draw.io is a JavaScript, client-side editor for general diagramming.
30.3.14 release
David Bensond13f3e78d813
diff --git a/ChangeLog b/ChangeLogindex f015c3a19..c0b4fc2ea 100644--- a/ChangeLog+++ b/ChangeLog@@ -1,3 +1,16 @@+17-JUL-2026: 30.3.14++- Replaces invalid transparent fill value with none in SVG export [jgraph/drawio#5563]+- Resolves light-dark colors for text fallbacks in SVG export+- Adds local file path and file URL support for library and template URLs in the desktop app [jgraph/drawio-desktop#1278]+- Adds NMOS and PMOS shapes with body diode to Electrical/Transistors [jgraph/drawio#5412]+- Adopts new file stat when content unchanged on watched file change [jgraph/drawio-desktop#2312]+- Caches picked fonts for saving SVG files with embedded fonts [jgraph/drawio#2886]+- Adds per-file option for embedding fonts in saved SVG files [jgraph/drawio#2886]+- Loads fonts before updating the file data in saves [jgraph/drawio#2886]+- Adds save support to the desktop unsaved changes close dialog [jgraph/drawio-desktop#2335]+- Looks through edges to keep occupied fixed points connectable [jgraph/drawio-desktop#1245]+16-JUL-2026: 30.3.13- Clarifies override help and separates toggle lists in Configuration dialogdiff --git a/VERSION b/VERSIONindex d53f44070..c7b7b64f0 100644--- a/VERSION+++ b/VERSION@@ -1 +1 @@-30.3.13\ No newline at end of file+30.3.14\ No newline at end of filediff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.jsindex 04a6a78c1..f3938de2e 100644--- a/src/main/webapp/js/app.min.js+++ b/src/main/webapp/js/app.min.js@@ -65,7 +65,7 @@ b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io")))})();"1"==urlPa"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ADD_ATTR:["target","content","pointer-events","requiredFeatures"]};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";-window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"30.3.13",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"30.3.14",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&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."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),IS_MT:0<=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."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!==document.createElementNS("http://www.w3.org/2000/svg","foreignObject").toString()||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),@@ -409,9 +409,9 @@ mxSvgCanvas2D.prototype.getAlternateTextLines=function(a,b,c,d,e,f){var g=this.sa[m].split(/\s+/),p="",q=0;q<n.length;q++)if(0<n[q].length){var r=0<p.length?p+" "+n[q]:n[q];for(0<p.length&&l.measureText(r).width>k?(b.push(p),p=n[q]):p=r;1<p.length&&l.measureText(p).width>k&&/[\u2E80-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF]/.test(p);){for(r=p.length-1;1<r&&l.measureText(p.substring(0,r)).width>k;)r--;b.push(p.substring(0,r));p=p.substring(r)}}b.push(p)}a=b}(f||"fill"==e)&&0<c&&(c=Math.max(1,Math.floor(c/Math.round(mxConstants.LINE_HEIGHT*g.fontSize))),a.length>c&&(a=a.slice(0,c),a[a.length-1]+="..."));if(f&&!d&&null!=l)for(m=0;m<a.length;m++)if(l.measureText(a[m]).width>k){for(r=a[m].length-1;1<r&&l.measureText(a[m].substring(0,r)+"...").width>k;)r--;a[m]=mxUtils.trim(a[m].substring(0,r))+"..."}return a};mxSvgCanvas2D.prototype.createAlternateContent=function(a,b,c,d,e,f,g,k,l,m,n,p,q){m=this.getAlternateText(a,b,c,d,e,f,g,k,l,m,n,p,q);a=this.state;if(null!=m&&0<a.fontSize){f=k==mxConstants.ALIGN_TOP?1:k==mxConstants.ALIGN_BOTTOM?0:.3;g=g==mxConstants.ALIGN_RIGHT?"end":g==mxConstants.ALIGN_LEFT?"start":"middle";d=this.getAlternateTextLines(m,d,e,l,n,p);e=Math.round(mxConstants.LINE_HEIGHT*a.fontSize);b=Math.round(b+a.dx);c=c+a.dy+f*a.fontSize-(k==mxConstants.ALIGN_TOP?0:k==mxConstants.ALIGN_BOTTOM?-(d.length-1)*e:(d.length-1)*e/2);k=this.createElement("text");k.setAttribute("x",b);k.setAttribute("y",Math.round(c));k.setAttribute("fill",a.fontColor||"black");k.setAttribute("font-family",mxUtils.parseCssFontFamily(a.fontFamily));k.setAttribute("font-size",Math.round(a.fontSize)+"px");"start"!=g&&k.setAttribute("text-anchor",g);(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&k.setAttribute("font-weight","bold");(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&k.setAttribute("font-style",-"italic");l=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&l.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&l.push("line-through");0<l.length&&(k.setAttribute("text-decoration",l.join(" ")),(a.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(k.style.textDecorationStyle="dotted"));if(1<d.length)for(a=0;a<d.length;a++)l=this.createElement("tspan"),l.setAttribute("x",b),l.setAttribute("y",Math.round(c+-a*e)),mxUtils.write(l,d[a]),k.appendChild(l);else mxUtils.write(k,d[0]);return k}return null};+(d.length-1)*e:(d.length-1)*e/2);l=this.getLightDarkColor(a.fontColor||"black");k=this.createElement("text");k.setAttribute("x",b);k.setAttribute("y",Math.round(c));"transparent"==l.light?k.setAttribute("fill","none"):(k.setAttribute("fill",l.light),k.style.fill=l.cssText);k.setAttribute("font-family",mxUtils.parseCssFontFamily(a.fontFamily));k.setAttribute("font-size",Math.round(a.fontSize)+"px");"start"!=g&&k.setAttribute("text-anchor",g);(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&+k.setAttribute("font-weight","bold");(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&k.setAttribute("font-style","italic");g=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&g.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&g.push("line-through");0<g.length&&(k.setAttribute("text-decoration",g.join(" ")),(a.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(k.style.textDecorationStyle=+"dotted"));if(1<d.length)for(a=0;a<d.length;a++)g=this.createElement("tspan"),g.setAttribute("x",b),g.setAttribute("y",Math.round(c+a*e)),mxUtils.write(g,d[a]),k.appendChild(g);else mxUtils.write(k,d[0]);return k}return null};mxSvgCanvas2D.prototype.createGradientId=function(a,b,c,d,e){a=a.toLowerCase()+"-"+c;b=b.toLowerCase()+"-"+d;c=null;null==e||e==mxConstants.DIRECTION_SOUTH?c="s":e==mxConstants.DIRECTION_EAST?c="e":e==mxConstants.DIRECTION_RADIAL?c="r":(d=a,a=b,b=d,e==mxConstants.DIRECTION_NORTH?c="s":e==mxConstants.DIRECTION_WEST&&(c="e"));return((""!=this.idPrefix?this.idPrefix:"mx")+"-gradient-"+a+"-"+b+"-"+c).replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};mxSvgCanvas2D.prototype.getSvgGradient=function(a,b,c,d,e){a=this.getLightDarkColor(a);b=this.getLightDarkColor(b);var f=this.createGradientId(a.cssText,b.cssText,c,d,e),g=this.gradients[f];if(null==g){var k=this.root.ownerSVGElement,l=0,m=f+"-"+l;if(null!=k)for(g=k.ownerDocument.getElementById(m);null!=g&&g.ownerSVGElement!=k;)m=f+"-"+l++,g=k.ownerDocument.getElementById(m);else m="id"+ ++this.refCount;null==g&&(g=this.createSvgGradient(a,b,c,d,e),g.setAttribute("id",m),null!=this.defs?this.defs.appendChild(g):k.appendChild(g));this.gradients[f]=g}return g.getAttribute("id")};@@ -434,8 +434,8 @@ mxSvgCanvas2D.prototype.addNode=function(a,b){var c=this.addTitle(this.node),d=tc.setAttribute("transform",d.transform);this.pointerEvents?c.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none");0<this.strokeTolerance&&(!a||null==d.fillColor||!mxShape.forceFilledPointerEvents&&!this.pointerEvents&&null==this.originalRoot)&&this.addTolerance(c);("rect"!=c.nodeName&&"path"!=c.nodeName&&"ellipse"!=c.nodeName||"none"!=c.getAttribute("fill")&&"transparent"!=c.getAttribute("fill")||"none"!=c.getAttribute("stroke")||"none"!=c.getAttribute("pointer-events"))&&this.root.appendChild(c);this.node=null}};mxSvgCanvas2D.prototype.getShadowFilter=function(){var a=this.state,b=a.shadowStyle;if(1!=a.scale){var c=b.split("(");if(0<c.length){var d=c[1].split(" ");3<d.length&&(b=function(e){return Math.round(parseFloat(d[e])*a.scale*100)/100+"px"},b=c[0]+"("+b(0)+" "+b(1)+" "+b(2)+" "+d.slice(3).join(" ")+(2<c.length?"("+c.slice(2).join("("):""))}}return b};mxSvgCanvas2D.prototype.addTolerance=function(a){this.root.appendChild(this.createTolerance(a))};mxSvgCanvas2D.prototype.updateFill=function(){var a=this.state;(1>a.alpha||1>a.fillAlpha)&&this.node.setAttribute("fill-opacity",a.alpha*a.fillAlpha);var b=!1;if(null!=a.fillColor)if(null!=a.gradientColor&&a.gradientColor!=mxConstants.NONE){b=!0;var c=this.getSvgGradient(String(a.fillColor),String(a.gradientColor),a.gradientFillAlpha,a.gradientAlpha,a.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c="url("+d+"#"+c+-")"}else c="url(#"+c+")";d=c}else c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText;var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill",-"url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};+")"}else c="url(#"+c+")";d=c}else String(a.fillColor).toLowerCase()==mxConstants.NONE?c=d="none":(c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText);var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,+"\\$1"),this.node.setAttribute("fill","url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};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 a=this.state,b=this.getLightDarkColor(String(a.strokeColor).toLowerCase());this.node.setAttribute("stroke",b.light);this.node.style.stroke=b.cssText;(1>a.alpha||1>a.strokeAlpha)&&this.node.setAttribute("stroke-opacity",a.alpha*a.strokeAlpha);b=this.getCurrentStrokeWidth();1!=b&&this.node.setAttribute("stroke-width",b);"path"==this.node.nodeName&&this.updateStrokeAttributes();a.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((a.fixDash?1:a.strokeWidth)*a.scale))};mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var a=this.state;null!=a.lineJoin&&"miter"!=a.lineJoin&&this.node.setAttribute("stroke-linejoin",a.lineJoin);if(null!=a.lineCap){var b=a.lineCap;"flat"==b&&(b="butt");"butt"!=b&&this.node.setAttribute("stroke-linecap",b)}null==a.miterLimit||this.styleEnabled&&10==a.miterLimit||this.node.setAttribute("stroke-miterlimit",a.miterLimit)};mxSvgCanvas2D.prototype.createDashPattern=function(a){var b=[];if("string"===typeof this.state.dashPattern){var c=this.state.dashPattern.split(" ");if(0<c.length)for(var d=0;d<c.length;d++)b[d]=Math.round(Number(c[d])*a*100)/100}return b.join(" ")};@@ -3099,60 +3099,60 @@ A=t.getCell;t.getCell=mxUtils.bind(this,function(B){var F=A.apply(this,argumentsB=0;B<A.length;B++)null!=this.currentEdgeStyle[A[B]]&&(t+=A[B]+"="+this.currentEdgeStyle[A[B]]+";");null!=this.currentEdgeStyle.orthogonalLoop?t+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(t+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?t+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(t+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(t+="elbow="+this.currentEdgeStyle.elbow+";");return t=null!=this.currentEdgeStyle.html?t+("html="+this.currentEdgeStyle.html+";"):t+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var t=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=t&&(new mxCodec(t.ownerDocument)).decode(t,this.getStylesheet())};Graph.prototype.createCellLookup=function(t,A){A=null!=A?A:{};for(var B=0;B<t.length;B++){var F=t[B];A[mxObjectIdentity.get(F)]=F.getId();for(var I=this.model.getChildCount(F),O=0;O<I;O++)this.createCellLookup([this.model.getChildAt(F,O)],A)}return A};Graph.prototype.createCellMapping=function(t,A,B){B=null!=B?B:{};for(var F in t){var I=A[F];null==B[I]&&(B[I]=t[F].getId()||"")}return B};Graph.prototype.importGraphModel=function(t,A,-B,F){A=null!=A?A:0;B=null!=B?B:0;var I=new mxCodec(t.ownerDocument),O=new mxGraphModel;I.decode(t,O);t=[];I={};var R={},ea=O.getChildren(this.cloneCell(O.root,this.isCloneInvalidEdges(),I));if(null!=ea){var ia=this.createCellLookup([O.root]);ea=ea.slice();this.model.beginUpdate();try{if(1!=ea.length||this.isCellLocked(this.getDefaultParent()))for(O=0;O<ea.length;O++)da=this.model.getChildren(this.moveCells([ea[O]],A,B,!1,this.model.getRoot())[0]),null!=da&&(t=t.concat(da));else{var da=O.getChildren(ea[0]);-null!=da&&(t=this.moveCells(da,A,B,!1,this.getDefaultParent()),R[O.getChildAt(O.root,0).getId()]=this.getDefaultParent().getId())}if(null!=t&&(this.createCellMapping(I,ia,R),this.updateCustomLinks(R,t),F)){this.isGridEnabled()&&(A=this.snap(A),B=this.snap(B));var za=this.getBoundingBoxFromGeometry(t,!0);null!=za&&this.moveCells(t,A-za.x,B-za.y)}}finally{this.model.endUpdate()}}return t};Graph.prototype.encodeCells=function(t){for(var A={},B=this.cloneCells(t,null,A),F=new mxDictionary,I=0;I<t.length;I++)F.put(t[I],-!0);var O=new mxCodec,R=new mxGraphModel,ea=R.getChildAt(R.getRoot(),0);for(I=0;I<B.length;I++){R.add(ea,B[I]);var ia=this.view.getState(t[I]);if(null!=ia){var da=this.getCellGeometry(B[I]);null!=da&&da.relative&&!this.model.isEdge(t[I])&&null==F.get(this.model.getParent(t[I]))&&(da.offset=null,da.relative=!1,da.x=ia.x/ia.view.scale-ia.view.translate.x,da.y=ia.y/ia.view.scale-ia.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(A,this.createCellLookup(t)),B);return O.encode(R)};Graph.prototype.isSwimlane=+B,F){A=null!=A?A:0;B=null!=B?B:0;var I=new mxCodec(t.ownerDocument),O=new mxGraphModel;I.decode(t,O);t=[];I={};var R={},da=O.getChildren(this.cloneCell(O.root,this.isCloneInvalidEdges(),I));if(null!=da){var ia=this.createCellLookup([O.root]);da=da.slice();this.model.beginUpdate();try{if(1!=da.length||this.isCellLocked(this.getDefaultParent()))for(O=0;O<da.length;O++)ea=this.model.getChildren(this.moveCells([da[O]],A,B,!1,this.model.getRoot())[0]),null!=ea&&(t=t.concat(ea));else{var ea=O.getChildren(da[0]);+null!=ea&&(t=this.moveCells(ea,A,B,!1,this.getDefaultParent()),R[O.getChildAt(O.root,0).getId()]=this.getDefaultParent().getId())}if(null!=t&&(this.createCellMapping(I,ia,R),this.updateCustomLinks(R,t),F)){this.isGridEnabled()&&(A=this.snap(A),B=this.snap(B));var za=this.getBoundingBoxFromGeometry(t,!0);null!=za&&this.moveCells(t,A-za.x,B-za.y)}}finally{this.model.endUpdate()}}return t};Graph.prototype.encodeCells=function(t){for(var A={},B=this.cloneCells(t,null,A),F=new mxDictionary,I=0;I<t.length;I++)F.put(t[I],+!0);var O=new mxCodec,R=new mxGraphModel,da=R.getChildAt(R.getRoot(),0);for(I=0;I<B.length;I++){R.add(da,B[I]);var ia=this.view.getState(t[I]);if(null!=ia){var ea=this.getCellGeometry(B[I]);null!=ea&&ea.relative&&!this.model.isEdge(t[I])&&null==F.get(this.model.getParent(t[I]))&&(ea.offset=null,ea.relative=!1,ea.x=ia.x/ia.view.scale-ia.view.translate.x,ea.y=ia.y/ia.view.scale-ia.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(A,this.createCellLookup(t)),B);return O.encode(R)};Graph.prototype.isSwimlane=function(t,A){var B=null;null==t||this.model.isEdge(t)||this.model.getParent(t)==this.model.getRoot()||(B=this.getCurrentCellStyle(t,A)[mxConstants.STYLE_SHAPE]);return B==mxConstants.SHAPE_SWIMLANE||"table"==B||"tableRow"==B};var k=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(t){return null!=t&&k.apply(this,arguments)?this.isTableCell(t)||this.isTableRow(t)?this.isCellEditable(this.model.getParent(t)):!0:!1};var p=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=function(t){return null!=t&&p.apply(this,arguments)?this.isTableCell(t)||this.isTableRow(t)?this.isCellMovable(this.model.getParent(t)):!0:!1};var l=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(t){var A=this.model.getParent(t);if(null!=A){var B=this.getCurrentCellStyle(A);if(null!=B.expand)return"0"!=B.expand}return l.apply(this,arguments)&&(null==A||!this.isTable(A))};var u=Graph.prototype.isContractParent;Graph.prototype.isContractParent=function(t){var A=this.model.getParent(t);-if(null!=A){var B=this.getCurrentCellStyle(A);if(null!=B.contract)return"0"!=B.contract}return u.apply(this,arguments)&&(null==A||!this.isTable(A))};var x=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(t,A,B,F,I,O,R,ea){null==ea&&(ea=this.model.getParent(t),this.isTable(ea)||this.isTableRow(ea))&&(ea=this.getCellAt(O,R,null,!0,!1));B=null;this.model.beginUpdate();try{var ia=this.getCellGeometry(t);if(null!=ia&&null!=ia.points&&0<ia.points.length&&1==A.length&&this.model.isVertex(A[0])){var da=-this.getCellGeometry(A[0]);if(null!=da&&!da.relative){var za=new mxRectangle(da.x+F,da.y+I,da.width,da.height),Fa=ia.points;da=[];for(var Ga=0;Ga<Fa.length;Ga++)za.intersectsPoint(Fa[Ga].x,Fa[Ga].y)||da.push(Fa[Ga]);da.length<Fa.length&&(ia=ia.clone(),ia.points=da,this.model.setGeometry(t,ia))}}B=x.apply(this,[t,A,B,F,I,O,R,ea]);this.model.setValue(B,"");var ca=this.getChildCells(B,!0);for(Ga=0;Ga<ca.length;Ga++)ia=this.getCellGeometry(ca[Ga]),null!=ia&&ia.relative&&0<ia.x&&this.model.remove(ca[Ga]);+if(null!=A){var B=this.getCurrentCellStyle(A);if(null!=B.contract)return"0"!=B.contract}return u.apply(this,arguments)&&(null==A||!this.isTable(A))};var x=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(t,A,B,F,I,O,R,da){null==da&&(da=this.model.getParent(t),this.isTable(da)||this.isTableRow(da))&&(da=this.getCellAt(O,R,null,!0,!1));B=null;this.model.beginUpdate();try{var ia=this.getCellGeometry(t);if(null!=ia&&null!=ia.points&&0<ia.points.length&&1==A.length&&this.model.isVertex(A[0])){var ea=+this.getCellGeometry(A[0]);if(null!=ea&&!ea.relative){var za=new mxRectangle(ea.x+F,ea.y+I,ea.width,ea.height),Fa=ia.points;ea=[];for(var Ga=0;Ga<Fa.length;Ga++)za.intersectsPoint(Fa[Ga].x,Fa[Ga].y)||ea.push(Fa[Ga]);ea.length<Fa.length&&(ia=ia.clone(),ia.points=ea,this.model.setGeometry(t,ia))}}B=x.apply(this,[t,A,B,F,I,O,R,da]);this.model.setValue(B,"");var ca=this.getChildCells(B,!0);for(Ga=0;Ga<ca.length;Ga++)ia=this.getCellGeometry(ca[Ga]),null!=ia&&ia.relative&&0<ia.x&&this.model.remove(ca[Ga]);var wa=this.getChildCells(t,!0);for(Ga=0;Ga<wa.length;Ga++)ia=this.getCellGeometry(wa[Ga]),null!=ia&&ia.relative&&0>=ia.x&&this.model.remove(wa[Ga]);var ya=this.model.getTerminal(B,!1);if(null!=ya){var Ia=this.getCurrentCellStyle(ya);null!=Ia&&"1"==Ia.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[t]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[t]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[B]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[B]))}}finally{this.model.endUpdate()}return B};-var w=Graph.prototype.selectCell;Graph.prototype.selectCell=function(t,A,B){if(A||B)w.apply(this,arguments);else{var F=this.getSelectionCell(),I=null,O=[],R=mxUtils.bind(this,function(ea){if(null!=this.view.getState(ea)&&(this.model.isVertex(ea)||this.model.isEdge(ea)))if(O.push(ea),ea==F)I=O.length-1;else if(t&&null==F&&0<O.length||null!=I&&t&&O.length>I||!t&&0<I)return;for(var ia=0;ia<this.model.getChildCount(ea);ia++)R(this.model.getChildAt(ea,ia))});R(this.model.root);0<O.length&&(I=null!=I?mxUtils.mod(I++var w=Graph.prototype.selectCell;Graph.prototype.selectCell=function(t,A,B){if(A||B)w.apply(this,arguments);else{var F=this.getSelectionCell(),I=null,O=[],R=mxUtils.bind(this,function(da){if(null!=this.view.getState(da)&&(this.model.isVertex(da)||this.model.isEdge(da)))if(O.push(da),da==F)I=O.length-1;else if(t&&null==F&&0<O.length||null!=I&&t&&O.length>I||!t&&0<I)return;for(var ia=0;ia<this.model.getChildCount(da);ia++)R(this.model.getChildAt(da,ia))});R(this.model.root);0<O.length&&(I=null!=I?mxUtils.mod(I+(t?1:-1),O.length):0,this.setSelectionCell(O[I]))}};Graph.prototype.swapShapes=function(t,A){if(this.model.isVertex(t)&&this.model.isVertex(A)&&2==this.getMovableCells([t,A]).length){var B=this.getCellGeometry(t),F=this.getCellGeometry(A);if(null!=B&&null!=F){var I=B.clone(),O=F.clone();this.model.beginUpdate();try{I.x=F.getCenterX()-B.width/2,I.y=F.getCenterY()-B.height/2,O.x=B.getCenterX()-F.width/2,O.y=B.getCenterY()-F.height/2,this.model.setGeometry(t,I),this.model.setGeometry(A,O)}finally{this.model.endUpdate()}}}};-var z=Graph.prototype.moveCells;Graph.prototype.moveCells=function(t,A,B,F,I,O,R){R=null!=R?R:{};if(this.isTable(I)){for(var ea=[],ia=0;ia<t.length;ia++)this.isTable(t[ia])?ea=ea.concat(this.model.getChildCells(t[ia],!0).reverse()):ea.push(t[ia]);t=ea}this.model.beginUpdate();try{ea=[];for(ia=0;ia<t.length;ia++)if(null!=I&&this.isTableRow(t[ia])){var da=this.model.getParent(t[ia]),za=this.getCellGeometry(t[ia]);this.isTable(da)&&ea.push(da);if(null!=da&&null!=za&&this.isTable(da)&&this.isTable(I)&&-(F||da!=I)){if(!F){var Fa=this.getCellGeometry(da);null!=Fa&&(Fa=Fa.clone(),Fa.height-=za.height,this.model.setGeometry(da,Fa))}Fa=this.getCellGeometry(I);null!=Fa&&(Fa=Fa.clone(),Fa.height+=za.height,this.model.setGeometry(I,Fa));var Ga=this.model.getChildCells(I,!0);if(0<Ga.length){t[ia]=F?this.cloneCell(t[ia]):t[ia];var ca=this.model.getChildCells(t[ia],!0),wa=this.model.getChildCells(Ga[0],!0),ya=wa.length-ca.length;if(0<ya)for(var Ia=0;Ia<ya;Ia++){var Ca=this.cloneCell(ca[ca.length-1]);null!=-Ca&&(Ca.value="",this.model.add(t[ia],Ca))}else if(0>ya)for(Ia=0;Ia>ya;Ia--)this.model.remove(ca[ca.length+Ia-1]);ca=this.model.getChildCells(t[ia],!0);for(Ia=0;Ia<wa.length;Ia++){var Ka=this.getCellGeometry(wa[Ia]),Da=this.getCellGeometry(ca[Ia]);null!=Ka&&null!=Da&&(Da=Da.clone(),Da.width=Ka.width,this.model.setGeometry(ca[Ia],Da))}}}}var Ya=z.apply(this,arguments);for(ia=0;ia<ea.length;ia++)!F&&this.model.contains(ea[ia])&&0==this.model.getChildCount(ea[ia])&&this.model.remove(ea[ia]);F&&this.updateCustomLinks(this.createCellMapping(R,+var z=Graph.prototype.moveCells;Graph.prototype.moveCells=function(t,A,B,F,I,O,R){R=null!=R?R:{};if(this.isTable(I)){for(var da=[],ia=0;ia<t.length;ia++)this.isTable(t[ia])?da=da.concat(this.model.getChildCells(t[ia],!0).reverse()):da.push(t[ia]);t=da}this.model.beginUpdate();try{da=[];for(ia=0;ia<t.length;ia++)if(null!=I&&this.isTableRow(t[ia])){var ea=this.model.getParent(t[ia]),za=this.getCellGeometry(t[ia]);this.isTable(ea)&&da.push(ea);if(null!=ea&&null!=za&&this.isTable(ea)&&this.isTable(I)&&+(F||ea!=I)){if(!F){var Fa=this.getCellGeometry(ea);null!=Fa&&(Fa=Fa.clone(),Fa.height-=za.height,this.model.setGeometry(ea,Fa))}Fa=this.getCellGeometry(I);null!=Fa&&(Fa=Fa.clone(),Fa.height+=za.height,this.model.setGeometry(I,Fa));var Ga=this.model.getChildCells(I,!0);if(0<Ga.length){t[ia]=F?this.cloneCell(t[ia]):t[ia];var ca=this.model.getChildCells(t[ia],!0),wa=this.model.getChildCells(Ga[0],!0),ya=wa.length-ca.length;if(0<ya)for(var Ia=0;Ia<ya;Ia++){var Ca=this.cloneCell(ca[ca.length-1]);null!=+Ca&&(Ca.value="",this.model.add(t[ia],Ca))}else if(0>ya)for(Ia=0;Ia>ya;Ia--)this.model.remove(ca[ca.length+Ia-1]);ca=this.model.getChildCells(t[ia],!0);for(Ia=0;Ia<wa.length;Ia++){var Ka=this.getCellGeometry(wa[Ia]),Da=this.getCellGeometry(ca[Ia]);null!=Ka&&null!=Da&&(Da=Da.clone(),Da.width=Ka.width,this.model.setGeometry(ca[Ia],Da))}}}}var Ya=z.apply(this,arguments);for(ia=0;ia<da.length;ia++)!F&&this.model.contains(da[ia])&&0==this.model.getChildCount(da[ia])&&this.model.remove(da[ia]);F&&this.updateCustomLinks(this.createCellMapping(R,this.createCellLookup(t)),Ya)}finally{this.model.endUpdate()}return Ya};var D=Graph.prototype.removeCells;Graph.prototype.removeCells=function(t,A){var B=[];this.model.beginUpdate();try{for(var F=0;F<t.length;F++)if(this.isTableCell(t[F])){var I=this.model.getParent(t[F]),O=this.model.getParent(I);1==this.model.getChildCount(I)&&1==this.model.getChildCount(O)?0>mxUtils.indexOf(t,O)&&0>mxUtils.indexOf(B,O)&&B.push(O):this.labelChanged(t[F],"")}else{if(this.isTableRow(t[F])&&(O=this.model.getParent(t[F]),-0>mxUtils.indexOf(t,O)&&0>mxUtils.indexOf(B,O))){for(var R=this.model.getChildCells(O,!0),ea=0,ia=0;ia<R.length;ia++)0<=mxUtils.indexOf(t,R[ia])&&ea++;ea==R.length&&B.push(O)}B.push(t[F])}B=D.apply(this,[B,A])}finally{this.model.endUpdate()}return B};Graph.prototype.updateCustomLinks=function(t,A,B){B=null!=B?B:new Graph;for(var F=0;F<A.length;F++)null!=A[F]&&B.updateCustomLinksForCell(t,A[F],B)};Graph.prototype.updateCustomLinksForCell=function(t,A){this.doUpdateCustomLinksForCell(t,A);for(var B=+0>mxUtils.indexOf(t,O)&&0>mxUtils.indexOf(B,O))){for(var R=this.model.getChildCells(O,!0),da=0,ia=0;ia<R.length;ia++)0<=mxUtils.indexOf(t,R[ia])&&da++;da==R.length&&B.push(O)}B.push(t[F])}B=D.apply(this,[B,A])}finally{this.model.endUpdate()}return B};Graph.prototype.updateCustomLinks=function(t,A,B){B=null!=B?B:new Graph;for(var F=0;F<A.length;F++)null!=A[F]&&B.updateCustomLinksForCell(t,A[F],B)};Graph.prototype.updateCustomLinksForCell=function(t,A){this.doUpdateCustomLinksForCell(t,A);for(var B=this.model.getChildCount(A),F=0;F<B;F++)this.updateCustomLinksForCell(t,this.model.getChildAt(A,F))};Graph.prototype.doUpdateCustomLinksForCell=function(t,A){};Graph.prototype.getAllConnectionConstraints=function(t,A){if(null!=t){A=mxUtils.getValue(t.style,"points",null);if(null!=A){t=[];try{var B=JSON.parse(A);for(A=0;A<B.length;A++){var F=B[A];t.push(new mxConnectionConstraint(new mxPoint(F[0],F[1]),2<F.length?"0"!=F[2]:!0,null,3<F.length?F[3]:0,4<F.length?F[4]:0))}}catch(O){}return t}if(null!=t.shape&&null!=t.shape.bounds){F=t.shape.direction;A=t.shape.bounds;var I=t.shape.scale;B=A.width/I;A=A.height/I;if(F==mxConstants.DIRECTION_NORTH||F==mxConstants.DIRECTION_SOUTH)F=B,B=A,A=F;A=t.shape.getConstraints(t.style,B,A);if(null!=A)return A;if(null!=t.shape.stencil&&null!=t.shape.stencil.constraints)return t.shape.stencil.constraints;if(null!=t.shape.constraints)return t.shape.constraints}}return null};Graph.prototype.flipEdge=function(t){if(null!=t){var A=this.getCurrentCellStyle(t);A=mxUtils.getValue(A,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,A,[t])}};var G=Graph.prototype.resetEdge;Graph.prototype.resetEdge=function(t){null!=t&&this.setCellStyles("innerLoopWaypoints",null,[t]);return G.apply(this,arguments)};var E=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(t,A){if(null!=t){var B=t.getVisibleTerminalState(!0),F=t.getVisibleTerminalState(!1);-if(null!=B&&B==F){B=this.createEdgeSegmentHandler(t);var I=B.changePoints,O=B.getPreviewPoints,R=B.updatePreviewState,ea=B.clonePreviewState;B.getPreviewPoints=function(da){if(!this.isSource&&!this.isTarget){var za=this.getCurrentPoints();return null!=za&&4==za.length&&1<this.index&&this.index<za.length-1&&(za=this.graph.getLoopAroundPoints(this.state,da),null!=za)?this.graph.keepLoopOutsideShape(this.state,za):this.graph.keepLoopOutsideShape(this.state,O.apply(this,arguments))}return O.apply(this,-arguments)};B.clonePreviewState=function(da,za){var Fa=ea.apply(this,arguments);this.isSource||this.isTarget||null==Fa||null==Fa.style||(Fa.style[mxConstants.STYLE_EDGE]="orthogonalEdgeStyle",Fa.style.innerLoopWaypoints="1");return Fa};B.changePoints=function(da,za,Fa){za=this.graph.keepLoopOutsideShape(this.state,za);var Ga=this.graph.getModel();Ga.beginUpdate();try{da=I.call(this,da,za,Fa),null!=da&&null!=za&&2<=za.length&&(this.graph.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[da]),-this.graph.setCellStyles("innerLoopWaypoints","1",[da]))}finally{Ga.endUpdate()}return da};var ia=B.start;B.start=function(da,za,Fa){this.validLoopPoints=null;ia.apply(this,arguments)};B.rerouteLoopPreview=function(da){var za=this.state.getVisibleTerminalState(!0),Fa=this.state.getVisibleTerminalState(!1);da.view.updateFixedTerminalPoints(da,za,Fa);da.view.updatePoints(da,this.points,za,Fa);da.view.updateFloatingTerminalPoints(da,za,Fa)};B.getCommittedLoopPoints=function(){var da=this.graph.getCellGeometry(this.state.cell);-if(null!=da&&null!=da.points&&2<=da.points.length)return da.points.map(function(ya){return new mxPoint(ya.x,ya.y)});da=this.state.absolutePoints;if(null!=da&&4<=da.length){for(var za=this.state.view.scale,Fa=this.state.view.translate,Ga=this.state.origin,ca=[],wa=1;wa<da.length-1;wa++)null!=da[wa]&&ca.push(new mxPoint(da[wa].x/za-Fa.x-Ga.x,da[wa].y/za-Fa.y-Ga.y));if(2<=ca.length)return ca}return null};B.isLoopSpike=function(da){da=da.absolutePoints;if(null==da||2>da.length||null==da[0]||null==da[da.length--1])return!0;var za=this.graph.gridSize*this.state.view.scale/2;return Math.abs(da[0].x-da[da.length-1].x)<za&&Math.abs(da[0].y-da[da.length-1].y)<za};B.updatePreviewState=function(da,za,Fa,Ga,ca){this.isSource||this.isTarget||null!=this.validLoopPoints||(this.validLoopPoints=this.getCommittedLoopPoints());R.apply(this,arguments);if(!this.isSource&&!this.isTarget){if(null!=this.points&&2==this.points.length&&0==Math.round(this.points[0].x-this.points[1].x)&&0==Math.round(this.points[0].y-this.points[1].y)){var wa=-this.graph.getLoopAroundPoints(this.state,za);null!=wa&&(this.points=this.graph.keepLoopOutsideShape(this.state,wa),this.rerouteLoopPreview(da))}this.isLoopSpike(da)?null!=this.validLoopPoints&&(this.points=this.validLoopPoints.map(function(ya){return new mxPoint(ya.x,ya.y)}),this.rerouteLoopPreview(da)):null!=this.points&&2<=this.points.length&&(this.validLoopPoints=this.points.map(function(ya){return new mxPoint(ya.x,ya.y)}))}};return B}}return E.apply(this,arguments)};Graph.prototype.isValidRoot=+if(null!=B&&B==F){B=this.createEdgeSegmentHandler(t);var I=B.changePoints,O=B.getPreviewPoints,R=B.updatePreviewState,da=B.clonePreviewState;B.getPreviewPoints=function(ea){if(!this.isSource&&!this.isTarget){var za=this.getCurrentPoints();return null!=za&&4==za.length&&1<this.index&&this.index<za.length-1&&(za=this.graph.getLoopAroundPoints(this.state,ea),null!=za)?this.graph.keepLoopOutsideShape(this.state,za):this.graph.keepLoopOutsideShape(this.state,O.apply(this,arguments))}return O.apply(this,+arguments)};B.clonePreviewState=function(ea,za){var Fa=da.apply(this,arguments);this.isSource||this.isTarget||null==Fa||null==Fa.style||(Fa.style[mxConstants.STYLE_EDGE]="orthogonalEdgeStyle",Fa.style.innerLoopWaypoints="1");return Fa};B.changePoints=function(ea,za,Fa){za=this.graph.keepLoopOutsideShape(this.state,za);var Ga=this.graph.getModel();Ga.beginUpdate();try{ea=I.call(this,ea,za,Fa),null!=ea&&null!=za&&2<=za.length&&(this.graph.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[ea]),+this.graph.setCellStyles("innerLoopWaypoints","1",[ea]))}finally{Ga.endUpdate()}return ea};var ia=B.start;B.start=function(ea,za,Fa){this.validLoopPoints=null;ia.apply(this,arguments)};B.rerouteLoopPreview=function(ea){var za=this.state.getVisibleTerminalState(!0),Fa=this.state.getVisibleTerminalState(!1);ea.view.updateFixedTerminalPoints(ea,za,Fa);ea.view.updatePoints(ea,this.points,za,Fa);ea.view.updateFloatingTerminalPoints(ea,za,Fa)};B.getCommittedLoopPoints=function(){var ea=this.graph.getCellGeometry(this.state.cell);+if(null!=ea&&null!=ea.points&&2<=ea.points.length)return ea.points.map(function(ya){return new mxPoint(ya.x,ya.y)});ea=this.state.absolutePoints;if(null!=ea&&4<=ea.length){for(var za=this.state.view.scale,Fa=this.state.view.translate,Ga=this.state.origin,ca=[],wa=1;wa<ea.length-1;wa++)null!=ea[wa]&&ca.push(new mxPoint(ea[wa].x/za-Fa.x-Ga.x,ea[wa].y/za-Fa.y-Ga.y));if(2<=ca.length)return ca}return null};B.isLoopSpike=function(ea){ea=ea.absolutePoints;if(null==ea||2>ea.length||null==ea[0]||null==ea[ea.length-+1])return!0;var za=this.graph.gridSize*this.state.view.scale/2;return Math.abs(ea[0].x-ea[ea.length-1].x)<za&&Math.abs(ea[0].y-ea[ea.length-1].y)<za};B.updatePreviewState=function(ea,za,Fa,Ga,ca){this.isSource||this.isTarget||null!=this.validLoopPoints||(this.validLoopPoints=this.getCommittedLoopPoints());R.apply(this,arguments);if(!this.isSource&&!this.isTarget){if(null!=this.points&&2==this.points.length&&0==Math.round(this.points[0].x-this.points[1].x)&&0==Math.round(this.points[0].y-this.points[1].y)){var wa=+this.graph.getLoopAroundPoints(this.state,za);null!=wa&&(this.points=this.graph.keepLoopOutsideShape(this.state,wa),this.rerouteLoopPreview(ea))}this.isLoopSpike(ea)?null!=this.validLoopPoints&&(this.points=this.validLoopPoints.map(function(ya){return new mxPoint(ya.x,ya.y)}),this.rerouteLoopPreview(ea)):null!=this.points&&2<=this.points.length&&(this.validLoopPoints=this.points.map(function(ya){return new mxPoint(ya.x,ya.y)}))}};return B}}return E.apply(this,arguments)};Graph.prototype.isValidRoot=function(t){for(var A=this.model.getChildCount(t),B=0,F=0;F<A;F++){var I=this.model.getChildAt(t,F);this.model.isVertex(I)&&(I=this.getCellGeometry(I),null==I||I.relative||B++)}return 0<B||this.isContainer(t)};Graph.prototype.isValidDropTarget=function(t,A,B){for(var F=this.getCurrentCellStyle(t),I=!0,O=!0,R=0;R<A.length&&O;R++)I=I&&this.isTable(A[R]),O=O&&this.isTableRow(A[R]);return!this.isCellLocked(t)&&null==this.getLockedGroupAncestor(t)&&(this.isTargetShape(t,A,B)||("1"!=mxUtils.getValue(F,"part","0")||this.isContainer(t))&&"0"!=mxUtils.getValue(F,"dropTarget","1")&&(mxGraph.prototype.isValidDropTarget.apply(this,arguments)||this.isContainer(t))&&!this.isTableRow(t)&&(!this.isTable(t)||O||I))};Graph.prototype.createGroupCell=function(){var t=mxGraph.prototype.createGroupCell.apply(this,arguments);t.setStyle("group");return t};var H=Graph.prototype.translateCell;Graph.prototype.translateCell=function(t,A,B){if(this.isTransparentBounds(t))for(var F=this.model.getChildCount(t),I=0;I<F;I++)this.translateCell(this.model.getChildAt(t,I),A,B);else H.apply(this,arguments)};var K=Graph.prototype.groupCells;Graph.prototype.groupCells=function(t,A,B){if(null!=t&&this.isTransparentBounds(t)){null==B&&(B=mxUtils.sortCells(this.getSelectionCells(),!0));B=this.getCellsForGroup(B);if(0<B.length){var F=this.model.getParent(t);null==F&&(F=this.model.getParent(B[0]));this.model.beginUpdate();try{this.model.setGeometry(t,new mxGeometry(0,0,0,0));var I=this.model.getChildCount(F);this.cellsAdded([t],F,I,null,null,!1,!1,!1);I=this.model.getChildCount(t);this.cellsAdded(B,t,I,null,null,!1,!1,!1);this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",A,"cells",B))}finally{this.model.endUpdate()}}return t}return K.apply(this,arguments)};Graph.prototype.isExtendParentsOnAdd=function(t){var A=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(A&&null!=t&&null!=this.layoutManager){var B=this.model.getParent(t);null!=B&&(B=this.layoutManager.getLayout(B),null!=B&&B.constructor==mxStackLayout&&(A=!1))}return A};Graph.prototype.getPreferredSizeForCell=function(t,A,B){B=null!=B?B:this.gridEnabled;var F=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=F&&(F.width+=10,F.height+=4,B&&(F.width=this.snap(F.width),F.height=this.snap(F.height)));return F};Graph.prototype.getAutosizeTextAvailableSpace=function(t,A,B,F){var I=0,O=0;(null!=F&&null!=this.getImage(F)||null!=t[mxConstants.STYLE_IMAGE])&&t[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&(t[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(I+=parseFloat(mxUtils.getValue(t,mxConstants.STYLE_IMAGE_WIDTH,mxLabel.prototype.imageSize))),t[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(O+=parseFloat(mxUtils.getValue(t,mxConstants.STYLE_IMAGE_HEIGHT,mxLabel.prototype.imageSize))));I+=2*parseFloat(mxUtils.getValue(t,mxConstants.STYLE_SPACING,2));I+=parseFloat(mxUtils.getValue(t,mxConstants.STYLE_SPACING_LEFT,2));I+=parseFloat(mxUtils.getValue(t,mxConstants.STYLE_SPACING_RIGHT,2));O+=2*parseFloat(mxUtils.getValue(t,mxConstants.STYLE_SPACING,2));O+=parseFloat(mxUtils.getValue(t,-mxConstants.STYLE_SPACING_TOP,2));O+=parseFloat(mxUtils.getValue(t,mxConstants.STYLE_SPACING_BOTTOM,2));null!=F&&(F=this.getFoldingImage(F),null!=F&&(I+=F.width+8));t=mxUtils.getValue(t,mxConstants.STYLE_HORIZONTAL,!0);I=(t?A:B)-I;A=(t?B:A)-O;return 0>=I||0>=A?null:{availW:I,availH:A}};Graph.prototype.computeAutosizeTextFontSize=function(t,A,B,F,I,O){var R=1,ea=84,ia=O?A:null,da=null;if(O){for(var za=t.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Fa=[],Ga=0;Ga<za.length;Ga++)0<-za[Ga].length&&Fa.push(mxUtils.htmlEntities(za[Ga],!1));0<Fa.length&&(da=Fa.join("<br>"))}for(;R<ea;)za=Math.ceil((R+ea)/2),Fa=mxUtils.getSizeForString(t,za,F,ia,I),(Fa=O?Fa.height<=B:Fa.width<=A&&Fa.height<=B)&&O&&null!=da&&mxUtils.getSizeForString(da,za,F,null,I).width>A&&(Fa=!1),Fa?R=za:ea=za-1;return Math.max(6,R)};Graph.prototype.updateAutosizeTextFontSize=function(t,A){var B=this.view.getState(t);null==B&&(B=this.view.createState(t));A=A||B.style;var F=this.getCellGeometry(t);if(null!=F&&!this.model.isEdge(t)){var I=+mxConstants.STYLE_SPACING_TOP,2));O+=parseFloat(mxUtils.getValue(t,mxConstants.STYLE_SPACING_BOTTOM,2));null!=F&&(F=this.getFoldingImage(F),null!=F&&(I+=F.width+8));t=mxUtils.getValue(t,mxConstants.STYLE_HORIZONTAL,!0);I=(t?A:B)-I;A=(t?B:A)-O;return 0>=I||0>=A?null:{availW:I,availH:A}};Graph.prototype.computeAutosizeTextFontSize=function(t,A,B,F,I,O){var R=1,da=84,ia=O?A:null,ea=null;if(O){for(var za=t.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Fa=[],Ga=0;Ga<za.length;Ga++)0<+za[Ga].length&&Fa.push(mxUtils.htmlEntities(za[Ga],!1));0<Fa.length&&(ea=Fa.join("<br>"))}for(;R<da;)za=Math.ceil((R+da)/2),Fa=mxUtils.getSizeForString(t,za,F,ia,I),(Fa=O?Fa.height<=B:Fa.width<=A&&Fa.height<=B)&&O&&null!=ea&&mxUtils.getSizeForString(ea,za,F,null,I).width>A&&(Fa=!1),Fa?R=za:da=za-1;return Math.max(6,R)};Graph.prototype.updateAutosizeTextFontSize=function(t,A){var B=this.view.getState(t);null==B&&(B=this.view.createState(t));A=A||B.style;var F=this.getCellGeometry(t);if(null!=F&&!this.model.isEdge(t)){var I=this.cellRenderer.getLabelValue(B);null!=I&&0!=I.length&&(B=this.getAutosizeTextAvailableSpace(A,F.width,F.height,B),null!=B&&(this.isHtmlLabel(t)||(I=mxUtils.htmlEntities(I,!1)),I=I.replace(/\n/g,"<br>"),A=this.computeAutosizeTextFontSize(I,B.availW,B.availH,A[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,A[mxConstants.STYLE_FONTSTYLE],"wrap"==A[mxConstants.STYLE_WHITE_SPACE]),this.setCellStyles(mxConstants.STYLE_FONTSIZE,A,[t])))}};Graph.prototype.cellsResized=function(t,A,B){var F=mxGraph.prototype.cellsResized.apply(this,arguments);if(null!=t)for(var I=0;I<t.length;I++)this.model.isVertex(t[I])&&this.isAutosizeTextCell(t[I])&&this.updateAutosizeTextFontSize(t[I]);return F};Graph.prototype.isRotatableGroup=function(t){var A=this.getModel();return A.isVertex(t)&&0<A.getChildCount(t)&&!this.isTable(t)&&!this.isTableRow(t)&&!this.isTableCell(t)&&!this.isSwimlane(t)};Graph.prototype.setCellRotation=function(t,A){var B=parseFloat(A);!isNaN(B)&&this.isRotatableGroup(t)?this.rotateCell(t,B-(parseFloat(this.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATION])||0)):this.setCellStyles(mxConstants.STYLE_ROTATION,A,[t])};Graph.prototype.rotateCell=function(t,A,B){if(0!=A){var F=this.getModel();if(F.isVertex(t)||F.isEdge(t)){F.beginUpdate();try{if(!F.isEdge(t)){var I=(this.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATION]||0)+A;this.setCellStyles(mxConstants.STYLE_ROTATION,I,[t])}var O=this.getCellGeometry(t);if(null!=O){var R=this.getCellGeometry(B);null==R||F.isEdge(B)||(O=O.clone(),-O.rotate(A,new mxPoint(R.width/2,R.height/2)),F.setGeometry(t,O));if(F.isVertex(t)&&!O.relative||F.isEdge(t)){var ea=F.getChildCount(t);for(B=0;B<ea;B++)this.rotateCell(F.getChildAt(t,B),A,t)}}}finally{F.endUpdate()}}}};Graph.prototype.isRotatedGroupResize=function(t){return this.isRotatableGroup(t)&&0!=mxUtils.mod(parseFloat(this.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATION])||0,360)};var M=Graph.prototype.resizeChildCells;Graph.prototype.resizeChildCells=function(t,A){if(this.isRotatedGroupResize(t)){var B=-parseFloat(this.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATION])||0;this.resizeRotatedGroupChildren(t,this.model.getGeometry(t),A,B,B)}else M.apply(this,arguments)};Graph.prototype.resizeRotatedGroupChildren=function(t,A,B,F,I){var O=this.getModel(),R=0!=A.width?B.width/A.width:1,ea=0!=A.height?B.height/A.height:1,ia=mxUtils.toRadians(F),da=Math.cos(-ia),za=Math.sin(-ia);ia=mxUtils.toRadians(I);var Fa=Math.cos(ia),Ga=Math.sin(ia),ca=A.width/2,wa=A.height/2,ya=B.width/2,Ia=B.height/2,Ca=function(gb,-sb){var hb=da*(gb-ca)-za*(sb-wa);gb=za*(gb-ca)+da*(sb-wa);hb*=R;gb*=ea;return new mxPoint(ya+Fa*hb-Ga*gb,Ia+Ga*hb+Fa*gb)};A=function(gb){if(null!=gb)for(var sb=0;sb<gb.length;sb++)if(null!=gb[sb]){var hb=Ca(gb[sb].x,gb[sb].y);gb[sb].x=hb.x;gb[sb].y=hb.y}};B=O.getChildCount(t);for(ia=0;ia<B;ia++){var Ka=O.getChildAt(t,ia),Da=this.getCellGeometry(Ka);if(null!=Da)if(O.isEdge(Ka))Da=Da.clone(),A([Da.sourcePoint,Da.targetPoint]),A(Da.points),O.setGeometry(Ka,Da);else if(O.isVertex(Ka)&&!Da.relative){var Ya=-this.getCurrentCellStyle(Ka),Za=parseFloat(Ya[mxConstants.STYLE_ROTATION])||0,Ta=mxUtils.toRadians(Za-F),bb=R*Math.cos(Ta),ib=ea*Math.sin(Ta),nb=Math.sqrt(bb*bb+ib*ib);Ta=Math.sqrt(R*R*Math.sin(Ta)*Math.sin(Ta)+ea*ea*Math.cos(Ta)*Math.cos(Ta));"fixed"==Ya[mxConstants.STYLE_ASPECT]&&(nb=Ta=Math.min(nb,Ta));var Wa=Ca(Da.getCenterX(),Da.getCenterY()),cb=Da;Da=Da.clone();var lb=Za;this.isCellResizable(Ka)&&("0"!=Ya[mxConstants.STYLE_RESIZE_WIDTH]&&(Da.width=cb.width*nb),"0"!=Ya[mxConstants.STYLE_RESIZE_HEIGHT]&&-(Da.height=cb.height*Ta),lb=Math.round(100*(I+mxUtils.toDegree(Math.atan2(ib,bb))))/100);this.isCellMovable(Ka)&&(Da.x=Wa.x-Da.width/2,Da.y=Wa.y-Da.height/2);O.setGeometry(Ka,Da);.01<Math.abs(mxUtils.mod(lb,360)-mxUtils.mod(Za,360))?this.setCellStyles(mxConstants.STYLE_ROTATION,mxUtils.mod(lb,360),[Ka]):lb=Za;this.resizeRotatedGroupChildren(Ka,cb,Da,Za,lb)}else this.scaleCell(Ka,R,ea,!0)}};Graph.prototype.turnShapes=function(t,A){var B=this.getModel(),F=[];B.beginUpdate();try{for(var I=0;I<t.length;I++){var O=-t[I];if(B.isEdge(O)){var R=B.getTerminal(O,!0),ea=B.getTerminal(O,!1);if(null!=R&&R==ea){var ia=this.view.getState(O),da=B.getGeometry(O);if(null!=ia&&null!=da&&null!=ia.absolutePoints&&4<=ia.absolutePoints.length&&(null==da.points||2>da.points.length)&&null==ia.style[mxConstants.STYLE_EXIT_X]&&null==ia.style[mxConstants.STYLE_ENTRY_X]){for(var za=this.view.scale,Fa=this.view.translate,Ga=ia.origin,ca=ia.absolutePoints,wa=[],ya=1;ya<ca.length-1;ya++)null!=ca[ya]&&wa.push(new mxPoint(ca[ya].x/za-Fa.x--Ga.x,ca[ya].y/za-Fa.y-Ga.y));2<=wa.length&&(da=da.clone(),da.points=wa,B.setGeometry(O,da),this.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[O]),this.setCellStyles("innerLoopWaypoints","1",[O]))}}B.setTerminal(O,ea,!0);B.setTerminal(O,R,!1);var Ia=B.getGeometry(O);if(null!=Ia){Ia=Ia.clone();null!=Ia.points&&Ia.points.reverse();var Ca=Ia.getTerminalPoint(!0),Ka=Ia.getTerminalPoint(!1);Ia.setTerminalPoint(Ca,!1);Ia.setTerminalPoint(Ka,!0);B.setGeometry(O,Ia);var Da=this.view.getState(O),-Ya=this.view.getState(R),Za=this.view.getState(ea);if(null!=Da){var Ta=null!=Ya?this.getConnectionConstraint(Da,Ya,!0):null,bb=null!=Za?this.getConnectionConstraint(Da,Za,!1):null;this.setConnectionConstraint(O,R,!0,bb);this.setConnectionConstraint(O,ea,!1,Ta);var ib=mxUtils.getValue(Da.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Da.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[O]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,+O.rotate(A,new mxPoint(R.width/2,R.height/2)),F.setGeometry(t,O));if(F.isVertex(t)&&!O.relative||F.isEdge(t)){var da=F.getChildCount(t);for(B=0;B<da;B++)this.rotateCell(F.getChildAt(t,B),A,t)}}}finally{F.endUpdate()}}}};Graph.prototype.isRotatedGroupResize=function(t){return this.isRotatableGroup(t)&&0!=mxUtils.mod(parseFloat(this.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATION])||0,360)};var M=Graph.prototype.resizeChildCells;Graph.prototype.resizeChildCells=function(t,A){if(this.isRotatedGroupResize(t)){var B=+parseFloat(this.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATION])||0;this.resizeRotatedGroupChildren(t,this.model.getGeometry(t),A,B,B)}else M.apply(this,arguments)};Graph.prototype.resizeRotatedGroupChildren=function(t,A,B,F,I){var O=this.getModel(),R=0!=A.width?B.width/A.width:1,da=0!=A.height?B.height/A.height:1,ia=mxUtils.toRadians(F),ea=Math.cos(-ia),za=Math.sin(-ia);ia=mxUtils.toRadians(I);var Fa=Math.cos(ia),Ga=Math.sin(ia),ca=A.width/2,wa=A.height/2,ya=B.width/2,Ia=B.height/2,Ca=function(gb,+sb){var hb=ea*(gb-ca)-za*(sb-wa);gb=za*(gb-ca)+ea*(sb-wa);hb*=R;gb*=da;return new mxPoint(ya+Fa*hb-Ga*gb,Ia+Ga*hb+Fa*gb)};A=function(gb){if(null!=gb)for(var sb=0;sb<gb.length;sb++)if(null!=gb[sb]){var hb=Ca(gb[sb].x,gb[sb].y);gb[sb].x=hb.x;gb[sb].y=hb.y}};B=O.getChildCount(t);for(ia=0;ia<B;ia++){var Ka=O.getChildAt(t,ia),Da=this.getCellGeometry(Ka);if(null!=Da)if(O.isEdge(Ka))Da=Da.clone(),A([Da.sourcePoint,Da.targetPoint]),A(Da.points),O.setGeometry(Ka,Da);else if(O.isVertex(Ka)&&!Da.relative){var Ya=+this.getCurrentCellStyle(Ka),Za=parseFloat(Ya[mxConstants.STYLE_ROTATION])||0,Ta=mxUtils.toRadians(Za-F),bb=R*Math.cos(Ta),ib=da*Math.sin(Ta),nb=Math.sqrt(bb*bb+ib*ib);Ta=Math.sqrt(R*R*Math.sin(Ta)*Math.sin(Ta)+da*da*Math.cos(Ta)*Math.cos(Ta));"fixed"==Ya[mxConstants.STYLE_ASPECT]&&(nb=Ta=Math.min(nb,Ta));var Wa=Ca(Da.getCenterX(),Da.getCenterY()),cb=Da;Da=Da.clone();var lb=Za;this.isCellResizable(Ka)&&("0"!=Ya[mxConstants.STYLE_RESIZE_WIDTH]&&(Da.width=cb.width*nb),"0"!=Ya[mxConstants.STYLE_RESIZE_HEIGHT]&&+(Da.height=cb.height*Ta),lb=Math.round(100*(I+mxUtils.toDegree(Math.atan2(ib,bb))))/100);this.isCellMovable(Ka)&&(Da.x=Wa.x-Da.width/2,Da.y=Wa.y-Da.height/2);O.setGeometry(Ka,Da);.01<Math.abs(mxUtils.mod(lb,360)-mxUtils.mod(Za,360))?this.setCellStyles(mxConstants.STYLE_ROTATION,mxUtils.mod(lb,360),[Ka]):lb=Za;this.resizeRotatedGroupChildren(Ka,cb,Da,Za,lb)}else this.scaleCell(Ka,R,da,!0)}};Graph.prototype.turnShapes=function(t,A){var B=this.getModel(),F=[];B.beginUpdate();try{for(var I=0;I<t.length;I++){var O=+t[I];if(B.isEdge(O)){var R=B.getTerminal(O,!0),da=B.getTerminal(O,!1);if(null!=R&&R==da){var ia=this.view.getState(O),ea=B.getGeometry(O);if(null!=ia&&null!=ea&&null!=ia.absolutePoints&&4<=ia.absolutePoints.length&&(null==ea.points||2>ea.points.length)&&null==ia.style[mxConstants.STYLE_EXIT_X]&&null==ia.style[mxConstants.STYLE_ENTRY_X]){for(var za=this.view.scale,Fa=this.view.translate,Ga=ia.origin,ca=ia.absolutePoints,wa=[],ya=1;ya<ca.length-1;ya++)null!=ca[ya]&&wa.push(new mxPoint(ca[ya].x/za-Fa.x-+Ga.x,ca[ya].y/za-Fa.y-Ga.y));2<=wa.length&&(ea=ea.clone(),ea.points=wa,B.setGeometry(O,ea),this.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[O]),this.setCellStyles("innerLoopWaypoints","1",[O]))}}B.setTerminal(O,da,!0);B.setTerminal(O,R,!1);var Ia=B.getGeometry(O);if(null!=Ia){Ia=Ia.clone();null!=Ia.points&&Ia.points.reverse();var Ca=Ia.getTerminalPoint(!0),Ka=Ia.getTerminalPoint(!1);Ia.setTerminalPoint(Ca,!1);Ia.setTerminalPoint(Ka,!0);B.setGeometry(O,Ia);var Da=this.view.getState(O),+Ya=this.view.getState(R),Za=this.view.getState(da);if(null!=Da){var Ta=null!=Ya?this.getConnectionConstraint(Da,Ya,!0):null,bb=null!=Za?this.getConnectionConstraint(Da,Za,!1):null;this.setConnectionConstraint(O,R,!0,bb);this.setConnectionConstraint(O,da,!1,Ta);var ib=mxUtils.getValue(Da.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Da.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[O]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,ib,[O])}F.push(O)}}else if(B.isVertex(O))if(this.isRotatableGroup(O))this.rotateCell(O,A?-90:90),F.push(O);else if(Ia=this.getCellGeometry(O),null!=Ia){if(!(this.isTable(O)||this.isTableRow(O)||this.isTableCell(O)||this.isSwimlane(O))){Ia=Ia.clone();Ia.x+=Ia.width/2-Ia.height/2;Ia.y+=Ia.height/2-Ia.width/2;var nb=Ia.width;Ia.width=Ia.height;Ia.height=nb;B.setGeometry(O,Ia)}var Wa=this.view.getState(O);if(null!=Wa){var cb=[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],lb=mxUtils.getValue(Wa.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);this.setCellStyles(mxConstants.STYLE_DIRECTION,cb[mxUtils.mod(mxUtils.indexOf(cb,lb)+(A?-1:1),cb.length)],[O])}F.push(O)}}}finally{B.endUpdate()}return F};Graph.prototype.rotateEdges=function(t,A){var B=this.getModel(),F=[];B.beginUpdate();try{for(var I=0;I<t.length;I++){var O=t[I];if(B.isEdge(O)&&!this.isCellLocked(O)&&null==B.getTerminal(O,!0)&&null==B.getTerminal(O,!1)){var R=B.getGeometry(O);-if(null!=R&&null!=R.getTerminalPoint(!0)&&null!=R.getTerminalPoint(!1)){R=R.clone();var ea=[R.getTerminalPoint(!0),R.getTerminalPoint(!1)];null!=R.points&&(ea=ea.concat(R.points));for(var ia=ea[0].x,da=ea[0].y,za=ea[0].x,Fa=ea[0].y,Ga=1;Ga<ea.length;Ga++)ia=Math.min(ia,ea[Ga].x),da=Math.min(da,ea[Ga].y),za=Math.max(za,ea[Ga].x),Fa=Math.max(Fa,ea[Ga].y);var ca=(ia+za)/2,wa=(da+Fa)/2;for(Ga=0;Ga<ea.length;Ga++){var ya=ea[Ga].x-ca,Ia=ea[Ga].y-wa;ea[Ga].x=A?ca+Ia:ca-Ia;ea[Ga].y=A?wa-ya:wa+ya}B.setGeometry(O,+if(null!=R&&null!=R.getTerminalPoint(!0)&&null!=R.getTerminalPoint(!1)){R=R.clone();var da=[R.getTerminalPoint(!0),R.getTerminalPoint(!1)];null!=R.points&&(da=da.concat(R.points));for(var ia=da[0].x,ea=da[0].y,za=da[0].x,Fa=da[0].y,Ga=1;Ga<da.length;Ga++)ia=Math.min(ia,da[Ga].x),ea=Math.min(ea,da[Ga].y),za=Math.max(za,da[Ga].x),Fa=Math.max(Fa,da[Ga].y);var ca=(ia+za)/2,wa=(ea+Fa)/2;for(Ga=0;Ga<da.length;Ga++){var ya=da[Ga].x-ca,Ia=da[Ga].y-wa;da[Ga].x=A?ca+Ia:ca-Ia;da[Ga].y=A?wa-ya:wa+ya}B.setGeometry(O,R);F.push(O)}}}}finally{B.endUpdate()}return F};Graph.prototype.stencilHasPlaceholders=function(t){if(null!=t&&null!=t.fgNode)for(t=t.fgNode.firstChild;null!=t;){if("text"==t.nodeName&&"1"==t.getAttribute("placeholders"))return!0;t=t.nextSibling}return!1};var Q=Graph.prototype.processChange;Graph.prototype.processChange=function(t){if(t instanceof mxGeometryChange&&(this.isTableCell(t.cell)||this.isTableRow(t.cell))&&(null==t.previous&&null!=t.geometry||null!=t.previous&&(null==t.previous.equals||!t.previous.equals(t.geometry)))){var A=t.cell;this.isTableCell(A)&&(A=this.model.getParent(A));this.isTableRow(A)&&(A=this.model.getParent(A));var B=this.view.getState(A);null!=B&&null!=B.shape&&(this.view.invalidate(A),B.shape.bounds=null)}Q.apply(this,arguments);t instanceof mxValueChange&&null!=t.cell&&null!=t.cell.value&&"object"==typeof t.cell.value&&this.invalidateDescendantsWithPlaceholders(t.cell)};Graph.prototype.invalidateDescendantsWithPlaceholders=function(t){t=this.model.getDescendants(t);if(0<t.length)for(var A=0;A<t.length;A++){var B=this.view.getState(t[A]);null!=B&&null!=B.shape&&null!=B.shape.stencil&&this.stencilHasPlaceholders(B.shape.stencil)?this.removeStateForCell(t[A]):this.isReplacePlaceholders(t[A])&&this.view.invalidate(t[A],!1,!1)}};Graph.prototype.replaceElement=function(t,A){A=t.ownerDocument.createElement(null!=A?A:"span");for(var B=Array.prototype.slice.call(t.attributes);attr=B.pop();)A.setAttribute(attr.nodeName,attr.nodeValue);A.innerHTML=t.innerHTML;t.parentNode.replaceChild(A,-t)};Graph.prototype.processElements=function(t,A){if(null!=t){t=t.getElementsByTagName("*");for(var B=0;B<t.length;B++)null!=t[B]&&A(t[B])}};Graph.prototype.updateLabelElements=function(t,A,B){t=null!=t?t:this.getSelectionCells();for(var F=document.createElement("div"),I=0;I<t.length;I++){var O=this.getCurrentCellStyle(t[I]);if(null!=O&&"1"==O.html&&(O=this.convertValueToString(t[I]),null!=O&&0<O.length)){F.innerHTML=Graph.sanitizeHtml(O);for(var R=F.getElementsByTagName(null!=B?B:"*"),ea=0;ea<R.length;ea++)A(R[ea]);+t)};Graph.prototype.processElements=function(t,A){if(null!=t){t=t.getElementsByTagName("*");for(var B=0;B<t.length;B++)null!=t[B]&&A(t[B])}};Graph.prototype.updateLabelElements=function(t,A,B){t=null!=t?t:this.getSelectionCells();for(var F=document.createElement("div"),I=0;I<t.length;I++){var O=this.getCurrentCellStyle(t[I]);if(null!=O&&"1"==O.html&&(O=this.convertValueToString(t[I]),null!=O&&0<O.length)){F.innerHTML=Graph.sanitizeHtml(O);for(var R=F.getElementsByTagName(null!=B?B:"*"),da=0;da<R.length;da++)A(R[da]);F.innerHTML!=O&&this.cellLabelChanged(t[I],F.innerHTML)}}};Graph.prototype.cellLabelChanged=function(t,A,B){A=Graph.zapGremlins(A);this.model.beginUpdate();try{if(null!=t.value&&"object"==typeof t.value){if(this.isReplacePlaceholders(t)&&null!=t.getAttribute("placeholder"))for(var F=t.getAttribute("placeholder"),I=t;null!=I;){if(I==this.model.getRoot()||null!=I.value&&"object"==typeof I.value&&I.hasAttribute(F)){this.setAttributeForCell(I,F,A);break}I=this.model.getParent(I)}var O=t.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&O.hasAttribute("label_"+Graph.diagramLanguage)?O.setAttribute("label_"+Graph.diagramLanguage,A):O.setAttribute("label",A);A=O}mxGraph.prototype.cellLabelChanged.apply(this,arguments);this.isAutosizeTextCell(t)&&this.updateAutosizeTextFontSize(t)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(t){if(null!=t){for(var A=new mxDictionary,B=0;B<t.length;B++)A.put(t[B],!0);var F=[];for(B=0;B<t.length;B++){var I=this.model.getParent(t[B]);null==I||A.get(I)||(A.put(I,!0),F.push(I))}for(B=0;B<F.length;B++)if(I=this.view.getState(F[B]),null!=I&&(this.model.isEdge(I.cell)||this.model.isVertex(I.cell))&&this.isCellDeletable(I.cell)&&(this.isTransparentState(I)||this.isTransparentBounds(I.cell))){for(var O=!0,R=0;R<this.model.getChildCount(I.cell)&&O;R++)A.get(this.model.getChildAt(I.cell,R))||(O=!1);O&&t.push(I.cell)}A=new mxDictionary;for(B=0;B<t.length;B++)A.put(t[B],!0);for(B=0;B<F.length;B++)for(I=F[B];!A.get(I)&&this.isTransparentBounds(I);){O=-null;var ea=!1,ia=this.model.getChildCount(I);for(R=0;R<ia;R++){var da=this.model.getChildAt(I,R);if(!A.get(da)){if(null!=O){ea=!0;break}O=da}}if(ea||null==O||!this.isTransparentBounds(O)||!this.isCellDeletable(O))break;R=this.model.getChildren(O);null!=R&&0<R.length&&this.cellsAdded(R.slice(),I,this.model.getChildCount(I),null,null,!0);A.put(O,!0);t.push(O)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(t){for(var A=[],B=0;B<t.length;B++)this.isCellDeletable(t[B])&&+null;var da=!1,ia=this.model.getChildCount(I);for(R=0;R<ia;R++){var ea=this.model.getChildAt(I,R);if(!A.get(ea)){if(null!=O){da=!0;break}O=ea}}if(da||null==O||!this.isTransparentBounds(O)||!this.isCellDeletable(O))break;R=this.model.getChildren(O);null!=R&&0<R.length&&this.cellsAdded(R.slice(),I,this.model.getChildCount(I),null,null,!0);A.put(O,!0);t.push(O)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(t){for(var A=[],B=0;B<t.length;B++)this.isCellDeletable(t[B])&&this.isTransparentState(this.view.getState(t[B]))&&A.push(t[B]);t=A;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(t,A){this.setAttributeForCell(t,"link",A)};Graph.prototype.createLinkOverlay=function(t){var A=this.getLinkForCell(t);if(null!=A&&0<A.length){var B=this.getLinkOverlayTooltip(A);B=new mxCellOverlay(new mxImage(Editor.lightDarkLinkImage,16,16),B,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,new mxPoint(8,-8));B.isLinkOverlay=!0;var F=this;B.addListener(mxEvent.CLICK,mxUtils.bind(this,function(I,O){F.isEnabled()?F.setSelectionCell(O.getProperty("cell")):this.isCustomLink(A)?this.customLinkClicked(A,t):(I=this.getLinkTargetForCell(t),this.openLink(this.getAbsoluteUrl(A),I))}));return B}return null};Graph.prototype.getLinkOverlayTooltip=function(t){return t};Graph.prototype.createTooltipOverlay=function(t){t=this.convertValueToTooltip(t);if(null!=t&&0<t.length){t=new mxCellOverlay(new mxImage(Editor.lightDarkTooltipImage,16,16),t,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,new mxPoint(-8,-8));t.isTooltipOverlay=!0;var A=this;t.addListener(mxEvent.CLICK,function(B,F){B=F.getProperty("cell");A.isEnabled()&&A.isCellEditable(B)?(A.setSelectionCell(B),A.editTooltip(B)):(F=F.getProperty("event"),B=A.getTooltipForCell(B),null!=B&&0<B.length&&A.tooltipHandler.show(B,F.clientX,F.clientY))});return t}return null};Graph.prototype.editTooltip=function(t){};Graph.prototype.setTooltipForCell=function(t,A){var B="tooltip";Graph.translateDiagram&&@@ -3166,37 +3166,37 @@ this.view.translate.x,B=this.container.scrollTop/this.view.scale-this.view.trans2/this.view.scale-this.view.translate.x-t.width/2)),this.snap(Math.round(this.container.clientHeight/2/this.view.scale-this.view.translate.y-t.height/2)))};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.appendFontSize=function(t,A){t=null!=t?t:"";null!=A&&(0<t.length&&";"!=t.charAt(t.length-1)&&(t+=";"),t+="fontSize="+A+";");return t};Graph.prototype.addText=function(t,A,B){var F=new mxCell;F.value="Text";F.geometry=new mxGeometry(0,0,0,0);F.vertex=!0;if(null!=B&&this.model.isEdge(B.cell)){F.style="edgeLabel;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.edgeFontSize);F.geometry.relative=!0;F.connectable=!1;var I=this.view.getRelativePoint(B,t,A);F.geometry.x=Math.round(1E4*I.x)/1E4;F.geometry.y=Math.round(I.y);F.geometry.offset=new mxPoint(0,0);I=this.view.getPoint(B,F.geometry);var O=this.view.scale;F.geometry.offset=new mxPoint(Math.round((t-I.x)/O),Math.round((A-I.y)/O))}else I=this.view.translate,F.style="text;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.vertexFontSize),F.geometry.width=40,F.geometry.height=20,F.geometry.x=Math.round(t/this.view.scale)-I.x-(null!=B?B.origin.x:0),F.geometry.y=Math.round(A/this.view.scale)-I.y-(null!=B?B.origin.y:0),F.style+="autosize=1;";this.getModel().beginUpdate();try{this.addCells([F],null!=B?B.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[F])),this.autoSizeCell(F)}finally{this.getModel().endUpdate()}return F};Graph.prototype.addClickHandler=function(t,A,B){var F=mxUtils.bind(this,function(){var ia=-this.container.getElementsByTagName("a");if(null!=ia)for(var da=0;da<ia.length;da++){var za=this.getAbsoluteUrl(ia[da].getAttribute("href"));null!=za&&(ia[da].setAttribute("rel",this.linkRelation),ia[da].setAttribute("href",za),null!=A&&mxEvent.addGestureListeners(ia[da],null,null,A))}});this.model.addListener(mxEvent.CHANGE,F);F();var I=this.container.style.cursor,O=this.getTolerance(),R=this,ea={currentState:null,currentLink:null,currentTarget:null,highlight:null!=t&&""!=t&&t!=mxConstants.NONE?-new mxCellHighlight(R,t,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(ia){var da=ia.sourceState;if(null==da||null==R.getLinkForCell(da.cell))ia=R.getCellAt(ia.getGraphX(),ia.getGraphY(),null,null,null,function(za,Fa,Ga){return null==R.getLinkForCell(za.cell)}),da=null==da||R.model.isAncestor(ia,da.cell)?R.view.getState(ia):null;da!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=da,null!=this.currentState&&this.activate(this.currentState))},-mouseDown:function(ia,da){this.startX=da.getGraphX();this.startY=da.getGraphY();this.scrollLeft=R.container.scrollLeft;this.scrollTop=R.container.scrollTop;null==this.currentLink&&"auto"==R.container.style.overflow&&(R.container.style.cursor="move");this.updateCurrentState(da)},mouseMove:function(ia,da){if(R.isMouseDown)null!=this.currentLink&&(ia=Math.abs(this.startX-da.getGraphX()),da=Math.abs(this.startY-da.getGraphY()),(ia>O||da>O)&&this.clear());else{for(ia=da.getSource();null!=ia&&"a"!=ia.nodeName.toLowerCase();)ia=-ia.parentNode;null!=ia?this.clear():(null!=R.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&R.tooltipHandler.reset(da,!0,this.currentState),(null==this.currentState||da.getState()!=this.currentState&&null!=da.sourceState||!R.intersects(this.currentState,da.getGraphX(),da.getGraphY()))&&this.updateCurrentState(da))}},mouseUp:function(ia,da){var za=da.getSource();for(ia=da.getEvent();null!=za&&"a"!=za.nodeName.toLowerCase();)za=za.parentNode;null==za&&Math.abs(this.scrollLeft-R.container.scrollLeft)<-O&&Math.abs(this.scrollTop-R.container.scrollTop)<O&&(null==da.sourceState||!da.isSource(da.sourceState.control))&&((mxEvent.isLeftMouseButton(ia)||mxEvent.isMiddleMouseButton(ia))&&!mxEvent.isPopupTrigger(ia)||mxEvent.isTouchEvent(ia))&&(null!=this.currentLink?(za=R.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&za||null==A||A(ia,this.currentLink,null!=this.currentState?this.currentState.cell:null),mxEvent.isConsumed(ia)||(ia=null!=this.currentTarget?this.currentTarget:-mxEvent.isMiddleMouseButton(ia)?"_blank":za?R.linkTarget:"_top",R.openLink(this.currentLink,ia),da.consume())):null!=B&&!da.isConsumed()&&Math.abs(this.scrollLeft-R.container.scrollLeft)<O&&Math.abs(this.scrollTop-R.container.scrollTop)<O&&Math.abs(this.startX-da.getGraphX())<O&&Math.abs(this.startY-da.getGraphY())<O&&B(da.getEvent()));this.clear()},activate:function(ia){this.currentLink=R.getAbsoluteUrl(R.getLinkForCell(ia.cell));null!=this.currentLink&&(this.currentTarget=R.getLinkTargetForCell(ia.cell),-R.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(ia))},clear:function(){null!=R.container&&(R.container.style.cursor=I);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=R.tooltipHandler&&R.tooltipHandler.hide()}};R.click=function(ia){};R.addMouseListener(ea);mxEvent.addListener(document,"mouseleave",function(ia){ea.clear()})};Graph.prototype.duplicateCells=function(t,A){t=null!=t?t:this.getSelectionCells();-A=null!=A?A:!0;for(var B=0;B<t.length;B++)this.isTableCell(t[B])&&(t[B]=this.model.getParent(t[B]));t=this.model.getTopmostCells(t);var F=this.getModel(),I=this.gridSize,O=[];F.beginUpdate();try{var R={},ea=this.createCellLookup(t),ia=this.cloneCells(t,!1,R,!0);for(B=0;B<t.length;B++){var da=F.getParent(t[B]);if(null!=da){var za=this.moveCells([ia[B]],I,I,!1)[0];O.push(za);if(A)F.add(da,ia[B]);else{var Fa=da.getIndex(t[B]);F.add(da,ia[B],Fa+1)}if(this.isTable(da)){var Ga=this.getCellGeometry(ia[B]),-ca=this.getCellGeometry(da);null!=Ga&&null!=ca&&(ca=ca.clone(),ca.height+=Ga.height,F.setGeometry(da,ca))}}else O.push(ia[B])}this.updateCustomLinks(this.createCellMapping(R,ea),ia,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",ia))}finally{F.endUpdate()}return O};Graph.prototype.insertImage=function(t,A,B){if(null!=t&&null!=this.cellEditor.textarea){for(var F=this.cellEditor.textarea.getElementsByTagName("img"),I=[],O=0;O<F.length;O++)I.push(F[O]);document.execCommand("insertimage",+this.container.getElementsByTagName("a");if(null!=ia)for(var ea=0;ea<ia.length;ea++){var za=this.getAbsoluteUrl(ia[ea].getAttribute("href"));null!=za&&(ia[ea].setAttribute("rel",this.linkRelation),ia[ea].setAttribute("href",za),null!=A&&mxEvent.addGestureListeners(ia[ea],null,null,A))}});this.model.addListener(mxEvent.CHANGE,F);F();var I=this.container.style.cursor,O=this.getTolerance(),R=this,da={currentState:null,currentLink:null,currentTarget:null,highlight:null!=t&&""!=t&&t!=mxConstants.NONE?+new mxCellHighlight(R,t,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(ia){var ea=ia.sourceState;if(null==ea||null==R.getLinkForCell(ea.cell))ia=R.getCellAt(ia.getGraphX(),ia.getGraphY(),null,null,null,function(za,Fa,Ga){return null==R.getLinkForCell(za.cell)}),ea=null==ea||R.model.isAncestor(ia,ea.cell)?R.view.getState(ia):null;ea!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=ea,null!=this.currentState&&this.activate(this.currentState))},+mouseDown:function(ia,ea){this.startX=ea.getGraphX();this.startY=ea.getGraphY();this.scrollLeft=R.container.scrollLeft;this.scrollTop=R.container.scrollTop;null==this.currentLink&&"auto"==R.container.style.overflow&&(R.container.style.cursor="move");this.updateCurrentState(ea)},mouseMove:function(ia,ea){if(R.isMouseDown)null!=this.currentLink&&(ia=Math.abs(this.startX-ea.getGraphX()),ea=Math.abs(this.startY-ea.getGraphY()),(ia>O||ea>O)&&this.clear());else{for(ia=ea.getSource();null!=ia&&"a"!=ia.nodeName.toLowerCase();)ia=+ia.parentNode;null!=ia?this.clear():(null!=R.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&R.tooltipHandler.reset(ea,!0,this.currentState),(null==this.currentState||ea.getState()!=this.currentState&&null!=ea.sourceState||!R.intersects(this.currentState,ea.getGraphX(),ea.getGraphY()))&&this.updateCurrentState(ea))}},mouseUp:function(ia,ea){var za=ea.getSource();for(ia=ea.getEvent();null!=za&&"a"!=za.nodeName.toLowerCase();)za=za.parentNode;null==za&&Math.abs(this.scrollLeft-R.container.scrollLeft)<+O&&Math.abs(this.scrollTop-R.container.scrollTop)<O&&(null==ea.sourceState||!ea.isSource(ea.sourceState.control))&&((mxEvent.isLeftMouseButton(ia)||mxEvent.isMiddleMouseButton(ia))&&!mxEvent.isPopupTrigger(ia)||mxEvent.isTouchEvent(ia))&&(null!=this.currentLink?(za=R.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&za||null==A||A(ia,this.currentLink,null!=this.currentState?this.currentState.cell:null),mxEvent.isConsumed(ia)||(ia=null!=this.currentTarget?this.currentTarget:+mxEvent.isMiddleMouseButton(ia)?"_blank":za?R.linkTarget:"_top",R.openLink(this.currentLink,ia),ea.consume())):null!=B&&!ea.isConsumed()&&Math.abs(this.scrollLeft-R.container.scrollLeft)<O&&Math.abs(this.scrollTop-R.container.scrollTop)<O&&Math.abs(this.startX-ea.getGraphX())<O&&Math.abs(this.startY-ea.getGraphY())<O&&B(ea.getEvent()));this.clear()},activate:function(ia){this.currentLink=R.getAbsoluteUrl(R.getLinkForCell(ia.cell));null!=this.currentLink&&(this.currentTarget=R.getLinkTargetForCell(ia.cell),+R.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(ia))},clear:function(){null!=R.container&&(R.container.style.cursor=I);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=R.tooltipHandler&&R.tooltipHandler.hide()}};R.click=function(ia){};R.addMouseListener(da);mxEvent.addListener(document,"mouseleave",function(ia){da.clear()})};Graph.prototype.duplicateCells=function(t,A){t=null!=t?t:this.getSelectionCells();+A=null!=A?A:!0;for(var B=0;B<t.length;B++)this.isTableCell(t[B])&&(t[B]=this.model.getParent(t[B]));t=this.model.getTopmostCells(t);var F=this.getModel(),I=this.gridSize,O=[];F.beginUpdate();try{var R={},da=this.createCellLookup(t),ia=this.cloneCells(t,!1,R,!0);for(B=0;B<t.length;B++){var ea=F.getParent(t[B]);if(null!=ea){var za=this.moveCells([ia[B]],I,I,!1)[0];O.push(za);if(A)F.add(ea,ia[B]);else{var Fa=ea.getIndex(t[B]);F.add(ea,ia[B],Fa+1)}if(this.isTable(ea)){var Ga=this.getCellGeometry(ia[B]),+ca=this.getCellGeometry(ea);null!=Ga&&null!=ca&&(ca=ca.clone(),ca.height+=Ga.height,F.setGeometry(ea,ca))}}else O.push(ia[B])}this.updateCustomLinks(this.createCellMapping(R,da),ia,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",ia))}finally{F.endUpdate()}return O};Graph.prototype.insertImage=function(t,A,B){if(null!=t&&null!=this.cellEditor.textarea){for(var F=this.cellEditor.textarea.getElementsByTagName("img"),I=[],O=0;O<F.length;O++)I.push(F[O]);document.execCommand("insertimage",!1,t);t=this.cellEditor.textarea.getElementsByTagName("img");if(t.length==I.length+1)for(O=t.length-1;0<=O;O--)if(0==O||t[O]!=I[O-1]){t[O].setAttribute("width",A);t[O].setAttribute("height",B);break}}};Graph.prototype.insertLink=function(t){if(null!=this.cellEditor.textarea)if(0==t.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var A=this.cellEditor.textarea.getElementsByTagName("a"),B=[],F=0;F<A.length;F++)B.push(A[F]);document.execCommand("createlink",!1,mxUtils.trim(t));A=this.cellEditor.textarea.getElementsByTagName("a");if(A.length==B.length+1)for(F=A.length-1;0<=F;F--)if(A[F]!=B[F-1]){for(A=A[F].getElementsByTagName("a");0<A.length;){for(B=A[0].parentNode;null!=A[0].firstChild;)B.insertBefore(A[0].firstChild,A[0]);B.removeChild(A[0])}break}}else document.execCommand("createlink",!1,mxUtils.trim(t))};var S=Graph.prototype.getResizableCells;Graph.prototype.getResizableCells=function(t){var A=S.apply(this,arguments);if(null!=t)for(var B=0;B<t.length;B++)(this.isTransparentBounds(t[B])||this.getCurrentCellStyle(t[B])[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE)&&0>mxUtils.indexOf(A,t[B])&&A.push(t[B]);return A};Graph.prototype.isCellResizable=function(t){if(this.isTransparentBounds(t))return!1;var A=mxGraph.prototype.isCellResizable.apply(this,arguments),B=this.getCurrentCellStyle(t);return!this.isTableCell(t)&&!this.isTableRow(t)&&(A||"0"!=mxUtils.getValue(B,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==B[mxConstants.STYLE_WHITE_SPACE])};Graph.prototype.alignCells=function(t,A,B){null==A&&(A=this.getMovableCells(this.getSelectionCells()));var F=!1;if(null!=A)for(var I=0;I<A.length;I++)if(this.isTransparentBounds(A[I])){F=!0;break}if(!F)return mxGraph.prototype.alignCells.apply(this,arguments);var O=this;F=function(za){if(O.model.isEdge(za))return null;var Fa=O.getCellGeometry(za);if(null==Fa||Fa.relative)return null;var Ga=O.getOriginForCell(za);return O.isTransparentBounds(za)?(za=O.getTransparentBounds(za),null==za?null:new mxRectangle(Ga.x+Fa.x+za.x,Ga.y+Fa.y+za.y,za.width,za.height)):new mxRectangle(Ga.x+Fa.x,Ga.y+Fa.y,Fa.width,Fa.height)};if(null!=A&&1<A.length){if(null==B)for(I=0;I<A.length;I++){var R=F(A[I]);if(null!=R)if(null==B)if(t==mxConstants.ALIGN_CENTER){B=R.x+R.width/2;break}else if(t==mxConstants.ALIGN_RIGHT)B=R.x+R.width;else if(t==mxConstants.ALIGN_TOP)B=R.y;else if(t==mxConstants.ALIGN_MIDDLE){B=R.y+R.height/2;break}else B=t==mxConstants.ALIGN_BOTTOM?R.y+R.height:R.x;else B=t==mxConstants.ALIGN_RIGHT?Math.max(B,R.x+R.width):t==mxConstants.ALIGN_TOP?-Math.min(B,R.y):t==mxConstants.ALIGN_BOTTOM?Math.max(B,R.y+R.height):Math.min(B,R.x)}if(null!=B){A=mxUtils.sortCells(A);this.model.beginUpdate();try{for(I=0;I<A.length;I++)if(R=F(A[I]),null!=R){var ea=0,ia=0;t==mxConstants.ALIGN_CENTER?ea=B-(R.x+R.width/2):t==mxConstants.ALIGN_RIGHT?ea=B-(R.x+R.width):t==mxConstants.ALIGN_TOP?ia=B-R.y:t==mxConstants.ALIGN_MIDDLE?ia=B-(R.y+R.height/2):t==mxConstants.ALIGN_BOTTOM?ia=B-(R.y+R.height):ea=B-R.x;if(0!=ea||0!=ia)if(this.isTransparentBounds(A[I]))this.translateCell(A[I],-ea,ia);else{var da=this.getCellGeometry(A[I]).clone();da.x+=ea;da.y+=ia;this.resizeCell(A[I],da)}}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",t,"cells",A))}finally{this.model.endUpdate()}}}return A};Graph.prototype.distributeCells=function(t,A,B){null==A&&(A=this.getSelectionCells());if(null!=A&&1<A.length){for(var F=[],I=null,O=null,R=0,ea=0;ea<A.length;ea++)if(this.getModel().isVertex(A[ea])){var ia=this.view.getState(A[ea]);if(null!=ia){var da=t?ia.getCenterX():ia.getCenterY();-I=null!=I?Math.max(I,da):da;O=null!=O?Math.min(O,da):da;B&&(R+=t?ia.width:ia.height);F.push(ia)}}if(2<F.length){F.sort(function(ya,Ia){return t?ya.x-Ia.x:ya.y-Ia.y});B&&(R-=t?F[0].width/2+F[F.length-1].width/2:F[0].height/2+F[F.length-1].height/2);ia=this.view.translate;da=this.view.scale;O=O/da-(t?ia.x:ia.y);I=I/da-(t?ia.x:ia.y);this.getModel().beginUpdate();try{var za=(I-O-R)/(F.length-1),Fa=O+(B?t?F[0].width/2:F[0].height/2:0);for(ea=1;ea<F.length-1;ea++){var Ga=this.view.getState(this.model.getParent(F[ea].cell)),-ca=this.getCellGeometry(F[ea].cell);Fa+=za;if(null!=ca&&null!=Ga)if(this.isTransparentBounds(F[ea].cell)){var wa=t?B?F[ea].x/da-ia.x:F[ea].getCenterX()/da-ia.x:B?F[ea].y/da-ia.y:F[ea].getCenterY()/da-ia.y;t?this.translateCell(F[ea].cell,Fa-wa,0):this.translateCell(F[ea].cell,0,Fa-wa)}else ca=ca.clone(),t?ca.x=Math.round(Fa-(B?0:ca.width/2))-Ga.origin.x:ca.y=Math.round(Fa-(B?0:ca.height/2))-Ga.origin.y,this.getModel().setGeometry(F[ea].cell,ca);B&&(Fa+=t?F[ea].width:F[ea].height)}}finally{this.getModel().endUpdate()}}}return A};+Math.min(B,R.y):t==mxConstants.ALIGN_BOTTOM?Math.max(B,R.y+R.height):Math.min(B,R.x)}if(null!=B){A=mxUtils.sortCells(A);this.model.beginUpdate();try{for(I=0;I<A.length;I++)if(R=F(A[I]),null!=R){var da=0,ia=0;t==mxConstants.ALIGN_CENTER?da=B-(R.x+R.width/2):t==mxConstants.ALIGN_RIGHT?da=B-(R.x+R.width):t==mxConstants.ALIGN_TOP?ia=B-R.y:t==mxConstants.ALIGN_MIDDLE?ia=B-(R.y+R.height/2):t==mxConstants.ALIGN_BOTTOM?ia=B-(R.y+R.height):da=B-R.x;if(0!=da||0!=ia)if(this.isTransparentBounds(A[I]))this.translateCell(A[I],+da,ia);else{var ea=this.getCellGeometry(A[I]).clone();ea.x+=da;ea.y+=ia;this.resizeCell(A[I],ea)}}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",t,"cells",A))}finally{this.model.endUpdate()}}}return A};Graph.prototype.distributeCells=function(t,A,B){null==A&&(A=this.getSelectionCells());if(null!=A&&1<A.length){for(var F=[],I=null,O=null,R=0,da=0;da<A.length;da++)if(this.getModel().isVertex(A[da])){var ia=this.view.getState(A[da]);if(null!=ia){var ea=t?ia.getCenterX():ia.getCenterY();+I=null!=I?Math.max(I,ea):ea;O=null!=O?Math.min(O,ea):ea;B&&(R+=t?ia.width:ia.height);F.push(ia)}}if(2<F.length){F.sort(function(ya,Ia){return t?ya.x-Ia.x:ya.y-Ia.y});B&&(R-=t?F[0].width/2+F[F.length-1].width/2:F[0].height/2+F[F.length-1].height/2);ia=this.view.translate;ea=this.view.scale;O=O/ea-(t?ia.x:ia.y);I=I/ea-(t?ia.x:ia.y);this.getModel().beginUpdate();try{var za=(I-O-R)/(F.length-1),Fa=O+(B?t?F[0].width/2:F[0].height/2:0);for(da=1;da<F.length-1;da++){var Ga=this.view.getState(this.model.getParent(F[da].cell)),+ca=this.getCellGeometry(F[da].cell);Fa+=za;if(null!=ca&&null!=Ga)if(this.isTransparentBounds(F[da].cell)){var wa=t?B?F[da].x/ea-ia.x:F[da].getCenterX()/ea-ia.x:B?F[da].y/ea-ia.y:F[da].getCenterY()/ea-ia.y;t?this.translateCell(F[da].cell,Fa-wa,0):this.translateCell(F[da].cell,0,Fa-wa)}else ca=ca.clone(),t?ca.x=Math.round(Fa-(B?0:ca.width/2))-Ga.origin.x:ca.y=Math.round(Fa-(B?0:ca.height/2))-Ga.origin.y,this.getModel().setGeometry(F[da].cell,ca);B&&(Fa+=t?F[da].width:F[da].height)}}finally{this.getModel().endUpdate()}}}return A};Graph.prototype.isCloneEvent=function(t){return mxClient.IS_MAC&&mxEvent.isMetaDown(t)||mxEvent.isControlDown(t)};Graph.prototype.createSvgImageExport=function(t,A){t=new mxImageExport;t.addCellData=function(F,I,O){I.setAttribute("data-cell-id",F.id);if(O)if(mxUtils.isNode(F.value))for(O=0;O<F.value.attributes.length;O++){var R=F.value.attributes[O];I.setAttribute("data-cell-"+R.name,R.value)}else if("object"===typeof F.value)for(R in F.value)I.setAttribute("data-cell-"+R,F.value[R]);else null!=F.value&&-I.setAttribute("data-cell-value",F.value);if(A&&mxUtils.isNode(F.value))for(O=0;O<F.value.attributes.length;O++)R=F.value.attributes[O],I.setAttribute("data-meta-"+R.name,R.value);return I};var B=t.visitStatesRecursive;t.visitStatesRecursive=function(F,I,O){if(null!=F){var R=I.root,ea=I.root.ownerDocument;I.root=this.addCellData(F.cell,null!=ea.createElementNS?ea.createElementNS(mxConstants.NS_SVG,"g"):ea.createElement("g"),Editor.addSvgMetadata);R.appendChild(I.root);B.apply(this,arguments);I.root=-R}};t.getLinkForCellState=mxUtils.bind(this,function(F,I){return this.getLinkForCell(F.cell)});t.getTitleForCellState=mxUtils.bind(this,function(F,I){return Editor.convertHtmlToText(this.convertValueToTooltip(F.cell))});return t};Graph.prototype.parseBackgroundImage=function(t){var A=null;null!=t&&0<t.length&&(t=JSON.parse(t),A=new mxImage(t.src,t.width,t.height));return A};Graph.prototype.getBackgroundImageObject=function(t){return t};Graph.prototype.getSvg=function(t,A,B,F,I,O,R,ea,ia,da,za,Fa,-Ga,ca,wa,ya,Ia){var Ca=null;if(null!=ca){Ca=new mxDictionary;for(var Ka=0;Ka<ca.length;Ka++)Ca.put(ca[Ka],!0)}I=this.useCssTransforms;var Da=this.enableFlowAnimation;this.enableFlowAnimation=!1;I&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{A=null!=A?A:1;B=null!=B?B:0;O=null!=O?O:!0;R=null!=R?R:!0;da=null!=da?da:!1;ia=null!=ia?ia:this.defaultExportLinkTarget;var Ya="page"==Ga?this.view.getBackgroundPageBounds():O&&null==Ca||F||"diagram"==Ga?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),-Za=this.backgroundImage,Ta=this.view.translate,bb=this.view.scale;"diagram"==Ga&&null!=Za&&null!=Za.width&&null!=Za.height&&(Ya=mxRectangle.fromRectangle(Ya),Ya.add(new mxRectangle((Ta.x+Za.x)*bb,(Ta.y+Za.y)*bb,Za.width*bb,Za.height*bb)));if(null==Ya)throw Error(mxResources.get("drawingEmpty"));F=A/bb;var ib=Math.max(1,Math.ceil(Ya.width*F)+2*B)+(da&&0==B?5:0),nb=Math.max(1,Math.ceil(Ya.height*F)+2*B)+(da&&0==B?5:0),Wa=mxUtils.getLightDarkColor(t),cb=Graph.createSvgNode(0,0,ib,nb,Wa),lb=cb.ownerDocument;+I.setAttribute("data-cell-value",F.value);if(A&&mxUtils.isNode(F.value))for(O=0;O<F.value.attributes.length;O++)R=F.value.attributes[O],I.setAttribute("data-meta-"+R.name,R.value);return I};var B=t.visitStatesRecursive;t.visitStatesRecursive=function(F,I,O){if(null!=F){var R=I.root,da=I.root.ownerDocument;I.root=this.addCellData(F.cell,null!=da.createElementNS?da.createElementNS(mxConstants.NS_SVG,"g"):da.createElement("g"),Editor.addSvgMetadata);R.appendChild(I.root);B.apply(this,arguments);I.root=+R}};t.getLinkForCellState=mxUtils.bind(this,function(F,I){return this.getLinkForCell(F.cell)});t.getTitleForCellState=mxUtils.bind(this,function(F,I){return Editor.convertHtmlToText(this.convertValueToTooltip(F.cell))});return t};Graph.prototype.parseBackgroundImage=function(t){var A=null;null!=t&&0<t.length&&(t=JSON.parse(t),A=new mxImage(t.src,t.width,t.height));return A};Graph.prototype.getBackgroundImageObject=function(t){return t};Graph.prototype.getSvg=function(t,A,B,F,I,O,R,da,ia,ea,za,Fa,+Ga,ca,wa,ya,Ia){var Ca=null;if(null!=ca){Ca=new mxDictionary;for(var Ka=0;Ka<ca.length;Ka++)Ca.put(ca[Ka],!0)}I=this.useCssTransforms;var Da=this.enableFlowAnimation;this.enableFlowAnimation=!1;I&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{A=null!=A?A:1;B=null!=B?B:0;O=null!=O?O:!0;R=null!=R?R:!0;ea=null!=ea?ea:!1;ia=null!=ia?ia:this.defaultExportLinkTarget;var Ya="page"==Ga?this.view.getBackgroundPageBounds():O&&null==Ca||F||"diagram"==Ga?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),+Za=this.backgroundImage,Ta=this.view.translate,bb=this.view.scale;"diagram"==Ga&&null!=Za&&null!=Za.width&&null!=Za.height&&(Ya=mxRectangle.fromRectangle(Ya),Ya.add(new mxRectangle((Ta.x+Za.x)*bb,(Ta.y+Za.y)*bb,Za.width*bb,Za.height*bb)));if(null==Ya)throw Error(mxResources.get("drawingEmpty"));F=A/bb;var ib=Math.max(1,Math.ceil(Ya.width*F)+2*B)+(ea&&0==B?5:0),nb=Math.max(1,Math.ceil(Ya.height*F)+2*B)+(ea&&0==B?5:0),Wa=mxUtils.getLightDarkColor(t),cb=Graph.createSvgNode(0,0,ib,nb,Wa),lb=cb.ownerDocument;if(null!=t){var gb=mxUtils.createElementNs(lb,mxConstants.NS_SVG,"rect");gb.setAttribute("fill",Wa.light);gb.style.fill=Wa.cssText;gb.setAttribute("width","100%");gb.setAttribute("height","100%");gb.setAttribute("x","0");gb.setAttribute("y","0");cb.appendChild(gb)}var sb=mxUtils.createElementNs(lb,mxConstants.NS_SVG,"g");cb.appendChild(sb);var hb=this.createSvgCanvas(sb),Yb=Math.floor(B/A-Ya.x/bb),Vb=Math.floor(B/A-Ya.y/bb);hb.translate(Yb,Vb);hb.idPrefix="drawio-svg-"+Editor.guid();if(Ia){var Wb=this.gridSize*A,Nb=this.view.gridSteps*Wb;t=[];for(Ka=1;Ka<this.view.gridSteps;Ka++)B=Ka*Wb,t.push("M 0 "+B+" L "+Nb+" "+B+" M "+B+" 0 L "+B+" "+Nb);var Xb=mxUtils.getLightDarkColor(this.view.gridColor),Jb=mxUtils.createElementNs(lb,mxConstants.NS_SVG,"pattern");Jb.setAttribute("id",hb.idPrefix+"-grid");Jb.setAttribute("patternUnits","userSpaceOnUse");Jb.setAttribute("width",Nb);Jb.setAttribute("height",Nb);Jb.setAttribute("x",mxUtils.mod((Ta.x+Yb)*A,Nb));Jb.setAttribute("y",mxUtils.mod((Ta.y+Vb)*A,Nb));if(0<t.length){var d=mxUtils.createElementNs(lb,mxConstants.NS_SVG,"path");d.setAttribute("d",t.join(" "));d.setAttribute("fill","none");d.setAttribute("stroke",Xb.light);d.style.stroke=Xb.cssText;d.setAttribute("opacity","0.2");d.setAttribute("stroke-width",A);Jb.appendChild(d)}var m=mxUtils.createElementNs(lb,mxConstants.NS_SVG,"path");m.setAttribute("d","M "+Nb+" 0 L 0 0 0 "+Nb);m.setAttribute("fill","none");m.setAttribute("stroke",Xb.light);m.style.stroke=Xb.cssText;m.setAttribute("stroke-width",A);Jb.appendChild(m);hb.defs.appendChild(Jb);var r=mxUtils.createElementNs(lb,mxConstants.NS_SVG,"rect");r.setAttribute("width","100%");r.setAttribute("height","100%");r.setAttribute("fill","url(#"+Jb.getAttribute("id")+")");cb.insertBefore(r,sb)}var n=document.createElement("div"),q=hb.getAlternateText;hb.getAlternateText=function(va,Xa,La,qa,ta,xa,Ba,Na,Qa,Ra,Sa,$b,ac){if(null!=xa&&0<this.state.fontSize)try{return mxUtils.isNode(xa)?xa=xa.innerText:(n.innerHTML=xa,xa=mxUtils.extractTextWithWhitespace(n.childNodes)),-xa}catch(Zb){return q.apply(this,arguments)}else return q.apply(this,arguments)};if(null!=Za&&null!=Za.width&&null!=Za.height){Ka=bb/A;var v=new mxRectangle((Za.x+Ta.x)*Ka,(Za.y+Ta.y)*Ka,Za.width*Ka,Za.height*Ka);mxUtils.intersects(Ya,v)&&hb.image(Za.x+Ta.x,Za.y+Ta.y,Za.width,Za.height,Za.src,!0)}hb.scale(F);hb.textEnabled=R;ea=null!=ea?ea:this.createSvgImageExport();var y=ea.getLinkForCellState;ea.getLinkForCellState=function(va,Xa){var La=va.view.graph.getAbsoluteUrl(y.apply(this,arguments));return null==-La||va.view.graph.isCustomLink(La)?null:La};ea.getLinkTargetForCellState=function(va,Xa){return va.view.graph.getLinkTargetForCell(va.cell)};var J=ea.drawCellState,C=null,ba=mxUtils.bind(this,function(){if(null==C){C="ge-flow-animation-"+Editor.guid();var va=null!=lb.createElementNS?lb.createElementNS(mxConstants.NS_SVG,"style"):lb.createElement("style");va.innerHTML=this.createFlowAnimationCss(C);lb.getElementsByTagName("defs")[0].appendChild(va)}return C});ea.drawCellState=function(va,Xa){for(var La=+xa}catch(Zb){return q.apply(this,arguments)}else return q.apply(this,arguments)};if(null!=Za&&null!=Za.width&&null!=Za.height){Ka=bb/A;var v=new mxRectangle((Za.x+Ta.x)*Ka,(Za.y+Ta.y)*Ka,Za.width*Ka,Za.height*Ka);mxUtils.intersects(Ya,v)&&hb.image(Za.x+Ta.x,Za.y+Ta.y,Za.width,Za.height,Za.src,!0)}hb.scale(F);hb.textEnabled=R;da=null!=da?da:this.createSvgImageExport();var y=da.getLinkForCellState;da.getLinkForCellState=function(va,Xa){var La=va.view.graph.getAbsoluteUrl(y.apply(this,arguments));return null==+La||va.view.graph.isCustomLink(La)?null:La};da.getLinkTargetForCellState=function(va,Xa){return va.view.graph.getLinkTargetForCell(va.cell)};var J=da.drawCellState,C=null,ba=mxUtils.bind(this,function(){if(null==C){C="ge-flow-animation-"+Editor.guid();var va=null!=lb.createElementNS?lb.createElementNS(mxConstants.NS_SVG,"style"):lb.createElement("style");va.innerHTML=this.createFlowAnimationCss(C);lb.getElementsByTagName("defs")[0].appendChild(va)}return C});da.drawCellState=function(va,Xa){for(var La=va.view.graph,qa=null!=Ca?Ca.get(va.cell):La.isCellSelected(va.cell),ta=La.model.getParent(va.cell);!(O&&null==Ca||qa)&&null!=ta;)qa=null!=Ca?Ca.get(ta):La.isCellSelected(ta),ta=La.model.getParent(ta);if(null!=va.shape)try{var xa=va.shape.isFlowAnimationEnabled,Ba=va.shape.addFlowAnimationToShape;va.shape.isFlowAnimationEnabled=function(){return Da&&La.model.isEdge(va.cell)&&"1"==mxUtils.getValue(va.style,"flowAnimation","0")};va.shape.addFlowAnimationToShape=function(){La.addFlowAnimationToNode(this.getFlowAnimationPath(),-va.style,A,ba())};if(O&&null==Ca||qa)La.view.redrawEnumerationState(va),J.apply(this,arguments),this.doDrawShape(va.secondLabel,Xa)}finally{va.shape.isFlowAnimationEnabled=xa,va.shape.addFlowAnimationToShape=Ba}};var P=null!=this.view.currentRoot?this.view.currentRoot:this.model.root;ea.drawState(this.getView().getState(P),hb);this.addForeignObjectWarning(hb,cb);Graph.inlineSingleUseImages(cb);Graph.replaceFontElements(cb);Graph.addAdaptiveColors(cb,this.shapeBackgroundColor);ya?this.disableSvgLinks(cb):+va.style,A,ba())};if(O&&null==Ca||qa)La.view.redrawEnumerationState(va),J.apply(this,arguments),this.doDrawShape(va.secondLabel,Xa)}finally{va.shape.isFlowAnimationEnabled=xa,va.shape.addFlowAnimationToShape=Ba}};var P=null!=this.view.currentRoot?this.view.currentRoot:this.model.root;da.drawState(this.getView().getState(P),hb);this.addForeignObjectWarning(hb,cb);Graph.inlineSingleUseImages(cb);Graph.replaceFontElements(cb);Graph.addAdaptiveColors(cb,this.shapeBackgroundColor);ya?this.disableSvgLinks(cb):this.updateSvgLinks(cb,ia,!0);return cb}finally{this.enableFlowAnimation=Da,I&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(t,A){if("0"!=urlParams["svg-warning"]&&0<A.getElementsByTagName("foreignObject").length){var B=t.createElement("switch"),F=t.createElement("g");F.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var I=t.createElement("a");I.setAttribute("transform","translate(0,-5)");null==I.setAttributeNS||A.ownerDocument!=document&&null==document.documentMode?(I.setAttribute("xlink:href",Graph.foreignObjectWarningLink),I.setAttribute("target","_blank")):(I.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Graph.foreignObjectWarningLink),I.setAttributeNS(mxConstants.NS_XLINK,"target","_blank"));t=t.createElement("text");t.setAttribute("text-anchor","middle");t.setAttribute("font-size","10px");t.setAttribute("x","50%");t.setAttribute("y","100%");mxUtils.write(t,Graph.foreignObjectWarningText);B.appendChild(F);I.appendChild(t);B.appendChild(I);A.appendChild(B)}};Graph.prototype.disableSvgLinks=function(t,A){t=t.getElementsByTagName("a");for(var B=0;B<t.length;B++){var F=t[B].getAttribute("href");null==F&&(F=t[B].getAttribute("xlink:href"));null!=F&&(t[B].style.pointerEvents="none",t[B].setAttribute("href",""));A&&A(t[B])}};Graph.prototype.updateSvgLinks=function(t,A,B){t=t.getElementsByTagName("a");for(var F=0;F<t.length;F++)if(null==t[F].getAttribute("target")){var I=t[F].getAttribute("href");@@ -3205,45 +3205,45 @@ this.imageSymbols,A,B)};return t};Graph.prototype.getSelectedElement=function(){Graph.prototype.getParentByName=function(t,A,B){for(;null!=t&&t.nodeName!=A;){if(t==B)return null;t=t.parentNode}return t};Graph.prototype.getParentByNames=function(t,A,B){for(;null!=t&&!(0<=mxUtils.indexOf(A,t.nodeName));){if(t==B)return null;t=t.parentNode}return t};Graph.prototype.selectNode=function(t){var A=null;if(window.getSelection){if(A=window.getSelection(),A.getRangeAt&&A.rangeCount){var B=document.createRange();B.selectNode(t);A.removeAllRanges();A.addRange(B)}}else(A=document.selection)&&"Control"!=A.type&&(t=A.createRange(),t.collapse(!0),B=A.createRange(),B.setEndPoint("StartToStart",t),B.select())};Graph.prototype.flipEdgePoints=function(t,A,B){var F=this.getCellGeometry(t);if(null!=F){F=F.clone();if(null!=F.points)for(var I=0;I<F.points.length;I++)A?F.points[I].x=B+(B-F.points[I].x):F.points[I].y=B+(B-F.points[I].y);I=function(O){null!=O&&(A?O.x=B+(B-O.x):O.y=B+(B-O.y))};I(F.getTerminalPoint(!0));I(F.getTerminalPoint(!1));this.model.setGeometry(t,F)}};Graph.prototype.flipChildren=function(t,A,B){this.model.beginUpdate();try{for(var F=this.model.getChildCount(t),I=0;I<F;I++){var O=this.model.getChildAt(t,I);if(this.model.isEdge(O))this.flipEdgePoints(O,A,B);else{var R=this.getCellGeometry(O);null!=R&&(R=R.clone(),A?R.x=B+(B-R.x-R.width):R.y=B+(B-R.y-R.height),this.model.setGeometry(O,R))}}}finally{this.model.endUpdate()}};Graph.prototype.getConnectionPoint=function(t,A,B){return null!=t&&1==mxUtils.getValue(t.style,"legacyAnchorPoints",1)?this.getLegacyConnectionPoint(t,A,-B):mxGraph.prototype.getConnectionPoint.apply(this,arguments)};Graph.prototype.getLegacyConnectionPoint=function(t,A,B){B=null!=B?B:!0;var F=null;if(null!=t&&null!=A.point){var I=this.view.getPerimeterBounds(t),O=new mxPoint(I.getCenterX(),I.getCenterY()),R=t.style[mxConstants.STYLE_DIRECTION],ea=0;null!=R&&1==mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(R==mxConstants.DIRECTION_NORTH?ea+=270:R==mxConstants.DIRECTION_WEST?ea+=180:R==mxConstants.DIRECTION_SOUTH&&(ea+=90),-R!=mxConstants.DIRECTION_NORTH&&R!=mxConstants.DIRECTION_SOUTH||I.rotate90());F=this.view.scale;F=new mxPoint(I.x+A.point.x*I.width+A.dx*F,I.y+A.point.y*I.height+A.dy*F);var ia=t.style[mxConstants.STYLE_ROTATION]||0;if(A.perimeter)0!=ea&&(R=I=0,90==ea?R=1:180==ea?I=-1:270==ea&&(R=-1),F=mxUtils.getRotatedPoint(F,I,R,O)),F=this.view.getPerimeterPoint(t,F,!1);else if(ia+=ea,this.getModel().isVertex(t.cell)){ea=1==t.style[mxConstants.STYLE_FLIPH];A=1==t.style[mxConstants.STYLE_FLIPV];null!=t.shape&&null!=-t.shape.stencil&&(ea=1==mxUtils.getValue(t.style,"stencilFlipH",0)||ea,A=1==mxUtils.getValue(t.style,"stencilFlipV",0)||A);if(R==mxConstants.DIRECTION_NORTH||R==mxConstants.DIRECTION_SOUTH)t=ea,ea=A,A=t;ea&&(F.x=2*I.getCenterX()-F.x);A&&(F.y=2*I.getCenterY()-F.y)}0!=ia&&null!=F&&(t=mxUtils.toRadians(ia),I=Math.cos(t),R=Math.sin(t),F=mxUtils.getRotatedPoint(F,I,R,O))}B&&null!=F&&(F.x=Math.round(F.x),F.y=Math.round(F.y));return F};Graph.prototype.flipCells=function(t,A){this.model.beginUpdate();try{t=+B):mxGraph.prototype.getConnectionPoint.apply(this,arguments)};Graph.prototype.getLegacyConnectionPoint=function(t,A,B){B=null!=B?B:!0;var F=null;if(null!=t&&null!=A.point){var I=this.view.getPerimeterBounds(t),O=new mxPoint(I.getCenterX(),I.getCenterY()),R=t.style[mxConstants.STYLE_DIRECTION],da=0;null!=R&&1==mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(R==mxConstants.DIRECTION_NORTH?da+=270:R==mxConstants.DIRECTION_WEST?da+=180:R==mxConstants.DIRECTION_SOUTH&&(da+=90),+R!=mxConstants.DIRECTION_NORTH&&R!=mxConstants.DIRECTION_SOUTH||I.rotate90());F=this.view.scale;F=new mxPoint(I.x+A.point.x*I.width+A.dx*F,I.y+A.point.y*I.height+A.dy*F);var ia=t.style[mxConstants.STYLE_ROTATION]||0;if(A.perimeter)0!=da&&(R=I=0,90==da?R=1:180==da?I=-1:270==da&&(R=-1),F=mxUtils.getRotatedPoint(F,I,R,O)),F=this.view.getPerimeterPoint(t,F,!1);else if(ia+=da,this.getModel().isVertex(t.cell)){da=1==t.style[mxConstants.STYLE_FLIPH];A=1==t.style[mxConstants.STYLE_FLIPV];null!=t.shape&&null!=+t.shape.stencil&&(da=1==mxUtils.getValue(t.style,"stencilFlipH",0)||da,A=1==mxUtils.getValue(t.style,"stencilFlipV",0)||A);if(R==mxConstants.DIRECTION_NORTH||R==mxConstants.DIRECTION_SOUTH)t=da,da=A,A=t;da&&(F.x=2*I.getCenterX()-F.x);A&&(F.y=2*I.getCenterY()-F.y)}0!=ia&&null!=F&&(t=mxUtils.toRadians(ia),I=Math.cos(t),R=Math.sin(t),F=mxUtils.getRotatedPoint(F,I,R,O))}B&&null!=F&&(F.x=Math.round(F.x),F.y=Math.round(F.y));return F};Graph.prototype.flipCells=function(t,A){this.model.beginUpdate();try{t=this.model.getTopmostCells(t);for(var B=[],F=0;F<t.length;F++)if(this.model.isEdge(t[F])){var I=this.view.getState(t[F]);null!=I&&this.flipEdgePoints(t[F],A,(A?I.getCenterX():I.getCenterY())/this.view.scale-(A?I.origin.x:I.origin.y)-(A?this.view.translate.x:this.view.translate.y))}else{var O=this.getCellGeometry(t[F]);null!=O&&this.flipChildren(t[F],A,A?O.getCenterX()-O.x:O.getCenterY()-O.y);B.push(t[F])}this.toggleCellStyles(A?mxConstants.STYLE_FLIPH:mxConstants.STYLE_FLIPV,!1,B);this.setCellStyles("legacyAnchorPoints",-"0",B)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(t,A){var B=null;if(null!=t&&0<t.length){this.model.beginUpdate();try{for(var F=0;F<t.length;F++){var I=this.model.getParent(t[F]);if(this.isTable(I)){var O=this.getCellGeometry(t[F]),R=this.getCellGeometry(I);null!=O&&null!=R&&(R=R.clone(),R.height-=O.height,this.model.setGeometry(I,R))}}var ea=this.selectParentAfterDelete?this.model.getParents(t):null;this.removeCells(t,A)}finally{this.model.endUpdate()}if(null!=ea)for(B=-[],F=0;F<ea.length;F++)this.model.contains(ea[F])&&(this.model.isVertex(ea[F])||this.model.isEdge(ea[F]))&&B.push(ea[F])}return B};Graph.prototype.insertTableColumn=function(t,A){var B=this.getModel();B.beginUpdate();try{var F=t,I=0;if(this.isTableCell(t)){var O=B.getParent(t);F=B.getParent(O);I=mxUtils.indexOf(B.getChildCells(O,!0),t)}else this.isTableRow(t)?F=B.getParent(t):t=B.getChildCells(F,!0)[0],A||(I=B.getChildCells(t,!0).length-1);var R=B.getChildCells(F,!0),ea=Graph.minTableColumnWidth;-for(t=0;t<R.length;t++){var ia=B.getChildCells(R[t],!0)[I],da=B.cloneCell(ia,!1);null==da&&(da=this.createVertex());var za=this.getCellGeometry(da);da.value=null;da.style=mxUtils.setStyle(mxUtils.setStyle(da.style,"rowspan",null),"colspan",null);if(null!=za){null!=za.alternateBounds&&(za.width=za.alternateBounds.width,za.height=za.alternateBounds.height,za.alternateBounds=null);ea=za.width;var Fa=this.getCellGeometry(R[t]);null!=Fa&&(za.height=Fa.height)}B.add(R[t],da,I+(A?0:1))}var Ga=this.getCellGeometry(F);-null!=Ga&&(Ga=Ga.clone(),Ga.width+=ea,B.setGeometry(F,Ga))}finally{B.endUpdate()}};Graph.prototype.deleteLane=function(t){var A=this.getModel();A.beginUpdate();try{var B=null;B="stackLayout"==this.getCurrentCellStyle(t).childLayout?t:A.getParent(t);var F=A.getChildCells(B,!0);0==F.length?A.remove(B):(B==t&&(t=F[F.length-1]),A.remove(t))}finally{A.endUpdate()}};Graph.prototype.insertLane=function(t,A){var B=this.getModel();B.beginUpdate();try{var F=null;if("stackLayout"==this.getCurrentCellStyle(t).childLayout){F=-t;var I=B.getChildCells(F,!0);t=I[A?0:I.length-1]}else F=B.getParent(t);var O=F.getIndex(t);t=B.cloneCell(t,!1);t.value=null;B.add(F,t,O+(A?0:1))}finally{B.endUpdate()}};Graph.prototype.insertTableRow=function(t,A){var B=this.getModel();B.beginUpdate();try{var F=t,I=t;if(this.isTableCell(t))I=B.getParent(t),F=B.getParent(I);else if(this.isTableRow(t))F=B.getParent(t);else{var O=B.getChildCells(F,!0);I=O[A?0:O.length-1]}if(null!=I){var R=B.getChildCells(I,!0),ea=F.getIndex(I);I=B.cloneCell(I,!1);I.value=-null;var ia=this.getCellGeometry(I);if(null!=ia){for(O=0;O<R.length;O++){t=B.cloneCell(R[O],!1);t.value=null;t.style=mxUtils.setStyle(mxUtils.setStyle(t.style,"rowspan",null),"colspan",null);var da=this.getCellGeometry(t);null!=da&&(null!=da.alternateBounds&&(da.width=da.alternateBounds.width,da.height=da.alternateBounds.height,da.alternateBounds=null),da.height=ia.height);I.insert(t)}B.add(F,I,ea+(A?0:1));var za=this.getCellGeometry(F);null!=za&&(za=za.clone(),za.height+=ia.height,B.setGeometry(F,+"0",B)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(t,A){var B=null;if(null!=t&&0<t.length){this.model.beginUpdate();try{for(var F=0;F<t.length;F++){var I=this.model.getParent(t[F]);if(this.isTable(I)){var O=this.getCellGeometry(t[F]),R=this.getCellGeometry(I);null!=O&&null!=R&&(R=R.clone(),R.height-=O.height,this.model.setGeometry(I,R))}}var da=this.selectParentAfterDelete?this.model.getParents(t):null;this.removeCells(t,A)}finally{this.model.endUpdate()}if(null!=da)for(B=+[],F=0;F<da.length;F++)this.model.contains(da[F])&&(this.model.isVertex(da[F])||this.model.isEdge(da[F]))&&B.push(da[F])}return B};Graph.prototype.insertTableColumn=function(t,A){var B=this.getModel();B.beginUpdate();try{var F=t,I=0;if(this.isTableCell(t)){var O=B.getParent(t);F=B.getParent(O);I=mxUtils.indexOf(B.getChildCells(O,!0),t)}else this.isTableRow(t)?F=B.getParent(t):t=B.getChildCells(F,!0)[0],A||(I=B.getChildCells(t,!0).length-1);var R=B.getChildCells(F,!0),da=Graph.minTableColumnWidth;+for(t=0;t<R.length;t++){var ia=B.getChildCells(R[t],!0)[I],ea=B.cloneCell(ia,!1);null==ea&&(ea=this.createVertex());var za=this.getCellGeometry(ea);ea.value=null;ea.style=mxUtils.setStyle(mxUtils.setStyle(ea.style,"rowspan",null),"colspan",null);if(null!=za){null!=za.alternateBounds&&(za.width=za.alternateBounds.width,za.height=za.alternateBounds.height,za.alternateBounds=null);da=za.width;var Fa=this.getCellGeometry(R[t]);null!=Fa&&(za.height=Fa.height)}B.add(R[t],ea,I+(A?0:1))}var Ga=this.getCellGeometry(F);+null!=Ga&&(Ga=Ga.clone(),Ga.width+=da,B.setGeometry(F,Ga))}finally{B.endUpdate()}};Graph.prototype.deleteLane=function(t){var A=this.getModel();A.beginUpdate();try{var B=null;B="stackLayout"==this.getCurrentCellStyle(t).childLayout?t:A.getParent(t);var F=A.getChildCells(B,!0);0==F.length?A.remove(B):(B==t&&(t=F[F.length-1]),A.remove(t))}finally{A.endUpdate()}};Graph.prototype.insertLane=function(t,A){var B=this.getModel();B.beginUpdate();try{var F=null;if("stackLayout"==this.getCurrentCellStyle(t).childLayout){F=+t;var I=B.getChildCells(F,!0);t=I[A?0:I.length-1]}else F=B.getParent(t);var O=F.getIndex(t);t=B.cloneCell(t,!1);t.value=null;B.add(F,t,O+(A?0:1))}finally{B.endUpdate()}};Graph.prototype.insertTableRow=function(t,A){var B=this.getModel();B.beginUpdate();try{var F=t,I=t;if(this.isTableCell(t))I=B.getParent(t),F=B.getParent(I);else if(this.isTableRow(t))F=B.getParent(t);else{var O=B.getChildCells(F,!0);I=O[A?0:O.length-1]}if(null!=I){var R=B.getChildCells(I,!0),da=F.getIndex(I);I=B.cloneCell(I,!1);I.value=+null;var ia=this.getCellGeometry(I);if(null!=ia){for(O=0;O<R.length;O++){t=B.cloneCell(R[O],!1);t.value=null;t.style=mxUtils.setStyle(mxUtils.setStyle(t.style,"rowspan",null),"colspan",null);var ea=this.getCellGeometry(t);null!=ea&&(null!=ea.alternateBounds&&(ea.width=ea.alternateBounds.width,ea.height=ea.alternateBounds.height,ea.alternateBounds=null),ea.height=ia.height);I.insert(t)}B.add(F,I,da+(A?0:1));var za=this.getCellGeometry(F);null!=za&&(za=za.clone(),za.height+=ia.height,B.setGeometry(F,za))}}else if(za=this.getCellGeometry(F),null!=za){var Fa=za.width;I=this.createVertex(null,null,"",0,0,Fa,40,"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fixedHeader=1;");I.insert(this.createVertex(null,null,"",0,0,Fa,40,"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;"));-B.add(F,I);za=za.clone();za.height+=40;B.setGeometry(F,za)}}finally{B.endUpdate()}};Graph.prototype.deleteTableColumn=function(t){var A=this.getModel();A.beginUpdate();try{var B=t,F=t;this.isTableCell(t)&&(F=A.getParent(t));this.isTableRow(F)&&(B=A.getParent(F));var I=A.getChildCells(B,!0);if(0==I.length)A.remove(B);else{this.isTableRow(F)||(F=I[0]);var O=A.getChildCells(F,!0);if(1>=O.length)A.remove(B);else{var R=O.length-1;this.isTableCell(t)&&(R=mxUtils.indexOf(O,t));for(F=t=0;F<I.length;F++){var ea=-A.getChildCells(I[F],!0)[R];A.remove(ea);var ia=this.getCellGeometry(ea);null!=ia&&(t=Math.max(t,ia.width))}var da=this.getCellGeometry(B);null!=da&&(da=da.clone(),da.width-=t,A.setGeometry(B,da))}}}finally{A.endUpdate()}};Graph.prototype.deleteTableRow=function(t){var A=this.getModel();A.beginUpdate();try{var B=t,F=t;this.isTableCell(t)&&(t=F=A.getParent(t));this.isTableRow(t)&&(B=A.getParent(F));var I=A.getChildCells(B,!0);if(1>=I.length)A.remove(B);else{this.isTableRow(F)||(F=I[I.length-1]);A.remove(F);+B.add(F,I);za=za.clone();za.height+=40;B.setGeometry(F,za)}}finally{B.endUpdate()}};Graph.prototype.deleteTableColumn=function(t){var A=this.getModel();A.beginUpdate();try{var B=t,F=t;this.isTableCell(t)&&(F=A.getParent(t));this.isTableRow(F)&&(B=A.getParent(F));var I=A.getChildCells(B,!0);if(0==I.length)A.remove(B);else{this.isTableRow(F)||(F=I[0]);var O=A.getChildCells(F,!0);if(1>=O.length)A.remove(B);else{var R=O.length-1;this.isTableCell(t)&&(R=mxUtils.indexOf(O,t));for(F=t=0;F<I.length;F++){var da=+A.getChildCells(I[F],!0)[R];A.remove(da);var ia=this.getCellGeometry(da);null!=ia&&(t=Math.max(t,ia.width))}var ea=this.getCellGeometry(B);null!=ea&&(ea=ea.clone(),ea.width-=t,A.setGeometry(B,ea))}}}finally{A.endUpdate()}};Graph.prototype.deleteTableRow=function(t){var A=this.getModel();A.beginUpdate();try{var B=t,F=t;this.isTableCell(t)&&(t=F=A.getParent(t));this.isTableRow(t)&&(B=A.getParent(F));var I=A.getChildCells(B,!0);if(1>=I.length)A.remove(B);else{this.isTableRow(F)||(F=I[I.length-1]);A.remove(F);t=0;var O=this.getCellGeometry(F);null!=O&&(t=O.height);var R=this.getCellGeometry(B);null!=R&&(R=R.clone(),R.height-=t,A.setGeometry(B,R))}}finally{A.endUpdate()}};Graph.prototype.insertRow=function(t,A){for(var B=t.tBodies[0],F=B.rows[0].cells,I=t=0;I<F.length;I++){var O=F[I].getAttribute("colspan");t+=null!=O?parseInt(O):1}A=B.insertRow(A);for(I=0;I<t;I++)mxUtils.br(A.insertCell(-1));return A.cells[0]};Graph.prototype.deleteRow=function(t,A){t.tBodies[0].deleteRow(A)};Graph.prototype.insertColumn=function(t,A){var B=t.tHead;if(null!=B)for(var F=0;F<B.rows.length;F++){var I=document.createElement("th");B.rows[F].appendChild(I);mxUtils.br(I)}t=t.tBodies[0];for(B=0;B<t.rows.length;B++)F=t.rows[B].insertCell(A),mxUtils.br(F);return t.rows[0].cells[0<=A?A:t.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(t,A){if(0<=A){t=t.tBodies[0].rows;for(var B=0;B<t.length;B++)t[B].cells.length>A&&t[B].deleteCell(A)}};Graph.prototype.pasteHtmlAtCaret=function(t){if(window.getSelection){var A=window.getSelection();if(A.getRangeAt&&A.rangeCount){A=A.getRangeAt(0);A.deleteContents();var B=document.createElement("div");B.innerHTML=t;t=document.createDocumentFragment();for(var F;F=B.firstChild;)lastNode=t.appendChild(F);A.insertNode(t)}}else(A=document.selection)&&"Control"!=A.type&&A.createRange().pasteHTML(t)};Graph.prototype.createLinkForHint=function(t,A,B){function F(O,R){O.length>R&&(O=O.substring(0,Math.round(R/2))+"..."+O.substring(O.length-Math.round(R/4)));return O}t=null!=t?t:"javascript:void(0);";if(null==A||0==A.length)A=this.isCustomLink(t)?this.getLinkTitle(t):t;var I=document.createElement("a");I.setAttribute("rel",this.linkRelation);I.setAttribute("href",this.getAbsoluteUrl(t));I.setAttribute("title",F(this.isCustomLink(t)?this.getLinkTitle(t):t,80));null!=this.linkTarget&&I.setAttribute("target",this.linkTarget);mxUtils.write(I,F(A,40));this.isCustomLink(t)&&mxEvent.addListener(I,"click",mxUtils.bind(this,function(O){this.customLinkClicked(t,B);mxEvent.consume(O)}));return I};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(O,R){this.popupMenuHandler.hideMenu()});var t=this.updateMouseEvent;this.updateMouseEvent=function(O){O=t.apply(this,arguments);if(mxEvent.isTouchEvent(O.getEvent())&&null==O.getState()){var R=this.getCellAt(O.graphX,O.graphY);null!=R&&this.isSwimlane(R)&&this.hitsSwimlaneContent(R,O.graphX,O.graphY)||(O.state=this.view.getState(R),null!=O.state&&-null!=O.state.shape&&(this.container.style.cursor=O.state.shape.node.style.cursor))}null==O.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return O};var A=!1,B=!1,F=!1,I=this.fireMouseEvent;this.fireMouseEvent=function(O,R,ea){O==mxEvent.MOUSE_DOWN&&(R=this.updateMouseEvent(R),A=this.isCellSelected(R.getCell()),B=this.isSelectionEmpty(),F=this.popupMenuHandler.isMenuShowing());I.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(O,R){if(null!=this.freehand&&-!this.freehand.isDrawing()){var ea=mxEvent.isMouseEvent(R.getEvent());this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==R.getState()||!R.isSource(R.getState().control))&&(this.popupMenuHandler.popupTrigger||!F&&!ea&&(B&&null==R.getCell()&&this.isSelectionEmpty()||A&&this.isCellSelected(R.getCell())));ea=!A||ea?null:mxUtils.bind(this,function(ia){window.setTimeout(mxUtils.bind(this,function(){if(!this.isEditing()&&this.isTouchPopupMenuEnabled()){var da=mxUtils.getScrollOrigin();-this.popupMenuHandler.popup(R.getX()+da.x+1,R.getY()+da.y+1,ia,R.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[O,R,ea])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0};mxCellEditor.prototype.isContentEditing=function(){var t=this.graph.view.getState(this.editingCell);return null!=t&&1==t.style.html};mxCellEditor.prototype.isTableSelected=function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};+null!=O.state.shape&&(this.container.style.cursor=O.state.shape.node.style.cursor))}null==O.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return O};var A=!1,B=!1,F=!1,I=this.fireMouseEvent;this.fireMouseEvent=function(O,R,da){O==mxEvent.MOUSE_DOWN&&(R=this.updateMouseEvent(R),A=this.isCellSelected(R.getCell()),B=this.isSelectionEmpty(),F=this.popupMenuHandler.isMenuShowing());I.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(O,R){if(null!=this.freehand&&+!this.freehand.isDrawing()){var da=mxEvent.isMouseEvent(R.getEvent());this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==R.getState()||!R.isSource(R.getState().control))&&(this.popupMenuHandler.popupTrigger||!F&&!da&&(B&&null==R.getCell()&&this.isSelectionEmpty()||A&&this.isCellSelected(R.getCell())));da=!A||da?null:mxUtils.bind(this,function(ia){window.setTimeout(mxUtils.bind(this,function(){if(!this.isEditing()&&this.isTouchPopupMenuEnabled()){var ea=mxUtils.getScrollOrigin();+this.popupMenuHandler.popup(R.getX()+ea.x+1,R.getY()+ea.y+1,ia,R.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[O,R,da])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0};mxCellEditor.prototype.isContentEditing=function(){var t=this.graph.view.getState(this.editingCell);return null!=t&&1==t.style.html};mxCellEditor.prototype.isTableSelected=function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};mxCellEditor.prototype.isTextSelected=function(){var t="";window.getSelection?t=window.getSelection():document.getSelection?t=document.getSelection():document.selection&&(t=document.selection.createRange().text);return""!=t};mxCellEditor.prototype.insertTab=function(t){var A=this.textarea.ownerDocument.defaultView.getSelection(),B=A.getRangeAt(0);t=Graph.createTabNode(t);B.insertNode(t);B.setStartAfter(t);B.setEndAfter(t);A.removeAllRanges();A.addRange(B)};mxCellEditor.prototype.alignText=function(t,A){var B=this.graph.getView().getState(this.editingCell);if(null!=B){B=mxUtils.getValue(B.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);var F=null!=B&&"vertical-"==B.substring(0,9),I=null!=A&&mxEvent.isShiftDown(A);if(I||null!=window.getSelection&&null!=window.getSelection().containsNode){var O=!0;this.graph.processElements(this.textarea,function(R){I||F||window.getSelection().containsNode(R,!0)?(R.removeAttribute("align"),R.style.textAlign=null):O=!1});(O||F)&&this.graph.cellEditor.setAlign(t)}F||document.execCommand("justify"+t.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var t=window.getSelection();if(t.getRangeAt&&t.rangeCount){for(var A=[],B=0,F=t.rangeCount;B<F;++B)A.push(t.getRangeAt(B));return A}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(t){try{if(t)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var A=0,B=t.length;A<B;++A)sel.addRange(t[A])}else document.selection&&t.select&&t.select()}catch(F){}};var na=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(t){null!=t.text&&(t.text.replaceLinefeeds="0"!=mxUtils.getValue(t.style,"nl2Br","1"));na.apply(this,arguments)};var fa=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(t,A){this.isKeepFocusEvent(t)||!mxEvent.isAltDown(t.getEvent())?fa.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(t){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var ja=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(t,A){t=this.graph.getStartEditingCell(t,A);ja.apply(this,arguments);var B=this.graph.view.getState(t);this.textarea.className=null!=B&&1==B.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";Graph.browserTranslate&&(this.textarea.classList.add("notranslate"),this.textarea.setAttribute("translate","no"));this.textarea.style.colorScheme="none"==this.graph.getAdaptiveColors()?"light":"";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(t);null!=this.editingCell&&null!=this.textarea&&null!=this.textarea.parentNode&&null!=B&&this.graph.isAutosizeTextState(B)&&this.resize()};mxCellEditor.prototype.toggleViewMode=function(){var t=this.graph.view.getState(this.editingCell);if(null!=t){var A=-null!=t&&"0"!=mxUtils.getValue(t.style,"nl2Br","1"),B=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);ea=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<ea.length&&"\n"==ea.charAt(ea.length-1)&&(ea=ea.substring(0,ea.length-1));ea=Graph.sanitizeHtml(A?ea.replace(/\n/g,"<br/>"):ea,!0);this.textarea.className="mxCellEditor geContentEditable";ia=mxUtils.getValue(t.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);+null!=t&&"0"!=mxUtils.getValue(t.style,"nl2Br","1"),B=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);da=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<da.length&&"\n"==da.charAt(da.length-1)&&(da=da.substring(0,da.length-1));da=Graph.sanitizeHtml(A?da.replace(/\n/g,"<br/>"):da,!0);this.textarea.className="mxCellEditor geContentEditable";ia=mxUtils.getValue(t.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);A=mxUtils.getValue(t.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var F=mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),I=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,O=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,R=[];(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&R.push("underline");(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&R.push("line-through");0<R.length&&(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&R.push("dotted");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(ia*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(ia)+"px";this.textarea.style.textDecoration=-R.join(" ");this.textarea.style.fontWeight=I?"bold":"normal";this.textarea.style.fontStyle=O?"italic":"";this.textarea.style.fontFamily=A;this.textarea.style.textAlign=F;this.textarea.style.padding="0px";this.textarea.innerHTML!=ea&&(this.textarea.innerHTML=ea,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors());-this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerText="");Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var ea=mxUtils.htmlEntities(this.textarea.innerHTML);8!=document.documentMode&&(ea=mxUtils.replaceTrailingNewlines(ea,"<div><br></div>"));ea=Graph.sanitizeHtml(A?ea.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):ea,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var ia=+R.join(" ");this.textarea.style.fontWeight=I?"bold":"normal";this.textarea.style.fontStyle=O?"italic":"";this.textarea.style.fontFamily=A;this.textarea.style.textAlign=F;this.textarea.style.padding="0px";this.textarea.innerHTML!=da&&(this.textarea.innerHTML=da,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors());+this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerText="");Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var da=mxUtils.htmlEntities(this.textarea.innerHTML);8!=document.documentMode&&(da=mxUtils.replaceTrailingNewlines(da,"<div><br></div>"));da=Graph.sanitizeHtml(A?da.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):da,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var ia=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(ia*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(ia)+"px";this.textarea.style.textDecoration="";this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.width="";this.textarea.style.padding="2px";this.textarea.innerHTML!=-ea&&(this.textarea.innerHTML=ea);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=B;this.resize()}};var W=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(t,A){if(null!=this.textarea)if(t=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=t){var B=t.view.scale;this.bounds=mxRectangle.fromRectangle(t);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=+da&&(this.textarea.innerHTML=da);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=B;this.resize()}};var W=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(t,A){if(null!=this.textarea)if(t=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=t){var B=t.view.scale;this.bounds=mxRectangle.fromRectangle(t);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*B;this.bounds.height=60*B;var F=null!=t.text?t.text.margin:null;null==F&&(F=mxUtils.getAlignmentAsPoint(mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=F.x*this.bounds.width;this.bounds.y+=F.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/B)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/B)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/B)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*B);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/B)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*B);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px";mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+B+","+B+")")}else if(null!=t&&this.graph.isAutosizeTextState(t)){B=t.view.scale;F=t.style;var I=this.graph.getCellGeometry(this.editingCell);if(null!=I){this.bounds=mxRectangle.fromRectangle(t);this.textarea.style.left=Math.round(t.x)+"px";this.textarea.style.top=Math.round(t.y)+"px";var O=this.rotateText&&null!=this.textShape?this.textShape.getTextRotation():0;mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform",(0!=O?"rotate("+O+"deg) ":"")+"scale("+B+","+B+")");this.textarea.style.borderWidth="0";this.textarea.style.width=Math.round(I.width+mxSvgCanvas2D.prototype.foreignObjectPadding)+"px";this.textarea.style.height=Math.round(I.height)+"px";this.textarea.style.overflow="hidden";this.textarea.style.boxSizing="border-box";"wrap"==F[mxConstants.STYLE_WHITE_SPACE]&&(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace=-"normal");var R=parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING,2));B=R+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_TOP,0));O=R+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_BOTTOM,0));var ea=R+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_LEFT,0));R+=parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_RIGHT,0));this.textarea.style.paddingLeft=Math.round(ea)+"px";this.textarea.style.paddingRight=Math.round(R)+"px";this.textarea.style.paddingTop=Math.round(B)+"px";+"normal");var R=parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING,2));B=R+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_TOP,0));O=R+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_BOTTOM,0));var da=R+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_LEFT,0));R+=parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_RIGHT,0));this.textarea.style.paddingLeft=Math.round(da)+"px";this.textarea.style.paddingRight=Math.round(R)+"px";this.textarea.style.paddingTop=Math.round(B)+"px";this.textarea.style.paddingBottom=Math.round(O)+"px";this.textarea.style.display="table-cell";this.textarea.style.flexDirection="";this.textarea.style.justifyContent="";B=mxUtils.getValue(F,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);this.textarea.style.verticalAlign=B==mxConstants.ALIGN_MIDDLE?"middle":B==mxConstants.ALIGN_BOTTOM?"bottom":"top";B=this.textarea.innerText;null!=B&&0<B.length&&(I=this.graph.getAutosizeTextAvailableSpace(F,I.width,I.height,t),null!=I&&(B=mxUtils.htmlEntities(B,!1).replace(/\n/g,"<br>"),F=this.graph.computeAutosizeTextFontSize(B,I.availW,I.availH,F[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,F[mxConstants.STYLE_FONTSTYLE],"wrap"==F[mxConstants.STYLE_WHITE_SPACE]),this.textarea.style.fontSize=F+"px",this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?F*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT))}}else this.textarea.style.width="",this.textarea.style.height="",this.textarea.style.overflow="",this.textarea.style.boxSizing="",this.textarea.style.borderWidth="",this.textarea.style.paddingTop="",this.textarea.style.paddingBottom="",this.textarea.style.paddingLeft="",this.textarea.style.paddingRight="",this.textarea.style.display="",this.textarea.style.flexDirection="",this.textarea.style.justifyContent="",this.textarea.style.verticalAlign="",W.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(t,A){if("0"==mxUtils.getValue(t.style,@@ -3253,60 +3253,61 @@ this.graph.getAdaptiveColors())};mxCellEditorGetCurrentValue=mxCellEditor.prototmxCellEditor.prototype.applyValue=function(t,A){this.graph.getModel().beginUpdate();try{ma.apply(this,arguments),""==A&&this.graph.isCellDeletable(t.cell)&&0==this.graph.model.getChildCount(t.cell)&&this.graph.isTransparentState(t)&&this.graph.removeCells([t.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(t){t=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);t==mxConstants.NONE&&(t=null);return t};mxCellEditor.prototype.getBorderColor=function(t){t=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);t==mxConstants.NONE&&(t=null);return t};mxCellEditor.prototype.getMinimumSize=function(t){var A=this.graph.getView().scale;return new mxRectangle(0,0,null==t.text?30:t.text.size*A+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(t,A){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(A.getEvent)};var ha=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(t){var A=ha.apply(this,arguments);if(null!=A){var B=this.graph.getLockedGroupAncestor(this.graph.model.getParent(A));null!=B&&(A=B)}return A};var N=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(t,A,B){var F=this.graph.model.getParent(t);if(null!=F){if(this.graph.isSelectParentFirst(F))return!this.graph.isCellSelected(F)&&!this.graph.isSiblingSelected(t);-if(this.graph.isTransparentBounds(F))return!1}return N.apply(this,arguments)};var Y=mxConstraintHandler.prototype.getCellForEvent;mxConstraintHandler.prototype.getCellForEvent=function(t,A){var B=Y.apply(this,arguments);if(null!=B&&(null==this.currentFocus||this.currentFocus.cell!=B)){var F=this.graph.getBorderContainer(B,null!=A?A.x:t.getGraphX(),null!=A?A.y:t.getGraphY());null!=F&&(B=F)}return B};var X=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=-function(){for(var t=X.apply(this,arguments),A=this.graph,B=new mxDictionary,F=[],I=0;I<t.length;I++)null==B.get(t[I])&&(B.put(t[I],!0),F.push(t[I]));for(I=0;I<t.length;I++)for(var O=A.model.getParent(t[I]);null!=O&&A.isTransparentBounds(O);)null==B.get(O)&&(B.put(O,!0),F.push(O)),O=A.model.getParent(O);return F};mxGraphView.prototype.formatUnitText=function(t){return t?b(t,this.unit):t};mxGraphHandler.prototype.updateHint=function(t){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==-this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var A=this.graph.view.translate,B=this.graph.view.scale;t=this.roundLength((this.bounds.x+this.currentDx)/B-A.x);A=this.roundLength((this.bounds.y+this.currentDy)/B-A.y);B=this.graph.view.unit;this.hint.innerHTML=b(t,B)+", "+b(A,B);this.hint.style.left=this.pBounds.x+this.currentDx+Math.round((this.pBounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.pBounds.y+this.currentDy+this.pBounds.height+Editor.hintOffset+-"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(null!=this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint),this.hint=null)};var L=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(t,A){L.apply(this,arguments);var B=this.graph.getCellStyle(t);if(null==B.childLayout){var F=this.graph.model.getParent(t),I=null!=F?this.graph.getCellGeometry(F):null;if(null!=I&&(B=this.graph.getCellStyle(F),"stackLayout"==B.childLayout)){var O=parseFloat(mxUtils.getValue(B,-"stackBorder",mxStackLayout.prototype.border));B="1"==mxUtils.getValue(B,"horizontalStack","1");var R=this.graph.getActualStartSize(F);I=I.clone();B?I.height=A.height+R.y+R.height+2*O:I.width=A.width+R.x+R.width+2*O;this.graph.model.setGeometry(F,I)}}};var V=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function t(ea){B.get(ea)||(B.put(ea,!0),I.push(ea))}for(var A=V.apply(this,arguments),B=new mxDictionary,F=this.graph.model,-I=[],O=0;O<A.length;O++){var R=A[O];this.graph.isTableCell(R)?t(F.getParent(F.getParent(R))):this.graph.isTableRow(R)&&t(F.getParent(R));t(R)}return I};var ka=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(t){return ka.apply(this,arguments)&&!mxEvent.isControlDown(t.getEvent())&&!mxEvent.isShiftDown(t.getEvent())};var aa=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return aa.apply(this,arguments)&&!this.graph.isTable(this.state.cell)&&-!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};var la=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(t){var A=la.apply(this,arguments);A.stroke="#C0C0C0";A.strokewidth=1;var B=this.graph.model.getParent(this.state.cell);null!=B&&this.graph.isTransparentBounds(B)&&(A.isDashed=!0);return A};var ra=mxVertexHandler.prototype.isSelectionDashed;mxVertexHandler.prototype.isSelectionDashed=-function(){return this.graph.isTransparentBounds(this.state.cell)?!0:ra.apply(this,arguments)};var U=mxVertexHandler.prototype.getSelectionColor;mxVertexHandler.prototype.getSelectionColor=function(){return this.graph.isTransparentBounds(this.state.cell)&&!this.graph.isCellSelected(this.state.cell)?"#C0C0C0":U.apply(this,arguments)};var ua=mxVertexHandler.prototype.updateParentHighlight;mxVertexHandler.prototype.updateParentHighlight=function(){ua.apply(this,arguments);null!=this.selectionBorder&&-this.graph.isTransparentBounds(this.state.cell)&&(this.selectionBorder.stroke=this.getSelectionColor(),this.selectionBorder.redraw())};var sa=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(t){var A=sa.apply(this,arguments);A.stroke="#C0C0C0";A.strokewidth=1;return A};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var t=this.getHandlePadding();return new mxPoint(this.bounds.x+-this.bounds.width-this.rotationHandleVSpacing+t.x/2,this.bounds.y+this.rotationHandleVSpacing-t.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(t,A){return this.graph.isRecursiveVertexResize(t)&&!mxEvent.isAltDown(A.getEvent())};var Ma=mxVertexHandler.prototype.resizeCell;mxVertexHandler.prototype.resizeCell=function(t,A,B,F,I,O,R){R&&this.graph.isRotatedGroupResize(t)&&(this.childOffsetY=this.childOffsetX=0);Ma.apply(this,arguments)};mxVertexHandler.prototype.isCenteredEvent=function(t,-A){return mxEvent.isControlDown(A.getEvent())||mxEvent.isMetaDown(A.getEvent())};var pa=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return pa.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTransparentBounds(this.state.cell)&&"1"!=mxUtils.getValue(this.state.style,"labelAutoRotate","0")};mxVertexHandler.prototype.isConnectHandleVisible=-function(){return this.graph.isConnectIconVisible(this.state.cell)&&this.graph.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing=-12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var t=this.getHandlePadding(),A=this.graph,B=A.getNestedCornerIconOffset(this.state.cell,this.bounds.x+this.bounds.width,this.bounds.y+-this.bounds.height,function(F){return A.isConnectIconVisible(F)&&A.isEnabled()&&A.isCellConnectable(F)&&!A.isTableCell(F)&&!A.isTableRow(F)&&!A.isTable(F)});return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing+t.x/2+B,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+t.y/2+B)};mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):-this.bounds};var Ea=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){var t=this.graph.model.getParent(this.state.cell);return null!=t&&this.graph.isTransparentBounds(t)?!1:Ea.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var Aa=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(t){return t.tableHandle||t.lockHandle||t.editIconHandle||-t.moveGroupHandle||Aa.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=function(){var t=0;this.graph.isTransparentBounds(this.state.cell)?t=-this.graph.getNestedTransparentBoundsCount(this.state.cell):this.graph.isTableRow(this.state.cell)?t=1:this.graph.isTableCell(this.state.cell)&&(t=2);return t};var Pa=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=-function(){return Pa.apply(this,arguments).grow(-this.getSelectionBorderInset())};var $a=null,Ua=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==$a&&($a=mxCellRenderer.defaultShapes.tableLine);var t=Ua.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var A=function(Ca,Ka,Da){for(var Ya=[],Za=0;Za<Ca.length;Za++){var Ta=Ca[Za];Ya.push(null==Ta?null:new mxPoint((ia+Ta.x+Ka)*O,(da+Ta.y+-Da)*O))}return Ya},B=this,F=this.graph,I=F.model,O=F.view.scale,R=this.state,ea=this.selectionBorder,ia=this.state.origin.x+F.view.translate.x,da=this.state.origin.y+F.view.translate.y;null==t&&(t=[]);var za=F.view.getCellStates(I.getChildCells(this.state.cell,!0));if(0<za.length){var Fa=I.getChildCells(za[0].cell,!0),Ga=F.getTableLines(this.state.cell,!1,!0),ca=F.getTableLines(this.state.cell,!0,!1);for(I=0;I<za.length;I++)mxUtils.bind(this,function(Ca){var Ka=za[Ca],Da=null;if(F.isCellMovable(Ka.cell)){Da=-Ca<za.length-1?za[Ca+1]:null;Da=null!=Da?F.getCellGeometry(Da.cell):null;var Ya=null!=Da&&null!=Da.alternateBounds?Da.alternateBounds:Da;Da=null!=ca[Ca]?new $a(ca[Ca],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Da.isDashed=ea.isDashed;Da.svgStrokeTolerance++;Da=new mxHandle(Ka,"row-resize",null,Da);Da.tableHandle=!0;var Za=0;Da.shape.node.parentNode.insertBefore(Da.shape.node,Da.shape.node.parentNode.firstChild);Da.redraw=function(){if(null!=this.shape){this.shape.stroke=-0==Za?mxConstants.NONE:ea.stroke;if(this.shape.constructor==$a)this.shape.line=A(ca[Ca],0,Za),this.shape.updateBoundsFromLine();else{var Ta=F.getActualStartSize(R.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+Za*O;this.shape.bounds.x=R.x+(Ca==za.length-1?0:Ta.x*O);this.shape.bounds.width=R.width-(Ca==za.length-1?0:Ta.width+Ta.x+O)}this.shape.redraw()}};Da.setPosition=function(Ta,bb,ib){Za=Math.max(Graph.minTableRowHeight-Ta.height,bb.y-Ta.y-Ta.height);null!=-Ya&&mxEvent.isShiftDown(ib.getEvent())&&(Za=Math.min(Za,Ya.height-Graph.minTableRowHeight))};Da.execute=function(Ta){if(0!=Za){var bb=mxEvent.isShiftDown(Ta.getEvent());(Ta=mxEvent.isControlDown(Ta.getEvent())||mxEvent.isMetaDown(Ta.getEvent()))&&bb?F.distributeRows(R.cell):Ta?F.resizeAllTableRows(R.cell,Za):F.setTableRowHeight(this.state.cell,Za,!bb)}else B.blockDelayedSelection||(bb=F.getCellAt(Ta.getGraphX(),Ta.getGraphY())||R.cell,F.graphHandler.selectCellForEvent(bb,Ta));Za=0};Da.reset=function(){Za=-0}}t.push(Da)})(I);for(I=0;I<Fa.length;I++)mxUtils.bind(this,function(Ca){var Ka=F.view.getState(Fa[Ca]),Da=F.getCellGeometry(Fa[Ca]),Ya=null!=Da.alternateBounds?Da.alternateBounds:Da;null==Ka&&(Ka=new mxCellState(F.view,Fa[Ca],F.getCellStyle(Fa[Ca])),Ka.x=R.x+Da.x*O,Ka.y=R.y+Da.y*O,Ka.width=Ya.width*O,Ka.height=Ya.height*O,Ka.updateCachedBounds());Da=Ca<Fa.length-1?Fa[Ca+1]:null;Da=null!=Da?F.getCellGeometry(Da):null;var Za=null!=Da&&null!=Da.alternateBounds?Da.alternateBounds:Da;Da=null!=Ga[Ca]?-new $a(Ga[Ca],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Da.isDashed=ea.isDashed;Da.svgStrokeTolerance++;Ka=new mxHandle(Ka,"col-resize",null,Da);Ka.tableHandle=!0;var Ta=0;Ka.shape.node.parentNode.insertBefore(Ka.shape.node,Ka.shape.node.parentNode.firstChild);Ka.redraw=function(){if(null!=this.shape){this.shape.stroke=0==Ta?mxConstants.NONE:ea.stroke;if(this.shape.constructor==$a)this.shape.line=A(Ga[Ca],Ta,0),this.shape.updateBoundsFromLine();else{var bb=F.getActualStartSize(R.cell,-!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(Ya.width+Ta)*O;this.shape.bounds.y=R.y+(Ca==Fa.length-1?0:bb.y*O);this.shape.bounds.height=R.height-(Ca==Fa.length-1?0:(bb.height+bb.y)*O)}this.shape.redraw()}};Ka.setPosition=function(bb,ib,nb){Ta=Math.max(Graph.minTableColumnWidth-Ya.width,ib.x-bb.x-Ya.width);null!=Za&&mxEvent.isShiftDown(nb.getEvent())&&(Ta=Math.min(Ta,Za.width-Graph.minTableColumnWidth))};Ka.execute=function(bb){if(0!=Ta){var ib=mxEvent.isShiftDown(bb.getEvent());-(bb=mxEvent.isControlDown(bb.getEvent())||mxEvent.isMetaDown(bb.getEvent()))&&ib?F.distributeColumns(R.cell):bb?F.resizeAllTableColumns(R.cell,Ta):F.setTableColumnWidth(this.state.cell,Ta,!ib)}else B.blockDelayedSelection||(ib=F.getCellAt(bb.getGraphX(),bb.getGraphY())||R.cell,F.graphHandler.selectCellForEvent(ib,bb));Ta=0};Ka.positionChanged=function(){};Ka.reset=function(){Ta=0};t.push(Ka)})(I)}}if(this.graph.isLockedGroupIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){null==-t&&(t=[]);B=this;F=this.graph;var wa=this.state.cell,ya=16,Ia=this.graph.isLockedGroup(wa);I=new mxImageShape(new mxRectangle(0,0,ya,ya),(Ia?HoverIcons.prototype.lockHandle:HoverIcons.prototype.unlockHandle).src);I.preserveImageAspect=!1;I=new mxHandle(this.state,"pointer",null,I);I.lockHandle=!0;I.setPosition=function(){};I.positionChanged=function(){};I.reset=function(){};I.redraw=function(){if(null!=this.shape){var Ca=B.getHandlePadding(),Ka=F.getNestedCornerIconOffset(wa,B.bounds.x,B.bounds.y,-function(Za){return F.isLockedGroupIconVisible(Za)&&F.isCellMovable(Za)});Ca=new mxPoint(B.bounds.x-12-Ca.x/2-Ka,B.bounds.y-12-Ca.y/2-Ka);F.isMoveIconVisible(wa)&&F.isCellMovable(wa)&&(Ca.y+=24);Ka=Number(null!=B.currentAlpha?B.currentAlpha:B.state.style[mxConstants.STYLE_ROTATION]||"0");var Da=mxUtils.toRadians(Ka);if(0!=Da){var Ya=new mxPoint(B.state.getCenterX(),B.state.getCenterY());Ca=mxUtils.getRotatedPoint(Ca,Math.cos(Da),Math.sin(Da),Ya)}this.shape.bounds.width=ya;this.shape.bounds.height=-ya;this.shape.bounds.x=Ca.x-ya/2;this.shape.bounds.y=Ca.y-ya/2;this.shape.rotation=Ka;this.shape.redraw()}};I.execute=function(Ca){F.getModel().beginUpdate();try{F.setCellStyles("lockedGroup",Ia?"0":"1",[wa])}finally{F.getModel().endUpdate()}if(!Ia){Ca=F.getSelectionCells();for(var Ka=[],Da=0;Da<Ca.length;Da++)Ca[Da]!=wa&&F.model.isAncestor(wa,Ca[Da])||Ka.push(Ca[Da]);Ka.length!=Ca.length&&F.setSelectionCells(0<Ka.length?Ka:[wa])}};t.push(I)}this.graph.isEditIconVisible(this.state.cell)&&(null==t&&-(t=[]),B=this,F=this.graph,wa=this.state.cell,ya=16,I=new mxImageShape(new mxRectangle(0,0,ya,ya),HoverIcons.prototype.editHandle.src),I.preserveImageAspect=!1,I=new mxHandle(this.state,"pointer",null,I),I.editIconHandle=!0,I.setPosition=function(){},I.positionChanged=function(){},I.reset=function(){},I.redraw=function(){if(null!=this.shape){var Ca=B.getHandlePadding(),Ka=F.getNestedCornerIconOffset(wa,B.bounds.x,B.bounds.y,function(Za){return F.isEditIconVisible(Za)});Ca=new mxPoint(B.bounds.x-12--Ca.x/2-Ka,B.bounds.y-12-Ca.y/2-Ka);F.isCellMovable(wa)&&(F.isLockedGroupIconVisible(wa)||F.isMoveIconVisible(wa))&&(Ca.x+=24);Ka=Number(null!=B.currentAlpha?B.currentAlpha:B.state.style[mxConstants.STYLE_ROTATION]||"0");var Da=mxUtils.toRadians(Ka);if(0!=Da){var Ya=new mxPoint(B.state.getCenterX(),B.state.getCenterY());Ca=mxUtils.getRotatedPoint(Ca,Math.cos(Da),Math.sin(Da),Ya)}this.shape.bounds.width=ya;this.shape.bounds.height=ya;this.shape.bounds.x=Ca.x-ya/2;this.shape.bounds.y=Ca.y-ya/2;this.shape.rotation=-Ka;this.shape.redraw()}},I.execute=function(Ca){F.startEditingAtCell(wa)},t.push(I));this.graph.isMoveIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&(null==t&&(t=[]),B=this,F=this.graph,wa=this.state.cell,ya=16,I=new mxImageShape(new mxRectangle(0,0,ya,ya),HoverIcons.prototype.moveHandle.src),I.preserveImageAspect=!1,I=new mxHandle(this.state,"move",null,I),I.moveGroupHandle=!0,I.setPosition=function(){},I.positionChanged=function(){},I.execute=function(){},I.reset=function(){},-I.redraw=function(){if(null!=this.shape){var Ca=B.getHandlePadding(),Ka=F.getNestedCornerIconOffset(wa,B.bounds.x,B.bounds.y,function(Ya){return F.isMoveIconVisible(Ya)&&F.isCellMovable(Ya)}),Da=B.bounds.x-12-Ca.x/2-Ka;Ca=B.bounds.y-12-Ca.y/2-Ka;this.shape.bounds.width=ya;this.shape.bounds.height=ya;this.shape.bounds.x=Da-ya/2;this.shape.bounds.y=Ca-ya/2;this.shape.redraw()}},t.push(I));return null!=t?t.reverse():null};var Va=mxVertexHandler.prototype.setHandlesVisible,Ha=mxVertexHandler.prototype.start;-mxVertexHandler.prototype.start=function(t,A,B){Ha.apply(this,arguments);var F=this.graph;if(null!=this.parentState&&F.isTransparentBounds(this.parentState.cell)){var I=F.view.scale,O=F.view.translate,R=this.parentState;this.parentState=R.clone();this.parentState.x=I*(O.x+R.origin.x);this.parentState.y=I*(O.y+R.origin.y)}for(I=F.model.getParent(this.state.cell);null!=I;)F.isTransparentBounds(I)&&(O=F.selectionCellsHandler.getHandler(I),null!=O&&null!=O.selectionBorder&&(O.selectionBorder.node.style.visibility=-"hidden")),I=F.model.getParent(I);if(!this.livePreviewActive&&null==this.ghostPreview&&null!=this.index&&this.index!=mxEvent.LABEL_HANDLE&&null!=this.sizers){for(F=0;F<this.sizers.length;F++)null!=this.sizers[F]&&F!=this.index&&(this.sizers[F].node.style.display="none");null!=this.rotationShape&&this.index!=mxEvent.ROTATION_HANDLE&&(this.rotationShape.node.style.visibility="hidden");this.resizeHandlesHidden=!0}};var Oa=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){if(this.resizeHandlesHidden){if(null!=-this.sizers)for(var t=0;t<this.sizers.length;t++)null!=this.sizers[t]&&(this.sizers[t].node.style.display="");null!=this.rotationShape&&(this.rotationShape.node.style.visibility="");this.resizeHandlesHidden=null}t=this.graph;for(var A=null!=this.state?t.model.getParent(this.state.cell):null;null!=A;){if(t.isTransparentBounds(A)){var B=t.selectionCellsHandler.getHandler(A);null!=B&&null!=B.selectionBorder&&(B.selectionBorder.node.style.visibility="")}A=t.model.getParent(A)}Oa.apply(this,arguments)};-mxVertexHandler.prototype.setHandlesVisible=function(t){Va.apply(this,arguments);if(null!=this.moveHandles)for(var A=0;A<this.moveHandles.length;A++)null!=this.moveHandles[A]&&(this.moveHandles[A].node.style.visibility=t?"":"hidden");if(null!=this.cornerHandles)for(A=0;A<this.cornerHandles.length;A++)this.cornerHandles[A].node.style.visibility=t?"":"hidden";this.graph.isTransparentBounds(this.state.cell)&&null!=this.selectionBorder&&(this.selectionBorder.node.style.visibility=t?"":"hidden")};mxVertexHandler.prototype.isMoveHandlesVisible=-function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};mxVertexHandler.prototype.refreshMoveHandles=function(){var t=this.isMoveHandlesVisible();t&&null==this.moveHandles?this.moveHandles=this.createMoveHandles():t||null==this.moveHandles||this.destroyMoveHandles();if(t&&null==this.moveHandles){for(t=0;t<this.moveHandles.length;t++)null!=this.moveHandles[t]&&this.moveHandles[t].parentNode.removeChild(this.moveHandles[t]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=-function(){for(var t=this.graph,A=t.model,B=[],F=0;F<A.getChildCount(this.state.cell);F++)mxUtils.bind(this,function(I){if(null!=I&&A.isVertex(I.cell)&&t.isCellMovable(I.cell)){var O=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);O=new mxImageShape(O,this.rowHandleImage.src);O.rowState=I;O.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;O.init(this.graph.getView().getOverlayPane());O.node.style.cursor="move";mxEvent.addGestureListeners(O.node,-mxUtils.bind(this,function(R){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(R)&&this.graph.isCellSelected(I.cell)||this.graph.selectCellForEvent(I.cell,R);mxEvent.isPopupTrigger(R)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(R),mxEvent.getClientY(R),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(R),this.graph.isMouseDown=!0);mxEvent.consume(R)}),null,mxUtils.bind(this,-function(R){mxEvent.isPopupTrigger(R)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(R),mxEvent.getClientY(R),I.cell,R),mxEvent.consume(R))}));B.push(O)}else B.push(null)})(this.graph.view.getState(A.getChildAt(this.state.cell,F)));return B};mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var t=0;t<this.moveHandles.length;t++)null!=this.moveHandles[t]&&this.moveHandles[t].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=-function(){if(null!=this.cornerHandles){for(var t=0;t<this.cornerHandles.length;t++)null!=this.cornerHandles[t]&&null!=this.cornerHandles[t].node&&null!=this.cornerHandles[t].node.parentNode&&this.cornerHandles[t].node.parentNode.removeChild(this.cornerHandles[t].node);this.cornerHandles=null}};var oa=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){oa.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();if(this.graph.isTable(this.state.cell)&&-this.graph.isCellMovable(this.state.cell))this.refreshMoveHandles();else if(this.graph.isCellMovable(this.state.cell)&&(this.graph.isTransparentBounds(this.state.cell)||1==this.graph.getSelectionCount()&&(this.graph.isTableCell(this.state.cell)||this.graph.isTableRow(this.state.cell)))){this.cornerHandles=[];for(var t=0;4>t;t++){var A=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);A.dialect=mxConstants.DIALECT_SVG;A.init(this.graph.view.getOverlayPane());this.cornerHandles.push(A)}}this.graph.isTable(this.state.cell)&&-this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();t=this.graph.getLinkForCell(this.state.cell);A=this.graph.getLinksForState(this.state);this.updateLinkHint(t,A)};var Ja=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var t=new mxPoint(0,0),A=this.tolerance,B=this.state.style.shape;null==mxCellRenderer.defaultShapes[B]&&mxStencilRegistry.getStencil(B);B=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==-this.state.cell;if(!B&&null!=this.customHandles)for(var F=0;F<this.customHandles.length;F++)if(null!=this.customHandles[F]&&!this.customHandles[F].lockHandle&&!this.customHandles[F].editIconHandle&&!this.customHandles[F].moveGroupHandle&&null!=this.customHandles[F].shape&&null!=this.customHandles[F].shape.bounds){var I=this.customHandles[F].shape.bounds,O=I.getCenterX(),R=I.getCenterY();if(Math.abs(this.state.x-O)<I.width/2||Math.abs(this.state.y-R)<I.height/2||Math.abs(this.state.x+this.state.width--O)<I.width/2||Math.abs(this.state.y+this.state.height-R)<I.height/2){B=!0;break}}B&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(A/=2,this.graph.isTable(this.state.cell)&&(A+=7),t.x=this.sizers[0].bounds.width+A,t.y=this.sizers[0].bounds.height+A):t=Ja.apply(this,arguments);return t};mxVertexHandler.prototype.updateHint=function(t){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=-this.currentAlpha+"°";else{t=this.state.view.scale;var A=this.state.view.unit;this.hint.innerHTML=b(this.roundLength(this.bounds.width/t),A)+" x "+b(this.roundLength(this.bounds.height/t),A)}t=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==t&&(t=this.bounds);this.hint.style.left=t.x+Math.round((t.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=t.y+t.height+Editor.hintOffset+"px";null!=this.linkHint&&-(this.linkHint.style.display="none")}};mxVertexHandler.prototype.removeHint=function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};var db=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=function(){db.apply(this,arguments);var t=this.graph.getLinkForCell(this.state.cell),A=this.graph.getLinksForState(this.state);this.updateLinkHint(t,A)};var rb=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(t,-A){rb.apply(this,arguments);null!=this.linkHint&&"none"!=this.linkHint.style.display&&null!=this.graph.graphHandler&&null!=this.graph.graphHandler.first&&(this.linkHint.style.display="none")};var jb=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(t,A){jb.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(t,A,B){null==this.hint&&(this.hint=-a(),this.state.view.graph.container.appendChild(this.hint));var F=this.graph.view.translate,I=this.graph.view.scale,O=this.roundLength(A.x/I-F.x);F=this.roundLength(A.y/I-F.y);var R=this.graph.view.unit;this.hint.innerHTML=b(O,R)+", "+b(F,R);this.hint.style.visibility="visible";null!=B&&(B.view.updateEdgeBounds(B),this.hint.innerHTML+=" ("+(R==mxConstants.POINTS?Math.round(B.length/I):b(B.length/I,R))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&-null!=this.constraintHandler.currentFocus?(B=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*B.x)+"%, "+Math.round(100*B.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(t.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(t.getGraphY(),A.y)+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")};Graph.createFoldingImage=function(t,A){return A?Graph.createSvgImage(t,-t,'<defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 4.5 2 L 4.5 7 M 2 4.5 L 7 4.5 z" stroke="#000"/>',9,9):Graph.createSvgImage(t,t,'<defs><linearGradient id="grad1" x1="50%" y1="0%" x2="50%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 2 4.5 L 7 4.5 z" stroke="#000"/>',-9,9)};Graph.updateFoldingImages=function(t){Graph.prototype.expandedImage=Graph.createFoldingImage(t,!1);Graph.prototype.collapsedImage=Graph.createFoldingImage(t,!0)};Graph.updateFoldingImages(9);Graph.foldingImages={};Graph.prototype.getFoldingImage=function(t){var A=mxGraph.prototype.getFoldingImage.apply(this,arguments);if(null!=A){var B=parseInt(mxUtils.getValue(t.style,"foldingIconSize",0));if(0<B){var F=B+"-"+this.isCellCollapsed(t.cell);A=Graph.foldingImages[F];null==A&&(A=Graph.createFoldingImage(B,-this.isCellCollapsed(t.cell)),Graph.foldingImages[F]=A)}}return A};mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;HoverIcons.prototype.mainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,-'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.endFixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.terminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="'+-HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.endTerminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.rotationHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" fill="'+HoverIcons.prototype.arrowFill+'" d="M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"/>',+if(this.graph.isTransparentBounds(F))return!1}return N.apply(this,arguments)};var Y=mxConstraintHandler.prototype.getCellForEvent;mxConstraintHandler.prototype.getCellForEvent=function(t,A){var B=Y.apply(this,arguments),F=null!=A?A.x:t.getGraphX(),I=null!=A?A.y:t.getGraphY();if(null!=B&&this.graph.model.isEdge(B)){var O=this.graph.model;B=this.graph.getCellAt(F,I,null,!0,!1,function(da){return O.isEdge(O.getParent(da.cell))});if(null!=B&&!this.graph.isCellConnectable(B)){var R=O.getParent(B);O.isVertex(R)&&+this.graph.isCellConnectable(R)&&(B=R)}B=this.graph.isCellLocked(B)?null:B}null==B||null!=this.currentFocus&&this.currentFocus.cell==B||(F=this.graph.getBorderContainer(B,F,I),null!=F&&(B=F));return B};var X=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){for(var t=X.apply(this,arguments),A=this.graph,B=new mxDictionary,F=[],I=0;I<t.length;I++)null==B.get(t[I])&&(B.put(t[I],!0),F.push(t[I]));for(I=0;I<t.length;I++)for(var O=+A.model.getParent(t[I]);null!=O&&A.isTransparentBounds(O);)null==B.get(O)&&(B.put(O,!0),F.push(O)),O=A.model.getParent(O);return F};mxGraphView.prototype.formatUnitText=function(t){return t?b(t,this.unit):t};mxGraphHandler.prototype.updateHint=function(t){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var A=this.graph.view.translate,B=this.graph.view.scale;t=this.roundLength((this.bounds.x+this.currentDx)/+B-A.x);A=this.roundLength((this.bounds.y+this.currentDy)/B-A.y);B=this.graph.view.unit;this.hint.innerHTML=b(t,B)+", "+b(A,B);this.hint.style.left=this.pBounds.x+this.currentDx+Math.round((this.pBounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.pBounds.y+this.currentDy+this.pBounds.height+Editor.hintOffset+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(null!=this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint),this.hint=null)};var L=mxStackLayout.prototype.resizeCell;+mxStackLayout.prototype.resizeCell=function(t,A){L.apply(this,arguments);var B=this.graph.getCellStyle(t);if(null==B.childLayout){var F=this.graph.model.getParent(t),I=null!=F?this.graph.getCellGeometry(F):null;if(null!=I&&(B=this.graph.getCellStyle(F),"stackLayout"==B.childLayout)){var O=parseFloat(mxUtils.getValue(B,"stackBorder",mxStackLayout.prototype.border));B="1"==mxUtils.getValue(B,"horizontalStack","1");var R=this.graph.getActualStartSize(F);I=I.clone();B?I.height=A.height+R.y+R.height+2*+O:I.width=A.width+R.x+R.width+2*O;this.graph.model.setGeometry(F,I)}}};var V=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function t(da){B.get(da)||(B.put(da,!0),I.push(da))}for(var A=V.apply(this,arguments),B=new mxDictionary,F=this.graph.model,I=[],O=0;O<A.length;O++){var R=A[O];this.graph.isTableCell(R)?t(F.getParent(F.getParent(R))):this.graph.isTableRow(R)&&t(F.getParent(R));t(R)}return I};var ka=mxConnectionHandler.prototype.isStartEvent;+mxConnectionHandler.prototype.isStartEvent=function(t){return ka.apply(this,arguments)&&!mxEvent.isControlDown(t.getEvent())&&!mxEvent.isShiftDown(t.getEvent())};var aa=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return aa.apply(this,arguments)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};var la=mxVertexHandler.prototype.createParentHighlightShape;+mxVertexHandler.prototype.createParentHighlightShape=function(t){var A=la.apply(this,arguments);A.stroke="#C0C0C0";A.strokewidth=1;var B=this.graph.model.getParent(this.state.cell);null!=B&&this.graph.isTransparentBounds(B)&&(A.isDashed=!0);return A};var ra=mxVertexHandler.prototype.isSelectionDashed;mxVertexHandler.prototype.isSelectionDashed=function(){return this.graph.isTransparentBounds(this.state.cell)?!0:ra.apply(this,arguments)};var U=mxVertexHandler.prototype.getSelectionColor;mxVertexHandler.prototype.getSelectionColor=+function(){return this.graph.isTransparentBounds(this.state.cell)&&!this.graph.isCellSelected(this.state.cell)?"#C0C0C0":U.apply(this,arguments)};var ua=mxVertexHandler.prototype.updateParentHighlight;mxVertexHandler.prototype.updateParentHighlight=function(){ua.apply(this,arguments);null!=this.selectionBorder&&this.graph.isTransparentBounds(this.state.cell)&&(this.selectionBorder.stroke=this.getSelectionColor(),this.selectionBorder.redraw())};var sa=mxEdgeHandler.prototype.createParentHighlightShape;+mxEdgeHandler.prototype.createParentHighlightShape=function(t){var A=sa.apply(this,arguments);A.stroke="#C0C0C0";A.strokewidth=1;return A};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var t=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+t.x/2,this.bounds.y+this.rotationHandleVSpacing-t.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(t,A){return this.graph.isRecursiveVertexResize(t)&&+!mxEvent.isAltDown(A.getEvent())};var Ma=mxVertexHandler.prototype.resizeCell;mxVertexHandler.prototype.resizeCell=function(t,A,B,F,I,O,R){R&&this.graph.isRotatedGroupResize(t)&&(this.childOffsetY=this.childOffsetX=0);Ma.apply(this,arguments)};mxVertexHandler.prototype.isCenteredEvent=function(t,A){return mxEvent.isControlDown(A.getEvent())||mxEvent.isMetaDown(A.getEvent())};var pa=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return pa.apply(this,+arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTransparentBounds(this.state.cell)&&"1"!=mxUtils.getValue(this.state.style,"labelAutoRotate","0")};mxVertexHandler.prototype.isConnectHandleVisible=function(){return this.graph.isConnectIconVisible(this.state.cell)&&this.graph.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&+!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing=-12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var t=this.getHandlePadding(),A=this.graph,B=A.getNestedCornerIconOffset(this.state.cell,this.bounds.x+this.bounds.width,this.bounds.y+this.bounds.height,function(F){return A.isConnectIconVisible(F)&&A.isEnabled()&&A.isCellConnectable(F)&&!A.isTableCell(F)&&!A.isTableRow(F)&&!A.isTable(F)});return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing++t.x/2+B,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+t.y/2+B)};mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):this.bounds};var Ea=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){var t=this.graph.model.getParent(this.state.cell);return null!=t&&this.graph.isTransparentBounds(t)?+!1:Ea.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var Aa=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(t){return t.tableHandle||t.lockHandle||t.editIconHandle||t.moveGroupHandle||Aa.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=function(){var t=0;this.graph.isTransparentBounds(this.state.cell)?+t=-this.graph.getNestedTransparentBoundsCount(this.state.cell):this.graph.isTableRow(this.state.cell)?t=1:this.graph.isTableCell(this.state.cell)&&(t=2);return t};var Pa=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return Pa.apply(this,arguments).grow(-this.getSelectionBorderInset())};var $a=null,Ua=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==$a&&($a=mxCellRenderer.defaultShapes.tableLine);+var t=Ua.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var A=function(Ca,Ka,Da){for(var Ya=[],Za=0;Za<Ca.length;Za++){var Ta=Ca[Za];Ya.push(null==Ta?null:new mxPoint((ia+Ta.x+Ka)*O,(ea+Ta.y+Da)*O))}return Ya},B=this,F=this.graph,I=F.model,O=F.view.scale,R=this.state,da=this.selectionBorder,ia=this.state.origin.x+F.view.translate.x,ea=this.state.origin.y+F.view.translate.y;null==t&&(t=[]);var za=F.view.getCellStates(I.getChildCells(this.state.cell,+!0));if(0<za.length){var Fa=I.getChildCells(za[0].cell,!0),Ga=F.getTableLines(this.state.cell,!1,!0),ca=F.getTableLines(this.state.cell,!0,!1);for(I=0;I<za.length;I++)mxUtils.bind(this,function(Ca){var Ka=za[Ca],Da=null;if(F.isCellMovable(Ka.cell)){Da=Ca<za.length-1?za[Ca+1]:null;Da=null!=Da?F.getCellGeometry(Da.cell):null;var Ya=null!=Da&&null!=Da.alternateBounds?Da.alternateBounds:Da;Da=null!=ca[Ca]?new $a(ca[Ca],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Da.isDashed=+da.isDashed;Da.svgStrokeTolerance++;Da=new mxHandle(Ka,"row-resize",null,Da);Da.tableHandle=!0;var Za=0;Da.shape.node.parentNode.insertBefore(Da.shape.node,Da.shape.node.parentNode.firstChild);Da.redraw=function(){if(null!=this.shape){this.shape.stroke=0==Za?mxConstants.NONE:da.stroke;if(this.shape.constructor==$a)this.shape.line=A(ca[Ca],0,Za),this.shape.updateBoundsFromLine();else{var Ta=F.getActualStartSize(R.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height++Za*O;this.shape.bounds.x=R.x+(Ca==za.length-1?0:Ta.x*O);this.shape.bounds.width=R.width-(Ca==za.length-1?0:Ta.width+Ta.x+O)}this.shape.redraw()}};Da.setPosition=function(Ta,bb,ib){Za=Math.max(Graph.minTableRowHeight-Ta.height,bb.y-Ta.y-Ta.height);null!=Ya&&mxEvent.isShiftDown(ib.getEvent())&&(Za=Math.min(Za,Ya.height-Graph.minTableRowHeight))};Da.execute=function(Ta){if(0!=Za){var bb=mxEvent.isShiftDown(Ta.getEvent());(Ta=mxEvent.isControlDown(Ta.getEvent())||mxEvent.isMetaDown(Ta.getEvent()))&&bb?+F.distributeRows(R.cell):Ta?F.resizeAllTableRows(R.cell,Za):F.setTableRowHeight(this.state.cell,Za,!bb)}else B.blockDelayedSelection||(bb=F.getCellAt(Ta.getGraphX(),Ta.getGraphY())||R.cell,F.graphHandler.selectCellForEvent(bb,Ta));Za=0};Da.reset=function(){Za=0}}t.push(Da)})(I);for(I=0;I<Fa.length;I++)mxUtils.bind(this,function(Ca){var Ka=F.view.getState(Fa[Ca]),Da=F.getCellGeometry(Fa[Ca]),Ya=null!=Da.alternateBounds?Da.alternateBounds:Da;null==Ka&&(Ka=new mxCellState(F.view,Fa[Ca],F.getCellStyle(Fa[Ca])),+Ka.x=R.x+Da.x*O,Ka.y=R.y+Da.y*O,Ka.width=Ya.width*O,Ka.height=Ya.height*O,Ka.updateCachedBounds());Da=Ca<Fa.length-1?Fa[Ca+1]:null;Da=null!=Da?F.getCellGeometry(Da):null;var Za=null!=Da&&null!=Da.alternateBounds?Da.alternateBounds:Da;Da=null!=Ga[Ca]?new $a(Ga[Ca],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Da.isDashed=da.isDashed;Da.svgStrokeTolerance++;Ka=new mxHandle(Ka,"col-resize",null,Da);Ka.tableHandle=!0;var Ta=0;Ka.shape.node.parentNode.insertBefore(Ka.shape.node,+Ka.shape.node.parentNode.firstChild);Ka.redraw=function(){if(null!=this.shape){this.shape.stroke=0==Ta?mxConstants.NONE:da.stroke;if(this.shape.constructor==$a)this.shape.line=A(Ga[Ca],Ta,0),this.shape.updateBoundsFromLine();else{var bb=F.getActualStartSize(R.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(Ya.width+Ta)*O;this.shape.bounds.y=R.y+(Ca==Fa.length-1?0:bb.y*O);this.shape.bounds.height=R.height-(Ca==Fa.length-1?0:(bb.height+bb.y)*O)}this.shape.redraw()}};Ka.setPosition=+function(bb,ib,nb){Ta=Math.max(Graph.minTableColumnWidth-Ya.width,ib.x-bb.x-Ya.width);null!=Za&&mxEvent.isShiftDown(nb.getEvent())&&(Ta=Math.min(Ta,Za.width-Graph.minTableColumnWidth))};Ka.execute=function(bb){if(0!=Ta){var ib=mxEvent.isShiftDown(bb.getEvent());(bb=mxEvent.isControlDown(bb.getEvent())||mxEvent.isMetaDown(bb.getEvent()))&&ib?F.distributeColumns(R.cell):bb?F.resizeAllTableColumns(R.cell,Ta):F.setTableColumnWidth(this.state.cell,Ta,!ib)}else B.blockDelayedSelection||(ib=F.getCellAt(bb.getGraphX(),+bb.getGraphY())||R.cell,F.graphHandler.selectCellForEvent(ib,bb));Ta=0};Ka.positionChanged=function(){};Ka.reset=function(){Ta=0};t.push(Ka)})(I)}}if(this.graph.isLockedGroupIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){null==t&&(t=[]);B=this;F=this.graph;var wa=this.state.cell,ya=16,Ia=this.graph.isLockedGroup(wa);I=new mxImageShape(new mxRectangle(0,0,ya,ya),(Ia?HoverIcons.prototype.lockHandle:HoverIcons.prototype.unlockHandle).src);I.preserveImageAspect=!1;I=new mxHandle(this.state,+"pointer",null,I);I.lockHandle=!0;I.setPosition=function(){};I.positionChanged=function(){};I.reset=function(){};I.redraw=function(){if(null!=this.shape){var Ca=B.getHandlePadding(),Ka=F.getNestedCornerIconOffset(wa,B.bounds.x,B.bounds.y,function(Za){return F.isLockedGroupIconVisible(Za)&&F.isCellMovable(Za)});Ca=new mxPoint(B.bounds.x-12-Ca.x/2-Ka,B.bounds.y-12-Ca.y/2-Ka);F.isMoveIconVisible(wa)&&F.isCellMovable(wa)&&(Ca.y+=24);Ka=Number(null!=B.currentAlpha?B.currentAlpha:B.state.style[mxConstants.STYLE_ROTATION]||+"0");var Da=mxUtils.toRadians(Ka);if(0!=Da){var Ya=new mxPoint(B.state.getCenterX(),B.state.getCenterY());Ca=mxUtils.getRotatedPoint(Ca,Math.cos(Da),Math.sin(Da),Ya)}this.shape.bounds.width=ya;this.shape.bounds.height=ya;this.shape.bounds.x=Ca.x-ya/2;this.shape.bounds.y=Ca.y-ya/2;this.shape.rotation=Ka;this.shape.redraw()}};I.execute=function(Ca){F.getModel().beginUpdate();try{F.setCellStyles("lockedGroup",Ia?"0":"1",[wa])}finally{F.getModel().endUpdate()}if(!Ia){Ca=F.getSelectionCells();for(var Ka=+[],Da=0;Da<Ca.length;Da++)Ca[Da]!=wa&&F.model.isAncestor(wa,Ca[Da])||Ka.push(Ca[Da]);Ka.length!=Ca.length&&F.setSelectionCells(0<Ka.length?Ka:[wa])}};t.push(I)}this.graph.isEditIconVisible(this.state.cell)&&(null==t&&(t=[]),B=this,F=this.graph,wa=this.state.cell,ya=16,I=new mxImageShape(new mxRectangle(0,0,ya,ya),HoverIcons.prototype.editHandle.src),I.preserveImageAspect=!1,I=new mxHandle(this.state,"pointer",null,I),I.editIconHandle=!0,I.setPosition=function(){},I.positionChanged=function(){},I.reset=+function(){},I.redraw=function(){if(null!=this.shape){var Ca=B.getHandlePadding(),Ka=F.getNestedCornerIconOffset(wa,B.bounds.x,B.bounds.y,function(Za){return F.isEditIconVisible(Za)});Ca=new mxPoint(B.bounds.x-12-Ca.x/2-Ka,B.bounds.y-12-Ca.y/2-Ka);F.isCellMovable(wa)&&(F.isLockedGroupIconVisible(wa)||F.isMoveIconVisible(wa))&&(Ca.x+=24);Ka=Number(null!=B.currentAlpha?B.currentAlpha:B.state.style[mxConstants.STYLE_ROTATION]||"0");var Da=mxUtils.toRadians(Ka);if(0!=Da){var Ya=new mxPoint(B.state.getCenterX(),+B.state.getCenterY());Ca=mxUtils.getRotatedPoint(Ca,Math.cos(Da),Math.sin(Da),Ya)}this.shape.bounds.width=ya;this.shape.bounds.height=ya;this.shape.bounds.x=Ca.x-ya/2;this.shape.bounds.y=Ca.y-ya/2;this.shape.rotation=Ka;this.shape.redraw()}},I.execute=function(Ca){F.startEditingAtCell(wa)},t.push(I));this.graph.isMoveIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&(null==t&&(t=[]),B=this,F=this.graph,wa=this.state.cell,ya=16,I=new mxImageShape(new mxRectangle(0,0,ya,ya),HoverIcons.prototype.moveHandle.src),+I.preserveImageAspect=!1,I=new mxHandle(this.state,"move",null,I),I.moveGroupHandle=!0,I.setPosition=function(){},I.positionChanged=function(){},I.execute=function(){},I.reset=function(){},I.redraw=function(){if(null!=this.shape){var Ca=B.getHandlePadding(),Ka=F.getNestedCornerIconOffset(wa,B.bounds.x,B.bounds.y,function(Ya){return F.isMoveIconVisible(Ya)&&F.isCellMovable(Ya)}),Da=B.bounds.x-12-Ca.x/2-Ka;Ca=B.bounds.y-12-Ca.y/2-Ka;this.shape.bounds.width=ya;this.shape.bounds.height=ya;this.shape.bounds.x=+Da-ya/2;this.shape.bounds.y=Ca-ya/2;this.shape.redraw()}},t.push(I));return null!=t?t.reverse():null};var Va=mxVertexHandler.prototype.setHandlesVisible,Ha=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(t,A,B){Ha.apply(this,arguments);var F=this.graph;if(null!=this.parentState&&F.isTransparentBounds(this.parentState.cell)){var I=F.view.scale,O=F.view.translate,R=this.parentState;this.parentState=R.clone();this.parentState.x=I*(O.x+R.origin.x);this.parentState.y=I*(O.y+R.origin.y)}for(I=+F.model.getParent(this.state.cell);null!=I;)F.isTransparentBounds(I)&&(O=F.selectionCellsHandler.getHandler(I),null!=O&&null!=O.selectionBorder&&(O.selectionBorder.node.style.visibility="hidden")),I=F.model.getParent(I);if(!this.livePreviewActive&&null==this.ghostPreview&&null!=this.index&&this.index!=mxEvent.LABEL_HANDLE&&null!=this.sizers){for(F=0;F<this.sizers.length;F++)null!=this.sizers[F]&&F!=this.index&&(this.sizers[F].node.style.display="none");null!=this.rotationShape&&this.index!=mxEvent.ROTATION_HANDLE&&+(this.rotationShape.node.style.visibility="hidden");this.resizeHandlesHidden=!0}};var Oa=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){if(this.resizeHandlesHidden){if(null!=this.sizers)for(var t=0;t<this.sizers.length;t++)null!=this.sizers[t]&&(this.sizers[t].node.style.display="");null!=this.rotationShape&&(this.rotationShape.node.style.visibility="");this.resizeHandlesHidden=null}t=this.graph;for(var A=null!=this.state?t.model.getParent(this.state.cell):null;null!=A;){if(t.isTransparentBounds(A)){var B=+t.selectionCellsHandler.getHandler(A);null!=B&&null!=B.selectionBorder&&(B.selectionBorder.node.style.visibility="")}A=t.model.getParent(A)}Oa.apply(this,arguments)};mxVertexHandler.prototype.setHandlesVisible=function(t){Va.apply(this,arguments);if(null!=this.moveHandles)for(var A=0;A<this.moveHandles.length;A++)null!=this.moveHandles[A]&&(this.moveHandles[A].node.style.visibility=t?"":"hidden");if(null!=this.cornerHandles)for(A=0;A<this.cornerHandles.length;A++)this.cornerHandles[A].node.style.visibility=+t?"":"hidden";this.graph.isTransparentBounds(this.state.cell)&&null!=this.selectionBorder&&(this.selectionBorder.node.style.visibility=t?"":"hidden")};mxVertexHandler.prototype.isMoveHandlesVisible=function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};mxVertexHandler.prototype.refreshMoveHandles=function(){var t=this.isMoveHandlesVisible();t&&null==this.moveHandles?this.moveHandles=this.createMoveHandles():t||null==this.moveHandles||this.destroyMoveHandles();+if(t&&null==this.moveHandles){for(t=0;t<this.moveHandles.length;t++)null!=this.moveHandles[t]&&this.moveHandles[t].parentNode.removeChild(this.moveHandles[t]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=function(){for(var t=this.graph,A=t.model,B=[],F=0;F<A.getChildCount(this.state.cell);F++)mxUtils.bind(this,function(I){if(null!=I&&A.isVertex(I.cell)&&t.isCellMovable(I.cell)){var O=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);O=new mxImageShape(O,+this.rowHandleImage.src);O.rowState=I;O.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;O.init(this.graph.getView().getOverlayPane());O.node.style.cursor="move";mxEvent.addGestureListeners(O.node,mxUtils.bind(this,function(R){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(R)&&this.graph.isCellSelected(I.cell)||this.graph.selectCellForEvent(I.cell,R);mxEvent.isPopupTrigger(R)||(this.graph.graphHandler.start(this.state.cell,+mxEvent.getClientX(R),mxEvent.getClientY(R),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(R),this.graph.isMouseDown=!0);mxEvent.consume(R)}),null,mxUtils.bind(this,function(R){mxEvent.isPopupTrigger(R)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(R),mxEvent.getClientY(R),I.cell,R),mxEvent.consume(R))}));B.push(O)}else B.push(null)})(this.graph.view.getState(A.getChildAt(this.state.cell,F)));return B};mxVertexHandler.prototype.destroyMoveHandles=+function(){if(null!=this.moveHandles){for(var t=0;t<this.moveHandles.length;t++)null!=this.moveHandles[t]&&this.moveHandles[t].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=function(){if(null!=this.cornerHandles){for(var t=0;t<this.cornerHandles.length;t++)null!=this.cornerHandles[t]&&null!=this.cornerHandles[t].node&&null!=this.cornerHandles[t].node.parentNode&&this.cornerHandles[t].node.parentNode.removeChild(this.cornerHandles[t].node);this.cornerHandles=null}};+var oa=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){oa.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell))this.refreshMoveHandles();else if(this.graph.isCellMovable(this.state.cell)&&(this.graph.isTransparentBounds(this.state.cell)||1==this.graph.getSelectionCount()&&(this.graph.isTableCell(this.state.cell)||this.graph.isTableRow(this.state.cell)))){this.cornerHandles=+[];for(var t=0;4>t;t++){var A=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);A.dialect=mxConstants.DIALECT_SVG;A.init(this.graph.view.getOverlayPane());this.cornerHandles.push(A)}}this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();t=this.graph.getLinkForCell(this.state.cell);A=this.graph.getLinksForState(this.state);this.updateLinkHint(t,A)};var Ja=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=+function(){var t=new mxPoint(0,0),A=this.tolerance,B=this.state.style.shape;null==mxCellRenderer.defaultShapes[B]&&mxStencilRegistry.getStencil(B);B=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;if(!B&&null!=this.customHandles)for(var F=0;F<this.customHandles.length;F++)if(null!=this.customHandles[F]&&!this.customHandles[F].lockHandle&&!this.customHandles[F].editIconHandle&&!this.customHandles[F].moveGroupHandle&&null!=this.customHandles[F].shape&&null!=+this.customHandles[F].shape.bounds){var I=this.customHandles[F].shape.bounds,O=I.getCenterX(),R=I.getCenterY();if(Math.abs(this.state.x-O)<I.width/2||Math.abs(this.state.y-R)<I.height/2||Math.abs(this.state.x+this.state.width-O)<I.width/2||Math.abs(this.state.y+this.state.height-R)<I.height/2){B=!0;break}}B&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(A/=2,this.graph.isTable(this.state.cell)&&(A+=7),t.x=this.sizers[0].bounds.width+A,t.y=this.sizers[0].bounds.height+A):t=Ja.apply(this,+arguments);return t};mxVertexHandler.prototype.updateHint=function(t){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"°";else{t=this.state.view.scale;var A=this.state.view.unit;this.hint.innerHTML=b(this.roundLength(this.bounds.width/t),A)+" x "+b(this.roundLength(this.bounds.height/t),A)}t=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?+this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==t&&(t=this.bounds);this.hint.style.left=t.x+Math.round((t.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=t.y+t.height+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")}};mxVertexHandler.prototype.removeHint=function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};var db=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=+function(){db.apply(this,arguments);var t=this.graph.getLinkForCell(this.state.cell),A=this.graph.getLinksForState(this.state);this.updateLinkHint(t,A)};var rb=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(t,A){rb.apply(this,arguments);null!=this.linkHint&&"none"!=this.linkHint.style.display&&null!=this.graph.graphHandler&&null!=this.graph.graphHandler.first&&(this.linkHint.style.display="none")};var jb=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=+function(t,A){jb.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(t,A,B){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));var F=this.graph.view.translate,I=this.graph.view.scale,O=this.roundLength(A.x/I-F.x);F=this.roundLength(A.y/I-F.y);var R=this.graph.view.unit;this.hint.innerHTML=b(O,R)+", "+b(F,R);this.hint.style.visibility=+"visible";null!=B&&(B.view.updateEdgeBounds(B),this.hint.innerHTML+=" ("+(R==mxConstants.POINTS?Math.round(B.length/I):b(B.length/I,R))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(B=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*B.x)+"%, "+Math.round(100*B.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=+Math.round(t.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(t.getGraphY(),A.y)+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")};Graph.createFoldingImage=function(t,A){return A?Graph.createSvgImage(t,t,'<defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 4.5 2 L 4.5 7 M 2 4.5 L 7 4.5 z" stroke="#000"/>',+9,9):Graph.createSvgImage(t,t,'<defs><linearGradient id="grad1" x1="50%" y1="0%" x2="50%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 2 4.5 L 7 4.5 z" stroke="#000"/>',9,9)};Graph.updateFoldingImages=function(t){Graph.prototype.expandedImage=Graph.createFoldingImage(t,!1);Graph.prototype.collapsedImage=Graph.createFoldingImage(t,+!0)};Graph.updateFoldingImages(9);Graph.foldingImages={};Graph.prototype.getFoldingImage=function(t){var A=mxGraph.prototype.getFoldingImage.apply(this,arguments);if(null!=A){var B=parseInt(mxUtils.getValue(t.style,"foldingIconSize",0));if(0<B){var F=B+"-"+this.isCellCollapsed(t.cell);A=Graph.foldingImages[F];null==A&&(A=Graph.createFoldingImage(B,this.isCellCollapsed(t.cell)),Graph.foldingImages[F]=A)}}return A};mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;HoverIcons.prototype.mainHandle=+Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');+HoverIcons.prototype.endFixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.terminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.endTerminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="'++HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.rotationHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" fill="'+HoverIcons.prototype.arrowFill+'" d="M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"/>',24,24);HoverIcons.prototype.connectHandle=Graph.createSvgImage(16,16,'<circle cx="12" cy="12" r="10" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><path transform="translate(5,5) scale(0.583)" d="M6 18v-3h7.6L4 5.4 5.4 4 15 13.6V6h3v12z" fill="#fff"/>',24,24);HoverIcons.prototype.lockHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/>',24,24);HoverIcons.prototype.unlockHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M18 8h-1V6c0-2.76-2.24-5-5-5-2.28 0-4.27 .54-4.84 2.75-.14.54.18 1.08.72 1.22.53.14 1.08-.18 1.22-.72C9.44 3.93 10.63 3 12 3c1.65 0 3 1.35 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/>',24,24);HoverIcons.prototype.editHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/>',24,24);HoverIcons.prototype.moveHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M12 2 L9 5 L11 5 L11 11 L5 11 L5 9 L2 12 L5 15 L5 13 L11 13 L11 19 L9 19 L12 22 L15 19 L13 19 L13 13 L19 13 L19 15 L22 12 L19 9 L19 11 L13 11 L13 5 L15 5 Z"/>',@@ -3324,7 +3325,7 @@ arguments);"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.endMovePrmxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxConstraintHandler.prototype.getTolerance=function(t){return mxEvent.isMouseEvent(t.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(t){var A=t.getEvent();return null==t.getState()&&!mxEvent.isMouseEvent(A)||mxEvent.isPopupTrigger(A)&&(null==t.getState()||mxEvent.isControlDown(A)||mxEvent.isShiftDown(A))}}else mxPanningHandler.prototype.isPanningTrigger=function(t){var A=t.getEvent();return mxEvent.isLeftMouseButton(A)&&(this.useLeftButtonForPanning&&null==t.getState()||mxEvent.isControlDown(A)&&!mxEvent.isShiftDown(A))||this.usePopupTrigger&&mxEvent.isPopupTrigger(A)};mxRubberband.prototype.isSpaceEvent=function(t){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&(mxEvent.isControlDown(t.getEvent())||mxEvent.isMetaDown(t.getEvent()))&&mxEvent.isShiftDown(t.getEvent())&&mxEvent.isAltDown(t.getEvent())};mxRubberband.prototype.cancelled=!1;mxRubberband.prototype.cancel=function(){this.isActive()&&(this.cancelled=!0,this.reset())};mxRubberband.prototype.mouseUp=function(t,A){if(this.cancelled)this.cancelled=!1,A.consume();else{var B=null!=this.div&&"none"!=this.div.style.display,F=null,I=null,O=t=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(F=this.first.x,I=this.first.y,t=(this.currentX-F)/this.graph.view.scale,O=(this.currentY-I)/this.graph.view.scale,mxEvent.isAltDown(A.getEvent())||(t=this.graph.snap(t),O=-this.graph.snap(O),this.graph.isGridEnabled()||(Math.abs(t)<this.graph.tolerance&&(t=0),Math.abs(O)<this.graph.tolerance&&(O=0))));this.reset();if(B){if(this.isSpaceEvent(A)){this.graph.model.beginUpdate();try{var R=this.graph.getCellsBeyond(F,I,this.graph.getDefaultParent(),!0,!0);for(B=0;B<R.length;B++)if(this.graph.isCellMovable(R[B])){var ea=this.graph.view.getState(R[B]),ia=this.graph.getCellGeometry(R[B]);null!=ea&&null!=ia&&(ia=ia.clone(),ia.translate(t,O),this.graph.model.setGeometry(R[B],+this.graph.snap(O),this.graph.isGridEnabled()||(Math.abs(t)<this.graph.tolerance&&(t=0),Math.abs(O)<this.graph.tolerance&&(O=0))));this.reset();if(B){if(this.isSpaceEvent(A)){this.graph.model.beginUpdate();try{var R=this.graph.getCellsBeyond(F,I,this.graph.getDefaultParent(),!0,!0);for(B=0;B<R.length;B++)if(this.graph.isCellMovable(R[B])){var da=this.graph.view.getState(R[B]),ia=this.graph.getCellGeometry(R[B]);null!=da&&null!=ia&&(ia=ia.clone(),ia.translate(t,O),this.graph.model.setGeometry(R[B],ia))}}finally{this.graph.model.endUpdate()}}else R=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(R,A.getEvent());A.consume()}}};mxRubberband.prototype.mouseMove=function(t,A){if(!A.isConsumed()&&null!=this.first){var B=mxUtils.getScrollOrigin(this.graph.container);t=mxUtils.getOffset(this.graph.container);B.x-=t.x;B.y-=t.y;t=A.getX()+B.x;B=A.getY()+B.y;var F=this.first.x-t,I=this.first.y-B,O=this.graph.tolerance;if(null!=this.div||Math.abs(F)>O||Math.abs(I)>O)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(t,B),this.isSpaceEvent(A)?(t=this.x+this.width,B=this.y+this.height,F=this.graph.view.scale,mxEvent.isAltDown(A.getEvent())||(this.width=this.graph.snap(this.width/F)*F,this.height=this.graph.snap(this.height/F)*F,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=t-this.width),this.y<this.first.y&&(this.y=B-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+@@ -3347,10 +3348,10 @@ function(t,A){ab.apply(this,arguments);this.resizeHandlesHidden&&null!=this.indemxVertexHandler.prototype.mouseUp=function(t,A){Hb.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="");this.blockDelayedSelection=null};mxVertexHandler.prototype.updateLinkHint=function(t,A){try{if(null==t&&(null==A||0==A.length))null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=t||null!=A&&0<A.length){var B=document.createElement("img");B.className="geAdaptiveAsset";B.setAttribute("src",Editor.editImage);B.setAttribute("title",mxResources.get("editLink"));B.setAttribute("width","14");B.setAttribute("height","14");B.style.paddingLeft="8px";B.style.marginLeft="auto";B.style.marginBottom="-1px";B.style.cursor="pointer";var F=B.cloneNode(!0);F.setAttribute("src",Editor.trashImage);F.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));F.style.paddingLeft="4px";F.style.marginLeft="0";null==this.linkHint&&(this.linkHint=a(),mxUtils.setPrefixedStyle(this.linkHint.style,"transform","translate(-50%,0)"),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint),mxEvent.addListener(this.linkHint,-"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()})));this.linkHint.innerText="";if(null!=t){var I=document.createElement("div");I.style.display="flex";I.style.alignItems="center";I.appendChild(this.graph.createLinkForHint(t,null,this.state.cell));this.linkHint.appendChild(I);if(this.graph.isEnabled()&&"function"===typeof this.graph.editLink&&!this.graph.isCellLocked(this.state.cell)){var O=B.cloneNode(!0);I.appendChild(O);mxEvent.addListener(O,"click",mxUtils.bind(this,function(ea){this.graph.setSelectionCell(this.state.cell);-this.graph.editLink();mxEvent.consume(ea)}));var R=F.cloneNode(!0);I.appendChild(R);mxEvent.addListener(R,"click",mxUtils.bind(this,function(ea){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(ea)}))}}if(null!=A)for(I=0;I<A.length;I++)mxUtils.bind(this,function(ea,ia){var da=document.createElement("div");da.style.display="flex";da.style.alignItems="center";da.style.marginTop=null!=t||0<ia?"6px":"0px";da.appendChild(this.graph.createLinkForHint(ea.getAttribute("href"),mxUtils.getTextContent(ea),-this.state.cell));var za=B.cloneNode(!0);da.appendChild(za);var Fa=mxUtils.bind(this,function(Ga){var ca=document.createElement("div");ca.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var wa=ca.getElementsByTagName("a")[ia];if(null!=wa){if(null==Ga||""==Ga){for(Ga=wa.cloneNode(!0).firstChild;null!=Ga;)wa.parentNode.insertBefore(Ga.cloneNode(!0),wa),Ga=Ga.nextSibling;wa.parentNode.removeChild(wa)}else wa.setAttribute("href",Ga);this.graph.labelChanged(this.state.cell,ca.innerHTML)}});-mxEvent.addListener(za,"click",mxUtils.bind(this,function(Ga){this.graph.showLinkDialog(ea.getAttribute("href")||"",mxResources.get("ok"),Fa);mxEvent.consume(Ga)}));za=F.cloneNode(!0);da.appendChild(za);mxEvent.addListener(za,"click",mxUtils.bind(this,function(Ga){Fa();mxEvent.consume(Ga)}));this.linkHint.appendChild(da)})(A[I],I)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(ea){}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var pb=mxEdgeHandler.prototype.createConstraintHandler;+"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()})));this.linkHint.innerText="";if(null!=t){var I=document.createElement("div");I.style.display="flex";I.style.alignItems="center";I.appendChild(this.graph.createLinkForHint(t,null,this.state.cell));this.linkHint.appendChild(I);if(this.graph.isEnabled()&&"function"===typeof this.graph.editLink&&!this.graph.isCellLocked(this.state.cell)){var O=B.cloneNode(!0);I.appendChild(O);mxEvent.addListener(O,"click",mxUtils.bind(this,function(da){this.graph.setSelectionCell(this.state.cell);+this.graph.editLink();mxEvent.consume(da)}));var R=F.cloneNode(!0);I.appendChild(R);mxEvent.addListener(R,"click",mxUtils.bind(this,function(da){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(da)}))}}if(null!=A)for(I=0;I<A.length;I++)mxUtils.bind(this,function(da,ia){var ea=document.createElement("div");ea.style.display="flex";ea.style.alignItems="center";ea.style.marginTop=null!=t||0<ia?"6px":"0px";ea.appendChild(this.graph.createLinkForHint(da.getAttribute("href"),mxUtils.getTextContent(da),+this.state.cell));var za=B.cloneNode(!0);ea.appendChild(za);var Fa=mxUtils.bind(this,function(Ga){var ca=document.createElement("div");ca.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var wa=ca.getElementsByTagName("a")[ia];if(null!=wa){if(null==Ga||""==Ga){for(Ga=wa.cloneNode(!0).firstChild;null!=Ga;)wa.parentNode.insertBefore(Ga.cloneNode(!0),wa),Ga=Ga.nextSibling;wa.parentNode.removeChild(wa)}else wa.setAttribute("href",Ga);this.graph.labelChanged(this.state.cell,ca.innerHTML)}});+mxEvent.addListener(za,"click",mxUtils.bind(this,function(Ga){this.graph.showLinkDialog(da.getAttribute("href")||"",mxResources.get("ok"),Fa);mxEvent.consume(Ga)}));za=F.cloneNode(!0);ea.appendChild(za);mxEvent.addListener(za,"click",mxUtils.bind(this,function(Ga){Fa();mxEvent.consume(Ga)}));this.linkHint.appendChild(ea)})(A[I],I)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(da){}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var pb=mxEdgeHandler.prototype.createConstraintHandler;mxEdgeHandler.prototype.createConstraintHandler=function(){var t=pb.apply(this,arguments);t.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});return t};var Fb=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){Fb.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var Tb=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){if(null!=this.moveHandles)for(var t=0;t<this.moveHandles.length;t++)null!=this.moveHandles[t]&&(this.moveHandles[t].bounds.x=Math.round(this.moveHandles[t].rowState.x+this.moveHandles[t].rowState.width-this.moveHandles[t].bounds.width/2),this.moveHandles[t].bounds.y=Math.round(this.moveHandles[t].rowState.y+(this.moveHandles[t].rowState.height-this.moveHandles[t].bounds.height)/2),this.moveHandles[t].redraw());if(null!=this.cornerHandles){t=this.getSelectionBorderInset();var A=this.cornerHandles,B=A[0].bounds.height/2;A[0].bounds.x=this.state.x-A[0].bounds.width/2+t;A[0].bounds.y=this.state.y-B+t;A[0].redraw();A[1].bounds.x=A[0].bounds.x+this.state.width-2*t;A[1].bounds.y=A[0].bounds.y;A[1].redraw();A[2].bounds.x=A[0].bounds.x;A[2].bounds.y=this.state.y+this.state.height-2*t;A[2].redraw();A[3].bounds.x=A[1].bounds.x;A[3].bounds.y=A[2].bounds.y;A[3].redraw();A=1==this.graph.getSelectionCount()&&(!this.graph.isTransparentBounds(this.state.cell)||this.graph.isCellSelected(this.state.cell));@@ -3619,7 +3620,7 @@ c.getSelectionCells();for(ra=0;ra<Sb.length&&!Gb;ra++){var Kb=c.view.getState(SbmxUtils.write(Rb,"⚠︎");vb.appendChild(Rb);vb.setAttribute("title","Label cannot be converted to SVG and falls back to HTML rendering. Uncheck to remove the style.")}else vb.style.opacity="0.5",yb.setAttribute("disabled","disabled"),vb.setAttribute("title","Label contains unsupported HTML or vertical text for SVG conversion. Supported: H1-H6, P, PRE, BLOCKQUOTE, DIV, B, I, U, STRIKE, SUP, SUB, SPAN, FONT, BR (without background color).")}else yb.checked||(vb.style.opacity="0.5",yb.setAttribute("disabled","disabled"));var Ub=this.createCellOption(mxResources.get("autosizeText"),"autosizeText","0",null,null,mxUtils.bind(this,function(ca,wa){if(wa)for(wa=0;wa<ca.length;wa++)c.model.isVertex(ca[wa])&&c.updateAutosizeTextFontSize(ca[wa])}));Ub.style.fontWeight="bold";0<h.vertices.length&&h.resizable&&kb.appendChild(Ub);if(!g.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)vb.getElementsByTagName("span")[0].style.maxWidth="172px",vb.appendChild(g.menus.createHelpLink("https://www.drawio.com/docs/manual/text/svg-labels/"));var ob=this.createPanel();ob.style.height="86px";var Db=this.addUnitInput(ob,this.getUnit(),87,52,function(){R.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Db.setAttribute("title",mxResources.get("top"));var Lb=this.addUnitInput(ob,this.getUnit(),16,52,function(){O.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Lb.setAttribute("title",mxResources.get("global"));mxUtils.br(ob);this.addLabel(ob,mxResources.get("top"),87,64);this.addLabel(ob,mxResources.get("global"),-16,64);mxUtils.br(ob);mxUtils.br(ob);var Mb=this.addUnitInput(ob,this.getUnit(),158,52,function(){da.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Mb.setAttribute("title",mxResources.get("left"));var Eb=this.addUnitInput(ob,this.getUnit(),87,52,function(){ia.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Eb.setAttribute("title",mxResources.get("bottom"));var Cb=this.addUnitInput(ob,this.getUnit(),16,52,function(){ea.apply(this,arguments)},this.getUnitStep(),+16,64);mxUtils.br(ob);mxUtils.br(ob);var Mb=this.addUnitInput(ob,this.getUnit(),158,52,function(){ea.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Mb.setAttribute("title",mxResources.get("left"));var Eb=this.addUnitInput(ob,this.getUnit(),87,52,function(){ia.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Eb.setAttribute("title",mxResources.get("bottom"));var Cb=this.addUnitInput(ob,this.getUnit(),16,52,function(){da.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Cb.setAttribute("title",mxResources.get("right"));mxUtils.br(ob);this.addLabel(ob,mxResources.get("left"),158,64);this.addLabel(ob,mxResources.get("bottom"),87,64);this.addLabel(ob,mxResources.get("right"),16,64);var ab=this.createPanel();ab.className="geFormatEntry";ab.style.fontWeight="bold";mxUtils.write(ab,mxResources.get("labelWidth"));ab.setAttribute("title",mxResources.get("labelWidth"));var Hb=mxUtils.bind(this,function(ca){var wa=this.isFloatUnit()?parseFloat(pb.value):parseInt(pb.value);wa=isNaN(wa)?null:Math.max(1,this.fromUnit(wa));if(wa!=mxUtils.getValue(g.getSelectionState().style,mxConstants.STYLE_LABEL_WIDTH,null)){c.isEditing()&&c.stopEditing(!0);var ya=g.getSelectionState().cells;c.getModel().beginUpdate();try{c.setCellStyles(mxConstants.STYLE_LABEL_WIDTH,wa,ya),g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_LABEL_WIDTH],"values",[wa],"cells",ya))}finally{c.getModel().endUpdate()}}pb.value=null==wa?"":this.inUnit(wa)+" "+this.getUnit();mxEvent.consume(ca)}),pb=this.addUnitInput(ab,this.getUnit(),16,52,function(){Hb.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());pb.setAttribute("title",mxResources.get("labelWidth"));mxEvent.addListener(pb,"change",Hb);mxEvent.addListener(pb,"blur",Hb);if(c.cellEditor.isContentEditing()){var Fb=null,Tb=null;a.appendChild(this.createRelativeOption(mxResources.get("lineheight"),null,null,function(ca){var wa=""==ca.value?120:parseInt(ca.value);wa=Math.max(0,isNaN(wa)?120:wa);@@ -3640,8 +3641,8 @@ ca=mxUtils.getValue(h.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_C"bottom":ca==mxConstants.ALIGN_RIGHT&&wa==mxConstants.ALIGN_BOTTOM?"bottomRight":ca==mxConstants.ALIGN_LEFT?"left":ca==mxConstants.ALIGN_RIGHT?"right":"center";ca=mxUtils.getValue(h.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);ca==mxConstants.TEXT_DIRECTION_RTL?sa.value="rightToLeft":ca==mxConstants.TEXT_DIRECTION_LTR?sa.value="leftToRight":ca!=mxConstants.TEXT_DIRECTION_AUTO&&h.html?ca==mxConstants.TEXT_DIRECTION_VERTICAL_LR?sa.value="vertical-leftToRight":ca==mxConstants.TEXT_DIRECTION_VERTICAL_RL&&(sa.value="vertical-rightToLeft"):sa.value="automatic";if(ya||document.activeElement!=Lb)ca=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING,2)),Lb.value=isNaN(ca)?"":this.inUnit(ca)+" "+this.getUnit();if(ya||document.activeElement!=Db)ca=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING_TOP,0)),Db.value=isNaN(ca)?"":this.inUnit(ca)+" "+this.getUnit();if(ya||document.activeElement!=Cb)ca=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING_RIGHT,0)),Cb.value=isNaN(ca)?"":this.inUnit(ca)+" "+this.getUnit();if(ya||document.activeElement!=Eb)ca=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING_BOTTOM,0)),Eb.value=isNaN(ca)?"":this.inUnit(ca)+" "+this.getUnit();if(ya||document.activeElement!=Mb)ca=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING_LEFT,0)),Mb.value=isNaN(ca)?"":this.inUnit(ca)+" "+this.getUnit();if(ya||document.activeElement!=pb)ca=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_LABEL_WIDTH,"")),pb.value=isNaN(ca)?"":this.inUnit(ca)+-" "+this.getUnit()});var O=this.installInputHandler(Lb,mxConstants.STYLE_SPACING,2,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var R=this.installInputHandler(Db,mxConstants.STYLE_SPACING_TOP,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var ea=this.installInputHandler(Cb,mxConstants.STYLE_SPACING_RIGHT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var ia=this.installInputHandler(Eb,mxConstants.STYLE_SPACING_BOTTOM,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),-!0);var da=this.installInputHandler(Mb,mxConstants.STYLE_SPACING_LEFT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);this.addKeyHandler(Aa,I);this.addKeyHandler(Lb,I);this.addKeyHandler(Db,I);this.addKeyHandler(Cb,I);this.addKeyHandler(Eb,I);this.addKeyHandler(Mb,I);this.addKeyHandler(pb,I);c.getModel().addListener(mxEvent.CHANGE,I);this.listeners.push({destroy:function(){c.getModel().removeListener(I)}});I();if(c.cellEditor.isContentEditing()){var za=null,Fa=!1,Ga=mxUtils.bind(this,function(){Fa||+" "+this.getUnit()});var O=this.installInputHandler(Lb,mxConstants.STYLE_SPACING,2,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var R=this.installInputHandler(Db,mxConstants.STYLE_SPACING_TOP,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var da=this.installInputHandler(Cb,mxConstants.STYLE_SPACING_RIGHT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var ia=this.installInputHandler(Eb,mxConstants.STYLE_SPACING_BOTTOM,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),+!0);var ea=this.installInputHandler(Mb,mxConstants.STYLE_SPACING_LEFT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);this.addKeyHandler(Aa,I);this.addKeyHandler(Lb,I);this.addKeyHandler(Db,I);this.addKeyHandler(Cb,I);this.addKeyHandler(Eb,I);this.addKeyHandler(Mb,I);this.addKeyHandler(pb,I);c.getModel().addListener(mxEvent.CHANGE,I);this.listeners.push({destroy:function(){c.getModel().removeListener(I)}});I();if(c.cellEditor.isContentEditing()){var za=null,Fa=!1,Ga=mxUtils.bind(this,function(){Fa||(Fa=!0,window.setTimeout(mxUtils.bind(this,function(){var ca=c.getSelectedEditingElement();if(null!=ca&&null!=c.cellEditor.textarea){var wa=function(Wa,cb){if(null!=Wa&&null!=cb){if(Wa==cb)return!0;if(Wa.length>cb.length+1)return Wa.substring(Wa.length-cb.length-1,Wa.length)=="-"+cb}return!1},ya=function(Wa){if(null!=c.getParentByName(ca,Wa,c.cellEditor.textarea))return!0;for(var cb=ca;null!=cb&&1==cb.childNodes.length;)if(cb=cb.childNodes[0],cb.nodeName==Wa)return!0;return!1},Ia=function(Wa){for(;null!=Wa&&Wa!=c.cellEditor.textarea;){if("block"==mxUtils.getCurrentStyle(Wa).display)return Wa;Wa=Wa.parentNode}return null},Ca=mxUtils.getCurrentStyle(ca),Ka=ca==c.cellEditor.textarea||""==ca.style.lineHeight?null:ca.style.lineHeight,Da=ca==c.cellEditor.textarea||""==ca.style.fontSize?null:b(Ca);if(window.getSelection)for(var Ya=ca.getElementsByTagName("*"),Za=window.getSelection(),Ta=0;Ta<Ya.length&&(!Za.containsNode(Ya[Ta],!0)||null==Ya[Ta].style||(null==Da&&""!=Ya[Ta].style.fontSize&&(Da=parseFloat(Ya[Ta].style.fontSize)),null==Ka&&""!=Ya[Ta].style.lineHeight&&(Ka=Ya[Ta].style.lineHeight),null==Da||null==Ka));Ta++);null==Da&&(Da=b(Ca));if(null==Ka)for(Ya=ca;null!=Ya&&Ya!=c.cellEditor.textarea.parentNode;){if(null!=Ya.style&&""!=Ya.style.lineHeight){Ka=Ya.style.lineHeight;break}Ya=Ya.parentNode}if(null!=Ca){f(G[0],"bold"==Ca.fontWeight||400<Ca.fontWeight||ya("B")||ya("STRONG"));f(G[1],"italic"==Ca.fontStyle||ya("I")||ya("EM"));f(G[2],"underline"==Ca.textDecorationLine||ya("U"));f(ja,"line-through"==Ca.textDecorationLine||@@ -3809,10 +3810,10 @@ q/2);s=this.scale;m=this.bounds.x/s;r=this.bounds.y/s;n=this.bounds.width/s;q=thnull!=v.paintTableCellLines){var y=this.state.cell;if(null!=v.isTableRow&&v.isTableRow(y)){var J=this.getTitleSize();this.isHorizontal()?v.paintTableCellLines(d,y,0,0,n,Math.min(J,q),this.stroke,this.strokewidth):v.paintTableCellLines(d,y,0,0,Math.min(J,n),q,this.stroke,this.strokewidth)}else v.paintTableCellLines(d,y,0,0,n,q,this.stroke,this.strokewidth)}}};mxUtils.extend(f,mxCylinder);f.prototype.size=20;f.prototype.darkOpacity=0;f.prototype.darkOpacity2=0;f.prototype.paintVertexShape=function(d,m,r,n,q){var v=Math.max(0,Math.min(n,Math.min(q,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),y=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),J=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));d.translate(m,r);d.begin();d.moveTo(0,0);d.lineTo(n-v,0);d.lineTo(n,v);d.lineTo(n,q);d.lineTo(v,q);d.lineTo(0,q-v);d.lineTo(0,0);d.close();d.end();d.fillAndStroke();this.outline||(d.setShadow(!1),0!=y&&(d.setFillAlpha(Math.abs(y)),d.setFillColor(0>y?"#FFFFFF":"#000000"),d.begin(),d.moveTo(0,0),d.lineTo(n-v,0),d.lineTo(n,v),d.lineTo(v,v),d.close(),d.fill()),0!=J&&(d.setFillAlpha(Math.abs(J)),d.setFillColor(0>J?"#FFFFFF":"#000000"),d.begin(),d.moveTo(0,0),d.lineTo(v,v),d.lineTo(v,q),d.lineTo(0,q-v),d.close(),d.fill()),d.begin(),d.moveTo(v,q),d.lineTo(v,v),d.lineTo(0,0),d.moveTo(v,v),d.lineTo(n,v),d.end(),d.stroke())};f.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,-"boundedLbl",!1)?(d=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(d,d,0,0)):null};mxCellRenderer.registerShape("cube",f);var R=Math.tan(mxUtils.toRadians(30)),ea=(.5-R)/2;mxCellRenderer.registerShape("isoRectangle",h);mxUtils.extend(g,mxConnector);g.prototype.paintEdgeShape=function(d,m){var r=this.createMarker(d,m,!0),n=this.createMarker(d,m,!1);d.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&d.setDashed(this.isDashed,+"boundedLbl",!1)?(d=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(d,d,0,0)):null};mxCellRenderer.registerShape("cube",f);var R=Math.tan(mxUtils.toRadians(30)),da=(.5-R)/2;mxCellRenderer.registerShape("isoRectangle",h);mxUtils.extend(g,mxConnector);g.prototype.paintEdgeShape=function(d,m){var r=this.createMarker(d,m,!0),n=this.createMarker(d,m,!1);d.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&d.setDashed(this.isDashed,null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);d.setShadow(!1);d.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);d.setStrokeColor(this.stroke);d.setFillColor(this.stroke);d.setDashed(!1);null!=r&&r();null!=n&&n()};mxCellRenderer.registerShape("wire",g);mxUtils.extend(c,mxCylinder);c.prototype.size=6;c.prototype.paintVertexShape=function(d,m,r,n,q){d.setFillColor(this.stroke);var v=Math.max(0,parseFloat(mxUtils.getValue(this.style,-"size",this.size))-2)+2*this.strokewidth;d.ellipse(m+.5*(n-v),r+.5*(q-v),v,v);d.fill();d.setFillColor(mxConstants.NONE);d.rect(m,r,n,q);d.fill()};mxCellRenderer.registerShape("waypoint",c);mxUtils.extend(h,mxActor);h.prototype.size=20;h.prototype.redrawPath=function(d,m,r,n,q){m=Math.min(n,q/R);d.translate((n-m)/2,(q-m)/2+m/4);d.moveTo(0,.25*m);d.lineTo(.5*m,m*ea);d.lineTo(m,.25*m);d.lineTo(.5*m,(.5-ea)*m);d.lineTo(0,.25*m);d.close();d.end()};mxCellRenderer.registerShape("isoRectangle",h);mxUtils.extend(k,-mxCylinder);k.prototype.size=20;k.prototype.redrawPath=function(d,m,r,n,q,v){m=Math.min(n,q/(.5+R));v?(d.moveTo(0,.25*m),d.lineTo(.5*m,(.5-ea)*m),d.lineTo(m,.25*m),d.moveTo(.5*m,(.5-ea)*m),d.lineTo(.5*m,(1-ea)*m)):(d.translate((n-m)/2,(q-m)/2),d.moveTo(0,.25*m),d.lineTo(.5*m,m*ea),d.lineTo(m,.25*m),d.lineTo(m,.75*m),d.lineTo(.5*m,(1-ea)*m),d.lineTo(0,.75*m),d.close());d.end()};mxCellRenderer.registerShape("isoCube",k);mxUtils.extend(p,mxCylinder);p.prototype.redrawPath=function(d,m,r,n,q,v){m=Math.min(q/+"size",this.size))-2)+2*this.strokewidth;d.ellipse(m+.5*(n-v),r+.5*(q-v),v,v);d.fill();d.setFillColor(mxConstants.NONE);d.rect(m,r,n,q);d.fill()};mxCellRenderer.registerShape("waypoint",c);mxUtils.extend(h,mxActor);h.prototype.size=20;h.prototype.redrawPath=function(d,m,r,n,q){m=Math.min(n,q/R);d.translate((n-m)/2,(q-m)/2+m/4);d.moveTo(0,.25*m);d.lineTo(.5*m,m*da);d.lineTo(m,.25*m);d.lineTo(.5*m,(.5-da)*m);d.lineTo(0,.25*m);d.close();d.end()};mxCellRenderer.registerShape("isoRectangle",h);mxUtils.extend(k,+mxCylinder);k.prototype.size=20;k.prototype.redrawPath=function(d,m,r,n,q,v){m=Math.min(n,q/(.5+R));v?(d.moveTo(0,.25*m),d.lineTo(.5*m,(.5-da)*m),d.lineTo(m,.25*m),d.moveTo(.5*m,(.5-da)*m),d.lineTo(.5*m,(1-da)*m)):(d.translate((n-m)/2,(q-m)/2),d.moveTo(0,.25*m),d.lineTo(.5*m,m*da),d.lineTo(m,.25*m),d.lineTo(m,.75*m),d.lineTo(.5*m,(1-da)*m),d.lineTo(0,.75*m),d.close());d.end()};mxCellRenderer.registerShape("isoCube",k);mxUtils.extend(p,mxCylinder);p.prototype.redrawPath=function(d,m,r,n,q,v){m=Math.min(q/2,Math.round(q/8)+this.strokewidth-1);if(v&&null!=this.fill||!v&&null==this.fill)d.moveTo(0,m),d.curveTo(0,2*m,n,2*m,n,m),v||(d.stroke(),d.begin()),d.translate(0,m/2),d.moveTo(0,m),d.curveTo(0,2*m,n,2*m,n,m),v||(d.stroke(),d.begin()),d.translate(0,m/2),d.moveTo(0,m),d.curveTo(0,2*m,n,2*m,n,m),v||(d.stroke(),d.begin()),d.translate(0,-m);v||(d.moveTo(0,m),d.curveTo(0,-m/3,n,-m/3,n,m),d.lineTo(n,q-m),d.curveTo(n,q+m/3,0,q+m/3,0,q-m),d.close())};p.prototype.getLabelMargins=function(d){return new mxRectangle(0,2.5*Math.min(d.height/2,Math.round(d.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",p);mxUtils.extend(l,mxCylinder);l.prototype.size=30;l.prototype.darkOpacity=0;l.prototype.paintVertexShape=function(d,m,r,n,q){var v=Math.max(0,Math.min(n,Math.min(q,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),y=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));d.translate(m,r);d.begin();d.moveTo(0,0);d.lineTo(n-v,0);d.lineTo(n,v);d.lineTo(n,q);d.lineTo(0,q);d.lineTo(0,0);d.close();d.end();d.fillAndStroke();this.outline||(d.setShadow(!1),0!=y&&(d.setFillAlpha(Math.abs(y)),d.setFillColor(0>y?"#FFFFFF":"#000000"),d.begin(),d.moveTo(n-v,0),d.lineTo(n-v,v),d.lineTo(n,v),d.close(),d.fill()),d.begin(),d.moveTo(n-v,0),d.lineTo(n-v,v),d.lineTo(n,v),d.end(),d.stroke())};mxCellRenderer.registerShape("note",l);mxUtils.extend(u,l);mxCellRenderer.registerShape("note2",u);u.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,@@ -3844,7 +3845,7 @@ this.fixedSize)))):n*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.styq);d.fillAndStroke();d.rect(4*m,0,m,q);d.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",fa);ja.prototype.moveTo=function(d,m){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=m;this.firstX=d;this.firstY=m};ja.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};ja.prototype.quadTo=function(d,m,r,n){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=r;this.lastY=n};ja.prototype.curveTo=function(d,m,r,n,q,v){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=q;this.lastY=v};ja.prototype.arcTo=function(d,m,r,n,q,v,y){this.originalArcTo.apply(this.canvas,arguments);this.lastX=v;this.lastY=y};ja.prototype.lineTo=function(d,m){if(null!=this.lastX&&null!=this.lastY){var r=function(P){return"number"===typeof P?P?0>P?-1:1:P===P?0:NaN:NaN},n=Math.abs(d-this.lastX),q=Math.abs(m-this.lastY),v=Math.sqrt(n*n+q*q);if(2>v){this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=m;return}var y=Math.round(v/10),J=this.defaultVariation;5>y&&(y=5,J/=3);var C=r(d-this.lastX)*n/y;r=r(m-this.lastY)*q/y;n/=v;q/=v;for(v=0;v<y;v++){var ba=(Math.random()-.5)*J;this.originalLineTo.call(this.canvas,C*v+this.lastX-ba*q,r*v+this.lastY-ba*n)}this.originalLineTo.call(this.canvas,d,m)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=m};ja.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=-this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var da=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(d){da.apply(this,arguments);null==d.handJiggle&&(d.handJiggle=this.createHandJiggle(d))};var za=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(d){za.apply(this,arguments);null!=d.handJiggle&&(d.handJiggle.destroy(),delete d.handJiggle)};+this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var ea=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(d){ea.apply(this,arguments);null==d.handJiggle&&(d.handJiggle=this.createHandJiggle(d))};var za=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(d){za.apply(this,arguments);null!=d.handJiggle&&(d.handJiggle.destroy(),delete d.handJiggle)};mxShape.prototype.createComicCanvas=function(d){return new ja(d,mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(d){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(d)};var Fa=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.outline&&(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")&&"0"==mxUtils.getValue(this.style,"sketch","1"==urlParams.rough?"1":"0"))&&Fa.apply(this,arguments)};var Ga=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(d,m,r,n,q){if(null==d.handJiggle||d.handJiggle.constructor!=ja)Ga.apply(this,arguments);else{var v=!0;null!=this.style&&(v="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(v||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)v||null!=this.fill&&this.fill!=mxConstants.NONE||(d.pointerEvents=!1),d.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?v=Math.min(n/2,Math.min(q/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(v=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,v=Math.min(n*v,q*v)),d.moveTo(m+v,r),d.lineTo(m+n-v,r),d.quadTo(m+n,r,m+n,r+v),d.lineTo(m+n,r+q-v),d.quadTo(m+n,r+q,m+n-v,r+q),d.lineTo(m+v,r+q),d.quadTo(m,r+q,m,r+q-v),@@ -7924,37 +7925,38 @@ this.addPaletteFunctions("electricalTransistors","Electrical / Transistors",!1,["nigbt;",64,100,"","NIGBT",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","nigbt","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"pnp_transistor_1;",95,100,"","BJT (PNP)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","pnp_transistor_1","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"pnp_transistor_5;",64,100,"","BJT (PNP)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","pnp_transistor_5","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"pigbt;",64,100,"","PIGBT",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","pigbt","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"n-channel_jfet_1;",95,100,"","N Channel JFET",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","n-channel_jfet_1","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"p-channel_jfet_1;",95,100,"","P Channel JFET",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","p-channel_jfet_1","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"n-channel_mosfet_1;",95,100,"","MOSFET (N)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","n-channel_mosfet_1","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"p-channel_mosfet_1;",95,100,"","MOSFET (P)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","p-channel_mosfet_1","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"mosfet_ic_n;",-95,100,"","NMOS",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_ic_n","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"mosfet_ic_p;",95,100,"","PMOS",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_ic_p","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"mosfet_n_no_bulk;",95,100,"","MOSFET No Bulk (N)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_n_no_bulk","electrical transistor ").join(" ")),-this.createVertexTemplateEntry(l+"mosfet_p_no_bulk;",95,100,"","MOSFET No Bulk (P)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_p_no_bulk","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"dual_gate_mosfet_n;",95,100,"","Dual Gate MOSFET (N)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","dual_gate_mosfet_n","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"dual_gate_mosfet_p;",95,100,"","Dual Gate MOSFET (P)",-null,null,this.getTagsForStencil("mxgraph.electrical.transistors","dual_gate_mosfet_p","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"nmos;pointerEvents=1;",60,100,"","NMOS",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","nmos","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"nmos_bulk;pointerEvents=1;",60,100,"","NMOS with Bulk",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","nmos bulk","electrical transistor ").join(" ")),-this.createVertexTemplateEntry(k+"pmos;pointerEvents=1;",60,100,"","PMOS",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","pmos","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"pmos_bulk;pointerEvents=1;",60,100,"","PMOS with Bulk",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","pmos bulk","electrical transistor ").join(" "))]);this.setCurrentSearchEntryLibrary("electrical","electricalInstruments");this.addPaletteFunctions("electricalInstruments",-"Electrical / Instruments",!1,[this.createVertexTemplateEntry("verticalLabelPosition=middle;shadow=0;dashed=0;align=center;html=1;verticalAlign=middle;strokeWidth=1;shape=ellipse;aspect=fixed;fontSize=50;",90,90,"A","Ammeter",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","ampermeter ammeter","electrical instrument ").join(" ")),this.createVertexTemplateEntry(w+"galvanometer;",90,90,"","Galvanometer",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","galvanometer",-"electrical instrument ").join(" ")),this.createVertexTemplateEntry(w+"oscilloscope;",90,90,"","Oscilloscope",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","oscilloscope","electrical instrument ").join(" ")),this.createVertexTemplateEntry(w+"signal_generator;",90,90,"","Signal Generator",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","signal_generator","electrical instrument ").join(" ")),this.createVertexTemplateEntry("verticalLabelPosition=middle;shadow=0;dashed=0;align=center;html=1;verticalAlign=middle;strokeWidth=1;shape=ellipse;aspect=fixed;fontSize=50;",-90,90,"V","Voltmeter",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","ampermeter ammeter","electrical instrument ").join(" "))]);this.setCurrentSearchEntryLibrary("electrical","electricalMisc");this.addPaletteFunctions("electricalMisc","Electrical / Misc",!1,[this.createVertexTemplateEntry(p+"aerial_-_antenna_1;",80,100,"","Antenna",null,null,this.getTagsForStencil("mxgraph.electrical.radio","aerial_-_antenna_1","electrical radio audio ").join(" ")),this.createVertexTemplateEntry(p+-"aerial_-_antenna_2;",79,100,"","Antenna",null,null,this.getTagsForStencil("mxgraph.electrical.radio","aerial_-_antenna_2","electrical radio audio ").join(" ")),this.createVertexTemplateEntry(p+"loop_antenna;",64.8,69.78,"","Loop Antenna",null,null,this.getTagsForStencil("mxgraph.electrical.radio","loop_antenna","electrical radio audio ").join(" ")),this.createVertexTemplateEntry(f+"loop_antenna",100,100,"","Loop Antenna",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","loop antenna",-"electrical ").join(" ")),this.createVertexTemplateEntry("verticalLabelPosition=middle;shadow=0;dashed=0;align=center;html=1;verticalAlign=middle;strokeWidth=1;shape=ellipse;aspect=fixed;fontSize=35;",60,60,"M","Electrical Motor",null,null,this.getTagsForStencil("mxgraph.electrical.electro-mechanical","motor_1","electrical switch relay ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_SHAPE+"=mxgraph.electrical.electro-mechanical.motor_2;html=1;shadow=0;dashed=0;align=center;fontSize=30;strokeWidth=1;",-100,60,"","Motor Armature",null,null,this.getTagsForStencil("mxgraph.electrical.electro-mechanical","motor_2","electrical switch relay ").join(" ")),this.createVertexTemplateEntry(f+"co-ax;",40,60,"","Co-Ax",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","co-ax","electrical ").join(" ")),this.createVertexTemplateEntry(f+"crystal_1;",100,40,"","Crystal",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","crystal_1","electrical ").join(" ")),this.createVertexTemplateEntry(f+-"fuse_1;",100,20,"","Fuse (IEC)",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","fuse_1","electrical ").join(" ")),this.createVertexTemplateEntry(f+"fuse_2;",100,20,"","Fuse (IEEE)",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","fuse_2","electrical ").join(" ")),this.createVertexTemplateEntry(f+"fuse_3;",100,12,"","Fuse (obsolete)",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","fuse_3","electrical ").join(" ")),this.createVertexTemplateEntry(f+-"fuse_4;",100,32,"","Fuse (IEEE)",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","fuse_4","electrical ").join(" ")),this.createVertexTemplateEntry(f+"light_bulb;",60,50,"","Light Bulb",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","light_bulb","electrical ").join(" ")),this.createVertexTemplateEntry(f+"illuminating_bulb;",60,50,"","Illuminating Bulb",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","illuminating_bulb","electrical ").join(" ")),-this.createVertexTemplateEntry(f+"light_bulb;",60,50,"","Pilot Light",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","light_bulb","electrical ").join(" ")),this.createVertexTemplateEntry(f+"neon_lamp_2;",60,50,"","Neon Lamp",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","neon_lamp_2","electrical ").join(" ")),this.createVertexTemplateEntry(f+"flourescent_lamp",80,30,"","Flourescent Lamp",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources",-"flourescent lamp","electrical ").join(" ")),this.createVertexTemplateEntry(m+"lamp",50,100,"","Lamp",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","lamp","electrical optical ").join(" ")),this.createVertexTemplateEntry(f+"thermocouple;",80,81,"","Thermocouple",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","thermocouple","electrical ").join(" ")),this.createVertexTemplateEntry(c+"amplifier;",90,100,"","Amplifier",null,null,this.getTagsForStencil("mxgraph.electrical.abstract",-"amplifier","electrical ").join(" ")),this.createVertexTemplateEntry(c+"controlled_amplifier;",100,90,"","Controlled Amplifier",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","controlled_amplifier","electrical ").join(" ")),this.createVertexTemplateEntry(c+"dac;",70,46,"","DAC",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","dac","electrical ").join(" ")),this.createVertexTemplateEntry("shadow=0;dashed=0;align=center;html=1;strokeWidth=1;shape=mxgraph.electrical.abstract.mux2;whiteSpace=wrap;",-80,120,"Mux","Mux",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","mux","electrical ").join(" ")),this.createVertexTemplateEntry("shadow=0;dashed=0;align=center;html=1;strokeWidth=1;shape=mxgraph.electrical.abstract.mux2;operation=demux;whiteSpace=wrap;",80,120,"Demux","Demux",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","mux","electrical ").join(" ")),this.createVertexTemplateEntry(c+"operational_amp_1;",98,90,"","Operational Amp",null,null,this.getTagsForStencil("mxgraph.electrical.abstract",-"operational_amp_1","electrical ").join(" ")),this.createVertexTemplateEntry(c+"operational_amp_2;",98,90,"","Operational Amp",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","operational_amp_2","electrical ").join(" ")),this.createVertexTemplateEntry(c+"ota_1;",100,90,"","OTA",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","ota_1","electrical ").join(" ")),this.createVertexTemplateEntry(c+"ota_2;",100,90,"","OTA",null,null,this.getTagsForStencil("mxgraph.electrical.abstract",-"ota_2","electrical ").join(" ")),this.createVertexTemplateEntry(c+"ota_3;",100,90,"","OTA",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","ota_3","electrical ").join(" ")),this.createVertexTemplateEntry(c+"quantizer;",52,46,"","Quantizer",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","quantizer","electrical ").join(" ")),this.createVertexTemplateEntry(c+"delta;",50,50,"","Delta",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","delta","electrical ").join(" ")),-this.createVertexTemplateEntry(mxConstants.STYLE_SHAPE+"=mxgraph.electrical.abstract.function;html=1;shadow=0;dashed=0;align=center;strokeWidth=1;fontSize=24",50,50,"fn","Function",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","function","electrical ").join(" ")),this.createVertexTemplateEntry(c+"integrator;",50,50,"","Integrator",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","integrator","electrical ").join(" ")),this.createVertexTemplateEntry(c+"multiplier;",50,-50,"","Multiplier",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","multiplier","electrical ").join(" ")),this.createVertexTemplateEntry(c+"sum;",50,50,"","Sum",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","sum","electrical ").join(" ")),this.createVertexTemplateEntry(c+"summation_point;",50,50,"","Summation Point",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","summation_point","electrical ").join(" ")),this.createVertexTemplateEntry(c+"filter;",52,-46,"","Filter",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","filter","electrical ").join(" ")),this.createVertexTemplateEntry(a+"=mxgraph.electrical.logic_gates.bandpass_filter;",52,46,"","Bandpass Filter",null,null,this.getTagsForStencil("mxgraph.electrical.logic_gates","bandpass_filter","").join(" ")),this.createVertexTemplateEntry(a+"=mxgraph.electrical.logic_gates.highpass_filter;",52,46,"","Highpass Filter",null,null,this.getTagsForStencil("mxgraph.electrical.logic_gates","highpass_filter",-"").join(" ")),this.createVertexTemplateEntry(a+"=mxgraph.electrical.logic_gates.lowpass_filter;",52,46,"","Lowpass Filter",null,null,this.getTagsForStencil("mxgraph.electrical.logic_gates","lowpass_filter","").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_SHAPE+"=mxgraph.electrical.abstract.thermistor_with_independent_integral_heater;html=1;shadow=0;dashed=0;strokeWidth=1;align=center;overflow=fill;fontSize=12;",100,94.25,'<table cellpadding="0" cellspacing="0" style="width:100%;height:100%;"><tr height="45%"><td align="center">\\temp\\</td></tr><tr height="55%"><td></td></tr></table>',-"Thermistor With Independent Integral Heater",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","thermistor_with_independent_integral_heater","electrical ").join(" ")),this.createVertexTemplateEntry(c+"voltage_regulator;",70,58,"","Voltage Regulator",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","voltage_regulator","electrical ").join(" ")),this.createVertexTemplateEntry(r+"vss2;fontSize=24;flipV=1;",60,40,"V<sub>ss</sub>","Vss",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources",-"vss","electrical signal source ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_VERTICAL_LABEL_POSITION+"=top;"+mxConstants.STYLE_VERTICAL_ALIGN+"=bottom;"+mxConstants.STYLE_SHAPE+"=mxgraph.electrical.signal_sources.vdd;shadow=0;dashed=0;align=center;strokeWidth=1;fontSize=24;html=1;flipV=1;",60,40,"V<sub>dd</sub>","Vdd",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","vdd","electrical signal source ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_VERTICAL_LABEL_POSITION+-"=top;"+mxConstants.STYLE_VERTICAL_ALIGN+"=bottom;"+mxConstants.STYLE_SHAPE+"=mxgraph.electrical.signal_sources.current_flow;shadow=0;dashed=0;align=center;strokeWidth=1;fontSize=10;html=1;",70,10,"5 mA","Current Flow",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","current_flow","electrical signal source ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_LABEL_POSITION+"=right;"+mxConstants.STYLE_ALIGN+"=left;"+mxConstants.STYLE_SHAPE+"=mxgraph.electrical.signal_sources.voltage;shadow=0;dashed=0;strokeWidth=1;fontSize=10;html=1;",-10,70,"1.2 V","Voltage",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","voltage","electrical signal source ").join(" ")),this.createVertexTemplateEntry(r+"equipotential;",90,90,"","Equipotential",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","equipotential","electrical signal source ").join(" ")),this.createVertexTemplateEntry(r+"protective_earth;",25,20,"","Equipotential",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","protective_earth earth ground",-"electrical signal source ").join(" ")),this.createVertexTemplateEntry(r+"signal_ground;",45,30,"","Ground",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","signal_ground earth","electrical signal source ").join(" ")),this.createVertexTemplateEntry(f+"chassis;",65,32,"","Chassis",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","chassis","electrical ").join(" ")),this.createVertexTemplateEntry(f+"circuit_breaker;",100,13,"","Circuit Breaker",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources",-"circuit breaker","electrical ").join(" ")),this.createVertexTemplateEntry(f+"generic_component",60,60,"","Generic Component",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","generic component","electrical ").join(" ")),this.createVertexTemplateEntry(f+"permanent_magnet",20,70,"","Permanent Magnet",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","permanent magnet","electrical ").join(" ")),this.createVertexTemplateEntry(f+"thermal_element",100,32,"","Thermal Element",-null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","thermal element","electrical ").join(" ")),this.createVertexTemplateEntry(f+"igniter_plug2",72,39,"","Igniter Plug",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","igniter plug","electrical ").join(" ")),this.createVertexTemplateEntry("shape=mxgraph.arrows2.arrow;verticalLabelPosition=bottom;shadow=0;dashed=0;align=center;html=1;verticalAlign=top;strokeWidth=1;dy=0;dx=10;notch=0;",100,30,"","Pickup Head",null,-null,this.getTagsForStencil("mxgraph.electrical.signal_sources","pickup head","electrical ").join(" ")),this.createVertexTemplateEntry(f+"squib_ignitor",100,100,"","Squib Ignitor",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","squib ignitor","electrical ").join(" ")),this.createVertexTemplateEntry(f+"transducer",70,60,"","Transducer",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","transducer","electrical ").join(" ")),this.createVertexTemplateEntry(f+"transducer_2",-80,100,"","Transducer",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","transducer","electrical ").join(" ")),this.createVertexTemplateEntry(f+"thermopile",80,82,"","Thermopile",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","thermopile","electrical ").join(" ")),this.createVertexTemplateEntry(f+"indicator",60,60,"","Indicator",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","indicator","electrical ").join(" ")),this.createVertexTemplateEntry("verticalLabelPosition=bottom;shadow=0;dashed=0;align=center;fillColor=strokeColor;html=1;verticalAlign=top;strokeWidth=1;shape=mxgraph.electrical.miscellaneous.surge_protector;",+95,100,"","NMOS",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_ic_n","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"mosfet_ic_p;",95,100,"","PMOS",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_ic_p","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"mosfet_ic_n_body_diode;",95,100,"","NMOS with Body Diode",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_ic_n_body_diode","electrical transistor ").join(" ")),+this.createVertexTemplateEntry(l+"mosfet_ic_p_body_diode;",95,100,"","PMOS with Body Diode",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_ic_p_body_diode","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"mosfet_n_no_bulk;",95,100,"","MOSFET No Bulk (N)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_n_no_bulk","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"mosfet_p_no_bulk;",95,100,"","MOSFET No Bulk (P)",+null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_p_no_bulk","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"dual_gate_mosfet_n;",95,100,"","Dual Gate MOSFET (N)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","dual_gate_mosfet_n","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"dual_gate_mosfet_p;",95,100,"","Dual Gate MOSFET (P)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","dual_gate_mosfet_p",+"electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"nmos;pointerEvents=1;",60,100,"","NMOS",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","nmos","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"nmos_bulk;pointerEvents=1;",60,100,"","NMOS with Bulk",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","nmos bulk","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"pmos;pointerEvents=1;",60,100,"","PMOS",null,+null,this.getTagsForStencil("mxgraph.electrical.transistors","pmos","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"pmos_bulk;pointerEvents=1;",60,100,"","PMOS with Bulk",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","pmos bulk","electrical transistor ").join(" "))]);this.setCurrentSearchEntryLibrary("electrical","electricalInstruments");this.addPaletteFunctions("electricalInstruments","Electrical / Instruments",!1,[this.createVertexTemplateEntry("verticalLabelPosition=middle;shadow=0;dashed=0;align=center;html=1;verticalAlign=middle;strokeWidth=1;shape=ellipse;aspect=fixed;fontSize=50;",+90,90,"A","Ammeter",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","ampermeter ammeter","electrical instrument ").join(" ")),this.createVertexTemplateEntry(w+"galvanometer;",90,90,"","Galvanometer",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","galvanometer","electrical instrument ").join(" ")),this.createVertexTemplateEntry(w+"oscilloscope;",90,90,"","Oscilloscope",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","oscilloscope","electrical instrument ").join(" ")),+this.createVertexTemplateEntry(w+"signal_generator;",90,90,"","Signal Generator",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","signal_generator","electrical instrument ").join(" ")),this.createVertexTemplateEntry("verticalLabelPosition=middle;shadow=0;dashed=0;align=center;html=1;verticalAlign=middle;strokeWidth=1;shape=ellipse;aspect=fixed;fontSize=50;",90,90,"V","Voltmeter",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","ampermeter ammeter","electrical instrument ").join(" "))]);+this.setCurrentSearchEntryLibrary("electrical","electricalMisc");this.addPaletteFunctions("electricalMisc","Electrical / Misc",!1,[this.createVertexTemplateEntry(p+"aerial_-_antenna_1;",80,100,"","Antenna",null,null,this.getTagsForStencil("mxgraph.electrical.radio","aerial_-_antenna_1","electrical radio audio ").join(" ")),this.createVertexTemplateEntry(p+"aerial_-_antenna_2;",79,100,"","Antenna",null,null,this.getTagsForStencil("mxgraph.electrical.radio","aerial_-_antenna_2","electrical radio audio ").join(" ")),+this.createVertexTemplateEntry(p+"loop_antenna;",64.8,69.78,"","Loop Antenna",null,null,this.getTagsForStencil("mxgraph.electrical.radio","loop_antenna","electrical radio audio ").join(" ")),this.createVertexTemplateEntry(f+"loop_antenna",100,100,"","Loop Antenna",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","loop antenna","electrical ").join(" ")),this.createVertexTemplateEntry("verticalLabelPosition=middle;shadow=0;dashed=0;align=center;html=1;verticalAlign=middle;strokeWidth=1;shape=ellipse;aspect=fixed;fontSize=35;",+60,60,"M","Electrical Motor",null,null,this.getTagsForStencil("mxgraph.electrical.electro-mechanical","motor_1","electrical switch relay ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_SHAPE+"=mxgraph.electrical.electro-mechanical.motor_2;html=1;shadow=0;dashed=0;align=center;fontSize=30;strokeWidth=1;",100,60,"","Motor Armature",null,null,this.getTagsForStencil("mxgraph.electrical.electro-mechanical","motor_2","electrical switch relay ").join(" ")),this.createVertexTemplateEntry(f++"co-ax;",40,60,"","Co-Ax",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","co-ax","electrical ").join(" ")),this.createVertexTemplateEntry(f+"crystal_1;",100,40,"","Crystal",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","crystal_1","electrical ").join(" ")),this.createVertexTemplateEntry(f+"fuse_1;",100,20,"","Fuse (IEC)",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","fuse_1","electrical ").join(" ")),this.createVertexTemplateEntry(f++"fuse_2;",100,20,"","Fuse (IEEE)",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","fuse_2","electrical ").join(" ")),this.createVertexTemplateEntry(f+"fuse_3;",100,12,"","Fuse (obsolete)",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","fuse_3","electrical ").join(" ")),this.createVertexTemplateEntry(f+"fuse_4;",100,32,"","Fuse (IEEE)",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","fuse_4","electrical ").join(" ")),this.createVertexTemplateEntry(f++"light_bulb;",60,50,"","Light Bulb",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","light_bulb","electrical ").join(" ")),this.createVertexTemplateEntry(f+"illuminating_bulb;",60,50,"","Illuminating Bulb",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","illuminating_bulb","electrical ").join(" ")),this.createVertexTemplateEntry(f+"light_bulb;",60,50,"","Pilot Light",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","light_bulb","electrical ").join(" ")),+this.createVertexTemplateEntry(f+"neon_lamp_2;",60,50,"","Neon Lamp",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","neon_lamp_2","electrical ").join(" ")),this.createVertexTemplateEntry(f+"flourescent_lamp",80,30,"","Flourescent Lamp",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","flourescent lamp","electrical ").join(" ")),this.createVertexTemplateEntry(m+"lamp",50,100,"","Lamp",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","lamp",+"electrical optical ").join(" ")),this.createVertexTemplateEntry(f+"thermocouple;",80,81,"","Thermocouple",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","thermocouple","electrical ").join(" ")),this.createVertexTemplateEntry(c+"amplifier;",90,100,"","Amplifier",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","amplifier","electrical ").join(" ")),this.createVertexTemplateEntry(c+"controlled_amplifier;",100,90,"","Controlled Amplifier",null,null,this.getTagsForStencil("mxgraph.electrical.abstract",+"controlled_amplifier","electrical ").join(" ")),this.createVertexTemplateEntry(c+"dac;",70,46,"","DAC",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","dac","electrical ").join(" ")),this.createVertexTemplateEntry("shadow=0;dashed=0;align=center;html=1;strokeWidth=1;shape=mxgraph.electrical.abstract.mux2;whiteSpace=wrap;",80,120,"Mux","Mux",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","mux","electrical ").join(" ")),this.createVertexTemplateEntry("shadow=0;dashed=0;align=center;html=1;strokeWidth=1;shape=mxgraph.electrical.abstract.mux2;operation=demux;whiteSpace=wrap;",+80,120,"Demux","Demux",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","mux","electrical ").join(" ")),this.createVertexTemplateEntry(c+"operational_amp_1;",98,90,"","Operational Amp",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","operational_amp_1","electrical ").join(" ")),this.createVertexTemplateEntry(c+"operational_amp_2;",98,90,"","Operational Amp",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","operational_amp_2","electrical ").join(" ")),this.createVertexTemplateEntry(c++"ota_1;",100,90,"","OTA",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","ota_1","electrical ").join(" ")),this.createVertexTemplateEntry(c+"ota_2;",100,90,"","OTA",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","ota_2","electrical ").join(" ")),this.createVertexTemplateEntry(c+"ota_3;",100,90,"","OTA",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","ota_3","electrical ").join(" ")),this.createVertexTemplateEntry(c+"quantizer;",52,46,"","Quantizer",null,+null,this.getTagsForStencil("mxgraph.electrical.abstract","quantizer","electrical ").join(" ")),this.createVertexTemplateEntry(c+"delta;",50,50,"","Delta",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","delta","electrical ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_SHAPE+"=mxgraph.electrical.abstract.function;html=1;shadow=0;dashed=0;align=center;strokeWidth=1;fontSize=24",50,50,"fn","Function",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","function",+"electrical ").join(" ")),this.createVertexTemplateEntry(c+"integrator;",50,50,"","Integrator",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","integrator","electrical ").join(" ")),this.createVertexTemplateEntry(c+"multiplier;",50,50,"","Multiplier",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","multiplier","electrical ").join(" ")),this.createVertexTemplateEntry(c+"sum;",50,50,"","Sum",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","sum","electrical ").join(" ")),+this.createVertexTemplateEntry(c+"summation_point;",50,50,"","Summation Point",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","summation_point","electrical ").join(" ")),this.createVertexTemplateEntry(c+"filter;",52,46,"","Filter",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","filter","electrical ").join(" ")),this.createVertexTemplateEntry(a+"=mxgraph.electrical.logic_gates.bandpass_filter;",52,46,"","Bandpass Filter",null,null,this.getTagsForStencil("mxgraph.electrical.logic_gates",+"bandpass_filter","").join(" ")),this.createVertexTemplateEntry(a+"=mxgraph.electrical.logic_gates.highpass_filter;",52,46,"","Highpass Filter",null,null,this.getTagsForStencil("mxgraph.electrical.logic_gates","highpass_filter","").join(" ")),this.createVertexTemplateEntry(a+"=mxgraph.electrical.logic_gates.lowpass_filter;",52,46,"","Lowpass Filter",null,null,this.getTagsForStencil("mxgraph.electrical.logic_gates","lowpass_filter","").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_SHAPE++"=mxgraph.electrical.abstract.thermistor_with_independent_integral_heater;html=1;shadow=0;dashed=0;strokeWidth=1;align=center;overflow=fill;fontSize=12;",100,94.25,'<table cellpadding="0" cellspacing="0" style="width:100%;height:100%;"><tr height="45%"><td align="center">\\temp\\</td></tr><tr height="55%"><td></td></tr></table>',"Thermistor With Independent Integral Heater",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","thermistor_with_independent_integral_heater","electrical ").join(" ")),+this.createVertexTemplateEntry(c+"voltage_regulator;",70,58,"","Voltage Regulator",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","voltage_regulator","electrical ").join(" ")),this.createVertexTemplateEntry(r+"vss2;fontSize=24;flipV=1;",60,40,"V<sub>ss</sub>","Vss",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","vss","electrical signal source ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_VERTICAL_LABEL_POSITION+"=top;"+mxConstants.STYLE_VERTICAL_ALIGN++"=bottom;"+mxConstants.STYLE_SHAPE+"=mxgraph.electrical.signal_sources.vdd;shadow=0;dashed=0;align=center;strokeWidth=1;fontSize=24;html=1;flipV=1;",60,40,"V<sub>dd</sub>","Vdd",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","vdd","electrical signal source ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_VERTICAL_LABEL_POSITION+"=top;"+mxConstants.STYLE_VERTICAL_ALIGN+"=bottom;"+mxConstants.STYLE_SHAPE+"=mxgraph.electrical.signal_sources.current_flow;shadow=0;dashed=0;align=center;strokeWidth=1;fontSize=10;html=1;",+70,10,"5 mA","Current Flow",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","current_flow","electrical signal source ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_LABEL_POSITION+"=right;"+mxConstants.STYLE_ALIGN+"=left;"+mxConstants.STYLE_SHAPE+"=mxgraph.electrical.signal_sources.voltage;shadow=0;dashed=0;strokeWidth=1;fontSize=10;html=1;",10,70,"1.2 V","Voltage",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","voltage","electrical signal source ").join(" ")),+this.createVertexTemplateEntry(r+"equipotential;",90,90,"","Equipotential",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","equipotential","electrical signal source ").join(" ")),this.createVertexTemplateEntry(r+"protective_earth;",25,20,"","Equipotential",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","protective_earth earth ground","electrical signal source ").join(" ")),this.createVertexTemplateEntry(r+"signal_ground;",45,30,"","Ground",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources",+"signal_ground earth","electrical signal source ").join(" ")),this.createVertexTemplateEntry(f+"chassis;",65,32,"","Chassis",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","chassis","electrical ").join(" ")),this.createVertexTemplateEntry(f+"circuit_breaker;",100,13,"","Circuit Breaker",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","circuit breaker","electrical ").join(" ")),this.createVertexTemplateEntry(f+"generic_component",60,60,"","Generic Component",+null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","generic component","electrical ").join(" ")),this.createVertexTemplateEntry(f+"permanent_magnet",20,70,"","Permanent Magnet",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","permanent magnet","electrical ").join(" ")),this.createVertexTemplateEntry(f+"thermal_element",100,32,"","Thermal Element",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","thermal element","electrical ").join(" ")),+this.createVertexTemplateEntry(f+"igniter_plug2",72,39,"","Igniter Plug",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","igniter plug","electrical ").join(" ")),this.createVertexTemplateEntry("shape=mxgraph.arrows2.arrow;verticalLabelPosition=bottom;shadow=0;dashed=0;align=center;html=1;verticalAlign=top;strokeWidth=1;dy=0;dx=10;notch=0;",100,30,"","Pickup Head",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","pickup head","electrical ").join(" ")),this.createVertexTemplateEntry(f++"squib_ignitor",100,100,"","Squib Ignitor",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","squib ignitor","electrical ").join(" ")),this.createVertexTemplateEntry(f+"transducer",70,60,"","Transducer",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","transducer","electrical ").join(" ")),this.createVertexTemplateEntry(f+"transducer_2",80,100,"","Transducer",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","transducer","electrical ").join(" ")),+this.createVertexTemplateEntry(f+"thermopile",80,82,"","Thermopile",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","thermopile","electrical ").join(" ")),this.createVertexTemplateEntry(f+"indicator",60,60,"","Indicator",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","indicator","electrical ").join(" ")),this.createVertexTemplateEntry("verticalLabelPosition=bottom;shadow=0;dashed=0;align=center;fillColor=strokeColor;html=1;verticalAlign=top;strokeWidth=1;shape=mxgraph.electrical.miscellaneous.surge_protector;",70,20,"","Surge Protector",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","surge protector","electrical ").join(" ")),this.createVertexTemplateEntry(f+"surge_protector_2;",70,24,"","Surge Protector",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","surge protector","electrical ").join(" ")),this.createVertexTemplateEntry("verticalLabelPosition=bottom;shadow=0;dashed=0;align=center;html=1;verticalAlign=top;strokeWidth=1;shape=rect;",130,50,"","Material",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","material","electrical ").join(" ")),this.createVertexTemplateEntry(f+"sensing_link_squib",130,40,"","Sensing Link Squib",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","sensing link squib","electrical ").join(" ")),this.createVertexTemplateEntry(f+"delay_element",100,100,"","Delay Element",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","delay_element","electrical ").join(" ")),this.createVertexTemplateEntry(p+"buzzer",80,50,"","Buzzer",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","buzzer","electrical radio audio ").join(" ")),this.createVertexTemplateEntry(f+"adapter",100,40,"","Adapter",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","adapter","electrical radio audio ").join(" ")),this.createVertexTemplateEntry("verticalLabelPosition=bottom;shadow=0;dashed=0;align=center;html=1;verticalAlign=top;strokeWidth=1;shape=ellipse;perimeter=ellipsePerimeter;",15,15,@@ -12637,37 +12639,38 @@ $jscomp.generator.Engine_.prototype.nextStep_=function(){for(;this.context_.next$jscomp.generator.Generator_=function(b){this.next=function(k){return b.next_(k)};this.throw=function(k){return b.throw_(k)};this.return=function(k){return b.return_(k)};this[Symbol.iterator]=function(){return this}};$jscomp.generator.createGenerator=function(b,k){k=new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(k));$jscomp.setPrototypeOf&&b.prototype&&$jscomp.setPrototypeOf(k,b.prototype);return k};$jscomp.asyncExecutePromiseGenerator=function(b){function k(d){return b.next(d)}function m(d){return b.throw(d)}return new Promise(function(d,q){function u(y){y.done?d(y.value):Promise.resolve(y.value).then(k,m).then(u,q)}u(b.next())})};$jscomp.asyncExecutePromiseGeneratorFunction=function(b){return $jscomp.asyncExecutePromiseGenerator(b())};$jscomp.asyncExecutePromiseGeneratorProgram=function(b){return $jscomp.asyncExecutePromiseGenerator(new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(b)))};DrawioFile=function(b,k){mxEventSource.call(this);this.ui=b;this.setData(k||"");this.initialData=this.getData();this.created=(new Date).getTime();this.stats={opened:0,merged:0,fileMerged:0,fileReloaded:0,conflicts:0,timeouts:0,saved:0,closed:0,destroyed:0,joined:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0}};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;DrawioFile.RESTRICT_EXPORT=!1;mxUtils.extend(DrawioFile,mxEventSource);-DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.savingSpinnerKey="saving";DrawioFile.prototype.savingStatusKey="saving";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.optimisticSyncDelay=300;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.lastSaved=null;DrawioFile.prototype.lastChanged=null;DrawioFile.prototype.opened=null;DrawioFile.prototype.modified=!1;-DrawioFile.prototype.shadowModified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.ageStart=null;DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};-DrawioFile.prototype.getShadowPages=function(){if(null==this.shadowPages&&(this.shadowPages=this.ui.getPagesForXml(this.initialData,!0),void 0===this.shadowVars)){this.shadowVars=null;try{var b=mxUtils.parseXml(this.initialData).documentElement;null!=b&&"mxfile"==b.nodeName&&(this.shadowVars=b.getAttribute("vars"))}catch(k){}}return this.shadowPages};+DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.savingSpinnerKey="saving";DrawioFile.prototype.savingStatusKey="saving";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.optimisticSyncDelay=300;DrawioFile.prototype.loadFontsTimeout=5E3;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.lastSaved=null;DrawioFile.prototype.lastChanged=null;+DrawioFile.prototype.opened=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.shadowModified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.ageStart=null;+DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};DrawioFile.prototype.getShadowPages=function(){if(null==this.shadowPages&&(this.shadowPages=this.ui.getPagesForXml(this.initialData,!0),void 0===this.shadowVars)){this.shadowVars=null;try{var b=mxUtils.parseXml(this.initialData).documentElement;null!=b&&"mxfile"==b.nodeName&&(this.shadowVars=b.getAttribute("vars"))}catch(k){}}return this.shadowPages};DrawioFile.prototype.setShadowPages=function(b,k){this.shadowPages=b;this.shadowVars=void 0!==k?k:null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null};DrawioFile.prototype.getShadowVars=function(){this.getShadowPages();return void 0!==this.shadowVars?this.shadowVars:null};DrawioFile.prototype.synchronizeFile=function(b,k,m){EditorUi.debug("DrawioFile.synchronizeFile",[this],"latestFile",[m],"savingFile",this.savingFile);if(this.savingFile)null!=k&&k({message:mxResources.get("busy")});else{var d=!0,q=window.setTimeout(mxUtils.bind(this,function(){d=!1;null!=k&&k({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,k)})})}),this.ui.timeout),u=mxUtils.bind(this,function(A){d&&(window.clearTimeout(q),null!=k&&k(A))}),y=mxUtils.bind(this,function(){return!d});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,function(A){d&&(window.clearTimeout(q),this.sync.cleanup(b,k,A))}),u,y):this.updateFile(mxUtils.bind(this,function(){d&&(window.clearTimeout(q),null!=b&&b())}),u,y,null,null,m)}};DrawioFile.prototype.updateFile=function(b,k,m,d,q,u){if(null==m||!m())if(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",q,"invalidChecksum",this.invalidChecksum,"latestFile",[u]),this.ui.getCurrentFile()!=this||this.invalidChecksum)null!=k&&k();else{var y=mxUtils.bind(this,function(A){try{null!=m&&m()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[A]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=k&&k():null!=A?this.mergeFile(A,b,k,d,q):this.reloadFile(b,k))}catch(J){null!=k&&k(J)}});null!=u?y(u):this.getLatestVersion(y,k)}};DrawioFile.prototype.mergeFile=function(b,k,m,d,q){try{var u=b.getShadowPages();if(null!=u&&0<u.length){var y=this.getShadowPages(),A=[this.ui.diffPages(null!=d?d:y,u)];d=null;try{var J=mxUtils.parseXml(b.initialData).documentElement;null!=J&&"mxfile"==J.nodeName&&(d=J.getAttribute("vars"))}catch(t){}d!=this.getShadowVars()&&(A[0][EditorUi.DIFF_FILE]={vars:d});var K=this.ignorePatches(A);if(K)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),-EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",K),null!=k&&k();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var H=this.isModified()?this.ui.diffPages(y,this.isRealtime()?this.ownPages:this.ui.pages):null,G=this.ui.patchPages(this.ui.clonePages(y),A[0]),c=this.ui.getHashValueForPages(G,{}),f=this.ui.getHashValueForPages(u,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",y,"pages",u,"patched",G,"patches",A,"changes",H,"checksum",-c,"current",f,"valid",c==f,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",q);if(null!=c&&c!=f)this.checksumError(m,A,null,null,"mergeFile",c,f,b.getCurrentRevisionId());else{this.setShadowPages(u,d);if(null!=this.sync){var l=this.sync.patchRealtime(A,DrawioFile.LAST_WRITE_WINS?H:null,null,q);null==l||mxUtils.isEmptyObject(l)||A.push(l)}this.patch(A,DrawioFile.LAST_WRITE_WINS?H:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());+EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",K),null!=k&&k();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var F=this.isModified()?this.ui.diffPages(y,this.isRealtime()?this.ownPages:this.ui.pages):null,H=this.ui.patchPages(this.ui.clonePages(y),A[0]),c=this.ui.getHashValueForPages(H,{}),f=this.ui.getHashValueForPages(u,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",y,"pages",u,"patched",H,"patches",A,"changes",F,"checksum",+c,"current",f,"valid",c==f,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",q);if(null!=c&&c!=f)this.checksumError(m,A,null,null,"mergeFile",c,f,b.getCurrentRevisionId());else{this.setShadowPages(u,d);if(null!=this.sync){var l=this.sync.patchRealtime(A,DrawioFile.LAST_WRITE_WINS?F:null,null,q);null==l||mxUtils.isEmptyObject(l)||A.push(l)}this.patch(A,DrawioFile.LAST_WRITE_WINS?F:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=k&&k()}}catch(t){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=m&&m(t);try{if(!(t instanceof DOMException&&"InvalidCharacterError"==t.name)){var n=this.getCurrentUser(),r=null!=n?n.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),r,t)}}catch(x){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(t){null!=m&&m(t)}};DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var k=new mxCodec(mxUtils.createXmlDocument()),m=k.document.createElement("mxfile");if(null!=b)for(var d=0;d<b.length;d++){var q=k.encode(new mxGraphModel(b[d].root));"1"!=urlParams.dev&&(q=this.ui.anonymizeNode(q,!0));q.setAttribute("id",b[d].getId());b[d].viewState&&this.ui.editor.graph.saveViewState(b[d].viewState,q,!0);m.appendChild(q)}return mxUtils.getPrettyXml(m)};DrawioFile.prototype.compressReportData=function(b,k,m){k=null!=k?k:1E4;null!=m&&null!=b&&b.length>m?b=b.substring(0,m)+"[...]":null!=b&&b.length>k&&(b=Graph.compress(b)+"\n");return b};-DrawioFile.prototype.checksumError=function(b,k,m,d,q,u,y,A){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var J=this.getCurrentUser(),K=null!=J?J.id:"unknown",H=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",G=JSON.stringify(k).length,c=null;if(null!=k&&1E3>G){b=[];for(m=0;m<k.length;m++)b.push(this.ui.anonymizePatch(k[m]));c=JSON.stringify(b);c=null!=c&&1E3>-c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(f){try{var l=null!=c?"report":"error",n=this.ui.getHashValueForPages(f.getShadowPages()),r="unknown",t="unknown",x="unknown";try{var B=null!=f.initialData&&0<f.initialData.length?mxUtils.parseXml(f.initialData).documentElement:null;null!=B&&(null!=B.getAttribute("version")&&(r=B.getAttribute("version")),null!=B.getAttribute("agent")&&(t=B.getAttribute("agent")),null!=B.getAttribute("type")&&(x=B.getAttribute("type")))}catch(F){}EditorUi.logError("Checksum "+-l+" in "+q,null,this.getMode()+"."+H,"user_"+K+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+G+"-patches_"+k.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=u?"-expected_"+u:"")+(null!=y?"-current_"+y:"")+(null!=A?"-rev_"+this.ui.hashValue(A):"")+(null!=n?"-latest_"+n:"")+"-latestRev_"+this.ui.hashValue(f.getCurrentRevisionId())+("-latestVersion_"+r)+("-latestAgent_"+t)+("-latestType_"+x));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+H,action:q,label:"user_"+-K+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+G+"-patches_"+k.length+"-size_"+this.getSize()})}catch(F){}}),function(){})}catch(f){}};-DrawioFile.prototype.sendErrorReport=function(b,k,m,d){try{var q=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),u=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),y=this.getCurrentUser(),A=null!=y?this.ui.hashValue(y.id):"unknown",J=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",K=this.getTitle(),H=K.lastIndexOf(".");y="xml";0<H&&(y=K.substring(H));var G=null!=m?m.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()++DrawioFile.prototype.checksumError=function(b,k,m,d,q,u,y,A){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var J=this.getCurrentUser(),K=null!=J?J.id:"unknown",F=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",H=JSON.stringify(k).length,c=null;if(null!=k&&1E3>H){b=[];for(m=0;m<k.length;m++)b.push(this.ui.anonymizePatch(k[m]));c=JSON.stringify(b);c=null!=c&&1E3>+c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(f){try{var l=null!=c?"report":"error",n=this.ui.getHashValueForPages(f.getShadowPages()),r="unknown",t="unknown",x="unknown";try{var B=null!=f.initialData&&0<f.initialData.length?mxUtils.parseXml(f.initialData).documentElement:null;null!=B&&(null!=B.getAttribute("version")&&(r=B.getAttribute("version")),null!=B.getAttribute("agent")&&(t=B.getAttribute("agent")),null!=B.getAttribute("type")&&(x=B.getAttribute("type")))}catch(G){}EditorUi.logError("Checksum "++l+" in "+q,null,this.getMode()+"."+F,"user_"+K+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+H+"-patches_"+k.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=u?"-expected_"+u:"")+(null!=y?"-current_"+y:"")+(null!=A?"-rev_"+this.ui.hashValue(A):"")+(null!=n?"-latest_"+n:"")+"-latestRev_"+this.ui.hashValue(f.getCurrentRevisionId())+("-latestVersion_"+r)+("-latestAgent_"+t)+("-latestType_"+x));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+F,action:q,label:"user_"++K+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+H+"-patches_"+k.length+"-size_"+this.getSize()})}catch(G){}}),function(){})}catch(f){}};+DrawioFile.prototype.sendErrorReport=function(b,k,m,d){try{var q=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),u=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),y=this.getCurrentUser(),A=null!=y?this.ui.hashValue(y.id):"unknown",J=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",K=this.getTitle(),F=K.lastIndexOf(".");y="xml";0<F&&(y=K.substring(F));var H=null!=m?m.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()+":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+y+")\nUser="+A+J+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=k?"\n\n"+k:-"")+(null!=m?"\n\nError: "+m.message:"")+"\n\nStack:\n"+G+"\n\nShadow:\n"+q+"\n\nData:\n"+u,d)}catch(c){}};+"")+(null!=m?"\n\nError: "+m.message:"")+"\n\nStack:\n"+H+"\n\nShadow:\n"+q+"\n\nData:\n"+u,d)}catch(c){}};DrawioFile.prototype.reloadFile=function(b,k){try{this.stats.fileReloaded++;var m=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),d=this.ui.editor.graph,q=d.getSelectionCells(),u=d.getViewState(),y=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(A){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[m],"viewState",[u],"latestFile",A);null!=A?(this.ui.replaceFileData(A.getData(),[m]),this.ui.restoreViewState(y,u,q),this.setDescriptor(A.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var J=this.ui.getCurrentFile();null!=J&&(J.stats=this.stats,J.patch([m]),J.fileChanged());this.ui.restoreViewState(y,u,q);null!=b&&b()}else null!=k&&k(this.ui.fileLoadedError)}),!0))}),k)}catch(A){null!=k&&k(A)}};DrawioFile.prototype.copyFile=function(b,k){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};DrawioFile.prototype.ignorePatches=function(b){var k=!0;if(null!=b)for(var m=0;m<b.length&&k;m++)k=k&&mxUtils.isEmptyObject(b[m]);return k};-DrawioFile.prototype.patch=function(b,k,m,d){if(null!=b){var q=this.ui.editor.undoManager,u=q.history.slice(),y=q.indexOfNextAdd,A=this.ui.editor.graph;A.container.style.visibility="hidden";var J=this.changeListenerEnabled;this.changeListenerEnabled=m;var K=A.foldingEnabled,H=A.mathEnabled,G=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var c=A.cellRenderer.redraw;A.cellRenderer.redraw=function(x){x.view.graph.isEditing(x.cell)&&(x.view.graph.scrollCellToVisible(x.cell),+DrawioFile.prototype.patch=function(b,k,m,d){if(null!=b){var q=this.ui.editor.undoManager,u=q.history.slice(),y=q.indexOfNextAdd,A=this.ui.editor.graph;A.container.style.visibility="hidden";var J=this.changeListenerEnabled;this.changeListenerEnabled=m;var K=A.foldingEnabled,F=A.mathEnabled,H=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var c=A.cellRenderer.redraw;A.cellRenderer.redraw=function(x){x.view.graph.isEditing(x.cell)&&(x.view.graph.scrollCellToVisible(x.cell),x.view.graph.cellEditor.resize());c.apply(this,arguments)};A.model.beginUpdate();try{if(m){for(var f=this.ui.pages.slice(),l=this.ui.currentPage,n=this.ui.applyPatches(this.ui.pages,b,!0,k,this.isModified()),r=0;r<n.length;r++){var t=mxUtils.indexOf(this.ui.pages,n[r]);0>t?this.ui.insertPage(n[r],Math.min(r,this.ui.pages.length)):this.ui.movePage(t,r)}for(r=0;r<f.length;r++)0>mxUtils.indexOf(n,f[r])&&this.ui.removePage(f[r]);0<=mxUtils.indexOf(this.ui.pages,l)&&this.ui.selectPage(l,!0)}else this.ui.pages=-this.ui.applyPatches(this.ui.pages,b,!0,k,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);A.checkDefaultParent()}finally{A.container.style.visibility="",A.model.endUpdate(),A.cellRenderer.redraw=c,this.changeListenerEnabled=J,m||(q.history=u,q.indexOfNextAdd=y,q.fireEvent(new mxEventObject(mxEvent.CLEAR))),q=G!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):-null),(u=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&H!=A.mathEnabled?(this.ui.editor.updateGraphComponents(),A.refresh()):q?A.refresh():u&&(K!=A.foldingEnabled?A.view.revalidate():A.view.validate(),A.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!d&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",-[this],"patches",b,"resolver",k,"undoable",m)}return b};-DrawioFile.prototype.save=function(b,k,m,d,q,u){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",d,"overwrite",q,"manual",u,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!q&&this.invalidChecksum)if(null!=m)m({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=k&&k();else if(null!=m)m({message:mxResources.get("readOnly")});-else throw Error(mxResources.get("readOnly"));}catch(y){if(null!=m)m(y);else throw y;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var k=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=k&&(k.viewState=this.ui.editor.graph.getViewState(),k.needsUpdate=!0)}k=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return k};+this.ui.applyPatches(this.ui.pages,b,!0,k,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);A.checkDefaultParent()}finally{A.container.style.visibility="",A.model.endUpdate(),A.cellRenderer.redraw=c,this.changeListenerEnabled=J,m||(q.history=u,q.indexOfNextAdd=y,q.fireEvent(new mxEventObject(mxEvent.CLEAR))),q=H!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):+null),(u=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&F!=A.mathEnabled?(this.ui.editor.updateGraphComponents(),A.refresh()):q?A.refresh():u&&(K!=A.foldingEnabled?A.view.revalidate():A.view.validate(),A.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!d&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",+[this],"patches",b,"resolver",k,"undoable",m)}return b};DrawioFile.prototype.loadFonts=function(b){if(this.ui.getCurrentFile()==this&&/(\.svg)$/i.test(this.getTitle())&&this.ui.getSvgFileProperties(this.ui.fileNode).embedFonts){var k=null,m=!1,d=function(){m||(m=!0,window.clearTimeout(k),b())};k=window.setTimeout(d,this.loadFontsTimeout);try{this.ui.editor.loadFonts(mxUtils.bind(this,function(){this.ui.editor.embedExtFonts(d)}))}catch(q){d()}}else b()};+DrawioFile.prototype.save=function(b,k,m,d,q,u){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",d,"overwrite",q,"manual",u,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!q&&this.invalidChecksum)if(null!=m)m({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else{this.clearAutosave();var y=mxUtils.bind(this,function(){try{this.updateFileData(),null!=k&&k()}catch(A){if(null!=+m)m(A);else throw A;}});d?y():this.loadFonts(y)}else if(null!=m)m({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(A){if(null!=m)m(A);else throw A;}};+DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var k=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=k&&(k.viewState=this.ui.editor.graph.getViewState(),k.needsUpdate=!0)}k=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return k};DrawioFile.prototype.updateFileData=function(){null!=this.sync&&this.sync.sendLocalChanges();this.setData(this.createData());null!=this.sync&&this.sync.fileDataUpdated()};DrawioFile.prototype.isCompressedStorage=function(){return Editor.defaultCompressed};DrawioFile.prototype.isCompressed=function(){var b=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("compressed"):null;return null!=b?"false"!=b:this.isCompressedStorage()&&Editor.compressXml};DrawioFile.prototype.setLocked=function(b){this.ui.fileNode.setAttribute("locked",b?"true":"false");this.ui.fireEvent(new mxEventObject("lockedChanged"));this.fileChanged();b&&this.ui.editor.graph.clearSelection()};DrawioFile.prototype.isLocked=function(){var b=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("locked"):null;return null!=b?"true"==b:!1};DrawioFile.prototype.saveAs=function(b,k,m){};DrawioFile.prototype.saveFile=function(b,k,m,d){};DrawioFile.prototype.getFileUrl=function(){return null};DrawioFile.prototype.getFolderUrl=function(b){return null};DrawioFile.prototype.getPublicUrl=function(b){b(null)};DrawioFile.prototype.isRestricted=function(){return DrawioFile.RESTRICT_EXPORT};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.getShadowModified=function(){return this.shadowModified};DrawioFile.prototype.setShadowModified=function(b){this.shadowModified=b};DrawioFile.prototype.setModified=function(b){this.shadowModified=this.modified=b};@@ -12717,7 +12720,7 @@ DrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=newthis.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(k){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=this.lastChanged)}),mxUtils.bind(this,function(k){this.handleFileError(k)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus());null!=this.sync&&b&&this.sync.localFileChanged()};DrawioFile.prototype.createSecret=function(b){var k=Editor.guid(32);Editor.enableRealtimeCache&&null!=this.sync&&!this.isOptimisticSync()?this.sync.createToken(k,mxUtils.bind(this,function(m){EditorUi.debug("DrawioFile.createSecret",[this],"secret",k,"token",m);b(k,m)}),mxUtils.bind(this,function(){b(k)})):b(k)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};DrawioFile.prototype.fileSaved=function(b,k,m,d,q,u,y){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;u=null!=u?u:this.ui.getPagesForXml(b,!0);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(u),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=m&&m()):this.sync.fileSaved(u,k,m,d,q,y)}catch(K){this.invalidChecksum=-this.inConflictState=!0;this.descriptorChanged();null!=d&&d(K);try{var A=this.getCurrentUser(),J=null!=A?A.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),J,K)}catch(H){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[k],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(K){this.descriptorChanged(),null!=d&&d(K)}};+this.inConflictState=!0;this.descriptorChanged();null!=d&&d(K);try{var A=this.getCurrentUser(),J=null!=A?A.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),J,K)}catch(F){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[k],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(K){this.descriptorChanged(),null!=d&&d(K)}};DrawioFile.prototype.autosave=function(b,k,m,d){null==this.lastAutosave&&(this.lastAutosave=Date.now());var q=Date.now()-this.lastAutosave<k?b:0;this.clearAutosave();var u=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==u&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",u,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var y=this.isAutosaveRevision();y&&(this.lastAutosaveRevision=(new Date).getTime());this.save(y,mxUtils.bind(this,function(A){this.autosaveCompleted();null!=m&&m(A)}),mxUtils.bind(this,function(A){null!=d&&d(A)}))}else this.isModified()||this.ui.clearStatus(),null!=m&&m(null)}catch(A){null!=d&&d(A)}}),q);this.autosaveThread=u;EditorUi.debug("DrawioFile.autosave",[this],"thread",u,"delay",b,"maxDelay",k,"actualDelay",q,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var b=(new Date).getTime();return null==this.lastAutosaveRevision||b-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};@@ -12726,11 +12729,11 @@ DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(thisDrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,k){b([])};DrawioFile.prototype.addComment=function(b,k,m){k(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,k){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,k)};LocalFile=function(b,k,m,d,q,u,y){DrawioFile.call(this,b,k);this.title=m;this.mode=d?null:App.MODE_DEVICE;this.fileHandle=q;this.desc=u;this.editable=y};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&(null==this.editable||this.editable)};LocalFile.prototype.setEditable=function(b){this.editable=b;this.descriptorChanged()};LocalFile.prototype.save=function(b,k,m,d,q){this.saveAs(this.title,k,m,d,q)};LocalFile.prototype.saveAs=function(b,k,m,d,q){this.saveFile(b,!1,k,m,null,d,q)};LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b};LocalFile.prototype.getLatestVersion=function(b,k){null==this.fileHandle?null!=k&&k({message:mxResources.get("cannotOpenFile")}):this.ui.loadFileSystemEntry(this.fileHandle,b,k)};-LocalFile.prototype.saveFile=function(b,k,m,d,q,u,y){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;q||this.updateFileData();var A=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var J=this.getData(),K=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=m&&m()}),H=mxUtils.bind(this,function(G){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=-!0;var c=mxUtils.bind(this,function(l){this.savingFile=!1;null!=d&&d({error:l})});this.saveDraft(J);this.fileHandle.createWritable().then(mxUtils.bind(this,function(l){this.fileHandle.getFile().then(mxUtils.bind(this,function(n){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[n],"conflict",this.desc.lastModified!=n.lastModified);y||this.desc.lastModified==n.lastModified?l.write(A?this.ui.base64ToBlob(G,"image/png"):G).then(mxUtils.bind(this,function(){l.close().then(mxUtils.bind(this,-function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(r){try{var t=this.desc;this.savingFile=!1;this.desc=r;this.fileSaved(J,t,K,c);this.removeDraft()}catch(x){c(x)}}),c)}),c)}),c):(this.inConflictState=!0,c())}),mxUtils.bind(this,function(n){this.invalidFileHandle=!0;c(n)}))}),c)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(G,b,A?"image/png":"text/xml",A);else if(G.length<MAX_REQUEST_SIZE){var f=b.lastIndexOf(".");f=0<f?b.substring(f+1):"xml";-(new mxXmlRequest(SAVE_URL,"format="+f+"&xml="+encodeURIComponent(G)+"&filename="+encodeURIComponent(b)+(A?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(G)}));K()}});A?(k=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(G){H(G)}),d,this.ui.getCurrentFile()!=this?J:null,k.scale,k.border)):H(J)};-LocalFile.prototype.rename=function(b,k,m){this.title=b;this.descriptorChanged();null!=k&&k()};LocalLibrary=function(b,k,m){LocalFile.call(this,b,k,m)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(b,k,m){this.saveFile(b,!1,k,m)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(b,k,m){DrawioFile.call(this,b,k);this.title=m;this.etag=this.getEtag(k)};mxUtils.extend(StorageFile,DrawioFile);StorageFile.prototype.getEtag=function(b){return this.ui.hashValue(null!=b?b:"")};StorageFile.prototype.autosaveDelay=500;StorageFile.prototype.maxAutosaveDelay=2E4;StorageFile.prototype.maxRetries=5;StorageFile.prototype.type="F";StorageFile.prototype.getMode=function(){return App.MODE_BROWSER};StorageFile.prototype.isSyncSupported=function(){return!0};+LocalFile.prototype.saveFile=function(b,k,m,d,q,u,y){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;if(q||u){q||this.updateFileData();var A=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var J=this.getData(),K=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=m&&m()}),F=mxUtils.bind(this,function(H){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=+!0;var c=mxUtils.bind(this,function(l){this.savingFile=!1;null!=d&&d({error:l})});this.saveDraft(J);this.fileHandle.createWritable().then(mxUtils.bind(this,function(l){this.fileHandle.getFile().then(mxUtils.bind(this,function(n){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[n],"conflict",this.desc.lastModified!=n.lastModified);y||this.desc.lastModified==n.lastModified?l.write(A?this.ui.base64ToBlob(H,"image/png"):H).then(mxUtils.bind(this,function(){l.close().then(mxUtils.bind(this,+function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(r){try{var t=this.desc;this.savingFile=!1;this.desc=r;this.fileSaved(J,t,K,c);this.removeDraft()}catch(x){c(x)}}),c)}),c)}),c):(this.inConflictState=!0,c())}),mxUtils.bind(this,function(n){this.invalidFileHandle=!0;c(n)}))}),c)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(H,b,A?"image/png":"text/xml",A);else if(H.length<MAX_REQUEST_SIZE){var f=b.lastIndexOf(".");f=0<f?b.substring(f+1):"xml";+(new mxXmlRequest(SAVE_URL,"format="+f+"&xml="+encodeURIComponent(H)+"&filename="+encodeURIComponent(b)+(A?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(H)}));K()}});A?(q=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(H){F(H)}),d,this.ui.getCurrentFile()!=this?J:null,q.scale,q.border)):F(J)}else this.loadFonts(mxUtils.bind(this,+function(){this.updateFileData();this.saveFile(b,k,m,d,!0,u,y)}))};LocalFile.prototype.rename=function(b,k,m){this.title=b;this.descriptorChanged();null!=k&&k()};LocalLibrary=function(b,k,m){LocalFile.call(this,b,k,m)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(b,k,m){this.saveFile(b,!1,k,m)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(b,k,m){DrawioFile.call(this,b,k);this.title=m;this.etag=this.getEtag(k)};mxUtils.extend(StorageFile,DrawioFile);StorageFile.prototype.getEtag=function(b){return this.ui.hashValue(null!=b?b:"")};StorageFile.prototype.autosaveDelay=500;StorageFile.prototype.maxAutosaveDelay=2E4;StorageFile.prototype.maxRetries=5;StorageFile.prototype.type="F";StorageFile.prototype.getMode=function(){return App.MODE_BROWSER};StorageFile.prototype.isSyncSupported=function(){return!0};StorageFile.prototype.isPolling=function(){return this.isSyncSupported()};StorageFile.prototype.getPollingInterval=function(){return 1E4};StorageFile.prototype.loadDescriptor=function(b,k){this.getLatestVersionId(b,k)};StorageFile.prototype.getLatestVersionId=function(b,k){StorageFile.getFileContent(this.ui,this.title,mxUtils.bind(this,function(m){b(this.getEtag(m))}),k)};StorageFile.prototype.isAutosaveOptional=function(){return!0};StorageFile.prototype.getHash=function(){return"L"+encodeURIComponent(this.getTitle())};StorageFile.prototype.getTitle=function(){return this.title};StorageFile.prototype.isRenamable=function(){return!0};StorageFile.prototype.getDescriptor=function(){return this.etag};StorageFile.prototype.setDescriptor=function(b){this.etag=b};StorageFile.prototype.getDescriptorEtag=function(b){return b};StorageFile.prototype.save=function(b,k,m){DrawioFile.prototype.save.apply(this,[!1,mxUtils.bind(this,function(){this.saveFile(this.getTitle(),!1,k,m)}),m])};StorageFile.prototype.saveAs=function(b,k,m){this.rename(b,k,m)};StorageFile.insertFile=function(b,k,m,d,q,u){StorageFile.doInsertFile(null!=u?u:new StorageFile(b,m,k),d,q)};StorageFile.doInsertFile=function(b,k,m){var d=b.getTitle(),q=b.getUi(),u=mxUtils.bind(this,function(y){var A=function(){b.writeFile(d,function(){k(b)},m)};y?q.confirm(mxResources.get("replaceIt",[d]),A,m):A()});StorageFile.getFileContent(q,d,function(y){u(null!=y)},function(){u(!1)})};@@ -12747,72 +12750,72 @@ StorageFile.listFiles=function(b,k,m,d){b.getDatabaseItems(function(q){var u=[];StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title};StorageLibrary.prototype.isRenamable=function(b,k,m){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};RemoteFile=function(b,k,m){DrawioFile.call(this,b,k);this.title=m;this.mode=null};mxUtils.extend(RemoteFile,DrawioFile);RemoteFile.prototype.isAutosave=function(){return!1};RemoteFile.prototype.getMode=function(){return this.mode};RemoteFile.prototype.getTitle=function(){return this.title};RemoteFile.prototype.isRenamable=function(){return!1};RemoteFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};RemoteLibrary=function(b,k,m){RemoteFile.call(this,b,k,m.title);this.libObj=m};mxUtils.extend(RemoteLibrary,LocalFile);RemoteLibrary.prototype.getHash=function(){return"R"+encodeURIComponent(JSON.stringify([this.libObj.id,this.libObj.title,this.libObj.downloadUrl]))};RemoteLibrary.prototype.isEditable=function(){return!1};RemoteLibrary.prototype.isRenamable=function(){return!1};RemoteLibrary.prototype.isAutosave=function(){return!1};RemoteLibrary.prototype.save=function(b,k,m){};RemoteLibrary.prototype.saveAs=function(b,k,m){};RemoteLibrary.prototype.updateFileData=function(){};RemoteLibrary.prototype.open=function(){};UrlLibrary=function(b,k,m){StorageFile.call(this,b,k,m);b=m;k=b.lastIndexOf("/");0<=k&&(b=b.substring(k+1));this.fname=b};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(b,k,m){return!1};UrlLibrary.prototype.saveAs=function(b,k,m){};UrlLibrary.prototype.open=function(){};EmbedFile=function(b,k,m){DrawioFile.call(this,b,k);this.desc=m||{};this.mode=App.MODE_EMBED};mxUtils.extend(EmbedFile,DrawioFile);EmbedFile.prototype.getMode=function(){return this.mode};EmbedFile.prototype.getDescriptor=function(){return this.desc};EmbedFile.prototype.setDescriptor=function(b){this.desc=b||{}};EmbedFile.prototype.getTitle=function(){return this.desc.title||""};/*mxClient.IS_IOS || */-var StorageDialog=function(b,k,m){function d(G,c,f,l,n,r){function t(){mxEvent.addListener(x,"click",null!=r?r:function(){f==App.MODE_GOOGLE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(f,!0);k()})):f==App.MODE_ONEDRIVE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.oneDrive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(f,!0);k()}),function(T){b.spinner.stop();b.handleError(T)}):+var StorageDialog=function(b,k,m){function d(H,c,f,l,n,r){function t(){mxEvent.addListener(x,"click",null!=r?r:function(){f==App.MODE_GOOGLE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(f,!0);k()})):f==App.MODE_ONEDRIVE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.oneDrive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(f,!0);k()}),function(T){b.spinner.stop();b.handleError(T)}):(b.setMode(f,!0),k())})}A++;++y>m&&(mxUtils.br(J),y=1);var x=document.createElement("a");x.style.overflow="hidden";x.style.display="inline-block";x.className="geBaseButton";x.style.boxSizing="border-box";x.style.fontSize="11px";x.style.position="relative";x.style.margin="4px";x.style.marginTop="8px";x.style.marginBottom="0px";x.style.padding="8px 10px 8px 10px";x.style.width="88px";x.style.height="100px";x.style.whiteSpace="nowrap";x.setAttribute("title",c);var B=document.createElement("div");B.style.textOverflow=-"ellipsis";B.style.overflow="hidden";B.style.position="absolute";B.style.bottom="8px";B.style.left="0px";B.style.right="0px";mxUtils.write(B,c);x.appendChild(B);if(null!=G){var F=document.createElement("img");F.setAttribute("src",G);F.setAttribute("border","0");F.setAttribute("align","absmiddle");F.style.width="60px";F.style.height="60px";F.style.paddingBottom="6px";x.appendChild(F)}else B.style.paddingTop="5px",B.style.whiteSpace="normal",mxClient.IS_IOS?(x.style.padding="0px 10px 20px 10px",x.style.top=-"6px"):mxClient.IS_FF&&(B.style.paddingTop="0px",B.style.marginTop="-2px");if(null!=n)for(G=0;G<n.length;G++)mxUtils.br(B),mxUtils.write(B,n[G]);if(null!=l&&null==b[l]){F.style.visibility="hidden";mxUtils.setOpacity(B,10);var L=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});L.spin(x);var D=window.setTimeout(function(){null==b[l]&&(L.stop(),x.style.display="none")},3E4);b.addListener("clientLoaded",-mxUtils.bind(this,function(T,N){null!=b[l]&&N.getProperty("client")==b[l]&&(window.clearTimeout(D),mxUtils.setOpacity(B,100),F.style.visibility="",L.stop(),t(),"drive"==l&&null!=K.parentNode&&K.parentNode.removeChild(K))}))}else t();J.appendChild(x)}m=null!=m?m:2;var q=document.createElement("div");q.style.textAlign="center";q.style.whiteSpace="nowrap";q.style.paddingTop="0px";q.style.paddingBottom="20px";var u=document.createElement("div");u.style.border="1px solid #d3d3d3";u.style.borderWidth="1px 0px 1px 0px";-u.style.padding="10px 0px 20px 0px";var y=0,A=0,J=document.createElement("div");J.style.paddingTop="2px";u.appendChild(J);var K=document.createElement("p"),H=document.createElement("p");H.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";mxUtils.write(H,mxResources.get("saveDiagramsTo")+":");q.appendChild(H);q.appendChild(u);y=0;"function"===typeof window.DriveClient&&d(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");null!=b.m365&&+"ellipsis";B.style.overflow="hidden";B.style.position="absolute";B.style.bottom="8px";B.style.left="0px";B.style.right="0px";mxUtils.write(B,c);x.appendChild(B);if(null!=H){var G=document.createElement("img");G.setAttribute("src",H);G.setAttribute("border","0");G.setAttribute("align","absmiddle");G.style.width="60px";G.style.height="60px";G.style.paddingBottom="6px";x.appendChild(G)}else B.style.paddingTop="5px",B.style.whiteSpace="normal",mxClient.IS_IOS?(x.style.padding="0px 10px 20px 10px",x.style.top=+"6px"):mxClient.IS_FF&&(B.style.paddingTop="0px",B.style.marginTop="-2px");if(null!=n)for(H=0;H<n.length;H++)mxUtils.br(B),mxUtils.write(B,n[H]);if(null!=l&&null==b[l]){G.style.visibility="hidden";mxUtils.setOpacity(B,10);var L=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});L.spin(x);var D=window.setTimeout(function(){null==b[l]&&(L.stop(),x.style.display="none")},3E4);b.addListener("clientLoaded",+mxUtils.bind(this,function(T,N){null!=b[l]&&N.getProperty("client")==b[l]&&(window.clearTimeout(D),mxUtils.setOpacity(B,100),G.style.visibility="",L.stop(),t(),"drive"==l&&null!=K.parentNode&&K.parentNode.removeChild(K))}))}else t();J.appendChild(x)}m=null!=m?m:2;var q=document.createElement("div");q.style.textAlign="center";q.style.whiteSpace="nowrap";q.style.paddingTop="0px";q.style.paddingBottom="20px";var u=document.createElement("div");u.style.border="1px solid #d3d3d3";u.style.borderWidth="1px 0px 1px 0px";+u.style.padding="10px 0px 20px 0px";var y=0,A=0,J=document.createElement("div");J.style.paddingTop="2px";u.appendChild(J);var K=document.createElement("p"),F=document.createElement("p");F.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";mxUtils.write(F,mxResources.get("saveDiagramsTo")+":");q.appendChild(F);q.appendChild(u);y=0;"function"===typeof window.DriveClient&&d(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");null!=b.m365&&d(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("m365"),App.MODE_M365,"m365");"1"!=urlParams.noDevice&&d(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||d(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);"function"===typeof window.OneDriveClient&&d(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");null!=b.gitHub&&d(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub");null!=b.gitLab&&d(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab");u=document.createElement("span");u.style.position="absolute";u.style.cursor="pointer";u.style.bottom="27px";u.style.color="gray";u.style.userSelect="none";u.style.textAlign="center";u.style.left="50%";mxUtils.setPrefixedStyle(u.style,"transform","translate(-50%,0)");mxUtils.write(u,mxResources.get("decideLater"));q.appendChild(u);mxEvent.addListener(u,-"click",function(){b.hideDialog();var G=Editor.useLocalStorage;b.createFile(b.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=G});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==b.drive&&(K.style.padding="7px",K.style.fontSize="9pt",K.style.marginTop="-14px",K.innerHTML='<a style="background-color:#dcdcdc;padding:6px;color:black;text-decoration:none;" href="https://www.drawio.com/doc/faq/google-drive-connection-problems" target="_blank"><img border="0" src="'++"click",function(){b.hideDialog();var H=Editor.useLocalStorage;b.createFile(b.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=H});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==b.drive&&(K.style.padding="7px",K.style.fontSize="9pt",K.style.marginTop="-14px",K.innerHTML='<a style="background-color:#dcdcdc;padding:6px;color:black;text-decoration:none;" href="https://www.drawio.com/doc/faq/google-drive-connection-problems" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="absmiddle" style="margin-top:-4px"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",q.appendChild(K))},5E3);this.container=q},SplashDialog=function(b){var k=document.createElement("div");k.style.textAlign="center";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var m=b.addLanguageMenu(k,!1,"28px");null!=m&&(m.style.bottom="24px")}var d=document.createElement("img");d.setAttribute("border","0");d.setAttribute("align","absmiddle");d.style.width="32px";d.style.height="32px";d.style.marginRight="8px";d.style.marginTop="-4px";var q=document.createElement("div");q.style.margin="8px 0px 0px 0px";q.style.padding="18px 0px 24px 0px";m="";b.mode==App.MODE_GOOGLE?(d.src=IMAGE_PATH+"/google-drive-logo.svg",m=mxResources.get("googleDrive")):b.mode==App.MODE_DROPBOX?(d.src=IMAGE_PATH+"/dropbox-logo.svg",m=mxResources.get("dropbox")):b.mode==App.MODE_ONEDRIVE?(d.src=IMAGE_PATH+"/onedrive-logo.svg",m=mxResources.get("oneDrive")):b.mode==App.MODE_M365?(d.src=IMAGE_PATH+"/onedrive-logo.svg",m=mxResources.get("m365")):b.mode==App.MODE_GITHUB?(d.src=IMAGE_PATH+"/github-logo.svg",m=mxResources.get("github")):b.mode==App.MODE_GITLAB?(d.src=IMAGE_PATH+"/gitlab-logo.svg",m=mxResources.get("gitlab")):b.mode==App.MODE_BROWSER?(d.src=IMAGE_PATH+"/osa_database.png",m=mxResources.get("browser")):b.mode==App.MODE_TRELLO?(d.src=IMAGE_PATH+"/trello-logo.svg",m=mxResources.get("trello")):(d.src=IMAGE_PATH+"/osa_drive-harddisk.png",q.style.paddingBottom="10px",q.style.paddingTop="30px",m=mxResources.get("device"));var u=document.createElement("button");u.className="geBigButton";u.style.marginBottom="8px";u.style.fontSize="18px";u.style.padding="10px";u.style.width="340px";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)q.style.padding="42px 0px 10px 0px",u.style.marginBottom="12px";else{q.style.border="1px solid #d3d3d3";q.style.borderWidth="1px 0px 1px 0px";var y=document.createElement("table"),A=document.createElement("tbody"),J=document.createElement("tr"),-K=document.createElement("td"),H=document.createElement("td");y.setAttribute("align","center");K.appendChild(d);d=document.createElement("div");d.style.fontSize="22px";d.style.paddingBottom="6px";d.style.color="gray";mxUtils.write(d,m);H.style.textAlign="left";H.appendChild(d);J.appendChild(K);J.appendChild(H);A.appendChild(J);y.appendChild(A);k.appendChild(y);m=document.createElement("span");m.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";+K=document.createElement("td"),F=document.createElement("td");y.setAttribute("align","center");K.appendChild(d);d=document.createElement("div");d.style.fontSize="22px";d.style.paddingBottom="6px";d.style.color="gray";mxUtils.write(d,m);F.style.textAlign="left";F.appendChild(d);J.appendChild(K);J.appendChild(F);A.appendChild(J);y.appendChild(A);k.appendChild(y);m=document.createElement("span");m.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";mxUtils.setPrefixedStyle(m.style,"transform","translate(-50%,0)");mxUtils.write(m,mxResources.get("changeStorage"));mxEvent.addListener(m,"click",function(){b.hideDialog(!1);b.setMode(null);b.clearMode();b.showSplash(!0)});k.appendChild(m)}mxUtils.write(u,mxResources.get("createNewDiagram"));mxEvent.addListener(u,"click",function(){b.hideDialog();b.actions.get("new").funct()});q.appendChild(u);mxUtils.br(q);u=document.createElement("button");u.className="geBigButton";u.style.marginBottom="22px";u.style.fontSize="18px";u.style.padding="10px";u.style.width="340px";mxUtils.write(u,mxResources.get("openExistingDiagram"));mxEvent.addListener(u,"click",function(){b.actions.get("open").funct()});q.appendChild(u);b.mode==App.MODE_GOOGLE?mxResources.get("googleDrive"):b.mode==App.MODE_DROPBOX?mxResources.get("dropbox"):b.mode==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):b.mode==App.MODE_GITHUB?mxResources.get("github"):b.mode==App.MODE_GITLAB?mxResources.get("gitlab"):b.mode==App.MODE_TRELLO?mxResources.get("trello"):b.mode==App.MODE_DEVICE?mxResources.get("device"):b.mode==App.MODE_BROWSER&&mxResources.get("browser");if(!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp)if(m=function(f){u.style.marginBottom="24px";var l=document.createElement("a");l.style.display="inline-block";l.style.color="gray";l.style.cursor="pointer";l.style.marginTop="6px";mxUtils.write(l,mxResources.get("signOut"));u.style.marginBottom="16px";q.style.paddingBottom="18px";mxEvent.addListener(l,"click",function(){b.confirm(mxResources.get("areYouSure"),-function(){f()})});q.appendChild(l)},b.mode==App.MODE_GOOGLE&&null!=b.drive){var G=b.drive.getUsersList();if(0<G.length){d=document.createElement("span");d.style.marginTop="6px";mxUtils.write(d,mxResources.get("changeUser")+":");u.style.marginBottom="16px";q.style.paddingBottom="18px";q.appendChild(d);var c=document.createElement("select");c.style.marginLeft="4px";c.style.width="140px";for(m=0;m<G.length;m++)y=document.createElement("option"),mxUtils.write(y,G[m].displayName),y.value=m,c.appendChild(y),-y=document.createElement("option"),y.innerHTML=" ",mxUtils.write(y,"<"+G[m].email+">"),y.setAttribute("disabled","disabled"),c.appendChild(y);y=document.createElement("option");mxUtils.write(y,mxResources.get("addAccount"));y.value=G.length;c.appendChild(y);mxEvent.addListener(c,"change",function(){var f=c.value,l=G.length!=f;l&&b.drive.setUser(G[f]);b.drive.authorize(l,function(){b.setMode(App.MODE_GOOGLE);b.hideDialog();b.showSplash()},function(n){b.handleError(n,null,function(){b.hideDialog();+function(){f()})});q.appendChild(l)},b.mode==App.MODE_GOOGLE&&null!=b.drive){var H=b.drive.getUsersList();if(0<H.length){d=document.createElement("span");d.style.marginTop="6px";mxUtils.write(d,mxResources.get("changeUser")+":");u.style.marginBottom="16px";q.style.paddingBottom="18px";q.appendChild(d);var c=document.createElement("select");c.style.marginLeft="4px";c.style.width="140px";for(m=0;m<H.length;m++)y=document.createElement("option"),mxUtils.write(y,H[m].displayName),y.value=m,c.appendChild(y),+y=document.createElement("option"),y.innerHTML=" ",mxUtils.write(y,"<"+H[m].email+">"),y.setAttribute("disabled","disabled"),c.appendChild(y);y=document.createElement("option");mxUtils.write(y,mxResources.get("addAccount"));y.value=H.length;c.appendChild(y);mxEvent.addListener(c,"change",function(){var f=c.value,l=H.length!=f;l&&b.drive.setUser(H[f]);b.drive.authorize(l,function(){b.setMode(App.MODE_GOOGLE);b.hideDialog();b.showSplash()},function(n){b.handleError(n,null,function(){b.hideDialog();b.showSplash()})},!0)});q.appendChild(c)}else m(function(){b.drive.logout()})}else b.mode!=App.MODE_ONEDRIVE||null==b.oneDrive||b.oneDrive.noLogout?b.mode==App.MODE_GITHUB&&null!=b.gitHub?m(function(){b.gitHub.logout();b.openLink("https://www.github.com/logout")}):b.mode==App.MODE_GITLAB&&null!=b.gitLab?m(function(){b.gitLab.logout();var f=document.createElement("form");f.setAttribute("method","post");f.setAttribute("action",DRAWIO_GITLAB_URL+"/users/sign_out");f.setAttribute("target","_blank");document.body.appendChild(f);-f.submit();f.parentNode.removeChild(f)}):b.mode==App.MODE_TRELLO&&null!=b.trello?b.trello.isAuthorized()&&m(function(){b.trello.logout()}):b.mode==App.MODE_DROPBOX&&null!=b.dropbox&&m(function(){b.dropbox.logout();b.openLink("https://www.dropbox.com/logout")}):m(function(){b.oneDrive.logout()});k.appendChild(q);this.container=k},EmbedDialog=function(b,k,m,d,q,u,y,A,J,K){d=document.createElement("div");d.style.height="100%";d.style.display="flex";d.style.flexDirection="column";var H=EmbedDialog.maxSize,-G=/^https?:\/\//.test(k)||/^mailto:\/\//.test(k);y=document.createElement("div");y.style.flexShrink="0";y.style.position="relative";null!=u?mxUtils.write(y,u):mxUtils.write(y,mxResources.get(k.length<H?G?"link":"mainEmbedNotice":"preview")+":");u=document.createElement("span");u.style.cssFloat="right";u.style.color="gray";mxUtils.write(u,b.formatFileSize(k.length));y.appendChild(u);d.appendChild(y);var c=document.createElement("textarea");c.setAttribute("autocomplete","off");c.setAttribute("autocorrect",-"off");c.setAttribute("autocapitalize","off");c.setAttribute("spellcheck","false");c.style.fontFamily="monospace";c.style.wordBreak="break-all";c.style.marginTop="10px";c.style.resize="none";c.style.flex="1";c.style.width="100%";c.style.boxSizing="border-box";c.value=mxResources.get("updatingDocument");d.appendChild(c);this.init=function(){window.setTimeout(function(){k.length<H?(c.value=k,c.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?c.select():document.execCommand("selectAll",-!1,null)):(c.setAttribute("readonly","true"),c.value=mxResources.get("tooLargeUseDownload"))},0)};u=document.createElement("div");u.style.flexShrink="0";u.style.textAlign="right";u.style.paddingTop="14px";u.style.whiteSpace="nowrap";y=null;EmbedDialog.showPreviewOption&&!mxIsElectron&&!navigator.standalone&&G&&(y=mxUtils.button(null!=A?A:mxResources.get(k.length<H?"preview":"openInNewWindow"),function(){var f=k.length<H?c.value:k;if(null!=q)q(f);else if(G)try{var l=b.openLink(f);null!=l&&(null==m||+f.submit();f.parentNode.removeChild(f)}):b.mode==App.MODE_TRELLO&&null!=b.trello?b.trello.isAuthorized()&&m(function(){b.trello.logout()}):b.mode==App.MODE_DROPBOX&&null!=b.dropbox&&m(function(){b.dropbox.logout();b.openLink("https://www.dropbox.com/logout")}):m(function(){b.oneDrive.logout()});k.appendChild(q);this.container=k},EmbedDialog=function(b,k,m,d,q,u,y,A,J,K){d=document.createElement("div");d.style.height="100%";d.style.display="flex";d.style.flexDirection="column";var F=EmbedDialog.maxSize,+H=/^https?:\/\//.test(k)||/^mailto:\/\//.test(k);y=document.createElement("div");y.style.flexShrink="0";y.style.position="relative";null!=u?mxUtils.write(y,u):mxUtils.write(y,mxResources.get(k.length<F?H?"link":"mainEmbedNotice":"preview")+":");u=document.createElement("span");u.style.cssFloat="right";u.style.color="gray";mxUtils.write(u,b.formatFileSize(k.length));y.appendChild(u);d.appendChild(y);var c=document.createElement("textarea");c.setAttribute("autocomplete","off");c.setAttribute("autocorrect",+"off");c.setAttribute("autocapitalize","off");c.setAttribute("spellcheck","false");c.style.fontFamily="monospace";c.style.wordBreak="break-all";c.style.marginTop="10px";c.style.resize="none";c.style.flex="1";c.style.width="100%";c.style.boxSizing="border-box";c.value=mxResources.get("updatingDocument");d.appendChild(c);this.init=function(){window.setTimeout(function(){k.length<F?(c.value=k,c.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?c.select():document.execCommand("selectAll",+!1,null)):(c.setAttribute("readonly","true"),c.value=mxResources.get("tooLargeUseDownload"))},0)};u=document.createElement("div");u.style.flexShrink="0";u.style.textAlign="right";u.style.paddingTop="14px";u.style.whiteSpace="nowrap";y=null;EmbedDialog.showPreviewOption&&!mxIsElectron&&!navigator.standalone&&H&&(y=mxUtils.button(null!=A?A:mxResources.get(k.length<F?"preview":"openInNewWindow"),function(){var f=k.length<F?c.value:k;if(null!=q)q(f);else if(H)try{var l=b.openLink(f);null!=l&&(null==m||0<m)&&window.setTimeout(mxUtils.bind(this,function(){try{null!=l&&null!=l.location.href&&l.location.href.substring(0,8)!=f.substring(0,8)&&(l.close(),b.handleError({message:mxResources.get("drawingTooLarge")}))}catch(r){}}),m||500)}catch(r){b.handleError({message:r.message||mxResources.get("drawingTooLarge")})}else{var n=window.open();n=null!=n?n.document:null;null!=n?(n.writeln("<html><head><title>"+mxUtils.htmlEntities(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+("<iframe"==-k.substring(0,7)?k:mxUtils.htmlEntities(k))+"</body></html>"),n.close()):b.handleError({message:mxResources.get("errorUpdatingPreview")})}}),y.className="geBtn",u.appendChild(y));K||(A=mxUtils.button(mxResources.get("export"),function(){b.hideDialog();b.saveData(null!=J?J:"embed.txt","txt",k,"text/plain")}),A.className="geBtn",u.appendChild(A));!b.isOffline()&&k.length<H&&(A=mxUtils.button("",function(){try{var f="mailto:?subject="+encodeURIComponent(J||b.defaultFilename)+"&body="+encodeURIComponent(c.value);+k.substring(0,7)?k:mxUtils.htmlEntities(k))+"</body></html>"),n.close()):b.handleError({message:mxResources.get("errorUpdatingPreview")})}}),y.className="geBtn",u.appendChild(y));K||(A=mxUtils.button(mxResources.get("export"),function(){b.hideDialog();b.saveData(null!=J?J:"embed.txt","txt",k,"text/plain")}),A.className="geBtn",u.appendChild(A));!b.isOffline()&&k.length<F&&(A=mxUtils.button("",function(){try{var f="mailto:?subject="+encodeURIComponent(J||b.defaultFilename)+"&body="+encodeURIComponent(c.value);b.openLink(f)}catch(l){b.handleError({message:l.message||mxResources.get("drawingTooLarge")})}}),K=document.createElement("img"),K.className="geAdaptiveAsset",K.setAttribute("src",Editor.mailImage),K.setAttribute("width","18"),K.setAttribute("height","18"),K.setAttribute("border","0"),K.style.marginBottom="5px",A.appendChild(K),A.style.verticalAlign="bottom",A.style.paddingTop="4px",A.style.minWidth="46px",A.className="geBtn",u.appendChild(A));A=mxUtils.button(mxResources.get("close"),function(){b.hideDialog()});-A.className="geBtn";u.appendChild(A);K=mxUtils.button(mxResources.get("copy"),function(){c.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?c.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");b.alert(mxResources.get("copiedToClipboard"))});k.length<H?mxClient.IS_SF||null!=document.documentMode?A.className="geBtn gePrimaryBtn":(u.appendChild(K),K.className="geBtn gePrimaryBtn"):null!=y&&(u.appendChild(y),y.className="geBtn gePrimaryBtn");d.appendChild(u);+A.className="geBtn";u.appendChild(A);K=mxUtils.button(mxResources.get("copy"),function(){c.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?c.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");b.alert(mxResources.get("copiedToClipboard"))});k.length<F?mxClient.IS_SF||null!=document.documentMode?A.className="geBtn gePrimaryBtn":(u.appendChild(K),K.className="geBtn gePrimaryBtn"):null!=y&&(u.appendChild(y),y.className="geBtn gePrimaryBtn");d.appendChild(u);this.container=d};EmbedDialog.showPreviewOption=!0;EmbedDialog.maxSize=5E5;var BackgroundImageDialog=function(b,k,m,d,q){function u(){if(null==P||P==mxConstants.NONE)R.style.display="none",N.checked=!1;else{var S=mxUtils.getLightDarkColor(P);mxUtils.isLightDarkColor(P)&&S.light!=S.dark?R.style.background="linear-gradient(to right bottom, "+S.cssText+" 50%, "+mxUtils.invertLightDarkColor(S).cssText+" 50.3%)":(R.style.background="",R.style.backgroundColor=S.cssText);R.style.display="";N.checked=!0}}var y=document.createElement("div"),A=document.createElement("h3");mxUtils.write(A,-mxResources.get("background"));y.appendChild(A);var J=null!=m&&null!=m.originalSrc;A=!1;var K=document.createElement("input");K.setAttribute("value","url");K.setAttribute("type","radio");K.setAttribute("name","geBackgroundImageDialogOption");var H=document.createElement("input");H.setAttribute("value","url");H.setAttribute("type","radio");H.setAttribute("name","geBackgroundImageDialogOption");var G=document.createElement("input");G.setAttribute("type","text");G.style.flex="1";G.style.minWidth="0";-G.value=J||null==m?"":m.src;var c=document.createElement("select");c.style.flex="1";c.style.minWidth="0";c.style.marginLeft="0";if(null!=b.pages)for(var f=0;f<b.pages.length;f++){var l=document.createElement("option");mxUtils.write(l,b.pages[f].getName()||mxResources.get("pageWithNumber",[f+1]));l.setAttribute("value","data:page/id,"+b.pages[f].getId());b.pages[f]==b.currentPage&&l.setAttribute("disabled","disabled");null!=m&&m.originalSrc==l.getAttribute("value")&&(l.setAttribute("selected","selected"),-A=!0);c.appendChild(l)}J||null!=b.pages&&1!=b.pages.length||(K.style.display="none",H.style.display="none",c.style.display="none");var n=document.createElement("option"),r=!1,t=!1,x=function(S,z){r||null!=S&&t||(H.checked?null!=z&&z(n.selected?null:c.value):""==G.value||b.isOffline()?(D.value="",T.value="",null!=z&&z("")):(G.value=mxUtils.trim(G.value),b.loadImage(G.value,function(g){D.value=g.width;T.value=g.height;null!=z&&z(G.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),-mxResources.get("ok"));D.value="";T.value="";null!=z&&z(null)})))},B=mxUtils.bind(this,function(S){b.importFiles(S,0,0,b.maxBackgroundSize,function(z,g,p,v,C,E){G.value=z;x();G.focus()},function(){},function(z){return"image/"==z.type.substring(0,6)},function(z){for(var g=0;g<z.length;g++)z[g]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){J?c.focus():G.focus();mxEvent.addListener(c,"focus",function(){K.removeAttribute("checked");H.setAttribute("checked","checked");H.checked=-!0});mxEvent.addListener(G,"focus",function(){H.removeAttribute("checked");K.setAttribute("checked","checked");K.checked=!0});if(Graph.fileSupport){G.setAttribute("placeholder",mxResources.get("dragImagesHere"));var S=y.parentNode,z=null;mxEvent.addListener(S,"dragleave",function(g){null!=z&&(z.parentNode.removeChild(z),z=null);g.stopPropagation();g.preventDefault()});mxEvent.addListener(S,"dragover",mxUtils.bind(this,function(g){null==z&&(z=b.highlightElement(S));g.stopPropagation();g.preventDefault()}));-mxEvent.addListener(S,"drop",mxUtils.bind(this,function(g){null!=z&&(z.parentNode.removeChild(z),z=null);if(0<g.dataTransfer.files.length)B(g.dataTransfer.files);else if(0<=mxUtils.indexOf(g.dataTransfer.types,"text/uri-list")){var p=g.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(p)&&(G.value=decodeURIComponent(p),x())}g.stopPropagation();g.preventDefault()}),!1)}};f=document.createElement("div");f.className="geDialogSection";l=document.createElement("div");l.className=-"geDialogCheckRow";l.appendChild(K);l.appendChild(G);f.appendChild(l);l=document.createElement("div");l.className="geDialogInlineFields";l.style.marginTop="6px";l.style.paddingLeft="24px";var F=document.createElement("div");F.className="geDialogInlineField";var L=document.createElement("label");mxUtils.write(L,mxResources.get("width"));F.appendChild(L);var D=document.createElement("input");D.setAttribute("type","text");D.value=null==m||J?"":m.width;F.appendChild(D);l.appendChild(F);F=document.createElement("div");-F.className="geDialogInlineField";L=document.createElement("label");mxUtils.write(L,mxResources.get("height"));F.appendChild(L);var T=document.createElement("input");T.setAttribute("type","text");T.value=null==m||J?"":m.height;F.appendChild(T);l.appendChild(F);f.appendChild(l);mxEvent.addListener(G,"change",x);ImageDialog.filePicked=function(S){S.action==google.picker.Action.PICKED&&null!=S.docs[0].thumbnails&&(S=S.docs[0].thumbnails[S.docs[0].thumbnails.length-1],null!=S&&(G.value=S.url,x()));G.focus()};-m=document.createElement("div");m.className="geDialogCheckRow";m.style.marginTop="6px";m.appendChild(H);m.appendChild(c);f.appendChild(m);y.appendChild(f);J?(H.setAttribute("checked","checked"),H.checked=!0):(K.setAttribute("checked","checked"),K.checked=!0);!A&&H.checked&&(mxUtils.write(n,mxResources.get("pageNotFound")),n.setAttribute("disabled","disabled"),n.setAttribute("selected","selected"),n.setAttribute("value","pageNotFound"),c.appendChild(n),mxEvent.addListener(c,"change",function(){null==+mxResources.get("background"));y.appendChild(A);var J=null!=m&&null!=m.originalSrc;A=!1;var K=document.createElement("input");K.setAttribute("value","url");K.setAttribute("type","radio");K.setAttribute("name","geBackgroundImageDialogOption");var F=document.createElement("input");F.setAttribute("value","url");F.setAttribute("type","radio");F.setAttribute("name","geBackgroundImageDialogOption");var H=document.createElement("input");H.setAttribute("type","text");H.style.flex="1";H.style.minWidth="0";+H.value=J||null==m?"":m.src;var c=document.createElement("select");c.style.flex="1";c.style.minWidth="0";c.style.marginLeft="0";if(null!=b.pages)for(var f=0;f<b.pages.length;f++){var l=document.createElement("option");mxUtils.write(l,b.pages[f].getName()||mxResources.get("pageWithNumber",[f+1]));l.setAttribute("value","data:page/id,"+b.pages[f].getId());b.pages[f]==b.currentPage&&l.setAttribute("disabled","disabled");null!=m&&m.originalSrc==l.getAttribute("value")&&(l.setAttribute("selected","selected"),+A=!0);c.appendChild(l)}J||null!=b.pages&&1!=b.pages.length||(K.style.display="none",F.style.display="none",c.style.display="none");var n=document.createElement("option"),r=!1,t=!1,x=function(S,z){r||null!=S&&t||(F.checked?null!=z&&z(n.selected?null:c.value):""==H.value||b.isOffline()?(D.value="",T.value="",null!=z&&z("")):(H.value=mxUtils.trim(H.value),b.loadImage(H.value,function(g){D.value=g.width;T.value=g.height;null!=z&&z(H.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),+mxResources.get("ok"));D.value="";T.value="";null!=z&&z(null)})))},B=mxUtils.bind(this,function(S){b.importFiles(S,0,0,b.maxBackgroundSize,function(z,g,p,v,C,E){H.value=z;x();H.focus()},function(){},function(z){return"image/"==z.type.substring(0,6)},function(z){for(var g=0;g<z.length;g++)z[g]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){J?c.focus():H.focus();mxEvent.addListener(c,"focus",function(){K.removeAttribute("checked");F.setAttribute("checked","checked");F.checked=+!0});mxEvent.addListener(H,"focus",function(){F.removeAttribute("checked");K.setAttribute("checked","checked");K.checked=!0});if(Graph.fileSupport){H.setAttribute("placeholder",mxResources.get("dragImagesHere"));var S=y.parentNode,z=null;mxEvent.addListener(S,"dragleave",function(g){null!=z&&(z.parentNode.removeChild(z),z=null);g.stopPropagation();g.preventDefault()});mxEvent.addListener(S,"dragover",mxUtils.bind(this,function(g){null==z&&(z=b.highlightElement(S));g.stopPropagation();g.preventDefault()}));+mxEvent.addListener(S,"drop",mxUtils.bind(this,function(g){null!=z&&(z.parentNode.removeChild(z),z=null);if(0<g.dataTransfer.files.length)B(g.dataTransfer.files);else if(0<=mxUtils.indexOf(g.dataTransfer.types,"text/uri-list")){var p=g.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(p)&&(H.value=decodeURIComponent(p),x())}g.stopPropagation();g.preventDefault()}),!1)}};f=document.createElement("div");f.className="geDialogSection";l=document.createElement("div");l.className=+"geDialogCheckRow";l.appendChild(K);l.appendChild(H);f.appendChild(l);l=document.createElement("div");l.className="geDialogInlineFields";l.style.marginTop="6px";l.style.paddingLeft="24px";var G=document.createElement("div");G.className="geDialogInlineField";var L=document.createElement("label");mxUtils.write(L,mxResources.get("width"));G.appendChild(L);var D=document.createElement("input");D.setAttribute("type","text");D.value=null==m||J?"":m.width;G.appendChild(D);l.appendChild(G);G=document.createElement("div");+G.className="geDialogInlineField";L=document.createElement("label");mxUtils.write(L,mxResources.get("height"));G.appendChild(L);var T=document.createElement("input");T.setAttribute("type","text");T.value=null==m||J?"":m.height;G.appendChild(T);l.appendChild(G);f.appendChild(l);mxEvent.addListener(H,"change",x);ImageDialog.filePicked=function(S){S.action==google.picker.Action.PICKED&&null!=S.docs[0].thumbnails&&(S=S.docs[0].thumbnails[S.docs[0].thumbnails.length-1],null!=S&&(H.value=S.url,x()));H.focus()};+m=document.createElement("div");m.className="geDialogCheckRow";m.style.marginTop="6px";m.appendChild(F);m.appendChild(c);f.appendChild(m);y.appendChild(f);J?(F.setAttribute("checked","checked"),F.checked=!0):(K.setAttribute("checked","checked"),K.checked=!0);!A&&F.checked&&(mxUtils.write(n,mxResources.get("pageNotFound")),n.setAttribute("disabled","disabled"),n.setAttribute("selected","selected"),n.setAttribute("value","pageNotFound"),c.appendChild(n),mxEvent.addListener(c,"change",function(){null==n.parentNode||n.selected||n.parentNode.removeChild(n)}));m=document.createElement("div");m.className="geDialogSection";m.style.display=q?"":"none";q=document.createElement("div");q.className="geDialogCheckRow";q.style.cursor="default";var N=document.createElement("input");N.setAttribute("type","checkbox");N.defaultChecked=d!=mxConstants.NONE&&null!=d;N.checked=N.defaultChecked;q.appendChild(N);A=document.createElement("label");mxUtils.write(A,mxResources.get("fillColor"));q.appendChild(A);var R=document.createElement("button");R.style.width="36px";R.style.height="18px";R.style.cursor="pointer";R.style.marginLeft="10px";R.style.backgroundPosition="center center";R.style.backgroundRepeat="no-repeat";R.className="geColorBtn";var P=d;u();mxEvent.addListener(q,"click",function(S){mxEvent.getSource(S)!=N&&(N.checked=!N.checked);P=N.checked?b.editor.graph.defaultPageBackgroundColor:null;u()});mxEvent.addListener(R,"click",function(S){b.pickColor(P||"none",function(z){P=z;u()});mxEvent.consume(S)});q.appendChild(R);m.appendChild(q);-y.appendChild(m);d=document.createElement("div");d.style.marginTop="34px";d.style.textAlign="right";q=mxUtils.button(mxResources.get("cancel"),function(){r=!0;b.hideDialog()});q.className="geBtn";b.editor.cancelFirst&&d.appendChild(q);m=mxUtils.button(mxResources.get("reset"),function(){G.value="";D.value="";T.value="";K.checked=!0;P=mxConstants.NONE;u();r=!1});mxEvent.addGestureListeners(m,function(){r=!0});m.className="geBtn";d.appendChild(m);if(Graph.fileSupport){var U=document.createElement("input");+y.appendChild(m);d=document.createElement("div");d.style.marginTop="34px";d.style.textAlign="right";q=mxUtils.button(mxResources.get("cancel"),function(){r=!0;b.hideDialog()});q.className="geBtn";b.editor.cancelFirst&&d.appendChild(q);m=mxUtils.button(mxResources.get("reset"),function(){H.value="";D.value="";T.value="";K.checked=!0;P=mxConstants.NONE;u();r=!1});mxEvent.addGestureListeners(m,function(){r=!0});m.className="geBtn";d.appendChild(m);if(Graph.fileSupport){var U=document.createElement("input");U.setAttribute("multiple","multiple");U.setAttribute("type","file");mxEvent.addListener(U,"change",function(S){null!=U.files&&(B(U.files),U.type="",U.type="file",U.value="")});U.style.display="none";y.appendChild(U);m=mxUtils.button(mxResources.get("open"),function(){U.click()});m.className="geBtn";d.appendChild(m)}applyBtn=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();x(null,function(S){k(""!=S&&null!=S?new mxImage(S,D.value,T.value):null,null==S,P)})});mxEvent.addGestureListeners(applyBtn,function(){t=!0});applyBtn.className="geBtn gePrimaryBtn";d.appendChild(applyBtn);b.editor.cancelFirst||d.appendChild(q);y.appendChild(d);this.container=y},ParseDialog=function(b,k,m){function d(f,l,n){if("plantUmlDiagram"==l||"plantUmlImage"==l){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var r=mxUtils.bind(this,function(S){b.spinner.stop();b.hideDialog();var z=b.editor.graph;z.getModel().beginUpdate();try{var g=b.importXml(S,Math.max(u.x,20),Math.max(u.y,20),!0,null,null,!0);z.setSelectionCells(g)}finally{z.getModel().endUpdate()}z.scrollCellToVisible(z.getSelectionCell())});n=mxUtils.bind(this,function(S){b.spinner.stop();b.handleError(S)});"plantUmlImage"==l?b.parsePlantUmlImage(f,r,n):b.parsePlantUmlDiagram(f,null,mxUtils.bind(this,function(S){r(mxPlantUmlToDrawio.wrapGroup(S,f,null))}),n)}}else if("mermaid"==l||"mermaidImage"==l){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var t=mxUtils.bind(this,function(S){b.spinner.stop();b.hideDialog();var z=-b.editor.graph;z.getModel().beginUpdate();try{var g=b.importXml(S,Math.max(u.x,20),Math.max(u.y,20),!0,null,null,!0);z.setSelectionCells(g)}finally{z.getModel().endUpdate()}z.scrollCellToVisible(z.getSelectionCell())});n=mxUtils.bind(this,function(S){b.spinner.stop();b.handleError(S)});"mermaidImage"==l?b.parseMermaidImage(f,t,n):b.parseMermaidDiagram(f,null,mxUtils.bind(this,function(S){t(mxMermaidToDrawio.wrapGroup(S,f,null))}),n)}}else if("table"==l){var x=f.split("\n");l=null;var B=[],F=0,L={};-for(n=0;n<x.length;n++){var D=mxUtils.trim(x[n]);if("primary key"==D.substring(0,11).toLowerCase()){var T=D.match(/\((.+)\)/);T&&T[1]&&(L[T[1]]=!0);x.splice(n,1)}else 0<D.toLowerCase().indexOf("primary key")&&(L[D.split(" ")[0]]=!0,x[n]=mxUtils.trim(D.replace(/primary key/i,"")))}for(n=0;n<x.length;n++)if(D=mxUtils.trim(x[n]),"create table"==D.substring(0,12).toLowerCase())D=mxUtils.trim(D.substring(12)),"("==D.charAt(D.length-1)&&(D=mxUtils.trim(D.substring(0,D.length-1))),l=new mxCell(D,new mxGeometry(F,-0,160,30),"shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;"),l.vertex=!0,B.push(l),D=b.editor.graph.getPreferredSizeForCell(N),null!=D&&(l.geometry.width=D.width+10);else if(null!=l&&")"==D.charAt(0))F+=l.geometry.width+40,l=null;else if("("!=D&&null!=l){D=D.substring(0,","==D.charAt(D.length-1)?D.length-1:D.length);T=L[D.split(" ")[0]];var N=new mxCell("",new mxGeometry(0,0,160,30),"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;strokeColor=inherit;top=0;left=0;right=0;bottom="++b.editor.graph;z.getModel().beginUpdate();try{var g=b.importXml(S,Math.max(u.x,20),Math.max(u.y,20),!0,null,null,!0);z.setSelectionCells(g)}finally{z.getModel().endUpdate()}z.scrollCellToVisible(z.getSelectionCell())});n=mxUtils.bind(this,function(S){b.spinner.stop();b.handleError(S)});"mermaidImage"==l?b.parseMermaidImage(f,t,n):b.parseMermaidDiagram(f,null,mxUtils.bind(this,function(S){t(mxMermaidToDrawio.wrapGroup(S,f,null))}),n)}}else if("table"==l){var x=f.split("\n");l=null;var B=[],G=0,L={};+for(n=0;n<x.length;n++){var D=mxUtils.trim(x[n]);if("primary key"==D.substring(0,11).toLowerCase()){var T=D.match(/\((.+)\)/);T&&T[1]&&(L[T[1]]=!0);x.splice(n,1)}else 0<D.toLowerCase().indexOf("primary key")&&(L[D.split(" ")[0]]=!0,x[n]=mxUtils.trim(D.replace(/primary key/i,"")))}for(n=0;n<x.length;n++)if(D=mxUtils.trim(x[n]),"create table"==D.substring(0,12).toLowerCase())D=mxUtils.trim(D.substring(12)),"("==D.charAt(D.length-1)&&(D=mxUtils.trim(D.substring(0,D.length-1))),l=new mxCell(D,new mxGeometry(G,+0,160,30),"shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;"),l.vertex=!0,B.push(l),D=b.editor.graph.getPreferredSizeForCell(N),null!=D&&(l.geometry.width=D.width+10);else if(null!=l&&")"==D.charAt(0))G+=l.geometry.width+40,l=null;else if("("!=D&&null!=l){D=D.substring(0,","==D.charAt(D.length-1)?D.length-1:D.length);T=L[D.split(" ")[0]];var N=new mxCell("",new mxGeometry(0,0,160,30),"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;strokeColor=inherit;top=0;left=0;right=0;bottom="+(T?"1":"0")+";");N.vertex=!0;var R=new mxCell(T?"PK":"",new mxGeometry(0,0,30,30),"shape=partialRectangle;overflow=hidden;connectable=0;fillColor=none;strokeColor=inherit;top=0;left=0;bottom=0;right=0;"+(T?"fontStyle=1;":""));R.vertex=!0;N.insert(R);D=new mxCell(D,new mxGeometry(30,0,130,30),"shape=partialRectangle;overflow=hidden;connectable=0;fillColor=none;align=left;strokeColor=inherit;top=0;left=0;bottom=0;right=0;spacingLeft=6;"+(T?"fontStyle=5;":""));D.vertex=!0;N.insert(D);D=b.editor.graph.getPreferredSizeForCell(D);-null!=D&&l.geometry.width<D.width+30&&(l.geometry.width=Math.min(320,Math.max(l.geometry.width,D.width+30)));l.insert(N,T?0:null);l.geometry.height+=30}0<B.length&&(N=b.editor.graph,N.setSelectionCells(N.importCells(B,u.x,u.y)),N.scrollCellToVisible(N.getSelectionCell()))}else if("list"==l){if(x=f.split("\n"),0<x.length){N=b.editor.graph;l=null;B=[];for(n=F=0;n<x.length;n++)";"!=x[n].charAt(0)&&(0==x[n].length?l=null:null==l?(l=new mxCell(x[n],new mxGeometry(F,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"),-l.vertex=!0,B.push(l),D=N.getPreferredSizeForCell(l),null!=D&&l.geometry.width<D.width+10&&(l.geometry.width=D.width+10),F+=l.geometry.width+40):"--"==x[n]?(D=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),D.vertex=!0,l.geometry.height+=D.geometry.height,l.insert(D)):0<x[n].length&&(L=new mxCell(x[n],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),+null!=D&&l.geometry.width<D.width+30&&(l.geometry.width=Math.min(320,Math.max(l.geometry.width,D.width+30)));l.insert(N,T?0:null);l.geometry.height+=30}0<B.length&&(N=b.editor.graph,N.setSelectionCells(N.importCells(B,u.x,u.y)),N.scrollCellToVisible(N.getSelectionCell()))}else if("list"==l){if(x=f.split("\n"),0<x.length){N=b.editor.graph;l=null;B=[];for(n=G=0;n<x.length;n++)";"!=x[n].charAt(0)&&(0==x[n].length?l=null:null==l?(l=new mxCell(x[n],new mxGeometry(G,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"),+l.vertex=!0,B.push(l),D=N.getPreferredSizeForCell(l),null!=D&&l.geometry.width<D.width+10&&(l.geometry.width=D.width+10),G+=l.geometry.width+40):"--"==x[n]?(D=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),D.vertex=!0,l.geometry.height+=D.geometry.height,l.insert(D)):0<x[n].length&&(L=new mxCell(x[n],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),L.vertex=!0,D=N.getPreferredSizeForCell(L),null!=D&&L.geometry.width<D.width&&(L.geometry.width=D.width),l.geometry.width=Math.max(l.geometry.width,L.geometry.width),l.geometry.height+=L.geometry.height,l.insert(L)));if(0<B.length){N.getModel().beginUpdate();try{B=N.importCells(B,u.x,u.y);D=[];for(n=0;n<B.length;n++)D.push(B[n]),D=D.concat(B[n].children);N.fireEvent(new mxEventObject("cellsInserted","cells",D))}finally{N.getModel().endUpdate()}N.setSelectionCells(B);N.scrollCellToVisible(N.getSelectionCell())}}}else{N=function(S){var z=P[S];null==z&&(z=new mxCell(S,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),z.vertex=!0,P[S]=z,B.push(z));return z};x=f.split("\n");var P={};B=[];for(n=0;n<x.length;n++)if(";"!=x[n].charAt(0)){var U=x[n].split("->");2<=U.length&&(T=N(U[0]),R=N(U[U.length-1]),U=new mxCell(2<U.length?U[1]:"",new mxGeometry),U.edge=!0,U.geometry.relative=!0,T.insertEdge(U,!0),R.insertEdge(U,!1),B.push(U))}if(0<B.length){x=document.createElement("div");x.style.visibility="hidden";document.body.appendChild(x);N=new Graph(x);N.getModel().beginUpdate();try{B=N.importCells(B);for(n=0;n<B.length;n++)N.getModel().isVertex(B[n])&&(D=N.getPreferredSizeForCell(B[n]),B[n].geometry.width=Math.max(B[n].geometry.width,D.width),B[n].geometry.height=Math.max(B[n].geometry.height,D.height));n=!0;"horizontalFlow"==l||"verticalFlow"==l?((new mxHierarchicalLayout(N,"horizontalFlow"==l?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH)).execute(N.getDefaultParent(),B),n=!1):"circle"==l?(new mxCircleLayout(N)).execute(N.getDefaultParent()):-(F=new mxFastOrganicLayout(N),F.disableEdgeStyle=!1,F.forceConstant=180,F.execute(N.getDefaultParent()));n&&(L=new mxParallelEdgeLayout(N),L.spacing=30,L.execute(N.getDefaultParent()))}finally{N.getModel().endUpdate()}N.clearCellOverlays();D=[];b.editor.graph.getModel().beginUpdate();try{B=N.getModel().getChildren(N.getDefaultParent()),D=b.editor.graph.importCells(B,u.x,u.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",D))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(D);+(G=new mxFastOrganicLayout(N),G.disableEdgeStyle=!1,G.forceConstant=180,G.execute(N.getDefaultParent()));n&&(L=new mxParallelEdgeLayout(N),L.spacing=30,L.execute(N.getDefaultParent()))}finally{N.getModel().endUpdate()}N.clearCellOverlays();D=[];b.editor.graph.getModel().beginUpdate();try{B=N.getModel().getChildren(N.getDefaultParent()),D=b.editor.graph.importCells(B,u.x,u.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",D))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(D);b.editor.graph.scrollCellToVisible(b.editor.graph.getSelectionCell());N.destroy();x.parentNode.removeChild(x)}}}function q(){return"list"==K.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String":"mermaid"==K.value||"mermaidImage"==K.value?"graph TD;\n A--\x3eB;\n A--\x3eC;\n B--\x3eD;\n C--\x3eD;":"table"==K.value?"CREATE TABLE Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\n":"plantUmlDiagram"==K.value||"plantUmlImage"==K.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":";Example:\na->b\nb->edge label->c\nc->a\n"}var u=b.editor.graph.getFreeInsertPoint(),y=document.createElement("div");y.style.display="flex";y.style.flexDirection="column";y.style.height="100%";y.style.boxSizing="border-box";y.style.overflow="visible";var A=document.createElement("h3");mxUtils.write(A,k||mxResources.get("insert"));y.appendChild(A);var J=document.createElement("textarea");J.style.flex="1";J.style.minHeight="0";J.style.width="100%";J.style.boxSizing="border-box";J.style.resize="none";J.setAttribute("wrap","off");J.setAttribute("spellcheck","false");J.setAttribute("autocorrect","off");J.setAttribute("autocomplete","off");J.setAttribute("autocapitalize","off");var K=document.createElement("select");K.className="geBtn";if("formatSql"==m||("mermaid"==m||"plantUml"==m)&&"draw.io"!=b.getServiceName()&&"atlassian"!=b.getServiceName())K.style.display="none";k=document.createElement("option");k.setAttribute("value","list");mxUtils.write(k,mxResources.get("list"));"plantUml"!=m&&"mermaid"!=m&&K.appendChild(k);null!=m&&"fromText"!=m||k.setAttribute("selected","selected");k=document.createElement("option");k.setAttribute("value","table");mxUtils.write(k,mxResources.get("formatSql"));"formatSql"==m&&(K.appendChild(k),k.setAttribute("selected","selected"));"mermaid"==m&&(k=document.createElement("option"),k.setAttribute("value","mermaid"),k.setAttribute("selected","selected"),mxUtils.write(k,mxResources.get("diagram")),K.appendChild(k),k=document.createElement("option"),k.setAttribute("value","mermaidImage"),mxUtils.write(k,mxResources.get("image")),K.appendChild(k));k=document.createElement("option");k.setAttribute("value","diagram");mxUtils.write(k,mxResources.get("diagram"));A=document.createElement("option");-A.setAttribute("value","circle");mxUtils.write(A,mxResources.get("circle"));var H=document.createElement("option");H.setAttribute("value","horizontalFlow");mxUtils.write(H,mxResources.get("horizontalFlow"));var G=document.createElement("option");G.setAttribute("value","verticalFlow");mxUtils.write(G,mxResources.get("verticalFlow"));"plantUml"!=m&&"mermaid"!=m&&(K.appendChild(k),K.appendChild(A),K.appendChild(H),K.appendChild(G));"plantUml"==m&&(k=document.createElement("option"),k.setAttribute("value",+A.setAttribute("value","circle");mxUtils.write(A,mxResources.get("circle"));var F=document.createElement("option");F.setAttribute("value","horizontalFlow");mxUtils.write(F,mxResources.get("horizontalFlow"));var H=document.createElement("option");H.setAttribute("value","verticalFlow");mxUtils.write(H,mxResources.get("verticalFlow"));"plantUml"!=m&&"mermaid"!=m&&(K.appendChild(k),K.appendChild(A),K.appendChild(F),K.appendChild(H));"plantUml"==m&&(k=document.createElement("option"),k.setAttribute("value","plantUmlDiagram"),k.setAttribute("selected","selected"),mxUtils.write(k,mxResources.get("diagram")),K.appendChild(k),k=document.createElement("option"),k.setAttribute("value","plantUmlImage"),mxUtils.write(k,mxResources.get("image")),K.appendChild(k));var c=q();J.value=c;y.appendChild(J);k=document.createElement("div");k.style.display="flex";k.style.justifyContent="end";k.style.alignItems="center";k.style.marginTop="14px";k.style.flexShrink="0";this.init=function(){J.focus()};Graph.fileSupport&&(J.addEventListener("dragover",function(f){f.stopPropagation();f.preventDefault()},!1),J.addEventListener("drop",function(f){f.stopPropagation();f.preventDefault();if(0<f.dataTransfer.files.length){f=f.dataTransfer.files[0];var l=new FileReader;l.onload=function(n){J.value=n.target.result};l.readAsText(f)}},!1));"plantUml"==m&&(A=document.createElement("div"),A.style.display="inline-block",A.style.color="#c00",A.style.fontSize="12px",A.style.marginRight="10px",A.style.display="flex",A.style.alignItems="center",A.innerHTML='<a href="https://github.com/jgraph/drawio/issues" target="_blank" rel="noopener noreferrer">Report any PlantUML issues</a>',k.appendChild(A));b.isOffline()&&!mxClient.IS_CHROMEAPP||"mermaid"!=m&&"plantUml"!=m||k.appendChild(b.createHelpIcon("mermaid"==m?"https://www.drawio.com/docs/manual/mermaid/":"https://plantuml.com/"));k.appendChild(K);mxEvent.addListener(K,"change",function(){var f=q();if(0==J.value.length||J.value==c)c=f,J.value=c});m=mxUtils.button(mxResources.get("close"),function(){J.value==c?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});m.className="geBtn";b.editor.cancelFirst&&k.appendChild(m);A=mxUtils.button(mxResources.get("insert"),function(f){try{"mermaid"!=K.value&&"mermaidImage"!=K.value&&"plantUmlDiagram"!=K.value&&"plantUmlImage"!=K.value&&b.hideDialog(),d(J.value,K.value,f)}catch(l){b.handleError(l)}});A.className="geBtn gePrimaryBtn";k.appendChild(A);b.editor.cancelFirst||k.appendChild(m);y.appendChild(k);this.container=-y},NewDialog=function(b,k,m,d,q,u,y,A,J,K,H,G,c,f,l,n,r,t,x,B){function F(Fa){null!=Fa&&(Ja=Ra=Fa?135:140);Fa=!0;if(null!=Ua)for(;V<Ua.length&&(Fa||0!=mxUtils.mod(V,30));){var Na=Ua[V++];Na=U(Na.url,Na.libs,Na.title,Na.tooltip?Na.tooltip:Na.title,Na.select,Na.imgUrl,Na.info,Na.onClick,Na.preview,Na.noImg,Na.clibs,Na.type);Fa&&Na.click();Fa=!1}}function L(Fa,Na,Ka,Qa,La,Oa){if(null!=Fa&&mxUtils.isAncestorNode(document.body,Qa)){Fa=mxUtils.parseXml(Fa);Fa=Editor.parseDiagramNode(Fa.documentElement,+y},NewDialog=function(b,k,m,d,q,u,y,A,J,K,F,H,c,f,l,n,r,t,x,B){function G(Fa){null!=Fa&&(Ja=Ra=Fa?135:140);Fa=!0;if(null!=Ua)for(;V<Ua.length&&(Fa||0!=mxUtils.mod(V,30));){var Na=Ua[V++];Na=U(Na.url,Na.libs,Na.title,Na.tooltip?Na.tooltip:Na.title,Na.select,Na.imgUrl,Na.info,Na.onClick,Na.preview,Na.noImg,Na.clibs,Na.type);Fa&&Na.click();Fa=!1}}function L(Fa,Na,Ka,Qa,La,Oa){if(null!=Fa&&mxUtils.isAncestorNode(document.body,Qa)){Fa=mxUtils.parseXml(Fa);Fa=Editor.parseDiagramNode(Fa.documentElement,null,!0);var $a=new mxCodec(Fa.ownerDocument),cb=new mxGraphModel;$a.decode(Fa,cb);b.sidebar.createTooltip(Qa,cb.root.children,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1E3),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,800),null!=La?mxResources.get(La):null,!0,new mxPoint(Na,Ka),!0,function(){aa=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;null!=Oa&&T(Qa,null,null,Oa,infoObj,clibs)},!0,!1)}}function D(){if(oa==Va&&null==fa&&null!=wb&&null!=hb)d&&b.spinner.spin(document.body,mxResources.get("generate")+" '"+hb.value+"'")&&(g=!0,b.hideDialog()),wb.click();else if(g&&b.spinner.stop(),pa&&null!=f)m||g||b.hideDialog(),f(pa,ya,I.value);else if(d)m||g||b.hideDialog(),d(fa,I.value,ua,Ca);else{var Fa=I.value;if(null!=Fa&&0<Fa.length){var Na=function(Qa,La,Oa){b.createFile(Oa,fa,null!=Ca&&0<Ca.length?Ca:null,Qa,function(){g||b.hideDialog()},null,La,null,null!=ca&&0<ca.length?ca:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var Ka=new SaveDialog(b,Fa,mxUtils.bind(this,function(Qa,La,Oa){Na(La,Oa,Qa.value)}),null,null,null,null,b.mode);b.showDialog(Ka.container,420,162,!0,!1);Ka.init()}else b.pickFolder(b.mode,function(Qa){Na(b.mode,Qa,Fa)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}}function T(Fa,Na,Ka,Qa,La,Oa,$a){return oa!=Fa?(null!=oa&&(oa.classList.remove("geTemplateSelected"),oa==Va&&(ab.style.display="none",pb.style.display=@@ -12826,96 +12829,96 @@ Ra+"px";Y=gb;var Mb=Oa.replace(".drawio.xml","").replace(".drawio","").replace("null,ib,Ga),na&&D())})};Oa=gb||TEMPLATE_PATH+"/"+Fa.substring(0,Fa.length-4)+".png";gb=pb.cloneNode(!1);gb.style.backgroundImage="url("+Oa+")";gb.style.display="";Xa.appendChild(gb);null!=Ka&&Xa.appendChild(Kb);mxEvent.addGestureListeners(Xa,mxUtils.bind(this,function(na){ma()}),null,null);mxEvent.addListener(Xa,"dblclick",function(na){ma(!0);mxEvent.consume(na)})}else Xa.appendChild(Kb),"generative"==Eb&&null==Va&&(Xa.appendChild(pb),Xa.appendChild(ab),Xa.appendChild(Pa),Xa.appendChild(eb),Va=Xa),La&&T(Xa),null!=cb?(mxEvent.addGestureListeners(Xa,null,null,mxUtils.bind(this,function(na){T(Xa,null,null,Fa,$a)})),mxEvent.addListener(Xa,"click",cb)):(mxEvent.addListener(Xa,"click",function(na){T(Xa,null,null,Fa,$a)&&"generative"==Eb&&null==ia&&N()}),mxEvent.addListener(Xa,"dblclick",function(na){"generative"!=Eb?D():"none"==ab.style.display&&N();mxEvent.consume(na)}));null!=Fa&&(Oa=X.cloneNode(!0),Xa.appendChild(Oa),mxEvent.addGestureListeners(Oa,mxUtils.bind(this,function(na){aa=b.sidebar.currentElt==Xa}),null,null),mxEvent.addListener(Oa,"click",mxUtils.bind(this,function(na){aa||xb(na,null!=Ka?Ka:Qa);mxEvent.consume(na)})));ea.appendChild(Xa);return Xa}function S(){function Fa(fb,xb){fb=mxResources.get(fb,null,fb.substring(0,1).toUpperCase()+fb.substring(1));18<fb.length&&(fb=fb.substring(0,18)+"…");return fb+(null!=xb?" ("+xb.length+")":"")}function Na(fb,xb,Xa){mxEvent.addListener(xb,"click",function(){Wa!=xb&&(null!=Wa&&(Wa.style.backgroundColor=""),Wa=xb,Wa.style.backgroundColor=-y,ea.scrollTop=0,ea.innerText="",V=0,null!=Ya[fb].content?(ea.appendChild(Ya[fb].content),fa=ia,Ua=null,null!=Ya[fb].content.init&&Ya[fb].content.init()):(Ua=Xa?rb[fb][Xa]:Ya[fb],ba=null,F(!1)))})}Cb&&(Cb=!1,mxEvent.addListener(ea,"scroll",function(fb){ea.scrollTop+ea.clientHeight>=ea.scrollHeight&&(F(),mxEvent.consume(fb))}));if(0<ub){var Ka=document.createElement("div");Ka.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Ka,mxResources.get("custom"));+y,ea.scrollTop=0,ea.innerText="",V=0,null!=Ya[fb].content?(ea.appendChild(Ya[fb].content),fa=ia,Ua=null,null!=Ya[fb].content.init&&Ya[fb].content.init()):(Ua=Xa?rb[fb][Xa]:Ya[fb],ba=null,G(!1)))})}Cb&&(Cb=!1,mxEvent.addListener(ea,"scroll",function(fb){ea.scrollTop+ea.clientHeight>=ea.scrollHeight&&(G(),mxEvent.consume(fb))}));if(0<ub){var Ka=document.createElement("div");Ka.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Ka,mxResources.get("custom"));Ha.appendChild(Ka);for(var Qa in yb){var La=document.createElement("div");Ka=Qa;var Oa=yb[Qa];18<Ka.length&&(Ka=Ka.substring(0,18)+"…");La.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";La.setAttribute("title",Ka+" ("+Oa.length+")");mxUtils.write(La,La.getAttribute("title"));null!=K&&(La.style.padding=K);Ha.appendChild(La);(function(fb,xb){mxEvent.addListener(La,"click",function(){Wa!=xb&&-(Wa.style.backgroundColor="",Wa=xb,Wa.style.backgroundColor=y,ea.scrollTop=0,ea.innerText="",V=0,Ua=yb[fb],ba=null,F(!1))})})(Qa,La)}Ka=document.createElement("div");Ka.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Ka,"draw.io");Ha.appendChild(Ka)}for(Qa in Ya){Ka=Oa=null;if(null!=Ya[Qa].content)La=document.createElement($a?"ul":"div"),Ka=Fa(Qa),La.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",+(Wa.style.backgroundColor="",Wa=xb,Wa.style.backgroundColor=y,ea.scrollTop=0,ea.innerText="",V=0,Ua=yb[fb],ba=null,G(!1))})})(Qa,La)}Ka=document.createElement("div");Ka.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Ka,"draw.io");Ha.appendChild(Ka)}for(Qa in Ya){Ka=Oa=null;if(null!=Ya[Qa].content)La=document.createElement($a?"ul":"div"),Ka=Fa(Qa),La.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",La.setAttribute("title",Ka),mxUtils.write(La,Ka),Ha.appendChild(La),Ka=La;else{var $a=rb[Qa];Ka=La=document.createElement($a?"ul":"div");Oa=Ya[Qa];var cb=Fa(Qa,Oa);if(null!=$a){Oa=document.createElement("li");var gb=document.createElement("div");gb.className="geTempTreeCaret";gb.setAttribute("title",cb);mxUtils.write(gb,cb);Ka=gb;Oa.appendChild(gb);cb=document.createElement("ul");cb.className="geTempTreeNested";cb.style.visibility="hidden";for(var zb in $a){var ib=document.createElement("li"),Eb=Fa(zb,$a[zb]);ib.setAttribute("title",Eb);mxUtils.write(ib,Eb);Na(Qa,ib,zb);cb.appendChild(ib)}Oa.appendChild(cb);La.className="geTempTree";La.appendChild(Oa);(function(fb,xb){mxEvent.addListener(xb,"click",function(){fb.style.visibility="visible";fb.classList.toggle("geTempTreeActive");fb.classList.toggle("geTempTreeNested")&&setTimeout(function(){fb.style.visibility="hidden"},550);xb.classList.toggle("geTempTreeCaret-down")})})(cb,gb)}else La.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",-La.setAttribute("title",cb),mxUtils.write(La,cb);null!=K&&(La.style.padding=K);Ha.appendChild(La)}Na(Qa,Ka);null==Wa&&Ka.click()}F(!1)}var z=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);m=null!=m?m:!0;q=null!=q?q:!1;y=null!=y?y:"light-dark(#ebf2f9, "+Editor.darkColor+")";H=null!=H?H:EditorUi.templateFile;var g=!1,p=document.createElement("div");p.style.userSelect="none";p.style.height="100%";var v=document.createElement("div");v.style.whiteSpace="nowrap";+La.setAttribute("title",cb),mxUtils.write(La,cb);null!=K&&(La.style.padding=K);Ha.appendChild(La)}Na(Qa,Ka);null==Wa&&Ka.click()}G(!1)}var z=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);m=null!=m?m:!0;q=null!=q?q:!1;y=null!=y?y:"light-dark(#ebf2f9, "+Editor.darkColor+")";F=null!=F?F:EditorUi.templateFile;var g=!1,p=document.createElement("div");p.style.userSelect="none";p.style.height="100%";var v=document.createElement("div");v.style.whiteSpace="nowrap";v.style.height="46px";m&&p.appendChild(v);var C=document.createElement("img");C.setAttribute("border","0");C.setAttribute("align","absmiddle");C.style.width="40px";C.style.height="40px";C.style.marginRight="10px";C.style.paddingBottom="4px";C.src=b.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":b.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":b.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":b.mode==App.MODE_M365?IMAGE_PATH+"/onedrive-logo.svg":b.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":b.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":b.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":b.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";k||z||!m||v.appendChild(C);m&&mxUtils.write(v,(z?mxResources.get("name"):null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");var E=".drawio";b.mode==App.MODE_GOOGLE&&null!=b.drive?E=b.drive.extension:b.mode==App.MODE_DROPBOX&&null!=b.dropbox?E=b.dropbox.extension:b.mode==App.MODE_ONEDRIVE&&null!=b.oneDrive?E=b.oneDrive.extension:b.mode==App.MODE_GITHUB&&null!=b.gitHub?E=b.gitHub.extension:b.mode==App.MODE_GITLAB&&null!=b.gitLab?E=b.gitLab.extension:b.mode==App.MODE_TRELLO&&null!=b.trello&&(E=b.trello.extension);var I=document.createElement("input");I.setAttribute("value",b.defaultFilename+E);I.style.marginLeft="10px";I.style.width=k||z?"144px":"244px";this.init=function(){m&&Editor.selectFilename(I);null!=ea.parentNode&&null!=ea.parentNode.parentNode&&mxEvent.addGestureListeners(ea.parentNode.parentNode,mxUtils.bind(this,function(Fa){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null)};if(m)if(v.appendChild(I),t)I.style.width=k||z?"350px":"450px";else if(null!=b.editor.diagramFileTypes){var O=FilenameDialog.createFileTypes(b,I,b.editor.diagramFileTypes);O.style.marginLeft="6px";O.style.width=k||z?"80px":"180px";v.appendChild(O)}var Q=!1,V=0,W=new Spinner({lines:12,length:10,width:5,radius:10,-rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),M=mxUtils.button(n||mxResources.get("create"),function(){M.setAttribute("disabled","disabled");D();M.removeAttribute("disabled")});M.className="geBtn gePrimaryBtn";var X=document.createElement("img");X.setAttribute("src",Editor.magnifyImage);X.setAttribute("title",mxResources.get("preview"));X.className="geButton geRoundButton";var Z=!1,Y=null,aa=!1;if(G||c){var da=[],ba=null,ha=null,la=null,+rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),M=mxUtils.button(n||mxResources.get("create"),function(){M.setAttribute("disabled","disabled");D();M.removeAttribute("disabled")});M.className="geBtn gePrimaryBtn";var X=document.createElement("img");X.setAttribute("src",Editor.magnifyImage);X.setAttribute("title",mxResources.get("preview"));X.className="geButton geRoundButton";var Z=!1,Y=null,aa=!1;if(H||c){var da=[],ba=null,ha=null,la=null,ra=function(Fa){M.setAttribute("disabled","disabled");for(var Na=0;Na<da.length;Na++)da[Na].className=Na==Fa?"geBtn gePrimaryBtn":"geBtn"};Q=!0;var sa=document.createElement("div");sa.style.whiteSpace="nowrap";sa.style.height="30px";p.appendChild(sa);var va=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Ha.style.display="";ta.style.display="";ea.style.left="160px";ra(0);ea.scrollTop=0;ea.innerText="";V=0;ba!=Ua&&(Ua=ba,Ya=ha,ub=la,Ha.innerText="",S(),ba=null)});da.push(va);sa.appendChild(va);var wa=function(Fa){Ha.style.display="none";ta.style.display="none";ea.style.left="30px";ra(Fa?-1:1);null==ba&&(ba=Ua);ea.scrollTop=0;ea.innerText="";W.spin(ea);var Na=function(Ka,Qa,La){V=0;W.stop();Ua=Ka;La=La||{};var Oa=0,$a;for($a in La)Oa+=La[$a].length;if(Qa)ea.innerText=Qa;else if(0==Ka.length&&0==Oa)ea.innerText=mxResources.get("noDiagrams",null,"No Diagrams Found");else if(ea.innerText="",0<Oa){Ha.style.display="";ea.style.left="160px";Ha.innerText="";ub=0;Ya={"draw.io":Ka};-for($a in La)Ya[$a]=La[$a];S()}else F(!0)};Fa?c(Aa.value,Na):G(Na)};if(G){var qa=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){wa()});sa.appendChild(qa);da.push(qa)}if(c){var Ba=document.createElement("span");Ba.style.marginLeft="10px";Ba.innerText=mxResources.get("search")+":";sa.appendChild(Ba);var Aa=document.createElement("input");Aa.style.marginRight="10px";Aa.style.marginLeft="10px";Aa.style.width="220px";mxEvent.addListener(Aa,"keypress",function(Fa){13==Fa.keyCode&&wa(!0)});+for($a in La)Ya[$a]=La[$a];S()}else G(!0)};Fa?c(Aa.value,Na):H(Na)};if(H){var qa=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){wa()});sa.appendChild(qa);da.push(qa)}if(c){var Ba=document.createElement("span");Ba.style.marginLeft="10px";Ba.innerText=mxResources.get("search")+":";sa.appendChild(Ba);var Aa=document.createElement("input");Aa.style.marginRight="10px";Aa.style.marginLeft="10px";Aa.style.width="220px";mxEvent.addListener(Aa,"keypress",function(Fa){13==Fa.keyCode&&wa(!0)});sa.appendChild(Aa);var Da=mxUtils.button(mxResources.get("search"),function(){wa(!0)});Da.className="geBtn";sa.appendChild(Da)}ra(0)}var Ca=null,ca=null,fa=null,oa=null,pa=null,ua=null,ya=null,ia=null,ka=null,ea=document.createElement("div");ea.style.border="1px solid #d3d3d3";ea.style.position="absolute";ea.style.left="160px";ea.style.right="34px";var ja=(m?72:40)+(Q?30:0);ea.style.top=ja+"px";ea.style.bottom="68px";ea.style.margin="6px 0 0 -1px";ea.style.padding="6px";ea.style.overflow="auto";var ta=document.createElement("div");ta.style.cssText="position:absolute;left:30px;width:128px;top:"+ja+"px;height:22px;margin-top: 6px;white-space: nowrap;";var xa=document.createElement("input");xa.style.cssText="width:105px;height:16px;border:1px solid #d3d3d3;padding: 3px 20px 3px 3px;font-size: 12px;border-radius:0px;";xa.setAttribute("placeholder",mxResources.get("search"));xa.setAttribute("type","text");ta.appendChild(xa);var Ea=document.createElement("img");Ea.setAttribute("src",Editor.magnifyImage);Ea.setAttribute("title",mxResources.get("search"));Ea.className="geAdaptiveAsset";Ea.style.position="relative";Ea.style.cursor="pointer";Ea.style.outline="none";Ea.style.opacity="0.5";Ea.style.height="16px";Ea.style.left="-20px";Ea.style.top="4px";ta.appendChild(Ea);mxEvent.addListener(Ea,"click",function(){Ea.getAttribute("src")!=Editor.magnifyImage&&(Ea.setAttribute("src",Editor.magnifyImage),Ea.setAttribute("title",mxResources.get("search")),xa.value="",null!=mb&&(mb.click(),mb=null));xa.focus()});-mxEvent.addListener(xa,"keydown",mxUtils.bind(this,function(Fa){if(13==Fa.keyCode){var Na=xa.value;if(""==Na)null!=mb&&(mb.click(),mb=null);else{if(null==NewDialog.tagsList[H]){var Ka={};for(ib in Ya)if(null==Ya[ib].content)for(var Qa=Ya[ib],La=0;La<Qa.length;La++){var Oa=Qa[La];if(null!=Oa.tags)for(var $a=Oa.tags.toLowerCase().split(";"),cb=0;cb<$a.length;cb++)null==Ka[$a[cb]]&&(Ka[$a[cb]]=[]),Ka[$a[cb]].push(Oa)}NewDialog.tagsList[H]=Ka}var gb=Na.toLowerCase().split(" ");Ka=NewDialog.tagsList[H];+mxEvent.addListener(xa,"keydown",mxUtils.bind(this,function(Fa){if(13==Fa.keyCode){var Na=xa.value;if(""==Na)null!=mb&&(mb.click(),mb=null);else{if(null==NewDialog.tagsList[F]){var Ka={};for(ib in Ya)if(null==Ya[ib].content)for(var Qa=Ya[ib],La=0;La<Qa.length;La++){var Oa=Qa[La];if(null!=Oa.tags)for(var $a=Oa.tags.toLowerCase().split(";"),cb=0;cb<$a.length;cb++)null==Ka[$a[cb]]&&(Ka[$a[cb]]=[]),Ka[$a[cb]].push(Oa)}NewDialog.tagsList[F]=Ka}var gb=Na.toLowerCase().split(" ");Ka=NewDialog.tagsList[F];if(0<ub&&null==Ka.__tagsList__){for(ib in yb)for(Qa=yb[ib],La=0;La<Qa.length;La++)for(Oa=Qa[La],$a=Oa.title.split(" "),$a.push(ib),cb=0;cb<$a.length;cb++){var zb=$a[cb].toLowerCase();null==Ka[zb]&&(Ka[zb]=[]);Ka[zb].push(Oa)}Ka.__tagsList__=!0}var ib=[];Qa={};for(La=$a=0;La<gb.length;La++)if(0<gb[La].length){zb=Ka[gb[La]];var Eb={};ib=[];if(null!=zb)for(cb=0;cb<zb.length;cb++)Oa=zb[cb],0==$a==(null==Qa[Oa.url])&&(Eb[Oa.url]=!0,ib.push(Oa));Qa=Eb;$a++}ea.scrollTop=0;ea.innerText="";V=0;Ka=document.createElement("div");-Ka.style.padding="6px";Ka.style.whiteSpace="nowrap";Ka.style.overflow="hidden";Ka.style.textOverflow="ellipsis";Oa=mxResources.get(0==ib.length?"noResultsFor":"resultsFor",[Na]);Ka.setAttribute("title",Oa);mxUtils.write(Ka,Oa);ea.appendChild(Ka);null!=Wa&&null==mb&&(Wa.style.backgroundColor="",mb=Wa,Wa=Ka);Ua=ib;ba=null;F(!1)}mxEvent.consume(Fa)}}));mxEvent.addListener(xa,"keyup",mxUtils.bind(this,function(Fa){""==xa.value?(Ea.setAttribute("src",Editor.magnifyImage),Ea.setAttribute("title",mxResources.get("search"))):+Ka.style.padding="6px";Ka.style.whiteSpace="nowrap";Ka.style.overflow="hidden";Ka.style.textOverflow="ellipsis";Oa=mxResources.get(0==ib.length?"noResultsFor":"resultsFor",[Na]);Ka.setAttribute("title",Oa);mxUtils.write(Ka,Oa);ea.appendChild(Ka);null!=Wa&&null==mb&&(Wa.style.backgroundColor="",mb=Wa,Wa=Ka);Ua=ib;ba=null;G(!1)}mxEvent.consume(Fa)}}));mxEvent.addListener(xa,"keyup",mxUtils.bind(this,function(Fa){""==xa.value?(Ea.setAttribute("src",Editor.magnifyImage),Ea.setAttribute("title",mxResources.get("search"))):(Ea.setAttribute("src",Editor.crossImage),Ea.setAttribute("title",mxResources.get("reset")))}));ja+=23;var Ha=document.createElement("div");Ha.style.cssText="position:absolute;left:30px;width:128px;top:"+ja+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(ea,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var Ja=140,Ra=Ja,Va=null,bb="url("+Editor.thinSparklesImage+")",ab=document.createElement("div");ab.className="geGenerateDiagramForm";ab.style.position="absolute";ab.style.width="100%";ab.style.height="100%";var pb=document.createElement("div");pb.className="geTemplatePreview geAdaptiveAsset";pb.style.backgroundImage=bb;var hb=document.createElement("textarea");hb.setAttribute("placeholder",mxResources.get("describeYourDiagram"));hb.className="geGenerateDiagramDescription";var wb=document.createElement("button");wb.className="geBtn gePrimaryBtn geGenerateDiagramButton";wb.setAttribute("disabled","disabled");wb.setAttribute("title",mxResources.get("ok"));mxUtils.write(wb,mxResources.get("ok"));var Pa=X.cloneNode(!0);Pa.style.display="none";var Za=!1;mxEvent.addGestureListeners(Pa,function(Fa){Za=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},null,function(Fa){if(!Za&&null!=ia){var Na="<mxfile><diagram>"+Graph.compress(ia)+"</diagram></mxfile>";L(Na,mxEvent.getClientX(Fa),mxEvent.getClientY(Fa),Va,ka)}});var eb=X.cloneNode(!0);eb.setAttribute("src",Editor.editImage);eb.setAttribute("title",mxResources.get("edit"));eb.style.visibility="hidden";eb.style.left="0px";var qb=X.cloneNode(!0);qb.setAttribute("src",Editor.helpImage);qb.setAttribute("title",mxResources.get("help"));mxEvent.addListener(qb,"click",function(Fa){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");mxEvent.consume(Fa)});ab.appendChild(hb);ab.appendChild(wb);ab.appendChild(qb);ab.style.display="none";mxEvent.addListener(eb,"click",N);mxEvent.addListener(hb,"input",function(){""!=hb.value?wb.removeAttribute("disabled"):wb.setAttribute("disabled","disabled")});var lb=!1;mxEvent.addListener(wb,"click",function(){P()});mxEvent.addListener(hb,"keydown",function(Fa){13!=Fa.keyCode||mxEvent.isShiftDown(Fa)?27==Fa.keyCode&&(P(!0),mxEvent.consume(Fa)):(P(),mxEvent.consume(Fa))});var Ya={},rb={},yb={},ub=0,Cb=!0,Wa=null,mb=null;Ya.basic=B?[]:[{title:"blankDiagram"}];var Ua=Ya.basic;Editor.enableAi&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&EditorUi.isMermaidSupported()&&Ya.basic.push({title:"generate",type:"generative"});if(!k){var nb=-function(){mxUtils.get(jb,function(Fa){if(!Hb){Hb=!0;Fa=Fa.getXml().documentElement.firstChild;for(var Na={};null!=Fa;){if("undefined"!==typeof Fa.getAttribute)if("parsererror"==Fa.nodeName)null!=window.console&&console.log("Parser error in "+H+": "+Fa.textContent);else if("clibs"==Fa.nodeName){for(var Ka=Fa.getAttribute("name"),Qa=Fa.getElementsByTagName("add"),La=[],Oa=0;Oa<Qa.length;Oa++)La.push(encodeURIComponent(mxUtils.getTextContent(Qa[Oa])));null!=Ka&&0<La.length&&(Na[Ka]=La.join(";"))}else if(La=+function(){mxUtils.get(jb,function(Fa){if(!Hb){Hb=!0;Fa=Fa.getXml().documentElement.firstChild;for(var Na={};null!=Fa;){if("undefined"!==typeof Fa.getAttribute)if("parsererror"==Fa.nodeName)null!=window.console&&console.log("Parser error in "+F+": "+Fa.textContent);else if("clibs"==Fa.nodeName){for(var Ka=Fa.getAttribute("name"),Qa=Fa.getElementsByTagName("add"),La=[],Oa=0;Oa<Qa.length;Oa++)La.push(encodeURIComponent(mxUtils.getTextContent(Qa[Oa])));null!=Ka&&0<La.length&&(Na[Ka]=La.join(";"))}else if(La=Fa.getAttribute("url"),null!=La){Qa=Fa.getAttribute("section");Ka=Fa.getAttribute("subsection");if(null==Qa&&(Oa=La.indexOf("/"),Qa=La.substring(0,Oa),null==Ka)){var $a=La.indexOf("/",Oa+1);-1<$a&&(Ka=La.substring(Oa+1,$a))}Oa=Ya[Qa];null==Oa&&(Oa=[],Ya[Qa]=Oa);La=Fa.getAttribute("clibs");null!=Na[La]&&(La=Na[La]);La={url:Fa.getAttribute("url"),libs:Fa.getAttribute("libs"),title:Fa.getAttribute("title"),tooltip:Fa.getAttribute("name")||Fa.getAttribute("url"),preview:Fa.getAttribute("preview"),clibs:La,-tags:Fa.getAttribute("tags")};Oa.push(La);null!=Ka&&(Oa=rb[Qa],null==Oa&&(Oa={},rb[Qa]=Oa),Qa=Oa[Ka],null==Qa&&(Qa=[],Oa[Ka]=Qa),Qa.push(La))}Fa=Fa.nextSibling}W.stop();S()}})};p.appendChild(ta);p.appendChild(Ha);p.appendChild(ea);var Hb=!1,jb=H;/^https?:\/\//.test(jb)&&!b.editor.isCorsEnabledForUrl(jb)&&(jb=PROXY_URL+"?url="+encodeURIComponent(jb));W.spin(ea);null!=r?r(function(Fa,Na){yb=Fa;la=ub=Na;nb()},nb):nb();ha=Ya}mxEvent.addListener(I,"keypress",function(Fa){b.dialog.container.firstChild==+tags:Fa.getAttribute("tags")};Oa.push(La);null!=Ka&&(Oa=rb[Qa],null==Oa&&(Oa={},rb[Qa]=Oa),Qa=Oa[Ka],null==Qa&&(Qa=[],Oa[Ka]=Qa),Qa.push(La))}Fa=Fa.nextSibling}W.stop();S()}})};p.appendChild(ta);p.appendChild(Ha);p.appendChild(ea);var Hb=!1,jb=F;/^https?:\/\//.test(jb)&&!b.editor.isCorsEnabledForUrl(jb)&&(jb=PROXY_URL+"?url="+encodeURIComponent(jb));W.spin(ea);null!=r?r(function(Fa,Na){yb=Fa;la=ub=Na;nb()},nb):nb();ha=Ya}mxEvent.addListener(I,"keypress",function(Fa){b.dialog.container.firstChild==p&&13==Fa.keyCode&&D()});var db=document.createElement("div");db.style.marginTop=k?"4px":"16px";db.style.textAlign="right";db.style.position="absolute";db.style.left="40px";db.style.bottom="24px";db.style.right="40px";var Ab=mxUtils.button(mxResources.get("cancel"),function(){null!=u&&u();b.hideDialog(!0)});Ab.className="geBtn";!b.editor.cancelFirst||q&&null==u||db.appendChild(Ab);if(!(k||"1"==urlParams.embed||q||mxClient.IS_ANDROID||mxClient.IS_IOS)&&"1"!=urlParams.noDevice){var vb=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var Fa=new FilenameDialog(b,"",mxResources.get("create"),function(Na){null!=Na&&0<Na.length&&b.editor.loadUrl(b.editor.getProxiedUrl(Na),function(Ka){fa=Ka;Ca=null;templateRealURl=Na;b.hideDialog();D()},function(Ka){b.handleError(Ka)})},mxResources.get("url"),null,null,null,!1);b.showDialog(Fa.container,300,80,!0,!0);Fa.init()});vb.className="geBtn";db.appendChild(vb)}if(Graph.fileSupport&&l){var Fb=mxUtils.button(mxResources.get("import"),function(){if(null==b.newDlgFileInputElt){var Fa=document.createElement("input");Fa.setAttribute("multiple","multiple");Fa.setAttribute("type","file");mxEvent.addListener(Fa,"change",function(Na){b.openFiles(Fa.files,!0);Fa.value=""});Fa.style.display="none";document.body.appendChild(Fa);b.newDlgFileInputElt=Fa}b.newDlgFileInputElt.click()});Fb.className="geBtn";db.appendChild(Fb)}db.appendChild(M);b.editor.cancelFirst||null!=d||q&&null==u||db.appendChild(Ab);p.appendChild(db);this.container=p};NewDialog.tagsList={};-var SaveDialog=function(b,k,m,d,q,u,y,A,J,K,H){function G(g,p,v,C,E,I){var O=null;if((null==d||0>mxUtils.indexOf(d,g))&&(null==J||g==J)&&(null==K||0<=mxUtils.indexOf(K,g))){E=null!=E?E:b.getTitleForService(g);var Q=0<=mxUtils.indexOf(P,g);if(Q||null!=b.getServiceForName(g)){O=document.createElement("option");var V="";!Q&&b.isOffline(g==App.MODE_GOOGLE&&"1"==urlParams["gapi-stealth"])&&(O.setAttribute("disabled","disabled"),V=" ("+mxResources.get("offline")+")");if("pick"==I)O.innerHTML=mxUtils.htmlEntities(E)++var SaveDialog=function(b,k,m,d,q,u,y,A,J,K,F){function H(g,p,v,C,E,I){var O=null;if((null==d||0>mxUtils.indexOf(d,g))&&(null==J||g==J)&&(null==K||0<=mxUtils.indexOf(K,g))){E=null!=E?E:b.getTitleForService(g);var Q=0<=mxUtils.indexOf(P,g);if(Q||null!=b.getServiceForName(g)){O=document.createElement("option");var V="";!Q&&b.isOffline(g==App.MODE_GOOGLE&&"1"==urlParams["gapi-stealth"])&&(O.setAttribute("disabled","disabled"),V=" ("+mxResources.get("offline")+")");if("pick"==I)O.innerHTML=mxUtils.htmlEntities(E)+" – "+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"..."+V,O.setAttribute("value","pickFolder-"+g),O.setAttribute("title",E+" - "+mxResources.get("pickFolder")+"...");else{Q=g+(null!=v?"-"+v:"");var W=S[Q];null!=W&&null!=W.option&&W.option.parentNode.removeChild(W.option);W=null;if(null!=p){"/"==p.charAt(p.length-1)&&(p=p.substring(0,p.length-1));"/"==p.charAt(0)&&(p=p.substring(1));W=p;if(g!=App.MODE_GITHUB&&g==App.MODE_GITLAB){var M=W.lastIndexOf("/");0<=M&&(W=W.substring(M+1))}40<W.length&&(W=W.substring(0,20)+"..."+W.substring(W.length-20))}O.innerHTML=mxUtils.htmlEntities(E)+(null!=W?" – "+mxUtils.htmlEntities(W):"")+V;O.setAttribute("title",E+(null!=p?" ("+p+")":"")+(null!=v&&decodeURIComponent(v)!=p?" ["+v+"]":""));O.setAttribute("value",Q);S[Q]={option:O,mode:g,path:p,id:v};SaveDialog.lastValue==Q&&null==A&&"disabled"==!O.getAttribute("disabled")?C=!0:null==C&&("root"==I?C=null==A&&b.mode==g||null!=g&&g==A:"pickFolder-"==R.value.substring(0,11)&&(C=!0));C&&O.setAttribute("selected","selected")}R.appendChild(O)}}return O}function c(g){b.pickFolder(g,function(p){var v=null;g==App.MODE_GOOGLE&&null!=p.docs&&0<p.docs.length?v={mode:g,path:p.docs[0].name,id:p.docs[0].id}:g==App.MODE_ONEDRIVE&&null!=p.value&&0<p.value.length?v={mode:g,path:p.value[0].name,id:OneDriveFile.prototype.getIdOf(p.value[0])}:g==App.MODE_M365&&null!=p.value&&0<p.value.length?v={mode:g,path:p.value[0].name,id:OneDriveFile.prototype.getIdOf(p.value[0])}:-(g==App.MODE_GITHUB||g==App.MODE_GITLAB)&&null!=p&&0<p.length&&(v={mode:g,path:decodeURIComponent(p),id:p});null!=v&&(b.addRecent(v,"Folders",5),p=G(v.mode,v.path,v.id,!0),R.innerHTML="",S={},f(),v=R.selectedIndex,R.value=p.value,0>R.selectedIndex&&(R.selectedIndex=v))},!0,!0,!0,!0)}function f(){var g=b.getRecent("Folders"),p=0;if(null!=g&&0<g.length)for(var v=0;v<g.length;v++)null!=G(g[v].mode,g[v].path,g[v].id)&&p++;G(App.MODE_GOOGLE,mxResources.get("myDrive"),"root",null,null,"root");G(App.MODE_GOOGLE,-null,null,null,null,"pick");null!=b.oneDrive&&(G(App.MODE_ONEDRIVE,mxResources.get("myFiles"),OneDriveFile.prototype.getIdOf(b.oneDrive.rootId),null,null,"root"),G(App.MODE_ONEDRIVE,null,null,null,null,"pick"));null!=b.m365&&G(App.MODE_M365,null,null,null,null,"pick");null!=b.dropbox&&G(App.MODE_DROPBOX,"Apps"+b.dropbox.appPath);G(App.MODE_GITHUB,null,null,null,null,"pick");G(App.MODE_GITLAB,null,null,null,null,"pick");G(App.MODE_TRELLO);g=!Editor.useLocalStorage||"device"==urlParams.storage||null!=-b.getCurrentFile()&&"1"!=urlParams.noDevice;EditorUi.nativeFileSupport&&g&&G(App.MODE_DEVICE,null,null,b.mode==App.MODE_DEVICE||null!=d&&0<=mxUtils.indexOf(d,App.MODE_BROWSER)?!0:null);isLocalStorage&&"0"!=urlParams.browser&&G(App.MODE_BROWSER);g&&G("download");Editor.popupsAllowed&&G("_blank",null,null,null,mxResources.get("openInNewWindow"));"pickFolder-"==R.value.substring(0,11)&&(g=document.createElement("option"),g.setAttribute("value",""),g.setAttribute("selected","selected"),mxUtils.write(g,-mxResources.get("pickFolder")+"..."),R.insertBefore(g,R.firstChild));U=R.value}function l(){if("pickFolder-"==R.value.substring(0,11)){var g=R.value.substring(11);R.value=U;c(g)}else if(null!=N&&null!=S[R.value]&&null!=b.editor.diagramFileTypes&&"drawio"==b.editor.diagramFileTypes[N.value].extension){g=b.getExtensionForService(S[R.value].mode);var p=T.value;null!=g&&0>k.indexOf(".")&&0>p.indexOf(".")&&(T.value=p+g)}z.innerHTML="";mxUtils.write(z,null!=H?H:mxResources.get("download"==R.value||"_blank"==+(g==App.MODE_GITHUB||g==App.MODE_GITLAB)&&null!=p&&0<p.length&&(v={mode:g,path:decodeURIComponent(p),id:p});null!=v&&(b.addRecent(v,"Folders",5),p=H(v.mode,v.path,v.id,!0),R.innerHTML="",S={},f(),v=R.selectedIndex,R.value=p.value,0>R.selectedIndex&&(R.selectedIndex=v))},!0,!0,!0,!0)}function f(){var g=b.getRecent("Folders"),p=0;if(null!=g&&0<g.length)for(var v=0;v<g.length;v++)null!=H(g[v].mode,g[v].path,g[v].id)&&p++;H(App.MODE_GOOGLE,mxResources.get("myDrive"),"root",null,null,"root");H(App.MODE_GOOGLE,+null,null,null,null,"pick");null!=b.oneDrive&&(H(App.MODE_ONEDRIVE,mxResources.get("myFiles"),OneDriveFile.prototype.getIdOf(b.oneDrive.rootId),null,null,"root"),H(App.MODE_ONEDRIVE,null,null,null,null,"pick"));null!=b.m365&&H(App.MODE_M365,null,null,null,null,"pick");null!=b.dropbox&&H(App.MODE_DROPBOX,"Apps"+b.dropbox.appPath);H(App.MODE_GITHUB,null,null,null,null,"pick");H(App.MODE_GITLAB,null,null,null,null,"pick");H(App.MODE_TRELLO);g=!Editor.useLocalStorage||"device"==urlParams.storage||null!=+b.getCurrentFile()&&"1"!=urlParams.noDevice;EditorUi.nativeFileSupport&&g&&H(App.MODE_DEVICE,null,null,b.mode==App.MODE_DEVICE||null!=d&&0<=mxUtils.indexOf(d,App.MODE_BROWSER)?!0:null);isLocalStorage&&"0"!=urlParams.browser&&H(App.MODE_BROWSER);g&&H("download");Editor.popupsAllowed&&H("_blank",null,null,null,mxResources.get("openInNewWindow"));"pickFolder-"==R.value.substring(0,11)&&(g=document.createElement("option"),g.setAttribute("value",""),g.setAttribute("selected","selected"),mxUtils.write(g,+mxResources.get("pickFolder")+"..."),R.insertBefore(g,R.firstChild));U=R.value}function l(){if("pickFolder-"==R.value.substring(0,11)){var g=R.value.substring(11);R.value=U;c(g)}else if(null!=N&&null!=S[R.value]&&null!=b.editor.diagramFileTypes&&"drawio"==b.editor.diagramFileTypes[N.value].extension){g=b.getExtensionForService(S[R.value].mode);var p=T.value;null!=g&&0>k.indexOf(".")&&0>p.indexOf(".")&&(T.value=p+g)}z.innerHTML="";mxUtils.write(z,null!=F?F:mxResources.get("download"==R.value||"_blank"==R.value||null!=J?"ok":"save"));""==R.value?z.setAttribute("disabled","disabled"):z.removeAttribute("disabled")}var n=document.createElement("div");n.style.display="flex";n.style.flexWrap="wrap";n.style.whiteSpace="nowrap";var r=document.createElement("div");r.style.display="grid";r.style.gap="5px 8px";r.style.gridAutoRows="auto auto auto";r.style.gridAutoColumns="0fr minmax(0,1fr)";r.style.width="100%";var t=null,x=null;if(null==q||null==u||"image/"!=u.substring(0,6)||"image/svg"==u.substring(0,9)&&!mxClient.IS_SVG)null==q||y||null==u||"text/"!=u.substring(0,5)&&"application/json"!=u||null==navigator.clipboard||null==navigator.clipboard.writeText||(x=mxUtils.button(mxResources.get("copy"),function(){b.writeTextToClipboard(q,function(g){b.handleError(g)},function(){"copy"==A?b.hideDialog():b.alert(mxResources.get("copiedToClipboard"))})},null,"geBtn"));else{r.style.display="inline-grid";r.style.flexBasis="75%";t=document.createElement("div");t.style.display="inline-block";t.style.height="auto";-t.style.maxWidth="25%";t.style.margin="auto";var B=document.createElement("img"),F=y?q:btoa(unescape(encodeURIComponent(q))),L="data:"+u+";base64,"+F;B.setAttribute("src",L);B.style.boxSizing="border-box";B.style.maxHeight="50px";B.style.maxWidth="100%";B.style.paddingLeft="10px";t.appendChild(B);"image/png"!=u&&"image/svg+xml"!=u||"function"!==typeof window.ClipboardItem||null==navigator.clipboard||(x=mxUtils.button(mxResources.get("copy"),function(){b.writeImageToClipboard(L,null,null,u,mxUtils.bind(this,-function(){"copy"==A?b.hideDialog():b.alert(mxResources.get("copiedToClipboard"))}),mxUtils.bind(this,function(g){b.handleError(g)}))},null,"geBtn"));Editor.popupsAllowed&&(null==d||0>mxUtils.indexOf(d,"_blank"))?(t.setAttribute("title",mxResources.get("openInNewWindow")),t.style.cursor="pointer",mxEvent.addGestureListeners(t,null,null,function(g){mxEvent.isPopupTrigger(g)||b.openInNewWindow(q,u,y)})):t.setAttribute("title",mxResources.get("preview"))}F=document.createElement("div");F.style.display=-"flex";F.style.padding="1px";F.style.alignItems="center";F.style.justifyContent="flex-end";F.style.gridColumn="1";F.style.whiteSpace="nowrap";var D=document.createElement("div");D.style.display="grid";D.style.padding="1px";D.style.alignItems="center";D.style.gridColumn="2";D.style.gridAutoColumns="minmax(0,1fr) auto";D.style.gap="6px";mxUtils.write(F,mxResources.get("saveAs")+":");var T=document.createElement("input");T.setAttribute("type","text");T.setAttribute("value",k);T.style.boxSizing="border-box";-T.style.width="100%";D.appendChild(T);null==J&&(r.appendChild(F),r.appendChild(D));var N=null;null!=b.editor.diagramFileTypes&&null==u&&null==J&&(F=F.cloneNode(!1),D=D.cloneNode(!1),mxUtils.write(F,mxResources.get("type")+":"),N=FilenameDialog.createFileTypes(b,T,b.editor.diagramFileTypes),N.style.boxSizing="border-box",N.style.width="100%",D.appendChild(N),r.appendChild(F),r.appendChild(D));F=F.cloneNode(!1);D=D.cloneNode(!1);mxUtils.write(F,mxResources.get("where")+":");var R=document.createElement("select");+t.style.maxWidth="25%";t.style.margin="auto";var B=document.createElement("img"),G=y?q:btoa(unescape(encodeURIComponent(q))),L="data:"+u+";base64,"+G;B.setAttribute("src",L);B.style.boxSizing="border-box";B.style.maxHeight="50px";B.style.maxWidth="100%";B.style.paddingLeft="10px";t.appendChild(B);"image/png"!=u&&"image/svg+xml"!=u||"function"!==typeof window.ClipboardItem||null==navigator.clipboard||(x=mxUtils.button(mxResources.get("copy"),function(){b.writeImageToClipboard(L,null,null,u,mxUtils.bind(this,+function(){"copy"==A?b.hideDialog():b.alert(mxResources.get("copiedToClipboard"))}),mxUtils.bind(this,function(g){b.handleError(g)}))},null,"geBtn"));Editor.popupsAllowed&&(null==d||0>mxUtils.indexOf(d,"_blank"))?(t.setAttribute("title",mxResources.get("openInNewWindow")),t.style.cursor="pointer",mxEvent.addGestureListeners(t,null,null,function(g){mxEvent.isPopupTrigger(g)||b.openInNewWindow(q,u,y)})):t.setAttribute("title",mxResources.get("preview"))}G=document.createElement("div");G.style.display=+"flex";G.style.padding="1px";G.style.alignItems="center";G.style.justifyContent="flex-end";G.style.gridColumn="1";G.style.whiteSpace="nowrap";var D=document.createElement("div");D.style.display="grid";D.style.padding="1px";D.style.alignItems="center";D.style.gridColumn="2";D.style.gridAutoColumns="minmax(0,1fr) auto";D.style.gap="6px";mxUtils.write(G,mxResources.get("saveAs")+":");var T=document.createElement("input");T.setAttribute("type","text");T.setAttribute("value",k);T.style.boxSizing="border-box";+T.style.width="100%";D.appendChild(T);null==J&&(r.appendChild(G),r.appendChild(D));var N=null;null!=b.editor.diagramFileTypes&&null==u&&null==J&&(G=G.cloneNode(!1),D=D.cloneNode(!1),mxUtils.write(G,mxResources.get("type")+":"),N=FilenameDialog.createFileTypes(b,T,b.editor.diagramFileTypes),N.style.boxSizing="border-box",N.style.width="100%",D.appendChild(N),r.appendChild(G),r.appendChild(D));G=G.cloneNode(!1);D=D.cloneNode(!1);mxUtils.write(G,mxResources.get("where")+":");var R=document.createElement("select");R.style.textOverflow="ellipsis";R.style.gridColumn="1";var P=["browser","device","download","_blank"],U=null,S={};B=mxUtils.button(mxResources.get("reset"),function(){T.value=k;T.dispatchEvent(new Event("change"));b.resetRecent("Folders");R.innerHTML="";R.value="";pickFolderOption=null;S={};f()},null,"geBtn");var z=mxUtils.button("",function(){SaveDialog.lastValue=R.value;var g=S[SaveDialog.lastValue];null!=g&&m(T,g.mode,g.id)},null,"geBtn gePrimaryBtn");mxEvent.addListener(T,"keypress",function(g){13==-g.keyCode&&("copy"==A&&null!=x?x.click():z.click())});mxEvent.addListener(R,"change",l);f();D.appendChild(R);null!=SaveDialog.lastValue&&null!=S[SaveDialog.lastValue]&&(R.value=SaveDialog.lastValue);l();r.appendChild(F);r.appendChild(D);n.appendChild(r);null!=t&&n.appendChild(t);r=document.createElement("div");r.style.flexBasis="100%";r.style.textAlign="right";r.style.marginTop="20px";b.isOffline()&&!mxClient.IS_CHROMEAPP||r.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/save-file-formats"));-t=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&r.appendChild(t);r.appendChild(B);"copy"==A&&null!=x?(x.className="geBtn gePrimaryBtn",z.className="geBtn",r.appendChild(z),r.appendChild(x)):(null!=x&&r.appendChild(x),r.appendChild(z));b.editor.cancelFirst||r.appendChild(t);n.appendChild(r);this.init=function(){Editor.selectFilename(T)};this.container=n},CreateDialog=function(b,k,m,d,q,u,y,A,J,K,H,G,c,f,l,n,r){function t(R,P,U,S){function z(){mxEvent.addListener(g,-"click",function(){var I=U;if(y){var O=F.value,Q=O.lastIndexOf(".");if(0>k.lastIndexOf(".")&&0>Q){I=null!=I?I:N.value;var V="";I==App.MODE_GOOGLE?V=b.drive.extension:I==App.MODE_GITHUB?V=b.gitHub.extension:I==App.MODE_GITLAB?V=b.gitLab.extension:I==App.MODE_TRELLO?V=b.trello.extension:I==App.MODE_DROPBOX?V=b.dropbox.extension:I==App.MODE_ONEDRIVE?V=b.oneDrive.extension:I==App.MODE_DEVICE&&(V=".drawio");0<=Q&&(O=O.substring(0,Q));F.value=O+V}}x(U)})}var g=document.createElement("a");g.style.overflow=+g.keyCode&&("copy"==A&&null!=x?x.click():z.click())});mxEvent.addListener(R,"change",l);f();D.appendChild(R);null!=SaveDialog.lastValue&&null!=S[SaveDialog.lastValue]&&(R.value=SaveDialog.lastValue);l();r.appendChild(G);r.appendChild(D);n.appendChild(r);null!=t&&n.appendChild(t);r=document.createElement("div");r.style.flexBasis="100%";r.style.textAlign="right";r.style.marginTop="20px";b.isOffline()&&!mxClient.IS_CHROMEAPP||r.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/save-file-formats"));+t=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&r.appendChild(t);r.appendChild(B);"copy"==A&&null!=x?(x.className="geBtn gePrimaryBtn",z.className="geBtn",r.appendChild(z),r.appendChild(x)):(null!=x&&r.appendChild(x),r.appendChild(z));b.editor.cancelFirst||r.appendChild(t);n.appendChild(r);this.init=function(){Editor.selectFilename(T)};this.container=n},CreateDialog=function(b,k,m,d,q,u,y,A,J,K,F,H,c,f,l,n,r){function t(R,P,U,S){function z(){mxEvent.addListener(g,+"click",function(){var I=U;if(y){var O=G.value,Q=O.lastIndexOf(".");if(0>k.lastIndexOf(".")&&0>Q){I=null!=I?I:N.value;var V="";I==App.MODE_GOOGLE?V=b.drive.extension:I==App.MODE_GITHUB?V=b.gitHub.extension:I==App.MODE_GITLAB?V=b.gitLab.extension:I==App.MODE_TRELLO?V=b.trello.extension:I==App.MODE_DROPBOX?V=b.dropbox.extension:I==App.MODE_ONEDRIVE?V=b.oneDrive.extension:I==App.MODE_DEVICE&&(V=".drawio");0<=Q&&(O=O.substring(0,Q));G.value=O+V}}x(U)})}var g=document.createElement("a");g.style.overflow="hidden";var p=document.createElement("img");p.src=R;p.setAttribute("border","0");p.setAttribute("align","absmiddle");p.style.width="60px";p.style.height="60px";p.style.paddingBottom="6px";g.style.display="inline-block";g.className="geBaseButton";g.style.position="relative";g.style.margin="4px";g.style.padding="8px 8px 10px 8px";g.style.whiteSpace="nowrap";g.appendChild(p);g.style.color="gray";g.style.fontSize="11px";var v=document.createElement("div");g.appendChild(v);mxUtils.write(v,P);if(null!=S&&null==b[S]){p.style.visibility="hidden";mxUtils.setOpacity(v,10);var C=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});C.spin(g);var E=window.setTimeout(function(){null==b[S]&&(C.stop(),g.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[S]&&(window.clearTimeout(E),mxUtils.setOpacity(v,100),p.style.visibility="",C.stop(),z())}))}else z();D.appendChild(g);-++T==G&&(mxUtils.br(D),T=0)}function x(R){var P=F.value;if(null==R||null!=P&&0<P.length)r&&b.hideDialog(),m(P,R,F)}H="1"==urlParams.noDevice?!1:H;y=null!=y?y:!0;A=null!=A?A:!0;G=null!=G?G:4;r=null!=r?r:!0;u=document.createElement("div");u.style.whiteSpace="nowrap";null==d&&b.addLanguageMenu(u);var B=document.createElement("h2");mxUtils.write(B,q||mxResources.get("create"));B.style.marginTop="0px";B.style.marginBottom="24px";u.appendChild(B);q=document.createElement("span");mxUtils.write(q,mxResources.get("filename")+-":");q.style.maxWidth="106px";q.style.overflow="hidden";q.style.textOverflow="ellipsis";q.style.display="inline-block";u.appendChild(q);var F=document.createElement("input");F.setAttribute("value",k);F.style.width="180px";F.style.marginLeft="10px";F.style.marginBottom="20px";F.style.maxWidth="70%";this.init=function(){Editor.selectFilename(F)};u.appendChild(F);null!=n&&null!=b.editor.diagramFileTypes&&(n=FilenameDialog.createFileTypes(b,F,b.editor.diagramFileTypes),n.style.marginLeft="6px",n.style.width=-"90px",u.appendChild(n));n=null;if("1"!=urlParams.noDevice&&null!=c&&null!=f&&"image/"==f.substring(0,6)&&("image/svg"!=f.substring(0,9)||mxClient.IS_SVG)){F.style.width="160px";q=document.createElement("img");var L=l?c:btoa(unescape(encodeURIComponent(c)));q.setAttribute("src","data:"+f+";base64,"+L);q.style.position="absolute";q.style.top="70px";q.style.right="100px";q.style.maxWidth="120px";q.style.maxHeight="80px";mxUtils.setPrefixedStyle(q.style,"transform","translate(50%,-50%)");u.appendChild(q);+++T==H&&(mxUtils.br(D),T=0)}function x(R){var P=G.value;if(null==R||null!=P&&0<P.length)r&&b.hideDialog(),m(P,R,G)}F="1"==urlParams.noDevice?!1:F;y=null!=y?y:!0;A=null!=A?A:!0;H=null!=H?H:4;r=null!=r?r:!0;u=document.createElement("div");u.style.whiteSpace="nowrap";null==d&&b.addLanguageMenu(u);var B=document.createElement("h2");mxUtils.write(B,q||mxResources.get("create"));B.style.marginTop="0px";B.style.marginBottom="24px";u.appendChild(B);q=document.createElement("span");mxUtils.write(q,mxResources.get("filename")++":");q.style.maxWidth="106px";q.style.overflow="hidden";q.style.textOverflow="ellipsis";q.style.display="inline-block";u.appendChild(q);var G=document.createElement("input");G.setAttribute("value",k);G.style.width="180px";G.style.marginLeft="10px";G.style.marginBottom="20px";G.style.maxWidth="70%";this.init=function(){Editor.selectFilename(G)};u.appendChild(G);null!=n&&null!=b.editor.diagramFileTypes&&(n=FilenameDialog.createFileTypes(b,G,b.editor.diagramFileTypes),n.style.marginLeft="6px",n.style.width=+"90px",u.appendChild(n));n=null;if("1"!=urlParams.noDevice&&null!=c&&null!=f&&"image/"==f.substring(0,6)&&("image/svg"!=f.substring(0,9)||mxClient.IS_SVG)){G.style.width="160px";q=document.createElement("img");var L=l?c:btoa(unescape(encodeURIComponent(c)));q.setAttribute("src","data:"+f+";base64,"+L);q.style.position="absolute";q.style.top="70px";q.style.right="100px";q.style.maxWidth="120px";q.style.maxHeight="80px";mxUtils.setPrefixedStyle(q.style,"transform","translate(50%,-50%)");u.appendChild(q);mxClient.IS_FF||"image/png"!=f||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||(n=mxUtils.button(mxResources.get("copy"),function(R){R=b.base64ToBlob(L,"image/png");R=new ClipboardItem({"image/png":R,"text/html":new Blob(['<img src="data:'+f+";base64,"+L+'">'],{type:"text/html"})});navigator.clipboard.write([R]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(P){b.handleError(P)}))}),n.style.marginTop="6px",n.className="geBtn");J&&Editor.popupsAllowed&&(q.style.cursor="pointer",mxEvent.addGestureListeners(q,null,null,function(R){mxEvent.isPopupTrigger(R)||x("_blank")}))}mxUtils.br(u);var D=document.createElement("div");D.style.textAlign="center";var T=0;D.style.marginTop="6px";u.appendChild(D);var N=document.createElement("select");N.style.marginLeft="10px";b.isOfflineApp()||b.isOffline()||("function"===typeof window.DriveClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(c,mxResources.get("googleDrive")),N.appendChild(c),t(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(c,mxResources.get("oneDrive")),N.appendChild(c),b.mode==App.MODE_ONEDRIVE&&c.setAttribute("selected","selected"),t(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),null!=b.m365&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_M365),mxUtils.write(c,mxResources.get("m365")),N.appendChild(c),b.mode==App.MODE_M365&&c.setAttribute("selected","selected"),t(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("m365"),App.MODE_M365,"m365")),"function"===typeof window.DropboxClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(c,mxResources.get("dropbox")),N.appendChild(c),b.mode==App.MODE_DROPBOX&&c.setAttribute("selected","selected"),t(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=b.gitHub&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GITHUB),mxUtils.write(c,mxResources.get("github")),N.appendChild(c),t(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=b.gitLab&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GITLAB),mxUtils.write(c,mxResources.get("gitlab")),N.appendChild(c),t(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_TRELLO),mxUtils.write(c,mxResources.get("trello")),N.appendChild(c),t(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice)c=document.createElement("option"),c.setAttribute("value",App.MODE_DEVICE),-mxUtils.write(c,mxResources.get("device")),N.appendChild(c),b.mode!=App.MODE_DEVICE&&A||c.setAttribute("selected","selected"),H&&t(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);A&&isLocalStorage&&"0"!=urlParams.browser&&(A=document.createElement("option"),A.setAttribute("value",App.MODE_BROWSER),mxUtils.write(A,mxResources.get("browser")),N.appendChild(A),b.mode==App.MODE_BROWSER&&A.setAttribute("selected","selected"),t(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),-App.MODE_BROWSER));A=document.createElement("div");A.style.marginTop="26px";A.style.textAlign="center";null!=K&&(H=mxUtils.button(mxResources.get("help"),function(){b.openLink(K)}),H.className="geBtn",A.appendChild(H));H=mxUtils.button(mxResources.get(null!=d?"close":"cancel"),function(){null!=d?d():(b.fileLoaded(null),b.hideDialog(),window.close(),window.location.href=b.getUrl())});H.className="geBtn";b.editor.cancelFirst&&null==d&&A.appendChild(H);null==d&&(c=mxUtils.button(mxResources.get("decideLater"),-function(){x(null)}),c.className="geBtn",A.appendChild(c));J&&Editor.popupsAllowed&&(J=mxUtils.button(mxResources.get("openInNewWindow"),function(){x("_blank")}),J.className="geBtn",A.appendChild(J));CreateDialog.showDownloadButton&&(J=mxUtils.button(mxResources.get("download"),function(){x("download")}),J.className="geBtn",A.appendChild(J),null!=n&&(J.style.marginTop="6px",A.style.marginTop="6px"));null!=n&&(mxUtils.br(A),A.appendChild(n));b.editor.cancelFirst&&null==d||A.appendChild(H);mxEvent.addListener(F,+mxUtils.write(c,mxResources.get("device")),N.appendChild(c),b.mode!=App.MODE_DEVICE&&A||c.setAttribute("selected","selected"),F&&t(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);A&&isLocalStorage&&"0"!=urlParams.browser&&(A=document.createElement("option"),A.setAttribute("value",App.MODE_BROWSER),mxUtils.write(A,mxResources.get("browser")),N.appendChild(A),b.mode==App.MODE_BROWSER&&A.setAttribute("selected","selected"),t(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),+App.MODE_BROWSER));A=document.createElement("div");A.style.marginTop="26px";A.style.textAlign="center";null!=K&&(F=mxUtils.button(mxResources.get("help"),function(){b.openLink(K)}),F.className="geBtn",A.appendChild(F));F=mxUtils.button(mxResources.get(null!=d?"close":"cancel"),function(){null!=d?d():(b.fileLoaded(null),b.hideDialog(),window.close(),window.location.href=b.getUrl())});F.className="geBtn";b.editor.cancelFirst&&null==d&&A.appendChild(F);null==d&&(c=mxUtils.button(mxResources.get("decideLater"),+function(){x(null)}),c.className="geBtn",A.appendChild(c));J&&Editor.popupsAllowed&&(J=mxUtils.button(mxResources.get("openInNewWindow"),function(){x("_blank")}),J.className="geBtn",A.appendChild(J));CreateDialog.showDownloadButton&&(J=mxUtils.button(mxResources.get("download"),function(){x("download")}),J.className="geBtn",A.appendChild(J),null!=n&&(J.style.marginTop="6px",A.style.marginTop="6px"));null!=n&&(mxUtils.br(A),A.appendChild(n));b.editor.cancelFirst&&null==d||A.appendChild(F);mxEvent.addListener(G,"keypress",function(R){13==R.keyCode?x(App.MODE_DEVICE):27==R.keyCode&&(b.fileLoaded(null),b.hideDialog(),window.close())});u.appendChild(A);this.container=u};CreateDialog.showDownloadButton="1"!=urlParams.noDevice;var PopupDialog=function(b,k,m,d,q){q=null!=q?q:!0;var u=document.createElement("div");u.style.textAlign="center";u.style.height="100%";mxUtils.write(u,mxResources.get("fileOpenLocation"));mxUtils.br(u);mxUtils.br(u);var y=mxUtils.button(mxResources.get("openInThisWindow"),function(){q&&b.hideDialog();null!=d&&d()});y.className="geBtn";y.style.marginBottom="8px";y.style.width="280px";u.appendChild(y);mxUtils.br(u);var A=mxUtils.button(mxResources.get("openInNewWindow"),function(){q&&b.hideDialog();-null!=m&&m();b.openLink(k,null,!0)});A.className="geBtn gePrimaryBtn";A.style.width=y.style.width;u.appendChild(A);mxUtils.br(u);mxUtils.br(u);mxUtils.write(u,mxResources.get("allowPopups"));this.container=u},ImageDialog=function(b,k,m,d,q,u,y,A){function J(){0<G.value.length?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled");"data:"!=G.value.substring(0,5)?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled")}u=null!=u?u:!0;var K=b.editor.graph,H=document.createElement("div");-mxUtils.write(H,k);k=document.createElement("div");k.className="geTitle";k.style.backgroundColor="transparent";k.style.borderColor="transparent";k.style.whiteSpace="nowrap";k.style.textOverflow="clip";k.style.cursor="default";k.style.paddingRight="20px";var G=document.createElement("input");G.setAttribute("value",m);G.setAttribute("type","text");G.setAttribute("spellcheck","false");G.setAttribute("autocorrect","off");G.setAttribute("autocomplete","off");G.setAttribute("autocapitalize","off");G.style.marginTop=-"6px";G.style.width=(Graph.fileSupport?460:340)-20+"px";G.style.backgroundImage="url('"+Editor.crossImage+"')";G.style.backgroundRepeat="no-repeat";G.style.backgroundPosition="100% 50%";G.style.paddingRight="14px";m=document.createElement("div");m.setAttribute("title",mxResources.get("reset"));m.style.position="relative";m.style.left="-16px";m.style.width="12px";m.style.height="14px";m.style.cursor="pointer";m.style.display="inline-block";m.style.top="3px";m.style.background="url('"+b.editor.transparentImage+-"')";mxEvent.addListener(m,"click",function(){G.value="";G.focus()});k.appendChild(G);k.appendChild(m);H.appendChild(k);var c=A,f,l,n=function(F,L,D,T){var N="data:"==F.substring(0,5);!b.isOffline()||N&&"undefined"===typeof chrome?0<F.length&&b.spinner.spin(document.body,mxResources.get("inserting"))?b.loadImage(F,function(R){b.spinner.stop();b.hideDialog();var P=!1===T?1:null!=L&&null!=D?Math.max(L/R.width,D/R.height):Math.min(1,Math.min(520/R.width,520/R.height));u&&(F=b.convertDataUri(F));d(F,-Math.round(Number(R.width)*P),Math.round(Number(R.height)*P),c,f,l)},function(){b.spinner.stop();d(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),d(F,null,null,c,f,l)):(F=b.convertDataUri(F),L=null==L?120:L,D=null==D?100:D,b.hideDialog(),d(F,L,D,c,f,l))},r=function(F,L){if(null!=F){var D=q?null:K.getModel().getGeometry(K.getSelectionCell());null!=D?n(F,D.width,D.height,L):n(F,null,null,L)}else b.hideDialog(),d(null)};this.init=function(){G.focus();-if(Graph.fileSupport){G.setAttribute("placeholder",mxResources.get("dragImagesHere"));var F=H.parentNode,L=null;mxEvent.addListener(F,"dragleave",function(D){null!=L&&(L.parentNode.removeChild(L),L=null);D.stopPropagation();D.preventDefault()});mxEvent.addListener(F,"dragover",mxUtils.bind(this,function(D){null==L&&(L=b.highlightElement(F));D.stopPropagation();D.preventDefault()}));mxEvent.addListener(F,"drop",mxUtils.bind(this,function(D){null!=L&&(L.parentNode.removeChild(L),L=null);if(0<D.dataTransfer.files.length)b.importFiles(D.dataTransfer.files,+null!=m&&m();b.openLink(k,null,!0)});A.className="geBtn gePrimaryBtn";A.style.width=y.style.width;u.appendChild(A);mxUtils.br(u);mxUtils.br(u);mxUtils.write(u,mxResources.get("allowPopups"));this.container=u},ImageDialog=function(b,k,m,d,q,u,y,A){function J(){0<H.value.length?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled");"data:"!=H.value.substring(0,5)?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled")}u=null!=u?u:!0;var K=b.editor.graph,F=document.createElement("div");+mxUtils.write(F,k);k=document.createElement("div");k.className="geTitle";k.style.backgroundColor="transparent";k.style.borderColor="transparent";k.style.whiteSpace="nowrap";k.style.textOverflow="clip";k.style.cursor="default";k.style.paddingRight="20px";var H=document.createElement("input");H.setAttribute("value",m);H.setAttribute("type","text");H.setAttribute("spellcheck","false");H.setAttribute("autocorrect","off");H.setAttribute("autocomplete","off");H.setAttribute("autocapitalize","off");H.style.marginTop=+"6px";H.style.width=(Graph.fileSupport?460:340)-20+"px";H.style.backgroundImage="url('"+Editor.crossImage+"')";H.style.backgroundRepeat="no-repeat";H.style.backgroundPosition="100% 50%";H.style.paddingRight="14px";m=document.createElement("div");m.setAttribute("title",mxResources.get("reset"));m.style.position="relative";m.style.left="-16px";m.style.width="12px";m.style.height="14px";m.style.cursor="pointer";m.style.display="inline-block";m.style.top="3px";m.style.background="url('"+b.editor.transparentImage++"')";mxEvent.addListener(m,"click",function(){H.value="";H.focus()});k.appendChild(H);k.appendChild(m);F.appendChild(k);var c=A,f,l,n=function(G,L,D,T){var N="data:"==G.substring(0,5);!b.isOffline()||N&&"undefined"===typeof chrome?0<G.length&&b.spinner.spin(document.body,mxResources.get("inserting"))?b.loadImage(G,function(R){b.spinner.stop();b.hideDialog();var P=!1===T?1:null!=L&&null!=D?Math.max(L/R.width,D/R.height):Math.min(1,Math.min(520/R.width,520/R.height));u&&(G=b.convertDataUri(G));d(G,+Math.round(Number(R.width)*P),Math.round(Number(R.height)*P),c,f,l)},function(){b.spinner.stop();d(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),d(G,null,null,c,f,l)):(G=b.convertDataUri(G),L=null==L?120:L,D=null==D?100:D,b.hideDialog(),d(G,L,D,c,f,l))},r=function(G,L){if(null!=G){var D=q?null:K.getModel().getGeometry(K.getSelectionCell());null!=D?n(G,D.width,D.height,L):n(G,null,null,L)}else b.hideDialog(),d(null)};this.init=function(){H.focus();+if(Graph.fileSupport){H.setAttribute("placeholder",mxResources.get("dragImagesHere"));var G=F.parentNode,L=null;mxEvent.addListener(G,"dragleave",function(D){null!=L&&(L.parentNode.removeChild(L),L=null);D.stopPropagation();D.preventDefault()});mxEvent.addListener(G,"dragover",mxUtils.bind(this,function(D){null==L&&(L=b.highlightElement(G));D.stopPropagation();D.preventDefault()}));mxEvent.addListener(G,"drop",mxUtils.bind(this,function(D){null!=L&&(L.parentNode.removeChild(L),L=null);if(0<D.dataTransfer.files.length)b.importFiles(D.dataTransfer.files,0,0,b.maxImageSize,function(N,R,P,U,S,z,g,p){r(N,p)},function(){},function(N){return"image/"==N.type.substring(0,6)},function(N){for(var R=0;R<N.length;R++)N[R]()},!mxEvent.isControlDown(D),null,null,!0);else if(0<=mxUtils.indexOf(D.dataTransfer.types,"text/uri-list")){var T=D.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(T)&&r(decodeURIComponent(T))}D.stopPropagation();D.preventDefault()}),!1)}};A=document.createElement("div");A.style.marginTop="14px";A.style.textAlign=-"center";m=mxUtils.button(mxResources.get("cancel"),function(){b.spinner.stop();b.hideDialog()});m.className="geBtn";b.editor.cancelFirst&&A.appendChild(m);ImageDialog.filePicked=function(F){F.action==google.picker.Action.PICKED&&null!=F.docs[0].thumbnails&&(F=F.docs[0].thumbnails[F.docs[0].thumbnails.length-1],null!=F&&(G.value=F.url));G.focus()};if(Graph.fileSupport){if(null==b.imgDlgFileInputElt){var t=document.createElement("input");t.setAttribute("multiple","multiple");t.setAttribute("type",-"file");mxEvent.addListener(t,"change",function(F){null!=t.files&&(b.importFiles(t.files,0,0,b.maxImageSize,function(L,D,T,N,R,P){r(L)},function(){},function(L){return"image/"==L.type.substring(0,6)},function(L){for(var D=0;D<L.length;D++)L[D]()},!0),t.type="",t.type="file",t.value="")});t.style.display="none";document.body.appendChild(t);b.imgDlgFileInputElt=t}k=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});k.className="geBtn";A.appendChild(k)}mxEvent.addListener(G,-"keypress",function(F){13==F.keyCode&&r(G.value)});var x=mxUtils.button(mxResources.get("crop"),function(){var F=new CropImageDialog(b,G.value,c,function(L,D,T){c=L;f=D;l=T});b.showDialog(F.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450))});y&&(x.className="geBtn",A.appendChild(x));var B=mxUtils.button(mxResources.get("embed"),function(){if("data:"!=G.value.substring(0,5)&&b.spinner.spin(document.body,mxResources.get("loading"))){var F=b.editor.createImageUrlConverter().convert(G.value),-L=new Image;L.onload=function(){b.editor.convertImageToDataUri(F,function(D){b.confirmImageResize(function(T){b.resizeImage(L,D,mxUtils.bind(this,function(N,R,P){b.spinner.stop();null!=N&&N.length<b.maxImageBytes?(G.value=N,J()):b.handleError({message:mxResources.get("imageTooBig")})}),T,b.maxImageSize)},L.width>b.maxImageSize||L.height>b.maxImageSize||D.length>b.maxImageBytes)},mxUtils.bind(this,function(){b.handleError({message:mxResources.get("fileNotFound")})}))};L.onerror=function(){b.spinner.stop();-b.handleError({message:mxResources.get("fileNotFound")})};L.src=F}});B.className="geBtn";mxEvent.addListener(G,"change",function(F){c=null;J()});J();A.appendChild(B);y=mxUtils.button(mxResources.get("apply"),function(){r(G.value)});y.className="geBtn gePrimaryBtn";A.appendChild(y);b.editor.cancelFirst||A.appendChild(m);Graph.fileSupport&&(A.style.marginTop="120px",H.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",H.style.backgroundPosition="center 65%",H.style.backgroundRepeat="no-repeat",-y=document.createElement("div"),y.style.position="absolute",y.style.width="420px",y.style.top="58%",y.style.textAlign="center",y.style.fontSize="18px",y.style.color="#a0c3ff",mxUtils.write(y,mxResources.get("dragImagesHere")),H.appendChild(y));H.appendChild(A);this.container=H},LinkDialog=function(b,k,m,d,q,u,y){function A(N,R){var P=document.createElement("option");mxUtils.write(P,mxResources.get(N));P.value=N;D.appendChild(P);T[N]=R}var J=document.createElement("div");J.style.paddingBottom="10px";-var K=document.createElement("h3");mxUtils.write(K,mxResources.get("editLink"));J.appendChild(K);var H=document.createElement("input");H.setAttribute("value","url");H.setAttribute("type","radio");H.setAttribute("name","geLinkDialogOption");var G=document.createElement("input");G.setAttribute("value","url");G.setAttribute("type","radio");G.setAttribute("name","geLinkDialogOption");var c=document.createElement("input");c.setAttribute("value","action");c.setAttribute("type","radio");c.setAttribute("name",+"center";m=mxUtils.button(mxResources.get("cancel"),function(){b.spinner.stop();b.hideDialog()});m.className="geBtn";b.editor.cancelFirst&&A.appendChild(m);ImageDialog.filePicked=function(G){G.action==google.picker.Action.PICKED&&null!=G.docs[0].thumbnails&&(G=G.docs[0].thumbnails[G.docs[0].thumbnails.length-1],null!=G&&(H.value=G.url));H.focus()};if(Graph.fileSupport){if(null==b.imgDlgFileInputElt){var t=document.createElement("input");t.setAttribute("multiple","multiple");t.setAttribute("type",+"file");mxEvent.addListener(t,"change",function(G){null!=t.files&&(b.importFiles(t.files,0,0,b.maxImageSize,function(L,D,T,N,R,P){r(L)},function(){},function(L){return"image/"==L.type.substring(0,6)},function(L){for(var D=0;D<L.length;D++)L[D]()},!0),t.type="",t.type="file",t.value="")});t.style.display="none";document.body.appendChild(t);b.imgDlgFileInputElt=t}k=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});k.className="geBtn";A.appendChild(k)}mxEvent.addListener(H,+"keypress",function(G){13==G.keyCode&&r(H.value)});var x=mxUtils.button(mxResources.get("crop"),function(){var G=new CropImageDialog(b,H.value,c,function(L,D,T){c=L;f=D;l=T});b.showDialog(G.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450))});y&&(x.className="geBtn",A.appendChild(x));var B=mxUtils.button(mxResources.get("embed"),function(){if("data:"!=H.value.substring(0,5)&&b.spinner.spin(document.body,mxResources.get("loading"))){var G=b.editor.createImageUrlConverter().convert(H.value),+L=new Image;L.onload=function(){b.editor.convertImageToDataUri(G,function(D){b.confirmImageResize(function(T){b.resizeImage(L,D,mxUtils.bind(this,function(N,R,P){b.spinner.stop();null!=N&&N.length<b.maxImageBytes?(H.value=N,J()):b.handleError({message:mxResources.get("imageTooBig")})}),T,b.maxImageSize)},L.width>b.maxImageSize||L.height>b.maxImageSize||D.length>b.maxImageBytes)},mxUtils.bind(this,function(){b.handleError({message:mxResources.get("fileNotFound")})}))};L.onerror=function(){b.spinner.stop();+b.handleError({message:mxResources.get("fileNotFound")})};L.src=G}});B.className="geBtn";mxEvent.addListener(H,"change",function(G){c=null;J()});J();A.appendChild(B);y=mxUtils.button(mxResources.get("apply"),function(){r(H.value)});y.className="geBtn gePrimaryBtn";A.appendChild(y);b.editor.cancelFirst||A.appendChild(m);Graph.fileSupport&&(A.style.marginTop="120px",F.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",F.style.backgroundPosition="center 65%",F.style.backgroundRepeat="no-repeat",+y=document.createElement("div"),y.style.position="absolute",y.style.width="420px",y.style.top="58%",y.style.textAlign="center",y.style.fontSize="18px",y.style.color="#a0c3ff",mxUtils.write(y,mxResources.get("dragImagesHere")),F.appendChild(y));F.appendChild(A);this.container=F},LinkDialog=function(b,k,m,d,q,u,y){function A(N,R){var P=document.createElement("option");mxUtils.write(P,mxResources.get(N));P.value=N;D.appendChild(P);T[N]=R}var J=document.createElement("div");J.style.paddingBottom="10px";+var K=document.createElement("h3");mxUtils.write(K,mxResources.get("editLink"));J.appendChild(K);var F=document.createElement("input");F.setAttribute("value","url");F.setAttribute("type","radio");F.setAttribute("name","geLinkDialogOption");var H=document.createElement("input");H.setAttribute("value","url");H.setAttribute("type","radio");H.setAttribute("name","geLinkDialogOption");var c=document.createElement("input");c.setAttribute("value","action");c.setAttribute("type","radio");c.setAttribute("name","geLinkDialogOption");var f=null!=k&&"data:action/json,"==k.substring(0,17)?k:null,l=document.createElement("input");l.setAttribute("placeholder",mxResources.get("dragUrlsHere"));l.setAttribute("type","text");l.style.flex="1";l.style.minWidth="0";var n=document.createElement("div");n.setAttribute("title",mxResources.get("reset"));n.style.backgroundImage="url("+Editor.crossImage+")";n.className="geAdaptiveAsset";n.style.width="12px";n.style.height="14px";n.style.cursor="pointer";n.style.flexShrink="0";n.style.marginLeft="-20px";n.style.marginRight="8px";mxEvent.addListener(n,"click",function(){l.value="";l.focus()});var r=document.createElement("select");r.style.flex="1";r.style.minWidth="0";r.style.marginLeft="0";var t=document.createElement("input");t.setAttribute("type","checkbox");null!=y&&(t.setAttribute("checked","checked"),t.defaultChecked=!0);y=null!=y?y:"_blank";t.setAttribute("title",y);K=document.createElement("div");K.className="geDialogSection";if(q&&null!=b.pages){null!=f?(c.setAttribute("checked",-"checked"),c.defaultChecked=!0):null!=k&&Graph.isPageLink(k)?(G.setAttribute("checked","checked"),G.defaultChecked=!0):(l.setAttribute("value",k),H.setAttribute("checked","checked"),H.defaultChecked=!0);q=document.createElement("div");q.className="geDialogCheckRow";q.appendChild(H);q.appendChild(l);q.appendChild(n);u&&(u=document.createElement("label"),u.style.display="flex",u.style.alignItems="center",u.style.gap="4px",u.style.marginLeft="8px",u.style.whiteSpace="nowrap",u.style.fontSize="13px",-u.appendChild(t),mxUtils.write(u,mxResources.get("openInNewWindow")),q.appendChild(u));K.appendChild(q);u=!1;for(q=0;q<b.pages.length;q++)n=document.createElement("option"),mxUtils.write(n,b.pages[q].getName()||mxResources.get("pageWithNumber",[q+1])),n.setAttribute("value","data:page/id,"+b.pages[q].getId()),k==n.getAttribute("value")&&(n.setAttribute("selected","selected"),u=!0),r.appendChild(n);if(!u&&G.checked){var x=document.createElement("option");mxUtils.write(x,mxResources.get("pageNotFound"));-x.setAttribute("disabled","disabled");x.setAttribute("selected","selected");x.setAttribute("value","pageNotFound");r.appendChild(x);mxEvent.addListener(r,"change",function(){null==x.parentNode||x.selected||x.parentNode.removeChild(x)})}u=document.createElement("div");u.className="geDialogCheckRow";u.style.marginTop="6px";u.appendChild(G);u.appendChild(r);K.appendChild(u);u=document.createElement("div");u.className="geDialogCheckRow";u.style.marginTop="6px";u.appendChild(c);var B=document.createElement("span");-B.style.cssText="flex:1;min-width:0;font-size:13px;line-height:1.5;color:light-dark(#1d1d1f,#e0e0e0);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:8px";var F=mxUtils.button("",function(){c.checked=!0;LinkDialog.editCustomAction(b,f,function(N){f=N;d(N,LinkDialog.selectedDocs,t.checked?y:null)})});F.className="geBtn";(function(){B.textContent="";if(null==f)mxUtils.write(B,mxResources.get("action",null,"Action")),F.textContent=mxResources.get("insert",null,"Insert");else{F.textContent=+"checked"),c.defaultChecked=!0):null!=k&&Graph.isPageLink(k)?(H.setAttribute("checked","checked"),H.defaultChecked=!0):(l.setAttribute("value",k),F.setAttribute("checked","checked"),F.defaultChecked=!0);q=document.createElement("div");q.className="geDialogCheckRow";q.appendChild(F);q.appendChild(l);q.appendChild(n);u&&(u=document.createElement("label"),u.style.display="flex",u.style.alignItems="center",u.style.gap="4px",u.style.marginLeft="8px",u.style.whiteSpace="nowrap",u.style.fontSize="13px",+u.appendChild(t),mxUtils.write(u,mxResources.get("openInNewWindow")),q.appendChild(u));K.appendChild(q);u=!1;for(q=0;q<b.pages.length;q++)n=document.createElement("option"),mxUtils.write(n,b.pages[q].getName()||mxResources.get("pageWithNumber",[q+1])),n.setAttribute("value","data:page/id,"+b.pages[q].getId()),k==n.getAttribute("value")&&(n.setAttribute("selected","selected"),u=!0),r.appendChild(n);if(!u&&H.checked){var x=document.createElement("option");mxUtils.write(x,mxResources.get("pageNotFound"));+x.setAttribute("disabled","disabled");x.setAttribute("selected","selected");x.setAttribute("value","pageNotFound");r.appendChild(x);mxEvent.addListener(r,"change",function(){null==x.parentNode||x.selected||x.parentNode.removeChild(x)})}u=document.createElement("div");u.className="geDialogCheckRow";u.style.marginTop="6px";u.appendChild(H);u.appendChild(r);K.appendChild(u);u=document.createElement("div");u.className="geDialogCheckRow";u.style.marginTop="6px";u.appendChild(c);var B=document.createElement("span");+B.style.cssText="flex:1;min-width:0;font-size:13px;line-height:1.5;color:light-dark(#1d1d1f,#e0e0e0);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:8px";var G=mxUtils.button("",function(){c.checked=!0;LinkDialog.editCustomAction(b,f,function(N){f=N;d(N,LinkDialog.selectedDocs,t.checked?y:null)})});G.className="geBtn";(function(){B.textContent="";if(null==f)mxUtils.write(B,mxResources.get("action",null,"Action")),G.textContent=mxResources.get("insert",null,"Insert");else{G.textContent=mxResources.get("edit",null,"Edit");try{var N=JSON.parse(f.substring(17));if("string"==typeof N.title&&""!=N.title.trim())var R=N.title.trim();else{var P=0<(null!=N.actions?N.actions.length:0)?Object.keys(N.actions[0])[0]:"";if("animation"==P&&null!=N.actions[0].animation.steps){var U=N.actions[0].animation.steps.length;R=mxResources.get("effects",null,"Effects")+" ("+U+")"}else if(""!=P){var S=null!=CustomActionDialog?CustomActionDialog.SCHEMAS[P]:null;R=mxResources.get(null!=S&&S.labelKey?S.labelKey:-P,null,null!=S?S.label:P)}else R=mxResources.get("action",null,"Action")}mxUtils.write(B,R)}catch(z){mxUtils.write(B,"("+mxResources.get("invalid",null,"invalid")+")")}}})();u.appendChild(B);F.style.marginLeft="8px";u.appendChild(F);K.appendChild(u)}else l.setAttribute("value",k),q=document.createElement("div"),q.className="geDialogFormRow",q.appendChild(l),q.appendChild(n),K.appendChild(q);J.appendChild(K);var L=mxUtils.button(m,function(){b.hideDialog();d(c.checked?null!=f?f:k:G.checked?"pageNotFound"!==-r.value?r.value:k:l.value,LinkDialog.selectedDocs,t.checked?y:null)});L.style.verticalAlign="middle";L.className="geBtn gePrimaryBtn";this.init=function(){G.checked?r.focus():(l.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?l.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(r,"focus",function(){H.removeAttribute("checked");G.setAttribute("checked","checked");G.checked=!0});mxEvent.addListener(l,"focus",function(){G.removeAttribute("checked");H.setAttribute("checked",-"checked");H.checked=!0});if(Graph.fileSupport&&null!=J.parentNode){var N=J.parentNode,R=null;mxEvent.addListener(N,"dragleave",function(P){null!=R&&(R.parentNode.removeChild(R),R=null);P.stopPropagation();P.preventDefault()});mxEvent.addListener(N,"dragover",mxUtils.bind(this,function(P){null==R&&(R=b.highlightElement(N));P.stopPropagation();P.preventDefault()}));mxEvent.addListener(N,"drop",mxUtils.bind(this,function(P){try{null!=R&&(R.parentNode.removeChild(R),R=null),0<=mxUtils.indexOf(P.dataTransfer.types,-"text/uri-list")&&(l.value=decodeURIComponent(P.dataTransfer.getData("text/uri-list")),H.setAttribute("checked","checked"),H.checked=!0,L.click())}catch(U){b.handleError(U)}P.stopPropagation();P.preventDefault()}),!1)}};m=document.createElement("div");m.style.marginTop="34px";m.style.textAlign="right";b.isOffline()||m.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/custom-links"));K=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});K.style.verticalAlign="middle";K.className=+P,null,null!=S?S.label:P)}else R=mxResources.get("action",null,"Action")}mxUtils.write(B,R)}catch(z){mxUtils.write(B,"("+mxResources.get("invalid",null,"invalid")+")")}}})();u.appendChild(B);G.style.marginLeft="8px";u.appendChild(G);K.appendChild(u)}else l.setAttribute("value",k),q=document.createElement("div"),q.className="geDialogFormRow",q.appendChild(l),q.appendChild(n),K.appendChild(q);J.appendChild(K);var L=mxUtils.button(m,function(){b.hideDialog();d(c.checked?null!=f?f:k:H.checked?"pageNotFound"!==+r.value?r.value:k:l.value,LinkDialog.selectedDocs,t.checked?y:null)});L.style.verticalAlign="middle";L.className="geBtn gePrimaryBtn";this.init=function(){H.checked?r.focus():(l.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?l.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(r,"focus",function(){F.removeAttribute("checked");H.setAttribute("checked","checked");H.checked=!0});mxEvent.addListener(l,"focus",function(){H.removeAttribute("checked");F.setAttribute("checked",+"checked");F.checked=!0});if(Graph.fileSupport&&null!=J.parentNode){var N=J.parentNode,R=null;mxEvent.addListener(N,"dragleave",function(P){null!=R&&(R.parentNode.removeChild(R),R=null);P.stopPropagation();P.preventDefault()});mxEvent.addListener(N,"dragover",mxUtils.bind(this,function(P){null==R&&(R=b.highlightElement(N));P.stopPropagation();P.preventDefault()}));mxEvent.addListener(N,"drop",mxUtils.bind(this,function(P){try{null!=R&&(R.parentNode.removeChild(R),R=null),0<=mxUtils.indexOf(P.dataTransfer.types,+"text/uri-list")&&(l.value=decodeURIComponent(P.dataTransfer.getData("text/uri-list")),F.setAttribute("checked","checked"),F.checked=!0,L.click())}catch(U){b.handleError(U)}P.stopPropagation();P.preventDefault()}),!1)}};m=document.createElement("div");m.style.marginTop="34px";m.style.textAlign="right";b.isOffline()||m.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/custom-links"));K=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});K.style.verticalAlign="middle";K.className="geBtn";b.editor.cancelFirst&&m.appendChild(K);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(N){if(N.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=N.docs;var R=N.docs[0].url;"application/mxe"==N.docs[0].mimeType||null!=N.docs[0].mimeType&&"application/vnd.jgraph."==N.docs[0].mimeType.substring(0,23)?R="https://app.diagrams.net/#G"+N.docs[0].id:"application/vnd.google-apps.folder"==N.docs[0].mimeType&&(R="https://drive.google.com/#folders/"+N.docs[0].id);l.value=R;l.focus()}else LinkDialog.selectedDocs=null;l.focus()};var D=document.createElement("select");D.className="geBtn";D.style.position="relative";D.style.top="1px";D.style.maxWidth="120px";var T={};u=document.createElement("option");mxUtils.write(u,mxResources.get("select")+"...");u.value="";D.appendChild(u);"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=b.drive&&A("googleDrive",function(){b.spinner.spin(document.body,mxResources.get("authorizing"))&&b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();if(null==b.linkPicker){var N=b.drive.createLinkPicker();b.linkPicker=N.setCallback(function(R){LinkDialog.filePicked(R)}).build()}b.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&A("dropbox",function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(N){l.value=N[0].link;l.focus()}})});null!=b.oneDrive&&A("oneDrive",function(){b.oneDrive.pickFile(function(N,R){null!=R&&null!=R.value&&0<R.value.length&&(l.value=R.value[0].webUrl,l.focus())},@@ -12926,29 +12929,29 @@ var ANIMATION_HELP_URL="https://www.drawio.com/docs/manual/links-tooltips-tags/aasterisk:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M8 3.5v9M4 5.5l8 5M4 10.5l8-5"/></svg>'};function installCustomActionStyles(){if(!installCustomActionStyles._done){installCustomActionStyles._done=!0;var b=document.createElement("style");b.setAttribute("data-source","customActionDialog");b.textContent='.geSelField{display:inline-flex;align-items:center;gap:6px;font:12px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased}.geSelFieldLabel{color:light-dark(#6e6e73,#a0a0a0);font-weight:500;letter-spacing:0.01em}.geSelChip{display:inline-flex;align-items:center;gap:4px;min-height:24px;padding:2px 10px;border-radius:999px;border:1px solid light-dark(#d2d2d7,#48484a);background:light-dark(#fafafa,#2c2c2e);color:light-dark(#1d1d1f,#e5e5e7);font:inherit;font-weight:500;flex:0 0 auto;max-width:100%;white-space:nowrap;user-select:none;transition:background-color .15s,border-color .15s,box-shadow .15s}.geSelChipReadOnly{cursor:default}button.geSelChip,a.geSelChip{cursor:pointer}button.geSelChip:hover,a.geSelChip:hover{background:light-dark(#f0f0f2,#3a3a3c);border-color:light-dark(#b9b9be,#5a5a5e)}button.geSelChip:focus-visible{outline:2px solid light-dark(#0071e3,#0a84ff);outline-offset:1px}.geSelChipEmpty{color:light-dark(#8e8e93,#7a7a7e);border-style:dashed;background:transparent}.geSelChipAll{background:light-dark(#e8f0fe,#10325f);border-color:light-dark(#a3c4f8,#2a5aa8);color:light-dark(#0a4bb0,#7eb1ff)}.geSelChipTags{padding:2px 6px;gap:3px}.geSelChipExpandable::after{content:"";display:inline-block;width:5px;height:5px;margin-left:6px;border:solid currentColor;border-width:0 1.4px 1.4px 0;transform:translateY(-2px) rotate(45deg);opacity:.55}.geSelIconBtn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border-radius:6px;border:1px solid light-dark(#d2d2d7,#48484a);background:light-dark(#ffffff,#1c1c1e);color:light-dark(#3a3a3f,#cfcfd3);cursor:pointer;transition:background-color .15s,border-color .15s,color .15s}.geSelIconBtn:hover{background:light-dark(#f5f5f7,#2c2c2e);border-color:light-dark(#b9b9be,#5a5a5e);color:light-dark(#0071e3,#0a84ff)}.geSelIconBtn:focus-visible{outline:2px solid light-dark(#0071e3,#0a84ff);outline-offset:1px}.geSelIconBtn:active{background:light-dark(#e5e5ea,#3a3a3c)}.geSelIconBtnActive{background:light-dark(#0071e3,#0a84ff);border-color:light-dark(#0071e3,#0a84ff);color:#ffffff}.geSelIconBtnActive:hover{background:light-dark(#0062c4,#1a90ff);border-color:light-dark(#0062c4,#1a90ff);color:#ffffff}.geSelIconBtn svg{display:block}.geTagPicker{position:fixed;z-index:10000;min-width:220px;max-width:300px;background:light-dark(#ffffff,#1c1c1e);border:1px solid light-dark(#d0d0d0,#505050);border-radius:12px;box-shadow:0 4px 16px rgba(0,0,0,0.15);font:12px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:light-dark(#1d1d1f,#e5e5e7);opacity:0;transform:scale(0);transition:transform .2s cubic-bezier(0.34,1.56,0.64,1),opacity .1s ease-out}.geTagPickerOpen{opacity:1;transform:scale(1)}.geTagPickerArrow{position:absolute;top:-7px;width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid light-dark(#d2d2d7,#48484a);pointer-events:none}.geTagPickerArrow::after{content:"";position:absolute;top:1px;left:-6px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid light-dark(#ffffff,#1c1c1e)}.geTagPickerArrowBottom{top:auto;bottom:-7px;border-bottom:none;border-top:7px solid light-dark(#d2d2d7,#48484a)}.geTagPickerArrowBottom::after{top:auto;bottom:1px;border-bottom:none;border-top:6px solid light-dark(#ffffff,#1c1c1e)}.geTagPickerHeader{padding:10px 14px 6px;font-weight:600;color:light-dark(#1d1d1f,#e5e5e7);font-size:12px;letter-spacing:.02em;text-transform:uppercase;opacity:.8}.geTagPickerEmpty{padding:14px 18px;color:light-dark(#8e8e93,#7a7a7e);font-style:italic;text-align:center}.geTagPickerFooter{padding:4px;border-top:1px solid light-dark(#e5e5ea,#3a3a3c)}.geTagPickerModeBar{display:flex;align-items:center;gap:6px;padding:6px 10px 4px}.geTagPickerModeLabel{font-size:11px;font-weight:500;color:light-dark(#6e6e73,#a0a0a0);margin-right:4px}.geTagPickerModeBtn{padding:2px 10px;border-radius:999px;font:inherit;font-size:11px;font-weight:500;cursor:pointer;border:1px solid light-dark(#d2d2d7,#48484a);background:transparent;color:light-dark(#3a3a3f,#cfcfd3);transition:background-color .12s,color .12s,border-color .12s}.geTagPickerModeBtn:hover{background:light-dark(#f0f0f2,#2c2c2e)}.geTagPickerModeBtnActive{background:light-dark(#0071e3,#0a84ff);border-color:light-dark(#0071e3,#0a84ff);color:#ffffff}.geTagPickerModeBtnActive:hover{background:light-dark(#0062c4,#1a90ff);border-color:light-dark(#0062c4,#1a90ff)}.geTagPickerCloud{display:flex;flex-wrap:wrap;gap:6px;padding:8px 10px 12px;max-height:320px;overflow:auto;max-width:320px}.geTagCloudPill{display:inline-block;padding:3px 10px;border-radius:999px;cursor:pointer;font:inherit;font-size:11px;font-weight:500;line-height:1.4;background:light-dark(#e5e5ea,#48484a);color:light-dark(#3a3a3f,#cfcfd3);border:1px solid transparent;white-space:nowrap;transition:background-color .12s,color .12s,border-color .12s}.geTagCloudPill:hover{background:light-dark(#d5d5da,#5a5a5e)}.geTagCloudPillActive{background:light-dark(#d4f0db,#1c4530);color:light-dark(#1f7a3e,#86e0a3);border-color:light-dark(#a8e0b8,#2d6849)}.geTagCloudPillActive:hover{background:light-dark(#c4e8ce,#235c3d)}.geLayerPickerList{display:flex;flex-direction:column;gap:2px;padding:6px 6px 10px;max-height:320px;overflow:auto;min-width:220px}.geLayerPickerRow{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:6px;cursor:pointer;font:inherit;font-size:12px;color:light-dark(#1d1d1f,#e5e5e7);transition:background-color .1s}.geLayerPickerRow:hover{background:light-dark(#f0f0f2,#2c2c2e)}.geLayerPickerRow input[type="checkbox"]{margin:0;flex:0 0 auto}.geLayerPickerRowLabel{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}option.geDeleteOpt{color:light-dark(#d70015,#ff453a);font-weight:500}.geNoSpin{-moz-appearance:textfield;flex:0 0 60px;width:60px;max-width:60px;box-sizing:border-box}.geNoSpin::-webkit-outer-spin-button,.geNoSpin::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.geActionMenuList{padding:4px;min-width:180px}.geActionMenuItem{display:block;width:100%;padding:6px 12px;background:none;border:0;border-radius:6px;text-align:left;font:inherit;font-size:13px;cursor:pointer;color:light-dark(#1d1d1f,#e5e5e7);transition:background-color .1s}.geActionMenuItem:hover{background:light-dark(#f0f0f2,#2c2c2e)}.geActionMenuItemActive{color:light-dark(#0071e3,#0a84ff);font-weight:600}.geActionMenuItemDanger{color:light-dark(#d70015,#ff453a)}.geActionMenuItemDanger:hover{background:light-dark(#fdf0f0,#3a2020)}.geActionMenuItemDisabled{color:light-dark(#aeaeb2,#636366);cursor:default;pointer-events:none}.geActionMenuSeparator{height:1px;margin:4px 6px;background:light-dark(#e5e5ea,#3a3a3c)}.geAnimationStepActive{background:light-dark(rgba(0,113,227,.10),rgba(10,132,255,.18))}.geAnimationStepSelected{background:light-dark(rgba(0,113,227,.06),rgba(10,132,255,.10))}.geAnimationStepActive.geAnimationStepSelected{background:light-dark(rgba(0,113,227,.16),rgba(10,132,255,.28))}';document.head.appendChild(b)}}function installDialogDocking(b,k){var m=EditorUi.windowed;EditorUi.windowed=!0;try{b.installResizeHandler(k,!0)}finally{EditorUi.windowed=m}}function containDragEvents(b){for(var k="dragstart dragenter dragover dragleave drop dragend".split(" "),m=0;m<k.length;m++)b.addEventListener(k[m],function(d){d.stopPropagation()})}-var SelectorChips={create:function(b,k){function m(A,J,K,H,G){for(var c=(Array.isArray(J())?J():[]).slice(),f="function"==typeof b.getAllTags?b.getAllTags():[],l=0;l<c.length;l++)0>f.indexOf(c[l])&&f.push(c[l]);f.sort();J=document.createElement("div");if(0==f.length)f=document.createElement("div"),f.className="geTagPickerEmpty",mxUtils.write(f,mxResources.get("noTagsInDiagram",null,"No tags in this diagram yet.")),J.appendChild(f);else{var n="function"==typeof H?H()||"and":null;if("function"==typeof G){H=-document.createElement("div");H.className="geTagPickerModeBar";l=document.createElement("span");l.className="geTagPickerModeLabel";mxUtils.write(l,mxResources.get("match",null,"Match")+":");H.appendChild(l);var r=document.createElement("button");r.type="button";r.className="geTagPickerModeBtn";mxUtils.write(r,mxResources.get("matchAll",null,"All"));r.title=mxResources.get("matchAllHint",null,"Match cells that have every selected tag (AND)");var t=document.createElement("button");t.type="button";t.className=-"geTagPickerModeBtn";mxUtils.write(t,mxResources.get("matchAny",null,"Any"));t.title=mxResources.get("matchAnyHint",null,"Match cells that have at least one selected tag (OR)");var x=function(){r.classList.toggle("geTagPickerModeBtnActive","and"===n);t.classList.toggle("geTagPickerModeBtnActive","or"===n)};x();r.addEventListener("click",function(N){N.preventDefault();n="and";G("and");x()});t.addEventListener("click",function(N){N.preventDefault();n="or";G("or");x()});H.appendChild(r);H.appendChild(t);-J.appendChild(H)}var B=document.createElement("div");B.className="geTagPickerCloud";var F=[];for(l=0;l<f.length;l++)(function(N){var R=document.createElement("button");R.type="button";R.className="geTagCloudPill";R.title=N;R.textContent=N;var P=function(){R.classList.toggle("geTagCloudPillActive",0<=c.indexOf(N))};P();F.push(P);R.addEventListener("click",function(U){U.preventDefault();U=c.indexOf(N);0<=U?c.splice(U,1):c.push(N);K(c.slice());P();T()});B.appendChild(R)})(f[l]);J.appendChild(B);f=document.createElement("div");+var SelectorChips={create:function(b,k){function m(A,J,K,F,H){for(var c=(Array.isArray(J())?J():[]).slice(),f="function"==typeof b.getAllTags?b.getAllTags():[],l=0;l<c.length;l++)0>f.indexOf(c[l])&&f.push(c[l]);f.sort();J=document.createElement("div");if(0==f.length)f=document.createElement("div"),f.className="geTagPickerEmpty",mxUtils.write(f,mxResources.get("noTagsInDiagram",null,"No tags in this diagram yet.")),J.appendChild(f);else{var n="function"==typeof F?F()||"and":null;if("function"==typeof H){F=+document.createElement("div");F.className="geTagPickerModeBar";l=document.createElement("span");l.className="geTagPickerModeLabel";mxUtils.write(l,mxResources.get("match",null,"Match")+":");F.appendChild(l);var r=document.createElement("button");r.type="button";r.className="geTagPickerModeBtn";mxUtils.write(r,mxResources.get("matchAll",null,"All"));r.title=mxResources.get("matchAllHint",null,"Match cells that have every selected tag (AND)");var t=document.createElement("button");t.type="button";t.className=+"geTagPickerModeBtn";mxUtils.write(t,mxResources.get("matchAny",null,"Any"));t.title=mxResources.get("matchAnyHint",null,"Match cells that have at least one selected tag (OR)");var x=function(){r.classList.toggle("geTagPickerModeBtnActive","and"===n);t.classList.toggle("geTagPickerModeBtnActive","or"===n)};x();r.addEventListener("click",function(N){N.preventDefault();n="and";H("and");x()});t.addEventListener("click",function(N){N.preventDefault();n="or";H("or");x()});F.appendChild(r);F.appendChild(t);+J.appendChild(F)}var B=document.createElement("div");B.className="geTagPickerCloud";var G=[];for(l=0;l<f.length;l++)(function(N){var R=document.createElement("button");R.type="button";R.className="geTagCloudPill";R.title=N;R.textContent=N;var P=function(){R.classList.toggle("geTagCloudPillActive",0<=c.indexOf(N))};P();G.push(P);R.addEventListener("click",function(U){U.preventDefault();U=c.indexOf(N);0<=U?c.splice(U,1):c.push(N);K(c.slice());P();T()});B.appendChild(R)})(f[l]);J.appendChild(B);f=document.createElement("div");f.className="geTagPickerFooter";var L=document.createElement("button");L.type="button";L.className="geActionMenuItem";mxUtils.write(L,mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"));L.addEventListener("click",function(N){N.preventDefault();0!=c.length&&(N="function"==typeof b.getCellsForTags?b.getCellsForTags(c,null,null,!0,n):[],0<N.length?b.setSelectionCells(N):b.clearSelection())});f.appendChild(L);var D=document.createElement("button");D.type="button";D.className="geActionMenuItem geActionMenuItemDanger";-mxUtils.write(D,mxResources.get("reset",null,"Reset"));D.addEventListener("click",function(N){N.preventDefault();c=[];K([]);for(N=0;N<F.length;N++)F[N]();T()});f.appendChild(D);J.appendChild(f);var T=function(){var N=0==c.length;L.classList.toggle("geActionMenuItemDisabled",N);L.disabled=N;D.classList.toggle("geActionMenuItemDisabled",N);D.disabled=N};T()}u(A,mxResources.get("tags",null,"Tags"),J)}function d(){for(var A=b.getModel(),J=A.getRoot(),K=A.getChildCount(J),H=[],G=0;G<K;G++){var c=A.getChildAt(J,-G);if(null!=c){var f=b.convertValueToString(c);if(null==f||""===f)f=0==G?mxResources.get("background",null,"Background"):mxResources.get("untitledLayer",null,"Untitled Layer");H.push({id:c.id,name:f,cell:c})}}return H}function q(A,J,K){var H=(Array.isArray(J())?J():[]).slice(),G=d();J=document.createElement("div");var c=document.createElement("div");c.className="geLayerPickerList";for(var f=[],l=0;l<G.length;l++)(function(x){var B=document.createElement("label");B.className="geLayerPickerRow";B.title=-x.name;var F=document.createElement("input");F.type="checkbox";F.checked=0<=H.indexOf(x.id);B.appendChild(F);var L=document.createElement("span");L.className="geLayerPickerRowLabel";mxUtils.write(L,x.name);B.appendChild(L);f.push(function(){F.checked=0<=H.indexOf(x.id)});F.addEventListener("change",function(){var D=H.indexOf(x.id);F.checked&&0>D?H.push(x.id):!F.checked&&0<=D&&H.splice(D,1);K(H.slice());t()});c.appendChild(B)})(G[l]);J.appendChild(c);G=document.createElement("div");G.className="geTagPickerFooter";-var n=document.createElement("button");n.type="button";n.className="geActionMenuItem";mxUtils.write(n,mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"));n.addEventListener("click",function(x){x.preventDefault();0!=H.length&&(x="function"==typeof b.getCellsForLayers?b.getCellsForLayers(H):[],0<x.length?b.setSelectionCells(x):b.clearSelection())});G.appendChild(n);var r=document.createElement("button");r.type="button";r.className="geActionMenuItem geActionMenuItemDanger";mxUtils.write(r,-mxResources.get("reset",null,"Reset"));r.addEventListener("click",function(x){x.preventDefault();H=[];K([]);for(x=0;x<f.length;x++)f[x]();t()});G.appendChild(r);J.appendChild(G);var t=function(){var x=0==H.length;n.classList.toggle("geActionMenuItemDisabled",x);n.disabled=x;r.classList.toggle("geActionMenuItemDisabled",x);r.disabled=x};t();u(A,mxResources.get("selectLayers",null,"Layers"),J)}function u(A,J,K){function H(){document.removeEventListener("mousedown",G,!0);window.removeEventListener("resize",-H);window.removeEventListener("scroll",H,!0);c.parentNode&&c.parentNode.removeChild(c);u._open===x&&(u._open=null)}function G(B){c.contains(B.target)||A.contains(B.target)||null!=b.container&&b.container.contains(B.target)||H()}null!=u._open&&u._open.close();var c=document.createElement("div");c.className="geTagPicker";var f=document.createElement("div");f.className="geTagPickerArrow";c.appendChild(f);if(J){var l=document.createElement("div");l.className="geTagPickerHeader";mxUtils.write(l,J);c.appendChild(l)}c.appendChild(K);+mxUtils.write(D,mxResources.get("reset",null,"Reset"));D.addEventListener("click",function(N){N.preventDefault();c=[];K([]);for(N=0;N<G.length;N++)G[N]();T()});f.appendChild(D);J.appendChild(f);var T=function(){var N=0==c.length;L.classList.toggle("geActionMenuItemDisabled",N);L.disabled=N;D.classList.toggle("geActionMenuItemDisabled",N);D.disabled=N};T()}u(A,mxResources.get("tags",null,"Tags"),J)}function d(){for(var A=b.getModel(),J=A.getRoot(),K=A.getChildCount(J),F=[],H=0;H<K;H++){var c=A.getChildAt(J,+H);if(null!=c){var f=b.convertValueToString(c);if(null==f||""===f)f=0==H?mxResources.get("background",null,"Background"):mxResources.get("untitledLayer",null,"Untitled Layer");F.push({id:c.id,name:f,cell:c})}}return F}function q(A,J,K){var F=(Array.isArray(J())?J():[]).slice(),H=d();J=document.createElement("div");var c=document.createElement("div");c.className="geLayerPickerList";for(var f=[],l=0;l<H.length;l++)(function(x){var B=document.createElement("label");B.className="geLayerPickerRow";B.title=+x.name;var G=document.createElement("input");G.type="checkbox";G.checked=0<=F.indexOf(x.id);B.appendChild(G);var L=document.createElement("span");L.className="geLayerPickerRowLabel";mxUtils.write(L,x.name);B.appendChild(L);f.push(function(){G.checked=0<=F.indexOf(x.id)});G.addEventListener("change",function(){var D=F.indexOf(x.id);G.checked&&0>D?F.push(x.id):!G.checked&&0<=D&&F.splice(D,1);K(F.slice());t()});c.appendChild(B)})(H[l]);J.appendChild(c);H=document.createElement("div");H.className="geTagPickerFooter";+var n=document.createElement("button");n.type="button";n.className="geActionMenuItem";mxUtils.write(n,mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"));n.addEventListener("click",function(x){x.preventDefault();0!=F.length&&(x="function"==typeof b.getCellsForLayers?b.getCellsForLayers(F):[],0<x.length?b.setSelectionCells(x):b.clearSelection())});H.appendChild(n);var r=document.createElement("button");r.type="button";r.className="geActionMenuItem geActionMenuItemDanger";mxUtils.write(r,+mxResources.get("reset",null,"Reset"));r.addEventListener("click",function(x){x.preventDefault();F=[];K([]);for(x=0;x<f.length;x++)f[x]();t()});H.appendChild(r);J.appendChild(H);var t=function(){var x=0==F.length;n.classList.toggle("geActionMenuItemDisabled",x);n.disabled=x;r.classList.toggle("geActionMenuItemDisabled",x);r.disabled=x};t();u(A,mxResources.get("selectLayers",null,"Layers"),J)}function u(A,J,K){function F(){document.removeEventListener("mousedown",H,!0);window.removeEventListener("resize",+F);window.removeEventListener("scroll",F,!0);c.parentNode&&c.parentNode.removeChild(c);u._open===x&&(u._open=null)}function H(B){c.contains(B.target)||A.contains(B.target)||null!=b.container&&b.container.contains(B.target)||F()}null!=u._open&&u._open.close();var c=document.createElement("div");c.className="geTagPicker";var f=document.createElement("div");f.className="geTagPickerArrow";c.appendChild(f);if(J){var l=document.createElement("div");l.className="geTagPickerHeader";mxUtils.write(l,J);c.appendChild(l)}c.appendChild(K);document.body.appendChild(c);l=A.getBoundingClientRect();var n=c.offsetWidth;J=c.offsetHeight;var r=l.bottom+6;K=!1;r+J>window.innerHeight-12&&(r=Math.max(8,l.top-J-6),f.classList.add("geTagPickerArrowBottom"),K=!0);var t=l.left;t+n>window.innerWidth-8&&(t=Math.max(8,window.innerWidth-n-8));c.style.top=r+"px";c.style.left=t+"px";l=Math.min(n-24,Math.max(12,l.left+l.width/2-t-6));f.style.left=l+"px";c.style.transformOrigin=l+6+"px "+(K?J+"px":"0px");requestAnimationFrame(function(){c.classList.add("geTagPickerOpen")});-document.addEventListener("mousedown",G,!0);window.addEventListener("resize",H);window.addEventListener("scroll",H,!0);var x={close:H,anchor:A};return u._open=x}function y(A,J){var K=document.createElement("div");K.className="geActionMenuList";for(var H=[],G,c=0;c<J.length;c++)(function(n){if(n.separator){var r=document.createElement("div");r.className="geActionMenuSeparator";K.appendChild(r)}else{var t=document.createElement("button");t.type="button";t.className="geActionMenuItem";n.danger&&t.classList.add("geActionMenuItemDanger");-n.active&&t.classList.add("geActionMenuItemActive");var x=function(){return"function"==typeof n.disabled?!!n.disabled():!!n.disabled};r=function(){var B=x();t.classList.toggle("geActionMenuItemDisabled",B);t.disabled=B};r();H.push(r);mxUtils.write(t,n.label);t.addEventListener("click",function(B){B.preventDefault();x()||(G&&G.close(),n.onClick(A))});K.appendChild(t)}})(J[c]);G=u(A,null,K);var f=function(){for(var n=0;n<H.length;n++)H[n]()};b.getSelectionModel().addListener(mxEvent.CHANGE,f);var l=-G.close;G.close=function(){b.getSelectionModel().removeListener(f);l()};return G}installCustomActionStyles();return{cellListField:function(A,J,K,H){H=H||{};var G=H.singularKey||"cell",c=H.pluralKey||"cells",f=H.singularFallback||"cell",l=H.pluralFallback||"cells",n=H.emptyKey||"select",r=H.emptyFallback||"Select",t=document.createElement("div");t.className="geSelField";if(A){var x=document.createElement("span");x.className="geSelFieldLabel";mxUtils.write(x,A);t.appendChild(x)}var B=document.createElement("button");-B.type="button";B.className="geSelChip geSelChipExpandable";var F=null,L=function(){var N=J();return Array.isArray(N)&&1==N.length&&"*"===N[0]},D=function(){var N=J();return Array.isArray(N)&&0<N.length},T=function(){var N=J(),R=Array.isArray(N)&&!L()?N.length:0;B.textContent="";B.classList.remove("geSelChipEmpty","geSelChipAll");B.title="";L()?(B.classList.add("geSelChipAll"),mxUtils.write(B,mxResources.get("allCells",null,"All cells"))):0==R?(B.classList.add("geSelChipEmpty"),mxUtils.write(B,mxResources.get(n,-null,r))):(mxUtils.write(B,R+" "+(1==R?mxResources.get(G,null,f):mxResources.get(c,null,l))),B.title=N.join("\n"))};B.addEventListener("click",function(N){N.preventDefault();if(null!=u._open&&u._open.anchor===B)u._open.close();else{N=[];N.push({label:mxResources.get("useSelection",null,"Use selection"),disabled:function(){return 0==b.getSelectionCount()},onClick:function(){var P=b.getSelectionCells();0!=P.length&&(K(P.map(function(U){return U.id})),T())}});H.allowWildcard&&N.push({label:mxResources.get("allCells",-null,"All cells"),active:L(),onClick:function(){if(L())K(F),F=null;else{var P=J();F=Array.isArray(P)?P.slice():null;K(["*"])}T()}});D()&&(N.push({label:mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"),onClick:function(){for(var P=J(),U=[],S=0;S<P.length;S++){if("*"===P[S]){U=b.model.getDescendants(b.model.getRoot());break}var z=b.model.getCell(P[S]);null!=z&&U.push(z)}0<U.length?b.setSelectionCells(U):b.clearSelection()}}),N.push({separator:!0}),N.push({label:mxResources.get("reset",-null,"Reset"),danger:!0,onClick:function(){K(null);F=null;T()}}));if(Array.isArray(H.extraMenuItems)&&0<H.extraMenuItems.length){0<N.length&&!N[N.length-1].separator&&N.push({separator:!0});for(var R=0;R<H.extraMenuItems.length;R++)N.push(H.extraMenuItems[R])}y(B,N)}});t.appendChild(B);T();return t},tagListField:function(A,J,K,H){H=H||{};var G=document.createElement("div");G.className="geSelField";if(A){var c=document.createElement("span");c.className="geSelFieldLabel";mxUtils.write(c,A);G.appendChild(c)}var f=+document.addEventListener("mousedown",H,!0);window.addEventListener("resize",F);window.addEventListener("scroll",F,!0);var x={close:F,anchor:A};return u._open=x}function y(A,J){var K=document.createElement("div");K.className="geActionMenuList";for(var F=[],H,c=0;c<J.length;c++)(function(n){if(n.separator){var r=document.createElement("div");r.className="geActionMenuSeparator";K.appendChild(r)}else{var t=document.createElement("button");t.type="button";t.className="geActionMenuItem";n.danger&&t.classList.add("geActionMenuItemDanger");+n.active&&t.classList.add("geActionMenuItemActive");var x=function(){return"function"==typeof n.disabled?!!n.disabled():!!n.disabled};r=function(){var B=x();t.classList.toggle("geActionMenuItemDisabled",B);t.disabled=B};r();F.push(r);mxUtils.write(t,n.label);t.addEventListener("click",function(B){B.preventDefault();x()||(H&&H.close(),n.onClick(A))});K.appendChild(t)}})(J[c]);H=u(A,null,K);var f=function(){for(var n=0;n<F.length;n++)F[n]()};b.getSelectionModel().addListener(mxEvent.CHANGE,f);var l=+H.close;H.close=function(){b.getSelectionModel().removeListener(f);l()};return H}installCustomActionStyles();return{cellListField:function(A,J,K,F){F=F||{};var H=F.singularKey||"cell",c=F.pluralKey||"cells",f=F.singularFallback||"cell",l=F.pluralFallback||"cells",n=F.emptyKey||"select",r=F.emptyFallback||"Select",t=document.createElement("div");t.className="geSelField";if(A){var x=document.createElement("span");x.className="geSelFieldLabel";mxUtils.write(x,A);t.appendChild(x)}var B=document.createElement("button");+B.type="button";B.className="geSelChip geSelChipExpandable";var G=null,L=function(){var N=J();return Array.isArray(N)&&1==N.length&&"*"===N[0]},D=function(){var N=J();return Array.isArray(N)&&0<N.length},T=function(){var N=J(),R=Array.isArray(N)&&!L()?N.length:0;B.textContent="";B.classList.remove("geSelChipEmpty","geSelChipAll");B.title="";L()?(B.classList.add("geSelChipAll"),mxUtils.write(B,mxResources.get("allCells",null,"All cells"))):0==R?(B.classList.add("geSelChipEmpty"),mxUtils.write(B,mxResources.get(n,+null,r))):(mxUtils.write(B,R+" "+(1==R?mxResources.get(H,null,f):mxResources.get(c,null,l))),B.title=N.join("\n"))};B.addEventListener("click",function(N){N.preventDefault();if(null!=u._open&&u._open.anchor===B)u._open.close();else{N=[];N.push({label:mxResources.get("useSelection",null,"Use selection"),disabled:function(){return 0==b.getSelectionCount()},onClick:function(){var P=b.getSelectionCells();0!=P.length&&(K(P.map(function(U){return U.id})),T())}});F.allowWildcard&&N.push({label:mxResources.get("allCells",+null,"All cells"),active:L(),onClick:function(){if(L())K(G),G=null;else{var P=J();G=Array.isArray(P)?P.slice():null;K(["*"])}T()}});D()&&(N.push({label:mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"),onClick:function(){for(var P=J(),U=[],S=0;S<P.length;S++){if("*"===P[S]){U=b.model.getDescendants(b.model.getRoot());break}var z=b.model.getCell(P[S]);null!=z&&U.push(z)}0<U.length?b.setSelectionCells(U):b.clearSelection()}}),N.push({separator:!0}),N.push({label:mxResources.get("reset",+null,"Reset"),danger:!0,onClick:function(){K(null);G=null;T()}}));if(Array.isArray(F.extraMenuItems)&&0<F.extraMenuItems.length){0<N.length&&!N[N.length-1].separator&&N.push({separator:!0});for(var R=0;R<F.extraMenuItems.length;R++)N.push(F.extraMenuItems[R])}y(B,N)}});t.appendChild(B);T();return t},tagListField:function(A,J,K,F){F=F||{};var H=document.createElement("div");H.className="geSelField";if(A){var c=document.createElement("span");c.className="geSelFieldLabel";mxUtils.write(c,A);H.appendChild(c)}var f=document.createElement("button");f.type="button";f.className="geSelChip geSelChipExpandable";var l=function(){var n=J(),r=Array.isArray(n)?n.length:0;f.textContent="";f.classList.remove("geSelChipEmpty");f.title="";0==r?(f.classList.add("geSelChipEmpty"),mxUtils.write(f,mxResources.get("tags",null,"Tags"))):(mxUtils.write(f,r+" "+(1==r?mxResources.get("tag",null,"Tag"):mxResources.get("tags",null,"Tags"))),f.title=n.join("\n"))};f.addEventListener("click",function(n){n.preventDefault();null!=u._open&&-u._open.anchor===f?u._open.close():m(f,J,function(r){K(r);l()},H.getMode,H.setMode)});G.appendChild(f);l();return G},layerListField:function(A,J,K){var H=document.createElement("div");H.className="geSelField";if(A){var G=document.createElement("span");G.className="geSelFieldLabel";mxUtils.write(G,A);H.appendChild(G)}var c=document.createElement("button");c.type="button";c.className="geSelChip geSelChipExpandable";var f=function(){var l=J(),n=Array.isArray(l)?l.length:0;c.textContent="";c.classList.remove("geSelChipEmpty");+u._open.anchor===f?u._open.close():m(f,J,function(r){K(r);l()},F.getMode,F.setMode)});H.appendChild(f);l();return H},layerListField:function(A,J,K){var F=document.createElement("div");F.className="geSelField";if(A){var H=document.createElement("span");H.className="geSelFieldLabel";mxUtils.write(H,A);F.appendChild(H)}var c=document.createElement("button");c.type="button";c.className="geSelChip geSelChipExpandable";var f=function(){var l=J(),n=Array.isArray(l)?l.length:0;c.textContent="";c.classList.remove("geSelChipEmpty");c.title="";if(0==n)c.classList.add("geSelChipEmpty"),mxUtils.write(c,mxResources.get("layers",null,"Layers"));else{mxUtils.write(c,n+" "+(1==n?mxResources.get("layer",null,"Layer"):mxResources.get("layers",null,"Layers")));n=[];for(var r=b.getModel(),t=0;t<l.length;t++){var x=r.getCell(l[t]);null!=x?(x=b.convertValueToString(x),n.push(null!=x&&""!==x?x:l[t])):n.push(l[t])}c.title=n.join("\n")}};c.addEventListener("click",function(l){l.preventDefault();null!=u._open&&u._open.anchor===c?u._open.close():-q(c,J,function(n){K(n);f()})});H.appendChild(c);f();return H},iconButton:function(A,J,K){var H=document.createElement("button");H.type="button";H.title=J;H.className="geSelIconBtn";H.innerHTML=SELECTOR_ICONS[A];H.addEventListener("click",function(G){G.preventDefault();K(G)});return H},openTagPicker:m,openLayerPicker:q,closePopover:function(){null!=u._open&&u._open.close()}}}},CustomActionDialog=function(b,k,m){installCustomActionStyles();var d={steps:[]};if(null!=k&&"data:action/json,"==k.substring(0,+q(c,J,function(n){K(n);f()})});F.appendChild(c);f();return F},iconButton:function(A,J,K){var F=document.createElement("button");F.type="button";F.title=J;F.className="geSelIconBtn";F.innerHTML=SELECTOR_ICONS[A];F.addEventListener("click",function(H){H.preventDefault();K(H)});return F},openTagPicker:m,openLayerPicker:q,closePopover:function(){null!=u._open&&u._open.close()}}}},CustomActionDialog=function(b,k,m){installCustomActionStyles();var d={steps:[]};if(null!=k&&"data:action/json,"==k.substring(0,17))try{var q=JSON.parse(k.substring(17));if(Array.isArray(q.actions)){k=[];for(var u=0;u<q.actions.length;u++){var y=q.actions[u];if(y&&y.animation&&Array.isArray(y.animation.steps))for(var A=0;A<y.animation.steps.length;A++)k.push(y.animation.steps[A]);else k.push(y)}d.steps=k}"string"==typeof q.title&&""!==q.title&&(d.title=q.title)}catch(J){}q=mxSettings.getWindowState("customAction");y=null!=q&&null!=q.w?q.w:700;d=new AnimationDialog(b,null!=q&&null!=q.x?q.x:Math.max(40,(document.body.offsetWidth-y)/2),null!=q&&null!=q.y?q.y:80,y,null!=q&&null!=q.h?q.h:560,{kind:"action",showTitle:!0,windowTitleKey:"action",windowTitleFallback:"Action",initial:d,save:function(J){var K={actions:J.steps};J.title&&(K.title=J.title);m("data:action/json,"+JSON.stringify(K))}});b.installWindowPersistence("customAction",d);null!=q&&(b.restoreWindowState("customAction",d),d.window.setVisible(!0));return d};CustomActionDialog.SCHEMAS={toggle:{label:"Toggle",icon:"⇄",selector:!0,allowLayers:!0},show:{label:"Show",icon:"✓",selector:!0,allowLayers:!0},hide:{label:"Hide",icon:"✗",selector:!0,allowLayers:!0},select:{label:"Select",icon:"☑",selector:!0,allowLayers:!0},scroll:{label:"Scroll To",icon:"↓",selector:!0,allowLayers:!0,fields:[{name:"border",type:"number",placeholder:"0",width:36,label:"",titleKey:"border",title:"Border"},{name:"smooth",type:"checkbox",labelKey:"transition",label:"Transition"}]},@@ -12961,8 +12964,8 @@ label:"",title:"URL"}},viewbox:{label:"View",labelKey:"view",icon:"⊞",noSelecttitle:"Border"},{name:"smooth",type:"checkbox",labelKey:"transition",label:"Transition"}]},tags:{label:"Toggle Tags",icon:"\ud83c\udff7",noSelector:!0,fields:[{name:"toggle",type:"tagList",labelKey:"toggle",label:"Toggle",modeField:"toggleMatch"},{name:"hidden",type:"tagList",labelKey:"hide",label:"Hide",modeField:"hiddenMatch"},{name:"visible",type:"tagList",labelKey:"show",label:"Show",modeField:"visibleMatch"}]}};var RevisionDialog=function(b,k,m){var d=document.createElement("div"),q=document.createElement("h3");q.style.marginTop="3px";mxUtils.write(q,mxResources.get("revisionHistory"));d.appendChild(q);q=document.createElement("div");q.style.position="absolute";q.style.overflow="auto";q.style.width="170px";q.style.height="378px";d.appendChild(q);var u=document.createElement("div");u.style.position="absolute";u.style.left="200px";u.style.width="470px";u.style.height="376px";u.style.overflow="hidden";u.style.borderWidth="1px";u.style.borderStyle="solid";var y=document.createElement("div");y.style.position="absolute";y.style.display="none";y.style.textAlign="center";y.style.padding="8px";y.style.borderRadius="8px";y.style.left="50%";y.style.top="50%";y.style.whiteSpace="nowrap";y.style.transform="translate(-50%, -50%)";y.style.background="inherit";y.style.border="1px solid";u.appendChild(y);mxEvent.disableContextMenu(u);d.appendChild(u);var A=new Graph(u);A.setTooltips(!1);A.setEnabled(!1);A.setPanning(!0);A.panningHandler.ignoreCell=-!0;A.panningHandler.useLeftButtonForPanning=!0;A.minFitScale=null;A.maxFitScale=null;A.centerZoom=!0;var J=0,K=null,H=0,G=A.getGlobalVariable;A.getGlobalVariable=function(X){return"page"==X&&null!=K&&null!=K[H]?K[H].getAttribute("name"):"pagenumber"==X?H+1:"pagecount"==X?null!=K?K.length:1:G.apply(this,arguments)};A.getLinkForCell=function(){return null};for(var c=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"light-dark(#000000, #C0C0C0)",speed:1.4,trail:60,-shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),f=b.getCurrentFile(),l=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),n={},r=0;r<l.length;r++)n[l[r].getAttribute("id")]=l[r];var t=null,x=null,B=null,F=null,L=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=B&&A.zoomIn()},20);L.setAttribute("disabled","disabled");var D=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=B&&A.zoomOut()},20);D.setAttribute("disabled",+!0;A.panningHandler.useLeftButtonForPanning=!0;A.minFitScale=null;A.maxFitScale=null;A.centerZoom=!0;var J=0,K=null,F=0,H=A.getGlobalVariable;A.getGlobalVariable=function(X){return"page"==X&&null!=K&&null!=K[F]?K[F].getAttribute("name"):"pagenumber"==X?F+1:"pagecount"==X?null!=K?K.length:1:H.apply(this,arguments)};A.getLinkForCell=function(){return null};for(var c=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"light-dark(#000000, #C0C0C0)",speed:1.4,trail:60,+shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),f=b.getCurrentFile(),l=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),n={},r=0;r<l.length;r++)n[l[r].getAttribute("id")]=l[r];var t=null,x=null,B=null,G=null,L=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=B&&A.zoomIn()},20);L.setAttribute("disabled","disabled");var D=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=B&&A.zoomOut()},20);D.setAttribute("disabled","disabled");var T=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){null!=B&&(1==A.view.scale?(A.maxFitScale=8,A.fit(8)):A.zoomActual(),A.center())},20);T.setAttribute("disabled","disabled");var N=b.createToolbarButton(Editor.compareImage,mxResources.get("compare"));N.setAttribute("disabled","disabled");var R=b.createToolbarButton(Editor.thinDataImage,mxResources.get("merge"));R.setAttribute("disabled","disabled");var P=u.cloneNode(!1);P.style.pointerEvent="none";u.parentNode.appendChild(P);var U=new Graph(P);U.setTooltips(!1);U.setEnabled(!1);U.setPanning(!0);U.panningHandler.ignoreCell=!0;U.panningHandler.useLeftButtonForPanning=!0;U.minFitScale=null;U.maxFitScale=null;U.centerZoom=!0;var S=document.createElement("div");S.style.textAlign="left";S.style.color="gray";S.style.backgroundColor="transparent";S.style.overflow="hidden";S.style.textOverflow="ellipsis";S.style.whiteSpace="nowrap";S.style.cursor="default";S.style.height="100%";S.style.display="inline-flex";S.style.alignItems="center";S.style.flexGrow="1";mxEvent.addListener(S,"click",function(){var X=mxUtils.getTextContent(S);""!=X&&b.alert(X)});var z=null;mxEvent.addGestureListeners(N,function(X){try{var Z=null!=K[J]?n[K[J].getAttribute("id")]:null;mxUtils.setOpacity(N,20);y.innerText="";if(null==Z)y.style.display="inline-block",mxUtils.write(y,mxResources.get("pageNotFound"));else{z=S.innerHTML;S.innerHTML=mxResources.get("current");u.style.display="none";P.style.display="";P.style.backgroundColor=u.style.backgroundColor;@@ -12970,85 +12973,85 @@ var Y=Editor.parseDiagramNode(Z);(new mxCodec(Y.ownerDocument)).decode(Y,U.getMo"none";y.innerText="";"none"==u.style.display&&(u.style.display="",S.innerHTML=z,P.style.display="none")});mxEvent.addListener(R,"click",mxUtils.bind(this,function(X){if(null!=B){X=b.getPagesForNode(B.documentElement);var Z=b.diffPages(b.pages,X);X=new TextareaDialog(b,mxResources.get("merge")+":",JSON.stringify(Z,null,2),function(Y){try{if(0<Y.length&&b.editor.graph.isEnabled()){var aa=[JSON.parse(Y)];b.confirm(mxResources.get("areYouSure"),function(){try{f.patch(aa,null,!0,!0),b.hideDialog(),b.hideDialog()}catch(da){b.handleError(da)}})}else b.hideDialog()}catch(da){b.handleError(da)}},null,null,null,null,function(Y,aa){if(null!=Z[EditorUi.DIFF_UPDATE]){var da=document.createElement("select"),ba=document.createElement("option");mxUtils.write(ba,mxResources.get("allPages"));ba.setAttribute("value","allPages");da.appendChild(ba);for(var ha in Z[EditorUi.DIFF_UPDATE]){ba=document.createElement("option");var la=b.getPageById(ha);null!=la&&(mxUtils.write(ba,la.getName()),ba.setAttribute("value","page-"+ha),da.appendChild(ba))}da.style.marginRight="8px";da.style.order="-1";mxEvent.addListener(da,"change",function(ra){ra=null;if("allPages"!=da.value){var sa=da.value.substring(5);null!=Z[EditorUi.DIFF_UPDATE][sa]&&(ra={},ra[EditorUi.DIFF_UPDATE]={},ra[EditorUi.DIFF_UPDATE][sa]=Z[EditorUi.DIFF_UPDATE][sa])}aa.value=JSON.stringify(null==ra?Z:ra,null,2)});2<da.children.length&&Y.appendChild(da)}},!0,null,mxResources.get(b.editor.graph.isEnabled()?"merge":"close"));b.showDialog(X.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));X.init()}}));var g=mxUtils.button(mxResources.get("restore"),-function(X){null!=B&&null!=F&&b.confirm(mxResources.get("areYouSure"),function(){null!=m?m(F):b.spinner.spin(document.body,mxResources.get("restoring"))&&(g.setAttribute("disabled","disabled"),f.save(!0,function(Z){b.spinner.stop();g.removeAttribute("disabled");b.replaceFileData(F);b.hideDialog()},function(Z){b.spinner.stop();g.removeAttribute("disabled");b.clearStatus();b.handleError(Z,null!=Z?mxResources.get("errorSavingFile"):null)}))})});g.className="geBtn gePrimaryBtn";g.setAttribute("disabled",+function(X){null!=B&&null!=G&&b.confirm(mxResources.get("areYouSure"),function(){null!=m?m(G):b.spinner.spin(document.body,mxResources.get("restoring"))&&(g.setAttribute("disabled","disabled"),f.save(!0,function(Z){b.spinner.stop();g.removeAttribute("disabled");b.replaceFileData(G);b.hideDialog()},function(Z){b.spinner.stop();g.removeAttribute("disabled");b.clearStatus();b.handleError(Z,null!=Z?mxResources.get("errorSavingFile"):null)}))})});g.className="geBtn gePrimaryBtn";g.setAttribute("disabled","disabled");var p=document.createElement("select");p.setAttribute("disabled","disabled");p.style.userSelect="none";p.style.maxWidth="100px";p.style.marginLeft="10px";p.style.display="none";var v=null;mxEvent.addListener(p,"change",function(X){null!=v&&(v(X),mxEvent.consume(X))});var C=mxUtils.button(mxResources.get("open"),function(){null!=B&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(B.documentElement)),b.openLink(b.getUrl(),null,!0))});C.className="geBtn";C.setAttribute("disabled","disabled");var E=mxUtils.button(mxResources.get("createRevision"),function(){b.actions.get("save").funct(!1)});E.className="geBtn";E.setAttribute("disabled","disabled");null!=m&&(C.style.display="none");l=document.createElement("div");l.style.position="absolute";l.style.top="482px";l.style.right="28px";l.style.left="32px";l.style.justifyContent="end";l.style.display="flex";var I=document.createElement("div");I.className="geToolbarContainer";I.style.backgroundColor="transparent";I.style.left="32px";I.style.right="32px";I.style.border="none";I.style.top="442px";var O=null;if(null!=k&&0<k.length){u.style.cursor="move";var Q=document.createElement("table");Q.style.borderWidth="1px";Q.style.borderStyle="solid";Q.style.borderCollapse="collapse";Q.style.borderSpacing="0px";Q.style.width="100%";var V=document.createElement("tbody"),W=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(J=mxUtils.indexOf(b.pages,b.currentPage));for(r=k.length-1;0<=r;r--){var M=function(X){var Z=new Date(X.modifiedDate),Y=null;if(0<=Z.getTime()){var aa=function(ba){c.stop();y.innerText="";var ha=mxUtils.parseXml(ba),la=b.editor.extractGraphModel(ha.documentElement,!0);if(null!=la){var ra=function(Ba){null!=Ba&&(Ba=sa(Editor.parseDiagramNode(Ba)));return Ba},sa=function(Ba){var Aa=Ba.getAttribute("background");if(null==Aa||""==Aa||Aa==mxConstants.NONE)Aa=A.defaultPageBackgroundColor;u.style.backgroundColor=mxUtils.getLightDarkColor(Aa);(new mxCodec(Ba.ownerDocument)).decode(Ba,-A.getModel());A.maxFitScale=1;A.fit(8);A.center();A.mathEnabled="1"==Ba.getAttribute("math");A.setAdaptiveColors(Ba.getAttribute("adaptiveColors"));Editor.MathJaxRender&&A.mathEnabled&&Editor.MathJaxRender(A.container);return Ba};p.style.display="none";p.innerText="";B=ha;F=ba;K=parseSelectFunction=null;H=0;if("mxfile"==la.nodeName){ha=la.getElementsByTagName("diagram");K=[];for(ba=0;ba<ha.length;ba++)K.push(ha[ba]);H=Math.min(J,K.length-1);0<K.length&&ra(K[H]);if(1<K.length)for(p.removeAttribute("disabled"),-p.style.display="",ba=0;ba<K.length;ba++){ha=document.createElement("option");ha.setAttribute("title",va+" ("+K[ba].getAttribute("id")+")");ha.setAttribute("value",ba);var va=K[ba].getAttribute("name")||mxResources.get("pageWithNumber",[ba+1]);la=b.getPageById(K[ba].getAttribute("id"));var wa="";if(null!=la){var qa=new DiagramPage(K[ba]);b.getHashValueForPages([la])!=b.getHashValueForPages([qa])&&(wa=" (M)")}else wa=" (X)";mxUtils.write(ha,va+wa);ba==H&&ha.setAttribute("selected","selected");p.appendChild(ha)}v=-function(){try{var Ba=parseInt(p.value);H=J=Ba;ra(K[Ba])}catch(Aa){p.value=J,b.handleError(Aa)}}}else sa(la);va=X.lastModifyingUserName;null!=va&&20<va.length&&(va=va.substring(0,20)+"...");S.innerText="";mxUtils.write(S,(null!=va?va+" ":"")+Z.toLocaleDateString()+" "+Z.toLocaleTimeString());S.setAttribute("title",Y.getAttribute("title"));L.removeAttribute("disabled");D.removeAttribute("disabled");T.removeAttribute("disabled");N.removeAttribute("disabled");R.removeAttribute("disabled");null!=f&&f.isRestricted()||+A.getModel());A.maxFitScale=1;A.fit(8);A.center();A.mathEnabled="1"==Ba.getAttribute("math");A.setAdaptiveColors(Ba.getAttribute("adaptiveColors"));Editor.MathJaxRender&&A.mathEnabled&&Editor.MathJaxRender(A.container);return Ba};p.style.display="none";p.innerText="";B=ha;G=ba;K=parseSelectFunction=null;F=0;if("mxfile"==la.nodeName){ha=la.getElementsByTagName("diagram");K=[];for(ba=0;ba<ha.length;ba++)K.push(ha[ba]);F=Math.min(J,K.length-1);0<K.length&&ra(K[F]);if(1<K.length)for(p.removeAttribute("disabled"),+p.style.display="",ba=0;ba<K.length;ba++){ha=document.createElement("option");ha.setAttribute("title",va+" ("+K[ba].getAttribute("id")+")");ha.setAttribute("value",ba);var va=K[ba].getAttribute("name")||mxResources.get("pageWithNumber",[ba+1]);la=b.getPageById(K[ba].getAttribute("id"));var wa="";if(null!=la){var qa=new DiagramPage(K[ba]);b.getHashValueForPages([la])!=b.getHashValueForPages([qa])&&(wa=" (M)")}else wa=" (X)";mxUtils.write(ha,va+wa);ba==F&&ha.setAttribute("selected","selected");p.appendChild(ha)}v=+function(){try{var Ba=parseInt(p.value);F=J=Ba;ra(K[Ba])}catch(Aa){p.value=J,b.handleError(Aa)}}}else sa(la);va=X.lastModifyingUserName;null!=va&&20<va.length&&(va=va.substring(0,20)+"...");S.innerText="";mxUtils.write(S,(null!=va?va+" ":"")+Z.toLocaleDateString()+" "+Z.toLocaleTimeString());S.setAttribute("title",Y.getAttribute("title"));L.removeAttribute("disabled");D.removeAttribute("disabled");T.removeAttribute("disabled");N.removeAttribute("disabled");R.removeAttribute("disabled");null!=f&&f.isRestricted()||(b.editor.graph.isEnabled()&&g.removeAttribute("disabled"),C.removeAttribute("disabled"),E.removeAttribute("disabled"));mxUtils.setOpacity(L,60);mxUtils.setOpacity(D,60);mxUtils.setOpacity(T,60);mxUtils.setOpacity(N,60);mxUtils.setOpacity(R,60)}else p.style.display="none",p.innerText="",S.innerText="",y.innerText="",mxUtils.write(S,mxResources.get("errorLoadingFile")),mxUtils.write(y,mxResources.get("errorLoadingFile"))};Y=document.createElement("tr");Y.style.borderBottomWidth="1px";Y.style.borderBottomStyle="solid";Y.style.fontSize="12px";Y.style.cursor="pointer";var da=document.createElement("td");da.style.padding="6px";da.style.whiteSpace="nowrap";X==k[k.length-1]?mxUtils.write(da,mxResources.get("current")):Z.toDateString()===W?mxUtils.write(da,Z.toLocaleTimeString()):mxUtils.write(da,Z.toLocaleDateString()+" "+Z.toLocaleTimeString());Y.appendChild(da);Y.setAttribute("title",Z.toLocaleDateString()+" "+Z.toLocaleTimeString()+(null!=X.fileSize?" "+b.formatFileSize(parseInt(X.fileSize)):"")+(null!=X.lastModifyingUserName?-" "+X.lastModifyingUserName:""));mxEvent.addListener(Y,"click",function(ba){x!=X&&(c.stop(),null!=t&&(t.style.backgroundColor=""),x=X,t=Y,t.style.backgroundColor="light-dark(#ebf2f9, #000000)",F=B=null,S.removeAttribute("title"),S.innerText=mxResources.get("loading")+"...",u.style.backgroundColor=A.defaultPageBackgroundColor,y.innerText="",A.getModel().clear(),g.setAttribute("disabled","disabled"),L.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),T.setAttribute("disabled",+" "+X.lastModifyingUserName:""));mxEvent.addListener(Y,"click",function(ba){x!=X&&(c.stop(),null!=t&&(t.style.backgroundColor=""),x=X,t=Y,t.style.backgroundColor="light-dark(#ebf2f9, #000000)",G=B=null,S.removeAttribute("title"),S.innerText=mxResources.get("loading")+"...",u.style.backgroundColor=A.defaultPageBackgroundColor,y.innerText="",A.getModel().clear(),g.setAttribute("disabled","disabled"),L.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled"),N.setAttribute("disabled","disabled"),R.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),p.setAttribute("disabled","disabled"),mxUtils.setOpacity(L,20),mxUtils.setOpacity(D,20),mxUtils.setOpacity(T,20),mxUtils.setOpacity(N,20),mxUtils.setOpacity(R,20),c.spin(u),X.getXml(function(ha){if(x==X)try{aa(ha)}catch(la){S.innerText=mxResources.get("error")+": "+la.message}},function(ha){c.stop();p.style.display="none";p.innerText="";S.innerText="";mxUtils.write(S,mxResources.get("errorLoadingFile"));mxUtils.write(y,mxResources.get("errorLoadingFile"))}),mxEvent.consume(ba))});mxEvent.addListener(Y,"dblclick",function(ba){C.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(ba)},!1);V.appendChild(Y)}return Y}(k[r]);null!=M&&r==k.length-1&&(O=M)}Q.appendChild(V);q.appendChild(Q)}else null==f||null==b.drive&&f.constructor==window.DriveFile||null==b.dropbox&&f.constructor==window.DropboxFile?(u.style.display="none",I.style.display="none",mxUtils.write(q,mxResources.get("notAvailable"))):(u.style.display="none",I.style.display="none",mxUtils.write(q,mxResources.get("noRevisions")));this.init=function(){null!=O&&O.click()};q=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});q.className="geBtn";I.appendChild(S);I.appendChild(N);I.appendChild(D);I.appendChild(T);I.appendChild(L);I.appendChild(p);I.appendChild(R);b.editor.cancelFirst&&l.appendChild(q);l.appendChild(C);null!=f&&f.constructor==DriveFile&&l.appendChild(E);l.appendChild(g);b.editor.cancelFirst||l.appendChild(q);d.appendChild(l);d.appendChild(I);this.container=d},RecoveryDialog=function(b,k,m,d){var q=document.createElement("div");q.style.paddingBottom="10px";b=document.createElement("h3");mxUtils.write(b,mxResources.get("recoverTitle"));q.appendChild(b);b=function(y){var A=document.createElement("div");A.className="geDialogSection";A.style.cursor="pointer";A.style.marginBottom="8px";A.style.padding="10px";var J=document.createElement("div");J.style.fontWeight="600";J.style.marginBottom="4px";mxUtils.write(J,y.label);A.appendChild(J);null!=y.description&&(J=document.createElement("div"),J.style.fontSize="12px",J.style.opacity="0.75",mxUtils.write(J,y.description),A.appendChild(J));mxEvent.addListener(A,"click",function(){m(y)});q.appendChild(A)};for(var u=0;u<k.length;u++)b(k[u]);k=document.createElement("div");k.style.marginTop="34px";k.style.textAlign="right";b=mxUtils.button(mxResources.get("cancel"),function(){null!=d&&d()});b.className="geBtn";k.appendChild(b);-q.appendChild(k);this.container=q},DraftDialog=function(b,k,m,d,q,u,y,A,J){var K=document.createElement("div"),H=document.createElement("div");H.style.marginTop="0px";H.style.whiteSpace="nowrap";H.style.overflow="auto";H.style.lineHeight="normal";mxUtils.write(H,k);K.appendChild(H);var G=document.createElement("select"),c=mxUtils.bind(this,function(){"-1"==G.value?(G.value=G.options[0].value,c(),b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var N=this,R;return $jscomp.asyncExecutePromiseGeneratorProgram(function(P){for(R=-0;R<J.length;R++)q.apply(N,[R,mxUtils.bind(N,function(){})]);b.hideDialog(!0);P.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(x=mxUtils.parseXml(J[G.value].data),B=b.editor.extractGraphModel(x.documentElement,!0),F=0,this.init())});if(null!=J){G.style.marginLeft="4px";for(k=0;k<J.length;k++){var f=document.createElement("option");f.setAttribute("value",k);var l=new Date(J[k].created),n=new Date(J[k].modified);mxUtils.write(f,l.toLocaleDateString()+" "+l.toLocaleTimeString()+" - "+-(l.toDateString(),n.toDateString(),n.toLocaleDateString())+" "+n.toLocaleTimeString());G.appendChild(f)}f=document.createElement("option");f.setAttribute("value","-1");mxUtils.write(f,mxResources.get("deleteAll"));G.appendChild(f);H.appendChild(G);mxEvent.addListener(G,"change",c)}null==m&&(m=J[0].data);var r=document.createElement("div");r.style.position="absolute";r.style.border="1px solid lightGray";r.style.marginTop="10px";r.style.left="40px";r.style.right="40px";r.style.top="46px";r.style.bottom=-"74px";r.style.overflow="hidden";mxEvent.disableContextMenu(r);K.appendChild(r);var t=new Graph(r);t.setEnabled(!1);t.setPanning(!0);t.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";t.panningHandler.ignoreCell=!0;t.panningHandler.useLeftButtonForPanning=!0;t.minFitScale=null;t.maxFitScale=null;t.centerZoom=!0;var x=mxUtils.parseXml(m),B=b.editor.extractGraphModel(x.documentElement,!0),F=0,L=null,D=t.getGlobalVariable;t.getGlobalVariable=function(N){return"page"==N&&null!=L&&null!=L[F]?L[F].getAttribute("name"):-"pagenumber"==N?F+1:"pagecount"==N?null!=L?L.length:1:D.apply(this,arguments)};t.getLinkForCell=function(){return null};m=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){t.zoomIn()},20);H=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){t.zoomOut()},20);k=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==t.view.scale?(t.maxFitScale=8,t.fit(8)):t.zoomActual();t.center()},20);y=mxUtils.button(y||mxResources.get("discard"),-function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var N=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(R){q.apply(N,[G.value,mxUtils.bind(N,function(){null!=G.parentNode&&(G.options[G.selectedIndex].parentNode.removeChild(G.options[G.selectedIndex]),1<G.options.length?(G.value=G.options[0].value,c()):b.hideDialog(!0))})]);R.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))});y.className="geBtn";var T=document.createElement("select");-T.style.maxWidth="80px";T.style.position="relative";T.style.top="-2px";T.style.verticalAlign="bottom";T.style.marginRight="6px";T.style.display="none";u=mxUtils.button(u||mxResources.get("edit"),function(){d.apply(this,[G.value])});u.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.position="absolute";f.style.bottom="30px";f.style.right="40px";f.style.textAlign="right";l=document.createElement("div");l.className="geToolbarContainer";l.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";-this.init=function(){function N(S){if(null!=S){var z=S.getAttribute("background");if(null==z||""==z||z==mxConstants.NONE)z="light-dark(#ffffff, transparent)";r.style.backgroundColor=z;(new mxCodec(S.ownerDocument)).decode(S,t.getModel());t.maxFitScale=1;t.fit(8);t.center()}return S}function R(S){if(null!=S)try{S=N(Editor.parseDiagramNode(S))}catch(z){b.handleError(z)}return S}mxEvent.addListener(T,"change",function(S){F=parseInt(T.value);R(L[F]);mxEvent.consume(S)});if("mxfile"==B.nodeName){var P=-B.getElementsByTagName("diagram");L=[];for(var U=0;U<P.length;U++)L.push(P[U]);0<L.length&&R(L[F]);T.innerText="";if(1<L.length)for(T.style.display="",U=0;U<L.length;U++)P=document.createElement("option"),mxUtils.write(P,L[U].getAttribute("name")||mxResources.get("pageWithNumber",[U+1])),P.setAttribute("value",U),U==F&&P.setAttribute("selected","selected"),T.appendChild(P);else T.style.display="none"}else N(B)};l.appendChild(T);l.appendChild(m);l.appendChild(H);l.appendChild(k);m=mxUtils.button(mxResources.get("cancel"),+q.appendChild(k);this.container=q},DraftDialog=function(b,k,m,d,q,u,y,A,J){var K=document.createElement("div"),F=document.createElement("div");F.style.marginTop="0px";F.style.whiteSpace="nowrap";F.style.overflow="auto";F.style.lineHeight="normal";mxUtils.write(F,k);K.appendChild(F);var H=document.createElement("select"),c=mxUtils.bind(this,function(){"-1"==H.value?(H.value=H.options[0].value,c(),b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var N=this,R;return $jscomp.asyncExecutePromiseGeneratorProgram(function(P){for(R=+0;R<J.length;R++)q.apply(N,[R,mxUtils.bind(N,function(){})]);b.hideDialog(!0);P.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(x=mxUtils.parseXml(J[H.value].data),B=b.editor.extractGraphModel(x.documentElement,!0),G=0,this.init())});if(null!=J){H.style.marginLeft="4px";for(k=0;k<J.length;k++){var f=document.createElement("option");f.setAttribute("value",k);var l=new Date(J[k].created),n=new Date(J[k].modified);mxUtils.write(f,l.toLocaleDateString()+" "+l.toLocaleTimeString()+" - "++(l.toDateString(),n.toDateString(),n.toLocaleDateString())+" "+n.toLocaleTimeString());H.appendChild(f)}f=document.createElement("option");f.setAttribute("value","-1");mxUtils.write(f,mxResources.get("deleteAll"));H.appendChild(f);F.appendChild(H);mxEvent.addListener(H,"change",c)}null==m&&(m=J[0].data);var r=document.createElement("div");r.style.position="absolute";r.style.border="1px solid lightGray";r.style.marginTop="10px";r.style.left="40px";r.style.right="40px";r.style.top="46px";r.style.bottom=+"74px";r.style.overflow="hidden";mxEvent.disableContextMenu(r);K.appendChild(r);var t=new Graph(r);t.setEnabled(!1);t.setPanning(!0);t.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";t.panningHandler.ignoreCell=!0;t.panningHandler.useLeftButtonForPanning=!0;t.minFitScale=null;t.maxFitScale=null;t.centerZoom=!0;var x=mxUtils.parseXml(m),B=b.editor.extractGraphModel(x.documentElement,!0),G=0,L=null,D=t.getGlobalVariable;t.getGlobalVariable=function(N){return"page"==N&&null!=L&&null!=L[G]?L[G].getAttribute("name"):+"pagenumber"==N?G+1:"pagecount"==N?null!=L?L.length:1:D.apply(this,arguments)};t.getLinkForCell=function(){return null};m=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){t.zoomIn()},20);F=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){t.zoomOut()},20);k=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==t.view.scale?(t.maxFitScale=8,t.fit(8)):t.zoomActual();t.center()},20);y=mxUtils.button(y||mxResources.get("discard"),+function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var N=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(R){q.apply(N,[H.value,mxUtils.bind(N,function(){null!=H.parentNode&&(H.options[H.selectedIndex].parentNode.removeChild(H.options[H.selectedIndex]),1<H.options.length?(H.value=H.options[0].value,c()):b.hideDialog(!0))})]);R.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))});y.className="geBtn";var T=document.createElement("select");+T.style.maxWidth="80px";T.style.position="relative";T.style.top="-2px";T.style.verticalAlign="bottom";T.style.marginRight="6px";T.style.display="none";u=mxUtils.button(u||mxResources.get("edit"),function(){d.apply(this,[H.value])});u.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.position="absolute";f.style.bottom="30px";f.style.right="40px";f.style.textAlign="right";l=document.createElement("div");l.className="geToolbarContainer";l.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";+this.init=function(){function N(S){if(null!=S){var z=S.getAttribute("background");if(null==z||""==z||z==mxConstants.NONE)z="light-dark(#ffffff, transparent)";r.style.backgroundColor=z;(new mxCodec(S.ownerDocument)).decode(S,t.getModel());t.maxFitScale=1;t.fit(8);t.center()}return S}function R(S){if(null!=S)try{S=N(Editor.parseDiagramNode(S))}catch(z){b.handleError(z)}return S}mxEvent.addListener(T,"change",function(S){G=parseInt(T.value);R(L[G]);mxEvent.consume(S)});if("mxfile"==B.nodeName){var P=+B.getElementsByTagName("diagram");L=[];for(var U=0;U<P.length;U++)L.push(P[U]);0<L.length&&R(L[G]);T.innerText="";if(1<L.length)for(T.style.display="",U=0;U<L.length;U++)P=document.createElement("option"),mxUtils.write(P,L[U].getAttribute("name")||mxResources.get("pageWithNumber",[U+1])),P.setAttribute("value",U),U==G&&P.setAttribute("selected","selected"),T.appendChild(P);else T.style.display="none"}else N(B)};l.appendChild(T);l.appendChild(m);l.appendChild(F);l.appendChild(k);m=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});m.className="geBtn";A=null!=A?mxUtils.button(mxResources.get("ignore"),A):null;null!=A&&(A.className="geBtn");b.editor.cancelFirst?(f.appendChild(m),null!=A&&f.appendChild(A),f.appendChild(y),f.appendChild(u)):(f.appendChild(u),f.appendChild(y),null!=A&&f.appendChild(A),f.appendChild(m));K.appendChild(f);K.appendChild(l);this.container=K},FindWindow=function(b,k,m,d,q,u){function y(v,C,E){if("object"===typeof C.value&&null!=C.value.attributes){C=C.value.attributes;for(var I=-0;I<C.length;I++)if("label"!=C[I].nodeName){var O=mxUtils.trim(C[I].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==v&&0<=O.indexOf(E)||null!=v&&v.test(O))return!0}}return!1}function A(){f?(z.removeAttribute("disabled"),g.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),g.setAttribute("disabled","disabled"));F.value?p.removeAttribute("disabled"):p.setAttribute("disabled","disabled")}function J(v,C,E){U.innerText="";var I=H.model.getDescendants(H.model.getRoot()),-O=F.value.toLowerCase(),Q=D.checked?new RegExp(O):null,V=null;n=null;G!=O&&(G=O,c=null,l=!1);var W=null==c;if(0<O.length){if(l){l=!1;for(var M,X=0;X<b.pages.length;X++)if(b.currentPage==b.pages[X]){M=X;break}v=(M+1)%b.pages.length;c=null;do l=!1,O=b.pages[v],H=b.createTemporaryGraph(H.getStylesheet()),b.updatePageRoot(O),H.model.setRoot(O.root),v=(v+1)%b.pages.length;while(!J(!0,C,E)&&v!=M);c&&(c=null,E?b.editor.graph.model.execute(new SelectPage(b,O)):b.selectPage(O));l=!1;H=b.editor.graph;return J(!0,-C,E)}for(X=0;X<I.length;X++){M=H.view.getState(I[X]);C&&(W=W||M==c);if(null!=M&&null!=M.cell.value&&(W||null==V)&&(H.model.isVertex(M.cell)||H.model.isEdge(M.cell))){null!=M.style&&"1"==M.style.html?(N.innerHTML=H.sanitizeHtml(H.getLabel(M.cell)),label=mxUtils.extractTextWithWhitespace([N])):label=H.getLabel(M.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var Z=0;C&&u&&M==c&&(label=label.substr(r),Z=r);var Y=null==L||""==L.value;if(null==Q&&(0<=label.indexOf(O)||-Y&&y(Q,M.cell,O))||null!=Q&&(Q.test(label)||Y&&y(Q,M.cell,O)))if(u&&(null!=Q?(Y=label.match(Q),null!=Y&&0<Y.length&&(n=Y[0].toLowerCase(),r=Z+Y.index+n.length)):(n=O,r=Z+label.indexOf(O)+n.length)),W){V=M;break}else null==V&&(V=M)}W=W||M==c}}if(null!=V){if(X==I.length&&T.checked)return c=null,l=!0,J(!0,C,E);c=V;C=H.container;(null==C||c.x<C.scrollLeft||c.y<C.scrollTop||c.x+c.width>C.scrollLeft+C.clientWidth||c.y+c.height>C.scrollTop+C.clientHeight)&&H.scrollCellToVisible(c.cell,!0);H.isEnabled()&&-!H.isCellLocked(c.cell)?E||H.getSelectionCell()==c.cell&&1==H.getSelectionCount()||H.setSelectionCell(c.cell):H.highlightCell(c.cell)}else{if(!v&&T.checked)return l=!0,J(!0,C,E);H.isEnabled()&&!E&&H.clearSelection()}f=null!=V;u&&!v&&A();return 0==O.length||null!=V}var K=b.actions.get("findReplace"),H=b.editor.graph,G=null,c=null,f=!1,l=!1,n=null,r=0,t=1,x=document.createElement("div");x.style.userSelect="none";x.style.overflow="hidden";x.style.padding="10px";x.style.height="100%";var B=u?"260px":-"200px",F=document.createElement("input");F.setAttribute("placeholder",mxResources.get("find"));F.setAttribute("type","text");F.style.marginTop="4px";F.style.marginBottom="6px";F.style.width=B;F.style.fontSize="12px";F.style.borderRadius="4px";F.style.padding="6px";x.appendChild(F);mxUtils.br(x);if(u){var L=document.createElement("input");L.setAttribute("placeholder",mxResources.get("replaceWith"));L.setAttribute("type","text");L.style.marginTop="4px";L.style.marginBottom="6px";L.style.width=B;L.style.fontSize=+0;I<C.length;I++)if("label"!=C[I].nodeName){var O=mxUtils.trim(C[I].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==v&&0<=O.indexOf(E)||null!=v&&v.test(O))return!0}}return!1}function A(){f?(z.removeAttribute("disabled"),g.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),g.setAttribute("disabled","disabled"));G.value?p.removeAttribute("disabled"):p.setAttribute("disabled","disabled")}function J(v,C,E){U.innerText="";var I=F.model.getDescendants(F.model.getRoot()),+O=G.value.toLowerCase(),Q=D.checked?new RegExp(O):null,V=null;n=null;H!=O&&(H=O,c=null,l=!1);var W=null==c;if(0<O.length){if(l){l=!1;for(var M,X=0;X<b.pages.length;X++)if(b.currentPage==b.pages[X]){M=X;break}v=(M+1)%b.pages.length;c=null;do l=!1,O=b.pages[v],F=b.createTemporaryGraph(F.getStylesheet()),b.updatePageRoot(O),F.model.setRoot(O.root),v=(v+1)%b.pages.length;while(!J(!0,C,E)&&v!=M);c&&(c=null,E?b.editor.graph.model.execute(new SelectPage(b,O)):b.selectPage(O));l=!1;F=b.editor.graph;return J(!0,+C,E)}for(X=0;X<I.length;X++){M=F.view.getState(I[X]);C&&(W=W||M==c);if(null!=M&&null!=M.cell.value&&(W||null==V)&&(F.model.isVertex(M.cell)||F.model.isEdge(M.cell))){null!=M.style&&"1"==M.style.html?(N.innerHTML=F.sanitizeHtml(F.getLabel(M.cell)),label=mxUtils.extractTextWithWhitespace([N])):label=F.getLabel(M.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var Z=0;C&&u&&M==c&&(label=label.substr(r),Z=r);var Y=null==L||""==L.value;if(null==Q&&(0<=label.indexOf(O)||+Y&&y(Q,M.cell,O))||null!=Q&&(Q.test(label)||Y&&y(Q,M.cell,O)))if(u&&(null!=Q?(Y=label.match(Q),null!=Y&&0<Y.length&&(n=Y[0].toLowerCase(),r=Z+Y.index+n.length)):(n=O,r=Z+label.indexOf(O)+n.length)),W){V=M;break}else null==V&&(V=M)}W=W||M==c}}if(null!=V){if(X==I.length&&T.checked)return c=null,l=!0,J(!0,C,E);c=V;C=F.container;(null==C||c.x<C.scrollLeft||c.y<C.scrollTop||c.x+c.width>C.scrollLeft+C.clientWidth||c.y+c.height>C.scrollTop+C.clientHeight)&&F.scrollCellToVisible(c.cell,!0);F.isEnabled()&&+!F.isCellLocked(c.cell)?E||F.getSelectionCell()==c.cell&&1==F.getSelectionCount()||F.setSelectionCell(c.cell):F.highlightCell(c.cell)}else{if(!v&&T.checked)return l=!0,J(!0,C,E);F.isEnabled()&&!E&&F.clearSelection()}f=null!=V;u&&!v&&A();return 0==O.length||null!=V}var K=b.actions.get("findReplace"),F=b.editor.graph,H=null,c=null,f=!1,l=!1,n=null,r=0,t=1,x=document.createElement("div");x.style.userSelect="none";x.style.overflow="hidden";x.style.padding="10px";x.style.height="100%";var B=u?"260px":+"200px",G=document.createElement("input");G.setAttribute("placeholder",mxResources.get("find"));G.setAttribute("type","text");G.style.marginTop="4px";G.style.marginBottom="6px";G.style.width=B;G.style.fontSize="12px";G.style.borderRadius="4px";G.style.padding="6px";x.appendChild(G);mxUtils.br(x);if(u){var L=document.createElement("input");L.setAttribute("placeholder",mxResources.get("replaceWith"));L.setAttribute("type","text");L.style.marginTop="4px";L.style.marginBottom="6px";L.style.width=B;L.style.fontSize="12px";L.style.borderRadius="4px";L.style.padding="6px";x.appendChild(L);mxUtils.br(x);mxEvent.addListener(L,"input",A)}var D=document.createElement("input");D.setAttribute("id","geFindWinRegExChck");D.setAttribute("type","checkbox");D.style.marginRight="4px";x.appendChild(D);B=document.createElement("label");B.setAttribute("for","geFindWinRegExChck");x.appendChild(B);mxUtils.write(B,mxResources.get("regularExpression"));x.appendChild(B);B=b.menus.createHelpLink("https://www.drawio.com/doc/faq/find-shapes");B.style.position="relative";B.style.marginLeft="6px";x.appendChild(B);mxUtils.br(x);var T=document.createElement("input");T.setAttribute("id","geFindWinAllPagesChck");T.setAttribute("type","checkbox");T.style.marginRight="4px";x.appendChild(T);B=document.createElement("label");B.setAttribute("for","geFindWinAllPagesChck");x.appendChild(B);mxUtils.write(B,mxResources.get("allPages"));x.appendChild(B);var N=document.createElement("div");mxUtils.br(x);B=document.createElement("div");B.style.left="0px";-B.style.right="0px";B.style.marginTop="6px";B.style.padding="0 6px 0 6px";x.appendChild(B);var R=mxUtils.button(mxResources.get("reset"),function(){U.innerText="";F.value="";F.style.backgroundColor="";u&&(L.value="",A());G=c=null;l=!1;F.focus()});R.setAttribute("title",mxResources.get("reset"));R.style.float="none";R.style.width="120px";R.style.marginTop="6px";R.style.marginLeft="8px";R.style.overflow="hidden";R.style.textOverflow="ellipsis";R.className="geBtn";u||B.appendChild(R);var P=mxUtils.button(mxResources.get("find"),-function(){try{F.style.backgroundColor=J()?"":"light-dark(#ffcfcf, #ff0000)"}catch(v){b.handleError(v)}});P.setAttribute("title",mxResources.get("find")+" (Enter)");P.style.float="none";P.style.width="120px";P.style.marginTop="6px";P.style.marginLeft="8px";P.style.overflow="hidden";P.style.textOverflow="ellipsis";P.className="geBtn gePrimaryBtn";B.appendChild(P);var U=document.createElement("div");U.style.marginTop="10px";if(u){var S=function(v,C,E,I,O){if(null==O||"1"!=O.html)return I=v.toLowerCase().indexOf(C,+B.style.right="0px";B.style.marginTop="6px";B.style.padding="0 6px 0 6px";x.appendChild(B);var R=mxUtils.button(mxResources.get("reset"),function(){U.innerText="";G.value="";G.style.backgroundColor="";u&&(L.value="",A());H=c=null;l=!1;G.focus()});R.setAttribute("title",mxResources.get("reset"));R.style.float="none";R.style.width="120px";R.style.marginTop="6px";R.style.marginLeft="8px";R.style.overflow="hidden";R.style.textOverflow="ellipsis";R.className="geBtn";u||B.appendChild(R);var P=mxUtils.button(mxResources.get("find"),+function(){try{G.style.backgroundColor=J()?"":"light-dark(#ffcfcf, #ff0000)"}catch(v){b.handleError(v)}});P.setAttribute("title",mxResources.get("find")+" (Enter)");P.style.float="none";P.style.width="120px";P.style.marginTop="6px";P.style.marginLeft="8px";P.style.overflow="hidden";P.style.textOverflow="ellipsis";P.className="geBtn gePrimaryBtn";B.appendChild(P);var U=document.createElement("div");U.style.marginTop="10px";if(u){var S=function(v,C,E,I,O){if(null==O||"1"!=O.html)return I=v.toLowerCase().indexOf(C,I),0>I?v:v.substr(0,I)+E+v.substr(I+C.length);var Q=v;C=mxUtils.htmlEntities(C,!1,!1,!1);O=[];var V=-1;for(v=v.replace(/<br>/ig,"\n").replace(/(\s|\S)(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1\n$2");-1<(V=v.indexOf("<",V+1));)O.push(V);V=v.match(/<[^>]*>/g);v=v.replace(/<[^>]*>/g,"");I=v.toLowerCase().indexOf(C,I);if(0>I)return Q;Q=I+C.length;E=mxUtils.htmlEntities(E);v=v.substr(0,I)+E+v.substr(Q);for(var W=0,M=0;M<O.length;M++){if(O[M]-W<I)v=v.substr(0,O[M])+V[M]+v.substr(O[M]);-else{var X=O[M]-W<Q?I+W:O[M]+(E.length-C.length);v=v.substr(0,X)+V[M]+v.substr(X)}W+=V[M].length}return v.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1").replace(/\n/g,"<br>")};B.style.textAlign="center";var z=mxUtils.button(mxResources.get("replFind"),function(){try{if(null!=n&&null!=c){var v=c.cell,C=H.getLabel(v);H.isCellEditable(v)&&H.model.setValue(v,S(C,n,L.value,r-n.length,H.getCurrentCellStyle(v)));F.style.backgroundColor=J(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(E){b.handleError(E)}});-z.setAttribute("title",mxResources.get("replFind"));z.style.float="none";z.style.width="120px";z.style.marginTop="6px";z.style.marginLeft="8px";z.style.overflow="hidden";z.style.textOverflow="ellipsis";z.className="geBtn gePrimaryBtn";z.setAttribute("disabled","disabled");B.appendChild(z);mxUtils.br(B);var g=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=n&&null!=c){var v=c.cell,C=H.getLabel(v);H.model.setValue(v,S(C,n,L.value,r-n.length,H.getCurrentCellStyle(v)));z.setAttribute("disabled",-"disabled");g.setAttribute("disabled","disabled")}}catch(E){b.handleError(E)}});g.setAttribute("title",mxResources.get("replace"));g.style.float="none";g.style.width="120px";g.style.marginTop="6px";g.style.marginLeft="8px";g.style.overflow="hidden";g.style.textOverflow="ellipsis";g.className="geBtn gePrimaryBtn";g.setAttribute("disabled","disabled");B.appendChild(g);var p=mxUtils.button(mxResources.get("replaceAll"),function(){U.innerText="";G=null;var v=b.currentPage,C=b.editor.graph.getSelectionCells();-b.editor.graph.rendering=!1;H.getModel().beginUpdate();try{for(var E=0,I={};J(!1,!0,!0)&&100>E;){var O=c.cell,Q=H.getLabel(O),V=I[O.id];if(V&&V.replAllMrk==t&&V.replAllPos>=r)break;I[O.id]={replAllMrk:t,replAllPos:r};H.isCellEditable(O)&&(H.model.setValue(O,S(Q,n,L.value,r-n.length,H.getCurrentCellStyle(O))),E++)}v!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,v));mxUtils.write(U,mxResources.get("matchesRepl",[E]))}catch(W){b.handleError(W)}finally{H.getModel().endUpdate(),b.editor.graph.setSelectionCells(C),+else{var X=O[M]-W<Q?I+W:O[M]+(E.length-C.length);v=v.substr(0,X)+V[M]+v.substr(X)}W+=V[M].length}return v.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1").replace(/\n/g,"<br>")};B.style.textAlign="center";var z=mxUtils.button(mxResources.get("replFind"),function(){try{if(null!=n&&null!=c){var v=c.cell,C=F.getLabel(v);F.isCellEditable(v)&&F.model.setValue(v,S(C,n,L.value,r-n.length,F.getCurrentCellStyle(v)));G.style.backgroundColor=J(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(E){b.handleError(E)}});+z.setAttribute("title",mxResources.get("replFind"));z.style.float="none";z.style.width="120px";z.style.marginTop="6px";z.style.marginLeft="8px";z.style.overflow="hidden";z.style.textOverflow="ellipsis";z.className="geBtn gePrimaryBtn";z.setAttribute("disabled","disabled");B.appendChild(z);mxUtils.br(B);var g=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=n&&null!=c){var v=c.cell,C=F.getLabel(v);F.model.setValue(v,S(C,n,L.value,r-n.length,F.getCurrentCellStyle(v)));z.setAttribute("disabled",+"disabled");g.setAttribute("disabled","disabled")}}catch(E){b.handleError(E)}});g.setAttribute("title",mxResources.get("replace"));g.style.float="none";g.style.width="120px";g.style.marginTop="6px";g.style.marginLeft="8px";g.style.overflow="hidden";g.style.textOverflow="ellipsis";g.className="geBtn gePrimaryBtn";g.setAttribute("disabled","disabled");B.appendChild(g);var p=mxUtils.button(mxResources.get("replaceAll"),function(){U.innerText="";H=null;var v=b.currentPage,C=b.editor.graph.getSelectionCells();+b.editor.graph.rendering=!1;F.getModel().beginUpdate();try{for(var E=0,I={};J(!1,!0,!0)&&100>E;){var O=c.cell,Q=F.getLabel(O),V=I[O.id];if(V&&V.replAllMrk==t&&V.replAllPos>=r)break;I[O.id]={replAllMrk:t,replAllPos:r};F.isCellEditable(O)&&(F.model.setValue(O,S(Q,n,L.value,r-n.length,F.getCurrentCellStyle(O))),E++)}v!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,v));mxUtils.write(U,mxResources.get("matchesRepl",[E]))}catch(W){b.handleError(W)}finally{F.getModel().endUpdate(),b.editor.graph.setSelectionCells(C),b.editor.graph.rendering=!0}t++});p.setAttribute("title",mxResources.get("replaceAll"));p.style.float="none";p.style.width="120px";p.style.marginTop="6px";p.style.marginLeft="8px";p.style.overflow="hidden";p.style.textOverflow="ellipsis";p.className="geBtn gePrimaryBtn";p.setAttribute("disabled","disabled");B.appendChild(p);mxUtils.br(B);B.appendChild(R);R=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,function(){this.window.setVisible(!1)}));R.setAttribute("title",mxResources.get("close"));-R.style.float="none";R.style.width="120px";R.style.marginTop="6px";R.style.marginLeft="8px";R.style.overflow="hidden";R.style.textOverflow="ellipsis";R.className="geBtn";B.appendChild(R);mxUtils.br(B);B.appendChild(U)}else B.style.display="flex",B.style.alignItems="center",R.style.width="",P.style.width="";mxEvent.addListener(F,"keyup",function(v){if(91==v.keyCode||93==v.keyCode||17==v.keyCode)mxEvent.consume(v);else if(27==v.keyCode)K.funct();else if(G!=F.value.toLowerCase()||13==v.keyCode)try{F.style.backgroundColor=-J()?"":"light-dark(#ffcfcf, #ff0000)"}catch(C){F.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(x,"keydown",function(v){70==v.keyCode&&b.keyHandler.isControlDown(v)&&!mxEvent.isShiftDown(v)&&(K.funct(),mxEvent.consume(v))});this.window=new mxWindow(mxResources.get("find")+(u?"/"+mxResources.get("replace"):""),x,k,m,d,q,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",-mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(F.focus(),mxClient.IS_GC||mxClient.IS_FF?F.select():document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?T.removeAttribute("disabled"):(T.checked=!1,T.setAttribute("disabled","disabled"))):H.container.focus()}));b.installResizeHandler(this,!1);this.doSearch=function(v){F.focus();F.value=v;P.click()}},FreehandWindow=function(b,k,m,d,q,u){var y=b.editor.graph,A=document.createElement("div");A.style.textAlign=-"center";A.style.userSelect="none";A.style.overflow="hidden";A.style.height="100%";if(u){var J=function(){var f=y.freehand.getStrokeColor(!0);null!=f&&f!=mxConstants.NONE&&1<f.length&&"string"===typeof f&&("default"==f?f=mxResources.get("useBlackAndWhite"):(f="#"==f.charAt(0)?f.substring(1).toUpperCase():f,f=ColorDialog.prototype.colorNames[f]),null!=f&&H.setAttribute("title",f))},K=document.createElement("input");K.setAttribute("id","geFreehandBrush");K.setAttribute("type","checkbox");K.checked=-y.freehand.isPerfectFreehandMode();K.style.margin="10px 5px 0px 10px";K.style.float="left";A.appendChild(K);y.freehand.setPerfectFreehandMode(K.checked);u=document.createElement("label");u.setAttribute("for","geFreehandBrush");u.style.float="left";u.style.marginTop="10px";A.appendChild(u);mxUtils.write(u,mxResources.get("brush"));A.appendChild(u);var H=document.createElement("tempDiv");H.style.display="block";H.style.width="100%";H.style.height="100%";H.style.borderRadius="2px";H.style.boxSizing=-"border-box";H.style.border="1px solid black";H.style.backgroundColor=y.freehand.getStrokeColor();b.addListener("darkModeChanged",function(){H.style.backgroundColor=y.freehand.getStrokeColor()});J();u=mxUtils.button("",mxUtils.bind(this,function(f){b.pickColor(y.freehand.getStrokeColor(!0),function(l){y.freehand.setStrokeColor(l);H.style.backgroundColor=y.freehand.getStrokeColor();J()},"default");mxEvent.consume(f)}));u.style.position="absolute";u.style.boxSizing="border-box";u.style.padding="2px";-u.style.top="8px";u.style.right="8px";u.style.width="28px";u.style.height="18px";u.className="geColorBtn";u.innerText="";u.appendChild(H);A.appendChild(u);u=document.createElement("img");u.setAttribute("title",mxResources.get("settings"));u.setAttribute("src",Editor.gearImage);u.className="geButton";u.style.position="absolute";u.style.boxSizing="border-box";u.style.padding="2px";u.style.top="8px";u.style.right="38px";u.style.width="18px";u.style.height="18px";u.style.opacity="0.6";A.appendChild(u);-mxEvent.addListener(u,"click",mxUtils.bind(this,function(f){f=y.freehand.getSmoothing();b.prompt(mxResources.get("smoothing")+" (1-20)",f,function(l){!isNaN(l)&&0<l&&20>=l&&y.freehand.setSmoothing(parseInt(l))})}));mxUtils.br(A);var G=document.createElement("input");G.setAttribute("type","range");G.setAttribute("min","2");G.setAttribute("max","30");G.setAttribute("value",y.freehand.getBrushSize());G.style.width="90%";G.style.visibility="hidden";A.appendChild(G);mxUtils.br(A);u=function(){y.freehand.setPerfectFreehandMode(K.checked);-G.style.visibility=K.checked?"visible":"hidden"};mxEvent.addListener(K,"change",u);u();mxEvent.addListener(G,"change",function(){y.freehand.setBrushSize(parseInt(this.value))})}var c=mxUtils.button(mxResources.get("startDrawing"),function(){y.freehand.isDrawing()?y.freehand.stopDrawing():y.freehand.startDrawing()});c.setAttribute("title",mxResources.get("startDrawing")+" (X)");c.style.width="90%";c.style.marginLeft="0px";c.style.position="relative";c.className="geBtn gePrimaryBtn";A.appendChild(c);+R.style.float="none";R.style.width="120px";R.style.marginTop="6px";R.style.marginLeft="8px";R.style.overflow="hidden";R.style.textOverflow="ellipsis";R.className="geBtn";B.appendChild(R);mxUtils.br(B);B.appendChild(U)}else B.style.display="flex",B.style.alignItems="center",R.style.width="",P.style.width="";mxEvent.addListener(G,"keyup",function(v){if(91==v.keyCode||93==v.keyCode||17==v.keyCode)mxEvent.consume(v);else if(27==v.keyCode)K.funct();else if(H!=G.value.toLowerCase()||13==v.keyCode)try{G.style.backgroundColor=+J()?"":"light-dark(#ffcfcf, #ff0000)"}catch(C){G.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(x,"keydown",function(v){70==v.keyCode&&b.keyHandler.isControlDown(v)&&!mxEvent.isShiftDown(v)&&(K.funct(),mxEvent.consume(v))});this.window=new mxWindow(mxResources.get("find")+(u?"/"+mxResources.get("replace"):""),x,k,m,d,q,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",+mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(G.focus(),mxClient.IS_GC||mxClient.IS_FF?G.select():document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?T.removeAttribute("disabled"):(T.checked=!1,T.setAttribute("disabled","disabled"))):F.container.focus()}));b.installResizeHandler(this,!1);this.doSearch=function(v){G.focus();G.value=v;P.click()}},FreehandWindow=function(b,k,m,d,q,u){var y=b.editor.graph,A=document.createElement("div");A.style.textAlign=+"center";A.style.userSelect="none";A.style.overflow="hidden";A.style.height="100%";if(u){var J=function(){var f=y.freehand.getStrokeColor(!0);null!=f&&f!=mxConstants.NONE&&1<f.length&&"string"===typeof f&&("default"==f?f=mxResources.get("useBlackAndWhite"):(f="#"==f.charAt(0)?f.substring(1).toUpperCase():f,f=ColorDialog.prototype.colorNames[f]),null!=f&&F.setAttribute("title",f))},K=document.createElement("input");K.setAttribute("id","geFreehandBrush");K.setAttribute("type","checkbox");K.checked=+y.freehand.isPerfectFreehandMode();K.style.margin="10px 5px 0px 10px";K.style.float="left";A.appendChild(K);y.freehand.setPerfectFreehandMode(K.checked);u=document.createElement("label");u.setAttribute("for","geFreehandBrush");u.style.float="left";u.style.marginTop="10px";A.appendChild(u);mxUtils.write(u,mxResources.get("brush"));A.appendChild(u);var F=document.createElement("tempDiv");F.style.display="block";F.style.width="100%";F.style.height="100%";F.style.borderRadius="2px";F.style.boxSizing=+"border-box";F.style.border="1px solid black";F.style.backgroundColor=y.freehand.getStrokeColor();b.addListener("darkModeChanged",function(){F.style.backgroundColor=y.freehand.getStrokeColor()});J();u=mxUtils.button("",mxUtils.bind(this,function(f){b.pickColor(y.freehand.getStrokeColor(!0),function(l){y.freehand.setStrokeColor(l);F.style.backgroundColor=y.freehand.getStrokeColor();J()},"default");mxEvent.consume(f)}));u.style.position="absolute";u.style.boxSizing="border-box";u.style.padding="2px";+u.style.top="8px";u.style.right="8px";u.style.width="28px";u.style.height="18px";u.className="geColorBtn";u.innerText="";u.appendChild(F);A.appendChild(u);u=document.createElement("img");u.setAttribute("title",mxResources.get("settings"));u.setAttribute("src",Editor.gearImage);u.className="geButton";u.style.position="absolute";u.style.boxSizing="border-box";u.style.padding="2px";u.style.top="8px";u.style.right="38px";u.style.width="18px";u.style.height="18px";u.style.opacity="0.6";A.appendChild(u);+mxEvent.addListener(u,"click",mxUtils.bind(this,function(f){f=y.freehand.getSmoothing();b.prompt(mxResources.get("smoothing")+" (1-20)",f,function(l){!isNaN(l)&&0<l&&20>=l&&y.freehand.setSmoothing(parseInt(l))})}));mxUtils.br(A);var H=document.createElement("input");H.setAttribute("type","range");H.setAttribute("min","2");H.setAttribute("max","30");H.setAttribute("value",y.freehand.getBrushSize());H.style.width="90%";H.style.visibility="hidden";A.appendChild(H);mxUtils.br(A);u=function(){y.freehand.setPerfectFreehandMode(K.checked);+H.style.visibility=K.checked?"visible":"hidden"};mxEvent.addListener(K,"change",u);u();mxEvent.addListener(H,"change",function(){y.freehand.setBrushSize(parseInt(this.value))})}var c=mxUtils.button(mxResources.get("startDrawing"),function(){y.freehand.isDrawing()?y.freehand.stopDrawing():y.freehand.startDrawing()});c.setAttribute("title",mxResources.get("startDrawing")+" (X)");c.style.width="90%";c.style.marginLeft="0px";c.style.position="relative";c.className="geBtn gePrimaryBtn";A.appendChild(c);this.window=new mxWindow(mxResources.get("freehand"),A,k,m,d,q,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);y.addListener("freehandStateChanged",mxUtils.bind(this,function(){c.innerText="";mxUtils.write(c,mxResources.get(y.freehand.isDrawing()?"stopDrawing":"startDrawing"));var f=document.createElement("span");f.className="geShortcutKey";f.style.margin="0 2px 4px 0";mxUtils.write(f,"X");c.appendChild(f);c.setAttribute("title",mxResources.get(y.freehand.isDrawing()?"stopDrawing":"startDrawing")+" (X)");c.className="geBtn"+(y.freehand.isDrawing()?" gePrimaryBtn":"")}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));this.window.addListener("hide",mxUtils.bind(this,function(){y.freehand.isDrawing()&&y.freehand.stopDrawing()}));b.installResizeHandler(this,!1)},AdaptiveColorsWindow=function(b,k,m,d,q){var u=b.editor.graph,y=document.createElement("div");y.style.userSelect="none";y.style.overflow=-"hidden";y.style.height="100%";var A=document.createElement("div");A.style.display="flex";A.style.alignItems="center";A.style.justifyContent="center";A.style.paddingTop="20px";var J=document.createElement("input");J.setAttribute("type","checkbox");J.style.marginRight="4px";J.checked=!0;var K=document.createElement("input");K.setAttribute("type","checkbox");K.style.marginRight="4px";K.checked=!0;var H=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),mxUtils.bind(this,function(){b.removeUserDefinedDarkColors(u.isSelectionEmpty()?-u.getVerticesAndEdges():u.getSelectionCells(),J.checked,K.checked)}));H.setAttribute("title","Convert Colors");H.className="geBtn gePrimaryBtn";A.appendChild(H);y.appendChild(A);A=A.cloneNode(!1);A.appendChild(K);A.style.paddingTop="8px";mxUtils.write(A,mxResources.get("background"));y.appendChild(A);A=A.cloneNode(!1);A.appendChild(J);A.style.paddingTop="8px";mxUtils.write(A,mxResources.get("labels"));y.appendChild(A);this.window=new mxWindow(mxResources.get("adaptiveColors"),y,k,m,d,q,!0,!0);this.window.destroyOnClose=+"hidden";y.style.height="100%";var A=document.createElement("div");A.style.display="flex";A.style.alignItems="center";A.style.justifyContent="center";A.style.paddingTop="20px";var J=document.createElement("input");J.setAttribute("type","checkbox");J.style.marginRight="4px";J.checked=!0;var K=document.createElement("input");K.setAttribute("type","checkbox");K.style.marginRight="4px";K.checked=!0;var F=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),mxUtils.bind(this,function(){b.removeUserDefinedDarkColors(u.isSelectionEmpty()?+u.getVerticesAndEdges():u.getSelectionCells(),J.checked,K.checked)}));F.setAttribute("title","Convert Colors");F.className="geBtn gePrimaryBtn";A.appendChild(F);y.appendChild(A);A=A.cloneNode(!1);A.appendChild(K);A.style.paddingTop="8px";mxUtils.write(A,mxResources.get("background"));y.appendChild(A);A=A.cloneNode(!1);A.appendChild(J);A.style.paddingTop="8px";mxUtils.write(A,mxResources.get("labels"));y.appendChild(A);this.window=new mxWindow(mxResources.get("adaptiveColors"),y,k,m,d,q,!0,!0);this.window.destroyOnClose=!1;this.window.setMinimizable(!1);this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!1)},ChatWindow=function(b,k,m,d,q){function u(){var ca={title:null,turns:[],el:document.createElement("div"),lastContext:null},fa=document.createElement("a");fa.style.display="flex";fa.style.alignItems="center";fa.style.gap="4px";fa.style.padding="5px 6px";fa.style.borderRadius="8px";fa.style.fontSize="11px";fa.style.cursor="default";fa.style.overflow="hidden";ca.item=fa;var oa=document.createElement("span");oa.style.flexGrow="1";oa.style.overflow="hidden";oa.style.textOverflow="ellipsis";oa.style.whiteSpace="nowrap";fa.appendChild(oa);ca.label=oa;var pa=document.createElement("img");pa.className="geAdaptiveAsset";pa.setAttribute("src",Editor.trashImage);pa.setAttribute("title",mxResources.get("delete"));pa.style.width="13px";pa.style.flexShrink="0";pa.style.cursor="pointer";pa.style.opacity="0";fa.appendChild(pa);mxEvent.addListener(fa,"mouseenter",function(){pa.style.opacity="0.6";ca.active||(fa.style.backgroundColor="light-dark(#ececec, #333333)")});mxEvent.addListener(fa,"mouseleave",function(){pa.style.opacity="0";ca.active||(fa.style.backgroundColor="transparent")});mxEvent.addListener(fa,"click",function(ua){mxEvent.getSource(ua)==pa?b.confirm(mxResources.get("areYouSure"),function(){var ya=mxUtils.indexOf(B,ca);0<=ya&&B.splice(ya,1);null!=ca.item.parentNode&&-ca.item.parentNode.removeChild(ca.item);ca==F&&(0<B.length?L(B[Math.min(ya,B.length-1)]):L(u()))}):ca!=F&&L(ca);mxEvent.consume(ua)});D(ca,null);t.insertBefore(fa,t.firstChild);B.splice(0,0,ca);return ca}function y(){var ca=document.createElement("div");ca.style.textAlign="left";ca.style.padding="6px";ca.style.margin="6px 0";return ca}function A(ca){var fa=document.createElement("div");fa.style.whiteSpace="pre-wrap";fa.style.overflow="auto";fa.innerHTML=Graph.sanitizeHtml(mxUtils.htmlEntities(ca,+ca.item.parentNode.removeChild(ca.item);ca==G&&(0<B.length?L(B[Math.min(ya,B.length-1)]):L(u()))}):ca!=G&&L(ca);mxEvent.consume(ua)});D(ca,null);t.insertBefore(fa,t.firstChild);B.splice(0,0,ca);return ca}function y(){var ca=document.createElement("div");ca.style.textAlign="left";ca.style.padding="6px";ca.style.margin="6px 0";return ca}function A(ca){var fa=document.createElement("div");fa.style.whiteSpace="pre-wrap";fa.style.overflow="auto";fa.innerHTML=Graph.sanitizeHtml(mxUtils.htmlEntities(ca,!1).replace(/\n*^##### (.+)$\n*/gm,"<h5>$1</h5>").replace(/\n*^#### (.+)$\n*/gm,"<h4>$1</h4>").replace(/\n*^### (.+)$\n*/gm,"<h3>$1</h3>").replace(/\n*^## (.+)$\n*/gm,"<h2>$1</h2>").replace(/\n*^# (.+)$\n*/gm,"<h1>$1</h1>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>"));return fa}function J(ca,fa){var oa=mxResources.get("error")+": ",pa=document.createElement("div");pa.style.whiteSpace="pre-wrap";ca=null!=ca&&null!=ca.message?ca.message:"string"===typeof ca?ca:mxResources.get("unknownError");"string"!==typeof ca&&(ca=String(ca));ca.substring(0,oa.length)!=oa&&(ca=oa+ca);mxUtils.write(pa,ca);if(null!=fa){oa=pa.appendChild;ca=document.createElement("div");ca.style.display="flex";var ua=document.createElement("img");ua.className="geAdaptiveAsset geLibraryButton";ua.setAttribute("src",Editor.refreshImage);ua.setAttribute("title",mxResources.get("retry"));ca.appendChild(ua);mxEvent.addListener(ua,"click",fa);oa.call(pa,ca)}return pa}-function K(){null!=Q&&Q();var ca=mxUtils.trim(z.value),fa=I();if(""!=ca||"clipboard"==fa.kind&&null!=P)try{var oa=P;P=null;U();null==F.title&&""!=ca&&D(F,40<ca.length?ca.substring(0,40)+"…":ca);Ca(F,ca,oa,fa);z.value="";g();ra()}catch(pa){EditorUi.debug("EditorUi.ChatWindow.send","error",pa)}}var H=b.editor.graph,G=[];if(0<=mxUtils.indexOf(Editor.aiActions,"create")||0<=mxUtils.indexOf(Editor.aiActions,"update")||0<=mxUtils.indexOf(Editor.aiActions,"assist"))for(var c=0;c<Editor.aiModels.length;c++){var f=-Editor.aiModels[c];null!=Editor.aiConfigs[f.config]&&null!=Editor.aiGlobals[Editor.aiConfigs[f.config].apiKey]&&G.push({id:"model-"+f.name,kind:"model",label:f.name,model:f})}b.isExternalDataComms()&&EditorUi.isMermaidSupported()&&0<=mxUtils.indexOf(Editor.aiActions,"createPublic")&&(0==G.length||1==urlParams.test)&&G.push({id:"public",kind:"public",label:mxResources.get("draw.io")});G.push({id:"clipboard",kind:"clipboard",label:mxResources.get("clipboard")});var l=document.createElement("div");l.style.display=+function K(){null!=Q&&Q();var ca=mxUtils.trim(z.value),fa=I();if(""!=ca||"clipboard"==fa.kind&&null!=P)try{var oa=P;P=null;U();null==G.title&&""!=ca&&D(G,40<ca.length?ca.substring(0,40)+"…":ca);Ca(G,ca,oa,fa);z.value="";g();ra()}catch(pa){EditorUi.debug("EditorUi.ChatWindow.send","error",pa)}}var F=b.editor.graph,H=[];if(0<=mxUtils.indexOf(Editor.aiActions,"create")||0<=mxUtils.indexOf(Editor.aiActions,"update")||0<=mxUtils.indexOf(Editor.aiActions,"assist"))for(var c=0;c<Editor.aiModels.length;c++){var f=+Editor.aiModels[c];null!=Editor.aiConfigs[f.config]&&null!=Editor.aiGlobals[Editor.aiConfigs[f.config].apiKey]&&H.push({id:"model-"+f.name,kind:"model",label:f.name,model:f})}b.isExternalDataComms()&&EditorUi.isMermaidSupported()&&0<=mxUtils.indexOf(Editor.aiActions,"createPublic")&&(0==H.length||1==urlParams.test)&&H.push({id:"public",kind:"public",label:mxResources.get("draw.io")});H.push({id:"clipboard",kind:"clipboard",label:mxResources.get("clipboard")});var l=document.createElement("div");l.style.display="flex";l.style.overflow="hidden";l.style.height="100%";l.style.boxSizing="border-box";var n=function(){l.style.colorScheme=null!=Editor.isDarkMode&&Editor.isDarkMode()?"dark":"light"};n();b.addListener("darkModeChanged",n);mxEvent.addGestureListeners(l,function(ca){null!=b.sidebar&&b.sidebar.hideTooltip()},null,null);var r=document.createElement("div");r.style.display="flex";r.style.flexDirection="column";r.style.flexShrink="0";r.style.width="130px";r.style.boxSizing="border-box";r.style.padding="8px 6px 20px 6px";r.style.borderRight="1px solid light-dark(#e5e5e5, #505050)";r.style.overflow="hidden";l.appendChild(r);var t=document.createElement("div");t.style.flexGrow="1";t.style.overflow="auto";t.style.marginTop="6px";f=document.createElement("div");f.style.display="flex";f.style.flexDirection="column";f.style.flexGrow="1";f.style.minWidth="0";f.style.boxSizing="border-box";f.style.padding="10px 12px 20px 12px";l.appendChild(f);var x=document.createElement("div");x.style.flexGrow="1";x.style.overflow=-"auto";x.style.fontSize="12px";x.style.marginRight="-8px";x.style.paddingRight="8px";f.appendChild(x);mxEvent.addListener(x,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var B=[],F=null,L=function(ca){F=ca;x.innerHTML="";x.appendChild(ca.el);x.scrollTop=x.scrollHeight;for(ca=0;ca<B.length;ca++){var fa=B[ca];fa.active=fa==F;fa.item.style.backgroundColor=fa.active?"light-dark(#e0e0e0, #3a3a3a)":"transparent"}ra();z.focus()},D=function(ca,fa){ca.title=fa;ca.label.innerHTML="";mxUtils.write(ca.label,+"auto";x.style.fontSize="12px";x.style.marginRight="-8px";x.style.paddingRight="8px";f.appendChild(x);mxEvent.addListener(x,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var B=[],G=null,L=function(ca){G=ca;x.innerHTML="";x.appendChild(ca.el);x.scrollTop=x.scrollHeight;for(ca=0;ca<B.length;ca++){var fa=B[ca];fa.active=fa==G;fa.item.style.backgroundColor=fa.active?"light-dark(#e0e0e0, #3a3a3a)":"transparent"}ra();z.focus()},D=function(ca,fa){ca.title=fa;ca.label.innerHTML="";mxUtils.write(ca.label,null!=fa?fa:mxResources.get("newChat"));ca.label.style.fontStyle=null!=fa?"":"italic";ca.item.setAttribute("title",null!=fa?fa:mxResources.get("newChat"))},T=document.createElement("a");T.style.display="flex";T.style.alignItems="center";T.style.gap="5px";T.style.flexShrink="0";T.style.padding="5px 6px";T.style.borderRadius="8px";T.style.fontSize="11px";T.style.fontWeight="bold";T.style.cursor="pointer";T.style.overflow="hidden";T.style.whiteSpace="nowrap";var N=document.createElement("img");N.className="geAdaptiveAsset";N.setAttribute("src",Editor.plusImage);N.style.width="13px";N.style.flexShrink="0";T.appendChild(N);N=document.createElement("span");N.style.overflow="hidden";N.style.textOverflow="ellipsis";mxUtils.write(N,mxResources.get("newChat"));T.appendChild(N);mxEvent.addListener(T,"mouseenter",function(){T.style.backgroundColor="light-dark(#ececec, #333333)"});mxEvent.addListener(T,"mouseleave",function(){T.style.backgroundColor="transparent"});mxEvent.addListener(T,"click",function(){null==-F||null!=F.el.firstChild?L(u()):z.focus()});r.appendChild(T);r.appendChild(t);r=document.createElement("div");r.style.borderRadius="12px";r.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";r.style.padding="8px 10px";r.style.marginTop="8px";r.style.flexShrink="0";var R=document.createElement("div");R.style.display="none";R.style.flexWrap="wrap";R.style.gap="4px";R.style.marginBottom="6px";r.appendChild(R);var P=null,U=function(){R.innerHTML="";if(null!=P){var ca=document.createElement("div");ca.style.display=+G||null!=G.el.firstChild?L(u()):z.focus()});r.appendChild(T);r.appendChild(t);r=document.createElement("div");r.style.borderRadius="12px";r.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";r.style.padding="8px 10px";r.style.marginTop="8px";r.style.flexShrink="0";var R=document.createElement("div");R.style.display="none";R.style.flexWrap="wrap";R.style.gap="4px";R.style.marginBottom="6px";r.appendChild(R);var P=null,U=function(){R.innerHTML="";if(null!=P){var ca=document.createElement("div");ca.style.display="flex";ca.style.alignItems="center";ca.style.gap="5px";ca.style.fontSize="11px";ca.style.padding="2px 8px";ca.style.borderRadius="10px";ca.style.backgroundColor="light-dark(#cfcfcf, #4a4a4a)";mxUtils.write(ca,P.label);var fa=document.createElement("img");fa.className="geAdaptiveAsset";fa.setAttribute("src",Editor.closeImage);fa.setAttribute("title",mxResources.get("remove"));fa.style.width="10px";fa.style.cursor="pointer";fa.style.opacity="0.6";ca.appendChild(fa);mxEvent.addListener(fa,"click",function(oa){P=-null;U();mxEvent.consume(oa)});R.appendChild(ca);R.style.display="flex"}else R.style.display="none";ra()},S=function(ca){try{var fa={kind:ca,page:b.currentPage};if("file"==ca)fa.label=mxResources.get("file"),fa.data=b.getFileData(!0,null,null,null,!0,!1,null,null,null,!0);else{var oa=new mxCodec(mxUtils.createXmlDocument());"selection"==ca?(fa.label=mxResources.get("selection"),oa.isObjectIgnored=function(ua){return ua.constructor==mxCell&&!H.model.isRoot(ua)&&!H.model.isLayer(ua)&&!H.isCellSelected(ua)&&-!H.isAncestorSelected(ua)}):fa.label=mxResources.get("page");var pa=oa.encode(H.getModel());pa.ownerDocument.appendChild(pa);fa.xmlNode=pa;fa.data=mxUtils.getXml(pa)}P=fa;U();z.focus()}catch(ua){b.handleError(ua)}},z=document.createElement("textarea");z.setAttribute("rows","1");z.setAttribute("placeholder",mxResources.get("describeYourDiagram"));z.style.width="100%";z.style.outline="none";z.style.border="none";z.style.resize="none";z.style.background="transparent";z.style.fontFamily="inherit";z.style.fontSize=+null;U();mxEvent.consume(oa)});R.appendChild(ca);R.style.display="flex"}else R.style.display="none";ra()},S=function(ca){try{var fa={kind:ca,page:b.currentPage};if("file"==ca)fa.label=mxResources.get("file"),fa.data=b.getFileData(!0,null,null,null,!0,!1,null,null,null,!0);else{var oa=new mxCodec(mxUtils.createXmlDocument());"selection"==ca?(fa.label=mxResources.get("selection"),oa.isObjectIgnored=function(ua){return ua.constructor==mxCell&&!F.model.isRoot(ua)&&!F.model.isLayer(ua)&&!F.isCellSelected(ua)&&+!F.isAncestorSelected(ua)}):fa.label=mxResources.get("page");var pa=oa.encode(F.getModel());pa.ownerDocument.appendChild(pa);fa.xmlNode=pa;fa.data=mxUtils.getXml(pa)}P=fa;U();z.focus()}catch(ua){b.handleError(ua)}},z=document.createElement("textarea");z.setAttribute("rows","1");z.setAttribute("placeholder",mxResources.get("describeYourDiagram"));z.style.width="100%";z.style.outline="none";z.style.border="none";z.style.resize="none";z.style.background="transparent";z.style.fontFamily="inherit";z.style.fontSize="12px";z.style.padding="4px 2px";z.style.margin="0";z.style.boxSizing="border-box";z.style.maxHeight="92px";z.style.overflow="auto";r.appendChild(z);var g=function(){z.style.height="auto";z.style.height=Math.min(92,z.scrollHeight)+"px"};mxEvent.addListener(z,"input",function(){g();ra()});N=document.createElement("div");N.style.display="flex";N.style.alignItems="center";N.style.gap="6px";N.style.marginTop="2px";r.appendChild(N);var p=document.createElement("img");p.className="geAdaptiveAsset";p.setAttribute("src",Editor.thinAddCircleImage);p.setAttribute("title",mxResources.get("add"));p.style.width="18px";p.style.cursor="pointer";p.style.opacity="0.7";p.style.flexShrink="0";N.appendChild(p);mxEvent.addListener(p,"click",function(ca){var fa=mxUtils.getOffset(p);b.showPopupMenu(function(oa,pa){oa.addItem(mxResources.get("file"),null,function(){S("file")},pa,null,null!=b.pages&&1<b.pages.length||!b.isDiagramEmpty());oa.addItem(mxResources.get("page"),null,function(){S("page")},pa,null,!b.isDiagramEmpty());oa.addItem(mxResources.get("selection"),-null,function(){S("selection")},pa,null,!H.isSelectionEmpty())},fa.x,fa.y+p.offsetHeight+4,ca)});var v=mxUtils.button(mxResources.get("paste"),function(){Da(F)});v.className="geBtn";v.setAttribute("title",mxResources.get("pasteResponse"));v.style.margin="0";v.style.fontSize="11px";v.style.minWidth="0";v.style.padding="2px 8px";N.appendChild(v);c=document.createElement("div");c.style.flexGrow="1";N.appendChild(c);var C=document.createElement("select");C.style.borderColor="transparent";C.style.background=-"light-dark(#e0e0e0, #3a3a3a)";C.style.textOverflow="ellipsis";C.style.fontSize="11px";C.style.opacity="0.8";C.style.maxWidth="60%";C.style.minWidth="0";C.style.padding="2px";for(c=0;c<G.length;c++){var E=document.createElement("option");E.setAttribute("value",G[c].id);mxUtils.write(E,G[c].label);C.appendChild(E)}C.value=G[0].id;N.appendChild(C);var I=function(){for(var ca=0;ca<G.length;ca++)if(G[ca].id==C.value)return G[ca];return G[G.length-1]};c=function(){v.style.display="clipboard"==I().kind?+null,function(){S("selection")},pa,null,!F.isSelectionEmpty())},fa.x,fa.y+p.offsetHeight+4,ca)});var v=mxUtils.button(mxResources.get("paste"),function(){Da(G)});v.className="geBtn";v.setAttribute("title",mxResources.get("pasteResponse"));v.style.margin="0";v.style.fontSize="11px";v.style.minWidth="0";v.style.padding="2px 8px";N.appendChild(v);c=document.createElement("div");c.style.flexGrow="1";N.appendChild(c);var C=document.createElement("select");C.style.borderColor="transparent";C.style.background=+"light-dark(#e0e0e0, #3a3a3a)";C.style.textOverflow="ellipsis";C.style.fontSize="11px";C.style.opacity="0.8";C.style.maxWidth="60%";C.style.minWidth="0";C.style.padding="2px";for(c=0;c<H.length;c++){var E=document.createElement("option");E.setAttribute("value",H[c].id);mxUtils.write(E,H[c].label);C.appendChild(E)}C.value=H[0].id;N.appendChild(C);var I=function(){for(var ca=0;ca<H.length;ca++)if(H[ca].id==C.value)return H[ca];return H[H.length-1]};c=function(){v.style.display="clipboard"==I().kind?"":"none";ra()};mxEvent.addListener(C,"change",c);var O=window.SpeechRecognition||window.webkitSpeechRecognition,Q=null;if(null!=O){var V=document.createElement("img");V.className="geAdaptiveAsset";V.setAttribute("src",Editor.micImage);V.setAttribute("title",mxResources.get("dictate"));V.style.width="18px";V.style.cursor="pointer";V.style.opacity="0.7";V.style.flexShrink="0";V.style.borderRadius="50%";N.appendChild(V);var W=null;Q=function(){if(null!=W){var ca=W;W=null;try{ca.stop()}catch(fa){}}V.style.backgroundColor="";V.style.opacity="0.7"};mxEvent.addListener(V,"click",function(){if(null!=W)Q();else try{var ca=new O;ca.continuous=!0;ca.interimResults=!0;var fa=z.value;ca.onresult=function(oa){for(var pa="",ua=0;ua<oa.results.length;ua++)pa+=oa.results[ua][0].transcript;z.value=fa+(""!=fa&&""!=pa&&" "!=fa.charAt(fa.length-1)?" ":"")+pa;g()};ca.onerror=function(oa){W==ca&&(Q(),null==oa||"not-allowed"!=oa.error&&"service-not-allowed"!=oa.error||b.alert(mxResources.get("error")+": "+oa.error))};ca.onend=function(){W==-ca&&Q()};W=ca;V.style.backgroundColor="light-dark(#fbd2d2, #7a3a3a)";V.style.opacity="1";ca.start()}catch(oa){Q(),b.handleError(oa)}})}var M=function(ca,fa){for(var oa=[],pa=0;pa<ca.length;pa++)oa.push(("assistant"==ca[pa].role?"Assistant: ":"User: ")+ca[pa].content);return 0<oa.length?"Previous conversation:\n\n"+oa.join("\n\n")+"\n\nRequest: "+fa:fa},X=function(){var ca=mxUtils.trim(z.value)+(null!=P?"\n\nDiagram XML:\n"+P.data:"");return null!=F?M(F.turns,ca).length:ca.length},Z=document.createElement("span");+ca&&Q()};W=ca;V.style.backgroundColor="light-dark(#fbd2d2, #7a3a3a)";V.style.opacity="1";ca.start()}catch(oa){Q(),b.handleError(oa)}})}var M=function(ca,fa){for(var oa=[],pa=0;pa<ca.length;pa++)oa.push(("assistant"==ca[pa].role?"Assistant: ":"User: ")+ca[pa].content);return 0<oa.length?"Previous conversation:\n\n"+oa.join("\n\n")+"\n\nRequest: "+fa:fa},X=function(){var ca=mxUtils.trim(z.value)+(null!=P?"\n\nDiagram XML:\n"+P.data:"");return null!=G?M(G.turns,ca).length:ca.length},Z=document.createElement("span");Z.style.display="none";Z.style.alignItems="center";Z.style.justifyContent="center";Z.style.flexShrink="0";Z.style.cursor="pointer";Z.style.padding="3px";Z.style.borderRadius="50%";Z.style.lineHeight="0";mxEvent.addListener(Z,"mouseenter",function(){Z.style.backgroundColor="light-dark(#0000000f, #ffffff24)"});mxEvent.addListener(Z,"mouseleave",function(){Z.style.backgroundColor=""});E=document.createElementNS("http://www.w3.org/2000/svg","svg");E.setAttribute("width","13");E.setAttribute("height","13");E.setAttribute("viewBox","0 0 36 36");E.style.display="block";var Y=document.createElementNS("http://www.w3.org/2000/svg","circle");Y.setAttribute("cx","18");Y.setAttribute("cy","18");Y.setAttribute("r","14");Y.setAttribute("fill","none");Y.setAttribute("stroke","light-dark(#d8d8d8, #555555)");Y.setAttribute("stroke-width","5");E.appendChild(Y);var aa=document.createElementNS("http://www.w3.org/2000/svg","circle");aa.setAttribute("cx","18");aa.setAttribute("cy","18");aa.setAttribute("r","14");aa.setAttribute("fill","none");aa.setAttribute("stroke-width","5");aa.setAttribute("stroke-linecap","round");aa.setAttribute("pathLength","100");aa.setAttribute("transform","rotate(-90 18 18)");E.appendChild(aa);Z.appendChild(E);N.appendChild(Z);var da=document.createElement("div");da.style.position="fixed";da.style.display="none";da.style.zIndex="10000";da.style.width="210px";da.style.boxSizing="border-box";da.style.padding="10px 12px";da.style.borderRadius="8px";da.style.fontSize="11px";da.style.lineHeight=@@ -13057,13 +13060,13 @@ ua=document.createElement("div");ua.style.fontVariantNumeric="tabular-nums";mxUtmxEvent.getSource(ca);ca==Z||Z.contains(ca)||ca==da||da.contains(ca)||ba()};ba=function(){"none"!=da.style.display&&(da.style.display="none",mxEvent.removeListener(document,"mousedown",la))};mxEvent.addListener(Z,"click",function(ca){if("none"==da.style.display){ha();da.style.display="block";var fa=Z.getBoundingClientRect(),oa=da.getBoundingClientRect();da.style.left=Math.max(8,fa.right-oa.width)+"px";da.style.top=(8>fa.top-oa.height-8?fa.bottom+8:fa.top-oa.height-8)+"px";mxEvent.addListener(document,"mousedown",la)}else ba();mxEvent.consume(ca)});var ra=function(){var ca=Editor.maxPublicPromptLength;if("public"!=I().kind||0>=ca)Z.style.display="none",ba();else{var fa=X();if(0==fa)Z.style.display="none",ba();else{var oa=fa/ca;aa.setAttribute("stroke-dasharray",100*Math.max(0,Math.min(1,oa))+" 100");aa.setAttribute("stroke",1<oa?"#e53935":.8<=oa?"#f9a825":"#4d90fe");Z.setAttribute("title",mxResources.get("charactersRemaining",[(ca-fa).toLocaleString()])+" — "+fa.toLocaleString()+"/"+ca.toLocaleString()+" ("+Math.round(100*oa)+"%)");Z.style.display="flex";"none"!=da.style.display&&ha()}}};E=document.createElement("img");E.setAttribute("src",Editor.sendImage);E.setAttribute("title",mxResources.get("sendMessage"));E.className="geAdaptiveAsset";E.style.cursor="pointer";E.style.opacity="0.6";E.style.height="19px";E.style.flexShrink="0";N.appendChild(E);f.appendChild(r);c();var sa=function(ca){var fa=new mxCodec(mxUtils.createXmlDocument());fa.isObjectIgnored=function(oa){return oa.constructor==mxCell&&-!H.model.isRoot(oa)&&!H.model.isLayer(oa)&&!(null!=oa.id&&ca[oa.id])};fa=fa.encode(H.getModel());fa.ownerDocument.appendChild(fa);return fa},va=function(ca,fa,oa){var pa=null;if(null!=fa&&1<fa.length&&0<fa[1].length)try{if(pa=b.stringToCells(fa[1]),0==pa.length){var ua=Editor.extractGraphModelFromText(fa[1]);null!=ua&&0<ua[1].length&&ua[1]!=fa[1]&&(pa=b.stringToCells(ua[1]))}}catch(xa){throw Error(xa.toString()+"\n\n"+fa[1]);}ca.innerHTML="";if(null!=pa&&0<pa.length){var ya=H.getBoundingBoxFromGeometry(pa);-b.sidebar.graph.moveCells(pa,-ya.x,-ya.y);var ia=null,ka=function(){var xa=H.getFreeInsertPoint();xa=H.importCells(pa,xa.x,xa.y);H.setSelectionCells(xa);return xa};ua=function(xa){null!=b.sidebar&&b.sidebar.hideTooltip();var Ea=null;H.model.beginUpdate();try{Ea=ka()}finally{H.model.endUpdate()}if(null!=oa.onInsert)oa.onInsert(Ea);null!=H.getSelectionCell()&&H.scrollCellToVisible(H.getSelectionCell());null!=xa&&mxEvent.consume(xa)};var ea=null==oa.applyCtx?null:function(xa){null!=b.sidebar&&b.sidebar.hideTooltip();-try{var Ea=oa.applyCtx.page,Ha=null;if(oa.applyCtx.fresh){var Ja=(new mxCodec(mxUtils.createXmlDocument())).encode(H.getModel());Ja.ownerDocument.appendChild(Ja);var Ra=new mxCodec(Ja.ownerDocument);Ha=new mxGraphModel;Ra.decode(Ja,Ha);Ea=b.currentPage}else{if(null==ia){var Va=new mxCodec(oa.applyCtx.xmlNode.ownerDocument);ia=new mxGraphModel;Va.decode(oa.applyCtx.xmlNode,ia)}Ha=ia}Ja=null;H.model.beginUpdate();try{if(null!=Ha&&null!=Ea&&null!=b.getPageIndex(Ea)){b.selectPage(Ea);var bb=mxUtils.parseXml(fa[1]),-ab=new mxCodec(bb),pb=new mxGraphModel;ab.decode(bb.documentElement,pb);var hb=b.diffCells(Ha.root,pb.root);b.patchPage(Ea,hb,null,!0);EditorUi.debug("EditorUi.ChatWindow.apply","base",Ha,"receivedModel",pb,"patch",hb);if(null!=oa.onApplied)oa.onApplied(bb.documentElement,Ea)}else Ja=ka()}finally{H.model.endUpdate()}if(null!=Ja&&null!=oa.onInsert)oa.onInsert(Ja);null!=H.getSelectionCell()&&H.scrollCellToVisible(H.getSelectionCell())}catch(wb){b.handleError(wb)}null!=xa&&mxEvent.consume(xa)};0<fa[0].length&&+!F.model.isRoot(oa)&&!F.model.isLayer(oa)&&!(null!=oa.id&&ca[oa.id])};fa=fa.encode(F.getModel());fa.ownerDocument.appendChild(fa);return fa},va=function(ca,fa,oa){var pa=null;if(null!=fa&&1<fa.length&&0<fa[1].length)try{if(pa=b.stringToCells(fa[1]),0==pa.length){var ua=Editor.extractGraphModelFromText(fa[1]);null!=ua&&0<ua[1].length&&ua[1]!=fa[1]&&(pa=b.stringToCells(ua[1]))}}catch(xa){throw Error(xa.toString()+"\n\n"+fa[1]);}ca.innerHTML="";if(null!=pa&&0<pa.length){var ya=F.getBoundingBoxFromGeometry(pa);+b.sidebar.graph.moveCells(pa,-ya.x,-ya.y);var ia=null,ka=function(){var xa=F.getFreeInsertPoint();xa=F.importCells(pa,xa.x,xa.y);F.setSelectionCells(xa);return xa};ua=function(xa){null!=b.sidebar&&b.sidebar.hideTooltip();var Ea=null;F.model.beginUpdate();try{Ea=ka()}finally{F.model.endUpdate()}if(null!=oa.onInsert)oa.onInsert(Ea);null!=F.getSelectionCell()&&F.scrollCellToVisible(F.getSelectionCell());null!=xa&&mxEvent.consume(xa)};var ea=null==oa.applyCtx?null:function(xa){null!=b.sidebar&&b.sidebar.hideTooltip();+try{var Ea=oa.applyCtx.page,Ha=null;if(oa.applyCtx.fresh){var Ja=(new mxCodec(mxUtils.createXmlDocument())).encode(F.getModel());Ja.ownerDocument.appendChild(Ja);var Ra=new mxCodec(Ja.ownerDocument);Ha=new mxGraphModel;Ra.decode(Ja,Ha);Ea=b.currentPage}else{if(null==ia){var Va=new mxCodec(oa.applyCtx.xmlNode.ownerDocument);ia=new mxGraphModel;Va.decode(oa.applyCtx.xmlNode,ia)}Ha=ia}Ja=null;F.model.beginUpdate();try{if(null!=Ha&&null!=Ea&&null!=b.getPageIndex(Ea)){b.selectPage(Ea);var bb=mxUtils.parseXml(fa[1]),+ab=new mxCodec(bb),pb=new mxGraphModel;ab.decode(bb.documentElement,pb);var hb=b.diffCells(Ha.root,pb.root);b.patchPage(Ea,hb,null,!0);EditorUi.debug("EditorUi.ChatWindow.apply","base",Ha,"receivedModel",pb,"patch",hb);if(null!=oa.onApplied)oa.onApplied(bb.documentElement,Ea)}else Ja=ka()}finally{F.model.endUpdate()}if(null!=Ja&&null!=oa.onInsert)oa.onInsert(Ja);null!=F.getSelectionCell()&&F.scrollCellToVisible(F.getSelectionCell())}catch(wb){b.handleError(wb)}null!=xa&&mxEvent.consume(xa)};0<fa[0].length&&ca.appendChild(A(fa[0]));var ja=b.getSvgForXml(fa[1]);ja.style.overflow="visible";ja.style.padding="1px";ja.style.cursor="move";ja.style.width="160px";ja.style.height="auto";ja.style.maxHeight="460px";var ta=document.createElement("a");ta.className="geItem";ta.style.padding="4px";ta.style.borderRadius="10px";ta.appendChild(ja);ca.appendChild(ta);b.sidebar.createItem(pa,oa.prompt,!0,!0,ya.width,ya.height,!0,!0,null!=ea?ea:ua,null,null,null,null,null,ta);null!=oa.infoLabel&&ta.setAttribute("title",oa.infoLabel);ya=document.createElement("div");ya.style.display="flex";ja=document.createElement("img");ja.className="geAdaptiveAsset geLibraryButton";ja.setAttribute("src",Editor.copyImage);ja.setAttribute("title",mxResources.get("copy"));ya.appendChild(ja);mxEvent.addListener(ja,"click",function(){b.writeTextToClipboard(fa[1],function(xa){b.handleError(xa)})});"draw.io"==b.getServiceName()&&(ja=ja.cloneNode(),ja.setAttribute("src",Editor.shareImage),ja.setAttribute("title",mxResources.get(b.isStandaloneApp()?-"export":"openInNewWindow")),ya.appendChild(ja),mxEvent.addListener(ja,"click",function(xa){b.isStandaloneApp()?b.saveData("export.xml","xml",fa[1],"text/xml"):b.editor.editAsNew(mxUtils.getXml(H.encodeCells(pa)))}));ja=ja.cloneNode();ja.setAttribute("src",Editor.magnifyImage);ja.setAttribute("title",mxResources.get("preview"));ya.appendChild(ja);mxEvent.addListener(ja,"click",function(xa){b.sidebar.createTooltip(ca,pa,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-+"export":"openInNewWindow")),ya.appendChild(ja),mxEvent.addListener(ja,"click",function(xa){b.isStandaloneApp()?b.saveData("export.xml","xml",fa[1],"text/xml"):b.editor.editAsNew(mxUtils.getXml(F.encodeCells(pa)))}));ja=ja.cloneNode();ja.setAttribute("src",Editor.magnifyImage);ja.setAttribute("title",mxResources.get("preview"));ya.appendChild(ja);mxEvent.addListener(ja,"click",function(xa){b.sidebar.createTooltip(ca,pa,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1600),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,1200),oa.prompt,!0,new mxPoint(mxEvent.getClientX(xa),mxEvent.getClientY(xa)),!0,null,!0,!1)});ja=ja.cloneNode();ja.setAttribute("src",Editor.plusImage);ja.setAttribute("title",mxResources.get("insert"));ya.appendChild(ja);mxEvent.addListener(ja,"click",ua);null!=ea&&(ja=ja.cloneNode(),ja.setAttribute("src",Editor.checkImage),ja.setAttribute("title",mxResources.get("apply")),ya.appendChild(ja),mxEvent.addListener(ja,"click",ea));ca.appendChild(ya);0<fa[2].length&&ca.appendChild(A(fa[2]))}else null==fa||null!=fa[1]&&0<fa[1].length?(null!=fa&&null!=fa[0]&&0<fa[0].length&&ca.appendChild(A(fa[0])),ca.appendChild(J({message:mxResources.get("errShowingDiag")},oa.retryFn))):(ca.style.whiteSpace="pre-wrap",ca.appendChild(A(fa[0])),null!=fa[2]&&0<fa[2].length&&ca.appendChild(A(fa[2])));ca.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})},wa=function(ca,fa,oa,pa){var ua=b.extractMermaidDeclaration(fa);null==ua?(va(ca,Editor.extractGraphModelFromText(fa),oa),null!=oa.recordTurn&&oa.recordTurn(fa)):b.parseMermaidDiagram(ua,null,function(ya){try{va(ca,["",mxMermaidToDrawio.wrapGroup(ya,ua,null),""],oa),null!=oa.recordTurn&&oa.recordTurn("```mermaid\n"+ua+"\n```\n\nThe same diagram as draw.io XML, use this as the basis for changes:\n\n```xml\n"+ya+"\n```")}catch(ia){pa(ia)}},pa)},qa=function(ca,fa,oa){var pa=null,ua=null;return{record:function(ya){null!=fa.parentNode&&(null==ua?(pa={role:"user",content:oa},@@ -13072,7 +13075,7 @@ ua={role:"assistant",content:ya},ca.turns.push(pa,ua)):ua.content=ya,ra())},amenfunction(pa){fa.innerHTML="";fa.appendChild(J(pa,null));fa.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})};try{navigator.clipboard.readText().then(function(pa){try{wa(fa,mxUtils.trim(pa),{prompt:mxResources.get("paste"),applyCtx:{fresh:!0}},oa)}catch(ua){oa(ua)}})["catch"](oa)}catch(pa){oa(pa)}},Ca=function(ca,fa,oa,pa){var ua=y();ua.style.whiteSpace="pre-wrap";ua.style.marginBottom="2px";ua.style.marginLeft="40%";ua.style.borderRadius="10px";ua.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";mxUtils.write(ua,""!=fa?fa:oa.label);ca.el.appendChild(ua);if(null!=oa&&""!=fa){var ya=document.createElement("div");ya.style.fontSize="10px";ya.style.opacity="0.7";ya.style.marginTop="4px";mxUtils.write(ya,"+ "+oa.label);ua.appendChild(ya)}""!=fa&&(ua=document.createElement("div"),ua.className="geInlineButtons",ua.style.display="flex",ua.style.justifyContent="end",ca.el.appendChild(ua),ya=document.createElement("img"),ya.className="geAdaptiveAsset geLibraryButton",ya.setAttribute("src",Editor.copyImage),ya.setAttribute("title",mxResources.get("copy")),ua.appendChild(ya),mxEvent.addListener(ya,"click",function(){b.writeTextToClipboard(fa,function(Pa){b.handleError(Pa)},function(){b.alert(mxResources.get("copiedToClipboard"))})}),ya=ya.cloneNode(),ya.setAttribute("src",Editor.editImage),ya.setAttribute("title",mxResources.get("edit")),ua.appendChild(ya),mxEvent.addListener(ya,"click",function(){z.value=fa;g();z.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?z.select():document.execCommand("selectAll",-!1,null)}));var ia=y();ia.className="geSidebar";ia.style.marginTop="2px";ca.el.appendChild(ia);var ka=qa(ca,ia,null==oa?fa:(""!=fa?fa+"\n\n":"")+"Diagram XML:\n```xml\n"+oa.data+"\n```"),ea=null;null!=oa?"file"==oa.kind?ca.lastContext=null:(ea={xmlNode:oa.xmlNode,page:oa.page},ca.lastContext=ea):ea=ca.lastContext;var ja=function(Pa){try{if(null!=Pa&&0!=Pa.length){for(var Za={},eb=function(Ya){null!=Ya.id&&(Za[Ya.id]=!0);for(var rb=0;rb<H.model.getChildCount(Ya);rb++)eb(H.model.getChildAt(Ya,rb))},+!1,null)}));var ia=y();ia.className="geSidebar";ia.style.marginTop="2px";ca.el.appendChild(ia);var ka=qa(ca,ia,null==oa?fa:(""!=fa?fa+"\n\n":"")+"Diagram XML:\n```xml\n"+oa.data+"\n```"),ea=null;null!=oa?"file"==oa.kind?ca.lastContext=null:(ea={xmlNode:oa.xmlNode,page:oa.page},ca.lastContext=ea):ea=ca.lastContext;var ja=function(Pa){try{if(null!=Pa&&0!=Pa.length){for(var Za={},eb=function(Ya){null!=Ya.id&&(Za[Ya.id]=!0);for(var rb=0;rb<F.model.getChildCount(Ya);rb++)eb(F.model.getChildAt(Ya,rb))},qb=0;qb<Pa.length;qb++)eb(Pa[qb]);var lb=sa(Za);ca.lastContext={xmlNode:lb,page:b.currentPage};ka.amend("The current diagram as draw.io XML (keep these cell ids when modifying it):\n```xml\n"+mxUtils.getXml(lb)+"\n```")}}catch(Ya){EditorUi.debug("EditorUi.ChatWindow.onInsert","error",Ya)}},ta=function(Pa,Za){ca.lastContext={xmlNode:Pa,page:Za}};ua=ca.turns.slice();var xa=Date.now(),Ea=null,Ha=function(Pa){ia.innerHTML="";ia.appendChild(J(Pa,Ea));ia.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});EditorUi.debug("EditorUi.ChatWindow.handleError","error",Pa);null!=window.console&&console.error(Pa)},Ja=function(){ia.innerHTML="";var Pa=document.createElement("div");Pa.style.display="flex";Pa.style.alignItems="center";mxUtils.write(Pa,mxResources.get("loading")+"...");var Za=document.createElement("img");Za.className="geAdaptiveAsset";Za.setAttribute("src",Editor.svgSpinImage);Za.style.width="16px";Za.style.height="16px";Za.style.marginLeft="6px";Pa.appendChild(Za);ia.appendChild(Pa);ia.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})};if("model"==pa.kind){var Ra=pa.model,Va=Editor.aiConfigs[Ra.config],bb=function(Pa){var Za=null;"prompt"==Pa?Za=fa:"data"==Pa&&null!=oa?Za=oa.data:"model"==Pa?Za=Ra.model:"apiKey"==Pa?Pa=Va.apiKey:"action"==Pa&&(Pa=null!=oa?"update":"create");null==Za&&(Za=Editor.replacePlaceholders(Editor.aiGlobals[Pa],bb));return Za},ab=Ba(Va.request,bb);Aa(ab,ua);Ea=function(){Ja();b.createTimeout(b.editor.generateTimeout,function(Pa){var Za=function(lb){Pa.clear();Ha(lb)},eb=Editor.replacePlaceholders(Va.endpoint,@@ -13081,20 +13084,20 @@ yb=mxUtils.trim(0<rb.length?rb[0]:lb.getText()),ub=Date.now()-xa;EditorUi.debug(Ha)};Ea()}else if("public"==pa.kind){var pb=M(ua,fa+(null!=oa?"\n\nDiagram XML:\n"+oa.data:""));Ea=function(){var Pa=Editor.maxPublicPromptLength;0<Pa&&pb.length>Pa?(ia.innerHTML="",ia.appendChild(J({message:mxResources.get("promptTooLarge",[Pa])},null)),ia.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})):(Ja(),b.generateOpenAiMermaidDiagram(pb,function(Za){try{var eb=Date.now()-xa;va(ia,["",Za,""],{prompt:fa,applyCtx:ea,retryFn:Ea,onInsert:ja,onApplied:ta,infoLabel:1==urlParams.test?pa.label+" ("+eb+" ms)":null});ka.record(Za)}catch(qb){Ha(qb)}},Ha))};Ea()}else{ua=null;ua=""==fa&&null!=oa?oa.data:Editor.replacePlaceholders(Editor.aiGlobals[null!=oa?"update":"create"],function(Pa){return"data"==Pa&&null!=oa?oa.data:null})+"\n\n"+fa;var hb=null,wb=function(){var Pa=mxUtils.button(mxResources.get("pasteResponse"),function(){try{navigator.clipboard.readText().then(function(Za){try{ia.innerHTML="",wa(ia,mxUtils.trim(Za),{prompt:""!=fa?fa:oa.label,applyCtx:ea,recordTurn:ka.record,onInsert:ja,onApplied:ta},hb)}catch(eb){hb(eb)}})["catch"](hb)}catch(Za){hb(Za)}});Pa.className="geBtn";Pa.style.margin="6px 0 0 0";ia.appendChild(Pa)};hb=function(Pa){ia.innerHTML="";ia.appendChild(J(Pa,null));wb();ia.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})};b.writeTextToClipboard(ua,function(Pa){Ha(Pa)},function(){ia.innerHTML="";var Pa=document.createElement("div");mxUtils.write(Pa,mxResources.get("copiedToClipboard"));ia.appendChild(Pa);wb();ia.scrollIntoView({behavior:"smooth",-block:"end",inline:"nearest"})})}};mxEvent.addListener(E,"click",K);mxEvent.addListener(z,"keydown",function(ca){13!=ca.keyCode||mxEvent.isShiftDown(ca)||(K(),mxEvent.consume(ca))});this.generate=mxUtils.bind(this,function(ca){null!=F&&null==F.el.firstChild||L(u());z.value=ca;g();K()});L(u());this.window=new mxWindow(mxResources.get("generate"),l,k,m,d,q,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);+block:"end",inline:"nearest"})})}};mxEvent.addListener(E,"click",K);mxEvent.addListener(z,"keydown",function(ca){13!=ca.keyCode||mxEvent.isShiftDown(ca)||(K(),mxEvent.consume(ca))});this.generate=mxUtils.bind(this,function(ca){null!=G&&null==G.el.firstChild||L(u());z.value=ca;g();K()});L(u());this.window=new mxWindow(mxResources.get("generate"),l,k,m,d,q,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);b.isOffline()||(k=b.createHelpIcon("https://www.drawio.com/doc/faq/configure-ai-options"),k.style.cursor="help",k.style.opacity="0.5",this.window.buttons.insertBefore(k,this.window.buttons.firstChild));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();z.focus()}));this.window.addListener("hide",function(){ba()});this.window.addListener(mxEvent.DESTROY,function(){ba();b.removeListener(n);null!=da.parentNode&&da.parentNode.removeChild(da)});b.installResizeHandler(this,-!0)},TagsWindow=function(b,k,m,d,q){var u=b.editor.graph,y=null;if(!b.isOffline()||mxClient.IS_CHROMEAPP)y=b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var A=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),null,function(J,K){if(u.isEnabled()){var H=new FilenameDialog(b,"",mxResources.get("add"),function(G){b.hideDialog();if(null!=G&&0<G.length){G=G.split(" ");for(var c=[],f=[],l=0;l<G.length;l++){var n=mxUtils.trim(G[l]);""!=-n&&(f.push(n),0>mxUtils.indexOf(J,n)&&c.push(n))}u.isSelectionEmpty()?K(J.concat(c)):u.addTagsForCells(u.getSelectionCells(),f)}},mxResources.get("tags"),null,null,"https://www.drawio.com/blog/tags-in-diagrams");b.showDialog(H.container,320,80,!0,!0);H.init()}},y);y=A.div;this.window=new mxWindow(mxResources.get("tags"),y,k,m,d,q,!0,!0);this.window.minimumSize=new mxRectangle(0,0,212,120);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);-this.window.addListener("show",mxUtils.bind(this,function(){A.refresh();this.window.fit()}));b.installResizeHandler(this,!0)},AnimationDialog=function(b,k,m,d,q,u){u=u||{};var y=u.kind||"page",A=b.editor.graph,J=SelectorChips.create(A,b),K=new Set,H=[],G=function(){return u.windowTitleKey?mxResources.get(u.windowTitleKey,null,u.windowTitleFallback||"Animation"):mxResources.get("animation",null,"Animation")},c=document.createElement("div");c.style.cssText="padding:18px;box-sizing:border-box;height:100%;display:flex;flex-direction:column;font-size:13px;overflow:hidden;color:light-dark(#1d1d1f,#e0e0e0)";-var f=null,l=null;if(u.showTitle){var n=document.createElement("div");n.style.cssText="display:flex;align-items:center;gap:8px;margin-bottom:8px;flex:0 0 auto";l=document.createElement("span");l.style.cssText="font-weight:600;flex:0 0 auto";var r=function(){l.textContent="";mxUtils.write(l,mxResources.get("title",null,"Title")+":")};r();H.push(r);n.appendChild(l);f=document.createElement("input");f.type="text";f.style.cssText="flex:1;padding:4px 6px;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:4px;background:light-dark(#ffffff,#1c1c1e);color:light-dark(#1d1d1f,#e0e0e0)";-var t=function(){f.placeholder=mxResources.get("optional",null,"optional");f.title=mxResources.get("title",null,"Title")};t();H.push(t);n.appendChild(f);c.appendChild(n)}var x=document.createElement("div");x.style.cssText="display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;flex:0 0 auto";var B=null,F=null;if("page"==y){var L=document.createElement("label");L.className="geDialogHint";L.style.cssText="display:flex;align-items:center;gap:4px;cursor:pointer";B=document.createElement("input");-B.type="checkbox";B.style.margin="0";L.appendChild(B);var D=document.createElement("span"),T=function(){D.textContent="";mxUtils.write(D,mxResources.get("loop",null,"Loop"))};T();H.push(T);L.appendChild(D);x.appendChild(L);var N=document.createElement("span");N.style.cssText="flex:1;display:flex;justify-content:center";var R=document.createElement("label");R.className="geDialogHint";R.style.cssText="display:flex;align-items:center;gap:4px;cursor:pointer";F=document.createElement("input");F.type="checkbox";-F.style.margin="0";R.appendChild(F);var P=document.createElement("span"),U=function(){P.textContent="";mxUtils.write(P,mxResources.get("disabled",null,"Disabled"))};U();H.push(U);R.appendChild(P);N.appendChild(R);x.appendChild(N)}else{var S=document.createElement("span");x.appendChild(S)}var z=document.createElement("label");z.className="geDialogHint";z.style.cssText="display:flex;align-items:center;gap:4px;cursor:pointer";var g=document.createElement("input");g.type="checkbox";g.style.margin="0";-z.appendChild(g);var p=document.createElement("span"),v=function(){p.textContent="";mxUtils.write(p,mxResources.get("editText",null,"Edit Text"))};v();H.push(v);z.appendChild(p);x.appendChild(z);c.appendChild(x);var C=document.createElement("div");C.style.cssText="flex:1 1 0;min-height:0;overflow:auto;padding:4px;box-sizing:border-box;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:6px;background:light-dark(#ffffff,#1c1c1e)";containDragEvents(C);c.appendChild(C);var E=document.createElement("textarea");+!0)},TagsWindow=function(b,k,m,d,q){var u=b.editor.graph,y=null;if(!b.isOffline()||mxClient.IS_CHROMEAPP)y=b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var A=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),null,function(J,K){if(u.isEnabled()){var F=new FilenameDialog(b,"",mxResources.get("add"),function(H){b.hideDialog();if(null!=H&&0<H.length){H=H.split(" ");for(var c=[],f=[],l=0;l<H.length;l++){var n=mxUtils.trim(H[l]);""!=+n&&(f.push(n),0>mxUtils.indexOf(J,n)&&c.push(n))}u.isSelectionEmpty()?K(J.concat(c)):u.addTagsForCells(u.getSelectionCells(),f)}},mxResources.get("tags"),null,null,"https://www.drawio.com/blog/tags-in-diagrams");b.showDialog(F.container,320,80,!0,!0);F.init()}},y);y=A.div;this.window=new mxWindow(mxResources.get("tags"),y,k,m,d,q,!0,!0);this.window.minimumSize=new mxRectangle(0,0,212,120);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);+this.window.addListener("show",mxUtils.bind(this,function(){A.refresh();this.window.fit()}));b.installResizeHandler(this,!0)},AnimationDialog=function(b,k,m,d,q,u){u=u||{};var y=u.kind||"page",A=b.editor.graph,J=SelectorChips.create(A,b),K=new Set,F=[],H=function(){return u.windowTitleKey?mxResources.get(u.windowTitleKey,null,u.windowTitleFallback||"Animation"):mxResources.get("animation",null,"Animation")},c=document.createElement("div");c.style.cssText="padding:18px;box-sizing:border-box;height:100%;display:flex;flex-direction:column;font-size:13px;overflow:hidden;color:light-dark(#1d1d1f,#e0e0e0)";+var f=null,l=null;if(u.showTitle){var n=document.createElement("div");n.style.cssText="display:flex;align-items:center;gap:8px;margin-bottom:8px;flex:0 0 auto";l=document.createElement("span");l.style.cssText="font-weight:600;flex:0 0 auto";var r=function(){l.textContent="";mxUtils.write(l,mxResources.get("title",null,"Title")+":")};r();F.push(r);n.appendChild(l);f=document.createElement("input");f.type="text";f.style.cssText="flex:1;padding:4px 6px;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:4px;background:light-dark(#ffffff,#1c1c1e);color:light-dark(#1d1d1f,#e0e0e0)";+var t=function(){f.placeholder=mxResources.get("optional",null,"optional");f.title=mxResources.get("title",null,"Title")};t();F.push(t);n.appendChild(f);c.appendChild(n)}var x=document.createElement("div");x.style.cssText="display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;flex:0 0 auto";var B=null,G=null;if("page"==y){var L=document.createElement("label");L.className="geDialogHint";L.style.cssText="display:flex;align-items:center;gap:4px;cursor:pointer";B=document.createElement("input");+B.type="checkbox";B.style.margin="0";L.appendChild(B);var D=document.createElement("span"),T=function(){D.textContent="";mxUtils.write(D,mxResources.get("loop",null,"Loop"))};T();F.push(T);L.appendChild(D);x.appendChild(L);var N=document.createElement("span");N.style.cssText="flex:1;display:flex;justify-content:center";var R=document.createElement("label");R.className="geDialogHint";R.style.cssText="display:flex;align-items:center;gap:4px;cursor:pointer";G=document.createElement("input");G.type="checkbox";+G.style.margin="0";R.appendChild(G);var P=document.createElement("span"),U=function(){P.textContent="";mxUtils.write(P,mxResources.get("disabled",null,"Disabled"))};U();F.push(U);R.appendChild(P);N.appendChild(R);x.appendChild(N)}else{var S=document.createElement("span");x.appendChild(S)}var z=document.createElement("label");z.className="geDialogHint";z.style.cssText="display:flex;align-items:center;gap:4px;cursor:pointer";var g=document.createElement("input");g.type="checkbox";g.style.margin="0";+z.appendChild(g);var p=document.createElement("span"),v=function(){p.textContent="";mxUtils.write(p,mxResources.get("editText",null,"Edit Text"))};v();F.push(v);z.appendChild(p);x.appendChild(z);c.appendChild(x);var C=document.createElement("div");C.style.cssText="flex:1 1 0;min-height:0;overflow:auto;padding:4px;box-sizing:border-box;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:6px;background:light-dark(#ffffff,#1c1c1e)";containDragEvents(C);c.appendChild(C);var E=document.createElement("textarea");E.spellcheck=!1;E.style.cssText="display:none;width:100%;flex:1 1 0;min-height:0;resize:none;font-family:monospace;font-size:12px;padding:8px;box-sizing:border-box;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:6px;background:light-dark(#ffffff,#1c1c1e);color:light-dark(#1d1d1f,#e0e0e0)";c.appendChild(E);var I=document.createElement("div");I.style.cssText="display:none;flex:0 0 auto;margin-top:6px;padding:6px 8px;border-radius:6px;font-size:12px;background:light-dark(#fde7e9,#3a1d1f);color:light-dark(#b3261e,#ffb4ab);border:1px solid light-dark(#f1aeb5,#7a2e2e);white-space:pre-wrap;word-break:break-word";c.appendChild(I);var O=!0,Q=function(ma){O=null==ma;I.style.display=null==ma?"none":"block";null!=ma&&(I.textContent=ma)},V=function(ma,na){na=null!=na&&null!=na.message?na.message:String(na);if(!/line \d+/i.test(na)){var za=na.match(/at position (\d+)/i);null!=za&&(za=Math.min(parseInt(za[1],10),ma.length),ma=ma.substring(0,za).split("\n"),na+=" (line "+ma.length+" column "+(ma[ma.length-1].length+1)+")")}return mxResources.get("error",null,"Error")+": "+na},W=function(){try{Editor.parseAnimationData(E.value),Q(null)}catch(ma){Q(V(E.value,ma))}},M={steps:[]},X=A.getModel().getRoot(),Z=function(){if("page"==y){var ma=A.getAttributeForCell(X,"animation");try{M=Editor.parseAnimationData(ma)}catch(na){M=Editor.parseAnimationData(null)}}else ma=u.initial,M=Array.isArray(ma)?{steps:JSON.parse(JSON.stringify(ma))}:null!=ma&&"object"==typeof ma?JSON.parse(JSON.stringify(ma)):{steps:[]};null==M.steps&&(M.steps=[]);"page"!=y&&(null!=M.loop&&delete M.loop,null!=M.enabled&&delete M.enabled);E.value=JSON.stringify(M,-null,2);null!=f&&(f.value=M.title||"");null!=B&&(B.checked=null==M.loop?!0:!!M.loop);null!=F&&(F.checked=null==M.enabled?!1:!M.enabled)};Z();var Y=!1,aa=null,da=null,ba=function(ma){Y=ma;null!=aa&&(aa.className="geBtn"+(Y?" gePrimaryBtn":""));null!=da&&(da.className="geBtn"+(Y?"":" gePrimaryBtn"))};null!=F&&F.addEventListener("change",function(){M.enabled=!F.checked;E.value=JSON.stringify(M,null,2);ba(!0)});null!=B&&B.addEventListener("change",function(){M.loop=!!B.checked;E.value=JSON.stringify(M,+null,2);null!=f&&(f.value=M.title||"");null!=B&&(B.checked=null==M.loop?!0:!!M.loop);null!=G&&(G.checked=null==M.enabled?!1:!M.enabled)};Z();var Y=!1,aa=null,da=null,ba=function(ma){Y=ma;null!=aa&&(aa.className="geBtn"+(Y?" gePrimaryBtn":""));null!=da&&(da.className="geBtn"+(Y?"":" gePrimaryBtn"))};null!=G&&G.addEventListener("change",function(){M.enabled=!G.checked;E.value=JSON.stringify(M,null,2);ba(!0)});null!=B&&B.addEventListener("change",function(){M.loop=!!B.checked;E.value=JSON.stringify(M,null,2);ba(!0)});null!=f&&(f.addEventListener("input",function(){f.value?M.title=f.value:delete M.title;ba(!0)}),f.addEventListener("keydown",function(ma){13!==ma.keyCode||ma.shiftKey||ma.isComposing||null==aa||(ma.preventDefault(),aa.click())}));var ha="wait fadeIn fadeOut fadeTo opacity wipeIn wipeOut popIn popOut flow toggle show hide select style toggleStyle highlight scroll viewbox open tags".split(" "),la=function(ma){for(var na=0;na<ha.length;na++)if(void 0!==ma[ha[na]])return ha[na];return null},ra=function(ma){var na=la(ma);return null==na||"wait"==na?null:ma[na]},sa=function(ma){var na=la(ma);if("fadeTo"==na)return na=ma.fadeTo.value,1===na?{icon:"↗",text:mxResources.get("fadeIn",null,"Fade In")}:0===na?{icon:"↘",text:mxResources.get("fadeOut",null,"Fade Out")}:{icon:"◐",text:mxResources.get("fadeTo",null,"Fade To")};if("flow"==na)return!0===ma.flow.start?{icon:"➡",text:mxResources.get("flowOn",null,"Flow On")}:!1===ma.flow.start?{icon:"⏸",text:mxResources.get("flowOff",null,"Flow Off")}:{icon:"➡",text:mxResources.get("flowOn",null,"Flow Toggle")};if("opacity"==na)return{icon:"◐",text:mxResources.get("setOpacity",null,"Set Opacity")};ma=null!=na?CustomActionDialog.SCHEMAS[na]:null;return null!=ma?{icon:ma.icon||"?",text:mxResources.get(ma.labelKey||na,null,ma.label||na)}:{icon:"?",text:na||"?"}},va=function(){E.value=JSON.stringify(M,null,2);ba(!0);Ra()},wa=function(){E.value=JSON.stringify(M,null,2);ba(!0)},qa=new Set,Ba=null,Aa=null,Da=null,Ca=null,ca=null,fa=function(ma,na){null!=@@ -13126,12 +13129,12 @@ Bb();0===na&&(sb.style.visibility="hidden");sb.addEventListener("click",function("wipeIn"==Ia||"wipeOut"==Ia||"popIn"==Ia||"popOut"==Ia)){var tb=Ha(Db.delay,{min:0,step:100,width:55,placeholder:"900"});tb.title=mxResources.get("duration",null,"Duration (ms)");tb.addEventListener("change",function(){var Ta=parseFloat(tb.value);Ta=""===tb.value||isNaN(Ta)||0>Ta?void 0:Ta;null==Ta?delete M.steps[na][Ia].delay:M.steps[na][Ia].delay=Ta;wa()});za.appendChild(tb);Sa=document.createElement("span");Sa.className="geDialogHint";Sa.style.cssText="flex:0 0 auto";mxUtils.write(Sa,"ms");za.appendChild(Sa)}"viewbox"==Ia&&(Sa=document.createElement("button"),Sa.type="button",Sa.className="geBtn",Sa.style.cssText="flex:0 0 auto;padding:2px 8px;font-size:11px;min-width:0",Sa.textContent=mxResources.get("useCurrent",null,"Use Current"),Sa.title=Sa.textContent,Sa.addEventListener("click",function(Ta){Ta.preventDefault();Ta=Fb();var Ma=M.steps[na].viewbox;if(null==Ma||"object"!=typeof Ma)Ma=M.steps[na].viewbox={};Ma.x=Ta.x;Ma.y=Ta.y;Ma.width=Ta.width;Ma.height=Ta.height;null==Ma.border&&(Ma.border=Ta.border);va()}),za.appendChild(Sa))}Sa=Ea("▶",mxResources.get("preview",null,"Preview"),!0,function(){Oa();var Ta=JSON.parse(JSON.stringify(Graph.flattenAnimationActions([ma])));A.executeCustomActions(Ta)});za.appendChild(Sa);return za};g.addEventListener("change",function(){g.checked?(C.style.display="none",E.style.display="block",W()):(E.style.display="none",C.style.display="block",Q(null),Ra())});E.addEventListener("input",function(){ba(!0);try{var ma=Editor.parseAnimationData(E.value);null!=ma&&Array.isArray(ma.steps)&&-(M=ma,qa.clear(),Ba=null,Q(null),null!=B&&(B.checked=!!M.loop),null!=F&&(F.checked=!M.enabled),g.checked||Ra())}catch(na){Q(V(E.value,na))}});Ra();var Za=document.createElement("div");Za.className="geDialogSection";Za.style.cssText="margin-top:10px;margin-bottom:0;flex:0 0 auto;display:flex;flex-direction:column;gap:8px";var eb=document.createElement("div");eb.style.cssText="display:flex;align-items:center;gap:8px;flex-wrap:wrap";Za.appendChild(eb);var qb=document.createElement("select");qb.style.cssText=-"flex:1 1 200px;min-width:180px;padding:5px 6px;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:4px;background:light-dark(#ffffff,#1c1c1e);color:light-dark(#1d1d1f,#e0e0e0);font-size:13px";var lb=[],Ya=document.createElement("option");Ya.value="";Ya.disabled=!0;Ya.selected=!0;var rb=function(){Ya.textContent=mxResources.get("add",null,"Add")+"…"};rb();H.push(rb);qb.appendChild(Ya);for(var yb=[{labelKey:"visibilityActions",label:"Visibility",keys:["toggle","show","hide"]},{labelKey:"effects",+(M=ma,qa.clear(),Ba=null,Q(null),null!=B&&(B.checked=!!M.loop),null!=G&&(G.checked=!M.enabled),g.checked||Ra())}catch(na){Q(V(E.value,na))}});Ra();var Za=document.createElement("div");Za.className="geDialogSection";Za.style.cssText="margin-top:10px;margin-bottom:0;flex:0 0 auto;display:flex;flex-direction:column;gap:8px";var eb=document.createElement("div");eb.style.cssText="display:flex;align-items:center;gap:8px;flex-wrap:wrap";Za.appendChild(eb);var qb=document.createElement("select");qb.style.cssText=+"flex:1 1 200px;min-width:180px;padding:5px 6px;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:4px;background:light-dark(#ffffff,#1c1c1e);color:light-dark(#1d1d1f,#e0e0e0);font-size:13px";var lb=[],Ya=document.createElement("option");Ya.value="";Ya.disabled=!0;Ya.selected=!0;var rb=function(){Ya.textContent=mxResources.get("add",null,"Add")+"…"};rb();F.push(rb);qb.appendChild(Ya);for(var yb=[{labelKey:"visibilityActions",label:"Visibility",keys:["toggle","show","hide"]},{labelKey:"effects",label:"Effects",keys:"fadeIn fadeOut fadeTo wipeIn wipeOut popIn popOut".split(" ")},{labelKey:"style",label:"Style",keys:["opacity","style","toggleStyle","highlight","flow"]},{labelKey:"navigation",label:"Navigation",keys:["select","scroll","viewbox","open"]},{labelKey:"tags",label:"Tags",keys:["tags"]},{labelKey:"timing",label:"Timing",keys:["wait"]}],ub=0;ub<yb.length;ub++){var Cb=document.createElement("optgroup");Cb.label=mxResources.get(yb[ub].labelKey,null,yb[ub].label);lb.push({el:Cb,prop:"label",key:yb[ub].labelKey,fallback:yb[ub].label});for(var Wa=0;Wa<yb[ub].keys.length;Wa++){var mb=yb[ub].keys[Wa],Ua=CustomActionDialog.SCHEMAS[mb];if(null!=Ua){var nb=document.createElement("option");nb.value=mb;var Hb=Ua.labelKey||mb;nb.textContent=mxResources.get(Hb,null,Ua.label);lb.push({el:nb,prop:"textContent",key:Hb,fallback:Ua.label});Cb.appendChild(nb)}}qb.appendChild(Cb)}var jb=document.createElement("optgroup");jb.label="──────";var db=document.createElement("option");db.value="__deleteAll__";-db.className="geDeleteOpt";db.textContent=mxResources.get("deleteAll",null,"Delete All");lb.push({el:db,prop:"textContent",key:"deleteAll",fallback:"Delete All"});jb.appendChild(db);qb.appendChild(jb);H.push(function(){for(var ma=0;ma<lb.length;ma++){var na=lb[ma];na.el[na.prop]=mxResources.get(na.key,null,na.fallback)}});eb.appendChild(qb);var Ab=[],vb=function(ma,na,za,Ga){var Ia=mxResources.get(na,null,za);Ga=Ea("",Ia,!0,Ga);Ia=document.createElement("img");Ia.className="geAdaptiveAsset";Ia.setAttribute("src",-ma);Ia.style.cssText="width:14px;height:14px;vertical-align:middle";Ga.appendChild(Ia);Ab.push({el:Ga,key:na,fallback:za});eb.appendChild(Ga);return Ga};Aa=vb(Editor.copyImage,"copy","Copy",ua);Da=vb(Editor.pasteImage,"paste","Paste",ia);Ca=vb(Editor.duplicateImage,"duplicate","Duplicate",ka);ca=vb(Editor.trashImage,"delete","Delete",ea);oa();H.push(function(){for(var ma=0;ma<Ab.length;ma++){var na=Ab[ma];na.el.title=mxResources.get(na.key,null,na.fallback)}});c.addEventListener("keydown",function(ma){var na=+db.className="geDeleteOpt";db.textContent=mxResources.get("deleteAll",null,"Delete All");lb.push({el:db,prop:"textContent",key:"deleteAll",fallback:"Delete All"});jb.appendChild(db);qb.appendChild(jb);F.push(function(){for(var ma=0;ma<lb.length;ma++){var na=lb[ma];na.el[na.prop]=mxResources.get(na.key,null,na.fallback)}});eb.appendChild(qb);var Ab=[],vb=function(ma,na,za,Ga){var Ia=mxResources.get(na,null,za);Ga=Ea("",Ia,!0,Ga);Ia=document.createElement("img");Ia.className="geAdaptiveAsset";Ia.setAttribute("src",+ma);Ia.style.cssText="width:14px;height:14px;vertical-align:middle";Ga.appendChild(Ia);Ab.push({el:Ga,key:na,fallback:za});eb.appendChild(Ga);return Ga};Aa=vb(Editor.copyImage,"copy","Copy",ua);Da=vb(Editor.pasteImage,"paste","Paste",ia);Ca=vb(Editor.duplicateImage,"duplicate","Duplicate",ka);ca=vb(Editor.trashImage,"delete","Delete",ea);oa();F.push(function(){for(var ma=0;ma<Ab.length;ma++){var na=Ab[ma];na.el.title=mxResources.get(na.key,null,na.fallback)}});c.addEventListener("keydown",function(ma){var na=ma.target,za=null!=na&&null!=na.tagName?na.tagName.toLowerCase():"";"textarea"==za||"select"==za||"input"==za&&"checkbox"!=na.type||null!=na&&na.isContentEditable||(na=null!=ma.key?ma.key.toLowerCase():"",za=!1,!("delete"!=na&&"backspace"!=na||ma.metaKey||ma.ctrlKey||ma.altKey)&&0<qa.size?(ea(),za=!0):(mxClient.IS_MAC?ma.metaKey:ma.ctrlKey)&&!ma.altKey&&("c"==na&&0<qa.size&&""==window.getSelection().toString()?(ua(),za=!0):"v"==na&&null!=AnimationDialog.stepsClipboard&&0<AnimationDialog.stepsClipboard.length?(ia(),za=!0):"d"==na&&0<qa.size&&(ka(),za=!0)),za&&(ma.preventDefault(),ma.stopPropagation()))});c.appendChild(Za);var Fb=function(){var ma=A.view,na=A.container,za=ma.scale;ma=ma.translate;return{x:Math.round(na.scrollLeft/za-ma.x),y:Math.round(na.scrollTop/za-ma.y),width:Math.round(na.clientWidth/za),height:Math.round(na.clientHeight/za),border:0}},Fa=function(ma,na){var za=CustomActionDialog.SCHEMAS[ma];if(null==za)return null;var Ga={};if(null!=za.primary){var Ia=za.primary.def;Ga[ma]=null!=Ia?"number"==za.primary.type?parseFloat(Ia):Ia:"number"==za.primary.type?0:""}else{Ia={};za.selector&&Array.isArray(na)&&0<na.length&&(Ia.cells=na.slice());if(Array.isArray(za.fields))for(na=0;na<za.fields.length;na++){var Sa=za.fields[na];null!=Sa.def&&(Ia[Sa.name]="number"==Sa.type?parseFloat(Sa.def):Sa.def)}"viewbox"==ma&&(za=Fb(),null==Ia.x&&(Ia.x=za.x),null==Ia.y&&(Ia.y=za.y),null==Ia.width&&(Ia.width=za.width),null==Ia.height&&(Ia.height=za.height),null==Ia.border&&(Ia.border=za.border));Ga[ma]=@@ -13139,10 +13142,10 @@ Ia}return Ga};qb.addEventListener("change",function(){var ma=qb.value;qb.value="null,Ka=null,Qa=null,La=function(){if(null!=Qa){var ma=null!=Ka;Qa.disabled=!ma;Qa.style.opacity=ma?"":"0.4";Qa.style.cursor=ma?"":"default"}},Oa=function(){null==Ka&&(Ka=new Editor.AnimationPlayer(A,M),Ka.snapshotOpacity(),La())},$a=function(){if(null!=Ka){Ka.restoreOpacity();for(var ma=Ka.collectReferencedCells(),na=[],za=0;za<ma.length;za++)A.getModel().isEdge(ma[za])&&na.push(ma[za]);0<na.length&&Editor.toggleFlowAnimation(A,na,"stop");A.refresh();Ka=null;La()}},cb=function(){null!=Na&&(Na.stop(),Na=null)},gb=document.createElement("div");gb.style.cssText="margin-top:20px;display:flex;gap:6px;flex:0 0 auto";var zb=function(ma,na){var za=new Set;if(null!=ma&&0<=ma)for(na=null!=na?na:ma+1;ma<na;ma++)za.add(ma);if(za.size===K.size){ma=!0;na=$jscomp.makeIterator(za);for(var Ga=na.next();!Ga.done;Ga=na.next())if(!K.has(Ga.value)){ma=!1;break}if(ma)return}K=za;za=C.querySelectorAll("[data-step-idx]");for(ma=0;ma<za.length;ma++)na=parseInt(za[ma].getAttribute("data-step-idx"),10),za[ma].classList.toggle("geAnimationStepActive",K.has(na))};gb.appendChild(b.createHelpIcon(ANIMATION_HELP_URL));var ib=this,Eb=function(){if("page"==y){var ma=A.getModel().getRoot(),na={steps:M.steps};!1===M.loop&&(na.loop=!1);!1===M.enabled&&(na.enabled=!1);na=0<na.steps.length?JSON.stringify({animation:na}):null;A.setAttributeForCell(ma,"animation",na);A.setAttributeForCell(ma,"animationHideInitial",null)}else"function"==typeof u.save&&u.save(M);ba(!1)};da=mxUtils.button(mxResources.get("preview"),function(){cb();Oa();Na=new Editor.AnimationPlayer(A,-M);Na.snapshot=[];Na.play({done:function(){Na=null;zb(-1)},onStep:function(ma,na){zb(ma,na)}})});da.className="geBtn";H.push(function(){da.textContent=mxResources.get("preview");da.title=mxResources.get("preview")});da.title=mxResources.get("preview");gb.appendChild(da);var fb=mxUtils.button(mxResources.get("reset",null,"Reset"),function(){cb();zb(-1);$a()});fb.className="geBtn";H.push(function(){var ma=mxResources.get("reset",null,"Reset");fb.textContent=ma;fb.title=ma});fb.title=mxResources.get("reset",-null,"Reset");Qa=fb;La();gb.appendChild(fb);S=document.createElement("span");S.style.flex="1 1 auto";gb.appendChild(S);var xb=mxUtils.button(mxResources.get("cancel"),function(){Y?Gb():ib.window.setVisible(!1)});xb.className="geBtn";H.push(function(){xb.textContent=mxResources.get("cancel");xb.title=mxResources.get("cancel")});xb.title=mxResources.get("cancel");gb.appendChild(xb);aa=mxUtils.button(mxResources.get("save"),function(){g.checked&&!O?(W(),E.focus()):(Eb(),ib.window.setVisible(!1))});aa.className=-"geBtn gePrimaryBtn";H.push(function(){aa.textContent=mxResources.get("save");aa.title=mxResources.get("save")});aa.title=mxResources.get("save");gb.appendChild(aa);c.appendChild(gb);this.window=new mxWindow(G(),c,k,m,d,q,!0,!0);this.window.minimumSize=new mxRectangle(0,0,360,360);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);var Xa=function(){"function"==typeof J.closePopover&&J.closePopover()};this.window.addListener(mxEvent.MOVE,-Xa);this.window.addListener(mxEvent.RESIZE,Xa);var Jb=function(){for(var ma=0;ma<H.length;ma++)try{H[ma]()}catch(na){}null!=ib.window&&null!=ib.window.title&&(ib.window.title.innerHTML=mxUtils.htmlEntities(G()));Ra()};b.addListener("languageChanged",Jb);this.window.addListener(mxEvent.DESTROY,function(){b.removeListener(Jb)});var Gb=function(){b.confirm(mxResources.get("allChangesLost"),null,function(){ba(!1);ib.window.setVisible(!1)},mxResources.get("cancel"),mxResources.get("discardChanges"))},+M);Na.snapshot=[];Na.play({done:function(){Na=null;zb(-1)},onStep:function(ma,na){zb(ma,na)}})});da.className="geBtn";F.push(function(){da.textContent=mxResources.get("preview");da.title=mxResources.get("preview")});da.title=mxResources.get("preview");gb.appendChild(da);var fb=mxUtils.button(mxResources.get("reset",null,"Reset"),function(){cb();zb(-1);$a()});fb.className="geBtn";F.push(function(){var ma=mxResources.get("reset",null,"Reset");fb.textContent=ma;fb.title=ma});fb.title=mxResources.get("reset",+null,"Reset");Qa=fb;La();gb.appendChild(fb);S=document.createElement("span");S.style.flex="1 1 auto";gb.appendChild(S);var xb=mxUtils.button(mxResources.get("cancel"),function(){Y?Gb():ib.window.setVisible(!1)});xb.className="geBtn";F.push(function(){xb.textContent=mxResources.get("cancel");xb.title=mxResources.get("cancel")});xb.title=mxResources.get("cancel");gb.appendChild(xb);aa=mxUtils.button(mxResources.get("save"),function(){g.checked&&!O?(W(),E.focus()):(Eb(),ib.window.setVisible(!1))});aa.className=+"geBtn gePrimaryBtn";F.push(function(){aa.textContent=mxResources.get("save");aa.title=mxResources.get("save")});aa.title=mxResources.get("save");gb.appendChild(aa);c.appendChild(gb);this.window=new mxWindow(H(),c,k,m,d,q,!0,!0);this.window.minimumSize=new mxRectangle(0,0,360,360);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);var Xa=function(){"function"==typeof J.closePopover&&J.closePopover()};this.window.addListener(mxEvent.MOVE,+Xa);this.window.addListener(mxEvent.RESIZE,Xa);var Jb=function(){for(var ma=0;ma<F.length;ma++)try{F[ma]()}catch(na){}null!=ib.window&&null!=ib.window.title&&(ib.window.title.innerHTML=mxUtils.htmlEntities(H()));Ra()};b.addListener("languageChanged",Jb);this.window.addListener(mxEvent.DESTROY,function(){b.removeListener(Jb)});var Gb=function(){b.confirm(mxResources.get("allChangesLost"),null,function(){ba(!1);ib.window.setVisible(!1)},mxResources.get("cancel"),mxResources.get("discardChanges"))},Kb=ib.window.setVisible.bind(ib.window);ib.window.setVisible=function(ma){!1===ma&&Y&&Eb();Kb(ma)};this.window.addListener("hide",function(){cb();zb(-1);$a()});"page"==y&&A.addListener(mxEvent.ROOT,function(){var ma=A.getModel().getRoot();if(ma!=X){if(Y){var na={steps:M.steps};!1===M.loop&&(na.loop=!1);!1===M.enabled&&(na.enabled=!1);na=0<M.steps.length?JSON.stringify({animation:na}):null;A.setAttributeForCell(X,"animation",na)}X=ma;Z();ba(!1);qa.clear();Ba=null;Ra();cb()}});var Mb=function(){ba(!1);ib.window.setVisible(!1)};b.editor.addListener("fileLoaded",Mb);this.window.addListener(mxEvent.DESTROY,function(){b.editor.removeListener(Mb)});installDialogDocking(b,this);this.window.setVisible(!0);window.setTimeout(mxUtils.bind(this,function(){null==this.window||null==this.window.div||this.window.minimized||null!=this.window.dockState||this.window.setLocation(this.window.getX(),this.window.getY())}),0)};AnimationDialog.stepsClipboard=null;var CustomGitLabUrlWarningDialog=function(b,k){var m=document.createElement("div"),d=document.createElement("h3");mxUtils.write(d,mxResources.get("customGitlabUrlTitle"));m.appendChild(d);d=document.createElement("p");mxUtils.write(d,mxResources.get("customGitlabUrlWarning"));m.appendChild(d);d=document.createElement("p");var q=document.createElement("strong");mxUtils.write(q,mxResources.get("customGitlabUrlServer")+" ");d.appendChild(q);q=document.createElement("code");mxUtils.write(q,k);d.appendChild(q);@@ -13152,89 +13155,89 @@ k==b.oneDrive?(y=mxResources.get("oneDrive"),A.src=IMAGE_PATH+"/onedrive-logo-wh[y]));var J=document.createElement("input");J.setAttribute("type","checkbox");y=mxUtils.button(mxResources.get("authorize"),function(){d(J.checked)});y.insertBefore(A,y.firstChild);y.style.marginTop="6px";y.className="geBigButton";y.style.fontSize="18px";y.style.padding="14px";q.appendChild(u);q.appendChild(b);q.appendChild(y);m&&(m=document.createElement("p"),m.style.marginTop="20px",m.appendChild(J),u=document.createElement("span"),mxUtils.write(u," "+mxResources.get("rememberMe")),m.appendChild(u),q.appendChild(m),J.checked=!0,J.defaultChecked=!0,mxEvent.addListener(u,"click",function(K){J.checked=!J.checked;mxEvent.consume(K)}));this.container=q},MoreShapesDialog=function(b,k,m){m=null!=m?m:b.sidebar.entries;var d=document.createElement("div"),q=[];if(null!=b.sidebar.customEntries)for(var u=0;u<b.sidebar.customEntries.length;u++){for(var y=b.sidebar.customEntries[u]||{},A={title:b.getResource(y.title),entries:[]},J=0;null!=y.entries&&J<y.entries.length;J++){var K=y.entries[J];A.entries.push({id:K.id,title:b.getResource(K.title),desc:b.getResource(K.desc),image:K.preview})}0<A.entries.length&&q.push(A)}for(u=0;u<m.length;u++)if(null==b.sidebar.enabledLibraries)q.push(m[u]);else{A={title:m[u].title,entries:[]};for(J=0;J<m[u].entries.length;J++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,m[u].entries[J].id)&&A.entries.push(m[u].entries[J]);0<A.entries.length&&q.push(A)}m=q;if(k){u=mxUtils.bind(this,function(L){for(var D=0;D<L.length;D++)(function(T){var N=document.createElement("div");N.className=-"geMoreShapesSectionHeader";mxUtils.write(N,T.title);H.appendChild(N);for(var R=0;R<T.entries.length;R++)(function(P){var U=document.createElement("div");U.className="geMoreShapesItem";U.setAttribute("title",P.title+" ("+P.id+")");var S=document.createElement("input");S.setAttribute("type","checkbox");S.checked=b.sidebar.isEntryVisible(P.id);S.defaultChecked=S.checked;U.appendChild(S);var z=document.createElement("span");mxUtils.write(z,P.title);U.appendChild(z);H.appendChild(U);z=function(g){if(null==-g||"INPUT"!=mxEvent.getSource(g).nodeName){G.style.textAlign="center";G.style.padding="0px";G.style.color="";G.innerText="";if(null!=P.desc){var p=document.createElement("pre");p.style.boxSizing="border-box";p.style.fontFamily="inherit";p.style.margin="20px";p.style.right="0px";p.style.textAlign="left";mxUtils.write(p,P.desc);G.appendChild(p)}null!=P.imageCallback?P.imageCallback(G):null!=P.image?(p=document.createElement("img"),p.setAttribute("border","0"),p.style.maxWidth="100%",p.setAttribute("src",-P.image),G.appendChild(p)):null==P.desc&&(G.style.padding="20px",G.style.color="rgb(179, 179, 179)",mxUtils.write(G,mxResources.get("noPreview")));null!=c&&c.classList.remove("geMoreShapesItemSelected");c=U;c.classList.add("geMoreShapesItemSelected");null!=g&&mxEvent.consume(g)}};mxEvent.addListener(U,"click",z);mxEvent.addListener(U,"dblclick",function(g){S.checked=!S.checked;mxEvent.consume(g)});f.push(function(){return S.checked?P.id:null});0==D&&0==R&&z()})(T.entries[R])})(L[D])});J=document.createElement("div");-J.className="geDialogTitle";mxUtils.write(J,mxResources.get("shapes"));J.style.position="absolute";J.style.top="0px";J.style.left="0px";J.style.lineHeight="40px";J.style.height="40px";J.style.right="0px";var H=document.createElement("div"),G=document.createElement("div");H.style.position="absolute";H.style.top="40px";H.style.left="0px";H.style.width="220px";H.style.bottom="70px";H.style.overflow="auto";G.className="geMoreShapesPreview";G.style.position="absolute";G.style.left="220px";G.style.right=-"0px";G.style.top="40px";G.style.bottom="70px";G.style.overflow="auto";G.style.textAlign="center";var c=null,f=[];u(m);d.appendChild(J);d.appendChild(H);d.appendChild(G);m=document.createElement("div");m.className="geDialogFooter";m.style.position="absolute";m.style.display="flex";m.style.alignItems="center";m.style.paddingRight="16px";m.style.paddingLeft="16px";m.style.left="0px";m.style.right="0px";m.style.bottom="0px";m.style.height="70px";u=document.createElement("div");u.className="geMoreShapesFooterChecks";+"geMoreShapesSectionHeader";mxUtils.write(N,T.title);F.appendChild(N);for(var R=0;R<T.entries.length;R++)(function(P){var U=document.createElement("div");U.className="geMoreShapesItem";U.setAttribute("title",P.title+" ("+P.id+")");var S=document.createElement("input");S.setAttribute("type","checkbox");S.checked=b.sidebar.isEntryVisible(P.id);S.defaultChecked=S.checked;U.appendChild(S);var z=document.createElement("span");mxUtils.write(z,P.title);U.appendChild(z);F.appendChild(U);z=function(g){if(null==+g||"INPUT"!=mxEvent.getSource(g).nodeName){H.style.textAlign="center";H.style.padding="0px";H.style.color="";H.innerText="";if(null!=P.desc){var p=document.createElement("pre");p.style.boxSizing="border-box";p.style.fontFamily="inherit";p.style.margin="20px";p.style.right="0px";p.style.textAlign="left";mxUtils.write(p,P.desc);H.appendChild(p)}null!=P.imageCallback?P.imageCallback(H):null!=P.image?(p=document.createElement("img"),p.setAttribute("border","0"),p.style.maxWidth="100%",p.setAttribute("src",+P.image),H.appendChild(p)):null==P.desc&&(H.style.padding="20px",H.style.color="rgb(179, 179, 179)",mxUtils.write(H,mxResources.get("noPreview")));null!=c&&c.classList.remove("geMoreShapesItemSelected");c=U;c.classList.add("geMoreShapesItemSelected");null!=g&&mxEvent.consume(g)}};mxEvent.addListener(U,"click",z);mxEvent.addListener(U,"dblclick",function(g){S.checked=!S.checked;mxEvent.consume(g)});f.push(function(){return S.checked?P.id:null});0==D&&0==R&&z()})(T.entries[R])})(L[D])});J=document.createElement("div");+J.className="geDialogTitle";mxUtils.write(J,mxResources.get("shapes"));J.style.position="absolute";J.style.top="0px";J.style.left="0px";J.style.lineHeight="40px";J.style.height="40px";J.style.right="0px";var F=document.createElement("div"),H=document.createElement("div");F.style.position="absolute";F.style.top="40px";F.style.left="0px";F.style.width="220px";F.style.bottom="70px";F.style.overflow="auto";H.className="geMoreShapesPreview";H.style.position="absolute";H.style.left="220px";H.style.right=+"0px";H.style.top="40px";H.style.bottom="70px";H.style.overflow="auto";H.style.textAlign="center";var c=null,f=[];u(m);d.appendChild(J);d.appendChild(F);d.appendChild(H);m=document.createElement("div");m.className="geDialogFooter";m.style.position="absolute";m.style.display="flex";m.style.alignItems="center";m.style.paddingRight="16px";m.style.paddingLeft="16px";m.style.left="0px";m.style.right="0px";m.style.bottom="0px";m.style.height="70px";u=document.createElement("div");u.className="geMoreShapesFooterChecks";J=document.createElement("label");J.className="geMoreShapesFooterCheck";var l=document.createElement("input");l.setAttribute("type","checkbox");l.checked=b.sidebar.sidebarTitles;l.defaultChecked=l.checked;J.appendChild(l);k=document.createElement("span");mxUtils.write(k,mxResources.get("labels"));J.appendChild(k);u.appendChild(J);var n=document.createElement("input");n.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)J=document.createElement("label"),J.className="geMoreShapesFooterCheck",n.checked=!0,n.defaultChecked=!0,J.appendChild(n),k=document.createElement("span"),mxUtils.write(k,mxResources.get("rememberThisSetting")),J.appendChild(k),u.appendChild(J);m.appendChild(u);u=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});u.className="geBtn";J=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();for(var L=[],D=0;D<f.length;D++){var T=f[D].apply(this,arguments);null!=T&&L.push(T)}"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||!Editor.isSettingsEnabled()||(D=mxUtils.indexOf(L,".scratchpad"),null!=b.scratchpad!=(0<=D&&0<L.splice(D,1).length)&&b.toggleScratchpad(),D=mxUtils.indexOf(L,"search"),mxSettings.settings.search=0<=D&&0<L.splice(D,1).length,b.sidebar.showPalette("search",mxSettings.settings.search),n.checked&&mxSettings.save());b.sidebar.showEntries(L.join(";"),n.checked,!0);b.setSidebarTitles(l.checked,n.checked)});J.className="geBtn gePrimaryBtn";k=document.createElement("div");k.style.flex="1";k.style.textAlign="right";b.editor.cancelFirst?(k.appendChild(u),k.appendChild(J)):(k.appendChild(J),k.appendChild(u));m.appendChild(k)}else{var r=document.createElement("table");u=document.createElement("tbody");d.style.height="100%";d.style.overflow="auto";J=document.createElement("tr");r.style.width="100%";k=document.createElement("td");q=document.createElement("td");y=document.createElement("td");var t=mxUtils.bind(this,function(L,D,T){var N=document.createElement("input");N.type="checkbox";r.appendChild(N);N.checked=b.sidebar.isEntryVisible(T);var R=document.createElement("span");mxUtils.write(R,D);D=document.createElement("div");D.style.display="block";D.appendChild(N);D.appendChild(R);mxEvent.addListener(R,"click",function(P){N.checked=!N.checked;mxEvent.consume(P)});L.appendChild(D);return function(){return N.checked?T:null}});J.appendChild(k);J.appendChild(q);J.appendChild(y);u.appendChild(J);r.appendChild(u);f=[];var x=0;for(u=0;u<m.length;u++)for(J=0;J<m[u].entries.length;J++)x++;-var B=[k,q,y],F=0;for(u=0;u<m.length;u++)(function(L){for(var D=0;D<L.entries.length;D++){var T=L.entries[D];f.push(t(B[Math.floor(F/(x/3))],T.title,T.id));F++}})(m[u]);d.appendChild(r);m=document.createElement("div");m.style.marginTop="18px";m.style.textAlign="center";n=document.createElement("input");isLocalStorage&&(n.setAttribute("type","checkbox"),n.checked=!0,n.defaultChecked=!0,m.appendChild(n),u=document.createElement("span"),mxUtils.write(u," "+mxResources.get("rememberThisSetting")),m.appendChild(u),+var B=[k,q,y],G=0;for(u=0;u<m.length;u++)(function(L){for(var D=0;D<L.entries.length;D++){var T=L.entries[D];f.push(t(B[Math.floor(G/(x/3))],T.title,T.id));G++}})(m[u]);d.appendChild(r);m=document.createElement("div");m.style.marginTop="18px";m.style.textAlign="center";n=document.createElement("input");isLocalStorage&&(n.setAttribute("type","checkbox"),n.checked=!0,n.defaultChecked=!0,m.appendChild(n),u=document.createElement("span"),mxUtils.write(u," "+mxResources.get("rememberThisSetting")),m.appendChild(u),mxEvent.addListener(u,"click",function(L){n.checked=!n.checked;mxEvent.consume(L)}));d.appendChild(m);u=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});u.className="geBtn";J=mxUtils.button(mxResources.get("apply"),function(){for(var L=["search"],D=0;D<f.length;D++){var T=f[D].apply(this,arguments);null!=T&&L.push(T)}b.sidebar.showEntries(0<L.length?L.join(";"):"",n.checked);b.hideDialog()});J.className="geBtn gePrimaryBtn";m=document.createElement("div");m.style.marginTop="26px";-m.style.textAlign="right";b.editor.cancelFirst?(m.appendChild(u),m.appendChild(J)):(m.appendChild(J),m.appendChild(u))}d.appendChild(m);this.container=d},PluginsDialog=function(b,k,m,d){function q(){H=!0;if(0==K.length){J.innerText="";var t=document.createElement("div");t.className="geDialogHint";mxUtils.write(t,mxResources.get("noPlugins"));J.appendChild(t)}else for(J.innerText="",t=0;t<K.length;t++){var x=document.createElement("span");x.style.display="flex";x.style.alignItems="center";x.style.whiteSpace=-"nowrap";x.style.minHeight="26px";var B=document.createElement("img");B.src=Editor.trashImage;B.style.cursor="pointer";B.style.marginRight="8px";B.style.width="16px";B.style.flexShrink="0";B.setAttribute("title",mxResources.get("delete"));x.appendChild(B);var F=document.createElement("span");F.style.overflow="hidden";F.style.textOverflow="ellipsis";mxUtils.write(F,K[t]);x.appendChild(F);J.appendChild(x);mxEvent.addListener(B,"click",function(L){return function(){b.confirm(mxResources.get("delete")+-' "'+K[L]+'"?',function(){null!=m&&m(K[L]);K.splice(L,1);q()})}}(t))}}function u(){if(null!=G){G.innerText="";var t=document.createElement("option");t.value="";mxUtils.write(t,mxResources.get("chooseAnOption")||"Choose…");G.appendChild(t);for(t=0;t<App.publicPlugin.length;t++){var x=App.publicPlugin[t],B=App.pluginRegistry[x],F=document.createElement("option");mxUtils.write(F,x);F.value=x;if(null==B||0<=mxUtils.indexOf(K,B))F.disabled=!0;G.appendChild(F)}null!=c&&(c.disabled=!0)}}var y=document.createElement("div"),-A=document.createElement("h3");mxUtils.write(A,mxResources.get("plugins"));y.appendChild(A);var J=document.createElement("div");J.className="geDialogSection";J.style.height="160px";J.style.overflow="auto";J.style.fontSize="13px";var K=mxSettings.getPlugins().slice(),H=!1;y.appendChild(J);q();H=!1;var G=null,c=null;if(null==k){A=document.createElement("div");A.style.display="flex";A.style.alignItems="center";A.style.gap="8px";A.style.marginTop="10px";G=document.createElement("select");G.style.flex=-"1";G.style.minWidth="0";A.appendChild(G);c=mxUtils.button(mxResources.get("add"),function(){var t=G.value;""!=t&&(t=App.pluginRegistry[t],null!=t&&0>mxUtils.indexOf(K,t)&&(K.push(t),q()))});c.className="geBtn";c.style.margin="0";c.disabled=!0;A.appendChild(c);mxEvent.addListener(G,"change",function(){c.disabled=""==G.value});if(ALLOW_CUSTOM_PLUGINS){var f=mxUtils.button(mxResources.get("custom")+"...",function(){var t=new FilenameDialog(b,"",mxResources.get("add"),function(x){b.hideDialog();if(null!=-x&&0<x.length){x=x.split(";");for(var B=0;B<x.length;B++){var F=x[B],L=App.pluginRegistry[F];null!=L&&(F=L);0<F.length&&0>mxUtils.indexOf(K,F)&&K.push(F)}q()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(t.container,300,80,!0,!0);t.init()});f.className="geBtn";f.style.margin="0";A.appendChild(f)}y.appendChild(A)}var l=q;q=function(){l();u()};u();A=null;null!=k&&(A=mxUtils.button(mxResources.get("add"),function(){k(function(t){t&&0>mxUtils.indexOf(K,t)&&K.push(t);q()})}),-A.className="geBtn");f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});f.className="geBtn";var n=mxUtils.button(d?mxResources.get("close"):mxResources.get("apply"),function(){H?(mxSettings.setPlugins(K),mxSettings.save(),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))):b.hideDialog()});n.className="geBtn gePrimaryBtn";var r=document.createElement("div");r.style.marginTop="14px";r.style.textAlign="right";b.isOffline()||r.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/plugins"));-b.editor.cancelFirst?(d||r.appendChild(f),null!=A&&r.appendChild(A),r.appendChild(n)):(null!=A&&r.appendChild(A),r.appendChild(n),d||r.appendChild(f));y.appendChild(r);this.container=y},CropImageDialog=function(b,k,m,d){function q(){null!=f&&(G.style.overflow="hidden",f.maxFitScale=null,f.fit(8),f.center(),G.style.overflow="auto")}function u(O){var Q=document.createElement("span");Q.style.marginLeft="6px";Q.style.fontSize="11px";mxUtils.write(Q,O);N.appendChild(Q);O=document.createElement("input");+m.style.textAlign="right";b.editor.cancelFirst?(m.appendChild(u),m.appendChild(J)):(m.appendChild(J),m.appendChild(u))}d.appendChild(m);this.container=d},PluginsDialog=function(b,k,m,d){function q(){F=!0;if(0==K.length){J.innerText="";var t=document.createElement("div");t.className="geDialogHint";mxUtils.write(t,mxResources.get("noPlugins"));J.appendChild(t)}else for(J.innerText="",t=0;t<K.length;t++){var x=document.createElement("span");x.style.display="flex";x.style.alignItems="center";x.style.whiteSpace=+"nowrap";x.style.minHeight="26px";var B=document.createElement("img");B.src=Editor.trashImage;B.style.cursor="pointer";B.style.marginRight="8px";B.style.width="16px";B.style.flexShrink="0";B.setAttribute("title",mxResources.get("delete"));x.appendChild(B);var G=document.createElement("span");G.style.overflow="hidden";G.style.textOverflow="ellipsis";mxUtils.write(G,K[t]);x.appendChild(G);J.appendChild(x);mxEvent.addListener(B,"click",function(L){return function(){b.confirm(mxResources.get("delete")++' "'+K[L]+'"?',function(){null!=m&&m(K[L]);K.splice(L,1);q()})}}(t))}}function u(){if(null!=H){H.innerText="";var t=document.createElement("option");t.value="";mxUtils.write(t,mxResources.get("chooseAnOption")||"Choose…");H.appendChild(t);for(t=0;t<App.publicPlugin.length;t++){var x=App.publicPlugin[t],B=App.pluginRegistry[x],G=document.createElement("option");mxUtils.write(G,x);G.value=x;if(null==B||0<=mxUtils.indexOf(K,B))G.disabled=!0;H.appendChild(G)}null!=c&&(c.disabled=!0)}}var y=document.createElement("div"),+A=document.createElement("h3");mxUtils.write(A,mxResources.get("plugins"));y.appendChild(A);var J=document.createElement("div");J.className="geDialogSection";J.style.height="160px";J.style.overflow="auto";J.style.fontSize="13px";var K=mxSettings.getPlugins().slice(),F=!1;y.appendChild(J);q();F=!1;var H=null,c=null;if(null==k){A=document.createElement("div");A.style.display="flex";A.style.alignItems="center";A.style.gap="8px";A.style.marginTop="10px";H=document.createElement("select");H.style.flex=+"1";H.style.minWidth="0";A.appendChild(H);c=mxUtils.button(mxResources.get("add"),function(){var t=H.value;""!=t&&(t=App.pluginRegistry[t],null!=t&&0>mxUtils.indexOf(K,t)&&(K.push(t),q()))});c.className="geBtn";c.style.margin="0";c.disabled=!0;A.appendChild(c);mxEvent.addListener(H,"change",function(){c.disabled=""==H.value});if(ALLOW_CUSTOM_PLUGINS){var f=mxUtils.button(mxResources.get("custom")+"...",function(){var t=new FilenameDialog(b,"",mxResources.get("add"),function(x){b.hideDialog();if(null!=+x&&0<x.length){x=x.split(";");for(var B=0;B<x.length;B++){var G=x[B],L=App.pluginRegistry[G];null!=L&&(G=L);0<G.length&&0>mxUtils.indexOf(K,G)&&K.push(G)}q()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(t.container,300,80,!0,!0);t.init()});f.className="geBtn";f.style.margin="0";A.appendChild(f)}y.appendChild(A)}var l=q;q=function(){l();u()};u();A=null;null!=k&&(A=mxUtils.button(mxResources.get("add"),function(){k(function(t){t&&0>mxUtils.indexOf(K,t)&&K.push(t);q()})}),+A.className="geBtn");f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});f.className="geBtn";var n=mxUtils.button(d?mxResources.get("close"):mxResources.get("apply"),function(){F?(mxSettings.setPlugins(K),mxSettings.save(),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))):b.hideDialog()});n.className="geBtn gePrimaryBtn";var r=document.createElement("div");r.style.marginTop="14px";r.style.textAlign="right";b.isOffline()||r.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/plugins"));+b.editor.cancelFirst?(d||r.appendChild(f),null!=A&&r.appendChild(A),r.appendChild(n)):(null!=A&&r.appendChild(A),r.appendChild(n),d||r.appendChild(f));y.appendChild(r);this.container=y},CropImageDialog=function(b,k,m,d){function q(){null!=f&&(H.style.overflow="hidden",f.maxFitScale=null,f.fit(8),f.center(),H.style.overflow="auto")}function u(O){var Q=document.createElement("span");Q.style.marginLeft="6px";Q.style.fontSize="11px";mxUtils.write(Q,O);N.appendChild(Q);O=document.createElement("input");O.setAttribute("type","text");O.style.cssText="width:46px;margin:0 2px;text-align:right;";N.appendChild(O);return O}function y(){var O=t.geometry;P.value=Math.round(O.x);U.value=Math.round(O.y);S.value=Math.round(O.width);z.value=Math.round(O.height)}function A(){if(null!=f){var O=parseFloat(P.value),Q=parseFloat(U.value),V=parseFloat(S.value),W=parseFloat(z.value);if(isFinite(O)&&isFinite(Q)&&isFinite(V)&&isFinite(W)&&0<V&&0<W){var M=t.geometry.clone();M.x=O;M.y=Q;M.width=V;M.height=W;f.model.setGeometry(t,-M);f.model.setStyle(t,F+J());f.selectAll()}}}function J(){var O=p.checked,Q=v.checked,V=t.geometry;0>V.x?(V.width+=V.x,V.x=0):V.x+V.width>x&&(V.width=x-V.x,V.x=Math.min(V.x,x));0>V.y?(V.height+=V.y,V.y=0):V.y+V.height>B&&(V.height=B-V.y,V.y=Math.min(V.y,B));var W=V.x/x*100,M=100-(V.x+V.width)/x*100,X=100-(V.y+V.height)/B*100;return"inset("+mxUtils.format(V.y/B*100)+"% "+mxUtils.format(M)+"% "+mxUtils.format(X)+"% "+mxUtils.format(W)+"%"+(O?" round "+r+"%":Q?" round 50%":"")+")"}function K(O){null!=-f&&(!0!==O&&(f.model.setGeometry(t,n.clone()),r=5,E.value=r),f.model.setStyle(t,F+J()),f.selectAll(),y(),C.style.visibility=p.checked?"visible":"hidden")}var H=document.createElement("div");H.style.display="flex";H.style.flexDirection="column";H.style.height="100%";var G=document.createElement("div");G.style.flex="1";G.style.minHeight="0";G.style.overflow="auto";G.style.border="1px solid";H.appendChild(G);var c=k.replace(";base64",""),f=null,l=null,n=null,r=5,t=new mxCell("",new mxGeometry(0,0,1,-1),""),x=0,B=0,F="shape=image;fillColor=none;rotatable=0;cloneable=0;deletable=0;image="+c+";clipPath=",L="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;opacity=40;image="+c+";",D="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;image="+c+";",T=new Image;T.onload=function(){function O(){f.model.setStyle(t,F+J());y()}x=T.naturalWidth;B=T.naturalHeight;n=new mxGeometry(.15*x,.15*B,.7*x,.7*B);t.geometry=-n.clone();f=new Graph(G);f.autoExtend=!1;f.autoScroll=!1;f.setGridEnabled(!1);f.setEnabled(!0);f.setPanning(!0);f.setConnectable(!1);f.getRubberband().setEnabled(!1);f.graphHandler.allowLivePreview=!1;f.centerZoom=!0;f.background="#ffffff";var Q=f.createVertexHandler;f.createVertexHandler=function(){var la=Q.apply(this,arguments);la.livePreview=!1;return la};var V=f.isCellSelectable;f.isCellSelectable=function(la){return la===t&&V.apply(this,arguments)};l=new mxCell("",new mxGeometry(0,0,x,B),L);+M);f.model.setStyle(t,G+J());f.selectAll()}}}function J(){var O=p.checked,Q=v.checked,V=t.geometry;0>V.x?(V.width+=V.x,V.x=0):V.x+V.width>x&&(V.width=x-V.x,V.x=Math.min(V.x,x));0>V.y?(V.height+=V.y,V.y=0):V.y+V.height>B&&(V.height=B-V.y,V.y=Math.min(V.y,B));var W=V.x/x*100,M=100-(V.x+V.width)/x*100,X=100-(V.y+V.height)/B*100;return"inset("+mxUtils.format(V.y/B*100)+"% "+mxUtils.format(M)+"% "+mxUtils.format(X)+"% "+mxUtils.format(W)+"%"+(O?" round "+r+"%":Q?" round 50%":"")+")"}function K(O){null!=+f&&(!0!==O&&(f.model.setGeometry(t,n.clone()),r=5,E.value=r),f.model.setStyle(t,G+J()),f.selectAll(),y(),C.style.visibility=p.checked?"visible":"hidden")}var F=document.createElement("div");F.style.display="flex";F.style.flexDirection="column";F.style.height="100%";var H=document.createElement("div");H.style.flex="1";H.style.minHeight="0";H.style.overflow="auto";H.style.border="1px solid";F.appendChild(H);var c=k.replace(";base64",""),f=null,l=null,n=null,r=5,t=new mxCell("",new mxGeometry(0,0,1,+1),""),x=0,B=0,G="shape=image;fillColor=none;rotatable=0;cloneable=0;deletable=0;image="+c+";clipPath=",L="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;opacity=40;image="+c+";",D="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;image="+c+";",T=new Image;T.onload=function(){function O(){f.model.setStyle(t,G+J());y()}x=T.naturalWidth;B=T.naturalHeight;n=new mxGeometry(.15*x,.15*B,.7*x,.7*B);t.geometry=+n.clone();f=new Graph(H);f.autoExtend=!1;f.autoScroll=!1;f.setGridEnabled(!1);f.setEnabled(!0);f.setPanning(!0);f.setConnectable(!1);f.getRubberband().setEnabled(!1);f.graphHandler.allowLivePreview=!1;f.centerZoom=!0;f.background="#ffffff";var Q=f.createVertexHandler;f.createVertexHandler=function(){var la=Q.apply(this,arguments);la.livePreview=!1;return la};var V=f.isCellSelectable;f.isCellSelectable=function(la){return la===t&&V.apply(this,arguments)};l=new mxCell("",new mxGeometry(0,0,x,B),L);l.vertex=!0;f.addCell(l);if(null!=m)try{if("inset"==m.substring(0,5)){var W=t.geometry,M=m.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),X=parseFloat(M[0]),Z=parseFloat(M[1]),Y=parseFloat(M[2]),aa=parseFloat(M[3]);isFinite(X)&&isFinite(Z)&&isFinite(Y)&&isFinite(aa)?(W.x=aa/100*x,W.y=X/100*B,W.width=(100-Z)/100*x-W.x,W.height=(100-Y)/100*B-W.y,"round"==M[4]?"50%"==M[5]?v.setAttribute("checked","checked"):(r=parseInt(M[5]),E.value=r,p.setAttribute("checked","checked"),C.style.visibility="visible"):g.setAttribute("checked",-"checked")):m=null}else m=null}catch(la){}t.style=F+(m?m:J());t.vertex=!0;f.addCell(t);f.selectAll();f.addListener(mxEvent.CELLS_MOVED,O);f.addListener(mxEvent.CELLS_RESIZED,O);var da=f.graphHandler.mouseUp,ba=f.graphHandler.mouseDown;f.graphHandler.mouseUp=function(){da.apply(this,arguments);null!=l&&f.model.setStyle(l,L)};f.graphHandler.mouseDown=function(){ba.apply(this,arguments);null!=l&&f.model.setStyle(l,D)};f.dblClick=function(){};var ha=f.getSelectionModel().changeSelection;f.getSelectionModel().changeSelection=+"checked")):m=null}else m=null}catch(la){}t.style=G+(m?m:J());t.vertex=!0;f.addCell(t);f.selectAll();f.addListener(mxEvent.CELLS_MOVED,O);f.addListener(mxEvent.CELLS_RESIZED,O);var da=f.graphHandler.mouseUp,ba=f.graphHandler.mouseDown;f.graphHandler.mouseUp=function(){da.apply(this,arguments);null!=l&&f.model.setStyle(l,L)};f.graphHandler.mouseDown=function(){ba.apply(this,arguments);null!=l&&f.model.setStyle(l,D)};f.dblClick=function(){};var ha=f.getSelectionModel().changeSelection;f.getSelectionModel().changeSelection=function(){ha.call(this,[t],[t])};y();q()};T.onerror=function(){T.onload=null;T.src=Editor.errorImage};T.src=k;var N=document.createElement("div");N.style.display="flex";N.style.flexShrink="0";N.style.alignItems="center";N.style.justifyContent="center";N.style.paddingTop="6px";k=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=f&&f.zoomIn()});c=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=f&&f.zoomOut()});var R=b.createToolbarButton(Editor.zoomFitImage,-mxResources.get("fit"),function(){q()});N.appendChild(k);N.appendChild(c);N.appendChild(R);var P=u("X"),U=u("Y"),S=u("W"),z=u("H");mxEvent.addListener(P,"change",A);mxEvent.addListener(U,"change",A);mxEvent.addListener(S,"change",A);mxEvent.addListener(z,"change",A);H.appendChild(N);k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.display="flex";k.style.flexShrink="0";k.style.alignItems="center";k.style.justifyContent="center";var g=document.createElement("input");g.setAttribute("type",+mxResources.get("fit"),function(){q()});N.appendChild(k);N.appendChild(c);N.appendChild(R);var P=u("X"),U=u("Y"),S=u("W"),z=u("H");mxEvent.addListener(P,"change",A);mxEvent.addListener(U,"change",A);mxEvent.addListener(S,"change",A);mxEvent.addListener(z,"change",A);F.appendChild(N);k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.display="flex";k.style.flexShrink="0";k.style.alignItems="center";k.style.justifyContent="center";var g=document.createElement("input");g.setAttribute("type","radio");g.setAttribute("id","croppingRect");g.setAttribute("name","croppingShape");g.setAttribute("checked","checked");g.style.margin="5px";k.appendChild(g);c=document.createElement("label");c.setAttribute("for","croppingRect");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("rectangle"));k.appendChild(c);var p=document.createElement("input");p.setAttribute("type","radio");p.setAttribute("id","croppingRounded");p.setAttribute("name","croppingShape");p.style.margin="5px";k.appendChild(p);c=document.createElement("label");c.setAttribute("for","croppingRounded");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("rounded"));k.appendChild(c);var v=document.createElement("input");v.setAttribute("type","radio");v.setAttribute("id","croppingEllipse");v.setAttribute("name","croppingShape");v.style.margin="5px";k.appendChild(v);c=document.createElement("label");c.setAttribute("for",-"croppingEllipse");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("ellipse"));k.appendChild(c);H.appendChild(k);mxEvent.addListener(g,"change",K);mxEvent.addListener(p,"change",K);mxEvent.addListener(v,"change",K);var C=document.createElement("div");C.style.textAlign="center";C.style.flexShrink="0";C.style.visibility="hidden";var E=document.createElement("input");E.setAttribute("type","range");E.setAttribute("min","1");E.setAttribute("max",-"49");E.setAttribute("value",r);E.setAttribute("title",mxResources.get("arcSize"));C.appendChild(E);H.appendChild(C);mxEvent.addListener(E,"change",function(){r=this.value;K(!0)});k=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});k.className="geBtn";c=mxUtils.button(mxResources.get("apply"),function(){d(J(),t.geometry.width,t.geometry.height);b.hideDialog()});c.className="geBtn gePrimaryBtn";R=mxUtils.button(mxResources.get("reset"),function(){d(null,x,B);b.hideDialog()});R.className=-"geBtn";var I=document.createElement("div");I.style.flexShrink="0";I.style.marginTop="10px";I.style.whiteSpace="nowrap";I.style.display="flex";I.style.justifyContent="flex-end";b.editor.cancelFirst?(I.appendChild(k),I.appendChild(R),I.appendChild(c)):(I.appendChild(R),I.appendChild(c),I.appendChild(k));H.appendChild(I);this.container=H},EditGeometryDialog=function(b,k){function m(x,B){var F=document.createElement("div");F.className="geDialogInlineField";var L=document.createElement("label");mxUtils.write(L,-x);F.appendChild(L);x=document.createElement("input");x.setAttribute("type","text");x.value=null!=B?B:"";F.appendChild(x);F.input=x;return F}var d=b.editor.graph,q=1==k.length?d.getCellGeometry(k[0]):null,u=document.createElement("div"),y=document.createElement("h3");mxUtils.write(y,mxResources.get("editGeometry"));u.appendChild(y);y=document.createElement("div");y.className="geDialogSection";var A=document.createElement("div");A.className="geDialogCheckRow";var J=document.createElement("input");-J.setAttribute("type","checkbox");J.setAttribute("id","geEditGeoRelative");null!=q&&q.relative&&(J.setAttribute("checked","checked"),J.defaultChecked=!0);A.appendChild(J);var K=document.createElement("label");K.setAttribute("for","geEditGeoRelative");mxUtils.write(K,mxResources.get("relative"));A.appendChild(K);y.appendChild(A);A=document.createElement("div");A.className="geDialogInlineFields";K=m(mxResources.get("left"),null!=q?q.x:null);var H=K.input;A.appendChild(K);K=m(mxResources.get("top"),-null!=q?q.y:null);var G=K.input;A.appendChild(K);y.appendChild(A);A=document.createElement("div");A.className="geDialogInlineFields";A.style.marginTop="6px";K=m(mxResources.get("dx"),null!=q&&null!=q.offset?q.offset.x:null);var c=K.input;A.appendChild(K);K=m(mxResources.get("dy"),null!=q&&null!=q.offset?q.offset.y:null);var f=K.input;A.appendChild(K);y.appendChild(A);u.appendChild(y);y=document.createElement("div");y.className="geDialogSection";A=document.createElement("div");A.className="geDialogInlineFields";+"croppingEllipse");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("ellipse"));k.appendChild(c);F.appendChild(k);mxEvent.addListener(g,"change",K);mxEvent.addListener(p,"change",K);mxEvent.addListener(v,"change",K);var C=document.createElement("div");C.style.textAlign="center";C.style.flexShrink="0";C.style.visibility="hidden";var E=document.createElement("input");E.setAttribute("type","range");E.setAttribute("min","1");E.setAttribute("max",+"49");E.setAttribute("value",r);E.setAttribute("title",mxResources.get("arcSize"));C.appendChild(E);F.appendChild(C);mxEvent.addListener(E,"change",function(){r=this.value;K(!0)});k=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});k.className="geBtn";c=mxUtils.button(mxResources.get("apply"),function(){d(J(),t.geometry.width,t.geometry.height);b.hideDialog()});c.className="geBtn gePrimaryBtn";R=mxUtils.button(mxResources.get("reset"),function(){d(null,x,B);b.hideDialog()});R.className=+"geBtn";var I=document.createElement("div");I.style.flexShrink="0";I.style.marginTop="10px";I.style.whiteSpace="nowrap";I.style.display="flex";I.style.justifyContent="flex-end";b.editor.cancelFirst?(I.appendChild(k),I.appendChild(R),I.appendChild(c)):(I.appendChild(R),I.appendChild(c),I.appendChild(k));F.appendChild(I);this.container=F},EditGeometryDialog=function(b,k){function m(x,B){var G=document.createElement("div");G.className="geDialogInlineField";var L=document.createElement("label");mxUtils.write(L,+x);G.appendChild(L);x=document.createElement("input");x.setAttribute("type","text");x.value=null!=B?B:"";G.appendChild(x);G.input=x;return G}var d=b.editor.graph,q=1==k.length?d.getCellGeometry(k[0]):null,u=document.createElement("div"),y=document.createElement("h3");mxUtils.write(y,mxResources.get("editGeometry"));u.appendChild(y);y=document.createElement("div");y.className="geDialogSection";var A=document.createElement("div");A.className="geDialogCheckRow";var J=document.createElement("input");+J.setAttribute("type","checkbox");J.setAttribute("id","geEditGeoRelative");null!=q&&q.relative&&(J.setAttribute("checked","checked"),J.defaultChecked=!0);A.appendChild(J);var K=document.createElement("label");K.setAttribute("for","geEditGeoRelative");mxUtils.write(K,mxResources.get("relative"));A.appendChild(K);y.appendChild(A);A=document.createElement("div");A.className="geDialogInlineFields";K=m(mxResources.get("left"),null!=q?q.x:null);var F=K.input;A.appendChild(K);K=m(mxResources.get("top"),+null!=q?q.y:null);var H=K.input;A.appendChild(K);y.appendChild(A);A=document.createElement("div");A.className="geDialogInlineFields";A.style.marginTop="6px";K=m(mxResources.get("dx"),null!=q&&null!=q.offset?q.offset.x:null);var c=K.input;A.appendChild(K);K=m(mxResources.get("dy"),null!=q&&null!=q.offset?q.offset.y:null);var f=K.input;A.appendChild(K);y.appendChild(A);u.appendChild(y);y=document.createElement("div");y.className="geDialogSection";A=document.createElement("div");A.className="geDialogInlineFields";K=m(mxResources.get("width"),null!=q?q.width:null);var l=K.input;A.appendChild(K);q=m(mxResources.get("height"),null!=q?q.height:null);var n=q.input;A.appendChild(q);y.appendChild(A);u.appendChild(y);q=document.createElement("div");q.className="geDialogSection";y=document.createElement("div");y.className="geDialogFormRow";A=document.createElement("span");A.className="geDialogFormLabel";mxUtils.write(A,mxResources.get("rotation")+":");y.appendChild(A);var r=document.createElement("input");r.setAttribute("type",-"text");r.value=1==k.length?mxUtils.getValue(d.getCellStyle(k[0]),mxConstants.STYLE_ROTATION,0):"";y.appendChild(r);q.appendChild(y);u.appendChild(q);this.init=function(){H.focus();H.select()};var t=function(){d.getModel().beginUpdate();try{for(var x=0;x<k.length;x++){var B=d.getCellGeometry(k[x]);null!=B&&(B=B.clone(),d.isCellMovable(k[x])&&(B.relative=J.checked,0<mxUtils.trim(H.value).length&&(B.x=Number(H.value)),0<mxUtils.trim(G.value).length&&(B.y=Number(G.value)),0<mxUtils.trim(c.value).length&&+"text");r.value=1==k.length?mxUtils.getValue(d.getCellStyle(k[0]),mxConstants.STYLE_ROTATION,0):"";y.appendChild(r);q.appendChild(y);u.appendChild(q);this.init=function(){F.focus();F.select()};var t=function(){d.getModel().beginUpdate();try{for(var x=0;x<k.length;x++){var B=d.getCellGeometry(k[x]);null!=B&&(B=B.clone(),d.isCellMovable(k[x])&&(B.relative=J.checked,0<mxUtils.trim(F.value).length&&(B.x=Number(F.value)),0<mxUtils.trim(H.value).length&&(B.y=Number(H.value)),0<mxUtils.trim(c.value).length&&(null==B.offset&&(B.offset=new mxPoint),B.offset.x=Number(c.value)),0<mxUtils.trim(f.value).length&&(null==B.offset&&(B.offset=new mxPoint),B.offset.y=Number(f.value))),d.isCellResizable(k[x])&&(0<mxUtils.trim(l.value).length&&(B.width=Number(l.value)),0<mxUtils.trim(n.value).length&&(B.height=Number(n.value))),d.getModel().setGeometry(k[x],B));0<mxUtils.trim(r.value).length&&d.setCellRotation(k[x],Number(r.value))}}finally{d.getModel().endUpdate()}};this.container=(new CustomDialog(b,u,t,null,mxResources.get("apply"))).container;mxEvent.addListener(this.container,"keypress",function(x){13==x.keyCode&&(t(),b.hideDialog())})},LibraryDialog=function(b,k,m,d,q,u,y){function A(U){for(U=document.elementFromPoint(U.clientX,U.clientY);null!=U&&U.parentNode!=t;)U=U.parentNode;var S=null;if(null!=U){var z=t.firstChild;for(S=0;null!=z&&z!=U;)z=z.nextSibling,S++}return S}function J(U,S,z,g,p,v,C,E,I){try{if(b.spinner.stop(),null==S||"image/"==S.substring(0,6))if(null==U&&null!=C||null==B[U]){var O=function(){aa.innerText="";aa.style.cursor="pointer";aa.style.whiteSpace="nowrap";aa.style.textOverflow="ellipsis";mxUtils.write(aa,null!=da.title&&0<da.title.length?da.title:mxResources.get("untitled"));aa.style.color=null==da.title||0==da.title.length?"#d0d0d0":""};t.style.backgroundImage="";x.style.display="none";var Q=p,V=v;if(p>b.maxImageSize||v>b.maxImageSize){var W=Math.min(1,Math.min(b.maxImageSize/Math.max(1,p)),b.maxImageSize/Math.max(1,v));p*=W;v*=W}Q>V?(V=Math.round(100*V/Q),Q=100):(Q=Math.round(100*Q/V),V=100);var M=document.createElement("div");M.setAttribute("draggable","true");M.style.display="inline-block";M.style.position="relative";M.style.padding="0 12px";M.style.cursor="move";mxUtils.setPrefixedStyle(M.style,"transition","transform .1s ease-in-out");if(null!=U){var X=document.createElement("img");X.setAttribute("src",T.convert(U));X.style.width=Q+"px";X.style.height=V+"px";X.style.margin="10px";X.style.paddingBottom=Math.floor((100-V)/2)+"px";X.style.paddingLeft=Math.floor((100-Q)/2)+"px";M.appendChild(X)}else if(null!=C){var Z=b.stringToCells("<"==C.xml.charAt(0)?C.xml:Graph.decompress(C.xml));0<Z.length&&(b.sidebar.createThumb(Z,100,100,M,null,!0,!1,null,null,c.shapeBackgroundColor),M.firstChild.style.display="inline-block",M.firstChild.style.cursor="")}var Y=document.createElement("img");Y.setAttribute("src",Editor.closeBlackImage);Y.setAttribute("border","0");Y.setAttribute("title",mxResources.get("delete"));Y.setAttribute("align","top");Y.style.paddingTop="4px";Y.style.position="absolute";Y.style.marginLeft="-12px";Y.style.zIndex="1";Y.style.cursor=-"pointer";mxEvent.addListener(Y,"dragstart",function(sa){mxEvent.consume(sa)});(function(sa,va,wa){mxEvent.addListener(Y,"click",function(qa){B[va]=null;for(var Ba=0;Ba<G.length;Ba++)if(null!=G[Ba].data&&G[Ba].data==va||null!=G[Ba].xml&&null!=wa&&G[Ba].xml==wa.xml){G.splice(Ba,1);break}M.parentNode.removeChild(sa);0==G.length&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",x.style.display="");mxEvent.consume(qa)});mxEvent.addListener(Y,"dblclick",function(qa){mxEvent.consume(qa)})})(M,-U,C);M.appendChild(Y);M.style.marginBottom="30px";var aa=document.createElement("div");aa.style.position="absolute";aa.style.boxSizing="border-box";aa.style.bottom="-18px";aa.style.left="10px";aa.style.right="10px";aa.style.backgroundColor="light-dark(#ffffff, transparent)";aa.style.overflow="hidden";aa.style.textAlign="center";aa.setAttribute("title",mxResources.get("rename"));var da=null;null!=U?(da={data:U,w:p,h:v,title:I},null!=E&&(da.aspect=E),B[U]=X,G.push(da)):null!=C&&(C.aspect="fixed",G.push(C),+"pointer";mxEvent.addListener(Y,"dragstart",function(sa){mxEvent.consume(sa)});(function(sa,va,wa){mxEvent.addListener(Y,"click",function(qa){B[va]=null;for(var Ba=0;Ba<H.length;Ba++)if(null!=H[Ba].data&&H[Ba].data==va||null!=H[Ba].xml&&null!=wa&&H[Ba].xml==wa.xml){H.splice(Ba,1);break}M.parentNode.removeChild(sa);0==H.length&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",x.style.display="");mxEvent.consume(qa)});mxEvent.addListener(Y,"dblclick",function(qa){mxEvent.consume(qa)})})(M,+U,C);M.appendChild(Y);M.style.marginBottom="30px";var aa=document.createElement("div");aa.style.position="absolute";aa.style.boxSizing="border-box";aa.style.bottom="-18px";aa.style.left="10px";aa.style.right="10px";aa.style.backgroundColor="light-dark(#ffffff, transparent)";aa.style.overflow="hidden";aa.style.textAlign="center";aa.setAttribute("title",mxResources.get("rename"));var da=null;null!=U?(da={data:U,w:p,h:v,title:I},null!=E&&(da.aspect=E),B[U]=X,H.push(da)):null!=C&&(C.aspect="fixed",H.push(C),da=C);mxEvent.addListener(aa,"keydown",function(sa){13==sa.keyCode&&null!=D&&(D(),D=null,mxEvent.consume(sa))});O();M.appendChild(aa);mxEvent.addListener(aa,"mousedown",function(sa){"true"!=aa.getAttribute("contentEditable")&&mxEvent.consume(sa)});Z=function(sa){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var va=new FilenameDialog(b,da.title||"",mxResources.get("ok"),function(wa){null!=wa&&(da.title=wa,O())},mxResources.get("enterValue"));b.showDialog(va.container,300,80,!0,!0);va.init();mxEvent.consume(sa)}else if("true"!=aa.getAttribute("contentEditable")){null!=D&&(D(),D=null);if(null==da.title||0==da.title.length)aa.innerText="";aa.style.textOverflow="";aa.style.whiteSpace="";aa.style.cursor="text";aa.style.color="";aa.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(aa.style,"user-select","text");aa.focus();document.execCommand("selectAll",!1,null);D=function(){aa.removeAttribute("contentEditable");aa.style.cursor="pointer";da.title=mxUtils.getTextContent(aa);-O()};mxEvent.consume(sa)}};mxEvent.addListener(aa,"click",Z);mxEvent.addListener(M,"dblclick",Z);t.appendChild(M);mxEvent.addListener(M,"dragstart",function(sa){null==D&&(null==U&&null!=C&&(Y.style.visibility="hidden",aa.style.visibility="hidden"),mxClient.IS_FF&&null!=C.xml&&sa.dataTransfer.setData("Text",C.xml),F=A(sa),mxClient.IS_GC&&(M.style.opacity="0.9"),window.setTimeout(function(){mxUtils.setPrefixedStyle(M.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(M,30);Y.style.visibility="";-aa.style.visibility=""},0))});mxEvent.addListener(M,"dragend",function(sa){"hidden"==Y.style.visibility&&(Y.style.visibility="",aa.style.visibility="");F=null;mxUtils.setOpacity(M,100);mxUtils.setPrefixedStyle(M.style,"transform",null)})}else N||(N=!0,b.handleError({message:mxResources.get("fileExists")}));else{p=!1;try{if(Q=mxUtils.parseXml(U),"mxlibrary"==Q.documentElement.nodeName){V=JSON.parse(mxUtils.getTextContent(Q.documentElement));if(null!=V&&0<V.length)for(var ba=0;ba<V.length;ba++)null!=+O()};mxEvent.consume(sa)}};mxEvent.addListener(aa,"click",Z);mxEvent.addListener(M,"dblclick",Z);t.appendChild(M);mxEvent.addListener(M,"dragstart",function(sa){null==D&&(null==U&&null!=C&&(Y.style.visibility="hidden",aa.style.visibility="hidden"),mxClient.IS_FF&&null!=C.xml&&sa.dataTransfer.setData("Text",C.xml),G=A(sa),mxClient.IS_GC&&(M.style.opacity="0.9"),window.setTimeout(function(){mxUtils.setPrefixedStyle(M.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(M,30);Y.style.visibility="";+aa.style.visibility=""},0))});mxEvent.addListener(M,"dragend",function(sa){"hidden"==Y.style.visibility&&(Y.style.visibility="",aa.style.visibility="");G=null;mxUtils.setOpacity(M,100);mxUtils.setPrefixedStyle(M.style,"transform",null)})}else N||(N=!0,b.handleError({message:mxResources.get("fileExists")}));else{p=!1;try{if(Q=mxUtils.parseXml(U),"mxlibrary"==Q.documentElement.nodeName){V=JSON.parse(mxUtils.getTextContent(Q.documentElement));if(null!=V&&0<V.length)for(var ba=0;ba<V.length;ba++)null!=V[ba].xml?J(null,null,0,0,0,0,V[ba]):J(V[ba].data,null,0,0,V[ba].w,V[ba].h,null,"fixed",V[ba].title);p=!0}else if("mxfile"==Q.documentElement.nodeName){var ha=Q.documentElement.getElementsByTagName("diagram");for(ba=0;ba<ha.length;ba++){var la=Editor.getDiagramNodeXml(ha[ba]);Z=b.stringToCells(la);if(0<Z.length){var ra=b.editor.graph.getBoundingBoxFromGeometry(Z);null!=ra&&J(null,null,0,0,0,0,{xml:la,w:ra.width,h:ra.height})}}p=!0}}catch(sa){null!=window.console&&console.error("Error in library dialog: "+-sa)}p||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(sa){null!=window.console&&console.log("Error in library dialog: "+sa)}return null}function K(U){U.dataTransfer.dropEffect=null!=F?"move":"copy";U.stopPropagation();U.preventDefault()}function H(U){U.stopPropagation();U.preventDefault();N=!1;L=A(U);if(null!=F)null!=L&&L<t.children.length?(G.splice(L>F?L-1:L,0,G.splice(F,1)[0]),t.insertBefore(t.children[F],t.children[L])):(G.push(G.splice(F,1)[0]),t.appendChild(t.children[F]));-else if(0<U.dataTransfer.files.length)b.importFiles(U.dataTransfer.files,0,0,b.maxImageSize,R(U));else if(0<=mxUtils.indexOf(U.dataTransfer.types,"text/uri-list")){var S=decodeURIComponent(U.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(S)||/(\.png)($|\?)/i.test(S)||/(\.gif)($|\?)/i.test(S)||/(\.svg)($|\?)/i.test(S))&&b.loadImage(S,function(z){J(S,null,0,0,z.width,z.height);t.scrollTop=t.scrollHeight})}U.stopPropagation();U.preventDefault()}var G=[],c=b.editor.graph;m=document.createElement("div");+sa)}p||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(sa){null!=window.console&&console.log("Error in library dialog: "+sa)}return null}function K(U){U.dataTransfer.dropEffect=null!=G?"move":"copy";U.stopPropagation();U.preventDefault()}function F(U){U.stopPropagation();U.preventDefault();N=!1;L=A(U);if(null!=G)null!=L&&L<t.children.length?(H.splice(L>G?L-1:L,0,H.splice(G,1)[0]),t.insertBefore(t.children[G],t.children[L])):(H.push(H.splice(G,1)[0]),t.appendChild(t.children[G]));+else if(0<U.dataTransfer.files.length)b.importFiles(U.dataTransfer.files,0,0,b.maxImageSize,R(U));else if(0<=mxUtils.indexOf(U.dataTransfer.types,"text/uri-list")){var S=decodeURIComponent(U.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(S)||/(\.png)($|\?)/i.test(S)||/(\.gif)($|\?)/i.test(S)||/(\.svg)($|\?)/i.test(S))&&b.loadImage(S,function(z){J(S,null,0,0,z.width,z.height);t.scrollTop=t.scrollHeight})}U.stopPropagation();U.preventDefault()}var H=[],c=b.editor.graph;m=document.createElement("div");m.style.height="100%";m.style.display="flex";m.style.flexDirection="column";var f=document.createElement("div");f.className="geDialogSection";f.style.flexShrink="0";var l=document.createElement("div");l.className="geDialogFormRow";var n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("filename")+":");l.appendChild(n);null==k&&(k=b.defaultLibraryName+".xml");var r=document.createElement("input");r.setAttribute("type","text");r.setAttribute("value",k);null==q||q.isRenamable()||r.setAttribute("disabled","true");l.appendChild(r);f.appendChild(l);Editor.enableUncompressedLibraries&&(k=document.createElement("div"),k.className="geDialogCheckRow",l=document.createElement("input"),l.setAttribute("type","checkbox"),l.setAttribute("id","geLibCompressed"),k.appendChild(l),l=document.createElement("label"),l.setAttribute("for","geLibCompressed"),mxUtils.write(l,mxResources.get("compressed")),k.appendChild(l),f.appendChild(k));m.appendChild(f);this.init=-function(){if(null==q||q.isRenamable())r.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?r.select():document.execCommand("selectAll",!1,null)};var t=document.createElement("div");t.style.border="light-dark(1px solid rgba(0, 0, 0, 0.15), 1px solid rgba(255, 255, 255, 0.15))";t.style.borderRadius="8px";t.style.marginTop="10px";t.style.overflow="auto";t.style.flex="1";t.style.minHeight="0";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";0==G.length&&Graph.fileSupport&&-(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var x=document.createElement("div");x.style.position="absolute";x.style.left="0";x.style.right="0";x.style.top="260px";x.style.textAlign="center";x.style.fontSize="22px";x.style.color="#a0c3ff";mxUtils.write(x,mxResources.get("dragImagesHere"));m.appendChild(x);var B={},F=null,L=null,D=null;f=function(U){"true"!=mxEvent.getSource(U).getAttribute("contentEditable")&&null!=D&&(D(),D=null,mxEvent.consume(U))};mxEvent.addListener(t,"mousedown",+function(){if(null==q||q.isRenamable())r.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?r.select():document.execCommand("selectAll",!1,null)};var t=document.createElement("div");t.style.border="light-dark(1px solid rgba(0, 0, 0, 0.15), 1px solid rgba(255, 255, 255, 0.15))";t.style.borderRadius="8px";t.style.marginTop="10px";t.style.overflow="auto";t.style.flex="1";t.style.minHeight="0";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";0==H.length&&Graph.fileSupport&&+(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var x=document.createElement("div");x.style.position="absolute";x.style.left="0";x.style.right="0";x.style.top="260px";x.style.textAlign="center";x.style.fontSize="22px";x.style.color="#a0c3ff";mxUtils.write(x,mxResources.get("dragImagesHere"));m.appendChild(x);var B={},G=null,L=null,D=null;f=function(U){"true"!=mxEvent.getSource(U).getAttribute("contentEditable")&&null!=D&&(D(),D=null,mxEvent.consume(U))};mxEvent.addListener(t,"mousedown",f);mxEvent.addListener(t,"pointerdown",f);mxEvent.addListener(t,"touchstart",f);var T=new mxUrlConverter,N=!1;if(null!=d)for(f=0;f<d.length;f++)k=d[f],J(k.data,null,0,0,k.w,k.h,k,k.aspect,k.title);mxEvent.addListener(t,"dragleave",function(U){x.style.cursor="";for(var S=mxEvent.getSource(U);null!=S;){if(S==t||S==x){U.stopPropagation();U.preventDefault();break}S=S.parentNode}});var R=function(U){return function(S,z,g,p,v,C,E,I,O){null!=O&&EditorUi.isVisioFilename(O.name)?b.importVisio(O,mxUtils.bind(this,function(Q){J(Q,z,g,p,v,C,E,"fixed",mxEvent.isAltDown(U)?null:E.substring(0,E.lastIndexOf(".")).replace(/_/g," "))})):null!=O&&(new XMLHttpRequest).upload&&b.isRemoteFileFormat(S,O.name)?b.isExternalDataComms()?b.parseFile(O,mxUtils.bind(this,function(Q){4==Q.readyState&&(b.spinner.stop(),200<=Q.status&&299>=Q.status&&(J(Q.responseText,z,g,p,v,C,E,"fixed",mxEvent.isAltDown(U)?null:E.substring(0,E.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),-mxResources.get("notInOffline"))):(J(S,z,g,p,v,C,E,"fixed",mxEvent.isAltDown(U)?null:E.substring(0,E.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",K);mxEvent.addListener(t,"drop",H);mxEvent.addListener(x,"dragover",K);mxEvent.addListener(x,"drop",H);m.appendChild(t);d=document.createElement("div");d.style.textAlign="right";d.style.marginTop="14px";d.style.flexShrink="0";f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});f.setAttribute("id",+mxResources.get("notInOffline"))):(J(S,z,g,p,v,C,E,"fixed",mxEvent.isAltDown(U)?null:E.substring(0,E.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",K);mxEvent.addListener(t,"drop",F);mxEvent.addListener(x,"dragover",K);mxEvent.addListener(x,"drop",F);m.appendChild(t);d=document.createElement("div");d.style.textAlign="right";d.style.marginTop="14px";d.style.flexShrink="0";f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});f.setAttribute("id","btnCancel");f.className="geBtn";b.editor.cancelFirst&&d.appendChild(f);"draw.io"!=b.getServiceName()||null==q||q.constructor!=DriveLibrary&&q.constructor!=GitHubLibrary||(k=mxUtils.button(mxResources.get("link"),function(){b.getPublicUrl(q,function(U){if(null!=U){var S=b.getSearch("create title mode url drive splash state clibs ui".split(" "));S+=(0==S.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(U);U=new EmbedDialog(b,window.location.protocol+"//"+window.location.host+"/"+S,null,null,null,null,"Check out the library I made using @drawio");b.showDialog(U.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));U.init()}else q.constructor==DriveLibrary?b.showError(mxResources.get("error"),mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){b.drive.showPermissions(q.getId(),q)}),null,mxResources.get("ok"),mxUtils.bind(this,function(){})):b.handleError({message:mxResources.get("diagramIsNotPublic")})})}),k.className="geBtn",d.appendChild(k));-k=mxUtils.button(mxResources.get("export"),function(){var U=b.createLibraryDataFromImages(G),S=r.value;/(\.xml)$/i.test(S)||(S+=".xml");b.isLocalFileSave()?b.saveLocalFile(U,S,"text/xml",null,null,null!=y?y:!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(S)+"&format=xml&xml="+encodeURIComponent(U))).simulate(document,"_blank")});k.setAttribute("id","btnDownload");k.className="geBtn";d.appendChild(k);if(Graph.fileSupport){if(null==b.libDlgFileInputElt){var P=document.createElement("input");+k=mxUtils.button(mxResources.get("export"),function(){var U=b.createLibraryDataFromImages(H),S=r.value;/(\.xml)$/i.test(S)||(S+=".xml");b.isLocalFileSave()?b.saveLocalFile(U,S,"text/xml",null,null,null!=y?y:!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(S)+"&format=xml&xml="+encodeURIComponent(U))).simulate(document,"_blank")});k.setAttribute("id","btnDownload");k.className="geBtn";d.appendChild(k);if(Graph.fileSupport){if(null==b.libDlgFileInputElt){var P=document.createElement("input");P.setAttribute("multiple","multiple");P.setAttribute("type","file");mxEvent.addListener(P,"change",function(U){N=!1;b.importFiles(P.files,0,0,b.maxImageSize,function(S,z,g,p,v,C,E,I,O){null!=P.files&&(R(U)(S,z,g,p,v,C,E,I,O),P.type="",P.type="file",P.value="")});t.scrollTop=t.scrollHeight});P.style.display="none";document.body.appendChild(P);b.libDlgFileInputElt=P}k=mxUtils.button(mxResources.get("import"),function(){null!=D&&(D(),D=null);b.libDlgFileInputElt.click()});k.setAttribute("id","btnAddImage");k.className="geBtn";d.appendChild(k)}k=mxUtils.button(mxResources.get("addImages"),function(){null!=D&&(D(),D=null);b.showImageDialog(mxResources.get("addImageUrl"),"",function(U,S,z){N=!1;if(null!=U){if("data:image/"==U.substring(0,11)){var g=U.indexOf(",");0<g&&(U=U.substring(0,g)+";base64,"+U.substring(g+1))}J(U,null,0,0,S,z);t.scrollTop=t.scrollHeight}})});k.setAttribute("id","btnAddImageUrl");k.className="geBtn";d.appendChild(k);this.saveBtnClickHandler=function(U,S,z,g){b.saveLibrary(U,S,z,-g)};k=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=D&&(D(),D=null);this.saveBtnClickHandler(r.value,G,q,u)}));k.setAttribute("id","btnSave");k.className="geBtn gePrimaryBtn";d.appendChild(k);b.editor.cancelFirst||d.appendChild(f);m.appendChild(d);this.container=m},EditShapeDialog=function(b,k,m){var d=document.createElement("div");d.style.position="absolute";d.style.left="30px";d.style.right="30px";d.style.top="30px";d.style.bottom="30px";var q=document.createElement("div");+g)};k=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=D&&(D(),D=null);this.saveBtnClickHandler(r.value,H,q,u)}));k.setAttribute("id","btnSave");k.className="geBtn gePrimaryBtn";d.appendChild(k);b.editor.cancelFirst||d.appendChild(f);m.appendChild(d);this.container=m},EditShapeDialog=function(b,k,m){var d=document.createElement("div");d.style.position="absolute";d.style.left="30px";d.style.right="30px";d.style.top="30px";d.style.bottom="30px";var q=document.createElement("div");q.style.position="absolute";q.style.top="0px";mxUtils.write(q,m);d.appendChild(q);m=document.createElement("div");m.style.position="absolute";m.style.width="100%";m.style.display="flex";m.style.alignItems="stretch";m.style.top="24px";m.style.bottom="50px";var u=document.createElement("textarea");u.style.outline="none";u.style.resize="horizontal";u.style.width="430px";u.style.maxWidth="calc(100% - 100px)";u.style.flexShrink="0";u.style.borderRadius="4px";u.style.marginRight="4px";m.appendChild(u);var y=document.createElement("div");y.style.borderWidth="1px";y.style.borderStyle="solid";y.style.padding="20px";y.style.flexGrow="1";y.style.borderRadius="4px";mxEvent.disableContextMenu(y);m.appendChild(y);var A=new Graph(y);A.setEnabled(!1);var J=b.editor.graph.cloneCell(k);A.addCells([J]);q=A.view.getState(J);var K="";null!=q.shape&&null!=q.shape.stencil&&(K=mxUtils.getPrettyXml(q.shape.stencil.desc));mxUtils.write(u,K||"");d.appendChild(m);m=document.createElement("div");m.style.position="absolute";-m.style.display="flex";m.style.alignItems="center";m.style.justifyContent="end";m.style.bottom="6px";m.style.height="30px";m.style.width="100%";b.isOffline()||m.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-complex-create-edit"));q=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});q.className="geBtn";b.editor.cancelFirst&&m.appendChild(q);var H=function(c,f,l){var n=u.value,r=mxUtils.parseXml(n);n=mxUtils.getPrettyXml(r.documentElement);r=r.documentElement.getElementsByTagName("parsererror");+m.style.display="flex";m.style.alignItems="center";m.style.justifyContent="end";m.style.bottom="6px";m.style.height="30px";m.style.width="100%";b.isOffline()||m.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-complex-create-edit"));q=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});q.className="geBtn";b.editor.cancelFirst&&m.appendChild(q);var F=function(c,f,l){var n=u.value,r=mxUtils.parseXml(n);n=mxUtils.getPrettyXml(r.documentElement);r=r.documentElement.getElementsByTagName("parsererror");if(null!=r&&0<r.length)b.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(l&&b.hideDialog(),r=!c.model.contains(f),!l||r||n!=K){n=Graph.compress(n);c.getModel().beginUpdate();try{if(r){var t=b.editor.graph.getFreeInsertPoint();f.geometry.x=t.x;f.geometry.y=t.y;c.addCell(f)}c.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+n+")",[f])}catch(x){throw x;}finally{c.getModel().endUpdate()}r&&(c.setSelectionCell(f),c.scrollCellToVisible(f))}},-G=mxUtils.button(mxResources.get("preview"),function(){H(A,J,!1);A.fit()});G.className="geBtn";m.appendChild(G);G=mxUtils.button(mxResources.get("apply"),function(){H(b.editor.graph,k,!0)});G.className="geBtn gePrimaryBtn";m.appendChild(G);b.editor.cancelFirst||m.appendChild(q);d.appendChild(m);this.init=function(){u.focus();u.scrollTop=0;A.fit();y.style.overflow="auto";A.fit()};this.container=d},CustomDialog=function(b,k,m,d,q,u,y,A,J,K,H,G){var c=document.createElement("div");c.style.display="flex";-c.style.flexDirection="column";c.style.minHeight="0";c.style.paddingBottom="10px";var f=document.createElement("div");f.style.flex="1 1 auto";f.style.minHeight="0";f.style.overflowY="auto";f.appendChild(k);c.appendChild(f);var l=document.createElement("div");l.style.flex="0 0 auto";l.style.marginTop=null!=G?G:"34px";l.style.textAlign="right";b.isOffline()||null==u||l.appendChild(b.createHelpIcon(u));null!=y&&l.appendChild(y);k=mxUtils.button(J||mxResources.get("cancel"),function(){b.hideDialog();-null!=d&&d()});k.className="geBtn";A&&(k.style.display="none");b.editor.cancelFirst&&l.appendChild(k);q=mxUtils.button(q||mxResources.get("ok"),mxUtils.bind(this,function(){K||b.hideDialog(null,null,this.container);if(null!=m){var n=m();if("string"===typeof n){b.showError(mxResources.get("error"),n);return}}K&&b.hideDialog(null,null,this.container)}));l.appendChild(q);q.className="geBtn gePrimaryBtn";b.editor.cancelFirst||l.appendChild(k);if(null!=H)for(A=0;A<H.length;A++)(function(n,r,t){n=mxUtils.button(n,-function(x){r(x)});null!=t&&n.setAttribute("title",t);n.className="geBtn";l.appendChild(n)})(H[A][0],H[A][1],H[A][2]);c.appendChild(l);this.cancelBtn=k;this.okButton=q;this.container=c},BtnDialog=function(b,k,m,d){var q=document.createElement("div");q.style.textAlign="center";var u=document.createElement("p");u.style.fontSize="16pt";u.style.padding="0px";u.style.margin="0px";u.style.color="gray";mxUtils.write(u,mxResources.get("done"));var y="Unknown",A=document.createElement("img");A.setAttribute("border",+H=mxUtils.button(mxResources.get("preview"),function(){F(A,J,!1);A.fit()});H.className="geBtn";m.appendChild(H);H=mxUtils.button(mxResources.get("apply"),function(){F(b.editor.graph,k,!0)});H.className="geBtn gePrimaryBtn";m.appendChild(H);b.editor.cancelFirst||m.appendChild(q);d.appendChild(m);this.init=function(){u.focus();u.scrollTop=0;A.fit();y.style.overflow="auto";A.fit()};this.container=d},CustomDialog=function(b,k,m,d,q,u,y,A,J,K,F,H){var c=document.createElement("div");c.style.display="flex";+c.style.flexDirection="column";c.style.minHeight="0";c.style.paddingBottom="10px";var f=document.createElement("div");f.style.flex="1 1 auto";f.style.minHeight="0";f.style.overflowY="auto";f.appendChild(k);c.appendChild(f);var l=document.createElement("div");l.style.flex="0 0 auto";l.style.marginTop=null!=H?H:"34px";l.style.textAlign="right";b.isOffline()||null==u||l.appendChild(b.createHelpIcon(u));null!=y&&l.appendChild(y);k=mxUtils.button(J||mxResources.get("cancel"),function(){b.hideDialog();+null!=d&&d()});k.className="geBtn";A&&(k.style.display="none");b.editor.cancelFirst&&l.appendChild(k);q=mxUtils.button(q||mxResources.get("ok"),mxUtils.bind(this,function(){K||b.hideDialog(null,null,this.container);if(null!=m){var n=m();if("string"===typeof n){b.showError(mxResources.get("error"),n);return}}K&&b.hideDialog(null,null,this.container)}));l.appendChild(q);q.className="geBtn gePrimaryBtn";b.editor.cancelFirst||l.appendChild(k);if(null!=F)for(A=0;A<F.length;A++)(function(n,r,t){n=mxUtils.button(n,+function(x){r(x)});null!=t&&n.setAttribute("title",t);n.className="geBtn";l.appendChild(n)})(F[A][0],F[A][1],F[A][2]);c.appendChild(l);this.cancelBtn=k;this.okButton=q;this.container=c},BtnDialog=function(b,k,m,d){var q=document.createElement("div");q.style.textAlign="center";var u=document.createElement("p");u.style.fontSize="16pt";u.style.padding="0px";u.style.margin="0px";u.style.color="gray";mxUtils.write(u,mxResources.get("done"));var y="Unknown",A=document.createElement("img");A.setAttribute("border","0");A.setAttribute("align","absmiddle");A.style.marginRight="10px";k==b.drive?(y=mxResources.get("googleDrive"),A.src=IMAGE_PATH+"/google-drive-logo-white.svg"):k==b.dropbox?(y=mxResources.get("dropbox"),A.src=IMAGE_PATH+"/dropbox-logo-white.svg"):k==b.oneDrive?(y=mxResources.get("oneDrive"),A.src=IMAGE_PATH+"/onedrive-logo-white.svg"):k==b.gitHub?(y=mxResources.get("github"),A.src=IMAGE_PATH+"/github-logo-white.svg"):k==b.gitLab?(y=mxResources.get("gitlab"),A.src=IMAGE_PATH+"/gitlab-logo.svg"):-k==b.trello&&(y=mxResources.get("trello"),A.src=IMAGE_PATH+"/trello-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizedIn",[y],"You are now authorized in {1}"));m=mxUtils.button(m,d);m.insertBefore(A,m.firstChild);m.style.marginTop="6px";m.className="geBigButton";m.style.fontSize="18px";m.style.padding="14px";q.appendChild(u);q.appendChild(b);q.appendChild(m);this.container=q},FontDialog=function(b,k,m,d,q){function u(F,L,D){var T=document.createElement("div");-T.className="geDialogFormRow";T.style.paddingLeft="24px";var N=document.createElement("span");N.className="geDialogFormLabel";mxUtils.write(N,L+":");T.appendChild(N);T.appendChild(D);F.appendChild(T);return T}function y(F){this.style.border="";13==F.keyCode&&B.click()}var A=document.createElement("div"),J=document.createElement("h3");mxUtils.write(J,mxResources.get("font"));A.appendChild(J);J=document.createElement("div");J.className="geDialogSection";var K=b.addCheckbox(J,mxResources.get("sysFonts",-null,"System Fonts"),!1,null,null,null,!0,"current-fontdialog",!0),H=document.createElement("input");H.setAttribute("type","text");"s"==d&&H.setAttribute("value",k);H.className="dlg_fontName_s";var G=null;if(null!=Editor.localFonts){G=document.createElement("datalist");G.id="fontdialog-localfonts";for(var c=0;c<Editor.localFonts.length;c++){var f=document.createElement("option");f.value=Editor.localFonts[c];G.appendChild(f)}H.setAttribute("list","fontdialog-localfonts")}c=u(J,mxResources.get("fontname",-null,"Font Name"),H);null!=G&&c.appendChild(G);A.appendChild(J);J=document.createElement("div");J.className="geDialogSection";var l=b.addCheckbox(J,mxResources.get("googleFonts",null,"Google Fonts"),!1,null,null,null,!0,"current-fontdialog",!0);b.isOffline()&&!EditorUi.isElectronApp||l.checkRow.appendChild(b.createHelpIcon("https://fonts.google.com/"));var n=document.createElement("input");n.setAttribute("type","text");"g"==d&&n.setAttribute("value",k);n.className="dlg_fontName_g";u(J,mxResources.get("fontname",-null,"Font Name"),n);"0"!=urlParams.isGoogleFontsEnabled&&A.appendChild(J);J=document.createElement("div");J.className="geDialogSection";var r=b.addCheckbox(J,mxResources.get("webfonts",null,"Web Fonts"),!1,null,null,null,!0,"current-fontdialog",!0),t=document.createElement("input");t.setAttribute("type","text");"w"==d&&(Editor.enableWebFonts?t.setAttribute("value",k):H.setAttribute("value",k));t.className="dlg_fontName_w";u(J,mxResources.get("fontname",null,"Font Name"),t);var x=document.createElement("input");-x.setAttribute("type","text");x.setAttribute("value",m||"");x.className="dlg_fontUrl";u(J,mxResources.get("fontUrl",null,"Font URL"),x);Editor.enableWebFonts&&A.appendChild(J);this.init=function(){var F=H;"g"==d?F=n:"w"==d&&Editor.enableWebFonts&&(F=t);F.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?F.select():document.execCommand("selectAll",!1,null)};A.style.paddingBottom="10px";k=document.createElement("div");k.style.marginTop="34px";k.style.textAlign="right";k.style.whiteSpace=-"nowrap";b.isOffline()||k.appendChild(b.createHelpIcon("https://www.drawio.com/blog/external-fonts"));m=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();q()});m.className="geBtn";var B=mxUtils.button(mxResources.get("apply"),function(){if(K.checked){var F=H.value;var L="s"}else if(l.checked){F=n.value;var D=Editor.GOOGLE_FONTS+encodeURIComponent(F).replace(/%20/g,"+");L="g"}else r.checked&&(F=t.value,D=x.value,L="w");var T=F;var N=D,R=L,P=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,-U=A.querySelector(".dlg_fontName_"+R);null==U||null!=T&&0!=T.length?(U=A.querySelector(".dlg_fontUrl"),null==U||"w"!=R||P.test(N)?T=!0:(U.style.border="1px solid red",T=!1)):(U.style.border="1px solid red",T=!1);T&&(q(F,D,L),b.hideDialog())});B.className="geBtn gePrimaryBtn";mxEvent.addListener(H,"keypress",y);mxEvent.addListener(n,"keypress",y);mxEvent.addListener(t,"keypress",y);mxEvent.addListener(x,"keypress",y);mxEvent.addListener(H,"focus",function(){K.setAttribute("checked","checked");K.checked=+k==b.trello&&(y=mxResources.get("trello"),A.src=IMAGE_PATH+"/trello-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizedIn",[y],"You are now authorized in {1}"));m=mxUtils.button(m,d);m.insertBefore(A,m.firstChild);m.style.marginTop="6px";m.className="geBigButton";m.style.fontSize="18px";m.style.padding="14px";q.appendChild(u);q.appendChild(b);q.appendChild(m);this.container=q},FontDialog=function(b,k,m,d,q){function u(G,L,D){var T=document.createElement("div");+T.className="geDialogFormRow";T.style.paddingLeft="24px";var N=document.createElement("span");N.className="geDialogFormLabel";mxUtils.write(N,L+":");T.appendChild(N);T.appendChild(D);G.appendChild(T);return T}function y(G){this.style.border="";13==G.keyCode&&B.click()}var A=document.createElement("div"),J=document.createElement("h3");mxUtils.write(J,mxResources.get("font"));A.appendChild(J);J=document.createElement("div");J.className="geDialogSection";var K=b.addCheckbox(J,mxResources.get("sysFonts",+null,"System Fonts"),!1,null,null,null,!0,"current-fontdialog",!0),F=document.createElement("input");F.setAttribute("type","text");"s"==d&&F.setAttribute("value",k);F.className="dlg_fontName_s";var H=null;if(null!=Editor.localFonts){H=document.createElement("datalist");H.id="fontdialog-localfonts";for(var c=0;c<Editor.localFonts.length;c++){var f=document.createElement("option");f.value=Editor.localFonts[c];H.appendChild(f)}F.setAttribute("list","fontdialog-localfonts")}c=u(J,mxResources.get("fontname",+null,"Font Name"),F);null!=H&&c.appendChild(H);A.appendChild(J);J=document.createElement("div");J.className="geDialogSection";var l=b.addCheckbox(J,mxResources.get("googleFonts",null,"Google Fonts"),!1,null,null,null,!0,"current-fontdialog",!0);b.isOffline()&&!EditorUi.isElectronApp||l.checkRow.appendChild(b.createHelpIcon("https://fonts.google.com/"));var n=document.createElement("input");n.setAttribute("type","text");"g"==d&&n.setAttribute("value",k);n.className="dlg_fontName_g";u(J,mxResources.get("fontname",+null,"Font Name"),n);"0"!=urlParams.isGoogleFontsEnabled&&A.appendChild(J);J=document.createElement("div");J.className="geDialogSection";var r=b.addCheckbox(J,mxResources.get("webfonts",null,"Web Fonts"),!1,null,null,null,!0,"current-fontdialog",!0),t=document.createElement("input");t.setAttribute("type","text");"w"==d&&(Editor.enableWebFonts?t.setAttribute("value",k):F.setAttribute("value",k));t.className="dlg_fontName_w";u(J,mxResources.get("fontname",null,"Font Name"),t);var x=document.createElement("input");+x.setAttribute("type","text");x.setAttribute("value",m||"");x.className="dlg_fontUrl";u(J,mxResources.get("fontUrl",null,"Font URL"),x);Editor.enableWebFonts&&A.appendChild(J);this.init=function(){var G=F;"g"==d?G=n:"w"==d&&Editor.enableWebFonts&&(G=t);G.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?G.select():document.execCommand("selectAll",!1,null)};A.style.paddingBottom="10px";k=document.createElement("div");k.style.marginTop="34px";k.style.textAlign="right";k.style.whiteSpace=+"nowrap";b.isOffline()||k.appendChild(b.createHelpIcon("https://www.drawio.com/blog/external-fonts"));m=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();q()});m.className="geBtn";var B=mxUtils.button(mxResources.get("apply"),function(){if(K.checked){var G=F.value;var L="s"}else if(l.checked){G=n.value;var D=Editor.GOOGLE_FONTS+encodeURIComponent(G).replace(/%20/g,"+");L="g"}else r.checked&&(G=t.value,D=x.value,L="w");var T=G;var N=D,R=L,P=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,+U=A.querySelector(".dlg_fontName_"+R);null==U||null!=T&&0!=T.length?(U=A.querySelector(".dlg_fontUrl"),null==U||"w"!=R||P.test(N)?T=!0:(U.style.border="1px solid red",T=!1)):(U.style.border="1px solid red",T=!1);T&&(q(G,D,L),b.hideDialog())});B.className="geBtn gePrimaryBtn";mxEvent.addListener(F,"keypress",y);mxEvent.addListener(n,"keypress",y);mxEvent.addListener(t,"keypress",y);mxEvent.addListener(x,"keypress",y);mxEvent.addListener(F,"focus",function(){K.setAttribute("checked","checked");K.checked=!0});mxEvent.addListener(n,"focus",function(){l.setAttribute("checked","checked");l.checked=!0});mxEvent.addListener(t,"focus",function(){r.setAttribute("checked","checked");r.checked=!0});mxEvent.addListener(x,"focus",function(){r.setAttribute("checked","checked");r.checked=!0});b.editor.cancelFirst?(k.appendChild(m),k.appendChild(B)):(k.appendChild(B),k.appendChild(m));A.appendChild(k);this.container=A};function AspectDialog(b,k,m,d,q){this.aspect={pageId:k||(b.pages?b.pages[0].getId():null),layerIds:m||[]};k=document.createElement("div");var u=document.createElement("h5");u.style.margin="0 0 10px";mxUtils.write(u,mxResources.get("pages"));k.appendChild(u);m=document.createElement("div");m.className="geAspectDlgList";k.appendChild(m);u=document.createElement("h5");u.style.margin="0 0 10px";mxUtils.write(u,mxResources.get("layers"));k.appendChild(u);u=document.createElement("div");u.className="geAspectDlgList";k.appendChild(u);this.pagesContainer=m;this.layersContainer=u;this.ui=b;m=document.createElement("div");m.style.marginTop="16px";m.style.textAlign="center";u=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=q&&q()});u.className="geBtn";b.editor.cancelFirst&&m.appendChild(u);var y=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){b.hideDialog();d({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));m.appendChild(y);y.className="geBtn gePrimaryBtn";@@ -13245,73 +13248,73 @@ AspectDialog.prototype.createPageItem=function(b,k,m){var d=document.createElemethis.selectedPage=b;d.className+=" geAspectDlgListItemSelected";this.layersContainer.innerText="";this.selectedLayers={};this.okBtn.setAttribute("disabled","disabled");var u=q.model;u=u.getChildCells(u.getRoot());for(var y=0;y<u.length;y++)this.createLayerItem(u[y],b,q,m)});mxEvent.addListener(d,"click",k);this.aspect.pageId==b&&k()};AspectDialog.prototype.createLayerItem=function(b,k,m,d){k=m.convertValueToString(b)||mxResources.get("background")||"Background";var q=document.createElement("div");q.setAttribute("data-layer-id",b.id);q.className="geAspectDlgListItem";q.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+mxUtils.htmlEntities(k)+"</div>";this.layersContainer.appendChild(q);this.createViewer(q.childNodes[0],d,b.id);d=mxUtils.bind(this,function(){0<=q.className.indexOf("geAspectDlgListItemSelected")?(q.className="geAspectDlgListItem",delete this.selectedLayers[b.id],mxUtils.isEmptyObject(this.selectedLayers)&&this.okBtn.setAttribute("disabled","disabled")):(q.className+=" geAspectDlgListItemSelected",this.selectedLayers[b.id]=!0,this.okBtn.removeAttribute("disabled"))});mxEvent.addListener(q,"click",d);-1!=this.aspect.layerIds.indexOf(b.id)&&d()};-var FilePropertiesDialog=function(b,k){function m(B){var F=H;H=function(L,D){try{B(function(){F(L,D)},D)}catch(T){D(T)}}}function d(B,F,L){var D=document.createElement("div");D.className="geDialogFormRow";var T=document.createElement("span");T.className="geDialogFormLabel";mxUtils.write(T,F+":");D.appendChild(T);D.appendChild(L);B.appendChild(D);return D}var q=document.createElement("div"),u=document.createElement("h3");mxUtils.write(u,mxResources.get("properties"));q.appendChild(u);var y=b.getCurrentFile(),-A=null!=y&&null!=y.getTitle()?y.getTitle():b.defaultFilename,J=/(\.png)$/i.test(A),K=/(\.svg)$/i.test(A),H=function(B,F){B()},G=null!=y?y.isLocked():!1;u=document.createElement("div");u.className="geDialogSection";var c=b.addCheckbox(u,mxResources.get("locked"),G,null,null,null,null,null,!0);this.init=function(){c.focus()};m(function(B,F){null!=b.fileNode&&G!=c.checked?window.setTimeout(function(){null!=y&&y.setLocked(c.checked);B()},0):B()});if(J||K){A=1;J=0;K=b.fileNode;null!=K&&(K.hasAttribute("scale")&&-(A=parseFloat(K.getAttribute("scale"))),K.hasAttribute("border")&&(J=parseInt(K.getAttribute("border"))));var f=document.createElement("input");f.setAttribute("type","text");f.setAttribute("value",100*A+"%");d(u,mxResources.get("zoom"),f);var l=document.createElement("input");l.setAttribute("type","text");l.setAttribute("value",J);d(u,mxResources.get("borderWidth"),l);this.init=this.init||function(){f.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?f.select():document.execCommand("selectAll",-!1,null)};m(function(B,F){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(f.value)/100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(l.value))),null!=y&&y.fileChanged());B()})}else if(!/(\.html)$/i.test(A)&&!/(\.svg)$/i.test(A)){var n=null!=y?y.isCompressed():Editor.defaultCompressed,r=b.addCheckbox(u,mxResources.get("compressed"),n,null,null,null,null,null,!0);this.init=this.init||function(){r.focus()};m(function(B,F){null!=b.fileNode&&n!=r.checked?window.setTimeout(function(){b.fileNode.setAttribute("compressed",-r.checked?"true":"false");null!=y&&(y.compressionChanged(r.checked),y.fileChanged());B()},0):B()})}if(null!=y&&y.isRealtimeOptional()){var t="disabled"!=b.drive.getCustomProperty(y.desc,"collaboration"),x=b.addCheckbox(u,mxResources.get("realtimeCollaboration"),t,null,null,null,null,null,!0);x.checkRow.appendChild(b.menus.createHelpLink("https://www.drawio.com/docs/manual/collaboration/concurrent-editing/#disable-real-time-collaboration"));m(function(B,F){x.checked!=t?y.setRealtimeEnabled(x.checked,-B,F):B()});this.init=null!=this.init?this.init:function(){x.focus()}}q.appendChild(u);u=document.createElement("div");u.className="geDialogSection";A=!1;null!=y&&"draw.io"==b.getServiceName()&&0<y.getSize()&&"1"!=urlParams.embed&&(A=b.formatFileSize(y.getSize()),J=document.createElement("input"),J.setAttribute("type","text"),J.setAttribute("title",A),J.setAttribute("value",A),J.setAttribute("disabled","disabled"),d(u,mxResources.get("size"),J),A=!0);null!=y&&null!=y.fileObject&&null!=y.fileObject.path&&-(A=document.createElement("input"),A.setAttribute("type","text"),A.setAttribute("title",y.fileObject.path),A.setAttribute("value",y.fileObject.path),A.setAttribute("disabled","disabled"),d(u,mxResources.get("pathFilename"),A),A=!0);null!=k&&(A=document.createElement("a"),A.setAttribute("href",k),A.setAttribute("title",k),A.style.flex="1",A.style.minWidth="0",A.style.whiteSpace="nowrap",A.style.overflow="hidden",A.style.textOverflow="ellipsis",mxUtils.write(A,k),mxEvent.addListener(A,"click",function(B){b.openLink(k);-mxEvent.consume(B)}),d(u,mxResources.get("publicDiagramUrl"),A),A=!0);A&&q.appendChild(u);this.init=null!=this.init?this.init:function(){};q.style.paddingBottom="10px";u=document.createElement("div");u.style.marginTop="34px";u.style.textAlign="right";u.style.whiteSpace="nowrap";A=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});A.className="geBtn";J=mxUtils.button(mxResources.get("apply"),function(){b.spinner.spin(document.body,mxResources.get("updatingDocument"))&&H(function(){b.spinner.stop();-b.hideDialog()},function(B){b.spinner.stop();b.handleError(B,mxResources.get("error"))})});J.className="geBtn gePrimaryBtn";K=null;null!=b.fileNode&&(K=mxUtils.button(mxResources.get("editData")+"...",function(){b.hideDialog();var B={};try{var F=b.fileNode.getAttribute("vars");null!=F&&0<F.length&&(B=JSON.parse(F))}catch(T){}F=mxUtils.createXmlDocument().createElement("object");F.setAttribute("label","");for(var L in B)F.setAttribute(L,B[L]);B=b.createTemporaryGraph(b.editor.graph.getStylesheet());-var D=new mxCell(F);B.getModel().add(B.getDefaultParent(),D);B.getModel().addListener(mxEvent.CHANGE,function(T,N){T=N.getProperty("edit").changes;for(N=0;N<T.length;N++)if(T[N]instanceof mxValueChange&&T[N].cell===D){for(var R={},P=T[N].value.attributes,U=0;U<P.length;U++)"label"!=P[U].nodeName&&(R[P[U].nodeName]=P[U].nodeValue);R=JSON.stringify(R);"{}"==R?b.fileNode.removeAttribute("vars"):b.fileNode.setAttribute("vars",R);b.updateFileVars();b.editor.graph.refresh();R=b.getCurrentFile();null!=R&&-R.fileChanged()}});B=new EditDataDialog(b,D,B);b.showDialog(B.container,480,420,!0,!1,null,!1,null,new mxRectangle(0,0,440,220));B.init()}),K.className="geBtn");b.editor.cancelFirst?(u.appendChild(A),null!=K&&u.appendChild(K),u.appendChild(J)):(null!=K&&u.appendChild(K),u.appendChild(J),u.appendChild(A));q.appendChild(u);this.container=q},ConnectionPointsDialog=function(b,k){function m(){null!=q&&q.destroy()}var d=document.createElement("div");d.style.userSelect="none";d.style.display="flex";d.style.flexDirection=-"column";d.style.height="100%";var q=null;this.init=function(){function u(S,z,g){var p="shape=image;points=[];rotatable=0;resizable=0;connectable=0;editable=0;image="+b.convertDataUri(mxConstraintHandler.prototype.pointImage.src)+";";S=new mxCell("",new mxGeometry(S,z,6,6),p);S.vertex=!0;S.cp=!0;S.constObj=g;return G.addCell(S)}function y(S){S=G.getSelectionCells();G.deleteCells(S)}function A(){var S=parseFloat(N.value)||0;S=0>S?0:100<S?100:S;N.value=S;var z=parseFloat(P.value)||0;z=0>z?0:100<z?100:-z;P.value=z;var g=parseInt(R.value)||0,p=parseInt(U.value)||0;g=new mxConnectionConstraint(new mxPoint(parseFloat((S/100).toFixed(6)),parseFloat((z/100).toFixed(6))),!1,null,g,p);S=G.getConnectionPoint(l,g);z=G.getSelectionCell();if(null!=z){z.constObj=g;g=z.geometry.clone();p=G.view.scale;var v=G.view.translate;g.x=(S.x-3*p)/p-v.x;g.y=(S.y-3*p)/p-v.y;G.model.setGeometry(z,g)}}function J(S){if(S.constObj)return{x:S.constObj.point.x,y:S.constObj.point.y,dx:S.constObj.dx,dy:S.constObj.dy};var z=0,g=-0,p=c.geometry,v=parseFloat(((S.geometry.x+3-p.x)/p.width).toFixed(6));S=parseFloat(((S.geometry.y+3-p.y)/p.height).toFixed(6));0>v?(z=v*p.width,v=0):1<v&&(z=(v-1)*p.width,v=1);0>S?(g=S*p.height,S=0):1<S&&(g=(S-1)*p.height,S=1);return{x:v,y:S,dx:parseInt(z),dy:parseInt(g)}}function K(S){if(1==G.getSelectionCount()){var z=G.getSelectionCell();S&&(z.constObj=null);S=J(z);N.value=parseFloat((100*S.x).toFixed(4));P.value=parseFloat((100*S.y).toFixed(4));R.value=S.dx;U.value=S.dy;T.style.visibility=""}else T.style.visibility=-"hidden"}var H=document.createElement("div");H.style.flex="1";H.style.minHeight="0";H.style.overflow="hidden";H.style.borderStyle="solid";H.style.borderWidth="1px";H.style.boxSizing="border-box";mxEvent.disableContextMenu(H);d.appendChild(H);var G=new Graph(H);G.transparentBackground=!1;G.autoExtend=!1;G.autoScroll=!1;G.setGridEnabled(!1);G.setEnabled(!0);G.setPanning(!0);G.setConnectable(!1);G.setTooltips(!1);G.minFitScale=null;G.maxFitScale=null;G.centerZoom=!0;G.maxFitScale=2;H=k.geometry;var c=-new mxCell(k.value,new mxGeometry(0,0,H.width,H.height),k.style+";rotatable=0;resizable=0;connectable=0;editable=0;movable=0;opacity=50;");c.vertex=!0;G.addCell(c);G.dblClick=function(S,z){if(null!=z&&z!=c)G.setSelectionCell(z);else{z=mxUtils.convertPoint(G.container,mxEvent.getClientX(S),mxEvent.getClientY(S));mxEvent.consume(S);S=G.view.scale;var g=G.view.translate;G.setSelectionCell(u((z.x-3*S)/S-g.x,(z.y-3*S)/S-g.y))}};q=new mxKeyHandler(G);q.bindKey(46,y);q.bindKey(8,y);G.getRubberband().isForceRubberbandEvent=-function(S){return 0==S.evt.button&&(null==S.getCell()||S.getCell()==c)};G.panningHandler.isForcePanningEvent=function(S){return 2==S.evt.button};var f=G.isCellSelectable;G.isCellSelectable=function(S){return S==c?!1:f.apply(this,arguments)};G.getLinkForCell=function(){return null};var l=G.view.getState(c);H=G.getAllConnectionConstraints(l);for(var n=0;null!=H&&n<H.length;n++){var r=G.getConnectionPoint(l,H[n]);u(r.x-3,r.y-3,H[n])}n=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),-function(){G.zoomIn()});r=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){G.zoomOut()});var t=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==G.view.scale?(G.maxFitScale=8,G.fit(8)):G.zoomActual();G.center()}),x=function(){b.prompt(mxResources.get("gridSize"),G.gridSize,function(S){!isNaN(S)&&0<S&&(G.setGridSize(S),G.setGridEnabled(!0),G.refresh())})},B=b.createToolbarButton(Editor.thinGridImage,mxResources.get("grid"),function(S){mxEvent.isShiftDown(S)?-x():(G.setGridEnabled(!G.isGridEnabled()),G.refresh())});mxEvent.addListener(B,"dblclick",x);var F=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),y);mxUtils.setOpacity(F,10);H=document.createElement("div");H.style.display="flex";H.style.flexShrink="0";H.style.alignItems="center";H.style.paddingTop="6px";H.appendChild(n);H.appendChild(r);H.appendChild(t);H.appendChild(B);H.appendChild(F);d.appendChild(H);var L=document.createElement("input");L.setAttribute("type","number");L.setAttribute("min",-"1");L.setAttribute("value","1");L.style.width="45px";L.style.position="relative";L.style.margin="0 4px 0 4px";var D=document.createElement("select");D.style.position="relative";r=["left","right","top","bottom"];for(n=0;n<r.length;n++)t=r[n],B=document.createElement("option"),mxUtils.write(B,mxResources.get(t)),B.value=t,D.appendChild(B);n=mxUtils.button(mxResources.get("add"),function(){var S=parseInt(L.value);S=1>S?1:100<S?100:S;L.value=S;for(var z=D.value,g=c.geometry,p=[],v=0;v<S;v++){switch(z){case "left":var C=-g.x;var E=g.y+(v+1)*g.height/(S+1);break;case "right":C=g.x+g.width;E=g.y+(v+1)*g.height/(S+1);break;case "top":C=g.x+(v+1)*g.width/(S+1);E=g.y;break;case "bottom":C=g.x+(v+1)*g.width/(S+1),E=g.y+g.height}p.push(u(C-3,E-3))}G.setSelectionCells(p)});n.style.marginLeft="auto";H.appendChild(n);H.appendChild(L);H.appendChild(D);var T=document.createElement("div");T.style.flexShrink="0";T.style.margin="4px 0px 8px 0px";T.style.whiteSpace="nowrap";T.style.height="24px";H=document.createElement("span");-mxUtils.write(H,mxResources.get("dx"));T.appendChild(H);var N=document.createElement("input");N.setAttribute("type","number");N.setAttribute("min","0");N.setAttribute("max","100");N.setAttribute("step","any");N.style.width="45px";N.style.margin="0 4px 0 4px";T.appendChild(N);mxUtils.write(T,"%");var R=document.createElement("input");R.setAttribute("type","number");R.style.width="45px";R.style.margin="0 4px 0 4px";T.appendChild(R);mxUtils.write(T,"pt");H=document.createElement("span");mxUtils.write(H,-mxResources.get("dy"));H.style.marginLeft="12px";T.appendChild(H);var P=document.createElement("input");P.setAttribute("type","number");P.setAttribute("min","0");P.setAttribute("max","100");P.setAttribute("step","any");P.style.width="45px";P.style.margin="0 4px 0 4px";T.appendChild(P);mxUtils.write(T,"%");var U=document.createElement("input");U.setAttribute("type","number");U.style.width="45px";U.style.margin="0 4px 0 4px";T.appendChild(U);mxUtils.write(T,"pt");d.appendChild(T);K();G.getSelectionModel().addListener(mxEvent.CHANGE,-function(){0<G.getSelectionCount()?mxUtils.setOpacity(F,60):mxUtils.setOpacity(F,10);K()});G.addListener(mxEvent.CELLS_MOVED,K);mxEvent.addListener(N,"change",A);mxEvent.addListener(P,"change",A);mxEvent.addListener(R,"change",A);mxEvent.addListener(U,"change",A);H=mxUtils.button(mxResources.get("cancel"),function(){m();b.hideDialog()});H.className="geBtn";n=mxUtils.button(mxResources.get("apply"),function(){var S=G.model.cells,z=[],g=[],p;for(p in S){var v=S[p];v.cp&&g.push(J(v))}g.sort(function(C,-E){return C.x!=E.x?C.x-E.x:C.y!=E.y?C.y-E.y:C.dx!=E.dx?C.dx-E.dx:C.dy-E.dy});for(S=0;S<g.length;S++)0<S&&g[S].x==g[S-1].x&&g[S].y==g[S-1].y&&g[S].dx==g[S-1].dx&&g[S].dy==g[S-1].dy||z.push("["+g[S].x+","+g[S].y+",0,"+g[S].dx+","+g[S].dy+"]");b.editor.graph.setCellStyles("points","["+z.join(",")+"]",[k]);m();b.hideDialog()});n.className="geBtn gePrimaryBtn";r=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[k]);m();b.hideDialog()});r.className="geBtn";t=-document.createElement("div");t.style.flexShrink="0";t.style.marginTop="10px";t.style.textAlign="right";b.isOffline()||t.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-connection-points-customise"));b.editor.cancelFirst&&t.appendChild(H);t.appendChild(r);t.appendChild(n);b.editor.cancelFirst||t.appendChild(H);d.appendChild(t);G.fit(8);G.center()};this.destroy=m;this.container=d},PolygonDialog=function(b,k,m){function d(ia){var ka=Y.getBoundingClientRect();if(0<ka.width&&0<ka.height){var ea=-N+P/2,ja=R+U/2;S=Math.max(.05,Math.min(5,ia));P=ka.width*S;U=ka.height*S;N=ea-P/2;R=ja-U/2;q()}}function q(){Y.setAttribute("viewBox",N+" "+R+" "+P+" "+U);var ia=Z.getBoundingClientRect();if(!(0>=ia.width||0>=ia.height)){var ka=ia.width-12,ea=Math.max(20,ka*Math.min(1,P/1200)),ja=1200-P;ja=0<ja?(N- -400)/ja:.5;ja=Math.max(0,Math.min(1,ja));sa.style.width=ea+"px";sa.style.left=ja*(ka-ea)+"px";ia=ia.height-12;ka=Math.max(20,ia*Math.min(1,U/1200));ea=1200-U;ea=0<ea?(R- -400)/ea:.5;ea=Math.max(0,Math.min(1,-ea));wa.style.height=ka+"px";wa.style.top=ea*(ia-ka)+"px"}}function u(ia){var ka=Y.getBoundingClientRect(),ea=N+((null!=ia.touches?ia.touches[0].clientX:ia.clientX)-ka.left)/ka.width*P;ka=R+((null!=ia.touches?ia.touches[0].clientY:ia.clientY)-ka.top)/ka.height*U;ia=mxEvent.isAltDown(ia);return{x:t&&!ia?20*Math.round(ea/20):Math.round(ea),y:t&&!ia?20*Math.round(ka/20):Math.round(ka)}}function y(ia){var ka=Y.getBoundingClientRect(),ea=N+((null!=ia.touches?ia.touches[0].clientX:ia.clientX)-ka.left)/-ka.width*P;ia=R+((null!=ia.touches?ia.touches[0].clientY:ia.clientY)-ka.top)/ka.height*U;ka=P/400*9;if(r&&2<l.length&&"Q"===l[0].type){var ja=l[0].cx-ea,ta=l[0].cy-ia;if(Math.sqrt(ja*ja+ta*ta)<=ka)return{type:"control",index:0}}for(var xa=1;xa<l.length;xa++)if("Q"===l[xa].type&&(ja=l[xa].cx-ea,ta=l[xa].cy-ia,Math.sqrt(ja*ja+ta*ta)<=ka))return{type:"control",index:xa};for(xa=0;xa<l.length;xa++)if(ja=l[xa].x-ea,ta=l[xa].y-ia,Math.sqrt(ja*ja+ta*ta)<=ka)return{type:"vertex",index:xa};return null}function A(){x.push(JSON.stringify(l));-B=[];H()}function J(){0<x.length&&(B.push(JSON.stringify(l)),l=JSON.parse(x.pop()),n=Math.min(n,l.length-1),G(),H())}function K(){0<B.length&&(x.push(JSON.stringify(l)),l=JSON.parse(B.pop()),n=Math.min(n,l.length-1),G(),H())}function H(){null!=ua&&(ua.style.opacity=0<x.length?"1":"0.3",ua.style.pointerEvents=0<x.length?"":"none");null!=ya&&(ya.style.opacity=0<B.length?"1":"0.3",ya.style.pointerEvents=0<B.length?"":"none")}function G(){for(var ia="",ka=0;ka<l.length;ka++)ia=0===ka?ia+("M"+l[ka].x+-" "+l[ka].y):"Q"===l[ka].type?ia+("Q"+l[ka].cx+" "+l[ka].cy+" "+l[ka].x+" "+l[ka].y):ia+("L"+l[ka].x+" "+l[ka].y);r&&2<l.length&&("Q"===l[0].type&&(ia+="Q"+l[0].cx+" "+l[0].cy+" "+l[0].x+" "+l[0].y),ia+="Z");da.setAttribute("d",ia);for(da.setAttribute("fill",r&&2<l.length?"rgba(66, 133, 244, 0.1)":"none");ba.firstChild;)ba.removeChild(ba.firstChild);for(ka=1;ka<l.length;ka++)"Q"===l[ka].type&&(ia=document.createElementNS("http://www.w3.org/2000/svg","polyline"),ia.setAttribute("points",l[ka-1].x+-","+l[ka-1].y+" "+l[ka].cx+","+l[ka].cy+" "+l[ka].x+","+l[ka].y),ia.setAttribute("fill","none"),ia.setAttribute("stroke","#f0a030"),ia.setAttribute("stroke-width","1"),ia.setAttribute("stroke-dasharray","4,3"),ba.appendChild(ia));r&&2<l.length&&"Q"===l[0].type&&(ka=document.createElementNS("http://www.w3.org/2000/svg","polyline"),ka.setAttribute("points",l[l.length-1].x+","+l[l.length-1].y+" "+l[0].cx+","+l[0].cy+" "+l[0].x+","+l[0].y),ka.setAttribute("fill","none"),ka.setAttribute("stroke","#f0a030"),-ka.setAttribute("stroke-width","1"),ka.setAttribute("stroke-dasharray","4,3"),ba.appendChild(ka));for(;ha.firstChild;)ha.removeChild(ha.firstChild);for(ka=0;ka<l.length;ka++)ia=document.createElementNS("http://www.w3.org/2000/svg","circle"),ia.setAttribute("cx",l[ka].x),ia.setAttribute("cy",l[ka].y),ia.setAttribute("r",5),ia.setAttribute("fill",ka===n?"#ff4444":"#4285f4"),ia.setAttribute("stroke","#fff"),ia.setAttribute("stroke-width","1.5"),ia.style.cursor="move",ha.appendChild(ia);for(;la.firstChild;)la.removeChild(la.firstChild);-for(ka=1;ka<l.length;ka++)"Q"===l[ka].type&&(ia=document.createElementNS("http://www.w3.org/2000/svg","rect"),ia.setAttribute("x",l[ka].cx-5),ia.setAttribute("y",l[ka].cy-5),ia.setAttribute("width",10),ia.setAttribute("height",10),ia.setAttribute("fill",ka===n?"#ff8800":"#f0a030"),ia.setAttribute("stroke","#fff"),ia.setAttribute("stroke-width","1.5"),ia.style.cursor="move",la.appendChild(ia));r&&2<l.length&&"Q"===l[0].type&&(ka=document.createElementNS("http://www.w3.org/2000/svg","rect"),ka.setAttribute("x",-l[0].cx-5),ka.setAttribute("y",l[0].cy-5),ka.setAttribute("width",10),ka.setAttribute("height",10),ka.setAttribute("fill",0===n?"#ff8800":"#f0a030"),ka.setAttribute("stroke","#fff"),ka.setAttribute("stroke-width","1.5"),ka.style.cursor="move",la.appendChild(ka));c()}function c(){fa.innerHTML="";if(0===l.length){var ia=document.createElement("div");ia.style.padding="20px 10px";ia.style.textAlign="center";ia.style.opacity="0.5";ia.style.fontSize="12px";mxUtils.write(ia,mxResources.get("clickToAdd"));-fa.appendChild(ia)}else for(ia=0;ia<l.length;ia++)(function(ka){var ea=document.createElement("div");ea.style.display="flex";ea.style.alignItems="center";ea.style.padding="2px 4px";ea.style.gap="4px";ea.style.borderRadius="3px";ea.style.marginBottom="2px";ea.style.fontSize="12px";ea.setAttribute("draggable","true");ea.setAttribute("data-idx",ka);ka===n&&(ea.style.backgroundColor="rgba(66, 133, 244, 0.15)");ea.style.cursor="pointer";mxEvent.addListener(ea,"click",function(){n=ka;G()});var ja=document.createElement("span");-ja.innerHTML="☰";ja.style.cursor="grab";ja.style.fontSize="11px";ja.style.opacity="0.4";ja.style.flexShrink="0";ea.appendChild(ja);ja=document.createElement("span");ja.style.minWidth="18px";ja.style.fontWeight="bold";mxUtils.write(ja,ka+1+"");ea.appendChild(ja);ja=document.createElement("input");ja.type="number";ja.value=Math.round(l[ka].x);ja.style.width="48px";ja.style.fontSize="11px";ja.style.padding="1px 3px";ja.title="X";mxEvent.addListener(ja,"change",function(){A();l[ka].x=parseInt(this.value)||-0;G()});mxEvent.addListener(ja,"click",function(xa){xa.stopPropagation()});ea.appendChild(ja);ja=document.createElement("input");ja.type="number";ja.value=Math.round(l[ka].y);ja.style.width="48px";ja.style.fontSize="11px";ja.style.padding="1px 3px";ja.title="Y";mxEvent.addListener(ja,"change",function(){A();l[ka].y=parseInt(this.value)||0;G()});mxEvent.addListener(ja,"click",function(xa){xa.stopPropagation()});ea.appendChild(ja);if(0<ka||0===ka&&r&&2<l.length){ja=document.createElement("label");ja.style.display=-"flex";ja.style.alignItems="center";ja.style.cursor="pointer";ja.style.flexShrink="0";ja.title=mxResources.get("curved");var ta=document.createElement("input");ta.type="checkbox";ta.checked="Q"===l[ka].type;ta.style.margin="0";mxEvent.addListener(ta,"click",function(xa){xa.stopPropagation()});mxEvent.addListener(ta,"change",function(){A();if("Q"===l[ka].type)l[ka].type="L",delete l[ka].cx,delete l[ka].cy;else{var xa=0<ka?l[ka-1]:l[l.length-1];var Ea=l[ka];var Ha=(xa.x+Ea.x)/2;var Ja=(xa.y+Ea.y)/2;-var Ra=Ea.x-xa.x,Va=Ea.y-xa.y;xa=Math.sqrt(Ra*Ra+Va*Va);0!==xa&&(Ea=.25*xa,Ha=Math.round(Ha+-Va/xa*Ea),Ja=Math.round(Ja+Ra/xa*Ea));l[ka].type="Q";l[ka].cx=Ha;l[ka].cy=Ja}G()});ja.appendChild(ta);ea.appendChild(ja)}ja=document.createElement("img");ja.setAttribute("src",Editor.trashImage);ja.style.cursor="pointer";ja.style.marginLeft="auto";ja.style.width="14px";ja.style.height="14px";ja.style.opacity="0.5";ja.style.flexShrink="0";ja.title=mxResources.get("delete");Editor.isDarkMode()&&(ja.style.filter=-"invert(1)");mxEvent.addListener(ja,"click",function(xa){xa.stopPropagation();A();l.splice(ka,1);n>=l.length&&(n=l.length-1);G()});ea.appendChild(ja);mxEvent.addListener(ea,"dragstart",function(xa){I=ka;ea.style.opacity="0.4";xa.dataTransfer.effectAllowed="move";xa.dataTransfer.setData("text/plain",""+ka);xa.stopPropagation()});mxEvent.addListener(ea,"dragover",function(xa){xa.preventDefault();xa.stopPropagation();xa.dataTransfer.dropEffect="move";xa=parseInt(ea.getAttribute("data-idx"));null!==I&&-xa!==I&&(ea.style.borderTop=xa<I?"2px solid #4285f4":"",ea.style.borderBottom=xa>I?"2px solid #4285f4":"")});mxEvent.addListener(ea,"dragleave",function(xa){ea.style.borderTop="";ea.style.borderBottom=""});mxEvent.addListener(ea,"drop",function(xa){xa.preventDefault();xa.stopPropagation();ea.style.borderTop="";ea.style.borderBottom="";var Ea=parseInt(ea.getAttribute("data-idx"));null!==I&&Ea!==I&&(A(),xa=l.splice(I,1)[0],Ea=Ea>I?Ea-1:Ea,l.splice(Ea,0,xa),n===I?n=Ea:I<n&&Ea>=n?n--:I>n&&Ea<=n&&n++,-G());I=null});mxEvent.addListener(ea,"dragend",function(xa){ea.style.opacity="";ea.style.borderTop="";ea.style.borderBottom="";I=null});fa.appendChild(ea)})(ia)}var f=b.editor.graph,l=[],n=-1,r=!0,t=!0,x=[],B=[],F=-1,L=null,D=!1,T=!1,N=0,R=0,P=400,U=400,S=1,z=!1,g=0,p=0,v=0,C=0,E=!1,I=null,O=f.view.getState(k);if(null!=O)try{var Q=JSON.parse(mxUtils.getValue(O.style,"polyCoords","[]")),V=JSON.parse(mxUtils.getValue(O.style,"polyCurves","[]")),W=mxUtils.getValue(O.style,"polyline",0);r=!(1==W||!0===-W||"true"===W||"1"===W);for(O=0;O<Q.length;O++){var M={x:Math.round(400*Q[O][0]),y:Math.round(400*Q[O][1]),type:"L"};0<O&&V.length>O-1&&null!=V[O-1]&&3<=V[O-1].length&&"Q"===V[O-1][0]&&(M.type="Q",M.cx=Math.round(400*V[O-1][1]),M.cy=Math.round(400*V[O-1][2]));l.push(M)}r&&2<Q.length&&V.length>=Q.length&&null!=V[Q.length-1]&&3<=V[Q.length-1].length&&"Q"===V[Q.length-1][0]&&(l[0].type="Q",l[0].cx=Math.round(400*V[Q.length-1][1]),l[0].cy=Math.round(400*V[Q.length-1][2]))}catch(ia){}var X=document.createElement("div");-X.style.userSelect="none";X.setAttribute("tabindex","0");X.style.outline="none";X.style.position="absolute";X.style.left="30px";X.style.right="30px";X.style.top="30px";X.style.bottom="30px";Q=document.createElement("div");Q.style.display="flex";Q.style.gap="10px";Q.style.position="absolute";Q.style.left="0px";Q.style.right="0px";Q.style.top="0px";Q.style.bottom="40px";X.appendChild(Q);var Z=document.createElement("div");Z.style.border="1px solid";Z.style.borderColor="inherit";Z.style.borderRadius=-"4px";Z.style.flexGrow="1";Z.style.flexShrink="1";Z.style.minWidth="200px";Z.style.position="relative";Z.style.overflow="hidden";Q.appendChild(Z);var Y=document.createElementNS("http://www.w3.org/2000/svg","svg");Y.setAttribute("width","100%");Y.setAttribute("height","100%");Y.setAttribute("viewBox","0 0 400 400");Y.style.display="block";Y.style.cursor="crosshair";V=document.createElementNS("http://www.w3.org/2000/svg","defs");M=document.createElementNS("http://www.w3.org/2000/svg","pattern");O="polygonGrid_"+-Date.now();M.setAttribute("id",O);M.setAttribute("width",20);M.setAttribute("height",20);M.setAttribute("patternUnits","userSpaceOnUse");W=document.createElementNS("http://www.w3.org/2000/svg","path");W.setAttribute("d","M 20 0 L 0 0 0 20");W.setAttribute("fill","none");W.setAttribute("stroke","#e0e0e0");W.setAttribute("stroke-width","0.5");M.appendChild(W);V.appendChild(M);Y.appendChild(V);var aa=document.createElementNS("http://www.w3.org/2000/svg","rect");aa.setAttribute("x","-5000");aa.setAttribute("y",-"-5000");aa.setAttribute("width","10000");aa.setAttribute("height","10000");aa.setAttribute("fill","url(#"+O+")");Y.appendChild(aa);var da=document.createElementNS("http://www.w3.org/2000/svg","path");da.setAttribute("fill","rgba(66, 133, 244, 0.1)");da.setAttribute("stroke","#4285f4");da.setAttribute("stroke-width","2");Y.appendChild(da);var ba=document.createElementNS("http://www.w3.org/2000/svg","g");Y.appendChild(ba);var ha=document.createElementNS("http://www.w3.org/2000/svg","g");Y.appendChild(ha);-var la=document.createElementNS("http://www.w3.org/2000/svg","g");Y.appendChild(la);Z.appendChild(Y);var ra=document.createElement("div");ra.style.position="absolute";ra.style.bottom="0px";ra.style.left="0px";ra.style.right="12px";ra.style.height="12px";ra.style.backgroundColor="rgba(128,128,128,0.08)";var sa=document.createElement("div");sa.style.position="absolute";sa.style.top="2px";sa.style.height="8px";sa.style.borderRadius="4px";sa.style.backgroundColor="rgba(128,128,128,0.35)";sa.style.cursor=-"pointer";sa.style.minWidth="20px";ra.appendChild(sa);Z.appendChild(ra);var va=document.createElement("div");va.style.position="absolute";va.style.top="0px";va.style.right="0px";va.style.bottom="12px";va.style.width="12px";va.style.backgroundColor="rgba(128,128,128,0.08)";var wa=document.createElement("div");wa.style.position="absolute";wa.style.left="2px";wa.style.width="8px";wa.style.borderRadius="4px";wa.style.backgroundColor="rgba(128,128,128,0.35)";wa.style.cursor="pointer";wa.style.minHeight=-"20px";va.appendChild(wa);Z.appendChild(va);var qa=!1,Ba=!1,Aa=0,Da=0;mxEvent.addListener(sa,"mousedown",function(ia){qa=!0;Aa=ia.clientX;Da=N;ia.preventDefault();ia.stopPropagation()});mxEvent.addListener(wa,"mousedown",function(ia){Ba=!0;Aa=ia.clientY;Da=R;ia.preventDefault();ia.stopPropagation()});mxEvent.addListener(ra,"mousedown",function(ia){if(ia.target===ra){var ka=ra.getBoundingClientRect().width,ea=ia.clientX-ra.getBoundingClientRect().left,ja=1200-P;0<ja&&(N=-400+ea/ka*ja,q());ia.preventDefault();-ia.stopPropagation()}});mxEvent.addListener(va,"mousedown",function(ia){if(ia.target===va){var ka=va.getBoundingClientRect().height,ea=ia.clientY-va.getBoundingClientRect().top,ja=1200-U;0<ja&&(R=-400+ea/ka*ja,q());ia.preventDefault();ia.stopPropagation()}});var Ca=function(ia){if(qa){var ka=Z.getBoundingClientRect().width-12,ea=parseFloat(sa.style.width)||20,ja=1200-P;ka>ea&&0<ja&&(N=Da+(ia.clientX-Aa)/(ka-ea)*ja,q());ia.preventDefault()}Ba&&(ka=Z.getBoundingClientRect().height-12,ea=parseFloat(wa.style.height)||-20,ja=1200-U,ka>ea&&0<ja&&(R=Da+(ia.clientY-Aa)/(ka-ea)*ja,q()),ia.preventDefault())},ca=function(ia){Ba=qa=!1};mxEvent.addListener(document,"mousemove",Ca);mxEvent.addListener(document,"mouseup",ca);"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){var ia=Y.getBoundingClientRect();if(0<ia.width&&0<ia.height){var ka=N+P/2,ea=R+U/2;P=ia.width*S;U=ia.height*S;N=ka-P/2;R=ea-U/2;q()}})).observe(Z);var fa=document.createElement("div");fa.style.width="200px";fa.style.flexShrink="0";fa.style.overflowY=-"auto";fa.style.border="1px solid";fa.style.borderColor="inherit";fa.style.borderRadius="4px";fa.style.padding="4px";Q.appendChild(fa);mxEvent.addGestureListeners(Y,function(ia){if(!E&&1!==ia.button&&2!==ia.button){var ka=y(ia);if(null!=ka)F=ka.index,L=ka.type,D=!0,T=!1,n=ka.index;else{ka=u(ia);A();if(2>l.length)l.push({x:ka.x,y:ka.y,type:"L"}),n=l.length-1;else{for(var ea=Infinity,ja=l.length-1,ta=r?l.length:l.length-1,xa=0;xa<ta;xa++){var Ea=(xa+1)%l.length;Ea=mxUtils.ptSegDistSq(l[xa].x,l[xa].y,-l[Ea].x,l[Ea].y,ka.x,ka.y);Ea<ea&&(ea=Ea,ja=xa)}l.splice(ja+1,0,{x:ka.x,y:ka.y,type:"L"});n=ja+1}F=n;L="vertex";T=D=!0}G();mxEvent.consume(ia)}},function(ia){if(D&&0<=F&&F<l.length){T||(A(),T=!0);var ka=u(ia);"control"===L?(l[F].cx=ka.x,l[F].cy=ka.y):(l[F].x=ka.x,l[F].y=ka.y);G();mxEvent.consume(ia)}},function(ia){!E&&1!==ia.button&&2!==ia.button&&D&&0<=F&&(D=!1,F=-1,L=null,mxEvent.consume(ia))});mxEvent.addListener(Y,"wheel",function(ia){ia.preventDefault();var ka=Y.getBoundingClientRect(),ea=(ia.clientX--ka.left)/ka.width,ja=(ia.clientY-ka.top)/ka.height,ta=N+ea*P,xa=R+ja*U;S=Math.max(.05,Math.min(5,S*(0<ia.deltaY?1.15:1/1.15)));P=ka.width*S;U=ka.height*S;N=ta-ea*P;R=xa-ja*U;q()});mxEvent.addListener(Y,"contextmenu",function(ia){ia.preventDefault()});mxEvent.addListener(Y,"mousedown",function(ia){if(1===ia.button||2===ia.button||0===ia.button&&E)z=!0,g=ia.clientX,p=ia.clientY,v=N,C=R,Y.style.cursor="grabbing",ia.preventDefault()});var oa=function(ia){if(z){var ka=Y.getBoundingClientRect();N=v-(ia.clientX--g)/ka.width*P;R=C-(ia.clientY-p)/ka.height*U;q();ia.preventDefault()}},pa=function(ia){z&&(z=!1,Y.style.cursor=E?"grab":"crosshair")};mxEvent.addListener(document,"mousemove",oa);mxEvent.addListener(document,"mouseup",pa);Q=document.createElement("div");Q.style.display="flex";Q.style.alignItems="center";Q.style.gap="6px";Q.style.position="absolute";Q.style.left="0px";Q.style.right="0px";Q.style.bottom="0px";Q.style.height="34px";var ua=b.createToolbarButton(Editor.undoImage,mxResources.get("undo"),-function(){J()});Q.appendChild(ua);var ya=b.createToolbarButton(Editor.redoImage,mxResources.get("redo"),function(){K()});Q.appendChild(ya);V=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){d(S/1.15)});Q.appendChild(V);V=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){d(1.15*S)});Q.appendChild(V);V=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){var ia=Y.getBoundingClientRect();if(0<ia.width&&0<ia.height){if(1==-S)if(0<l.length){for(var ka=l[0].x,ea=l[0].y,ja=l[0].x,ta=l[0].y,xa=1;xa<l.length;xa++)ka=Math.min(ka,l[xa].x),ea=Math.min(ea,l[xa].y),ja=Math.max(ja,l[xa].x),ta=Math.max(ta,l[xa].y),"Q"===l[xa].type&&(ka=Math.min(ka,l[xa].cx),ea=Math.min(ea,l[xa].cy),ja=Math.max(ja,l[xa].cx),ta=Math.max(ta,l[xa].cy));ja=ja-ka+40;ta=ta-ea+40;S=1/Math.min(ia.width/ja,ia.height/ta);P=ia.width*S;U=ia.height*S;N=ka-20+(ja-P)/2;R=ea-20+(ta-U)/2}else S=1,P=ia.width,U=ia.height,N=(400-P)/2,R=(400-U)/2;else S=1,P=ia.width*-S,U=ia.height*S,N=(400-P)/2,R=(400-U)/2;q()}});Q.appendChild(V);V=mxUtils.button(mxResources.get("deleteAll"),function(){0<l.length&&(A(),l=[],n=-1,G())});V.className="geBtn";V.style.padding="2px 10px";V.style.fontSize="12px";Q.appendChild(V);V=document.createElement("span");V.style.flexGrow="1";Q.appendChild(V);V=document.createElement("label");V.style.display="flex";V.style.alignItems="center";V.style.gap="4px";V.style.fontSize="12px";V.style.cursor="pointer";V.style.whiteSpace="nowrap";M=document.createElement("input");-M.type="checkbox";M.checked=t;mxEvent.addListener(M,"change",function(){t=this.checked;aa.style.display=t?"":"none"});V.appendChild(M);mxUtils.write(V,mxResources.get("grid"));Q.appendChild(V);V=document.createElement("label");V.style.display="flex";V.style.alignItems="center";V.style.gap="4px";V.style.fontSize="12px";V.style.cursor="pointer";V.style.whiteSpace="nowrap";M=document.createElement("input");M.type="checkbox";M.checked=r;mxEvent.addListener(M,"change",function(){r=this.checked;G()});V.appendChild(M);-mxUtils.write(V,mxResources.get("closePath"));Q.appendChild(V);V=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});V.className="geBtn";M=mxUtils.button(mxResources.get("apply"),function(){if(2>l.length)b.showError(mxResources.get("error"),mxResources.get("minTwoPoints"),mxResources.get("ok"));else{for(var ia=l[0].x,ka=l[0].x,ea=l[0].y,ja=l[0].y,ta=0;ta<l.length;ta++)ia=Math.min(ia,l[ta].x),ka=Math.max(ka,l[ta].x),ea=Math.min(ea,l[ta].y),ja=Math.max(ja,l[ta].y),"Q"===l[ta].type&&-(ia=Math.min(ia,l[ta].cx),ka=Math.max(ka,l[ta].cx),ea=Math.min(ea,l[ta].cy),ja=Math.max(ja,l[ta].cy));var xa=ka-ia,Ea=ja-ea,Ha=function(Ra){return 0<xa?Math.round((Ra-ia)/xa*1E5)/1E5:.5},Ja=function(Ra){return 0<Ea?Math.round((Ra-ea)/Ea*1E5)/1E5:.5};ka=[];ja=[];for(ta=0;ta<l.length;ta++)ka.push([Ha(l[ta].x),Ja(l[ta].y)]),0<ta&&("Q"===l[ta].type?ja.push(["Q",Ha(l[ta].cx),Ja(l[ta].cy)]):ja.push([]));r&&2<l.length&&"Q"===l[0].type&&ja.push(["Q",Ha(l[0].cx),Ja(l[0].cy)]);if(null!=m)ta="shape=mxgraph.basic.polygon;polyCoords="+-JSON.stringify(ka)+";polyCurves="+JSON.stringify(ja)+";polyline="+(r?"0":"1")+";whiteSpace=wrap;html=1;",m(ta);else{ta=f.getCellGeometry(k);null!=ta&&(ta=ta.clone(),0<xa&&(ta.x+=ia/400*ta.width,ta.width*=xa/400),0<Ea&&(ta.y+=ea/400*ta.height,ta.height*=Ea/400));f.getModel().beginUpdate();try{null!=ta&&f.getModel().setGeometry(k,ta),f.setCellStyles("polyCoords",JSON.stringify(ka),[k]),f.setCellStyles("polyCurves",JSON.stringify(ja),[k]),f.setCellStyles("polyline",r?"0":"1",[k])}finally{f.getModel().endUpdate()}}b.hideDialog()}});-M.className="geBtn gePrimaryBtn";b.editor.cancelFirst?(Q.appendChild(V),Q.appendChild(M)):(Q.appendChild(M),Q.appendChild(V));X.appendChild(Q);mxEvent.addListener(X,"keydown",function(ia){32===ia.keyCode?(E||(E=!0,Y.style.cursor="grab"),mxEvent.consume(ia)):46===ia.keyCode||8===ia.keyCode?0<=n&&n<l.length&&"INPUT"!==ia.target.tagName&&(A(),l.splice(n,1),n>=l.length&&(n=l.length-1),G(),mxEvent.consume(ia)):90===ia.keyCode&&(ia.ctrlKey||ia.metaKey)?(ia.shiftKey?K():J(),mxEvent.consume(ia)):89===ia.keyCode&&-(ia.ctrlKey||ia.metaKey)&&(K(),mxEvent.consume(ia))});mxEvent.addListener(X,"keyup",function(ia){32===ia.keyCode&&(E=!1,z||(Y.style.cursor="crosshair"))});G();H();this.init=function(){X.focus();var ia=Y.getBoundingClientRect();0<ia.width&&0<ia.height&&(S=1,P=ia.width*S,U=ia.height*S,N=(400-P)/2,R=(400-U)/2,q())};this.destroy=function(){mxEvent.removeListener(document,"mousemove",Ca);mxEvent.removeListener(document,"mouseup",ca);mxEvent.removeListener(document,"mousemove",oa);mxEvent.removeListener(document,-"mouseup",pa)};this.container=X};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinFormatImage=+var FilePropertiesDialog=function(b,k){function m(L){var D=K;K=function(T,N){try{L(function(){D(T,N)},N)}catch(R){N(R)}}}function d(L,D,T){var N=document.createElement("div");N.className="geDialogFormRow";var R=document.createElement("span");R.className="geDialogFormLabel";mxUtils.write(R,D+":");N.appendChild(R);N.appendChild(T);L.appendChild(N);return N}var q=document.createElement("div"),u=document.createElement("h3");mxUtils.write(u,mxResources.get("properties"));q.appendChild(u);var y=b.getCurrentFile(),+A=null!=y&&null!=y.getTitle()?y.getTitle():b.defaultFilename,J=/(\.png)$/i.test(A);u=/(\.svg)$/i.test(A);var K=function(L,D){L()},F=document.createElement("div");F.className="geDialogSection";if(J||u){A=1;J=0;var H=b.fileNode;null!=H&&(H.hasAttribute("scale")&&(A=parseFloat(H.getAttribute("scale"))),H.hasAttribute("border")&&(J=parseInt(H.getAttribute("border"))));var c=document.createElement("input");c.setAttribute("type","text");c.setAttribute("value",100*A+"%");d(F,mxResources.get("zoom"),c);var f=+document.createElement("input");f.setAttribute("type","text");f.setAttribute("value",J);d(F,mxResources.get("borderWidth"),f);var l=null;u&&(l=b.addCheckbox(F,mxResources.get("embedFonts"),b.getSvgFileProperties(H).embedFonts,null,null,null,null,null,!0));this.init=this.init||function(){c.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?c.select():document.execCommand("selectAll",!1,null)};m(function(L,D){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(c.value)/+100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(f.value))),null!=l&&b.fileNode.setAttribute("embedFonts",l.checked?"true":"false"),null!=y&&y.fileChanged());L()})}else if(!/(\.html)$/i.test(A)&&!/(\.svg)$/i.test(A)){var n=null!=y?y.isCompressed():Editor.defaultCompressed,r=b.addCheckbox(F,mxResources.get("compressed"),n,null,null,null,null,null,!0);this.init=this.init||function(){r.focus()};m(function(L,D){null!=b.fileNode&&n!=r.checked?window.setTimeout(function(){b.fileNode.setAttribute("compressed",+r.checked?"true":"false");null!=y&&(y.compressionChanged(r.checked),y.fileChanged());L()},0):L()})}var t=null!=y?y.isLocked():!1,x=b.addCheckbox(F,mxResources.get("locked"),t,null,null,null,null,null,!0);this.init=this.init||function(){x.focus()};m(function(L,D){null!=b.fileNode&&t!=x.checked?window.setTimeout(function(){null!=y&&y.setLocked(x.checked);L()},0):L()});if(null!=y&&y.isRealtimeOptional()){var B="disabled"!=b.drive.getCustomProperty(y.desc,"collaboration"),G=b.addCheckbox(F,mxResources.get("realtimeCollaboration"),+B,null,null,null,null,null,!0);G.checkRow.appendChild(b.menus.createHelpLink("https://www.drawio.com/docs/manual/collaboration/concurrent-editing/#disable-real-time-collaboration"));m(function(L,D){G.checked!=B?y.setRealtimeEnabled(G.checked,L,D):L()});this.init=null!=this.init?this.init:function(){G.focus()}}q.appendChild(F);u=document.createElement("div");u.className="geDialogSection";F=!1;null!=y&&"draw.io"==b.getServiceName()&&0<y.getSize()&&"1"!=urlParams.embed&&(F=b.formatFileSize(y.getSize()),+A=document.createElement("input"),A.setAttribute("type","text"),A.setAttribute("title",F),A.setAttribute("value",F),A.setAttribute("disabled","disabled"),d(u,mxResources.get("size"),A),F=!0);null!=y&&null!=y.fileObject&&null!=y.fileObject.path&&(F=document.createElement("input"),F.setAttribute("type","text"),F.setAttribute("title",y.fileObject.path),F.setAttribute("value",y.fileObject.path),F.setAttribute("disabled","disabled"),d(u,mxResources.get("pathFilename"),F),F=!0);null!=k&&(F=document.createElement("a"),+F.setAttribute("href",k),F.setAttribute("title",k),F.style.flex="1",F.style.minWidth="0",F.style.whiteSpace="nowrap",F.style.overflow="hidden",F.style.textOverflow="ellipsis",mxUtils.write(F,k),mxEvent.addListener(F,"click",function(L){b.openLink(k);mxEvent.consume(L)}),d(u,mxResources.get("publicDiagramUrl"),F),F=!0);F&&q.appendChild(u);this.init=null!=this.init?this.init:function(){};q.style.paddingBottom="10px";u=document.createElement("div");u.style.marginTop="34px";u.style.textAlign="right";+u.style.whiteSpace="nowrap";F=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});F.className="geBtn";A=mxUtils.button(mxResources.get("apply"),function(){b.spinner.spin(document.body,mxResources.get("updatingDocument"))&&K(function(){b.spinner.stop();b.hideDialog()},function(L){b.spinner.stop();b.handleError(L,mxResources.get("error"))})});A.className="geBtn gePrimaryBtn";J=null;null!=b.fileNode&&(J=mxUtils.button(mxResources.get("editData")+"...",function(){b.hideDialog();var L=+{};try{var D=b.fileNode.getAttribute("vars");null!=D&&0<D.length&&(L=JSON.parse(D))}catch(R){}D=mxUtils.createXmlDocument().createElement("object");D.setAttribute("label","");for(var T in L)D.setAttribute(T,L[T]);L=b.createTemporaryGraph(b.editor.graph.getStylesheet());var N=new mxCell(D);L.getModel().add(L.getDefaultParent(),N);L.getModel().addListener(mxEvent.CHANGE,function(R,P){R=P.getProperty("edit").changes;for(P=0;P<R.length;P++)if(R[P]instanceof mxValueChange&&R[P].cell===N){for(var U={},+S=R[P].value.attributes,z=0;z<S.length;z++)"label"!=S[z].nodeName&&(U[S[z].nodeName]=S[z].nodeValue);U=JSON.stringify(U);"{}"==U?b.fileNode.removeAttribute("vars"):b.fileNode.setAttribute("vars",U);b.updateFileVars();b.editor.graph.refresh();U=b.getCurrentFile();null!=U&&U.fileChanged()}});L=new EditDataDialog(b,N,L);b.showDialog(L.container,480,420,!0,!1,null,!1,null,new mxRectangle(0,0,440,220));L.init()}),J.className="geBtn");b.editor.cancelFirst?(u.appendChild(F),null!=J&&u.appendChild(J),u.appendChild(A)):+(null!=J&&u.appendChild(J),u.appendChild(A),u.appendChild(F));q.appendChild(u);this.container=q},ConnectionPointsDialog=function(b,k){function m(){null!=q&&q.destroy()}var d=document.createElement("div");d.style.userSelect="none";d.style.display="flex";d.style.flexDirection="column";d.style.height="100%";var q=null;this.init=function(){function u(S,z,g){var p="shape=image;points=[];rotatable=0;resizable=0;connectable=0;editable=0;image="+b.convertDataUri(mxConstraintHandler.prototype.pointImage.src)++";";S=new mxCell("",new mxGeometry(S,z,6,6),p);S.vertex=!0;S.cp=!0;S.constObj=g;return H.addCell(S)}function y(S){S=H.getSelectionCells();H.deleteCells(S)}function A(){var S=parseFloat(N.value)||0;S=0>S?0:100<S?100:S;N.value=S;var z=parseFloat(P.value)||0;z=0>z?0:100<z?100:z;P.value=z;var g=parseInt(R.value)||0,p=parseInt(U.value)||0;g=new mxConnectionConstraint(new mxPoint(parseFloat((S/100).toFixed(6)),parseFloat((z/100).toFixed(6))),!1,null,g,p);S=H.getConnectionPoint(l,g);z=H.getSelectionCell();+if(null!=z){z.constObj=g;g=z.geometry.clone();p=H.view.scale;var v=H.view.translate;g.x=(S.x-3*p)/p-v.x;g.y=(S.y-3*p)/p-v.y;H.model.setGeometry(z,g)}}function J(S){if(S.constObj)return{x:S.constObj.point.x,y:S.constObj.point.y,dx:S.constObj.dx,dy:S.constObj.dy};var z=0,g=0,p=c.geometry,v=parseFloat(((S.geometry.x+3-p.x)/p.width).toFixed(6));S=parseFloat(((S.geometry.y+3-p.y)/p.height).toFixed(6));0>v?(z=v*p.width,v=0):1<v&&(z=(v-1)*p.width,v=1);0>S?(g=S*p.height,S=0):1<S&&(g=(S-1)*p.height,S=1);return{x:v,+y:S,dx:parseInt(z),dy:parseInt(g)}}function K(S){if(1==H.getSelectionCount()){var z=H.getSelectionCell();S&&(z.constObj=null);S=J(z);N.value=parseFloat((100*S.x).toFixed(4));P.value=parseFloat((100*S.y).toFixed(4));R.value=S.dx;U.value=S.dy;T.style.visibility=""}else T.style.visibility="hidden"}var F=document.createElement("div");F.style.flex="1";F.style.minHeight="0";F.style.overflow="hidden";F.style.borderStyle="solid";F.style.borderWidth="1px";F.style.boxSizing="border-box";mxEvent.disableContextMenu(F);+d.appendChild(F);var H=new Graph(F);H.transparentBackground=!1;H.autoExtend=!1;H.autoScroll=!1;H.setGridEnabled(!1);H.setEnabled(!0);H.setPanning(!0);H.setConnectable(!1);H.setTooltips(!1);H.minFitScale=null;H.maxFitScale=null;H.centerZoom=!0;H.maxFitScale=2;F=k.geometry;var c=new mxCell(k.value,new mxGeometry(0,0,F.width,F.height),k.style+";rotatable=0;resizable=0;connectable=0;editable=0;movable=0;opacity=50;");c.vertex=!0;H.addCell(c);H.dblClick=function(S,z){if(null!=z&&z!=c)H.setSelectionCell(z);+else{z=mxUtils.convertPoint(H.container,mxEvent.getClientX(S),mxEvent.getClientY(S));mxEvent.consume(S);S=H.view.scale;var g=H.view.translate;H.setSelectionCell(u((z.x-3*S)/S-g.x,(z.y-3*S)/S-g.y))}};q=new mxKeyHandler(H);q.bindKey(46,y);q.bindKey(8,y);H.getRubberband().isForceRubberbandEvent=function(S){return 0==S.evt.button&&(null==S.getCell()||S.getCell()==c)};H.panningHandler.isForcePanningEvent=function(S){return 2==S.evt.button};var f=H.isCellSelectable;H.isCellSelectable=function(S){return S==+c?!1:f.apply(this,arguments)};H.getLinkForCell=function(){return null};var l=H.view.getState(c);F=H.getAllConnectionConstraints(l);for(var n=0;null!=F&&n<F.length;n++){var r=H.getConnectionPoint(l,F[n]);u(r.x-3,r.y-3,F[n])}n=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){H.zoomIn()});r=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){H.zoomOut()});var t=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==H.view.scale?+(H.maxFitScale=8,H.fit(8)):H.zoomActual();H.center()}),x=function(){b.prompt(mxResources.get("gridSize"),H.gridSize,function(S){!isNaN(S)&&0<S&&(H.setGridSize(S),H.setGridEnabled(!0),H.refresh())})},B=b.createToolbarButton(Editor.thinGridImage,mxResources.get("grid"),function(S){mxEvent.isShiftDown(S)?x():(H.setGridEnabled(!H.isGridEnabled()),H.refresh())});mxEvent.addListener(B,"dblclick",x);var G=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),y);mxUtils.setOpacity(G,10);F=document.createElement("div");+F.style.display="flex";F.style.flexShrink="0";F.style.alignItems="center";F.style.paddingTop="6px";F.appendChild(n);F.appendChild(r);F.appendChild(t);F.appendChild(B);F.appendChild(G);d.appendChild(F);var L=document.createElement("input");L.setAttribute("type","number");L.setAttribute("min","1");L.setAttribute("value","1");L.style.width="45px";L.style.position="relative";L.style.margin="0 4px 0 4px";var D=document.createElement("select");D.style.position="relative";r=["left","right","top","bottom"];+for(n=0;n<r.length;n++)t=r[n],B=document.createElement("option"),mxUtils.write(B,mxResources.get(t)),B.value=t,D.appendChild(B);n=mxUtils.button(mxResources.get("add"),function(){var S=parseInt(L.value);S=1>S?1:100<S?100:S;L.value=S;for(var z=D.value,g=c.geometry,p=[],v=0;v<S;v++){switch(z){case "left":var C=g.x;var E=g.y+(v+1)*g.height/(S+1);break;case "right":C=g.x+g.width;E=g.y+(v+1)*g.height/(S+1);break;case "top":C=g.x+(v+1)*g.width/(S+1);E=g.y;break;case "bottom":C=g.x+(v+1)*g.width/(S+1),E=+g.y+g.height}p.push(u(C-3,E-3))}H.setSelectionCells(p)});n.style.marginLeft="auto";F.appendChild(n);F.appendChild(L);F.appendChild(D);var T=document.createElement("div");T.style.flexShrink="0";T.style.margin="4px 0px 8px 0px";T.style.whiteSpace="nowrap";T.style.height="24px";F=document.createElement("span");mxUtils.write(F,mxResources.get("dx"));T.appendChild(F);var N=document.createElement("input");N.setAttribute("type","number");N.setAttribute("min","0");N.setAttribute("max","100");N.setAttribute("step",+"any");N.style.width="45px";N.style.margin="0 4px 0 4px";T.appendChild(N);mxUtils.write(T,"%");var R=document.createElement("input");R.setAttribute("type","number");R.style.width="45px";R.style.margin="0 4px 0 4px";T.appendChild(R);mxUtils.write(T,"pt");F=document.createElement("span");mxUtils.write(F,mxResources.get("dy"));F.style.marginLeft="12px";T.appendChild(F);var P=document.createElement("input");P.setAttribute("type","number");P.setAttribute("min","0");P.setAttribute("max","100");P.setAttribute("step",+"any");P.style.width="45px";P.style.margin="0 4px 0 4px";T.appendChild(P);mxUtils.write(T,"%");var U=document.createElement("input");U.setAttribute("type","number");U.style.width="45px";U.style.margin="0 4px 0 4px";T.appendChild(U);mxUtils.write(T,"pt");d.appendChild(T);K();H.getSelectionModel().addListener(mxEvent.CHANGE,function(){0<H.getSelectionCount()?mxUtils.setOpacity(G,60):mxUtils.setOpacity(G,10);K()});H.addListener(mxEvent.CELLS_MOVED,K);mxEvent.addListener(N,"change",A);mxEvent.addListener(P,+"change",A);mxEvent.addListener(R,"change",A);mxEvent.addListener(U,"change",A);F=mxUtils.button(mxResources.get("cancel"),function(){m();b.hideDialog()});F.className="geBtn";n=mxUtils.button(mxResources.get("apply"),function(){var S=H.model.cells,z=[],g=[],p;for(p in S){var v=S[p];v.cp&&g.push(J(v))}g.sort(function(C,E){return C.x!=E.x?C.x-E.x:C.y!=E.y?C.y-E.y:C.dx!=E.dx?C.dx-E.dx:C.dy-E.dy});for(S=0;S<g.length;S++)0<S&&g[S].x==g[S-1].x&&g[S].y==g[S-1].y&&g[S].dx==g[S-1].dx&&g[S].dy==g[S-1].dy||+z.push("["+g[S].x+","+g[S].y+",0,"+g[S].dx+","+g[S].dy+"]");b.editor.graph.setCellStyles("points","["+z.join(",")+"]",[k]);m();b.hideDialog()});n.className="geBtn gePrimaryBtn";r=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[k]);m();b.hideDialog()});r.className="geBtn";t=document.createElement("div");t.style.flexShrink="0";t.style.marginTop="10px";t.style.textAlign="right";b.isOffline()||t.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-connection-points-customise"));+b.editor.cancelFirst&&t.appendChild(F);t.appendChild(r);t.appendChild(n);b.editor.cancelFirst||t.appendChild(F);d.appendChild(t);H.fit(8);H.center()};this.destroy=m;this.container=d},PolygonDialog=function(b,k,m){function d(ia){var ka=Y.getBoundingClientRect();if(0<ka.width&&0<ka.height){var ea=N+P/2,ja=R+U/2;S=Math.max(.05,Math.min(5,ia));P=ka.width*S;U=ka.height*S;N=ea-P/2;R=ja-U/2;q()}}function q(){Y.setAttribute("viewBox",N+" "+R+" "+P+" "+U);var ia=Z.getBoundingClientRect();if(!(0>=ia.width||+0>=ia.height)){var ka=ia.width-12,ea=Math.max(20,ka*Math.min(1,P/1200)),ja=1200-P;ja=0<ja?(N- -400)/ja:.5;ja=Math.max(0,Math.min(1,ja));sa.style.width=ea+"px";sa.style.left=ja*(ka-ea)+"px";ia=ia.height-12;ka=Math.max(20,ia*Math.min(1,U/1200));ea=1200-U;ea=0<ea?(R- -400)/ea:.5;ea=Math.max(0,Math.min(1,ea));wa.style.height=ka+"px";wa.style.top=ea*(ia-ka)+"px"}}function u(ia){var ka=Y.getBoundingClientRect(),ea=N+((null!=ia.touches?ia.touches[0].clientX:ia.clientX)-ka.left)/ka.width*P;ka=R+((null!=ia.touches?+ia.touches[0].clientY:ia.clientY)-ka.top)/ka.height*U;ia=mxEvent.isAltDown(ia);return{x:t&&!ia?20*Math.round(ea/20):Math.round(ea),y:t&&!ia?20*Math.round(ka/20):Math.round(ka)}}function y(ia){var ka=Y.getBoundingClientRect(),ea=N+((null!=ia.touches?ia.touches[0].clientX:ia.clientX)-ka.left)/ka.width*P;ia=R+((null!=ia.touches?ia.touches[0].clientY:ia.clientY)-ka.top)/ka.height*U;ka=P/400*9;if(r&&2<l.length&&"Q"===l[0].type){var ja=l[0].cx-ea,ta=l[0].cy-ia;if(Math.sqrt(ja*ja+ta*ta)<=ka)return{type:"control",+index:0}}for(var xa=1;xa<l.length;xa++)if("Q"===l[xa].type&&(ja=l[xa].cx-ea,ta=l[xa].cy-ia,Math.sqrt(ja*ja+ta*ta)<=ka))return{type:"control",index:xa};for(xa=0;xa<l.length;xa++)if(ja=l[xa].x-ea,ta=l[xa].y-ia,Math.sqrt(ja*ja+ta*ta)<=ka)return{type:"vertex",index:xa};return null}function A(){x.push(JSON.stringify(l));B=[];F()}function J(){0<x.length&&(B.push(JSON.stringify(l)),l=JSON.parse(x.pop()),n=Math.min(n,l.length-1),H(),F())}function K(){0<B.length&&(x.push(JSON.stringify(l)),l=JSON.parse(B.pop()),+n=Math.min(n,l.length-1),H(),F())}function F(){null!=ua&&(ua.style.opacity=0<x.length?"1":"0.3",ua.style.pointerEvents=0<x.length?"":"none");null!=ya&&(ya.style.opacity=0<B.length?"1":"0.3",ya.style.pointerEvents=0<B.length?"":"none")}function H(){for(var ia="",ka=0;ka<l.length;ka++)ia=0===ka?ia+("M"+l[ka].x+" "+l[ka].y):"Q"===l[ka].type?ia+("Q"+l[ka].cx+" "+l[ka].cy+" "+l[ka].x+" "+l[ka].y):ia+("L"+l[ka].x+" "+l[ka].y);r&&2<l.length&&("Q"===l[0].type&&(ia+="Q"+l[0].cx+" "+l[0].cy+" "+l[0].x+" "++l[0].y),ia+="Z");da.setAttribute("d",ia);for(da.setAttribute("fill",r&&2<l.length?"rgba(66, 133, 244, 0.1)":"none");ba.firstChild;)ba.removeChild(ba.firstChild);for(ka=1;ka<l.length;ka++)"Q"===l[ka].type&&(ia=document.createElementNS("http://www.w3.org/2000/svg","polyline"),ia.setAttribute("points",l[ka-1].x+","+l[ka-1].y+" "+l[ka].cx+","+l[ka].cy+" "+l[ka].x+","+l[ka].y),ia.setAttribute("fill","none"),ia.setAttribute("stroke","#f0a030"),ia.setAttribute("stroke-width","1"),ia.setAttribute("stroke-dasharray",+"4,3"),ba.appendChild(ia));r&&2<l.length&&"Q"===l[0].type&&(ka=document.createElementNS("http://www.w3.org/2000/svg","polyline"),ka.setAttribute("points",l[l.length-1].x+","+l[l.length-1].y+" "+l[0].cx+","+l[0].cy+" "+l[0].x+","+l[0].y),ka.setAttribute("fill","none"),ka.setAttribute("stroke","#f0a030"),ka.setAttribute("stroke-width","1"),ka.setAttribute("stroke-dasharray","4,3"),ba.appendChild(ka));for(;ha.firstChild;)ha.removeChild(ha.firstChild);for(ka=0;ka<l.length;ka++)ia=document.createElementNS("http://www.w3.org/2000/svg",+"circle"),ia.setAttribute("cx",l[ka].x),ia.setAttribute("cy",l[ka].y),ia.setAttribute("r",5),ia.setAttribute("fill",ka===n?"#ff4444":"#4285f4"),ia.setAttribute("stroke","#fff"),ia.setAttribute("stroke-width","1.5"),ia.style.cursor="move",ha.appendChild(ia);for(;la.firstChild;)la.removeChild(la.firstChild);for(ka=1;ka<l.length;ka++)"Q"===l[ka].type&&(ia=document.createElementNS("http://www.w3.org/2000/svg","rect"),ia.setAttribute("x",l[ka].cx-5),ia.setAttribute("y",l[ka].cy-5),ia.setAttribute("width",+10),ia.setAttribute("height",10),ia.setAttribute("fill",ka===n?"#ff8800":"#f0a030"),ia.setAttribute("stroke","#fff"),ia.setAttribute("stroke-width","1.5"),ia.style.cursor="move",la.appendChild(ia));r&&2<l.length&&"Q"===l[0].type&&(ka=document.createElementNS("http://www.w3.org/2000/svg","rect"),ka.setAttribute("x",l[0].cx-5),ka.setAttribute("y",l[0].cy-5),ka.setAttribute("width",10),ka.setAttribute("height",10),ka.setAttribute("fill",0===n?"#ff8800":"#f0a030"),ka.setAttribute("stroke","#fff"),ka.setAttribute("stroke-width",+"1.5"),ka.style.cursor="move",la.appendChild(ka));c()}function c(){fa.innerHTML="";if(0===l.length){var ia=document.createElement("div");ia.style.padding="20px 10px";ia.style.textAlign="center";ia.style.opacity="0.5";ia.style.fontSize="12px";mxUtils.write(ia,mxResources.get("clickToAdd"));fa.appendChild(ia)}else for(ia=0;ia<l.length;ia++)(function(ka){var ea=document.createElement("div");ea.style.display="flex";ea.style.alignItems="center";ea.style.padding="2px 4px";ea.style.gap="4px";ea.style.borderRadius=+"3px";ea.style.marginBottom="2px";ea.style.fontSize="12px";ea.setAttribute("draggable","true");ea.setAttribute("data-idx",ka);ka===n&&(ea.style.backgroundColor="rgba(66, 133, 244, 0.15)");ea.style.cursor="pointer";mxEvent.addListener(ea,"click",function(){n=ka;H()});var ja=document.createElement("span");ja.innerHTML="☰";ja.style.cursor="grab";ja.style.fontSize="11px";ja.style.opacity="0.4";ja.style.flexShrink="0";ea.appendChild(ja);ja=document.createElement("span");ja.style.minWidth="18px";+ja.style.fontWeight="bold";mxUtils.write(ja,ka+1+"");ea.appendChild(ja);ja=document.createElement("input");ja.type="number";ja.value=Math.round(l[ka].x);ja.style.width="48px";ja.style.fontSize="11px";ja.style.padding="1px 3px";ja.title="X";mxEvent.addListener(ja,"change",function(){A();l[ka].x=parseInt(this.value)||0;H()});mxEvent.addListener(ja,"click",function(xa){xa.stopPropagation()});ea.appendChild(ja);ja=document.createElement("input");ja.type="number";ja.value=Math.round(l[ka].y);ja.style.width=+"48px";ja.style.fontSize="11px";ja.style.padding="1px 3px";ja.title="Y";mxEvent.addListener(ja,"change",function(){A();l[ka].y=parseInt(this.value)||0;H()});mxEvent.addListener(ja,"click",function(xa){xa.stopPropagation()});ea.appendChild(ja);if(0<ka||0===ka&&r&&2<l.length){ja=document.createElement("label");ja.style.display="flex";ja.style.alignItems="center";ja.style.cursor="pointer";ja.style.flexShrink="0";ja.title=mxResources.get("curved");var ta=document.createElement("input");ta.type="checkbox";+ta.checked="Q"===l[ka].type;ta.style.margin="0";mxEvent.addListener(ta,"click",function(xa){xa.stopPropagation()});mxEvent.addListener(ta,"change",function(){A();if("Q"===l[ka].type)l[ka].type="L",delete l[ka].cx,delete l[ka].cy;else{var xa=0<ka?l[ka-1]:l[l.length-1];var Ea=l[ka];var Ha=(xa.x+Ea.x)/2;var Ja=(xa.y+Ea.y)/2;var Ra=Ea.x-xa.x,Va=Ea.y-xa.y;xa=Math.sqrt(Ra*Ra+Va*Va);0!==xa&&(Ea=.25*xa,Ha=Math.round(Ha+-Va/xa*Ea),Ja=Math.round(Ja+Ra/xa*Ea));l[ka].type="Q";l[ka].cx=Ha;l[ka].cy=Ja}H()});ja.appendChild(ta);+ea.appendChild(ja)}ja=document.createElement("img");ja.setAttribute("src",Editor.trashImage);ja.style.cursor="pointer";ja.style.marginLeft="auto";ja.style.width="14px";ja.style.height="14px";ja.style.opacity="0.5";ja.style.flexShrink="0";ja.title=mxResources.get("delete");Editor.isDarkMode()&&(ja.style.filter="invert(1)");mxEvent.addListener(ja,"click",function(xa){xa.stopPropagation();A();l.splice(ka,1);n>=l.length&&(n=l.length-1);H()});ea.appendChild(ja);mxEvent.addListener(ea,"dragstart",function(xa){I=+ka;ea.style.opacity="0.4";xa.dataTransfer.effectAllowed="move";xa.dataTransfer.setData("text/plain",""+ka);xa.stopPropagation()});mxEvent.addListener(ea,"dragover",function(xa){xa.preventDefault();xa.stopPropagation();xa.dataTransfer.dropEffect="move";xa=parseInt(ea.getAttribute("data-idx"));null!==I&&xa!==I&&(ea.style.borderTop=xa<I?"2px solid #4285f4":"",ea.style.borderBottom=xa>I?"2px solid #4285f4":"")});mxEvent.addListener(ea,"dragleave",function(xa){ea.style.borderTop="";ea.style.borderBottom=+""});mxEvent.addListener(ea,"drop",function(xa){xa.preventDefault();xa.stopPropagation();ea.style.borderTop="";ea.style.borderBottom="";var Ea=parseInt(ea.getAttribute("data-idx"));null!==I&&Ea!==I&&(A(),xa=l.splice(I,1)[0],Ea=Ea>I?Ea-1:Ea,l.splice(Ea,0,xa),n===I?n=Ea:I<n&&Ea>=n?n--:I>n&&Ea<=n&&n++,H());I=null});mxEvent.addListener(ea,"dragend",function(xa){ea.style.opacity="";ea.style.borderTop="";ea.style.borderBottom="";I=null});fa.appendChild(ea)})(ia)}var f=b.editor.graph,l=[],n=-1,r=!0,t=!0,+x=[],B=[],G=-1,L=null,D=!1,T=!1,N=0,R=0,P=400,U=400,S=1,z=!1,g=0,p=0,v=0,C=0,E=!1,I=null,O=f.view.getState(k);if(null!=O)try{var Q=JSON.parse(mxUtils.getValue(O.style,"polyCoords","[]")),V=JSON.parse(mxUtils.getValue(O.style,"polyCurves","[]")),W=mxUtils.getValue(O.style,"polyline",0);r=!(1==W||!0===W||"true"===W||"1"===W);for(O=0;O<Q.length;O++){var M={x:Math.round(400*Q[O][0]),y:Math.round(400*Q[O][1]),type:"L"};0<O&&V.length>O-1&&null!=V[O-1]&&3<=V[O-1].length&&"Q"===V[O-1][0]&&(M.type="Q",M.cx=+Math.round(400*V[O-1][1]),M.cy=Math.round(400*V[O-1][2]));l.push(M)}r&&2<Q.length&&V.length>=Q.length&&null!=V[Q.length-1]&&3<=V[Q.length-1].length&&"Q"===V[Q.length-1][0]&&(l[0].type="Q",l[0].cx=Math.round(400*V[Q.length-1][1]),l[0].cy=Math.round(400*V[Q.length-1][2]))}catch(ia){}var X=document.createElement("div");X.style.userSelect="none";X.setAttribute("tabindex","0");X.style.outline="none";X.style.position="absolute";X.style.left="30px";X.style.right="30px";X.style.top="30px";X.style.bottom=+"30px";Q=document.createElement("div");Q.style.display="flex";Q.style.gap="10px";Q.style.position="absolute";Q.style.left="0px";Q.style.right="0px";Q.style.top="0px";Q.style.bottom="40px";X.appendChild(Q);var Z=document.createElement("div");Z.style.border="1px solid";Z.style.borderColor="inherit";Z.style.borderRadius="4px";Z.style.flexGrow="1";Z.style.flexShrink="1";Z.style.minWidth="200px";Z.style.position="relative";Z.style.overflow="hidden";Q.appendChild(Z);var Y=document.createElementNS("http://www.w3.org/2000/svg",+"svg");Y.setAttribute("width","100%");Y.setAttribute("height","100%");Y.setAttribute("viewBox","0 0 400 400");Y.style.display="block";Y.style.cursor="crosshair";V=document.createElementNS("http://www.w3.org/2000/svg","defs");M=document.createElementNS("http://www.w3.org/2000/svg","pattern");O="polygonGrid_"+Date.now();M.setAttribute("id",O);M.setAttribute("width",20);M.setAttribute("height",20);M.setAttribute("patternUnits","userSpaceOnUse");W=document.createElementNS("http://www.w3.org/2000/svg",+"path");W.setAttribute("d","M 20 0 L 0 0 0 20");W.setAttribute("fill","none");W.setAttribute("stroke","#e0e0e0");W.setAttribute("stroke-width","0.5");M.appendChild(W);V.appendChild(M);Y.appendChild(V);var aa=document.createElementNS("http://www.w3.org/2000/svg","rect");aa.setAttribute("x","-5000");aa.setAttribute("y","-5000");aa.setAttribute("width","10000");aa.setAttribute("height","10000");aa.setAttribute("fill","url(#"+O+")");Y.appendChild(aa);var da=document.createElementNS("http://www.w3.org/2000/svg",+"path");da.setAttribute("fill","rgba(66, 133, 244, 0.1)");da.setAttribute("stroke","#4285f4");da.setAttribute("stroke-width","2");Y.appendChild(da);var ba=document.createElementNS("http://www.w3.org/2000/svg","g");Y.appendChild(ba);var ha=document.createElementNS("http://www.w3.org/2000/svg","g");Y.appendChild(ha);var la=document.createElementNS("http://www.w3.org/2000/svg","g");Y.appendChild(la);Z.appendChild(Y);var ra=document.createElement("div");ra.style.position="absolute";ra.style.bottom="0px";+ra.style.left="0px";ra.style.right="12px";ra.style.height="12px";ra.style.backgroundColor="rgba(128,128,128,0.08)";var sa=document.createElement("div");sa.style.position="absolute";sa.style.top="2px";sa.style.height="8px";sa.style.borderRadius="4px";sa.style.backgroundColor="rgba(128,128,128,0.35)";sa.style.cursor="pointer";sa.style.minWidth="20px";ra.appendChild(sa);Z.appendChild(ra);var va=document.createElement("div");va.style.position="absolute";va.style.top="0px";va.style.right="0px";va.style.bottom=+"12px";va.style.width="12px";va.style.backgroundColor="rgba(128,128,128,0.08)";var wa=document.createElement("div");wa.style.position="absolute";wa.style.left="2px";wa.style.width="8px";wa.style.borderRadius="4px";wa.style.backgroundColor="rgba(128,128,128,0.35)";wa.style.cursor="pointer";wa.style.minHeight="20px";va.appendChild(wa);Z.appendChild(va);var qa=!1,Ba=!1,Aa=0,Da=0;mxEvent.addListener(sa,"mousedown",function(ia){qa=!0;Aa=ia.clientX;Da=N;ia.preventDefault();ia.stopPropagation()});mxEvent.addListener(wa,+"mousedown",function(ia){Ba=!0;Aa=ia.clientY;Da=R;ia.preventDefault();ia.stopPropagation()});mxEvent.addListener(ra,"mousedown",function(ia){if(ia.target===ra){var ka=ra.getBoundingClientRect().width,ea=ia.clientX-ra.getBoundingClientRect().left,ja=1200-P;0<ja&&(N=-400+ea/ka*ja,q());ia.preventDefault();ia.stopPropagation()}});mxEvent.addListener(va,"mousedown",function(ia){if(ia.target===va){var ka=va.getBoundingClientRect().height,ea=ia.clientY-va.getBoundingClientRect().top,ja=1200-U;0<ja&&(R=-400++ea/ka*ja,q());ia.preventDefault();ia.stopPropagation()}});var Ca=function(ia){if(qa){var ka=Z.getBoundingClientRect().width-12,ea=parseFloat(sa.style.width)||20,ja=1200-P;ka>ea&&0<ja&&(N=Da+(ia.clientX-Aa)/(ka-ea)*ja,q());ia.preventDefault()}Ba&&(ka=Z.getBoundingClientRect().height-12,ea=parseFloat(wa.style.height)||20,ja=1200-U,ka>ea&&0<ja&&(R=Da+(ia.clientY-Aa)/(ka-ea)*ja,q()),ia.preventDefault())},ca=function(ia){Ba=qa=!1};mxEvent.addListener(document,"mousemove",Ca);mxEvent.addListener(document,+"mouseup",ca);"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){var ia=Y.getBoundingClientRect();if(0<ia.width&&0<ia.height){var ka=N+P/2,ea=R+U/2;P=ia.width*S;U=ia.height*S;N=ka-P/2;R=ea-U/2;q()}})).observe(Z);var fa=document.createElement("div");fa.style.width="200px";fa.style.flexShrink="0";fa.style.overflowY="auto";fa.style.border="1px solid";fa.style.borderColor="inherit";fa.style.borderRadius="4px";fa.style.padding="4px";Q.appendChild(fa);mxEvent.addGestureListeners(Y,function(ia){if(!E&&+1!==ia.button&&2!==ia.button){var ka=y(ia);if(null!=ka)G=ka.index,L=ka.type,D=!0,T=!1,n=ka.index;else{ka=u(ia);A();if(2>l.length)l.push({x:ka.x,y:ka.y,type:"L"}),n=l.length-1;else{for(var ea=Infinity,ja=l.length-1,ta=r?l.length:l.length-1,xa=0;xa<ta;xa++){var Ea=(xa+1)%l.length;Ea=mxUtils.ptSegDistSq(l[xa].x,l[xa].y,l[Ea].x,l[Ea].y,ka.x,ka.y);Ea<ea&&(ea=Ea,ja=xa)}l.splice(ja+1,0,{x:ka.x,y:ka.y,type:"L"});n=ja+1}G=n;L="vertex";T=D=!0}H();mxEvent.consume(ia)}},function(ia){if(D&&0<=G&&G<l.length){T||+(A(),T=!0);var ka=u(ia);"control"===L?(l[G].cx=ka.x,l[G].cy=ka.y):(l[G].x=ka.x,l[G].y=ka.y);H();mxEvent.consume(ia)}},function(ia){!E&&1!==ia.button&&2!==ia.button&&D&&0<=G&&(D=!1,G=-1,L=null,mxEvent.consume(ia))});mxEvent.addListener(Y,"wheel",function(ia){ia.preventDefault();var ka=Y.getBoundingClientRect(),ea=(ia.clientX-ka.left)/ka.width,ja=(ia.clientY-ka.top)/ka.height,ta=N+ea*P,xa=R+ja*U;S=Math.max(.05,Math.min(5,S*(0<ia.deltaY?1.15:1/1.15)));P=ka.width*S;U=ka.height*S;N=ta-ea*P;R=xa-ja*U;q()});+mxEvent.addListener(Y,"contextmenu",function(ia){ia.preventDefault()});mxEvent.addListener(Y,"mousedown",function(ia){if(1===ia.button||2===ia.button||0===ia.button&&E)z=!0,g=ia.clientX,p=ia.clientY,v=N,C=R,Y.style.cursor="grabbing",ia.preventDefault()});var oa=function(ia){if(z){var ka=Y.getBoundingClientRect();N=v-(ia.clientX-g)/ka.width*P;R=C-(ia.clientY-p)/ka.height*U;q();ia.preventDefault()}},pa=function(ia){z&&(z=!1,Y.style.cursor=E?"grab":"crosshair")};mxEvent.addListener(document,"mousemove",+oa);mxEvent.addListener(document,"mouseup",pa);Q=document.createElement("div");Q.style.display="flex";Q.style.alignItems="center";Q.style.gap="6px";Q.style.position="absolute";Q.style.left="0px";Q.style.right="0px";Q.style.bottom="0px";Q.style.height="34px";var ua=b.createToolbarButton(Editor.undoImage,mxResources.get("undo"),function(){J()});Q.appendChild(ua);var ya=b.createToolbarButton(Editor.redoImage,mxResources.get("redo"),function(){K()});Q.appendChild(ya);V=b.createToolbarButton(Editor.zoomInImage,+mxResources.get("zoomIn"),function(){d(S/1.15)});Q.appendChild(V);V=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){d(1.15*S)});Q.appendChild(V);V=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){var ia=Y.getBoundingClientRect();if(0<ia.width&&0<ia.height){if(1==S)if(0<l.length){for(var ka=l[0].x,ea=l[0].y,ja=l[0].x,ta=l[0].y,xa=1;xa<l.length;xa++)ka=Math.min(ka,l[xa].x),ea=Math.min(ea,l[xa].y),ja=Math.max(ja,l[xa].x),ta=Math.max(ta,l[xa].y),+"Q"===l[xa].type&&(ka=Math.min(ka,l[xa].cx),ea=Math.min(ea,l[xa].cy),ja=Math.max(ja,l[xa].cx),ta=Math.max(ta,l[xa].cy));ja=ja-ka+40;ta=ta-ea+40;S=1/Math.min(ia.width/ja,ia.height/ta);P=ia.width*S;U=ia.height*S;N=ka-20+(ja-P)/2;R=ea-20+(ta-U)/2}else S=1,P=ia.width,U=ia.height,N=(400-P)/2,R=(400-U)/2;else S=1,P=ia.width*S,U=ia.height*S,N=(400-P)/2,R=(400-U)/2;q()}});Q.appendChild(V);V=mxUtils.button(mxResources.get("deleteAll"),function(){0<l.length&&(A(),l=[],n=-1,H())});V.className="geBtn";V.style.padding=+"2px 10px";V.style.fontSize="12px";Q.appendChild(V);V=document.createElement("span");V.style.flexGrow="1";Q.appendChild(V);V=document.createElement("label");V.style.display="flex";V.style.alignItems="center";V.style.gap="4px";V.style.fontSize="12px";V.style.cursor="pointer";V.style.whiteSpace="nowrap";M=document.createElement("input");M.type="checkbox";M.checked=t;mxEvent.addListener(M,"change",function(){t=this.checked;aa.style.display=t?"":"none"});V.appendChild(M);mxUtils.write(V,mxResources.get("grid"));+Q.appendChild(V);V=document.createElement("label");V.style.display="flex";V.style.alignItems="center";V.style.gap="4px";V.style.fontSize="12px";V.style.cursor="pointer";V.style.whiteSpace="nowrap";M=document.createElement("input");M.type="checkbox";M.checked=r;mxEvent.addListener(M,"change",function(){r=this.checked;H()});V.appendChild(M);mxUtils.write(V,mxResources.get("closePath"));Q.appendChild(V);V=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});V.className="geBtn";M=mxUtils.button(mxResources.get("apply"),+function(){if(2>l.length)b.showError(mxResources.get("error"),mxResources.get("minTwoPoints"),mxResources.get("ok"));else{for(var ia=l[0].x,ka=l[0].x,ea=l[0].y,ja=l[0].y,ta=0;ta<l.length;ta++)ia=Math.min(ia,l[ta].x),ka=Math.max(ka,l[ta].x),ea=Math.min(ea,l[ta].y),ja=Math.max(ja,l[ta].y),"Q"===l[ta].type&&(ia=Math.min(ia,l[ta].cx),ka=Math.max(ka,l[ta].cx),ea=Math.min(ea,l[ta].cy),ja=Math.max(ja,l[ta].cy));var xa=ka-ia,Ea=ja-ea,Ha=function(Ra){return 0<xa?Math.round((Ra-ia)/xa*1E5)/1E5:.5},Ja=function(Ra){return 0<+Ea?Math.round((Ra-ea)/Ea*1E5)/1E5:.5};ka=[];ja=[];for(ta=0;ta<l.length;ta++)ka.push([Ha(l[ta].x),Ja(l[ta].y)]),0<ta&&("Q"===l[ta].type?ja.push(["Q",Ha(l[ta].cx),Ja(l[ta].cy)]):ja.push([]));r&&2<l.length&&"Q"===l[0].type&&ja.push(["Q",Ha(l[0].cx),Ja(l[0].cy)]);if(null!=m)ta="shape=mxgraph.basic.polygon;polyCoords="+JSON.stringify(ka)+";polyCurves="+JSON.stringify(ja)+";polyline="+(r?"0":"1")+";whiteSpace=wrap;html=1;",m(ta);else{ta=f.getCellGeometry(k);null!=ta&&(ta=ta.clone(),0<xa&&(ta.x+=ia/400*+ta.width,ta.width*=xa/400),0<Ea&&(ta.y+=ea/400*ta.height,ta.height*=Ea/400));f.getModel().beginUpdate();try{null!=ta&&f.getModel().setGeometry(k,ta),f.setCellStyles("polyCoords",JSON.stringify(ka),[k]),f.setCellStyles("polyCurves",JSON.stringify(ja),[k]),f.setCellStyles("polyline",r?"0":"1",[k])}finally{f.getModel().endUpdate()}}b.hideDialog()}});M.className="geBtn gePrimaryBtn";b.editor.cancelFirst?(Q.appendChild(V),Q.appendChild(M)):(Q.appendChild(M),Q.appendChild(V));X.appendChild(Q);mxEvent.addListener(X,+"keydown",function(ia){32===ia.keyCode?(E||(E=!0,Y.style.cursor="grab"),mxEvent.consume(ia)):46===ia.keyCode||8===ia.keyCode?0<=n&&n<l.length&&"INPUT"!==ia.target.tagName&&(A(),l.splice(n,1),n>=l.length&&(n=l.length-1),H(),mxEvent.consume(ia)):90===ia.keyCode&&(ia.ctrlKey||ia.metaKey)?(ia.shiftKey?K():J(),mxEvent.consume(ia)):89===ia.keyCode&&(ia.ctrlKey||ia.metaKey)&&(K(),mxEvent.consume(ia))});mxEvent.addListener(X,"keyup",function(ia){32===ia.keyCode&&(E=!1,z||(Y.style.cursor="crosshair"))});H();+F();this.init=function(){X.focus();var ia=Y.getBoundingClientRect();0<ia.width&&0<ia.height&&(S=1,P=ia.width*S,U=ia.height*S,N=(400-P)/2,R=(400-U)/2,q())};this.destroy=function(){mxEvent.removeListener(document,"mousemove",Ca);mxEvent.removeListener(document,"mouseup",ca);mxEvent.removeListener(document,"mousemove",oa);mxEvent.removeListener(document,"mouseup",pa)};this.container=X};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";Editor.thinGestureImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI4IDQxLjZxLTIuNSAwLTQuMDc1LTEuNjUtMS41NzUtMS42NS0xLjU3NS00LjM1IDAtMi4zNSAxLjEtNC4xIDEuMS0xLjc1IDIuODI1LTIuOTUgMS43MjUtMS4yIDMuNy0xLjgyNVQzMy42NSAyNnEtLjE1LTMuMDUtMS4yNS00LjQyNVQyOS4yNSAyMC4ycS0yLjMgMC00LjE3NSAxLjV0LTQuNDI1IDQuOTVxLTIuNjUgMy40NS00LjYgNS4xLTEuOTUgMS42NS00LjM1IDEuNjUtMi4xIDAtMy42NS0xLjM3NVE2LjUgMzAuNjUgNi41IDI3LjQ1cTAtMiAxLjItNC41MjUgMS4yLTIuNTI1IDMuNS02LjE3NSAxLjMtMS44NSAxLjk3NS0zLjIyNXQuNjc1LTIuMzc1cTAtLjctLjM1LTEuMDUtLjM1LS4zNS0xLjA1LS4zNS0uNzUgMC0xLjYuNDc1UTEwIDEwLjcgOSAxMS45TDcgOS44cTEuMzUtMS41NSAyLjcyNS0yLjI3NVExMS4xIDYuOCAxMi41IDYuOHExLjkgMCAzLjEgMS4yNSAxLjIgMS4yNSAxLjIgMy4yIDAgMS44LS45NzUgMy41NzVRMTQuODUgMTYuNiAxMy4wNSAxOS4zcS0xLjk1IDIuOTUtMi43NzUgNC43dC0uODI1IDMuNjVxMCAxLjYuNzUgMi4yLjc1LjYgMS43NS42IDEuNDUgMCAyLjgyNS0xLjMgMS4zNzUtMS4zIDMuNTc1LTQuMTUgMi45NS0zLjggNS41MjUtNS43NzUgMi41NzUtMS45NzUgNS42NzUtMS45NzUgMy4xNSAwIDUgMi4zMjVUMzYuNiAyNS45aDQuOXYyLjk1aC00LjlxLS40NSA3LjM1LTMuMiAxMC4wNS0yLjc1IDIuNy01LjQgMi43Wm0uMS0yLjk1cTEuODUgMCAzLjY1LTIuMjUgMS44LTIuMjUgMi03LjUtMi44LjE1LTUuNjI1IDIuMDI1VDI1LjMgMzUuOXEwIDEuMy43NSAyLjAyNS43NS43MjUgMi4wNS43MjVaIi8+PC9zdmc+";Editor.thinShapesImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI5Ljc1IDI5Ljc1Wm0tMTMgNS40NXEuNC4wNS43NS4wNUgxOS4wNXY0LjY1cTAgLjI1LjE3NS40MjV0LjQyNS4xNzVIMzkuOXEuMjUgMCAuNDI1LS4xNzV0LjE3NS0uNDI1VjE5LjY1cTAtLjI1LS4xNzUtLjQyNXQtLjQyNS0uMTc1aC00LjY1VjE3LjVxMC0uMzUtLjA1LS43NWg0LjdxMS4xNSAwIDIgLjg3NS44NS44NzUuODUgMi4wMjVWMzkuOXEwIDEuMTUtLjg1IDItLjg1Ljg1LTIgLjg1SDE5LjY1cS0xLjE1IDAtMi4wMjUtLjg1dC0uODc1LTJabTEuNS0zLjk1cS01LjQ1IDAtOS4yMjUtMy44LTMuNzc1LTMuOC0zLjc3NS05LjIgMC01LjQ1IDMuNzc1LTkuMjI1UTEyLjggNS4yNSAxOC4yNSA1LjI1cTUuNCAwIDkuMiAzLjc3NSAzLjggMy43NzUgMy44IDkuMjI1IDAgNS40LTMuOCA5LjItMy44IDMuOC05LjIgMy44Wm0tLjA1LTIuM3E0LjQ1IDAgNy42LTMuMTI1IDMuMTUtMy4xMjUgMy4xNS03LjU3NXQtMy4xMjUtNy42UTIyLjcgNy41IDE4LjI1IDcuNXQtNy42IDMuMTI1UTcuNSAxMy43NSA3LjUgMTguMnQzLjEyNSA3LjZxMy4xMjUgMy4xNSA3LjU3NSAzLjE1Wm0uMDUtMTAuN1oiLz48L3N2Zz4=";@@ -13505,185 +13508,186 @@ break}O=g.charCodeAt(v++);p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxv&&v({message:mxResources.get("error")+" "+M.getStatus()})},V,this.timeout,function(){E&&null!=v&&v({code:App.ERROR_TIMEOUT,retry:W})},Q)});W()}catch(M){null!=v&&v(M)}};Editor.prototype.getErrorMessage=function(g){var p=mxResources.get("error")+" "+g.getStatus();try{var v=g.getText(),C=JSON.parse(v);null!=C&&null!=C.error&&null!=C.error.message&&(p=C.error.message+" ("+p+")")}catch(E){}return p};Editor.prototype.absoluteCssFonts=function(g){var p=null;if(null!=g){var v=g.split("url(");if(0<v.length){p=[v[0]];g=window.location.pathname;var C=null!=g?g.lastIndexOf("/"):-1;0<=C&&(g=g.substring(0,C+1));C=document.getElementsByTagName("base");var E=null;null!=C&&0<C.length&&(E=C[0].getAttribute("href"));for(var I=1;I<v.length;I++)if(C=v[I].indexOf(")"),0<C){var O=Editor.trimCssUrl(v[I].substring(0,C));this.graph.isRelativeUrl(O)&&(O=null!=E?E+O:window.location.protocol+"//"+window.location.hostname+("/"==O.charAt(0)?"":g)+O);p.push('url("'+O+'"'+v[I].substring(C))}else p.push(v[I])}else p=[g]}return null!=p?p.join(""):null};Editor.prototype.mapFontUrl=function(g,p,v){/^https?:\/\//.test(p)&&!this.isCorsEnabledForUrl(p)&&(p=PROXY_URL+"?url="+encodeURIComponent(p));v(g,p)};Editor.prototype.embedCssFonts=function(g,p){var v=g.split("url("),C=0;null==this.cachedFonts&&(this.cachedFonts={});var E=mxUtils.bind(this,function(){if(0==C){for(var V=[v[0]],W=1;W<v.length;W++){var M=v[W].indexOf(")");V.push('url("');V.push(this.cachedFonts[Editor.trimCssUrl(v[W].substring(0,M))]);V.push('"'+v[W].substring(M))}p(V.join(""))}});-if(0<v.length){for(g=1;g<v.length;g++){var I=v[g].indexOf(")"),O=null,Q=v[g].indexOf("format(",I);0<Q&&(O=Editor.trimCssUrl(v[g].substring(Q+7,v[g].indexOf(")",Q))));mxUtils.bind(this,function(V){if(null==this.cachedFonts[V]){this.cachedFonts[V]=V;C++;var W="application/x-font-ttf";if("svg"==O||/(\.svg)($|\?)/i.test(V))W="image/svg+xml";else if("otf"==O||"embedded-opentype"==O||/(\.otf)($|\?)/i.test(V))W="application/x-font-opentype";else if("woff"==O||/(\.woff)($|\?)/i.test(V))W="application/font-woff";-else if("woff2"==O||/(\.woff2)($|\?)/i.test(V))W="application/font-woff2";else if("eot"==O||/(\.eot)($|\?)/i.test(V))W="application/vnd.ms-fontobject";else if("sfnt"==O||/(\.sfnt)($|\?)/i.test(V))W="application/font-sfnt";this.mapFontUrl(W,V,mxUtils.bind(this,function(M,X){this.loadUrl(X,mxUtils.bind(this,function(Z){this.cachedFonts[V]=Z;C--;E()}),mxUtils.bind(this,function(Z){C--;E()}),!0,null,"data:"+M+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(v[g].substring(0,I)),O)}E()}else p(g)};Editor.prototype.loadFonts=-function(g){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(p){this.resolvedFontCss=p;null!=g&&g()})):null!=g&&g()};Editor.prototype.createGoogleFontCache=function(){var g={},p;for(p in Graph.fontMapping)Graph.isCssFontUrl(p)&&(g[p]=Graph.fontMapping[p]);return g};Editor.prototype.embedExtFonts=function(g){var p=this.graph.getCustomFonts();if(0<p.length){var v=[],C=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());-for(var E=mxUtils.bind(this,function(){0==C&&this.embedCssFonts(v.join(""),g)}),I=0;I<p.length;I++)mxUtils.bind(this,function(O,Q){Graph.isCssFontUrl(Q)?null==this.cachedGoogleFonts[Q]?(C++,this.loadUrl(Graph.rewriteGoogleFontUrl(Q),mxUtils.bind(this,function(V){this.cachedGoogleFonts[Q]=V;v.push(V+"\n");C--;E()}),mxUtils.bind(this,function(V){C--;v.push("@import url("+Q+");\n");E()}))):v.push(this.cachedGoogleFonts[Q]+"\n"):v.push('@font-face {font-family: "'+O+'";src: url("'+Q+'")}\n')})(p[I].name,-p[I].url);E()}else g()};Editor.prototype.addMathCss=function(g){g=g.getElementsByTagName("defs");if(null!=g&&0<g.length)for(var p=document.getElementsByTagName("style"),v=0;v<p.length;v++){var C=mxUtils.getTextContent(p[v]);0>C.indexOf("mxPageSelector")&&0<C.indexOf("MathJax")&&g[0].appendChild(p[v].cloneNode(!0))}};Editor.prototype.addFontCss=function(g,p){p=null!=p?p:this.absoluteCssFonts(this.fontCss);if(null!=p){var v=mxUtils.getSvgDefs(g),C=p.split("\n");p=[];for(var E=[],I=0;I<C.length;I++)"@import"==-C[I].substring(0,7)?p.push(C[I]):E.push(C[I]);g=g.ownerDocument;g=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"style"):g.createElement("style");g.setAttribute("type","text/css");0<p.length&&(mxUtils.setTextContent(g,p.join("\n")),v.appendChild(g));0<E.length&&(g=g.cloneNode(!1),mxUtils.setTextContent(g,E.join("\n")),v.appendChild(g))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(g,-p,v){var C=mxClient.IS_FF?8192:16384;return Math.min(v,Math.min(C/g,C/p))};Editor.prototype.exportToCanvas=function(g,p,v,C,E,I,O,Q,V,W,M,X,Z,Y,aa,da,ba,ha){try{I=null!=I?I:!0;O=null!=O?O:!0;X=null!=X?X:this.graph;Z=null!=Z?Z:0;var la=V?null:X.background;la==mxConstants.NONE&&(la=null);null==la&&(la=C);null==la&&0==V&&(la="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(X.getSvg(null,null,Z,Y,null,O,null,null,null,W,null,da,ba,ha),mxUtils.bind(this,function(ra){try{ra.style.setProperty("-webkit-font-smoothing",-"antialiased");ra.style.setProperty("-moz-osx-font-smoothing","grayscale");var sa=new Image;sa.onload=mxUtils.bind(this,function(){try{var wa=function(){mxClient.IS_SF?window.setTimeout(function(){Da.drawImage(sa,0,0);g(qa,ra)},0):(Da.drawImage(sa,0,0),g(qa,ra))},qa=document.createElement("canvas"),Ba=parseInt(ra.getAttribute("width")),Aa=parseInt(ra.getAttribute("height"));Q=null!=Q?Q:1;null!=p&&(Q=I?Math.min(1,Math.min(3*p/(4*Aa),p/Ba)):p/Ba);Q=this.getMaxCanvasScale(Ba,Aa,Q);Ba=Math.ceil(Q*Ba);-Aa=Math.ceil(Q*Aa);qa.setAttribute("width",Ba);qa.setAttribute("height",Aa);var Da=qa.getContext("2d");if(null!=la){var Ca=mxUtils.getLightDarkColor(la);Da.beginPath();Da.rect(0,0,Ba,Aa);Da.fillStyle="dark"==da&&"none"!=X.getAdaptiveColors()?Ca.dark:Ca.light;Da.fill()}1!=Q&&Da.scale(Q,Q);if(aa){var ca=X.view,fa=ca.scale;ca.scale=1;var oa=btoa(unescape(encodeURIComponent(ca.createSvgGrid(ca.gridColor))));ca.scale=fa;oa="data:image/svg+xml;base64,"+oa;var pa=X.gridSize*ca.gridSteps*Q,ua=X.getGraphBounds(),-ya=ca.translate.x*fa,ia=ca.translate.y*fa,ka=ya+(ua.x-ya)/fa-Z,ea=ia+(ua.y-ia)/fa-Z,ja=new Image;ja.onload=function(){try{for(var ta=-Math.round(pa-mxUtils.mod((ya-ka)*Q,pa)),xa=-Math.round(pa-mxUtils.mod((ia-ea)*Q,pa));ta<Ba;ta+=pa)for(var Ea=xa;Ea<Aa;Ea+=pa)Da.drawImage(ja,ta/Q,Ea/Q);wa()}catch(Ha){null!=E&&E(Ha)}};ja.onerror=function(ta){null!=E&&E(ta)};ja.src=oa}else wa()}catch(ta){null!=E&&E(ta)}});sa.onerror=function(wa){null!=E&&E(wa)};W&&this.graph.addSvgShadow(ra);this.graph.mathEnabled&&-this.addMathCss(ra);var va=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(ra,this.resolvedFontCss),sa.src=Editor.createSvgDataUri(mxUtils.getXml(ra))}catch(wa){null!=E&&E(wa)}});this.embedExtFonts(mxUtils.bind(this,function(wa){try{null!=wa&&this.addFontCss(ra,wa),this.loadFonts(va)}catch(qa){null!=E&&E(qa)}}))}catch(wa){null!=E&&E(wa)}}),v,M)}catch(ra){null!=E&&E(ra)}};Editor.crcTable=[];for(var q=0;256>q;q++)for(var u=q,y=0;8>y;y++)u=1==(u&1)?3988292384^u>>>1:u>>>1,-Editor.crcTable[q]=u;Editor.updateCRC=function(g,p,v,C){for(var E=0;E<C;E++)g=Editor.crcTable[(g^p.charCodeAt(v+E))&255]^g>>>8;return g};Editor.crc32=function(g){for(var p=-1,v=0;v<g.length;v++)p=p>>>8^Editor.crcTable[(p^g.charCodeAt(v))&255];return(p^-1)>>>0};Editor.writeGraphModelToPng=function(g,p,v,C,E){function I(M,X){var Z=V;V+=X;return M.substring(Z,V)}function O(M){M=I(M,4);return M.charCodeAt(3)+(M.charCodeAt(2)<<8)+(M.charCodeAt(1)<<16)+(M.charCodeAt(0)<<24)}function Q(M){return String.fromCharCode(M>>-24&255,M>>16&255,M>>8&255,M&255)}g=g.substring(g.indexOf(",")+1);g=window.atob?atob(g):Base64.decode(g,!0);var V=0;if(I(g,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=E&&E();else if(I(g,4),"IHDR"!=I(g,4))null!=E&&E();else{I(g,17);E=g.substring(0,V);do{var W=O(g);if("IDAT"==I(g,4)){E=g.substring(0,V-8);"pHYs"==p&&"dpi"==v?(v=Math.round(C/.0254),v=Q(v)+Q(v)+String.fromCharCode(1)):v=v+String.fromCharCode(0)+("zTXt"==p?String.fromCharCode(0):"")+C;C=4294967295;C=Editor.updateCRC(C,-p,0,4);C=Editor.updateCRC(C,v,0,v.length);E+=Q(v.length)+p+v+Q(C^4294967295);E+=g.substring(V-8,g.length);break}E+=g.substring(V-8,V-4+W);I(g,W);I(g,4)}while(W);return"data:image/png;base64,"+(window.btoa?btoa(E):Base64.encode(E,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var A=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(g,p){A.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};-var J=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){J.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(g,p,v){var C=null;if(null!=v)return null;null!=g.editor.graph.getModel().getParent(p)?C=p.getId():null!=g.currentPage&&(C=g.currentPage.getId());return C});if(null!=window.StyleFormatPanel){var K=Format.prototype.init;Format.prototype.init=-function(){K.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var H=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?H.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(g){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var G=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=-function(g){g=G.apply(this,arguments);var p=this.editorUi,v=p.editor.graph;if(v.isEnabled()){var C=p.getCurrentFile();null!=C&&C.isAutosaveOptional()&&g.appendChild(this.createOption(mxResources.get("autosave"),function(){return p.editor.autosave},function(I){p.editor.setAutosave(I);p.editor.autosave&&C.isModified()&&C.fileChanged()},{install:function(I){this.listener=function(){I(p.editor.autosave)};p.editor.addListener("autosaveChanged",this.listener)},destroy:function(){p.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&-v.isEnabled()&&"undefined"!==typeof MathJax){var E=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return v.mathEnabled},function(I){p.actions.get("mathematicalTypesetting").funct()},{install:function(I){this.listener=function(){I(v.mathEnabled)};p.addListener("mathEnabledChanged",this.listener)},destroy:function(){p.removeListener(this.listener)}});g.appendChild(E);(!p.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&E.appendChild(p.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return g};-mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(g,p){return 0<mxUtils.getValue(g.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.ellipse.prototype.customProperties=-[{name:"centerRadius",dispName:"Center Radius",type:"float",min:0,defVal:0},{name:"centerColor",dispName:"Center Color",type:"color",defVal:null,primary:!0,isVisible:function(g,p){return 0<mxUtils.getValue(g.style,"centerRadius",0)}}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=-[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",-dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},-{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2,isVisible:function(g){return"0"==mxUtils.getValue(g.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(g){return"1"==mxUtils.getValue(g.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,-defVal:.25,isVisible:function(g){return"0"==mxUtils.getValue(g.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:25,isVisible:function(g){return"1"==mxUtils.getValue(g.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,-min:0,max:1},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",-dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder3.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlState.prototype.customProperties=-[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.step.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",type:"float",min:0,defVal:20},{name:"fixedSize",dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},-{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.note2.prototype.customProperties=-[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.card.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20},-{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",dispName:"Left"},-{val:"right",dispName:"Right"}]},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},{name:"swimlaneBody",-dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},{name:"separatorColor",dispName:"Separator Color",type:"color",defVal:null},{name:"fixedHeader",dispName:"Fixed Header",type:"bool",defVal:!0,getDefaultValue:function(g,p){g=mxCellRenderer.defaultShapes[mxUtils.getValue(g.style,"shape","")];return null!=g&&null!=g.prototype.fixedHeaderDefault?g.prototype.fixedHeaderDefault?"1":"0":"1"}}];mxCellRenderer.defaultShapes.table.prototype.customProperties=-[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=-mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",-min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0},{name:"imageAlign",-dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},{name:"imageVerticalAlign",dispName:"Image Vertical Align",type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",type:"float",min:0,defVal:24},{name:"arcSize",-dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(g,p){return 0<mxUtils.getValue(g.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=-[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",-min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=-[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.cross.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.corner.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.tee.prototype.customProperties=-[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.umlLifeline.prototype.customProperties=[{name:"participant",dispName:"Participant",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName:"Actor"},{val:"umlBoundary",dispName:"Boundary"},{val:"umlEntity",dispName:"Entity"},{val:"umlControl",dispName:"Control"}]},{name:"size",dispName:"Height",type:"float",defVal:40,-min:0},{name:"lifelineMirror",dispName:"Mirror Head",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:"width",dispName:"Title Width",type:"float",defVal:60,min:0},{name:"height",dispName:"Title Height",type:"float",defVal:30,min:0}];StyleFormatPanel.prototype.defaultColorSchemes=[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",-stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},-{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},-{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",-stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;var c=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var g=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&0<g.cells.length&&-this.container.appendChild(this.addStyles(this.createPanel()));c.apply(this,arguments);null!=g.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),g.customProperties,g))};var f=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(g){var p=this.editorUi.getSelectionState();1==p.cells.length?this.addActions(g,["copyStyle","pasteStyle"]):1<=p.cells.length&&this.addActions(g,["pasteStyle","pasteData"]);f.apply(this,arguments);return g};-EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(g,p,v,C){function E(Ca){try{return decodeURIComponent(Ca)}catch(ca){return Ca}}function I(Ca,ca,fa,oa,pa){if(null!=fa.valueChanged)fa.valueChanged(ca,pa,v,Z);else{Y.getModel().beginUpdate();try{pa=[];var ua=[];if(null!=fa.index){for(var ya=[],ia=fa.parentRow.nextSibling;ia&&ia.getAttribute("data-pName")==Ca;)ya.push(ia.getAttribute("data-pValue")),ia=ia.nextSibling;fa.index<ya.length?null!=oa?ya.splice(oa,1):-ya[fa.index]=ca:ya.push(ca);null!=fa.size&&ya.length>fa.size&&(ya=ya.slice(0,fa.size));ca=ya.join(",");null!=fa.countProperty&&(Y.setCellStyles(fa.countProperty,ya.length,Y.getSelectionCells()),pa.push(fa.countProperty),ua.push(ya.length))}Y.setCellStyles(Ca,ca,Y.getSelectionCells());pa.push(Ca);ua.push(ca);if(null!=fa.dependentProps)for(Ca=0;Ca<fa.dependentProps.length;Ca++){var ka=fa.dependentPropsDefVal[Ca],ea=fa.dependentPropsVals[Ca];if(ea.length>ca)ea=ea.slice(0,ca);else for(var ja=ea.length;ja<-ca;ja++)ea.push(ka);ea=ea.join(",");Y.setCellStyles(fa.dependentProps[Ca],ea,Y.getSelectionCells());pa.push(fa.dependentProps[Ca]);ua.push(ea)}if("function"==typeof fa.onChange)fa.onChange(Y,ca);Z.editorUi.fireEvent(new mxEventObject("styleChanged","keys",pa,"values",ua,"cells",Y.getSelectionCells()))}finally{Y.getModel().endUpdate()}}}function O(Ca,ca){ca.style.left="0px";ca.style.top="0px";ca.style.position="relative";ca.style.right="0px";ca.style.bottom="0px";ca.style.width="100%";ca.style.maxWidth=-"100%";ca.style.maxHeight="100%";ca.style.textAlign="left"}function Q(Ca,ca,fa){function oa(ua){if(null==ua||ua==mxConstants.NONE)pa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==ua)pa.style.background="";else{var ya=mxUtils.getLightDarkColor(ua);mxUtils.isLightDarkColor(ua)&&ya.light!=ya.dark?pa.style.background="linear-gradient(to right bottom, "+ya.cssText+" 50%, "+mxUtils.invertLightDarkColor(ya).cssText+" 50.3%)":pa.style.background=ua}}var pa=document.createElement("div");-pa.style.width="32px";pa.style.height="8px";pa.style.margin="2px";pa.style.borderStyle="solid";pa.style.borderWidth="1px";oa(ca);btn=mxUtils.button("",mxUtils.bind(Z,function(ua){this.editorUi.pickColor(ca,function(ya){I(Ca,ya,fa);oa(ya)});mxEvent.consume(ua)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(pa);return btn}function V(Ca,ca,fa,oa,pa,ua,ya){null!=ca&&(ca=ca.split(","),aa.push({name:Ca,values:ca,-type:fa,defVal:oa,countProperty:pa,parentRow:ua,isDeletable:!0,flipBkg:ya}));btn=mxUtils.button("+",mxUtils.bind(Z,function(ia){for(var ka=ua,ea=0;null!=ka.nextSibling;)if(ka.nextSibling.getAttribute("data-pName")==Ca)ka=ka.nextSibling,ea++;else break;var ja={type:fa,parentRow:ua,index:ea,isDeletable:!0,defVal:oa,countProperty:pa};ea=X(Ca,"",ja,0==ea%2,ya);I(Ca,oa,ja);ka.parentNode.insertBefore(ea,ka.nextSibling);mxEvent.consume(ia)}));btn.style.height="16px";btn.style.width="25px";btn.className=-"geColorBtn";return btn}function W(Ca,ca,fa,oa,pa,ua,ya){if(0<pa){var ia=Array(pa);ca=null!=ca?ca.split(","):[];for(var ka=0;ka<pa;ka++)ia[ka]=null!=ca[ka]?ca[ka]:null!=oa?oa:"";aa.push({name:Ca,values:ia,type:fa,defVal:oa,parentRow:ua,flipBkg:ya,size:pa})}return document.createElement("div")}function M(Ca,ca,fa){var oa=document.createElement("input");oa.type="checkbox";oa.checked="1"==ca;mxEvent.addListener(oa,"change",function(){I(Ca,oa.checked?"1":"0",fa,null,oa)});return oa}function X(Ca,ca,fa,-oa,pa){var ua=fa.dispName,ya=fa.type,ia=document.createElement("tr");ia.className="gePropRow"+(pa?"Dark":"")+(oa?"Alt":"")+" gePropNonHeaderRow";ia.setAttribute("data-pName",Ca);ia.setAttribute("data-pValue",ca);oa=!1;null!=fa.index&&(ia.setAttribute("data-index",fa.index),ua=(null!=ua?ua:"")+"["+fa.index+"]",oa=!0);var ka=document.createElement("td");ka.className="gePropRowCell";ua=mxResources.get(ua,null,ua);mxUtils.write(ka,ua);ka.setAttribute("title",ua);oa&&(ka.style.textAlign="right");ia.appendChild(ka);-ka=document.createElement("td");ka.className="gePropRowCell";ka.setAttribute("title",null!=ca?E(ca):mxResources.get("none"));mxEvent.addListener(ka,"click",mxUtils.bind(Z,function(xa){!mxUtils.isAncestorNode(ia,document.activeElement)&&mxUtils.isAncestorNode(ia.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(xa))}));if("color"==ya)ka.appendChild(Q(Ca,ca,fa));else if("bool"==ya||"boolean"==ya)ka.appendChild(M(Ca,-ca,fa));else if("enum"==ya){var ea=fa.enumList;ka.innerHTML="";var ja=document.createElement("div");ja.className="gePropValue";ka.appendChild(ja);for(pa=0;pa<ea.length;pa++)if(ua=ea[pa],ua.val==ca){mxUtils.write(ja,mxResources.get(ua.dispName,null,ua.dispName));break}mxEvent.addListener(ka,"click",mxUtils.bind(Z,function(xa){var Ea=mxEvent.getSource(xa);if(!(Ea!=ka&&Ea!=ja||mxEvent.isConsumed(xa))){ja.innerHTML="";var Ha=document.createElement("select"),Ja=null;O(ka,Ha);Ha.style.boxSizing="border-box";-Ha.style.height="100%";Ha.style.padding="0";Ha.style.margin="0";Ha.style.border="0";for(xa=0;xa<ea.length;xa++){Ea=ea[xa];var Ra=document.createElement("option");Ra.value=mxUtils.htmlEntities(Ea.val);mxUtils.write(Ra,mxResources.get(Ea.dispName,null,Ea.dispName));Ha.appendChild(Ra);null==Ea.val&&(Ra.value="null",Ja=Ra)}Ha.value=null==ca&&null!=Ja?"null":ca;ja.appendChild(Ha);mxEvent.addListener(Ha,"change",function(){var Va=mxUtils.htmlEntities(Ha.value);if(Ha[Ha.selectedIndex]==Ja||"null"==Va.value)Va=-null;I(Ca,Va,fa)});Ha.focus();mxEvent.addListener(Ha,"blur",function(){ja.innerHTML="";for(var Va=Ha[Ha.selectedIndex]==Ja||"null"==Ha.value?null:Ha.value,bb=0;bb<ea.length;bb++){var ab=ea[bb];if(ab.val==Va){mxUtils.write(ja,mxResources.get(ab.dispName,null,ab.dispName));break}}})}}))}else if("dynamicArr"==ya)ka.appendChild(V(Ca,ca,fa.subType,fa.subDefVal,fa.countProperty,ia,pa));else if("staticArr"==ya)ka.appendChild(W(Ca,ca,fa.subType,fa.subDefVal,fa.size,ia,pa));else if("readOnly"==ya)pa=document.createElement("input"),-pa.setAttribute("readonly",""),pa.value=ca,pa.style.borderWidth="0px","id"==Ca||"shape"==Ca?(ia.firstChild.innerHTML="",ia.firstChild.setAttribute("colspan","2"),pa.style.flexGrow="1",pa.style.marginLeft="4px",pa.style.textAlign="id"==Ca?"center":"left",pa.setAttribute("title",ca),ua=document.createElement("div"),mxUtils.write(ua,mxResources.get(Ca)+":"),ua.style.display="inline-flex",ua.style.alignItems="center",ua.style.width="100%",ua.appendChild(pa),ia.firstChild.appendChild(ua)):(pa.style.width=-"96px",ka.appendChild(pa));else{ka.innerHTML="";var ta=document.createElement("div");ta.className="gePropValue";ka.appendChild(ta);ta.innerHTML=mxUtils.htmlEntities(E(ca));mxEvent.addListener(ka,"click",mxUtils.bind(Z,function(xa){function Ea(){var Ra=Ja.value,Va=ya;Ra=0==Ra.trim().length&&"string"!=Va&&"numbers"!=Va?fa.allowAuto?"auto":0:Ra;fa.allowAuto&&(null!=Ra.trim&&"auto"==Ra.trim().toLowerCase()?(Ra="auto",Va="string"):(Ra=parseFloat(Ra),Ra=isNaN(Ra)?0:Ra));null!=fa.min&&Ra<fa.min?Ra=fa.min:-null!=fa.max&&Ra>fa.max&&(Ra=fa.max);var bb=null;try{bb="numbers"==Va?Ra.match(/\d+/g).map(Number).join(" "):"auto"===Ra&&fa.allowAuto&&"auto"==fa.defVal?null:encodeURIComponent(("int"==Va?parseInt(Ra):Ra)+"")}catch(ab){}I(Ca,bb,fa,null,Ja)}var Ha=mxEvent.getSource(xa);if(!(Ha!=ka&&Ha!=ta||mxEvent.isConsumed(xa))){ta.innerHTML="";var Ja=document.createElement("input");O(ta,Ja);Ja.value=E(ca);Ja.className="gePropEditor";"int"!=ya&&"float"!=ya||fa.allowAuto||(Ja.type="number",Ja.step="int"==ya?"1":-"any",null!=fa.min&&(Ja.min=parseFloat(fa.min)),null!=fa.max&&(Ja.max=parseFloat(fa.max)));ta.appendChild(Ja);mxEvent.addListener(Ja,"keypress",function(Ra){13==Ra.keyCode&&Ea()});Ja.focus();mxEvent.addListener(Ja,"blur",function(){Ea()})}}))}fa.isDeletable&&(pa=mxUtils.button("-",mxUtils.bind(Z,function(xa){I(Ca,"",fa,fa.index);mxEvent.consume(xa)})),pa.style.height="16px",pa.style.width="25px",pa.style.float="right",pa.className="geColorBtn",ka.appendChild(pa));ia.appendChild(ka);return ia}var Z=-this,Y=this.editorUi.editor.graph,aa=[],da=document.createElement("table");da.className="geProperties geFullWidthElement";var ba=document.createElement("tr");ba.className="gePropHeader";var ha=document.createElement("th");ha.className="gePropHeaderCell";ha.style.paddingLeft="16px";ha.style.backgroundRepeat="no-repeat";ha.style.backgroundPosition="-2px 50%";ha.style.backgroundSize="20px";mxUtils.write(ha,mxResources.get("property"));ba.style.cursor="pointer";var la=function(){var Ca=da.querySelectorAll(".gePropNonHeaderRow");-if(Z.editorUi.propertiesCollapsed){ha.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var ca="none";for(var fa=g.childNodes.length-1;0<=fa;fa--)try{var oa=g.childNodes[fa],pa=oa.nodeName.toUpperCase();"INPUT"!=pa&&"SELECT"!=pa||g.removeChild(oa)}catch(ua){}}else ha.style.backgroundImage="url('"+Editor.arrowDownImage+"')",ca="";for(fa=0;fa<Ca.length;fa++)Ca[fa].style.display=ca};mxEvent.addListener(ba,"click",function(){Z.editorUi.propertiesCollapsed=!Z.editorUi.propertiesCollapsed;la()});-ba.appendChild(ha);var ra=document.createElement("th");ra.className="gePropHeaderCell";ra.style.paddingLeft="4px";mxUtils.write(ra,mxResources.get("value"));ba.appendChild(ra);da.appendChild(ba);var sa=ra=!1;ba=null;1==v.vertices.length&&0==v.edges.length?ba=v.vertices[0].id:0==v.vertices.length&&1==v.edges.length&&(ba=v.edges[0].id);null==ba||C||(da.appendChild(X("id",mxUtils.htmlEntities(ba),{dispName:"id",type:"readOnly"},!0,!1)),null!=v.style&&null!=v.style.shape&&da.appendChild(X("shape",mxUtils.htmlEntities(v.style.shape),-{dispName:"shape",type:"readOnly"},!0,!1)));for(var va in p)if(C=p[va],("function"!=typeof C.isVisible||C.isVisible(v,this))&&!C.primary){var wa=null!=C.getValue?C.getValue(v,this):null!=v.style[va]?mxUtils.htmlEntities(v.style[va]+""):null!=C.getDefaultValue?C.getDefaultValue(v,this):C.defVal;if("separator"==C.type)sa=!sa;else{if("staticArr"==C.type)C.size=parseInt(v.style[C.sizeProperty]||p[C.sizeProperty].defVal)||0;else if(null!=C.dependentProps){var qa=C.dependentProps,Ba=[],Aa=[];for(ba=0;ba<-qa.length;ba++)if(null!=p[qa[ba]]){var Da=v.style[qa[ba]];Aa.push(p[qa[ba]].subDefVal);Ba.push(null!=Da?Da.split(","):[])}C.dependentPropsDefVal=Aa;C.dependentPropsVals=Ba}da.appendChild(X(va,wa,C,ra,sa));ra=!ra}}for(ba=0;ba<aa.length;ba++)for(C=aa[ba],p=C.parentRow,va=0;va<C.values.length;va++)ra=X(C.name,C.values[va],{type:C.type,parentRow:C.parentRow,isDeletable:C.isDeletable,index:va,defVal:C.defVal,countProperty:C.countProperty,size:C.size},0==va%2,C.flipBkg),p.parentNode.insertBefore(ra,p.nextSibling),-p=ra;g.appendChild(da);la();return g};StyleFormatPanel.prototype.addStyles=function(g){if(null!=this.defaultColorSchemes){var p=this.editorUi,v=p.editor.graph,C=document.createElement("div");C.style.padding="6px 20px 0 24px";g.appendChild(C);var E=document.createElement("div");E.className="geSwitcher";E.style.padding="4px 18px 6px 0px";for(var I=[],O=0;O<this.defaultColorSchemes.length;O++){var Q=document.createElement("div");Q.className="geSwitcherDot";mxUtils.bind(this,function(Z){mxEvent.addListener(Q,-"click",mxUtils.bind(this,function(){V(Z)}))})(O);I.push(Q);E.appendChild(Q)}var V=mxUtils.bind(this,function(Z){null!=I[Z]&&(null!=this.format.currentScheme&&null!=I[this.format.currentScheme]&&(I[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=Z,W(this.defaultColorSchemes[this.format.currentScheme]),I[this.format.currentScheme].style.background="#84d7ff")}),W=mxUtils.bind(this,function(Z){var Y=mxUtils.clone(v.defaultVertexStyle);Y[mxConstants.STYLE_STROKECOLOR]=-null!=Y[mxConstants.STYLE_STROKECOLOR]?Y[mxConstants.STYLE_STROKECOLOR]:"default";Y[mxConstants.STYLE_FILLCOLOR]=null!=Y[mxConstants.STYLE_FILLCOLOR]?Y[mxConstants.STYLE_FILLCOLOR]:"default";Y[mxConstants.STYLE_FONTCOLOR]=null!=Y[mxConstants.STYLE_FONTCOLOR]?Y[mxConstants.STYLE_FONTCOLOR]:"default";v.replaceDefaultColors(new mxCell,Y);var aa=mxUtils.bind(this,function(ba){var ha=mxUtils.button("",mxUtils.bind(this,function(sa){v.getModel().beginUpdate();try{for(var va=p.getSelectionState().cells,-wa=v.getModel(),qa=[],Ba=0<va.length,Aa=0;Aa<va.length;Aa++){var Da=wa.isVertex(va[Aa])&&wa.isEdge(wa.getParent(va[Aa])),Ca=v.getCellStyle(va[Aa]),ca=null!=Ca&&"image"==Ca.shape,fa=v.getCellGeometry(va[Aa]);qa.push({isLabel:ca||Da&&(null==fa||0>=fa.width||0>=fa.height)});Da||ca||(Ba=!1)}for(Aa=0;Aa<va.length;Aa++){var oa=qa[Aa];if(Ba||!oa.isLabel){var pa=oa.isLabel?mxConstants.STYLE_LABEL_BACKGROUNDCOLOR:mxConstants.STYLE_FILLCOLOR,ua=oa.isLabel?mxConstants.STYLE_LABEL_BORDERCOLOR:mxConstants.STYLE_STROKECOLOR,-ya=wa.getStyle(va[Aa]);null!=ya&&"string"!==typeof ya&&(ya=String(ya));null!=ba?(mxEvent.isShiftDown(sa)||(ya=""==ba.fill||null==ba.fill?mxUtils.setStyle(ya,pa,null):mxUtils.setStyle(ya,pa,ba.fill),oa.isLabel||(ya=""==ba.gradient||null==ba.gradient?mxUtils.setStyle(ya,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(ya,mxConstants.STYLE_GRADIENTCOLOR,ba.gradient)),mxEvent.isControlDown(sa)||mxClient.IS_MAC&&mxEvent.isMetaDown(sa)||!wa.isVertex(va[Aa])||(ya=""==ba.font||null==ba.font?mxUtils.setStyle(ya,-mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(ya,mxConstants.STYLE_FONTCOLOR,ba.font))),mxEvent.isAltDown(sa)||(ya=""==ba.stroke||null==ba.stroke?mxUtils.setStyle(ya,ua,null):mxUtils.setStyle(ya,ua,ba.stroke))):(ya=mxUtils.setStyle(ya,pa,null),ya=mxUtils.setStyle(ya,ua,null),oa.isLabel||(ya=mxUtils.setStyle(ya,mxConstants.STYLE_GRADIENTCOLOR,null)),wa.isVertex(va[Aa])&&(ya=mxUtils.setStyle(ya,mxConstants.STYLE_FONTCOLOR,null)));wa.setStyle(va[Aa],ya)}}}finally{v.getModel().endUpdate()}}));ha.className=-"geStyleButton";ha.style.width="36px";ha.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";ha.style.margin="0px 6px 6px 0px";if(null!=ba){var la="1px solid";null!=ba.border&&(la=ba.border);if(null!=ba.gradient)ha.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(ba.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(ba.gradient).cssText+" 100%)";else if(ba.fill==mxConstants.NONE)ha.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==ba.fill||""==ba.fill)ha.style.backgroundColor=-mxUtils.getLightDarkColor(mxUtils.getValue(Y,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var ra=mxUtils.getLightDarkColor(ba.fill);ha.style.backgroundImage="linear-gradient(to right bottom, "+ra.cssText+" 50%, "+ra.light+" 50.3%)"}null==ba.stroke||ba.stroke==mxConstants.NONE?ha.style.border=la+" transparent":""==ba.stroke?ha.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(Y,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(ra=mxUtils.getLightDarkColor(ba.stroke),ha.style.border=-la+" "+ra.cssText,ha.style.borderRightColor=ra.light,ha.style.borderBottomColor=ha.style.borderRightColor);null!=ba.title&&ha.setAttribute("title",ba.title)}else la=mxUtils.getValue(Y,mxConstants.STYLE_FILLCOLOR,"#ffffff"),ra=mxUtils.getValue(Y,mxConstants.STYLE_STROKECOLOR,"#000000"),ha.style.backgroundColor=la,ha.style.border="1px solid "+ra;ha.style.borderRadius="0";C.appendChild(ha);null!=ba&&null!=ba.gradient&&(la=ha.cloneNode(!1),la.style.backgroundImage="linear-gradient(light-dark(transparent, "+-mxUtils.getLightDarkColor(ba.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(ba.gradient).light+") 100%)",la.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",la.style.backgroundColor="transparent",C.appendChild(la),la.style.marginLeft="-42px",mxEvent.addListener(la,"click",function(){ha.click()}))});C.innerText="";if(null!=Z)for(var da=0;da<Z.length;da++)0<da&&0==mxUtils.mod(da,4)&&mxUtils.br(C),aa(Z[da])});null==this.format.currentScheme?V(Math.min(I.length-1,Editor.isDarkMode()?-1:"1"==urlParams.sketch?5:0)):V(this.format.currentScheme);O=10>=this.defaultColorSchemes.length?43:23;var M=document.createElement("div");M.className="geButton";M.style.cssText="position:absolute;left:0px;bottom:"+O+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(M,"click",mxUtils.bind(this,function(){V(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var X=document.createElement("div");X.className="geButton";X.style.cssText="position:absolute;left:186px;bottom:"+-O+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(g.appendChild(M),g.appendChild(X));mxEvent.addListener(X,"click",mxUtils.bind(this,function(){V(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));W(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&g.appendChild(E)}return g}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+-STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(g){return g.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||g.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(g){return Graph.isGoogleFontUrl(g)};Graph.rewriteGoogleFontUrl=function(g){null!=g&&g.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(g=Editor.GOOGLE_FONTS_CSS2+g.substring(Editor.GOOGLE_FONTS.length)+-":wght@400;500");return g};Graph.createFontElement=function(g,p){var v=Graph.fontMapping[p];null==v&&Graph.isCssFontUrl(p)?(g=document.createElement("link"),g.setAttribute("rel","stylesheet"),g.setAttribute("type","text/css"),g.setAttribute("charset","UTF-8"),g.setAttribute("href",Graph.rewriteGoogleFontUrl(p))):(null==v&&(v='@font-face {\nfont-family: "'+g+'";\nsrc: url("'+p+'");\n}'),g=document.createElement("style"),mxUtils.write(g,v));return g};Graph.addRecentCustomFont=function(g,p){};Graph.addFont=-function(g,p,v,C){if(null!=g&&0<g.length&&null!=p&&0<p.length){C=null!=C?C:Graph.customFontElements;var E=g.toLowerCase();if("helvetica"!=E&&"arial"!=g&&"sans-serif"!=E){var I=C[E];null!=I&&I.url!=p&&(I.elt.parentNode.removeChild(I.elt),I=null);null==I?(I=p,"http:"==p.substring(0,5)&&(I=PROXY_URL+"?url="+encodeURIComponent(p)),I={name:g,url:p,elt:Graph.createFontElement(g,I)},C[E]=I,p=C==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=v&&("link"==I.elt.nodeName.toLowerCase()?-(I.elt.onload=v,I.elt.onerror=v):v()),null!=p&&p.appendChild(I.elt)):null!=v&&v()}else null!=v&&v()}else null!=v&&v();return g};Graph.getFontUrl=function(g,p){g=Graph.customFontElements[g.toLowerCase()];null!=g&&(p=g.url);return p};Graph.processFontAttributes=function(g){g=g.getElementsByTagName("*");for(var p=0;p<g.length;p++){var v=g[p].getAttribute("data-font-src");if(null!=v){var C="FONT"==g[p].nodeName?g[p].getAttribute("face"):g[p].style.fontFamily;null!=C&&Graph.addFont(C,v)}}};Graph.processFontStyle=-function(g){if(null!=g){var p=mxUtils.getValue(g,"fontSource",null);if(null!=p){var v=mxUtils.getValue(g,mxConstants.STYLE_FONTFAMILY,null);if(null!=v)try{Graph.addFont(v,decodeURIComponent(p))}catch(C){}}}return g};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;mxConnectionHandler.prototype.createTarget="1"==urlParams.sketch;-Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var l=Graph.prototype.init;Graph.prototype.init=function(){function g(E){p=E}l.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var p=null;mxEvent.addListener(this.container,"mouseenter",g);mxEvent.addListener(this.container,"mousemove",-g);mxEvent.addListener(this.container,"mouseleave",function(E){p=null});this.isMouseInsertPoint=function(){return null!=p};var v=this.getInsertPoint;this.getInsertPoint=function(E){return null==p||E?v.apply(this,arguments):this.getPointForEvent(p)};var C=this.layoutManager.getLayout;this.layoutManager.getLayout=function(E){var I=this.graph.getCellStyle(E);if(null!=I&&"rack"==I.childLayout){var O=new mxStackLayout(this.graph,!1);O.gridSize=null!=I.rackUnitSize?parseFloat(I.rackUnitSize):"undefined"!==-typeof mxRackContainer?mxRackContainer.unitSize:20;O.marginLeft=I.marginLeft||0;O.marginRight=I.marginRight||0;O.marginTop=I.marginTop||0;O.marginBottom=I.marginBottom||0;O.allowGaps=I.allowGaps||0;O.horizontal="1"==mxUtils.getValue(I,"horizontalRack","0");O.resizeParent=!1;O.fill=!0;return O}return C.apply(this,arguments)};this.updateGlobalUrlVariables()};var n=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(g,p){return Graph.processFontStyle(n.apply(this,arguments))};-var r=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(g,p,v,C,E,I,O,Q,V,W,M,X){r.apply(this,arguments);Graph.processFontAttributes(X)};var t=mxText.prototype.redraw;mxText.prototype.redraw=function(){t.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(g,p,v,C){function E(){for(var da=Q.getSelectionCells(),ba=[],ha=0;ha<da.length;ha++)Q.isCellVisible(da[ha])&&ba.push(da[ha]);-Q.setSelectionCells(ba)}function I(da){Q.setHiddenTags(da?[]:V.slice());E();Q.refresh()}function O(da,ba){M.innerText="";if(0<da.length){var ha=document.createElement("table");ha.setAttribute("cellpadding","2");ha.style.boxSizing="border-box";ha.style.tableLayout="fixed";ha.style.width="100%";var la=document.createElement("tbody");if(null!=da&&0<da.length)for(var ra=0;ra<da.length;ra++)(function(sa){function va(){var Ca=Q.getCellsForTags([sa],null,null,!0);Q.isEnabled()?Q.setSelectionCells(Ca):Q.highlightCells(Ca,-null,null,70)}var wa=0>mxUtils.indexOf(Q.hiddenTags,sa),qa=document.createElement("tr"),Ba=document.createElement("td");Ba.style.align="center";Ba.style.width="16px";var Aa=document.createElement("img");Aa.setAttribute("src",wa?Editor.visibleImage:Editor.hiddenImage);Aa.setAttribute("title",mxResources.get(wa?"hideIt":"show",[sa])+"\n"+mxResources.get("shiftClickShowOnly",[sa]));mxUtils.setOpacity(Aa,wa?75:25);Aa.className="geAdaptiveAsset";Aa.style.verticalAlign="middle";Aa.style.cursor="pointer";-Aa.style.width="16px";if(p||Editor.isDarkMode())Aa.style.filter="invert(100%)";Ba.appendChild(Aa);mxEvent.addListener(Aa,"click",function(Ca){if(mxEvent.isShiftDown(Ca)){for(var ca=[],fa=0;fa<V.length;fa++)V[fa]!==sa&&ca.push(V[fa]);var oa=0<ca.length;for(fa=0;fa<ca.length;fa++)if(0>mxUtils.indexOf(Q.hiddenTags,ca[fa])){oa=!1;break}oa&&0>mxUtils.indexOf(Q.hiddenTags,sa)?Q.setHiddenTags([]):Q.setHiddenTags(ca)}else Q.toggleHiddenTag(sa);E();Q.refresh();mxEvent.consume(Ca)});qa.appendChild(Ba);Ba=document.createElement("td");-Ba.style.align="center";Ba.style.width="16px";Aa=document.createElement("img");Aa.setAttribute("src",Editor.selectImage);Aa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Aa,wa?75:25);Aa.className="geAdaptiveAsset";Aa.style.verticalAlign="middle";Aa.style.cursor="pointer";Aa.style.width="16px";if(p||Editor.isDarkMode())Aa.style.filter="invert(100%)";mxEvent.addListener(Aa,"click",function(Ca){I(!0);va();mxEvent.consume(Ca)});Ba.appendChild(Aa);qa.appendChild(Ba);Ba=document.createElement("td");-Ba.style.overflow="hidden";Ba.style.whiteSpace="nowrap";Ba.style.textOverflow="ellipsis";Ba.style.verticalAlign="middle";Ba.style.cursor="pointer";Ba.setAttribute("title",sa);a=document.createElement("a");mxUtils.write(a,sa);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,wa?100:40);Ba.appendChild(a);mxEvent.addListener(Ba,"click",function(Ca){if(mxEvent.isShiftDown(Ca))I(!0),va();else if(wa&&0<Q.hiddenTags.length)I(!0);else{var ca=V.slice(),fa=mxUtils.indexOf(ca,-sa);ca.splice(fa,1);Q.setHiddenTags(ca);E();Q.refresh()}mxEvent.consume(Ca)});qa.appendChild(Ba);if(Q.isEnabled()){Ba=document.createElement("td");Ba.style.verticalAlign="middle";Ba.style.textAlign="center";Ba.style.width="18px";if(null==ba){Ba.style.align="center";Ba.style.width="16px";Aa=document.createElement("img");Aa.setAttribute("src",Editor.trashImage);Aa.setAttribute("title",mxResources.get("removeIt",[sa]));mxUtils.setOpacity(Aa,wa?75:25);Aa.className="geAdaptiveAsset";Aa.style.verticalAlign=-"middle";Aa.style.cursor="pointer";Aa.style.width="16px";if(p||Editor.isDarkMode())Aa.style.filter="invert(100%)";mxEvent.addListener(Aa,"click",function(Ca){var ca=mxUtils.indexOf(V,sa);0<=ca&&V.splice(ca,1);Q.removeTagsForCells(Q.model.getDescendants(Q.model.getRoot()),[sa]);Q.refresh();mxEvent.consume(Ca)});Ba.appendChild(Aa)}else{var Da=document.createElement("input");Da.setAttribute("type","checkbox");Da.style.margin="0px";Da.defaultChecked=null!=ba&&0<=mxUtils.indexOf(ba,sa);Da.checked=Da.defaultChecked;-Da.style.background="transparent";Da.setAttribute("title",mxResources.get(Da.defaultChecked?"removeIt":"add",[sa]));mxEvent.addListener(Da,"change",function(Ca){Da.checked?Q.addTagsForCells(Q.getSelectionCells(),[sa]):Q.removeTagsForCells(Q.getSelectionCells(),[sa]);mxEvent.consume(Ca)});Ba.appendChild(Da)}qa.appendChild(Ba)}la.appendChild(qa)})(da[ra]);ha.appendChild(la);M.appendChild(ha)}}var Q=this,V=Q.hiddenTags.slice(),W=document.createElement("div");W.style.userSelect="none";W.style.overflow=-"hidden";W.style.padding="10px";W.style.height="100%";var M=document.createElement("div");M.style.position="absolute";M.style.boxSizing="border-box";M.style.userSelect="none";M.style.overflow="auto";M.style.padding="3px";M.style.left="0px";M.style.right="0px";M.style.top="0px";M.style.bottom="0px";W.appendChild(M);Q.addListener(mxEvent.ROOT,function(){V=Q.hiddenTags.slice()});var X=mxUtils.bind(this,function(da,ba){if(g()){da=Q.getAllTags();for(ba=0;ba<da.length;ba++)0>mxUtils.indexOf(V,da[ba])&&-V.push(da[ba]);V.sort();Q.isSelectionEmpty()?O(V):O(V,Q.getCommonTagsForCells(Q.getSelectionCells()))}});Q.selectionModel.addListener(mxEvent.CHANGE,X);Q.model.addListener(mxEvent.CHANGE,X);Q.addListener(mxEvent.REFRESH,X);var Z=document.createElement("div");Z.className="geToolbarContainer geDialogToolbar";Z.style.position="absolute";Z.style.display="flex";Z.style.bottom="0px";Z.style.left="0px";Z.style.right="0px";Z.style.height="32px";Z.style.overflow="hidden";Z.style.padding="3px 4px 4px 4px";-Z.style.borderWidth="1px 0px 0px 0px";Z.style.borderStyle="solid";Z.style.whiteSpace="nowrap";if(Q.isEnabled()){M.style.bottom="32px";var Y=document.createElement("a");Y.className="geButton";var aa=Y.cloneNode(!1);aa.style.backgroundImage="url("+Editor.visibleImage+")";aa.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(aa,"click",function(da){Q.setHiddenTags([]);mxEvent.isShiftDown(da)||(V=Q.hiddenTags.slice());E();Q.refresh();mxEvent.consume(da)});Z.appendChild(aa);null!=v&&(Y=-Y.cloneNode(!1),Y.style.backgroundImage="url("+Editor.plusImage+")",Y.setAttribute("title",mxResources.get("add")),mxEvent.addListener(Y,"click",function(da){v(V,function(ba){V=ba;X()});mxEvent.consume(da)}),Z.appendChild(Y));W.appendChild(Z)}null!=C&&Z.appendChild(C);return{div:W,refresh:X}};Graph.prototype.getCustomFonts=function(){var g=this.extFonts;g=null!=g?g.slice():[];for(var p in Graph.customFontElements){var v=Graph.customFontElements[p];g.push({name:v.name,url:v.url})}return g};Graph.prototype.getExtFontCss=-function(){for(var g=this.getCustomFonts(),p="",v="",C=0;C<g.length;C++){var E=g[C].name,I=g[C].url;Graph.isCssFontUrl(I)?p+="@import url("+Graph.rewriteGoogleFontUrl(I)+");\n":v+='@font-face {\nfont-family: "'+E+'";\nsrc: url("'+I+'");\n}\n'}return p+v};Graph.prototype.setFont=function(g,p){Graph.addFont(g,p);var v=Editor.guid();document.execCommand("fontname",!1,v);for(var C=this.cellEditor.textarea.getElementsByTagName("font"),E=!1,I=0;I<C.length;I++)C[I].getAttribute("face")==v&&(E=!0,C[I].setAttribute("face",-g),null!=p?C[I].setAttribute("data-font-src",p):C[I].removeAttribute("data-font-src"));E||document.execCommand("fontname",!1,g)};var x=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return x.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var g=JSON.parse(decodeURIComponent(urlParams.vars));-if(null!=g)for(var p in g)this.globalVars[p]=g[p]}catch(v){null!=window.console&&console.log("Error in vars URL parameter: "+v)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var B=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(g){var p=B.apply(this,arguments);null==p&&null!=this.globalVars&&(p=this.globalVars[g]);return p};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var g=-this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(g.ownerDocument)).decode(g)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var F=Graph.prototype.getSvg;Graph.prototype.getSvg=function(g,p,v,C,E,I,O,Q,V,W,M,X,Z,Y,aa,da,ba){if(Editor.mathOutputSize&&this.mathEnabled&&null!=this.container&&document.body.contains(this.container)&&"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset){if(0==this.container.getElementsByTagName("mjx-container").length)try{MathJax.typeset([this.container])}catch(va){}this.refreshMathBounds()}var ha=-F.apply(this,arguments);if(null!=X){var la=ha.getAttribute("style");null==la&&(la="");X="auto"==X||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":X;ha.setAttribute("style",la+(" color-scheme: "+X+";"))}var ra=M?this.getExtFontCss():"";if(0<ra.length){var sa=ha.ownerDocument;la=null!=sa.createElementNS?sa.createElementNS(mxConstants.NS_SVG,"style"):sa.createElement("style");null!=sa.setAttributeNS?la.setAttributeNS("type","text/css"):la.setAttribute("type","text/css");-la.appendChild(sa.createTextNode(ra));ha.getElementsByTagName("defs")[0].appendChild(la)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(ha);this.mathEnabled&&(document.body.appendChild(ha),Editor.MathJaxRender(ha),ha.parentNode.removeChild(ha),la=ha.ownerDocument.getElementById("MJX-SVG-styles"),null!=la&&ha.getElementsByTagName("defs")[0].appendChild(la.cloneNode(!0)));return ha};var L=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=-function(g){L.apply(this,arguments);null!=g.secondLabel&&(g.secondLabel.destroy(),g.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(g){return[g.shape,g.text,g.secondLabel,g.control]};var D=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){D.apply(this,arguments);this.enumerationState=0};var T=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(g){null!=g.shape&&this.redrawEnumerationState(g);return T.apply(this,-arguments)};mxGraphView.prototype.createEnumerationValue=function(g){g=decodeURIComponent(mxUtils.getValue(g.style,"enumerateValue",""));""==g&&(g=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(g)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(g){var p="1"==mxUtils.getValue(g.style,"enumerate",0);p&&null==g.secondLabel?(g.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),-g.secondLabel.size=12,g.secondLabel.state=g,g.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(g,g.secondLabel)):p||null==g.secondLabel||(g.secondLabel.destroy(),g.secondLabel=null);p=g.secondLabel;if(null!=p){var v=g.view.scale,C=this.createEnumerationValue(g);g=this.graph.model.isVertex(g.cell)?new mxRectangle(g.x+g.width-4*v,g.y+4*v,0,0):mxRectangle.fromPoint(g.view.getPoint(g));p.bounds.equals(g)&&p.value==C&&p.scale==v||(p.bounds=g,p.value=C,p.scale=-v,p.redraw())}};var N=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();N.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var R=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){R.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=-function(g,p){"data:action/json,"==g.substring(0,17)&&(g=JSON.parse(g.substring(17)),null!=g.actions&&this.executeCustomActions(Graph.flattenAnimationActions(g.actions),null,p))};Graph.flattenAnimationActions=function(g){if(!Array.isArray(g))return g;for(var p=[],v=0;v<g.length;v++){var C=g[v];if(null!=C&&null!=C.animation&&Array.isArray(C.animation.steps)){C=Graph.flattenAnimationActions(C.animation.steps);for(var E=0;E<C.length;E++)p.push(C[E])}else p.push(C)}return p};Graph.smoothScrollContainer=-function(g,p,v,C,E,I){I=I||600;if(p!==C||v!==E){g.scrollLeft=p;g.scrollTop=v;var O="undefined"!=typeof performance&&null!=performance.now?performance.now():Date.now(),Q=C-p,V=E-v,W=function(M){M=Math.min(1,(M-O)/I);var X=1-Math.pow(1-M,3);g.scrollLeft=p+Q*X;g.scrollTop=v+V*X;1>M&&window.requestAnimationFrame(W)};window.requestAnimationFrame(W)}};Graph.applyTransformTransition=function(g,p){p=p||600;var v=g.view.getDrawPane(),C=null!=v?v.parentNode:null;if(null!=C){var E=C.style.transition;C.style.transition=-"transform "+p+"ms cubic-bezier(0.16, 1, 0.3, 1)";g.armTransformTransition=!0;var I=function(){C.style.transition=E||"";g.armTransformTransition=!1;C.removeEventListener("transitionend",I)};C.addEventListener("transitionend",I);window.setTimeout(I,p+100)}};Graph.prototype.fitBoundsCssTransform=function(g,p){var v=null!=p?p:10;p=this.view.graphBounds;var C=Math.max(p.x,g.x),E=Math.max(p.y,g.y),I=Math.max(1,Math.min(p.x+p.width,g.x+g.width)-C),O=Math.max(1,Math.min(p.y+p.height,g.y+g.height)-E),Q=this.container.clientWidth--v,V=this.container.clientHeight-v;g=Math.floor(20*Math.min(Q/I,V/O))/20;this.view.scaleAndTranslate(g,-p.x,-p.y);C=(C-p.x)*g-Math.max((Q-I*g)/2+v/2,0);v=(E-p.y)*g-Math.max((V-O*g)/2+v/2,0);I=this.getBorder();E=p.width*g+2*I-this.container.clientWidth;p=p.height*g+2*I-this.container.clientHeight;this.container.scrollLeft=0>E?0:Math.max(0,Math.min(C,E));this.container.scrollTop=0>p?0:Math.max(0,Math.min(v,p))};Graph.prototype.isGraphTornDown=function(){return!0===this.destroyed||null==this.container};-Graph.prototype.smoothFitWindow=function(g,p,v){if(this.isGraphTornDown())null!=v&&v();else{var C=this.container,E=C.scrollLeft,I=C.scrollTop;this.useCssTransforms?(Graph.applyTransformTransition(this,600),this.fitBoundsCssTransform(g,p)):this.fitWindow(g,p);Graph.smoothScrollContainer(C,E,I,C.scrollLeft,C.scrollTop,600);null!=v&&window.setTimeout(v,600)}};Graph.prototype.scrollCellToVisibleCssTransform=function(g,p){var v=this.view.getState(g);if(null!=v){var C=this.view.graphBounds,E=this.view.scale;-this.view.translate.x===-C.x&&this.view.translate.y===-C.y||this.view.scaleAndTranslate(E,-C.x,-C.y);g=this.container.clientWidth;var I=this.container.clientHeight,O=this.getBorder(),Q=C.width*E+2*O-g;O=C.height*E+2*O-I;if(null!=p){var V=(v.x-C.x)*E,W=(v.y-C.y)*E,M=(v.x+v.width-C.x)*E;C=(v.y+v.height-C.y)*E;var X=this.container.scrollLeft;v=this.container.scrollTop;V-p<X?X=V-p:M+p>X+g&&(X=M+p-g);W-p<v?v=W-p:C+p>v+I&&(v=C+p-I)}else X=(v.x+v.width/2-C.x)*E-g/2,v=(v.y+v.height/2-C.y)*E-I/2;this.container.scrollLeft=-0>Q?0:Math.max(0,Math.min(X,Q));this.container.scrollTop=0>O?0:Math.max(0,Math.min(v,O))}};Graph.prototype.scrollCellToVisibleBorder=function(g,p){null==p?this.scrollCellToVisible(g):(g=this.view.getState(g),null!=g&&this.scrollRectToVisible(new mxRectangle(-this.view.translate.x+g.x-p,-this.view.translate.y+g.y-p,g.width+2*p,g.height+2*p)))};Graph.prototype.smoothScrollCellToVisible=function(g,p,v){if(this.isGraphTornDown())null!=v&&v();else{var C=this.container,E=C.scrollLeft,I=C.scrollTop;this.useCssTransforms?-this.scrollCellToVisibleCssTransform(g,p):this.scrollCellToVisibleBorder(g,p);Graph.smoothScrollContainer(C,E,I,C.scrollLeft,C.scrollTop,600);null!=v&&window.setTimeout(v,600)}};Graph.prototype.toggleCellsTransient=function(g){g=this.getNodesForCells(g);for(var p=0;p<g.length;p++){var v=g[p].style.opacity;v=""===v||null===v||0<parseFloat(v);g[p].style.opacity=v?0:1}};Graph.prototype.setCellStylesTransient=function(g,p,v){for(var C=0;C<v.length;C++){var E=this.view.getState(v[C]);null!=E&&null!=E.style&&-(null==p?delete E.style[g]:E.style[g]=p,null!=E.shape&&(E.shape.apply(E),E.shape.redraw()),null!=E.text&&(E.text.apply(E),E.text.redraw()))}};Graph.prototype.toggleCellStylesTransient=function(g,p,v){null==p&&(p="0");for(var C=0;C<v.length;C++){var E=this.view.getState(v[C]);if(null!=E&&null!=E.style){var I=mxUtils.getValue(E.style,g,p)?"0":"1";E.style[g]=I;null!=E.shape&&(E.shape.apply(E),E.shape.redraw());null!=E.text&&(E.text.apply(E),E.text.redraw())}}};Graph.prototype.executeCustomActions=function(g,-p,v){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var C=!1,E=0,I=0,O=mxUtils.bind(this,function(){C||(C=!0,this.model.beginUpdate())}),Q=mxUtils.bind(this,function(){C&&(C=!1,this.model.endUpdate())}),V=null==v,W=function(Z){return null!=Z.transient?-Z.transient:V},M=mxUtils.bind(this,function(){0<E&&E--;0==E&&X()}),X=mxUtils.bind(this,function(){if(this.isGraphTornDown())this.stoppingCustomActions=this.executingCustomActions=!1,null!=p&&p();else if(I<g.length){do{var Z=this.stoppingCustomActions,Y=g[I++],aa=[];if(null!=Y.open)if(Q(),this.isCustomLink(Y.open)){if(!this.customLinkClicked(Y.open,v))return}else this.openLink(Y.open);null==Y.wait||Z||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=-null;M()}),E++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Y.wait?parseInt(Y.wait):1E3),Q());null!=Y.opacity&&null!=Y.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Y.opacity,!0)),Y.opacity.value);null!=Y.fadeIn&&(E++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeIn,!0)),0,1,M,Z?0:Y.fadeIn.delay));null!=Y.fadeOut&&(E++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeOut,!0)),1,0,M,Z?0:Y.fadeOut.delay));-if(null!=Y.fadeTo&&null!=Y.fadeTo.value){E++;var da=this.getNodesForCells(this.getCellsForAction(Y.fadeTo,!0)),ba=Z?0:null!=Y.fadeTo.delay?Y.fadeTo.delay:1E3;Graph.setTransitionForNodes(da,"all "+ba+"ms ease-in-out");Graph.setOpacityForNodes(da,Y.fadeTo.value);window.setTimeout(function(){Graph.setTransitionForNodes(da,null);M()},ba)}null!=Y.flow&&(ba=this.getCellsForAction(Y.flow,!0),Editor.toggleFlowAnimation(this,ba,!1===Y.flow.start?"stop":!0===Y.flow.start?"start":"toggle"));null!=Y.wipeIn&&-(aa=aa.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeIn,!0),!0)));null!=Y.wipeOut&&(aa=aa.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeOut,!0),!1)));null!=Y.popIn&&(aa=aa.concat(this.createPopAnimations(this.getCellsForAction(Y.popIn,!0),!0)));null!=Y.popOut&&(aa=aa.concat(this.createPopAnimations(this.getCellsForAction(Y.popOut,!0),!1)));null!=Y.toggle&&(W(Y.toggle)?this.toggleCellsTransient(this.getCellsForAction(Y.toggle,!0)):(O(),this.toggleCells(this.getCellsForAction(Y.toggle,-!0,!0))));null!=Y.show&&(ba=this.getCellsForAction(Y.show,!0),Graph.setOpacityForNodes(this.getNodesForCells(ba),1),W(Y.show)||(O(),this.setCellsVisible(this.getCellsForAction(Y.show,!0,!0),!0)));null!=Y.hide&&(ba=this.getCellsForAction(Y.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ba),0),W(Y.hide)||(O(),this.setCellsVisible(this.getCellsForAction(Y.hide,!0,!0),!1)));if(null!=Y.toggleStyle&&null!=Y.toggleStyle.key){ba=this.getCellsForAction(Y.toggleStyle,!0);var ha=null!=Y.toggleStyle.defaultValue?-Y.toggleStyle.defaultValue:"0";W(Y.toggleStyle)?this.toggleCellStylesTransient(Y.toggleStyle.key,ha,ba):(O(),this.toggleCellStyles(Y.toggleStyle.key,ha,ba))}null!=Y.style&&null!=Y.style.key&&(ba=this.getCellsForAction(Y.style,!0),W(Y.style)?this.setCellStylesTransient(Y.style.key,Y.style.value,ba):(O(),this.setCellStyles(Y.style.key,Y.style.value,ba)));ba=[];null!=Y.select&&this.isEnabled()&&(ba=this.getCellsForAction(Y.select),this.setSelectionCells(ba));null!=Y.highlight&&(ba=this.getCellsForAction(Y.highlight),-this.highlightCells(ba,Y.highlight.color,Y.highlight.duration,Y.highlight.opacity));null!=Y.scroll&&(ba=this.getCellsForAction(Y.scroll));null!=Y.viewbox&&(!0!==Y.viewbox.smooth||Z?this.useCssTransforms?this.fitBoundsCssTransform(Y.viewbox,Y.viewbox.border):this.fitWindow(Y.viewbox,Y.viewbox.border):(E++,this.smoothFitWindow(Y.viewbox,Y.viewbox.border,M)));0<ba.length&&(ha=null==Y.scroll||null==Y.scroll.border||""===Y.scroll.border||isNaN(parseFloat(Y.scroll.border))?null:parseFloat(Y.scroll.border),-null==Y.scroll||!0!==Y.scroll.smooth||Z?this.useCssTransforms?this.scrollCellToVisibleCssTransform(ba[0],ha):this.scrollCellToVisibleBorder(ba[0],ha):(E++,this.smoothScrollCellToVisible(ba[0],ha,M)));null!=v&&null!=Y.explore&&Graph.exploreFromCell(this,v,Y.explore);if(null!=Y.tags){if(null!=Y.tags.toggle)for(ha=Y.tags.toggle,0==ha.length&&(ha=this.getAllTags()),ba=0;ba<ha.length;ba++)this.toggleHiddenTag(ha[ba]);ha=null;null!=Y.tags.hidden&&(null==ha&&(ha=[]),ha=ha.concat(Y.tags.hidden));if(null!=-Y.tags.visible){null==ha&&(ha=[]);var la=this.getAllTags();for(ba=0;ba<la.length;ba++)0>mxUtils.indexOf(Y.tags.visible,la[ba])&&0>mxUtils.indexOf(ha,la[ba])&&ha.push(la[ba])}null!=ha&&this.setHiddenTags(ha);this.refresh()}if(0<aa.length){E++;ba=null!=Y.steps?Y.steps:30;ha=Y.delay;la=["wipeIn","wipeOut","popIn","popOut"];for(var ra=null,sa=0;sa<la.length;sa++){var va=Y[la[sa]];null!=va&&null!=va.delay&&(ra=null==ra?va.delay:Math.max(ra,va.delay))}null!=ra&&(ha=ra/ba);this.executeAnimations(aa,M,Z?-1:ba,Z?0:ha)}}while(I<g.length&&!0===g[I].immediate&&!this.stoppingCustomActions);0==E?X():Q()}else this.stoppingCustomActions=this.executingCustomActions=!1,Q(),null!=p&&p()});X()}};Graph.prototype.doUpdateCustomLinksForCell=function(g,p){var v=this.getLinkForCell(p);null!=v&&"data:action/json,"==v.substring(0,17)&&this.setLinkForCell(p,this.updateCustomLink(g,v));if(this.isHtmlLabel(p)){var C=document.createElement("div");C.innerHTML=Graph.sanitizeHtml(this.getLabel(p));for(var E=C.getElementsByTagName("a"),-I=!1,O=0;O<E.length;O++)v=E[O].getAttribute("href"),null!=v&&"data:action/json,"==v.substring(0,17)&&(E[O].setAttribute("href",this.updateCustomLink(g,v)),I=!0);I&&this.labelChanged(p,C.innerHTML)}};Graph.prototype.updateCustomLink=function(g,p){if("data:action/json,"==p.substring(0,17))try{var v=JSON.parse(p.substring(17));null!=v.actions&&(this.updateCustomLinkActions(g,v.actions),p="data:action/json,"+JSON.stringify(v))}catch(C){}return p};Graph.prototype.updateCustomLinkActions=function(g,p){for(var v=-0;v<p.length;v++){var C=p[v],E;for(E in C)this.updateCustomLinkAction(g,C[E],"cells"),this.updateCustomLinkAction(g,C[E],"excludeCells"),this.updateCustomLinkAction(g,C[E],"layers")}};Graph.prototype.updateCustomLinkAction=function(g,p,v){if(null!=p&&null!=p[v]){for(var C=[],E=0;E<p[v].length;E++)if("*"==p[v][E])C.push(p[v][E]);else{var I=g[p[v][E]];null!=I?""!=I&&C.push(I):C.push(p[v][E])}p[v]=C}};Graph.prototype.getCellsForAction=function(g,p,v){var C="or"===g.tagsMatch?"or":"and",E={},I=[],O=function(Q){for(var V=-0;V<Q.length;V++){var W=Q[V].id;E[W]||(E[W]=!0,I.push(Q[V]))}};O(this.getCellsById(g.cells));O(this.getCellsForTags(g.tags,null,p,!1,C));O(v?this.getLayerCells(g.layers):this.getCellsForLayers(g.layers));if(null!=g.excludeCells&&0<g.excludeCells.length){p={};C=!1;for(v=0;v<g.excludeCells.length;v++){if("*"===g.excludeCells[v]){C=!0;break}p[g.excludeCells[v]]=!0}if(C)return[];g=[];for(v=0;v<I.length;v++)p[I[v].id]||g.push(I[v]);return g}return I};Graph.prototype.getCellsById=function(g){var p=[];if(null!=-g)for(var v=0;v<g.length;v++)if("*"==g[v]){var C=this.model.getRoot();p=p.concat(this.model.filterDescendants(function(I){return I!=C},C))}else{var E=this.model.getCell(g[v]);null!=E&&p.push(E)}return p};Graph.prototype.getCellsForLayers=function(g){var p=[];if(Array.isArray(g))for(var v=0;v<g.length;v++){var C=this.model.getCell(g[v]);null!=C&&(p=p.concat(this.model.filterDescendants(function(E){return E!=C},C)))}return p};Graph.prototype.getLayerCells=function(g){var p=[];if(Array.isArray(g))for(var v=-0;v<g.length;v++){var C=this.model.getCell(g[v]);null!=C&&p.push(C)}return p};var P=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(g){return P.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(g))};Graph.prototype.setHiddenTags=function(g){this.hiddenTags=g;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(g){var p=mxUtils.indexOf(this.hiddenTags,g);0>p?this.hiddenTags.push(g):0<=p&&this.hiddenTags.splice(p,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};-Graph.prototype.isAllTagsHidden=function(g){if(null==g||0==g.length||0==this.hiddenTags.length)return!1;g=g.split(" ");if(g.length>this.hiddenTags.length)return!1;for(var p=0;p<g.length;p++)if(0>mxUtils.indexOf(this.hiddenTags,g[p]))return!1;return!0};Graph.prototype.getCellsForTags=function(g,p,v,C,E){var I=[];E="or"===E;if(null!=g){p=null!=p?p:this.model.getDescendants(this.model.getRoot());for(var O=0,Q={},V=0;V<g.length;V++)0<g[V].length&&(Q[g[V]]=!0,O++);for(V=0;V<p.length;V++)if(v&&this.model.getParent(p[V])==-this.model.root||this.model.isVertex(p[V])||this.model.isEdge(p[V])){var W=this.getTagsForCell(p[V]),M=!1;if(0<W.length&&(W=W.split(" "),E||W.length>=g.length)){for(var X=M=0;X<W.length&&M<O;X++)null!=Q[W[X]]&&M++;M=E?0<M:M==O}M&&(1!=C||this.isCellVisible(p[V]))&&I.push(p[V])}}return I};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(g){for(var p=null,v=[],C=0;C<g.length;C++){var E=this.getTagsForCell(g[C]);-v=[];if(0<E.length){E=E.split(" ");for(var I={},O=0;O<E.length;O++)if(null==p||null!=p[E[O]])I[E[O]]=!0,v.push(E[O]);p=I}else return[]}return v};Graph.prototype.getTagsForCells=function(g){for(var p=[],v={},C=0;C<g.length;C++){var E=this.getTagsForCell(g[C]);if(0<E.length){E=E.split(" ");for(var I=0;I<E.length;I++)null==v[E[I]]&&(v[E[I]]=!0,p.push(E[I]))}}return p};Graph.prototype.getTagsForCell=function(g){return this.getAttributeForCell(g,"tags","")};Graph.prototype.addTagsForCells=function(g,p){if(0<-g.length&&0<p.length){this.model.beginUpdate();try{for(var v=0;v<g.length;v++){for(var C=this.getTagsForCell(g[v]),E=C.split(" "),I=!1,O=0;O<p.length;O++){var Q=mxUtils.trim(p[O]);""!=Q&&0>mxUtils.indexOf(E,Q)&&(C=0<C.length?C+" "+Q:Q,I=!0)}I&&this.setAttributeForCell(g[v],"tags",C)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(g,p){if(0<g.length&&0<p.length){this.model.beginUpdate();try{for(var v=0;v<g.length;v++){var C=this.getTagsForCell(g[v]);if(0<C.length){for(var E=-C.split(" "),I=!1,O=0;O<p.length;O++){var Q=mxUtils.indexOf(E,p[O]);0<=Q&&(E.splice(Q,1),I=!0)}I&&this.setAttributeForCell(g[v],"tags",E.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(g){this.model.beginUpdate();try{for(var p=0;p<g.length;p++)this.model.setVisible(g[p],!this.model.isVisible(g[p]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(g,p){this.model.beginUpdate();try{for(var v=0;v<g.length;v++)this.model.setVisible(g[v],p)}finally{this.model.endUpdate()}};-Graph.prototype.highlightCells=function(g,p,v,C){for(var E=0;E<g.length;E++)this.highlightCell(g[E],p,v,C)};Graph.prototype.highlightCell=function(g,p,v,C,E){p=null!=p?p:mxConstants.DEFAULT_VALID_COLOR;v=null!=v?v:1E3;g=this.view.getState(g);var I=null;null!=g&&(E=null!=E?E:4,E=Math.max(E+1,mxUtils.getValue(g.style,mxConstants.STYLE_STROKEWIDTH,1)+E),I=new mxCellHighlight(this,p,E,!1),null!=C&&(I.opacity=C),I.highlight(g),window.setTimeout(function(){null!=I.shape&&(mxUtils.setPrefixedStyle(I.shape.node.style,-"transition","all 1200ms ease-in-out"),I.shape.node.style.opacity=0);window.setTimeout(function(){I.destroy()},1200)},v));return I};Graph.prototype.addSvgShadow=function(g,p,v,C){C=null!=C?C:!0;var E=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=v&&v||(p=null!=p?p:g.getElementsByTagName("g")[0],null!=p&&(this.updateShadowFilter(p,!0),!isNaN(parseInt(g.getAttribute("width")))&&C&&(g.setAttribute("width",parseInt(g.getAttribute("width"))+E),g.setAttribute("height",parseInt(g.getAttribute("height"))+-E),p=g.getAttribute("viewBox"),null!=p&&0<p.length&&(p=p.split(" "),3<p.length&&(w=parseFloat(p[2])+E,h=parseFloat(p[3])+E,g.setAttribute("viewBox",p[0]+" "+p[1]+" "+w+" "+h))))));return E};Graph.prototype.updateShadowFilter=function(g,p){mxClient.IS_SF||(p?(p=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),g.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+p.cssText+-")"):g.style.filter="")};Graph.prototype.setShadowVisible=function(g,p){p=null!=p?p:!0;this.shadowVisible=g;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);p&&this.fireEvent(new mxEventObject("shadowVisibleChanged"));return Math.ceil(this.svgShadowSize*this.svgShadowBlur)};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=-function(){if(null==this.defaultParent){var g=this.model.getChildCount(this.model.root),p=0;do var v=this.model.getChildAt(this.model.root,p);while(p++<g&&"1"==mxUtils.getValue(this.getCellStyle(v),"locked","0"));null!=v&&this.setDefaultParent(v)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=-[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",-STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",-STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];-mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=-[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=-[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",-STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",-STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=-[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",-STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=-[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];-mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(g){var p=null;null!=g&&0<g.length&&("ER"==g.substring(0,2)?p="mxgraph.er":"sysML"==g.substring(0,5)&&(p="mxgraph.sysml"));return p};var U=mxMarker.createMarker;mxMarker.createMarker=function(g,p,v,C,E,I,O,Q,V,W){if(null!=v&&null==mxMarker.markers[v]){var M=this.getPackageForType(v);null!=M&&mxStencilRegistry.getStencil(M)}return U.apply(this,-arguments)};var S=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(g,p,v,C,E,I){"1"==mxUtils.getValue(p.style,"lineShape",null)&&g.setFillColor(mxUtils.getValue(p.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return S.apply(this,arguments)};PrintDialog.prototype.create=function(g,p,v,C){function E(){ha.value=Math.max(1,Math.min(Z,Math.max(parseInt(ha.value),parseInt(ba.value))));ba.value=Math.max(1,Math.min(Z,Math.min(parseInt(ha.value),parseInt(ba.value))))}function I(Ha){g.lastPrintPagesRadioChecked=-da.checked;g.lastPrintSelectionOnlyChecked=la.checked;g.lastPrintCropRadioChecked=sa.checked;g.lastPrintFitRadioChecked=va.checked;da.checked&&ba.value<ha.value?(g.lastPrintPagesFromInput=ba.value,g.lastPrintPagesToInput=ha.value):(g.lastPrintPagesFromInput=null,g.lastPrintPagesToInput=null);ia.value=Math.max(1,Math.min(1600,parseInt(ia.value)))+"%";g.lastPrintZoom=ia.value;g.lastPrintBorder=ya.value;g.lastPrintGrid=ka.checked;g.lastPrintShadow=ea.checked;g.lastPrintTransparent=ja.checked;g.lastPrintInclude=-ta.checked;g.lastPrintSheetsAcross=pa.value;g.lastPrintSheetsDown=ua.value;var Ja={};Ja.border=parseInt(ya.value);Ja.scale=parseInt(ia.value)/100;Ja.grid=ka.checked;Ja.shadows=ea.checked;Ja.transparent=ja.checked;Ja.includeCopy=ta.checked;Ja.sheetsAcross=parseInt(pa.value);Ja.sheetsDown=parseInt(ua.value);Ja.pagesFrom=parseInt(ba.value);Ja.pagesTo=parseInt(ha.value);Ja.allPages=Y.checked;Ja.selection=la.checked;Ja.pageView=ra.checked;Ja.crop=sa.checked;Ja.fit=va.checked;return null!=v?v(!Ha,Ja):g.print(!Ha,-Ja)}function O(Ha){try{g.hideDialog(),null!=v?I(Ha):g.spinner.spin(document.body,mxResources.get("updatingPreview"))&&window.setTimeout(function(){try{I(Ha),g.spinner.stop()}catch(Ja){g.handleError(Ja)}},0)}catch(Ja){g.handleError(Ja)}}var Q=g.editor.graph,V=document.createElement("div");V.style.display="flex";V.style.flexDirection="column";V.style.minHeight="0";var W=document.createElement("div");W.style.flex="1 1 auto";W.style.minHeight="0";W.style.overflowY="auto";V.appendChild(W);var M=document.createElement("h3");-mxUtils.write(M,p||mxResources.get("print"));W.appendChild(M);var X=1,Z=1;M=document.createElement("div");M.className="geDialogSection";M.style.whiteSpace="nowrap";var Y=document.createElement("input");Y.style.marginRight="8px";Y.setAttribute("type","radio");Y.setAttribute("name","pages-printdialog");Y.setAttribute("id","gePrintDlgAllPages");var aa=document.createElement("div");aa.className="geDialogCheckRow";aa.appendChild(Y);p=document.createElement("label");p.setAttribute("for","gePrintDlgAllPages");-mxUtils.write(p,mxResources.get("allPages"));aa.appendChild(p);M.appendChild(aa);var da=document.createElement("input");da.style.marginRight="8px";da.setAttribute("type","radio");da.setAttribute("name","pages-printdialog");da.setAttribute("id","gePrintDlgPages");aa=document.createElement("div");aa.className="geDialogCheckRow";aa.appendChild(da);p=document.createElement("label");p.setAttribute("for","gePrintDlgPages");mxUtils.write(p,mxResources.get("pages")+":");aa.appendChild(p);var ba=document.createElement("input");-ba.style.margin="0 4px";ba.setAttribute("value","1");ba.setAttribute("type","number");ba.setAttribute("min","1");ba.style.width="40px";aa.appendChild(ba);p=document.createElement("span");mxUtils.write(p,mxResources.get("to"));aa.appendChild(p);var ha=ba.cloneNode(!0);aa.appendChild(ha);mxEvent.addListener(ba,"focus",function(){da.checked=!0});mxEvent.addListener(ha,"focus",function(){da.checked=!0});mxEvent.addListener(ba,"change",E);mxEvent.addListener(ha,"change",E);if(null!=g.pages&&(Z=g.pages.length,-null!=g.currentPage))for(p=0;p<Z;p++)if(g.currentPage==g.pages[p]){X=p+1;break}null!=g.lastPrintPagesFromInput&&null!=g.lastPrintPagesToInput?(ba.value=Math.min(Z,Math.max(1,g.lastPrintPagesFromInput)),ha.value=Math.min(Z,Math.max(1,g.lastPrintPagesToInput))):(ba.value=X,ha.value=X);ba.setAttribute("max",Z);ha.setAttribute("max",Z);p=mxUtils.button(mxResources.get("currentPage"),function(Ha){ba.value=X;ha.value=X;da.checked=!0});p.className="geBtn";p.setAttribute("title",mxResources.get("currentPage"));-p.style.marginLeft="4px";p.style.maxWidth="100px";aa.appendChild(p);M.appendChild(aa);1<Z&&W.appendChild(M);aa=document.createElement("div");aa.className="geDialogCheckRow";var la=document.createElement("input");la.setAttribute("name","pages-printdialog");la.setAttribute("type",1==Z?"checkbox":"radio");la.setAttribute("id","gePrintDlgSelectionOnly");la.style.marginRight="8px";Q.isSelectionEmpty()&&la.setAttribute("disabled","disabled");Q.isEnabled()&&(aa.appendChild(la),p=document.createElement("label"),-p.setAttribute("for","gePrintDlgSelectionOnly"),mxUtils.write(p,mxResources.get("selectionOnly")),aa.appendChild(p));Q.isEnabled()&&(1<Z?M.appendChild(aa):(p=document.createElement("div"),p.className="geDialogSection",p.appendChild(aa),W.appendChild(p)));!g.isPagesEnabled()||g.lastPrintPagesRadioChecked?da.checked=!0:!Q.isSelectionEmpty()&&g.lastPrintSelectionOnlyChecked?la.checked=!0:Y.checked=!0;Q=g.addAdvancedSection(W);W=Q.content;M=document.createElement("div");M.className="geDialogCheckRow";-var ra=document.createElement("input");ra.style.marginRight="8px";ra.setAttribute("type","radio");ra.setAttribute("name","printSize");ra.setAttribute("id","gePrintDlgPageView");M.appendChild(ra);p=document.createElement("label");p.setAttribute("for","gePrintDlgPageView");mxUtils.write(p,mxResources.get("pageView"));M.appendChild(p);mxEvent.addListener(M,"click",function(){ra.checked=!0});W.appendChild(M);M=document.createElement("div");M.className="geDialogCheckRow";var sa=document.createElement("input");-sa.style.marginRight="8px";sa.setAttribute("type","radio");sa.setAttribute("name","printSize");sa.setAttribute("id","gePrintDlgCrop");M.appendChild(sa);p=document.createElement("label");p.setAttribute("for","gePrintDlgCrop");mxUtils.write(p,mxResources.get("crop"));M.appendChild(p);mxEvent.addListener(M,"click",function(){sa.checked=!0});W.appendChild(M);M=document.createElement("div");M.className="geDialogCheckRow";M.style.alignItems="flex-start";var va=document.createElement("input");va.style.marginTop=-"4px";va.setAttribute("type","radio");va.setAttribute("name","printSize");M.appendChild(va);aa=document.createElement("table");aa.style.display="inline-block";aa.style.borderSpacing="0";var wa=document.createElement("tbody"),qa=document.createElement("tr"),Ba=qa.cloneNode(!0),Aa=document.createElement("td"),Da=Aa.cloneNode(!0),Ca=Aa.cloneNode(!0),ca=Aa.cloneNode(!0),fa=Aa.cloneNode(!0),oa=Aa.cloneNode(!0);Aa.style.textAlign="right";ca.style.textAlign="right";mxUtils.write(Aa,mxResources.get("fitTo"));-mxEvent.addListener(M,"click",function(Ha){mxEvent.getSource(Ha)!=va&&(va.checked=!va.checked)});var pa=document.createElement("input");pa.style.margin="0 2px";pa.style.boxSizing="border-box";pa.setAttribute("value",g.lastPrintSheetsAcross||"1");pa.setAttribute("min","1");pa.setAttribute("type","number");pa.style.width="40px";Da.appendChild(pa);p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsAcross"));Ca.appendChild(p);mxUtils.write(ca,mxResources.get("fitToBy"));var ua=-pa.cloneNode(!0);ua.setAttribute("value",g.lastPrintSheetsDown||"1");fa.appendChild(ua);mxEvent.addListener(pa,"click",function(Ha){va.checked=!0;mxEvent.consume(Ha)});mxEvent.addListener(ua,"click",function(Ha){va.checked=!0;mxEvent.consume(Ha)});g.lastPrintCropRadioChecked?sa.checked=!0:g.lastPrintFitRadioChecked?va.checked=!0:ra.checked=!0;p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsDown"));oa.appendChild(p);qa.appendChild(Aa);qa.appendChild(Da);qa.appendChild(Ca);-Ba.appendChild(ca);Ba.appendChild(fa);Ba.appendChild(oa);wa.appendChild(qa);wa.appendChild(Ba);aa.appendChild(wa);M.appendChild(aa);W.appendChild(M);W=document.createElement("div");W.className="geDialogSection";p=document.createElement("div");p.className="geDialogFormRow";M=document.createElement("label");M.className="geDialogFormLabel";M.setAttribute("for","gePrintDlgBorder");mxUtils.write(M,mxResources.get("borderWidth"));p.appendChild(M);var ya=document.createElement("input");ya.setAttribute("type",-"number");ya.setAttribute("min","0");ya.setAttribute("id","gePrintDlgBorder");ya.style.width="40px";ya.value=null!=g.lastPrintBorder?g.lastPrintBorder:mxPrintPreview.prototype.pageMargin;p.appendChild(ya);M=document.createElement("label");M.setAttribute("for","gePrintDlgZoom");M.style.marginLeft="12px";M.style.marginRight="4px";mxUtils.write(M,mxResources.get("zoom"));p.appendChild(M);var ia=document.createElement("input");ia.setAttribute("id","gePrintDlgZoom");ia.style.width="60px";ia.value=null!=-g.lastPrintZoom?g.lastPrintZoom:"100%";p.appendChild(ia);W.appendChild(p);M=document.createElement("div");M.className="geDialogCheckRow";var ka=document.createElement("input");ka.setAttribute("type","checkbox");ka.setAttribute("id","gePrintDlgGrid");ka.style.marginRight="8px";ka.checked=null!=g.lastPrintGrid?g.lastPrintGrid:!1;M.appendChild(ka);p=document.createElement("label");p.setAttribute("for","gePrintDlgGrid");mxUtils.write(p,mxResources.get("grid"));M.appendChild(p);W.appendChild(M);M=document.createElement("div");-M.className="geDialogCheckRow";var ea=document.createElement("input");ea.setAttribute("type","checkbox");ea.setAttribute("id","gePrintDlgShadows");ea.style.marginRight="8px";ea.checked=null!=g.lastPrintShadow?g.lastPrintShadow:!1;M.appendChild(ea);p=document.createElement("label");p.setAttribute("for","gePrintDlgShadows");mxUtils.write(p,mxResources.get("shadows"));M.appendChild(p);g.isOffline()&&!mxClient.IS_CHROMEAPP||M.appendChild(g.createHelpIcon("https://www.drawio.com/docs/manual/export/print-diagram/#shadows-in-print-and-pdf-export"));-Editor.enableShadowOption||(M.style.display="none");W.appendChild(M);var ja=document.createElement("input");ja.setAttribute("type","checkbox");ja.setAttribute("id","gePrintDlgTransparent");ja.style.marginRight="8px";ja.checked=null!=g.lastPrintTransparent?g.lastPrintTransparent:!1;null!=v&&(M=document.createElement("div"),M.className="geDialogCheckRow",M.appendChild(ja),p=document.createElement("label"),p.setAttribute("for","gePrintDlgTransparent"),mxUtils.write(p,mxResources.get("transparentBackground")),-M.appendChild(p),W.appendChild(M));var ta=document.createElement("input");ta.setAttribute("type","checkbox");ta.setAttribute("id","gePrintDlgInclude");ta.style.marginRight="8px";ta.checked=null!=g.lastPrintInclude?g.lastPrintInclude:Editor.defaultIncludeDiagram;null==v||mxClient.IS_CHROMEAPP||"draw.io"!=g.getServiceName()||(M=document.createElement("div"),M.className="geDialogCheckRow",M.appendChild(ta),p=document.createElement("label"),p.setAttribute("for","gePrintDlgInclude"),mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram")),+if(0<v.length){for(g=1;g<v.length;g++){var I=v[g].indexOf(")"),O=null,Q=v[g].indexOf("format(",I);0<Q&&(O=Editor.trimCssUrl(v[g].substring(Q+7,v[g].indexOf(")",Q))));mxUtils.bind(this,function(V){var W=this.cachedFonts[V];if(null==W){var M=[];this.cachedFonts[V]=M;C++;W="application/x-font-ttf";if("svg"==O||/(\.svg)($|\?)/i.test(V))W="image/svg+xml";else if("otf"==O||"embedded-opentype"==O||/(\.otf)($|\?)/i.test(V))W="application/x-font-opentype";else if("woff"==O||/(\.woff)($|\?)/i.test(V))W="application/font-woff";+else if("woff2"==O||/(\.woff2)($|\?)/i.test(V))W="application/font-woff2";else if("eot"==O||/(\.eot)($|\?)/i.test(V))W="application/vnd.ms-fontobject";else if("sfnt"==O||/(\.sfnt)($|\?)/i.test(V))W="application/font-sfnt";var X=mxUtils.bind(this,function(Z){this.cachedFonts[V]=Z;C--;E();for(Z=0;Z<M.length;Z++)M[Z]()});this.mapFontUrl(W,V,mxUtils.bind(this,function(Z,Y){this.loadUrl(Y,function(aa){X(aa)},function(aa){X(V)},!0,null,"data:"+Z+";charset=utf-8;base64,")}))}else"string"!=typeof W&&(C++,+W.push(function(){C--;E()}))})(Editor.trimCssUrl(v[g].substring(0,I)),O)}E()}else p(g)};Editor.prototype.loadFonts=function(g){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(p){this.resolvedFontCss=p;null!=g&&g()})):null!=g&&g()};Editor.prototype.createGoogleFontCache=function(){var g={},p;for(p in Graph.fontMapping)Graph.isCssFontUrl(p)&&(g[p]=Graph.fontMapping[p]);return g};Editor.prototype.embedExtFonts=function(g){var p=this.graph.getCustomFonts();+if(0<p.length){var v=[],C=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var E=mxUtils.bind(this,function(){0==C&&this.embedCssFonts(v.join(""),g)}),I=0;I<p.length;I++)mxUtils.bind(this,function(O,Q){Graph.isCssFontUrl(Q)?null==this.cachedGoogleFonts[Q]?(C++,this.loadUrl(Graph.rewriteGoogleFontUrl(Q),mxUtils.bind(this,function(V){this.cachedGoogleFonts[Q]=V;v.push(V+"\n");C--;E()}),mxUtils.bind(this,function(V){C--;v.push("@import url("+Q+");\n");E()}))):+v.push(this.cachedGoogleFonts[Q]+"\n"):v.push('@font-face {font-family: "'+O+'";src: url("'+Q+'")}\n')})(p[I].name,p[I].url);E()}else g()};Editor.prototype.addMathCss=function(g){g=g.getElementsByTagName("defs");if(null!=g&&0<g.length)for(var p=document.getElementsByTagName("style"),v=0;v<p.length;v++){var C=mxUtils.getTextContent(p[v]);0>C.indexOf("mxPageSelector")&&0<C.indexOf("MathJax")&&g[0].appendChild(p[v].cloneNode(!0))}};Editor.prototype.addFontCss=function(g,p){p=null!=p?p:this.absoluteCssFonts(this.fontCss);+if(null!=p){var v=mxUtils.getSvgDefs(g),C=p.split("\n");p=[];for(var E=[],I=0;I<C.length;I++)"@import"==C[I].substring(0,7)?p.push(C[I]):E.push(C[I]);g=g.ownerDocument;g=null!=g.createElementNS?g.createElementNS(mxConstants.NS_SVG,"style"):g.createElement("style");g.setAttribute("type","text/css");0<p.length&&(mxUtils.setTextContent(g,p.join("\n")),v.appendChild(g));0<E.length&&(g=g.cloneNode(!1),mxUtils.setTextContent(g,E.join("\n")),v.appendChild(g))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||+Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(g,p,v){var C=mxClient.IS_FF?8192:16384;return Math.min(v,Math.min(C/g,C/p))};Editor.prototype.exportToCanvas=function(g,p,v,C,E,I,O,Q,V,W,M,X,Z,Y,aa,da,ba,ha){try{I=null!=I?I:!0;O=null!=O?O:!0;X=null!=X?X:this.graph;Z=null!=Z?Z:0;var la=V?null:X.background;la==mxConstants.NONE&&(la=null);null==la&&(la=C);null==la&&0==V&&(la="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(X.getSvg(null,null,Z,Y,null,O,null,null,null,+W,null,da,ba,ha),mxUtils.bind(this,function(ra){try{ra.style.setProperty("-webkit-font-smoothing","antialiased");ra.style.setProperty("-moz-osx-font-smoothing","grayscale");var sa=new Image;sa.onload=mxUtils.bind(this,function(){try{var wa=function(){mxClient.IS_SF?window.setTimeout(function(){Da.drawImage(sa,0,0);g(qa,ra)},0):(Da.drawImage(sa,0,0),g(qa,ra))},qa=document.createElement("canvas"),Ba=parseInt(ra.getAttribute("width")),Aa=parseInt(ra.getAttribute("height"));Q=null!=Q?Q:1;null!=p&&(Q=+I?Math.min(1,Math.min(3*p/(4*Aa),p/Ba)):p/Ba);Q=this.getMaxCanvasScale(Ba,Aa,Q);Ba=Math.ceil(Q*Ba);Aa=Math.ceil(Q*Aa);qa.setAttribute("width",Ba);qa.setAttribute("height",Aa);var Da=qa.getContext("2d");if(null!=la){var Ca=mxUtils.getLightDarkColor(la);Da.beginPath();Da.rect(0,0,Ba,Aa);Da.fillStyle="dark"==da&&"none"!=X.getAdaptiveColors()?Ca.dark:Ca.light;Da.fill()}1!=Q&&Da.scale(Q,Q);if(aa){var ca=X.view,fa=ca.scale;ca.scale=1;var oa=btoa(unescape(encodeURIComponent(ca.createSvgGrid(ca.gridColor))));+ca.scale=fa;oa="data:image/svg+xml;base64,"+oa;var pa=X.gridSize*ca.gridSteps*Q,ua=X.getGraphBounds(),ya=ca.translate.x*fa,ia=ca.translate.y*fa,ka=ya+(ua.x-ya)/fa-Z,ea=ia+(ua.y-ia)/fa-Z,ja=new Image;ja.onload=function(){try{for(var ta=-Math.round(pa-mxUtils.mod((ya-ka)*Q,pa)),xa=-Math.round(pa-mxUtils.mod((ia-ea)*Q,pa));ta<Ba;ta+=pa)for(var Ea=xa;Ea<Aa;Ea+=pa)Da.drawImage(ja,ta/Q,Ea/Q);wa()}catch(Ha){null!=E&&E(Ha)}};ja.onerror=function(ta){null!=E&&E(ta)};ja.src=oa}else wa()}catch(ta){null!=E&&E(ta)}});+sa.onerror=function(wa){null!=E&&E(wa)};W&&this.graph.addSvgShadow(ra);this.graph.mathEnabled&&this.addMathCss(ra);var va=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(ra,this.resolvedFontCss),sa.src=Editor.createSvgDataUri(mxUtils.getXml(ra))}catch(wa){null!=E&&E(wa)}});this.embedExtFonts(mxUtils.bind(this,function(wa){try{null!=wa&&this.addFontCss(ra,wa),this.loadFonts(va)}catch(qa){null!=E&&E(qa)}}))}catch(wa){null!=E&&E(wa)}}),v,M)}catch(ra){null!=E&&E(ra)}};Editor.crcTable=+[];for(var q=0;256>q;q++)for(var u=q,y=0;8>y;y++)u=1==(u&1)?3988292384^u>>>1:u>>>1,Editor.crcTable[q]=u;Editor.updateCRC=function(g,p,v,C){for(var E=0;E<C;E++)g=Editor.crcTable[(g^p.charCodeAt(v+E))&255]^g>>>8;return g};Editor.crc32=function(g){for(var p=-1,v=0;v<g.length;v++)p=p>>>8^Editor.crcTable[(p^g.charCodeAt(v))&255];return(p^-1)>>>0};Editor.writeGraphModelToPng=function(g,p,v,C,E){function I(M,X){var Z=V;V+=X;return M.substring(Z,V)}function O(M){M=I(M,4);return M.charCodeAt(3)+(M.charCodeAt(2)<<+8)+(M.charCodeAt(1)<<16)+(M.charCodeAt(0)<<24)}function Q(M){return String.fromCharCode(M>>24&255,M>>16&255,M>>8&255,M&255)}g=g.substring(g.indexOf(",")+1);g=window.atob?atob(g):Base64.decode(g,!0);var V=0;if(I(g,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=E&&E();else if(I(g,4),"IHDR"!=I(g,4))null!=E&&E();else{I(g,17);E=g.substring(0,V);do{var W=O(g);if("IDAT"==I(g,4)){E=g.substring(0,V-8);"pHYs"==p&&"dpi"==v?(v=Math.round(C/.0254),v=Q(v)+Q(v)+String.fromCharCode(1)):+v=v+String.fromCharCode(0)+("zTXt"==p?String.fromCharCode(0):"")+C;C=4294967295;C=Editor.updateCRC(C,p,0,4);C=Editor.updateCRC(C,v,0,v.length);E+=Q(v.length)+p+v+Q(C^4294967295);E+=g.substring(V-8,g.length);break}E+=g.substring(V-8,V-4+W);I(g,W);I(g,4)}while(W);return"data:image/png;base64,"+(window.btoa?btoa(E):Base64.encode(E,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var A=ColorDialog.addRecentColor;ColorDialog.addRecentColor=+function(g,p){A.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var J=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){J.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(g,p,v){var C=null;if(null!=v)return null;null!=g.editor.graph.getModel().getParent(p)?C=p.getId():null!=g.currentPage&&(C=g.currentPage.getId());+return C});if(null!=window.StyleFormatPanel){var K=Format.prototype.init;Format.prototype.init=function(){K.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var F=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?F.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(g){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||+"min"==Editor.currentTheme};var H=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(g){g=H.apply(this,arguments);var p=this.editorUi,v=p.editor.graph;if(v.isEnabled()){var C=p.getCurrentFile();null!=C&&C.isAutosaveOptional()&&g.appendChild(this.createOption(mxResources.get("autosave"),function(){return p.editor.autosave},function(I){p.editor.setAutosave(I);p.editor.autosave&&C.isModified()&&C.fileChanged()},{install:function(I){this.listener=function(){I(p.editor.autosave)};+p.editor.addListener("autosaveChanged",this.listener)},destroy:function(){p.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&v.isEnabled()&&"undefined"!==typeof MathJax){var E=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return v.mathEnabled},function(I){p.actions.get("mathematicalTypesetting").funct()},{install:function(I){this.listener=function(){I(v.mathEnabled)};p.addListener("mathEnabledChanged",this.listener)},destroy:function(){p.removeListener(this.listener)}});+g.appendChild(E);(!p.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&E.appendChild(p.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return g};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",+dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(g,p){return 0<mxUtils.getValue(g.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.ellipse.prototype.customProperties=[{name:"centerRadius",dispName:"Center Radius",type:"float",min:0,defVal:0},{name:"centerColor",dispName:"Center Color",type:"color",defVal:null,primary:!0,isVisible:function(g,p){return 0<mxUtils.getValue(g.style,"centerRadius",0)}}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",+dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=+[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",+type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2,isVisible:function(g){return"0"==mxUtils.getValue(g.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(g){return"1"==mxUtils.getValue(g.style,+"fixedSize","0")}}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.25,isVisible:function(g){return"0"==mxUtils.getValue(g.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:25,isVisible:function(g){return"1"==mxUtils.getValue(g.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=+[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,min:0,max:1},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,+defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder.prototype.customProperties=[{name:"boundedLbl",+dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder3.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlState.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.step.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",+type:"float",min:0,defVal:20},{name:"fixedSize",dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",+defVal:!1}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.note2.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.card.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",+dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20},{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",type:"float",min:0,max:1,defVal:.5}];+mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"right",dispName:"Right"}]},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",+dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},{name:"swimlaneBody",dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},{name:"separatorColor",dispName:"Separator Color",type:"color",defVal:null},{name:"fixedHeader",dispName:"Fixed Header",type:"bool",+defVal:!0,getDefaultValue:function(g,p){g=mxCellRenderer.defaultShapes[mxUtils.getValue(g.style,"shape","")];return null!=g&&null!=g.prototype.fixedHeaderDefault?g.prototype.fixedHeaderDefault?"1":"0":"1"}}];mxCellRenderer.defaultShapes.table.prototype.customProperties=[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",+type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=+[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];+mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0},{name:"imageAlign",dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},{name:"imageVerticalAlign",dispName:"Image Vertical Align",+type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",type:"float",min:0,defVal:24},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",+dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(g,p){return 0<mxUtils.getValue(g.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20},{name:"boundedLbl",dispName:"Bounded Label",+type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=[{name:"size",dispName:"Size",+type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.cross.prototype.customProperties=+[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.corner.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.tee.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.umlLifeline.prototype.customProperties=[{name:"participant",+dispName:"Participant",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName:"Actor"},{val:"umlBoundary",dispName:"Boundary"},{val:"umlEntity",dispName:"Entity"},{val:"umlControl",dispName:"Control"}]},{name:"size",dispName:"Height",type:"float",defVal:40,min:0},{name:"lifelineMirror",dispName:"Mirror Head",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:"width",dispName:"Title Width",type:"float",defVal:60,min:0},+{name:"height",dispName:"Title Height",type:"float",defVal:30,min:0}];StyleFormatPanel.prototype.defaultColorSchemes=[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},+{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",+stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},+{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",+stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;var c=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var g=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&0<g.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));c.apply(this,arguments);null!=g.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),g.customProperties,g))};var f=StyleFormatPanel.prototype.addStyleOps;+StyleFormatPanel.prototype.addStyleOps=function(g){var p=this.editorUi.getSelectionState();1==p.cells.length?this.addActions(g,["copyStyle","pasteStyle"]):1<=p.cells.length&&this.addActions(g,["pasteStyle","pasteData"]);f.apply(this,arguments);return g};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(g,p,v,C){function E(Ca){try{return decodeURIComponent(Ca)}catch(ca){return Ca}}function I(Ca,ca,fa,oa,pa){if(null!=fa.valueChanged)fa.valueChanged(ca,pa,v,Z);+else{Y.getModel().beginUpdate();try{pa=[];var ua=[];if(null!=fa.index){for(var ya=[],ia=fa.parentRow.nextSibling;ia&&ia.getAttribute("data-pName")==Ca;)ya.push(ia.getAttribute("data-pValue")),ia=ia.nextSibling;fa.index<ya.length?null!=oa?ya.splice(oa,1):ya[fa.index]=ca:ya.push(ca);null!=fa.size&&ya.length>fa.size&&(ya=ya.slice(0,fa.size));ca=ya.join(",");null!=fa.countProperty&&(Y.setCellStyles(fa.countProperty,ya.length,Y.getSelectionCells()),pa.push(fa.countProperty),ua.push(ya.length))}Y.setCellStyles(Ca,+ca,Y.getSelectionCells());pa.push(Ca);ua.push(ca);if(null!=fa.dependentProps)for(Ca=0;Ca<fa.dependentProps.length;Ca++){var ka=fa.dependentPropsDefVal[Ca],ea=fa.dependentPropsVals[Ca];if(ea.length>ca)ea=ea.slice(0,ca);else for(var ja=ea.length;ja<ca;ja++)ea.push(ka);ea=ea.join(",");Y.setCellStyles(fa.dependentProps[Ca],ea,Y.getSelectionCells());pa.push(fa.dependentProps[Ca]);ua.push(ea)}if("function"==typeof fa.onChange)fa.onChange(Y,ca);Z.editorUi.fireEvent(new mxEventObject("styleChanged","keys",+pa,"values",ua,"cells",Y.getSelectionCells()))}finally{Y.getModel().endUpdate()}}}function O(Ca,ca){ca.style.left="0px";ca.style.top="0px";ca.style.position="relative";ca.style.right="0px";ca.style.bottom="0px";ca.style.width="100%";ca.style.maxWidth="100%";ca.style.maxHeight="100%";ca.style.textAlign="left"}function Q(Ca,ca,fa){function oa(ua){if(null==ua||ua==mxConstants.NONE)pa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==ua)pa.style.background="";else{var ya=+mxUtils.getLightDarkColor(ua);mxUtils.isLightDarkColor(ua)&&ya.light!=ya.dark?pa.style.background="linear-gradient(to right bottom, "+ya.cssText+" 50%, "+mxUtils.invertLightDarkColor(ya).cssText+" 50.3%)":pa.style.background=ua}}var pa=document.createElement("div");pa.style.width="32px";pa.style.height="8px";pa.style.margin="2px";pa.style.borderStyle="solid";pa.style.borderWidth="1px";oa(ca);btn=mxUtils.button("",mxUtils.bind(Z,function(ua){this.editorUi.pickColor(ca,function(ya){I(Ca,ya,fa);oa(ya)});+mxEvent.consume(ua)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(pa);return btn}function V(Ca,ca,fa,oa,pa,ua,ya){null!=ca&&(ca=ca.split(","),aa.push({name:Ca,values:ca,type:fa,defVal:oa,countProperty:pa,parentRow:ua,isDeletable:!0,flipBkg:ya}));btn=mxUtils.button("+",mxUtils.bind(Z,function(ia){for(var ka=ua,ea=0;null!=ka.nextSibling;)if(ka.nextSibling.getAttribute("data-pName")==Ca)ka=ka.nextSibling,+ea++;else break;var ja={type:fa,parentRow:ua,index:ea,isDeletable:!0,defVal:oa,countProperty:pa};ea=X(Ca,"",ja,0==ea%2,ya);I(Ca,oa,ja);ka.parentNode.insertBefore(ea,ka.nextSibling);mxEvent.consume(ia)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function W(Ca,ca,fa,oa,pa,ua,ya){if(0<pa){var ia=Array(pa);ca=null!=ca?ca.split(","):[];for(var ka=0;ka<pa;ka++)ia[ka]=null!=ca[ka]?ca[ka]:null!=oa?oa:"";aa.push({name:Ca,values:ia,type:fa,defVal:oa,parentRow:ua,+flipBkg:ya,size:pa})}return document.createElement("div")}function M(Ca,ca,fa){var oa=document.createElement("input");oa.type="checkbox";oa.checked="1"==ca;mxEvent.addListener(oa,"change",function(){I(Ca,oa.checked?"1":"0",fa,null,oa)});return oa}function X(Ca,ca,fa,oa,pa){var ua=fa.dispName,ya=fa.type,ia=document.createElement("tr");ia.className="gePropRow"+(pa?"Dark":"")+(oa?"Alt":"")+" gePropNonHeaderRow";ia.setAttribute("data-pName",Ca);ia.setAttribute("data-pValue",ca);oa=!1;null!=fa.index&&+(ia.setAttribute("data-index",fa.index),ua=(null!=ua?ua:"")+"["+fa.index+"]",oa=!0);var ka=document.createElement("td");ka.className="gePropRowCell";ua=mxResources.get(ua,null,ua);mxUtils.write(ka,ua);ka.setAttribute("title",ua);oa&&(ka.style.textAlign="right");ia.appendChild(ka);ka=document.createElement("td");ka.className="gePropRowCell";ka.setAttribute("title",null!=ca?E(ca):mxResources.get("none"));mxEvent.addListener(ka,"click",mxUtils.bind(Z,function(xa){!mxUtils.isAncestorNode(ia,document.activeElement)&&+mxUtils.isAncestorNode(ia.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(xa))}));if("color"==ya)ka.appendChild(Q(Ca,ca,fa));else if("bool"==ya||"boolean"==ya)ka.appendChild(M(Ca,ca,fa));else if("enum"==ya){var ea=fa.enumList;ka.innerHTML="";var ja=document.createElement("div");ja.className="gePropValue";ka.appendChild(ja);for(pa=0;pa<ea.length;pa++)if(ua=ea[pa],ua.val==ca){mxUtils.write(ja,mxResources.get(ua.dispName,+null,ua.dispName));break}mxEvent.addListener(ka,"click",mxUtils.bind(Z,function(xa){var Ea=mxEvent.getSource(xa);if(!(Ea!=ka&&Ea!=ja||mxEvent.isConsumed(xa))){ja.innerHTML="";var Ha=document.createElement("select"),Ja=null;O(ka,Ha);Ha.style.boxSizing="border-box";Ha.style.height="100%";Ha.style.padding="0";Ha.style.margin="0";Ha.style.border="0";for(xa=0;xa<ea.length;xa++){Ea=ea[xa];var Ra=document.createElement("option");Ra.value=mxUtils.htmlEntities(Ea.val);mxUtils.write(Ra,mxResources.get(Ea.dispName,+null,Ea.dispName));Ha.appendChild(Ra);null==Ea.val&&(Ra.value="null",Ja=Ra)}Ha.value=null==ca&&null!=Ja?"null":ca;ja.appendChild(Ha);mxEvent.addListener(Ha,"change",function(){var Va=mxUtils.htmlEntities(Ha.value);if(Ha[Ha.selectedIndex]==Ja||"null"==Va.value)Va=null;I(Ca,Va,fa)});Ha.focus();mxEvent.addListener(Ha,"blur",function(){ja.innerHTML="";for(var Va=Ha[Ha.selectedIndex]==Ja||"null"==Ha.value?null:Ha.value,bb=0;bb<ea.length;bb++){var ab=ea[bb];if(ab.val==Va){mxUtils.write(ja,mxResources.get(ab.dispName,+null,ab.dispName));break}}})}}))}else if("dynamicArr"==ya)ka.appendChild(V(Ca,ca,fa.subType,fa.subDefVal,fa.countProperty,ia,pa));else if("staticArr"==ya)ka.appendChild(W(Ca,ca,fa.subType,fa.subDefVal,fa.size,ia,pa));else if("readOnly"==ya)pa=document.createElement("input"),pa.setAttribute("readonly",""),pa.value=ca,pa.style.borderWidth="0px","id"==Ca||"shape"==Ca?(ia.firstChild.innerHTML="",ia.firstChild.setAttribute("colspan","2"),pa.style.flexGrow="1",pa.style.marginLeft="4px",pa.style.textAlign=+"id"==Ca?"center":"left",pa.setAttribute("title",ca),ua=document.createElement("div"),mxUtils.write(ua,mxResources.get(Ca)+":"),ua.style.display="inline-flex",ua.style.alignItems="center",ua.style.width="100%",ua.appendChild(pa),ia.firstChild.appendChild(ua)):(pa.style.width="96px",ka.appendChild(pa));else{ka.innerHTML="";var ta=document.createElement("div");ta.className="gePropValue";ka.appendChild(ta);ta.innerHTML=mxUtils.htmlEntities(E(ca));mxEvent.addListener(ka,"click",mxUtils.bind(Z,function(xa){function Ea(){var Ra=+Ja.value,Va=ya;Ra=0==Ra.trim().length&&"string"!=Va&&"numbers"!=Va?fa.allowAuto?"auto":0:Ra;fa.allowAuto&&(null!=Ra.trim&&"auto"==Ra.trim().toLowerCase()?(Ra="auto",Va="string"):(Ra=parseFloat(Ra),Ra=isNaN(Ra)?0:Ra));null!=fa.min&&Ra<fa.min?Ra=fa.min:null!=fa.max&&Ra>fa.max&&(Ra=fa.max);var bb=null;try{bb="numbers"==Va?Ra.match(/\d+/g).map(Number).join(" "):"auto"===Ra&&fa.allowAuto&&"auto"==fa.defVal?null:encodeURIComponent(("int"==Va?parseInt(Ra):Ra)+"")}catch(ab){}I(Ca,bb,fa,null,Ja)}var Ha=mxEvent.getSource(xa);+if(!(Ha!=ka&&Ha!=ta||mxEvent.isConsumed(xa))){ta.innerHTML="";var Ja=document.createElement("input");O(ta,Ja);Ja.value=E(ca);Ja.className="gePropEditor";"int"!=ya&&"float"!=ya||fa.allowAuto||(Ja.type="number",Ja.step="int"==ya?"1":"any",null!=fa.min&&(Ja.min=parseFloat(fa.min)),null!=fa.max&&(Ja.max=parseFloat(fa.max)));ta.appendChild(Ja);mxEvent.addListener(Ja,"keypress",function(Ra){13==Ra.keyCode&&Ea()});Ja.focus();mxEvent.addListener(Ja,"blur",function(){Ea()})}}))}fa.isDeletable&&(pa=mxUtils.button("-",+mxUtils.bind(Z,function(xa){I(Ca,"",fa,fa.index);mxEvent.consume(xa)})),pa.style.height="16px",pa.style.width="25px",pa.style.float="right",pa.className="geColorBtn",ka.appendChild(pa));ia.appendChild(ka);return ia}var Z=this,Y=this.editorUi.editor.graph,aa=[],da=document.createElement("table");da.className="geProperties geFullWidthElement";var ba=document.createElement("tr");ba.className="gePropHeader";var ha=document.createElement("th");ha.className="gePropHeaderCell";ha.style.paddingLeft="16px";+ha.style.backgroundRepeat="no-repeat";ha.style.backgroundPosition="-2px 50%";ha.style.backgroundSize="20px";mxUtils.write(ha,mxResources.get("property"));ba.style.cursor="pointer";var la=function(){var Ca=da.querySelectorAll(".gePropNonHeaderRow");if(Z.editorUi.propertiesCollapsed){ha.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var ca="none";for(var fa=g.childNodes.length-1;0<=fa;fa--)try{var oa=g.childNodes[fa],pa=oa.nodeName.toUpperCase();"INPUT"!=pa&&"SELECT"!=pa||g.removeChild(oa)}catch(ua){}}else ha.style.backgroundImage=+"url('"+Editor.arrowDownImage+"')",ca="";for(fa=0;fa<Ca.length;fa++)Ca[fa].style.display=ca};mxEvent.addListener(ba,"click",function(){Z.editorUi.propertiesCollapsed=!Z.editorUi.propertiesCollapsed;la()});ba.appendChild(ha);var ra=document.createElement("th");ra.className="gePropHeaderCell";ra.style.paddingLeft="4px";mxUtils.write(ra,mxResources.get("value"));ba.appendChild(ra);da.appendChild(ba);var sa=ra=!1;ba=null;1==v.vertices.length&&0==v.edges.length?ba=v.vertices[0].id:0==v.vertices.length&&+1==v.edges.length&&(ba=v.edges[0].id);null==ba||C||(da.appendChild(X("id",mxUtils.htmlEntities(ba),{dispName:"id",type:"readOnly"},!0,!1)),null!=v.style&&null!=v.style.shape&&da.appendChild(X("shape",mxUtils.htmlEntities(v.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var va in p)if(C=p[va],("function"!=typeof C.isVisible||C.isVisible(v,this))&&!C.primary){var wa=null!=C.getValue?C.getValue(v,this):null!=v.style[va]?mxUtils.htmlEntities(v.style[va]+""):null!=C.getDefaultValue?C.getDefaultValue(v,+this):C.defVal;if("separator"==C.type)sa=!sa;else{if("staticArr"==C.type)C.size=parseInt(v.style[C.sizeProperty]||p[C.sizeProperty].defVal)||0;else if(null!=C.dependentProps){var qa=C.dependentProps,Ba=[],Aa=[];for(ba=0;ba<qa.length;ba++)if(null!=p[qa[ba]]){var Da=v.style[qa[ba]];Aa.push(p[qa[ba]].subDefVal);Ba.push(null!=Da?Da.split(","):[])}C.dependentPropsDefVal=Aa;C.dependentPropsVals=Ba}da.appendChild(X(va,wa,C,ra,sa));ra=!ra}}for(ba=0;ba<aa.length;ba++)for(C=aa[ba],p=C.parentRow,va=0;va<C.values.length;va++)ra=+X(C.name,C.values[va],{type:C.type,parentRow:C.parentRow,isDeletable:C.isDeletable,index:va,defVal:C.defVal,countProperty:C.countProperty,size:C.size},0==va%2,C.flipBkg),p.parentNode.insertBefore(ra,p.nextSibling),p=ra;g.appendChild(da);la();return g};StyleFormatPanel.prototype.addStyles=function(g){if(null!=this.defaultColorSchemes){var p=this.editorUi,v=p.editor.graph,C=document.createElement("div");C.style.padding="6px 20px 0 24px";g.appendChild(C);var E=document.createElement("div");E.className=+"geSwitcher";E.style.padding="4px 18px 6px 0px";for(var I=[],O=0;O<this.defaultColorSchemes.length;O++){var Q=document.createElement("div");Q.className="geSwitcherDot";mxUtils.bind(this,function(Z){mxEvent.addListener(Q,"click",mxUtils.bind(this,function(){V(Z)}))})(O);I.push(Q);E.appendChild(Q)}var V=mxUtils.bind(this,function(Z){null!=I[Z]&&(null!=this.format.currentScheme&&null!=I[this.format.currentScheme]&&(I[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=+Z,W(this.defaultColorSchemes[this.format.currentScheme]),I[this.format.currentScheme].style.background="#84d7ff")}),W=mxUtils.bind(this,function(Z){var Y=mxUtils.clone(v.defaultVertexStyle);Y[mxConstants.STYLE_STROKECOLOR]=null!=Y[mxConstants.STYLE_STROKECOLOR]?Y[mxConstants.STYLE_STROKECOLOR]:"default";Y[mxConstants.STYLE_FILLCOLOR]=null!=Y[mxConstants.STYLE_FILLCOLOR]?Y[mxConstants.STYLE_FILLCOLOR]:"default";Y[mxConstants.STYLE_FONTCOLOR]=null!=Y[mxConstants.STYLE_FONTCOLOR]?Y[mxConstants.STYLE_FONTCOLOR]:+"default";v.replaceDefaultColors(new mxCell,Y);var aa=mxUtils.bind(this,function(ba){var ha=mxUtils.button("",mxUtils.bind(this,function(sa){v.getModel().beginUpdate();try{for(var va=p.getSelectionState().cells,wa=v.getModel(),qa=[],Ba=0<va.length,Aa=0;Aa<va.length;Aa++){var Da=wa.isVertex(va[Aa])&&wa.isEdge(wa.getParent(va[Aa])),Ca=v.getCellStyle(va[Aa]),ca=null!=Ca&&"image"==Ca.shape,fa=v.getCellGeometry(va[Aa]);qa.push({isLabel:ca||Da&&(null==fa||0>=fa.width||0>=fa.height)});Da||ca||(Ba=!1)}for(Aa=+0;Aa<va.length;Aa++){var oa=qa[Aa];if(Ba||!oa.isLabel){var pa=oa.isLabel?mxConstants.STYLE_LABEL_BACKGROUNDCOLOR:mxConstants.STYLE_FILLCOLOR,ua=oa.isLabel?mxConstants.STYLE_LABEL_BORDERCOLOR:mxConstants.STYLE_STROKECOLOR,ya=wa.getStyle(va[Aa]);null!=ya&&"string"!==typeof ya&&(ya=String(ya));null!=ba?(mxEvent.isShiftDown(sa)||(ya=""==ba.fill||null==ba.fill?mxUtils.setStyle(ya,pa,null):mxUtils.setStyle(ya,pa,ba.fill),oa.isLabel||(ya=""==ba.gradient||null==ba.gradient?mxUtils.setStyle(ya,mxConstants.STYLE_GRADIENTCOLOR,+null):mxUtils.setStyle(ya,mxConstants.STYLE_GRADIENTCOLOR,ba.gradient)),mxEvent.isControlDown(sa)||mxClient.IS_MAC&&mxEvent.isMetaDown(sa)||!wa.isVertex(va[Aa])||(ya=""==ba.font||null==ba.font?mxUtils.setStyle(ya,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(ya,mxConstants.STYLE_FONTCOLOR,ba.font))),mxEvent.isAltDown(sa)||(ya=""==ba.stroke||null==ba.stroke?mxUtils.setStyle(ya,ua,null):mxUtils.setStyle(ya,ua,ba.stroke))):(ya=mxUtils.setStyle(ya,pa,null),ya=mxUtils.setStyle(ya,ua,null),oa.isLabel||+(ya=mxUtils.setStyle(ya,mxConstants.STYLE_GRADIENTCOLOR,null)),wa.isVertex(va[Aa])&&(ya=mxUtils.setStyle(ya,mxConstants.STYLE_FONTCOLOR,null)));wa.setStyle(va[Aa],ya)}}}finally{v.getModel().endUpdate()}}));ha.className="geStyleButton";ha.style.width="36px";ha.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";ha.style.margin="0px 6px 6px 0px";if(null!=ba){var la="1px solid";null!=ba.border&&(la=ba.border);if(null!=ba.gradient)ha.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(ba.fill).cssText++" 0px,"+mxUtils.getLightDarkColor(ba.gradient).cssText+" 100%)";else if(ba.fill==mxConstants.NONE)ha.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==ba.fill||""==ba.fill)ha.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(Y,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var ra=mxUtils.getLightDarkColor(ba.fill);ha.style.backgroundImage="linear-gradient(to right bottom, "+ra.cssText+" 50%, "+ra.light+" 50.3%)"}null==ba.stroke||ba.stroke==mxConstants.NONE?+ha.style.border=la+" transparent":""==ba.stroke?ha.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(Y,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(ra=mxUtils.getLightDarkColor(ba.stroke),ha.style.border=la+" "+ra.cssText,ha.style.borderRightColor=ra.light,ha.style.borderBottomColor=ha.style.borderRightColor);null!=ba.title&&ha.setAttribute("title",ba.title)}else la=mxUtils.getValue(Y,mxConstants.STYLE_FILLCOLOR,"#ffffff"),ra=mxUtils.getValue(Y,mxConstants.STYLE_STROKECOLOR,+"#000000"),ha.style.backgroundColor=la,ha.style.border="1px solid "+ra;ha.style.borderRadius="0";C.appendChild(ha);null!=ba&&null!=ba.gradient&&(la=ha.cloneNode(!1),la.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(ba.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(ba.gradient).light+") 100%)",la.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",la.style.backgroundColor="transparent",C.appendChild(la),la.style.marginLeft="-42px",+mxEvent.addListener(la,"click",function(){ha.click()}))});C.innerText="";if(null!=Z)for(var da=0;da<Z.length;da++)0<da&&0==mxUtils.mod(da,4)&&mxUtils.br(C),aa(Z[da])});null==this.format.currentScheme?V(Math.min(I.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):V(this.format.currentScheme);O=10>=this.defaultColorSchemes.length?43:23;var M=document.createElement("div");M.className="geButton";M.style.cssText="position:absolute;left:0px;bottom:"+O+"px;width:20px;background-image:url("+Editor.chevronLeftImage++");";mxEvent.addListener(M,"click",mxUtils.bind(this,function(){V(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var X=document.createElement("div");X.className="geButton";X.style.cssText="position:absolute;left:186px;bottom:"+O+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(g.appendChild(M),g.appendChild(X));mxEvent.addListener(X,"click",mxUtils.bind(this,function(){V(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));+W(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&g.appendChild(E)}return g}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(g){return g.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||g.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==+Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(g){return Graph.isGoogleFontUrl(g)};Graph.rewriteGoogleFontUrl=function(g){null!=g&&g.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(g=Editor.GOOGLE_FONTS_CSS2+g.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return g};Graph.createFontElement=function(g,p){var v=Graph.fontMapping[p];null==v&&Graph.isCssFontUrl(p)?(g=document.createElement("link"),g.setAttribute("rel","stylesheet"),g.setAttribute("type","text/css"),g.setAttribute("charset",+"UTF-8"),g.setAttribute("href",Graph.rewriteGoogleFontUrl(p))):(null==v&&(v='@font-face {\nfont-family: "'+g+'";\nsrc: url("'+p+'");\n}'),g=document.createElement("style"),mxUtils.write(g,v));return g};Graph.addRecentCustomFont=function(g,p){};Graph.addFont=function(g,p,v,C){if(null!=g&&0<g.length&&null!=p&&0<p.length){C=null!=C?C:Graph.customFontElements;var E=g.toLowerCase();if("helvetica"!=E&&"arial"!=g&&"sans-serif"!=E){var I=C[E];null!=I&&I.url!=p&&(I.elt.parentNode.removeChild(I.elt),I=null);+null==I?(I=p,"http:"==p.substring(0,5)&&(I=PROXY_URL+"?url="+encodeURIComponent(p)),I={name:g,url:p,elt:Graph.createFontElement(g,I)},C[E]=I,p=C==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=v&&("link"==I.elt.nodeName.toLowerCase()?(I.elt.onload=v,I.elt.onerror=v):v()),null!=p&&p.appendChild(I.elt)):null!=v&&v()}else null!=v&&v()}else null!=v&&v();return g};Graph.getFontUrl=function(g,p){g=Graph.customFontElements[g.toLowerCase()];null!=g&&(p=g.url);return p};Graph.processFontAttributes=+function(g){g=g.getElementsByTagName("*");for(var p=0;p<g.length;p++){var v=g[p].getAttribute("data-font-src");if(null!=v){var C="FONT"==g[p].nodeName?g[p].getAttribute("face"):g[p].style.fontFamily;null!=C&&Graph.addFont(C,v)}}};Graph.processFontStyle=function(g){if(null!=g){var p=mxUtils.getValue(g,"fontSource",null);if(null!=p){var v=mxUtils.getValue(g,mxConstants.STYLE_FONTFAMILY,null);if(null!=v)try{Graph.addFont(v,decodeURIComponent(p))}catch(C){}}}return g};Graph.prototype.defaultThemeName=+"default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;mxConnectionHandler.prototype.createTarget="1"==urlParams.sketch;Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var l=Graph.prototype.init;Graph.prototype.init=+function(){function g(E){p=E}l.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var p=null;mxEvent.addListener(this.container,"mouseenter",g);mxEvent.addListener(this.container,"mousemove",g);mxEvent.addListener(this.container,"mouseleave",function(E){p=null});this.isMouseInsertPoint=function(){return null!=p};var v=this.getInsertPoint;this.getInsertPoint=function(E){return null==p||E?v.apply(this,arguments):this.getPointForEvent(p)};var C=this.layoutManager.getLayout;+this.layoutManager.getLayout=function(E){var I=this.graph.getCellStyle(E);if(null!=I&&"rack"==I.childLayout){var O=new mxStackLayout(this.graph,!1);O.gridSize=null!=I.rackUnitSize?parseFloat(I.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;O.marginLeft=I.marginLeft||0;O.marginRight=I.marginRight||0;O.marginTop=I.marginTop||0;O.marginBottom=I.marginBottom||0;O.allowGaps=I.allowGaps||0;O.horizontal="1"==mxUtils.getValue(I,"horizontalRack","0");O.resizeParent=!1;O.fill=+!0;return O}return C.apply(this,arguments)};this.updateGlobalUrlVariables()};var n=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(g,p){return Graph.processFontStyle(n.apply(this,arguments))};var r=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(g,p,v,C,E,I,O,Q,V,W,M,X){r.apply(this,arguments);Graph.processFontAttributes(X)};var t=mxText.prototype.redraw;mxText.prototype.redraw=function(){t.apply(this,arguments);null!=this.node&&+"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(g,p,v,C){function E(){for(var da=Q.getSelectionCells(),ba=[],ha=0;ha<da.length;ha++)Q.isCellVisible(da[ha])&&ba.push(da[ha]);Q.setSelectionCells(ba)}function I(da){Q.setHiddenTags(da?[]:V.slice());E();Q.refresh()}function O(da,ba){M.innerText="";if(0<da.length){var ha=document.createElement("table");ha.setAttribute("cellpadding","2");ha.style.boxSizing="border-box";ha.style.tableLayout="fixed";+ha.style.width="100%";var la=document.createElement("tbody");if(null!=da&&0<da.length)for(var ra=0;ra<da.length;ra++)(function(sa){function va(){var Ca=Q.getCellsForTags([sa],null,null,!0);Q.isEnabled()?Q.setSelectionCells(Ca):Q.highlightCells(Ca,null,null,70)}var wa=0>mxUtils.indexOf(Q.hiddenTags,sa),qa=document.createElement("tr"),Ba=document.createElement("td");Ba.style.align="center";Ba.style.width="16px";var Aa=document.createElement("img");Aa.setAttribute("src",wa?Editor.visibleImage:Editor.hiddenImage);+Aa.setAttribute("title",mxResources.get(wa?"hideIt":"show",[sa])+"\n"+mxResources.get("shiftClickShowOnly",[sa]));mxUtils.setOpacity(Aa,wa?75:25);Aa.className="geAdaptiveAsset";Aa.style.verticalAlign="middle";Aa.style.cursor="pointer";Aa.style.width="16px";if(p||Editor.isDarkMode())Aa.style.filter="invert(100%)";Ba.appendChild(Aa);mxEvent.addListener(Aa,"click",function(Ca){if(mxEvent.isShiftDown(Ca)){for(var ca=[],fa=0;fa<V.length;fa++)V[fa]!==sa&&ca.push(V[fa]);var oa=0<ca.length;for(fa=0;fa<ca.length;fa++)if(0>+mxUtils.indexOf(Q.hiddenTags,ca[fa])){oa=!1;break}oa&&0>mxUtils.indexOf(Q.hiddenTags,sa)?Q.setHiddenTags([]):Q.setHiddenTags(ca)}else Q.toggleHiddenTag(sa);E();Q.refresh();mxEvent.consume(Ca)});qa.appendChild(Ba);Ba=document.createElement("td");Ba.style.align="center";Ba.style.width="16px";Aa=document.createElement("img");Aa.setAttribute("src",Editor.selectImage);Aa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Aa,wa?75:25);Aa.className="geAdaptiveAsset";Aa.style.verticalAlign=+"middle";Aa.style.cursor="pointer";Aa.style.width="16px";if(p||Editor.isDarkMode())Aa.style.filter="invert(100%)";mxEvent.addListener(Aa,"click",function(Ca){I(!0);va();mxEvent.consume(Ca)});Ba.appendChild(Aa);qa.appendChild(Ba);Ba=document.createElement("td");Ba.style.overflow="hidden";Ba.style.whiteSpace="nowrap";Ba.style.textOverflow="ellipsis";Ba.style.verticalAlign="middle";Ba.style.cursor="pointer";Ba.setAttribute("title",sa);a=document.createElement("a");mxUtils.write(a,sa);a.style.textOverflow=+"ellipsis";a.style.position="relative";mxUtils.setOpacity(a,wa?100:40);Ba.appendChild(a);mxEvent.addListener(Ba,"click",function(Ca){if(mxEvent.isShiftDown(Ca))I(!0),va();else if(wa&&0<Q.hiddenTags.length)I(!0);else{var ca=V.slice(),fa=mxUtils.indexOf(ca,sa);ca.splice(fa,1);Q.setHiddenTags(ca);E();Q.refresh()}mxEvent.consume(Ca)});qa.appendChild(Ba);if(Q.isEnabled()){Ba=document.createElement("td");Ba.style.verticalAlign="middle";Ba.style.textAlign="center";Ba.style.width="18px";if(null==ba){Ba.style.align=+"center";Ba.style.width="16px";Aa=document.createElement("img");Aa.setAttribute("src",Editor.trashImage);Aa.setAttribute("title",mxResources.get("removeIt",[sa]));mxUtils.setOpacity(Aa,wa?75:25);Aa.className="geAdaptiveAsset";Aa.style.verticalAlign="middle";Aa.style.cursor="pointer";Aa.style.width="16px";if(p||Editor.isDarkMode())Aa.style.filter="invert(100%)";mxEvent.addListener(Aa,"click",function(Ca){var ca=mxUtils.indexOf(V,sa);0<=ca&&V.splice(ca,1);Q.removeTagsForCells(Q.model.getDescendants(Q.model.getRoot()),+[sa]);Q.refresh();mxEvent.consume(Ca)});Ba.appendChild(Aa)}else{var Da=document.createElement("input");Da.setAttribute("type","checkbox");Da.style.margin="0px";Da.defaultChecked=null!=ba&&0<=mxUtils.indexOf(ba,sa);Da.checked=Da.defaultChecked;Da.style.background="transparent";Da.setAttribute("title",mxResources.get(Da.defaultChecked?"removeIt":"add",[sa]));mxEvent.addListener(Da,"change",function(Ca){Da.checked?Q.addTagsForCells(Q.getSelectionCells(),[sa]):Q.removeTagsForCells(Q.getSelectionCells(),+[sa]);mxEvent.consume(Ca)});Ba.appendChild(Da)}qa.appendChild(Ba)}la.appendChild(qa)})(da[ra]);ha.appendChild(la);M.appendChild(ha)}}var Q=this,V=Q.hiddenTags.slice(),W=document.createElement("div");W.style.userSelect="none";W.style.overflow="hidden";W.style.padding="10px";W.style.height="100%";var M=document.createElement("div");M.style.position="absolute";M.style.boxSizing="border-box";M.style.userSelect="none";M.style.overflow="auto";M.style.padding="3px";M.style.left="0px";M.style.right="0px";+M.style.top="0px";M.style.bottom="0px";W.appendChild(M);Q.addListener(mxEvent.ROOT,function(){V=Q.hiddenTags.slice()});var X=mxUtils.bind(this,function(da,ba){if(g()){da=Q.getAllTags();for(ba=0;ba<da.length;ba++)0>mxUtils.indexOf(V,da[ba])&&V.push(da[ba]);V.sort();Q.isSelectionEmpty()?O(V):O(V,Q.getCommonTagsForCells(Q.getSelectionCells()))}});Q.selectionModel.addListener(mxEvent.CHANGE,X);Q.model.addListener(mxEvent.CHANGE,X);Q.addListener(mxEvent.REFRESH,X);var Z=document.createElement("div");Z.className=+"geToolbarContainer geDialogToolbar";Z.style.position="absolute";Z.style.display="flex";Z.style.bottom="0px";Z.style.left="0px";Z.style.right="0px";Z.style.height="32px";Z.style.overflow="hidden";Z.style.padding="3px 4px 4px 4px";Z.style.borderWidth="1px 0px 0px 0px";Z.style.borderStyle="solid";Z.style.whiteSpace="nowrap";if(Q.isEnabled()){M.style.bottom="32px";var Y=document.createElement("a");Y.className="geButton";var aa=Y.cloneNode(!1);aa.style.backgroundImage="url("+Editor.visibleImage+")";aa.setAttribute("title",+mxResources.get("reset"));mxEvent.addListener(aa,"click",function(da){Q.setHiddenTags([]);mxEvent.isShiftDown(da)||(V=Q.hiddenTags.slice());E();Q.refresh();mxEvent.consume(da)});Z.appendChild(aa);null!=v&&(Y=Y.cloneNode(!1),Y.style.backgroundImage="url("+Editor.plusImage+")",Y.setAttribute("title",mxResources.get("add")),mxEvent.addListener(Y,"click",function(da){v(V,function(ba){V=ba;X()});mxEvent.consume(da)}),Z.appendChild(Y));W.appendChild(Z)}null!=C&&Z.appendChild(C);return{div:W,refresh:X}};+Graph.prototype.getCustomFonts=function(){var g=this.extFonts;g=null!=g?g.slice():[];for(var p in Graph.customFontElements){var v=Graph.customFontElements[p];g.push({name:v.name,url:v.url})}return g};Graph.prototype.getExtFontCss=function(){for(var g=this.getCustomFonts(),p="",v="",C=0;C<g.length;C++){var E=g[C].name,I=g[C].url;Graph.isCssFontUrl(I)?p+="@import url("+Graph.rewriteGoogleFontUrl(I)+");\n":v+='@font-face {\nfont-family: "'+E+'";\nsrc: url("'+I+'");\n}\n'}return p+v};Graph.prototype.setFont=+function(g,p){Graph.addFont(g,p);var v=Editor.guid();document.execCommand("fontname",!1,v);for(var C=this.cellEditor.textarea.getElementsByTagName("font"),E=!1,I=0;I<C.length;I++)C[I].getAttribute("face")==v&&(E=!0,C[I].setAttribute("face",g),null!=p?C[I].setAttribute("data-font-src",p):C[I].removeAttribute("data-font-src"));E||document.execCommand("fontname",!1,g)};var x=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return x.apply(this,arguments)&&(!this.shadowVisible||+!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var g=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=g)for(var p in g)this.globalVars[p]=g[p]}catch(v){null!=window.console&&console.log("Error in vars URL parameter: "+v)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var B=+Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(g){var p=B.apply(this,arguments);null==p&&null!=this.globalVars&&(p=this.globalVars[g]);return p};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var g=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(g.ownerDocument)).decode(g)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var G=Graph.prototype.getSvg;Graph.prototype.getSvg=function(g,+p,v,C,E,I,O,Q,V,W,M,X,Z,Y,aa,da,ba){if(Editor.mathOutputSize&&this.mathEnabled&&null!=this.container&&document.body.contains(this.container)&&"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset){if(0==this.container.getElementsByTagName("mjx-container").length)try{MathJax.typeset([this.container])}catch(va){}this.refreshMathBounds()}var ha=G.apply(this,arguments);if(null!=X){var la=ha.getAttribute("style");null==la&&(la="");X="auto"==X||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?+"light":"light dark":X;ha.setAttribute("style",la+(" color-scheme: "+X+";"))}var ra=M?this.getExtFontCss():"";if(0<ra.length){var sa=ha.ownerDocument;la=null!=sa.createElementNS?sa.createElementNS(mxConstants.NS_SVG,"style"):sa.createElement("style");null!=sa.setAttributeNS?la.setAttributeNS("type","text/css"):la.setAttribute("type","text/css");la.appendChild(sa.createTextNode(ra));ha.getElementsByTagName("defs")[0].appendChild(la)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&+EditorUi.embedSvgImages(ha);this.mathEnabled&&(document.body.appendChild(ha),Editor.MathJaxRender(ha),ha.parentNode.removeChild(ha),la=ha.ownerDocument.getElementById("MJX-SVG-styles"),null!=la&&ha.getElementsByTagName("defs")[0].appendChild(la.cloneNode(!0)));return ha};var L=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(g){L.apply(this,arguments);null!=g.secondLabel&&(g.secondLabel.destroy(),g.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(g){return[g.shape,+g.text,g.secondLabel,g.control]};var D=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){D.apply(this,arguments);this.enumerationState=0};var T=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(g){null!=g.shape&&this.redrawEnumerationState(g);return T.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(g){g=decodeURIComponent(mxUtils.getValue(g.style,"enumerateValue",""));""==g&&(g=++this.enumerationState);+return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(g)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(g){var p="1"==mxUtils.getValue(g.style,"enumerate",0);p&&null==g.secondLabel?(g.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),g.secondLabel.size=12,g.secondLabel.state=g,g.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(g,g.secondLabel)):+p||null==g.secondLabel||(g.secondLabel.destroy(),g.secondLabel=null);p=g.secondLabel;if(null!=p){var v=g.view.scale,C=this.createEnumerationValue(g);g=this.graph.model.isVertex(g.cell)?new mxRectangle(g.x+g.width-4*v,g.y+4*v,0,0):mxRectangle.fromPoint(g.view.getPoint(g));p.bounds.equals(g)&&p.value==C&&p.scale==v||(p.bounds=g,p.value=C,p.scale=v,p.redraw())}};var N=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();N.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=+function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var R=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){R.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(g,p){"data:action/json,"==g.substring(0,17)&&(g=JSON.parse(g.substring(17)),null!=g.actions&&this.executeCustomActions(Graph.flattenAnimationActions(g.actions),+null,p))};Graph.flattenAnimationActions=function(g){if(!Array.isArray(g))return g;for(var p=[],v=0;v<g.length;v++){var C=g[v];if(null!=C&&null!=C.animation&&Array.isArray(C.animation.steps)){C=Graph.flattenAnimationActions(C.animation.steps);for(var E=0;E<C.length;E++)p.push(C[E])}else p.push(C)}return p};Graph.smoothScrollContainer=function(g,p,v,C,E,I){I=I||600;if(p!==C||v!==E){g.scrollLeft=p;g.scrollTop=v;var O="undefined"!=typeof performance&&null!=performance.now?performance.now():Date.now(),+Q=C-p,V=E-v,W=function(M){M=Math.min(1,(M-O)/I);var X=1-Math.pow(1-M,3);g.scrollLeft=p+Q*X;g.scrollTop=v+V*X;1>M&&window.requestAnimationFrame(W)};window.requestAnimationFrame(W)}};Graph.applyTransformTransition=function(g,p){p=p||600;var v=g.view.getDrawPane(),C=null!=v?v.parentNode:null;if(null!=C){var E=C.style.transition;C.style.transition="transform "+p+"ms cubic-bezier(0.16, 1, 0.3, 1)";g.armTransformTransition=!0;var I=function(){C.style.transition=E||"";g.armTransformTransition=!1;C.removeEventListener("transitionend",+I)};C.addEventListener("transitionend",I);window.setTimeout(I,p+100)}};Graph.prototype.fitBoundsCssTransform=function(g,p){var v=null!=p?p:10;p=this.view.graphBounds;var C=Math.max(p.x,g.x),E=Math.max(p.y,g.y),I=Math.max(1,Math.min(p.x+p.width,g.x+g.width)-C),O=Math.max(1,Math.min(p.y+p.height,g.y+g.height)-E),Q=this.container.clientWidth-v,V=this.container.clientHeight-v;g=Math.floor(20*Math.min(Q/I,V/O))/20;this.view.scaleAndTranslate(g,-p.x,-p.y);C=(C-p.x)*g-Math.max((Q-I*g)/2+v/2,0);v=(E-p.y)*+g-Math.max((V-O*g)/2+v/2,0);I=this.getBorder();E=p.width*g+2*I-this.container.clientWidth;p=p.height*g+2*I-this.container.clientHeight;this.container.scrollLeft=0>E?0:Math.max(0,Math.min(C,E));this.container.scrollTop=0>p?0:Math.max(0,Math.min(v,p))};Graph.prototype.isGraphTornDown=function(){return!0===this.destroyed||null==this.container};Graph.prototype.smoothFitWindow=function(g,p,v){if(this.isGraphTornDown())null!=v&&v();else{var C=this.container,E=C.scrollLeft,I=C.scrollTop;this.useCssTransforms?+(Graph.applyTransformTransition(this,600),this.fitBoundsCssTransform(g,p)):this.fitWindow(g,p);Graph.smoothScrollContainer(C,E,I,C.scrollLeft,C.scrollTop,600);null!=v&&window.setTimeout(v,600)}};Graph.prototype.scrollCellToVisibleCssTransform=function(g,p){var v=this.view.getState(g);if(null!=v){var C=this.view.graphBounds,E=this.view.scale;this.view.translate.x===-C.x&&this.view.translate.y===-C.y||this.view.scaleAndTranslate(E,-C.x,-C.y);g=this.container.clientWidth;var I=this.container.clientHeight,+O=this.getBorder(),Q=C.width*E+2*O-g;O=C.height*E+2*O-I;if(null!=p){var V=(v.x-C.x)*E,W=(v.y-C.y)*E,M=(v.x+v.width-C.x)*E;C=(v.y+v.height-C.y)*E;var X=this.container.scrollLeft;v=this.container.scrollTop;V-p<X?X=V-p:M+p>X+g&&(X=M+p-g);W-p<v?v=W-p:C+p>v+I&&(v=C+p-I)}else X=(v.x+v.width/2-C.x)*E-g/2,v=(v.y+v.height/2-C.y)*E-I/2;this.container.scrollLeft=0>Q?0:Math.max(0,Math.min(X,Q));this.container.scrollTop=0>O?0:Math.max(0,Math.min(v,O))}};Graph.prototype.scrollCellToVisibleBorder=function(g,p){null==+p?this.scrollCellToVisible(g):(g=this.view.getState(g),null!=g&&this.scrollRectToVisible(new mxRectangle(-this.view.translate.x+g.x-p,-this.view.translate.y+g.y-p,g.width+2*p,g.height+2*p)))};Graph.prototype.smoothScrollCellToVisible=function(g,p,v){if(this.isGraphTornDown())null!=v&&v();else{var C=this.container,E=C.scrollLeft,I=C.scrollTop;this.useCssTransforms?this.scrollCellToVisibleCssTransform(g,p):this.scrollCellToVisibleBorder(g,p);Graph.smoothScrollContainer(C,E,I,C.scrollLeft,C.scrollTop,+600);null!=v&&window.setTimeout(v,600)}};Graph.prototype.toggleCellsTransient=function(g){g=this.getNodesForCells(g);for(var p=0;p<g.length;p++){var v=g[p].style.opacity;v=""===v||null===v||0<parseFloat(v);g[p].style.opacity=v?0:1}};Graph.prototype.setCellStylesTransient=function(g,p,v){for(var C=0;C<v.length;C++){var E=this.view.getState(v[C]);null!=E&&null!=E.style&&(null==p?delete E.style[g]:E.style[g]=p,null!=E.shape&&(E.shape.apply(E),E.shape.redraw()),null!=E.text&&(E.text.apply(E),E.text.redraw()))}};+Graph.prototype.toggleCellStylesTransient=function(g,p,v){null==p&&(p="0");for(var C=0;C<v.length;C++){var E=this.view.getState(v[C]);if(null!=E&&null!=E.style){var I=mxUtils.getValue(E.style,g,p)?"0":"1";E.style[g]=I;null!=E.shape&&(E.shape.apply(E),E.shape.redraw());null!=E.text&&(E.text.apply(E),E.text.redraw())}}};Graph.prototype.executeCustomActions=function(g,p,v){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),+null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var C=!1,E=0,I=0,O=mxUtils.bind(this,function(){C||(C=!0,this.model.beginUpdate())}),Q=mxUtils.bind(this,function(){C&&(C=!1,this.model.endUpdate())}),V=null==v,W=function(Z){return null!=Z.transient?Z.transient:V},M=mxUtils.bind(this,function(){0<E&&E--;0==E&&X()}),X=mxUtils.bind(this,function(){if(this.isGraphTornDown())this.stoppingCustomActions=+this.executingCustomActions=!1,null!=p&&p();else if(I<g.length){do{var Z=this.stoppingCustomActions,Y=g[I++],aa=[];if(null!=Y.open)if(Q(),this.isCustomLink(Y.open)){if(!this.customLinkClicked(Y.open,v))return}else this.openLink(Y.open);null==Y.wait||Z||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;M()}),E++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Y.wait?parseInt(Y.wait):1E3),Q());null!=Y.opacity&&+null!=Y.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Y.opacity,!0)),Y.opacity.value);null!=Y.fadeIn&&(E++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeIn,!0)),0,1,M,Z?0:Y.fadeIn.delay));null!=Y.fadeOut&&(E++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeOut,!0)),1,0,M,Z?0:Y.fadeOut.delay));if(null!=Y.fadeTo&&null!=Y.fadeTo.value){E++;var da=this.getNodesForCells(this.getCellsForAction(Y.fadeTo,!0)),ba=Z?0:null!=Y.fadeTo.delay?+Y.fadeTo.delay:1E3;Graph.setTransitionForNodes(da,"all "+ba+"ms ease-in-out");Graph.setOpacityForNodes(da,Y.fadeTo.value);window.setTimeout(function(){Graph.setTransitionForNodes(da,null);M()},ba)}null!=Y.flow&&(ba=this.getCellsForAction(Y.flow,!0),Editor.toggleFlowAnimation(this,ba,!1===Y.flow.start?"stop":!0===Y.flow.start?"start":"toggle"));null!=Y.wipeIn&&(aa=aa.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeIn,!0),!0)));null!=Y.wipeOut&&(aa=aa.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeOut,+!0),!1)));null!=Y.popIn&&(aa=aa.concat(this.createPopAnimations(this.getCellsForAction(Y.popIn,!0),!0)));null!=Y.popOut&&(aa=aa.concat(this.createPopAnimations(this.getCellsForAction(Y.popOut,!0),!1)));null!=Y.toggle&&(W(Y.toggle)?this.toggleCellsTransient(this.getCellsForAction(Y.toggle,!0)):(O(),this.toggleCells(this.getCellsForAction(Y.toggle,!0,!0))));null!=Y.show&&(ba=this.getCellsForAction(Y.show,!0),Graph.setOpacityForNodes(this.getNodesForCells(ba),1),W(Y.show)||(O(),this.setCellsVisible(this.getCellsForAction(Y.show,+!0,!0),!0)));null!=Y.hide&&(ba=this.getCellsForAction(Y.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ba),0),W(Y.hide)||(O(),this.setCellsVisible(this.getCellsForAction(Y.hide,!0,!0),!1)));if(null!=Y.toggleStyle&&null!=Y.toggleStyle.key){ba=this.getCellsForAction(Y.toggleStyle,!0);var ha=null!=Y.toggleStyle.defaultValue?Y.toggleStyle.defaultValue:"0";W(Y.toggleStyle)?this.toggleCellStylesTransient(Y.toggleStyle.key,ha,ba):(O(),this.toggleCellStyles(Y.toggleStyle.key,ha,ba))}null!=Y.style&&+null!=Y.style.key&&(ba=this.getCellsForAction(Y.style,!0),W(Y.style)?this.setCellStylesTransient(Y.style.key,Y.style.value,ba):(O(),this.setCellStyles(Y.style.key,Y.style.value,ba)));ba=[];null!=Y.select&&this.isEnabled()&&(ba=this.getCellsForAction(Y.select),this.setSelectionCells(ba));null!=Y.highlight&&(ba=this.getCellsForAction(Y.highlight),this.highlightCells(ba,Y.highlight.color,Y.highlight.duration,Y.highlight.opacity));null!=Y.scroll&&(ba=this.getCellsForAction(Y.scroll));null!=Y.viewbox&&+(!0!==Y.viewbox.smooth||Z?this.useCssTransforms?this.fitBoundsCssTransform(Y.viewbox,Y.viewbox.border):this.fitWindow(Y.viewbox,Y.viewbox.border):(E++,this.smoothFitWindow(Y.viewbox,Y.viewbox.border,M)));0<ba.length&&(ha=null==Y.scroll||null==Y.scroll.border||""===Y.scroll.border||isNaN(parseFloat(Y.scroll.border))?null:parseFloat(Y.scroll.border),null==Y.scroll||!0!==Y.scroll.smooth||Z?this.useCssTransforms?this.scrollCellToVisibleCssTransform(ba[0],ha):this.scrollCellToVisibleBorder(ba[0],ha):(E++,+this.smoothScrollCellToVisible(ba[0],ha,M)));null!=v&&null!=Y.explore&&Graph.exploreFromCell(this,v,Y.explore);if(null!=Y.tags){if(null!=Y.tags.toggle)for(ha=Y.tags.toggle,0==ha.length&&(ha=this.getAllTags()),ba=0;ba<ha.length;ba++)this.toggleHiddenTag(ha[ba]);ha=null;null!=Y.tags.hidden&&(null==ha&&(ha=[]),ha=ha.concat(Y.tags.hidden));if(null!=Y.tags.visible){null==ha&&(ha=[]);var la=this.getAllTags();for(ba=0;ba<la.length;ba++)0>mxUtils.indexOf(Y.tags.visible,la[ba])&&0>mxUtils.indexOf(ha,la[ba])&&+ha.push(la[ba])}null!=ha&&this.setHiddenTags(ha);this.refresh()}if(0<aa.length){E++;ba=null!=Y.steps?Y.steps:30;ha=Y.delay;la=["wipeIn","wipeOut","popIn","popOut"];for(var ra=null,sa=0;sa<la.length;sa++){var va=Y[la[sa]];null!=va&&null!=va.delay&&(ra=null==ra?va.delay:Math.max(ra,va.delay))}null!=ra&&(ha=ra/ba);this.executeAnimations(aa,M,Z?1:ba,Z?0:ha)}}while(I<g.length&&!0===g[I].immediate&&!this.stoppingCustomActions);0==E?X():Q()}else this.stoppingCustomActions=this.executingCustomActions=!1,+Q(),null!=p&&p()});X()}};Graph.prototype.doUpdateCustomLinksForCell=function(g,p){var v=this.getLinkForCell(p);null!=v&&"data:action/json,"==v.substring(0,17)&&this.setLinkForCell(p,this.updateCustomLink(g,v));if(this.isHtmlLabel(p)){var C=document.createElement("div");C.innerHTML=Graph.sanitizeHtml(this.getLabel(p));for(var E=C.getElementsByTagName("a"),I=!1,O=0;O<E.length;O++)v=E[O].getAttribute("href"),null!=v&&"data:action/json,"==v.substring(0,17)&&(E[O].setAttribute("href",this.updateCustomLink(g,+v)),I=!0);I&&this.labelChanged(p,C.innerHTML)}};Graph.prototype.updateCustomLink=function(g,p){if("data:action/json,"==p.substring(0,17))try{var v=JSON.parse(p.substring(17));null!=v.actions&&(this.updateCustomLinkActions(g,v.actions),p="data:action/json,"+JSON.stringify(v))}catch(C){}return p};Graph.prototype.updateCustomLinkActions=function(g,p){for(var v=0;v<p.length;v++){var C=p[v],E;for(E in C)this.updateCustomLinkAction(g,C[E],"cells"),this.updateCustomLinkAction(g,C[E],"excludeCells"),this.updateCustomLinkAction(g,+C[E],"layers")}};Graph.prototype.updateCustomLinkAction=function(g,p,v){if(null!=p&&null!=p[v]){for(var C=[],E=0;E<p[v].length;E++)if("*"==p[v][E])C.push(p[v][E]);else{var I=g[p[v][E]];null!=I?""!=I&&C.push(I):C.push(p[v][E])}p[v]=C}};Graph.prototype.getCellsForAction=function(g,p,v){var C="or"===g.tagsMatch?"or":"and",E={},I=[],O=function(Q){for(var V=0;V<Q.length;V++){var W=Q[V].id;E[W]||(E[W]=!0,I.push(Q[V]))}};O(this.getCellsById(g.cells));O(this.getCellsForTags(g.tags,null,p,!1,C));O(v?this.getLayerCells(g.layers):+this.getCellsForLayers(g.layers));if(null!=g.excludeCells&&0<g.excludeCells.length){p={};C=!1;for(v=0;v<g.excludeCells.length;v++){if("*"===g.excludeCells[v]){C=!0;break}p[g.excludeCells[v]]=!0}if(C)return[];g=[];for(v=0;v<I.length;v++)p[I[v].id]||g.push(I[v]);return g}return I};Graph.prototype.getCellsById=function(g){var p=[];if(null!=g)for(var v=0;v<g.length;v++)if("*"==g[v]){var C=this.model.getRoot();p=p.concat(this.model.filterDescendants(function(I){return I!=C},C))}else{var E=this.model.getCell(g[v]);+null!=E&&p.push(E)}return p};Graph.prototype.getCellsForLayers=function(g){var p=[];if(Array.isArray(g))for(var v=0;v<g.length;v++){var C=this.model.getCell(g[v]);null!=C&&(p=p.concat(this.model.filterDescendants(function(E){return E!=C},C)))}return p};Graph.prototype.getLayerCells=function(g){var p=[];if(Array.isArray(g))for(var v=0;v<g.length;v++){var C=this.model.getCell(g[v]);null!=C&&p.push(C)}return p};var P=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(g){return P.apply(this,+arguments)&&!this.isAllTagsHidden(this.getTagsForCell(g))};Graph.prototype.setHiddenTags=function(g){this.hiddenTags=g;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(g){var p=mxUtils.indexOf(this.hiddenTags,g);0>p?this.hiddenTags.push(g):0<=p&&this.hiddenTags.splice(p,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(g){if(null==g||0==g.length||0==this.hiddenTags.length)return!1;g=g.split(" ");if(g.length>+this.hiddenTags.length)return!1;for(var p=0;p<g.length;p++)if(0>mxUtils.indexOf(this.hiddenTags,g[p]))return!1;return!0};Graph.prototype.getCellsForTags=function(g,p,v,C,E){var I=[];E="or"===E;if(null!=g){p=null!=p?p:this.model.getDescendants(this.model.getRoot());for(var O=0,Q={},V=0;V<g.length;V++)0<g[V].length&&(Q[g[V]]=!0,O++);for(V=0;V<p.length;V++)if(v&&this.model.getParent(p[V])==this.model.root||this.model.isVertex(p[V])||this.model.isEdge(p[V])){var W=this.getTagsForCell(p[V]),M=!1;if(0<+W.length&&(W=W.split(" "),E||W.length>=g.length)){for(var X=M=0;X<W.length&&M<O;X++)null!=Q[W[X]]&&M++;M=E?0<M:M==O}M&&(1!=C||this.isCellVisible(p[V]))&&I.push(p[V])}}return I};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(g){for(var p=null,v=[],C=0;C<g.length;C++){var E=this.getTagsForCell(g[C]);v=[];if(0<E.length){E=E.split(" ");for(var I={},O=0;O<E.length;O++)if(null==p||null!=p[E[O]])I[E[O]]=+!0,v.push(E[O]);p=I}else return[]}return v};Graph.prototype.getTagsForCells=function(g){for(var p=[],v={},C=0;C<g.length;C++){var E=this.getTagsForCell(g[C]);if(0<E.length){E=E.split(" ");for(var I=0;I<E.length;I++)null==v[E[I]]&&(v[E[I]]=!0,p.push(E[I]))}}return p};Graph.prototype.getTagsForCell=function(g){return this.getAttributeForCell(g,"tags","")};Graph.prototype.addTagsForCells=function(g,p){if(0<g.length&&0<p.length){this.model.beginUpdate();try{for(var v=0;v<g.length;v++){for(var C=this.getTagsForCell(g[v]),+E=C.split(" "),I=!1,O=0;O<p.length;O++){var Q=mxUtils.trim(p[O]);""!=Q&&0>mxUtils.indexOf(E,Q)&&(C=0<C.length?C+" "+Q:Q,I=!0)}I&&this.setAttributeForCell(g[v],"tags",C)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(g,p){if(0<g.length&&0<p.length){this.model.beginUpdate();try{for(var v=0;v<g.length;v++){var C=this.getTagsForCell(g[v]);if(0<C.length){for(var E=C.split(" "),I=!1,O=0;O<p.length;O++){var Q=mxUtils.indexOf(E,p[O]);0<=Q&&(E.splice(Q,1),I=!0)}I&&this.setAttributeForCell(g[v],+"tags",E.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(g){this.model.beginUpdate();try{for(var p=0;p<g.length;p++)this.model.setVisible(g[p],!this.model.isVisible(g[p]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(g,p){this.model.beginUpdate();try{for(var v=0;v<g.length;v++)this.model.setVisible(g[v],p)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(g,p,v,C){for(var E=0;E<g.length;E++)this.highlightCell(g[E],+p,v,C)};Graph.prototype.highlightCell=function(g,p,v,C,E){p=null!=p?p:mxConstants.DEFAULT_VALID_COLOR;v=null!=v?v:1E3;g=this.view.getState(g);var I=null;null!=g&&(E=null!=E?E:4,E=Math.max(E+1,mxUtils.getValue(g.style,mxConstants.STYLE_STROKEWIDTH,1)+E),I=new mxCellHighlight(this,p,E,!1),null!=C&&(I.opacity=C),I.highlight(g),window.setTimeout(function(){null!=I.shape&&(mxUtils.setPrefixedStyle(I.shape.node.style,"transition","all 1200ms ease-in-out"),I.shape.node.style.opacity=0);window.setTimeout(function(){I.destroy()},+1200)},v));return I};Graph.prototype.addSvgShadow=function(g,p,v,C){C=null!=C?C:!0;var E=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=v&&v||(p=null!=p?p:g.getElementsByTagName("g")[0],null!=p&&(this.updateShadowFilter(p,!0),!isNaN(parseInt(g.getAttribute("width")))&&C&&(g.setAttribute("width",parseInt(g.getAttribute("width"))+E),g.setAttribute("height",parseInt(g.getAttribute("height"))+E),p=g.getAttribute("viewBox"),null!=p&&0<p.length&&(p=p.split(" "),3<p.length&&(w=parseFloat(p[2])+E,+h=parseFloat(p[3])+E,g.setAttribute("viewBox",p[0]+" "+p[1]+" "+w+" "+h))))));return E};Graph.prototype.updateShadowFilter=function(g,p){mxClient.IS_SF||(p?(p=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),g.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+p.cssText+")"):g.style.filter="")};Graph.prototype.setShadowVisible=function(g,p){p=null!=p?p:!0;this.shadowVisible=+g;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);p&&this.fireEvent(new mxEventObject("shadowVisibleChanged"));return Math.ceil(this.svgShadowSize*this.svgShadowBlur)};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var g=this.model.getChildCount(this.model.root),p=0;do var v=this.model.getChildAt(this.model.root,+p);while(p++<g&&"1"==mxUtils.getValue(this.getCellStyle(v),"locked","0"));null!=v&&this.setDefaultParent(v)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=+[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",+STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",+STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=+[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=+[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=+[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];+mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH++"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=+[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",+STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];+mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=+[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(g){var p=null;null!=g&&0<g.length&&("ER"==g.substring(0,2)?p="mxgraph.er":"sysML"==g.substring(0,5)&&(p="mxgraph.sysml"));return p};var U=mxMarker.createMarker;mxMarker.createMarker=function(g,p,v,C,E,I,O,Q,V,W){if(null!=v&&null==mxMarker.markers[v]){var M=this.getPackageForType(v);null!=M&&mxStencilRegistry.getStencil(M)}return U.apply(this,arguments)};var S=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(g,+p,v,C,E,I){"1"==mxUtils.getValue(p.style,"lineShape",null)&&g.setFillColor(mxUtils.getValue(p.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return S.apply(this,arguments)};PrintDialog.prototype.create=function(g,p,v,C){function E(){ha.value=Math.max(1,Math.min(Z,Math.max(parseInt(ha.value),parseInt(ba.value))));ba.value=Math.max(1,Math.min(Z,Math.min(parseInt(ha.value),parseInt(ba.value))))}function I(Ha){g.lastPrintPagesRadioChecked=da.checked;g.lastPrintSelectionOnlyChecked=la.checked;g.lastPrintCropRadioChecked=+sa.checked;g.lastPrintFitRadioChecked=va.checked;da.checked&&ba.value<ha.value?(g.lastPrintPagesFromInput=ba.value,g.lastPrintPagesToInput=ha.value):(g.lastPrintPagesFromInput=null,g.lastPrintPagesToInput=null);ia.value=Math.max(1,Math.min(1600,parseInt(ia.value)))+"%";g.lastPrintZoom=ia.value;g.lastPrintBorder=ya.value;g.lastPrintGrid=ka.checked;g.lastPrintShadow=ea.checked;g.lastPrintTransparent=ja.checked;g.lastPrintInclude=ta.checked;g.lastPrintSheetsAcross=pa.value;g.lastPrintSheetsDown=ua.value;+var Ja={};Ja.border=parseInt(ya.value);Ja.scale=parseInt(ia.value)/100;Ja.grid=ka.checked;Ja.shadows=ea.checked;Ja.transparent=ja.checked;Ja.includeCopy=ta.checked;Ja.sheetsAcross=parseInt(pa.value);Ja.sheetsDown=parseInt(ua.value);Ja.pagesFrom=parseInt(ba.value);Ja.pagesTo=parseInt(ha.value);Ja.allPages=Y.checked;Ja.selection=la.checked;Ja.pageView=ra.checked;Ja.crop=sa.checked;Ja.fit=va.checked;return null!=v?v(!Ha,Ja):g.print(!Ha,Ja)}function O(Ha){try{g.hideDialog(),null!=v?I(Ha):g.spinner.spin(document.body,+mxResources.get("updatingPreview"))&&window.setTimeout(function(){try{I(Ha),g.spinner.stop()}catch(Ja){g.handleError(Ja)}},0)}catch(Ja){g.handleError(Ja)}}var Q=g.editor.graph,V=document.createElement("div");V.style.display="flex";V.style.flexDirection="column";V.style.minHeight="0";var W=document.createElement("div");W.style.flex="1 1 auto";W.style.minHeight="0";W.style.overflowY="auto";V.appendChild(W);var M=document.createElement("h3");mxUtils.write(M,p||mxResources.get("print"));W.appendChild(M);+var X=1,Z=1;M=document.createElement("div");M.className="geDialogSection";M.style.whiteSpace="nowrap";var Y=document.createElement("input");Y.style.marginRight="8px";Y.setAttribute("type","radio");Y.setAttribute("name","pages-printdialog");Y.setAttribute("id","gePrintDlgAllPages");var aa=document.createElement("div");aa.className="geDialogCheckRow";aa.appendChild(Y);p=document.createElement("label");p.setAttribute("for","gePrintDlgAllPages");mxUtils.write(p,mxResources.get("allPages"));aa.appendChild(p);+M.appendChild(aa);var da=document.createElement("input");da.style.marginRight="8px";da.setAttribute("type","radio");da.setAttribute("name","pages-printdialog");da.setAttribute("id","gePrintDlgPages");aa=document.createElement("div");aa.className="geDialogCheckRow";aa.appendChild(da);p=document.createElement("label");p.setAttribute("for","gePrintDlgPages");mxUtils.write(p,mxResources.get("pages")+":");aa.appendChild(p);var ba=document.createElement("input");ba.style.margin="0 4px";ba.setAttribute("value",+"1");ba.setAttribute("type","number");ba.setAttribute("min","1");ba.style.width="40px";aa.appendChild(ba);p=document.createElement("span");mxUtils.write(p,mxResources.get("to"));aa.appendChild(p);var ha=ba.cloneNode(!0);aa.appendChild(ha);mxEvent.addListener(ba,"focus",function(){da.checked=!0});mxEvent.addListener(ha,"focus",function(){da.checked=!0});mxEvent.addListener(ba,"change",E);mxEvent.addListener(ha,"change",E);if(null!=g.pages&&(Z=g.pages.length,null!=g.currentPage))for(p=0;p<Z;p++)if(g.currentPage==+g.pages[p]){X=p+1;break}null!=g.lastPrintPagesFromInput&&null!=g.lastPrintPagesToInput?(ba.value=Math.min(Z,Math.max(1,g.lastPrintPagesFromInput)),ha.value=Math.min(Z,Math.max(1,g.lastPrintPagesToInput))):(ba.value=X,ha.value=X);ba.setAttribute("max",Z);ha.setAttribute("max",Z);p=mxUtils.button(mxResources.get("currentPage"),function(Ha){ba.value=X;ha.value=X;da.checked=!0});p.className="geBtn";p.setAttribute("title",mxResources.get("currentPage"));p.style.marginLeft="4px";p.style.maxWidth="100px";+aa.appendChild(p);M.appendChild(aa);1<Z&&W.appendChild(M);aa=document.createElement("div");aa.className="geDialogCheckRow";var la=document.createElement("input");la.setAttribute("name","pages-printdialog");la.setAttribute("type",1==Z?"checkbox":"radio");la.setAttribute("id","gePrintDlgSelectionOnly");la.style.marginRight="8px";Q.isSelectionEmpty()&&la.setAttribute("disabled","disabled");Q.isEnabled()&&(aa.appendChild(la),p=document.createElement("label"),p.setAttribute("for","gePrintDlgSelectionOnly"),+mxUtils.write(p,mxResources.get("selectionOnly")),aa.appendChild(p));Q.isEnabled()&&(1<Z?M.appendChild(aa):(p=document.createElement("div"),p.className="geDialogSection",p.appendChild(aa),W.appendChild(p)));!g.isPagesEnabled()||g.lastPrintPagesRadioChecked?da.checked=!0:!Q.isSelectionEmpty()&&g.lastPrintSelectionOnlyChecked?la.checked=!0:Y.checked=!0;Q=g.addAdvancedSection(W);W=Q.content;M=document.createElement("div");M.className="geDialogCheckRow";var ra=document.createElement("input");ra.style.marginRight=+"8px";ra.setAttribute("type","radio");ra.setAttribute("name","printSize");ra.setAttribute("id","gePrintDlgPageView");M.appendChild(ra);p=document.createElement("label");p.setAttribute("for","gePrintDlgPageView");mxUtils.write(p,mxResources.get("pageView"));M.appendChild(p);mxEvent.addListener(M,"click",function(){ra.checked=!0});W.appendChild(M);M=document.createElement("div");M.className="geDialogCheckRow";var sa=document.createElement("input");sa.style.marginRight="8px";sa.setAttribute("type","radio");+sa.setAttribute("name","printSize");sa.setAttribute("id","gePrintDlgCrop");M.appendChild(sa);p=document.createElement("label");p.setAttribute("for","gePrintDlgCrop");mxUtils.write(p,mxResources.get("crop"));M.appendChild(p);mxEvent.addListener(M,"click",function(){sa.checked=!0});W.appendChild(M);M=document.createElement("div");M.className="geDialogCheckRow";M.style.alignItems="flex-start";var va=document.createElement("input");va.style.marginTop="4px";va.setAttribute("type","radio");va.setAttribute("name",+"printSize");M.appendChild(va);aa=document.createElement("table");aa.style.display="inline-block";aa.style.borderSpacing="0";var wa=document.createElement("tbody"),qa=document.createElement("tr"),Ba=qa.cloneNode(!0),Aa=document.createElement("td"),Da=Aa.cloneNode(!0),Ca=Aa.cloneNode(!0),ca=Aa.cloneNode(!0),fa=Aa.cloneNode(!0),oa=Aa.cloneNode(!0);Aa.style.textAlign="right";ca.style.textAlign="right";mxUtils.write(Aa,mxResources.get("fitTo"));mxEvent.addListener(M,"click",function(Ha){mxEvent.getSource(Ha)!=+va&&(va.checked=!va.checked)});var pa=document.createElement("input");pa.style.margin="0 2px";pa.style.boxSizing="border-box";pa.setAttribute("value",g.lastPrintSheetsAcross||"1");pa.setAttribute("min","1");pa.setAttribute("type","number");pa.style.width="40px";Da.appendChild(pa);p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsAcross"));Ca.appendChild(p);mxUtils.write(ca,mxResources.get("fitToBy"));var ua=pa.cloneNode(!0);ua.setAttribute("value",g.lastPrintSheetsDown||+"1");fa.appendChild(ua);mxEvent.addListener(pa,"click",function(Ha){va.checked=!0;mxEvent.consume(Ha)});mxEvent.addListener(ua,"click",function(Ha){va.checked=!0;mxEvent.consume(Ha)});g.lastPrintCropRadioChecked?sa.checked=!0:g.lastPrintFitRadioChecked?va.checked=!0:ra.checked=!0;p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsDown"));oa.appendChild(p);qa.appendChild(Aa);qa.appendChild(Da);qa.appendChild(Ca);Ba.appendChild(ca);Ba.appendChild(fa);Ba.appendChild(oa);wa.appendChild(qa);+wa.appendChild(Ba);aa.appendChild(wa);M.appendChild(aa);W.appendChild(M);W=document.createElement("div");W.className="geDialogSection";p=document.createElement("div");p.className="geDialogFormRow";M=document.createElement("label");M.className="geDialogFormLabel";M.setAttribute("for","gePrintDlgBorder");mxUtils.write(M,mxResources.get("borderWidth"));p.appendChild(M);var ya=document.createElement("input");ya.setAttribute("type","number");ya.setAttribute("min","0");ya.setAttribute("id","gePrintDlgBorder");+ya.style.width="40px";ya.value=null!=g.lastPrintBorder?g.lastPrintBorder:mxPrintPreview.prototype.pageMargin;p.appendChild(ya);M=document.createElement("label");M.setAttribute("for","gePrintDlgZoom");M.style.marginLeft="12px";M.style.marginRight="4px";mxUtils.write(M,mxResources.get("zoom"));p.appendChild(M);var ia=document.createElement("input");ia.setAttribute("id","gePrintDlgZoom");ia.style.width="60px";ia.value=null!=g.lastPrintZoom?g.lastPrintZoom:"100%";p.appendChild(ia);W.appendChild(p);M=+document.createElement("div");M.className="geDialogCheckRow";var ka=document.createElement("input");ka.setAttribute("type","checkbox");ka.setAttribute("id","gePrintDlgGrid");ka.style.marginRight="8px";ka.checked=null!=g.lastPrintGrid?g.lastPrintGrid:!1;M.appendChild(ka);p=document.createElement("label");p.setAttribute("for","gePrintDlgGrid");mxUtils.write(p,mxResources.get("grid"));M.appendChild(p);W.appendChild(M);M=document.createElement("div");M.className="geDialogCheckRow";var ea=document.createElement("input");+ea.setAttribute("type","checkbox");ea.setAttribute("id","gePrintDlgShadows");ea.style.marginRight="8px";ea.checked=null!=g.lastPrintShadow?g.lastPrintShadow:!1;M.appendChild(ea);p=document.createElement("label");p.setAttribute("for","gePrintDlgShadows");mxUtils.write(p,mxResources.get("shadows"));M.appendChild(p);g.isOffline()&&!mxClient.IS_CHROMEAPP||M.appendChild(g.createHelpIcon("https://www.drawio.com/docs/manual/export/print-diagram/#shadows-in-print-and-pdf-export"));Editor.enableShadowOption||+(M.style.display="none");W.appendChild(M);var ja=document.createElement("input");ja.setAttribute("type","checkbox");ja.setAttribute("id","gePrintDlgTransparent");ja.style.marginRight="8px";ja.checked=null!=g.lastPrintTransparent?g.lastPrintTransparent:!1;null!=v&&(M=document.createElement("div"),M.className="geDialogCheckRow",M.appendChild(ja),p=document.createElement("label"),p.setAttribute("for","gePrintDlgTransparent"),mxUtils.write(p,mxResources.get("transparentBackground")),M.appendChild(p),+W.appendChild(M));var ta=document.createElement("input");ta.setAttribute("type","checkbox");ta.setAttribute("id","gePrintDlgInclude");ta.style.marginRight="8px";ta.checked=null!=g.lastPrintInclude?g.lastPrintInclude:Editor.defaultIncludeDiagram;null==v||mxClient.IS_CHROMEAPP||"draw.io"!=g.getServiceName()||(M=document.createElement("div"),M.className="geDialogCheckRow",M.appendChild(ta),p=document.createElement("label"),p.setAttribute("for","gePrintDlgInclude"),mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram")),M.appendChild(p),W.appendChild(M));Q.wrapper.appendChild(W);p=document.createElement("div");p.style.flex="0 0 auto";p.style.marginTop="16px";p.style.textAlign="right";p.style.whiteSpace="nowrap";g.isOffline()&&!mxClient.IS_CHROMEAPP||null!=v||p.appendChild(g.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));Q=mxUtils.button(mxResources.get("cancel"),function(){g.hideDialog()});Q.className="geBtn";g.editor.cancelFirst&&p.appendChild(Q);PrintDialog.previewEnabled&&null==v&&(W=mxUtils.button(mxResources.get("preview"),function(){O(!1)}),W.className="geBtn",p.appendChild(W));C=null!=C?C:null!=v?"export":PrintDialog.previewEnabled?"print":"ok";C=mxUtils.button(mxResources.get(C),function(){O(!0)});C.className="geBtn gePrimaryBtn";p.appendChild(C);g.editor.cancelFirst||p.appendChild(Q);V.appendChild(p);if(g.editor.isChromelessView()){var xa=function(){Editor.isDarkMode()?(V.classList.add("geDarkMode"),V.style.colorScheme="dark"):(V.classList.remove("geDarkMode"),V.style.colorScheme="light")};g.addListener("darkModeChanged",xa);xa();var Ea=function(Ha,Ja){Ha=Ja.getProperty("dialog");V.parentNode==Ha.container&&(g.editor.removeListener(Ea),g.removeListener(xa))};g.editor.addListener("hideDialog",Ea)}this.container=V};var z=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var g=this.image;null!=@@ -13702,7 +13706,7 @@ p.running=!1:p.cancelled?(p.restoreOpacity(),p.running=!1):(p.snapshotOpacity(),[],p=this.collectReferencedCells(),v=0;v<p.length;v++)this.graph.getModel().isEdge(p[v])&&g.push(p[v]);0<g.length&&Editor.toggleFlowAnimation(this.graph,g,"stop")};Editor.toggleFlowAnimation=function(g,p,v){v=v||"toggle";for(var C=0;C<p.length;C++)if(g.getModel().isEdge(p[C])){var E=g.view.getState(p[C]);if(null!=E&&null!=E.shape){var I=null!=E.shape.getFlowAnimationPath?E.shape.getFlowAnimationPath():null;if(null!=I){var O="mxEdgeFlow"==I.getAttribute("class"),Q="start"==v||"toggle"==v&&!O;O="stop"==v||"toggle"==v&&O;E="1"==mxUtils.getValue(E.style,mxConstants.STYLE_DASHED,"0");O?(I.removeAttribute("class"),E||I.removeAttribute("stroke-dasharray")):Q&&(I.setAttribute("class","mxEdgeFlow"),E||I.setAttribute("stroke-dasharray","8"))}}}};Editor.playAnimationOnGraph=function(g,p){var v=g.getModel().getRoot(),C=null;null!=v.value&&"object"==typeof v.value&&(C=v.value.getAttribute("animation"));if(null==C||""==C)return null;try{var E=Editor.parseAnimationData(C)}catch(O){return null}if(!E.steps||0==E.steps.length||!1===E.enabled)return null;v={};if(null!=p)for(var I in p)v[I]=p[I];null==v.loop&&(v.loop=E.loop);null==v.defer&&(v.defer=!0);g=new Editor.AnimationPlayer(g,E);g.play(v);return g};Editor.installAnimationStyles=function(){if(!Editor.animationStylesInstalled){Editor.animationStylesInstalled=!0;try{var g=document.createElement("style");g.type="text/css";g.appendChild(document.createTextNode(".mxEdgeFlow { animation: mxEdgeFlow 0.5s linear infinite; }@keyframes mxEdgeFlow { to { stroke-dashoffset: -16; } }"));-document.getElementsByTagName("head")[0].appendChild(g)}catch(p){}}};Editor.installAnimationStyles()})();(function(){EditorUi.VERSION="30.3.13";EditorUi.CSV_ELK_LAYOUTS={verticalflow:{layout:"elkLayered",config:{"elk.direction":"DOWN","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},horizontalflow:{layout:"elkLayered",config:{"elk.direction":"RIGHT","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED",+document.getElementsByTagName("head")[0].appendChild(g)}catch(p){}}};Editor.installAnimationStyles()})();(function(){EditorUi.VERSION="30.3.14";EditorUi.CSV_ELK_LAYOUTS={verticalflow:{layout:"elkLayered",config:{"elk.direction":"DOWN","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},horizontalflow:{layout:"elkLayered",config:{"elk.direction":"RIGHT","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},elkRadial:{layout:"elkRadial",config:{edgeStyle:"elkCompat"}},elkOrganic:{layout:"elkOrganic",config:{edgeStyle:"elkCompat"}},elkStress:{layout:"elkStress",config:{edgeStyle:"elkCompat"}}};EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)||/.*\.cdn\.prod\.atlassian-dev\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&"1"!=urlParams.extAuth&&"showSaveFilePicker"in window&&"showOpenFilePicker"in@@ -13715,7 +13719,7 @@ c);else if(EditorUi.enableLogging)try{f=null!=f?f:5E4,c.length>f&&(c=c.substringc)}}catch(l){}};EditorUi.removeChildNodes=function(c){for(;null!=c.firstChild;)c.removeChild(c.firstChild)};EditorUi.embedSvgImages=function(c){c=c.getElementsByTagName("image");for(var f=[],l=0;l<c.length;l++)f.push(c[l]);for(l=0;l<f.length;l++)EditorUi.replaceSvgImage(f[l])};EditorUi.replaceSvgImage=function(c){try{var f=null;f=null==c.getAttributeNS?c.getAttribute("xlink:href"):c.getAttributeNS(mxConstants.NS_XLINK,"href");var l=EditorUi.getSvgSubtree(f);if(null!=l&&"svg"==l.nodeName){var n=l.getAttribute("width"),r=l.getAttribute("height");c.hasAttribute("x")&&l.setAttribute("x",c.getAttribute("x"));c.hasAttribute("y")&&l.setAttribute("y",c.getAttribute("y"));l.setAttribute("width",c.getAttribute("width"));l.setAttribute("height",c.getAttribute("height"));l.style.fontFamily="initial";null!=c.getAttribute("preserveAspectRatio")&&l.setAttribute("preserveAspectRatio",c.getAttribute("preserveAspectRatio"));0<n&&0<r&&null==l.getAttribute("viewBox")&&l.setAttribute("viewBox","0 0 "+n+" "+r);var t=mxUtils.createElementNs(l.ownerDocument,mxConstants.NS_SVG,"g");t.appendChild(l);c.hasAttribute("id")&&t.setAttribute("id",c.getAttribute("id"));c.hasAttribute("transform")&&t.setAttribute("transform",c.getAttribute("transform"));c.hasAttribute("opacity")&&t.setAttribute("opacity",c.getAttribute("opacity"));c.parentNode.replaceChild(t,c)}}catch(x){}};EditorUi.getSvgSubtree=function(c){var f=Graph.getSvgFromDataUri(c);c=null;if(null!=f){c=Graph.sanitizeNode(mxUtils.parseXml(f).documentElement);f=c.getElementsByTagName("style");if(0<f.length){var l=-"svg-image-"+Editor.guid();c.setAttribute("id",l);for(var n=document.implementation.createHTMLDocument(""),r=document.createElement("style"),t=0;t<f.length;t++){r.textContent=f[t].textContent;n.body.appendChild(r);for(var x="",B=0;B<r.sheet.cssRules.length;B++){var F=r.sheet.cssRules[B];if(null!=F.selectorText){for(var L=F.selectorText.split(","),D=0;D<L.length;D++)L[D]="#"+l+" "+L[D];F.selectorText=L.join(",")}x+=F.cssText+"\n"}f[t].textContent=x}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&+"svg-image-"+Editor.guid();c.setAttribute("id",l);for(var n=document.implementation.createHTMLDocument(""),r=document.createElement("style"),t=0;t<f.length;t++){r.textContent=f[t].textContent;n.body.appendChild(r);for(var x="",B=0;B<r.sheet.cssRules.length;B++){var G=r.sheet.cssRules[B];if(null!=G.selectorText){for(var L=G.selectorText.split(","),D=0;D<L.length;D++)L[D]="#"+l+" "+L[D];G.selectorText=L.join(",")}x+=G.cssText+"\n"}f[t].textContent=x}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&c.style.removeProperty("color-scheme");f=c.getElementsByTagName("*");for(l=0;l<f.length;l++)f[l].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.isDiagramDataEmpty=function(c){if(null==c||0==c.length||c==this.emptyDiagramXml)return!0;try{var f=mxUtils.parseXml(c).documentElement;c=function(B){return null==B||2>=B.getElementsByTagName("mxCell").length};if("mxGraphModel"==f.nodeName)return c(f);if("mxfile"==f.nodeName){var l=f.getElementsByTagName("diagram");if(0==l.length)return!0;for(f=0;f<l.length;f++){var n=l[f].getElementsByTagName("mxGraphModel");if(0<n.length){if(!c(n[0]))return!1}else{var r=mxUtils.getNodeValue(l[f]);if(null!=r&&0<r.length){var t=Graph.decompress(r);if(null!=t&&0<t.length){var x=mxUtils.parseXml(t);if(!c(x.documentElement))return!1}}}}return!0}}catch(B){}return!1};EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=@@ -13725,9 +13729,9 @@ f,l)};EditorUi.prototype.showSplash=function(c){};EditorUi.prototype.getLocalDatEditorUi.prototype.isShareCursorPosition=function(){return this.shareCursorPosition};EditorUi.prototype.setShowRemoteCursors=function(c){this.showRemoteCursors=c;this.fireEvent(new mxEventObject("showRemoteCursorsChanged"))};EditorUi.prototype.isShowRemoteCursors=function(){return this.showRemoteCursors};EditorUi.prototype.setMathEnabled=function(c){var f=this.editor.graph;f.mathEnabled=c;null!=f.view.backgroundImage&&(f.view.backgroundImage.destroy(),f.view.backgroundImage=null);this.editor.updateGraphComponents();f.refresh();f.defaultMathEnabled=c;this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(c){return this.editor.graph.mathEnabled};EditorUi.prototype.setAdaptiveColors=function(c){this.editor.graph.setAdaptiveColors(c);this.editor.graph.view.clear();this.fireEvent(new mxEventObject("adaptiveColorsChanged"))};EditorUi.prototype.isStandaloneApp=function(){return mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(c){return this.isOfflineApp()||!navigator.onLine&&!EditorUi.isElectronApp||!c&&("1"==urlParams.stealth||"1"==urlParams.lockdown)};EditorUi.prototype.isExternalDataComms=function(){return"1"!=urlParams.offline&&!this.isOffline()&&!this.isOfflineApp()};EditorUi.prototype.createSpinner=function(c,f,l){var n=null==c||null==f;l=null!=l?l:24;var r=new Spinner({lines:12,length:l,width:Math.round(l/3),radius:Math.round(l/2),rotate:0,-color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),t=this.timeout,x=r.spin,B=null,F=null,L=mxUtils.bind(this,function(N){null!=N&&N()}),D=this;r.spin=function(N,R,P,U){U=null!=U?U:t;var S=!1;if(!this.active){var z=Date.now();null!=P&&(B=window.setTimeout(function(){r.stop();B=null;P({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:F})},U));n&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/+color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),t=this.timeout,x=r.spin,B=null,G=null,L=mxUtils.bind(this,function(N){null!=N&&N()}),D=this;r.spin=function(N,R,P,U){U=null!=U?U:t;var S=!1;if(!this.active){var z=Date.now();null!=P&&(B=window.setTimeout(function(){r.stop();B=null;P({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:G})},U));n&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/2-2);N==document.body&&"1"==urlParams.embedInline&&(N=D.diagramContainer,c=N.scrollLeft+N.clientWidth/2,f=N.scrollTop+N.clientHeight/2);x.call(this,N);"1"==urlParams.embedInline&&null!=r.el&&(r.el.style.marginTop=N.scrollTop+"px",r.el.style.marginLeft=N.scrollLeft+"px");this.active=!0;null!=R&&(S=document.createElement("div"),S.className="geSpinnerStatus",S.setAttribute("title",R),N==document.body?(S.style.left=Math.max(0,c)+"px",S.style.top=Math.max(0,f+66)+"px"):(S.style.left="50%",S.style.top=-"50%",S.style.marginTop="70px"),"..."!=R.substring(R.length-3,R.length)&&"!"!=R.charAt(R.length-1)&&(R+="..."),S.innerText=R,N.appendChild(S),r.status=S);this.pause=mxUtils.bind(this,function(){var g=L;this.active&&(U=Math.max(0,U-(Date.now()-z)),g=mxUtils.bind(this,function(p){this.spin(N,R,P,U);if(null!=p)try{p(),F=mxUtils.bind(this,function(){this.spin(N,R,P,U);try{p()}catch(v){null!=P&&P(v)}})}catch(v){null!=P&&P(v)}}));this.stop();return g});S=!0}return S};var T=r.stop;r.stop=function(){T.call(this);+"50%",S.style.marginTop="70px"),"..."!=R.substring(R.length-3,R.length)&&"!"!=R.charAt(R.length-1)&&(R+="..."),S.innerText=R,N.appendChild(S),r.status=S);this.pause=mxUtils.bind(this,function(){var g=L;this.active&&(U=Math.max(0,U-(Date.now()-z)),g=mxUtils.bind(this,function(p){this.spin(N,R,P,U);if(null!=p)try{p(),G=mxUtils.bind(this,function(){this.spin(N,R,P,U);try{p()}catch(v){null!=P&&P(v)}})}catch(v){null!=P&&P(v)}}));this.stop();return g});S=!0}return S};var T=r.stop;r.stop=function(){T.call(this);this.active&&(this.active=!1,null!=B&&(window.clearTimeout(B),B=null),null!=r.status&&null!=r.status.parentNode&&r.status.parentNode.removeChild(r.status),r.status=null)};r.pause=function(){return L};return r};EditorUi.prototype.isCompatibleString=function(c){try{if(c=mxUtils.trim(c),"<"==c.charAt(0)){var f=mxUtils.parseXml(c),l=this.editor.extractGraphModel(f.documentElement,!0);return null!=l&&0==l.getElementsByTagName("parsererror").length}}catch(n){}return!1};EditorUi.isVisioFilename=function(c){return/(\.v(dx|sdx?))($|\?)/i.test(c)||/(\.vs(x|sx?))($|\?)/i.test(c)};EditorUi.prototype.isVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&4==c.charCodeAt(3)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&6==c.charCodeAt(3))};EditorUi.prototype.isRemoteVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||60==c.charCodeAt(0)&&63==c.charCodeAt(1)&&120==c.charCodeAt(2)&&109==c.charCodeAt(3)&&108==c.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=function(c){var f=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var l=f.getFunction,n=this.editor.graph,r=this;@@ -13736,30 +13740,30 @@ x&&r.selectNextPage(!1)};if(38==t.keyCode)return function(){0<x&&r.selectPage(r.EditorUi.prototype.extractGraphModelFromHtml=function(c){var f=k.apply(this,arguments);if(null==f)try{var l=c.indexOf("<mxfile ");if(0<=l){var n=c.lastIndexOf("</mxfile>");n>l&&(f=c.substring(l,n+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var r=mxUtils.parseXml(c),t=this.editor.extractGraphModel(r.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);f=null!=t?mxUtils.getXml(t):""}}catch(x){}return f};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var f=c.indexOf('<meta charset="utf-8">');0<=f&&(c=c.slice(0,f)+'<meta charset="utf-8"/>'+c.slice(f+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.repairFileData=function(c){c=mxUtils.trim(c||"");if(0==c.length)return null;var f=c.replace(/<\/([A-Za-z_][\w.\-]*)(\s*)(?=<)/g,"</$1>$2"),l=f.lastIndexOf(">");f.lastIndexOf("<")>l&&(f=mxUtils.trim(f.substring(0,l+1)));if("</mxfile>"!=f.substring(f.length-9)){l=[];for(var n=/<(\/?)([A-Za-z_][\w.\-]*)[^>]*?(\/?)>/g,r;null!=(r=n.exec(f));)"/"==r[1]?0<l.length&&l[l.length-1]==r[2]&&l.pop():"/"!=r[3]&&l.push(r[2]);for(n=l.length-1;0<=n;n--)f+="</"+l[n]+">"}return f!=c?f:null};EditorUi.prototype.isFileDataLoadable=function(c){try{c=this.validateFileData(c);var f=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;if(null==f||null!=Editor.extractParserError(f))return!1;var l=this.editor.extractGraphModel(f,!0);return null!=(null!=l?l:f)}catch(n){return!1}};EditorUi.prototype.getRecoveryData=function(c,f,-l,n){var r=null;try{var t=this.repairFileData(f);null!=t&&t!=f&&this.isFileDataLoadable(t)&&(r={type:"repair",label:mxResources.get("openRepairedCopy"),description:mxResources.get("recoveryRepairedDesc"),data:t,lossy:!0})}catch(B){}var x=mxUtils.bind(this,function(B){var F=[];null!=B&&null!=B.data&&F.push(B);null!=r&&F.push(r);n(F)});null!=c&&"function"===typeof c.getRecoveryVersion?c.getRecoveryVersion(mxUtils.bind(this,function(B){x(B)}),mxUtils.bind(this,function(){x(null)})):x(null)};EditorUi.prototype.openRecoveredCopy=+l,n){var r=null;try{var t=this.repairFileData(f);null!=t&&t!=f&&this.isFileDataLoadable(t)&&(r={type:"repair",label:mxResources.get("openRepairedCopy"),description:mxResources.get("recoveryRepairedDesc"),data:t,lossy:!0})}catch(B){}var x=mxUtils.bind(this,function(B){var G=[];null!=B&&null!=B.data&&G.push(B);null!=r&&G.push(r);n(G)});null!=c&&"function"===typeof c.getRecoveryVersion?c.getRecoveryVersion(mxUtils.bind(this,function(B){x(B)}),mxUtils.bind(this,function(){x(null)})):x(null)};EditorUi.prototype.openRecoveredCopy=function(c,f){c=new LocalFile(this,c.data,mxResources.get("copyOf",[f||this.defaultFilename]),!0);this.fileLoaded(c)&&c.fileChanged()};EditorUi.prototype.showRecoveryDialog=function(c,f){c=new RecoveryDialog(this,c,mxUtils.bind(this,function(l){this.hideDialog();this.openRecoveredCopy(l,f)}),mxUtils.bind(this,function(){this.hideDialog()}));this.showDialog(c.container,380,null,!0,!0)};EditorUi.prototype.formatRecoveryDate=function(c){c=new Date(c);return!isNaN(c.getTime())&&0<=c.getTime()?c.toLocaleString():null};EditorUi.prototype.replaceFileData=function(c,f){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",f);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var l=null!=c?this.editor.extractGraphModel(c,!0):null;null!=l&&(c=l);if(null!=c){l=this.editor.graph;l.model.beginUpdate();try{var n=null!=this.pages?this.pages.slice():null,r=c.getElementsByTagName("diagram");if(1<r.length||1==r.length&&r[0].hasAttribute("name")){this.fileNode=c;l.defaultExportLinkTarget=c.getAttribute("linkTarget");this.pages=null!=this.pages?this.pages:[];for(var t=r.length-1;0<=t;t--){var x=this.updatePageRoot(new DiagramPage(r[t]));null==x.getName()&&x.setName(mxResources.get("pageWithNumber",[t+1]));l.model.execute(new ChangePage(this,x,0==t?x:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),l.model.execute(new ChangePage(this,-this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=n)for(t=0;t<n.length;t++)l.model.execute(new ChangePage(this,n[t],null));var B=this.getCurrentFile();null!=B&&B.fileReplaced(f)}finally{l.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,f,l,n,r,t,x,B,F,L,D,T,N){f=null!=f?f:this.editor.graph;r=null!=r?r:!1;F=-null!=F?F:!0;L=null!=L?L:this.defaultCompact;D=null!=D?D:!Editor.defaultCompressed;var R=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var P="_blank";else R=P=n;if(null==c)return"";var U=c;if("mxfile"!=U.nodeName.toLowerCase()){if(D){var S=c.ownerDocument.createElement("diagram");S.setAttribute("name",mxResources.get("pageWithNumber",[1]));S.setAttribute("id",Editor.guid());S.appendChild(c)}else{S=Graph.zapGremlins(mxUtils.getXml(c));U=Graph.compress(S);if(Graph.decompress(U)!=+this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=n)for(t=0;t<n.length;t++)l.model.execute(new ChangePage(this,n[t],null));var B=this.getCurrentFile();null!=B&&B.fileReplaced(f)}finally{l.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,f,l,n,r,t,x,B,G,L,D,T,N){f=null!=f?f:this.editor.graph;r=null!=r?r:!1;G=+null!=G?G:!0;L=null!=L?L:this.defaultCompact;D=null!=D?D:!Editor.defaultCompressed;var R=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var P="_blank";else R=P=n;if(null==c)return"";var U=c;if("mxfile"!=U.nodeName.toLowerCase()){if(D){var S=c.ownerDocument.createElement("diagram");S.setAttribute("name",mxResources.get("pageWithNumber",[1]));S.setAttribute("id",Editor.guid());S.appendChild(c)}else{S=Graph.zapGremlins(mxUtils.getXml(c));U=Graph.compress(S);if(Graph.decompress(U)!=S)return S;S=c.ownerDocument.createElement("diagram");S.setAttribute("name",mxResources.get("pageWithNumber",[1]));S.setAttribute("id",Editor.guid());mxUtils.setTextContent(S,U)}U=c.ownerDocument.createElement("mxfile");U.appendChild(S)}L?(U=U.cloneNode(!0),U.removeAttribute("modified"),U.removeAttribute("host"),U.removeAttribute("agent"),U.removeAttribute("etag"),U.removeAttribute("userAgent"),U.removeAttribute("version"),U.removeAttribute("editor"),U.removeAttribute("type")):(U.removeAttribute("userAgent"),U.removeAttribute("modified"),U.removeAttribute("version"),U.removeAttribute("editor"),U.removeAttribute("pages"),U.removeAttribute("type"),U.removeAttribute("etag"),mxClient.IS_CHROMEAPP?U.setAttribute("host","Chrome"):EditorUi.isElectronApp?U.setAttribute("host","Electron"):U.setAttribute("host",window.location.hostname),1<U.getElementsByTagName("diagram").length&&null!=this.pages&&U.setAttribute("pages",this.pages.length));null!=T&&(U=U.cloneNode(!0),U.setAttribute("scale",T));null!=N&&(U=U.cloneNode(!0),-U.setAttribute("border",N));c=D?mxUtils.getPrettyXml(U):mxUtils.getXml(U);if(!t&&!r&&(x||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(U),f,null!=l?l.getTitle():null,P,R);else if(t||!r&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(n=null),l=this.getSvgFileProperties(U),c=this.getEmbeddedSvg(c,f,n,null,B,F,R,null,null,l.scale,l.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,-f,l,n){c=null!=c?c:!0;f=null!=f?f:!1;l=null!=l?l:!Editor.defaultCompressed;var r=this.editor.getGraphXml(c,n);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(F){var L=F.getElementsByTagName("mxGraphModel"),D=0<L.length?L[0]:null;L=F;null==D&&l?(D=mxUtils.getNodeValue(F),0<D.length&&(D=Graph.decompress(D),null!=D&&0<D.length&&(L=F.cloneNode(!1),L.appendChild(mxUtils.parseXml(D).documentElement)))):null==D||l?L=F.cloneNode(!0):(L=F.cloneNode(!1),mxUtils.setTextContent(L,Graph.compressNode(D)));+U.setAttribute("border",N));c=D?mxUtils.getPrettyXml(U):mxUtils.getXml(U);if(!t&&!r&&(x||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(U),f,null!=l?l.getTitle():null,P,R);else if(t||!r&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(n=null),l=this.getSvgFileProperties(U),c=this.getEmbeddedSvg(c,f,n,null,B,G,R,null,null,l.scale,l.border,null,Editor.svgFileTheme,null,l.embedFonts);return c};EditorUi.prototype.getXmlFileData=+function(c,f,l,n){c=null!=c?c:!0;f=null!=f?f:!1;l=null!=l?l:!Editor.defaultCompressed;var r=this.editor.getGraphXml(c,n);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(G){var L=G.getElementsByTagName("mxGraphModel"),D=0<L.length?L[0]:null;L=G;null==D&&l?(D=mxUtils.getNodeValue(G),0<D.length&&(D=Graph.decompress(D),null!=D&&0<D.length&&(L=G.cloneNode(!1),L.appendChild(mxUtils.parseXml(D).documentElement)))):null==D||l?L=G.cloneNode(!0):(L=G.cloneNode(!1),mxUtils.setTextContent(L,Graph.compressNode(D)));r.appendChild(L)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(r),r=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var t=this.pages[f],x=t.node;if(t!=this.currentPage)if(t.needsUpdate){var B=new mxCodec(mxUtils.createXmlDocument());B=B.encode(new mxGraphModel(t.root));this.editor.graph.saveViewState(t.viewState,B,null,n);EditorUi.removeChildNodes(x);x.appendChild(B);delete t.needsUpdate}else n&&(this.updatePageRoot(t),null!=t.viewState.backgroundImage&&null!=t.viewState.backgroundImage.originalSrc&&(B=new mxCodec(mxUtils.createXmlDocument()),B=B.encode(new mxGraphModel(t.root)),this.editor.graph.saveViewState(t.viewState,B,null,n,t),x=x.cloneNode(!1),x.appendChild(B)));c(x)}return r};EditorUi.prototype.anonymizeString=function(c,f){for(var l=[],n=0;n<c.length;n++){var r=c.charAt(n);0<=EditorUi.ignoredAnonymizedChars.indexOf(r)?l.push(r):isNaN(parseInt(r))?r.toLowerCase()!=r?l.push(String.fromCharCode(65+Math.round(25*-Math.random()))):r.toUpperCase()!=r?l.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(r)?l.push(" "):l.push("?"):l.push(f?"0":Math.round(9*Math.random()))}return l.join("")};EditorUi.prototype.anonymizeXml=function(c){function f(x,B,F){if(x.hasAttribute(B)){var L=x.getAttribute(B);null!=L&&0<L.length&&(F&&0<=L.indexOf("<")?(t.innerHTML=Graph.sanitizeHtml(L),l(t),L=t.innerHTML):L=r.anonymizeString(L),x.setAttribute(B,L))}}function l(x){null!=x.nodeValue&&(x.nodeValue=r.anonymizeString(x.nodeValue));-if(x.nodeType==mxConstants.NODETYPE_ELEMENT)for(x=x.firstChild;null!=x;)l(x),x=x.nextSibling}function n(x){if(x.nodeType==mxConstants.NODETYPE_ELEMENT){if("mxCell"==x.nodeName)f(x,"value",!0);else if("object"==x.nodeName||"UserObject"==x.nodeName)for(var B=0;B<x.attributes.length;B++){var F=x.attributes[B];"id"!=F.name&&"style"!=F.name&&"placeholders"!=F.name&&"vertex"!=F.name&&"edge"!=F.name&&"parent"!=F.name&&"connectable"!=F.name&&"visible"!=F.name&&"collapsed"!=F.name&&"source"!=F.name&&"target"!=-F.name&&(F.value=r.anonymizeString(F.value))}else"diagram"==x.nodeName&&f(x,"name",!1);for(x=x.firstChild;null!=x;)n(x),x=x.nextSibling}}var r=this,t=document.createElement("div");c=mxUtils.parseXml(c);n(c.documentElement);return mxUtils.getPrettyXml(c.documentElement)};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var f=0;f<c[EditorUi.DIFF_INSERT].length;f++)try{var l=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][f].data).documentElement.cloneNode(!1);+Math.random()))):r.toUpperCase()!=r?l.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(r)?l.push(" "):l.push("?"):l.push(f?"0":Math.round(9*Math.random()))}return l.join("")};EditorUi.prototype.anonymizeXml=function(c){function f(x,B,G){if(x.hasAttribute(B)){var L=x.getAttribute(B);null!=L&&0<L.length&&(G&&0<=L.indexOf("<")?(t.innerHTML=Graph.sanitizeHtml(L),l(t),L=t.innerHTML):L=r.anonymizeString(L),x.setAttribute(B,L))}}function l(x){null!=x.nodeValue&&(x.nodeValue=r.anonymizeString(x.nodeValue));+if(x.nodeType==mxConstants.NODETYPE_ELEMENT)for(x=x.firstChild;null!=x;)l(x),x=x.nextSibling}function n(x){if(x.nodeType==mxConstants.NODETYPE_ELEMENT){if("mxCell"==x.nodeName)f(x,"value",!0);else if("object"==x.nodeName||"UserObject"==x.nodeName)for(var B=0;B<x.attributes.length;B++){var G=x.attributes[B];"id"!=G.name&&"style"!=G.name&&"placeholders"!=G.name&&"vertex"!=G.name&&"edge"!=G.name&&"parent"!=G.name&&"connectable"!=G.name&&"visible"!=G.name&&"collapsed"!=G.name&&"source"!=G.name&&"target"!=+G.name&&(G.value=r.anonymizeString(G.value))}else"diagram"==x.nodeName&&f(x,"name",!1);for(x=x.firstChild;null!=x;)n(x),x=x.nextSibling}}var r=this,t=document.createElement("div");c=mxUtils.parseXml(c);n(c.documentElement);return mxUtils.getPrettyXml(c.documentElement)};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var f=0;f<c[EditorUi.DIFF_INSERT].length;f++)try{var l=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][f].data).documentElement.cloneNode(!1);null!=l.getAttribute("name")&&l.setAttribute("name",this.anonymizeString(l.getAttribute("name")));c[EditorUi.DIFF_INSERT][f].data=mxUtils.getXml(l)}catch(t){c[EditorUi.DIFF_INSERT][f].data=t.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var n in c[EditorUi.DIFF_UPDATE]){var r=c[EditorUi.DIFF_UPDATE][n];null!=r.name&&(r.name=this.anonymizeString(r.name));null!=r.cells&&(f=mxUtils.bind(this,function(t){var x=r.cells[t];if(null!=x){for(var B in x)null!=x[B].value&&(x[B].value="["+x[B].value.length+"]"),null!=x[B].xmlValue&&(x[B].xmlValue="["+x[B].xmlValue.length+"]"),null!=x[B].style&&(x[B].style="["+x[B].style.length+"]"),mxUtils.isEmptyObject(x[B])&&delete x[B];mxUtils.isEmptyObject(x)&&delete r.cells[t]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(r.cells)&&delete r.cells);mxUtils.isEmptyObject(r)&&delete c[EditorUi.DIFF_UPDATE][n]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,f){if(null!=c.attributes)for(var l=0;l<c.attributes.length;l++)"as"!=c.attributes[l].name&&c.setAttribute(c.attributes[l].name,this.anonymizeString(c.attributes[l].value,f));if(null!=c.childNodes)for(l=0;l<c.childNodes.length;l++)this.anonymizeAttributes(c.childNodes[l],f)};EditorUi.prototype.anonymizeNode=function(c,f){f=c.getElementsByTagName("mxCell");for(var l=0;l<f.length;l++)null!=f[l].getAttribute("value")&&f[l].setAttribute("value","["+f[l].getAttribute("value").length+"]"),null!=f[l].getAttribute("xmlValue")&&f[l].setAttribute("xmlValue","["+f[l].getAttribute("xmlValue").length+"]"),null!=f[l].getAttribute("style")&&f[l].setAttribute("style","["+f[l].getAttribute("style").length+"]"),null!=f[l].parentNode&&"root"!=f[l].parentNode.nodeName&&null!=f[l].parentNode.parentNode&&(f[l].setAttribute("id",f[l].parentNode.getAttribute("id")),f[l].parentNode.parentNode.replaceChild(f[l],f[l].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var f=this.getCurrentFile();null!=f&&(f.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&f.invalidChecksum?f.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(f.clearAutosave(),this.clearStatus(),c?f.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();f.handleFileError(l,!0)})):f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,-function(l){f.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=function(c,f,l,n,r,t,x,B,F,L,D,T,N){r=null!=r?r:!0;t=null!=t?t:!1;L=null!=L?L:!Editor.defaultCompressed;var R=this.editor.graph;if((f||!c&&null!=F&&/(\.svg)$/i.test(F.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var P=R.getGlobalVariable;R=this.createTemporaryGraph(R.getStylesheet());R.setBackgroundImage=this.editor.graph.setBackgroundImage;R.background=this.editor.graph.background;var U=null!=this.pages?-this.pages[0]:null;null==U||this.currentPage==U?R.setBackgroundImage(this.editor.graph.backgroundImage):null!=U.viewState&&null!=U.viewState&&R.setBackgroundImage(U.viewState.backgroundImage);R.getGlobalVariable=function(S){return"page"==S&&null!=U?U.getName():"pagenumber"==S?1:P.apply(this,arguments)};document.body.appendChild(R.container);null!=U&&R.model.setRoot(U.root)}x=null!=x?x:this.getXmlFileData(r,t,L,D);F=null!=F?F:this.getCurrentFile();c=this.createFileData(x,R,F,window.location.href,c,-f,l,n,r,B,L,T,N);R!=this.editor.graph&&R.container.parentNode.removeChild(R.container);return c};EditorUi.prototype.getHtml=function(c,f,l,n,r,t){t=null!=t?t:!0;var x=null,B=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){x=t?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var F=f.view.scale;t=Math.floor(x.x/F-f.view.translate.x);F=Math.floor(x.y/F-f.view.translate.y);x=f.background;null==r&&(f=this.getBasenames().join(";"),0<f.length&&(B=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",-t);c.setAttribute("y0",F)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=n&&c.setAttribute("edit",n));null!=r&&(r=r.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";n=Graph.compress(c);Graph.decompress(n)!=c&&(n=encodeURIComponent(c));return(null==r?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")++function(l){f.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=function(c,f,l,n,r,t,x,B,G,L,D,T,N){r=null!=r?r:!0;t=null!=t?t:!1;L=null!=L?L:!Editor.defaultCompressed;var R=this.editor.graph;if((f||!c&&null!=G&&/(\.svg)$/i.test(G.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var P=R.getGlobalVariable;R=this.createTemporaryGraph(R.getStylesheet());R.setBackgroundImage=this.editor.graph.setBackgroundImage;R.background=this.editor.graph.background;var U=null!=this.pages?+this.pages[0]:null;null==U||this.currentPage==U?R.setBackgroundImage(this.editor.graph.backgroundImage):null!=U.viewState&&null!=U.viewState&&R.setBackgroundImage(U.viewState.backgroundImage);R.getGlobalVariable=function(S){return"page"==S&&null!=U?U.getName():"pagenumber"==S?1:P.apply(this,arguments)};document.body.appendChild(R.container);null!=U&&R.model.setRoot(U.root)}x=null!=x?x:this.getXmlFileData(r,t,L,D);G=null!=G?G:this.getCurrentFile();c=this.createFileData(x,R,G,window.location.href,c,+f,l,n,r,B,L,T,N);R!=this.editor.graph&&R.container.parentNode.removeChild(R.container);return c};EditorUi.prototype.getHtml=function(c,f,l,n,r,t){t=null!=t?t:!0;var x=null,B=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){x=t?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var G=f.view.scale;t=Math.floor(x.x/G-f.view.translate.x);G=Math.floor(x.y/G-f.view.translate.y);x=f.background;null==r&&(f=this.getBasenames().join(";"),0<f.length&&(B=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",+t);c.setAttribute("y0",G)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=n&&c.setAttribute("edit",n));null!=r&&(r=r.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";n=Graph.compress(c);Graph.decompress(n)!=c&&(n=encodeURIComponent(c));return(null==r?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=r?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==r?null!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=r?'<meta http-equiv="refresh" content="0;URL=\''+r+"'\"/>\n":"")+"</head>\n<body"+(null==r&&null!=x&&x!=mxConstants.NONE?' style="background-color:'+x+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+n+"</div>\n</div>\n"+(null==r?'<script type="text/javascript" src="'+B+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+r+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,f,l,n,r){f=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=r&&(r=r.replace(/&/g,"&"));c={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(c),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==r?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=r?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==r?null!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=r?'<meta http-equiv="refresh" content="0;URL=\''+@@ -13767,25 +13771,25 @@ r+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph"function(){var c=null!=this.fileNode?this.fileNode.getAttribute("vars"):null;if(c!==this.fileVarsStr&&(this.fileVarsStr=c,this.fileVars=null,null!=c&&0<c.length))try{this.fileVars=JSON.parse(c)}catch(f){}};EditorUi.prototype.setFileData=function(c,f){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;f=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var l=Editor.extractParserError(f,mxResources.get("invalidOrMissingFile"));if(l)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[c],"node",[f],"cause",[l]),Error(mxResources.get("notADiagramFile")+" ("+l+")");c=null!=f?this.editor.extractGraphModel(f,!0):null;null!=c&&(f=c);if(null!=f&&"mxfile"==f.nodeName&&(c=f.getElementsByTagName("diagram"),l={},0<c.length)){var n=this.getHashObject(),r=null;this.fileNode=f;this.editor.graph.defaultExportLinkTarget=f.getAttribute("linkTarget");this.pages=[];for(var t=0;t<c.length;t++){null==c[t].getAttribute("id")&&c[t].setAttribute("id",t);f=new DiagramPage(c[t]);null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[t+1]));this.pages.push(f);if(null==n.pageId&&null!=urlParams["page-id"]&&f.getId()==urlParams["page-id"]||null!=n.pageId&&f.getId()==n.pageId)r=f;if(null==l[f.getId()])l[f.getId()]=f;else throw Error(f.getId()+": Duplicate page ID");}this.currentPage=null!=r?r:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];f=this.currentPage.node}null==this.fileNode&&null!=f&&(this.fileNode=f.ownerDocument.createElement("mxfile"),this.currentPage=-new DiagramPage(f.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(f);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var x=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(t=0;t<x.length;t++)f[x[t]]=!0;var B=this.editor.graph.getModel(),F=B.getChildren(B.root);-for(t=0;t<F.length;t++){var L=F[t];B.setVisible(L,f[L.id]||!1)}}catch(D){}};EditorUi.prototype.fileStats=function(c,f){try{if(null!=c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var l=f.getElementsByTagName("diagram");f={};f.modified=c.getLastModifiedDate();f.fileMode=c.getMode();f.fileSize=c.getSize();f.fileHash=c.getHash();f.pages=l.length;f.redundantStencils=0;f.redundantImages=0;f.redundantSize=0;f.stencils=0;f.images=0;for(var n=f.cells=0;n<l.length;n++){var r=l[n].getElementsByTagName("mxCell");-f.cells+=r.length;for(var t={},x=0;x<r.length;x++){var B=r[x].getAttribute("style");if(null!=B)for(var F=B.split(";"),L=0;L<F.length;L++){var D=F[L];if(D.startsWith("image=data:")||D.startsWith("shape=stencil("))null==t[D]?t[D]=1:t[D]++}}for(var T in t){var N=t[T];T.startsWith("shape=stencil(")?f.stencils+=N:f.images+=N;1<N&&(f.redundantSize+=T.length*(N-1),T.startsWith("shape=stencil(")?f.redundantStencils+=N-1:f.redundantImages+=N-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()+"-FILE-STATS-"++new DiagramPage(f.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(f);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var x=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(t=0;t<x.length;t++)f[x[t]]=!0;var B=this.editor.graph.getModel(),G=B.getChildren(B.root);+for(t=0;t<G.length;t++){var L=G[t];B.setVisible(L,f[L.id]||!1)}}catch(D){}};EditorUi.prototype.fileStats=function(c,f){try{if(null!=c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var l=f.getElementsByTagName("diagram");f={};f.modified=c.getLastModifiedDate();f.fileMode=c.getMode();f.fileSize=c.getSize();f.fileHash=c.getHash();f.pages=l.length;f.redundantStencils=0;f.redundantImages=0;f.redundantSize=0;f.stencils=0;f.images=0;for(var n=f.cells=0;n<l.length;n++){var r=l[n].getElementsByTagName("mxCell");+f.cells+=r.length;for(var t={},x=0;x<r.length;x++){var B=r[x].getAttribute("style");if(null!=B)for(var G=B.split(";"),L=0;L<G.length;L++){var D=G[L];if(D.startsWith("image=data:")||D.startsWith("shape=stencil("))null==t[D]?t[D]=1:t[D]++}}for(var T in t){var N=t[T];T.startsWith("shape=stencil(")?f.stencils+=N:f.images+=N;1<N&&(f.redundantSize+=T.length*(N-1),T.startsWith("shape=stencil(")?f.redundantStencils+=N-1:f.redundantImages+=N-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()+"-FILE-STATS-"+c.getHash(),action:"size_"+c.getSize(),label:JSON.stringify(f)})}}catch(R){}};EditorUi.prototype.getBaseFilename=function(c){var f=this.getCurrentFile();f=null!=f&&null!=f.getTitle()?f.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(f)||/(\.html)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.png)$/i.test(f))f=f.substring(0,f.lastIndexOf("."));/(\.drawio)$/i.test(f)&&(f=f.substring(0,f.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&-0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,l,n,r,t,x,B,F,L,D,T,N,R,P,U,S){try{n=null!=n?n:this.editor.graph.isSelectionEmpty();var z=this.getBaseFilename(!r),g=z+("xml"==c||"pdf"==c&&D?".drawio":"")+"."+c;if("xml"==c){var p=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,n,r,null,null,null,f);this.saveData(g,c,p,"text/xml")}else if("html"==c)p=this.getHtml2(this.getFileData(!0),this.editor.graph,z),-this.saveData(g,c,p,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?g=z+".png":"jpeg"==c&&(g=z+".jpg"),"1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){var v=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(g,c,n,"1",x,r,B,F,L,D,T,void 0,void 0,!t,N,R,P,U,S).send(mxUtils.bind(this,function(Q){this.spinner.stop();+0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,l,n,r,t,x,B,G,L,D,T,N,R,P,U,S){try{n=null!=n?n:this.editor.graph.isSelectionEmpty();var z=this.getBaseFilename(!r),g=z+("xml"==c||"pdf"==c&&D?".drawio":"")+"."+c;if("xml"==c){var p=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,n,r,null,null,null,f);this.saveData(g,c,p,"text/xml")}else if("html"==c)p=this.getHtml2(this.getFileData(!0),this.editor.graph,z),+this.saveData(g,c,p,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?g=z+".png":"jpeg"==c&&(g=z+".jpg"),"1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){var v=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(g,c,n,"1",x,r,B,G,L,D,T,void 0,void 0,!t,N,R,P,U,S).send(mxUtils.bind(this,function(Q){this.spinner.stop();if(200<=Q.getStatus()&&299>=Q.getStatus()){var V=this.createLoadMessage("export");V.format=c;V.filename=g;V.data="data:application/pdf;base64,"+Q.getText();V.xml=this.getFileData(!0);v.postMessage(JSON.stringify(V),"*")}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(){this.spinner.stop();this.handleError({message:mxResources.get("errorSavingFile")})}))}else this.saveRequest(g,c,mxUtils.bind(this,function(Q,V){try{return this.createDownloadRequest(Q,-c,n,V,x,r,B,F,L,D,T,void 0,void 0,!t,N,R,P,U,S)}catch(W){this.handleError(W)}}));else{var C=null,E=mxUtils.bind(this,function(Q){Q.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",Q,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(C)}))});if("svg"==c){var I=this.editor.graph.background;if(x||I==mxConstants.NONE)I=null;var O=this.editor.graph.getSvg(I,null,null,null,null,n);l&&this.editor.graph.addSvgShadow(O);-this.editor.convertImages(O,mxUtils.bind(this,mxUtils.bind(this,function(Q){this.spinner.stop();E(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(Q))})))}else g=z+".svg",C=this.getFileData(!1,!0,null,mxUtils.bind(this,function(Q){this.spinner.stop();E(Q)}),n)}}catch(Q){this.handleError(Q)}};EditorUi.prototype.createDownloadRequest=function(c,f,l,n,r,t,x,B,F,L,D,T,N,R,P,U,S,z,g){c=this.downloadRequestBuilder(c,f,l,n,r,t,x,B,F,L,D,T,N,R,P,U,S,z,g);f="";for(var p in c)l=c[p],null!=l&&-(f+=p+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,l,n,r,t,x,B,F,L,D,T,N,R,P,U,S,z,g){var p=this.editor.graph,v=p.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==t?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var C=null,E=null,I=null;if(!EditorUi.isElectronApp&&(v.width*v.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};L=L?"1":"0";"pdf"==f&&-(null!=D?(C=D.from,E=D.to):0==t&&(I="1"));"xmlpng"==f&&(L="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(t=0;t<this.pages.length;t++)if(this.pages[t]==this.currentPage){C=t;break}t=p.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!r?r||null!=t&&t!=mxConstants.NONE||(t="#ffffff"):t=mxConstants.NONE;r={globalVars:p.getExportVariables()};null!=D&&null!=D.from&&(r.globalVars.pagenumber=D.from+1);F&&(r.grid={size:p.gridSize,steps:p.view.gridSteps,color:Editor.isDarkMode()&&-"pdf"==f?mxGraphView.prototype.defaultGridColor:p.view.gridColor});Graph.translateDiagram&&(r.diagramLanguage=Graph.diagramLanguage);F=this.getHiddenTagsMap();null!=F&&(r.hiddenTags=F);return{format:f,from:C,to:E,allPages:I,bg:null!=t?t:mxConstants.NONE,base64:n,embedXml:L,xml:l,filename:null!=c?c:"",extras:JSON.stringify(r),scale:x,border:B,pageMargin:P,w:T&&isFinite(T)?T:null,h:N&&isFinite(N)?N:null,crop:null!=R&&R?"1":"0",fit:null!=U&&U?"1":"0",shadows:null!=g&&g?"1":"0",sheetsAcross:S,sheetsDown:z}};+c,n,V,x,r,B,G,L,D,T,void 0,void 0,!t,N,R,P,U,S)}catch(W){this.handleError(W)}}));else{var C=null,E=mxUtils.bind(this,function(Q){Q.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",Q,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(C)}))});if("svg"==c){var I=this.editor.graph.background;if(x||I==mxConstants.NONE)I=null;var O=this.editor.graph.getSvg(I,null,null,null,null,n);l&&this.editor.graph.addSvgShadow(O);+this.editor.convertImages(O,mxUtils.bind(this,mxUtils.bind(this,function(Q){this.spinner.stop();E(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(Q))})))}else g=z+".svg",C=this.getFileData(!1,!0,null,mxUtils.bind(this,function(Q){this.spinner.stop();E(Q)}),n)}}catch(Q){this.handleError(Q)}};EditorUi.prototype.createDownloadRequest=function(c,f,l,n,r,t,x,B,G,L,D,T,N,R,P,U,S,z,g){c=this.downloadRequestBuilder(c,f,l,n,r,t,x,B,G,L,D,T,N,R,P,U,S,z,g);f="";for(var p in c)l=c[p],null!=l&&+(f+=p+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,l,n,r,t,x,B,G,L,D,T,N,R,P,U,S,z,g){var p=this.editor.graph,v=p.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==t?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var C=null,E=null,I=null;if(!EditorUi.isElectronApp&&(v.width*v.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};L=L?"1":"0";"pdf"==f&&+(null!=D?(C=D.from,E=D.to):0==t&&(I="1"));"xmlpng"==f&&(L="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(t=0;t<this.pages.length;t++)if(this.pages[t]==this.currentPage){C=t;break}t=p.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!r?r||null!=t&&t!=mxConstants.NONE||(t="#ffffff"):t=mxConstants.NONE;r={globalVars:p.getExportVariables()};null!=D&&null!=D.from&&(r.globalVars.pagenumber=D.from+1);G&&(r.grid={size:p.gridSize,steps:p.view.gridSteps,color:Editor.isDarkMode()&&+"pdf"==f?mxGraphView.prototype.defaultGridColor:p.view.gridColor});Graph.translateDiagram&&(r.diagramLanguage=Graph.diagramLanguage);G=this.getHiddenTagsMap();null!=G&&(r.hiddenTags=G);return{format:f,from:C,to:E,allPages:I,bg:null!=t?t:mxConstants.NONE,base64:n,embedXml:L,xml:l,filename:null!=c?c:"",extras:JSON.stringify(r),scale:x,border:B,pageMargin:P,w:T&&isFinite(T)?T:null,h:N&&isFinite(N)?N:null,crop:null!=R&&R?"1":"0",fit:null!=U&&U?"1":"0",shadows:null!=g&&g?"1":"0",sheetsAcross:S,sheetsDown:z}};EditorUi.prototype.getHiddenTagsMap=function(){var c=this.editor.graph,f={},l=!1;if(null!=this.pages)for(var n=0;n<this.pages.length;n++){var r=this.pages[n],t=r==this.currentPage?c.hiddenTags:null!=r.viewState?r.viewState.hiddenTags:null;null!=t&&0<t.length&&(f[r.getId()]=t,l=!0)}else null!=c.hiddenTags&&0<c.hiddenTags.length&&(f[0]=c.hiddenTags,l=!0);return l?f:null};EditorUi.prototype.setMode=function(c,f){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=window.location.hash;null!=c&&0<c.length&&(c=c.substring(1));if(null!=c&&1<c.length){var f=c.indexOf("#");0<=f&&(c=c.substring(0,f))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,f={};if(null!=c&&0<c.length){var l=c.lastIndexOf("#");if(0<l){c=decodeURIComponent(c.substring(l+1));try{f=JSON.parse(c)}catch(n){}}}return f};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var c=this.getHashObject();c.pageId=this.currentPage.getId();this.setHashObject(c)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(c){if(Editor.enableHashObjects){var f=window.location.hash;if(null==f||""==f)f="#";var l=f.lastIndexOf("#");0<l&&(f=f.substring(0,l));try{null==c||mxUtils.isEmptyObject(c)||(f=f+"#"+encodeURIComponent(JSON.stringify(c)))}catch(n){}0<l&&0<f.lastIndexOf("#")?window.location.hash=f:window.location.replace(f)}};EditorUi.prototype.loadDescriptor=function(c,f,l){var n=window.location.hash,r=mxUtils.bind(this,-function(x){var B=null!=c.data?c.data:"";null!=x&&0<x.length&&(0<B.length&&(B+="\n"),B+=x);x=new LocalFile(this,"csv"!=c.format&&0<B.length?B:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);x.getHash=function(){return n};this.fileLoaded(x);"csv"==c.format&&this.importCsv(B,mxUtils.bind(this,function(N){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var F=null!=c.interval?parseInt(c.interval):-6E4,L=null,D=mxUtils.bind(this,function(){var N=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(R){N===this.currentPage&&(200<=R.getStatus()&&300>=R.getStatus()?(this.updateDiagram(R.getText()),T()):this.handleError({message:mxResources.get("error")+" "+R.getStatus()}))}),mxUtils.bind(this,function(R){this.handleError(R)}))}),T=mxUtils.bind(this,function(){window.clearTimeout(L);L=window.setTimeout(D,F)});this.editor.addListener("pageSelected",+function(x){var B=null!=c.data?c.data:"";null!=x&&0<x.length&&(0<B.length&&(B+="\n"),B+=x);x=new LocalFile(this,"csv"!=c.format&&0<B.length?B:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);x.getHash=function(){return n};this.fileLoaded(x);"csv"==c.format&&this.importCsv(B,mxUtils.bind(this,function(N){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var G=null!=c.interval?parseInt(c.interval):+6E4,L=null,D=mxUtils.bind(this,function(){var N=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(R){N===this.currentPage&&(200<=R.getStatus()&&300>=R.getStatus()?(this.updateDiagram(R.getText()),T()):this.handleError({message:mxResources.get("error")+" "+R.getStatus()}))}),mxUtils.bind(this,function(R){this.handleError(R)}))}),T=mxUtils.bind(this,function(){window.clearTimeout(L);L=window.setTimeout(D,G)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){T();D()}));T();D()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var t=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(t,mxUtils.bind(this,function(x){r(x)}),mxUtils.bind(this,function(x){null!=l&&l(x)}))}else r("")};EditorUi.prototype.updateDiagram=function(c){function f(p){var v=new mxCellOverlay(p.image||r.warningImage,p.tooltip,p.align,p.valign,p.offset);v.addListener(mxEvent.CLICK,function(C,E){n.alert(p.tooltip)});return v}var l=null,n=this;if(null!=c&&0<c.length&&-(l=mxUtils.parseXml(c),c=null!=l?l.documentElement:null,null!=c&&"updates"==c.nodeName)){var r=this.editor.graph,t=r.getModel();t.beginUpdate();var x=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var B=t.getCell(c.getAttribute("id"));if(null!=B){try{var F=c.getAttribute("value");if(null!=F){var L=mxUtils.parseXml(F).documentElement;if(null!=L)if("1"==L.getAttribute("replace-value"))t.setValue(B,L);else for(var D=L.attributes,T=0;T<D.length;T++)r.setAttributeForCell(B,D[T].nodeName,+(l=mxUtils.parseXml(c),c=null!=l?l.documentElement:null,null!=c&&"updates"==c.nodeName)){var r=this.editor.graph,t=r.getModel();t.beginUpdate();var x=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var B=t.getCell(c.getAttribute("id"));if(null!=B){try{var G=c.getAttribute("value");if(null!=G){var L=mxUtils.parseXml(G).documentElement;if(null!=L)if("1"==L.getAttribute("replace-value"))t.setValue(B,L);else for(var D=L.attributes,T=0;T<D.length;T++)r.setAttributeForCell(B,D[T].nodeName,0<D[T].nodeValue.length?D[T].nodeValue:null)}}catch(p){null!=window.console&&console.log("Error in value for "+B.id+": "+p)}try{var N=c.getAttribute("style");null!=N&&r.model.setStyle(B,N)}catch(p){null!=window.console&&console.log("Error in style for "+B.id+": "+p)}try{var R=c.getAttribute("icon");if(null!=R){var P=0<R.length?JSON.parse(R):null;null!=P&&P.append||r.removeCellOverlays(B);null!=P&&r.addCellOverlay(B,f(P))}}catch(p){null!=window.console&&console.log("Error in icon for "+B.id+": "+p)}try{var U=c.getAttribute("geometry");if(null!=U){U=JSON.parse(U);var S=r.getCellGeometry(B);if(null!=S){S=S.clone();for(key in U){var z=parseFloat(U[key]);"dx"==key?S.x+=z:"dy"==key?S.y+=z:"dw"==key?S.width+=z:"dh"==key?S.height+=z:S[key]=parseFloat(U[key])}r.model.setGeometry(B,S)}}}catch(p){null!=window.console&&console.log("Error in icon for "+B.id+": "+p)}}}else if("model"==c.nodeName){for(var g=c.firstChild;null!=g&&g.nodeType!=mxConstants.NODETYPE_ELEMENT;)g=g.nextSibling;null!=g&&(new mxCodec(c.firstChild)).decode(g,t)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(r.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))r.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(x=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{t.endUpdate()}null!=x&&this.chromelessResize&&this.chromelessResize(!0,x)}return l};EditorUi.prototype.getCopyFilename=function(c,@@ -13793,134 +13797,134 @@ f){var l=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";varf,l){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[c],"noDialogs",[f]);var n=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var r=!1;this.hideDialog();null!=n&&(n.removeListener(this.descriptorChangedListener),this.logIfModified(n,!0),n.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var t=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=n&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!f&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fname.innerText="");this.clearStatus();this.updateUi();if(!f)if("0"!=urlParams.splash)this.showSplash();else try{this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}catch(T){this.handleError(T)}});if(null!=c)try{this.openingFile=!0;this.setCurrentFile(c);c.addListener("descriptorChanged",this.descriptorChangedListener);c.addListener("contentChanged",this.descriptorChangedListener);c.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(c.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();c.isEditable()?c.isModified()?c.addUnsavedStatus():this.clearStatus():this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus('<div class="geStatusBox" title="'+mxUtils.htmlEntities(mxResources.get("readOnly"))+'">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+-"</div>")}));!this.editor.isChromelessView()||this.editor.editable?(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers(),this.restoreLibraries(),window.self===window.top||this.noAutoFocus||window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=l&&l();this.editor.fireEvent(new mxEventObject("fileLoaded"));r=!0;if(Editor.embedSvgFonts&&/(\.svg)$/i.test(c.getTitle()))try{this.editor.loadFonts(),-this.editor.embedExtFonts(function(){})}catch(T){}if(!this.isOffline()&&null!=c.getMode()){var x="1"==urlParams.sketch?"sketch":uiTheme;if(null==x)x="default";else if("sketch"==x||"min"==x)x+=Editor.isDarkMode()?"-dark":"-light";EditorUi.logEvent({category:c.getMode().toUpperCase()+"-OPEN-FILE-"+c.getHash(),action:"size_"+c.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")+"_theme_"+x})}EditorUi.debug("File.opened",[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));-if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(T){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(T){}}catch(T){this.fileLoadedError=T;l=null;var B=this.defaultFilename;if(null!=c){try{l=c.getData(),B=c.getTitle()||this.defaultFilename}catch(N){}try{c.close()}catch(N){}}var F=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,-mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=n?this.fileLoaded(n)||t():t()});if(f)F();else{T.dialogWidth=350;var L=mxUtils.bind(this,function(){this.handleError(T,mxResources.get("errorLoadingFile"),F,!0,null,null,!0)});if(null!=T.fallbackFileData)T.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var N=new LocalFile(this,T.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(N)})},L();else{var D=-this.spinner.spin(document.body,mxResources.get("loading"));this.getRecoveryData(c,l,T,mxUtils.bind(this,function(N){D&&this.spinner.stop();if(null!=N&&1==N.length){var R=N[0];T.alternateAction={label:R.label,funct:mxUtils.bind(this,function(){this.hideDialog();R.lossy?this.confirm(mxResources.get("recoveryWarning"),mxUtils.bind(this,function(){this.openRecoveredCopy(R,B)})):this.openRecoveredCopy(R,B)})}}else null!=N&&1<N.length&&(T.alternateAction={label:mxResources.get("recover"),funct:mxUtils.bind(this,-function(){this.hideDialog();this.showRecoveryDialog(N,B)})});L()}))}}}else t();return r};EditorUi.prototype.getHashValueForPages=function(c,f){var l=0,n=new mxGraphModel,r=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var t=0;t<c.length;t++)if(null!=c[t]){this.updatePageRoot(c[t]);var x=c[t].node.ownerDocument.createElement("diagram");x.setAttribute("id",c[t].getId());n.root=c[t].root;var B=r.encode(n);this.editor.graph.saveViewState(c[t].viewState,B,!0);B.removeAttribute("pageWidth");-B.removeAttribute("pageHeight");x.appendChild(B);null!=f&&(f.eltCount+=x.getElementsByTagName("*").length,f.nodeCount+=x.getElementsByTagName("mxCell").length);l=(l<<5)-l+this.hashValue(x,function(F,L,D,T){return!T||"mxGeometry"!=F.nodeName&&"mxPoint"!=F.nodeName||"x"!=L&&"y"!=L&&"width"!=L&&"height"!=L?T&&"mxCell"==F.nodeName&&"previous"==L?null:D:Math.round(D)},f)<<0}return l};EditorUi.prototype.hashValue=function(c,f,l){var n=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===-typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(n^=this.hashValue(c.nodeName,f,l));if(null!=c.attributes){null!=l&&(l.attrCount+=c.attributes.length);for(var r=0;r<c.attributes.length;r++){var t=c.attributes[r].name,x=null!=f?f(c,t,c.attributes[r].value,!0):c.attributes[r].value;null!=x&&(n^=this.hashValue(t,f,l)+this.hashValue(x,f,l))}}if(null!=c.childNodes)for(r=0;r<c.childNodes.length;r++)n=(n<<5)-n+this.hashValue(c.childNodes[r],f,l)<<0}else if(null!=c&&"function"!==-typeof c){c=String(c);f=0;null!=l&&(l.byteCount+=c.length);for(r=0;r<c.length;r++)f=(f<<5)-f+c.charCodeAt(r)<<0;n^=f}return n};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,l,n,r,t,x){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,-".scratchpad",mxUtils.bind(this,function(c){if(null==c||"<mxfile"==c.substring(0,7))c=this.emptyLibraryXml;this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var f=0;f<c.length;f++)null!=c[f].xml&&"<"!=c[f].xml.charAt(0)&&(c[f].xml=mxUtils.trim(Graph.decompress(c[f].xml)));f=mxUtils.createXmlDocument();var l=f.createElement("mxlibrary");mxUtils.setTextContent(l,-JSON.stringify(c,null,2));f.appendChild(l);return mxUtils.getXml(f,"\n")};EditorUi.prototype.closeLibrary=function(c){null!=c&&(this.removeLibrarySidebar(c.getHash()),c.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(c.getHash()),".scratchpad"==c.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(c){var f=this.sidebar.palettes[c];if(null!=f){for(var l=0;l<f.length;l++)this.sidebar.unobserveElements(f[l]),f[l].parentNode.removeChild(f[l]);delete this.sidebar.palettes[c]}};-EditorUi.prototype.repositionLibrary=function(c,f){var l=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!f){null==c&&(f=this.sidebar.palettes["L.scratchpad"],null==f&&(f=this.sidebar.palettes.search),null!=f&&(c=f[f.length-1].nextSibling));c=null!=c?c:l.firstChild.nextSibling.nextSibling;f=l.lastChild;var n=f.previousSibling;l.insertBefore(f,c);l.insertBefore(n,f)}};EditorUi.prototype.loadLibrary=function(c,f){var l=mxUtils.parseXml(c.getData());if("mxlibrary"==-l.documentElement.nodeName){var n=JSON.parse(mxUtils.getTextContent(l.documentElement));this.libraryLoaded(c,n,l.documentElement.getAttribute("title"),f,l.documentElement.getAttribute("tags"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(c){return""};EditorUi.prototype.showSidebar=function(){null!=this.sidebarWindow?this.sidebarWindow.window.setVisible(!0):this.toggleShapesPanel(!0)};EditorUi.prototype.showSearchWindow=function(c,f){var l=-c?"findReplace":"find",n=l+"Window";if(null==this[n]){var r="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,t=mxSettings.getWindowState(l),x=null!=t&&null!=t.w?t.w:c?r?330:300:240;this[n]=new FindWindow(this,null!=t&&null!=t.x?t.x:document.body.offsetWidth-(x+20),null!=t&&null!=t.y?t.y:100,x,null!=t&&null!=t.h?t.h:c?r?304:288:180,c);this[n].window.addListener("show",function(){this.fireEvent(new mxEventObject(l))});this[n].window.addListener("hide",function(){this.fireEvent(new mxEventObject(l))});-this.installWindowPersistence(l,this[n]);null!=t&&null==f&&this.restoreWindowState(l,this[n]);this[n].window.setVisible(!0)}else null==f&&this[n].window.setVisible(!this[n].window.isVisible());null!=f&&(this[n].doSearch(f),this[n].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,f,l,n,r){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var t=null;if(c.constructor!=StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=-[]);for(var x=0;x<this.openLibraries.length;x++)if(this.openLibraries[x].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[x],this.openLibraries);break}t={file:c,images:f,title:l,expand:n};this.openLibraries.push(t)}else this.scratchpad=c;x=this.sidebar.palettes[c.getHash()];x=null!=x?x[x.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var B=null,F=mxUtils.bind(this,function(g,p){0==g.length&&c.isEditable()?(null==B&&(B=document.createElement("div"),B.className="geDropTarget",-g=mxResources.get("dragElementsHere"),mxUtils.write(B,g),B.setAttribute("title",g)),p.appendChild(B)):this.addLibraryEntries(g,p)});null!=this.sidebar&&null!=f&&(this.sidebar.setCurrentSearchEntryLibrary(c.getHash(),c.getHash()),this.sidebar.addEntries(f,r),this.sidebar.setCurrentSearchEntryLibrary());null==l&&(l=c.getTitle(),null!=l&&/(\.xml)$/i.test(l)&&(l=l.substring(0,l.lastIndexOf("."))));var L=this.sidebar.addPalette(c.getHash(),l,null!=n?n:!0,mxUtils.bind(this,function(g){F(f,g)}),!0);null!=-t&&(t.div=L);this.repositionLibrary(x,"L.scratchpad"!=c.getHash());n=L.parentNode.previousSibling;l=n.getAttribute("title");null!=l&&0<l.length&&".scratchpad"!=c.title&&n.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+l);var D=document.createElement("div");D.style.backgroundColor="inherit";n.style.position="relative";var T=document.createElement("img");T.className="geLibraryButton";T.setAttribute("src",Editor.crossImage);T.setAttribute("title",mxResources.get("close"));var N=null;if(".scratchpad"!=-c.title||this.closableScratchpad)D.appendChild(T),mxEvent.addListener(T,"click",mxUtils.bind(this,function(g){if(!mxEvent.isConsumed(g)){var p=mxUtils.bind(this,function(){null!=t&&mxUtils.remove(t,this.openLibraries);this.closeLibrary(c)});null!=N?this.confirm(mxResources.get("allChangesLost"),null,p,mxResources.get("cancel"),mxResources.get("discardChanges")):p();mxEvent.consume(g)}}));if(c.isEditable()){var R=this.editor.graph,P=null;l=mxUtils.bind(this,function(g){this.showLibraryDialog(c.getTitle(),-L,f,c,c.getMode());mxEvent.consume(g)});var U=mxUtils.bind(this,function(g){c.setModified(!0);c.isAutosave()?(null!=P&&null!=P.parentNode&&P.parentNode.removeChild(P),P=T.cloneNode(!1),P.setAttribute("src",Editor.spinImage),P.setAttribute("title",mxResources.get("saving")),P.style.cursor="default",P.style.marginRight="2px",P.style.marginTop="-2px",D.insertBefore(P,D.firstChild),this.saveLibrary(c.getTitle(),f,c,c.getMode(),!0,!0,function(){null!=P&&null!=P.parentNode&&P.parentNode.removeChild(P)})):-null==N&&(N=T.cloneNode(!1),N.setAttribute("src",Editor.saveImage),N.setAttribute("title",mxResources.get("save")),D.insertBefore(N,D.firstChild),mxEvent.addListener(N,"click",mxUtils.bind(this,function(p){this.saveLibrary(c.getTitle(),f,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==N||c.isModified()||(N.parentNode.removeChild(N),N=null)});mxEvent.consume(p)})))}),S=mxUtils.bind(this,function(g,p,v,C){g=R.cloneCells(mxUtils.sortCells(R.model.getTopmostCells(g)));for(var E=0;E<g.length;E++){var I=-R.getCellGeometry(g[E]);null!=I&&I.translate(-p.x,-p.y)}L.appendChild(this.sidebar.createVertexTemplateFromCells(g,p.width,p.height,C||"",!0,null,!1));g=mxUtils.getXml(this.editor.graph.encodeCells(g));Editor.defaultCompressed&&(g=Graph.compress(g));p={xml:g,w:p.width,h:p.height};null!=C&&(p.title=C);f.push(p);U(v);null!=B&&null!=B.parentNode&&0<f.length&&(B.parentNode.removeChild(B),B=null)}),z=mxUtils.bind(this,function(g){if(R.isSelectionEmpty())R.getRubberband().isActive()?(R.getRubberband().execute(g),-R.getRubberband().reset()):null!=g&&null!=mxEvent.getSource(g)&&mxEvent.getSource(g).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var p=R.getSelectionCells(),v=R.view.getBounds(p);if(null!=v&&0<v.width&&0<v.height){var C=R.view.scale;v.x/=C;v.y/=C;v.width/=C;v.height/=C;v.x-=R.view.translate.x;v.y-=R.view.translate.y;S(p,v)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(g)});-mxEvent.addGestureListeners(L,function(){},mxUtils.bind(this,function(g){R.isMouseDown&&null!=R.panningManager&&null!=R.graphHandler.first&&(R.graphHandler.suspend(),null!=R.graphHandler.hint&&(R.graphHandler.hint.style.visibility="hidden"),L.style.backgroundColor="light-dark(#fefefe, #000000)",L.style.cursor="copy",R.panningManager.stop(),R.autoScroll=!1,mxEvent.consume(g))}),mxUtils.bind(this,function(g){R.isMouseDown&&null!=R.panningManager&&null!=R.graphHandler&&(L.style.backgroundColor="",L.style.cursor=-"default",this.sidebar.showTooltips=!0,R.panningManager.stop(),R.graphHandler.reset(),R.isMouseDown=!1,R.autoScroll=!0,z(g),mxEvent.consume(g))}));mxEvent.addListener(L,"mouseleave",mxUtils.bind(this,function(g){R.isMouseDown&&null!=R.graphHandler.first&&(R.graphHandler.resume(),null!=R.graphHandler.hint&&(R.graphHandler.hint.style.visibility="visible"),L.style.backgroundColor="",L.style.cursor="",R.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(L,"dragover",mxUtils.bind(this,function(g){L.style.backgroundColor=-"light-dark(#fefefe, #000000)";g.dataTransfer.dropEffect="copy";L.style.cursor="copy";this.sidebar.hideTooltip();g.stopPropagation();g.preventDefault()})),mxEvent.addListener(L,"drop",mxUtils.bind(this,function(g){L.style.cursor="";L.style.backgroundColor="";0<g.dataTransfer.files.length&&this.importFiles(g.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(p,v,C,E,I,O,Q,V,W){if(null!=p&&"image/"==v.substring(0,6))p="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+-this.convertDataUri(p),p=[new mxCell("",new mxGeometry(0,0,I,O),p)],p[0].vertex=!0,S(p,new mxRectangle(0,0,I,O),g,mxEvent.isAltDown(g)?null:Q.substring(0,Q.lastIndexOf(".")).replace(/_/g," ")),null!=B&&null!=B.parentNode&&0<f.length&&(B.parentNode.removeChild(B),B=null);else{var M=!1,X=mxUtils.bind(this,function(Z,Y){null!=Z&&"application/pdf"==Y&&(Y=Editor.extractGraphModelFromPdf(Z),null!=Y&&0<Y.length&&(Z=Y));if(null!=Z)if(Z=mxUtils.parseXml(Z),"mxlibrary"==Z.documentElement.nodeName)try{var aa=-JSON.parse(mxUtils.getTextContent(Z.documentElement));F(aa,L);f=f.concat(aa);U(g);this.spinner.stop();M=!0}catch(la){}else if("mxfile"==Z.documentElement.nodeName)try{var da=Z.documentElement.getElementsByTagName("diagram");for(aa=0;aa<da.length;aa++){var ba=this.stringToCells(Editor.getDiagramNodeXml(da[aa])),ha=this.editor.graph.getBoundingBoxFromGeometry(ba);null!=ha&&S(ba,new mxRectangle(0,0,ha.width,ha.height),g)}M=!0}catch(la){null!=window.console&&console.log("error in drop handler:",la)}M||-(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=B&&null!=B.parentNode&&0<f.length&&(B.parentNode.removeChild(B),B=null)});null!=W&&null!=Q&&EditorUi.isVisioFilename(Q)?this.importVisio(W,function(Z){X(Z,"text/xml")},null,Q):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(p,Q)&&null!=W?this.isExternalDataComms()?this.parseFile(W,mxUtils.bind(this,function(Z){4==Z.readyState&&(this.spinner.stop(),200<=Z.status&&299>=Z.status?X(Z.responseText,"text/xml"):-this.handleError({message:mxResources.get(413==Z.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):X(p,v)}}));g.stopPropagation();g.preventDefault()})),mxEvent.addListener(L,"dragleave",function(g){L.style.cursor="";L.style.backgroundColor="";g.stopPropagation();g.preventDefault()}));T=T.cloneNode(!1);T.setAttribute("src",Editor.editImage);T.setAttribute("title",-mxResources.get("edit"));D.insertBefore(T,D.firstChild);mxEvent.addListener(T,"click",l);l=T.cloneNode(!1);l.setAttribute("src",Editor.plusImage);l.setAttribute("title",mxResources.get("add"));D.insertBefore(l,D.firstChild);mxEvent.addListener(l,"click",z);".scratchpad"==c.title&&(this.addSelectionToScratchpad=z);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(l=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),l.className="geLibraryButton",D.insertBefore(l,D.firstChild))}n.appendChild(D);-this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,f){for(var l=0;l<c.length;l++)try{var n=c[l],r=n.data;if(null!=r){r="data:"==r.substring(0,5)?this.convertDataUri(r):r;var t="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==n.aspect&&(t+="aspect=fixed;");t=t+"image="+r+";";null!=n.style&&(t+=n.style);f.appendChild(this.sidebar.createVertexTemplate(t,n.w,n.h,"",n.title||"",!1,null,!0))}else if(null!=n.xml){var x=-this.stringToCells("<"==n.xml.charAt(0)?n.xml:Graph.decompress(n.xml)),B=0==x.length?mxResources.get("drawingEmpty"):null!=n.title?n.title:"";f.appendChild(this.sidebar.createVertexTemplateFromCells(x,n.w,n.h,B,!0,null,!0))}}catch(F){B=null!=F.message?mxResources.get("error")+": "+F.message:String(F),t=this.sidebar.createVertexTemplateFromCells(null,n.w,n.h,B,!0,null,!0),f.appendChild(t)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&-(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,f,l,n,r,t,x){c=new ImageDialog(this,c,f,l,n,r,t,x);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,-f,l,n,r,t){var x=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=x?JSON.stringify(JSON.parse(x),null,2):"",mxUtils.bind(this,function(B){if(null!=B)try{if(null!=t&&t(B),B==x)this.hideDialog();else{if(0<B.length){var F=JSON.parse(B);localStorage.setItem(f,JSON.stringify(F))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(L){this.handleError(L)}}),null,mxResources.get("close"),null,null,null,!0,null,null,r,l,n);this.showDialog(c.container,-660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,280));c.init()};EditorUi.prototype.showConfigurationEditorDialog=function(c,f,l,n){function r(Q){R?F.confirm(mxResources.get("allChangesLost"),null,Q,mxResources.get("cancel"),mxResources.get("discardChanges")):Q()}function t(){P=!0;F.hideDialog()}function x(Q,V){var W=document.createElement("div");W.style.padding="4px 16px";W.style.cursor="pointer";W.style.fontSize="13px";W.style.borderBottom=V?"2px solid #29b6f2":"2px solid transparent";-W.style.fontWeight=V?"bold":"normal";W.style.color=V?"":"#888";W.style.userSelect="none";mxUtils.write(W,Q);return W}function B(Q){if(Q!==N){if("json"===Q)null!=T&&(E.value=JSON.stringify(T,null,2)),g.style.display="none",C.style.display="",z.style.borderBottomColor="#29b6f2",z.style.fontWeight="bold",z.style.color="",S.style.borderBottomColor="transparent",S.style.fontWeight="normal",S.style.color="#888",E.focus();else{try{var V=JSON.parse(E.value);T=V;v.setConfig(V)}catch(W){}g.style.display="";-C.style.display="none";S.style.borderBottomColor="#29b6f2";S.style.fontWeight="bold";S.style.color="";z.style.borderBottomColor="transparent";z.style.fontWeight="normal";z.style.color="#888"}N=Q}}var F=this,L=localStorage.getItem(f),D={};try{null!=L&&(D=JSON.parse(L))}catch(Q){}var T=D,N="editor",R=!1,P=!1;c=document.createElement("div");c.style.position="absolute";c.style.top="20px";c.style.bottom="20px";c.style.left="20px";c.style.right="20px";var U=document.createElement("div");U.style.position=-"absolute";U.style.left="0";U.style.right="0";U.style.top="0";U.style.height="28px";U.style.display="flex";U.style.alignItems="end";U.style.borderBottom="1px solid #d0d0d0";var S=x(mxResources.get("editor",null,"Editor"),!0),z=x(mxResources.get("formatJson",null,"JSON"),!1);U.appendChild(S);U.appendChild(z);c.appendChild(U);var g=document.createElement("div");g.style.position="absolute";g.style.left="0";g.style.right="0";g.style.top="30px";g.style.bottom="50px";U={};try{var p=F.editor.graph;null!=-p.currentVertexStyle&&(U.currentVertexStyle=p.currentVertexStyle);null!=p.currentEdgeStyle&&(U.currentEdgeStyle=p.currentEdgeStyle)}catch(Q){}var v=DrawioConfigEditor.install(g,{initialConfig:D,editorContext:U,darkMode:null!=Editor.isDarkMode&&Editor.isDarkMode(),highContrast:F.isHighContrast(),onConfigChanged:function(Q){T=Q;R=!0}}),C=document.createElement("div");C.style.position="absolute";C.style.left="0";C.style.right="0";C.style.top="30px";C.style.bottom="50px";C.style.display="none";var E=-document.createElement("textarea");E.setAttribute("wrap","off");E.setAttribute("spellcheck","false");E.setAttribute("autocorrect","off");E.setAttribute("autocomplete","off");E.setAttribute("autocapitalize","off");E.style.resize="none";E.style.outline="none";E.style.boxSizing="border-box";E.style.width="100%";E.style.height="100%";try{E.value=null!=L?JSON.stringify(JSON.parse(L),null,2):""}catch(Q){E.value=L||""}mxEvent.addListener(E,"input",function(){R=!0});C.appendChild(E);c.appendChild(g);c.appendChild(C);-mxEvent.addListener(S,"click",function(){B("editor")});mxEvent.addListener(z,"click",function(){B("json")});var I=document.createElement("div");I.style.position="absolute";I.style.left="0";I.style.right="0";I.style.bottom="0";I.style.height="46px";I.style.display="flex";I.style.whiteSpace="nowrap";I.style.alignItems="center";I.style.justifyContent="end";I.style.paddingTop="10px";I.style.paddingBottom="10px";I.style.boxSizing="border-box";null==n||F.isOffline()||I.appendChild(F.createHelpIcon(n));-if(null!=l)for(n=0;n<l.length;n++)(function(Q,V,W){Q=mxUtils.button(Q,function(M){"editor"===N&&null!=T&&(E.value=JSON.stringify(T,null,2));V(M,E)});null!=W&&Q.setAttribute("title",W);Q.className="geBtn";I.appendChild(Q)})(l[n][0],l[n][1],l[n][2]);n=mxUtils.button(mxResources.get("close"),function(){r(t)});n.setAttribute("title","Escape");n.className="geBtn";var O=mxUtils.button(mxResources.get("apply"),function(){var Q="editor"===N?null!=T&&0<Object.keys(T).length?JSON.stringify(T,null,2):"":E.value;-try{if(Q==L)R=!1,t();else{if(0<Q.length){var V=JSON.parse(Q);localStorage.setItem(f,JSON.stringify(V))}else localStorage.removeItem(f);R=!1;t();F.alert(mxResources.get("restartForChangeRequired"))}}catch(W){F.handleError(W)}});O.className="geBtn gePrimaryBtn";F.editor.cancelFirst?(I.appendChild(n),I.appendChild(O)):(I.appendChild(O),I.appendChild(n));c.appendChild(I);mxEvent.addListener(c,"keydown",function(Q){13===Q.keyCode&&mxEvent.isControlDown(Q)&&O.click()});F.showDialog(c,800,600,!0,!1,function(Q,-V){if(!P&&R)return r(t),!1},null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,400));E.scrollTop=0};EditorUi.prototype.showBackgroundImageDialog=function(c,f,l,n){c=null!=c?c:mxUtils.bind(this,function(r,t,x){t||(r=new ChangePageSetup(this,n?x:null,r),r.ignoreColor=!n,this.editor.graph.model.execute(r))});c=new BackgroundImageDialog(this,c,f,l,n);this.showDialog(c.container,400,null,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,f,l,n,r){c=new LibraryDialog(this,c,f,l,n,r);-this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(t){t&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}),!1,!1,new mxRectangle(0,0,480,320));c.init()};EditorUi.prototype.getCollapsedSections=function(){return mxSettings.getCollapsedSections()};EditorUi.prototype.getLibraryExpanded=function(c,f){var l=mxSettings.getCollapsedLibraries();return null!=l[c]?!l[c]:f};EditorUi.prototype.setLibraryExpanded=function(c,f){if(null!=c){var l=mxSettings.getCollapsedLibraries();-l[c]=!f;mxSettings.setCollapsedLibraries(l);mxSettings.save()}};var m=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var f=m.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(l){this.editor.graph.isSelectionEmpty()&&f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,l,n,r,t,x){var B=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},F=null!=c&&null!=c.error?c.error:c;if(null!=-c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{"1"!=urlParams.test&&!x||null==window.console||console.error("EditorUi.handleError:",c)}catch(N){}if(null!=F||null!=f){x=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var L=mxResources.get("ok"),D=null;f=null!=f?f:mxResources.get("error");if(null!=F){null!=F.retry&&(L=mxResources.get("cancel"),D=function(){B();F.retry()});if(404==F.code||404==F.status||403==F.code){x=403==F.code?null!=F.message?mxUtils.htmlEntities(F.message,-!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=r?r:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var T=null!=r?null:null!=t?t:window.location.hash;if(null!=T&&("#G"==T.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==T.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&-0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==F.code||404==F.status)){T="#U"==T.substring(0,2)?T.substring(45,T.lastIndexOf("%26ex")):T.substring(2);this.showError(f,x,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+T);null!=n&&n()}),D,mxResources.get("changeUser"),mxUtils.bind(this,function(){function N(){S.innerText="";for(var z=0;z<R.length;z++){var g=document.createElement("option");mxUtils.write(g,-R[z].displayName);g.value=z;S.appendChild(g);g=document.createElement("option");g.innerHTML=" ";mxUtils.write(g,"<"+R[z].email+">");g.setAttribute("disabled","disabled");S.appendChild(g)}g=document.createElement("option");mxUtils.write(g,mxResources.get("addAccount"));g.value=R.length;S.appendChild(g)}var R=this.drive.getUsersList(),P=document.createElement("div"),U=document.createElement("div");U.style.marginBottom="6px";mxUtils.write(U,mxResources.get("changeUser")+": ");P.appendChild(U);-var S=document.createElement("select");S.style.width="100%";N();mxEvent.addListener(S,"change",mxUtils.bind(this,function(){var z=S.value,g=R.length!=z;g&&this.drive.setUser(R[z]);this.drive.authorize(g,mxUtils.bind(this,function(){g||(R=this.drive.getUsersList(),N())}),mxUtils.bind(this,function(p){this.handleError(p)}),!0)}));P.appendChild(S);P=new CustomDialog(this,P,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(P.container,300,100,!0,!0)}),mxResources.get("cancel"),-mxUtils.bind(this,function(){this.hideDialog();null!=l&&l()}),520,150);return}}null!=F.message?x=""==F.message&&null!=F.name?mxUtils.htmlEntities(F.name,!1):mxUtils.htmlEntities(F.message,!1):null!=F.response&&null!=F.response.error?x=mxUtils.htmlEntities(F.response.error,!1):"undefined"!==typeof window.App&&(F.code==App.ERROR_TIMEOUT?x=mxUtils.htmlEntities(mxResources.get("timeout"),!1):F.code==App.ERROR_BUSY?x=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof F&&0<F.length&&(x=-mxUtils.htmlEntities(F,!1)))}r=c=null;null!=F&&null!=F.helpLink?(c=mxResources.get("help"),r=mxUtils.bind(this,function(){return this.editor.graph.openLink(F.helpLink)})):null!=F&&null!=F.ownerEmail?(c=mxResources.get("contactOwner"),x+=mxUtils.htmlEntities(" ("+c+": "+F.ownerEmail+")",!1),r=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(F.ownerEmail))})):null!=F&&null!=F.alternateAction&&(c=F.alternateAction.label,r=F.alternateAction.funct);this.showError(f,x,L,-l,D,null,null,c,r,null!=F?F.dialogWidth:null,null,null,n?l:null)}else null!=l&&l()};EditorUi.prototype.alert=function(c,f,l){c=new ErrorDialog(this,null,c,mxResources.get("ok"),f);this.showDialog(c.container,l||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,l,n,r,t){c=null!=c?c:"";var x=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},B=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){x();null!=f&&f()},function(){x();-null!=l&&l()},n,r,null,null,null,null,B);this.showDialog(c.container,340,46+B,!0,t);c.init()};EditorUi.prototype.showBanner=function(c,f,l,n,r,t,x,B,F){t=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){x=null!=x?x:"translate(-50%,120%)";B=null!=B?B:"translate(-50%,0%)";var L=document.createElement("div");L.className="geBtn gePrimaryBtn geBanner"+(r?" geSmallBanner":"");L.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(L.style,-"transform",x);mxUtils.setPrefixedStyle(L.style,"transition","all 1000ms ease");null!=F&&mxUtils.setPrefixedStyle(L.style,"transform-origin",F);F=F=document.createElement("img");F.setAttribute("src",Editor.crossImage);F.setAttribute("title",mxResources.get(n?"doNotShowAgain":"close"));F.setAttribute("border","0");r||(t=document.createElement("img"),t.setAttribute("src",IMAGE_PATH+"/logo.png"),t.setAttribute("border","0"),t.setAttribute("align","absmiddle"),t.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",-L.appendChild(t),F.style.cssText=(r?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",L.appendChild(F));mxUtils.write(L,f);document.body.appendChild(L);this.bannerShowing=!0;r&&(F.className="geLibraryButton",L.appendChild(F));f=document.createElement("div");f.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var D=document.createElement("input");-D.setAttribute("type","checkbox");D.setAttribute("id","geDoNotShowAgainCheckbox");D.style.marginRight="6px";if(!n){f.appendChild(D);var T=document.createElement("label");T.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(T,mxResources.get("doNotShowAgain"));f.appendChild(T);L.style.paddingBottom=r?"16px":"30px";L.appendChild(f)}var N=mxUtils.bind(this,function(){null!=L.parentNode&&(L.parentNode.removeChild(L),this.bannerShowing=!1,D.checked||n)&&(this["hideBanner"+c]=!0,isLocalStorage&&-null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=F&&mxEvent.addListener(F,"click",mxUtils.bind(this,function(P){mxEvent.consume(P);N()}));var R=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(L.style,"transform",x);window.setTimeout(mxUtils.bind(this,function(){N()}),1E3)});mxEvent.addListener(L,"click",mxUtils.bind(this,function(P){var U=mxEvent.getSource(P);U!=D&&U!=T?(null!=l&&l(),N(),mxEvent.consume(P)):R()}));window.setTimeout(mxUtils.bind(this,-function(){mxUtils.setPrefixedStyle(L.style,"transform",B)}),500);window.setTimeout(R,r?5E3:3E4);t=!0}return t};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,f,l,n){c=c.toDataURL("image/"+l);if(null!=c&&6<c.length)null!=f&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(f))),0<n&&(c=Editor.writeGraphModelToPng(c,-"pHYs","dpi",n));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,f,l,n,r){var t="jpeg"==l?"jpg":l;n=this.getBaseFilename(n)+(null!=f?".drawio":"")+"."+t;c=this.createImageDataUri(c,f,l,r);this.saveData(n,t,c.substring(c.lastIndexOf(",")+1),"image/"+l,!0)};EditorUi.prototype.showAnimatedGifExportDialog=function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("formatAnimatedGif",-null,"Animated GIF"));c.appendChild(f);f=document.createElement("div");f.className="geDialogSection";var l=document.createElement("div");l.className="geDialogFormRow";var n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("speed",null,"Speed")+":");l.appendChild(n);var r=document.createElement("select"),t=[{label:mxResources.get("slow",null,"Slow"),value:8},{label:mxResources.get("medium",null,"Medium"),value:15},{label:mxResources.get("fast",null,"Fast"),-value:24}];for(n=0;n<t.length;n++){var x=document.createElement("option");mxUtils.write(x,t[n].label);x.setAttribute("value",t[n].value);r.appendChild(x)}r.value=null!=this.lastExportFps?this.lastExportFps:15;0>r.selectedIndex&&(r.value=15);l.appendChild(r);f.appendChild(l);l=document.createElement("div");l.className="geDialogFormRow";n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("zoom")+":");l.appendChild(n);var B=document.createElement("input");-B.setAttribute("type","text");B.value=this.lastExportZoom||"100%";l.appendChild(B);f.appendChild(l);l=document.createElement("div");l.className="geDialogFormRow";n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("borderWidth",null,"Border Width")+":");l.appendChild(n);var F=document.createElement("input");F.setAttribute("type","text");F.value=this.lastExportBorder||"0";l.appendChild(F);f.appendChild(l);l=document.createElement("div");l.className="geDialogFormRow";-n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("loops",null,"Loops")+":");l.appendChild(n);var L=document.createElement("select");t=[{label:mxResources.get("forever",null,"Forever"),value:0},{label:"1",value:1},{label:"3",value:3},{label:"5",value:5}];for(n=0;n<t.length;n++)x=document.createElement("option"),mxUtils.write(x,t[n].label),x.setAttribute("value",t[n].value),L.appendChild(x);L.value=null!=this.lastExportLoops?this.lastExportLoops:0;0>L.selectedIndex&&-(L.value=0);l.appendChild(L);f.appendChild(l);l=document.createElement("div");l.className="geDialogFormRow";n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("appearance")+":");l.appendChild(n);var D=document.createElement("select");n=document.createElement("option");n.setAttribute("value","light");mxUtils.write(n,mxResources.get("light"));D.appendChild(n);n=document.createElement("option");n.setAttribute("value","dark");mxUtils.write(n,mxResources.get("dark"));-D.appendChild(n);var T=Editor.isDarkMode()?"dark":"light";D.value=null!=this.lastExportTheme?this.lastExportTheme:T;0>D.selectedIndex&&(D.value=T);l.appendChild(D);f.appendChild(l);c.appendChild(f);f=document.createElement("div");f.className="geDialogSection";var N=this.addCheckbox(f,mxResources.get("transparentBackground",null,"Transparent Background"),null!=this.lastExportTransparent?this.lastExportTransparent:!1,null,null,null,null,null,!0);c.appendChild(f);c=new CustomDialog(this,c,mxUtils.bind(this,-function(){var R=parseInt(B.value);if(isNaN(R)||0>=R)R=100;this.lastExportZoom=R+"%";this.lastExportBorder=F.value;this.lastExportFps=15!=parseInt(r.value)?parseInt(r.value):null;this.lastExportLoops=0!=parseInt(L.value)?parseInt(L.value):null;this.lastExportTransparent=N.checked?!0:null;this.lastExportTheme=D.value==T?null:D.value;this.exportAnimatedGif({fps:parseInt(r.value),scale:R/100,border:parseInt(F.value)||0,repeat:parseInt(L.value),transparent:N.checked,theme:D.value,background:N.checked?-null:null!=this.editor.graph.background&&this.editor.graph.background!=mxConstants.NONE?this.editor.graph.background:"light-dark(#ffffff,"+Editor.darkColor+")"})}),null,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram");this.showDialog(c.container,360,null,!0,!0,null,null,null,null,!0)};EditorUi.prototype.exportAnimatedGif=function(c){if(this.spinner.spin(document.body,mxResources.get("exporting")))try{(new AnimatedGifExport(this)).doExport(c,mxUtils.bind(this,function(f){this.spinner.stop();-if(null!=f){var l=this.getBaseFilename()+".gif";if("function"===typeof navigator.msSaveBlob)navigator.msSaveBlob(f,l);else{var n=document.createElement("a");n.href=URL.createObjectURL(f);n.download=l;document.body.appendChild(n);n.click();setTimeout(function(){document.body.removeChild(n);URL.revokeObjectURL(n.href)},0)}}}),mxUtils.bind(this,function(f){this.spinner.stop();this.handleError(f)}))}catch(f){this.spinner.stop(),this.handleError(f)}};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=-urlParams.save&&"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,f){c=new TextareaDialog(this,c,f,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280),!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,f,l,n,r,t){"text/xml"!=l||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||-/(\.html)$/i.test(f)||(f=f+"."+(null!=t?t:"drawio"));if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==l||"image/"!=l.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,l,n);else{var x=document.createElement("a");t=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof x.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var B=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);t=65==(B?parseInt(B[2],10):!1)?!1:t}if(t||this.isOffline()){x.href=-URL.createObjectURL(n?this.base64ToBlob(c,l):new Blob([c],{type:l}));t?x.download=f:x.setAttribute("target","_blank");document.body.appendChild(x);try{window.setTimeout(function(){URL.revokeObjectURL(x.href)},2E4),x.click(),x.parentNode.removeChild(x)}catch(F){}}else this.createEchoRequest(c,f,l,n,r).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,l,n,r,t){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=l?"&mime="+l:"")+(null!=r?"&format="+-r:"")+(null!=t?"&base64="+t:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(n?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,l,n,r,t,x,B,F){t=null!=t?t:!1;x=null!=x?x:"vsdx"!=r&&(!mxClient.IS_IOS||!navigator.standalone);var L=mxUtils.bind(this,function(T,N,R,P){try{if("_blank"==N)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,n);else if(null!=l&&"text/html"==l.substring(0,9)&&c.length<EmbedDialog.maxSize){var U=new EmbedDialog(this,c,null,null,null,null,null,-null,null,!0);this.showDialog(U.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));U.init()}else null==window.open(URL.createObjectURL(new Blob([c],{type:"text/plain;charset=utf-8"})))&&mxUtils.popup(c,!0);else if(N==App.MODE_DEVICE||"download"==N)this.doSaveLocalFile(c,T,l,n,null,B);else if(null!=T&&0<T.length){var S=mxUtils.bind(this,function(z){try{this.exportFile(c,T,l,n,N,z)}catch(g){this.handleError(g)}});null!=P?S(P):this.pickFolder(N,S)}}catch(z){this.handleError(z)}});r=[];-t||r.push(App.MODE_BROWSER);x||r.push("_blank");var D=new SaveDialog(this,f,mxUtils.bind(this,function(T,N,R){L(T.value,N,T,R);this.hideDialog(null,null,D.container)}),r,c,l,n,F);this.showDialog(D.container,420,null!=l?114:122,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));D.init()};EditorUi.prototype.openInNewWindow=function(c,f,l){null==window.open(URL.createObjectURL(l?this.base64ToBlob(c,f):new Blob([c],{type:f})))&&mxUtils.popup(c,!0)};var d=EditorUi.prototype.addChromelessToolbarItems;+"</div>")}));!this.editor.isChromelessView()||this.editor.editable?(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers(),this.restoreLibraries(),window.self===window.top||this.noAutoFocus||window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=l&&l();this.editor.fireEvent(new mxEventObject("fileLoaded"));r=!0;if(/(\.svg)$/i.test(c.getTitle())&&+this.getSvgFileProperties(this.fileNode).embedFonts)try{this.editor.loadFonts(),this.editor.embedExtFonts(function(){})}catch(T){}if(!this.isOffline()&&null!=c.getMode()){var x="1"==urlParams.sketch?"sketch":uiTheme;if(null==x)x="default";else if("sketch"==x||"min"==x)x+=Editor.isDarkMode()?"-dark":"-light";EditorUi.logEvent({category:c.getMode().toUpperCase()+"-OPEN-FILE-"+c.getHash(),action:"size_"+c.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")+"_theme_"+x})}EditorUi.debug("File.opened",+[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(T){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(T){}}catch(T){this.fileLoadedError=T;l=null;var B=this.defaultFilename;if(null!=c){try{l=c.getData(),B=c.getTitle()||this.defaultFilename}catch(N){}try{c.close()}catch(N){}}var G=+mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=n?this.fileLoaded(n)||t():t()});if(f)G();else{T.dialogWidth=350;var L=mxUtils.bind(this,function(){this.handleError(T,mxResources.get("errorLoadingFile"),G,!0,null,null,!0)});if(null!=T.fallbackFileData)T.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var N=new LocalFile(this,+T.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(N)})},L();else{var D=this.spinner.spin(document.body,mxResources.get("loading"));this.getRecoveryData(c,l,T,mxUtils.bind(this,function(N){D&&this.spinner.stop();if(null!=N&&1==N.length){var R=N[0];T.alternateAction={label:R.label,funct:mxUtils.bind(this,function(){this.hideDialog();R.lossy?this.confirm(mxResources.get("recoveryWarning"),mxUtils.bind(this,function(){this.openRecoveredCopy(R,B)})):this.openRecoveredCopy(R,B)})}}else null!=+N&&1<N.length&&(T.alternateAction={label:mxResources.get("recover"),funct:mxUtils.bind(this,function(){this.hideDialog();this.showRecoveryDialog(N,B)})});L()}))}}}else t();return r};EditorUi.prototype.getHashValueForPages=function(c,f){var l=0,n=new mxGraphModel,r=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var t=0;t<c.length;t++)if(null!=c[t]){this.updatePageRoot(c[t]);var x=c[t].node.ownerDocument.createElement("diagram");x.setAttribute("id",c[t].getId());n.root=+c[t].root;var B=r.encode(n);this.editor.graph.saveViewState(c[t].viewState,B,!0);B.removeAttribute("pageWidth");B.removeAttribute("pageHeight");x.appendChild(B);null!=f&&(f.eltCount+=x.getElementsByTagName("*").length,f.nodeCount+=x.getElementsByTagName("mxCell").length);l=(l<<5)-l+this.hashValue(x,function(G,L,D,T){return!T||"mxGeometry"!=G.nodeName&&"mxPoint"!=G.nodeName||"x"!=L&&"y"!=L&&"width"!=L&&"height"!=L?T&&"mxCell"==G.nodeName&&"previous"==L?null:D:Math.round(D)},f)<<0}return l};EditorUi.prototype.hashValue=+function(c,f,l){var n=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(n^=this.hashValue(c.nodeName,f,l));if(null!=c.attributes){null!=l&&(l.attrCount+=c.attributes.length);for(var r=0;r<c.attributes.length;r++){var t=c.attributes[r].name,x=null!=f?f(c,t,c.attributes[r].value,!0):c.attributes[r].value;null!=x&&(n^=this.hashValue(t,f,l)+this.hashValue(x,f,l))}}if(null!=c.childNodes)for(r=0;r<c.childNodes.length;r++)n=+(n<<5)-n+this.hashValue(c.childNodes[r],f,l)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);f=0;null!=l&&(l.byteCount+=c.length);for(r=0;r<c.length;r++)f=(f<<5)-f+c.charCodeAt(r)<<0;n^=f}return n};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,l,n,r,t,x){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&+(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(c){if(null==c||"<mxfile"==c.substring(0,7))c=this.emptyLibraryXml;this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var f=0;f<c.length;f++)null!=c[f].xml&&"<"!=c[f].xml.charAt(0)&&(c[f].xml=mxUtils.trim(Graph.decompress(c[f].xml)));f=mxUtils.createXmlDocument();var l=+f.createElement("mxlibrary");mxUtils.setTextContent(l,JSON.stringify(c,null,2));f.appendChild(l);return mxUtils.getXml(f,"\n")};EditorUi.prototype.closeLibrary=function(c){null!=c&&(this.removeLibrarySidebar(c.getHash()),c.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(c.getHash()),".scratchpad"==c.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(c){var f=this.sidebar.palettes[c];if(null!=f){for(var l=0;l<f.length;l++)this.sidebar.unobserveElements(f[l]),+f[l].parentNode.removeChild(f[l]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=function(c,f){var l=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!f){null==c&&(f=this.sidebar.palettes["L.scratchpad"],null==f&&(f=this.sidebar.palettes.search),null!=f&&(c=f[f.length-1].nextSibling));c=null!=c?c:l.firstChild.nextSibling.nextSibling;f=l.lastChild;var n=f.previousSibling;l.insertBefore(f,c);l.insertBefore(n,f)}};EditorUi.prototype.loadLibrary=+function(c,f){var l=mxUtils.parseXml(c.getData());if("mxlibrary"==l.documentElement.nodeName){var n=JSON.parse(mxUtils.getTextContent(l.documentElement));this.libraryLoaded(c,n,l.documentElement.getAttribute("title"),f,l.documentElement.getAttribute("tags"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(c){return""};EditorUi.prototype.showSidebar=function(){null!=this.sidebarWindow?this.sidebarWindow.window.setVisible(!0):this.toggleShapesPanel(!0)};+EditorUi.prototype.showSearchWindow=function(c,f){var l=c?"findReplace":"find",n=l+"Window";if(null==this[n]){var r="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,t=mxSettings.getWindowState(l),x=null!=t&&null!=t.w?t.w:c?r?330:300:240;this[n]=new FindWindow(this,null!=t&&null!=t.x?t.x:document.body.offsetWidth-(x+20),null!=t&&null!=t.y?t.y:100,x,null!=t&&null!=t.h?t.h:c?r?304:288:180,c);this[n].window.addListener("show",function(){this.fireEvent(new mxEventObject(l))});+this[n].window.addListener("hide",function(){this.fireEvent(new mxEventObject(l))});this.installWindowPersistence(l,this[n]);null!=t&&null==f&&this.restoreWindowState(l,this[n]);this[n].window.setVisible(!0)}else null==f&&this[n].window.setVisible(!this[n].window.isVisible());null!=f&&(this[n].doSearch(f),this[n].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,f,l,n,r){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var t=null;if(c.constructor!=+StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var x=0;x<this.openLibraries.length;x++)if(this.openLibraries[x].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[x],this.openLibraries);break}t={file:c,images:f,title:l,expand:n};this.openLibraries.push(t)}else this.scratchpad=c;x=this.sidebar.palettes[c.getHash()];x=null!=x?x[x.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var B=null,G=mxUtils.bind(this,function(g,p){0==+g.length&&c.isEditable()?(null==B&&(B=document.createElement("div"),B.className="geDropTarget",g=mxResources.get("dragElementsHere"),mxUtils.write(B,g),B.setAttribute("title",g)),p.appendChild(B)):this.addLibraryEntries(g,p)});null!=this.sidebar&&null!=f&&(this.sidebar.setCurrentSearchEntryLibrary(c.getHash(),c.getHash()),this.sidebar.addEntries(f,r),this.sidebar.setCurrentSearchEntryLibrary());null==l&&(l=c.getTitle(),null!=l&&/(\.xml)$/i.test(l)&&(l=l.substring(0,l.lastIndexOf("."))));var L=this.sidebar.addPalette(c.getHash(),+l,null!=n?n:!0,mxUtils.bind(this,function(g){G(f,g)}),!0);null!=t&&(t.div=L);this.repositionLibrary(x,"L.scratchpad"!=c.getHash());n=L.parentNode.previousSibling;l=n.getAttribute("title");null!=l&&0<l.length&&".scratchpad"!=c.title&&n.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+l);var D=document.createElement("div");D.style.backgroundColor="inherit";n.style.position="relative";var T=document.createElement("img");T.className="geLibraryButton";T.setAttribute("src",Editor.crossImage);T.setAttribute("title",+mxResources.get("close"));var N=null;if(".scratchpad"!=c.title||this.closableScratchpad)D.appendChild(T),mxEvent.addListener(T,"click",mxUtils.bind(this,function(g){if(!mxEvent.isConsumed(g)){var p=mxUtils.bind(this,function(){null!=t&&mxUtils.remove(t,this.openLibraries);this.closeLibrary(c)});null!=N?this.confirm(mxResources.get("allChangesLost"),null,p,mxResources.get("cancel"),mxResources.get("discardChanges")):p();mxEvent.consume(g)}}));if(c.isEditable()){var R=this.editor.graph,P=null;l=mxUtils.bind(this,+function(g){this.showLibraryDialog(c.getTitle(),L,f,c,c.getMode());mxEvent.consume(g)});var U=mxUtils.bind(this,function(g){c.setModified(!0);c.isAutosave()?(null!=P&&null!=P.parentNode&&P.parentNode.removeChild(P),P=T.cloneNode(!1),P.setAttribute("src",Editor.spinImage),P.setAttribute("title",mxResources.get("saving")),P.style.cursor="default",P.style.marginRight="2px",P.style.marginTop="-2px",D.insertBefore(P,D.firstChild),this.saveLibrary(c.getTitle(),f,c,c.getMode(),!0,!0,function(){null!=P&&+null!=P.parentNode&&P.parentNode.removeChild(P)})):null==N&&(N=T.cloneNode(!1),N.setAttribute("src",Editor.saveImage),N.setAttribute("title",mxResources.get("save")),D.insertBefore(N,D.firstChild),mxEvent.addListener(N,"click",mxUtils.bind(this,function(p){this.saveLibrary(c.getTitle(),f,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==N||c.isModified()||(N.parentNode.removeChild(N),N=null)});mxEvent.consume(p)})))}),S=mxUtils.bind(this,function(g,p,v,C){g=R.cloneCells(mxUtils.sortCells(R.model.getTopmostCells(g)));+for(var E=0;E<g.length;E++){var I=R.getCellGeometry(g[E]);null!=I&&I.translate(-p.x,-p.y)}L.appendChild(this.sidebar.createVertexTemplateFromCells(g,p.width,p.height,C||"",!0,null,!1));g=mxUtils.getXml(this.editor.graph.encodeCells(g));Editor.defaultCompressed&&(g=Graph.compress(g));p={xml:g,w:p.width,h:p.height};null!=C&&(p.title=C);f.push(p);U(v);null!=B&&null!=B.parentNode&&0<f.length&&(B.parentNode.removeChild(B),B=null)}),z=mxUtils.bind(this,function(g){if(R.isSelectionEmpty())R.getRubberband().isActive()?+(R.getRubberband().execute(g),R.getRubberband().reset()):null!=g&&null!=mxEvent.getSource(g)&&mxEvent.getSource(g).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var p=R.getSelectionCells(),v=R.view.getBounds(p);if(null!=v&&0<v.width&&0<v.height){var C=R.view.scale;v.x/=C;v.y/=C;v.width/=C;v.height/=C;v.x-=R.view.translate.x;v.y-=R.view.translate.y;S(p,v)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),+mxResources.get("ok"))}mxEvent.consume(g)});mxEvent.addGestureListeners(L,function(){},mxUtils.bind(this,function(g){R.isMouseDown&&null!=R.panningManager&&null!=R.graphHandler.first&&(R.graphHandler.suspend(),null!=R.graphHandler.hint&&(R.graphHandler.hint.style.visibility="hidden"),L.style.backgroundColor="light-dark(#fefefe, #000000)",L.style.cursor="copy",R.panningManager.stop(),R.autoScroll=!1,mxEvent.consume(g))}),mxUtils.bind(this,function(g){R.isMouseDown&&null!=R.panningManager&&null!=R.graphHandler&&+(L.style.backgroundColor="",L.style.cursor="default",this.sidebar.showTooltips=!0,R.panningManager.stop(),R.graphHandler.reset(),R.isMouseDown=!1,R.autoScroll=!0,z(g),mxEvent.consume(g))}));mxEvent.addListener(L,"mouseleave",mxUtils.bind(this,function(g){R.isMouseDown&&null!=R.graphHandler.first&&(R.graphHandler.resume(),null!=R.graphHandler.hint&&(R.graphHandler.hint.style.visibility="visible"),L.style.backgroundColor="",L.style.cursor="",R.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(L,+"dragover",mxUtils.bind(this,function(g){L.style.backgroundColor="light-dark(#fefefe, #000000)";g.dataTransfer.dropEffect="copy";L.style.cursor="copy";this.sidebar.hideTooltip();g.stopPropagation();g.preventDefault()})),mxEvent.addListener(L,"drop",mxUtils.bind(this,function(g){L.style.cursor="";L.style.backgroundColor="";0<g.dataTransfer.files.length&&this.importFiles(g.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(p,v,C,E,I,O,Q,V,W){if(null!=p&&"image/"==v.substring(0,6))p=+"shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(p),p=[new mxCell("",new mxGeometry(0,0,I,O),p)],p[0].vertex=!0,S(p,new mxRectangle(0,0,I,O),g,mxEvent.isAltDown(g)?null:Q.substring(0,Q.lastIndexOf(".")).replace(/_/g," ")),null!=B&&null!=B.parentNode&&0<f.length&&(B.parentNode.removeChild(B),B=null);else{var M=!1,X=mxUtils.bind(this,function(Z,Y){null!=Z&&"application/pdf"==Y&&(Y=Editor.extractGraphModelFromPdf(Z),null!=Y&&0<Y.length&&+(Z=Y));if(null!=Z)if(Z=mxUtils.parseXml(Z),"mxlibrary"==Z.documentElement.nodeName)try{var aa=JSON.parse(mxUtils.getTextContent(Z.documentElement));G(aa,L);f=f.concat(aa);U(g);this.spinner.stop();M=!0}catch(la){}else if("mxfile"==Z.documentElement.nodeName)try{var da=Z.documentElement.getElementsByTagName("diagram");for(aa=0;aa<da.length;aa++){var ba=this.stringToCells(Editor.getDiagramNodeXml(da[aa])),ha=this.editor.graph.getBoundingBoxFromGeometry(ba);null!=ha&&S(ba,new mxRectangle(0,0,ha.width,+ha.height),g)}M=!0}catch(la){null!=window.console&&console.log("error in drop handler:",la)}M||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=B&&null!=B.parentNode&&0<f.length&&(B.parentNode.removeChild(B),B=null)});null!=W&&null!=Q&&EditorUi.isVisioFilename(Q)?this.importVisio(W,function(Z){X(Z,"text/xml")},null,Q):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(p,Q)&&null!=W?this.isExternalDataComms()?this.parseFile(W,mxUtils.bind(this,function(Z){4==+Z.readyState&&(this.spinner.stop(),200<=Z.status&&299>=Z.status?X(Z.responseText,"text/xml"):this.handleError({message:mxResources.get(413==Z.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):X(p,v)}}));g.stopPropagation();g.preventDefault()})),mxEvent.addListener(L,"dragleave",function(g){L.style.cursor="";L.style.backgroundColor="";g.stopPropagation();g.preventDefault()}));+T=T.cloneNode(!1);T.setAttribute("src",Editor.editImage);T.setAttribute("title",mxResources.get("edit"));D.insertBefore(T,D.firstChild);mxEvent.addListener(T,"click",l);l=T.cloneNode(!1);l.setAttribute("src",Editor.plusImage);l.setAttribute("title",mxResources.get("add"));D.insertBefore(l,D.firstChild);mxEvent.addListener(l,"click",z);".scratchpad"==c.title&&(this.addSelectionToScratchpad=z);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(l=this.createHelpIcon(EditorUi.scratchpadHelpLink,+!0),l.className="geLibraryButton",D.insertBefore(l,D.firstChild))}n.appendChild(D);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,f){for(var l=0;l<c.length;l++)try{var n=c[l],r=n.data;if(null!=r){r="data:"==r.substring(0,5)?this.convertDataUri(r):r;var t="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==n.aspect&&(t+="aspect=fixed;");t=t+"image="+r+";";null!=n.style&&(t+=n.style);f.appendChild(this.sidebar.createVertexTemplate(t,+n.w,n.h,"",n.title||"",!1,null,!0))}else if(null!=n.xml){var x=this.stringToCells("<"==n.xml.charAt(0)?n.xml:Graph.decompress(n.xml)),B=0==x.length?mxResources.get("drawingEmpty"):null!=n.title?n.title:"";f.appendChild(this.sidebar.createVertexTemplateFromCells(x,n.w,n.h,B,!0,null,!0))}}catch(G){B=null!=G.message?mxResources.get("error")+": "+G.message:String(G),t=this.sidebar.createVertexTemplateFromCells(null,n.w,n.h,B,!0,null,!0),f.appendChild(t)}};EditorUi.prototype.getResource=function(c){return null!=+c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,f,l,n,r,t,x){c=new ImageDialog(this,c,f,l,n,r,t,x);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,+!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,l,n,r,t){var x=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=x?JSON.stringify(JSON.parse(x),null,2):"",mxUtils.bind(this,function(B){if(null!=B)try{if(null!=t&&t(B),B==x)this.hideDialog();else{if(0<B.length){var G=JSON.parse(B);localStorage.setItem(f,JSON.stringify(G))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(L){this.handleError(L)}}),null,mxResources.get("close"),+null,null,null,!0,null,null,r,l,n);this.showDialog(c.container,660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,280));c.init()};EditorUi.prototype.showConfigurationEditorDialog=function(c,f,l,n){function r(Q){R?G.confirm(mxResources.get("allChangesLost"),null,Q,mxResources.get("cancel"),mxResources.get("discardChanges")):Q()}function t(){P=!0;G.hideDialog()}function x(Q,V){var W=document.createElement("div");W.style.padding="4px 16px";W.style.cursor="pointer";W.style.fontSize=+"13px";W.style.borderBottom=V?"2px solid #29b6f2":"2px solid transparent";W.style.fontWeight=V?"bold":"normal";W.style.color=V?"":"#888";W.style.userSelect="none";mxUtils.write(W,Q);return W}function B(Q){if(Q!==N){if("json"===Q)null!=T&&(E.value=JSON.stringify(T,null,2)),g.style.display="none",C.style.display="",z.style.borderBottomColor="#29b6f2",z.style.fontWeight="bold",z.style.color="",S.style.borderBottomColor="transparent",S.style.fontWeight="normal",S.style.color="#888",E.focus();else{try{var V=+JSON.parse(E.value);T=V;v.setConfig(V)}catch(W){}g.style.display="";C.style.display="none";S.style.borderBottomColor="#29b6f2";S.style.fontWeight="bold";S.style.color="";z.style.borderBottomColor="transparent";z.style.fontWeight="normal";z.style.color="#888"}N=Q}}var G=this,L=localStorage.getItem(f),D={};try{null!=L&&(D=JSON.parse(L))}catch(Q){}var T=D,N="editor",R=!1,P=!1;c=document.createElement("div");c.style.position="absolute";c.style.top="20px";c.style.bottom="20px";c.style.left="20px";c.style.right=+"20px";var U=document.createElement("div");U.style.position="absolute";U.style.left="0";U.style.right="0";U.style.top="0";U.style.height="28px";U.style.display="flex";U.style.alignItems="end";U.style.borderBottom="1px solid #d0d0d0";var S=x(mxResources.get("editor",null,"Editor"),!0),z=x(mxResources.get("formatJson",null,"JSON"),!1);U.appendChild(S);U.appendChild(z);c.appendChild(U);var g=document.createElement("div");g.style.position="absolute";g.style.left="0";g.style.right="0";g.style.top="30px";+g.style.bottom="50px";U={};try{var p=G.editor.graph;null!=p.currentVertexStyle&&(U.currentVertexStyle=p.currentVertexStyle);null!=p.currentEdgeStyle&&(U.currentEdgeStyle=p.currentEdgeStyle)}catch(Q){}var v=DrawioConfigEditor.install(g,{initialConfig:D,editorContext:U,darkMode:null!=Editor.isDarkMode&&Editor.isDarkMode(),highContrast:G.isHighContrast(),onConfigChanged:function(Q){T=Q;R=!0}}),C=document.createElement("div");C.style.position="absolute";C.style.left="0";C.style.right="0";C.style.top=+"30px";C.style.bottom="50px";C.style.display="none";var E=document.createElement("textarea");E.setAttribute("wrap","off");E.setAttribute("spellcheck","false");E.setAttribute("autocorrect","off");E.setAttribute("autocomplete","off");E.setAttribute("autocapitalize","off");E.style.resize="none";E.style.outline="none";E.style.boxSizing="border-box";E.style.width="100%";E.style.height="100%";try{E.value=null!=L?JSON.stringify(JSON.parse(L),null,2):""}catch(Q){E.value=L||""}mxEvent.addListener(E,"input",+function(){R=!0});C.appendChild(E);c.appendChild(g);c.appendChild(C);mxEvent.addListener(S,"click",function(){B("editor")});mxEvent.addListener(z,"click",function(){B("json")});var I=document.createElement("div");I.style.position="absolute";I.style.left="0";I.style.right="0";I.style.bottom="0";I.style.height="46px";I.style.display="flex";I.style.whiteSpace="nowrap";I.style.alignItems="center";I.style.justifyContent="end";I.style.paddingTop="10px";I.style.paddingBottom="10px";I.style.boxSizing="border-box";+null==n||G.isOffline()||I.appendChild(G.createHelpIcon(n));if(null!=l)for(n=0;n<l.length;n++)(function(Q,V,W){Q=mxUtils.button(Q,function(M){"editor"===N&&null!=T&&(E.value=JSON.stringify(T,null,2));V(M,E)});null!=W&&Q.setAttribute("title",W);Q.className="geBtn";I.appendChild(Q)})(l[n][0],l[n][1],l[n][2]);n=mxUtils.button(mxResources.get("close"),function(){r(t)});n.setAttribute("title","Escape");n.className="geBtn";var O=mxUtils.button(mxResources.get("apply"),function(){var Q="editor"===N?null!=+T&&0<Object.keys(T).length?JSON.stringify(T,null,2):"":E.value;try{if(Q==L)R=!1,t();else{if(0<Q.length){var V=JSON.parse(Q);localStorage.setItem(f,JSON.stringify(V))}else localStorage.removeItem(f);R=!1;t();G.alert(mxResources.get("restartForChangeRequired"))}}catch(W){G.handleError(W)}});O.className="geBtn gePrimaryBtn";G.editor.cancelFirst?(I.appendChild(n),I.appendChild(O)):(I.appendChild(O),I.appendChild(n));c.appendChild(I);mxEvent.addListener(c,"keydown",function(Q){13===Q.keyCode&&mxEvent.isControlDown(Q)&&+O.click()});G.showDialog(c,800,600,!0,!1,function(Q,V){if(!P&&R)return r(t),!1},null,null,new mxRectangle(0,0,null!=l&&2<l.length?500:440,400));E.scrollTop=0};EditorUi.prototype.showBackgroundImageDialog=function(c,f,l,n){c=null!=c?c:mxUtils.bind(this,function(r,t,x){t||(r=new ChangePageSetup(this,n?x:null,r),r.ignoreColor=!n,this.editor.graph.model.execute(r))});c=new BackgroundImageDialog(this,c,f,l,n);this.showDialog(c.container,400,null,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,+f,l,n,r){c=new LibraryDialog(this,c,f,l,n,r);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(t){t&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}),!1,!1,new mxRectangle(0,0,480,320));c.init()};EditorUi.prototype.getCollapsedSections=function(){return mxSettings.getCollapsedSections()};EditorUi.prototype.getLibraryExpanded=function(c,f){var l=mxSettings.getCollapsedLibraries();return null!=l[c]?!l[c]:f};EditorUi.prototype.setLibraryExpanded=function(c,f){if(null!=+c){var l=mxSettings.getCollapsedLibraries();l[c]=!f;mxSettings.setCollapsedLibraries(l);mxSettings.save()}};var m=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var f=m.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(l){this.editor.graph.isSelectionEmpty()&&f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,l,n,r,t,x){var B=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},+G=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{"1"!=urlParams.test&&!x||null==window.console||console.error("EditorUi.handleError:",c)}catch(N){}if(null!=G||null!=f){x=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var L=mxResources.get("ok"),D=null;f=null!=f?f:mxResources.get("error");if(null!=G){null!=G.retry&&(L=mxResources.get("cancel"),D=function(){B();G.retry()});if(404==G.code||404==G.status||403==G.code){x=403==G.code?null!=+G.message?mxUtils.htmlEntities(G.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=r?r:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var T=null!=r?null:null!=t?t:window.location.hash;if(null!=T&&("#G"==T.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==T.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||+null!=c.error.data&&0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==G.code||404==G.status)){T="#U"==T.substring(0,2)?T.substring(45,T.lastIndexOf("%26ex")):T.substring(2);this.showError(f,x,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+T);null!=n&&n()}),D,mxResources.get("changeUser"),mxUtils.bind(this,function(){function N(){S.innerText="";for(var z=0;z<R.length;z++){var g=document.createElement("option");+mxUtils.write(g,R[z].displayName);g.value=z;S.appendChild(g);g=document.createElement("option");g.innerHTML=" ";mxUtils.write(g,"<"+R[z].email+">");g.setAttribute("disabled","disabled");S.appendChild(g)}g=document.createElement("option");mxUtils.write(g,mxResources.get("addAccount"));g.value=R.length;S.appendChild(g)}var R=this.drive.getUsersList(),P=document.createElement("div"),U=document.createElement("div");U.style.marginBottom="6px";mxUtils.write(U,mxResources.get("changeUser")++": ");P.appendChild(U);var S=document.createElement("select");S.style.width="100%";N();mxEvent.addListener(S,"change",mxUtils.bind(this,function(){var z=S.value,g=R.length!=z;g&&this.drive.setUser(R[z]);this.drive.authorize(g,mxUtils.bind(this,function(){g||(R=this.drive.getUsersList(),N())}),mxUtils.bind(this,function(p){this.handleError(p)}),!0)}));P.appendChild(S);P=new CustomDialog(this,P,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(P.container,+300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=l&&l()}),520,150);return}}null!=G.message?x=""==G.message&&null!=G.name?mxUtils.htmlEntities(G.name,!1):mxUtils.htmlEntities(G.message,!1):null!=G.response&&null!=G.response.error?x=mxUtils.htmlEntities(G.response.error,!1):"undefined"!==typeof window.App&&(G.code==App.ERROR_TIMEOUT?x=mxUtils.htmlEntities(mxResources.get("timeout"),!1):G.code==App.ERROR_BUSY?x=mxUtils.htmlEntities(mxResources.get("busy"),+!1):"string"===typeof G&&0<G.length&&(x=mxUtils.htmlEntities(G,!1)))}r=c=null;null!=G&&null!=G.helpLink?(c=mxResources.get("help"),r=mxUtils.bind(this,function(){return this.editor.graph.openLink(G.helpLink)})):null!=G&&null!=G.ownerEmail?(c=mxResources.get("contactOwner"),x+=mxUtils.htmlEntities(" ("+c+": "+G.ownerEmail+")",!1),r=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(G.ownerEmail))})):null!=G&&null!=G.alternateAction&&(c=G.alternateAction.label,r=G.alternateAction.funct);+this.showError(f,x,L,l,D,null,null,c,r,null!=G?G.dialogWidth:null,null,null,n?l:null)}else null!=l&&l()};EditorUi.prototype.alert=function(c,f,l){c=new ErrorDialog(this,null,c,mxResources.get("ok"),f);this.showDialog(c.container,l||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,l,n,r,t){c=null!=c?c:"";var x=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},B=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){x();+null!=f&&f()},function(){x();null!=l&&l()},n,r,null,null,null,null,B);this.showDialog(c.container,340,46+B,!0,t);c.init()};EditorUi.prototype.showBanner=function(c,f,l,n,r,t,x,B,G){t=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){x=null!=x?x:"translate(-50%,120%)";B=null!=B?B:"translate(-50%,0%)";var L=document.createElement("div");L.className="geBtn gePrimaryBtn geBanner"+(r?" geSmallBanner":"");L.style.zIndex=mxPopupMenu.prototype.zIndex;+mxUtils.setPrefixedStyle(L.style,"transform",x);mxUtils.setPrefixedStyle(L.style,"transition","all 1000ms ease");null!=G&&mxUtils.setPrefixedStyle(L.style,"transform-origin",G);G=G=document.createElement("img");G.setAttribute("src",Editor.crossImage);G.setAttribute("title",mxResources.get(n?"doNotShowAgain":"close"));G.setAttribute("border","0");r||(t=document.createElement("img"),t.setAttribute("src",IMAGE_PATH+"/logo.png"),t.setAttribute("border","0"),t.setAttribute("align","absmiddle"),t.style.cssText=+"margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",L.appendChild(t),G.style.cssText=(r?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",L.appendChild(G));mxUtils.write(L,f);document.body.appendChild(L);this.bannerShowing=!0;r&&(G.className="geLibraryButton",L.appendChild(G));f=document.createElement("div");f.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";+var D=document.createElement("input");D.setAttribute("type","checkbox");D.setAttribute("id","geDoNotShowAgainCheckbox");D.style.marginRight="6px";if(!n){f.appendChild(D);var T=document.createElement("label");T.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(T,mxResources.get("doNotShowAgain"));f.appendChild(T);L.style.paddingBottom=r?"16px":"30px";L.appendChild(f)}var N=mxUtils.bind(this,function(){null!=L.parentNode&&(L.parentNode.removeChild(L),this.bannerShowing=!1,D.checked||n)&&+(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=G&&mxEvent.addListener(G,"click",mxUtils.bind(this,function(P){mxEvent.consume(P);N()}));var R=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(L.style,"transform",x);window.setTimeout(mxUtils.bind(this,function(){N()}),1E3)});mxEvent.addListener(L,"click",mxUtils.bind(this,function(P){var U=mxEvent.getSource(P);U!=D&&U!=T?(null!=l&&l(),N(),mxEvent.consume(P)):+R()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(L.style,"transform",B)}),500);window.setTimeout(R,r?5E3:3E4);t=!0}return t};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,f,l,n){c=c.toDataURL("image/"+l);if(null!=c&&6<c.length)null!=f&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(f))),+0<n&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",n));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,f,l,n,r){var t="jpeg"==l?"jpg":l;n=this.getBaseFilename(n)+(null!=f?".drawio":"")+"."+t;c=this.createImageDataUri(c,f,l,r);this.saveData(n,t,c.substring(c.lastIndexOf(",")+1),"image/"+l,!0)};EditorUi.prototype.showAnimatedGifExportDialog=function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");+mxUtils.write(f,mxResources.get("formatAnimatedGif",null,"Animated GIF"));c.appendChild(f);f=document.createElement("div");f.className="geDialogSection";var l=document.createElement("div");l.className="geDialogFormRow";var n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("speed",null,"Speed")+":");l.appendChild(n);var r=document.createElement("select"),t=[{label:mxResources.get("slow",null,"Slow"),value:8},{label:mxResources.get("medium",null,"Medium"),+value:15},{label:mxResources.get("fast",null,"Fast"),value:24}];for(n=0;n<t.length;n++){var x=document.createElement("option");mxUtils.write(x,t[n].label);x.setAttribute("value",t[n].value);r.appendChild(x)}r.value=null!=this.lastExportFps?this.lastExportFps:15;0>r.selectedIndex&&(r.value=15);l.appendChild(r);f.appendChild(l);l=document.createElement("div");l.className="geDialogFormRow";n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("zoom")+":");l.appendChild(n);+var B=document.createElement("input");B.setAttribute("type","text");B.value=this.lastExportZoom||"100%";l.appendChild(B);f.appendChild(l);l=document.createElement("div");l.className="geDialogFormRow";n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("borderWidth",null,"Border Width")+":");l.appendChild(n);var G=document.createElement("input");G.setAttribute("type","text");G.value=this.lastExportBorder||"0";l.appendChild(G);f.appendChild(l);l=document.createElement("div");+l.className="geDialogFormRow";n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("loops",null,"Loops")+":");l.appendChild(n);var L=document.createElement("select");t=[{label:mxResources.get("forever",null,"Forever"),value:0},{label:"1",value:1},{label:"3",value:3},{label:"5",value:5}];for(n=0;n<t.length;n++)x=document.createElement("option"),mxUtils.write(x,t[n].label),x.setAttribute("value",t[n].value),L.appendChild(x);L.value=null!=this.lastExportLoops?+this.lastExportLoops:0;0>L.selectedIndex&&(L.value=0);l.appendChild(L);f.appendChild(l);l=document.createElement("div");l.className="geDialogFormRow";n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("appearance")+":");l.appendChild(n);var D=document.createElement("select");n=document.createElement("option");n.setAttribute("value","light");mxUtils.write(n,mxResources.get("light"));D.appendChild(n);n=document.createElement("option");n.setAttribute("value",+"dark");mxUtils.write(n,mxResources.get("dark"));D.appendChild(n);var T=Editor.isDarkMode()?"dark":"light";D.value=null!=this.lastExportTheme?this.lastExportTheme:T;0>D.selectedIndex&&(D.value=T);l.appendChild(D);f.appendChild(l);c.appendChild(f);f=document.createElement("div");f.className="geDialogSection";var N=this.addCheckbox(f,mxResources.get("transparentBackground",null,"Transparent Background"),null!=this.lastExportTransparent?this.lastExportTransparent:!1,null,null,null,null,null,!0);c.appendChild(f);+c=new CustomDialog(this,c,mxUtils.bind(this,function(){var R=parseInt(B.value);if(isNaN(R)||0>=R)R=100;this.lastExportZoom=R+"%";this.lastExportBorder=G.value;this.lastExportFps=15!=parseInt(r.value)?parseInt(r.value):null;this.lastExportLoops=0!=parseInt(L.value)?parseInt(L.value):null;this.lastExportTransparent=N.checked?!0:null;this.lastExportTheme=D.value==T?null:D.value;this.exportAnimatedGif({fps:parseInt(r.value),scale:R/100,border:parseInt(G.value)||0,repeat:parseInt(L.value),transparent:N.checked,+theme:D.value,background:N.checked?null:null!=this.editor.graph.background&&this.editor.graph.background!=mxConstants.NONE?this.editor.graph.background:"light-dark(#ffffff,"+Editor.darkColor+")"})}),null,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram");this.showDialog(c.container,360,null,!0,!0,null,null,null,null,!0)};EditorUi.prototype.exportAnimatedGif=function(c){if(this.spinner.spin(document.body,mxResources.get("exporting")))try{(new AnimatedGifExport(this)).doExport(c,+mxUtils.bind(this,function(f){this.spinner.stop();if(null!=f){var l=this.getBaseFilename()+".gif";if("function"===typeof navigator.msSaveBlob)navigator.msSaveBlob(f,l);else{var n=document.createElement("a");n.href=URL.createObjectURL(f);n.download=l;document.body.appendChild(n);n.click();setTimeout(function(){document.body.removeChild(n);URL.revokeObjectURL(n.href)},0)}}}),mxUtils.bind(this,function(f){this.spinner.stop();this.handleError(f)}))}catch(f){this.spinner.stop(),this.handleError(f)}};EditorUi.prototype.isLocalFileSave=+function(){return"remote"!=urlParams.save&&"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,f){c=new TextareaDialog(this,c,f,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280),!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,f,l,n,r,t){"text/xml"!=l||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||+/(\.svg)$/i.test(f)||/(\.html)$/i.test(f)||(f=f+"."+(null!=t?t:"drawio"));if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==l||"image/"!=l.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,l,n);else{var x=document.createElement("a");t=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof x.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var B=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);t=65==(B?parseInt(B[2],+10):!1)?!1:t}if(t||this.isOffline()){x.href=URL.createObjectURL(n?this.base64ToBlob(c,l):new Blob([c],{type:l}));t?x.download=f:x.setAttribute("target","_blank");document.body.appendChild(x);try{window.setTimeout(function(){URL.revokeObjectURL(x.href)},2E4),x.click(),x.parentNode.removeChild(x)}catch(G){}}else this.createEchoRequest(c,f,l,n,r).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,l,n,r,t){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c++(null!=l?"&mime="+l:"")+(null!=r?"&format="+r:"")+(null!=t?"&base64="+t:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(n?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,l,n,r,t,x,B,G){t=null!=t?t:!1;x=null!=x?x:"vsdx"!=r&&(!mxClient.IS_IOS||!navigator.standalone);var L=mxUtils.bind(this,function(T,N,R,P){try{if("_blank"==N)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,n);else if(null!=l&&"text/html"==l.substring(0,9)&&c.length<EmbedDialog.maxSize){var U=new EmbedDialog(this,+c,null,null,null,null,null,null,null,!0);this.showDialog(U.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));U.init()}else null==window.open(URL.createObjectURL(new Blob([c],{type:"text/plain;charset=utf-8"})))&&mxUtils.popup(c,!0);else if(N==App.MODE_DEVICE||"download"==N)this.doSaveLocalFile(c,T,l,n,null,B);else if(null!=T&&0<T.length){var S=mxUtils.bind(this,function(z){try{this.exportFile(c,T,l,n,N,z)}catch(g){this.handleError(g)}});null!=P?S(P):this.pickFolder(N,S)}}catch(z){this.handleError(z)}});+r=[];t||r.push(App.MODE_BROWSER);x||r.push("_blank");var D=new SaveDialog(this,f,mxUtils.bind(this,function(T,N,R){L(T.value,N,T,R);this.hideDialog(null,null,D.container)}),r,c,l,n,G);this.showDialog(D.container,420,null!=l?114:122,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));D.init()};EditorUi.prototype.openInNewWindow=function(c,f,l){null==window.open(URL.createObjectURL(l?this.base64ToBlob(c,f):new Blob([c],{type:f})))&&mxUtils.popup(c,!0)};var d=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.isChromelessImageExportEnabled=function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=function(c){if(null!=urlParams.tags){var f=null;try{var l=urlParams.tags;try{l=decodeURIComponent(l)}catch(B){}f=JSON.parse(l)}catch(B){}if(null!=f){var n=this.editor.graph,r=mxUtils.bind(this,function(){var B=null!=this.currentPage?this.currentPage.getId():0;B=f[B];n.hiddenTags=null!=B&&0<B.length?B:[];n.refresh()});this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){r();n.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize()}));this.editor.addListener("pageSelected",r)}this.tagsDialog=this.tagsComponent=null;var t=c(mxUtils.bind(this,function(B){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=this.tagsDialog}),!0),this.tagsComponent.div.getElementsByTagName("div")[0].style.position="",mxUtils.setPrefixedStyle(this.tagsComponent.div.style,"borderRadius","5px"),this.tagsComponent.div.style.maxHeight="160px",this.tagsComponent.div.style.maxWidth="120px",this.tagsComponent.div.style.padding="4px",this.tagsComponent.div.style.overflow="auto",this.tagsComponent.div.style.height="auto",this.tagsComponent.div.style.position="fixed",this.tagsComponent.div.style.fontFamily=Editor.defaultHtmlFont,this.tagsComponent.div.style.backgroundColor="#000000",this.tagsComponent.div.style.color=-"#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null;else{this.tagsDialog=this.tagsComponent.div;mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var F=t.getBoundingClientRect();this.tagsDialog.style.left=F.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+-this.chromelessToolbar.offsetHeight+4+"px";F=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=F.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(B)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var B=this.editor.graph.getAllTags();t.style.display=0<B.length?"":"none"}))}d.apply(this,+"#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null;else{this.tagsDialog=this.tagsComponent.div;mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var G=t.getBoundingClientRect();this.tagsDialog.style.left=G.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)++this.chromelessToolbar.offsetHeight+4+"px";G=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=G.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(B)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var B=this.editor.graph.getAllTags();t.style.display=0<B.length?"":"none"}))}d.apply(this,arguments);this.editor.addListener("tagsDialogShown",mxUtils.bind(this,function(){null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));this.editor.addListener("layersDialogShown",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));this.editor.addListener("pageSelected",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));mxEvent.addListener(this.editor.graph.container,"click",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));if(this.editor.isExportToCanvas()&&this.isChromelessImageExportEnabled()&&-"1"!=urlParams.noExport){this.exportDialog=null;var x=c(mxUtils.bind(this,function(B){var F=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",F);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)F.apply(this);else{this.exportDialog=document.createElement("div");var L=x.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position=+"1"!=urlParams.noExport){this.exportDialog=null;var x=c(mxUtils.bind(this,function(B){var G=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",G);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)G.apply(this);else{this.exportDialog=document.createElement("div");var L=x.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily=Editor.defaultHtmlFont;this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,80);this.exportDialog.style.left=L.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+-4+"px";L=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=L.zIndex;var D=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});D.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",F);this.editor.exportToCanvas(mxUtils.bind(this,function(T){D.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height=+4+"px";L=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=L.zIndex;var D=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});D.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",G);this.editor.exportToCanvas(mxUtils.bind(this,function(T){D.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var N=this.createImageDataUri(T,null,"png");T=document.createElement("img");T.style.maxWidth="140px";T.style.maxHeight="140px";T.style.cursor="pointer";T.style.backgroundColor="white";T.setAttribute("title",mxResources.get("openInNewWindow"));T.setAttribute("border","0");T.setAttribute("src",N);this.exportDialog.appendChild(T);mxEvent.addListener(T,"click",mxUtils.bind(this,function(){this.openInNewWindow(N.substring(N.indexOf(",")+1),"image/png",!0);-F.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(T){D.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(T)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(B)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,l,n,r,t){if("1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){t=-this.embedMessageSource||window.opener||window.parent;var x=this.createLoadMessage("export");x.format=f;x.filename=c;x.data=r?"data:"+n+";base64,"+l:l;x.xml=this.getFileData(!0);t.postMessage(JSON.stringify(x),"*")}else this.isLocalFileSave()?this.saveLocalFile(l,c,n,r,f,t):this.saveRequest(c,f,mxUtils.bind(this,function(B,F){return this.createEchoRequest(l,B,n,r,f,F)}),l,r,n)};EditorUi.prototype.saveRequest=function(c,f,l,n,r,t,x){x=null!=x?x:!mxClient.IS_IOS||!navigator.standalone;var B=mxUtils.bind(this,+G.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(T){D.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(T)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(B)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,l,n,r,t){if("1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){t=+this.embedMessageSource||window.opener||window.parent;var x=this.createLoadMessage("export");x.format=f;x.filename=c;x.data=r?"data:"+n+";base64,"+l:l;x.xml=this.getFileData(!0);t.postMessage(JSON.stringify(x),"*")}else this.isLocalFileSave()?this.saveLocalFile(l,c,n,r,f,t):this.saveRequest(c,f,mxUtils.bind(this,function(B,G){return this.createEchoRequest(l,B,n,r,f,G)}),l,r,n)};EditorUi.prototype.saveRequest=function(c,f,l,n,r,t,x){x=null!=x?x:!mxClient.IS_IOS||!navigator.standalone;var B=mxUtils.bind(this,function(L,D,T,N){if("_blank"==D||null!=L&&0<L.length){var R=l("_blank"==D?null:L,D==App.MODE_DEVICE||"download"==D||null==D||"_blank"==D?"0":"1");null!=R&&(D==App.MODE_DEVICE||"download"==D||"_blank"==D?R.simulate(document,"_blank"):(T=mxUtils.bind(this,function(P){t=null!=t?t:"pdf"==f?"application/pdf":"image/"+f;if(null!=n)try{this.exportFile(n,L,t,!0,D,P)}catch(U){this.handleError(U)}else this.spinner.spin(document.body,mxResources.get("saving"))&&R.send(mxUtils.bind(this,function(){this.spinner.stop();-if(200<=R.getStatus()&&299>=R.getStatus())try{this.exportFile(R.getText(),L,t,!0,D,P)}catch(U){this.handleError(U)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(U){this.spinner.stop();this.handleError(U)}))}),null!=N?T(N):this.pickFolder(D,T)))}});r=[App.MODE_BROWSER];x||r.push("_blank");var F=new SaveDialog(this,c,mxUtils.bind(this,function(L,D,T){B(L.value,D,L,T);this.hideDialog(null,null,F.container)}),r,null,"application/pdf");this.showDialog(F.container,-420,114,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));F.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,f,l,n,r,t){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,f,l){f(null)};EditorUi.prototype.exportSvg=function(c,f,l,n,r,t,-x,B,F,L,D,T,N,R,P,U){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(Y){Editor.addRetryToError(Y,mxUtils.bind(this,function(){this.exportSvg(c,f,l,n,r,t,x,B,F,L,D,T,N,R,P,U)}));this.handleError(Y)})))try{var S=this.editor.graph.isSelectionEmpty();l=null!=l?l:S;var z=f?null:this.editor.graph.background;z==mxConstants.NONE&&(z=null);null==z&&0==f&&(z=this.editor.graph.shapeBackgroundColor);var g=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&+if(200<=R.getStatus()&&299>=R.getStatus())try{this.exportFile(R.getText(),L,t,!0,D,P)}catch(U){this.handleError(U)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(U){this.spinner.stop();this.handleError(U)}))}),null!=N?T(N):this.pickFolder(D,T)))}});r=[App.MODE_BROWSER];x||r.push("_blank");var G=new SaveDialog(this,c,mxUtils.bind(this,function(L,D,T){B(L.value,D,L,T);this.hideDialog(null,null,G.container)}),r,null,"application/pdf");this.showDialog(G.container,+420,114,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));G.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,f,l,n,r,t){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,f,l){f(null)};EditorUi.prototype.exportSvg=function(c,f,l,n,r,t,+x,B,G,L,D,T,N,R,P,U){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(Y){Editor.addRetryToError(Y,mxUtils.bind(this,function(){this.exportSvg(c,f,l,n,r,t,x,B,G,L,D,T,N,R,P,U)}));this.handleError(Y)})))try{var S=this.editor.graph.isSelectionEmpty();l=null!=l?l:S;var z=f?null:this.editor.graph.background;z==mxConstants.NONE&&(z=null);null==z&&0==f&&(z=this.editor.graph.shapeBackgroundColor);var g=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var p=mxUtils.lightDarkColorSupported,v=mxUtils.preferDarkColor;if("light"==D||"dark"==D)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==D;var C=Graph.addFont,E={};Graph.addFont=function(Y,aa,da,ba){C.call(this,Y,aa,da,E)};var I=this.editor.graph.createSvgImageExport(r,P),O=I.drawCellState;I.drawCellState=function(Y,aa){null!=Y&&Graph.processFontStyle(Y.style);O.apply(this,arguments)};var Q=this.editor.graph.getSvg(z,c,x,B,null,l,null,I,"blank"==L?"_blank":"self"==L?"_top":null,null,!N,D,T,null,null,null,U);mxUtils.lightDarkColorSupported=p;mxUtils.preferDarkColor=v;this.editor.graph.addForeignObjectWarning=g;n&&this.editor.graph.addSvgShadow(Q);var V=this.getBaseFilename()+(r?".drawio":"")+".svg";R=null!=R?R:mxUtils.bind(this,function(Y){this.isLocalFileSave()||Y.length<=MAX_REQUEST_SIZE?this.saveData(V,"svg",Y,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),-mxUtils.bind(this,function(){mxUtils.popup(Y)}))});var W=mxUtils.bind(this,function(Y){this.spinner.stop();r&&Y.setAttribute("content",this.getFileData(!0,null,null,null,l,F,null,null,null,null,null,c,x));R(Graph.xmlDeclaration+"\n"+(r?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(Y))});this.editor.graph.mathEnabled&&this.editor.addMathCss(Q);var M=mxUtils.bind(this,function(Y){Editor.replaceSvgDataUris&&t&&EditorUi.embedSvgImages(Y);Editor.foreignObjectImages&&N?this.replaceAlternateContent(Y,+mxUtils.bind(this,function(){mxUtils.popup(Y)}))});var W=mxUtils.bind(this,function(Y){this.spinner.stop();r&&Y.setAttribute("content",this.getFileData(!0,null,null,null,l,G,null,null,null,null,null,c,x));R(Graph.xmlDeclaration+"\n"+(r?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(Y))});this.editor.graph.mathEnabled&&this.editor.addMathCss(Q);var M=mxUtils.bind(this,function(Y){Editor.replaceSvgDataUris&&t&&EditorUi.embedSvgImages(Y);Editor.foreignObjectImages&&N?this.replaceAlternateContent(Y,D,W):W(Y)}),X=Graph.customFontElements;Graph.customFontElements=E;var Z=mxUtils.bind(this,function(Y){Graph.customFontElements=X;Graph.addFont=C;t&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(Y,M,this.thumbImageCache)):M(Y)});N?this.embedFonts(Q,Z,!0):(this.editor.addFontCss(Q),Z(Q))}catch(Y){this.handleError(Y)}};EditorUi.prototype.replaceAlternateContent=function(c,f,l){function n(T,N,R,P,U){var S=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");S.setAttribute("x",N);S.setAttribute("y",R+.5);S.setAttribute("width",P.width);S.setAttribute("height",P.height);null==S.setAttributeNS?S.setAttribute("xlink:href",U):S.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",U);T.replaceChild(S,T.lastChild);B()}function r(){if(x<D.length)D[x++](r)}var t="";f=c.getElementsByTagName("style");for(var x=0;x<f.length;x++)t+=f[x].innerHTML;f=c.getElementsByTagName("switch");counter=f.length;var B=mxUtils.bind(this,function(){counter--;-0==counter&&l(c)}),F={},L={},D=[];for(x=0;x<f.length;x++)mxUtils.bind(this,function(T){var N=T.getElementsByTagName("div");if(0<N.length)try{var R=N[0].cloneNode(!0),P=parseInt(R.style.marginLeft),U=parseInt(R.style.paddingTop),S=R.getElementsByTagName("div")[1],z=N=!1,g=R.style.alignItems,p=R.style.justifyContent;if(null!=R.style.writingMode){var v=R.style.writingMode;z="vertical-"==v.substring(0,9);N="-rl"==v.substring(v.length-3)}var C=!z&&"1px"==R.style.width||z&&"1px"==R.style.height;if(!z&&-"1px"==R.style.height||z&&"1px"==R.style.width)R.style.alignItems=z&&N?"unsafe flex-end":"unsafe flex-start";C&&(R.style.justifyContent="unsafe flex-start");R.style.paddingTop="";R.style.marginLeft="";var E=R.outerHTML,I=F[E];null==I&&(R.style.position="absolute",R.style.visibility="hidden",document.body.appendChild(R),v=1,v="1px"==R.style.width?S.offsetWidth:parseInt(R.style.width),C=1,C="1px"==R.style.height?S.offsetHeight:parseInt(R.style.height),document.body.removeChild(R),I=new mxRectangle(P,-U,v,C),F[E]=I);"1px"==R.style.height&&("unsafe center"==g?U-=I.height/2:"unsafe flex-end"==g&&(U-=I.height));if("1px"==R.style.width)if(!z&&"unsafe center"==p||z&&"unsafe center"==g)P-=I.width/2;else if(!z&&"unsafe flex-end"==p||z&&(!N&&"unsafe flex-end"==g||N&&"unsafe flex-start"==g))P-=I.width;I=new mxRectangle(P,U,I.width,I.height+parseInt(S.style.fontSize)/4);D.push(mxUtils.bind(this,function(O){var Q=L[E];null==Q?Graph.htmlToPng(E,I.width,I.height,mxUtils.bind(this,function(V){n(T,P,U,I,V);L[E]=-V;O()}),t):(n(T,P,U,I,Q),O())}))}catch(O){B()}else B()})(f[x]);0==counter&&l(c);x=0;r()};EditorUi.prototype.addRadiobox=function(c,f,l,n,r,t,x){return this.addCheckbox(c,l,n,r,t,x,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,l,n,r,t,x,B,F){t=null!=t?t:!0;var L=document.createElement("input");L.style.marginRight="8px";L.setAttribute("type",x?"radio":"checkbox");x="geCheckbox-"+Editor.guid();L.id=x;null!=B&&L.setAttribute("name",B);l&&(L.setAttribute("checked","checked"),L.defaultChecked=!0);-n&&L.setAttribute("disabled","disabled");t&&(F?(r=document.createElement("div"),r.className="geDialogCheckRow",r.appendChild(L),l=document.createElement("label"),mxUtils.write(l,f),l.setAttribute("for",x),r.appendChild(l),c.appendChild(r),L.checkRow=r):(L.style.marginTop="16px",c.appendChild(L),l=document.createElement("label"),mxUtils.write(l,f),l.setAttribute("for",x),c.appendChild(l),r||mxUtils.br(c)));return L};EditorUi.prototype.addAdvancedSection=function(c,f){var l=document.createElement("div");+0==counter&&l(c)}),G={},L={},D=[];for(x=0;x<f.length;x++)mxUtils.bind(this,function(T){var N=T.getElementsByTagName("div");if(0<N.length)try{var R=N[0].cloneNode(!0),P=parseInt(R.style.marginLeft),U=parseInt(R.style.paddingTop),S=R.getElementsByTagName("div")[1],z=N=!1,g=R.style.alignItems,p=R.style.justifyContent;if(null!=R.style.writingMode){var v=R.style.writingMode;z="vertical-"==v.substring(0,9);N="-rl"==v.substring(v.length-3)}var C=!z&&"1px"==R.style.width||z&&"1px"==R.style.height;if(!z&&+"1px"==R.style.height||z&&"1px"==R.style.width)R.style.alignItems=z&&N?"unsafe flex-end":"unsafe flex-start";C&&(R.style.justifyContent="unsafe flex-start");R.style.paddingTop="";R.style.marginLeft="";var E=R.outerHTML,I=G[E];null==I&&(R.style.position="absolute",R.style.visibility="hidden",document.body.appendChild(R),v=1,v="1px"==R.style.width?S.offsetWidth:parseInt(R.style.width),C=1,C="1px"==R.style.height?S.offsetHeight:parseInt(R.style.height),document.body.removeChild(R),I=new mxRectangle(P,+U,v,C),G[E]=I);"1px"==R.style.height&&("unsafe center"==g?U-=I.height/2:"unsafe flex-end"==g&&(U-=I.height));if("1px"==R.style.width)if(!z&&"unsafe center"==p||z&&"unsafe center"==g)P-=I.width/2;else if(!z&&"unsafe flex-end"==p||z&&(!N&&"unsafe flex-end"==g||N&&"unsafe flex-start"==g))P-=I.width;I=new mxRectangle(P,U,I.width,I.height+parseInt(S.style.fontSize)/4);D.push(mxUtils.bind(this,function(O){var Q=L[E];null==Q?Graph.htmlToPng(E,I.width,I.height,mxUtils.bind(this,function(V){n(T,P,U,I,V);L[E]=+V;O()}),t):(n(T,P,U,I,Q),O())}))}catch(O){B()}else B()})(f[x]);0==counter&&l(c);x=0;r()};EditorUi.prototype.addRadiobox=function(c,f,l,n,r,t,x){return this.addCheckbox(c,l,n,r,t,x,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,l,n,r,t,x,B,G){t=null!=t?t:!0;var L=document.createElement("input");L.style.marginRight="8px";L.setAttribute("type",x?"radio":"checkbox");x="geCheckbox-"+Editor.guid();L.id=x;null!=B&&L.setAttribute("name",B);l&&(L.setAttribute("checked","checked"),L.defaultChecked=!0);+n&&L.setAttribute("disabled","disabled");t&&(G?(r=document.createElement("div"),r.className="geDialogCheckRow",r.appendChild(L),l=document.createElement("label"),mxUtils.write(l,f),l.setAttribute("for",x),r.appendChild(l),c.appendChild(r),L.checkRow=r):(L.style.marginTop="16px",c.appendChild(L),l=document.createElement("label"),mxUtils.write(l,f),l.setAttribute("for",x),c.appendChild(l),r||mxUtils.br(c)));return L};EditorUi.prototype.addAdvancedSection=function(c,f){var l=document.createElement("div");l.className="geCollapsibleTitle";mxUtils.write(l,mxResources.get(f||"advanced"));var n=document.createElement("div");n.className="geCollapsibleContent geCollapsed";f=document.createElement("div");f.className="geDialogSection";n.appendChild(f);var r=function(t){if(t!==l.classList.contains("geExpanded")&&(l.classList.toggle("geExpanded"),n.classList.toggle("geCollapsed"),t=l.closest(".geDialog"),null!=t)){var x=t.firstElementChild;null!=x&&(t.style.height="",t.style.height=x.scrollHeight+48+"px")}};mxEvent.addListener(l,"click",function(){r(!l.classList.contains("geExpanded"))});c.appendChild(l);c.appendChild(n);return{content:f,wrapper:n,expand:function(){r(!0)},collapse:function(){r(!1)},isExpanded:function(){return l.classList.contains("geExpanded")}}};EditorUi.prototype.addEditButton=function(c,f){var l=document.createElement("div");l.className="geDialogCheckRow";var n=document.createElement("span");n.className="geDialogFormLabel";n.style.display="flex";n.style.alignItems="center";var r=this.addCheckbox(n,mxResources.get("edit")+":",!0,null,!0);r.style.marginTop="0px";l.appendChild(n);n=this.getCurrentFile();var t="";null!=n&&n.getMode()!=App.MODE_DEVICE&&n.getMode()!=App.MODE_BROWSER&&(t=window.location.href);var x=document.createElement("select");x.style.maxWidth="200px";x.className="geBtn";n=document.createElement("option");n.setAttribute("value","blank");mxUtils.write(n,mxResources.get("makeCopy"));x.appendChild(n);var B=document.createElement("option");B.setAttribute("value",-"custom");mxUtils.write(B,mxResources.get("custom")+"...");x.appendChild(B);l.appendChild(x);c.appendChild(l);mxEvent.addListener(x,"change",mxUtils.bind(this,function(){if("custom"==x.value){var F=new FilenameDialog(this,t,mxResources.get("ok"),function(L){null!=L?(t=L,B.setAttribute("title",L),x.setAttribute("title",L)):(x.value="blank",B.removeAttribute("title"),x.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){x.value="blank"});this.showDialog(F.container,300,-80,!0,!1);F.init()}else x.removeAttribute("title")}));mxEvent.addListener(r,"change",mxUtils.bind(this,function(){r.checked&&(null==f||f.checked)?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")}));return{getLink:function(){return r.checked?"blank"===x.value?"_blank":t:null},getEditInput:function(){return r},getEditSelect:function(){return x},getEditRow:function(){return l}}};EditorUi.prototype.addLinkSection=function(c,f){function l(){var F=document.createElement("div");F.style.width=-"100%";F.style.height="100%";F.style.boxSizing="border-box";null!=x&&x!=mxConstants.NONE?(F.style.border="1px solid black",F.style.backgroundColor=x):(F.style.backgroundPosition="center center",F.style.backgroundRepeat="no-repeat",F.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");B.innerText="";B.appendChild(F)}var n=document.createElement("div");n.className="geDialogFormRow";var r=document.createElement("span");r.className="geDialogFormLabel";mxUtils.write(r,mxResources.get("links")++"custom");mxUtils.write(B,mxResources.get("custom")+"...");x.appendChild(B);l.appendChild(x);c.appendChild(l);mxEvent.addListener(x,"change",mxUtils.bind(this,function(){if("custom"==x.value){var G=new FilenameDialog(this,t,mxResources.get("ok"),function(L){null!=L?(t=L,B.setAttribute("title",L),x.setAttribute("title",L)):(x.value="blank",B.removeAttribute("title"),x.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){x.value="blank"});this.showDialog(G.container,300,+80,!0,!1);G.init()}else x.removeAttribute("title")}));mxEvent.addListener(r,"change",mxUtils.bind(this,function(){r.checked&&(null==f||f.checked)?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")}));return{getLink:function(){return r.checked?"blank"===x.value?"_blank":t:null},getEditInput:function(){return r},getEditSelect:function(){return x},getEditRow:function(){return l}}};EditorUi.prototype.addLinkSection=function(c,f){function l(){var G=document.createElement("div");G.style.width=+"100%";G.style.height="100%";G.style.boxSizing="border-box";null!=x&&x!=mxConstants.NONE?(G.style.border="1px solid black",G.style.backgroundColor=x):(G.style.backgroundPosition="center center",G.style.backgroundRepeat="no-repeat",G.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");B.innerText="";B.appendChild(G)}var n=document.createElement("div");n.className="geDialogFormRow";var r=document.createElement("span");r.className="geDialogFormLabel";mxUtils.write(r,mxResources.get("links")+":");n.appendChild(r);var t=document.createElement("select");t.style.width="100px";t.style.padding="0px";t.style.marginRight="10px";t.className="geBtn";r=document.createElement("option");r.setAttribute("value","auto");mxUtils.write(r,mxResources.get("automatic"));t.appendChild(r);r=document.createElement("option");r.setAttribute("value","blank");mxUtils.write(r,mxResources.get("openInNewWindow"));t.appendChild(r);r=document.createElement("option");r.setAttribute("value","self");mxUtils.write(r,mxResources.get("openInThisWindow"));-t.appendChild(r);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),t.appendChild(f));n.appendChild(t);f=document.createElement("span");mxUtils.write(f,mxResources.get("borderColor")+":");n.appendChild(f);var x="#0000ff",B=null;B=mxUtils.button("",mxUtils.bind(this,function(F){this.pickColor(x||"none",function(L){x=L;l()});mxEvent.consume(F)}));l();B.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":+t.appendChild(r);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),t.appendChild(f));n.appendChild(t);f=document.createElement("span");mxUtils.write(f,mxResources.get("borderColor")+":");n.appendChild(f);var x="#0000ff",B=null;B=mxUtils.button("",mxUtils.bind(this,function(G){this.pickColor(x||"none",function(L){x=L;l()});mxEvent.consume(G)}));l();B.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";B.style.marginLeft="4px";B.style.height="22px";B.style.width="22px";B.style.position="relative";B.style.top="1px";B.className="geColorBtn";n.appendChild(B);c.appendChild(n);return{getColor:function(){return x},getTarget:function(){return t.value},focus:function(){t.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,l,n,r,t,x,B){t=null!=t?t:[];l&&(t.push("lightbox=1"),"auto"!=c&&t.push("target="+c),null!=f&&f!=mxConstants.NONE&&t.push("highlight="+("#"==f.charAt(0)?f.substring(1):-f)),null!=n&&0<n.length&&t.push("edit="+encodeURIComponent(n)),r&&t.push("layers=1"),x&&t.push("link-icons=1"),B&&t.push("tooltip-icons=1"),this.editor.graph.foldingEnabled&&t.push("nav=1"));return t};EditorUi.prototype.createLink=function(c,f,l,n,r,t,x,B,F,L,D,T,N,R,P){var U=this.getCurrentFile();F=this.createUrlParameters(c,f,n,r,t,F,R,P);c=!0;null!=x?l="#U"+encodeURIComponent(x):B||null==U||""==U.getHash()?l="#R"+encodeURIComponent(l?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):-Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(l="#"+U.getHash(),c=!1);c&&null!=U&&null!=U.getTitle()&&U.getTitle()!=this.defaultFilename&&F.push("title="+encodeURIComponent(U.getTitle()));L&&1<l.length&&(F.push("open="+l.substring(1)),l="");L=1==D?this.currentPage:D;null!=L&&"function"===typeof L.getId&&F.push("page-id="+L.getId());T&&F.push("transparent=1");null!=N&&F.push("dark="+N);return(n&&(null!=x||null!=U&&U.getMode()!=App.MODE_GITHUB&&U.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:-mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<F.length?"?"+F.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,f,l,n,r,t,x,B,F,L,D,T,N,R,P,U){this.getBasenames();var S={};P&&(S["show-link-icons"]=!0);U&&(S["show-tooltip-icons"]=!0);""!=r&&r!=mxConstants.NONE&&(S.highlight=r);"auto"!==n&&(S.target=n);L||(S.lightbox=!1);S.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==-l||(S.zoom=l/100);l=[];x&&(l.push("pages"),S.resize=!0,null!=this.pages&&null!=this.currentPage&&(S.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(l.push("zoom"),S.resize=!0);B&&l.push("layers");F&&(l.push("tags"),R&&(f=this.getHiddenTagsMap(),null!=f&&(S.hiddenTags=f)));null!=N&&(S["dark-mode"]=N);0<l.length&&(L&&l.push("lightbox"),S.toolbar=l.join(" "));null!=D&&0<D.length&&(S.edit=D);null!=c?S.url=c:S.xml=this.getFileData(!0,null,null,null,null,!x);t='<div class="mxgraph" style="'+(t?+f)),null!=n&&0<n.length&&t.push("edit="+encodeURIComponent(n)),r&&t.push("layers=1"),x&&t.push("link-icons=1"),B&&t.push("tooltip-icons=1"),this.editor.graph.foldingEnabled&&t.push("nav=1"));return t};EditorUi.prototype.createLink=function(c,f,l,n,r,t,x,B,G,L,D,T,N,R,P){var U=this.getCurrentFile();G=this.createUrlParameters(c,f,n,r,t,G,R,P);c=!0;null!=x?l="#U"+encodeURIComponent(x):B||null==U||""==U.getHash()?l="#R"+encodeURIComponent(l?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):+Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(l="#"+U.getHash(),c=!1);c&&null!=U&&null!=U.getTitle()&&U.getTitle()!=this.defaultFilename&&G.push("title="+encodeURIComponent(U.getTitle()));L&&1<l.length&&(G.push("open="+l.substring(1)),l="");L=1==D?this.currentPage:D;null!=L&&"function"===typeof L.getId&&G.push("page-id="+L.getId());T&&G.push("transparent=1");null!=N&&G.push("dark="+N);return(n&&(null!=x||null!=U&&U.getMode()!=App.MODE_GITHUB&&U.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:+mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<G.length?"?"+G.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,f,l,n,r,t,x,B,G,L,D,T,N,R,P,U){this.getBasenames();var S={};P&&(S["show-link-icons"]=!0);U&&(S["show-tooltip-icons"]=!0);""!=r&&r!=mxConstants.NONE&&(S.highlight=r);"auto"!==n&&(S.target=n);L||(S.lightbox=!1);S.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==+l||(S.zoom=l/100);l=[];x&&(l.push("pages"),S.resize=!0,null!=this.pages&&null!=this.currentPage&&(S.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(l.push("zoom"),S.resize=!0);B&&l.push("layers");G&&(l.push("tags"),R&&(f=this.getHiddenTagsMap(),null!=f&&(S.hiddenTags=f)));null!=N&&(S["dark-mode"]=N);0<l.length&&(L&&l.push("lightbox"),S.toolbar=l.join(" "));null!=D&&0<D.length&&(S.edit=D);null!=c?S.url=c:S.xml=this.getFileData(!0,null,null,null,null,!x);t='<div class="mxgraph" style="'+(t?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(S))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";T(t,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.addPagesRow=function(c){var f=document.createElement("select");f.style.maxWidth="260px";var l=document.createElement("option");mxUtils.write(l,mxResources.get("allPages"));l.setAttribute("value","allPages");f.appendChild(l);l=document.createElement("option");mxUtils.write(l,mxResources.get("currentPage"));l.setAttribute("value","currentPage");f.appendChild(l);l=null;if(null!=this.pages&&1<this.pages.length){l=document.createElement("div");l.className="geDialogFormRow";var n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("pages")+":");l.appendChild(n);l.appendChild(f);c.appendChild(l)}return{row:l,select:f}};EditorUi.prototype.showHtmlDialog=function(c,f,l,n){var r=document.createElement("div");r.style.whiteSpace="nowrap";var t=document.createElement("h3");mxUtils.write(t,mxResources.get("html"));r.appendChild(t);var x=document.createElement("select");x.className="geBtn";x.style.margin="0 4px 8px 4px";x.style.width="calc(100% - 8px)";x.style.boxSizing="border-box";t=document.createElement("option");mxUtils.write(t,mxResources.get("includeCopyOfMyDiagram"));t.setAttribute("value","copy");x.appendChild(t);t=document.createElement("option");t.setAttribute("value","url");x.appendChild(t);null!=l?(mxUtils.write(t,mxResources.get("publicDiagramUrl")),t.setAttribute("title",l)):(mxUtils.write(t,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),t.setAttribute("disabled","disabled"));r.appendChild(x);mxUtils.br(r);var B=-this.getCurrentFile();if(null==l&&null!=B&&B.constructor==window.DriveFile){t=document.createElement("div");t.style.marginBottom="8px";var F=document.createElement("a");F.style.color="gray";F.style.cursor="pointer";mxUtils.write(F,mxResources.get("share"));t.appendChild(F);mxEvent.addListener(F,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(B.getId(),B)}));r.appendChild(t)}t=document.createElement("div");t.className="geDialogSection";var L=this.addLinkSection(t),-D=this.addPagesRow(t);F=document.createElement("div");F.className="geDialogCheckRow";var T=document.createElement("input");T.setAttribute("type","checkbox");T.setAttribute("checked","checked");T.defaultChecked=!0;T.style.marginRight="8px";F.appendChild(T);var N=document.createElement("label");mxUtils.write(N,mxResources.get("zoom")+":");F.appendChild(N);var R=document.createElement("input");R.setAttribute("type","text");R.style.width="60px";R.style.marginLeft="4px";R.value="100%";F.appendChild(R);-t.appendChild(F);var P=this.addCheckbox(t,mxResources.get("fit"),!0,null,null,null,null,null,!0),U=this.addCheckbox(t,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);r.appendChild(t);t=this.addAdvancedSection(r).content;var S=document.createElement("select");S.style.maxWidth="260px";F=document.createElement("option");F.setAttribute("value","light");mxUtils.write(F,mxResources.get("light"));S.appendChild(F);F=document.createElement("option");F.setAttribute("value","dark");mxUtils.write(F,-mxResources.get("dark"));S.appendChild(F);F=document.createElement("option");F.setAttribute("value","auto");mxUtils.write(F,mxResources.get("automatic"));F.setAttribute("selected","selected");S.appendChild(F);F=document.createElement("div");F.className="geDialogFormRow";N=document.createElement("span");N.className="geDialogFormLabel";mxUtils.write(N,mxResources.get("appearance")+":");F.appendChild(N);F.appendChild(S);t.appendChild(F);var z=null;if(EditorUi.enableHtmlEditOption){z=this.addEditButton(t,+this.getCurrentFile();if(null==l&&null!=B&&B.constructor==window.DriveFile){t=document.createElement("div");t.style.marginBottom="8px";var G=document.createElement("a");G.style.color="gray";G.style.cursor="pointer";mxUtils.write(G,mxResources.get("share"));t.appendChild(G);mxEvent.addListener(G,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(B.getId(),B)}));r.appendChild(t)}t=document.createElement("div");t.className="geDialogSection";var L=this.addLinkSection(t),+D=this.addPagesRow(t);G=document.createElement("div");G.className="geDialogCheckRow";var T=document.createElement("input");T.setAttribute("type","checkbox");T.setAttribute("checked","checked");T.defaultChecked=!0;T.style.marginRight="8px";G.appendChild(T);var N=document.createElement("label");mxUtils.write(N,mxResources.get("zoom")+":");G.appendChild(N);var R=document.createElement("input");R.setAttribute("type","text");R.style.width="60px";R.style.marginLeft="4px";R.value="100%";G.appendChild(R);+t.appendChild(G);var P=this.addCheckbox(t,mxResources.get("fit"),!0,null,null,null,null,null,!0),U=this.addCheckbox(t,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);r.appendChild(t);t=this.addAdvancedSection(r).content;var S=document.createElement("select");S.style.maxWidth="260px";G=document.createElement("option");G.setAttribute("value","light");mxUtils.write(G,mxResources.get("light"));S.appendChild(G);G=document.createElement("option");G.setAttribute("value","dark");mxUtils.write(G,+mxResources.get("dark"));S.appendChild(G);G=document.createElement("option");G.setAttribute("value","auto");mxUtils.write(G,mxResources.get("automatic"));G.setAttribute("selected","selected");S.appendChild(G);G=document.createElement("div");G.className="geDialogFormRow";N=document.createElement("span");N.className="geDialogFormLabel";mxUtils.write(N,mxResources.get("appearance")+":");G.appendChild(N);G.appendChild(S);t.appendChild(G);var z=null;if(EditorUi.enableHtmlEditOption){z=this.addEditButton(t,U);var g=z.getEditInput();mxEvent.addListener(U,"change",function(){U.checked?g.removeAttribute("disabled"):g.setAttribute("disabled","disabled");g.checked&&U.checked?z.getEditSelect().removeAttribute("disabled"):z.getEditSelect().setAttribute("disabled","disabled")})}var p=this.addCheckbox(t,mxResources.get("layers"),!0,null,null,null,null,null,!0),v=this.addCheckbox(t,mxResources.get("tags"),!0,null,null,null,null,null,!0),C=this.addCheckbox(t,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);C.checkRow.style.paddingLeft="24px";var E=this.addCheckbox(t,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),I=this.addCheckbox(t,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(v,"change",function(){v.checked?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")});mxEvent.addListener(U,"change",function(){U.checked?(E.removeAttribute("disabled"),I.removeAttribute("disabled")):(E.setAttribute("disabled","disabled"),-I.setAttribute("disabled","disabled"))});c=new CustomDialog(this,r,mxUtils.bind(this,function(){n("url"==x.value?l:null,T.checked,R.value,L.getTarget(),L.getColor(),P.checked,null!=D.row&&"allPages"==D.select.value,p.checked,v.checked,U.checked,null!=z?z.getLink():null,null!=S?S.value:null,v.checked&&C.checked,E.checked,I.checked)}),null,c,f);this.showDialog(c.container,360,null,!0,!0);x.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,f,l,n,r,t,x,B,F,L,D,T){var N=document.createElement("div");+I.setAttribute("disabled","disabled"))});c=new CustomDialog(this,r,mxUtils.bind(this,function(){n("url"==x.value?l:null,T.checked,R.value,L.getTarget(),L.getColor(),P.checked,null!=D.row&&"allPages"==D.select.value,p.checked,v.checked,U.checked,null!=z?z.getLink():null,null!=S?S.value:null,v.checked&&C.checked,E.checked,I.checked)}),null,c,f);this.showDialog(c.container,360,null,!0,!0);x.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,f,l,n,r,t,x,B,G,L,D,T){var N=document.createElement("div");N.style.whiteSpace="nowrap";var R=document.createElement("h3");mxUtils.write(R,c||mxResources.get("publish"));N.appendChild(R);var P=document.createElement("select");P.className="geBtn";P.style.margin="0 4px 8px 4px";P.style.width="calc(100% - 8px)";P.style.boxSizing="border-box";r=null!=r?r:"https://www.drawio.com/docs/manual/export/publish-link/";c=document.createElement("option");mxUtils.write(c,mxResources.get("includeCopyOfMyDiagram"));c.setAttribute("value","copy");P.appendChild(c);c=document.createElement("option");mxUtils.write(c,mxResources.get("authorizationRequired"));c.setAttribute("value","auth");P.appendChild(c);null==B||""==B.getHash()||B.getMode()==App.MODE_DEVICE||B.getMode()==App.MODE_BROWSER?c.setAttribute("disabled","disabled"):P.value="auth";B=document.createElement("option");B.setAttribute("value","public");P.appendChild(B);null!=x?(mxUtils.write(B,mxResources.get("publicDiagramUrl")),B.setAttribute("title",x),P.value="public"):(mxUtils.write(B,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),B.setAttribute("disabled","disabled"));N.appendChild(P);mxUtils.br(N);x=document.createElement("div");x.className="geDialogSection";var U=null,S=null;if(null!=f||null!=l)f=document.createElement("div"),f.className="geDialogInlineFields",B=document.createElement("div"),B.className="geDialogInlineField",c=document.createElement("label"),mxUtils.write(c,mxResources.get("width")+":"),B.appendChild(c),U=document.createElement("input"),U.setAttribute("type","text"),U.value="100%",B.appendChild(U),@@ -13930,17 +13934,17 @@ T.setAttribute("value",L),this.pages[L]==this.currentPage&&T.setAttribute("selecn=this.addAdvancedSection(N).content;var I=document.createElement("select");I.style.maxWidth="260px";l=document.createElement("option");l.setAttribute("value","0");mxUtils.write(l,mxResources.get("light"));I.appendChild(l);l=document.createElement("option");l.setAttribute("value","1");mxUtils.write(l,mxResources.get("dark"));I.appendChild(l);l=document.createElement("option");l.setAttribute("value","auto");mxUtils.write(l,mxResources.get("automatic"));l.setAttribute("selected","selected");I.appendChild(l);D&&(D=document.createElement("div"),D.className="geDialogFormRow",l=document.createElement("span"),l.className="geDialogFormLabel",mxUtils.write(l,mxResources.get("appearance")+":"),D.appendChild(l),D.appendChild(I),n.appendChild(D));var O=this.addEditButton(n,E),Q=O.getEditInput(),V=this.addCheckbox(n,mxResources.get("layers"),!0,null,null,null,null,null,!0),W=this.addCheckbox(n,mxResources.get("tags"),!0,null,null,null,null,null,!0),M=this.addCheckbox(n,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);M.checkRow.style.paddingLeft="24px";var X=this.addCheckbox(n,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),Z=this.addCheckbox(n,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(W,"change",function(){W.checked?M.removeAttribute("disabled"):M.setAttribute("disabled","disabled")});mxEvent.addListener(E,"change",function(){E.checked?(V.removeAttribute("disabled"),Q.removeAttribute("disabled"),W.removeAttribute("disabled"),-X.removeAttribute("disabled"),Z.removeAttribute("disabled"),W.checked&&M.removeAttribute("disabled")):(V.setAttribute("disabled","disabled"),Q.setAttribute("disabled","disabled"),W.setAttribute("disabled","disabled"),M.setAttribute("disabled","disabled"),X.setAttribute("disabled","disabled"),Z.setAttribute("disabled","disabled"));Q.checked&&E.checked?O.getEditSelect().removeAttribute("disabled"):O.getEditSelect().setAttribute("disabled","disabled")});r=new CustomDialog(this,N,mxUtils.bind(this,function(){F(z.getTarget(),+X.removeAttribute("disabled"),Z.removeAttribute("disabled"),W.checked&&M.removeAttribute("disabled")):(V.setAttribute("disabled","disabled"),Q.setAttribute("disabled","disabled"),W.setAttribute("disabled","disabled"),M.setAttribute("disabled","disabled"),X.setAttribute("disabled","disabled"),Z.setAttribute("disabled","disabled"));Q.checked&&E.checked?O.getEditSelect().removeAttribute("disabled"):O.getEditSelect().setAttribute("disabled","disabled")});r=new CustomDialog(this,N,mxUtils.bind(this,function(){G(z.getTarget(),z.getColor(),null==C||0>=C.selectedIndex||null!=C.getAttribute("disabled")?null:this.pages[C.selectedIndex],E.checked,O.getLink(),V.checked,null!=U?U.value:null,null!=S?S.value:null,W.checked,P.value,null!=g?g.checked:!1,I.value,"allPages"==v.value,W.checked&&M.checked,X.checked,Z.checked)}),null,mxResources.get("create"),r,t);this.showDialog(r.container,360,null,!0,!0);null!=U?(U.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?U.select():document.execCommand("selectAll",!1,null)):-P.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,l,n,r){var t=document.createElement("div");t.style.whiteSpace="nowrap";var x=document.createElement("h3");mxUtils.write(x,mxResources.get("image"));t.appendChild(x);if(r){x=document.createElement("div");x.className="geDialogSection";var B=document.createElement("div");B.className="geDialogFormRow";var F=document.createElement("span");F.className="geDialogFormLabel";mxUtils.write(F,mxResources.get("zoom")+":");B.appendChild(F);var L=-document.createElement("input");L.setAttribute("type","text");L.value=this.lastExportZoom||"100%";B.appendChild(L);x.appendChild(B);B=document.createElement("div");B.className="geDialogFormRow";F=document.createElement("span");F.className="geDialogFormLabel";mxUtils.write(F,mxResources.get("borderWidth")+":");B.appendChild(F);var D=document.createElement("input");D.setAttribute("type","text");D.value=this.lastExportBorder||"0";B.appendChild(D);x.appendChild(B);t.appendChild(x)}x=document.createElement("div");+P.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,l,n,r){var t=document.createElement("div");t.style.whiteSpace="nowrap";var x=document.createElement("h3");mxUtils.write(x,mxResources.get("image"));t.appendChild(x);if(r){x=document.createElement("div");x.className="geDialogSection";var B=document.createElement("div");B.className="geDialogFormRow";var G=document.createElement("span");G.className="geDialogFormLabel";mxUtils.write(G,mxResources.get("zoom")+":");B.appendChild(G);var L=+document.createElement("input");L.setAttribute("type","text");L.value=this.lastExportZoom||"100%";B.appendChild(L);x.appendChild(B);B=document.createElement("div");B.className="geDialogFormRow";G=document.createElement("span");G.className="geDialogFormLabel";mxUtils.write(G,mxResources.get("borderWidth")+":");B.appendChild(G);var D=document.createElement("input");D.setAttribute("type","text");D.value=this.lastExportBorder||"0";B.appendChild(D);x.appendChild(B);t.appendChild(x)}x=document.createElement("div");x.className="geDialogSection";var T=this.addCheckbox(x,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!this.editor.graph.isSelectionEmpty(),this.editor.graph.isSelectionEmpty(),null,null,null,null,!0),N=n?null:this.addCheckbox(x,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram,null,null,null,null,null,!0);B=this.editor.graph;var R=B.background==mxConstants.NONE||null==B.background,P=n?null:this.addCheckbox(x,mxResources.get("transparentBackground"),null!=this.lastExportTransparent?this.lastExportTransparent:R,null,null,null,null,null,!0);t.appendChild(x);c=new CustomDialog(this,t,mxUtils.bind(this,function(){this.lastExportSelectionOnly=T.checked;r&&(this.lastExportZoom=L.value,this.lastExportBorder=D.value);null!=P&&(this.lastExportTransparent=P.checked==R?null:P.checked);var U=parseInt(L.value)/100||1,S=parseInt(D.value)||0;l(!T.checked,null!=N?N.checked:!1,null!=P?P.checked:!1,U,S)}),null,c,f);this.showDialog(c.container,340,null,!0,!0)};EditorUi.prototype.showExportDialog=-function(c,f,l,n,r,t,x,B,F){function L(){return Math.max(0,parseFloat(U.value)||100)/100}function D(){var Da=L();da.value=Math.floor(Z*Da);ba.value=Math.floor(Y*Da)}x=null!=x?x:Editor.defaultIncludeDiagram;var T=document.createElement("div");T.style.whiteSpace="nowrap";var N=this.editor.graph,R=document.createElement("h3");mxUtils.write(R,c);T.appendChild(R);c=document.createElement("div");c.className="geDialogSection";R=document.createElement("div");R.className="geDialogFormRow";var P=document.createElement("span");+function(c,f,l,n,r,t,x,B,G){function L(){return Math.max(0,parseFloat(U.value)||100)/100}function D(){var Da=L();da.value=Math.floor(Z*Da);ba.value=Math.floor(Y*Da)}x=null!=x?x:Editor.defaultIncludeDiagram;var T=document.createElement("div");T.style.whiteSpace="nowrap";var N=this.editor.graph,R=document.createElement("h3");mxUtils.write(R,c);T.appendChild(R);c=document.createElement("div");c.className="geDialogSection";R=document.createElement("div");R.className="geDialogFormRow";var P=document.createElement("span");P.className="geDialogFormLabel";mxUtils.write(P,mxResources.get("zoom")+":");R.appendChild(P);var U=document.createElement("input");U.setAttribute("type","text");U.value=this.lastExportZoom||"100%";R.appendChild(U);c.appendChild(R);T.appendChild(c);c=document.createElement("div");c.className="geDialogSection";var S=this.addCheckbox(c,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!N.isSelectionEmpty(),N.isSelectionEmpty(),null,null,null,null,!0),z=document.createElement("input");z.setAttribute("disabled",-"disabled");z.setAttribute("type","checkbox");var g=document.createElement("select");g.style.marginLeft="8px";var p=["selectionOnly","diagram","page"];R={};for(P=0;P<p.length;P++)if(!N.isSelectionEmpty()||"selectionOnly"!=p[P]){var v=document.createElement("option");mxUtils.write(v,mxResources.get(p[P]));v.setAttribute("value",p[P]);g.appendChild(v);R[p[P]]=v}F?(P=document.createElement("div"),P.className="geDialogFormRow",t=document.createElement("span"),t.className="geDialogFormLabel",mxUtils.write(t,+"disabled");z.setAttribute("type","checkbox");var g=document.createElement("select");g.style.marginLeft="8px";var p=["selectionOnly","diagram","page"];R={};for(P=0;P<p.length;P++)if(!N.isSelectionEmpty()||"selectionOnly"!=p[P]){var v=document.createElement("option");mxUtils.write(v,mxResources.get(p[P]));v.setAttribute("value",p[P]);g.appendChild(v);R[p[P]]=v}G?(P=document.createElement("div"),P.className="geDialogFormRow",t=document.createElement("span"),t.className="geDialogFormLabel",mxUtils.write(t,mxResources.get("size")+":"),P.appendChild(t),g.style.marginLeft="0",P.appendChild(g),c.appendChild(P),mxEvent.addListener(g,"change",function(){"selectionOnly"==g.value&&(S.checked=!0)})):t&&(t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(z),P=document.createElement("label"),mxUtils.write(P,mxResources.get("crop")),t.appendChild(P),c.appendChild(t),mxEvent.addListener(S,"change",function(){S.checked?z.removeAttribute("disabled"):z.setAttribute("disabled","disabled")}));-N.isSelectionEmpty()?F&&null!=S.checkRow&&null!=S.checkRow.parentNode&&S.checkRow.parentNode.removeChild(S.checkRow):(g.value=this.lastExportSelectionOnly?"selectionOnly":"diagram",z.setAttribute("checked","checked"),z.defaultChecked=!0,mxEvent.addListener(S,"change",function(){g.value=S.checked?"selectionOnly":"diagram"}));var C=!N.isSelectionEmpty()&&this.lastExportSelectionOnly?"selectionOnly":"diagram";F&&null!=this.lastExportType&&null!=R[this.lastExportType]&&(g.value=this.lastExportType,"selectionOnly"==+N.isSelectionEmpty()?G&&null!=S.checkRow&&null!=S.checkRow.parentNode&&S.checkRow.parentNode.removeChild(S.checkRow):(g.value=this.lastExportSelectionOnly?"selectionOnly":"diagram",z.setAttribute("checked","checked"),z.defaultChecked=!0,mxEvent.addListener(S,"change",function(){g.value=S.checked?"selectionOnly":"diagram"}));var C=!N.isSelectionEmpty()&&this.lastExportSelectionOnly?"selectionOnly":"diagram";G&&null!=this.lastExportType&&null!=R[this.lastExportType]&&(g.value=this.lastExportType,"selectionOnly"==this.lastExportType&&(S.checked=!0));var E="jpeg"!=B&&"webp"!=B,I=this.addCheckbox(c,mxResources.get("transparentBackground"),E&&null!=this.lastExportTransparent?this.lastExportTransparent:!1,null,null,E,null,null,!0);T.appendChild(c);c=document.createElement("div");c.className="geDialogSection";R=!1;t=null!=this.pages?this.pages.length:1;var O=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram")+(1<t?":":""),x,null,null,"jpeg"!=B&&"webp"!=B,null,null,!0);"jpeg"!=B&&"webp"!=B&&(R=!0);var Q=document.createElement("select");Q.style.maxWidth="260px";if("png"==B||"svg"==B)x=function(){O.checked?Q.removeAttribute("disabled"):Q.setAttribute("disabled","disabled")},P=document.createElement("option"),P.setAttribute("value","allPages"),mxUtils.write(P,mxResources.get("allPages")),Q.appendChild(P),P=document.createElement("option"),P.setAttribute("value","currentPage"),mxUtils.write(P,mxResources.get("currentPage")),Q.appendChild(P),1<t&&(t=document.createElement("div"),t.style.paddingLeft="24px",t.appendChild(Q),c.appendChild(t)),null!=this.lastEmbedInclude&&(Q.value=this.lastEmbedInclude),mxEvent.addListener(O,"change",x),x();var V=document.createElement("input");V.setAttribute("type","checkbox");V.id="geCheckbox-"+Editor.guid();var W=document.createElement("input");W.setAttribute("type","checkbox");W.id="geCheckbox-"+Editor.guid();var M=document.createElement("input");M.setAttribute("type","checkbox");M.id="geCheckbox-"+Editor.guid();var X=document.createElement("select");X.style.maxWidth=@@ -13956,64 +13960,64 @@ sa.value=null!=this.lastExportTheme?this.lastExportTheme:va;0>sa.selectedIndex&&":"),c.appendChild(R),c.appendChild(X),x.appendChild(c),x.appendChild(t));var wa=1==N.shadowVisible,qa=this.addCheckbox(x,mxResources.get("shadow"),null!=this.lastExportShadow?this.lastExportShadow:wa,null,null,null,null,null,!0),Ba=null,Aa="svg"!=B&&(this.isOffline()||!Editor.canvasSupported);if("png"==B||"jpeg"==B||"webp"==B||"svg"==B)Ba=this.addCheckbox(x,mxResources.get("grid"),Aa||null==this.lastExportGrid?!1:this.lastExportGrid,Aa,!1,!0,null,null,!0);f&&(V.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(V),N=document.createElement("label"),mxUtils.write(N,mxResources.get("embedImages")),N.setAttribute("for",V.id),t.appendChild(N),x.appendChild(t),W.checked=null!=this.lastEmbedFonts?this.lastEmbedFonts:Editor.embedSvgFonts,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(W),N=document.createElement("label"),mxUtils.write(N,mxResources.get("embedFonts")),N.setAttribute("for",W.id),t.appendChild(N),x.appendChild(t),M.checked=null!=this.lastEmbedCellMetadata?this.lastEmbedCellMetadata:!1,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(M),N=document.createElement("label"),mxUtils.write(N,mxResources.get("embedCellMetadata")),N.setAttribute("for",M.id),t.appendChild(N),x.appendChild(t));l=new CustomDialog(this,T,mxUtils.bind(this,function(){this.lastExportSelectionOnly=S.checked;this.lastExportBorder=ra.value;this.lastExportZoom=U.value;E&&(this.lastExportTransparent=-0==I.checked?null:I.checked);this.lastExportTheme=sa.value==va?null:sa.value;this.lastExportShadow=qa.checked==wa?null:qa.checked;null==Ba||Aa||(this.lastExportGrid=Ba.checked?!0:null);"svg"==B&&(this.lastExportLinkTarget="auto"==X.value?null:X.value);if("png"==B){var Da=parseInt(la.value);this.lastExportDpi=!isNaN(Da)&&0<Da&&100!=Da?Da:null}F&&(this.lastExportType=g.value==C?null:g.value);f&&(this.lastEmbedImages=V.checked,this.lastEmbedFonts=W.checked,this.lastEmbedCellMetadata=M.checked);if("png"==+0==I.checked?null:I.checked);this.lastExportTheme=sa.value==va?null:sa.value;this.lastExportShadow=qa.checked==wa?null:qa.checked;null==Ba||Aa||(this.lastExportGrid=Ba.checked?!0:null);"svg"==B&&(this.lastExportLinkTarget="auto"==X.value?null:X.value);if("png"==B){var Da=parseInt(la.value);this.lastExportDpi=!isNaN(Da)&&0<Da&&100!=Da?Da:null}G&&(this.lastExportType=g.value==C?null:g.value);f&&(this.lastEmbedImages=V.checked,this.lastEmbedFonts=W.checked,this.lastEmbedCellMetadata=M.checked);if("png"==B||"svg"==B)this.lastEmbedInclude=Q.value;null!=r&&r(U.value,I.checked,!S.checked,qa.checked,O.checked,V.checked&&f,ra.value,z.checked,("png"==B||"svg"==B)&&"currentPage"==Q.value,X.value,null!=Ba?Ba.checked:null,null!=sa?sa.value:null,g.value,W.checked,M.checked&&f,"png"==B&&0<parseInt(la.value)&&100!=parseInt(la.value)?parseInt(la.value):null)}),null,l,n);this.showDialog(l.container,360,null,!0,!0,null,null,null,null,!0);U.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?U.select():-document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,l,n,r,t,x){var B=document.createElement("div"),F=this.editor.graph;if(null!=f){var L=document.createElement("h3");mxUtils.write(L,f);B.appendChild(L)}f=document.createElement("div");f.className="geDialogSection";var D=x?this.addPagesRow(f):null,T=this.addCheckbox(f,mxResources.get("fit"),!0,null,null,null,null,null,!0),N=this.addCheckbox(f,mxResources.get("shadow"),F.shadowVisible&&n,!n,null,null,null,+document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,l,n,r,t,x){var B=document.createElement("div"),G=this.editor.graph;if(null!=f){var L=document.createElement("h3");mxUtils.write(L,f);B.appendChild(L)}f=document.createElement("div");f.className="geDialogSection";var D=x?this.addPagesRow(f):null,T=this.addCheckbox(f,mxResources.get("fit"),!0,null,null,null,null,null,!0),N=this.addCheckbox(f,mxResources.get("shadow"),G.shadowVisible&&n,!n,null,null,null,null,!0),R=this.addCheckbox(f,l,!1,null,null,null,null,null,!0),P=this.addCheckbox(f,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);B.appendChild(f);l=this.addAdvancedSection(B).content;var U=null;t&&(U=document.createElement("select"),U.style.maxWidth="260px",t=document.createElement("option"),t.setAttribute("value","light"),mxUtils.write(t,mxResources.get("light")),U.appendChild(t),t=document.createElement("option"),t.setAttribute("value","dark"),mxUtils.write(t,mxResources.get("dark")),U.appendChild(t),mxUtils.lightDarkColorSupported?(t=document.createElement("option"),t.setAttribute("value","auto"),mxUtils.write(t,mxResources.get("automatic")),U.appendChild(t),U.value="auto"):U.value=Editor.isDarkMode()?"dark":"light",t=document.createElement("div"),t.className="geDialogFormRow",n=document.createElement("span"),n.className="geDialogFormLabel",mxUtils.write(n,mxResources.get("appearance")+":"),t.appendChild(n),t.appendChild(U),l.appendChild(t));var S=this.addEditButton(l,P),z=S.getEditInput(),-g=1<F.model.getChildCount(F.model.getRoot()),p=this.addCheckbox(l,mxResources.get("layers"),g,!g,null,null,null,null,!0),v=this.addCheckbox(l,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),C=this.addCheckbox(l,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(P,"change",function(){P.checked?(g&&p.removeAttribute("disabled"),null!=D&&D.select.removeAttribute("disabled"),z.removeAttribute("disabled"),v.removeAttribute("disabled"),C.removeAttribute("disabled")):+g=1<G.model.getChildCount(G.model.getRoot()),p=this.addCheckbox(l,mxResources.get("layers"),g,!g,null,null,null,null,!0),v=this.addCheckbox(l,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),C=this.addCheckbox(l,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(P,"change",function(){P.checked?(g&&p.removeAttribute("disabled"),null!=D&&D.select.removeAttribute("disabled"),z.removeAttribute("disabled"),v.removeAttribute("disabled"),C.removeAttribute("disabled")):(null!=D&&D.select.setAttribute("disabled","disabled"),p.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),v.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"));z.checked&&P.checked?S.getEditSelect().removeAttribute("disabled"):S.getEditSelect().setAttribute("disabled","disabled")});r=new CustomDialog(this,B,mxUtils.bind(this,function(){c(T.checked,N.checked,R.checked,P.checked,S.getLink(),p.checked,v.checked,C.checked,null!=U?U.value:null,null!=D?null!=-D.row&&"allPages"==D.select.value:null)}),null,mxResources.get("embed"),r);this.showDialog(r.container,280,null,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,l,n,r,t,x,B,F,L){function D(U){var S=" ",z="";n&&(S=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(null!=N?"&page="+N:"")+(r?"&edit=_blank":"")+(t?"&layers=1":"")+(x?"&link-icons=1":"")+(B?"&tooltip-icons=1":"")+"');}})(this);\"",z+="cursor:pointer;");c&&(z+="max-width:100%;");var g="";l&&(g=' width="'+Math.round(T.width)+'" height="'+Math.round(T.height)+'"');F('<img src="'+U+'"'+g+(""!=z?' style="'+z+'"':"")+S+"/>")}var T=this.editor.graph.getGraphBounds(),N=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,+D.row&&"allPages"==D.select.value:null)}),null,mxResources.get("embed"),r);this.showDialog(r.container,280,null,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,l,n,r,t,x,B,G,L){function D(U){var S=" ",z="";n&&(S=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"++EditorUi.lightboxHost+"/?client=1"+(null!=N?"&page="+N:"")+(r?"&edit=_blank":"")+(t?"&layers=1":"")+(x?"&link-icons=1":"")+(B?"&tooltip-icons=1":"")+"');}})(this);\"",z+="cursor:pointer;");c&&(z+="max-width:100%;");var g="";l&&(g=' width="'+Math.round(T.width)+'" height="'+Math.round(T.height)+'"');G('<img src="'+U+'"'+g+(""!=z?' style="'+z+'"':"")+S+"/>")}var T=this.editor.graph.getGraphBounds(),N=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(U){var S=n?this.getFileData(!0):null;U=this.createImageDataUri(U,S,"png");D(U)}),null,null,null,mxUtils.bind(this,function(U){L({message:mxResources.get("unknownError")})}),null,!0,l?2:1,null,f,null,null,Editor.defaultBorder);else if(f=this.getFileData(!0),T.width*T.height<=MAX_AREA&&f.length<=MAX_REQUEST_SIZE){var R="";l&&(R="&w="+Math.round(2*T.width)+"&h="+Math.round(2*T.height));var P=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(n?"1":"0")+R+"&xml="+encodeURIComponent(f));-P.send(mxUtils.bind(this,function(){200<=P.getStatus()&&299>=P.getStatus()?D("data:image/png;base64,"+P.getText()):L({message:mxResources.get("unknownError")})}))}else L({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,f,l,n,r,t,x,B,F,L,D){F=null!=F?F:"auto";L=null!=L?L:!0;var T=this.getSelectedPageIndex(),N=mxUtils.lightDarkColorSupported,R=mxUtils.preferDarkColor;if("light"==F||"dark"==F)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==-F;var P=null;try{P=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,F)}finally{mxUtils.lightDarkColorSupported=N,mxUtils.preferDarkColor=R}F=P.getElementsByTagName("a");if(null!=F)for(N=0;N<F.length;N++)R=F[N].getAttribute("href"),null!=R&&"#"==R.charAt(0)&&"_blank"==F[N].getAttribute("target")&&F[N].removeAttribute("target");n&&P.setAttribute("content",this.getFileData(!0,null,null,null,null,!L));f&&this.editor.graph.addSvgShadow(P);if(l){var U=" ",S="";n&&(U="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"++P.send(mxUtils.bind(this,function(){200<=P.getStatus()&&299>=P.getStatus()?D("data:image/png;base64,"+P.getText()):L({message:mxResources.get("unknownError")})}))}else L({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,f,l,n,r,t,x,B,G,L,D){G=null!=G?G:"auto";L=null!=L?L:!0;var T=this.getSelectedPageIndex(),N=mxUtils.lightDarkColorSupported,R=mxUtils.preferDarkColor;if("light"==G||"dark"==G)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==+G;var P=null;try{P=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,G)}finally{mxUtils.lightDarkColorSupported=N,mxUtils.preferDarkColor=R}G=P.getElementsByTagName("a");if(null!=G)for(N=0;N<G.length;N++)R=G[N].getAttribute("href"),null!=R&&"#"==R.charAt(0)&&"_blank"==G[N].getAttribute("target")&&G[N].removeAttribute("target");n&&P.setAttribute("content",this.getFileData(!0,null,null,null,null,!L));f&&this.editor.graph.addSvgShadow(P);if(l){var U=" ",S="";n&&(U="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(L&&null!=T?"&page="+T:"")+(r?"&edit=_blank":"")+(t?"&layers=1":"")+(x?"&link-icons=1":"")+(B?"&tooltip-icons=1":"")+"');}})(this);\"",S+="cursor:pointer;");c&&(S+="max-width:100%;");this.editor.convertImages(P,mxUtils.bind(this,function(z){D('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(z))+'"'+(""!=S?' style="'+S+'"':"")+U+"/>")}))}else S="",n&&(P.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(L&&null!=T?"&page="+T:"")+(r?"&edit=_blank":"")+(t?"&layers=1":"")+(x?"&link-icons=1":"")+(B?"&tooltip-icons=1":"")+"');}}})(this);"),S+="cursor:pointer;"),c&&(c=parseInt(P.getAttribute("width")),f=parseInt(P.getAttribute("height")),P.setAttribute("viewBox","-0.5 -0.5 "+c+" "+f),S+="max-width:100%;max-height:"+f+"px;",P.removeAttribute("height")),""!=S&&(c=P.getAttribute("style"),P.setAttribute("style",(null!=c&&0<c.length?c+" ":"")+S)),this.editor.addFontCss(P),this.editor.graph.mathEnabled&&this.editor.addMathCss(P),D(mxUtils.getXml(P))};EditorUi.prototype.timeSince=function(c){c=Math.floor((new Date-c)/1E3);var f=Math.floor(c/31536E3);if(1<f)return f+" "+mxResources.get("years");f=Math.floor(c/2592E3);if(1<f)return f+" "+mxResources.get("months");f=Math.floor(c/86400);if(1<f)return f+" "+mxResources.get("days");f=Math.floor(c/3600);if(1<f)return f+" "+mxResources.get("hours");f=Math.floor(c/60);return 1<f?f+" "+mxResources.get("minutes"):1==f?f+" "+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,f){if(null!=c){var l=null;if("diagram"==c.nodeName)l=c;else if("mxfile"==c.nodeName){var n=c.getElementsByTagName("diagram");if(0<n.length){l=n[0];var r=f.getGlobalVariable;f.getGlobalVariable=function(t){return"page"==t?l.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==t?1:r.apply(this,arguments)}}}null!=l&&(c=Editor.parseDiagramNode(l))}n=this.editor.graph;try{this.editor.graph=f,this.editor.setGraphXml(c)}catch(t){}finally{this.editor.graph=-n}return c};EditorUi.prototype.getSvgFileProperties=function(c){return this.getPngFileProperties(c)};EditorUi.prototype.getPngFileProperties=function(c){var f=1,l=0;if(null!=c){if(c.hasAttribute("scale")){var n=parseFloat(c.getAttribute("scale"));!isNaN(n)&&0<n&&(f=n)}c.hasAttribute("border")&&(n=parseInt(c.getAttribute("border")),!isNaN(n)&&0<n&&(l=n))}return{scale:f,border:l}};EditorUi.prototype.getEmbeddedPng=function(c,f,l,n,r){try{var t=this.editor.graph,x=null;if(null!=l&&0<l.length)t=this.createTemporaryGraph(t.getStylesheet()),-document.body.appendChild(t.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(l).documentElement,!0),t),x=l;else if(null!=this.pages&&this.currentPage!=this.pages[0]){t=this.createTemporaryGraph(t.getStylesheet());var B=t.getGlobalVariable;t.setBackgroundImage=this.editor.graph.setBackgroundImage;var F=this.pages[0];this.currentPage==F?t.setBackgroundImage(this.editor.graph.backgroundImage):null!=F.viewState&&null!=F.viewState&&t.setBackgroundImage(F.viewState.backgroundImage);-t.getGlobalVariable=function(L){return"page"==L?F.getName():"pagenumber"==L?1:B.apply(this,arguments)};document.body.appendChild(t.container);t.model.setRoot(F.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(L){try{null==x&&(x=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var D=L.toDataURL("image/png");D=Editor.writeGraphModelToPng(D,"tEXt","mxfile",encodeURIComponent(x));c(D.substring(D.lastIndexOf(",")+1));t!=this.editor.graph&&t.container.parentNode.removeChild(t.container)}catch(T){null!=-f&&f(T)}}),null,null,null,mxUtils.bind(this,function(L){null!=f&&f(L)}),null,null,n,null,t.shadowVisible,null,t,r,null,null,null,"diagram",null)}catch(L){null!=f&&f(L)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,l,n,r,t,x,B,F,L,D,T,N,R,P){B=null!=B?B:!0;D=null!=D?D:0;x=null!=F?F:f.background;x==mxConstants.NONE&&(x=null);null==x&&"none"==f.getAdaptiveColors()&&(x="#ffffff");F=this.editor.graph.createSvgImageExport(null!=c,R);var U=Graph.addFont,S=null;if(null==r){S={};Graph.addFont=function(C,-E,I,O){U.call(this,C,E,I,S)};var z=F.drawCellState;F.drawCellState=function(C,E){null!=C&&Graph.processFontStyle(C.style);z.apply(this,arguments)}}R=null;try{R=f.getSvg(x,L,D,null,null,t,null,F,null,f.shadowVisible||T,null,N,"diagram")}finally{Graph.addFont=U}(f.shadowVisible||T)&&f.addSvgShadow(R,null,null,0==D);null!=c&&R.setAttribute("content",c);null!=l&&R.setAttribute("resource",l);var g=mxUtils.bind(this,function(C){C=(n?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+-"\n")+mxUtils.getXml(C);null!=r&&r(C);return C});f.mathEnabled&&this.editor.addMathCss(R);if(null!=r)this.embedFonts(R,mxUtils.bind(this,function(C){B?this.editor.convertImages(C,mxUtils.bind(this,function(E){g(E)})):g(C)}),P);else{c=Graph.customFontElements;Graph.customFontElements=S;try{var p=!1;this.embedFonts(R,function(){p=!0},P);if(!p)try{null==this.editor.resolvedFontCss&&this.editor.addFontCss(R);var v=this.editor.graph.getExtFontCss();0<v.length&&this.editor.addFontCss(R,v)}catch(C){}}finally{Graph.customFontElements=-c}return g(R)}};EditorUi.prototype.embedFonts=function(c,f,l){if(l=null!=l?l:Editor.embedSvgFonts)this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(r){try{null!=r&&this.editor.addFontCss(c,r),f(c)}catch(t){f(c)}}))}catch(r){f(c)}}));else{try{this.editor.addFontCss(c);var n=this.editor.graph.getExtFontCss();0<n.length&&this.editor.addFontCss(c,n)}catch(r){}f(c)}};-EditorUi.prototype.exportImage=function(c,f,l,n,r,t,x,B,F,L,D,T,N){F=null!=F?F:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(P){Editor.addRetryToError(P,mxUtils.bind(this,function(){this.exportImage(c,f,l,n,r,t,x,B,F,L,D,T,N)}));this.handleError(P)}))){var R=this.editor.graph.isSelectionEmpty();l=null!=l?l:R;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(P){this.spinner.stop();try{this.saveCanvas(P,-r?this.getFileData(!0,null,null,null,l,B,null,null,null,null,null,c,t):null,F,null==this.pages||0==this.pages.length,D)}catch(U){this.handleError(U)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(P){this.spinner.stop();this.handleError(P)}),null,l,c||1,f,n,null,null,t,x,L,T,N)}catch(P){this.spinner.stop(),this.handleError(P)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?-c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,l,n,r,t,x){EditorUi.debug("EditorUi.importXml",[this],"xml",[c],"dx",[f],"dy",[l],"crop",[n],"noErrorHandling",[r],"addNewPage",[t],"applyDefaultStyles",[x]);f=null!=f?f:0;l=null!=l?l:0;var B=[];try{if(null!=c&&0<c.length){var F=null!=this.pages?this.pages.length:0,L=this.isDiagramEmpty(),D=this.currentPage,T=this.editor.graph;T.model.beginUpdate();-try{var N=mxUtils.parseXml(c);c={};var R=this.editor.extractGraphModel(N.documentElement,null!=this.pages);if(null!=R&&"mxfile"==R.nodeName&&null!=this.pages){var P=R.getElementsByTagName("diagram");if(0<P.length){N=[];var U=0;if(1==P.length&&!t){if(null!=this.currentPage&&(c[P[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var S=P[0].getAttribute("name");null!=S&&""!=S&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,S))}R=Editor.parseDiagramNode(P[0]);-n=!1;U=1}for(;U<P.length;U++){var z=P[U].getAttribute("id");P[U].removeAttribute("id");var g=this.updatePageRoot(new DiagramPage(P[U]));c[z]=P[U].getAttribute("id");var p=this.pages.length;null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[p+1]));T.model.execute(new ChangePage(this,g,g,p,0<U));N.push(g)}this.updatePageLinks(c,N)}}if(null!=R&&"mxGraphModel"===R.nodeName){B=T.importGraphModel(R,f,l,n);if(null!=B)for(this.addLocalPagesToMapping(c),U=0;U<B.length;U++)this.updatePageLinksForCell(c,-B[U]);var v=T.parseBackgroundImage(R.getAttribute("backgroundImage"));if(null!=v&&null!=v.originalSrc&&this.updateBackgroundPageLink(c,v)){var C=new ChangePageSetup(this,null,v);C.ignoreColor=!0;T.model.execute(C)}}x&&T.pasteCellStyles(T.includeDescendants(B),T.defaultVertexStyle,T.defaultEdgeStyle);!t&&D!=this.currentPage&&null!=this.pages&&1<this.pages.length&&L&&1==F&&this.removePage(D)}finally{T.model.endUpdate()}}}catch(E){if(r)throw E;this.handleError(E)}return B};EditorUi.prototype.updatePageLinks=-function(c,f){for(var l=0;l<f.length;l++)this.updatePageLinksForCell(c,f[l].root),f[l]!=this.currentPage&&(f[l].needsUpdate=!0),null!=f[l].viewState&&this.updateBackgroundPageLink(c,f[l].viewState.backgroundImage)&&(f[l]==this.currentPage&&this.editor.graph.setViewState(f[l].viewState,!0),f[l].needsUpdate=!0)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){var l=!1;try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var n=c[f.originalSrc.substring(f.originalSrc.indexOf(",")+1)];null!=n&&(f.originalSrc=-"data:page/id,"+n,l=!0)}}catch(r){}return l};EditorUi.prototype.updatePageLinksForCell=function(c,f){var l=document.createElement("div"),n=this.editor.graph,r=n.getLinkForCell(f);null!=r&&n.setLinkForCell(f,this.updatePageLink(c,r));if(n.isHtmlLabel(f)){l.innerHTML=Graph.sanitizeHtml(n.getLabel(f));for(var t=l.getElementsByTagName("a"),x=!1,B=0;B<t.length;B++)r=t[B].getAttribute("href"),null!=r&&(t[B].setAttribute("href",this.updatePageLink(c,r)),x=!0);x&&n.labelChanged(f,l.innerHTML)}for(B=0;B<n.model.getChildCount(f);B++)this.updatePageLinksForCell(c,-n.model.getChildAt(f,B))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var l=c[f.substring(f.indexOf(",")+1)];f=null!=l?"data:page/id,"+l:null}else if("data:action/json,"==f.substring(0,17))try{var n=JSON.parse(f.substring(17));if(null!=n.actions){for(var r=0;r<n.actions.length;r++){var t=n.actions[r];if(null!=t.open&&Graph.isPageLink(t.open)){var x=t.open.substring(t.open.indexOf(",")+1);l=c[x];null!=l?t.open="data:page/id,"+l:null==this.getPageById(x)&&delete t.open}}f=-"data:action/json,"+JSON.stringify(n)}}catch(B){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,l,n,r){var t=mxUtils.bind(this,function(x){this.loadingExtensions=!1;null!=l?l(x):this.handleError(x)});this.createTimeout(null,mxUtils.bind(this,function(x){n=null!=n?n:c.name;var B=mxUtils.bind(this,function(L){x.clear()&&t(L)}),F=mxUtils.bind(this,function(){this.loadingExtensions=-!1;if(this.doImportVisio){var L=this.isRemoteVisioFormat(n);try{var D=n.lastIndexOf(".");if(0<=D&&D<n.length)n.substring(D+1).toUpperCase();else{var T=n.lastIndexOf("/");0<=T&&T<n.length&&(n=n.substring(T+1))}}catch(R){}if(L)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(n)?B({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):B({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{L=new FormData;-L.append("file1",c,n);var N=new XMLHttpRequest;N.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(n)?"?stencil=1":""));N.responseType="blob";this.addRemoteServiceSecurityCheck(N);null!=r&&N.setRequestHeader("x-convert-custom",r);N.onreadystatechange=mxUtils.bind(this,function(){if(4==N.readyState&&x.clear())if(200<=N.status&&299>=N.status)try{var R=N.response;if("text/xml"==R.type){var P=new FileReader;P.onload=mxUtils.bind(this,function(U){try{f(U.target.result)}catch(S){B({message:mxResources.get("errorLoadingFile")})}});-P.readAsText(R)}else this.doImportVisio(R,f,B,n)}catch(U){B(U)}else try{""==N.responseType||"text"==N.responseType?B({message:N.responseText}):(P=new FileReader,P.onload=function(){try{B({message:JSON.parse(P.result).Message})}catch(U){null!=P.result&&0<P.result.length?B({message:P.result}):B(U)}},P.readAsText(N.response))}catch(U){B({})}});N.send(L)}else if(x.clear())try{this.doImportVisio(c,f,B,n)}catch(R){B(R)}}else B({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||-this.loadingExtensions||this.isOffline(!0)?F():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",F,null,null,null,B))}),t)};EditorUi.prototype.importGraphML=function(c,f,l){var n=mxUtils.bind(this,function(r){this.loadingExtensions=!1;null!=l?l(r):this.handleError(r)});this.createTimeout(null,mxUtils.bind(this,function(r){var t=mxUtils.bind(this,function(B){r.clear()&&n(B)}),x=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(r.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,+n}return c};EditorUi.prototype.getSvgFileProperties=function(c){var f=this.getPngFileProperties(c);f.embedFonts=null!=c&&c.hasAttribute("embedFonts")?"false"!=c.getAttribute("embedFonts"):Editor.embedSvgFonts;return f};EditorUi.prototype.getPngFileProperties=function(c){var f=1,l=0;if(null!=c){if(c.hasAttribute("scale")){var n=parseFloat(c.getAttribute("scale"));!isNaN(n)&&0<n&&(f=n)}c.hasAttribute("border")&&(n=parseInt(c.getAttribute("border")),!isNaN(n)&&0<n&&(l=n))}return{scale:f,border:l}};EditorUi.prototype.getEmbeddedPng=+function(c,f,l,n,r){try{var t=this.editor.graph,x=null;if(null!=l&&0<l.length)t=this.createTemporaryGraph(t.getStylesheet()),document.body.appendChild(t.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(l).documentElement,!0),t),x=l;else if(null!=this.pages&&this.currentPage!=this.pages[0]){t=this.createTemporaryGraph(t.getStylesheet());var B=t.getGlobalVariable;t.setBackgroundImage=this.editor.graph.setBackgroundImage;var G=this.pages[0];this.currentPage==G?t.setBackgroundImage(this.editor.graph.backgroundImage):+null!=G.viewState&&null!=G.viewState&&t.setBackgroundImage(G.viewState.backgroundImage);t.getGlobalVariable=function(L){return"page"==L?G.getName():"pagenumber"==L?1:B.apply(this,arguments)};document.body.appendChild(t.container);t.model.setRoot(G.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(L){try{null==x&&(x=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var D=L.toDataURL("image/png");D=Editor.writeGraphModelToPng(D,"tEXt","mxfile",encodeURIComponent(x));c(D.substring(D.lastIndexOf(",")++1));t!=this.editor.graph&&t.container.parentNode.removeChild(t.container)}catch(T){null!=f&&f(T)}}),null,null,null,mxUtils.bind(this,function(L){null!=f&&f(L)}),null,null,n,null,t.shadowVisible,null,t,r,null,null,null,"diagram",null)}catch(L){null!=f&&f(L)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,l,n,r,t,x,B,G,L,D,T,N,R,P){B=null!=B?B:!0;D=null!=D?D:0;x=null!=G?G:f.background;x==mxConstants.NONE&&(x=null);null==x&&"none"==f.getAdaptiveColors()&&(x="#ffffff");G=this.editor.graph.createSvgImageExport(null!=+c,R);var U=Graph.addFont,S=null;if(null==r){S={};Graph.addFont=function(C,E,I,O){U.call(this,C,E,I,S)};var z=G.drawCellState;G.drawCellState=function(C,E){null!=C&&Graph.processFontStyle(C.style);z.apply(this,arguments)}}R=null;try{R=f.getSvg(x,L,D,null,null,t,null,G,null,f.shadowVisible||T,null,N,"diagram")}finally{Graph.addFont=U}(f.shadowVisible||T)&&f.addSvgShadow(R,null,null,0==D);null!=c&&R.setAttribute("content",c);null!=l&&R.setAttribute("resource",l);var g=mxUtils.bind(this,function(C){C=+(n?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(C);null!=r&&r(C);return C});f.mathEnabled&&this.editor.addMathCss(R);if(null!=r)this.embedFonts(R,mxUtils.bind(this,function(C){B?this.editor.convertImages(C,mxUtils.bind(this,function(E){g(E)})):g(C)}),P);else{c=Graph.customFontElements;Graph.customFontElements=S;try{var p=!1;this.embedFonts(R,function(){p=!0},P);if(!p)try{null==this.editor.resolvedFontCss&&this.editor.addFontCss(R);var v=this.editor.graph.getExtFontCss();+0<v.length&&this.editor.addFontCss(R,v)}catch(C){}}finally{Graph.customFontElements=c}return g(R)}};EditorUi.prototype.embedFonts=function(c,f,l){if(l=null!=l?l:Editor.embedSvgFonts)this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(r){try{null!=r&&this.editor.addFontCss(c,r),f(c)}catch(t){f(c)}}))}catch(r){f(c)}}));else{try{this.editor.addFontCss(c);var n=+this.editor.graph.getExtFontCss();0<n.length&&this.editor.addFontCss(c,n)}catch(r){}f(c)}};EditorUi.prototype.exportImage=function(c,f,l,n,r,t,x,B,G,L,D,T,N){G=null!=G?G:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(P){Editor.addRetryToError(P,mxUtils.bind(this,function(){this.exportImage(c,f,l,n,r,t,x,B,G,L,D,T,N)}));this.handleError(P)}))){var R=this.editor.graph.isSelectionEmpty();l=null!=l?l:R;null==this.thumbImageCache&&(this.thumbImageCache=+{});try{this.editor.exportToCanvas(mxUtils.bind(this,function(P){this.spinner.stop();try{this.saveCanvas(P,r?this.getFileData(!0,null,null,null,l,B,null,null,null,null,null,c,t):null,G,null==this.pages||0==this.pages.length,D)}catch(U){this.handleError(U)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(P){this.spinner.stop();this.handleError(P)}),null,l,c||1,f,n,null,null,t,x,L,T,N)}catch(P){this.spinner.stop(),this.handleError(P)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};+EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,l,n,r,t,x){EditorUi.debug("EditorUi.importXml",[this],"xml",[c],"dx",[f],"dy",[l],"crop",[n],"noErrorHandling",[r],"addNewPage",[t],"applyDefaultStyles",[x]);f=null!=f?f:0;l=null!=l?l:0;var B=[];try{if(null!=c&&0<c.length){var G=null!=this.pages?this.pages.length:0,L=this.isDiagramEmpty(),+D=this.currentPage,T=this.editor.graph;T.model.beginUpdate();try{var N=mxUtils.parseXml(c);c={};var R=this.editor.extractGraphModel(N.documentElement,null!=this.pages);if(null!=R&&"mxfile"==R.nodeName&&null!=this.pages){var P=R.getElementsByTagName("diagram");if(0<P.length){N=[];var U=0;if(1==P.length&&!t){if(null!=this.currentPage&&(c[P[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var S=P[0].getAttribute("name");null!=S&&""!=S&&this.editor.graph.model.execute(new RenamePage(this,+this.currentPage,S))}R=Editor.parseDiagramNode(P[0]);n=!1;U=1}for(;U<P.length;U++){var z=P[U].getAttribute("id");P[U].removeAttribute("id");var g=this.updatePageRoot(new DiagramPage(P[U]));c[z]=P[U].getAttribute("id");var p=this.pages.length;null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[p+1]));T.model.execute(new ChangePage(this,g,g,p,0<U));N.push(g)}this.updatePageLinks(c,N)}}if(null!=R&&"mxGraphModel"===R.nodeName){B=T.importGraphModel(R,f,l,n);if(null!=B)for(this.addLocalPagesToMapping(c),+U=0;U<B.length;U++)this.updatePageLinksForCell(c,B[U]);var v=T.parseBackgroundImage(R.getAttribute("backgroundImage"));if(null!=v&&null!=v.originalSrc&&this.updateBackgroundPageLink(c,v)){var C=new ChangePageSetup(this,null,v);C.ignoreColor=!0;T.model.execute(C)}}x&&T.pasteCellStyles(T.includeDescendants(B),T.defaultVertexStyle,T.defaultEdgeStyle);!t&&D!=this.currentPage&&null!=this.pages&&1<this.pages.length&&L&&1==G&&this.removePage(D)}finally{T.model.endUpdate()}}}catch(E){if(r)throw E;this.handleError(E)}return B};+EditorUi.prototype.updatePageLinks=function(c,f){for(var l=0;l<f.length;l++)this.updatePageLinksForCell(c,f[l].root),f[l]!=this.currentPage&&(f[l].needsUpdate=!0),null!=f[l].viewState&&this.updateBackgroundPageLink(c,f[l].viewState.backgroundImage)&&(f[l]==this.currentPage&&this.editor.graph.setViewState(f[l].viewState,!0),f[l].needsUpdate=!0)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){var l=!1;try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var n=c[f.originalSrc.substring(f.originalSrc.indexOf(",")++1)];null!=n&&(f.originalSrc="data:page/id,"+n,l=!0)}}catch(r){}return l};EditorUi.prototype.updatePageLinksForCell=function(c,f){var l=document.createElement("div"),n=this.editor.graph,r=n.getLinkForCell(f);null!=r&&n.setLinkForCell(f,this.updatePageLink(c,r));if(n.isHtmlLabel(f)){l.innerHTML=Graph.sanitizeHtml(n.getLabel(f));for(var t=l.getElementsByTagName("a"),x=!1,B=0;B<t.length;B++)r=t[B].getAttribute("href"),null!=r&&(t[B].setAttribute("href",this.updatePageLink(c,r)),x=!0);x&&n.labelChanged(f,+l.innerHTML)}for(B=0;B<n.model.getChildCount(f);B++)this.updatePageLinksForCell(c,n.model.getChildAt(f,B))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var l=c[f.substring(f.indexOf(",")+1)];f=null!=l?"data:page/id,"+l:null}else if("data:action/json,"==f.substring(0,17))try{var n=JSON.parse(f.substring(17));if(null!=n.actions){for(var r=0;r<n.actions.length;r++){var t=n.actions[r];if(null!=t.open&&Graph.isPageLink(t.open)){var x=t.open.substring(t.open.indexOf(",")+1);+l=c[x];null!=l?t.open="data:page/id,"+l:null==this.getPageById(x)&&delete t.open}}f="data:action/json,"+JSON.stringify(n)}}catch(B){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,l,n,r){var t=mxUtils.bind(this,function(x){this.loadingExtensions=!1;null!=l?l(x):this.handleError(x)});this.createTimeout(null,mxUtils.bind(this,function(x){n=null!=n?n:c.name;var B=mxUtils.bind(this,+function(L){x.clear()&&t(L)}),G=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var L=this.isRemoteVisioFormat(n);try{var D=n.lastIndexOf(".");if(0<=D&&D<n.length)n.substring(D+1).toUpperCase();else{var T=n.lastIndexOf("/");0<=T&&T<n.length&&(n=n.substring(T+1))}}catch(R){}if(L)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(n)?B({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):B({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):+mxResources.get("serviceUnavailableOrBlocked")});else{L=new FormData;L.append("file1",c,n);var N=new XMLHttpRequest;N.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(n)?"?stencil=1":""));N.responseType="blob";this.addRemoteServiceSecurityCheck(N);null!=r&&N.setRequestHeader("x-convert-custom",r);N.onreadystatechange=mxUtils.bind(this,function(){if(4==N.readyState&&x.clear())if(200<=N.status&&299>=N.status)try{var R=N.response;if("text/xml"==R.type){var P=new FileReader;P.onload=mxUtils.bind(this,+function(U){try{f(U.target.result)}catch(S){B({message:mxResources.get("errorLoadingFile")})}});P.readAsText(R)}else this.doImportVisio(R,f,B,n)}catch(U){B(U)}else try{""==N.responseType||"text"==N.responseType?B({message:N.responseText}):(P=new FileReader,P.onload=function(){try{B({message:JSON.parse(P.result).Message})}catch(U){null!=P.result&&0<P.result.length?B({message:P.result}):B(U)}},P.readAsText(N.response))}catch(U){B({})}});N.send(L)}else if(x.clear())try{this.doImportVisio(c,f,B,n)}catch(R){B(R)}}else B({message:mxResources.get("serviceUnavailableOrBlocked")})});+this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?G():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",G,null,null,null,B))}),t)};EditorUi.prototype.importGraphML=function(c,f,l){var n=mxUtils.bind(this,function(r){this.loadingExtensions=!1;null!=l?l(r):this.handleError(r)});this.createTimeout(null,mxUtils.bind(this,function(r){var t=mxUtils.bind(this,function(B){r.clear()&&n(B)}),x=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(r.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,n)}catch(B){t(B)}else t({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?x():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",x,null,null,null,t))}),n)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(l){this.loadingExtensions=!1;this.handleError(l)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(l){var n=mxUtils.bind(this,function(t){l.clear()&&f(t)}),r=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(l.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||n({message:mxResources.get("unknownError")})}catch(t){n(t)}else n({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(r,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",r,null,null,null,n))}),f):f({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,f,l){var n=mxUtils.bind(this,function(r){this.loadingExtensions=!1;null!=l?l(r):this.handleError(r)});this.createTimeout(null,mxUtils.bind(this,function(r){var t=mxUtils.bind(this,function(B){r.clear()&&n(B)}),x=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(r.clear())if("undefined"!==typeof window.LucidImporter)try{var B=-JSON.parse(c);f(LucidImporter.importState(B));try{if(null!=window.console&&"1"==urlParams.test){var F=[(new Date).toISOString(),"convertLucidChart",B];null!=B.state&&F.push(JSON.parse(B.state));if(null!=B.svgThumbs)for(var L=0;L<B.svgThumbs.length;L++)F.push(Editor.createSvgDataUri(B.svgThumbs[L]));null!=B.thumb&&F.push(B.thumb);console.log.apply(console,F)}}catch(D){}}catch(D){null!=window.console&&console.error(D),t(D)}else t({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==+JSON.parse(c);f(LucidImporter.importState(B));try{if(null!=window.console&&"1"==urlParams.test){var G=[(new Date).toISOString(),"convertLucidChart",B];null!=B.state&&G.push(JSON.parse(B.state));if(null!=B.svgThumbs)for(var L=0;L<B.svgThumbs.length;L++)G.push(Editor.createSvgDataUri(B.svgThumbs[L]));null!=B.thumb&&G.push(B.thumb);console.log.apply(console,G)}}catch(D){}}catch(D){null!=window.console&&console.error(D),t(D)}else t({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(x,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",x,null,null,null,t)},null,null,null,t)},null,null,null,t)},null,null,null,t)},null,null,null,t):mxscript(window.DRAWIO_SERVER_URL+-"js/extensions.min.js",x,null,null,null,t))}),n)};EditorUi.prototype.replaceLockedGroupChildren=function(c,f,l,n,r){var t=null!=r&&null!=r.dataAttr?r.dataAttr:"mermaidData",x=null!=r&&null!=r.attrPrefix?r.attrPrefix:"mermaid",B=this.editor.graph;r=mxUtils.parseXml((null!=r&&null!=r.wrapGroup?r.wrapGroup:mxMermaidToDrawio.wrapGroup)(f,l,n));var F=new mxCodec(r);f=new mxGraphModel;F.decode(r.documentElement,f);F=f.getRoot();var L=null;for(r=0;null!=F&&r<f.getChildCount(F)&&null==L;r++)for(var D=f.getChildAt(F,-r),T=0;T<f.getChildCount(D);T++){var N=f.getChildAt(D,T),R=N.value;if(null!=R&&"object"===typeof R&&null!=R.getAttribute&&null!=R.getAttribute(t)){L=N;break}}if(null!=L){F=[];for(r=0;r<f.getChildCount(L);r++)F.push(f.getChildAt(L,r));0==F.length&&(F=[L]);L=f.getGeometry(L);D=R=Infinity;N=B.model.getChildCount(c);for(r=0;r<N;r++){var P=B.model.getChildAt(c,r);B.model.isVertex(P)&&(P=P.getGeometry(),null!=P&&(R=Math.min(R,P.x),D=Math.min(D,P.y)))}var U=Infinity;P=Infinity;for(r=0;r<F.length;r++)f.isVertex(F[r])&&-(N=F[r].getGeometry(),null!=N&&(U=Math.min(U,N.x),P=Math.min(P,N.y)));R=isFinite(R)&&isFinite(U)?R-U:0;D=isFinite(D)&&isFinite(P)?D-P:0;if(0!=R||0!=D)for(r=0;r<F.length;r++)if(P=F[r],N=P.getGeometry(),null!=N){N=N.clone();if(f.isVertex(P))N.x+=R,N.y+=D;else if(f.isEdge(P)){if(null!=N.points)for(U=0;U<N.points.length;U++)null!=N.points[U]&&(N.points[U].x+=R,N.points[U].y+=D);null!=N.sourcePoint&&(N.sourcePoint.x+=R,N.sourcePoint.y+=D);null!=N.targetPoint&&(N.targetPoint.x+=R,N.targetPoint.y+=D)}f.setGeometry(P,-N)}f=this.snapshotMermaidIdentity(c,x);F=B.cloneCells(F,!0);B.getModel().beginUpdate();try{for(T=B.model.getChildCount(c)-1;0<=T;T--)B.model.remove(B.model.getChildAt(c,T));for(r=0;r<F.length;r++)this.applyMermaidUserCustomizations(F[r],f,x),B.model.add(c,F[r]);if(null!=L){var S=B.model.getGeometry(c);null!=S&&(S=S.clone(),S.width=L.width,S.height=L.height,B.model.setGeometry(c,S))}B.setAttributeForCell(c,t,JSON.stringify({data:l,config:n},null,2))}finally{B.getModel().endUpdate()}}};EditorUi.prototype.snapshotMermaidIdentity=-function(c,f){f=null!=f?f:"mermaid";for(var l=this.editor.graph,n={},r=l.model.getChildCount(c),t=0;t<r;t++){var x=l.model.getChildAt(c,t),B=x.value;if(null!=B&&"object"===typeof B&&null!=B.getAttribute){var F=B.getAttribute(f+"Id");F&&(n[F]={currentStyle:x.style||"",currentLabel:B.getAttribute("label")||"",baseStyle:B.getAttribute(f+"BaseStyle")||"",baseValue:B.getAttribute(f+"BaseValue")||""})}}return n};EditorUi.prototype.applyMermaidUserCustomizations=function(c,f,l){var n=c.value;null!=n&&"object"===+"js/extensions.min.js",x,null,null,null,t))}),n)};EditorUi.prototype.replaceLockedGroupChildren=function(c,f,l,n,r){var t=null!=r&&null!=r.dataAttr?r.dataAttr:"mermaidData",x=null!=r&&null!=r.attrPrefix?r.attrPrefix:"mermaid",B=this.editor.graph;r=mxUtils.parseXml((null!=r&&null!=r.wrapGroup?r.wrapGroup:mxMermaidToDrawio.wrapGroup)(f,l,n));var G=new mxCodec(r);f=new mxGraphModel;G.decode(r.documentElement,f);G=f.getRoot();var L=null;for(r=0;null!=G&&r<f.getChildCount(G)&&null==L;r++)for(var D=f.getChildAt(G,+r),T=0;T<f.getChildCount(D);T++){var N=f.getChildAt(D,T),R=N.value;if(null!=R&&"object"===typeof R&&null!=R.getAttribute&&null!=R.getAttribute(t)){L=N;break}}if(null!=L){G=[];for(r=0;r<f.getChildCount(L);r++)G.push(f.getChildAt(L,r));0==G.length&&(G=[L]);L=f.getGeometry(L);D=R=Infinity;N=B.model.getChildCount(c);for(r=0;r<N;r++){var P=B.model.getChildAt(c,r);B.model.isVertex(P)&&(P=P.getGeometry(),null!=P&&(R=Math.min(R,P.x),D=Math.min(D,P.y)))}var U=Infinity;P=Infinity;for(r=0;r<G.length;r++)f.isVertex(G[r])&&+(N=G[r].getGeometry(),null!=N&&(U=Math.min(U,N.x),P=Math.min(P,N.y)));R=isFinite(R)&&isFinite(U)?R-U:0;D=isFinite(D)&&isFinite(P)?D-P:0;if(0!=R||0!=D)for(r=0;r<G.length;r++)if(P=G[r],N=P.getGeometry(),null!=N){N=N.clone();if(f.isVertex(P))N.x+=R,N.y+=D;else if(f.isEdge(P)){if(null!=N.points)for(U=0;U<N.points.length;U++)null!=N.points[U]&&(N.points[U].x+=R,N.points[U].y+=D);null!=N.sourcePoint&&(N.sourcePoint.x+=R,N.sourcePoint.y+=D);null!=N.targetPoint&&(N.targetPoint.x+=R,N.targetPoint.y+=D)}f.setGeometry(P,+N)}f=this.snapshotMermaidIdentity(c,x);G=B.cloneCells(G,!0);B.getModel().beginUpdate();try{for(T=B.model.getChildCount(c)-1;0<=T;T--)B.model.remove(B.model.getChildAt(c,T));for(r=0;r<G.length;r++)this.applyMermaidUserCustomizations(G[r],f,x),B.model.add(c,G[r]);if(null!=L){var S=B.model.getGeometry(c);null!=S&&(S=S.clone(),S.width=L.width,S.height=L.height,B.model.setGeometry(c,S))}B.setAttributeForCell(c,t,JSON.stringify({data:l,config:n},null,2))}finally{B.getModel().endUpdate()}}};EditorUi.prototype.snapshotMermaidIdentity=+function(c,f){f=null!=f?f:"mermaid";for(var l=this.editor.graph,n={},r=l.model.getChildCount(c),t=0;t<r;t++){var x=l.model.getChildAt(c,t),B=x.value;if(null!=B&&"object"===typeof B&&null!=B.getAttribute){var G=B.getAttribute(f+"Id");G&&(n[G]={currentStyle:x.style||"",currentLabel:B.getAttribute("label")||"",baseStyle:B.getAttribute(f+"BaseStyle")||"",baseValue:B.getAttribute(f+"BaseValue")||""})}}return n};EditorUi.prototype.applyMermaidUserCustomizations=function(c,f,l){var n=c.value;null!=n&&"object"===typeof n&&null!=n.getAttribute&&(l=n.getAttribute((null!=l?l:"mermaid")+"Id"))&&(f=f[l],null!=f&&(c.style=this.mergeMermaidStyleDelta(f.baseStyle,f.currentStyle,c.style||"",c.isEdge()),f.currentLabel!==f.baseValue&&n.setAttribute("label",f.currentLabel)))};EditorUi.prototype.mergeMermaidStyleDelta=function(c,f,l,n){function r(D){var T={},N=[];if(!D)return{map:T,keys:N};D=D.split(";");for(var R=0;R<D.length;R++){var P=D[R];if(P){var U=P.indexOf("=");if(0<U){var S=P.substring(0,U);S in T||N.push(S);-T[S]=P.substring(U+1)}else P in T||N.push(P),T[P]=!0}}return{map:T,keys:N}}c=r(c);f=r(f);var t=r(l),x={exitX:1,exitY:1,exitDx:1,exitDy:1,entryX:1,entryY:1,entryDx:1,entryDy:1,edgeStyle:1,noEdgeStyle:1,orthogonal:1},B=n?{startArrow:1,endArrow:1,startFill:1,endFill:1,startSize:1,endSize:1}:{};n={};l=[];for(var F=0;F<t.keys.length;F++){var L=t.keys[F];n[L]=t.map[L];l.push(L)}for(F=0;F<f.keys.length;F++)L=f.keys[F],x[L]||B[L]||f.map[L]===c.map[L]||(L in n||l.push(L),n[L]=f.map[L]);for(F=0;F<c.keys.length;F++)L=-c.keys[F],x[L]||B[L]||L in f.map||delete n[L];c=[];for(F=0;F<l.length;F++)L=l[F],f=n[L],void 0!==f&&(!0===f?c.push(L):c.push(L+"="+f));return 0<c.length?c.join(";")+";":""};EditorUi.prototype.getSvgForXml=function(c,f,l){var n=null,r=this.createTemporaryGraph(this.editor.graph.getStylesheet());try{document.body.appendChild(r.container),(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,r.getModel()),n=r.getSvg(null,null,f,null,null,null,null,null,null,null,null,l,null,null,-!0,!0)}finally{document.body.removeChild(r.container)}return n};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,l,n){var r=0,t=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(x){var B="";if(null!=this.drive&&null!=this.drive.getUser()){var F=this.drive.getUser();null!=F.email&&0<F.email.indexOf("@")&&(B=F.email.substring(F.email.indexOf("@")+1))}var L={prompt:c,driveDomain:B,options:null!=n?n:{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",+T[S]=P.substring(U+1)}else P in T||N.push(P),T[P]=!0}}return{map:T,keys:N}}c=r(c);f=r(f);var t=r(l),x={exitX:1,exitY:1,exitDx:1,exitDy:1,entryX:1,entryY:1,entryDx:1,entryDy:1,edgeStyle:1,noEdgeStyle:1,orthogonal:1},B=n?{startArrow:1,endArrow:1,startFill:1,endFill:1,startSize:1,endSize:1}:{};n={};l=[];for(var G=0;G<t.keys.length;G++){var L=t.keys[G];n[L]=t.map[L];l.push(L)}for(G=0;G<f.keys.length;G++)L=f.keys[G],x[L]||B[L]||f.map[L]===c.map[L]||(L in n||l.push(L),n[L]=f.map[L]);for(G=0;G<c.keys.length;G++)L=+c.keys[G],x[L]||B[L]||L in f.map||delete n[L];c=[];for(G=0;G<l.length;G++)L=l[G],f=n[L],void 0!==f&&(!0===f?c.push(L):c.push(L+"="+f));return 0<c.length?c.join(";")+";":""};EditorUi.prototype.getSvgForXml=function(c,f,l){var n=null,r=this.createTemporaryGraph(this.editor.graph.getStylesheet());try{document.body.appendChild(r.container),(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,r.getModel()),n=r.getSvg(null,null,f,null,null,null,null,null,null,null,null,l,null,null,+!0,!0)}finally{document.body.removeChild(r.container)}return n};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,l,n){var r=0,t=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(x){var B="";if(null!=this.drive&&null!=this.drive.getUser()){var G=this.drive.getUser();null!=G.email&&0<G.email.indexOf("@")&&(B=G.email.substring(G.email.indexOf("@")+1))}var L={prompt:c,driveDomain:B,options:null!=n?n:{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[L],"url",["https://www.draw.io/generate/v3"]);var D=Date.now();B=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(L),"POST");var T=mxUtils.bind(this,function(R){x.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[L],"error",[R],"time",Date.now()-D+" ms"),l(R))}),N=mxUtils.bind(this,function(R){3>r++?x.clear()&&t():T(R)});B.send(mxUtils.bind(this,function(R){if(x.isAlive())if(200<=R.getStatus()&&299>=R.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var U=R.getText();try{U=JSON.parse(U),result=U.result}catch(z){result=U}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[L],"response",[U],"time",Date.now()-D+" ms");U=Editor.extractGraphModelFromText(result);if(null!=U&&""!=U[1])x.clear()&&f(U[1]);else if("<"==mxUtils.trim(result).charAt(0))x.clear()&&f(result);else{var S=this.extractMermaidDeclaration(result)||result;this.parseMermaidDiagram(S,null,mxUtils.bind(this,function(z){this.tryAndHandle(mxUtils.bind(this,function(){x.clear()&&f(mxMermaidToDrawio.wrapGroup(z,S,null))}),T)}),T,N)}}),T,!0);else{var P={message:mxResources.get("error")+" "+R.getStatus()};try{P=JSON.parse(R.getText()),null!=P.error&&(P.message=P.error)}catch(U){}T(P)}}),T)}),l)});t()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("(Begins)");for(var l=mxUtils.trim(1>=f.length?c:f[1]),n=l.split("\n"),r=0;r<n.length&&("mermaid"==n[r]||0==n[r].trim().length||"%%"==n[r].substring(0,2));)r++;l=[];for(var t=r;t<n.length;t++){var x=mxUtils.trim(n[t]);if("%%"!=x.substring(0,2)&&"classDef "!=x.substring(0,9))l.push(n[t]);else if("mermaid"==x)break}n=l;l=mxUtils.trim(n.join("\n"));t="undefined"!==typeof MermaidParser?MermaidParser.detectType(l):null;EditorUi.debug("EditorUi.extractMermaidDeclaration","value",[c],"text",[l],"typeInfo",[t],"startLine",r,"lines",n,"tokens",f);return null!=t?l:null};EditorUi.prototype.getMermaidDiagramType=function(c){var f=null!=c?c.split("\n"):[],l=0;c=function(){for(;l<f.length&&(0==f[l].trim().length||"%%"==f[l].substring(0,2));)l++};c();if(l<f.length&&"---"==f[l].trim()){do l++;while(l<f.length&&"---"!=f[l].trim());l++;c()}if(l>=f.length)return"";c=f[l].trim().toLowerCase();var n=c.indexOf(" ");return c.substring(0,0<n?n:c.length)};EditorUi.prototype.isMermaidElkFlowchart=function(c){return null!=c&&(/defaultRenderer["']?\s*:\s*["']?elk/i.test(c)||/(?:^|\n)\s*layout\s*:\s*["']?elk\b/i.test(c))&&/(?:flowchart|graph)\b/i.test(c)};EditorUi.prototype.applyMermaidElkPostPass=function(c,f,l){if("undefined"===typeof ElkLayout||"undefined"===typeof Graph)l(c);else{f=f.match(/(?:flowchart|graph)\s+(LR|RL|TB|TD|BT)/i);var n={LR:"RIGHT",RL:"LEFT",TB:"DOWN",TD:"DOWN",BT:"UP"};f=f?n[f[1].toUpperCase()]||"DOWN":"DOWN";var r=document.createElement("div");r.style.cssText="position:absolute;left:-99999px;top:-99999px;width:1200px;height:800px;visibility:hidden;";-document.body.appendChild(r);var t=null,x=!1,B=function(L){if(!x){x=!0;try{null!=t&&t.destroy()}catch(D){}r.remove();l(L)}};try{t=new Graph(r);t.foldingEnabled=!1;t.setEnabled(!1);t.setHtmlLabels(!0);var F=mxUtils.parseXml(c);(new mxCodec(F)).decode(F.documentElement,t.getModel());(new ElkLayout(t,"layered",{"elk.direction":f,"elk.layered.cycleBreaking.strategy":"GREEDY"},Object.assign({mermaidPolicy:!0},ElkLayout.CANONICAL_EDGE))).execute(t.getDefaultParent(),function(L){var D=null;if(!L)try{var T=+document.body.appendChild(r);var t=null,x=!1,B=function(L){if(!x){x=!0;try{null!=t&&t.destroy()}catch(D){}r.remove();l(L)}};try{t=new Graph(r);t.foldingEnabled=!1;t.setEnabled(!1);t.setHtmlLabels(!0);var G=mxUtils.parseXml(c);(new mxCodec(G)).decode(G.documentElement,t.getModel());(new ElkLayout(t,"layered",{"elk.direction":f,"elk.layered.cycleBreaking.strategy":"GREEDY"},Object.assign({mermaidPolicy:!0},ElkLayout.CANONICAL_EDGE))).execute(t.getDefaultParent(),function(L){var D=null;if(!L)try{var T=new mxCodec;D=mxUtils.getXml(T.encode(t.getModel()))}catch(N){}B(null!=D?D:c)})}catch(L){if(x)throw L;B(c)}}};EditorUi.prototype.parseMermaidDiagram=function(c,f,l,n,r){var t=mxUtils.bind(this,function(B){null!=r?r(B):null!=n?n(B):this.handleError(B)});if(EditorUi.isMermaidSupported())try{var x=mxMermaidToDrawio.parseText(c,this.getMermaidConfig(c,f));null!=x?this.isMermaidElkFlowchart(c)?this.applyMermaidElkPostPass(x,c,l):l(x):t(Error("Unsupported diagram type: "+this.getMermaidDiagramType(c)))}catch(B){t(B)}else t(Error("Mermaid parser not available"))};EditorUi.prototype.loadMermaid=function(c,f){var l=mxUtils.bind(this,function(r){this.loadingMermaid=!1;f(r)}),n=mxUtils.bind(this,function(){try{this.loadingMermaid=!1,c()}catch(r){l(r)}});"undefined"!==typeof mxMermaidToDrawio||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(n,0):(this.loadingMermaid=!0,"undefined"!==typeof urlParams&&"1"==urlParams.dev||window.location.search&&0<=window.location.search.indexOf("dev=1")?mxscript("js/elk/drawio-elk.min.js",function(){mxscript("js/mermaid/drawio-mermaid.min.js",n,null,null,null,l)},null,null,null,l):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",n,null,null,null,l))};EditorUi.prototype.loadPlantUml=function(c,f){var l=mxUtils.bind(this,function(t){this.loadingPlantUml=!1;f(t)}),n=mxUtils.bind(this,function(){try{this.loadingPlantUml=!1,c()}catch(t){l(t)}});if("undefined"!==typeof mxPlantUmlToDrawio||this.loadingPlantUml)window.setTimeout(n,0);else{this.loadingPlantUml=!0;var r="undefined"!==typeof urlParams&&"1"==urlParams.dev||window.location.search&&@@ -14025,23 +14029,23 @@ r.border+";image="+r.data+";");l.setAttributeForCell(r,null!=t?t:"mermaidData",Jfunction(c){var f=this.editor.graph,l=f.getAttributeForCell(c,"plantUmlData"),n=null!=l?"plantUmlData":"mermaidData";l=null!=l?l:f.getAttributeForCell(c,"mermaidData");var r=null;if(null!=l)try{r=JSON.parse(l)}catch(B){}if(null!=r&&null!=r.data&&null==r.format){var t=this.getMermaidImageBorder(c,r.border);l=function(){};var x=mxUtils.bind(this,function(B){if(f.model.contains(c)&&this.getMermaidImageBorder(c,r.border)==t){f.model.beginUpdate();try{this.updateMermaidImage(c,r.data,null,B,t,n)}finally{f.model.endUpdate()}}});"plantUmlData"==n?this.parsePlantUmlDiagram(r.data,null,x,l):this.parseMermaidDiagram(r.data,mxUtils.clone(EditorUi.legacyMermaidConfig),x,l)}};EditorUi.prototype.replaceMermaidCell=function(c,f){var l=this.editor.graph,n=l.getBoundingBoxFromGeometry([c]),r=null!=n?n.x:0;n=null!=n?n.y:0;for(var t=l.model.getParent(c);null!=t&&l.model.isVertex(t);){var x=l.model.getGeometry(t);null!=x&&(r+=x.x,n+=x.y);t=l.model.getParent(t)}l.getModel().beginUpdate();try{var B=this.importXml(f,r,n,!0,null,null,!0);l.model.remove(c);l.setSelectionCells(B)}finally{l.getModel().endUpdate()}l.scrollCellToVisible(l.getSelectionCell());return B};EditorUi.prototype.insertAsPreText=function(c,f,l){var n=this.editor.graph,r=null;n.getModel().beginUpdate();try{r=n.insertVertex(null,null,"<pre>"+c+"</pre>",f,l,1,1,"text;html=1;align=left;verticalAlign=top;"),n.updateCellSize(r,!0)}finally{n.getModel().endUpdate()}return r};EditorUi.prototype.insertTextAt=function(c,f,l,n,r,t,x,B){t=null!=t?t:!0;x=null!=x?x:!0;if(null!=-c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(N){4==N.readyState&&200<=N.status&&299>=N.status&&this.editor.graph.setSelectionCells(this.insertTextAt(N.responseText,f,l,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(r||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var F=this.editor.graph;if("data:application/pdf;base64,"==+c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(N){4==N.readyState&&200<=N.status&&299>=N.status&&this.editor.graph.setSelectionCells(this.insertTextAt(N.responseText,f,l,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(r||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var G=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var L=Editor.extractGraphModelFromPdf(c);if(null!=L&&0<L.length)return this.importXml(L,f,l,t,!0,B)}if(Editor.isPngDataUrl(c)&&(L=Editor.extractGraphModelFromPng(c),null!=L&&0<L.length))return this.importXml(L,f,l,t,!0,B);if("data:image/svg+xml;"==c.substring(0,19))try{L=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(L=c.substring(c.indexOf(",")+1),L=window.atob&&!mxClient.IS_SF?atob(L):Base64.decode(L,!0)):L=decodeURIComponent(c.substring(c.indexOf(",")+1));var D=this.importXml(L,-f,l,t,!0,B);if(0<D.length)return D}catch(N){}this.loadImage(c,mxUtils.bind(this,function(N){if("data:"==c.substring(0,5))this.resizeImage(N,Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(U,S,z){F.setSelectionCell(F.insertVertex(null,null,"",F.snap(f),F.snap(l),S,z,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(U)+";"))}),x,this.maxImageSize);else{var R=Math.min(1,Math.min(this.maxImageSize/-N.width,this.maxImageSize/N.height)),P=Math.round(N.width*R);N=Math.round(N.height*R);F.setSelectionCell(F.insertVertex(null,null,"",F.snap(f),F.snap(l),P,N,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var N=null;F.getModel().beginUpdate();try{N=F.insertVertex(F.getDefaultParent(),null,c,F.snap(f),F.snap(l),1,1,"text;"+(n?"html=1;":"")),F.updateCellSize(N),F.fireEvent(new mxEventObject("textInserted",-"cells",[N]))}finally{F.getModel().endUpdate()}F.setSelectionCell(N)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,f,l,t,null,B);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(N){this.editor.graph.setSelectionCells(this.importXml(N,f,l,t,null,B))}),mxUtils.bind(this,function(N){this.handleError(N)}));else{F=this.editor.graph;r=null;F.getModel().beginUpdate();try{r=F.insertVertex(F.getDefaultParent(),-null,"",F.snap(f),F.snap(l),1,1,"text;whiteSpace=wrap;"+(n?"html=1;":""));F.fireEvent(new mxEventObject("textInserted","cells",[r]));n&&(c=F.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");r.value=c;F.updateCellSize(r);if(0<this.maxTextWidth&&r.geometry.width>this.maxTextWidth){var T=F.getPreferredSizeForCell(r,this.maxTextWidth);r.geometry.width=T.width;r.geometry.height=T.height}Graph.isLink(r.value)&&F.setLinkForCell(r,r.value);r.geometry.width+=F.gridSize;-r.geometry.height+=F.gridSize}finally{F.getModel().endUpdate()}return[r]}}return[]};EditorUi.prototype.formatFileSize=function(c){var f=-1;do c/=1024,f++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[f]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var f=c.indexOf(";");0<f&&(c=c.substring(0,f)+c.substring(c.indexOf(",",f+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,f){return/("contentType":\s*"application\/gliffy\+json")/.test(c)};+f,l,t,!0,B);if(0<D.length)return D}catch(N){}this.loadImage(c,mxUtils.bind(this,function(N){if("data:"==c.substring(0,5))this.resizeImage(N,Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(U,S,z){G.setSelectionCell(G.insertVertex(null,null,"",G.snap(f),G.snap(l),S,z,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(U)+";"))}),x,this.maxImageSize);else{var R=Math.min(1,Math.min(this.maxImageSize/+N.width,this.maxImageSize/N.height)),P=Math.round(N.width*R);N=Math.round(N.height*R);G.setSelectionCell(G.insertVertex(null,null,"",G.snap(f),G.snap(l),P,N,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var N=null;G.getModel().beginUpdate();try{N=G.insertVertex(G.getDefaultParent(),null,c,G.snap(f),G.snap(l),1,1,"text;"+(n?"html=1;":"")),G.updateCellSize(N),G.fireEvent(new mxEventObject("textInserted",+"cells",[N]))}finally{G.getModel().endUpdate()}G.setSelectionCell(N)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,f,l,t,null,B);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(N){this.editor.graph.setSelectionCells(this.importXml(N,f,l,t,null,B))}),mxUtils.bind(this,function(N){this.handleError(N)}));else{G=this.editor.graph;r=null;G.getModel().beginUpdate();try{r=G.insertVertex(G.getDefaultParent(),+null,"",G.snap(f),G.snap(l),1,1,"text;whiteSpace=wrap;"+(n?"html=1;":""));G.fireEvent(new mxEventObject("textInserted","cells",[r]));n&&(c=G.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");r.value=c;G.updateCellSize(r);if(0<this.maxTextWidth&&r.geometry.width>this.maxTextWidth){var T=G.getPreferredSizeForCell(r,this.maxTextWidth);r.geometry.width=T.width;r.geometry.height=T.height}Graph.isLink(r.value)&&G.setLinkForCell(r,r.value);r.geometry.width+=G.gridSize;+r.geometry.height+=G.gridSize}finally{G.getModel().endUpdate()}return[r]}}return[]};EditorUi.prototype.formatFileSize=function(c){var f=-1;do c/=1024,f++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[f]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var f=c.indexOf(";");0<f&&(c=c.substring(0,f)+c.substring(c.indexOf(",",f+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,f){return/("contentType":\s*"application\/gliffy\+json")/.test(c)};EditorUi.prototype.isLucidChartData=function(c){return null!=c&&('{"state":"{\\"Properties\\":'==c.substring(0,26)||'{"Properties":'==c.substring(0,14))};EditorUi.prototype.importLocalFile=function(c,f){if(c&&Graph.fileSupport){if(null==this.importFileInputElt){var l=document.createElement("input");l.setAttribute("type","file");mxEvent.addListener(l,"change",mxUtils.bind(this,function(){null!=l.files&&(this.importFiles(l.files,null,null,this.maxImageSize),l.type="",l.type="file",l.value="")}));l.style.display=-"none";document.body.appendChild(l);this.importFileInputElt=l}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(x,B){StorageFile.listFiles(this,"F",x,B)});window.openBrowserFile=mxUtils.bind(this,function(x,B,F){StorageFile.getFileContent(this,x,B,F)});window.deleteBrowserFile=mxUtils.bind(this,function(x,B,F){StorageFile.deleteFile(this,x,B,F)});if(!f){var n=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=-new OpenFile(mxUtils.bind(this,function(x){this.hideDialog(x)}));window.openFile.setConsumer(mxUtils.bind(this,function(x,B){null!=B&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(B)?(x=new Blob([x],{type:"application/octet-stream"}),this.importVisio(x,mxUtils.bind(this,function(F){this.importXml(F,0,0,!0)}),null,B)):this.editor.graph.setSelectionCells(this.importXml(x,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,-function(){window.openFile=null});if(!f){var r=this.dialog,t=r.close;this.dialog.close=mxUtils.bind(this,function(x){Editor.useLocalStorage=n;t.apply(r,arguments);x&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,f,l){var n=this,r=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(t){if(mxUtils.isEmptyObject(t.files))l();else{var x=0,B,F=!1;t.forEach(function(L,D){L=-D.name.toLowerCase();"diagram/diagram.xml"==L?(F=!0,D.async("string").then(function(T){0==T.indexOf("<mxfile ")?f(T):l()})):0==L.indexOf("versions/")&&(L=parseInt(L.substr(9)),L>x&&(x=L,B=D))});0<x?B.async("string").then(function(L){(new XMLHttpRequest).upload&&n.isRemoteFileFormat(L,c.name)?n.isOffline()?n.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,l):n.parseFileData(L,mxUtils.bind(this,function(D){4==D.readyState&&(200<=D.status&&299>=D.status?f(D.responseText):l())}),-c.name):l()}):F||l()}},function(t){l(t)}):l()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?r():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",r,null,null,null,l))};EditorUi.prototype.importFile=function(c,f,l,n,r,t,x,B,F,L,D,T){L=null!=L?L:!0;var N=!1,R=null,P=mxUtils.bind(this,function(U){var S=null;null!=U&&"<mxlibrary"==U.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,U,x)),this.showSidebar()):S=this.importXml(U,l,n,L,null,-null!=T?mxEvent.isControlDown(T):null);null!=B&&B(S)});"image"==f.substring(0,5)?(F=!1,"image/png"==f.substring(0,9)&&(D=D?null:this.extractGraphModelFromPng(c),null!=D&&0<D.length&&(R=this.importXml(D,l,n,L,null,null!=T?mxEvent.isControlDown(T):null),F=!0)),F||(F=this.editor.graph,D=c.indexOf(";"),0<D&&(c=c.substring(0,D)+c.substring(c.indexOf(",",D+1))),L&&F.isGridEnabled()&&(l=F.snap(l),n=F.snap(n)),D="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;",-"image/svg"==f.substring(0,9)&&(D+="editableCssRules=.*;"),R=[F.insertVertex(null,null,"",l,n,r,t,D+"image="+c+";")])):/(\.*<graphml )/.test(c)?(N=!0,this.importGraphML(c,P)):null!=F&&null!=x&&EditorUi.isVisioFilename(x)?(N=!0,this.importVisio(F,P)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,x)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(N=!0,f=mxUtils.bind(this,function(U){4==U.readyState&&(200<=U.status&&299>=U.status?P(U.responseText):-null!=B&&(B(null),this.showError(mxResources.get("error"),413==U.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,f,x):this.parseFile(F,f,x)):0==c.indexOf("PK")&&null!=F?(N=!0,this.importZipFile(F,P,mxUtils.bind(this,function(){R=this.insertTextAt(this.validateFileData(c),l,n,!0,null,L);B(R)}))):/(\.v(sd|dx))($|\?)/i.test(x)||/(\.vs(s|x))($|\?)/i.test(x)||(R=this.insertTextAt(this.validateFileData(c),l,n,!0,null,L,null,null!=T?mxEvent.isControlDown(T):-null));N||null==B||B(R);return R};EditorUi.prototype.importFiles=function(c,f,l,n,r,t,x,B,F,L,D,T,N){n=null!=n?n:this.maxImageSize;L=null!=L?L:this.maxImageBytes;var R=null!=f&&null!=l,P=!0;f=null!=f?f:0;l=null!=l?l:0;var U=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var S=D||this.resampleThreshold,z=0;z<c.length;z++)if("image/svg"!==c[z].type.substring(0,9)&&"image/"===c[z].type.substring(0,6)&&c[z].size>S){U=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[f],"y",[l],"maxSize",+"none";document.body.appendChild(l);this.importFileInputElt=l}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(x,B){StorageFile.listFiles(this,"F",x,B)});window.openBrowserFile=mxUtils.bind(this,function(x,B,G){StorageFile.getFileContent(this,x,B,G)});window.deleteBrowserFile=mxUtils.bind(this,function(x,B,G){StorageFile.deleteFile(this,x,B,G)});if(!f){var n=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=+new OpenFile(mxUtils.bind(this,function(x){this.hideDialog(x)}));window.openFile.setConsumer(mxUtils.bind(this,function(x,B){null!=B&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(B)?(x=new Blob([x],{type:"application/octet-stream"}),this.importVisio(x,mxUtils.bind(this,function(G){this.importXml(G,0,0,!0)}),null,B)):this.editor.graph.setSelectionCells(this.importXml(x,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,+function(){window.openFile=null});if(!f){var r=this.dialog,t=r.close;this.dialog.close=mxUtils.bind(this,function(x){Editor.useLocalStorage=n;t.apply(r,arguments);x&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,f,l){var n=this,r=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(t){if(mxUtils.isEmptyObject(t.files))l();else{var x=0,B,G=!1;t.forEach(function(L,D){L=+D.name.toLowerCase();"diagram/diagram.xml"==L?(G=!0,D.async("string").then(function(T){0==T.indexOf("<mxfile ")?f(T):l()})):0==L.indexOf("versions/")&&(L=parseInt(L.substr(9)),L>x&&(x=L,B=D))});0<x?B.async("string").then(function(L){(new XMLHttpRequest).upload&&n.isRemoteFileFormat(L,c.name)?n.isOffline()?n.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,l):n.parseFileData(L,mxUtils.bind(this,function(D){4==D.readyState&&(200<=D.status&&299>=D.status?f(D.responseText):l())}),+c.name):l()}):G||l()}},function(t){l(t)}):l()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?r():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",r,null,null,null,l))};EditorUi.prototype.importFile=function(c,f,l,n,r,t,x,B,G,L,D,T){L=null!=L?L:!0;var N=!1,R=null,P=mxUtils.bind(this,function(U){var S=null;null!=U&&"<mxlibrary"==U.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,U,x)),this.showSidebar()):S=this.importXml(U,l,n,L,null,+null!=T?mxEvent.isControlDown(T):null);null!=B&&B(S)});"image"==f.substring(0,5)?(G=!1,"image/png"==f.substring(0,9)&&(D=D?null:this.extractGraphModelFromPng(c),null!=D&&0<D.length&&(R=this.importXml(D,l,n,L,null,null!=T?mxEvent.isControlDown(T):null),G=!0)),G||(G=this.editor.graph,D=c.indexOf(";"),0<D&&(c=c.substring(0,D)+c.substring(c.indexOf(",",D+1))),L&&G.isGridEnabled()&&(l=G.snap(l),n=G.snap(n)),D="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;",+"image/svg"==f.substring(0,9)&&(D+="editableCssRules=.*;"),R=[G.insertVertex(null,null,"",l,n,r,t,D+"image="+c+";")])):/(\.*<graphml )/.test(c)?(N=!0,this.importGraphML(c,P)):null!=G&&null!=x&&EditorUi.isVisioFilename(x)?(N=!0,this.importVisio(G,P)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,x)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(N=!0,f=mxUtils.bind(this,function(U){4==U.readyState&&(200<=U.status&&299>=U.status?P(U.responseText):+null!=B&&(B(null),this.showError(mxResources.get("error"),413==U.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,f,x):this.parseFile(G,f,x)):0==c.indexOf("PK")&&null!=G?(N=!0,this.importZipFile(G,P,mxUtils.bind(this,function(){R=this.insertTextAt(this.validateFileData(c),l,n,!0,null,L);B(R)}))):/(\.v(sd|dx))($|\?)/i.test(x)||/(\.vs(s|x))($|\?)/i.test(x)||(R=this.insertTextAt(this.validateFileData(c),l,n,!0,null,L,null,null!=T?mxEvent.isControlDown(T):+null));N||null==B||B(R);return R};EditorUi.prototype.importFiles=function(c,f,l,n,r,t,x,B,G,L,D,T,N){n=null!=n?n:this.maxImageSize;L=null!=L?L:this.maxImageBytes;var R=null!=f&&null!=l,P=!0;f=null!=f?f:0;l=null!=l?l:0;var U=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var S=D||this.resampleThreshold,z=0;z<c.length;z++)if("image/svg"!==c[z].type.substring(0,9)&&"image/"===c[z].type.substring(0,6)&&c[z].size>S){U=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[f],"y",[l],"maxSize",[n],"maxBytes",[L],"resampleThreshold",[this.resampleThreshold],"largeImages",[U],"crop",[R],"resizeImages",[P],"ignoreEmbeddedXml",[T],"evt",[N]);var g=mxUtils.bind(this,function(){var p=this.editor.graph,v=p.gridSize;r=null!=r?r:mxUtils.bind(this,function(W,M,X,Z,Y,aa,da,ba,ha){try{if(null!=W&&"<mxlibrary"==W.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,W,da)),this.showSidebar(),null;this.isCompatibleString(W)&&1==c.length&&null!=N&&"drop"==N.type&&this.isBlankFile()&&!this.canUndo()&&(R=!1,Z=X=0);return this.importFile(W,M,X,Z,Y,aa,da,ba,ha,R,T,N)}catch(la){return this.handleError(la),null}});t=null!=t?t:mxUtils.bind(this,function(W){p.setSelectionCells(W)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var C=this.currentPage,E=c.length,I=E,O=[],Q=mxUtils.bind(this,function(W,M){O[W]=M;if(0==--I){this.spinner.stop();if(null!=B)B(O);else{var X=[];p.getModel().beginUpdate();try{for(W=0;W<O.length;W++){var Z=O[W]();null!=Z&&(X=X.concat(Z))}}finally{p.getModel().endUpdate()}}C!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);t(X)}}),V=0;V<E;V++)mxUtils.bind(this,function(W){var M=c[W];if(null!=M){var X=new FileReader;X.onload=mxUtils.bind(this,function(Z){if(null==x||x(M))try{if("image/"==M.type.substring(0,6))if("image/svg"==M.type.substring(0,9)){var Y=Graph.clipSvgDataUri(Z.target.result),aa=Y.indexOf(","),da=decodeURIComponent(escape(atob(Y.substring(aa+1)))),ba=mxUtils.parseXml(da),ha=ba.getElementsByTagName("svg");@@ -14051,12 +14055,12 @@ Math.round(Aa*ca)),M.name);if(null!=fa&&(isNaN(Ba)||isNaN(Aa))){var oa=new ImageQ(W,mxUtils.bind(this,function(){return r(ra,"text/xml",f+W*v,l+W*v,0,0,M.name)}))}else Q(W,mxUtils.bind(this,function(){return null}))}else{aa=!1;if("image/png"==M.type){var sa=T?null:this.extractGraphModelFromPng(Z.target.result);if(null!=sa&&0<sa.length){var va=new Image;va.src=Z.target.result;Q(W,mxUtils.bind(this,function(){return r(sa,"text/xml",f+W*v,l+W*v,va.width,va.height,M.name)}));aa=!0}}aa||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(Z.target.result,mxUtils.bind(this,function(wa){this.resizeImage(wa,Editor.stripImageMetadata(Z.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(qa,Ba,Aa){Q(W,mxUtils.bind(this,function(){if(null!=qa&&qa.length<L){var Da=P&&this.isResampleImageSize(M.size,D)?Math.min(1,Math.min(n/Ba,n/Aa)):1;return r(qa,M.type,f+W*v,l+W*v,Math.round(Ba*Da),Math.round(Aa*Da),M.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),P,n,D,M.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else Y=Z.target.result,r(Y,M.type,f+W*v,l+W*v,240,160,M.name,function(wa){Q(W,function(){return wa})},M)}catch(wa){Q(W,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(wa,M)}else Q(W,mxUtils.bind(this,function(){return null}))});-EditorUi.isVisioFilename(M.name)?r(null,M.type,f+W*v,l+W*v,240,160,M.name,function(Z){Q(W,function(){return Z})},M):"image"==M.type.substring(0,5)||"application/pdf"==M.type?X.readAsDataURL(M):X.readAsText(M)}})(V)});if(U){U=[];for(z=0;z<c.length;z++)U.push(c[z]);c=U;this.confirmImageResize(function(p){P=p;g()},F)}else g()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};+EditorUi.isVisioFilename(M.name)?r(null,M.type,f+W*v,l+W*v,240,160,M.name,function(Z){Q(W,function(){return Z})},M):"image"==M.type.substring(0,5)||"application/pdf"==M.type?X.readAsDataURL(M):X.readAsText(M)}})(V)});if(U){U=[];for(z=0;z<c.length;z++)U.push(c[z]);c=U;this.confirmImageResize(function(p){P=p;g()},G)}else g()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,f){f=null!=f?f:!1;var l=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},n=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,r=function(t,x){if(t||f)mxSettings.setResizeImages(t?x:null),mxSettings.save();l();c(x)};null==n||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(t){r(t,!0)},function(t){r(t,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):r(!1,n)};EditorUi.prototype.parseFile=function(c,f,l){l=null!=l?l:c.name;var n=new FileReader;n.onload=mxUtils.bind(this,function(){this.parseFileData(n.result,f,l)});n.readAsText(c)};EditorUi.prototype.parseFileData=function(c,f,l){var n=new XMLHttpRequest;n.open("POST",OPEN_URL);n.setRequestHeader("Content-Type","application/x-www-form-urlencoded");n.onreadystatechange=function(){f(n)};n.send("format=xml&filename="+encodeURIComponent(l)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(r){}};EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,l,n,r,t,x){r=null!=r?r:this.maxImageSize;var B=Math.max(1,c.width),-F=Math.max(1,c.height),L=f;if(n&&this.isResampleImageSize(null!=x?x:f.length,t))try{var D=Math.max(B/r,F/r);if(1<D){var T=Math.round(B/D),N=Math.round(F/D),R=document.createElement("canvas");R.width=T;R.height=N;R.getContext("2d").drawImage(c,0,0,T,N);var P=R.toDataURL();if(P.length<f.length){var U=document.createElement("canvas");U.width=T;U.height=N;var S=U.toDataURL();P!==S&&(f=P,B=T,F=N)}}}catch(z){}n&&L!=f&&r>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,l,n,r/1.5,t,x):-l(f,B,F)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,f,l){try{var n=new Image;n.onload=function(){n.width=0<n.width?n.width:120;n.height=0<n.height?n.height:120;f(n)};null!=l&&(n.onerror=l);n.src=c}catch(r){if(null!=l)l(r);else throw r;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var q=EditorUi.prototype.createUi;+G=Math.max(1,c.height),L=f;if(n&&this.isResampleImageSize(null!=x?x:f.length,t))try{var D=Math.max(B/r,G/r);if(1<D){var T=Math.round(B/D),N=Math.round(G/D),R=document.createElement("canvas");R.width=T;R.height=N;R.getContext("2d").drawImage(c,0,0,T,N);var P=R.toDataURL();if(P.length<f.length){var U=document.createElement("canvas");U.width=T;U.height=N;var S=U.toDataURL();P!==S&&(f=P,B=T,G=N)}}}catch(z){}n&&L!=f&&r>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,l,n,r/1.5,t,x):+l(f,B,G)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,f,l){try{var n=new Image;n.onload=function(){n.width=0<n.width?n.width:120;n.height=0<n.height?n.height:120;f(n)};null!=l&&(n.onerror=l);n.src=c}catch(r){if(null!=l)l(r);else throw r;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var q=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){if(Editor.isSettingsEnabled()){null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles);this.formatWidth=mxSettings.getFormatWidth();var c=mxSettings.getSidebarWidth();null!=c&&(this.hsplitPosition=parseInt(c))}this.formatEnabled||(this.formatWidth=0);this.sidebarEnabled||(this.hsplitPosition=0);q.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var u=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,f=this.editor.graph;"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.installAutoRouting&&LibavoidRouting.installAutoRouting(this);this.addListener("styleChanged",mxUtils.bind(this,function(M,X){X.getProperty("force")&&"undefined"!==typeof mxSettings&&null!=mxSettings.setCurrentEdgeStyle&&null!=mxSettings.settings&&mxSettings.setCurrentEdgeStyle(mxUtils.clone(this.editor.graph.currentEdgeStyle))}));this.restorePersistedEdgeStyle();if(this.editor.isChromelessView()&&"0"!=urlParams.animate){var l=null,n=function(){var M=f.getModel().getRoot();if(M===l&&null!=c.chromelessAnimationPlayer)return!0;l=M;null!=c.chromelessAnimationPlayer&&c.chromelessAnimationPlayer.stop();c.chromelessAnimationPlayer=Editor.playAnimationOnGraph(f);return null!=c.chromelessAnimationPlayer};@@ -14069,8 +14073,8 @@ mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,da=null==Y.format&&!aa;X="dattrPrefix:"plantUml"});else{var wa=c.getMermaidImageBorder(M,Y.border),qa=c.replaceMermaidCell(M,ra?c.createMermaidImageXml(la,null,va,null,wa,"plantUmlData"):mxPlantUmlToDrawio.wrapGroup(va,la,sa));ra||null==wa||f.setCellStyles("groupPadding",wa,qa)}}finally{f.getModel().endUpdate()}}catch(Ba){c.handleError(Ba)}},function(va){c.spinner.stop();c.handleError(va)})}},null,null,X?ba:null,!0);B(ha)};f.cellEditor.editMermaidData=function(M,X,Z){var Y=JSON.parse(Z);X=f.getCurrentCellStyle(M);var aa=mxUtils.getValue(X,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE;X="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var da=document.createElement("select");da.className="geBtn";Z=document.createElement("option");Z.setAttribute("value","mermaid");mxUtils.write(Z,mxResources.get("diagram"));da.appendChild(Z);Z=document.createElement("option");Z.setAttribute("value","mermaidImage");mxUtils.write(Z,mxResources.get("image"));da.appendChild(Z);da.value=aa?"mermaidImage":"mermaid";var ba=new SimpleTextareaDialog(c,Y.data,function(ha){if(null!=ha&&c.spinner.spin(document.body,mxResources.get("inserting"))){var la="mermaidImage"==da.value,ra=la?EditorUi.legacyMermaidConfig:aa?null:Y.config;c.parseMermaidDiagram(ha,mxUtils.clone(ra),function(sa){c.spinner.stop();ba.hide();try{f.getModel().beginUpdate();try{if(aa&&la)c.updateMermaidImage(M,ha,null,sa,c.getMermaidImageBorder(M,Y.border));else if(aa||la){var va=c.getMermaidImageBorder(M,Y.border),wa=c.replaceMermaidCell(M,la?c.createMermaidImageXml(ha,null,sa,null,-va):mxMermaidToDrawio.wrapGroup(sa,ha,ra));la||null==va||f.setCellStyles("groupPadding",va,wa)}else c.replaceLockedGroupChildren(M,sa,ha,ra)}finally{f.getModel().endUpdate()}}catch(qa){c.handleError(qa)}},function(sa){c.spinner.stop();c.handleError(sa)})}},null,null,X?da:null,!0);B(ba)};var F=f.cellEditor.startEditing;f.cellEditor.startEditing=function(M,X,Z){try{var Y=this.graph.getLockedGroupAncestor(M);null!=Y&&(M=Y);var aa=this.graph.getAttributeForCell(M,"plantUmlData");if(null!=aa)this.editPlantUmlData(M,-X,aa);else if(aa=this.graph.getAttributeForCell(M,"mermaidData"),null!=aa&&EditorUi.isMermaidSupported())this.editMermaidData(M,X,aa);else{var da=f.getCellStyle(M);"1"==mxUtils.getValue(da,"metaEdit","0")?c.showDataDialog(M):F.call(this,M,X,Z)}}catch(ba){c.handleError(ba)}};f.getLinkTitle=function(M){return c.getLinkTitle(M)};f.customLinkClicked=function(M,X){var Z=!1;try{var Y=this.view.graphBounds,aa=null!=Y?new mxRectangle(Y.x,Y.y,Y.width,Y.height):null;c.handleCustomLink(M,X);Z=!0;var da=this.view.graphBounds;+va):mxMermaidToDrawio.wrapGroup(sa,ha,ra));la||null==va||f.setCellStyles("groupPadding",va,wa)}else c.replaceLockedGroupChildren(M,sa,ha,ra)}finally{f.getModel().endUpdate()}}catch(qa){c.handleError(qa)}},function(sa){c.spinner.stop();c.handleError(sa)})}},null,null,X?da:null,!0);B(ba)};var G=f.cellEditor.startEditing;f.cellEditor.startEditing=function(M,X,Z){try{var Y=this.graph.getLockedGroupAncestor(M);null!=Y&&(M=Y);var aa=this.graph.getAttributeForCell(M,"plantUmlData");if(null!=aa)this.editPlantUmlData(M,+X,aa);else if(aa=this.graph.getAttributeForCell(M,"mermaidData"),null!=aa&&EditorUi.isMermaidSupported())this.editMermaidData(M,X,aa);else{var da=f.getCellStyle(M);"1"==mxUtils.getValue(da,"metaEdit","0")?c.showDataDialog(M):G.call(this,M,X,Z)}}catch(ba){c.handleError(ba)}};f.getLinkTitle=function(M){return c.getLinkTitle(M)};f.customLinkClicked=function(M,X){var Z=!1;try{var Y=this.view.graphBounds,aa=null!=Y?new mxRectangle(Y.x,Y.y,Y.width,Y.height):null;c.handleCustomLink(M,X);Z=!0;var da=this.view.graphBounds;c.chromelessResize&&null!=aa&&null!=da&&!aa.equals(da)&&(c.chromelessResize(),this.scrollCellToVisible(X))}catch(ba){c.handleError(ba)}return Z};var L=f.parseBackgroundImage;f.parseBackgroundImage=function(M){var X=L.apply(this,arguments);null!=X&&null!=X.src&&Graph.isPageLink(X.src)&&(X={originalSrc:X.src});return X};var D=f.setBackgroundImage;f.setBackgroundImage=function(M){null!=M&&null!=M.originalSrc&&(M=c.createImageForPageLink(M.originalSrc,c.currentPage,this));D.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,function(M,X){M=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=M){var Z=M.indexOf(",");if(0<Z)for(M=M.substring(Z+1),X=X.getProperty("patches"),Z=0;Z<X.length;Z++)if(null!=X[Z][EditorUi.DIFF_UPDATE]&&null!=X[Z][EditorUi.DIFF_UPDATE][M]||null!=X[Z][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(X[Z][EditorUi.DIFF_REMOVE],M)){f.refreshBackgroundImage();break}}}));var T=f.getBackgroundImageObject;f.getBackgroundImageObject=function(M,X,Z){var Y=T.apply(this,arguments);null!=Y&&null!=Y.originalSrc&&(Y=X?c.createImageForPageLink(Y.originalSrc,Z,null,!0):{src:Y.originalSrc});return Y};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||@@ -14110,9 +14114,9 @@ this.setHighContrast(mxSettings.settings.highContrast):null!=window.matchMedia&&X){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var y=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));f=Editor.smallScreenWidth-160;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,!0):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&!this.isShapesPanelVisible()&&this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}y.apply(this,arguments);null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,l=this.sketchPickerMenuElt,n=this.editor.graph;l.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(L){mxEvent.getSource(L)==this.diagramContainer.parentNode&&(this.embedExitPoint=-new mxPoint(mxEvent.getClientX(L),mxEvent.getClientY(L)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var r=document.createElement("div");r.style.position="absolute";r.style.width="10px";r.style.height="10px";r.style.borderRadius="5px";r.style.border="1px solid gray";r.style.background="#ffffff";r.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(r);this.bottomResizer=r;var t=null,x=null,B=null,F=null;mxEvent.addGestureListeners(r,mxUtils.bind(this,function(L){F=+new mxPoint(mxEvent.getClientX(L),mxEvent.getClientY(L)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var r=document.createElement("div");r.style.position="absolute";r.style.width="10px";r.style.height="10px";r.style.borderRadius="5px";r.style.border="1px solid gray";r.style.background="#ffffff";r.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(r);this.bottomResizer=r;var t=null,x=null,B=null,G=null;mxEvent.addGestureListeners(r,mxUtils.bind(this,function(L){G=parseInt(this.diagramContainer.style.height);x=mxEvent.getClientY(L);n.popupMenuHandler.hideMenu();mxEvent.consume(L)}));r=r.cloneNode(!1);r.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(r);this.rightResizer=r;mxEvent.addGestureListeners(r,mxUtils.bind(this,function(L){B=parseInt(this.diagramContainer.style.width);t=mxEvent.getClientX(L);n.popupMenuHandler.hideMenu();mxEvent.consume(L)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(L){var D=!1;-null!=t&&(this.diagramContainer.style.width=Math.max(20,B+mxEvent.getClientX(L)-t)+"px",D=!0);null!=x&&(this.diagramContainer.style.height=Math.max(20,F+mxEvent.getClientY(L)-x)+"px",D=!0);D&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(L){null==t&&null==x||mxEvent.consume(L);x=t=null});document.body.style.backgroundColor=+null!=t&&(this.diagramContainer.style.width=Math.max(20,B+mxEvent.getClientX(L)-t)+"px",D=!0);null!=x&&(this.diagramContainer.style.height=Math.max(20,G+mxEvent.getClientY(L)-x)+"px",D=!0);D&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(L){null==t&&null==x||mxEvent.consume(L);x=t=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";f.style.visibility="hidden";c.style.visibility="hidden";l.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(L){this.inlineSizeChanged();Editor.passiveScroll?this.hideWindows():this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(L){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";f.style.visibility="hidden";c.style.visibility="hidden";l.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){l.innerHTML=" ";l.focus();try{var t=document.createRange();t.selectNodeContents(l);var x=window.getSelection();null!=x&&(x.removeAllRanges(),x.addRange(t))}catch(B){}},0)}var f=this.editor.graph,l=document.createElement("div");l.setAttribute("autocomplete","off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");l.style.textRendering="optimizeSpeed";l.style.fontFamily="monospace";l.style.wordBreak="break-all";l.style.background="transparent";l.style.color="transparent";l.style.position="absolute";@@ -14120,7 +14124,7 @@ l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.display="block";l.null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==x.nodeName||"TEXTAREA"==x.nodeName&&x!==this.typingShim||"true"==x.contentEditable||224!=t.keyCode&&(mxClient.IS_MAC||17!=t.keyCode)&&(!mxClient.IS_MAC||91!=t.keyCode&&93!=t.keyCode)||n||(l.style.left=f.container.scrollLeft+10+"px",l.style.top=f.container.scrollTop+10+"px",t=f.container.scrollLeft,x=f.container.scrollTop,f.container.appendChild(l),n=!0,l.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=t,f.container.scrollTop=x)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(t){var x=t.keyCode;window.setTimeout(mxUtils.bind(this,function(){!n||224!=x&&17!=x&&91!=x&&93!=x||(n=!1,l.parentNode.removeChild(l),f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,function(t){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l),c()}catch(x){this.handleError(x)}}));mxEvent.addListener(l,"cut",mxUtils.bind(this,function(t){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l,!0),c()}catch(x){this.handleError(x)}}));mxEvent.addListener(l,"paste",mxUtils.bind(this,function(t){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(l.innerHTML=" ",l.focus(),null!=t.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(t,l,!0,!0)),!mxEvent.isConsumed(t)){var x=f.container.scrollLeft,B=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,-function(){try{f.container.scrollLeft=x,f.container.scrollTop=B,Graph.removePasteFormatting(l.firstChild),this.pasteCells(t,l,!1,!0)}catch(F){this.handleError(F)}}),0)}}catch(F){this.handleError(F)}}),!0);var r=this.isSelectionAllowed;this.isSelectionAllowed=function(t){return mxEvent.getSource(t)==l?!0:r.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=+function(){try{f.container.scrollLeft=x,f.container.scrollTop=B,Graph.removePasteFormatting(l.firstChild),this.pasteCells(t,l,!1,!0)}catch(G){this.handleError(G)}}),0)}}catch(G){this.handleError(G)}}),!0);var r=this.isSelectionAllowed;this.isSelectionAllowed=function(t){return mxEvent.getSource(t)==l?!0:r.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var l="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(l||f)f=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(f);return l};EditorUi.prototype.saveScrollState=function(c){var f=this.editor.graph.view.translate,l=this.diagramContainer.scrollLeft,n=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(l-=this.embedViewport.x,n-=this.embedViewport.y):(l+=this.embedViewport.x,n+=this.embedViewport.y));f={x:l,y:n,tx:f.x,ty:f.y};c&&(f.boundingRect=this.diagramContainer.getBoundingClientRect());return f};EditorUi.prototype.restoreScrollState=function(c){var f=this.editor.graph.view.scale,l=this.editor.graph.view.translate;if(null!=c.boundingRect){var n=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-n.x;c.y-=c.boundingRect.y-n.y}this.diagramContainer.scrollLeft=c.x+(l.x-c.tx)*f;this.diagramContainer.scrollTop=c.y+(l.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&@@ -14135,15 +14139,15 @@ l&&l.visible&&(l=this.actions.get(c[f]),null!=l&&l.funct())}}};EditorUi.prototypnull});mxSettings.save()};EditorUi.prototype.restoreWindowState=function(c,f){c=mxSettings.getWindowState(c);if(null==c)return null;f=f.window;null!=c.w&&null!=c.h&&mxWindow.prototype.setSize.call(f,c.w,c.h);null!=c.x&&null!=c.y&&mxWindow.prototype.setLocation.call(f,c.x,c.y);null!=c.dockState&&null!=this.dockManager&&Editor.enableWindowDocking&&(f._dockAnchorRight=c.dockAnchorRight,f._dockAnchorBottom=c.dockAnchorBottom,f._dockOffsetX=c.dockOffsetX,f._dockOffsetY=c.dockOffsetY,f.dockState=c.dockState,f.div.classList.add("mxWindowDocked"),this.dockManager.windows.push(f),this.dockManager.pinToEdge(f));f.fit();null!=c.visible&&f.setVisible(c.visible);c.minimized&&!f.minimized&&f.toggleMinimized();return c};EditorUi.prototype.installWindowPersistence=function(c,f){var l=this,n=f.window,r=function(){l.saveWindowState(c,f)};n.addListener(mxEvent.MOVE_END,r);n.addListener(mxEvent.RESIZE_END,r);n.addListener(mxEvent.SHOW,r);n.addListener(mxEvent.HIDE,r);n.addListener(mxEvent.DOCK,r);n.addListener(mxEvent.UNDOCK,r);n.addListener(mxEvent.MAXIMIZE,r);n.addListener(mxEvent.MINIMIZE,r);n.addListener(mxEvent.NORMALIZE,r)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,f,l){var n=this.threshold,r=c<=n;c=c+l.offsetWidth>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-n;var t=f<=n;f=f+l.offsetHeight>=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-n;return r&&-t?"top-left":c&&t?"top-right":r&&f?"bottom-left":c&&f?"bottom-right":r?"left":c?"right":t?"top":f?"bottom":null},dock:function(c,f){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=parseInt(c.div.style.width),t=parseInt(c.div.style.height),x=c.getX(),B=c.getY();c.dockState=f;c.div.classList.add("mxWindowDocked");var F=0<=f.indexOf("right"),L=0<=f.indexOf("bottom");0<=f.indexOf("left")?-x=0:0<=f.indexOf("right")&&(x=l-r);0<=f.indexOf("top")?B=0:0<=f.indexOf("bottom")&&(B=n-t);F||(F=x+r/2>l/2);L||(L=B+t/2>n/2);c._dockAnchorRight=F;c._dockAnchorBottom=L;c._dockOffsetX=F?l-x-r:x;c._dockOffsetY=L?n-B-t:B;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,"side",f))},undock:function(c){var f=c.dockState;if(null!=f){for(var l=0;l<this.windows.length;l++)if(this.windows[l]===c){this.windows.splice(l,1);break}c.div.classList.remove("mxWindowDocked");c.dockState=+t?"top-left":c&&t?"top-right":r&&f?"bottom-left":c&&f?"bottom-right":r?"left":c?"right":t?"top":f?"bottom":null},dock:function(c,f){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=parseInt(c.div.style.width),t=parseInt(c.div.style.height),x=c.getX(),B=c.getY();c.dockState=f;c.div.classList.add("mxWindowDocked");var G=0<=f.indexOf("right"),L=0<=f.indexOf("bottom");0<=f.indexOf("left")?+x=0:0<=f.indexOf("right")&&(x=l-r);0<=f.indexOf("top")?B=0:0<=f.indexOf("bottom")&&(B=n-t);G||(G=x+r/2>l/2);L||(L=B+t/2>n/2);c._dockAnchorRight=G;c._dockAnchorBottom=L;c._dockOffsetX=G?l-x-r:x;c._dockOffsetY=L?n-B-t:B;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,"side",f))},undock:function(c){var f=c.dockState;if(null!=f){for(var l=0;l<this.windows.length;l++)if(this.windows[l]===c){this.windows.splice(l,1);break}c.div.classList.remove("mxWindowDocked");c.dockState=null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",f))}},pinToEdge:function(c){var f=c.dockState;if(null!=f){var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=parseInt(c.div.style.width),t=parseInt(c.div.style.height);var x=c._dockAnchorRight?l-r-(c._dockOffsetX||0):c._dockOffsetX||0;var B=c._dockAnchorBottom?n-t-(c._dockOffsetY||0):c._dockOffsetY||0;0<=f.indexOf("left")?x=0:0<=f.indexOf("right")&&(x=l-r);0<=f.indexOf("top")?B=0:0<=f.indexOf("bottom")&&(B=n-t);x=Math.max(0,Math.min(x,l-r));B=Math.max(0,Math.min(B,n-t));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,x,B);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,f){null==this.previewElement&&(this.previewElement=document.createElement("div"),this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=this.previewElement,t=f.div.offsetWidth,x=f.div.offsetHeight,B=f.getX();f=f.getY();0<=c.indexOf("left")?B=0:0<=c.indexOf("right")&&(B=l-t);0<=c.indexOf("top")?f=0:0<=c.indexOf("bottom")&&(f=n-x);B=Math.max(0,Math.min(B,l-t));f=Math.max(0,Math.min(f,n-x));r.style.display="block";r.style.left=B+"px";r.style.top=f+"px";r.style.width=t+"px";r.style.height=x+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var f=0;f<this.windows.length;f++)if(this.windows[f]===c){this.windows.splice(f,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var A=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,f,l){A.apply(this,arguments);if(EditorUi.windowed&&Editor.enableWindowDocking){var n=c.window;null==this.dockManager&&this.createDockManager();var r=this.dockManager,t=!1,x=null,B=n.setLocation;n.setLocation=function(D,T){(null==-this.dockState||this._undocking||this._relayouting)&&B.call(this,D,T)};var F=n.setSize;n.setSize=function(D,T){if(null!=this.dockState){mxWindow.prototype.setSize.call(this,D,T);D=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;T=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var N=parseInt(this.div.style.width),R=parseInt(this.div.style.height),P=this.getX(),U=this.getY();this._dockOffsetX=this._dockAnchorRight?D-P-N:P;this._dockOffsetY=-this._dockAnchorBottom?T-U-R:U;r.pinToEdge(this)}else F.call(this,D,T)};n.addListener(mxEvent.MOVE_START,function(D,T){t=!0;x=null;null!=n.dockState&&(n._undocking=!0,r.undock(n),n._undocking=!1)});n.addListener(mxEvent.MOVE,function(D,T){t&&(D=r.getDockZone(n.getX(),n.getY(),n.div),D!=x&&(x=D,null!=D?r.showPreview(D,n):r.hidePreview()))});n.addListener(mxEvent.MOVE_END,function(D,T){t=!1;r.hidePreview();null!=x&&r.dock(n,x);x=null});n.addListener(mxEvent.DOCK,function(D,T){if(null!=n.resize){D=T.getProperty("side");+this.dockState||this._undocking||this._relayouting)&&B.call(this,D,T)};var G=n.setSize;n.setSize=function(D,T){if(null!=this.dockState){mxWindow.prototype.setSize.call(this,D,T);D=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;T=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var N=parseInt(this.div.style.width),R=parseInt(this.div.style.height),P=this.getX(),U=this.getY();this._dockOffsetX=this._dockAnchorRight?D-P-N:P;this._dockOffsetY=+this._dockAnchorBottom?T-U-R:U;r.pinToEdge(this)}else G.call(this,D,T)};n.addListener(mxEvent.MOVE_START,function(D,T){t=!0;x=null;null!=n.dockState&&(n._undocking=!0,r.undock(n),n._undocking=!1)});n.addListener(mxEvent.MOVE,function(D,T){t&&(D=r.getDockZone(n.getX(),n.getY(),n.div),D!=x&&(x=D,null!=D?r.showPreview(D,n):r.hidePreview()))});n.addListener(mxEvent.MOVE_END,function(D,T){t=!1;r.hidePreview();null!=x&&r.dock(n,x);x=null});n.addListener(mxEvent.DOCK,function(D,T){if(null!=n.resize){D=T.getProperty("side");var N=0<=D.indexOf("right"),R=0<=D.indexOf("bottom");if(N||R){D=n.resize;D.parentNode.removeChild(D);n.resize=null;D=document.createElement("img");D.style.position="absolute";D.style.zIndex="2";D.setAttribute("src",mxWindow.prototype.resizeImage);N?D.style.left="0px":D.style.right="0px";R?D.style.top="0px":D.style.bottom="0px";D.style.cursor=N!=R?"nesw-resize":"nwse-resize";var P=null,U=null,S=null,z=null,g=function(v){if(null!=P&&null!=U){var C=mxEvent.getClientX(v)-P,E=mxEvent.getClientY(v)-U;n.setSize(N?S-C:S+C,R?z-E:z+E);n.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",v));mxEvent.consume(v)}},p=function(v){null!=P&&null!=U&&(U=P=null,mxEvent.removeGestureListeners(document,null,g,p),n.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",v)),mxEvent.consume(v))};mxEvent.addGestureListeners(D,function(v){n.activate();P=mxEvent.getClientX(v);U=mxEvent.getClientY(v);S=n.div.offsetWidth;z=n.div.offsetHeight;mxEvent.addGestureListeners(document,null,g,p);n.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",v));mxEvent.consume(v)},g,p);n.div.appendChild(D);n.resize=D;n._dockResize=!0}}});n.addListener(mxEvent.UNDOCK,function(D,T){n._dockResize&&(null!=n.resize&&(n.resize.parentNode.removeChild(n.resize),n.resize=null),n.setResizable(!0),n._dockResize=!1)});n.addListener(mxEvent.NORMALIZE,function(D,T){null!=n.dockState&&r.pinToEdge(n)});n.addListener(mxEvent.MAXIMIZE,function(D,T){null!=n.dockState&&(n._undocking=!0,r.undock(n),n._undocking=!1)});n.addListener(mxEvent.SHOW,function(D,T){null!=@@ -14154,14 +14158,14 @@ function(c){};EditorUi.prototype.createPickerMenuForTheme=function(c){};EditorUi"",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,f,l,n){l=null!=l?l:"geButton";var r=this.menus.get(c);n=this.menubar.addMenu(mxResources.get(c),r.funct,null,n);n.className=l;n.setAttribute("title",mxResources.get(c));this.menus.menuCreated(r,n,l);null!=f&&(n.style.backgroundImage="url("+f+")",n.innerText="");return n};EditorUi.prototype.addButton=function(c,f,l,n){c=this.createToolbarButton(c,f,l);n=null!=n?n:this.container;n.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,f,l){var n=document.createElement("a");n.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(n.style.backgroundImage="url("+c+")");null!=f&&n.setAttribute("title",f);null!=l&&mxEvent.addListener(n,"click",function(r){"disabled"!=n.getAttribute("disabled")&&l(r);mxEvent.consume(r)});mxEvent.preventDefault(n);return n};EditorUi.prototype.createMenuItem=function(c,f,l){var n=this.actions.get(c),r=null!=n?n.funct:null,t=this.createToolbarButton(f,mxResources.get(c)+(null!=n&&null!=n.shortcut?" ("+n.shortcut+")":""),r);null==n||l||(c=function(){n.isEnabled()?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),n.addListener("stateChanged",c),c());return t};EditorUi.prototype.createFormatWindow=-function(){if(null==this.formatWindow){var c=this,f=mxSettings.getWindowState("format"),l=null!=f&&null!=f.x?f.x:Math.max(10,this.diagramContainer.parentNode.clientWidth-256),n=null!=f&&null!=f.y?f.y:60,r=null!=f&&null!=f.w?f.w:240,t=null!=f&&null!=f.h?f.h:"1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),l,n,r,t,mxUtils.bind(this,function(F){F.appendChild(this.formatContainer)}));+function(){if(null==this.formatWindow){var c=this,f=mxSettings.getWindowState("format"),l=null!=f&&null!=f.x?f.x:Math.max(10,this.diagramContainer.parentNode.clientWidth-256),n=null!=f&&null!=f.y?f.y:60,r=null!=f&&null!=f.w?f.w:240,t=null!=f&&null!=f.h?f.h:"1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),l,n,r,t,mxUtils.bind(this,function(G){G.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var x=this.formatWindow.window.toggleMinimized,B=r;this.formatWindow.window.toggleMinimized=function(){x.apply(this,arguments);this.minimized?(B=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+B-140+"px"):(this.div.style.width=B+"px",this.table.style.width=-this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-B+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(F){mxEvent.getSource(F)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);this.installWindowPersistence("format",this.formatWindow);null!=f?this.restoreWindowState("format",this.formatWindow):-"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var F=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,L=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>F||690>L)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var J=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=+this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-B+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(G){mxEvent.getSource(G)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);this.installWindowPersistence("format",this.formatWindow);null!=f?this.restoreWindowState("format",this.formatWindow):+"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var G=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,L=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>G||690>L)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var J=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):J.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,f){if(this.isShapesPanelVisible()!=c){var l=EditorUi.prototype.hsplitPosition;0==l&&(l=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var n=this.hsplitPosition,r=mxUtils.bind(this,function(){this.hsplitPosition=t;this.refresh();f||(this.diagramContainer.scrollLeft-=n-this.hsplitPosition)}),t=c?l:0,x=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==t?"translateX(0)":"translateX(-100%)");0!=t&&r();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==t?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+x+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==t&&r();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*x)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var K=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;-return null!=c?c.window.isVisible():K.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var f=mxUtils.bind(this,function(x,B){var F=this.menus.get(x);x=this.createMenuElement(B,mxUtils.bind(this,function(){F.funct.apply(this,arguments)}));x.setAttribute("title",B);x.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";x.className="geButton";c.parentNode.appendChild(x);return x});if(Editor.enableCustomLibraries&&("1"!=+return null!=c?c.window.isVisible():K.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var f=mxUtils.bind(this,function(x,B){var G=this.menus.get(x);x=this.createMenuElement(B,mxUtils.bind(this,function(){G.funct.apply(this,arguments)}));x.setAttribute("title",B);x.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";x.className="geButton";c.parentNode.appendChild(x);return x});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))f=document.createElement("div"),f.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",f.className="geButton",f.style.left="0px",f.style.right="50%",mxUtils.write(f,mxResources.get("newLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("newLibrary").funct),f=f.cloneNode(!1),f.style.left="50%",f.style.right="0px",mxUtils.write(f,mxResources.get("openLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("openLibrary").funct);else{var l=f("newLibrary","");l.style.left="0px";l.style.right="50%";var n=document.createElement("span");l.appendChild(n);var r=f("openLibraryFrom","");r.style.borderLeftWidth="1px";r.style.left="50%";r.style.right="0px";var t=document.createElement("span");r.appendChild(t);this.dependsOnLanguage(mxUtils.bind(this,function(){n.innerHTML="";mxUtils.write(n,mxResources.get("newLibrary"));l.setAttribute("title",mxResources.get("newLibrary"));t.innerHTML="";mxUtils.write(t,mxResources.get("openLibraryFrom"));r.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=mxSettings.getWindowState("shapes"),f=null!=c&&null!=c.w?c.w:Math.min(this.diagramContainer.parentNode.clientWidth-10,230)-6,l=null!=c&&null!=c.h?c.h:("1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,@@ -14193,29 +14197,29 @@ f)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled())mxSettings.getGridColor(!1);c.view.gridColor="light-dark("+c.view.defaultGridColor+", "+c.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(f,l){mxSettings.setGridColor(c.view.defaultGridColor,!1);mxSettings.setGridColor(c.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(f,l){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(f,l){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()});this.addListener("sidebarWidthChanged",function(){mxSettings.setSidebarWidth(this.hsplitPosition);mxSettings.save()});this.addListener("collapsedSectionsChanged",-function(){null!=this.format&&(mxSettings.setCollapsedSections(this.format.collapsedSections),mxSettings.save())})}};EditorUi.prototype.writeImageToClipboard=function(c,f,l,n,r,t){n=null!=n?n:"image/png";var x=null==f||null==l?'<img src="'+c+'">':'<img src="'+c+'" width="'+f+'" height="'+l+'">',B={"text/html":new Blob([x],{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(n)&&(B[n]=this.base64ToBlob(c.substring(c.indexOf(",")+1),n));var F=new ClipboardItem(B);navigator.clipboard.write([F]).then(r)["catch"](t);-EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",[c],"w",f,"h",l,"type",n,"html",[x],"data",[B],"item",[F])};EditorUi.prototype.writeHtmlToClipboard=function(c,f){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})])["catch"](f)};EditorUi.prototype.writeTextToClipboard=function(c,f,l){navigator.clipboard.writeText(c).then(function(){null!=l&&l()})["catch"](f)};EditorUi.prototype.copySvg=+function(){null!=this.format&&(mxSettings.setCollapsedSections(this.format.collapsedSections),mxSettings.save())})}};EditorUi.prototype.writeImageToClipboard=function(c,f,l,n,r,t){n=null!=n?n:"image/png";var x=null==f||null==l?'<img src="'+c+'">':'<img src="'+c+'" width="'+f+'" height="'+l+'">',B={"text/html":new Blob([x],{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(n)&&(B[n]=this.base64ToBlob(c.substring(c.indexOf(",")+1),n));var G=new ClipboardItem(B);navigator.clipboard.write([G]).then(r)["catch"](t);+EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",[c],"w",f,"h",l,"type",n,"html",[x],"data",[B],"item",[G])};EditorUi.prototype.writeHtmlToClipboard=function(c,f){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})])["catch"](f)};EditorUi.prototype.writeTextToClipboard=function(c,f,l){navigator.clipboard.writeText(c).then(function(){null!=l&&l()})["catch"](f)};EditorUi.prototype.copySvg=function(c,f,l){try{if(null!=navigator.clipboard&&"function"===typeof window.ClipboardItem){var n=this.editor.graph.getSvg(null,l,null,null,null,null,null,null,null,null,null,Editor.isDarkMode()?"dark":"light",null,0<c.length?c:null);null!=f&&n.setAttribute("content",f);var r=Editor.createSvgDataUri(mxUtils.getXml(n)),t=parseInt(n.getAttribute("width")),x=parseInt(n.getAttribute("height"));this.writeImageToClipboard(r,t,x,"image/svg+xml",null,mxUtils.bind(this,function(B){this.handleError(B)}))}}catch(B){this.handleError(B)}};EditorUi.prototype.copyImage=function(c,f,l){try{l=null!=l?l:4,null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(n,r){try{this.spinner.stop();var t=this.createImageDataUri(n,f,"png"),x=Math.round(parseInt(r.getAttribute("width"))/l),B=Math.round(parseInt(r.getAttribute("height"))/l);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[f],"scale",[l]);this.writeImageToClipboard(t,-x,B,"image/png",null,mxUtils.bind(this,function(){if(this.isLocalFileSave()){var F=this.getBaseFilename(!1)+(null!=f?".drawio":"")+".png";this.saveLocalFile(t.substring(t.lastIndexOf(",")+1),F,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(F){this.handleError(F)}}),null,null,null,mxUtils.bind(this,function(n){this.spinner.stop();this.handleError(n)}),null,null,l,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,+x,B,"image/png",null,mxUtils.bind(this,function(){if(this.isLocalFileSave()){var G=this.getBaseFilename(!1)+(null!=f?".drawio":"")+".png";this.saveLocalFile(t.substring(t.lastIndexOf(",")+1),G,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(G){this.handleError(G)}}),null,null,null,mxUtils.bind(this,function(n){this.spinner.stop();this.handleError(n)}),null,null,l,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,Editor.isDarkMode()?"dark":"light",null,0<c.length?c:null)}catch(n){this.handleError(n)}};EditorUi.prototype.copyCells=function(c,f){var l=this.editor.graph;if(l.isSelectionEmpty())c.innerText="";else{var n=mxUtils.sortCells(l.model.getTopmostCells(l.getSelectionCells())),r=mxUtils.getXml(l.encodeCells(n));mxUtils.setTextContent(c,encodeURIComponent(r));f?(l.removeCells(n,!1),l.lastPasteXml=null):(l.lastPasteXml=r,l.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=null;if(Editor.enableNativeClipboard){var f=this.editor.graph;f.isSelectionEmpty()||(c=mxUtils.sortCells(f.getExportableCells(f.model.getTopmostCells(f.getSelectionCells()))),f=mxUtils.getXml(f.encodeCells(c)),navigator.clipboard.writeText(f))}return c};EditorUi.prototype.pasteXml=function(c,f,l,n,r,t){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",[f],"compat",[l],"evt",[n],"html",[r],"pt",[t]);r=null!=r?r:!0;var x=this.editor.graph,B=null!=t?t:Editor.pasteAtMousePointer&&-x.isMouseInsertPoint()?x.getInsertPoint():null;t=null;x.lastPasteXml==c?null==B&&x.pasteCounter++:(x.lastPasteXml=c,x.pasteCounter=0);var F=x.pasteCounter*x.gridSize;if(l||this.isCompatibleString(c)){x.model.beginUpdate();try{if(t=this.importXml(c,F,F),null!=B){var L=x.getBoundingBoxFromGeometry(t,!0);if(null!=L){var D=Math.round(x.snap(B.x)),T=Math.round(x.snap(B.y));x.cellsMoved(t,D-L.x,T-L.y)}}}finally{x.model.endUpdate()}x.setSelectionCells(t)}else if(f&&1==x.getSelectionCount()){f=x.getStartEditingCell(x.getSelectionCell(),-n);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==x.getCurrentCellStyle(f)[mxConstants.STYLE_SHAPE])x.setCellStyles(mxConstants.STYLE_IMAGE,c,[f]);else{x.model.beginUpdate();try{x.labelChanged(f,c),Graph.isLink(c)&&x.setLinkForCell(f,c)}finally{x.model.endUpdate()}}x.setSelectionCell(f)}else B=null!=B?B:x.getInsertPoint(),x.isMouseInsertPoint()&&(F=0,x.lastPasteXml==c&&0<x.pasteCounter&&x.pasteCounter--),t=this.insertTextAt(c,B.x+F,B.y+F,r),x.setSelectionCells(t);x.isSelectionEmpty()||(x.scrollCellToVisible(x.getSelectionCell()),-null!=this.hoverIcons&&this.hoverIcons.update(x.view.getState(x.getSelectionCell())));return t};EditorUi.prototype.pasteCells=function(c,f,l,n){if(!mxEvent.isConsumed(c)){var r=c.clipboardData,t=this.editor.graph,x=!1,B=f;if(l&&null!=r&&r.getData){var F=r.getData("text/plain"),L=!1;if(null!=F&&0<F.length&&"%3CmxGraphModel%3E"==F.substring(0,18))try{var D=decodeURIComponent(F);this.isCompatibleString(D)&&(L=!0,F=D)}catch(z){}L=L?null:r.getData("text/html");null!=L&&0<L.length?(B=this.parseHtmlData(L),-x="text/plain"!=B.getAttribute("data-type")):null!=F&&0<F.length&&(B=document.createElement("div"),mxUtils.setTextContent(B,F))}F=B.getElementsByTagName("span");if(null!=F&&0<F.length&&"application/vnd.lucid.chart.objects"===F[0].getAttribute("data-lucid-type"))l=F[0].getAttribute("data-lucid-content"),null!=l&&0<l.length&&(this.convertLucidChart(l,mxUtils.bind(this,function(z){var g=this.editor.graph;g.lastPasteXml==z?g.pasteCounter++:(g.lastPasteXml=z,g.pasteCounter=0);var p=g.pasteCounter*g.gridSize;+x.isMouseInsertPoint()?x.getInsertPoint():null;t=null;x.lastPasteXml==c?null==B&&x.pasteCounter++:(x.lastPasteXml=c,x.pasteCounter=0);var G=x.pasteCounter*x.gridSize;if(l||this.isCompatibleString(c)){x.model.beginUpdate();try{if(t=this.importXml(c,G,G),null!=B){var L=x.getBoundingBoxFromGeometry(t,!0);if(null!=L){var D=Math.round(x.snap(B.x)),T=Math.round(x.snap(B.y));x.cellsMoved(t,D-L.x,T-L.y)}}}finally{x.model.endUpdate()}x.setSelectionCells(t)}else if(f&&1==x.getSelectionCount()){f=x.getStartEditingCell(x.getSelectionCell(),+n);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==x.getCurrentCellStyle(f)[mxConstants.STYLE_SHAPE])x.setCellStyles(mxConstants.STYLE_IMAGE,c,[f]);else{x.model.beginUpdate();try{x.labelChanged(f,c),Graph.isLink(c)&&x.setLinkForCell(f,c)}finally{x.model.endUpdate()}}x.setSelectionCell(f)}else B=null!=B?B:x.getInsertPoint(),x.isMouseInsertPoint()&&(G=0,x.lastPasteXml==c&&0<x.pasteCounter&&x.pasteCounter--),t=this.insertTextAt(c,B.x+G,B.y+G,r),x.setSelectionCells(t);x.isSelectionEmpty()||(x.scrollCellToVisible(x.getSelectionCell()),+null!=this.hoverIcons&&this.hoverIcons.update(x.view.getState(x.getSelectionCell())));return t};EditorUi.prototype.pasteCells=function(c,f,l,n){if(!mxEvent.isConsumed(c)){var r=c.clipboardData,t=this.editor.graph,x=!1,B=f;if(l&&null!=r&&r.getData){var G=r.getData("text/plain"),L=!1;if(null!=G&&0<G.length&&"%3CmxGraphModel%3E"==G.substring(0,18))try{var D=decodeURIComponent(G);this.isCompatibleString(D)&&(L=!0,G=D)}catch(z){}L=L?null:r.getData("text/html");null!=L&&0<L.length?(B=this.parseHtmlData(L),+x="text/plain"!=B.getAttribute("data-type")):null!=G&&0<G.length&&(B=document.createElement("div"),mxUtils.setTextContent(B,G))}G=B.getElementsByTagName("span");if(null!=G&&0<G.length&&"application/vnd.lucid.chart.objects"===G[0].getAttribute("data-lucid-type"))l=G[0].getAttribute("data-lucid-content"),null!=l&&0<l.length&&(this.convertLucidChart(l,mxUtils.bind(this,function(z){var g=this.editor.graph;g.lastPasteXml==z?g.pasteCounter++:(g.lastPasteXml=z,g.pasteCounter=0);var p=g.pasteCounter*g.gridSize;g.setSelectionCells(this.importXml(z,p,p));g.scrollCellToVisible(g.getSelectionCell())}),mxUtils.bind(this,function(z){this.handleError(z)})),mxEvent.consume(c));else{var T=!1,N="";N=x?null!=B.textContent&&"<mxfile"==B.textContent.substring(0,7)&&"</mxfile>"==B.textContent.substring(B.textContent.length-9)||"<mxGraphModel"==B.textContent.substring(0,13)&&"</mxGraphModel>"==B.textContent.substring(B.textContent.length-15)?B.textContent.replace(/\u00a0/g," "):B.innerHTML:mxUtils.trim(null==B.innerText?-mxUtils.getTextContent(B):B.innerText);try{var R=N.lastIndexOf("%3E");0<=R&&R<N.length-3&&(N=N.substring(0,R+3))}catch(z){}try{F=B.getElementsByTagName("span"),(D=null!=F&&0<F.length?mxUtils.trim(decodeURIComponent(F[0].textContent)):decodeURIComponent(N))&&(this.isCompatibleString(D)||0==D.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(T=!0,N=D)}catch(z){}D=null;try{if(!T&&""==B.textContent)for(R=0;R<r.items.length;R++){var P=r.items[R];if("file"===P.kind){D=P.getAsFile();break}}}catch(z){}EditorUi.debug("EditorUi.pasteCells",+mxUtils.getTextContent(B):B.innerText);try{var R=N.lastIndexOf("%3E");0<=R&&R<N.length-3&&(N=N.substring(0,R+3))}catch(z){}try{G=B.getElementsByTagName("span"),(D=null!=G&&0<G.length?mxUtils.trim(decodeURIComponent(G[0].textContent)):decodeURIComponent(N))&&(this.isCompatibleString(D)||0==D.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(T=!0,N=D)}catch(z){}D=null;try{if(!T&&""==B.textContent)for(R=0;R<r.items.length;R++){var P=r.items[R];if("file"===P.kind){D=P.getAsFile();break}}}catch(z){}EditorUi.debug("EditorUi.pasteCells",[this],"evt",[c],"realElt",[f.outerHTML],"elt",[B.outerHTML],"useEvent",l,"pasteAsLabel",n,"xml",[N],"compat",T,"asHtml",x,"data",r,"items",[r.items.length],"files",[r.files.length],"types",[JSON.stringify(r.types)],"blob",[D]);try{if(T||null==D)if(null!=N&&0<N.length){if(0==N.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var S=mxUtils.bind(this,function(){try{N=(new MiroImporter).importMiroJson(JSON.parse(N)),this.pasteXml(N,n,T,c)}catch(z){console.log("Miro import error:",z)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",S):S()}else this.pasteXml(N,n,T,c,x);mxEvent.consume(c)}else l||(t.lastPasteXml=null,t.pasteCounter=0);else{var U=t.getInsertPoint();this.importFiles([D],U.x,U.y,this.maxImageSize);mxEvent.consume(c)}}catch(z){this.handleError(z)}}}f.innerHTML=" "};EditorUi.prototype.pasteFromClipboard=function(c){var f=this.editor.graph;null==c&&Editor.pasteAtMousePointer&&f.isMouseInsertPoint()&&(c=f.getInsertPoint());if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(l,n,r,t,x){if(null!=l){f.getModel().beginUpdate();try{this.pasteXml(l,!0,null,null,null,c)}finally{f.getModel().endUpdate()}}else l=null!=n?n:null!=r?r:t,null!=l?(c=null!=c?c:f.getInsertPoint(),this.importFiles([l],c.x,c.y,this.maxImageSize)):this.pasteFromLocalClipboard(c)})):this.pasteFromLocalClipboard(c)}catch(l){}};EditorUi.prototype.pasteFromLocalClipboard=function(c){var f=this.editor.graph;f.getModel().beginUpdate();try{f.moveCellsTo(mxClipboard.paste(f),c)}finally{f.getModel().endUpdate()}};EditorUi.prototype.installImagePasteHandler=function(){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,function(f){for(var l=null!=f.clipboardData?f.clipboardData:f.originalEvent.clipboardData,n=!1,r=null,t=0;t<l.types.length;t++)if("text/"===l.types[t].substring(0,5)){n=!0;break}for(t=0;t<l.items.length;t++){var x=l.items[t];if("file"===x.kind){r=x.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[f],"data",[l],"items",[l.items.length],"files",[l.files.length],"types",[JSON.stringify(l.types)],"containsText",n,"file",[r],"editing",c.isEditing());var B=mxUtils.bind(this,function(){try{if(!n&&null!=r){if(c.isEditing())this.importFiles([r],0,0,this.maxImageSize,function(L,D,T,N,R,P){c.insertImage(L,R,P)},function(){},function(L){return"image/"==L.type.substring(0,6)},function(L){for(var D=0;D<L.length;D++)L[D]()});-else{var F=this.editor.graph.getInsertPoint();this.importFiles([r],F.x,F.y,this.maxImageSize)}mxEvent.consume(f)}}catch(L){}});if(!mxEvent.isConsumed(f)&&!n)if(Editor.enableNativeClipboard)navigator.clipboard.read().then(mxUtils.bind(this,function(F){this.readTypeFromClipboardData(F,"image/svg+xml",mxUtils.bind(this,function(L){if(null!=L){L=new Blob([L],{type:"image/svg+xml"});var D=this.editor.graph.getInsertPoint();this.importFiles([L],D.x,D.y,this.maxImageSize)}else B()}),"image")}))["catch"](B);+else{var G=this.editor.graph.getInsertPoint();this.importFiles([r],G.x,G.y,this.maxImageSize)}mxEvent.consume(f)}}catch(L){}});if(!mxEvent.isConsumed(f)&&!n)if(Editor.enableNativeClipboard)navigator.clipboard.read().then(mxUtils.bind(this,function(G){this.readTypeFromClipboardData(G,"image/svg+xml",mxUtils.bind(this,function(L){if(null!=L){L=new Blob([L],{type:"image/svg+xml"});var D=this.editor.graph.getInsertPoint();this.importFiles([L],D.x,D.y,this.maxImageSize)}else B()}),"image")}))["catch"](B);else B()}),!1)};EditorUi.prototype.readGraphModelFromClipboard=function(c){navigator.clipboard.read().then(mxUtils.bind(this,function(f){try{EditorUi.debug("EditorUi.readGraphModelFromClipboard",[this],"data",f,"types",null!=f&&0<f.length?[JSON.stringify(f[0].types)]:[]),this.readGraphModelFromHtmlClipboardData(f,mxUtils.bind(this,function(l,n){null!=l?c(l):this.readGraphModelFromImageClipboardData(f,mxUtils.bind(this,function(r,t,x){null!=r?c(r):this.readTypeFromClipboardData(f,"text/plain",mxUtils.bind(this,function(B){c(B,t,x,n,f)}))}))}))}catch(l){c(null)}}))["catch"](function(){c(null)})};EditorUi.prototype.readGraphModelFromHtmlClipboardData=function(c,f){this.readTypeFromClipboardData(c,"text/html",mxUtils.bind(this,function(l){var n=null,r=null;try{var t=this.parseHtmlData(l);if(null!=t){n="text/plain"!=t.getAttribute("data-type")?t.innerHTML:mxUtils.trim(null==t.innerText?mxUtils.getTextContent(t):t.innerText);try{var x=n.lastIndexOf("%3E");0<=x&&x<n.length-3&&(n=n.substring(0,x+3))}catch(L){}try{null==-n&&(l=null,""==t.textContent&&1==t.children.length&&"IMG"==t.firstChild.nodeName&&(l=t.firstChild.getAttribute("src")),null!=l&&0<l.length&&("data:image/png;base64,"==l.substring(0,22)?r=this.base64ToBlob(l.substring(l.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==l.substring(0,26)&&(r=this.base64ToBlob(l.substring(l.indexOf(",")+1),"image/svg+xml"))))}catch(L){}try{var B=t.getElementsByTagName("span"),F=null!=B&&0<B.length?mxUtils.trim(decodeURIComponent(B[0].textContent)):decodeURIComponent(n);-this.isCompatibleString(F)&&(n=F)}catch(L){}}}catch(L){}f(this.isCompatibleString(n)?n:null,r)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,f){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(l,n){var r=null;try{null!=l&&(r=mxUtils.parseXml(l).documentElement.getAttribute("content"))}catch(t){}this.isCompatibleString(r)?f(r):this.readTypeFromClipboardData(c,"image/png",mxUtils.bind(this,function(t,x){r=Editor.extractGraphModelFromPng("data:image/png;base64,"++n&&(l=null,""==t.textContent&&1==t.children.length&&"IMG"==t.firstChild.nodeName&&(l=t.firstChild.getAttribute("src")),null!=l&&0<l.length&&("data:image/png;base64,"==l.substring(0,22)?r=this.base64ToBlob(l.substring(l.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==l.substring(0,26)&&(r=this.base64ToBlob(l.substring(l.indexOf(",")+1),"image/svg+xml"))))}catch(L){}try{var B=t.getElementsByTagName("span"),G=null!=B&&0<B.length?mxUtils.trim(decodeURIComponent(B[0].textContent)):decodeURIComponent(n);+this.isCompatibleString(G)&&(n=G)}catch(L){}}}catch(L){}f(this.isCompatibleString(n)?n:null,r)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,f){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(l,n){var r=null;try{null!=l&&(r=mxUtils.parseXml(l).documentElement.getAttribute("content"))}catch(t){}this.isCompatibleString(r)?f(r):this.readTypeFromClipboardData(c,"image/png",mxUtils.bind(this,function(t,x){r=Editor.extractGraphModelFromPng("data:image/png;base64,"+t);this.isCompatibleString(r)?f(r):f(null,n,x)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,f,l){var n=!1;if(null!=c&&0<c.length)for(var r=0;r<c.length&&!n;r++)(function(t){0<=mxUtils.indexOf(t.types,f)&&(n=!0,t.getType(f).then(mxUtils.bind(this,function(x){if("image/png"==f)x.arrayBuffer().then(function(B){l(btoa(Graph.arrayBufferToString(B)),x)})["catch"](function(){l(null)});else x.text().then(mxUtils.bind(this,function(B){EditorUi.debug("EditorUi.readTypeFromClipboardData",[this],"data",[c],"type",[f],"result",[B]);l(B,x)}))["catch"](function(){l(null)})}))["catch"](function(){l(null)}))})(c[r]);n||l()};EditorUi.prototype.parseHtmlData=function(c){var f=null;if(null!=c&&0<c.length){var l="<meta "==c.substring(0,6);f=document.createElement("div");f.innerHTML=(l?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(c);asHtml=!0;l=f.getElementsByTagName("style");if(null!=l)for(;0<l.length;)l[0].parentNode.removeChild(l[0]);if(null!=f.firstChild&&f.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=f.firstChild.nextSibling&&f.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==f.firstChild.nodeName&&"A"==f.firstChild.nextSibling.nodeName&&null==f.firstChild.nextSibling.nextSibling){var n=null==f.firstChild.nextSibling.innerText?mxUtils.getTextContent(f.firstChild.nextSibling):f.firstChild.nextSibling.innerText;n==f.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(f,n),asHtml=!1)}if(""==f.textContent&&(l=f.getElementsByTagName("img"),1==l.length&&@@ -14228,9 +14232,9 @@ ra.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(qa)+'";\nsrc: urlthis.mathEnabled=this.mathEnabled||!0:qa.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var Aa=qa.getElementsByTagName("svg"),Da=0;Da<Aa.length;Da++)z.addSvgShadow(Aa[Da])};f.grid&&(g.gridSize=z.gridSize,g.gridSteps=z.view.gridSteps,g.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:z.view.gridColor);g.isCellVisible=f.selection?function(ra){return z.isCellSelected(ra)&&z.isCellVisible(ra)}:function(ra){return z.isCellVisible(ra)};g.open(null,null,p,!0,v,X,f.selection?z.getSelectionCells():null)}else{V=z.background;if(null==V||""==V||V==mxConstants.NONE)V="#ffffff";g.backgroundColor=V;g.autoOrigin=Z;f.grid&&(g.gridSize=z.gridSize,g.gridSteps=z.view.gridSteps,g.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:z.view.gridColor);g.isCellVisible=f.selection?function(ra){return z.isCellSelected(ra)&&z.isCellVisible(ra)}:function(ra){return z.isCellVisible(ra)};g.appendGraph(z,aa,W,M,p,!0,v,X,f.selection?z.getSelectionCells():null);p=z.getCustomFonts();if(null!=g.wnd)for(X=0;X<p.length;X++)W=p[X].name,M=p[X].url,Graph.isCssFontUrl(M)?g.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(M)+'" charset="UTF-8" type="text/css">'):(g.wnd.document.writeln('<style type="text/css">'),g.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(W)+'";\nsrc: url("'+mxUtils.htmlEntities(M)+'");\n}'),g.wnd.document.writeln("</style>"))}C&&(z.useCssTransforms=C,z.currentTranslate=E,z.currentScale=I,z.view.translate=O,z.view.scale=-Q);return g}),B=f.pagesFrom,F=f.pagesTo,L=!f.allPages;r=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{L&&(L=f.selection||B==t&&F==t);if(!L&&null!=this.pages&&this.pages.length){L=0;t=this.pages.length-1;f.allPages||(L=parseInt(B)-1,t=parseInt(F)-1);for(var D=L;D<=t;D++){var T=this.pages[D];B=T==this.currentPage?n:null;if(null==B){B=this.createTemporaryGraph(n.stylesheet);B.shapeForegroundColor=n.shapeForegroundColor;B.shapeBackgroundColor=n.shapeBackgroundColor;F=!0;var N=-L=!1,R=null,P=null;null==T.viewState&&null==T.root&&this.updatePageRoot(T);null!=T.viewState&&(F=T.viewState.pageVisible,L=T.viewState.mathEnabled,N=T.viewState.shadowVisible,R=T.viewState.background,P=T.viewState.backgroundImage,B.pageFormat=T.viewState.pageFormat,B.gridSize=T.viewState.gridSize,B.hiddenTags=T.viewState.hiddenTags||[]);null!=P&&null!=P.originalSrc&&(P=this.createImageForPageLink(P.originalSrc,T));B.background=R;B.backgroundImage=null!=P?new mxImage(P.src,P.width,P.height,P.x,P.y):-null;B.pageVisible=F;B.mathEnabled=L;B.shadowVisible=N;var U=B.getGraphBounds;B.getGraphBounds=function(){var z=U.apply(this,arguments),g=this.backgroundImage;if(null!=g&&null!=g.width&&null!=g.height){var p=this.view.translate,v=this.view.scale;z=mxRectangle.fromRectangle(z);z.add(new mxRectangle((p.x+g.x)*v,(p.y+g.y)*v,g.width*v,g.height*v))}return z};var S=B.getGlobalVariable;B.getGlobalVariable=function(z){return"page"==z?T.getName():"pagenumber"==z?D+1:"pagecount"==z?null!=this.pages?this.pages.length:+Q);return g}),B=f.pagesFrom,G=f.pagesTo,L=!f.allPages;r=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{L&&(L=f.selection||B==t&&G==t);if(!L&&null!=this.pages&&this.pages.length){L=0;t=this.pages.length-1;f.allPages||(L=parseInt(B)-1,t=parseInt(G)-1);for(var D=L;D<=t;D++){var T=this.pages[D];B=T==this.currentPage?n:null;if(null==B){B=this.createTemporaryGraph(n.stylesheet);B.shapeForegroundColor=n.shapeForegroundColor;B.shapeBackgroundColor=n.shapeBackgroundColor;G=!0;var N=+L=!1,R=null,P=null;null==T.viewState&&null==T.root&&this.updatePageRoot(T);null!=T.viewState&&(G=T.viewState.pageVisible,L=T.viewState.mathEnabled,N=T.viewState.shadowVisible,R=T.viewState.background,P=T.viewState.backgroundImage,B.pageFormat=T.viewState.pageFormat,B.gridSize=T.viewState.gridSize,B.hiddenTags=T.viewState.hiddenTags||[]);null!=P&&null!=P.originalSrc&&(P=this.createImageForPageLink(P.originalSrc,T));B.background=R;B.backgroundImage=null!=P?new mxImage(P.src,P.width,P.height,P.x,P.y):+null;B.pageVisible=G;B.mathEnabled=L;B.shadowVisible=N;var U=B.getGraphBounds;B.getGraphBounds=function(){var z=U.apply(this,arguments),g=this.backgroundImage;if(null!=g&&null!=g.width&&null!=g.height){var p=this.view.translate,v=this.view.scale;z=mxRectangle.fromRectangle(z);z.add(new mxRectangle((p.x+g.x)*v,(p.y+g.y)*v,g.width*v,g.height*v))}return z};var S=B.getGlobalVariable;B.getGlobalVariable=function(z){return"page"==z?T.getName():"pagenumber"==z?D+1:"pagecount"==z?null!=this.pages?this.pages.length:1:S.apply(this,arguments)};document.body.appendChild(B.container);this.updatePageRoot(T);B.model.setRoot(T.root)}r=x(B,r,D!=t,T.getId());B!=n&&B.container.parentNode.removeChild(B.container)}}else r=x(n);if(null==r||null==r.wnd)this.handleError({message:mxResources.get("errorUpdatingPreview")});else{r.mathEnabled&&(x=r.wnd.document,c||(r.wnd.IMMEDIATE_PRINT=!0),x.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>'));r.closeDocument();if(Editor.expandPatternsForPrint&&null!=r.wnd)for(x=r.wnd.document.getElementsByTagName("svg"),D=0;D<x.length;D++)Editor.expandSvgPatterns(x[D]);Graph.rewritePageLinks(r.wnd.document,!0);r.mathEnabled||c||PrintDialog.printPreview(r)}return r}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var f=null,l=0;l<c.length;l++)mxEvent.addListener(c[l],"dragleave",function(n){null!=f&&(f.parentNode.removeChild(f),f=null);n.stopPropagation();n.preventDefault()}),mxEvent.addListener(c[l],"dragover",mxUtils.bind(this,function(n){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==f&&(f=this.highlightElement());n.stopPropagation();n.preventDefault()})),mxEvent.addListener(c[l],"drop",mxUtils.bind(this,function(n){null!=f&&(f.parentNode.removeChild(f),f=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<n.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(n.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(n)&&!mxEvent.isShiftDown(n)):this.openFiles(n.dataTransfer.files,@@ -14243,16 +14247,16 @@ EditorUi.prototype.openFileHandle=function(c,f,l,n,r,t,x){if(null!=f&&0<f.lengthL,f)),this.showSidebar()}catch(D){this.handleError(D,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(L,f,n,null,null,null,x)});if(EditorUi.isVisioFilename(f))this.importVisio(l,mxUtils.bind(this,function(L){this.spinner.stop();B(L)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(L){this.spinner.stop();B(L)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,f))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(l,mxUtils.bind(this,function(L){4==L.readyState&&(this.spinner.stop(),200<=L.status&&299>=L.status?B(L.responseText):this.handleError({message:mxResources.get(413==L.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(L){this.spinner.stop();this.openLocalFile(L,f,n,null,null,null,x)}),mxUtils.bind(this,function(L){this.spinner.stop();this.handleError(L)}));else if("<mxlibrary"==c.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,n);try{this.loadLibrary(new LocalLibrary(this,c,l.name)),this.showSidebar()}catch(L){this.handleError(L,mxResources.get("errorLoadingFile"))}}else if(0==c.indexOf("PK"))this.importZipFile(l,mxUtils.bind(this,function(L){this.spinner.stop();-B(L)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,f,n,null,null,null,x)}));else{if("image/png"==l.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==l.type){var F=Editor.extractGraphModelFromPdf(c);null!=F&&(r=null,n=!0,c=F)}this.spinner.stop();this.openLocalFile(c,f,n,r,null!=r?l:null,t,x)}}};EditorUi.prototype.openFiles=function(c,f,l){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=0;n<c.length;n++)mxUtils.bind(this,-function(r){var t=new FileReader;t.onload=mxUtils.bind(this,function(x){try{this.openFileHandle(x.target.result,r.name,r,f,null,null,l)}catch(B){this.handleError(B)}});t.onerror=mxUtils.bind(this,function(x){this.spinner.stop();this.handleError(x);window.openFile=null});"image"!==r.type.substring(0,5)&&"application/pdf"!==r.type||"image/svg"===r.type.substring(0,9)?t.readAsText(r):t.readAsDataURL(r)})(c[n])};EditorUi.prototype.openLocalFile=function(c,f,l,n,r,t,x){var B=this.getCurrentFile(),F=mxUtils.bind(this,-function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var D=mxUtils.parseXml(c);null!=D&&(this.editor.setGraphXml(D.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,f||this.defaultFilename,l,n,r,t));null!=x&&x()});if(null!=c&&0<c.length)if(null==B||!B.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=n||this.isDiagramEmpty()))F();else if((mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=B&&B.isModified())this.confirm(mxResources.get("allChangesLost"),-null,F,mxResources.get("cancel"),mxResources.get("discardChanges"));else{window.openFile=new OpenFile(function(){window.openFile=null});window.openFile.setData(c,f,l);var L=mxUtils.bind(this,function(){null!=B&&B.isModified()?this.confirm(mxResources.get("allChangesLost"),null,F,mxResources.get("cancel"),mxResources.get("discardChanges")):F()});"1"==urlParams.openInSameWin||navigator.standalone?L():this.showDialog((new PopupDialog(this,this.getUrl(),null,L)).container,340,140,!0,!0)}else throw Error(mxResources.get("notADiagramFile"));+B(L)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,f,n,null,null,null,x)}));else{if("image/png"==l.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==l.type){var G=Editor.extractGraphModelFromPdf(c);null!=G&&(r=null,n=!0,c=G)}this.spinner.stop();this.openLocalFile(c,f,n,r,null!=r?l:null,t,x)}}};EditorUi.prototype.openFiles=function(c,f,l){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=0;n<c.length;n++)mxUtils.bind(this,+function(r){var t=new FileReader;t.onload=mxUtils.bind(this,function(x){try{this.openFileHandle(x.target.result,r.name,r,f,null,null,l)}catch(B){this.handleError(B)}});t.onerror=mxUtils.bind(this,function(x){this.spinner.stop();this.handleError(x);window.openFile=null});"image"!==r.type.substring(0,5)&&"application/pdf"!==r.type||"image/svg"===r.type.substring(0,9)?t.readAsText(r):t.readAsDataURL(r)})(c[n])};EditorUi.prototype.openLocalFile=function(c,f,l,n,r,t,x){var B=this.getCurrentFile(),G=mxUtils.bind(this,+function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var D=mxUtils.parseXml(c);null!=D&&(this.editor.setGraphXml(D.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,f||this.defaultFilename,l,n,r,t));null!=x&&x()});if(null!=c&&0<c.length)if(null==B||!B.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=n||this.isDiagramEmpty()))G();else if((mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=B&&B.isModified())this.confirm(mxResources.get("allChangesLost"),+null,G,mxResources.get("cancel"),mxResources.get("discardChanges"));else{window.openFile=new OpenFile(function(){window.openFile=null});window.openFile.setData(c,f,l);var L=mxUtils.bind(this,function(){null!=B&&B.isModified()?this.confirm(mxResources.get("allChangesLost"),null,G,mxResources.get("cancel"),mxResources.get("discardChanges")):G()});"1"==urlParams.openInSameWin||navigator.standalone?L():this.showDialog((new PopupDialog(this,this.getUrl(),null,L)).container,340,140,!0,!0)}else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)this.updatePageRoot(this.pages[f]),this.addBasenamesForCell(this.pages[f].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);f=[];for(var l in c)f.push(l);return f};EditorUi.prototype.addBasenamesForCell=function(c,f){function l(x){if(null!=x){var B=x.lastIndexOf(".");0<B&&(x=x.substring(B+1,x.length));null==f[x]&&(f[x]=!0)}}var n=this.editor.graph,r=n.getCellStyle(c);l(mxStencilRegistry.getBasenameForStencil(r[mxConstants.STYLE_SHAPE]));n.model.isEdge(c)&&(l(mxMarker.getPackageForType(r[mxConstants.STYLE_STARTARROW])),l(mxMarker.getPackageForType(r[mxConstants.STYLE_ENDARROW])));r=n.model.getChildCount(c);for(var t=0;t<r;t++)this.addBasenamesForCell(n.model.getChildAt(c,t),f)};EditorUi.prototype.setGraphEnabled=function(c){this.diagramContainer.style.visibility=c?"":"hidden";this.formatContainer.style.visibility=this.diagramContainer.style.visibility;this.sidebarContainer.style.display=c?"":"none";this.hsplit.style.display=this.sidebarContainer.style.display;this.editor.graph.setEnabled(c);null!=this.tabContainer&&(this.tabContainer.style.visibility=this.diagramContainer.style.visibility);c||this.hideWindows();this.editor.graph.sizeDidChange();this.resetScrollbars()};EditorUi.prototype.fitInitialView=function(c){var f=this.editor.graph,l=this.currentPage;l=null!=l?l.getViewBox():null;var n=f.container;if(null!=l&&0<n.clientWidth&&0<n.clientHeight){c=n.clientWidth;var r=n.clientHeight,t=Math.min(c/l.width,r/l.height);f.zoomTo(null!=l.scale?Math.min(l.scale,t):t,null,null,mxUtils.hasScrollbars(n));mxUtils.hasScrollbars(n)&&(t=f.view.translate,f=f.view.scale,n.scrollLeft=(l.x+l.width/2+t.x)*f-c/2,n.scrollTop=(l.y+l.height/2+t.y)*f-r/2)}else this.initialFitDiagram(c)};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((this.embedMessageSource||window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))){var c=-!1;this.installMessageHandler(mxUtils.bind(this,function(f,l,n,r){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);Editor.fitDiagramOnLoad&&this.fitInitialView();if(r)try{var t=this.editor.graph;t.setGridEnabled(!1);t.pageVisible=!1;var x=t.model.cells,B;for(B in x){var F=x[B];null!=F&&null!=F.style&&(F.style+=";sketch=1;"+(-1==F.style.indexOf("fontFamily=")||--1<F.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(L){console.log(L)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=n?n:!1;this.updateUi();window.self===window.top||this.noAutoFocus||window.focus();null!=this.format&&+!1;this.installMessageHandler(mxUtils.bind(this,function(f,l,n,r){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);Editor.fitDiagramOnLoad&&this.fitInitialView();if(r)try{var t=this.editor.graph;t.setGridEnabled(!1);t.pageVisible=!1;var x=t.model.cells,B;for(B in x){var G=x[B];null!=G&&null!=G.style&&(G.style+=";sketch=1;"+(-1==G.style.indexOf("fontFamily=")||+-1<G.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(L){console.log(L)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=n?n:!1;this.updateUi();window.self===window.top||this.noAutoFocus||window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(c,f){null!=c?this.spinner.spin(document.body,mxResources.get("loading"))&&c.getPublicUrl(mxUtils.bind(this,function(l){this.spinner.stop();f(l)})):f(null)};EditorUi.prototype.createLoadMessage=function(c){var f=this.editor.graph,l=f.getGraphBounds(),n=f.view.scale,r=f.view.translate;return{event:c,pageVisible:f.pageVisible,translate:r,bounds:l,currentPage:this.getSelectedPageIndex(),scale:n,page:f.view.getBackgroundPageBounds(),modelBounds:{x:l.x/n-r.x,y:l.y/n-r.y,width:l.width/n,height:l.height/n},containerSize:{width:f.container.clientWidth,height:f.container.clientHeight,offsetWidth:f.container.offsetWidth,offsetHeight:f.container.offsetHeight}}};EditorUi.prototype.sendEmbeddedSvgExport=function(c){try{var f=this.editor.graph;f.isEditing()&&f.stopEditing(!f.isInvokesStopCellEditing());var l=this.embedMessageSource||window.opener||window.parent;if(this.editor.modified){var n=f.background;if(null==n||n==mxConstants.NONE)n=this.embedExportBackground;this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),f,null,!0,mxUtils.bind(this,function(r){l.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,exit:null!=c?!c:!0,data:Editor.createSvgDataUri(r)}),@@ -14260,8 +14264,8 @@ function(c){try{var f=this.editor.graph;f.isEditing()&&f.stopEditing(!f.isInvokel){if(c())f();else var n=0,r=window.setInterval(function(){c()?(window.clearInterval(r),f()):100<=++n&&(window.clearInterval(r),null!=l&&l())},100)};EditorUi.prototype.lastLayoutSpec=null;EditorUi.prototype.resolveLayoutList=function(c){if("string"===typeof c){c=mxUtils.trim(c);if("["==c.charAt(0))return JSON.parse(c);if("undefined"===typeof LibavoidRouting||c!==LibavoidRouting.SHORTHAND&&c!==LibavoidRouting.LAYOUT_NAME){if("parallels"===c)return[{layout:"mxParallelEdgeLayout",config:{checkOverlap:!0}}];if("undefined"!==typeof ElkLayout&&null!=ElkLayout.MENU_PRESETS&&null!=ElkLayout.MENU_PRESETS[c]){c=ElkLayout.MENU_PRESETS[c];var f="layered"===c.algorithm?ElkLayout.CANONICAL_EDGE:{corners:(ElkLayout.CANONICAL_EDGE||{}).corners};return[{layout:Graph.elkLayoutNameForAlgorithm(c.algorithm),config:Graph.elkOptionsToConfig(c.options,f)}]}}else return[{layout:LibavoidRouting.LAYOUT_NAME}];return null}return"object"===typeof c?c:null};EditorUi.prototype.getSelectedLayoutContainer=function(){var c=this.editor.graph,f=1==c.getSelectionCount()?c.getSelectionCell():null;return null!=f&&c.model.isVertex(f)&&(c=c.getCellStyle(f).childLayout,null!=c&&"tableLayout"!=c&&"stackLayout"!=c&&"rack"!=c)?f:null};EditorUi.prototype.setContainerChildLayout=function(c,f){var l=this.editor.graph,n=f,r=null,t=null;if("string"!==typeof f){if(!Array.isArray(f)||0==f.length)throw Error("Invalid layout list: "+JSON.stringify(f));n=[];for(var x=0;x<f.length;x++){var B=f[x];if(null!=B&&("mxRadialTreeLayout"==B.layout||"mxOrgChartLayout"==-B.layout||"mxFastOrganicLayout"==B.layout||"mxCircleLayout"==B.layout))throw Error("Not supported as childLayout: "+B.layout);if(null!=B&&null!=Graph.elkLayoutAlgorithms[B.layout]){var F={},L;for(L in B.config)F[L]=B.config[L];delete F.rootCellIds;null==F.resizeNodes&&(F.resizeNodes=!1);null==F.resizeLayoutRoot&&(F.resizeLayoutRoot=!0);"elkLayered"==B.layout&&null==F.extractIsolated&&(F.extractIsolated=!1);null!=F.corners&&(t=F.corners);if(null!=F.groupPadding&&(r=String(F.groupPadding),/[;=]/.test(r)))throw Error("Invalid groupPadding: "+-r);B={layout:B.layout,config:F}}n.push(B)}l.createLayouts(n);n=Graph.encodeChildLayout(n)}if(0<=n.indexOf(";"))throw Error("Invalid childLayout: "+n);l.model.beginUpdate();try{var D=l.model.getStyle(c);l.setCellStyles("childLayout",n,[c]);null!=r&&l.setCellStyles("groupPadding",r,[c]);null!=t&&"undefined"!==typeof ElkLayout&&"function"===typeof ElkLayout.applyCorners&&ElkLayout.applyCorners(l,c,t);l.model.getStyle(c)==D&&null!=l.layoutManager&&l.layoutManager.executeLayout(c,!1)}finally{l.model.endUpdate()}};+B.layout||"mxFastOrganicLayout"==B.layout||"mxCircleLayout"==B.layout))throw Error("Not supported as childLayout: "+B.layout);if(null!=B&&null!=Graph.elkLayoutAlgorithms[B.layout]){var G={},L;for(L in B.config)G[L]=B.config[L];delete G.rootCellIds;null==G.resizeNodes&&(G.resizeNodes=!1);null==G.resizeLayoutRoot&&(G.resizeLayoutRoot=!0);"elkLayered"==B.layout&&null==G.extractIsolated&&(G.extractIsolated=!1);null!=G.corners&&(t=G.corners);if(null!=G.groupPadding&&(r=String(G.groupPadding),/[;=]/.test(r)))throw Error("Invalid groupPadding: "++r);B={layout:B.layout,config:G}}n.push(B)}l.createLayouts(n);n=Graph.encodeChildLayout(n)}if(0<=n.indexOf(";"))throw Error("Invalid childLayout: "+n);l.model.beginUpdate();try{var D=l.model.getStyle(c);l.setCellStyles("childLayout",n,[c]);null!=r&&l.setCellStyles("groupPadding",r,[c]);null!=t&&"undefined"!==typeof ElkLayout&&"function"===typeof ElkLayout.applyCorners&&ElkLayout.applyCorners(l,c,t);l.model.getStyle(c)==D&&null!=l.layoutManager&&l.layoutManager.executeLayout(c,!1)}finally{l.model.endUpdate()}};EditorUi.prototype.executeLayoutSpec=function(c,f,l){var n=this;this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout&&null!=ElkLayout.MENU_PRESETS},function(){try{var r=n.resolveLayoutList(c);if(null!=r){n.lastLayoutSpec=r;var t=l?n.getSelectedLayoutContainer():null;null!=t&&Array.isArray(r)&&0<r.length?(n.setContainerChildLayout(t,r),null!=f&&f()):n.executeLayouts(n.editor.graph.createLayouts(r),f)}else n.handleError(Error("Unknown layout: "+c))}catch(x){n.handleError(x)}},function(){n.handleError(Error(mxResources.get("serviceUnavailableOrBlocked")))})};EditorUi.prototype.installPassThroughKeys=function(){null!=Editor.passThroughKeys&&null==this.passThroughKeysListener&&(this.passThroughKeysListener=mxUtils.bind(this,function(c){for(var f=Editor.passThroughKeys,l=c.ctrlKey||c.metaKey,n=null!=c.key?c.key.toLowerCase():"",r=0;r<f.length;r++){var t=f[r];if(n===String(t.key).toLowerCase()&&l===!!t.ctrl&&c.shiftKey===!!t.shift&&c.altKey===!!t.alt){c.preventDefault();c.stopImmediatePropagation();null!=t.command&&(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"shortcut",command:t.command}),"*");break}}}),window.addEventListener("keydown",this.passThroughKeysListener,!0))};EditorUi.keyNames={8:"Backspace",9:"Tab",13:"Enter",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",109:"-",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",187:"+",189:"-"};EditorUi.prototype.installKeyboardShortcuts=@@ -14309,7 +14313,7 @@ window.opener||window.parent).postMessage(JSON.stringify(Ea),"*")}r=xa}),this.edf),this.addListener("guidesEnabledChanged",f),this.addListener("pageViewChanged",f));null!=T&&T();if("1"==urlParams.returnbounds||"json"==urlParams.proto){var ta=this.createLoadMessage("load");ta.xml=null!=N?ia():ea;this.embedDiffSync&&null!=this.pages&&(ta.checksum=this.getHashValueForPages(this.pages));B.postMessage(JSON.stringify(ta),"*")}});null!=N?this.executeLayoutSpec(N,ja):ja()});null!=D&&"function"===typeof D.substring&&"data:application/vnd.visio;base64,"==D.substring(0,34)?(R="0M8R4KGxGuE"==D.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(D.substring(D.indexOf(",")+1)),function(ea){ka(ea,L)},mxUtils.bind(this,function(ea){this.handleError(ea)}),R)):null!=D&&"function"===typeof D.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(D,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(D,mxUtils.bind(this,function(ea){4==ea.readyState&&(200<=ea.status&&299>=ea.status&&"<mxGraphModel"==ea.responseText.substring(0,13)?ka(ea.responseText,L):this.handleError({message:413==ea.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=D&&"function"===typeof D.substring&&this.isLucidChartData(D)?this.convertLucidChart(D,mxUtils.bind(this,function(ea){ka(ea)}),mxUtils.bind(this,function(ea){this.handleError(ea)})):null==D||"object"!==typeof D||null==D.format||null==D.data&&null==D.url?(D=R(D),ka(D,L)):this.loadDescriptor(D,mxUtils.bind(this,function(ea){ka(ia(),L)}),mxUtils.bind(this,-function(ea){this.handleError(ea,mxResources.get("errorLoadingFile"))}))}}));var B=this.embedMessageSource||window.opener||window.parent;x="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";B.postMessage(x,"*");if("json"==urlParams.proto){var F=this.editor.graph.openLink;this.editor.graph.openLink=function(L,D,T){F.apply(this,arguments);B.postMessage(JSON.stringify({event:"openLink",href:L,target:D,allowOpener:T}),"*")};Editor.suppressNewWindows&&document.addEventListener("click",+function(ea){this.handleError(ea,mxResources.get("errorLoadingFile"))}))}}));var B=this.embedMessageSource||window.opener||window.parent;x="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";B.postMessage(x,"*");if("json"==urlParams.proto){var G=this.editor.graph.openLink;this.editor.graph.openLink=function(L,D,T){G.apply(this,arguments);B.postMessage(JSON.stringify({event:"openLink",href:L,target:D,allowOpener:T}),"*")};Editor.suppressNewWindows&&document.addEventListener("click",mxUtils.bind(this,function(L){for(var D=mxEvent.getSource(L);null!=D&&"A"!=D.nodeName;)D=D.parentNode;if(null!=D){var T=D.getAttribute("href");null==T||"#"==T.charAt(0)||"javascript:"==T.substring(0,11)||this.editor.graph.isCustomLink(T)||(L.preventDefault(),this.editor.graph.openLink(T,D.getAttribute("target")))}}),!0)}};EditorUi.prototype.createEmbedButton=function(c,f,l,n){var r=document.createElement("button");r.className="geEmbedBtn geBtn";r.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(r,c);n&&r.classList.add("gePrimaryBtn");mxEvent.addListener(r,"click",f);return r};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,@@ -14319,25 +14323,25 @@ EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mnull,null,mxUtils.bind(this,function(l,n){var r=this.createLayoutAddSelect(n);l.appendChild(r);r=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var t=n.value;n.value=JSON.stringify(JSON.parse(t));n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?n.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));n.value=t}catch(x){this.handleError(x)}}));r.setAttribute("title","copy");r.className="geBtn";l.appendChild(r)}),!0,null,null,EditorUi.APPLY_LAYOUTS_SPEC_URL);this.showDialog(f.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));f.init()}))};EditorUi.APPLY_LAYOUTS_SPEC_URL="https://www.drawio.com/docs/reference/json-layout-specification/";EditorUi.prototype.scopeLayoutsToCells=function(c,f){for(var l={},n=0;n<f.length;n++)null!=f[n]&&(l[f[n].id]=!0);var r=function(t){return null!=t&&!0===l[t.id]};for(n=0;n<c.length;n++)f=c[n],"undefined"!==typeof ElkLayout&&f instanceofElkLayout||void 0!==f.cellFilter?f.cellFilter=r:"function"===typeof f.isVertexIgnored&&function(t){var x=t.isVertexIgnored;t.isVertexIgnored=function(B){return x.apply(this,arguments)||!r(B)}}(f)};EditorUi.prototype.createLayoutAddSelect=function(c){var f=this,l=document.createElement("select");l.className="geBtn";l.style.marginRight="8px";l.style.maxWidth="180px";var n=document.createElement("option");n.value="";mxUtils.write(n,mxResources.get("add")+"...");n.disabled=!0;n.selected=!0;l.appendChild(n);-var r=[];"undefined"!==typeof ElkLayout&&(n=function(x,B){var F=ElkLayout.MENU_PRESETS[x];return{label:x,kind:"elk",algo:F.algorithm,preset:F.options,layoutName:B}},r.push(n("verticalFlow","elkLayered")),r.push(n("horizontalFlow","elkLayered")),r.push(n("verticalTree","elkTree")),r.push(n("horizontalTree","elkTree")),r.push(n("radialTree","elkRadial")),r.push(n("organic","elkOrganic")));r.push({label:"orgChart",kind:"orgchart"});r.push({label:"circle",kind:"simple",layoutName:"mxCircleLayout",config:{}});+var r=[];"undefined"!==typeof ElkLayout&&(n=function(x,B){var G=ElkLayout.MENU_PRESETS[x];return{label:x,kind:"elk",algo:G.algorithm,preset:G.options,layoutName:B}},r.push(n("verticalFlow","elkLayered")),r.push(n("horizontalFlow","elkLayered")),r.push(n("verticalTree","elkTree")),r.push(n("horizontalTree","elkTree")),r.push(n("radialTree","elkRadial")),r.push(n("organic","elkOrganic")));r.push({label:"orgChart",kind:"orgchart"});r.push({label:"circle",kind:"simple",layoutName:"mxCircleLayout",config:{}});r.push({label:"parallels",kind:"simple",layoutName:"mxParallelEdgeLayout",config:{spacing:20,checkOverlap:!0}});"undefined"!==typeof LibavoidRouting&&r.push({label:"orthogonalRouting",kind:"simple",layoutName:LibavoidRouting.LAYOUT_NAME,config:{}});for(n=0;n<r.length;n++){var t=document.createElement("option");t.value=String(n);mxUtils.write(t,mxResources.get(r[n].label)+("elk"===r[n].kind||"orgchart"===r[n].kind?"...":""));l.appendChild(t)}mxEvent.addListener(l,"change",mxUtils.bind(this,function(){var x=-parseInt(l.value);l.selectedIndex=0;if(!(isNaN(x)||0>x||x>=r.length)){var B=r[x],F=c.value;if(0===mxUtils.trim(F).length)var L=[];else{try{L=JSON.parse(F)}catch(T){f.handleError(T);return}if(!Array.isArray(L)){f.handleError(Error(mxResources.get("error")+": expected JSON array"));return}}var D=mxUtils.bind(this,function(T){L.push(T);f.hideDialog();f.showCustomLayoutDialog(JSON.stringify(L,null,2))});x=mxUtils.bind(this,function(){f.hideDialog();f.showCustomLayoutDialog(F)});"elk"===B.kind?(f.hideDialog(),+parseInt(l.value);l.selectedIndex=0;if(!(isNaN(x)||0>x||x>=r.length)){var B=r[x],G=c.value;if(0===mxUtils.trim(G).length)var L=[];else{try{L=JSON.parse(G)}catch(T){f.handleError(T);return}if(!Array.isArray(L)){f.handleError(Error(mxResources.get("error")+": expected JSON array"));return}}var D=mxUtils.bind(this,function(T){L.push(T);f.hideDialog();f.showCustomLayoutDialog(JSON.stringify(L,null,2))});x=mxUtils.bind(this,function(){f.hideDialog();f.showCustomLayoutDialog(G)});"elk"===B.kind?(f.hideDialog(),ElkLayout.runWithDialog(f,B.algo,B.preset,mxResources.get(B.label),function(T,N){T=Graph.elkOptionsToConfig(T,N);D({layout:B.layoutName,config:T})},x)):"orgchart"===B.kind?(f.hideDialog(),f.showOrgChartConfigDialog(D,x)):D({layout:B.layoutName,config:B.config||{}})}}));return l};EditorUi.prototype.showOrgChartConfigDialog=function(c,f){var l=2,n=20,r=20,t=document.createElement("div"),x=function(R,P){var U=document.createElement("div");U.style.marginTop="6px";U.style.display="inline-block";U.style.width=-"180px";mxUtils.write(U,mxResources.get(R)+": ");t.appendChild(U);t.appendChild(P)},B=document.createElement("select");B.style.width="160px";B.style.boxSizing="border-box";for(var F=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],L=0;L<F.length;L++){var D=document.createElement("option");mxUtils.write(D,F[L]);D.value=L;+"180px";mxUtils.write(U,mxResources.get(R)+": ");t.appendChild(U);t.appendChild(P)},B=document.createElement("select");B.style.width="160px";B.style.boxSizing="border-box";for(var G=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],L=0;L<G.length;L++){var D=document.createElement("option");mxUtils.write(D,G[L]);D.value=L;2===L&&D.setAttribute("selected","selected");B.appendChild(D)}mxEvent.addListener(B,"change",function(){l=parseInt(B.value)});x("orgChartType",B);var T=document.createElement("input");T.type="number";T.value=n;T.style.width="160px";T.style.boxSizing="border-box";mxEvent.addListener(T,"change",function(){n=parseInt(T.value)});x("parentChildSpacing",T);var N=document.createElement("input");N.type="number";N.value=r;N.style.width="160px";N.style.boxSizing="border-box";mxEvent.addListener(N,"change",function(){r=parseInt(N.value)});x("siblingSpacing",N);f=new CustomDialog(this,t,function(){c({layout:"mxOrgChartLayout",config:{branchOptimizer:l,parentChildSpacing:n,siblingSpacing:r}})},f||null,mxResources.get("apply"),"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");this.showDialog(f.container,355,null,!0,!0)};EditorUi.prototype.loadOrgChartLayouts=function(c,f){this.createTimeout(null,mxUtils.bind(this,function(l){var n=mxUtils.bind(this,function(){this.loadingOrgChart=!1;l.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),r=mxUtils.bind(this,function(t){this.loadingOrgChart=!1;l.clear()&&this.handleError(t)});if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))n();else if(f||this.spinner.spin(document.body,mxResources.get("loading")))this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",-function(){mxscript("js/orgchart/mxOrgChartLayout.js",n,null,null,null,r)},null,null,null,r)},null,null,null,r)},null,null,null,r):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",n,null,null,null,r)}),onerror)};EditorUi.prototype.importCsv=function(c,f,l,n){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,l)}),n)};EditorUi.prototype.doImportCsv=function(c,f,l){try{var n=c.split("\n"),r=[],t=[],x=[],B={};if(0<n.length){var F={};l=null!=l?l:this.editor.graph;var L=null,+function(){mxscript("js/orgchart/mxOrgChartLayout.js",n,null,null,null,r)},null,null,null,r)},null,null,null,r)},null,null,null,r):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",n,null,null,null,r)}),onerror)};EditorUi.prototype.importCsv=function(c,f,l,n){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,l)}),n)};EditorUi.prototype.doImportCsv=function(c,f,l){try{var n=c.split("\n"),r=[],t=[],x=[],B={};if(0<n.length){var G={};l=null!=l?l:this.editor.graph;var L=null,D=null,T=null,N=null,R=null,P=null,U=null,S="whiteSpace=wrap;html=1;",z=null,g=null,p="",v="auto",C="auto",E=!1,I=null,O=null,Q=40,V=40,W=100,M=0,X=mxUtils.bind(this,function(){null!=f?f(ta):(l.setSelectionCells(ta),l.scrollCellToVisible(l.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),Z=l.getFreeInsertPoint(!0),Y=Z.x,aa=Z.y;Z=aa;var da=null,ba="auto";g=null;for(var ha=[],la=null,ra=null,sa=0;sa<n.length&&"#"==n[sa].charAt(0);){c=n[sa].replace(/\r$/,"");for(sa++;sa<n.length&&"\\"==c.charAt(c.length-1)&&"#"==n[sa].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(n[sa].substring(1)),sa++;if("#"!=c.charAt(1)){var va=c.indexOf(":");if(0<va){var wa=mxUtils.trim(c.substring(1,va)),qa=mxUtils.trim(c.substring(va+1));"label"==wa?da=Graph.sanitizeHtml(qa):"labelname"==wa&&0<qa.length&&"-"!=qa?R=qa:"labels"==wa&&0<qa.length&&"-"!=qa?U=JSON.parse(qa):"style"==wa?D=qa:"parentstyle"==wa?S=qa:"unknownStyle"==wa&&"-"!=qa?P=qa:"stylename"==wa&&0<qa.length&&"-"!=qa?N=qa:"styles"==wa&&0<qa.length&&"-"!=qa?T=JSON.parse(qa):"vars"==wa&&0<qa.length&&"-"!=qa?L=JSON.parse(qa):"identity"==wa&&0<qa.length&&"-"!=qa?z=qa:"parent"==wa&&0<qa.length&&"-"!=qa?g=qa:"namespace"==wa&&0<qa.length&&"-"!=qa?p=qa:"width"==wa?v=qa:"height"==wa?C=qa:"collapsed"==wa&&"-"!=qa?E="true"==qa:"left"==wa&&0<qa.length?I=qa:"top"==wa&&0<qa.length?O=qa:"ignore"==wa?ra=qa.split(","):"connect"==wa?ha.push(JSON.parse(qa)):"link"==wa?la=qa:"padding"==wa?M=parseFloat(qa):"edgespacing"==wa?Q=parseFloat(qa):"nodespacing"==wa?V=parseFloat(qa):"levelspacing"==wa?W=parseFloat(qa):"layout"==wa&&(ba=qa)}}}if(null==n[sa])throw Error(mxResources.get("invalidOrMissingFile"));var Ba=this.editor.csvToArray(n[sa].replace(/\r$/,""));va=c=null;wa=[];for(qa=0;qa<Ba.length;qa++)z==Ba[qa]&&(c=qa),g==Ba[qa]&&(va=qa),wa.push(mxUtils.trim(Ba[qa]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==da&&(da="%"+wa[0]+"%");if(null!=ha)for(var Aa=0;Aa<ha.length;Aa++)null==-F[ha[Aa].to]&&(F[ha[Aa].to]={});z=[];for(qa=sa+1;qa<n.length;qa++){var Da=this.editor.csvToArray(n[qa].replace(/\r$/,""));if(null==Da){var Ca=40<n[qa].length?n[qa].substring(0,40)+"...":n[qa];throw Error(Ca+" ("+qa+"):\n"+mxResources.get("containsValidationErrors"));}0<Da.length&&z.push(Da)}l.model.beginUpdate();try{for(qa=0;qa<z.length;qa++){Da=z[qa];var ca=null,fa=null!=c?p+Da[c]:null;n=!1;null!=fa&&(ca=l.model.getCell(fa),n=null==ca||0<=mxUtils.indexOf(r,ca));var oa=new mxCell(da,new mxGeometry(Y,+G[ha[Aa].to]&&(G[ha[Aa].to]={});z=[];for(qa=sa+1;qa<n.length;qa++){var Da=this.editor.csvToArray(n[qa].replace(/\r$/,""));if(null==Da){var Ca=40<n[qa].length?n[qa].substring(0,40)+"...":n[qa];throw Error(Ca+" ("+qa+"):\n"+mxResources.get("containsValidationErrors"));}0<Da.length&&z.push(Da)}l.model.beginUpdate();try{for(qa=0;qa<z.length;qa++){Da=z[qa];var ca=null,fa=null!=c?p+Da[c]:null;n=!1;null!=fa&&(ca=l.model.getCell(fa),n=null==ca||0<=mxUtils.indexOf(r,ca));var oa=new mxCell(da,new mxGeometry(Y,Z,0,0),D||"whiteSpace=wrap;html=1;");oa.collapsed=E;oa.vertex=!0;oa.id=fa;null==ca||n||l.model.setCollapsed(ca,E);for(var pa=0;pa<Da.length;pa++)l.setAttributeForCell(oa,wa[pa],Da[pa]),null==ca||n||l.setAttributeForCell(ca,wa[pa],Da[pa]);if(null!=R&&null!=U){var ua=U[oa.getAttribute(R)];null!=ua&&(l.labelChanged(oa,ua),null==ca||n||l.cellLabelChanged(ca,ua))}if(null!=N&&null!=T){var ya=T[oa.getAttribute(N)];null!=ya&&(oa.style=ya)}l.setAttributeForCell(oa,"placeholders","1");oa.style=l.replacePlaceholders(oa,-oa.style,L);null==ca||n?l.fireEvent(new mxEventObject("cellsInserted","cells",[oa])):(l.model.setStyle(ca,oa.style),0>mxUtils.indexOf(x,ca)&&x.push(ca),l.fireEvent(new mxEventObject("cellsInserted","cells",[ca])));n=null!=ca;ca=oa;if(!n)for(Aa=0;Aa<ha.length;Aa++)F[ha[Aa].to][ca.getAttribute(ha[Aa].to)]=ca;null!=la&&"link"!=la&&(l.setLinkForCell(ca,ca.getAttribute(la)),l.setAttributeForCell(ca,la,null));var ia=l.getPreferredSizeForCell(ca);g=null!=va?l.model.getCell(p+Da[va]):null;if(ca.vertex){Ca=+oa.style,L);null==ca||n?l.fireEvent(new mxEventObject("cellsInserted","cells",[oa])):(l.model.setStyle(ca,oa.style),0>mxUtils.indexOf(x,ca)&&x.push(ca),l.fireEvent(new mxEventObject("cellsInserted","cells",[ca])));n=null!=ca;ca=oa;if(!n)for(Aa=0;Aa<ha.length;Aa++)G[ha[Aa].to][ca.getAttribute(ha[Aa].to)]=ca;null!=la&&"link"!=la&&(l.setLinkForCell(ca,ca.getAttribute(la)),l.setAttributeForCell(ca,la,null));var ia=l.getPreferredSizeForCell(ca);g=null!=va?l.model.getCell(p+Da[va]):null;if(ca.vertex){Ca=null!=g?0:Y;sa=null!=g?0:aa;null!=I&&null!=ca.getAttribute(I)&&(ca.geometry.x=Ca+parseFloat(ca.getAttribute(I)));null!=O&&null!=ca.getAttribute(O)&&(ca.geometry.y=sa+parseFloat(ca.getAttribute(O)));var ka="@"==v.charAt(0)?ca.getAttribute(v.substring(1)):null;ca.geometry.width=null!=ka&&"auto"!=ka?parseFloat(ca.getAttribute(v.substring(1))):"auto"==v||"auto"==ka?ia.width+M:parseFloat(v);var ea="@"==C.charAt(0)?ca.getAttribute(C.substring(1)):null;ca.geometry.height=null!=ea&&"auto"!=ea&&"width"!=C?parseFloat(ea):"auto"==C||"auto"==ea?ia.height+M:"width"==C?ca.geometry.width:parseFloat(C);Z+=ca.geometry.height+V}n?(null==B[fa]&&(B[fa]=[]),B[fa].push(ca)):(r.push(ca),null!=g?(g.style=l.replacePlaceholders(g,S,L),l.addCell(ca,g),t.push(g)):x.push(l.addCell(ca)))}for(qa=0;qa<t.length;qa++)ka="@"==v.charAt(0)?t[qa].getAttribute(v.substring(1)):null,ea="@"==C.charAt(0)?t[qa].getAttribute(C.substring(1)):null,"auto"!=v&&"auto"!=ka||"auto"!=C&&"auto"!=ea||l.updateGroupBounds([t[qa]],M,!0);var ja=x.slice(),-ta=x.slice();for(Aa=0;Aa<ha.length;Aa++){var xa=ha[Aa];for(qa=0;qa<r.length;qa++){ca=r[qa];var Ea=mxUtils.bind(this,function(Wa,mb,Ua){var nb=mb.getAttribute(Ua.from);if(null!=nb&&""!=nb){nb=nb.split(",");for(var Hb=0;Hb<nb.length;Hb++){var jb=F[Ua.to][nb[Hb]];if(null==jb&&null!=P){jb=new mxCell(nb[Hb],new mxGeometry(Y,aa,0,0),P);jb.style=l.replacePlaceholders(mb,jb.style,L);var db=l.getPreferredSizeForCell(jb);jb.geometry.width=db.width+M;jb.geometry.height=db.height+M;F[Ua.to][nb[Hb]]=jb;jb.vertex=+ta=x.slice();for(Aa=0;Aa<ha.length;Aa++){var xa=ha[Aa];for(qa=0;qa<r.length;qa++){ca=r[qa];var Ea=mxUtils.bind(this,function(Wa,mb,Ua){var nb=mb.getAttribute(Ua.from);if(null!=nb&&""!=nb){nb=nb.split(",");for(var Hb=0;Hb<nb.length;Hb++){var jb=G[Ua.to][nb[Hb]];if(null==jb&&null!=P){jb=new mxCell(nb[Hb],new mxGeometry(Y,aa,0,0),P);jb.style=l.replacePlaceholders(mb,jb.style,L);var db=l.getPreferredSizeForCell(jb);jb.geometry.width=db.width+M;jb.geometry.height=db.height+M;G[Ua.to][nb[Hb]]=jb;jb.vertex=!0;jb.id=nb[Hb];x.push(l.addCell(jb))}if(null!=jb){db=Ua.label;null!=Ua.fromlabel&&(db=(mb.getAttribute(Ua.fromlabel)||"")+(db||""));null!=Ua.sourcelabel&&(db=l.replacePlaceholders(mb,Ua.sourcelabel,L)+(db||""));null!=Ua.tolabel&&(db=(db||"")+(jb.getAttribute(Ua.tolabel)||""));null!=Ua.targetlabel&&(db=(db||"")+l.replacePlaceholders(jb,Ua.targetlabel,L));var Ab="target"==Ua.placeholders==!Ua.invert?jb:Wa;Ab=null!=Ua.style?l.replacePlaceholders(Ab,Ua.style,L):l.createCurrentEdgeStyle();db=l.insertEdge(null,null,db||"",Ua.invert?jb:Wa,Ua.invert?Wa:jb,Ab);if(null!=Ua.labels)for(Ab=0;Ab<Ua.labels.length;Ab++){var vb=Ua.labels[Ab],Fb=new mxCell(vb.label||Ab,new mxGeometry(null!=vb.x?vb.x:0,null!=vb.y?vb.y:0,0,0),"resizable=0;html=1;");Fb.vertex=!0;Fb.connectable=!1;Fb.geometry.relative=!0;null!=vb.placeholders&&(Fb.value=l.replacePlaceholders("target"==vb.placeholders==!Ua.invert?jb:Wa,Fb.value,L));if(null!=vb.dx||null!=vb.dy)Fb.geometry.offset=new mxPoint(null!=vb.dx?vb.dx:0,null!=vb.dy?vb.dy:0);db.insert(Fb)}if(null!=Ua.data)for(var Fa in Ua.data)l.setAttributeForCell(db,Fa,Ua.data[Fa]);ta.push(db);mxUtils.remove(Ua.invert?Wa:jb,ja)}}}});Ea(ca,ca,xa);if(null!=B[ca.id])for(pa=0;pa<B[ca.id].length;pa++)Ea(ca,B[ca.id][pa],xa)}}if(null!=ra)for(qa=0;qa<r.length;qa++)for(ca=r[qa],pa=0;pa<ra.length;pa++)l.setAttributeForCell(ca,mxUtils.trim(ra[pa]),null);if(0<x.length){var Ha=new mxParallelEdgeLayout(l);Ha.spacing=Q;Ha.checkOverlap=!0;var Ja=function(){0<Ha.spacing&&Ha.execute(l.getDefaultParent());var Wa=0,mb=0;0<x.length&&@@ -14352,34 +14356,34 @@ EditorUi.prototype.getServiceCount=function(c){var f=1;null==this.drive&&"functic||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var l=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!l);this.actions.get("print").setEnabled(!l);this.menus.get("exportAs").setEnabled(!l);this.menus.get("embed").setEnabled(!l);l="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(l);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(l),this.menus.get("newLibrary").setEnabled(l));c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(f);this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f);this.actions.get("smartFit").setEnabled(f);this.actions.get("resetView").setEnabled(f);this.menus.get("edit").setEnabled(f);this.menus.get("view").setEnabled(f);this.menus.get("importFrom").setEnabled(c);this.menus.get("arrange").setEnabled(c);this.menus.get("edgeShape").setEnabled(c);this.menus.get("edgeStyle").setEnabled(c);this.menus.get("appearance").setEnabled(mxUtils.lightDarkColorSupported)};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};-EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var f=0;f<c.length;f++)this.libraryLoaded(c[f].file,c[f].images,c[f].title,null!=c[f].div?"none"!=c[f].div.style.display:c[f].expand)};var H=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){H.apply(this,arguments);var c=this.editor.graph,f=this.getCurrentFile(),l=this.getSelectionState(),n=this.isDiagramActive(),r="1"==urlParams.embed&&this.editor.graph.isEnabled()||+EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var f=0;f<c.length;f++)this.libraryLoaded(c[f].file,c[f].images,c[f].title,null!=c[f].div?"none"!=c[f].div.style.display:c[f].expand)};var F=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){F.apply(this,arguments);var c=this.editor.graph,f=this.getCurrentFile(),l=this.getSelectionState(),n=this.isDiagramActive(),r="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=f&&f.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&r);this.actions.get("redo").setEnabled(this.canRedo()&&r);this.actions.get("autosave").setEnabled(null!=f&&f.isEditable()&&f.isAutosaveOptional());this.actions.get("guides").setEnabled(n);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("explore").setEnabled(n&&(1==l.edges.length||1==l.vertices.length));this.actions.get("editConnectionPoints").setEnabled(n&&0==l.edges.length&&1==l.vertices.length);this.actions.get("editPolygon").setEnabled(n&&1==l.vertices.length&&"mxgraph.basic.polygon"==l.style[mxConstants.STYLE_SHAPE]);this.actions.get("editImage").setEnabled(n&&l.image&&0<l.cells.length);this.actions.get("crop").setEnabled(n&&l.image&&0<l.cells.length);this.actions.get("pageSetup").setEnabled(n);this.actions.get("shadowVisible").setEnabled(n);this.actions.get("connectionArrows").setEnabled(n);this.actions.get("connectionPoints").setEnabled(n);this.actions.get("copyStyle").setEnabled(n&&!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&n&&0<l.cells.length);this.actions.get("copyTextStyle").setEnabled(n&&!c.isSelectionEmpty());this.actions.get("pasteTextStyle").setEnabled(null!=this.copiedTextStyle&&n&&0<l.cells.length);this.actions.get("editGeometry").setEnabled(0<l.vertices.length&&!l.transparentBounds);this.actions.get("addToScratchpad").setEnabled(0<l.cells.length);this.actions.get("createShape").setEnabled(n);this.actions.get("createRevision").setEnabled(n);this.actions.get("moveToFolder").setEnabled(null!=f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(n&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=f&&!f.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.actions.get("properties").setEnabled(null!=f);this.menus.get("publish").setEnabled(null!=f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("none"!=this.diagramContainer.style.display);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(n&&-null!=c&&null!=c.shape&&null!=c.shape.stencil)};var G=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);G.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,l,n,r,t,x,B){var F=c.editor.graph;if("xml"==l)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");-else if("svg"==l)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(F.getSvg(n,r,t)),"image/svg+xml");else{var L=c.getFileData(!0,null,null,null,null,!0),D=F.getGraphBounds(),T=Math.floor(D.width*r/F.view.scale),N=Math.floor(D.height*r/F.view.scale);if(L.length<=MAX_REQUEST_SIZE&&T*N<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.editor.isExportToCanvas()){var R={globalVars:F.getExportVariables()};B&&(R.grid={size:F.gridSize,steps:F.view.gridSteps,color:F.view.gridColor});c.saveRequest(f,+null!=c&&null!=c.shape&&null!=c.shape.stencil)};var H=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);H.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,l,n,r,t,x,B){var G=c.editor.graph;if("xml"==l)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");+else if("svg"==l)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(G.getSvg(n,r,t)),"image/svg+xml");else{var L=c.getFileData(!0,null,null,null,null,!0),D=G.getGraphBounds(),T=Math.floor(D.width*r/G.view.scale),N=Math.floor(D.height*r/G.view.scale);if(L.length<=MAX_REQUEST_SIZE&&T*N<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.editor.isExportToCanvas()){var R={globalVars:G.getExportVariables()};B&&(R.grid={size:G.gridSize,steps:G.view.gridSteps,color:G.view.gridColor});c.saveRequest(f,l,function(P,U){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(U||"0")+(null!=P?"&filename="+encodeURIComponent(P):"")+"&extras="+encodeURIComponent(JSON.stringify(R))+(0<x?"&dpi="+x:"")+"&bg="+(null!=n?n:"none")+"&w="+T+"&h="+N+"&border="+t+"&xml="+encodeURIComponent(L))})}else"png"==l?c.exportImage(r,null==n||"none"==n,!0,!1,!1,t,!0,!1,null,B,x):c.exportImage(r,!1,!0,!1,!1,t,!0,!1,"jpeg",B);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var l=0;l<this.pages.length;l++){var n=c;this.currentPage!=this.pages[l]&&(n=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[l]),n.model.setRoot(this.pages[l].root));f+=this.pages[l].getName()+" "+n.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.writeJsonLabel=function(c,f,l){if(null!=f&&""!=f){if(this.editor.graph.isHtmlLabel(c)&&(c=document.createElement("div"),c.innerHTML=Graph.sanitizeHtml(f),0<c.getElementsByTagName("*").length)){l.label=mxUtils.trim(mxUtils.extractTextWithWhitespace([c]));l.html=f;return}l.label=f}};EditorUi.prototype.getJsonForExportCell=function(c,f){var l={id:c.getId()};l.type=f?"layer":c.edge?"edge":c.vertex?"node":"group";f||(f=c.getParent(),null!=f&&(l.parent=f.getId()));c.edge&&(null!=c.source&&(l.source=c.source.getId()),null!=c.target&&(l.target=c.target.getId()));f=c.value;if(null!=f&&mxUtils.isNode(f)){this.writeJsonLabel(c,f.getAttribute("label"),l);c=f.attributes;f={};for(var n=0,r=0;r<c.length;r++){var t=c[r].nodeName;"label"!=t&&"placeholders"!=t&&"id"!=t&&(f[t]=c[r].nodeValue,n++)}0<n&&(l.metadata=f)}else"string"===typeof f&&this.writeJsonLabel(c,f,l);return l};EditorUi.prototype.getJsonForPage=function(c,f){var l=this.editor.graph.getModel();var n=null==c||c==this.currentPage?l.getRoot():this.updatePageRoot(c).root;var r=[],t=mxUtils.bind(this,function(D,T){r.push(this.getJsonForExportCell(D,T));T=D.getChildCount();-for(var N=0;N<T;N++)t(D.getChildAt(N),!1)});if(null!=f){n={};for(var x=0;x<f.length;x++)n[f[x].getId()]=!0;for(x=0;x<f.length;x++){for(var B=f[x],F=B.getParent(),L=!1;null!=F;){if(n[F.getId()]){L=!0;break}F=F.getParent()}L||t(B,l.isLayer(B))}}else for(f=n.getChildCount(),x=0;x<f;x++)t(n.getChildAt(x),!0);x={};null!=c&&(x.id=c.getId(),x.name=c.getName());x.cells=r;return x};EditorUi.prototype.createJsonForExport=function(c,f,l,n){var r={version:EditorUi.VERSION};f&&(r.data=mxUtils.getXml(this.getXmlFileData(!n,+for(var N=0;N<T;N++)t(D.getChildAt(N),!1)});if(null!=f){n={};for(var x=0;x<f.length;x++)n[f[x].getId()]=!0;for(x=0;x<f.length;x++){for(var B=f[x],G=B.getParent(),L=!1;null!=G;){if(n[G.getId()]){L=!0;break}G=G.getParent()}L||t(B,l.isLayer(B))}}else for(f=n.getChildCount(),x=0;x<f;x++)t(n.getChildAt(x),!0);x={};null!=c&&(x.id=c.getId(),x.name=c.getName());x.cells=r;return x};EditorUi.prototype.createJsonForExport=function(c,f,l,n){var r={version:EditorUi.VERSION};f&&(r.data=mxUtils.getXml(this.getXmlFileData(!n,!c,!l)));f=[];if(n)f.push(this.getJsonForPage(this.currentPage,this.editor.graph.getSelectionCells()));else if(c&&null!=this.pages)for(c=0;c<this.pages.length;c++)f.push(this.getJsonForPage(this.pages[c]));else f.push(this.getJsonForPage(this.currentPage));r.pages=f;return r};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},l=document.createElement("div");l.style.whiteSpace="nowrap";var n=document.createElement("h3");mxUtils.write(n,mxUtils.htmlEntities(c));l.appendChild(n);var r=-document.createElement("div");r.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";r.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var t={};try{var x=mxSettings.getCustomLibraries();for(c=0;c<x.length;c++){var B=x[c];if("R"==B.substring(0,1)){var F=JSON.parse(decodeURIComponent(B.substring(1)));t[F[0]]={id:F[0],title:F[1],downloadUrl:F[2]}}}}catch(L){}this.remoteInvoke("getCustomLibraries",null,null,function(L){r.innerText="";+document.createElement("div");r.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";r.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var t={};try{var x=mxSettings.getCustomLibraries();for(c=0;c<x.length;c++){var B=x[c];if("R"==B.substring(0,1)){var G=JSON.parse(decodeURIComponent(B.substring(1)));t[G[0]]={id:G[0],title:G[1],downloadUrl:G[2]}}}}catch(L){}this.remoteInvoke("getCustomLibraries",null,null,function(L){r.innerText="";if(0==L.length)r.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var D=0;D<L.length;D++){var T=L[D];t[T.id]&&(f[T.id]=T);var N=this.addCheckbox(r,T.title,t[T.id]);(function(R,P){mxEvent.addListener(P,"change",function(){this.checked?f[R.id]=R:delete f[R.id]})})(T,N)}},mxUtils.bind(this,function(L){r.innerText="";var D=document.createElement("div");D.style.padding="8px";D.style.textAlign="center";mxUtils.write(D,mxResources.get("error")+": ");mxUtils.write(D,null!=L&&null!=L.message?L.message:mxResources.get("unknownError"));r.appendChild(D)}));l.appendChild(r);l=new CustomDialog(this,l,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var L=0,D;for(D in f)null==t[D]&&(L++,mxUtils.bind(this,function(T){this.remoteInvoke("getFileContent",[T.downloadUrl],null,mxUtils.bind(this,function(N){L--;0==L&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,N,T)),this.showSidebar()}catch(R){this.handleError(R,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){L--;0==L&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[D]));for(D in t)f[D]||this.closeLibrary(new RemoteLibrary(this,null,t[D]));0==L&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(l.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=c;for(var f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,l=this.remoteInvokeCallbacks[f.callbackId];if(null==l)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?l.error&&l.error(c.error.errResp):l.callback&&l.callback.apply(this,c.resp);this.remoteInvokeCallbacks[f.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,f,l,n,r){var t=!0,x=window.setTimeout(mxUtils.bind(this,function(){t=!1;r({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),B=mxUtils.bind(this,function(){window.clearTimeout(x);-t&&n.apply(this,arguments)}),F=mxUtils.bind(this,function(){window.clearTimeout(x);t&&r.apply(this,arguments)});l=l||{};l.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:B,error:F});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,f){var l=mxUtils.bind(this,function(L,D){var T={event:"remoteInvokeResponse",+t&&n.apply(this,arguments)}),G=mxUtils.bind(this,function(){window.clearTimeout(x);t&&r.apply(this,arguments)});l=l||{};l.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:B,error:G});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,f){var l=mxUtils.bind(this,function(L,D){var T={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=D?T.error={errResp:D}:null!=L&&(T.resp=L);this.remoteWin.postMessage(JSON.stringify(T),"*")});try{var n=c.funtionName,r=this.remoteInvokableFns[n];if(null!=r&&"function"===typeof this[n]){if(r.allowedDomains){for(var t=!1,x=0;x<r.allowedDomains.length;x++)if(f=="https://"+r.allowedDomains[x]){t=!0;break}if(!t){l(null,"Invalid Call: "+n+" is not allowed.");return}}var B=c.functionArgs;Array.isArray(B)||(B=[]);if(r.isAsync)B.push(function(){l(Array.prototype.slice.apply(arguments))}),-B.push(function(L){l(null,L||"Unkown Error")}),this[n].apply(this,B);else{var F=this[n].apply(this,B);l([F])}}else l(null,"Invalid Call: "+n+" is not found.")}catch(L){l(null,"Invalid Call: An error occurred, "+L.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=l)try{var n=l.open("database",2);n.onupgradeneeded=function(r){try{var t=n.result;1>r.oldVersion&&t.createObjectStore("objects",{keyPath:"key"});+B.push(function(L){l(null,L||"Unkown Error")}),this[n].apply(this,B);else{var G=this[n].apply(this,B);l([G])}}else l(null,"Invalid Call: "+n+" is not found.")}catch(L){l(null,"Invalid Call: An error occurred, "+L.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=l)try{var n=l.open("database",2);n.onupgradeneeded=function(r){try{var t=n.result;1>r.oldVersion&&t.createObjectStore("objects",{keyPath:"key"});2>r.oldVersion&&(t.createObjectStore("files",{keyPath:"title"}),t.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(x){null!=f&&f(x)}};n.onsuccess=mxUtils.bind(this,function(r){try{var t=n.result;this.database=t;EditorUi.migrateStorageFiles&&(StorageFile.migrate(t),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,-function(x){if((!x||"1"==urlParams.forceMigration)&&"1"==urlParams.forceMigration){var B=document.createElement("iframe");B.style.display="none";B.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(B);var F=!0,L=!1,D,T=0,N=mxUtils.bind(this,function(){L=!0;this.setDatabaseItem(".drawioMigrated3",!0);B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),R=mxUtils.bind(this,+function(x){if((!x||"1"==urlParams.forceMigration)&&"1"==urlParams.forceMigration){var B=document.createElement("iframe");B.style.display="none";B.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(B);var G=!0,L=!1,D,T=0,N=mxUtils.bind(this,function(){L=!0;this.setDatabaseItem(".drawioMigrated3",!0);B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),R=mxUtils.bind(this,function(){T++;P()}),P=mxUtils.bind(this,function(){try{if(T>=D.length)N();else{var S=D[T];StorageFile.getFileContent(this,S,mxUtils.bind(this,function(z){null==z||".scratchpad"==S&&z==this.emptyLibraryXml?B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[S]}),"*"):R()}),R)}}catch(z){console.log(z)}}),U=mxUtils.bind(this,function(S){try{this.setDatabaseItem(null,[{title:S.title,size:S.data.length,lastModified:Date.now(),type:S.isLib?-"L":"F"},{title:S.title,data:S.data}],R,R,["filesInfo","files"])}catch(z){console.log(z)}});x=mxUtils.bind(this,function(S){try{if(S.source==B.contentWindow){var z={};try{z=JSON.parse(S.data)}catch(g){}"init"==z.event?(B.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=z.event||L||(F?null!=z.resp&&0<z.resp.length&&null!=z.resp[0]?(D=z.resp[0],-F=!1,P()):N():null!=z.resp&&0<z.resp.length&&null!=z.resp[0]?U(z.resp[0]):R())}}catch(g){console.log(g)}});window.addEventListener("message",x)}})));c(t);t.onversionchange=function(){t.close()}}catch(x){null!=f?f(x):null!=window.console&&console.warn(x)}});n.onerror=f;n.onblocked=function(){}}catch(r){null!=f?f(r):null!=window.console&&console.error(r)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,f,l,n,r){this.openDatabase(mxUtils.bind(this,+"L":"F"},{title:S.title,data:S.data}],R,R,["filesInfo","files"])}catch(z){console.log(z)}});x=mxUtils.bind(this,function(S){try{if(S.source==B.contentWindow){var z={};try{z=JSON.parse(S.data)}catch(g){}"init"==z.event?(B.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=z.event||L||(G?null!=z.resp&&0<z.resp.length&&null!=z.resp[0]?(D=z.resp[0],+G=!1,P()):N():null!=z.resp&&0<z.resp.length&&null!=z.resp[0]?U(z.resp[0]):R())}}catch(g){console.log(g)}});window.addEventListener("message",x)}})));c(t);t.onversionchange=function(){t.close()}}catch(x){null!=f?f(x):null!=window.console&&console.warn(x)}});n.onerror=f;n.onblocked=function(){}}catch(r){null!=f?f(r):null!=window.console&&console.error(r)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,f,l,n,r){this.openDatabase(mxUtils.bind(this,function(t){try{r=r||"objects";Array.isArray(r)||(r=[r],c=[c],f=[f]);var x=t.transaction(r,"readwrite");x.oncomplete=l;x.onerror=n;for(t=0;t<r.length;t++)x.objectStore(r[t]).put(null!=c&&null!=c[t]?{key:c[t],data:f[t]}:f[t])}catch(B){null!=n&&n(B)}}),n)};EditorUi.prototype.removeDatabaseItem=function(c,f,l,n){this.openDatabase(mxUtils.bind(this,function(r){try{n=n||"objects";Array.isArray(n)||(n=[n],c=[c]);var t=r.transaction(n,"readwrite");t.oncomplete=f;t.onerror=l;for(r=0;r<n.length;r++)t.objectStore(n[r]).delete(c[r])}catch(x){null!=l&&l(x)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,f,l,n){this.openDatabase(mxUtils.bind(this,function(r){try{n=n||"objects";var t=r.transaction([n],"readonly").objectStore(n).get(c);t.onsuccess=function(){f(t.result)};t.onerror=l}catch(x){null!=l&&l(x)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(n){try{l=l||"objects";var r=n.transaction([l],"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),t=[];r.onsuccess=function(x){null==x.target.result?c(t):(t.push(x.target.result.value),x.target.result.continue())};r.onerror=f}catch(x){null!=f&&f(x)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(n){try{l=l||"objects";var r=n.transaction([l],"readonly").objectStore(l).getAllKeys();r.onsuccess=function(){c(r.result)};r.onerror=f}catch(t){null!=f&&f(t)}}),f)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};@@ -14387,7 +14391,7 @@ EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.newComment=function(c,f){var l=this.getCurrentFile();return null!=l?l.newComment(c,f):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,f){var l=this.getCurrentFile();null!=l&&l.getRevisions?l.getRevisions(c,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,l,n,r,t,x,B){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,l,n,r,t,x,B)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=-function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,l,n,r,t,x,B,F,L,D,T,N,R,P,U){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,l,n,r,t,x,B,F,L,D,T,N,R,P,U)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");+function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,l,n,r,t,x,B,G,L,D,T,N,R,P,U){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,l,n,r,t,x,B,G,L,D,T,N,R,P,U)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,l,n){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,l,n)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,f)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,f,l,n){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,l,n)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,l,n,r){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,f,l,n,r)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],f=0;f<localStorage.length;f++){var l=localStorage.key(f),n=localStorage.getItem(l);if(0<l.length&&(".scratchpad"==l||"."!=l.charAt(0))&&0<n.length){var r="<mxfile "===n.substring(0,8)||"<?xml"===n.substring(0,5)||"\x3c!--[if IE]>"===n.substring(0,12);n="<mxlibrary>"===n.substring(0,11);(r||n)&&c.push(l)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;@@ -14395,47 +14399,47 @@ var f=localStorage.getItem(c);return{title:c,data:f,isLib:"<mxlibrary>"===f.subsvar CommentsWindow=function(b,k,m,d,q,u){function y(){for(var P=x.getElementsByTagName("div"),U=0,S=0;S<P.length;S++)"none"!=P[S].style.display&&P[S].parentNode==x&&U++;B.style.display=0==U?"block":"none"}function A(P,U,S,z){function g(){U.removeChild(C);U.removeChild(E);v.style.display="block";p.style.display="block"}n={div:U,comment:P,saveCallback:S,deleteOnCancel:z};var p=U.querySelector(".geCommentTxt"),v=U.querySelector(".geCommentActionsList"),C=document.createElement("textarea");C.className="geCommentEditTxtArea";C.style.minHeight=p.offsetHeight+"px";C.value=P.content;U.insertBefore(C,p);var E=document.createElement("div");E.className="geCommentEditBtns";var I=mxUtils.button(mxResources.get("cancel"),function(){z?(U.parentNode.removeChild(U),y()):g();n=null});I.className="geCommentEditBtn";E.appendChild(I);var O=mxUtils.button(mxResources.get("save"),function(){p.innerText="";P.content=C.value;mxUtils.write(p,P.content);g();S(P);n=null});mxEvent.addListener(C,"keydown",mxUtils.bind(this,function(Q){mxEvent.isConsumed(Q)||((mxEvent.isControlDown(Q)||mxClient.IS_MAC&&mxEvent.isMetaDown(Q))&&13==Q.keyCode?(O.click(),mxEvent.consume(Q)):27==Q.keyCode&&(I.click(),mxEvent.consume(Q)))}));O.focus();O.className="geCommentEditBtn gePrimaryBtn";E.appendChild(O);U.insertBefore(E,p);v.style.display="none";p.style.display="none";C.focus()}function J(P,U){U.innerText="";P=new Date(P.modifiedDate);var S=b.timeSince(P);null==S&&(S=mxResources.get("lessThanAMinute"));mxUtils.write(U,mxResources.get("timeAgo",-[S],"{1} ago"));U.setAttribute("title",P.toLocaleDateString()+" "+P.toLocaleTimeString())}function K(P){var U=document.createElement("img");U.className="geCommentBusyImg";U.src=IMAGE_PATH+"/spin.gif";P.appendChild(U);P.busyImg=U}function H(P){P.style.border="1px solid red";P.busyImg.parentNode==P&&P.removeChild(P.busyImg)}function G(P){P.style.border="";P.busyImg.parentNode==P&&P.removeChild(P.busyImg)}function c(P,U,S,z,g){function p(W,M,X){var Z=document.createElement("li");Z.className="geCommentAction";+[S],"{1} ago"));U.setAttribute("title",P.toLocaleDateString()+" "+P.toLocaleTimeString())}function K(P){var U=document.createElement("img");U.className="geCommentBusyImg";U.src=IMAGE_PATH+"/spin.gif";P.appendChild(U);P.busyImg=U}function F(P){P.style.border="1px solid red";P.busyImg.parentNode==P&&P.removeChild(P.busyImg)}function H(P){P.style.border="";P.busyImg.parentNode==P&&P.removeChild(P.busyImg)}function c(P,U,S,z,g){function p(W,M,X){var Z=document.createElement("li");Z.className="geCommentAction";var Y=document.createElement("a");Y.className="geCommentActionLnk";mxUtils.write(Y,W);Z.appendChild(Y);mxEvent.addListener(Y,"click",function(aa){M(aa,P);aa.preventDefault();mxEvent.consume(aa)});V.appendChild(Z);X&&(Z.style.display="none")}function v(){function W(Z){M.push(X);if(null!=Z.replies)for(var Y=0;Y<Z.replies.length;Y++)X=X.nextSibling,W(Z.replies[Y])}var M=[],X=E;W(P);return{pdiv:X,replies:M}}function C(W,M,X,Z,Y){function aa(){K(la);P.addReply(ha,function(ra){ha.id=ra;P.replies.push(ha);-G(la);X&&X()},function(ra){da();H(la);b.handleError(ra,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},Z,Y)}function da(){A(ha,la,function(ra){aa()},!0)}var ba=v().pdiv,ha=b.newComment(W,b.getCurrentUser());ha.pCommentId=P.id;null==P.replies&&(P.replies=[]);var la=c(ha,P.replies,ba,z+1);M?da():aa()}if(g||!P.isResolved){B.style.display="none";var E=document.createElement("div");E.className="geCommentContainer";E.setAttribute("data-commentId",P.id);E.style.marginLeft=20*z+5++H(la);X&&X()},function(ra){da();F(la);b.handleError(ra,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},Z,Y)}function da(){A(ha,la,function(ra){aa()},!0)}var ba=v().pdiv,ha=b.newComment(W,b.getCurrentUser());ha.pCommentId=P.id;null==P.replies&&(P.replies=[]);var la=c(ha,P.replies,ba,z+1);M?da():aa()}if(g||!P.isResolved){B.style.display="none";var E=document.createElement("div");E.className="geCommentContainer";E.setAttribute("data-commentId",P.id);E.style.marginLeft=20*z+5+"px";P.isResolved&&(r.style.opacity="0.7");var I=document.createElement("div");I.className="geCommentHeader";var O=document.createElement("img");O.className="geCommentUserImg";O.src=null!=P.user&&null!=P.user.pictureUrl?P.user.pictureUrl:Editor.userImage;I.appendChild(O);O=document.createElement("div");O.className="geCommentHeaderTxt";I.appendChild(O);var Q=document.createElement("div");Q.className="geCommentUsername";mxUtils.write(Q,null!=P.user?P.user.displayName:mxResources.get("unknownUser"));O.appendChild(Q);Q=document.createElement("div");Q.className="geCommentDate";Q.setAttribute("data-commentId",P.id);J(P,Q);O.appendChild(Q);E.appendChild(I);I=document.createElement("div");I.className="geCommentTxt";mxUtils.write(I,P.content||"");E.appendChild(I);P.isLocked&&(E.style.opacity="0.5");I=document.createElement("div");I.className="geCommentActions";var V=document.createElement("ul");V.className="geCommentActionsList";I.appendChild(V);f||P.isLocked||0!=z&&!l||p(mxResources.get("reply"),-function(){C("",!0)},P.isResolved);O=b.getCurrentUser();null==O||null==P.user||O.id!=P.user.id||f||P.isLocked||(p(mxResources.get("edit"),function(){function W(){A(P,E,function(){K(E);P.editComment(P.content,function(){G(E)},function(M){H(E);W();b.handleError(M,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}W()},P.isResolved),p(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){K(E);P.deleteComment(function(W){if(!0===W){W=E.querySelector(".geCommentTxt");-W.innerText="";mxUtils.write(W,mxResources.get("msgDeleted"));var M=E.querySelectorAll(".geCommentAction");for(W=0;W<M.length;W++)M[W].parentNode.removeChild(M[W]);G(E);E.style.opacity="0.5"}else{M=v(P).replies;for(W=0;W<M.length;W++)x.removeChild(M[W]);for(W=0;W<U.length;W++)if(U[W]==P){U.splice(W,1);break}B.style.display=0==x.getElementsByTagName("div").length?"block":"none"}},function(W){H(E);b.handleError(W,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},P.isResolved));+function(){C("",!0)},P.isResolved);O=b.getCurrentUser();null==O||null==P.user||O.id!=P.user.id||f||P.isLocked||(p(mxResources.get("edit"),function(){function W(){A(P,E,function(){K(E);P.editComment(P.content,function(){H(E)},function(M){F(E);W();b.handleError(M,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}W()},P.isResolved),p(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){K(E);P.deleteComment(function(W){if(!0===W){W=E.querySelector(".geCommentTxt");+W.innerText="";mxUtils.write(W,mxResources.get("msgDeleted"));var M=E.querySelectorAll(".geCommentAction");for(W=0;W<M.length;W++)M[W].parentNode.removeChild(M[W]);H(E);E.style.opacity="0.5"}else{M=v(P).replies;for(W=0;W<M.length;W++)x.removeChild(M[W]);for(W=0;W<U.length;W++)if(U[W]==P){U.splice(W,1);break}B.style.display=0==x.getElementsByTagName("div").length?"block":"none"}},function(W){F(E);b.handleError(W,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},P.isResolved));f||P.isLocked||0!=z||p(P.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(W){function M(){var X=W.target;X.innerText="";P.isResolved=!P.isResolved;mxUtils.write(X,P.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var Z=P.isResolved?"none":"",Y=v(P).replies,aa="light-dark("+(P.isResolved?"ghostWhite":"white")+", transparent)",da=0;da<Y.length;da++){Y[da].style.backgroundColor=aa;for(var ba=Y[da].querySelectorAll(".geCommentAction"),ha=0;ha<ba.length;ha++)ba[ha]!=X.parentNode&&(ba[ha].style.display=Z);T||(Y[da].style.display="none")}y()}P.isResolved?C(mxResources.get("reOpened")+": ",!0,M,!1,!0):C(mxResources.get("markedAsResolved"),!1,M,!0)});E.appendChild(I);null!=S?x.insertBefore(E,S.nextSibling):x.appendChild(E);for(S=0;null!=P.replies&&S<P.replies.length;S++)I=P.replies[S],I.isResolved=P.isResolved,c(I,P.replies,null,z+1,g);null!=n&&(n.comment.id==P.id?(g=P.content,P.content=n.comment.content,A(P,E,n.saveCallback,n.deleteOnCancel),P.content=g):null==n.comment.id&&n.comment.pCommentId==P.id&&(x.appendChild(n.div),A(n.comment,n.div,n.saveCallback,n.deleteOnCancel)));return E}}var f=!b.canComment(),l=b.canReplyToReplies(),n=null,r=document.createElement("div");r.className="geCommentsWin";var t=EditorUi.compactUi?"26px":"30px",x=document.createElement("div");x.className="geCommentsList";x.style.bottom=parseInt(t)+7+"px";r.appendChild(x);var B=document.createElement("span");B.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(B,-mxResources.get("noCommentsFound"));var F=document.createElement("div");F.className="geToolbarContainer geCommentsToolbar";F.style.height=t;F.style.padding="3px 4px 4px 4px";t=document.createElement("a");t.className="geButton";if(!f){var L=t.cloneNode();L.style.backgroundImage="url("+Editor.plusImage+")";L.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(L,"click",function(P){function U(){A(S,z,function(g){K(z);b.addComment(g,function(p){g.id=p;N.push(g);G(z)},function(p){H(z);-U();b.handleError(p,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var S=b.newComment("",b.getCurrentUser()),z=c(S,N,null,0);U();P.preventDefault();mxEvent.consume(P)});F.appendChild(L)}var D=t.cloneNode();D.style.backgroundImage="url("+Editor.checkImage+")";D.setAttribute("title",mxResources.get("showResolved"));var T=!1;mxEvent.addListener(D,"click",function(P){(T=!T)?D.classList.add("geActiveItem"):D.classList.remove("geActiveItem");R();P.preventDefault();mxEvent.consume(P)});-F.appendChild(D);b.commentsRefreshNeeded()&&(L=t.cloneNode(),L.style.backgroundImage="url("+Editor.refreshImage+")",L.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(L,"click",function(P){R();P.preventDefault();mxEvent.consume(P)}),F.appendChild(L));b.commentsSaveNeeded()&&(t=t.cloneNode(),t.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',t.setAttribute("title",mxResources.get("save")),t.className="geButton geAdaptiveAsset",mxEvent.addListener(t,-"click",function(P){u();P.preventDefault();mxEvent.consume(P)}),F.appendChild(t));r.appendChild(F);var N=[],R=mxUtils.bind(this,function(){this.hasError=!1;if(null!=n)try{n.div=n.div.cloneNode(!0);var P=n.div.querySelector(".geCommentEditTxtArea"),U=n.div.querySelector(".geCommentEditBtns");n.comment.content=P.value;P.parentNode.removeChild(P);U.parentNode.removeChild(U)}catch(S){b.handleError(S)}x.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '++mxResources.get("noCommentsFound"));var G=document.createElement("div");G.className="geToolbarContainer geCommentsToolbar";G.style.height=t;G.style.padding="3px 4px 4px 4px";t=document.createElement("a");t.className="geButton";if(!f){var L=t.cloneNode();L.style.backgroundImage="url("+Editor.plusImage+")";L.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(L,"click",function(P){function U(){A(S,z,function(g){K(z);b.addComment(g,function(p){g.id=p;N.push(g);H(z)},function(p){F(z);+U();b.handleError(p,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var S=b.newComment("",b.getCurrentUser()),z=c(S,N,null,0);U();P.preventDefault();mxEvent.consume(P)});G.appendChild(L)}var D=t.cloneNode();D.style.backgroundImage="url("+Editor.checkImage+")";D.setAttribute("title",mxResources.get("showResolved"));var T=!1;mxEvent.addListener(D,"click",function(P){(T=!T)?D.classList.add("geActiveItem"):D.classList.remove("geActiveItem");R();P.preventDefault();mxEvent.consume(P)});+G.appendChild(D);b.commentsRefreshNeeded()&&(L=t.cloneNode(),L.style.backgroundImage="url("+Editor.refreshImage+")",L.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(L,"click",function(P){R();P.preventDefault();mxEvent.consume(P)}),G.appendChild(L));b.commentsSaveNeeded()&&(t=t.cloneNode(),t.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',t.setAttribute("title",mxResources.get("save")),t.className="geButton geAdaptiveAsset",mxEvent.addListener(t,+"click",function(P){u();P.preventDefault();mxEvent.consume(P)}),G.appendChild(t));r.appendChild(G);var N=[],R=mxUtils.bind(this,function(){this.hasError=!1;if(null!=n)try{n.div=n.div.cloneNode(!0);var P=n.div.querySelector(".geCommentEditTxtArea"),U=n.div.querySelector(".geCommentEditBtns");n.comment.content=P.value;P.parentNode.removeChild(P);U.parentNode.removeChild(U)}catch(S){b.handleError(S)}x.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";l=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(S){function z(g){if(null!=g){g.sort(function(v,C){return new Date(v.modifiedDate)-new Date(C.modifiedDate)});for(var p=0;p<g.length;p++)z(g[p].replies)}}S.sort(function(g,p){return new Date(g.modifiedDate)-new Date(p.modifiedDate)});x.innerText="";x.appendChild(B);B.style.display="block";N=S;for(S=0;S<N.length;S++)z(N[S].replies),c(N[S],N,null,0,T);null!=n&&null==n.comment.id&&-null==n.comment.pCommentId&&(x.appendChild(n.div),A(n.comment,n.div,n.saveCallback,n.deleteOnCancel))},mxUtils.bind(this,function(S){x.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(S&&S.message?": "+S.message:""));this.hasError=!0})):x.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});R();this.refreshComments=R;F=mxUtils.bind(this,function(){function P(p){var v=S[p.id];if(null!=v)for(J(p,v),v=0;null!=p.replies&&v<p.replies.length;v++)P(p.replies[v])}if(this.window.isVisible()){for(var U=-x.querySelectorAll(".geCommentDate"),S={},z=0;z<U.length;z++){var g=U[z];S[g.getAttribute("data-commentId")]=g}for(z=0;z<N.length;z++)P(N[z])}});setInterval(F,6E4);this.refreshCommentsTime=F;this.window=new mxWindow(mxResources.get("comments"),r,k,m,d,q,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,-function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,k,m,d,q,u,y,A,J,K,H){var G=document.createElement("div");G.style.textAlign="center";H=null!=H?H:44;var c=document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=H+"px";c.style.lineHeight="1.2em";mxUtils.write(c,k);G.appendChild(c);null!=K&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",k=document.createElement("img"),k.setAttribute("src",K),c.appendChild(k),-G.appendChild(c));K=document.createElement("div");K.style.textAlign="center";K.style.whiteSpace="nowrap";var f=document.createElement("input");f.setAttribute("type","checkbox");u=mxUtils.button(u||mxResources.get("cancel"),function(){b.hideDialog();null!=d&&d(f.checked)});u.className="geBtn";null!=A&&(u.innerHTML=A+"<br>"+u.innerHTML,u.style.display="inline-block",u.style.paddingBottom="8px",u.style.paddingTop="8px",u.style.height="auto",u.style.width="40%");b.editor.cancelFirst&&K.appendChild(u);-var l=mxUtils.button(q||mxResources.get("ok"),function(){b.hideDialog();null!=m&&m(f.checked)});K.appendChild(l);null!=y?(l.innerHTML=y+"<br>"+l.innerHTML+"<br>",l.style.display="inline-block",l.style.paddingBottom="8px",l.style.paddingTop="8px",l.style.height="auto",l.className="geBtn",l.style.width="40%"):l.className="geBtn gePrimaryBtn";b.editor.cancelFirst||K.appendChild(u);G.appendChild(K);J?(K.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom=-"0px",c.appendChild(f),q=document.createElement("span"),mxUtils.write(q," "+mxResources.get("rememberThisSetting")),c.appendChild(q),G.appendChild(c),mxEvent.addListener(q,"click",function(n){f.checked=!f.checked;mxEvent.consume(n)})):K.style.marginTop="12px";this.init=function(){l.focus()};this.container=G},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};-HeadlessEditorUi.prototype.addTrees=function(){};HeadlessEditorUi.prototype.onBeforeUnload=function(){};HeadlessEditorUi.prototype.updateActionStates=function(){};var DrawioConfigEditor={installCss:function(){if(null==document.getElementById("geConfigEditorStyle")){var b=document.createElement("style");b.id="geConfigEditorStyle";b.textContent=DrawioConfigEditor.css;document.head.appendChild(b)}},install:function(b,k){function m(){if("function"===typeof k.onConfigChanged)k.onConfigChanged(JSON.parse(JSON.stringify(F)))}function d(v){var C=document.createElement("div");C.appendChild(document.createTextNode(v));return C.innerHTML}function q(v){return b.querySelector(v)}-function u(v){var C=q("#"+v+"-tags"),E="";L[v].forEach(function(I,O){E+='<span class="tag"><span>'+d(I)+'</span><button type="button" class="tag__remove" data-list="'+v+'" data-index="'+O+'">×</button></span>'});C.innerHTML=E;C.querySelectorAll(".tag__remove").forEach(function(I){I.addEventListener("click",function(){L[I.getAttribute("data-list")].splice(parseInt(I.getAttribute("data-index")),1);y(I.getAttribute("data-list"));u(I.getAttribute("data-list"))})})}function y(v){0<L[v].length?F[v]=-L[v].slice():delete F[v];m()}function A(v){function C(){var I=E.value.trim();I&&(L[v].push(I),E.value="",y(v),u(v))}var E=q("#"+v+"-input");q("#"+v+"-add").addEventListener("click",C);E.addEventListener("keydown",function(I){"Enter"===I.key&&(I.preventDefault(),C())});u(v)}function J(v){var C=q("#"+v+"-list");C.innerHTML="";D[v].forEach(function(E,I){var O="none"===E||"null"===E,Q=document.createElement("div");Q.className="color-swatch";Q.title=O?E:"#"+E;O?Q.style.cssText="background: transparent; background-image: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%), linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%); background-size: 8px 8px; background-position: 0 0, 4px 4px;":+null==n.comment.pCommentId&&(x.appendChild(n.div),A(n.comment,n.div,n.saveCallback,n.deleteOnCancel))},mxUtils.bind(this,function(S){x.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(S&&S.message?": "+S.message:""));this.hasError=!0})):x.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});R();this.refreshComments=R;G=mxUtils.bind(this,function(){function P(p){var v=S[p.id];if(null!=v)for(J(p,v),v=0;null!=p.replies&&v<p.replies.length;v++)P(p.replies[v])}if(this.window.isVisible()){for(var U=+x.querySelectorAll(".geCommentDate"),S={},z=0;z<U.length;z++){var g=U[z];S[g.getAttribute("data-commentId")]=g}for(z=0;z<N.length;z++)P(N[z])}});setInterval(G,6E4);this.refreshCommentsTime=G;this.window=new mxWindow(mxResources.get("comments"),r,k,m,d,q,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,+function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,k,m,d,q,u,y,A,J,K,F){var H=document.createElement("div");H.style.textAlign="center";F=null!=F?F:44;var c=document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=F+"px";c.style.lineHeight="1.2em";mxUtils.write(c,k);H.appendChild(c);null!=K&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",k=document.createElement("img"),k.setAttribute("src",K),c.appendChild(k),+H.appendChild(c));K=document.createElement("div");K.style.textAlign="center";K.style.whiteSpace="nowrap";var f=document.createElement("input");f.setAttribute("type","checkbox");u=mxUtils.button(u||mxResources.get("cancel"),function(){b.hideDialog();null!=d&&d(f.checked)});u.className="geBtn";null!=A&&(u.innerHTML=A+"<br>"+u.innerHTML,u.style.display="inline-block",u.style.paddingBottom="8px",u.style.paddingTop="8px",u.style.height="auto",u.style.width="40%");b.editor.cancelFirst&&K.appendChild(u);+var l=mxUtils.button(q||mxResources.get("ok"),function(){b.hideDialog();null!=m&&m(f.checked)});K.appendChild(l);null!=y?(l.innerHTML=y+"<br>"+l.innerHTML+"<br>",l.style.display="inline-block",l.style.paddingBottom="8px",l.style.paddingTop="8px",l.style.height="auto",l.className="geBtn",l.style.width="40%"):l.className="geBtn gePrimaryBtn";b.editor.cancelFirst||K.appendChild(u);H.appendChild(K);J?(K.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom=+"0px",c.appendChild(f),q=document.createElement("span"),mxUtils.write(q," "+mxResources.get("rememberThisSetting")),c.appendChild(q),H.appendChild(c),mxEvent.addListener(q,"click",function(n){f.checked=!f.checked;mxEvent.consume(n)})):K.style.marginTop="12px";this.init=function(){l.focus()};this.container=H},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};+HeadlessEditorUi.prototype.addTrees=function(){};HeadlessEditorUi.prototype.onBeforeUnload=function(){};HeadlessEditorUi.prototype.updateActionStates=function(){};var DrawioConfigEditor={installCss:function(){if(null==document.getElementById("geConfigEditorStyle")){var b=document.createElement("style");b.id="geConfigEditorStyle";b.textContent=DrawioConfigEditor.css;document.head.appendChild(b)}},install:function(b,k){function m(){if("function"===typeof k.onConfigChanged)k.onConfigChanged(JSON.parse(JSON.stringify(G)))}function d(v){var C=document.createElement("div");C.appendChild(document.createTextNode(v));return C.innerHTML}function q(v){return b.querySelector(v)}+function u(v){var C=q("#"+v+"-tags"),E="";L[v].forEach(function(I,O){E+='<span class="tag"><span>'+d(I)+'</span><button type="button" class="tag__remove" data-list="'+v+'" data-index="'+O+'">×</button></span>'});C.innerHTML=E;C.querySelectorAll(".tag__remove").forEach(function(I){I.addEventListener("click",function(){L[I.getAttribute("data-list")].splice(parseInt(I.getAttribute("data-index")),1);y(I.getAttribute("data-list"));u(I.getAttribute("data-list"))})})}function y(v){0<L[v].length?G[v]=+L[v].slice():delete G[v];m()}function A(v){function C(){var I=E.value.trim();I&&(L[v].push(I),E.value="",y(v),u(v))}var E=q("#"+v+"-input");q("#"+v+"-add").addEventListener("click",C);E.addEventListener("keydown",function(I){"Enter"===I.key&&(I.preventDefault(),C())});u(v)}function J(v){var C=q("#"+v+"-list");C.innerHTML="";D[v].forEach(function(E,I){var O="none"===E||"null"===E,Q=document.createElement("div");Q.className="color-swatch";Q.title=O?E:"#"+E;O?Q.style.cssText="background: transparent; background-image: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%), linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%); background-size: 8px 8px; background-position: 0 0, 4px 4px;":Q.style.background="#"+E;if(!O){var V=document.createElement("input");V.type="color";V.className="color-swatch__picker";V.value="#"+(3===E.length?E[0]+E[0]+E[1]+E[1]+E[2]+E[2]:E.padEnd(6,"0"));V.addEventListener("input",function(W){return function(){var M=V.value.substring(1).toUpperCase();D[v][W]=M;Q.style.background="#"+M;Q.title="#"+M;K(v)}}(I));Q.appendChild(V)}E=document.createElement("button");E.className="color-swatch__delete";E.textContent="×";E.addEventListener("click",function(W){return function(M){M.stopPropagation();-D[v].splice(W,1);K(v);J(v)}}(I));Q.appendChild(E);C.appendChild(Q)})}function K(v){0<D[v].length?F[v]=D[v].slice():delete F[v];m()}function H(v){function C(){var Q=I.value.trim().replace(/^#/,"");"none"===Q||"null"===Q?(D[v].push(Q),I.value="",K(v),J(v)):/^[0-9A-Fa-f]{3,8}$/.test(Q)&&(D[v].push(Q.toUpperCase()),I.value="",K(v),J(v))}var E=q("#"+v+"-picker"),I=q("#"+v+"-input"),O=q("#"+v+"-add");E.addEventListener("input",function(){I.value=E.value.substring(1).toUpperCase()});O.addEventListener("click",-C);I.addEventListener("keydown",function(Q){"Enter"===Q.key&&(Q.preventDefault(),C())});J(v)}function G(v){var C=q("#"+v+"-editor");C.innerHTML="";N[v].forEach(function(E,I){var O=document.createElement("div");O.className="color-scheme-row";var Q=document.createElement("span");Q.className="color-scheme-row__label";Q.textContent=I+1;O.appendChild(Q);E.forEach(function(X,Z){if(null===X){var Y=document.createElement("span");Y.className="color-scheme-entry";Y.innerHTML='<span style="color: var(--color-text-secondary); font-style: italic;">default</span>';-var aa=document.createElement("button");aa.className="color-scheme-entry__remove";aa.textContent="×";aa.addEventListener("click",function(da,ba){return function(){N[v][da].splice(ba,1);c(v);G(v)}}(I,Z));Y.appendChild(aa);O.appendChild(Y)}else U.forEach(function(da){if(X[da]){var ba=document.createElement("span");ba.className="color-scheme-entry";var ha=document.createElement("span");ha.className="color-scheme-entry__swatch";ha.style.background=X[da];var la=document.createElement("input");la.type=+D[v].splice(W,1);K(v);J(v)}}(I));Q.appendChild(E);C.appendChild(Q)})}function K(v){0<D[v].length?G[v]=D[v].slice():delete G[v];m()}function F(v){function C(){var Q=I.value.trim().replace(/^#/,"");"none"===Q||"null"===Q?(D[v].push(Q),I.value="",K(v),J(v)):/^[0-9A-Fa-f]{3,8}$/.test(Q)&&(D[v].push(Q.toUpperCase()),I.value="",K(v),J(v))}var E=q("#"+v+"-picker"),I=q("#"+v+"-input"),O=q("#"+v+"-add");E.addEventListener("input",function(){I.value=E.value.substring(1).toUpperCase()});O.addEventListener("click",+C);I.addEventListener("keydown",function(Q){"Enter"===Q.key&&(Q.preventDefault(),C())});J(v)}function H(v){var C=q("#"+v+"-editor");C.innerHTML="";N[v].forEach(function(E,I){var O=document.createElement("div");O.className="color-scheme-row";var Q=document.createElement("span");Q.className="color-scheme-row__label";Q.textContent=I+1;O.appendChild(Q);E.forEach(function(X,Z){if(null===X){var Y=document.createElement("span");Y.className="color-scheme-entry";Y.innerHTML='<span style="color: var(--color-text-secondary); font-style: italic;">default</span>';+var aa=document.createElement("button");aa.className="color-scheme-entry__remove";aa.textContent="×";aa.addEventListener("click",function(da,ba){return function(){N[v][da].splice(ba,1);c(v);H(v)}}(I,Z));Y.appendChild(aa);O.appendChild(Y)}else U.forEach(function(da){if(X[da]){var ba=document.createElement("span");ba.className="color-scheme-entry";var ha=document.createElement("span");ha.className="color-scheme-entry__swatch";ha.style.background=X[da];var la=document.createElement("input");la.type="color";la.value=X[da];la.addEventListener("input",function(va,wa,qa){return function(){N[v][va][wa][qa]=la.value;ha.style.background=la.value;c(v)}}(I,Z,da));ha.appendChild(la);var ra=document.createElement("span");ra.className="color-scheme-entry__key";ra.textContent=da.charAt(0).toUpperCase();ra.title=da;var sa=document.createElement("button");sa.className="color-scheme-entry__remove";sa.textContent="×";sa.addEventListener("click",function(va,wa,qa){return function(){delete N[v][va][wa][qa];0===-Object.keys(N[v][va][wa]).filter(function(Ba){return-1<U.indexOf(Ba)}).length&&N[v][va].splice(wa,1);c(v);G(v)}}(I,Z,da));ba.appendChild(ha);ba.appendChild(ra);ba.appendChild(sa);O.appendChild(ba)}})});E=document.createElement("span");E.className="color-scheme-row__actions";Q=document.createElement("button");Q.className="color-scheme-row__btn";Q.textContent="+";Q.title="Add colour entry";Q.addEventListener("click",function(X){return function(){N[v][X].push({fill:"#dae8fc",stroke:"#6c8ebf"});c(v);-G(v)}}(I));var V=document.createElement("button");V.className="color-scheme-row__btn";V.textContent="ø";V.title="Add default (null) entry";V.addEventListener("click",function(X){return function(){N[v][X].unshift(null);c(v);G(v)}}(I));var W=document.createElement("button");W.className="color-scheme-row__btn";W.title="Add colour key to last entry";W.textContent="key";W.addEventListener("click",function(X){return function(){for(var Z=N[v][X],Y=null,aa=Z.length-1;0<=aa;aa--)if(null!==Z[aa]){Y=Z[aa];break}if(Y){Z=-null;for(aa=0;aa<U.length;aa++)if(!Y[U[aa]]){Z=U[aa];break}Z&&(Y[Z]="#888888",c(v),G(v))}}}(I));var M=document.createElement("button");M.className="color-scheme-row__btn";M.textContent="−";M.title="Remove row";M.addEventListener("click",function(X){return function(){N[v].splice(X,1);c(v);G(v)}}(I));E.appendChild(V);E.appendChild(Q);E.appendChild(W);E.appendChild(M);O.appendChild(E);C.appendChild(O)})}function c(v){0<N[v].length?F[v]=JSON.parse(JSON.stringify(N[v])):delete F[v];m()}function f(v){q("#"+-v+"-addRow").addEventListener("click",function(){N[v].push([null,{fill:"#f5f5f5",stroke:"#666666"}]);c(v);G(v)});G(v)}function l(v){var C=q("#"+v+"-tags"),E="";T[v].forEach(function(I,O){E+='<span class="tag"><span>'+d(I)+'</span><button type="button" class="tag__remove" data-list="'+v+'" data-index="'+O+'">×</button></span>'});C.innerHTML=E;C.querySelectorAll(".tag__remove").forEach(function(I){I.addEventListener("click",function(){T[I.getAttribute("data-list")].splice(parseInt(I.getAttribute("data-index")),-1);n(I.getAttribute("data-list"));l(I.getAttribute("data-list"))})})}function n(v){0<T[v].length?F[v]=T[v].slice():delete F[v];m()}function r(v){function C(){var I=E.value.trim();I&&(T[v].push(I),E.value="",n(v),l(v))}var E=q("#"+v+"-input");q("#"+v+"-add").addEventListener("click",C);E.addEventListener("keydown",function(I){"Enter"===I.key&&(I.preventDefault(),C())});l(v)}function t(v){v=v||{};F={};L={defaultFonts:[],customFonts:[]};D={presetColors:[],customPresetColors:[],defaultColors:[]};T={enabledLibraries:[],-defaultCustomLibraries:[],hideMenuItems:[],hideMenus:[]};N={defaultColorSchemes:[],customColorSchemes:[]};Object.keys(v).forEach(function(C){var E=v[C];"defaultFonts"===C||"customFonts"===C?Array.isArray(E)&&(L[C]=E.map(function(I){return"object"===typeof I?I.fontFamily||"":String(I)}),F[C]=E):"presetColors"===C||"customPresetColors"===C||"defaultColors"===C?Array.isArray(E)&&(D[C]=E.map(function(I){return I||""}),F[C]=E):"defaultColorSchemes"===C||"customColorSchemes"===C?Array.isArray(E)&&(N[C]=-JSON.parse(JSON.stringify(E)),F[C]=E):"enabledLibraries"===C||"defaultCustomLibraries"===C||"hideMenuItems"===C||"hideMenus"===C?Array.isArray(E)&&(T[C]=E.map(function(I){return String(I)}),F[C]=E):F[C]=E});x()}function x(){b.querySelectorAll("[data-key]").forEach(function(O){if(!O.closest(".tri-toggle")){var Q=O.getAttribute("data-key"),V="json"===O.getAttribute("data-type");O.value=void 0!==F[Q]?V?JSON.stringify(F[Q],null,2):F[Q]:""}});var v=q("#cfg-tooltipMaxWidth"),C=q("#cfg-tooltipMaxWidthEnabled");-if(void 0!==F.tooltipMaxWidth){var E=0<F.tooltipMaxWidth;C.checked=E;v.disabled=!E;v.value=E?F.tooltipMaxWidth:""}else C.checked=!0,v.disabled=!1,v.value="";F.pageFormat?(q("#cfg-pageFormatWidth").value=F.pageFormat.width||"",q("#cfg-pageFormatHeight").value=F.pageFormat.height||""):(q("#cfg-pageFormatWidth").value="",q("#cfg-pageFormatHeight").value="");v=F.darkColor||"";/^#[0-9A-Fa-f]{6}$/.test(v)&&(q("#cfg-darkColorPicker").value=v);v=F.shadowColor||"";/^#[0-9A-Fa-f]{6}$/.test(v)&&(q("#cfg-shadowColorPicker").value=-v);b.querySelectorAll(".tri-toggle").forEach(function(O){var Q=O.getAttribute("data-key");Q=F[Q];O.querySelectorAll("button").forEach(function(V){V.className=""});!0===Q?O.querySelector('[data-value="true"]').className="active--true":!1===Q?O.querySelector('[data-value="false"]').className="active--false":O.querySelector('[data-value="unset"]').className="active--unset"});["defaultFonts","customFonts"].forEach(u);["presetColors","customPresetColors","defaultColors"].forEach(J);["enabledLibraries",-"defaultCustomLibraries","hideMenuItems","hideMenus"].forEach(l);["defaultColorSchemes","customColorSchemes"].forEach(G);if(F.defaultMacroParameters){var I=F.defaultMacroParameters;I.toolbarStyle&&(q("#cfg-dmp-toolbarStyle").value=I.toolbarStyle);I.links&&(q("#cfg-dmp-links").value=I.links);I.width&&(q("#cfg-dmp-width").value=I.width);["border","lightbox","simpleViewer"].forEach(function(O){var Q=q("#cfg-dmp-"+O);void 0!==I[O]?(Q.checked=I[O],Q.indeterminate=!1,Q.dataset.cycleState=I[O]?"checked":+Object.keys(N[v][va][wa]).filter(function(Ba){return-1<U.indexOf(Ba)}).length&&N[v][va].splice(wa,1);c(v);H(v)}}(I,Z,da));ba.appendChild(ha);ba.appendChild(ra);ba.appendChild(sa);O.appendChild(ba)}})});E=document.createElement("span");E.className="color-scheme-row__actions";Q=document.createElement("button");Q.className="color-scheme-row__btn";Q.textContent="+";Q.title="Add colour entry";Q.addEventListener("click",function(X){return function(){N[v][X].push({fill:"#dae8fc",stroke:"#6c8ebf"});c(v);+H(v)}}(I));var V=document.createElement("button");V.className="color-scheme-row__btn";V.textContent="ø";V.title="Add default (null) entry";V.addEventListener("click",function(X){return function(){N[v][X].unshift(null);c(v);H(v)}}(I));var W=document.createElement("button");W.className="color-scheme-row__btn";W.title="Add colour key to last entry";W.textContent="key";W.addEventListener("click",function(X){return function(){for(var Z=N[v][X],Y=null,aa=Z.length-1;0<=aa;aa--)if(null!==Z[aa]){Y=Z[aa];break}if(Y){Z=+null;for(aa=0;aa<U.length;aa++)if(!Y[U[aa]]){Z=U[aa];break}Z&&(Y[Z]="#888888",c(v),H(v))}}}(I));var M=document.createElement("button");M.className="color-scheme-row__btn";M.textContent="−";M.title="Remove row";M.addEventListener("click",function(X){return function(){N[v].splice(X,1);c(v);H(v)}}(I));E.appendChild(V);E.appendChild(Q);E.appendChild(W);E.appendChild(M);O.appendChild(E);C.appendChild(O)})}function c(v){0<N[v].length?G[v]=JSON.parse(JSON.stringify(N[v])):delete G[v];m()}function f(v){q("#"++v+"-addRow").addEventListener("click",function(){N[v].push([null,{fill:"#f5f5f5",stroke:"#666666"}]);c(v);H(v)});H(v)}function l(v){var C=q("#"+v+"-tags"),E="";T[v].forEach(function(I,O){E+='<span class="tag"><span>'+d(I)+'</span><button type="button" class="tag__remove" data-list="'+v+'" data-index="'+O+'">×</button></span>'});C.innerHTML=E;C.querySelectorAll(".tag__remove").forEach(function(I){I.addEventListener("click",function(){T[I.getAttribute("data-list")].splice(parseInt(I.getAttribute("data-index")),+1);n(I.getAttribute("data-list"));l(I.getAttribute("data-list"))})})}function n(v){0<T[v].length?G[v]=T[v].slice():delete G[v];m()}function r(v){function C(){var I=E.value.trim();I&&(T[v].push(I),E.value="",n(v),l(v))}var E=q("#"+v+"-input");q("#"+v+"-add").addEventListener("click",C);E.addEventListener("keydown",function(I){"Enter"===I.key&&(I.preventDefault(),C())});l(v)}function t(v){v=v||{};G={};L={defaultFonts:[],customFonts:[]};D={presetColors:[],customPresetColors:[],defaultColors:[]};T={enabledLibraries:[],+defaultCustomLibraries:[],hideMenuItems:[],hideMenus:[]};N={defaultColorSchemes:[],customColorSchemes:[]};Object.keys(v).forEach(function(C){var E=v[C];"defaultFonts"===C||"customFonts"===C?Array.isArray(E)&&(L[C]=E.map(function(I){return"object"===typeof I?I.fontFamily||"":String(I)}),G[C]=E):"presetColors"===C||"customPresetColors"===C||"defaultColors"===C?Array.isArray(E)&&(D[C]=E.map(function(I){return I||""}),G[C]=E):"defaultColorSchemes"===C||"customColorSchemes"===C?Array.isArray(E)&&(N[C]=+JSON.parse(JSON.stringify(E)),G[C]=E):"enabledLibraries"===C||"defaultCustomLibraries"===C||"hideMenuItems"===C||"hideMenus"===C?Array.isArray(E)&&(T[C]=E.map(function(I){return String(I)}),G[C]=E):G[C]=E});x()}function x(){b.querySelectorAll("[data-key]").forEach(function(O){if(!O.closest(".tri-toggle")){var Q=O.getAttribute("data-key"),V="json"===O.getAttribute("data-type");O.value=void 0!==G[Q]?V?JSON.stringify(G[Q],null,2):G[Q]:""}});var v=q("#cfg-tooltipMaxWidth"),C=q("#cfg-tooltipMaxWidthEnabled");+if(void 0!==G.tooltipMaxWidth){var E=0<G.tooltipMaxWidth;C.checked=E;v.disabled=!E;v.value=E?G.tooltipMaxWidth:""}else C.checked=!0,v.disabled=!1,v.value="";G.pageFormat?(q("#cfg-pageFormatWidth").value=G.pageFormat.width||"",q("#cfg-pageFormatHeight").value=G.pageFormat.height||""):(q("#cfg-pageFormatWidth").value="",q("#cfg-pageFormatHeight").value="");v=G.darkColor||"";/^#[0-9A-Fa-f]{6}$/.test(v)&&(q("#cfg-darkColorPicker").value=v);v=G.shadowColor||"";/^#[0-9A-Fa-f]{6}$/.test(v)&&(q("#cfg-shadowColorPicker").value=+v);b.querySelectorAll(".tri-toggle").forEach(function(O){var Q=O.getAttribute("data-key");Q=G[Q];O.querySelectorAll("button").forEach(function(V){V.className=""});!0===Q?O.querySelector('[data-value="true"]').className="active--true":!1===Q?O.querySelector('[data-value="false"]').className="active--false":O.querySelector('[data-value="unset"]').className="active--unset"});["defaultFonts","customFonts"].forEach(u);["presetColors","customPresetColors","defaultColors"].forEach(J);["enabledLibraries",+"defaultCustomLibraries","hideMenuItems","hideMenus"].forEach(l);["defaultColorSchemes","customColorSchemes"].forEach(H);if(G.defaultMacroParameters){var I=G.defaultMacroParameters;I.toolbarStyle&&(q("#cfg-dmp-toolbarStyle").value=I.toolbarStyle);I.links&&(q("#cfg-dmp-links").value=I.links);I.width&&(q("#cfg-dmp-width").value=I.width);["border","lightbox","simpleViewer"].forEach(function(O){var Q=q("#cfg-dmp-"+O);void 0!==I[O]?(Q.checked=I[O],Q.indeterminate=!1,Q.dataset.cycleState=I[O]?"checked":"unchecked"):(Q.indeterminate=!0,Q.dataset.cycleState="indeterminate")})}}function B(v){if(v=v.trim().toLowerCase()){var C=v.split(/\s+/),E=new Set,I=new Set,O=0;g.forEach(function(Q){C.every(function(V){return-1<Q.keywords.indexOf(V)})&&(I.add(Q.element),E.add(Q.section),"section-title"!==Q.type&&O++)});b.querySelectorAll(".config-section").forEach(function(Q){Q.classList.toggle("search-hidden",!E.has(Q))});g.forEach(function(Q){if("section-title"!==Q.type&&E.has(Q.section)){var V=!1;g.forEach(function(W){"section-title"===-W.type&&W.section===Q.section&&I.has(W.element)&&(V=!0)});V?Q.element.classList.remove("search-hidden"):Q.element.classList.toggle("search-hidden",!I.has(Q.element))}});z.textContent=O+" result"+(1!==O?"s":"")}else b.querySelectorAll(".config-section, .toggle-field, .field, .field-row").forEach(function(Q){Q.classList.remove("search-hidden")}),z.textContent=""}k=k||{};DrawioConfigEditor.installCss();b.classList.add("geConfigEditor");b.innerHTML=DrawioConfigEditor.html;var F={},L={defaultFonts:[],+W.type&&W.section===Q.section&&I.has(W.element)&&(V=!0)});V?Q.element.classList.remove("search-hidden"):Q.element.classList.toggle("search-hidden",!I.has(Q.element))}});z.textContent=O+" result"+(1!==O?"s":"")}else b.querySelectorAll(".config-section, .toggle-field, .field, .field-row").forEach(function(Q){Q.classList.remove("search-hidden")}),z.textContent=""}k=k||{};DrawioConfigEditor.installCss();b.classList.add("geConfigEditor");b.innerHTML=DrawioConfigEditor.html;var G={},L={defaultFonts:[],customFonts:[]},D={presetColors:[],customPresetColors:[],defaultColors:[]},T={enabledLibraries:[],defaultCustomLibraries:[],hideMenuItems:[],hideMenus:[]},N={defaultColorSchemes:[],customColorSchemes:[]},R=k.editorContext||{},P={"general-toggles":[{key:"override",name:"Override",help:"Ignore user settings stored in the browser so the defaults in this configuration always apply"},{key:"compact",name:"Compact UI",help:"Enable compact user interface mode"},{key:"noAutoFocus",name:"No Auto Focus",help:"Disable auto-focus on startup"},{key:"showSplashOnStart",name:"Show Splash on Start",help:"Show the splash screen with storage options on startup"},{key:"updateDefaultStyle",name:"Update Default Style",help:"Update defaults when styles change"},{key:"mathOutputSize",name:"Math Output Size",help:"Size labels, view bounds and initial fit to the rendered math output instead of the formula source"},{key:"browserTranslate",name:"Browser Translate",help:"Mirror diagram text for browser translation engines (e.g. Chrome Translate)"}],"canvas-toggles":[{key:"defaultPageVisible",name:"Page Visible",help:"Show page outline on canvas"},{key:"defaultGridEnabled",name:"Grid Enabled",help:"Show grid on canvas"},{key:"defaultConnectable",name:"Default Connectable",help:"Shapes are connectable by default"},{key:"defaultConnectionArrowsEnabled",name:"Connection Arrows",help:"Show arrows when hovering connections"},{key:"copyOnConnect",name:"Copy on Connect",help:"Create a copy of the source shape for connections that end on the canvas"},{key:"defaultFoldingEnabled",name:"Folding Enabled",@@ -14445,47 +14449,47 @@ name:"Paste at Mouse",help:"Paste elements at mouse pointer location"},{key:"fit"appearance-toggles":[{key:"enableCssDarkMode",name:"CSS Dark Mode",help:"Use CSS for dark mode rendering"},{key:"enableLightDarkColors",name:"Light/Dark Colors",help:"Use CSS light-dark() color function"},{key:"enableAnimations",name:"Enable Animations",help:"Enable shape and layout animations"},{key:"insertAnimations",name:"Insert Animations",help:"Show pop animation when inserting shapes from the sidebar"}],"sidebar-toggles":[{key:"sidebarTitles",name:"Sidebar Titles",help:"Show titles in the sidebar"},{key:"expandLibraries",name:"Expand Libraries",help:"Libraries expanded by default"}],"library-toggles":[{key:"enableCustomLibraries",name:"Enable Custom Libraries",help:"Allow open and new library functions"},{key:"appendCustomLibraries",name:"Append Custom Libraries",help:"Custom libraries appear after built-in ones"}],"export-toggles":[{key:"compressXml",name:"Compress XML",help:"Compress XML output in saved files"},{key:"compressStyles",name:"Compress Styles",help:"Deduplicate repeated inline images and stencils into a shared lookup table. Only readable by draw.io 29.3.1 and later.",experimental:!0,helpLink:"https://www.drawio.com/docs/reference/style-compression/"},{key:"includeDiagram",name:"Include Diagram in Export",help:"Include diagram data in export dialogs"},{key:"enableExportUrl",name:"Enable Export URL",help:"Enable the export URL feature"},{key:"lockdown",name:"Lockdown",help:"Disable data transmission apart from storage"},{key:"restrictExport",name:"Restrict Export",help:"Disable exporting diagrams to other formats"},{key:"enableNativeClipboard",name:"Native Clipboard",-help:"Use native system clipboard"},{key:"replaceSvgDataUris",name:"Replace SVG Data URIs",help:"Replace data URIs with SVG sub-trees in export"},{key:"foreignObjectImages",name:"Foreign Object Images",help:"Replace foreignObject with images"},{key:"embedSvgFonts",name:"Embed SVG Fonts",help:"Embed fonts as data URIs in exported and saved SVG files, disable to keep external font references"},{key:"removeImageMetadata",name:"Remove Image Metadata",help:"Strip metadata from images"},{key:"expandPatternsForPrint",-name:"Expand Patterns for Print",help:"Expand patterns to visible graphics during print/PDF export"}],"advanced-toggles":[{key:"shareCursorPosition",name:"Share Cursor Position",help:"Share cursor in real-time collaboration"},{key:"showRemoteCursors",name:"Show Remote Cursors",help:"Display other users' cursors"},{key:"oneDriveInlinePicker",name:"OneDrive Inline Picker",help:"Use inline picker for OneDrive"},{key:"enableCustomGitLabUrl",name:"Enable Custom GitLab URL",help:"Allow ?gitlab= / ?gitlab-id= URL parameters to override the default GitLab server. Enable only for self-hosted GitLab deployments."}],-"embedding-toggles":[{key:"passiveScroll",name:"Passive Scroll",help:"Enable passive scroll event listeners"},{key:"noResizers",name:"No Resizers",help:"Hide shape resize handles"},{key:"preserveViewState",name:"Preserve View State",help:"Preserve view state in embed mode"},{key:"useInternalClipboard",name:"Use Internal Clipboard",help:"Use internal clipboard instead of native"}],"ai-toggles":[{key:"enableAi",name:"Enable AI",help:"Enable AI diagram generation"}],"confluence-cloud-toggles":[{key:"simpleViewer",-name:"Simple Viewer",help:"Use simple viewer for all diagrams"},{key:"disableVersioning",name:"Disable Versioning",help:"Disable diagram versioning"},{key:"hiResPreview",name:"Hi-Res Preview",help:"Generate high-resolution preview images"},{key:"autoCropViewer",name:"Auto Crop Viewer",help:"Auto-crop viewer to fit diagram bounds"},{key:"enableCssDarkMode",name:"CSS Dark Mode",help:"Enable CSS-based dark mode for viewer diagrams"},{key:"viewerCanExceedPageWidth",name:"Viewer Can Exceed Page Width",-help:"Allow the viewer to exceed the page width"},{key:"inplaceEdits",name:"In-place Edits",help:"Allow launching the editor from the viewer"},{key:"lockdown",name:"Lockdown",help:"Disable data transmission outside Confluence"},{key:"translateDiagrams",name:"Translate Diagrams",help:"Enable automatic translation of diagram labels"},{key:"generateSVGs",name:"Generate SVGs",help:"Generate SVG previews for diagrams"}],"confluence-toggles":[{key:"debug",name:"Debug",help:"Enable debug output"},{key:"inplaceEdits",-name:"In-place Edits",help:"Allow launching editor from viewer"},{key:"forceSimpleViewer",name:"Force Simple Viewer",help:"Force simple viewer for all diagrams"}]};if(null!=k.isDesktop?k.isDesktop:0<=navigator.userAgent.indexOf("Electron"))P["font-toggles"]=[{key:"enableLocalFonts",name:"Local Fonts",help:"Scan and list locally installed fonts in the font picker"}],P["desktop-toggles"]=[{key:"desktopAutoSync",name:"Desktop Auto Sync",help:"Auto-sync when local file changes"}];var U=["fill","stroke",-"gradient","font"],S=q("#searchInput"),z=q("#searchCount"),g=[],p;S.addEventListener("input",function(){clearTimeout(p);p=setTimeout(function(){B(S.value)},150)});S.addEventListener("keydown",function(v){"Escape"===v.key&&(S.value="",B(""),S.blur())});(function(){Object.keys(P).forEach(function(v){var C=q("#"+v);if(C){C.classList.add("toggle-list");var E="";P[v].forEach(function(I){E+='<div class="toggle-field"><div class="toggle-field__label"><span class="toggle-field__name">'+I.name+(I.experimental?-' <span class="toggle-field__experimental" title="Experimental feature">experimental</span>':"")+'</span><span class="toggle-field__help">'+I.help+" <code>"+I.key+"</code>"+(I.helpLink?' <a class="toggle-field__helplink" href="'+I.helpLink+'" target="_blank" rel="noopener" title="Learn more">?</a>':"")+'</span></div><div class="tri-toggle" data-key="'+I.key+'"><button type="button" data-value="unset" class="active--unset" title="Not set (use default)">—</button><button type="button" data-value="true" title="Enabled">On</button><button type="button" data-value="false" title="Disabled">Off</button></div></div>'});-C.innerHTML=E}});b.querySelectorAll(".tri-toggle").forEach(function(v){v.querySelectorAll("button").forEach(function(C){C.addEventListener("click",function(){var E=v.getAttribute("data-key"),I=C.getAttribute("data-value");v.querySelectorAll("button").forEach(function(O){O.className=""});C.className="active--"+I;"unset"===I?delete F[E]:F[E]="true"===I;m()})})})})();(function(){b.querySelectorAll("[data-key]").forEach(function(v){if(!v.classList.contains("tri-toggle")&&!v.closest(".tri-toggle")){var C=-v.getAttribute("data-key"),E="json"===v.getAttribute("data-type");v.addEventListener("input",function(){var I=v.value.trim();if(""===I)delete F[C];else if("number"===v.type)I=parseFloat(I),isNaN(I)||(F[C]=I);else if(E)try{F[C]=JSON.parse(I)}catch(O){}else F[C]=I;m()});"SELECT"===v.tagName&&v.addEventListener("change",function(){var I=v.value;""===I?delete F[C]:F[C]=I;m()})}})})();(function(){[{picker:"cfg-darkColorPicker",text:"cfg-darkColor"},{picker:"cfg-shadowColorPicker",text:"cfg-shadowColor"}].forEach(function(v){var C=-q("#"+v.picker),E=q("#"+v.text);C.addEventListener("input",function(){E.value=C.value.toUpperCase();E.dispatchEvent(new Event("input"))});E.addEventListener("input",function(){/^#[0-9A-Fa-f]{6}$/.test(E.value)&&(C.value=E.value)})})})();(function(){function v(){var I=parseInt(C.value),O=parseInt(E.value);isNaN(I)||isNaN(O)?""===C.value&&""===E.value&&delete F.pageFormat:F.pageFormat={width:I,height:O};m()}var C=q("#cfg-pageFormatWidth"),E=q("#cfg-pageFormatHeight");C.addEventListener("input",v);E.addEventListener("input",-v)})();(function(){function v(){C.disabled=!E.checked;if(E.checked){var I=parseInt(C.value);!isNaN(I)&&0<I?F.tooltipMaxWidth=I:delete F.tooltipMaxWidth}else F.tooltipMaxWidth=0;m()}var C=q("#cfg-tooltipMaxWidth"),E=q("#cfg-tooltipMaxWidthEnabled");E.addEventListener("change",v);C.addEventListener("input",v)})();A("defaultFonts");A("customFonts");H("presetColors");H("customPresetColors");H("defaultColors");r("enabledLibraries");r("defaultCustomLibraries");r("hideMenuItems");r("hideMenus");f("defaultColorSchemes");-f("customColorSchemes");(function(){function v(){var W={},M=!1;C.value&&(W.toolbarStyle=C.value,M=!0);E.value&&(W.links=E.value,M=!0);I.value&&(W.width=parseInt(I.value),M=!0);!1===O.indeterminate&&(W.border=O.checked,M=!0);!1===Q.indeterminate&&(W.lightbox=Q.checked,M=!0);!1===V.indeterminate&&(W.simpleViewer=V.checked,M=!0);M?F.defaultMacroParameters=W:delete F.defaultMacroParameters;m()}var C=q("#cfg-dmp-toolbarStyle"),E=q("#cfg-dmp-links"),I=q("#cfg-dmp-width"),O=q("#cfg-dmp-border"),Q=q("#cfg-dmp-lightbox"),+help:"Use native system clipboard"},{key:"replaceSvgDataUris",name:"Replace SVG Data URIs",help:"Replace data URIs with SVG sub-trees in export"},{key:"foreignObjectImages",name:"Foreign Object Images",help:"Replace foreignObject with images"},{key:"embedSvgFonts",name:"Embed SVG Fonts",help:"Default for embedding fonts as data URIs in exported and saved SVG files, can be overridden per file in the file properties"},{key:"removeImageMetadata",name:"Remove Image Metadata",help:"Strip metadata from images"},+{key:"expandPatternsForPrint",name:"Expand Patterns for Print",help:"Expand patterns to visible graphics during print/PDF export"}],"advanced-toggles":[{key:"shareCursorPosition",name:"Share Cursor Position",help:"Share cursor in real-time collaboration"},{key:"showRemoteCursors",name:"Show Remote Cursors",help:"Display other users' cursors"},{key:"oneDriveInlinePicker",name:"OneDrive Inline Picker",help:"Use inline picker for OneDrive"},{key:"enableCustomGitLabUrl",name:"Enable Custom GitLab URL",+help:"Allow ?gitlab= / ?gitlab-id= URL parameters to override the default GitLab server. Enable only for self-hosted GitLab deployments."}],"embedding-toggles":[{key:"passiveScroll",name:"Passive Scroll",help:"Enable passive scroll event listeners"},{key:"noResizers",name:"No Resizers",help:"Hide shape resize handles"},{key:"preserveViewState",name:"Preserve View State",help:"Preserve view state in embed mode"},{key:"useInternalClipboard",name:"Use Internal Clipboard",help:"Use internal clipboard instead of native"}],+"ai-toggles":[{key:"enableAi",name:"Enable AI",help:"Enable AI diagram generation"}],"confluence-cloud-toggles":[{key:"simpleViewer",name:"Simple Viewer",help:"Use simple viewer for all diagrams"},{key:"disableVersioning",name:"Disable Versioning",help:"Disable diagram versioning"},{key:"hiResPreview",name:"Hi-Res Preview",help:"Generate high-resolution preview images"},{key:"autoCropViewer",name:"Auto Crop Viewer",help:"Auto-crop viewer to fit diagram bounds"},{key:"enableCssDarkMode",name:"CSS Dark Mode",+help:"Enable CSS-based dark mode for viewer diagrams"},{key:"viewerCanExceedPageWidth",name:"Viewer Can Exceed Page Width",help:"Allow the viewer to exceed the page width"},{key:"inplaceEdits",name:"In-place Edits",help:"Allow launching the editor from the viewer"},{key:"lockdown",name:"Lockdown",help:"Disable data transmission outside Confluence"},{key:"translateDiagrams",name:"Translate Diagrams",help:"Enable automatic translation of diagram labels"},{key:"generateSVGs",name:"Generate SVGs",help:"Generate SVG previews for diagrams"}],+"confluence-toggles":[{key:"debug",name:"Debug",help:"Enable debug output"},{key:"inplaceEdits",name:"In-place Edits",help:"Allow launching editor from viewer"},{key:"forceSimpleViewer",name:"Force Simple Viewer",help:"Force simple viewer for all diagrams"}]};if(null!=k.isDesktop?k.isDesktop:0<=navigator.userAgent.indexOf("Electron"))P["font-toggles"]=[{key:"enableLocalFonts",name:"Local Fonts",help:"Scan and list locally installed fonts in the font picker"}],P["desktop-toggles"]=[{key:"desktopAutoSync",+name:"Desktop Auto Sync",help:"Auto-sync when local file changes"}];var U=["fill","stroke","gradient","font"],S=q("#searchInput"),z=q("#searchCount"),g=[],p;S.addEventListener("input",function(){clearTimeout(p);p=setTimeout(function(){B(S.value)},150)});S.addEventListener("keydown",function(v){"Escape"===v.key&&(S.value="",B(""),S.blur())});(function(){Object.keys(P).forEach(function(v){var C=q("#"+v);if(C){C.classList.add("toggle-list");var E="";P[v].forEach(function(I){E+='<div class="toggle-field"><div class="toggle-field__label"><span class="toggle-field__name">'++I.name+(I.experimental?' <span class="toggle-field__experimental" title="Experimental feature">experimental</span>':"")+'</span><span class="toggle-field__help">'+I.help+" <code>"+I.key+"</code>"+(I.helpLink?' <a class="toggle-field__helplink" href="'+I.helpLink+'" target="_blank" rel="noopener" title="Learn more">?</a>':"")+'</span></div><div class="tri-toggle" data-key="'+I.key+'"><button type="button" data-value="unset" class="active--unset" title="Not set (use default)">—</button><button type="button" data-value="true" title="Enabled">On</button><button type="button" data-value="false" title="Disabled">Off</button></div></div>'});+C.innerHTML=E}});b.querySelectorAll(".tri-toggle").forEach(function(v){v.querySelectorAll("button").forEach(function(C){C.addEventListener("click",function(){var E=v.getAttribute("data-key"),I=C.getAttribute("data-value");v.querySelectorAll("button").forEach(function(O){O.className=""});C.className="active--"+I;"unset"===I?delete G[E]:G[E]="true"===I;m()})})})})();(function(){b.querySelectorAll("[data-key]").forEach(function(v){if(!v.classList.contains("tri-toggle")&&!v.closest(".tri-toggle")){var C=+v.getAttribute("data-key"),E="json"===v.getAttribute("data-type");v.addEventListener("input",function(){var I=v.value.trim();if(""===I)delete G[C];else if("number"===v.type)I=parseFloat(I),isNaN(I)||(G[C]=I);else if(E)try{G[C]=JSON.parse(I)}catch(O){}else G[C]=I;m()});"SELECT"===v.tagName&&v.addEventListener("change",function(){var I=v.value;""===I?delete G[C]:G[C]=I;m()})}})})();(function(){[{picker:"cfg-darkColorPicker",text:"cfg-darkColor"},{picker:"cfg-shadowColorPicker",text:"cfg-shadowColor"}].forEach(function(v){var C=+q("#"+v.picker),E=q("#"+v.text);C.addEventListener("input",function(){E.value=C.value.toUpperCase();E.dispatchEvent(new Event("input"))});E.addEventListener("input",function(){/^#[0-9A-Fa-f]{6}$/.test(E.value)&&(C.value=E.value)})})})();(function(){function v(){var I=parseInt(C.value),O=parseInt(E.value);isNaN(I)||isNaN(O)?""===C.value&&""===E.value&&delete G.pageFormat:G.pageFormat={width:I,height:O};m()}var C=q("#cfg-pageFormatWidth"),E=q("#cfg-pageFormatHeight");C.addEventListener("input",v);E.addEventListener("input",+v)})();(function(){function v(){C.disabled=!E.checked;if(E.checked){var I=parseInt(C.value);!isNaN(I)&&0<I?G.tooltipMaxWidth=I:delete G.tooltipMaxWidth}else G.tooltipMaxWidth=0;m()}var C=q("#cfg-tooltipMaxWidth"),E=q("#cfg-tooltipMaxWidthEnabled");E.addEventListener("change",v);C.addEventListener("input",v)})();A("defaultFonts");A("customFonts");F("presetColors");F("customPresetColors");F("defaultColors");r("enabledLibraries");r("defaultCustomLibraries");r("hideMenuItems");r("hideMenus");f("defaultColorSchemes");+f("customColorSchemes");(function(){function v(){var W={},M=!1;C.value&&(W.toolbarStyle=C.value,M=!0);E.value&&(W.links=E.value,M=!0);I.value&&(W.width=parseInt(I.value),M=!0);!1===O.indeterminate&&(W.border=O.checked,M=!0);!1===Q.indeterminate&&(W.lightbox=Q.checked,M=!0);!1===V.indeterminate&&(W.simpleViewer=V.checked,M=!0);M?G.defaultMacroParameters=W:delete G.defaultMacroParameters;m()}var C=q("#cfg-dmp-toolbarStyle"),E=q("#cfg-dmp-links"),I=q("#cfg-dmp-width"),O=q("#cfg-dmp-border"),Q=q("#cfg-dmp-lightbox"),V=q("#cfg-dmp-simpleViewer");[O,Q,V].forEach(function(W){W.indeterminate=!0;W.dataset.cycleState="indeterminate";W.addEventListener("click",function(){"indeterminate"===W.dataset.cycleState?(W.checked=!0,W.indeterminate=!1,W.dataset.cycleState="checked"):"checked"===W.dataset.cycleState?(W.checked=!1,W.indeterminate=!1,W.dataset.cycleState="unchecked"):(W.checked=!1,W.indeterminate=!0,W.dataset.cycleState="indeterminate");v()});W.addEventListener("mousedown",function(M){M.preventDefault()})});C.addEventListener("change",v);E.addEventListener("change",v);I.addEventListener("input",v)})();(function(){[{btnId:"useCurrentVertexStyle",textareaId:"cfg-defaultVertexStyle",key:"currentVertexStyle"},{btnId:"useCurrentEdgeStyle",textareaId:"cfg-defaultEdgeStyle",key:"currentEdgeStyle"}].forEach(function(v){var C=R[v.key];if(null!=C&&"object"===typeof C&&0<Object.keys(C).length){var E=q("#"+v.btnId);E.style.display="";E.addEventListener("click",function(){var I=q("#"+v.textareaId);I.value=JSON.stringify(C,null,2);I.dispatchEvent(new Event("input"))})}})})();(function(){g=[];b.querySelectorAll(".toggle-field").forEach(function(v){var C=v.querySelector(".tri-toggle"),E=C?C.getAttribute("data-key"):"",I=v.querySelector(".toggle-field__name"),O=v.querySelector(".toggle-field__help");C=v.closest(".config-section");E=(E+" "+(I?I.textContent:"")+" "+(O?O.textContent:"")).toLowerCase();g.push({element:v,section:C,keywords:E,type:"toggle"})});b.querySelectorAll(".config-section .field").forEach(function(v){if(!v.parentElement.classList.contains("field-row")){var C=v.closest(".config-section"),E=v.textContent.toLowerCase();v.querySelectorAll("[data-key]").forEach(function(I){E+=" "+I.getAttribute("data-key")});g.push({element:v,section:C,keywords:E,type:"field"})}});b.querySelectorAll(".config-section .field-row").forEach(function(v){var C=v.closest(".config-section"),E=v.textContent.toLowerCase();v.querySelectorAll("[data-key]").forEach(function(I){E+=" "+I.getAttribute("data-key")});v.querySelectorAll("input, select, textarea").forEach(function(I){I.id&&(E+=-" "+I.id.replace("cfg-","").replace("cfg-dmp-",""))});g.push({element:v,section:C,keywords:E,type:"field-row"})});b.querySelectorAll(".config-section").forEach(function(v){var C=v.querySelector(".card__title");C&&g.push({element:v,section:v,keywords:C.textContent.toLowerCase(),type:"section-title"})})})();t(k.initialConfig||{});k.darkMode&&b.classList.add("dark");k.highContrast&&b.classList.add("high-contrast");return{setConfig:function(v){t(v||{})},getConfig:function(){return JSON.parse(JSON.stringify(F))},+" "+I.id.replace("cfg-","").replace("cfg-dmp-",""))});g.push({element:v,section:C,keywords:E,type:"field-row"})});b.querySelectorAll(".config-section").forEach(function(v){var C=v.querySelector(".card__title");C&&g.push({element:v,section:v,keywords:C.textContent.toLowerCase(),type:"section-title"})})})();t(k.initialConfig||{});k.darkMode&&b.classList.add("dark");k.highContrast&&b.classList.add("high-contrast");return{setConfig:function(v){t(v||{})},getConfig:function(){return JSON.parse(JSON.stringify(G))},setDarkMode:function(v){b.classList.toggle("dark",!!v)},setHighContrast:function(v){b.classList.toggle("high-contrast",!!v)}}},css:'.geConfigEditor {\n --drawio-blue: #29b6f2;\n --drawio-blue-hover: #1aa3e0;\n --color-bg: #f0f0f0;\n --color-bg-dark: #2a2a2a;\n --color-bg-secondary: #e4e4e4;\n --color-bg-secondary-dark: #333333;\n --color-bg-tertiary: #dadada;\n --color-bg-tertiary-dark: #3d3d3d;\n --color-input: #ffffff;\n --color-input-dark: #1e2022;\n --color-text: #3F3F3F;\n --color-text-dark: #C0C0C0;\n --color-text-secondary: #6c757d;\n --color-text-secondary-dark: #999999;\n --color-border: #dadada;\n --color-border-dark: #404040;\n --color-border-focus: var(--drawio-blue);\n --color-success: #198754;\n --color-error: #dc3545;\n --color-warning-bg: #fff3cd;\n --color-scrollbar: #e2e2e2;\n --color-scrollbar-dark: #3d3d3d;\n --color-scrollbar-hover: #959798;\n --color-scrollbar-hover-dark: #555555;\n --spacing-xs: 4px;\n --spacing-sm: 8px;\n --spacing-md: 12px;\n --spacing-lg: 16px;\n --radius-sm: 4px;\n --radius-md: 6px;\n --radius-lg: 8px;\n --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, ui-sans-serif, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";\n --font-family-mono: ui-monospace, SFMono-Regular, Consolas, monospace;\n --font-size-xs: 11px;\n --font-size-sm: 12px;\n --font-size-base: 13px;\n --transition-fast: 150ms ease;\n font-family: var(--font-family);\n font-size: var(--font-size-base);\n background: light-dark(var(--color-bg), var(--color-bg-dark));\n color: light-dark(var(--color-text), var(--color-text-dark));\n line-height: 1.5;\n overflow-y: auto;\n padding: 0 8px;\n}\n.geConfigEditor { box-sizing: border-box; margin: 0; }\n.geConfigEditor *, .geConfigEditor *::before, .geConfigEditor *::after { box-sizing: border-box; margin: 0; padding: 0; }\n.geConfigEditor.dark { color-scheme: dark; }\n.geConfigEditor::-webkit-scrollbar, .geConfigEditor ::-webkit-scrollbar { width: 10px; height: 10px; }\n.geConfigEditor::-webkit-scrollbar-track, .geConfigEditor ::-webkit-scrollbar-track { background-clip: padding-box; border: solid transparent; border-width: 1px; }\n.geConfigEditor::-webkit-scrollbar-corner, .geConfigEditor ::-webkit-scrollbar-corner { background-color: transparent; }\n.geConfigEditor::-webkit-scrollbar-thumb, .geConfigEditor ::-webkit-scrollbar-thumb { background-color: light-dark(var(--color-scrollbar), var(--color-scrollbar-dark)); background-clip: padding-box; border: solid transparent; border-radius: 4px; }\n.geConfigEditor::-webkit-scrollbar-thumb:hover, .geConfigEditor ::-webkit-scrollbar-thumb:hover { background-color: light-dark(var(--color-scrollbar-hover), var(--color-scrollbar-hover-dark)); }\n.geConfigEditor input[type="text"], .geConfigEditor input[type="url"], .geConfigEditor input[type="number"], .geConfigEditor textarea, .geConfigEditor select {\n font-family: inherit;\n font-size: var(--font-size-base);\n padding: 5px 8px;\n border: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n border-radius: var(--radius-md);\n background: light-dark(var(--color-input), var(--color-input-dark));\n color: light-dark(var(--color-text), var(--color-text-dark));\n width: 100%;\n transition: border-color var(--transition-fast);\n}\n.geConfigEditor input:focus, .geConfigEditor textarea:focus, .geConfigEditor select:focus {\n outline: none;\n border-color: var(--color-border-focus);\n box-shadow: 0 0 0 2px rgba(41, 182, 242, 0.15);\n}\n.geConfigEditor textarea { font-family: var(--font-family-mono); resize: vertical; min-height: 60px; }\n.geConfigEditor label { display: block; font-weight: 500; margin-bottom: 2px; font-size: var(--font-size-sm); }\n.geConfigEditor .btn {\n display: inline-flex; align-items: center; padding: 4px 8px;\n font-family: inherit; font-size: var(--font-size-xs); font-weight: 500;\n border: none; border-radius: var(--radius-md); cursor: pointer;\n}\n.geConfigEditor .btn--secondary { background: light-dark(var(--color-bg-tertiary), var(--color-bg-tertiary-dark)); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); }\n.geConfigEditor .btn--secondary:hover { background: light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor .btn--sm { padding: 3px 6px; font-size: var(--font-size-xs); }\n.geConfigEditor .btn-group { display: flex; flex-wrap: wrap; gap: 4px; }\n.geConfigEditor .card {\n background: light-dark(var(--color-bg), var(--color-bg-dark)); border: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--spacing-lg);\n}\n.geConfigEditor .card__header {\n padding: 6px var(--spacing-md); border-bottom: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n background: light-dark(var(--color-bg-secondary), var(--color-bg-secondary-dark));\n}\n.geConfigEditor .card__title { font-size: var(--font-size-base); font-weight: 600; margin: 0; }\n.geConfigEditor .card__body { padding: var(--spacing-md); display: flex; flex-direction: column; gap: var(--spacing-md); }\n.geConfigEditor .field { display: flex; flex-direction: column; gap: 2px; }\n.geConfigEditor .field__help { font-size: var(--font-size-xs); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); margin: 0; line-height: 1.3; }\n.geConfigEditor .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-md); }\n.geConfigEditor .toggle-field {\n display: flex; align-items: center; justify-content: space-between;\n padding: 4px 0; border-bottom: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n}\n.geConfigEditor .toggle-field:last-child { border-bottom: none; }\n.geConfigEditor .card__body > * + .toggle-list { border-top: 1px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor .toggle-field__label { display: flex; flex-direction: column; gap: 1px; flex: 1; margin-bottom: 0; }\n.geConfigEditor .toggle-field__name { font-weight: 500; font-size: var(--font-size-sm); }\n.geConfigEditor .toggle-field__help { font-size: var(--font-size-xs); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); }\n.geConfigEditor .toggle-field__experimental {\n display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 8px; vertical-align: middle;\n font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;\n color: light-dark(#8a5a00, #f0b429); background: light-dark(#fff3d6, rgba(240, 180, 41, 0.15));\n}\n.geConfigEditor .toggle-field__helplink {\n display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px;\n margin-left: 4px; border-radius: 50%; vertical-align: middle; text-decoration: none;\n font-size: 9px; font-weight: 700; line-height: 1;\n color: light-dark(#fff, #1a1a1a); background: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark));\n}\n.geConfigEditor .tri-toggle {\n display: inline-flex; border: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n border-radius: var(--radius-md); overflow: hidden; flex-shrink: 0;\n}\n.geConfigEditor .tri-toggle button {\n padding: 3px 8px; font-size: var(--font-size-xs); border: none;\n background: light-dark(var(--color-input), var(--color-input-dark)); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark));\n cursor: pointer; font-family: inherit; transition: all var(--transition-fast);\n}\n.geConfigEditor .tri-toggle button + button { border-left: 1px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor .tri-toggle button.active--unset { background: light-dark(var(--color-bg-tertiary), var(--color-bg-tertiary-dark)); color: light-dark(var(--color-text), var(--color-text-dark)); font-weight: 500; }\n.geConfigEditor .tri-toggle button.active--true { background: var(--color-success); color: #fff; font-weight: 500; }\n.geConfigEditor .tri-toggle button.active--false { background: var(--color-error); color: #fff; font-weight: 500; }\n.geConfigEditor .color-list { display: flex; flex-wrap: wrap; gap: 3px; padding: 4px 0; min-height: 24px; }\n.geConfigEditor .color-swatch {\n width: 22px; height: 22px; border-radius: var(--radius-sm);\n border: 1px solid light-dark(var(--color-border), var(--color-border-dark)); cursor: pointer; position: relative;\n transition: transform var(--transition-fast);\n}\n.geConfigEditor .color-swatch:hover { transform: scale(1.15); box-shadow: 0 0 0 2px var(--drawio-blue); }\n.geConfigEditor .color-swatch__delete {\n position: absolute; top: -5px; right: -5px; width: 12px; height: 12px;\n background: var(--color-error); color: #fff; border: none; border-radius: 50%;\n font-size: 9px; line-height: 12px; text-align: center; cursor: pointer; display: none; padding: 0;\n}\n.geConfigEditor .color-swatch:hover .color-swatch__delete { display: block; }\n.geConfigEditor .color-swatch__picker {\n position: absolute; top: 0; left: 0; width: 100%; height: 100%;\n opacity: 0; cursor: pointer; border: none; padding: 0;\n}\n.geConfigEditor .color-scheme-editor { display: flex; flex-direction: column; gap: 4px; }\n.geConfigEditor .color-scheme-row {\n display: flex; flex-wrap: wrap; gap: 3px; align-items: center;\n padding: 3px 6px; background: light-dark(var(--color-bg-secondary), var(--color-bg-secondary-dark));\n border: 1px solid light-dark(var(--color-border), var(--color-border-dark)); border-radius: var(--radius-sm);\n}\n.geConfigEditor .color-scheme-row__label { font-size: var(--font-size-xs); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); min-width: 20px; text-align: center; }\n.geConfigEditor .color-scheme-entry {\n display: flex; align-items: center; gap: 3px; padding: 1px 4px;\n background: light-dark(var(--color-bg), var(--color-bg-dark)); border: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n border-radius: var(--radius-sm); font-size: var(--font-size-xs);\n}\n.geConfigEditor .color-scheme-entry__swatch {\n width: 14px; height: 14px; border-radius: 2px;\n border: 1px solid light-dark(var(--color-border), var(--color-border-dark)); position: relative; cursor: pointer; flex-shrink: 0;\n}\n.geConfigEditor .color-scheme-entry__swatch input[type="color"] {\n position: absolute; top: 0; left: 0; width: 100%; height: 100%;\n opacity: 0; cursor: pointer; border: none; padding: 0;\n}\n.geConfigEditor .color-scheme-entry__key { color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); }\n.geConfigEditor .color-scheme-entry__remove {\n background: none; border: none; cursor: pointer;\n color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); font-size: 11px; padding: 0 1px; line-height: 1;\n}\n.geConfigEditor .color-scheme-entry__remove:hover { color: var(--color-error); }\n.geConfigEditor .color-scheme-row__actions { display: flex; gap: 2px; margin-left: auto; }\n.geConfigEditor .color-scheme-row__btn {\n background: none; border: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n border-radius: var(--radius-sm); cursor: pointer;\n font-size: var(--font-size-xs); padding: 1px 5px; color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark));\n}\n.geConfigEditor .color-scheme-row__btn:hover { background: light-dark(var(--color-bg-tertiary), var(--color-bg-tertiary-dark)); color: light-dark(var(--color-text), var(--color-text-dark)); }\n.geConfigEditor .tag-list { display: flex; flex-wrap: wrap; gap: 3px; }\n.geConfigEditor .tag {\n display: inline-flex; align-items: center; gap: 3px;\n padding: 1px 6px; background: light-dark(var(--color-bg-tertiary), var(--color-bg-tertiary-dark));\n border-radius: var(--radius-sm); font-size: var(--font-size-xs);\n}\n.geConfigEditor .tag__remove {\n background: none; border: none; cursor: pointer;\n color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); font-size: 13px; padding: 0 1px; line-height: 1;\n}\n.geConfigEditor .tag__remove:hover { color: var(--color-error); }\n.geConfigEditor .tag-input-wrap { display: flex; gap: 4px; margin-top: 4px; }\n.geConfigEditor .tag-input-wrap input { flex: 1; }\n.geConfigEditor .search-box { position: sticky; top: 0; z-index: 50; background: light-dark(var(--color-bg), var(--color-bg-dark)); padding: 6px 0 8px; }\n.geConfigEditor .search-box input { font-size: var(--font-size-base); padding: 6px 10px; }\n.geConfigEditor .search-box__count { font-size: var(--font-size-xs); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); margin-top: 2px; }\n.geConfigEditor .config-section.search-hidden, .geConfigEditor .toggle-field.search-hidden,\n.geConfigEditor .field.search-hidden, .geConfigEditor .field-row.search-hidden { display: none; }\n.geConfigEditor .mt-sm { margin-top: 4px; }\n.geConfigEditor .mb-sm { margin-bottom: 4px; }\n.geConfigEditor .checkbox { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }\n.geConfigEditor .checkbox input { width: auto; margin: 0; }\n@supports (scrollbar-color: auto) {\n .geConfigEditor { scrollbar-color: light-dark(var(--color-scrollbar), var(--color-scrollbar-dark)) transparent; scrollbar-width: thin; }\n}\n@media (prefers-contrast: more) {\n .geConfigEditor {\n --color-bg: #ffffff;\n --color-bg-dark: #000000;\n --color-bg-secondary: #e0e0e0;\n --color-bg-secondary-dark: #1a1a1a;\n --color-bg-tertiary: #cccccc;\n --color-bg-tertiary-dark: #2a2a2a;\n --color-input: #ffffff;\n --color-input-dark: #111111;\n --color-text: #000000;\n --color-text-dark: #ffffff;\n --color-text-secondary: #333333;\n --color-text-secondary-dark: #cccccc;\n --color-border: #666666;\n --color-border-dark: #999999;\n --color-success: #006633;\n --color-error: #cc0000;\n }\n .geConfigEditor input[type="text"], .geConfigEditor input[type="url"], .geConfigEditor input[type="number"], .geConfigEditor textarea, .geConfigEditor select {\n border: 2px solid light-dark(var(--color-border), var(--color-border-dark));\n }\n .geConfigEditor .tri-toggle { border: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n .geConfigEditor .tri-toggle button { font-weight: 600; }\n .geConfigEditor .tri-toggle button + button { border-left: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n .geConfigEditor .card { border: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n .geConfigEditor .card__header { border-bottom: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n .geConfigEditor .toggle-field { border-bottom: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n .geConfigEditor .card__body > * + .toggle-list { border-top: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n}\n.geConfigEditor.high-contrast {\n --color-bg: #ffffff;\n --color-bg-dark: #000000;\n --color-bg-secondary: #e0e0e0;\n --color-bg-secondary-dark: #1a1a1a;\n --color-bg-tertiary: #cccccc;\n --color-bg-tertiary-dark: #2a2a2a;\n --color-input: #ffffff;\n --color-input-dark: #111111;\n --color-text: #000000;\n --color-text-dark: #ffffff;\n --color-text-secondary: #333333;\n --color-text-secondary-dark: #cccccc;\n --color-border: #666666;\n --color-border-dark: #999999;\n --color-success: #006633;\n --color-error: #cc0000;\n}\n.geConfigEditor.high-contrast input[type="text"],\n.geConfigEditor.high-contrast input[type="url"],\n.geConfigEditor.high-contrast input[type="number"],\n.geConfigEditor.high-contrast textarea,\n.geConfigEditor.high-contrast select {\n border: 2px solid light-dark(var(--color-border), var(--color-border-dark));\n}\n.geConfigEditor.high-contrast .tri-toggle { border: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor.high-contrast .tri-toggle button { font-weight: 600; }\n.geConfigEditor.high-contrast .tri-toggle button + button { border-left: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor.high-contrast .card { border: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor.high-contrast .card__header { border-bottom: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor.high-contrast .toggle-field { border-bottom: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor.high-contrast .card__body > * + .toggle-list { border-top: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n@media (forced-colors: active) {\n .geConfigEditor input[type="text"], .geConfigEditor input[type="url"], .geConfigEditor input[type="number"], .geConfigEditor textarea, .geConfigEditor select {\n border: 2px solid ButtonText;\n background: Field;\n color: FieldText;\n }\n .geConfigEditor .card { border: 2px solid ButtonText; }\n .geConfigEditor .card__header { background: Canvas; border-bottom: 2px solid ButtonText; forced-color-adjust: none; }\n .geConfigEditor .tri-toggle { border: 2px solid ButtonText; }\n .geConfigEditor .tri-toggle button { background: ButtonFace; color: ButtonText; border-color: ButtonText; }\n .geConfigEditor .tri-toggle button.active--true,\n .geConfigEditor .tri-toggle button.active--false { background: Highlight; color: HighlightText; }\n .geConfigEditor .tri-toggle button.active--unset { background: ButtonFace; color: ButtonText; outline: 2px solid Highlight; outline-offset: -2px; }\n .geConfigEditor .btn--secondary { border: 1px solid ButtonText; }\n .geConfigEditor .toggle-field { border-bottom: 1px solid ButtonText; }\n .geConfigEditor .card__body > * + .toggle-list { border-top: 1px solid ButtonText; }\n .geConfigEditor .search-box { background: Canvas; }\n .geConfigEditor { background: Canvas; color: CanvasText; }\n}',html:'<div class="search-box" id="searchBox">\n <input type="text" id="searchInput" placeholder="Search settings (e.g. grid, font, dark mode, compressXml...)">\n <div class="search-box__count" id="searchCount"></div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">General</h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-version">Version</label>\n <input type="text" id="cfg-version" data-key="version" placeholder="e.g. 1.0">\n <p class="field__help">Configuration version identifier</p>\n </div>\n <div class="field">\n <label for="cfg-settingsName">Settings Name</label>\n <input type="text" id="cfg-settingsName" data-key="settingsName" placeholder=".drawio-config">\n <p class="field__help">Key for storing user settings in local storage</p>\n </div>\n </div>\n <div class="field">\n <label for="cfg-keyboardShortcuts">Keyboard Shortcuts (JSON)</label>\n <textarea id="cfg-keyboardShortcuts" data-key="keyboardShortcuts" data-type="json" placeholder=\'[{"keyCode": "T", "control": true, "shift": true, "action": "tags"}]\' style="min-height: 60px;"></textarea>\n <p class="field__help">Custom keyboard shortcuts. Entries are {keyCode, control, shift, alt, action} where keyCode is a key code or single character and action is an action name, or null to remove a binding.</p>\n </div>\n <div id="general-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Canvas & Grid</h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-defaultGridSize">Default Grid Size</label>\n <input type="number" id="cfg-defaultGridSize" data-key="defaultGridSize" placeholder="10" min="1">\n </div>\n <div class="field">\n <label for="cfg-gridSteps">Grid Steps</label>\n <input type="number" id="cfg-gridSteps" data-key="gridSteps" placeholder="e.g. 4" min="1">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-zoomFactor">Zoom Factor</label>\n <input type="number" id="cfg-zoomFactor" data-key="zoomFactor" placeholder="1.2" min="1.01" step="0.05">\n </div>\n <div class="field">\n <label for="cfg-defaultEdgeLength">Default Edge Length</label>\n <input type="number" id="cfg-defaultEdgeLength" data-key="defaultEdgeLength" placeholder="80" min="1">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-foldingIconSize">Folding Icon Size</label>\n <input type="number" id="cfg-foldingIconSize" data-key="foldingIconSize" placeholder="9" min="1">\n </div>\n <div class="field"></div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-tooltipFontSize">Tooltip Font Size (px)</label>\n <input type="number" id="cfg-tooltipFontSize" data-key="tooltipFontSize" placeholder="11" min="1">\n </div>\n <div class="field">\n <label for="cfg-tooltipMaxWidth">Tooltip Max Width (px)</label>\n <div style="display: flex; gap: 6px; align-items: center;">\n <input type="number" id="cfg-tooltipMaxWidth" placeholder="360" min="1" style="flex: 1;">\n <label class="checkbox" style="white-space: nowrap;"><input type="checkbox" id="cfg-tooltipMaxWidthEnabled"> <span>Limit</span></label>\n </div>\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-pageFormatWidth">Page Width (1/10 inch)</label>\n <input type="number" id="cfg-pageFormatWidth" placeholder="850" min="1">\n </div>\n <div class="field">\n <label for="cfg-pageFormatHeight">Page Height (1/10 inch)</label>\n <input type="number" id="cfg-pageFormatHeight" placeholder="1100" min="1">\n </div>\n </div>\n <p class="field__help">Page format: US Letter = 850 x 1100, A4 = 827 x 1169</p>\n <div id="canvas-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Appearance</h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-darkColor">Dark Mode Background</label>\n <div style="display: flex; gap: 6px; align-items: center;">\n <input type="color" id="cfg-darkColorPicker" value="#2A2A2A" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="cfg-darkColor" data-key="darkColor" placeholder="#2A2A2A" style="flex: 1;">\n </div>\n </div>\n <div class="field">\n <label for="cfg-defaultAdaptiveColors">Adaptive Colors</label>\n <select id="cfg-defaultAdaptiveColors" data-key="defaultAdaptiveColors">\n <option value="">- Not set -</option>\n <option value="auto">auto</option>\n <option value="simple">simple</option>\n <option value="none">none</option>\n </select>\n </div>\n </div>\n <div class="field">\n <label for="cfg-darkColorVar">Dark Color CSS Variable</label>\n <input type="text" id="cfg-darkColorVar" data-key="darkColorVar" placeholder="--ge-dark-color">\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-shadowColor">Shadow Color</label>\n <div style="display: flex; gap: 6px; align-items: center;">\n <input type="color" id="cfg-shadowColorPicker" value="#808080" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="cfg-shadowColor" data-key="shadowColor" placeholder="#808080" style="flex: 1;">\n </div>\n </div>\n <div class="field">\n <label for="cfg-shadowOpacity">Shadow Opacity</label>\n <input type="number" id="cfg-shadowOpacity" data-key="shadowOpacity" placeholder="1" min="0" max="1" step="0.1">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-shadowOffsetX">Shadow Offset X</label>\n <input type="number" id="cfg-shadowOffsetX" data-key="shadowOffsetX" placeholder="e.g. 2">\n </div>\n <div class="field">\n <label for="cfg-shadowOffsetY">Shadow Offset Y</label>\n <input type="number" id="cfg-shadowOffsetY" data-key="shadowOffsetY" placeholder="e.g. 3">\n </div>\n </div>\n <div class="field">\n <label for="cfg-shadowBlur">Shadow Blur</label>\n <input type="number" id="cfg-shadowBlur" data-key="shadowBlur" placeholder="e.g. 6" min="0">\n </div>\n <div id="appearance-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Sidebar & Panels</h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-thumbWidth">Thumbnail Width</label>\n <input type="number" id="cfg-thumbWidth" data-key="thumbWidth" placeholder="46" min="1">\n </div>\n <div class="field">\n <label for="cfg-thumbHeight">Thumbnail Height</label>\n <input type="number" id="cfg-thumbHeight" data-key="thumbHeight" placeholder="46" min="1">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-sidebarWidth">Sidebar Width</label>\n <input type="number" id="cfg-sidebarWidth" data-key="sidebarWidth" placeholder="e.g. 250" min="1">\n </div>\n <div class="field">\n <label for="cfg-sidebarTitleSize">Title Font Size (pt)</label>\n <input type="number" id="cfg-sidebarTitleSize" data-key="sidebarTitleSize" placeholder="8" min="1">\n </div>\n </div>\n <div class="field">\n <label for="cfg-shapePicker">Shape Picker (JSON)</label>\n <textarea id="cfg-shapePicker" data-key="shapePicker" data-type="json" placeholder=\'{"shapes": [...]}\' style="min-height: 60px;"></textarea>\n <p class="field__help">Custom shape picker entries for the sidebar</p>\n </div>\n <div id="sidebar-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Libraries</h3></div>\n <div class="card__body">\n <div class="field">\n <label for="cfg-defaultLibraries">Default Libraries</label>\n <input type="text" id="cfg-defaultLibraries" data-key="defaultLibraries" placeholder="general;uml;er;bpmn;flowchart;basic;arrows2">\n <p class="field__help">Semicolon-separated library keys shown in sidebar on startup</p>\n </div>\n <div class="field">\n <label>Enabled Libraries</label>\n <div class="tag-list" id="enabledLibraries-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="enabledLibraries-input" placeholder="Add library key (e.g. general, uml)...">\n <button type="button" class="btn btn--secondary btn--sm" id="enabledLibraries-add">Add</button>\n </div>\n <p class="field__help">Libraries available in More Shapes dialog. Leave empty for all.</p>\n </div>\n <div class="field">\n <label>Default Custom Libraries</label>\n <div class="tag-list" id="defaultCustomLibraries-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="defaultCustomLibraries-input" placeholder="Add library ID or URL...">\n <button type="button" class="btn btn--secondary btn--sm" id="defaultCustomLibraries-add">Add</button>\n </div>\n <p class="field__help">IDs or URLs of custom libraries to load on startup</p>\n </div>\n <div class="field">\n <label for="cfg-templateFile">Template File URL</label>\n <input type="url" id="cfg-templateFile" data-key="templateFile" placeholder="https://app.diagrams.net/templates/index.xml">\n </div>\n <div class="field">\n <label for="cfg-libraries">Libraries (JSON)</label>\n <textarea id="cfg-libraries" data-key="libraries" data-type="json" placeholder=\'[{"title": {"main": "Company"}, "entries": [...]}]\' style="min-height: 60px;"></textarea>\n <p class="field__help">Custom library sections for the left panel</p>\n </div>\n <div id="library-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Fonts</h3></div>\n <div class="card__body">\n <div class="field">\n <label>Default Fonts</label>\n <div class="tag-list" id="defaultFonts-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="defaultFonts-input" placeholder="Add font name...">\n <button type="button" class="btn btn--secondary btn--sm" id="defaultFonts-add">Add</button>\n </div>\n <p class="field__help">Font names for the format panel font picker</p>\n </div>\n <div class="field">\n <label>Custom Fonts</label>\n <div class="tag-list" id="customFonts-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="customFonts-input" placeholder="Add font name...">\n <button type="button" class="btn btn--secondary btn--sm" id="customFonts-add">Add</button>\n </div>\n <p class="field__help">Additional fonts added before default fonts</p>\n </div>\n <div class="field">\n <label for="cfg-fontCss">Font CSS (@font-face rules)</label>\n <textarea id="cfg-fontCss" data-key="fontCss" placeholder="@font-face { font-family: \'MyFont\'; src: url(\'...\'); }" style="min-height: 60px;"></textarea>\n </div>\n <div id="font-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Colors</h3></div>\n <div class="card__body">\n <div class="field">\n <label>Preset Colors (upper palette)</label>\n <div class="color-list" id="presetColors-list"></div>\n <div class="tag-input-wrap">\n <input type="color" id="presetColors-picker" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="presetColors-input" placeholder="Hex without # (e.g. E6D0DE)" style="flex: 1;">\n <button type="button" class="btn btn--secondary btn--sm" id="presetColors-add">Add</button>\n </div>\n </div>\n <div class="field">\n <label>Custom Preset Colors</label>\n <div class="color-list" id="customPresetColors-list"></div>\n <div class="tag-input-wrap">\n <input type="color" id="customPresetColors-picker" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="customPresetColors-input" placeholder="Hex without # (e.g. FF5733)" style="flex: 1;">\n <button type="button" class="btn btn--secondary btn--sm" id="customPresetColors-add">Add</button>\n </div>\n <p class="field__help">Added before preset colors in the colour dialog</p>\n </div>\n <div class="field">\n <label>Default Colors (lower palette)</label>\n <div class="color-list" id="defaultColors-list"></div>\n <div class="tag-input-wrap">\n <input type="color" id="defaultColors-picker" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="defaultColors-input" placeholder="Hex without # or \'none\'" style="flex: 1;">\n <button type="button" class="btn btn--secondary btn--sm" id="defaultColors-add">Add</button>\n </div>\n </div>\n <div class="field">\n <label for="cfg-colorNames">Color Names (JSON)</label>\n <textarea id="cfg-colorNames" data-key="colorNames" data-type="json" placeholder=\'{"FFFFFF": "White", "000000": "Black"}\' style="min-height: 60px;"></textarea>\n <p class="field__help">Map of colour codes to display names (tooltips)</p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Color Schemes</h3></div>\n <div class="card__body">\n <div class="field">\n <label>Default Color Schemes</label>\n <div class="color-scheme-editor" id="defaultColorSchemes-editor"></div>\n <div class="btn-group mt-sm">\n <button type="button" class="btn btn--secondary btn--sm" id="defaultColorSchemes-addRow">Add Row</button>\n </div>\n <p class="field__help">Colour schemes for the Style section. Each row is a scheme group.</p>\n </div>\n <div class="field">\n <label>Custom Color Schemes</label>\n <div class="color-scheme-editor" id="customColorSchemes-editor"></div>\n <div class="btn-group mt-sm">\n <button type="button" class="btn btn--secondary btn--sm" id="customColorSchemes-addRow">Add Row</button>\n </div>\n <p class="field__help">Additional colour schemes added before default schemes</p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Default Styles</h3></div>\n <div class="card__body">\n <div class="field">\n <label for="cfg-defaultTextStyle">Default Text Style</label>\n <input type="text" id="cfg-defaultTextStyle" data-key="defaultTextStyle" placeholder="text;html=1;whiteSpace=wrap;...">\n </div>\n <div class="field">\n <div style="display: flex; align-items: center; justify-content: space-between;">\n <label for="cfg-defaultVertexStyle" style="margin-bottom: 0;">Default Vertex Style (JSON)</label>\n <button type="button" class="btn btn--secondary btn--sm" id="useCurrentVertexStyle" style="display: none;">Use Current</button>\n </div>\n <textarea id="cfg-defaultVertexStyle" data-key="defaultVertexStyle" data-type="json" placeholder=\'{"fontFamily": "Arial"}\' style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <div style="display: flex; align-items: center; justify-content: space-between;">\n <label for="cfg-defaultEdgeStyle" style="margin-bottom: 0;">Default Edge Style (JSON)</label>\n <button type="button" class="btn btn--secondary btn--sm" id="useCurrentEdgeStyle" style="display: none;">Use Current</button>\n </div>\n <textarea id="cfg-defaultEdgeStyle" data-key="defaultEdgeStyle" data-type="json" placeholder=\'{"edgeStyle": "orthogonalEdgeStyle"}\' style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <label for="cfg-styles">Styles (JSON)</label>\n <textarea id="cfg-styles" data-key="styles" data-type="json" placeholder=\'[{}, {"commonStyle": {"fontColor": "#5C5C5C"}}]\' style="min-height: 60px;"></textarea>\n <p class="field__help">Colours for the Style tab. Keys: commonStyle, vertexStyle, edgeStyle, graph.</p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Custom CSS</h3></div>\n <div class="card__body">\n <div class="field">\n <label for="cfg-css">CSS Rules</label>\n <textarea id="cfg-css" data-key="css" placeholder=".geMenubarContainer { background-color: #2A2A2A !important; }" style="min-height: 80px;"></textarea>\n <p class="field__help">CSS rules to customize the draw.io user interface</p>\n </div>\n <div class="field">\n <label for="cfg-customCss">Custom CSS (alternative)</label>\n <textarea id="cfg-customCss" data-key="customCss" placeholder="Additional CSS rules..." style="min-height: 60px;"></textarea>\n <p class="field__help">Injected as a separate style element</p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Embedding</h3></div>\n <div class="card__body">\n <div id="embedding-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Menu Customization</h3></div>\n <div class="card__body">\n <div class="field">\n <label>Hidden Menu Items</label>\n <div class="tag-list" id="hideMenuItems-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="hideMenuItems-input" placeholder="Add action name (e.g. print, exportPdf)...">\n <button type="button" class="btn btn--secondary btn--sm" id="hideMenuItems-add">Add</button>\n </div>\n <p class="field__help">Action names of menu items to hide</p>\n </div>\n <div class="field">\n <label>Hidden Menus</label>\n <div class="tag-list" id="hideMenus-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="hideMenus-input" placeholder="Add menu name (e.g. extras, help)...">\n <button type="button" class="btn btn--secondary btn--sm" id="hideMenus-add">Add</button>\n </div>\n <p class="field__help">Names of top-level menus to hide</p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">AI Configuration</h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-gptApiKey">OpenAI API Key</label>\n <input type="text" id="cfg-gptApiKey" data-key="gptApiKey" placeholder="sk-...">\n </div>\n <div class="field">\n <label for="cfg-gptUrl">Custom GPT URL</label>\n <input type="url" id="cfg-gptUrl" data-key="gptUrl" placeholder="https://api.openai.com/v1/chat/completions">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-geminiApiKey">Gemini API Key</label>\n <input type="text" id="cfg-geminiApiKey" data-key="geminiApiKey" placeholder="AI...">\n </div>\n <div class="field">\n <label for="cfg-claudeApiKey">Claude API Key</label>\n <input type="text" id="cfg-claudeApiKey" data-key="claudeApiKey" placeholder="sk-ant-...">\n </div>\n </div>\n <div class="field">\n <label for="cfg-aiActions">AI Actions (JSON)</label>\n <textarea id="cfg-aiActions" data-key="aiActions" data-type="json" placeholder=\'{"myAction": {"prompt": "..."}}\' style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <label for="cfg-aiGlobals">AI Globals (JSON)</label>\n <textarea id="cfg-aiGlobals" data-key="aiGlobals" data-type="json" placeholder=\'{}\' style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <label for="cfg-aiConfigs">AI Configs (JSON)</label>\n <textarea id="cfg-aiConfigs" data-key="aiConfigs" data-type="json" placeholder=\'{}\' style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <label for="cfg-aiModels">AI Models (JSON)</label>\n <textarea id="cfg-aiModels" data-key="aiModels" data-type="json" placeholder=\'{}\' style="min-height: 60px;"></textarea>\n </div>\n <div id="ai-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Export & Security</h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-maxImageBytes">Max Image Bytes</label>\n <input type="number" id="cfg-maxImageBytes" data-key="maxImageBytes" placeholder="1000000" min="0">\n </div>\n <div class="field">\n <label for="cfg-maxImageSize">Max Image Size (px)</label>\n <input type="number" id="cfg-maxImageSize" data-key="maxImageSize" placeholder="520" min="0">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-autosaveDelay">Autosave Delay (ms)</label>\n <input type="number" id="cfg-autosaveDelay" data-key="autosaveDelay" placeholder="e.g. 2000" min="0">\n </div>\n <div class="field">\n <label for="cfg-defaultFileType">Default File Type</label>\n <select id="cfg-defaultFileType" data-key="defaultFileType">\n <option value="">- Not set -</option>\n <option value="drawio">XML (.drawio)</option>\n <option value="png">Editable PNG (.drawio.png)</option>\n <option value="svg">Editable SVG (.drawio.svg)</option>\n <option value="html">HTML (.drawio.html)</option>\n </select>\n </div>\n </div>\n <div id="export-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Collaboration & Advanced</h3></div>\n <div class="card__body">\n <div class="field">\n <label for="cfg-globalVars">Global Variables (JSON)</label>\n <textarea id="cfg-globalVars" data-key="globalVars" data-type="json" placeholder=\'{"companyName": "Acme Corp"}\' style="min-height: 60px;"></textarea>\n <p class="field__help">Global placeholders available in all diagrams</p>\n </div>\n <div class="field">\n <label for="cfg-emptyDiagramXml">Empty Diagram XML</label>\n <textarea id="cfg-emptyDiagramXml" data-key="emptyDiagramXml" placeholder="<mxGraphModel>...</mxGraphModel>" style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <label for="cfg-emptyLibraryXml">Empty Library XML</label>\n <textarea id="cfg-emptyLibraryXml" data-key="emptyLibraryXml" placeholder="<mxlibrary>[]</mxlibrary>" style="min-height: 60px;"></textarea>\n </div>\n <div id="advanced-toggles"></div>\n <div id="desktop-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Confluence Cloud</h3></div>\n <div class="card__body">\n <p class="field__help mb-sm">These options only apply to <strong>Confluence Cloud</strong>.</p>\n <div class="field">\n <label for="cfg-ui">UI Theme</label>\n <select id="cfg-ui" data-key="ui">\n <option value="">- Not set -</option>\n <option value="kennedy">Kennedy</option>\n <option value="atlas">Atlas (default)</option>\n <option value="min">Minimal</option>\n <option value="sketch">Sketch</option>\n <option value="simple">Simple</option>\n </select>\n </div>\n <div id="confluence-cloud-toggles"></div>\n <div class="field">\n <label for="cfg-viewerTimeout">Viewer Timeout</label>\n <input type="number" id="cfg-viewerTimeout" data-key="viewerTimeout" placeholder="e.g. 30000" min="0">\n <p class="field__help">Timeout in milliseconds before the viewer gives up loading <code>viewerTimeout</code></p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Confluence Server / Data Center</h3></div>\n <div class="card__body">\n <p class="field__help mb-sm">These options only apply to <strong>Confluence Server / Data Center</strong>.</p>\n <div id="confluence-toggles"></div>\n <div class="field">\n <label>Default Macro Parameters</label>\n <div class="field-row">\n <div class="field">\n <label for="cfg-dmp-toolbarStyle" style="font-weight: normal;">Toolbar Style</label>\n <select id="cfg-dmp-toolbarStyle">\n <option value="">- Not set -</option>\n <option value="top">top</option>\n <option value="inline">inline</option>\n <option value="hidden">hidden</option>\n </select>\n </div>\n <div class="field">\n <label for="cfg-dmp-links" style="font-weight: normal;">Links</label>\n <select id="cfg-dmp-links">\n <option value="">- Not set -</option>\n <option value="auto">auto</option>\n <option value="blank">blank</option>\n <option value="self">self</option>\n </select>\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-dmp-width" style="font-weight: normal;">Width</label>\n <input type="number" id="cfg-dmp-width" placeholder="e.g. 800" min="1">\n </div>\n <div class="field" style="padding-top: 16px;">\n <div id="dmp-toggles-container"></div>\n </div>\n </div>\n <div style="display: flex; flex-wrap: wrap; gap: 12px; padding-top: 6px;" id="dmp-booleans">\n <label class="checkbox"><input type="checkbox" id="cfg-dmp-border" data-tristate="true"> <span>Border</span></label>\n <label class="checkbox"><input type="checkbox" id="cfg-dmp-lightbox" data-tristate="true"> <span>Lightbox</span></label>\n <label class="checkbox"><input type="checkbox" id="cfg-dmp-simpleViewer" data-tristate="true"> <span>Simple Viewer</span></label>\n </div>\n </div>\n </div>\n </div>\n</div>'};EditorUi.DIFF_INSERT="i";EditorUi.DIFF_REMOVE="r";EditorUi.DIFF_UPDATE="u";EditorUi.DIFF_FILE="f";EditorUi.transientViewStateProperties="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");EditorUi.prototype.viewStateProperties={background:!0,backgroundImage:!0,shadowVisible:!0,foldingEnabled:!0,pageScale:!0,mathEnabled:!0,pageFormat:!0,extFonts:!0,adaptiveColors:!0};EditorUi.prototype.cellProperties={id:!0,value:!0,xmlValue:!0,vertex:!0,edge:!0,visible:!0,collapsed:!0,connectable:!0,parent:!0,children:!0,previous:!0,source:!0,target:!0,edges:!0,geometry:!0,style:!0,overlays:!0,mxObjectId:!0,mxTransient:!0};EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.applyPatches=function(b,k,m,d,q){if(null!=k)for(var u=0;u<k.length;u++)null!=k[u]&&(b=this.patchPages(b,k[u],m,d,q));return b};EditorUi.prototype.patchFileNode=function(b){var k=!1;if(null!=this.fileNode&&null!=b)for(var m=0;m<b.length;m++)if(null!=b[m]&&null!=b[m][EditorUi.DIFF_FILE])for(var d in b[m][EditorUi.DIFF_FILE])k=b[m][EditorUi.DIFF_FILE][d],null!=k?this.fileNode.setAttribute(d,k):this.fileNode.removeAttribute(d),k=!0;return k};-EditorUi.prototype.patchPages=function(b,k,m,d,q){var u={},y=[],A={},J={},K={},H={};if(null!=d&&null!=d[EditorUi.DIFF_UPDATE])for(var G in d[EditorUi.DIFF_UPDATE])u[G]=d[EditorUi.DIFF_UPDATE][G];if(null!=k[EditorUi.DIFF_REMOVE])for(d=0;d<k[EditorUi.DIFF_REMOVE].length;d++)J[k[EditorUi.DIFF_REMOVE][d]]=!0;if(null!=k[EditorUi.DIFF_INSERT])for(d=0;d<k[EditorUi.DIFF_INSERT].length;d++)A[k[EditorUi.DIFF_INSERT][d].previous]=k[EditorUi.DIFF_INSERT][d];if(null!=k[EditorUi.DIFF_UPDATE])for(G in k[EditorUi.DIFF_UPDATE])d=-k[EditorUi.DIFF_UPDATE][G],null!=d.previous&&(H[d.previous]=G);if(null!=b){var c="";for(d=0;d<b.length;d++){var f=b[d].getId();K[f]=b[d];null!=H[c]||J[f]||null!=k[EditorUi.DIFF_UPDATE]&&null!=k[EditorUi.DIFF_UPDATE][f]&&null!=k[EditorUi.DIFF_UPDATE][f].previous||(H[c]=f);c=f}}var l={},n=mxUtils.bind(this,function(t){var x=null!=t?t.getId():"";if(null!=t&&!l[x]){l[x]=!0;y.push(t);var B=null!=k[EditorUi.DIFF_UPDATE]?k[EditorUi.DIFF_UPDATE][x]:null;null!=B&&(this.updatePageRoot(t),null!=B.name&&t.setName(B.name),-null!=B.viewBox&&(""==B.viewBox?t.node.removeAttribute("viewBox"):t.node.setAttribute("viewBox",B.viewBox)),null!=B.view&&this.patchViewState(t,B.view),null!=B.cells&&this.patchPage(t,B.cells,u[t.getId()],q),!m||null==B.cells&&null==B.view||(t.needsUpdate=!0))}t=H[x];null!=t&&(delete H[x],n(K[t]));t=A[x];null!=t&&(delete A[x],r(t))}),r=mxUtils.bind(this,function(t){t=mxUtils.parseXml(t.data).documentElement;t=new DiagramPage(t);this.updatePageRoot(t);var x=K[t.getId()];null==x?n(t):(this.patchPage(x,-this.diffPages([x],[t]),u[x.getId()],q),m&&(x.needsUpdate=!0))});n();for(G in H)n(K[H[G]]),delete H[G];for(G in A)r(A[G]),delete A[G];return y};+EditorUi.prototype.patchPages=function(b,k,m,d,q){var u={},y=[],A={},J={},K={},F={};if(null!=d&&null!=d[EditorUi.DIFF_UPDATE])for(var H in d[EditorUi.DIFF_UPDATE])u[H]=d[EditorUi.DIFF_UPDATE][H];if(null!=k[EditorUi.DIFF_REMOVE])for(d=0;d<k[EditorUi.DIFF_REMOVE].length;d++)J[k[EditorUi.DIFF_REMOVE][d]]=!0;if(null!=k[EditorUi.DIFF_INSERT])for(d=0;d<k[EditorUi.DIFF_INSERT].length;d++)A[k[EditorUi.DIFF_INSERT][d].previous]=k[EditorUi.DIFF_INSERT][d];if(null!=k[EditorUi.DIFF_UPDATE])for(H in k[EditorUi.DIFF_UPDATE])d=+k[EditorUi.DIFF_UPDATE][H],null!=d.previous&&(F[d.previous]=H);if(null!=b){var c="";for(d=0;d<b.length;d++){var f=b[d].getId();K[f]=b[d];null!=F[c]||J[f]||null!=k[EditorUi.DIFF_UPDATE]&&null!=k[EditorUi.DIFF_UPDATE][f]&&null!=k[EditorUi.DIFF_UPDATE][f].previous||(F[c]=f);c=f}}var l={},n=mxUtils.bind(this,function(t){var x=null!=t?t.getId():"";if(null!=t&&!l[x]){l[x]=!0;y.push(t);var B=null!=k[EditorUi.DIFF_UPDATE]?k[EditorUi.DIFF_UPDATE][x]:null;null!=B&&(this.updatePageRoot(t),null!=B.name&&t.setName(B.name),+null!=B.viewBox&&(""==B.viewBox?t.node.removeAttribute("viewBox"):t.node.setAttribute("viewBox",B.viewBox)),null!=B.view&&this.patchViewState(t,B.view),null!=B.cells&&this.patchPage(t,B.cells,u[t.getId()],q),!m||null==B.cells&&null==B.view||(t.needsUpdate=!0))}t=F[x];null!=t&&(delete F[x],n(K[t]));t=A[x];null!=t&&(delete A[x],r(t))}),r=mxUtils.bind(this,function(t){t=mxUtils.parseXml(t.data).documentElement;t=new DiagramPage(t);this.updatePageRoot(t);var x=K[t.getId()];null==x?n(t):(this.patchPage(x,+this.diffPages([x],[t]),u[x.getId()],q),m&&(x.needsUpdate=!0))});n();for(H in F)n(K[F[H]]),delete F[H];for(H in A)r(A[H]),delete A[H];return y};EditorUi.prototype.patchViewState=function(b,k){if(null!=k){if(null==b.viewState){var m=mxUtils.createXmlDocument();b.viewState=this.editor.graph.createViewState(m.createElement("mxGraphModel"))}b==this.currentPage&&(b.viewState=this.editor.graph.getViewState());for(var d in k)try{this.patchViewStateProperty(b,k,d)}catch(q){}b==this.currentPage&&this.editor.graph.setViewState(b.viewState,!0)}};EditorUi.prototype.patchViewStateProperty=function(b,k,m){b.viewState[m]=JSON.parse(k[m])};-EditorUi.prototype.createParentLookup=function(b,k){function m(K){var H=d[K];null==H&&(H={inserted:[],moved:{}},d[K]=H);return H}var d={};if(null!=k[EditorUi.DIFF_INSERT])for(var q=0;q<k[EditorUi.DIFF_INSERT].length;q++){var u=k[EditorUi.DIFF_INSERT][q],y=null!=u.parent?u.parent:"",A=null!=u.previous?u.previous:"";m(y).inserted[A]=u}if(null!=k[EditorUi.DIFF_UPDATE])for(var J in k[EditorUi.DIFF_UPDATE])u=k[EditorUi.DIFF_UPDATE][J],null!=u.previous&&(y=u.parent,null==y&&(q=b.getCell(J),null!=q&&(q=+EditorUi.prototype.createParentLookup=function(b,k){function m(K){var F=d[K];null==F&&(F={inserted:[],moved:{}},d[K]=F);return F}var d={};if(null!=k[EditorUi.DIFF_INSERT])for(var q=0;q<k[EditorUi.DIFF_INSERT].length;q++){var u=k[EditorUi.DIFF_INSERT][q],y=null!=u.parent?u.parent:"",A=null!=u.previous?u.previous:"";m(y).inserted[A]=u}if(null!=k[EditorUi.DIFF_UPDATE])for(var J in k[EditorUi.DIFF_UPDATE])u=k[EditorUi.DIFF_UPDATE][J],null!=u.previous&&(y=u.parent,null==y&&(q=b.getCell(J),null!=q&&(q=b.getParent(q),null!=q&&(y=q.getId()))),null!=y&&(m(y).moved[u.previous]=J));return d};-EditorUi.prototype.patchPage=function(b,k,m,d){var q=b==this.currentPage?this.editor.graph.model:new mxGraphModel(b.root),u=this.createParentLookup(q,k);q.beginUpdate();try{var y=q.updateEdgeParent,A=new mxDictionary,J=[];q.updateEdgeParent=function(r,t){!A.get(r)&&d&&(A.put(r,!0),J.push(r))};var K=u[""],H=null!=K&&null!=K.inserted?K.inserted[""]:null,G=null;null!=H&&(G=this.getCellForJson(H));if(null==G){var c=null!=K&&null!=K.moved?K.moved[""]:null;null!=c&&(G=q.getCell(c))}null!=G&&(q.setRoot(G),-b.root=G,EditorUi.debug("EditorUi.patchPage: Root changed",G.id));this.patchCellRecursive(b,q,q.root,u,k);if(null!=k[EditorUi.DIFF_REMOVE])for(var f=0;f<k[EditorUi.DIFF_REMOVE].length;f++){c=k[EditorUi.DIFF_REMOVE][f];var l=q.getCell(c);null!=l&&q.remove(l)}if(null!=k[EditorUi.DIFF_UPDATE]){var n=null!=m&&null!=m.cells?m.cells[EditorUi.DIFF_UPDATE]:null;for(c in k[EditorUi.DIFF_UPDATE])l=q.getCell(c),null!=l?this.patchCell(q,l,k[EditorUi.DIFF_UPDATE][c],null!=n?n[c]:null):EditorUi.debug("EditorUi.patchPage: Updated cell not found",-c,"diff",[k[EditorUi.DIFF_UPDATE][c]])}if(null!=k[EditorUi.DIFF_INSERT])for(f=0;f<k[EditorUi.DIFF_INSERT].length;f++)H=k[EditorUi.DIFF_INSERT][f],l=q.getCell(H.id),null!=l&&(q.setTerminal(l,q.getCell(H.source),!0),q.setTerminal(l,q.getCell(H.target),!1));q.updateEdgeParent=y;if(d&&0<J.length)for(f=0;f<J.length;f++)q.contains(J[f])&&q.updateEdgeParent(J[f])}finally{q.endUpdate()}};-EditorUi.prototype.patchCellRecursive=function(b,k,m,d,q){if(null!=m){var u=d[m.getId()],y=null!=u&&null!=u.inserted?u.inserted:{};u=null!=u&&null!=u.moved?u.moved:{};for(var A=0,J=k.getChildCount(m),K="",H=0;H<J;H++){var G=k.getChildAt(m,H).getId();null==u[K]&&(null==q[EditorUi.DIFF_UPDATE]||null==q[EditorUi.DIFF_UPDATE][G]||null==q[EditorUi.DIFF_UPDATE][G].previous&&null==q[EditorUi.DIFF_UPDATE][G].parent)&&(u[K]=G);K=G}J=mxUtils.bind(this,function(c,f){var l=null!=c?c.getId():"";null==l&&EditorUi.debug("EditorUi.patchCellRecursive: Inserting cell with null id",-"cell",c);null!=c&&f&&(f=k.getCell(l),null!=f&&f!=c&&(c=null));null!=c&&(k.getChildAt(m,A)!=c&&k.add(m,c,A),this.patchCellRecursive(b,k,c,d,q),A++);return l});for(K=[null];0<K.length;)if(H=K.shift(),H=J(null!=H?H.child:null,null!=H?H.insert:!1),G=u[H],null!=G&&(delete u[H],K.push({child:k.getCell(G)})),G=y[H],null!=G&&(delete y[H],K.push({child:this.getCellForJson(G),insert:!0})),0==K.length){for(H in u)K.push({child:k.getCell(u[H])}),delete u[H];for(H in y)K.push({child:this.getCellForJson(y[H]),-insert:!0}),delete y[H]}}};+EditorUi.prototype.patchPage=function(b,k,m,d){var q=b==this.currentPage?this.editor.graph.model:new mxGraphModel(b.root),u=this.createParentLookup(q,k);q.beginUpdate();try{var y=q.updateEdgeParent,A=new mxDictionary,J=[];q.updateEdgeParent=function(r,t){!A.get(r)&&d&&(A.put(r,!0),J.push(r))};var K=u[""],F=null!=K&&null!=K.inserted?K.inserted[""]:null,H=null;null!=F&&(H=this.getCellForJson(F));if(null==H){var c=null!=K&&null!=K.moved?K.moved[""]:null;null!=c&&(H=q.getCell(c))}null!=H&&(q.setRoot(H),+b.root=H,EditorUi.debug("EditorUi.patchPage: Root changed",H.id));this.patchCellRecursive(b,q,q.root,u,k);if(null!=k[EditorUi.DIFF_REMOVE])for(var f=0;f<k[EditorUi.DIFF_REMOVE].length;f++){c=k[EditorUi.DIFF_REMOVE][f];var l=q.getCell(c);null!=l&&q.remove(l)}if(null!=k[EditorUi.DIFF_UPDATE]){var n=null!=m&&null!=m.cells?m.cells[EditorUi.DIFF_UPDATE]:null;for(c in k[EditorUi.DIFF_UPDATE])l=q.getCell(c),null!=l?this.patchCell(q,l,k[EditorUi.DIFF_UPDATE][c],null!=n?n[c]:null):EditorUi.debug("EditorUi.patchPage: Updated cell not found",+c,"diff",[k[EditorUi.DIFF_UPDATE][c]])}if(null!=k[EditorUi.DIFF_INSERT])for(f=0;f<k[EditorUi.DIFF_INSERT].length;f++)F=k[EditorUi.DIFF_INSERT][f],l=q.getCell(F.id),null!=l&&(q.setTerminal(l,q.getCell(F.source),!0),q.setTerminal(l,q.getCell(F.target),!1));q.updateEdgeParent=y;if(d&&0<J.length)for(f=0;f<J.length;f++)q.contains(J[f])&&q.updateEdgeParent(J[f])}finally{q.endUpdate()}};+EditorUi.prototype.patchCellRecursive=function(b,k,m,d,q){if(null!=m){var u=d[m.getId()],y=null!=u&&null!=u.inserted?u.inserted:{};u=null!=u&&null!=u.moved?u.moved:{};for(var A=0,J=k.getChildCount(m),K="",F=0;F<J;F++){var H=k.getChildAt(m,F).getId();null==u[K]&&(null==q[EditorUi.DIFF_UPDATE]||null==q[EditorUi.DIFF_UPDATE][H]||null==q[EditorUi.DIFF_UPDATE][H].previous&&null==q[EditorUi.DIFF_UPDATE][H].parent)&&(u[K]=H);K=H}J=mxUtils.bind(this,function(c,f){var l=null!=c?c.getId():"";null==l&&EditorUi.debug("EditorUi.patchCellRecursive: Inserting cell with null id",+"cell",c);null!=c&&f&&(f=k.getCell(l),null!=f&&f!=c&&(c=null));null!=c&&(k.getChildAt(m,A)!=c&&k.add(m,c,A),this.patchCellRecursive(b,k,c,d,q),A++);return l});for(K=[null];0<K.length;)if(F=K.shift(),F=J(null!=F?F.child:null,null!=F?F.insert:!1),H=u[F],null!=H&&(delete u[F],K.push({child:k.getCell(H)})),H=y[F],null!=H&&(delete y[F],K.push({child:this.getCellForJson(H),insert:!0})),0==K.length){for(F in u)K.push({child:k.getCell(u[F])}),delete u[F];for(F in y)K.push({child:this.getCellForJson(y[F]),+insert:!0}),delete y[F]}}};EditorUi.prototype.patchCell=function(b,k,m,d){if(null!=k&&null!=m){if(null==d||null==d.xmlValue&&(null==d.value||""==d.value))"value"in m?b.setValue(k,m.value):null!=m.xmlValue&&b.setValue(k,mxUtils.parseXml(m.xmlValue).documentElement);null!=d&&null!=d.style||null==m.style||b.setStyle(k,m.style);null!=m.visible&&b.setVisible(k,1==m.visible);null!=m.collapsed&&b.setCollapsed(k,1==m.collapsed);null!=m.vertex&&(k.vertex=1==m.vertex);null!=m.edge&&(k.edge=1==m.edge);null!=m.connectable&&(k.connectable=1==m.connectable);null!=m.geometry&&b.setGeometry(k,this.codec.decode(mxUtils.parseXml(m.geometry).documentElement));null!=m.source&&b.setTerminal(k,b.getCell(m.source),!0);null!=m.target&&b.setTerminal(k,b.getCell(m.target),!1);for(var q in m)this.cellProperties[q]||(k[q]=m[q])}};EditorUi.prototype.getXmlForPages=function(b){b=this.getNodeForPages(b);var k=null;null!=b&&(k=mxUtils.getXml(b));return k};EditorUi.prototype.getNodeForPages=function(b){var k=null;if(null!=this.fileNode&&null!=b){k=this.fileNode.cloneNode(!1);for(var m=0;m<b.length;m++){var d=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b[m].root));this.editor.graph.saveViewState(b[m].viewState,d);var q=b[m].node.cloneNode(!1);q.appendChild(d);k.appendChild(q)}}return k};EditorUi.prototype.getPagesForXml=function(b,k){b=mxUtils.parseXml(b);return this.getPagesForNode(b.documentElement,null,k)};EditorUi.prototype.getPagesForNode=function(b,k,m){var d=this.editor.extractGraphModel(b,!0,!0);null!=d&&(b=d);k=b.getElementsByTagName(k||"diagram");d=[];if(0<k.length)for(b=0;b<k.length;b++){var q=new DiagramPage(k[b]);try{this.updatePageRoot(q,!0)}catch(u){if(!m)throw u;q=null}d.push(q)}else"mxGraphModel"==b.nodeName&&(q=new DiagramPage(b.ownerDocument.createElement("diagram")),q.setName(mxResources.get("pageWithNumber",[1])),q.node.appendChild(b.cloneNode(!0)),d.push(q));return d};-EditorUi.prototype.diffPages=function(b,k){var m=[],d=[],q={},u={},y={},A=null;if(null!=b&&null!=k){for(var J=0;J<k.length;J++)null!=k[J]&&(u[k[J].getId()]={page:k[J],prev:A},A=k[J]);A=null;for(J=0;J<b.length;J++)if(null!=b[J]){var K=b[J].getId(),H=u[K];if(null==H)d.push(K);else{this.updatePageRoot(b[J]);this.updatePageRoot(H.page);var G=this.diffCells(b[J].root,H.page.root);k={};mxUtils.isEmptyObject(G)||(k.cells=G);G=this.diffViewState(b[J],H.page);mxUtils.isEmptyObject(G)||(k.view=G);if((null!=-H.prev?null==A:null!=A)||null!=A&&null!=H.prev&&A.getId()!=H.prev.getId())k.previous=null!=H.prev?H.prev.getId():"";null!=H.page.getName()&&b[J].getName()!=H.page.getName()&&(k.name=H.page.getName());A=b[J].node.getAttribute("viewBox");H=H.page.node.getAttribute("viewBox");H!=A&&(k.viewBox=null!=H?H:"");mxUtils.isEmptyObject(k)||(y[K]=k)}delete u[b[J].getId()];A=b[J]}for(K in u)H=u[K],m.push({id:H.page.getId(),data:mxUtils.getXml(H.page.node),previous:null!=H.prev?H.prev.getId():""});mxUtils.isEmptyObject(y)||+EditorUi.prototype.diffPages=function(b,k){var m=[],d=[],q={},u={},y={},A=null;if(null!=b&&null!=k){for(var J=0;J<k.length;J++)null!=k[J]&&(u[k[J].getId()]={page:k[J],prev:A},A=k[J]);A=null;for(J=0;J<b.length;J++)if(null!=b[J]){var K=b[J].getId(),F=u[K];if(null==F)d.push(K);else{this.updatePageRoot(b[J]);this.updatePageRoot(F.page);var H=this.diffCells(b[J].root,F.page.root);k={};mxUtils.isEmptyObject(H)||(k.cells=H);H=this.diffViewState(b[J],F.page);mxUtils.isEmptyObject(H)||(k.view=H);if((null!=+F.prev?null==A:null!=A)||null!=A&&null!=F.prev&&A.getId()!=F.prev.getId())k.previous=null!=F.prev?F.prev.getId():"";null!=F.page.getName()&&b[J].getName()!=F.page.getName()&&(k.name=F.page.getName());A=b[J].node.getAttribute("viewBox");F=F.page.node.getAttribute("viewBox");F!=A&&(k.viewBox=null!=F?F:"");mxUtils.isEmptyObject(k)||(y[K]=k)}delete u[b[J].getId()];A=b[J]}for(K in u)F=u[K],m.push({id:F.page.getId(),data:mxUtils.getXml(F.page.node),previous:null!=F.prev?F.prev.getId():""});mxUtils.isEmptyObject(y)||(q[EditorUi.DIFF_UPDATE]=y);0<d.length&&(q[EditorUi.DIFF_REMOVE]=d);0<m.length&&(q[EditorUi.DIFF_INSERT]=m)}return q};EditorUi.prototype.createCellLookup=function(b,k,m){m=null!=m?m:{};null==b.getId()?EditorUi.debug("EditorUi.createCellLookup: Ignored inserted cell with no id",b):m[b.getId()]={cell:b,prev:k};var d=b.getChildCount();k=null;for(var q=0;q<d;q++){var u=b.getChildAt(q);this.createCellLookup(u,k,m);k=u}return m};EditorUi.prototype.diffCellRecursive=function(b,k,m,d,q){d=null!=d?d:{};var u=m[b.getId()];delete m[b.getId()];if(null==u)null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored removed cell with no id",b):q.push(b.getId());else{var y=this.diffCell(b,u.cell);if(null!=y.parent||(null!=u.prev?null==k:null!=k)||null!=k&&null!=u.prev&&k.getId()!=u.prev.getId())y.previous=null!=u.prev?u.prev.getId():"";mxUtils.isEmptyObject(y)||(null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored changed cell with no id",b,"diff",y):d[b.getId()]=y)}u=b.getChildCount();k=null;for(y=0;y<u;y++){var A=b.getChildAt(y);this.diffCellRecursive(A,k,m,d,q);k=A}return d};@@ -14568,9 +14572,9 @@ DrawioFileSync.prototype.patchRealtime=function(b,k,m,d){var q=null;if(this.fileDrawioFileSync.prototype.sendLocalChanges=function(){try{if(this.file.isRealtime()&&this.localFileWasChanged){var b=this.ui.clonePages(this.ui.pages),k=this.ui.diffPages(this.snapshot,b),m=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;m!=this.snapshotVars&&(k[EditorUi.DIFF_FILE]={vars:m});this.snapshotVars=m;this.file.ownPages=this.ui.patchPages(this.file.ownPages,k,!0);this.snapshot=b;var d=this.ui.resolveCrossReferences(k,this.ui.diffPages(this.file.ownPages,this.ui.pages));this.file.ownPages=this.ui.patchPages(this.file.ownPages,d,!0);this.isRealtimeActive()&&this.doSendLocalChanges([d,k])}this.localFileWasChanged=!1}catch(q){b=this.file.getCurrentUser(),b=null!=b?b.id:"unknown",EditorUi.logError("Error in sendLocalChanges",null,this.file.getMode()+"."+this.file.getId(),b,q)}};DrawioFileSync.prototype.doReceiveRemoteChanges=function(b){this.file.isRealtime()&&this.isRealtimeActive()&&(this.sendLocalChanges(),this.file.patch(b),this.file.theirPages=this.ui.applyPatches(this.file.theirPages,b),this.scheduleCleanup(),EditorUi.debug("DrawioFileSync.doReceiveRemoteChanges",[this],"changes",b))};-DrawioFileSync.prototype.merge=function(b,k,m,d,q,u,y){try{this.file.stats.merged++;this.lastModified=new Date;var A=this.file.getDescriptorRevisionId(m);if(!this.file.ignorePatches(b)){this.sendLocalChanges();var J=this.ui.clonePages(this.file.getShadowPages()),K=this.file.isModified()&&!this.file.isRealtime()?this.ui.diffPages(J,this.ui.pages):null,H=this.file.isRealtime()?this.ui.diffPages(J,this.file.ownPages):null;J=this.ui.applyPatches(J,b);var G=null==k?null:this.ui.getHashValueForPages(J);-EditorUi.debug("DrawioFileSync.merge",[this],"patches",b,"changes",K,"pending",H,"checksum",k,"current",G,"valid",k==G,"attempt",this.catchupRetryCount,"of",this.maxCatchupRetries,"from",this.file.getCurrentRevisionId(),"to",A,"etag",this.file.getDescriptorEtag(m),"immediate",y);if(null!=k&&k!=G){this.reload(mxUtils.bind(this,function(){null!=d&&d()}),mxUtils.bind(this,function(){null!=q&&q()}),u,null,y);return}var c=this.file.getShadowVars();for(k=0;k<b.length;k++)null!=b[k]&&null!=b[k][EditorUi.DIFF_FILE]&&-void 0!==b[k][EditorUi.DIFF_FILE].vars&&(c=b[k][EditorUi.DIFF_FILE].vars);this.file.setShadowPages(J,c);if(null==this.patchRealtime(b,null,H,y))this.file.patch(b,DrawioFile.LAST_WRITE_WINS?K:null);else{var f=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var l=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;f!=l&&(this.ui.editor.graph.refresh(),this.snapshotVars=l)}}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),+DrawioFileSync.prototype.merge=function(b,k,m,d,q,u,y){try{this.file.stats.merged++;this.lastModified=new Date;var A=this.file.getDescriptorRevisionId(m);if(!this.file.ignorePatches(b)){this.sendLocalChanges();var J=this.ui.clonePages(this.file.getShadowPages()),K=this.file.isModified()&&!this.file.isRealtime()?this.ui.diffPages(J,this.ui.pages):null,F=this.file.isRealtime()?this.ui.diffPages(J,this.file.ownPages):null;J=this.ui.applyPatches(J,b);var H=null==k?null:this.ui.getHashValueForPages(J);+EditorUi.debug("DrawioFileSync.merge",[this],"patches",b,"changes",K,"pending",F,"checksum",k,"current",H,"valid",k==H,"attempt",this.catchupRetryCount,"of",this.maxCatchupRetries,"from",this.file.getCurrentRevisionId(),"to",A,"etag",this.file.getDescriptorEtag(m),"immediate",y);if(null!=k&&k!=H){this.reload(mxUtils.bind(this,function(){null!=d&&d()}),mxUtils.bind(this,function(){null!=q&&q()}),u,null,y);return}var c=this.file.getShadowVars();for(k=0;k<b.length;k++)null!=b[k]&&null!=b[k][EditorUi.DIFF_FILE]&&+void 0!==b[k][EditorUi.DIFF_FILE].vars&&(c=b[k][EditorUi.DIFF_FILE].vars);this.file.setShadowPages(J,c);if(null==this.patchRealtime(b,null,F,y))this.file.patch(b,DrawioFile.LAST_WRITE_WINS?K:null);else{var f=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var l=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;f!=l&&(this.ui.editor.graph.refresh(),this.snapshotVars=l)}}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),m);null!=d&&d(!0)}catch(t){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=q&&q(t);try{var n=this.file.getCurrentUser(),r=null!=n?n.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),r,t)}catch(x){}}};DrawioFileSync.prototype.fileChanged=function(b,k,m,d,q){var u=window.setTimeout(mxUtils.bind(this,function(){null!=m&&m()||(EditorUi.debug("DrawioFileSync.fileChanged",[this],"lazy",d,"immediate",q,"remoteFileChanged",this.remoteFileChanged,"valid",this.isValidState()),this.isValidState()?(this.remoteFileChanged=!1,this.file.loadPatchDescriptor(mxUtils.bind(this,function(y){null!=m&&m()||(this.isValidState()?this.catchup(y,b,k,m,q):null!=k&&k())}),k)):null!=k&&k())}),d?this.cacheReadyDelay:0);return this.notifyThread=u};@@ -14579,19 +14583,19 @@ this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;k=this.cleanupThreadDrawioFileSync.prototype.reloadDescriptor=function(){this.file.loadDescriptor(mxUtils.bind(this,function(b){null!=b?(this.file.setDescriptorRevisionId(b,this.file.getCurrentRevisionId()),this.updateDescriptor(b),this.fileChangedNotify()):(this.file.inConflictState=!0,this.file.handleFileError())}),mxUtils.bind(this,function(b){this.file.inConflictState=!0;this.file.handleFileError(b)}))};DrawioFileSync.prototype.updateDescriptor=function(b){this.file.setDescriptor(b);this.file.descriptorChanged();this.start()};DrawioFileSync.prototype.catchup=function(b,k,m,d,q){if(null!=b&&(null==d||!d())){var u=this.file.getCurrentRevisionId(),y=this.file.getDescriptorRevisionId(b);EditorUi.debug("DrawioFileSync.catchup",[this],"desc",[b],"from",u,"to",y,"immediate",q,"valid",this.isValidState());if(u==y)this.file.patchDescriptor(this.file.getDescriptor(),b),"1"==urlParams.test&&EditorUi.debug("DrawioFileSync.catchup",[this],"up to date","cleanup",this.cleanupThread,"checksum",this.ui.getHashValueForPages(this.ui.pages)),-document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||null!=this.cleanupThread||this.testChecksum(),null!=k&&k(!0);else if(this.isValidState()){var A=this.file.getDescriptorChecksum(b),J=this.file.getDescriptorSecret(b);if(null!=A&&A==this.ui.getHashValueForPages(this.ui.pages))this.fastForward(b),null!=k&&k(!0);else if(Editor.enableRealtimeCache&&null!=J&&"1"!=urlParams.lockdown){var K=0,H=!1,G=mxUtils.bind(this,function(){if(null==d||!d())if(u!=this.file.getCurrentRevisionId())null!=k&&+document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||null!=this.cleanupThread||this.testChecksum(),null!=k&&k(!0);else if(this.isValidState()){var A=this.file.getDescriptorChecksum(b),J=this.file.getDescriptorSecret(b);if(null!=A&&A==this.ui.getHashValueForPages(this.ui.pages))this.fastForward(b),null!=k&&k(!0);else if(Editor.enableRealtimeCache&&null!=J&&"1"!=urlParams.lockdown){var K=0,F=!1,H=mxUtils.bind(this,function(){if(null==d||!d())if(u!=this.file.getCurrentRevisionId())null!=k&&k(!0);else if(this.isValidState()){this.scheduleCleanup(!0);var c=!0,f=window.setTimeout(mxUtils.bind(this,function(){c=!1;this.reload(k,m,d,null,q)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(u)+"&to="+encodeURIComponent(y)+(null!=J?"&secret="+encodeURIComponent(J):""),mxUtils.bind(this,function(l){this.file.stats.bytesReceived+=l.getText().length;window.clearTimeout(f);if(c&&(null==d||!d()))if(u!=this.file.getCurrentRevisionId())null!=-k&&k(!0);else if(this.isValidState()){var n=null,r=[];EditorUi.debug("DrawioFileSync.doCatchup",[this],"request",[l],"status",l.getStatus(),"cacheReadyRetryCount",K,"maxCacheReadyRetries",this.maxCacheReadyRetries);if(200<=l.getStatus()&&299>=l.getStatus()&&0<l.getText().length)try{var t=JSON.parse(l.getText());if(null!=t&&0<t.length)for(var x=0;x<t.length;x++){var B=this.stringToObject(t[x]);if(B.v>DrawioFileSync.PROTOCOL){H=!0;r=[];break}else if(B.v===DrawioFileSync.PROTOCOL&&null!=B.d)n=B.d.checksum,-r.push(B.d.patch);else{H=!0;r=[];break}}EditorUi.debug("DrawioFileSync.doCatchup",[this],"response",[t],"status",H?"failed":"ok","temp",r,"checksum",n)}catch(F){r=[],null!=window.console&&"1"==urlParams.test&&console.log(F)}try{0<r.length?(this.file.stats.cacheHits++,this.merge(r,n,b,k,m,d,q)):K<=this.maxCacheReadyRetries-1&&!H&&401!=l.getStatus()&&503!=l.getStatus()&&410!=l.getStatus()?(K++,this.file.stats.cacheMiss++,window.setTimeout(G,(K+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,-this.reload(k,m,d,null,q))}catch(F){null!=m&&m(F)}}else null!=m&&m()}),m)}else null!=m&&m()});window.setTimeout(G,this.cacheReadyDelay)}else this.reload(k,m,d,null,q)}else null!=m&&m()}};DrawioFileSync.prototype.reload=function(b,k,m,d,q){EditorUi.debug("DrawioFileSync.reload",[this],"immediate",q);this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=b&&b()}),mxUtils.bind(this,function(u){null!=k&&k(u)}),m,d,q)};+k&&k(!0);else if(this.isValidState()){var n=null,r=[];EditorUi.debug("DrawioFileSync.doCatchup",[this],"request",[l],"status",l.getStatus(),"cacheReadyRetryCount",K,"maxCacheReadyRetries",this.maxCacheReadyRetries);if(200<=l.getStatus()&&299>=l.getStatus()&&0<l.getText().length)try{var t=JSON.parse(l.getText());if(null!=t&&0<t.length)for(var x=0;x<t.length;x++){var B=this.stringToObject(t[x]);if(B.v>DrawioFileSync.PROTOCOL){F=!0;r=[];break}else if(B.v===DrawioFileSync.PROTOCOL&&null!=B.d)n=B.d.checksum,+r.push(B.d.patch);else{F=!0;r=[];break}}EditorUi.debug("DrawioFileSync.doCatchup",[this],"response",[t],"status",F?"failed":"ok","temp",r,"checksum",n)}catch(G){r=[],null!=window.console&&"1"==urlParams.test&&console.log(G)}try{0<r.length?(this.file.stats.cacheHits++,this.merge(r,n,b,k,m,d,q)):K<=this.maxCacheReadyRetries-1&&!F&&401!=l.getStatus()&&503!=l.getStatus()&&410!=l.getStatus()?(K++,this.file.stats.cacheMiss++,window.setTimeout(H,(K+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,+this.reload(k,m,d,null,q))}catch(G){null!=m&&m(G)}}else null!=m&&m()}),m)}else null!=m&&m()});window.setTimeout(H,this.cacheReadyDelay)}else this.reload(k,m,d,null,q)}else null!=m&&m()}};DrawioFileSync.prototype.reload=function(b,k,m,d,q){EditorUi.debug("DrawioFileSync.reload",[this],"immediate",q);this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=b&&b()}),mxUtils.bind(this,function(u){null!=k&&k(u)}),m,d,q)};DrawioFileSync.prototype.descriptorChanged=function(b){this.lastModified=this.file.getLastModifiedDate();if(null!=this.channelId){var k=this.objectToString(this.createMessage({a:"desc",m:this.lastModified.getTime()})),m=this.file.getCurrentRevisionId(),d=this.objectToString({});mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(b)+"&to="+encodeURIComponent(m)+"&msg="+encodeURIComponent(k)+"&data="+encodeURIComponent(d));this.file.stats.bytesSent+=d.length;this.file.stats.msgSent++;EditorUi.debug("DrawioFileSync.descriptorChanged",[this],"from",b,"to",m)}this.updateStatus()};DrawioFileSync.prototype.objectToString=function(b){b=Graph.compress(JSON.stringify(b));null!=this.key&&"undefined"!==typeof CryptoJS&&(b=CryptoJS.AES.encrypt(b,this.key).toString());return b};DrawioFileSync.prototype.stringToObject=function(b){null!=this.key&&"undefined"!==typeof CryptoJS&&(b=CryptoJS.AES.decrypt(b,this.key).toString(CryptoJS.enc.Utf8));return JSON.parse(Graph.decompress(b))};DrawioFileSync.prototype.createToken=function(b,k,m){var d=!0,q=window.setTimeout(mxUtils.bind(this,function(){d=!1;m({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&secret="+encodeURIComponent(b),mxUtils.bind(this,function(u){window.clearTimeout(q);d&&(200<=u.getStatus()&&299>=u.getStatus()?k(u.getText()):m({code:u.getStatus(),message:"Token Error "+u.getStatus()}))}),m)};DrawioFileSync.prototype.fileSaving=function(){this.file.isOptimisticSync()&&this.notify(this.createMessage({m:Date.now(),type:"optimistic"}));EditorUi.debug("DrawioFileSync.fileSaving",[this],"optimistic",this.file.isOptimisticSync())};DrawioFileSync.prototype.fileDataUpdated=function(){this.scheduleCleanup(!0);EditorUi.debug("DrawioFileSync.fileDataUpdated",[this])};DrawioFileSync.prototype.fileSaved=function(b,k,m,d,q,u){this.lastModified=this.file.getLastModifiedDate();this.resetUpdateStatusThread();this.catchupRetryCount=0;if(!this.ui.isOffline(!0)&&!this.file.inConflictState&&!this.file.redirectDialogShowing&&(this.start(),null!=this.channelId)){var y=this.file.getDescriptorSecret(this.file.getDescriptor()),A=this.createMessage({m:this.lastModified.getTime()}),J=this.file.getDescriptorRevisionId(k),K=this.file.getCurrentRevisionId();if(null!=y&&null!=q&&-"1"!=urlParams.lockdown&&Editor.enableRealtimeCache){var H=this.ui.diffPages(this.file.getShadowPages(),b),G=this.file.getShadowVars(),c=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;c!=G&&(H[EditorUi.DIFF_FILE]={vars:c});k=this.file.getDescriptorSecret(k);u=null!=u?u:this.ui.getHashValueForPages(b);G=this.objectToString(this.createMessage({patch:H,checksum:u}));this.file.stats.bytesSent+=G.length;this.file.stats.msgSent++;var f=!0,l=window.setTimeout(mxUtils.bind(this,function(){f=-!1;d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(J)+"&to="+encodeURIComponent(K)+(Editor.p2pSyncNotify?"":"&msg="+encodeURIComponent(this.objectToString(A)))+(null!=y?"&secret="+encodeURIComponent(y):"")+(null!=k?"&last-secret="+encodeURIComponent(k):"")+(G.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(G):"")+(null!=q?"&token="+encodeURIComponent(q):""),mxUtils.bind(this,-function(n){window.clearTimeout(l);f&&(200<=n.getStatus()&&299>=n.getStatus()?(Editor.p2pSyncNotify&&this.notify(A),null!=m&&m()):d({message:mxResources.get("realtimeCollaboration")+(0!=n.getStatus()?": "+n.getStatus():"")}))}));EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",J,"to",K,"etag",this.file.getCurrentEtag(),"diff",H,G.length,"bytes","msg",A,"checksum",u)}else this.notify(A),null!=m&&m(),EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",J,"to",K,"etag",this.file.getCurrentEtag())}this.file.setShadowPages(b);+"1"!=urlParams.lockdown&&Editor.enableRealtimeCache){var F=this.ui.diffPages(this.file.getShadowPages(),b),H=this.file.getShadowVars(),c=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;c!=H&&(F[EditorUi.DIFF_FILE]={vars:c});k=this.file.getDescriptorSecret(k);u=null!=u?u:this.ui.getHashValueForPages(b);H=this.objectToString(this.createMessage({patch:F,checksum:u}));this.file.stats.bytesSent+=H.length;this.file.stats.msgSent++;var f=!0,l=window.setTimeout(mxUtils.bind(this,function(){f=+!1;d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(J)+"&to="+encodeURIComponent(K)+(Editor.p2pSyncNotify?"":"&msg="+encodeURIComponent(this.objectToString(A)))+(null!=y?"&secret="+encodeURIComponent(y):"")+(null!=k?"&last-secret="+encodeURIComponent(k):"")+(H.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(H):"")+(null!=q?"&token="+encodeURIComponent(q):""),mxUtils.bind(this,+function(n){window.clearTimeout(l);f&&(200<=n.getStatus()&&299>=n.getStatus()?(Editor.p2pSyncNotify&&this.notify(A),null!=m&&m()):d({message:mxResources.get("realtimeCollaboration")+(0!=n.getStatus()?": "+n.getStatus():"")}))}));EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",J,"to",K,"etag",this.file.getCurrentEtag(),"diff",F,H.length,"bytes","msg",A,"checksum",u)}else this.notify(A),null!=m&&m(),EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",J,"to",K,"etag",this.file.getCurrentEtag())}this.file.setShadowPages(b);this.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.scheduleCleanup()};DrawioFileSync.prototype.getIdParameters=function(){var b="id="+this.channelId;null!=this.pusher&&null!=this.pusher.connection&&null!=this.pusher.connection.socket_id&&(b+="&sid="+this.pusher.connection.socket_id);return b};DrawioFileSync.prototype.createMessage=function(b){return{v:DrawioFileSync.PROTOCOL,d:b,c:this.clientId}};DrawioFileSync.prototype.fileConflict=function(b,k,m){this.catchupRetryCount++;EditorUi.debug("DrawioFileSync.fileConflict",[this],"desc",[b],"catchupRetryCount",this.catchupRetryCount,"maxCatchupRetries",this.maxCatchupRetries);this.catchupRetryCount<this.maxCatchupRetries?(this.file.stats.conflicts++,null!=b?this.catchup(b,k,m):this.fileChanged(k,m)):(this.file.stats.timeouts++,this.catchupRetryCount=0,null!=m&&m({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")}))};DrawioFileSync.prototype.stop=function(){null!=this.pusher?(null!=this.pusher.connection&&(this.pusher.connection.unbind("state_change",this.connectionListener),this.pusher.connection.unbind("error",this.pusherErrorListener)),null!=this.channel&&(this.channel.unbind("changed",this.changeListener),this.channel=null),this.pusher.disconnect(),this.pusher=null,null!=this.p2pCollab&&(this.p2pCollab.destroy(),this.p2pCollab=null),EditorUi.debug("DrawioFileSync.stop",[this])):null!=this.polling&&(this.polling.stop(),@@ -14604,7 +14608,7 @@ mxAsyncCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waimxAsyncCanvas.prototype.setAlpha=function(b){this.state.alpha=b};mxAsyncCanvas.prototype.setFontColor=function(b){this.state.fontColor=b};mxAsyncCanvas.prototype.setFontBackgroundColor=function(b){b==mxConstants.NONE&&(b=null);this.state.fontBackgroundColor=b};mxAsyncCanvas.prototype.setFontBorderColor=function(b){b==mxConstants.NONE&&(b=null);this.state.fontBorderColor=b};mxAsyncCanvas.prototype.setFontSize=function(b){this.state.fontSize=b};mxAsyncCanvas.prototype.setFontFamily=function(b){this.state.fontFamily=b};mxAsyncCanvas.prototype.setFontStyle=function(b){this.state.fontStyle=b};mxAsyncCanvas.prototype.rect=function(b,k,m,d){};mxAsyncCanvas.prototype.roundrect=function(b,k,m,d,q,u){};mxAsyncCanvas.prototype.ellipse=function(b,k,m,d){};mxAsyncCanvas.prototype.rewriteImageSource=function(b){if("http://"==b.substring(0,7)||"https://"==b.substring(0,8))b="/proxy?url="+encodeURIComponent(b);return b};mxAsyncCanvas.prototype.image=function(b,k,m,d,q,u,y,A){q=this.rewriteImageSource(q);b=this.htmlCanvas.images[q];null==b&&(b=new Image,b.onload=mxUtils.bind(this,function(){this.decWaitCounter()}),b.onerror=mxUtils.bind(this,function(){this.decWaitCounter()}),this.incWaitCounter(),this.htmlCanvas.images[q]=b,b.src=q)};mxAsyncCanvas.prototype.fill=function(){};mxAsyncCanvas.prototype.stroke=function(){};mxAsyncCanvas.prototype.fillAndStroke=function(){};-mxAsyncCanvas.prototype.text=function(b,k,m,d,q,u,y,A,J,K,H,G){if(null!=q&&0!=q.length&&(b=this.state.scale,"html"==J&&"function"===typeof html2canvas)){this.incWaitCounter();var c=this.canvasIndex++;html2canvas(q,{onrendered:mxUtils.bind(this,function(f){this.htmlCanvas.subCanvas[c]=f;this.decWaitCounter()}),scale:b,logging:!0})}};mxAsyncCanvas.prototype.finish=function(b){0==this.waitCounter?b():this.onComplete=b};function mxJsCanvas(b){mxAbstractCanvas2D.call(this);this.ctx=b.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null;+mxAsyncCanvas.prototype.text=function(b,k,m,d,q,u,y,A,J,K,F,H){if(null!=q&&0!=q.length&&(b=this.state.scale,"html"==J&&"function"===typeof html2canvas)){this.incWaitCounter();var c=this.canvasIndex++;html2canvas(q,{onrendered:mxUtils.bind(this,function(f){this.htmlCanvas.subCanvas[c]=f;this.decWaitCounter()}),scale:b,logging:!0})}};mxAsyncCanvas.prototype.finish=function(b){0==this.waitCounter?b():this.onComplete=b};function mxJsCanvas(b){mxAbstractCanvas2D.call(this);this.ctx=b.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null;mxJsCanvas.prototype.subCanvas=null;mxJsCanvas.prototype.canvasIndex=0;mxJsCanvas.prototype.hexToRgb=function(b){b=b.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(k,m,d,q){return m+m+d+d+q+q});return(b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(b))?{r:parseInt(b[1],16),g:parseInt(b[2],16),b:parseInt(b[3],16)}:null};mxJsCanvas.prototype.incWaitCounter=function(){this.waitCounter++};mxJsCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waitCounter&&null!=this.onComplete&&(this.onComplete(),this.onComplete=null)};mxJsCanvas.prototype.updateFont=function(){var b="";(this.state.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(b+="bold ");(this.state.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(b+="italic ");this.ctx.font=b+this.state.fontSize+"px "+this.state.fontFamily};mxJsCanvas.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state);this.ctx.save()};mxJsCanvas.prototype.restore=function(){this.state=this.states.pop();this.ctx.restore()};mxJsCanvas.prototype.scale=function(b){this.state.scale*=b;this.state.strokeWidth*=b;this.ctx.scale(b,b)};mxJsCanvas.prototype.translate=function(b,k){this.state.dx+=b;this.state.dy+=k;this.ctx.translate(b,k)};@@ -14619,13 +14623,13 @@ mxJsCanvas.prototype.setShadowOffset=function(b,k){this.state.shadowDx=b;this.stmxJsCanvas.prototype.arcTo=function(b,k,m,d,q,u,y){b=mxUtils.arcToCurves(this.lastMoveX,this.lastMoveY,b,k,m,d,q,u,y);if(null!=b)for(k=0;k<b.length;k+=6)this.curveTo(b[k],b[k+1],b[k+2],b[k+3],b[k+4],b[k+5])};mxJsCanvas.prototype.curveTo=function(b,k,m,d,q,u){this.ctx.bezierCurveTo(b,k,m,d,q,u);this.lastMoveX=q;this.lastMoveY=u};mxJsCanvas.prototype.rect=function(b,k,m,d){this.begin();this.moveTo(b,k);this.lineTo(b+m,k);this.lineTo(b+m,k+d);this.lineTo(b,k+d);this.close()};mxJsCanvas.prototype.roundrect=function(b,k,m,d,q,u){this.begin();this.moveTo(b+q,k);this.lineTo(b+m-q,k);this.quadTo(b+m,k,b+m,k+u);this.lineTo(b+m,k+d-u);this.quadTo(b+m,k+d,b+m-q,k+d);this.lineTo(b+q,k+d);this.quadTo(b,k+d,b,k+d-u);this.lineTo(b,k+u);this.quadTo(b,k,b+q,k)};mxJsCanvas.prototype.ellipse=function(b,k,m,d){this.ctx.save();this.ctx.translate(b+m/2,k+d/2);this.ctx.scale(m/2,d/2);this.ctx.beginPath();this.ctx.arc(0,0,1,0,2*Math.PI,!1);this.ctx.restore()};mxJsCanvas.prototype.rewriteImageSource=function(b){if("http://"==b.substring(0,7)||"https://"==b.substring(0,8))b="/proxy?url="+encodeURIComponent(b);return b};-mxJsCanvas.prototype.image=function(b,k,m,d,q,u,y,A){q=this.rewriteImageSource(q);q=this.images[q];if(null!=q&&0<q.height&&0<q.width){var J=this.ctx;J.save();if(u){u=q.width;var K=q.height,H=Math.min(m/u,d/K);b+=(m-u*H)/2;k+=(d-K*H)/2;m=u*H;d=K*H}y&&(J.translate(2*b+m,0),J.scale(-1,1));A&&(J.translate(0,2*k+d),J.scale(1,-1));J.drawImage(q,b,k,m,d);J.restore()}};mxJsCanvas.prototype.begin=function(){this.ctx.beginPath()};mxJsCanvas.prototype.close=function(){this.ctx.closePath()};+mxJsCanvas.prototype.image=function(b,k,m,d,q,u,y,A){q=this.rewriteImageSource(q);q=this.images[q];if(null!=q&&0<q.height&&0<q.width){var J=this.ctx;J.save();if(u){u=q.width;var K=q.height,F=Math.min(m/u,d/K);b+=(m-u*F)/2;k+=(d-K*F)/2;m=u*F;d=K*F}y&&(J.translate(2*b+m,0),J.scale(-1,1));A&&(J.translate(0,2*k+d),J.scale(1,-1));J.drawImage(q,b,k,m,d);J.restore()}};mxJsCanvas.prototype.begin=function(){this.ctx.beginPath()};mxJsCanvas.prototype.close=function(){this.ctx.closePath()};mxJsCanvas.prototype.fill=function(){this.ctx.fill()};mxJsCanvas.prototype.stroke=function(){this.ctx.stroke()};mxJsCanvas.prototype.fillAndStroke=function(){if(this.state.shadow){this.ctx.stroke();this.ctx.fill();var b=this.ctx.shadowColor,k=this.ctx.shadowOffsetX,m=this.ctx.shadowOffsetY;this.ctx.shadowColor="transparent";this.ctx.shadowOffsetX=0;this.ctx.shadowOffsetY=0;this.ctx.stroke();this.ctx.shadowColor=b;this.ctx.shadowOffsetX=k;this.ctx.shadowOffsetY=m}else this.ctx.fill(),this.ctx.stroke()};-mxJsCanvas.prototype.text=function(b,k,m,d,q,u,y,A,J,K,H,G){if(null!=q&&0!=q.length){m=this.state.scale;0!=G&&(this.ctx.translate(Math.round(b),Math.round(k)),this.ctx.rotate(G*Math.PI/180),this.ctx.translate(Math.round(-b),Math.round(-k)));if("html"==J){q=this.subCanvas[this.canvasIndex++];J=q.height;G=q.width;switch(y){case mxConstants.ALIGN_MIDDLE:k-=J/2/m;break;case mxConstants.ALIGN_BOTTOM:k-=J/m}switch(u){case mxConstants.ALIGN_CENTER:b-=G/2/m;break;case mxConstants.ALIGN_RIGHT:b-=G/m}this.ctx.save();+mxJsCanvas.prototype.text=function(b,k,m,d,q,u,y,A,J,K,F,H){if(null!=q&&0!=q.length){m=this.state.scale;0!=H&&(this.ctx.translate(Math.round(b),Math.round(k)),this.ctx.rotate(H*Math.PI/180),this.ctx.translate(Math.round(-b),Math.round(-k)));if("html"==J){q=this.subCanvas[this.canvasIndex++];J=q.height;H=q.width;switch(y){case mxConstants.ALIGN_MIDDLE:k-=J/2/m;break;case mxConstants.ALIGN_BOTTOM:k-=J/m}switch(u){case mxConstants.ALIGN_CENTER:b-=H/2/m;break;case mxConstants.ALIGN_RIGHT:b-=H/m}this.ctx.save();if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor)null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(Math.round(b)-.5,Math.round(k)-.5,Math.round(q.width/m),Math.round(q.height/m))),null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(Math.round(b)-.5,Math.round(k)-.5,Math.round(q.width/m),Math.round(q.height/m)));this.ctx.scale(1/m,1/m);this.ctx.drawImage(q,-Math.round(b*m),Math.round(k*m))}else{this.ctx.save();this.updateFont();G=document.createElement("div");G.innerHTML=q;G.style.position="absolute";G.style.top="-9999px";G.style.left="-9999px";G.style.fontFamily=this.state.fontFamily;G.style.fontWeight="bold";G.style.fontSize=this.state.fontSize+"pt";document.body.appendChild(G);J=[G.offsetWidth,G.offsetHeight];document.body.removeChild(G);q=q.split("\n");G=J[1];this.ctx.textBaseline="top";J=k;switch(y){case mxConstants.ALIGN_MIDDLE:this.ctx.textBaseline=-"middle";k-=(q.length-1)*G/2;J=k-this.state.fontSize/2;break;case mxConstants.ALIGN_BOTTOM:this.ctx.textBaseline="alphabetic",k-=G*(q.length-1),J=k-this.state.fontSize}y=[];G=[];for(m=0;m<q.length;m++)G[m]=b,y[m]=this.ctx.measureText(q[m]).width,null!=u&&u!=mxConstants.ALIGN_LEFT&&(G[m]-=y[m],u==mxConstants.ALIGN_CENTER&&(G[m]+=y[m]/2));if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor){b=G[0];u=y[0];for(m=1;m<q.length;m++)b=Math.min(b,G[m]),u=Math.max(u,y[m]);this.ctx.save();-b=Math.round(b)-.5;J=Math.round(J)-.5;null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(b,J,u,this.state.fontSize*mxConstants.LINE_HEIGHT*q.length));null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(b,J,u,this.state.fontSize*mxConstants.LINE_HEIGHT*q.length));this.ctx.restore()}for(m=0;m<q.length;m++)this.ctx.fillText(q[m],G[m],k),k+=this.state.fontSize*mxConstants.LINE_HEIGHT}this.ctx.restore()}};+Math.round(b*m),Math.round(k*m))}else{this.ctx.save();this.updateFont();H=document.createElement("div");H.innerHTML=q;H.style.position="absolute";H.style.top="-9999px";H.style.left="-9999px";H.style.fontFamily=this.state.fontFamily;H.style.fontWeight="bold";H.style.fontSize=this.state.fontSize+"pt";document.body.appendChild(H);J=[H.offsetWidth,H.offsetHeight];document.body.removeChild(H);q=q.split("\n");H=J[1];this.ctx.textBaseline="top";J=k;switch(y){case mxConstants.ALIGN_MIDDLE:this.ctx.textBaseline=+"middle";k-=(q.length-1)*H/2;J=k-this.state.fontSize/2;break;case mxConstants.ALIGN_BOTTOM:this.ctx.textBaseline="alphabetic",k-=H*(q.length-1),J=k-this.state.fontSize}y=[];H=[];for(m=0;m<q.length;m++)H[m]=b,y[m]=this.ctx.measureText(q[m]).width,null!=u&&u!=mxConstants.ALIGN_LEFT&&(H[m]-=y[m],u==mxConstants.ALIGN_CENTER&&(H[m]+=y[m]/2));if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor){b=H[0];u=y[0];for(m=1;m<q.length;m++)b=Math.min(b,H[m]),u=Math.max(u,y[m]);this.ctx.save();+b=Math.round(b)-.5;J=Math.round(J)-.5;null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(b,J,u,this.state.fontSize*mxConstants.LINE_HEIGHT*q.length));null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(b,J,u,this.state.fontSize*mxConstants.LINE_HEIGHT*q.length));this.ctx.restore()}for(m=0;m<q.length;m++)this.ctx.fillText(q[m],H[m],k),k+=this.state.fontSize*mxConstants.LINE_HEIGHT}this.ctx.restore()}};mxJsCanvas.prototype.getCanvas=function(){return canvas};mxJsCanvas.prototype.finish=function(b){0==this.waitCounter?b():this.onComplete=b};function GifEncoder(b,k){this.width=b;this.height=k;this.delay=100;this.repeat=0;this.transparent=!1;this.dispose=2;this.out=[];this.frameCount=0;this.started=!1}GifEncoder.prototype.setDelay=function(b){this.delay=Math.max(10,Math.round(b))};GifEncoder.prototype.setRepeat=function(b){this.repeat=b};GifEncoder.prototype.setTransparent=function(b){this.transparent=b};GifEncoder.prototype.addFrame=function(b){var k=b.getContext("2d").getImageData(0,0,this.width,this.height).data,m=k.length/4;if(this.started){b=this.globalPalette;var d=this.globalTransparentIndex;var q=new Uint8Array(m);for(var u=0;u<m;u++){var y=4*u;q[u]=this.transparent&&128>k[y+3]?d:GifEncoder.findClosest(b,k[y],k[y+1],k[y+2],d)}}else k=GifEncoder.quantize(k,256,this.transparent),b=k.palette,q=k.indexedPixels,d=k.transparentIndex,this.globalPalette=b,this.globalTransparentIndex=d,this.started=!0,this.writeHeader(),this.writeLogicalScreenDescriptor(b),this.writeGlobalColorTable(b),0<=this.repeat&&this.writeNetscapeExtension();this.writeGraphicControlExtension(d);this.writeImageDescriptor();this.writeImageData(q,b);this.frameCount++};GifEncoder.prototype.finish=function(){if(!this.started)return null;this.out.push(59);return new Blob([new Uint8Array(this.out)],{type:"image/gif"})};GifEncoder.prototype.writeHeader=function(){this.writeString("GIF89a")};@@ -14635,16 +14639,16 @@ GifEncoder.prototype.writeImageDescriptor=function(){this.out.push(44);this.writGifEncoder.prototype.writeShort=function(b){this.out.push(b&255);this.out.push(b>>8&255)};GifEncoder.prototype.writeString=function(b){for(var k=0;k<b.length;k++)this.out.push(b.charCodeAt(k))};GifEncoder.colorTableSizeFor=function(b){for(var k=0;2<<k<b;)k++;return Math.min(k,7)};GifEncoder.colorTableEntries=function(b){for(var k=2;k<b;)k*=2;return Math.min(k,256)};GifEncoder.colorDepthFor=function(b){for(var k=1;1<<k<b;)k++;return k};GifEncoder.quantize=function(b,k,m){var d=b.length/4,q=-1;m&&--k;for(var u=[],y=1E5<d?Math.floor(d/5E4):1,A=0;A<d;A+=y){var J=4*A;128>b[J+3]||u.push([b[J],b[J+1],b[J+2]])}u.length<=k?(y=GifEncoder.uniqueColors(u),y.length>k&&(y=GifEncoder.medianCut(u,k))):y=GifEncoder.medianCut(u,k);for(;2>y.length;)y.push([0,0,0]);m&&(q=y.length,y.push([0,0,0]));k=new Uint8Array(d);for(A=0;A<d;A++)J=4*A,k[A]=m&&128>b[J+3]?q:GifEncoder.findClosest(y,b[J],b[J+1],b[J+2],q);return{palette:y,indexedPixels:k,transparentIndex:q}};GifEncoder.uniqueColors=function(b){for(var k={},m=[],d=0;d<b.length;d++){var q=b[d][0]<<16|b[d][1]<<8|b[d][2];null==k[q]&&(k[q]=!0,m.push(b[d]))}return m};-GifEncoder.medianCut=function(b,k){if(0==b.length)return[[0,0,0]];for(b=[b];b.length<k;){for(var m=-1,d=0,q=0;q<b.length;q++)if(!(1>=b[q].length)){var u=GifEncoder.colorRange(b[q]);u.maxRange>m&&(m=u.maxRange,d=q)}if(0>=m)break;q=b[d];u=GifEncoder.colorRange(q);q.sort(function(K,H){return K[u.channel]-H[u.channel]});m=Math.floor(q.length/2);b.splice(d,1,q.slice(0,m),q.slice(m))}k=[];for(q=0;q<b.length;q++){d=b[q];for(var y=m=0,A=0,J=0;J<d.length;J++)m+=d[J][0],y+=d[J][1],A+=d[J][2];k.push([Math.round(m/+GifEncoder.medianCut=function(b,k){if(0==b.length)return[[0,0,0]];for(b=[b];b.length<k;){for(var m=-1,d=0,q=0;q<b.length;q++)if(!(1>=b[q].length)){var u=GifEncoder.colorRange(b[q]);u.maxRange>m&&(m=u.maxRange,d=q)}if(0>=m)break;q=b[d];u=GifEncoder.colorRange(q);q.sort(function(K,F){return K[u.channel]-F[u.channel]});m=Math.floor(q.length/2);b.splice(d,1,q.slice(0,m),q.slice(m))}k=[];for(q=0;q<b.length;q++){d=b[q];for(var y=m=0,A=0,J=0;J<d.length;J++)m+=d[J][0],y+=d[J][1],A+=d[J][2];k.push([Math.round(m/d.length),Math.round(y/d.length),Math.round(A/d.length)])}return k};GifEncoder.colorRange=function(b){for(var k=255,m=0,d=255,q=0,u=255,y=0,A=0;A<b.length;A++){var J=b[A];J[0]<k&&(k=J[0]);J[0]>m&&(m=J[0]);J[1]<d&&(d=J[1]);J[1]>q&&(q=J[1]);J[2]<u&&(u=J[2]);J[2]>y&&(y=J[2])}b=m-k;d=q-d;u=y-u;return b>=d&&b>=u?{channel:0,maxRange:b}:d>=b&&d>=u?{channel:1,maxRange:d}:{channel:2,maxRange:u}};-GifEncoder.findClosest=function(b,k,m,d,q){for(var u=Infinity,y=0,A=0;A<b.length;A++)if(A!==q){var J=k-b[A][0],K=m-b[A][1],H=d-b[A][2];J=J*J+K*K+H*H;J<u&&(u=J,y=A)}return y};-GifEncoder.lzwEncode=function(b,k){for(var m=1<<k,d=m+1,q=k+1,u=d+1,y=1<<q,A={},J=0;J<m;J++)A[String(J)]=J;var K=0,H=0,G=[],c=function(n){K|=n<<H;for(H+=q;8<=H;)G.push(K&255),K>>=8,H-=8};c(m);if(0==b.length)return c(d),0<H&&G.push(K&255),new Uint8Array(G);var f=String(b[0]);for(J=1;J<b.length;J++){var l=f+","+b[J];if(null!=A[l])f=l;else{c(A[f]);if(4096>u)A[l]=u,u++,u>y&&12>q&&(q++,y=1<<q);else{c(m);A={};for(u=0;u<m;u++)A[String(u)]=u;q=k+1;u=d+1;y=1<<q}f=String(b[J])}}c(A[f]);c(d);0<H&&G.push(K&255);-return new Uint8Array(G)};function AnimatedGifExport(b){this.editorUi=b}-AnimatedGifExport.prototype.doExport=function(b,k,m){var d=this.editorUi.editor.graph,q=this.editorUi.editor;b=b||{};var u=b.fps||15,y=b.scale||1,A=b.border||0,J=b.transparent||!1,K=null!=b.repeat?b.repeat:0,H=J?null:null!=b.background&&b.background!=mxConstants.NONE?b.background:"light-dark(#ffffff,"+Editor.darkColor+")",G=b.theme||null;try{var c=d.getSvg(H,y,A,!0,null,!0,null,null,null,d.shadowVisible,null,G),f=AnimatedGifExport.findAnimatedPaths(c);if(0==f.length)null!=m&&m(Error(mxResources.get("noAnimationsInDiagram")));-else{var l=b.duration||AnimatedGifExport.detectDuration(f)||1E3,n=Math.max(2,Math.round(u*l/1E3));AnimatedGifExport.removeAnimationCss(c,f);q.convertImages(c,mxUtils.bind(this,function(r){try{this.renderFrames(r,f,n,u,y,J,K,H,G,k,m)}catch(t){null!=m&&m(t)}}),null,q.createImageUrlConverter())}}catch(r){null!=m&&m(r)}};-AnimatedGifExport.prototype.renderFrames=function(b,k,m,d,q,u,y,A,J,K,H){var G=parseInt(b.getAttribute("width")),c=parseInt(b.getAttribute("height"));if(isNaN(G)||isNaN(c)||0>=G||0>=c)null!=H&&H(Error("Invalid SVG dimensions"));else{var f=this.editorUi.editor.getMaxCanvasScale(G,c,1);1>f&&(G=Math.ceil(G*f),c=Math.ceil(c*f));var l=new GifEncoder(G,c);l.setDelay(Math.round(1E3/d));l.setRepeat(y);l.setTransparent(u);var n=null;null!=A&&(d=mxUtils.getLightDarkColor(A),n="dark"==J&&"none"!=this.editorUi.editor.graph.getAdaptiveColors()?-d.dark:d.light);var r=0,t=mxUtils.bind(this,function(){if(r>=m)try{var x=l.finish();K(x)}catch(T){null!=H&&H(T)}else{x=1<m?r/m:0;for(var B=0;B<k.length;B++){var F=k[B];if("alternate"===F.direction||"alternate-reverse"===F.direction){var L=.5>x?2*x:2*(1-x);L="alternate"===F.direction?F.dashSum*(1-L):F.dashSum*L}else L="reverse"===F.direction?F.dashSum*x:F.dashSum*(1-x);F.node.style.strokeDashoffset=L}x=Editor.createSvgDataUri(mxUtils.getXml(b));var D=new Image;D.onload=function(){try{var T=document.createElement("canvas");-T.width=G;T.height=c;var N=T.getContext("2d");null!=n&&(N.fillStyle=n,N.fillRect(0,0,G,c));1>f&&N.scale(f,f);N.drawImage(D,0,0);l.addFrame(T);r++;setTimeout(t,0)}catch(R){null!=H&&H(R)}};D.onerror=function(){null!=H&&H(Error("Failed to render SVG frame"))};D.src=x}});t()}};+GifEncoder.findClosest=function(b,k,m,d,q){for(var u=Infinity,y=0,A=0;A<b.length;A++)if(A!==q){var J=k-b[A][0],K=m-b[A][1],F=d-b[A][2];J=J*J+K*K+F*F;J<u&&(u=J,y=A)}return y};+GifEncoder.lzwEncode=function(b,k){for(var m=1<<k,d=m+1,q=k+1,u=d+1,y=1<<q,A={},J=0;J<m;J++)A[String(J)]=J;var K=0,F=0,H=[],c=function(n){K|=n<<F;for(F+=q;8<=F;)H.push(K&255),K>>=8,F-=8};c(m);if(0==b.length)return c(d),0<F&&H.push(K&255),new Uint8Array(H);var f=String(b[0]);for(J=1;J<b.length;J++){var l=f+","+b[J];if(null!=A[l])f=l;else{c(A[f]);if(4096>u)A[l]=u,u++,u>y&&12>q&&(q++,y=1<<q);else{c(m);A={};for(u=0;u<m;u++)A[String(u)]=u;q=k+1;u=d+1;y=1<<q}f=String(b[J])}}c(A[f]);c(d);0<F&&H.push(K&255);+return new Uint8Array(H)};function AnimatedGifExport(b){this.editorUi=b}+AnimatedGifExport.prototype.doExport=function(b,k,m){var d=this.editorUi.editor.graph,q=this.editorUi.editor;b=b||{};var u=b.fps||15,y=b.scale||1,A=b.border||0,J=b.transparent||!1,K=null!=b.repeat?b.repeat:0,F=J?null:null!=b.background&&b.background!=mxConstants.NONE?b.background:"light-dark(#ffffff,"+Editor.darkColor+")",H=b.theme||null;try{var c=d.getSvg(F,y,A,!0,null,!0,null,null,null,d.shadowVisible,null,H),f=AnimatedGifExport.findAnimatedPaths(c);if(0==f.length)null!=m&&m(Error(mxResources.get("noAnimationsInDiagram")));+else{var l=b.duration||AnimatedGifExport.detectDuration(f)||1E3,n=Math.max(2,Math.round(u*l/1E3));AnimatedGifExport.removeAnimationCss(c,f);q.convertImages(c,mxUtils.bind(this,function(r){try{this.renderFrames(r,f,n,u,y,J,K,F,H,k,m)}catch(t){null!=m&&m(t)}}),null,q.createImageUrlConverter())}}catch(r){null!=m&&m(r)}};+AnimatedGifExport.prototype.renderFrames=function(b,k,m,d,q,u,y,A,J,K,F){var H=parseInt(b.getAttribute("width")),c=parseInt(b.getAttribute("height"));if(isNaN(H)||isNaN(c)||0>=H||0>=c)null!=F&&F(Error("Invalid SVG dimensions"));else{var f=this.editorUi.editor.getMaxCanvasScale(H,c,1);1>f&&(H=Math.ceil(H*f),c=Math.ceil(c*f));var l=new GifEncoder(H,c);l.setDelay(Math.round(1E3/d));l.setRepeat(y);l.setTransparent(u);var n=null;null!=A&&(d=mxUtils.getLightDarkColor(A),n="dark"==J&&"none"!=this.editorUi.editor.graph.getAdaptiveColors()?+d.dark:d.light);var r=0,t=mxUtils.bind(this,function(){if(r>=m)try{var x=l.finish();K(x)}catch(T){null!=F&&F(T)}else{x=1<m?r/m:0;for(var B=0;B<k.length;B++){var G=k[B];if("alternate"===G.direction||"alternate-reverse"===G.direction){var L=.5>x?2*x:2*(1-x);L="alternate"===G.direction?G.dashSum*(1-L):G.dashSum*L}else L="reverse"===G.direction?G.dashSum*x:G.dashSum*(1-x);G.node.style.strokeDashoffset=L}x=Editor.createSvgDataUri(mxUtils.getXml(b));var D=new Image;D.onload=function(){try{var T=document.createElement("canvas");+T.width=H;T.height=c;var N=T.getContext("2d");null!=n&&(N.fillStyle=n,N.fillRect(0,0,H,c));1>f&&N.scale(f,f);N.drawImage(D,0,0);l.addFrame(T);r++;setTimeout(t,0)}catch(R){null!=F&&F(R)}};D.onerror=function(){null!=F&&F(Error("Failed to render SVG frame"))};D.src=x}});t()}};AnimatedGifExport.findAnimatedPaths=function(b){var k=[];b=b.getElementsByTagName("path");for(var m=0;m<b.length;m++){var d=b[m],q=d.style.animation||d.getAttribute("style");if(null!=q&&0<=q.indexOf("ge-flow-animation")){var u=parseFloat(d.style.strokeDashoffset);isNaN(u)&&(u=parseFloat(d.getAttribute("stroke-dashoffset")));if(!isNaN(u)&&0<u){var y="normal";"string"===typeof q&&(0<=q.indexOf("alternate-reverse")?y="alternate-reverse":0<=q.indexOf("alternate")?y="alternate":0<=q.indexOf("reverse")&&(y="reverse"));var A=500;q="string"===typeof q?q.match(/(\d+)ms/):null;null!=q&&(A=parseInt(q[1]));k.push({node:d,dashSum:u,duration:A,direction:y})}}}return k};AnimatedGifExport.detectDuration=function(b){for(var k=0,m=0;m<b.length;m++)b[m].duration>k&&(k=b[m].duration);return k};AnimatedGifExport.removeAnimationCss=function(b,k){for(var m=0;m<k.length;m++)k[m].node.style.animation="",k[m].node.style.animationName="";m=b.getElementsByTagName("defs");if(0<m.length)for(b=m[0].getElementsByTagName("style"),m=b.length-1;0<=m;m--)null!=b[m].innerHTML&&0<=b[m].innerHTML.indexOf("ge-flow-animation")&&b[m].parentNode.removeChild(b[m])};DrawioClient=function(b,k){mxEventSource.call(this);this.ui=b;this.cookieName=k;this.token=this.getPersistentToken()};mxUtils.extend(DrawioClient,mxEventSource);DrawioClient.prototype.token=null;DrawioClient.prototype.user=null;DrawioClient.prototype.setUser=function(b){this.user=b;this.fireEvent(new mxEventObject("userChanged"))};DrawioClient.prototype.getUser=function(){return this.user};@@ -14655,8 +14659,8 @@ DriveFile.prototype.isConflict=function(b){return null!=b&&null!=b.error&&412==bDriveFile.prototype.getFolderUrl=function(){return null!=this.desc.labels&&this.desc.labels.trashed?"https://drive.google.com/drive/trash":null!=this.desc.parents&&0<this.desc.parents.length?"https://drive.google.com/drive/folders/"+this.desc.parents[0].id:null};DriveFile.prototype.getPublicUrl=function(b){this.ui.drive.executeRequest({url:"/files/"+this.desc.id+"/permissions?supportsAllDrives=true"},mxUtils.bind(this,function(k){if(null!=k&&null!=k.items)for(var m=0;m<k.items.length;m++)if("anyoneWithLink"===k.items[m].id||"anyone"===k.items[m].id){b(this.desc.webContentLink);return}b(null)}),mxUtils.bind(this,function(){b(null)}))};DriveFile.prototype.isAutosaveOptional=function(){return!0};DriveFile.prototype.isRenamable=function(){return this.isEditable()&&DrawioFile.prototype.isEditable.apply(this,arguments)};DriveFile.prototype.isMovable=function(){return this.isEditable()};DriveFile.prototype.isTrashed=function(){return this.desc.labels.trashed};DriveFile.prototype.save=function(b,k,m,d,q){DrawioFile.prototype.save.apply(this,[b,mxUtils.bind(this,function(){this.saveFile(null,b,k,m,d,q)}),m,d,q])};-DriveFile.prototype.saveFile=function(b,k,m,d,q,u){try{this.isEditable()?this.savingFile||(this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.createSecret(mxUtils.bind(this,function(y,A){var J=mxUtils.bind(this,function(K,H){try{var G=this.desc;null!=this.sync&&this.sync.fileSaving();this.ui.drive.saveFile(this,H,mxUtils.bind(this,function(c,f,l,n){try{this.savingFile=!1,0!=c?(this.setModified(this.getShadowModified()),k&&(this.lastAutosaveRevision=(new Date).getTime()),-this.autosaveDelay=Math.round(Math.min(1E4,Math.max(DriveFile.prototype.autosaveDelay,this.saveDelay))),this.desc=c,this.fileSaved(f,G,mxUtils.bind(this,function(){this.contentChanged();"function"===typeof m&&m(c)}),d,A,l,n)):null!=d&&d(c)}catch(r){if(this.savingFile=!1,null!=d)d(r);else throw r;}}),mxUtils.bind(this,function(c,f){try{this.savingFile=!1,this.isConflict(c)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(f,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,+DriveFile.prototype.saveFile=function(b,k,m,d,q,u){try{this.isEditable()?this.savingFile||(this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.createSecret(mxUtils.bind(this,function(y,A){var J=mxUtils.bind(this,function(K,F){try{var H=this.desc;null!=this.sync&&this.sync.fileSaving();this.ui.drive.saveFile(this,F,mxUtils.bind(this,function(c,f,l,n){try{this.savingFile=!1,0!=c?(this.setModified(this.getShadowModified()),k&&(this.lastAutosaveRevision=(new Date).getTime()),+this.autosaveDelay=Math.round(Math.min(1E4,Math.max(DriveFile.prototype.autosaveDelay,this.saveDelay))),this.desc=c,this.fileSaved(f,H,mxUtils.bind(this,function(){this.contentChanged();"function"===typeof m&&m(c)}),d,A,l,n)):null!=d&&d(c)}catch(r){if(this.savingFile=!1,null!=d)d(r);else throw r;}}),mxUtils.bind(this,function(c,f){try{this.savingFile=!1,this.isConflict(c)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(f,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();this.setShadowModified(!1);J(K,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}))):null!=d&&d()):null!=d&&d(c)}catch(l){if(this.savingFile=!1,null!=d)d(l);else throw l;}}),q,q,K,null,y)}catch(c){if(this.savingFile=!1,null!=d)d(c);else throw c;}});J(u,k)}))):null!=m&&m()}catch(y){if(null!=d)d(y);else throw y;}};DriveFile.prototype.copyFile=function(b,k,m){this.isRestricted()?DrawioFile.prototype.copyFile.apply(this,arguments):this.makeCopy(mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,mxResources.get("saving")))try{this.save(!0,b,k)}catch(d){k(d)}}),k,null!=m?m:this.ui.getCopyFilename(this,!0))};DriveFile.prototype.makeCopy=function(b,k,m){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.saveAs(m,mxUtils.bind(this,function(d){null!=this.sync&&(this.sync.stop(),this.sync.channelId=null,this.sync.key=null);this.desc=d;null!=this.sync&&this.sync.start();this.ui.spinner.stop();this.setModified(!1);this.inConflictState=this.invalidChecksum=!1;this.descriptorChanged();b()}),mxUtils.bind(this,function(){this.ui.spinner.stop();null!=k&&k()}))};@@ -14681,35 +14685,35 @@ null;DriveClient.prototype.sameWinAuthMode=!1;DriveClient.prototype.sameWinRedirfunction(){return this.user};DriveClient.prototype.getUsersList=function(){var m=[],d=JSON.parse(this.getPersistentToken(!0)),q=null;if(null!=d){null!=d.current&&(q=d.current.userId,m.push(d[q].user),m[0].isCurrent=!0);for(var u in d)"current"!=u&&u!=q&&m.push(d[u].user)}return m};DriveClient.prototype.logout=function(){this.ui.editor.loadUrl(this.redirectUri+"?doLogout=1&userId="+this.userId+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host));this.clearPersistentToken();this.setUser(null);b=null};DriveClient.prototype.execute=function(m){var d=mxUtils.bind(this,function(q){this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(u,y){this.authorize(!1,mxUtils.bind(this,function(){null!=y&&y();m()}),mxUtils.bind(this,function(A){var J=null!=A.message?A.message:mxResources.get("cannotLogin");null!=A&&null!=A.error&&403==A.error.code&&null!=A.error.data&&0<A.error.data.length&&"domainPolicy"==A.error.data[0].reason&&(J=A.error.message);this.logout();this.ui.showError(mxResources.get("error"),J,mxResources.get("help"),mxUtils.bind(this,function(){this.ui.openLink("https://www.drawio.com/doc/faq/gsuite-authorisation-troubleshoot")}),null,mxResources.get("ok"))}),u)}))});this.authorize(!0,m,d)};DriveClient.prototype.executeRequest=function(m,d,q){try{var u=!0,y=null,A=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var J=mxUtils.bind(this,function(){try{this.requestThread=null;this.currentRequest=m;null!=y&&window.clearTimeout(y);y=window.setTimeout(mxUtils.bind(this,-function(){u=!1;null!=q&&q({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:J})}),this.ui.timeout);var K=null,H=!1;"string"===typeof m.params?K=m.params:null!=m.params&&(K=JSON.stringify(m.params),H=!0);var G=m.fullUrl||this.GDriveBaseUrl+m.url;H&&(G+=(0<G.indexOf("?")?"&":"?")+"alt=json");var c=new mxXmlRequest(G,K,m.method||"GET");c.setRequestHeaders=mxUtils.bind(this,function(f,l){if(null!=m.headers)for(var n in m.headers)f.setRequestHeader(n,m.headers[n]);else null!=m.contentType?-f.setRequestHeader("Content-Type",m.contentType):H&&f.setRequestHeader("Content-Type","application/json");f.setRequestHeader("Authorization","Bearer "+b)});c.send(mxUtils.bind(this,function(f){try{if(window.clearTimeout(y),u){try{var l=JSON.parse(f.getText())}catch(t){l=null}if(200<=f.getStatus()&&299>=f.getStatus())null!=d&&d(l);else{var n=null!=l&&null!=l.error?null!=l.error.data?l.error.data:l.error.errors:null,r=null!=n&&0<n.length?n[0].reason:null;null==q||null==l||null==l.error||-1!=l.error.code&&+function(){u=!1;null!=q&&q({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:J})}),this.ui.timeout);var K=null,F=!1;"string"===typeof m.params?K=m.params:null!=m.params&&(K=JSON.stringify(m.params),F=!0);var H=m.fullUrl||this.GDriveBaseUrl+m.url;F&&(H+=(0<H.indexOf("?")?"&":"?")+"alt=json");var c=new mxXmlRequest(H,K,m.method||"GET");c.setRequestHeaders=mxUtils.bind(this,function(f,l){if(null!=m.headers)for(var n in m.headers)f.setRequestHeader(n,m.headers[n]);else null!=m.contentType?+f.setRequestHeader("Content-Type",m.contentType):F&&f.setRequestHeader("Content-Type","application/json");f.setRequestHeader("Authorization","Bearer "+b)});c.send(mxUtils.bind(this,function(f){try{if(window.clearTimeout(y),u){try{var l=JSON.parse(f.getText())}catch(t){l=null}if(200<=f.getStatus()&&299>=f.getStatus())null!=d&&d(l);else{var n=null!=l&&null!=l.error?null!=l.error.data?l.error.data:l.error.errors:null,r=null!=n&&0<n.length?n[0].reason:null;null==q||null==l||null==l.error||-1!=l.error.code&&(403!=l.error.code||"domainPolicy"!=r&&"The requested mime type change is forbidden."!=l.error.message)?null!=l&&null!=l.error&&(401==l.error.code||403==l.error.code&&"rateLimitExceeded"!=r)?403==l.error.code&&this.retryAuth||401==l.error.code&&this.retryAuth&&"authError"==r?(null!=q&&q(l),this.retryAuth=!1):(this.retryAuth=!0,this.execute(J)):null!=l&&null!=l.error&&412!=l.error.code&&404!=l.error.code&&400!=l.error.code&&this.currentRequest==m&&A<this.maxRetries?(A++,this.requestThread=window.setTimeout(J,Math.round(Math.pow(2,A)*(1+.1*(Math.random()-.5))*this.coolOff))):null!=q&&q(l):q(l)}}}catch(t){if(null!=q)q(t);else throw t;}}))}catch(f){if(null!=q)q(f);else throw f;}});null!=b&&this.authCalled?J():this.execute(J)}catch(K){if(null!=q)q(K);else throw K;}};DriveClient.prototype.createAuthWin=function(m){return window.open(m?m:"about:blank","gdauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join())};DriveClient.prototype.authorize=function(m,d,q,u,y){this.isExtAuth&&!m?window.parent.driveAuth(mxUtils.bind(this,function(A){this.updateAuthInfo(A,!0,!0,d,q)}),q):(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(A){200<=A.getStatus()&&299>=A.getStatus()?this.authorizeStep2(A.getText(),m,d,q,u,y):null!=q&&q(A)}),q)};DriveClient.prototype.updateAuthInfo=function(m,d,q,u,y){b=m.access_token;delete m.access_token;m.expires=Date.now()+1E3*parseInt(m.expires_in);m.remember=d;this.resetTokenRefresh(m);this.authCalled=!0;if(q||null==this.user){var A=JSON.stringify(m);this.updateUser(mxUtils.bind(this,function(){var J=JSON.parse(A);this.setPersistentToken(J,!d);null!=u&&u()}),y)}else null!=u&&(this.setPersistentToken(m,!d),u())};DriveClient.prototype.authorizeStep2=function(m,d,q,u,y,A){try{null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(this.userId=this.ui.stateArg.userId,null!=this.user&&this.user.id!=this.userId&&(this.user=null));if(null==this.userId){var J=-JSON.parse(this.getPersistentToken(!0));J&&null!=J.current&&(this.userId=J.current.userId)}if(d&&null==this.userId)null!=u&&u();else if(d)(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+m)+"&userId="+this.userId,null,"GET")).send(mxUtils.bind(this,function(H){try{if(200<=H.getStatus()&&299>=H.getStatus()){var G=JSON.parse(H.getText());this.updateAuthInfo(G,!0,!1,q,u)}else 0!=H.getStatus()&&this.logout(),null!=u&&u(H)}catch(c){if(null!=+JSON.parse(this.getPersistentToken(!0));J&&null!=J.current&&(this.userId=J.current.userId)}if(d&&null==this.userId)null!=u&&u();else if(d)(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+m)+"&userId="+this.userId,null,"GET")).send(mxUtils.bind(this,function(F){try{if(200<=F.getStatus()&&299>=F.getStatus()){var H=JSON.parse(F.getText());this.updateAuthInfo(H,!0,!1,q,u)}else 0!=F.getStatus()&&this.logout(),null!=u&&u(F)}catch(c){if(null!=window.console&&console.log("DriveClient.authorizeStep2",c),null!=u)u(c);else throw c;}}),u);else{var K="https://accounts.google.com/o/oauth2/v2/auth?client_id="+this.clientId+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&include_granted_scopes=true"+(y?"&access_type=offline&prompt=consent%20select_account":"")+"&scope="+encodeURIComponent(this.scopes.join(" "))+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+m+(this.sameWinRedirectUrl?-"&redirect="+this.sameWinRedirectUrl:""));this.sameWinAuthMode?(window.location.assign(K),A=null):null==A?A=this.createAuthWin(K):A.location=K;null!=A?(window.onGoogleDriveCallback=mxUtils.bind(this,function(H,G){window.onGoogleDriveCallback=null;try{null==H?null!=u&&u({message:mxResources.get("accessDenied")}):this.updateAuthInfo(H,y,!0,q,u)}catch(c){null!=u&&u(c)}finally{null!=G&&G.close()}}),A.focus()):null!=u&&u({message:mxResources.get("allowPopups")})}}catch(H){if(null!=u)u(H);else throw H;+"&redirect="+this.sameWinRedirectUrl:""));this.sameWinAuthMode?(window.location.assign(K),A=null):null==A?A=this.createAuthWin(K):A.location=K;null!=A?(window.onGoogleDriveCallback=mxUtils.bind(this,function(F,H){window.onGoogleDriveCallback=null;try{null==F?null!=u&&u({message:mxResources.get("accessDenied")}):this.updateAuthInfo(F,y,!0,q,u)}catch(c){null!=u&&u(c)}finally{null!=H&&H.close()}}),A.focus()):null!=u&&u({message:mxResources.get("allowPopups")})}}catch(F){if(null!=u)u(F);else throw F;}};DriveClient.prototype.resetTokenRefresh=function(m){null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);null!=m&&null==m.error&&0<m.expires_in&&(this.tokenRefreshInterval=1E3*parseInt(m.expires_in),this.lastTokenRefresh=Date.now(),this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authorize(!0,mxUtils.bind(this,function(){}),mxUtils.bind(this,function(){}))}),900*m.expires_in))};DriveClient.prototype.checkToken=function(m){var d=0<this.lastTokenRefresh;Date.now()-this.lastTokenRefresh>this.tokenRefreshInterval||null==this.tokenRefreshThread?this.execute(mxUtils.bind(this,function(){m();d&&this.fireEvent(new mxEventObject("disconnected"))})):m()};DriveClient.prototype.updateUser=function(m,d){try{var q={Authorization:"Bearer "+b};this.ui.editor.loadUrl("https://www.googleapis.com/oauth2/v2/userinfo?alt=json",mxUtils.bind(this,function(u){try{var y=JSON.parse(u);this.executeRequest({url:"/about"},mxUtils.bind(this,function(A){var J=-mxResources.get("notAvailable"),K=J,H=null;null!=A&&null!=A.user&&(J=A.user.emailAddress,K=A.user.displayName,H=null!=A.user.picture?A.user.picture.url:null);this.setUser(new DrawioUser(y.id,J,K,H,y.locale));this.userId=y.id;null!=m&&m()}),d)}catch(A){null!=d&&d(A)}}),d,null,null,null,null,q)}catch(u){if(null!=d)d(u);else throw u;}};DriveClient.prototype.copyFile=function(m,d,q,u){null!=m&&null!=d&&this.executeRequest({url:"/files/"+m+"/copy?fields="+encodeURIComponent(this.allFields)+"&supportsAllDrives=true&enforceSingleParent=true",+mxResources.get("notAvailable"),K=J,F=null;null!=A&&null!=A.user&&(J=A.user.emailAddress,K=A.user.displayName,F=null!=A.user.picture?A.user.picture.url:null);this.setUser(new DrawioUser(y.id,J,K,F,y.locale));this.userId=y.id;null!=m&&m()}),d)}catch(A){null!=d&&d(A)}}),d,null,null,null,null,q)}catch(u){if(null!=d)d(u);else throw u;}};DriveClient.prototype.copyFile=function(m,d,q,u){null!=m&&null!=d&&this.executeRequest({url:"/files/"+m+"/copy?fields="+encodeURIComponent(this.allFields)+"&supportsAllDrives=true&enforceSingleParent=true",method:"POST",params:{title:d,properties:[{key:"channel",value:Editor.guid()}]}},q,u)};DriveClient.prototype.renameFile=function(m,d,q,u){null!=m&&null!=d&&this.executeRequest(this.createDriveRequest(m,{title:d}),q,u)};DriveClient.prototype.moveFile=function(m,d,q,u){null!=m&&null!=d&&this.executeRequest(this.createDriveRequest(m,{parents:[{kind:"drive#fileLink",id:d}]}),q,u)};DriveClient.prototype.createDriveRequest=function(m,d){return{url:"/files/"+m+"?uploadType=multipart&supportsAllDrives=true",method:"PUT",contentType:"application/json; charset=UTF-8",params:d}};DriveClient.prototype.getLibrary=function(m,d,q){return this.getFile(m,d,q,!0,!0)};DriveClient.prototype.loadDescriptor=function(m,d,q,u){this.executeRequest({url:"/files/"+m+"?supportsAllDrives=true&fields="+(null!=u?u:this.allFields)},d,q)};DriveClient.prototype.listFiles=function(m,d,q,u,y){this.executeRequest({url:"/files?supportsAllDrives=true&includeItemsFromAllDrives=true&q="+encodeURIComponent("(mimeType contains '"+this.xmlMimeType+"') "+(m?" and (title contains '"+m+"')":"")+(d?" and (modifiedDate > '"+d.toISOString()+"')":"")+(q?" and ('me' in owners)":""))+"&orderBy=modifiedDate desc,title"},u,y)};DriveClient.prototype.getCustomProperty=function(m,d){m=m.properties;var q=null;if(null!=m)for(var u=0;u<m.length;u++)if(m[u].key==d){q=m[u].value;break}return q};DriveClient.prototype.getFile=function(m,d,q,u,y){u=null!=u?u:!1;y=null!=y?y:!1;null!=urlParams.rev?this.executeRequest({url:"/files/"+m+"/revisions/"+urlParams.rev+"?supportsAllDrives=true"},mxUtils.bind(this,function(A){A.title=A.originalFilename;A.headRevisionId=A.id;A.id=m;this.getXmlFile(A,d,q)}),q):this.loadDescriptor(m,mxUtils.bind(this,function(A){try{if(null!=this.user){var J=/\.png$/i.test(A.title);/\.v(dx|sdx?)$/i.test(A.title)||/\.gliffy$/i.test(A.title)||!Editor.useCanvasForExport&&J?this.ui.convertFile(A.downloadUrl,A.title,A.mimeType,this.extension,d,q,null,{Authorization:"Bearer "+b}):u||y||A.mimeType==this.libraryMimeType||A.mimeType==this.xmlMimeType?this.getXmlFile(A,-d,q,!0,y):this.getXmlFile(A,d,q)}else q({message:mxResources.get("loggedOut")})}catch(K){if(null!=q)q(K);else throw K;}}),q)};DriveClient.prototype.isGoogleRealtimeMimeType=function(m){return null!=m&&"application/vnd.jgraph.mxfile."==m.substring(0,30)};DriveClient.prototype.getXmlFile=function(m,d,q,u,y){try{var A={Authorization:"Bearer "+b},J=m.downloadUrl;if(null==J)null!=q&&q({message:mxResources.get("exportOptionsDisabledDetails")});else{var K=0,H=mxUtils.bind(this,function(){this.ui.editor.loadUrl(J,-mxUtils.bind(this,function(G){try{if(null==G)q({message:mxResources.get("invalidOrMissingFile")});else if(m.mimeType==this.libraryMimeType||y)m.mimeType!=this.libraryMimeType||y?d(new DriveLibrary(this.ui,G,m)):q({message:mxResources.get("notADiagramFile")});else{var c=!1;if(/\.png$/i.test(m.title)){var f=G.lastIndexOf(",");if(0<f){var l=this.ui.extractGraphModelFromPng(G);if(null!=l&&0<l.length)G=l;else try{l=G.substring(f+1);var n=window.atob?atob(l):Base64.decode(l),r=this.ui.editor.extractGraphModel(mxUtils.parseXml(n).documentElement,-!0);null==r||0<r.getElementsByTagName("parsererror").length?c=!0:G=n}catch(t){c=!0}}}else/\.pdf$/i.test(m.title)?(l=Editor.extractGraphModelFromPdf(G),null!=l&&0<l.length&&(c=!0,G=l)):"data:image/png;base64,PG14ZmlsZS"==G.substring(0,32)&&(n=G.substring(22),G=window.atob&&!mxClient.IS_SF?atob(n):Base64.decode(n));Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(G,J)?this.ui.parseFileData(G,mxUtils.bind(this,function(t){try{4==t.readyState&&(200<=t.status&&299>=t.status?d(new LocalFile(this.ui,-t.responseText,m.title+this.extension,!0)):null!=q&&q({message:mxResources.get("errorLoadingFile")}))}catch(x){if(null!=q)q(x);else throw x;}}),m.title):d(c?new LocalFile(this.ui,G,m.title,!0):new DriveFile(this.ui,G,m))}}catch(t){if(null!=q)q(t);else throw t;}}),mxUtils.bind(this,function(G,c){if(K<this.maxRetries&&null!=c&&403==c.getStatus())K++,window.setTimeout(H,2*K*this.coolOff*(1+.1*(Math.random()-.5)));else if(null!=q)q(G);else throw G;}),null!=m.mimeType&&"image/"==m.mimeType.substring(0,-6)&&"image/svg"!=m.mimeType.substring(0,9)||/\.png$/i.test(m.title)||/\.jpe?g$/i.test(m.title)||/\.pdf$/i.test(m.title),null,null,null,A)});H()}}catch(G){if(null!=q)q(G);else throw G;}};DriveClient.prototype.saveFile=function(m,d,q,u,y,A,J,K,H){try{var G=0;m.saveLevel=1;var c=mxUtils.bind(this,function(T){if(null!=u)u(T);else throw T;}),f=mxUtils.bind(this,function(T){c(T);try{EditorUi.logError(T.message,null,null,null,T)}catch(N){}});if(m.isEditable()&&null!=m.desc){var l=Date.now(),n=m.desc.etag,-r=m.desc.modifiedDate,t=m.desc.headRevisionId,x=Editor.useCanvasForExport&&/(\.png)$/i.test(m.getTitle());A=null!=A?A:!1;var B=null,F=!1,L={mimeType:m.desc.mimeType,title:m.getTitle()};if(this.isGoogleRealtimeMimeType(L.mimeType))L.mimeType=this.xmlMimeType,B=m.desc,F=d=!0;else if("application/octet-stream"==L.mimeType||"1"==urlParams["override-mime"]&&L.mimeType!=this.xmlMimeType)L.mimeType=this.xmlMimeType;var D=mxUtils.bind(this,function(T,N,R){try{m.saveLevel=3;var P=m.getData(),U=null,S=null;-m.constructor==DriveFile&&(null==K&&(K=[]),null==m.getChannelId()&&K.push({key:"channel",value:Editor.guid(32)}),null==m.getChannelKey()&&K.push({key:"key",value:Editor.guid(32)}),H=null!=H?H:Editor.guid(32),K.push({key:"secret",value:H}),S=this.ui.getPagesForXml(P,!0),U=this.ui.getHashValueForPages(S),K.push({key:"checksum",value:H+":"+U}));R||(null!=T||A||(T=this.placeholderThumbnail,N=this.placeholderMimeType),null!=T&&null!=N&&(L.thumbnail={image:T,mimeType:N}));var z=mxUtils.bind(this,function(v){try{if(m.saveDelay=+d,q,!0,y):this.getXmlFile(A,d,q)}else q({message:mxResources.get("loggedOut")})}catch(K){if(null!=q)q(K);else throw K;}}),q)};DriveClient.prototype.isGoogleRealtimeMimeType=function(m){return null!=m&&"application/vnd.jgraph.mxfile."==m.substring(0,30)};DriveClient.prototype.getXmlFile=function(m,d,q,u,y){try{var A={Authorization:"Bearer "+b},J=m.downloadUrl;if(null==J)null!=q&&q({message:mxResources.get("exportOptionsDisabledDetails")});else{var K=0,F=mxUtils.bind(this,function(){this.ui.editor.loadUrl(J,+mxUtils.bind(this,function(H){try{if(null==H)q({message:mxResources.get("invalidOrMissingFile")});else if(m.mimeType==this.libraryMimeType||y)m.mimeType!=this.libraryMimeType||y?d(new DriveLibrary(this.ui,H,m)):q({message:mxResources.get("notADiagramFile")});else{var c=!1;if(/\.png$/i.test(m.title)){var f=H.lastIndexOf(",");if(0<f){var l=this.ui.extractGraphModelFromPng(H);if(null!=l&&0<l.length)H=l;else try{l=H.substring(f+1);var n=window.atob?atob(l):Base64.decode(l),r=this.ui.editor.extractGraphModel(mxUtils.parseXml(n).documentElement,+!0);null==r||0<r.getElementsByTagName("parsererror").length?c=!0:H=n}catch(t){c=!0}}}else/\.pdf$/i.test(m.title)?(l=Editor.extractGraphModelFromPdf(H),null!=l&&0<l.length&&(c=!0,H=l)):"data:image/png;base64,PG14ZmlsZS"==H.substring(0,32)&&(n=H.substring(22),H=window.atob&&!mxClient.IS_SF?atob(n):Base64.decode(n));Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(H,J)?this.ui.parseFileData(H,mxUtils.bind(this,function(t){try{4==t.readyState&&(200<=t.status&&299>=t.status?d(new LocalFile(this.ui,+t.responseText,m.title+this.extension,!0)):null!=q&&q({message:mxResources.get("errorLoadingFile")}))}catch(x){if(null!=q)q(x);else throw x;}}),m.title):d(c?new LocalFile(this.ui,H,m.title,!0):new DriveFile(this.ui,H,m))}}catch(t){if(null!=q)q(t);else throw t;}}),mxUtils.bind(this,function(H,c){if(K<this.maxRetries&&null!=c&&403==c.getStatus())K++,window.setTimeout(F,2*K*this.coolOff*(1+.1*(Math.random()-.5)));else if(null!=q)q(H);else throw H;}),null!=m.mimeType&&"image/"==m.mimeType.substring(0,+6)&&"image/svg"!=m.mimeType.substring(0,9)||/\.png$/i.test(m.title)||/\.jpe?g$/i.test(m.title)||/\.pdf$/i.test(m.title),null,null,null,A)});F()}}catch(H){if(null!=q)q(H);else throw H;}};DriveClient.prototype.saveFile=function(m,d,q,u,y,A,J,K,F){try{var H=0;m.saveLevel=1;var c=mxUtils.bind(this,function(T){if(null!=u)u(T);else throw T;}),f=mxUtils.bind(this,function(T){c(T);try{EditorUi.logError(T.message,null,null,null,T)}catch(N){}});if(m.isEditable()&&null!=m.desc){var l=Date.now(),n=m.desc.etag,+r=m.desc.modifiedDate,t=m.desc.headRevisionId,x=Editor.useCanvasForExport&&/(\.png)$/i.test(m.getTitle());A=null!=A?A:!1;var B=null,G=!1,L={mimeType:m.desc.mimeType,title:m.getTitle()};if(this.isGoogleRealtimeMimeType(L.mimeType))L.mimeType=this.xmlMimeType,B=m.desc,G=d=!0;else if("application/octet-stream"==L.mimeType||"1"==urlParams["override-mime"]&&L.mimeType!=this.xmlMimeType)L.mimeType=this.xmlMimeType;var D=mxUtils.bind(this,function(T,N,R){try{m.saveLevel=3;var P=m.getData(),U=null,S=null;+m.constructor==DriveFile&&(null==K&&(K=[]),null==m.getChannelId()&&K.push({key:"channel",value:Editor.guid(32)}),null==m.getChannelKey()&&K.push({key:"key",value:Editor.guid(32)}),F=null!=F?F:Editor.guid(32),K.push({key:"secret",value:F}),S=this.ui.getPagesForXml(P,!0),U=this.ui.getHashValueForPages(S),K.push({key:"checksum",value:F+":"+U}));R||(null!=T||A||(T=this.placeholderThumbnail,N=this.placeholderMimeType),null!=T&&null!=N&&(L.thumbnail={image:T,mimeType:N}));var z=mxUtils.bind(this,function(v){try{if(m.saveDelay=Date.now()-l,m.saveLevel=null,q(v,P,S,U),null!=B){this.executeRequest({url:"/files/"+B.id+"/revisions/"+B.headRevisionId+"?supportsAllDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(C){C.pinned=!0;this.executeRequest({url:"/files/"+B.id+"/revisions/"+B.headRevisionId,method:"PUT",params:C})})));try{EditorUi.logEvent({category:m.convertedFrom+"-CONVERT-FILE-"+m.getHash(),action:"from_"+B.id+"."+B.headRevisionId+"-to_"+m.desc.id+"."+m.desc.headRevisionId,label:null!=this.user?"user_"+this.user.id:"nouser"+(null!=m.sync?"-client_"+m.sync.clientId:"nosync")})}catch(C){}}}catch(C){f(C)}}),g=mxUtils.bind(this,function(v,C){m.saveLevel=4;try{null!=K&&(L.properties=K);var E=J||m.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:m.getCurrentEtag(),I=mxUtils.bind(this,function(V){m.saveLevel=5;try{var W=m.desc.mimeType!=this.xmlMimeType&&m.desc.mimeType!=this.mimeType&&m.desc.mimeType!=this.libraryMimeType,M=!0,X=null;try{X=window.setTimeout(mxUtils.bind(this,function(){M=-!1;c({code:App.ERROR_TIMEOUT})}),5*this.ui.timeout)}catch(Z){}this.executeRequest(this.createUploadRequest(m.getId(),L,v,d||V||W,C,V?null:E,F),mxUtils.bind(this,function(Z){window.clearTimeout(X);if(M){var Y=null!=Z?(new Date(Z.modifiedDate)).getTime()-(new Date(r)).getTime():0;if(0>=Y||n==Z.etag||d&&t==Z.headRevisionId){var aa=[];null==Z?aa.push("Empty response"):(0>=Y&&aa.push("Invalid modified time"),n==Z.etag&&aa.push("Stale etag"),d&&t==Z.headRevisionId&&aa.push("Stale revision"),E=Z.etag);0==-aa.length&&aa.push(mxResources.get("unknownError"));Y=aa.join(", ");if(G<this.staleEtagMaxRetries)G++,aa=Math.round(Math.pow(2,G)*this.coolOff*(1+.1*(Math.random()-.5))),window.setTimeout(I,aa),"1"==urlParams.test&&EditorUi.debug("DriveClient: Invalid response","retry",G,"delay",aa,"rev",null!=Z?Z.headRevisionId:"null","errors",Y);else{m.saveLevel=12;c({message:mxResources.get("error")+": "+Y},Z);try{EditorUi.logError("Saving to Google Drive failed",null,"id-"+m.desc.id+"-from-"+t+"."+r+"-"+this.ui.hashValue(n)+-"-to-"+Z.headRevisionId+"."+Z.modifiedDate+"-"+this.ui.hashValue(Z.etag)+(0<Y.length?"-errors-"+Y:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=m.sync?"-client_"+m.sync.clientId:"-nosync")+"-retries-"+G+"-delay-"+(Date.now()-l))}catch(da){}}}else z(Z)}}),mxUtils.bind(this,function(Z){window.clearTimeout(X);if(M){m.saveLevel=6;try{m.isConflict(Z)?this.executeRequest({url:"/files/"+m.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(Y){m.saveLevel=-7;try{if(null!=Y&&Y.etag==E)if(G<this.staleEtagMaxRetries){G++;var aa=Math.round(2*G*this.coolOff*(1+.1*(Math.random()-.5)));window.setTimeout(O,aa);"1"==urlParams.test&&EditorUi.debug("DriveClient: Stale Etag Detected","retry",G,"delay",aa)}else{O(!0);try{EditorUi.logEvent({category:"STALE-ETAG-SAVE-FILE-"+m.getHash(),action:"rev_"+m.desc.headRevisionId+"-mod_"+m.desc.modifiedDate+"-size_"+m.getSize()+"-mime_"+m.desc.mimeType+(this.ui.editor.autosave?"":"-nosave")+(m.isAutosave()?"":"-noauto")+(m.changeListenerEnabled?+!1;c({code:App.ERROR_TIMEOUT})}),5*this.ui.timeout)}catch(Z){}this.executeRequest(this.createUploadRequest(m.getId(),L,v,d||V||W,C,V?null:E,G),mxUtils.bind(this,function(Z){window.clearTimeout(X);if(M){var Y=null!=Z?(new Date(Z.modifiedDate)).getTime()-(new Date(r)).getTime():0;if(0>=Y||n==Z.etag||d&&t==Z.headRevisionId){var aa=[];null==Z?aa.push("Empty response"):(0>=Y&&aa.push("Invalid modified time"),n==Z.etag&&aa.push("Stale etag"),d&&t==Z.headRevisionId&&aa.push("Stale revision"),E=Z.etag);0==+aa.length&&aa.push(mxResources.get("unknownError"));Y=aa.join(", ");if(H<this.staleEtagMaxRetries)H++,aa=Math.round(Math.pow(2,H)*this.coolOff*(1+.1*(Math.random()-.5))),window.setTimeout(I,aa),"1"==urlParams.test&&EditorUi.debug("DriveClient: Invalid response","retry",H,"delay",aa,"rev",null!=Z?Z.headRevisionId:"null","errors",Y);else{m.saveLevel=12;c({message:mxResources.get("error")+": "+Y},Z);try{EditorUi.logError("Saving to Google Drive failed",null,"id-"+m.desc.id+"-from-"+t+"."+r+"-"+this.ui.hashValue(n)++"-to-"+Z.headRevisionId+"."+Z.modifiedDate+"-"+this.ui.hashValue(Z.etag)+(0<Y.length?"-errors-"+Y:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=m.sync?"-client_"+m.sync.clientId:"-nosync")+"-retries-"+H+"-delay-"+(Date.now()-l))}catch(da){}}}else z(Z)}}),mxUtils.bind(this,function(Z){window.clearTimeout(X);if(M){m.saveLevel=6;try{m.isConflict(Z)?this.executeRequest({url:"/files/"+m.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(Y){m.saveLevel=+7;try{if(null!=Y&&Y.etag==E)if(H<this.staleEtagMaxRetries){H++;var aa=Math.round(2*H*this.coolOff*(1+.1*(Math.random()-.5)));window.setTimeout(O,aa);"1"==urlParams.test&&EditorUi.debug("DriveClient: Stale Etag Detected","retry",H,"delay",aa)}else{O(!0);try{EditorUi.logEvent({category:"STALE-ETAG-SAVE-FILE-"+m.getHash(),action:"rev_"+m.desc.headRevisionId+"-mod_"+m.desc.modifiedDate+"-size_"+m.getSize()+"-mime_"+m.desc.mimeType+(this.ui.editor.autosave?"":"-nosave")+(m.isAutosave()?"":"-noauto")+(m.changeListenerEnabled?"":"-nolisten")+(m.inConflictState?"-conflict":"")+(m.invalidChecksum?"-invalid":""),label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=m.sync?"-client_"+m.sync.clientId:"-nosync")})}catch(da){}}else"1"==urlParams.test&&Y.headRevisionId==t&&EditorUi.debug("DriveClient: Remote Etag Changed","local",E,"remote",Y.etag,"rev",m.desc.headRevisionId,"response",[Y],"file",[m]),c(Z,Y)}catch(da){f(da)}}),mxUtils.bind(this,function(){c(Z)})):c(Z)}catch(Y){f(Y)}}}))}catch(Z){f(Z)}}),O=mxUtils.bind(this,function(V){m.saveLevel=9;if(V||null==E)I(V);else{var W=!0,M=null;try{M=window.setTimeout(mxUtils.bind(this,function(){W=!1;c({code:App.ERROR_TIMEOUT})}),3*this.ui.timeout)}catch(X){}this.executeRequest({url:"/files/"+m.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(X){window.clearTimeout(M);if(W){m.saveLevel=10;try{null!=X&&X.headRevisionId==t?("1"==urlParams.test&&E!=X.etag&&EditorUi.debug("DriveClient: Preflight Etag Update","from",E,"to",X.etag,"rev",m.desc.headRevisionId,"response",[X],"file",[m]),E=X.etag,I(V)):c({error:{code:412}},X)}catch(Z){f(Z)}}}),mxUtils.bind(this,function(X){window.clearTimeout(M);W&&(m.saveLevel=11,c(X))}))}});if(x&&null==T){m.saveLevel=8;var Q=new Image;Q.onload=mxUtils.bind(this,function(){try{var V=this.thumbnailWidth/Q.width,W=document.createElement("canvas");W.width=this.thumbnailWidth;W.height=Math.floor(Q.height*V);W.getContext("2d").drawImage(Q,0,0,W.width,W.height);var M=W.toDataURL();M=M.substring(M.indexOf(",")+@@ -14720,20 +14724,20 @@ null!=A&&(K["If-Match"]=A);m={fullUrl:"https://content.googleapis.com/upload/driBase64.encode(q):"")+"\r\n---------314159265358979323846--"};u||(m.fullUrl+="&newRevision=false");J&&(m.fullUrl+="&pinned=true");return m};DriveClient.prototype.createLinkPicker=function(){var m=k.linkPicker;if(null==m||k.linkPickerToken!=b){k.linkPickerToken=b;m=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0);var d=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),q=(new google.picker.DocsView).setIncludeFolders(!0).setEnableDrives(!0).setSelectFolderEnabled(!0);m=(new google.picker.PickerBuilder).setAppId(this.appId).setLocale(mxLanguage).setOAuthToken(k.linkPickerToken).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(m).addView(d).addView(q).addView(google.picker.ViewId.RECENTLY_PICKED)}return m};DriveClient.prototype.pickFile=function(m,d,q){this.filePickerCallback=null!=m?m:mxUtils.bind(this,function(u){this.ui.loadFile("G"+u)});this.filePicked=mxUtils.bind(this,function(u){u.action==google.picker.Action.PICKED&&this.filePickerCallback(u.docs[0].id,u.docs[0])});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var u=d?"genericPicker":"filePicker",y=mxUtils.bind(this,function(c){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(c).className&&(mxEvent.removeListener(document,"click",y),this[u].setVisible(!1),q&&q())});if(null==k[u]||k[u+"Token"]!=b){k[u+"Token"]=b;var A=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),-J=(new google.picker.DocsView).setIncludeFolders(!0),K=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0),H=(new google.picker.DocsUploadView).setIncludeFolders(!0);d?(A.setMimeTypes("*/*"),J.setMimeTypes("*/*"),K.setMimeTypes("*/*")):(A.setMimeTypes(this.mimeTypes),J.setMimeTypes(this.mimeTypes),K.setMimeTypes(this.mimeTypes));k[u]=(new google.picker.PickerBuilder).setOAuthToken(k[u+"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(A).addView(J).addView(K).addView(google.picker.ViewId.RECENTLY_PICKED).addView(H);-if(urlParams.gPickerSize){var G=urlParams.gPickerSize.split(",");k[u]=k[u].setSize(G[0],G[1])}urlParams.topBaseUrl&&(k[u]=k[u].setOrigin(decodeURIComponent(urlParams.topBaseUrl)));k[u]=k[u].setCallback(mxUtils.bind(this,function(c){if(c.action==google.picker.Action.PICKED||c.action==google.picker.Action.CANCEL)mxEvent.removeListener(document,"click",y),q&&c.action==google.picker.Action.CANCEL&&q();c.action==google.picker.Action.PICKED&&this.filePicked(c)})).build()}mxEvent.addListener(document,"click",-y);k[u].setVisible(!0)}catch(c){this.ui.spinner.stop(),this.ui.handleError(c)}}))};DriveClient.prototype.pickFolder=function(m,d){this.folderPickerCallback=m;var q=mxUtils.bind(this,function(){try{this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var u=mxUtils.bind(this,function(H){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(H).className&&(mxEvent.removeListener(document,"click",u),k.folderPicker.setVisible(!1))});+J=(new google.picker.DocsView).setIncludeFolders(!0),K=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0),F=(new google.picker.DocsUploadView).setIncludeFolders(!0);d?(A.setMimeTypes("*/*"),J.setMimeTypes("*/*"),K.setMimeTypes("*/*")):(A.setMimeTypes(this.mimeTypes),J.setMimeTypes(this.mimeTypes),K.setMimeTypes(this.mimeTypes));k[u]=(new google.picker.PickerBuilder).setOAuthToken(k[u+"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(A).addView(J).addView(K).addView(google.picker.ViewId.RECENTLY_PICKED).addView(F);+if(urlParams.gPickerSize){var H=urlParams.gPickerSize.split(",");k[u]=k[u].setSize(H[0],H[1])}urlParams.topBaseUrl&&(k[u]=k[u].setOrigin(decodeURIComponent(urlParams.topBaseUrl)));k[u]=k[u].setCallback(mxUtils.bind(this,function(c){if(c.action==google.picker.Action.PICKED||c.action==google.picker.Action.CANCEL)mxEvent.removeListener(document,"click",y),q&&c.action==google.picker.Action.CANCEL&&q();c.action==google.picker.Action.PICKED&&this.filePicked(c)})).build()}mxEvent.addListener(document,"click",+y);k[u].setVisible(!0)}catch(c){this.ui.spinner.stop(),this.ui.handleError(c)}}))};DriveClient.prototype.pickFolder=function(m,d){this.folderPickerCallback=m;var q=mxUtils.bind(this,function(){try{this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var u=mxUtils.bind(this,function(F){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(F).className&&(mxEvent.removeListener(document,"click",u),k.folderPicker.setVisible(!1))});if(null==k.folderPicker||k.folderPickerToken!=b){k.folderPickerToken=b;var y=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),A=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),J=(new google.picker.DocsView).setIncludeFolders(!0).setEnableDrives(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder");k.folderPicker=(new google.picker.PickerBuilder).setSelectableMimeTypes("application/vnd.google-apps.folder").setOAuthToken(k.folderPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(y).addView(A).addView(J).addView(google.picker.ViewId.RECENTLY_PICKED).setTitle(mxResources.get("pickFolder"));if(urlParams.gPickerSize){var K=urlParams.gPickerSize.split(",");k.folderPicker=k.folderPicker.setSize(K[0],K[1])}urlParams.topBaseUrl&&(k.folderPicker=-k.folderPicker.setOrigin(decodeURIComponent(urlParams.topBaseUrl)));k.folderPicker=k.folderPicker.setCallback(mxUtils.bind(this,function(H){H.action!=google.picker.Action.PICKED&&H.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",u);this.folderPickerCallback(H)})).build()}mxEvent.addListener(document,"click",u);k.folderPicker.setVisible(!0)}catch(H){this.ui.spinner.stop(),this.ui.handleError(H)}}))}catch(u){this.ui.handleError(u)}});d?q():this.ui.spinner.spin(document.body,+k.folderPicker.setOrigin(decodeURIComponent(urlParams.topBaseUrl)));k.folderPicker=k.folderPicker.setCallback(mxUtils.bind(this,function(F){F.action!=google.picker.Action.PICKED&&F.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",u);this.folderPickerCallback(F)})).build()}mxEvent.addListener(document,"click",u);k.folderPicker.setVisible(!0)}catch(F){this.ui.spinner.stop(),this.ui.handleError(F)}}))}catch(u){this.ui.handleError(u)}});d?q():this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop(),this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){this.folderPickerCallback({action:google.picker.Action.PICKED,docs:[{type:"folder",id:"root"}]})}),mxUtils.bind(this,function(){q()}),mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0)}catch(u){this.ui.handleError(u)}}))};DriveClient.prototype.pickLibrary=function(m){this.filePickerCallback=m;this.filePicked=mxUtils.bind(this,function(d){d.action==google.picker.Action.PICKED?this.filePickerCallback(d.docs[0].id):d.action==google.picker.Action.CANCEL&&null==this.ui.getCurrentFile()&&this.ui.showSplash()});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var d=mxUtils.bind(this,function(K){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(K).className&&(mxEvent.removeListener(document,"click",d),k.libraryPicker.setVisible(!1))});if(null==k.libraryPicker||k.libraryPickerToken!=b){k.libraryPickerToken=b;var q=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),u=(new google.picker.DocsView).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),y=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),A=(new google.picker.DocsUploadView).setIncludeFolders(!0);k.libraryPicker=(new google.picker.PickerBuilder).setOAuthToken(k.libraryPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(q).addView(u).addView(y).addView(google.picker.ViewId.RECENTLY_PICKED).addView(A);if(urlParams.gPickerSize){var J=urlParams.gPickerSize.split(",");k.libraryPicker=k.libraryPicker.setSize(J[0],J[1])}urlParams.topBaseUrl&&(k.libraryPicker=k.libraryPicker.setOrigin(decodeURIComponent(urlParams.topBaseUrl)));k.libraryPicker=k.libraryPicker.setCallback(mxUtils.bind(this,function(K){K.action!=google.picker.Action.PICKED&&K.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",d);K.action==google.picker.Action.PICKED&&this.filePicked(K)})).build()}mxEvent.addListener(document,"click",d);k.libraryPicker.setVisible(!0)}catch(K){this.ui.spinner.stop(),this.ui.handleError(K)}}))};DriveClient.prototype.showPermissions=function(m,d){var q=mxUtils.bind(this,function(){var u=new ConfirmDialog(this.ui,mxResources.get("googleSharingNotAvailable"),mxUtils.bind(this,function(){var y=null!=d?d.getFolderUrl():"https://drive.google.com/open?id="+m;this.ui.editor.graph.openLink(y)}),null,mxResources.get("open"),null,null,null,null,IMAGE_PATH+"/google-share.png");this.ui.showDialog(u.container,400,150,!0,!0);u.init()});this.sharingFailed?q():this.checkToken(mxUtils.bind(this,function(){try{var u=new gapi.drive.share.ShareClient(this.appId);-u.setOAuthToken(b);u.setItemIds([m]);u.showSettingsDialog();"MutationObserver"in window&&(null!=this.sharingObserver&&(this.sharingObserver.disconnect(),this.sharingObserver=null),this.sharingObserver=new MutationObserver(mxUtils.bind(this,function(y){for(var A=!1,J=0;J<y.length;J++)for(var K=0;K<y[J].addedNodes.length;K++){var H=y[J].addedNodes[K];"BUTTON"==H.nodeName&&"ok"==H.getAttribute("name")&&null!=H.parentNode&&null!=H.parentNode.parentNode&&"dialog"==H.parentNode.parentNode.getAttribute("role")?-(this.sharingFailed=!0,H.click(),q(),A=!0):"DIV"==H.nodeName&&"shr-q-shr-r-shr-xb"==H.className&&(A=!0)}A&&(this.sharingObserver.disconnect(),this.sharingObserver=null)})),this.sharingObserver.observe(document,{childList:!0,subtree:!0}))}catch(y){this.ui.handleError(y)}}))};DriveClient.prototype.clearPersistentToken=function(){var m=JSON.parse(this.getPersistentToken(!0))||{};delete m.current;delete m[this.userId];for(var d in m){m.current={userId:d,expires:0};break}DrawioClient.prototype.setPersistentToken.call(this,+u.setOAuthToken(b);u.setItemIds([m]);u.showSettingsDialog();"MutationObserver"in window&&(null!=this.sharingObserver&&(this.sharingObserver.disconnect(),this.sharingObserver=null),this.sharingObserver=new MutationObserver(mxUtils.bind(this,function(y){for(var A=!1,J=0;J<y.length;J++)for(var K=0;K<y[J].addedNodes.length;K++){var F=y[J].addedNodes[K];"BUTTON"==F.nodeName&&"ok"==F.getAttribute("name")&&null!=F.parentNode&&null!=F.parentNode.parentNode&&"dialog"==F.parentNode.parentNode.getAttribute("role")?+(this.sharingFailed=!0,F.click(),q(),A=!0):"DIV"==F.nodeName&&"shr-q-shr-r-shr-xb"==F.className&&(A=!0)}A&&(this.sharingObserver.disconnect(),this.sharingObserver=null)})),this.sharingObserver.observe(document,{childList:!0,subtree:!0}))}catch(y){this.ui.handleError(y)}}))};DriveClient.prototype.clearPersistentToken=function(){var m=JSON.parse(this.getPersistentToken(!0))||{};delete m.current;delete m[this.userId];for(var d in m){m.current={userId:d,expires:0};break}DrawioClient.prototype.setPersistentToken.call(this,JSON.stringify(m))};DriveClient.prototype.setPersistentToken=function(m,d){var q=JSON.parse(this.getPersistentToken(!0))||{};m.userId=this.userId;q.current=m;q[this.userId]={user:this.user};DrawioClient.prototype.setPersistentToken.call(this,JSON.stringify(q),d)}})();DropboxFile=function(b,k,m){DrawioFile.call(this,b,k);this.stat=m};mxUtils.extend(DropboxFile,DrawioFile);DropboxFile.prototype.getId=function(){return this.stat.path_display.substring(1)};DropboxFile.prototype.getHash=function(){return"D"+encodeURIComponent(this.getId())};DropboxFile.prototype.getMode=function(){return App.MODE_DROPBOX};DropboxFile.prototype.isAutosaveOptional=function(){return!0};DropboxFile.prototype.getTitle=function(){return this.stat.name};DropboxFile.prototype.isRenamable=function(){return!0};DropboxFile.prototype.getSize=function(){return this.stat.size};DropboxFile.prototype.isRevisionHistorySupported=function(){return!0};DropboxFile.prototype.getFileUrl=function(){return"https://www.dropbox.com/home/Apps"+this.ui.dropbox.appPath+this.stat.path_display};DropboxFile.prototype.getFolderUrl=function(){var b=this.getFileUrl();return b.substring(0,b.lastIndexOf("/"))};DropboxFile.prototype.getRevisions=function(b,k){var m=this.ui.dropbox.client.filesListRevisions({path:this.stat.path_lower,limit:100});m.then(mxUtils.bind(this,function(d){try{for(var q=[],u=d.entries.length-1;0<=u;u--)mxUtils.bind(this,function(y){q.push({modifiedDate:y.client_modified,fileSize:y.size,getXml:mxUtils.bind(this,function(A,J){this.ui.dropbox.readFile({path:this.stat.path_lower,rev:y.rev},A,J)}),getUrl:mxUtils.bind(this,function(A){return this.ui.getUrl(window.location.pathname+"?rev="+@@ -14746,22 +14750,22 @@ function(){this.ui.editor.loadUrl(this.redirectUri+"?doLogout=1&state="+encodeURy.then(mxUtils.bind(this,function(A){window.clearTimeout(u);q&&(this.setUser(new DrawioUser(A.account_id,A.email,A.name.display_name)),k())}));y["catch"](mxUtils.bind(this,function(A){window.clearTimeout(u);q&&(null==A||401!==A.status||d?m({message:mxResources.get("accessDenied")}):(this.setUser(null),this.client.setAccessToken(null),b=null,this.authenticate(mxUtils.bind(this,function(){this.updateUser(k,m,!0)}),m)))}))};DropboxClient.prototype.authenticate=function(k,m){(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(d){200<=d.getStatus()&&299>=d.getStatus()?this.authenticateStep2(d.getText(),k,m):null!=m&&m(d)}),m)};DropboxClient.prototype.authenticateStep2=function(k,m,d){if(null==window.onDropboxCallback){var q=mxUtils.bind(this,function(){var u=!0;null!=this.getPersistentToken(!0)?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k),null,"GET")).send(mxUtils.bind(this,function(y){if(200<=y.getStatus()&&299>=y.getStatus())try{b=JSON.parse(y.getText()).access_token,this.client.setAccessToken(b),this.setUser(null),m()}catch(A){d({message:mxResources.get("authFailed"),retry:q})}else this.clearPersistentToken(),this.setUser(null),b=null,this.client.setAccessToken(null),401==y.getStatus()?q():d({message:mxResources.get("accessDenied"),retry:q})}),d):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(y,A){null!=window.open("https://www.dropbox.com/oauth2/authorize?client_id="+this.clientId+-(y?"&token_access_type=offline":"")+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k),"dbauth")?window.onDropboxCallback=mxUtils.bind(this,function(J,K){if(u){window.onDropboxCallback=null;u=!1;try{null==J?d({message:mxResources.get("accessDenied"),retry:q}):(null!=A&&A(),b=J.access_token,this.client.setAccessToken(b),this.setUser(null),y&&this.setPersistentToken("remembered"),m())}catch(H){d(H)}finally{null!=+(y?"&token_access_type=offline":"")+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k),"dbauth")?window.onDropboxCallback=mxUtils.bind(this,function(J,K){if(u){window.onDropboxCallback=null;u=!1;try{null==J?d({message:mxResources.get("accessDenied"),retry:q}):(null!=A&&A(),b=J.access_token,this.client.setAccessToken(b),this.setUser(null),y&&this.setPersistentToken("remembered"),m())}catch(F){d(F)}finally{null!=K&&K.close()}}else null!=K&&K.close()}):d({message:mxResources.get("serviceUnavailableOrBlocked"),retry:q})}),mxUtils.bind(this,function(){u&&(window.onDropboxCallback=null,u=!1,d({message:mxResources.get("accessDenied"),retry:q}))}))});q()}else d({code:App.ERROR_BUSY})};DropboxClient.prototype.getErrorMessage=function(k){return null!=k&&null!=k.status?mxResources.get("error")+" "+k.status:mxResources.get("noResponse")};DropboxClient.prototype.executePromise=function(k,m,d){var q=mxUtils.bind(this,-function(y){var A=!0,J=window.setTimeout(mxUtils.bind(this,function(){A=!1;d({code:App.ERROR_TIMEOUT,retry:u})}),this.ui.timeout),K=k();K.then(mxUtils.bind(this,function(H){window.clearTimeout(J);A&&null!=m&&m(H)}));K["catch"](mxUtils.bind(this,function(H){window.clearTimeout(J);A&&(null==H||500!=H.status&&400!=H.status&&401!=H.status?d({message:this.getErrorMessage(H)}):(this.setUser(null),this.client.setAccessToken(null),b=null,y?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,+function(y){var A=!0,J=window.setTimeout(mxUtils.bind(this,function(){A=!1;d({code:App.ERROR_TIMEOUT,retry:u})}),this.ui.timeout),K=k();K.then(mxUtils.bind(this,function(F){window.clearTimeout(J);A&&null!=m&&m(F)}));K["catch"](mxUtils.bind(this,function(F){window.clearTimeout(J);A&&(null==F||500!=F.status&&400!=F.status&&401!=F.status?d({message:this.getErrorMessage(F)}):(this.setUser(null),this.client.setAccessToken(null),b=null,y?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){u(!0)},d)})}):this.authenticate(function(){q(!0)},d)))}))}),u=mxUtils.bind(this,function(y){null==this.user?this.updateUser(function(){u(!0)},d,y):q(y)});null==b?this.authenticate(function(){u(!0)},d):u(!1)};DropboxClient.prototype.getLibrary=function(k,m,d){this.getFile(k,m,d,!0)};DropboxClient.prototype.getFile=function(k,m,d,q){q=null!=q?q:!1;var u=/\.png$/i.test(k);if(/^https:\/\//i.test(k)||/\.v(dx|sdx?)$/i.test(k)||/\.gliffy$/i.test(k)||/\.pdf$/i.test(k)||-!Editor.useCanvasForExport&&u){var y=mxUtils.bind(this,function(){var A=k.split("/");this.ui.convertFile(k,0<A.length?A[A.length-1]:k,null,this.extension,m,d)});null!=b?y():this.authenticate(y,d)}else y={path:"/"+k},null!=urlParams.rev&&(y.rev=urlParams.rev),this.readFile(y,mxUtils.bind(this,function(A,J){var K=null;if(0<(u?A.lastIndexOf(","):-1)){var H=this.ui.extractGraphModelFromPng(A);null!=H&&0<H.length?A=H:K=new LocalFile(this,A,k,!0)}m(null!=K?K:q?new DropboxLibrary(this.ui,A,J):new DropboxFile(this.ui,-A,J))}),d,u)};DropboxClient.prototype.readFile=function(k,m,d,q){var u=mxUtils.bind(this,function(A){var J=!0,K=window.setTimeout(mxUtils.bind(this,function(){J=!1;d({code:App.ERROR_TIMEOUT})}),this.ui.timeout),H=this.client.filesGetMetadata({path:"/"+k.path.substring(1),include_deleted:!1});H.then(mxUtils.bind(this,function(G){}));H["catch"](function(G){window.clearTimeout(K);J&&null!=G&&409==G.status&&(J=!1,d({message:mxResources.get("fileNotFound")}))});H=this.client.filesDownload(k);H.then(mxUtils.bind(this,-function(G){window.clearTimeout(K);if(J){J=!1;try{var c=new FileReader;c.onload=mxUtils.bind(this,function(f){m(c.result,G)});q?c.readAsDataURL(G.fileBlob):c.readAsText(G.fileBlob)}catch(f){d(f)}}}));H["catch"](mxUtils.bind(this,function(G){window.clearTimeout(K);J&&(J=!1,null==G||500!=G.status&&400!=G.status&&401!=G.status?d({message:this.getErrorMessage(G)}):(this.client.setAccessToken(null),this.setUser(null),b=null,A?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){y(!0)},+!Editor.useCanvasForExport&&u){var y=mxUtils.bind(this,function(){var A=k.split("/");this.ui.convertFile(k,0<A.length?A[A.length-1]:k,null,this.extension,m,d)});null!=b?y():this.authenticate(y,d)}else y={path:"/"+k},null!=urlParams.rev&&(y.rev=urlParams.rev),this.readFile(y,mxUtils.bind(this,function(A,J){var K=null;if(0<(u?A.lastIndexOf(","):-1)){var F=this.ui.extractGraphModelFromPng(A);null!=F&&0<F.length?A=F:K=new LocalFile(this,A,k,!0)}m(null!=K?K:q?new DropboxLibrary(this.ui,A,J):new DropboxFile(this.ui,+A,J))}),d,u)};DropboxClient.prototype.readFile=function(k,m,d,q){var u=mxUtils.bind(this,function(A){var J=!0,K=window.setTimeout(mxUtils.bind(this,function(){J=!1;d({code:App.ERROR_TIMEOUT})}),this.ui.timeout),F=this.client.filesGetMetadata({path:"/"+k.path.substring(1),include_deleted:!1});F.then(mxUtils.bind(this,function(H){}));F["catch"](function(H){window.clearTimeout(K);J&&null!=H&&409==H.status&&(J=!1,d({message:mxResources.get("fileNotFound")}))});F=this.client.filesDownload(k);F.then(mxUtils.bind(this,+function(H){window.clearTimeout(K);if(J){J=!1;try{var c=new FileReader;c.onload=mxUtils.bind(this,function(f){m(c.result,H)});q?c.readAsDataURL(H.fileBlob):c.readAsText(H.fileBlob)}catch(f){d(f)}}}));F["catch"](mxUtils.bind(this,function(H){window.clearTimeout(K);J&&(J=!1,null==H||500!=H.status&&400!=H.status&&401!=H.status?d({message:this.getErrorMessage(H)}):(this.client.setAccessToken(null),this.setUser(null),b=null,A?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){y(!0)},d)})}):this.authenticate(function(){u(!0)},d)))}))}),y=mxUtils.bind(this,function(A){null==this.user?this.updateUser(function(){y(!0)},d,A):u(A)});null==b?this.authenticate(function(){y(!0)},d):y(!1)};DropboxClient.prototype.checkExists=function(k,m,d){var q=mxUtils.bind(this,function(){return this.client.filesGetMetadata({path:"/"+k.toLowerCase(),include_deleted:!1})});this.executePromise(q,mxUtils.bind(this,function(u){d?m(!1,!0,u):this.ui.confirm(mxResources.get("replaceIt",[k]),function(){m(!0,-!0,u)},function(){m(!1,!0,u)})}),function(u){m(!0,!1)})};DropboxClient.prototype.renameFile=function(k,m,d,q){if(/[\\\/:\?\*"\|]/.test(m))q({message:mxResources.get("dropboxCharsNotAllowed")});else{if(null!=k&&null!=m){var u=k.stat.path_display.substring(1),y=u.lastIndexOf("/");0<y&&(m=u.substring(0,y+1)+m)}null!=k&&null!=m&&k.stat.path_lower.substring(1)!==m.toLowerCase()?this.checkExists(m,mxUtils.bind(this,function(A,J,K){A?(A=mxUtils.bind(this,function(H){H=mxUtils.bind(this,function(){return this.client.filesMove({from_path:k.stat.path_display,-to_path:"/"+m,autorename:!1})});this.executePromise(H,d,q)}),J&&K.path_lower.substring(1)!==m.toLowerCase()?(J=mxUtils.bind(this,function(){return this.client.filesDelete({path:"/"+m.toLowerCase()})}),this.executePromise(J,A,q)):A()):q()})):q({message:mxResources.get("invalidName")})}};DropboxClient.prototype.insertLibrary=function(k,m,d,q){this.insertFile(k,m,d,q,!0)};DropboxClient.prototype.insertFile=function(k,m,d,q,u){u=null!=u?u:!1;this.checkExists(k,mxUtils.bind(this,function(y){y?this.saveFile(k,+!0,u)},function(){m(!1,!0,u)})}),function(u){m(!0,!1)})};DropboxClient.prototype.renameFile=function(k,m,d,q){if(/[\\\/:\?\*"\|]/.test(m))q({message:mxResources.get("dropboxCharsNotAllowed")});else{if(null!=k&&null!=m){var u=k.stat.path_display.substring(1),y=u.lastIndexOf("/");0<y&&(m=u.substring(0,y+1)+m)}null!=k&&null!=m&&k.stat.path_lower.substring(1)!==m.toLowerCase()?this.checkExists(m,mxUtils.bind(this,function(A,J,K){A?(A=mxUtils.bind(this,function(F){F=mxUtils.bind(this,function(){return this.client.filesMove({from_path:k.stat.path_display,+to_path:"/"+m,autorename:!1})});this.executePromise(F,d,q)}),J&&K.path_lower.substring(1)!==m.toLowerCase()?(J=mxUtils.bind(this,function(){return this.client.filesDelete({path:"/"+m.toLowerCase()})}),this.executePromise(J,A,q)):A()):q()})):q({message:mxResources.get("invalidName")})}};DropboxClient.prototype.insertLibrary=function(k,m,d,q){this.insertFile(k,m,d,q,!0)};DropboxClient.prototype.insertFile=function(k,m,d,q,u){u=null!=u?u:!1;this.checkExists(k,mxUtils.bind(this,function(y){y?this.saveFile(k,m,mxUtils.bind(this,function(A){u?d(new DropboxLibrary(this.ui,m,A)):d(new DropboxFile(this.ui,m,A))}),q):q()}))};DropboxClient.prototype.saveFile=function(k,m,d,q,u){if(/[\\\/:\?\*"\|]/.test(k))q({message:mxResources.get("dropboxCharsNotAllowed")});else if(15E7<=m.length)q({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(m.length)+" / 150 MB)"});else{u=null!=u?u:"";var y=mxUtils.bind(this,function(){return this.client.filesUpload({path:"/"+u+k,mode:{".tag":"overwrite"},mute:!0,contents:new Blob([m],{type:"text/plain"})})});this.executePromise(y,d,q)}};DropboxClient.prototype.pickLibrary=function(k){Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(m){if(this.ui.spinner.spin(document.body,mxResources.get("loading"))){var d=mxUtils.bind(this,function(y){this.ui.spinner.stop();this.ui.handleError(y)}),q=null!=m[0].link?m[0].link.indexOf(this.appPath):-1;if(0<q){var u=decodeURIComponent(m[0].link.substring(q+this.appPath.length-1));this.readFile({path:u},mxUtils.bind(this,function(y,A){if(null!=A&&A.id==m[0].id)try{this.ui.spinner.stop(),k(u.substring(1),new DropboxLibrary(this.ui,y,A))}catch(J){this.ui.handleError(J)}else this.createLibrary(m[0],k,d)}),d)}else this.createLibrary(m[0],k,d)}})})};DropboxClient.prototype.createLibrary=function(k,m,d){this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[k.name]),mxUtils.bind(this,function(){this.ui.editor.loadUrl(k.link,mxUtils.bind(this,function(q){this.insertFile(k.name,q,mxUtils.bind(this,function(u){try{this.ui.spinner.stop(),m(u.getHash().substring(1),u)}catch(y){d(y)}}),d,!0)}),d)}),mxUtils.bind(this,function(){this.ui.spinner.stop()}))};DropboxClient.prototype.pickFile=function(k,m){null!=Dropbox.choose?(k=null!=k?k:mxUtils.bind(this,function(d,q){this.ui.loadFile(null!=d?"D"+encodeURIComponent(d):q.getHash(),null,q)}),Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(d){if(this.ui.spinner.spin(document.body,-mxResources.get("loading")))if(m)this.ui.spinner.stop(),k(d[0].link);else{var q=mxUtils.bind(this,function(K){this.ui.spinner.stop();this.ui.handleError(K)}),u=mxUtils.bind(this,function(K,H){this.ui.spinner.stop();k(K,H)}),y=/\.png$/i.test(d[0].name);if(/\.vsdx$/i.test(d[0].name)||/\.gliffy$/i.test(d[0].name)||!Editor.useCanvasForExport&&y)u(d[0].link);else{var A=null!=d[0].link?d[0].link.indexOf(this.appPath):-1;if(0<A){var J=decodeURIComponent(d[0].link.substring(A+this.appPath.length-1));this.readFile({path:J},-mxUtils.bind(this,function(K,H){if(null!=H&&H.id==d[0].id){var G=y?K.lastIndexOf(","):-1;this.ui.spinner.stop();var c=null;0<G&&(G=this.ui.extractGraphModelFromPng(K),null!=G&&0<G.length?K=G:c=new LocalFile(this,K,J,!0));k(J.substring(1),null!=c?c:new DropboxFile(this.ui,K,H))}else this.createFile(d[0],u,q)}),q,y)}else this.createFile(d[0],u,q)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})};DropboxClient.prototype.createFile=function(k,m,d){var q=/(\.png)$/i.test(k.name);+mxResources.get("loading")))if(m)this.ui.spinner.stop(),k(d[0].link);else{var q=mxUtils.bind(this,function(K){this.ui.spinner.stop();this.ui.handleError(K)}),u=mxUtils.bind(this,function(K,F){this.ui.spinner.stop();k(K,F)}),y=/\.png$/i.test(d[0].name);if(/\.vsdx$/i.test(d[0].name)||/\.gliffy$/i.test(d[0].name)||!Editor.useCanvasForExport&&y)u(d[0].link);else{var A=null!=d[0].link?d[0].link.indexOf(this.appPath):-1;if(0<A){var J=decodeURIComponent(d[0].link.substring(A+this.appPath.length-1));this.readFile({path:J},+mxUtils.bind(this,function(K,F){if(null!=F&&F.id==d[0].id){var H=y?K.lastIndexOf(","):-1;this.ui.spinner.stop();var c=null;0<H&&(H=this.ui.extractGraphModelFromPng(K),null!=H&&0<H.length?K=H:c=new LocalFile(this,K,J,!0));k(J.substring(1),null!=c?c:new DropboxFile(this.ui,K,F))}else this.createFile(d[0],u,q)}),q,y)}else this.createFile(d[0],u,q)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})};DropboxClient.prototype.createFile=function(k,m,d){var q=/(\.png)$/i.test(k.name);this.ui.editor.loadUrl(k.link,mxUtils.bind(this,function(u){null!=u&&0<u.length?this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[k.name]),mxUtils.bind(this,function(){var y=q?u.lastIndexOf(","):-1;0<y&&(y=this.ui.extractGraphModelFromPng(u.substring(y+1)),null!=y&&0<y.length&&(u=y));this.insertFile(k.name,u,mxUtils.bind(this,function(A){m(k.name,A)}),d)}),mxUtils.bind(this,function(){this.ui.spinner.stop()})):(this.ui.spinner.stop(),d({message:mxResources.get("errorLoadingFile")}))}),d,q)}})();OneDriveFile=function(b,k,m,d){DrawioFile.call(this,b,k);this.meta=m;this.isSP=d};mxUtils.extend(OneDriveFile,DrawioFile);OneDriveFile.prototype.autosaveDelay=500;OneDriveFile.prototype.isRealtimeSupported=function(){return!0};OneDriveFile.prototype.getFileUrl=function(){var b=this.meta.webUrl;b=b.substring(0,b.lastIndexOf("/"));if(null!=this.meta.parentReference)try{if("personal"==this.meta.parentReference.driveType)b="https://onedrive.live.com/?cid="+encodeURIComponent(this.meta.parentReference.driveId)+"&id="+encodeURIComponent(this.meta.id);else if("documentLibrary"==this.meta.parentReference.driveType){var k=this.meta.parentReference.path;k=k.substring(k.indexOf("/root:")+6);var m=this.meta.webUrl;b=m.substring(0,@@ -14775,124 +14779,124 @@ OneDriveFile.prototype.setDescriptor=function(b){this.meta=b};OneDriveFile.protoOneDriveFile.prototype.getChannelKey=function(){return"undefined"!==typeof CryptoJS?CryptoJS.MD5(this.meta.createdDateTime+(null!=this.meta.createdBy&&null!=this.meta.createdBy.user?this.meta.createdBy.user.id:"")).toString():null};OneDriveFile.prototype.getLastModifiedDate=function(){return new Date(this.meta.lastModifiedDateTime)};OneDriveFile.prototype.save=function(b,k,m,d,q){this.doSave(this.getTitle(),b,k,m,d,q)};OneDriveFile.prototype.saveAs=function(b,k,m){this.doSave(b,!1,k,m)};OneDriveFile.prototype.doSave=function(b,k,m,d,q,u){var y=this.meta.name;this.meta.name=b;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=y;this.saveFile(b,k,m,d,q,u)}),d,q,u])};OneDriveFile.prototype.saveFile=function(b,k,m,d,q,u){if(!this.isEditable())null!=m&&m();else if(!this.savingFile)if(this.getTitle()==b){var y=mxUtils.bind(this,function(){try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var A=u||this.constructor!=OneDriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:this.getCurrentEtag(),J=this.meta;null!=this.sync&&this.sync.fileSaving();(this.isSP?this.ui.m365:this.ui.oneDrive).saveFile(this,mxUtils.bind(this,function(K,-H){this.setModified(this.getShadowModified());this.savingFile=!1;this.meta=K;this.fileSaved(H,J,mxUtils.bind(this,function(){this.contentChanged();null!=m&&m()}),d)}),mxUtils.bind(this,function(K,H){try{this.savingFile=!1,this.isConflict(H)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();y()}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=-!1;null!=d&&d()}))):null!=d&&d()):null!=d&&d(K)}catch(G){if(this.savingFile=!1,null!=d)d(G);else throw G;}}),A)}catch(K){if(this.savingFile=!1,null!=d)d(K);else throw K;}});y()}else this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,(this.isSP?this.ui.m365:this.ui.oneDrive).insertFile(b,this.getData(),mxUtils.bind(this,function(A){this.setModified(this.getShadowModified());this.savingFile=!1;null!=m&&m();this.ui.fileLoaded(A)}),mxUtils.bind(this,function(){this.savingFile=+F){this.setModified(this.getShadowModified());this.savingFile=!1;this.meta=K;this.fileSaved(F,J,mxUtils.bind(this,function(){this.contentChanged();null!=m&&m()}),d)}),mxUtils.bind(this,function(K,F){try{this.savingFile=!1,this.isConflict(F)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();y()}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=+!1;null!=d&&d()}))):null!=d&&d()):null!=d&&d(K)}catch(H){if(this.savingFile=!1,null!=d)d(H);else throw H;}}),A)}catch(K){if(this.savingFile=!1,null!=d)d(K);else throw K;}});y()}else this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,(this.isSP?this.ui.m365:this.ui.oneDrive).insertFile(b,this.getData(),mxUtils.bind(this,function(A){this.setModified(this.getShadowModified());this.savingFile=!1;null!=m&&m();this.ui.fileLoaded(A)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}))};OneDriveFile.prototype.rename=function(b,k,m){var d=this.getCurrentRevisionId();(this.isSP?this.ui.m365:this.ui.oneDrive).renameFile(this,b,mxUtils.bind(this,function(q){this.hasSameExtension(b,this.getTitle())?(this.meta=q,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(d),null!=k&&k(q)):(this.meta=q,null!=this.sync&&this.sync.descriptorChanged(d),this.save(!0,k,m))}),m)};-OneDriveFile.prototype.move=function(b,k,m){(this.isSP?this.ui.m365:this.ui.oneDrive).moveFile(this.getId(),b,mxUtils.bind(this,function(d){this.meta=d;this.descriptorChanged();null!=k&&k(d)}),m)};OneDriveLibrary=function(b,k,m,d){OneDriveFile.call(this,b,k,m,d)};mxUtils.extend(OneDriveLibrary,OneDriveFile);OneDriveLibrary.prototype.isAutosave=function(){return!0};OneDriveLibrary.prototype.save=function(b,k,m){(this.isSP?this.ui.m365:this.ui.oneDrive).saveFile(this,mxUtils.bind(this,function(d){this.desc=d;null!=k&&k(d)}),m)};OneDriveLibrary.prototype.open=function(){};(function(){var b=null,k=null,m=null,d=null,q=null,u=null,y=null,A=null;window.OneDriveClient=function(G,c,f,l,n){this.sharepointMode=!0===n;null==c&&null!=window.urlParams&&"1"==window.urlParams.extAuth&&(c=!0);null==f&&(f=null!=window.Editor?Editor.oneDriveInlinePicker:!0);null==l&&null!=window.urlParams&&"1"==window.urlParams.noLogoutOD&&(l=!0);DrawioClient.call(this,G,c?"oneDriveExtAuthInfo":this.sharepointMode?"ms365AuthInfo":"oneDriveAuthInfo");this.isExtAuth=c;this.inlinePicker=f;this.noLogout=-l;G=JSON.parse(this.token);null!=G&&(this.endpointHint=null!=G.endpointHint?G.endpointHint.replace("/Documents","/_layouts/15/onedrive.aspx"):G.endpointHint);this.sharepointMode&&(this.redirectUri=window.DRAWIO_SERVER_URL+"ms365")};mxUtils.extend(OneDriveClient,DrawioClient);OneDriveClient.prototype.clientId=window.DRAWIO_MSGRAPH_CLIENT_ID||("test.draw.io"==window.location.hostname?"95e4b4ed-ed5c-4a05-935b-b411b4562ef2":"24b129a6-117b-4394-bdc8-3b9955e5cdef");OneDriveClient.prototype.clientId="app.diagrams.net"==+OneDriveFile.prototype.move=function(b,k,m){(this.isSP?this.ui.m365:this.ui.oneDrive).moveFile(this.getId(),b,mxUtils.bind(this,function(d){this.meta=d;this.descriptorChanged();null!=k&&k(d)}),m)};OneDriveLibrary=function(b,k,m,d){OneDriveFile.call(this,b,k,m,d)};mxUtils.extend(OneDriveLibrary,OneDriveFile);OneDriveLibrary.prototype.isAutosave=function(){return!0};OneDriveLibrary.prototype.save=function(b,k,m){(this.isSP?this.ui.m365:this.ui.oneDrive).saveFile(this,mxUtils.bind(this,function(d){this.desc=d;null!=k&&k(d)}),m)};OneDriveLibrary.prototype.open=function(){};(function(){var b=null,k=null,m=null,d=null,q=null,u=null,y=null,A=null;window.OneDriveClient=function(H,c,f,l,n){this.sharepointMode=!0===n;null==c&&null!=window.urlParams&&"1"==window.urlParams.extAuth&&(c=!0);null==f&&(f=null!=window.Editor?Editor.oneDriveInlinePicker:!0);null==l&&null!=window.urlParams&&"1"==window.urlParams.noLogoutOD&&(l=!0);DrawioClient.call(this,H,c?"oneDriveExtAuthInfo":this.sharepointMode?"ms365AuthInfo":"oneDriveAuthInfo");this.isExtAuth=c;this.inlinePicker=f;this.noLogout=+l;H=JSON.parse(this.token);null!=H&&(this.endpointHint=null!=H.endpointHint?H.endpointHint.replace("/Documents","/_layouts/15/onedrive.aspx"):H.endpointHint);this.sharepointMode&&(this.redirectUri=window.DRAWIO_SERVER_URL+"ms365")};mxUtils.extend(OneDriveClient,DrawioClient);OneDriveClient.prototype.clientId=window.DRAWIO_MSGRAPH_CLIENT_ID||("test.draw.io"==window.location.hostname?"95e4b4ed-ed5c-4a05-935b-b411b4562ef2":"24b129a6-117b-4394-bdc8-3b9955e5cdef");OneDriveClient.prototype.clientId="app.diagrams.net"==window.location.hostname?"b5ff67d6-3155-4fca-965a-59a3655c4476":OneDriveClient.prototype.clientId;OneDriveClient.prototype.clientId="viewer.diagrams.net"==window.location.hostname?"417a451a-a343-4788-b6c1-901e63182565":OneDriveClient.prototype.clientId;OneDriveClient.prototype.scopes="user.read files.readwrite.all sites.read.all";OneDriveClient.prototype.scopesSP="https://microsoft.sharepoint.com/AllSites.Write https://microsoft.sharepoint.com/MyFiles.Write";OneDriveClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+"microsoft";OneDriveClient.prototype.pickerRedirectUri=window.DRAWIO_SERVER_URL+"onedrive3.html";OneDriveClient.prototype.defEndpointHint="api.onedrive.com";OneDriveClient.prototype.endpointHint=OneDriveClient.prototype.defEndpointHint;OneDriveClient.prototype.rootId={id:"root",name:"root",parentReference:{driveId:"me"}};OneDriveClient.prototype.extension=".drawio";OneDriveClient.prototype.baseUrl="https://graph.microsoft.com/v1.0";OneDriveClient.prototype.authUrl="https://login.microsoftonline.com/"+-(window.DRAWIO_MSGRAPH_TENANT_ID||"common");OneDriveClient.prototype.PICKER_SDK_VERSION="8.0";OneDriveClient.prototype.FILE_EXTENSIONS=".drawio .xml .svg .png .pdf .vsdx".split(" ");OneDriveClient.prototype.sharepointMode=!1;OneDriveClient.prototype.emptyFn=function(){};OneDriveClient.prototype.invalidFilenameRegExs=[/[~"#%\*:<>\?\/\\{\|}]/,/^\.lock$/i,/^CON$/i,/^PRN$/i,/^AUX$/i,/^NUL$/i,/^COM\d$/i,/^LPT\d$/i,/^desktop\.ini$/i,/_vti_/i];OneDriveClient.prototype.isValidFilename=function(G){if(null==-G||""===G)return!1;for(var c=0;c<this.invalidFilenameRegExs.length;c++)if(this.invalidFilenameRegExs[c].test(G))return!1;return!0};OneDriveClient.prototype.get=function(G,c,f){G=new mxXmlRequest(G,null,"GET");G.setRequestHeaders=mxUtils.bind(this,function(l,n){l.setRequestHeader("Authorization","Bearer "+b)});G.send(c,f);return G};OneDriveClient.prototype.updateUser=function(G,c,f){var l=!0,n=window.setTimeout(mxUtils.bind(this,function(){l=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.get(this.baseUrl+-"/me",mxUtils.bind(this,function(r){window.clearTimeout(n);if(l)if(200>r.getStatus()||300<=r.getStatus())f?c({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(G,c,!0)}),c,null,this.sharepointMode));else try{var t=JSON.parse(r.getText());this.setUser(new DrawioUser(t.id,t.mail,t.displayName));G()}catch(x){c(x)}}),mxUtils.bind(this,function(r){window.clearTimeout(n);l&&c(r)}))};OneDriveClient.prototype.resetTokenRefresh=function(G){null!=-this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);0<G&&(this.tokenRefreshInterval=1E3*G,this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authenticate(this.emptyFn,this.emptyFn,!0,this.sharepointMode)}),900*G))};OneDriveClient.prototype.authenticate=function(G,c,f,l,n){this.isExtAuth?(window.oneDriveAuth?window.oneDriveAuth:window.parent.oneDriveAuth)(mxUtils.bind(this,function(r){this.updateAuthInfo(r,!0,null==this.endpointHint,-G,c)}),c,null!=window.urlParams&&"1"==urlParams.odAuthCancellable):(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(r){200<=r.getStatus()&&299>=r.getStatus()?this.authenticateStep2(r.getText(),G,c,f,l,n):null!=c&&c({message:mxResources.get("error")+" "+r.getStatus()})}),c)};OneDriveClient.prototype.updateAuthInfo=function(G,c,f,l,n,r){f&&this.setUser(null);r?m=G.access_token:(b=G.access_token,this.sharepointMode&&(k=G.access_token));delete G.access_token;-G.expiresOn=Date.now()+1E3*G.expires_in;this.tokenExpiresOn=G.expiresOn;G.remember=c;this.setPersistentToken(JSON.stringify(G),!c);this.resetTokenRefresh(G.expires_in);f?this.getAccountTypeAndEndpoint(mxUtils.bind(this,function(){l()}),n):l()};OneDriveClient.prototype.authenticateStep2=function(G,c,f,l,n,r){if(null==window.onOneDriveCallback){var t=mxUtils.bind(this,function(){var x=!0,B=JSON.parse(this.getPersistentToken(!0));null!=B?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+-this.clientId+"&domain="+window.location.host+"&token="+G)+"&scopes="+encodeURIComponent(n?this.scopesSP:this.scopes),null,"GET")).send(mxUtils.bind(this,function(F){if(200<=F.getStatus()&&299>=F.getStatus())try{this.updateAuthInfo(JSON.parse(F.getText()),B.remember,r,mxUtils.bind(this,function(){n?this.authenticate(c,f,l,!1):c()}),f,n)}catch(L){f({message:mxResources.get("authFailed"),retry:t})}else this.clearPersistentToken(),this.setUser(null),b=null,this.sharepointMode&&(k=null),401!=F.getStatus()&&-400!=F.getStatus()||l?f({message:mxResources.get("accessDenied"),retry:t}):t()}),f):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(F,L){var D=this.authUrl+"/oauth2/v2.0/authorize?client_id="+this.clientId+"&response_type=code&prompt=select_account&redirect_uri="+encodeURIComponent(this.redirectUri)+"&scope="+encodeURIComponent((n?this.scopesSP:this.scopes)+(F?" offline_access":""))+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+G);D=window.open(D,-"odauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join());null!=D&&(window.onOneDriveCallback=mxUtils.bind(this,function(T,N){if(x){window.onOneDriveCallback=null;x=!1;try{null==T?f({message:mxResources.get("accessDenied"),retry:t}):(null!=L&&L(),this.updateAuthInfo(T,F,!n,mxUtils.bind(this,function(){n?this.authenticate(c,f,l,!1,-!0):c()}),f,n))}catch(R){f(R)}finally{null!=N&&N.close()}}else null!=N&&N.close()}),D.focus())}),mxUtils.bind(this,function(){x&&(window.onOneDriveCallback=null,x=!1,f({message:mxResources.get("accessDenied"),retry:t}))}))});t()}else f({code:App.ERROR_BUSY})};OneDriveClient.prototype.getAccountTypeAndEndpoint=function(G,c){this.get(this.baseUrl+"/me/drive/root",mxUtils.bind(this,function(f){try{if(200<=f.getStatus()&&299>=f.getStatus()){var l=JSON.parse(f.getText());0<l.webUrl.indexOf(".sharepoint.com")?-this.endpointHint=l.webUrl.replace("/Documents","/_layouts/15/onedrive.aspx"):this.endpointHint=this.defEndpointHint;var n=JSON.parse(this.getPersistentToken(!0));null!=n&&(n.endpointHint=this.endpointHint,this.setPersistentToken(JSON.stringify(n),!n.remember));G();return}}catch(r){}c({message:mxResources.get("unknownError")+" (Code: "+f.getStatus()+")"})}),c)};OneDriveClient.prototype.executeRequest=function(G,c,f){this.sharepointMode&&(b=k);var l=mxUtils.bind(this,function(n){var r=!0,t=window.setTimeout(mxUtils.bind(this,-function(){r=!1;f({code:App.ERROR_TIMEOUT,retry:l})}),this.ui.timeout);this.get(G,mxUtils.bind(this,function(x){window.clearTimeout(t);r&&(200<=x.getStatus()&&299>=x.getStatus()||404==x.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),c(x)):n||401!==x.getStatus()&&400!==x.getStatus()?f(this.parseRequestText(x)):this.authenticate(function(){l(!0)},f,n,this.sharepointMode))}),mxUtils.bind(this,function(x){window.clearTimeout(t);r&&f(x)}))});null==b||6E4>this.tokenExpiresOn--Date.now()?this.authenticate(function(){l(!0)},f,null,this.sharepointMode):l(!1)};OneDriveClient.prototype.checkToken=function(G,c){this.sharepointMode&&(b=k);null==b||null==this.tokenRefreshThread||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(G,null!=c?c:this.emptyFn,null,this.sharepointMode):G()};OneDriveClient.prototype.getItemRef=function(G){var c=G.split("/");return 1<c.length?{driveId:c[0],id:c[1]}:{id:G}};OneDriveClient.prototype.getItemURL=function(G,c){var f=G.split("/");return 1<-f.length?(G=f[1],(c?"":this.baseUrl)+"/drives/"+f[0]+("root"==G?"/root":"/items/"+G)):(c?"":this.baseUrl)+"/me/drive/items/"+G};OneDriveClient.prototype.getLibrary=function(G,c,f){this.getFile(G,c,f,!1,!0)};OneDriveClient.prototype.removeExtraHtmlContent=function(G){var c=G.lastIndexOf('<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"><meta name="Robots" ');0<c&&(G=G.substring(0,c));return G};OneDriveClient.prototype.getFile=function(G,c,f,l,n){n=null!=n?n:!1;this.executeRequest(this.getItemURL(G),-mxUtils.bind(this,function(r){if(200<=r.getStatus()&&299>=r.getStatus()){var t=JSON.parse(r.getText()),x=/\.png$/i.test(t.name);if(/\.v(dx|sdx?)$/i.test(t.name)||/\.gliffy$/i.test(t.name)||/\.pdf$/i.test(t.name)||!Editor.useCanvasForExport&&x)this.ui.convertFile(t["@microsoft.graph.downloadUrl"],t.name,null!=t.file?t.file.mimeType:null,this.extension,c,f);else{var B=!0,F=window.setTimeout(mxUtils.bind(this,function(){B=!1;f({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.editor.loadUrl(t["@microsoft.graph.downloadUrl"],-mxUtils.bind(this,function(L){try{if(window.clearTimeout(F),B){/\.html$/i.test(t.name)&&(L=this.removeExtraHtmlContent(L));var D=null;if(0<(x?L.lastIndexOf(","):-1)){var T=this.ui.extractGraphModelFromPng(L);null!=T&&0<T.length?L=T:D=new LocalFile(this.ui,L,t.name,!0)}else if("data:image/png;base64,PG14ZmlsZS"==L.substring(0,32)){var N=L.substring(22);L=window.atob&&!mxClient.IS_SF?atob(N):Base64.decode(N)}Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(L,t["@microsoft.graph.downloadUrl"])?-this.ui.parseFileData(L,mxUtils.bind(this,function(R){try{4==R.readyState&&(200<=R.status&&299>=R.status?c(new LocalFile(this.ui,R.responseText,t.name+this.extension,!0)):null!=f&&f({message:mxResources.get("errorLoadingFile")}))}catch(P){if(null!=f)f(P);else throw P;}}),t.name):null!=D?c(D):n?c(new OneDriveLibrary(this.ui,L,t,this.sharepointMode)):c(new OneDriveFile(this.ui,L,t,this.sharepointMode))}}catch(R){if(null!=f)f(R);else throw R;}}),mxUtils.bind(this,function(L){window.clearTimeout(F);B&&+(window.DRAWIO_MSGRAPH_TENANT_ID||"common");OneDriveClient.prototype.PICKER_SDK_VERSION="8.0";OneDriveClient.prototype.FILE_EXTENSIONS=".drawio .xml .svg .png .pdf .vsdx".split(" ");OneDriveClient.prototype.sharepointMode=!1;OneDriveClient.prototype.emptyFn=function(){};OneDriveClient.prototype.invalidFilenameRegExs=[/[~"#%\*:<>\?\/\\{\|}]/,/^\.lock$/i,/^CON$/i,/^PRN$/i,/^AUX$/i,/^NUL$/i,/^COM\d$/i,/^LPT\d$/i,/^desktop\.ini$/i,/_vti_/i];OneDriveClient.prototype.isValidFilename=function(H){if(null==+H||""===H)return!1;for(var c=0;c<this.invalidFilenameRegExs.length;c++)if(this.invalidFilenameRegExs[c].test(H))return!1;return!0};OneDriveClient.prototype.get=function(H,c,f){H=new mxXmlRequest(H,null,"GET");H.setRequestHeaders=mxUtils.bind(this,function(l,n){l.setRequestHeader("Authorization","Bearer "+b)});H.send(c,f);return H};OneDriveClient.prototype.updateUser=function(H,c,f){var l=!0,n=window.setTimeout(mxUtils.bind(this,function(){l=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.get(this.baseUrl++"/me",mxUtils.bind(this,function(r){window.clearTimeout(n);if(l)if(200>r.getStatus()||300<=r.getStatus())f?c({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(H,c,!0)}),c,null,this.sharepointMode));else try{var t=JSON.parse(r.getText());this.setUser(new DrawioUser(t.id,t.mail,t.displayName));H()}catch(x){c(x)}}),mxUtils.bind(this,function(r){window.clearTimeout(n);l&&c(r)}))};OneDriveClient.prototype.resetTokenRefresh=function(H){null!=+this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);0<H&&(this.tokenRefreshInterval=1E3*H,this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authenticate(this.emptyFn,this.emptyFn,!0,this.sharepointMode)}),900*H))};OneDriveClient.prototype.authenticate=function(H,c,f,l,n){this.isExtAuth?(window.oneDriveAuth?window.oneDriveAuth:window.parent.oneDriveAuth)(mxUtils.bind(this,function(r){this.updateAuthInfo(r,!0,null==this.endpointHint,+H,c)}),c,null!=window.urlParams&&"1"==urlParams.odAuthCancellable):(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(r){200<=r.getStatus()&&299>=r.getStatus()?this.authenticateStep2(r.getText(),H,c,f,l,n):null!=c&&c({message:mxResources.get("error")+" "+r.getStatus()})}),c)};OneDriveClient.prototype.updateAuthInfo=function(H,c,f,l,n,r){f&&this.setUser(null);r?m=H.access_token:(b=H.access_token,this.sharepointMode&&(k=H.access_token));delete H.access_token;+H.expiresOn=Date.now()+1E3*H.expires_in;this.tokenExpiresOn=H.expiresOn;H.remember=c;this.setPersistentToken(JSON.stringify(H),!c);this.resetTokenRefresh(H.expires_in);f?this.getAccountTypeAndEndpoint(mxUtils.bind(this,function(){l()}),n):l()};OneDriveClient.prototype.authenticateStep2=function(H,c,f,l,n,r){if(null==window.onOneDriveCallback){var t=mxUtils.bind(this,function(){var x=!0,B=JSON.parse(this.getPersistentToken(!0));null!=B?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="++this.clientId+"&domain="+window.location.host+"&token="+H)+"&scopes="+encodeURIComponent(n?this.scopesSP:this.scopes),null,"GET")).send(mxUtils.bind(this,function(G){if(200<=G.getStatus()&&299>=G.getStatus())try{this.updateAuthInfo(JSON.parse(G.getText()),B.remember,r,mxUtils.bind(this,function(){n?this.authenticate(c,f,l,!1):c()}),f,n)}catch(L){f({message:mxResources.get("authFailed"),retry:t})}else this.clearPersistentToken(),this.setUser(null),b=null,this.sharepointMode&&(k=null),401!=G.getStatus()&&+400!=G.getStatus()||l?f({message:mxResources.get("accessDenied"),retry:t}):t()}),f):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(G,L){var D=this.authUrl+"/oauth2/v2.0/authorize?client_id="+this.clientId+"&response_type=code&prompt=select_account&redirect_uri="+encodeURIComponent(this.redirectUri)+"&scope="+encodeURIComponent((n?this.scopesSP:this.scopes)+(G?" offline_access":""))+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+H);D=window.open(D,+"odauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join());null!=D&&(window.onOneDriveCallback=mxUtils.bind(this,function(T,N){if(x){window.onOneDriveCallback=null;x=!1;try{null==T?f({message:mxResources.get("accessDenied"),retry:t}):(null!=L&&L(),this.updateAuthInfo(T,G,!n,mxUtils.bind(this,function(){n?this.authenticate(c,f,l,!1,+!0):c()}),f,n))}catch(R){f(R)}finally{null!=N&&N.close()}}else null!=N&&N.close()}),D.focus())}),mxUtils.bind(this,function(){x&&(window.onOneDriveCallback=null,x=!1,f({message:mxResources.get("accessDenied"),retry:t}))}))});t()}else f({code:App.ERROR_BUSY})};OneDriveClient.prototype.getAccountTypeAndEndpoint=function(H,c){this.get(this.baseUrl+"/me/drive/root",mxUtils.bind(this,function(f){try{if(200<=f.getStatus()&&299>=f.getStatus()){var l=JSON.parse(f.getText());0<l.webUrl.indexOf(".sharepoint.com")?+this.endpointHint=l.webUrl.replace("/Documents","/_layouts/15/onedrive.aspx"):this.endpointHint=this.defEndpointHint;var n=JSON.parse(this.getPersistentToken(!0));null!=n&&(n.endpointHint=this.endpointHint,this.setPersistentToken(JSON.stringify(n),!n.remember));H();return}}catch(r){}c({message:mxResources.get("unknownError")+" (Code: "+f.getStatus()+")"})}),c)};OneDriveClient.prototype.executeRequest=function(H,c,f){this.sharepointMode&&(b=k);var l=mxUtils.bind(this,function(n){var r=!0,t=window.setTimeout(mxUtils.bind(this,+function(){r=!1;f({code:App.ERROR_TIMEOUT,retry:l})}),this.ui.timeout);this.get(H,mxUtils.bind(this,function(x){window.clearTimeout(t);r&&(200<=x.getStatus()&&299>=x.getStatus()||404==x.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),c(x)):n||401!==x.getStatus()&&400!==x.getStatus()?f(this.parseRequestText(x)):this.authenticate(function(){l(!0)},f,n,this.sharepointMode))}),mxUtils.bind(this,function(x){window.clearTimeout(t);r&&f(x)}))});null==b||6E4>this.tokenExpiresOn-+Date.now()?this.authenticate(function(){l(!0)},f,null,this.sharepointMode):l(!1)};OneDriveClient.prototype.checkToken=function(H,c){this.sharepointMode&&(b=k);null==b||null==this.tokenRefreshThread||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(H,null!=c?c:this.emptyFn,null,this.sharepointMode):H()};OneDriveClient.prototype.getItemRef=function(H){var c=H.split("/");return 1<c.length?{driveId:c[0],id:c[1]}:{id:H}};OneDriveClient.prototype.getItemURL=function(H,c){var f=H.split("/");return 1<+f.length?(H=f[1],(c?"":this.baseUrl)+"/drives/"+f[0]+("root"==H?"/root":"/items/"+H)):(c?"":this.baseUrl)+"/me/drive/items/"+H};OneDriveClient.prototype.getLibrary=function(H,c,f){this.getFile(H,c,f,!1,!0)};OneDriveClient.prototype.removeExtraHtmlContent=function(H){var c=H.lastIndexOf('<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"><meta name="Robots" ');0<c&&(H=H.substring(0,c));return H};OneDriveClient.prototype.getFile=function(H,c,f,l,n){n=null!=n?n:!1;this.executeRequest(this.getItemURL(H),+mxUtils.bind(this,function(r){if(200<=r.getStatus()&&299>=r.getStatus()){var t=JSON.parse(r.getText()),x=/\.png$/i.test(t.name);if(/\.v(dx|sdx?)$/i.test(t.name)||/\.gliffy$/i.test(t.name)||/\.pdf$/i.test(t.name)||!Editor.useCanvasForExport&&x)this.ui.convertFile(t["@microsoft.graph.downloadUrl"],t.name,null!=t.file?t.file.mimeType:null,this.extension,c,f);else{var B=!0,G=window.setTimeout(mxUtils.bind(this,function(){B=!1;f({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.editor.loadUrl(t["@microsoft.graph.downloadUrl"],+mxUtils.bind(this,function(L){try{if(window.clearTimeout(G),B){/\.html$/i.test(t.name)&&(L=this.removeExtraHtmlContent(L));var D=null;if(0<(x?L.lastIndexOf(","):-1)){var T=this.ui.extractGraphModelFromPng(L);null!=T&&0<T.length?L=T:D=new LocalFile(this.ui,L,t.name,!0)}else if("data:image/png;base64,PG14ZmlsZS"==L.substring(0,32)){var N=L.substring(22);L=window.atob&&!mxClient.IS_SF?atob(N):Base64.decode(N)}Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(L,t["@microsoft.graph.downloadUrl"])?+this.ui.parseFileData(L,mxUtils.bind(this,function(R){try{4==R.readyState&&(200<=R.status&&299>=R.status?c(new LocalFile(this.ui,R.responseText,t.name+this.extension,!0)):null!=f&&f({message:mxResources.get("errorLoadingFile")}))}catch(P){if(null!=f)f(P);else throw P;}}),t.name):null!=D?c(D):n?c(new OneDriveLibrary(this.ui,L,t,this.sharepointMode)):c(new OneDriveFile(this.ui,L,t,this.sharepointMode))}}catch(R){if(null!=f)f(R);else throw R;}}),mxUtils.bind(this,function(L){window.clearTimeout(G);B&&f(this.parseRequestText(L))}),x||null!=t.file&&null!=t.file.mimeType&&("image/"==t.file.mimeType.substring(0,6)&&"image/svg"!=t.file.mimeType.substring(0,9)||"application/pdf"==t.file.mimeType))}}else this.isExtAuth?f({message:mxResources.get("fileNotFoundOrDenied"),ownerEmail:null!=window.urlParams?urlParams.ownerEml:null}):f(this.parseRequestText(r))}),function(r){null!=f&&(null!=r&&null!=r.error&&"ObjectHandle is Invalid"===r.error.message&&(r.error.message=mxResources.get("fileNotFoundOrDenied")),-f(r))})};OneDriveClient.prototype.renameFile=function(G,c,f,l){null!=G&&null!=c&&(this.isValidFilename(c)?this.checkExists(G.getParentId(),c,!1,mxUtils.bind(this,function(n){n?this.writeFile(this.getItemURL(G.getId()),JSON.stringify({name:c}),"PATCH","application/json",f,l):l()})):l({message:this.invalidFilenameRegExs[0].test(c)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")}))};OneDriveClient.prototype.moveFile=function(G,c,f,l){c=this.getItemRef(c);var n=-this.getItemRef(G);c.driveId!=n.driveId?l({message:mxResources.get("cannotMoveOneDrive",null,"Moving a file between accounts is not supported yet.")}):this.writeFile(this.getItemURL(G),JSON.stringify({parentReference:c}),"PATCH","application/json",f,l)};OneDriveClient.prototype.insertLibrary=function(G,c,f,l,n){this.insertFile(G,c,f,l,!0,n)};OneDriveClient.prototype.insertFile=function(G,c,f,l,n,r){this.isValidFilename(G)?(n=null!=n?n:!1,this.checkExists(r,G,!0,mxUtils.bind(this,function(t){if(t){t=-"/me/drive/root";null!=r&&(t=this.getItemURL(r,!0));var x=mxUtils.bind(this,function(B){n?f(new OneDriveLibrary(this.ui,c,B,this.sharepointMode)):f(new OneDriveFile(this.ui,c,B,this.sharepointMode))});t=this.baseUrl+t+"/children/"+encodeURIComponent(G)+"/content";4E6<=c.length?this.writeFile(t,"","PUT",null,mxUtils.bind(this,function(B){this.writeLargeFile(this.getItemURL(B.id),c,x,l)}),l):this.writeFile(t,c,"PUT",null,x,l)}else l()}))):l({message:this.invalidFilenameRegExs[0].test(G)?mxResources.get("oneDriveCharsNotAllowed"):-mxResources.get("oneDriveInvalidDeviceName")})};OneDriveClient.prototype.checkExists=function(G,c,f,l){var n="/me/drive/root";null!=G&&(n=this.getItemURL(G,!0));this.executeRequest(this.baseUrl+n+"/children/"+encodeURIComponent(c),mxUtils.bind(this,function(r){404==r.getStatus()?l(!0):f?(this.ui.spinner.stop(),this.ui.confirm(mxResources.get("replaceIt",[c]),function(){l(!0)},function(){l(!1)})):(this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),-function(){l(!1)}))}),function(r){l(!1)},!0)};OneDriveClient.prototype.saveFile=function(G,c,f,l){try{var n=G.getData(),r=mxUtils.bind(this,function(x){var B=mxUtils.bind(this,function(L){c(L,n)}),F=this.getItemURL(G.getId());4E6<=x.length?this.writeLargeFile(F,x,B,f,l):this.writeFile(F+"/content/",x,"PUT",null,B,f,l)});if(Editor.useCanvasForExport&&/(\.png)$/i.test(G.meta.name)){var t=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(x){r(this.ui.base64ToBlob(x,-"image/png"))}),f,this.ui.getCurrentFile()!=G?n:null,t.scale,t.border)}else r(n)}catch(x){f(x)}};OneDriveClient.prototype.writeLargeFile=function(G,c,f,l,n){this.sharepointMode&&(b=k);try{if(null!=c){var r=(new TextEncoder).encode(c).length,t=mxUtils.bind(this,function(B,F,L,D){try{D=D||0;var T=!0,N=null;N=window.setTimeout(mxUtils.bind(this,function(){T=!1;l({code:App.ERROR_TIMEOUT})}),this.ui.timeout);var R=c.substr(F,4194304),P=(new TextEncoder).encode(R).length,U=new mxXmlRequest(B,R,"PUT");U.setRequestHeaders=-mxUtils.bind(this,function(S,z){S.setRequestHeader("Content-Range","bytes "+L+"-"+(L+P-1)+"/"+r)});U.send(mxUtils.bind(this,function(S){window.clearTimeout(N);if(T){var z=S.getStatus();200<=z&&299>=z?(z=F+R.length,z==c.length?f(JSON.parse(S.getText())):t(B,z,L+P,D)):500<=z&&599>=z&&2>D?(D++,t(B,F,L,D)):l(this.parseRequestText(S),S)}}),mxUtils.bind(this,function(S){window.clearTimeout(N);T&&l(this.parseRequestText(S))}))}catch(S){l(S)}}),x=mxUtils.bind(this,function(B){try{var F=!0,L=null;try{L=window.setTimeout(mxUtils.bind(this,-function(){F=!1;l({code:App.ERROR_TIMEOUT})}),this.ui.timeout)}catch(T){}var D=new mxXmlRequest(G+"/createUploadSession","{}","POST");D.setRequestHeaders=mxUtils.bind(this,function(T,N){T.setRequestHeader("Content-Type","application/json");T.setRequestHeader("Authorization","Bearer "+b);null!=n&&T.setRequestHeader("If-Match",n)});D.send(mxUtils.bind(this,function(T){window.clearTimeout(L);F&&(200<=T.getStatus()&&299>=T.getStatus()?(T=JSON.parse(T.getText()),t(T.uploadUrl,0,0)):B||401!==T.getStatus()?-l(this.parseRequestText(T),T):this.authenticate(function(){x(!0)},l,B,this.sharepointMode))}),mxUtils.bind(this,function(T){window.clearTimeout(L);F&&l(this.parseRequestText(T))}))}catch(T){l(T)}});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){x(!0)},l,null,this.sharepointMode):x(!1)}else l({message:mxResources.get("unknownError")})}catch(B){l(B)}};OneDriveClient.prototype.writeFile=function(G,c,f,l,n,r,t){this.sharepointMode&&(b=k);try{if(null!=G&&null!=c){var x=mxUtils.bind(this,-function(B){try{var F=!0,L=null;try{L=window.setTimeout(mxUtils.bind(this,function(){F=!1;r({code:App.ERROR_TIMEOUT})}),this.ui.timeout)}catch(T){}var D=new mxXmlRequest(G,c,f);D.setRequestHeaders=mxUtils.bind(this,function(T,N){T.setRequestHeader("Content-Type",l||" ");T.setRequestHeader("Authorization","Bearer "+b);null!=t&&T.setRequestHeader("If-Match",t)});D.send(mxUtils.bind(this,function(T){window.clearTimeout(L);F&&(200<=T.getStatus()&&299>=T.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,-this.emptyFn,!0),n(JSON.parse(T.getText()))):B||401!==T.getStatus()?r(this.parseRequestText(T),T):this.authenticate(function(){x(!0)},r,B,this.sharepointMode))}),mxUtils.bind(this,function(T){window.clearTimeout(L);F&&r(this.parseRequestText(T))}))}catch(T){r(T)}});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){x(!0)},r,null,this.sharepointMode):x(!1)}else r({message:mxResources.get("unknownError")})}catch(B){r(B)}};OneDriveClient.prototype.parseRequestText=function(G){var c=-{message:mxResources.get("unknownError")};try{c=JSON.parse(G.getText()),c.status=G.getStatus(),c.error&&(c.error.status=c.status,c.error.code=c.status)}catch(f){}return c};OneDriveClient.prototype.pickLibrary=function(G){this.pickFile(function(c){G(c)})};OneDriveClient.prototype.createInlinePicker=function(G,c,f){return mxUtils.bind(this,function(){var l=null,n=document.createElement("div");n.style.position="relative";var r=new CustomDialog(this.ui,n,mxUtils.bind(this,function(){var t=l.getSelectedItem();-if(null!=t)if(c&&"object"==typeof t.folder)G({value:[t]});else{if(!t.folder&&this.ui.spinner.spin(document.body,mxResources.get("loading"))){var x=OneDriveFile.prototype.getIdOf(t);this.executeRequest(this.getItemURL(x),mxUtils.bind(this,function(B){this.ui.spinner.stop();200<=B.getStatus()&&299>=B.getStatus()?(B=JSON.parse(B.getText()),G(x,{value:[B]})):this.ui.handleError({code:B.getStatus()})}),mxUtils.bind(this,function(B){this.ui.spinner.stop();this.ui.handleError(B)}))}}else return mxResources.get("invalidSel",-null,"Invalid selection")}),null,mxResources.get(c?"select":"open"),null,null,null,null,!0);this.ui.showDialog(r.container,550,500,!0,!0);n.style.width=parseInt(r.container.parentNode.style.width)-60+"px";n.style.height=parseInt(r.container.parentNode.style.height)-120+"px";l=new mxODPicker(n,null,mxUtils.bind(this,function(t,x,B,F){this.executeRequest(F?t:this.baseUrl+t,function(L){x(JSON.parse(L.getText()))},B)}),mxUtils.bind(this,function(t,x,B,F){this.executeRequest(this.baseUrl+"/drives/"+x+-"/items/"+t,function(L){B(JSON.parse(L.getText()))},F)}),null,null,function(t){c?G({value:[t]}):G(OneDriveFile.prototype.getIdOf(t))},mxUtils.bind(this,function(t){this.ui.showError(mxResources.get("error"),t)}),c,null,null,null,null,f)})};var J=function(){null!=A&&(clearInterval(A),A=null);if(null!=y){try{window.removeEventListener("message",y)}catch(G){}y=null}if(null!=q){try{q.close&&q.close()}catch(G){}q=null}if(null!=u)try{u.closed||u.close()}catch(G){}u=null},K=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,-function(G){var c=16*Math.random()|0;return("x"===G?c:c&3|8).toString(16)})};OneDriveClient.prototype.createPickerConfig=function(G,c){return{sdk:this.PICKER_SDK_VERSION,entry:{sharePoint:{byPath:{web:c}}},authentication:{},messaging:{origin:location.origin,channelId:K()},typesAndSources:Object.assign({},{mode:G},"files"===G&&{filters:this.FILE_EXTENSIONS},{pivots:{oneDrive:!0,recent:!0,shared:!1,sharedLibraries:!0,myOrganization:!1,site:!0}}),selection:{mode:"single"},theme:Editor.isDarkMode()?"dark":-"default"}};OneDriveClient.prototype.setupPickerMessageListener=function(G,c){if(null!=y){try{window.removeEventListener("message",y)}catch(l){}y=null}var f=function(l){if(l.source&&l.source===u){var n=l.data;"initialize"===n.type&&n.channelId===G&&(q=l.ports[0],q.addEventListener("message",c),q.start(),q.postMessage({type:"activate"}))}};y=f;window.addEventListener("message",f)};var H=function(G,c){var f,l;return $jscomp.asyncExecutePromiseGeneratorProgram(function(n){q.postMessage({type:"acknowledge",-id:G.id});f=G.data;try{switch(f.command){case "authenticate":if(l=m)q.postMessage({type:"result",id:G.id,data:{result:"token",token:l}});else throw Error("Could not get auth token for command: "+JSON.stringify(f));break;case "close":J();break;case "pick":q.postMessage({type:"result",id:G.id,data:{result:"success"}});J();c(f);break;default:console.warn("Unsupported command: "+JSON.stringify(f)),q.postMessage({type:"result",id:G.id,data:{result:"error",error:{code:"unsupportedCommand",message:f.command},-isExpected:!0}})}}catch(r){console.error("Error handling picker command:",r),q.postMessage({type:"result",id:G.id,data:{result:"error",error:{code:"commandError",message:r.message},isExpected:!0}})}n.jumpToEnd()})};OneDriveClient.prototype.handleFolderPickerMessage=function(G){var c,f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress){c=G;f=c.data;switch(f.type){case "command":return l.jumpTo(2)}return l.jumpTo(0)}return 4!=l.nextAddress?l.yield(H(f,function(n){d({value:n.items})}),-4):l.jumpTo(0)})};OneDriveClient.prototype.handleFilePickerMessage=function(G){var c,f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress){c=G;f=c.data;switch(f.type){case "command":return l.jumpTo(2)}return l.jumpTo(0)}return 4!=l.nextAddress?l.yield(H(f,function(n){n=n.items[0];d((null!=n.parentReference&&null!=n.parentReference.driveId?n.parentReference.driveId+"/":"")+(n.id+(n.folder&&n.folder.isRoot?"/root":"")))}),4):l.jumpTo(0)})};OneDriveClient.prototype.pickFile=-function(G,c){this.sharepointMode?this.pickFileSP(G,c):this.pickFileOD(G,c)};OneDriveClient.prototype.pickFolder=function(G,c){var f=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){f.sharepointMode?f.pickFolderSP(G,c):f.pickFolderOD(G,c);l.jumpToEnd()})};OneDriveClient.prototype.pickFileSP=function(G,c){var f;G=null!=(f=G)?f:mxUtils.bind(this,function(l){this.ui.loadFile("M"+encodeURIComponent(l))});this.launchPicker(G,"files")};OneDriveClient.prototype.pickFolderSP=function(G,-c){var f=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){f.launchPicker(G,"folders");l.jumpToEnd()})};OneDriveClient.prototype.launchPicker=function(G,c){var f=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){try{d=G,J(),f.executeRequest(f.baseUrl+"/me/drive",mxUtils.bind(f,function(n){if(200<=n.getStatus()&&299>=n.getStatus()){n=JSON.parse(n.getText()).webUrl;if(null!=n){var r=n.lastIndexOf("/");0<r&&(n=n.substring(0,r))}r=this.createPickerConfig(c,n);var t=+f(r))})};OneDriveClient.prototype.renameFile=function(H,c,f,l){null!=H&&null!=c&&(this.isValidFilename(c)?this.checkExists(H.getParentId(),c,!1,mxUtils.bind(this,function(n){n?this.writeFile(this.getItemURL(H.getId()),JSON.stringify({name:c}),"PATCH","application/json",f,l):l()})):l({message:this.invalidFilenameRegExs[0].test(c)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")}))};OneDriveClient.prototype.moveFile=function(H,c,f,l){c=this.getItemRef(c);var n=+this.getItemRef(H);c.driveId!=n.driveId?l({message:mxResources.get("cannotMoveOneDrive",null,"Moving a file between accounts is not supported yet.")}):this.writeFile(this.getItemURL(H),JSON.stringify({parentReference:c}),"PATCH","application/json",f,l)};OneDriveClient.prototype.insertLibrary=function(H,c,f,l,n){this.insertFile(H,c,f,l,!0,n)};OneDriveClient.prototype.insertFile=function(H,c,f,l,n,r){this.isValidFilename(H)?(n=null!=n?n:!1,this.checkExists(r,H,!0,mxUtils.bind(this,function(t){if(t){t=+"/me/drive/root";null!=r&&(t=this.getItemURL(r,!0));var x=mxUtils.bind(this,function(B){n?f(new OneDriveLibrary(this.ui,c,B,this.sharepointMode)):f(new OneDriveFile(this.ui,c,B,this.sharepointMode))});t=this.baseUrl+t+"/children/"+encodeURIComponent(H)+"/content";4E6<=c.length?this.writeFile(t,"","PUT",null,mxUtils.bind(this,function(B){this.writeLargeFile(this.getItemURL(B.id),c,x,l)}),l):this.writeFile(t,c,"PUT",null,x,l)}else l()}))):l({message:this.invalidFilenameRegExs[0].test(H)?mxResources.get("oneDriveCharsNotAllowed"):+mxResources.get("oneDriveInvalidDeviceName")})};OneDriveClient.prototype.checkExists=function(H,c,f,l){var n="/me/drive/root";null!=H&&(n=this.getItemURL(H,!0));this.executeRequest(this.baseUrl+n+"/children/"+encodeURIComponent(c),mxUtils.bind(this,function(r){404==r.getStatus()?l(!0):f?(this.ui.spinner.stop(),this.ui.confirm(mxResources.get("replaceIt",[c]),function(){l(!0)},function(){l(!1)})):(this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),+function(){l(!1)}))}),function(r){l(!1)},!0)};OneDriveClient.prototype.saveFile=function(H,c,f,l){try{var n=H.getData(),r=mxUtils.bind(this,function(x){var B=mxUtils.bind(this,function(L){c(L,n)}),G=this.getItemURL(H.getId());4E6<=x.length?this.writeLargeFile(G,x,B,f,l):this.writeFile(G+"/content/",x,"PUT",null,B,f,l)});if(Editor.useCanvasForExport&&/(\.png)$/i.test(H.meta.name)){var t=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(x){r(this.ui.base64ToBlob(x,+"image/png"))}),f,this.ui.getCurrentFile()!=H?n:null,t.scale,t.border)}else r(n)}catch(x){f(x)}};OneDriveClient.prototype.writeLargeFile=function(H,c,f,l,n){this.sharepointMode&&(b=k);try{if(null!=c){var r=(new TextEncoder).encode(c).length,t=mxUtils.bind(this,function(B,G,L,D){try{D=D||0;var T=!0,N=null;N=window.setTimeout(mxUtils.bind(this,function(){T=!1;l({code:App.ERROR_TIMEOUT})}),this.ui.timeout);var R=c.substr(G,4194304),P=(new TextEncoder).encode(R).length,U=new mxXmlRequest(B,R,"PUT");U.setRequestHeaders=+mxUtils.bind(this,function(S,z){S.setRequestHeader("Content-Range","bytes "+L+"-"+(L+P-1)+"/"+r)});U.send(mxUtils.bind(this,function(S){window.clearTimeout(N);if(T){var z=S.getStatus();200<=z&&299>=z?(z=G+R.length,z==c.length?f(JSON.parse(S.getText())):t(B,z,L+P,D)):500<=z&&599>=z&&2>D?(D++,t(B,G,L,D)):l(this.parseRequestText(S),S)}}),mxUtils.bind(this,function(S){window.clearTimeout(N);T&&l(this.parseRequestText(S))}))}catch(S){l(S)}}),x=mxUtils.bind(this,function(B){try{var G=!0,L=null;try{L=window.setTimeout(mxUtils.bind(this,+function(){G=!1;l({code:App.ERROR_TIMEOUT})}),this.ui.timeout)}catch(T){}var D=new mxXmlRequest(H+"/createUploadSession","{}","POST");D.setRequestHeaders=mxUtils.bind(this,function(T,N){T.setRequestHeader("Content-Type","application/json");T.setRequestHeader("Authorization","Bearer "+b);null!=n&&T.setRequestHeader("If-Match",n)});D.send(mxUtils.bind(this,function(T){window.clearTimeout(L);G&&(200<=T.getStatus()&&299>=T.getStatus()?(T=JSON.parse(T.getText()),t(T.uploadUrl,0,0)):B||401!==T.getStatus()?+l(this.parseRequestText(T),T):this.authenticate(function(){x(!0)},l,B,this.sharepointMode))}),mxUtils.bind(this,function(T){window.clearTimeout(L);G&&l(this.parseRequestText(T))}))}catch(T){l(T)}});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){x(!0)},l,null,this.sharepointMode):x(!1)}else l({message:mxResources.get("unknownError")})}catch(B){l(B)}};OneDriveClient.prototype.writeFile=function(H,c,f,l,n,r,t){this.sharepointMode&&(b=k);try{if(null!=H&&null!=c){var x=mxUtils.bind(this,+function(B){try{var G=!0,L=null;try{L=window.setTimeout(mxUtils.bind(this,function(){G=!1;r({code:App.ERROR_TIMEOUT})}),this.ui.timeout)}catch(T){}var D=new mxXmlRequest(H,c,f);D.setRequestHeaders=mxUtils.bind(this,function(T,N){T.setRequestHeader("Content-Type",l||" ");T.setRequestHeader("Authorization","Bearer "+b);null!=t&&T.setRequestHeader("If-Match",t)});D.send(mxUtils.bind(this,function(T){window.clearTimeout(L);G&&(200<=T.getStatus()&&299>=T.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,+this.emptyFn,!0),n(JSON.parse(T.getText()))):B||401!==T.getStatus()?r(this.parseRequestText(T),T):this.authenticate(function(){x(!0)},r,B,this.sharepointMode))}),mxUtils.bind(this,function(T){window.clearTimeout(L);G&&r(this.parseRequestText(T))}))}catch(T){r(T)}});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){x(!0)},r,null,this.sharepointMode):x(!1)}else r({message:mxResources.get("unknownError")})}catch(B){r(B)}};OneDriveClient.prototype.parseRequestText=function(H){var c=+{message:mxResources.get("unknownError")};try{c=JSON.parse(H.getText()),c.status=H.getStatus(),c.error&&(c.error.status=c.status,c.error.code=c.status)}catch(f){}return c};OneDriveClient.prototype.pickLibrary=function(H){this.pickFile(function(c){H(c)})};OneDriveClient.prototype.createInlinePicker=function(H,c,f){return mxUtils.bind(this,function(){var l=null,n=document.createElement("div");n.style.position="relative";var r=new CustomDialog(this.ui,n,mxUtils.bind(this,function(){var t=l.getSelectedItem();+if(null!=t)if(c&&"object"==typeof t.folder)H({value:[t]});else{if(!t.folder&&this.ui.spinner.spin(document.body,mxResources.get("loading"))){var x=OneDriveFile.prototype.getIdOf(t);this.executeRequest(this.getItemURL(x),mxUtils.bind(this,function(B){this.ui.spinner.stop();200<=B.getStatus()&&299>=B.getStatus()?(B=JSON.parse(B.getText()),H(x,{value:[B]})):this.ui.handleError({code:B.getStatus()})}),mxUtils.bind(this,function(B){this.ui.spinner.stop();this.ui.handleError(B)}))}}else return mxResources.get("invalidSel",+null,"Invalid selection")}),null,mxResources.get(c?"select":"open"),null,null,null,null,!0);this.ui.showDialog(r.container,550,500,!0,!0);n.style.width=parseInt(r.container.parentNode.style.width)-60+"px";n.style.height=parseInt(r.container.parentNode.style.height)-120+"px";l=new mxODPicker(n,null,mxUtils.bind(this,function(t,x,B,G){this.executeRequest(G?t:this.baseUrl+t,function(L){x(JSON.parse(L.getText()))},B)}),mxUtils.bind(this,function(t,x,B,G){this.executeRequest(this.baseUrl+"/drives/"+x++"/items/"+t,function(L){B(JSON.parse(L.getText()))},G)}),null,null,function(t){c?H({value:[t]}):H(OneDriveFile.prototype.getIdOf(t))},mxUtils.bind(this,function(t){this.ui.showError(mxResources.get("error"),t)}),c,null,null,null,null,f)})};var J=function(){null!=A&&(clearInterval(A),A=null);if(null!=y){try{window.removeEventListener("message",y)}catch(H){}y=null}if(null!=q){try{q.close&&q.close()}catch(H){}q=null}if(null!=u)try{u.closed||u.close()}catch(H){}u=null},K=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,+function(H){var c=16*Math.random()|0;return("x"===H?c:c&3|8).toString(16)})};OneDriveClient.prototype.createPickerConfig=function(H,c){return{sdk:this.PICKER_SDK_VERSION,entry:{sharePoint:{byPath:{web:c}}},authentication:{},messaging:{origin:location.origin,channelId:K()},typesAndSources:Object.assign({},{mode:H},"files"===H&&{filters:this.FILE_EXTENSIONS},{pivots:{oneDrive:!0,recent:!0,shared:!1,sharedLibraries:!0,myOrganization:!1,site:!0}}),selection:{mode:"single"},theme:Editor.isDarkMode()?"dark":+"default"}};OneDriveClient.prototype.setupPickerMessageListener=function(H,c){if(null!=y){try{window.removeEventListener("message",y)}catch(l){}y=null}var f=function(l){if(l.source&&l.source===u){var n=l.data;"initialize"===n.type&&n.channelId===H&&(q=l.ports[0],q.addEventListener("message",c),q.start(),q.postMessage({type:"activate"}))}};y=f;window.addEventListener("message",f)};var F=function(H,c){var f,l;return $jscomp.asyncExecutePromiseGeneratorProgram(function(n){q.postMessage({type:"acknowledge",+id:H.id});f=H.data;try{switch(f.command){case "authenticate":if(l=m)q.postMessage({type:"result",id:H.id,data:{result:"token",token:l}});else throw Error("Could not get auth token for command: "+JSON.stringify(f));break;case "close":J();break;case "pick":q.postMessage({type:"result",id:H.id,data:{result:"success"}});J();c(f);break;default:console.warn("Unsupported command: "+JSON.stringify(f)),q.postMessage({type:"result",id:H.id,data:{result:"error",error:{code:"unsupportedCommand",message:f.command},+isExpected:!0}})}}catch(r){console.error("Error handling picker command:",r),q.postMessage({type:"result",id:H.id,data:{result:"error",error:{code:"commandError",message:r.message},isExpected:!0}})}n.jumpToEnd()})};OneDriveClient.prototype.handleFolderPickerMessage=function(H){var c,f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress){c=H;f=c.data;switch(f.type){case "command":return l.jumpTo(2)}return l.jumpTo(0)}return 4!=l.nextAddress?l.yield(F(f,function(n){d({value:n.items})}),+4):l.jumpTo(0)})};OneDriveClient.prototype.handleFilePickerMessage=function(H){var c,f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress){c=H;f=c.data;switch(f.type){case "command":return l.jumpTo(2)}return l.jumpTo(0)}return 4!=l.nextAddress?l.yield(F(f,function(n){n=n.items[0];d((null!=n.parentReference&&null!=n.parentReference.driveId?n.parentReference.driveId+"/":"")+(n.id+(n.folder&&n.folder.isRoot?"/root":"")))}),4):l.jumpTo(0)})};OneDriveClient.prototype.pickFile=+function(H,c){this.sharepointMode?this.pickFileSP(H,c):this.pickFileOD(H,c)};OneDriveClient.prototype.pickFolder=function(H,c){var f=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){f.sharepointMode?f.pickFolderSP(H,c):f.pickFolderOD(H,c);l.jumpToEnd()})};OneDriveClient.prototype.pickFileSP=function(H,c){var f;H=null!=(f=H)?f:mxUtils.bind(this,function(l){this.ui.loadFile("M"+encodeURIComponent(l))});this.launchPicker(H,"files")};OneDriveClient.prototype.pickFolderSP=function(H,+c){var f=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){f.launchPicker(H,"folders");l.jumpToEnd()})};OneDriveClient.prototype.launchPicker=function(H,c){var f=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){try{d=H,J(),f.executeRequest(f.baseUrl+"/me/drive",mxUtils.bind(f,function(n){if(200<=n.getStatus()&&299>=n.getStatus()){n=JSON.parse(n.getText()).webUrl;if(null!=n){var r=n.lastIndexOf("/");0<r&&(n=n.substring(0,r))}r=this.createPickerConfig(c,n);var t=new URLSearchParams({filePicker:JSON.stringify(r)});u=window.open("","SharePointPicker","width=1080,height=680,left="+(screen.width-1080)/2+",top="+(screen.height-680)/2+",menubar=no,toolbar=no,location=no,status=no");null==u?(this.ui.showError(mxResources.get("error"),"Popup blocked. Please allow popups for this site."),J()):(n=n+"/_layouts/15/FilePicker.aspx?"+t,this.setupPickerMessageListener(r.messaging.channelId,"files"===c?this.handleFilePickerMessage:this.handleFolderPickerMessage),u.location.href=-n,A=setInterval(function(){(null==u||u.closed)&&J()},500))}else this.ui.handleError({code:n.getStatus()})}),mxUtils.bind(f,function(n){this.ui.handleError(n)}))}catch(n){J(),f.ui.showError(mxResources.get("error"),n&&n.message?n.message:n)}l.jumpToEnd()})};OneDriveClient.prototype.pickFolderOD=function(G,c){var f=mxUtils.bind(this,function(n){this.ui.showError(mxResources.get("error"),n&&n.message?n.message:n)}),l=mxUtils.bind(this,function(n){var r=this.inlinePicker?this.createInlinePicker(G,!0):-mxUtils.bind(this,function(){OneDrive.save({clientId:this.clientId,action:"query",openInNewWindow:!0,advanced:{endpointHint:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:b,isConsumerAccount:!1},success:mxUtils.bind(this,function(t){G(t)}),cancel:mxUtils.bind(this,function(){}),error:f})});n?r():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){G({value:[this.rootId]})}),r,mxResources.get("yes"),mxResources.get("noPickFolder")+-"...",!0);null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){l(this.inlinePicker&&c)}),f):l(c)};OneDriveClient.prototype.pickFileOD=function(G,c){G=null!=G?G:mxUtils.bind(this,function(n){this.ui.loadFile("W"+encodeURIComponent(n))});var f=mxUtils.bind(this,function(n){this.ui.showError(mxResources.get("authFailed"),n&&n.message?n.message:n)}),l=this.inlinePicker?this.createInlinePicker(G,null,-c):mxUtils.bind(this,function(){OneDrive.open({clientId:this.clientId,action:"query",multiSelect:!1,advanced:{endpointHint:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference,webUrl",accessToken:b,isConsumerAccount:!1},success:mxUtils.bind(this,function(n){null!=n&&null!=n.value&&0<n.value.length&&G(OneDriveFile.prototype.getIdOf(n.value[0]),n)}),cancel:mxUtils.bind(this,function(){}),error:f});null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,-!0)});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){this.inlinePicker?l():this.ui.showDialog((new BtnDialog(this.ui,this,mxResources.get("open"),mxUtils.bind(this,function(){this.ui.hideDialog();l()}))).container,300,140,!0,!0)}),f):l()};OneDriveClient.prototype.logout=function(){if(isLocalStorage){var G=localStorage.getItem("odpickerv7cache");null!=G&&'{"odsdkLoginHint":{'==G.substring(0,19)&&localStorage.removeItem("odpickerv7cache")}window.open(this.authUrl++n,A=setInterval(function(){(null==u||u.closed)&&J()},500))}else this.ui.handleError({code:n.getStatus()})}),mxUtils.bind(f,function(n){this.ui.handleError(n)}))}catch(n){J(),f.ui.showError(mxResources.get("error"),n&&n.message?n.message:n)}l.jumpToEnd()})};OneDriveClient.prototype.pickFolderOD=function(H,c){var f=mxUtils.bind(this,function(n){this.ui.showError(mxResources.get("error"),n&&n.message?n.message:n)}),l=mxUtils.bind(this,function(n){var r=this.inlinePicker?this.createInlinePicker(H,!0):+mxUtils.bind(this,function(){OneDrive.save({clientId:this.clientId,action:"query",openInNewWindow:!0,advanced:{endpointHint:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:b,isConsumerAccount:!1},success:mxUtils.bind(this,function(t){H(t)}),cancel:mxUtils.bind(this,function(){}),error:f})});n?r():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){H({value:[this.rootId]})}),r,mxResources.get("yes"),mxResources.get("noPickFolder")++"...",!0);null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){l(this.inlinePicker&&c)}),f):l(c)};OneDriveClient.prototype.pickFileOD=function(H,c){H=null!=H?H:mxUtils.bind(this,function(n){this.ui.loadFile("W"+encodeURIComponent(n))});var f=mxUtils.bind(this,function(n){this.ui.showError(mxResources.get("authFailed"),n&&n.message?n.message:n)}),l=this.inlinePicker?this.createInlinePicker(H,null,+c):mxUtils.bind(this,function(){OneDrive.open({clientId:this.clientId,action:"query",multiSelect:!1,advanced:{endpointHint:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference,webUrl",accessToken:b,isConsumerAccount:!1},success:mxUtils.bind(this,function(n){null!=n&&null!=n.value&&0<n.value.length&&H(OneDriveFile.prototype.getIdOf(n.value[0]),n)}),cancel:mxUtils.bind(this,function(){}),error:f});null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,+!0)});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){this.inlinePicker?l():this.ui.showDialog((new BtnDialog(this.ui,this,mxResources.get("open"),mxUtils.bind(this,function(){this.ui.hideDialog();l()}))).container,300,140,!0,!0)}),f):l()};OneDriveClient.prototype.logout=function(){if(isLocalStorage){var H=localStorage.getItem("odpickerv7cache");null!=H&&'{"odsdkLoginHint":{'==H.substring(0,19)&&localStorage.removeItem("odpickerv7cache")}window.open(this.authUrl+"/oauth2/v2.0/logout","logout","width=525,height=525,status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes");this.ui.editor.loadUrl(this.redirectUri+"?doLogout=1&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host));this.clearPersistentToken();this.setUser(null);b=null;this.sharepointMode&&(k=m=null)}})();GitHubFile=function(b,k,m){DrawioFile.call(this,b,k);this.meta=m;this.peer=this.ui.gitHub};mxUtils.extend(GitHubFile,DrawioFile);GitHubFile.prototype.share=function(){this.ui.editor.graph.openLink("https://github.com/"+encodeURIComponent(this.meta.org)+"/"+encodeURIComponent(this.meta.repo)+"/settings/access")};GitHubFile.prototype.getId=function(){return encodeURIComponent(this.meta.org)+"/"+(null!=this.meta.repo?encodeURIComponent(this.meta.repo)+"/"+(null!=this.meta.ref?this.meta.ref+(null!=this.meta.path?"/"+this.meta.path:""):""):"")};GitHubFile.prototype.getHash=function(){return encodeURIComponent("H"+this.getId())};GitHubFile.prototype.getFileUrl=function(){return"https://github.com/"+encodeURIComponent(this.meta.org)+"/"+encodeURIComponent(this.meta.repo)+"/blob/"+this.meta.ref+"/"+this.meta.path};GitHubFile.prototype.getFolderUrl=function(){return"https://github.com/"+encodeURIComponent(this.meta.org)+"/"+encodeURIComponent(this.meta.repo)+"/tree/"+this.meta.ref+"/"+this.meta.path.split("/").slice(0,-1).join("/")};GitHubFile.prototype.getPublicUrl=function(b){if(null!=this.meta.download_url)try{""!=(new URL(this.meta.download_url)).search?b(null):mxUtils.get(this.meta.download_url,mxUtils.bind(this,function(k){b(200<=k.getStatus()&&299>=k.getStatus()?this.meta.download_url:null)}),mxUtils.bind(this,function(){b(null)}))}catch(k){b(null)}else b(null)};GitHubFile.prototype.isConflict=function(b){return null!=b&&409==b.status};GitHubFile.prototype.getMode=function(){return App.MODE_GITHUB};GitHubFile.prototype.isAutosave=function(){return!1};GitHubFile.prototype.getTitle=function(){return this.meta.name};GitHubFile.prototype.isRenamable=function(){return!1};GitHubFile.prototype.getLatestVersion=function(b,k){this.peer.getFile(this.getId(),b,k)};GitHubFile.prototype.getDescriptor=function(){return this.meta};GitHubFile.prototype.setDescriptor=function(b){this.meta=b};GitHubFile.prototype.getDescriptorEtag=function(b){return b.sha};GitHubFile.prototype.setDescriptorEtag=function(b,k){b.sha=k};GitHubFile.prototype.save=function(b,k,m,d,q,u){this.doSave(this.getTitle(),k,m,d,q,u)};GitHubFile.prototype.saveAs=function(b,k,m){this.doSave(b,k,m)};GitHubFile.prototype.doSave=function(b,k,m,d,q,u){var y=this.meta.name;this.meta.name=b;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=y;this.saveFile(b,!1,k,m,d,q,u)}),m,d,q])};-GitHubFile.prototype.saveFile=function(b,k,m,d,q,u,y){if(this.isEditable())if(this.savingFile)null!=d&&d({code:App.ERROR_BUSY});else{var A=mxUtils.bind(this,function(J){if(this.getTitle()==b)try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var K=this.getCurrentEtag(),H=this.data;this.peer.saveFile(this,mxUtils.bind(this,function(G){this.setModified(this.getShadowModified());this.savingFile=!1;this.setDescriptorEtag(this.meta,G);this.fileSaved(H,K,mxUtils.bind(this,function(){this.contentChanged();-null!=m&&m()}),d)}),mxUtils.bind(this,function(G){this.savingFile=!1;this.isConflict(G)?(this.inConflictState=!0,null!=d&&(G.commitMessage=J,d(G))):null!=d&&d(G)}),u,J)}catch(G){if(this.savingFile=!1,null!=d)d(G);else throw G;}else this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.ui.pickFolder(this.getMode(),mxUtils.bind(this,function(G){this.peer.insertFile(b,this.getData(),mxUtils.bind(this,function(c){this.setModified(this.getShadowModified());this.savingFile=!1;-null!=m&&m();this.ui.fileLoaded(c)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}),!1,G,J)}))});null!=y?A(y):this.peer.showCommitDialog(this.meta.name,null==this.getDescriptorEtag(this.meta)||this.meta.isNew,mxUtils.bind(this,function(J){A(J)}),d)}else null!=m&&m()};GitHubLibrary=function(b,k,m){GitHubFile.call(this,b,k,m)};mxUtils.extend(GitHubLibrary,GitHubFile);GitHubLibrary.prototype.doSave=function(b,k,m){this.saveFile(b,!1,k,m)};GitHubLibrary.prototype.open=function(){};(function(){var b=null;window.GitHubClient=function(k,m){DrawioClient.call(this,k,m||"ghauth")};mxUtils.extend(GitHubClient,DrawioClient);GitHubClient.prototype.clientId="test.draw.io"==window.location.hostname?"Iv1.1218f5567fbc258a":window.DRAWIO_GITHUB_ID;GitHubClient.prototype.extension=".drawio";GitHubClient.prototype.baseUrl=DRAWIO_GITHUB_API_URL;GitHubClient.prototype.baseHostUrl=DRAWIO_GITHUB_URL;GitHubClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+"github2";GitHubClient.prototype.maxFileSize=+GitHubFile.prototype.saveFile=function(b,k,m,d,q,u,y){if(this.isEditable())if(this.savingFile)null!=d&&d({code:App.ERROR_BUSY});else{var A=mxUtils.bind(this,function(J){if(this.getTitle()==b)try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var K=this.getCurrentEtag(),F=this.data;this.peer.saveFile(this,mxUtils.bind(this,function(H){this.setModified(this.getShadowModified());this.savingFile=!1;this.setDescriptorEtag(this.meta,H);this.fileSaved(F,K,mxUtils.bind(this,function(){this.contentChanged();+null!=m&&m()}),d)}),mxUtils.bind(this,function(H){this.savingFile=!1;this.isConflict(H)?(this.inConflictState=!0,null!=d&&(H.commitMessage=J,d(H))):null!=d&&d(H)}),u,J)}catch(H){if(this.savingFile=!1,null!=d)d(H);else throw H;}else this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.ui.pickFolder(this.getMode(),mxUtils.bind(this,function(H){this.peer.insertFile(b,this.getData(),mxUtils.bind(this,function(c){this.setModified(this.getShadowModified());this.savingFile=!1;+null!=m&&m();this.ui.fileLoaded(c)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}),!1,H,J)}))});null!=y?A(y):this.peer.showCommitDialog(this.meta.name,null==this.getDescriptorEtag(this.meta)||this.meta.isNew,mxUtils.bind(this,function(J){A(J)}),d)}else null!=m&&m()};GitHubLibrary=function(b,k,m){GitHubFile.call(this,b,k,m)};mxUtils.extend(GitHubLibrary,GitHubFile);GitHubLibrary.prototype.doSave=function(b,k,m){this.saveFile(b,!1,k,m)};GitHubLibrary.prototype.open=function(){};(function(){var b=null;window.GitHubClient=function(k,m){DrawioClient.call(this,k,m||"ghauth")};mxUtils.extend(GitHubClient,DrawioClient);GitHubClient.prototype.clientId="test.draw.io"==window.location.hostname?"Iv1.1218f5567fbc258a":window.DRAWIO_GITHUB_ID;GitHubClient.prototype.extension=".drawio";GitHubClient.prototype.baseUrl=DRAWIO_GITHUB_API_URL;GitHubClient.prototype.baseHostUrl=DRAWIO_GITHUB_URL;GitHubClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+"github2";GitHubClient.prototype.maxFileSize=5E7;GitHubClient.prototype.authToken="token";GitHubClient.prototype.setToken=function(k){b=k};GitHubClient.prototype.updateUser=function(k,m,d){var q=!0,u=window.setTimeout(mxUtils.bind(this,function(){q=!1;m({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),y=new mxXmlRequest(this.baseUrl+"/user",null,"GET"),A=this.authToken+" "+b;y.setRequestHeaders=function(J,K){J.setRequestHeader("Authorization",A)};y.send(mxUtils.bind(this,function(){window.clearTimeout(u);q&&(401===y.getStatus()?d?m({code:y.getStatus(),message:this.getErrorMessage(y,mxResources.get("accessDenied"))}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(k,m,!0)}),m)):200>y.getStatus()||300<=y.getStatus()?m({message:mxResources.get("accessDenied")}):(this.setUser(this.createUser(JSON.parse(y.getText()))),k()))}),m)};GitHubClient.prototype.createUser=function(k){return new DrawioUser(k.id,k.email,k.name)};GitHubClient.prototype.authenticate=function(k,m){(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(d){200<=d.getStatus()&&299>=d.getStatus()?this.authenticateStep2(d.getText(),k,m):null!=m&&m(d)}),m)};GitHubClient.prototype.authenticateStep2=function(k,m,d){if(null==window.onGitHubCallback){var q=mxUtils.bind(this,function(){var u=!0;null!=this.getPersistentToken(!0)?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k),null,"GET")).send(mxUtils.bind(this,function(y){if(200<=y.getStatus()&&299>=y.getStatus())try{b=JSON.parse(y.getText()).access_token,this.setUser(null),m()}catch(A){d({message:mxResources.get("authFailed"),retry:q})}else this.clearPersistentToken(),this.setUser(null),b=null,401==y.getStatus()?q():d({message:mxResources.get("accessDenied"),retry:q})}),d):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(y,A){null!=window.open(this.baseHostUrl+"/login/oauth/authorize?client_id="+this.clientId+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k),"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(J,K){u?(window.onGitHubCallback=null,u=!1,null==J?d({message:mxResources.get("accessDenied"),retry:q}):(null!=A&&A(),b=J.access_token,this.setUser(null),y&&this.setPersistentToken("remembered"),m(),null!=K&&K.close())):null!=K&&K.close()}):d({message:mxResources.get("serviceUnavailableOrBlocked"),retry:q})}),mxUtils.bind(this,function(){u&&(window.onGitHubCallback=null,u=!1,d({message:mxResources.get("accessDenied"),retry:q}))}))});q()}else d({code:App.ERROR_BUSY})};GitHubClient.prototype.getErrorMessage=function(k,m){try{var d=JSON.parse(k.getText());null!=d&&null!=d.message&&(m=d.message)}catch(q){}return m};GitHubClient.prototype.showAuthorizeDialog=function(k,m){this.ui.showError(mxResources.get("accessDenied"),mxResources.get("authorizationRequired"),mxResources.get("help"),mxUtils.bind(this,function(){this.ui.openLink("https://www.drawio.com/blog/single-repository-diagrams")}),k,mxResources.get("authorize"),-mxUtils.bind(this,function(){this.ui.openLink("test.draw.io"==window.location.hostname?"https://github.com/apps/diagrams-net-app-test":"https://github.com/apps/draw-io-app")}),mxResources.get("cancel"),m,480,null,!1)};GitHubClient.prototype.executeRequest=function(k,m,d,q,u){var y=mxUtils.bind(this,function(J){var K=!0,H=window.setTimeout(mxUtils.bind(this,function(){K=!1;d({code:App.ERROR_TIMEOUT,retry:A})}),this.ui.timeout),G=this.authToken+" "+b;k.setRequestHeaders=function(c,f){c.setRequestHeader("Authorization",-G)};k.send(mxUtils.bind(this,function(){window.clearTimeout(H);var c=mxUtils.bind(this,function(){var n=this.ui.spinner.pause();this.showAuthorizeDialog(mxUtils.bind(this,function(){n();A()}),mxUtils.bind(this,function(){this.ui.hideDialog();d({name:"AbortError"})}))});if(K)if(200<=k.getStatus()&&299>=k.getStatus()||q&&404==k.getStatus())m(k);else if(401===k.getStatus())J?d({code:k.getStatus(),message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){A(!0)},+mxUtils.bind(this,function(){this.ui.openLink("test.draw.io"==window.location.hostname?"https://github.com/apps/diagrams-net-app-test":"https://github.com/apps/draw-io-app")}),mxResources.get("cancel"),m,480,null,!1)};GitHubClient.prototype.executeRequest=function(k,m,d,q,u){var y=mxUtils.bind(this,function(J){var K=!0,F=window.setTimeout(mxUtils.bind(this,function(){K=!1;d({code:App.ERROR_TIMEOUT,retry:A})}),this.ui.timeout),H=this.authToken+" "+b;k.setRequestHeaders=function(c,f){c.setRequestHeader("Authorization",+H)};k.send(mxUtils.bind(this,function(){window.clearTimeout(F);var c=mxUtils.bind(this,function(){var n=this.ui.spinner.pause();this.showAuthorizeDialog(mxUtils.bind(this,function(){n();A()}),mxUtils.bind(this,function(){this.ui.hideDialog();d({name:"AbortError"})}))});if(K)if(200<=k.getStatus()&&299>=k.getStatus()||q&&404==k.getStatus())m(k);else if(401===k.getStatus())J?d({code:k.getStatus(),message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){A(!0)},d)})}):this.authenticate(function(){y(!0)},d);else if(403===k.getStatus()){var f=!1;try{var l=JSON.parse(k.getText());null!=l&&"Resource not accessible by integration"==l.message?c():(null!=l&&null!=l.errors&&0<l.errors.length&&(f="too_large"==l.errors[0].code),d({message:mxResources.get(f?"drawingTooLarge":"forbidden")}))}catch(n){d({message:mxResources.get(f?"drawingTooLarge":"forbidden")})}}else 404===k.getStatus()?u?d({code:k.getStatus(),message:this.getErrorMessage(k,mxResources.get("fileNotFound"))}):-c():409===k.getStatus()?d({code:k.getStatus(),status:409}):d({code:k.getStatus(),message:this.getErrorMessage(k,mxResources.get("error")+" "+k.getStatus())})}),mxUtils.bind(this,function(c){window.clearTimeout(H);K&&d(c)}))}),A=mxUtils.bind(this,function(J){null==this.user?this.updateUser(function(){A(!0)},d,J):y(J)});null==b?this.authenticate(function(){A(!0)},d):A(!1)};GitHubClient.prototype.getLibrary=function(k,m,d){this.getFile(k,m,d,!0)};GitHubClient.prototype.getSha=function(k,m,d,q,u,y,A){var J=-"&t="+(new Date).getTime();k=new mxXmlRequest(this.baseUrl+"/repos/"+k+"/"+m+"/contents/"+d+"?ref="+q+J,null,"HEAD");this.executeRequest(k,mxUtils.bind(this,function(K){try{u(K.request.getResponseHeader("Etag").match(/"([^"]+)"/)[1])}catch(H){y(H)}}),y,null,A)};GitHubClient.prototype.getFile=function(k,m,d,q,u){q=null!=q?q:!1;var y=k.split("/"),A=y[0],J=y[1],K=y[2];k=y.slice(3,y.length).join("/");y=/\.png$/i.test(k);if(!u&&(/\.v(dx|sdx?)$/i.test(k)||/\.gliffy$/i.test(k)||/\.pdf$/i.test(k)||!Editor.useCanvasForExport&&-y))if(null!=b){u=this.baseUrl+"/repos/"+A+"/"+J+"/contents/"+k+"?ref="+K;var H={Authorization:"token "+b};y=k.split("/");this.ui.convertFile(u,0<y.length?y[y.length-1]:k,null,this.extension,m,d,null,H)}else d({message:mxResources.get("accessDenied")});else y="&t="+(new Date).getTime(),k=new mxXmlRequest(this.baseUrl+"/repos/"+A+"/"+J+"/contents/"+k+"?ref="+K+y,null,"GET"),this.executeRequest(k,mxUtils.bind(this,function(G){try{var c=JSON.parse(G.getText());if(""==c.content&&null!=c.git_url){var f=+c():409===k.getStatus()?d({code:k.getStatus(),status:409}):d({code:k.getStatus(),message:this.getErrorMessage(k,mxResources.get("error")+" "+k.getStatus())})}),mxUtils.bind(this,function(c){window.clearTimeout(F);K&&d(c)}))}),A=mxUtils.bind(this,function(J){null==this.user?this.updateUser(function(){A(!0)},d,J):y(J)});null==b?this.authenticate(function(){A(!0)},d):A(!1)};GitHubClient.prototype.getLibrary=function(k,m,d){this.getFile(k,m,d,!0)};GitHubClient.prototype.getSha=function(k,m,d,q,u,y,A){var J=+"&t="+(new Date).getTime();k=new mxXmlRequest(this.baseUrl+"/repos/"+k+"/"+m+"/contents/"+d+"?ref="+q+J,null,"HEAD");this.executeRequest(k,mxUtils.bind(this,function(K){try{u(K.request.getResponseHeader("Etag").match(/"([^"]+)"/)[1])}catch(F){y(F)}}),y,null,A)};GitHubClient.prototype.getFile=function(k,m,d,q,u){q=null!=q?q:!1;var y=k.split("/"),A=y[0],J=y[1],K=y[2];k=y.slice(3,y.length).join("/");y=/\.png$/i.test(k);if(!u&&(/\.v(dx|sdx?)$/i.test(k)||/\.gliffy$/i.test(k)||/\.pdf$/i.test(k)||!Editor.useCanvasForExport&&+y))if(null!=b){u=this.baseUrl+"/repos/"+A+"/"+J+"/contents/"+k+"?ref="+K;var F={Authorization:"token "+b};y=k.split("/");this.ui.convertFile(u,0<y.length?y[y.length-1]:k,null,this.extension,m,d,null,F)}else d({message:mxResources.get("accessDenied")});else y="&t="+(new Date).getTime(),k=new mxXmlRequest(this.baseUrl+"/repos/"+A+"/"+J+"/contents/"+k+"?ref="+K+y,null,"GET"),this.executeRequest(k,mxUtils.bind(this,function(H){try{var c=JSON.parse(H.getText());if(""==c.content&&null!=c.git_url){var f=new mxXmlRequest(c.git_url,null,"GET");this.executeRequest(f,mxUtils.bind(this,function(l){l=JSON.parse(l.getText());""!=l.content?(c.content=l.content,c.encoding=l.encoding,m(this.createGitHubFile(A,J,K,c,q))):d({message:mxResources.get("errorLoadingFile")})}),d)}else m(this.createGitHubFile(A,J,K,c,q))}catch(l){d(l)}}),d)};GitHubClient.prototype.createGitHubFile=function(k,m,d,q,u){k={org:k,repo:m,ref:d,name:q.name,path:q.path,sha:q.sha,html_url:q.html_url,download_url:q.download_url};m=q.content;"base64"===q.encoding&&(/\.jpe?g$/i.test(q.name)?m="data:image/jpeg;base64,"+m:/\.gif$/i.test(q.name)?m="data:image/gif;base64,"+m:/\.png$/i.test(q.name)?(q=this.ui.extractGraphModelFromPng(m),m=null!=q&&0<q.length?q:"data:image/png;base64,"+m):m=Base64.decode(m));return u?new GitHubLibrary(this.ui,m,k):new GitHubFile(this.ui,m,k)};GitHubClient.prototype.insertLibrary=function(k,m,d,q,u){this.insertFile(k,m,d,q,!0,u,!1)};GitHubClient.prototype.insertFile=function(k,m,d,q,u,y,A){u=null!=u?u:!1;y=y.split("/");-var J=y[0],K=y[1],H=y[2],G=y.slice(3,y.length).join("/");0<G.length&&(G+="/");G+=k;this.checkExists(J+"/"+K+"/"+H+"/"+G,!0,mxUtils.bind(this,function(c,f){c?u?(A||(m=Base64.encode(m)),this.showCommitDialog(k,!0,mxUtils.bind(this,function(l){this.writeFile(J,K,H,G,l,m,f,mxUtils.bind(this,function(n){try{var r=JSON.parse(n.getText());d(this.createGitHubFile(J,K,H,r.content,u))}catch(t){q(t)}}),q)}),q)):d(new GitHubFile(this.ui,m,{org:J,repo:K,ref:H,name:k,path:G,sha:f,isNew:!0})):q()}))};GitHubClient.prototype.showCommitDialog=+var J=y[0],K=y[1],F=y[2],H=y.slice(3,y.length).join("/");0<H.length&&(H+="/");H+=k;this.checkExists(J+"/"+K+"/"+F+"/"+H,!0,mxUtils.bind(this,function(c,f){c?u?(A||(m=Base64.encode(m)),this.showCommitDialog(k,!0,mxUtils.bind(this,function(l){this.writeFile(J,K,F,H,l,m,f,mxUtils.bind(this,function(n){try{var r=JSON.parse(n.getText());d(this.createGitHubFile(J,K,F,r.content,u))}catch(t){q(t)}}),q)}),q)):d(new GitHubFile(this.ui,m,{org:J,repo:K,ref:F,name:k,path:H,sha:f,isNew:!0})):q()}))};GitHubClient.prototype.showCommitDialog=function(k,m,d,q){var u=this.ui.spinner.pause();k=new FilenameDialog(this.ui,mxResources.get(m?"addedFile":"updateFile",[k]),mxResources.get("ok"),mxUtils.bind(this,function(y){u(function(){d(y)})}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){q()}));this.ui.showDialog(k.container,400,80,!0,!1);k.init()};GitHubClient.prototype.writeFile=function(k,m,d,q,u,y,A,J,K){y.length>=this.maxFileSize?K({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(y.length)+-" / 1 MB)"}):(d={path:q,branch:decodeURIComponent(d),message:u,content:y},null!=A&&(d.sha=A),k=new mxXmlRequest(this.baseUrl+"/repos/"+k+"/"+m+"/contents/"+q,JSON.stringify(d),"PUT"),this.executeRequest(k,mxUtils.bind(this,function(H){J(H)}),mxUtils.bind(this,function(H){404==H.code&&(H.helpLink=this.baseHostUrl+"/settings/connections/applications/"+this.clientId,H.code=null);K(H)})))};GitHubClient.prototype.checkExists=function(k,m,d){var q=k.split("/"),u=q[0],y=q[1],A=q[2];k=q.slice(3,q.length).join("/");-this.getSha(u,y,k,A,mxUtils.bind(this,function(J){if(m){var K=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[k]),function(){K();d(!0,J)},function(){K();d(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){d(!1)})}),mxUtils.bind(this,function(J){d(!0)}),!0)};GitHubClient.prototype.saveFile=function(k,m,d,q,u){var y=k.meta.org,A=k.meta.repo,J=k.meta.ref,K=k.meta.path,H=mxUtils.bind(this,function(c,-f){this.writeFile(y,A,J,K,u,f,c,mxUtils.bind(this,function(l){delete k.meta.isNew;m(JSON.parse(l.getText()).content.sha)}),mxUtils.bind(this,function(l){d(l)}))}),G=mxUtils.bind(this,function(){if(Editor.useCanvasForExport&&/(\.png)$/i.test(K)){var c=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(f){H(k.meta.sha,f)}),d,this.ui.getCurrentFile()!=k?k.getData():null,c.scale,c.border)}else H(k.meta.sha,Base64.encode(k.getData()))});q?this.getSha(y,A,K,-J,mxUtils.bind(this,function(c){k.meta.sha=c;G()}),d):G()};GitHubClient.prototype.pickLibrary=function(k){this.pickFile(k)};GitHubClient.prototype.pickFolder=function(k){this.showGitHubDialog(!1,k,!0)};GitHubClient.prototype.pickFile=function(k){k=null!=k?k:mxUtils.bind(this,function(m){this.ui.loadFile("H"+encodeURIComponent(m))});this.showGitHubDialog(!0,k)};GitHubClient.prototype.showGitHubDialog=function(k,m,d){var q=null,u=null,y=null,A=null,J=document.createElement("div");J.style.whiteSpace=-"nowrap";J.style.overflow="hidden";J.style.height="320px";var K=document.createElement("h3");mxUtils.write(K,mxResources.get(k?"selectFile":"selectFolder"));J.appendChild(K);K=this.ui.createToolbarButton(Editor.refreshImage,mxResources.get("refresh"),mxUtils.bind(this,function(){F()}));K.style.position="absolute";K.style.right="40px";K.style.top="26px";J.appendChild(K);var H=document.createElement("div");H.style.whiteSpace="nowrap";H.style.border="1px solid lightgray";H.style.boxSizing="border-box";-H.style.padding="4px";H.style.overflow="auto";H.style.lineHeight="1.2em";H.style.height="290px";J.appendChild(H);var G=document.createElement("div");G.style.textOverflow="ellipsis";G.style.boxSizing="border-box";G.style.overflow="hidden";G.style.padding="4px";G.style.width="100%";var c=new CustomDialog(this.ui,J,mxUtils.bind(this,function(){m(q+"/"+u+"/"+encodeURIComponent(y)+"/"+A)}),null,null,"https://www.drawio.com/blog/single-repository-diagrams",null,null,null,null,[[mxResources.get("authorize"),+" / 1 MB)"}):(d={path:q,branch:decodeURIComponent(d),message:u,content:y},null!=A&&(d.sha=A),k=new mxXmlRequest(this.baseUrl+"/repos/"+k+"/"+m+"/contents/"+q,JSON.stringify(d),"PUT"),this.executeRequest(k,mxUtils.bind(this,function(F){J(F)}),mxUtils.bind(this,function(F){404==F.code&&(F.helpLink=this.baseHostUrl+"/settings/connections/applications/"+this.clientId,F.code=null);K(F)})))};GitHubClient.prototype.checkExists=function(k,m,d){var q=k.split("/"),u=q[0],y=q[1],A=q[2];k=q.slice(3,q.length).join("/");+this.getSha(u,y,k,A,mxUtils.bind(this,function(J){if(m){var K=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[k]),function(){K();d(!0,J)},function(){K();d(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){d(!1)})}),mxUtils.bind(this,function(J){d(!0)}),!0)};GitHubClient.prototype.saveFile=function(k,m,d,q,u){var y=k.meta.org,A=k.meta.repo,J=k.meta.ref,K=k.meta.path,F=mxUtils.bind(this,function(c,+f){this.writeFile(y,A,J,K,u,f,c,mxUtils.bind(this,function(l){delete k.meta.isNew;m(JSON.parse(l.getText()).content.sha)}),mxUtils.bind(this,function(l){d(l)}))}),H=mxUtils.bind(this,function(){if(Editor.useCanvasForExport&&/(\.png)$/i.test(K)){var c=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(f){F(k.meta.sha,f)}),d,this.ui.getCurrentFile()!=k?k.getData():null,c.scale,c.border)}else F(k.meta.sha,Base64.encode(k.getData()))});q?this.getSha(y,A,K,+J,mxUtils.bind(this,function(c){k.meta.sha=c;H()}),d):H()};GitHubClient.prototype.pickLibrary=function(k){this.pickFile(k)};GitHubClient.prototype.pickFolder=function(k){this.showGitHubDialog(!1,k,!0)};GitHubClient.prototype.pickFile=function(k){k=null!=k?k:mxUtils.bind(this,function(m){this.ui.loadFile("H"+encodeURIComponent(m))});this.showGitHubDialog(!0,k)};GitHubClient.prototype.showGitHubDialog=function(k,m,d){var q=null,u=null,y=null,A=null,J=document.createElement("div");J.style.whiteSpace=+"nowrap";J.style.overflow="hidden";J.style.height="320px";var K=document.createElement("h3");mxUtils.write(K,mxResources.get(k?"selectFile":"selectFolder"));J.appendChild(K);K=this.ui.createToolbarButton(Editor.refreshImage,mxResources.get("refresh"),mxUtils.bind(this,function(){G()}));K.style.position="absolute";K.style.right="40px";K.style.top="26px";J.appendChild(K);var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.border="1px solid lightgray";F.style.boxSizing="border-box";+F.style.padding="4px";F.style.overflow="auto";F.style.lineHeight="1.2em";F.style.height="290px";J.appendChild(F);var H=document.createElement("div");H.style.textOverflow="ellipsis";H.style.boxSizing="border-box";H.style.overflow="hidden";H.style.padding="4px";H.style.width="100%";var c=new CustomDialog(this.ui,J,mxUtils.bind(this,function(){m(q+"/"+u+"/"+encodeURIComponent(y)+"/"+A)}),null,null,"https://www.drawio.com/blog/single-repository-diagrams",null,null,null,null,[[mxResources.get("authorize"),mxUtils.bind(this,function(){this.ui.openLink("test.draw.io"==window.location.hostname?"https://github.com/apps/diagrams-net-app-test":"https://github.com/apps/draw-io-app")})]],"16px");this.ui.showDialog(c.container,420,370,!0,!0);k&&c.okButton.parentNode.removeChild(c.okButton);var f=mxUtils.bind(this,function(L,D,T,N){var R=document.createElement("a");R.setAttribute("title",L);R.style.cursor="pointer";mxUtils.write(R,L);mxEvent.addListener(R,"click",D);N&&(R.style.textDecoration="underline");null!=-T&&(L=G.cloneNode(),L.style.padding=T,L.appendChild(R),R=L);return R}),l=mxUtils.bind(this,function(L){var D=document.createElement("div");D.style.marginBottom="8px";D.appendChild(f(q+"/"+u,mxUtils.bind(this,function(){A=null;F()}),null,!0));L||(mxUtils.write(D," / "),D.appendChild(f(decodeURIComponent(y),mxUtils.bind(this,function(){A=null;B()}),null,!0)));if(null!=A&&0<A.length){var T=A.split("/");for(L=0;L<T.length;L++)(function(N){mxUtils.write(D," / ");D.appendChild(f(T[N],mxUtils.bind(this,-function(){A=T.slice(0,N+1).join("/");x()}),null,!0))})(L)}H.appendChild(D)}),n=mxUtils.bind(this,function(L){this.ui.handleError(L,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(A=y=u=q=null,F()):this.ui.hideDialog()}),null,{})}),r=null,t=null,x=mxUtils.bind(this,function(L){null==L&&(H.innerText="",L=1);var D=new mxXmlRequest(this.baseUrl+"/repos/"+q+"/"+u+"/contents/"+A+"?ref="+encodeURIComponent(y)+"&per_page=100&page="+L,null,"GET");this.ui.spinner.spin(H,mxResources.get("loading"));-c.okButton.removeAttribute("disabled");null!=t&&(mxEvent.removeListener(H,"scroll",t),t=null);null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r);r=document.createElement("a");r.style.display="block";r.style.cursor="pointer";mxUtils.write(r,mxResources.get("more")+"...");var T=mxUtils.bind(this,function(){x(L+1)});mxEvent.addListener(r,"click",T);this.executeRequest(D,mxUtils.bind(this,function(N){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==L&&(l(),H.appendChild(f("../ [Up]",-mxUtils.bind(this,function(){if(""==A)A=null,F();else{var z=A.split("/");A=z.slice(0,z.length-1).join("/");x()}}),"4px")));var R=JSON.parse(N.getText());if(null==R||0==R.length)d||(mxUtils.br(H),mxUtils.write(H,mxResources.get("noFiles")));else{var P=!0,U=0,S=mxUtils.bind(this,function(z){for(var g=0;g<R.length;g++)mxUtils.bind(this,function(p,v){if(z==("dir"==p.type)){v=G.cloneNode();v.style.backgroundColor=P?Editor.isDarkMode()?"#000000":"#eeeeee":"";P=!P;var C=document.createElement("img");C.src=-IMAGE_PATH+"/"+("dir"==p.type?"folder.png":"file.png");C.setAttribute("align","absmiddle");C.style.marginRight="4px";C.style.marginTop="-4px";C.width=20;v.appendChild(C);v.appendChild(f(p.name+("dir"==p.type?"/":""),mxUtils.bind(this,function(){"dir"==p.type?(A=p.path,x()):k&&"file"==p.type&&(this.ui.hideDialog(),m(q+"/"+u+"/"+encodeURIComponent(y)+"/"+p.path))})));H.appendChild(v);U++}})(R[g],g)});S(!0);k&&S(!1)}}))}),n,!0)}),B=mxUtils.bind(this,function(L,D){null==L&&(H.innerText="",L=1);var T=-new mxXmlRequest(this.baseUrl+"/repos/"+q+"/"+u+"/branches?per_page=100&page="+L,null,"GET");c.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(H,mxResources.get("loading"));null!=t&&(mxEvent.removeListener(H,"scroll",t),t=null);null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r);r=document.createElement("a");r.style.display="block";r.style.cursor="pointer";mxUtils.write(r,mxResources.get("more")+"...");var N=mxUtils.bind(this,function(){B(L+1)});mxEvent.addListener(r,"click",-N);this.executeRequest(T,mxUtils.bind(this,function(R){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==L&&(l(!0),H.appendChild(f("../ [Up]",mxUtils.bind(this,function(){A=null;F()}),"4px")));var P=JSON.parse(R.getText());if(null==P||0==P.length)mxUtils.br(H),mxUtils.write(H,mxResources.get("repositoryNotFound"));else if(1==P.length&&D)y=P[0].name,A="",x();else{for(var U=0;U<P.length;U++)mxUtils.bind(this,function(S,z){var g=G.cloneNode();g.style.backgroundColor=0==z%2?-Editor.isDarkMode()?"#000000":"#eeeeee":"";g.appendChild(f(S.name,mxUtils.bind(this,function(){y=S.name;A="";x()})));H.appendChild(g)})(P[U],U);100==P.length&&(H.appendChild(r),t=function(){H.scrollTop>=H.scrollHeight-H.offsetHeight&&N()},mxEvent.addListener(H,"scroll",t))}}))}),n)}),F=mxUtils.bind(this,function(L){null==L&&(H.innerText="",L=1);var D=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+L,null,"GET");c.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(H,mxResources.get("loading"));-null!=t&&mxEvent.removeListener(H,"scroll",t);null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r);r=document.createElement("a");r.style.display="block";r.style.cursor="pointer";mxUtils.write(r,mxResources.get("more")+"...");var T=mxUtils.bind(this,function(){F(L+1)});mxEvent.addListener(r,"click",T);this.executeRequest(D,mxUtils.bind(this,function(N){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();var R=JSON.parse(N.getText());if(null==R||0==R.length)mxUtils.br(H),mxUtils.write(H,-mxResources.get("repositoryNotFound"));else{1==L&&(H.appendChild(f(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var U=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(S){if(null!=S){var z=S.split("/");if(1<z.length){S=z[0];var g=z[1];3>z.length?(q=S,u=g,A=y=null,B()):this.ui.spinner.spin(H,mxResources.get("loading"))&&(z=encodeURIComponent(z.slice(2,z.length).join("/")),this.getFile(S+"/"+g+"/"+z,mxUtils.bind(this,function(p){this.ui.spinner.stop();-q=p.meta.org;u=p.meta.repo;y=decodeURIComponent(p.meta.ref);A="";x()}),mxUtils.bind(this,function(p){this.ui.spinner.stop();this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(U.container,300,80,!0,!1);U.init()}))),mxUtils.br(H),mxUtils.br(H));for(var P=0;P<R.length;P++)mxUtils.bind(this,function(U,S){var z=G.cloneNode();z.style.backgroundColor=-0==S%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";z.appendChild(f(U.full_name,mxUtils.bind(this,function(){q=U.owner.login;u=U.name;A="";B(null,!0)})));H.appendChild(z)})(R[P],P)}100==R.length&&(H.appendChild(r),t=function(){H.scrollTop>=H.scrollHeight-H.offsetHeight&&T()},mxEvent.addListener(H,"scroll",t))}))}),n)});F()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);b=null}})();TrelloFile=function(b,k,m){DrawioFile.call(this,b,k);this.meta=m;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes};+T&&(L=H.cloneNode(),L.style.padding=T,L.appendChild(R),R=L);return R}),l=mxUtils.bind(this,function(L){var D=document.createElement("div");D.style.marginBottom="8px";D.appendChild(f(q+"/"+u,mxUtils.bind(this,function(){A=null;G()}),null,!0));L||(mxUtils.write(D," / "),D.appendChild(f(decodeURIComponent(y),mxUtils.bind(this,function(){A=null;B()}),null,!0)));if(null!=A&&0<A.length){var T=A.split("/");for(L=0;L<T.length;L++)(function(N){mxUtils.write(D," / ");D.appendChild(f(T[N],mxUtils.bind(this,+function(){A=T.slice(0,N+1).join("/");x()}),null,!0))})(L)}F.appendChild(D)}),n=mxUtils.bind(this,function(L){this.ui.handleError(L,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(A=y=u=q=null,G()):this.ui.hideDialog()}),null,{})}),r=null,t=null,x=mxUtils.bind(this,function(L){null==L&&(F.innerText="",L=1);var D=new mxXmlRequest(this.baseUrl+"/repos/"+q+"/"+u+"/contents/"+A+"?ref="+encodeURIComponent(y)+"&per_page=100&page="+L,null,"GET");this.ui.spinner.spin(F,mxResources.get("loading"));+c.okButton.removeAttribute("disabled");null!=t&&(mxEvent.removeListener(F,"scroll",t),t=null);null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r);r=document.createElement("a");r.style.display="block";r.style.cursor="pointer";mxUtils.write(r,mxResources.get("more")+"...");var T=mxUtils.bind(this,function(){x(L+1)});mxEvent.addListener(r,"click",T);this.executeRequest(D,mxUtils.bind(this,function(N){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==L&&(l(),F.appendChild(f("../ [Up]",+mxUtils.bind(this,function(){if(""==A)A=null,G();else{var z=A.split("/");A=z.slice(0,z.length-1).join("/");x()}}),"4px")));var R=JSON.parse(N.getText());if(null==R||0==R.length)d||(mxUtils.br(F),mxUtils.write(F,mxResources.get("noFiles")));else{var P=!0,U=0,S=mxUtils.bind(this,function(z){for(var g=0;g<R.length;g++)mxUtils.bind(this,function(p,v){if(z==("dir"==p.type)){v=H.cloneNode();v.style.backgroundColor=P?Editor.isDarkMode()?"#000000":"#eeeeee":"";P=!P;var C=document.createElement("img");C.src=+IMAGE_PATH+"/"+("dir"==p.type?"folder.png":"file.png");C.setAttribute("align","absmiddle");C.style.marginRight="4px";C.style.marginTop="-4px";C.width=20;v.appendChild(C);v.appendChild(f(p.name+("dir"==p.type?"/":""),mxUtils.bind(this,function(){"dir"==p.type?(A=p.path,x()):k&&"file"==p.type&&(this.ui.hideDialog(),m(q+"/"+u+"/"+encodeURIComponent(y)+"/"+p.path))})));F.appendChild(v);U++}})(R[g],g)});S(!0);k&&S(!1)}}))}),n,!0)}),B=mxUtils.bind(this,function(L,D){null==L&&(F.innerText="",L=1);var T=+new mxXmlRequest(this.baseUrl+"/repos/"+q+"/"+u+"/branches?per_page=100&page="+L,null,"GET");c.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(F,mxResources.get("loading"));null!=t&&(mxEvent.removeListener(F,"scroll",t),t=null);null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r);r=document.createElement("a");r.style.display="block";r.style.cursor="pointer";mxUtils.write(r,mxResources.get("more")+"...");var N=mxUtils.bind(this,function(){B(L+1)});mxEvent.addListener(r,"click",+N);this.executeRequest(T,mxUtils.bind(this,function(R){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==L&&(l(!0),F.appendChild(f("../ [Up]",mxUtils.bind(this,function(){A=null;G()}),"4px")));var P=JSON.parse(R.getText());if(null==P||0==P.length)mxUtils.br(F),mxUtils.write(F,mxResources.get("repositoryNotFound"));else if(1==P.length&&D)y=P[0].name,A="",x();else{for(var U=0;U<P.length;U++)mxUtils.bind(this,function(S,z){var g=H.cloneNode();g.style.backgroundColor=0==z%2?+Editor.isDarkMode()?"#000000":"#eeeeee":"";g.appendChild(f(S.name,mxUtils.bind(this,function(){y=S.name;A="";x()})));F.appendChild(g)})(P[U],U);100==P.length&&(F.appendChild(r),t=function(){F.scrollTop>=F.scrollHeight-F.offsetHeight&&N()},mxEvent.addListener(F,"scroll",t))}}))}),n)}),G=mxUtils.bind(this,function(L){null==L&&(F.innerText="",L=1);var D=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+L,null,"GET");c.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(F,mxResources.get("loading"));+null!=t&&mxEvent.removeListener(F,"scroll",t);null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r);r=document.createElement("a");r.style.display="block";r.style.cursor="pointer";mxUtils.write(r,mxResources.get("more")+"...");var T=mxUtils.bind(this,function(){G(L+1)});mxEvent.addListener(r,"click",T);this.executeRequest(D,mxUtils.bind(this,function(N){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();var R=JSON.parse(N.getText());if(null==R||0==R.length)mxUtils.br(F),mxUtils.write(F,+mxResources.get("repositoryNotFound"));else{1==L&&(F.appendChild(f(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var U=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(S){if(null!=S){var z=S.split("/");if(1<z.length){S=z[0];var g=z[1];3>z.length?(q=S,u=g,A=y=null,B()):this.ui.spinner.spin(F,mxResources.get("loading"))&&(z=encodeURIComponent(z.slice(2,z.length).join("/")),this.getFile(S+"/"+g+"/"+z,mxUtils.bind(this,function(p){this.ui.spinner.stop();+q=p.meta.org;u=p.meta.repo;y=decodeURIComponent(p.meta.ref);A="";x()}),mxUtils.bind(this,function(p){this.ui.spinner.stop();this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(U.container,300,80,!0,!1);U.init()}))),mxUtils.br(F),mxUtils.br(F));for(var P=0;P<R.length;P++)mxUtils.bind(this,function(U,S){var z=H.cloneNode();z.style.backgroundColor=+0==S%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";z.appendChild(f(U.full_name,mxUtils.bind(this,function(){q=U.owner.login;u=U.name;A="";B(null,!0)})));F.appendChild(z)})(R[P],P)}100==R.length&&(F.appendChild(r),t=function(){F.scrollTop>=F.scrollHeight-F.offsetHeight&&T()},mxEvent.addListener(F,"scroll",t))}))}),n)});G()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);b=null}})();TrelloFile=function(b,k,m){DrawioFile.call(this,b,k);this.meta=m;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes};TrelloFile.prototype.save=function(b,k,m){this.doSave(this.getTitle(),k,m)};TrelloFile.prototype.saveAs=function(b,k,m){this.doSave(b,k,m)};TrelloFile.prototype.doSave=function(b,k,m){var d=this.meta.name;this.meta.name=b;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=d;this.saveFile(b,!1,k,m)}),m])};TrelloFile.prototype.saveFile=function(b,k,m,d){this.isEditable()?this.savingFile?null!=d&&(this.saveNeededCounter++,d({code:App.ERROR_BUSY})):(this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.getTitle()==b?this.ui.trello.saveFile(this,mxUtils.bind(this,function(q){this.setModified(this.getShadowModified());this.savingFile=!1;this.meta=q;this.contentChanged();null!=m&&m();0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(b,k,m,d))}),mxUtils.bind(this,function(q){this.savingFile=!1;null!=d&&d(q)})):this.ui.pickFolder(App.MODE_TRELLO,mxUtils.bind(this,function(q){this.ui.trello.insertFile(b,this.getData(),mxUtils.bind(this,function(u){this.savingFile=!1;null!=m&&m();this.ui.fileLoaded(u);0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(b,k,m,d))}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}),!1,q)}))):null!=m&&m()};TrelloLibrary=function(b,k,m){TrelloFile.call(this,b,k,m)};mxUtils.extend(TrelloLibrary,TrelloFile);TrelloLibrary.prototype.doSave=function(b,k,m){this.saveFile(b,!1,k,m)};TrelloLibrary.prototype.open=function(){};TrelloClient=function(b){DrawioClient.call(this,b,"tauth");Trello.setKey(this.key)};mxUtils.extend(TrelloClient,DrawioClient);TrelloClient.prototype.key="e89d109082298ce91f6576f82f458551";TrelloClient.prototype.baseUrl="https://api.trello.com/1/";TrelloClient.prototype.SEPARATOR="|$|";TrelloClient.prototype.maxFileSize=1E7;TrelloClient.prototype.extension=".xml";TrelloClient.prototype.authenticate=function(b,k,m){m&&this.logout();m=mxUtils.bind(this,function(d,q){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:d?"never":"1hour",success:function(){localStorage.setItem("drawio_trello_token",localStorage.trello_token);null!=q&&q();b()},error:function(){null!=q&&q();null!=k&&k(mxResources.get("loggedOut"))}})});this.isAuthorized()?m(!0):this.ui.showAuthDialog(this,!0,m)};TrelloClient.prototype.getLibrary=function(b,k,m){this.getFile(b,k,m,!1,!0)};-TrelloClient.prototype.getFile=function(b,k,m,d,q){q=null!=q?q:!1;var u=mxUtils.bind(this,function(){var y=b.split(this.SEPARATOR),A=!0,J=window.setTimeout(mxUtils.bind(this,function(){A=!1;m({code:App.ERROR_TIMEOUT,retry:u})}),this.ui.timeout);Trello.cards.get(y[0]+"/attachments/"+y[1],mxUtils.bind(this,function(K){window.clearTimeout(J);if(A){var H=/\.png$/i.test(K.name),G={Authorization:'OAuth oauth_consumer_key="'+Trello.key()+'", oauth_token="'+Trello.token()+'"'};/\.v(dx|sdx?)$/i.test(K.name)||-/\.gliffy$/i.test(K.name)||!Editor.useCanvasForExport&&H?this.ui.convertFile(PROXY_URL+"?url="+encodeURIComponent(K.url),K.name,K.mimeType,this.extension,k,m,null,G):(A=!0,J=window.setTimeout(mxUtils.bind(this,function(){A=!1;m({code:App.ERROR_TIMEOUT})}),this.ui.timeout),this.ui.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(K.url),mxUtils.bind(this,function(c){window.clearTimeout(J);if(A){K.compoundId=b;if(0<(H?c.lastIndexOf(","):-1)){var f=this.ui.extractGraphModelFromPng(c);null!=f&&0<f.length&&-(c=f)}q?k(new TrelloLibrary(this.ui,c,K)):k(new TrelloFile(this.ui,c,K))}}),mxUtils.bind(this,function(c,f){window.clearTimeout(J);A&&(401==f.status?this.authenticate(u,m,!0):m())}),H||null!=K.mimeType&&"image/"==K.mimeType.substring(0,6),null,null,null,G))}}),mxUtils.bind(this,function(K){window.clearTimeout(J);A&&(null!=K&&401==K.status?this.authenticate(u,m,!0):m())}))});this.authenticate(u,m)};TrelloClient.prototype.insertLibrary=function(b,k,m,d,q){this.insertFile(b,k,m,d,!0,q)};+TrelloClient.prototype.getFile=function(b,k,m,d,q){q=null!=q?q:!1;var u=mxUtils.bind(this,function(){var y=b.split(this.SEPARATOR),A=!0,J=window.setTimeout(mxUtils.bind(this,function(){A=!1;m({code:App.ERROR_TIMEOUT,retry:u})}),this.ui.timeout);Trello.cards.get(y[0]+"/attachments/"+y[1],mxUtils.bind(this,function(K){window.clearTimeout(J);if(A){var F=/\.png$/i.test(K.name),H={Authorization:'OAuth oauth_consumer_key="'+Trello.key()+'", oauth_token="'+Trello.token()+'"'};/\.v(dx|sdx?)$/i.test(K.name)||+/\.gliffy$/i.test(K.name)||!Editor.useCanvasForExport&&F?this.ui.convertFile(PROXY_URL+"?url="+encodeURIComponent(K.url),K.name,K.mimeType,this.extension,k,m,null,H):(A=!0,J=window.setTimeout(mxUtils.bind(this,function(){A=!1;m({code:App.ERROR_TIMEOUT})}),this.ui.timeout),this.ui.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(K.url),mxUtils.bind(this,function(c){window.clearTimeout(J);if(A){K.compoundId=b;if(0<(F?c.lastIndexOf(","):-1)){var f=this.ui.extractGraphModelFromPng(c);null!=f&&0<f.length&&+(c=f)}q?k(new TrelloLibrary(this.ui,c,K)):k(new TrelloFile(this.ui,c,K))}}),mxUtils.bind(this,function(c,f){window.clearTimeout(J);A&&(401==f.status?this.authenticate(u,m,!0):m())}),F||null!=K.mimeType&&"image/"==K.mimeType.substring(0,6),null,null,null,H))}}),mxUtils.bind(this,function(K){window.clearTimeout(J);A&&(null!=K&&401==K.status?this.authenticate(u,m,!0):m())}))});this.authenticate(u,m)};TrelloClient.prototype.insertLibrary=function(b,k,m,d,q){this.insertFile(b,k,m,d,!0,q)};TrelloClient.prototype.insertFile=function(b,k,m,d,q,u){q=null!=q?q:!1;var y=mxUtils.bind(this,function(){var A=mxUtils.bind(this,function(J){this.writeFile(b,J,u,mxUtils.bind(this,function(K){q?m(new TrelloLibrary(this.ui,k,K)):m(new TrelloFile(this.ui,k,K))}),d)});Editor.useCanvasForExport&&/(\.png)$/i.test(b)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(J){A(this.ui.base64ToBlob(J,"image/png"))}),d,k):A(k)});this.authenticate(y,d)};TrelloClient.prototype.saveFile=function(b,k,m){var d=b.meta.compoundId.split(this.SEPARATOR),q=mxUtils.bind(this,function(y){this.writeFile(b.meta.name,y,d[0],function(A){Trello.del("cards/"+d[0]+"/attachments/"+d[1],mxUtils.bind(this,function(){k(A)}),mxUtils.bind(this,function(J){null!=J&&401==J.status?this.authenticate(u,m,!0):m()}))},m)}),u=mxUtils.bind(this,function(){Editor.useCanvasForExport&&/(\.png)$/i.test(b.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(y){q(this.ui.base64ToBlob(y,"image/png"))}),m,this.ui.getCurrentFile()!=b?b.getData():null):q(b.getData())});this.authenticate(u,m)};TrelloClient.prototype.writeFile=function(b,k,m,d,q){if(null!=b&&null!=k)if(k.length>=this.maxFileSize)q({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(k.length)+" / 10 MB)"});else{var u=mxUtils.bind(this,function(){var y=!0,A=window.setTimeout(mxUtils.bind(this,function(){y=!1;q({code:App.ERROR_TIMEOUT,retry:u})}),this.ui.timeout),J=new FormData;J.append("key",Trello.key());J.append("token",Trello.token());J.append("file","string"===typeof k?new Blob([k]):k,b);J.append("name",-b);var K=new XMLHttpRequest;K.responseType="json";K.onreadystatechange=mxUtils.bind(this,function(){if(4===K.readyState&&(window.clearTimeout(A),y))if(200==K.status){var H=K.response;H.compoundId=m+this.SEPARATOR+H.id;d(H)}else 401==K.status?this.authenticate(u,q,!0):q()});K.open("POST",this.baseUrl+"cards/"+m+"/attachments");K.send(J)});this.authenticate(u,q)}else q({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(b){this.pickFile(b)};+b);var K=new XMLHttpRequest;K.responseType="json";K.onreadystatechange=mxUtils.bind(this,function(){if(4===K.readyState&&(window.clearTimeout(A),y))if(200==K.status){var F=K.response;F.compoundId=m+this.SEPARATOR+F.id;d(F)}else 401==K.status?this.authenticate(u,q,!0):q()});K.open("POST",this.baseUrl+"cards/"+m+"/attachments");K.send(J)});this.authenticate(u,q)}else q({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(b){this.pickFile(b)};TrelloClient.prototype.pickFolder=function(b){this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!1,b)}),mxUtils.bind(this,function(k){this.ui.showError(mxResources.get("error"),k)}))};TrelloClient.prototype.pickFile=function(b,k){b=null!=b?b:mxUtils.bind(this,function(m){this.ui.loadFile("T"+encodeURIComponent(m))});this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!0,b)}),mxUtils.bind(this,function(m){this.ui.showError(mxResources.get("error"),m,mxResources.get("ok"))}))};TrelloClient.prototype.showTrelloDialog=function(b,k){var m=null,d="@me",q=0,u=document.createElement("div");u.style.whiteSpace="nowrap";u.style.overflow="hidden";u.style.height="224px";var y=document.createElement("h3");mxUtils.write(y,b?mxResources.get("selectFile"):mxResources.get("selectCard"));u.appendChild(y);var A=document.createElement("div");A.style.whiteSpace="nowrap";A.style.overflow="auto";A.style.height="194px";u.appendChild(A);u=new CustomDialog(this.ui,u);this.ui.showDialog(u.container,340,290,!0,!0);u.okButton.parentNode.removeChild(u.okButton);var J=mxUtils.bind(this,function(l,n,r){q++;var t=document.createElement("div");t.style="width:100%;text-overflow:ellipsis;overflow:hidden;vertical-align:middle;padding:2px 0 2px 0;background:"+(0==q%2?Editor.isDarkMode()?"#000":"#eee":Editor.isDarkMode()?"":"#fff");var x=document.createElement("a");x.style.cursor="pointer";if(null!=r){var B=document.createElement("img");B.src=r.url;B.width=r.width;B.height=r.height;B.style="border: 1px solid black;margin:5px;vertical-align:middle";-x.appendChild(B)}mxUtils.write(x,l);mxEvent.addListener(x,"click",n);t.appendChild(x);return t}),K=mxUtils.bind(this,function(l){this.ui.handleError(l,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),H=mxUtils.bind(this,function(){q=0;A.innerText="";this.ui.spinner.spin(A,mxResources.get("loading"));var l=mxUtils.bind(this,function(){Trello.cards.get(m+"/attachments",{fields:"id,name,previews"},mxUtils.bind(this,function(n){this.ui.spinner.stop();A.appendChild(J("../ [Up]",-mxUtils.bind(this,function(){f()})));mxUtils.br(A);null==n||0==n.length?mxUtils.write(A,mxResources.get("noFiles")):mxUtils.bind(this,function(){for(var r=0;r<n.length;r++)mxUtils.bind(this,function(t){A.appendChild(J(t.name,mxUtils.bind(this,function(){this.ui.hideDialog();k(m+this.SEPARATOR+t.id)}),null!=t.previews?t.previews[0]:null))})(n[r])})()}),mxUtils.bind(this,function(n){401==n.status?this.authenticate(l,K,!0):null!=K&&K(n)}))});l()}),G=null,c=null,f=mxUtils.bind(this,function(l){null==-l&&(q=0,A.innerText="",l=1);this.ui.spinner.spin(A,mxResources.get("loading"));null!=G&&null!=G.parentNode&&G.parentNode.removeChild(G);G=document.createElement("a");G.style.display="block";G.style.cursor="pointer";mxUtils.write(G,mxResources.get("more")+"...");var n=mxUtils.bind(this,function(){mxEvent.removeListener(A,"scroll",c);f(l+1)});mxEvent.addListener(G,"click",n);var r=mxUtils.bind(this,function(){Trello.get("search",{query:""==mxUtils.trim(d)?"is:open":d,cards_limit:100,cards_page:l-1},-mxUtils.bind(this,function(t){this.ui.spinner.stop();t=null!=t?t.cards:null;if(null==t||0==t.length)mxUtils.write(A,mxResources.get("noFiles"));else{1==l&&(A.appendChild(J(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var B=new FilenameDialog(this.ui,d,mxResources.get("ok"),mxUtils.bind(this,function(F){null!=F&&(d=F,f())}),mxResources.get("filterCards"),null,null,"http://help.trello.com/article/808-searching-for-cards-all-boards");this.ui.showDialog(B.container,300,80,!0,!1);-B.init()}))),mxUtils.br(A));for(var x=0;x<t.length;x++)mxUtils.bind(this,function(B){A.appendChild(J(B.name,mxUtils.bind(this,function(){b?(m=B.id,H()):(this.ui.hideDialog(),k(B.id))})))})(t[x]);100==t.length&&(A.appendChild(G),c=function(){A.scrollTop>=A.scrollHeight-A.offsetHeight&&n()},mxEvent.addListener(A,"scroll",c))}}),mxUtils.bind(this,function(t){401==t.status?this.authenticate(r,K,!0):null!=K&&K({message:t.responseText})}))});r()});f()};+x.appendChild(B)}mxUtils.write(x,l);mxEvent.addListener(x,"click",n);t.appendChild(x);return t}),K=mxUtils.bind(this,function(l){this.ui.handleError(l,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),F=mxUtils.bind(this,function(){q=0;A.innerText="";this.ui.spinner.spin(A,mxResources.get("loading"));var l=mxUtils.bind(this,function(){Trello.cards.get(m+"/attachments",{fields:"id,name,previews"},mxUtils.bind(this,function(n){this.ui.spinner.stop();A.appendChild(J("../ [Up]",+mxUtils.bind(this,function(){f()})));mxUtils.br(A);null==n||0==n.length?mxUtils.write(A,mxResources.get("noFiles")):mxUtils.bind(this,function(){for(var r=0;r<n.length;r++)mxUtils.bind(this,function(t){A.appendChild(J(t.name,mxUtils.bind(this,function(){this.ui.hideDialog();k(m+this.SEPARATOR+t.id)}),null!=t.previews?t.previews[0]:null))})(n[r])})()}),mxUtils.bind(this,function(n){401==n.status?this.authenticate(l,K,!0):null!=K&&K(n)}))});l()}),H=null,c=null,f=mxUtils.bind(this,function(l){null==+l&&(q=0,A.innerText="",l=1);this.ui.spinner.spin(A,mxResources.get("loading"));null!=H&&null!=H.parentNode&&H.parentNode.removeChild(H);H=document.createElement("a");H.style.display="block";H.style.cursor="pointer";mxUtils.write(H,mxResources.get("more")+"...");var n=mxUtils.bind(this,function(){mxEvent.removeListener(A,"scroll",c);f(l+1)});mxEvent.addListener(H,"click",n);var r=mxUtils.bind(this,function(){Trello.get("search",{query:""==mxUtils.trim(d)?"is:open":d,cards_limit:100,cards_page:l-1},+mxUtils.bind(this,function(t){this.ui.spinner.stop();t=null!=t?t.cards:null;if(null==t||0==t.length)mxUtils.write(A,mxResources.get("noFiles"));else{1==l&&(A.appendChild(J(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var B=new FilenameDialog(this.ui,d,mxResources.get("ok"),mxUtils.bind(this,function(G){null!=G&&(d=G,f())}),mxResources.get("filterCards"),null,null,"http://help.trello.com/article/808-searching-for-cards-all-boards");this.ui.showDialog(B.container,300,80,!0,!1);+B.init()}))),mxUtils.br(A));for(var x=0;x<t.length;x++)mxUtils.bind(this,function(B){A.appendChild(J(B.name,mxUtils.bind(this,function(){b?(m=B.id,F()):(this.ui.hideDialog(),k(B.id))})))})(t[x]);100==t.length&&(A.appendChild(H),c=function(){A.scrollTop>=A.scrollHeight-A.offsetHeight&&n()},mxEvent.addListener(A,"scroll",c))}}),mxUtils.bind(this,function(t){401==t.status?this.authenticate(r,K,!0):null!=K&&K({message:t.responseText})}))});r()});f()};TrelloClient.prototype.isAuthorized=function(){try{var b=localStorage.trello_token;null==b&&(b=localStorage.drawio_trello_token,null!=b&&localStorage.setItem("trello_token",b));return null!=b}catch(k){}return!1};TrelloClient.prototype.logout=function(){localStorage.removeItem("drawio_trello_token");Trello.deauthorize()};GitLabFile=function(b,k,m){GitHubFile.call(this,b,k,m);this.peer=this.ui.gitLab};mxUtils.extend(GitLabFile,GitHubFile);GitLabFile.prototype.getFileUrl=function(){return this.meta.html_url};GitLabFile.prototype.getFolderUrl=function(){var b=this.getFileUrl();return b.substring(0,b.lastIndexOf("/"))};GitLabFile.prototype.share=function(){this.ui.editor.graph.openLink(DRAWIO_GITLAB_URL+"/"+this.meta.org+"/"+encodeURIComponent(this.meta.repo)+"/-/project_members")};GitLabFile.prototype.getId=function(){return this.meta.org+"/"+(null!=this.meta.repo?encodeURIComponent(this.meta.repo)+"/"+(null!=this.meta.ref?this.meta.ref+(null!=this.meta.path?"/"+this.meta.path:""):""):"")};GitLabFile.prototype.getHash=function(){return encodeURIComponent("A"+this.getId())};GitLabFile.prototype.isConflict=function(b){return null!=b&&400==b.status};GitLabFile.prototype.getMode=function(){return App.MODE_GITLAB};GitLabFile.prototype.getDescriptorEtag=function(b){return b.last_commit_id};GitLabFile.prototype.setDescriptorEtag=function(b,k){b.last_commit_id=k};GitLabLibrary=function(b,k,m){GitLabFile.call(this,b,k,m)};mxUtils.extend(GitLabLibrary,GitLabFile);GitLabLibrary.prototype.doSave=function(b,k,m){this.saveFile(b,!1,k,m)};GitLabLibrary.prototype.open=function(){};(function(){var b=null;window.GitLabClient=function(k){GitHubClient.call(this,k,"gitlabauth")};mxUtils.extend(GitLabClient,GitHubClient);GitLabClient.DEFAULT_URL="https://gitlab.com";GitLabClient.prototype.clientId=DRAWIO_GITLAB_ID;GitLabClient.prototype.scope="api%20read_repository%20write_repository";GitLabClient.prototype.baseUrl=DRAWIO_GITLAB_URL+"/api/v4";GitLabClient.prototype.maxFileSize=1E7;GitLabClient.prototype.authToken="Bearer";GitLabClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+@@ -14900,44 +14904,44 @@ GitLabFile.prototype.setDescriptorEtag=function(b,k){b.last_commit_id=k};GitLabLfunction(k,m,d){if(null==window.onGitLabCallback){var q=mxUtils.bind(this,function(){var u=!0;null!=this.getPersistentToken(!0)?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k),null,"GET")).send(mxUtils.bind(this,function(y){if(200<=y.getStatus()&&299>=y.getStatus())try{b=JSON.parse(y.getText()).access_token,this.setToken(b),this.setUser(null),m()}catch(A){d({message:mxResources.get("authFailed"),retry:q})}else this.clearPersistentToken(),this.setUser(null),b=null,this.setToken(null),401==y.getStatus()?q():d({message:mxResources.get("accessDenied"),retry:q})}),d):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(y,A){null!=window.open(DRAWIO_GITLAB_URL+"/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+k),"gitlabauth")?window.onGitLabCallback=mxUtils.bind(this,function(J,K){u?(window.onGitLabCallback=null,u=!1,null==J?d({message:mxResources.get("accessDenied"),retry:q}):(null!=A&&A(),b=J.access_token,this.setToken(b),this.setUser(null),y&&this.setPersistentToken("remembered"),m(),null!=K&&K.close())):null!=K&&K.close()}):d({message:mxResources.get("serviceUnavailableOrBlocked"),retry:q})}),mxUtils.bind(this,function(){u&&(window.onGitLabCallback=null,u=!1,d({message:mxResources.get("accessDenied"),retry:q}))}))});q()}else d({code:App.ERROR_BUSY})};GitLabClient.prototype.executeRequest=-function(k,m,d,q){var u=mxUtils.bind(this,function(A){var J=!0,K=window.setTimeout(mxUtils.bind(this,function(){J=!1;d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),H=this.authToken+" "+b;k.setRequestHeaders=function(G,c){G.setRequestHeader("Authorization",H);G.setRequestHeader("PRIVATE_TOKEN",H);G.setRequestHeader("Content-Type","application/json")};k.send(mxUtils.bind(this,function(){window.clearTimeout(K);if(J)if(200<=k.getStatus()&&299>=k.getStatus()||q&&404==-k.getStatus())m(k);else if(401===k.getStatus())A?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){y(!0)},d)})}):this.authenticate(function(){u(!0)},d);else if(403===k.getStatus()){var G=!1;try{var c=JSON.parse(k.getText());null!=c&&null!=c.errors&&0<c.errors.length&&(G="too_large"==c.errors[0].code)}catch(f){}d({message:mxResources.get(G?"drawingTooLarge":"forbidden")})}else 404===k.getStatus()?d({message:this.getErrorMessage(k,mxResources.get("fileNotFound"))}):-d({status:k.getStatus(),message:this.getErrorMessage(k,mxResources.get("error")+" "+k.getStatus())})}),mxUtils.bind(this,function(G){window.clearTimeout(K);J&&d(G)}))}),y=mxUtils.bind(this,function(A){null==this.user?this.updateUser(function(){y(!0)},d,A):u(A)});null==b?this.authenticate(function(){y(!0)},d):y(!1)};GitLabClient.prototype.getRefIndex=function(k,m,d,q,u,y){if(null!=u)d(k,u);else{var A=k.length-2,J=mxUtils.bind(this,function(){if(2>A)q({message:mxResources.get("fileNotFound")});else{var K=-Math.max(A-1,0),H=k.slice(0,K).join("/");K=k[K];var G=k[A],c=k.slice(A+1,k.length).join("/");H=this.baseUrl+"/projects/"+encodeURIComponent(H+"/"+K)+"/repository/"+(m?y?"branches?per_page=1&page=1&ref="+G:"tree?path="+c+"&ref="+G:"files/"+encodeURIComponent(c)+"?ref="+G);var f=new mxXmlRequest(H,null,"HEAD");this.executeRequest(f,mxUtils.bind(this,function(){200==f.getStatus()?d(k,A):q({message:mxResources.get("fileNotFound")})}),mxUtils.bind(this,function(){404==f.getStatus()?(A--,J()):q({message:mxResources.get("fileNotFound")})}))}});-J()}};GitLabClient.prototype.getFile=function(k,m,d,q,u,y){q=null!=q?q:!1;this.getRefIndex(k.split("/"),!1,mxUtils.bind(this,function(A,J){var K=Math.max(J-1,0),H=A.slice(0,K).join("/"),G=A[K],c=A[J];k=A.slice(J+1,A.length).join("/");A=/\.png$/i.test(k);if(!u&&(/\.v(dx|sdx?)$/i.test(k)||/\.gliffy$/i.test(k)||/\.pdf$/i.test(k)||!Editor.useCanvasForExport&&A))if(null!=b){K="&t="+(new Date).getTime();var f=this.baseUrl+"/projects/"+encodeURIComponent(H+"/"+G)+"/repository/files/"+encodeURIComponent(k)+-"?ref="+c;A=k.split("/");this.ui.convertFile(f+K,0<A.length?A[A.length-1]:k,null,this.extension,m,d,mxUtils.bind(this,function(l,n,r){l=new mxXmlRequest(l,null,"GET");this.executeRequest(l,mxUtils.bind(this,function(t){try{n(this.getFileContent(JSON.parse(t.getText())))}catch(x){r(x)}}),r)}))}else d({message:mxResources.get("accessDenied")});else K="&t="+(new Date).getTime(),f=this.baseUrl+"/projects/"+encodeURIComponent(H+"/"+G)+"/repository/files/"+encodeURIComponent(k)+"?ref="+c,A=new mxXmlRequest(f+-K,null,"GET"),this.executeRequest(A,mxUtils.bind(this,function(l){try{m(this.createGitLabFile(H,G,c,JSON.parse(l.getText()),q,J))}catch(n){d(n)}}),d)}),d,y)};GitLabClient.prototype.getFileContent=function(k){var m=k.file_name,d=k.content;"base64"===k.encoding&&(/\.jpe?g$/i.test(m)?d="data:image/jpeg;base64,"+d:/\.gif$/i.test(m)?d="data:image/gif;base64,"+d:/\.pdf$/i.test(m)?d="data:application/pdf;base64,"+d:/\.png$/i.test(m)?(k=this.ui.extractGraphModelFromPng(d),d=null!=k&&0<k.length?k:"data:image/png;base64,"++function(k,m,d,q){var u=mxUtils.bind(this,function(A){var J=!0,K=window.setTimeout(mxUtils.bind(this,function(){J=!1;d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),F=this.authToken+" "+b;k.setRequestHeaders=function(H,c){H.setRequestHeader("Authorization",F);H.setRequestHeader("PRIVATE_TOKEN",F);H.setRequestHeader("Content-Type","application/json")};k.send(mxUtils.bind(this,function(){window.clearTimeout(K);if(J)if(200<=k.getStatus()&&299>=k.getStatus()||q&&404==+k.getStatus())m(k);else if(401===k.getStatus())A?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){y(!0)},d)})}):this.authenticate(function(){u(!0)},d);else if(403===k.getStatus()){var H=!1;try{var c=JSON.parse(k.getText());null!=c&&null!=c.errors&&0<c.errors.length&&(H="too_large"==c.errors[0].code)}catch(f){}d({message:mxResources.get(H?"drawingTooLarge":"forbidden")})}else 404===k.getStatus()?d({message:this.getErrorMessage(k,mxResources.get("fileNotFound"))}):+d({status:k.getStatus(),message:this.getErrorMessage(k,mxResources.get("error")+" "+k.getStatus())})}),mxUtils.bind(this,function(H){window.clearTimeout(K);J&&d(H)}))}),y=mxUtils.bind(this,function(A){null==this.user?this.updateUser(function(){y(!0)},d,A):u(A)});null==b?this.authenticate(function(){y(!0)},d):y(!1)};GitLabClient.prototype.getRefIndex=function(k,m,d,q,u,y){if(null!=u)d(k,u);else{var A=k.length-2,J=mxUtils.bind(this,function(){if(2>A)q({message:mxResources.get("fileNotFound")});else{var K=+Math.max(A-1,0),F=k.slice(0,K).join("/");K=k[K];var H=k[A],c=k.slice(A+1,k.length).join("/");F=this.baseUrl+"/projects/"+encodeURIComponent(F+"/"+K)+"/repository/"+(m?y?"branches?per_page=1&page=1&ref="+H:"tree?path="+c+"&ref="+H:"files/"+encodeURIComponent(c)+"?ref="+H);var f=new mxXmlRequest(F,null,"HEAD");this.executeRequest(f,mxUtils.bind(this,function(){200==f.getStatus()?d(k,A):q({message:mxResources.get("fileNotFound")})}),mxUtils.bind(this,function(){404==f.getStatus()?(A--,J()):q({message:mxResources.get("fileNotFound")})}))}});+J()}};GitLabClient.prototype.getFile=function(k,m,d,q,u,y){q=null!=q?q:!1;this.getRefIndex(k.split("/"),!1,mxUtils.bind(this,function(A,J){var K=Math.max(J-1,0),F=A.slice(0,K).join("/"),H=A[K],c=A[J];k=A.slice(J+1,A.length).join("/");A=/\.png$/i.test(k);if(!u&&(/\.v(dx|sdx?)$/i.test(k)||/\.gliffy$/i.test(k)||/\.pdf$/i.test(k)||!Editor.useCanvasForExport&&A))if(null!=b){K="&t="+(new Date).getTime();var f=this.baseUrl+"/projects/"+encodeURIComponent(F+"/"+H)+"/repository/files/"+encodeURIComponent(k)++"?ref="+c;A=k.split("/");this.ui.convertFile(f+K,0<A.length?A[A.length-1]:k,null,this.extension,m,d,mxUtils.bind(this,function(l,n,r){l=new mxXmlRequest(l,null,"GET");this.executeRequest(l,mxUtils.bind(this,function(t){try{n(this.getFileContent(JSON.parse(t.getText())))}catch(x){r(x)}}),r)}))}else d({message:mxResources.get("accessDenied")});else K="&t="+(new Date).getTime(),f=this.baseUrl+"/projects/"+encodeURIComponent(F+"/"+H)+"/repository/files/"+encodeURIComponent(k)+"?ref="+c,A=new mxXmlRequest(f++K,null,"GET"),this.executeRequest(A,mxUtils.bind(this,function(l){try{m(this.createGitLabFile(F,H,c,JSON.parse(l.getText()),q,J))}catch(n){d(n)}}),d)}),d,y)};GitLabClient.prototype.getFileContent=function(k){var m=k.file_name,d=k.content;"base64"===k.encoding&&(/\.jpe?g$/i.test(m)?d="data:image/jpeg;base64,"+d:/\.gif$/i.test(m)?d="data:image/gif;base64,"+d:/\.pdf$/i.test(m)?d="data:application/pdf;base64,"+d:/\.png$/i.test(m)?(k=this.ui.extractGraphModelFromPng(d),d=null!=k&&0<k.length?k:"data:image/png;base64,"+d):d=Base64.decode(d));return d};GitLabClient.prototype.createGitLabFile=function(k,m,d,q,u,y){var A=DRAWIO_GITLAB_URL+"/";k={org:k,repo:m,ref:d,name:q.file_name,path:q.file_path,html_url:A+k+"/"+m+"/blob/"+d+"/"+q.file_path,download_url:A+k+"/"+m+"/raw/"+d+"/"+q.file_path+"?inline=false",last_commit_id:q.last_commit_id,refPos:y};q=this.getFileContent(q);return u?new GitLabLibrary(this.ui,q,k):new GitLabFile(this.ui,q,k)};GitLabClient.prototype.insertFile=function(k,m,d,q,u,y,A){u=null!=u?u:!1;y=-y.split("/");this.getRefIndex(y,!0,mxUtils.bind(this,function(J,K){var H=Math.max(K-1,0),G=J.slice(0,H).join("/"),c=J[H],f=J[K];path=J.slice(K+1,J.length).join("/");0<path.length&&(path+="/");path+=k;this.checkExists(G+"/"+c+"/"+f+"/"+path,!0,mxUtils.bind(this,function(l,n){l?u?(A||(m=Base64.encode(m)),this.showCommitDialog(k,!0,mxUtils.bind(this,function(r){this.writeFile(G,c,f,path,r,m,n,mxUtils.bind(this,function(t){try{var x=JSON.parse(t.getText());d(this.createGitLabFile(G,c,f,null!=x.content?-x.content:x,u,K))}catch(B){q(B)}}),q)}),q)):(l=DRAWIO_GITLAB_URL+"/",d(new GitLabFile(this.ui,m,{org:G,repo:c,ref:f,name:k,path:path,html_url:l+G+"/"+c+"/blob/"+f+"/"+path,download_url:l+G+"/"+c+"/raw/"+f+"/"+path+"?inline=false",refPos:K,last_commit_id:n,isNew:!0}))):q()}))}),q,null,4>=y.length)};GitLabClient.prototype.checkExists=function(k,m,d){this.getFile(k,mxUtils.bind(this,function(q){if(m){var u=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[k]),function(){u();d(!0,q.getCurrentEtag())},-function(){u();d(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){d(!1)})}),mxUtils.bind(this,function(q){d(!0)}),null,!0)};GitLabClient.prototype.writeFile=function(k,m,d,q,u,y,A,J,K){if(y.length>=this.maxFileSize)K({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(y.length)+" / 10 MB)"});else{var H="POST";d={path:encodeURIComponent(q),branch:decodeURIComponent(d),commit_message:u,content:y,-encoding:"base64"};null!=A&&(d.last_commit_id=A,H="PUT");k=this.baseUrl+"/projects/"+encodeURIComponent(k+"/"+m)+"/repository/files/"+encodeURIComponent(q);H=new mxXmlRequest(k,JSON.stringify(d),H);this.executeRequest(H,mxUtils.bind(this,function(G){J(G)}),K)}};GitLabClient.prototype.saveFile=function(k,m,d,q,u){var y=k.meta.org,A=k.meta.repo,J=k.meta.ref,K=k.meta.path,H=mxUtils.bind(this,function(c,f){this.writeFile(y,A,J,K,u,f,c,mxUtils.bind(this,function(l){delete k.meta.isNew;this.getFile(y+"/"+-A+"/"+J+"/"+K,mxUtils.bind(this,function(n){n.getData()==k.getData()?m(n.getCurrentEtag()):m({content:k.getCurrentEtag()})}),d,null,null,k.meta.refPos)}),d)}),G=mxUtils.bind(this,function(){if(Editor.useCanvasForExport&&/(\.png)$/i.test(K)){var c=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(f){H(k.meta.last_commit_id,f)}),d,this.ui.getCurrentFile()!=k?k.getData():null,c.scale,c.border)}else H(k.meta.last_commit_id,Base64.encode(k.getData()))});q?-this.getFile(y+"/"+A+"/"+J+"/"+K,mxUtils.bind(this,function(c){k.meta.last_commit_id=c.meta.last_commit_id;G()}),d):G()};GitLabClient.prototype.pickFolder=function(k){this.showGitLabDialog(!1,k,!0)};GitLabClient.prototype.pickFile=function(k){k=null!=k?k:mxUtils.bind(this,function(m){this.ui.loadFile("A"+encodeURIComponent(m))});this.showGitLabDialog(!0,k)};GitLabClient.prototype.showGitLabDialog=function(k,m,d){var q=null,u=null,y=null,A=null,J=document.createElement("div");J.style.whiteSpace="nowrap";-J.style.overflow="hidden";J.style.height="304px";var K=document.createElement("h3");mxUtils.write(K,mxResources.get(k?"selectFile":"selectFolder"));J.appendChild(K);var H=document.createElement("div");H.style.whiteSpace="nowrap";H.style.border="1px solid lightgray";H.style.boxSizing="border-box";H.style.padding="4px";H.style.overflow="auto";H.style.lineHeight="1.2em";H.style.height="274px";J.appendChild(H);var G=document.createElement("div");G.style.textOverflow="ellipsis";G.style.boxSizing="border-box";-G.style.overflow="hidden";G.style.padding="4px";G.style.width="100%";var c=new CustomDialog(this.ui,J,mxUtils.bind(this,function(){m(q+"/"+u+"/"+encodeURIComponent(y)+"/"+A)}));this.ui.showDialog(c.container,420,370,!0,!0);k&&c.okButton.parentNode.removeChild(c.okButton);var f=mxUtils.bind(this,function(L,D,T,N){var R=document.createElement("a");R.setAttribute("title",L);R.style.cursor="pointer";mxUtils.write(R,L);mxEvent.addListener(R,"click",D);N&&(R.style.textDecoration="underline");null!=T&&(L=-G.cloneNode(),L.style.padding=T,L.appendChild(R),R=L);return R}),l=mxUtils.bind(this,function(L){var D=document.createElement("div");D.style.marginBottom="8px";D.appendChild(f(q+"/"+u,mxUtils.bind(this,function(){A=null;F()}),null,!0));L||(mxUtils.write(D," / "),D.appendChild(f(decodeURIComponent(y),mxUtils.bind(this,function(){A=null;B()}),null,!0)));if(null!=A&&0<A.length){var T=A.split("/");for(L=0;L<T.length;L++)(function(N){mxUtils.write(D," / ");D.appendChild(f(T[N],mxUtils.bind(this,function(){A=-T.slice(0,N+1).join("/");x()}),null,!0))})(L)}H.appendChild(D)}),n=mxUtils.bind(this,function(L){this.ui.handleError(L,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(A=y=u=q=null,F()):this.ui.hideDialog()}))}),r=null,t=null,x=mxUtils.bind(this,function(L){null==L&&(H.innerText="",L=1);var D=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(q+"/"+u)+"/repository/tree?path="+A+"&ref="+y+"&per_page=100&page="+L,null,"GET");this.ui.spinner.spin(H,mxResources.get("loading"));-c.okButton.removeAttribute("disabled");null!=t&&(mxEvent.removeListener(H,"scroll",t),t=null);null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r);r=document.createElement("a");r.style.display="block";r.style.cursor="pointer";mxUtils.write(r,mxResources.get("more")+"...");var T=mxUtils.bind(this,function(){x(L+1)});mxEvent.addListener(r,"click",T);this.executeRequest(D,mxUtils.bind(this,function(N){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==L&&(l(!y),H.appendChild(f("../ [Up]",-mxUtils.bind(this,function(){if(""==A||null==A)A=null,F();else{var z=A.split("/");A=z.slice(0,z.length-1).join("/");x()}}),"4px")));var R=JSON.parse(N.getText());if(null==R||0==R.length)d||(mxUtils.br(H),mxUtils.write(H,mxResources.get("noFiles")));else{var P=!0,U=0,S=mxUtils.bind(this,function(z){for(var g=0;g<R.length;g++)mxUtils.bind(this,function(p){if(z==("tree"==p.type)){var v=G.cloneNode();v.style.backgroundColor=P?Editor.isDarkMode()?"#000000":"#eeeeee":"";P=!P;var C=document.createElement("img");-C.src=IMAGE_PATH+"/"+("tree"==p.type?"folder.png":"file.png");C.setAttribute("align","absmiddle");C.style.marginRight="4px";C.style.marginTop="-4px";C.width=20;v.appendChild(C);v.appendChild(f(p.name+("tree"==p.type?"/":""),mxUtils.bind(this,function(){"tree"==p.type?(A=p.path,x()):k&&"blob"==p.type&&(this.ui.hideDialog(),m(q+"/"+u+"/"+y+"/"+p.path))})));H.appendChild(v);U++}})(R[g])});S(!0);k&&S(!1);100==U&&(H.appendChild(r),t=function(){H.scrollTop>=H.scrollHeight-H.offsetHeight&&T()},mxEvent.addListener(H,-"scroll",t))}}))}),n,!0)}),B=mxUtils.bind(this,function(L,D){null==L&&(H.innerText="",L=1);var T=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(q+"/"+u)+"/repository/branches?per_page=100&page="+L,null,"GET");c.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(H,mxResources.get("loading"));null!=t&&(mxEvent.removeListener(H,"scroll",t),t=null);null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r);r=document.createElement("a");r.style.display="block";r.style.cursor=-"pointer";mxUtils.write(r,mxResources.get("more")+"...");var N=mxUtils.bind(this,function(){B(L+1)});mxEvent.addListener(r,"click",N);this.executeRequest(T,mxUtils.bind(this,function(R){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==L&&(l(!0),H.appendChild(f("../ [Up]",mxUtils.bind(this,function(){A=null;F()}),"4px")));var P=JSON.parse(R.getText());if(null==P||0==P.length)mxUtils.br(H),mxUtils.write(H,mxResources.get("repositoryNotFound"));else if(1==P.length&&D)y=P[0].name,-A="",x();else{for(var U=0;U<P.length;U++)mxUtils.bind(this,function(S,z){var g=G.cloneNode();g.style.backgroundColor=0==z%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";g.appendChild(f(S.name,mxUtils.bind(this,function(){y=encodeURIComponent(S.name);A="";x()})));H.appendChild(g)})(P[U],U);100==P.length&&(H.appendChild(r),t=function(){H.scrollTop>=H.scrollHeight-H.offsetHeight&&N()},mxEvent.addListener(H,"scroll",t))}}))}),n)});c.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(H,mxResources.get("loading"));-var F=mxUtils.bind(this,function(L){var D=this.ui.spinner,T=0;this.ui.spinner.stop();var N=function(){D.spin(H,mxResources.get("loading"));T+=1},R=function(){--T;0===T&&D.stop()};null==L&&(H.innerText="",L=1);null!=t&&(mxEvent.removeListener(H,"scroll",t),t=null);null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r);r=document.createElement("a");r.style.display="block";r.style.cursor="pointer";mxUtils.write(r,mxResources.get("more")+"...");var P=mxUtils.bind(this,function(){0===T&&F(L+1)});mxEvent.addListener(r,+y.split("/");this.getRefIndex(y,!0,mxUtils.bind(this,function(J,K){var F=Math.max(K-1,0),H=J.slice(0,F).join("/"),c=J[F],f=J[K];path=J.slice(K+1,J.length).join("/");0<path.length&&(path+="/");path+=k;this.checkExists(H+"/"+c+"/"+f+"/"+path,!0,mxUtils.bind(this,function(l,n){l?u?(A||(m=Base64.encode(m)),this.showCommitDialog(k,!0,mxUtils.bind(this,function(r){this.writeFile(H,c,f,path,r,m,n,mxUtils.bind(this,function(t){try{var x=JSON.parse(t.getText());d(this.createGitLabFile(H,c,f,null!=x.content?+x.content:x,u,K))}catch(B){q(B)}}),q)}),q)):(l=DRAWIO_GITLAB_URL+"/",d(new GitLabFile(this.ui,m,{org:H,repo:c,ref:f,name:k,path:path,html_url:l+H+"/"+c+"/blob/"+f+"/"+path,download_url:l+H+"/"+c+"/raw/"+f+"/"+path+"?inline=false",refPos:K,last_commit_id:n,isNew:!0}))):q()}))}),q,null,4>=y.length)};GitLabClient.prototype.checkExists=function(k,m,d){this.getFile(k,mxUtils.bind(this,function(q){if(m){var u=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[k]),function(){u();d(!0,q.getCurrentEtag())},+function(){u();d(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){d(!1)})}),mxUtils.bind(this,function(q){d(!0)}),null,!0)};GitLabClient.prototype.writeFile=function(k,m,d,q,u,y,A,J,K){if(y.length>=this.maxFileSize)K({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(y.length)+" / 10 MB)"});else{var F="POST";d={path:encodeURIComponent(q),branch:decodeURIComponent(d),commit_message:u,content:y,+encoding:"base64"};null!=A&&(d.last_commit_id=A,F="PUT");k=this.baseUrl+"/projects/"+encodeURIComponent(k+"/"+m)+"/repository/files/"+encodeURIComponent(q);F=new mxXmlRequest(k,JSON.stringify(d),F);this.executeRequest(F,mxUtils.bind(this,function(H){J(H)}),K)}};GitLabClient.prototype.saveFile=function(k,m,d,q,u){var y=k.meta.org,A=k.meta.repo,J=k.meta.ref,K=k.meta.path,F=mxUtils.bind(this,function(c,f){this.writeFile(y,A,J,K,u,f,c,mxUtils.bind(this,function(l){delete k.meta.isNew;this.getFile(y+"/"++A+"/"+J+"/"+K,mxUtils.bind(this,function(n){n.getData()==k.getData()?m(n.getCurrentEtag()):m({content:k.getCurrentEtag()})}),d,null,null,k.meta.refPos)}),d)}),H=mxUtils.bind(this,function(){if(Editor.useCanvasForExport&&/(\.png)$/i.test(K)){var c=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(f){F(k.meta.last_commit_id,f)}),d,this.ui.getCurrentFile()!=k?k.getData():null,c.scale,c.border)}else F(k.meta.last_commit_id,Base64.encode(k.getData()))});q?+this.getFile(y+"/"+A+"/"+J+"/"+K,mxUtils.bind(this,function(c){k.meta.last_commit_id=c.meta.last_commit_id;H()}),d):H()};GitLabClient.prototype.pickFolder=function(k){this.showGitLabDialog(!1,k,!0)};GitLabClient.prototype.pickFile=function(k){k=null!=k?k:mxUtils.bind(this,function(m){this.ui.loadFile("A"+encodeURIComponent(m))});this.showGitLabDialog(!0,k)};GitLabClient.prototype.showGitLabDialog=function(k,m,d){var q=null,u=null,y=null,A=null,J=document.createElement("div");J.style.whiteSpace="nowrap";+J.style.overflow="hidden";J.style.height="304px";var K=document.createElement("h3");mxUtils.write(K,mxResources.get(k?"selectFile":"selectFolder"));J.appendChild(K);var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.border="1px solid lightgray";F.style.boxSizing="border-box";F.style.padding="4px";F.style.overflow="auto";F.style.lineHeight="1.2em";F.style.height="274px";J.appendChild(F);var H=document.createElement("div");H.style.textOverflow="ellipsis";H.style.boxSizing="border-box";+H.style.overflow="hidden";H.style.padding="4px";H.style.width="100%";var c=new CustomDialog(this.ui,J,mxUtils.bind(this,function(){m(q+"/"+u+"/"+encodeURIComponent(y)+"/"+A)}));this.ui.showDialog(c.container,420,370,!0,!0);k&&c.okButton.parentNode.removeChild(c.okButton);var f=mxUtils.bind(this,function(L,D,T,N){var R=document.createElement("a");R.setAttribute("title",L);R.style.cursor="pointer";mxUtils.write(R,L);mxEvent.addListener(R,"click",D);N&&(R.style.textDecoration="underline");null!=T&&(L=+H.cloneNode(),L.style.padding=T,L.appendChild(R),R=L);return R}),l=mxUtils.bind(this,function(L){var D=document.createElement("div");D.style.marginBottom="8px";D.appendChild(f(q+"/"+u,mxUtils.bind(this,function(){A=null;G()}),null,!0));L||(mxUtils.write(D," / "),D.appendChild(f(decodeURIComponent(y),mxUtils.bind(this,function(){A=null;B()}),null,!0)));if(null!=A&&0<A.length){var T=A.split("/");for(L=0;L<T.length;L++)(function(N){mxUtils.write(D," / ");D.appendChild(f(T[N],mxUtils.bind(this,function(){A=+T.slice(0,N+1).join("/");x()}),null,!0))})(L)}F.appendChild(D)}),n=mxUtils.bind(this,function(L){this.ui.handleError(L,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(A=y=u=q=null,G()):this.ui.hideDialog()}))}),r=null,t=null,x=mxUtils.bind(this,function(L){null==L&&(F.innerText="",L=1);var D=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(q+"/"+u)+"/repository/tree?path="+A+"&ref="+y+"&per_page=100&page="+L,null,"GET");this.ui.spinner.spin(F,mxResources.get("loading"));+c.okButton.removeAttribute("disabled");null!=t&&(mxEvent.removeListener(F,"scroll",t),t=null);null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r);r=document.createElement("a");r.style.display="block";r.style.cursor="pointer";mxUtils.write(r,mxResources.get("more")+"...");var T=mxUtils.bind(this,function(){x(L+1)});mxEvent.addListener(r,"click",T);this.executeRequest(D,mxUtils.bind(this,function(N){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==L&&(l(!y),F.appendChild(f("../ [Up]",+mxUtils.bind(this,function(){if(""==A||null==A)A=null,G();else{var z=A.split("/");A=z.slice(0,z.length-1).join("/");x()}}),"4px")));var R=JSON.parse(N.getText());if(null==R||0==R.length)d||(mxUtils.br(F),mxUtils.write(F,mxResources.get("noFiles")));else{var P=!0,U=0,S=mxUtils.bind(this,function(z){for(var g=0;g<R.length;g++)mxUtils.bind(this,function(p){if(z==("tree"==p.type)){var v=H.cloneNode();v.style.backgroundColor=P?Editor.isDarkMode()?"#000000":"#eeeeee":"";P=!P;var C=document.createElement("img");+C.src=IMAGE_PATH+"/"+("tree"==p.type?"folder.png":"file.png");C.setAttribute("align","absmiddle");C.style.marginRight="4px";C.style.marginTop="-4px";C.width=20;v.appendChild(C);v.appendChild(f(p.name+("tree"==p.type?"/":""),mxUtils.bind(this,function(){"tree"==p.type?(A=p.path,x()):k&&"blob"==p.type&&(this.ui.hideDialog(),m(q+"/"+u+"/"+y+"/"+p.path))})));F.appendChild(v);U++}})(R[g])});S(!0);k&&S(!1);100==U&&(F.appendChild(r),t=function(){F.scrollTop>=F.scrollHeight-F.offsetHeight&&T()},mxEvent.addListener(F,+"scroll",t))}}))}),n,!0)}),B=mxUtils.bind(this,function(L,D){null==L&&(F.innerText="",L=1);var T=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(q+"/"+u)+"/repository/branches?per_page=100&page="+L,null,"GET");c.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(F,mxResources.get("loading"));null!=t&&(mxEvent.removeListener(F,"scroll",t),t=null);null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r);r=document.createElement("a");r.style.display="block";r.style.cursor=+"pointer";mxUtils.write(r,mxResources.get("more")+"...");var N=mxUtils.bind(this,function(){B(L+1)});mxEvent.addListener(r,"click",N);this.executeRequest(T,mxUtils.bind(this,function(R){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==L&&(l(!0),F.appendChild(f("../ [Up]",mxUtils.bind(this,function(){A=null;G()}),"4px")));var P=JSON.parse(R.getText());if(null==P||0==P.length)mxUtils.br(F),mxUtils.write(F,mxResources.get("repositoryNotFound"));else if(1==P.length&&D)y=P[0].name,+A="",x();else{for(var U=0;U<P.length;U++)mxUtils.bind(this,function(S,z){var g=H.cloneNode();g.style.backgroundColor=0==z%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";g.appendChild(f(S.name,mxUtils.bind(this,function(){y=encodeURIComponent(S.name);A="";x()})));F.appendChild(g)})(P[U],U);100==P.length&&(F.appendChild(r),t=function(){F.scrollTop>=F.scrollHeight-F.offsetHeight&&N()},mxEvent.addListener(F,"scroll",t))}}))}),n)});c.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(F,mxResources.get("loading"));+var G=mxUtils.bind(this,function(L){var D=this.ui.spinner,T=0;this.ui.spinner.stop();var N=function(){D.spin(F,mxResources.get("loading"));T+=1},R=function(){--T;0===T&&D.stop()};null==L&&(F.innerText="",L=1);null!=t&&(mxEvent.removeListener(F,"scroll",t),t=null);null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r);r=document.createElement("a");r.style.display="block";r.style.cursor="pointer";mxUtils.write(r,mxResources.get("more")+"...");var P=mxUtils.bind(this,function(){0===T&&G(L+1)});mxEvent.addListener(r,"click",P);var U=mxUtils.bind(this,function(z){N();var g=new mxXmlRequest(this.baseUrl+"/groups?per_page=100",null,"GET");this.executeRequest(g,mxUtils.bind(this,function(p){this.ui.tryAndHandle(mxUtils.bind(this,function(){z(JSON.parse(p.getText()));R()}))}),n)}),S=mxUtils.bind(this,function(z,g){N();var p=new mxXmlRequest(this.baseUrl+"/groups/"+z.id+"/projects?per_page=100",null,"GET");this.executeRequest(p,mxUtils.bind(this,function(v){this.ui.tryAndHandle(mxUtils.bind(this,function(){404==v.getStatus()?-g(z,[]):g(z,JSON.parse(v.getText()));R()}))}),n,!0)});U(mxUtils.bind(this,function(z){if(null==this.user)mxUtils.write(H,mxResources.get("loggedOut"));else{N();var g=new mxXmlRequest(this.baseUrl+"/users/"+this.user.id+"/projects?per_page=100&page="+L,null,"GET");this.executeRequest(g,mxUtils.bind(this,function(p){p=JSON.parse(p.getText());if(null!=p&&0!=p.length||null!=z&&0!=z.length){1==L&&(H.appendChild(f(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){if(0===T){var E=new FilenameDialog(this.ui,-"group/project",mxResources.get("ok"),mxUtils.bind(this,function(I){null!=I&&(I=I.split("/"),1<I.length?(q=I.slice(0,I.length-1).join("/"),u=I[I.length-1],A="",B(null,!0)):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(E.container,300,80,!0,!1);E.init()}}))),mxUtils.br(H),mxUtils.br(H));for(var v=!0,C=0;C<p.length;C++)mxUtils.bind(this,function(E){var I=G.cloneNode();I.style.backgroundColor=v?Editor.isDarkMode()?-"#000000":"#eeeeee":"";v=!v;I.appendChild(f(E.name_with_namespace,mxUtils.bind(this,function(){0===T&&(q=E.owner.username,u=E.path,A="",B(null,!0))})));H.appendChild(I)})(p[C]);for(C=0;C<z.length;C++)N(),S(z[C],mxUtils.bind(this,function(E,I){R();for(var O=0;O<I.length;O++){var Q=G.cloneNode();Q.style.backgroundColor=v?Editor.isDarkMode()?"#000000":"#eeeeee":"";v=!v;mxUtils.bind(this,function(V){Q.appendChild(f(V.name_with_namespace,mxUtils.bind(this,function(){0===T&&(q=E.full_path,u=V.path,A="",-B(null,!0))})));H.appendChild(Q)})(I[O])}}));R()}else R(),mxUtils.br(H),mxUtils.write(H,mxResources.get("repositoryNotFound"));100==p.length&&(H.appendChild(r),t=function(){H.scrollTop>=H.scrollHeight-H.offsetHeight&&P()},mxEvent.addListener(H,"scroll",t))}),n)}}))});b?this.user?F():this.updateUser(function(){F()},n,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){F()},n,!0)}),n)};GitLabClient.prototype.logout=function(){this.ui.editor.loadUrl(this.redirectUri+"?doLogout=1&state="++g(z,[]):g(z,JSON.parse(v.getText()));R()}))}),n,!0)});U(mxUtils.bind(this,function(z){if(null==this.user)mxUtils.write(F,mxResources.get("loggedOut"));else{N();var g=new mxXmlRequest(this.baseUrl+"/users/"+this.user.id+"/projects?per_page=100&page="+L,null,"GET");this.executeRequest(g,mxUtils.bind(this,function(p){p=JSON.parse(p.getText());if(null!=p&&0!=p.length||null!=z&&0!=z.length){1==L&&(F.appendChild(f(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){if(0===T){var E=new FilenameDialog(this.ui,+"group/project",mxResources.get("ok"),mxUtils.bind(this,function(I){null!=I&&(I=I.split("/"),1<I.length?(q=I.slice(0,I.length-1).join("/"),u=I[I.length-1],A="",B(null,!0)):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(E.container,300,80,!0,!1);E.init()}}))),mxUtils.br(F),mxUtils.br(F));for(var v=!0,C=0;C<p.length;C++)mxUtils.bind(this,function(E){var I=H.cloneNode();I.style.backgroundColor=v?Editor.isDarkMode()?+"#000000":"#eeeeee":"";v=!v;I.appendChild(f(E.name_with_namespace,mxUtils.bind(this,function(){0===T&&(q=E.owner.username,u=E.path,A="",B(null,!0))})));F.appendChild(I)})(p[C]);for(C=0;C<z.length;C++)N(),S(z[C],mxUtils.bind(this,function(E,I){R();for(var O=0;O<I.length;O++){var Q=H.cloneNode();Q.style.backgroundColor=v?Editor.isDarkMode()?"#000000":"#eeeeee":"";v=!v;mxUtils.bind(this,function(V){Q.appendChild(f(V.name_with_namespace,mxUtils.bind(this,function(){0===T&&(q=E.full_path,u=V.path,A="",+B(null,!0))})));F.appendChild(Q)})(I[O])}}));R()}else R(),mxUtils.br(F),mxUtils.write(F,mxResources.get("repositoryNotFound"));100==p.length&&(F.appendChild(r),t=function(){F.scrollTop>=F.scrollHeight-F.offsetHeight&&P()},mxEvent.addListener(F,"scroll",t))}),n)}}))});b?this.user?G():this.updateUser(function(){G()},n,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){G()},n,!0)}),n)};GitLabClient.prototype.logout=function(){this.ui.editor.loadUrl(this.redirectUri+"?doLogout=1&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host));this.clearPersistentToken();this.setUser(null);b=null;this.setToken(null)}})();DrawioComment=function(b,k,m,d,q,u,y){this.file=b;this.id=k;this.content=m;this.modifiedDate=d;this.createdDate=q;this.isResolved=u;this.user=y;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,k,m,d,q){k()};DrawioComment.prototype.editComment=function(b,k,m){k()};DrawioComment.prototype.deleteComment=function(b,k){b()};DriveComment=function(b,k,m,d,q,u,y,A){DrawioComment.call(this,b,k,m,d,q,u,y);this.pCommentId=A};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(b,k,m,d,q){b={content:b.content};d?b.verb="resolve":q&&(b.verb="reopen");this.file.ui.drive.executeRequest({url:"/files/"+this.file.getId()+"/comments/"+this.id+"/replies",params:b,method:"POST"},mxUtils.bind(this,function(u){k(u.replyId)}),m)};DriveComment.prototype.editComment=function(b,k,m){this.content=b;b={content:b};this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,params:b,method:"PATCH"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,params:b,method:"PATCH"},k,m)};-DriveComment.prototype.deleteComment=function(b,k){this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,method:"DELETE"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,method:"DELETE"},b,k)};function mxODPicker(b,k,m,d,q,u,y,A,J,K,H,G,c,f){function l(W,M){M=M||document;return M.querySelector(W)}function n(W,M,X){if(null==W["@microsoft.graph.downloadUrl"])if(null==W.parentReference)X();else{d(W.id,W.parentReference.driveId,function(aa){n(aa,M,X)},X);return}var Z=new XMLHttpRequest;Z.open("GET",W["@microsoft.graph.downloadUrl"]);var Y=W.file?"image/png"==W.file.mimeType:!1;Z.onreadystatechange=function(){if(4==this.readyState){if(200<=this.status&&299>=this.status)try{var aa=Z.responseText;+DriveComment.prototype.deleteComment=function(b,k){this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,method:"DELETE"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,method:"DELETE"},b,k)};function mxODPicker(b,k,m,d,q,u,y,A,J,K,F,H,c,f){function l(W,M){M=M||document;return M.querySelector(W)}function n(W,M,X){if(null==W["@microsoft.graph.downloadUrl"])if(null==W.parentReference)X();else{d(W.id,W.parentReference.driveId,function(aa){n(aa,M,X)},X);return}var Z=new XMLHttpRequest;Z.open("GET",W["@microsoft.graph.downloadUrl"]);var Y=W.file?"image/png"==W.file.mimeType:!1;Z.onreadystatechange=function(){if(4==this.readyState){if(200<=this.status&&299>=this.status)try{var aa=Z.responseText;Y?(aa="data:image/png;base64,"+Editor.base64Encode(aa),aa=Editor.extractGraphModelFromPng(aa)):/\.pdf$/.test(W.name)&&(aa="data:application/pdf;base64,"+Editor.base64Encode(aa),aa=Editor.extractGraphModelFromPdf(aa));var da=mxUtils.parseXml(aa),ba="mxlibrary"==da.documentElement.nodeName?da.documentElement:Editor.extractGraphModel(da.documentElement);if(null!=ba){M(ba.ownerDocument);return}}catch(ha){}X()}};(Y||/\.pdf$/.test(W.name))&&Z.overrideMimeType&&Z.overrideMimeType("text/plain; charset=x-user-defined");-Z.send()}function r(){null!=S&&null!=S.remoteItem&&(S=S.remoteItem);G&&null!=U?P.exportToCanvas(function(W){W=EditorUi.prototype.createImageDataUri(W,null,"png");y(S,W);u(S)},400,null,null,function(W){console.log(W)},600,null,null,null,null,null,U):(y(S,void 0),u(S))}function t(W){function M(X){O.style.background="transparent";O.innerText="";var Z=document.createElement("div");Z.className="odPreviewStatus";mxUtils.write(Z,X);O.appendChild(Z);R.stop()}if(null!=O)if(O.style.background="transparent",+Z.send()}function r(){null!=S&&null!=S.remoteItem&&(S=S.remoteItem);H&&null!=U?P.exportToCanvas(function(W){W=EditorUi.prototype.createImageDataUri(W,null,"png");y(S,W);u(S)},400,null,null,function(W){console.log(W)},600,null,null,null,null,null,U):(y(S,void 0),u(S))}function t(W){function M(X){O.style.background="transparent";O.innerText="";var Z=document.createElement("div");Z.className="odPreviewStatus";mxUtils.write(Z,X);O.appendChild(Z);R.stop()}if(null!=O)if(O.style.background="transparent",O.innerText="",null==W||W.folder||/\.drawiolib$/.test(W.name))M(mxResources.get("noPreview"));else try{null!=W.remoteItem&&(W=W.remoteItem),C=W,R.spin(O),n(W,function(X){R.stop();if(C==W)if("mxlibrary"==X.documentElement.nodeName)M(mxResources.get("noPreview"));else{var Z=X.getElementsByTagName("diagram");U=AspectDialog.prototype.createViewer(O,0==Z.length?X.documentElement:Z[0],null,"transparent")}},function(){S=null;M(mxResources.get("notADiagramFile"))})}catch(X){S=null,M(mxResources.get("notADiagramFile"))}}-function x(){var W=l(".odFilesBreadcrumb");if(null!=W){W.innerText="";for(var M=0;M<p.length-1;M++){var X=document.createElement("span");X.className="odBCFolder";X.innerHTML=mxUtils.htmlEntities(p[M].name||mxResources.get("home"));W.appendChild(X);(function(Y,aa){X.addEventListener("click",function(){k(null);p=p.slice(0,aa);F(Y.driveId,Y.folderId,Y.siteId,Y.name)})})(p[M],M);var Z=document.createElement("span");Z.innerHTML=" > ";W.appendChild(Z)}null!=p[p.length-1]&&(M=document.createElement("span"),-M.innerHTML=mxUtils.htmlEntities(1==p.length?mxResources.get(J?"selectFolder":"officeSelDiag"):p[p.length-1].name||mxResources.get("home")),W.appendChild(M))}}function B(){if(null!=S&&!g)if("sharepoint"==z)F("site",null,S.id,S.displayName);else if("site"==z)F("subsite",null,S.id,S.name);else{var W=S.folder;S=S.remoteItem?S.remoteItem:S;var M=(S.parentReference?S.parentReference.driveId:null)||z,X=S.id;W?F(M,X,null,S.name):r()}}function F(W,M,X,Z,Y){function aa(Aa){R.stop();var Da=document.createElement("table");+function x(){var W=l(".odFilesBreadcrumb");if(null!=W){W.innerText="";for(var M=0;M<p.length-1;M++){var X=document.createElement("span");X.className="odBCFolder";X.innerHTML=mxUtils.htmlEntities(p[M].name||mxResources.get("home"));W.appendChild(X);(function(Y,aa){X.addEventListener("click",function(){k(null);p=p.slice(0,aa);G(Y.driveId,Y.folderId,Y.siteId,Y.name)})})(p[M],M);var Z=document.createElement("span");Z.innerHTML=" > ";W.appendChild(Z)}null!=p[p.length-1]&&(M=document.createElement("span"),+M.innerHTML=mxUtils.htmlEntities(1==p.length?mxResources.get(J?"selectFolder":"officeSelDiag"):p[p.length-1].name||mxResources.get("home")),W.appendChild(M))}}function B(){if(null!=S&&!g)if("sharepoint"==z)G("site",null,S.id,S.displayName);else if("site"==z)G("subsite",null,S.id,S.name);else{var W=S.folder;S=S.remoteItem?S.remoteItem:S;var M=(S.parentReference?S.parentReference.driveId:null)||z,X=S.id;W?G(M,X,null,S.name):r()}}function G(W,M,X,Z,Y){function aa(Aa){R.stop();var Da=document.createElement("table");Da.className="odFileListGrid";for(var Ca=null,ca=0,fa=0;null!=Aa&&fa<Aa.length;fa++){var oa=Aa[fa];if(1!=ha||!oa.webUrl||0<oa.webUrl.indexOf("sharepoint.com/sites/")||0>oa.webUrl.indexOf("sharepoint.com/")){var pa=oa.displayName||oa.name,ua=mxUtils.htmlEntities(oa.description||pa);ha&&(oa.folder=2==ha?{isRoot:!0}:!0);var ya=null!=oa.folder;if(!J||ya){var ia=document.createElement("tr");ia.className=ca++%2?"odOddRow":"odEvenRow";var ka=document.createElement("td");ka.style.width="36px";var ea=document.createElement("img");ea.src="/images/"+(ya?"folder.png":"file.png");ea.className="odFileImg";ka.appendChild(ea);ia.appendChild(ka);ka=document.createElement("td");ya=document.createElement("div");ya.className="odFileTitle";ya.innerHTML=mxUtils.htmlEntities(pa);ya.setAttribute("title",ua);ka.appendChild(ya);ia.appendChild(ka);Da.appendChild(ia);null==Ca&&(Ca=ia,Ca.className+=" odRowSelected",S=oa,z=W,f||k(S));(function(ja,ta){ia.addEventListener("dblclick",B);ia.addEventListener("click",function(){Ca!=ta&&(Ca.className=Ca.className.replace("odRowSelected",""),Ca=ta,Ca.className+=" odRowSelected",S=ja,z=W,f||k(S))})})(oa,ia)}}}0==ca?(Aa=document.createElement("div"),Aa.className="odEmptyFolder",Aa.innerHTML=mxUtils.htmlEntities(1==ha&&Y?mxResources.get("noResultsFor",[Y],"No results for '"+Y+"'"):mxResources.get("folderEmpty",null,"Folder is empty!")),ra.appendChild(Aa)):ra.appendChild(Da);x();g=!1}function da(Aa){m(Aa?Aa:qa,function(Da){if(ba){var Ca=Da.value||[];if(f||ha)Array.prototype.push.apply(Ba,Ca);else{for(var ca=@@ -14946,14 +14950,14 @@ Ca.className.replace("odRowSelected",""),Ca=ta,Ca.className+=" odRowSelected",S=null!=O&&(O.innerText="",O.style.top="50%");var ba=g=!0,ha=0;v=arguments;var la=setTimeout(function(){g=ba=!1;R.stop();A(mxResources.get("timeout"))},2E4),ra=l(".odFilesList");ra.innerText="";R.spin(ra);switch(W){case "recent":p=[{name:mxResources.get("recent",null,"Recent"),driveId:W}];var sa=q()||{},va=[],wa;for(wa in sa)va.push(sa[wa]);clearTimeout(la);aa(va);return;case "shared":var qa="/me/drive/sharedWithMe";p=[{name:mxResources.get("sharedWithMe",null,"Shared With Me"),driveId:W}];break;case "sharepoint":qa="/sites?search="+(null!=Y?encodeURIComponent(Y):"");p=[{name:mxResources.get("sharepointSites",null,"Sharepoint Sites"),driveId:W}];ha=1;break;case "site":p.push({name:Z,driveId:W,folderId:M,siteId:X});qa="/sites/"+X+"/drives";ha=2;break;case "subsite":p.push({name:Z,driveId:W,folderId:M,siteId:X});qa="/drives/"+X+(M?"/items/"+M:"/root")+"/children";break;case "search":W=z;p=[{driveId:W,name:mxResources.get("back",null,"Back")}];Y=encodeURIComponent(Y.replace(/'/g,"\\'"));qa=W?"/drives/"+W+"/root/search(q='"+Y+"')":"/me/drive/root/search(q='"+Y+"')";break;default:null==M?p=[{driveId:W}]:p.push({name:Z,driveId:W,folderId:M}),qa=(W?"/drives/"+W:"/me/drive")+(M?"/items/"+M:"/root")+"/children"}ha||(qa+=(0<qa.indexOf("?")?"&":"?")+"select=id,name,description,parentReference,file,createdBy,lastModifiedBy,lastModifiedDateTime,size,folder,remoteItem,@microsoft.graph.downloadUrl");var Ba=[];da()}}function L(W){Q.className=Q.className.replace("odCatSelected","");Q=W;Q.className+=" odCatSelected"}function D(W){V=-null;null!=v&&"sharepoint"==v[0]&&(g?V=setTimeout(function(){D(W)},500):F("sharepoint",null,null,null,W))}var T="";null==k&&(k=t,T='<div style="text-align: center;" class="odPreview"></div>');null==q&&(q=function(){var W=null;try{W=JSON.parse(localStorage.getItem("mxODPickerRecentList"))}catch(M){}return W});null==u&&(u=function(W){if(null!=W){var M=q()||{};delete W["@microsoft.graph.downloadUrl"];M[W.id]=W;localStorage.setItem("mxODPickerRecentList",JSON.stringify(M))}});T='<div class="odCatsList"><div class="odCatsListLbl">OneDrive</div><div id="odFiles" class="odCatListTitle odCatSelected">'++null;null!=v&&"sharepoint"==v[0]&&(g?V=setTimeout(function(){D(W)},500):G("sharepoint",null,null,null,W))}var T="";null==k&&(k=t,T='<div style="text-align: center;" class="odPreview"></div>');null==q&&(q=function(){var W=null;try{W=JSON.parse(localStorage.getItem("mxODPickerRecentList"))}catch(M){}return W});null==u&&(u=function(W){if(null!=W){var M=q()||{};delete W["@microsoft.graph.downloadUrl"];M[W.id]=W;localStorage.setItem("mxODPickerRecentList",JSON.stringify(M))}});T='<div class="odCatsList"><div class="odCatsListLbl">OneDrive</div><div id="odFiles" class="odCatListTitle odCatSelected">'+mxUtils.htmlEntities(mxResources.get("files"))+'</div><div id="odRecent" class="odCatListTitle">'+mxUtils.htmlEntities(mxResources.get("recent"))+'</div><div id="odShared" class="odCatListTitle">'+mxUtils.htmlEntities(mxResources.get("shared"))+'</div><div id="odSharepoint" class="odCatListTitle">'+mxUtils.htmlEntities(mxResources.get("sharepoint"))+'</div></div><div class="odFilesSec"><div class="searchBar" style="display:none"><input type="search" id="odSearchBox" placeholder="'+mxUtils.htmlEntities(mxResources.get("search"))+-'"></div><div class="odFilesBreadcrumb"></div><div id="refreshOD" class="odRefreshButton"><img class="geAdaptiveAsset" src="/images/update32.png" width="16" height="16" title="'+mxUtils.htmlEntities(mxResources.get("refresh"))+'Refresh" border="0"/></div><div class="odFilesList"></div></div>'+T+(K?'<div id="odBackBtn" class="odLinkBtn">< '+mxUtils.htmlEntities(mxResources.get("back"))+"</div>":"")+(H?'<button id="odSubmitBtn" class="odSubmitBtn">'+mxUtils.htmlEntities(mxResources.get(J?"select":+'"></div><div class="odFilesBreadcrumb"></div><div id="refreshOD" class="odRefreshButton"><img class="geAdaptiveAsset" src="/images/update32.png" width="16" height="16" title="'+mxUtils.htmlEntities(mxResources.get("refresh"))+'Refresh" border="0"/></div><div class="odFilesList"></div></div>'+T+(K?'<div id="odBackBtn" class="odLinkBtn">< '+mxUtils.htmlEntities(mxResources.get("back"))+"</div>":"")+(F?'<button id="odSubmitBtn" class="odSubmitBtn">'+mxUtils.htmlEntities(mxResources.get(J?"select":"open"))+"</button>":"");var N=null!=window.Editor&&null!=Editor.isDarkMode&&Editor.isDarkMode();N=".odCatsList *, .odFilesSec * { user-select: none; }.odCatsList {\tbox-sizing: border-box;\tposition:absolute;\ttop:0px;\tbottom:50%;\twidth:30%;\tborder: 1px solid #CCCCCC;\tborder-bottom:none;\tdisplay: inline-block;\toverflow-x: hidden;\toverflow-y: auto;}.odCatsListLbl {\theight: 17px;\tcolor: #6D6D6D;\tfont-size: 14px;\tfont-weight: bold;\tline-height: 17px;\tmargin: 10px 0 3px 5px;}.odFilesSec {\tbox-sizing: border-box;\tposition:absolute;\tleft:30%;\ttop:0px;\tbottom:50%;\twidth: 70%;\tborder: 1px solid #CCCCCC;\tborder-left:none;\tborder-bottom:none;\tdisplay: inline-block;\toverflow: hidden;}.odFilesBreadcrumb {\tbox-sizing: border-box;\tposition:absolute;\tmin-height: 32px;\tleft:0px;\tright:20px;\ttext-overflow:ellipsis;\toverflow:hidden;\tfont-size: 13px;\tcolor: #6D6D6D;\tpadding: 5px;}.odRefreshButton {\tbox-sizing: border-box;\tposition:absolute;\tright:0px;\ttop:0px;\tpadding: 4px;\tmargin: 1px;\theight:24px;\tcursor:default;}.odRefreshButton>img {\topacity:0.5;}.odRefreshButton:hover {\tbackground-color:#ddd;\tborder-radius:50%;}.odRefreshButton:active {\topacity:0.7;}.searchBar {\tposition:absolute;\ttop:4px;\tright:30px;\tz-index:1;}.searchBar > input {\tbox-sizing: border-box;\twidth: 140px;\tfont-size: 13px;}.odFilesList {\tbox-sizing: border-box;\tposition:absolute;\ttop:32px;\tbottom:0px;\twidth: 100%;\toverflow-x: hidden;\toverflow-y: auto;}.odFileImg {\twidth: 24px;\tpadding-left: 5px;\tpadding-right: 5px;}.odFileTitle {\tcursor: default;\tfont-weight: normal;\tcolor: #666666 !important;\twidth: calc(100% - 20px);\twhite-space: nowrap;\toverflow: hidden;\ttext-overflow: ellipsis;}.odFileListGrid {\twidth: 100%;\twhite-space: nowrap;\tfont-size: 13px; box-sizing: border-box; border-spacing: 0;}.odOddRow {"+(N?"":"\tbackground-color: #eeeeee;")+"}.odEvenRow {"+(N?"":"\tbackground-color: #FFFFFF;")+"}.odRowSelected {\tbackground-color: #cadfff;}.odCatListTitle {\tbox-sizing: border-box;\theight: 17px;\tcursor: default;\tcolor: #666666;\tfont-size: 14px;\tline-height: 17px;\tmargin: 5px 0 5px 0px; padding-left: 10px;}.odCatSelected {\tfont-weight: bold;\tbackground-color: #cadfff;}.odEmptyFolder {\theight: 17px;\tcolor: #6D6D6D;\tfont-size: 14px;\tfont-weight: bold;\tline-height: 17px;\tmargin: 10px 0 3px 5px;\twidth: 100%; text-align: center;}.odBCFolder {\tcursor: pointer;\tcolor: #0432ff;}.odPreviewStatus {\tposition:absolute;\ttext-align:center;\twidth:100%;\ttop:50%;\ttransform: translateY(-50%);\tfont-size:13px;\topacity:0.5;}.odPreview { position:absolute;\t overflow:hidden;\t border: 1px solid #CCCCCC; bottom:0px; top: 50%; left:0px; right:0px;}.odLinkBtn { position: absolute;\tfont-size: 12px;\tcursor: pointer;\tcolor: #6D6D6D;\tleft: 5px;\tbottom: 3px;}.odSubmitBtn { position: absolute;\tcolor: #333;\tright: 5px;\tbottom: 5px;}";var R=new Spinner({left:"50%",lines:12,length:8,width:3,radius:5,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9}),P=new Editor,U=null,S=null,z=null,g=!1,p=[],v=null,C=null;this.getSelectedItem=function(){null!=S&&(S=S.remoteItem?S.remoteItem:S,u(S));return S};if(null==l("#mxODPickerCss")){var E=document.head||document.getElementsByTagName("head")[0],I=document.createElement("style");E.appendChild(I);I.type="text/css";I.id="mxODPickerCss";-I.appendChild(document.createTextNode(N))}b.innerHTML=T;var O=l(".odPreview"),Q=l("#odFiles");b=function(W,M){M=M||document;return M.querySelectorAll(W)}(".odCatListTitle");for(T=0;T<b.length;T++)b[T].addEventListener("click",function(){S=C=null;if(!g)switch(L(this),this.id){case "odFiles":F();break;case "odRecent":F("recent");break;case "odShared":F("shared");break;case "odSharepoint":F("sharepoint")}});var V=null;b=l("#odSearchBox");b.addEventListener("input",function(){var W=this.value;null!=V&&-clearTimeout(V);V=setTimeout(function(){D(W)},500)});b.addEventListener("keyup",function(W){13==W.keyCode&&(null!=V&&clearTimeout(V),D(this.value))});l("#refreshOD").addEventListener("click",function(){if(null!=v){k(null);var W=p.slice();F.apply(this,v);p=W}});K&&l("#odBackBtn").addEventListener("click",K);H&&l("#odSubmitBtn").addEventListener("click",r);null!=c?(K=c.pop(),"sharepoint"==c[0].driveId&&L(l("#odSharepoint")),p=c,F(K.driveId,K.folderId,K.siteId,K.name)):F()};App=function(b,k,m){EditorUi.call(this,b,k,null!=m?m:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(){var d=this.getCurrentFile();null!=d&&EditorUi.logEvent({category:(this.editor.autosave?"ON":"OFF")+"-AUTOSAVE-FILE-"+d.getHash(),action:"changed",label:"autosave_"+(this.editor.autosave?"on":"off")})}));mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII=":+I.appendChild(document.createTextNode(N))}b.innerHTML=T;var O=l(".odPreview"),Q=l("#odFiles");b=function(W,M){M=M||document;return M.querySelectorAll(W)}(".odCatListTitle");for(T=0;T<b.length;T++)b[T].addEventListener("click",function(){S=C=null;if(!g)switch(L(this),this.id){case "odFiles":G();break;case "odRecent":G("recent");break;case "odShared":G("shared");break;case "odSharepoint":G("sharepoint")}});var V=null;b=l("#odSearchBox");b.addEventListener("input",function(){var W=this.value;null!=V&&+clearTimeout(V);V=setTimeout(function(){D(W)},500)});b.addEventListener("keyup",function(W){13==W.keyCode&&(null!=V&&clearTimeout(V),D(this.value))});l("#refreshOD").addEventListener("click",function(){if(null!=v){k(null);var W=p.slice();G.apply(this,v);p=W}});K&&l("#odBackBtn").addEventListener("click",K);F&&l("#odSubmitBtn").addEventListener("click",r);null!=c?(K=c.pop(),"sharepoint"==c[0].driveId&&L(l("#odSharepoint")),p=c,G(K.driveId,K.folderId,K.siteId,K.name)):G()};App=function(b,k,m){EditorUi.call(this,b,k,null!=m?m:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(){var d=this.getCurrentFile();null!=d&&EditorUi.logEvent({category:(this.editor.autosave?"ON":"OFF")+"-AUTOSAVE-FILE-"+d.getHash(),action:"changed",label:"autosave_"+(this.editor.autosave?"on":"off")})}));mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII=":(new Image).src=mxGraph.prototype.warningImage.src;window.geOpenWindow=mxUtils.bind(this,function(d,q,u){if("1"==urlParams.openInSameWin||navigator.standalone)null!=u&&u();else{var y=null;try{y=window.open(d)}catch(A){}null==y||void 0===y?this.showDialog((new PopupDialog(this,d,q,u)).container,340,140,!0,!0):null!=q&&q()}});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(d){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(d)});this.editor.chromeless&&!this.editor.editable||this.addFileDropHandler([document]);if(null!=App.DrawPlugins){for(b=0;b<App.DrawPlugins.length;b++)try{App.DrawPlugins[b](this)}catch(d){null!=window.console&&console.log("Plugin Error:",d,App.DrawPlugins[b])}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}window.Draw.loadPlugin=mxUtils.bind(this,function(d){try{d(this)}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}});setTimeout(mxUtils.bind(this,function(){0<App.embedModePluginsCount&&(App.embedModePluginsCount=0,this.initializeEmbedMode())}),5E3)}this.load()};App.ERROR_TIMEOUT="timeout";App.ERROR_BUSY="busy";App.ERROR_UNKNOWN="unknown";App.MODE_GOOGLE="google";App.MODE_DROPBOX="dropbox";App.MODE_ONEDRIVE="onedrive";App.MODE_M365="m365";App.MODE_GITHUB="github";App.MODE_GITLAB="gitlab";App.MODE_DEVICE="device";App.MODE_BROWSER="browser";App.MODE_TRELLO="trello";App.MODE_EMBED="embed";App.MODE_ATLAS="atlas";App.DROPBOX_APPKEY=window.DRAWIO_DROPBOX_ID;App.DROPBOX_URL="js/dropbox/Dropbox-sdk.min.js";@@ -14968,27 +14972,27 @@ window.location.hash&&"#G"==window.location.hash.substring(0,2)?mxscript("https:2))?mxscript(App.ONEDRIVE_URL):"0"==urlParams.chrome&&(window.OneDriveClient=null):window.OneDriveClient=null),"function"===typeof window.TrelloClient&&("1"==urlParams.tr&&isSvgBrowser?App.mode==App.MODE_TRELLO||null!=window.location.hash&&"#T"==window.location.hash.substring(0,2)?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL)}):"0"==urlParams.chrome&&(window.TrelloClient=null):window.TrelloClient=null)))})();App.clearServiceWorker=function(b,k){navigator.serviceWorker.getRegistration().then(function(m){null!=m&&m.unregister().then(function(){null!=b&&(b(),b=null)})})["catch"](function(){null!=k&&k()})};App.isSameDomain=function(b){var k=document.createElement("a");k.href=b;return k.protocol===window.location.protocol||k.host===window.location.host};App.isBuiltInPlugin=function(b){for(var k in App.pluginRegistry)if(App.pluginRegistry[k]==b)return!0;return!1};App.isSimpleThemePreferred=function(){var b=navigator.userAgent||navigator.vendor||window.opera;return 1024>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)||/android/i.test(b)||/iPad|iPhone|iPod/.test(b)&&!window.MSStream||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints};-App.main=function(b,k){try{var m=function(){try{if(null!=mxSettings.settings){if(null!=mxSettings.settings.autosaveDelay){var H=parseInt(mxSettings.settings.autosaveDelay);!isNaN(H)&&0<H?(DrawioFile.prototype.autosaveDelay=H,EditorUi.debug("Setting autosaveDelay",H)):EditorUi.debug("Invalid autosaveDelay",H)}null!=mxSettings.settings.defaultEdgeLength&&(H=parseInt(mxSettings.settings.defaultEdgeLength),!isNaN(H)&&0<H?(Graph.prototype.defaultEdgeLength=H,EditorUi.debug("Using defaultEdgeLength",H)):-EditorUi.debug("Invalid defaultEdgeLength",H))}}catch(c){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(c.stack)):console.error(c)}try{if(null!=Menus.prototype.defaultFonts)for(H=0;H<Menus.prototype.defaultFonts.length;H++){var G=Menus.prototype.defaultFonts[H];"string"!==typeof G&&null!=G.fontFamily&&null!=G.fontUrl&&Graph.addFont(G.fontFamily,G.fontUrl)}mxResources.loadDefaultBundle=!1;d(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,-mxLanguage))}catch(c){document.body.innerHTML="",G=document.createElement("pre"),mxUtils.write(G,c.stack),document.body.appendChild(G)}},d=function(H){mxUtils.getAll("1"!=urlParams.dev?[H]:[H,STYLE_PATH+"/default.xml"],function(G){function c(){try{try{null==Editor.currentTheme&&"1"!=urlParams.embed&&(1==urlParams.dev||1==urlParams.test||"test.draw.io"===window.location.hostname||"www.draw.io"===window.location.hostname||"preprod.diagrams.net"===window.location.hostname||"app.diagrams.net"===window.location.hostname||+App.main=function(b,k){try{var m=function(){try{if(null!=mxSettings.settings){if(null!=mxSettings.settings.autosaveDelay){var F=parseInt(mxSettings.settings.autosaveDelay);!isNaN(F)&&0<F?(DrawioFile.prototype.autosaveDelay=F,EditorUi.debug("Setting autosaveDelay",F)):EditorUi.debug("Invalid autosaveDelay",F)}null!=mxSettings.settings.defaultEdgeLength&&(F=parseInt(mxSettings.settings.defaultEdgeLength),!isNaN(F)&&0<F?(Graph.prototype.defaultEdgeLength=F,EditorUi.debug("Using defaultEdgeLength",F)):+EditorUi.debug("Invalid defaultEdgeLength",F))}}catch(c){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(c.stack)):console.error(c)}try{if(null!=Menus.prototype.defaultFonts)for(F=0;F<Menus.prototype.defaultFonts.length;F++){var H=Menus.prototype.defaultFonts[F];"string"!==typeof H&&null!=H.fontFamily&&null!=H.fontUrl&&Graph.addFont(H.fontFamily,H.fontUrl)}mxResources.loadDefaultBundle=!1;d(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,+mxLanguage))}catch(c){document.body.innerHTML="",H=document.createElement("pre"),mxUtils.write(H,c.stack),document.body.appendChild(H)}},d=function(F){mxUtils.getAll("1"!=urlParams.dev?[F]:[F,STYLE_PATH+"/default.xml"],function(H){function c(){try{try{null==Editor.currentTheme&&"1"!=urlParams.embed&&(1==urlParams.dev||1==urlParams.test||"test.draw.io"===window.location.hostname||"www.draw.io"===window.location.hostname||"preprod.diagrams.net"===window.location.hostname||"app.diagrams.net"===window.location.hostname||"jgraph.github.io"===window.location.hostname||/drawio-dev\.pages\.dev$/.test(window.location.hostname))&&App.isSimpleThemePreferred()&&(Editor.currentTheme="simple")}catch(x){}"kennedy"!=Editor.currentTheme&&0>mxUtils.indexOf(Editor.themes,Editor.currentTheme)&&(Editor.currentTheme="kennedy");"1"==urlParams.transparent&&(document.body.style.background="transparent");var t=null!=k?k():new App(new Editor("0"==urlParams.chrome||"min"==uiTheme,null,null,null,"0"!=urlParams.chrome));null!=window.mxscript&&("function"===typeof window.DropboxClient&&null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode)?mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL,function(){DrawDropboxClientCallback()},"dropboxjs",App.DROPBOX_APPKEY)}):"undefined"===typeof window.Dropbox&&(window.DropboxClient=null),"function"===typeof window.OneDriveClient&&"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=null),"function"===typeof window.TrelloClient&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&"1"==urlParams.tr?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null));null!=b&&b(t);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",["v"+EditorUi.VERSION,t,(new Date).getTime()-t0.getTime()+"ms"]),null!=urlParams["export"]&&EditorUi.debug("Export:",EXPORT_URL))}catch(x){EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(x.stack)):(EditorUi.logError(x.message,null,null,null,x),-window.setTimeout(function(){alert(x.message)},1))}}mxResources.parse(G[0].getText());if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var f=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=f){EditorUi.debug("Setting configuration",JSON.stringify(f));if(null!=f.merge){var l=localStorage.getItem(Editor.configurationKey);if(null!=l)try{var n=JSON.parse(l),r;for(r in f.merge)n[r]=f.merge[r];f=n}catch(t){window.location.hash=-"",alert(t)}else f=f.merge}confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(f)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(t){window.location.hash="",alert(t)}1<G.length&&(Graph.prototype.defaultThemes["default-style2"]=G[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=G[1].getDocumentElement());"1"==urlParams.dev||EditorUi.isElectronApp?c():(mxStencilRegistry.allowEval=-!1,App.loadScripts(["js/shapes-14-6-5.min.js","js/stencils.min.js","js/extensions.min.js"],c,function(t){document.body.innerHTML="";var x=document.createElement("pre");mxUtils.write(x,t.stack);document.body.appendChild(x)}))},function(G){G=document.getElementById("geStatus");null!=G&&(G.innerHTML="Error loading page. <a>Please try refreshing.</a>",G.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";d(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,+window.setTimeout(function(){alert(x.message)},1))}}mxResources.parse(H[0].getText());if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var f=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=f){EditorUi.debug("Setting configuration",JSON.stringify(f));if(null!=f.merge){var l=localStorage.getItem(Editor.configurationKey);if(null!=l)try{var n=JSON.parse(l),r;for(r in f.merge)n[r]=f.merge[r];f=n}catch(t){window.location.hash=+"",alert(t)}else f=f.merge}confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(f)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(t){window.location.hash="",alert(t)}1<H.length&&(Graph.prototype.defaultThemes["default-style2"]=H[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=H[1].getDocumentElement());"1"==urlParams.dev||EditorUi.isElectronApp?c():(mxStencilRegistry.allowEval=+!1,App.loadScripts(["js/shapes-14-6-5.min.js","js/stencils.min.js","js/extensions.min.js"],c,function(t){document.body.innerHTML="";var x=document.createElement("pre");mxUtils.write(x,t.stack);document.body.appendChild(x)}))},function(H){H=document.getElementById("geStatus");null!=H&&(H.innerHTML="Error loading page. <a>Please try refreshing.</a>",H.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";d(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})})};if(!App.isMainCalled)if(mxIsElectron&&"undefined"===typeof electron)alert("Runtime Environment not found."),document.body.innerHTML='<div style="margin-top:10%;text-align:center;"><img src="mxgraph/images/warning.png" align="top" style="padding-right:6px;"/>Runtime Environment not found.</div>';else{Editor.loadCompatibleCss();App.isMainCalled=!0;if("1"==urlParams.android||"0"!=urlParams.android&&!mxClient.IS_ANDROID&&mxClient.IS_LINUX&&mxClient.IS_GC&&1<navigator.maxTouchPoints)mxClient.IS_ANDROID=-!0;window.onerror=function(H,G,c,f,l){EditorUi.logError("Global: "+(null!=H?H:""),G,c,f,l,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",H,"\nURL:",G,"\nLine:",c,"\nColumn:",f,"\nError:",l)):console.error("Message:",H,"\nURL:",G,"\nLine:",c,"\nColumn:",f,"\nError:",l);window.setTimeout(function(){alert("Error: "+(null!=H?H:""))},100)};if(window.top!=window.self||"import.diagrams.net"!==window.location.hostname&&"ac.draw.io"!==window.location.hostname&&"aj.draw.io"!==+!0;window.onerror=function(F,H,c,f,l){EditorUi.logError("Global: "+(null!=F?F:""),H,c,f,l,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",F,"\nURL:",H,"\nLine:",c,"\nColumn:",f,"\nError:",l)):console.error("Message:",F,"\nURL:",H,"\nLine:",c,"\nColumn:",f,"\nError:",l);window.setTimeout(function(){alert("Error: "+(null!=F?F:""))},100)};if(window.top!=window.self||"import.diagrams.net"!==window.location.hostname&&"ac.draw.io"!==window.location.hostname&&"aj.draw.io"!==window.location.hostname){if("1"==urlParams.embed||"1"==urlParams.lightbox){var q=document.getElementById("geInfo");null!=q&&q.parentNode.removeChild(q)}"1"==urlParams.embed&&document.body.classList.add("geEmbed");null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){try{Editor.enableServiceWorker&&("0"==urlParams.offline||/www\.draw\.io$/.test(window.location.hostname)||"1"!=-urlParams.offline&&"1"!=urlParams.enableSW&&"1"==urlParams.dev)?(EditorUi.debug("App.main","Uninstalling service worker"),App.clearServiceWorker(function(){"0"==urlParams.offline&&alert("Cache cleared")})):Editor.enableServiceWorker&&navigator.serviceWorker.getRegistration().then(function(H){null!=H?(EditorUi.debug("App.main","Updating service worker"),H.update()):!Editor.isSettingsEnabled()||null!=mxSettings.settings&&!mxSettings.settings.isNew||"1"==urlParams.enableSW?(EditorUi.debug("App.main",-"Installing service worker"),navigator.serviceWorker.register("service-worker.js")):EditorUi.debug("App.main","Skipping service worker (first load)")})}catch(H){}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&("1"!=urlParams.embedRT||"1"==urlParams.lockdown)||"1"==urlParams.local||"0"==urlParams.chrome&&"1"!=urlParams.rt||"1"==urlParams.stealth||"1"==urlParams.offline||(mxscript(App.PUSHER_URL),"1"==urlParams["fast-sync"]&&-mxscript(App.SIMPLE_PEER_URL));if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var u=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var y=JSON.parse(localStorage.getItem(mxSettings.key));null!=y&&(u=y.plugins)}catch(H){}y=urlParams.p;App.initPluginCallback();null!=y&&App.loadPlugins(y.split(";"));if(null!=u&&0<u.length&&"0"!=urlParams.plugins)for(q=0;q<u.length;q++)try{("/"==u[q].charAt(0)&&(u[q]=PLUGINS_BASE_PATH+-u[q]),App.isSameDomain(u[q]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(u[q])?null==App.pluginsLoaded[u[q]]&&(App.pluginsLoaded[u[q]]=!0,App.embedModePluginsCount++,mxscript(u[q])):null!=window.console&&console.log("Unknown plugin:",u[q]):null!=window.console&&console.log("Blocked plugin:",u[q])}catch(H){}}"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||-10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();if("1"==urlParams.configure){var A=window.opener||window.parent,J=function(H){if(H.source==A)try{var G=JSON.parse(H.data);null!=G&&"configure"==G.action&&(mxEvent.removeListener(window,"message",J),Editor.configure(G.config),mxSettings.load(),null!=G.config.darkColor&&-document.body.style.setProperty("--dark-color",G.config.darkColor),G.colorSchemeMeta&&mxmeta("color-scheme","dark light"),m())}catch(c){null!=window.console&&console.log("Error in configure message: "+c,H.data)}};mxEvent.addListener(window,"message",J);A.postMessage(JSON.stringify({event:"configure"}),"*")}else{if(null==Editor.config){if(null!=window.DRAWIO_CONFIG)try{EditorUi.debug("Using global configuration",window.DRAWIO_CONFIG),Editor.configure(window.DRAWIO_CONFIG),mxSettings.load()}catch(H){null==-window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(H.stack)):console.error(H)}if(isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed){var K=localStorage.getItem(Editor.configurationKey);if(null!=K)try{K=JSON.parse(K),null!=K&&(EditorUi.debug("Using local configuration",K),Editor.configure(K),mxSettings.load())}catch(H){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(H.stack)):console.error(H)}}}m()}}else document.body.innerHTML='<div style="margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>'}}catch(H){document.body.innerHTML=-"",u=document.createElement("pre"),mxUtils.write(u,H.stack),document.body.appendChild(u)}};mxUtils.extend(App,EditorUi);App.prototype.warnInterval=3E5;App.prototype.compactMode=!1;App.prototype.fullscreenMode=!1;App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(b){App.DrawPlugins.push(b)})};App.pluginsLoaded={};App.embedModePluginsCount=0;+urlParams.offline&&"1"!=urlParams.enableSW&&"1"==urlParams.dev)?(EditorUi.debug("App.main","Uninstalling service worker"),App.clearServiceWorker(function(){"0"==urlParams.offline&&alert("Cache cleared")})):Editor.enableServiceWorker&&navigator.serviceWorker.getRegistration().then(function(F){null!=F?(EditorUi.debug("App.main","Updating service worker"),F.update()):!Editor.isSettingsEnabled()||null!=mxSettings.settings&&!mxSettings.settings.isNew||"1"==urlParams.enableSW?(EditorUi.debug("App.main",+"Installing service worker"),navigator.serviceWorker.register("service-worker.js")):EditorUi.debug("App.main","Skipping service worker (first load)")})}catch(F){}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&("1"!=urlParams.embedRT||"1"==urlParams.lockdown)||"1"==urlParams.local||"0"==urlParams.chrome&&"1"!=urlParams.rt||"1"==urlParams.stealth||"1"==urlParams.offline||(mxscript(App.PUSHER_URL),"1"==urlParams["fast-sync"]&&+mxscript(App.SIMPLE_PEER_URL));if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var u=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var y=JSON.parse(localStorage.getItem(mxSettings.key));null!=y&&(u=y.plugins)}catch(F){}y=urlParams.p;App.initPluginCallback();null!=y&&App.loadPlugins(y.split(";"));if(null!=u&&0<u.length&&"0"!=urlParams.plugins)for(q=0;q<u.length;q++)try{("/"==u[q].charAt(0)&&(u[q]=PLUGINS_BASE_PATH++u[q]),App.isSameDomain(u[q]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(u[q])?null==App.pluginsLoaded[u[q]]&&(App.pluginsLoaded[u[q]]=!0,App.embedModePluginsCount++,mxscript(u[q])):null!=window.console&&console.log("Unknown plugin:",u[q]):null!=window.console&&console.log("Blocked plugin:",u[q])}catch(F){}}"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||+10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();if("1"==urlParams.configure){var A=window.opener||window.parent,J=function(F){if(F.source==A)try{var H=JSON.parse(F.data);null!=H&&"configure"==H.action&&(mxEvent.removeListener(window,"message",J),Editor.configure(H.config),mxSettings.load(),null!=H.config.darkColor&&+document.body.style.setProperty("--dark-color",H.config.darkColor),H.colorSchemeMeta&&mxmeta("color-scheme","dark light"),m())}catch(c){null!=window.console&&console.log("Error in configure message: "+c,F.data)}};mxEvent.addListener(window,"message",J);A.postMessage(JSON.stringify({event:"configure"}),"*")}else{if(null==Editor.config){if(null!=window.DRAWIO_CONFIG)try{EditorUi.debug("Using global configuration",window.DRAWIO_CONFIG),Editor.configure(window.DRAWIO_CONFIG),mxSettings.load()}catch(F){null==+window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(F.stack)):console.error(F)}if(isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed){var K=localStorage.getItem(Editor.configurationKey);if(null!=K)try{K=JSON.parse(K),null!=K&&(EditorUi.debug("Using local configuration",K),Editor.configure(K),mxSettings.load())}catch(F){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(F.stack)):console.error(F)}}}m()}}else document.body.innerHTML='<div style="margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>'}}catch(F){document.body.innerHTML=+"",u=document.createElement("pre"),mxUtils.write(u,F.stack),document.body.appendChild(u)}};mxUtils.extend(App,EditorUi);App.prototype.warnInterval=3E5;App.prototype.compactMode=!1;App.prototype.fullscreenMode=!1;App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(b){App.DrawPlugins.push(b)})};App.pluginsLoaded={};App.embedModePluginsCount=0;App.loadPlugins=function(b,k){EditorUi.debug("Loading plugins",b);for(var m=0;m<b.length;m++)if(null!=b[m]&&0<b[m].length)try{if(null!=App.pluginRegistry[b[m]]){var d=PLUGINS_BASE_PATH+App.pluginRegistry[b[m]];null==App.pluginsLoaded[d]&&(App.pluginsLoaded[d]=!0,App.embedModePluginsCount++,"undefined"===typeof window.drawDevUrl?k?mxinclude(d):mxscript(d):k?mxinclude(d):mxscript(drawDevUrl+d))}else null!=window.console&&console.log("Unknown plugin:",b[m])}catch(q){null!=window.console&&console.log("Error loading plugin:",b[m],q)}};App.prototype.initializeEmbedMode=function(){"1"==urlParams.embed&&("app.diagrams.net"==window.location.hostname&&this.showBanner("EmbedDeprecationFooter","app.diagrams.net will stop working for embed mode. Please use embed.diagrams.net."),0<App.embedModePluginsCount||this.initEmbedDone||(this.initEmbedDone=!0,EditorUi.prototype.initializeEmbedMode.apply(this,arguments)))};App.prototype.initializeViewerMode=function(){var b=window.opener||window.parent;null!=b&&this.editor.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(){b.postMessage(JSON.stringify(this.createLoadMessage("size")),"*")}))};@@ -15028,11 +15032,11 @@ App.prototype.resetRecent=function(b){if(isLocalStorage&&null!=localStorage)try{App.prototype.onBeforeUnload=function(){if("1"==urlParams.embed&&this.editor.modified)return mxResources.get("allChangesLost");this.unloading=!0;var b=this.getCurrentFile();if(null!=b)if(b.constructor!=LocalFile||""!=b.getHash()||b.isModified()||"1"==urlParams.nowarn||this.isDiagramEmpty()||null!=urlParams.url||this.editor.isChromelessView()||null!=b.fileHandle){if(b.isModified())return this.logIfModified(b),mxResources.get("allChangesLost");b.close(!0)}else return mxResources.get("ensureDataSaved")};App.prototype.updateDocumentTitle=function(){var b=this.editor.appName,k=this.getCurrentFile();null==k||!this.editor.graph.isLightboxView()&&"simple"!=Editor.currentTheme||null==this.pages||null==this.currentPage?this.isOfflineApp()&&(b+=" app"):b=this.getShortPageName(this.currentPage);null!=k&&(b=(null!=k.getTitle()?k.getTitle():this.defaultFilename)+" - "+b);document.title!=b&&(document.title=b)};App.prototype.getThumbnail=function(b,k,m){m=null!=m?m:0;var d=!1;try{var q=!0,u=window.setTimeout(mxUtils.bind(this,function(){q=!1;k(null)}),this.timeout),y=mxUtils.bind(this,function(N){window.clearTimeout(u);q&&k(N)});null==this.thumbImageCache&&(this.thumbImageCache={});var A=this.editor.graph,J=A.backgroundImage;if(null!=this.pages&&this.currentPage!=this.pages[0]){var K=A.getGlobalVariable;A=this.createTemporaryGraph(A.getStylesheet());A.setBackgroundImage=this.editor.graph.setBackgroundImage;-var H=this.pages[0];this.currentPage==H?(A.mathEnabled=this.editor.graph.mathEnabled,A.setBackgroundImage(J)):null!=H.viewState&&null!=H.viewState&&(A.mathEnabled=H.viewState.mathEnabled,J=H.viewState.backgroundImage,A.setBackgroundImage(J));A.getGlobalVariable=function(N){return"page"==N?H.getName():"pagenumber"==N?1:K.apply(this,arguments)};A.getGlobalVariable=K;document.body.appendChild(A.container);A.model.setRoot(H.root)}if(mxClient.IS_CHROMEAPP||Editor.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,-function(N){try{A!=this.editor.graph&&null!=A.container.parentNode&&A.container.parentNode.removeChild(A.container)}catch(R){N=null}y(N)}),b,this.thumbImageCache,"#ffffff",function(){y()},null,null,null,null,null,null,A,m,null,null,null,"diagram",null),d=!0;else if(Editor.canvasSupported&&null!=this.getCurrentFile()){var G=document.createElement("canvas"),c=A.getGraphBounds(),f=A.view.translate,l=A.view.scale;null!=J&&(c=mxRectangle.fromRectangle(c),c.add(new mxRectangle((f.x+J.x)*l,(f.y+J.y)*l,J.width*-l,J.height*l)));var n=b/c.width;n=Math.min(1,Math.min(3*b/(4*c.height),n));var r=Math.floor(c.x),t=Math.floor(c.y);G.setAttribute("width",Math.ceil(n*(c.width+4)));G.setAttribute("height",Math.ceil(n*(c.height+4)));var x=G.getContext("2d");x.scale(n,n);x.translate(-r,-t);var B=A.background;if(null==B||""==B||B==mxConstants.NONE)B="#ffffff";x.save();x.fillStyle=B;x.fillRect(r,t,Math.ceil(c.width+4),Math.ceil(c.height+4));x.restore();if(null!=J){var F=new Image;F.src=J.src;x.drawImage(F,J.x*n,J.y*n,-J.width*n,J.height*n)}var L=new mxJsCanvas(G),D=new mxAsyncCanvas(this.thumbImageCache);L.images=this.thumbImageCache.images;var T=new mxImageExport;T.drawShape=function(N,R){N.shape instanceof mxShape&&N.shape.checkBounds()&&(R.save(),R.translate(.5,.5),N.shape.paint(R),R.translate(-.5,-.5),R.restore())};T.drawText=function(N,R){};T.drawState(A.getView().getState(A.model.root),D);D.finish(mxUtils.bind(this,function(){try{T.drawState(A.getView().getState(A.model.root),L),A!=this.editor.graph&&null!=-A.container.parentNode&&A.container.parentNode.removeChild(A.container)}catch(N){G=null}y(G)}));d=!0}}catch(N){d=!1,null!=A&&A!=this.editor.graph&&null!=A.container.parentNode&&A.container.parentNode.removeChild(A.container)}d||window.clearTimeout(u);return d};+var F=this.pages[0];this.currentPage==F?(A.mathEnabled=this.editor.graph.mathEnabled,A.setBackgroundImage(J)):null!=F.viewState&&null!=F.viewState&&(A.mathEnabled=F.viewState.mathEnabled,J=F.viewState.backgroundImage,A.setBackgroundImage(J));A.getGlobalVariable=function(N){return"page"==N?F.getName():"pagenumber"==N?1:K.apply(this,arguments)};A.getGlobalVariable=K;document.body.appendChild(A.container);A.model.setRoot(F.root)}if(mxClient.IS_CHROMEAPP||Editor.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,+function(N){try{A!=this.editor.graph&&null!=A.container.parentNode&&A.container.parentNode.removeChild(A.container)}catch(R){N=null}y(N)}),b,this.thumbImageCache,"#ffffff",function(){y()},null,null,null,null,null,null,A,m,null,null,null,"diagram",null),d=!0;else if(Editor.canvasSupported&&null!=this.getCurrentFile()){var H=document.createElement("canvas"),c=A.getGraphBounds(),f=A.view.translate,l=A.view.scale;null!=J&&(c=mxRectangle.fromRectangle(c),c.add(new mxRectangle((f.x+J.x)*l,(f.y+J.y)*l,J.width*+l,J.height*l)));var n=b/c.width;n=Math.min(1,Math.min(3*b/(4*c.height),n));var r=Math.floor(c.x),t=Math.floor(c.y);H.setAttribute("width",Math.ceil(n*(c.width+4)));H.setAttribute("height",Math.ceil(n*(c.height+4)));var x=H.getContext("2d");x.scale(n,n);x.translate(-r,-t);var B=A.background;if(null==B||""==B||B==mxConstants.NONE)B="#ffffff";x.save();x.fillStyle=B;x.fillRect(r,t,Math.ceil(c.width+4),Math.ceil(c.height+4));x.restore();if(null!=J){var G=new Image;G.src=J.src;x.drawImage(G,J.x*n,J.y*n,+J.width*n,J.height*n)}var L=new mxJsCanvas(H),D=new mxAsyncCanvas(this.thumbImageCache);L.images=this.thumbImageCache.images;var T=new mxImageExport;T.drawShape=function(N,R){N.shape instanceof mxShape&&N.shape.checkBounds()&&(R.save(),R.translate(.5,.5),N.shape.paint(R),R.translate(-.5,-.5),R.restore())};T.drawText=function(N,R){};T.drawState(A.getView().getState(A.model.root),D);D.finish(mxUtils.bind(this,function(){try{T.drawState(A.getView().getState(A.model.root),L),A!=this.editor.graph&&null!=+A.container.parentNode&&A.container.parentNode.removeChild(A.container)}catch(N){H=null}y(H)}));d=!0}}catch(N){d=!1,null!=A&&A!=this.editor.graph&&null!=A.container.parentNode&&A.container.parentNode.removeChild(A.container)}d||window.clearTimeout(u);return d};(function(){var b=EditorUi.prototype.setMode;App.prototype.setMode=function(k,m){b.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(null!=this.appIcon){var d=this.getCurrentFile();k=null!=d?d.getMode():k;null==this.updateTitleListener&&(this.updateTitleListener=mxUtils.bind(this,function(){k==App.MODE_GOOGLE?this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("googleDrive")])):k==App.MODE_DROPBOX?this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])):k==App.MODE_ONEDRIVE?this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])):this.appIcon.removeAttribute("title")}),this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTitleListener()})));this.updateTitleListener()}if(m)try{if(isLocalStorage)localStorage.setItem(".mode",k);else if("undefined"!=typeof Storage){var q=new Date;q.setYear(q.getFullYear()+1);document.cookie="MODE="+k+"; expires="+q.toUTCString()}}catch(u){}}})();@@ -15047,22 +15051,22 @@ App.prototype.showRefreshDialog=function(b,k){this.showingRefreshDialog||(this.sApp.prototype.showAlert=function(b){if(null!=b&&0<b.length){var k=document.createElement("div");k.className="geAlert";k.style.zIndex=2E9;k.style.left="50%";k.style.top="-100%";k.style.maxWidth="80%";k.style.width="max-content";k.style.whiteSpace="pre-wrap";mxUtils.setPrefixedStyle(k.style,"transform","translate(-50%,0%)");mxUtils.setPrefixedStyle(k.style,"transition","all 1s ease");k.innerHTML=b;b=document.createElement("a");b.className="geAlertLink";b.style.textAlign="right";b.style.marginTop="20px";b.style.display="block";b.setAttribute("title",mxResources.get("close"));b.innerHTML=mxResources.get("close");k.appendChild(b);mxEvent.addListener(b,"click",function(m){null!=k.parentNode&&(k.parentNode.removeChild(k),mxEvent.consume(m))});document.body.appendChild(k);window.setTimeout(function(){k.style.top="30px"},10);window.setTimeout(function(){mxUtils.setPrefixedStyle(k.style,"transition","all 2s ease");k.style.opacity="0";window.setTimeout(function(){null!=k.parentNode&&k.parentNode.removeChild(k)},2E3)},15E3)}};-App.prototype.start=function(){try{this.restoreLibraries();this.spinner.stop();var b=this;window.onerror=function(y,A,J,K,H){"ResizeObserver loop limit exceeded"!=y&&((null==y||0>y.indexOf("Invalid or unexpected token"))&&EditorUi.logError("Uncaught: "+(null!=y?y:""),A,J,K,H,null,!0),b.handleError({message:y},mxResources.get("unknownError"),null,null,null,null,!0))};if("1"!=urlParams.client&&"1"!=urlParams.embed){try{isLocalStorage&&window.addEventListener("storage",mxUtils.bind(this,function(y){var A=+App.prototype.start=function(){try{this.restoreLibraries();this.spinner.stop();var b=this;window.onerror=function(y,A,J,K,F){"ResizeObserver loop limit exceeded"!=y&&((null==y||0>y.indexOf("Invalid or unexpected token"))&&EditorUi.logError("Uncaught: "+(null!=y?y:""),A,J,K,F,null,!0),b.handleError({message:y},mxResources.get("unknownError"),null,null,null,null,!0))};if("1"!=urlParams.client&&"1"!=urlParams.embed){try{isLocalStorage&&window.addEventListener("storage",mxUtils.bind(this,function(y){var A=this.getCurrentFile();EditorUi.debug("storage event",[y],[A]);null!=A&&".draft-alive-check"==y.key&&null!=y.newValue&&null!=A.draftId&&(this.draftAliveCheck=y.newValue,A.saveDraft())}))}catch(y){}var k=this.getDiagramId();mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(y){try{var A=this.getDiagramId();if(A!=k){k=A;var J=this.getCurrentFile();null!=J&&J.getHash()==A||this.loadFile(A,!0)}else{var K=this.getHashObject();if(null!=K&&null!=K.pageId&&null!=this.currentPage&&K.pageId!=-this.currentPage.getId()){var H=this.getPageById(K.pageId);null!=H&&this.selectPage(H)}}}catch(G){null!=document.body&&this.handleError(G,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var c=this.getCurrentFile();window.location.hash=null!=c?c.getHash():""}))}}))}if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.desc)try{this.loadDescriptor(JSON.parse(Graph.decompress(urlParams.desc)),null,mxUtils.bind(this,function(y){this.handleError(y,mxResources.get("errorLoadingFile"))}))}catch(y){this.handleError(y,-mxResources.get("errorLoadingFile"))}else if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.url)this.loadFile("U"+urlParams.url,!0);else if(null==this.getCurrentFile()){var m=mxUtils.bind(this,function(){if("1"==urlParams.client&&(null==window.location.hash||0==window.location.hash.length||"#P"==window.location.hash.substring(0,2))){var y=mxUtils.bind(this,function(K){Editor.isPngDataUrl(K)&&(K=Editor.extractGraphModelFromPng(K));var H=urlParams.title;H=null!=H?decodeURIComponent(H):-this.defaultFilename;K=new LocalFile(this,K,H,!0);this.fileLoaded(K);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(window.location.hash="");this.editor.chromeless||(K.fileChanged(),window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0))}),A=window.opener||window.parent;if(A!=window){var J=urlParams.create;null!=J?y(A[decodeURIComponent(J)]):(J=urlParams.data,null!=J?y(decodeURIComponent(J)):this.spinner.spin(document.body,mxResources.get("loading"))&&-this.createTimeout(2E3,mxUtils.bind(this,function(K){this.installMessageHandler(mxUtils.bind(this,function(H,G){G.source==A&&K.clear()&&(this.spinner.stop(),y(H))}))}),mxUtils.bind(this,function(K){this.handleError(K)})))}}else if(null==this.dialog)if("1"==urlParams.demo)J=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=J;else{J=!1;try{J=null!=window.opener&&null!=window.opener.openFile}catch(K){}J?this.spinner.spin(document.body,-mxResources.get("loading")):(J=this.getDiagramId(),!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=J&&0!=J.length||this.editor.isChromelessView()?null!=J&&0<J.length?this.loadFile(J,null,null,mxUtils.bind(this,function(){var K=decodeURIComponent(urlParams.viewbox||"");if(""!=K)try{var H=JSON.parse(K);this.editor.graph.fitWindow(H,H.border)}catch(G){console.error(G)}})):"0"!=urlParams.splash||null!=urlParams.mode&&!EditorUi.isElectronApp?this.loadFile():this.createFile(this.defaultFilename,+this.currentPage.getId()){var F=this.getPageById(K.pageId);null!=F&&this.selectPage(F)}}}catch(H){null!=document.body&&this.handleError(H,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var c=this.getCurrentFile();window.location.hash=null!=c?c.getHash():""}))}}))}if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.desc)try{this.loadDescriptor(JSON.parse(Graph.decompress(urlParams.desc)),null,mxUtils.bind(this,function(y){this.handleError(y,mxResources.get("errorLoadingFile"))}))}catch(y){this.handleError(y,+mxResources.get("errorLoadingFile"))}else if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.url)this.loadFile("U"+urlParams.url,!0);else if(null==this.getCurrentFile()){var m=mxUtils.bind(this,function(){if("1"==urlParams.client&&(null==window.location.hash||0==window.location.hash.length||"#P"==window.location.hash.substring(0,2))){var y=mxUtils.bind(this,function(K){Editor.isPngDataUrl(K)&&(K=Editor.extractGraphModelFromPng(K));var F=urlParams.title;F=null!=F?decodeURIComponent(F):+this.defaultFilename;K=new LocalFile(this,K,F,!0);this.fileLoaded(K);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(window.location.hash="");this.editor.chromeless||(K.fileChanged(),window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0))}),A=window.opener||window.parent;if(A!=window){var J=urlParams.create;null!=J?y(A[decodeURIComponent(J)]):(J=urlParams.data,null!=J?y(decodeURIComponent(J)):this.spinner.spin(document.body,mxResources.get("loading"))&&+this.createTimeout(2E3,mxUtils.bind(this,function(K){this.installMessageHandler(mxUtils.bind(this,function(F,H){H.source==A&&K.clear()&&(this.spinner.stop(),y(F))}))}),mxUtils.bind(this,function(K){this.handleError(K)})))}}else if(null==this.dialog)if("1"==urlParams.demo)J=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=J;else{J=!1;try{J=null!=window.opener&&null!=window.opener.openFile}catch(K){}J?this.spinner.spin(document.body,+mxResources.get("loading")):(J=this.getDiagramId(),!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=J&&0!=J.length||this.editor.isChromelessView()?null!=J&&0<J.length?this.loadFile(J,null,null,mxUtils.bind(this,function(){var K=decodeURIComponent(urlParams.viewbox||"");if(""!=K)try{var F=JSON.parse(K);this.editor.graph.fitWindow(F,F.border)}catch(H){console.error(H)}})):"0"!=urlParams.splash||null!=urlParams.mode&&!EditorUi.isElectronApp?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0):this.checkDrafts())}}),d=decodeURIComponent(urlParams.create||"");null!=window.location.hash&&"#create="==window.location.hash.substring(0,8)&&(d=decodeURIComponent(window.location.hash.substring(8)));null!=urlParams["smart-template"]&&(null==window.location.hash||1>=window.location.hash.length)&&(d=JSON.stringify({type:"generate",data:decodeURIComponent(urlParams["smart-template"])}));if((null==window.location.hash||1>=window.location.hash.length)&&0<d.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var q=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create","title"]))}),u=mxUtils.bind(this,function(y){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,y,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var A=urlParams.title;A=null!=A?decodeURIComponent(A):this.defaultFilename;y=this.getServiceCount(!0);-isLocalStorage&&y++;var J=4>=y?2:6<y?4:3;A=new CreateDialog(this,A,mxUtils.bind(this,function(K,H){try{if(null==H){this.hideDialog();var G=Editor.useLocalStorage;this.createFile(0<K.length?K:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=G}else this.pickFolder(H,mxUtils.bind(this,function(c){try{this.createFile(K,this.getFileData(!0),null,H,null,!0,c)}catch(f){this.handleError(f)}}))}catch(c){this.handleError(c)}}),null,null,null,null,"1"==urlParams.browser,+isLocalStorage&&y++;var J=4>=y?2:6<y?4:3;A=new CreateDialog(this,A,mxUtils.bind(this,function(K,F){try{if(null==F){this.hideDialog();var H=Editor.useLocalStorage;this.createFile(0<K.length?K:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=H}else this.pickFolder(F,mxUtils.bind(this,function(c){try{this.createFile(K,this.getFileData(!0),null,F,null,!0,c)}catch(f){this.handleError(f)}}))}catch(c){this.handleError(c)}}),null,null,null,null,"1"==urlParams.browser,null,null,!0,J,null,null,null,this.editor.fileExtensions);this.showDialog(A.container,420,y>J?390:280,!0,!1,mxUtils.bind(this,function(K){K&&null==this.getCurrentFile()&&this.showSplash()}));A.init()}});if("http://"!=d.substring(0,7)&&"https://"!=d.substring(0,8))try{if("{"==d.charAt(0))this.executeCreateObject(JSON.parse(decodeURIComponent(d)),mxUtils.bind(this,function(){window.history.replaceState(null,null,window.location.pathname+this.getSearch(["create"]))}));else if(null!=window.opener&&null!=window.opener[d])u(window.opener[d]);else throw Error(mxResources.get("invalidCallFnNotFound",["window.opener."+d]));}catch(y){this.handleError(y,mxResources.get("errorLoadingFile"))}else this.loadTemplate(d,function(y){u(y)},mxUtils.bind(this,function(y){this.handleError(y,mxResources.get("errorLoadingFile"),q)}))}else(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.state&&null!=this.stateArg&&"open"==this.stateArg.action?null!=this.stateArg.ids&&(window.history&&window.history.replaceState&&window.history.replaceState(null,null,window.location.pathname+this.getSearch(["state","splash"])),window.location.hash="G"+this.stateArg.ids[0]):(null==window.location.hash||1>=window.location.hash.length)&&null!=this.drive&&null!=this.stateArg&&"create"==this.stateArg.action?(window.history&&window.history.replaceState&&window.history.replaceState(null,null,window.location.pathname+this.getSearch(["state"])),this.setMode(App.MODE_GOOGLE),"0"==urlParams.splash?this.createFile(null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename):this.actions.get("new").funct()):(null!=urlParams.open&&window.history&&window.history.replaceState&&(window.history.replaceState(null,null,window.location.pathname+this.getSearch(["open","sketch"])),window.location.hash=urlParams.open),m())}}catch(y){this.handleError(y)}};App.prototype.executeCreateObject=function(b,k){try{EditorUi.debug("App.executeCreateObject",[this],"value",[b]);var m=mxUtils.bind(this,function(y){this.spinner.stop();this.createFile(null!=b.filename?b.filename:this.defaultFilename,y,null,null,mxUtils.bind(this,function(){null!=urlParams.pv&&this.setPageVisible("1"==urlParams.pv);null!=urlParams.grid&&this.editor.graph.setGridEnabled("1"==urlParams.grid);var A=mxUtils.bind(this,function(){this.initialFitDiagram(1.2);if("pop"==b.effect){var J=this.editor.graph,-K=J.model.getDescendants(J.model.getRoot()),H=J.getNodesForCells(K);Graph.setOpacityForNodes(H,0);window.setTimeout(mxUtils.bind(this,function(){var G=J.createPopAnimations(K,!0);J.executeAnimations(G)}),200)}null!=k&&k();b.type="xml";b.compressed=!0;b.data=Graph.compress(null!=b.layout?mxUtils.getXml(this.editor.getGraphXml()):y);delete b.layout;window.location.hash="create="+encodeURIComponent(JSON.stringify(b))});null!=b.layout?this.executeLayoutSpec(b.layout,A):A()}),!0,null,!0)}),d=b.data;b.compressed&&+K=J.model.getDescendants(J.model.getRoot()),F=J.getNodesForCells(K);Graph.setOpacityForNodes(F,0);window.setTimeout(mxUtils.bind(this,function(){var H=J.createPopAnimations(K,!0);J.executeAnimations(H)}),200)}null!=k&&k();b.type="xml";b.compressed=!0;b.data=Graph.compress(null!=b.layout?mxUtils.getXml(this.editor.getGraphXml()):y);delete b.layout;window.location.hash="create="+encodeURIComponent(JSON.stringify(b))});null!=b.layout?this.executeLayoutSpec(b.layout,A):A()}),!0,null,!0)}),d=b.data;b.compressed&&(d=Graph.decompress(d));if("mermaid"==b.type)if(EditorUi.isMermaidSupported()){var q=mxUtils.bind(this,function(y){this.handleError(y)});b.image?this.parseMermaidImage(d,mxUtils.bind(this,function(y){m(y)}),q):this.parseMermaidDiagram(d,null,mxUtils.bind(this,function(y){m(mxMermaidToDrawio.wrapGroup(y,d,null))}),q)}else throw Error(mxResources.get("serviceUnavailableOrBlocked"));else if("generate"==b.type&&this.spinner.spin(document.body,mxResources.get("generate")+" '"+d+"'"))this.generateOpenAiMermaidDiagram(d,function(y){m(y)},mxUtils.bind(this,function(y){this.handleError(y,mxResources.get("errorLoadingFile"))}),{complexity:"high"});else if("csv"==b.type){var u=this.createTemporaryGraph(this.editor.graph.getStylesheet());this.importCsv(d,mxUtils.bind(this,function(){var y=new mxCodec;m(mxUtils.getXml(y.encode(u.getModel())))}),u,!0)}else if("xml"==b.type)m(d);else throw Error(mxResources.get("invalidCallFnNotFound",[b.type]));}catch(y){this.handleError(y,mxResources.get("errorLoadingFile"))}};App.prototype.openGenerateDialog=function(b){if(null==this.chatWindow){var k=mxSettings.getWindowState("chat");this.chatWindow=new ChatWindow(this,null!=k&&null!=k.x?k.x:224,null!=k&&null!=k.y?k.y:104,null!=k&&null!=k.w?k.w:440,null!=k&&null!=k.h?k.h:440);this.chatWindow.window.addListener("show",mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("chat"))}));this.chatWindow.window.addListener("hide",function(){this.fireEvent(new mxEventObject("chat"))});this.installWindowPersistence("chat",@@ -15086,59 +15090,59 @@ q):this.editor.diagramFileTypes[d].extension==m?k.splice(0,0,q):k.push(q)}returnApp.prototype.pickFile=function(b){try{if(b=null!=b?b:this.mode,b==App.MODE_GOOGLE)null!=this.drive&&"undefined"!=typeof google&&"undefined"!=typeof google.picker?this.drive.pickFile():this.openLink("https://drive.google.com");else{var k=this.getServiceForName(b);if(null!=k)k.pickFile();else if(b==App.MODE_DEVICE&&EditorUi.nativeFileSupport)window.showOpenFilePicker().then(mxUtils.bind(this,function(y){null!=y&&0<y.length&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.loadFileSystemEntry(y[0])}),mxUtils.bind(this,function(y){"AbortError"!=y.name&&this.handleError(y)}));else if(b==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.openFileInputElt){var m=document.createElement("input");m.setAttribute("type","file");mxEvent.addListener(m,"change",mxUtils.bind(this,function(){null!=m.files&&(this.openFiles(m.files),m.type="",m.type="file",m.value="")}));m.style.display="none";document.body.appendChild(m);this.openFileInputElt=m}this.openFileInputElt.click()}else{this.hideDialog();window.openNew=null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";window.listBrowserFiles=mxUtils.bind(this,function(y,A){StorageFile.listFiles(this,"F",y,A)});window.openBrowserFile=mxUtils.bind(this,function(y,A,J){StorageFile.getFileContent(this,y,A,J)});window.deleteBrowserFile=mxUtils.bind(this,function(y,A,J){StorageFile.deleteFile(this,y,A,J)});var d=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,-function(y,A,J){var K=mxUtils.bind(this,function(){Editor.useCanvasForExport||".png"!=A.substring(A.length-4)||(A=A.substring(0,A.length-4)+".drawio");this.fileLoaded(b==App.MODE_BROWSER?new StorageFile(this,y,A):new LocalFile(this,y,A,J));var G=this.getCurrentFile();J&&null!=G&&G.fileChanged()}),H=this.getCurrentFile();null!=H&&H.isModified()?this.confirm(mxResources.get("allChangesLost"),null,K,mxResources.get("cancel"),mxResources.get("discardChanges")):K()}));var q=this.dialog,u=q.close;this.dialog.close=+function(y,A,J){var K=mxUtils.bind(this,function(){Editor.useCanvasForExport||".png"!=A.substring(A.length-4)||(A=A.substring(0,A.length-4)+".drawio");this.fileLoaded(b==App.MODE_BROWSER?new StorageFile(this,y,A):new LocalFile(this,y,A,J));var H=this.getCurrentFile();J&&null!=H&&H.fileChanged()}),F=this.getCurrentFile();null!=F&&F.isModified()?this.confirm(mxResources.get("allChangesLost"),null,K,mxResources.get("cancel"),mxResources.get("discardChanges")):K()}));var q=this.dialog,u=q.close;this.dialog.close=mxUtils.bind(this,function(y){Editor.useLocalStorage=d;u.apply(q,arguments);null==this.getCurrentFile()&&this.showSplash()})}}}catch(y){this.handleError(y)}};App.prototype.pickLibrary=function(b){b=null!=b?b:this.mode;var k=mxUtils.bind(this,function(u){try{this.loadLibrary(u);this.showSidebar();try{this.sidebar.palettes[u.getHash()][0].scrollIntoView({behavior:"smooth"})}catch(y){}}catch(y){this.handleError(y,mxResources.get("errorLoadingFile"))}});if(b==App.MODE_GOOGLE||b==App.MODE_DROPBOX||b==App.MODE_ONEDRIVE||b==App.MODE_GITHUB||b==App.MODE_GITLAB||b==App.MODE_TRELLO){var m=b==App.MODE_GOOGLE?this.drive:b==App.MODE_ONEDRIVE?this.oneDrive:b==App.MODE_GITHUB?this.gitHub:b==App.MODE_GITLAB?this.gitLab:b==App.MODE_TRELLO?this.trello:this.dropbox;null!=m&&m.pickLibrary(mxUtils.bind(this,function(u,y){null!=y?k(y):this.spinner.spin(document.body,mxResources.get("loading"))&&m.getLibrary(u,mxUtils.bind(this,function(A){this.spinner.stop();k(A)}),mxUtils.bind(this,function(A){this.handleError(A,null!=A?mxResources.get("errorLoadingFile"):null)}))}))}else if(b==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.libFileInputElt){var d=document.createElement("input");d.setAttribute("type","file");mxEvent.addListener(d,"change",mxUtils.bind(this,function(){if(null!=d.files){for(var u=0;u<d.files.length;u++)mxUtils.bind(this,function(y){var A=new FileReader;A.onload=mxUtils.bind(this,function(J){k(new LocalLibrary(this,J.target.result,y.name))});A.readAsText(y)})(d.files[u]);d.type="";d.type="file";d.value=""}}));d.style.display="none";document.body.appendChild(d);this.libFileInputElt=d}this.libFileInputElt.click()}else{window.openNew=!1;window.openKey="open";window.listBrowserFiles=mxUtils.bind(this,function(u,y){StorageFile.listFiles(this,"L",u,y)});window.openBrowserFile=mxUtils.bind(this,function(u,y,A){StorageFile.getFileContent(this,u,y,A)});window.deleteBrowserFile=mxUtils.bind(this,function(u,y,A){StorageFile.deleteFile(this,u,y,A)});var q=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;window.openFile=new OpenFile(mxUtils.bind(this,function(u){this.hideDialog(u)}));window.openFile.setConsumer(mxUtils.bind(this,function(u,y){k(b==App.MODE_BROWSER?new StorageLibrary(this,u,y):new LocalLibrary(this,u,y))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage=q;window.openFile=null})}};-App.prototype.saveLibrary=function(b,k,m,d,q,u,y){try{d=null!=d?d:this.mode;q=null!=q?q:!1;u=null!=u?u:!1;var A=this.createLibraryDataFromImages(k),J=mxUtils.bind(this,function(G){this.spinner.stop();null!=y&&y();this.handleError(G,null!=G?mxResources.get("errorSavingFile"):null)});null==m&&d==App.MODE_DEVICE&&(m=new LocalLibrary(this,A,b));if(null==m)this.pickFolder(d,mxUtils.bind(this,function(G){d==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?-this.drive.insertFile(b,A,G,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,k)}),J,this.drive.libraryMimeType):d==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(b,A,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,k)}),J,G):d==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(b,-A,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,k)}),J,G):d==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(b,A,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,k)}),J,G):d==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(b,A,mxUtils.bind(this,function(c){this.spinner.stop();-this.hideDialog(!0);this.libraryLoaded(c,k)}),J,G):d==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(b,A,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,k)}),J,G):d==App.MODE_BROWSER?StorageFile.doInsertFile(new StorageLibrary(this,A,b),mxUtils.bind(this,function(c){this.hideDialog(!0);this.libraryLoaded(c,k)}),J):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));-else if(q||this.spinner.spin(document.body,mxResources.get("saving"))){m.setData(A);var K=mxUtils.bind(this,function(){m.save(!0,mxUtils.bind(this,function(G){this.spinner.stop();this.hideDialog(!0);u||this.libraryLoaded(m,k);null!=y&&y()}),J)});if(b!=m.getTitle()){var H=m.getHash();m.rename(b,mxUtils.bind(this,function(G){m.constructor!=LocalLibrary&&H!=m.getHash()&&(mxSettings.removeCustomLibrary(H),mxSettings.addCustomLibrary(m.getHash()));this.removeLibrarySidebar(H);K()}),J)}else K()}}catch(G){this.handleError(G)}};+App.prototype.saveLibrary=function(b,k,m,d,q,u,y){try{d=null!=d?d:this.mode;q=null!=q?q:!1;u=null!=u?u:!1;var A=this.createLibraryDataFromImages(k),J=mxUtils.bind(this,function(H){this.spinner.stop();null!=y&&y();this.handleError(H,null!=H?mxResources.get("errorSavingFile"):null)});null==m&&d==App.MODE_DEVICE&&(m=new LocalLibrary(this,A,b));if(null==m)this.pickFolder(d,mxUtils.bind(this,function(H){d==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?+this.drive.insertFile(b,A,H,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,k)}),J,this.drive.libraryMimeType):d==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(b,A,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,k)}),J,H):d==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(b,+A,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,k)}),J,H):d==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(b,A,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,k)}),J,H):d==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(b,A,mxUtils.bind(this,function(c){this.spinner.stop();+this.hideDialog(!0);this.libraryLoaded(c,k)}),J,H):d==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(b,A,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,k)}),J,H):d==App.MODE_BROWSER?StorageFile.doInsertFile(new StorageLibrary(this,A,b),mxUtils.bind(this,function(c){this.hideDialog(!0);this.libraryLoaded(c,k)}),J):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));+else if(q||this.spinner.spin(document.body,mxResources.get("saving"))){m.setData(A);var K=mxUtils.bind(this,function(){m.save(!0,mxUtils.bind(this,function(H){this.spinner.stop();this.hideDialog(!0);u||this.libraryLoaded(m,k);null!=y&&y()}),J)});if(b!=m.getTitle()){var F=m.getHash();m.rename(b,mxUtils.bind(this,function(H){m.constructor!=LocalLibrary&&F!=m.getHash()&&(mxSettings.removeCustomLibrary(F),mxSettings.addCustomLibrary(m.getHash()));this.removeLibrarySidebar(F);K()}),J)}else K()}}catch(H){this.handleError(H)}};App.prototype.saveFile=function(b,k){var m=this.getCurrentFile(),d=this.mode;if(null!=m){var q=mxUtils.bind(this,function(){EditorUi.enableDrafts&&m.removeDraft();this.getCurrentFile()==m||m.isModified()||(m.getMode()!=App.MODE_DEVICE?this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")))})):this.clearStatus());null!=k&&k()});if(b||null==m.getTitle()||null!=m.invalidFileHandle||null==this.mode)if(null!=m&&m.constructor==LocalFile&&-null!=m.fileHandle)this.showSaveFilePicker(mxUtils.bind(this,function(J,K){m.invalidFileHandle=null;m.fileHandle=J;m.title=K.name;m.desc=K;m.editable=null;this.save(K.name,q)}),null,this.createFileSystemOptions(m.getTitle()));else{var u=null!=m.getTitle()?m.getTitle():this.defaultFilename,y=mxUtils.bind(this,function(J,K,H,G){if(null!=J&&0<J.length)if(/(\.pdf)$/i.test(J))this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),-mxUtils.bind(this,function(){H.value=J.split(".").slice(0,-1).join(".");H.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?H.select():document.execCommand("selectAll",!1,null)}),mxResources.get("yes"),mxResources.get("no"));else if(this.hideDialog(),null==d&&K==App.MODE_DEVICE)null!=m&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,function(f,l){m.fileHandle=f;m.mode=App.MODE_DEVICE;m.title=l.name;m.desc=l;this.setMode(App.MODE_DEVICE);this.save(l.name,q)}),mxUtils.bind(this,+null!=m.fileHandle)this.showSaveFilePicker(mxUtils.bind(this,function(J,K){m.invalidFileHandle=null;m.fileHandle=J;m.title=K.name;m.desc=K;m.editable=null;this.save(K.name,q)}),null,this.createFileSystemOptions(m.getTitle()));else{var u=null!=m.getTitle()?m.getTitle():this.defaultFilename,y=mxUtils.bind(this,function(J,K,F,H){if(null!=J&&0<J.length)if(/(\.pdf)$/i.test(J))this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),+mxUtils.bind(this,function(){F.value=J.split(".").slice(0,-1).join(".");F.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?F.select():document.execCommand("selectAll",!1,null)}),mxResources.get("yes"),mxResources.get("no"));else if(this.hideDialog(),null==d&&K==App.MODE_DEVICE)null!=m&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,function(f,l){m.fileHandle=f;m.mode=App.MODE_DEVICE;m.title=l.name;m.desc=l;this.setMode(App.MODE_DEVICE);this.save(l.name,q)}),mxUtils.bind(this,function(f){"AbortError"!=f.name&&this.handleError(f)}),this.createFileSystemOptions(J)):(this.setMode(App.MODE_DEVICE),this.save(J,q));else if("download"==K)(new LocalFile(this,null,J)).save();else if("_blank"==K)window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname),null,!0);else if(b||d!=K){var c=mxUtils.bind(this,function(f){try{var l=this.editor.graph,n=l.getSelectionCells(),r=l.getViewState(),-t=this.currentPage,x=this.getCurrentFile(),B=null==this.mode||null==x||null==x.mode;this.createFile(J,this.getFileData(/(\.xml)$/i.test(J)||0>J.indexOf(".")||/(\.drawio)$/i.test(J),/(\.svg)$/i.test(J),/(\.html)$/i.test(J)),null,K,q,B,f,null,null,mxUtils.bind(this,function(){this.restoreViewState(t,r,n)}))}catch(F){this.handleError(F)}});null!=G?c(G):this.pickFolder(K,c)}else null!=K&&this.save(J,q)}),A=!mxClient.IS_IOS||!navigator.standalone;u=new SaveDialog(this,u,mxUtils.bind(this,function(J,K,-H){try{y(J.value,K,J,H),this.hideDialog()}catch(G){this.handleError(G)}}),A?null:["_blank"]);this.showDialog(u.container,420,162,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));u.init()}else this.save(m.getTitle(),q)}};-App.prototype.loadTemplate=function(b,k,m,d,q){var u=!1,y=b,A=null!=d?d:b;d=/\.png$/i.test(A)||/\.pdf$/i.test(A);var J=EditorUi.isVisioFilename(A);this.editor.isCorsEnabledForUrl(y)||(u=d||J,y="t="+(new Date).getTime(),y=PROXY_URL+"?url="+encodeURIComponent(b)+"&"+y+(u?"&base64=1":""));this.editor.loadUrl(y,mxUtils.bind(this,function(K){try{var H=u?window.atob?atob(K):Base64.decode(K):K;if(J||this.isVisioData(H))J||(A=q?this.isRemoteVisioData(H)?"raw.vss":"raw.vssx":this.isRemoteVisioData(H)?"raw.vsd":-"raw.vsdx"),this.importVisio(this.base64ToBlob(K.substring(K.indexOf(",")+1)),function(G){k(G)},m,A);else if((new XMLHttpRequest).upload&&this.isRemoteFileFormat(H,A))this.isExternalDataComms()?this.parseFileData(H,mxUtils.bind(this,function(G){4==G.readyState&&200<=G.status&&299>=G.status&&"<mxGraphModel"==G.responseText.substring(0,13)&&k(G.responseText)}),b):this.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,m);else if(this.isLucidChartData(H))this.convertLucidChart(H,-mxUtils.bind(this,function(G){k(G)}),mxUtils.bind(this,function(G){m(G)}));else{if(/(\.png)($|\?)/i.test(A)||Editor.isPngData(H))H=Editor.extractGraphModelFromPng(K);k(H)}}catch(G){m(G)}}),m,/(\.png)($|\?)/i.test(A)||J,null,null,u)};App.prototype.getModeForChar=function(b){return"G"==b?App.MODE_GOOGLE:"D"==b?App.MODE_DROPBOX:"W"==b?App.MODE_ONEDRIVE:"M"==b?App.MODE_M365:"H"==b?App.MODE_GITHUB:"A"==b?App.MODE_GITLAB:"T"==b?App.MODE_TRELLO:null};+t=this.currentPage,x=this.getCurrentFile(),B=null==this.mode||null==x||null==x.mode;this.createFile(J,this.getFileData(/(\.xml)$/i.test(J)||0>J.indexOf(".")||/(\.drawio)$/i.test(J),/(\.svg)$/i.test(J),/(\.html)$/i.test(J)),null,K,q,B,f,null,null,mxUtils.bind(this,function(){this.restoreViewState(t,r,n)}))}catch(G){this.handleError(G)}});null!=H?c(H):this.pickFolder(K,c)}else null!=K&&this.save(J,q)}),A=!mxClient.IS_IOS||!navigator.standalone;u=new SaveDialog(this,u,mxUtils.bind(this,function(J,K,+F){try{y(J.value,K,J,F),this.hideDialog()}catch(H){this.handleError(H)}}),A?null:["_blank"]);this.showDialog(u.container,420,162,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));u.init()}else this.save(m.getTitle(),q)}};+App.prototype.loadTemplate=function(b,k,m,d,q){var u=!1,y=b,A=null!=d?d:b;d=/\.png$/i.test(A)||/\.pdf$/i.test(A);var J=EditorUi.isVisioFilename(A);this.editor.isCorsEnabledForUrl(y)||(u=d||J,y="t="+(new Date).getTime(),y=PROXY_URL+"?url="+encodeURIComponent(b)+"&"+y+(u?"&base64=1":""));this.editor.loadUrl(y,mxUtils.bind(this,function(K){try{var F=u?window.atob?atob(K):Base64.decode(K):K;if(J||this.isVisioData(F))J||(A=q?this.isRemoteVisioData(F)?"raw.vss":"raw.vssx":this.isRemoteVisioData(F)?"raw.vsd":+"raw.vsdx"),this.importVisio(this.base64ToBlob(K.substring(K.indexOf(",")+1)),function(H){k(H)},m,A);else if((new XMLHttpRequest).upload&&this.isRemoteFileFormat(F,A))this.isExternalDataComms()?this.parseFileData(F,mxUtils.bind(this,function(H){4==H.readyState&&200<=H.status&&299>=H.status&&"<mxGraphModel"==H.responseText.substring(0,13)&&k(H.responseText)}),b):this.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,m);else if(this.isLucidChartData(F))this.convertLucidChart(F,+mxUtils.bind(this,function(H){k(H)}),mxUtils.bind(this,function(H){m(H)}));else{if(/(\.png)($|\?)/i.test(A)||Editor.isPngData(F))F=Editor.extractGraphModelFromPng(K);k(F)}}catch(H){m(H)}}),m,/(\.png)($|\?)/i.test(A)||J,null,null,u)};App.prototype.getModeForChar=function(b){return"G"==b?App.MODE_GOOGLE:"D"==b?App.MODE_DROPBOX:"W"==b?App.MODE_ONEDRIVE:"M"==b?App.MODE_M365:"H"==b?App.MODE_GITHUB:"A"==b?App.MODE_GITLAB:"T"==b?App.MODE_TRELLO:null};App.prototype.isModeEnabled=function(b){return b==App.MODE_GOOGLE?"function"===typeof window.DriveClient&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode):b==App.MODE_GITHUB?null!=this.gitHub:b==App.MODE_GITLAB?null!=this.gitLab:b==App.MODE_DROPBOX?"function"===typeof window.DropboxClient&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode):b==App.MODE_ONEDRIVE?"function"===typeof window.OneDriveClient&&("www.draw.io"==window.location.hostname||"test.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname||"app.diagrams.net"==window.location.hostname)&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&!mxClient.IS_IOS&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode):b==App.MODE_TRELLO?"function"===typeof window.TrelloClient&&"1"==urlParams.tr&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode):b==App.MODE_M365?null!=this.m365:!1};App.prototype.isModeReady=function(b){return null!=this.getServiceForName(b)&&(b!=App.MODE_DROPBOX||"undefined"!==typeof Dropbox.choose)};App.prototype.uncompressPages=function(b){if(null!=b)try{var k=mxUtils.parseXml(b);if("mxfile"==k.documentElement.nodeName){for(var m=k.documentElement.getElementsByTagName("diagram"),d=0;d<m.length;d++){var q=Editor.parseDiagramNode(m[d],!0);null!=q&&(mxUtils.setTextContent(m[d],""),m[d].appendChild(q))}b=mxUtils.getPrettyXml(k.documentElement)}}catch(u){}return b};-App.prototype.createFile=function(b,k,m,d,q,u,y,A,J,K){EditorUi.debug("App.createFile",[this],"title",[b],"data",[k],"libs",[m],"mode",[d]);d=A?null:null!=d?d:this.mode;if(null!=b&&this.spinner.spin(document.body,mxResources.get("inserting"))){k=null!=k?k:this.emptyDiagramXml;null==k||Editor.defaultCompressed||(k=this.uncompressPages(k));var H=mxUtils.bind(this,function(){this.spinner.stop()}),G=mxUtils.bind(this,function(f){H();null==f&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():-null!=f&&this.handleError(f)});try{var c=mxUtils.bind(this,function(f){H();this.fileCreated(f,m,u,q,J,K)});d==App.MODE_GOOGLE&&null!=this.drive?(null==y&&null!=this.stateArg&&null!=this.stateArg.folderId&&(y=this.stateArg.folderId),this.drive.insertFile(b,k,y,c,G)):d==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(b,k,c,G,!1,y):d==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(b,k,c,G,!1,y):d==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(b,k,c,G,!1,y):d==App.MODE_DROPBOX&&-null!=this.dropbox?this.dropbox.insertFile(b,k,c,G):d==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(b,k,c,G,!1,y):d==App.MODE_M365&&null!=this.m365?this.m365.insertFile(b,k,c,G,!1,y):d==App.MODE_BROWSER?StorageFile.insertFile(this,b,k,c,G):!A&&d==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(H(),this.showSaveFilePicker(mxUtils.bind(this,function(f,l){var n=new LocalFile(this,k,l.name,null,f,l);n.saveFile(l.name,!1,mxUtils.bind(this,function(){this.fileCreated(n,m,u,q,J,K)}),G,!0)}),-mxUtils.bind(this,function(f){"AbortError"!=f.name&&G(f)}),this.createFileSystemOptions(b))):(H(),this.fileCreated(new LocalFile(this,k,b,null==d),m,u,q,J,K))}catch(f){H(),this.handleError(f)}}};+App.prototype.createFile=function(b,k,m,d,q,u,y,A,J,K){EditorUi.debug("App.createFile",[this],"title",[b],"data",[k],"libs",[m],"mode",[d]);d=A?null:null!=d?d:this.mode;if(null!=b&&this.spinner.spin(document.body,mxResources.get("inserting"))){k=null!=k?k:this.emptyDiagramXml;null==k||Editor.defaultCompressed||(k=this.uncompressPages(k));var F=mxUtils.bind(this,function(){this.spinner.stop()}),H=mxUtils.bind(this,function(f){F();null==f&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():+null!=f&&this.handleError(f)});try{var c=mxUtils.bind(this,function(f){F();this.fileCreated(f,m,u,q,J,K)});d==App.MODE_GOOGLE&&null!=this.drive?(null==y&&null!=this.stateArg&&null!=this.stateArg.folderId&&(y=this.stateArg.folderId),this.drive.insertFile(b,k,y,c,H)):d==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(b,k,c,H,!1,y):d==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(b,k,c,H,!1,y):d==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(b,k,c,H,!1,y):d==App.MODE_DROPBOX&&+null!=this.dropbox?this.dropbox.insertFile(b,k,c,H):d==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(b,k,c,H,!1,y):d==App.MODE_M365&&null!=this.m365?this.m365.insertFile(b,k,c,H,!1,y):d==App.MODE_BROWSER?StorageFile.insertFile(this,b,k,c,H):!A&&d==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(F(),this.showSaveFilePicker(mxUtils.bind(this,function(f,l){var n=new LocalFile(this,k,l.name,null,f,l);n.saveFile(l.name,!1,mxUtils.bind(this,function(){this.fileCreated(n,m,u,q,J,K)}),H,!0)}),+mxUtils.bind(this,function(f){"AbortError"!=f.name&&H(f)}),this.createFileSystemOptions(b))):(F(),this.fileCreated(new LocalFile(this,k,b,null==d),m,u,q,J,K))}catch(f){F(),this.handleError(f)}}};App.prototype.fileCreated=function(b,k,m,d,q,u){EditorUi.debug("App.fileCreated",[this],"file",[b],"libs",[k],"replace",[m]);var y=window.location.pathname;null!=k&&0<k.length&&(y+="?libs="+k);null!=q&&0<q.length&&(y+="?clibs="+q);y=this.getUrl(y);b.getMode()!=App.MODE_DEVICE&&(y+="#"+b.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var A=b.getData();A=0<A.length?this.editor.extractGraphModel(mxUtils.parseXml(A).documentElement,!0):null;var J=window.location.protocol+-"//"+window.location.hostname+y,K=A,H=null;null!=A&&/\.svg$/i.test(b.getTitle())&&(H=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(H.container),K=this.decodeNodeIntoGraph(K,H));b.setData(this.createFileData(A,H,b,J));null!=H&&H.container.parentNode.removeChild(H.container);var G=mxUtils.bind(this,function(){this.spinner.stop()}),c=mxUtils.bind(this,function(){G();var f=this.getCurrentFile();null==m&&null!=f&&(m=!f.isModified()&&(null==f.getMode()||EditorUi.isElectronApp));+"//"+window.location.hostname+y,K=A,F=null;null!=A&&/\.svg$/i.test(b.getTitle())&&(F=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(F.container),K=this.decodeNodeIntoGraph(K,F));b.setData(this.createFileData(A,F,b,J));null!=F&&F.container.parentNode.removeChild(F.container);var H=mxUtils.bind(this,function(){this.spinner.stop()}),c=mxUtils.bind(this,function(){H();var f=this.getCurrentFile();null==m&&null!=f&&(m=!f.isModified()&&(null==f.getMode()||EditorUi.isElectronApp));var l=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(b,null,u);m&&this.updateStatus(mxUtils.bind(this,function(){b.addAllSavedStatus()}));null!=k&&this.sidebar.showEntries(k);if(null!=q){for(var r=[],t=q.split(";"),x=0;x<t.length;x++)r.push(decodeURIComponent(t[x]));this.loadLibraries(r)}null!=d&&d()}),n=mxUtils.bind(this,function(){m||null==f||!f.isModified()?l():this.confirm(mxResources.get("allChangesLost"),null,l,mxResources.get("cancel"),mxResources.get("discardChanges"))});-null==m||m?n():(b.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(b.getData(),b.getTitle(),null==b.getMode())),window.geOpenWindow(y,null,n))});b.constructor==LocalFile?c():b.saveFile(b.getTitle(),!1,mxUtils.bind(this,function(){c()}),mxUtils.bind(this,function(f){G();null!=f&&"AbortError"==f.name||this.handleError(f)}))}};+null==m||m?n():(b.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(b.getData(),b.getTitle(),null==b.getMode())),window.geOpenWindow(y,null,n))});b.constructor==LocalFile?c():b.saveFile(b.getTitle(),!1,mxUtils.bind(this,function(){c()}),mxUtils.bind(this,function(f){H();null!=f&&"AbortError"==f.name||this.handleError(f)}))}};App.prototype.loadFile=function(b,k,m,d,q){if("1"==urlParams.openInSameWin||navigator.standalone)k=!0;this.hideDialog();var u=mxUtils.bind(this,function(){if(null==b||0==b.length)this.clearStatus(),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==b.charAt(0))if(this.spinner.stop(),isLocalStorage){var J=mxUtils.bind(this,function(r){this.handleError(r,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var t=this.getCurrentFile();window.location.hash=null!=t?t.getHash():""}))});b=decodeURIComponent(b.substring(1));StorageFile.getFileContent(this,b,mxUtils.bind(this,function(r){null!=r?(this.fileLoaded(new StorageFile(this,r,b)),null!=d&&d()):J({message:mxResources.get("fileNotFound")})}),J)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var r=this.getCurrentFile();window.location.hash=null!=r?r.getHash():""}));else if(null!=m)this.spinner.stop(),this.fileLoaded(m),-null!=d&&d();else if("S"==b.charAt(0))this.spinner.stop(),this.alert("[Deprecation] #S is no longer supported, go to https://app.diagrams.net/?desc="+b.substring(1).substring(0,10),mxUtils.bind(this,function(){window.location.href="https://app.diagrams.net/?desc="+b.substring(1)}));else if("create="==b.substring(0,7))try{var K=JSON.parse(decodeURIComponent(b.substring(7)));if("message"==K.type){var H=window.opener||window.parent,G=mxUtils.bind(this,function(r){EditorUi.debug("EditorUi.createMessageHandler",-[this],"evt",[r]);if(r.source==H)try{"create"==r.data.action&&null!=r.data.data&&(mxEvent.removeListener(window,"message",G),this.executeCreateObject(r.data.data))}catch(t){c=null}});mxEvent.addListener(window,"message",G);H.postMessage(JSON.stringify({event:"ready"}),"*")}else this.executeCreateObject(K)}catch(r){this.handleError(r,mxResources.get("errorLoadingFile"))}else if("R"==b.charAt(0)){this.spinner.stop();var c=decodeURIComponent(b.substring(1));"<"!=c.charAt(0)&&(c=Graph.decompress(c));+null!=d&&d();else if("S"==b.charAt(0))this.spinner.stop(),this.alert("[Deprecation] #S is no longer supported, go to https://app.diagrams.net/?desc="+b.substring(1).substring(0,10),mxUtils.bind(this,function(){window.location.href="https://app.diagrams.net/?desc="+b.substring(1)}));else if("create="==b.substring(0,7))try{var K=JSON.parse(decodeURIComponent(b.substring(7)));if("message"==K.type){var F=window.opener||window.parent,H=mxUtils.bind(this,function(r){EditorUi.debug("EditorUi.createMessageHandler",+[this],"evt",[r]);if(r.source==F)try{"create"==r.data.action&&null!=r.data.data&&(mxEvent.removeListener(window,"message",H),this.executeCreateObject(r.data.data))}catch(t){c=null}});mxEvent.addListener(window,"message",H);F.postMessage(JSON.stringify({event:"ready"}),"*")}else this.executeCreateObject(K)}catch(r){this.handleError(r,mxResources.get("errorLoadingFile"))}else if("R"==b.charAt(0)){this.spinner.stop();var c=decodeURIComponent(b.substring(1));"<"!=c.charAt(0)&&(c=Graph.decompress(c));K=new LocalFile(this,c,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);K.getHash=function(){return b};this.fileLoaded(K);null!=d&&d()}else if("E"==b.charAt(0))null==this.getCurrentFile()?this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile")):this.remoteInvoke("getDraftFileContent",null,null,mxUtils.bind(this,function(r,t){this.spinner.stop();this.fileLoaded(new EmbedFile(this,r,t));null!=d&&d()}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"))}));else if("U"==b.charAt(0)){var f=decodeURIComponent(b.substring(1)),l=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=f.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var r=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var t=f.substring(31,f.lastIndexOf("&ex"));this.loadFile("G"+t,k,null,mxUtils.bind(this,function(){var x=this.getCurrentFile();null!=x&&this.editor.chromeless&&!this.editor.editable&&(x.getHash=function(){return"G"+t},window.location.hash="#"+x.getHash());null!=d&&d()}));return!0}return!1});!r()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",r);return!0});this.loadTemplate(f,mxUtils.bind(this,function(r){this.spinner.stop();if(null!=r&&0<r.length){var t=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var x=-f,B=f.lastIndexOf("."),F=x.lastIndexOf("/");B>F&&0<F&&(x=x.substring(F+1,B),B=f.substring(B),Editor.useCanvasForExport||".png"!=B||(B=".drawio"),".svg"===B||".xml"===B||".html"===B||".png"===B||".drawio"===B)&&(t=x+B)}r=new LocalFile(this,r,null!=urlParams.title?decodeURIComponent(urlParams.title):t,!0);r.getHash=function(){return b};this.fileLoaded(r,!0)?null!=d&&d():l()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else l()||this.handleError({message:mxResources.get("fileNotFound")},+f,B=f.lastIndexOf("."),G=x.lastIndexOf("/");B>G&&0<G&&(x=x.substring(G+1,B),B=f.substring(B),Editor.useCanvasForExport||".png"!=B||(B=".drawio"),".svg"===B||".xml"===B||".html"===B||".png"===B||".drawio"===B)&&(t=x+B)}r=new LocalFile(this,r,null!=urlParams.title?decodeURIComponent(urlParams.title):t,!0);r.getHash=function(){return b};this.fileLoaded(r,!0)?null!=d&&d():l()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else l()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}),mxUtils.bind(this,function(){l()||(this.spinner.stop(),this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile")))}),null!=urlParams["template-filename"]?decodeURIComponent(urlParams["template-filename"]):null)}else{var n=this.getModeForChar(b.charAt(0));mxUtils.bind(this,function(){var r=this.getServiceForName(n);if(null==r)this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),-mxUtils.bind(this,function(){var x=this.getCurrentFile();window.location.hash=null!=x?x.getHash():""}));else{var t=b.charAt(0);b=decodeURIComponent(b.substring(1));r.getFile(b,mxUtils.bind(this,function(x){this.spinner.stop();this.fileLoaded(x);var B=this.getCurrentFile();if(null==B)window.location.hash="",this.showSplash();else if(this.editor.chromeless&&!this.editor.editable){B.getHash=function(){return t+b};x="#"+B.getHash();try{var F=this.getHashObject();null==F||mxUtils.isEmptyObject(F)||(x=-x+"#"+encodeURIComponent(JSON.stringify(F)))}catch(L){}window.location.replace(x)}else x==B&&null==x.getMode()&&this.updateStatus(mxUtils.bind(this,function(){var L=mxResources.get("copyCreated");this.editor.setStatus('<div title="'+L+'" class="geStatusAlert">'+L+"</div>")}));null!=d&&d()}),mxUtils.bind(this,function(x){null!=window.console&&null!=x&&console.log("error in loadFile:",b,x);var B=mxUtils.bind(this,function(){var F=this.getCurrentFile();null==F?(window.location.hash="",this.showSplash()):-window.location.hash="#"+F.getHash()});null==x||"AbortError"!=x.name?this.handleError(x,null!=x?mxResources.get("errorLoadingFile"):null,B,null,null,"#"+t+b):B()}))}})()}}),y=this.getCurrentFile(),A=mxUtils.bind(this,function(){q||null==y||!y.isModified()?u():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=y&&(window.location.hash=y.getHash())}),u,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==b||0==b.length||null==k&&null!=y&&!y.isModified()&&+mxUtils.bind(this,function(){var x=this.getCurrentFile();window.location.hash=null!=x?x.getHash():""}));else{var t=b.charAt(0);b=decodeURIComponent(b.substring(1));r.getFile(b,mxUtils.bind(this,function(x){this.spinner.stop();this.fileLoaded(x);var B=this.getCurrentFile();if(null==B)window.location.hash="",this.showSplash();else if(this.editor.chromeless&&!this.editor.editable){B.getHash=function(){return t+b};x="#"+B.getHash();try{var G=this.getHashObject();null==G||mxUtils.isEmptyObject(G)||(x=+x+"#"+encodeURIComponent(JSON.stringify(G)))}catch(L){}window.location.replace(x)}else x==B&&null==x.getMode()&&this.updateStatus(mxUtils.bind(this,function(){var L=mxResources.get("copyCreated");this.editor.setStatus('<div title="'+L+'" class="geStatusAlert">'+L+"</div>")}));null!=d&&d()}),mxUtils.bind(this,function(x){null!=window.console&&null!=x&&console.log("error in loadFile:",b,x);var B=mxUtils.bind(this,function(){var G=this.getCurrentFile();null==G?(window.location.hash="",this.showSplash()):+window.location.hash="#"+G.getHash()});null==x||"AbortError"!=x.name?this.handleError(x,null!=x?mxResources.get("errorLoadingFile"):null,B,null,null,"#"+t+b):B()}))}})()}}),y=this.getCurrentFile(),A=mxUtils.bind(this,function(){q||null==y||!y.isModified()?u():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=y&&(window.location.hash=y.getHash())}),u,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==b||0==b.length||null==k&&null!=y&&!y.isModified()&&this.isBlankFile()?A():null==y||k?A():this.showDialog((new PopupDialog(this,this.getUrl()+"#"+b,null,A)).container,340,140,!0,!0)};App.prototype.getLibraryStorageHint=function(b){var k=b.getTitle();b.constructor!=LocalLibrary&&(k+="\n"+b.getHash());b.constructor==DriveLibrary?k+=" ("+mxResources.get("googleDrive")+")":b.constructor==GitHubLibrary?k+=" ("+mxResources.get("github")+")":b.constructor==TrelloLibrary?k+=" ("+mxResources.get("trello")+")":b.constructor==DropboxLibrary?k+=" ("+mxResources.get("dropbox")+")":b.constructor==OneDriveLibrary?k+=" ("+mxResources.get("oneDrive")+")":b.constructor==StorageLibrary?k+=" ("+mxResources.get("browser")+")":b.constructor==LocalLibrary&&(k+=" ("+mxResources.get("device")+")");return k};App.prototype.restoreLibraries=function(){function b(m){for(var d=0;d<m.length;d++)""!=m[d]&&0>mxUtils.indexOf(k,m[d])&&k.push(m[d])}var k=[];b(mxSettings.getCustomLibraries());b((urlParams.clibs||"").split(";"));this.loadLibraries(k)};-App.prototype.loadLibraries=function(b,k){if(null!=this.sidebar){null==this.loadedLibraries&&(this.loadedLibraries={});var m=mxUtils.bind(this,function(K,H){H||mxSettings.removeCustomLibrary(K);delete this.loadedLibraries[K]}),d=0,q=[],u=0<b.length&&"L.scratchpad"==b[0]?1:0,y=mxUtils.bind(this,function(){if(0==d){if(null!=b)for(var K=b.length-1;0<=K;K--)if(null!=q[K])try{this.loadLibrary(q[K],K<=u)}catch(H){}null!=k&&k()}});if(null!=b)for(var A=0;A<b.length;A++){var J=encodeURIComponent(decodeURIComponent(b[A]));-mxUtils.bind(this,function(K,H){if(null!=K&&0<K.length&&null==this.loadedLibraries[K]&&null==this.sidebar.palettes[K]){this.loadedLibraries[K]=!0;d++;var G=mxUtils.bind(this,function(t){q[H]=t;d--;y()}),c=mxUtils.bind(this,function(t){m(K,t);d--;y()}),f=K.substring(0,1);if("L"==f)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var t=decodeURIComponent(K.substring(1));StorageFile.getFileContent(this,t,mxUtils.bind(this,function(x){".scratchpad"!=t||null!=-x&&"<mxfile"!=x.substring(0,7)||(x=this.emptyLibraryXml);null!=x?G(new StorageLibrary(this,x,t)):c()}),c)}catch(x){c()}}),0);else if("U"==f){var l=decodeURIComponent(K.substring(1));this.isOffline()?c(!0):this.loadTemplate(l,mxUtils.bind(this,function(t){null!=t&&0<t.length?G(new UrlLibrary(this,t,l)):c()}),function(){c()},null,!0)}else if("R"==f){f=decodeURIComponent(K.substring(1));try{f=JSON.parse(f);var n={id:f[0],title:f[1],downloadUrl:f[2]};this.remoteInvoke("getFileContent",[n.downloadUrl],-null,mxUtils.bind(this,function(t){try{G(new RemoteLibrary(this,t,n))}catch(x){c()}}),function(){c()})}catch(t){c()}}else if("S"==f&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(K.substring(1)),function(t){G(t)},c)}catch(t){c()}else{var r=null;"G"==f?null!=this.drive&&null!=this.drive.user&&(r=this.drive):"H"==f?null!=this.gitHub&&null!=this.gitHub.getUser()&&(r=this.gitHub):"T"==f?null!=this.trello&&this.trello.isAuthorized()&&(r=this.trello):"D"==f?null!=this.dropbox&&null!=-this.dropbox.getUser()&&(r=this.dropbox):"W"==f&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(r=this.oneDrive);null!=r?r.getLibrary(decodeURIComponent(K.substring(1)),mxUtils.bind(this,function(t){try{G(t)}catch(x){c()}}),function(t){c()}):c(!0)}}})(J,A)}y()}};+App.prototype.loadLibraries=function(b,k){if(null!=this.sidebar){null==this.loadedLibraries&&(this.loadedLibraries={});var m=mxUtils.bind(this,function(K,F){F||mxSettings.removeCustomLibrary(K);delete this.loadedLibraries[K]}),d=0,q=[],u=0<b.length&&"L.scratchpad"==b[0]?1:0,y=mxUtils.bind(this,function(){if(0==d){if(null!=b)for(var K=b.length-1;0<=K;K--)if(null!=q[K])try{this.loadLibrary(q[K],K<=u)}catch(F){}null!=k&&k()}});if(null!=b)for(var A=0;A<b.length;A++){var J=encodeURIComponent(decodeURIComponent(b[A]));+mxUtils.bind(this,function(K,F){if(null!=K&&0<K.length&&null==this.loadedLibraries[K]&&null==this.sidebar.palettes[K]){this.loadedLibraries[K]=!0;d++;var H=mxUtils.bind(this,function(t){q[F]=t;d--;y()}),c=mxUtils.bind(this,function(t){m(K,t);d--;y()}),f=K.substring(0,1);if("L"==f)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var t=decodeURIComponent(K.substring(1));StorageFile.getFileContent(this,t,mxUtils.bind(this,function(x){".scratchpad"!=t||null!=+x&&"<mxfile"!=x.substring(0,7)||(x=this.emptyLibraryXml);null!=x?H(new StorageLibrary(this,x,t)):c()}),c)}catch(x){c()}}),0);else if("U"==f){var l=decodeURIComponent(K.substring(1));this.isOffline()?c(!0):this.loadTemplate(l,mxUtils.bind(this,function(t){null!=t&&0<t.length?H(new UrlLibrary(this,t,l)):c()}),function(){c()},null,!0)}else if("R"==f){f=decodeURIComponent(K.substring(1));try{f=JSON.parse(f);var n={id:f[0],title:f[1],downloadUrl:f[2]};this.remoteInvoke("getFileContent",[n.downloadUrl],+null,mxUtils.bind(this,function(t){try{H(new RemoteLibrary(this,t,n))}catch(x){c()}}),function(){c()})}catch(t){c()}}else if("S"==f&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(K.substring(1)),function(t){H(t)},c)}catch(t){c()}else{var r=null;"G"==f?null!=this.drive&&null!=this.drive.user&&(r=this.drive):"H"==f?null!=this.gitHub&&null!=this.gitHub.getUser()&&(r=this.gitHub):"T"==f?null!=this.trello&&this.trello.isAuthorized()&&(r=this.trello):"D"==f?null!=this.dropbox&&null!=+this.dropbox.getUser()&&(r=this.dropbox):"W"==f&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(r=this.oneDrive);null!=r?r.getLibrary(decodeURIComponent(K.substring(1)),mxUtils.bind(this,function(t){try{H(t)}catch(x){c()}}),function(t){c()}):c(!0)}}})(J,A)}y()}};App.prototype.updateButtonContainer=function(b){if(null!=this.buttonContainer)if(EditorUi.isElectronApp||this.isOffline()||b||(null!=urlParams.notif?this.fetchAndShowNotification(urlParams.notif):"1"!=urlParams.extAuth&&"atlas"!=Editor.currentTheme&&this.fetchAndShowNotification("online",this.mode)),this.isStandaloneApp()||"simple"==Editor.currentTheme&&"1"!=urlParams.embed)this.buttonContainer.style.display="none",null!=this.notificationBtn&&this.notificationBtn.parentNode!=this.sketchMenubarElt&&this.sketchMenubarElt.appendChild(this.notificationBtn);else{this.buttonContainer.style.display="";b=this.getCurrentFile();null!=this.notificationBtn&&this.notificationBtn.parentNode!=this.buttonContainer&&this.buttonContainer.appendChild(this.notificationBtn);"sketch"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&(null==this.commentButton&&(this.commentButton=document.createElement("a"),this.setElementTitle(this.commentButton,"comments"),this.commentButton.className="geButton geRoundButton",this.commentButton.style.backgroundImage="url("+Editor.commentImage+")",mxEvent.addListener(this.commentButton,"click",mxUtils.bind(this,function(){this.actions.get("comments").funct()})),this.buttonContainer.appendChild(this.commentButton)),this.commentButton.style.display=this.commentsSupported()?"":"none");if(null==this.shareButton){this.shareButton=document.createElement("button");this.shareButton.className="geBtn gePrimaryBtn";var k=document.createElement("div");k.className="geButton";k.style.backgroundImage=@@ -15149,13 +15153,13 @@ m.classList.add("geUserPhoto"),m.style.backgroundImage="url("+u.pictureUrl+")",dq=null!=m&&null!=m.message?q+m.message:q+mxResources.get("disconnected"));q+=")"}else d.style.display="none",d.src=Editor.cloudImage;this.userButton.setAttribute("title",q);this.userButton.style.display="draw.io"!=this.getServiceName()||null==u||"1"==urlParams.embed||this.isStandaloneApp()||null==b?"none":""}}}};App.prototype.fetchAndShowNotification=function(b,k){if(!this.fetchingNotif&&null!=NOTIFICATIONS_URL){b=b||"online";var m=null,d=mxUtils.bind(this,function(q){q=q.filter(function(J){return!J.targets||-1<J.targets.indexOf(b)||null!=k&&-1<J.targets.indexOf(k)});for(var u=b+"NotifReadTS",y=isLocalStorage?parseInt(localStorage.getItem(u)):!0,A=0;A<q.length;A++)q[A].isNew=!y||q[A].timestamp>y;this.showNotification(q,u)});try{isLocalStorage&&(m=JSON.parse(localStorage.getItem(".notifCache")))}catch(q){}null==m||m.ts+864E5<Date.now()?(this.fetchingNotif=!0,mxUtils.get(NOTIFICATIONS_URL,mxUtils.bind(this,function(q){if(200<=q.getStatus()&&299>=q.getStatus())try{var u=JSON.parse(q.getText());u.sort(function(y,A){return A.timestamp-y.timestamp});isLocalStorage&&localStorage.setItem(".notifCache",JSON.stringify({ts:Date.now(),notifs:u}));this.fetchingNotif=!1;d(u)}catch(y){}}))):d(m.notifs)}};-App.prototype.showNotification=function(b,k){function m(K){var H=document.querySelector(".geNotification-count");null!=H&&(H.innerHTML=K,H.style.display=0==K?"none":"",H=document.querySelector(".geNotification-bell"),H.style.animation=0==K?"none":"",H.className="geNotification-bell"+(0==K?" geNotification-bellOff":""),document.querySelector(".geBell-rad").style.animation=0==K?"none":"")}var d=b.length;if("min"==Editor.currentTheme||"simple"==Editor.currentTheme)for(var q=d=0;q<b.length;q++)b[q].isNew&&-d++;if(0==d)null!=this.notificationBtn&&(this.notificationBtn.style.display="none",this.editor.fireEvent(new mxEventObject("statusChanged")));else{var u=mxUtils.bind(this,function(){this.notificationWin.style.display="none";for(var K=this.notificationWin.querySelectorAll(".circle.active"),H=0;H<K.length;H++)K[H].className="circle";isLocalStorage&&b[0]&&localStorage.setItem(k,b[0].timestamp)});if(null==this.notificationBtn){this.notificationBtn=document.createElement("div");this.notificationBtn.className=+App.prototype.showNotification=function(b,k){function m(K){var F=document.querySelector(".geNotification-count");null!=F&&(F.innerHTML=K,F.style.display=0==K?"none":"",F=document.querySelector(".geNotification-bell"),F.style.animation=0==K?"none":"",F.className="geNotification-bell"+(0==K?" geNotification-bellOff":""),document.querySelector(".geBell-rad").style.animation=0==K?"none":"")}var d=b.length;if("min"==Editor.currentTheme||"simple"==Editor.currentTheme)for(var q=d=0;q<b.length;q++)b[q].isNew&&+d++;if(0==d)null!=this.notificationBtn&&(this.notificationBtn.style.display="none",this.editor.fireEvent(new mxEventObject("statusChanged")));else{var u=mxUtils.bind(this,function(){this.notificationWin.style.display="none";for(var K=this.notificationWin.querySelectorAll(".circle.active"),F=0;F<K.length;F++)K[F].className="circle";isLocalStorage&&b[0]&&localStorage.setItem(k,b[0].timestamp)});if(null==this.notificationBtn){this.notificationBtn=document.createElement("div");this.notificationBtn.className="geNotification-box";d=document.createElement("span");d.className="geNotification-count";this.notificationBtn.appendChild(d);this.notifCount=d;d=document.createElement("div");d.className="geNotification-bell";q=document.createElement("span");q.className="geBell-top";d.appendChild(q);q=document.createElement("span");q.className="geBell-middle";d.appendChild(q);q=document.createElement("span");q.className="geBell-bottom";d.appendChild(q);q=document.createElement("span");q.className="geBell-rad";d.appendChild(q);this.notificationBtn.appendChild(d);this.notificationWin=document.createElement("div");this.notificationWin.className="geNotifPanel";this.notificationWin.style.display="none";document.body.appendChild(this.notificationWin);q=document.createElement("div");q.className="header";d=document.createElement("span");d.className="title";d.textContent=mxResources.get("notifications");q.appendChild(d);d=document.createElement("span");d.className="closeBtn";d.textContent="x";q.appendChild(d);this.notificationWin.appendChild(q);q=document.createElement("div");q.className="notifications clearfix";var y=document.createElement("div");y.setAttribute("id","geNotifList");y.style.position="relative";q.appendChild(y);this.notificationWin.appendChild(q);mxEvent.addListener(this.notificationBtn,"click",mxUtils.bind(this,function(){if("none"==this.notificationWin.style.display){this.notificationWin.style.display="";document.querySelector(".notifications").scrollTop=0;var K=this.notificationBtn.getBoundingClientRect();this.notificationWin.style.top=-K.top+this.notificationBtn.clientHeight+"px";this.notificationWin.style.left=K.right-this.notificationWin.clientWidth+"px";m(0)}else u()}));mxEvent.addListener(d,"click",u)}else this.notificationBtn.style.display="";var A=0,J=document.getElementById("geNotifList");if(null!=J){J.innerHTML='<div class="line"></div>';for(q=0;q<b.length;q++)(function(K,H){H.isNew&&A++;var G=document.createElement("div");G.className="notification";K=K.timeSince(new Date(H.timestamp));null==K&&(K=mxResources.get("lessThanAMinute"));-G.innerHTML='<div class="circle'+(H.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[K],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(H.content)+"</p>";H.link&&mxEvent.addListener(G,"click",function(){window.open(H.link,"notifWin")});J.appendChild(G)})(this,b[q]);m(A)}}};+K.top+this.notificationBtn.clientHeight+"px";this.notificationWin.style.left=K.right-this.notificationWin.clientWidth+"px";m(0)}else u()}));mxEvent.addListener(d,"click",u)}else this.notificationBtn.style.display="";var A=0,J=document.getElementById("geNotifList");if(null!=J){J.innerHTML='<div class="line"></div>';for(q=0;q<b.length;q++)(function(K,F){F.isNew&&A++;var H=document.createElement("div");H.className="notification";K=K.timeSince(new Date(F.timestamp));null==K&&(K=mxResources.get("lessThanAMinute"));+H.innerHTML='<div class="circle'+(F.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[K],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(F.content)+"</p>";F.link&&mxEvent.addListener(H,"click",function(){window.open(F.link,"notifWin")});J.appendChild(H)})(this,b[q]);m(A)}}};App.prototype.save=function(b,k){var m=this.getCurrentFile(),d=!0,q=mxUtils.bind(this,function(){d&&(d=!1,m.handleFileSuccess(!0),null!=k&&k())}),u=mxUtils.bind(this,function(y){if(d){d=!1;Editor.addRetryToError(y,mxUtils.bind(this,function(){this.save(b,k)}));if(null!=y&&null!=y.retry){var A=y.retry;y.retry=function(){d=!0;try{m.isModified()?A():q()}catch(J){u(J)}}}m.handleFileError(y,null==y||"AbortError"!=y.name)}});if(null!=m&&this.spinner.spin(document.body,mxResources.get("saving"),u,3*this.timeout))try{this.clearStatus(),this.editor.graph.isEditing()&&this.editor.graph.stopEditing(),b==m.getTitle()?m.save(!0,q,u):m.saveAs(b,q,u)}catch(y){u(y)}};App.prototype.getExtensionForService=function(b){b=this.getServiceForName(b);return null!=b?b.extension:".drawio"};App.prototype.getServiceForName=function(b){return b==App.MODE_GOOGLE?this.drive:b==App.MODE_ONEDRIVE?this.oneDrive:b==App.MODE_M365?this.m365:b==App.MODE_DROPBOX?this.dropbox:b==App.MODE_GITHUB?this.gitHub:b==App.MODE_GITLAB?this.gitLab:b==App.MODE_TRELLO?this.trello:null};@@ -15171,8 +15175,8 @@ function(){localStorage.setItem(k,b)}),null==localStorage.getItem(k)?m():this.coApp.prototype.descriptorChanged=function(){var b=this.getCurrentFile();if(null!=b){if(null!=this.fname){this.fname.innerText="";var k=null!=b.getTitle()?b.getTitle():this.defaultFilename;mxUtils.write(this.fname,k)}k=this.editor.graph;var m=b.isEditable();k.isEnabled()&&!m&&k.reset();k.setEnabled(m);null==urlParams.rev&&(this.updateDocumentTitle(),k=b.getHash(),0<k.length?(k!=this.getDiagramId()&&(window.location.hash=k),this.updateHashObject()):0<window.location.hash.length&&(window.location.hash=""))}this.updateUi();null==this.format||null!=b&&this.fileEditable==b.isEditable()||!this.editor.graph.isSelectionEmpty()||(this.format.refresh(),this.fileEditable=null!=b?b.isEditable():null);this.fireEvent(new mxEventObject("fileDescriptorChanged","file",b))};App.prototype.showAuthDialog=function(b,k,m,d){var q=this.spinner.pause();this.showDialog((new AuthDialog(this,b,k,mxUtils.bind(this,function(u){try{null!=m&&m(u,mxUtils.bind(this,function(){this.hideDialog();q()}))}catch(y){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(y.message))}))}}))).container,300,k?180:140,!0,!0,mxUtils.bind(this,function(u){null!=d&&d(u);u&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};-App.prototype.convertFile=function(b,k,m,d,q,u,y,A){var J=k;/\.svg$/i.test(J)||(J=J.substring(0,k.lastIndexOf("."))+d);var K=!1;null!=this.gitHub&&b.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(K=!0);if(/\.v(dx|sdx?)$/i.test(k)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var H=new XMLHttpRequest;H.open("GET",b,!0);K||(H.responseType="blob");if(A)for(var G in A)H.setRequestHeader(G,A[G]);H.onload=mxUtils.bind(this,function(){if(200<=-H.status&&299>=H.status){var f=null;K?(f=JSON.parse(H.responseText),f=this.base64ToBlob(f.content,"application/octet-stream")):f=new Blob([H.response],{type:"application/octet-stream"});this.importVisio(f,mxUtils.bind(this,function(l){q(new LocalFile(this,l,J,!0))}),u,k)}else null!=u&&u({message:mxResources.get("errorLoadingFile")})});H.onerror=u;H.send()}else{var c=mxUtils.bind(this,function(f){try{if(/\.pdf$/i.test(k)){var l=Editor.extractGraphModelFromPdf(f);null!=l&&0<l.length&&q(new LocalFile(this,+App.prototype.convertFile=function(b,k,m,d,q,u,y,A){var J=k;/\.svg$/i.test(J)||(J=J.substring(0,k.lastIndexOf("."))+d);var K=!1;null!=this.gitHub&&b.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(K=!0);if(/\.v(dx|sdx?)$/i.test(k)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var F=new XMLHttpRequest;F.open("GET",b,!0);K||(F.responseType="blob");if(A)for(var H in A)F.setRequestHeader(H,A[H]);F.onload=mxUtils.bind(this,function(){if(200<=+F.status&&299>=F.status){var f=null;K?(f=JSON.parse(F.responseText),f=this.base64ToBlob(f.content,"application/octet-stream")):f=new Blob([F.response],{type:"application/octet-stream"});this.importVisio(f,mxUtils.bind(this,function(l){q(new LocalFile(this,l,J,!0))}),u,k)}else null!=u&&u({message:mxResources.get("errorLoadingFile")})});F.onerror=u;F.send()}else{var c=mxUtils.bind(this,function(f){try{if(/\.pdf$/i.test(k)){var l=Editor.extractGraphModelFromPdf(f);null!=l&&0<l.length&&q(new LocalFile(this,l,J,!0))}else/\.png$/i.test(k)?(l=this.extractGraphModelFromPng(f),null!=l?q(new LocalFile(this,l,J,!0)):q(new LocalFile(this,f,k,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(f,b)?this.parseFileData(f,mxUtils.bind(this,function(n){4==n.readyState&&(200<=n.status&&299>=n.status?q(new LocalFile(this,n.responseText,J,!0)):null!=u&&u({message:mxResources.get("errorLoadingFile")}))}),k):q(new LocalFile(this,f,J,!0))}catch(n){null!=u&&u(n)}});m=/\.png$/i.test(k)||/\.jpe?g$/i.test(k)||/\.pdf$/i.test(k)||null!=m&&"image/"==m.substring(0,6);K?mxUtils.get(b,mxUtils.bind(this,function(f){if(200<=f.getStatus()&&299>=f.getStatus()){if(null!=q){f=JSON.parse(f.getText());var l=f.content;"base64"===f.encoding&&(l=/\.png$/i.test(k)?"data:image/png;base64,"+l:/\.pdf$/i.test(k)?"data:application/pdf;base64,"+l:window.atob?atob(l):Base64.decode(l));c(l)}}else null!=u&&u({code:App.ERROR_UNKNOWN})}),function(){null!=u&&u({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=u&&u({code:App.ERROR_TIMEOUT,retry:fn})},A):null!=y?y(b,c,u,m):this.editor.loadUrl(b,c,u,m,null,null,null,A)}};@@ -15193,14 +15197,14 @@ App.prototype.hideUserPanel=function(){null!=this.userPanel&&null!=this.userPaneApp.prototype.toggleUserPanel=function(){if(null==this.userPanel){var b=document.createElement("div");b.className="geDialog geInlineDialog";b.style.minWidth="300px";this.userPanel=b;mxEvent.addListener(document.body,"click",mxUtils.bind(this,function(y){mxEvent.isConsumed(y)||this.hideUserPanel()}))}if(null!=this.userPanel.parentNode)this.userPanel.parentNode.removeChild(this.userPanel);else{var k=!1;this.userPanel.innerText="";b=document.createElement("div");b.className="geButton";b.setAttribute("title",mxResources.get("close"));b.style.backgroundImage="url("+Editor.crossImage+")";b.style.position="absolute";b.style.right="0px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideUserPanel()}));this.userPanel.appendChild(b);if(null!=this.drive){var m=this.drive.getUsersList();if(0<m.length){var d=mxUtils.bind(this,function(y,A){var J=this.getCurrentFile();null!=J&&J.constructor==DriveFile?(this.spinner.spin(document.body,A),this.fileLoaded(null),window.setTimeout(mxUtils.bind(this,function(){this.spinner.stop();y()}),2E3)):y()});b=mxUtils.bind(this,function(y){var A=document.createElement("tr"),J=document.createElement("td");J.setAttribute("valig","middle");J.style.height="59px";J.style.width="66px";var K=document.createElement("img");K.setAttribute("width","50");K.setAttribute("height","50");K.setAttribute("border","0");K.setAttribute("src",null!=y.pictureUrl?y.pictureUrl:Editor.userImage);K.style.borderRadius="50%";K.style.margin="4px 8px 0 8px";J.appendChild(K);A.appendChild(J);-J=document.createElement("td");J.setAttribute("valign","middle");J.style.whiteSpace="nowrap";J.style.paddingTop="4px";J.style.maxWidth="0";J.style.overflow="hidden";J.style.textOverflow="ellipsis";mxUtils.write(J,y.displayName+(y.isCurrent&&1<m.length?" ("+mxResources.get("default")+")":""));null!=y.email&&(mxUtils.br(J),K=document.createElement("small"),K.style.color="gray",mxUtils.write(K,y.email),J.appendChild(K));K=document.createElement("div");K.style.marginTop="4px";var H=document.createElement("i");-mxUtils.write(H,mxResources.get("googleDrive"));K.appendChild(H);J.appendChild(K);A.appendChild(J);y.isCurrent?A.setAttribute("title","User ID: "+y.id):(A.setAttribute("title",mxResources.get("login")+" (User ID: "+y.id+")"),A.style.cursor="pointer",A.style.opacity="0.3",mxEvent.addListener(A,"mouseenter",mxUtils.bind(this,function(){A.style.opacity="1"})),mxEvent.addListener(A,"mouseleave",mxUtils.bind(this,function(){A.style.opacity="0.3"})),mxEvent.addListener(A,"click",mxUtils.bind(this,function(G){this.hideUserPanel();-d(mxUtils.bind(this,function(){this.stateArg=null;this.drive.setUser(y);this.drive.authorize(!0,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(c){this.handleError(c)}),!0)}),mxResources.get("changeUser")+"...");mxEvent.consume(G)})));return A});k=!0;var q=document.createElement("table");q.style.borderSpacing="0";q.style.fontSize="10pt";q.style.width="100%";q.style.padding="10px";for(var u=0;u<m.length;u++)q.appendChild(b(m[u]));+J=document.createElement("td");J.setAttribute("valign","middle");J.style.whiteSpace="nowrap";J.style.paddingTop="4px";J.style.maxWidth="0";J.style.overflow="hidden";J.style.textOverflow="ellipsis";mxUtils.write(J,y.displayName+(y.isCurrent&&1<m.length?" ("+mxResources.get("default")+")":""));null!=y.email&&(mxUtils.br(J),K=document.createElement("small"),K.style.color="gray",mxUtils.write(K,y.email),J.appendChild(K));K=document.createElement("div");K.style.marginTop="4px";var F=document.createElement("i");+mxUtils.write(F,mxResources.get("googleDrive"));K.appendChild(F);J.appendChild(K);A.appendChild(J);y.isCurrent?A.setAttribute("title","User ID: "+y.id):(A.setAttribute("title",mxResources.get("login")+" (User ID: "+y.id+")"),A.style.cursor="pointer",A.style.opacity="0.3",mxEvent.addListener(A,"mouseenter",mxUtils.bind(this,function(){A.style.opacity="1"})),mxEvent.addListener(A,"mouseleave",mxUtils.bind(this,function(){A.style.opacity="0.3"})),mxEvent.addListener(A,"click",mxUtils.bind(this,function(H){this.hideUserPanel();+d(mxUtils.bind(this,function(){this.stateArg=null;this.drive.setUser(y);this.drive.authorize(!0,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(c){this.handleError(c)}),!0)}),mxResources.get("changeUser")+"...");mxEvent.consume(H)})));return A});k=!0;var q=document.createElement("table");q.style.borderSpacing="0";q.style.fontSize="10pt";q.style.width="100%";q.style.padding="10px";for(var u=0;u<m.length;u++)q.appendChild(b(m[u]));this.userPanel.appendChild(q);b=document.createElement("div");b.style.textAlign="left";b.style.padding="10px";b.style.whiteSpace="nowrap";b.style.borderTopStyle="solid";b.style.borderTopWidth="1px";q=mxUtils.button(mxResources.get("signOut"),mxUtils.bind(this,function(){this.confirm(mxResources.get("areYouSure"),mxUtils.bind(this,function(){d(mxUtils.bind(this,function(){this.stateArg=null;this.drive.logout();this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxResources.get("signOut"))}))}));q.className="geBtn";q.style.float="right";b.appendChild(q);q=mxUtils.button(mxResources.get("addAccount"),mxUtils.bind(this,function(){var y=this.drive.createAuthWin();y.blur();window.focus();d(mxUtils.bind(this,function(){this.stateArg=null;this.drive.authorize(!1,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(A){this.handleError(A)}),!0,y)}),mxResources.get("closingFile")+"...")}));q.className="geBtn";q.style.margin="0px";-b.appendChild(q);this.userPanel.appendChild(b)}}b=mxUtils.bind(this,function(y,A,J,K){if(null!=y){k&&this.userPanel.appendChild(document.createElement("hr"));k=!0;var H=document.createElement("table");H.style.borderSpacing="0";H.style.fontSize="10pt";H.style.width="100%";H.style.padding="10px";var G=document.createElement("tbody"),c=document.createElement("tr"),f=document.createElement("td");f.setAttribute("valig","top");f.style.width="40px";if(null!=A){var l=document.createElement("img");l.setAttribute("width",+b.appendChild(q);this.userPanel.appendChild(b)}}b=mxUtils.bind(this,function(y,A,J,K){if(null!=y){k&&this.userPanel.appendChild(document.createElement("hr"));k=!0;var F=document.createElement("table");F.style.borderSpacing="0";F.style.fontSize="10pt";F.style.width="100%";F.style.padding="10px";var H=document.createElement("tbody"),c=document.createElement("tr"),f=document.createElement("td");f.setAttribute("valig","top");f.style.width="40px";if(null!=A){var l=document.createElement("img");l.setAttribute("width","40");l.setAttribute("height","40");l.setAttribute("border","0");l.setAttribute("src",A);l.style.marginRight="6px";f.appendChild(l)}c.appendChild(f);f=document.createElement("td");f.setAttribute("valign","middle");f.style.whiteSpace="nowrap";f.style.maxWidth="0";f.style.overflow="hidden";f.style.textOverflow="ellipsis";mxUtils.write(f,y.displayName);null!=y.email&&(mxUtils.br(f),A=document.createElement("small"),A.style.color="gray",mxUtils.write(A,y.email),f.appendChild(A));null!=K&&(y=document.createElement("div"),-y.style.marginTop="4px",A=document.createElement("i"),mxUtils.write(A,K),y.appendChild(A),f.appendChild(y));c.appendChild(f);G.appendChild(c);H.appendChild(G);this.userPanel.appendChild(H);y=document.createElement("div");y.style.textAlign="center";y.style.padding="10px";y.style.whiteSpace="nowrap";null!=J&&(J=mxUtils.button(mxResources.get("signOut"),J),J.className="geBtn",y.appendChild(J));this.userPanel.appendChild(y)}});null!=this.dropbox&&b(this.dropbox.getUser(),IMAGE_PATH+"/dropbox-logo.svg",+y.style.marginTop="4px",A=document.createElement("i"),mxUtils.write(A,K),y.appendChild(A),f.appendChild(y));c.appendChild(f);H.appendChild(c);F.appendChild(H);this.userPanel.appendChild(F);y=document.createElement("div");y.style.textAlign="center";y.style.padding="10px";y.style.whiteSpace="nowrap";null!=J&&(J=mxUtils.button(mxResources.get("signOut"),J),J.className="geBtn",y.appendChild(J));this.userPanel.appendChild(y)}});null!=this.dropbox&&b(this.dropbox.getUser(),IMAGE_PATH+"/dropbox-logo.svg",mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null!=y&&y.constructor==DropboxFile){var A=mxUtils.bind(this,function(){this.dropbox.logout();window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,A,mxResources.get("cancel"),mxResources.get("discardChanges")):A()}else this.dropbox.logout()}),mxResources.get("dropbox"));null!=this.oneDrive&&b(this.oneDrive.getUser(),IMAGE_PATH+"/onedrive-logo.svg",this.oneDrive.noLogout?null:mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null==y||y.constructor!=OneDriveFile||y.isSP)this.oneDrive.logout();else{var A=mxUtils.bind(this,function(){this.oneDrive.logout();window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,A,mxResources.get("cancel"),mxResources.get("discardChanges")):A()}}),mxResources.get("oneDrive"));null!=this.m365&&b(this.m365.getUser(),IMAGE_PATH+"/onedrive-logo.svg",this.m365.noLogout?null:mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null!=y&&y.constructor==OneDriveFile&&y.isSP){var A=mxUtils.bind(this,function(){this.m365.logout();window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,A,mxResources.get("cancel"),mxResources.get("discardChanges")):A()}else this.m365.logout()}),mxResources.get("m365"));null!=this.gitHub&&b(this.gitHub.getUser(),IMAGE_PATH+"/github-logo.svg",mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null!=y&&y.constructor==GitHubFile){var A=mxUtils.bind(this,function(){this.gitHub.logout();@@ -15283,21 +15287,21 @@ I||null==I.boundingBox||!isNaN(I.boundingBox.x)&&!isNaN(I.boundingBox.y)&&!isNaNO.cell.id,O.text),I=!1);I||C++;E++});console.log("states checked",E,"invalid",C)}));d.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var z=null!=d.pages&&null!=d.getCurrentFile()?d.getCurrentFile().getAnonymizedXmlForPages(d.pages):"";z=new TextareaDialog(d,"Paste Data:",z,function(g){if(0<g.length)try{var p=function(O){function Q(ha){if(null==ba[ha]){if(ba[ha]=!0,null!=M[ha]){for(;0<M[ha].length;){var la=M[ha].pop();Q(la)}delete M[ha]}}else mxLog.debug(V+": Visited: "+ha)}var V=O.parentNode.id,W=O.childNodes;O={};for(var M={},X=null,Z={},Y=0;Y<W.length;Y++){var aa=W[Y];if(null!=aa.id&&0<aa.id.length)if(null==O[aa.id]){O[aa.id]=aa.id;var da=aa.getAttribute("parent");null==da?null!=X?mxLog.debug(V+": Multiple roots: "+aa.id):X=aa.id:(null==M[da]&&(M[da]=[]),M[da].push(aa.id))}else Z[aa.id]=aa.id}W=Object.keys(Z);0<W.length?(W=V+": "+W.length+" Duplicates: "+W.join(", "),mxLog.debug(W+" (see console)")):mxLog.debug(V+": Checked");var ba={};null==X?mxLog.debug(V+": No root"):(Q(X),Object.keys(ba).length!=Object.keys(O).length&&(mxLog.debug(V+": Invalid tree: (see console)"),console.log(V+": Invalid tree",M)))};"<"!=g.charAt(0)&&(g=Graph.decompress(g),mxLog.debug("See console for uncompressed XML"),console.log("xml",g));var v=mxUtils.parseXml(g),C=d.getPagesForNode(v.documentElement,"mxGraphModel");if(null!=C&&0<C.length)try{var E=d.getHashValueForPages(C);mxLog.debug("Checksum: ",E)}catch(O){mxLog.debug("Error: ",O.message)}else mxLog.debug("No pages found for checksum");var I=v.getElementsByTagName("root");-for(g=0;g<I.length;g++)p(I[g]);mxLog.show()}catch(O){d.handleError(O),null!=window.console&&console.error(O)}});d.showDialog(z.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));z.init()}));var H=null;d.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=d.pages){var z=new TextareaDialog(d,"Diff/Sync:","",function(g){var p=d.getCurrentFile();if(0<g.length&&null!=p)try{var v=JSON.parse(g);p.patch([v],null,!0,!0);d.hideDialog()}catch(C){d.handleError(C)}},null,"Close",-null,null,null,!0,null,"Patch",null,[["Snapshot",function(g,p){try{H=d.getPagesForXml(d.getFileData(!0)),z.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "+d.getHashValueForPages(H)}catch(v){d.handleError(v)}}],["Diff",function(g,p){try{z.textarea.value=JSON.stringify(d.diffPages(H,d.pages),null,2)}catch(v){d.handleError(v)}}]]);if(null==H)try{H=d.getPagesForXml(d.getFileData(!0)),z.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+d.getHashValueForPages(H)}catch(g){d.handleError(g)}else z.textarea.value=-JSON.stringify(d.diffPages(H,d.pages),null,2);d.showDialog(z.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));z.init()}else d.alert("No pages")}));d.actions.addAction("testChecksum",mxUtils.bind(this,function(){var z=d.getCurrentFile();null!=d.pages&&null!=z?d.spinner.spin(document.body,mxResources.get("loading"))&&z.getLatestVersion(function(g){d.spinner.stop();var p=d.getHashValueForPages(d.pages),v=z.getCurrentRevisionId(),C=d.getHashValueForPages(g.getShadowPages()),E=g.getDescriptorChecksum(g.getDescriptor()),+for(g=0;g<I.length;g++)p(I[g]);mxLog.show()}catch(O){d.handleError(O),null!=window.console&&console.error(O)}});d.showDialog(z.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));z.init()}));var F=null;d.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=d.pages){var z=new TextareaDialog(d,"Diff/Sync:","",function(g){var p=d.getCurrentFile();if(0<g.length&&null!=p)try{var v=JSON.parse(g);p.patch([v],null,!0,!0);d.hideDialog()}catch(C){d.handleError(C)}},null,"Close",+null,null,null,!0,null,"Patch",null,[["Snapshot",function(g,p){try{F=d.getPagesForXml(d.getFileData(!0)),z.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "+d.getHashValueForPages(F)}catch(v){d.handleError(v)}}],["Diff",function(g,p){try{z.textarea.value=JSON.stringify(d.diffPages(F,d.pages),null,2)}catch(v){d.handleError(v)}}]]);if(null==F)try{F=d.getPagesForXml(d.getFileData(!0)),z.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+d.getHashValueForPages(F)}catch(g){d.handleError(g)}else z.textarea.value=+JSON.stringify(d.diffPages(F,d.pages),null,2);d.showDialog(z.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));z.init()}else d.alert("No pages")}));d.actions.addAction("testChecksum",mxUtils.bind(this,function(){var z=d.getCurrentFile();null!=d.pages&&null!=z?d.spinner.spin(document.body,mxResources.get("loading"))&&z.getLatestVersion(function(g){d.spinner.stop();var p=d.getHashValueForPages(d.pages),v=z.getCurrentRevisionId(),C=d.getHashValueForPages(g.getShadowPages()),E=g.getDescriptorChecksum(g.getDescriptor()),I=g.getCurrentRevisionId();console.log("Local File",[z],"modified",z.isModified(),"checksum",p);console.log("Remote File",[g],"rev",I==v,"desc",E==C,"checksum",C);d.alert("Checksums "+(C==p?"match":"no not match"))},function(g){console.log("Error getLatestVersion",g);d.handleError(g)}):console.log("Checksum: no file or pages")}));d.actions.addAction("testCheckPages",mxUtils.bind(this,function(){var z=d.getCurrentFile();console.log("editorUi",d,"file",z);if(null!=z&&z.isRealtime()){console.log("Checksum ownPages",d.getHashValueForPages(z.ownPages));console.log("Checksum theirPages",d.getHashValueForPages(z.theirPages));console.log("diff ownPages/theirPages",d.diffPages(z.ownPages,z.theirPages));var g=z.getShadowPages();null!=g&&(console.log("Checksum shadowPages",d.getHashValueForPages(g)),console.log("diff shadowPages/ownPages",d.diffPages(g,z.ownPages)),console.log("diff ownPages/shadowPages",d.diffPages(z.ownPages,g)),console.log("diff theirPages/shadowPages",d.diffPages(z.theirPages,g)));null!=z.sync&&null!=z.sync.snapshot&&(console.log("Checksum snapshot",d.getHashValueForPages(z.sync.snapshot)),console.log("diff ownPages/snapshot",d.diffPages(z.ownPages,z.sync.snapshot)),console.log("diff theirPages/snapshot",d.diffPages(z.theirPages,z.sync.snapshot)),null!=d.pages&&console.log("diff snapshot/actualPages",d.diffPages(z.sync.snapshot,d.pages)));null!=d.pages&&(console.log("diff ownPages/actualPages",d.diffPages(z.ownPages,d.pages)),console.log("diff theirPages/actualPages",d.diffPages(z.theirPages,d.pages)))}null!=z&&console.log("Shadow pages",[d.getXmlForPages(z.getShadowPages())]);null!=d.pages&&console.log("Checksum actualPages",d.getHashValueForPages(d.pages))}));d.actions.addAction("testFixPages",mxUtils.bind(this,function(){console.log("editorUi",d);var z=d.getCurrentFile();null!=z&&z.isRealtime()&&null!=z.shadowPages&&(console.log("patching actualPages to shadowPages",z.patch([d.diffPages(z.shadowPages,d.pages)])),z.ownPages=d.clonePages(d.pages),z.theirPages=d.clonePages(d.pages),z.shadowPages=d.clonePages(d.pages),null!=z.sync&&(z.sync.snapshot=d.clonePages(d.pages)))}));d.actions.addAction("testOptimize",mxUtils.bind(this,function(){q.model.beginUpdate();try{var z=q.model.cells,g=0,p=[],v=[],C;for(C in z){var E=z[C],I=q.getCurrentCellStyle(E)[mxConstants.STYLE_IMAGE];null!=I&&"data:"==I.substring(0,5)&&(null==p[I]&&(p[I]=(p[I]||0)+1,g++),v.push(E))}q.setCellStyles(mxConstants.STYLE_IMAGE,null,v);console.log("Removed",g,"image(s) from",v.length,"cell(s): ",[v,p])}finally{q.model.endUpdate()}}));d.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(d,q.getModel())}));d.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var z=new mxImageExport,g=q.getGraphBounds(),p=q.view.scale,v=mxUtils.createXmlDocument(),C=v.createElement("output");v.appendChild(C);v=new mxXmlCanvas2D(C);v.translate(Math.floor((1-g.x)/p),Math.floor((1-g.y)/p));v.scale(1/p);var E=0,I=v.save;v.save=function(){E++;I.apply(this,arguments)};var O=v.restore;v.restore=function(){E--;O.apply(this,-arguments)};var Q=z.drawShape;z.drawShape=function(V){mxLog.debug("entering shape",V,E);Q.apply(this,arguments);mxLog.debug("leaving shape",V,E)};z.drawState(q.getView().getState(q.model.root),v);mxLog.show();mxLog.debug(mxUtils.getXml(C));mxLog.debug("stateCounter",E)}));d.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-2});var G=null,c=null,f=null,l=null,n=null,r=null,t=null,x=null;d.actions.addAction("testPerformance",-mxUtils.bind(this,function(){null!=G?(q.view.revalidate=G,G=null):(G=q.view.revalidate,q.view.revalidate=function(){var z=Date.now(),g=G.apply(this,arguments);EditorUi.debug("[Performance] mxGraphView.revalidate",[this],"time",Date.now()-z+" ms","args",arguments);return g});null!=c?(d.selectPage=c,c=null):(c=d.selectPage,d.selectPage=function(){var z=Date.now(),g=c.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.selectPage",[this],"time",Date.now()-z+" ms","args",arguments);return g});+arguments)};var Q=z.drawShape;z.drawShape=function(V){mxLog.debug("entering shape",V,E);Q.apply(this,arguments);mxLog.debug("leaving shape",V,E)};z.drawState(q.getView().getState(q.model.root),v);mxLog.show();mxLog.debug(mxUtils.getXml(C));mxLog.debug("stateCounter",E)}));d.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-2});var H=null,c=null,f=null,l=null,n=null,r=null,t=null,x=null;d.actions.addAction("testPerformance",+mxUtils.bind(this,function(){null!=H?(q.view.revalidate=H,H=null):(H=q.view.revalidate,q.view.revalidate=function(){var z=Date.now(),g=H.apply(this,arguments);EditorUi.debug("[Performance] mxGraphView.revalidate",[this],"time",Date.now()-z+" ms","args",arguments);return g});null!=c?(d.selectPage=c,c=null):(c=d.selectPage,d.selectPage=function(){var z=Date.now(),g=c.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.selectPage",[this],"time",Date.now()-z+" ms","args",arguments);return g});null!=f?(d.diffPages=f,f=null):(f=d.diffPages,d.diffPages=function(){var z=Date.now(),g=f.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.diffPages",[this],"time",Date.now()-z+" ms","args",arguments);return g});null!=l?(d.patchPages=l,l=null):(l=d.patchPages,d.patchPages=function(){var z=Date.now(),g=l.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.patchPages",[this],"time",Date.now()-z+" ms","args",arguments);return g});null!=n?(d.clonePages=n,n=null):(n=d.clonePages,d.clonePages=function(){var z=Date.now(),g=n.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.clonePages",[this],"time",Date.now()-z+" ms","args",arguments);return g});null!=t?(d.getHashValueForPages=t,t=null):(t=d.getHashValueForPages,d.getHashValueForPages=function(){var z=Date.now(),g=t.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getHashValueForPages",[this],"time",Date.now()-z+" ms","args",arguments);return g});null!=x?(d.resolveCrossReferences=x,x=null):(x=d.resolveCrossReferences,-d.resolveCrossReferences=function(){var z=Date.now(),g=x.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.resolveCrossReferences",[this],"time",Date.now()-z+" ms","args",arguments);return g});null!=r?(d.getFileData=r,r=null):(r=d.getFileData,d.getFileData=function(){var z=Date.now(),g=r.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getFileData",[this],"time",Date.now()-z+" ms","args",arguments);return g});EditorUi.debug("[Performance]",null!=G?"Enabled":"Disabled")}));this.put("testDevelop",-new Menu(mxUtils.bind(this,function(z,g){this.addMenuItems(z,"createSidebarEntry showBoundingBox - testCheckPages testChecksum testFixPages - testCheckFile testDiff - testInspect testOptimize - testXmlImageExport -".split(" "),g);var p=z.addItem(mxResources.get("testPerformance"),null,function(){d.actions.get("testPerformance").funct()},g);null!=G&&z.addCheckmark(p,Editor.checkmarkImage);this.addMenuItems(z,["-","testShowConsole"],g)})))}d.actions.put("shapes",new Action("moreShapes...",function(z){mxClient.IS_CHROMEAPP||+d.resolveCrossReferences=function(){var z=Date.now(),g=x.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.resolveCrossReferences",[this],"time",Date.now()-z+" ms","args",arguments);return g});null!=r?(d.getFileData=r,r=null):(r=d.getFileData,d.getFileData=function(){var z=Date.now(),g=r.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getFileData",[this],"time",Date.now()-z+" ms","args",arguments);return g});EditorUi.debug("[Performance]",null!=H?"Enabled":"Disabled")}));this.put("testDevelop",+new Menu(mxUtils.bind(this,function(z,g){this.addMenuItems(z,"createSidebarEntry showBoundingBox - testCheckPages testChecksum testFixPages - testCheckFile testDiff - testInspect testOptimize - testXmlImageExport -".split(" "),g);var p=z.addItem(mxResources.get("testPerformance"),null,function(){d.actions.get("testPerformance").funct()},g);null!=H&&z.addCheckmark(p,Editor.checkmarkImage);this.addMenuItems(z,["-","testShowConsole"],g)})))}d.actions.put("shapes",new Action("moreShapes...",function(z){mxClient.IS_CHROMEAPP||!d.isOffline()?d.showDialog((new MoreShapesDialog(d,!0)).container,680,isLocalStorage?mxClient.IS_IOS?500:480:460,!0,!0):d.showDialog((new MoreShapesDialog(d,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)}));d.actions.put("createShape",new Action("shape...",function(z){q.isEnabled()&&(z=new mxCell("",new mxGeometry(0,0,120,120),d.defaultCustomShapeStyle),z.vertex=!0,z=new EditShapeDialog(d,z,mxResources.get("editShape")),d.showDialog(z.container,640,480,!0,!1,null,null,null,new mxRectangle(0,0,300,200),null,"createShape"),z.init())})).isEnabled=u;d.isOffline()||("1"!=urlParams.embed&&(d.actions.put("embedNotion",new Action("notion...",function(){var z=document.createElement("div");z.style.position="absolute";z.style.bottom="12px";z.style.textAlign="center";z.style.width="100%";z.style.left="0px";var g=document.createElement("a");g.setAttribute("href","javascript:void(0);");g.setAttribute("target","_blank");g.style.cursor="pointer";mxUtils.write(g,mxResources.get("getNotionChromeExtension"));z.appendChild(g);mxUtils.setPrefixedStyle(g.style,"transition","all 1s ease");mxUtils.setOpacity(g,0);window.setTimeout(function(){mxUtils.setOpacity(g,100)},300);mxEvent.addListener(g,"click",function(p){d.openLink("https://chrome.google.com/webstore/detail/drawio-for-notion/plhaalebpkihaccllnkdaokdoeaokmle");mxEvent.consume(p)});d.getPublicUrl(d.getCurrentFile(),function(p){d.showPublishLinkDialog(mxResources.get("notion"),null,null,!0,"https://www.drawio.com/blog/drawio-notion",z,p,d.getCurrentFile(),@@ -15342,8 +15346,8 @@ Editor.zoomOutImage,mxResources.get("zoomOut"));X(function(){Q.zoomIn();O.chromedocument.body.style.overflow=V;for(var da=0;da<v.length;da++)urlParams[v[da]]=p[v[da]];Y.apply(this,arguments)};var aa=function(da){27==da.keyCode&&O.destroy()};mxEvent.addListener(document.documentElement,"keydown",aa);document.body.appendChild(C);document.body.appendChild(W);window.setTimeout(function(){try{O.setFileData(d.getFileData(!0)),Z(),O.lightboxFit(),O.chromelessResize()}catch(da){O.handleError(da,null,function(){O.destroy()})}},0)}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var z=d.getCurrentFile();null!=z&&z.share()}catch(g){d.handleError(g)}})).isEnabled=u;this.put("embed",new Menu(mxUtils.bind(this,function(z,g){var p=d.getCurrentFile();null==p||p.getMode()!=App.MODE_GOOGLE&&p.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(p.getTitle())||this.addMenuItems(z,["liveImage","-"],g);this.addMenuItems(z,["embedImage","embedSvg","-","embedHtml"],g);navigator.standalone||d.isOffline()||this.addMenuItems(z,["embedIframe"],g);this.addMenuItems(z,["-","microsoftOffice","-","embedNotion"],g)})));y=function(z){var g=mxResources.get(z);d.actions.put(z,new Action(g+"...",function(p){p=new ParseDialog(d,g,z);d.showDialog(p.container,640,420,!0,!1,null,null,null,new mxRectangle(0,0,440,280));p.init()})).isEnabled=u};var B=function(z,g,p,v){d.actions.put(z,new Action(mxResources.get(z),function(){if(q.isEnabled()&&!q.isCellLocked(q.getDefaultParent())){var C=new mxCell("",new mxGeometry(0,0,0,0),g);C.vertex=!0;for(var E=q.getFreeInsertPoint(),I=[],O=0;O<v.nodes.length;O++){var Q=-new mxCell(v.nodes[O],new mxGeometry(E.x+20,E.y+20,100,40),"whiteSpace=wrap;html=1;");Q.vertex=!0;I.push(C.insert(Q))}for(O=0;O<v.edges.length;O++)E=new mxCell("",new mxGeometry,p),E.geometry.relative=!0,E.edge=!0,I[v.edges[O][0]].insertEdge(E,!0),I[v.edges[O][1]].insertEdge(E,!1),C.insert(E);T(C)}})).isEnabled=u},F={nodes:["Root","Child 1","Child 2"],edges:[[0,1],[0,2]]},L={nodes:["Start","Task","Task","End"],edges:[[0,1],[0,2],[1,3],[2,3]]},D=function(z,g){B(z,Menus.layoutContainers[z].style,Menus.layoutContainerEdgeStyle,-g)};D("horizontalFlow",L);D("verticalFlow",L);D("horizontalTree",F);D("verticalTree",F);D("radialTree",F);D("organic",F);D("circle",F);y("mermaid");y("fromText");y("formatSql");y("plantUml");var T=function(z){q.getModel().beginUpdate();try{z=q.addCell(z),q.fireEvent(new mxEventObject("cellsInserted","cells",[z])),q.model.isVertex(z)&&q.isAutoSizeCell(z)&&q.updateCellSize(z)}finally{q.getModel().endUpdate()}q.scrollCellToVisible(z);q.setSelectionCell(z);q.container.focus();q.editAfterInsert&&q.startEditing(z);+new mxCell(v.nodes[O],new mxGeometry(E.x+20,E.y+20,100,40),"whiteSpace=wrap;html=1;");Q.vertex=!0;I.push(C.insert(Q))}for(O=0;O<v.edges.length;O++)E=new mxCell("",new mxGeometry,p),E.geometry.relative=!0,E.edge=!0,I[v.edges[O][0]].insertEdge(E,!0),I[v.edges[O][1]].insertEdge(E,!1),C.insert(E);T(C)}})).isEnabled=u},G={nodes:["Root","Child 1","Child 2"],edges:[[0,1],[0,2]]},L={nodes:["Start","Task","Task","End"],edges:[[0,1],[0,2],[1,3],[2,3]]},D=function(z,g){B(z,Menus.layoutContainers[z].style,Menus.layoutContainerEdgeStyle,+g)};D("horizontalFlow",L);D("verticalFlow",L);D("horizontalTree",G);D("verticalTree",G);D("radialTree",G);D("organic",G);D("circle",G);y("mermaid");y("fromText");y("formatSql");y("plantUml");var T=function(z){q.getModel().beginUpdate();try{z=q.addCell(z),q.fireEvent(new mxEventObject("cellsInserted","cells",[z])),q.model.isVertex(z)&&q.isAutoSizeCell(z)&&q.updateCellSize(z)}finally{q.getModel().endUpdate()}q.scrollCellToVisible(z);q.setSelectionCell(z);q.container.focus();q.editAfterInsert&&q.startEditing(z);window.setTimeout(function(){null!=d.hoverIcons&&d.hoverIcons.update(q.view.getState(z))},0);return z},N=function(z,g,p,v,C){z=new mxCell(z,new mxGeometry(0,0,g,p),v);z.vertex=!0;null==C&&(C=q.getCenterInsertPoint(q.getBoundingBoxFromGeometry([z],!0)));z.geometry.x=C.x;z.geometry.y=C.y;return T(z)};d.actions.put("insertText",new Action("text",function(z){q.isEnabled()&&!q.isCellLocked(q.getDefaultParent())&&q.startEditingAtCell(N("Text",60,30,q.appendFontSize(Editor.defaultTextStyle,q.vertexFontSize),null==z||mxEvent.isControlDown(z)||mxEvent.isMetaDown(z)||!q.isMouseInsertPoint()?null:q.getInsertPoint()))},null,null,"A")).isEnabled=u;d.actions.put("insertRectangle",new Action("rectangle",function(z){q.isEnabled()&&!q.isCellLocked(q.getDefaultParent())&&N("",120,60,"whiteSpace=wrap;html=1;",null==z||mxEvent.isControlDown(z)||mxEvent.isMetaDown(z)||!q.isMouseInsertPoint()?null:q.getInsertPoint())},null,null,"D")).isEnabled=u;d.actions.put("insertNote",new Action("note",function(z){q.isEnabled()&&!q.isCellLocked(q.getDefaultParent())&&N("",160,160,Editor.defaultNoteStyle,null==z||mxEvent.isControlDown(z)||mxEvent.isMetaDown(z)||!q.isMouseInsertPoint()?null:q.getInsertPoint())},null,null,"S")).isEnabled=u;d.actions.put("insertEllipse",new Action("ellipse",function(z){q.isEnabled()&&!q.isCellLocked(q.getDefaultParent())&&N("",80,80,"ellipse;whiteSpace=wrap;html=1;",null==z||mxEvent.isControlDown(z)||mxEvent.isMetaDown(z)||!q.isMouseInsertPoint()?null:q.getInsertPoint())},null,null,"F")).isEnabled=@@ -15466,8 +15470,8 @@ EditorUi.prototype.clonePage=function(b){this.updatePageRoot(b);var k=new DiagraEditorUi.prototype.renamePage=function(b){if(this.editor.graph.isEnabled()){var k=new FilenameDialog(this,b.getName(),mxResources.get("rename"),mxUtils.bind(this,function(m){null!=m&&0<m.length&&this.editor.graph.model.execute(new RenamePage(this,b,m))}),mxResources.get("rename"));this.showDialog(k.container,300,80,!0,!0);k.init()}return b};EditorUi.prototype.movePage=function(b,k){this.editor.graph.model.execute(new MovePage(this,b,k))};EditorUi.prototype.sortPages=function(){var b=this.pages.slice().sort(function(q,u){return(q.getName()||"").localeCompare(u.getName()||"",void 0,{numeric:!0,sensitivity:"base"})}),k=this.editor.graph.model;k.beginUpdate();try{for(var m=0;m<b.length;m++){var d=mxUtils.indexOf(this.pages,b[m]);d!=m&&this.movePage(d,m)}}finally{k.endUpdate()}this.scrollToPage(this.currentPage,!0)};EditorUi.prototype.createTabContainer=function(){var b=document.createElement("div");b.className="geTabContainer geTabItem";return b};-EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&!this.isTabContainerVisible())this.tabContainer.style.display="none";else if(null!=this.tabContainer&&null!=this.pages){this.tabContainer.style.display="";var b=this.editor.graph,k=document.createElement("div");k.className="geTabScroller";for(var m=null,d=null,q=null,u=this,y=null!=this.tabScroller?this.tabScroller.scrollLeft:0,A=!1,J=0;J<this.pages.length;J++){var K=this.pages[J];if(null!=K){var H=K.getId(),G=K.getName()||-mxResources.get("untitled"),c=H+":"+G;c=null!=this.btPageTabCache?this.btPageTabCache[c]:null;null!=c?c.setAttribute("title",G+(null!=H?" ("+H+")":"")+" ["+(J+1)+"]"):(c=this.createTabForPage(K,J+1),A=!0);c.setAttribute("draggable","true");c.setAttribute("data-index",J);c.className="geTab gePageTab";null==c.btDndInstalled&&(c.btDndInstalled=!0,mxEvent.addListener(c,"dragstart",mxUtils.bind(this,function(n){b.isEnabled()?(mxClient.IS_FF&&n.dataTransfer.setData("Text","<diagram/>"),m=parseInt(n.currentTarget.getAttribute("data-index"),+EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&!this.isTabContainerVisible())this.tabContainer.style.display="none";else if(null!=this.tabContainer&&null!=this.pages){this.tabContainer.style.display="";var b=this.editor.graph,k=document.createElement("div");k.className="geTabScroller";for(var m=null,d=null,q=null,u=this,y=null!=this.tabScroller?this.tabScroller.scrollLeft:0,A=!1,J=0;J<this.pages.length;J++){var K=this.pages[J];if(null!=K){var F=K.getId(),H=K.getName()||+mxResources.get("untitled"),c=F+":"+H;c=null!=this.btPageTabCache?this.btPageTabCache[c]:null;null!=c?c.setAttribute("title",H+(null!=F?" ("+F+")":"")+" ["+(J+1)+"]"):(c=this.createTabForPage(K,J+1),A=!0);c.setAttribute("draggable","true");c.setAttribute("data-index",J);c.className="geTab gePageTab";null==c.btDndInstalled&&(c.btDndInstalled=!0,mxEvent.addListener(c,"dragstart",mxUtils.bind(this,function(n){b.isEnabled()?(mxClient.IS_FF&&n.dataTransfer.setData("Text","<diagram/>"),m=parseInt(n.currentTarget.getAttribute("data-index"),10),d=n.currentTarget,window.requestAnimationFrame(function(){null!=d&&d.classList.add("gePageTabDragPlaceholder")}),u._pageTabDragOverHandler=function(r){r.dataTransfer.dropEffect="move";r.preventDefault();r.target.classList&&r.target.classList.contains("gePageTab")||r.stopPropagation()},u._pageTabDropHandler=function(r){r.preventDefault();r.stopPropagation()},document.addEventListener("dragover",u._pageTabDragOverHandler,!0),document.addEventListener("drop",u._pageTabDropHandler,!0)):mxEvent.consume(n)})),mxEvent.addListener(c,"dragend",mxUtils.bind(this,function(n){if(null!=d){d.classList.remove("gePageTabDragPlaceholder");for(var r=d.parentNode.querySelectorAll(".gePageTab"),t=0,x=0;x<r.length;x++)if(r[x]==d){t=x;break}null!=m&&t!=m&&this.movePage(m,t)}null!=u._pageTabDragOverHandler&&(document.removeEventListener("dragover",u._pageTabDragOverHandler,!0),document.removeEventListener("drop",u._pageTabDropHandler,!0),u._pageTabDragOverHandler=null,u._pageTabDropHandler=null);d=m=null;n.stopPropagation();n.preventDefault()})),mxEvent.addListener(c,"dragover",function(n){if(null!=m&&null!=d){n.dataTransfer.dropEffect="move";var r=n.currentTarget;if(r!=d){var t=r.getBoundingClientRect(),x=d.parentNode;n.clientX<t.left+t.width/2?x.insertBefore(d,r):r.nextSibling!=d&&x.insertBefore(d,r.nextSibling)}}n.stopPropagation();n.preventDefault()}),mxEvent.addListener(c,"drop",function(n){n.stopPropagation();n.preventDefault()}));K==this.currentPage&&(q=c);k.appendChild(c)}}this.tabContainer.innerText="";this.isPageInsertTabVisible()&&@@ -15486,7 +15490,7 @@ EditorUi.prototype.createRightScrollTab=function(){return this.createControlTab(EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var k=new mxPopupMenu(mxUtils.bind(this,function(q,u){this.menus.get("pages").funct(q,u)}));k.smartSeparators=!0;k.showDisabled=!0;k.autoExpand=!0;k.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(k,arguments);k.destroy()});var m=mxEvent.getClientX(b),d=mxEvent.getClientY(b);k.popup(m,d,null,b);this.setCurrentMenu(k);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,k){var m=this.createTab(),d=b.getName()||mxResources.get("untitled"),q=b.getId();m.setAttribute("title",d+(null!=q?" ("+q+")":"")+" ["+k+"]");k=document.createElement("span");k.style.maxWidth="160px";k.style.textOverflow="ellipsis";k.style.overflow="hidden";mxUtils.write(k,d);m.appendChild(k);this.addTabListeners(b,m);return m};EditorUi.prototype.addTabListeners=function(b,k){mxEvent.disableContextMenu(k);var m=this.editor.graph;mxEvent.addListener(k,"dblclick",mxUtils.bind(this,function(J){this.renamePage(b);mxEvent.consume(J)}));var d=document.createElement("div");d.style.backgroundImage="url("+Editor.thinExpandImage+")";d.className="geButton";k.appendChild(d);var q=!1,u=!1,y=mxUtils.bind(this,function(J){q=null!=this.currentMenu;u=b==this.currentPage;this.scrollToPage(b);m.isMouseDown||u||this.selectPage(b)}),A=mxUtils.bind(this,-function(J){if(!m.isMouseDown&&(u&&(mxEvent.isTouchEvent(J)||mxEvent.getSource(J)==d)||mxEvent.isPopupTrigger(J))&&(m.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(J)||!q)){var K=new mxPopupMenu(this.createPageMenu(b));K.smartSeparators=!0;K.showDisabled=!0;K.autoExpand=!0;K.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(K,arguments);this.resetCurrentMenu();K.destroy()});var H=mxEvent.getClientX(J),G=mxEvent.getClientY(J);K.popup(H,G,null,J);+function(J){if(!m.isMouseDown&&(u&&(mxEvent.isTouchEvent(J)||mxEvent.getSource(J)==d)||mxEvent.isPopupTrigger(J))&&(m.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(J)||!q)){var K=new mxPopupMenu(this.createPageMenu(b));K.smartSeparators=!0;K.showDisabled=!0;K.autoExpand=!0;K.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(K,arguments);this.resetCurrentMenu();K.destroy()});var F=mxEvent.getClientX(J),H=mxEvent.getClientY(J);K.popup(F,H,null,J);this.setCurrentMenu(K,k)}mxEvent.consume(J)});mxEvent.addGestureListeners(d,y,null,A);mxEvent.addGestureListeners(k,y,null,A)};EditorUi.prototype.createPageMenu=function(b,k){return mxUtils.bind(this,function(m,d){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||navigator.standalone||m.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,!0,!0))}),d));this.editor.graph.isEnabled()&&(this.menus.addMenuItems(m,["duplicatePage","-"],d),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",m,d,mxResources.get("move")),this.menus.addMenuItems(m,["removePage","renamePage"],d))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(d,q,u,y,A){q=null!=q?q:!1;null==u&&(u=this.getFoldableCells(this.getSelectionCells(),d));this.stopEditing();this.model.beginUpdate();try{for(var J=u.slice(),K=0;K<u.length;K++)"1"==mxUtils.getValue(this.getCurrentCellStyle(u[K]),"treeFolding","0")&&this.foldTreeCell(d,u[K]);u=J;u=b.apply(this,arguments)}finally{this.model.endUpdate()}return u};Graph.prototype.foldTreeCell=function(d,q){this.model.beginUpdate();try{var u=@@ -15495,17 +15499,17 @@ function(K){return this.isTreeEdge(K)}))};Graph.prototype.getIncomingTreeEdges=fx.getCurrentCellStyle(p).treeMoving);return v}function u(p){var v=!1;null!=p&&(p=B.getParent(p),v=x.view.getState(p),v="tree"==(null!=v?v.style:x.getCellStyle(p)).containerType);return v}function y(p){for(;null!=p&&!u(p);)p=B.getParent(p);return null!=p?B.getParent(p):null}function A(p){var v=!1;null!=p&&(p=B.getParent(p),v=x.view.getState(p),x.view.getState(p),v=null!=(null!=v?v.style:x.getCellStyle(p)).childLayout);return v}function J(p,v){function C(X,Z){null!=X&&(I.cut.get(X)||(I.cut.put(X,!0),I.cells.push(X)),Z&&!O.get(X)&&(O.put(X,!0),Q.push(X)))}function E(X){if(!I.deleted.get(X)){I.deleted.put(X,!0);I.cells.push(X);X=x.getAllEdges([X]);for(var Z=0;Z<X.length;Z++)C(X[Z],!0)}}for(var I={cells:[],deleted:new mxDictionary,cut:new mxDictionary,cascaded:[]},O=new mxDictionary,Q=[],V=0;V<p.length;V++){var W=p[V];B.isEdge(W)?C(W,!1):B.isVertex(W)&&null!=y(W)?E(W):null!=W&&I.cells.push(W)}for(;0<Q.length;)if(p=B.getTerminal(Q.shift(),!1),null!=p&&!I.deleted.get(p)&&B.isVertex(p)&&(V=y(p),null!=V&&(null==v||!v.get(V)))){V=x.getIncomingTreeEdges(p);W=!0;for(var M=0;M<V.length;M++)if(!I.cut.get(V[M])){W=!1;break}W&&(I.cascaded.push(p),E(p))}return I}function K(p){p=x.view.getState(p);if(null!=p){var v=x.getIncomingTreeEdges(p.cell);if(0<v.length&&(v=x.view.getState(v[0]),null!=v&&(v=v.absolutePoints,null!=v&&0<v.length&&(v=v[v.length-1],null!=v)))){if(v.y==p.y&&Math.abs(v.x-p.getCenterX())<p.width/2)return mxConstants.DIRECTION_SOUTH;if(v.y==p.y+p.height&&Math.abs(v.x-p.getCenterX())<p.width/-2)return mxConstants.DIRECTION_NORTH;if(v.x>p.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function H(p,v,C){if(null!=C){for(var E=x.getCurrentCellStyle(v),I=["treeFolding","treeMoving","newEdgeStyle"],O=0;O<I.length;O++)null!=E[I[O]]&&(null==C.style||0>C.style.indexOf(I[O]+"="))&&(C.style=mxUtils.setStyle(C.style,I[O],E[I[O]]));null!=C.geometry&&null!=v.geometry&&(C.geometry.x=v.geometry.x,C.geometry.y=v.geometry.y);x.model.getTerminal(p[0],!1)==p[1]&&x.model.setTerminal(p[0],-C,!1);p[1]=C}return p}function G(p,v,C){v=null!=v?v:!0;x.model.beginUpdate();try{var E=x.model.getParent(p),I=x.getIncomingTreeEdges(p),O=H(x.cloneCells([I[0],p]),p,C);x.model.setTerminal(O[0],x.model.getTerminal(I[0],!0),!0);var Q=K(p),V=E.geometry;Q==mxConstants.DIRECTION_SOUTH||Q==mxConstants.DIRECTION_NORTH?O[1].geometry.x+=v?p.geometry.width+10:-O[1].geometry.width-10:O[1].geometry.y+=v?p.geometry.height+10:-O[1].geometry.height-10;x.view.currentRoot!=E&&(O[1].geometry.x-=V.x,O[1].geometry.y-=+2)return mxConstants.DIRECTION_NORTH;if(v.x>p.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function F(p,v,C){if(null!=C){for(var E=x.getCurrentCellStyle(v),I=["treeFolding","treeMoving","newEdgeStyle"],O=0;O<I.length;O++)null!=E[I[O]]&&(null==C.style||0>C.style.indexOf(I[O]+"="))&&(C.style=mxUtils.setStyle(C.style,I[O],E[I[O]]));null!=C.geometry&&null!=v.geometry&&(C.geometry.x=v.geometry.x,C.geometry.y=v.geometry.y);x.model.getTerminal(p[0],!1)==p[1]&&x.model.setTerminal(p[0],+C,!1);p[1]=C}return p}function H(p,v,C){v=null!=v?v:!0;x.model.beginUpdate();try{var E=x.model.getParent(p),I=x.getIncomingTreeEdges(p),O=F(x.cloneCells([I[0],p]),p,C);x.model.setTerminal(O[0],x.model.getTerminal(I[0],!0),!0);var Q=K(p),V=E.geometry;Q==mxConstants.DIRECTION_SOUTH||Q==mxConstants.DIRECTION_NORTH?O[1].geometry.x+=v?p.geometry.width+10:-O[1].geometry.width-10:O[1].geometry.y+=v?p.geometry.height+10:-O[1].geometry.height-10;x.view.currentRoot!=E&&(O[1].geometry.x-=V.x,O[1].geometry.y-=V.y);var W=x.view.getState(p),M=x.view.scale;if(null!=W){var X=mxRectangle.fromRectangle(W);Q==mxConstants.DIRECTION_SOUTH||Q==mxConstants.DIRECTION_NORTH?X.x+=(v?p.geometry.width+10:-O[1].geometry.width-10)*M:X.y+=(v?p.geometry.height+10:-O[1].geometry.height-10)*M;var Z=x.getOutgoingTreeEdges(x.model.getTerminal(I[0],!0));if(null!=Z){var Y=Q==mxConstants.DIRECTION_SOUTH||Q==mxConstants.DIRECTION_NORTH;for(V=I=C=0;V<Z.length;V++){var aa=x.model.getTerminal(Z[V],!1);if(Q==K(aa)){var da=x.view.getState(aa);aa!=p&&null!=da&&(Y&&v!=da.getCenterX()<W.getCenterX()||!Y&&v!=da.getCenterY()<W.getCenterY())&&mxUtils.intersects(X,da)&&(C=10+Math.max(C,(Math.min(X.x+X.width,da.x+da.width)-Math.max(X.x,da.x))/M),I=10+Math.max(I,(Math.min(X.y+X.height,da.y+da.height)-Math.max(X.y,da.y))/M))}}Y?I=0:C=0;for(V=0;V<Z.length;V++)if(aa=x.model.getTerminal(Z[V],!1),Q==K(aa)&&(da=x.view.getState(aa),aa!=p&&null!=da&&(Y&&v!=da.getCenterX()<W.getCenterX()||!Y&&v!=da.getCenterY()<W.getCenterY()))){var ba=[];x.traverse(da.cell,-!0,function(ha,la){var ra=null!=la&&x.isTreeEdge(la);ra&&ba.push(la);(null==la||ra)&&ba.push(ha);return null==la||ra});x.moveCells(ba,(v?1:-1)*C,(v?1:-1)*I)}}}return x.addCells(O,E)}finally{x.model.endUpdate()}}function c(p,v){x.model.beginUpdate();try{var C=K(p),E=x.getIncomingTreeEdges(p),I=H(x.cloneCells([E[0],p]),p,v);x.model.setTerminal(E[0],I[1],!1);x.model.setTerminal(I[0],I[1],!0);x.model.setTerminal(I[0],p,!1);var O=x.model.getParent(p),Q=O.geometry,V=[];x.view.currentRoot!=O&&(I[1].geometry.x-=+!0,function(ha,la){var ra=null!=la&&x.isTreeEdge(la);ra&&ba.push(la);(null==la||ra)&&ba.push(ha);return null==la||ra});x.moveCells(ba,(v?1:-1)*C,(v?1:-1)*I)}}}return x.addCells(O,E)}finally{x.model.endUpdate()}}function c(p,v){x.model.beginUpdate();try{var C=K(p),E=x.getIncomingTreeEdges(p),I=F(x.cloneCells([E[0],p]),p,v);x.model.setTerminal(E[0],I[1],!1);x.model.setTerminal(I[0],I[1],!0);x.model.setTerminal(I[0],p,!1);var O=x.model.getParent(p),Q=O.geometry,V=[];x.view.currentRoot!=O&&(I[1].geometry.x-=Q.x,I[1].geometry.y-=Q.y);x.traverse(p,!0,function(X,Z){var Y=null!=Z&&x.isTreeEdge(Z);Y&&V.push(Z);(null==Z||Y)&&V.push(X);return null==Z||Y});var W=p.geometry.width+40,M=p.geometry.height+40;C==mxConstants.DIRECTION_SOUTH?W=0:C==mxConstants.DIRECTION_NORTH?(W=0,M=-M):C==mxConstants.DIRECTION_WEST?(W=-W,M=0):C==mxConstants.DIRECTION_EAST&&(M=0);x.moveCells(V,W,M);return x.addCells(I,O)}finally{x.model.endUpdate()}}function f(p,v,C){x.model.beginUpdate();try{var E=x.model.getParent(p),I=x.getIncomingTreeEdges(p),-O=K(p);0==I.length&&(I=[x.createEdge(E,null,"",null,null,x.createCurrentEdgeStyle())],O=v);var Q=H(x.cloneCells([I[0],p]),p,C);x.model.setTerminal(Q[0],p,!0);null==x.model.getTerminal(Q[0],!1)&&(x.model.setTerminal(Q[0],Q[1],!1),x.applyNewEdgeStyle(Q[1],[Q[0]],O));I=x.getOutgoingTreeEdges(p);var V=E.geometry;v=[];x.view.currentRoot==E&&(V=new mxRectangle);for(C=0;C<I.length;C++){var W=x.model.getTerminal(I[C],!1);null!=W&&v.push(W)}var M=x.view.getBounds(v),X=x.view.translate,Z=x.view.scale;O==mxConstants.DIRECTION_SOUTH?+O=K(p);0==I.length&&(I=[x.createEdge(E,null,"",null,null,x.createCurrentEdgeStyle())],O=v);var Q=F(x.cloneCells([I[0],p]),p,C);x.model.setTerminal(Q[0],p,!0);null==x.model.getTerminal(Q[0],!1)&&(x.model.setTerminal(Q[0],Q[1],!1),x.applyNewEdgeStyle(Q[1],[Q[0]],O));I=x.getOutgoingTreeEdges(p);var V=E.geometry;v=[];x.view.currentRoot==E&&(V=new mxRectangle);for(C=0;C<I.length;C++){var W=x.model.getTerminal(I[C],!1);null!=W&&v.push(W)}var M=x.view.getBounds(v),X=x.view.translate,Z=x.view.scale;O==mxConstants.DIRECTION_SOUTH?(Q[1].geometry.x=null==M?p.geometry.x+(p.geometry.width-Q[1].geometry.width)/2:(M.x+M.width)/Z-X.x-V.x+10,Q[1].geometry.y+=p.geometry.height-V.y+40):O==mxConstants.DIRECTION_NORTH?(Q[1].geometry.x=null==M?p.geometry.x+(p.geometry.width-Q[1].geometry.width)/2:(M.x+M.width)/Z-X.x+-V.x+10,Q[1].geometry.y-=Q[1].geometry.height+V.y+40):(Q[1].geometry.x=O==mxConstants.DIRECTION_WEST?Q[1].geometry.x-(Q[1].geometry.width+V.x+40):Q[1].geometry.x+(p.geometry.width-V.x+40),Q[1].geometry.y=null==M?p.geometry.y+(p.geometry.height-Q[1].geometry.height)/2:(M.y+M.height)/Z-X.y+-V.y+10);return x.addCells(Q,E)}finally{x.model.endUpdate()}}function l(p,v,C){p=x.getOutgoingTreeEdges(p);C=x.view.getState(C);var E=[];if(null!=C&&null!=p){for(var I=0;I<p.length;I++){var O=x.view.getState(x.model.getTerminal(p[I],!1));null!=O&&(!v&&Math.min(O.x+O.width,C.x+C.width)>=Math.max(O.x,C.x)||v&&Math.min(O.y+O.height,C.y+C.height)>=Math.max(O.y,C.y))&&E.push(O)}E.sort(function(Q,V){return v?Q.x+Q.width-V.x-V.width:Q.y+Q.height-V.y-V.height})}return E}function n(p,v){var C=K(p),E=v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST;(C==mxConstants.DIRECTION_EAST||C==mxConstants.DIRECTION_WEST)==E&&C!=v?t.actions.get("selectParent").funct():C==v?(v=x.getOutgoingTreeEdges(p),null!=v&&0<v.length&&x.setSelectionCell(x.model.getTerminal(v[0],!1))):(C=x.getIncomingTreeEdges(p),null!=C&&0<C.length&&(E=l(x.model.getTerminal(C[0],!0),E,p),p=x.view.getState(p),null!=p&&(p=mxUtils.indexOf(E,p),0<=p&&(p+=v==mxConstants.DIRECTION_NORTH||-v==mxConstants.DIRECTION_WEST?-1:1,0<=p&&p<=E.length-1&&x.setSelectionCell(E[p].cell)))))}function r(p){return(q(p)||d(p))&&!A(p)&&0<x.getOutgoingTreeEdges(p).length&&!x.isCellCollapsed(p)}var t=this,x=t.editor.graph,B=x.getModel(),F=t.menus.createPopupMenu;t.menus.createPopupMenu=function(p,v,C){F.apply(this,arguments);if(1==x.getSelectionCount()){v=x.getSelectionCell();var E=x.getOutgoingTreeEdges(v);p.addSeparator();0<E.length&&(d(x.getSelectionCell())&&this.addMenuItems(p,["selectChildren"],null,+v==mxConstants.DIRECTION_WEST?-1:1,0<=p&&p<=E.length-1&&x.setSelectionCell(E[p].cell)))))}function r(p){return(q(p)||d(p))&&!A(p)&&0<x.getOutgoingTreeEdges(p).length&&!x.isCellCollapsed(p)}var t=this,x=t.editor.graph,B=x.getModel(),G=t.menus.createPopupMenu;t.menus.createPopupMenu=function(p,v,C){G.apply(this,arguments);if(1==x.getSelectionCount()){v=x.getSelectionCell();var E=x.getOutgoingTreeEdges(v);p.addSeparator();0<E.length&&(d(x.getSelectionCell())&&this.addMenuItems(p,["selectChildren"],null,C),this.addMenuItems(p,["selectDescendants"],null,C));d(x.getSelectionCell())?(p.addSeparator(),0<x.getIncomingTreeEdges(v).length&&this.addMenuItems(p,["selectSiblings","selectParent"],null,C)):0<x.model.getEdgeCount(v)&&this.addMenuItems(p,["selectConnections"],null,C)}};t.actions.addAction("selectChildren",function(p){if(x.isEnabled()&&1==x.getSelectionCount()){var v=x.getSelectionCell();p=mxEvent.isControlDown(p)?null:x.getOutgoingTreeEdges(v);if(null!=p&&0<p.length){v=[];for(var C=0;C<p.length;C++)v.push(x.model.getTerminal(p[C],!1));x.setSelectionCells(v)}else x.setSelectionCells(x.model.getChildren(v))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");t.actions.addAction("selectDescendants",function(p){var v=x.getSelectionCell();if(x.isEnabled()&&null!=v){var C=[];mxEvent.isControlDown(p)||x.traverse(v,!0,function(E,I){var O=null!=I&&x.isTreeEdge(I);O&&mxEvent.isControlDown(p)&&C.push(I);(null==I||O)&&C.push(E);return null==I||O});if(0==C.length||1==C.length&&C[0]==v)C=x.model.getDescendants(v);x.setSelectionCells(C)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");t.actions.addAction("selectParent",function(p){var v=x.getSelectionCell();x.isEnabled()&&null!=v&&(p=mxEvent.isControlDown(p)?null:x.getIncomingTreeEdges(v),null!=p&&0<p.length?x.setSelectionCell(x.model.getTerminal(p[0],!0)):x.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey+"+P");t.actions.addAction("selectSiblings",function(p){if(x.isEnabled()&&1==x.getSelectionCount()){var v=x.getSelectionCell(),C=mxEvent.isControlDown(p)?null:@@ -15517,129 +15521,129 @@ p&&d(I)&&"1"==mxUtils.getValue(X,"treeFolding","0")){for(M=0;M<p.length;M++)if(dif(null!=V&&null!=p&&V.length==p.length)for(M=0;M<V.length;M++)if(this.model.isEdge(V[M]))d(W)&&0>mxUtils.indexOf(V,this.model.getTerminal(V[M],!0))&&this.model.setTerminal(V[M],W,!0);else if(d(p[M])&&(Z=x.getIncomingTreeEdges(p[M]),0<Z.length))if(!E)d(W)&&0>mxUtils.indexOf(p,this.model.getTerminal(Z[0],!0))&&this.model.setTerminal(Z[0],W,!0);else if(0==x.getIncomingTreeEdges(V[M]).length){X=W;if(null==X||X==x.model.getParent(p[M]))X=x.model.getTerminal(Z[0],!0);E=this.cloneCell(Z[0]);this.addEdge(E,x.getDefaultParent(),X,V[M])}}finally{this.model.endUpdate()}return V};if(null!=t.sidebar){var N=t.sidebar.dropAndConnect;t.sidebar.dropAndConnect=function(p,v,C,E){var I=x.model,O=null;I.beginUpdate();try{if(O=N.apply(this,arguments),d(p))for(var Q=0;Q<O.length;Q++)if(I.isEdge(O[Q])&&null==I.getTerminal(O[Q],!0)){I.setTerminal(O[Q],p,!0);var V=x.getCellGeometry(O[Q]);V.points=null;null!=V.getTerminalPoint(!0)&&V.setTerminalPoint(null,!0)}}finally{I.endUpdate()}return O}}var R={67:t.actions.get("selectChildren"),88:t.actions.get("selectDescendants"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},P={67:t.actions.get("copyStyle"),86:t.actions.get("pasteStyle")},U=t.onKeyDown;t.onKeyDown=function(p){try{var v=x.getSelectionCell();if(x.isEnabled()&&!x.isEditing()&&null!=v){var C=mxEvent.isAltDown(p)&&mxEvent.isShiftDown(p)?R[p.keyCode]:mxEvent.isAltDown(p)?P[p.keyCode]:null;null!=C?(C.funct(p),mxEvent.consume(p)):d(v)&&(C=null,0<x.getIncomingTreeEdges(v).length&&(9==p.which?C=mxEvent.isShiftDown(p)?-c(v):f(v):13==p.which&&(C=G(v,!mxEvent.isShiftDown(p)))),null!=C&&0<C.length?(1==C.length&&x.model.isEdge(C[0])?x.setSelectionCell(x.model.getTerminal(C[0],!1)):x.setSelectionCell(C[C.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(x.view.getState(v)),x.startEditingAtCell(v),mxEvent.consume(p)):37==p.keyCode?(n(v,mxConstants.DIRECTION_WEST),mxEvent.consume(p)):38==p.keyCode?(n(v,mxConstants.DIRECTION_NORTH),mxEvent.consume(p)):39==p.keyCode?(n(v,mxConstants.DIRECTION_EAST),mxEvent.consume(p)):-40==p.keyCode&&(n(v,mxConstants.DIRECTION_SOUTH),mxEvent.consume(p)))}}catch(E){t.handleError(E)}mxEvent.isConsumed(p)||U.apply(this,arguments)};var S=x.connectVertex;x.connectVertex=function(p,v,C,E,I,O,Q,V,W){var M=x.getIncomingTreeEdges(p);if(d(p)){var X=K(p),Z=X==mxConstants.DIRECTION_EAST||X==mxConstants.DIRECTION_WEST,Y=v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST;M=X==v||0==M.length?f(p,v,W):Z==Y?c(p,W):G(p,v!=mxConstants.DIRECTION_NORTH&&v!=mxConstants.DIRECTION_WEST,W);if(null!=+c(v):f(v):13==p.which&&(C=H(v,!mxEvent.isShiftDown(p)))),null!=C&&0<C.length?(1==C.length&&x.model.isEdge(C[0])?x.setSelectionCell(x.model.getTerminal(C[0],!1)):x.setSelectionCell(C[C.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(x.view.getState(v)),x.startEditingAtCell(v),mxEvent.consume(p)):37==p.keyCode?(n(v,mxConstants.DIRECTION_WEST),mxEvent.consume(p)):38==p.keyCode?(n(v,mxConstants.DIRECTION_NORTH),mxEvent.consume(p)):39==p.keyCode?(n(v,mxConstants.DIRECTION_EAST),mxEvent.consume(p)):+40==p.keyCode&&(n(v,mxConstants.DIRECTION_SOUTH),mxEvent.consume(p)))}}catch(E){t.handleError(E)}mxEvent.isConsumed(p)||U.apply(this,arguments)};var S=x.connectVertex;x.connectVertex=function(p,v,C,E,I,O,Q,V,W){var M=x.getIncomingTreeEdges(p);if(d(p)){var X=K(p),Z=X==mxConstants.DIRECTION_EAST||X==mxConstants.DIRECTION_WEST,Y=v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST;M=X==v||0==M.length?f(p,v,W):Z==Y?c(p,W):H(p,v!=mxConstants.DIRECTION_NORTH&&v!=mxConstants.DIRECTION_WEST,W);if(null!=V)V(M);else return M}else return S.apply(this,arguments)};x.getSubtree=function(p){var v=[p];!q(p)&&!d(p)||A(p)||x.traverse(p,!0,function(C,E){var I=null!=E&&x.isTreeEdge(E);I&&0>mxUtils.indexOf(v,E)&&v.push(E);(null==E||I)&&0>mxUtils.indexOf(v,C)&&v.push(C);return null==E||I});return v};var z=x.isMoveIconVisible;x.isMoveIconVisible=function(p){return z.apply(this,arguments)||r(p)};var g=x.getMoveIconDragCells;x.getMoveIconDragCells=function(p){return r(p)?this.getSubtree(p):g.apply(this,arguments)}};if("undefined"!==typeof Sidebar){var m=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var d=m.apply(this,arguments),q=this.graph,u=this;return d.concat([this.addEntry("tree container",function(){var y=new mxCell("Tree Container",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");y.vertex=!0;var A=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');A.vertex=!0;var J=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');J.vertex=!0;var K=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");K.geometry.relative=!0;K.edge=!0;A.insertEdge(K,!0);J.insertEdge(K,!1);y.insert(K);y.insert(A);y.insert(J);return u.createVertexTemplateFromCells([y],160,180,y.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var y=new mxCell("Mindmap",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");y.vertex=!0;var A=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');A.vertex=!0;var J=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');J.vertex=!0;var K=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");-K.geometry.relative=!0;K.edge=!0;A.insertEdge(K,!0);J.insertEdge(K,!1);var H=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-H.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),K.style);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!0);H.insertEdge(G,!1);var c=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+K.geometry.relative=!0;K.edge=!0;A.insertEdge(K,!0);J.insertEdge(K,!1);var F=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+F.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),K.style);H.geometry.relative=!0;H.edge=!0;A.insertEdge(H,!0);F.insertEdge(H,!1);var c=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');c.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),K.style);f.geometry.relative=!0;f.edge=!0;A.insertEdge(f,!0);c.insertEdge(f,!1);var l=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-l.vertex=!0;var n=new mxCell("",new mxGeometry(0,0,0,0),K.style);n.geometry.relative=!0;n.edge=!0;A.insertEdge(n,!0);l.insertEdge(n,!1);y.insert(K);y.insert(G);y.insert(f);y.insert(n);y.insert(A);y.insert(J);y.insert(H);y.insert(c);y.insert(l);return u.createVertexTemplateFromCells([y],420,126,y.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var y=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');+l.vertex=!0;var n=new mxCell("",new mxGeometry(0,0,0,0),K.style);n.geometry.relative=!0;n.edge=!0;A.insertEdge(n,!0);l.insertEdge(n,!1);y.insert(K);y.insert(H);y.insert(f);y.insert(n);y.insert(A);y.insert(J);y.insert(F);y.insert(c);y.insert(l);return u.createVertexTemplateFromCells([y],420,126,y.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var y=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');y.vertex=!0;return u.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var y=new mxCell("Branch",new mxGeometry(0,0,80,20),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');y.vertex=!0;var A=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");A.geometry.setTerminalPoint(new mxPoint(-40,40),!0);A.geometry.relative=!0;A.edge=!0;y.insertEdge(A,!1);return u.createVertexTemplateFromCells([y,A],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var y=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');y.vertex=!0;var A=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");A.geometry.setTerminalPoint(new mxPoint(-40,40),!0);A.geometry.relative=!0;A.edge=!0;y.insertEdge(A,!1);return u.createVertexTemplateFromCells([y,A],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree orgchart organization division",function(){var y=new mxCell("Orgchart",new mxGeometry(0,0,0,0),'swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');y.vertex=!0;var A=new mxCell("Organization",new mxGeometry(80,40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');q.setAttributeForCell(A,"treeRoot","1");A.vertex=!0;var J=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');J.vertex=!0;var K=-new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");K.geometry.relative=!0;K.edge=!0;A.insertEdge(K,!0);J.insertEdge(K,!1);var H=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');H.vertex=!0;var G=new mxCell("",-new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!0);H.insertEdge(G,!1);y.insert(K);y.insert(G);y.insert(A);y.insert(J);y.insert(H);return u.createVertexTemplateFromCells([y],280,220,y.value)}),this.addEntry("tree root",function(){var y=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');+new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");K.geometry.relative=!0;K.edge=!0;A.insertEdge(K,!0);J.insertEdge(K,!1);var F=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');F.vertex=!0;var H=new mxCell("",+new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");H.geometry.relative=!0;H.edge=!0;A.insertEdge(H,!0);F.insertEdge(H,!1);y.insert(K);y.insert(H);y.insert(A);y.insert(J);y.insert(F);return u.createVertexTemplateFromCells([y],280,220,y.value)}),this.addEntry("tree root",function(){var y=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');q.setAttributeForCell(y,"treeRoot","1");y.vertex=!0;return u.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree division",function(){var y=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');y.vertex=!0;var A=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");A.geometry.setTerminalPoint(new mxPoint(0,0),!0);A.geometry.relative=!0;A.edge=!0;y.insertEdge(A,!1);return u.createVertexTemplateFromCells([y,A],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree sub sections",function(){var y=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");y.vertex=!0;var A=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");A.geometry.setTerminalPoint(new mxPoint(110,-40),!0);A.geometry.relative=!0;A.edge=!0;y.insertEdge(A,!1);var J=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");J.vertex=!0;var K=new mxCell("",new mxGeometry(0,0,0,0),A.style);K.geometry.setTerminalPoint(new mxPoint(110,-40),!0);K.geometry.relative=!0;K.edge=!0;J.insertEdge(K,!1);return u.createVertexTemplateFromCells([A,K,y,J],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;-EditorUi.initMinimalTheme=function(){function b(K,H){if(EditorUi.windowed){var G=K.editor.graph;G.popupMenuHandler.hideMenu();null==K.formatWindow?(K.formatWindow=new WrapperWindow(K,"",Math.max(10,K.diagramContainer.clientWidth-248),60,240,Math.min(600,G.container.clientHeight-10),function(c){c.className="geSidebarContainer geFormatContainer";K.createFormat(c).init()}),K.dependsOnLanguage(mxUtils.bind(this,function(){K.formatWindow.window.setTitle(mxResources.get("format"))})),K.formatWindow.window.addListener(mxEvent.SHOW,-mxUtils.bind(this,function(){K.formatWindow.window.fit()})),K.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):K.formatWindow.window.setVisible(null!=H?H:!K.formatWindow.window.isVisible())}else null==K.formatElt&&(K.formatElt=K.createSidebarContainer(),K.createFormat(K.formatElt).init(),K.formatElt.style.border="none",K.formatElt.style.width="240px",K.formatElt.style.borderLeftWidth="1px",K.formatElt.style.borderLeftStyle="solid",K.formatElt.style.right="0px"),H=K.diagramContainer.parentNode,-null!=K.formatElt.parentNode?(K.formatElt.parentNode.removeChild(K.formatElt),H.style.right="0px"):(H.parentNode.appendChild(K.formatElt),H.style.right=K.formatElt.style.width)}function k(K,H){if(EditorUi.windowed){var G=K.editor.graph;G.popupMenuHandler.hideMenu();null==K.sidebarWindow?(K.sidebarWindow=new WrapperWindow(K,"",10,56,Math.min(G.container.clientWidth-10,218)-6,Math.min(G.container.clientHeight-40,650)-6,function(c){K.createShapesPanel(c)}),K.dependsOnLanguage(mxUtils.bind(this,function(){K.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),-K.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){K.sidebarWindow.window.fit()})),K.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),K.sidebarWindow.window.setVisible(!0),isLocalStorage&&K.getLocalData("sidebar",function(c){K.sidebar.showEntries(c,null,!0)}),K.restoreLibraries()):K.sidebarWindow.window.setVisible(null!=H?H:!K.sidebarWindow.window.isVisible())}else null==K.sidebarElt&&(K.sidebarElt=K.createSidebarContainer(),K.createShapesPanel(K.sidebarElt),K.sidebarElt.style.border=-"none",K.sidebarElt.style.width="210px",K.sidebarElt.style.borderRight="1px solid gray"),H=K.diagramContainer.parentNode,null!=K.sidebarElt.parentNode?(K.sidebarElt.parentNode.removeChild(K.sidebarElt),H.style.left="0px"):(H.parentNode.appendChild(K.sidebarElt),H.style.left=K.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var m=0;try{m=window.innerWidth||document.documentElement.clientWidth||+EditorUi.initMinimalTheme=function(){function b(K,F){if(EditorUi.windowed){var H=K.editor.graph;H.popupMenuHandler.hideMenu();null==K.formatWindow?(K.formatWindow=new WrapperWindow(K,"",Math.max(10,K.diagramContainer.clientWidth-248),60,240,Math.min(600,H.container.clientHeight-10),function(c){c.className="geSidebarContainer geFormatContainer";K.createFormat(c).init()}),K.dependsOnLanguage(mxUtils.bind(this,function(){K.formatWindow.window.setTitle(mxResources.get("format"))})),K.formatWindow.window.addListener(mxEvent.SHOW,+mxUtils.bind(this,function(){K.formatWindow.window.fit()})),K.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):K.formatWindow.window.setVisible(null!=F?F:!K.formatWindow.window.isVisible())}else null==K.formatElt&&(K.formatElt=K.createSidebarContainer(),K.createFormat(K.formatElt).init(),K.formatElt.style.border="none",K.formatElt.style.width="240px",K.formatElt.style.borderLeftWidth="1px",K.formatElt.style.borderLeftStyle="solid",K.formatElt.style.right="0px"),F=K.diagramContainer.parentNode,+null!=K.formatElt.parentNode?(K.formatElt.parentNode.removeChild(K.formatElt),F.style.right="0px"):(F.parentNode.appendChild(K.formatElt),F.style.right=K.formatElt.style.width)}function k(K,F){if(EditorUi.windowed){var H=K.editor.graph;H.popupMenuHandler.hideMenu();null==K.sidebarWindow?(K.sidebarWindow=new WrapperWindow(K,"",10,56,Math.min(H.container.clientWidth-10,218)-6,Math.min(H.container.clientHeight-40,650)-6,function(c){K.createShapesPanel(c)}),K.dependsOnLanguage(mxUtils.bind(this,function(){K.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),+K.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){K.sidebarWindow.window.fit()})),K.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),K.sidebarWindow.window.setVisible(!0),isLocalStorage&&K.getLocalData("sidebar",function(c){K.sidebar.showEntries(c,null,!0)}),K.restoreLibraries()):K.sidebarWindow.window.setVisible(null!=F?F:!K.sidebarWindow.window.isVisible())}else null==K.sidebarElt&&(K.sidebarElt=K.createSidebarContainer(),K.createShapesPanel(K.sidebarElt),K.sidebarElt.style.border=+"none",K.sidebarElt.style.width="210px",K.sidebarElt.style.borderRight="1px solid gray"),F=K.diagramContainer.parentNode,null!=K.sidebarElt.parentNode?(K.sidebarElt.parentNode.removeChild(K.sidebarElt),F.style.left="0px"):(F.parentNode.appendChild(K.sidebarElt),F.style.left=K.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var m=0;try{m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}catch(K){}Menus.prototype.autoPopup=!1;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke-width="2" style="stroke-opacity:0.4" stroke="#ffffff"/><path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR="#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR="#C0C0C0";mxConstants.OUTLINE_COLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#fff";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowSize="0.6";Graph.prototype.svgShadowBlur="1.2";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;EditorUi.prototype.closableScratchpad=!1;Graph.prototype.editAfterInsert=!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=-function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var d=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){d.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var q=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(K,H){null!=H.shortcut&&900>m&&!mxClient.IS_IOS?K.firstChild.nextSibling.setAttribute("title",H.shortcut):q.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=+function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var d=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){d.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var q=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(K,F){null!=F.shortcut&&900>m&&!mxClient.IS_IOS?K.firstChild.nextSibling.setAttribute("title",F.shortcut):q.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=function(K){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=K?K:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||null==this.formatWindow&&0<this.formatWidth};var u=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();u.apply(this,arguments)};var y=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(K){y.apply(this,-arguments);if(K){var H=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=H&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=H&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};EditorUi.prototype.installFormatToolbar=-function(K){var H=this.editor.graph,G=document.createElement("div");G.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";H.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,f){0<H.getSelectionCount()?(K.appendChild(G),G.innerHTML="Selected: "+H.getSelectionCount()):null!=G.parentNode&&G.parentNode.removeChild(G)}))};var A=!1;EditorUi.prototype.initFormatWindow=-function(){if(!A&&null!=this.formatWindow){A=!0;var K=this.formatWindow.window.toggleMinimized,H=240;this.formatWindow.window.toggleMinimized=function(){K.apply(this,arguments);this.minimized?(H=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+H-140+"px"):(this.div.style.width=H+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-H+140)+"px");this.fit()};-mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(G){mxEvent.getSource(G)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var J=EditorUi.prototype.init;EditorUi.prototype.init=function(){function K(v,C,E){var I=l.menus.get(v);C=t.addMenu(mxResources.get(v),mxUtils.bind(this,function(){I.funct.apply(this,arguments)}));C.className="geButton";C.setAttribute("title",mxResources.get(v));l.menus.menuCreated(I,C,"geButton");null!=E&&-(C.style.backgroundImage="url("+E+")",C.innerText="");return C}function H(v,C,E,I,O,Q){var V=document.createElement("a");V.className="geButton";r.appendChild(V);null!=Q?V.style.backgroundImage="url("+Q+")":mxUtils.write(V,v);mxEvent.addListener(V,"click",function(W){"disabled"!=V.getAttribute("disabled")&&C(W);mxEvent.consume(W)});mxEvent.preventDefault(V);null!=I&&V.setAttribute("title",I);null!=O&&(v=function(){O.isEnabled()?V.removeAttribute("disabled"):V.setAttribute("disabled","disabled")},O.addListener("stateChanged",-v),n.addListener("enabledChanged",v),v());return V}function G(v,C,E){C=document.createElement("div");C.className="geButtonGroup";for(E=0;E<v.length;E++)null!=v[E]&&C.appendChild(v[E]);r.appendChild(C);return C}function c(){m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var v=0;"1"==urlParams.embed&&null!=l.buttonContainer&&(v=l.buttonContainer.offsetWidth||300);r.innerHTML="";var C=m<1E3+v,E=K("diagram",null,C?Editor.menuImage:null);G([E,H(mxResources.get("shapes"),-l.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),l.actions.get("image"),C?Editor.shapesImage:null),H(mxResources.get("format"),l.actions.get("format").funct,null,mxResources.get("format")+" ("+l.actions.get("format").shortcut+")",l.actions.get("image"),C?Editor.formatImage:null)]);E=K("insert",!0,C?D:null);G([E,H(mxResources.get("delete"),l.actions.get("delete").funct,null,mxResources.get("delete"),l.actions.get("delete"),C?Editor.trashImage:null)]);n.isEnabled()||E.setAttribute("disabled",-"disabled");z.setAttribute("title",mxResources.get("undo")+" ("+U.shortcut+")");g.setAttribute("title",mxResources.get("redo")+" ("+S.shortcut+")");p.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");m>=411+v&&(G([z,g]),m>=520+v&&G([p,m>=640+v?H("",R.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",R,Editor.zoomInImage):null,m>=640+v?H("",P.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",P,Editor.zoomOutImage):null]));r.appendChild(l.statusContainer);+arguments);if(K){var F=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=F&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=F&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};EditorUi.prototype.installFormatToolbar=+function(K){var F=this.editor.graph,H=document.createElement("div");H.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";F.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,f){0<F.getSelectionCount()?(K.appendChild(H),H.innerHTML="Selected: "+F.getSelectionCount()):null!=H.parentNode&&H.parentNode.removeChild(H)}))};var A=!1;EditorUi.prototype.initFormatWindow=+function(){if(!A&&null!=this.formatWindow){A=!0;var K=this.formatWindow.window.toggleMinimized,F=240;this.formatWindow.window.toggleMinimized=function(){K.apply(this,arguments);this.minimized?(F=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+F-140+"px"):(this.div.style.width=F+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-F+140)+"px");this.fit()};+mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(H){mxEvent.getSource(H)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var J=EditorUi.prototype.init;EditorUi.prototype.init=function(){function K(v,C,E){var I=l.menus.get(v);C=t.addMenu(mxResources.get(v),mxUtils.bind(this,function(){I.funct.apply(this,arguments)}));C.className="geButton";C.setAttribute("title",mxResources.get(v));l.menus.menuCreated(I,C,"geButton");null!=E&&+(C.style.backgroundImage="url("+E+")",C.innerText="");return C}function F(v,C,E,I,O,Q){var V=document.createElement("a");V.className="geButton";r.appendChild(V);null!=Q?V.style.backgroundImage="url("+Q+")":mxUtils.write(V,v);mxEvent.addListener(V,"click",function(W){"disabled"!=V.getAttribute("disabled")&&C(W);mxEvent.consume(W)});mxEvent.preventDefault(V);null!=I&&V.setAttribute("title",I);null!=O&&(v=function(){O.isEnabled()?V.removeAttribute("disabled"):V.setAttribute("disabled","disabled")},O.addListener("stateChanged",+v),n.addListener("enabledChanged",v),v());return V}function H(v,C,E){C=document.createElement("div");C.className="geButtonGroup";for(E=0;E<v.length;E++)null!=v[E]&&C.appendChild(v[E]);r.appendChild(C);return C}function c(){m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var v=0;"1"==urlParams.embed&&null!=l.buttonContainer&&(v=l.buttonContainer.offsetWidth||300);r.innerHTML="";var C=m<1E3+v,E=K("diagram",null,C?Editor.menuImage:null);H([E,F(mxResources.get("shapes"),+l.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),l.actions.get("image"),C?Editor.shapesImage:null),F(mxResources.get("format"),l.actions.get("format").funct,null,mxResources.get("format")+" ("+l.actions.get("format").shortcut+")",l.actions.get("image"),C?Editor.formatImage:null)]);E=K("insert",!0,C?D:null);H([E,F(mxResources.get("delete"),l.actions.get("delete").funct,null,mxResources.get("delete"),l.actions.get("delete"),C?Editor.trashImage:null)]);n.isEnabled()||E.setAttribute("disabled",+"disabled");z.setAttribute("title",mxResources.get("undo")+" ("+U.shortcut+")");g.setAttribute("title",mxResources.get("redo")+" ("+S.shortcut+")");p.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");m>=411+v&&(H([z,g]),m>=520+v&&H([p,m>=640+v?F("",R.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",R,Editor.zoomInImage):null,m>=640+v?F("",P.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",P,Editor.zoomOutImage):null]));r.appendChild(l.statusContainer);r.appendChild(l.buttonContainer)}J.apply(this,arguments);var f=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=f&&(f.classList.add("geSimple"),f.classList.add("geMinimal"),f.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);"0"!=urlParams.sidebar&&(1E3<=m||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])&&(k(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search")));this.formatEnabled&&EditorUi.windowed&&1E3<=m&&(b(this,!0),this.formatWindow.window.setVisible(!0));var l=this,n=l.editor.graph;l.toolbar=this.createToolbar(l.createDiv("geToolbar"));var r=document.createElement("div");r.className="geMenubarContainer";var t=new Menubar(l,r),x=l.hideCurrentMenu;l.hideCurrentMenu=function(){x.apply(this,arguments);null!=this.editor&&this.editor.graph.popupMenuHandler.hideMenu()};var B=l.descriptorChanged;l.descriptorChanged=function(){B.apply(this,arguments);var v=l.getCurrentFile();if(null!=v&&null!=v.getTitle()){var C=v.getMode();"google"==C?C="googleDrive":"github"==C?C="gitHub":"gitlab"==C?C="gitLab":"onedrive"==C&&(C="oneDrive");C=mxResources.get(C);r.setAttribute("title",v.getTitle()+(null!=C?" ("+C+")":""))}else r.removeAttribute("title")};l.setStatusText(l.editor.getStatus());r.appendChild(l.statusContainer);l.buttonContainer=this.createButtonContainer();r.appendChild(l.buttonContainer);-l.menubarContainer=l.buttonContainer;l.tabContainer=this.createTabContainer();var F=this.createZoomInput(!0),L=l.updateTabContainer;l.updateTabContainer=function(){L.apply(this,arguments);l.tabContainer.appendChild(F)};var D=Editor.addBoxImage;if(null!=l.hoverIcons){var T=l.hoverIcons.update;l.hoverIcons.update=function(){n.freehand.isDrawing()||T.apply(this,arguments)}}if(null!=n.freehand){var N=n.freehand.createStyle;n.freehand.createStyle=function(v){return N.apply(this,arguments)+"sketch=0;"}}l.editor.addListener("statusChanged",-mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));l.setStatusText(l.editor.getStatus());var R=l.actions.get("zoomIn"),P=l.actions.get("zoomOut");f=l.actions.get("resetView");var U=l.actions.get("undo"),S=l.actions.get("redo"),z=H("",U.funct,null,"",U,Editor.undoImage),g=H("",S.funct,null,"",S,Editor.redoImage),p=H("",function(v){mxEvent.isAltDown(v)?(l.hideCurrentMenu(),l.actions.get("customZoom").funct()):(l.hideCurrentMenu(),l.actions.get("smartFit").funct());mxEvent.consume(v)},+l.menubarContainer=l.buttonContainer;l.tabContainer=this.createTabContainer();var G=this.createZoomInput(!0),L=l.updateTabContainer;l.updateTabContainer=function(){L.apply(this,arguments);l.tabContainer.appendChild(G)};var D=Editor.addBoxImage;if(null!=l.hoverIcons){var T=l.hoverIcons.update;l.hoverIcons.update=function(){n.freehand.isDrawing()||T.apply(this,arguments)}}if(null!=n.freehand){var N=n.freehand.createStyle;n.freehand.createStyle=function(v){return N.apply(this,arguments)+"sketch=0;"}}l.editor.addListener("statusChanged",+mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));l.setStatusText(l.editor.getStatus());var R=l.actions.get("zoomIn"),P=l.actions.get("zoomOut");f=l.actions.get("resetView");var U=l.actions.get("undo"),S=l.actions.get("redo"),z=F("",U.funct,null,"",U,Editor.undoImage),g=F("",S.funct,null,"",S,Editor.redoImage),p=F("",function(v){mxEvent.isAltDown(v)?(l.hideCurrentMenu(),l.actions.get("customZoom").funct()):(l.hideCurrentMenu(),l.actions.get("smartFit").funct());mxEvent.consume(v)},!0,"",f,Editor.zoomFitImage);l.actions.get("toggleShapes").funct=mxUtils.bind(this,function(){k(l,null)});l.container.appendChild(l.tabContainer);l.container.appendChild(r);l.updateTabContainer();this.formatEnabled&&!EditorUi.windowed&&1E3<=m&&b(this,!0);c();l.addListener("lockedChanged",c);l.addListener("languageChanged",c);l.editor.graph.addListener("enabledChanged",c);mxEvent.addListener(window,"resize",function(){c();null!=l.sidebarWindow&&l.sidebarWindow.window.fit();null!=l.formatWindow&&l.formatWindow.window.fit();null!=l.actions.outlineWindow&&l.actions.outlineWindow.window.fit();null!=l.actions.layersWindow&&l.actions.layersWindow.window.fit();null!=l.menus.chatWindow&&l.menus.chatWindow.window.fit();null!=l.menus.tagsWindow&&l.menus.tagsWindow.window.fit();null!=l.menus.findWindow&&l.menus.findWindow.window.fit();null!=l.menus.findReplaceWindow&&l.menus.findReplaceWindow.window.fit()})}}};-(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var k=EditorUi.initTheme;EditorUi.initTheme=function(){k.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();(function(){var b=mxGuide.prototype.move;mxGuide.prototype.move=function(d,q,u,y){var A=q.y,J=q.x,K=!1,H=!1;if(null!=this.states&&null!=d&&null!=q){var G=this,c=new mxCellState,f=this.graph.getView().scale,l=Math.max(2,this.getGuideTolerance()/2);c.x=d.x+J;c.y=d.y+A;c.width=d.width;c.height=d.height;for(var n=[],r=[],t=0;t<this.states.length;t++){var x=this.states[t];x instanceof mxCellState&&(y||!this.graph.isCellSelected(x.cell))&&((c.x>=x.x&&c.x<=x.x+x.width||x.x>=c.x&&x.x<=c.x+c.width)&&(c.y>-x.y+x.height+4||c.y+c.height+4<x.y)?n.push(x):(c.y>=x.y&&c.y<=x.y+x.height||x.y>=c.y&&x.y<=c.y+c.height)&&(c.x>x.x+x.width+4||c.x+c.width+4<x.x)&&r.push(x))}var B=0,F=0,L=x=0,D=0,T=0,N=0,R=0,P=5*f;if(1<n.length){n.push(c);n.sort(function(g,p){return g.y-p.y});var U=!1;t=c==n[0];f=c==n[n.length-1];if(!t&&!f)for(t=1;t<n.length-1;t++)if(c==n[t]){f=n[t-1];t=n[t+1];x=F=L=(t.y-f.y-f.height-c.height)/2;break}for(t=0;t<n.length-1;t++){f=n[t];var S=n[t+1],z=c==f||c==S;S=S.y-f.y-f.height;U|=c==f;if(0==F&&0==-B)F=S,B=1;else if(Math.abs(F-S)<=(z||1==t&&U?l:0))B+=1;else if(1<B&&U){n=n.slice(0,t+1);break}else if(3<=n.length-t&&!U)B=0,x=F=0!=L?L:0,n.splice(0,0==t?1:t),t=-1;else break;0!=x||z||(F=x=S)}3==n.length&&n[1]==c&&(x=0)}if(1<r.length){r.push(c);r.sort(function(g,p){return g.x-p.x});U=!1;t=c==r[0];f=c==r[r.length-1];if(!t&&!f)for(t=1;t<r.length-1;t++)if(c==r[t]){f=r[t-1];t=r[t+1];N=T=R=(t.x-f.x-f.width-c.width)/2;break}for(t=0;t<r.length-1;t++){f=r[t];S=r[t+1];z=c==f||c==S;S=S.x-f.x-f.width;U|=c==f;+(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var k=EditorUi.initTheme;EditorUi.initTheme=function(){k.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();(function(){var b=mxGuide.prototype.move;mxGuide.prototype.move=function(d,q,u,y){var A=q.y,J=q.x,K=!1,F=!1;if(null!=this.states&&null!=d&&null!=q){var H=this,c=new mxCellState,f=this.graph.getView().scale,l=Math.max(2,this.getGuideTolerance()/2);c.x=d.x+J;c.y=d.y+A;c.width=d.width;c.height=d.height;for(var n=[],r=[],t=0;t<this.states.length;t++){var x=this.states[t];x instanceof mxCellState&&(y||!this.graph.isCellSelected(x.cell))&&((c.x>=x.x&&c.x<=x.x+x.width||x.x>=c.x&&x.x<=c.x+c.width)&&(c.y>+x.y+x.height+4||c.y+c.height+4<x.y)?n.push(x):(c.y>=x.y&&c.y<=x.y+x.height||x.y>=c.y&&x.y<=c.y+c.height)&&(c.x>x.x+x.width+4||c.x+c.width+4<x.x)&&r.push(x))}var B=0,G=0,L=x=0,D=0,T=0,N=0,R=0,P=5*f;if(1<n.length){n.push(c);n.sort(function(g,p){return g.y-p.y});var U=!1;t=c==n[0];f=c==n[n.length-1];if(!t&&!f)for(t=1;t<n.length-1;t++)if(c==n[t]){f=n[t-1];t=n[t+1];x=G=L=(t.y-f.y-f.height-c.height)/2;break}for(t=0;t<n.length-1;t++){f=n[t];var S=n[t+1],z=c==f||c==S;S=S.y-f.y-f.height;U|=c==f;if(0==G&&0==+B)G=S,B=1;else if(Math.abs(G-S)<=(z||1==t&&U?l:0))B+=1;else if(1<B&&U){n=n.slice(0,t+1);break}else if(3<=n.length-t&&!U)B=0,x=G=0!=L?L:0,n.splice(0,0==t?1:t),t=-1;else break;0!=x||z||(G=x=S)}3==n.length&&n[1]==c&&(x=0)}if(1<r.length){r.push(c);r.sort(function(g,p){return g.x-p.x});U=!1;t=c==r[0];f=c==r[r.length-1];if(!t&&!f)for(t=1;t<r.length-1;t++)if(c==r[t]){f=r[t-1];t=r[t+1];N=T=R=(t.x-f.x-f.width-c.width)/2;break}for(t=0;t<r.length-1;t++){f=r[t];S=r[t+1];z=c==f||c==S;S=S.x-f.x-f.width;U|=c==f;if(0==T&&0==D)T=S,D=1;else if(Math.abs(T-S)<=(z||1==t&&U?l:0))D+=1;else if(1<D&&U){r=r.slice(0,t+1);break}else if(3<=r.length-t&&!U)D=0,N=T=0!=R?R:0,r.splice(0,0==t?1:t),t=-1;else break;0!=N||z||(T=N=S)}3==r.length&&r[1]==c&&(N=0)}l=function(g,p,v,C){var E=[];if(C){C=P;var I=0}else C=0,I=P;E.push(new mxPoint(g.x-C,g.y-I));E.push(new mxPoint(g.x+C,g.y+I));E.push(g);E.push(p);E.push(new mxPoint(p.x-C,p.y-I));E.push(new mxPoint(p.x+C,p.y+I));if(null!=v)return v.points=E,v;g=new mxPolyline(E,mxConstants.GUIDE_COLOR,-mxConstants.GUIDE_STROKEWIDTH);g.dialect=mxConstants.DIALECT_SVG;g.pointerEvents=!1;g.init(G.graph.getView().getOverlayPane());return g};T=function(g,p){if(g&&null!=G.guidesArrHor)for(g=0;g<G.guidesArrHor.length;g++)G.guidesArrHor[g].node.style.visibility="hidden";if(p&&null!=G.guidesArrVer)for(g=0;g<G.guidesArrVer.length;g++)G.guidesArrVer[g].node.style.visibility="hidden"};if(1<D&&D==r.length-1){D=[];R=G.guidesArrHor;K=[];J=0;t=r[0]==c?1:0;U=r[t].y+r[t].height;if(0<N)for(t=0;t<r.length-1;t++)f=+mxConstants.GUIDE_STROKEWIDTH);g.dialect=mxConstants.DIALECT_SVG;g.pointerEvents=!1;g.init(H.graph.getView().getOverlayPane());return g};T=function(g,p){if(g&&null!=H.guidesArrHor)for(g=0;g<H.guidesArrHor.length;g++)H.guidesArrHor[g].node.style.visibility="hidden";if(p&&null!=H.guidesArrVer)for(g=0;g<H.guidesArrVer.length;g++)H.guidesArrVer[g].node.style.visibility="hidden"};if(1<D&&D==r.length-1){D=[];R=H.guidesArrHor;K=[];J=0;t=r[0]==c?1:0;U=r[t].y+r[t].height;if(0<N)for(t=0;t<r.length-1;t++)f=r[t],S=r[t+1],c==f?(J=S.x-f.width-N,K.push(new mxPoint(J+f.width+P,U)),K.push(new mxPoint(S.x-P,U))):c==S?(K.push(new mxPoint(f.x+f.width+P,U)),J=f.x+f.width+N,K.push(new mxPoint(J-P,U))):(K.push(new mxPoint(f.x+f.width+P,U)),K.push(new mxPoint(S.x-P,U)));else f=r[0],t=r[2],J=f.x+f.width+(t.x-f.x-f.width-c.width)/2,K.push(new mxPoint(f.x+f.width+P,U)),K.push(new mxPoint(J-P,U)),K.push(new mxPoint(J+c.width+P,U)),K.push(new mxPoint(t.x-P,U));for(t=0;t<K.length;t+=2)r=K[t],N=K[t+1],r=l(r,N,null!=R?-R[t/2]:null),r.node.style.visibility="visible",r.redraw(),D.push(r);for(t=K.length/2;null!=R&&t<R.length;t++)R[t].destroy();G.guidesArrHor=D;J-=d.x;K=!0}else T(!0);if(1<B&&B==n.length-1){D=[];R=G.guidesArrVer;H=[];A=0;t=n[0]==c?1:0;B=n[t].x+n[t].width;if(0<x)for(t=0;t<n.length-1;t++)f=n[t],S=n[t+1],c==f?(A=S.y-f.height-x,H.push(new mxPoint(B,A+f.height+P)),H.push(new mxPoint(B,S.y-P))):c==S?(H.push(new mxPoint(B,f.y+f.height+P)),A=f.y+f.height+x,H.push(new mxPoint(B,A-P))):(H.push(new mxPoint(B,f.y+-f.height+P)),H.push(new mxPoint(B,S.y-P)));else f=n[0],t=n[2],A=f.y+f.height+(t.y-f.y-f.height-c.height)/2,H.push(new mxPoint(B,f.y+f.height+P)),H.push(new mxPoint(B,A-P)),H.push(new mxPoint(B,A+c.height+P)),H.push(new mxPoint(B,t.y-P));for(t=0;t<H.length;t+=2)r=H[t],N=H[t+1],r=l(r,N,null!=R?R[t/2]:null,!0),r.node.style.visibility="visible",r.redraw(),D.push(r);for(t=H.length/2;null!=R&&t<R.length;t++)R[t].destroy();G.guidesArrVer=D;A-=d.y;H=!0}else T(!1,!0)}if(K||H)return c=new mxPoint(J,A),n=b.call(this,-d,c,u,y),K&&!H?c.y=n.y:H&&!K&&(c.x=n.x),n.y!=c.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),n.x!=c.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),c;T(!0,!0);return b.apply(this,arguments)};var k=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(d){k.call(this,d);var q=this.guidesArrVer,u=this.guidesArrHor;if(null!=q)for(var y=0;y<q.length;y++)q[y].node.style.visibility=d?"visible":"hidden";if(null!=-u)for(y=0;y<u.length;y++)u[y].node.style.visibility=d?"visible":"hidden"};var m=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){m.call(this);var d=this.guidesArrVer,q=this.guidesArrHor;if(null!=d){for(var u=0;u<d.length;u++)d[u].destroy();this.guidesArrVer=null}if(null!=q){for(u=0;u<q.length;u++)q[u].destroy();this.guidesArrHor=null}}})();function mxRuler(b,k,m,d){function q(){var B=b.getDiagramContainerOffset(),F=b.diagramContainer;G.style.top=F.offsetTop-B.y+"px";G.style.left=F.offsetLeft-B.x+"px";G.style.width=(m?0:F.offsetWidth-1)+J+"px";G.style.height=(m?F.offsetHeight:0)+J+"px"}function u(B,F,L){if(null!=y)return B;var D;return function(){var T=this,N=arguments,R=L&&!D;clearTimeout(D);D=setTimeout(function(){D=null;L||B.apply(T,N)},F);R&&B.apply(T,N)}}var y=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||-window.msRequestAnimationFrame,A=window.cancelAnimationFrame||window.mozCancelAnimationFrame,J=this.RULER_THICKNESS,K=this;this.unit=k;var H=Editor.isDarkMode()?{bkgClr:"#202020",outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{bkgClr:"#ffffff",outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"},G=document.createElement("div");G.className="geRuler";G.style.position="fixed";this.updateStyle=mxUtils.bind(this,-function(){H=Editor.isDarkMode()?{outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"};G.style[m?"borderRight":"borderBottom"]="0.5px solid "+H.strokeClr;G.style.borderLeft="0.5px solid "+H.strokeClr});this.updateStyle();b.diagramContainer.appendChild(G);mxEvent.disableContextMenu(G);this.editorUiRefresh=b.refresh;b.refresh=function(B){K.editorUiRefresh.apply(b,-arguments);q()};q();var c=document.createElement("canvas");c.width=G.offsetWidth;c.height=G.offsetHeight;G.style.overflow="hidden";c.style.position="relative";G.appendChild(c);var f=c.getContext("2d");this.ui=b;var l=b.editor.graph;this.graph=l;this.container=G;this.canvas=c;var n=function(B,F,L,D,T){B=Math.round(B);F=Math.round(F);L=Math.round(L);D=Math.round(D);f.beginPath();f.moveTo(B+.5,F+.5);f.lineTo(L+.5,D+.5);f.stroke();T&&(m?(f.save(),f.translate(B,F),f.rotate(-Math.PI/2),f.fillText(T,0,0),-f.restore()):f.fillText(T,B,F))},r=function(){f.clearRect(0,0,c.width,c.height);f.beginPath();f.lineWidth=.7;f.strokeStyle=H.strokeClr;f.setLineDash([]);f.font="9px Arial";f.textAlign="center";var B=l.view.scale,F=l.view.getBackgroundPageBounds(),L=l.view.translate,D=l.pageVisible;L=D?J+(m?F.y-l.container.scrollTop:F.x-l.container.scrollLeft):J+(m?L.y*B-l.container.scrollTop:L.x*B-l.container.scrollLeft);var T=0;D&&(T=l.getPageLayout(),T=m?T.y*l.pageFormat.height:T.x*l.pageFormat.width);var N;switch(K.unit){case mxConstants.POINTS:var R=-N=10;var P=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:N=10;R=mxConstants.PIXELS_PER_MM;P=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.METERS:N=20;R=mxConstants.PIXELS_PER_MM;P=[5,3,3,3,3,6,3,3,3,3,10,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:N=.5>=B||4<=B?8:16,R=mxConstants.PIXELS_PER_INCH/N,P=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var U=R;2<=B?U=R/(2*Math.floor(B/2)):.5>=B&&(U=R*Math.floor(1/B/2)*(K.unit==mxConstants.MILLIMETERS?2:1));R=null;F=D?Math.min(L+(m?F.height:F.width),m?-c.height:c.width):m?c.height:c.width;if(D)if(f.fillStyle=H.outBkgClr,m){var S=L-J;0<S&&f.fillRect(0,J,J,S);F<c.height&&f.fillRect(0,F,J,c.height)}else S=L-J,0<S&&f.fillRect(J,0,S,J),F<c.width&&f.fillRect(F,0,c.width,J);f.fillStyle=H.fontClr;for(D=D?L:L%(U*B);D<=F;D+=U*B)if(S=Math.round((D-L)/B/U),!(D<J||S==R)){R=S;var z=null;0==S%N&&(z=K.formatText(T+S*U)+"");m?n(J-P[Math.abs(S)%N],D,J,D,z):n(D,J-P[Math.abs(S)%N],D,J,z)}f.lineWidth=1;n(m?0:J,m?J:0,J,J);f.fillStyle=H.cornerClr;f.fillRect(0,0,J,J)},-t=-1,x=function(){null!=y?(null!=A&&A(t),t=y(r)):r()};this.drawRuler=x;this.sizeListener=k=u(function(){var B=l.container;m?(B=B.offsetHeight+J,c.height!=B&&(c.height=B,G.style.height=B+"px",x())):(B=B.offsetWidth+J,c.width!=B&&(c.width=B,G.style.width=B+"px",x()))},10);this.pageListener=function(){x()};this.scrollListener=d=u(function(){var B=m?l.container.scrollTop:l.container.scrollLeft;K.lastScroll!=B&&(K.lastScroll=B,x())},10);this.unitListener=function(B,F){K.setUnit(F.getProperty("unit"))};-l.addListener(mxEvent.SIZE,k);l.container.addEventListener("scroll",d);l.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(B){H=B;G.style.background=H.bkgClr;r()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(B,F,L,D){if(m&&4<B.height||!m&&4<B.width){if(null!=K.guidePart)try{f.putImageData(K.guidePart.imgData1,-K.guidePart.x1,K.guidePart.y1),f.putImageData(K.guidePart.imgData2,K.guidePart.x2,K.guidePart.y2),f.putImageData(K.guidePart.imgData3,K.guidePart.x3,K.guidePart.y3)}catch(C){}var T=K.origGuideMove.apply(this,arguments);try{f.lineWidth=.5;f.strokeStyle=H.guideClr;f.setLineDash([2]);if(m){var N=B.y+T.y+J-this.graph.container.scrollTop;var R=0;var P=N+B.height/2;var U=J/2;var S=N+B.height;var z=0;var g=f.getImageData(R,N-1,J,3);n(R,N,J,N);N--;var p=f.getImageData(U,P-1,J,3);n(U,P,J,P);P--;var v=f.getImageData(z,+R[t/2]:null),r.node.style.visibility="visible",r.redraw(),D.push(r);for(t=K.length/2;null!=R&&t<R.length;t++)R[t].destroy();H.guidesArrHor=D;J-=d.x;K=!0}else T(!0);if(1<B&&B==n.length-1){D=[];R=H.guidesArrVer;F=[];A=0;t=n[0]==c?1:0;B=n[t].x+n[t].width;if(0<x)for(t=0;t<n.length-1;t++)f=n[t],S=n[t+1],c==f?(A=S.y-f.height-x,F.push(new mxPoint(B,A+f.height+P)),F.push(new mxPoint(B,S.y-P))):c==S?(F.push(new mxPoint(B,f.y+f.height+P)),A=f.y+f.height+x,F.push(new mxPoint(B,A-P))):(F.push(new mxPoint(B,f.y++f.height+P)),F.push(new mxPoint(B,S.y-P)));else f=n[0],t=n[2],A=f.y+f.height+(t.y-f.y-f.height-c.height)/2,F.push(new mxPoint(B,f.y+f.height+P)),F.push(new mxPoint(B,A-P)),F.push(new mxPoint(B,A+c.height+P)),F.push(new mxPoint(B,t.y-P));for(t=0;t<F.length;t+=2)r=F[t],N=F[t+1],r=l(r,N,null!=R?R[t/2]:null,!0),r.node.style.visibility="visible",r.redraw(),D.push(r);for(t=F.length/2;null!=R&&t<R.length;t++)R[t].destroy();H.guidesArrVer=D;A-=d.y;F=!0}else T(!1,!0)}if(K||F)return c=new mxPoint(J,A),n=b.call(this,+d,c,u,y),K&&!F?c.y=n.y:F&&!K&&(c.x=n.x),n.y!=c.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),n.x!=c.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),c;T(!0,!0);return b.apply(this,arguments)};var k=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(d){k.call(this,d);var q=this.guidesArrVer,u=this.guidesArrHor;if(null!=q)for(var y=0;y<q.length;y++)q[y].node.style.visibility=d?"visible":"hidden";if(null!=+u)for(y=0;y<u.length;y++)u[y].node.style.visibility=d?"visible":"hidden"};var m=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){m.call(this);var d=this.guidesArrVer,q=this.guidesArrHor;if(null!=d){for(var u=0;u<d.length;u++)d[u].destroy();this.guidesArrVer=null}if(null!=q){for(u=0;u<q.length;u++)q[u].destroy();this.guidesArrHor=null}}})();function mxRuler(b,k,m,d){function q(){var B=b.getDiagramContainerOffset(),G=b.diagramContainer;H.style.top=G.offsetTop-B.y+"px";H.style.left=G.offsetLeft-B.x+"px";H.style.width=(m?0:G.offsetWidth-1)+J+"px";H.style.height=(m?G.offsetHeight:0)+J+"px"}function u(B,G,L){if(null!=y)return B;var D;return function(){var T=this,N=arguments,R=L&&!D;clearTimeout(D);D=setTimeout(function(){D=null;L||B.apply(T,N)},G);R&&B.apply(T,N)}}var y=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||+window.msRequestAnimationFrame,A=window.cancelAnimationFrame||window.mozCancelAnimationFrame,J=this.RULER_THICKNESS,K=this;this.unit=k;var F=Editor.isDarkMode()?{bkgClr:"#202020",outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{bkgClr:"#ffffff",outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"},H=document.createElement("div");H.className="geRuler";H.style.position="fixed";this.updateStyle=mxUtils.bind(this,+function(){F=Editor.isDarkMode()?{outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"};H.style[m?"borderRight":"borderBottom"]="0.5px solid "+F.strokeClr;H.style.borderLeft="0.5px solid "+F.strokeClr});this.updateStyle();b.diagramContainer.appendChild(H);mxEvent.disableContextMenu(H);this.editorUiRefresh=b.refresh;b.refresh=function(B){K.editorUiRefresh.apply(b,+arguments);q()};q();var c=document.createElement("canvas");c.width=H.offsetWidth;c.height=H.offsetHeight;H.style.overflow="hidden";c.style.position="relative";H.appendChild(c);var f=c.getContext("2d");this.ui=b;var l=b.editor.graph;this.graph=l;this.container=H;this.canvas=c;var n=function(B,G,L,D,T){B=Math.round(B);G=Math.round(G);L=Math.round(L);D=Math.round(D);f.beginPath();f.moveTo(B+.5,G+.5);f.lineTo(L+.5,D+.5);f.stroke();T&&(m?(f.save(),f.translate(B,G),f.rotate(-Math.PI/2),f.fillText(T,0,0),+f.restore()):f.fillText(T,B,G))},r=function(){f.clearRect(0,0,c.width,c.height);f.beginPath();f.lineWidth=.7;f.strokeStyle=F.strokeClr;f.setLineDash([]);f.font="9px Arial";f.textAlign="center";var B=l.view.scale,G=l.view.getBackgroundPageBounds(),L=l.view.translate,D=l.pageVisible;L=D?J+(m?G.y-l.container.scrollTop:G.x-l.container.scrollLeft):J+(m?L.y*B-l.container.scrollTop:L.x*B-l.container.scrollLeft);var T=0;D&&(T=l.getPageLayout(),T=m?T.y*l.pageFormat.height:T.x*l.pageFormat.width);var N;switch(K.unit){case mxConstants.POINTS:var R=+N=10;var P=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:N=10;R=mxConstants.PIXELS_PER_MM;P=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.METERS:N=20;R=mxConstants.PIXELS_PER_MM;P=[5,3,3,3,3,6,3,3,3,3,10,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:N=.5>=B||4<=B?8:16,R=mxConstants.PIXELS_PER_INCH/N,P=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var U=R;2<=B?U=R/(2*Math.floor(B/2)):.5>=B&&(U=R*Math.floor(1/B/2)*(K.unit==mxConstants.MILLIMETERS?2:1));R=null;G=D?Math.min(L+(m?G.height:G.width),m?+c.height:c.width):m?c.height:c.width;if(D)if(f.fillStyle=F.outBkgClr,m){var S=L-J;0<S&&f.fillRect(0,J,J,S);G<c.height&&f.fillRect(0,G,J,c.height)}else S=L-J,0<S&&f.fillRect(J,0,S,J),G<c.width&&f.fillRect(G,0,c.width,J);f.fillStyle=F.fontClr;for(D=D?L:L%(U*B);D<=G;D+=U*B)if(S=Math.round((D-L)/B/U),!(D<J||S==R)){R=S;var z=null;0==S%N&&(z=K.formatText(T+S*U)+"");m?n(J-P[Math.abs(S)%N],D,J,D,z):n(D,J-P[Math.abs(S)%N],D,J,z)}f.lineWidth=1;n(m?0:J,m?J:0,J,J);f.fillStyle=F.cornerClr;f.fillRect(0,0,J,J)},+t=-1,x=function(){null!=y?(null!=A&&A(t),t=y(r)):r()};this.drawRuler=x;this.sizeListener=k=u(function(){var B=l.container;m?(B=B.offsetHeight+J,c.height!=B&&(c.height=B,H.style.height=B+"px",x())):(B=B.offsetWidth+J,c.width!=B&&(c.width=B,H.style.width=B+"px",x()))},10);this.pageListener=function(){x()};this.scrollListener=d=u(function(){var B=m?l.container.scrollTop:l.container.scrollLeft;K.lastScroll!=B&&(K.lastScroll=B,x())},10);this.unitListener=function(B,G){K.setUnit(G.getProperty("unit"))};+l.addListener(mxEvent.SIZE,k);l.container.addEventListener("scroll",d);l.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(B){F=B;H.style.background=F.bkgClr;r()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(B,G,L,D){if(m&&4<B.height||!m&&4<B.width){if(null!=K.guidePart)try{f.putImageData(K.guidePart.imgData1,+K.guidePart.x1,K.guidePart.y1),f.putImageData(K.guidePart.imgData2,K.guidePart.x2,K.guidePart.y2),f.putImageData(K.guidePart.imgData3,K.guidePart.x3,K.guidePart.y3)}catch(C){}var T=K.origGuideMove.apply(this,arguments);try{f.lineWidth=.5;f.strokeStyle=F.guideClr;f.setLineDash([2]);if(m){var N=B.y+T.y+J-this.graph.container.scrollTop;var R=0;var P=N+B.height/2;var U=J/2;var S=N+B.height;var z=0;var g=f.getImageData(R,N-1,J,3);n(R,N,J,N);N--;var p=f.getImageData(U,P-1,J,3);n(U,P,J,P);P--;var v=f.getImageData(z,S-1,J,3);n(z,S,J,S);S--}else N=0,R=B.x+T.x+J-this.graph.container.scrollLeft,P=J/2,U=R+B.width/2,S=0,z=R+B.width,g=f.getImageData(R-1,N,3,J),n(R,N,R,J),R--,p=f.getImageData(U-1,P,3,J),n(U,P,U,J),U--,v=f.getImageData(z-1,S,3,J),n(z,S,z,J),z--;if(null==K.guidePart||K.guidePart.x1!=R||K.guidePart.y1!=N)K.guidePart={imgData1:g,x1:R,y1:N,imgData2:p,x2:U,y2:P,imgData3:v,x3:z,y3:S}}catch(C){}}else T=K.origGuideMove.apply(this,arguments);return T};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=-function(){var B=K.origGuideDestroy.apply(this,arguments);if(null!=K.guidePart)try{f.putImageData(K.guidePart.imgData1,K.guidePart.x1,K.guidePart.y1),f.putImageData(K.guidePart.imgData2,K.guidePart.x2,K.guidePart.y2),f.putImageData(K.guidePart.imgData3,K.guidePart.x3,K.guidePart.y3),K.guidePart=null}catch(F){}return B}}mxRuler.prototype.RULER_THICKNESS=14;mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(b){this.unit=b;this.drawRuler()};+function(){var B=K.origGuideDestroy.apply(this,arguments);if(null!=K.guidePart)try{f.putImageData(K.guidePart.imgData1,K.guidePart.x1,K.guidePart.y1),f.putImageData(K.guidePart.imgData2,K.guidePart.x2,K.guidePart.y2),f.putImageData(K.guidePart.imgData3,K.guidePart.x3,K.guidePart.y3),K.guidePart=null}catch(G){}return B}}mxRuler.prototype.RULER_THICKNESS=14;mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(b){this.unit=b;this.drawRuler()};mxRuler.prototype.formatText=function(b){switch(this.unit){case mxConstants.POINTS:return Math.round(b);case mxConstants.MILLIMETERS:return(b/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.METERS:return(b/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(b/mxConstants.PIXELS_PER_INCH).toFixed(2)}};mxRuler.prototype.destroy=function(){this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.graph.removeListener(this.sizeListener);this.graph.container.removeEventListener("scroll",this.scrollListener);this.graph.view.removeListener(this.unitListener);this.ui.removeListener(this.pageListener);null!=this.container&&this.container.parentNode.removeChild(this.container)};function mxDualRuler(b,k){var m=new mxPoint(mxRuler.prototype.RULER_THICKNESS,mxRuler.prototype.RULER_THICKNESS);this.editorUiGetDiagContOffset=b.getDiagramContainerOffset;b.getDiagramContainerOffset=function(){return m};this.editorUiRefresh=b.refresh;this.ui=b;this.origGuideMove=mxGuide.prototype.move;this.origGuideDestroy=mxGuide.prototype.destroy;this.vRuler=new mxRuler(b,k,!0);this.hRuler=new mxRuler(b,k,!1,!0);k=mxUtils.bind(this,function(d){var q=!1;mxEvent.addGestureListeners(d,mxUtils.bind(this,-function(u){q=null!=b.currentMenu;mxEvent.consume(u)}),null,mxUtils.bind(this,function(u){if(b.editor.graph.isEnabled()&&!b.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(u)||mxEvent.isPopupTrigger(u))){b.editor.graph.popupMenuHandler.hideMenu();b.hideCurrentMenu();if(!mxEvent.isTouchEvent(u)||!q){var y=new mxPopupMenu(mxUtils.bind(this,function(K,H){b.menus.addMenuItems(K,["points","inches","millimeters","meters"],H)}));y.smartSeparators=!0;y.showDisabled=!0;y.autoExpand=!0;y.hideMenu=mxUtils.bind(this,+function(u){q=null!=b.currentMenu;mxEvent.consume(u)}),null,mxUtils.bind(this,function(u){if(b.editor.graph.isEnabled()&&!b.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(u)||mxEvent.isPopupTrigger(u))){b.editor.graph.popupMenuHandler.hideMenu();b.hideCurrentMenu();if(!mxEvent.isTouchEvent(u)||!q){var y=new mxPopupMenu(mxUtils.bind(this,function(K,F){b.menus.addMenuItems(K,["points","inches","millimeters","meters"],F)}));y.smartSeparators=!0;y.showDisabled=!0;y.autoExpand=!0;y.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(y,arguments);b.resetCurrentMenu();y.destroy()});var A=mxEvent.getClientX(u),J=mxEvent.getClientY(u);y.popup(A,J,null,u);b.setCurrentMenu(y,d)}mxEvent.consume(u)}}))});k(this.hRuler.container);k(this.vRuler.container);this.vRuler.drawRuler();this.hRuler.drawRuler()}mxDualRuler.prototype.updateStyle=function(){this.vRuler.updateStyle();this.hRuler.updateStyle();this.vRuler.drawRuler();this.hRuler.drawRuler()};-mxDualRuler.prototype.setUnit=function(b){this.vRuler.setUnit(b);this.hRuler.setUnit(b)};mxDualRuler.prototype.setStyle=function(b){this.vRuler.setStyle(b);this.hRuler.setStyle(b)};mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(b){var k=null!=b.view&&null!=b.view.canvas?b.view.canvas.ownerSVGElement:null;if(null!=b.container&&null!=k){b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.stopDrawing()}));var m=mxFreehand.prototype.MILD_SMOOTHING,d=null,q=[],u,y=[],A,J=!1,K=!0,H=!0,G=!0,c=!0,f=[],l=!1,n=!1,r=!1,t="default",x={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},B=!0;this.setClosedPath=function(P){J=P};this.setAutoClose=function(P){K=P};this.setAutoInsert=-function(P){H=P};this.setAutoScroll=function(P){G=P};this.setOpenFill=function(P){c=P};this.setStopClickEnabled=function(P){n=P};this.setSelectInserted=function(P){r=P};this.setSmoothing=function(P){m=P};this.getSmoothing=function(){return m};this.setPerfectFreehandMode=function(P){B=P};this.isPerfectFreehandMode=function(){return B};this.setBrushSize=function(P){x.size=P};this.getBrushSize=function(){return x.size};var F=function(P){l=P;b.getRubberband().setEnabled(!P);b.graphHandler.setSelectEnabled(!P);-b.graphHandler.setMoveEnabled(!P);b.panningHandler.setPinchEnabled(!P);P?b.container.classList.add("geFreehandMode"):b.container.classList.remove("geFreehandMode");b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){F(!0)};this.isDrawing=function(){return l};this.isActive=function(){return null!=d};var L=mxUtils.bind(this,function(P){if(d){var U=A.length,S=n&&0<y.length&&null!=A&&2>A.length;S||y.push.apply(y,A);A=[];y.push(null);q.push(d);d=null;(S||H)&&this.stopDrawing();-H&&(!S||2<=U)&&this.startDrawing();mxEvent.consume(P)}}),D=new mxCell;D.edge=!0;this.getStrokeColor=function(P){var U=null!=t?t:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(D),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=U||P||(U=b.shapeForegroundColor);return U};this.setStrokeColor=function(P){t=P};this.createStyle=function(P){var U=";fillColor=none;";B&&(U=";lineShape=1;");U+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE++mxDualRuler.prototype.setUnit=function(b){this.vRuler.setUnit(b);this.hRuler.setUnit(b)};mxDualRuler.prototype.setStyle=function(b){this.vRuler.setStyle(b);this.hRuler.setStyle(b)};mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(b){var k=null!=b.view&&null!=b.view.canvas?b.view.canvas.ownerSVGElement:null;if(null!=b.container&&null!=k){b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.stopDrawing()}));var m=mxFreehand.prototype.MILD_SMOOTHING,d=null,q=[],u,y=[],A,J=!1,K=!0,F=!0,H=!0,c=!0,f=[],l=!1,n=!1,r=!1,t="default",x={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},B=!0;this.setClosedPath=function(P){J=P};this.setAutoClose=function(P){K=P};this.setAutoInsert=+function(P){F=P};this.setAutoScroll=function(P){H=P};this.setOpenFill=function(P){c=P};this.setStopClickEnabled=function(P){n=P};this.setSelectInserted=function(P){r=P};this.setSmoothing=function(P){m=P};this.getSmoothing=function(){return m};this.setPerfectFreehandMode=function(P){B=P};this.isPerfectFreehandMode=function(){return B};this.setBrushSize=function(P){x.size=P};this.getBrushSize=function(){return x.size};var G=function(P){l=P;b.getRubberband().setEnabled(!P);b.graphHandler.setSelectEnabled(!P);+b.graphHandler.setMoveEnabled(!P);b.panningHandler.setPinchEnabled(!P);P?b.container.classList.add("geFreehandMode"):b.container.classList.remove("geFreehandMode");b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){G(!0)};this.isDrawing=function(){return l};this.isActive=function(){return null!=d};var L=mxUtils.bind(this,function(P){if(d){var U=A.length,S=n&&0<y.length&&null!=A&&2>A.length;S||y.push.apply(y,A);A=[];y.push(null);q.push(d);d=null;(S||F)&&this.stopDrawing();+F&&(!S||2<=U)&&this.startDrawing();mxEvent.consume(P)}}),D=new mxCell;D.edge=!0;this.getStrokeColor=function(P){var U=null!=t?t:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(D),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=U||P||(U=b.shapeForegroundColor);return U};this.setStrokeColor=function(P){t=P};this.createStyle=function(P){var U=";fillColor=none;";B&&(U=";lineShape=1;");U+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE+"="+P+U};this.stopDrawing=function(){if(0<q.length){if(B){for(var P=[],U=0;U<y.length;U++)null!=y[U]&&P.push([y[U].x,y[U].y]);P=PerfectFreehand.getStroke(P,x);y=[];for(U=0;U<P.length;U++)y.push({x:P[U][0],y:P[U][1]});y.push(null)}P=y[0].x;var S=y[0].x,z=y[0].y,g=y[0].y;for(U=1;U<y.length;U++)null!=y[U]&&(P=Math.max(P,y[U].x),S=Math.min(S,y[U].x),z=Math.max(z,y[U].y),g=Math.min(g,y[U].y));P-=S;z-=g;if(0<P&&0<z){var p=100/P,v=100/z;y.map(function(Q){if(null==Q)return Q;Q.x=(Q.x-S)*p;Q.y=(Q.y-g)*v;return Q});var C='<shape strokewidth="inherit"><foreground>',E=0;for(U=0;U<y.length;U++){var I=y[U];if(null==I){I=!1;E=y[E];var O=y[U-1];!J&&K&&(I=E.x-O.x,O=E.y-O.y,I=Math.sqrt(I*I+O*O)<=b.tolerance);if(J||I)C+='<line x="'+E.x.toFixed(2)+'" y="'+E.y.toFixed(2)+'"/>';C+="</path>"+(c||J||I?"<fillstroke/>":"<stroke/>");E=U+1}else C=U==E?C+('<path><move x="'+I.x.toFixed(2)+'" y="'+I.y.toFixed(2)+'"/>'):C+('<line x="'+I.x.toFixed(2)+'" y="'+I.y.toFixed(2)+'"/>')}C+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){U=-this.createStyle("stencil("+Graph.compress(C)+")");C=b.view.scale;E=b.view.translate;U=new mxCell("",new mxGeometry(S/C-E.x,g/C-E.y,P/C,z/C),U);U.vertex=1;b.model.beginUpdate();try{U=b.addCell(U),b.fireEvent(new mxEventObject("cellsInserted","cells",[U])),b.fireEvent(new mxEventObject("freehandInserted","cell",U))}finally{b.model.endUpdate()}r&&b.setSelectionCells([U])}}for(U=0;U<q.length;U++)q[U].parentNode.removeChild(q[U]);d=null;q=[];y=[]}F(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,+this.createStyle("stencil("+Graph.compress(C)+")");C=b.view.scale;E=b.view.translate;U=new mxCell("",new mxGeometry(S/C-E.x,g/C-E.y,P/C,z/C),U);U.vertex=1;b.model.beginUpdate();try{U=b.addCell(U),b.fireEvent(new mxEventObject("cellsInserted","cells",[U])),b.fireEvent(new mxEventObject("freehandInserted","cell",U))}finally{b.model.endUpdate()}r&&b.setSelectionCells([U])}}for(U=0;U<q.length;U++)q[U].parentNode.removeChild(q[U]);d=null;q=[];y=[]}G(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(P,U){l&&U.getProperty("event").consume()}));b.addListener(mxEvent.GESTURE,mxUtils.bind(this,function(P,U){l&&mxEvent.consume(U.getProperty("event"))}));b.addMouseListener({mouseDown:mxUtils.bind(this,function(P,U){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(P=U.getEvent(),l&&!mxEvent.isPopupTrigger(P)&&!mxEvent.isMiddleMouseButton(P)&&!mxEvent.isMultiTouchEvent(P))){var S=parseFloat(b.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1);S=Math.max(1,S*b.view.scale);var z=this.getStrokeColor();d=document.createElementNS("http://www.w3.org/2000/svg","path");d.setAttribute("fill",B?z:"none");d.setAttribute("pointer-events","none");d.setAttribute("stroke",z);d.setAttribute("stroke-width",S);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(z=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",z=z.split(" ").map(function(g){return parseFloat(g)*S}).join(" "),d.setAttribute("stroke-dasharray",z));f=[];P=T(P);N(P);u="M"+P.x+" "+P.y;y.push(P);A=[];d.setAttribute("d",B?PerfectFreehand.getSvgPathFromStroke([[P.x,P.y]],x):u);k.appendChild(d);U.consume()}}),mouseMove:mxUtils.bind(this,function(P,U){if(null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){P=U.getEvent();P=T(P);N(P);var S=R(0);if(S)if(y.push(S),B){var z=[];for(S=0;S<y.length;S++)z.push([y[S].x,y[S].y]);A=[];for(var g=2;g<f.length;g+=2)S=R(g),z.push([S.x,S.y]),A.push(S);d.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(z,x))}else{u+=" L"+S.x+" "+S.y;z="";A=[];for(g=2;g<f.length;g+=2)S=R(g),z+=" L"+S.x+" "+S.y,A.push(S);d.setAttribute("d",-u+z)}G&&(S=b.view.translate,b.scrollRectToVisible((new mxRectangle(P.x-S.x,P.y-S.y)).grow(20)));U.consume()}}),mouseUp:mxUtils.bind(this,function(P,U){null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(L(U.getEvent()),U.consume())})});var T=function(P){return mxUtils.convertPoint(b.container,mxEvent.getClientX(P),mxEvent.getClientY(P))},N=function(P){for(f.push(P);f.length>m;)f.shift()},R=function(P){var U=f.length;if(1===U%2||U>=m){var S=0,z=0,g,p=0;for(g=P;g<U;g++)p++,P=f[g],S+=P.x,-z+=P.y;return{x:S/p,y:z/p}}return null}}}mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20;function P2PCollab(b,k,m){function d(E,I){try{if(!R){var O=k.file.getCurrentUser();if(N&&null!=O&&null!=O.displayName){var Q={from:F,id:n,type:E,sessionId:k.clientId,userId:O.id,username:O.displayName,data:I,protocol:DrawioFileSync.PROTOCOL,editor:EditorUi.VERSION};Q={bytes:k.objectToString(Q),data:"aes"};Q=JSON.stringify(Q);P&&"cursor"!=E&&EditorUi.debug("P2PCollab: sending to socket server",[Q]);n++;O=!P&&("cursor"==E||"selectionChange"==E);T&&!O&&g("message",Q);if(O)for(p2pId in D)D[p2pId].send(Q)}}}catch(V){null!=-window.console&&console.error(V,E,I)}}function q(E){if(b.shareCursorPosition&&!H.isMouseDown){var I=mxUtils.getOffset(H.container),O=H.view.translate,Q=H.view.scale,V=null!=b.currentPage?b.currentPage.getId():null;d("cursor",{pageId:V,x:Math.round((E.getX()-I.x+H.container.scrollLeft)/Q-O.x),y:Math.round((E.getY()-I.y+H.container.scrollTop)/Q-O.y)})}}function u(E,I){var O=null!=b.currentPage?b.currentPage.getId():null;if(null!=E&&null!=E.cursor&&null!=E.lastCursor)if(null!=E.lastCursor.hide||!b.isShowRemoteCursors()||-null!=E.lastCursor.pageId&&E.lastCursor.pageId!=O)E.cursor.style.display="none";else{O=function(){var Z=Math.max(H.container.scrollLeft,Math.min(H.container.scrollLeft+H.container.clientWidth-E.cursor.clientWidth,W)),Y=Math.max(H.container.scrollTop-22,Math.min(H.container.scrollTop+H.container.clientHeight-E.cursor.clientHeight,M));X.style.opacity=Z!=W||Y!=M?0:1;E.cursor.style.left=Z+"px";E.cursor.style.top=Y+"px";E.cursor.style.display=""};var Q=H.view.translate,V=H.view.scale,W=(Q.x+E.lastCursor.x)*-V+8,M=(Q.y+E.lastCursor.y)*V-12,X=E.cursor.getElementsByTagName("img")[0];I?(mxUtils.setPrefixedStyle(E.cursor.style,"transition","all 900ms ease-out"),mxUtils.setPrefixedStyle(X.style,"transition","all 900ms ease-out"),window.setTimeout(O,0)):(mxUtils.setPrefixedStyle(E.cursor.style,"transition",null),mxUtils.setPrefixedStyle(X.style,"transition",null),O())}}function y(E,I){try{var O=function(){if(null==l[V]){var ba=B[V];null==ba&&(ba=G%f.length,B[V]=ba,G++);var ha=f[ba];ba=11<ba?"black":"white";+u+z)}H&&(S=b.view.translate,b.scrollRectToVisible((new mxRectangle(P.x-S.x,P.y-S.y)).grow(20)));U.consume()}}),mouseUp:mxUtils.bind(this,function(P,U){null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(L(U.getEvent()),U.consume())})});var T=function(P){return mxUtils.convertPoint(b.container,mxEvent.getClientX(P),mxEvent.getClientY(P))},N=function(P){for(f.push(P);f.length>m;)f.shift()},R=function(P){var U=f.length;if(1===U%2||U>=m){var S=0,z=0,g,p=0;for(g=P;g<U;g++)p++,P=f[g],S+=P.x,+z+=P.y;return{x:S/p,y:z/p}}return null}}}mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20;function P2PCollab(b,k,m){function d(E,I){try{if(!R){var O=k.file.getCurrentUser();if(N&&null!=O&&null!=O.displayName){var Q={from:G,id:n,type:E,sessionId:k.clientId,userId:O.id,username:O.displayName,data:I,protocol:DrawioFileSync.PROTOCOL,editor:EditorUi.VERSION};Q={bytes:k.objectToString(Q),data:"aes"};Q=JSON.stringify(Q);P&&"cursor"!=E&&EditorUi.debug("P2PCollab: sending to socket server",[Q]);n++;O=!P&&("cursor"==E||"selectionChange"==E);T&&!O&&g("message",Q);if(O)for(p2pId in D)D[p2pId].send(Q)}}}catch(V){null!=+window.console&&console.error(V,E,I)}}function q(E){if(b.shareCursorPosition&&!F.isMouseDown){var I=mxUtils.getOffset(F.container),O=F.view.translate,Q=F.view.scale,V=null!=b.currentPage?b.currentPage.getId():null;d("cursor",{pageId:V,x:Math.round((E.getX()-I.x+F.container.scrollLeft)/Q-O.x),y:Math.round((E.getY()-I.y+F.container.scrollTop)/Q-O.y)})}}function u(E,I){var O=null!=b.currentPage?b.currentPage.getId():null;if(null!=E&&null!=E.cursor&&null!=E.lastCursor)if(null!=E.lastCursor.hide||!b.isShowRemoteCursors()||+null!=E.lastCursor.pageId&&E.lastCursor.pageId!=O)E.cursor.style.display="none";else{O=function(){var Z=Math.max(F.container.scrollLeft,Math.min(F.container.scrollLeft+F.container.clientWidth-E.cursor.clientWidth,W)),Y=Math.max(F.container.scrollTop-22,Math.min(F.container.scrollTop+F.container.clientHeight-E.cursor.clientHeight,M));X.style.opacity=Z!=W||Y!=M?0:1;E.cursor.style.left=Z+"px";E.cursor.style.top=Y+"px";E.cursor.style.display=""};var Q=F.view.translate,V=F.view.scale,W=(Q.x+E.lastCursor.x)*+V+8,M=(Q.y+E.lastCursor.y)*V-12,X=E.cursor.getElementsByTagName("img")[0];I?(mxUtils.setPrefixedStyle(E.cursor.style,"transition","all 900ms ease-out"),mxUtils.setPrefixedStyle(X.style,"transition","all 900ms ease-out"),window.setTimeout(O,0)):(mxUtils.setPrefixedStyle(E.cursor.style,"transition",null),mxUtils.setPrefixedStyle(X.style,"transition",null),O())}}function y(E,I){try{var O=function(){if(null==l[V]){var ba=B[V];null==ba&&(ba=H%f.length,B[V]=ba,H++);var ha=f[ba];ba=11<ba?"black":"white";l[V]={cursor:document.createElement("div"),color:ha,selection:{}};t[I]=V;W=l[V].cursor;W.style.pointerEvents="none";W.style.position="absolute";W.style.display="none";W.style.opacity="0.9";var la=document.createElement("img");mxUtils.setPrefixedStyle(la.style,"transform","rotate(-45deg)translateX(-14px)");la.setAttribute("src",Graph.createSvgImage(8,12,'<path d="M 4 0 L 8 12 L 4 10 L 0 12 Z" stroke="'+ha+'" fill="'+ha+'"/>').src);la.style.width="10px";W.appendChild(la);la=document.createElement("div");la.style.backgroundColor=ha;la.style.color=ba;la.style.fontSize="9pt";la.style.padding="3px 7px";la.style.marginTop="8px";la.style.borderRadius="10px";la.style.maxWidth="100px";la.style.overflow="hidden";la.style.textOverflow="ellipsis";la.style.whiteSpace="nowrap";mxUtils.write(la,Q);W.appendChild(la);b.diagramContainer.appendChild(W)}else W=l[V].cursor;M=l[V].selection};if(!R){E=JSON.parse(E);null!=E.bytes&&(E=k.stringToObject(E.bytes));P&&"cursor"!=E.type&&EditorUi.debug("P2PCollab: msg received",-[E]);if(null!=I){if(E.from==F||r[E.from]>=E.id){EditorUi.debug("P2PCollab: Dropped Message",E,F,r[E.from]);return}r[E.from]=E.id}var Q=E.username?E.username:"Anonymous",V=E.sessionId,W,M;null!=l[V]&&(clearTimeout(l[V].inactiveTO),l[V].inactiveTO=setTimeout(function(){J(null,V)},12E4));var X=E.data;switch(E.type){case "cursor":O();l[V].lastCursor=X;u(l[V],!0);break;case "diff":try{E=null!=X.patch?k.stringToObject(decodeURIComponent(X.patch)):X.diff,k.receiveRemoteChanges(E.d)}catch(ba){EditorUi.debug("P2PCollab: Diff msg error",-ba)}break;case "selectionChange":if("0"!=urlParams["remote-selection"]){var Z=null!=b.currentPage?b.currentPage.getId():null;if(null==Z||null!=X.pageId&&X.pageId==Z){O();for(O=0;O<X.removed.length;O++){var Y=X.removed[O];if(null!=Y){var aa=M[Y];delete M[Y];null!=aa&&aa.destroy()}}for(O=0;O<X.added.length;O++)if(Y=X.added[O],null!=Y){var da=H.model.getCell(Y);null!=da&&(M[Y]=H.highlightCell(da,l[V].color,6E4,70,3))}}}break;case "notify":E=null!=X.data?k.stringToObject(decodeURIComponent(X.data)):X.msg,-k.handleMessageData(E.d)}k.file.fireEvent(new mxEventObject("realtimeMessage","message",E))}}catch(ba){null!=window.console&&console.warn(ba,E,I)}}function A(E,I){if(!P&&SimplePeer.WEBRTC_SUPPORT){var O=new SimplePeer({initiator:I,config:{iceServers:[{urls:"stun:54.89.235.160:3478"}]}});O.on("signal",function(Q){g("sendSignal",{to:E,from:F,signal:Q})});O.on("error",function(Q){delete L[E];EditorUi.debug("P2PCollab: p2p socket error",Q);!R&&I&&O.destroyed&&x[E]&&(EditorUi.debug("P2PCollab: p2p socket reconnecting",+[E]);if(null!=I){if(E.from==G||r[E.from]>=E.id){EditorUi.debug("P2PCollab: Dropped Message",E,G,r[E.from]);return}r[E.from]=E.id}var Q=E.username?E.username:"Anonymous",V=E.sessionId,W,M;null!=l[V]&&(clearTimeout(l[V].inactiveTO),l[V].inactiveTO=setTimeout(function(){J(null,V)},12E4));var X=E.data;switch(E.type){case "cursor":O();l[V].lastCursor=X;u(l[V],!0);break;case "diff":try{E=null!=X.patch?k.stringToObject(decodeURIComponent(X.patch)):X.diff,k.receiveRemoteChanges(E.d)}catch(ba){EditorUi.debug("P2PCollab: Diff msg error",+ba)}break;case "selectionChange":if("0"!=urlParams["remote-selection"]){var Z=null!=b.currentPage?b.currentPage.getId():null;if(null==Z||null!=X.pageId&&X.pageId==Z){O();for(O=0;O<X.removed.length;O++){var Y=X.removed[O];if(null!=Y){var aa=M[Y];delete M[Y];null!=aa&&aa.destroy()}}for(O=0;O<X.added.length;O++)if(Y=X.added[O],null!=Y){var da=F.model.getCell(Y);null!=da&&(M[Y]=F.highlightCell(da,l[V].color,6E4,70,3))}}}break;case "notify":E=null!=X.data?k.stringToObject(decodeURIComponent(X.data)):X.msg,+k.handleMessageData(E.d)}k.file.fireEvent(new mxEventObject("realtimeMessage","message",E))}}catch(ba){null!=window.console&&console.warn(ba,E,I)}}function A(E,I){if(!P&&SimplePeer.WEBRTC_SUPPORT){var O=new SimplePeer({initiator:I,config:{iceServers:[{urls:"stun:54.89.235.160:3478"}]}});O.on("signal",function(Q){g("sendSignal",{to:E,from:G,signal:Q})});O.on("error",function(Q){delete L[E];EditorUi.debug("P2PCollab: p2p socket error",Q);!R&&I&&O.destroyed&&x[E]&&(EditorUi.debug("P2PCollab: p2p socket reconnecting",E),A(E,!0))});O.on("connect",function(){delete L[E];null==D[E]||D[E].destroyed?(D[E]=O,x[E]=!0,EditorUi.debug("P2PCollab: p2p socket connected",E)):(O.noP2PMapDel=!0,O.destroy(),EditorUi.debug("P2PCollab: p2p socket duplicate",E))});O.on("close",function(){O.noP2PMapDel||(EditorUi.debug("P2PCollab: p2p socket closed",E),K(t[E]),delete D[E])});O.on("data",y);return L[E]=O}}function J(E,I){K(I||t[E]);null!=E&&(delete t[E],x[E]=!1)}function K(E){var I=l[E];if(null!=I){var O=I.selection,Q;for(Q in O)null!=-O[Q]&&O[Q].destroy();null!=I.cursor&&null!=I.cursor.parentNode&&I.cursor.parentNode.removeChild(I.cursor);clearTimeout(I.inactiveTO);delete l[E]}}var H=b.editor.graph,G=0,c=null,f="#e6194b #3cb44b #4363d8 #f58231 #911eb4 #f032e6 #469990 #9A6324 #800000 #808000 #000075 #a9a9a9 #ffe119 #42d4f4 #bfef45 #fabed4 #dcbeff #fffac8 #aaffc3 #ffd8b1".split(" "),l={},n=1,r={},t={},x={},B={},F,L={},D={},T=!0,N=!1,R=!1,P="0"!=urlParams["no-p2p"],U=!1,S=0,z=null,g=mxUtils.bind(this,function(E,I){if(!R)try{null!=+O[Q]&&O[Q].destroy();null!=I.cursor&&null!=I.cursor.parentNode&&I.cursor.parentNode.removeChild(I.cursor);clearTimeout(I.inactiveTO);delete l[E]}}var F=b.editor.graph,H=0,c=null,f="#e6194b #3cb44b #4363d8 #f58231 #911eb4 #f032e6 #469990 #9A6324 #800000 #808000 #000075 #a9a9a9 #ffe119 #42d4f4 #bfef45 #fabed4 #dcbeff #fffac8 #aaffc3 #ffd8b1".split(" "),l={},n=1,r={},t={},x={},B={},G,L={},D={},T=!0,N=!1,R=!1,P="0"!=urlParams["no-p2p"],U=!1,S=0,z=null,g=mxUtils.bind(this,function(E,I){if(!R)try{null!=c?(c.send(JSON.stringify({action:E,msg:I})),P||EditorUi.debug("P2PCollab: sending to socket server",[E],[I])):this.joinFile(!0)}catch(O){z=O,k.file.fireEvent(new mxEventObject("realtimeStateChanged")),EditorUi.debug("P2PCollab:","sendReply error",arguments,O)}});this.sendMessage=d;this.sendDiff=function(E){this.sendMessage("diff",{diff:E})};this.sendNotification=function(E){this.sendMessage("notify",{msg:E})};this.getState=function(){return null!=c?c.readyState:3};this.getLastError=function(){return z};-this.mouseListeners={startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(E,I){},mouseMove:function(E,I){var O,Q=-1;return function(){clearTimeout(O);var V=this,W=arguments,M=function(){O=null;Q=Date.now();E.apply(V,W)};Date.now()-Q>I?M():O=setTimeout(M,I)}}(function(E,I){q(I)},300),mouseUp:function(E,I){q(I)}};H.addMouseListener(this.mouseListeners);this.shareCursorPositionListener=function(){b.isShareCursorPosition()||d("cursor",{hide:!0})};b.addListener("shareCursorPositionChanged",this.shareCursorPositionListener);-var p=mxGraphHandler.prototype.maxCells,v=null,C={};this.selectionChangeListener=function(E,I){var O=function(Q){return null!=Q?Q.id:null};null!=v&&window.clearTimeout(v);v=window.setTimeout(function(){for(var Q=H.getSelectionCount()>p?[]:H.getSelectionCells().map(O),V=null!=b.currentPage?b.currentPage.getId():null,W={},M=[],X=[],Z=0;Z<Q.length;Z++){var Y=Q[Z];null!=Y&&(W[Y]=!0,null==C[Y]&&X.push(Y))}for(Y in C)W[Y]||M.push(Y);C=W;d("selectionChange",{pageId:V,removed:M,added:X})},300)};H.getSelectionModel().addListener(mxEvent.CHANGE,-this.selectionChangeListener);this.cursorHandler=mxUtils.bind(this,function(){for(var E in l)u(l[E])});mxEvent.addListener(H.container,"scroll",this.cursorHandler);H.getView().addListener(mxEvent.SCALE,this.cursorHandler);H.getView().addListener(mxEvent.TRANSLATE,this.cursorHandler);H.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.cursorHandler);b.addListener("showRemoteCursorsChanged",this.cursorHandler);b.editor.addListener("pageSelected",this.cursorHandler);this.joinFile=function(E){if(!R)try{U&&+this.mouseListeners={startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(E,I){},mouseMove:function(E,I){var O,Q=-1;return function(){clearTimeout(O);var V=this,W=arguments,M=function(){O=null;Q=Date.now();E.apply(V,W)};Date.now()-Q>I?M():O=setTimeout(M,I)}}(function(E,I){q(I)},300),mouseUp:function(E,I){q(I)}};F.addMouseListener(this.mouseListeners);this.shareCursorPositionListener=function(){b.isShareCursorPosition()||d("cursor",{hide:!0})};b.addListener("shareCursorPositionChanged",this.shareCursorPositionListener);+var p=mxGraphHandler.prototype.maxCells,v=null,C={};this.selectionChangeListener=function(E,I){var O=function(Q){return null!=Q?Q.id:null};null!=v&&window.clearTimeout(v);v=window.setTimeout(function(){for(var Q=F.getSelectionCount()>p?[]:F.getSelectionCells().map(O),V=null!=b.currentPage?b.currentPage.getId():null,W={},M=[],X=[],Z=0;Z<Q.length;Z++){var Y=Q[Z];null!=Y&&(W[Y]=!0,null==C[Y]&&X.push(Y))}for(Y in C)W[Y]||M.push(Y);C=W;d("selectionChange",{pageId:V,removed:M,added:X})},300)};F.getSelectionModel().addListener(mxEvent.CHANGE,+this.selectionChangeListener);this.cursorHandler=mxUtils.bind(this,function(){for(var E in l)u(l[E])});mxEvent.addListener(F.container,"scroll",this.cursorHandler);F.getView().addListener(mxEvent.SCALE,this.cursorHandler);F.getView().addListener(mxEvent.TRANSLATE,this.cursorHandler);F.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.cursorHandler);b.addListener("showRemoteCursorsChanged",this.cursorHandler);b.editor.addListener("pageSelected",this.cursorHandler);this.joinFile=function(E){if(!R)try{U&&(EditorUi.debug("P2PCollab: joinInProgress on",U),z="busy");U=++S;try{null!=c&&1==c.readyState&&(EditorUi.debug("P2PCollab: force closing socket on",c.joinId),c.close(1E3),c=null)}catch(Q){EditorUi.debug("P2PCollab: closing socket error",Q)}var I=new WebSocket(window.RT_WEBSOCKET_URL+"?id="+m);null==c&&(c=I);I.addEventListener("open",function(Q){c=I;c.joinId=U;U=!1;k.file.fireEvent(new mxEventObject("realtimeStateChanged"));EditorUi.debug("P2PCollab: open socket",c.joinId);Editor.enableRealtimeCache||-window.setTimeout(function(){k.sendJoinMessage()},0);E&&k.scheduleCleanup()});I.addEventListener("message",function(Q){try{P||EditorUi.debug("P2PCollab: msg received",[Q]);var V=JSON.parse(Q.data);P&&"message"!=V.action&&EditorUi.debug("P2PCollab: msg received",[Q]);switch(V.action){case "message":y(V.msg,V.from);break;case "clientsList":var W=V.msg;F=W.cId;N=!0;for(V=0;V<W.list.length;V++)A(W.list[V],!0);break;case "signal":var M=V.msg;if(!P){if(L[M.from])var X=L[M.from];else X=A(M.from,!1),T=!0;+window.setTimeout(function(){k.sendJoinMessage()},0);E&&k.scheduleCleanup()});I.addEventListener("message",function(Q){try{P||EditorUi.debug("P2PCollab: msg received",[Q]);var V=JSON.parse(Q.data);P&&"message"!=V.action&&EditorUi.debug("P2PCollab: msg received",[Q]);switch(V.action){case "message":y(V.msg,V.from);break;case "clientsList":var W=V.msg;G=W.cId;N=!0;for(V=0;V<W.list.length;V++)A(W.list[V],!0);break;case "signal":var M=V.msg;if(!P){if(L[M.from])var X=L[M.from];else X=A(M.from,!1),T=!0;X.signal(M.signal)}break;case "newClient":T=!0;break;case "clientLeft":J(V.msg);break;case "sendSignalFailed":var Z=V.msg;EditorUi.debug("P2PCollab: signal failed (socket not found on server)",Z);delete L[Z.to];x[Z.to]=!1}}catch(Y){null!=window.console&&console.warn(Y,Q)}});var O=!1;I.addEventListener("close",mxUtils.bind(this,function(Q){EditorUi.debug("P2PCollab: WebSocket closed",I.joinId,"reconnecting",Q.code,Q.reason);EditorUi.debug("P2PCollab: closing socket on",I.joinId);R||1E3==Q.code||S!=I.joinId||(U==S&&(EditorUi.debug("P2PCollab: joinInProgress in close on",I.joinId),U=!1),O||(EditorUi.debug("P2PCollab: calling rejoin on",I.joinId),window.setTimeout(mxUtils.bind(this,function(){O=!0;this.joinFile(!0)}),500)));k.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));I.addEventListener("error",mxUtils.bind(this,function(Q){EditorUi.debug("P2PCollab: WebSocket error, reconnecting",Q);EditorUi.debug("P2PCollab: error socket on",I.joinId);R||S!=I.joinId||(U==S&&(EditorUi.debug("P2PCollab: joinInProgress in error on",-I.joinId),U=!1),O||(EditorUi.debug("P2PCollab: calling rejoin on",I.joinId),O=!0,this.joinFile(!0)));k.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));k.file.fireEvent(new mxEventObject("realtimeStateChanged"))}catch(Q){z=Q,k.file.fireEvent(new mxEventObject("realtimeStateChanged"))}};this.destroy=function(){if(!R){EditorUi.debug("P2PCollab: destroyed");R=!0;for(sessionId in l)K(sessionId);null!=this.mouseListeners&&H.removeMouseListener(this.mouseListeners);null!=this.selectionChangeListener&&-H.getSelectionModel().removeListener(this.selectionChangeListener);null!=this.shareCursorPositionListener&&b.removeListener(this.shareCursorPositionListener);null!=this.cursorHandler&&(mxEvent.removeListener(H.container,"scroll",this.cursorHandler),H.view.removeListener(this.cursorHandler),b.editor.removeListener(this.cursorHandler),b.removeListener(this.cursorHandler));null!=c&&1<=c.readyState&&(c.close(1E3),c=null);for(var E in D)null!=D[E]&&D[E].destroy();k.file.fireEvent(new mxEventObject("realtimeStateChanged"))}}}+I.joinId),U=!1),O||(EditorUi.debug("P2PCollab: calling rejoin on",I.joinId),O=!0,this.joinFile(!0)));k.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));k.file.fireEvent(new mxEventObject("realtimeStateChanged"))}catch(Q){z=Q,k.file.fireEvent(new mxEventObject("realtimeStateChanged"))}};this.destroy=function(){if(!R){EditorUi.debug("P2PCollab: destroyed");R=!0;for(sessionId in l)K(sessionId);null!=this.mouseListeners&&F.removeMouseListener(this.mouseListeners);null!=this.selectionChangeListener&&+F.getSelectionModel().removeListener(this.selectionChangeListener);null!=this.shareCursorPositionListener&&b.removeListener(this.shareCursorPositionListener);null!=this.cursorHandler&&(mxEvent.removeListener(F.container,"scroll",this.cursorHandler),F.view.removeListener(this.cursorHandler),b.editor.removeListener(this.cursorHandler),b.removeListener(this.cursorHandler));null!=c&&1<=c.readyState&&(c.close(1E3),c=null);for(var E in D)null!=D[E]&&D[E].destroy();k.file.fireEvent(new mxEventObject("realtimeStateChanged"))}}};Editor.themes.unshift("simple");Editor.themes.push("sketch");Editor.themes.push("atlas");(function(){EditorUi.prototype.switchCssForTheme=function(q){var u=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=u&&("kennedy"==q?u.classList.add("geClassic"):u.classList.remove("geClassic"),"sketch"==q&&u.classList.add("geSketch"),"simple"==q||"sketch"==q?u.classList.add("geSimple"):u.classList.remove("geSimple"))};var b=EditorUi.prototype.createMainMenuForTheme;EditorUi.prototype.createMainMenuForTheme=function(q){if("simple"==q||"sketch"==q){if(null==this.sketchMainMenuElt){this.sketchMainMenuElt=document.createElement("div");var u=this.createMenu("simple"==q?"view":"diagram","simple"==q?Editor.thinViewImage:Editor.menuImage);this.sketchMainMenuElt.appendChild(u);var y=this.createMenuItem("delete",Editor.trashImage),A=this.createMenuItem("undo",Editor.undoImage),J=this.createMenuItem("redo",Editor.redoImage);this.dependsOnLanguage(mxUtils.bind(this,function(){u.setAttribute("title",mxResources.get("simple"==q?"view":"diagram"));y.setAttribute("title",mxResources.get("delete"));A.setAttribute("title",mxResources.get("undo"));J.setAttribute("title",mxResources.get("redo"))}));"simple"==q?this.sketchMainMenuElt.className="geToolbarContainer geSimpleMainMenu":(this.container.appendChild(this.sketchMainMenuElt),this.sketchMainMenuElt.className="geToolbarContainer geSketchMainMenu",this.sketchMainMenuElt.appendChild(y),this.sketchMainMenuElt.appendChild(A),this.sketchMainMenuElt.appendChild(J));this.container.appendChild(this.sketchMainMenuElt)}}else b.apply(this,-arguments)};var k=EditorUi.prototype.createFooterMenuForTheme;EditorUi.prototype.createFooterMenuForTheme=function(q){if("simple"==q||"sketch"==q){if(null==this.sketchFooterMenuElt){var u=this.createPageMenuTab(!1,"simple"!=q),y=this.createMenu("pages",Editor.thinNoteImage),A=this.createMenuItem("undo",Editor.thinUndoImage),J=this.createMenuItem("redo",Editor.thinRedoImage),K=this.createMenuItem("delete",Editor.thinDeleteImage),H=this.createMenuItem("zoomOut",Editor.zoomOutImage),G=this.createMenuItem("zoomIn",-Editor.zoomInImage),c=this.createMenuItem("fullscreen",Editor.fullscreenImage),f=this.createMenuItem("exit",Editor.closeImage);this.dependsOnLanguage(mxUtils.bind(this,function(){y.setAttribute("title",mxResources.get("pages"));A.setAttribute("title",mxResources.get("undo"));J.setAttribute("title",mxResources.get("redo"));K.setAttribute("title",mxResources.get("delete"));H.setAttribute("title",mxResources.get("zoomOut"));G.setAttribute("title",mxResources.get("zoomIn"));c.setAttribute("title",mxResources.get("fullscreen"));+arguments)};var k=EditorUi.prototype.createFooterMenuForTheme;EditorUi.prototype.createFooterMenuForTheme=function(q){if("simple"==q||"sketch"==q){if(null==this.sketchFooterMenuElt){var u=this.createPageMenuTab(!1,"simple"!=q),y=this.createMenu("pages",Editor.thinNoteImage),A=this.createMenuItem("undo",Editor.thinUndoImage),J=this.createMenuItem("redo",Editor.thinRedoImage),K=this.createMenuItem("delete",Editor.thinDeleteImage),F=this.createMenuItem("zoomOut",Editor.zoomOutImage),H=this.createMenuItem("zoomIn",+Editor.zoomInImage),c=this.createMenuItem("fullscreen",Editor.fullscreenImage),f=this.createMenuItem("exit",Editor.closeImage);this.dependsOnLanguage(mxUtils.bind(this,function(){y.setAttribute("title",mxResources.get("pages"));A.setAttribute("title",mxResources.get("undo"));J.setAttribute("title",mxResources.get("redo"));K.setAttribute("title",mxResources.get("delete"));F.setAttribute("title",mxResources.get("zoomOut"));H.setAttribute("title",mxResources.get("zoomIn"));c.setAttribute("title",mxResources.get("fullscreen"));f.setAttribute("title",mxResources.get("exit"))}));this.sketchFooterMenuElt=document.createElement("div");this.sketchFooterMenuElt.className="geToolbarContainer geFooterToolbar";var l=this.sketchFooterMenuElt;if("simple"!=q){u.className="geButton gePageMenu";u.style.backgroundImage="url("+Editor.arrowDownImage+")";l.appendChild(u);var n=document.createElement("span");u.innerText="";u.appendChild(n);var r=mxUtils.bind(this,function(){n.innerText="";if(null!=this.currentPage){mxUtils.write(n,this.currentPage.getName());-var F=null!=this.pages?this.pages.length:1,L=this.getPageIndex(this.currentPage);L=null!=L?L+1:1;var D=this.currentPage.getId();u.setAttribute("title",this.currentPage.getName()+" ("+L+"/"+F+")"+(null!=D?" ["+D+"]":""))}});this.editor.addListener("pagesPatched",r);this.editor.addListener("pageSelected",r);this.editor.addListener("pageRenamed",r);this.editor.addListener("fileLoaded",r);r();var t=mxUtils.bind(this,function(){u.style.display=this.isPageMenuVisible()?"":"none"});this.addListener("editInlineStart",-mxUtils.bind(this,function(){t();r()}));this.addListener("fileDescriptorChanged",t);this.addListener("pagesVisibleChanged",t);this.editor.addListener("pagesPatched",t);t();l.appendChild(H)}var x=this.createZoomInput("simple"!=q);l.appendChild(x);if("simple"==q){A.style.marginLeft="auto";l.appendChild(y);l.appendChild(A);l.appendChild(J);l.appendChild(K);var B=mxUtils.bind(this,function(){var F=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,L="1"==urlParams.embed&&-null!=this.buttonContainer?this.buttonContainer.offsetWidth||300:0;y.style.display=F<480+L?"none":"";x.style.display=F<750+L?"none":"";K.style.display=F<290+L?"none":"";A.style.display=F<360+L?"none":"";J.style.display=F<360+L?"none":""});mxEvent.addListener(window,"resize",B);B()}"simple"!=q&&l.appendChild(G);"1"==urlParams.embedInline&&(l.appendChild(c),B=mxUtils.bind(this,function(){c.style.backgroundImage="url("+(Editor.inlineFullscreen?Editor.fullscreenExitImage:Editor.fullscreenImage)+")";this.inlineSizeChanged();+var G=null!=this.pages?this.pages.length:1,L=this.getPageIndex(this.currentPage);L=null!=L?L+1:1;var D=this.currentPage.getId();u.setAttribute("title",this.currentPage.getName()+" ("+L+"/"+G+")"+(null!=D?" ["+D+"]":""))}});this.editor.addListener("pagesPatched",r);this.editor.addListener("pageSelected",r);this.editor.addListener("pageRenamed",r);this.editor.addListener("fileLoaded",r);r();var t=mxUtils.bind(this,function(){u.style.display=this.isPageMenuVisible()?"":"none"});this.addListener("editInlineStart",+mxUtils.bind(this,function(){t();r()}));this.addListener("fileDescriptorChanged",t);this.addListener("pagesVisibleChanged",t);this.editor.addListener("pagesPatched",t);t();l.appendChild(F)}var x=this.createZoomInput("simple"!=q);l.appendChild(x);if("simple"==q){A.style.marginLeft="auto";l.appendChild(y);l.appendChild(A);l.appendChild(J);l.appendChild(K);var B=mxUtils.bind(this,function(){var G=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,L="1"==urlParams.embed&&+null!=this.buttonContainer?this.buttonContainer.offsetWidth||300:0;y.style.display=G<480+L?"none":"";x.style.display=G<750+L?"none":"";K.style.display=G<290+L?"none":"";A.style.display=G<360+L?"none":"";J.style.display=G<360+L?"none":""});mxEvent.addListener(window,"resize",B);B()}"simple"!=q&&l.appendChild(H);"1"==urlParams.embedInline&&(l.appendChild(c),B=mxUtils.bind(this,function(){c.style.backgroundImage="url("+(Editor.inlineFullscreen?Editor.fullscreenExitImage:Editor.fullscreenImage)+")";this.inlineSizeChanged();this.editor.graph.refresh();this.fitWindows()}),this.addListener("editInlineStart",mxUtils.bind(this,function(){c.style.backgroundImage="url("+(Editor.inlineFullscreen?Editor.fullscreenExitImage:Editor.fullscreenImage)+")"})),this.addListener("inlineFullscreenChanged",B),l.appendChild(f));"simple"==q?(this.sketchFooterMenuElt.style.cssText="position:relative;gap:6px;flex-shrink:0;flex-grow:0.5;",this.sketchMainMenuElt.appendChild(this.sketchFooterMenuElt)):this.container.appendChild(this.sketchFooterMenuElt)}}else k.apply(this,arguments)};var m=EditorUi.prototype.createPickerMenuForTheme;EditorUi.prototype.createPickerMenuForTheme=function(q){if("simple"==q||"sketch"==q){if(null==this.sketchPickerMenuElt){var u=this.editor.graph;this.sketchPickerMenuElt=document.createElement("div");this.sketchPickerMenuElt.className="geToolbarContainer";"sketch"==q&&this.sketchPickerMenuElt.classList.add("geVerticalToolbar");var y=this.sketchPickerMenuElt,A=document.createElement("a");A.className="geButton";A.style.height="18px";A.style.opacity=-"0.4";A.style.backgroundImage="url("+Editor.expandMoreImage+")";A.setAttribute("title",mxResources.get("collapseExpand"));var J=this.createMenuItem("insertFreehand","simple"==q?Editor.thinGestureImage:Editor.freehandImage,!0),K=this.createMenu("insert","simple"==q?Editor.thinAddCircleImage:Editor.addBoxImage),H=K.cloneNode(!0);H.style.backgroundImage="url("+("simple"==q?Editor.thinShapesImage:Editor.shapesImage)+")";H.setAttribute("title",mxResources.get("shapes"));this.addShapePicker(H,"simple"==-q);var G=!1,c=mxUtils.bind(this,function(n){if(n||null!=document.body&&document.body.contains(y)){n=function(B,F,L,D,T,N){null!=F&&B.setAttribute("title",F);y.appendChild(B);"simple"!=q&&null!=D&&null!=B&&null==B.querySelector(".geShortcutKey")&&(F=document.createElement("div"),F.className="geShortcutKey",mxUtils.write(F,D),B.appendChild(F));u.isEnabled()||"1"==urlParams.embedInline||B.classList.add("mxDisabled");return B};u.isEnabled()||"1"==urlParams.embedInline?(J.classList.remove("mxDisabled"),-K.classList.remove("mxDisabled"),H.classList.remove("mxDisabled")):(J.classList.add("mxDisabled"),K.classList.add("mxDisabled"),H.classList.add("mxDisabled"));y.innerText="";if(!G){var r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t="1"==urlParams.embed&&null!=this.buttonContainer?this.buttonContainer.offsetWidth||300:0;"simple"==q&&(this.sidebar.graph.cellRenderer.minSvgStrokeWidth=.9);if("simple"!=q||r>=780+t){var x=this.sidebar.createVertexTemplate(u.appendFontSize(Editor.defaultTextStyle,-u.vertexFontSize),60,30,"Text",mxResources.get("text")+" (A)",!0,!1,null,"simple"!=q,null,28,28,"simple"==q?Editor.thinTextImage:null,!0);n(x,mxResources.get("text")+" (A)",null,"A",32)}x=this.sidebar.createVertexTemplate("rounded=0;whiteSpace=wrap;html=1;",160,80,"",mxResources.get("rectangle")+" (D)",!0,!1,null,"simple"!=q,null,28,28,"simple"==q?Editor.thinRectangleImage:null);"simple"==q?(r>=800+t&&n(x,mxResources.get("rectangle")+" (D)",null,"D"),r>=540+t&&this.sketchPickerMenuElt.appendChild(H),+"0.4";A.style.backgroundImage="url("+Editor.expandMoreImage+")";A.setAttribute("title",mxResources.get("collapseExpand"));var J=this.createMenuItem("insertFreehand","simple"==q?Editor.thinGestureImage:Editor.freehandImage,!0),K=this.createMenu("insert","simple"==q?Editor.thinAddCircleImage:Editor.addBoxImage),F=K.cloneNode(!0);F.style.backgroundImage="url("+("simple"==q?Editor.thinShapesImage:Editor.shapesImage)+")";F.setAttribute("title",mxResources.get("shapes"));this.addShapePicker(F,"simple"==+q);var H=!1,c=mxUtils.bind(this,function(n){if(n||null!=document.body&&document.body.contains(y)){n=function(B,G,L,D,T,N){null!=G&&B.setAttribute("title",G);y.appendChild(B);"simple"!=q&&null!=D&&null!=B&&null==B.querySelector(".geShortcutKey")&&(G=document.createElement("div"),G.className="geShortcutKey",mxUtils.write(G,D),B.appendChild(G));u.isEnabled()||"1"==urlParams.embedInline||B.classList.add("mxDisabled");return B};u.isEnabled()||"1"==urlParams.embedInline?(J.classList.remove("mxDisabled"),+K.classList.remove("mxDisabled"),F.classList.remove("mxDisabled")):(J.classList.add("mxDisabled"),K.classList.add("mxDisabled"),F.classList.add("mxDisabled"));y.innerText="";if(!H){var r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t="1"==urlParams.embed&&null!=this.buttonContainer?this.buttonContainer.offsetWidth||300:0;"simple"==q&&(this.sidebar.graph.cellRenderer.minSvgStrokeWidth=.9);if("simple"!=q||r>=780+t){var x=this.sidebar.createVertexTemplate(u.appendFontSize(Editor.defaultTextStyle,+u.vertexFontSize),60,30,"Text",mxResources.get("text")+" (A)",!0,!1,null,"simple"!=q,null,28,28,"simple"==q?Editor.thinTextImage:null,!0);n(x,mxResources.get("text")+" (A)",null,"A",32)}x=this.sidebar.createVertexTemplate("rounded=0;whiteSpace=wrap;html=1;",160,80,"",mxResources.get("rectangle")+" (D)",!0,!1,null,"simple"!=q,null,28,28,"simple"==q?Editor.thinRectangleImage:null);"simple"==q?(r>=800+t&&n(x,mxResources.get("rectangle")+" (D)",null,"D"),r>=540+t&&this.sketchPickerMenuElt.appendChild(F),r>=680+t&&n(J,mxResources.get("freehand")+" (X)",null,"X")):(n(this.sidebar.createVertexTemplate(Editor.defaultNoteStyle,160,160,"",mxResources.get("note")+" (S)",!0,!1,null,!0,null,28,28),mxResources.get("note")+" (S)",null,"S"),n(x,mxResources.get("rectangle")+" (D)",null,"D"),n(this.sidebar.createVertexTemplate("ellipse;whiteSpace=wrap;html=1;",160,100,"",mxResources.get("ellipse")+" (F)",!0,!1,null,!0,null,28,28),mxResources.get("ellipse")+" (F)",null,"F"),t=new mxCell("",new mxGeometry(0,0,this.editor.graph.defaultEdgeLength+20,0),"edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),t.geometry.setTerminalPoint(new mxPoint(0,0),!0),t.geometry.setTerminalPoint(new mxPoint(t.geometry.width,0),!1),t.geometry.points=[],t.geometry.relative=!0,t.edge=!0,n(this.sidebar.createEdgeTemplateFromCells([t],t.geometry.width,t.geometry.height,mxResources.get("line")+" (C)",!0,null,"simple"!=q,!1,null,28,28),mxResources.get("line")+" (C)",null,"C"),t=t.clone(),t.style="edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;",-t.geometry.width=this.editor.graph.defaultEdgeLength+20,t.geometry.setTerminalPoint(new mxPoint(0,20),!0),t.geometry.setTerminalPoint(new mxPoint(t.geometry.width,20),!1),n(J,mxResources.get("freehand")+" (X)",null,"X"),this.sketchPickerMenuElt.appendChild(H));("simple"!=q||320<r)&&this.sketchPickerMenuElt.appendChild(K)}"simple"!=q&&"1"!=urlParams.embedInline&&y.appendChild(A);this.sidebar.graph.cellRenderer.minSvgStrokeWidth=this.sidebar.minThumbStrokeWidth}});mxEvent.addListener(A,"click",mxUtils.bind(this,-function(){G?(y.classList.remove("geCollapsedToolbar"),A.style.backgroundImage="url("+Editor.expandMoreImage+")",G=!1,c()):(y.innerText="",y.appendChild(A),y.classList.add("geCollapsedToolbar"),A.style.backgroundImage="url("+Editor.expandLessImage+")",G=!0)}));var f=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,l=null;mxEvent.addListener(window,"resize",function(){var n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;n!=f&&(f=+t.geometry.width=this.editor.graph.defaultEdgeLength+20,t.geometry.setTerminalPoint(new mxPoint(0,20),!0),t.geometry.setTerminalPoint(new mxPoint(t.geometry.width,20),!1),n(J,mxResources.get("freehand")+" (X)",null,"X"),this.sketchPickerMenuElt.appendChild(F));("simple"!=q||320<r)&&this.sketchPickerMenuElt.appendChild(K)}"simple"!=q&&"1"!=urlParams.embedInline&&y.appendChild(A);this.sidebar.graph.cellRenderer.minSvgStrokeWidth=this.sidebar.minThumbStrokeWidth}});mxEvent.addListener(A,"click",mxUtils.bind(this,+function(){H?(y.classList.remove("geCollapsedToolbar"),A.style.backgroundImage="url("+Editor.expandMoreImage+")",H=!1,c()):(y.innerText="",y.appendChild(A),y.classList.add("geCollapsedToolbar"),A.style.backgroundImage="url("+Editor.expandLessImage+")",H=!0)}));var f=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,l=null;mxEvent.addListener(window,"resize",function(){var n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;n!=f&&(f=n,null!=l&&window.clearTimeout(l),l=window.setTimeout(function(){l=null;c()},200))});this.editor.addListener("fileLoaded",c);this.addListener("sketchModeChanged",c);this.addListener("currentThemeChanged",c);this.addListener("languageChanged",c);this.addListener("lockedChanged",c);c(!0);"simple"==q?(this.sketchPickerMenuElt.style.cssText="position:relative;white-space:nowrap;user-select:none;display:flex;align-items:center;justify-content:flex-end;flex-grow:1;gap:6px;flex-shrink:0;",this.sketchMainMenuElt.appendChild(this.sketchPickerMenuElt)):this.container.appendChild(this.sketchPickerMenuElt);mxClient.IS_POINTER&&(this.sketchPickerMenuElt.style.touchAction="none")}}else m.apply(this,arguments)};var d=EditorUi.prototype.createMenubarForTheme;EditorUi.prototype.createMenubarForTheme=function(q){if("simple"==q||"sketch"==q){if(null==this.sketchMenubarElt){this.sketchMenubarElt=document.createElement("div");this.sketchMenubarElt.className="geToolbarContainer";if("simple"==q){if(this.sketchMenubarElt.style.cssText="position:relative;"+("1"!=urlParams.embed?"flex-grow:0.5;overflow:visible;":"")+"flex-shrink:0;display:flex;white-space:nowrap;user-select:none;justify-content:flex-end;align-items:center;flex-wrap:nowrap;gap:6px;",null==this.commentElt&&(this.commentElt=this.createMenuItem("comments",Editor.thinCommentImage,!0),this.commentElt.style.backgroundSize="24px"),null==this.shareElt&&"1"!=urlParams.embed&&"draw.io"==this.getServiceName())if(this.shareElt=this.createMenu("share",Editor.thinUserAddImage),this.shareElt.style.backgroundSize=diff --git a/src/main/webapp/js/diagramly/ConfigEditor.js b/src/main/webapp/js/diagramly/ConfigEditor.jsindex 136f06f47..195ab47ad 100644--- a/src/main/webapp/js/diagramly/ConfigEditor.js+++ b/src/main/webapp/js/diagramly/ConfigEditor.js@@ -134,7 +134,7 @@ DrawioConfigEditor.install = function(container, options){ key: 'enableNativeClipboard', name: 'Native Clipboard', help: 'Use native system clipboard' },{ key: 'replaceSvgDataUris', name: 'Replace SVG Data URIs', help: 'Replace data URIs with SVG sub-trees in export' },{ key: 'foreignObjectImages', name: 'Foreign Object Images', help: 'Replace foreignObject with images' },- { key: 'embedSvgFonts', name: 'Embed SVG Fonts', help: 'Embed fonts as data URIs in exported and saved SVG files, disable to keep external font references' },+ { key: 'embedSvgFonts', name: 'Embed SVG Fonts', help: 'Default for embedding fonts as data URIs in exported and saved SVG files, can be overridden per file in the file properties' },{ key: 'removeImageMetadata', name: 'Remove Image Metadata', help: 'Strip metadata from images' },{ key: 'expandPatternsForPrint', name: 'Expand Patterns for Print', help: 'Expand patterns to visible graphics during print/PDF export' }],diff --git a/src/main/webapp/js/diagramly/Dialogs.js b/src/main/webapp/js/diagramly/Dialogs.jsindex cf4f276d2..7e72cf2e2 100644--- a/src/main/webapp/js/diagramly/Dialogs.js+++ b/src/main/webapp/js/diagramly/Dialogs.js@@ -18328,40 +18328,11 @@ var FilePropertiesDialog = function(editorUi, publicLink)return row;};- var initialLocked = (file != null) ? file.isLocked() : false;-- // Settings section: editable toggles and inputs+ // Settings section: editable toggles and inputs, file type+ // specific options above the common optionsvar settingsSection = document.createElement('div');settingsSection.className = 'geDialogSection';- var lockedInput = editorUi.addCheckbox(settingsSection, mxResources.get('locked'),- initialLocked, null, null, null, null, null, true);-- this.init = function()- {- lockedInput.focus();- };-- addApply(function(success, error)- {- if (editorUi.fileNode != null && initialLocked != lockedInput.checked)- {- window.setTimeout(function()- {- if (file != null)- {- file.setLocked(lockedInput.checked);- }-- success();- }, 0);- }- else- {- success();- }- });-if (isPng || isSvg){var scale = 1;@@ -18391,6 +18362,14 @@ var FilePropertiesDialog = function(editorUi, publicLink)borderInput.setAttribute('value', border);addFormRow(settingsSection, mxResources.get('borderWidth'), borderInput);+ var embedFontsInput = null;++ if (isSvg)+ {+ embedFontsInput = editorUi.addCheckbox(settingsSection, mxResources.get('embedFonts'),+ editorUi.getSvgFileProperties(node).embedFonts, null, null, null, null, null, true);+ }+this.init = this.init || function(){zoomInput.focus();@@ -18412,6 +18391,12 @@ var FilePropertiesDialog = function(editorUi, publicLink)editorUi.fileNode.setAttribute('scale', Math.max(0, parseInt(zoomInput.value) / 100));editorUi.fileNode.setAttribute('border', Math.max(0, parseInt(borderInput.value)));+ if (embedFontsInput != null)+ {+ editorUi.fileNode.setAttribute('embedFonts',+ (embedFontsInput.checked) ? 'true' : 'false');+ }+if (file != null){file.fileChanged();@@ -18459,6 +18444,36 @@ var FilePropertiesDialog = function(editorUi, publicLink)});}+ var initialLocked = (file != null) ? file.isLocked() : false;++ var lockedInput = editorUi.addCheckbox(settingsSection, mxResources.get('locked'),+ initialLocked, null, null, null, null, null, true);++ this.init = this.init || function()+ {+ lockedInput.focus();+ };++ addApply(function(success, error)+ {+ if (editorUi.fileNode != null && initialLocked != lockedInput.checked)+ {+ window.setTimeout(function()+ {+ if (file != null)+ {+ file.setLocked(lockedInput.checked);+ }++ success();+ }, 0);+ }+ else+ {+ success();+ }+ });+if (file != null && file.isRealtimeOptional()){var collab = editorUi.drive.getCustomProperty(file.desc, 'collaboration');diff --git a/src/main/webapp/js/diagramly/DrawioFile.js b/src/main/webapp/js/diagramly/DrawioFile.jsindex 3407d9ce2..9c7d6011c 100644--- a/src/main/webapp/js/diagramly/DrawioFile.js+++ b/src/main/webapp/js/diagramly/DrawioFile.js@@ -90,6 +90,12 @@ DrawioFile.prototype.maxAutosaveDelay = 30000;*/DrawioFile.prototype.optimisticSyncDelay = 300;+/**+ * Specifies the maximum time to wait for the fonts to be loaded into the+ * local font cache before saving the file with external font references.+ */+DrawioFile.prototype.loadFontsTimeout = 5000;+/*** Contains the thread for the next autosave.*/@@ -1056,6 +1062,54 @@ DrawioFile.prototype.patch = function(patches, resolver, undoable, sendChanges)return patches;};+/**+ * Loads the fonts used in the diagram into the local font cache if this is+ * the current file in the UI and an SVG file that is saved with embedded+ * fonts, so that the following synchronous update of the file data can+ * embed the font data. The callback is invoked when the fonts are+ * available, immediately if there is nothing to load, or after+ * loadFontsTimeout ms if the fonts cannot be loaded in time.+ */+DrawioFile.prototype.loadFonts = function(callback)+{+ if (this.ui.getCurrentFile() == this && /(\.svg)$/i.test(this.getTitle()) &&+ this.ui.getSvgFileProperties(this.ui.fileNode).embedFonts)+ {+ var timeoutThread = null;+ var called = false;++ var done = function()+ {+ if (!called)+ {+ called = true;+ window.clearTimeout(timeoutThread);+ callback();+ }+ };++ // Falls back to external font references in the saved data+ // if the fonts cannot be loaded in time+ timeoutThread = window.setTimeout(done, this.loadFontsTimeout);++ try+ {+ this.ui.editor.loadFonts(mxUtils.bind(this, function()+ {+ this.ui.editor.embedExtFonts(done);+ }));+ }+ catch (e)+ {+ done();+ }+ }+ else+ {+ callback();+ }+};+/*** Adds the listener for automatically saving the diagram for local changes.*/@@ -1092,12 +1146,42 @@ DrawioFile.prototype.save = function(revision, success, error, unloading, overwr}else{- this.updateFileData();this.clearAutosave();-- if (success != null)++ var doSave = mxUtils.bind(this, function()+ {+ try+ {+ this.updateFileData();++ if (success != null)+ {+ success();+ }+ }+ catch (e)+ {+ if (error != null)+ {+ error(e);+ }+ else+ {+ throw e;+ }+ }+ });++ // Waits for the fonts used in the file to be loaded into+ // the local cache for saving SVG files with embedded fonts,+ // keeps the synchronous flow during page unload+ if (unloading)+ {+ doSave();+ }+ else{- success();+ this.loadFonts(doSave);}}}diff --git a/src/main/webapp/js/diagramly/Editor.js b/src/main/webapp/js/diagramly/Editor.jsindex e59c45974..54cec41bb 100644--- a/src/main/webapp/js/diagramly/Editor.js+++ b/src/main/webapp/js/diagramly/Editor.js@@ -5585,10 +5585,14 @@(mxUtils.bind(this, function(url){- if (this.cachedFonts[url] == null)+ var cached = this.cachedFonts[url];++ if (cached == null){- // Mark font as being fetched and fetch it- this.cachedFonts[url] = url;+ // Marks font as being fetched, concurrent calls wait+ // for the result via the callbacks in the waiters list+ var waiters = [];+ this.cachedFonts[url] = waiters;waiting++;var mime = 'application/x-font-ttf';@@ -5619,22 +5623,42 @@mime = 'application/font-sfnt';}+ var fontDone = mxUtils.bind(this, function(uri)+ {+ this.cachedFonts[url] = uri;+ waiting--;+ finish();++ for (var k = 0; k < waiters.length; k++)+ {+ waiters[k]();+ }+ });+this.mapFontUrl(mime, url, mxUtils.bind(this, function(realMime, realUrl){// LATER: Remove cache-control header- this.loadUrl(realUrl, mxUtils.bind(this, function(uri)+ this.loadUrl(realUrl, function(uri){- this.cachedFonts[url] = uri;- waiting--;- finish();- }), mxUtils.bind(this, function(err)+ fontDone(uri);+ }, function(err){- // LATER: handle error- waiting--;- finish();- }), true, null, 'data:' + realMime + ';charset=utf-8;base64,');+ // LATER: handle error, keeps external font URL+ fontDone(url);+ }, true, null, 'data:' + realMime + ';charset=utf-8;base64,');}));}+ else if (typeof cached != 'string')+ {+ // Waits for the font that is being fetched in another call+ waiting++;++ cached.push(function()+ {+ waiting--;+ finish();+ });+ }}))(Editor.trimCssUrl(parts[i].substring(0, idx)), format);}diff --git a/src/main/webapp/js/diagramly/EditorUi.js b/src/main/webapp/js/diagramly/EditorUi.jsindex 6eaed9822..c1c112aa1 100644--- a/src/main/webapp/js/diagramly/EditorUi.js+++ b/src/main/webapp/js/diagramly/EditorUi.js@@ -1947,7 +1947,8 @@var props = this.getSvgFileProperties(fileNode);xml = this.getEmbeddedSvg(xml, graph, url, null, embeddedCallback, ignoreSelection,- redirect, null, null, props.scale, props.border, null, Editor.svgFileTheme);+ redirect, null, null, props.scale, props.border, null, Editor.svgFileTheme,+ null, props.embedFonts);}return xml;@@ -4038,7 +4039,8 @@// Loads fonts into the local cache for saving// SVG files with embedded fonts- if (Editor.embedSvgFonts && /(\.svg)$/i.test(file.getTitle()))+ if (/(\.svg)$/i.test(file.getTitle()) &&+ this.getSvgFileProperties(this.fileNode).embedFonts){try{@@ -10216,7 +10218,12 @@*/EditorUi.prototype.getSvgFileProperties = function(node){- return this.getPngFileProperties(node);+ var props = this.getPngFileProperties(node);++ props.embedFonts = (node != null && node.hasAttribute('embedFonts')) ?+ node.getAttribute('embedFonts') != 'false' : Editor.embedSvgFonts;++ return props;};/**diff --git a/src/main/webapp/js/diagramly/ElectronApp.js b/src/main/webapp/js/diagramly/ElectronApp.jsindex 87848f73d..4376dc947 100644--- a/src/main/webapp/js/diagramly/ElectronApp.js+++ b/src/main/webapp/js/diagramly/ElectronApp.js@@ -480,6 +480,33 @@ mxStencilRegistry.allowEval = false;electron.sendMessage('draftRemoved', {});});+ electron.registerMsgListener('saveAndClose', (uniqueId) =>+ {+ const currentFile = editorUi.getCurrentFile();+ let resultSent = false;++ // Ensures a single result is sent even if the save flow calls+ // more than one callback+ let sendResult = (success) =>+ {+ if (!resultSent)+ {+ resultSent = true;+ electron.sendMessage('saveAndClose-result', {uniqueId: uniqueId, success: success});+ }+ };++ if (currentFile == null || !currentFile.isModified())+ {+ sendResult(true);+ }+ else+ {+ editorUi.saveFile(null, () => sendResult(true),+ () => sendResult(false), () => sendResult(false));+ }+ });+// Adds support for librariesthis.actions.addAction('newLibrary...', mxUtils.bind(this, function(){@@ -1193,6 +1220,11 @@ mxStencilRegistry.allowEval = false;}else{+ // Adopts the new stat for timestamp-only changes (eg. FUSE+ // mounts finalize mtime after write) so the next save+ // doesn't misdetect a conflict+ file.stat = latestFile.stat;+EditorUi.debug('EditorUi.handleFileChange', [this],'No changes detected in file', [file]);}@@ -1664,19 +1696,19 @@ mxStencilRegistry.allowEval = false;var autoSaveEnabled = false;- LocalFile.prototype.save = function(revision, success, error, unloading, overwrite)+ LocalFile.prototype.save = function(revision, success, error, unloading, overwrite, cancel){if (!this.isEditable()){- this.saveAs(this.title, success, error);+ this.saveAs(this.title, success, error, cancel);return;}DrawioFile.prototype.save.apply(this, [revision, mxUtils.bind(this, function(){- this.saveFile(revision, mxUtils.bind(this, function()+ this.saveFile(revision, mxUtils.bind(this, function(){- //Only for first save after auto save is enabled (excluding the save as [overwrite])+ //Only for first save after auto save is enabled (excluding the save as [overwrite])if (autoSaveEnabled && !overwrite && EditorUi.enableDrafts){this.removeDraft();@@ -1684,7 +1716,7 @@ mxStencilRegistry.allowEval = false;autoSaveEnabled = false;success.apply(this, arguments);- }), error, unloading, overwrite);+ }), error, unloading, overwrite, cancel);}), error, unloading, overwrite]);};@@ -1693,7 +1725,7 @@ mxStencilRegistry.allowEval = false;return stat != null && this.stat != null && stat.mtimeMs != this.stat.mtimeMs;};- LocalFile.prototype.saveFile = async function(revision, success, error, unloading, overwrite)+ LocalFile.prototype.saveFile = async function(revision, success, error, unloading, overwrite, cancel){//Safeguard in case saveFile is called from online code in the futureif (typeof success !== 'function')@@ -1844,6 +1876,11 @@ mxStencilRegistry.allowEval = false;else{this.ui.spinner.stop();++ if (cancel != null)+ {+ cancel();+ }}}else@@ -1856,6 +1893,11 @@ mxStencilRegistry.allowEval = false;error(e);}}+ else if (cancel != null)+ {+ //Another save is already in progress (eg. autosave), this save request is dropped+ cancel();+ }};@@ -1887,7 +1929,7 @@ mxStencilRegistry.allowEval = false;this.ui.addRecent({id: this.fileObject.path, title: title});};- LocalFile.prototype.saveAs = async function(title, success, error)+ LocalFile.prototype.saveAs = async function(title, success, error, cancel){try{@@ -1930,6 +1972,10 @@ mxStencilRegistry.allowEval = false;success();}), error, null, true);}+ else if (cancel != null)+ {+ cancel();+ }}catch (e){@@ -2023,10 +2069,10 @@ mxStencilRegistry.allowEval = false;/*** Loads the given file handle as a local file.*/- App.prototype.saveFile = function(forceDialog)+ App.prototype.saveFile = function(forceDialog, success, error, cancel){var file = this.getCurrentFile();-+if (file != null){if (!forceDialog && file.getTitle() != null)@@ -2037,12 +2083,22 @@ mxStencilRegistry.allowEval = false;{file.removeDraft();}-+file.handleFileSuccess(true);++ if (success != null)+ {+ success();+ }}), mxUtils.bind(this, function(err){file.handleFileError(err, true);- }));++ if (error != null)+ {+ error(err);+ }+ }), null, null, cancel);}else{@@ -2058,12 +2114,22 @@ mxStencilRegistry.allowEval = false;file.removeDraft();file.fileObject = curFileObject;}-+file.handleFileSuccess(true);++ if (success != null)+ {+ success();+ }}), mxUtils.bind(this, function(err){file.handleFileError(err, true);- }));++ if (error != null)+ {+ error(err);+ }+ }), cancel);}}};@@ -2490,4 +2556,76 @@ mxStencilRegistry.allowEval = false;success(library);}), error, libPath);};++ // Returns the filesystem path for URLs that point to local files+ // (file:// URLs, drive, UNC and absolute paths), null otherwise+ Editor.getLocalFilePath = function(url)+ {+ if (url != null && url.substring(0, 7) == 'file://')+ {+ var path = decodeURIComponent(url.substring(7).split(/[?#]/)[0]);++ // Removes leading slash before Windows drive letters (file:///C:/...)+ return (/^\/[a-zA-Z]:/.test(path)) ? path.substring(1) : path;+ }+ else if (url != null && /^([a-zA-Z]:[\\\/]|[\\\/])/.test(url))+ {+ return url;+ }++ return null;+ };++ // Reads URLs that point to local files via the main process so libraries+ // and templates configured with local paths or file:// URLs work in the+ // desktop app [jgraph/drawio-desktop#1278]+ var editorLoadUrl = Editor.prototype.loadUrl;++ Editor.prototype.loadUrl = function(url, success, error, forceBinary, retry, dataUriPrefix, noBinary, headers)+ {+ try+ {+ var filename = Editor.getLocalFilePath(url);++ if (filename == null)+ {+ editorLoadUrl.apply(this, arguments);+ }+ else+ {+ var binary = !noBinary && (forceBinary || /(\.png)($|\?)/i.test(url) ||+ /(\.jpe?g)($|\?)/i.test(url) || /(\.gif)($|\?)/i.test(url) ||+ /(\.pdf)($|\?)/i.test(url));++ electron.request({action: 'readFile', filename: filename,+ encoding: (binary) ? 'base64' : 'utf-8'}, function(data)+ {+ if (success != null)+ {+ if (binary)+ {+ data = ((dataUriPrefix != null) ? dataUriPrefix :+ 'data:image/png;base64,') + data;+ }++ success(data);+ }+ }, function(msg)+ {+ if (error != null)+ {+ error({message: (msg != null) ? msg :+ mxResources.get('fileNotFound')});+ }+ });+ }+ }+ catch (e)+ {+ if (error != null)+ {+ error(e);+ }+ }+ };})();diff --git a/src/main/webapp/js/diagramly/LocalFile.js b/src/main/webapp/js/diagramly/LocalFile.jsindex 92377baa5..f45d19094 100644--- a/src/main/webapp/js/diagramly/LocalFile.js+++ b/src/main/webapp/js/diagramly/LocalFile.js@@ -175,12 +175,25 @@ LocalFile.prototype.saveFile = function(title, revision, success, error, useCurrthis.title = title;- // Updates data after changing file name- if (!useCurrentData)+ // Updates data after changing file name, waits for the fonts to be+ // loaded into the local cache for saving SVG files with embedded+ // fonts, keeps the synchronous flow during page unload+ if (!useCurrentData && !unloading)+ {+ this.loadFonts(mxUtils.bind(this, function()+ {+ this.updateFileData();+ this.saveFile(title, revision, success, error,+ true, unloading, overwrite);+ }));++ return;+ }+ else if (!useCurrentData){this.updateFileData();}-+var binary = Editor.useCanvasForExport && /(\.png)$/i.test(this.getTitle());this.setShadowModified(false);var savedData = this.getData();diff --git a/src/main/webapp/js/diagramly/sidebar/Sidebar-Electrical.js b/src/main/webapp/js/diagramly/sidebar/Sidebar-Electrical.jsindex 42730f8ca..52ff0a4c2 100644--- a/src/main/webapp/js/diagramly/sidebar/Sidebar-Electrical.js+++ b/src/main/webapp/js/diagramly/sidebar/Sidebar-Electrical.js@@ -556,6 +556,10 @@95, 100, '', 'NMOS', null, null, this.getTagsForStencil(gnmet, 'mosfet_ic_n', dtmet).join(' ')),this.createVertexTemplateEntry(mef1 + 'mosfet_ic_p;',95, 100, '', 'PMOS', null, null, this.getTagsForStencil(gnmet, 'mosfet_ic_p', dtmet).join(' ')),+ this.createVertexTemplateEntry(mef1 + 'mosfet_ic_n_body_diode;',+ 95, 100, '', 'NMOS with Body Diode', null, null, this.getTagsForStencil(gnmet, 'mosfet_ic_n_body_diode', dtmet).join(' ')),+ this.createVertexTemplateEntry(mef1 + 'mosfet_ic_p_body_diode;',+ 95, 100, '', 'PMOS with Body Diode', null, null, this.getTagsForStencil(gnmet, 'mosfet_ic_p_body_diode', dtmet).join(' ')),this.createVertexTemplateEntry(mef1 + 'mosfet_n_no_bulk;',95, 100, '', 'MOSFET No Bulk (N)', null, null, this.getTagsForStencil(gnmet, 'mosfet_n_no_bulk', dtmet).join(' ')),this.createVertexTemplateEntry(mef1 + 'mosfet_p_no_bulk;',diff --git a/src/main/webapp/js/grapheditor/Graph.js b/src/main/webapp/js/grapheditor/Graph.jsindex fa1e657ee..9cebcde59 100644--- a/src/main/webapp/js/grapheditor/Graph.js+++ b/src/main/webapp/js/grapheditor/Graph.js@@ -21541,6 +21541,9 @@ if (typeof mxVertexHandler !== 'undefined')};/**+ * Makes edges transparent for fixed points, using the topmost vertex+ * beneath the event instead (or none), so that a connection point+ * occupied by an edge endpoint stays reachable for more connections.* Shows the connection points of a container instead of an overlapping* child if the event is on the container's border band. A cell that* already has the focus keeps it, so that its own connection points@@ -21550,13 +21553,36 @@ if (typeof mxVertexHandler !== 'undefined')mxConstraintHandler.prototype.getCellForEvent = function(me, point){var cell = mxConstraintHandlerGetCellForEvent.apply(this, arguments);+ var x = (point != null) ? point.x : me.getGraphX();+ var y = (point != null) ? point.y : me.getGraphY();++ if (cell != null && this.graph.model.isEdge(cell))+ {+ var model = this.graph.model;+ var temp = this.graph.getCellAt(x, y, null, true, false, function(state)+ {+ // Ignores labels of edges+ return model.isEdge(model.getParent(state.cell));+ });++ // Applies the connectable parent rule of the base function+ if (temp != null && !this.graph.isCellConnectable(temp))+ {+ var parent = model.getParent(temp);++ if (model.isVertex(parent) && this.graph.isCellConnectable(parent))+ {+ temp = parent;+ }+ }++ cell = (this.graph.isCellLocked(temp)) ? null : temp;+ }if (cell != null && (this.currentFocus == null ||this.currentFocus.cell != cell)){- var container = this.graph.getBorderContainer(cell,- (point != null) ? point.x : me.getGraphX(),- (point != null) ? point.y : me.getGraphY());+ var container = this.graph.getBorderContainer(cell, x, y);if (container != null){diff --git a/src/main/webapp/js/integrate.min.js b/src/main/webapp/js/integrate.min.jsindex ef394b2f1..b0b7cb240 100644--- a/src/main/webapp/js/integrate.min.js+++ b/src/main/webapp/js/integrate.min.js@@ -65,7 +65,7 @@ b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io")))})();"1"==urlPa"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ADD_ATTR:["target","content","pointer-events","requiredFeatures"]};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";-window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"30.3.13",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"30.3.14",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&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."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),IS_MT:0<=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."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!==document.createElementNS("http://www.w3.org/2000/svg","foreignObject").toString()||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),@@ -409,9 +409,9 @@ mxSvgCanvas2D.prototype.getAlternateTextLines=function(a,b,c,d,e,f){var g=this.sa[m].split(/\s+/),p="",q=0;q<n.length;q++)if(0<n[q].length){var r=0<p.length?p+" "+n[q]:n[q];for(0<p.length&&l.measureText(r).width>k?(b.push(p),p=n[q]):p=r;1<p.length&&l.measureText(p).width>k&&/[\u2E80-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF]/.test(p);){for(r=p.length-1;1<r&&l.measureText(p.substring(0,r)).width>k;)r--;b.push(p.substring(0,r));p=p.substring(r)}}b.push(p)}a=b}(f||"fill"==e)&&0<c&&(c=Math.max(1,Math.floor(c/Math.round(mxConstants.LINE_HEIGHT*g.fontSize))),a.length>c&&(a=a.slice(0,c),a[a.length-1]+="..."));if(f&&!d&&null!=l)for(m=0;m<a.length;m++)if(l.measureText(a[m]).width>k){for(r=a[m].length-1;1<r&&l.measureText(a[m].substring(0,r)+"...").width>k;)r--;a[m]=mxUtils.trim(a[m].substring(0,r))+"..."}return a};mxSvgCanvas2D.prototype.createAlternateContent=function(a,b,c,d,e,f,g,k,l,m,n,p,q){m=this.getAlternateText(a,b,c,d,e,f,g,k,l,m,n,p,q);a=this.state;if(null!=m&&0<a.fontSize){f=k==mxConstants.ALIGN_TOP?1:k==mxConstants.ALIGN_BOTTOM?0:.3;g=g==mxConstants.ALIGN_RIGHT?"end":g==mxConstants.ALIGN_LEFT?"start":"middle";d=this.getAlternateTextLines(m,d,e,l,n,p);e=Math.round(mxConstants.LINE_HEIGHT*a.fontSize);b=Math.round(b+a.dx);c=c+a.dy+f*a.fontSize-(k==mxConstants.ALIGN_TOP?0:k==mxConstants.ALIGN_BOTTOM?-(d.length-1)*e:(d.length-1)*e/2);k=this.createElement("text");k.setAttribute("x",b);k.setAttribute("y",Math.round(c));k.setAttribute("fill",a.fontColor||"black");k.setAttribute("font-family",mxUtils.parseCssFontFamily(a.fontFamily));k.setAttribute("font-size",Math.round(a.fontSize)+"px");"start"!=g&&k.setAttribute("text-anchor",g);(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&k.setAttribute("font-weight","bold");(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&k.setAttribute("font-style",-"italic");l=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&l.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&l.push("line-through");0<l.length&&(k.setAttribute("text-decoration",l.join(" ")),(a.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(k.style.textDecorationStyle="dotted"));if(1<d.length)for(a=0;a<d.length;a++)l=this.createElement("tspan"),l.setAttribute("x",b),l.setAttribute("y",Math.round(c+-a*e)),mxUtils.write(l,d[a]),k.appendChild(l);else mxUtils.write(k,d[0]);return k}return null};+(d.length-1)*e:(d.length-1)*e/2);l=this.getLightDarkColor(a.fontColor||"black");k=this.createElement("text");k.setAttribute("x",b);k.setAttribute("y",Math.round(c));"transparent"==l.light?k.setAttribute("fill","none"):(k.setAttribute("fill",l.light),k.style.fill=l.cssText);k.setAttribute("font-family",mxUtils.parseCssFontFamily(a.fontFamily));k.setAttribute("font-size",Math.round(a.fontSize)+"px");"start"!=g&&k.setAttribute("text-anchor",g);(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&+k.setAttribute("font-weight","bold");(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&k.setAttribute("font-style","italic");g=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&g.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&g.push("line-through");0<g.length&&(k.setAttribute("text-decoration",g.join(" ")),(a.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(k.style.textDecorationStyle=+"dotted"));if(1<d.length)for(a=0;a<d.length;a++)g=this.createElement("tspan"),g.setAttribute("x",b),g.setAttribute("y",Math.round(c+a*e)),mxUtils.write(g,d[a]),k.appendChild(g);else mxUtils.write(k,d[0]);return k}return null};mxSvgCanvas2D.prototype.createGradientId=function(a,b,c,d,e){a=a.toLowerCase()+"-"+c;b=b.toLowerCase()+"-"+d;c=null;null==e||e==mxConstants.DIRECTION_SOUTH?c="s":e==mxConstants.DIRECTION_EAST?c="e":e==mxConstants.DIRECTION_RADIAL?c="r":(d=a,a=b,b=d,e==mxConstants.DIRECTION_NORTH?c="s":e==mxConstants.DIRECTION_WEST&&(c="e"));return((""!=this.idPrefix?this.idPrefix:"mx")+"-gradient-"+a+"-"+b+"-"+c).replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};mxSvgCanvas2D.prototype.getSvgGradient=function(a,b,c,d,e){a=this.getLightDarkColor(a);b=this.getLightDarkColor(b);var f=this.createGradientId(a.cssText,b.cssText,c,d,e),g=this.gradients[f];if(null==g){var k=this.root.ownerSVGElement,l=0,m=f+"-"+l;if(null!=k)for(g=k.ownerDocument.getElementById(m);null!=g&&g.ownerSVGElement!=k;)m=f+"-"+l++,g=k.ownerDocument.getElementById(m);else m="id"+ ++this.refCount;null==g&&(g=this.createSvgGradient(a,b,c,d,e),g.setAttribute("id",m),null!=this.defs?this.defs.appendChild(g):k.appendChild(g));this.gradients[f]=g}return g.getAttribute("id")};@@ -434,8 +434,8 @@ mxSvgCanvas2D.prototype.addNode=function(a,b){var c=this.addTitle(this.node),d=tc.setAttribute("transform",d.transform);this.pointerEvents?c.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none");0<this.strokeTolerance&&(!a||null==d.fillColor||!mxShape.forceFilledPointerEvents&&!this.pointerEvents&&null==this.originalRoot)&&this.addTolerance(c);("rect"!=c.nodeName&&"path"!=c.nodeName&&"ellipse"!=c.nodeName||"none"!=c.getAttribute("fill")&&"transparent"!=c.getAttribute("fill")||"none"!=c.getAttribute("stroke")||"none"!=c.getAttribute("pointer-events"))&&this.root.appendChild(c);this.node=null}};mxSvgCanvas2D.prototype.getShadowFilter=function(){var a=this.state,b=a.shadowStyle;if(1!=a.scale){var c=b.split("(");if(0<c.length){var d=c[1].split(" ");3<d.length&&(b=function(e){return Math.round(parseFloat(d[e])*a.scale*100)/100+"px"},b=c[0]+"("+b(0)+" "+b(1)+" "+b(2)+" "+d.slice(3).join(" ")+(2<c.length?"("+c.slice(2).join("("):""))}}return b};mxSvgCanvas2D.prototype.addTolerance=function(a){this.root.appendChild(this.createTolerance(a))};mxSvgCanvas2D.prototype.updateFill=function(){var a=this.state;(1>a.alpha||1>a.fillAlpha)&&this.node.setAttribute("fill-opacity",a.alpha*a.fillAlpha);var b=!1;if(null!=a.fillColor)if(null!=a.gradientColor&&a.gradientColor!=mxConstants.NONE){b=!0;var c=this.getSvgGradient(String(a.fillColor),String(a.gradientColor),a.gradientFillAlpha,a.gradientAlpha,a.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c="url("+d+"#"+c+-")"}else c="url(#"+c+")";d=c}else c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText;var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill",-"url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};+")"}else c="url(#"+c+")";d=c}else String(a.fillColor).toLowerCase()==mxConstants.NONE?c=d="none":(c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText);var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,+"\\$1"),this.node.setAttribute("fill","url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};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 a=this.state,b=this.getLightDarkColor(String(a.strokeColor).toLowerCase());this.node.setAttribute("stroke",b.light);this.node.style.stroke=b.cssText;(1>a.alpha||1>a.strokeAlpha)&&this.node.setAttribute("stroke-opacity",a.alpha*a.strokeAlpha);b=this.getCurrentStrokeWidth();1!=b&&this.node.setAttribute("stroke-width",b);"path"==this.node.nodeName&&this.updateStrokeAttributes();a.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((a.fixDash?1:a.strokeWidth)*a.scale))};mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var a=this.state;null!=a.lineJoin&&"miter"!=a.lineJoin&&this.node.setAttribute("stroke-linejoin",a.lineJoin);if(null!=a.lineCap){var b=a.lineCap;"flat"==b&&(b="butt");"butt"!=b&&this.node.setAttribute("stroke-linecap",b)}null==a.miterLimit||this.styleEnabled&&10==a.miterLimit||this.node.setAttribute("stroke-miterlimit",a.miterLimit)};mxSvgCanvas2D.prototype.createDashPattern=function(a){var b=[];if("string"===typeof this.state.dashPattern){var c=this.state.dashPattern.split(" ");if(0<c.length)for(var d=0;d<c.length;d++)b[d]=Math.round(Number(c[d])*a*100)/100}return b.join(" ")};@@ -3099,60 +3099,60 @@ A=t.getCell;t.getCell=mxUtils.bind(this,function(B){var F=A.apply(this,argumentsB=0;B<A.length;B++)null!=this.currentEdgeStyle[A[B]]&&(t+=A[B]+"="+this.currentEdgeStyle[A[B]]+";");null!=this.currentEdgeStyle.orthogonalLoop?t+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(t+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?t+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(t+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(t+="elbow="+this.currentEdgeStyle.elbow+";");return t=null!=this.currentEdgeStyle.html?t+("html="+this.currentEdgeStyle.html+";"):t+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var t=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=t&&(new mxCodec(t.ownerDocument)).decode(t,this.getStylesheet())};Graph.prototype.createCellLookup=function(t,A){A=null!=A?A:{};for(var B=0;B<t.length;B++){var F=t[B];A[mxObjectIdentity.get(F)]=F.getId();for(var I=this.model.getChildCount(F),O=0;O<I;O++)this.createCellLookup([this.model.getChildAt(F,O)],A)}return A};Graph.prototype.createCellMapping=function(t,A,B){B=null!=B?B:{};for(var F in t){var I=A[F];null==B[I]&&(B[I]=t[F].getId()||"")}return B};Graph.prototype.importGraphModel=function(t,A,-B,F){A=null!=A?A:0;B=null!=B?B:0;var I=new mxCodec(t.ownerDocument),O=new mxGraphModel;I.decode(t,O);t=[];I={};var R={},ea=O.getChildren(this.cloneCell(O.root,this.isCloneInvalidEdges(),I));if(null!=ea){var ia=this.createCellLookup([O.root]);ea=ea.slice();this.model.beginUpdate();try{if(1!=ea.length||this.isCellLocked(this.getDefaultParent()))for(O=0;O<ea.length;O++)da=this.model.getChildren(this.moveCells([ea[O]],A,B,!1,this.model.getRoot())[0]),null!=da&&(t=t.concat(da));else{var da=O.getChildren(ea[0]);-null!=da&&(t=this.moveCells(da,A,B,!1,this.getDefaultParent()),R[O.getChildAt(O.root,0).getId()]=this.getDefaultParent().getId())}if(null!=t&&(this.createCellMapping(I,ia,R),this.updateCustomLinks(R,t),F)){this.isGridEnabled()&&(A=this.snap(A),B=this.snap(B));var za=this.getBoundingBoxFromGeometry(t,!0);null!=za&&this.moveCells(t,A-za.x,B-za.y)}}finally{this.model.endUpdate()}}return t};Graph.prototype.encodeCells=function(t){for(var A={},B=this.cloneCells(t,null,A),F=new mxDictionary,I=0;I<t.length;I++)F.put(t[I],-!0);var O=new mxCodec,R=new mxGraphModel,ea=R.getChildAt(R.getRoot(),0);for(I=0;I<B.length;I++){R.add(ea,B[I]);var ia=this.view.getState(t[I]);if(null!=ia){var da=this.getCellGeometry(B[I]);null!=da&&da.relative&&!this.model.isEdge(t[I])&&null==F.get(this.model.getParent(t[I]))&&(da.offset=null,da.relative=!1,da.x=ia.x/ia.view.scale-ia.view.translate.x,da.y=ia.y/ia.view.scale-ia.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(A,this.createCellLookup(t)),B);return O.encode(R)};Graph.prototype.isSwimlane=+B,F){A=null!=A?A:0;B=null!=B?B:0;var I=new mxCodec(t.ownerDocument),O=new mxGraphModel;I.decode(t,O);t=[];I={};var R={},da=O.getChildren(this.cloneCell(O.root,this.isCloneInvalidEdges(),I));if(null!=da){var ia=this.createCellLookup([O.root]);da=da.slice();this.model.beginUpdate();try{if(1!=da.length||this.isCellLocked(this.getDefaultParent()))for(O=0;O<da.length;O++)ea=this.model.getChildren(this.moveCells([da[O]],A,B,!1,this.model.getRoot())[0]),null!=ea&&(t=t.concat(ea));else{var ea=O.getChildren(da[0]);+null!=ea&&(t=this.moveCells(ea,A,B,!1,this.getDefaultParent()),R[O.getChildAt(O.root,0).getId()]=this.getDefaultParent().getId())}if(null!=t&&(this.createCellMapping(I,ia,R),this.updateCustomLinks(R,t),F)){this.isGridEnabled()&&(A=this.snap(A),B=this.snap(B));var za=this.getBoundingBoxFromGeometry(t,!0);null!=za&&this.moveCells(t,A-za.x,B-za.y)}}finally{this.model.endUpdate()}}return t};Graph.prototype.encodeCells=function(t){for(var A={},B=this.cloneCells(t,null,A),F=new mxDictionary,I=0;I<t.length;I++)F.put(t[I],+!0);var O=new mxCodec,R=new mxGraphModel,da=R.getChildAt(R.getRoot(),0);for(I=0;I<B.length;I++){R.add(da,B[I]);var ia=this.view.getState(t[I]);if(null!=ia){var ea=this.getCellGeometry(B[I]);null!=ea&&ea.relative&&!this.model.isEdge(t[I])&&null==F.get(this.model.getParent(t[I]))&&(ea.offset=null,ea.relative=!1,ea.x=ia.x/ia.view.scale-ia.view.translate.x,ea.y=ia.y/ia.view.scale-ia.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(A,this.createCellLookup(t)),B);return O.encode(R)};Graph.prototype.isSwimlane=function(t,A){var B=null;null==t||this.model.isEdge(t)||this.model.getParent(t)==this.model.getRoot()||(B=this.getCurrentCellStyle(t,A)[mxConstants.STYLE_SHAPE]);return B==mxConstants.SHAPE_SWIMLANE||"table"==B||"tableRow"==B};var k=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(t){return null!=t&&k.apply(this,arguments)?this.isTableCell(t)||this.isTableRow(t)?this.isCellEditable(this.model.getParent(t)):!0:!1};var p=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=function(t){return null!=t&&p.apply(this,arguments)?this.isTableCell(t)||this.isTableRow(t)?this.isCellMovable(this.model.getParent(t)):!0:!1};var l=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(t){var A=this.model.getParent(t);if(null!=A){var B=this.getCurrentCellStyle(A);if(null!=B.expand)return"0"!=B.expand}return l.apply(this,arguments)&&(null==A||!this.isTable(A))};var u=Graph.prototype.isContractParent;Graph.prototype.isContractParent=function(t){var A=this.model.getParent(t);-if(null!=A){var B=this.getCurrentCellStyle(A);if(null!=B.contract)return"0"!=B.contract}return u.apply(this,arguments)&&(null==A||!this.isTable(A))};var x=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(t,A,B,F,I,O,R,ea){null==ea&&(ea=this.model.getParent(t),this.isTable(ea)||this.isTableRow(ea))&&(ea=this.getCellAt(O,R,null,!0,!1));B=null;this.model.beginUpdate();try{var ia=this.getCellGeometry(t);if(null!=ia&&null!=ia.points&&0<ia.points.length&&1==A.length&&this.model.isVertex(A[0])){var da=-this.getCellGeometry(A[0]);if(null!=da&&!da.relative){var za=new mxRectangle(da.x+F,da.y+I,da.width,da.height),Fa=ia.points;da=[];for(var Ga=0;Ga<Fa.length;Ga++)za.intersectsPoint(Fa[Ga].x,Fa[Ga].y)||da.push(Fa[Ga]);da.length<Fa.length&&(ia=ia.clone(),ia.points=da,this.model.setGeometry(t,ia))}}B=x.apply(this,[t,A,B,F,I,O,R,ea]);this.model.setValue(B,"");var ca=this.getChildCells(B,!0);for(Ga=0;Ga<ca.length;Ga++)ia=this.getCellGeometry(ca[Ga]),null!=ia&&ia.relative&&0<ia.x&&this.model.remove(ca[Ga]);+if(null!=A){var B=this.getCurrentCellStyle(A);if(null!=B.contract)return"0"!=B.contract}return u.apply(this,arguments)&&(null==A||!this.isTable(A))};var x=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(t,A,B,F,I,O,R,da){null==da&&(da=this.model.getParent(t),this.isTable(da)||this.isTableRow(da))&&(da=this.getCellAt(O,R,null,!0,!1));B=null;this.model.beginUpdate();try{var ia=this.getCellGeometry(t);if(null!=ia&&null!=ia.points&&0<ia.points.length&&1==A.length&&this.model.isVertex(A[0])){var ea=+this.getCellGeometry(A[0]);if(null!=ea&&!ea.relative){var za=new mxRectangle(ea.x+F,ea.y+I,ea.width,ea.height),Fa=ia.points;ea=[];for(var Ga=0;Ga<Fa.length;Ga++)za.intersectsPoint(Fa[Ga].x,Fa[Ga].y)||ea.push(Fa[Ga]);ea.length<Fa.length&&(ia=ia.clone(),ia.points=ea,this.model.setGeometry(t,ia))}}B=x.apply(this,[t,A,B,F,I,O,R,da]);this.model.setValue(B,"");var ca=this.getChildCells(B,!0);for(Ga=0;Ga<ca.length;Ga++)ia=this.getCellGeometry(ca[Ga]),null!=ia&&ia.relative&&0<ia.x&&this.model.remove(ca[Ga]);var wa=this.getChildCells(t,!0);for(Ga=0;Ga<wa.length;Ga++)ia=this.getCellGeometry(wa[Ga]),null!=ia&&ia.relative&&0>=ia.x&&this.model.remove(wa[Ga]);var ya=this.model.getTerminal(B,!1);if(null!=ya){var Ia=this.getCurrentCellStyle(ya);null!=Ia&&"1"==Ia.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[t]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[t]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[B]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[B]))}}finally{this.model.endUpdate()}return B};-var w=Graph.prototype.selectCell;Graph.prototype.selectCell=function(t,A,B){if(A||B)w.apply(this,arguments);else{var F=this.getSelectionCell(),I=null,O=[],R=mxUtils.bind(this,function(ea){if(null!=this.view.getState(ea)&&(this.model.isVertex(ea)||this.model.isEdge(ea)))if(O.push(ea),ea==F)I=O.length-1;else if(t&&null==F&&0<O.length||null!=I&&t&&O.length>I||!t&&0<I)return;for(var ia=0;ia<this.model.getChildCount(ea);ia++)R(this.model.getChildAt(ea,ia))});R(this.model.root);0<O.length&&(I=null!=I?mxUtils.mod(I++var w=Graph.prototype.selectCell;Graph.prototype.selectCell=function(t,A,B){if(A||B)w.apply(this,arguments);else{var F=this.getSelectionCell(),I=null,O=[],R=mxUtils.bind(this,function(da){if(null!=this.view.getState(da)&&(this.model.isVertex(da)||this.model.isEdge(da)))if(O.push(da),da==F)I=O.length-1;else if(t&&null==F&&0<O.length||null!=I&&t&&O.length>I||!t&&0<I)return;for(var ia=0;ia<this.model.getChildCount(da);ia++)R(this.model.getChildAt(da,ia))});R(this.model.root);0<O.length&&(I=null!=I?mxUtils.mod(I+(t?1:-1),O.length):0,this.setSelectionCell(O[I]))}};Graph.prototype.swapShapes=function(t,A){if(this.model.isVertex(t)&&this.model.isVertex(A)&&2==this.getMovableCells([t,A]).length){var B=this.getCellGeometry(t),F=this.getCellGeometry(A);if(null!=B&&null!=F){var I=B.clone(),O=F.clone();this.model.beginUpdate();try{I.x=F.getCenterX()-B.width/2,I.y=F.getCenterY()-B.height/2,O.x=B.getCenterX()-F.width/2,O.y=B.getCenterY()-F.height/2,this.model.setGeometry(t,I),this.model.setGeometry(A,O)}finally{this.model.endUpdate()}}}};-var z=Graph.prototype.moveCells;Graph.prototype.moveCells=function(t,A,B,F,I,O,R){R=null!=R?R:{};if(this.isTable(I)){for(var ea=[],ia=0;ia<t.length;ia++)this.isTable(t[ia])?ea=ea.concat(this.model.getChildCells(t[ia],!0).reverse()):ea.push(t[ia]);t=ea}this.model.beginUpdate();try{ea=[];for(ia=0;ia<t.length;ia++)if(null!=I&&this.isTableRow(t[ia])){var da=this.model.getParent(t[ia]),za=this.getCellGeometry(t[ia]);this.isTable(da)&&ea.push(da);if(null!=da&&null!=za&&this.isTable(da)&&this.isTable(I)&&-(F||da!=I)){if(!F){var Fa=this.getCellGeometry(da);null!=Fa&&(Fa=Fa.clone(),Fa.height-=za.height,this.model.setGeometry(da,Fa))}Fa=this.getCellGeometry(I);null!=Fa&&(Fa=Fa.clone(),Fa.height+=za.height,this.model.setGeometry(I,Fa));var Ga=this.model.getChildCells(I,!0);if(0<Ga.length){t[ia]=F?this.cloneCell(t[ia]):t[ia];var ca=this.model.getChildCells(t[ia],!0),wa=this.model.getChildCells(Ga[0],!0),ya=wa.length-ca.length;if(0<ya)for(var Ia=0;Ia<ya;Ia++){var Ca=this.cloneCell(ca[ca.length-1]);null!=-Ca&&(Ca.value="",this.model.add(t[ia],Ca))}else if(0>ya)for(Ia=0;Ia>ya;Ia--)this.model.remove(ca[ca.length+Ia-1]);ca=this.model.getChildCells(t[ia],!0);for(Ia=0;Ia<wa.length;Ia++){var Ka=this.getCellGeometry(wa[Ia]),Da=this.getCellGeometry(ca[Ia]);null!=Ka&&null!=Da&&(Da=Da.clone(),Da.width=Ka.width,this.model.setGeometry(ca[Ia],Da))}}}}var Ya=z.apply(this,arguments);for(ia=0;ia<ea.length;ia++)!F&&this.model.contains(ea[ia])&&0==this.model.getChildCount(ea[ia])&&this.model.remove(ea[ia]);F&&this.updateCustomLinks(this.createCellMapping(R,+var z=Graph.prototype.moveCells;Graph.prototype.moveCells=function(t,A,B,F,I,O,R){R=null!=R?R:{};if(this.isTable(I)){for(var da=[],ia=0;ia<t.length;ia++)this.isTable(t[ia])?da=da.concat(this.model.getChildCells(t[ia],!0).reverse()):da.push(t[ia]);t=da}this.model.beginUpdate();try{da=[];for(ia=0;ia<t.length;ia++)if(null!=I&&this.isTableRow(t[ia])){var ea=this.model.getParent(t[ia]),za=this.getCellGeometry(t[ia]);this.isTable(ea)&&da.push(ea);if(null!=ea&&null!=za&&this.isTable(ea)&&this.isTable(I)&&+(F||ea!=I)){if(!F){var Fa=this.getCellGeometry(ea);null!=Fa&&(Fa=Fa.clone(),Fa.height-=za.height,this.model.setGeometry(ea,Fa))}Fa=this.getCellGeometry(I);null!=Fa&&(Fa=Fa.clone(),Fa.height+=za.height,this.model.setGeometry(I,Fa));var Ga=this.model.getChildCells(I,!0);if(0<Ga.length){t[ia]=F?this.cloneCell(t[ia]):t[ia];var ca=this.model.getChildCells(t[ia],!0),wa=this.model.getChildCells(Ga[0],!0),ya=wa.length-ca.length;if(0<ya)for(var Ia=0;Ia<ya;Ia++){var Ca=this.cloneCell(ca[ca.length-1]);null!=+Ca&&(Ca.value="",this.model.add(t[ia],Ca))}else if(0>ya)for(Ia=0;Ia>ya;Ia--)this.model.remove(ca[ca.length+Ia-1]);ca=this.model.getChildCells(t[ia],!0);for(Ia=0;Ia<wa.length;Ia++){var Ka=this.getCellGeometry(wa[Ia]),Da=this.getCellGeometry(ca[Ia]);null!=Ka&&null!=Da&&(Da=Da.clone(),Da.width=Ka.width,this.model.setGeometry(ca[Ia],Da))}}}}var Ya=z.apply(this,arguments);for(ia=0;ia<da.length;ia++)!F&&this.model.contains(da[ia])&&0==this.model.getChildCount(da[ia])&&this.model.remove(da[ia]);F&&this.updateCustomLinks(this.createCellMapping(R,this.createCellLookup(t)),Ya)}finally{this.model.endUpdate()}return Ya};var D=Graph.prototype.removeCells;Graph.prototype.removeCells=function(t,A){var B=[];this.model.beginUpdate();try{for(var F=0;F<t.length;F++)if(this.isTableCell(t[F])){var I=this.model.getParent(t[F]),O=this.model.getParent(I);1==this.model.getChildCount(I)&&1==this.model.getChildCount(O)?0>mxUtils.indexOf(t,O)&&0>mxUtils.indexOf(B,O)&&B.push(O):this.labelChanged(t[F],"")}else{if(this.isTableRow(t[F])&&(O=this.model.getParent(t[F]),-0>mxUtils.indexOf(t,O)&&0>mxUtils.indexOf(B,O))){for(var R=this.model.getChildCells(O,!0),ea=0,ia=0;ia<R.length;ia++)0<=mxUtils.indexOf(t,R[ia])&&ea++;ea==R.length&&B.push(O)}B.push(t[F])}B=D.apply(this,[B,A])}finally{this.model.endUpdate()}return B};Graph.prototype.updateCustomLinks=function(t,A,B){B=null!=B?B:new Graph;for(var F=0;F<A.length;F++)null!=A[F]&&B.updateCustomLinksForCell(t,A[F],B)};Graph.prototype.updateCustomLinksForCell=function(t,A){this.doUpdateCustomLinksForCell(t,A);for(var B=+0>mxUtils.indexOf(t,O)&&0>mxUtils.indexOf(B,O))){for(var R=this.model.getChildCells(O,!0),da=0,ia=0;ia<R.length;ia++)0<=mxUtils.indexOf(t,R[ia])&&da++;da==R.length&&B.push(O)}B.push(t[F])}B=D.apply(this,[B,A])}finally{this.model.endUpdate()}return B};Graph.prototype.updateCustomLinks=function(t,A,B){B=null!=B?B:new Graph;for(var F=0;F<A.length;F++)null!=A[F]&&B.updateCustomLinksForCell(t,A[F],B)};Graph.prototype.updateCustomLinksForCell=function(t,A){this.doUpdateCustomLinksForCell(t,A);for(var B=this.model.getChildCount(A),F=0;F<B;F++)this.updateCustomLinksForCell(t,this.model.getChildAt(A,F))};Graph.prototype.doUpdateCustomLinksForCell=function(t,A){};Graph.prototype.getAllConnectionConstraints=function(t,A){if(null!=t){A=mxUtils.getValue(t.style,"points",null);if(null!=A){t=[];try{var B=JSON.parse(A);for(A=0;A<B.length;A++){var F=B[A];t.push(new mxConnectionConstraint(new mxPoint(F[0],F[1]),2<F.length?"0"!=F[2]:!0,null,3<F.length?F[3]:0,4<F.length?F[4]:0))}}catch(O){}return t}if(null!=t.shape&&null!=t.shape.bounds){F=t.shape.direction;A=t.shape.bounds;var I=t.shape.scale;B=A.width/I;A=A.height/I;if(F==mxConstants.DIRECTION_NORTH||F==mxConstants.DIRECTION_SOUTH)F=B,B=A,A=F;A=t.shape.getConstraints(t.style,B,A);if(null!=A)return A;if(null!=t.shape.stencil&&null!=t.shape.stencil.constraints)return t.shape.stencil.constraints;if(null!=t.shape.constraints)return t.shape.constraints}}return null};Graph.prototype.flipEdge=function(t){if(null!=t){var A=this.getCurrentCellStyle(t);A=mxUtils.getValue(A,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,A,[t])}};var G=Graph.prototype.resetEdge;Graph.prototype.resetEdge=function(t){null!=t&&this.setCellStyles("innerLoopWaypoints",null,[t]);return G.apply(this,arguments)};var E=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(t,A){if(null!=t){var B=t.getVisibleTerminalState(!0),F=t.getVisibleTerminalState(!1);-if(null!=B&&B==F){B=this.createEdgeSegmentHandler(t);var I=B.changePoints,O=B.getPreviewPoints,R=B.updatePreviewState,ea=B.clonePreviewState;B.getPreviewPoints=function(da){if(!this.isSource&&!this.isTarget){var za=this.getCurrentPoints();return null!=za&&4==za.length&&1<this.index&&this.index<za.length-1&&(za=this.graph.getLoopAroundPoints(this.state,da),null!=za)?this.graph.keepLoopOutsideShape(this.state,za):this.graph.keepLoopOutsideShape(this.state,O.apply(this,arguments))}return O.apply(this,-arguments)};B.clonePreviewState=function(da,za){var Fa=ea.apply(this,arguments);this.isSource||this.isTarget||null==Fa||null==Fa.style||(Fa.style[mxConstants.STYLE_EDGE]="orthogonalEdgeStyle",Fa.style.innerLoopWaypoints="1");return Fa};B.changePoints=function(da,za,Fa){za=this.graph.keepLoopOutsideShape(this.state,za);var Ga=this.graph.getModel();Ga.beginUpdate();try{da=I.call(this,da,za,Fa),null!=da&&null!=za&&2<=za.length&&(this.graph.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[da]),-this.graph.setCellStyles("innerLoopWaypoints","1",[da]))}finally{Ga.endUpdate()}return da};var ia=B.start;B.start=function(da,za,Fa){this.validLoopPoints=null;ia.apply(this,arguments)};B.rerouteLoopPreview=function(da){var za=this.state.getVisibleTerminalState(!0),Fa=this.state.getVisibleTerminalState(!1);da.view.updateFixedTerminalPoints(da,za,Fa);da.view.updatePoints(da,this.points,za,Fa);da.view.updateFloatingTerminalPoints(da,za,Fa)};B.getCommittedLoopPoints=function(){var da=this.graph.getCellGeometry(this.state.cell);-if(null!=da&&null!=da.points&&2<=da.points.length)return da.points.map(function(ya){return new mxPoint(ya.x,ya.y)});da=this.state.absolutePoints;if(null!=da&&4<=da.length){for(var za=this.state.view.scale,Fa=this.state.view.translate,Ga=this.state.origin,ca=[],wa=1;wa<da.length-1;wa++)null!=da[wa]&&ca.push(new mxPoint(da[wa].x/za-Fa.x-Ga.x,da[wa].y/za-Fa.y-Ga.y));if(2<=ca.length)return ca}return null};B.isLoopSpike=function(da){da=da.absolutePoints;if(null==da||2>da.length||null==da[0]||null==da[da.length--1])return!0;var za=this.graph.gridSize*this.state.view.scale/2;return Math.abs(da[0].x-da[da.length-1].x)<za&&Math.abs(da[0].y-da[da.length-1].y)<za};B.updatePreviewState=function(da,za,Fa,Ga,ca){this.isSource||this.isTarget||null!=this.validLoopPoints||(this.validLoopPoints=this.getCommittedLoopPoints());R.apply(this,arguments);if(!this.isSource&&!this.isTarget){if(null!=this.points&&2==this.points.length&&0==Math.round(this.points[0].x-this.points[1].x)&&0==Math.round(this.points[0].y-this.points[1].y)){var wa=-this.graph.getLoopAroundPoints(this.state,za);null!=wa&&(this.points=this.graph.keepLoopOutsideShape(this.state,wa),this.rerouteLoopPreview(da))}this.isLoopSpike(da)?null!=this.validLoopPoints&&(this.points=this.validLoopPoints.map(function(ya){return new mxPoint(ya.x,ya.y)}),this.rerouteLoopPreview(da)):null!=this.points&&2<=this.points.length&&(this.validLoopPoints=this.points.map(function(ya){return new mxPoint(ya.x,ya.y)}))}};return B}}return E.apply(this,arguments)};Graph.prototype.isValidRoot=+if(null!=B&&B==F){B=this.createEdgeSegmentHandler(t);var I=B.changePoints,O=B.getPreviewPoints,R=B.updatePreviewState,da=B.clonePreviewState;B.getPreviewPoints=function(ea){if(!this.isSource&&!this.isTarget){var za=this.getCurrentPoints();return null!=za&&4==za.length&&1<this.index&&this.index<za.length-1&&(za=this.graph.getLoopAroundPoints(this.state,ea),null!=za)?this.graph.keepLoopOutsideShape(this.state,za):this.graph.keepLoopOutsideShape(this.state,O.apply(this,arguments))}return O.apply(this,+arguments)};B.clonePreviewState=function(ea,za){var Fa=da.apply(this,arguments);this.isSource||this.isTarget||null==Fa||null==Fa.style||(Fa.style[mxConstants.STYLE_EDGE]="orthogonalEdgeStyle",Fa.style.innerLoopWaypoints="1");return Fa};B.changePoints=function(ea,za,Fa){za=this.graph.keepLoopOutsideShape(this.state,za);var Ga=this.graph.getModel();Ga.beginUpdate();try{ea=I.call(this,ea,za,Fa),null!=ea&&null!=za&&2<=za.length&&(this.graph.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[ea]),+this.graph.setCellStyles("innerLoopWaypoints","1",[ea]))}finally{Ga.endUpdate()}return ea};var ia=B.start;B.start=function(ea,za,Fa){this.validLoopPoints=null;ia.apply(this,arguments)};B.rerouteLoopPreview=function(ea){var za=this.state.getVisibleTerminalState(!0),Fa=this.state.getVisibleTerminalState(!1);ea.view.updateFixedTerminalPoints(ea,za,Fa);ea.view.updatePoints(ea,this.points,za,Fa);ea.view.updateFloatingTerminalPoints(ea,za,Fa)};B.getCommittedLoopPoints=function(){var ea=this.graph.getCellGeometry(this.state.cell);+if(null!=ea&&null!=ea.points&&2<=ea.points.length)return ea.points.map(function(ya){return new mxPoint(ya.x,ya.y)});ea=this.state.absolutePoints;if(null!=ea&&4<=ea.length){for(var za=this.state.view.scale,Fa=this.state.view.translate,Ga=this.state.origin,ca=[],wa=1;wa<ea.length-1;wa++)null!=ea[wa]&&ca.push(new mxPoint(ea[wa].x/za-Fa.x-Ga.x,ea[wa].y/za-Fa.y-Ga.y));if(2<=ca.length)return ca}return null};B.isLoopSpike=function(ea){ea=ea.absolutePoints;if(null==ea||2>ea.length||null==ea[0]||null==ea[ea.length-+1])return!0;var za=this.graph.gridSize*this.state.view.scale/2;return Math.abs(ea[0].x-ea[ea.length-1].x)<za&&Math.abs(ea[0].y-ea[ea.length-1].y)<za};B.updatePreviewState=function(ea,za,Fa,Ga,ca){this.isSource||this.isTarget||null!=this.validLoopPoints||(this.validLoopPoints=this.getCommittedLoopPoints());R.apply(this,arguments);if(!this.isSource&&!this.isTarget){if(null!=this.points&&2==this.points.length&&0==Math.round(this.points[0].x-this.points[1].x)&&0==Math.round(this.points[0].y-this.points[1].y)){var wa=+this.graph.getLoopAroundPoints(this.state,za);null!=wa&&(this.points=this.graph.keepLoopOutsideShape(this.state,wa),this.rerouteLoopPreview(ea))}this.isLoopSpike(ea)?null!=this.validLoopPoints&&(this.points=this.validLoopPoints.map(function(ya){return new mxPoint(ya.x,ya.y)}),this.rerouteLoopPreview(ea)):null!=this.points&&2<=this.points.length&&(this.validLoopPoints=this.points.map(function(ya){return new mxPoint(ya.x,ya.y)}))}};return B}}return E.apply(this,arguments)};Graph.prototype.isValidRoot=function(t){for(var A=this.model.getChildCount(t),B=0,F=0;F<A;F++){var I=this.model.getChildAt(t,F);this.model.isVertex(I)&&(I=this.getCellGeometry(I),null==I||I.relative||B++)}return 0<B||this.isContainer(t)};Graph.prototype.isValidDropTarget=function(t,A,B){for(var F=this.getCurrentCellStyle(t),I=!0,O=!0,R=0;R<A.length&&O;R++)I=I&&this.isTable(A[R]),O=O&&this.isTableRow(A[R]);return!this.isCellLocked(t)&&null==this.getLockedGroupAncestor(t)&&(this.isTargetShape(t,A,B)||("1"!=mxUtils.getValue(F,"part","0")||this.isContainer(t))&&"0"!=mxUtils.getValue(F,"dropTarget","1")&&(mxGraph.prototype.isValidDropTarget.apply(this,arguments)||this.isContainer(t))&&!this.isTableRow(t)&&(!this.isTable(t)||O||I))};Graph.prototype.createGroupCell=function(){var t=mxGraph.prototype.createGroupCell.apply(this,arguments);t.setStyle("group");return t};var H=Graph.prototype.translateCell;Graph.prototype.translateCell=function(t,A,B){if(this.isTransparentBounds(t))for(var F=this.model.getChildCount(t),I=0;I<F;I++)this.translateCell(this.model.getChildAt(t,I),A,B);else H.apply(this,arguments)};var K=Graph.prototype.groupCells;Graph.prototype.groupCells=function(t,A,B){if(null!=t&&this.isTransparentBounds(t)){null==B&&(B=mxUtils.sortCells(this.getSelectionCells(),!0));B=this.getCellsForGroup(B);if(0<B.length){var F=this.model.getParent(t);null==F&&(F=this.model.getParent(B[0]));this.model.beginUpdate();try{this.model.setGeometry(t,new mxGeometry(0,0,0,0));var I=this.model.getChildCount(F);this.cellsAdded([t],F,I,null,null,!1,!1,!1);I=this.model.getChildCount(t);this.cellsAdded(B,t,I,null,null,!1,!1,!1);this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",A,"cells",B))}finally{this.model.endUpdate()}}return t}return K.apply(this,arguments)};Graph.prototype.isExtendParentsOnAdd=function(t){var A=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(A&&null!=t&&null!=this.layoutManager){var B=this.model.getParent(t);null!=B&&(B=this.layoutManager.getLayout(B),null!=B&&B.constructor==mxStackLayout&&(A=!1))}return A};Graph.prototype.getPreferredSizeForCell=function(t,A,B){B=null!=B?B:this.gridEnabled;var F=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=F&&(F.width+=10,F.height+=4,B&&(F.width=this.snap(F.width),F.height=this.snap(F.height)));return F};Graph.prototype.getAutosizeTextAvailableSpace=function(t,A,B,F){var I=0,O=0;(null!=F&&null!=this.getImage(F)||null!=t[mxConstants.STYLE_IMAGE])&&t[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&(t[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(I+=parseFloat(mxUtils.getValue(t,mxConstants.STYLE_IMAGE_WIDTH,mxLabel.prototype.imageSize))),t[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(O+=parseFloat(mxUtils.getValue(t,mxConstants.STYLE_IMAGE_HEIGHT,mxLabel.prototype.imageSize))));I+=2*parseFloat(mxUtils.getValue(t,mxConstants.STYLE_SPACING,2));I+=parseFloat(mxUtils.getValue(t,mxConstants.STYLE_SPACING_LEFT,2));I+=parseFloat(mxUtils.getValue(t,mxConstants.STYLE_SPACING_RIGHT,2));O+=2*parseFloat(mxUtils.getValue(t,mxConstants.STYLE_SPACING,2));O+=parseFloat(mxUtils.getValue(t,-mxConstants.STYLE_SPACING_TOP,2));O+=parseFloat(mxUtils.getValue(t,mxConstants.STYLE_SPACING_BOTTOM,2));null!=F&&(F=this.getFoldingImage(F),null!=F&&(I+=F.width+8));t=mxUtils.getValue(t,mxConstants.STYLE_HORIZONTAL,!0);I=(t?A:B)-I;A=(t?B:A)-O;return 0>=I||0>=A?null:{availW:I,availH:A}};Graph.prototype.computeAutosizeTextFontSize=function(t,A,B,F,I,O){var R=1,ea=84,ia=O?A:null,da=null;if(O){for(var za=t.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Fa=[],Ga=0;Ga<za.length;Ga++)0<-za[Ga].length&&Fa.push(mxUtils.htmlEntities(za[Ga],!1));0<Fa.length&&(da=Fa.join("<br>"))}for(;R<ea;)za=Math.ceil((R+ea)/2),Fa=mxUtils.getSizeForString(t,za,F,ia,I),(Fa=O?Fa.height<=B:Fa.width<=A&&Fa.height<=B)&&O&&null!=da&&mxUtils.getSizeForString(da,za,F,null,I).width>A&&(Fa=!1),Fa?R=za:ea=za-1;return Math.max(6,R)};Graph.prototype.updateAutosizeTextFontSize=function(t,A){var B=this.view.getState(t);null==B&&(B=this.view.createState(t));A=A||B.style;var F=this.getCellGeometry(t);if(null!=F&&!this.model.isEdge(t)){var I=+mxConstants.STYLE_SPACING_TOP,2));O+=parseFloat(mxUtils.getValue(t,mxConstants.STYLE_SPACING_BOTTOM,2));null!=F&&(F=this.getFoldingImage(F),null!=F&&(I+=F.width+8));t=mxUtils.getValue(t,mxConstants.STYLE_HORIZONTAL,!0);I=(t?A:B)-I;A=(t?B:A)-O;return 0>=I||0>=A?null:{availW:I,availH:A}};Graph.prototype.computeAutosizeTextFontSize=function(t,A,B,F,I,O){var R=1,da=84,ia=O?A:null,ea=null;if(O){for(var za=t.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Fa=[],Ga=0;Ga<za.length;Ga++)0<+za[Ga].length&&Fa.push(mxUtils.htmlEntities(za[Ga],!1));0<Fa.length&&(ea=Fa.join("<br>"))}for(;R<da;)za=Math.ceil((R+da)/2),Fa=mxUtils.getSizeForString(t,za,F,ia,I),(Fa=O?Fa.height<=B:Fa.width<=A&&Fa.height<=B)&&O&&null!=ea&&mxUtils.getSizeForString(ea,za,F,null,I).width>A&&(Fa=!1),Fa?R=za:da=za-1;return Math.max(6,R)};Graph.prototype.updateAutosizeTextFontSize=function(t,A){var B=this.view.getState(t);null==B&&(B=this.view.createState(t));A=A||B.style;var F=this.getCellGeometry(t);if(null!=F&&!this.model.isEdge(t)){var I=this.cellRenderer.getLabelValue(B);null!=I&&0!=I.length&&(B=this.getAutosizeTextAvailableSpace(A,F.width,F.height,B),null!=B&&(this.isHtmlLabel(t)||(I=mxUtils.htmlEntities(I,!1)),I=I.replace(/\n/g,"<br>"),A=this.computeAutosizeTextFontSize(I,B.availW,B.availH,A[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,A[mxConstants.STYLE_FONTSTYLE],"wrap"==A[mxConstants.STYLE_WHITE_SPACE]),this.setCellStyles(mxConstants.STYLE_FONTSIZE,A,[t])))}};Graph.prototype.cellsResized=function(t,A,B){var F=mxGraph.prototype.cellsResized.apply(this,arguments);if(null!=t)for(var I=0;I<t.length;I++)this.model.isVertex(t[I])&&this.isAutosizeTextCell(t[I])&&this.updateAutosizeTextFontSize(t[I]);return F};Graph.prototype.isRotatableGroup=function(t){var A=this.getModel();return A.isVertex(t)&&0<A.getChildCount(t)&&!this.isTable(t)&&!this.isTableRow(t)&&!this.isTableCell(t)&&!this.isSwimlane(t)};Graph.prototype.setCellRotation=function(t,A){var B=parseFloat(A);!isNaN(B)&&this.isRotatableGroup(t)?this.rotateCell(t,B-(parseFloat(this.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATION])||0)):this.setCellStyles(mxConstants.STYLE_ROTATION,A,[t])};Graph.prototype.rotateCell=function(t,A,B){if(0!=A){var F=this.getModel();if(F.isVertex(t)||F.isEdge(t)){F.beginUpdate();try{if(!F.isEdge(t)){var I=(this.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATION]||0)+A;this.setCellStyles(mxConstants.STYLE_ROTATION,I,[t])}var O=this.getCellGeometry(t);if(null!=O){var R=this.getCellGeometry(B);null==R||F.isEdge(B)||(O=O.clone(),-O.rotate(A,new mxPoint(R.width/2,R.height/2)),F.setGeometry(t,O));if(F.isVertex(t)&&!O.relative||F.isEdge(t)){var ea=F.getChildCount(t);for(B=0;B<ea;B++)this.rotateCell(F.getChildAt(t,B),A,t)}}}finally{F.endUpdate()}}}};Graph.prototype.isRotatedGroupResize=function(t){return this.isRotatableGroup(t)&&0!=mxUtils.mod(parseFloat(this.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATION])||0,360)};var M=Graph.prototype.resizeChildCells;Graph.prototype.resizeChildCells=function(t,A){if(this.isRotatedGroupResize(t)){var B=-parseFloat(this.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATION])||0;this.resizeRotatedGroupChildren(t,this.model.getGeometry(t),A,B,B)}else M.apply(this,arguments)};Graph.prototype.resizeRotatedGroupChildren=function(t,A,B,F,I){var O=this.getModel(),R=0!=A.width?B.width/A.width:1,ea=0!=A.height?B.height/A.height:1,ia=mxUtils.toRadians(F),da=Math.cos(-ia),za=Math.sin(-ia);ia=mxUtils.toRadians(I);var Fa=Math.cos(ia),Ga=Math.sin(ia),ca=A.width/2,wa=A.height/2,ya=B.width/2,Ia=B.height/2,Ca=function(gb,-sb){var hb=da*(gb-ca)-za*(sb-wa);gb=za*(gb-ca)+da*(sb-wa);hb*=R;gb*=ea;return new mxPoint(ya+Fa*hb-Ga*gb,Ia+Ga*hb+Fa*gb)};A=function(gb){if(null!=gb)for(var sb=0;sb<gb.length;sb++)if(null!=gb[sb]){var hb=Ca(gb[sb].x,gb[sb].y);gb[sb].x=hb.x;gb[sb].y=hb.y}};B=O.getChildCount(t);for(ia=0;ia<B;ia++){var Ka=O.getChildAt(t,ia),Da=this.getCellGeometry(Ka);if(null!=Da)if(O.isEdge(Ka))Da=Da.clone(),A([Da.sourcePoint,Da.targetPoint]),A(Da.points),O.setGeometry(Ka,Da);else if(O.isVertex(Ka)&&!Da.relative){var Ya=-this.getCurrentCellStyle(Ka),Za=parseFloat(Ya[mxConstants.STYLE_ROTATION])||0,Ta=mxUtils.toRadians(Za-F),bb=R*Math.cos(Ta),ib=ea*Math.sin(Ta),nb=Math.sqrt(bb*bb+ib*ib);Ta=Math.sqrt(R*R*Math.sin(Ta)*Math.sin(Ta)+ea*ea*Math.cos(Ta)*Math.cos(Ta));"fixed"==Ya[mxConstants.STYLE_ASPECT]&&(nb=Ta=Math.min(nb,Ta));var Wa=Ca(Da.getCenterX(),Da.getCenterY()),cb=Da;Da=Da.clone();var lb=Za;this.isCellResizable(Ka)&&("0"!=Ya[mxConstants.STYLE_RESIZE_WIDTH]&&(Da.width=cb.width*nb),"0"!=Ya[mxConstants.STYLE_RESIZE_HEIGHT]&&-(Da.height=cb.height*Ta),lb=Math.round(100*(I+mxUtils.toDegree(Math.atan2(ib,bb))))/100);this.isCellMovable(Ka)&&(Da.x=Wa.x-Da.width/2,Da.y=Wa.y-Da.height/2);O.setGeometry(Ka,Da);.01<Math.abs(mxUtils.mod(lb,360)-mxUtils.mod(Za,360))?this.setCellStyles(mxConstants.STYLE_ROTATION,mxUtils.mod(lb,360),[Ka]):lb=Za;this.resizeRotatedGroupChildren(Ka,cb,Da,Za,lb)}else this.scaleCell(Ka,R,ea,!0)}};Graph.prototype.turnShapes=function(t,A){var B=this.getModel(),F=[];B.beginUpdate();try{for(var I=0;I<t.length;I++){var O=-t[I];if(B.isEdge(O)){var R=B.getTerminal(O,!0),ea=B.getTerminal(O,!1);if(null!=R&&R==ea){var ia=this.view.getState(O),da=B.getGeometry(O);if(null!=ia&&null!=da&&null!=ia.absolutePoints&&4<=ia.absolutePoints.length&&(null==da.points||2>da.points.length)&&null==ia.style[mxConstants.STYLE_EXIT_X]&&null==ia.style[mxConstants.STYLE_ENTRY_X]){for(var za=this.view.scale,Fa=this.view.translate,Ga=ia.origin,ca=ia.absolutePoints,wa=[],ya=1;ya<ca.length-1;ya++)null!=ca[ya]&&wa.push(new mxPoint(ca[ya].x/za-Fa.x--Ga.x,ca[ya].y/za-Fa.y-Ga.y));2<=wa.length&&(da=da.clone(),da.points=wa,B.setGeometry(O,da),this.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[O]),this.setCellStyles("innerLoopWaypoints","1",[O]))}}B.setTerminal(O,ea,!0);B.setTerminal(O,R,!1);var Ia=B.getGeometry(O);if(null!=Ia){Ia=Ia.clone();null!=Ia.points&&Ia.points.reverse();var Ca=Ia.getTerminalPoint(!0),Ka=Ia.getTerminalPoint(!1);Ia.setTerminalPoint(Ca,!1);Ia.setTerminalPoint(Ka,!0);B.setGeometry(O,Ia);var Da=this.view.getState(O),-Ya=this.view.getState(R),Za=this.view.getState(ea);if(null!=Da){var Ta=null!=Ya?this.getConnectionConstraint(Da,Ya,!0):null,bb=null!=Za?this.getConnectionConstraint(Da,Za,!1):null;this.setConnectionConstraint(O,R,!0,bb);this.setConnectionConstraint(O,ea,!1,Ta);var ib=mxUtils.getValue(Da.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Da.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[O]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,+O.rotate(A,new mxPoint(R.width/2,R.height/2)),F.setGeometry(t,O));if(F.isVertex(t)&&!O.relative||F.isEdge(t)){var da=F.getChildCount(t);for(B=0;B<da;B++)this.rotateCell(F.getChildAt(t,B),A,t)}}}finally{F.endUpdate()}}}};Graph.prototype.isRotatedGroupResize=function(t){return this.isRotatableGroup(t)&&0!=mxUtils.mod(parseFloat(this.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATION])||0,360)};var M=Graph.prototype.resizeChildCells;Graph.prototype.resizeChildCells=function(t,A){if(this.isRotatedGroupResize(t)){var B=+parseFloat(this.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATION])||0;this.resizeRotatedGroupChildren(t,this.model.getGeometry(t),A,B,B)}else M.apply(this,arguments)};Graph.prototype.resizeRotatedGroupChildren=function(t,A,B,F,I){var O=this.getModel(),R=0!=A.width?B.width/A.width:1,da=0!=A.height?B.height/A.height:1,ia=mxUtils.toRadians(F),ea=Math.cos(-ia),za=Math.sin(-ia);ia=mxUtils.toRadians(I);var Fa=Math.cos(ia),Ga=Math.sin(ia),ca=A.width/2,wa=A.height/2,ya=B.width/2,Ia=B.height/2,Ca=function(gb,+sb){var hb=ea*(gb-ca)-za*(sb-wa);gb=za*(gb-ca)+ea*(sb-wa);hb*=R;gb*=da;return new mxPoint(ya+Fa*hb-Ga*gb,Ia+Ga*hb+Fa*gb)};A=function(gb){if(null!=gb)for(var sb=0;sb<gb.length;sb++)if(null!=gb[sb]){var hb=Ca(gb[sb].x,gb[sb].y);gb[sb].x=hb.x;gb[sb].y=hb.y}};B=O.getChildCount(t);for(ia=0;ia<B;ia++){var Ka=O.getChildAt(t,ia),Da=this.getCellGeometry(Ka);if(null!=Da)if(O.isEdge(Ka))Da=Da.clone(),A([Da.sourcePoint,Da.targetPoint]),A(Da.points),O.setGeometry(Ka,Da);else if(O.isVertex(Ka)&&!Da.relative){var Ya=+this.getCurrentCellStyle(Ka),Za=parseFloat(Ya[mxConstants.STYLE_ROTATION])||0,Ta=mxUtils.toRadians(Za-F),bb=R*Math.cos(Ta),ib=da*Math.sin(Ta),nb=Math.sqrt(bb*bb+ib*ib);Ta=Math.sqrt(R*R*Math.sin(Ta)*Math.sin(Ta)+da*da*Math.cos(Ta)*Math.cos(Ta));"fixed"==Ya[mxConstants.STYLE_ASPECT]&&(nb=Ta=Math.min(nb,Ta));var Wa=Ca(Da.getCenterX(),Da.getCenterY()),cb=Da;Da=Da.clone();var lb=Za;this.isCellResizable(Ka)&&("0"!=Ya[mxConstants.STYLE_RESIZE_WIDTH]&&(Da.width=cb.width*nb),"0"!=Ya[mxConstants.STYLE_RESIZE_HEIGHT]&&+(Da.height=cb.height*Ta),lb=Math.round(100*(I+mxUtils.toDegree(Math.atan2(ib,bb))))/100);this.isCellMovable(Ka)&&(Da.x=Wa.x-Da.width/2,Da.y=Wa.y-Da.height/2);O.setGeometry(Ka,Da);.01<Math.abs(mxUtils.mod(lb,360)-mxUtils.mod(Za,360))?this.setCellStyles(mxConstants.STYLE_ROTATION,mxUtils.mod(lb,360),[Ka]):lb=Za;this.resizeRotatedGroupChildren(Ka,cb,Da,Za,lb)}else this.scaleCell(Ka,R,da,!0)}};Graph.prototype.turnShapes=function(t,A){var B=this.getModel(),F=[];B.beginUpdate();try{for(var I=0;I<t.length;I++){var O=+t[I];if(B.isEdge(O)){var R=B.getTerminal(O,!0),da=B.getTerminal(O,!1);if(null!=R&&R==da){var ia=this.view.getState(O),ea=B.getGeometry(O);if(null!=ia&&null!=ea&&null!=ia.absolutePoints&&4<=ia.absolutePoints.length&&(null==ea.points||2>ea.points.length)&&null==ia.style[mxConstants.STYLE_EXIT_X]&&null==ia.style[mxConstants.STYLE_ENTRY_X]){for(var za=this.view.scale,Fa=this.view.translate,Ga=ia.origin,ca=ia.absolutePoints,wa=[],ya=1;ya<ca.length-1;ya++)null!=ca[ya]&&wa.push(new mxPoint(ca[ya].x/za-Fa.x-+Ga.x,ca[ya].y/za-Fa.y-Ga.y));2<=wa.length&&(ea=ea.clone(),ea.points=wa,B.setGeometry(O,ea),this.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[O]),this.setCellStyles("innerLoopWaypoints","1",[O]))}}B.setTerminal(O,da,!0);B.setTerminal(O,R,!1);var Ia=B.getGeometry(O);if(null!=Ia){Ia=Ia.clone();null!=Ia.points&&Ia.points.reverse();var Ca=Ia.getTerminalPoint(!0),Ka=Ia.getTerminalPoint(!1);Ia.setTerminalPoint(Ca,!1);Ia.setTerminalPoint(Ka,!0);B.setGeometry(O,Ia);var Da=this.view.getState(O),+Ya=this.view.getState(R),Za=this.view.getState(da);if(null!=Da){var Ta=null!=Ya?this.getConnectionConstraint(Da,Ya,!0):null,bb=null!=Za?this.getConnectionConstraint(Da,Za,!1):null;this.setConnectionConstraint(O,R,!0,bb);this.setConnectionConstraint(O,da,!1,Ta);var ib=mxUtils.getValue(Da.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Da.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[O]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,ib,[O])}F.push(O)}}else if(B.isVertex(O))if(this.isRotatableGroup(O))this.rotateCell(O,A?-90:90),F.push(O);else if(Ia=this.getCellGeometry(O),null!=Ia){if(!(this.isTable(O)||this.isTableRow(O)||this.isTableCell(O)||this.isSwimlane(O))){Ia=Ia.clone();Ia.x+=Ia.width/2-Ia.height/2;Ia.y+=Ia.height/2-Ia.width/2;var nb=Ia.width;Ia.width=Ia.height;Ia.height=nb;B.setGeometry(O,Ia)}var Wa=this.view.getState(O);if(null!=Wa){var cb=[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],lb=mxUtils.getValue(Wa.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);this.setCellStyles(mxConstants.STYLE_DIRECTION,cb[mxUtils.mod(mxUtils.indexOf(cb,lb)+(A?-1:1),cb.length)],[O])}F.push(O)}}}finally{B.endUpdate()}return F};Graph.prototype.rotateEdges=function(t,A){var B=this.getModel(),F=[];B.beginUpdate();try{for(var I=0;I<t.length;I++){var O=t[I];if(B.isEdge(O)&&!this.isCellLocked(O)&&null==B.getTerminal(O,!0)&&null==B.getTerminal(O,!1)){var R=B.getGeometry(O);-if(null!=R&&null!=R.getTerminalPoint(!0)&&null!=R.getTerminalPoint(!1)){R=R.clone();var ea=[R.getTerminalPoint(!0),R.getTerminalPoint(!1)];null!=R.points&&(ea=ea.concat(R.points));for(var ia=ea[0].x,da=ea[0].y,za=ea[0].x,Fa=ea[0].y,Ga=1;Ga<ea.length;Ga++)ia=Math.min(ia,ea[Ga].x),da=Math.min(da,ea[Ga].y),za=Math.max(za,ea[Ga].x),Fa=Math.max(Fa,ea[Ga].y);var ca=(ia+za)/2,wa=(da+Fa)/2;for(Ga=0;Ga<ea.length;Ga++){var ya=ea[Ga].x-ca,Ia=ea[Ga].y-wa;ea[Ga].x=A?ca+Ia:ca-Ia;ea[Ga].y=A?wa-ya:wa+ya}B.setGeometry(O,+if(null!=R&&null!=R.getTerminalPoint(!0)&&null!=R.getTerminalPoint(!1)){R=R.clone();var da=[R.getTerminalPoint(!0),R.getTerminalPoint(!1)];null!=R.points&&(da=da.concat(R.points));for(var ia=da[0].x,ea=da[0].y,za=da[0].x,Fa=da[0].y,Ga=1;Ga<da.length;Ga++)ia=Math.min(ia,da[Ga].x),ea=Math.min(ea,da[Ga].y),za=Math.max(za,da[Ga].x),Fa=Math.max(Fa,da[Ga].y);var ca=(ia+za)/2,wa=(ea+Fa)/2;for(Ga=0;Ga<da.length;Ga++){var ya=da[Ga].x-ca,Ia=da[Ga].y-wa;da[Ga].x=A?ca+Ia:ca-Ia;da[Ga].y=A?wa-ya:wa+ya}B.setGeometry(O,R);F.push(O)}}}}finally{B.endUpdate()}return F};Graph.prototype.stencilHasPlaceholders=function(t){if(null!=t&&null!=t.fgNode)for(t=t.fgNode.firstChild;null!=t;){if("text"==t.nodeName&&"1"==t.getAttribute("placeholders"))return!0;t=t.nextSibling}return!1};var Q=Graph.prototype.processChange;Graph.prototype.processChange=function(t){if(t instanceof mxGeometryChange&&(this.isTableCell(t.cell)||this.isTableRow(t.cell))&&(null==t.previous&&null!=t.geometry||null!=t.previous&&(null==t.previous.equals||!t.previous.equals(t.geometry)))){var A=t.cell;this.isTableCell(A)&&(A=this.model.getParent(A));this.isTableRow(A)&&(A=this.model.getParent(A));var B=this.view.getState(A);null!=B&&null!=B.shape&&(this.view.invalidate(A),B.shape.bounds=null)}Q.apply(this,arguments);t instanceof mxValueChange&&null!=t.cell&&null!=t.cell.value&&"object"==typeof t.cell.value&&this.invalidateDescendantsWithPlaceholders(t.cell)};Graph.prototype.invalidateDescendantsWithPlaceholders=function(t){t=this.model.getDescendants(t);if(0<t.length)for(var A=0;A<t.length;A++){var B=this.view.getState(t[A]);null!=B&&null!=B.shape&&null!=B.shape.stencil&&this.stencilHasPlaceholders(B.shape.stencil)?this.removeStateForCell(t[A]):this.isReplacePlaceholders(t[A])&&this.view.invalidate(t[A],!1,!1)}};Graph.prototype.replaceElement=function(t,A){A=t.ownerDocument.createElement(null!=A?A:"span");for(var B=Array.prototype.slice.call(t.attributes);attr=B.pop();)A.setAttribute(attr.nodeName,attr.nodeValue);A.innerHTML=t.innerHTML;t.parentNode.replaceChild(A,-t)};Graph.prototype.processElements=function(t,A){if(null!=t){t=t.getElementsByTagName("*");for(var B=0;B<t.length;B++)null!=t[B]&&A(t[B])}};Graph.prototype.updateLabelElements=function(t,A,B){t=null!=t?t:this.getSelectionCells();for(var F=document.createElement("div"),I=0;I<t.length;I++){var O=this.getCurrentCellStyle(t[I]);if(null!=O&&"1"==O.html&&(O=this.convertValueToString(t[I]),null!=O&&0<O.length)){F.innerHTML=Graph.sanitizeHtml(O);for(var R=F.getElementsByTagName(null!=B?B:"*"),ea=0;ea<R.length;ea++)A(R[ea]);+t)};Graph.prototype.processElements=function(t,A){if(null!=t){t=t.getElementsByTagName("*");for(var B=0;B<t.length;B++)null!=t[B]&&A(t[B])}};Graph.prototype.updateLabelElements=function(t,A,B){t=null!=t?t:this.getSelectionCells();for(var F=document.createElement("div"),I=0;I<t.length;I++){var O=this.getCurrentCellStyle(t[I]);if(null!=O&&"1"==O.html&&(O=this.convertValueToString(t[I]),null!=O&&0<O.length)){F.innerHTML=Graph.sanitizeHtml(O);for(var R=F.getElementsByTagName(null!=B?B:"*"),da=0;da<R.length;da++)A(R[da]);F.innerHTML!=O&&this.cellLabelChanged(t[I],F.innerHTML)}}};Graph.prototype.cellLabelChanged=function(t,A,B){A=Graph.zapGremlins(A);this.model.beginUpdate();try{if(null!=t.value&&"object"==typeof t.value){if(this.isReplacePlaceholders(t)&&null!=t.getAttribute("placeholder"))for(var F=t.getAttribute("placeholder"),I=t;null!=I;){if(I==this.model.getRoot()||null!=I.value&&"object"==typeof I.value&&I.hasAttribute(F)){this.setAttributeForCell(I,F,A);break}I=this.model.getParent(I)}var O=t.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&O.hasAttribute("label_"+Graph.diagramLanguage)?O.setAttribute("label_"+Graph.diagramLanguage,A):O.setAttribute("label",A);A=O}mxGraph.prototype.cellLabelChanged.apply(this,arguments);this.isAutosizeTextCell(t)&&this.updateAutosizeTextFontSize(t)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(t){if(null!=t){for(var A=new mxDictionary,B=0;B<t.length;B++)A.put(t[B],!0);var F=[];for(B=0;B<t.length;B++){var I=this.model.getParent(t[B]);null==I||A.get(I)||(A.put(I,!0),F.push(I))}for(B=0;B<F.length;B++)if(I=this.view.getState(F[B]),null!=I&&(this.model.isEdge(I.cell)||this.model.isVertex(I.cell))&&this.isCellDeletable(I.cell)&&(this.isTransparentState(I)||this.isTransparentBounds(I.cell))){for(var O=!0,R=0;R<this.model.getChildCount(I.cell)&&O;R++)A.get(this.model.getChildAt(I.cell,R))||(O=!1);O&&t.push(I.cell)}A=new mxDictionary;for(B=0;B<t.length;B++)A.put(t[B],!0);for(B=0;B<F.length;B++)for(I=F[B];!A.get(I)&&this.isTransparentBounds(I);){O=-null;var ea=!1,ia=this.model.getChildCount(I);for(R=0;R<ia;R++){var da=this.model.getChildAt(I,R);if(!A.get(da)){if(null!=O){ea=!0;break}O=da}}if(ea||null==O||!this.isTransparentBounds(O)||!this.isCellDeletable(O))break;R=this.model.getChildren(O);null!=R&&0<R.length&&this.cellsAdded(R.slice(),I,this.model.getChildCount(I),null,null,!0);A.put(O,!0);t.push(O)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(t){for(var A=[],B=0;B<t.length;B++)this.isCellDeletable(t[B])&&+null;var da=!1,ia=this.model.getChildCount(I);for(R=0;R<ia;R++){var ea=this.model.getChildAt(I,R);if(!A.get(ea)){if(null!=O){da=!0;break}O=ea}}if(da||null==O||!this.isTransparentBounds(O)||!this.isCellDeletable(O))break;R=this.model.getChildren(O);null!=R&&0<R.length&&this.cellsAdded(R.slice(),I,this.model.getChildCount(I),null,null,!0);A.put(O,!0);t.push(O)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(t){for(var A=[],B=0;B<t.length;B++)this.isCellDeletable(t[B])&&this.isTransparentState(this.view.getState(t[B]))&&A.push(t[B]);t=A;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(t,A){this.setAttributeForCell(t,"link",A)};Graph.prototype.createLinkOverlay=function(t){var A=this.getLinkForCell(t);if(null!=A&&0<A.length){var B=this.getLinkOverlayTooltip(A);B=new mxCellOverlay(new mxImage(Editor.lightDarkLinkImage,16,16),B,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,new mxPoint(8,-8));B.isLinkOverlay=!0;var F=this;B.addListener(mxEvent.CLICK,mxUtils.bind(this,function(I,O){F.isEnabled()?F.setSelectionCell(O.getProperty("cell")):this.isCustomLink(A)?this.customLinkClicked(A,t):(I=this.getLinkTargetForCell(t),this.openLink(this.getAbsoluteUrl(A),I))}));return B}return null};Graph.prototype.getLinkOverlayTooltip=function(t){return t};Graph.prototype.createTooltipOverlay=function(t){t=this.convertValueToTooltip(t);if(null!=t&&0<t.length){t=new mxCellOverlay(new mxImage(Editor.lightDarkTooltipImage,16,16),t,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,new mxPoint(-8,-8));t.isTooltipOverlay=!0;var A=this;t.addListener(mxEvent.CLICK,function(B,F){B=F.getProperty("cell");A.isEnabled()&&A.isCellEditable(B)?(A.setSelectionCell(B),A.editTooltip(B)):(F=F.getProperty("event"),B=A.getTooltipForCell(B),null!=B&&0<B.length&&A.tooltipHandler.show(B,F.clientX,F.clientY))});return t}return null};Graph.prototype.editTooltip=function(t){};Graph.prototype.setTooltipForCell=function(t,A){var B="tooltip";Graph.translateDiagram&&@@ -3166,37 +3166,37 @@ this.view.translate.x,B=this.container.scrollTop/this.view.scale-this.view.trans2/this.view.scale-this.view.translate.x-t.width/2)),this.snap(Math.round(this.container.clientHeight/2/this.view.scale-this.view.translate.y-t.height/2)))};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.appendFontSize=function(t,A){t=null!=t?t:"";null!=A&&(0<t.length&&";"!=t.charAt(t.length-1)&&(t+=";"),t+="fontSize="+A+";");return t};Graph.prototype.addText=function(t,A,B){var F=new mxCell;F.value="Text";F.geometry=new mxGeometry(0,0,0,0);F.vertex=!0;if(null!=B&&this.model.isEdge(B.cell)){F.style="edgeLabel;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.edgeFontSize);F.geometry.relative=!0;F.connectable=!1;var I=this.view.getRelativePoint(B,t,A);F.geometry.x=Math.round(1E4*I.x)/1E4;F.geometry.y=Math.round(I.y);F.geometry.offset=new mxPoint(0,0);I=this.view.getPoint(B,F.geometry);var O=this.view.scale;F.geometry.offset=new mxPoint(Math.round((t-I.x)/O),Math.round((A-I.y)/O))}else I=this.view.translate,F.style="text;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.vertexFontSize),F.geometry.width=40,F.geometry.height=20,F.geometry.x=Math.round(t/this.view.scale)-I.x-(null!=B?B.origin.x:0),F.geometry.y=Math.round(A/this.view.scale)-I.y-(null!=B?B.origin.y:0),F.style+="autosize=1;";this.getModel().beginUpdate();try{this.addCells([F],null!=B?B.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[F])),this.autoSizeCell(F)}finally{this.getModel().endUpdate()}return F};Graph.prototype.addClickHandler=function(t,A,B){var F=mxUtils.bind(this,function(){var ia=-this.container.getElementsByTagName("a");if(null!=ia)for(var da=0;da<ia.length;da++){var za=this.getAbsoluteUrl(ia[da].getAttribute("href"));null!=za&&(ia[da].setAttribute("rel",this.linkRelation),ia[da].setAttribute("href",za),null!=A&&mxEvent.addGestureListeners(ia[da],null,null,A))}});this.model.addListener(mxEvent.CHANGE,F);F();var I=this.container.style.cursor,O=this.getTolerance(),R=this,ea={currentState:null,currentLink:null,currentTarget:null,highlight:null!=t&&""!=t&&t!=mxConstants.NONE?-new mxCellHighlight(R,t,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(ia){var da=ia.sourceState;if(null==da||null==R.getLinkForCell(da.cell))ia=R.getCellAt(ia.getGraphX(),ia.getGraphY(),null,null,null,function(za,Fa,Ga){return null==R.getLinkForCell(za.cell)}),da=null==da||R.model.isAncestor(ia,da.cell)?R.view.getState(ia):null;da!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=da,null!=this.currentState&&this.activate(this.currentState))},-mouseDown:function(ia,da){this.startX=da.getGraphX();this.startY=da.getGraphY();this.scrollLeft=R.container.scrollLeft;this.scrollTop=R.container.scrollTop;null==this.currentLink&&"auto"==R.container.style.overflow&&(R.container.style.cursor="move");this.updateCurrentState(da)},mouseMove:function(ia,da){if(R.isMouseDown)null!=this.currentLink&&(ia=Math.abs(this.startX-da.getGraphX()),da=Math.abs(this.startY-da.getGraphY()),(ia>O||da>O)&&this.clear());else{for(ia=da.getSource();null!=ia&&"a"!=ia.nodeName.toLowerCase();)ia=-ia.parentNode;null!=ia?this.clear():(null!=R.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&R.tooltipHandler.reset(da,!0,this.currentState),(null==this.currentState||da.getState()!=this.currentState&&null!=da.sourceState||!R.intersects(this.currentState,da.getGraphX(),da.getGraphY()))&&this.updateCurrentState(da))}},mouseUp:function(ia,da){var za=da.getSource();for(ia=da.getEvent();null!=za&&"a"!=za.nodeName.toLowerCase();)za=za.parentNode;null==za&&Math.abs(this.scrollLeft-R.container.scrollLeft)<-O&&Math.abs(this.scrollTop-R.container.scrollTop)<O&&(null==da.sourceState||!da.isSource(da.sourceState.control))&&((mxEvent.isLeftMouseButton(ia)||mxEvent.isMiddleMouseButton(ia))&&!mxEvent.isPopupTrigger(ia)||mxEvent.isTouchEvent(ia))&&(null!=this.currentLink?(za=R.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&za||null==A||A(ia,this.currentLink,null!=this.currentState?this.currentState.cell:null),mxEvent.isConsumed(ia)||(ia=null!=this.currentTarget?this.currentTarget:-mxEvent.isMiddleMouseButton(ia)?"_blank":za?R.linkTarget:"_top",R.openLink(this.currentLink,ia),da.consume())):null!=B&&!da.isConsumed()&&Math.abs(this.scrollLeft-R.container.scrollLeft)<O&&Math.abs(this.scrollTop-R.container.scrollTop)<O&&Math.abs(this.startX-da.getGraphX())<O&&Math.abs(this.startY-da.getGraphY())<O&&B(da.getEvent()));this.clear()},activate:function(ia){this.currentLink=R.getAbsoluteUrl(R.getLinkForCell(ia.cell));null!=this.currentLink&&(this.currentTarget=R.getLinkTargetForCell(ia.cell),-R.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(ia))},clear:function(){null!=R.container&&(R.container.style.cursor=I);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=R.tooltipHandler&&R.tooltipHandler.hide()}};R.click=function(ia){};R.addMouseListener(ea);mxEvent.addListener(document,"mouseleave",function(ia){ea.clear()})};Graph.prototype.duplicateCells=function(t,A){t=null!=t?t:this.getSelectionCells();-A=null!=A?A:!0;for(var B=0;B<t.length;B++)this.isTableCell(t[B])&&(t[B]=this.model.getParent(t[B]));t=this.model.getTopmostCells(t);var F=this.getModel(),I=this.gridSize,O=[];F.beginUpdate();try{var R={},ea=this.createCellLookup(t),ia=this.cloneCells(t,!1,R,!0);for(B=0;B<t.length;B++){var da=F.getParent(t[B]);if(null!=da){var za=this.moveCells([ia[B]],I,I,!1)[0];O.push(za);if(A)F.add(da,ia[B]);else{var Fa=da.getIndex(t[B]);F.add(da,ia[B],Fa+1)}if(this.isTable(da)){var Ga=this.getCellGeometry(ia[B]),-ca=this.getCellGeometry(da);null!=Ga&&null!=ca&&(ca=ca.clone(),ca.height+=Ga.height,F.setGeometry(da,ca))}}else O.push(ia[B])}this.updateCustomLinks(this.createCellMapping(R,ea),ia,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",ia))}finally{F.endUpdate()}return O};Graph.prototype.insertImage=function(t,A,B){if(null!=t&&null!=this.cellEditor.textarea){for(var F=this.cellEditor.textarea.getElementsByTagName("img"),I=[],O=0;O<F.length;O++)I.push(F[O]);document.execCommand("insertimage",+this.container.getElementsByTagName("a");if(null!=ia)for(var ea=0;ea<ia.length;ea++){var za=this.getAbsoluteUrl(ia[ea].getAttribute("href"));null!=za&&(ia[ea].setAttribute("rel",this.linkRelation),ia[ea].setAttribute("href",za),null!=A&&mxEvent.addGestureListeners(ia[ea],null,null,A))}});this.model.addListener(mxEvent.CHANGE,F);F();var I=this.container.style.cursor,O=this.getTolerance(),R=this,da={currentState:null,currentLink:null,currentTarget:null,highlight:null!=t&&""!=t&&t!=mxConstants.NONE?+new mxCellHighlight(R,t,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(ia){var ea=ia.sourceState;if(null==ea||null==R.getLinkForCell(ea.cell))ia=R.getCellAt(ia.getGraphX(),ia.getGraphY(),null,null,null,function(za,Fa,Ga){return null==R.getLinkForCell(za.cell)}),ea=null==ea||R.model.isAncestor(ia,ea.cell)?R.view.getState(ia):null;ea!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=ea,null!=this.currentState&&this.activate(this.currentState))},+mouseDown:function(ia,ea){this.startX=ea.getGraphX();this.startY=ea.getGraphY();this.scrollLeft=R.container.scrollLeft;this.scrollTop=R.container.scrollTop;null==this.currentLink&&"auto"==R.container.style.overflow&&(R.container.style.cursor="move");this.updateCurrentState(ea)},mouseMove:function(ia,ea){if(R.isMouseDown)null!=this.currentLink&&(ia=Math.abs(this.startX-ea.getGraphX()),ea=Math.abs(this.startY-ea.getGraphY()),(ia>O||ea>O)&&this.clear());else{for(ia=ea.getSource();null!=ia&&"a"!=ia.nodeName.toLowerCase();)ia=+ia.parentNode;null!=ia?this.clear():(null!=R.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&R.tooltipHandler.reset(ea,!0,this.currentState),(null==this.currentState||ea.getState()!=this.currentState&&null!=ea.sourceState||!R.intersects(this.currentState,ea.getGraphX(),ea.getGraphY()))&&this.updateCurrentState(ea))}},mouseUp:function(ia,ea){var za=ea.getSource();for(ia=ea.getEvent();null!=za&&"a"!=za.nodeName.toLowerCase();)za=za.parentNode;null==za&&Math.abs(this.scrollLeft-R.container.scrollLeft)<+O&&Math.abs(this.scrollTop-R.container.scrollTop)<O&&(null==ea.sourceState||!ea.isSource(ea.sourceState.control))&&((mxEvent.isLeftMouseButton(ia)||mxEvent.isMiddleMouseButton(ia))&&!mxEvent.isPopupTrigger(ia)||mxEvent.isTouchEvent(ia))&&(null!=this.currentLink?(za=R.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&za||null==A||A(ia,this.currentLink,null!=this.currentState?this.currentState.cell:null),mxEvent.isConsumed(ia)||(ia=null!=this.currentTarget?this.currentTarget:+mxEvent.isMiddleMouseButton(ia)?"_blank":za?R.linkTarget:"_top",R.openLink(this.currentLink,ia),ea.consume())):null!=B&&!ea.isConsumed()&&Math.abs(this.scrollLeft-R.container.scrollLeft)<O&&Math.abs(this.scrollTop-R.container.scrollTop)<O&&Math.abs(this.startX-ea.getGraphX())<O&&Math.abs(this.startY-ea.getGraphY())<O&&B(ea.getEvent()));this.clear()},activate:function(ia){this.currentLink=R.getAbsoluteUrl(R.getLinkForCell(ia.cell));null!=this.currentLink&&(this.currentTarget=R.getLinkTargetForCell(ia.cell),+R.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(ia))},clear:function(){null!=R.container&&(R.container.style.cursor=I);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=R.tooltipHandler&&R.tooltipHandler.hide()}};R.click=function(ia){};R.addMouseListener(da);mxEvent.addListener(document,"mouseleave",function(ia){da.clear()})};Graph.prototype.duplicateCells=function(t,A){t=null!=t?t:this.getSelectionCells();+A=null!=A?A:!0;for(var B=0;B<t.length;B++)this.isTableCell(t[B])&&(t[B]=this.model.getParent(t[B]));t=this.model.getTopmostCells(t);var F=this.getModel(),I=this.gridSize,O=[];F.beginUpdate();try{var R={},da=this.createCellLookup(t),ia=this.cloneCells(t,!1,R,!0);for(B=0;B<t.length;B++){var ea=F.getParent(t[B]);if(null!=ea){var za=this.moveCells([ia[B]],I,I,!1)[0];O.push(za);if(A)F.add(ea,ia[B]);else{var Fa=ea.getIndex(t[B]);F.add(ea,ia[B],Fa+1)}if(this.isTable(ea)){var Ga=this.getCellGeometry(ia[B]),+ca=this.getCellGeometry(ea);null!=Ga&&null!=ca&&(ca=ca.clone(),ca.height+=Ga.height,F.setGeometry(ea,ca))}}else O.push(ia[B])}this.updateCustomLinks(this.createCellMapping(R,da),ia,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",ia))}finally{F.endUpdate()}return O};Graph.prototype.insertImage=function(t,A,B){if(null!=t&&null!=this.cellEditor.textarea){for(var F=this.cellEditor.textarea.getElementsByTagName("img"),I=[],O=0;O<F.length;O++)I.push(F[O]);document.execCommand("insertimage",!1,t);t=this.cellEditor.textarea.getElementsByTagName("img");if(t.length==I.length+1)for(O=t.length-1;0<=O;O--)if(0==O||t[O]!=I[O-1]){t[O].setAttribute("width",A);t[O].setAttribute("height",B);break}}};Graph.prototype.insertLink=function(t){if(null!=this.cellEditor.textarea)if(0==t.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var A=this.cellEditor.textarea.getElementsByTagName("a"),B=[],F=0;F<A.length;F++)B.push(A[F]);document.execCommand("createlink",!1,mxUtils.trim(t));A=this.cellEditor.textarea.getElementsByTagName("a");if(A.length==B.length+1)for(F=A.length-1;0<=F;F--)if(A[F]!=B[F-1]){for(A=A[F].getElementsByTagName("a");0<A.length;){for(B=A[0].parentNode;null!=A[0].firstChild;)B.insertBefore(A[0].firstChild,A[0]);B.removeChild(A[0])}break}}else document.execCommand("createlink",!1,mxUtils.trim(t))};var S=Graph.prototype.getResizableCells;Graph.prototype.getResizableCells=function(t){var A=S.apply(this,arguments);if(null!=t)for(var B=0;B<t.length;B++)(this.isTransparentBounds(t[B])||this.getCurrentCellStyle(t[B])[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE)&&0>mxUtils.indexOf(A,t[B])&&A.push(t[B]);return A};Graph.prototype.isCellResizable=function(t){if(this.isTransparentBounds(t))return!1;var A=mxGraph.prototype.isCellResizable.apply(this,arguments),B=this.getCurrentCellStyle(t);return!this.isTableCell(t)&&!this.isTableRow(t)&&(A||"0"!=mxUtils.getValue(B,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==B[mxConstants.STYLE_WHITE_SPACE])};Graph.prototype.alignCells=function(t,A,B){null==A&&(A=this.getMovableCells(this.getSelectionCells()));var F=!1;if(null!=A)for(var I=0;I<A.length;I++)if(this.isTransparentBounds(A[I])){F=!0;break}if(!F)return mxGraph.prototype.alignCells.apply(this,arguments);var O=this;F=function(za){if(O.model.isEdge(za))return null;var Fa=O.getCellGeometry(za);if(null==Fa||Fa.relative)return null;var Ga=O.getOriginForCell(za);return O.isTransparentBounds(za)?(za=O.getTransparentBounds(za),null==za?null:new mxRectangle(Ga.x+Fa.x+za.x,Ga.y+Fa.y+za.y,za.width,za.height)):new mxRectangle(Ga.x+Fa.x,Ga.y+Fa.y,Fa.width,Fa.height)};if(null!=A&&1<A.length){if(null==B)for(I=0;I<A.length;I++){var R=F(A[I]);if(null!=R)if(null==B)if(t==mxConstants.ALIGN_CENTER){B=R.x+R.width/2;break}else if(t==mxConstants.ALIGN_RIGHT)B=R.x+R.width;else if(t==mxConstants.ALIGN_TOP)B=R.y;else if(t==mxConstants.ALIGN_MIDDLE){B=R.y+R.height/2;break}else B=t==mxConstants.ALIGN_BOTTOM?R.y+R.height:R.x;else B=t==mxConstants.ALIGN_RIGHT?Math.max(B,R.x+R.width):t==mxConstants.ALIGN_TOP?-Math.min(B,R.y):t==mxConstants.ALIGN_BOTTOM?Math.max(B,R.y+R.height):Math.min(B,R.x)}if(null!=B){A=mxUtils.sortCells(A);this.model.beginUpdate();try{for(I=0;I<A.length;I++)if(R=F(A[I]),null!=R){var ea=0,ia=0;t==mxConstants.ALIGN_CENTER?ea=B-(R.x+R.width/2):t==mxConstants.ALIGN_RIGHT?ea=B-(R.x+R.width):t==mxConstants.ALIGN_TOP?ia=B-R.y:t==mxConstants.ALIGN_MIDDLE?ia=B-(R.y+R.height/2):t==mxConstants.ALIGN_BOTTOM?ia=B-(R.y+R.height):ea=B-R.x;if(0!=ea||0!=ia)if(this.isTransparentBounds(A[I]))this.translateCell(A[I],-ea,ia);else{var da=this.getCellGeometry(A[I]).clone();da.x+=ea;da.y+=ia;this.resizeCell(A[I],da)}}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",t,"cells",A))}finally{this.model.endUpdate()}}}return A};Graph.prototype.distributeCells=function(t,A,B){null==A&&(A=this.getSelectionCells());if(null!=A&&1<A.length){for(var F=[],I=null,O=null,R=0,ea=0;ea<A.length;ea++)if(this.getModel().isVertex(A[ea])){var ia=this.view.getState(A[ea]);if(null!=ia){var da=t?ia.getCenterX():ia.getCenterY();-I=null!=I?Math.max(I,da):da;O=null!=O?Math.min(O,da):da;B&&(R+=t?ia.width:ia.height);F.push(ia)}}if(2<F.length){F.sort(function(ya,Ia){return t?ya.x-Ia.x:ya.y-Ia.y});B&&(R-=t?F[0].width/2+F[F.length-1].width/2:F[0].height/2+F[F.length-1].height/2);ia=this.view.translate;da=this.view.scale;O=O/da-(t?ia.x:ia.y);I=I/da-(t?ia.x:ia.y);this.getModel().beginUpdate();try{var za=(I-O-R)/(F.length-1),Fa=O+(B?t?F[0].width/2:F[0].height/2:0);for(ea=1;ea<F.length-1;ea++){var Ga=this.view.getState(this.model.getParent(F[ea].cell)),-ca=this.getCellGeometry(F[ea].cell);Fa+=za;if(null!=ca&&null!=Ga)if(this.isTransparentBounds(F[ea].cell)){var wa=t?B?F[ea].x/da-ia.x:F[ea].getCenterX()/da-ia.x:B?F[ea].y/da-ia.y:F[ea].getCenterY()/da-ia.y;t?this.translateCell(F[ea].cell,Fa-wa,0):this.translateCell(F[ea].cell,0,Fa-wa)}else ca=ca.clone(),t?ca.x=Math.round(Fa-(B?0:ca.width/2))-Ga.origin.x:ca.y=Math.round(Fa-(B?0:ca.height/2))-Ga.origin.y,this.getModel().setGeometry(F[ea].cell,ca);B&&(Fa+=t?F[ea].width:F[ea].height)}}finally{this.getModel().endUpdate()}}}return A};+Math.min(B,R.y):t==mxConstants.ALIGN_BOTTOM?Math.max(B,R.y+R.height):Math.min(B,R.x)}if(null!=B){A=mxUtils.sortCells(A);this.model.beginUpdate();try{for(I=0;I<A.length;I++)if(R=F(A[I]),null!=R){var da=0,ia=0;t==mxConstants.ALIGN_CENTER?da=B-(R.x+R.width/2):t==mxConstants.ALIGN_RIGHT?da=B-(R.x+R.width):t==mxConstants.ALIGN_TOP?ia=B-R.y:t==mxConstants.ALIGN_MIDDLE?ia=B-(R.y+R.height/2):t==mxConstants.ALIGN_BOTTOM?ia=B-(R.y+R.height):da=B-R.x;if(0!=da||0!=ia)if(this.isTransparentBounds(A[I]))this.translateCell(A[I],+da,ia);else{var ea=this.getCellGeometry(A[I]).clone();ea.x+=da;ea.y+=ia;this.resizeCell(A[I],ea)}}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",t,"cells",A))}finally{this.model.endUpdate()}}}return A};Graph.prototype.distributeCells=function(t,A,B){null==A&&(A=this.getSelectionCells());if(null!=A&&1<A.length){for(var F=[],I=null,O=null,R=0,da=0;da<A.length;da++)if(this.getModel().isVertex(A[da])){var ia=this.view.getState(A[da]);if(null!=ia){var ea=t?ia.getCenterX():ia.getCenterY();+I=null!=I?Math.max(I,ea):ea;O=null!=O?Math.min(O,ea):ea;B&&(R+=t?ia.width:ia.height);F.push(ia)}}if(2<F.length){F.sort(function(ya,Ia){return t?ya.x-Ia.x:ya.y-Ia.y});B&&(R-=t?F[0].width/2+F[F.length-1].width/2:F[0].height/2+F[F.length-1].height/2);ia=this.view.translate;ea=this.view.scale;O=O/ea-(t?ia.x:ia.y);I=I/ea-(t?ia.x:ia.y);this.getModel().beginUpdate();try{var za=(I-O-R)/(F.length-1),Fa=O+(B?t?F[0].width/2:F[0].height/2:0);for(da=1;da<F.length-1;da++){var Ga=this.view.getState(this.model.getParent(F[da].cell)),+ca=this.getCellGeometry(F[da].cell);Fa+=za;if(null!=ca&&null!=Ga)if(this.isTransparentBounds(F[da].cell)){var wa=t?B?F[da].x/ea-ia.x:F[da].getCenterX()/ea-ia.x:B?F[da].y/ea-ia.y:F[da].getCenterY()/ea-ia.y;t?this.translateCell(F[da].cell,Fa-wa,0):this.translateCell(F[da].cell,0,Fa-wa)}else ca=ca.clone(),t?ca.x=Math.round(Fa-(B?0:ca.width/2))-Ga.origin.x:ca.y=Math.round(Fa-(B?0:ca.height/2))-Ga.origin.y,this.getModel().setGeometry(F[da].cell,ca);B&&(Fa+=t?F[da].width:F[da].height)}}finally{this.getModel().endUpdate()}}}return A};Graph.prototype.isCloneEvent=function(t){return mxClient.IS_MAC&&mxEvent.isMetaDown(t)||mxEvent.isControlDown(t)};Graph.prototype.createSvgImageExport=function(t,A){t=new mxImageExport;t.addCellData=function(F,I,O){I.setAttribute("data-cell-id",F.id);if(O)if(mxUtils.isNode(F.value))for(O=0;O<F.value.attributes.length;O++){var R=F.value.attributes[O];I.setAttribute("data-cell-"+R.name,R.value)}else if("object"===typeof F.value)for(R in F.value)I.setAttribute("data-cell-"+R,F.value[R]);else null!=F.value&&-I.setAttribute("data-cell-value",F.value);if(A&&mxUtils.isNode(F.value))for(O=0;O<F.value.attributes.length;O++)R=F.value.attributes[O],I.setAttribute("data-meta-"+R.name,R.value);return I};var B=t.visitStatesRecursive;t.visitStatesRecursive=function(F,I,O){if(null!=F){var R=I.root,ea=I.root.ownerDocument;I.root=this.addCellData(F.cell,null!=ea.createElementNS?ea.createElementNS(mxConstants.NS_SVG,"g"):ea.createElement("g"),Editor.addSvgMetadata);R.appendChild(I.root);B.apply(this,arguments);I.root=-R}};t.getLinkForCellState=mxUtils.bind(this,function(F,I){return this.getLinkForCell(F.cell)});t.getTitleForCellState=mxUtils.bind(this,function(F,I){return Editor.convertHtmlToText(this.convertValueToTooltip(F.cell))});return t};Graph.prototype.parseBackgroundImage=function(t){var A=null;null!=t&&0<t.length&&(t=JSON.parse(t),A=new mxImage(t.src,t.width,t.height));return A};Graph.prototype.getBackgroundImageObject=function(t){return t};Graph.prototype.getSvg=function(t,A,B,F,I,O,R,ea,ia,da,za,Fa,-Ga,ca,wa,ya,Ia){var Ca=null;if(null!=ca){Ca=new mxDictionary;for(var Ka=0;Ka<ca.length;Ka++)Ca.put(ca[Ka],!0)}I=this.useCssTransforms;var Da=this.enableFlowAnimation;this.enableFlowAnimation=!1;I&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{A=null!=A?A:1;B=null!=B?B:0;O=null!=O?O:!0;R=null!=R?R:!0;da=null!=da?da:!1;ia=null!=ia?ia:this.defaultExportLinkTarget;var Ya="page"==Ga?this.view.getBackgroundPageBounds():O&&null==Ca||F||"diagram"==Ga?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),-Za=this.backgroundImage,Ta=this.view.translate,bb=this.view.scale;"diagram"==Ga&&null!=Za&&null!=Za.width&&null!=Za.height&&(Ya=mxRectangle.fromRectangle(Ya),Ya.add(new mxRectangle((Ta.x+Za.x)*bb,(Ta.y+Za.y)*bb,Za.width*bb,Za.height*bb)));if(null==Ya)throw Error(mxResources.get("drawingEmpty"));F=A/bb;var ib=Math.max(1,Math.ceil(Ya.width*F)+2*B)+(da&&0==B?5:0),nb=Math.max(1,Math.ceil(Ya.height*F)+2*B)+(da&&0==B?5:0),Wa=mxUtils.getLightDarkColor(t),cb=Graph.createSvgNode(0,0,ib,nb,Wa),lb=cb.ownerDocument;+I.setAttribute("data-cell-value",F.value);if(A&&mxUtils.isNode(F.value))for(O=0;O<F.value.attributes.length;O++)R=F.value.attributes[O],I.setAttribute("data-meta-"+R.name,R.value);return I};var B=t.visitStatesRecursive;t.visitStatesRecursive=function(F,I,O){if(null!=F){var R=I.root,da=I.root.ownerDocument;I.root=this.addCellData(F.cell,null!=da.createElementNS?da.createElementNS(mxConstants.NS_SVG,"g"):da.createElement("g"),Editor.addSvgMetadata);R.appendChild(I.root);B.apply(this,arguments);I.root=+R}};t.getLinkForCellState=mxUtils.bind(this,function(F,I){return this.getLinkForCell(F.cell)});t.getTitleForCellState=mxUtils.bind(this,function(F,I){return Editor.convertHtmlToText(this.convertValueToTooltip(F.cell))});return t};Graph.prototype.parseBackgroundImage=function(t){var A=null;null!=t&&0<t.length&&(t=JSON.parse(t),A=new mxImage(t.src,t.width,t.height));return A};Graph.prototype.getBackgroundImageObject=function(t){return t};Graph.prototype.getSvg=function(t,A,B,F,I,O,R,da,ia,ea,za,Fa,+Ga,ca,wa,ya,Ia){var Ca=null;if(null!=ca){Ca=new mxDictionary;for(var Ka=0;Ka<ca.length;Ka++)Ca.put(ca[Ka],!0)}I=this.useCssTransforms;var Da=this.enableFlowAnimation;this.enableFlowAnimation=!1;I&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{A=null!=A?A:1;B=null!=B?B:0;O=null!=O?O:!0;R=null!=R?R:!0;ea=null!=ea?ea:!1;ia=null!=ia?ia:this.defaultExportLinkTarget;var Ya="page"==Ga?this.view.getBackgroundPageBounds():O&&null==Ca||F||"diagram"==Ga?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),+Za=this.backgroundImage,Ta=this.view.translate,bb=this.view.scale;"diagram"==Ga&&null!=Za&&null!=Za.width&&null!=Za.height&&(Ya=mxRectangle.fromRectangle(Ya),Ya.add(new mxRectangle((Ta.x+Za.x)*bb,(Ta.y+Za.y)*bb,Za.width*bb,Za.height*bb)));if(null==Ya)throw Error(mxResources.get("drawingEmpty"));F=A/bb;var ib=Math.max(1,Math.ceil(Ya.width*F)+2*B)+(ea&&0==B?5:0),nb=Math.max(1,Math.ceil(Ya.height*F)+2*B)+(ea&&0==B?5:0),Wa=mxUtils.getLightDarkColor(t),cb=Graph.createSvgNode(0,0,ib,nb,Wa),lb=cb.ownerDocument;if(null!=t){var gb=mxUtils.createElementNs(lb,mxConstants.NS_SVG,"rect");gb.setAttribute("fill",Wa.light);gb.style.fill=Wa.cssText;gb.setAttribute("width","100%");gb.setAttribute("height","100%");gb.setAttribute("x","0");gb.setAttribute("y","0");cb.appendChild(gb)}var sb=mxUtils.createElementNs(lb,mxConstants.NS_SVG,"g");cb.appendChild(sb);var hb=this.createSvgCanvas(sb),Yb=Math.floor(B/A-Ya.x/bb),Vb=Math.floor(B/A-Ya.y/bb);hb.translate(Yb,Vb);hb.idPrefix="drawio-svg-"+Editor.guid();if(Ia){var Wb=this.gridSize*A,Nb=this.view.gridSteps*Wb;t=[];for(Ka=1;Ka<this.view.gridSteps;Ka++)B=Ka*Wb,t.push("M 0 "+B+" L "+Nb+" "+B+" M "+B+" 0 L "+B+" "+Nb);var Xb=mxUtils.getLightDarkColor(this.view.gridColor),Jb=mxUtils.createElementNs(lb,mxConstants.NS_SVG,"pattern");Jb.setAttribute("id",hb.idPrefix+"-grid");Jb.setAttribute("patternUnits","userSpaceOnUse");Jb.setAttribute("width",Nb);Jb.setAttribute("height",Nb);Jb.setAttribute("x",mxUtils.mod((Ta.x+Yb)*A,Nb));Jb.setAttribute("y",mxUtils.mod((Ta.y+Vb)*A,Nb));if(0<t.length){var d=mxUtils.createElementNs(lb,mxConstants.NS_SVG,"path");d.setAttribute("d",t.join(" "));d.setAttribute("fill","none");d.setAttribute("stroke",Xb.light);d.style.stroke=Xb.cssText;d.setAttribute("opacity","0.2");d.setAttribute("stroke-width",A);Jb.appendChild(d)}var m=mxUtils.createElementNs(lb,mxConstants.NS_SVG,"path");m.setAttribute("d","M "+Nb+" 0 L 0 0 0 "+Nb);m.setAttribute("fill","none");m.setAttribute("stroke",Xb.light);m.style.stroke=Xb.cssText;m.setAttribute("stroke-width",A);Jb.appendChild(m);hb.defs.appendChild(Jb);var r=mxUtils.createElementNs(lb,mxConstants.NS_SVG,"rect");r.setAttribute("width","100%");r.setAttribute("height","100%");r.setAttribute("fill","url(#"+Jb.getAttribute("id")+")");cb.insertBefore(r,sb)}var n=document.createElement("div"),q=hb.getAlternateText;hb.getAlternateText=function(va,Xa,La,qa,ta,xa,Ba,Na,Qa,Ra,Sa,$b,ac){if(null!=xa&&0<this.state.fontSize)try{return mxUtils.isNode(xa)?xa=xa.innerText:(n.innerHTML=xa,xa=mxUtils.extractTextWithWhitespace(n.childNodes)),-xa}catch(Zb){return q.apply(this,arguments)}else return q.apply(this,arguments)};if(null!=Za&&null!=Za.width&&null!=Za.height){Ka=bb/A;var v=new mxRectangle((Za.x+Ta.x)*Ka,(Za.y+Ta.y)*Ka,Za.width*Ka,Za.height*Ka);mxUtils.intersects(Ya,v)&&hb.image(Za.x+Ta.x,Za.y+Ta.y,Za.width,Za.height,Za.src,!0)}hb.scale(F);hb.textEnabled=R;ea=null!=ea?ea:this.createSvgImageExport();var y=ea.getLinkForCellState;ea.getLinkForCellState=function(va,Xa){var La=va.view.graph.getAbsoluteUrl(y.apply(this,arguments));return null==-La||va.view.graph.isCustomLink(La)?null:La};ea.getLinkTargetForCellState=function(va,Xa){return va.view.graph.getLinkTargetForCell(va.cell)};var J=ea.drawCellState,C=null,ba=mxUtils.bind(this,function(){if(null==C){C="ge-flow-animation-"+Editor.guid();var va=null!=lb.createElementNS?lb.createElementNS(mxConstants.NS_SVG,"style"):lb.createElement("style");va.innerHTML=this.createFlowAnimationCss(C);lb.getElementsByTagName("defs")[0].appendChild(va)}return C});ea.drawCellState=function(va,Xa){for(var La=+xa}catch(Zb){return q.apply(this,arguments)}else return q.apply(this,arguments)};if(null!=Za&&null!=Za.width&&null!=Za.height){Ka=bb/A;var v=new mxRectangle((Za.x+Ta.x)*Ka,(Za.y+Ta.y)*Ka,Za.width*Ka,Za.height*Ka);mxUtils.intersects(Ya,v)&&hb.image(Za.x+Ta.x,Za.y+Ta.y,Za.width,Za.height,Za.src,!0)}hb.scale(F);hb.textEnabled=R;da=null!=da?da:this.createSvgImageExport();var y=da.getLinkForCellState;da.getLinkForCellState=function(va,Xa){var La=va.view.graph.getAbsoluteUrl(y.apply(this,arguments));return null==+La||va.view.graph.isCustomLink(La)?null:La};da.getLinkTargetForCellState=function(va,Xa){return va.view.graph.getLinkTargetForCell(va.cell)};var J=da.drawCellState,C=null,ba=mxUtils.bind(this,function(){if(null==C){C="ge-flow-animation-"+Editor.guid();var va=null!=lb.createElementNS?lb.createElementNS(mxConstants.NS_SVG,"style"):lb.createElement("style");va.innerHTML=this.createFlowAnimationCss(C);lb.getElementsByTagName("defs")[0].appendChild(va)}return C});da.drawCellState=function(va,Xa){for(var La=va.view.graph,qa=null!=Ca?Ca.get(va.cell):La.isCellSelected(va.cell),ta=La.model.getParent(va.cell);!(O&&null==Ca||qa)&&null!=ta;)qa=null!=Ca?Ca.get(ta):La.isCellSelected(ta),ta=La.model.getParent(ta);if(null!=va.shape)try{var xa=va.shape.isFlowAnimationEnabled,Ba=va.shape.addFlowAnimationToShape;va.shape.isFlowAnimationEnabled=function(){return Da&&La.model.isEdge(va.cell)&&"1"==mxUtils.getValue(va.style,"flowAnimation","0")};va.shape.addFlowAnimationToShape=function(){La.addFlowAnimationToNode(this.getFlowAnimationPath(),-va.style,A,ba())};if(O&&null==Ca||qa)La.view.redrawEnumerationState(va),J.apply(this,arguments),this.doDrawShape(va.secondLabel,Xa)}finally{va.shape.isFlowAnimationEnabled=xa,va.shape.addFlowAnimationToShape=Ba}};var P=null!=this.view.currentRoot?this.view.currentRoot:this.model.root;ea.drawState(this.getView().getState(P),hb);this.addForeignObjectWarning(hb,cb);Graph.inlineSingleUseImages(cb);Graph.replaceFontElements(cb);Graph.addAdaptiveColors(cb,this.shapeBackgroundColor);ya?this.disableSvgLinks(cb):+va.style,A,ba())};if(O&&null==Ca||qa)La.view.redrawEnumerationState(va),J.apply(this,arguments),this.doDrawShape(va.secondLabel,Xa)}finally{va.shape.isFlowAnimationEnabled=xa,va.shape.addFlowAnimationToShape=Ba}};var P=null!=this.view.currentRoot?this.view.currentRoot:this.model.root;da.drawState(this.getView().getState(P),hb);this.addForeignObjectWarning(hb,cb);Graph.inlineSingleUseImages(cb);Graph.replaceFontElements(cb);Graph.addAdaptiveColors(cb,this.shapeBackgroundColor);ya?this.disableSvgLinks(cb):this.updateSvgLinks(cb,ia,!0);return cb}finally{this.enableFlowAnimation=Da,I&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(t,A){if("0"!=urlParams["svg-warning"]&&0<A.getElementsByTagName("foreignObject").length){var B=t.createElement("switch"),F=t.createElement("g");F.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var I=t.createElement("a");I.setAttribute("transform","translate(0,-5)");null==I.setAttributeNS||A.ownerDocument!=document&&null==document.documentMode?(I.setAttribute("xlink:href",Graph.foreignObjectWarningLink),I.setAttribute("target","_blank")):(I.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Graph.foreignObjectWarningLink),I.setAttributeNS(mxConstants.NS_XLINK,"target","_blank"));t=t.createElement("text");t.setAttribute("text-anchor","middle");t.setAttribute("font-size","10px");t.setAttribute("x","50%");t.setAttribute("y","100%");mxUtils.write(t,Graph.foreignObjectWarningText);B.appendChild(F);I.appendChild(t);B.appendChild(I);A.appendChild(B)}};Graph.prototype.disableSvgLinks=function(t,A){t=t.getElementsByTagName("a");for(var B=0;B<t.length;B++){var F=t[B].getAttribute("href");null==F&&(F=t[B].getAttribute("xlink:href"));null!=F&&(t[B].style.pointerEvents="none",t[B].setAttribute("href",""));A&&A(t[B])}};Graph.prototype.updateSvgLinks=function(t,A,B){t=t.getElementsByTagName("a");for(var F=0;F<t.length;F++)if(null==t[F].getAttribute("target")){var I=t[F].getAttribute("href");@@ -3205,45 +3205,45 @@ this.imageSymbols,A,B)};return t};Graph.prototype.getSelectedElement=function(){Graph.prototype.getParentByName=function(t,A,B){for(;null!=t&&t.nodeName!=A;){if(t==B)return null;t=t.parentNode}return t};Graph.prototype.getParentByNames=function(t,A,B){for(;null!=t&&!(0<=mxUtils.indexOf(A,t.nodeName));){if(t==B)return null;t=t.parentNode}return t};Graph.prototype.selectNode=function(t){var A=null;if(window.getSelection){if(A=window.getSelection(),A.getRangeAt&&A.rangeCount){var B=document.createRange();B.selectNode(t);A.removeAllRanges();A.addRange(B)}}else(A=document.selection)&&"Control"!=A.type&&(t=A.createRange(),t.collapse(!0),B=A.createRange(),B.setEndPoint("StartToStart",t),B.select())};Graph.prototype.flipEdgePoints=function(t,A,B){var F=this.getCellGeometry(t);if(null!=F){F=F.clone();if(null!=F.points)for(var I=0;I<F.points.length;I++)A?F.points[I].x=B+(B-F.points[I].x):F.points[I].y=B+(B-F.points[I].y);I=function(O){null!=O&&(A?O.x=B+(B-O.x):O.y=B+(B-O.y))};I(F.getTerminalPoint(!0));I(F.getTerminalPoint(!1));this.model.setGeometry(t,F)}};Graph.prototype.flipChildren=function(t,A,B){this.model.beginUpdate();try{for(var F=this.model.getChildCount(t),I=0;I<F;I++){var O=this.model.getChildAt(t,I);if(this.model.isEdge(O))this.flipEdgePoints(O,A,B);else{var R=this.getCellGeometry(O);null!=R&&(R=R.clone(),A?R.x=B+(B-R.x-R.width):R.y=B+(B-R.y-R.height),this.model.setGeometry(O,R))}}}finally{this.model.endUpdate()}};Graph.prototype.getConnectionPoint=function(t,A,B){return null!=t&&1==mxUtils.getValue(t.style,"legacyAnchorPoints",1)?this.getLegacyConnectionPoint(t,A,-B):mxGraph.prototype.getConnectionPoint.apply(this,arguments)};Graph.prototype.getLegacyConnectionPoint=function(t,A,B){B=null!=B?B:!0;var F=null;if(null!=t&&null!=A.point){var I=this.view.getPerimeterBounds(t),O=new mxPoint(I.getCenterX(),I.getCenterY()),R=t.style[mxConstants.STYLE_DIRECTION],ea=0;null!=R&&1==mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(R==mxConstants.DIRECTION_NORTH?ea+=270:R==mxConstants.DIRECTION_WEST?ea+=180:R==mxConstants.DIRECTION_SOUTH&&(ea+=90),-R!=mxConstants.DIRECTION_NORTH&&R!=mxConstants.DIRECTION_SOUTH||I.rotate90());F=this.view.scale;F=new mxPoint(I.x+A.point.x*I.width+A.dx*F,I.y+A.point.y*I.height+A.dy*F);var ia=t.style[mxConstants.STYLE_ROTATION]||0;if(A.perimeter)0!=ea&&(R=I=0,90==ea?R=1:180==ea?I=-1:270==ea&&(R=-1),F=mxUtils.getRotatedPoint(F,I,R,O)),F=this.view.getPerimeterPoint(t,F,!1);else if(ia+=ea,this.getModel().isVertex(t.cell)){ea=1==t.style[mxConstants.STYLE_FLIPH];A=1==t.style[mxConstants.STYLE_FLIPV];null!=t.shape&&null!=-t.shape.stencil&&(ea=1==mxUtils.getValue(t.style,"stencilFlipH",0)||ea,A=1==mxUtils.getValue(t.style,"stencilFlipV",0)||A);if(R==mxConstants.DIRECTION_NORTH||R==mxConstants.DIRECTION_SOUTH)t=ea,ea=A,A=t;ea&&(F.x=2*I.getCenterX()-F.x);A&&(F.y=2*I.getCenterY()-F.y)}0!=ia&&null!=F&&(t=mxUtils.toRadians(ia),I=Math.cos(t),R=Math.sin(t),F=mxUtils.getRotatedPoint(F,I,R,O))}B&&null!=F&&(F.x=Math.round(F.x),F.y=Math.round(F.y));return F};Graph.prototype.flipCells=function(t,A){this.model.beginUpdate();try{t=+B):mxGraph.prototype.getConnectionPoint.apply(this,arguments)};Graph.prototype.getLegacyConnectionPoint=function(t,A,B){B=null!=B?B:!0;var F=null;if(null!=t&&null!=A.point){var I=this.view.getPerimeterBounds(t),O=new mxPoint(I.getCenterX(),I.getCenterY()),R=t.style[mxConstants.STYLE_DIRECTION],da=0;null!=R&&1==mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(R==mxConstants.DIRECTION_NORTH?da+=270:R==mxConstants.DIRECTION_WEST?da+=180:R==mxConstants.DIRECTION_SOUTH&&(da+=90),+R!=mxConstants.DIRECTION_NORTH&&R!=mxConstants.DIRECTION_SOUTH||I.rotate90());F=this.view.scale;F=new mxPoint(I.x+A.point.x*I.width+A.dx*F,I.y+A.point.y*I.height+A.dy*F);var ia=t.style[mxConstants.STYLE_ROTATION]||0;if(A.perimeter)0!=da&&(R=I=0,90==da?R=1:180==da?I=-1:270==da&&(R=-1),F=mxUtils.getRotatedPoint(F,I,R,O)),F=this.view.getPerimeterPoint(t,F,!1);else if(ia+=da,this.getModel().isVertex(t.cell)){da=1==t.style[mxConstants.STYLE_FLIPH];A=1==t.style[mxConstants.STYLE_FLIPV];null!=t.shape&&null!=+t.shape.stencil&&(da=1==mxUtils.getValue(t.style,"stencilFlipH",0)||da,A=1==mxUtils.getValue(t.style,"stencilFlipV",0)||A);if(R==mxConstants.DIRECTION_NORTH||R==mxConstants.DIRECTION_SOUTH)t=da,da=A,A=t;da&&(F.x=2*I.getCenterX()-F.x);A&&(F.y=2*I.getCenterY()-F.y)}0!=ia&&null!=F&&(t=mxUtils.toRadians(ia),I=Math.cos(t),R=Math.sin(t),F=mxUtils.getRotatedPoint(F,I,R,O))}B&&null!=F&&(F.x=Math.round(F.x),F.y=Math.round(F.y));return F};Graph.prototype.flipCells=function(t,A){this.model.beginUpdate();try{t=this.model.getTopmostCells(t);for(var B=[],F=0;F<t.length;F++)if(this.model.isEdge(t[F])){var I=this.view.getState(t[F]);null!=I&&this.flipEdgePoints(t[F],A,(A?I.getCenterX():I.getCenterY())/this.view.scale-(A?I.origin.x:I.origin.y)-(A?this.view.translate.x:this.view.translate.y))}else{var O=this.getCellGeometry(t[F]);null!=O&&this.flipChildren(t[F],A,A?O.getCenterX()-O.x:O.getCenterY()-O.y);B.push(t[F])}this.toggleCellStyles(A?mxConstants.STYLE_FLIPH:mxConstants.STYLE_FLIPV,!1,B);this.setCellStyles("legacyAnchorPoints",-"0",B)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(t,A){var B=null;if(null!=t&&0<t.length){this.model.beginUpdate();try{for(var F=0;F<t.length;F++){var I=this.model.getParent(t[F]);if(this.isTable(I)){var O=this.getCellGeometry(t[F]),R=this.getCellGeometry(I);null!=O&&null!=R&&(R=R.clone(),R.height-=O.height,this.model.setGeometry(I,R))}}var ea=this.selectParentAfterDelete?this.model.getParents(t):null;this.removeCells(t,A)}finally{this.model.endUpdate()}if(null!=ea)for(B=-[],F=0;F<ea.length;F++)this.model.contains(ea[F])&&(this.model.isVertex(ea[F])||this.model.isEdge(ea[F]))&&B.push(ea[F])}return B};Graph.prototype.insertTableColumn=function(t,A){var B=this.getModel();B.beginUpdate();try{var F=t,I=0;if(this.isTableCell(t)){var O=B.getParent(t);F=B.getParent(O);I=mxUtils.indexOf(B.getChildCells(O,!0),t)}else this.isTableRow(t)?F=B.getParent(t):t=B.getChildCells(F,!0)[0],A||(I=B.getChildCells(t,!0).length-1);var R=B.getChildCells(F,!0),ea=Graph.minTableColumnWidth;-for(t=0;t<R.length;t++){var ia=B.getChildCells(R[t],!0)[I],da=B.cloneCell(ia,!1);null==da&&(da=this.createVertex());var za=this.getCellGeometry(da);da.value=null;da.style=mxUtils.setStyle(mxUtils.setStyle(da.style,"rowspan",null),"colspan",null);if(null!=za){null!=za.alternateBounds&&(za.width=za.alternateBounds.width,za.height=za.alternateBounds.height,za.alternateBounds=null);ea=za.width;var Fa=this.getCellGeometry(R[t]);null!=Fa&&(za.height=Fa.height)}B.add(R[t],da,I+(A?0:1))}var Ga=this.getCellGeometry(F);-null!=Ga&&(Ga=Ga.clone(),Ga.width+=ea,B.setGeometry(F,Ga))}finally{B.endUpdate()}};Graph.prototype.deleteLane=function(t){var A=this.getModel();A.beginUpdate();try{var B=null;B="stackLayout"==this.getCurrentCellStyle(t).childLayout?t:A.getParent(t);var F=A.getChildCells(B,!0);0==F.length?A.remove(B):(B==t&&(t=F[F.length-1]),A.remove(t))}finally{A.endUpdate()}};Graph.prototype.insertLane=function(t,A){var B=this.getModel();B.beginUpdate();try{var F=null;if("stackLayout"==this.getCurrentCellStyle(t).childLayout){F=-t;var I=B.getChildCells(F,!0);t=I[A?0:I.length-1]}else F=B.getParent(t);var O=F.getIndex(t);t=B.cloneCell(t,!1);t.value=null;B.add(F,t,O+(A?0:1))}finally{B.endUpdate()}};Graph.prototype.insertTableRow=function(t,A){var B=this.getModel();B.beginUpdate();try{var F=t,I=t;if(this.isTableCell(t))I=B.getParent(t),F=B.getParent(I);else if(this.isTableRow(t))F=B.getParent(t);else{var O=B.getChildCells(F,!0);I=O[A?0:O.length-1]}if(null!=I){var R=B.getChildCells(I,!0),ea=F.getIndex(I);I=B.cloneCell(I,!1);I.value=-null;var ia=this.getCellGeometry(I);if(null!=ia){for(O=0;O<R.length;O++){t=B.cloneCell(R[O],!1);t.value=null;t.style=mxUtils.setStyle(mxUtils.setStyle(t.style,"rowspan",null),"colspan",null);var da=this.getCellGeometry(t);null!=da&&(null!=da.alternateBounds&&(da.width=da.alternateBounds.width,da.height=da.alternateBounds.height,da.alternateBounds=null),da.height=ia.height);I.insert(t)}B.add(F,I,ea+(A?0:1));var za=this.getCellGeometry(F);null!=za&&(za=za.clone(),za.height+=ia.height,B.setGeometry(F,+"0",B)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(t,A){var B=null;if(null!=t&&0<t.length){this.model.beginUpdate();try{for(var F=0;F<t.length;F++){var I=this.model.getParent(t[F]);if(this.isTable(I)){var O=this.getCellGeometry(t[F]),R=this.getCellGeometry(I);null!=O&&null!=R&&(R=R.clone(),R.height-=O.height,this.model.setGeometry(I,R))}}var da=this.selectParentAfterDelete?this.model.getParents(t):null;this.removeCells(t,A)}finally{this.model.endUpdate()}if(null!=da)for(B=+[],F=0;F<da.length;F++)this.model.contains(da[F])&&(this.model.isVertex(da[F])||this.model.isEdge(da[F]))&&B.push(da[F])}return B};Graph.prototype.insertTableColumn=function(t,A){var B=this.getModel();B.beginUpdate();try{var F=t,I=0;if(this.isTableCell(t)){var O=B.getParent(t);F=B.getParent(O);I=mxUtils.indexOf(B.getChildCells(O,!0),t)}else this.isTableRow(t)?F=B.getParent(t):t=B.getChildCells(F,!0)[0],A||(I=B.getChildCells(t,!0).length-1);var R=B.getChildCells(F,!0),da=Graph.minTableColumnWidth;+for(t=0;t<R.length;t++){var ia=B.getChildCells(R[t],!0)[I],ea=B.cloneCell(ia,!1);null==ea&&(ea=this.createVertex());var za=this.getCellGeometry(ea);ea.value=null;ea.style=mxUtils.setStyle(mxUtils.setStyle(ea.style,"rowspan",null),"colspan",null);if(null!=za){null!=za.alternateBounds&&(za.width=za.alternateBounds.width,za.height=za.alternateBounds.height,za.alternateBounds=null);da=za.width;var Fa=this.getCellGeometry(R[t]);null!=Fa&&(za.height=Fa.height)}B.add(R[t],ea,I+(A?0:1))}var Ga=this.getCellGeometry(F);+null!=Ga&&(Ga=Ga.clone(),Ga.width+=da,B.setGeometry(F,Ga))}finally{B.endUpdate()}};Graph.prototype.deleteLane=function(t){var A=this.getModel();A.beginUpdate();try{var B=null;B="stackLayout"==this.getCurrentCellStyle(t).childLayout?t:A.getParent(t);var F=A.getChildCells(B,!0);0==F.length?A.remove(B):(B==t&&(t=F[F.length-1]),A.remove(t))}finally{A.endUpdate()}};Graph.prototype.insertLane=function(t,A){var B=this.getModel();B.beginUpdate();try{var F=null;if("stackLayout"==this.getCurrentCellStyle(t).childLayout){F=+t;var I=B.getChildCells(F,!0);t=I[A?0:I.length-1]}else F=B.getParent(t);var O=F.getIndex(t);t=B.cloneCell(t,!1);t.value=null;B.add(F,t,O+(A?0:1))}finally{B.endUpdate()}};Graph.prototype.insertTableRow=function(t,A){var B=this.getModel();B.beginUpdate();try{var F=t,I=t;if(this.isTableCell(t))I=B.getParent(t),F=B.getParent(I);else if(this.isTableRow(t))F=B.getParent(t);else{var O=B.getChildCells(F,!0);I=O[A?0:O.length-1]}if(null!=I){var R=B.getChildCells(I,!0),da=F.getIndex(I);I=B.cloneCell(I,!1);I.value=+null;var ia=this.getCellGeometry(I);if(null!=ia){for(O=0;O<R.length;O++){t=B.cloneCell(R[O],!1);t.value=null;t.style=mxUtils.setStyle(mxUtils.setStyle(t.style,"rowspan",null),"colspan",null);var ea=this.getCellGeometry(t);null!=ea&&(null!=ea.alternateBounds&&(ea.width=ea.alternateBounds.width,ea.height=ea.alternateBounds.height,ea.alternateBounds=null),ea.height=ia.height);I.insert(t)}B.add(F,I,da+(A?0:1));var za=this.getCellGeometry(F);null!=za&&(za=za.clone(),za.height+=ia.height,B.setGeometry(F,za))}}else if(za=this.getCellGeometry(F),null!=za){var Fa=za.width;I=this.createVertex(null,null,"",0,0,Fa,40,"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fixedHeader=1;");I.insert(this.createVertex(null,null,"",0,0,Fa,40,"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;"));-B.add(F,I);za=za.clone();za.height+=40;B.setGeometry(F,za)}}finally{B.endUpdate()}};Graph.prototype.deleteTableColumn=function(t){var A=this.getModel();A.beginUpdate();try{var B=t,F=t;this.isTableCell(t)&&(F=A.getParent(t));this.isTableRow(F)&&(B=A.getParent(F));var I=A.getChildCells(B,!0);if(0==I.length)A.remove(B);else{this.isTableRow(F)||(F=I[0]);var O=A.getChildCells(F,!0);if(1>=O.length)A.remove(B);else{var R=O.length-1;this.isTableCell(t)&&(R=mxUtils.indexOf(O,t));for(F=t=0;F<I.length;F++){var ea=-A.getChildCells(I[F],!0)[R];A.remove(ea);var ia=this.getCellGeometry(ea);null!=ia&&(t=Math.max(t,ia.width))}var da=this.getCellGeometry(B);null!=da&&(da=da.clone(),da.width-=t,A.setGeometry(B,da))}}}finally{A.endUpdate()}};Graph.prototype.deleteTableRow=function(t){var A=this.getModel();A.beginUpdate();try{var B=t,F=t;this.isTableCell(t)&&(t=F=A.getParent(t));this.isTableRow(t)&&(B=A.getParent(F));var I=A.getChildCells(B,!0);if(1>=I.length)A.remove(B);else{this.isTableRow(F)||(F=I[I.length-1]);A.remove(F);+B.add(F,I);za=za.clone();za.height+=40;B.setGeometry(F,za)}}finally{B.endUpdate()}};Graph.prototype.deleteTableColumn=function(t){var A=this.getModel();A.beginUpdate();try{var B=t,F=t;this.isTableCell(t)&&(F=A.getParent(t));this.isTableRow(F)&&(B=A.getParent(F));var I=A.getChildCells(B,!0);if(0==I.length)A.remove(B);else{this.isTableRow(F)||(F=I[0]);var O=A.getChildCells(F,!0);if(1>=O.length)A.remove(B);else{var R=O.length-1;this.isTableCell(t)&&(R=mxUtils.indexOf(O,t));for(F=t=0;F<I.length;F++){var da=+A.getChildCells(I[F],!0)[R];A.remove(da);var ia=this.getCellGeometry(da);null!=ia&&(t=Math.max(t,ia.width))}var ea=this.getCellGeometry(B);null!=ea&&(ea=ea.clone(),ea.width-=t,A.setGeometry(B,ea))}}}finally{A.endUpdate()}};Graph.prototype.deleteTableRow=function(t){var A=this.getModel();A.beginUpdate();try{var B=t,F=t;this.isTableCell(t)&&(t=F=A.getParent(t));this.isTableRow(t)&&(B=A.getParent(F));var I=A.getChildCells(B,!0);if(1>=I.length)A.remove(B);else{this.isTableRow(F)||(F=I[I.length-1]);A.remove(F);t=0;var O=this.getCellGeometry(F);null!=O&&(t=O.height);var R=this.getCellGeometry(B);null!=R&&(R=R.clone(),R.height-=t,A.setGeometry(B,R))}}finally{A.endUpdate()}};Graph.prototype.insertRow=function(t,A){for(var B=t.tBodies[0],F=B.rows[0].cells,I=t=0;I<F.length;I++){var O=F[I].getAttribute("colspan");t+=null!=O?parseInt(O):1}A=B.insertRow(A);for(I=0;I<t;I++)mxUtils.br(A.insertCell(-1));return A.cells[0]};Graph.prototype.deleteRow=function(t,A){t.tBodies[0].deleteRow(A)};Graph.prototype.insertColumn=function(t,A){var B=t.tHead;if(null!=B)for(var F=0;F<B.rows.length;F++){var I=document.createElement("th");B.rows[F].appendChild(I);mxUtils.br(I)}t=t.tBodies[0];for(B=0;B<t.rows.length;B++)F=t.rows[B].insertCell(A),mxUtils.br(F);return t.rows[0].cells[0<=A?A:t.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(t,A){if(0<=A){t=t.tBodies[0].rows;for(var B=0;B<t.length;B++)t[B].cells.length>A&&t[B].deleteCell(A)}};Graph.prototype.pasteHtmlAtCaret=function(t){if(window.getSelection){var A=window.getSelection();if(A.getRangeAt&&A.rangeCount){A=A.getRangeAt(0);A.deleteContents();var B=document.createElement("div");B.innerHTML=t;t=document.createDocumentFragment();for(var F;F=B.firstChild;)lastNode=t.appendChild(F);A.insertNode(t)}}else(A=document.selection)&&"Control"!=A.type&&A.createRange().pasteHTML(t)};Graph.prototype.createLinkForHint=function(t,A,B){function F(O,R){O.length>R&&(O=O.substring(0,Math.round(R/2))+"..."+O.substring(O.length-Math.round(R/4)));return O}t=null!=t?t:"javascript:void(0);";if(null==A||0==A.length)A=this.isCustomLink(t)?this.getLinkTitle(t):t;var I=document.createElement("a");I.setAttribute("rel",this.linkRelation);I.setAttribute("href",this.getAbsoluteUrl(t));I.setAttribute("title",F(this.isCustomLink(t)?this.getLinkTitle(t):t,80));null!=this.linkTarget&&I.setAttribute("target",this.linkTarget);mxUtils.write(I,F(A,40));this.isCustomLink(t)&&mxEvent.addListener(I,"click",mxUtils.bind(this,function(O){this.customLinkClicked(t,B);mxEvent.consume(O)}));return I};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(O,R){this.popupMenuHandler.hideMenu()});var t=this.updateMouseEvent;this.updateMouseEvent=function(O){O=t.apply(this,arguments);if(mxEvent.isTouchEvent(O.getEvent())&&null==O.getState()){var R=this.getCellAt(O.graphX,O.graphY);null!=R&&this.isSwimlane(R)&&this.hitsSwimlaneContent(R,O.graphX,O.graphY)||(O.state=this.view.getState(R),null!=O.state&&-null!=O.state.shape&&(this.container.style.cursor=O.state.shape.node.style.cursor))}null==O.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return O};var A=!1,B=!1,F=!1,I=this.fireMouseEvent;this.fireMouseEvent=function(O,R,ea){O==mxEvent.MOUSE_DOWN&&(R=this.updateMouseEvent(R),A=this.isCellSelected(R.getCell()),B=this.isSelectionEmpty(),F=this.popupMenuHandler.isMenuShowing());I.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(O,R){if(null!=this.freehand&&-!this.freehand.isDrawing()){var ea=mxEvent.isMouseEvent(R.getEvent());this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==R.getState()||!R.isSource(R.getState().control))&&(this.popupMenuHandler.popupTrigger||!F&&!ea&&(B&&null==R.getCell()&&this.isSelectionEmpty()||A&&this.isCellSelected(R.getCell())));ea=!A||ea?null:mxUtils.bind(this,function(ia){window.setTimeout(mxUtils.bind(this,function(){if(!this.isEditing()&&this.isTouchPopupMenuEnabled()){var da=mxUtils.getScrollOrigin();-this.popupMenuHandler.popup(R.getX()+da.x+1,R.getY()+da.y+1,ia,R.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[O,R,ea])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0};mxCellEditor.prototype.isContentEditing=function(){var t=this.graph.view.getState(this.editingCell);return null!=t&&1==t.style.html};mxCellEditor.prototype.isTableSelected=function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};+null!=O.state.shape&&(this.container.style.cursor=O.state.shape.node.style.cursor))}null==O.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return O};var A=!1,B=!1,F=!1,I=this.fireMouseEvent;this.fireMouseEvent=function(O,R,da){O==mxEvent.MOUSE_DOWN&&(R=this.updateMouseEvent(R),A=this.isCellSelected(R.getCell()),B=this.isSelectionEmpty(),F=this.popupMenuHandler.isMenuShowing());I.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(O,R){if(null!=this.freehand&&+!this.freehand.isDrawing()){var da=mxEvent.isMouseEvent(R.getEvent());this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==R.getState()||!R.isSource(R.getState().control))&&(this.popupMenuHandler.popupTrigger||!F&&!da&&(B&&null==R.getCell()&&this.isSelectionEmpty()||A&&this.isCellSelected(R.getCell())));da=!A||da?null:mxUtils.bind(this,function(ia){window.setTimeout(mxUtils.bind(this,function(){if(!this.isEditing()&&this.isTouchPopupMenuEnabled()){var ea=mxUtils.getScrollOrigin();+this.popupMenuHandler.popup(R.getX()+ea.x+1,R.getY()+ea.y+1,ia,R.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[O,R,da])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0};mxCellEditor.prototype.isContentEditing=function(){var t=this.graph.view.getState(this.editingCell);return null!=t&&1==t.style.html};mxCellEditor.prototype.isTableSelected=function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};mxCellEditor.prototype.isTextSelected=function(){var t="";window.getSelection?t=window.getSelection():document.getSelection?t=document.getSelection():document.selection&&(t=document.selection.createRange().text);return""!=t};mxCellEditor.prototype.insertTab=function(t){var A=this.textarea.ownerDocument.defaultView.getSelection(),B=A.getRangeAt(0);t=Graph.createTabNode(t);B.insertNode(t);B.setStartAfter(t);B.setEndAfter(t);A.removeAllRanges();A.addRange(B)};mxCellEditor.prototype.alignText=function(t,A){var B=this.graph.getView().getState(this.editingCell);if(null!=B){B=mxUtils.getValue(B.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);var F=null!=B&&"vertical-"==B.substring(0,9),I=null!=A&&mxEvent.isShiftDown(A);if(I||null!=window.getSelection&&null!=window.getSelection().containsNode){var O=!0;this.graph.processElements(this.textarea,function(R){I||F||window.getSelection().containsNode(R,!0)?(R.removeAttribute("align"),R.style.textAlign=null):O=!1});(O||F)&&this.graph.cellEditor.setAlign(t)}F||document.execCommand("justify"+t.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var t=window.getSelection();if(t.getRangeAt&&t.rangeCount){for(var A=[],B=0,F=t.rangeCount;B<F;++B)A.push(t.getRangeAt(B));return A}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(t){try{if(t)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var A=0,B=t.length;A<B;++A)sel.addRange(t[A])}else document.selection&&t.select&&t.select()}catch(F){}};var na=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(t){null!=t.text&&(t.text.replaceLinefeeds="0"!=mxUtils.getValue(t.style,"nl2Br","1"));na.apply(this,arguments)};var fa=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(t,A){this.isKeepFocusEvent(t)||!mxEvent.isAltDown(t.getEvent())?fa.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(t){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var ja=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(t,A){t=this.graph.getStartEditingCell(t,A);ja.apply(this,arguments);var B=this.graph.view.getState(t);this.textarea.className=null!=B&&1==B.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";Graph.browserTranslate&&(this.textarea.classList.add("notranslate"),this.textarea.setAttribute("translate","no"));this.textarea.style.colorScheme="none"==this.graph.getAdaptiveColors()?"light":"";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(t);null!=this.editingCell&&null!=this.textarea&&null!=this.textarea.parentNode&&null!=B&&this.graph.isAutosizeTextState(B)&&this.resize()};mxCellEditor.prototype.toggleViewMode=function(){var t=this.graph.view.getState(this.editingCell);if(null!=t){var A=-null!=t&&"0"!=mxUtils.getValue(t.style,"nl2Br","1"),B=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);ea=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<ea.length&&"\n"==ea.charAt(ea.length-1)&&(ea=ea.substring(0,ea.length-1));ea=Graph.sanitizeHtml(A?ea.replace(/\n/g,"<br/>"):ea,!0);this.textarea.className="mxCellEditor geContentEditable";ia=mxUtils.getValue(t.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);+null!=t&&"0"!=mxUtils.getValue(t.style,"nl2Br","1"),B=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);da=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<da.length&&"\n"==da.charAt(da.length-1)&&(da=da.substring(0,da.length-1));da=Graph.sanitizeHtml(A?da.replace(/\n/g,"<br/>"):da,!0);this.textarea.className="mxCellEditor geContentEditable";ia=mxUtils.getValue(t.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);A=mxUtils.getValue(t.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var F=mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),I=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,O=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,R=[];(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&R.push("underline");(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&R.push("line-through");0<R.length&&(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&R.push("dotted");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(ia*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(ia)+"px";this.textarea.style.textDecoration=-R.join(" ");this.textarea.style.fontWeight=I?"bold":"normal";this.textarea.style.fontStyle=O?"italic":"";this.textarea.style.fontFamily=A;this.textarea.style.textAlign=F;this.textarea.style.padding="0px";this.textarea.innerHTML!=ea&&(this.textarea.innerHTML=ea,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors());-this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerText="");Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var ea=mxUtils.htmlEntities(this.textarea.innerHTML);8!=document.documentMode&&(ea=mxUtils.replaceTrailingNewlines(ea,"<div><br></div>"));ea=Graph.sanitizeHtml(A?ea.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):ea,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var ia=+R.join(" ");this.textarea.style.fontWeight=I?"bold":"normal";this.textarea.style.fontStyle=O?"italic":"";this.textarea.style.fontFamily=A;this.textarea.style.textAlign=F;this.textarea.style.padding="0px";this.textarea.innerHTML!=da&&(this.textarea.innerHTML=da,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors());+this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerText="");Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var da=mxUtils.htmlEntities(this.textarea.innerHTML);8!=document.documentMode&&(da=mxUtils.replaceTrailingNewlines(da,"<div><br></div>"));da=Graph.sanitizeHtml(A?da.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):da,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var ia=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(ia*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(ia)+"px";this.textarea.style.textDecoration="";this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.width="";this.textarea.style.padding="2px";this.textarea.innerHTML!=-ea&&(this.textarea.innerHTML=ea);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=B;this.resize()}};var W=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(t,A){if(null!=this.textarea)if(t=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=t){var B=t.view.scale;this.bounds=mxRectangle.fromRectangle(t);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=+da&&(this.textarea.innerHTML=da);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=B;this.resize()}};var W=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(t,A){if(null!=this.textarea)if(t=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=t){var B=t.view.scale;this.bounds=mxRectangle.fromRectangle(t);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*B;this.bounds.height=60*B;var F=null!=t.text?t.text.margin:null;null==F&&(F=mxUtils.getAlignmentAsPoint(mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=F.x*this.bounds.width;this.bounds.y+=F.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/B)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/B)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/B)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*B);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/B)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*B);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px";mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+B+","+B+")")}else if(null!=t&&this.graph.isAutosizeTextState(t)){B=t.view.scale;F=t.style;var I=this.graph.getCellGeometry(this.editingCell);if(null!=I){this.bounds=mxRectangle.fromRectangle(t);this.textarea.style.left=Math.round(t.x)+"px";this.textarea.style.top=Math.round(t.y)+"px";var O=this.rotateText&&null!=this.textShape?this.textShape.getTextRotation():0;mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform",(0!=O?"rotate("+O+"deg) ":"")+"scale("+B+","+B+")");this.textarea.style.borderWidth="0";this.textarea.style.width=Math.round(I.width+mxSvgCanvas2D.prototype.foreignObjectPadding)+"px";this.textarea.style.height=Math.round(I.height)+"px";this.textarea.style.overflow="hidden";this.textarea.style.boxSizing="border-box";"wrap"==F[mxConstants.STYLE_WHITE_SPACE]&&(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace=-"normal");var R=parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING,2));B=R+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_TOP,0));O=R+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_BOTTOM,0));var ea=R+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_LEFT,0));R+=parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_RIGHT,0));this.textarea.style.paddingLeft=Math.round(ea)+"px";this.textarea.style.paddingRight=Math.round(R)+"px";this.textarea.style.paddingTop=Math.round(B)+"px";+"normal");var R=parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING,2));B=R+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_TOP,0));O=R+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_BOTTOM,0));var da=R+parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_LEFT,0));R+=parseInt(mxUtils.getValue(F,mxConstants.STYLE_SPACING_RIGHT,0));this.textarea.style.paddingLeft=Math.round(da)+"px";this.textarea.style.paddingRight=Math.round(R)+"px";this.textarea.style.paddingTop=Math.round(B)+"px";this.textarea.style.paddingBottom=Math.round(O)+"px";this.textarea.style.display="table-cell";this.textarea.style.flexDirection="";this.textarea.style.justifyContent="";B=mxUtils.getValue(F,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);this.textarea.style.verticalAlign=B==mxConstants.ALIGN_MIDDLE?"middle":B==mxConstants.ALIGN_BOTTOM?"bottom":"top";B=this.textarea.innerText;null!=B&&0<B.length&&(I=this.graph.getAutosizeTextAvailableSpace(F,I.width,I.height,t),null!=I&&(B=mxUtils.htmlEntities(B,!1).replace(/\n/g,"<br>"),F=this.graph.computeAutosizeTextFontSize(B,I.availW,I.availH,F[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,F[mxConstants.STYLE_FONTSTYLE],"wrap"==F[mxConstants.STYLE_WHITE_SPACE]),this.textarea.style.fontSize=F+"px",this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?F*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT))}}else this.textarea.style.width="",this.textarea.style.height="",this.textarea.style.overflow="",this.textarea.style.boxSizing="",this.textarea.style.borderWidth="",this.textarea.style.paddingTop="",this.textarea.style.paddingBottom="",this.textarea.style.paddingLeft="",this.textarea.style.paddingRight="",this.textarea.style.display="",this.textarea.style.flexDirection="",this.textarea.style.justifyContent="",this.textarea.style.verticalAlign="",W.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(t,A){if("0"==mxUtils.getValue(t.style,@@ -3253,60 +3253,61 @@ this.graph.getAdaptiveColors())};mxCellEditorGetCurrentValue=mxCellEditor.prototmxCellEditor.prototype.applyValue=function(t,A){this.graph.getModel().beginUpdate();try{ma.apply(this,arguments),""==A&&this.graph.isCellDeletable(t.cell)&&0==this.graph.model.getChildCount(t.cell)&&this.graph.isTransparentState(t)&&this.graph.removeCells([t.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(t){t=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);t==mxConstants.NONE&&(t=null);return t};mxCellEditor.prototype.getBorderColor=function(t){t=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);t==mxConstants.NONE&&(t=null);return t};mxCellEditor.prototype.getMinimumSize=function(t){var A=this.graph.getView().scale;return new mxRectangle(0,0,null==t.text?30:t.text.size*A+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(t,A){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(A.getEvent)};var ha=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(t){var A=ha.apply(this,arguments);if(null!=A){var B=this.graph.getLockedGroupAncestor(this.graph.model.getParent(A));null!=B&&(A=B)}return A};var N=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(t,A,B){var F=this.graph.model.getParent(t);if(null!=F){if(this.graph.isSelectParentFirst(F))return!this.graph.isCellSelected(F)&&!this.graph.isSiblingSelected(t);-if(this.graph.isTransparentBounds(F))return!1}return N.apply(this,arguments)};var Y=mxConstraintHandler.prototype.getCellForEvent;mxConstraintHandler.prototype.getCellForEvent=function(t,A){var B=Y.apply(this,arguments);if(null!=B&&(null==this.currentFocus||this.currentFocus.cell!=B)){var F=this.graph.getBorderContainer(B,null!=A?A.x:t.getGraphX(),null!=A?A.y:t.getGraphY());null!=F&&(B=F)}return B};var X=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=-function(){for(var t=X.apply(this,arguments),A=this.graph,B=new mxDictionary,F=[],I=0;I<t.length;I++)null==B.get(t[I])&&(B.put(t[I],!0),F.push(t[I]));for(I=0;I<t.length;I++)for(var O=A.model.getParent(t[I]);null!=O&&A.isTransparentBounds(O);)null==B.get(O)&&(B.put(O,!0),F.push(O)),O=A.model.getParent(O);return F};mxGraphView.prototype.formatUnitText=function(t){return t?b(t,this.unit):t};mxGraphHandler.prototype.updateHint=function(t){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==-this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var A=this.graph.view.translate,B=this.graph.view.scale;t=this.roundLength((this.bounds.x+this.currentDx)/B-A.x);A=this.roundLength((this.bounds.y+this.currentDy)/B-A.y);B=this.graph.view.unit;this.hint.innerHTML=b(t,B)+", "+b(A,B);this.hint.style.left=this.pBounds.x+this.currentDx+Math.round((this.pBounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.pBounds.y+this.currentDy+this.pBounds.height+Editor.hintOffset+-"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(null!=this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint),this.hint=null)};var L=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(t,A){L.apply(this,arguments);var B=this.graph.getCellStyle(t);if(null==B.childLayout){var F=this.graph.model.getParent(t),I=null!=F?this.graph.getCellGeometry(F):null;if(null!=I&&(B=this.graph.getCellStyle(F),"stackLayout"==B.childLayout)){var O=parseFloat(mxUtils.getValue(B,-"stackBorder",mxStackLayout.prototype.border));B="1"==mxUtils.getValue(B,"horizontalStack","1");var R=this.graph.getActualStartSize(F);I=I.clone();B?I.height=A.height+R.y+R.height+2*O:I.width=A.width+R.x+R.width+2*O;this.graph.model.setGeometry(F,I)}}};var V=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function t(ea){B.get(ea)||(B.put(ea,!0),I.push(ea))}for(var A=V.apply(this,arguments),B=new mxDictionary,F=this.graph.model,-I=[],O=0;O<A.length;O++){var R=A[O];this.graph.isTableCell(R)?t(F.getParent(F.getParent(R))):this.graph.isTableRow(R)&&t(F.getParent(R));t(R)}return I};var ka=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(t){return ka.apply(this,arguments)&&!mxEvent.isControlDown(t.getEvent())&&!mxEvent.isShiftDown(t.getEvent())};var aa=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return aa.apply(this,arguments)&&!this.graph.isTable(this.state.cell)&&-!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};var la=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(t){var A=la.apply(this,arguments);A.stroke="#C0C0C0";A.strokewidth=1;var B=this.graph.model.getParent(this.state.cell);null!=B&&this.graph.isTransparentBounds(B)&&(A.isDashed=!0);return A};var ra=mxVertexHandler.prototype.isSelectionDashed;mxVertexHandler.prototype.isSelectionDashed=-function(){return this.graph.isTransparentBounds(this.state.cell)?!0:ra.apply(this,arguments)};var U=mxVertexHandler.prototype.getSelectionColor;mxVertexHandler.prototype.getSelectionColor=function(){return this.graph.isTransparentBounds(this.state.cell)&&!this.graph.isCellSelected(this.state.cell)?"#C0C0C0":U.apply(this,arguments)};var ua=mxVertexHandler.prototype.updateParentHighlight;mxVertexHandler.prototype.updateParentHighlight=function(){ua.apply(this,arguments);null!=this.selectionBorder&&-this.graph.isTransparentBounds(this.state.cell)&&(this.selectionBorder.stroke=this.getSelectionColor(),this.selectionBorder.redraw())};var sa=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(t){var A=sa.apply(this,arguments);A.stroke="#C0C0C0";A.strokewidth=1;return A};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var t=this.getHandlePadding();return new mxPoint(this.bounds.x+-this.bounds.width-this.rotationHandleVSpacing+t.x/2,this.bounds.y+this.rotationHandleVSpacing-t.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(t,A){return this.graph.isRecursiveVertexResize(t)&&!mxEvent.isAltDown(A.getEvent())};var Ma=mxVertexHandler.prototype.resizeCell;mxVertexHandler.prototype.resizeCell=function(t,A,B,F,I,O,R){R&&this.graph.isRotatedGroupResize(t)&&(this.childOffsetY=this.childOffsetX=0);Ma.apply(this,arguments)};mxVertexHandler.prototype.isCenteredEvent=function(t,-A){return mxEvent.isControlDown(A.getEvent())||mxEvent.isMetaDown(A.getEvent())};var pa=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return pa.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTransparentBounds(this.state.cell)&&"1"!=mxUtils.getValue(this.state.style,"labelAutoRotate","0")};mxVertexHandler.prototype.isConnectHandleVisible=-function(){return this.graph.isConnectIconVisible(this.state.cell)&&this.graph.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing=-12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var t=this.getHandlePadding(),A=this.graph,B=A.getNestedCornerIconOffset(this.state.cell,this.bounds.x+this.bounds.width,this.bounds.y+-this.bounds.height,function(F){return A.isConnectIconVisible(F)&&A.isEnabled()&&A.isCellConnectable(F)&&!A.isTableCell(F)&&!A.isTableRow(F)&&!A.isTable(F)});return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing+t.x/2+B,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+t.y/2+B)};mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):-this.bounds};var Ea=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){var t=this.graph.model.getParent(this.state.cell);return null!=t&&this.graph.isTransparentBounds(t)?!1:Ea.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var Aa=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(t){return t.tableHandle||t.lockHandle||t.editIconHandle||-t.moveGroupHandle||Aa.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=function(){var t=0;this.graph.isTransparentBounds(this.state.cell)?t=-this.graph.getNestedTransparentBoundsCount(this.state.cell):this.graph.isTableRow(this.state.cell)?t=1:this.graph.isTableCell(this.state.cell)&&(t=2);return t};var Pa=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=-function(){return Pa.apply(this,arguments).grow(-this.getSelectionBorderInset())};var $a=null,Ua=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==$a&&($a=mxCellRenderer.defaultShapes.tableLine);var t=Ua.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var A=function(Ca,Ka,Da){for(var Ya=[],Za=0;Za<Ca.length;Za++){var Ta=Ca[Za];Ya.push(null==Ta?null:new mxPoint((ia+Ta.x+Ka)*O,(da+Ta.y+-Da)*O))}return Ya},B=this,F=this.graph,I=F.model,O=F.view.scale,R=this.state,ea=this.selectionBorder,ia=this.state.origin.x+F.view.translate.x,da=this.state.origin.y+F.view.translate.y;null==t&&(t=[]);var za=F.view.getCellStates(I.getChildCells(this.state.cell,!0));if(0<za.length){var Fa=I.getChildCells(za[0].cell,!0),Ga=F.getTableLines(this.state.cell,!1,!0),ca=F.getTableLines(this.state.cell,!0,!1);for(I=0;I<za.length;I++)mxUtils.bind(this,function(Ca){var Ka=za[Ca],Da=null;if(F.isCellMovable(Ka.cell)){Da=-Ca<za.length-1?za[Ca+1]:null;Da=null!=Da?F.getCellGeometry(Da.cell):null;var Ya=null!=Da&&null!=Da.alternateBounds?Da.alternateBounds:Da;Da=null!=ca[Ca]?new $a(ca[Ca],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Da.isDashed=ea.isDashed;Da.svgStrokeTolerance++;Da=new mxHandle(Ka,"row-resize",null,Da);Da.tableHandle=!0;var Za=0;Da.shape.node.parentNode.insertBefore(Da.shape.node,Da.shape.node.parentNode.firstChild);Da.redraw=function(){if(null!=this.shape){this.shape.stroke=-0==Za?mxConstants.NONE:ea.stroke;if(this.shape.constructor==$a)this.shape.line=A(ca[Ca],0,Za),this.shape.updateBoundsFromLine();else{var Ta=F.getActualStartSize(R.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+Za*O;this.shape.bounds.x=R.x+(Ca==za.length-1?0:Ta.x*O);this.shape.bounds.width=R.width-(Ca==za.length-1?0:Ta.width+Ta.x+O)}this.shape.redraw()}};Da.setPosition=function(Ta,bb,ib){Za=Math.max(Graph.minTableRowHeight-Ta.height,bb.y-Ta.y-Ta.height);null!=-Ya&&mxEvent.isShiftDown(ib.getEvent())&&(Za=Math.min(Za,Ya.height-Graph.minTableRowHeight))};Da.execute=function(Ta){if(0!=Za){var bb=mxEvent.isShiftDown(Ta.getEvent());(Ta=mxEvent.isControlDown(Ta.getEvent())||mxEvent.isMetaDown(Ta.getEvent()))&&bb?F.distributeRows(R.cell):Ta?F.resizeAllTableRows(R.cell,Za):F.setTableRowHeight(this.state.cell,Za,!bb)}else B.blockDelayedSelection||(bb=F.getCellAt(Ta.getGraphX(),Ta.getGraphY())||R.cell,F.graphHandler.selectCellForEvent(bb,Ta));Za=0};Da.reset=function(){Za=-0}}t.push(Da)})(I);for(I=0;I<Fa.length;I++)mxUtils.bind(this,function(Ca){var Ka=F.view.getState(Fa[Ca]),Da=F.getCellGeometry(Fa[Ca]),Ya=null!=Da.alternateBounds?Da.alternateBounds:Da;null==Ka&&(Ka=new mxCellState(F.view,Fa[Ca],F.getCellStyle(Fa[Ca])),Ka.x=R.x+Da.x*O,Ka.y=R.y+Da.y*O,Ka.width=Ya.width*O,Ka.height=Ya.height*O,Ka.updateCachedBounds());Da=Ca<Fa.length-1?Fa[Ca+1]:null;Da=null!=Da?F.getCellGeometry(Da):null;var Za=null!=Da&&null!=Da.alternateBounds?Da.alternateBounds:Da;Da=null!=Ga[Ca]?-new $a(Ga[Ca],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Da.isDashed=ea.isDashed;Da.svgStrokeTolerance++;Ka=new mxHandle(Ka,"col-resize",null,Da);Ka.tableHandle=!0;var Ta=0;Ka.shape.node.parentNode.insertBefore(Ka.shape.node,Ka.shape.node.parentNode.firstChild);Ka.redraw=function(){if(null!=this.shape){this.shape.stroke=0==Ta?mxConstants.NONE:ea.stroke;if(this.shape.constructor==$a)this.shape.line=A(Ga[Ca],Ta,0),this.shape.updateBoundsFromLine();else{var bb=F.getActualStartSize(R.cell,-!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(Ya.width+Ta)*O;this.shape.bounds.y=R.y+(Ca==Fa.length-1?0:bb.y*O);this.shape.bounds.height=R.height-(Ca==Fa.length-1?0:(bb.height+bb.y)*O)}this.shape.redraw()}};Ka.setPosition=function(bb,ib,nb){Ta=Math.max(Graph.minTableColumnWidth-Ya.width,ib.x-bb.x-Ya.width);null!=Za&&mxEvent.isShiftDown(nb.getEvent())&&(Ta=Math.min(Ta,Za.width-Graph.minTableColumnWidth))};Ka.execute=function(bb){if(0!=Ta){var ib=mxEvent.isShiftDown(bb.getEvent());-(bb=mxEvent.isControlDown(bb.getEvent())||mxEvent.isMetaDown(bb.getEvent()))&&ib?F.distributeColumns(R.cell):bb?F.resizeAllTableColumns(R.cell,Ta):F.setTableColumnWidth(this.state.cell,Ta,!ib)}else B.blockDelayedSelection||(ib=F.getCellAt(bb.getGraphX(),bb.getGraphY())||R.cell,F.graphHandler.selectCellForEvent(ib,bb));Ta=0};Ka.positionChanged=function(){};Ka.reset=function(){Ta=0};t.push(Ka)})(I)}}if(this.graph.isLockedGroupIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){null==-t&&(t=[]);B=this;F=this.graph;var wa=this.state.cell,ya=16,Ia=this.graph.isLockedGroup(wa);I=new mxImageShape(new mxRectangle(0,0,ya,ya),(Ia?HoverIcons.prototype.lockHandle:HoverIcons.prototype.unlockHandle).src);I.preserveImageAspect=!1;I=new mxHandle(this.state,"pointer",null,I);I.lockHandle=!0;I.setPosition=function(){};I.positionChanged=function(){};I.reset=function(){};I.redraw=function(){if(null!=this.shape){var Ca=B.getHandlePadding(),Ka=F.getNestedCornerIconOffset(wa,B.bounds.x,B.bounds.y,-function(Za){return F.isLockedGroupIconVisible(Za)&&F.isCellMovable(Za)});Ca=new mxPoint(B.bounds.x-12-Ca.x/2-Ka,B.bounds.y-12-Ca.y/2-Ka);F.isMoveIconVisible(wa)&&F.isCellMovable(wa)&&(Ca.y+=24);Ka=Number(null!=B.currentAlpha?B.currentAlpha:B.state.style[mxConstants.STYLE_ROTATION]||"0");var Da=mxUtils.toRadians(Ka);if(0!=Da){var Ya=new mxPoint(B.state.getCenterX(),B.state.getCenterY());Ca=mxUtils.getRotatedPoint(Ca,Math.cos(Da),Math.sin(Da),Ya)}this.shape.bounds.width=ya;this.shape.bounds.height=-ya;this.shape.bounds.x=Ca.x-ya/2;this.shape.bounds.y=Ca.y-ya/2;this.shape.rotation=Ka;this.shape.redraw()}};I.execute=function(Ca){F.getModel().beginUpdate();try{F.setCellStyles("lockedGroup",Ia?"0":"1",[wa])}finally{F.getModel().endUpdate()}if(!Ia){Ca=F.getSelectionCells();for(var Ka=[],Da=0;Da<Ca.length;Da++)Ca[Da]!=wa&&F.model.isAncestor(wa,Ca[Da])||Ka.push(Ca[Da]);Ka.length!=Ca.length&&F.setSelectionCells(0<Ka.length?Ka:[wa])}};t.push(I)}this.graph.isEditIconVisible(this.state.cell)&&(null==t&&-(t=[]),B=this,F=this.graph,wa=this.state.cell,ya=16,I=new mxImageShape(new mxRectangle(0,0,ya,ya),HoverIcons.prototype.editHandle.src),I.preserveImageAspect=!1,I=new mxHandle(this.state,"pointer",null,I),I.editIconHandle=!0,I.setPosition=function(){},I.positionChanged=function(){},I.reset=function(){},I.redraw=function(){if(null!=this.shape){var Ca=B.getHandlePadding(),Ka=F.getNestedCornerIconOffset(wa,B.bounds.x,B.bounds.y,function(Za){return F.isEditIconVisible(Za)});Ca=new mxPoint(B.bounds.x-12--Ca.x/2-Ka,B.bounds.y-12-Ca.y/2-Ka);F.isCellMovable(wa)&&(F.isLockedGroupIconVisible(wa)||F.isMoveIconVisible(wa))&&(Ca.x+=24);Ka=Number(null!=B.currentAlpha?B.currentAlpha:B.state.style[mxConstants.STYLE_ROTATION]||"0");var Da=mxUtils.toRadians(Ka);if(0!=Da){var Ya=new mxPoint(B.state.getCenterX(),B.state.getCenterY());Ca=mxUtils.getRotatedPoint(Ca,Math.cos(Da),Math.sin(Da),Ya)}this.shape.bounds.width=ya;this.shape.bounds.height=ya;this.shape.bounds.x=Ca.x-ya/2;this.shape.bounds.y=Ca.y-ya/2;this.shape.rotation=-Ka;this.shape.redraw()}},I.execute=function(Ca){F.startEditingAtCell(wa)},t.push(I));this.graph.isMoveIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&(null==t&&(t=[]),B=this,F=this.graph,wa=this.state.cell,ya=16,I=new mxImageShape(new mxRectangle(0,0,ya,ya),HoverIcons.prototype.moveHandle.src),I.preserveImageAspect=!1,I=new mxHandle(this.state,"move",null,I),I.moveGroupHandle=!0,I.setPosition=function(){},I.positionChanged=function(){},I.execute=function(){},I.reset=function(){},-I.redraw=function(){if(null!=this.shape){var Ca=B.getHandlePadding(),Ka=F.getNestedCornerIconOffset(wa,B.bounds.x,B.bounds.y,function(Ya){return F.isMoveIconVisible(Ya)&&F.isCellMovable(Ya)}),Da=B.bounds.x-12-Ca.x/2-Ka;Ca=B.bounds.y-12-Ca.y/2-Ka;this.shape.bounds.width=ya;this.shape.bounds.height=ya;this.shape.bounds.x=Da-ya/2;this.shape.bounds.y=Ca-ya/2;this.shape.redraw()}},t.push(I));return null!=t?t.reverse():null};var Va=mxVertexHandler.prototype.setHandlesVisible,Ha=mxVertexHandler.prototype.start;-mxVertexHandler.prototype.start=function(t,A,B){Ha.apply(this,arguments);var F=this.graph;if(null!=this.parentState&&F.isTransparentBounds(this.parentState.cell)){var I=F.view.scale,O=F.view.translate,R=this.parentState;this.parentState=R.clone();this.parentState.x=I*(O.x+R.origin.x);this.parentState.y=I*(O.y+R.origin.y)}for(I=F.model.getParent(this.state.cell);null!=I;)F.isTransparentBounds(I)&&(O=F.selectionCellsHandler.getHandler(I),null!=O&&null!=O.selectionBorder&&(O.selectionBorder.node.style.visibility=-"hidden")),I=F.model.getParent(I);if(!this.livePreviewActive&&null==this.ghostPreview&&null!=this.index&&this.index!=mxEvent.LABEL_HANDLE&&null!=this.sizers){for(F=0;F<this.sizers.length;F++)null!=this.sizers[F]&&F!=this.index&&(this.sizers[F].node.style.display="none");null!=this.rotationShape&&this.index!=mxEvent.ROTATION_HANDLE&&(this.rotationShape.node.style.visibility="hidden");this.resizeHandlesHidden=!0}};var Oa=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){if(this.resizeHandlesHidden){if(null!=-this.sizers)for(var t=0;t<this.sizers.length;t++)null!=this.sizers[t]&&(this.sizers[t].node.style.display="");null!=this.rotationShape&&(this.rotationShape.node.style.visibility="");this.resizeHandlesHidden=null}t=this.graph;for(var A=null!=this.state?t.model.getParent(this.state.cell):null;null!=A;){if(t.isTransparentBounds(A)){var B=t.selectionCellsHandler.getHandler(A);null!=B&&null!=B.selectionBorder&&(B.selectionBorder.node.style.visibility="")}A=t.model.getParent(A)}Oa.apply(this,arguments)};-mxVertexHandler.prototype.setHandlesVisible=function(t){Va.apply(this,arguments);if(null!=this.moveHandles)for(var A=0;A<this.moveHandles.length;A++)null!=this.moveHandles[A]&&(this.moveHandles[A].node.style.visibility=t?"":"hidden");if(null!=this.cornerHandles)for(A=0;A<this.cornerHandles.length;A++)this.cornerHandles[A].node.style.visibility=t?"":"hidden";this.graph.isTransparentBounds(this.state.cell)&&null!=this.selectionBorder&&(this.selectionBorder.node.style.visibility=t?"":"hidden")};mxVertexHandler.prototype.isMoveHandlesVisible=-function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};mxVertexHandler.prototype.refreshMoveHandles=function(){var t=this.isMoveHandlesVisible();t&&null==this.moveHandles?this.moveHandles=this.createMoveHandles():t||null==this.moveHandles||this.destroyMoveHandles();if(t&&null==this.moveHandles){for(t=0;t<this.moveHandles.length;t++)null!=this.moveHandles[t]&&this.moveHandles[t].parentNode.removeChild(this.moveHandles[t]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=-function(){for(var t=this.graph,A=t.model,B=[],F=0;F<A.getChildCount(this.state.cell);F++)mxUtils.bind(this,function(I){if(null!=I&&A.isVertex(I.cell)&&t.isCellMovable(I.cell)){var O=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);O=new mxImageShape(O,this.rowHandleImage.src);O.rowState=I;O.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;O.init(this.graph.getView().getOverlayPane());O.node.style.cursor="move";mxEvent.addGestureListeners(O.node,-mxUtils.bind(this,function(R){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(R)&&this.graph.isCellSelected(I.cell)||this.graph.selectCellForEvent(I.cell,R);mxEvent.isPopupTrigger(R)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(R),mxEvent.getClientY(R),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(R),this.graph.isMouseDown=!0);mxEvent.consume(R)}),null,mxUtils.bind(this,-function(R){mxEvent.isPopupTrigger(R)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(R),mxEvent.getClientY(R),I.cell,R),mxEvent.consume(R))}));B.push(O)}else B.push(null)})(this.graph.view.getState(A.getChildAt(this.state.cell,F)));return B};mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var t=0;t<this.moveHandles.length;t++)null!=this.moveHandles[t]&&this.moveHandles[t].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=-function(){if(null!=this.cornerHandles){for(var t=0;t<this.cornerHandles.length;t++)null!=this.cornerHandles[t]&&null!=this.cornerHandles[t].node&&null!=this.cornerHandles[t].node.parentNode&&this.cornerHandles[t].node.parentNode.removeChild(this.cornerHandles[t].node);this.cornerHandles=null}};var oa=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){oa.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();if(this.graph.isTable(this.state.cell)&&-this.graph.isCellMovable(this.state.cell))this.refreshMoveHandles();else if(this.graph.isCellMovable(this.state.cell)&&(this.graph.isTransparentBounds(this.state.cell)||1==this.graph.getSelectionCount()&&(this.graph.isTableCell(this.state.cell)||this.graph.isTableRow(this.state.cell)))){this.cornerHandles=[];for(var t=0;4>t;t++){var A=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);A.dialect=mxConstants.DIALECT_SVG;A.init(this.graph.view.getOverlayPane());this.cornerHandles.push(A)}}this.graph.isTable(this.state.cell)&&-this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();t=this.graph.getLinkForCell(this.state.cell);A=this.graph.getLinksForState(this.state);this.updateLinkHint(t,A)};var Ja=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var t=new mxPoint(0,0),A=this.tolerance,B=this.state.style.shape;null==mxCellRenderer.defaultShapes[B]&&mxStencilRegistry.getStencil(B);B=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==-this.state.cell;if(!B&&null!=this.customHandles)for(var F=0;F<this.customHandles.length;F++)if(null!=this.customHandles[F]&&!this.customHandles[F].lockHandle&&!this.customHandles[F].editIconHandle&&!this.customHandles[F].moveGroupHandle&&null!=this.customHandles[F].shape&&null!=this.customHandles[F].shape.bounds){var I=this.customHandles[F].shape.bounds,O=I.getCenterX(),R=I.getCenterY();if(Math.abs(this.state.x-O)<I.width/2||Math.abs(this.state.y-R)<I.height/2||Math.abs(this.state.x+this.state.width--O)<I.width/2||Math.abs(this.state.y+this.state.height-R)<I.height/2){B=!0;break}}B&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(A/=2,this.graph.isTable(this.state.cell)&&(A+=7),t.x=this.sizers[0].bounds.width+A,t.y=this.sizers[0].bounds.height+A):t=Ja.apply(this,arguments);return t};mxVertexHandler.prototype.updateHint=function(t){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=-this.currentAlpha+"°";else{t=this.state.view.scale;var A=this.state.view.unit;this.hint.innerHTML=b(this.roundLength(this.bounds.width/t),A)+" x "+b(this.roundLength(this.bounds.height/t),A)}t=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==t&&(t=this.bounds);this.hint.style.left=t.x+Math.round((t.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=t.y+t.height+Editor.hintOffset+"px";null!=this.linkHint&&-(this.linkHint.style.display="none")}};mxVertexHandler.prototype.removeHint=function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};var db=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=function(){db.apply(this,arguments);var t=this.graph.getLinkForCell(this.state.cell),A=this.graph.getLinksForState(this.state);this.updateLinkHint(t,A)};var rb=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(t,-A){rb.apply(this,arguments);null!=this.linkHint&&"none"!=this.linkHint.style.display&&null!=this.graph.graphHandler&&null!=this.graph.graphHandler.first&&(this.linkHint.style.display="none")};var jb=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(t,A){jb.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(t,A,B){null==this.hint&&(this.hint=-a(),this.state.view.graph.container.appendChild(this.hint));var F=this.graph.view.translate,I=this.graph.view.scale,O=this.roundLength(A.x/I-F.x);F=this.roundLength(A.y/I-F.y);var R=this.graph.view.unit;this.hint.innerHTML=b(O,R)+", "+b(F,R);this.hint.style.visibility="visible";null!=B&&(B.view.updateEdgeBounds(B),this.hint.innerHTML+=" ("+(R==mxConstants.POINTS?Math.round(B.length/I):b(B.length/I,R))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&-null!=this.constraintHandler.currentFocus?(B=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*B.x)+"%, "+Math.round(100*B.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(t.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(t.getGraphY(),A.y)+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")};Graph.createFoldingImage=function(t,A){return A?Graph.createSvgImage(t,-t,'<defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 4.5 2 L 4.5 7 M 2 4.5 L 7 4.5 z" stroke="#000"/>',9,9):Graph.createSvgImage(t,t,'<defs><linearGradient id="grad1" x1="50%" y1="0%" x2="50%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 2 4.5 L 7 4.5 z" stroke="#000"/>',-9,9)};Graph.updateFoldingImages=function(t){Graph.prototype.expandedImage=Graph.createFoldingImage(t,!1);Graph.prototype.collapsedImage=Graph.createFoldingImage(t,!0)};Graph.updateFoldingImages(9);Graph.foldingImages={};Graph.prototype.getFoldingImage=function(t){var A=mxGraph.prototype.getFoldingImage.apply(this,arguments);if(null!=A){var B=parseInt(mxUtils.getValue(t.style,"foldingIconSize",0));if(0<B){var F=B+"-"+this.isCellCollapsed(t.cell);A=Graph.foldingImages[F];null==A&&(A=Graph.createFoldingImage(B,-this.isCellCollapsed(t.cell)),Graph.foldingImages[F]=A)}}return A};mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;HoverIcons.prototype.mainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,-'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.endFixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.terminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="'+-HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.endTerminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.rotationHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" fill="'+HoverIcons.prototype.arrowFill+'" d="M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"/>',+if(this.graph.isTransparentBounds(F))return!1}return N.apply(this,arguments)};var Y=mxConstraintHandler.prototype.getCellForEvent;mxConstraintHandler.prototype.getCellForEvent=function(t,A){var B=Y.apply(this,arguments),F=null!=A?A.x:t.getGraphX(),I=null!=A?A.y:t.getGraphY();if(null!=B&&this.graph.model.isEdge(B)){var O=this.graph.model;B=this.graph.getCellAt(F,I,null,!0,!1,function(da){return O.isEdge(O.getParent(da.cell))});if(null!=B&&!this.graph.isCellConnectable(B)){var R=O.getParent(B);O.isVertex(R)&&+this.graph.isCellConnectable(R)&&(B=R)}B=this.graph.isCellLocked(B)?null:B}null==B||null!=this.currentFocus&&this.currentFocus.cell==B||(F=this.graph.getBorderContainer(B,F,I),null!=F&&(B=F));return B};var X=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){for(var t=X.apply(this,arguments),A=this.graph,B=new mxDictionary,F=[],I=0;I<t.length;I++)null==B.get(t[I])&&(B.put(t[I],!0),F.push(t[I]));for(I=0;I<t.length;I++)for(var O=+A.model.getParent(t[I]);null!=O&&A.isTransparentBounds(O);)null==B.get(O)&&(B.put(O,!0),F.push(O)),O=A.model.getParent(O);return F};mxGraphView.prototype.formatUnitText=function(t){return t?b(t,this.unit):t};mxGraphHandler.prototype.updateHint=function(t){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var A=this.graph.view.translate,B=this.graph.view.scale;t=this.roundLength((this.bounds.x+this.currentDx)/+B-A.x);A=this.roundLength((this.bounds.y+this.currentDy)/B-A.y);B=this.graph.view.unit;this.hint.innerHTML=b(t,B)+", "+b(A,B);this.hint.style.left=this.pBounds.x+this.currentDx+Math.round((this.pBounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.pBounds.y+this.currentDy+this.pBounds.height+Editor.hintOffset+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(null!=this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint),this.hint=null)};var L=mxStackLayout.prototype.resizeCell;+mxStackLayout.prototype.resizeCell=function(t,A){L.apply(this,arguments);var B=this.graph.getCellStyle(t);if(null==B.childLayout){var F=this.graph.model.getParent(t),I=null!=F?this.graph.getCellGeometry(F):null;if(null!=I&&(B=this.graph.getCellStyle(F),"stackLayout"==B.childLayout)){var O=parseFloat(mxUtils.getValue(B,"stackBorder",mxStackLayout.prototype.border));B="1"==mxUtils.getValue(B,"horizontalStack","1");var R=this.graph.getActualStartSize(F);I=I.clone();B?I.height=A.height+R.y+R.height+2*+O:I.width=A.width+R.x+R.width+2*O;this.graph.model.setGeometry(F,I)}}};var V=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function t(da){B.get(da)||(B.put(da,!0),I.push(da))}for(var A=V.apply(this,arguments),B=new mxDictionary,F=this.graph.model,I=[],O=0;O<A.length;O++){var R=A[O];this.graph.isTableCell(R)?t(F.getParent(F.getParent(R))):this.graph.isTableRow(R)&&t(F.getParent(R));t(R)}return I};var ka=mxConnectionHandler.prototype.isStartEvent;+mxConnectionHandler.prototype.isStartEvent=function(t){return ka.apply(this,arguments)&&!mxEvent.isControlDown(t.getEvent())&&!mxEvent.isShiftDown(t.getEvent())};var aa=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return aa.apply(this,arguments)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};var la=mxVertexHandler.prototype.createParentHighlightShape;+mxVertexHandler.prototype.createParentHighlightShape=function(t){var A=la.apply(this,arguments);A.stroke="#C0C0C0";A.strokewidth=1;var B=this.graph.model.getParent(this.state.cell);null!=B&&this.graph.isTransparentBounds(B)&&(A.isDashed=!0);return A};var ra=mxVertexHandler.prototype.isSelectionDashed;mxVertexHandler.prototype.isSelectionDashed=function(){return this.graph.isTransparentBounds(this.state.cell)?!0:ra.apply(this,arguments)};var U=mxVertexHandler.prototype.getSelectionColor;mxVertexHandler.prototype.getSelectionColor=+function(){return this.graph.isTransparentBounds(this.state.cell)&&!this.graph.isCellSelected(this.state.cell)?"#C0C0C0":U.apply(this,arguments)};var ua=mxVertexHandler.prototype.updateParentHighlight;mxVertexHandler.prototype.updateParentHighlight=function(){ua.apply(this,arguments);null!=this.selectionBorder&&this.graph.isTransparentBounds(this.state.cell)&&(this.selectionBorder.stroke=this.getSelectionColor(),this.selectionBorder.redraw())};var sa=mxEdgeHandler.prototype.createParentHighlightShape;+mxEdgeHandler.prototype.createParentHighlightShape=function(t){var A=sa.apply(this,arguments);A.stroke="#C0C0C0";A.strokewidth=1;return A};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var t=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+t.x/2,this.bounds.y+this.rotationHandleVSpacing-t.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(t,A){return this.graph.isRecursiveVertexResize(t)&&+!mxEvent.isAltDown(A.getEvent())};var Ma=mxVertexHandler.prototype.resizeCell;mxVertexHandler.prototype.resizeCell=function(t,A,B,F,I,O,R){R&&this.graph.isRotatedGroupResize(t)&&(this.childOffsetY=this.childOffsetX=0);Ma.apply(this,arguments)};mxVertexHandler.prototype.isCenteredEvent=function(t,A){return mxEvent.isControlDown(A.getEvent())||mxEvent.isMetaDown(A.getEvent())};var pa=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return pa.apply(this,+arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTransparentBounds(this.state.cell)&&"1"!=mxUtils.getValue(this.state.style,"labelAutoRotate","0")};mxVertexHandler.prototype.isConnectHandleVisible=function(){return this.graph.isConnectIconVisible(this.state.cell)&&this.graph.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&+!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing=-12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var t=this.getHandlePadding(),A=this.graph,B=A.getNestedCornerIconOffset(this.state.cell,this.bounds.x+this.bounds.width,this.bounds.y+this.bounds.height,function(F){return A.isConnectIconVisible(F)&&A.isEnabled()&&A.isCellConnectable(F)&&!A.isTableCell(F)&&!A.isTableRow(F)&&!A.isTable(F)});return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing++t.x/2+B,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+t.y/2+B)};mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):this.bounds};var Ea=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){var t=this.graph.model.getParent(this.state.cell);return null!=t&&this.graph.isTransparentBounds(t)?+!1:Ea.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var Aa=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(t){return t.tableHandle||t.lockHandle||t.editIconHandle||t.moveGroupHandle||Aa.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=function(){var t=0;this.graph.isTransparentBounds(this.state.cell)?+t=-this.graph.getNestedTransparentBoundsCount(this.state.cell):this.graph.isTableRow(this.state.cell)?t=1:this.graph.isTableCell(this.state.cell)&&(t=2);return t};var Pa=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return Pa.apply(this,arguments).grow(-this.getSelectionBorderInset())};var $a=null,Ua=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==$a&&($a=mxCellRenderer.defaultShapes.tableLine);+var t=Ua.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var A=function(Ca,Ka,Da){for(var Ya=[],Za=0;Za<Ca.length;Za++){var Ta=Ca[Za];Ya.push(null==Ta?null:new mxPoint((ia+Ta.x+Ka)*O,(ea+Ta.y+Da)*O))}return Ya},B=this,F=this.graph,I=F.model,O=F.view.scale,R=this.state,da=this.selectionBorder,ia=this.state.origin.x+F.view.translate.x,ea=this.state.origin.y+F.view.translate.y;null==t&&(t=[]);var za=F.view.getCellStates(I.getChildCells(this.state.cell,+!0));if(0<za.length){var Fa=I.getChildCells(za[0].cell,!0),Ga=F.getTableLines(this.state.cell,!1,!0),ca=F.getTableLines(this.state.cell,!0,!1);for(I=0;I<za.length;I++)mxUtils.bind(this,function(Ca){var Ka=za[Ca],Da=null;if(F.isCellMovable(Ka.cell)){Da=Ca<za.length-1?za[Ca+1]:null;Da=null!=Da?F.getCellGeometry(Da.cell):null;var Ya=null!=Da&&null!=Da.alternateBounds?Da.alternateBounds:Da;Da=null!=ca[Ca]?new $a(ca[Ca],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Da.isDashed=+da.isDashed;Da.svgStrokeTolerance++;Da=new mxHandle(Ka,"row-resize",null,Da);Da.tableHandle=!0;var Za=0;Da.shape.node.parentNode.insertBefore(Da.shape.node,Da.shape.node.parentNode.firstChild);Da.redraw=function(){if(null!=this.shape){this.shape.stroke=0==Za?mxConstants.NONE:da.stroke;if(this.shape.constructor==$a)this.shape.line=A(ca[Ca],0,Za),this.shape.updateBoundsFromLine();else{var Ta=F.getActualStartSize(R.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height++Za*O;this.shape.bounds.x=R.x+(Ca==za.length-1?0:Ta.x*O);this.shape.bounds.width=R.width-(Ca==za.length-1?0:Ta.width+Ta.x+O)}this.shape.redraw()}};Da.setPosition=function(Ta,bb,ib){Za=Math.max(Graph.minTableRowHeight-Ta.height,bb.y-Ta.y-Ta.height);null!=Ya&&mxEvent.isShiftDown(ib.getEvent())&&(Za=Math.min(Za,Ya.height-Graph.minTableRowHeight))};Da.execute=function(Ta){if(0!=Za){var bb=mxEvent.isShiftDown(Ta.getEvent());(Ta=mxEvent.isControlDown(Ta.getEvent())||mxEvent.isMetaDown(Ta.getEvent()))&&bb?+F.distributeRows(R.cell):Ta?F.resizeAllTableRows(R.cell,Za):F.setTableRowHeight(this.state.cell,Za,!bb)}else B.blockDelayedSelection||(bb=F.getCellAt(Ta.getGraphX(),Ta.getGraphY())||R.cell,F.graphHandler.selectCellForEvent(bb,Ta));Za=0};Da.reset=function(){Za=0}}t.push(Da)})(I);for(I=0;I<Fa.length;I++)mxUtils.bind(this,function(Ca){var Ka=F.view.getState(Fa[Ca]),Da=F.getCellGeometry(Fa[Ca]),Ya=null!=Da.alternateBounds?Da.alternateBounds:Da;null==Ka&&(Ka=new mxCellState(F.view,Fa[Ca],F.getCellStyle(Fa[Ca])),+Ka.x=R.x+Da.x*O,Ka.y=R.y+Da.y*O,Ka.width=Ya.width*O,Ka.height=Ya.height*O,Ka.updateCachedBounds());Da=Ca<Fa.length-1?Fa[Ca+1]:null;Da=null!=Da?F.getCellGeometry(Da):null;var Za=null!=Da&&null!=Da.alternateBounds?Da.alternateBounds:Da;Da=null!=Ga[Ca]?new $a(Ga[Ca],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Da.isDashed=da.isDashed;Da.svgStrokeTolerance++;Ka=new mxHandle(Ka,"col-resize",null,Da);Ka.tableHandle=!0;var Ta=0;Ka.shape.node.parentNode.insertBefore(Ka.shape.node,+Ka.shape.node.parentNode.firstChild);Ka.redraw=function(){if(null!=this.shape){this.shape.stroke=0==Ta?mxConstants.NONE:da.stroke;if(this.shape.constructor==$a)this.shape.line=A(Ga[Ca],Ta,0),this.shape.updateBoundsFromLine();else{var bb=F.getActualStartSize(R.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(Ya.width+Ta)*O;this.shape.bounds.y=R.y+(Ca==Fa.length-1?0:bb.y*O);this.shape.bounds.height=R.height-(Ca==Fa.length-1?0:(bb.height+bb.y)*O)}this.shape.redraw()}};Ka.setPosition=+function(bb,ib,nb){Ta=Math.max(Graph.minTableColumnWidth-Ya.width,ib.x-bb.x-Ya.width);null!=Za&&mxEvent.isShiftDown(nb.getEvent())&&(Ta=Math.min(Ta,Za.width-Graph.minTableColumnWidth))};Ka.execute=function(bb){if(0!=Ta){var ib=mxEvent.isShiftDown(bb.getEvent());(bb=mxEvent.isControlDown(bb.getEvent())||mxEvent.isMetaDown(bb.getEvent()))&&ib?F.distributeColumns(R.cell):bb?F.resizeAllTableColumns(R.cell,Ta):F.setTableColumnWidth(this.state.cell,Ta,!ib)}else B.blockDelayedSelection||(ib=F.getCellAt(bb.getGraphX(),+bb.getGraphY())||R.cell,F.graphHandler.selectCellForEvent(ib,bb));Ta=0};Ka.positionChanged=function(){};Ka.reset=function(){Ta=0};t.push(Ka)})(I)}}if(this.graph.isLockedGroupIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){null==t&&(t=[]);B=this;F=this.graph;var wa=this.state.cell,ya=16,Ia=this.graph.isLockedGroup(wa);I=new mxImageShape(new mxRectangle(0,0,ya,ya),(Ia?HoverIcons.prototype.lockHandle:HoverIcons.prototype.unlockHandle).src);I.preserveImageAspect=!1;I=new mxHandle(this.state,+"pointer",null,I);I.lockHandle=!0;I.setPosition=function(){};I.positionChanged=function(){};I.reset=function(){};I.redraw=function(){if(null!=this.shape){var Ca=B.getHandlePadding(),Ka=F.getNestedCornerIconOffset(wa,B.bounds.x,B.bounds.y,function(Za){return F.isLockedGroupIconVisible(Za)&&F.isCellMovable(Za)});Ca=new mxPoint(B.bounds.x-12-Ca.x/2-Ka,B.bounds.y-12-Ca.y/2-Ka);F.isMoveIconVisible(wa)&&F.isCellMovable(wa)&&(Ca.y+=24);Ka=Number(null!=B.currentAlpha?B.currentAlpha:B.state.style[mxConstants.STYLE_ROTATION]||+"0");var Da=mxUtils.toRadians(Ka);if(0!=Da){var Ya=new mxPoint(B.state.getCenterX(),B.state.getCenterY());Ca=mxUtils.getRotatedPoint(Ca,Math.cos(Da),Math.sin(Da),Ya)}this.shape.bounds.width=ya;this.shape.bounds.height=ya;this.shape.bounds.x=Ca.x-ya/2;this.shape.bounds.y=Ca.y-ya/2;this.shape.rotation=Ka;this.shape.redraw()}};I.execute=function(Ca){F.getModel().beginUpdate();try{F.setCellStyles("lockedGroup",Ia?"0":"1",[wa])}finally{F.getModel().endUpdate()}if(!Ia){Ca=F.getSelectionCells();for(var Ka=+[],Da=0;Da<Ca.length;Da++)Ca[Da]!=wa&&F.model.isAncestor(wa,Ca[Da])||Ka.push(Ca[Da]);Ka.length!=Ca.length&&F.setSelectionCells(0<Ka.length?Ka:[wa])}};t.push(I)}this.graph.isEditIconVisible(this.state.cell)&&(null==t&&(t=[]),B=this,F=this.graph,wa=this.state.cell,ya=16,I=new mxImageShape(new mxRectangle(0,0,ya,ya),HoverIcons.prototype.editHandle.src),I.preserveImageAspect=!1,I=new mxHandle(this.state,"pointer",null,I),I.editIconHandle=!0,I.setPosition=function(){},I.positionChanged=function(){},I.reset=+function(){},I.redraw=function(){if(null!=this.shape){var Ca=B.getHandlePadding(),Ka=F.getNestedCornerIconOffset(wa,B.bounds.x,B.bounds.y,function(Za){return F.isEditIconVisible(Za)});Ca=new mxPoint(B.bounds.x-12-Ca.x/2-Ka,B.bounds.y-12-Ca.y/2-Ka);F.isCellMovable(wa)&&(F.isLockedGroupIconVisible(wa)||F.isMoveIconVisible(wa))&&(Ca.x+=24);Ka=Number(null!=B.currentAlpha?B.currentAlpha:B.state.style[mxConstants.STYLE_ROTATION]||"0");var Da=mxUtils.toRadians(Ka);if(0!=Da){var Ya=new mxPoint(B.state.getCenterX(),+B.state.getCenterY());Ca=mxUtils.getRotatedPoint(Ca,Math.cos(Da),Math.sin(Da),Ya)}this.shape.bounds.width=ya;this.shape.bounds.height=ya;this.shape.bounds.x=Ca.x-ya/2;this.shape.bounds.y=Ca.y-ya/2;this.shape.rotation=Ka;this.shape.redraw()}},I.execute=function(Ca){F.startEditingAtCell(wa)},t.push(I));this.graph.isMoveIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&(null==t&&(t=[]),B=this,F=this.graph,wa=this.state.cell,ya=16,I=new mxImageShape(new mxRectangle(0,0,ya,ya),HoverIcons.prototype.moveHandle.src),+I.preserveImageAspect=!1,I=new mxHandle(this.state,"move",null,I),I.moveGroupHandle=!0,I.setPosition=function(){},I.positionChanged=function(){},I.execute=function(){},I.reset=function(){},I.redraw=function(){if(null!=this.shape){var Ca=B.getHandlePadding(),Ka=F.getNestedCornerIconOffset(wa,B.bounds.x,B.bounds.y,function(Ya){return F.isMoveIconVisible(Ya)&&F.isCellMovable(Ya)}),Da=B.bounds.x-12-Ca.x/2-Ka;Ca=B.bounds.y-12-Ca.y/2-Ka;this.shape.bounds.width=ya;this.shape.bounds.height=ya;this.shape.bounds.x=+Da-ya/2;this.shape.bounds.y=Ca-ya/2;this.shape.redraw()}},t.push(I));return null!=t?t.reverse():null};var Va=mxVertexHandler.prototype.setHandlesVisible,Ha=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(t,A,B){Ha.apply(this,arguments);var F=this.graph;if(null!=this.parentState&&F.isTransparentBounds(this.parentState.cell)){var I=F.view.scale,O=F.view.translate,R=this.parentState;this.parentState=R.clone();this.parentState.x=I*(O.x+R.origin.x);this.parentState.y=I*(O.y+R.origin.y)}for(I=+F.model.getParent(this.state.cell);null!=I;)F.isTransparentBounds(I)&&(O=F.selectionCellsHandler.getHandler(I),null!=O&&null!=O.selectionBorder&&(O.selectionBorder.node.style.visibility="hidden")),I=F.model.getParent(I);if(!this.livePreviewActive&&null==this.ghostPreview&&null!=this.index&&this.index!=mxEvent.LABEL_HANDLE&&null!=this.sizers){for(F=0;F<this.sizers.length;F++)null!=this.sizers[F]&&F!=this.index&&(this.sizers[F].node.style.display="none");null!=this.rotationShape&&this.index!=mxEvent.ROTATION_HANDLE&&+(this.rotationShape.node.style.visibility="hidden");this.resizeHandlesHidden=!0}};var Oa=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){if(this.resizeHandlesHidden){if(null!=this.sizers)for(var t=0;t<this.sizers.length;t++)null!=this.sizers[t]&&(this.sizers[t].node.style.display="");null!=this.rotationShape&&(this.rotationShape.node.style.visibility="");this.resizeHandlesHidden=null}t=this.graph;for(var A=null!=this.state?t.model.getParent(this.state.cell):null;null!=A;){if(t.isTransparentBounds(A)){var B=+t.selectionCellsHandler.getHandler(A);null!=B&&null!=B.selectionBorder&&(B.selectionBorder.node.style.visibility="")}A=t.model.getParent(A)}Oa.apply(this,arguments)};mxVertexHandler.prototype.setHandlesVisible=function(t){Va.apply(this,arguments);if(null!=this.moveHandles)for(var A=0;A<this.moveHandles.length;A++)null!=this.moveHandles[A]&&(this.moveHandles[A].node.style.visibility=t?"":"hidden");if(null!=this.cornerHandles)for(A=0;A<this.cornerHandles.length;A++)this.cornerHandles[A].node.style.visibility=+t?"":"hidden";this.graph.isTransparentBounds(this.state.cell)&&null!=this.selectionBorder&&(this.selectionBorder.node.style.visibility=t?"":"hidden")};mxVertexHandler.prototype.isMoveHandlesVisible=function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};mxVertexHandler.prototype.refreshMoveHandles=function(){var t=this.isMoveHandlesVisible();t&&null==this.moveHandles?this.moveHandles=this.createMoveHandles():t||null==this.moveHandles||this.destroyMoveHandles();+if(t&&null==this.moveHandles){for(t=0;t<this.moveHandles.length;t++)null!=this.moveHandles[t]&&this.moveHandles[t].parentNode.removeChild(this.moveHandles[t]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=function(){for(var t=this.graph,A=t.model,B=[],F=0;F<A.getChildCount(this.state.cell);F++)mxUtils.bind(this,function(I){if(null!=I&&A.isVertex(I.cell)&&t.isCellMovable(I.cell)){var O=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);O=new mxImageShape(O,+this.rowHandleImage.src);O.rowState=I;O.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;O.init(this.graph.getView().getOverlayPane());O.node.style.cursor="move";mxEvent.addGestureListeners(O.node,mxUtils.bind(this,function(R){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(R)&&this.graph.isCellSelected(I.cell)||this.graph.selectCellForEvent(I.cell,R);mxEvent.isPopupTrigger(R)||(this.graph.graphHandler.start(this.state.cell,+mxEvent.getClientX(R),mxEvent.getClientY(R),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(R),this.graph.isMouseDown=!0);mxEvent.consume(R)}),null,mxUtils.bind(this,function(R){mxEvent.isPopupTrigger(R)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(R),mxEvent.getClientY(R),I.cell,R),mxEvent.consume(R))}));B.push(O)}else B.push(null)})(this.graph.view.getState(A.getChildAt(this.state.cell,F)));return B};mxVertexHandler.prototype.destroyMoveHandles=+function(){if(null!=this.moveHandles){for(var t=0;t<this.moveHandles.length;t++)null!=this.moveHandles[t]&&this.moveHandles[t].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=function(){if(null!=this.cornerHandles){for(var t=0;t<this.cornerHandles.length;t++)null!=this.cornerHandles[t]&&null!=this.cornerHandles[t].node&&null!=this.cornerHandles[t].node.parentNode&&this.cornerHandles[t].node.parentNode.removeChild(this.cornerHandles[t].node);this.cornerHandles=null}};+var oa=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){oa.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell))this.refreshMoveHandles();else if(this.graph.isCellMovable(this.state.cell)&&(this.graph.isTransparentBounds(this.state.cell)||1==this.graph.getSelectionCount()&&(this.graph.isTableCell(this.state.cell)||this.graph.isTableRow(this.state.cell)))){this.cornerHandles=+[];for(var t=0;4>t;t++){var A=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);A.dialect=mxConstants.DIALECT_SVG;A.init(this.graph.view.getOverlayPane());this.cornerHandles.push(A)}}this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();t=this.graph.getLinkForCell(this.state.cell);A=this.graph.getLinksForState(this.state);this.updateLinkHint(t,A)};var Ja=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=+function(){var t=new mxPoint(0,0),A=this.tolerance,B=this.state.style.shape;null==mxCellRenderer.defaultShapes[B]&&mxStencilRegistry.getStencil(B);B=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;if(!B&&null!=this.customHandles)for(var F=0;F<this.customHandles.length;F++)if(null!=this.customHandles[F]&&!this.customHandles[F].lockHandle&&!this.customHandles[F].editIconHandle&&!this.customHandles[F].moveGroupHandle&&null!=this.customHandles[F].shape&&null!=+this.customHandles[F].shape.bounds){var I=this.customHandles[F].shape.bounds,O=I.getCenterX(),R=I.getCenterY();if(Math.abs(this.state.x-O)<I.width/2||Math.abs(this.state.y-R)<I.height/2||Math.abs(this.state.x+this.state.width-O)<I.width/2||Math.abs(this.state.y+this.state.height-R)<I.height/2){B=!0;break}}B&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(A/=2,this.graph.isTable(this.state.cell)&&(A+=7),t.x=this.sizers[0].bounds.width+A,t.y=this.sizers[0].bounds.height+A):t=Ja.apply(this,+arguments);return t};mxVertexHandler.prototype.updateHint=function(t){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"°";else{t=this.state.view.scale;var A=this.state.view.unit;this.hint.innerHTML=b(this.roundLength(this.bounds.width/t),A)+" x "+b(this.roundLength(this.bounds.height/t),A)}t=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?+this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==t&&(t=this.bounds);this.hint.style.left=t.x+Math.round((t.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=t.y+t.height+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")}};mxVertexHandler.prototype.removeHint=function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};var db=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=+function(){db.apply(this,arguments);var t=this.graph.getLinkForCell(this.state.cell),A=this.graph.getLinksForState(this.state);this.updateLinkHint(t,A)};var rb=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(t,A){rb.apply(this,arguments);null!=this.linkHint&&"none"!=this.linkHint.style.display&&null!=this.graph.graphHandler&&null!=this.graph.graphHandler.first&&(this.linkHint.style.display="none")};var jb=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=+function(t,A){jb.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(t,A,B){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));var F=this.graph.view.translate,I=this.graph.view.scale,O=this.roundLength(A.x/I-F.x);F=this.roundLength(A.y/I-F.y);var R=this.graph.view.unit;this.hint.innerHTML=b(O,R)+", "+b(F,R);this.hint.style.visibility=+"visible";null!=B&&(B.view.updateEdgeBounds(B),this.hint.innerHTML+=" ("+(R==mxConstants.POINTS?Math.round(B.length/I):b(B.length/I,R))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(B=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*B.x)+"%, "+Math.round(100*B.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=+Math.round(t.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(t.getGraphY(),A.y)+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")};Graph.createFoldingImage=function(t,A){return A?Graph.createSvgImage(t,t,'<defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 4.5 2 L 4.5 7 M 2 4.5 L 7 4.5 z" stroke="#000"/>',+9,9):Graph.createSvgImage(t,t,'<defs><linearGradient id="grad1" x1="50%" y1="0%" x2="50%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 2 4.5 L 7 4.5 z" stroke="#000"/>',9,9)};Graph.updateFoldingImages=function(t){Graph.prototype.expandedImage=Graph.createFoldingImage(t,!1);Graph.prototype.collapsedImage=Graph.createFoldingImage(t,+!0)};Graph.updateFoldingImages(9);Graph.foldingImages={};Graph.prototype.getFoldingImage=function(t){var A=mxGraph.prototype.getFoldingImage.apply(this,arguments);if(null!=A){var B=parseInt(mxUtils.getValue(t.style,"foldingIconSize",0));if(0<B){var F=B+"-"+this.isCellCollapsed(t.cell);A=Graph.foldingImages[F];null==A&&(A=Graph.createFoldingImage(B,this.isCellCollapsed(t.cell)),Graph.foldingImages[F]=A)}}return A};mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;HoverIcons.prototype.mainHandle=+Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');+HoverIcons.prototype.endFixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.terminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.endTerminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="'++HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.rotationHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" fill="'+HoverIcons.prototype.arrowFill+'" d="M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"/>',24,24);HoverIcons.prototype.connectHandle=Graph.createSvgImage(16,16,'<circle cx="12" cy="12" r="10" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><path transform="translate(5,5) scale(0.583)" d="M6 18v-3h7.6L4 5.4 5.4 4 15 13.6V6h3v12z" fill="#fff"/>',24,24);HoverIcons.prototype.lockHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/>',24,24);HoverIcons.prototype.unlockHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M18 8h-1V6c0-2.76-2.24-5-5-5-2.28 0-4.27 .54-4.84 2.75-.14.54.18 1.08.72 1.22.53.14 1.08-.18 1.22-.72C9.44 3.93 10.63 3 12 3c1.65 0 3 1.35 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/>',24,24);HoverIcons.prototype.editHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/>',24,24);HoverIcons.prototype.moveHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M12 2 L9 5 L11 5 L11 11 L5 11 L5 9 L2 12 L5 15 L5 13 L11 13 L11 19 L9 19 L12 22 L15 19 L13 19 L13 13 L19 13 L19 15 L22 12 L19 9 L19 11 L13 11 L13 5 L15 5 Z"/>',@@ -3324,7 +3325,7 @@ arguments);"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.endMovePrmxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxConstraintHandler.prototype.getTolerance=function(t){return mxEvent.isMouseEvent(t.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(t){var A=t.getEvent();return null==t.getState()&&!mxEvent.isMouseEvent(A)||mxEvent.isPopupTrigger(A)&&(null==t.getState()||mxEvent.isControlDown(A)||mxEvent.isShiftDown(A))}}else mxPanningHandler.prototype.isPanningTrigger=function(t){var A=t.getEvent();return mxEvent.isLeftMouseButton(A)&&(this.useLeftButtonForPanning&&null==t.getState()||mxEvent.isControlDown(A)&&!mxEvent.isShiftDown(A))||this.usePopupTrigger&&mxEvent.isPopupTrigger(A)};mxRubberband.prototype.isSpaceEvent=function(t){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&(mxEvent.isControlDown(t.getEvent())||mxEvent.isMetaDown(t.getEvent()))&&mxEvent.isShiftDown(t.getEvent())&&mxEvent.isAltDown(t.getEvent())};mxRubberband.prototype.cancelled=!1;mxRubberband.prototype.cancel=function(){this.isActive()&&(this.cancelled=!0,this.reset())};mxRubberband.prototype.mouseUp=function(t,A){if(this.cancelled)this.cancelled=!1,A.consume();else{var B=null!=this.div&&"none"!=this.div.style.display,F=null,I=null,O=t=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(F=this.first.x,I=this.first.y,t=(this.currentX-F)/this.graph.view.scale,O=(this.currentY-I)/this.graph.view.scale,mxEvent.isAltDown(A.getEvent())||(t=this.graph.snap(t),O=-this.graph.snap(O),this.graph.isGridEnabled()||(Math.abs(t)<this.graph.tolerance&&(t=0),Math.abs(O)<this.graph.tolerance&&(O=0))));this.reset();if(B){if(this.isSpaceEvent(A)){this.graph.model.beginUpdate();try{var R=this.graph.getCellsBeyond(F,I,this.graph.getDefaultParent(),!0,!0);for(B=0;B<R.length;B++)if(this.graph.isCellMovable(R[B])){var ea=this.graph.view.getState(R[B]),ia=this.graph.getCellGeometry(R[B]);null!=ea&&null!=ia&&(ia=ia.clone(),ia.translate(t,O),this.graph.model.setGeometry(R[B],+this.graph.snap(O),this.graph.isGridEnabled()||(Math.abs(t)<this.graph.tolerance&&(t=0),Math.abs(O)<this.graph.tolerance&&(O=0))));this.reset();if(B){if(this.isSpaceEvent(A)){this.graph.model.beginUpdate();try{var R=this.graph.getCellsBeyond(F,I,this.graph.getDefaultParent(),!0,!0);for(B=0;B<R.length;B++)if(this.graph.isCellMovable(R[B])){var da=this.graph.view.getState(R[B]),ia=this.graph.getCellGeometry(R[B]);null!=da&&null!=ia&&(ia=ia.clone(),ia.translate(t,O),this.graph.model.setGeometry(R[B],ia))}}finally{this.graph.model.endUpdate()}}else R=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(R,A.getEvent());A.consume()}}};mxRubberband.prototype.mouseMove=function(t,A){if(!A.isConsumed()&&null!=this.first){var B=mxUtils.getScrollOrigin(this.graph.container);t=mxUtils.getOffset(this.graph.container);B.x-=t.x;B.y-=t.y;t=A.getX()+B.x;B=A.getY()+B.y;var F=this.first.x-t,I=this.first.y-B,O=this.graph.tolerance;if(null!=this.div||Math.abs(F)>O||Math.abs(I)>O)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(t,B),this.isSpaceEvent(A)?(t=this.x+this.width,B=this.y+this.height,F=this.graph.view.scale,mxEvent.isAltDown(A.getEvent())||(this.width=this.graph.snap(this.width/F)*F,this.height=this.graph.snap(this.height/F)*F,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=t-this.width),this.y<this.first.y&&(this.y=B-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+@@ -3347,10 +3348,10 @@ function(t,A){ab.apply(this,arguments);this.resizeHandlesHidden&&null!=this.indemxVertexHandler.prototype.mouseUp=function(t,A){Hb.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="");this.blockDelayedSelection=null};mxVertexHandler.prototype.updateLinkHint=function(t,A){try{if(null==t&&(null==A||0==A.length))null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=t||null!=A&&0<A.length){var B=document.createElement("img");B.className="geAdaptiveAsset";B.setAttribute("src",Editor.editImage);B.setAttribute("title",mxResources.get("editLink"));B.setAttribute("width","14");B.setAttribute("height","14");B.style.paddingLeft="8px";B.style.marginLeft="auto";B.style.marginBottom="-1px";B.style.cursor="pointer";var F=B.cloneNode(!0);F.setAttribute("src",Editor.trashImage);F.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));F.style.paddingLeft="4px";F.style.marginLeft="0";null==this.linkHint&&(this.linkHint=a(),mxUtils.setPrefixedStyle(this.linkHint.style,"transform","translate(-50%,0)"),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint),mxEvent.addListener(this.linkHint,-"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()})));this.linkHint.innerText="";if(null!=t){var I=document.createElement("div");I.style.display="flex";I.style.alignItems="center";I.appendChild(this.graph.createLinkForHint(t,null,this.state.cell));this.linkHint.appendChild(I);if(this.graph.isEnabled()&&"function"===typeof this.graph.editLink&&!this.graph.isCellLocked(this.state.cell)){var O=B.cloneNode(!0);I.appendChild(O);mxEvent.addListener(O,"click",mxUtils.bind(this,function(ea){this.graph.setSelectionCell(this.state.cell);-this.graph.editLink();mxEvent.consume(ea)}));var R=F.cloneNode(!0);I.appendChild(R);mxEvent.addListener(R,"click",mxUtils.bind(this,function(ea){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(ea)}))}}if(null!=A)for(I=0;I<A.length;I++)mxUtils.bind(this,function(ea,ia){var da=document.createElement("div");da.style.display="flex";da.style.alignItems="center";da.style.marginTop=null!=t||0<ia?"6px":"0px";da.appendChild(this.graph.createLinkForHint(ea.getAttribute("href"),mxUtils.getTextContent(ea),-this.state.cell));var za=B.cloneNode(!0);da.appendChild(za);var Fa=mxUtils.bind(this,function(Ga){var ca=document.createElement("div");ca.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var wa=ca.getElementsByTagName("a")[ia];if(null!=wa){if(null==Ga||""==Ga){for(Ga=wa.cloneNode(!0).firstChild;null!=Ga;)wa.parentNode.insertBefore(Ga.cloneNode(!0),wa),Ga=Ga.nextSibling;wa.parentNode.removeChild(wa)}else wa.setAttribute("href",Ga);this.graph.labelChanged(this.state.cell,ca.innerHTML)}});-mxEvent.addListener(za,"click",mxUtils.bind(this,function(Ga){this.graph.showLinkDialog(ea.getAttribute("href")||"",mxResources.get("ok"),Fa);mxEvent.consume(Ga)}));za=F.cloneNode(!0);da.appendChild(za);mxEvent.addListener(za,"click",mxUtils.bind(this,function(Ga){Fa();mxEvent.consume(Ga)}));this.linkHint.appendChild(da)})(A[I],I)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(ea){}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var pb=mxEdgeHandler.prototype.createConstraintHandler;+"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()})));this.linkHint.innerText="";if(null!=t){var I=document.createElement("div");I.style.display="flex";I.style.alignItems="center";I.appendChild(this.graph.createLinkForHint(t,null,this.state.cell));this.linkHint.appendChild(I);if(this.graph.isEnabled()&&"function"===typeof this.graph.editLink&&!this.graph.isCellLocked(this.state.cell)){var O=B.cloneNode(!0);I.appendChild(O);mxEvent.addListener(O,"click",mxUtils.bind(this,function(da){this.graph.setSelectionCell(this.state.cell);+this.graph.editLink();mxEvent.consume(da)}));var R=F.cloneNode(!0);I.appendChild(R);mxEvent.addListener(R,"click",mxUtils.bind(this,function(da){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(da)}))}}if(null!=A)for(I=0;I<A.length;I++)mxUtils.bind(this,function(da,ia){var ea=document.createElement("div");ea.style.display="flex";ea.style.alignItems="center";ea.style.marginTop=null!=t||0<ia?"6px":"0px";ea.appendChild(this.graph.createLinkForHint(da.getAttribute("href"),mxUtils.getTextContent(da),+this.state.cell));var za=B.cloneNode(!0);ea.appendChild(za);var Fa=mxUtils.bind(this,function(Ga){var ca=document.createElement("div");ca.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var wa=ca.getElementsByTagName("a")[ia];if(null!=wa){if(null==Ga||""==Ga){for(Ga=wa.cloneNode(!0).firstChild;null!=Ga;)wa.parentNode.insertBefore(Ga.cloneNode(!0),wa),Ga=Ga.nextSibling;wa.parentNode.removeChild(wa)}else wa.setAttribute("href",Ga);this.graph.labelChanged(this.state.cell,ca.innerHTML)}});+mxEvent.addListener(za,"click",mxUtils.bind(this,function(Ga){this.graph.showLinkDialog(da.getAttribute("href")||"",mxResources.get("ok"),Fa);mxEvent.consume(Ga)}));za=F.cloneNode(!0);ea.appendChild(za);mxEvent.addListener(za,"click",mxUtils.bind(this,function(Ga){Fa();mxEvent.consume(Ga)}));this.linkHint.appendChild(ea)})(A[I],I)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(da){}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var pb=mxEdgeHandler.prototype.createConstraintHandler;mxEdgeHandler.prototype.createConstraintHandler=function(){var t=pb.apply(this,arguments);t.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});return t};var Fb=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){Fb.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var Tb=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){if(null!=this.moveHandles)for(var t=0;t<this.moveHandles.length;t++)null!=this.moveHandles[t]&&(this.moveHandles[t].bounds.x=Math.round(this.moveHandles[t].rowState.x+this.moveHandles[t].rowState.width-this.moveHandles[t].bounds.width/2),this.moveHandles[t].bounds.y=Math.round(this.moveHandles[t].rowState.y+(this.moveHandles[t].rowState.height-this.moveHandles[t].bounds.height)/2),this.moveHandles[t].redraw());if(null!=this.cornerHandles){t=this.getSelectionBorderInset();var A=this.cornerHandles,B=A[0].bounds.height/2;A[0].bounds.x=this.state.x-A[0].bounds.width/2+t;A[0].bounds.y=this.state.y-B+t;A[0].redraw();A[1].bounds.x=A[0].bounds.x+this.state.width-2*t;A[1].bounds.y=A[0].bounds.y;A[1].redraw();A[2].bounds.x=A[0].bounds.x;A[2].bounds.y=this.state.y+this.state.height-2*t;A[2].redraw();A[3].bounds.x=A[1].bounds.x;A[3].bounds.y=A[2].bounds.y;A[3].redraw();A=1==this.graph.getSelectionCount()&&(!this.graph.isTransparentBounds(this.state.cell)||this.graph.isCellSelected(this.state.cell));@@ -3619,7 +3620,7 @@ c.getSelectionCells();for(ra=0;ra<Sb.length&&!Gb;ra++){var Kb=c.view.getState(SbmxUtils.write(Rb,"⚠︎");vb.appendChild(Rb);vb.setAttribute("title","Label cannot be converted to SVG and falls back to HTML rendering. Uncheck to remove the style.")}else vb.style.opacity="0.5",yb.setAttribute("disabled","disabled"),vb.setAttribute("title","Label contains unsupported HTML or vertical text for SVG conversion. Supported: H1-H6, P, PRE, BLOCKQUOTE, DIV, B, I, U, STRIKE, SUP, SUB, SPAN, FONT, BR (without background color).")}else yb.checked||(vb.style.opacity="0.5",yb.setAttribute("disabled","disabled"));var Ub=this.createCellOption(mxResources.get("autosizeText"),"autosizeText","0",null,null,mxUtils.bind(this,function(ca,wa){if(wa)for(wa=0;wa<ca.length;wa++)c.model.isVertex(ca[wa])&&c.updateAutosizeTextFontSize(ca[wa])}));Ub.style.fontWeight="bold";0<h.vertices.length&&h.resizable&&kb.appendChild(Ub);if(!g.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)vb.getElementsByTagName("span")[0].style.maxWidth="172px",vb.appendChild(g.menus.createHelpLink("https://www.drawio.com/docs/manual/text/svg-labels/"));var ob=this.createPanel();ob.style.height="86px";var Db=this.addUnitInput(ob,this.getUnit(),87,52,function(){R.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Db.setAttribute("title",mxResources.get("top"));var Lb=this.addUnitInput(ob,this.getUnit(),16,52,function(){O.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Lb.setAttribute("title",mxResources.get("global"));mxUtils.br(ob);this.addLabel(ob,mxResources.get("top"),87,64);this.addLabel(ob,mxResources.get("global"),-16,64);mxUtils.br(ob);mxUtils.br(ob);var Mb=this.addUnitInput(ob,this.getUnit(),158,52,function(){da.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Mb.setAttribute("title",mxResources.get("left"));var Eb=this.addUnitInput(ob,this.getUnit(),87,52,function(){ia.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Eb.setAttribute("title",mxResources.get("bottom"));var Cb=this.addUnitInput(ob,this.getUnit(),16,52,function(){ea.apply(this,arguments)},this.getUnitStep(),+16,64);mxUtils.br(ob);mxUtils.br(ob);var Mb=this.addUnitInput(ob,this.getUnit(),158,52,function(){ea.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Mb.setAttribute("title",mxResources.get("left"));var Eb=this.addUnitInput(ob,this.getUnit(),87,52,function(){ia.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Eb.setAttribute("title",mxResources.get("bottom"));var Cb=this.addUnitInput(ob,this.getUnit(),16,52,function(){da.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Cb.setAttribute("title",mxResources.get("right"));mxUtils.br(ob);this.addLabel(ob,mxResources.get("left"),158,64);this.addLabel(ob,mxResources.get("bottom"),87,64);this.addLabel(ob,mxResources.get("right"),16,64);var ab=this.createPanel();ab.className="geFormatEntry";ab.style.fontWeight="bold";mxUtils.write(ab,mxResources.get("labelWidth"));ab.setAttribute("title",mxResources.get("labelWidth"));var Hb=mxUtils.bind(this,function(ca){var wa=this.isFloatUnit()?parseFloat(pb.value):parseInt(pb.value);wa=isNaN(wa)?null:Math.max(1,this.fromUnit(wa));if(wa!=mxUtils.getValue(g.getSelectionState().style,mxConstants.STYLE_LABEL_WIDTH,null)){c.isEditing()&&c.stopEditing(!0);var ya=g.getSelectionState().cells;c.getModel().beginUpdate();try{c.setCellStyles(mxConstants.STYLE_LABEL_WIDTH,wa,ya),g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_LABEL_WIDTH],"values",[wa],"cells",ya))}finally{c.getModel().endUpdate()}}pb.value=null==wa?"":this.inUnit(wa)+" "+this.getUnit();mxEvent.consume(ca)}),pb=this.addUnitInput(ab,this.getUnit(),16,52,function(){Hb.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());pb.setAttribute("title",mxResources.get("labelWidth"));mxEvent.addListener(pb,"change",Hb);mxEvent.addListener(pb,"blur",Hb);if(c.cellEditor.isContentEditing()){var Fb=null,Tb=null;a.appendChild(this.createRelativeOption(mxResources.get("lineheight"),null,null,function(ca){var wa=""==ca.value?120:parseInt(ca.value);wa=Math.max(0,isNaN(wa)?120:wa);@@ -3640,8 +3641,8 @@ ca=mxUtils.getValue(h.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_C"bottom":ca==mxConstants.ALIGN_RIGHT&&wa==mxConstants.ALIGN_BOTTOM?"bottomRight":ca==mxConstants.ALIGN_LEFT?"left":ca==mxConstants.ALIGN_RIGHT?"right":"center";ca=mxUtils.getValue(h.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);ca==mxConstants.TEXT_DIRECTION_RTL?sa.value="rightToLeft":ca==mxConstants.TEXT_DIRECTION_LTR?sa.value="leftToRight":ca!=mxConstants.TEXT_DIRECTION_AUTO&&h.html?ca==mxConstants.TEXT_DIRECTION_VERTICAL_LR?sa.value="vertical-leftToRight":ca==mxConstants.TEXT_DIRECTION_VERTICAL_RL&&(sa.value="vertical-rightToLeft"):sa.value="automatic";if(ya||document.activeElement!=Lb)ca=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING,2)),Lb.value=isNaN(ca)?"":this.inUnit(ca)+" "+this.getUnit();if(ya||document.activeElement!=Db)ca=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING_TOP,0)),Db.value=isNaN(ca)?"":this.inUnit(ca)+" "+this.getUnit();if(ya||document.activeElement!=Cb)ca=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING_RIGHT,0)),Cb.value=isNaN(ca)?"":this.inUnit(ca)+" "+this.getUnit();if(ya||document.activeElement!=Eb)ca=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING_BOTTOM,0)),Eb.value=isNaN(ca)?"":this.inUnit(ca)+" "+this.getUnit();if(ya||document.activeElement!=Mb)ca=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING_LEFT,0)),Mb.value=isNaN(ca)?"":this.inUnit(ca)+" "+this.getUnit();if(ya||document.activeElement!=pb)ca=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_LABEL_WIDTH,"")),pb.value=isNaN(ca)?"":this.inUnit(ca)+-" "+this.getUnit()});var O=this.installInputHandler(Lb,mxConstants.STYLE_SPACING,2,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var R=this.installInputHandler(Db,mxConstants.STYLE_SPACING_TOP,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var ea=this.installInputHandler(Cb,mxConstants.STYLE_SPACING_RIGHT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var ia=this.installInputHandler(Eb,mxConstants.STYLE_SPACING_BOTTOM,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),-!0);var da=this.installInputHandler(Mb,mxConstants.STYLE_SPACING_LEFT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);this.addKeyHandler(Aa,I);this.addKeyHandler(Lb,I);this.addKeyHandler(Db,I);this.addKeyHandler(Cb,I);this.addKeyHandler(Eb,I);this.addKeyHandler(Mb,I);this.addKeyHandler(pb,I);c.getModel().addListener(mxEvent.CHANGE,I);this.listeners.push({destroy:function(){c.getModel().removeListener(I)}});I();if(c.cellEditor.isContentEditing()){var za=null,Fa=!1,Ga=mxUtils.bind(this,function(){Fa||+" "+this.getUnit()});var O=this.installInputHandler(Lb,mxConstants.STYLE_SPACING,2,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var R=this.installInputHandler(Db,mxConstants.STYLE_SPACING_TOP,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var da=this.installInputHandler(Cb,mxConstants.STYLE_SPACING_RIGHT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var ia=this.installInputHandler(Eb,mxConstants.STYLE_SPACING_BOTTOM,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),+!0);var ea=this.installInputHandler(Mb,mxConstants.STYLE_SPACING_LEFT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);this.addKeyHandler(Aa,I);this.addKeyHandler(Lb,I);this.addKeyHandler(Db,I);this.addKeyHandler(Cb,I);this.addKeyHandler(Eb,I);this.addKeyHandler(Mb,I);this.addKeyHandler(pb,I);c.getModel().addListener(mxEvent.CHANGE,I);this.listeners.push({destroy:function(){c.getModel().removeListener(I)}});I();if(c.cellEditor.isContentEditing()){var za=null,Fa=!1,Ga=mxUtils.bind(this,function(){Fa||(Fa=!0,window.setTimeout(mxUtils.bind(this,function(){var ca=c.getSelectedEditingElement();if(null!=ca&&null!=c.cellEditor.textarea){var wa=function(Wa,cb){if(null!=Wa&&null!=cb){if(Wa==cb)return!0;if(Wa.length>cb.length+1)return Wa.substring(Wa.length-cb.length-1,Wa.length)=="-"+cb}return!1},ya=function(Wa){if(null!=c.getParentByName(ca,Wa,c.cellEditor.textarea))return!0;for(var cb=ca;null!=cb&&1==cb.childNodes.length;)if(cb=cb.childNodes[0],cb.nodeName==Wa)return!0;return!1},Ia=function(Wa){for(;null!=Wa&&Wa!=c.cellEditor.textarea;){if("block"==mxUtils.getCurrentStyle(Wa).display)return Wa;Wa=Wa.parentNode}return null},Ca=mxUtils.getCurrentStyle(ca),Ka=ca==c.cellEditor.textarea||""==ca.style.lineHeight?null:ca.style.lineHeight,Da=ca==c.cellEditor.textarea||""==ca.style.fontSize?null:b(Ca);if(window.getSelection)for(var Ya=ca.getElementsByTagName("*"),Za=window.getSelection(),Ta=0;Ta<Ya.length&&(!Za.containsNode(Ya[Ta],!0)||null==Ya[Ta].style||(null==Da&&""!=Ya[Ta].style.fontSize&&(Da=parseFloat(Ya[Ta].style.fontSize)),null==Ka&&""!=Ya[Ta].style.lineHeight&&(Ka=Ya[Ta].style.lineHeight),null==Da||null==Ka));Ta++);null==Da&&(Da=b(Ca));if(null==Ka)for(Ya=ca;null!=Ya&&Ya!=c.cellEditor.textarea.parentNode;){if(null!=Ya.style&&""!=Ya.style.lineHeight){Ka=Ya.style.lineHeight;break}Ya=Ya.parentNode}if(null!=Ca){f(G[0],"bold"==Ca.fontWeight||400<Ca.fontWeight||ya("B")||ya("STRONG"));f(G[1],"italic"==Ca.fontStyle||ya("I")||ya("EM"));f(G[2],"underline"==Ca.textDecorationLine||ya("U"));f(ja,"line-through"==Ca.textDecorationLine||@@ -3809,10 +3810,10 @@ q/2);s=this.scale;m=this.bounds.x/s;r=this.bounds.y/s;n=this.bounds.width/s;q=thnull!=v.paintTableCellLines){var y=this.state.cell;if(null!=v.isTableRow&&v.isTableRow(y)){var J=this.getTitleSize();this.isHorizontal()?v.paintTableCellLines(d,y,0,0,n,Math.min(J,q),this.stroke,this.strokewidth):v.paintTableCellLines(d,y,0,0,Math.min(J,n),q,this.stroke,this.strokewidth)}else v.paintTableCellLines(d,y,0,0,n,q,this.stroke,this.strokewidth)}}};mxUtils.extend(f,mxCylinder);f.prototype.size=20;f.prototype.darkOpacity=0;f.prototype.darkOpacity2=0;f.prototype.paintVertexShape=function(d,m,r,n,q){var v=Math.max(0,Math.min(n,Math.min(q,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),y=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),J=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));d.translate(m,r);d.begin();d.moveTo(0,0);d.lineTo(n-v,0);d.lineTo(n,v);d.lineTo(n,q);d.lineTo(v,q);d.lineTo(0,q-v);d.lineTo(0,0);d.close();d.end();d.fillAndStroke();this.outline||(d.setShadow(!1),0!=y&&(d.setFillAlpha(Math.abs(y)),d.setFillColor(0>y?"#FFFFFF":"#000000"),d.begin(),d.moveTo(0,0),d.lineTo(n-v,0),d.lineTo(n,v),d.lineTo(v,v),d.close(),d.fill()),0!=J&&(d.setFillAlpha(Math.abs(J)),d.setFillColor(0>J?"#FFFFFF":"#000000"),d.begin(),d.moveTo(0,0),d.lineTo(v,v),d.lineTo(v,q),d.lineTo(0,q-v),d.close(),d.fill()),d.begin(),d.moveTo(v,q),d.lineTo(v,v),d.lineTo(0,0),d.moveTo(v,v),d.lineTo(n,v),d.end(),d.stroke())};f.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,-"boundedLbl",!1)?(d=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(d,d,0,0)):null};mxCellRenderer.registerShape("cube",f);var R=Math.tan(mxUtils.toRadians(30)),ea=(.5-R)/2;mxCellRenderer.registerShape("isoRectangle",h);mxUtils.extend(g,mxConnector);g.prototype.paintEdgeShape=function(d,m){var r=this.createMarker(d,m,!0),n=this.createMarker(d,m,!1);d.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&d.setDashed(this.isDashed,+"boundedLbl",!1)?(d=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(d,d,0,0)):null};mxCellRenderer.registerShape("cube",f);var R=Math.tan(mxUtils.toRadians(30)),da=(.5-R)/2;mxCellRenderer.registerShape("isoRectangle",h);mxUtils.extend(g,mxConnector);g.prototype.paintEdgeShape=function(d,m){var r=this.createMarker(d,m,!0),n=this.createMarker(d,m,!1);d.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&d.setDashed(this.isDashed,null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);d.setShadow(!1);d.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);d.setStrokeColor(this.stroke);d.setFillColor(this.stroke);d.setDashed(!1);null!=r&&r();null!=n&&n()};mxCellRenderer.registerShape("wire",g);mxUtils.extend(c,mxCylinder);c.prototype.size=6;c.prototype.paintVertexShape=function(d,m,r,n,q){d.setFillColor(this.stroke);var v=Math.max(0,parseFloat(mxUtils.getValue(this.style,-"size",this.size))-2)+2*this.strokewidth;d.ellipse(m+.5*(n-v),r+.5*(q-v),v,v);d.fill();d.setFillColor(mxConstants.NONE);d.rect(m,r,n,q);d.fill()};mxCellRenderer.registerShape("waypoint",c);mxUtils.extend(h,mxActor);h.prototype.size=20;h.prototype.redrawPath=function(d,m,r,n,q){m=Math.min(n,q/R);d.translate((n-m)/2,(q-m)/2+m/4);d.moveTo(0,.25*m);d.lineTo(.5*m,m*ea);d.lineTo(m,.25*m);d.lineTo(.5*m,(.5-ea)*m);d.lineTo(0,.25*m);d.close();d.end()};mxCellRenderer.registerShape("isoRectangle",h);mxUtils.extend(k,-mxCylinder);k.prototype.size=20;k.prototype.redrawPath=function(d,m,r,n,q,v){m=Math.min(n,q/(.5+R));v?(d.moveTo(0,.25*m),d.lineTo(.5*m,(.5-ea)*m),d.lineTo(m,.25*m),d.moveTo(.5*m,(.5-ea)*m),d.lineTo(.5*m,(1-ea)*m)):(d.translate((n-m)/2,(q-m)/2),d.moveTo(0,.25*m),d.lineTo(.5*m,m*ea),d.lineTo(m,.25*m),d.lineTo(m,.75*m),d.lineTo(.5*m,(1-ea)*m),d.lineTo(0,.75*m),d.close());d.end()};mxCellRenderer.registerShape("isoCube",k);mxUtils.extend(p,mxCylinder);p.prototype.redrawPath=function(d,m,r,n,q,v){m=Math.min(q/+"size",this.size))-2)+2*this.strokewidth;d.ellipse(m+.5*(n-v),r+.5*(q-v),v,v);d.fill();d.setFillColor(mxConstants.NONE);d.rect(m,r,n,q);d.fill()};mxCellRenderer.registerShape("waypoint",c);mxUtils.extend(h,mxActor);h.prototype.size=20;h.prototype.redrawPath=function(d,m,r,n,q){m=Math.min(n,q/R);d.translate((n-m)/2,(q-m)/2+m/4);d.moveTo(0,.25*m);d.lineTo(.5*m,m*da);d.lineTo(m,.25*m);d.lineTo(.5*m,(.5-da)*m);d.lineTo(0,.25*m);d.close();d.end()};mxCellRenderer.registerShape("isoRectangle",h);mxUtils.extend(k,+mxCylinder);k.prototype.size=20;k.prototype.redrawPath=function(d,m,r,n,q,v){m=Math.min(n,q/(.5+R));v?(d.moveTo(0,.25*m),d.lineTo(.5*m,(.5-da)*m),d.lineTo(m,.25*m),d.moveTo(.5*m,(.5-da)*m),d.lineTo(.5*m,(1-da)*m)):(d.translate((n-m)/2,(q-m)/2),d.moveTo(0,.25*m),d.lineTo(.5*m,m*da),d.lineTo(m,.25*m),d.lineTo(m,.75*m),d.lineTo(.5*m,(1-da)*m),d.lineTo(0,.75*m),d.close());d.end()};mxCellRenderer.registerShape("isoCube",k);mxUtils.extend(p,mxCylinder);p.prototype.redrawPath=function(d,m,r,n,q,v){m=Math.min(q/2,Math.round(q/8)+this.strokewidth-1);if(v&&null!=this.fill||!v&&null==this.fill)d.moveTo(0,m),d.curveTo(0,2*m,n,2*m,n,m),v||(d.stroke(),d.begin()),d.translate(0,m/2),d.moveTo(0,m),d.curveTo(0,2*m,n,2*m,n,m),v||(d.stroke(),d.begin()),d.translate(0,m/2),d.moveTo(0,m),d.curveTo(0,2*m,n,2*m,n,m),v||(d.stroke(),d.begin()),d.translate(0,-m);v||(d.moveTo(0,m),d.curveTo(0,-m/3,n,-m/3,n,m),d.lineTo(n,q-m),d.curveTo(n,q+m/3,0,q+m/3,0,q-m),d.close())};p.prototype.getLabelMargins=function(d){return new mxRectangle(0,2.5*Math.min(d.height/2,Math.round(d.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",p);mxUtils.extend(l,mxCylinder);l.prototype.size=30;l.prototype.darkOpacity=0;l.prototype.paintVertexShape=function(d,m,r,n,q){var v=Math.max(0,Math.min(n,Math.min(q,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),y=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));d.translate(m,r);d.begin();d.moveTo(0,0);d.lineTo(n-v,0);d.lineTo(n,v);d.lineTo(n,q);d.lineTo(0,q);d.lineTo(0,0);d.close();d.end();d.fillAndStroke();this.outline||(d.setShadow(!1),0!=y&&(d.setFillAlpha(Math.abs(y)),d.setFillColor(0>y?"#FFFFFF":"#000000"),d.begin(),d.moveTo(n-v,0),d.lineTo(n-v,v),d.lineTo(n,v),d.close(),d.fill()),d.begin(),d.moveTo(n-v,0),d.lineTo(n-v,v),d.lineTo(n,v),d.end(),d.stroke())};mxCellRenderer.registerShape("note",l);mxUtils.extend(u,l);mxCellRenderer.registerShape("note2",u);u.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,@@ -3844,7 +3845,7 @@ this.fixedSize)))):n*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.styq);d.fillAndStroke();d.rect(4*m,0,m,q);d.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",fa);ja.prototype.moveTo=function(d,m){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=m;this.firstX=d;this.firstY=m};ja.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};ja.prototype.quadTo=function(d,m,r,n){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=r;this.lastY=n};ja.prototype.curveTo=function(d,m,r,n,q,v){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=q;this.lastY=v};ja.prototype.arcTo=function(d,m,r,n,q,v,y){this.originalArcTo.apply(this.canvas,arguments);this.lastX=v;this.lastY=y};ja.prototype.lineTo=function(d,m){if(null!=this.lastX&&null!=this.lastY){var r=function(P){return"number"===typeof P?P?0>P?-1:1:P===P?0:NaN:NaN},n=Math.abs(d-this.lastX),q=Math.abs(m-this.lastY),v=Math.sqrt(n*n+q*q);if(2>v){this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=m;return}var y=Math.round(v/10),J=this.defaultVariation;5>y&&(y=5,J/=3);var C=r(d-this.lastX)*n/y;r=r(m-this.lastY)*q/y;n/=v;q/=v;for(v=0;v<y;v++){var ba=(Math.random()-.5)*J;this.originalLineTo.call(this.canvas,C*v+this.lastX-ba*q,r*v+this.lastY-ba*n)}this.originalLineTo.call(this.canvas,d,m)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=m};ja.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=-this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var da=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(d){da.apply(this,arguments);null==d.handJiggle&&(d.handJiggle=this.createHandJiggle(d))};var za=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(d){za.apply(this,arguments);null!=d.handJiggle&&(d.handJiggle.destroy(),delete d.handJiggle)};+this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var ea=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(d){ea.apply(this,arguments);null==d.handJiggle&&(d.handJiggle=this.createHandJiggle(d))};var za=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(d){za.apply(this,arguments);null!=d.handJiggle&&(d.handJiggle.destroy(),delete d.handJiggle)};mxShape.prototype.createComicCanvas=function(d){return new ja(d,mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(d){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(d)};var Fa=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.outline&&(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")&&"0"==mxUtils.getValue(this.style,"sketch","1"==urlParams.rough?"1":"0"))&&Fa.apply(this,arguments)};var Ga=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(d,m,r,n,q){if(null==d.handJiggle||d.handJiggle.constructor!=ja)Ga.apply(this,arguments);else{var v=!0;null!=this.style&&(v="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(v||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)v||null!=this.fill&&this.fill!=mxConstants.NONE||(d.pointerEvents=!1),d.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?v=Math.min(n/2,Math.min(q/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(v=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,v=Math.min(n*v,q*v)),d.moveTo(m+v,r),d.lineTo(m+n-v,r),d.quadTo(m+n,r,m+n,r+v),d.lineTo(m+n,r+q-v),d.quadTo(m+n,r+q,m+n-v,r+q),d.lineTo(m+v,r+q),d.quadTo(m,r+q,m,r+q-v),@@ -7924,37 +7925,38 @@ this.addPaletteFunctions("electricalTransistors","Electrical / Transistors",!1,["nigbt;",64,100,"","NIGBT",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","nigbt","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"pnp_transistor_1;",95,100,"","BJT (PNP)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","pnp_transistor_1","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"pnp_transistor_5;",64,100,"","BJT (PNP)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","pnp_transistor_5","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"pigbt;",64,100,"","PIGBT",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","pigbt","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"n-channel_jfet_1;",95,100,"","N Channel JFET",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","n-channel_jfet_1","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"p-channel_jfet_1;",95,100,"","P Channel JFET",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","p-channel_jfet_1","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"n-channel_mosfet_1;",95,100,"","MOSFET (N)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","n-channel_mosfet_1","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"p-channel_mosfet_1;",95,100,"","MOSFET (P)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","p-channel_mosfet_1","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"mosfet_ic_n;",-95,100,"","NMOS",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_ic_n","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"mosfet_ic_p;",95,100,"","PMOS",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_ic_p","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"mosfet_n_no_bulk;",95,100,"","MOSFET No Bulk (N)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_n_no_bulk","electrical transistor ").join(" ")),-this.createVertexTemplateEntry(l+"mosfet_p_no_bulk;",95,100,"","MOSFET No Bulk (P)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_p_no_bulk","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"dual_gate_mosfet_n;",95,100,"","Dual Gate MOSFET (N)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","dual_gate_mosfet_n","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"dual_gate_mosfet_p;",95,100,"","Dual Gate MOSFET (P)",-null,null,this.getTagsForStencil("mxgraph.electrical.transistors","dual_gate_mosfet_p","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"nmos;pointerEvents=1;",60,100,"","NMOS",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","nmos","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"nmos_bulk;pointerEvents=1;",60,100,"","NMOS with Bulk",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","nmos bulk","electrical transistor ").join(" ")),-this.createVertexTemplateEntry(k+"pmos;pointerEvents=1;",60,100,"","PMOS",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","pmos","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"pmos_bulk;pointerEvents=1;",60,100,"","PMOS with Bulk",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","pmos bulk","electrical transistor ").join(" "))]);this.setCurrentSearchEntryLibrary("electrical","electricalInstruments");this.addPaletteFunctions("electricalInstruments",-"Electrical / Instruments",!1,[this.createVertexTemplateEntry("verticalLabelPosition=middle;shadow=0;dashed=0;align=center;html=1;verticalAlign=middle;strokeWidth=1;shape=ellipse;aspect=fixed;fontSize=50;",90,90,"A","Ammeter",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","ampermeter ammeter","electrical instrument ").join(" ")),this.createVertexTemplateEntry(w+"galvanometer;",90,90,"","Galvanometer",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","galvanometer",-"electrical instrument ").join(" ")),this.createVertexTemplateEntry(w+"oscilloscope;",90,90,"","Oscilloscope",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","oscilloscope","electrical instrument ").join(" ")),this.createVertexTemplateEntry(w+"signal_generator;",90,90,"","Signal Generator",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","signal_generator","electrical instrument ").join(" ")),this.createVertexTemplateEntry("verticalLabelPosition=middle;shadow=0;dashed=0;align=center;html=1;verticalAlign=middle;strokeWidth=1;shape=ellipse;aspect=fixed;fontSize=50;",-90,90,"V","Voltmeter",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","ampermeter ammeter","electrical instrument ").join(" "))]);this.setCurrentSearchEntryLibrary("electrical","electricalMisc");this.addPaletteFunctions("electricalMisc","Electrical / Misc",!1,[this.createVertexTemplateEntry(p+"aerial_-_antenna_1;",80,100,"","Antenna",null,null,this.getTagsForStencil("mxgraph.electrical.radio","aerial_-_antenna_1","electrical radio audio ").join(" ")),this.createVertexTemplateEntry(p+-"aerial_-_antenna_2;",79,100,"","Antenna",null,null,this.getTagsForStencil("mxgraph.electrical.radio","aerial_-_antenna_2","electrical radio audio ").join(" ")),this.createVertexTemplateEntry(p+"loop_antenna;",64.8,69.78,"","Loop Antenna",null,null,this.getTagsForStencil("mxgraph.electrical.radio","loop_antenna","electrical radio audio ").join(" ")),this.createVertexTemplateEntry(f+"loop_antenna",100,100,"","Loop Antenna",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","loop antenna",-"electrical ").join(" ")),this.createVertexTemplateEntry("verticalLabelPosition=middle;shadow=0;dashed=0;align=center;html=1;verticalAlign=middle;strokeWidth=1;shape=ellipse;aspect=fixed;fontSize=35;",60,60,"M","Electrical Motor",null,null,this.getTagsForStencil("mxgraph.electrical.electro-mechanical","motor_1","electrical switch relay ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_SHAPE+"=mxgraph.electrical.electro-mechanical.motor_2;html=1;shadow=0;dashed=0;align=center;fontSize=30;strokeWidth=1;",-100,60,"","Motor Armature",null,null,this.getTagsForStencil("mxgraph.electrical.electro-mechanical","motor_2","electrical switch relay ").join(" ")),this.createVertexTemplateEntry(f+"co-ax;",40,60,"","Co-Ax",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","co-ax","electrical ").join(" ")),this.createVertexTemplateEntry(f+"crystal_1;",100,40,"","Crystal",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","crystal_1","electrical ").join(" ")),this.createVertexTemplateEntry(f+-"fuse_1;",100,20,"","Fuse (IEC)",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","fuse_1","electrical ").join(" ")),this.createVertexTemplateEntry(f+"fuse_2;",100,20,"","Fuse (IEEE)",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","fuse_2","electrical ").join(" ")),this.createVertexTemplateEntry(f+"fuse_3;",100,12,"","Fuse (obsolete)",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","fuse_3","electrical ").join(" ")),this.createVertexTemplateEntry(f+-"fuse_4;",100,32,"","Fuse (IEEE)",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","fuse_4","electrical ").join(" ")),this.createVertexTemplateEntry(f+"light_bulb;",60,50,"","Light Bulb",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","light_bulb","electrical ").join(" ")),this.createVertexTemplateEntry(f+"illuminating_bulb;",60,50,"","Illuminating Bulb",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","illuminating_bulb","electrical ").join(" ")),-this.createVertexTemplateEntry(f+"light_bulb;",60,50,"","Pilot Light",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","light_bulb","electrical ").join(" ")),this.createVertexTemplateEntry(f+"neon_lamp_2;",60,50,"","Neon Lamp",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","neon_lamp_2","electrical ").join(" ")),this.createVertexTemplateEntry(f+"flourescent_lamp",80,30,"","Flourescent Lamp",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources",-"flourescent lamp","electrical ").join(" ")),this.createVertexTemplateEntry(m+"lamp",50,100,"","Lamp",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","lamp","electrical optical ").join(" ")),this.createVertexTemplateEntry(f+"thermocouple;",80,81,"","Thermocouple",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","thermocouple","electrical ").join(" ")),this.createVertexTemplateEntry(c+"amplifier;",90,100,"","Amplifier",null,null,this.getTagsForStencil("mxgraph.electrical.abstract",-"amplifier","electrical ").join(" ")),this.createVertexTemplateEntry(c+"controlled_amplifier;",100,90,"","Controlled Amplifier",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","controlled_amplifier","electrical ").join(" ")),this.createVertexTemplateEntry(c+"dac;",70,46,"","DAC",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","dac","electrical ").join(" ")),this.createVertexTemplateEntry("shadow=0;dashed=0;align=center;html=1;strokeWidth=1;shape=mxgraph.electrical.abstract.mux2;whiteSpace=wrap;",-80,120,"Mux","Mux",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","mux","electrical ").join(" ")),this.createVertexTemplateEntry("shadow=0;dashed=0;align=center;html=1;strokeWidth=1;shape=mxgraph.electrical.abstract.mux2;operation=demux;whiteSpace=wrap;",80,120,"Demux","Demux",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","mux","electrical ").join(" ")),this.createVertexTemplateEntry(c+"operational_amp_1;",98,90,"","Operational Amp",null,null,this.getTagsForStencil("mxgraph.electrical.abstract",-"operational_amp_1","electrical ").join(" ")),this.createVertexTemplateEntry(c+"operational_amp_2;",98,90,"","Operational Amp",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","operational_amp_2","electrical ").join(" ")),this.createVertexTemplateEntry(c+"ota_1;",100,90,"","OTA",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","ota_1","electrical ").join(" ")),this.createVertexTemplateEntry(c+"ota_2;",100,90,"","OTA",null,null,this.getTagsForStencil("mxgraph.electrical.abstract",-"ota_2","electrical ").join(" ")),this.createVertexTemplateEntry(c+"ota_3;",100,90,"","OTA",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","ota_3","electrical ").join(" ")),this.createVertexTemplateEntry(c+"quantizer;",52,46,"","Quantizer",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","quantizer","electrical ").join(" ")),this.createVertexTemplateEntry(c+"delta;",50,50,"","Delta",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","delta","electrical ").join(" ")),-this.createVertexTemplateEntry(mxConstants.STYLE_SHAPE+"=mxgraph.electrical.abstract.function;html=1;shadow=0;dashed=0;align=center;strokeWidth=1;fontSize=24",50,50,"fn","Function",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","function","electrical ").join(" ")),this.createVertexTemplateEntry(c+"integrator;",50,50,"","Integrator",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","integrator","electrical ").join(" ")),this.createVertexTemplateEntry(c+"multiplier;",50,-50,"","Multiplier",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","multiplier","electrical ").join(" ")),this.createVertexTemplateEntry(c+"sum;",50,50,"","Sum",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","sum","electrical ").join(" ")),this.createVertexTemplateEntry(c+"summation_point;",50,50,"","Summation Point",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","summation_point","electrical ").join(" ")),this.createVertexTemplateEntry(c+"filter;",52,-46,"","Filter",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","filter","electrical ").join(" ")),this.createVertexTemplateEntry(a+"=mxgraph.electrical.logic_gates.bandpass_filter;",52,46,"","Bandpass Filter",null,null,this.getTagsForStencil("mxgraph.electrical.logic_gates","bandpass_filter","").join(" ")),this.createVertexTemplateEntry(a+"=mxgraph.electrical.logic_gates.highpass_filter;",52,46,"","Highpass Filter",null,null,this.getTagsForStencil("mxgraph.electrical.logic_gates","highpass_filter",-"").join(" ")),this.createVertexTemplateEntry(a+"=mxgraph.electrical.logic_gates.lowpass_filter;",52,46,"","Lowpass Filter",null,null,this.getTagsForStencil("mxgraph.electrical.logic_gates","lowpass_filter","").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_SHAPE+"=mxgraph.electrical.abstract.thermistor_with_independent_integral_heater;html=1;shadow=0;dashed=0;strokeWidth=1;align=center;overflow=fill;fontSize=12;",100,94.25,'<table cellpadding="0" cellspacing="0" style="width:100%;height:100%;"><tr height="45%"><td align="center">\\temp\\</td></tr><tr height="55%"><td></td></tr></table>',-"Thermistor With Independent Integral Heater",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","thermistor_with_independent_integral_heater","electrical ").join(" ")),this.createVertexTemplateEntry(c+"voltage_regulator;",70,58,"","Voltage Regulator",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","voltage_regulator","electrical ").join(" ")),this.createVertexTemplateEntry(r+"vss2;fontSize=24;flipV=1;",60,40,"V<sub>ss</sub>","Vss",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources",-"vss","electrical signal source ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_VERTICAL_LABEL_POSITION+"=top;"+mxConstants.STYLE_VERTICAL_ALIGN+"=bottom;"+mxConstants.STYLE_SHAPE+"=mxgraph.electrical.signal_sources.vdd;shadow=0;dashed=0;align=center;strokeWidth=1;fontSize=24;html=1;flipV=1;",60,40,"V<sub>dd</sub>","Vdd",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","vdd","electrical signal source ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_VERTICAL_LABEL_POSITION+-"=top;"+mxConstants.STYLE_VERTICAL_ALIGN+"=bottom;"+mxConstants.STYLE_SHAPE+"=mxgraph.electrical.signal_sources.current_flow;shadow=0;dashed=0;align=center;strokeWidth=1;fontSize=10;html=1;",70,10,"5 mA","Current Flow",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","current_flow","electrical signal source ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_LABEL_POSITION+"=right;"+mxConstants.STYLE_ALIGN+"=left;"+mxConstants.STYLE_SHAPE+"=mxgraph.electrical.signal_sources.voltage;shadow=0;dashed=0;strokeWidth=1;fontSize=10;html=1;",-10,70,"1.2 V","Voltage",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","voltage","electrical signal source ").join(" ")),this.createVertexTemplateEntry(r+"equipotential;",90,90,"","Equipotential",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","equipotential","electrical signal source ").join(" ")),this.createVertexTemplateEntry(r+"protective_earth;",25,20,"","Equipotential",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","protective_earth earth ground",-"electrical signal source ").join(" ")),this.createVertexTemplateEntry(r+"signal_ground;",45,30,"","Ground",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","signal_ground earth","electrical signal source ").join(" ")),this.createVertexTemplateEntry(f+"chassis;",65,32,"","Chassis",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","chassis","electrical ").join(" ")),this.createVertexTemplateEntry(f+"circuit_breaker;",100,13,"","Circuit Breaker",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources",-"circuit breaker","electrical ").join(" ")),this.createVertexTemplateEntry(f+"generic_component",60,60,"","Generic Component",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","generic component","electrical ").join(" ")),this.createVertexTemplateEntry(f+"permanent_magnet",20,70,"","Permanent Magnet",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","permanent magnet","electrical ").join(" ")),this.createVertexTemplateEntry(f+"thermal_element",100,32,"","Thermal Element",-null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","thermal element","electrical ").join(" ")),this.createVertexTemplateEntry(f+"igniter_plug2",72,39,"","Igniter Plug",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","igniter plug","electrical ").join(" ")),this.createVertexTemplateEntry("shape=mxgraph.arrows2.arrow;verticalLabelPosition=bottom;shadow=0;dashed=0;align=center;html=1;verticalAlign=top;strokeWidth=1;dy=0;dx=10;notch=0;",100,30,"","Pickup Head",null,-null,this.getTagsForStencil("mxgraph.electrical.signal_sources","pickup head","electrical ").join(" ")),this.createVertexTemplateEntry(f+"squib_ignitor",100,100,"","Squib Ignitor",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","squib ignitor","electrical ").join(" ")),this.createVertexTemplateEntry(f+"transducer",70,60,"","Transducer",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","transducer","electrical ").join(" ")),this.createVertexTemplateEntry(f+"transducer_2",-80,100,"","Transducer",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","transducer","electrical ").join(" ")),this.createVertexTemplateEntry(f+"thermopile",80,82,"","Thermopile",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","thermopile","electrical ").join(" ")),this.createVertexTemplateEntry(f+"indicator",60,60,"","Indicator",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","indicator","electrical ").join(" ")),this.createVertexTemplateEntry("verticalLabelPosition=bottom;shadow=0;dashed=0;align=center;fillColor=strokeColor;html=1;verticalAlign=top;strokeWidth=1;shape=mxgraph.electrical.miscellaneous.surge_protector;",+95,100,"","NMOS",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_ic_n","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"mosfet_ic_p;",95,100,"","PMOS",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_ic_p","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"mosfet_ic_n_body_diode;",95,100,"","NMOS with Body Diode",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_ic_n_body_diode","electrical transistor ").join(" ")),+this.createVertexTemplateEntry(l+"mosfet_ic_p_body_diode;",95,100,"","PMOS with Body Diode",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_ic_p_body_diode","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"mosfet_n_no_bulk;",95,100,"","MOSFET No Bulk (N)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_n_no_bulk","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"mosfet_p_no_bulk;",95,100,"","MOSFET No Bulk (P)",+null,null,this.getTagsForStencil("mxgraph.electrical.transistors","mosfet_p_no_bulk","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"dual_gate_mosfet_n;",95,100,"","Dual Gate MOSFET (N)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","dual_gate_mosfet_n","electrical transistor ").join(" ")),this.createVertexTemplateEntry(l+"dual_gate_mosfet_p;",95,100,"","Dual Gate MOSFET (P)",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","dual_gate_mosfet_p",+"electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"nmos;pointerEvents=1;",60,100,"","NMOS",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","nmos","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"nmos_bulk;pointerEvents=1;",60,100,"","NMOS with Bulk",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","nmos bulk","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"pmos;pointerEvents=1;",60,100,"","PMOS",null,+null,this.getTagsForStencil("mxgraph.electrical.transistors","pmos","electrical transistor ").join(" ")),this.createVertexTemplateEntry(k+"pmos_bulk;pointerEvents=1;",60,100,"","PMOS with Bulk",null,null,this.getTagsForStencil("mxgraph.electrical.transistors","pmos bulk","electrical transistor ").join(" "))]);this.setCurrentSearchEntryLibrary("electrical","electricalInstruments");this.addPaletteFunctions("electricalInstruments","Electrical / Instruments",!1,[this.createVertexTemplateEntry("verticalLabelPosition=middle;shadow=0;dashed=0;align=center;html=1;verticalAlign=middle;strokeWidth=1;shape=ellipse;aspect=fixed;fontSize=50;",+90,90,"A","Ammeter",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","ampermeter ammeter","electrical instrument ").join(" ")),this.createVertexTemplateEntry(w+"galvanometer;",90,90,"","Galvanometer",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","galvanometer","electrical instrument ").join(" ")),this.createVertexTemplateEntry(w+"oscilloscope;",90,90,"","Oscilloscope",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","oscilloscope","electrical instrument ").join(" ")),+this.createVertexTemplateEntry(w+"signal_generator;",90,90,"","Signal Generator",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","signal_generator","electrical instrument ").join(" ")),this.createVertexTemplateEntry("verticalLabelPosition=middle;shadow=0;dashed=0;align=center;html=1;verticalAlign=middle;strokeWidth=1;shape=ellipse;aspect=fixed;fontSize=50;",90,90,"V","Voltmeter",null,null,this.getTagsForStencil("mxgraph.electrical.instruments","ampermeter ammeter","electrical instrument ").join(" "))]);+this.setCurrentSearchEntryLibrary("electrical","electricalMisc");this.addPaletteFunctions("electricalMisc","Electrical / Misc",!1,[this.createVertexTemplateEntry(p+"aerial_-_antenna_1;",80,100,"","Antenna",null,null,this.getTagsForStencil("mxgraph.electrical.radio","aerial_-_antenna_1","electrical radio audio ").join(" ")),this.createVertexTemplateEntry(p+"aerial_-_antenna_2;",79,100,"","Antenna",null,null,this.getTagsForStencil("mxgraph.electrical.radio","aerial_-_antenna_2","electrical radio audio ").join(" ")),+this.createVertexTemplateEntry(p+"loop_antenna;",64.8,69.78,"","Loop Antenna",null,null,this.getTagsForStencil("mxgraph.electrical.radio","loop_antenna","electrical radio audio ").join(" ")),this.createVertexTemplateEntry(f+"loop_antenna",100,100,"","Loop Antenna",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","loop antenna","electrical ").join(" ")),this.createVertexTemplateEntry("verticalLabelPosition=middle;shadow=0;dashed=0;align=center;html=1;verticalAlign=middle;strokeWidth=1;shape=ellipse;aspect=fixed;fontSize=35;",+60,60,"M","Electrical Motor",null,null,this.getTagsForStencil("mxgraph.electrical.electro-mechanical","motor_1","electrical switch relay ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_SHAPE+"=mxgraph.electrical.electro-mechanical.motor_2;html=1;shadow=0;dashed=0;align=center;fontSize=30;strokeWidth=1;",100,60,"","Motor Armature",null,null,this.getTagsForStencil("mxgraph.electrical.electro-mechanical","motor_2","electrical switch relay ").join(" ")),this.createVertexTemplateEntry(f++"co-ax;",40,60,"","Co-Ax",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","co-ax","electrical ").join(" ")),this.createVertexTemplateEntry(f+"crystal_1;",100,40,"","Crystal",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","crystal_1","electrical ").join(" ")),this.createVertexTemplateEntry(f+"fuse_1;",100,20,"","Fuse (IEC)",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","fuse_1","electrical ").join(" ")),this.createVertexTemplateEntry(f++"fuse_2;",100,20,"","Fuse (IEEE)",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","fuse_2","electrical ").join(" ")),this.createVertexTemplateEntry(f+"fuse_3;",100,12,"","Fuse (obsolete)",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","fuse_3","electrical ").join(" ")),this.createVertexTemplateEntry(f+"fuse_4;",100,32,"","Fuse (IEEE)",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","fuse_4","electrical ").join(" ")),this.createVertexTemplateEntry(f++"light_bulb;",60,50,"","Light Bulb",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","light_bulb","electrical ").join(" ")),this.createVertexTemplateEntry(f+"illuminating_bulb;",60,50,"","Illuminating Bulb",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","illuminating_bulb","electrical ").join(" ")),this.createVertexTemplateEntry(f+"light_bulb;",60,50,"","Pilot Light",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","light_bulb","electrical ").join(" ")),+this.createVertexTemplateEntry(f+"neon_lamp_2;",60,50,"","Neon Lamp",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","neon_lamp_2","electrical ").join(" ")),this.createVertexTemplateEntry(f+"flourescent_lamp",80,30,"","Flourescent Lamp",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","flourescent lamp","electrical ").join(" ")),this.createVertexTemplateEntry(m+"lamp",50,100,"","Lamp",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","lamp",+"electrical optical ").join(" ")),this.createVertexTemplateEntry(f+"thermocouple;",80,81,"","Thermocouple",null,null,this.getTagsForStencil("mxgraph.electrical.miscellaneous","thermocouple","electrical ").join(" ")),this.createVertexTemplateEntry(c+"amplifier;",90,100,"","Amplifier",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","amplifier","electrical ").join(" ")),this.createVertexTemplateEntry(c+"controlled_amplifier;",100,90,"","Controlled Amplifier",null,null,this.getTagsForStencil("mxgraph.electrical.abstract",+"controlled_amplifier","electrical ").join(" ")),this.createVertexTemplateEntry(c+"dac;",70,46,"","DAC",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","dac","electrical ").join(" ")),this.createVertexTemplateEntry("shadow=0;dashed=0;align=center;html=1;strokeWidth=1;shape=mxgraph.electrical.abstract.mux2;whiteSpace=wrap;",80,120,"Mux","Mux",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","mux","electrical ").join(" ")),this.createVertexTemplateEntry("shadow=0;dashed=0;align=center;html=1;strokeWidth=1;shape=mxgraph.electrical.abstract.mux2;operation=demux;whiteSpace=wrap;",+80,120,"Demux","Demux",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","mux","electrical ").join(" ")),this.createVertexTemplateEntry(c+"operational_amp_1;",98,90,"","Operational Amp",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","operational_amp_1","electrical ").join(" ")),this.createVertexTemplateEntry(c+"operational_amp_2;",98,90,"","Operational Amp",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","operational_amp_2","electrical ").join(" ")),this.createVertexTemplateEntry(c++"ota_1;",100,90,"","OTA",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","ota_1","electrical ").join(" ")),this.createVertexTemplateEntry(c+"ota_2;",100,90,"","OTA",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","ota_2","electrical ").join(" ")),this.createVertexTemplateEntry(c+"ota_3;",100,90,"","OTA",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","ota_3","electrical ").join(" ")),this.createVertexTemplateEntry(c+"quantizer;",52,46,"","Quantizer",null,+null,this.getTagsForStencil("mxgraph.electrical.abstract","quantizer","electrical ").join(" ")),this.createVertexTemplateEntry(c+"delta;",50,50,"","Delta",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","delta","electrical ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_SHAPE+"=mxgraph.electrical.abstract.function;html=1;shadow=0;dashed=0;align=center;strokeWidth=1;fontSize=24",50,50,"fn","Function",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","function",+"electrical ").join(" ")),this.createVertexTemplateEntry(c+"integrator;",50,50,"","Integrator",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","integrator","electrical ").join(" ")),this.createVertexTemplateEntry(c+"multiplier;",50,50,"","Multiplier",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","multiplier","electrical ").join(" ")),this.createVertexTemplateEntry(c+"sum;",50,50,"","Sum",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","sum","electrical ").join(" ")),+this.createVertexTemplateEntry(c+"summation_point;",50,50,"","Summation Point",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","summation_point","electrical ").join(" ")),this.createVertexTemplateEntry(c+"filter;",52,46,"","Filter",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","filter","electrical ").join(" ")),this.createVertexTemplateEntry(a+"=mxgraph.electrical.logic_gates.bandpass_filter;",52,46,"","Bandpass Filter",null,null,this.getTagsForStencil("mxgraph.electrical.logic_gates",+"bandpass_filter","").join(" ")),this.createVertexTemplateEntry(a+"=mxgraph.electrical.logic_gates.highpass_filter;",52,46,"","Highpass Filter",null,null,this.getTagsForStencil("mxgraph.electrical.logic_gates","highpass_filter","").join(" ")),this.createVertexTemplateEntry(a+"=mxgraph.electrical.logic_gates.lowpass_filter;",52,46,"","Lowpass Filter",null,null,this.getTagsForStencil("mxgraph.electrical.logic_gates","lowpass_filter","").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_SHAPE++"=mxgraph.electrical.abstract.thermistor_with_independent_integral_heater;html=1;shadow=0;dashed=0;strokeWidth=1;align=center;overflow=fill;fontSize=12;",100,94.25,'<table cellpadding="0" cellspacing="0" style="width:100%;height:100%;"><tr height="45%"><td align="center">\\temp\\</td></tr><tr height="55%"><td></td></tr></table>',"Thermistor With Independent Integral Heater",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","thermistor_with_independent_integral_heater","electrical ").join(" ")),+this.createVertexTemplateEntry(c+"voltage_regulator;",70,58,"","Voltage Regulator",null,null,this.getTagsForStencil("mxgraph.electrical.abstract","voltage_regulator","electrical ").join(" ")),this.createVertexTemplateEntry(r+"vss2;fontSize=24;flipV=1;",60,40,"V<sub>ss</sub>","Vss",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","vss","electrical signal source ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_VERTICAL_LABEL_POSITION+"=top;"+mxConstants.STYLE_VERTICAL_ALIGN++"=bottom;"+mxConstants.STYLE_SHAPE+"=mxgraph.electrical.signal_sources.vdd;shadow=0;dashed=0;align=center;strokeWidth=1;fontSize=24;html=1;flipV=1;",60,40,"V<sub>dd</sub>","Vdd",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","vdd","electrical signal source ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_VERTICAL_LABEL_POSITION+"=top;"+mxConstants.STYLE_VERTICAL_ALIGN+"=bottom;"+mxConstants.STYLE_SHAPE+"=mxgraph.electrical.signal_sources.current_flow;shadow=0;dashed=0;align=center;strokeWidth=1;fontSize=10;html=1;",+70,10,"5 mA","Current Flow",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","current_flow","electrical signal source ").join(" ")),this.createVertexTemplateEntry(mxConstants.STYLE_LABEL_POSITION+"=right;"+mxConstants.STYLE_ALIGN+"=left;"+mxConstants.STYLE_SHAPE+"=mxgraph.electrical.signal_sources.voltage;shadow=0;dashed=0;strokeWidth=1;fontSize=10;html=1;",10,70,"1.2 V","Voltage",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","voltage","electrical signal source ").join(" ")),+this.createVertexTemplateEntry(r+"equipotential;",90,90,"","Equipotential",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","equipotential","electrical signal source ").join(" ")),this.createVertexTemplateEntry(r+"protective_earth;",25,20,"","Equipotential",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","protective_earth earth ground","electrical signal source ").join(" ")),this.createVertexTemplateEntry(r+"signal_ground;",45,30,"","Ground",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources",+"signal_ground earth","electrical signal source ").join(" ")),this.createVertexTemplateEntry(f+"chassis;",65,32,"","Chassis",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","chassis","electrical ").join(" ")),this.createVertexTemplateEntry(f+"circuit_breaker;",100,13,"","Circuit Breaker",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","circuit breaker","electrical ").join(" ")),this.createVertexTemplateEntry(f+"generic_component",60,60,"","Generic Component",+null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","generic component","electrical ").join(" ")),this.createVertexTemplateEntry(f+"permanent_magnet",20,70,"","Permanent Magnet",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","permanent magnet","electrical ").join(" ")),this.createVertexTemplateEntry(f+"thermal_element",100,32,"","Thermal Element",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","thermal element","electrical ").join(" ")),+this.createVertexTemplateEntry(f+"igniter_plug2",72,39,"","Igniter Plug",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","igniter plug","electrical ").join(" ")),this.createVertexTemplateEntry("shape=mxgraph.arrows2.arrow;verticalLabelPosition=bottom;shadow=0;dashed=0;align=center;html=1;verticalAlign=top;strokeWidth=1;dy=0;dx=10;notch=0;",100,30,"","Pickup Head",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","pickup head","electrical ").join(" ")),this.createVertexTemplateEntry(f++"squib_ignitor",100,100,"","Squib Ignitor",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","squib ignitor","electrical ").join(" ")),this.createVertexTemplateEntry(f+"transducer",70,60,"","Transducer",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","transducer","electrical ").join(" ")),this.createVertexTemplateEntry(f+"transducer_2",80,100,"","Transducer",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","transducer","electrical ").join(" ")),+this.createVertexTemplateEntry(f+"thermopile",80,82,"","Thermopile",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","thermopile","electrical ").join(" ")),this.createVertexTemplateEntry(f+"indicator",60,60,"","Indicator",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","indicator","electrical ").join(" ")),this.createVertexTemplateEntry("verticalLabelPosition=bottom;shadow=0;dashed=0;align=center;fillColor=strokeColor;html=1;verticalAlign=top;strokeWidth=1;shape=mxgraph.electrical.miscellaneous.surge_protector;",70,20,"","Surge Protector",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","surge protector","electrical ").join(" ")),this.createVertexTemplateEntry(f+"surge_protector_2;",70,24,"","Surge Protector",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","surge protector","electrical ").join(" ")),this.createVertexTemplateEntry("verticalLabelPosition=bottom;shadow=0;dashed=0;align=center;html=1;verticalAlign=top;strokeWidth=1;shape=rect;",130,50,"","Material",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","material","electrical ").join(" ")),this.createVertexTemplateEntry(f+"sensing_link_squib",130,40,"","Sensing Link Squib",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","sensing link squib","electrical ").join(" ")),this.createVertexTemplateEntry(f+"delay_element",100,100,"","Delay Element",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","delay_element","electrical ").join(" ")),this.createVertexTemplateEntry(p+"buzzer",80,50,"","Buzzer",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","buzzer","electrical radio audio ").join(" ")),this.createVertexTemplateEntry(f+"adapter",100,40,"","Adapter",null,null,this.getTagsForStencil("mxgraph.electrical.signal_sources","adapter","electrical radio audio ").join(" ")),this.createVertexTemplateEntry("verticalLabelPosition=bottom;shadow=0;dashed=0;align=center;html=1;verticalAlign=top;strokeWidth=1;shape=ellipse;perimeter=ellipsePerimeter;",15,15,@@ -12618,7 +12620,7 @@ $jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_S$jscomp.getGlobal=function(b){b=["object"==typeof globalThis&&globalThis,b,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var l=0;l<b.length;++l){var p=b[l];if(p&&p.Math==Math)return p}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(b,l){var p=$jscomp.propertyToPolyfillSymbol[l];if(null==p)return b[l];p=b[p];return void 0!==p?p:b[l]};$jscomp.polyfill=function(b,l,p,g){l&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(b,l,p,g):$jscomp.polyfillUnisolated(b,l,p,g))};$jscomp.polyfillUnisolated=function(b,l,p,g){p=$jscomp.global;b=b.split(".");for(g=0;g<b.length-1;g++){var x=b[g];if(!(x in p))return;p=p[x]}b=b[b.length-1];g=p[b];l=l(g);l!=g&&null!=l&&$jscomp.defineProperty(p,b,{configurable:!0,writable:!0,value:l})};-$jscomp.polyfillIsolated=function(b,l,p,g){var x=b.split(".");b=1===x.length;g=x[0];g=!b&&g in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var B=0;B<x.length-1;B++){var z=x[B];if(!(z in g))return;g=g[z]}x=x[x.length-1];p=$jscomp.IS_SYMBOL_NATIVE&&"es6"===p?g[x]:null;l=l(p);null!=l&&(b?$jscomp.defineProperty($jscomp.polyfills,x,{configurable:!0,writable:!0,value:l}):l!==p&&(void 0===$jscomp.propertyToPolyfillSymbol[x]&&(p=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[x]=$jscomp.IS_SYMBOL_NATIVE?+$jscomp.polyfillIsolated=function(b,l,p,g){var x=b.split(".");b=1===x.length;g=x[0];g=!b&&g in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var A=0;A<x.length-1;A++){var y=x[A];if(!(y in g))return;g=g[y]}x=x[x.length-1];p=$jscomp.IS_SYMBOL_NATIVE&&"es6"===p?g[x]:null;l=l(p);null!=l&&(b?$jscomp.defineProperty($jscomp.polyfills,x,{configurable:!0,writable:!0,value:l}):l!==p&&(void 0===$jscomp.propertyToPolyfillSymbol[x]&&(p=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[x]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(x):$jscomp.POLYFILL_PREFIX+p+"$"+x),$jscomp.defineProperty(g,$jscomp.propertyToPolyfillSymbol[x],{configurable:!0,writable:!0,value:l})))};$jscomp.underscoreProtoCanBeSet=function(){var b={a:!0},l={};try{return l.__proto__=b,l.a}catch(p){}return!1};$jscomp.setPrototypeOf=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(b,l){b.__proto__=l;if(b.__proto__!==l)throw new TypeError(b+" is not extensible");return b}:null;$jscomp.generator={};$jscomp.generator.ensureIteratorResultIsObject_=function(b){if(!(b instanceof Object))throw new TypeError("Iterator result "+b+" is not an object");};$jscomp.generator.Context=function(){this.isRunning_=!1;this.yieldAllIterator_=null;this.yieldResult=void 0;this.nextAddress=1;this.finallyAddress_=this.catchAddress_=0;this.finallyContexts_=this.abruptCompletion_=null};$jscomp.generator.Context.prototype.start_=function(){if(this.isRunning_)throw new TypeError("Generator is already running");this.isRunning_=!0};$jscomp.generator.Context.prototype.stop_=function(){this.isRunning_=!1};@@ -12631,42 +12633,43 @@ $jscomp.generator.Context.PropertyIterator=function(b){this.object_=b;this.prope$jscomp.generator.Engine_.prototype.next_=function(b){this.context_.start_();if(this.context_.yieldAllIterator_)return this.yieldAllStep_(this.context_.yieldAllIterator_.next,b,this.context_.next_);this.context_.next_(b);return this.nextStep_()};$jscomp.generator.Engine_.prototype.return_=function(b){this.context_.start_();var l=this.context_.yieldAllIterator_;if(l)return this.yieldAllStep_("return"in l?l["return"]:function(p){return{value:p,done:!0}},b,this.context_.return);this.context_.return(b);return this.nextStep_()};$jscomp.generator.Engine_.prototype.throw_=function(b){this.context_.start_();if(this.context_.yieldAllIterator_)return this.yieldAllStep_(this.context_.yieldAllIterator_["throw"],b,this.context_.next_);this.context_.throw_(b);return this.nextStep_()};-$jscomp.generator.Engine_.prototype.yieldAllStep_=function(b,l,p){try{var g=b.call(this.context_.yieldAllIterator_,l);$jscomp.generator.ensureIteratorResultIsObject_(g);if(!g.done)return this.context_.stop_(),g;var x=g.value}catch(B){return this.context_.yieldAllIterator_=null,this.context_.throw_(B),this.nextStep_()}this.context_.yieldAllIterator_=null;p.call(this.context_,x);return this.nextStep_()};+$jscomp.generator.Engine_.prototype.yieldAllStep_=function(b,l,p){try{var g=b.call(this.context_.yieldAllIterator_,l);$jscomp.generator.ensureIteratorResultIsObject_(g);if(!g.done)return this.context_.stop_(),g;var x=g.value}catch(A){return this.context_.yieldAllIterator_=null,this.context_.throw_(A),this.nextStep_()}this.context_.yieldAllIterator_=null;p.call(this.context_,x);return this.nextStep_()};$jscomp.generator.Engine_.prototype.nextStep_=function(){for(;this.context_.nextAddress;)try{var b=this.program_(this.context_);if(b)return this.context_.stop_(),{value:b.value,done:!1}}catch(l){this.context_.yieldResult=void 0,this.context_.throw_(l)}this.context_.stop_();if(this.context_.abruptCompletion_){b=this.context_.abruptCompletion_;this.context_.abruptCompletion_=null;if(b.isException)throw b.exception;return{value:b.return,done:!0}}return{value:void 0,done:!0}};$jscomp.generator.Generator_=function(b){this.next=function(l){return b.next_(l)};this.throw=function(l){return b.throw_(l)};this.return=function(l){return b.return_(l)};this[Symbol.iterator]=function(){return this}};$jscomp.generator.createGenerator=function(b,l){l=new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(l));$jscomp.setPrototypeOf&&b.prototype&&$jscomp.setPrototypeOf(l,b.prototype);return l};-$jscomp.asyncExecutePromiseGenerator=function(b){function l(g){return b.next(g)}function p(g){return b.throw(g)}return new Promise(function(g,x){function B(z){z.done?g(z.value):Promise.resolve(z.value).then(l,p).then(B,x)}B(b.next())})};$jscomp.asyncExecutePromiseGeneratorFunction=function(b){return $jscomp.asyncExecutePromiseGenerator(b())};$jscomp.asyncExecutePromiseGeneratorProgram=function(b){return $jscomp.asyncExecutePromiseGenerator(new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(b)))};+$jscomp.asyncExecutePromiseGenerator=function(b){function l(g){return b.next(g)}function p(g){return b.throw(g)}return new Promise(function(g,x){function A(y){y.done?g(y.value):Promise.resolve(y.value).then(l,p).then(A,x)}A(b.next())})};$jscomp.asyncExecutePromiseGeneratorFunction=function(b){return $jscomp.asyncExecutePromiseGenerator(b())};$jscomp.asyncExecutePromiseGeneratorProgram=function(b){return $jscomp.asyncExecutePromiseGenerator(new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(b)))};DrawioFile=function(b,l){mxEventSource.call(this);this.ui=b;this.setData(l||"");this.initialData=this.getData();this.created=(new Date).getTime();this.stats={opened:0,merged:0,fileMerged:0,fileReloaded:0,conflicts:0,timeouts:0,saved:0,closed:0,destroyed:0,joined:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0}};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;DrawioFile.RESTRICT_EXPORT=!1;mxUtils.extend(DrawioFile,mxEventSource);-DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.savingSpinnerKey="saving";DrawioFile.prototype.savingStatusKey="saving";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.optimisticSyncDelay=300;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.lastSaved=null;DrawioFile.prototype.lastChanged=null;DrawioFile.prototype.opened=null;DrawioFile.prototype.modified=!1;-DrawioFile.prototype.shadowModified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.ageStart=null;DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};-DrawioFile.prototype.getShadowPages=function(){if(null==this.shadowPages&&(this.shadowPages=this.ui.getPagesForXml(this.initialData,!0),void 0===this.shadowVars)){this.shadowVars=null;try{var b=mxUtils.parseXml(this.initialData).documentElement;null!=b&&"mxfile"==b.nodeName&&(this.shadowVars=b.getAttribute("vars"))}catch(l){}}return this.shadowPages};+DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.savingSpinnerKey="saving";DrawioFile.prototype.savingStatusKey="saving";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.optimisticSyncDelay=300;DrawioFile.prototype.loadFontsTimeout=5E3;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.lastSaved=null;DrawioFile.prototype.lastChanged=null;+DrawioFile.prototype.opened=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.shadowModified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.ageStart=null;+DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};DrawioFile.prototype.getShadowPages=function(){if(null==this.shadowPages&&(this.shadowPages=this.ui.getPagesForXml(this.initialData,!0),void 0===this.shadowVars)){this.shadowVars=null;try{var b=mxUtils.parseXml(this.initialData).documentElement;null!=b&&"mxfile"==b.nodeName&&(this.shadowVars=b.getAttribute("vars"))}catch(l){}}return this.shadowPages};DrawioFile.prototype.setShadowPages=function(b,l){this.shadowPages=b;this.shadowVars=void 0!==l?l:null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null};DrawioFile.prototype.getShadowVars=function(){this.getShadowPages();return void 0!==this.shadowVars?this.shadowVars:null};-DrawioFile.prototype.synchronizeFile=function(b,l,p){EditorUi.debug("DrawioFile.synchronizeFile",[this],"latestFile",[p],"savingFile",this.savingFile);if(this.savingFile)null!=l&&l({message:mxResources.get("busy")});else{var g=!0,x=window.setTimeout(mxUtils.bind(this,function(){g=!1;null!=l&&l({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,l)})})}),this.ui.timeout),B=mxUtils.bind(this,function(F){g&&(window.clearTimeout(x),null!=-l&&l(F))}),z=mxUtils.bind(this,function(){return!g});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,function(F){g&&(window.clearTimeout(x),this.sync.cleanup(b,l,F))}),B,z):this.updateFile(mxUtils.bind(this,function(){g&&(window.clearTimeout(x),null!=b&&b())}),B,z,null,null,p)}};-DrawioFile.prototype.updateFile=function(b,l,p,g,x,B){if(null==p||!p())if(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",x,"invalidChecksum",this.invalidChecksum,"latestFile",[B]),this.ui.getCurrentFile()!=this||this.invalidChecksum)null!=l&&l();else{var z=mxUtils.bind(this,function(F){try{null!=p&&p()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[F]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=l&&l():null!=F?this.mergeFile(F,-b,l,g,x):this.reloadFile(b,l))}catch(K){null!=l&&l(K)}});null!=B?z(B):this.getLatestVersion(z,l)}};-DrawioFile.prototype.mergeFile=function(b,l,p,g,x){try{var B=b.getShadowPages();if(null!=B&&0<B.length){var z=this.getShadowPages(),F=[this.ui.diffPages(null!=g?g:z,B)];g=null;try{var K=mxUtils.parseXml(b.initialData).documentElement;null!=K&&"mxfile"==K.nodeName&&(g=K.getAttribute("vars"))}catch(t){}g!=this.getShadowVars()&&(F[0][EditorUi.DIFF_FILE]={vars:g});var M=this.ignorePatches(F);if(M)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),-EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",M),null!=l&&l();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var L=this.isModified()?this.ui.diffPages(z,this.isRealtime()?this.ownPages:this.ui.pages):null,Q=this.ui.patchPages(this.ui.clonePages(z),F[0]),c=this.ui.getHashValueForPages(Q,{}),f=this.ui.getHashValueForPages(B,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",z,"pages",B,"patched",Q,"patches",F,"changes",L,"checksum",-c,"current",f,"valid",c==f,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",x);if(null!=c&&c!=f)this.checksumError(p,F,null,null,"mergeFile",c,f,b.getCurrentRevisionId());else{this.setShadowPages(B,g);if(null!=this.sync){var k=this.sync.patchRealtime(F,DrawioFile.LAST_WRITE_WINS?L:null,null,x);null==k||mxUtils.isEmptyObject(k)||F.push(k)}this.patch(F,DrawioFile.LAST_WRITE_WINS?L:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());+DrawioFile.prototype.synchronizeFile=function(b,l,p){EditorUi.debug("DrawioFile.synchronizeFile",[this],"latestFile",[p],"savingFile",this.savingFile);if(this.savingFile)null!=l&&l({message:mxResources.get("busy")});else{var g=!0,x=window.setTimeout(mxUtils.bind(this,function(){g=!1;null!=l&&l({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,l)})})}),this.ui.timeout),A=mxUtils.bind(this,function(G){g&&(window.clearTimeout(x),null!=+l&&l(G))}),y=mxUtils.bind(this,function(){return!g});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,function(G){g&&(window.clearTimeout(x),this.sync.cleanup(b,l,G))}),A,y):this.updateFile(mxUtils.bind(this,function(){g&&(window.clearTimeout(x),null!=b&&b())}),A,y,null,null,p)}};+DrawioFile.prototype.updateFile=function(b,l,p,g,x,A){if(null==p||!p())if(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",x,"invalidChecksum",this.invalidChecksum,"latestFile",[A]),this.ui.getCurrentFile()!=this||this.invalidChecksum)null!=l&&l();else{var y=mxUtils.bind(this,function(G){try{null!=p&&p()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[G]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=l&&l():null!=G?this.mergeFile(G,+b,l,g,x):this.reloadFile(b,l))}catch(L){null!=l&&l(L)}});null!=A?y(A):this.getLatestVersion(y,l)}};+DrawioFile.prototype.mergeFile=function(b,l,p,g,x){try{var A=b.getShadowPages();if(null!=A&&0<A.length){var y=this.getShadowPages(),G=[this.ui.diffPages(null!=g?g:y,A)];g=null;try{var L=mxUtils.parseXml(b.initialData).documentElement;null!=L&&"mxfile"==L.nodeName&&(g=L.getAttribute("vars"))}catch(t){}g!=this.getShadowVars()&&(G[0][EditorUi.DIFF_FILE]={vars:g});var O=this.ignorePatches(G);if(O)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),+EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",O),null!=l&&l();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var J=this.isModified()?this.ui.diffPages(y,this.isRealtime()?this.ownPages:this.ui.pages):null,Q=this.ui.patchPages(this.ui.clonePages(y),G[0]),c=this.ui.getHashValueForPages(Q,{}),f=this.ui.getHashValueForPages(A,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",y,"pages",A,"patched",Q,"patches",G,"changes",J,"checksum",+c,"current",f,"valid",c==f,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",x);if(null!=c&&c!=f)this.checksumError(p,G,null,null,"mergeFile",c,f,b.getCurrentRevisionId());else{this.setShadowPages(A,g);if(null!=this.sync){var k=this.sync.patchRealtime(G,DrawioFile.LAST_WRITE_WINS?J:null,null,x);null==k||mxUtils.isEmptyObject(k)||G.push(k)}this.patch(G,DrawioFile.LAST_WRITE_WINS?J:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=l&&l()}}catch(t){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=p&&p(t);try{if(!(t instanceof DOMException&&"InvalidCharacterError"==t.name)){var n=this.getCurrentUser(),q=null!=n?n.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),q,t)}}catch(u){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(t){null!=p&&p(t)}};DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var l=new mxCodec(mxUtils.createXmlDocument()),p=l.document.createElement("mxfile");if(null!=b)for(var g=0;g<b.length;g++){var x=l.encode(new mxGraphModel(b[g].root));"1"!=urlParams.dev&&(x=this.ui.anonymizeNode(x,!0));x.setAttribute("id",b[g].getId());b[g].viewState&&this.ui.editor.graph.saveViewState(b[g].viewState,x,!0);p.appendChild(x)}return mxUtils.getPrettyXml(p)};DrawioFile.prototype.compressReportData=function(b,l,p){l=null!=l?l:1E4;null!=p&&null!=b&&b.length>p?b=b.substring(0,p)+"[...]":null!=b&&b.length>l&&(b=Graph.compress(b)+"\n");return b};-DrawioFile.prototype.checksumError=function(b,l,p,g,x,B,z,F){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var K=this.getCurrentUser(),M=null!=K?K.id:"unknown",L=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",Q=JSON.stringify(l).length,c=null;if(null!=l&&1E3>Q){b=[];for(p=0;p<l.length;p++)b.push(this.ui.anonymizePatch(l[p]));c=JSON.stringify(b);c=null!=c&&1E3>-c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(f){try{var k=null!=c?"report":"error",n=this.ui.getHashValueForPages(f.getShadowPages()),q="unknown",t="unknown",u="unknown";try{var y=null!=f.initialData&&0<f.initialData.length?mxUtils.parseXml(f.initialData).documentElement:null;null!=y&&(null!=y.getAttribute("version")&&(q=y.getAttribute("version")),null!=y.getAttribute("agent")&&(t=y.getAttribute("agent")),null!=y.getAttribute("type")&&(u=y.getAttribute("type")))}catch(E){}EditorUi.logError("Checksum "+-k+" in "+x,null,this.getMode()+"."+L,"user_"+M+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+Q+"-patches_"+l.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=B?"-expected_"+B:"")+(null!=z?"-current_"+z:"")+(null!=F?"-rev_"+this.ui.hashValue(F):"")+(null!=n?"-latest_"+n:"")+"-latestRev_"+this.ui.hashValue(f.getCurrentRevisionId())+("-latestVersion_"+q)+("-latestAgent_"+t)+("-latestType_"+u));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+L,action:x,label:"user_"+-M+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+Q+"-patches_"+l.length+"-size_"+this.getSize()})}catch(E){}}),function(){})}catch(f){}};-DrawioFile.prototype.sendErrorReport=function(b,l,p,g){try{var x=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),B=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),z=this.getCurrentUser(),F=null!=z?this.ui.hashValue(z.id):"unknown",K=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",M=this.getTitle(),L=M.lastIndexOf(".");z="xml";0<L&&(z=M.substring(L));var Q=null!=p?p.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()+-":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+z+")\nUser="+F+K+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=l?"\n\n"+l:-"")+(null!=p?"\n\nError: "+p.message:"")+"\n\nStack:\n"+Q+"\n\nShadow:\n"+x+"\n\nData:\n"+B,g)}catch(c){}};-DrawioFile.prototype.reloadFile=function(b,l){try{this.stats.fileReloaded++;var p=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),g=this.ui.editor.graph,x=g.getSelectionCells(),B=g.getViewState(),z=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(F){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[p],"viewState",[B],"latestFile",F);null!=F?(this.ui.replaceFileData(F.getData(),-[p]),this.ui.restoreViewState(z,B,x),this.setDescriptor(F.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var K=this.ui.getCurrentFile();null!=K&&(K.stats=this.stats,K.patch([p]),K.fileChanged());this.ui.restoreViewState(z,B,x);null!=b&&b()}else null!=l&&l(this.ui.fileLoadedError)}),!0))}),l)}catch(F){null!=l&&l(F)}};+DrawioFile.prototype.checksumError=function(b,l,p,g,x,A,y,G){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var L=this.getCurrentUser(),O=null!=L?L.id:"unknown",J=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",Q=JSON.stringify(l).length,c=null;if(null!=l&&1E3>Q){b=[];for(p=0;p<l.length;p++)b.push(this.ui.anonymizePatch(l[p]));c=JSON.stringify(b);c=null!=c&&1E3>+c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(f){try{var k=null!=c?"report":"error",n=this.ui.getHashValueForPages(f.getShadowPages()),q="unknown",t="unknown",u="unknown";try{var B=null!=f.initialData&&0<f.initialData.length?mxUtils.parseXml(f.initialData).documentElement:null;null!=B&&(null!=B.getAttribute("version")&&(q=B.getAttribute("version")),null!=B.getAttribute("agent")&&(t=B.getAttribute("agent")),null!=B.getAttribute("type")&&(u=B.getAttribute("type")))}catch(E){}EditorUi.logError("Checksum "++k+" in "+x,null,this.getMode()+"."+J,"user_"+O+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+Q+"-patches_"+l.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=A?"-expected_"+A:"")+(null!=y?"-current_"+y:"")+(null!=G?"-rev_"+this.ui.hashValue(G):"")+(null!=n?"-latest_"+n:"")+"-latestRev_"+this.ui.hashValue(f.getCurrentRevisionId())+("-latestVersion_"+q)+("-latestAgent_"+t)+("-latestType_"+u));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+J,action:x,label:"user_"++O+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+Q+"-patches_"+l.length+"-size_"+this.getSize()})}catch(E){}}),function(){})}catch(f){}};+DrawioFile.prototype.sendErrorReport=function(b,l,p,g){try{var x=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),A=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),y=this.getCurrentUser(),G=null!=y?this.ui.hashValue(y.id):"unknown",L=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",O=this.getTitle(),J=O.lastIndexOf(".");y="xml";0<J&&(y=O.substring(J));var Q=null!=p?p.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()++":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+y+")\nUser="+G+L+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=l?"\n\n"+l:+"")+(null!=p?"\n\nError: "+p.message:"")+"\n\nStack:\n"+Q+"\n\nShadow:\n"+x+"\n\nData:\n"+A,g)}catch(c){}};+DrawioFile.prototype.reloadFile=function(b,l){try{this.stats.fileReloaded++;var p=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),g=this.ui.editor.graph,x=g.getSelectionCells(),A=g.getViewState(),y=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(G){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[p],"viewState",[A],"latestFile",G);null!=G?(this.ui.replaceFileData(G.getData(),+[p]),this.ui.restoreViewState(y,A,x),this.setDescriptor(G.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var L=this.ui.getCurrentFile();null!=L&&(L.stats=this.stats,L.patch([p]),L.fileChanged());this.ui.restoreViewState(y,A,x);null!=b&&b()}else null!=l&&l(this.ui.fileLoadedError)}),!0))}),l)}catch(G){null!=l&&l(G)}};DrawioFile.prototype.copyFile=function(b,l){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};DrawioFile.prototype.ignorePatches=function(b){var l=!0;if(null!=b)for(var p=0;p<b.length&&l;p++)l=l&&mxUtils.isEmptyObject(b[p]);return l};-DrawioFile.prototype.patch=function(b,l,p,g){if(null!=b){var x=this.ui.editor.undoManager,B=x.history.slice(),z=x.indexOfNextAdd,F=this.ui.editor.graph;F.container.style.visibility="hidden";var K=this.changeListenerEnabled;this.changeListenerEnabled=p;var M=F.foldingEnabled,L=F.mathEnabled,Q=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var c=F.cellRenderer.redraw;F.cellRenderer.redraw=function(u){u.view.graph.isEditing(u.cell)&&(u.view.graph.scrollCellToVisible(u.cell),-u.view.graph.cellEditor.resize());c.apply(this,arguments)};F.model.beginUpdate();try{if(p){for(var f=this.ui.pages.slice(),k=this.ui.currentPage,n=this.ui.applyPatches(this.ui.pages,b,!0,l,this.isModified()),q=0;q<n.length;q++){var t=mxUtils.indexOf(this.ui.pages,n[q]);0>t?this.ui.insertPage(n[q],Math.min(q,this.ui.pages.length)):this.ui.movePage(t,q)}for(q=0;q<f.length;q++)0>mxUtils.indexOf(n,f[q])&&this.ui.removePage(f[q]);0<=mxUtils.indexOf(this.ui.pages,k)&&this.ui.selectPage(k,!0)}else this.ui.pages=-this.ui.applyPatches(this.ui.pages,b,!0,l,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);F.checkDefaultParent()}finally{F.container.style.visibility="",F.model.endUpdate(),F.cellRenderer.redraw=c,this.changeListenerEnabled=K,p||(x.history=B,x.indexOfNextAdd=z,x.fireEvent(new mxEventObject(mxEvent.CLEAR))),x=Q!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):-null),(B=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&L!=F.mathEnabled?(this.ui.editor.updateGraphComponents(),F.refresh()):x?F.refresh():B&&(M!=F.foldingEnabled?F.view.revalidate():F.view.validate(),F.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!g&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",-[this],"patches",b,"resolver",l,"undoable",p)}return b};-DrawioFile.prototype.save=function(b,l,p,g,x,B){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",g,"overwrite",x,"manual",B,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!x&&this.invalidChecksum)if(null!=p)p({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=l&&l();else if(null!=p)p({message:mxResources.get("readOnly")});-else throw Error(mxResources.get("readOnly"));}catch(z){if(null!=p)p(z);else throw z;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var l=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=l&&(l.viewState=this.ui.editor.graph.getViewState(),l.needsUpdate=!0)}l=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return l};+DrawioFile.prototype.patch=function(b,l,p,g){if(null!=b){var x=this.ui.editor.undoManager,A=x.history.slice(),y=x.indexOfNextAdd,G=this.ui.editor.graph;G.container.style.visibility="hidden";var L=this.changeListenerEnabled;this.changeListenerEnabled=p;var O=G.foldingEnabled,J=G.mathEnabled,Q=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var c=G.cellRenderer.redraw;G.cellRenderer.redraw=function(u){u.view.graph.isEditing(u.cell)&&(u.view.graph.scrollCellToVisible(u.cell),+u.view.graph.cellEditor.resize());c.apply(this,arguments)};G.model.beginUpdate();try{if(p){for(var f=this.ui.pages.slice(),k=this.ui.currentPage,n=this.ui.applyPatches(this.ui.pages,b,!0,l,this.isModified()),q=0;q<n.length;q++){var t=mxUtils.indexOf(this.ui.pages,n[q]);0>t?this.ui.insertPage(n[q],Math.min(q,this.ui.pages.length)):this.ui.movePage(t,q)}for(q=0;q<f.length;q++)0>mxUtils.indexOf(n,f[q])&&this.ui.removePage(f[q]);0<=mxUtils.indexOf(this.ui.pages,k)&&this.ui.selectPage(k,!0)}else this.ui.pages=+this.ui.applyPatches(this.ui.pages,b,!0,l,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);G.checkDefaultParent()}finally{G.container.style.visibility="",G.model.endUpdate(),G.cellRenderer.redraw=c,this.changeListenerEnabled=L,p||(x.history=A,x.indexOfNextAdd=y,x.fireEvent(new mxEventObject(mxEvent.CLEAR))),x=Q!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):+null),(A=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&J!=G.mathEnabled?(this.ui.editor.updateGraphComponents(),G.refresh()):x?G.refresh():A&&(O!=G.foldingEnabled?G.view.revalidate():G.view.validate(),G.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!g&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",+[this],"patches",b,"resolver",l,"undoable",p)}return b};DrawioFile.prototype.loadFonts=function(b){if(this.ui.getCurrentFile()==this&&/(\.svg)$/i.test(this.getTitle())&&this.ui.getSvgFileProperties(this.ui.fileNode).embedFonts){var l=null,p=!1,g=function(){p||(p=!0,window.clearTimeout(l),b())};l=window.setTimeout(g,this.loadFontsTimeout);try{this.ui.editor.loadFonts(mxUtils.bind(this,function(){this.ui.editor.embedExtFonts(g)}))}catch(x){g()}}else b()};+DrawioFile.prototype.save=function(b,l,p,g,x,A){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",g,"overwrite",x,"manual",A,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!x&&this.invalidChecksum)if(null!=p)p({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else{this.clearAutosave();var y=mxUtils.bind(this,function(){try{this.updateFileData(),null!=l&&l()}catch(G){if(null!=+p)p(G);else throw G;}});g?y():this.loadFonts(y)}else if(null!=p)p({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(G){if(null!=p)p(G);else throw G;}};+DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var l=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=l&&(l.viewState=this.ui.editor.graph.getViewState(),l.needsUpdate=!0)}l=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return l};DrawioFile.prototype.updateFileData=function(){null!=this.sync&&this.sync.sendLocalChanges();this.setData(this.createData());null!=this.sync&&this.sync.fileDataUpdated()};DrawioFile.prototype.isCompressedStorage=function(){return Editor.defaultCompressed};DrawioFile.prototype.isCompressed=function(){var b=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("compressed"):null;return null!=b?"false"!=b:this.isCompressedStorage()&&Editor.compressXml};DrawioFile.prototype.setLocked=function(b){this.ui.fileNode.setAttribute("locked",b?"true":"false");this.ui.fireEvent(new mxEventObject("lockedChanged"));this.fileChanged();b&&this.ui.editor.graph.clearSelection()};DrawioFile.prototype.isLocked=function(){var b=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("locked"):null;return null!=b?"true"==b:!1};DrawioFile.prototype.saveAs=function(b,l,p){};DrawioFile.prototype.saveFile=function(b,l,p,g){};DrawioFile.prototype.getFileUrl=function(){return null};DrawioFile.prototype.getFolderUrl=function(b){return null};DrawioFile.prototype.getPublicUrl=function(b){b(null)};DrawioFile.prototype.isRestricted=function(){return DrawioFile.RESTRICT_EXPORT};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.getShadowModified=function(){return this.shadowModified};DrawioFile.prototype.setShadowModified=function(b){this.shadowModified=b};DrawioFile.prototype.setModified=function(b){this.shadowModified=this.modified=b};@@ -12677,8 +12680,8 @@ DrawioFile.prototype.setData=function(b){this.data=b;EditorUi.debug("DrawioFile.DrawioFile.prototype.open=function(){this.stats.opened++;var b=this.getData();null!=b&&(this.ui.setFileData(b,this),this.isModified()||this.setShadowPages(this.ui.clonePages(this.ui.pages)));this.installListeners();this.isSyncSupported()&&this.startSync();EditorUi.debug("DrawioFile.open",[this])};DrawioFile.prototype.isPolling=function(){return!1};DrawioFile.prototype.getPollingInterval=function(){return 1E4};DrawioFile.prototype.isSyncSupported=function(){return!1};DrawioFile.prototype.isRealtime=function(){return null!=this.ownPages&&null!=this.ui.pages};DrawioFile.prototype.isRealtimeSupported=function(){return!1};DrawioFile.prototype.isRealtimeEnabled=function(){return Editor.enableRealtime&&"0"!=urlParams["fast-sync"]};DrawioFile.prototype.setRealtimeEnabled=function(){};DrawioFile.prototype.isRealtimeOptional=function(){return!1};DrawioFile.prototype.getRealtimeState=function(){return null!=this.sync&&null!=this.sync.p2pCollab?this.sync.p2pCollab.getState():3};DrawioFile.prototype.getRealtimeError=function(){return null!=this.sync&&null!=this.sync.p2pCollab?this.sync.p2pCollab.getLastError():null};DrawioFile.prototype.isOptimisticSync=function(){return!1};DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};DrawioFile.prototype.getRevisions=function(b,l){b(null)};-DrawioFile.prototype.getRecoveryVersion=function(b,l){this.isRevisionHistorySupported()?this.getRevisions(mxUtils.bind(this,function(p){if(null==p||2>p.length)b(null);else{var g=p.length-2,x=Math.max(0,g-5+1),B=mxUtils.bind(this,function(){if(g<x)EditorUi.debug("DrawioFile.getRecoveryVersion",[this],"no valid revision found in",p.length-1-x,"probed"),b(null);else{var z=p[g--];null==z||"function"!==typeof z.getXml?B():z.getXml(mxUtils.bind(this,function(F){if(this.ui.isFileDataLoadable(F)){var K=this.ui.formatRecoveryDate(z.modifiedDate);-b({type:"version",label:null!=K?mxResources.get("recoverVersionFrom",[K]):mxResources.get("recoverPreviousVersion"),description:mxResources.get("recoveryVersionDesc"),data:F,date:z.modifiedDate,lossy:!1})}else B()}),mxUtils.bind(this,function(){B()}))}});B()}}),mxUtils.bind(this,function(){b(null)})):b(null)};DrawioFile.prototype.loadDescriptor=function(b,l){b(null)};DrawioFile.prototype.loadPatchDescriptor=function(b,l){this.loadDescriptor(mxUtils.bind(this,function(p){b(p)}),l)};+DrawioFile.prototype.getRecoveryVersion=function(b,l){this.isRevisionHistorySupported()?this.getRevisions(mxUtils.bind(this,function(p){if(null==p||2>p.length)b(null);else{var g=p.length-2,x=Math.max(0,g-5+1),A=mxUtils.bind(this,function(){if(g<x)EditorUi.debug("DrawioFile.getRecoveryVersion",[this],"no valid revision found in",p.length-1-x,"probed"),b(null);else{var y=p[g--];null==y||"function"!==typeof y.getXml?A():y.getXml(mxUtils.bind(this,function(G){if(this.ui.isFileDataLoadable(G)){var L=this.ui.formatRecoveryDate(y.modifiedDate);+b({type:"version",label:null!=L?mxResources.get("recoverVersionFrom",[L]):mxResources.get("recoverPreviousVersion"),description:mxResources.get("recoveryVersionDesc"),data:G,date:y.modifiedDate,lossy:!1})}else A()}),mxUtils.bind(this,function(){A()}))}});A()}}),mxUtils.bind(this,function(){b(null)})):b(null)};DrawioFile.prototype.loadDescriptor=function(b,l){b(null)};DrawioFile.prototype.loadPatchDescriptor=function(b,l){this.loadDescriptor(mxUtils.bind(this,function(p){b(p)}),l)};DrawioFile.prototype.patchDescriptor=function(b,l){this.setDescriptorEtag(b,this.getDescriptorEtag(l));this.descriptorChanged()};DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC&&"fast"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(null==this.sync&&(this.sync=new DrawioFileSync(this)),this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.ui.fireEvent(new mxEventObject("realtimeStateChanged"))})),this.sync.start())};DrawioFile.prototype.isConflict=function(){return!1};DrawioFile.prototype.getChannelId=function(){return Graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(b){return null};DrawioFile.prototype.getCurrentUser=function(){return null};DrawioFile.prototype.getLatestVersion=function(b,l){b(null)};DrawioFile.prototype.getLatestVersionId=function(b,l){b(-1)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};@@ -12707,249 +12710,249 @@ DrawioFile.prototype.handleFileSuccess=function(b){this.ui.spinner.stop();this.uthis.ui.updateStatus(mxUtils.bind(this,function(){this.addAllSavedStatus()})),null!=this.sync&&(this.sync.resetUpdateStatusThread(),this.sync.remoteFileChanged&&(this.sync.remoteFileChanged=!1,this.sync.fileChangedNotify()))):this.ui.clearStatus())};DrawioFile.prototype.handleFileError=function(b,l){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(this.inConflictState?this.handleConflictError(b,l):(this.isModified()&&this.addUnsavedStatus(b),l?this.ui.handleError(b,null!=b?mxResources.get("errorSavingFile"):null):this.isModified()||this.ui.updateStatus(mxUtils.bind(this,function(){var p=this.getErrorMessage(b);null!=p&&60<p.length&&(p=p.substring(0,60)+"...");this.ui.editor.setStatus('<div class="geStatusAlert">'+mxUtils.htmlEntities(mxResources.get("error"))+(null!=p?" ("+mxUtils.htmlEntities(p)+")":"")+"</div>")}))))};-DrawioFile.prototype.handleConflictError=function(b,l){var p=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),g=mxUtils.bind(this,function(z){this.handleFileError(z,!0)}),x=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&(this.ui.clearStatus(),this.save(!0,p,g,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage))}),B=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&-this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&this.save(!0,p,g,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage)}),g)});"none"==DrawioFile.SYNC?this.showCopyDialog(p,g,x):this.invalidChecksum&&l?this.showRefreshDialog(p,g,this.getErrorMessage(b)):l?this.showConflictDialog(x,B):this.addConflictStatus(this.getErrorMessage(b),mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));+DrawioFile.prototype.handleConflictError=function(b,l){var p=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),g=mxUtils.bind(this,function(y){this.handleFileError(y,!0)}),x=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&(this.ui.clearStatus(),this.save(!0,p,g,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage))}),A=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&+this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&this.save(!0,p,g,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage)}),g)});"none"==DrawioFile.SYNC?this.showCopyDialog(p,g,x):this.invalidChecksum&&l?this.showRefreshDialog(p,g,this.getErrorMessage(b)):l?this.showConflictDialog(x,A):this.addConflictStatus(this.getErrorMessage(b),mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));this.synchronizeFile(p,g)}))};DrawioFile.prototype.getErrorMessage=function(b){var l=null!=b?null!=b.error?b.error.message:b.message:null;null==l&&null!=b&&b.code==App.ERROR_TIMEOUT?l=mxResources.get("timeout"):"0"==l&&(l=mxResources.get("noResponse"));return l};DrawioFile.prototype.isOverdue=function(){return null!=this.ageStart&&Date.now()-this.ageStart.getTime()>=this.ui.warnInterval};-DrawioFile.prototype.compressionChanged=function(b){var l=null!=this.ownPages?this.ownPages:this.ui.pages;if(null!=l)for(var p=0;p<l.length;p++){var g=l[p].node;if(null!=g&&(null==this.ui.currentPage||this.ui.currentPage.getId()!=l[p].getId())){var x=g.getElementsByTagName("mxGraphModel");x=0<x.length?x[0]:null;var B=Graph.decompress(mxUtils.getNodeValue(g));b?0==B.length&&null!=x&&(EditorUi.removeChildNodes(g),mxUtils.setTextContent(g,Graph.compressNode(x)),EditorUi.debug("DrawioFile.compressionChanged",-[this],"Page "+p+" compressed")):0<B.length&&null==x&&(EditorUi.removeChildNodes(g),g.appendChild(mxUtils.parseXml(B).documentElement),EditorUi.debug("DrawioFile.compressionChanged",[this],"Page "+p+" decompressed"))}}};DrawioFile.prototype.fileReplaced=function(b){this.inConflictState=this.invalidChecksum=!1;null!=b&&this.patch(b);null!=this.sync&&this.sync.initRealtime();EditorUi.debug("DrawioFile.fileReplaced",[this],"patches",b)};+DrawioFile.prototype.compressionChanged=function(b){var l=null!=this.ownPages?this.ownPages:this.ui.pages;if(null!=l)for(var p=0;p<l.length;p++){var g=l[p].node;if(null!=g&&(null==this.ui.currentPage||this.ui.currentPage.getId()!=l[p].getId())){var x=g.getElementsByTagName("mxGraphModel");x=0<x.length?x[0]:null;var A=Graph.decompress(mxUtils.getNodeValue(g));b?0==A.length&&null!=x&&(EditorUi.removeChildNodes(g),mxUtils.setTextContent(g,Graph.compressNode(x)),EditorUi.debug("DrawioFile.compressionChanged",+[this],"Page "+p+" compressed")):0<A.length&&null==x&&(EditorUi.removeChildNodes(g),g.appendChild(mxUtils.parseXml(A).documentElement),EditorUi.debug("DrawioFile.compressionChanged",[this],"Page "+p+" decompressed"))}}};DrawioFile.prototype.fileReplaced=function(b){this.inConflictState=this.invalidChecksum=!1;null!=b&&this.patch(b);null!=this.sync&&this.sync.initRealtime();EditorUi.debug("DrawioFile.fileReplaced",[this],"patches",b)};DrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=new Date;this.setModified(!0);EditorUi.debug("DrawioFile.fileChanged",[this],"autosaveDelay",this.autosaveDelay,"autosave",this.isAutosave(),"saving",this.savingFile);this.isAutosave()?(null!=this.savingStatusKey&&this.ui.updateStatus(mxUtils.bind(this,function(){this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get(this.savingStatusKey))+"...")})),this.ui.scheduleSanityCheck(),null==this.ageStart&&(this.ageStart=new Date),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(l){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=this.lastChanged)}),mxUtils.bind(this,function(l){this.handleFileError(l)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus());null!=this.sync&&b&&this.sync.localFileChanged()};DrawioFile.prototype.createSecret=function(b){var l=Editor.guid(32);Editor.enableRealtimeCache&&null!=this.sync&&!this.isOptimisticSync()?this.sync.createToken(l,mxUtils.bind(this,function(p){EditorUi.debug("DrawioFile.createSecret",[this],"secret",l,"token",p);b(l,p)}),mxUtils.bind(this,function(){b(l)})):b(l)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};-DrawioFile.prototype.fileSaved=function(b,l,p,g,x,B,z){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;B=null!=B?B:this.ui.getPagesForXml(b,!0);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(B),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=p&&p()):this.sync.fileSaved(B,l,p,g,x,z)}catch(M){this.invalidChecksum=-this.inConflictState=!0;this.descriptorChanged();null!=g&&g(M);try{var F=this.getCurrentUser(),K=null!=F?F.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),K,M)}catch(L){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[l],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(M){this.descriptorChanged(),null!=g&&g(M)}};-DrawioFile.prototype.autosave=function(b,l,p,g){null==this.lastAutosave&&(this.lastAutosave=Date.now());var x=Date.now()-this.lastAutosave<l?b:0;this.clearAutosave();var B=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==B&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",B,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var z=this.isAutosaveRevision();-z&&(this.lastAutosaveRevision=(new Date).getTime());this.save(z,mxUtils.bind(this,function(F){this.autosaveCompleted();null!=p&&p(F)}),mxUtils.bind(this,function(F){null!=g&&g(F)}))}else this.isModified()||this.ui.clearStatus(),null!=p&&p(null)}catch(F){null!=g&&g(F)}}),x);this.autosaveThread=B;EditorUi.debug("DrawioFile.autosave",[this],"thread",B,"delay",b,"maxDelay",l,"actualDelay",x,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};+DrawioFile.prototype.fileSaved=function(b,l,p,g,x,A,y){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;A=null!=A?A:this.ui.getPagesForXml(b,!0);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(A),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=p&&p()):this.sync.fileSaved(A,l,p,g,x,y)}catch(O){this.invalidChecksum=+this.inConflictState=!0;this.descriptorChanged();null!=g&&g(O);try{var G=this.getCurrentUser(),L=null!=G?G.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),L,O)}catch(J){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[l],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(O){this.descriptorChanged(),null!=g&&g(O)}};+DrawioFile.prototype.autosave=function(b,l,p,g){null==this.lastAutosave&&(this.lastAutosave=Date.now());var x=Date.now()-this.lastAutosave<l?b:0;this.clearAutosave();var A=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==A&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",A,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var y=this.isAutosaveRevision();+y&&(this.lastAutosaveRevision=(new Date).getTime());this.save(y,mxUtils.bind(this,function(G){this.autosaveCompleted();null!=p&&p(G)}),mxUtils.bind(this,function(G){null!=g&&g(G)}))}else this.isModified()||this.ui.clearStatus(),null!=p&&p(null)}catch(G){null!=g&&g(G)}}),x);this.autosaveThread=A;EditorUi.debug("DrawioFile.autosave",[this],"thread",A,"delay",b,"maxDelay",l,"actualDelay",x,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var b=(new Date).getTime();return null==this.lastAutosaveRevision||b-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};DrawioFile.prototype.close=function(b){try{this.isAutosave()&&this.isModified()&&(this.updateFileData(),this.save(this.isAutosaveRevision(),null,null,b))}catch(l){}this.stats.closed++;this.destroy()};DrawioFile.prototype.hasSameExtension=function(b,l){if(null!=b&&null!=l){var p=b.lastIndexOf(".");b=0<p?b.substring(p):"";p=l.lastIndexOf(".");return b===(0<p?l.substring(p):"")}return b==l};DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(this.ui.editor.graph.model.removeListener(this.changeListener),this.ui.editor.graph.removeListener(this.changeListener),this.ui.removeListener(this.changeListener),this.changeListener=null)};DrawioFile.prototype.destroy=function(){this.clearAutosave();this.removeListeners();this.stats.destroyed++;null!=this.sync&&(this.sync.destroy(),this.sync=null)};DrawioFile.prototype.commentsSupported=function(){return!1};-DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,l){b([])};DrawioFile.prototype.addComment=function(b,l,p){l(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,l){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,l)};LocalFile=function(b,l,p,g,x,B,z){DrawioFile.call(this,b,l);this.title=p;this.mode=g?null:App.MODE_DEVICE;this.fileHandle=x;this.desc=B;this.editable=z};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};+DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,l){b([])};DrawioFile.prototype.addComment=function(b,l,p){l(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,l){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,l)};LocalFile=function(b,l,p,g,x,A,y){DrawioFile.call(this,b,l);this.title=p;this.mode=g?null:App.MODE_DEVICE;this.fileHandle=x;this.desc=A;this.editable=y};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&(null==this.editable||this.editable)};LocalFile.prototype.setEditable=function(b){this.editable=b;this.descriptorChanged()};LocalFile.prototype.save=function(b,l,p,g,x){this.saveAs(this.title,l,p,g,x)};LocalFile.prototype.saveAs=function(b,l,p,g,x){this.saveFile(b,!1,l,p,null,g,x)};LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b};LocalFile.prototype.getLatestVersion=function(b,l){null==this.fileHandle?null!=l&&l({message:mxResources.get("cannotOpenFile")}):this.ui.loadFileSystemEntry(this.fileHandle,b,l)};-LocalFile.prototype.saveFile=function(b,l,p,g,x,B,z){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;x||this.updateFileData();var F=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var K=this.getData(),M=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=p&&p()}),L=mxUtils.bind(this,function(Q){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=-!0;var c=mxUtils.bind(this,function(k){this.savingFile=!1;null!=g&&g({error:k})});this.saveDraft(K);this.fileHandle.createWritable().then(mxUtils.bind(this,function(k){this.fileHandle.getFile().then(mxUtils.bind(this,function(n){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[n],"conflict",this.desc.lastModified!=n.lastModified);z||this.desc.lastModified==n.lastModified?k.write(F?this.ui.base64ToBlob(Q,"image/png"):Q).then(mxUtils.bind(this,function(){k.close().then(mxUtils.bind(this,-function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(q){try{var t=this.desc;this.savingFile=!1;this.desc=q;this.fileSaved(K,t,M,c);this.removeDraft()}catch(u){c(u)}}),c)}),c)}),c):(this.inConflictState=!0,c())}),mxUtils.bind(this,function(n){this.invalidFileHandle=!0;c(n)}))}),c)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(Q,b,F?"image/png":"text/xml",F);else if(Q.length<MAX_REQUEST_SIZE){var f=b.lastIndexOf(".");f=0<f?b.substring(f+1):"xml";-(new mxXmlRequest(SAVE_URL,"format="+f+"&xml="+encodeURIComponent(Q)+"&filename="+encodeURIComponent(b)+(F?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(Q)}));M()}});F?(l=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(Q){L(Q)}),g,this.ui.getCurrentFile()!=this?K:null,l.scale,l.border)):L(K)};-LocalFile.prototype.rename=function(b,l,p){this.title=b;this.descriptorChanged();null!=l&&l()};LocalLibrary=function(b,l,p){LocalFile.call(this,b,l,p)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(b,l,p){this.saveFile(b,!1,l,p)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(b,l,p){DrawioFile.call(this,b,l);this.title=p;this.etag=this.getEtag(l)};mxUtils.extend(StorageFile,DrawioFile);StorageFile.prototype.getEtag=function(b){return this.ui.hashValue(null!=b?b:"")};StorageFile.prototype.autosaveDelay=500;StorageFile.prototype.maxAutosaveDelay=2E4;StorageFile.prototype.maxRetries=5;StorageFile.prototype.type="F";StorageFile.prototype.getMode=function(){return App.MODE_BROWSER};StorageFile.prototype.isSyncSupported=function(){return!0};+LocalFile.prototype.saveFile=function(b,l,p,g,x,A,y){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;if(x||A){x||this.updateFileData();var G=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var L=this.getData(),O=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=p&&p()}),J=mxUtils.bind(this,function(Q){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=+!0;var c=mxUtils.bind(this,function(k){this.savingFile=!1;null!=g&&g({error:k})});this.saveDraft(L);this.fileHandle.createWritable().then(mxUtils.bind(this,function(k){this.fileHandle.getFile().then(mxUtils.bind(this,function(n){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[n],"conflict",this.desc.lastModified!=n.lastModified);y||this.desc.lastModified==n.lastModified?k.write(G?this.ui.base64ToBlob(Q,"image/png"):Q).then(mxUtils.bind(this,function(){k.close().then(mxUtils.bind(this,+function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(q){try{var t=this.desc;this.savingFile=!1;this.desc=q;this.fileSaved(L,t,O,c);this.removeDraft()}catch(u){c(u)}}),c)}),c)}),c):(this.inConflictState=!0,c())}),mxUtils.bind(this,function(n){this.invalidFileHandle=!0;c(n)}))}),c)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(Q,b,G?"image/png":"text/xml",G);else if(Q.length<MAX_REQUEST_SIZE){var f=b.lastIndexOf(".");f=0<f?b.substring(f+1):"xml";+(new mxXmlRequest(SAVE_URL,"format="+f+"&xml="+encodeURIComponent(Q)+"&filename="+encodeURIComponent(b)+(G?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(Q)}));O()}});G?(x=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(Q){J(Q)}),g,this.ui.getCurrentFile()!=this?L:null,x.scale,x.border)):J(L)}else this.loadFonts(mxUtils.bind(this,+function(){this.updateFileData();this.saveFile(b,l,p,g,!0,A,y)}))};LocalFile.prototype.rename=function(b,l,p){this.title=b;this.descriptorChanged();null!=l&&l()};LocalLibrary=function(b,l,p){LocalFile.call(this,b,l,p)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(b,l,p){this.saveFile(b,!1,l,p)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(b,l,p){DrawioFile.call(this,b,l);this.title=p;this.etag=this.getEtag(l)};mxUtils.extend(StorageFile,DrawioFile);StorageFile.prototype.getEtag=function(b){return this.ui.hashValue(null!=b?b:"")};StorageFile.prototype.autosaveDelay=500;StorageFile.prototype.maxAutosaveDelay=2E4;StorageFile.prototype.maxRetries=5;StorageFile.prototype.type="F";StorageFile.prototype.getMode=function(){return App.MODE_BROWSER};StorageFile.prototype.isSyncSupported=function(){return!0};StorageFile.prototype.isPolling=function(){return this.isSyncSupported()};StorageFile.prototype.getPollingInterval=function(){return 1E4};StorageFile.prototype.loadDescriptor=function(b,l){this.getLatestVersionId(b,l)};StorageFile.prototype.getLatestVersionId=function(b,l){StorageFile.getFileContent(this.ui,this.title,mxUtils.bind(this,function(p){b(this.getEtag(p))}),l)};StorageFile.prototype.isAutosaveOptional=function(){return!0};StorageFile.prototype.getHash=function(){return"L"+encodeURIComponent(this.getTitle())};StorageFile.prototype.getTitle=function(){return this.title};StorageFile.prototype.isRenamable=function(){return!0};StorageFile.prototype.getDescriptor=function(){return this.etag};StorageFile.prototype.setDescriptor=function(b){this.etag=b};StorageFile.prototype.getDescriptorEtag=function(b){return b};StorageFile.prototype.save=function(b,l,p){DrawioFile.prototype.save.apply(this,[!1,mxUtils.bind(this,function(){this.saveFile(this.getTitle(),!1,l,p)}),p])};-StorageFile.prototype.saveAs=function(b,l,p){this.rename(b,l,p)};StorageFile.insertFile=function(b,l,p,g,x,B){StorageFile.doInsertFile(null!=B?B:new StorageFile(b,p,l),g,x)};StorageFile.doInsertFile=function(b,l,p){var g=b.getTitle(),x=b.getUi(),B=mxUtils.bind(this,function(z){var F=function(){b.writeFile(g,function(){l(b)},p)};z?x.confirm(mxResources.get("replaceIt",[g]),F,p):F()});StorageFile.getFileContent(x,g,function(z){B(null!=z)},function(){B(!1)})};+StorageFile.prototype.saveAs=function(b,l,p){this.rename(b,l,p)};StorageFile.insertFile=function(b,l,p,g,x,A){StorageFile.doInsertFile(null!=A?A:new StorageFile(b,p,l),g,x)};StorageFile.doInsertFile=function(b,l,p){var g=b.getTitle(),x=b.getUi(),A=mxUtils.bind(this,function(y){var G=function(){b.writeFile(g,function(){l(b)},p)};y?x.confirm(mxResources.get("replaceIt",[g]),G,p):G()});StorageFile.getFileContent(x,g,function(y){A(null!=y)},function(){A(!1)})};StorageFile.getFileContent=function(b,l,p,g){b.getDatabaseItem(l,function(x){p(null!=x?x.data:null)},mxUtils.bind(this,function(){null==b.database?b.getLocalData(l,p):null!=g&&g()}),"files")};StorageFile.getFileInfo=function(b,l,p,g){b.getDatabaseItem(l,function(x){p(x)},mxUtils.bind(this,function(){null==b.database?b.getLocalData(l,function(x){p(null!=x?{title:l}:null)}):null!=g&&g()}),"filesInfo")};-StorageFile.prototype.saveFile=function(b,l,p,g,x){x=null!=x?x:0;if(this.isEditable()){var B=mxUtils.bind(this,function(){this.writeFile(b,p,g)});this.isRenamable()&&"."==b.charAt(0)&&null!=g?g({message:mxResources.get("invalidName")}):this instanceof StorageLibrary?B():StorageFile.getFileInfo(this.ui,b,mxUtils.bind(this,function(z){this.isRenamable()&&this.getTitle()!=b&&null!=z?this.ui.confirm(mxResources.get("replaceIt",[b]),B,g):this.getLatestVersion(mxUtils.bind(this,function(F){EditorUi.debug("StorageFile.saveFile",-[this],"title",b,"data",z,"latestVersion",[F],"descriptor",this.getDescriptor(),"latestVersionDescriptor",F.getDescriptor());F.getDescriptor()!=this.getDescriptor()?this.mergeFile(F,mxUtils.bind(this,function(){x>=this.maxRetries||this.invalidChecksum||this.inConflictState?(this.inConflictState=!0,null!=g&&g()):this.retrySave(mxUtils.bind(this,function(){this.updateFileData();this.saveFile(b,l,p,g,x+1)}))}),g):B()}),g)}),g)}else null!=p&&p();EditorUi.debug("StorageFile.saveFile",[this],"title",b,+StorageFile.prototype.saveFile=function(b,l,p,g,x){x=null!=x?x:0;if(this.isEditable()){var A=mxUtils.bind(this,function(){this.writeFile(b,p,g)});this.isRenamable()&&"."==b.charAt(0)&&null!=g?g({message:mxResources.get("invalidName")}):this instanceof StorageLibrary?A():StorageFile.getFileInfo(this.ui,b,mxUtils.bind(this,function(y){this.isRenamable()&&this.getTitle()!=b&&null!=y?this.ui.confirm(mxResources.get("replaceIt",[b]),A,g):this.getLatestVersion(mxUtils.bind(this,function(G){EditorUi.debug("StorageFile.saveFile",+[this],"title",b,"data",y,"latestVersion",[G],"descriptor",this.getDescriptor(),"latestVersionDescriptor",G.getDescriptor());G.getDescriptor()!=this.getDescriptor()?this.mergeFile(G,mxUtils.bind(this,function(){x>=this.maxRetries||this.invalidChecksum||this.inConflictState?(this.inConflictState=!0,null!=g&&g()):this.retrySave(mxUtils.bind(this,function(){this.updateFileData();this.saveFile(b,l,p,g,x+1)}))}),g):A()}),g)}),g)}else null!=p&&p();EditorUi.debug("StorageFile.saveFile",[this],"title",b,"revision",l,"retry",x)};StorageFile.prototype.retrySave=function(b){var l=300+300*Math.random();window.setTimeout(b,l);EditorUi.debug("StorageFile.retrySave",[this],"delay",l)};-StorageFile.prototype.writeFile=function(b,l,p){EditorUi.debug("StorageFile.writeFile",[this],"title",b);this.isRenamable()&&(this.title=b);try{var g=this.getDescriptor(),x=this.getData(),B=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.setDescriptor(this.getEtag(x));this.contentChanged();this.fileSaved(x,g,l,p)});this.setShadowModified(!1);this.ui.setDatabaseItem(null,[{title:this.title,size:x.length,lastModified:Date.now(),type:this.type},{title:this.title,data:x}],-B,mxUtils.bind(this,function(){if(null==this.ui.database)try{this.ui.setLocalData(this.title,x,B)}catch(z){null!=p&&p(z)}else null!=p&&p()}),["filesInfo","files"])}catch(z){null!=p&&p(z)}};StorageFile.prototype.rename=function(b,l,p){var g=this.getTitle();g!=b?(EditorUi.debug("StorageFile.rename",[this],"oldTitle",g,"newTitle",b),this.saveFile(b,!1,mxUtils.bind(this,function(){StorageFile.deleteFile(this.ui,g,mxUtils.bind(this,function(){this.ui.removeLocalData(g,l)},p))}),p)):l()};+StorageFile.prototype.writeFile=function(b,l,p){EditorUi.debug("StorageFile.writeFile",[this],"title",b);this.isRenamable()&&(this.title=b);try{var g=this.getDescriptor(),x=this.getData(),A=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.setDescriptor(this.getEtag(x));this.contentChanged();this.fileSaved(x,g,l,p)});this.setShadowModified(!1);this.ui.setDatabaseItem(null,[{title:this.title,size:x.length,lastModified:Date.now(),type:this.type},{title:this.title,data:x}],+A,mxUtils.bind(this,function(){if(null==this.ui.database)try{this.ui.setLocalData(this.title,x,A)}catch(y){null!=p&&p(y)}else null!=p&&p()}),["filesInfo","files"])}catch(y){null!=p&&p(y)}};StorageFile.prototype.rename=function(b,l,p){var g=this.getTitle();g!=b?(EditorUi.debug("StorageFile.rename",[this],"oldTitle",g,"newTitle",b),this.saveFile(b,!1,mxUtils.bind(this,function(){StorageFile.deleteFile(this.ui,g,mxUtils.bind(this,function(){this.ui.removeLocalData(g,l)},p))}),p)):l()};StorageFile.prototype.getLatestVersion=function(b,l){StorageFile.getFileContent(this.ui,this.title,mxUtils.bind(this,function(p){b(new StorageFile(this.ui,p,this.title))}),l)};StorageFile.prototype.destroy=function(){DrawioFile.prototype.destroy.apply(this,arguments);null!=this.storageListener&&(mxEvent.removeListener(window,"storage",this.storageListener),this.storageListener=null)};-StorageFile.listLocalStorageFiles=function(b){for(var l=[],p=0;p<localStorage.length;p++){var g=localStorage.key(p),x=localStorage.getItem(g);if(0<g.length&&"."!=g.charAt(0)&&0<x.length){var B=(null==b||"F"==b)&&("<mxfile "===x.substring(0,8)||"<?xml"===x.substring(0,5)||"\x3c!--[if IE]>"===x.substring(0,12)),z=(null==b||"L"==b)&&"<mxlibrary>"===x.substring(0,11);(B||z)&&l.push({title:g,type:B?"F":"L",size:x.length,lastModified:Date.now()})}}return l};-StorageFile.migrate=function(b){var l=StorageFile.listLocalStorageFiles();l.push({title:".scratchpad",type:"L"});var p=b.transaction(["files","filesInfo"],"readwrite");b=p.objectStore("files");p=p.objectStore("filesInfo");for(var g=0;g<l.length;g++){var x=l[g],B=localStorage.getItem(x.title);b.add({title:x.title,data:B});p.add(x)}};-StorageFile.listFiles=function(b,l,p,g){b.getDatabaseItems(function(x){var B=[];if(null!=x)for(var z=0;z<x.length;z++)"."==x[z].title.charAt(0)||null!=l&&x[z].type!=l||B.push(x[z]);p(B)},function(){null==b.database?p(StorageFile.listLocalStorageFiles(l)):null!=g&&g()},"filesInfo")};StorageFile.deleteFile=function(b,l,p,g){b.removeDatabaseItem([l,l],p,function(){null==b.database?(localStorage.removeItem(l),p()):null!=g&&g()},["files","filesInfo"])};StorageLibrary=function(b,l,p){StorageFile.call(this,b,l,p)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.type="L";StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.save=function(b,l,p){this.saveAs(this.getTitle(),l,p)};StorageLibrary.prototype.saveAs=function(b,l,p){this.saveFile(b,!1,l,p)};StorageLibrary.prototype.getHash=function(){return"L"+encodeURIComponent(this.title)};+StorageFile.listLocalStorageFiles=function(b){for(var l=[],p=0;p<localStorage.length;p++){var g=localStorage.key(p),x=localStorage.getItem(g);if(0<g.length&&"."!=g.charAt(0)&&0<x.length){var A=(null==b||"F"==b)&&("<mxfile "===x.substring(0,8)||"<?xml"===x.substring(0,5)||"\x3c!--[if IE]>"===x.substring(0,12)),y=(null==b||"L"==b)&&"<mxlibrary>"===x.substring(0,11);(A||y)&&l.push({title:g,type:A?"F":"L",size:x.length,lastModified:Date.now()})}}return l};+StorageFile.migrate=function(b){var l=StorageFile.listLocalStorageFiles();l.push({title:".scratchpad",type:"L"});var p=b.transaction(["files","filesInfo"],"readwrite");b=p.objectStore("files");p=p.objectStore("filesInfo");for(var g=0;g<l.length;g++){var x=l[g],A=localStorage.getItem(x.title);b.add({title:x.title,data:A});p.add(x)}};+StorageFile.listFiles=function(b,l,p,g){b.getDatabaseItems(function(x){var A=[];if(null!=x)for(var y=0;y<x.length;y++)"."==x[y].title.charAt(0)||null!=l&&x[y].type!=l||A.push(x[y]);p(A)},function(){null==b.database?p(StorageFile.listLocalStorageFiles(l)):null!=g&&g()},"filesInfo")};StorageFile.deleteFile=function(b,l,p,g){b.removeDatabaseItem([l,l],p,function(){null==b.database?(localStorage.removeItem(l),p()):null!=g&&g()},["files","filesInfo"])};StorageLibrary=function(b,l,p){StorageFile.call(this,b,l,p)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.type="L";StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.save=function(b,l,p){this.saveAs(this.getTitle(),l,p)};StorageLibrary.prototype.saveAs=function(b,l,p){this.saveFile(b,!1,l,p)};StorageLibrary.prototype.getHash=function(){return"L"+encodeURIComponent(this.title)};StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title};StorageLibrary.prototype.isRenamable=function(b,l,p){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};RemoteFile=function(b,l,p){DrawioFile.call(this,b,l);this.title=p;this.mode=null};mxUtils.extend(RemoteFile,DrawioFile);RemoteFile.prototype.isAutosave=function(){return!1};RemoteFile.prototype.getMode=function(){return this.mode};RemoteFile.prototype.getTitle=function(){return this.title};RemoteFile.prototype.isRenamable=function(){return!1};RemoteFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};RemoteLibrary=function(b,l,p){RemoteFile.call(this,b,l,p.title);this.libObj=p};mxUtils.extend(RemoteLibrary,LocalFile);RemoteLibrary.prototype.getHash=function(){return"R"+encodeURIComponent(JSON.stringify([this.libObj.id,this.libObj.title,this.libObj.downloadUrl]))};RemoteLibrary.prototype.isEditable=function(){return!1};RemoteLibrary.prototype.isRenamable=function(){return!1};RemoteLibrary.prototype.isAutosave=function(){return!1};RemoteLibrary.prototype.save=function(b,l,p){};RemoteLibrary.prototype.saveAs=function(b,l,p){};RemoteLibrary.prototype.updateFileData=function(){};RemoteLibrary.prototype.open=function(){};UrlLibrary=function(b,l,p){StorageFile.call(this,b,l,p);b=p;l=b.lastIndexOf("/");0<=l&&(b=b.substring(l+1));this.fname=b};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(b,l,p){return!1};UrlLibrary.prototype.saveAs=function(b,l,p){};UrlLibrary.prototype.open=function(){};EmbedFile=function(b,l,p){DrawioFile.call(this,b,l);this.desc=p||{};this.mode=App.MODE_EMBED};mxUtils.extend(EmbedFile,DrawioFile);EmbedFile.prototype.getMode=function(){return this.mode};EmbedFile.prototype.getDescriptor=function(){return this.desc};EmbedFile.prototype.setDescriptor=function(b){this.desc=b||{}};EmbedFile.prototype.getTitle=function(){return this.desc.title||""};/*mxClient.IS_IOS || */var StorageDialog=function(b,l,p){function g(Q,c,f,k,n,q){function t(){mxEvent.addListener(u,"click",null!=q?q:function(){f==App.MODE_GOOGLE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(f,!0);l()})):f==App.MODE_ONEDRIVE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.oneDrive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(f,!0);l()}),function(U){b.spinner.stop();b.handleError(U)}):-(b.setMode(f,!0),l())})}F++;++z>p&&(mxUtils.br(K),z=1);var u=document.createElement("a");u.style.overflow="hidden";u.style.display="inline-block";u.className="geBaseButton";u.style.boxSizing="border-box";u.style.fontSize="11px";u.style.position="relative";u.style.margin="4px";u.style.marginTop="8px";u.style.marginBottom="0px";u.style.padding="8px 10px 8px 10px";u.style.width="88px";u.style.height="100px";u.style.whiteSpace="nowrap";u.setAttribute("title",c);var y=document.createElement("div");y.style.textOverflow=-"ellipsis";y.style.overflow="hidden";y.style.position="absolute";y.style.bottom="8px";y.style.left="0px";y.style.right="0px";mxUtils.write(y,c);u.appendChild(y);if(null!=Q){var E=document.createElement("img");E.setAttribute("src",Q);E.setAttribute("border","0");E.setAttribute("align","absmiddle");E.style.width="60px";E.style.height="60px";E.style.paddingBottom="6px";u.appendChild(E)}else y.style.paddingTop="5px",y.style.whiteSpace="normal",mxClient.IS_IOS?(u.style.padding="0px 10px 20px 10px",u.style.top=-"6px"):mxClient.IS_FF&&(y.style.paddingTop="0px",y.style.marginTop="-2px");if(null!=n)for(Q=0;Q<n.length;Q++)mxUtils.br(y),mxUtils.write(y,n[Q]);if(null!=k&&null==b[k]){E.style.visibility="hidden";mxUtils.setOpacity(y,10);var I=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});I.spin(u);var C=window.setTimeout(function(){null==b[k]&&(I.stop(),u.style.display="none")},3E4);b.addListener("clientLoaded",-mxUtils.bind(this,function(U,J){null!=b[k]&&J.getProperty("client")==b[k]&&(window.clearTimeout(C),mxUtils.setOpacity(y,100),E.style.visibility="",I.stop(),t(),"drive"==k&&null!=M.parentNode&&M.parentNode.removeChild(M))}))}else t();K.appendChild(u)}p=null!=p?p:2;var x=document.createElement("div");x.style.textAlign="center";x.style.whiteSpace="nowrap";x.style.paddingTop="0px";x.style.paddingBottom="20px";var B=document.createElement("div");B.style.border="1px solid #d3d3d3";B.style.borderWidth="1px 0px 1px 0px";-B.style.padding="10px 0px 20px 0px";var z=0,F=0,K=document.createElement("div");K.style.paddingTop="2px";B.appendChild(K);var M=document.createElement("p"),L=document.createElement("p");L.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";mxUtils.write(L,mxResources.get("saveDiagramsTo")+":");x.appendChild(L);x.appendChild(B);z=0;"function"===typeof window.DriveClient&&g(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");null!=b.m365&&+(b.setMode(f,!0),l())})}G++;++y>p&&(mxUtils.br(L),y=1);var u=document.createElement("a");u.style.overflow="hidden";u.style.display="inline-block";u.className="geBaseButton";u.style.boxSizing="border-box";u.style.fontSize="11px";u.style.position="relative";u.style.margin="4px";u.style.marginTop="8px";u.style.marginBottom="0px";u.style.padding="8px 10px 8px 10px";u.style.width="88px";u.style.height="100px";u.style.whiteSpace="nowrap";u.setAttribute("title",c);var B=document.createElement("div");B.style.textOverflow=+"ellipsis";B.style.overflow="hidden";B.style.position="absolute";B.style.bottom="8px";B.style.left="0px";B.style.right="0px";mxUtils.write(B,c);u.appendChild(B);if(null!=Q){var E=document.createElement("img");E.setAttribute("src",Q);E.setAttribute("border","0");E.setAttribute("align","absmiddle");E.style.width="60px";E.style.height="60px";E.style.paddingBottom="6px";u.appendChild(E)}else B.style.paddingTop="5px",B.style.whiteSpace="normal",mxClient.IS_IOS?(u.style.padding="0px 10px 20px 10px",u.style.top=+"6px"):mxClient.IS_FF&&(B.style.paddingTop="0px",B.style.marginTop="-2px");if(null!=n)for(Q=0;Q<n.length;Q++)mxUtils.br(B),mxUtils.write(B,n[Q]);if(null!=k&&null==b[k]){E.style.visibility="hidden";mxUtils.setOpacity(B,10);var I=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});I.spin(u);var C=window.setTimeout(function(){null==b[k]&&(I.stop(),u.style.display="none")},3E4);b.addListener("clientLoaded",+mxUtils.bind(this,function(U,K){null!=b[k]&&K.getProperty("client")==b[k]&&(window.clearTimeout(C),mxUtils.setOpacity(B,100),E.style.visibility="",I.stop(),t(),"drive"==k&&null!=O.parentNode&&O.parentNode.removeChild(O))}))}else t();L.appendChild(u)}p=null!=p?p:2;var x=document.createElement("div");x.style.textAlign="center";x.style.whiteSpace="nowrap";x.style.paddingTop="0px";x.style.paddingBottom="20px";var A=document.createElement("div");A.style.border="1px solid #d3d3d3";A.style.borderWidth="1px 0px 1px 0px";+A.style.padding="10px 0px 20px 0px";var y=0,G=0,L=document.createElement("div");L.style.paddingTop="2px";A.appendChild(L);var O=document.createElement("p"),J=document.createElement("p");J.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";mxUtils.write(J,mxResources.get("saveDiagramsTo")+":");x.appendChild(J);x.appendChild(A);y=0;"function"===typeof window.DriveClient&&g(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");null!=b.m365&&g(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("m365"),App.MODE_M365,"m365");"1"!=urlParams.noDevice&&g(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||g(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);"function"===typeof window.OneDriveClient&&g(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");null!=b.gitHub&&g(IMAGE_PATH+"/github-logo.svg",-mxResources.get("github"),App.MODE_GITHUB,"gitHub");null!=b.gitLab&&g(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab");B=document.createElement("span");B.style.position="absolute";B.style.cursor="pointer";B.style.bottom="27px";B.style.color="gray";B.style.userSelect="none";B.style.textAlign="center";B.style.left="50%";mxUtils.setPrefixedStyle(B.style,"transform","translate(-50%,0)");mxUtils.write(B,mxResources.get("decideLater"));x.appendChild(B);mxEvent.addListener(B,-"click",function(){b.hideDialog();var Q=Editor.useLocalStorage;b.createFile(b.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=Q});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==b.drive&&(M.style.padding="7px",M.style.fontSize="9pt",M.style.marginTop="-14px",M.innerHTML='<a style="background-color:#dcdcdc;padding:6px;color:black;text-decoration:none;" href="https://www.drawio.com/doc/faq/google-drive-connection-problems" target="_blank"><img border="0" src="'+-mxGraph.prototype.warningImage.src+'" align="absmiddle" style="margin-top:-4px"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",x.appendChild(M))},5E3);this.container=x},SplashDialog=function(b){var l=document.createElement("div");l.style.textAlign="center";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var p=b.addLanguageMenu(l,!1,"28px");null!=p&&(p.style.bottom="24px")}var g=document.createElement("img");g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width=+mxResources.get("github"),App.MODE_GITHUB,"gitHub");null!=b.gitLab&&g(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab");A=document.createElement("span");A.style.position="absolute";A.style.cursor="pointer";A.style.bottom="27px";A.style.color="gray";A.style.userSelect="none";A.style.textAlign="center";A.style.left="50%";mxUtils.setPrefixedStyle(A.style,"transform","translate(-50%,0)");mxUtils.write(A,mxResources.get("decideLater"));x.appendChild(A);mxEvent.addListener(A,+"click",function(){b.hideDialog();var Q=Editor.useLocalStorage;b.createFile(b.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=Q});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==b.drive&&(O.style.padding="7px",O.style.fontSize="9pt",O.style.marginTop="-14px",O.innerHTML='<a style="background-color:#dcdcdc;padding:6px;color:black;text-decoration:none;" href="https://www.drawio.com/doc/faq/google-drive-connection-problems" target="_blank"><img border="0" src="'++mxGraph.prototype.warningImage.src+'" align="absmiddle" style="margin-top:-4px"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",x.appendChild(O))},5E3);this.container=x},SplashDialog=function(b){var l=document.createElement("div");l.style.textAlign="center";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var p=b.addLanguageMenu(l,!1,"28px");null!=p&&(p.style.bottom="24px")}var g=document.createElement("img");g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width="32px";g.style.height="32px";g.style.marginRight="8px";g.style.marginTop="-4px";var x=document.createElement("div");x.style.margin="8px 0px 0px 0px";x.style.padding="18px 0px 24px 0px";p="";b.mode==App.MODE_GOOGLE?(g.src=IMAGE_PATH+"/google-drive-logo.svg",p=mxResources.get("googleDrive")):b.mode==App.MODE_DROPBOX?(g.src=IMAGE_PATH+"/dropbox-logo.svg",p=mxResources.get("dropbox")):b.mode==App.MODE_ONEDRIVE?(g.src=IMAGE_PATH+"/onedrive-logo.svg",p=mxResources.get("oneDrive")):b.mode==App.MODE_M365?(g.src=IMAGE_PATH+"/onedrive-logo.svg",p=mxResources.get("m365")):b.mode==App.MODE_GITHUB?(g.src=IMAGE_PATH+"/github-logo.svg",p=mxResources.get("github")):b.mode==App.MODE_GITLAB?(g.src=IMAGE_PATH+"/gitlab-logo.svg",p=mxResources.get("gitlab")):b.mode==App.MODE_BROWSER?(g.src=IMAGE_PATH+"/osa_database.png",p=mxResources.get("browser")):b.mode==App.MODE_TRELLO?(g.src=IMAGE_PATH+"/trello-logo.svg",p=mxResources.get("trello")):(g.src=IMAGE_PATH+"/osa_drive-harddisk.png",x.style.paddingBottom="10px",-x.style.paddingTop="30px",p=mxResources.get("device"));var B=document.createElement("button");B.className="geBigButton";B.style.marginBottom="8px";B.style.fontSize="18px";B.style.padding="10px";B.style.width="340px";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)x.style.padding="42px 0px 10px 0px",B.style.marginBottom="12px";else{x.style.border="1px solid #d3d3d3";x.style.borderWidth="1px 0px 1px 0px";var z=document.createElement("table"),F=document.createElement("tbody"),K=document.createElement("tr"),-M=document.createElement("td"),L=document.createElement("td");z.setAttribute("align","center");M.appendChild(g);g=document.createElement("div");g.style.fontSize="22px";g.style.paddingBottom="6px";g.style.color="gray";mxUtils.write(g,p);L.style.textAlign="left";L.appendChild(g);K.appendChild(M);K.appendChild(L);F.appendChild(K);z.appendChild(F);l.appendChild(z);p=document.createElement("span");p.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";-mxUtils.setPrefixedStyle(p.style,"transform","translate(-50%,0)");mxUtils.write(p,mxResources.get("changeStorage"));mxEvent.addListener(p,"click",function(){b.hideDialog(!1);b.setMode(null);b.clearMode();b.showSplash(!0)});l.appendChild(p)}mxUtils.write(B,mxResources.get("createNewDiagram"));mxEvent.addListener(B,"click",function(){b.hideDialog();b.actions.get("new").funct()});x.appendChild(B);mxUtils.br(x);B=document.createElement("button");B.className="geBigButton";B.style.marginBottom="22px";B.style.fontSize=-"18px";B.style.padding="10px";B.style.width="340px";mxUtils.write(B,mxResources.get("openExistingDiagram"));mxEvent.addListener(B,"click",function(){b.actions.get("open").funct()});x.appendChild(B);b.mode==App.MODE_GOOGLE?mxResources.get("googleDrive"):b.mode==App.MODE_DROPBOX?mxResources.get("dropbox"):b.mode==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):b.mode==App.MODE_GITHUB?mxResources.get("github"):b.mode==App.MODE_GITLAB?mxResources.get("gitlab"):b.mode==App.MODE_TRELLO?mxResources.get("trello"):-b.mode==App.MODE_DEVICE?mxResources.get("device"):b.mode==App.MODE_BROWSER&&mxResources.get("browser");if(!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp)if(p=function(f){B.style.marginBottom="24px";var k=document.createElement("a");k.style.display="inline-block";k.style.color="gray";k.style.cursor="pointer";k.style.marginTop="6px";mxUtils.write(k,mxResources.get("signOut"));B.style.marginBottom="16px";x.style.paddingBottom="18px";mxEvent.addListener(k,"click",function(){b.confirm(mxResources.get("areYouSure"),-function(){f()})});x.appendChild(k)},b.mode==App.MODE_GOOGLE&&null!=b.drive){var Q=b.drive.getUsersList();if(0<Q.length){g=document.createElement("span");g.style.marginTop="6px";mxUtils.write(g,mxResources.get("changeUser")+":");B.style.marginBottom="16px";x.style.paddingBottom="18px";x.appendChild(g);var c=document.createElement("select");c.style.marginLeft="4px";c.style.width="140px";for(p=0;p<Q.length;p++)z=document.createElement("option"),mxUtils.write(z,Q[p].displayName),z.value=p,c.appendChild(z),-z=document.createElement("option"),z.innerHTML=" ",mxUtils.write(z,"<"+Q[p].email+">"),z.setAttribute("disabled","disabled"),c.appendChild(z);z=document.createElement("option");mxUtils.write(z,mxResources.get("addAccount"));z.value=Q.length;c.appendChild(z);mxEvent.addListener(c,"change",function(){var f=c.value,k=Q.length!=f;k&&b.drive.setUser(Q[f]);b.drive.authorize(k,function(){b.setMode(App.MODE_GOOGLE);b.hideDialog();b.showSplash()},function(n){b.handleError(n,null,function(){b.hideDialog();+x.style.paddingTop="30px",p=mxResources.get("device"));var A=document.createElement("button");A.className="geBigButton";A.style.marginBottom="8px";A.style.fontSize="18px";A.style.padding="10px";A.style.width="340px";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)x.style.padding="42px 0px 10px 0px",A.style.marginBottom="12px";else{x.style.border="1px solid #d3d3d3";x.style.borderWidth="1px 0px 1px 0px";var y=document.createElement("table"),G=document.createElement("tbody"),L=document.createElement("tr"),+O=document.createElement("td"),J=document.createElement("td");y.setAttribute("align","center");O.appendChild(g);g=document.createElement("div");g.style.fontSize="22px";g.style.paddingBottom="6px";g.style.color="gray";mxUtils.write(g,p);J.style.textAlign="left";J.appendChild(g);L.appendChild(O);L.appendChild(J);G.appendChild(L);y.appendChild(G);l.appendChild(y);p=document.createElement("span");p.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";+mxUtils.setPrefixedStyle(p.style,"transform","translate(-50%,0)");mxUtils.write(p,mxResources.get("changeStorage"));mxEvent.addListener(p,"click",function(){b.hideDialog(!1);b.setMode(null);b.clearMode();b.showSplash(!0)});l.appendChild(p)}mxUtils.write(A,mxResources.get("createNewDiagram"));mxEvent.addListener(A,"click",function(){b.hideDialog();b.actions.get("new").funct()});x.appendChild(A);mxUtils.br(x);A=document.createElement("button");A.className="geBigButton";A.style.marginBottom="22px";A.style.fontSize=+"18px";A.style.padding="10px";A.style.width="340px";mxUtils.write(A,mxResources.get("openExistingDiagram"));mxEvent.addListener(A,"click",function(){b.actions.get("open").funct()});x.appendChild(A);b.mode==App.MODE_GOOGLE?mxResources.get("googleDrive"):b.mode==App.MODE_DROPBOX?mxResources.get("dropbox"):b.mode==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):b.mode==App.MODE_GITHUB?mxResources.get("github"):b.mode==App.MODE_GITLAB?mxResources.get("gitlab"):b.mode==App.MODE_TRELLO?mxResources.get("trello"):+b.mode==App.MODE_DEVICE?mxResources.get("device"):b.mode==App.MODE_BROWSER&&mxResources.get("browser");if(!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp)if(p=function(f){A.style.marginBottom="24px";var k=document.createElement("a");k.style.display="inline-block";k.style.color="gray";k.style.cursor="pointer";k.style.marginTop="6px";mxUtils.write(k,mxResources.get("signOut"));A.style.marginBottom="16px";x.style.paddingBottom="18px";mxEvent.addListener(k,"click",function(){b.confirm(mxResources.get("areYouSure"),+function(){f()})});x.appendChild(k)},b.mode==App.MODE_GOOGLE&&null!=b.drive){var Q=b.drive.getUsersList();if(0<Q.length){g=document.createElement("span");g.style.marginTop="6px";mxUtils.write(g,mxResources.get("changeUser")+":");A.style.marginBottom="16px";x.style.paddingBottom="18px";x.appendChild(g);var c=document.createElement("select");c.style.marginLeft="4px";c.style.width="140px";for(p=0;p<Q.length;p++)y=document.createElement("option"),mxUtils.write(y,Q[p].displayName),y.value=p,c.appendChild(y),+y=document.createElement("option"),y.innerHTML=" ",mxUtils.write(y,"<"+Q[p].email+">"),y.setAttribute("disabled","disabled"),c.appendChild(y);y=document.createElement("option");mxUtils.write(y,mxResources.get("addAccount"));y.value=Q.length;c.appendChild(y);mxEvent.addListener(c,"change",function(){var f=c.value,k=Q.length!=f;k&&b.drive.setUser(Q[f]);b.drive.authorize(k,function(){b.setMode(App.MODE_GOOGLE);b.hideDialog();b.showSplash()},function(n){b.handleError(n,null,function(){b.hideDialog();b.showSplash()})},!0)});x.appendChild(c)}else p(function(){b.drive.logout()})}else b.mode!=App.MODE_ONEDRIVE||null==b.oneDrive||b.oneDrive.noLogout?b.mode==App.MODE_GITHUB&&null!=b.gitHub?p(function(){b.gitHub.logout();b.openLink("https://www.github.com/logout")}):b.mode==App.MODE_GITLAB&&null!=b.gitLab?p(function(){b.gitLab.logout();var f=document.createElement("form");f.setAttribute("method","post");f.setAttribute("action",DRAWIO_GITLAB_URL+"/users/sign_out");f.setAttribute("target","_blank");document.body.appendChild(f);-f.submit();f.parentNode.removeChild(f)}):b.mode==App.MODE_TRELLO&&null!=b.trello?b.trello.isAuthorized()&&p(function(){b.trello.logout()}):b.mode==App.MODE_DROPBOX&&null!=b.dropbox&&p(function(){b.dropbox.logout();b.openLink("https://www.dropbox.com/logout")}):p(function(){b.oneDrive.logout()});l.appendChild(x);this.container=l},EmbedDialog=function(b,l,p,g,x,B,z,F,K,M){g=document.createElement("div");g.style.height="100%";g.style.display="flex";g.style.flexDirection="column";var L=EmbedDialog.maxSize,-Q=/^https?:\/\//.test(l)||/^mailto:\/\//.test(l);z=document.createElement("div");z.style.flexShrink="0";z.style.position="relative";null!=B?mxUtils.write(z,B):mxUtils.write(z,mxResources.get(l.length<L?Q?"link":"mainEmbedNotice":"preview")+":");B=document.createElement("span");B.style.cssFloat="right";B.style.color="gray";mxUtils.write(B,b.formatFileSize(l.length));z.appendChild(B);g.appendChild(z);var c=document.createElement("textarea");c.setAttribute("autocomplete","off");c.setAttribute("autocorrect",-"off");c.setAttribute("autocapitalize","off");c.setAttribute("spellcheck","false");c.style.fontFamily="monospace";c.style.wordBreak="break-all";c.style.marginTop="10px";c.style.resize="none";c.style.flex="1";c.style.width="100%";c.style.boxSizing="border-box";c.value=mxResources.get("updatingDocument");g.appendChild(c);this.init=function(){window.setTimeout(function(){l.length<L?(c.value=l,c.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?c.select():document.execCommand("selectAll",-!1,null)):(c.setAttribute("readonly","true"),c.value=mxResources.get("tooLargeUseDownload"))},0)};B=document.createElement("div");B.style.flexShrink="0";B.style.textAlign="right";B.style.paddingTop="14px";B.style.whiteSpace="nowrap";z=null;EmbedDialog.showPreviewOption&&!mxIsElectron&&!navigator.standalone&&Q&&(z=mxUtils.button(null!=F?F:mxResources.get(l.length<L?"preview":"openInNewWindow"),function(){var f=l.length<L?c.value:l;if(null!=x)x(f);else if(Q)try{var k=b.openLink(f);null!=k&&(null==p||+f.submit();f.parentNode.removeChild(f)}):b.mode==App.MODE_TRELLO&&null!=b.trello?b.trello.isAuthorized()&&p(function(){b.trello.logout()}):b.mode==App.MODE_DROPBOX&&null!=b.dropbox&&p(function(){b.dropbox.logout();b.openLink("https://www.dropbox.com/logout")}):p(function(){b.oneDrive.logout()});l.appendChild(x);this.container=l},EmbedDialog=function(b,l,p,g,x,A,y,G,L,O){g=document.createElement("div");g.style.height="100%";g.style.display="flex";g.style.flexDirection="column";var J=EmbedDialog.maxSize,+Q=/^https?:\/\//.test(l)||/^mailto:\/\//.test(l);y=document.createElement("div");y.style.flexShrink="0";y.style.position="relative";null!=A?mxUtils.write(y,A):mxUtils.write(y,mxResources.get(l.length<J?Q?"link":"mainEmbedNotice":"preview")+":");A=document.createElement("span");A.style.cssFloat="right";A.style.color="gray";mxUtils.write(A,b.formatFileSize(l.length));y.appendChild(A);g.appendChild(y);var c=document.createElement("textarea");c.setAttribute("autocomplete","off");c.setAttribute("autocorrect",+"off");c.setAttribute("autocapitalize","off");c.setAttribute("spellcheck","false");c.style.fontFamily="monospace";c.style.wordBreak="break-all";c.style.marginTop="10px";c.style.resize="none";c.style.flex="1";c.style.width="100%";c.style.boxSizing="border-box";c.value=mxResources.get("updatingDocument");g.appendChild(c);this.init=function(){window.setTimeout(function(){l.length<J?(c.value=l,c.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?c.select():document.execCommand("selectAll",+!1,null)):(c.setAttribute("readonly","true"),c.value=mxResources.get("tooLargeUseDownload"))},0)};A=document.createElement("div");A.style.flexShrink="0";A.style.textAlign="right";A.style.paddingTop="14px";A.style.whiteSpace="nowrap";y=null;EmbedDialog.showPreviewOption&&!mxIsElectron&&!navigator.standalone&&Q&&(y=mxUtils.button(null!=G?G:mxResources.get(l.length<J?"preview":"openInNewWindow"),function(){var f=l.length<J?c.value:l;if(null!=x)x(f);else if(Q)try{var k=b.openLink(f);null!=k&&(null==p||0<p)&&window.setTimeout(mxUtils.bind(this,function(){try{null!=k&&null!=k.location.href&&k.location.href.substring(0,8)!=f.substring(0,8)&&(k.close(),b.handleError({message:mxResources.get("drawingTooLarge")}))}catch(q){}}),p||500)}catch(q){b.handleError({message:q.message||mxResources.get("drawingTooLarge")})}else{var n=window.open();n=null!=n?n.document:null;null!=n?(n.writeln("<html><head><title>"+mxUtils.htmlEntities(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+("<iframe"==-l.substring(0,7)?l:mxUtils.htmlEntities(l))+"</body></html>"),n.close()):b.handleError({message:mxResources.get("errorUpdatingPreview")})}}),z.className="geBtn",B.appendChild(z));M||(F=mxUtils.button(mxResources.get("export"),function(){b.hideDialog();b.saveData(null!=K?K:"embed.txt","txt",l,"text/plain")}),F.className="geBtn",B.appendChild(F));!b.isOffline()&&l.length<L&&(F=mxUtils.button("",function(){try{var f="mailto:?subject="+encodeURIComponent(K||b.defaultFilename)+"&body="+encodeURIComponent(c.value);-b.openLink(f)}catch(k){b.handleError({message:k.message||mxResources.get("drawingTooLarge")})}}),M=document.createElement("img"),M.className="geAdaptiveAsset",M.setAttribute("src",Editor.mailImage),M.setAttribute("width","18"),M.setAttribute("height","18"),M.setAttribute("border","0"),M.style.marginBottom="5px",F.appendChild(M),F.style.verticalAlign="bottom",F.style.paddingTop="4px",F.style.minWidth="46px",F.className="geBtn",B.appendChild(F));F=mxUtils.button(mxResources.get("close"),function(){b.hideDialog()});-F.className="geBtn";B.appendChild(F);M=mxUtils.button(mxResources.get("copy"),function(){c.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?c.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");b.alert(mxResources.get("copiedToClipboard"))});l.length<L?mxClient.IS_SF||null!=document.documentMode?F.className="geBtn gePrimaryBtn":(B.appendChild(M),M.className="geBtn gePrimaryBtn"):null!=z&&(B.appendChild(z),z.className="geBtn gePrimaryBtn");g.appendChild(B);+l.substring(0,7)?l:mxUtils.htmlEntities(l))+"</body></html>"),n.close()):b.handleError({message:mxResources.get("errorUpdatingPreview")})}}),y.className="geBtn",A.appendChild(y));O||(G=mxUtils.button(mxResources.get("export"),function(){b.hideDialog();b.saveData(null!=L?L:"embed.txt","txt",l,"text/plain")}),G.className="geBtn",A.appendChild(G));!b.isOffline()&&l.length<J&&(G=mxUtils.button("",function(){try{var f="mailto:?subject="+encodeURIComponent(L||b.defaultFilename)+"&body="+encodeURIComponent(c.value);+b.openLink(f)}catch(k){b.handleError({message:k.message||mxResources.get("drawingTooLarge")})}}),O=document.createElement("img"),O.className="geAdaptiveAsset",O.setAttribute("src",Editor.mailImage),O.setAttribute("width","18"),O.setAttribute("height","18"),O.setAttribute("border","0"),O.style.marginBottom="5px",G.appendChild(O),G.style.verticalAlign="bottom",G.style.paddingTop="4px",G.style.minWidth="46px",G.className="geBtn",A.appendChild(G));G=mxUtils.button(mxResources.get("close"),function(){b.hideDialog()});+G.className="geBtn";A.appendChild(G);O=mxUtils.button(mxResources.get("copy"),function(){c.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?c.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");b.alert(mxResources.get("copiedToClipboard"))});l.length<J?mxClient.IS_SF||null!=document.documentMode?G.className="geBtn gePrimaryBtn":(A.appendChild(O),O.className="geBtn gePrimaryBtn"):null!=y&&(A.appendChild(y),y.className="geBtn gePrimaryBtn");g.appendChild(A);this.container=g};EmbedDialog.showPreviewOption=!0;EmbedDialog.maxSize=5E5;-var BackgroundImageDialog=function(b,l,p,g,x){function B(){if(null==N||N==mxConstants.NONE)S.style.display="none",J.checked=!1;else{var T=mxUtils.getLightDarkColor(N);mxUtils.isLightDarkColor(N)&&T.light!=T.dark?S.style.background="linear-gradient(to right bottom, "+T.cssText+" 50%, "+mxUtils.invertLightDarkColor(T).cssText+" 50.3%)":(S.style.background="",S.style.backgroundColor=T.cssText);S.style.display="";J.checked=!0}}var z=document.createElement("div"),F=document.createElement("h3");mxUtils.write(F,-mxResources.get("background"));z.appendChild(F);var K=null!=p&&null!=p.originalSrc;F=!1;var M=document.createElement("input");M.setAttribute("value","url");M.setAttribute("type","radio");M.setAttribute("name","geBackgroundImageDialogOption");var L=document.createElement("input");L.setAttribute("value","url");L.setAttribute("type","radio");L.setAttribute("name","geBackgroundImageDialogOption");var Q=document.createElement("input");Q.setAttribute("type","text");Q.style.flex="1";Q.style.minWidth="0";-Q.value=K||null==p?"":p.src;var c=document.createElement("select");c.style.flex="1";c.style.minWidth="0";c.style.marginLeft="0";if(null!=b.pages)for(var f=0;f<b.pages.length;f++){var k=document.createElement("option");mxUtils.write(k,b.pages[f].getName()||mxResources.get("pageWithNumber",[f+1]));k.setAttribute("value","data:page/id,"+b.pages[f].getId());b.pages[f]==b.currentPage&&k.setAttribute("disabled","disabled");null!=p&&p.originalSrc==k.getAttribute("value")&&(k.setAttribute("selected","selected"),-F=!0);c.appendChild(k)}K||null!=b.pages&&1!=b.pages.length||(M.style.display="none",L.style.display="none",c.style.display="none");var n=document.createElement("option"),q=!1,t=!1,u=function(T,v){q||null!=T&&t||(L.checked?null!=v&&v(n.selected?null:c.value):""==Q.value||b.isOffline()?(C.value="",U.value="",null!=v&&v("")):(Q.value=mxUtils.trim(Q.value),b.loadImage(Q.value,function(d){C.value=d.width;U.value=d.height;null!=v&&v(Q.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),-mxResources.get("ok"));C.value="";U.value="";null!=v&&v(null)})))},y=mxUtils.bind(this,function(T){b.importFiles(T,0,0,b.maxBackgroundSize,function(v,d,m,r,A,D){Q.value=v;u();Q.focus()},function(){},function(v){return"image/"==v.type.substring(0,6)},function(v){for(var d=0;d<v.length;d++)v[d]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){K?c.focus():Q.focus();mxEvent.addListener(c,"focus",function(){M.removeAttribute("checked");L.setAttribute("checked","checked");L.checked=-!0});mxEvent.addListener(Q,"focus",function(){L.removeAttribute("checked");M.setAttribute("checked","checked");M.checked=!0});if(Graph.fileSupport){Q.setAttribute("placeholder",mxResources.get("dragImagesHere"));var T=z.parentNode,v=null;mxEvent.addListener(T,"dragleave",function(d){null!=v&&(v.parentNode.removeChild(v),v=null);d.stopPropagation();d.preventDefault()});mxEvent.addListener(T,"dragover",mxUtils.bind(this,function(d){null==v&&(v=b.highlightElement(T));d.stopPropagation();d.preventDefault()}));-mxEvent.addListener(T,"drop",mxUtils.bind(this,function(d){null!=v&&(v.parentNode.removeChild(v),v=null);if(0<d.dataTransfer.files.length)y(d.dataTransfer.files);else if(0<=mxUtils.indexOf(d.dataTransfer.types,"text/uri-list")){var m=d.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(m)&&(Q.value=decodeURIComponent(m),u())}d.stopPropagation();d.preventDefault()}),!1)}};f=document.createElement("div");f.className="geDialogSection";k=document.createElement("div");k.className=-"geDialogCheckRow";k.appendChild(M);k.appendChild(Q);f.appendChild(k);k=document.createElement("div");k.className="geDialogInlineFields";k.style.marginTop="6px";k.style.paddingLeft="24px";var E=document.createElement("div");E.className="geDialogInlineField";var I=document.createElement("label");mxUtils.write(I,mxResources.get("width"));E.appendChild(I);var C=document.createElement("input");C.setAttribute("type","text");C.value=null==p||K?"":p.width;E.appendChild(C);k.appendChild(E);E=document.createElement("div");-E.className="geDialogInlineField";I=document.createElement("label");mxUtils.write(I,mxResources.get("height"));E.appendChild(I);var U=document.createElement("input");U.setAttribute("type","text");U.value=null==p||K?"":p.height;E.appendChild(U);k.appendChild(E);f.appendChild(k);mxEvent.addListener(Q,"change",u);ImageDialog.filePicked=function(T){T.action==google.picker.Action.PICKED&&null!=T.docs[0].thumbnails&&(T=T.docs[0].thumbnails[T.docs[0].thumbnails.length-1],null!=T&&(Q.value=T.url,u()));Q.focus()};-p=document.createElement("div");p.className="geDialogCheckRow";p.style.marginTop="6px";p.appendChild(L);p.appendChild(c);f.appendChild(p);z.appendChild(f);K?(L.setAttribute("checked","checked"),L.checked=!0):(M.setAttribute("checked","checked"),M.checked=!0);!F&&L.checked&&(mxUtils.write(n,mxResources.get("pageNotFound")),n.setAttribute("disabled","disabled"),n.setAttribute("selected","selected"),n.setAttribute("value","pageNotFound"),c.appendChild(n),mxEvent.addListener(c,"change",function(){null==-n.parentNode||n.selected||n.parentNode.removeChild(n)}));p=document.createElement("div");p.className="geDialogSection";p.style.display=x?"":"none";x=document.createElement("div");x.className="geDialogCheckRow";x.style.cursor="default";var J=document.createElement("input");J.setAttribute("type","checkbox");J.defaultChecked=g!=mxConstants.NONE&&null!=g;J.checked=J.defaultChecked;x.appendChild(J);F=document.createElement("label");mxUtils.write(F,mxResources.get("fillColor"));x.appendChild(F);var S=document.createElement("button");-S.style.width="36px";S.style.height="18px";S.style.cursor="pointer";S.style.marginLeft="10px";S.style.backgroundPosition="center center";S.style.backgroundRepeat="no-repeat";S.className="geColorBtn";var N=g;B();mxEvent.addListener(x,"click",function(T){mxEvent.getSource(T)!=J&&(J.checked=!J.checked);N=J.checked?b.editor.graph.defaultPageBackgroundColor:null;B()});mxEvent.addListener(S,"click",function(T){b.pickColor(N||"none",function(v){N=v;B()});mxEvent.consume(T)});x.appendChild(S);p.appendChild(x);-z.appendChild(p);g=document.createElement("div");g.style.marginTop="34px";g.style.textAlign="right";x=mxUtils.button(mxResources.get("cancel"),function(){q=!0;b.hideDialog()});x.className="geBtn";b.editor.cancelFirst&&g.appendChild(x);p=mxUtils.button(mxResources.get("reset"),function(){Q.value="";C.value="";U.value="";M.checked=!0;N=mxConstants.NONE;B();q=!1});mxEvent.addGestureListeners(p,function(){q=!0});p.className="geBtn";g.appendChild(p);if(Graph.fileSupport){var R=document.createElement("input");-R.setAttribute("multiple","multiple");R.setAttribute("type","file");mxEvent.addListener(R,"change",function(T){null!=R.files&&(y(R.files),R.type="",R.type="file",R.value="")});R.style.display="none";z.appendChild(R);p=mxUtils.button(mxResources.get("open"),function(){R.click()});p.className="geBtn";g.appendChild(p)}applyBtn=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();u(null,function(T){l(""!=T&&null!=T?new mxImage(T,C.value,U.value):null,null==T,N)})});mxEvent.addGestureListeners(applyBtn,-function(){t=!0});applyBtn.className="geBtn gePrimaryBtn";g.appendChild(applyBtn);b.editor.cancelFirst||g.appendChild(x);z.appendChild(g);this.container=z},ParseDialog=function(b,l,p){function g(f,k,n){if("plantUmlDiagram"==k||"plantUmlImage"==k){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var q=mxUtils.bind(this,function(T){b.spinner.stop();b.hideDialog();var v=b.editor.graph;v.getModel().beginUpdate();try{var d=b.importXml(T,Math.max(B.x,20),Math.max(B.y,20),!0,null,null,!0);+var BackgroundImageDialog=function(b,l,p,g,x){function A(){if(null==M||M==mxConstants.NONE)S.style.display="none",K.checked=!1;else{var T=mxUtils.getLightDarkColor(M);mxUtils.isLightDarkColor(M)&&T.light!=T.dark?S.style.background="linear-gradient(to right bottom, "+T.cssText+" 50%, "+mxUtils.invertLightDarkColor(T).cssText+" 50.3%)":(S.style.background="",S.style.backgroundColor=T.cssText);S.style.display="";K.checked=!0}}var y=document.createElement("div"),G=document.createElement("h3");mxUtils.write(G,+mxResources.get("background"));y.appendChild(G);var L=null!=p&&null!=p.originalSrc;G=!1;var O=document.createElement("input");O.setAttribute("value","url");O.setAttribute("type","radio");O.setAttribute("name","geBackgroundImageDialogOption");var J=document.createElement("input");J.setAttribute("value","url");J.setAttribute("type","radio");J.setAttribute("name","geBackgroundImageDialogOption");var Q=document.createElement("input");Q.setAttribute("type","text");Q.style.flex="1";Q.style.minWidth="0";+Q.value=L||null==p?"":p.src;var c=document.createElement("select");c.style.flex="1";c.style.minWidth="0";c.style.marginLeft="0";if(null!=b.pages)for(var f=0;f<b.pages.length;f++){var k=document.createElement("option");mxUtils.write(k,b.pages[f].getName()||mxResources.get("pageWithNumber",[f+1]));k.setAttribute("value","data:page/id,"+b.pages[f].getId());b.pages[f]==b.currentPage&&k.setAttribute("disabled","disabled");null!=p&&p.originalSrc==k.getAttribute("value")&&(k.setAttribute("selected","selected"),+G=!0);c.appendChild(k)}L||null!=b.pages&&1!=b.pages.length||(O.style.display="none",J.style.display="none",c.style.display="none");var n=document.createElement("option"),q=!1,t=!1,u=function(T,v){q||null!=T&&t||(J.checked?null!=v&&v(n.selected?null:c.value):""==Q.value||b.isOffline()?(C.value="",U.value="",null!=v&&v("")):(Q.value=mxUtils.trim(Q.value),b.loadImage(Q.value,function(d){C.value=d.width;U.value=d.height;null!=v&&v(Q.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),+mxResources.get("ok"));C.value="";U.value="";null!=v&&v(null)})))},B=mxUtils.bind(this,function(T){b.importFiles(T,0,0,b.maxBackgroundSize,function(v,d,m,r,z,D){Q.value=v;u();Q.focus()},function(){},function(v){return"image/"==v.type.substring(0,6)},function(v){for(var d=0;d<v.length;d++)v[d]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){L?c.focus():Q.focus();mxEvent.addListener(c,"focus",function(){O.removeAttribute("checked");J.setAttribute("checked","checked");J.checked=+!0});mxEvent.addListener(Q,"focus",function(){J.removeAttribute("checked");O.setAttribute("checked","checked");O.checked=!0});if(Graph.fileSupport){Q.setAttribute("placeholder",mxResources.get("dragImagesHere"));var T=y.parentNode,v=null;mxEvent.addListener(T,"dragleave",function(d){null!=v&&(v.parentNode.removeChild(v),v=null);d.stopPropagation();d.preventDefault()});mxEvent.addListener(T,"dragover",mxUtils.bind(this,function(d){null==v&&(v=b.highlightElement(T));d.stopPropagation();d.preventDefault()}));+mxEvent.addListener(T,"drop",mxUtils.bind(this,function(d){null!=v&&(v.parentNode.removeChild(v),v=null);if(0<d.dataTransfer.files.length)B(d.dataTransfer.files);else if(0<=mxUtils.indexOf(d.dataTransfer.types,"text/uri-list")){var m=d.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(m)&&(Q.value=decodeURIComponent(m),u())}d.stopPropagation();d.preventDefault()}),!1)}};f=document.createElement("div");f.className="geDialogSection";k=document.createElement("div");k.className=+"geDialogCheckRow";k.appendChild(O);k.appendChild(Q);f.appendChild(k);k=document.createElement("div");k.className="geDialogInlineFields";k.style.marginTop="6px";k.style.paddingLeft="24px";var E=document.createElement("div");E.className="geDialogInlineField";var I=document.createElement("label");mxUtils.write(I,mxResources.get("width"));E.appendChild(I);var C=document.createElement("input");C.setAttribute("type","text");C.value=null==p||L?"":p.width;E.appendChild(C);k.appendChild(E);E=document.createElement("div");+E.className="geDialogInlineField";I=document.createElement("label");mxUtils.write(I,mxResources.get("height"));E.appendChild(I);var U=document.createElement("input");U.setAttribute("type","text");U.value=null==p||L?"":p.height;E.appendChild(U);k.appendChild(E);f.appendChild(k);mxEvent.addListener(Q,"change",u);ImageDialog.filePicked=function(T){T.action==google.picker.Action.PICKED&&null!=T.docs[0].thumbnails&&(T=T.docs[0].thumbnails[T.docs[0].thumbnails.length-1],null!=T&&(Q.value=T.url,u()));Q.focus()};+p=document.createElement("div");p.className="geDialogCheckRow";p.style.marginTop="6px";p.appendChild(J);p.appendChild(c);f.appendChild(p);y.appendChild(f);L?(J.setAttribute("checked","checked"),J.checked=!0):(O.setAttribute("checked","checked"),O.checked=!0);!G&&J.checked&&(mxUtils.write(n,mxResources.get("pageNotFound")),n.setAttribute("disabled","disabled"),n.setAttribute("selected","selected"),n.setAttribute("value","pageNotFound"),c.appendChild(n),mxEvent.addListener(c,"change",function(){null==+n.parentNode||n.selected||n.parentNode.removeChild(n)}));p=document.createElement("div");p.className="geDialogSection";p.style.display=x?"":"none";x=document.createElement("div");x.className="geDialogCheckRow";x.style.cursor="default";var K=document.createElement("input");K.setAttribute("type","checkbox");K.defaultChecked=g!=mxConstants.NONE&&null!=g;K.checked=K.defaultChecked;x.appendChild(K);G=document.createElement("label");mxUtils.write(G,mxResources.get("fillColor"));x.appendChild(G);var S=document.createElement("button");+S.style.width="36px";S.style.height="18px";S.style.cursor="pointer";S.style.marginLeft="10px";S.style.backgroundPosition="center center";S.style.backgroundRepeat="no-repeat";S.className="geColorBtn";var M=g;A();mxEvent.addListener(x,"click",function(T){mxEvent.getSource(T)!=K&&(K.checked=!K.checked);M=K.checked?b.editor.graph.defaultPageBackgroundColor:null;A()});mxEvent.addListener(S,"click",function(T){b.pickColor(M||"none",function(v){M=v;A()});mxEvent.consume(T)});x.appendChild(S);p.appendChild(x);+y.appendChild(p);g=document.createElement("div");g.style.marginTop="34px";g.style.textAlign="right";x=mxUtils.button(mxResources.get("cancel"),function(){q=!0;b.hideDialog()});x.className="geBtn";b.editor.cancelFirst&&g.appendChild(x);p=mxUtils.button(mxResources.get("reset"),function(){Q.value="";C.value="";U.value="";O.checked=!0;M=mxConstants.NONE;A();q=!1});mxEvent.addGestureListeners(p,function(){q=!0});p.className="geBtn";g.appendChild(p);if(Graph.fileSupport){var R=document.createElement("input");+R.setAttribute("multiple","multiple");R.setAttribute("type","file");mxEvent.addListener(R,"change",function(T){null!=R.files&&(B(R.files),R.type="",R.type="file",R.value="")});R.style.display="none";y.appendChild(R);p=mxUtils.button(mxResources.get("open"),function(){R.click()});p.className="geBtn";g.appendChild(p)}applyBtn=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();u(null,function(T){l(""!=T&&null!=T?new mxImage(T,C.value,U.value):null,null==T,M)})});mxEvent.addGestureListeners(applyBtn,+function(){t=!0});applyBtn.className="geBtn gePrimaryBtn";g.appendChild(applyBtn);b.editor.cancelFirst||g.appendChild(x);y.appendChild(g);this.container=y},ParseDialog=function(b,l,p){function g(f,k,n){if("plantUmlDiagram"==k||"plantUmlImage"==k){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var q=mxUtils.bind(this,function(T){b.spinner.stop();b.hideDialog();var v=b.editor.graph;v.getModel().beginUpdate();try{var d=b.importXml(T,Math.max(A.x,20),Math.max(A.y,20),!0,null,null,!0);v.setSelectionCells(d)}finally{v.getModel().endUpdate()}v.scrollCellToVisible(v.getSelectionCell())});n=mxUtils.bind(this,function(T){b.spinner.stop();b.handleError(T)});"plantUmlImage"==k?b.parsePlantUmlImage(f,q,n):b.parsePlantUmlDiagram(f,null,mxUtils.bind(this,function(T){q(mxPlantUmlToDrawio.wrapGroup(T,f,null))}),n)}}else if("mermaid"==k||"mermaidImage"==k){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var t=mxUtils.bind(this,function(T){b.spinner.stop();b.hideDialog();var v=-b.editor.graph;v.getModel().beginUpdate();try{var d=b.importXml(T,Math.max(B.x,20),Math.max(B.y,20),!0,null,null,!0);v.setSelectionCells(d)}finally{v.getModel().endUpdate()}v.scrollCellToVisible(v.getSelectionCell())});n=mxUtils.bind(this,function(T){b.spinner.stop();b.handleError(T)});"mermaidImage"==k?b.parseMermaidImage(f,t,n):b.parseMermaidDiagram(f,null,mxUtils.bind(this,function(T){t(mxMermaidToDrawio.wrapGroup(T,f,null))}),n)}}else if("table"==k){var u=f.split("\n");k=null;var y=[],E=0,I={};+b.editor.graph;v.getModel().beginUpdate();try{var d=b.importXml(T,Math.max(A.x,20),Math.max(A.y,20),!0,null,null,!0);v.setSelectionCells(d)}finally{v.getModel().endUpdate()}v.scrollCellToVisible(v.getSelectionCell())});n=mxUtils.bind(this,function(T){b.spinner.stop();b.handleError(T)});"mermaidImage"==k?b.parseMermaidImage(f,t,n):b.parseMermaidDiagram(f,null,mxUtils.bind(this,function(T){t(mxMermaidToDrawio.wrapGroup(T,f,null))}),n)}}else if("table"==k){var u=f.split("\n");k=null;var B=[],E=0,I={};for(n=0;n<u.length;n++){var C=mxUtils.trim(u[n]);if("primary key"==C.substring(0,11).toLowerCase()){var U=C.match(/\((.+)\)/);U&&U[1]&&(I[U[1]]=!0);u.splice(n,1)}else 0<C.toLowerCase().indexOf("primary key")&&(I[C.split(" ")[0]]=!0,u[n]=mxUtils.trim(C.replace(/primary key/i,"")))}for(n=0;n<u.length;n++)if(C=mxUtils.trim(u[n]),"create table"==C.substring(0,12).toLowerCase())C=mxUtils.trim(C.substring(12)),"("==C.charAt(C.length-1)&&(C=mxUtils.trim(C.substring(0,C.length-1))),k=new mxCell(C,new mxGeometry(E,-0,160,30),"shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;"),k.vertex=!0,y.push(k),C=b.editor.graph.getPreferredSizeForCell(J),null!=C&&(k.geometry.width=C.width+10);else if(null!=k&&")"==C.charAt(0))E+=k.geometry.width+40,k=null;else if("("!=C&&null!=k){C=C.substring(0,","==C.charAt(C.length-1)?C.length-1:C.length);U=I[C.split(" ")[0]];var J=new mxCell("",new mxGeometry(0,0,160,30),"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;strokeColor=inherit;top=0;left=0;right=0;bottom="+-(U?"1":"0")+";");J.vertex=!0;var S=new mxCell(U?"PK":"",new mxGeometry(0,0,30,30),"shape=partialRectangle;overflow=hidden;connectable=0;fillColor=none;strokeColor=inherit;top=0;left=0;bottom=0;right=0;"+(U?"fontStyle=1;":""));S.vertex=!0;J.insert(S);C=new mxCell(C,new mxGeometry(30,0,130,30),"shape=partialRectangle;overflow=hidden;connectable=0;fillColor=none;align=left;strokeColor=inherit;top=0;left=0;bottom=0;right=0;spacingLeft=6;"+(U?"fontStyle=5;":""));C.vertex=!0;J.insert(C);C=b.editor.graph.getPreferredSizeForCell(C);-null!=C&&k.geometry.width<C.width+30&&(k.geometry.width=Math.min(320,Math.max(k.geometry.width,C.width+30)));k.insert(J,U?0:null);k.geometry.height+=30}0<y.length&&(J=b.editor.graph,J.setSelectionCells(J.importCells(y,B.x,B.y)),J.scrollCellToVisible(J.getSelectionCell()))}else if("list"==k){if(u=f.split("\n"),0<u.length){J=b.editor.graph;k=null;y=[];for(n=E=0;n<u.length;n++)";"!=u[n].charAt(0)&&(0==u[n].length?k=null:null==k?(k=new mxCell(u[n],new mxGeometry(E,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"),-k.vertex=!0,y.push(k),C=J.getPreferredSizeForCell(k),null!=C&&k.geometry.width<C.width+10&&(k.geometry.width=C.width+10),E+=k.geometry.width+40):"--"==u[n]?(C=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),C.vertex=!0,k.geometry.height+=C.geometry.height,k.insert(C)):0<u[n].length&&(I=new mxCell(u[n],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),-I.vertex=!0,C=J.getPreferredSizeForCell(I),null!=C&&I.geometry.width<C.width&&(I.geometry.width=C.width),k.geometry.width=Math.max(k.geometry.width,I.geometry.width),k.geometry.height+=I.geometry.height,k.insert(I)));if(0<y.length){J.getModel().beginUpdate();try{y=J.importCells(y,B.x,B.y);C=[];for(n=0;n<y.length;n++)C.push(y[n]),C=C.concat(y[n].children);J.fireEvent(new mxEventObject("cellsInserted","cells",C))}finally{J.getModel().endUpdate()}J.setSelectionCells(y);J.scrollCellToVisible(J.getSelectionCell())}}}else{J=-function(T){var v=N[T];null==v&&(v=new mxCell(T,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),v.vertex=!0,N[T]=v,y.push(v));return v};u=f.split("\n");var N={};y=[];for(n=0;n<u.length;n++)if(";"!=u[n].charAt(0)){var R=u[n].split("->");2<=R.length&&(U=J(R[0]),S=J(R[R.length-1]),R=new mxCell(2<R.length?R[1]:"",new mxGeometry),R.edge=!0,R.geometry.relative=!0,U.insertEdge(R,!0),S.insertEdge(R,!1),y.push(R))}if(0<y.length){u=document.createElement("div");u.style.visibility="hidden";document.body.appendChild(u);-J=new Graph(u);J.getModel().beginUpdate();try{y=J.importCells(y);for(n=0;n<y.length;n++)J.getModel().isVertex(y[n])&&(C=J.getPreferredSizeForCell(y[n]),y[n].geometry.width=Math.max(y[n].geometry.width,C.width),y[n].geometry.height=Math.max(y[n].geometry.height,C.height));n=!0;"horizontalFlow"==k||"verticalFlow"==k?((new mxHierarchicalLayout(J,"horizontalFlow"==k?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH)).execute(J.getDefaultParent(),y),n=!1):"circle"==k?(new mxCircleLayout(J)).execute(J.getDefaultParent()):-(E=new mxFastOrganicLayout(J),E.disableEdgeStyle=!1,E.forceConstant=180,E.execute(J.getDefaultParent()));n&&(I=new mxParallelEdgeLayout(J),I.spacing=30,I.execute(J.getDefaultParent()))}finally{J.getModel().endUpdate()}J.clearCellOverlays();C=[];b.editor.graph.getModel().beginUpdate();try{y=J.getModel().getChildren(J.getDefaultParent()),C=b.editor.graph.importCells(y,B.x,B.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",C))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(C);-b.editor.graph.scrollCellToVisible(b.editor.graph.getSelectionCell());J.destroy();u.parentNode.removeChild(u)}}}function x(){return"list"==M.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String":"mermaid"==M.value||"mermaidImage"==M.value?"graph TD;\n A--\x3eB;\n A--\x3eC;\n B--\x3eD;\n C--\x3eD;":"table"==M.value?"CREATE TABLE Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\n":-"plantUmlDiagram"==M.value||"plantUmlImage"==M.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":";Example:\na->b\nb->edge label->c\nc->a\n"}var B=b.editor.graph.getFreeInsertPoint(),z=document.createElement("div");z.style.display="flex";z.style.flexDirection="column";z.style.height="100%";z.style.boxSizing="border-box";-z.style.overflow="visible";var F=document.createElement("h3");mxUtils.write(F,l||mxResources.get("insert"));z.appendChild(F);var K=document.createElement("textarea");K.style.flex="1";K.style.minHeight="0";K.style.width="100%";K.style.boxSizing="border-box";K.style.resize="none";K.setAttribute("wrap","off");K.setAttribute("spellcheck","false");K.setAttribute("autocorrect","off");K.setAttribute("autocomplete","off");K.setAttribute("autocapitalize","off");var M=document.createElement("select");M.className=-"geBtn";if("formatSql"==p||("mermaid"==p||"plantUml"==p)&&"draw.io"!=b.getServiceName()&&"atlassian"!=b.getServiceName())M.style.display="none";l=document.createElement("option");l.setAttribute("value","list");mxUtils.write(l,mxResources.get("list"));"plantUml"!=p&&"mermaid"!=p&&M.appendChild(l);null!=p&&"fromText"!=p||l.setAttribute("selected","selected");l=document.createElement("option");l.setAttribute("value","table");mxUtils.write(l,mxResources.get("formatSql"));"formatSql"==p&&(M.appendChild(l),-l.setAttribute("selected","selected"));"mermaid"==p&&(l=document.createElement("option"),l.setAttribute("value","mermaid"),l.setAttribute("selected","selected"),mxUtils.write(l,mxResources.get("diagram")),M.appendChild(l),l=document.createElement("option"),l.setAttribute("value","mermaidImage"),mxUtils.write(l,mxResources.get("image")),M.appendChild(l));l=document.createElement("option");l.setAttribute("value","diagram");mxUtils.write(l,mxResources.get("diagram"));F=document.createElement("option");-F.setAttribute("value","circle");mxUtils.write(F,mxResources.get("circle"));var L=document.createElement("option");L.setAttribute("value","horizontalFlow");mxUtils.write(L,mxResources.get("horizontalFlow"));var Q=document.createElement("option");Q.setAttribute("value","verticalFlow");mxUtils.write(Q,mxResources.get("verticalFlow"));"plantUml"!=p&&"mermaid"!=p&&(M.appendChild(l),M.appendChild(F),M.appendChild(L),M.appendChild(Q));"plantUml"==p&&(l=document.createElement("option"),l.setAttribute("value",-"plantUmlDiagram"),l.setAttribute("selected","selected"),mxUtils.write(l,mxResources.get("diagram")),M.appendChild(l),l=document.createElement("option"),l.setAttribute("value","plantUmlImage"),mxUtils.write(l,mxResources.get("image")),M.appendChild(l));var c=x();K.value=c;z.appendChild(K);l=document.createElement("div");l.style.display="flex";l.style.justifyContent="end";l.style.alignItems="center";l.style.marginTop="14px";l.style.flexShrink="0";this.init=function(){K.focus()};Graph.fileSupport&&-(K.addEventListener("dragover",function(f){f.stopPropagation();f.preventDefault()},!1),K.addEventListener("drop",function(f){f.stopPropagation();f.preventDefault();if(0<f.dataTransfer.files.length){f=f.dataTransfer.files[0];var k=new FileReader;k.onload=function(n){K.value=n.target.result};k.readAsText(f)}},!1));"plantUml"==p&&(F=document.createElement("div"),F.style.display="inline-block",F.style.color="#c00",F.style.fontSize="12px",F.style.marginRight="10px",F.style.display="flex",F.style.alignItems=-"center",F.innerHTML='<a href="https://github.com/jgraph/drawio/issues" target="_blank" rel="noopener noreferrer">Report any PlantUML issues</a>',l.appendChild(F));b.isOffline()&&!mxClient.IS_CHROMEAPP||"mermaid"!=p&&"plantUml"!=p||l.appendChild(b.createHelpIcon("mermaid"==p?"https://www.drawio.com/docs/manual/mermaid/":"https://plantuml.com/"));l.appendChild(M);mxEvent.addListener(M,"change",function(){var f=x();if(0==K.value.length||K.value==c)c=f,K.value=c});p=mxUtils.button(mxResources.get("close"),-function(){K.value==c?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});p.className="geBtn";b.editor.cancelFirst&&l.appendChild(p);F=mxUtils.button(mxResources.get("insert"),function(f){try{"mermaid"!=M.value&&"mermaidImage"!=M.value&&"plantUmlDiagram"!=M.value&&"plantUmlImage"!=M.value&&b.hideDialog(),g(K.value,M.value,f)}catch(k){b.handleError(k)}});F.className="geBtn gePrimaryBtn";l.appendChild(F);b.editor.cancelFirst||l.appendChild(p);z.appendChild(l);this.container=-z},NewDialog=function(b,l,p,g,x,B,z,F,K,M,L,Q,c,f,k,n,q,t,u,y){function E(Da){null!=Da&&(Ja=Ra=Da?135:140);Da=!0;if(null!=Ua)for(;V<Ua.length&&(Da||0!=mxUtils.mod(V,30));){var Na=Ua[V++];Na=R(Na.url,Na.libs,Na.title,Na.tooltip?Na.tooltip:Na.title,Na.select,Na.imgUrl,Na.info,Na.onClick,Na.preview,Na.noImg,Na.clibs,Na.type);Da&&Na.click();Da=!1}}function I(Da,Na,Ka,Qa,La,Oa){if(null!=Da&&mxUtils.isAncestorNode(document.body,Qa)){Da=mxUtils.parseXml(Da);Da=Editor.parseDiagramNode(Da.documentElement,+0,160,30),"shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;"),k.vertex=!0,B.push(k),C=b.editor.graph.getPreferredSizeForCell(K),null!=C&&(k.geometry.width=C.width+10);else if(null!=k&&")"==C.charAt(0))E+=k.geometry.width+40,k=null;else if("("!=C&&null!=k){C=C.substring(0,","==C.charAt(C.length-1)?C.length-1:C.length);U=I[C.split(" ")[0]];var K=new mxCell("",new mxGeometry(0,0,160,30),"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;strokeColor=inherit;top=0;left=0;right=0;bottom="++(U?"1":"0")+";");K.vertex=!0;var S=new mxCell(U?"PK":"",new mxGeometry(0,0,30,30),"shape=partialRectangle;overflow=hidden;connectable=0;fillColor=none;strokeColor=inherit;top=0;left=0;bottom=0;right=0;"+(U?"fontStyle=1;":""));S.vertex=!0;K.insert(S);C=new mxCell(C,new mxGeometry(30,0,130,30),"shape=partialRectangle;overflow=hidden;connectable=0;fillColor=none;align=left;strokeColor=inherit;top=0;left=0;bottom=0;right=0;spacingLeft=6;"+(U?"fontStyle=5;":""));C.vertex=!0;K.insert(C);C=b.editor.graph.getPreferredSizeForCell(C);+null!=C&&k.geometry.width<C.width+30&&(k.geometry.width=Math.min(320,Math.max(k.geometry.width,C.width+30)));k.insert(K,U?0:null);k.geometry.height+=30}0<B.length&&(K=b.editor.graph,K.setSelectionCells(K.importCells(B,A.x,A.y)),K.scrollCellToVisible(K.getSelectionCell()))}else if("list"==k){if(u=f.split("\n"),0<u.length){K=b.editor.graph;k=null;B=[];for(n=E=0;n<u.length;n++)";"!=u[n].charAt(0)&&(0==u[n].length?k=null:null==k?(k=new mxCell(u[n],new mxGeometry(E,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"),+k.vertex=!0,B.push(k),C=K.getPreferredSizeForCell(k),null!=C&&k.geometry.width<C.width+10&&(k.geometry.width=C.width+10),E+=k.geometry.width+40):"--"==u[n]?(C=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),C.vertex=!0,k.geometry.height+=C.geometry.height,k.insert(C)):0<u[n].length&&(I=new mxCell(u[n],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),+I.vertex=!0,C=K.getPreferredSizeForCell(I),null!=C&&I.geometry.width<C.width&&(I.geometry.width=C.width),k.geometry.width=Math.max(k.geometry.width,I.geometry.width),k.geometry.height+=I.geometry.height,k.insert(I)));if(0<B.length){K.getModel().beginUpdate();try{B=K.importCells(B,A.x,A.y);C=[];for(n=0;n<B.length;n++)C.push(B[n]),C=C.concat(B[n].children);K.fireEvent(new mxEventObject("cellsInserted","cells",C))}finally{K.getModel().endUpdate()}K.setSelectionCells(B);K.scrollCellToVisible(K.getSelectionCell())}}}else{K=+function(T){var v=M[T];null==v&&(v=new mxCell(T,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),v.vertex=!0,M[T]=v,B.push(v));return v};u=f.split("\n");var M={};B=[];for(n=0;n<u.length;n++)if(";"!=u[n].charAt(0)){var R=u[n].split("->");2<=R.length&&(U=K(R[0]),S=K(R[R.length-1]),R=new mxCell(2<R.length?R[1]:"",new mxGeometry),R.edge=!0,R.geometry.relative=!0,U.insertEdge(R,!0),S.insertEdge(R,!1),B.push(R))}if(0<B.length){u=document.createElement("div");u.style.visibility="hidden";document.body.appendChild(u);+K=new Graph(u);K.getModel().beginUpdate();try{B=K.importCells(B);for(n=0;n<B.length;n++)K.getModel().isVertex(B[n])&&(C=K.getPreferredSizeForCell(B[n]),B[n].geometry.width=Math.max(B[n].geometry.width,C.width),B[n].geometry.height=Math.max(B[n].geometry.height,C.height));n=!0;"horizontalFlow"==k||"verticalFlow"==k?((new mxHierarchicalLayout(K,"horizontalFlow"==k?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH)).execute(K.getDefaultParent(),B),n=!1):"circle"==k?(new mxCircleLayout(K)).execute(K.getDefaultParent()):+(E=new mxFastOrganicLayout(K),E.disableEdgeStyle=!1,E.forceConstant=180,E.execute(K.getDefaultParent()));n&&(I=new mxParallelEdgeLayout(K),I.spacing=30,I.execute(K.getDefaultParent()))}finally{K.getModel().endUpdate()}K.clearCellOverlays();C=[];b.editor.graph.getModel().beginUpdate();try{B=K.getModel().getChildren(K.getDefaultParent()),C=b.editor.graph.importCells(B,A.x,A.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",C))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(C);+b.editor.graph.scrollCellToVisible(b.editor.graph.getSelectionCell());K.destroy();u.parentNode.removeChild(u)}}}function x(){return"list"==O.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String":"mermaid"==O.value||"mermaidImage"==O.value?"graph TD;\n A--\x3eB;\n A--\x3eC;\n B--\x3eD;\n C--\x3eD;":"table"==O.value?"CREATE TABLE Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\n":+"plantUmlDiagram"==O.value||"plantUmlImage"==O.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":";Example:\na->b\nb->edge label->c\nc->a\n"}var A=b.editor.graph.getFreeInsertPoint(),y=document.createElement("div");y.style.display="flex";y.style.flexDirection="column";y.style.height="100%";y.style.boxSizing="border-box";+y.style.overflow="visible";var G=document.createElement("h3");mxUtils.write(G,l||mxResources.get("insert"));y.appendChild(G);var L=document.createElement("textarea");L.style.flex="1";L.style.minHeight="0";L.style.width="100%";L.style.boxSizing="border-box";L.style.resize="none";L.setAttribute("wrap","off");L.setAttribute("spellcheck","false");L.setAttribute("autocorrect","off");L.setAttribute("autocomplete","off");L.setAttribute("autocapitalize","off");var O=document.createElement("select");O.className=+"geBtn";if("formatSql"==p||("mermaid"==p||"plantUml"==p)&&"draw.io"!=b.getServiceName()&&"atlassian"!=b.getServiceName())O.style.display="none";l=document.createElement("option");l.setAttribute("value","list");mxUtils.write(l,mxResources.get("list"));"plantUml"!=p&&"mermaid"!=p&&O.appendChild(l);null!=p&&"fromText"!=p||l.setAttribute("selected","selected");l=document.createElement("option");l.setAttribute("value","table");mxUtils.write(l,mxResources.get("formatSql"));"formatSql"==p&&(O.appendChild(l),+l.setAttribute("selected","selected"));"mermaid"==p&&(l=document.createElement("option"),l.setAttribute("value","mermaid"),l.setAttribute("selected","selected"),mxUtils.write(l,mxResources.get("diagram")),O.appendChild(l),l=document.createElement("option"),l.setAttribute("value","mermaidImage"),mxUtils.write(l,mxResources.get("image")),O.appendChild(l));l=document.createElement("option");l.setAttribute("value","diagram");mxUtils.write(l,mxResources.get("diagram"));G=document.createElement("option");+G.setAttribute("value","circle");mxUtils.write(G,mxResources.get("circle"));var J=document.createElement("option");J.setAttribute("value","horizontalFlow");mxUtils.write(J,mxResources.get("horizontalFlow"));var Q=document.createElement("option");Q.setAttribute("value","verticalFlow");mxUtils.write(Q,mxResources.get("verticalFlow"));"plantUml"!=p&&"mermaid"!=p&&(O.appendChild(l),O.appendChild(G),O.appendChild(J),O.appendChild(Q));"plantUml"==p&&(l=document.createElement("option"),l.setAttribute("value",+"plantUmlDiagram"),l.setAttribute("selected","selected"),mxUtils.write(l,mxResources.get("diagram")),O.appendChild(l),l=document.createElement("option"),l.setAttribute("value","plantUmlImage"),mxUtils.write(l,mxResources.get("image")),O.appendChild(l));var c=x();L.value=c;y.appendChild(L);l=document.createElement("div");l.style.display="flex";l.style.justifyContent="end";l.style.alignItems="center";l.style.marginTop="14px";l.style.flexShrink="0";this.init=function(){L.focus()};Graph.fileSupport&&+(L.addEventListener("dragover",function(f){f.stopPropagation();f.preventDefault()},!1),L.addEventListener("drop",function(f){f.stopPropagation();f.preventDefault();if(0<f.dataTransfer.files.length){f=f.dataTransfer.files[0];var k=new FileReader;k.onload=function(n){L.value=n.target.result};k.readAsText(f)}},!1));"plantUml"==p&&(G=document.createElement("div"),G.style.display="inline-block",G.style.color="#c00",G.style.fontSize="12px",G.style.marginRight="10px",G.style.display="flex",G.style.alignItems=+"center",G.innerHTML='<a href="https://github.com/jgraph/drawio/issues" target="_blank" rel="noopener noreferrer">Report any PlantUML issues</a>',l.appendChild(G));b.isOffline()&&!mxClient.IS_CHROMEAPP||"mermaid"!=p&&"plantUml"!=p||l.appendChild(b.createHelpIcon("mermaid"==p?"https://www.drawio.com/docs/manual/mermaid/":"https://plantuml.com/"));l.appendChild(O);mxEvent.addListener(O,"change",function(){var f=x();if(0==L.value.length||L.value==c)c=f,L.value=c});p=mxUtils.button(mxResources.get("close"),+function(){L.value==c?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});p.className="geBtn";b.editor.cancelFirst&&l.appendChild(p);G=mxUtils.button(mxResources.get("insert"),function(f){try{"mermaid"!=O.value&&"mermaidImage"!=O.value&&"plantUmlDiagram"!=O.value&&"plantUmlImage"!=O.value&&b.hideDialog(),g(L.value,O.value,f)}catch(k){b.handleError(k)}});G.className="geBtn gePrimaryBtn";l.appendChild(G);b.editor.cancelFirst||l.appendChild(p);y.appendChild(l);this.container=+y},NewDialog=function(b,l,p,g,x,A,y,G,L,O,J,Q,c,f,k,n,q,t,u,B){function E(Da){null!=Da&&(Ja=Ra=Da?135:140);Da=!0;if(null!=Ua)for(;V<Ua.length&&(Da||0!=mxUtils.mod(V,30));){var Na=Ua[V++];Na=R(Na.url,Na.libs,Na.title,Na.tooltip?Na.tooltip:Na.title,Na.select,Na.imgUrl,Na.info,Na.onClick,Na.preview,Na.noImg,Na.clibs,Na.type);Da&&Na.click();Da=!1}}function I(Da,Na,Ka,Qa,La,Oa){if(null!=Da&&mxUtils.isAncestorNode(document.body,Qa)){Da=mxUtils.parseXml(Da);Da=Editor.parseDiagramNode(Da.documentElement,null,!0);var $a=new mxCodec(Da.ownerDocument),cb=new mxGraphModel;$a.decode(Da,cb);b.sidebar.createTooltip(Qa,cb.root.children,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1E3),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,800),null!=La?mxResources.get(La):null,!0,new mxPoint(Na,Ka),!0,function(){ba=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;null!=Oa&&U(Qa,null,null,Oa,-infoObj,clibs)},!0,!1)}}function C(){if(oa==Va&&null==fa&&null!=wb&&null!=hb)g&&b.spinner.spin(document.body,mxResources.get("generate")+" '"+hb.value+"'")&&(d=!0,b.hideDialog()),wb.click();else if(d&&b.spinner.stop(),pa&&null!=f)p||d||b.hideDialog(),f(pa,za,G.value);else if(g)p||d||b.hideDialog(),g(fa,G.value,wa,Fa);else{var Da=G.value;if(null!=Da&&0<Da.length){var Na=function(Qa,La,Oa){b.createFile(Oa,fa,null!=Fa&&0<Fa.length?Fa:null,Qa,function(){d||b.hideDialog()},null,La,null,null!=ca&&0<ca.length?+infoObj,clibs)},!0,!1)}}function C(){if(oa==Va&&null==fa&&null!=wb&&null!=hb)g&&b.spinner.spin(document.body,mxResources.get("generate")+" '"+hb.value+"'")&&(d=!0,b.hideDialog()),wb.click();else if(d&&b.spinner.stop(),pa&&null!=f)p||d||b.hideDialog(),f(pa,za,F.value);else if(g)p||d||b.hideDialog(),g(fa,F.value,wa,Fa);else{var Da=F.value;if(null!=Da&&0<Da.length){var Na=function(Qa,La,Oa){b.createFile(Oa,fa,null!=Fa&&0<Fa.length?Fa:null,Qa,function(){d||b.hideDialog()},null,La,null,null!=ca&&0<ca.length?ca:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var Ka=new SaveDialog(b,Da,mxUtils.bind(this,function(Qa,La,Oa){Na(La,Oa,Qa.value)}),null,null,null,null,b.mode);b.showDialog(Ka.container,420,162,!0,!1);Ka.init()}else b.pickFolder(b.mode,function(Qa){Na(b.mode,Qa,Da)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}}function U(Da,Na,Ka,Qa,La,Oa,$a){return oa!=Da?(null!=oa&&(oa.classList.remove("geTemplateSelected"),oa==Va&&(ab.style.display="none",pb.style.display=-"",eb.style.visibility="hidden",Pa.style.visibility=null!=ia?"visible":"hidden")),Da==Va&&(Na=ia,null!=Na?(Pa.style.visibility="visible",Pa.style.visibility=null!=ia?"visible":"hidden",eb.style.visibility="visible"):(ab.style.display="",eb.style.visibility="hidden",Pa.style.visibility="hidden")),H.removeAttribute("disabled"),fa=Na,Fa=Ka,ca=Oa,oa=Da,pa=Qa,wa=$a,za=La,oa.classList.add("geTemplateSelected"),!0):!1}function J(){ab.style.display="";pb.style.display="none";eb.style.visibility="hidden";-Pa.style.visibility="hidden";hb.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?hb.select():document.execCommand("selectAll",!1,null)}function S(){pb.style.backgroundImage=bb;pb.style.backgroundSize="contain";ab.style.display="none";pb.style.display="";eb.style.visibility="visible";Pa.style.visibility="visible"}function N(Da){if(!lb){lb=!0;var Na=mxUtils.trim(hb.value);Da||""==Na?null!=ka&&(hb.value=ka,S()):(pb.style.backgroundImage="url("+Editor.spinImage+")",pb.style.backgroundSize=+"",eb.style.visibility="hidden",Pa.style.visibility=null!=ia?"visible":"hidden")),Da==Va&&(Na=ia,null!=Na?(Pa.style.visibility="visible",Pa.style.visibility=null!=ia?"visible":"hidden",eb.style.visibility="visible"):(ab.style.display="",eb.style.visibility="hidden",Pa.style.visibility="hidden")),H.removeAttribute("disabled"),fa=Na,Fa=Ka,ca=Oa,oa=Da,pa=Qa,wa=$a,za=La,oa.classList.add("geTemplateSelected"),!0):!1}function K(){ab.style.display="";pb.style.display="none";eb.style.visibility="hidden";+Pa.style.visibility="hidden";hb.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?hb.select():document.execCommand("selectAll",!1,null)}function S(){pb.style.backgroundImage=bb;pb.style.backgroundSize="contain";ab.style.display="none";pb.style.display="";eb.style.visibility="visible";Pa.style.visibility="visible"}function M(Da){if(!lb){lb=!0;var Na=mxUtils.trim(hb.value);Da||""==Na?null!=ka&&(hb.value=ka,S()):(pb.style.backgroundImage="url("+Editor.spinImage+")",pb.style.backgroundSize="12px 12px",pb.style.display="",ab.style.display="none",b.generateOpenAiMermaidDiagram(Na,function(Ka){lb=!1;oa==Va&&"none"==ab.style.display&&(bb="url("+Editor.createSvgDataUri(mxUtils.getXml(b.getSvgForXml(Ka)))+")",Va.setAttribute("title",Na),Pa.style.display="",ia=fa=Ka,ka=Na,S(),d&&C())},mxUtils.bind(this,function(Ka){lb=!1;oa==Va&&(ab.style.display="",pb.style.display="none",eb.style.visibility="hidden",Pa.style.visibility="hidden",b.handleError(Ka))})))}}function R(Da,Na,Ka,Qa,La,Oa,$a,cb,-gb,zb,ib,Eb){function fb(ma,ya){null==Jb?(Gb=ma,Gb=/^https?:\/\//.test(Gb)?b.editor.isCorsEnabledForUrl(Gb)?Gb:PROXY_URL+"?url="+encodeURIComponent(Gb):TEMPLATE_PATH+"/"+Gb,mxUtils.get(Gb,mxUtils.bind(this,function(Ga){200<=Ga.getStatus()&&299>=Ga.getStatus()&&(Jb=Ga.getText());ya(Jb,Gb)}))):ya(Jb,Gb)}function xb(ma,ya){if(null==Da||Z||b.sidebar.currentElt==Xa)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=X){var Ga="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='+-X.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+X.naturalWidth+'" height="'+X.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+"</diagram></mxfile>";I(Ga,mxEvent.getClientX(ma),mxEvent.getClientY(ma),Ka,Da)}else b.sidebar.currentElt=Xa,Z=!0,fb(Da,function(Ia){if(Z&&b.sidebar.currentElt==Xa)try{I(Ia,mxEvent.getClientX(ma),mxEvent.getClientY(ma),Xa,ya)}catch(Sa){b.sidebar.currentElt=null,b.handleError(Sa)}Z=!1})}var Xa=null;if("generative"!=Eb||null==Va){Xa=document.createElement("div");+gb,zb,ib,Eb){function fb(ma,ya){null==Jb?(Gb=ma,Gb=/^https?:\/\//.test(Gb)?b.editor.isCorsEnabledForUrl(Gb)?Gb:PROXY_URL+"?url="+encodeURIComponent(Gb):TEMPLATE_PATH+"/"+Gb,mxUtils.get(Gb,mxUtils.bind(this,function(Ga){200<=Ga.getStatus()&&299>=Ga.getStatus()&&(Jb=Ga.getText());ya(Jb,Gb)}))):ya(Jb,Gb)}function xb(ma,ya){if(null==Da||Z||b.sidebar.currentElt==Xa)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=Y){var Ga="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='++Y.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+Y.naturalWidth+'" height="'+Y.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+"</diagram></mxfile>";I(Ga,mxEvent.getClientX(ma),mxEvent.getClientY(ma),Ka,Da)}else b.sidebar.currentElt=Xa,Z=!0,fb(Da,function(Ia){if(Z&&b.sidebar.currentElt==Xa)try{I(Ia,mxEvent.getClientX(ma),mxEvent.getClientY(ma),Xa,ya)}catch(Sa){b.sidebar.currentElt=null,b.handleError(Sa)}Z=!1})}var Xa=null;if("generative"!=Eb||null==Va){Xa=document.createElement("div");Xa.className="geTemplate";var Jb=null,Gb=Da;null!=Ka?Xa.setAttribute("title",mxResources.get(Ka,null,Ka)):null!=Qa&&0<Qa.length&&Xa.setAttribute("title",Qa)}else Xa=Va;var Kb=document.createElement("span");Kb.className="geAdaptiveAsset";mxUtils.write(Kb,mxResources.get(Ka,null,Ka));if(null!=Oa){Xa.style.display="inline-flex";Xa.style.justifyContent="center";Xa.style.alignItems="center";gb=document.createElement("img");gb.setAttribute("src",Oa);gb.setAttribute("alt",Qa);gb.style.maxWidth=Ja+"px";gb.style.maxHeight=-Ra+"px";X=gb;var Mb=Oa.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");Xa.appendChild(gb);gb.onerror=function(){this.src!=Mb?this.src=Mb:(this.src=Editor.errorImage,this.onerror=null)};mxEvent.addGestureListeners(Xa,mxUtils.bind(this,function(ma){U(Xa,null,null,Da,$a,ib)}),null,null);mxEvent.addListener(Xa,"dblclick",function(ma){C();mxEvent.consume(ma)})}else if(!zb&&null!=Da&&0<Da.length){var la=function(ma){Y.spin(da)&&fb(Da,function(ya,Ga){Y.stop();null!=ya&&(U(Xa,ya,Na,null,+Ra+"px";Y=gb;var Mb=Oa.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");Xa.appendChild(gb);gb.onerror=function(){this.src!=Mb?this.src=Mb:(this.src=Editor.errorImage,this.onerror=null)};mxEvent.addGestureListeners(Xa,mxUtils.bind(this,function(ma){U(Xa,null,null,Da,$a,ib)}),null,null);mxEvent.addListener(Xa,"dblclick",function(ma){C();mxEvent.consume(ma)})}else if(!zb&&null!=Da&&0<Da.length){var la=function(ma){X.spin(da)&&fb(Da,function(ya,Ga){X.stop();null!=ya&&(U(Xa,ya,Na,null,null,ib,Ga),ma&&C())})};Oa=gb||TEMPLATE_PATH+"/"+Da.substring(0,Da.length-4)+".png";gb=pb.cloneNode(!1);gb.style.backgroundImage="url("+Oa+")";gb.style.display="";Xa.appendChild(gb);null!=Ka&&Xa.appendChild(Kb);mxEvent.addGestureListeners(Xa,mxUtils.bind(this,function(ma){la()}),null,null);mxEvent.addListener(Xa,"dblclick",function(ma){la(!0);mxEvent.consume(ma)})}else Xa.appendChild(Kb),"generative"==Eb&&null==Va&&(Xa.appendChild(pb),Xa.appendChild(ab),Xa.appendChild(Pa),Xa.appendChild(eb),Va=Xa),-La&&U(Xa),null!=cb?(mxEvent.addGestureListeners(Xa,null,null,mxUtils.bind(this,function(ma){U(Xa,null,null,Da,$a)})),mxEvent.addListener(Xa,"click",cb)):(mxEvent.addListener(Xa,"click",function(ma){U(Xa,null,null,Da,$a)&&"generative"==Eb&&null==ia&&J()}),mxEvent.addListener(Xa,"dblclick",function(ma){"generative"!=Eb?C():"none"==ab.style.display&&J();mxEvent.consume(ma)}));null!=Da&&(Oa=W.cloneNode(!0),Xa.appendChild(Oa),mxEvent.addGestureListeners(Oa,mxUtils.bind(this,function(ma){ba=b.sidebar.currentElt==+La&&U(Xa),null!=cb?(mxEvent.addGestureListeners(Xa,null,null,mxUtils.bind(this,function(ma){U(Xa,null,null,Da,$a)})),mxEvent.addListener(Xa,"click",cb)):(mxEvent.addListener(Xa,"click",function(ma){U(Xa,null,null,Da,$a)&&"generative"==Eb&&null==ia&&K()}),mxEvent.addListener(Xa,"dblclick",function(ma){"generative"!=Eb?C():"none"==ab.style.display&&K();mxEvent.consume(ma)}));null!=Da&&(Oa=W.cloneNode(!0),Xa.appendChild(Oa),mxEvent.addGestureListeners(Oa,mxUtils.bind(this,function(ma){ba=b.sidebar.currentElt==Xa}),null,null),mxEvent.addListener(Oa,"click",mxUtils.bind(this,function(ma){ba||xb(ma,null!=Ka?Ka:Qa);mxEvent.consume(ma)})));da.appendChild(Xa);return Xa}function T(){function Da(fb,xb){fb=mxResources.get(fb,null,fb.substring(0,1).toUpperCase()+fb.substring(1));18<fb.length&&(fb=fb.substring(0,18)+"…");return fb+(null!=xb?" ("+xb.length+")":"")}function Na(fb,xb,Xa){mxEvent.addListener(xb,"click",function(){Wa!=xb&&(null!=Wa&&(Wa.style.backgroundColor=""),Wa=xb,Wa.style.backgroundColor=-z,da.scrollTop=0,da.innerText="",V=0,null!=Ya[fb].content?(da.appendChild(Ya[fb].content),fa=ia,Ua=null,null!=Ya[fb].content.init&&Ya[fb].content.init()):(Ua=Xa?rb[fb][Xa]:Ya[fb],aa=null,E(!1)))})}Cb&&(Cb=!1,mxEvent.addListener(da,"scroll",function(fb){da.scrollTop+da.clientHeight>=da.scrollHeight&&(E(),mxEvent.consume(fb))}));if(0<ub){var Ka=document.createElement("div");Ka.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Ka,mxResources.get("custom"));-Ha.appendChild(Ka);for(var Qa in yb){var La=document.createElement("div");Ka=Qa;var Oa=yb[Qa];18<Ka.length&&(Ka=Ka.substring(0,18)+"…");La.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";La.setAttribute("title",Ka+" ("+Oa.length+")");mxUtils.write(La,La.getAttribute("title"));null!=M&&(La.style.padding=M);Ha.appendChild(La);(function(fb,xb){mxEvent.addListener(La,"click",function(){Wa!=xb&&-(Wa.style.backgroundColor="",Wa=xb,Wa.style.backgroundColor=z,da.scrollTop=0,da.innerText="",V=0,Ua=yb[fb],aa=null,E(!1))})})(Qa,La)}Ka=document.createElement("div");Ka.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Ka,"draw.io");Ha.appendChild(Ka)}for(Qa in Ya){Ka=Oa=null;if(null!=Ya[Qa].content)La=document.createElement($a?"ul":"div"),Ka=Da(Qa),La.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",+y,da.scrollTop=0,da.innerText="",V=0,null!=Ya[fb].content?(da.appendChild(Ya[fb].content),fa=ia,Ua=null,null!=Ya[fb].content.init&&Ya[fb].content.init()):(Ua=Xa?rb[fb][Xa]:Ya[fb],aa=null,E(!1)))})}Cb&&(Cb=!1,mxEvent.addListener(da,"scroll",function(fb){da.scrollTop+da.clientHeight>=da.scrollHeight&&(E(),mxEvent.consume(fb))}));if(0<ub){var Ka=document.createElement("div");Ka.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Ka,mxResources.get("custom"));+Ha.appendChild(Ka);for(var Qa in yb){var La=document.createElement("div");Ka=Qa;var Oa=yb[Qa];18<Ka.length&&(Ka=Ka.substring(0,18)+"…");La.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";La.setAttribute("title",Ka+" ("+Oa.length+")");mxUtils.write(La,La.getAttribute("title"));null!=O&&(La.style.padding=O);Ha.appendChild(La);(function(fb,xb){mxEvent.addListener(La,"click",function(){Wa!=xb&&+(Wa.style.backgroundColor="",Wa=xb,Wa.style.backgroundColor=y,da.scrollTop=0,da.innerText="",V=0,Ua=yb[fb],aa=null,E(!1))})})(Qa,La)}Ka=document.createElement("div");Ka.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(Ka,"draw.io");Ha.appendChild(Ka)}for(Qa in Ya){Ka=Oa=null;if(null!=Ya[Qa].content)La=document.createElement($a?"ul":"div"),Ka=Da(Qa),La.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",La.setAttribute("title",Ka),mxUtils.write(La,Ka),Ha.appendChild(La),Ka=La;else{var $a=rb[Qa];Ka=La=document.createElement($a?"ul":"div");Oa=Ya[Qa];var cb=Da(Qa,Oa);if(null!=$a){Oa=document.createElement("li");var gb=document.createElement("div");gb.className="geTempTreeCaret";gb.setAttribute("title",cb);mxUtils.write(gb,cb);Ka=gb;Oa.appendChild(gb);cb=document.createElement("ul");cb.className="geTempTreeNested";cb.style.visibility="hidden";for(var zb in $a){var ib=document.createElement("li"),Eb=Da(zb,$a[zb]);ib.setAttribute("title",Eb);mxUtils.write(ib,Eb);Na(Qa,ib,zb);cb.appendChild(ib)}Oa.appendChild(cb);La.className="geTempTree";La.appendChild(Oa);(function(fb,xb){mxEvent.addListener(xb,"click",function(){fb.style.visibility="visible";fb.classList.toggle("geTempTreeActive");fb.classList.toggle("geTempTreeNested")&&setTimeout(function(){fb.style.visibility="hidden"},550);xb.classList.toggle("geTempTreeCaret-down")})})(cb,gb)}else La.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",-La.setAttribute("title",cb),mxUtils.write(La,cb);null!=M&&(La.style.padding=M);Ha.appendChild(La)}Na(Qa,Ka);null==Wa&&Ka.click()}E(!1)}var v=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);p=null!=p?p:!0;x=null!=x?x:!1;z=null!=z?z:"light-dark(#ebf2f9, "+Editor.darkColor+")";L=null!=L?L:EditorUi.templateFile;var d=!1,m=document.createElement("div");m.style.userSelect="none";m.style.height="100%";var r=document.createElement("div");r.style.whiteSpace="nowrap";-r.style.height="46px";p&&m.appendChild(r);var A=document.createElement("img");A.setAttribute("border","0");A.setAttribute("align","absmiddle");A.style.width="40px";A.style.height="40px";A.style.marginRight="10px";A.style.paddingBottom="4px";A.src=b.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":b.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":b.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":b.mode==App.MODE_M365?IMAGE_PATH+"/onedrive-logo.svg":b.mode==App.MODE_GITHUB?IMAGE_PATH+-"/github-logo.svg":b.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":b.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":b.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";l||v||!p||r.appendChild(A);p&&mxUtils.write(r,(v?mxResources.get("name"):null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");var D=".drawio";b.mode==App.MODE_GOOGLE&&null!=b.drive?D=b.drive.extension:b.mode==-App.MODE_DROPBOX&&null!=b.dropbox?D=b.dropbox.extension:b.mode==App.MODE_ONEDRIVE&&null!=b.oneDrive?D=b.oneDrive.extension:b.mode==App.MODE_GITHUB&&null!=b.gitHub?D=b.gitHub.extension:b.mode==App.MODE_GITLAB&&null!=b.gitLab?D=b.gitLab.extension:b.mode==App.MODE_TRELLO&&null!=b.trello&&(D=b.trello.extension);var G=document.createElement("input");G.setAttribute("value",b.defaultFilename+D);G.style.marginLeft="10px";G.style.width=l||v?"144px":"244px";this.init=function(){p&&Editor.selectFilename(G);-null!=da.parentNode&&null!=da.parentNode.parentNode&&mxEvent.addGestureListeners(da.parentNode.parentNode,mxUtils.bind(this,function(Da){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null)};if(p)if(r.appendChild(G),t)G.style.width=l||v?"350px":"450px";else if(null!=b.editor.diagramFileTypes){var O=FilenameDialog.createFileTypes(b,G,b.editor.diagramFileTypes);O.style.marginLeft="6px";O.style.width=l||v?"80px":"180px";r.appendChild(O)}var P=!1,V=0,Y=new Spinner({lines:12,length:10,width:5,radius:10,-rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),H=mxUtils.button(n||mxResources.get("create"),function(){H.setAttribute("disabled","disabled");C();H.removeAttribute("disabled")});H.className="geBtn gePrimaryBtn";var W=document.createElement("img");W.setAttribute("src",Editor.magnifyImage);W.setAttribute("title",mxResources.get("preview"));W.className="geButton geRoundButton";var Z=!1,X=null,ba=!1;if(Q||c){var ea=[],aa=null,ha=null,na=null,+La.setAttribute("title",cb),mxUtils.write(La,cb);null!=O&&(La.style.padding=O);Ha.appendChild(La)}Na(Qa,Ka);null==Wa&&Ka.click()}E(!1)}var v=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);p=null!=p?p:!0;x=null!=x?x:!1;y=null!=y?y:"light-dark(#ebf2f9, "+Editor.darkColor+")";J=null!=J?J:EditorUi.templateFile;var d=!1,m=document.createElement("div");m.style.userSelect="none";m.style.height="100%";var r=document.createElement("div");r.style.whiteSpace="nowrap";+r.style.height="46px";p&&m.appendChild(r);var z=document.createElement("img");z.setAttribute("border","0");z.setAttribute("align","absmiddle");z.style.width="40px";z.style.height="40px";z.style.marginRight="10px";z.style.paddingBottom="4px";z.src=b.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":b.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":b.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":b.mode==App.MODE_M365?IMAGE_PATH+"/onedrive-logo.svg":b.mode==App.MODE_GITHUB?IMAGE_PATH++"/github-logo.svg":b.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":b.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":b.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";l||v||!p||r.appendChild(z);p&&mxUtils.write(r,(v?mxResources.get("name"):null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");var D=".drawio";b.mode==App.MODE_GOOGLE&&null!=b.drive?D=b.drive.extension:b.mode==+App.MODE_DROPBOX&&null!=b.dropbox?D=b.dropbox.extension:b.mode==App.MODE_ONEDRIVE&&null!=b.oneDrive?D=b.oneDrive.extension:b.mode==App.MODE_GITHUB&&null!=b.gitHub?D=b.gitHub.extension:b.mode==App.MODE_GITLAB&&null!=b.gitLab?D=b.gitLab.extension:b.mode==App.MODE_TRELLO&&null!=b.trello&&(D=b.trello.extension);var F=document.createElement("input");F.setAttribute("value",b.defaultFilename+D);F.style.marginLeft="10px";F.style.width=l||v?"144px":"244px";this.init=function(){p&&Editor.selectFilename(F);+null!=da.parentNode&&null!=da.parentNode.parentNode&&mxEvent.addGestureListeners(da.parentNode.parentNode,mxUtils.bind(this,function(Da){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null)};if(p)if(r.appendChild(F),t)F.style.width=l||v?"350px":"450px";else if(null!=b.editor.diagramFileTypes){var N=FilenameDialog.createFileTypes(b,F,b.editor.diagramFileTypes);N.style.marginLeft="6px";N.style.width=l||v?"80px":"180px";r.appendChild(N)}var P=!1,V=0,X=new Spinner({lines:12,length:10,width:5,radius:10,+rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),H=mxUtils.button(n||mxResources.get("create"),function(){H.setAttribute("disabled","disabled");C();H.removeAttribute("disabled")});H.className="geBtn gePrimaryBtn";var W=document.createElement("img");W.setAttribute("src",Editor.magnifyImage);W.setAttribute("title",mxResources.get("preview"));W.className="geButton geRoundButton";var Z=!1,Y=null,ba=!1;if(Q||c){var ea=[],aa=null,ha=null,na=null,ra=function(Da){H.setAttribute("disabled","disabled");for(var Na=0;Na<ea.length;Na++)ea[Na].className=Na==Da?"geBtn gePrimaryBtn":"geBtn"};P=!0;var sa=document.createElement("div");sa.style.whiteSpace="nowrap";sa.style.height="30px";m.appendChild(sa);var ua=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Ha.style.display="";ta.style.display="";da.style.left="160px";ra(0);da.scrollTop=0;da.innerText="";V=0;aa!=Ua&&(Ua=aa,Ya=ha,ub=na,Ha.innerText="",T(),aa=null)});ea.push(ua);-sa.appendChild(ua);var xa=function(Da){Ha.style.display="none";ta.style.display="none";da.style.left="30px";ra(Da?-1:1);null==aa&&(aa=Ua);da.scrollTop=0;da.innerText="";Y.spin(da);var Na=function(Ka,Qa,La){V=0;Y.stop();Ua=Ka;La=La||{};var Oa=0,$a;for($a in La)Oa+=La[$a].length;if(Qa)da.innerText=Qa;else if(0==Ka.length&&0==Oa)da.innerText=mxResources.get("noDiagrams",null,"No Diagrams Found");else if(da.innerText="",0<Oa){Ha.style.display="";da.style.left="160px";Ha.innerText="";ub=0;Ya={"draw.io":Ka};+sa.appendChild(ua);var xa=function(Da){Ha.style.display="none";ta.style.display="none";da.style.left="30px";ra(Da?-1:1);null==aa&&(aa=Ua);da.scrollTop=0;da.innerText="";X.spin(da);var Na=function(Ka,Qa,La){V=0;X.stop();Ua=Ka;La=La||{};var Oa=0,$a;for($a in La)Oa+=La[$a].length;if(Qa)da.innerText=Qa;else if(0==Ka.length&&0==Oa)da.innerText=mxResources.get("noDiagrams",null,"No Diagrams Found");else if(da.innerText="",0<Oa){Ha.style.display="";da.style.left="160px";Ha.innerText="";ub=0;Ya={"draw.io":Ka};for($a in La)Ya[$a]=La[$a];T()}else E(!0)};Da?c(Ba.value,Na):Q(Na)};if(Q){var qa=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){xa()});sa.appendChild(qa);ea.push(qa)}if(c){var Aa=document.createElement("span");Aa.style.marginLeft="10px";Aa.innerText=mxResources.get("search")+":";sa.appendChild(Aa);var Ba=document.createElement("input");Ba.style.marginRight="10px";Ba.style.marginLeft="10px";Ba.style.width="220px";mxEvent.addListener(Ba,"keypress",function(Da){13==Da.keyCode&&xa(!0)});sa.appendChild(Ba);var Ea=mxUtils.button(mxResources.get("search"),function(){xa(!0)});Ea.className="geBtn";sa.appendChild(Ea)}ra(0)}var Fa=null,ca=null,fa=null,oa=null,pa=null,wa=null,za=null,ia=null,ka=null,da=document.createElement("div");da.style.border="1px solid #d3d3d3";da.style.position="absolute";da.style.left="160px";da.style.right="34px";var ja=(p?72:40)+(P?30:0);da.style.top=ja+"px";da.style.bottom="68px";da.style.margin="6px 0 0 -1px";da.style.padding="6px";da.style.overflow="auto";var ta=document.createElement("div");ta.style.cssText="position:absolute;left:30px;width:128px;top:"+ja+"px;height:22px;margin-top: 6px;white-space: nowrap;";var va=document.createElement("input");va.style.cssText="width:105px;height:16px;border:1px solid #d3d3d3;padding: 3px 20px 3px 3px;font-size: 12px;border-radius:0px;";va.setAttribute("placeholder",mxResources.get("search"));va.setAttribute("type","text");ta.appendChild(va);var Ca=document.createElement("img");Ca.setAttribute("src",Editor.magnifyImage);Ca.setAttribute("title",mxResources.get("search"));Ca.className="geAdaptiveAsset";Ca.style.position="relative";Ca.style.cursor="pointer";Ca.style.outline="none";Ca.style.opacity="0.5";Ca.style.height="16px";Ca.style.left="-20px";Ca.style.top="4px";ta.appendChild(Ca);mxEvent.addListener(Ca,"click",function(){Ca.getAttribute("src")!=Editor.magnifyImage&&(Ca.setAttribute("src",Editor.magnifyImage),Ca.setAttribute("title",mxResources.get("search")),va.value="",null!=mb&&(mb.click(),mb=null));va.focus()});-mxEvent.addListener(va,"keydown",mxUtils.bind(this,function(Da){if(13==Da.keyCode){var Na=va.value;if(""==Na)null!=mb&&(mb.click(),mb=null);else{if(null==NewDialog.tagsList[L]){var Ka={};for(ib in Ya)if(null==Ya[ib].content)for(var Qa=Ya[ib],La=0;La<Qa.length;La++){var Oa=Qa[La];if(null!=Oa.tags)for(var $a=Oa.tags.toLowerCase().split(";"),cb=0;cb<$a.length;cb++)null==Ka[$a[cb]]&&(Ka[$a[cb]]=[]),Ka[$a[cb]].push(Oa)}NewDialog.tagsList[L]=Ka}var gb=Na.toLowerCase().split(" ");Ka=NewDialog.tagsList[L];+mxEvent.addListener(va,"keydown",mxUtils.bind(this,function(Da){if(13==Da.keyCode){var Na=va.value;if(""==Na)null!=mb&&(mb.click(),mb=null);else{if(null==NewDialog.tagsList[J]){var Ka={};for(ib in Ya)if(null==Ya[ib].content)for(var Qa=Ya[ib],La=0;La<Qa.length;La++){var Oa=Qa[La];if(null!=Oa.tags)for(var $a=Oa.tags.toLowerCase().split(";"),cb=0;cb<$a.length;cb++)null==Ka[$a[cb]]&&(Ka[$a[cb]]=[]),Ka[$a[cb]].push(Oa)}NewDialog.tagsList[J]=Ka}var gb=Na.toLowerCase().split(" ");Ka=NewDialog.tagsList[J];if(0<ub&&null==Ka.__tagsList__){for(ib in yb)for(Qa=yb[ib],La=0;La<Qa.length;La++)for(Oa=Qa[La],$a=Oa.title.split(" "),$a.push(ib),cb=0;cb<$a.length;cb++){var zb=$a[cb].toLowerCase();null==Ka[zb]&&(Ka[zb]=[]);Ka[zb].push(Oa)}Ka.__tagsList__=!0}var ib=[];Qa={};for(La=$a=0;La<gb.length;La++)if(0<gb[La].length){zb=Ka[gb[La]];var Eb={};ib=[];if(null!=zb)for(cb=0;cb<zb.length;cb++)Oa=zb[cb],0==$a==(null==Qa[Oa.url])&&(Eb[Oa.url]=!0,ib.push(Oa));Qa=Eb;$a++}da.scrollTop=0;da.innerText="";V=0;Ka=document.createElement("div");Ka.style.padding="6px";Ka.style.whiteSpace="nowrap";Ka.style.overflow="hidden";Ka.style.textOverflow="ellipsis";Oa=mxResources.get(0==ib.length?"noResultsFor":"resultsFor",[Na]);Ka.setAttribute("title",Oa);mxUtils.write(Ka,Oa);da.appendChild(Ka);null!=Wa&&null==mb&&(Wa.style.backgroundColor="",mb=Wa,Wa=Ka);Ua=ib;aa=null;E(!1)}mxEvent.consume(Da)}}));mxEvent.addListener(va,"keyup",mxUtils.bind(this,function(Da){""==va.value?(Ca.setAttribute("src",Editor.magnifyImage),Ca.setAttribute("title",mxResources.get("search"))):(Ca.setAttribute("src",Editor.crossImage),Ca.setAttribute("title",mxResources.get("reset")))}));ja+=23;var Ha=document.createElement("div");Ha.style.cssText="position:absolute;left:30px;width:128px;top:"+ja+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(da,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var Ja=140,Ra=Ja,Va=null,bb="url("+Editor.thinSparklesImage+")",ab=document.createElement("div");ab.className="geGenerateDiagramForm";ab.style.position="absolute";ab.style.width="100%";ab.style.height="100%";var pb=document.createElement("div");pb.className="geTemplatePreview geAdaptiveAsset";pb.style.backgroundImage=bb;var hb=document.createElement("textarea");hb.setAttribute("placeholder",mxResources.get("describeYourDiagram"));hb.className="geGenerateDiagramDescription";var wb=document.createElement("button");wb.className="geBtn gePrimaryBtn geGenerateDiagramButton";wb.setAttribute("disabled","disabled");wb.setAttribute("title",mxResources.get("ok"));mxUtils.write(wb,mxResources.get("ok"));var Pa=W.cloneNode(!0);Pa.style.display="none";var Za=!1;mxEvent.addGestureListeners(Pa,function(Da){Za=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},null,function(Da){if(!Za&&null!=ia){var Na="<mxfile><diagram>"+Graph.compress(ia)+"</diagram></mxfile>";I(Na,mxEvent.getClientX(Da),mxEvent.getClientY(Da),Va,ka)}});var eb=W.cloneNode(!0);eb.setAttribute("src",Editor.editImage);eb.setAttribute("title",mxResources.get("edit"));eb.style.visibility=-"hidden";eb.style.left="0px";var qb=W.cloneNode(!0);qb.setAttribute("src",Editor.helpImage);qb.setAttribute("title",mxResources.get("help"));mxEvent.addListener(qb,"click",function(Da){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");mxEvent.consume(Da)});ab.appendChild(hb);ab.appendChild(wb);ab.appendChild(qb);ab.style.display="none";mxEvent.addListener(eb,"click",J);mxEvent.addListener(hb,"input",function(){""!=hb.value?wb.removeAttribute("disabled"):wb.setAttribute("disabled",-"disabled")});var lb=!1;mxEvent.addListener(wb,"click",function(){N()});mxEvent.addListener(hb,"keydown",function(Da){13!=Da.keyCode||mxEvent.isShiftDown(Da)?27==Da.keyCode&&(N(!0),mxEvent.consume(Da)):(N(),mxEvent.consume(Da))});var Ya={},rb={},yb={},ub=0,Cb=!0,Wa=null,mb=null;Ya.basic=y?[]:[{title:"blankDiagram"}];var Ua=Ya.basic;Editor.enableAi&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&EditorUi.isMermaidSupported()&&Ya.basic.push({title:"generate",type:"generative"});if(!l){var nb=-function(){mxUtils.get(jb,function(Da){if(!Hb){Hb=!0;Da=Da.getXml().documentElement.firstChild;for(var Na={};null!=Da;){if("undefined"!==typeof Da.getAttribute)if("parsererror"==Da.nodeName)null!=window.console&&console.log("Parser error in "+L+": "+Da.textContent);else if("clibs"==Da.nodeName){for(var Ka=Da.getAttribute("name"),Qa=Da.getElementsByTagName("add"),La=[],Oa=0;Oa<Qa.length;Oa++)La.push(encodeURIComponent(mxUtils.getTextContent(Qa[Oa])));null!=Ka&&0<La.length&&(Na[Ka]=La.join(";"))}else if(La=+"hidden";eb.style.left="0px";var qb=W.cloneNode(!0);qb.setAttribute("src",Editor.helpImage);qb.setAttribute("title",mxResources.get("help"));mxEvent.addListener(qb,"click",function(Da){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");mxEvent.consume(Da)});ab.appendChild(hb);ab.appendChild(wb);ab.appendChild(qb);ab.style.display="none";mxEvent.addListener(eb,"click",K);mxEvent.addListener(hb,"input",function(){""!=hb.value?wb.removeAttribute("disabled"):wb.setAttribute("disabled",+"disabled")});var lb=!1;mxEvent.addListener(wb,"click",function(){M()});mxEvent.addListener(hb,"keydown",function(Da){13!=Da.keyCode||mxEvent.isShiftDown(Da)?27==Da.keyCode&&(M(!0),mxEvent.consume(Da)):(M(),mxEvent.consume(Da))});var Ya={},rb={},yb={},ub=0,Cb=!0,Wa=null,mb=null;Ya.basic=B?[]:[{title:"blankDiagram"}];var Ua=Ya.basic;Editor.enableAi&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&EditorUi.isMermaidSupported()&&Ya.basic.push({title:"generate",type:"generative"});if(!l){var nb=+function(){mxUtils.get(jb,function(Da){if(!Hb){Hb=!0;Da=Da.getXml().documentElement.firstChild;for(var Na={};null!=Da;){if("undefined"!==typeof Da.getAttribute)if("parsererror"==Da.nodeName)null!=window.console&&console.log("Parser error in "+J+": "+Da.textContent);else if("clibs"==Da.nodeName){for(var Ka=Da.getAttribute("name"),Qa=Da.getElementsByTagName("add"),La=[],Oa=0;Oa<Qa.length;Oa++)La.push(encodeURIComponent(mxUtils.getTextContent(Qa[Oa])));null!=Ka&&0<La.length&&(Na[Ka]=La.join(";"))}else if(La=Da.getAttribute("url"),null!=La){Qa=Da.getAttribute("section");Ka=Da.getAttribute("subsection");if(null==Qa&&(Oa=La.indexOf("/"),Qa=La.substring(0,Oa),null==Ka)){var $a=La.indexOf("/",Oa+1);-1<$a&&(Ka=La.substring(Oa+1,$a))}Oa=Ya[Qa];null==Oa&&(Oa=[],Ya[Qa]=Oa);La=Da.getAttribute("clibs");null!=Na[La]&&(La=Na[La]);La={url:Da.getAttribute("url"),libs:Da.getAttribute("libs"),title:Da.getAttribute("title"),tooltip:Da.getAttribute("name")||Da.getAttribute("url"),preview:Da.getAttribute("preview"),clibs:La,-tags:Da.getAttribute("tags")};Oa.push(La);null!=Ka&&(Oa=rb[Qa],null==Oa&&(Oa={},rb[Qa]=Oa),Qa=Oa[Ka],null==Qa&&(Qa=[],Oa[Ka]=Qa),Qa.push(La))}Da=Da.nextSibling}Y.stop();T()}})};m.appendChild(ta);m.appendChild(Ha);m.appendChild(da);var Hb=!1,jb=L;/^https?:\/\//.test(jb)&&!b.editor.isCorsEnabledForUrl(jb)&&(jb=PROXY_URL+"?url="+encodeURIComponent(jb));Y.spin(da);null!=q?q(function(Da,Na){yb=Da;na=ub=Na;nb()},nb):nb();ha=Ya}mxEvent.addListener(G,"keypress",function(Da){b.dialog.container.firstChild==-m&&13==Da.keyCode&&C()});var db=document.createElement("div");db.style.marginTop=l?"4px":"16px";db.style.textAlign="right";db.style.position="absolute";db.style.left="40px";db.style.bottom="24px";db.style.right="40px";var Ab=mxUtils.button(mxResources.get("cancel"),function(){null!=B&&B();b.hideDialog(!0)});Ab.className="geBtn";!b.editor.cancelFirst||x&&null==B||db.appendChild(Ab);if(!(l||"1"==urlParams.embed||x||mxClient.IS_ANDROID||mxClient.IS_IOS)&&"1"!=urlParams.noDevice){var vb=mxUtils.button(mxResources.get("fromTemplateUrl"),+tags:Da.getAttribute("tags")};Oa.push(La);null!=Ka&&(Oa=rb[Qa],null==Oa&&(Oa={},rb[Qa]=Oa),Qa=Oa[Ka],null==Qa&&(Qa=[],Oa[Ka]=Qa),Qa.push(La))}Da=Da.nextSibling}X.stop();T()}})};m.appendChild(ta);m.appendChild(Ha);m.appendChild(da);var Hb=!1,jb=J;/^https?:\/\//.test(jb)&&!b.editor.isCorsEnabledForUrl(jb)&&(jb=PROXY_URL+"?url="+encodeURIComponent(jb));X.spin(da);null!=q?q(function(Da,Na){yb=Da;na=ub=Na;nb()},nb):nb();ha=Ya}mxEvent.addListener(F,"keypress",function(Da){b.dialog.container.firstChild==+m&&13==Da.keyCode&&C()});var db=document.createElement("div");db.style.marginTop=l?"4px":"16px";db.style.textAlign="right";db.style.position="absolute";db.style.left="40px";db.style.bottom="24px";db.style.right="40px";var Ab=mxUtils.button(mxResources.get("cancel"),function(){null!=A&&A();b.hideDialog(!0)});Ab.className="geBtn";!b.editor.cancelFirst||x&&null==A||db.appendChild(Ab);if(!(l||"1"==urlParams.embed||x||mxClient.IS_ANDROID||mxClient.IS_IOS)&&"1"!=urlParams.noDevice){var vb=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var Da=new FilenameDialog(b,"",mxResources.get("create"),function(Na){null!=Na&&0<Na.length&&b.editor.loadUrl(b.editor.getProxiedUrl(Na),function(Ka){fa=Ka;Fa=null;templateRealURl=Na;b.hideDialog();C()},function(Ka){b.handleError(Ka)})},mxResources.get("url"),null,null,null,!1);b.showDialog(Da.container,300,80,!0,!0);Da.init()});vb.className="geBtn";db.appendChild(vb)}if(Graph.fileSupport&&k){var Fb=mxUtils.button(mxResources.get("import"),function(){if(null==b.newDlgFileInputElt){var Da=-document.createElement("input");Da.setAttribute("multiple","multiple");Da.setAttribute("type","file");mxEvent.addListener(Da,"change",function(Na){b.openFiles(Da.files,!0);Da.value=""});Da.style.display="none";document.body.appendChild(Da);b.newDlgFileInputElt=Da}b.newDlgFileInputElt.click()});Fb.className="geBtn";db.appendChild(Fb)}db.appendChild(H);b.editor.cancelFirst||null!=g||x&&null==B||db.appendChild(Ab);m.appendChild(db);this.container=m};NewDialog.tagsList={};-var SaveDialog=function(b,l,p,g,x,B,z,F,K,M,L){function Q(d,m,r,A,D,G){var O=null;if((null==g||0>mxUtils.indexOf(g,d))&&(null==K||d==K)&&(null==M||0<=mxUtils.indexOf(M,d))){D=null!=D?D:b.getTitleForService(d);var P=0<=mxUtils.indexOf(N,d);if(P||null!=b.getServiceForName(d)){O=document.createElement("option");var V="";!P&&b.isOffline(d==App.MODE_GOOGLE&&"1"==urlParams["gapi-stealth"])&&(O.setAttribute("disabled","disabled"),V=" ("+mxResources.get("offline")+")");if("pick"==G)O.innerHTML=mxUtils.htmlEntities(D)+-" – "+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"..."+V,O.setAttribute("value","pickFolder-"+d),O.setAttribute("title",D+" - "+mxResources.get("pickFolder")+"...");else{P=d+(null!=r?"-"+r:"");var Y=T[P];null!=Y&&null!=Y.option&&Y.option.parentNode.removeChild(Y.option);Y=null;if(null!=m){"/"==m.charAt(m.length-1)&&(m=m.substring(0,m.length-1));"/"==m.charAt(0)&&(m=m.substring(1));Y=m;if(d!=App.MODE_GITHUB&&d==App.MODE_GITLAB){var H=Y.lastIndexOf("/");0<=H&&(Y=-Y.substring(H+1))}40<Y.length&&(Y=Y.substring(0,20)+"..."+Y.substring(Y.length-20))}O.innerHTML=mxUtils.htmlEntities(D)+(null!=Y?" – "+mxUtils.htmlEntities(Y):"")+V;O.setAttribute("title",D+(null!=m?" ("+m+")":"")+(null!=r&&decodeURIComponent(r)!=m?" ["+r+"]":""));O.setAttribute("value",P);T[P]={option:O,mode:d,path:m,id:r};SaveDialog.lastValue==P&&null==F&&"disabled"==!O.getAttribute("disabled")?A=!0:null==A&&("root"==G?A=null==F&&b.mode==d||null!=d&&d==F:"pickFolder-"==-S.value.substring(0,11)&&(A=!0));A&&O.setAttribute("selected","selected")}S.appendChild(O)}}return O}function c(d){b.pickFolder(d,function(m){var r=null;d==App.MODE_GOOGLE&&null!=m.docs&&0<m.docs.length?r={mode:d,path:m.docs[0].name,id:m.docs[0].id}:d==App.MODE_ONEDRIVE&&null!=m.value&&0<m.value.length?r={mode:d,path:m.value[0].name,id:OneDriveFile.prototype.getIdOf(m.value[0])}:d==App.MODE_M365&&null!=m.value&&0<m.value.length?r={mode:d,path:m.value[0].name,id:OneDriveFile.prototype.getIdOf(m.value[0])}:+document.createElement("input");Da.setAttribute("multiple","multiple");Da.setAttribute("type","file");mxEvent.addListener(Da,"change",function(Na){b.openFiles(Da.files,!0);Da.value=""});Da.style.display="none";document.body.appendChild(Da);b.newDlgFileInputElt=Da}b.newDlgFileInputElt.click()});Fb.className="geBtn";db.appendChild(Fb)}db.appendChild(H);b.editor.cancelFirst||null!=g||x&&null==A||db.appendChild(Ab);m.appendChild(db);this.container=m};NewDialog.tagsList={};+var SaveDialog=function(b,l,p,g,x,A,y,G,L,O,J){function Q(d,m,r,z,D,F){var N=null;if((null==g||0>mxUtils.indexOf(g,d))&&(null==L||d==L)&&(null==O||0<=mxUtils.indexOf(O,d))){D=null!=D?D:b.getTitleForService(d);var P=0<=mxUtils.indexOf(M,d);if(P||null!=b.getServiceForName(d)){N=document.createElement("option");var V="";!P&&b.isOffline(d==App.MODE_GOOGLE&&"1"==urlParams["gapi-stealth"])&&(N.setAttribute("disabled","disabled"),V=" ("+mxResources.get("offline")+")");if("pick"==F)N.innerHTML=mxUtils.htmlEntities(D)++" – "+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"..."+V,N.setAttribute("value","pickFolder-"+d),N.setAttribute("title",D+" - "+mxResources.get("pickFolder")+"...");else{P=d+(null!=r?"-"+r:"");var X=T[P];null!=X&&null!=X.option&&X.option.parentNode.removeChild(X.option);X=null;if(null!=m){"/"==m.charAt(m.length-1)&&(m=m.substring(0,m.length-1));"/"==m.charAt(0)&&(m=m.substring(1));X=m;if(d!=App.MODE_GITHUB&&d==App.MODE_GITLAB){var H=X.lastIndexOf("/");0<=H&&(X=+X.substring(H+1))}40<X.length&&(X=X.substring(0,20)+"..."+X.substring(X.length-20))}N.innerHTML=mxUtils.htmlEntities(D)+(null!=X?" – "+mxUtils.htmlEntities(X):"")+V;N.setAttribute("title",D+(null!=m?" ("+m+")":"")+(null!=r&&decodeURIComponent(r)!=m?" ["+r+"]":""));N.setAttribute("value",P);T[P]={option:N,mode:d,path:m,id:r};SaveDialog.lastValue==P&&null==G&&"disabled"==!N.getAttribute("disabled")?z=!0:null==z&&("root"==F?z=null==G&&b.mode==d||null!=d&&d==G:"pickFolder-"==+S.value.substring(0,11)&&(z=!0));z&&N.setAttribute("selected","selected")}S.appendChild(N)}}return N}function c(d){b.pickFolder(d,function(m){var r=null;d==App.MODE_GOOGLE&&null!=m.docs&&0<m.docs.length?r={mode:d,path:m.docs[0].name,id:m.docs[0].id}:d==App.MODE_ONEDRIVE&&null!=m.value&&0<m.value.length?r={mode:d,path:m.value[0].name,id:OneDriveFile.prototype.getIdOf(m.value[0])}:d==App.MODE_M365&&null!=m.value&&0<m.value.length?r={mode:d,path:m.value[0].name,id:OneDriveFile.prototype.getIdOf(m.value[0])}:(d==App.MODE_GITHUB||d==App.MODE_GITLAB)&&null!=m&&0<m.length&&(r={mode:d,path:decodeURIComponent(m),id:m});null!=r&&(b.addRecent(r,"Folders",5),m=Q(r.mode,r.path,r.id,!0),S.innerHTML="",T={},f(),r=S.selectedIndex,S.value=m.value,0>S.selectedIndex&&(S.selectedIndex=r))},!0,!0,!0,!0)}function f(){var d=b.getRecent("Folders"),m=0;if(null!=d&&0<d.length)for(var r=0;r<d.length;r++)null!=Q(d[r].mode,d[r].path,d[r].id)&&m++;Q(App.MODE_GOOGLE,mxResources.get("myDrive"),"root",null,null,"root");Q(App.MODE_GOOGLE,null,null,null,null,"pick");null!=b.oneDrive&&(Q(App.MODE_ONEDRIVE,mxResources.get("myFiles"),OneDriveFile.prototype.getIdOf(b.oneDrive.rootId),null,null,"root"),Q(App.MODE_ONEDRIVE,null,null,null,null,"pick"));null!=b.m365&&Q(App.MODE_M365,null,null,null,null,"pick");null!=b.dropbox&&Q(App.MODE_DROPBOX,"Apps"+b.dropbox.appPath);Q(App.MODE_GITHUB,null,null,null,null,"pick");Q(App.MODE_GITLAB,null,null,null,null,"pick");Q(App.MODE_TRELLO);d=!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice;EditorUi.nativeFileSupport&&d&&Q(App.MODE_DEVICE,null,null,b.mode==App.MODE_DEVICE||null!=g&&0<=mxUtils.indexOf(g,App.MODE_BROWSER)?!0:null);isLocalStorage&&"0"!=urlParams.browser&&Q(App.MODE_BROWSER);d&&Q("download");Editor.popupsAllowed&&Q("_blank",null,null,null,mxResources.get("openInNewWindow"));"pickFolder-"==S.value.substring(0,11)&&(d=document.createElement("option"),d.setAttribute("value",""),d.setAttribute("selected","selected"),mxUtils.write(d,-mxResources.get("pickFolder")+"..."),S.insertBefore(d,S.firstChild));R=S.value}function k(){if("pickFolder-"==S.value.substring(0,11)){var d=S.value.substring(11);S.value=R;c(d)}else if(null!=J&&null!=T[S.value]&&null!=b.editor.diagramFileTypes&&"drawio"==b.editor.diagramFileTypes[J.value].extension){d=b.getExtensionForService(T[S.value].mode);var m=U.value;null!=d&&0>l.indexOf(".")&&0>m.indexOf(".")&&(U.value=m+d)}v.innerHTML="";mxUtils.write(v,null!=L?L:mxResources.get("download"==S.value||"_blank"==-S.value||null!=K?"ok":"save"));""==S.value?v.setAttribute("disabled","disabled"):v.removeAttribute("disabled")}var n=document.createElement("div");n.style.display="flex";n.style.flexWrap="wrap";n.style.whiteSpace="nowrap";var q=document.createElement("div");q.style.display="grid";q.style.gap="5px 8px";q.style.gridAutoRows="auto auto auto";q.style.gridAutoColumns="0fr minmax(0,1fr)";q.style.width="100%";var t=null,u=null;if(null==x||null==B||"image/"!=B.substring(0,6)||"image/svg"==B.substring(0,9)&&-!mxClient.IS_SVG)null==x||z||null==B||"text/"!=B.substring(0,5)&&"application/json"!=B||null==navigator.clipboard||null==navigator.clipboard.writeText||(u=mxUtils.button(mxResources.get("copy"),function(){b.writeTextToClipboard(x,function(d){b.handleError(d)},function(){"copy"==F?b.hideDialog():b.alert(mxResources.get("copiedToClipboard"))})},null,"geBtn"));else{q.style.display="inline-grid";q.style.flexBasis="75%";t=document.createElement("div");t.style.display="inline-block";t.style.height="auto";-t.style.maxWidth="25%";t.style.margin="auto";var y=document.createElement("img"),E=z?x:btoa(unescape(encodeURIComponent(x))),I="data:"+B+";base64,"+E;y.setAttribute("src",I);y.style.boxSizing="border-box";y.style.maxHeight="50px";y.style.maxWidth="100%";y.style.paddingLeft="10px";t.appendChild(y);"image/png"!=B&&"image/svg+xml"!=B||"function"!==typeof window.ClipboardItem||null==navigator.clipboard||(u=mxUtils.button(mxResources.get("copy"),function(){b.writeImageToClipboard(I,null,null,B,mxUtils.bind(this,-function(){"copy"==F?b.hideDialog():b.alert(mxResources.get("copiedToClipboard"))}),mxUtils.bind(this,function(d){b.handleError(d)}))},null,"geBtn"));Editor.popupsAllowed&&(null==g||0>mxUtils.indexOf(g,"_blank"))?(t.setAttribute("title",mxResources.get("openInNewWindow")),t.style.cursor="pointer",mxEvent.addGestureListeners(t,null,null,function(d){mxEvent.isPopupTrigger(d)||b.openInNewWindow(x,B,z)})):t.setAttribute("title",mxResources.get("preview"))}E=document.createElement("div");E.style.display=+mxResources.get("pickFolder")+"..."),S.insertBefore(d,S.firstChild));R=S.value}function k(){if("pickFolder-"==S.value.substring(0,11)){var d=S.value.substring(11);S.value=R;c(d)}else if(null!=K&&null!=T[S.value]&&null!=b.editor.diagramFileTypes&&"drawio"==b.editor.diagramFileTypes[K.value].extension){d=b.getExtensionForService(T[S.value].mode);var m=U.value;null!=d&&0>l.indexOf(".")&&0>m.indexOf(".")&&(U.value=m+d)}v.innerHTML="";mxUtils.write(v,null!=J?J:mxResources.get("download"==S.value||"_blank"==+S.value||null!=L?"ok":"save"));""==S.value?v.setAttribute("disabled","disabled"):v.removeAttribute("disabled")}var n=document.createElement("div");n.style.display="flex";n.style.flexWrap="wrap";n.style.whiteSpace="nowrap";var q=document.createElement("div");q.style.display="grid";q.style.gap="5px 8px";q.style.gridAutoRows="auto auto auto";q.style.gridAutoColumns="0fr minmax(0,1fr)";q.style.width="100%";var t=null,u=null;if(null==x||null==A||"image/"!=A.substring(0,6)||"image/svg"==A.substring(0,9)&&+!mxClient.IS_SVG)null==x||y||null==A||"text/"!=A.substring(0,5)&&"application/json"!=A||null==navigator.clipboard||null==navigator.clipboard.writeText||(u=mxUtils.button(mxResources.get("copy"),function(){b.writeTextToClipboard(x,function(d){b.handleError(d)},function(){"copy"==G?b.hideDialog():b.alert(mxResources.get("copiedToClipboard"))})},null,"geBtn"));else{q.style.display="inline-grid";q.style.flexBasis="75%";t=document.createElement("div");t.style.display="inline-block";t.style.height="auto";+t.style.maxWidth="25%";t.style.margin="auto";var B=document.createElement("img"),E=y?x:btoa(unescape(encodeURIComponent(x))),I="data:"+A+";base64,"+E;B.setAttribute("src",I);B.style.boxSizing="border-box";B.style.maxHeight="50px";B.style.maxWidth="100%";B.style.paddingLeft="10px";t.appendChild(B);"image/png"!=A&&"image/svg+xml"!=A||"function"!==typeof window.ClipboardItem||null==navigator.clipboard||(u=mxUtils.button(mxResources.get("copy"),function(){b.writeImageToClipboard(I,null,null,A,mxUtils.bind(this,+function(){"copy"==G?b.hideDialog():b.alert(mxResources.get("copiedToClipboard"))}),mxUtils.bind(this,function(d){b.handleError(d)}))},null,"geBtn"));Editor.popupsAllowed&&(null==g||0>mxUtils.indexOf(g,"_blank"))?(t.setAttribute("title",mxResources.get("openInNewWindow")),t.style.cursor="pointer",mxEvent.addGestureListeners(t,null,null,function(d){mxEvent.isPopupTrigger(d)||b.openInNewWindow(x,A,y)})):t.setAttribute("title",mxResources.get("preview"))}E=document.createElement("div");E.style.display="flex";E.style.padding="1px";E.style.alignItems="center";E.style.justifyContent="flex-end";E.style.gridColumn="1";E.style.whiteSpace="nowrap";var C=document.createElement("div");C.style.display="grid";C.style.padding="1px";C.style.alignItems="center";C.style.gridColumn="2";C.style.gridAutoColumns="minmax(0,1fr) auto";C.style.gap="6px";mxUtils.write(E,mxResources.get("saveAs")+":");var U=document.createElement("input");U.setAttribute("type","text");U.setAttribute("value",l);U.style.boxSizing="border-box";-U.style.width="100%";C.appendChild(U);null==K&&(q.appendChild(E),q.appendChild(C));var J=null;null!=b.editor.diagramFileTypes&&null==B&&null==K&&(E=E.cloneNode(!1),C=C.cloneNode(!1),mxUtils.write(E,mxResources.get("type")+":"),J=FilenameDialog.createFileTypes(b,U,b.editor.diagramFileTypes),J.style.boxSizing="border-box",J.style.width="100%",C.appendChild(J),q.appendChild(E),q.appendChild(C));E=E.cloneNode(!1);C=C.cloneNode(!1);mxUtils.write(E,mxResources.get("where")+":");var S=document.createElement("select");-S.style.textOverflow="ellipsis";S.style.gridColumn="1";var N=["browser","device","download","_blank"],R=null,T={};y=mxUtils.button(mxResources.get("reset"),function(){U.value=l;U.dispatchEvent(new Event("change"));b.resetRecent("Folders");S.innerHTML="";S.value="";pickFolderOption=null;T={};f()},null,"geBtn");var v=mxUtils.button("",function(){SaveDialog.lastValue=S.value;var d=T[SaveDialog.lastValue];null!=d&&p(U,d.mode,d.id)},null,"geBtn gePrimaryBtn");mxEvent.addListener(U,"keypress",function(d){13==-d.keyCode&&("copy"==F&&null!=u?u.click():v.click())});mxEvent.addListener(S,"change",k);f();C.appendChild(S);null!=SaveDialog.lastValue&&null!=T[SaveDialog.lastValue]&&(S.value=SaveDialog.lastValue);k();q.appendChild(E);q.appendChild(C);n.appendChild(q);null!=t&&n.appendChild(t);q=document.createElement("div");q.style.flexBasis="100%";q.style.textAlign="right";q.style.marginTop="20px";b.isOffline()&&!mxClient.IS_CHROMEAPP||q.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/save-file-formats"));-t=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&q.appendChild(t);q.appendChild(y);"copy"==F&&null!=u?(u.className="geBtn gePrimaryBtn",v.className="geBtn",q.appendChild(v),q.appendChild(u)):(null!=u&&q.appendChild(u),q.appendChild(v));b.editor.cancelFirst||q.appendChild(t);n.appendChild(q);this.init=function(){Editor.selectFilename(U)};this.container=n},CreateDialog=function(b,l,p,g,x,B,z,F,K,M,L,Q,c,f,k,n,q){function t(S,N,R,T){function v(){mxEvent.addListener(d,-"click",function(){var G=R;if(z){var O=E.value,P=O.lastIndexOf(".");if(0>l.lastIndexOf(".")&&0>P){G=null!=G?G:J.value;var V="";G==App.MODE_GOOGLE?V=b.drive.extension:G==App.MODE_GITHUB?V=b.gitHub.extension:G==App.MODE_GITLAB?V=b.gitLab.extension:G==App.MODE_TRELLO?V=b.trello.extension:G==App.MODE_DROPBOX?V=b.dropbox.extension:G==App.MODE_ONEDRIVE?V=b.oneDrive.extension:G==App.MODE_DEVICE&&(V=".drawio");0<=P&&(O=O.substring(0,P));E.value=O+V}}u(R)})}var d=document.createElement("a");d.style.overflow=-"hidden";var m=document.createElement("img");m.src=S;m.setAttribute("border","0");m.setAttribute("align","absmiddle");m.style.width="60px";m.style.height="60px";m.style.paddingBottom="6px";d.style.display="inline-block";d.className="geBaseButton";d.style.position="relative";d.style.margin="4px";d.style.padding="8px 8px 10px 8px";d.style.whiteSpace="nowrap";d.appendChild(m);d.style.color="gray";d.style.fontSize="11px";var r=document.createElement("div");d.appendChild(r);mxUtils.write(r,N);if(null!=-T&&null==b[T]){m.style.visibility="hidden";mxUtils.setOpacity(r,10);var A=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});A.spin(d);var D=window.setTimeout(function(){null==b[T]&&(A.stop(),d.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[T]&&(window.clearTimeout(D),mxUtils.setOpacity(r,100),m.style.visibility="",A.stop(),v())}))}else v();C.appendChild(d);-++U==Q&&(mxUtils.br(C),U=0)}function u(S){var N=E.value;if(null==S||null!=N&&0<N.length)q&&b.hideDialog(),p(N,S,E)}L="1"==urlParams.noDevice?!1:L;z=null!=z?z:!0;F=null!=F?F:!0;Q=null!=Q?Q:4;q=null!=q?q:!0;B=document.createElement("div");B.style.whiteSpace="nowrap";null==g&&b.addLanguageMenu(B);var y=document.createElement("h2");mxUtils.write(y,x||mxResources.get("create"));y.style.marginTop="0px";y.style.marginBottom="24px";B.appendChild(y);x=document.createElement("span");mxUtils.write(x,mxResources.get("filename")+-":");x.style.maxWidth="106px";x.style.overflow="hidden";x.style.textOverflow="ellipsis";x.style.display="inline-block";B.appendChild(x);var E=document.createElement("input");E.setAttribute("value",l);E.style.width="180px";E.style.marginLeft="10px";E.style.marginBottom="20px";E.style.maxWidth="70%";this.init=function(){Editor.selectFilename(E)};B.appendChild(E);null!=n&&null!=b.editor.diagramFileTypes&&(n=FilenameDialog.createFileTypes(b,E,b.editor.diagramFileTypes),n.style.marginLeft="6px",n.style.width=-"90px",B.appendChild(n));n=null;if("1"!=urlParams.noDevice&&null!=c&&null!=f&&"image/"==f.substring(0,6)&&("image/svg"!=f.substring(0,9)||mxClient.IS_SVG)){E.style.width="160px";x=document.createElement("img");var I=k?c:btoa(unescape(encodeURIComponent(c)));x.setAttribute("src","data:"+f+";base64,"+I);x.style.position="absolute";x.style.top="70px";x.style.right="100px";x.style.maxWidth="120px";x.style.maxHeight="80px";mxUtils.setPrefixedStyle(x.style,"transform","translate(50%,-50%)");B.appendChild(x);-mxClient.IS_FF||"image/png"!=f||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||(n=mxUtils.button(mxResources.get("copy"),function(S){S=b.base64ToBlob(I,"image/png");S=new ClipboardItem({"image/png":S,"text/html":new Blob(['<img src="data:'+f+";base64,"+I+'">'],{type:"text/html"})});navigator.clipboard.write([S]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(N){b.handleError(N)}))}),n.style.marginTop="6px",-n.className="geBtn");K&&Editor.popupsAllowed&&(x.style.cursor="pointer",mxEvent.addGestureListeners(x,null,null,function(S){mxEvent.isPopupTrigger(S)||u("_blank")}))}mxUtils.br(B);var C=document.createElement("div");C.style.textAlign="center";var U=0;C.style.marginTop="6px";B.appendChild(C);var J=document.createElement("select");J.style.marginLeft="10px";b.isOfflineApp()||b.isOffline()||("function"===typeof window.DriveClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GOOGLE),-mxUtils.write(c,mxResources.get("googleDrive")),J.appendChild(c),t(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(c,mxResources.get("oneDrive")),J.appendChild(c),b.mode==App.MODE_ONEDRIVE&&c.setAttribute("selected","selected"),t(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),-null!=b.m365&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_M365),mxUtils.write(c,mxResources.get("m365")),J.appendChild(c),b.mode==App.MODE_M365&&c.setAttribute("selected","selected"),t(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("m365"),App.MODE_M365,"m365")),"function"===typeof window.DropboxClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(c,mxResources.get("dropbox")),J.appendChild(c),b.mode==App.MODE_DROPBOX&&c.setAttribute("selected",-"selected"),t(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=b.gitHub&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GITHUB),mxUtils.write(c,mxResources.get("github")),J.appendChild(c),t(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=b.gitLab&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GITLAB),mxUtils.write(c,mxResources.get("gitlab")),J.appendChild(c),t(IMAGE_PATH+-"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_TRELLO),mxUtils.write(c,mxResources.get("trello")),J.appendChild(c),t(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice)c=document.createElement("option"),c.setAttribute("value",App.MODE_DEVICE),-mxUtils.write(c,mxResources.get("device")),J.appendChild(c),b.mode!=App.MODE_DEVICE&&F||c.setAttribute("selected","selected"),L&&t(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);F&&isLocalStorage&&"0"!=urlParams.browser&&(F=document.createElement("option"),F.setAttribute("value",App.MODE_BROWSER),mxUtils.write(F,mxResources.get("browser")),J.appendChild(F),b.mode==App.MODE_BROWSER&&F.setAttribute("selected","selected"),t(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),-App.MODE_BROWSER));F=document.createElement("div");F.style.marginTop="26px";F.style.textAlign="center";null!=M&&(L=mxUtils.button(mxResources.get("help"),function(){b.openLink(M)}),L.className="geBtn",F.appendChild(L));L=mxUtils.button(mxResources.get(null!=g?"close":"cancel"),function(){null!=g?g():(b.fileLoaded(null),b.hideDialog(),window.close(),window.location.href=b.getUrl())});L.className="geBtn";b.editor.cancelFirst&&null==g&&F.appendChild(L);null==g&&(c=mxUtils.button(mxResources.get("decideLater"),-function(){u(null)}),c.className="geBtn",F.appendChild(c));K&&Editor.popupsAllowed&&(K=mxUtils.button(mxResources.get("openInNewWindow"),function(){u("_blank")}),K.className="geBtn",F.appendChild(K));CreateDialog.showDownloadButton&&(K=mxUtils.button(mxResources.get("download"),function(){u("download")}),K.className="geBtn",F.appendChild(K),null!=n&&(K.style.marginTop="6px",F.style.marginTop="6px"));null!=n&&(mxUtils.br(F),F.appendChild(n));b.editor.cancelFirst&&null==g||F.appendChild(L);mxEvent.addListener(E,-"keypress",function(S){13==S.keyCode?u(App.MODE_DEVICE):27==S.keyCode&&(b.fileLoaded(null),b.hideDialog(),window.close())});B.appendChild(F);this.container=B};CreateDialog.showDownloadButton="1"!=urlParams.noDevice;-var PopupDialog=function(b,l,p,g,x){x=null!=x?x:!0;var B=document.createElement("div");B.style.textAlign="center";B.style.height="100%";mxUtils.write(B,mxResources.get("fileOpenLocation"));mxUtils.br(B);mxUtils.br(B);var z=mxUtils.button(mxResources.get("openInThisWindow"),function(){x&&b.hideDialog();null!=g&&g()});z.className="geBtn";z.style.marginBottom="8px";z.style.width="280px";B.appendChild(z);mxUtils.br(B);var F=mxUtils.button(mxResources.get("openInNewWindow"),function(){x&&b.hideDialog();-null!=p&&p();b.openLink(l,null,!0)});F.className="geBtn gePrimaryBtn";F.style.width=z.style.width;B.appendChild(F);mxUtils.br(B);mxUtils.br(B);mxUtils.write(B,mxResources.get("allowPopups"));this.container=B},ImageDialog=function(b,l,p,g,x,B,z,F){function K(){0<Q.value.length?u.removeAttribute("disabled"):u.setAttribute("disabled","disabled");"data:"!=Q.value.substring(0,5)?y.removeAttribute("disabled"):y.setAttribute("disabled","disabled")}B=null!=B?B:!0;var M=b.editor.graph,L=document.createElement("div");-mxUtils.write(L,l);l=document.createElement("div");l.className="geTitle";l.style.backgroundColor="transparent";l.style.borderColor="transparent";l.style.whiteSpace="nowrap";l.style.textOverflow="clip";l.style.cursor="default";l.style.paddingRight="20px";var Q=document.createElement("input");Q.setAttribute("value",p);Q.setAttribute("type","text");Q.setAttribute("spellcheck","false");Q.setAttribute("autocorrect","off");Q.setAttribute("autocomplete","off");Q.setAttribute("autocapitalize","off");Q.style.marginTop=+U.style.width="100%";C.appendChild(U);null==L&&(q.appendChild(E),q.appendChild(C));var K=null;null!=b.editor.diagramFileTypes&&null==A&&null==L&&(E=E.cloneNode(!1),C=C.cloneNode(!1),mxUtils.write(E,mxResources.get("type")+":"),K=FilenameDialog.createFileTypes(b,U,b.editor.diagramFileTypes),K.style.boxSizing="border-box",K.style.width="100%",C.appendChild(K),q.appendChild(E),q.appendChild(C));E=E.cloneNode(!1);C=C.cloneNode(!1);mxUtils.write(E,mxResources.get("where")+":");var S=document.createElement("select");+S.style.textOverflow="ellipsis";S.style.gridColumn="1";var M=["browser","device","download","_blank"],R=null,T={};B=mxUtils.button(mxResources.get("reset"),function(){U.value=l;U.dispatchEvent(new Event("change"));b.resetRecent("Folders");S.innerHTML="";S.value="";pickFolderOption=null;T={};f()},null,"geBtn");var v=mxUtils.button("",function(){SaveDialog.lastValue=S.value;var d=T[SaveDialog.lastValue];null!=d&&p(U,d.mode,d.id)},null,"geBtn gePrimaryBtn");mxEvent.addListener(U,"keypress",function(d){13==+d.keyCode&&("copy"==G&&null!=u?u.click():v.click())});mxEvent.addListener(S,"change",k);f();C.appendChild(S);null!=SaveDialog.lastValue&&null!=T[SaveDialog.lastValue]&&(S.value=SaveDialog.lastValue);k();q.appendChild(E);q.appendChild(C);n.appendChild(q);null!=t&&n.appendChild(t);q=document.createElement("div");q.style.flexBasis="100%";q.style.textAlign="right";q.style.marginTop="20px";b.isOffline()&&!mxClient.IS_CHROMEAPP||q.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/save-file-formats"));+t=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&q.appendChild(t);q.appendChild(B);"copy"==G&&null!=u?(u.className="geBtn gePrimaryBtn",v.className="geBtn",q.appendChild(v),q.appendChild(u)):(null!=u&&q.appendChild(u),q.appendChild(v));b.editor.cancelFirst||q.appendChild(t);n.appendChild(q);this.init=function(){Editor.selectFilename(U)};this.container=n},CreateDialog=function(b,l,p,g,x,A,y,G,L,O,J,Q,c,f,k,n,q){function t(S,M,R,T){function v(){mxEvent.addListener(d,+"click",function(){var F=R;if(y){var N=E.value,P=N.lastIndexOf(".");if(0>l.lastIndexOf(".")&&0>P){F=null!=F?F:K.value;var V="";F==App.MODE_GOOGLE?V=b.drive.extension:F==App.MODE_GITHUB?V=b.gitHub.extension:F==App.MODE_GITLAB?V=b.gitLab.extension:F==App.MODE_TRELLO?V=b.trello.extension:F==App.MODE_DROPBOX?V=b.dropbox.extension:F==App.MODE_ONEDRIVE?V=b.oneDrive.extension:F==App.MODE_DEVICE&&(V=".drawio");0<=P&&(N=N.substring(0,P));E.value=N+V}}u(R)})}var d=document.createElement("a");d.style.overflow=+"hidden";var m=document.createElement("img");m.src=S;m.setAttribute("border","0");m.setAttribute("align","absmiddle");m.style.width="60px";m.style.height="60px";m.style.paddingBottom="6px";d.style.display="inline-block";d.className="geBaseButton";d.style.position="relative";d.style.margin="4px";d.style.padding="8px 8px 10px 8px";d.style.whiteSpace="nowrap";d.appendChild(m);d.style.color="gray";d.style.fontSize="11px";var r=document.createElement("div");d.appendChild(r);mxUtils.write(r,M);if(null!=+T&&null==b[T]){m.style.visibility="hidden";mxUtils.setOpacity(r,10);var z=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});z.spin(d);var D=window.setTimeout(function(){null==b[T]&&(z.stop(),d.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[T]&&(window.clearTimeout(D),mxUtils.setOpacity(r,100),m.style.visibility="",z.stop(),v())}))}else v();C.appendChild(d);+++U==Q&&(mxUtils.br(C),U=0)}function u(S){var M=E.value;if(null==S||null!=M&&0<M.length)q&&b.hideDialog(),p(M,S,E)}J="1"==urlParams.noDevice?!1:J;y=null!=y?y:!0;G=null!=G?G:!0;Q=null!=Q?Q:4;q=null!=q?q:!0;A=document.createElement("div");A.style.whiteSpace="nowrap";null==g&&b.addLanguageMenu(A);var B=document.createElement("h2");mxUtils.write(B,x||mxResources.get("create"));B.style.marginTop="0px";B.style.marginBottom="24px";A.appendChild(B);x=document.createElement("span");mxUtils.write(x,mxResources.get("filename")++":");x.style.maxWidth="106px";x.style.overflow="hidden";x.style.textOverflow="ellipsis";x.style.display="inline-block";A.appendChild(x);var E=document.createElement("input");E.setAttribute("value",l);E.style.width="180px";E.style.marginLeft="10px";E.style.marginBottom="20px";E.style.maxWidth="70%";this.init=function(){Editor.selectFilename(E)};A.appendChild(E);null!=n&&null!=b.editor.diagramFileTypes&&(n=FilenameDialog.createFileTypes(b,E,b.editor.diagramFileTypes),n.style.marginLeft="6px",n.style.width=+"90px",A.appendChild(n));n=null;if("1"!=urlParams.noDevice&&null!=c&&null!=f&&"image/"==f.substring(0,6)&&("image/svg"!=f.substring(0,9)||mxClient.IS_SVG)){E.style.width="160px";x=document.createElement("img");var I=k?c:btoa(unescape(encodeURIComponent(c)));x.setAttribute("src","data:"+f+";base64,"+I);x.style.position="absolute";x.style.top="70px";x.style.right="100px";x.style.maxWidth="120px";x.style.maxHeight="80px";mxUtils.setPrefixedStyle(x.style,"transform","translate(50%,-50%)");A.appendChild(x);+mxClient.IS_FF||"image/png"!=f||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||(n=mxUtils.button(mxResources.get("copy"),function(S){S=b.base64ToBlob(I,"image/png");S=new ClipboardItem({"image/png":S,"text/html":new Blob(['<img src="data:'+f+";base64,"+I+'">'],{type:"text/html"})});navigator.clipboard.write([S]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(M){b.handleError(M)}))}),n.style.marginTop="6px",+n.className="geBtn");L&&Editor.popupsAllowed&&(x.style.cursor="pointer",mxEvent.addGestureListeners(x,null,null,function(S){mxEvent.isPopupTrigger(S)||u("_blank")}))}mxUtils.br(A);var C=document.createElement("div");C.style.textAlign="center";var U=0;C.style.marginTop="6px";A.appendChild(C);var K=document.createElement("select");K.style.marginLeft="10px";b.isOfflineApp()||b.isOffline()||("function"===typeof window.DriveClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GOOGLE),+mxUtils.write(c,mxResources.get("googleDrive")),K.appendChild(c),t(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(c,mxResources.get("oneDrive")),K.appendChild(c),b.mode==App.MODE_ONEDRIVE&&c.setAttribute("selected","selected"),t(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),+null!=b.m365&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_M365),mxUtils.write(c,mxResources.get("m365")),K.appendChild(c),b.mode==App.MODE_M365&&c.setAttribute("selected","selected"),t(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("m365"),App.MODE_M365,"m365")),"function"===typeof window.DropboxClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(c,mxResources.get("dropbox")),K.appendChild(c),b.mode==App.MODE_DROPBOX&&c.setAttribute("selected",+"selected"),t(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=b.gitHub&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GITHUB),mxUtils.write(c,mxResources.get("github")),K.appendChild(c),t(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=b.gitLab&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_GITLAB),mxUtils.write(c,mxResources.get("gitlab")),K.appendChild(c),t(IMAGE_PATH++"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&(c=document.createElement("option"),c.setAttribute("value",App.MODE_TRELLO),mxUtils.write(c,mxResources.get("trello")),K.appendChild(c),t(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice)c=document.createElement("option"),c.setAttribute("value",App.MODE_DEVICE),+mxUtils.write(c,mxResources.get("device")),K.appendChild(c),b.mode!=App.MODE_DEVICE&&G||c.setAttribute("selected","selected"),J&&t(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);G&&isLocalStorage&&"0"!=urlParams.browser&&(G=document.createElement("option"),G.setAttribute("value",App.MODE_BROWSER),mxUtils.write(G,mxResources.get("browser")),K.appendChild(G),b.mode==App.MODE_BROWSER&&G.setAttribute("selected","selected"),t(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),+App.MODE_BROWSER));G=document.createElement("div");G.style.marginTop="26px";G.style.textAlign="center";null!=O&&(J=mxUtils.button(mxResources.get("help"),function(){b.openLink(O)}),J.className="geBtn",G.appendChild(J));J=mxUtils.button(mxResources.get(null!=g?"close":"cancel"),function(){null!=g?g():(b.fileLoaded(null),b.hideDialog(),window.close(),window.location.href=b.getUrl())});J.className="geBtn";b.editor.cancelFirst&&null==g&&G.appendChild(J);null==g&&(c=mxUtils.button(mxResources.get("decideLater"),+function(){u(null)}),c.className="geBtn",G.appendChild(c));L&&Editor.popupsAllowed&&(L=mxUtils.button(mxResources.get("openInNewWindow"),function(){u("_blank")}),L.className="geBtn",G.appendChild(L));CreateDialog.showDownloadButton&&(L=mxUtils.button(mxResources.get("download"),function(){u("download")}),L.className="geBtn",G.appendChild(L),null!=n&&(L.style.marginTop="6px",G.style.marginTop="6px"));null!=n&&(mxUtils.br(G),G.appendChild(n));b.editor.cancelFirst&&null==g||G.appendChild(J);mxEvent.addListener(E,+"keypress",function(S){13==S.keyCode?u(App.MODE_DEVICE):27==S.keyCode&&(b.fileLoaded(null),b.hideDialog(),window.close())});A.appendChild(G);this.container=A};CreateDialog.showDownloadButton="1"!=urlParams.noDevice;+var PopupDialog=function(b,l,p,g,x){x=null!=x?x:!0;var A=document.createElement("div");A.style.textAlign="center";A.style.height="100%";mxUtils.write(A,mxResources.get("fileOpenLocation"));mxUtils.br(A);mxUtils.br(A);var y=mxUtils.button(mxResources.get("openInThisWindow"),function(){x&&b.hideDialog();null!=g&&g()});y.className="geBtn";y.style.marginBottom="8px";y.style.width="280px";A.appendChild(y);mxUtils.br(A);var G=mxUtils.button(mxResources.get("openInNewWindow"),function(){x&&b.hideDialog();+null!=p&&p();b.openLink(l,null,!0)});G.className="geBtn gePrimaryBtn";G.style.width=y.style.width;A.appendChild(G);mxUtils.br(A);mxUtils.br(A);mxUtils.write(A,mxResources.get("allowPopups"));this.container=A},ImageDialog=function(b,l,p,g,x,A,y,G){function L(){0<Q.value.length?u.removeAttribute("disabled"):u.setAttribute("disabled","disabled");"data:"!=Q.value.substring(0,5)?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled")}A=null!=A?A:!0;var O=b.editor.graph,J=document.createElement("div");+mxUtils.write(J,l);l=document.createElement("div");l.className="geTitle";l.style.backgroundColor="transparent";l.style.borderColor="transparent";l.style.whiteSpace="nowrap";l.style.textOverflow="clip";l.style.cursor="default";l.style.paddingRight="20px";var Q=document.createElement("input");Q.setAttribute("value",p);Q.setAttribute("type","text");Q.setAttribute("spellcheck","false");Q.setAttribute("autocorrect","off");Q.setAttribute("autocomplete","off");Q.setAttribute("autocapitalize","off");Q.style.marginTop="6px";Q.style.width=(Graph.fileSupport?460:340)-20+"px";Q.style.backgroundImage="url('"+Editor.crossImage+"')";Q.style.backgroundRepeat="no-repeat";Q.style.backgroundPosition="100% 50%";Q.style.paddingRight="14px";p=document.createElement("div");p.setAttribute("title",mxResources.get("reset"));p.style.position="relative";p.style.left="-16px";p.style.width="12px";p.style.height="14px";p.style.cursor="pointer";p.style.display="inline-block";p.style.top="3px";p.style.background="url('"+b.editor.transparentImage+-"')";mxEvent.addListener(p,"click",function(){Q.value="";Q.focus()});l.appendChild(Q);l.appendChild(p);L.appendChild(l);var c=F,f,k,n=function(E,I,C,U){var J="data:"==E.substring(0,5);!b.isOffline()||J&&"undefined"===typeof chrome?0<E.length&&b.spinner.spin(document.body,mxResources.get("inserting"))?b.loadImage(E,function(S){b.spinner.stop();b.hideDialog();var N=!1===U?1:null!=I&&null!=C?Math.max(I/S.width,C/S.height):Math.min(1,Math.min(520/S.width,520/S.height));B&&(E=b.convertDataUri(E));g(E,-Math.round(Number(S.width)*N),Math.round(Number(S.height)*N),c,f,k)},function(){b.spinner.stop();g(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),g(E,null,null,c,f,k)):(E=b.convertDataUri(E),I=null==I?120:I,C=null==C?100:C,b.hideDialog(),g(E,I,C,c,f,k))},q=function(E,I){if(null!=E){var C=x?null:M.getModel().getGeometry(M.getSelectionCell());null!=C?n(E,C.width,C.height,I):n(E,null,null,I)}else b.hideDialog(),g(null)};this.init=function(){Q.focus();-if(Graph.fileSupport){Q.setAttribute("placeholder",mxResources.get("dragImagesHere"));var E=L.parentNode,I=null;mxEvent.addListener(E,"dragleave",function(C){null!=I&&(I.parentNode.removeChild(I),I=null);C.stopPropagation();C.preventDefault()});mxEvent.addListener(E,"dragover",mxUtils.bind(this,function(C){null==I&&(I=b.highlightElement(E));C.stopPropagation();C.preventDefault()}));mxEvent.addListener(E,"drop",mxUtils.bind(this,function(C){null!=I&&(I.parentNode.removeChild(I),I=null);if(0<C.dataTransfer.files.length)b.importFiles(C.dataTransfer.files,-0,0,b.maxImageSize,function(J,S,N,R,T,v,d,m){q(J,m)},function(){},function(J){return"image/"==J.type.substring(0,6)},function(J){for(var S=0;S<J.length;S++)J[S]()},!mxEvent.isControlDown(C),null,null,!0);else if(0<=mxUtils.indexOf(C.dataTransfer.types,"text/uri-list")){var U=C.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(U)&&q(decodeURIComponent(U))}C.stopPropagation();C.preventDefault()}),!1)}};F=document.createElement("div");F.style.marginTop="14px";F.style.textAlign=-"center";p=mxUtils.button(mxResources.get("cancel"),function(){b.spinner.stop();b.hideDialog()});p.className="geBtn";b.editor.cancelFirst&&F.appendChild(p);ImageDialog.filePicked=function(E){E.action==google.picker.Action.PICKED&&null!=E.docs[0].thumbnails&&(E=E.docs[0].thumbnails[E.docs[0].thumbnails.length-1],null!=E&&(Q.value=E.url));Q.focus()};if(Graph.fileSupport){if(null==b.imgDlgFileInputElt){var t=document.createElement("input");t.setAttribute("multiple","multiple");t.setAttribute("type",-"file");mxEvent.addListener(t,"change",function(E){null!=t.files&&(b.importFiles(t.files,0,0,b.maxImageSize,function(I,C,U,J,S,N){q(I)},function(){},function(I){return"image/"==I.type.substring(0,6)},function(I){for(var C=0;C<I.length;C++)I[C]()},!0),t.type="",t.type="file",t.value="")});t.style.display="none";document.body.appendChild(t);b.imgDlgFileInputElt=t}l=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});l.className="geBtn";F.appendChild(l)}mxEvent.addListener(Q,-"keypress",function(E){13==E.keyCode&&q(Q.value)});var u=mxUtils.button(mxResources.get("crop"),function(){var E=new CropImageDialog(b,Q.value,c,function(I,C,U){c=I;f=C;k=U});b.showDialog(E.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450))});z&&(u.className="geBtn",F.appendChild(u));var y=mxUtils.button(mxResources.get("embed"),function(){if("data:"!=Q.value.substring(0,5)&&b.spinner.spin(document.body,mxResources.get("loading"))){var E=b.editor.createImageUrlConverter().convert(Q.value),-I=new Image;I.onload=function(){b.editor.convertImageToDataUri(E,function(C){b.confirmImageResize(function(U){b.resizeImage(I,C,mxUtils.bind(this,function(J,S,N){b.spinner.stop();null!=J&&J.length<b.maxImageBytes?(Q.value=J,K()):b.handleError({message:mxResources.get("imageTooBig")})}),U,b.maxImageSize)},I.width>b.maxImageSize||I.height>b.maxImageSize||C.length>b.maxImageBytes)},mxUtils.bind(this,function(){b.handleError({message:mxResources.get("fileNotFound")})}))};I.onerror=function(){b.spinner.stop();-b.handleError({message:mxResources.get("fileNotFound")})};I.src=E}});y.className="geBtn";mxEvent.addListener(Q,"change",function(E){c=null;K()});K();F.appendChild(y);z=mxUtils.button(mxResources.get("apply"),function(){q(Q.value)});z.className="geBtn gePrimaryBtn";F.appendChild(z);b.editor.cancelFirst||F.appendChild(p);Graph.fileSupport&&(F.style.marginTop="120px",L.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",L.style.backgroundPosition="center 65%",L.style.backgroundRepeat="no-repeat",-z=document.createElement("div"),z.style.position="absolute",z.style.width="420px",z.style.top="58%",z.style.textAlign="center",z.style.fontSize="18px",z.style.color="#a0c3ff",mxUtils.write(z,mxResources.get("dragImagesHere")),L.appendChild(z));L.appendChild(F);this.container=L},LinkDialog=function(b,l,p,g,x,B,z){function F(J,S){var N=document.createElement("option");mxUtils.write(N,mxResources.get(J));N.value=J;C.appendChild(N);U[J]=S}var K=document.createElement("div");K.style.paddingBottom="10px";-var M=document.createElement("h3");mxUtils.write(M,mxResources.get("editLink"));K.appendChild(M);var L=document.createElement("input");L.setAttribute("value","url");L.setAttribute("type","radio");L.setAttribute("name","geLinkDialogOption");var Q=document.createElement("input");Q.setAttribute("value","url");Q.setAttribute("type","radio");Q.setAttribute("name","geLinkDialogOption");var c=document.createElement("input");c.setAttribute("value","action");c.setAttribute("type","radio");c.setAttribute("name",+"')";mxEvent.addListener(p,"click",function(){Q.value="";Q.focus()});l.appendChild(Q);l.appendChild(p);J.appendChild(l);var c=G,f,k,n=function(E,I,C,U){var K="data:"==E.substring(0,5);!b.isOffline()||K&&"undefined"===typeof chrome?0<E.length&&b.spinner.spin(document.body,mxResources.get("inserting"))?b.loadImage(E,function(S){b.spinner.stop();b.hideDialog();var M=!1===U?1:null!=I&&null!=C?Math.max(I/S.width,C/S.height):Math.min(1,Math.min(520/S.width,520/S.height));A&&(E=b.convertDataUri(E));g(E,+Math.round(Number(S.width)*M),Math.round(Number(S.height)*M),c,f,k)},function(){b.spinner.stop();g(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),g(E,null,null,c,f,k)):(E=b.convertDataUri(E),I=null==I?120:I,C=null==C?100:C,b.hideDialog(),g(E,I,C,c,f,k))},q=function(E,I){if(null!=E){var C=x?null:O.getModel().getGeometry(O.getSelectionCell());null!=C?n(E,C.width,C.height,I):n(E,null,null,I)}else b.hideDialog(),g(null)};this.init=function(){Q.focus();+if(Graph.fileSupport){Q.setAttribute("placeholder",mxResources.get("dragImagesHere"));var E=J.parentNode,I=null;mxEvent.addListener(E,"dragleave",function(C){null!=I&&(I.parentNode.removeChild(I),I=null);C.stopPropagation();C.preventDefault()});mxEvent.addListener(E,"dragover",mxUtils.bind(this,function(C){null==I&&(I=b.highlightElement(E));C.stopPropagation();C.preventDefault()}));mxEvent.addListener(E,"drop",mxUtils.bind(this,function(C){null!=I&&(I.parentNode.removeChild(I),I=null);if(0<C.dataTransfer.files.length)b.importFiles(C.dataTransfer.files,+0,0,b.maxImageSize,function(K,S,M,R,T,v,d,m){q(K,m)},function(){},function(K){return"image/"==K.type.substring(0,6)},function(K){for(var S=0;S<K.length;S++)K[S]()},!mxEvent.isControlDown(C),null,null,!0);else if(0<=mxUtils.indexOf(C.dataTransfer.types,"text/uri-list")){var U=C.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(U)&&q(decodeURIComponent(U))}C.stopPropagation();C.preventDefault()}),!1)}};G=document.createElement("div");G.style.marginTop="14px";G.style.textAlign=+"center";p=mxUtils.button(mxResources.get("cancel"),function(){b.spinner.stop();b.hideDialog()});p.className="geBtn";b.editor.cancelFirst&&G.appendChild(p);ImageDialog.filePicked=function(E){E.action==google.picker.Action.PICKED&&null!=E.docs[0].thumbnails&&(E=E.docs[0].thumbnails[E.docs[0].thumbnails.length-1],null!=E&&(Q.value=E.url));Q.focus()};if(Graph.fileSupport){if(null==b.imgDlgFileInputElt){var t=document.createElement("input");t.setAttribute("multiple","multiple");t.setAttribute("type",+"file");mxEvent.addListener(t,"change",function(E){null!=t.files&&(b.importFiles(t.files,0,0,b.maxImageSize,function(I,C,U,K,S,M){q(I)},function(){},function(I){return"image/"==I.type.substring(0,6)},function(I){for(var C=0;C<I.length;C++)I[C]()},!0),t.type="",t.type="file",t.value="")});t.style.display="none";document.body.appendChild(t);b.imgDlgFileInputElt=t}l=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});l.className="geBtn";G.appendChild(l)}mxEvent.addListener(Q,+"keypress",function(E){13==E.keyCode&&q(Q.value)});var u=mxUtils.button(mxResources.get("crop"),function(){var E=new CropImageDialog(b,Q.value,c,function(I,C,U){c=I;f=C;k=U});b.showDialog(E.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450))});y&&(u.className="geBtn",G.appendChild(u));var B=mxUtils.button(mxResources.get("embed"),function(){if("data:"!=Q.value.substring(0,5)&&b.spinner.spin(document.body,mxResources.get("loading"))){var E=b.editor.createImageUrlConverter().convert(Q.value),+I=new Image;I.onload=function(){b.editor.convertImageToDataUri(E,function(C){b.confirmImageResize(function(U){b.resizeImage(I,C,mxUtils.bind(this,function(K,S,M){b.spinner.stop();null!=K&&K.length<b.maxImageBytes?(Q.value=K,L()):b.handleError({message:mxResources.get("imageTooBig")})}),U,b.maxImageSize)},I.width>b.maxImageSize||I.height>b.maxImageSize||C.length>b.maxImageBytes)},mxUtils.bind(this,function(){b.handleError({message:mxResources.get("fileNotFound")})}))};I.onerror=function(){b.spinner.stop();+b.handleError({message:mxResources.get("fileNotFound")})};I.src=E}});B.className="geBtn";mxEvent.addListener(Q,"change",function(E){c=null;L()});L();G.appendChild(B);y=mxUtils.button(mxResources.get("apply"),function(){q(Q.value)});y.className="geBtn gePrimaryBtn";G.appendChild(y);b.editor.cancelFirst||G.appendChild(p);Graph.fileSupport&&(G.style.marginTop="120px",J.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",J.style.backgroundPosition="center 65%",J.style.backgroundRepeat="no-repeat",+y=document.createElement("div"),y.style.position="absolute",y.style.width="420px",y.style.top="58%",y.style.textAlign="center",y.style.fontSize="18px",y.style.color="#a0c3ff",mxUtils.write(y,mxResources.get("dragImagesHere")),J.appendChild(y));J.appendChild(G);this.container=J},LinkDialog=function(b,l,p,g,x,A,y){function G(K,S){var M=document.createElement("option");mxUtils.write(M,mxResources.get(K));M.value=K;C.appendChild(M);U[K]=S}var L=document.createElement("div");L.style.paddingBottom="10px";+var O=document.createElement("h3");mxUtils.write(O,mxResources.get("editLink"));L.appendChild(O);var J=document.createElement("input");J.setAttribute("value","url");J.setAttribute("type","radio");J.setAttribute("name","geLinkDialogOption");var Q=document.createElement("input");Q.setAttribute("value","url");Q.setAttribute("type","radio");Q.setAttribute("name","geLinkDialogOption");var c=document.createElement("input");c.setAttribute("value","action");c.setAttribute("type","radio");c.setAttribute("name","geLinkDialogOption");var f=null!=l&&"data:action/json,"==l.substring(0,17)?l:null,k=document.createElement("input");k.setAttribute("placeholder",mxResources.get("dragUrlsHere"));k.setAttribute("type","text");k.style.flex="1";k.style.minWidth="0";var n=document.createElement("div");n.setAttribute("title",mxResources.get("reset"));n.style.backgroundImage="url("+Editor.crossImage+")";n.className="geAdaptiveAsset";n.style.width="12px";n.style.height="14px";n.style.cursor="pointer";n.style.flexShrink=-"0";n.style.marginLeft="-20px";n.style.marginRight="8px";mxEvent.addListener(n,"click",function(){k.value="";k.focus()});var q=document.createElement("select");q.style.flex="1";q.style.minWidth="0";q.style.marginLeft="0";var t=document.createElement("input");t.setAttribute("type","checkbox");null!=z&&(t.setAttribute("checked","checked"),t.defaultChecked=!0);z=null!=z?z:"_blank";t.setAttribute("title",z);M=document.createElement("div");M.className="geDialogSection";if(x&&null!=b.pages){null!=f?(c.setAttribute("checked",-"checked"),c.defaultChecked=!0):null!=l&&Graph.isPageLink(l)?(Q.setAttribute("checked","checked"),Q.defaultChecked=!0):(k.setAttribute("value",l),L.setAttribute("checked","checked"),L.defaultChecked=!0);x=document.createElement("div");x.className="geDialogCheckRow";x.appendChild(L);x.appendChild(k);x.appendChild(n);B&&(B=document.createElement("label"),B.style.display="flex",B.style.alignItems="center",B.style.gap="4px",B.style.marginLeft="8px",B.style.whiteSpace="nowrap",B.style.fontSize="13px",-B.appendChild(t),mxUtils.write(B,mxResources.get("openInNewWindow")),x.appendChild(B));M.appendChild(x);B=!1;for(x=0;x<b.pages.length;x++)n=document.createElement("option"),mxUtils.write(n,b.pages[x].getName()||mxResources.get("pageWithNumber",[x+1])),n.setAttribute("value","data:page/id,"+b.pages[x].getId()),l==n.getAttribute("value")&&(n.setAttribute("selected","selected"),B=!0),q.appendChild(n);if(!B&&Q.checked){var u=document.createElement("option");mxUtils.write(u,mxResources.get("pageNotFound"));-u.setAttribute("disabled","disabled");u.setAttribute("selected","selected");u.setAttribute("value","pageNotFound");q.appendChild(u);mxEvent.addListener(q,"change",function(){null==u.parentNode||u.selected||u.parentNode.removeChild(u)})}B=document.createElement("div");B.className="geDialogCheckRow";B.style.marginTop="6px";B.appendChild(Q);B.appendChild(q);M.appendChild(B);B=document.createElement("div");B.className="geDialogCheckRow";B.style.marginTop="6px";B.appendChild(c);var y=document.createElement("span");-y.style.cssText="flex:1;min-width:0;font-size:13px;line-height:1.5;color:light-dark(#1d1d1f,#e0e0e0);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:8px";var E=mxUtils.button("",function(){c.checked=!0;LinkDialog.editCustomAction(b,f,function(J){f=J;g(J,LinkDialog.selectedDocs,t.checked?z:null)})});E.className="geBtn";(function(){y.textContent="";if(null==f)mxUtils.write(y,mxResources.get("action",null,"Action")),E.textContent=mxResources.get("insert",null,"Insert");else{E.textContent=-mxResources.get("edit",null,"Edit");try{var J=JSON.parse(f.substring(17));if("string"==typeof J.title&&""!=J.title.trim())var S=J.title.trim();else{var N=0<(null!=J.actions?J.actions.length:0)?Object.keys(J.actions[0])[0]:"";if("animation"==N&&null!=J.actions[0].animation.steps){var R=J.actions[0].animation.steps.length;S=mxResources.get("effects",null,"Effects")+" ("+R+")"}else if(""!=N){var T=null!=CustomActionDialog?CustomActionDialog.SCHEMAS[N]:null;S=mxResources.get(null!=T&&T.labelKey?T.labelKey:-N,null,null!=T?T.label:N)}else S=mxResources.get("action",null,"Action")}mxUtils.write(y,S)}catch(v){mxUtils.write(y,"("+mxResources.get("invalid",null,"invalid")+")")}}})();B.appendChild(y);E.style.marginLeft="8px";B.appendChild(E);M.appendChild(B)}else k.setAttribute("value",l),x=document.createElement("div"),x.className="geDialogFormRow",x.appendChild(k),x.appendChild(n),M.appendChild(x);K.appendChild(M);var I=mxUtils.button(p,function(){b.hideDialog();g(c.checked?null!=f?f:l:Q.checked?"pageNotFound"!==-q.value?q.value:l:k.value,LinkDialog.selectedDocs,t.checked?z:null)});I.style.verticalAlign="middle";I.className="geBtn gePrimaryBtn";this.init=function(){Q.checked?q.focus():(k.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?k.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(q,"focus",function(){L.removeAttribute("checked");Q.setAttribute("checked","checked");Q.checked=!0});mxEvent.addListener(k,"focus",function(){Q.removeAttribute("checked");L.setAttribute("checked",-"checked");L.checked=!0});if(Graph.fileSupport&&null!=K.parentNode){var J=K.parentNode,S=null;mxEvent.addListener(J,"dragleave",function(N){null!=S&&(S.parentNode.removeChild(S),S=null);N.stopPropagation();N.preventDefault()});mxEvent.addListener(J,"dragover",mxUtils.bind(this,function(N){null==S&&(S=b.highlightElement(J));N.stopPropagation();N.preventDefault()}));mxEvent.addListener(J,"drop",mxUtils.bind(this,function(N){try{null!=S&&(S.parentNode.removeChild(S),S=null),0<=mxUtils.indexOf(N.dataTransfer.types,-"text/uri-list")&&(k.value=decodeURIComponent(N.dataTransfer.getData("text/uri-list")),L.setAttribute("checked","checked"),L.checked=!0,I.click())}catch(R){b.handleError(R)}N.stopPropagation();N.preventDefault()}),!1)}};p=document.createElement("div");p.style.marginTop="34px";p.style.textAlign="right";b.isOffline()||p.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/custom-links"));M=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});M.style.verticalAlign="middle";M.className=-"geBtn";b.editor.cancelFirst&&p.appendChild(M);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(J){if(J.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=J.docs;var S=J.docs[0].url;"application/mxe"==J.docs[0].mimeType||null!=J.docs[0].mimeType&&"application/vnd.jgraph."==J.docs[0].mimeType.substring(0,23)?S="https://app.diagrams.net/#G"+J.docs[0].id:"application/vnd.google-apps.folder"==J.docs[0].mimeType&&(S="https://drive.google.com/#folders/"+J.docs[0].id);k.value=S;k.focus()}else LinkDialog.selectedDocs=-null;k.focus()};var C=document.createElement("select");C.className="geBtn";C.style.position="relative";C.style.top="1px";C.style.maxWidth="120px";var U={};B=document.createElement("option");mxUtils.write(B,mxResources.get("select")+"...");B.value="";C.appendChild(B);"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=b.drive&&F("googleDrive",function(){b.spinner.spin(document.body,mxResources.get("authorizing"))&&b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();if(null==-b.linkPicker){var J=b.drive.createLinkPicker();b.linkPicker=J.setCallback(function(S){LinkDialog.filePicked(S)}).build()}b.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&F("dropbox",function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(J){k.value=J[0].link;k.focus()}})});null!=b.oneDrive&&F("oneDrive",function(){b.oneDrive.pickFile(function(J,S){null!=S&&null!=S.value&&0<S.value.length&&(k.value=S.value[0].webUrl,k.focus())},-!0)});null!=b.gitHub&&F("github",function(){b.gitHub.pickFile(function(J){if(null!=J){J=J.split("/");var S=J[0],N=J[1],R=J[2];J=J.slice(3,J.length).join("/");k.value="https://github.com/"+S+"/"+N+"/blob/"+R+"/"+J;k.focus()}})});null!=b.gitLab&&F("gitlab",function(){b.gitLab.pickFile(function(J){if(null!=J){J=J.split("/");var S=J[0],N=J[1],R=J[2];J=J.slice(3,J.length).join("/");k.value=DRAWIO_GITLAB_URL+"/"+S+"/"+N+"/blob/"+R+"/"+J;k.focus()}})});1<C.children.length&&(p.appendChild(C),mxEvent.addListener(C,-"change",function(J){null!=U[C.value]&&(U[C.value](),C.value="")}));mxEvent.addListener(k,"keypress",function(J){13==J.keyCode&&I.click()});p.appendChild(I);b.editor.cancelFirst||p.appendChild(M);K.appendChild(p);this.urlInput=k;this.container=K};+"0";n.style.marginLeft="-20px";n.style.marginRight="8px";mxEvent.addListener(n,"click",function(){k.value="";k.focus()});var q=document.createElement("select");q.style.flex="1";q.style.minWidth="0";q.style.marginLeft="0";var t=document.createElement("input");t.setAttribute("type","checkbox");null!=y&&(t.setAttribute("checked","checked"),t.defaultChecked=!0);y=null!=y?y:"_blank";t.setAttribute("title",y);O=document.createElement("div");O.className="geDialogSection";if(x&&null!=b.pages){null!=f?(c.setAttribute("checked",+"checked"),c.defaultChecked=!0):null!=l&&Graph.isPageLink(l)?(Q.setAttribute("checked","checked"),Q.defaultChecked=!0):(k.setAttribute("value",l),J.setAttribute("checked","checked"),J.defaultChecked=!0);x=document.createElement("div");x.className="geDialogCheckRow";x.appendChild(J);x.appendChild(k);x.appendChild(n);A&&(A=document.createElement("label"),A.style.display="flex",A.style.alignItems="center",A.style.gap="4px",A.style.marginLeft="8px",A.style.whiteSpace="nowrap",A.style.fontSize="13px",+A.appendChild(t),mxUtils.write(A,mxResources.get("openInNewWindow")),x.appendChild(A));O.appendChild(x);A=!1;for(x=0;x<b.pages.length;x++)n=document.createElement("option"),mxUtils.write(n,b.pages[x].getName()||mxResources.get("pageWithNumber",[x+1])),n.setAttribute("value","data:page/id,"+b.pages[x].getId()),l==n.getAttribute("value")&&(n.setAttribute("selected","selected"),A=!0),q.appendChild(n);if(!A&&Q.checked){var u=document.createElement("option");mxUtils.write(u,mxResources.get("pageNotFound"));+u.setAttribute("disabled","disabled");u.setAttribute("selected","selected");u.setAttribute("value","pageNotFound");q.appendChild(u);mxEvent.addListener(q,"change",function(){null==u.parentNode||u.selected||u.parentNode.removeChild(u)})}A=document.createElement("div");A.className="geDialogCheckRow";A.style.marginTop="6px";A.appendChild(Q);A.appendChild(q);O.appendChild(A);A=document.createElement("div");A.className="geDialogCheckRow";A.style.marginTop="6px";A.appendChild(c);var B=document.createElement("span");+B.style.cssText="flex:1;min-width:0;font-size:13px;line-height:1.5;color:light-dark(#1d1d1f,#e0e0e0);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:8px";var E=mxUtils.button("",function(){c.checked=!0;LinkDialog.editCustomAction(b,f,function(K){f=K;g(K,LinkDialog.selectedDocs,t.checked?y:null)})});E.className="geBtn";(function(){B.textContent="";if(null==f)mxUtils.write(B,mxResources.get("action",null,"Action")),E.textContent=mxResources.get("insert",null,"Insert");else{E.textContent=+mxResources.get("edit",null,"Edit");try{var K=JSON.parse(f.substring(17));if("string"==typeof K.title&&""!=K.title.trim())var S=K.title.trim();else{var M=0<(null!=K.actions?K.actions.length:0)?Object.keys(K.actions[0])[0]:"";if("animation"==M&&null!=K.actions[0].animation.steps){var R=K.actions[0].animation.steps.length;S=mxResources.get("effects",null,"Effects")+" ("+R+")"}else if(""!=M){var T=null!=CustomActionDialog?CustomActionDialog.SCHEMAS[M]:null;S=mxResources.get(null!=T&&T.labelKey?T.labelKey:+M,null,null!=T?T.label:M)}else S=mxResources.get("action",null,"Action")}mxUtils.write(B,S)}catch(v){mxUtils.write(B,"("+mxResources.get("invalid",null,"invalid")+")")}}})();A.appendChild(B);E.style.marginLeft="8px";A.appendChild(E);O.appendChild(A)}else k.setAttribute("value",l),x=document.createElement("div"),x.className="geDialogFormRow",x.appendChild(k),x.appendChild(n),O.appendChild(x);L.appendChild(O);var I=mxUtils.button(p,function(){b.hideDialog();g(c.checked?null!=f?f:l:Q.checked?"pageNotFound"!==+q.value?q.value:l:k.value,LinkDialog.selectedDocs,t.checked?y:null)});I.style.verticalAlign="middle";I.className="geBtn gePrimaryBtn";this.init=function(){Q.checked?q.focus():(k.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?k.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(q,"focus",function(){J.removeAttribute("checked");Q.setAttribute("checked","checked");Q.checked=!0});mxEvent.addListener(k,"focus",function(){Q.removeAttribute("checked");J.setAttribute("checked",+"checked");J.checked=!0});if(Graph.fileSupport&&null!=L.parentNode){var K=L.parentNode,S=null;mxEvent.addListener(K,"dragleave",function(M){null!=S&&(S.parentNode.removeChild(S),S=null);M.stopPropagation();M.preventDefault()});mxEvent.addListener(K,"dragover",mxUtils.bind(this,function(M){null==S&&(S=b.highlightElement(K));M.stopPropagation();M.preventDefault()}));mxEvent.addListener(K,"drop",mxUtils.bind(this,function(M){try{null!=S&&(S.parentNode.removeChild(S),S=null),0<=mxUtils.indexOf(M.dataTransfer.types,+"text/uri-list")&&(k.value=decodeURIComponent(M.dataTransfer.getData("text/uri-list")),J.setAttribute("checked","checked"),J.checked=!0,I.click())}catch(R){b.handleError(R)}M.stopPropagation();M.preventDefault()}),!1)}};p=document.createElement("div");p.style.marginTop="34px";p.style.textAlign="right";b.isOffline()||p.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/custom-links"));O=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});O.style.verticalAlign="middle";O.className=+"geBtn";b.editor.cancelFirst&&p.appendChild(O);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(K){if(K.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=K.docs;var S=K.docs[0].url;"application/mxe"==K.docs[0].mimeType||null!=K.docs[0].mimeType&&"application/vnd.jgraph."==K.docs[0].mimeType.substring(0,23)?S="https://app.diagrams.net/#G"+K.docs[0].id:"application/vnd.google-apps.folder"==K.docs[0].mimeType&&(S="https://drive.google.com/#folders/"+K.docs[0].id);k.value=S;k.focus()}else LinkDialog.selectedDocs=+null;k.focus()};var C=document.createElement("select");C.className="geBtn";C.style.position="relative";C.style.top="1px";C.style.maxWidth="120px";var U={};A=document.createElement("option");mxUtils.write(A,mxResources.get("select")+"...");A.value="";C.appendChild(A);"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=b.drive&&G("googleDrive",function(){b.spinner.spin(document.body,mxResources.get("authorizing"))&&b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();if(null==+b.linkPicker){var K=b.drive.createLinkPicker();b.linkPicker=K.setCallback(function(S){LinkDialog.filePicked(S)}).build()}b.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&G("dropbox",function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(K){k.value=K[0].link;k.focus()}})});null!=b.oneDrive&&G("oneDrive",function(){b.oneDrive.pickFile(function(K,S){null!=S&&null!=S.value&&0<S.value.length&&(k.value=S.value[0].webUrl,k.focus())},+!0)});null!=b.gitHub&&G("github",function(){b.gitHub.pickFile(function(K){if(null!=K){K=K.split("/");var S=K[0],M=K[1],R=K[2];K=K.slice(3,K.length).join("/");k.value="https://github.com/"+S+"/"+M+"/blob/"+R+"/"+K;k.focus()}})});null!=b.gitLab&&G("gitlab",function(){b.gitLab.pickFile(function(K){if(null!=K){K=K.split("/");var S=K[0],M=K[1],R=K[2];K=K.slice(3,K.length).join("/");k.value=DRAWIO_GITLAB_URL+"/"+S+"/"+M+"/blob/"+R+"/"+K;k.focus()}})});1<C.children.length&&(p.appendChild(C),mxEvent.addListener(C,+"change",function(K){null!=U[C.value]&&(U[C.value](),C.value="")}));mxEvent.addListener(k,"keypress",function(K){13==K.keyCode&&I.click()});p.appendChild(I);b.editor.cancelFirst||p.appendChild(O);L.appendChild(p);this.urlInput=k;this.container=L};LinkDialog.editCustomAction=function(b,l,p){b.hideDialog();null!=b.actionWindow&&null!=b.actionWindow.window&&b.actionWindow.window.isVisible()?(b.actionWindow.window.setVisible(!0),b.actionWindow.window.activate()):(b.actionWindow=new CustomActionDialog(b,l,p),b.actionWindow.window.addListener("hide",function(){b.actionWindow=null}))};var ANIMATION_HELP_URL="https://www.drawio.com/docs/manual/links-tooltips-tags/animations-custom-actions/",SELECTOR_ICONS={arrowDown:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2v8M4.5 6.5L8 10l3.5-3.5M3 13h10"/></svg>',target:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"/><path d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2"/></svg>',asterisk:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M8 3.5v9M4 5.5l8 5M4 10.5l8-5"/></svg>'};function installCustomActionStyles(){if(!installCustomActionStyles._done){installCustomActionStyles._done=!0;var b=document.createElement("style");b.setAttribute("data-source","customActionDialog");b.textContent='.geSelField{display:inline-flex;align-items:center;gap:6px;font:12px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased}.geSelFieldLabel{color:light-dark(#6e6e73,#a0a0a0);font-weight:500;letter-spacing:0.01em}.geSelChip{display:inline-flex;align-items:center;gap:4px;min-height:24px;padding:2px 10px;border-radius:999px;border:1px solid light-dark(#d2d2d7,#48484a);background:light-dark(#fafafa,#2c2c2e);color:light-dark(#1d1d1f,#e5e5e7);font:inherit;font-weight:500;flex:0 0 auto;max-width:100%;white-space:nowrap;user-select:none;transition:background-color .15s,border-color .15s,box-shadow .15s}.geSelChipReadOnly{cursor:default}button.geSelChip,a.geSelChip{cursor:pointer}button.geSelChip:hover,a.geSelChip:hover{background:light-dark(#f0f0f2,#3a3a3c);border-color:light-dark(#b9b9be,#5a5a5e)}button.geSelChip:focus-visible{outline:2px solid light-dark(#0071e3,#0a84ff);outline-offset:1px}.geSelChipEmpty{color:light-dark(#8e8e93,#7a7a7e);border-style:dashed;background:transparent}.geSelChipAll{background:light-dark(#e8f0fe,#10325f);border-color:light-dark(#a3c4f8,#2a5aa8);color:light-dark(#0a4bb0,#7eb1ff)}.geSelChipTags{padding:2px 6px;gap:3px}.geSelChipExpandable::after{content:"";display:inline-block;width:5px;height:5px;margin-left:6px;border:solid currentColor;border-width:0 1.4px 1.4px 0;transform:translateY(-2px) rotate(45deg);opacity:.55}.geSelIconBtn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border-radius:6px;border:1px solid light-dark(#d2d2d7,#48484a);background:light-dark(#ffffff,#1c1c1e);color:light-dark(#3a3a3f,#cfcfd3);cursor:pointer;transition:background-color .15s,border-color .15s,color .15s}.geSelIconBtn:hover{background:light-dark(#f5f5f7,#2c2c2e);border-color:light-dark(#b9b9be,#5a5a5e);color:light-dark(#0071e3,#0a84ff)}.geSelIconBtn:focus-visible{outline:2px solid light-dark(#0071e3,#0a84ff);outline-offset:1px}.geSelIconBtn:active{background:light-dark(#e5e5ea,#3a3a3c)}.geSelIconBtnActive{background:light-dark(#0071e3,#0a84ff);border-color:light-dark(#0071e3,#0a84ff);color:#ffffff}.geSelIconBtnActive:hover{background:light-dark(#0062c4,#1a90ff);border-color:light-dark(#0062c4,#1a90ff);color:#ffffff}.geSelIconBtn svg{display:block}.geTagPicker{position:fixed;z-index:10000;min-width:220px;max-width:300px;background:light-dark(#ffffff,#1c1c1e);border:1px solid light-dark(#d0d0d0,#505050);border-radius:12px;box-shadow:0 4px 16px rgba(0,0,0,0.15);font:12px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:light-dark(#1d1d1f,#e5e5e7);opacity:0;transform:scale(0);transition:transform .2s cubic-bezier(0.34,1.56,0.64,1),opacity .1s ease-out}.geTagPickerOpen{opacity:1;transform:scale(1)}.geTagPickerArrow{position:absolute;top:-7px;width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid light-dark(#d2d2d7,#48484a);pointer-events:none}.geTagPickerArrow::after{content:"";position:absolute;top:1px;left:-6px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid light-dark(#ffffff,#1c1c1e)}.geTagPickerArrowBottom{top:auto;bottom:-7px;border-bottom:none;border-top:7px solid light-dark(#d2d2d7,#48484a)}.geTagPickerArrowBottom::after{top:auto;bottom:1px;border-bottom:none;border-top:6px solid light-dark(#ffffff,#1c1c1e)}.geTagPickerHeader{padding:10px 14px 6px;font-weight:600;color:light-dark(#1d1d1f,#e5e5e7);font-size:12px;letter-spacing:.02em;text-transform:uppercase;opacity:.8}.geTagPickerEmpty{padding:14px 18px;color:light-dark(#8e8e93,#7a7a7e);font-style:italic;text-align:center}.geTagPickerFooter{padding:4px;border-top:1px solid light-dark(#e5e5ea,#3a3a3c)}.geTagPickerModeBar{display:flex;align-items:center;gap:6px;padding:6px 10px 4px}.geTagPickerModeLabel{font-size:11px;font-weight:500;color:light-dark(#6e6e73,#a0a0a0);margin-right:4px}.geTagPickerModeBtn{padding:2px 10px;border-radius:999px;font:inherit;font-size:11px;font-weight:500;cursor:pointer;border:1px solid light-dark(#d2d2d7,#48484a);background:transparent;color:light-dark(#3a3a3f,#cfcfd3);transition:background-color .12s,color .12s,border-color .12s}.geTagPickerModeBtn:hover{background:light-dark(#f0f0f2,#2c2c2e)}.geTagPickerModeBtnActive{background:light-dark(#0071e3,#0a84ff);border-color:light-dark(#0071e3,#0a84ff);color:#ffffff}.geTagPickerModeBtnActive:hover{background:light-dark(#0062c4,#1a90ff);border-color:light-dark(#0062c4,#1a90ff)}.geTagPickerCloud{display:flex;flex-wrap:wrap;gap:6px;padding:8px 10px 12px;max-height:320px;overflow:auto;max-width:320px}.geTagCloudPill{display:inline-block;padding:3px 10px;border-radius:999px;cursor:pointer;font:inherit;font-size:11px;font-weight:500;line-height:1.4;background:light-dark(#e5e5ea,#48484a);color:light-dark(#3a3a3f,#cfcfd3);border:1px solid transparent;white-space:nowrap;transition:background-color .12s,color .12s,border-color .12s}.geTagCloudPill:hover{background:light-dark(#d5d5da,#5a5a5e)}.geTagCloudPillActive{background:light-dark(#d4f0db,#1c4530);color:light-dark(#1f7a3e,#86e0a3);border-color:light-dark(#a8e0b8,#2d6849)}.geTagCloudPillActive:hover{background:light-dark(#c4e8ce,#235c3d)}.geLayerPickerList{display:flex;flex-direction:column;gap:2px;padding:6px 6px 10px;max-height:320px;overflow:auto;min-width:220px}.geLayerPickerRow{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:6px;cursor:pointer;font:inherit;font-size:12px;color:light-dark(#1d1d1f,#e5e5e7);transition:background-color .1s}.geLayerPickerRow:hover{background:light-dark(#f0f0f2,#2c2c2e)}.geLayerPickerRow input[type="checkbox"]{margin:0;flex:0 0 auto}.geLayerPickerRowLabel{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}option.geDeleteOpt{color:light-dark(#d70015,#ff453a);font-weight:500}.geNoSpin{-moz-appearance:textfield;flex:0 0 60px;width:60px;max-width:60px;box-sizing:border-box}.geNoSpin::-webkit-outer-spin-button,.geNoSpin::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.geActionMenuList{padding:4px;min-width:180px}.geActionMenuItem{display:block;width:100%;padding:6px 12px;background:none;border:0;border-radius:6px;text-align:left;font:inherit;font-size:13px;cursor:pointer;color:light-dark(#1d1d1f,#e5e5e7);transition:background-color .1s}.geActionMenuItem:hover{background:light-dark(#f0f0f2,#2c2c2e)}.geActionMenuItemActive{color:light-dark(#0071e3,#0a84ff);font-weight:600}.geActionMenuItemDanger{color:light-dark(#d70015,#ff453a)}.geActionMenuItemDanger:hover{background:light-dark(#fdf0f0,#3a2020)}.geActionMenuItemDisabled{color:light-dark(#aeaeb2,#636366);cursor:default;pointer-events:none}.geActionMenuSeparator{height:1px;margin:4px 6px;background:light-dark(#e5e5ea,#3a3a3c)}.geAnimationStepActive{background:light-dark(rgba(0,113,227,.10),rgba(10,132,255,.18))}.geAnimationStepSelected{background:light-dark(rgba(0,113,227,.06),rgba(10,132,255,.10))}.geAnimationStepActive.geAnimationStepSelected{background:light-dark(rgba(0,113,227,.16),rgba(10,132,255,.28))}';document.head.appendChild(b)}}function installDialogDocking(b,l){var p=EditorUi.windowed;EditorUi.windowed=!0;try{b.installResizeHandler(l,!0)}finally{EditorUi.windowed=p}}function containDragEvents(b){for(var l="dragstart dragenter dragover dragleave drop dragend".split(" "),p=0;p<l.length;p++)b.addEventListener(l[p],function(g){g.stopPropagation()})}-var SelectorChips={create:function(b,l){function p(F,K,M,L,Q){for(var c=(Array.isArray(K())?K():[]).slice(),f="function"==typeof b.getAllTags?b.getAllTags():[],k=0;k<c.length;k++)0>f.indexOf(c[k])&&f.push(c[k]);f.sort();K=document.createElement("div");if(0==f.length)f=document.createElement("div"),f.className="geTagPickerEmpty",mxUtils.write(f,mxResources.get("noTagsInDiagram",null,"No tags in this diagram yet.")),K.appendChild(f);else{var n="function"==typeof L?L()||"and":null;if("function"==typeof Q){L=-document.createElement("div");L.className="geTagPickerModeBar";k=document.createElement("span");k.className="geTagPickerModeLabel";mxUtils.write(k,mxResources.get("match",null,"Match")+":");L.appendChild(k);var q=document.createElement("button");q.type="button";q.className="geTagPickerModeBtn";mxUtils.write(q,mxResources.get("matchAll",null,"All"));q.title=mxResources.get("matchAllHint",null,"Match cells that have every selected tag (AND)");var t=document.createElement("button");t.type="button";t.className=-"geTagPickerModeBtn";mxUtils.write(t,mxResources.get("matchAny",null,"Any"));t.title=mxResources.get("matchAnyHint",null,"Match cells that have at least one selected tag (OR)");var u=function(){q.classList.toggle("geTagPickerModeBtnActive","and"===n);t.classList.toggle("geTagPickerModeBtnActive","or"===n)};u();q.addEventListener("click",function(J){J.preventDefault();n="and";Q("and");u()});t.addEventListener("click",function(J){J.preventDefault();n="or";Q("or");u()});L.appendChild(q);L.appendChild(t);-K.appendChild(L)}var y=document.createElement("div");y.className="geTagPickerCloud";var E=[];for(k=0;k<f.length;k++)(function(J){var S=document.createElement("button");S.type="button";S.className="geTagCloudPill";S.title=J;S.textContent=J;var N=function(){S.classList.toggle("geTagCloudPillActive",0<=c.indexOf(J))};N();E.push(N);S.addEventListener("click",function(R){R.preventDefault();R=c.indexOf(J);0<=R?c.splice(R,1):c.push(J);M(c.slice());N();U()});y.appendChild(S)})(f[k]);K.appendChild(y);f=document.createElement("div");-f.className="geTagPickerFooter";var I=document.createElement("button");I.type="button";I.className="geActionMenuItem";mxUtils.write(I,mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"));I.addEventListener("click",function(J){J.preventDefault();0!=c.length&&(J="function"==typeof b.getCellsForTags?b.getCellsForTags(c,null,null,!0,n):[],0<J.length?b.setSelectionCells(J):b.clearSelection())});f.appendChild(I);var C=document.createElement("button");C.type="button";C.className="geActionMenuItem geActionMenuItemDanger";-mxUtils.write(C,mxResources.get("reset",null,"Reset"));C.addEventListener("click",function(J){J.preventDefault();c=[];M([]);for(J=0;J<E.length;J++)E[J]();U()});f.appendChild(C);K.appendChild(f);var U=function(){var J=0==c.length;I.classList.toggle("geActionMenuItemDisabled",J);I.disabled=J;C.classList.toggle("geActionMenuItemDisabled",J);C.disabled=J};U()}B(F,mxResources.get("tags",null,"Tags"),K)}function g(){for(var F=b.getModel(),K=F.getRoot(),M=F.getChildCount(K),L=[],Q=0;Q<M;Q++){var c=F.getChildAt(K,-Q);if(null!=c){var f=b.convertValueToString(c);if(null==f||""===f)f=0==Q?mxResources.get("background",null,"Background"):mxResources.get("untitledLayer",null,"Untitled Layer");L.push({id:c.id,name:f,cell:c})}}return L}function x(F,K,M){var L=(Array.isArray(K())?K():[]).slice(),Q=g();K=document.createElement("div");var c=document.createElement("div");c.className="geLayerPickerList";for(var f=[],k=0;k<Q.length;k++)(function(u){var y=document.createElement("label");y.className="geLayerPickerRow";y.title=-u.name;var E=document.createElement("input");E.type="checkbox";E.checked=0<=L.indexOf(u.id);y.appendChild(E);var I=document.createElement("span");I.className="geLayerPickerRowLabel";mxUtils.write(I,u.name);y.appendChild(I);f.push(function(){E.checked=0<=L.indexOf(u.id)});E.addEventListener("change",function(){var C=L.indexOf(u.id);E.checked&&0>C?L.push(u.id):!E.checked&&0<=C&&L.splice(C,1);M(L.slice());t()});c.appendChild(y)})(Q[k]);K.appendChild(c);Q=document.createElement("div");Q.className="geTagPickerFooter";-var n=document.createElement("button");n.type="button";n.className="geActionMenuItem";mxUtils.write(n,mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"));n.addEventListener("click",function(u){u.preventDefault();0!=L.length&&(u="function"==typeof b.getCellsForLayers?b.getCellsForLayers(L):[],0<u.length?b.setSelectionCells(u):b.clearSelection())});Q.appendChild(n);var q=document.createElement("button");q.type="button";q.className="geActionMenuItem geActionMenuItemDanger";mxUtils.write(q,-mxResources.get("reset",null,"Reset"));q.addEventListener("click",function(u){u.preventDefault();L=[];M([]);for(u=0;u<f.length;u++)f[u]();t()});Q.appendChild(q);K.appendChild(Q);var t=function(){var u=0==L.length;n.classList.toggle("geActionMenuItemDisabled",u);n.disabled=u;q.classList.toggle("geActionMenuItemDisabled",u);q.disabled=u};t();B(F,mxResources.get("selectLayers",null,"Layers"),K)}function B(F,K,M){function L(){document.removeEventListener("mousedown",Q,!0);window.removeEventListener("resize",-L);window.removeEventListener("scroll",L,!0);c.parentNode&&c.parentNode.removeChild(c);B._open===u&&(B._open=null)}function Q(y){c.contains(y.target)||F.contains(y.target)||null!=b.container&&b.container.contains(y.target)||L()}null!=B._open&&B._open.close();var c=document.createElement("div");c.className="geTagPicker";var f=document.createElement("div");f.className="geTagPickerArrow";c.appendChild(f);if(K){var k=document.createElement("div");k.className="geTagPickerHeader";mxUtils.write(k,K);c.appendChild(k)}c.appendChild(M);-document.body.appendChild(c);k=F.getBoundingClientRect();var n=c.offsetWidth;K=c.offsetHeight;var q=k.bottom+6;M=!1;q+K>window.innerHeight-12&&(q=Math.max(8,k.top-K-6),f.classList.add("geTagPickerArrowBottom"),M=!0);var t=k.left;t+n>window.innerWidth-8&&(t=Math.max(8,window.innerWidth-n-8));c.style.top=q+"px";c.style.left=t+"px";k=Math.min(n-24,Math.max(12,k.left+k.width/2-t-6));f.style.left=k+"px";c.style.transformOrigin=k+6+"px "+(M?K+"px":"0px");requestAnimationFrame(function(){c.classList.add("geTagPickerOpen")});-document.addEventListener("mousedown",Q,!0);window.addEventListener("resize",L);window.addEventListener("scroll",L,!0);var u={close:L,anchor:F};return B._open=u}function z(F,K){var M=document.createElement("div");M.className="geActionMenuList";for(var L=[],Q,c=0;c<K.length;c++)(function(n){if(n.separator){var q=document.createElement("div");q.className="geActionMenuSeparator";M.appendChild(q)}else{var t=document.createElement("button");t.type="button";t.className="geActionMenuItem";n.danger&&t.classList.add("geActionMenuItemDanger");-n.active&&t.classList.add("geActionMenuItemActive");var u=function(){return"function"==typeof n.disabled?!!n.disabled():!!n.disabled};q=function(){var y=u();t.classList.toggle("geActionMenuItemDisabled",y);t.disabled=y};q();L.push(q);mxUtils.write(t,n.label);t.addEventListener("click",function(y){y.preventDefault();u()||(Q&&Q.close(),n.onClick(F))});M.appendChild(t)}})(K[c]);Q=B(F,null,M);var f=function(){for(var n=0;n<L.length;n++)L[n]()};b.getSelectionModel().addListener(mxEvent.CHANGE,f);var k=-Q.close;Q.close=function(){b.getSelectionModel().removeListener(f);k()};return Q}installCustomActionStyles();return{cellListField:function(F,K,M,L){L=L||{};var Q=L.singularKey||"cell",c=L.pluralKey||"cells",f=L.singularFallback||"cell",k=L.pluralFallback||"cells",n=L.emptyKey||"select",q=L.emptyFallback||"Select",t=document.createElement("div");t.className="geSelField";if(F){var u=document.createElement("span");u.className="geSelFieldLabel";mxUtils.write(u,F);t.appendChild(u)}var y=document.createElement("button");-y.type="button";y.className="geSelChip geSelChipExpandable";var E=null,I=function(){var J=K();return Array.isArray(J)&&1==J.length&&"*"===J[0]},C=function(){var J=K();return Array.isArray(J)&&0<J.length},U=function(){var J=K(),S=Array.isArray(J)&&!I()?J.length:0;y.textContent="";y.classList.remove("geSelChipEmpty","geSelChipAll");y.title="";I()?(y.classList.add("geSelChipAll"),mxUtils.write(y,mxResources.get("allCells",null,"All cells"))):0==S?(y.classList.add("geSelChipEmpty"),mxUtils.write(y,mxResources.get(n,-null,q))):(mxUtils.write(y,S+" "+(1==S?mxResources.get(Q,null,f):mxResources.get(c,null,k))),y.title=J.join("\n"))};y.addEventListener("click",function(J){J.preventDefault();if(null!=B._open&&B._open.anchor===y)B._open.close();else{J=[];J.push({label:mxResources.get("useSelection",null,"Use selection"),disabled:function(){return 0==b.getSelectionCount()},onClick:function(){var N=b.getSelectionCells();0!=N.length&&(M(N.map(function(R){return R.id})),U())}});L.allowWildcard&&J.push({label:mxResources.get("allCells",-null,"All cells"),active:I(),onClick:function(){if(I())M(E),E=null;else{var N=K();E=Array.isArray(N)?N.slice():null;M(["*"])}U()}});C()&&(J.push({label:mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"),onClick:function(){for(var N=K(),R=[],T=0;T<N.length;T++){if("*"===N[T]){R=b.model.getDescendants(b.model.getRoot());break}var v=b.model.getCell(N[T]);null!=v&&R.push(v)}0<R.length?b.setSelectionCells(R):b.clearSelection()}}),J.push({separator:!0}),J.push({label:mxResources.get("reset",-null,"Reset"),danger:!0,onClick:function(){M(null);E=null;U()}}));if(Array.isArray(L.extraMenuItems)&&0<L.extraMenuItems.length){0<J.length&&!J[J.length-1].separator&&J.push({separator:!0});for(var S=0;S<L.extraMenuItems.length;S++)J.push(L.extraMenuItems[S])}z(y,J)}});t.appendChild(y);U();return t},tagListField:function(F,K,M,L){L=L||{};var Q=document.createElement("div");Q.className="geSelField";if(F){var c=document.createElement("span");c.className="geSelFieldLabel";mxUtils.write(c,F);Q.appendChild(c)}var f=-document.createElement("button");f.type="button";f.className="geSelChip geSelChipExpandable";var k=function(){var n=K(),q=Array.isArray(n)?n.length:0;f.textContent="";f.classList.remove("geSelChipEmpty");f.title="";0==q?(f.classList.add("geSelChipEmpty"),mxUtils.write(f,mxResources.get("tags",null,"Tags"))):(mxUtils.write(f,q+" "+(1==q?mxResources.get("tag",null,"Tag"):mxResources.get("tags",null,"Tags"))),f.title=n.join("\n"))};f.addEventListener("click",function(n){n.preventDefault();null!=B._open&&-B._open.anchor===f?B._open.close():p(f,K,function(q){M(q);k()},L.getMode,L.setMode)});Q.appendChild(f);k();return Q},layerListField:function(F,K,M){var L=document.createElement("div");L.className="geSelField";if(F){var Q=document.createElement("span");Q.className="geSelFieldLabel";mxUtils.write(Q,F);L.appendChild(Q)}var c=document.createElement("button");c.type="button";c.className="geSelChip geSelChipExpandable";var f=function(){var k=K(),n=Array.isArray(k)?k.length:0;c.textContent="";c.classList.remove("geSelChipEmpty");-c.title="";if(0==n)c.classList.add("geSelChipEmpty"),mxUtils.write(c,mxResources.get("layers",null,"Layers"));else{mxUtils.write(c,n+" "+(1==n?mxResources.get("layer",null,"Layer"):mxResources.get("layers",null,"Layers")));n=[];for(var q=b.getModel(),t=0;t<k.length;t++){var u=q.getCell(k[t]);null!=u?(u=b.convertValueToString(u),n.push(null!=u&&""!==u?u:k[t])):n.push(k[t])}c.title=n.join("\n")}};c.addEventListener("click",function(k){k.preventDefault();null!=B._open&&B._open.anchor===c?B._open.close():-x(c,K,function(n){M(n);f()})});L.appendChild(c);f();return L},iconButton:function(F,K,M){var L=document.createElement("button");L.type="button";L.title=K;L.className="geSelIconBtn";L.innerHTML=SELECTOR_ICONS[F];L.addEventListener("click",function(Q){Q.preventDefault();M(Q)});return L},openTagPicker:p,openLayerPicker:x,closePopover:function(){null!=B._open&&B._open.close()}}}},CustomActionDialog=function(b,l,p){installCustomActionStyles();var g={steps:[]};if(null!=l&&"data:action/json,"==l.substring(0,-17))try{var x=JSON.parse(l.substring(17));if(Array.isArray(x.actions)){l=[];for(var B=0;B<x.actions.length;B++){var z=x.actions[B];if(z&&z.animation&&Array.isArray(z.animation.steps))for(var F=0;F<z.animation.steps.length;F++)l.push(z.animation.steps[F]);else l.push(z)}g.steps=l}"string"==typeof x.title&&""!==x.title&&(g.title=x.title)}catch(K){}x=mxSettings.getWindowState("customAction");z=null!=x&&null!=x.w?x.w:700;g=new AnimationDialog(b,null!=x&&null!=x.x?x.x:Math.max(40,(document.body.offsetWidth--z)/2),null!=x&&null!=x.y?x.y:80,z,null!=x&&null!=x.h?x.h:560,{kind:"action",showTitle:!0,windowTitleKey:"action",windowTitleFallback:"Action",initial:g,save:function(K){var M={actions:K.steps};K.title&&(M.title=K.title);p("data:action/json,"+JSON.stringify(M))}});b.installWindowPersistence("customAction",g);null!=x&&(b.restoreWindowState("customAction",g),g.window.setVisible(!0));return g};+var SelectorChips={create:function(b,l){function p(G,L,O,J,Q){for(var c=(Array.isArray(L())?L():[]).slice(),f="function"==typeof b.getAllTags?b.getAllTags():[],k=0;k<c.length;k++)0>f.indexOf(c[k])&&f.push(c[k]);f.sort();L=document.createElement("div");if(0==f.length)f=document.createElement("div"),f.className="geTagPickerEmpty",mxUtils.write(f,mxResources.get("noTagsInDiagram",null,"No tags in this diagram yet.")),L.appendChild(f);else{var n="function"==typeof J?J()||"and":null;if("function"==typeof Q){J=+document.createElement("div");J.className="geTagPickerModeBar";k=document.createElement("span");k.className="geTagPickerModeLabel";mxUtils.write(k,mxResources.get("match",null,"Match")+":");J.appendChild(k);var q=document.createElement("button");q.type="button";q.className="geTagPickerModeBtn";mxUtils.write(q,mxResources.get("matchAll",null,"All"));q.title=mxResources.get("matchAllHint",null,"Match cells that have every selected tag (AND)");var t=document.createElement("button");t.type="button";t.className=+"geTagPickerModeBtn";mxUtils.write(t,mxResources.get("matchAny",null,"Any"));t.title=mxResources.get("matchAnyHint",null,"Match cells that have at least one selected tag (OR)");var u=function(){q.classList.toggle("geTagPickerModeBtnActive","and"===n);t.classList.toggle("geTagPickerModeBtnActive","or"===n)};u();q.addEventListener("click",function(K){K.preventDefault();n="and";Q("and");u()});t.addEventListener("click",function(K){K.preventDefault();n="or";Q("or");u()});J.appendChild(q);J.appendChild(t);+L.appendChild(J)}var B=document.createElement("div");B.className="geTagPickerCloud";var E=[];for(k=0;k<f.length;k++)(function(K){var S=document.createElement("button");S.type="button";S.className="geTagCloudPill";S.title=K;S.textContent=K;var M=function(){S.classList.toggle("geTagCloudPillActive",0<=c.indexOf(K))};M();E.push(M);S.addEventListener("click",function(R){R.preventDefault();R=c.indexOf(K);0<=R?c.splice(R,1):c.push(K);O(c.slice());M();U()});B.appendChild(S)})(f[k]);L.appendChild(B);f=document.createElement("div");+f.className="geTagPickerFooter";var I=document.createElement("button");I.type="button";I.className="geActionMenuItem";mxUtils.write(I,mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"));I.addEventListener("click",function(K){K.preventDefault();0!=c.length&&(K="function"==typeof b.getCellsForTags?b.getCellsForTags(c,null,null,!0,n):[],0<K.length?b.setSelectionCells(K):b.clearSelection())});f.appendChild(I);var C=document.createElement("button");C.type="button";C.className="geActionMenuItem geActionMenuItemDanger";+mxUtils.write(C,mxResources.get("reset",null,"Reset"));C.addEventListener("click",function(K){K.preventDefault();c=[];O([]);for(K=0;K<E.length;K++)E[K]();U()});f.appendChild(C);L.appendChild(f);var U=function(){var K=0==c.length;I.classList.toggle("geActionMenuItemDisabled",K);I.disabled=K;C.classList.toggle("geActionMenuItemDisabled",K);C.disabled=K};U()}A(G,mxResources.get("tags",null,"Tags"),L)}function g(){for(var G=b.getModel(),L=G.getRoot(),O=G.getChildCount(L),J=[],Q=0;Q<O;Q++){var c=G.getChildAt(L,+Q);if(null!=c){var f=b.convertValueToString(c);if(null==f||""===f)f=0==Q?mxResources.get("background",null,"Background"):mxResources.get("untitledLayer",null,"Untitled Layer");J.push({id:c.id,name:f,cell:c})}}return J}function x(G,L,O){var J=(Array.isArray(L())?L():[]).slice(),Q=g();L=document.createElement("div");var c=document.createElement("div");c.className="geLayerPickerList";for(var f=[],k=0;k<Q.length;k++)(function(u){var B=document.createElement("label");B.className="geLayerPickerRow";B.title=+u.name;var E=document.createElement("input");E.type="checkbox";E.checked=0<=J.indexOf(u.id);B.appendChild(E);var I=document.createElement("span");I.className="geLayerPickerRowLabel";mxUtils.write(I,u.name);B.appendChild(I);f.push(function(){E.checked=0<=J.indexOf(u.id)});E.addEventListener("change",function(){var C=J.indexOf(u.id);E.checked&&0>C?J.push(u.id):!E.checked&&0<=C&&J.splice(C,1);O(J.slice());t()});c.appendChild(B)})(Q[k]);L.appendChild(c);Q=document.createElement("div");Q.className="geTagPickerFooter";+var n=document.createElement("button");n.type="button";n.className="geActionMenuItem";mxUtils.write(n,mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"));n.addEventListener("click",function(u){u.preventDefault();0!=J.length&&(u="function"==typeof b.getCellsForLayers?b.getCellsForLayers(J):[],0<u.length?b.setSelectionCells(u):b.clearSelection())});Q.appendChild(n);var q=document.createElement("button");q.type="button";q.className="geActionMenuItem geActionMenuItemDanger";mxUtils.write(q,+mxResources.get("reset",null,"Reset"));q.addEventListener("click",function(u){u.preventDefault();J=[];O([]);for(u=0;u<f.length;u++)f[u]();t()});Q.appendChild(q);L.appendChild(Q);var t=function(){var u=0==J.length;n.classList.toggle("geActionMenuItemDisabled",u);n.disabled=u;q.classList.toggle("geActionMenuItemDisabled",u);q.disabled=u};t();A(G,mxResources.get("selectLayers",null,"Layers"),L)}function A(G,L,O){function J(){document.removeEventListener("mousedown",Q,!0);window.removeEventListener("resize",+J);window.removeEventListener("scroll",J,!0);c.parentNode&&c.parentNode.removeChild(c);A._open===u&&(A._open=null)}function Q(B){c.contains(B.target)||G.contains(B.target)||null!=b.container&&b.container.contains(B.target)||J()}null!=A._open&&A._open.close();var c=document.createElement("div");c.className="geTagPicker";var f=document.createElement("div");f.className="geTagPickerArrow";c.appendChild(f);if(L){var k=document.createElement("div");k.className="geTagPickerHeader";mxUtils.write(k,L);c.appendChild(k)}c.appendChild(O);+document.body.appendChild(c);k=G.getBoundingClientRect();var n=c.offsetWidth;L=c.offsetHeight;var q=k.bottom+6;O=!1;q+L>window.innerHeight-12&&(q=Math.max(8,k.top-L-6),f.classList.add("geTagPickerArrowBottom"),O=!0);var t=k.left;t+n>window.innerWidth-8&&(t=Math.max(8,window.innerWidth-n-8));c.style.top=q+"px";c.style.left=t+"px";k=Math.min(n-24,Math.max(12,k.left+k.width/2-t-6));f.style.left=k+"px";c.style.transformOrigin=k+6+"px "+(O?L+"px":"0px");requestAnimationFrame(function(){c.classList.add("geTagPickerOpen")});+document.addEventListener("mousedown",Q,!0);window.addEventListener("resize",J);window.addEventListener("scroll",J,!0);var u={close:J,anchor:G};return A._open=u}function y(G,L){var O=document.createElement("div");O.className="geActionMenuList";for(var J=[],Q,c=0;c<L.length;c++)(function(n){if(n.separator){var q=document.createElement("div");q.className="geActionMenuSeparator";O.appendChild(q)}else{var t=document.createElement("button");t.type="button";t.className="geActionMenuItem";n.danger&&t.classList.add("geActionMenuItemDanger");+n.active&&t.classList.add("geActionMenuItemActive");var u=function(){return"function"==typeof n.disabled?!!n.disabled():!!n.disabled};q=function(){var B=u();t.classList.toggle("geActionMenuItemDisabled",B);t.disabled=B};q();J.push(q);mxUtils.write(t,n.label);t.addEventListener("click",function(B){B.preventDefault();u()||(Q&&Q.close(),n.onClick(G))});O.appendChild(t)}})(L[c]);Q=A(G,null,O);var f=function(){for(var n=0;n<J.length;n++)J[n]()};b.getSelectionModel().addListener(mxEvent.CHANGE,f);var k=+Q.close;Q.close=function(){b.getSelectionModel().removeListener(f);k()};return Q}installCustomActionStyles();return{cellListField:function(G,L,O,J){J=J||{};var Q=J.singularKey||"cell",c=J.pluralKey||"cells",f=J.singularFallback||"cell",k=J.pluralFallback||"cells",n=J.emptyKey||"select",q=J.emptyFallback||"Select",t=document.createElement("div");t.className="geSelField";if(G){var u=document.createElement("span");u.className="geSelFieldLabel";mxUtils.write(u,G);t.appendChild(u)}var B=document.createElement("button");+B.type="button";B.className="geSelChip geSelChipExpandable";var E=null,I=function(){var K=L();return Array.isArray(K)&&1==K.length&&"*"===K[0]},C=function(){var K=L();return Array.isArray(K)&&0<K.length},U=function(){var K=L(),S=Array.isArray(K)&&!I()?K.length:0;B.textContent="";B.classList.remove("geSelChipEmpty","geSelChipAll");B.title="";I()?(B.classList.add("geSelChipAll"),mxUtils.write(B,mxResources.get("allCells",null,"All cells"))):0==S?(B.classList.add("geSelChipEmpty"),mxUtils.write(B,mxResources.get(n,+null,q))):(mxUtils.write(B,S+" "+(1==S?mxResources.get(Q,null,f):mxResources.get(c,null,k))),B.title=K.join("\n"))};B.addEventListener("click",function(K){K.preventDefault();if(null!=A._open&&A._open.anchor===B)A._open.close();else{K=[];K.push({label:mxResources.get("useSelection",null,"Use selection"),disabled:function(){return 0==b.getSelectionCount()},onClick:function(){var M=b.getSelectionCells();0!=M.length&&(O(M.map(function(R){return R.id})),U())}});J.allowWildcard&&K.push({label:mxResources.get("allCells",+null,"All cells"),active:I(),onClick:function(){if(I())O(E),E=null;else{var M=L();E=Array.isArray(M)?M.slice():null;O(["*"])}U()}});C()&&(K.push({label:mxResources.get("selectCellsInDiagram",null,"Select cells in diagram"),onClick:function(){for(var M=L(),R=[],T=0;T<M.length;T++){if("*"===M[T]){R=b.model.getDescendants(b.model.getRoot());break}var v=b.model.getCell(M[T]);null!=v&&R.push(v)}0<R.length?b.setSelectionCells(R):b.clearSelection()}}),K.push({separator:!0}),K.push({label:mxResources.get("reset",+null,"Reset"),danger:!0,onClick:function(){O(null);E=null;U()}}));if(Array.isArray(J.extraMenuItems)&&0<J.extraMenuItems.length){0<K.length&&!K[K.length-1].separator&&K.push({separator:!0});for(var S=0;S<J.extraMenuItems.length;S++)K.push(J.extraMenuItems[S])}y(B,K)}});t.appendChild(B);U();return t},tagListField:function(G,L,O,J){J=J||{};var Q=document.createElement("div");Q.className="geSelField";if(G){var c=document.createElement("span");c.className="geSelFieldLabel";mxUtils.write(c,G);Q.appendChild(c)}var f=+document.createElement("button");f.type="button";f.className="geSelChip geSelChipExpandable";var k=function(){var n=L(),q=Array.isArray(n)?n.length:0;f.textContent="";f.classList.remove("geSelChipEmpty");f.title="";0==q?(f.classList.add("geSelChipEmpty"),mxUtils.write(f,mxResources.get("tags",null,"Tags"))):(mxUtils.write(f,q+" "+(1==q?mxResources.get("tag",null,"Tag"):mxResources.get("tags",null,"Tags"))),f.title=n.join("\n"))};f.addEventListener("click",function(n){n.preventDefault();null!=A._open&&+A._open.anchor===f?A._open.close():p(f,L,function(q){O(q);k()},J.getMode,J.setMode)});Q.appendChild(f);k();return Q},layerListField:function(G,L,O){var J=document.createElement("div");J.className="geSelField";if(G){var Q=document.createElement("span");Q.className="geSelFieldLabel";mxUtils.write(Q,G);J.appendChild(Q)}var c=document.createElement("button");c.type="button";c.className="geSelChip geSelChipExpandable";var f=function(){var k=L(),n=Array.isArray(k)?k.length:0;c.textContent="";c.classList.remove("geSelChipEmpty");+c.title="";if(0==n)c.classList.add("geSelChipEmpty"),mxUtils.write(c,mxResources.get("layers",null,"Layers"));else{mxUtils.write(c,n+" "+(1==n?mxResources.get("layer",null,"Layer"):mxResources.get("layers",null,"Layers")));n=[];for(var q=b.getModel(),t=0;t<k.length;t++){var u=q.getCell(k[t]);null!=u?(u=b.convertValueToString(u),n.push(null!=u&&""!==u?u:k[t])):n.push(k[t])}c.title=n.join("\n")}};c.addEventListener("click",function(k){k.preventDefault();null!=A._open&&A._open.anchor===c?A._open.close():+x(c,L,function(n){O(n);f()})});J.appendChild(c);f();return J},iconButton:function(G,L,O){var J=document.createElement("button");J.type="button";J.title=L;J.className="geSelIconBtn";J.innerHTML=SELECTOR_ICONS[G];J.addEventListener("click",function(Q){Q.preventDefault();O(Q)});return J},openTagPicker:p,openLayerPicker:x,closePopover:function(){null!=A._open&&A._open.close()}}}},CustomActionDialog=function(b,l,p){installCustomActionStyles();var g={steps:[]};if(null!=l&&"data:action/json,"==l.substring(0,+17))try{var x=JSON.parse(l.substring(17));if(Array.isArray(x.actions)){l=[];for(var A=0;A<x.actions.length;A++){var y=x.actions[A];if(y&&y.animation&&Array.isArray(y.animation.steps))for(var G=0;G<y.animation.steps.length;G++)l.push(y.animation.steps[G]);else l.push(y)}g.steps=l}"string"==typeof x.title&&""!==x.title&&(g.title=x.title)}catch(L){}x=mxSettings.getWindowState("customAction");y=null!=x&&null!=x.w?x.w:700;g=new AnimationDialog(b,null!=x&&null!=x.x?x.x:Math.max(40,(document.body.offsetWidth-+y)/2),null!=x&&null!=x.y?x.y:80,y,null!=x&&null!=x.h?x.h:560,{kind:"action",showTitle:!0,windowTitleKey:"action",windowTitleFallback:"Action",initial:g,save:function(L){var O={actions:L.steps};L.title&&(O.title=L.title);p("data:action/json,"+JSON.stringify(O))}});b.installWindowPersistence("customAction",g);null!=x&&(b.restoreWindowState("customAction",g),g.window.setVisible(!0));return g};CustomActionDialog.SCHEMAS={toggle:{label:"Toggle",icon:"⇄",selector:!0,allowLayers:!0},show:{label:"Show",icon:"✓",selector:!0,allowLayers:!0},hide:{label:"Hide",icon:"✗",selector:!0,allowLayers:!0},select:{label:"Select",icon:"☑",selector:!0,allowLayers:!0},scroll:{label:"Scroll To",icon:"↓",selector:!0,allowLayers:!0,fields:[{name:"border",type:"number",placeholder:"0",width:36,label:"",titleKey:"border",title:"Border"},{name:"smooth",type:"checkbox",labelKey:"transition",label:"Transition"}]},opacity:{label:"Set Opacity",icon:"◐",selector:!0,allowLayers:!0,fields:[{name:"value",type:"number",min:0,max:1,step:.1,def:"1",width:50,label:"",titleKey:"opacity",title:"Opacity"}]},fadeIn:{label:"Fade In",icon:"↗",selector:!0,allowLayers:!0,fields:[{name:"delay",type:"number",min:0,step:100,width:50,placeholder:"400",label:"ms",titleKey:"duration",title:"Duration (ms)"}]},fadeOut:{label:"Fade Out",icon:"↘",selector:!0,allowLayers:!0,fields:[{name:"delay",type:"number",min:0,step:100,width:50,placeholder:"400",label:"ms",titleKey:"duration",title:"Duration (ms)"}]},fadeTo:{label:"Fade To",icon:"◐",selector:!0,allowLayers:!0,fields:[{name:"value",type:"number",min:0,max:1,step:.1,def:"0.5",width:50,label:"",titleKey:"opacity",title:"Opacity"},{name:"delay",type:"number",min:0,step:100,width:50,placeholder:"400",label:"ms",titleKey:"duration",title:"Duration (ms)"}]},wipeIn:{label:"Wipe In",icon:"→",selector:!0,allowLayers:!0},wipeOut:{label:"Wipe Out",icon:"←",selector:!0,allowLayers:!0},@@ -12958,359 +12961,359 @@ titleKey:"opacity",title:"Opacity"}]},style:{label:"Set Style",icon:"\ud83c\udfalabel:"",title:"Default value"}]},flow:{label:"Flow",icon:"➡",selector:!0,allowLayers:!0,fields:[{name:"start",type:"select",options:[{value:"",label:"(toggle)"},{value:"true",label:"On"},{value:"false",label:"Off"}],label:""}]},wait:{label:"Wait",icon:"⏱",noSelector:!0,primary:{name:"value",type:"number",min:0,step:100,width:60,def:"1000",label:"ms",titleKey:"wait",title:"Wait"}},open:{label:"Open Link",icon:"\ud83d\udd17",noSelector:!0,primary:{name:"value",type:"text",placeholder:"https://… or data:page/id,…",label:"",title:"URL"}},viewbox:{label:"View",labelKey:"view",icon:"⊞",noSelector:!0,fields:[{name:"x",type:"number",placeholder:"x",width:36,label:"",title:"X"},{name:"y",type:"number",placeholder:"y",width:36,label:"",title:"Y"},{name:"width",type:"number",placeholder:"w",width:36,label:"",titleKey:"width",title:"Width"},{name:"height",type:"number",placeholder:"h",width:36,label:"",titleKey:"height",title:"Height"},{name:"border",type:"number",placeholder:"b",width:36,label:"",titleKey:"border",title:"Border"},{name:"smooth",type:"checkbox",labelKey:"transition",label:"Transition"}]},tags:{label:"Toggle Tags",icon:"\ud83c\udff7",noSelector:!0,fields:[{name:"toggle",type:"tagList",labelKey:"toggle",label:"Toggle",modeField:"toggleMatch"},{name:"hidden",type:"tagList",labelKey:"hide",label:"Hide",modeField:"hiddenMatch"},{name:"visible",type:"tagList",labelKey:"show",label:"Show",modeField:"visibleMatch"}]}};-var RevisionDialog=function(b,l,p){var g=document.createElement("div"),x=document.createElement("h3");x.style.marginTop="3px";mxUtils.write(x,mxResources.get("revisionHistory"));g.appendChild(x);x=document.createElement("div");x.style.position="absolute";x.style.overflow="auto";x.style.width="170px";x.style.height="378px";g.appendChild(x);var B=document.createElement("div");B.style.position="absolute";B.style.left="200px";B.style.width="470px";B.style.height="376px";B.style.overflow="hidden";B.style.borderWidth=-"1px";B.style.borderStyle="solid";var z=document.createElement("div");z.style.position="absolute";z.style.display="none";z.style.textAlign="center";z.style.padding="8px";z.style.borderRadius="8px";z.style.left="50%";z.style.top="50%";z.style.whiteSpace="nowrap";z.style.transform="translate(-50%, -50%)";z.style.background="inherit";z.style.border="1px solid";B.appendChild(z);mxEvent.disableContextMenu(B);g.appendChild(B);var F=new Graph(B);F.setTooltips(!1);F.setEnabled(!1);F.setPanning(!0);F.panningHandler.ignoreCell=-!0;F.panningHandler.useLeftButtonForPanning=!0;F.minFitScale=null;F.maxFitScale=null;F.centerZoom=!0;var K=0,M=null,L=0,Q=F.getGlobalVariable;F.getGlobalVariable=function(W){return"page"==W&&null!=M&&null!=M[L]?M[L].getAttribute("name"):"pagenumber"==W?L+1:"pagecount"==W?null!=M?M.length:1:Q.apply(this,arguments)};F.getLinkForCell=function(){return null};for(var c=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"light-dark(#000000, #C0C0C0)",speed:1.4,trail:60,-shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),f=b.getCurrentFile(),k=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),n={},q=0;q<k.length;q++)n[k[q].getAttribute("id")]=k[q];var t=null,u=null,y=null,E=null,I=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=y&&F.zoomIn()},20);I.setAttribute("disabled","disabled");var C=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=y&&F.zoomOut()},20);C.setAttribute("disabled",-"disabled");var U=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){null!=y&&(1==F.view.scale?(F.maxFitScale=8,F.fit(8)):F.zoomActual(),F.center())},20);U.setAttribute("disabled","disabled");var J=b.createToolbarButton(Editor.compareImage,mxResources.get("compare"));J.setAttribute("disabled","disabled");var S=b.createToolbarButton(Editor.thinDataImage,mxResources.get("merge"));S.setAttribute("disabled","disabled");var N=B.cloneNode(!1);N.style.pointerEvent="none";B.parentNode.appendChild(N);-var R=new Graph(N);R.setTooltips(!1);R.setEnabled(!1);R.setPanning(!0);R.panningHandler.ignoreCell=!0;R.panningHandler.useLeftButtonForPanning=!0;R.minFitScale=null;R.maxFitScale=null;R.centerZoom=!0;var T=document.createElement("div");T.style.textAlign="left";T.style.color="gray";T.style.backgroundColor="transparent";T.style.overflow="hidden";T.style.textOverflow="ellipsis";T.style.whiteSpace="nowrap";T.style.cursor="default";T.style.height="100%";T.style.display="inline-flex";T.style.alignItems=-"center";T.style.flexGrow="1";mxEvent.addListener(T,"click",function(){var W=mxUtils.getTextContent(T);""!=W&&b.alert(W)});var v=null;mxEvent.addGestureListeners(J,function(W){try{var Z=null!=M[K]?n[M[K].getAttribute("id")]:null;mxUtils.setOpacity(J,20);z.innerText="";if(null==Z)z.style.display="inline-block",mxUtils.write(z,mxResources.get("pageNotFound"));else{v=T.innerHTML;T.innerHTML=mxResources.get("current");B.style.display="none";N.style.display="";N.style.backgroundColor=B.style.backgroundColor;-var X=Editor.parseDiagramNode(Z);(new mxCodec(X.ownerDocument)).decode(X,R.getModel());R.view.scaleAndTranslate(F.view.scale,F.view.translate.x,F.view.translate.y);R.mathEnabled="1"==X.getAttribute("math");R.setAdaptiveColors(X.getAttribute("adaptiveColors"));Editor.MathJaxRender&&R.mathEnabled&&Editor.MathJaxRender(R.container)}}catch(ba){z.style.display="inline-block",z.innerText="",mxUtils.write(z,mxResources.get("pageNotFound")+": "+ba.message)}},null,function(){mxUtils.setOpacity(J,60);z.style.display=-"none";z.innerText="";"none"==B.style.display&&(B.style.display="",T.innerHTML=v,N.style.display="none")});mxEvent.addListener(S,"click",mxUtils.bind(this,function(W){if(null!=y){W=b.getPagesForNode(y.documentElement);var Z=b.diffPages(b.pages,W);W=new TextareaDialog(b,mxResources.get("merge")+":",JSON.stringify(Z,null,2),function(X){try{if(0<X.length&&b.editor.graph.isEnabled()){var ba=[JSON.parse(X)];b.confirm(mxResources.get("areYouSure"),function(){try{f.patch(ba,null,!0,!0),b.hideDialog(),b.hideDialog()}catch(ea){b.handleError(ea)}})}else b.hideDialog()}catch(ea){b.handleError(ea)}},-null,null,null,null,function(X,ba){if(null!=Z[EditorUi.DIFF_UPDATE]){var ea=document.createElement("select"),aa=document.createElement("option");mxUtils.write(aa,mxResources.get("allPages"));aa.setAttribute("value","allPages");ea.appendChild(aa);for(var ha in Z[EditorUi.DIFF_UPDATE]){aa=document.createElement("option");var na=b.getPageById(ha);null!=na&&(mxUtils.write(aa,na.getName()),aa.setAttribute("value","page-"+ha),ea.appendChild(aa))}ea.style.marginRight="8px";ea.style.order="-1";mxEvent.addListener(ea,-"change",function(ra){ra=null;if("allPages"!=ea.value){var sa=ea.value.substring(5);null!=Z[EditorUi.DIFF_UPDATE][sa]&&(ra={},ra[EditorUi.DIFF_UPDATE]={},ra[EditorUi.DIFF_UPDATE][sa]=Z[EditorUi.DIFF_UPDATE][sa])}ba.value=JSON.stringify(null==ra?Z:ra,null,2)});2<ea.children.length&&X.appendChild(ea)}},!0,null,mxResources.get(b.editor.graph.isEnabled()?"merge":"close"));b.showDialog(W.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));W.init()}}));var d=mxUtils.button(mxResources.get("restore"),-function(W){null!=y&&null!=E&&b.confirm(mxResources.get("areYouSure"),function(){null!=p?p(E):b.spinner.spin(document.body,mxResources.get("restoring"))&&(d.setAttribute("disabled","disabled"),f.save(!0,function(Z){b.spinner.stop();d.removeAttribute("disabled");b.replaceFileData(E);b.hideDialog()},function(Z){b.spinner.stop();d.removeAttribute("disabled");b.clearStatus();b.handleError(Z,null!=Z?mxResources.get("errorSavingFile"):null)}))})});d.className="geBtn gePrimaryBtn";d.setAttribute("disabled",-"disabled");var m=document.createElement("select");m.setAttribute("disabled","disabled");m.style.userSelect="none";m.style.maxWidth="100px";m.style.marginLeft="10px";m.style.display="none";var r=null;mxEvent.addListener(m,"change",function(W){null!=r&&(r(W),mxEvent.consume(W))});var A=mxUtils.button(mxResources.get("open"),function(){null!=y&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(y.documentElement)),b.openLink(b.getUrl(),null,!0))});-A.className="geBtn";A.setAttribute("disabled","disabled");var D=mxUtils.button(mxResources.get("createRevision"),function(){b.actions.get("save").funct(!1)});D.className="geBtn";D.setAttribute("disabled","disabled");null!=p&&(A.style.display="none");k=document.createElement("div");k.style.position="absolute";k.style.top="482px";k.style.right="28px";k.style.left="32px";k.style.justifyContent="end";k.style.display="flex";var G=document.createElement("div");G.className="geToolbarContainer";G.style.backgroundColor=-"transparent";G.style.left="32px";G.style.right="32px";G.style.border="none";G.style.top="442px";var O=null;if(null!=l&&0<l.length){B.style.cursor="move";var P=document.createElement("table");P.style.borderWidth="1px";P.style.borderStyle="solid";P.style.borderCollapse="collapse";P.style.borderSpacing="0px";P.style.width="100%";var V=document.createElement("tbody"),Y=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(K=mxUtils.indexOf(b.pages,b.currentPage));for(q=l.length-1;0<=q;q--){var H=-function(W){var Z=new Date(W.modifiedDate),X=null;if(0<=Z.getTime()){var ba=function(aa){c.stop();z.innerText="";var ha=mxUtils.parseXml(aa),na=b.editor.extractGraphModel(ha.documentElement,!0);if(null!=na){var ra=function(Aa){null!=Aa&&(Aa=sa(Editor.parseDiagramNode(Aa)));return Aa},sa=function(Aa){var Ba=Aa.getAttribute("background");if(null==Ba||""==Ba||Ba==mxConstants.NONE)Ba=F.defaultPageBackgroundColor;B.style.backgroundColor=mxUtils.getLightDarkColor(Ba);(new mxCodec(Aa.ownerDocument)).decode(Aa,-F.getModel());F.maxFitScale=1;F.fit(8);F.center();F.mathEnabled="1"==Aa.getAttribute("math");F.setAdaptiveColors(Aa.getAttribute("adaptiveColors"));Editor.MathJaxRender&&F.mathEnabled&&Editor.MathJaxRender(F.container);return Aa};m.style.display="none";m.innerText="";y=ha;E=aa;M=parseSelectFunction=null;L=0;if("mxfile"==na.nodeName){ha=na.getElementsByTagName("diagram");M=[];for(aa=0;aa<ha.length;aa++)M.push(ha[aa]);L=Math.min(K,M.length-1);0<M.length&&ra(M[L]);if(1<M.length)for(m.removeAttribute("disabled"),-m.style.display="",aa=0;aa<M.length;aa++){ha=document.createElement("option");ha.setAttribute("title",ua+" ("+M[aa].getAttribute("id")+")");ha.setAttribute("value",aa);var ua=M[aa].getAttribute("name")||mxResources.get("pageWithNumber",[aa+1]);na=b.getPageById(M[aa].getAttribute("id"));var xa="";if(null!=na){var qa=new DiagramPage(M[aa]);b.getHashValueForPages([na])!=b.getHashValueForPages([qa])&&(xa=" (M)")}else xa=" (X)";mxUtils.write(ha,ua+xa);aa==L&&ha.setAttribute("selected","selected");m.appendChild(ha)}r=-function(){try{var Aa=parseInt(m.value);L=K=Aa;ra(M[Aa])}catch(Ba){m.value=K,b.handleError(Ba)}}}else sa(na);ua=W.lastModifyingUserName;null!=ua&&20<ua.length&&(ua=ua.substring(0,20)+"...");T.innerText="";mxUtils.write(T,(null!=ua?ua+" ":"")+Z.toLocaleDateString()+" "+Z.toLocaleTimeString());T.setAttribute("title",X.getAttribute("title"));I.removeAttribute("disabled");C.removeAttribute("disabled");U.removeAttribute("disabled");J.removeAttribute("disabled");S.removeAttribute("disabled");null!=f&&f.isRestricted()||-(b.editor.graph.isEnabled()&&d.removeAttribute("disabled"),A.removeAttribute("disabled"),D.removeAttribute("disabled"));mxUtils.setOpacity(I,60);mxUtils.setOpacity(C,60);mxUtils.setOpacity(U,60);mxUtils.setOpacity(J,60);mxUtils.setOpacity(S,60)}else m.style.display="none",m.innerText="",T.innerText="",z.innerText="",mxUtils.write(T,mxResources.get("errorLoadingFile")),mxUtils.write(z,mxResources.get("errorLoadingFile"))};X=document.createElement("tr");X.style.borderBottomWidth="1px";X.style.borderBottomStyle=-"solid";X.style.fontSize="12px";X.style.cursor="pointer";var ea=document.createElement("td");ea.style.padding="6px";ea.style.whiteSpace="nowrap";W==l[l.length-1]?mxUtils.write(ea,mxResources.get("current")):Z.toDateString()===Y?mxUtils.write(ea,Z.toLocaleTimeString()):mxUtils.write(ea,Z.toLocaleDateString()+" "+Z.toLocaleTimeString());X.appendChild(ea);X.setAttribute("title",Z.toLocaleDateString()+" "+Z.toLocaleTimeString()+(null!=W.fileSize?" "+b.formatFileSize(parseInt(W.fileSize)):"")+(null!=W.lastModifyingUserName?-" "+W.lastModifyingUserName:""));mxEvent.addListener(X,"click",function(aa){u!=W&&(c.stop(),null!=t&&(t.style.backgroundColor=""),u=W,t=X,t.style.backgroundColor="light-dark(#ebf2f9, #000000)",E=y=null,T.removeAttribute("title"),T.innerText=mxResources.get("loading")+"...",B.style.backgroundColor=F.defaultPageBackgroundColor,z.innerText="",F.getModel().clear(),d.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),U.setAttribute("disabled",-"disabled"),J.setAttribute("disabled","disabled"),S.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),m.setAttribute("disabled","disabled"),mxUtils.setOpacity(I,20),mxUtils.setOpacity(C,20),mxUtils.setOpacity(U,20),mxUtils.setOpacity(J,20),mxUtils.setOpacity(S,20),c.spin(B),W.getXml(function(ha){if(u==W)try{ba(ha)}catch(na){T.innerText=mxResources.get("error")+": "+na.message}},function(ha){c.stop();m.style.display="none";m.innerText="";T.innerText="";mxUtils.write(T,mxResources.get("errorLoadingFile"));-mxUtils.write(z,mxResources.get("errorLoadingFile"))}),mxEvent.consume(aa))});mxEvent.addListener(X,"dblclick",function(aa){A.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(aa)},!1);V.appendChild(X)}return X}(l[q]);null!=H&&q==l.length-1&&(O=H)}P.appendChild(V);x.appendChild(P)}else null==f||null==b.drive&&f.constructor==window.DriveFile||null==b.dropbox&&f.constructor==window.DropboxFile?(B.style.display="none",G.style.display=-"none",mxUtils.write(x,mxResources.get("notAvailable"))):(B.style.display="none",G.style.display="none",mxUtils.write(x,mxResources.get("noRevisions")));this.init=function(){null!=O&&O.click()};x=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});x.className="geBtn";G.appendChild(T);G.appendChild(J);G.appendChild(C);G.appendChild(U);G.appendChild(I);G.appendChild(m);G.appendChild(S);b.editor.cancelFirst&&k.appendChild(x);k.appendChild(A);null!=f&&f.constructor==DriveFile&&k.appendChild(D);-k.appendChild(d);b.editor.cancelFirst||k.appendChild(x);g.appendChild(k);g.appendChild(G);this.container=g},RecoveryDialog=function(b,l,p,g){var x=document.createElement("div");x.style.paddingBottom="10px";b=document.createElement("h3");mxUtils.write(b,mxResources.get("recoverTitle"));x.appendChild(b);b=function(z){var F=document.createElement("div");F.className="geDialogSection";F.style.cursor="pointer";F.style.marginBottom="8px";F.style.padding="10px";var K=document.createElement("div");K.style.fontWeight=-"600";K.style.marginBottom="4px";mxUtils.write(K,z.label);F.appendChild(K);null!=z.description&&(K=document.createElement("div"),K.style.fontSize="12px",K.style.opacity="0.75",mxUtils.write(K,z.description),F.appendChild(K));mxEvent.addListener(F,"click",function(){p(z)});x.appendChild(F)};for(var B=0;B<l.length;B++)b(l[B]);l=document.createElement("div");l.style.marginTop="34px";l.style.textAlign="right";b=mxUtils.button(mxResources.get("cancel"),function(){null!=g&&g()});b.className="geBtn";l.appendChild(b);-x.appendChild(l);this.container=x},DraftDialog=function(b,l,p,g,x,B,z,F,K){var M=document.createElement("div"),L=document.createElement("div");L.style.marginTop="0px";L.style.whiteSpace="nowrap";L.style.overflow="auto";L.style.lineHeight="normal";mxUtils.write(L,l);M.appendChild(L);var Q=document.createElement("select"),c=mxUtils.bind(this,function(){"-1"==Q.value?(Q.value=Q.options[0].value,c(),b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var J=this,S;return $jscomp.asyncExecutePromiseGeneratorProgram(function(N){for(S=-0;S<K.length;S++)x.apply(J,[S,mxUtils.bind(J,function(){})]);b.hideDialog(!0);N.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(u=mxUtils.parseXml(K[Q.value].data),y=b.editor.extractGraphModel(u.documentElement,!0),E=0,this.init())});if(null!=K){Q.style.marginLeft="4px";for(l=0;l<K.length;l++){var f=document.createElement("option");f.setAttribute("value",l);var k=new Date(K[l].created),n=new Date(K[l].modified);mxUtils.write(f,k.toLocaleDateString()+" "+k.toLocaleTimeString()+" - "+-(k.toDateString(),n.toDateString(),n.toLocaleDateString())+" "+n.toLocaleTimeString());Q.appendChild(f)}f=document.createElement("option");f.setAttribute("value","-1");mxUtils.write(f,mxResources.get("deleteAll"));Q.appendChild(f);L.appendChild(Q);mxEvent.addListener(Q,"change",c)}null==p&&(p=K[0].data);var q=document.createElement("div");q.style.position="absolute";q.style.border="1px solid lightGray";q.style.marginTop="10px";q.style.left="40px";q.style.right="40px";q.style.top="46px";q.style.bottom=-"74px";q.style.overflow="hidden";mxEvent.disableContextMenu(q);M.appendChild(q);var t=new Graph(q);t.setEnabled(!1);t.setPanning(!0);t.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";t.panningHandler.ignoreCell=!0;t.panningHandler.useLeftButtonForPanning=!0;t.minFitScale=null;t.maxFitScale=null;t.centerZoom=!0;var u=mxUtils.parseXml(p),y=b.editor.extractGraphModel(u.documentElement,!0),E=0,I=null,C=t.getGlobalVariable;t.getGlobalVariable=function(J){return"page"==J&&null!=I&&null!=I[E]?I[E].getAttribute("name"):-"pagenumber"==J?E+1:"pagecount"==J?null!=I?I.length:1:C.apply(this,arguments)};t.getLinkForCell=function(){return null};p=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){t.zoomIn()},20);L=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){t.zoomOut()},20);l=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==t.view.scale?(t.maxFitScale=8,t.fit(8)):t.zoomActual();t.center()},20);z=mxUtils.button(z||mxResources.get("discard"),-function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var J=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(S){x.apply(J,[Q.value,mxUtils.bind(J,function(){null!=Q.parentNode&&(Q.options[Q.selectedIndex].parentNode.removeChild(Q.options[Q.selectedIndex]),1<Q.options.length?(Q.value=Q.options[0].value,c()):b.hideDialog(!0))})]);S.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))});z.className="geBtn";var U=document.createElement("select");-U.style.maxWidth="80px";U.style.position="relative";U.style.top="-2px";U.style.verticalAlign="bottom";U.style.marginRight="6px";U.style.display="none";B=mxUtils.button(B||mxResources.get("edit"),function(){g.apply(this,[Q.value])});B.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.position="absolute";f.style.bottom="30px";f.style.right="40px";f.style.textAlign="right";k=document.createElement("div");k.className="geToolbarContainer";k.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";-this.init=function(){function J(T){if(null!=T){var v=T.getAttribute("background");if(null==v||""==v||v==mxConstants.NONE)v="light-dark(#ffffff, transparent)";q.style.backgroundColor=v;(new mxCodec(T.ownerDocument)).decode(T,t.getModel());t.maxFitScale=1;t.fit(8);t.center()}return T}function S(T){if(null!=T)try{T=J(Editor.parseDiagramNode(T))}catch(v){b.handleError(v)}return T}mxEvent.addListener(U,"change",function(T){E=parseInt(U.value);S(I[E]);mxEvent.consume(T)});if("mxfile"==y.nodeName){var N=-y.getElementsByTagName("diagram");I=[];for(var R=0;R<N.length;R++)I.push(N[R]);0<I.length&&S(I[E]);U.innerText="";if(1<I.length)for(U.style.display="",R=0;R<I.length;R++)N=document.createElement("option"),mxUtils.write(N,I[R].getAttribute("name")||mxResources.get("pageWithNumber",[R+1])),N.setAttribute("value",R),R==E&&N.setAttribute("selected","selected"),U.appendChild(N);else U.style.display="none"}else J(y)};k.appendChild(U);k.appendChild(p);k.appendChild(L);k.appendChild(l);p=mxUtils.button(mxResources.get("cancel"),-function(){b.hideDialog(!0)});p.className="geBtn";F=null!=F?mxUtils.button(mxResources.get("ignore"),F):null;null!=F&&(F.className="geBtn");b.editor.cancelFirst?(f.appendChild(p),null!=F&&f.appendChild(F),f.appendChild(z),f.appendChild(B)):(f.appendChild(B),f.appendChild(z),null!=F&&f.appendChild(F),f.appendChild(p));M.appendChild(f);M.appendChild(k);this.container=M},FindWindow=function(b,l,p,g,x,B){function z(r,A,D){if("object"===typeof A.value&&null!=A.value.attributes){A=A.value.attributes;for(var G=-0;G<A.length;G++)if("label"!=A[G].nodeName){var O=mxUtils.trim(A[G].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==r&&0<=O.indexOf(D)||null!=r&&r.test(O))return!0}}return!1}function F(){f?(v.removeAttribute("disabled"),d.removeAttribute("disabled")):(v.setAttribute("disabled","disabled"),d.setAttribute("disabled","disabled"));E.value?m.removeAttribute("disabled"):m.setAttribute("disabled","disabled")}function K(r,A,D){R.innerText="";var G=L.model.getDescendants(L.model.getRoot()),-O=E.value.toLowerCase(),P=C.checked?new RegExp(O):null,V=null;n=null;Q!=O&&(Q=O,c=null,k=!1);var Y=null==c;if(0<O.length){if(k){k=!1;for(var H,W=0;W<b.pages.length;W++)if(b.currentPage==b.pages[W]){H=W;break}r=(H+1)%b.pages.length;c=null;do k=!1,O=b.pages[r],L=b.createTemporaryGraph(L.getStylesheet()),b.updatePageRoot(O),L.model.setRoot(O.root),r=(r+1)%b.pages.length;while(!K(!0,A,D)&&r!=H);c&&(c=null,D?b.editor.graph.model.execute(new SelectPage(b,O)):b.selectPage(O));k=!1;L=b.editor.graph;return K(!0,-A,D)}for(W=0;W<G.length;W++){H=L.view.getState(G[W]);A&&(Y=Y||H==c);if(null!=H&&null!=H.cell.value&&(Y||null==V)&&(L.model.isVertex(H.cell)||L.model.isEdge(H.cell))){null!=H.style&&"1"==H.style.html?(J.innerHTML=L.sanitizeHtml(L.getLabel(H.cell)),label=mxUtils.extractTextWithWhitespace([J])):label=L.getLabel(H.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var Z=0;A&&B&&H==c&&(label=label.substr(q),Z=q);var X=null==I||""==I.value;if(null==P&&(0<=label.indexOf(O)||-X&&z(P,H.cell,O))||null!=P&&(P.test(label)||X&&z(P,H.cell,O)))if(B&&(null!=P?(X=label.match(P),null!=X&&0<X.length&&(n=X[0].toLowerCase(),q=Z+X.index+n.length)):(n=O,q=Z+label.indexOf(O)+n.length)),Y){V=H;break}else null==V&&(V=H)}Y=Y||H==c}}if(null!=V){if(W==G.length&&U.checked)return c=null,k=!0,K(!0,A,D);c=V;A=L.container;(null==A||c.x<A.scrollLeft||c.y<A.scrollTop||c.x+c.width>A.scrollLeft+A.clientWidth||c.y+c.height>A.scrollTop+A.clientHeight)&&L.scrollCellToVisible(c.cell,!0);L.isEnabled()&&-!L.isCellLocked(c.cell)?D||L.getSelectionCell()==c.cell&&1==L.getSelectionCount()||L.setSelectionCell(c.cell):L.highlightCell(c.cell)}else{if(!r&&U.checked)return k=!0,K(!0,A,D);L.isEnabled()&&!D&&L.clearSelection()}f=null!=V;B&&!r&&F();return 0==O.length||null!=V}var M=b.actions.get("findReplace"),L=b.editor.graph,Q=null,c=null,f=!1,k=!1,n=null,q=0,t=1,u=document.createElement("div");u.style.userSelect="none";u.style.overflow="hidden";u.style.padding="10px";u.style.height="100%";var y=B?"260px":-"200px",E=document.createElement("input");E.setAttribute("placeholder",mxResources.get("find"));E.setAttribute("type","text");E.style.marginTop="4px";E.style.marginBottom="6px";E.style.width=y;E.style.fontSize="12px";E.style.borderRadius="4px";E.style.padding="6px";u.appendChild(E);mxUtils.br(u);if(B){var I=document.createElement("input");I.setAttribute("placeholder",mxResources.get("replaceWith"));I.setAttribute("type","text");I.style.marginTop="4px";I.style.marginBottom="6px";I.style.width=y;I.style.fontSize=-"12px";I.style.borderRadius="4px";I.style.padding="6px";u.appendChild(I);mxUtils.br(u);mxEvent.addListener(I,"input",F)}var C=document.createElement("input");C.setAttribute("id","geFindWinRegExChck");C.setAttribute("type","checkbox");C.style.marginRight="4px";u.appendChild(C);y=document.createElement("label");y.setAttribute("for","geFindWinRegExChck");u.appendChild(y);mxUtils.write(y,mxResources.get("regularExpression"));u.appendChild(y);y=b.menus.createHelpLink("https://www.drawio.com/doc/faq/find-shapes");-y.style.position="relative";y.style.marginLeft="6px";u.appendChild(y);mxUtils.br(u);var U=document.createElement("input");U.setAttribute("id","geFindWinAllPagesChck");U.setAttribute("type","checkbox");U.style.marginRight="4px";u.appendChild(U);y=document.createElement("label");y.setAttribute("for","geFindWinAllPagesChck");u.appendChild(y);mxUtils.write(y,mxResources.get("allPages"));u.appendChild(y);var J=document.createElement("div");mxUtils.br(u);y=document.createElement("div");y.style.left="0px";-y.style.right="0px";y.style.marginTop="6px";y.style.padding="0 6px 0 6px";u.appendChild(y);var S=mxUtils.button(mxResources.get("reset"),function(){R.innerText="";E.value="";E.style.backgroundColor="";B&&(I.value="",F());Q=c=null;k=!1;E.focus()});S.setAttribute("title",mxResources.get("reset"));S.style.float="none";S.style.width="120px";S.style.marginTop="6px";S.style.marginLeft="8px";S.style.overflow="hidden";S.style.textOverflow="ellipsis";S.className="geBtn";B||y.appendChild(S);var N=mxUtils.button(mxResources.get("find"),-function(){try{E.style.backgroundColor=K()?"":"light-dark(#ffcfcf, #ff0000)"}catch(r){b.handleError(r)}});N.setAttribute("title",mxResources.get("find")+" (Enter)");N.style.float="none";N.style.width="120px";N.style.marginTop="6px";N.style.marginLeft="8px";N.style.overflow="hidden";N.style.textOverflow="ellipsis";N.className="geBtn gePrimaryBtn";y.appendChild(N);var R=document.createElement("div");R.style.marginTop="10px";if(B){var T=function(r,A,D,G,O){if(null==O||"1"!=O.html)return G=r.toLowerCase().indexOf(A,-G),0>G?r:r.substr(0,G)+D+r.substr(G+A.length);var P=r;A=mxUtils.htmlEntities(A,!1,!1,!1);O=[];var V=-1;for(r=r.replace(/<br>/ig,"\n").replace(/(\s|\S)(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1\n$2");-1<(V=r.indexOf("<",V+1));)O.push(V);V=r.match(/<[^>]*>/g);r=r.replace(/<[^>]*>/g,"");G=r.toLowerCase().indexOf(A,G);if(0>G)return P;P=G+A.length;D=mxUtils.htmlEntities(D);r=r.substr(0,G)+D+r.substr(P);for(var Y=0,H=0;H<O.length;H++){if(O[H]-Y<G)r=r.substr(0,O[H])+V[H]+r.substr(O[H]);-else{var W=O[H]-Y<P?G+Y:O[H]+(D.length-A.length);r=r.substr(0,W)+V[H]+r.substr(W)}Y+=V[H].length}return r.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1").replace(/\n/g,"<br>")};y.style.textAlign="center";var v=mxUtils.button(mxResources.get("replFind"),function(){try{if(null!=n&&null!=c){var r=c.cell,A=L.getLabel(r);L.isCellEditable(r)&&L.model.setValue(r,T(A,n,I.value,q-n.length,L.getCurrentCellStyle(r)));E.style.backgroundColor=K(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(D){b.handleError(D)}});-v.setAttribute("title",mxResources.get("replFind"));v.style.float="none";v.style.width="120px";v.style.marginTop="6px";v.style.marginLeft="8px";v.style.overflow="hidden";v.style.textOverflow="ellipsis";v.className="geBtn gePrimaryBtn";v.setAttribute("disabled","disabled");y.appendChild(v);mxUtils.br(y);var d=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=n&&null!=c){var r=c.cell,A=L.getLabel(r);L.model.setValue(r,T(A,n,I.value,q-n.length,L.getCurrentCellStyle(r)));v.setAttribute("disabled",-"disabled");d.setAttribute("disabled","disabled")}}catch(D){b.handleError(D)}});d.setAttribute("title",mxResources.get("replace"));d.style.float="none";d.style.width="120px";d.style.marginTop="6px";d.style.marginLeft="8px";d.style.overflow="hidden";d.style.textOverflow="ellipsis";d.className="geBtn gePrimaryBtn";d.setAttribute("disabled","disabled");y.appendChild(d);var m=mxUtils.button(mxResources.get("replaceAll"),function(){R.innerText="";Q=null;var r=b.currentPage,A=b.editor.graph.getSelectionCells();-b.editor.graph.rendering=!1;L.getModel().beginUpdate();try{for(var D=0,G={};K(!1,!0,!0)&&100>D;){var O=c.cell,P=L.getLabel(O),V=G[O.id];if(V&&V.replAllMrk==t&&V.replAllPos>=q)break;G[O.id]={replAllMrk:t,replAllPos:q};L.isCellEditable(O)&&(L.model.setValue(O,T(P,n,I.value,q-n.length,L.getCurrentCellStyle(O))),D++)}r!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,r));mxUtils.write(R,mxResources.get("matchesRepl",[D]))}catch(Y){b.handleError(Y)}finally{L.getModel().endUpdate(),b.editor.graph.setSelectionCells(A),-b.editor.graph.rendering=!0}t++});m.setAttribute("title",mxResources.get("replaceAll"));m.style.float="none";m.style.width="120px";m.style.marginTop="6px";m.style.marginLeft="8px";m.style.overflow="hidden";m.style.textOverflow="ellipsis";m.className="geBtn gePrimaryBtn";m.setAttribute("disabled","disabled");y.appendChild(m);mxUtils.br(y);y.appendChild(S);S=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,function(){this.window.setVisible(!1)}));S.setAttribute("title",mxResources.get("close"));-S.style.float="none";S.style.width="120px";S.style.marginTop="6px";S.style.marginLeft="8px";S.style.overflow="hidden";S.style.textOverflow="ellipsis";S.className="geBtn";y.appendChild(S);mxUtils.br(y);y.appendChild(R)}else y.style.display="flex",y.style.alignItems="center",S.style.width="",N.style.width="";mxEvent.addListener(E,"keyup",function(r){if(91==r.keyCode||93==r.keyCode||17==r.keyCode)mxEvent.consume(r);else if(27==r.keyCode)M.funct();else if(Q!=E.value.toLowerCase()||13==r.keyCode)try{E.style.backgroundColor=-K()?"":"light-dark(#ffcfcf, #ff0000)"}catch(A){E.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(u,"keydown",function(r){70==r.keyCode&&b.keyHandler.isControlDown(r)&&!mxEvent.isShiftDown(r)&&(M.funct(),mxEvent.consume(r))});this.window=new mxWindow(mxResources.get("find")+(B?"/"+mxResources.get("replace"):""),u,l,p,g,x,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",-mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(E.focus(),mxClient.IS_GC||mxClient.IS_FF?E.select():document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?U.removeAttribute("disabled"):(U.checked=!1,U.setAttribute("disabled","disabled"))):L.container.focus()}));b.installResizeHandler(this,!1);this.doSearch=function(r){E.focus();E.value=r;N.click()}},FreehandWindow=function(b,l,p,g,x,B){var z=b.editor.graph,F=document.createElement("div");F.style.textAlign=-"center";F.style.userSelect="none";F.style.overflow="hidden";F.style.height="100%";if(B){var K=function(){var f=z.freehand.getStrokeColor(!0);null!=f&&f!=mxConstants.NONE&&1<f.length&&"string"===typeof f&&("default"==f?f=mxResources.get("useBlackAndWhite"):(f="#"==f.charAt(0)?f.substring(1).toUpperCase():f,f=ColorDialog.prototype.colorNames[f]),null!=f&&L.setAttribute("title",f))},M=document.createElement("input");M.setAttribute("id","geFreehandBrush");M.setAttribute("type","checkbox");M.checked=-z.freehand.isPerfectFreehandMode();M.style.margin="10px 5px 0px 10px";M.style.float="left";F.appendChild(M);z.freehand.setPerfectFreehandMode(M.checked);B=document.createElement("label");B.setAttribute("for","geFreehandBrush");B.style.float="left";B.style.marginTop="10px";F.appendChild(B);mxUtils.write(B,mxResources.get("brush"));F.appendChild(B);var L=document.createElement("tempDiv");L.style.display="block";L.style.width="100%";L.style.height="100%";L.style.borderRadius="2px";L.style.boxSizing=-"border-box";L.style.border="1px solid black";L.style.backgroundColor=z.freehand.getStrokeColor();b.addListener("darkModeChanged",function(){L.style.backgroundColor=z.freehand.getStrokeColor()});K();B=mxUtils.button("",mxUtils.bind(this,function(f){b.pickColor(z.freehand.getStrokeColor(!0),function(k){z.freehand.setStrokeColor(k);L.style.backgroundColor=z.freehand.getStrokeColor();K()},"default");mxEvent.consume(f)}));B.style.position="absolute";B.style.boxSizing="border-box";B.style.padding="2px";-B.style.top="8px";B.style.right="8px";B.style.width="28px";B.style.height="18px";B.className="geColorBtn";B.innerText="";B.appendChild(L);F.appendChild(B);B=document.createElement("img");B.setAttribute("title",mxResources.get("settings"));B.setAttribute("src",Editor.gearImage);B.className="geButton";B.style.position="absolute";B.style.boxSizing="border-box";B.style.padding="2px";B.style.top="8px";B.style.right="38px";B.style.width="18px";B.style.height="18px";B.style.opacity="0.6";F.appendChild(B);-mxEvent.addListener(B,"click",mxUtils.bind(this,function(f){f=z.freehand.getSmoothing();b.prompt(mxResources.get("smoothing")+" (1-20)",f,function(k){!isNaN(k)&&0<k&&20>=k&&z.freehand.setSmoothing(parseInt(k))})}));mxUtils.br(F);var Q=document.createElement("input");Q.setAttribute("type","range");Q.setAttribute("min","2");Q.setAttribute("max","30");Q.setAttribute("value",z.freehand.getBrushSize());Q.style.width="90%";Q.style.visibility="hidden";F.appendChild(Q);mxUtils.br(F);B=function(){z.freehand.setPerfectFreehandMode(M.checked);-Q.style.visibility=M.checked?"visible":"hidden"};mxEvent.addListener(M,"change",B);B();mxEvent.addListener(Q,"change",function(){z.freehand.setBrushSize(parseInt(this.value))})}var c=mxUtils.button(mxResources.get("startDrawing"),function(){z.freehand.isDrawing()?z.freehand.stopDrawing():z.freehand.startDrawing()});c.setAttribute("title",mxResources.get("startDrawing")+" (X)");c.style.width="90%";c.style.marginLeft="0px";c.style.position="relative";c.className="geBtn gePrimaryBtn";F.appendChild(c);-this.window=new mxWindow(mxResources.get("freehand"),F,l,p,g,x,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);z.addListener("freehandStateChanged",mxUtils.bind(this,function(){c.innerText="";mxUtils.write(c,mxResources.get(z.freehand.isDrawing()?"stopDrawing":"startDrawing"));var f=document.createElement("span");f.className="geShortcutKey";f.style.margin="0 2px 4px 0";mxUtils.write(f,"X");c.appendChild(f);c.setAttribute("title",-mxResources.get(z.freehand.isDrawing()?"stopDrawing":"startDrawing")+" (X)");c.className="geBtn"+(z.freehand.isDrawing()?" gePrimaryBtn":"")}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));this.window.addListener("hide",mxUtils.bind(this,function(){z.freehand.isDrawing()&&z.freehand.stopDrawing()}));b.installResizeHandler(this,!1)},AdaptiveColorsWindow=function(b,l,p,g,x){var B=b.editor.graph,z=document.createElement("div");z.style.userSelect="none";z.style.overflow=-"hidden";z.style.height="100%";var F=document.createElement("div");F.style.display="flex";F.style.alignItems="center";F.style.justifyContent="center";F.style.paddingTop="20px";var K=document.createElement("input");K.setAttribute("type","checkbox");K.style.marginRight="4px";K.checked=!0;var M=document.createElement("input");M.setAttribute("type","checkbox");M.style.marginRight="4px";M.checked=!0;var L=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),mxUtils.bind(this,function(){b.removeUserDefinedDarkColors(B.isSelectionEmpty()?-B.getVerticesAndEdges():B.getSelectionCells(),K.checked,M.checked)}));L.setAttribute("title","Convert Colors");L.className="geBtn gePrimaryBtn";F.appendChild(L);z.appendChild(F);F=F.cloneNode(!1);F.appendChild(M);F.style.paddingTop="8px";mxUtils.write(F,mxResources.get("background"));z.appendChild(F);F=F.cloneNode(!1);F.appendChild(K);F.style.paddingTop="8px";mxUtils.write(F,mxResources.get("labels"));z.appendChild(F);this.window=new mxWindow(mxResources.get("adaptiveColors"),z,l,p,g,x,!0,!0);this.window.destroyOnClose=-!1;this.window.setMinimizable(!1);this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!1)},ChatWindow=function(b,l,p,g,x){function B(){var ca={title:null,turns:[],el:document.createElement("div"),lastContext:null},fa=document.createElement("a");fa.style.display="flex";fa.style.alignItems="center";fa.style.gap="4px";fa.style.padding="5px 6px";fa.style.borderRadius=+var RevisionDialog=function(b,l,p){var g=document.createElement("div"),x=document.createElement("h3");x.style.marginTop="3px";mxUtils.write(x,mxResources.get("revisionHistory"));g.appendChild(x);x=document.createElement("div");x.style.position="absolute";x.style.overflow="auto";x.style.width="170px";x.style.height="378px";g.appendChild(x);var A=document.createElement("div");A.style.position="absolute";A.style.left="200px";A.style.width="470px";A.style.height="376px";A.style.overflow="hidden";A.style.borderWidth=+"1px";A.style.borderStyle="solid";var y=document.createElement("div");y.style.position="absolute";y.style.display="none";y.style.textAlign="center";y.style.padding="8px";y.style.borderRadius="8px";y.style.left="50%";y.style.top="50%";y.style.whiteSpace="nowrap";y.style.transform="translate(-50%, -50%)";y.style.background="inherit";y.style.border="1px solid";A.appendChild(y);mxEvent.disableContextMenu(A);g.appendChild(A);var G=new Graph(A);G.setTooltips(!1);G.setEnabled(!1);G.setPanning(!0);G.panningHandler.ignoreCell=+!0;G.panningHandler.useLeftButtonForPanning=!0;G.minFitScale=null;G.maxFitScale=null;G.centerZoom=!0;var L=0,O=null,J=0,Q=G.getGlobalVariable;G.getGlobalVariable=function(W){return"page"==W&&null!=O&&null!=O[J]?O[J].getAttribute("name"):"pagenumber"==W?J+1:"pagecount"==W?null!=O?O.length:1:Q.apply(this,arguments)};G.getLinkForCell=function(){return null};for(var c=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"light-dark(#000000, #C0C0C0)",speed:1.4,trail:60,+shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),f=b.getCurrentFile(),k=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),n={},q=0;q<k.length;q++)n[k[q].getAttribute("id")]=k[q];var t=null,u=null,B=null,E=null,I=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=B&&G.zoomIn()},20);I.setAttribute("disabled","disabled");var C=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=B&&G.zoomOut()},20);C.setAttribute("disabled",+"disabled");var U=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){null!=B&&(1==G.view.scale?(G.maxFitScale=8,G.fit(8)):G.zoomActual(),G.center())},20);U.setAttribute("disabled","disabled");var K=b.createToolbarButton(Editor.compareImage,mxResources.get("compare"));K.setAttribute("disabled","disabled");var S=b.createToolbarButton(Editor.thinDataImage,mxResources.get("merge"));S.setAttribute("disabled","disabled");var M=A.cloneNode(!1);M.style.pointerEvent="none";A.parentNode.appendChild(M);+var R=new Graph(M);R.setTooltips(!1);R.setEnabled(!1);R.setPanning(!0);R.panningHandler.ignoreCell=!0;R.panningHandler.useLeftButtonForPanning=!0;R.minFitScale=null;R.maxFitScale=null;R.centerZoom=!0;var T=document.createElement("div");T.style.textAlign="left";T.style.color="gray";T.style.backgroundColor="transparent";T.style.overflow="hidden";T.style.textOverflow="ellipsis";T.style.whiteSpace="nowrap";T.style.cursor="default";T.style.height="100%";T.style.display="inline-flex";T.style.alignItems=+"center";T.style.flexGrow="1";mxEvent.addListener(T,"click",function(){var W=mxUtils.getTextContent(T);""!=W&&b.alert(W)});var v=null;mxEvent.addGestureListeners(K,function(W){try{var Z=null!=O[L]?n[O[L].getAttribute("id")]:null;mxUtils.setOpacity(K,20);y.innerText="";if(null==Z)y.style.display="inline-block",mxUtils.write(y,mxResources.get("pageNotFound"));else{v=T.innerHTML;T.innerHTML=mxResources.get("current");A.style.display="none";M.style.display="";M.style.backgroundColor=A.style.backgroundColor;+var Y=Editor.parseDiagramNode(Z);(new mxCodec(Y.ownerDocument)).decode(Y,R.getModel());R.view.scaleAndTranslate(G.view.scale,G.view.translate.x,G.view.translate.y);R.mathEnabled="1"==Y.getAttribute("math");R.setAdaptiveColors(Y.getAttribute("adaptiveColors"));Editor.MathJaxRender&&R.mathEnabled&&Editor.MathJaxRender(R.container)}}catch(ba){y.style.display="inline-block",y.innerText="",mxUtils.write(y,mxResources.get("pageNotFound")+": "+ba.message)}},null,function(){mxUtils.setOpacity(K,60);y.style.display=+"none";y.innerText="";"none"==A.style.display&&(A.style.display="",T.innerHTML=v,M.style.display="none")});mxEvent.addListener(S,"click",mxUtils.bind(this,function(W){if(null!=B){W=b.getPagesForNode(B.documentElement);var Z=b.diffPages(b.pages,W);W=new TextareaDialog(b,mxResources.get("merge")+":",JSON.stringify(Z,null,2),function(Y){try{if(0<Y.length&&b.editor.graph.isEnabled()){var ba=[JSON.parse(Y)];b.confirm(mxResources.get("areYouSure"),function(){try{f.patch(ba,null,!0,!0),b.hideDialog(),b.hideDialog()}catch(ea){b.handleError(ea)}})}else b.hideDialog()}catch(ea){b.handleError(ea)}},+null,null,null,null,function(Y,ba){if(null!=Z[EditorUi.DIFF_UPDATE]){var ea=document.createElement("select"),aa=document.createElement("option");mxUtils.write(aa,mxResources.get("allPages"));aa.setAttribute("value","allPages");ea.appendChild(aa);for(var ha in Z[EditorUi.DIFF_UPDATE]){aa=document.createElement("option");var na=b.getPageById(ha);null!=na&&(mxUtils.write(aa,na.getName()),aa.setAttribute("value","page-"+ha),ea.appendChild(aa))}ea.style.marginRight="8px";ea.style.order="-1";mxEvent.addListener(ea,+"change",function(ra){ra=null;if("allPages"!=ea.value){var sa=ea.value.substring(5);null!=Z[EditorUi.DIFF_UPDATE][sa]&&(ra={},ra[EditorUi.DIFF_UPDATE]={},ra[EditorUi.DIFF_UPDATE][sa]=Z[EditorUi.DIFF_UPDATE][sa])}ba.value=JSON.stringify(null==ra?Z:ra,null,2)});2<ea.children.length&&Y.appendChild(ea)}},!0,null,mxResources.get(b.editor.graph.isEnabled()?"merge":"close"));b.showDialog(W.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));W.init()}}));var d=mxUtils.button(mxResources.get("restore"),+function(W){null!=B&&null!=E&&b.confirm(mxResources.get("areYouSure"),function(){null!=p?p(E):b.spinner.spin(document.body,mxResources.get("restoring"))&&(d.setAttribute("disabled","disabled"),f.save(!0,function(Z){b.spinner.stop();d.removeAttribute("disabled");b.replaceFileData(E);b.hideDialog()},function(Z){b.spinner.stop();d.removeAttribute("disabled");b.clearStatus();b.handleError(Z,null!=Z?mxResources.get("errorSavingFile"):null)}))})});d.className="geBtn gePrimaryBtn";d.setAttribute("disabled",+"disabled");var m=document.createElement("select");m.setAttribute("disabled","disabled");m.style.userSelect="none";m.style.maxWidth="100px";m.style.marginLeft="10px";m.style.display="none";var r=null;mxEvent.addListener(m,"change",function(W){null!=r&&(r(W),mxEvent.consume(W))});var z=mxUtils.button(mxResources.get("open"),function(){null!=B&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(B.documentElement)),b.openLink(b.getUrl(),null,!0))});+z.className="geBtn";z.setAttribute("disabled","disabled");var D=mxUtils.button(mxResources.get("createRevision"),function(){b.actions.get("save").funct(!1)});D.className="geBtn";D.setAttribute("disabled","disabled");null!=p&&(z.style.display="none");k=document.createElement("div");k.style.position="absolute";k.style.top="482px";k.style.right="28px";k.style.left="32px";k.style.justifyContent="end";k.style.display="flex";var F=document.createElement("div");F.className="geToolbarContainer";F.style.backgroundColor=+"transparent";F.style.left="32px";F.style.right="32px";F.style.border="none";F.style.top="442px";var N=null;if(null!=l&&0<l.length){A.style.cursor="move";var P=document.createElement("table");P.style.borderWidth="1px";P.style.borderStyle="solid";P.style.borderCollapse="collapse";P.style.borderSpacing="0px";P.style.width="100%";var V=document.createElement("tbody"),X=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(L=mxUtils.indexOf(b.pages,b.currentPage));for(q=l.length-1;0<=q;q--){var H=+function(W){var Z=new Date(W.modifiedDate),Y=null;if(0<=Z.getTime()){var ba=function(aa){c.stop();y.innerText="";var ha=mxUtils.parseXml(aa),na=b.editor.extractGraphModel(ha.documentElement,!0);if(null!=na){var ra=function(Aa){null!=Aa&&(Aa=sa(Editor.parseDiagramNode(Aa)));return Aa},sa=function(Aa){var Ba=Aa.getAttribute("background");if(null==Ba||""==Ba||Ba==mxConstants.NONE)Ba=G.defaultPageBackgroundColor;A.style.backgroundColor=mxUtils.getLightDarkColor(Ba);(new mxCodec(Aa.ownerDocument)).decode(Aa,+G.getModel());G.maxFitScale=1;G.fit(8);G.center();G.mathEnabled="1"==Aa.getAttribute("math");G.setAdaptiveColors(Aa.getAttribute("adaptiveColors"));Editor.MathJaxRender&&G.mathEnabled&&Editor.MathJaxRender(G.container);return Aa};m.style.display="none";m.innerText="";B=ha;E=aa;O=parseSelectFunction=null;J=0;if("mxfile"==na.nodeName){ha=na.getElementsByTagName("diagram");O=[];for(aa=0;aa<ha.length;aa++)O.push(ha[aa]);J=Math.min(L,O.length-1);0<O.length&&ra(O[J]);if(1<O.length)for(m.removeAttribute("disabled"),+m.style.display="",aa=0;aa<O.length;aa++){ha=document.createElement("option");ha.setAttribute("title",ua+" ("+O[aa].getAttribute("id")+")");ha.setAttribute("value",aa);var ua=O[aa].getAttribute("name")||mxResources.get("pageWithNumber",[aa+1]);na=b.getPageById(O[aa].getAttribute("id"));var xa="";if(null!=na){var qa=new DiagramPage(O[aa]);b.getHashValueForPages([na])!=b.getHashValueForPages([qa])&&(xa=" (M)")}else xa=" (X)";mxUtils.write(ha,ua+xa);aa==J&&ha.setAttribute("selected","selected");m.appendChild(ha)}r=+function(){try{var Aa=parseInt(m.value);J=L=Aa;ra(O[Aa])}catch(Ba){m.value=L,b.handleError(Ba)}}}else sa(na);ua=W.lastModifyingUserName;null!=ua&&20<ua.length&&(ua=ua.substring(0,20)+"...");T.innerText="";mxUtils.write(T,(null!=ua?ua+" ":"")+Z.toLocaleDateString()+" "+Z.toLocaleTimeString());T.setAttribute("title",Y.getAttribute("title"));I.removeAttribute("disabled");C.removeAttribute("disabled");U.removeAttribute("disabled");K.removeAttribute("disabled");S.removeAttribute("disabled");null!=f&&f.isRestricted()||+(b.editor.graph.isEnabled()&&d.removeAttribute("disabled"),z.removeAttribute("disabled"),D.removeAttribute("disabled"));mxUtils.setOpacity(I,60);mxUtils.setOpacity(C,60);mxUtils.setOpacity(U,60);mxUtils.setOpacity(K,60);mxUtils.setOpacity(S,60)}else m.style.display="none",m.innerText="",T.innerText="",y.innerText="",mxUtils.write(T,mxResources.get("errorLoadingFile")),mxUtils.write(y,mxResources.get("errorLoadingFile"))};Y=document.createElement("tr");Y.style.borderBottomWidth="1px";Y.style.borderBottomStyle=+"solid";Y.style.fontSize="12px";Y.style.cursor="pointer";var ea=document.createElement("td");ea.style.padding="6px";ea.style.whiteSpace="nowrap";W==l[l.length-1]?mxUtils.write(ea,mxResources.get("current")):Z.toDateString()===X?mxUtils.write(ea,Z.toLocaleTimeString()):mxUtils.write(ea,Z.toLocaleDateString()+" "+Z.toLocaleTimeString());Y.appendChild(ea);Y.setAttribute("title",Z.toLocaleDateString()+" "+Z.toLocaleTimeString()+(null!=W.fileSize?" "+b.formatFileSize(parseInt(W.fileSize)):"")+(null!=W.lastModifyingUserName?+" "+W.lastModifyingUserName:""));mxEvent.addListener(Y,"click",function(aa){u!=W&&(c.stop(),null!=t&&(t.style.backgroundColor=""),u=W,t=Y,t.style.backgroundColor="light-dark(#ebf2f9, #000000)",E=B=null,T.removeAttribute("title"),T.innerText=mxResources.get("loading")+"...",A.style.backgroundColor=G.defaultPageBackgroundColor,y.innerText="",G.getModel().clear(),d.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),U.setAttribute("disabled",+"disabled"),K.setAttribute("disabled","disabled"),S.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),m.setAttribute("disabled","disabled"),mxUtils.setOpacity(I,20),mxUtils.setOpacity(C,20),mxUtils.setOpacity(U,20),mxUtils.setOpacity(K,20),mxUtils.setOpacity(S,20),c.spin(A),W.getXml(function(ha){if(u==W)try{ba(ha)}catch(na){T.innerText=mxResources.get("error")+": "+na.message}},function(ha){c.stop();m.style.display="none";m.innerText="";T.innerText="";mxUtils.write(T,mxResources.get("errorLoadingFile"));+mxUtils.write(y,mxResources.get("errorLoadingFile"))}),mxEvent.consume(aa))});mxEvent.addListener(Y,"dblclick",function(aa){z.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(aa)},!1);V.appendChild(Y)}return Y}(l[q]);null!=H&&q==l.length-1&&(N=H)}P.appendChild(V);x.appendChild(P)}else null==f||null==b.drive&&f.constructor==window.DriveFile||null==b.dropbox&&f.constructor==window.DropboxFile?(A.style.display="none",F.style.display=+"none",mxUtils.write(x,mxResources.get("notAvailable"))):(A.style.display="none",F.style.display="none",mxUtils.write(x,mxResources.get("noRevisions")));this.init=function(){null!=N&&N.click()};x=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});x.className="geBtn";F.appendChild(T);F.appendChild(K);F.appendChild(C);F.appendChild(U);F.appendChild(I);F.appendChild(m);F.appendChild(S);b.editor.cancelFirst&&k.appendChild(x);k.appendChild(z);null!=f&&f.constructor==DriveFile&&k.appendChild(D);+k.appendChild(d);b.editor.cancelFirst||k.appendChild(x);g.appendChild(k);g.appendChild(F);this.container=g},RecoveryDialog=function(b,l,p,g){var x=document.createElement("div");x.style.paddingBottom="10px";b=document.createElement("h3");mxUtils.write(b,mxResources.get("recoverTitle"));x.appendChild(b);b=function(y){var G=document.createElement("div");G.className="geDialogSection";G.style.cursor="pointer";G.style.marginBottom="8px";G.style.padding="10px";var L=document.createElement("div");L.style.fontWeight=+"600";L.style.marginBottom="4px";mxUtils.write(L,y.label);G.appendChild(L);null!=y.description&&(L=document.createElement("div"),L.style.fontSize="12px",L.style.opacity="0.75",mxUtils.write(L,y.description),G.appendChild(L));mxEvent.addListener(G,"click",function(){p(y)});x.appendChild(G)};for(var A=0;A<l.length;A++)b(l[A]);l=document.createElement("div");l.style.marginTop="34px";l.style.textAlign="right";b=mxUtils.button(mxResources.get("cancel"),function(){null!=g&&g()});b.className="geBtn";l.appendChild(b);+x.appendChild(l);this.container=x},DraftDialog=function(b,l,p,g,x,A,y,G,L){var O=document.createElement("div"),J=document.createElement("div");J.style.marginTop="0px";J.style.whiteSpace="nowrap";J.style.overflow="auto";J.style.lineHeight="normal";mxUtils.write(J,l);O.appendChild(J);var Q=document.createElement("select"),c=mxUtils.bind(this,function(){"-1"==Q.value?(Q.value=Q.options[0].value,c(),b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var K=this,S;return $jscomp.asyncExecutePromiseGeneratorProgram(function(M){for(S=+0;S<L.length;S++)x.apply(K,[S,mxUtils.bind(K,function(){})]);b.hideDialog(!0);M.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(u=mxUtils.parseXml(L[Q.value].data),B=b.editor.extractGraphModel(u.documentElement,!0),E=0,this.init())});if(null!=L){Q.style.marginLeft="4px";for(l=0;l<L.length;l++){var f=document.createElement("option");f.setAttribute("value",l);var k=new Date(L[l].created),n=new Date(L[l].modified);mxUtils.write(f,k.toLocaleDateString()+" "+k.toLocaleTimeString()+" - "++(k.toDateString(),n.toDateString(),n.toLocaleDateString())+" "+n.toLocaleTimeString());Q.appendChild(f)}f=document.createElement("option");f.setAttribute("value","-1");mxUtils.write(f,mxResources.get("deleteAll"));Q.appendChild(f);J.appendChild(Q);mxEvent.addListener(Q,"change",c)}null==p&&(p=L[0].data);var q=document.createElement("div");q.style.position="absolute";q.style.border="1px solid lightGray";q.style.marginTop="10px";q.style.left="40px";q.style.right="40px";q.style.top="46px";q.style.bottom=+"74px";q.style.overflow="hidden";mxEvent.disableContextMenu(q);O.appendChild(q);var t=new Graph(q);t.setEnabled(!1);t.setPanning(!0);t.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";t.panningHandler.ignoreCell=!0;t.panningHandler.useLeftButtonForPanning=!0;t.minFitScale=null;t.maxFitScale=null;t.centerZoom=!0;var u=mxUtils.parseXml(p),B=b.editor.extractGraphModel(u.documentElement,!0),E=0,I=null,C=t.getGlobalVariable;t.getGlobalVariable=function(K){return"page"==K&&null!=I&&null!=I[E]?I[E].getAttribute("name"):+"pagenumber"==K?E+1:"pagecount"==K?null!=I?I.length:1:C.apply(this,arguments)};t.getLinkForCell=function(){return null};p=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){t.zoomIn()},20);J=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){t.zoomOut()},20);l=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==t.view.scale?(t.maxFitScale=8,t.fit(8)):t.zoomActual();t.center()},20);y=mxUtils.button(y||mxResources.get("discard"),+function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var K=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(S){x.apply(K,[Q.value,mxUtils.bind(K,function(){null!=Q.parentNode&&(Q.options[Q.selectedIndex].parentNode.removeChild(Q.options[Q.selectedIndex]),1<Q.options.length?(Q.value=Q.options[0].value,c()):b.hideDialog(!0))})]);S.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))});y.className="geBtn";var U=document.createElement("select");+U.style.maxWidth="80px";U.style.position="relative";U.style.top="-2px";U.style.verticalAlign="bottom";U.style.marginRight="6px";U.style.display="none";A=mxUtils.button(A||mxResources.get("edit"),function(){g.apply(this,[Q.value])});A.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.position="absolute";f.style.bottom="30px";f.style.right="40px";f.style.textAlign="right";k=document.createElement("div");k.className="geToolbarContainer";k.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";+this.init=function(){function K(T){if(null!=T){var v=T.getAttribute("background");if(null==v||""==v||v==mxConstants.NONE)v="light-dark(#ffffff, transparent)";q.style.backgroundColor=v;(new mxCodec(T.ownerDocument)).decode(T,t.getModel());t.maxFitScale=1;t.fit(8);t.center()}return T}function S(T){if(null!=T)try{T=K(Editor.parseDiagramNode(T))}catch(v){b.handleError(v)}return T}mxEvent.addListener(U,"change",function(T){E=parseInt(U.value);S(I[E]);mxEvent.consume(T)});if("mxfile"==B.nodeName){var M=+B.getElementsByTagName("diagram");I=[];for(var R=0;R<M.length;R++)I.push(M[R]);0<I.length&&S(I[E]);U.innerText="";if(1<I.length)for(U.style.display="",R=0;R<I.length;R++)M=document.createElement("option"),mxUtils.write(M,I[R].getAttribute("name")||mxResources.get("pageWithNumber",[R+1])),M.setAttribute("value",R),R==E&&M.setAttribute("selected","selected"),U.appendChild(M);else U.style.display="none"}else K(B)};k.appendChild(U);k.appendChild(p);k.appendChild(J);k.appendChild(l);p=mxUtils.button(mxResources.get("cancel"),+function(){b.hideDialog(!0)});p.className="geBtn";G=null!=G?mxUtils.button(mxResources.get("ignore"),G):null;null!=G&&(G.className="geBtn");b.editor.cancelFirst?(f.appendChild(p),null!=G&&f.appendChild(G),f.appendChild(y),f.appendChild(A)):(f.appendChild(A),f.appendChild(y),null!=G&&f.appendChild(G),f.appendChild(p));O.appendChild(f);O.appendChild(k);this.container=O},FindWindow=function(b,l,p,g,x,A){function y(r,z,D){if("object"===typeof z.value&&null!=z.value.attributes){z=z.value.attributes;for(var F=+0;F<z.length;F++)if("label"!=z[F].nodeName){var N=mxUtils.trim(z[F].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==r&&0<=N.indexOf(D)||null!=r&&r.test(N))return!0}}return!1}function G(){f?(v.removeAttribute("disabled"),d.removeAttribute("disabled")):(v.setAttribute("disabled","disabled"),d.setAttribute("disabled","disabled"));E.value?m.removeAttribute("disabled"):m.setAttribute("disabled","disabled")}function L(r,z,D){R.innerText="";var F=J.model.getDescendants(J.model.getRoot()),+N=E.value.toLowerCase(),P=C.checked?new RegExp(N):null,V=null;n=null;Q!=N&&(Q=N,c=null,k=!1);var X=null==c;if(0<N.length){if(k){k=!1;for(var H,W=0;W<b.pages.length;W++)if(b.currentPage==b.pages[W]){H=W;break}r=(H+1)%b.pages.length;c=null;do k=!1,N=b.pages[r],J=b.createTemporaryGraph(J.getStylesheet()),b.updatePageRoot(N),J.model.setRoot(N.root),r=(r+1)%b.pages.length;while(!L(!0,z,D)&&r!=H);c&&(c=null,D?b.editor.graph.model.execute(new SelectPage(b,N)):b.selectPage(N));k=!1;J=b.editor.graph;return L(!0,+z,D)}for(W=0;W<F.length;W++){H=J.view.getState(F[W]);z&&(X=X||H==c);if(null!=H&&null!=H.cell.value&&(X||null==V)&&(J.model.isVertex(H.cell)||J.model.isEdge(H.cell))){null!=H.style&&"1"==H.style.html?(K.innerHTML=J.sanitizeHtml(J.getLabel(H.cell)),label=mxUtils.extractTextWithWhitespace([K])):label=J.getLabel(H.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var Z=0;z&&A&&H==c&&(label=label.substr(q),Z=q);var Y=null==I||""==I.value;if(null==P&&(0<=label.indexOf(N)||+Y&&y(P,H.cell,N))||null!=P&&(P.test(label)||Y&&y(P,H.cell,N)))if(A&&(null!=P?(Y=label.match(P),null!=Y&&0<Y.length&&(n=Y[0].toLowerCase(),q=Z+Y.index+n.length)):(n=N,q=Z+label.indexOf(N)+n.length)),X){V=H;break}else null==V&&(V=H)}X=X||H==c}}if(null!=V){if(W==F.length&&U.checked)return c=null,k=!0,L(!0,z,D);c=V;z=J.container;(null==z||c.x<z.scrollLeft||c.y<z.scrollTop||c.x+c.width>z.scrollLeft+z.clientWidth||c.y+c.height>z.scrollTop+z.clientHeight)&&J.scrollCellToVisible(c.cell,!0);J.isEnabled()&&+!J.isCellLocked(c.cell)?D||J.getSelectionCell()==c.cell&&1==J.getSelectionCount()||J.setSelectionCell(c.cell):J.highlightCell(c.cell)}else{if(!r&&U.checked)return k=!0,L(!0,z,D);J.isEnabled()&&!D&&J.clearSelection()}f=null!=V;A&&!r&&G();return 0==N.length||null!=V}var O=b.actions.get("findReplace"),J=b.editor.graph,Q=null,c=null,f=!1,k=!1,n=null,q=0,t=1,u=document.createElement("div");u.style.userSelect="none";u.style.overflow="hidden";u.style.padding="10px";u.style.height="100%";var B=A?"260px":+"200px",E=document.createElement("input");E.setAttribute("placeholder",mxResources.get("find"));E.setAttribute("type","text");E.style.marginTop="4px";E.style.marginBottom="6px";E.style.width=B;E.style.fontSize="12px";E.style.borderRadius="4px";E.style.padding="6px";u.appendChild(E);mxUtils.br(u);if(A){var I=document.createElement("input");I.setAttribute("placeholder",mxResources.get("replaceWith"));I.setAttribute("type","text");I.style.marginTop="4px";I.style.marginBottom="6px";I.style.width=B;I.style.fontSize=+"12px";I.style.borderRadius="4px";I.style.padding="6px";u.appendChild(I);mxUtils.br(u);mxEvent.addListener(I,"input",G)}var C=document.createElement("input");C.setAttribute("id","geFindWinRegExChck");C.setAttribute("type","checkbox");C.style.marginRight="4px";u.appendChild(C);B=document.createElement("label");B.setAttribute("for","geFindWinRegExChck");u.appendChild(B);mxUtils.write(B,mxResources.get("regularExpression"));u.appendChild(B);B=b.menus.createHelpLink("https://www.drawio.com/doc/faq/find-shapes");+B.style.position="relative";B.style.marginLeft="6px";u.appendChild(B);mxUtils.br(u);var U=document.createElement("input");U.setAttribute("id","geFindWinAllPagesChck");U.setAttribute("type","checkbox");U.style.marginRight="4px";u.appendChild(U);B=document.createElement("label");B.setAttribute("for","geFindWinAllPagesChck");u.appendChild(B);mxUtils.write(B,mxResources.get("allPages"));u.appendChild(B);var K=document.createElement("div");mxUtils.br(u);B=document.createElement("div");B.style.left="0px";+B.style.right="0px";B.style.marginTop="6px";B.style.padding="0 6px 0 6px";u.appendChild(B);var S=mxUtils.button(mxResources.get("reset"),function(){R.innerText="";E.value="";E.style.backgroundColor="";A&&(I.value="",G());Q=c=null;k=!1;E.focus()});S.setAttribute("title",mxResources.get("reset"));S.style.float="none";S.style.width="120px";S.style.marginTop="6px";S.style.marginLeft="8px";S.style.overflow="hidden";S.style.textOverflow="ellipsis";S.className="geBtn";A||B.appendChild(S);var M=mxUtils.button(mxResources.get("find"),+function(){try{E.style.backgroundColor=L()?"":"light-dark(#ffcfcf, #ff0000)"}catch(r){b.handleError(r)}});M.setAttribute("title",mxResources.get("find")+" (Enter)");M.style.float="none";M.style.width="120px";M.style.marginTop="6px";M.style.marginLeft="8px";M.style.overflow="hidden";M.style.textOverflow="ellipsis";M.className="geBtn gePrimaryBtn";B.appendChild(M);var R=document.createElement("div");R.style.marginTop="10px";if(A){var T=function(r,z,D,F,N){if(null==N||"1"!=N.html)return F=r.toLowerCase().indexOf(z,+F),0>F?r:r.substr(0,F)+D+r.substr(F+z.length);var P=r;z=mxUtils.htmlEntities(z,!1,!1,!1);N=[];var V=-1;for(r=r.replace(/<br>/ig,"\n").replace(/(\s|\S)(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1\n$2");-1<(V=r.indexOf("<",V+1));)N.push(V);V=r.match(/<[^>]*>/g);r=r.replace(/<[^>]*>/g,"");F=r.toLowerCase().indexOf(z,F);if(0>F)return P;P=F+z.length;D=mxUtils.htmlEntities(D);r=r.substr(0,F)+D+r.substr(P);for(var X=0,H=0;H<N.length;H++){if(N[H]-X<F)r=r.substr(0,N[H])+V[H]+r.substr(N[H]);+else{var W=N[H]-X<P?F+X:N[H]+(D.length-z.length);r=r.substr(0,W)+V[H]+r.substr(W)}X+=V[H].length}return r.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1").replace(/\n/g,"<br>")};B.style.textAlign="center";var v=mxUtils.button(mxResources.get("replFind"),function(){try{if(null!=n&&null!=c){var r=c.cell,z=J.getLabel(r);J.isCellEditable(r)&&J.model.setValue(r,T(z,n,I.value,q-n.length,J.getCurrentCellStyle(r)));E.style.backgroundColor=L(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(D){b.handleError(D)}});+v.setAttribute("title",mxResources.get("replFind"));v.style.float="none";v.style.width="120px";v.style.marginTop="6px";v.style.marginLeft="8px";v.style.overflow="hidden";v.style.textOverflow="ellipsis";v.className="geBtn gePrimaryBtn";v.setAttribute("disabled","disabled");B.appendChild(v);mxUtils.br(B);var d=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=n&&null!=c){var r=c.cell,z=J.getLabel(r);J.model.setValue(r,T(z,n,I.value,q-n.length,J.getCurrentCellStyle(r)));v.setAttribute("disabled",+"disabled");d.setAttribute("disabled","disabled")}}catch(D){b.handleError(D)}});d.setAttribute("title",mxResources.get("replace"));d.style.float="none";d.style.width="120px";d.style.marginTop="6px";d.style.marginLeft="8px";d.style.overflow="hidden";d.style.textOverflow="ellipsis";d.className="geBtn gePrimaryBtn";d.setAttribute("disabled","disabled");B.appendChild(d);var m=mxUtils.button(mxResources.get("replaceAll"),function(){R.innerText="";Q=null;var r=b.currentPage,z=b.editor.graph.getSelectionCells();+b.editor.graph.rendering=!1;J.getModel().beginUpdate();try{for(var D=0,F={};L(!1,!0,!0)&&100>D;){var N=c.cell,P=J.getLabel(N),V=F[N.id];if(V&&V.replAllMrk==t&&V.replAllPos>=q)break;F[N.id]={replAllMrk:t,replAllPos:q};J.isCellEditable(N)&&(J.model.setValue(N,T(P,n,I.value,q-n.length,J.getCurrentCellStyle(N))),D++)}r!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,r));mxUtils.write(R,mxResources.get("matchesRepl",[D]))}catch(X){b.handleError(X)}finally{J.getModel().endUpdate(),b.editor.graph.setSelectionCells(z),+b.editor.graph.rendering=!0}t++});m.setAttribute("title",mxResources.get("replaceAll"));m.style.float="none";m.style.width="120px";m.style.marginTop="6px";m.style.marginLeft="8px";m.style.overflow="hidden";m.style.textOverflow="ellipsis";m.className="geBtn gePrimaryBtn";m.setAttribute("disabled","disabled");B.appendChild(m);mxUtils.br(B);B.appendChild(S);S=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,function(){this.window.setVisible(!1)}));S.setAttribute("title",mxResources.get("close"));+S.style.float="none";S.style.width="120px";S.style.marginTop="6px";S.style.marginLeft="8px";S.style.overflow="hidden";S.style.textOverflow="ellipsis";S.className="geBtn";B.appendChild(S);mxUtils.br(B);B.appendChild(R)}else B.style.display="flex",B.style.alignItems="center",S.style.width="",M.style.width="";mxEvent.addListener(E,"keyup",function(r){if(91==r.keyCode||93==r.keyCode||17==r.keyCode)mxEvent.consume(r);else if(27==r.keyCode)O.funct();else if(Q!=E.value.toLowerCase()||13==r.keyCode)try{E.style.backgroundColor=+L()?"":"light-dark(#ffcfcf, #ff0000)"}catch(z){E.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(u,"keydown",function(r){70==r.keyCode&&b.keyHandler.isControlDown(r)&&!mxEvent.isShiftDown(r)&&(O.funct(),mxEvent.consume(r))});this.window=new mxWindow(mxResources.get("find")+(A?"/"+mxResources.get("replace"):""),u,l,p,g,x,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",+mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(E.focus(),mxClient.IS_GC||mxClient.IS_FF?E.select():document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?U.removeAttribute("disabled"):(U.checked=!1,U.setAttribute("disabled","disabled"))):J.container.focus()}));b.installResizeHandler(this,!1);this.doSearch=function(r){E.focus();E.value=r;M.click()}},FreehandWindow=function(b,l,p,g,x,A){var y=b.editor.graph,G=document.createElement("div");G.style.textAlign=+"center";G.style.userSelect="none";G.style.overflow="hidden";G.style.height="100%";if(A){var L=function(){var f=y.freehand.getStrokeColor(!0);null!=f&&f!=mxConstants.NONE&&1<f.length&&"string"===typeof f&&("default"==f?f=mxResources.get("useBlackAndWhite"):(f="#"==f.charAt(0)?f.substring(1).toUpperCase():f,f=ColorDialog.prototype.colorNames[f]),null!=f&&J.setAttribute("title",f))},O=document.createElement("input");O.setAttribute("id","geFreehandBrush");O.setAttribute("type","checkbox");O.checked=+y.freehand.isPerfectFreehandMode();O.style.margin="10px 5px 0px 10px";O.style.float="left";G.appendChild(O);y.freehand.setPerfectFreehandMode(O.checked);A=document.createElement("label");A.setAttribute("for","geFreehandBrush");A.style.float="left";A.style.marginTop="10px";G.appendChild(A);mxUtils.write(A,mxResources.get("brush"));G.appendChild(A);var J=document.createElement("tempDiv");J.style.display="block";J.style.width="100%";J.style.height="100%";J.style.borderRadius="2px";J.style.boxSizing=+"border-box";J.style.border="1px solid black";J.style.backgroundColor=y.freehand.getStrokeColor();b.addListener("darkModeChanged",function(){J.style.backgroundColor=y.freehand.getStrokeColor()});L();A=mxUtils.button("",mxUtils.bind(this,function(f){b.pickColor(y.freehand.getStrokeColor(!0),function(k){y.freehand.setStrokeColor(k);J.style.backgroundColor=y.freehand.getStrokeColor();L()},"default");mxEvent.consume(f)}));A.style.position="absolute";A.style.boxSizing="border-box";A.style.padding="2px";+A.style.top="8px";A.style.right="8px";A.style.width="28px";A.style.height="18px";A.className="geColorBtn";A.innerText="";A.appendChild(J);G.appendChild(A);A=document.createElement("img");A.setAttribute("title",mxResources.get("settings"));A.setAttribute("src",Editor.gearImage);A.className="geButton";A.style.position="absolute";A.style.boxSizing="border-box";A.style.padding="2px";A.style.top="8px";A.style.right="38px";A.style.width="18px";A.style.height="18px";A.style.opacity="0.6";G.appendChild(A);+mxEvent.addListener(A,"click",mxUtils.bind(this,function(f){f=y.freehand.getSmoothing();b.prompt(mxResources.get("smoothing")+" (1-20)",f,function(k){!isNaN(k)&&0<k&&20>=k&&y.freehand.setSmoothing(parseInt(k))})}));mxUtils.br(G);var Q=document.createElement("input");Q.setAttribute("type","range");Q.setAttribute("min","2");Q.setAttribute("max","30");Q.setAttribute("value",y.freehand.getBrushSize());Q.style.width="90%";Q.style.visibility="hidden";G.appendChild(Q);mxUtils.br(G);A=function(){y.freehand.setPerfectFreehandMode(O.checked);+Q.style.visibility=O.checked?"visible":"hidden"};mxEvent.addListener(O,"change",A);A();mxEvent.addListener(Q,"change",function(){y.freehand.setBrushSize(parseInt(this.value))})}var c=mxUtils.button(mxResources.get("startDrawing"),function(){y.freehand.isDrawing()?y.freehand.stopDrawing():y.freehand.startDrawing()});c.setAttribute("title",mxResources.get("startDrawing")+" (X)");c.style.width="90%";c.style.marginLeft="0px";c.style.position="relative";c.className="geBtn gePrimaryBtn";G.appendChild(c);+this.window=new mxWindow(mxResources.get("freehand"),G,l,p,g,x,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);y.addListener("freehandStateChanged",mxUtils.bind(this,function(){c.innerText="";mxUtils.write(c,mxResources.get(y.freehand.isDrawing()?"stopDrawing":"startDrawing"));var f=document.createElement("span");f.className="geShortcutKey";f.style.margin="0 2px 4px 0";mxUtils.write(f,"X");c.appendChild(f);c.setAttribute("title",+mxResources.get(y.freehand.isDrawing()?"stopDrawing":"startDrawing")+" (X)");c.className="geBtn"+(y.freehand.isDrawing()?" gePrimaryBtn":"")}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));this.window.addListener("hide",mxUtils.bind(this,function(){y.freehand.isDrawing()&&y.freehand.stopDrawing()}));b.installResizeHandler(this,!1)},AdaptiveColorsWindow=function(b,l,p,g,x){var A=b.editor.graph,y=document.createElement("div");y.style.userSelect="none";y.style.overflow=+"hidden";y.style.height="100%";var G=document.createElement("div");G.style.display="flex";G.style.alignItems="center";G.style.justifyContent="center";G.style.paddingTop="20px";var L=document.createElement("input");L.setAttribute("type","checkbox");L.style.marginRight="4px";L.checked=!0;var O=document.createElement("input");O.setAttribute("type","checkbox");O.style.marginRight="4px";O.checked=!0;var J=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),mxUtils.bind(this,function(){b.removeUserDefinedDarkColors(A.isSelectionEmpty()?+A.getVerticesAndEdges():A.getSelectionCells(),L.checked,O.checked)}));J.setAttribute("title","Convert Colors");J.className="geBtn gePrimaryBtn";G.appendChild(J);y.appendChild(G);G=G.cloneNode(!1);G.appendChild(O);G.style.paddingTop="8px";mxUtils.write(G,mxResources.get("background"));y.appendChild(G);G=G.cloneNode(!1);G.appendChild(L);G.style.paddingTop="8px";mxUtils.write(G,mxResources.get("labels"));y.appendChild(G);this.window=new mxWindow(mxResources.get("adaptiveColors"),y,l,p,g,x,!0,!0);this.window.destroyOnClose=+!1;this.window.setMinimizable(!1);this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!1)},ChatWindow=function(b,l,p,g,x){function A(){var ca={title:null,turns:[],el:document.createElement("div"),lastContext:null},fa=document.createElement("a");fa.style.display="flex";fa.style.alignItems="center";fa.style.gap="4px";fa.style.padding="5px 6px";fa.style.borderRadius="8px";fa.style.fontSize="11px";fa.style.cursor="default";fa.style.overflow="hidden";ca.item=fa;var oa=document.createElement("span");oa.style.flexGrow="1";oa.style.overflow="hidden";oa.style.textOverflow="ellipsis";oa.style.whiteSpace="nowrap";fa.appendChild(oa);ca.label=oa;var pa=document.createElement("img");pa.className="geAdaptiveAsset";pa.setAttribute("src",Editor.trashImage);pa.setAttribute("title",mxResources.get("delete"));pa.style.width="13px";pa.style.flexShrink="0";pa.style.cursor="pointer";-pa.style.opacity="0";fa.appendChild(pa);mxEvent.addListener(fa,"mouseenter",function(){pa.style.opacity="0.6";ca.active||(fa.style.backgroundColor="light-dark(#ececec, #333333)")});mxEvent.addListener(fa,"mouseleave",function(){pa.style.opacity="0";ca.active||(fa.style.backgroundColor="transparent")});mxEvent.addListener(fa,"click",function(wa){mxEvent.getSource(wa)==pa?b.confirm(mxResources.get("areYouSure"),function(){var za=mxUtils.indexOf(y,ca);0<=za&&y.splice(za,1);null!=ca.item.parentNode&&-ca.item.parentNode.removeChild(ca.item);ca==E&&(0<y.length?I(y[Math.min(za,y.length-1)]):I(B()))}):ca!=E&&I(ca);mxEvent.consume(wa)});C(ca,null);t.insertBefore(fa,t.firstChild);y.splice(0,0,ca);return ca}function z(){var ca=document.createElement("div");ca.style.textAlign="left";ca.style.padding="6px";ca.style.margin="6px 0";return ca}function F(ca){var fa=document.createElement("div");fa.style.whiteSpace="pre-wrap";fa.style.overflow="auto";fa.innerHTML=Graph.sanitizeHtml(mxUtils.htmlEntities(ca,-!1).replace(/\n*^##### (.+)$\n*/gm,"<h5>$1</h5>").replace(/\n*^#### (.+)$\n*/gm,"<h4>$1</h4>").replace(/\n*^### (.+)$\n*/gm,"<h3>$1</h3>").replace(/\n*^## (.+)$\n*/gm,"<h2>$1</h2>").replace(/\n*^# (.+)$\n*/gm,"<h1>$1</h1>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>"));return fa}function K(ca,fa){var oa=mxResources.get("error")+": ",pa=document.createElement("div");pa.style.whiteSpace="pre-wrap";ca=null!=ca&&null!=ca.message?+pa.style.opacity="0";fa.appendChild(pa);mxEvent.addListener(fa,"mouseenter",function(){pa.style.opacity="0.6";ca.active||(fa.style.backgroundColor="light-dark(#ececec, #333333)")});mxEvent.addListener(fa,"mouseleave",function(){pa.style.opacity="0";ca.active||(fa.style.backgroundColor="transparent")});mxEvent.addListener(fa,"click",function(wa){mxEvent.getSource(wa)==pa?b.confirm(mxResources.get("areYouSure"),function(){var za=mxUtils.indexOf(B,ca);0<=za&&B.splice(za,1);null!=ca.item.parentNode&&+ca.item.parentNode.removeChild(ca.item);ca==E&&(0<B.length?I(B[Math.min(za,B.length-1)]):I(A()))}):ca!=E&&I(ca);mxEvent.consume(wa)});C(ca,null);t.insertBefore(fa,t.firstChild);B.splice(0,0,ca);return ca}function y(){var ca=document.createElement("div");ca.style.textAlign="left";ca.style.padding="6px";ca.style.margin="6px 0";return ca}function G(ca){var fa=document.createElement("div");fa.style.whiteSpace="pre-wrap";fa.style.overflow="auto";fa.innerHTML=Graph.sanitizeHtml(mxUtils.htmlEntities(ca,+!1).replace(/\n*^##### (.+)$\n*/gm,"<h5>$1</h5>").replace(/\n*^#### (.+)$\n*/gm,"<h4>$1</h4>").replace(/\n*^### (.+)$\n*/gm,"<h3>$1</h3>").replace(/\n*^## (.+)$\n*/gm,"<h2>$1</h2>").replace(/\n*^# (.+)$\n*/gm,"<h1>$1</h1>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>"));return fa}function L(ca,fa){var oa=mxResources.get("error")+": ",pa=document.createElement("div");pa.style.whiteSpace="pre-wrap";ca=null!=ca&&null!=ca.message?ca.message:"string"===typeof ca?ca:mxResources.get("unknownError");"string"!==typeof ca&&(ca=String(ca));ca.substring(0,oa.length)!=oa&&(ca=oa+ca);mxUtils.write(pa,ca);if(null!=fa){oa=pa.appendChild;ca=document.createElement("div");ca.style.display="flex";var wa=document.createElement("img");wa.className="geAdaptiveAsset geLibraryButton";wa.setAttribute("src",Editor.refreshImage);wa.setAttribute("title",mxResources.get("retry"));ca.appendChild(wa);mxEvent.addListener(wa,"click",fa);oa.call(pa,ca)}return pa}-function M(){null!=P&&P();var ca=mxUtils.trim(v.value),fa=G();if(""!=ca||"clipboard"==fa.kind&&null!=N)try{var oa=N;N=null;R();null==E.title&&""!=ca&&C(E,40<ca.length?ca.substring(0,40)+"…":ca);Fa(E,ca,oa,fa);v.value="";d();ra()}catch(pa){EditorUi.debug("EditorUi.ChatWindow.send","error",pa)}}var L=b.editor.graph,Q=[];if(0<=mxUtils.indexOf(Editor.aiActions,"create")||0<=mxUtils.indexOf(Editor.aiActions,"update")||0<=mxUtils.indexOf(Editor.aiActions,"assist"))for(var c=0;c<Editor.aiModels.length;c++){var f=+function O(){null!=P&&P();var ca=mxUtils.trim(v.value),fa=F();if(""!=ca||"clipboard"==fa.kind&&null!=M)try{var oa=M;M=null;R();null==E.title&&""!=ca&&C(E,40<ca.length?ca.substring(0,40)+"…":ca);Fa(E,ca,oa,fa);v.value="";d();ra()}catch(pa){EditorUi.debug("EditorUi.ChatWindow.send","error",pa)}}var J=b.editor.graph,Q=[];if(0<=mxUtils.indexOf(Editor.aiActions,"create")||0<=mxUtils.indexOf(Editor.aiActions,"update")||0<=mxUtils.indexOf(Editor.aiActions,"assist"))for(var c=0;c<Editor.aiModels.length;c++){var f=Editor.aiModels[c];null!=Editor.aiConfigs[f.config]&&null!=Editor.aiGlobals[Editor.aiConfigs[f.config].apiKey]&&Q.push({id:"model-"+f.name,kind:"model",label:f.name,model:f})}b.isExternalDataComms()&&EditorUi.isMermaidSupported()&&0<=mxUtils.indexOf(Editor.aiActions,"createPublic")&&(0==Q.length||1==urlParams.test)&&Q.push({id:"public",kind:"public",label:mxResources.get("draw.io")});Q.push({id:"clipboard",kind:"clipboard",label:mxResources.get("clipboard")});var k=document.createElement("div");k.style.display="flex";k.style.overflow="hidden";k.style.height="100%";k.style.boxSizing="border-box";var n=function(){k.style.colorScheme=null!=Editor.isDarkMode&&Editor.isDarkMode()?"dark":"light"};n();b.addListener("darkModeChanged",n);mxEvent.addGestureListeners(k,function(ca){null!=b.sidebar&&b.sidebar.hideTooltip()},null,null);var q=document.createElement("div");q.style.display="flex";q.style.flexDirection="column";q.style.flexShrink="0";q.style.width="130px";q.style.boxSizing="border-box";q.style.padding="8px 6px 20px 6px";q.style.borderRight="1px solid light-dark(#e5e5e5, #505050)";q.style.overflow="hidden";k.appendChild(q);var t=document.createElement("div");t.style.flexGrow="1";t.style.overflow="auto";t.style.marginTop="6px";f=document.createElement("div");f.style.display="flex";f.style.flexDirection="column";f.style.flexGrow="1";f.style.minWidth="0";f.style.boxSizing="border-box";f.style.padding="10px 12px 20px 12px";k.appendChild(f);var u=document.createElement("div");u.style.flexGrow="1";u.style.overflow=-"auto";u.style.fontSize="12px";u.style.marginRight="-8px";u.style.paddingRight="8px";f.appendChild(u);mxEvent.addListener(u,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var y=[],E=null,I=function(ca){E=ca;u.innerHTML="";u.appendChild(ca.el);u.scrollTop=u.scrollHeight;for(ca=0;ca<y.length;ca++){var fa=y[ca];fa.active=fa==E;fa.item.style.backgroundColor=fa.active?"light-dark(#e0e0e0, #3a3a3a)":"transparent"}ra();v.focus()},C=function(ca,fa){ca.title=fa;ca.label.innerHTML="";mxUtils.write(ca.label,-null!=fa?fa:mxResources.get("newChat"));ca.label.style.fontStyle=null!=fa?"":"italic";ca.item.setAttribute("title",null!=fa?fa:mxResources.get("newChat"))},U=document.createElement("a");U.style.display="flex";U.style.alignItems="center";U.style.gap="5px";U.style.flexShrink="0";U.style.padding="5px 6px";U.style.borderRadius="8px";U.style.fontSize="11px";U.style.fontWeight="bold";U.style.cursor="pointer";U.style.overflow="hidden";U.style.whiteSpace="nowrap";var J=document.createElement("img");J.className=-"geAdaptiveAsset";J.setAttribute("src",Editor.plusImage);J.style.width="13px";J.style.flexShrink="0";U.appendChild(J);J=document.createElement("span");J.style.overflow="hidden";J.style.textOverflow="ellipsis";mxUtils.write(J,mxResources.get("newChat"));U.appendChild(J);mxEvent.addListener(U,"mouseenter",function(){U.style.backgroundColor="light-dark(#ececec, #333333)"});mxEvent.addListener(U,"mouseleave",function(){U.style.backgroundColor="transparent"});mxEvent.addListener(U,"click",function(){null==-E||null!=E.el.firstChild?I(B()):v.focus()});q.appendChild(U);q.appendChild(t);q=document.createElement("div");q.style.borderRadius="12px";q.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";q.style.padding="8px 10px";q.style.marginTop="8px";q.style.flexShrink="0";var S=document.createElement("div");S.style.display="none";S.style.flexWrap="wrap";S.style.gap="4px";S.style.marginBottom="6px";q.appendChild(S);var N=null,R=function(){S.innerHTML="";if(null!=N){var ca=document.createElement("div");ca.style.display=-"flex";ca.style.alignItems="center";ca.style.gap="5px";ca.style.fontSize="11px";ca.style.padding="2px 8px";ca.style.borderRadius="10px";ca.style.backgroundColor="light-dark(#cfcfcf, #4a4a4a)";mxUtils.write(ca,N.label);var fa=document.createElement("img");fa.className="geAdaptiveAsset";fa.setAttribute("src",Editor.closeImage);fa.setAttribute("title",mxResources.get("remove"));fa.style.width="10px";fa.style.cursor="pointer";fa.style.opacity="0.6";ca.appendChild(fa);mxEvent.addListener(fa,"click",function(oa){N=-null;R();mxEvent.consume(oa)});S.appendChild(ca);S.style.display="flex"}else S.style.display="none";ra()},T=function(ca){try{var fa={kind:ca,page:b.currentPage};if("file"==ca)fa.label=mxResources.get("file"),fa.data=b.getFileData(!0,null,null,null,!0,!1,null,null,null,!0);else{var oa=new mxCodec(mxUtils.createXmlDocument());"selection"==ca?(fa.label=mxResources.get("selection"),oa.isObjectIgnored=function(wa){return wa.constructor==mxCell&&!L.model.isRoot(wa)&&!L.model.isLayer(wa)&&!L.isCellSelected(wa)&&-!L.isAncestorSelected(wa)}):fa.label=mxResources.get("page");var pa=oa.encode(L.getModel());pa.ownerDocument.appendChild(pa);fa.xmlNode=pa;fa.data=mxUtils.getXml(pa)}N=fa;R();v.focus()}catch(wa){b.handleError(wa)}},v=document.createElement("textarea");v.setAttribute("rows","1");v.setAttribute("placeholder",mxResources.get("describeYourDiagram"));v.style.width="100%";v.style.outline="none";v.style.border="none";v.style.resize="none";v.style.background="transparent";v.style.fontFamily="inherit";v.style.fontSize=-"12px";v.style.padding="4px 2px";v.style.margin="0";v.style.boxSizing="border-box";v.style.maxHeight="92px";v.style.overflow="auto";q.appendChild(v);var d=function(){v.style.height="auto";v.style.height=Math.min(92,v.scrollHeight)+"px"};mxEvent.addListener(v,"input",function(){d();ra()});J=document.createElement("div");J.style.display="flex";J.style.alignItems="center";J.style.gap="6px";J.style.marginTop="2px";q.appendChild(J);var m=document.createElement("img");m.className="geAdaptiveAsset";m.setAttribute("src",-Editor.thinAddCircleImage);m.setAttribute("title",mxResources.get("add"));m.style.width="18px";m.style.cursor="pointer";m.style.opacity="0.7";m.style.flexShrink="0";J.appendChild(m);mxEvent.addListener(m,"click",function(ca){var fa=mxUtils.getOffset(m);b.showPopupMenu(function(oa,pa){oa.addItem(mxResources.get("file"),null,function(){T("file")},pa,null,null!=b.pages&&1<b.pages.length||!b.isDiagramEmpty());oa.addItem(mxResources.get("page"),null,function(){T("page")},pa,null,!b.isDiagramEmpty());oa.addItem(mxResources.get("selection"),-null,function(){T("selection")},pa,null,!L.isSelectionEmpty())},fa.x,fa.y+m.offsetHeight+4,ca)});var r=mxUtils.button(mxResources.get("paste"),function(){Ea(E)});r.className="geBtn";r.setAttribute("title",mxResources.get("pasteResponse"));r.style.margin="0";r.style.fontSize="11px";r.style.minWidth="0";r.style.padding="2px 8px";J.appendChild(r);c=document.createElement("div");c.style.flexGrow="1";J.appendChild(c);var A=document.createElement("select");A.style.borderColor="transparent";A.style.background=-"light-dark(#e0e0e0, #3a3a3a)";A.style.textOverflow="ellipsis";A.style.fontSize="11px";A.style.opacity="0.8";A.style.maxWidth="60%";A.style.minWidth="0";A.style.padding="2px";for(c=0;c<Q.length;c++){var D=document.createElement("option");D.setAttribute("value",Q[c].id);mxUtils.write(D,Q[c].label);A.appendChild(D)}A.value=Q[0].id;J.appendChild(A);var G=function(){for(var ca=0;ca<Q.length;ca++)if(Q[ca].id==A.value)return Q[ca];return Q[Q.length-1]};c=function(){r.style.display="clipboard"==G().kind?-"":"none";ra()};mxEvent.addListener(A,"change",c);var O=window.SpeechRecognition||window.webkitSpeechRecognition,P=null;if(null!=O){var V=document.createElement("img");V.className="geAdaptiveAsset";V.setAttribute("src",Editor.micImage);V.setAttribute("title",mxResources.get("dictate"));V.style.width="18px";V.style.cursor="pointer";V.style.opacity="0.7";V.style.flexShrink="0";V.style.borderRadius="50%";J.appendChild(V);var Y=null;P=function(){if(null!=Y){var ca=Y;Y=null;try{ca.stop()}catch(fa){}}V.style.backgroundColor=-"";V.style.opacity="0.7"};mxEvent.addListener(V,"click",function(){if(null!=Y)P();else try{var ca=new O;ca.continuous=!0;ca.interimResults=!0;var fa=v.value;ca.onresult=function(oa){for(var pa="",wa=0;wa<oa.results.length;wa++)pa+=oa.results[wa][0].transcript;v.value=fa+(""!=fa&&""!=pa&&" "!=fa.charAt(fa.length-1)?" ":"")+pa;d()};ca.onerror=function(oa){Y==ca&&(P(),null==oa||"not-allowed"!=oa.error&&"service-not-allowed"!=oa.error||b.alert(mxResources.get("error")+": "+oa.error))};ca.onend=function(){Y==-ca&&P()};Y=ca;V.style.backgroundColor="light-dark(#fbd2d2, #7a3a3a)";V.style.opacity="1";ca.start()}catch(oa){P(),b.handleError(oa)}})}var H=function(ca,fa){for(var oa=[],pa=0;pa<ca.length;pa++)oa.push(("assistant"==ca[pa].role?"Assistant: ":"User: ")+ca[pa].content);return 0<oa.length?"Previous conversation:\n\n"+oa.join("\n\n")+"\n\nRequest: "+fa:fa},W=function(){var ca=mxUtils.trim(v.value)+(null!=N?"\n\nDiagram XML:\n"+N.data:"");return null!=E?H(E.turns,ca).length:ca.length},Z=document.createElement("span");+"auto";u.style.fontSize="12px";u.style.marginRight="-8px";u.style.paddingRight="8px";f.appendChild(u);mxEvent.addListener(u,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var B=[],E=null,I=function(ca){E=ca;u.innerHTML="";u.appendChild(ca.el);u.scrollTop=u.scrollHeight;for(ca=0;ca<B.length;ca++){var fa=B[ca];fa.active=fa==E;fa.item.style.backgroundColor=fa.active?"light-dark(#e0e0e0, #3a3a3a)":"transparent"}ra();v.focus()},C=function(ca,fa){ca.title=fa;ca.label.innerHTML="";mxUtils.write(ca.label,+null!=fa?fa:mxResources.get("newChat"));ca.label.style.fontStyle=null!=fa?"":"italic";ca.item.setAttribute("title",null!=fa?fa:mxResources.get("newChat"))},U=document.createElement("a");U.style.display="flex";U.style.alignItems="center";U.style.gap="5px";U.style.flexShrink="0";U.style.padding="5px 6px";U.style.borderRadius="8px";U.style.fontSize="11px";U.style.fontWeight="bold";U.style.cursor="pointer";U.style.overflow="hidden";U.style.whiteSpace="nowrap";var K=document.createElement("img");K.className=+"geAdaptiveAsset";K.setAttribute("src",Editor.plusImage);K.style.width="13px";K.style.flexShrink="0";U.appendChild(K);K=document.createElement("span");K.style.overflow="hidden";K.style.textOverflow="ellipsis";mxUtils.write(K,mxResources.get("newChat"));U.appendChild(K);mxEvent.addListener(U,"mouseenter",function(){U.style.backgroundColor="light-dark(#ececec, #333333)"});mxEvent.addListener(U,"mouseleave",function(){U.style.backgroundColor="transparent"});mxEvent.addListener(U,"click",function(){null==+E||null!=E.el.firstChild?I(A()):v.focus()});q.appendChild(U);q.appendChild(t);q=document.createElement("div");q.style.borderRadius="12px";q.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";q.style.padding="8px 10px";q.style.marginTop="8px";q.style.flexShrink="0";var S=document.createElement("div");S.style.display="none";S.style.flexWrap="wrap";S.style.gap="4px";S.style.marginBottom="6px";q.appendChild(S);var M=null,R=function(){S.innerHTML="";if(null!=M){var ca=document.createElement("div");ca.style.display=+"flex";ca.style.alignItems="center";ca.style.gap="5px";ca.style.fontSize="11px";ca.style.padding="2px 8px";ca.style.borderRadius="10px";ca.style.backgroundColor="light-dark(#cfcfcf, #4a4a4a)";mxUtils.write(ca,M.label);var fa=document.createElement("img");fa.className="geAdaptiveAsset";fa.setAttribute("src",Editor.closeImage);fa.setAttribute("title",mxResources.get("remove"));fa.style.width="10px";fa.style.cursor="pointer";fa.style.opacity="0.6";ca.appendChild(fa);mxEvent.addListener(fa,"click",function(oa){M=+null;R();mxEvent.consume(oa)});S.appendChild(ca);S.style.display="flex"}else S.style.display="none";ra()},T=function(ca){try{var fa={kind:ca,page:b.currentPage};if("file"==ca)fa.label=mxResources.get("file"),fa.data=b.getFileData(!0,null,null,null,!0,!1,null,null,null,!0);else{var oa=new mxCodec(mxUtils.createXmlDocument());"selection"==ca?(fa.label=mxResources.get("selection"),oa.isObjectIgnored=function(wa){return wa.constructor==mxCell&&!J.model.isRoot(wa)&&!J.model.isLayer(wa)&&!J.isCellSelected(wa)&&+!J.isAncestorSelected(wa)}):fa.label=mxResources.get("page");var pa=oa.encode(J.getModel());pa.ownerDocument.appendChild(pa);fa.xmlNode=pa;fa.data=mxUtils.getXml(pa)}M=fa;R();v.focus()}catch(wa){b.handleError(wa)}},v=document.createElement("textarea");v.setAttribute("rows","1");v.setAttribute("placeholder",mxResources.get("describeYourDiagram"));v.style.width="100%";v.style.outline="none";v.style.border="none";v.style.resize="none";v.style.background="transparent";v.style.fontFamily="inherit";v.style.fontSize=+"12px";v.style.padding="4px 2px";v.style.margin="0";v.style.boxSizing="border-box";v.style.maxHeight="92px";v.style.overflow="auto";q.appendChild(v);var d=function(){v.style.height="auto";v.style.height=Math.min(92,v.scrollHeight)+"px"};mxEvent.addListener(v,"input",function(){d();ra()});K=document.createElement("div");K.style.display="flex";K.style.alignItems="center";K.style.gap="6px";K.style.marginTop="2px";q.appendChild(K);var m=document.createElement("img");m.className="geAdaptiveAsset";m.setAttribute("src",+Editor.thinAddCircleImage);m.setAttribute("title",mxResources.get("add"));m.style.width="18px";m.style.cursor="pointer";m.style.opacity="0.7";m.style.flexShrink="0";K.appendChild(m);mxEvent.addListener(m,"click",function(ca){var fa=mxUtils.getOffset(m);b.showPopupMenu(function(oa,pa){oa.addItem(mxResources.get("file"),null,function(){T("file")},pa,null,null!=b.pages&&1<b.pages.length||!b.isDiagramEmpty());oa.addItem(mxResources.get("page"),null,function(){T("page")},pa,null,!b.isDiagramEmpty());oa.addItem(mxResources.get("selection"),+null,function(){T("selection")},pa,null,!J.isSelectionEmpty())},fa.x,fa.y+m.offsetHeight+4,ca)});var r=mxUtils.button(mxResources.get("paste"),function(){Ea(E)});r.className="geBtn";r.setAttribute("title",mxResources.get("pasteResponse"));r.style.margin="0";r.style.fontSize="11px";r.style.minWidth="0";r.style.padding="2px 8px";K.appendChild(r);c=document.createElement("div");c.style.flexGrow="1";K.appendChild(c);var z=document.createElement("select");z.style.borderColor="transparent";z.style.background=+"light-dark(#e0e0e0, #3a3a3a)";z.style.textOverflow="ellipsis";z.style.fontSize="11px";z.style.opacity="0.8";z.style.maxWidth="60%";z.style.minWidth="0";z.style.padding="2px";for(c=0;c<Q.length;c++){var D=document.createElement("option");D.setAttribute("value",Q[c].id);mxUtils.write(D,Q[c].label);z.appendChild(D)}z.value=Q[0].id;K.appendChild(z);var F=function(){for(var ca=0;ca<Q.length;ca++)if(Q[ca].id==z.value)return Q[ca];return Q[Q.length-1]};c=function(){r.style.display="clipboard"==F().kind?+"":"none";ra()};mxEvent.addListener(z,"change",c);var N=window.SpeechRecognition||window.webkitSpeechRecognition,P=null;if(null!=N){var V=document.createElement("img");V.className="geAdaptiveAsset";V.setAttribute("src",Editor.micImage);V.setAttribute("title",mxResources.get("dictate"));V.style.width="18px";V.style.cursor="pointer";V.style.opacity="0.7";V.style.flexShrink="0";V.style.borderRadius="50%";K.appendChild(V);var X=null;P=function(){if(null!=X){var ca=X;X=null;try{ca.stop()}catch(fa){}}V.style.backgroundColor=+"";V.style.opacity="0.7"};mxEvent.addListener(V,"click",function(){if(null!=X)P();else try{var ca=new N;ca.continuous=!0;ca.interimResults=!0;var fa=v.value;ca.onresult=function(oa){for(var pa="",wa=0;wa<oa.results.length;wa++)pa+=oa.results[wa][0].transcript;v.value=fa+(""!=fa&&""!=pa&&" "!=fa.charAt(fa.length-1)?" ":"")+pa;d()};ca.onerror=function(oa){X==ca&&(P(),null==oa||"not-allowed"!=oa.error&&"service-not-allowed"!=oa.error||b.alert(mxResources.get("error")+": "+oa.error))};ca.onend=function(){X==+ca&&P()};X=ca;V.style.backgroundColor="light-dark(#fbd2d2, #7a3a3a)";V.style.opacity="1";ca.start()}catch(oa){P(),b.handleError(oa)}})}var H=function(ca,fa){for(var oa=[],pa=0;pa<ca.length;pa++)oa.push(("assistant"==ca[pa].role?"Assistant: ":"User: ")+ca[pa].content);return 0<oa.length?"Previous conversation:\n\n"+oa.join("\n\n")+"\n\nRequest: "+fa:fa},W=function(){var ca=mxUtils.trim(v.value)+(null!=M?"\n\nDiagram XML:\n"+M.data:"");return null!=E?H(E.turns,ca).length:ca.length},Z=document.createElement("span");Z.style.display="none";Z.style.alignItems="center";Z.style.justifyContent="center";Z.style.flexShrink="0";Z.style.cursor="pointer";Z.style.padding="3px";Z.style.borderRadius="50%";Z.style.lineHeight="0";mxEvent.addListener(Z,"mouseenter",function(){Z.style.backgroundColor="light-dark(#0000000f, #ffffff24)"});mxEvent.addListener(Z,"mouseleave",function(){Z.style.backgroundColor=""});D=document.createElementNS("http://www.w3.org/2000/svg","svg");D.setAttribute("width","13");D.setAttribute("height",-"13");D.setAttribute("viewBox","0 0 36 36");D.style.display="block";var X=document.createElementNS("http://www.w3.org/2000/svg","circle");X.setAttribute("cx","18");X.setAttribute("cy","18");X.setAttribute("r","14");X.setAttribute("fill","none");X.setAttribute("stroke","light-dark(#d8d8d8, #555555)");X.setAttribute("stroke-width","5");D.appendChild(X);var ba=document.createElementNS("http://www.w3.org/2000/svg","circle");ba.setAttribute("cx","18");ba.setAttribute("cy","18");ba.setAttribute("r","14");-ba.setAttribute("fill","none");ba.setAttribute("stroke-width","5");ba.setAttribute("stroke-linecap","round");ba.setAttribute("pathLength","100");ba.setAttribute("transform","rotate(-90 18 18)");D.appendChild(ba);Z.appendChild(D);J.appendChild(Z);var ea=document.createElement("div");ea.style.position="fixed";ea.style.display="none";ea.style.zIndex="10000";ea.style.width="210px";ea.style.boxSizing="border-box";ea.style.padding="10px 12px";ea.style.borderRadius="8px";ea.style.fontSize="11px";ea.style.lineHeight=+"13");D.setAttribute("viewBox","0 0 36 36");D.style.display="block";var Y=document.createElementNS("http://www.w3.org/2000/svg","circle");Y.setAttribute("cx","18");Y.setAttribute("cy","18");Y.setAttribute("r","14");Y.setAttribute("fill","none");Y.setAttribute("stroke","light-dark(#d8d8d8, #555555)");Y.setAttribute("stroke-width","5");D.appendChild(Y);var ba=document.createElementNS("http://www.w3.org/2000/svg","circle");ba.setAttribute("cx","18");ba.setAttribute("cy","18");ba.setAttribute("r","14");+ba.setAttribute("fill","none");ba.setAttribute("stroke-width","5");ba.setAttribute("stroke-linecap","round");ba.setAttribute("pathLength","100");ba.setAttribute("transform","rotate(-90 18 18)");D.appendChild(ba);Z.appendChild(D);K.appendChild(Z);var ea=document.createElement("div");ea.style.position="fixed";ea.style.display="none";ea.style.zIndex="10000";ea.style.width="210px";ea.style.boxSizing="border-box";ea.style.padding="10px 12px";ea.style.borderRadius="8px";ea.style.fontSize="11px";ea.style.lineHeight="1.5";ea.style.background="light-dark(#ffffff, #2a2a2a)";ea.style.color="light-dark(#000000, #f0f0f0)";ea.style.border="1px solid light-dark(#d0d0d0, #505050)";ea.style.boxShadow="0 4px 14px rgba(0, 0, 0, 0.25)";document.body.appendChild(ea);var aa=null,ha=function(){var ca=Editor.maxPublicPromptLength,fa=W(),oa=Math.round(fa/ca*100),pa=ca-fa;ea.innerHTML="";var wa=document.createElement("div");wa.style.fontWeight="bold";wa.style.marginBottom="2px";mxUtils.write(wa,mxResources.get("draw.io"));ea.appendChild(wa);wa=document.createElement("div");wa.style.fontVariantNumeric="tabular-nums";mxUtils.write(wa,fa.toLocaleString()+" / "+ca.toLocaleString()+" ("+oa+"%)");ea.appendChild(wa);ca=document.createElement("div");ca.style.color=0>pa?"#e53935":"";mxUtils.write(ca,mxResources.get("charactersRemaining",[pa.toLocaleString()]));ea.appendChild(ca);pa=document.createElement("div");pa.style.marginTop="6px";pa.style.opacity="0.7";mxUtils.write(pa,mxResources.get("aiFreeModelHint"));ea.appendChild(pa)},na=function(ca){ca=mxEvent.getSource(ca);ca==Z||Z.contains(ca)||ca==ea||ea.contains(ca)||aa()};aa=function(){"none"!=ea.style.display&&(ea.style.display="none",mxEvent.removeListener(document,"mousedown",na))};mxEvent.addListener(Z,"click",function(ca){if("none"==ea.style.display){ha();ea.style.display="block";var fa=Z.getBoundingClientRect(),oa=ea.getBoundingClientRect();ea.style.left=Math.max(8,fa.right-oa.width)+"px";ea.style.top=(8>fa.top-oa.height-8?fa.bottom+8:fa.top-oa.height-8)+"px";mxEvent.addListener(document,-"mousedown",na)}else aa();mxEvent.consume(ca)});var ra=function(){var ca=Editor.maxPublicPromptLength;if("public"!=G().kind||0>=ca)Z.style.display="none",aa();else{var fa=W();if(0==fa)Z.style.display="none",aa();else{var oa=fa/ca;ba.setAttribute("stroke-dasharray",100*Math.max(0,Math.min(1,oa))+" 100");ba.setAttribute("stroke",1<oa?"#e53935":.8<=oa?"#f9a825":"#4d90fe");Z.setAttribute("title",mxResources.get("charactersRemaining",[(ca-fa).toLocaleString()])+" — "+fa.toLocaleString()+"/"+ca.toLocaleString()+-" ("+Math.round(100*oa)+"%)");Z.style.display="flex";"none"!=ea.style.display&&ha()}}};D=document.createElement("img");D.setAttribute("src",Editor.sendImage);D.setAttribute("title",mxResources.get("sendMessage"));D.className="geAdaptiveAsset";D.style.cursor="pointer";D.style.opacity="0.6";D.style.height="19px";D.style.flexShrink="0";J.appendChild(D);f.appendChild(q);c();var sa=function(ca){var fa=new mxCodec(mxUtils.createXmlDocument());fa.isObjectIgnored=function(oa){return oa.constructor==mxCell&&-!L.model.isRoot(oa)&&!L.model.isLayer(oa)&&!(null!=oa.id&&ca[oa.id])};fa=fa.encode(L.getModel());fa.ownerDocument.appendChild(fa);return fa},ua=function(ca,fa,oa){var pa=null;if(null!=fa&&1<fa.length&&0<fa[1].length)try{if(pa=b.stringToCells(fa[1]),0==pa.length){var wa=Editor.extractGraphModelFromText(fa[1]);null!=wa&&0<wa[1].length&&wa[1]!=fa[1]&&(pa=b.stringToCells(wa[1]))}}catch(va){throw Error(va.toString()+"\n\n"+fa[1]);}ca.innerHTML="";if(null!=pa&&0<pa.length){var za=L.getBoundingBoxFromGeometry(pa);-b.sidebar.graph.moveCells(pa,-za.x,-za.y);var ia=null,ka=function(){var va=L.getFreeInsertPoint();va=L.importCells(pa,va.x,va.y);L.setSelectionCells(va);return va};wa=function(va){null!=b.sidebar&&b.sidebar.hideTooltip();var Ca=null;L.model.beginUpdate();try{Ca=ka()}finally{L.model.endUpdate()}if(null!=oa.onInsert)oa.onInsert(Ca);null!=L.getSelectionCell()&&L.scrollCellToVisible(L.getSelectionCell());null!=va&&mxEvent.consume(va)};var da=null==oa.applyCtx?null:function(va){null!=b.sidebar&&b.sidebar.hideTooltip();-try{var Ca=oa.applyCtx.page,Ha=null;if(oa.applyCtx.fresh){var Ja=(new mxCodec(mxUtils.createXmlDocument())).encode(L.getModel());Ja.ownerDocument.appendChild(Ja);var Ra=new mxCodec(Ja.ownerDocument);Ha=new mxGraphModel;Ra.decode(Ja,Ha);Ca=b.currentPage}else{if(null==ia){var Va=new mxCodec(oa.applyCtx.xmlNode.ownerDocument);ia=new mxGraphModel;Va.decode(oa.applyCtx.xmlNode,ia)}Ha=ia}Ja=null;L.model.beginUpdate();try{if(null!=Ha&&null!=Ca&&null!=b.getPageIndex(Ca)){b.selectPage(Ca);var bb=mxUtils.parseXml(fa[1]),-ab=new mxCodec(bb),pb=new mxGraphModel;ab.decode(bb.documentElement,pb);var hb=b.diffCells(Ha.root,pb.root);b.patchPage(Ca,hb,null,!0);EditorUi.debug("EditorUi.ChatWindow.apply","base",Ha,"receivedModel",pb,"patch",hb);if(null!=oa.onApplied)oa.onApplied(bb.documentElement,Ca)}else Ja=ka()}finally{L.model.endUpdate()}if(null!=Ja&&null!=oa.onInsert)oa.onInsert(Ja);null!=L.getSelectionCell()&&L.scrollCellToVisible(L.getSelectionCell())}catch(wb){b.handleError(wb)}null!=va&&mxEvent.consume(va)};0<fa[0].length&&-ca.appendChild(F(fa[0]));var ja=b.getSvgForXml(fa[1]);ja.style.overflow="visible";ja.style.padding="1px";ja.style.cursor="move";ja.style.width="160px";ja.style.height="auto";ja.style.maxHeight="460px";var ta=document.createElement("a");ta.className="geItem";ta.style.padding="4px";ta.style.borderRadius="10px";ta.appendChild(ja);ca.appendChild(ta);b.sidebar.createItem(pa,oa.prompt,!0,!0,za.width,za.height,!0,!0,null!=da?da:wa,null,null,null,null,null,ta);null!=oa.infoLabel&&ta.setAttribute("title",+"mousedown",na)}else aa();mxEvent.consume(ca)});var ra=function(){var ca=Editor.maxPublicPromptLength;if("public"!=F().kind||0>=ca)Z.style.display="none",aa();else{var fa=W();if(0==fa)Z.style.display="none",aa();else{var oa=fa/ca;ba.setAttribute("stroke-dasharray",100*Math.max(0,Math.min(1,oa))+" 100");ba.setAttribute("stroke",1<oa?"#e53935":.8<=oa?"#f9a825":"#4d90fe");Z.setAttribute("title",mxResources.get("charactersRemaining",[(ca-fa).toLocaleString()])+" — "+fa.toLocaleString()+"/"+ca.toLocaleString()++" ("+Math.round(100*oa)+"%)");Z.style.display="flex";"none"!=ea.style.display&&ha()}}};D=document.createElement("img");D.setAttribute("src",Editor.sendImage);D.setAttribute("title",mxResources.get("sendMessage"));D.className="geAdaptiveAsset";D.style.cursor="pointer";D.style.opacity="0.6";D.style.height="19px";D.style.flexShrink="0";K.appendChild(D);f.appendChild(q);c();var sa=function(ca){var fa=new mxCodec(mxUtils.createXmlDocument());fa.isObjectIgnored=function(oa){return oa.constructor==mxCell&&+!J.model.isRoot(oa)&&!J.model.isLayer(oa)&&!(null!=oa.id&&ca[oa.id])};fa=fa.encode(J.getModel());fa.ownerDocument.appendChild(fa);return fa},ua=function(ca,fa,oa){var pa=null;if(null!=fa&&1<fa.length&&0<fa[1].length)try{if(pa=b.stringToCells(fa[1]),0==pa.length){var wa=Editor.extractGraphModelFromText(fa[1]);null!=wa&&0<wa[1].length&&wa[1]!=fa[1]&&(pa=b.stringToCells(wa[1]))}}catch(va){throw Error(va.toString()+"\n\n"+fa[1]);}ca.innerHTML="";if(null!=pa&&0<pa.length){var za=J.getBoundingBoxFromGeometry(pa);+b.sidebar.graph.moveCells(pa,-za.x,-za.y);var ia=null,ka=function(){var va=J.getFreeInsertPoint();va=J.importCells(pa,va.x,va.y);J.setSelectionCells(va);return va};wa=function(va){null!=b.sidebar&&b.sidebar.hideTooltip();var Ca=null;J.model.beginUpdate();try{Ca=ka()}finally{J.model.endUpdate()}if(null!=oa.onInsert)oa.onInsert(Ca);null!=J.getSelectionCell()&&J.scrollCellToVisible(J.getSelectionCell());null!=va&&mxEvent.consume(va)};var da=null==oa.applyCtx?null:function(va){null!=b.sidebar&&b.sidebar.hideTooltip();+try{var Ca=oa.applyCtx.page,Ha=null;if(oa.applyCtx.fresh){var Ja=(new mxCodec(mxUtils.createXmlDocument())).encode(J.getModel());Ja.ownerDocument.appendChild(Ja);var Ra=new mxCodec(Ja.ownerDocument);Ha=new mxGraphModel;Ra.decode(Ja,Ha);Ca=b.currentPage}else{if(null==ia){var Va=new mxCodec(oa.applyCtx.xmlNode.ownerDocument);ia=new mxGraphModel;Va.decode(oa.applyCtx.xmlNode,ia)}Ha=ia}Ja=null;J.model.beginUpdate();try{if(null!=Ha&&null!=Ca&&null!=b.getPageIndex(Ca)){b.selectPage(Ca);var bb=mxUtils.parseXml(fa[1]),+ab=new mxCodec(bb),pb=new mxGraphModel;ab.decode(bb.documentElement,pb);var hb=b.diffCells(Ha.root,pb.root);b.patchPage(Ca,hb,null,!0);EditorUi.debug("EditorUi.ChatWindow.apply","base",Ha,"receivedModel",pb,"patch",hb);if(null!=oa.onApplied)oa.onApplied(bb.documentElement,Ca)}else Ja=ka()}finally{J.model.endUpdate()}if(null!=Ja&&null!=oa.onInsert)oa.onInsert(Ja);null!=J.getSelectionCell()&&J.scrollCellToVisible(J.getSelectionCell())}catch(wb){b.handleError(wb)}null!=va&&mxEvent.consume(va)};0<fa[0].length&&+ca.appendChild(G(fa[0]));var ja=b.getSvgForXml(fa[1]);ja.style.overflow="visible";ja.style.padding="1px";ja.style.cursor="move";ja.style.width="160px";ja.style.height="auto";ja.style.maxHeight="460px";var ta=document.createElement("a");ta.className="geItem";ta.style.padding="4px";ta.style.borderRadius="10px";ta.appendChild(ja);ca.appendChild(ta);b.sidebar.createItem(pa,oa.prompt,!0,!0,za.width,za.height,!0,!0,null!=da?da:wa,null,null,null,null,null,ta);null!=oa.infoLabel&&ta.setAttribute("title",oa.infoLabel);za=document.createElement("div");za.style.display="flex";ja=document.createElement("img");ja.className="geAdaptiveAsset geLibraryButton";ja.setAttribute("src",Editor.copyImage);ja.setAttribute("title",mxResources.get("copy"));za.appendChild(ja);mxEvent.addListener(ja,"click",function(){b.writeTextToClipboard(fa[1],function(va){b.handleError(va)})});"draw.io"==b.getServiceName()&&(ja=ja.cloneNode(),ja.setAttribute("src",Editor.shareImage),ja.setAttribute("title",mxResources.get(b.isStandaloneApp()?-"export":"openInNewWindow")),za.appendChild(ja),mxEvent.addListener(ja,"click",function(va){b.isStandaloneApp()?b.saveData("export.xml","xml",fa[1],"text/xml"):b.editor.editAsNew(mxUtils.getXml(L.encodeCells(pa)))}));ja=ja.cloneNode();ja.setAttribute("src",Editor.magnifyImage);ja.setAttribute("title",mxResources.get("preview"));za.appendChild(ja);mxEvent.addListener(ja,"click",function(va){b.sidebar.createTooltip(ca,pa,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-+"export":"openInNewWindow")),za.appendChild(ja),mxEvent.addListener(ja,"click",function(va){b.isStandaloneApp()?b.saveData("export.xml","xml",fa[1],"text/xml"):b.editor.editAsNew(mxUtils.getXml(J.encodeCells(pa)))}));ja=ja.cloneNode();ja.setAttribute("src",Editor.magnifyImage);ja.setAttribute("title",mxResources.get("preview"));za.appendChild(ja);mxEvent.addListener(ja,"click",function(va){b.sidebar.createTooltip(ca,pa,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1600),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,1200),oa.prompt,!0,new mxPoint(mxEvent.getClientX(va),mxEvent.getClientY(va)),!0,null,!0,!1)});ja=ja.cloneNode();ja.setAttribute("src",Editor.plusImage);ja.setAttribute("title",mxResources.get("insert"));za.appendChild(ja);mxEvent.addListener(ja,"click",wa);null!=da&&(ja=ja.cloneNode(),ja.setAttribute("src",Editor.checkImage),ja.setAttribute("title",mxResources.get("apply")),za.appendChild(ja),-mxEvent.addListener(ja,"click",da));ca.appendChild(za);0<fa[2].length&&ca.appendChild(F(fa[2]))}else null==fa||null!=fa[1]&&0<fa[1].length?(null!=fa&&null!=fa[0]&&0<fa[0].length&&ca.appendChild(F(fa[0])),ca.appendChild(K({message:mxResources.get("errShowingDiag")},oa.retryFn))):(ca.style.whiteSpace="pre-wrap",ca.appendChild(F(fa[0])),null!=fa[2]&&0<fa[2].length&&ca.appendChild(F(fa[2])));ca.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})},xa=function(ca,fa,oa,pa){var wa=b.extractMermaidDeclaration(fa);+mxEvent.addListener(ja,"click",da));ca.appendChild(za);0<fa[2].length&&ca.appendChild(G(fa[2]))}else null==fa||null!=fa[1]&&0<fa[1].length?(null!=fa&&null!=fa[0]&&0<fa[0].length&&ca.appendChild(G(fa[0])),ca.appendChild(L({message:mxResources.get("errShowingDiag")},oa.retryFn))):(ca.style.whiteSpace="pre-wrap",ca.appendChild(G(fa[0])),null!=fa[2]&&0<fa[2].length&&ca.appendChild(G(fa[2])));ca.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})},xa=function(ca,fa,oa,pa){var wa=b.extractMermaidDeclaration(fa);null==wa?(ua(ca,Editor.extractGraphModelFromText(fa),oa),null!=oa.recordTurn&&oa.recordTurn(fa)):b.parseMermaidDiagram(wa,null,function(za){try{ua(ca,["",mxMermaidToDrawio.wrapGroup(za,wa,null),""],oa),null!=oa.recordTurn&&oa.recordTurn("```mermaid\n"+wa+"\n```\n\nThe same diagram as draw.io XML, use this as the basis for changes:\n\n```xml\n"+za+"\n```")}catch(ia){pa(ia)}},pa)},qa=function(ca,fa,oa){var pa=null,wa=null;return{record:function(za){null!=fa.parentNode&&(null==wa?(pa={role:"user",content:oa},wa={role:"assistant",content:za},ca.turns.push(pa,wa)):wa.content=za,ra())},amend:function(za){null!=wa&&(wa.content=za,ra())}}},Aa=function(ca,fa){var oa=new ca.constructor,pa;for(pa in ca){var wa=ca[pa];oa[pa]="object"===typeof wa?Aa(wa,fa):"string"===typeof wa?Editor.replacePlaceholders(wa,fa):wa}return oa},Ba=function(ca,fa){if(null!=ca&&null!=fa&&0<fa.length)if(Array.isArray(ca.messages)&&0<ca.messages.length){for(var oa=ca.messages[ca.messages.length-1],pa=ca.messages.slice(0,ca.messages.length--1),wa=[],za=0;za<fa.length;za++)wa.push({role:fa[za].role,content:fa[za].content});ca.messages=pa.concat(wa,[oa])}else if(Array.isArray(ca.contents)&&0<ca.contents.length){oa=ca.contents[ca.contents.length-1];oa.role="user";pa=ca.contents.slice(0,ca.contents.length-1);wa=[];for(za=0;za<fa.length;za++)wa.push({role:"assistant"==fa[za].role?"model":"user",parts:[{text:fa[za].content}]});ca.contents=pa.concat(wa,[oa])}},Ea=function(ca){var fa=z();fa.className="geSidebar";ca.el.appendChild(fa);var oa=-function(pa){fa.innerHTML="";fa.appendChild(K(pa,null));fa.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})};try{navigator.clipboard.readText().then(function(pa){try{xa(fa,mxUtils.trim(pa),{prompt:mxResources.get("paste"),applyCtx:{fresh:!0}},oa)}catch(wa){oa(wa)}})["catch"](oa)}catch(pa){oa(pa)}},Fa=function(ca,fa,oa,pa){var wa=z();wa.style.whiteSpace="pre-wrap";wa.style.marginBottom="2px";wa.style.marginLeft="40%";wa.style.borderRadius="10px";wa.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";+1),wa=[],za=0;za<fa.length;za++)wa.push({role:fa[za].role,content:fa[za].content});ca.messages=pa.concat(wa,[oa])}else if(Array.isArray(ca.contents)&&0<ca.contents.length){oa=ca.contents[ca.contents.length-1];oa.role="user";pa=ca.contents.slice(0,ca.contents.length-1);wa=[];for(za=0;za<fa.length;za++)wa.push({role:"assistant"==fa[za].role?"model":"user",parts:[{text:fa[za].content}]});ca.contents=pa.concat(wa,[oa])}},Ea=function(ca){var fa=y();fa.className="geSidebar";ca.el.appendChild(fa);var oa=+function(pa){fa.innerHTML="";fa.appendChild(L(pa,null));fa.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})};try{navigator.clipboard.readText().then(function(pa){try{xa(fa,mxUtils.trim(pa),{prompt:mxResources.get("paste"),applyCtx:{fresh:!0}},oa)}catch(wa){oa(wa)}})["catch"](oa)}catch(pa){oa(pa)}},Fa=function(ca,fa,oa,pa){var wa=y();wa.style.whiteSpace="pre-wrap";wa.style.marginBottom="2px";wa.style.marginLeft="40%";wa.style.borderRadius="10px";wa.style.backgroundColor="light-dark(#e0e0e0, #3a3a3a)";mxUtils.write(wa,""!=fa?fa:oa.label);ca.el.appendChild(wa);if(null!=oa&&""!=fa){var za=document.createElement("div");za.style.fontSize="10px";za.style.opacity="0.7";za.style.marginTop="4px";mxUtils.write(za,"+ "+oa.label);wa.appendChild(za)}""!=fa&&(wa=document.createElement("div"),wa.className="geInlineButtons",wa.style.display="flex",wa.style.justifyContent="end",ca.el.appendChild(wa),za=document.createElement("img"),za.className="geAdaptiveAsset geLibraryButton",za.setAttribute("src",Editor.copyImage),za.setAttribute("title",mxResources.get("copy")),wa.appendChild(za),mxEvent.addListener(za,"click",function(){b.writeTextToClipboard(fa,function(Pa){b.handleError(Pa)},function(){b.alert(mxResources.get("copiedToClipboard"))})}),za=za.cloneNode(),za.setAttribute("src",Editor.editImage),za.setAttribute("title",mxResources.get("edit")),wa.appendChild(za),mxEvent.addListener(za,"click",function(){v.value=fa;d();v.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?v.select():document.execCommand("selectAll",-!1,null)}));var ia=z();ia.className="geSidebar";ia.style.marginTop="2px";ca.el.appendChild(ia);var ka=qa(ca,ia,null==oa?fa:(""!=fa?fa+"\n\n":"")+"Diagram XML:\n```xml\n"+oa.data+"\n```"),da=null;null!=oa?"file"==oa.kind?ca.lastContext=null:(da={xmlNode:oa.xmlNode,page:oa.page},ca.lastContext=da):da=ca.lastContext;var ja=function(Pa){try{if(null!=Pa&&0!=Pa.length){for(var Za={},eb=function(Ya){null!=Ya.id&&(Za[Ya.id]=!0);for(var rb=0;rb<L.model.getChildCount(Ya);rb++)eb(L.model.getChildAt(Ya,rb))},-qb=0;qb<Pa.length;qb++)eb(Pa[qb]);var lb=sa(Za);ca.lastContext={xmlNode:lb,page:b.currentPage};ka.amend("The current diagram as draw.io XML (keep these cell ids when modifying it):\n```xml\n"+mxUtils.getXml(lb)+"\n```")}}catch(Ya){EditorUi.debug("EditorUi.ChatWindow.onInsert","error",Ya)}},ta=function(Pa,Za){ca.lastContext={xmlNode:Pa,page:Za}};wa=ca.turns.slice();var va=Date.now(),Ca=null,Ha=function(Pa){ia.innerHTML="";ia.appendChild(K(Pa,Ca));ia.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});+!1,null)}));var ia=y();ia.className="geSidebar";ia.style.marginTop="2px";ca.el.appendChild(ia);var ka=qa(ca,ia,null==oa?fa:(""!=fa?fa+"\n\n":"")+"Diagram XML:\n```xml\n"+oa.data+"\n```"),da=null;null!=oa?"file"==oa.kind?ca.lastContext=null:(da={xmlNode:oa.xmlNode,page:oa.page},ca.lastContext=da):da=ca.lastContext;var ja=function(Pa){try{if(null!=Pa&&0!=Pa.length){for(var Za={},eb=function(Ya){null!=Ya.id&&(Za[Ya.id]=!0);for(var rb=0;rb<J.model.getChildCount(Ya);rb++)eb(J.model.getChildAt(Ya,rb))},+qb=0;qb<Pa.length;qb++)eb(Pa[qb]);var lb=sa(Za);ca.lastContext={xmlNode:lb,page:b.currentPage};ka.amend("The current diagram as draw.io XML (keep these cell ids when modifying it):\n```xml\n"+mxUtils.getXml(lb)+"\n```")}}catch(Ya){EditorUi.debug("EditorUi.ChatWindow.onInsert","error",Ya)}},ta=function(Pa,Za){ca.lastContext={xmlNode:Pa,page:Za}};wa=ca.turns.slice();var va=Date.now(),Ca=null,Ha=function(Pa){ia.innerHTML="";ia.appendChild(L(Pa,Ca));ia.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});EditorUi.debug("EditorUi.ChatWindow.handleError","error",Pa);null!=window.console&&console.error(Pa)},Ja=function(){ia.innerHTML="";var Pa=document.createElement("div");Pa.style.display="flex";Pa.style.alignItems="center";mxUtils.write(Pa,mxResources.get("loading")+"...");var Za=document.createElement("img");Za.className="geAdaptiveAsset";Za.setAttribute("src",Editor.svgSpinImage);Za.style.width="16px";Za.style.height="16px";Za.style.marginLeft="6px";Pa.appendChild(Za);ia.appendChild(Pa);ia.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})};if("model"==pa.kind){var Ra=pa.model,Va=Editor.aiConfigs[Ra.config],bb=function(Pa){var Za=null;"prompt"==Pa?Za=fa:"data"==Pa&&null!=oa?Za=oa.data:"model"==Pa?Za=Ra.model:"apiKey"==Pa?Pa=Va.apiKey:"action"==Pa&&(Pa=null!=oa?"update":"create");null==Za&&(Za=Editor.replacePlaceholders(Editor.aiGlobals[Pa],bb));return Za},ab=Aa(Va.request,bb);Ba(ab,wa);Ca=function(){Ja();b.createTimeout(b.editor.generateTimeout,function(Pa){var Za=function(lb){Pa.clear();Ha(lb)},eb=Editor.replacePlaceholders(Va.endpoint,bb),qb=new mxXmlRequest(eb,JSON.stringify(ab),"POST");qb.setRequestHeaders=function(lb,Ya){lb.setRequestHeader("Content-Type","application/json");for(var rb in Va.requestHeaders)lb.setRequestHeader(rb,Editor.replacePlaceholders(Va.requestHeaders[rb],bb))};EditorUi.debug("EditorUi.ChatWindow.send","url",eb,"params",ab,"aiModel",Ra,"config",Va);qb.send(function(lb){if(Pa.clear())try{if(200<=lb.getStatus()&&299>=lb.getStatus()){var Ya=JSON.parse(lb.getText()),rb=Editor.executeSimpleJsonPath(Ya,Va.responsePath),yb=mxUtils.trim(0<rb.length?rb[0]:lb.getText()),ub=Date.now()-va;EditorUi.debug("EditorUi.ChatWindow.response","params",ab,"response",Ya,"text",[yb],"time",ub);xa(ia,yb,{prompt:fa,applyCtx:da,retryFn:Ca,recordTurn:ka.record,onInsert:ja,onApplied:ta,infoLabel:1==urlParams.test?pa.label+" ("+ub+" ms)":null},Za)}else{rb="Error: "+lb.getStatus();try{var Cb=JSON.parse(lb.getText());null!=Cb&&null!=Cb.error&&null!=Cb.error.message&&(rb=Cb.error.message)}catch(Wa){}Ha({message:rb})}}catch(Wa){Za(Wa)}},Za)},-Ha)};Ca()}else if("public"==pa.kind){var pb=H(wa,fa+(null!=oa?"\n\nDiagram XML:\n"+oa.data:""));Ca=function(){var Pa=Editor.maxPublicPromptLength;0<Pa&&pb.length>Pa?(ia.innerHTML="",ia.appendChild(K({message:mxResources.get("promptTooLarge",[Pa])},null)),ia.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})):(Ja(),b.generateOpenAiMermaidDiagram(pb,function(Za){try{var eb=Date.now()-va;ua(ia,["",Za,""],{prompt:fa,applyCtx:da,retryFn:Ca,onInsert:ja,onApplied:ta,infoLabel:1==urlParams.test?+Ha)};Ca()}else if("public"==pa.kind){var pb=H(wa,fa+(null!=oa?"\n\nDiagram XML:\n"+oa.data:""));Ca=function(){var Pa=Editor.maxPublicPromptLength;0<Pa&&pb.length>Pa?(ia.innerHTML="",ia.appendChild(L({message:mxResources.get("promptTooLarge",[Pa])},null)),ia.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})):(Ja(),b.generateOpenAiMermaidDiagram(pb,function(Za){try{var eb=Date.now()-va;ua(ia,["",Za,""],{prompt:fa,applyCtx:da,retryFn:Ca,onInsert:ja,onApplied:ta,infoLabel:1==urlParams.test?pa.label+" ("+eb+" ms)":null});ka.record(Za)}catch(qb){Ha(qb)}},Ha))};Ca()}else{wa=null;wa=""==fa&&null!=oa?oa.data:Editor.replacePlaceholders(Editor.aiGlobals[null!=oa?"update":"create"],function(Pa){return"data"==Pa&&null!=oa?oa.data:null})+"\n\n"+fa;var hb=null,wb=function(){var Pa=mxUtils.button(mxResources.get("pasteResponse"),function(){try{navigator.clipboard.readText().then(function(Za){try{ia.innerHTML="",xa(ia,mxUtils.trim(Za),{prompt:""!=fa?fa:oa.label,applyCtx:da,recordTurn:ka.record,-onInsert:ja,onApplied:ta},hb)}catch(eb){hb(eb)}})["catch"](hb)}catch(Za){hb(Za)}});Pa.className="geBtn";Pa.style.margin="6px 0 0 0";ia.appendChild(Pa)};hb=function(Pa){ia.innerHTML="";ia.appendChild(K(Pa,null));wb();ia.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})};b.writeTextToClipboard(wa,function(Pa){Ha(Pa)},function(){ia.innerHTML="";var Pa=document.createElement("div");mxUtils.write(Pa,mxResources.get("copiedToClipboard"));ia.appendChild(Pa);wb();ia.scrollIntoView({behavior:"smooth",-block:"end",inline:"nearest"})})}};mxEvent.addListener(D,"click",M);mxEvent.addListener(v,"keydown",function(ca){13!=ca.keyCode||mxEvent.isShiftDown(ca)||(M(),mxEvent.consume(ca))});this.generate=mxUtils.bind(this,function(ca){null!=E&&null==E.el.firstChild||I(B());v.value=ca;d();M()});I(B());this.window=new mxWindow(mxResources.get("generate"),k,l,p,g,x,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);+onInsert:ja,onApplied:ta},hb)}catch(eb){hb(eb)}})["catch"](hb)}catch(Za){hb(Za)}});Pa.className="geBtn";Pa.style.margin="6px 0 0 0";ia.appendChild(Pa)};hb=function(Pa){ia.innerHTML="";ia.appendChild(L(Pa,null));wb();ia.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})};b.writeTextToClipboard(wa,function(Pa){Ha(Pa)},function(){ia.innerHTML="";var Pa=document.createElement("div");mxUtils.write(Pa,mxResources.get("copiedToClipboard"));ia.appendChild(Pa);wb();ia.scrollIntoView({behavior:"smooth",+block:"end",inline:"nearest"})})}};mxEvent.addListener(D,"click",O);mxEvent.addListener(v,"keydown",function(ca){13!=ca.keyCode||mxEvent.isShiftDown(ca)||(O(),mxEvent.consume(ca))});this.generate=mxUtils.bind(this,function(ca){null!=E&&null==E.el.firstChild||I(A());v.value=ca;d();O()});I(A());this.window=new mxWindow(mxResources.get("generate"),k,l,p,g,x,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);b.isOffline()||(l=b.createHelpIcon("https://www.drawio.com/doc/faq/configure-ai-options"),l.style.cursor="help",l.style.opacity="0.5",this.window.buttons.insertBefore(l,this.window.buttons.firstChild));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();v.focus()}));this.window.addListener("hide",function(){aa()});this.window.addListener(mxEvent.DESTROY,function(){aa();b.removeListener(n);null!=ea.parentNode&&ea.parentNode.removeChild(ea)});b.installResizeHandler(this,-!0)},TagsWindow=function(b,l,p,g,x){var B=b.editor.graph,z=null;if(!b.isOffline()||mxClient.IS_CHROMEAPP)z=b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var F=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),null,function(K,M){if(B.isEnabled()){var L=new FilenameDialog(b,"",mxResources.get("add"),function(Q){b.hideDialog();if(null!=Q&&0<Q.length){Q=Q.split(" ");for(var c=[],f=[],k=0;k<Q.length;k++){var n=mxUtils.trim(Q[k]);""!=-n&&(f.push(n),0>mxUtils.indexOf(K,n)&&c.push(n))}B.isSelectionEmpty()?M(K.concat(c)):B.addTagsForCells(B.getSelectionCells(),f)}},mxResources.get("tags"),null,null,"https://www.drawio.com/blog/tags-in-diagrams");b.showDialog(L.container,320,80,!0,!0);L.init()}},z);z=F.div;this.window=new mxWindow(mxResources.get("tags"),z,l,p,g,x,!0,!0);this.window.minimumSize=new mxRectangle(0,0,212,120);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);-this.window.addListener("show",mxUtils.bind(this,function(){F.refresh();this.window.fit()}));b.installResizeHandler(this,!0)},AnimationDialog=function(b,l,p,g,x,B){B=B||{};var z=B.kind||"page",F=b.editor.graph,K=SelectorChips.create(F,b),M=new Set,L=[],Q=function(){return B.windowTitleKey?mxResources.get(B.windowTitleKey,null,B.windowTitleFallback||"Animation"):mxResources.get("animation",null,"Animation")},c=document.createElement("div");c.style.cssText="padding:18px;box-sizing:border-box;height:100%;display:flex;flex-direction:column;font-size:13px;overflow:hidden;color:light-dark(#1d1d1f,#e0e0e0)";-var f=null,k=null;if(B.showTitle){var n=document.createElement("div");n.style.cssText="display:flex;align-items:center;gap:8px;margin-bottom:8px;flex:0 0 auto";k=document.createElement("span");k.style.cssText="font-weight:600;flex:0 0 auto";var q=function(){k.textContent="";mxUtils.write(k,mxResources.get("title",null,"Title")+":")};q();L.push(q);n.appendChild(k);f=document.createElement("input");f.type="text";f.style.cssText="flex:1;padding:4px 6px;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:4px;background:light-dark(#ffffff,#1c1c1e);color:light-dark(#1d1d1f,#e0e0e0)";-var t=function(){f.placeholder=mxResources.get("optional",null,"optional");f.title=mxResources.get("title",null,"Title")};t();L.push(t);n.appendChild(f);c.appendChild(n)}var u=document.createElement("div");u.style.cssText="display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;flex:0 0 auto";var y=null,E=null;if("page"==z){var I=document.createElement("label");I.className="geDialogHint";I.style.cssText="display:flex;align-items:center;gap:4px;cursor:pointer";y=document.createElement("input");-y.type="checkbox";y.style.margin="0";I.appendChild(y);var C=document.createElement("span"),U=function(){C.textContent="";mxUtils.write(C,mxResources.get("loop",null,"Loop"))};U();L.push(U);I.appendChild(C);u.appendChild(I);var J=document.createElement("span");J.style.cssText="flex:1;display:flex;justify-content:center";var S=document.createElement("label");S.className="geDialogHint";S.style.cssText="display:flex;align-items:center;gap:4px;cursor:pointer";E=document.createElement("input");E.type="checkbox";-E.style.margin="0";S.appendChild(E);var N=document.createElement("span"),R=function(){N.textContent="";mxUtils.write(N,mxResources.get("disabled",null,"Disabled"))};R();L.push(R);S.appendChild(N);J.appendChild(S);u.appendChild(J)}else{var T=document.createElement("span");u.appendChild(T)}var v=document.createElement("label");v.className="geDialogHint";v.style.cssText="display:flex;align-items:center;gap:4px;cursor:pointer";var d=document.createElement("input");d.type="checkbox";d.style.margin="0";-v.appendChild(d);var m=document.createElement("span"),r=function(){m.textContent="";mxUtils.write(m,mxResources.get("editText",null,"Edit Text"))};r();L.push(r);v.appendChild(m);u.appendChild(v);c.appendChild(u);var A=document.createElement("div");A.style.cssText="flex:1 1 0;min-height:0;overflow:auto;padding:4px;box-sizing:border-box;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:6px;background:light-dark(#ffffff,#1c1c1e)";containDragEvents(A);c.appendChild(A);var D=document.createElement("textarea");-D.spellcheck=!1;D.style.cssText="display:none;width:100%;flex:1 1 0;min-height:0;resize:none;font-family:monospace;font-size:12px;padding:8px;box-sizing:border-box;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:6px;background:light-dark(#ffffff,#1c1c1e);color:light-dark(#1d1d1f,#e0e0e0)";c.appendChild(D);var G=document.createElement("div");G.style.cssText="display:none;flex:0 0 auto;margin-top:6px;padding:6px 8px;border-radius:6px;font-size:12px;background:light-dark(#fde7e9,#3a1d1f);color:light-dark(#b3261e,#ffb4ab);border:1px solid light-dark(#f1aeb5,#7a2e2e);white-space:pre-wrap;word-break:break-word";-c.appendChild(G);var O=!0,P=function(la){O=null==la;G.style.display=null==la?"none":"block";null!=la&&(G.textContent=la)},V=function(la,ma){ma=null!=ma&&null!=ma.message?ma.message:String(ma);if(!/line \d+/i.test(ma)){var ya=ma.match(/at position (\d+)/i);null!=ya&&(ya=Math.min(parseInt(ya[1],10),la.length),la=la.substring(0,ya).split("\n"),ma+=" (line "+la.length+" column "+(la[la.length-1].length+1)+")")}return mxResources.get("error",null,"Error")+": "+ma},Y=function(){try{Editor.parseAnimationData(D.value),-P(null)}catch(la){P(V(D.value,la))}},H={steps:[]},W=F.getModel().getRoot(),Z=function(){if("page"==z){var la=F.getAttributeForCell(W,"animation");try{H=Editor.parseAnimationData(la)}catch(ma){H=Editor.parseAnimationData(null)}}else la=B.initial,H=Array.isArray(la)?{steps:JSON.parse(JSON.stringify(la))}:null!=la&&"object"==typeof la?JSON.parse(JSON.stringify(la)):{steps:[]};null==H.steps&&(H.steps=[]);"page"!=z&&(null!=H.loop&&delete H.loop,null!=H.enabled&&delete H.enabled);D.value=JSON.stringify(H,-null,2);null!=f&&(f.value=H.title||"");null!=y&&(y.checked=null==H.loop?!0:!!H.loop);null!=E&&(E.checked=null==H.enabled?!1:!H.enabled)};Z();var X=!1,ba=null,ea=null,aa=function(la){X=la;null!=ba&&(ba.className="geBtn"+(X?" gePrimaryBtn":""));null!=ea&&(ea.className="geBtn"+(X?"":" gePrimaryBtn"))};null!=E&&E.addEventListener("change",function(){H.enabled=!E.checked;D.value=JSON.stringify(H,null,2);aa(!0)});null!=y&&y.addEventListener("change",function(){H.loop=!!y.checked;D.value=JSON.stringify(H,+!0)},TagsWindow=function(b,l,p,g,x){var A=b.editor.graph,y=null;if(!b.isOffline()||mxClient.IS_CHROMEAPP)y=b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var G=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),null,function(L,O){if(A.isEnabled()){var J=new FilenameDialog(b,"",mxResources.get("add"),function(Q){b.hideDialog();if(null!=Q&&0<Q.length){Q=Q.split(" ");for(var c=[],f=[],k=0;k<Q.length;k++){var n=mxUtils.trim(Q[k]);""!=+n&&(f.push(n),0>mxUtils.indexOf(L,n)&&c.push(n))}A.isSelectionEmpty()?O(L.concat(c)):A.addTagsForCells(A.getSelectionCells(),f)}},mxResources.get("tags"),null,null,"https://www.drawio.com/blog/tags-in-diagrams");b.showDialog(J.container,320,80,!0,!0);J.init()}},y);y=G.div;this.window=new mxWindow(mxResources.get("tags"),y,l,p,g,x,!0,!0);this.window.minimumSize=new mxRectangle(0,0,212,120);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);+this.window.addListener("show",mxUtils.bind(this,function(){G.refresh();this.window.fit()}));b.installResizeHandler(this,!0)},AnimationDialog=function(b,l,p,g,x,A){A=A||{};var y=A.kind||"page",G=b.editor.graph,L=SelectorChips.create(G,b),O=new Set,J=[],Q=function(){return A.windowTitleKey?mxResources.get(A.windowTitleKey,null,A.windowTitleFallback||"Animation"):mxResources.get("animation",null,"Animation")},c=document.createElement("div");c.style.cssText="padding:18px;box-sizing:border-box;height:100%;display:flex;flex-direction:column;font-size:13px;overflow:hidden;color:light-dark(#1d1d1f,#e0e0e0)";+var f=null,k=null;if(A.showTitle){var n=document.createElement("div");n.style.cssText="display:flex;align-items:center;gap:8px;margin-bottom:8px;flex:0 0 auto";k=document.createElement("span");k.style.cssText="font-weight:600;flex:0 0 auto";var q=function(){k.textContent="";mxUtils.write(k,mxResources.get("title",null,"Title")+":")};q();J.push(q);n.appendChild(k);f=document.createElement("input");f.type="text";f.style.cssText="flex:1;padding:4px 6px;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:4px;background:light-dark(#ffffff,#1c1c1e);color:light-dark(#1d1d1f,#e0e0e0)";+var t=function(){f.placeholder=mxResources.get("optional",null,"optional");f.title=mxResources.get("title",null,"Title")};t();J.push(t);n.appendChild(f);c.appendChild(n)}var u=document.createElement("div");u.style.cssText="display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;flex:0 0 auto";var B=null,E=null;if("page"==y){var I=document.createElement("label");I.className="geDialogHint";I.style.cssText="display:flex;align-items:center;gap:4px;cursor:pointer";B=document.createElement("input");+B.type="checkbox";B.style.margin="0";I.appendChild(B);var C=document.createElement("span"),U=function(){C.textContent="";mxUtils.write(C,mxResources.get("loop",null,"Loop"))};U();J.push(U);I.appendChild(C);u.appendChild(I);var K=document.createElement("span");K.style.cssText="flex:1;display:flex;justify-content:center";var S=document.createElement("label");S.className="geDialogHint";S.style.cssText="display:flex;align-items:center;gap:4px;cursor:pointer";E=document.createElement("input");E.type="checkbox";+E.style.margin="0";S.appendChild(E);var M=document.createElement("span"),R=function(){M.textContent="";mxUtils.write(M,mxResources.get("disabled",null,"Disabled"))};R();J.push(R);S.appendChild(M);K.appendChild(S);u.appendChild(K)}else{var T=document.createElement("span");u.appendChild(T)}var v=document.createElement("label");v.className="geDialogHint";v.style.cssText="display:flex;align-items:center;gap:4px;cursor:pointer";var d=document.createElement("input");d.type="checkbox";d.style.margin="0";+v.appendChild(d);var m=document.createElement("span"),r=function(){m.textContent="";mxUtils.write(m,mxResources.get("editText",null,"Edit Text"))};r();J.push(r);v.appendChild(m);u.appendChild(v);c.appendChild(u);var z=document.createElement("div");z.style.cssText="flex:1 1 0;min-height:0;overflow:auto;padding:4px;box-sizing:border-box;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:6px;background:light-dark(#ffffff,#1c1c1e)";containDragEvents(z);c.appendChild(z);var D=document.createElement("textarea");+D.spellcheck=!1;D.style.cssText="display:none;width:100%;flex:1 1 0;min-height:0;resize:none;font-family:monospace;font-size:12px;padding:8px;box-sizing:border-box;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:6px;background:light-dark(#ffffff,#1c1c1e);color:light-dark(#1d1d1f,#e0e0e0)";c.appendChild(D);var F=document.createElement("div");F.style.cssText="display:none;flex:0 0 auto;margin-top:6px;padding:6px 8px;border-radius:6px;font-size:12px;background:light-dark(#fde7e9,#3a1d1f);color:light-dark(#b3261e,#ffb4ab);border:1px solid light-dark(#f1aeb5,#7a2e2e);white-space:pre-wrap;word-break:break-word";+c.appendChild(F);var N=!0,P=function(la){N=null==la;F.style.display=null==la?"none":"block";null!=la&&(F.textContent=la)},V=function(la,ma){ma=null!=ma&&null!=ma.message?ma.message:String(ma);if(!/line \d+/i.test(ma)){var ya=ma.match(/at position (\d+)/i);null!=ya&&(ya=Math.min(parseInt(ya[1],10),la.length),la=la.substring(0,ya).split("\n"),ma+=" (line "+la.length+" column "+(la[la.length-1].length+1)+")")}return mxResources.get("error",null,"Error")+": "+ma},X=function(){try{Editor.parseAnimationData(D.value),+P(null)}catch(la){P(V(D.value,la))}},H={steps:[]},W=G.getModel().getRoot(),Z=function(){if("page"==y){var la=G.getAttributeForCell(W,"animation");try{H=Editor.parseAnimationData(la)}catch(ma){H=Editor.parseAnimationData(null)}}else la=A.initial,H=Array.isArray(la)?{steps:JSON.parse(JSON.stringify(la))}:null!=la&&"object"==typeof la?JSON.parse(JSON.stringify(la)):{steps:[]};null==H.steps&&(H.steps=[]);"page"!=y&&(null!=H.loop&&delete H.loop,null!=H.enabled&&delete H.enabled);D.value=JSON.stringify(H,+null,2);null!=f&&(f.value=H.title||"");null!=B&&(B.checked=null==H.loop?!0:!!H.loop);null!=E&&(E.checked=null==H.enabled?!1:!H.enabled)};Z();var Y=!1,ba=null,ea=null,aa=function(la){Y=la;null!=ba&&(ba.className="geBtn"+(Y?" gePrimaryBtn":""));null!=ea&&(ea.className="geBtn"+(Y?"":" gePrimaryBtn"))};null!=E&&E.addEventListener("change",function(){H.enabled=!E.checked;D.value=JSON.stringify(H,null,2);aa(!0)});null!=B&&B.addEventListener("change",function(){H.loop=!!B.checked;D.value=JSON.stringify(H,null,2);aa(!0)});null!=f&&(f.addEventListener("input",function(){f.value?H.title=f.value:delete H.title;aa(!0)}),f.addEventListener("keydown",function(la){13!==la.keyCode||la.shiftKey||la.isComposing||null==ba||(la.preventDefault(),ba.click())}));var ha="wait fadeIn fadeOut fadeTo opacity wipeIn wipeOut popIn popOut flow toggle show hide select style toggleStyle highlight scroll viewbox open tags".split(" "),na=function(la){for(var ma=0;ma<ha.length;ma++)if(void 0!==la[ha[ma]])return ha[ma];return null},ra=function(la){var ma=na(la);return null==ma||"wait"==ma?null:la[ma]},sa=function(la){var ma=na(la);if("fadeTo"==ma)return ma=la.fadeTo.value,1===ma?{icon:"↗",text:mxResources.get("fadeIn",null,"Fade In")}:0===ma?{icon:"↘",text:mxResources.get("fadeOut",null,"Fade Out")}:{icon:"◐",text:mxResources.get("fadeTo",null,"Fade To")};if("flow"==ma)return!0===la.flow.start?{icon:"➡",text:mxResources.get("flowOn",null,"Flow On")}:!1===la.flow.start?{icon:"⏸",text:mxResources.get("flowOff",null,"Flow Off")}:{icon:"➡",text:mxResources.get("flowOn",null,"Flow Toggle")};if("opacity"==ma)return{icon:"◐",text:mxResources.get("setOpacity",null,"Set Opacity")};la=null!=ma?CustomActionDialog.SCHEMAS[ma]:null;return null!=la?{icon:la.icon||"?",text:mxResources.get(la.labelKey||ma,null,la.label||ma)}:{icon:"?",text:ma||"?"}},ua=function(){D.value=JSON.stringify(H,null,2);aa(!0);Ra()},xa=function(){D.value=JSON.stringify(H,null,2);aa(!0)},qa=new Set,Aa=null,Ba=null,Ea=null,Fa=null,ca=null,fa=function(la,ma){null!=la&&(la.disabled=!ma,la.style.opacity=ma?"":"0.3",la.style.cursor=ma?"pointer":"default")},oa=function(){var la=AnimationDialog.stepsClipboard;fa(Ba,0<qa.size);fa(Fa,0<qa.size);fa(ca,0<qa.size);fa(Ea,null!=la&&0<la.length)},pa=function(){return Array.from(qa).sort(function(la,ma){return la-ma})},wa=function(){if(0!=qa.size){for(var la=pa(),ma=[],ya=0;ya<la.length;ya++)ma.push(JSON.parse(JSON.stringify(H.steps[la[ya]])));AnimationDialog.stepsClipboard=ma;if(null!=navigator.clipboard&&null!=navigator.clipboard.writeText)navigator.clipboard.writeText(JSON.stringify(ma,-null,2))["catch"](function(){});oa()}},za=function(la,ma){la=JSON.parse(JSON.stringify(la));Array.prototype.splice.apply(H.steps,[ma,0].concat(la));qa.clear();for(var ya=0;ya<la.length;ya++)qa.add(ma+ya);Aa=ma;ua();ma=A.querySelector('[data-step-idx="'+ma+'"]');null!=ma&&null!=ma.scrollIntoView&&ma.scrollIntoView({block:"nearest"})},ia=function(){var la=AnimationDialog.stepsClipboard;if(null!=la&&0!=la.length){var ma=pa();za(la,0<ma.length?ma[ma.length-1]+1:H.steps.length)}},ka=function(){if(0!=qa.size){for(var la=+null,2))["catch"](function(){});oa()}},za=function(la,ma){la=JSON.parse(JSON.stringify(la));Array.prototype.splice.apply(H.steps,[ma,0].concat(la));qa.clear();for(var ya=0;ya<la.length;ya++)qa.add(ma+ya);Aa=ma;ua();ma=z.querySelector('[data-step-idx="'+ma+'"]');null!=ma&&null!=ma.scrollIntoView&&ma.scrollIntoView({block:"nearest"})},ia=function(){var la=AnimationDialog.stepsClipboard;if(null!=la&&0!=la.length){var ma=pa();za(la,0<ma.length?ma[ma.length-1]+1:H.steps.length)}},ka=function(){if(0!=qa.size){for(var la=pa(),ma=[],ya=0;ya<la.length;ya++)ma.push(H.steps[la[ya]]);za(ma,la[la.length-1]+1)}},da=function(){if(0!=qa.size){for(var la=pa(),ma=la.length-1;0<=ma;ma--)H.steps.splice(la[ma],1);qa.clear();Aa=null;ua()}},ja=null,ta=function(la,ma){var ya=document.createElement("span");ya.style.cssText="flex:0 0 14px;text-align:center;font-size:14px;line-height:1;color:light-dark(#86868b,#86868b);cursor:grab;user-select:none";ya.title=mxResources.get("reorder",null,"Drag to reorder");ya.textContent="⋮⋮";ya.addEventListener("mousedown",-function(){la.draggable=!0});ya.addEventListener("mouseup",function(){la.draggable=!1});la.addEventListener("dragstart",function(Ga){ja={sourceIndex:ma};Ga.dataTransfer.effectAllowed="move";Ga.dataTransfer.setData("text/plain","animstep");la.style.opacity="0.4"});la.addEventListener("dragend",function(){la.draggable=!1;la.style.opacity="";for(var Ga=A.querySelectorAll("div"),Ia=0;Ia<Ga.length;Ia++)Ga[Ia].style.borderTop="",Ga[Ia].style.borderBottom="";ja=null});return ya},va=function(la,ma){la.addEventListener("dragover",+function(){la.draggable=!0});ya.addEventListener("mouseup",function(){la.draggable=!1});la.addEventListener("dragstart",function(Ga){ja={sourceIndex:ma};Ga.dataTransfer.effectAllowed="move";Ga.dataTransfer.setData("text/plain","animstep");la.style.opacity="0.4"});la.addEventListener("dragend",function(){la.draggable=!1;la.style.opacity="";for(var Ga=z.querySelectorAll("div"),Ia=0;Ia<Ga.length;Ia++)Ga[Ia].style.borderTop="",Ga[Ia].style.borderBottom="";ja=null});return ya},va=function(la,ma){la.addEventListener("dragover",function(ya){if(null!=ja){var Ga=la.getBoundingClientRect(),Ia=(Ga=ya.clientY>Ga.top+Ga.height/2)?ma+1:ma,Sa=ja.sourceIndex;Ia==Sa||Ia==Sa+1?(la.style.borderTop="",la.style.borderBottom=""):(ya.preventDefault(),ya.dataTransfer.dropEffect="move",la._dropInsertAt=Ia,Ga?(la.style.borderTop="",la.style.borderBottom="2px solid light-dark(#007aff,#0a84ff)"):(la.style.borderBottom="",la.style.borderTop="2px solid light-dark(#007aff,#0a84ff)"))}});la.addEventListener("dragleave",function(){la.style.borderTop="";la.style.borderBottom=""});la.addEventListener("drop",function(ya){if(null!=ja){ya.preventDefault();ya.stopPropagation();la.style.borderTop="";la.style.borderBottom="";ya=ja.sourceIndex;var Ga=null!=la._dropInsertAt?la._dropInsertAt:ma;if(Ga!=ya&&Ga!=ya+1){var Ia=H.steps.splice(ya,1)[0];ya<Ga&&Ga--;H.steps.splice(Ga,0,Ia);qa.clear();Aa=null;ua()}}})},Ca=function(la,ma,ya,Ga){var Ia=document.createElement("button");Ia.type="button";Ia.title=ma;Ia.style.cssText="flex:0 0 22px;height:22px;line-height:1;padding:0;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:3px;background:transparent;cursor:pointer;font-size:14px;color:light-dark(#1d1d1f,#e0e0e0)";ya||(Ia.disabled=!0,Ia.style.opacity="0.3",Ia.style.cursor="default");mxUtils.write(Ia,la);ya&&Ia.addEventListener("click",Ga);return Ia},Ha=function(la,ma){ma=ma||{};var ya=document.createElement("input");ya.type="number";null!=ma.min&&(ya.min=ma.min);null!=ma.max&&(ya.max=ma.max);null!=ma.step&&(ya.step=ma.step);null!=ma.placeholder&&(ya.placeholder=ma.placeholder);null!=la&&(ya.value=la);ya.className="geNoSpin";ya.style.cssText="padding:2px 4px;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:3px;background:light-dark(#ffffff,#1c1c1e);color:light-dark(#1d1d1f,#e0e0e0)";return ya},Ja=function(la,ma,ya,Ga){if(null!=Ga){Ga=document.createElement("span");Ga.style.cssText="display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;gap:6px";var Ia=function(Ta){return{get:function(){var Ma=H.steps[ma]&&H.steps[ma][ya];return Ma&&Array.isArray(Ma[Ta])?Ma[Ta]:null},set:function(Ma){var ob=H.steps[ma][ya];ob&&"object"==typeof ob||(ob=H.steps[ma][ya]={});Ma&&Ma.length?ob[Ta]=Ma:delete ob[Ta];ua()}}},Sa=Ia("tags"),Db=function(){var Ta=H.steps[ma]&&H.steps[ma][ya];return Ta&&-"or"===Ta.tagsMatch?"or":"and"},kb=function(Ta){var Ma=H.steps[ma][ya];Ma&&"object"==typeof Ma||(Ma=H.steps[ma][ya]={});"or"===Ta?Ma.tagsMatch="or":delete Ma.tagsMatch;ua()},sb=Ia("layers"),Bb=CustomActionDialog.SCHEMAS[ya],tb=[];null!=Bb&&Bb.allowLayers&&tb.push({label:mxResources.get("selectLayers",null,"Select layers")+"…",disabled:function(){return 0==F.getModel().getChildCount(F.getModel().getRoot())},onClick:function(Ta){K.openLayerPicker(Ta,sb.get,sb.set)}});tb.push({label:mxResources.get("selectByTags",-null,"Select by tags")+"…",onClick:function(Ta){K.openTagPicker(Ta,Sa.get,Sa.set,Db,kb)}});tb.push({label:mxResources.get("excludeSelection",null,"Exclude selected cells"),disabled:function(){return 0==F.getSelectionCount()},onClick:function(){var Ta=F.getSelectionCells();if(0!=Ta.length){var Ma=H.steps[ma][ya];Ma&&"object"==typeof Ma||(Ma=H.steps[ma][ya]={});for(var ob=Array.isArray(Ma.excludeCells)?Ma.excludeCells.slice():[],Lb={},Ib=0;Ib<ob.length;Ib++)Lb[ob[Ib]]=!0;for(Ib=0;Ib<Ta.length;Ib++)Lb[Ta[Ib].id]||-(ob.push(Ta[Ib].id),Lb[Ta[Ib].id]=!0);Ma.excludeCells=ob;ua()}}});Bb=Ia("cells");Ga.appendChild(K.cellListField("",Bb.get,Bb.set,{allowWildcard:!0,extraMenuItems:tb}));tb=sb.get();Array.isArray(tb)&&0<tb.length&&Ga.appendChild(K.layerListField("",sb.get,sb.set));tb=Sa.get();Array.isArray(tb)&&0<tb.length&&Ga.appendChild(K.tagListField("",Sa.get,Sa.set,{getMode:Db,setMode:kb}));Ia=Ia("excludeCells");tb=Ia.get();Array.isArray(tb)&&0<tb.length&&Ga.appendChild(K.cellListField("",Ia.get,Ia.set,{allowWildcard:!1,-singularKey:"excluded",pluralKey:"excluded",singularFallback:"Excluded",pluralFallback:"Excluded"}));la.appendChild(Ga)}},Ra=function(){A.innerHTML="";if(0==H.steps.length){var la=document.createElement("div");la.style.cssText="padding:12px;text-align:center;color:light-dark(#86868b,#86868b);font-size:12px";mxUtils.write(la,mxResources.get("noStepsYet",null,"No steps yet. Add the first step below."));A.appendChild(la)}else for(la=0;la<H.steps.length;la++)A.appendChild(Pa(H.steps[la],la,la==H.steps.length-+"or"===Ta.tagsMatch?"or":"and"},kb=function(Ta){var Ma=H.steps[ma][ya];Ma&&"object"==typeof Ma||(Ma=H.steps[ma][ya]={});"or"===Ta?Ma.tagsMatch="or":delete Ma.tagsMatch;ua()},sb=Ia("layers"),Bb=CustomActionDialog.SCHEMAS[ya],tb=[];null!=Bb&&Bb.allowLayers&&tb.push({label:mxResources.get("selectLayers",null,"Select layers")+"…",disabled:function(){return 0==G.getModel().getChildCount(G.getModel().getRoot())},onClick:function(Ta){L.openLayerPicker(Ta,sb.get,sb.set)}});tb.push({label:mxResources.get("selectByTags",+null,"Select by tags")+"…",onClick:function(Ta){L.openTagPicker(Ta,Sa.get,Sa.set,Db,kb)}});tb.push({label:mxResources.get("excludeSelection",null,"Exclude selected cells"),disabled:function(){return 0==G.getSelectionCount()},onClick:function(){var Ta=G.getSelectionCells();if(0!=Ta.length){var Ma=H.steps[ma][ya];Ma&&"object"==typeof Ma||(Ma=H.steps[ma][ya]={});for(var ob=Array.isArray(Ma.excludeCells)?Ma.excludeCells.slice():[],Lb={},Ib=0;Ib<ob.length;Ib++)Lb[ob[Ib]]=!0;for(Ib=0;Ib<Ta.length;Ib++)Lb[Ta[Ib].id]||+(ob.push(Ta[Ib].id),Lb[Ta[Ib].id]=!0);Ma.excludeCells=ob;ua()}}});Bb=Ia("cells");Ga.appendChild(L.cellListField("",Bb.get,Bb.set,{allowWildcard:!0,extraMenuItems:tb}));tb=sb.get();Array.isArray(tb)&&0<tb.length&&Ga.appendChild(L.layerListField("",sb.get,sb.set));tb=Sa.get();Array.isArray(tb)&&0<tb.length&&Ga.appendChild(L.tagListField("",Sa.get,Sa.set,{getMode:Db,setMode:kb}));Ia=Ia("excludeCells");tb=Ia.get();Array.isArray(tb)&&0<tb.length&&Ga.appendChild(L.cellListField("",Ia.get,Ia.set,{allowWildcard:!1,+singularKey:"excluded",pluralKey:"excluded",singularFallback:"Excluded",pluralFallback:"Excluded"}));la.appendChild(Ga)}},Ra=function(){z.innerHTML="";if(0==H.steps.length){var la=document.createElement("div");la.style.cssText="padding:12px;text-align:center;color:light-dark(#86868b,#86868b);font-size:12px";mxUtils.write(la,mxResources.get("noStepsYet",null,"No steps yet. Add the first step below."));z.appendChild(la)}else for(la=0;la<H.steps.length;la++)z.appendChild(Pa(H.steps[la],la,la==H.steps.length-1));oa()},Va=function(la){var ma=document.createElement("div");ma.style.cssText="display:flex;align-items:center;gap:6px;min-width:max-content;padding:6px 4px;border-radius:4px;border-bottom:1px solid light-dark(rgba(0,0,0,0.05),rgba(255,255,255,0.05))";la&&(ma.style.borderBottom="none");return ma},bb=function(la){var ma=document.createElement("span");ma.style.cssText="flex:1 1 auto;min-width:0";la.appendChild(ma)},ab=function(la,ma){var ya=document.createElement("span");ya.style.cssText="flex:0 0 18px;text-align:center;font-size:14px";mxUtils.write(ya,ma);la.appendChild(ya);return ya},pb=function(la,ma){var ya=document.createElement("span");ya.style.cssText="flex:0 0 70px;font-weight:500;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis";ya.title=ma;mxUtils.write(ya,ma);la.appendChild(ya)},hb=function(la){return null!=la.titleKey?mxResources.get(la.titleKey,null,la.title||""):null!=la.title?la.title:null!=la.placeholderKey?mxResources.get(la.placeholderKey,null,la.placeholder||""):null!=la.placeholder?la.placeholder:null},wb=function(la,ma,ya,Ga,Ia){if(Ia){Ia=function(){return H.steps[ma][ya]};var Sa=function(Ma){H.steps[ma][ya]=null==Ma||""===Ma?"number"==Ga.type?0:"":Ma;xa()}}else Ia=function(){var Ma=H.steps[ma][ya];return null!=Ma&&"object"==typeof Ma?Ma[Ga.name]:void 0},Sa=function(Ma){var ob=H.steps[ma][ya];if(null==ob||"object"!=typeof ob)ob=H.steps[ma][ya]={};null==Ma||""===Ma?delete ob[Ga.name]:ob[Ga.name]=Ma;xa()};var Db=hb(Ga);if("checkbox"==Ga.type){var kb=document.createElement("label");kb.style.cssText="flex:0 0 auto;display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:light-dark(#1d1d1f,#e0e0e0);user-select:none";Db&&(kb.title=Db);var sb=document.createElement("input");sb.type="checkbox";sb.checked=!!Ia();sb.style.cssText="margin:0;accent-color:light-dark(#0071e3,#0a84ff)";sb.addEventListener("change",function(){sb.checked?Sa(!0):Sa(void 0)});kb.appendChild(sb);if(Ga.labelKey||Ga.label)Ia=document.createElement("span"),mxUtils.write(Ia,Ga.labelKey?mxResources.get(Ga.labelKey,-null,Ga.label||""):Ga.label||""),kb.appendChild(Ia);la.appendChild(kb)}else if("tagList"==Ga.type)Db=Ga.labelKey?mxResources.get(Ga.labelKey,null,Ga.label||""):Ga.label||"",la.appendChild(K.tagListField(Db,Ia,function(Ma){Array.isArray(Ma)&&0!=Ma.length?Sa(Ma):Sa(void 0)},(Ga.modeField?{getMode:function(){var Ma=H.steps[ma][ya];return Ma&&"or"===Ma[Ga.modeField]?"or":"and"},setMode:function(Ma){var ob=H.steps[ma][ya];if(null==ob||"object"!=typeof ob)ob=H.steps[ma][ya]={};"or"===Ma?ob[Ga.modeField]=+null,Ga.label||""):Ga.label||""),kb.appendChild(Ia);la.appendChild(kb)}else if("tagList"==Ga.type)Db=Ga.labelKey?mxResources.get(Ga.labelKey,null,Ga.label||""):Ga.label||"",la.appendChild(L.tagListField(Db,Ia,function(Ma){Array.isArray(Ma)&&0!=Ma.length?Sa(Ma):Sa(void 0)},(Ga.modeField?{getMode:function(){var Ma=H.steps[ma][ya];return Ma&&"or"===Ma[Ga.modeField]?"or":"and"},setMode:function(Ma){var ob=H.steps[ma][ya];if(null==ob||"object"!=typeof ob)ob=H.steps[ma][ya]={};"or"===Ma?ob[Ga.modeField]="or":delete ob[Ga.modeField];xa()}}:null)||void 0));else if("select"==Ga.type){var Bb=document.createElement("select");Bb.style.cssText="flex:0 0 auto;padding:2px 4px;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:3px;background:light-dark(#ffffff,#1c1c1e);color:light-dark(#1d1d1f,#e0e0e0)";for(kb=0;kb<Ga.options.length;kb++){var tb=document.createElement("option");tb.value=Ga.options[kb].value;tb.textContent=Ga.options[kb].label;Bb.appendChild(tb)}Ia=Ia();null!=Ia&&(Bb.value=String(Ia));Db&&(Bb.title=Db);Bb.addEventListener("change",function(){var Ma=Bb.value;""===Ma?Sa(void 0):"true"===Ma?Sa(!0):"false"===Ma?Sa(!1):Sa(Ma)});la.appendChild(Bb);Ga.label&&(Ia=document.createElement("span"),Ia.className="geDialogHint",Ia.style.cssText="flex:0 0 auto",mxUtils.write(Ia,Ga.label),la.appendChild(Ia))}else{if("number"==Ga.type){kb=null!=Ga.placeholderKey?mxResources.get(Ga.placeholderKey,null,Ga.placeholder||""):Ga.placeholder;var Ta=Ha(Ia(),{min:Ga.min,max:Ga.max,step:Ga.step,width:Ga.width||55,placeholder:kb})}else{Ta=document.createElement("input");Ta.type=Ga.type||"text";kb=Ga.width||("color"==Ga.type?36:80);Ta.style.cssText="color"==Ga.type?"flex:0 0 "+kb+"px;min-width:0;height:22px;padding:1px;cursor:pointer;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:3px;background:light-dark(#ffffff,#1c1c1e)":"flex:0 0 "+kb+"px;min-width:0;padding:2px 4px;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:3px;background:light-dark(#ffffff,#1c1c1e);color:light-dark(#1d1d1f,#e0e0e0)";if(kb=null!=Ga.placeholderKey?mxResources.get(Ga.placeholderKey,null,Ga.placeholder||""):Ga.placeholder)Ta.placeholder=kb;Ia=Ia();null!=Ia&&(Ta.value=String(Ia))}Db&&(Ta.title=Db);Ia=function(){var Ma=Ta.value;"number"==Ga.type?""===Ma?Sa(void 0):(Ma=parseFloat(Ma),isNaN(Ma)?Sa(void 0):Sa(Ma)):Sa(""===Ma?void 0:Ma)};Ta.addEventListener("change",Ia);Ta.addEventListener("input",Ia);la.appendChild(Ta);Ga.label&&(Ia=document.createElement("span"),Ia.className="geDialogHint",Ia.style.cssText="flex:0 0 auto",-mxUtils.write(Ia,Ga.label),la.appendChild(Ia))}},Pa=function(la,ma,ya){var Ga=sa(la),Ia=na(la),Sa=null!=Ia?CustomActionDialog.SCHEMAS[Ia]:null,Db=ra(la);ya=Va(ya);ya.setAttribute("data-step-idx",ma);M.has(ma)&&ya.classList.add("geAnimationStepActive");qa.has(ma)&&ya.classList.add("geAnimationStepSelected");var kb=document.createElement("input");kb.type="checkbox";kb.setAttribute("data-step-select","1");kb.checked=qa.has(ma);kb.title=mxResources.get("select",null,"Select");kb.style.cssText="flex:0 0 auto;margin:0;accent-color:light-dark(#0071e3,#0a84ff)";-kb.addEventListener("click",function(Ta){if(Ta.shiftKey&&null!=Aa){Ta=Math.max(Aa,ma);for(var Ma=Math.min(Aa,ma);Ma<=Ta;Ma++)qa.add(Ma)}else{if(kb.checked)qa.add(ma);else qa["delete"](ma);Aa=ma}Ta=A.querySelectorAll("[data-step-idx]");for(Ma=0;Ma<Ta.length;Ma++){var ob=parseInt(Ta[Ma].getAttribute("data-step-idx"),10);ob=qa.has(ob);Ta[Ma].classList.toggle("geAnimationStepSelected",ob);var Lb=Ta[Ma].querySelector("input[data-step-select]");null!=Lb&&(Lb.checked=ob)}oa()});ya.appendChild(kb);ya.appendChild(ta(ya,+mxUtils.write(Ia,Ga.label),la.appendChild(Ia))}},Pa=function(la,ma,ya){var Ga=sa(la),Ia=na(la),Sa=null!=Ia?CustomActionDialog.SCHEMAS[Ia]:null,Db=ra(la);ya=Va(ya);ya.setAttribute("data-step-idx",ma);O.has(ma)&&ya.classList.add("geAnimationStepActive");qa.has(ma)&&ya.classList.add("geAnimationStepSelected");var kb=document.createElement("input");kb.type="checkbox";kb.setAttribute("data-step-select","1");kb.checked=qa.has(ma);kb.title=mxResources.get("select",null,"Select");kb.style.cssText="flex:0 0 auto;margin:0;accent-color:light-dark(#0071e3,#0a84ff)";+kb.addEventListener("click",function(Ta){if(Ta.shiftKey&&null!=Aa){Ta=Math.max(Aa,ma);for(var Ma=Math.min(Aa,ma);Ma<=Ta;Ma++)qa.add(Ma)}else{if(kb.checked)qa.add(ma);else qa["delete"](ma);Aa=ma}Ta=z.querySelectorAll("[data-step-idx]");for(Ma=0;Ma<Ta.length;Ma++){var ob=parseInt(Ta[Ma].getAttribute("data-step-idx"),10);ob=qa.has(ob);Ta[Ma].classList.toggle("geAnimationStepSelected",ob);var Lb=Ta[Ma].querySelector("input[data-step-select]");null!=Lb&&(Lb.checked=ob)}oa()});ya.appendChild(kb);ya.appendChild(ta(ya,ma));va(ya,ma);var sb=document.createElement("button");sb.type="button";var Bb=function(){sb.textContent="";!0===la.immediate?(mxUtils.write(sb,"⏩︎"),sb.title=mxResources.get("immediate",null,"Immediate")):(mxUtils.write(sb,"⏱︎"),sb.title=mxResources.get("wait",null,"Wait"))};sb.style.cssText='flex:0 0 22px;height:22px;line-height:1;padding:0;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:3px;background:transparent;cursor:pointer;font-size:14px;color:light-dark(#1d1d1f,#e0e0e0);font-family:"Segoe UI Symbol","Apple Symbols",sans-serif;font-variant-emoji:text;filter:grayscale(1) contrast(2)';Bb();0===ma&&(sb.style.visibility="hidden");sb.addEventListener("click",function(){!0===la.immediate?(delete H.steps[ma].immediate,la.immediate=void 0):(H.steps[ma].immediate=!0,la.immediate=!0);Bb();xa()});ya.appendChild(sb);ab(ya,Ga.icon);pb(ya,Ga.text);if(null!=Sa&&null!=Sa.primary)bb(ya),wb(ya,ma,Ia,Sa.primary,!0);else{(null==Sa||Sa.selector)&&Ja(ya,ma,Ia,Db);bb(ya);if(null!=Sa&&Array.isArray(Sa.fields))for(Ga=0;Ga<Sa.fields.length;Ga++)wb(ya,ma,Ia,Sa.fields[Ga],!1);if(null!=Sa&&Sa.selector&&("wipeIn"==Ia||"wipeOut"==Ia||"popIn"==Ia||"popOut"==Ia)){var tb=Ha(Db.delay,{min:0,step:100,width:55,placeholder:"900"});tb.title=mxResources.get("duration",null,"Duration (ms)");tb.addEventListener("change",function(){var Ta=parseFloat(tb.value);Ta=""===tb.value||isNaN(Ta)||0>Ta?void 0:Ta;null==Ta?delete H.steps[ma][Ia].delay:H.steps[ma][Ia].delay=Ta;xa()});ya.appendChild(tb);Sa=document.createElement("span");Sa.className="geDialogHint";Sa.style.cssText="flex:0 0 auto";mxUtils.write(Sa,"ms");ya.appendChild(Sa)}"viewbox"==Ia&&(Sa=document.createElement("button"),Sa.type="button",Sa.className="geBtn",Sa.style.cssText="flex:0 0 auto;padding:2px 8px;font-size:11px;min-width:0",Sa.textContent=mxResources.get("useCurrent",null,"Use Current"),Sa.title=Sa.textContent,Sa.addEventListener("click",function(Ta){Ta.preventDefault();Ta=Fb();var Ma=H.steps[ma].viewbox;if(null==Ma||"object"!=typeof Ma)Ma=H.steps[ma].viewbox={};Ma.x=Ta.x;Ma.y=Ta.y;Ma.width=Ta.width;Ma.height=Ta.height;null==Ma.border&&(Ma.border=Ta.border);ua()}),-ya.appendChild(Sa))}Sa=Ca("▶",mxResources.get("preview",null,"Preview"),!0,function(){Oa();var Ta=JSON.parse(JSON.stringify(Graph.flattenAnimationActions([la])));F.executeCustomActions(Ta)});ya.appendChild(Sa);return ya};d.addEventListener("change",function(){d.checked?(A.style.display="none",D.style.display="block",Y()):(D.style.display="none",A.style.display="block",P(null),Ra())});D.addEventListener("input",function(){aa(!0);try{var la=Editor.parseAnimationData(D.value);null!=la&&Array.isArray(la.steps)&&-(H=la,qa.clear(),Aa=null,P(null),null!=y&&(y.checked=!!H.loop),null!=E&&(E.checked=!H.enabled),d.checked||Ra())}catch(ma){P(V(D.value,ma))}});Ra();var Za=document.createElement("div");Za.className="geDialogSection";Za.style.cssText="margin-top:10px;margin-bottom:0;flex:0 0 auto;display:flex;flex-direction:column;gap:8px";var eb=document.createElement("div");eb.style.cssText="display:flex;align-items:center;gap:8px;flex-wrap:wrap";Za.appendChild(eb);var qb=document.createElement("select");qb.style.cssText=-"flex:1 1 200px;min-width:180px;padding:5px 6px;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:4px;background:light-dark(#ffffff,#1c1c1e);color:light-dark(#1d1d1f,#e0e0e0);font-size:13px";var lb=[],Ya=document.createElement("option");Ya.value="";Ya.disabled=!0;Ya.selected=!0;var rb=function(){Ya.textContent=mxResources.get("add",null,"Add")+"…"};rb();L.push(rb);qb.appendChild(Ya);for(var yb=[{labelKey:"visibilityActions",label:"Visibility",keys:["toggle","show","hide"]},{labelKey:"effects",+ya.appendChild(Sa))}Sa=Ca("▶",mxResources.get("preview",null,"Preview"),!0,function(){Oa();var Ta=JSON.parse(JSON.stringify(Graph.flattenAnimationActions([la])));G.executeCustomActions(Ta)});ya.appendChild(Sa);return ya};d.addEventListener("change",function(){d.checked?(z.style.display="none",D.style.display="block",X()):(D.style.display="none",z.style.display="block",P(null),Ra())});D.addEventListener("input",function(){aa(!0);try{var la=Editor.parseAnimationData(D.value);null!=la&&Array.isArray(la.steps)&&+(H=la,qa.clear(),Aa=null,P(null),null!=B&&(B.checked=!!H.loop),null!=E&&(E.checked=!H.enabled),d.checked||Ra())}catch(ma){P(V(D.value,ma))}});Ra();var Za=document.createElement("div");Za.className="geDialogSection";Za.style.cssText="margin-top:10px;margin-bottom:0;flex:0 0 auto;display:flex;flex-direction:column;gap:8px";var eb=document.createElement("div");eb.style.cssText="display:flex;align-items:center;gap:8px;flex-wrap:wrap";Za.appendChild(eb);var qb=document.createElement("select");qb.style.cssText=+"flex:1 1 200px;min-width:180px;padding:5px 6px;border:1px solid light-dark(#d2d2d7,#48484a);border-radius:4px;background:light-dark(#ffffff,#1c1c1e);color:light-dark(#1d1d1f,#e0e0e0);font-size:13px";var lb=[],Ya=document.createElement("option");Ya.value="";Ya.disabled=!0;Ya.selected=!0;var rb=function(){Ya.textContent=mxResources.get("add",null,"Add")+"…"};rb();J.push(rb);qb.appendChild(Ya);for(var yb=[{labelKey:"visibilityActions",label:"Visibility",keys:["toggle","show","hide"]},{labelKey:"effects",label:"Effects",keys:"fadeIn fadeOut fadeTo wipeIn wipeOut popIn popOut".split(" ")},{labelKey:"style",label:"Style",keys:["opacity","style","toggleStyle","highlight","flow"]},{labelKey:"navigation",label:"Navigation",keys:["select","scroll","viewbox","open"]},{labelKey:"tags",label:"Tags",keys:["tags"]},{labelKey:"timing",label:"Timing",keys:["wait"]}],ub=0;ub<yb.length;ub++){var Cb=document.createElement("optgroup");Cb.label=mxResources.get(yb[ub].labelKey,null,yb[ub].label);lb.push({el:Cb,prop:"label",key:yb[ub].labelKey,fallback:yb[ub].label});for(var Wa=0;Wa<yb[ub].keys.length;Wa++){var mb=yb[ub].keys[Wa],Ua=CustomActionDialog.SCHEMAS[mb];if(null!=Ua){var nb=document.createElement("option");nb.value=mb;var Hb=Ua.labelKey||mb;nb.textContent=mxResources.get(Hb,null,Ua.label);lb.push({el:nb,prop:"textContent",key:Hb,fallback:Ua.label});Cb.appendChild(nb)}}qb.appendChild(Cb)}var jb=document.createElement("optgroup");jb.label="──────";var db=document.createElement("option");db.value="__deleteAll__";-db.className="geDeleteOpt";db.textContent=mxResources.get("deleteAll",null,"Delete All");lb.push({el:db,prop:"textContent",key:"deleteAll",fallback:"Delete All"});jb.appendChild(db);qb.appendChild(jb);L.push(function(){for(var la=0;la<lb.length;la++){var ma=lb[la];ma.el[ma.prop]=mxResources.get(ma.key,null,ma.fallback)}});eb.appendChild(qb);var Ab=[],vb=function(la,ma,ya,Ga){var Ia=mxResources.get(ma,null,ya);Ga=Ca("",Ia,!0,Ga);Ia=document.createElement("img");Ia.className="geAdaptiveAsset";Ia.setAttribute("src",-la);Ia.style.cssText="width:14px;height:14px;vertical-align:middle";Ga.appendChild(Ia);Ab.push({el:Ga,key:ma,fallback:ya});eb.appendChild(Ga);return Ga};Ba=vb(Editor.copyImage,"copy","Copy",wa);Ea=vb(Editor.pasteImage,"paste","Paste",ia);Fa=vb(Editor.duplicateImage,"duplicate","Duplicate",ka);ca=vb(Editor.trashImage,"delete","Delete",da);oa();L.push(function(){for(var la=0;la<Ab.length;la++){var ma=Ab[la];ma.el.title=mxResources.get(ma.key,null,ma.fallback)}});c.addEventListener("keydown",function(la){var ma=+db.className="geDeleteOpt";db.textContent=mxResources.get("deleteAll",null,"Delete All");lb.push({el:db,prop:"textContent",key:"deleteAll",fallback:"Delete All"});jb.appendChild(db);qb.appendChild(jb);J.push(function(){for(var la=0;la<lb.length;la++){var ma=lb[la];ma.el[ma.prop]=mxResources.get(ma.key,null,ma.fallback)}});eb.appendChild(qb);var Ab=[],vb=function(la,ma,ya,Ga){var Ia=mxResources.get(ma,null,ya);Ga=Ca("",Ia,!0,Ga);Ia=document.createElement("img");Ia.className="geAdaptiveAsset";Ia.setAttribute("src",+la);Ia.style.cssText="width:14px;height:14px;vertical-align:middle";Ga.appendChild(Ia);Ab.push({el:Ga,key:ma,fallback:ya});eb.appendChild(Ga);return Ga};Ba=vb(Editor.copyImage,"copy","Copy",wa);Ea=vb(Editor.pasteImage,"paste","Paste",ia);Fa=vb(Editor.duplicateImage,"duplicate","Duplicate",ka);ca=vb(Editor.trashImage,"delete","Delete",da);oa();J.push(function(){for(var la=0;la<Ab.length;la++){var ma=Ab[la];ma.el.title=mxResources.get(ma.key,null,ma.fallback)}});c.addEventListener("keydown",function(la){var ma=la.target,ya=null!=ma&&null!=ma.tagName?ma.tagName.toLowerCase():"";"textarea"==ya||"select"==ya||"input"==ya&&"checkbox"!=ma.type||null!=ma&&ma.isContentEditable||(ma=null!=la.key?la.key.toLowerCase():"",ya=!1,!("delete"!=ma&&"backspace"!=ma||la.metaKey||la.ctrlKey||la.altKey)&&0<qa.size?(da(),ya=!0):(mxClient.IS_MAC?la.metaKey:la.ctrlKey)&&!la.altKey&&("c"==ma&&0<qa.size&&""==window.getSelection().toString()?(wa(),ya=!0):"v"==ma&&null!=AnimationDialog.stepsClipboard&&0<AnimationDialog.stepsClipboard.length?-(ia(),ya=!0):"d"==ma&&0<qa.size&&(ka(),ya=!0)),ya&&(la.preventDefault(),la.stopPropagation()))});c.appendChild(Za);var Fb=function(){var la=F.view,ma=F.container,ya=la.scale;la=la.translate;return{x:Math.round(ma.scrollLeft/ya-la.x),y:Math.round(ma.scrollTop/ya-la.y),width:Math.round(ma.clientWidth/ya),height:Math.round(ma.clientHeight/ya),border:0}},Da=function(la,ma){var ya=CustomActionDialog.SCHEMAS[la];if(null==ya)return null;var Ga={};if(null!=ya.primary){var Ia=ya.primary.def;Ga[la]=null!=Ia?+(ia(),ya=!0):"d"==ma&&0<qa.size&&(ka(),ya=!0)),ya&&(la.preventDefault(),la.stopPropagation()))});c.appendChild(Za);var Fb=function(){var la=G.view,ma=G.container,ya=la.scale;la=la.translate;return{x:Math.round(ma.scrollLeft/ya-la.x),y:Math.round(ma.scrollTop/ya-la.y),width:Math.round(ma.clientWidth/ya),height:Math.round(ma.clientHeight/ya),border:0}},Da=function(la,ma){var ya=CustomActionDialog.SCHEMAS[la];if(null==ya)return null;var Ga={};if(null!=ya.primary){var Ia=ya.primary.def;Ga[la]=null!=Ia?"number"==ya.primary.type?parseFloat(Ia):Ia:"number"==ya.primary.type?0:""}else{Ia={};ya.selector&&Array.isArray(ma)&&0<ma.length&&(Ia.cells=ma.slice());if(Array.isArray(ya.fields))for(ma=0;ma<ya.fields.length;ma++){var Sa=ya.fields[ma];null!=Sa.def&&(Ia[Sa.name]="number"==Sa.type?parseFloat(Sa.def):Sa.def)}"viewbox"==la&&(ya=Fb(),null==Ia.x&&(Ia.x=ya.x),null==Ia.y&&(Ia.y=ya.y),null==Ia.width&&(Ia.width=ya.width),null==Ia.height&&(Ia.height=ya.height),null==Ia.border&&(Ia.border=ya.border));Ga[la]=-Ia}return Ga};qb.addEventListener("change",function(){var la=qb.value;qb.value="";if(la)if("__deleteAll__"==la)0!=H.steps.length&&b.confirm(mxResources.get("areYouSure",null,"Are you sure?"),function(){H.steps=[];qa.clear();Aa=null;ua()});else{var ma=CustomActionDialog.SCHEMAS[la];if(null!=ma){var ya=null;ma.selector&&(ma=F.getSelectionCells(),ya=0<ma.length?ma.map(function(Ga){return Ga.id}):[Editor.ANIMATION_ALL]);la=Da(la,ya);null!=la&&(H.steps.push(la),ua(),A.scrollTop=A.scrollHeight)}}});var Na=-null,Ka=null,Qa=null,La=function(){if(null!=Qa){var la=null!=Ka;Qa.disabled=!la;Qa.style.opacity=la?"":"0.4";Qa.style.cursor=la?"":"default"}},Oa=function(){null==Ka&&(Ka=new Editor.AnimationPlayer(F,H),Ka.snapshotOpacity(),La())},$a=function(){if(null!=Ka){Ka.restoreOpacity();for(var la=Ka.collectReferencedCells(),ma=[],ya=0;ya<la.length;ya++)F.getModel().isEdge(la[ya])&&ma.push(la[ya]);0<ma.length&&Editor.toggleFlowAnimation(F,ma,"stop");F.refresh();Ka=null;La()}},cb=function(){null!=Na&&(Na.stop(),-Na=null)},gb=document.createElement("div");gb.style.cssText="margin-top:20px;display:flex;gap:6px;flex:0 0 auto";var zb=function(la,ma){var ya=new Set;if(null!=la&&0<=la)for(ma=null!=ma?ma:la+1;la<ma;la++)ya.add(la);if(ya.size===M.size){la=!0;ma=$jscomp.makeIterator(ya);for(var Ga=ma.next();!Ga.done;Ga=ma.next())if(!M.has(Ga.value)){la=!1;break}if(la)return}M=ya;ya=A.querySelectorAll("[data-step-idx]");for(la=0;la<ya.length;la++)ma=parseInt(ya[la].getAttribute("data-step-idx"),10),ya[la].classList.toggle("geAnimationStepActive",-M.has(ma))};gb.appendChild(b.createHelpIcon(ANIMATION_HELP_URL));var ib=this,Eb=function(){if("page"==z){var la=F.getModel().getRoot(),ma={steps:H.steps};!1===H.loop&&(ma.loop=!1);!1===H.enabled&&(ma.enabled=!1);ma=0<ma.steps.length?JSON.stringify({animation:ma}):null;F.setAttributeForCell(la,"animation",ma);F.setAttributeForCell(la,"animationHideInitial",null)}else"function"==typeof B.save&&B.save(H);aa(!1)};ea=mxUtils.button(mxResources.get("preview"),function(){cb();Oa();Na=new Editor.AnimationPlayer(F,-H);Na.snapshot=[];Na.play({done:function(){Na=null;zb(-1)},onStep:function(la,ma){zb(la,ma)}})});ea.className="geBtn";L.push(function(){ea.textContent=mxResources.get("preview");ea.title=mxResources.get("preview")});ea.title=mxResources.get("preview");gb.appendChild(ea);var fb=mxUtils.button(mxResources.get("reset",null,"Reset"),function(){cb();zb(-1);$a()});fb.className="geBtn";L.push(function(){var la=mxResources.get("reset",null,"Reset");fb.textContent=la;fb.title=la});fb.title=mxResources.get("reset",-null,"Reset");Qa=fb;La();gb.appendChild(fb);T=document.createElement("span");T.style.flex="1 1 auto";gb.appendChild(T);var xb=mxUtils.button(mxResources.get("cancel"),function(){X?Gb():ib.window.setVisible(!1)});xb.className="geBtn";L.push(function(){xb.textContent=mxResources.get("cancel");xb.title=mxResources.get("cancel")});xb.title=mxResources.get("cancel");gb.appendChild(xb);ba=mxUtils.button(mxResources.get("save"),function(){d.checked&&!O?(Y(),D.focus()):(Eb(),ib.window.setVisible(!1))});ba.className=-"geBtn gePrimaryBtn";L.push(function(){ba.textContent=mxResources.get("save");ba.title=mxResources.get("save")});ba.title=mxResources.get("save");gb.appendChild(ba);c.appendChild(gb);this.window=new mxWindow(Q(),c,l,p,g,x,!0,!0);this.window.minimumSize=new mxRectangle(0,0,360,360);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);var Xa=function(){"function"==typeof K.closePopover&&K.closePopover()};this.window.addListener(mxEvent.MOVE,-Xa);this.window.addListener(mxEvent.RESIZE,Xa);var Jb=function(){for(var la=0;la<L.length;la++)try{L[la]()}catch(ma){}null!=ib.window&&null!=ib.window.title&&(ib.window.title.innerHTML=mxUtils.htmlEntities(Q()));Ra()};b.addListener("languageChanged",Jb);this.window.addListener(mxEvent.DESTROY,function(){b.removeListener(Jb)});var Gb=function(){b.confirm(mxResources.get("allChangesLost"),null,function(){aa(!1);ib.window.setVisible(!1)},mxResources.get("cancel"),mxResources.get("discardChanges"))},-Kb=ib.window.setVisible.bind(ib.window);ib.window.setVisible=function(la){!1===la&&X&&Eb();Kb(la)};this.window.addListener("hide",function(){cb();zb(-1);$a()});"page"==z&&F.addListener(mxEvent.ROOT,function(){var la=F.getModel().getRoot();if(la!=W){if(X){var ma={steps:H.steps};!1===H.loop&&(ma.loop=!1);!1===H.enabled&&(ma.enabled=!1);ma=0<H.steps.length?JSON.stringify({animation:ma}):null;F.setAttributeForCell(W,"animation",ma)}W=la;Z();aa(!1);qa.clear();Aa=null;Ra();cb()}});var Mb=function(){aa(!1);+Ia}return Ga};qb.addEventListener("change",function(){var la=qb.value;qb.value="";if(la)if("__deleteAll__"==la)0!=H.steps.length&&b.confirm(mxResources.get("areYouSure",null,"Are you sure?"),function(){H.steps=[];qa.clear();Aa=null;ua()});else{var ma=CustomActionDialog.SCHEMAS[la];if(null!=ma){var ya=null;ma.selector&&(ma=G.getSelectionCells(),ya=0<ma.length?ma.map(function(Ga){return Ga.id}):[Editor.ANIMATION_ALL]);la=Da(la,ya);null!=la&&(H.steps.push(la),ua(),z.scrollTop=z.scrollHeight)}}});var Na=+null,Ka=null,Qa=null,La=function(){if(null!=Qa){var la=null!=Ka;Qa.disabled=!la;Qa.style.opacity=la?"":"0.4";Qa.style.cursor=la?"":"default"}},Oa=function(){null==Ka&&(Ka=new Editor.AnimationPlayer(G,H),Ka.snapshotOpacity(),La())},$a=function(){if(null!=Ka){Ka.restoreOpacity();for(var la=Ka.collectReferencedCells(),ma=[],ya=0;ya<la.length;ya++)G.getModel().isEdge(la[ya])&&ma.push(la[ya]);0<ma.length&&Editor.toggleFlowAnimation(G,ma,"stop");G.refresh();Ka=null;La()}},cb=function(){null!=Na&&(Na.stop(),+Na=null)},gb=document.createElement("div");gb.style.cssText="margin-top:20px;display:flex;gap:6px;flex:0 0 auto";var zb=function(la,ma){var ya=new Set;if(null!=la&&0<=la)for(ma=null!=ma?ma:la+1;la<ma;la++)ya.add(la);if(ya.size===O.size){la=!0;ma=$jscomp.makeIterator(ya);for(var Ga=ma.next();!Ga.done;Ga=ma.next())if(!O.has(Ga.value)){la=!1;break}if(la)return}O=ya;ya=z.querySelectorAll("[data-step-idx]");for(la=0;la<ya.length;la++)ma=parseInt(ya[la].getAttribute("data-step-idx"),10),ya[la].classList.toggle("geAnimationStepActive",+O.has(ma))};gb.appendChild(b.createHelpIcon(ANIMATION_HELP_URL));var ib=this,Eb=function(){if("page"==y){var la=G.getModel().getRoot(),ma={steps:H.steps};!1===H.loop&&(ma.loop=!1);!1===H.enabled&&(ma.enabled=!1);ma=0<ma.steps.length?JSON.stringify({animation:ma}):null;G.setAttributeForCell(la,"animation",ma);G.setAttributeForCell(la,"animationHideInitial",null)}else"function"==typeof A.save&&A.save(H);aa(!1)};ea=mxUtils.button(mxResources.get("preview"),function(){cb();Oa();Na=new Editor.AnimationPlayer(G,+H);Na.snapshot=[];Na.play({done:function(){Na=null;zb(-1)},onStep:function(la,ma){zb(la,ma)}})});ea.className="geBtn";J.push(function(){ea.textContent=mxResources.get("preview");ea.title=mxResources.get("preview")});ea.title=mxResources.get("preview");gb.appendChild(ea);var fb=mxUtils.button(mxResources.get("reset",null,"Reset"),function(){cb();zb(-1);$a()});fb.className="geBtn";J.push(function(){var la=mxResources.get("reset",null,"Reset");fb.textContent=la;fb.title=la});fb.title=mxResources.get("reset",+null,"Reset");Qa=fb;La();gb.appendChild(fb);T=document.createElement("span");T.style.flex="1 1 auto";gb.appendChild(T);var xb=mxUtils.button(mxResources.get("cancel"),function(){Y?Gb():ib.window.setVisible(!1)});xb.className="geBtn";J.push(function(){xb.textContent=mxResources.get("cancel");xb.title=mxResources.get("cancel")});xb.title=mxResources.get("cancel");gb.appendChild(xb);ba=mxUtils.button(mxResources.get("save"),function(){d.checked&&!N?(X(),D.focus()):(Eb(),ib.window.setVisible(!1))});ba.className=+"geBtn gePrimaryBtn";J.push(function(){ba.textContent=mxResources.get("save");ba.title=mxResources.get("save")});ba.title=mxResources.get("save");gb.appendChild(ba);c.appendChild(gb);this.window=new mxWindow(Q(),c,l,p,g,x,!0,!0);this.window.minimumSize=new mxRectangle(0,0,360,360);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);var Xa=function(){"function"==typeof L.closePopover&&L.closePopover()};this.window.addListener(mxEvent.MOVE,+Xa);this.window.addListener(mxEvent.RESIZE,Xa);var Jb=function(){for(var la=0;la<J.length;la++)try{J[la]()}catch(ma){}null!=ib.window&&null!=ib.window.title&&(ib.window.title.innerHTML=mxUtils.htmlEntities(Q()));Ra()};b.addListener("languageChanged",Jb);this.window.addListener(mxEvent.DESTROY,function(){b.removeListener(Jb)});var Gb=function(){b.confirm(mxResources.get("allChangesLost"),null,function(){aa(!1);ib.window.setVisible(!1)},mxResources.get("cancel"),mxResources.get("discardChanges"))},+Kb=ib.window.setVisible.bind(ib.window);ib.window.setVisible=function(la){!1===la&&Y&&Eb();Kb(la)};this.window.addListener("hide",function(){cb();zb(-1);$a()});"page"==y&&G.addListener(mxEvent.ROOT,function(){var la=G.getModel().getRoot();if(la!=W){if(Y){var ma={steps:H.steps};!1===H.loop&&(ma.loop=!1);!1===H.enabled&&(ma.enabled=!1);ma=0<H.steps.length?JSON.stringify({animation:ma}):null;G.setAttributeForCell(W,"animation",ma)}W=la;Z();aa(!1);qa.clear();Aa=null;Ra();cb()}});var Mb=function(){aa(!1);ib.window.setVisible(!1)};b.editor.addListener("fileLoaded",Mb);this.window.addListener(mxEvent.DESTROY,function(){b.editor.removeListener(Mb)});installDialogDocking(b,this);this.window.setVisible(!0);window.setTimeout(mxUtils.bind(this,function(){null==this.window||null==this.window.div||this.window.minimized||null!=this.window.dockState||this.window.setLocation(this.window.getX(),this.window.getY())}),0)};AnimationDialog.stepsClipboard=null;var CustomGitLabUrlWarningDialog=function(b,l){var p=document.createElement("div"),g=document.createElement("h3");mxUtils.write(g,mxResources.get("customGitlabUrlTitle"));p.appendChild(g);g=document.createElement("p");mxUtils.write(g,mxResources.get("customGitlabUrlWarning"));p.appendChild(g);g=document.createElement("p");var x=document.createElement("strong");mxUtils.write(x,mxResources.get("customGitlabUrlServer")+" ");g.appendChild(x);x=document.createElement("code");mxUtils.write(x,l);g.appendChild(x);p.appendChild(g);l=document.createElement("p");g=document.createElement("a");g.setAttribute("href","https://github.com/jgraph/drawio/issues/493");g.setAttribute("target","_blank");g.setAttribute("rel","noopener noreferrer");mxUtils.write(g,mxResources.get("customGitlabUrlLearnMore"));l.appendChild(g);p.appendChild(l);this.container=(new CustomDialog(b,p,null,null,mxResources.get("close"),null,null,!0)).container},AuthDialog=function(b,l,p,g){var x=document.createElement("div");x.style.textAlign="center";-var B=document.createElement("p");B.style.fontSize="16pt";B.style.padding="0px";B.style.margin="0px";B.style.color="gray";mxUtils.write(B,mxResources.get("authorizationRequired"));var z="Unknown",F=document.createElement("img");F.setAttribute("border","0");F.setAttribute("align","absmiddle");F.style.marginRight="10px";l==b.drive?(z=mxResources.get("googleDrive"),F.src=IMAGE_PATH+"/google-drive-logo-white.svg"):l==b.dropbox?(z=mxResources.get("dropbox"),F.src=IMAGE_PATH+"/dropbox-logo-white.svg"):-l==b.oneDrive?(z=mxResources.get("oneDrive"),F.src=IMAGE_PATH+"/onedrive-logo-white.svg"):l==b.gitHub?(z=mxResources.get("github"),F.src=IMAGE_PATH+"/github-logo-white.svg"):l==b.gitLab?(z=mxResources.get("gitlab"),F.src=IMAGE_PATH+"/gitlab-logo.svg",F.style.width="32px"):l==b.trello?(z=mxResources.get("trello"),F.src=IMAGE_PATH+"/trello-logo-white.svg"):l==b.m365&&(z=mxResources.get("m365"),F.src=IMAGE_PATH+"/onedrive-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizeThisAppIn",-[z]));var K=document.createElement("input");K.setAttribute("type","checkbox");z=mxUtils.button(mxResources.get("authorize"),function(){g(K.checked)});z.insertBefore(F,z.firstChild);z.style.marginTop="6px";z.className="geBigButton";z.style.fontSize="18px";z.style.padding="14px";x.appendChild(B);x.appendChild(b);x.appendChild(z);p&&(p=document.createElement("p"),p.style.marginTop="20px",p.appendChild(K),B=document.createElement("span"),mxUtils.write(B," "+mxResources.get("rememberMe")),p.appendChild(B),-x.appendChild(p),K.checked=!0,K.defaultChecked=!0,mxEvent.addListener(B,"click",function(M){K.checked=!K.checked;mxEvent.consume(M)}));this.container=x},MoreShapesDialog=function(b,l,p){p=null!=p?p:b.sidebar.entries;var g=document.createElement("div"),x=[];if(null!=b.sidebar.customEntries)for(var B=0;B<b.sidebar.customEntries.length;B++){for(var z=b.sidebar.customEntries[B]||{},F={title:b.getResource(z.title),entries:[]},K=0;null!=z.entries&&K<z.entries.length;K++){var M=z.entries[K];F.entries.push({id:M.id,-title:b.getResource(M.title),desc:b.getResource(M.desc),image:M.preview})}0<F.entries.length&&x.push(F)}for(B=0;B<p.length;B++)if(null==b.sidebar.enabledLibraries)x.push(p[B]);else{F={title:p[B].title,entries:[]};for(K=0;K<p[B].entries.length;K++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,p[B].entries[K].id)&&F.entries.push(p[B].entries[K]);0<F.entries.length&&x.push(F)}p=x;if(l){B=mxUtils.bind(this,function(I){for(var C=0;C<I.length;C++)(function(U){var J=document.createElement("div");J.className=-"geMoreShapesSectionHeader";mxUtils.write(J,U.title);L.appendChild(J);for(var S=0;S<U.entries.length;S++)(function(N){var R=document.createElement("div");R.className="geMoreShapesItem";R.setAttribute("title",N.title+" ("+N.id+")");var T=document.createElement("input");T.setAttribute("type","checkbox");T.checked=b.sidebar.isEntryVisible(N.id);T.defaultChecked=T.checked;R.appendChild(T);var v=document.createElement("span");mxUtils.write(v,N.title);R.appendChild(v);L.appendChild(R);v=function(d){if(null==-d||"INPUT"!=mxEvent.getSource(d).nodeName){Q.style.textAlign="center";Q.style.padding="0px";Q.style.color="";Q.innerText="";if(null!=N.desc){var m=document.createElement("pre");m.style.boxSizing="border-box";m.style.fontFamily="inherit";m.style.margin="20px";m.style.right="0px";m.style.textAlign="left";mxUtils.write(m,N.desc);Q.appendChild(m)}null!=N.imageCallback?N.imageCallback(Q):null!=N.image?(m=document.createElement("img"),m.setAttribute("border","0"),m.style.maxWidth="100%",m.setAttribute("src",-N.image),Q.appendChild(m)):null==N.desc&&(Q.style.padding="20px",Q.style.color="rgb(179, 179, 179)",mxUtils.write(Q,mxResources.get("noPreview")));null!=c&&c.classList.remove("geMoreShapesItemSelected");c=R;c.classList.add("geMoreShapesItemSelected");null!=d&&mxEvent.consume(d)}};mxEvent.addListener(R,"click",v);mxEvent.addListener(R,"dblclick",function(d){T.checked=!T.checked;mxEvent.consume(d)});f.push(function(){return T.checked?N.id:null});0==C&&0==S&&v()})(U.entries[S])})(I[C])});K=document.createElement("div");-K.className="geDialogTitle";mxUtils.write(K,mxResources.get("shapes"));K.style.position="absolute";K.style.top="0px";K.style.left="0px";K.style.lineHeight="40px";K.style.height="40px";K.style.right="0px";var L=document.createElement("div"),Q=document.createElement("div");L.style.position="absolute";L.style.top="40px";L.style.left="0px";L.style.width="220px";L.style.bottom="70px";L.style.overflow="auto";Q.className="geMoreShapesPreview";Q.style.position="absolute";Q.style.left="220px";Q.style.right=-"0px";Q.style.top="40px";Q.style.bottom="70px";Q.style.overflow="auto";Q.style.textAlign="center";var c=null,f=[];B(p);g.appendChild(K);g.appendChild(L);g.appendChild(Q);p=document.createElement("div");p.className="geDialogFooter";p.style.position="absolute";p.style.display="flex";p.style.alignItems="center";p.style.paddingRight="16px";p.style.paddingLeft="16px";p.style.left="0px";p.style.right="0px";p.style.bottom="0px";p.style.height="70px";B=document.createElement("div");B.className="geMoreShapesFooterChecks";-K=document.createElement("label");K.className="geMoreShapesFooterCheck";var k=document.createElement("input");k.setAttribute("type","checkbox");k.checked=b.sidebar.sidebarTitles;k.defaultChecked=k.checked;K.appendChild(k);l=document.createElement("span");mxUtils.write(l,mxResources.get("labels"));K.appendChild(l);B.appendChild(K);var n=document.createElement("input");n.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)K=document.createElement("label"),K.className="geMoreShapesFooterCheck",-n.checked=!0,n.defaultChecked=!0,K.appendChild(n),l=document.createElement("span"),mxUtils.write(l,mxResources.get("rememberThisSetting")),K.appendChild(l),B.appendChild(K);p.appendChild(B);B=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});B.className="geBtn";K=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();for(var I=[],C=0;C<f.length;C++){var U=f[C].apply(this,arguments);null!=U&&I.push(U)}"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=-Editor.currentTheme||!Editor.isSettingsEnabled()||(C=mxUtils.indexOf(I,".scratchpad"),null!=b.scratchpad!=(0<=C&&0<I.splice(C,1).length)&&b.toggleScratchpad(),C=mxUtils.indexOf(I,"search"),mxSettings.settings.search=0<=C&&0<I.splice(C,1).length,b.sidebar.showPalette("search",mxSettings.settings.search),n.checked&&mxSettings.save());b.sidebar.showEntries(I.join(";"),n.checked,!0);b.setSidebarTitles(k.checked,n.checked)});K.className="geBtn gePrimaryBtn";l=document.createElement("div");l.style.flex=-"1";l.style.textAlign="right";b.editor.cancelFirst?(l.appendChild(B),l.appendChild(K)):(l.appendChild(K),l.appendChild(B));p.appendChild(l)}else{var q=document.createElement("table");B=document.createElement("tbody");g.style.height="100%";g.style.overflow="auto";K=document.createElement("tr");q.style.width="100%";l=document.createElement("td");x=document.createElement("td");z=document.createElement("td");var t=mxUtils.bind(this,function(I,C,U){var J=document.createElement("input");J.type="checkbox";-q.appendChild(J);J.checked=b.sidebar.isEntryVisible(U);var S=document.createElement("span");mxUtils.write(S,C);C=document.createElement("div");C.style.display="block";C.appendChild(J);C.appendChild(S);mxEvent.addListener(S,"click",function(N){J.checked=!J.checked;mxEvent.consume(N)});I.appendChild(C);return function(){return J.checked?U:null}});K.appendChild(l);K.appendChild(x);K.appendChild(z);B.appendChild(K);q.appendChild(B);f=[];var u=0;for(B=0;B<p.length;B++)for(K=0;K<p[B].entries.length;K++)u++;-var y=[l,x,z],E=0;for(B=0;B<p.length;B++)(function(I){for(var C=0;C<I.entries.length;C++){var U=I.entries[C];f.push(t(y[Math.floor(E/(u/3))],U.title,U.id));E++}})(p[B]);g.appendChild(q);p=document.createElement("div");p.style.marginTop="18px";p.style.textAlign="center";n=document.createElement("input");isLocalStorage&&(n.setAttribute("type","checkbox"),n.checked=!0,n.defaultChecked=!0,p.appendChild(n),B=document.createElement("span"),mxUtils.write(B," "+mxResources.get("rememberThisSetting")),p.appendChild(B),-mxEvent.addListener(B,"click",function(I){n.checked=!n.checked;mxEvent.consume(I)}));g.appendChild(p);B=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});B.className="geBtn";K=mxUtils.button(mxResources.get("apply"),function(){for(var I=["search"],C=0;C<f.length;C++){var U=f[C].apply(this,arguments);null!=U&&I.push(U)}b.sidebar.showEntries(0<I.length?I.join(";"):"",n.checked);b.hideDialog()});K.className="geBtn gePrimaryBtn";p=document.createElement("div");p.style.marginTop="26px";-p.style.textAlign="right";b.editor.cancelFirst?(p.appendChild(B),p.appendChild(K)):(p.appendChild(K),p.appendChild(B))}g.appendChild(p);this.container=g},PluginsDialog=function(b,l,p,g){function x(){L=!0;if(0==M.length){K.innerText="";var t=document.createElement("div");t.className="geDialogHint";mxUtils.write(t,mxResources.get("noPlugins"));K.appendChild(t)}else for(K.innerText="",t=0;t<M.length;t++){var u=document.createElement("span");u.style.display="flex";u.style.alignItems="center";u.style.whiteSpace=-"nowrap";u.style.minHeight="26px";var y=document.createElement("img");y.src=Editor.trashImage;y.style.cursor="pointer";y.style.marginRight="8px";y.style.width="16px";y.style.flexShrink="0";y.setAttribute("title",mxResources.get("delete"));u.appendChild(y);var E=document.createElement("span");E.style.overflow="hidden";E.style.textOverflow="ellipsis";mxUtils.write(E,M[t]);u.appendChild(E);K.appendChild(u);mxEvent.addListener(y,"click",function(I){return function(){b.confirm(mxResources.get("delete")+-' "'+M[I]+'"?',function(){null!=p&&p(M[I]);M.splice(I,1);x()})}}(t))}}function B(){if(null!=Q){Q.innerText="";var t=document.createElement("option");t.value="";mxUtils.write(t,mxResources.get("chooseAnOption")||"Choose…");Q.appendChild(t);for(t=0;t<App.publicPlugin.length;t++){var u=App.publicPlugin[t],y=App.pluginRegistry[u],E=document.createElement("option");mxUtils.write(E,u);E.value=u;if(null==y||0<=mxUtils.indexOf(M,y))E.disabled=!0;Q.appendChild(E)}null!=c&&(c.disabled=!0)}}var z=document.createElement("div"),-F=document.createElement("h3");mxUtils.write(F,mxResources.get("plugins"));z.appendChild(F);var K=document.createElement("div");K.className="geDialogSection";K.style.height="160px";K.style.overflow="auto";K.style.fontSize="13px";var M=mxSettings.getPlugins().slice(),L=!1;z.appendChild(K);x();L=!1;var Q=null,c=null;if(null==l){F=document.createElement("div");F.style.display="flex";F.style.alignItems="center";F.style.gap="8px";F.style.marginTop="10px";Q=document.createElement("select");Q.style.flex=-"1";Q.style.minWidth="0";F.appendChild(Q);c=mxUtils.button(mxResources.get("add"),function(){var t=Q.value;""!=t&&(t=App.pluginRegistry[t],null!=t&&0>mxUtils.indexOf(M,t)&&(M.push(t),x()))});c.className="geBtn";c.style.margin="0";c.disabled=!0;F.appendChild(c);mxEvent.addListener(Q,"change",function(){c.disabled=""==Q.value});if(ALLOW_CUSTOM_PLUGINS){var f=mxUtils.button(mxResources.get("custom")+"...",function(){var t=new FilenameDialog(b,"",mxResources.get("add"),function(u){b.hideDialog();if(null!=-u&&0<u.length){u=u.split(";");for(var y=0;y<u.length;y++){var E=u[y],I=App.pluginRegistry[E];null!=I&&(E=I);0<E.length&&0>mxUtils.indexOf(M,E)&&M.push(E)}x()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(t.container,300,80,!0,!0);t.init()});f.className="geBtn";f.style.margin="0";F.appendChild(f)}z.appendChild(F)}var k=x;x=function(){k();B()};B();F=null;null!=l&&(F=mxUtils.button(mxResources.get("add"),function(){l(function(t){t&&0>mxUtils.indexOf(M,t)&&M.push(t);x()})}),-F.className="geBtn");f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});f.className="geBtn";var n=mxUtils.button(g?mxResources.get("close"):mxResources.get("apply"),function(){L?(mxSettings.setPlugins(M),mxSettings.save(),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))):b.hideDialog()});n.className="geBtn gePrimaryBtn";var q=document.createElement("div");q.style.marginTop="14px";q.style.textAlign="right";b.isOffline()||q.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/plugins"));-b.editor.cancelFirst?(g||q.appendChild(f),null!=F&&q.appendChild(F),q.appendChild(n)):(null!=F&&q.appendChild(F),q.appendChild(n),g||q.appendChild(f));z.appendChild(q);this.container=z},CropImageDialog=function(b,l,p,g){function x(){null!=f&&(Q.style.overflow="hidden",f.maxFitScale=null,f.fit(8),f.center(),Q.style.overflow="auto")}function B(O){var P=document.createElement("span");P.style.marginLeft="6px";P.style.fontSize="11px";mxUtils.write(P,O);J.appendChild(P);O=document.createElement("input");-O.setAttribute("type","text");O.style.cssText="width:46px;margin:0 2px;text-align:right;";J.appendChild(O);return O}function z(){var O=t.geometry;N.value=Math.round(O.x);R.value=Math.round(O.y);T.value=Math.round(O.width);v.value=Math.round(O.height)}function F(){if(null!=f){var O=parseFloat(N.value),P=parseFloat(R.value),V=parseFloat(T.value),Y=parseFloat(v.value);if(isFinite(O)&&isFinite(P)&&isFinite(V)&&isFinite(Y)&&0<V&&0<Y){var H=t.geometry.clone();H.x=O;H.y=P;H.width=V;H.height=Y;f.model.setGeometry(t,-H);f.model.setStyle(t,E+K());f.selectAll()}}}function K(){var O=m.checked,P=r.checked,V=t.geometry;0>V.x?(V.width+=V.x,V.x=0):V.x+V.width>u&&(V.width=u-V.x,V.x=Math.min(V.x,u));0>V.y?(V.height+=V.y,V.y=0):V.y+V.height>y&&(V.height=y-V.y,V.y=Math.min(V.y,y));var Y=V.x/u*100,H=100-(V.x+V.width)/u*100,W=100-(V.y+V.height)/y*100;return"inset("+mxUtils.format(V.y/y*100)+"% "+mxUtils.format(H)+"% "+mxUtils.format(W)+"% "+mxUtils.format(Y)+"%"+(O?" round "+q+"%":P?" round 50%":"")+")"}function M(O){null!=-f&&(!0!==O&&(f.model.setGeometry(t,n.clone()),q=5,D.value=q),f.model.setStyle(t,E+K()),f.selectAll(),z(),A.style.visibility=m.checked?"visible":"hidden")}var L=document.createElement("div");L.style.display="flex";L.style.flexDirection="column";L.style.height="100%";var Q=document.createElement("div");Q.style.flex="1";Q.style.minHeight="0";Q.style.overflow="auto";Q.style.border="1px solid";L.appendChild(Q);var c=l.replace(";base64",""),f=null,k=null,n=null,q=5,t=new mxCell("",new mxGeometry(0,0,1,-1),""),u=0,y=0,E="shape=image;fillColor=none;rotatable=0;cloneable=0;deletable=0;image="+c+";clipPath=",I="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;opacity=40;image="+c+";",C="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;image="+c+";",U=new Image;U.onload=function(){function O(){f.model.setStyle(t,E+K());z()}u=U.naturalWidth;y=U.naturalHeight;n=new mxGeometry(.15*u,.15*y,.7*u,.7*y);t.geometry=-n.clone();f=new Graph(Q);f.autoExtend=!1;f.autoScroll=!1;f.setGridEnabled(!1);f.setEnabled(!0);f.setPanning(!0);f.setConnectable(!1);f.getRubberband().setEnabled(!1);f.graphHandler.allowLivePreview=!1;f.centerZoom=!0;f.background="#ffffff";var P=f.createVertexHandler;f.createVertexHandler=function(){var na=P.apply(this,arguments);na.livePreview=!1;return na};var V=f.isCellSelectable;f.isCellSelectable=function(na){return na===t&&V.apply(this,arguments)};k=new mxCell("",new mxGeometry(0,0,u,y),I);-k.vertex=!0;f.addCell(k);if(null!=p)try{if("inset"==p.substring(0,5)){var Y=t.geometry,H=p.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),W=parseFloat(H[0]),Z=parseFloat(H[1]),X=parseFloat(H[2]),ba=parseFloat(H[3]);isFinite(W)&&isFinite(Z)&&isFinite(X)&&isFinite(ba)?(Y.x=ba/100*u,Y.y=W/100*y,Y.width=(100-Z)/100*u-Y.x,Y.height=(100-X)/100*y-Y.y,"round"==H[4]?"50%"==H[5]?r.setAttribute("checked","checked"):(q=parseInt(H[5]),D.value=q,m.setAttribute("checked","checked"),A.style.visibility="visible"):d.setAttribute("checked",-"checked")):p=null}else p=null}catch(na){}t.style=E+(p?p:K());t.vertex=!0;f.addCell(t);f.selectAll();f.addListener(mxEvent.CELLS_MOVED,O);f.addListener(mxEvent.CELLS_RESIZED,O);var ea=f.graphHandler.mouseUp,aa=f.graphHandler.mouseDown;f.graphHandler.mouseUp=function(){ea.apply(this,arguments);null!=k&&f.model.setStyle(k,I)};f.graphHandler.mouseDown=function(){aa.apply(this,arguments);null!=k&&f.model.setStyle(k,C)};f.dblClick=function(){};var ha=f.getSelectionModel().changeSelection;f.getSelectionModel().changeSelection=-function(){ha.call(this,[t],[t])};z();x()};U.onerror=function(){U.onload=null;U.src=Editor.errorImage};U.src=l;var J=document.createElement("div");J.style.display="flex";J.style.flexShrink="0";J.style.alignItems="center";J.style.justifyContent="center";J.style.paddingTop="6px";l=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=f&&f.zoomIn()});c=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=f&&f.zoomOut()});var S=b.createToolbarButton(Editor.zoomFitImage,-mxResources.get("fit"),function(){x()});J.appendChild(l);J.appendChild(c);J.appendChild(S);var N=B("X"),R=B("Y"),T=B("W"),v=B("H");mxEvent.addListener(N,"change",F);mxEvent.addListener(R,"change",F);mxEvent.addListener(T,"change",F);mxEvent.addListener(v,"change",F);L.appendChild(J);l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.display="flex";l.style.flexShrink="0";l.style.alignItems="center";l.style.justifyContent="center";var d=document.createElement("input");d.setAttribute("type",+var A=document.createElement("p");A.style.fontSize="16pt";A.style.padding="0px";A.style.margin="0px";A.style.color="gray";mxUtils.write(A,mxResources.get("authorizationRequired"));var y="Unknown",G=document.createElement("img");G.setAttribute("border","0");G.setAttribute("align","absmiddle");G.style.marginRight="10px";l==b.drive?(y=mxResources.get("googleDrive"),G.src=IMAGE_PATH+"/google-drive-logo-white.svg"):l==b.dropbox?(y=mxResources.get("dropbox"),G.src=IMAGE_PATH+"/dropbox-logo-white.svg"):+l==b.oneDrive?(y=mxResources.get("oneDrive"),G.src=IMAGE_PATH+"/onedrive-logo-white.svg"):l==b.gitHub?(y=mxResources.get("github"),G.src=IMAGE_PATH+"/github-logo-white.svg"):l==b.gitLab?(y=mxResources.get("gitlab"),G.src=IMAGE_PATH+"/gitlab-logo.svg",G.style.width="32px"):l==b.trello?(y=mxResources.get("trello"),G.src=IMAGE_PATH+"/trello-logo-white.svg"):l==b.m365&&(y=mxResources.get("m365"),G.src=IMAGE_PATH+"/onedrive-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizeThisAppIn",+[y]));var L=document.createElement("input");L.setAttribute("type","checkbox");y=mxUtils.button(mxResources.get("authorize"),function(){g(L.checked)});y.insertBefore(G,y.firstChild);y.style.marginTop="6px";y.className="geBigButton";y.style.fontSize="18px";y.style.padding="14px";x.appendChild(A);x.appendChild(b);x.appendChild(y);p&&(p=document.createElement("p"),p.style.marginTop="20px",p.appendChild(L),A=document.createElement("span"),mxUtils.write(A," "+mxResources.get("rememberMe")),p.appendChild(A),+x.appendChild(p),L.checked=!0,L.defaultChecked=!0,mxEvent.addListener(A,"click",function(O){L.checked=!L.checked;mxEvent.consume(O)}));this.container=x},MoreShapesDialog=function(b,l,p){p=null!=p?p:b.sidebar.entries;var g=document.createElement("div"),x=[];if(null!=b.sidebar.customEntries)for(var A=0;A<b.sidebar.customEntries.length;A++){for(var y=b.sidebar.customEntries[A]||{},G={title:b.getResource(y.title),entries:[]},L=0;null!=y.entries&&L<y.entries.length;L++){var O=y.entries[L];G.entries.push({id:O.id,+title:b.getResource(O.title),desc:b.getResource(O.desc),image:O.preview})}0<G.entries.length&&x.push(G)}for(A=0;A<p.length;A++)if(null==b.sidebar.enabledLibraries)x.push(p[A]);else{G={title:p[A].title,entries:[]};for(L=0;L<p[A].entries.length;L++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,p[A].entries[L].id)&&G.entries.push(p[A].entries[L]);0<G.entries.length&&x.push(G)}p=x;if(l){A=mxUtils.bind(this,function(I){for(var C=0;C<I.length;C++)(function(U){var K=document.createElement("div");K.className=+"geMoreShapesSectionHeader";mxUtils.write(K,U.title);J.appendChild(K);for(var S=0;S<U.entries.length;S++)(function(M){var R=document.createElement("div");R.className="geMoreShapesItem";R.setAttribute("title",M.title+" ("+M.id+")");var T=document.createElement("input");T.setAttribute("type","checkbox");T.checked=b.sidebar.isEntryVisible(M.id);T.defaultChecked=T.checked;R.appendChild(T);var v=document.createElement("span");mxUtils.write(v,M.title);R.appendChild(v);J.appendChild(R);v=function(d){if(null==+d||"INPUT"!=mxEvent.getSource(d).nodeName){Q.style.textAlign="center";Q.style.padding="0px";Q.style.color="";Q.innerText="";if(null!=M.desc){var m=document.createElement("pre");m.style.boxSizing="border-box";m.style.fontFamily="inherit";m.style.margin="20px";m.style.right="0px";m.style.textAlign="left";mxUtils.write(m,M.desc);Q.appendChild(m)}null!=M.imageCallback?M.imageCallback(Q):null!=M.image?(m=document.createElement("img"),m.setAttribute("border","0"),m.style.maxWidth="100%",m.setAttribute("src",+M.image),Q.appendChild(m)):null==M.desc&&(Q.style.padding="20px",Q.style.color="rgb(179, 179, 179)",mxUtils.write(Q,mxResources.get("noPreview")));null!=c&&c.classList.remove("geMoreShapesItemSelected");c=R;c.classList.add("geMoreShapesItemSelected");null!=d&&mxEvent.consume(d)}};mxEvent.addListener(R,"click",v);mxEvent.addListener(R,"dblclick",function(d){T.checked=!T.checked;mxEvent.consume(d)});f.push(function(){return T.checked?M.id:null});0==C&&0==S&&v()})(U.entries[S])})(I[C])});L=document.createElement("div");+L.className="geDialogTitle";mxUtils.write(L,mxResources.get("shapes"));L.style.position="absolute";L.style.top="0px";L.style.left="0px";L.style.lineHeight="40px";L.style.height="40px";L.style.right="0px";var J=document.createElement("div"),Q=document.createElement("div");J.style.position="absolute";J.style.top="40px";J.style.left="0px";J.style.width="220px";J.style.bottom="70px";J.style.overflow="auto";Q.className="geMoreShapesPreview";Q.style.position="absolute";Q.style.left="220px";Q.style.right=+"0px";Q.style.top="40px";Q.style.bottom="70px";Q.style.overflow="auto";Q.style.textAlign="center";var c=null,f=[];A(p);g.appendChild(L);g.appendChild(J);g.appendChild(Q);p=document.createElement("div");p.className="geDialogFooter";p.style.position="absolute";p.style.display="flex";p.style.alignItems="center";p.style.paddingRight="16px";p.style.paddingLeft="16px";p.style.left="0px";p.style.right="0px";p.style.bottom="0px";p.style.height="70px";A=document.createElement("div");A.className="geMoreShapesFooterChecks";+L=document.createElement("label");L.className="geMoreShapesFooterCheck";var k=document.createElement("input");k.setAttribute("type","checkbox");k.checked=b.sidebar.sidebarTitles;k.defaultChecked=k.checked;L.appendChild(k);l=document.createElement("span");mxUtils.write(l,mxResources.get("labels"));L.appendChild(l);A.appendChild(L);var n=document.createElement("input");n.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)L=document.createElement("label"),L.className="geMoreShapesFooterCheck",+n.checked=!0,n.defaultChecked=!0,L.appendChild(n),l=document.createElement("span"),mxUtils.write(l,mxResources.get("rememberThisSetting")),L.appendChild(l),A.appendChild(L);p.appendChild(A);A=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});A.className="geBtn";L=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();for(var I=[],C=0;C<f.length;C++){var U=f[C].apply(this,arguments);null!=U&&I.push(U)}"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=+Editor.currentTheme||!Editor.isSettingsEnabled()||(C=mxUtils.indexOf(I,".scratchpad"),null!=b.scratchpad!=(0<=C&&0<I.splice(C,1).length)&&b.toggleScratchpad(),C=mxUtils.indexOf(I,"search"),mxSettings.settings.search=0<=C&&0<I.splice(C,1).length,b.sidebar.showPalette("search",mxSettings.settings.search),n.checked&&mxSettings.save());b.sidebar.showEntries(I.join(";"),n.checked,!0);b.setSidebarTitles(k.checked,n.checked)});L.className="geBtn gePrimaryBtn";l=document.createElement("div");l.style.flex=+"1";l.style.textAlign="right";b.editor.cancelFirst?(l.appendChild(A),l.appendChild(L)):(l.appendChild(L),l.appendChild(A));p.appendChild(l)}else{var q=document.createElement("table");A=document.createElement("tbody");g.style.height="100%";g.style.overflow="auto";L=document.createElement("tr");q.style.width="100%";l=document.createElement("td");x=document.createElement("td");y=document.createElement("td");var t=mxUtils.bind(this,function(I,C,U){var K=document.createElement("input");K.type="checkbox";+q.appendChild(K);K.checked=b.sidebar.isEntryVisible(U);var S=document.createElement("span");mxUtils.write(S,C);C=document.createElement("div");C.style.display="block";C.appendChild(K);C.appendChild(S);mxEvent.addListener(S,"click",function(M){K.checked=!K.checked;mxEvent.consume(M)});I.appendChild(C);return function(){return K.checked?U:null}});L.appendChild(l);L.appendChild(x);L.appendChild(y);A.appendChild(L);q.appendChild(A);f=[];var u=0;for(A=0;A<p.length;A++)for(L=0;L<p[A].entries.length;L++)u++;+var B=[l,x,y],E=0;for(A=0;A<p.length;A++)(function(I){for(var C=0;C<I.entries.length;C++){var U=I.entries[C];f.push(t(B[Math.floor(E/(u/3))],U.title,U.id));E++}})(p[A]);g.appendChild(q);p=document.createElement("div");p.style.marginTop="18px";p.style.textAlign="center";n=document.createElement("input");isLocalStorage&&(n.setAttribute("type","checkbox"),n.checked=!0,n.defaultChecked=!0,p.appendChild(n),A=document.createElement("span"),mxUtils.write(A," "+mxResources.get("rememberThisSetting")),p.appendChild(A),+mxEvent.addListener(A,"click",function(I){n.checked=!n.checked;mxEvent.consume(I)}));g.appendChild(p);A=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});A.className="geBtn";L=mxUtils.button(mxResources.get("apply"),function(){for(var I=["search"],C=0;C<f.length;C++){var U=f[C].apply(this,arguments);null!=U&&I.push(U)}b.sidebar.showEntries(0<I.length?I.join(";"):"",n.checked);b.hideDialog()});L.className="geBtn gePrimaryBtn";p=document.createElement("div");p.style.marginTop="26px";+p.style.textAlign="right";b.editor.cancelFirst?(p.appendChild(A),p.appendChild(L)):(p.appendChild(L),p.appendChild(A))}g.appendChild(p);this.container=g},PluginsDialog=function(b,l,p,g){function x(){J=!0;if(0==O.length){L.innerText="";var t=document.createElement("div");t.className="geDialogHint";mxUtils.write(t,mxResources.get("noPlugins"));L.appendChild(t)}else for(L.innerText="",t=0;t<O.length;t++){var u=document.createElement("span");u.style.display="flex";u.style.alignItems="center";u.style.whiteSpace=+"nowrap";u.style.minHeight="26px";var B=document.createElement("img");B.src=Editor.trashImage;B.style.cursor="pointer";B.style.marginRight="8px";B.style.width="16px";B.style.flexShrink="0";B.setAttribute("title",mxResources.get("delete"));u.appendChild(B);var E=document.createElement("span");E.style.overflow="hidden";E.style.textOverflow="ellipsis";mxUtils.write(E,O[t]);u.appendChild(E);L.appendChild(u);mxEvent.addListener(B,"click",function(I){return function(){b.confirm(mxResources.get("delete")++' "'+O[I]+'"?',function(){null!=p&&p(O[I]);O.splice(I,1);x()})}}(t))}}function A(){if(null!=Q){Q.innerText="";var t=document.createElement("option");t.value="";mxUtils.write(t,mxResources.get("chooseAnOption")||"Choose…");Q.appendChild(t);for(t=0;t<App.publicPlugin.length;t++){var u=App.publicPlugin[t],B=App.pluginRegistry[u],E=document.createElement("option");mxUtils.write(E,u);E.value=u;if(null==B||0<=mxUtils.indexOf(O,B))E.disabled=!0;Q.appendChild(E)}null!=c&&(c.disabled=!0)}}var y=document.createElement("div"),+G=document.createElement("h3");mxUtils.write(G,mxResources.get("plugins"));y.appendChild(G);var L=document.createElement("div");L.className="geDialogSection";L.style.height="160px";L.style.overflow="auto";L.style.fontSize="13px";var O=mxSettings.getPlugins().slice(),J=!1;y.appendChild(L);x();J=!1;var Q=null,c=null;if(null==l){G=document.createElement("div");G.style.display="flex";G.style.alignItems="center";G.style.gap="8px";G.style.marginTop="10px";Q=document.createElement("select");Q.style.flex=+"1";Q.style.minWidth="0";G.appendChild(Q);c=mxUtils.button(mxResources.get("add"),function(){var t=Q.value;""!=t&&(t=App.pluginRegistry[t],null!=t&&0>mxUtils.indexOf(O,t)&&(O.push(t),x()))});c.className="geBtn";c.style.margin="0";c.disabled=!0;G.appendChild(c);mxEvent.addListener(Q,"change",function(){c.disabled=""==Q.value});if(ALLOW_CUSTOM_PLUGINS){var f=mxUtils.button(mxResources.get("custom")+"...",function(){var t=new FilenameDialog(b,"",mxResources.get("add"),function(u){b.hideDialog();if(null!=+u&&0<u.length){u=u.split(";");for(var B=0;B<u.length;B++){var E=u[B],I=App.pluginRegistry[E];null!=I&&(E=I);0<E.length&&0>mxUtils.indexOf(O,E)&&O.push(E)}x()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(t.container,300,80,!0,!0);t.init()});f.className="geBtn";f.style.margin="0";G.appendChild(f)}y.appendChild(G)}var k=x;x=function(){k();A()};A();G=null;null!=l&&(G=mxUtils.button(mxResources.get("add"),function(){l(function(t){t&&0>mxUtils.indexOf(O,t)&&O.push(t);x()})}),+G.className="geBtn");f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});f.className="geBtn";var n=mxUtils.button(g?mxResources.get("close"):mxResources.get("apply"),function(){J?(mxSettings.setPlugins(O),mxSettings.save(),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))):b.hideDialog()});n.className="geBtn gePrimaryBtn";var q=document.createElement("div");q.style.marginTop="14px";q.style.textAlign="right";b.isOffline()||q.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/plugins"));+b.editor.cancelFirst?(g||q.appendChild(f),null!=G&&q.appendChild(G),q.appendChild(n)):(null!=G&&q.appendChild(G),q.appendChild(n),g||q.appendChild(f));y.appendChild(q);this.container=y},CropImageDialog=function(b,l,p,g){function x(){null!=f&&(Q.style.overflow="hidden",f.maxFitScale=null,f.fit(8),f.center(),Q.style.overflow="auto")}function A(N){var P=document.createElement("span");P.style.marginLeft="6px";P.style.fontSize="11px";mxUtils.write(P,N);K.appendChild(P);N=document.createElement("input");+N.setAttribute("type","text");N.style.cssText="width:46px;margin:0 2px;text-align:right;";K.appendChild(N);return N}function y(){var N=t.geometry;M.value=Math.round(N.x);R.value=Math.round(N.y);T.value=Math.round(N.width);v.value=Math.round(N.height)}function G(){if(null!=f){var N=parseFloat(M.value),P=parseFloat(R.value),V=parseFloat(T.value),X=parseFloat(v.value);if(isFinite(N)&&isFinite(P)&&isFinite(V)&&isFinite(X)&&0<V&&0<X){var H=t.geometry.clone();H.x=N;H.y=P;H.width=V;H.height=X;f.model.setGeometry(t,+H);f.model.setStyle(t,E+L());f.selectAll()}}}function L(){var N=m.checked,P=r.checked,V=t.geometry;0>V.x?(V.width+=V.x,V.x=0):V.x+V.width>u&&(V.width=u-V.x,V.x=Math.min(V.x,u));0>V.y?(V.height+=V.y,V.y=0):V.y+V.height>B&&(V.height=B-V.y,V.y=Math.min(V.y,B));var X=V.x/u*100,H=100-(V.x+V.width)/u*100,W=100-(V.y+V.height)/B*100;return"inset("+mxUtils.format(V.y/B*100)+"% "+mxUtils.format(H)+"% "+mxUtils.format(W)+"% "+mxUtils.format(X)+"%"+(N?" round "+q+"%":P?" round 50%":"")+")"}function O(N){null!=+f&&(!0!==N&&(f.model.setGeometry(t,n.clone()),q=5,D.value=q),f.model.setStyle(t,E+L()),f.selectAll(),y(),z.style.visibility=m.checked?"visible":"hidden")}var J=document.createElement("div");J.style.display="flex";J.style.flexDirection="column";J.style.height="100%";var Q=document.createElement("div");Q.style.flex="1";Q.style.minHeight="0";Q.style.overflow="auto";Q.style.border="1px solid";J.appendChild(Q);var c=l.replace(";base64",""),f=null,k=null,n=null,q=5,t=new mxCell("",new mxGeometry(0,0,1,+1),""),u=0,B=0,E="shape=image;fillColor=none;rotatable=0;cloneable=0;deletable=0;image="+c+";clipPath=",I="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;opacity=40;image="+c+";",C="shape=image;fillColor=none;movable=0;resizable=0;editable=0;connectable=0;rotatable=0;deletable=0;image="+c+";",U=new Image;U.onload=function(){function N(){f.model.setStyle(t,E+L());y()}u=U.naturalWidth;B=U.naturalHeight;n=new mxGeometry(.15*u,.15*B,.7*u,.7*B);t.geometry=+n.clone();f=new Graph(Q);f.autoExtend=!1;f.autoScroll=!1;f.setGridEnabled(!1);f.setEnabled(!0);f.setPanning(!0);f.setConnectable(!1);f.getRubberband().setEnabled(!1);f.graphHandler.allowLivePreview=!1;f.centerZoom=!0;f.background="#ffffff";var P=f.createVertexHandler;f.createVertexHandler=function(){var na=P.apply(this,arguments);na.livePreview=!1;return na};var V=f.isCellSelectable;f.isCellSelectable=function(na){return na===t&&V.apply(this,arguments)};k=new mxCell("",new mxGeometry(0,0,u,B),I);+k.vertex=!0;f.addCell(k);if(null!=p)try{if("inset"==p.substring(0,5)){var X=t.geometry,H=p.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),W=parseFloat(H[0]),Z=parseFloat(H[1]),Y=parseFloat(H[2]),ba=parseFloat(H[3]);isFinite(W)&&isFinite(Z)&&isFinite(Y)&&isFinite(ba)?(X.x=ba/100*u,X.y=W/100*B,X.width=(100-Z)/100*u-X.x,X.height=(100-Y)/100*B-X.y,"round"==H[4]?"50%"==H[5]?r.setAttribute("checked","checked"):(q=parseInt(H[5]),D.value=q,m.setAttribute("checked","checked"),z.style.visibility="visible"):d.setAttribute("checked",+"checked")):p=null}else p=null}catch(na){}t.style=E+(p?p:L());t.vertex=!0;f.addCell(t);f.selectAll();f.addListener(mxEvent.CELLS_MOVED,N);f.addListener(mxEvent.CELLS_RESIZED,N);var ea=f.graphHandler.mouseUp,aa=f.graphHandler.mouseDown;f.graphHandler.mouseUp=function(){ea.apply(this,arguments);null!=k&&f.model.setStyle(k,I)};f.graphHandler.mouseDown=function(){aa.apply(this,arguments);null!=k&&f.model.setStyle(k,C)};f.dblClick=function(){};var ha=f.getSelectionModel().changeSelection;f.getSelectionModel().changeSelection=+function(){ha.call(this,[t],[t])};y();x()};U.onerror=function(){U.onload=null;U.src=Editor.errorImage};U.src=l;var K=document.createElement("div");K.style.display="flex";K.style.flexShrink="0";K.style.alignItems="center";K.style.justifyContent="center";K.style.paddingTop="6px";l=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=f&&f.zoomIn()});c=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=f&&f.zoomOut()});var S=b.createToolbarButton(Editor.zoomFitImage,+mxResources.get("fit"),function(){x()});K.appendChild(l);K.appendChild(c);K.appendChild(S);var M=A("X"),R=A("Y"),T=A("W"),v=A("H");mxEvent.addListener(M,"change",G);mxEvent.addListener(R,"change",G);mxEvent.addListener(T,"change",G);mxEvent.addListener(v,"change",G);J.appendChild(K);l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.display="flex";l.style.flexShrink="0";l.style.alignItems="center";l.style.justifyContent="center";var d=document.createElement("input");d.setAttribute("type","radio");d.setAttribute("id","croppingRect");d.setAttribute("name","croppingShape");d.setAttribute("checked","checked");d.style.margin="5px";l.appendChild(d);c=document.createElement("label");c.setAttribute("for","croppingRect");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("rectangle"));l.appendChild(c);var m=document.createElement("input");m.setAttribute("type","radio");m.setAttribute("id","croppingRounded");m.setAttribute("name","croppingShape");m.style.margin="5px";l.appendChild(m);c=document.createElement("label");c.setAttribute("for","croppingRounded");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("rounded"));l.appendChild(c);var r=document.createElement("input");r.setAttribute("type","radio");r.setAttribute("id","croppingEllipse");r.setAttribute("name","croppingShape");r.style.margin="5px";l.appendChild(r);c=document.createElement("label");c.setAttribute("for",-"croppingEllipse");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("ellipse"));l.appendChild(c);L.appendChild(l);mxEvent.addListener(d,"change",M);mxEvent.addListener(m,"change",M);mxEvent.addListener(r,"change",M);var A=document.createElement("div");A.style.textAlign="center";A.style.flexShrink="0";A.style.visibility="hidden";var D=document.createElement("input");D.setAttribute("type","range");D.setAttribute("min","1");D.setAttribute("max",-"49");D.setAttribute("value",q);D.setAttribute("title",mxResources.get("arcSize"));A.appendChild(D);L.appendChild(A);mxEvent.addListener(D,"change",function(){q=this.value;M(!0)});l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});l.className="geBtn";c=mxUtils.button(mxResources.get("apply"),function(){g(K(),t.geometry.width,t.geometry.height);b.hideDialog()});c.className="geBtn gePrimaryBtn";S=mxUtils.button(mxResources.get("reset"),function(){g(null,u,y);b.hideDialog()});S.className=-"geBtn";var G=document.createElement("div");G.style.flexShrink="0";G.style.marginTop="10px";G.style.whiteSpace="nowrap";G.style.display="flex";G.style.justifyContent="flex-end";b.editor.cancelFirst?(G.appendChild(l),G.appendChild(S),G.appendChild(c)):(G.appendChild(S),G.appendChild(c),G.appendChild(l));L.appendChild(G);this.container=L},EditGeometryDialog=function(b,l){function p(u,y){var E=document.createElement("div");E.className="geDialogInlineField";var I=document.createElement("label");mxUtils.write(I,-u);E.appendChild(I);u=document.createElement("input");u.setAttribute("type","text");u.value=null!=y?y:"";E.appendChild(u);E.input=u;return E}var g=b.editor.graph,x=1==l.length?g.getCellGeometry(l[0]):null,B=document.createElement("div"),z=document.createElement("h3");mxUtils.write(z,mxResources.get("editGeometry"));B.appendChild(z);z=document.createElement("div");z.className="geDialogSection";var F=document.createElement("div");F.className="geDialogCheckRow";var K=document.createElement("input");-K.setAttribute("type","checkbox");K.setAttribute("id","geEditGeoRelative");null!=x&&x.relative&&(K.setAttribute("checked","checked"),K.defaultChecked=!0);F.appendChild(K);var M=document.createElement("label");M.setAttribute("for","geEditGeoRelative");mxUtils.write(M,mxResources.get("relative"));F.appendChild(M);z.appendChild(F);F=document.createElement("div");F.className="geDialogInlineFields";M=p(mxResources.get("left"),null!=x?x.x:null);var L=M.input;F.appendChild(M);M=p(mxResources.get("top"),-null!=x?x.y:null);var Q=M.input;F.appendChild(M);z.appendChild(F);F=document.createElement("div");F.className="geDialogInlineFields";F.style.marginTop="6px";M=p(mxResources.get("dx"),null!=x&&null!=x.offset?x.offset.x:null);var c=M.input;F.appendChild(M);M=p(mxResources.get("dy"),null!=x&&null!=x.offset?x.offset.y:null);var f=M.input;F.appendChild(M);z.appendChild(F);B.appendChild(z);z=document.createElement("div");z.className="geDialogSection";F=document.createElement("div");F.className="geDialogInlineFields";-M=p(mxResources.get("width"),null!=x?x.width:null);var k=M.input;F.appendChild(M);x=p(mxResources.get("height"),null!=x?x.height:null);var n=x.input;F.appendChild(x);z.appendChild(F);B.appendChild(z);x=document.createElement("div");x.className="geDialogSection";z=document.createElement("div");z.className="geDialogFormRow";F=document.createElement("span");F.className="geDialogFormLabel";mxUtils.write(F,mxResources.get("rotation")+":");z.appendChild(F);var q=document.createElement("input");q.setAttribute("type",-"text");q.value=1==l.length?mxUtils.getValue(g.getCellStyle(l[0]),mxConstants.STYLE_ROTATION,0):"";z.appendChild(q);x.appendChild(z);B.appendChild(x);this.init=function(){L.focus();L.select()};var t=function(){g.getModel().beginUpdate();try{for(var u=0;u<l.length;u++){var y=g.getCellGeometry(l[u]);null!=y&&(y=y.clone(),g.isCellMovable(l[u])&&(y.relative=K.checked,0<mxUtils.trim(L.value).length&&(y.x=Number(L.value)),0<mxUtils.trim(Q.value).length&&(y.y=Number(Q.value)),0<mxUtils.trim(c.value).length&&-(null==y.offset&&(y.offset=new mxPoint),y.offset.x=Number(c.value)),0<mxUtils.trim(f.value).length&&(null==y.offset&&(y.offset=new mxPoint),y.offset.y=Number(f.value))),g.isCellResizable(l[u])&&(0<mxUtils.trim(k.value).length&&(y.width=Number(k.value)),0<mxUtils.trim(n.value).length&&(y.height=Number(n.value))),g.getModel().setGeometry(l[u],y));0<mxUtils.trim(q.value).length&&g.setCellRotation(l[u],Number(q.value))}}finally{g.getModel().endUpdate()}};this.container=(new CustomDialog(b,B,t,null,mxResources.get("apply"))).container;-mxEvent.addListener(this.container,"keypress",function(u){13==u.keyCode&&(t(),b.hideDialog())})},LibraryDialog=function(b,l,p,g,x,B,z){function F(R){for(R=document.elementFromPoint(R.clientX,R.clientY);null!=R&&R.parentNode!=t;)R=R.parentNode;var T=null;if(null!=R){var v=t.firstChild;for(T=0;null!=v&&v!=R;)v=v.nextSibling,T++}return T}function K(R,T,v,d,m,r,A,D,G){try{if(b.spinner.stop(),null==T||"image/"==T.substring(0,6))if(null==R&&null!=A||null==y[R]){var O=function(){ba.innerText="";ba.style.cursor=-"pointer";ba.style.whiteSpace="nowrap";ba.style.textOverflow="ellipsis";mxUtils.write(ba,null!=ea.title&&0<ea.title.length?ea.title:mxResources.get("untitled"));ba.style.color=null==ea.title||0==ea.title.length?"#d0d0d0":""};t.style.backgroundImage="";u.style.display="none";var P=m,V=r;if(m>b.maxImageSize||r>b.maxImageSize){var Y=Math.min(1,Math.min(b.maxImageSize/Math.max(1,m)),b.maxImageSize/Math.max(1,r));m*=Y;r*=Y}P>V?(V=Math.round(100*V/P),P=100):(P=Math.round(100*P/V),V=100);var H=document.createElement("div");-H.setAttribute("draggable","true");H.style.display="inline-block";H.style.position="relative";H.style.padding="0 12px";H.style.cursor="move";mxUtils.setPrefixedStyle(H.style,"transition","transform .1s ease-in-out");if(null!=R){var W=document.createElement("img");W.setAttribute("src",U.convert(R));W.style.width=P+"px";W.style.height=V+"px";W.style.margin="10px";W.style.paddingBottom=Math.floor((100-V)/2)+"px";W.style.paddingLeft=Math.floor((100-P)/2)+"px";H.appendChild(W)}else if(null!=A){var Z=b.stringToCells("<"==-A.xml.charAt(0)?A.xml:Graph.decompress(A.xml));0<Z.length&&(b.sidebar.createThumb(Z,100,100,H,null,!0,!1,null,null,c.shapeBackgroundColor),H.firstChild.style.display="inline-block",H.firstChild.style.cursor="")}var X=document.createElement("img");X.setAttribute("src",Editor.closeBlackImage);X.setAttribute("border","0");X.setAttribute("title",mxResources.get("delete"));X.setAttribute("align","top");X.style.paddingTop="4px";X.style.position="absolute";X.style.marginLeft="-12px";X.style.zIndex="1";X.style.cursor=-"pointer";mxEvent.addListener(X,"dragstart",function(sa){mxEvent.consume(sa)});(function(sa,ua,xa){mxEvent.addListener(X,"click",function(qa){y[ua]=null;for(var Aa=0;Aa<Q.length;Aa++)if(null!=Q[Aa].data&&Q[Aa].data==ua||null!=Q[Aa].xml&&null!=xa&&Q[Aa].xml==xa.xml){Q.splice(Aa,1);break}H.parentNode.removeChild(sa);0==Q.length&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",u.style.display="");mxEvent.consume(qa)});mxEvent.addListener(X,"dblclick",function(qa){mxEvent.consume(qa)})})(H,-R,A);H.appendChild(X);H.style.marginBottom="30px";var ba=document.createElement("div");ba.style.position="absolute";ba.style.boxSizing="border-box";ba.style.bottom="-18px";ba.style.left="10px";ba.style.right="10px";ba.style.backgroundColor="light-dark(#ffffff, transparent)";ba.style.overflow="hidden";ba.style.textAlign="center";ba.setAttribute("title",mxResources.get("rename"));var ea=null;null!=R?(ea={data:R,w:m,h:r,title:G},null!=D&&(ea.aspect=D),y[R]=W,Q.push(ea)):null!=A&&(A.aspect="fixed",Q.push(A),-ea=A);mxEvent.addListener(ba,"keydown",function(sa){13==sa.keyCode&&null!=C&&(C(),C=null,mxEvent.consume(sa))});O();H.appendChild(ba);mxEvent.addListener(ba,"mousedown",function(sa){"true"!=ba.getAttribute("contentEditable")&&mxEvent.consume(sa)});Z=function(sa){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var ua=new FilenameDialog(b,ea.title||"",mxResources.get("ok"),function(xa){null!=xa&&(ea.title=xa,O())},mxResources.get("enterValue"));b.showDialog(ua.container,+"croppingEllipse");c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.style.padding="3px";mxUtils.write(c,mxResources.get("ellipse"));l.appendChild(c);J.appendChild(l);mxEvent.addListener(d,"change",O);mxEvent.addListener(m,"change",O);mxEvent.addListener(r,"change",O);var z=document.createElement("div");z.style.textAlign="center";z.style.flexShrink="0";z.style.visibility="hidden";var D=document.createElement("input");D.setAttribute("type","range");D.setAttribute("min","1");D.setAttribute("max",+"49");D.setAttribute("value",q);D.setAttribute("title",mxResources.get("arcSize"));z.appendChild(D);J.appendChild(z);mxEvent.addListener(D,"change",function(){q=this.value;O(!0)});l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});l.className="geBtn";c=mxUtils.button(mxResources.get("apply"),function(){g(L(),t.geometry.width,t.geometry.height);b.hideDialog()});c.className="geBtn gePrimaryBtn";S=mxUtils.button(mxResources.get("reset"),function(){g(null,u,B);b.hideDialog()});S.className=+"geBtn";var F=document.createElement("div");F.style.flexShrink="0";F.style.marginTop="10px";F.style.whiteSpace="nowrap";F.style.display="flex";F.style.justifyContent="flex-end";b.editor.cancelFirst?(F.appendChild(l),F.appendChild(S),F.appendChild(c)):(F.appendChild(S),F.appendChild(c),F.appendChild(l));J.appendChild(F);this.container=J},EditGeometryDialog=function(b,l){function p(u,B){var E=document.createElement("div");E.className="geDialogInlineField";var I=document.createElement("label");mxUtils.write(I,+u);E.appendChild(I);u=document.createElement("input");u.setAttribute("type","text");u.value=null!=B?B:"";E.appendChild(u);E.input=u;return E}var g=b.editor.graph,x=1==l.length?g.getCellGeometry(l[0]):null,A=document.createElement("div"),y=document.createElement("h3");mxUtils.write(y,mxResources.get("editGeometry"));A.appendChild(y);y=document.createElement("div");y.className="geDialogSection";var G=document.createElement("div");G.className="geDialogCheckRow";var L=document.createElement("input");+L.setAttribute("type","checkbox");L.setAttribute("id","geEditGeoRelative");null!=x&&x.relative&&(L.setAttribute("checked","checked"),L.defaultChecked=!0);G.appendChild(L);var O=document.createElement("label");O.setAttribute("for","geEditGeoRelative");mxUtils.write(O,mxResources.get("relative"));G.appendChild(O);y.appendChild(G);G=document.createElement("div");G.className="geDialogInlineFields";O=p(mxResources.get("left"),null!=x?x.x:null);var J=O.input;G.appendChild(O);O=p(mxResources.get("top"),+null!=x?x.y:null);var Q=O.input;G.appendChild(O);y.appendChild(G);G=document.createElement("div");G.className="geDialogInlineFields";G.style.marginTop="6px";O=p(mxResources.get("dx"),null!=x&&null!=x.offset?x.offset.x:null);var c=O.input;G.appendChild(O);O=p(mxResources.get("dy"),null!=x&&null!=x.offset?x.offset.y:null);var f=O.input;G.appendChild(O);y.appendChild(G);A.appendChild(y);y=document.createElement("div");y.className="geDialogSection";G=document.createElement("div");G.className="geDialogInlineFields";+O=p(mxResources.get("width"),null!=x?x.width:null);var k=O.input;G.appendChild(O);x=p(mxResources.get("height"),null!=x?x.height:null);var n=x.input;G.appendChild(x);y.appendChild(G);A.appendChild(y);x=document.createElement("div");x.className="geDialogSection";y=document.createElement("div");y.className="geDialogFormRow";G=document.createElement("span");G.className="geDialogFormLabel";mxUtils.write(G,mxResources.get("rotation")+":");y.appendChild(G);var q=document.createElement("input");q.setAttribute("type",+"text");q.value=1==l.length?mxUtils.getValue(g.getCellStyle(l[0]),mxConstants.STYLE_ROTATION,0):"";y.appendChild(q);x.appendChild(y);A.appendChild(x);this.init=function(){J.focus();J.select()};var t=function(){g.getModel().beginUpdate();try{for(var u=0;u<l.length;u++){var B=g.getCellGeometry(l[u]);null!=B&&(B=B.clone(),g.isCellMovable(l[u])&&(B.relative=L.checked,0<mxUtils.trim(J.value).length&&(B.x=Number(J.value)),0<mxUtils.trim(Q.value).length&&(B.y=Number(Q.value)),0<mxUtils.trim(c.value).length&&+(null==B.offset&&(B.offset=new mxPoint),B.offset.x=Number(c.value)),0<mxUtils.trim(f.value).length&&(null==B.offset&&(B.offset=new mxPoint),B.offset.y=Number(f.value))),g.isCellResizable(l[u])&&(0<mxUtils.trim(k.value).length&&(B.width=Number(k.value)),0<mxUtils.trim(n.value).length&&(B.height=Number(n.value))),g.getModel().setGeometry(l[u],B));0<mxUtils.trim(q.value).length&&g.setCellRotation(l[u],Number(q.value))}}finally{g.getModel().endUpdate()}};this.container=(new CustomDialog(b,A,t,null,mxResources.get("apply"))).container;+mxEvent.addListener(this.container,"keypress",function(u){13==u.keyCode&&(t(),b.hideDialog())})},LibraryDialog=function(b,l,p,g,x,A,y){function G(R){for(R=document.elementFromPoint(R.clientX,R.clientY);null!=R&&R.parentNode!=t;)R=R.parentNode;var T=null;if(null!=R){var v=t.firstChild;for(T=0;null!=v&&v!=R;)v=v.nextSibling,T++}return T}function L(R,T,v,d,m,r,z,D,F){try{if(b.spinner.stop(),null==T||"image/"==T.substring(0,6))if(null==R&&null!=z||null==B[R]){var N=function(){ba.innerText="";ba.style.cursor=+"pointer";ba.style.whiteSpace="nowrap";ba.style.textOverflow="ellipsis";mxUtils.write(ba,null!=ea.title&&0<ea.title.length?ea.title:mxResources.get("untitled"));ba.style.color=null==ea.title||0==ea.title.length?"#d0d0d0":""};t.style.backgroundImage="";u.style.display="none";var P=m,V=r;if(m>b.maxImageSize||r>b.maxImageSize){var X=Math.min(1,Math.min(b.maxImageSize/Math.max(1,m)),b.maxImageSize/Math.max(1,r));m*=X;r*=X}P>V?(V=Math.round(100*V/P),P=100):(P=Math.round(100*P/V),V=100);var H=document.createElement("div");+H.setAttribute("draggable","true");H.style.display="inline-block";H.style.position="relative";H.style.padding="0 12px";H.style.cursor="move";mxUtils.setPrefixedStyle(H.style,"transition","transform .1s ease-in-out");if(null!=R){var W=document.createElement("img");W.setAttribute("src",U.convert(R));W.style.width=P+"px";W.style.height=V+"px";W.style.margin="10px";W.style.paddingBottom=Math.floor((100-V)/2)+"px";W.style.paddingLeft=Math.floor((100-P)/2)+"px";H.appendChild(W)}else if(null!=z){var Z=b.stringToCells("<"==+z.xml.charAt(0)?z.xml:Graph.decompress(z.xml));0<Z.length&&(b.sidebar.createThumb(Z,100,100,H,null,!0,!1,null,null,c.shapeBackgroundColor),H.firstChild.style.display="inline-block",H.firstChild.style.cursor="")}var Y=document.createElement("img");Y.setAttribute("src",Editor.closeBlackImage);Y.setAttribute("border","0");Y.setAttribute("title",mxResources.get("delete"));Y.setAttribute("align","top");Y.style.paddingTop="4px";Y.style.position="absolute";Y.style.marginLeft="-12px";Y.style.zIndex="1";Y.style.cursor=+"pointer";mxEvent.addListener(Y,"dragstart",function(sa){mxEvent.consume(sa)});(function(sa,ua,xa){mxEvent.addListener(Y,"click",function(qa){B[ua]=null;for(var Aa=0;Aa<Q.length;Aa++)if(null!=Q[Aa].data&&Q[Aa].data==ua||null!=Q[Aa].xml&&null!=xa&&Q[Aa].xml==xa.xml){Q.splice(Aa,1);break}H.parentNode.removeChild(sa);0==Q.length&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",u.style.display="");mxEvent.consume(qa)});mxEvent.addListener(Y,"dblclick",function(qa){mxEvent.consume(qa)})})(H,+R,z);H.appendChild(Y);H.style.marginBottom="30px";var ba=document.createElement("div");ba.style.position="absolute";ba.style.boxSizing="border-box";ba.style.bottom="-18px";ba.style.left="10px";ba.style.right="10px";ba.style.backgroundColor="light-dark(#ffffff, transparent)";ba.style.overflow="hidden";ba.style.textAlign="center";ba.setAttribute("title",mxResources.get("rename"));var ea=null;null!=R?(ea={data:R,w:m,h:r,title:F},null!=D&&(ea.aspect=D),B[R]=W,Q.push(ea)):null!=z&&(z.aspect="fixed",Q.push(z),+ea=z);mxEvent.addListener(ba,"keydown",function(sa){13==sa.keyCode&&null!=C&&(C(),C=null,mxEvent.consume(sa))});N();H.appendChild(ba);mxEvent.addListener(ba,"mousedown",function(sa){"true"!=ba.getAttribute("contentEditable")&&mxEvent.consume(sa)});Z=function(sa){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var ua=new FilenameDialog(b,ea.title||"",mxResources.get("ok"),function(xa){null!=xa&&(ea.title=xa,N())},mxResources.get("enterValue"));b.showDialog(ua.container,300,80,!0,!0);ua.init();mxEvent.consume(sa)}else if("true"!=ba.getAttribute("contentEditable")){null!=C&&(C(),C=null);if(null==ea.title||0==ea.title.length)ba.innerText="";ba.style.textOverflow="";ba.style.whiteSpace="";ba.style.cursor="text";ba.style.color="";ba.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(ba.style,"user-select","text");ba.focus();document.execCommand("selectAll",!1,null);C=function(){ba.removeAttribute("contentEditable");ba.style.cursor="pointer";ea.title=mxUtils.getTextContent(ba);-O()};mxEvent.consume(sa)}};mxEvent.addListener(ba,"click",Z);mxEvent.addListener(H,"dblclick",Z);t.appendChild(H);mxEvent.addListener(H,"dragstart",function(sa){null==C&&(null==R&&null!=A&&(X.style.visibility="hidden",ba.style.visibility="hidden"),mxClient.IS_FF&&null!=A.xml&&sa.dataTransfer.setData("Text",A.xml),E=F(sa),mxClient.IS_GC&&(H.style.opacity="0.9"),window.setTimeout(function(){mxUtils.setPrefixedStyle(H.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(H,30);X.style.visibility="";-ba.style.visibility=""},0))});mxEvent.addListener(H,"dragend",function(sa){"hidden"==X.style.visibility&&(X.style.visibility="",ba.style.visibility="");E=null;mxUtils.setOpacity(H,100);mxUtils.setPrefixedStyle(H.style,"transform",null)})}else J||(J=!0,b.handleError({message:mxResources.get("fileExists")}));else{m=!1;try{if(P=mxUtils.parseXml(R),"mxlibrary"==P.documentElement.nodeName){V=JSON.parse(mxUtils.getTextContent(P.documentElement));if(null!=V&&0<V.length)for(var aa=0;aa<V.length;aa++)null!=-V[aa].xml?K(null,null,0,0,0,0,V[aa]):K(V[aa].data,null,0,0,V[aa].w,V[aa].h,null,"fixed",V[aa].title);m=!0}else if("mxfile"==P.documentElement.nodeName){var ha=P.documentElement.getElementsByTagName("diagram");for(aa=0;aa<ha.length;aa++){var na=Editor.getDiagramNodeXml(ha[aa]);Z=b.stringToCells(na);if(0<Z.length){var ra=b.editor.graph.getBoundingBoxFromGeometry(Z);null!=ra&&K(null,null,0,0,0,0,{xml:na,w:ra.width,h:ra.height})}}m=!0}}catch(sa){null!=window.console&&console.error("Error in library dialog: "+-sa)}m||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(sa){null!=window.console&&console.log("Error in library dialog: "+sa)}return null}function M(R){R.dataTransfer.dropEffect=null!=E?"move":"copy";R.stopPropagation();R.preventDefault()}function L(R){R.stopPropagation();R.preventDefault();J=!1;I=F(R);if(null!=E)null!=I&&I<t.children.length?(Q.splice(I>E?I-1:I,0,Q.splice(E,1)[0]),t.insertBefore(t.children[E],t.children[I])):(Q.push(Q.splice(E,1)[0]),t.appendChild(t.children[E]));-else if(0<R.dataTransfer.files.length)b.importFiles(R.dataTransfer.files,0,0,b.maxImageSize,S(R));else if(0<=mxUtils.indexOf(R.dataTransfer.types,"text/uri-list")){var T=decodeURIComponent(R.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(T)||/(\.png)($|\?)/i.test(T)||/(\.gif)($|\?)/i.test(T)||/(\.svg)($|\?)/i.test(T))&&b.loadImage(T,function(v){K(T,null,0,0,v.width,v.height);t.scrollTop=t.scrollHeight})}R.stopPropagation();R.preventDefault()}var Q=[],c=b.editor.graph;p=document.createElement("div");+N()};mxEvent.consume(sa)}};mxEvent.addListener(ba,"click",Z);mxEvent.addListener(H,"dblclick",Z);t.appendChild(H);mxEvent.addListener(H,"dragstart",function(sa){null==C&&(null==R&&null!=z&&(Y.style.visibility="hidden",ba.style.visibility="hidden"),mxClient.IS_FF&&null!=z.xml&&sa.dataTransfer.setData("Text",z.xml),E=G(sa),mxClient.IS_GC&&(H.style.opacity="0.9"),window.setTimeout(function(){mxUtils.setPrefixedStyle(H.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(H,30);Y.style.visibility="";+ba.style.visibility=""},0))});mxEvent.addListener(H,"dragend",function(sa){"hidden"==Y.style.visibility&&(Y.style.visibility="",ba.style.visibility="");E=null;mxUtils.setOpacity(H,100);mxUtils.setPrefixedStyle(H.style,"transform",null)})}else K||(K=!0,b.handleError({message:mxResources.get("fileExists")}));else{m=!1;try{if(P=mxUtils.parseXml(R),"mxlibrary"==P.documentElement.nodeName){V=JSON.parse(mxUtils.getTextContent(P.documentElement));if(null!=V&&0<V.length)for(var aa=0;aa<V.length;aa++)null!=+V[aa].xml?L(null,null,0,0,0,0,V[aa]):L(V[aa].data,null,0,0,V[aa].w,V[aa].h,null,"fixed",V[aa].title);m=!0}else if("mxfile"==P.documentElement.nodeName){var ha=P.documentElement.getElementsByTagName("diagram");for(aa=0;aa<ha.length;aa++){var na=Editor.getDiagramNodeXml(ha[aa]);Z=b.stringToCells(na);if(0<Z.length){var ra=b.editor.graph.getBoundingBoxFromGeometry(Z);null!=ra&&L(null,null,0,0,0,0,{xml:na,w:ra.width,h:ra.height})}}m=!0}}catch(sa){null!=window.console&&console.error("Error in library dialog: "++sa)}m||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(sa){null!=window.console&&console.log("Error in library dialog: "+sa)}return null}function O(R){R.dataTransfer.dropEffect=null!=E?"move":"copy";R.stopPropagation();R.preventDefault()}function J(R){R.stopPropagation();R.preventDefault();K=!1;I=G(R);if(null!=E)null!=I&&I<t.children.length?(Q.splice(I>E?I-1:I,0,Q.splice(E,1)[0]),t.insertBefore(t.children[E],t.children[I])):(Q.push(Q.splice(E,1)[0]),t.appendChild(t.children[E]));+else if(0<R.dataTransfer.files.length)b.importFiles(R.dataTransfer.files,0,0,b.maxImageSize,S(R));else if(0<=mxUtils.indexOf(R.dataTransfer.types,"text/uri-list")){var T=decodeURIComponent(R.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(T)||/(\.png)($|\?)/i.test(T)||/(\.gif)($|\?)/i.test(T)||/(\.svg)($|\?)/i.test(T))&&b.loadImage(T,function(v){L(T,null,0,0,v.width,v.height);t.scrollTop=t.scrollHeight})}R.stopPropagation();R.preventDefault()}var Q=[],c=b.editor.graph;p=document.createElement("div");p.style.height="100%";p.style.display="flex";p.style.flexDirection="column";var f=document.createElement("div");f.className="geDialogSection";f.style.flexShrink="0";var k=document.createElement("div");k.className="geDialogFormRow";var n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("filename")+":");k.appendChild(n);null==l&&(l=b.defaultLibraryName+".xml");var q=document.createElement("input");q.setAttribute("type","text");q.setAttribute("value",l);null==x||x.isRenamable()||q.setAttribute("disabled","true");k.appendChild(q);f.appendChild(k);Editor.enableUncompressedLibraries&&(l=document.createElement("div"),l.className="geDialogCheckRow",k=document.createElement("input"),k.setAttribute("type","checkbox"),k.setAttribute("id","geLibCompressed"),l.appendChild(k),k=document.createElement("label"),k.setAttribute("for","geLibCompressed"),mxUtils.write(k,mxResources.get("compressed")),l.appendChild(k),f.appendChild(l));p.appendChild(f);this.init=function(){if(null==x||x.isRenamable())q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null)};var t=document.createElement("div");t.style.border="light-dark(1px solid rgba(0, 0, 0, 0.15), 1px solid rgba(255, 255, 255, 0.15))";t.style.borderRadius="8px";t.style.marginTop="10px";t.style.overflow="auto";t.style.flex="1";t.style.minHeight="0";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";0==Q.length&&Graph.fileSupport&&-(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var u=document.createElement("div");u.style.position="absolute";u.style.left="0";u.style.right="0";u.style.top="260px";u.style.textAlign="center";u.style.fontSize="22px";u.style.color="#a0c3ff";mxUtils.write(u,mxResources.get("dragImagesHere"));p.appendChild(u);var y={},E=null,I=null,C=null;f=function(R){"true"!=mxEvent.getSource(R).getAttribute("contentEditable")&&null!=C&&(C(),C=null,mxEvent.consume(R))};mxEvent.addListener(t,"mousedown",-f);mxEvent.addListener(t,"pointerdown",f);mxEvent.addListener(t,"touchstart",f);var U=new mxUrlConverter,J=!1;if(null!=g)for(f=0;f<g.length;f++)l=g[f],K(l.data,null,0,0,l.w,l.h,l,l.aspect,l.title);mxEvent.addListener(t,"dragleave",function(R){u.style.cursor="";for(var T=mxEvent.getSource(R);null!=T;){if(T==t||T==u){R.stopPropagation();R.preventDefault();break}T=T.parentNode}});var S=function(R){return function(T,v,d,m,r,A,D,G,O){null!=O&&EditorUi.isVisioFilename(O.name)?b.importVisio(O,mxUtils.bind(this,-function(P){K(P,v,d,m,r,A,D,"fixed",mxEvent.isAltDown(R)?null:D.substring(0,D.lastIndexOf(".")).replace(/_/g," "))})):null!=O&&(new XMLHttpRequest).upload&&b.isRemoteFileFormat(T,O.name)?b.isExternalDataComms()?b.parseFile(O,mxUtils.bind(this,function(P){4==P.readyState&&(b.spinner.stop(),200<=P.status&&299>=P.status&&(K(P.responseText,v,d,m,r,A,D,"fixed",mxEvent.isAltDown(R)?null:D.substring(0,D.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),-mxResources.get("notInOffline"))):(K(T,v,d,m,r,A,D,"fixed",mxEvent.isAltDown(R)?null:D.substring(0,D.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",M);mxEvent.addListener(t,"drop",L);mxEvent.addListener(u,"dragover",M);mxEvent.addListener(u,"drop",L);p.appendChild(t);g=document.createElement("div");g.style.textAlign="right";g.style.marginTop="14px";g.style.flexShrink="0";f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});f.setAttribute("id",+(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var u=document.createElement("div");u.style.position="absolute";u.style.left="0";u.style.right="0";u.style.top="260px";u.style.textAlign="center";u.style.fontSize="22px";u.style.color="#a0c3ff";mxUtils.write(u,mxResources.get("dragImagesHere"));p.appendChild(u);var B={},E=null,I=null,C=null;f=function(R){"true"!=mxEvent.getSource(R).getAttribute("contentEditable")&&null!=C&&(C(),C=null,mxEvent.consume(R))};mxEvent.addListener(t,"mousedown",+f);mxEvent.addListener(t,"pointerdown",f);mxEvent.addListener(t,"touchstart",f);var U=new mxUrlConverter,K=!1;if(null!=g)for(f=0;f<g.length;f++)l=g[f],L(l.data,null,0,0,l.w,l.h,l,l.aspect,l.title);mxEvent.addListener(t,"dragleave",function(R){u.style.cursor="";for(var T=mxEvent.getSource(R);null!=T;){if(T==t||T==u){R.stopPropagation();R.preventDefault();break}T=T.parentNode}});var S=function(R){return function(T,v,d,m,r,z,D,F,N){null!=N&&EditorUi.isVisioFilename(N.name)?b.importVisio(N,mxUtils.bind(this,+function(P){L(P,v,d,m,r,z,D,"fixed",mxEvent.isAltDown(R)?null:D.substring(0,D.lastIndexOf(".")).replace(/_/g," "))})):null!=N&&(new XMLHttpRequest).upload&&b.isRemoteFileFormat(T,N.name)?b.isExternalDataComms()?b.parseFile(N,mxUtils.bind(this,function(P){4==P.readyState&&(b.spinner.stop(),200<=P.status&&299>=P.status&&(L(P.responseText,v,d,m,r,z,D,"fixed",mxEvent.isAltDown(R)?null:D.substring(0,D.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),+mxResources.get("notInOffline"))):(L(T,v,d,m,r,z,D,"fixed",mxEvent.isAltDown(R)?null:D.substring(0,D.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",O);mxEvent.addListener(t,"drop",J);mxEvent.addListener(u,"dragover",O);mxEvent.addListener(u,"drop",J);p.appendChild(t);g=document.createElement("div");g.style.textAlign="right";g.style.marginTop="14px";g.style.flexShrink="0";f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});f.setAttribute("id","btnCancel");f.className="geBtn";b.editor.cancelFirst&&g.appendChild(f);"draw.io"!=b.getServiceName()||null==x||x.constructor!=DriveLibrary&&x.constructor!=GitHubLibrary||(l=mxUtils.button(mxResources.get("link"),function(){b.getPublicUrl(x,function(R){if(null!=R){var T=b.getSearch("create title mode url drive splash state clibs ui".split(" "));T+=(0==T.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(R);R=new EmbedDialog(b,window.location.protocol+"//"+window.location.host+"/"+T,null,null,null,null,"Check out the library I made using @drawio");b.showDialog(R.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));R.init()}else x.constructor==DriveLibrary?b.showError(mxResources.get("error"),mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){b.drive.showPermissions(x.getId(),x)}),null,mxResources.get("ok"),mxUtils.bind(this,function(){})):b.handleError({message:mxResources.get("diagramIsNotPublic")})})}),l.className="geBtn",g.appendChild(l));-l=mxUtils.button(mxResources.get("export"),function(){var R=b.createLibraryDataFromImages(Q),T=q.value;/(\.xml)$/i.test(T)||(T+=".xml");b.isLocalFileSave()?b.saveLocalFile(R,T,"text/xml",null,null,null!=z?z:!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(T)+"&format=xml&xml="+encodeURIComponent(R))).simulate(document,"_blank")});l.setAttribute("id","btnDownload");l.className="geBtn";g.appendChild(l);if(Graph.fileSupport){if(null==b.libDlgFileInputElt){var N=document.createElement("input");-N.setAttribute("multiple","multiple");N.setAttribute("type","file");mxEvent.addListener(N,"change",function(R){J=!1;b.importFiles(N.files,0,0,b.maxImageSize,function(T,v,d,m,r,A,D,G,O){null!=N.files&&(S(R)(T,v,d,m,r,A,D,G,O),N.type="",N.type="file",N.value="")});t.scrollTop=t.scrollHeight});N.style.display="none";document.body.appendChild(N);b.libDlgFileInputElt=N}l=mxUtils.button(mxResources.get("import"),function(){null!=C&&(C(),C=null);b.libDlgFileInputElt.click()});l.setAttribute("id","btnAddImage");-l.className="geBtn";g.appendChild(l)}l=mxUtils.button(mxResources.get("addImages"),function(){null!=C&&(C(),C=null);b.showImageDialog(mxResources.get("addImageUrl"),"",function(R,T,v){J=!1;if(null!=R){if("data:image/"==R.substring(0,11)){var d=R.indexOf(",");0<d&&(R=R.substring(0,d)+";base64,"+R.substring(d+1))}K(R,null,0,0,T,v);t.scrollTop=t.scrollHeight}})});l.setAttribute("id","btnAddImageUrl");l.className="geBtn";g.appendChild(l);this.saveBtnClickHandler=function(R,T,v,d){b.saveLibrary(R,T,v,-d)};l=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=C&&(C(),C=null);this.saveBtnClickHandler(q.value,Q,x,B)}));l.setAttribute("id","btnSave");l.className="geBtn gePrimaryBtn";g.appendChild(l);b.editor.cancelFirst||g.appendChild(f);p.appendChild(g);this.container=p},EditShapeDialog=function(b,l,p){var g=document.createElement("div");g.style.position="absolute";g.style.left="30px";g.style.right="30px";g.style.top="30px";g.style.bottom="30px";var x=document.createElement("div");-x.style.position="absolute";x.style.top="0px";mxUtils.write(x,p);g.appendChild(x);p=document.createElement("div");p.style.position="absolute";p.style.width="100%";p.style.display="flex";p.style.alignItems="stretch";p.style.top="24px";p.style.bottom="50px";var B=document.createElement("textarea");B.style.outline="none";B.style.resize="horizontal";B.style.width="430px";B.style.maxWidth="calc(100% - 100px)";B.style.flexShrink="0";B.style.borderRadius="4px";B.style.marginRight="4px";p.appendChild(B);-var z=document.createElement("div");z.style.borderWidth="1px";z.style.borderStyle="solid";z.style.padding="20px";z.style.flexGrow="1";z.style.borderRadius="4px";mxEvent.disableContextMenu(z);p.appendChild(z);var F=new Graph(z);F.setEnabled(!1);var K=b.editor.graph.cloneCell(l);F.addCells([K]);x=F.view.getState(K);var M="";null!=x.shape&&null!=x.shape.stencil&&(M=mxUtils.getPrettyXml(x.shape.stencil.desc));mxUtils.write(B,M||"");g.appendChild(p);p=document.createElement("div");p.style.position="absolute";-p.style.display="flex";p.style.alignItems="center";p.style.justifyContent="end";p.style.bottom="6px";p.style.height="30px";p.style.width="100%";b.isOffline()||p.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-complex-create-edit"));x=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});x.className="geBtn";b.editor.cancelFirst&&p.appendChild(x);var L=function(c,f,k){var n=B.value,q=mxUtils.parseXml(n);n=mxUtils.getPrettyXml(q.documentElement);q=q.documentElement.getElementsByTagName("parsererror");-if(null!=q&&0<q.length)b.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(k&&b.hideDialog(),q=!c.model.contains(f),!k||q||n!=M){n=Graph.compress(n);c.getModel().beginUpdate();try{if(q){var t=b.editor.graph.getFreeInsertPoint();f.geometry.x=t.x;f.geometry.y=t.y;c.addCell(f)}c.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+n+")",[f])}catch(u){throw u;}finally{c.getModel().endUpdate()}q&&(c.setSelectionCell(f),c.scrollCellToVisible(f))}},-Q=mxUtils.button(mxResources.get("preview"),function(){L(F,K,!1);F.fit()});Q.className="geBtn";p.appendChild(Q);Q=mxUtils.button(mxResources.get("apply"),function(){L(b.editor.graph,l,!0)});Q.className="geBtn gePrimaryBtn";p.appendChild(Q);b.editor.cancelFirst||p.appendChild(x);g.appendChild(p);this.init=function(){B.focus();B.scrollTop=0;F.fit();z.style.overflow="auto";F.fit()};this.container=g},CustomDialog=function(b,l,p,g,x,B,z,F,K,M,L,Q){var c=document.createElement("div");c.style.display="flex";-c.style.flexDirection="column";c.style.minHeight="0";c.style.paddingBottom="10px";var f=document.createElement("div");f.style.flex="1 1 auto";f.style.minHeight="0";f.style.overflowY="auto";f.appendChild(l);c.appendChild(f);var k=document.createElement("div");k.style.flex="0 0 auto";k.style.marginTop=null!=Q?Q:"34px";k.style.textAlign="right";b.isOffline()||null==B||k.appendChild(b.createHelpIcon(B));null!=z&&k.appendChild(z);l=mxUtils.button(K||mxResources.get("cancel"),function(){b.hideDialog();-null!=g&&g()});l.className="geBtn";F&&(l.style.display="none");b.editor.cancelFirst&&k.appendChild(l);x=mxUtils.button(x||mxResources.get("ok"),mxUtils.bind(this,function(){M||b.hideDialog(null,null,this.container);if(null!=p){var n=p();if("string"===typeof n){b.showError(mxResources.get("error"),n);return}}M&&b.hideDialog(null,null,this.container)}));k.appendChild(x);x.className="geBtn gePrimaryBtn";b.editor.cancelFirst||k.appendChild(l);if(null!=L)for(F=0;F<L.length;F++)(function(n,q,t){n=mxUtils.button(n,-function(u){q(u)});null!=t&&n.setAttribute("title",t);n.className="geBtn";k.appendChild(n)})(L[F][0],L[F][1],L[F][2]);c.appendChild(k);this.cancelBtn=l;this.okButton=x;this.container=c},BtnDialog=function(b,l,p,g){var x=document.createElement("div");x.style.textAlign="center";var B=document.createElement("p");B.style.fontSize="16pt";B.style.padding="0px";B.style.margin="0px";B.style.color="gray";mxUtils.write(B,mxResources.get("done"));var z="Unknown",F=document.createElement("img");F.setAttribute("border",-"0");F.setAttribute("align","absmiddle");F.style.marginRight="10px";l==b.drive?(z=mxResources.get("googleDrive"),F.src=IMAGE_PATH+"/google-drive-logo-white.svg"):l==b.dropbox?(z=mxResources.get("dropbox"),F.src=IMAGE_PATH+"/dropbox-logo-white.svg"):l==b.oneDrive?(z=mxResources.get("oneDrive"),F.src=IMAGE_PATH+"/onedrive-logo-white.svg"):l==b.gitHub?(z=mxResources.get("github"),F.src=IMAGE_PATH+"/github-logo-white.svg"):l==b.gitLab?(z=mxResources.get("gitlab"),F.src=IMAGE_PATH+"/gitlab-logo.svg"):-l==b.trello&&(z=mxResources.get("trello"),F.src=IMAGE_PATH+"/trello-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizedIn",[z],"You are now authorized in {1}"));p=mxUtils.button(p,g);p.insertBefore(F,p.firstChild);p.style.marginTop="6px";p.className="geBigButton";p.style.fontSize="18px";p.style.padding="14px";x.appendChild(B);x.appendChild(b);x.appendChild(p);this.container=x},FontDialog=function(b,l,p,g,x){function B(E,I,C){var U=document.createElement("div");-U.className="geDialogFormRow";U.style.paddingLeft="24px";var J=document.createElement("span");J.className="geDialogFormLabel";mxUtils.write(J,I+":");U.appendChild(J);U.appendChild(C);E.appendChild(U);return U}function z(E){this.style.border="";13==E.keyCode&&y.click()}var F=document.createElement("div"),K=document.createElement("h3");mxUtils.write(K,mxResources.get("font"));F.appendChild(K);K=document.createElement("div");K.className="geDialogSection";var M=b.addCheckbox(K,mxResources.get("sysFonts",-null,"System Fonts"),!1,null,null,null,!0,"current-fontdialog",!0),L=document.createElement("input");L.setAttribute("type","text");"s"==g&&L.setAttribute("value",l);L.className="dlg_fontName_s";var Q=null;if(null!=Editor.localFonts){Q=document.createElement("datalist");Q.id="fontdialog-localfonts";for(var c=0;c<Editor.localFonts.length;c++){var f=document.createElement("option");f.value=Editor.localFonts[c];Q.appendChild(f)}L.setAttribute("list","fontdialog-localfonts")}c=B(K,mxResources.get("fontname",-null,"Font Name"),L);null!=Q&&c.appendChild(Q);F.appendChild(K);K=document.createElement("div");K.className="geDialogSection";var k=b.addCheckbox(K,mxResources.get("googleFonts",null,"Google Fonts"),!1,null,null,null,!0,"current-fontdialog",!0);b.isOffline()&&!EditorUi.isElectronApp||k.checkRow.appendChild(b.createHelpIcon("https://fonts.google.com/"));var n=document.createElement("input");n.setAttribute("type","text");"g"==g&&n.setAttribute("value",l);n.className="dlg_fontName_g";B(K,mxResources.get("fontname",-null,"Font Name"),n);"0"!=urlParams.isGoogleFontsEnabled&&F.appendChild(K);K=document.createElement("div");K.className="geDialogSection";var q=b.addCheckbox(K,mxResources.get("webfonts",null,"Web Fonts"),!1,null,null,null,!0,"current-fontdialog",!0),t=document.createElement("input");t.setAttribute("type","text");"w"==g&&(Editor.enableWebFonts?t.setAttribute("value",l):L.setAttribute("value",l));t.className="dlg_fontName_w";B(K,mxResources.get("fontname",null,"Font Name"),t);var u=document.createElement("input");-u.setAttribute("type","text");u.setAttribute("value",p||"");u.className="dlg_fontUrl";B(K,mxResources.get("fontUrl",null,"Font URL"),u);Editor.enableWebFonts&&F.appendChild(K);this.init=function(){var E=L;"g"==g?E=n:"w"==g&&Editor.enableWebFonts&&(E=t);E.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?E.select():document.execCommand("selectAll",!1,null)};F.style.paddingBottom="10px";l=document.createElement("div");l.style.marginTop="34px";l.style.textAlign="right";l.style.whiteSpace=-"nowrap";b.isOffline()||l.appendChild(b.createHelpIcon("https://www.drawio.com/blog/external-fonts"));p=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();x()});p.className="geBtn";var y=mxUtils.button(mxResources.get("apply"),function(){if(M.checked){var E=L.value;var I="s"}else if(k.checked){E=n.value;var C=Editor.GOOGLE_FONTS+encodeURIComponent(E).replace(/%20/g,"+");I="g"}else q.checked&&(E=t.value,C=u.value,I="w");var U=E;var J=C,S=I,N=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,-R=F.querySelector(".dlg_fontName_"+S);null==R||null!=U&&0!=U.length?(R=F.querySelector(".dlg_fontUrl"),null==R||"w"!=S||N.test(J)?U=!0:(R.style.border="1px solid red",U=!1)):(R.style.border="1px solid red",U=!1);U&&(x(E,C,I),b.hideDialog())});y.className="geBtn gePrimaryBtn";mxEvent.addListener(L,"keypress",z);mxEvent.addListener(n,"keypress",z);mxEvent.addListener(t,"keypress",z);mxEvent.addListener(u,"keypress",z);mxEvent.addListener(L,"focus",function(){M.setAttribute("checked","checked");M.checked=-!0});mxEvent.addListener(n,"focus",function(){k.setAttribute("checked","checked");k.checked=!0});mxEvent.addListener(t,"focus",function(){q.setAttribute("checked","checked");q.checked=!0});mxEvent.addListener(u,"focus",function(){q.setAttribute("checked","checked");q.checked=!0});b.editor.cancelFirst?(l.appendChild(p),l.appendChild(y)):(l.appendChild(y),l.appendChild(p));F.appendChild(l);this.container=F};-function AspectDialog(b,l,p,g,x){this.aspect={pageId:l||(b.pages?b.pages[0].getId():null),layerIds:p||[]};l=document.createElement("div");var B=document.createElement("h5");B.style.margin="0 0 10px";mxUtils.write(B,mxResources.get("pages"));l.appendChild(B);p=document.createElement("div");p.className="geAspectDlgList";l.appendChild(p);B=document.createElement("h5");B.style.margin="0 0 10px";mxUtils.write(B,mxResources.get("layers"));l.appendChild(B);B=document.createElement("div");B.className="geAspectDlgList";-l.appendChild(B);this.pagesContainer=p;this.layersContainer=B;this.ui=b;p=document.createElement("div");p.style.marginTop="16px";p.style.textAlign="center";B=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=x&&x()});B.className="geBtn";b.editor.cancelFirst&&p.appendChild(B);var z=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){b.hideDialog();g({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));p.appendChild(z);z.className="geBtn gePrimaryBtn";-b.editor.cancelFirst||p.appendChild(B);z.setAttribute("disabled","disabled");this.okBtn=z;l.appendChild(p);this.container=l}AspectDialog.prototype.init=function(){var b=this.ui.getFileData(!0);if(this.ui.pages)for(b=0;b<this.ui.pages.length;b++){var l=this.ui.updatePageRoot(this.ui.pages[b]);this.createPageItem(l.getId(),l.getName(),l.node)}else this.createPageItem("1",mxResources.get("pageWithNumber",[1]),mxUtils.parseXml(b).documentElement)};-AspectDialog.prototype.createViewer=function(b,l,p,g){mxEvent.disableContextMenu(b);b.style.userSelect="none";var x=new Graph(b);x.setTooltips(!1);x.setEnabled(!1);x.setPanning(!1);x.minFitScale=null;x.maxFitScale=null;x.centerZoom=!0;l="mxGraphModel"==l.nodeName?l:Editor.parseDiagramNode(l);if(null!=l){var B=l.getAttribute("background");if(null==B||""==B||B==mxConstants.NONE)B=null!=g?g:"#ffffff";b.style.backgroundColor=B;g=new mxCodec(l.ownerDocument);b=x.getModel();g.decode(l,b);l=b.getChildCount(b.root);-g=null==p;for(B=0;B<l;B++){var z=b.getChildAt(b.root,B);b.setVisible(z,g||p==z.id)}x.maxFitScale=1;x.fit(0);x.center()}return x};+l=mxUtils.button(mxResources.get("export"),function(){var R=b.createLibraryDataFromImages(Q),T=q.value;/(\.xml)$/i.test(T)||(T+=".xml");b.isLocalFileSave()?b.saveLocalFile(R,T,"text/xml",null,null,null!=y?y:!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(T)+"&format=xml&xml="+encodeURIComponent(R))).simulate(document,"_blank")});l.setAttribute("id","btnDownload");l.className="geBtn";g.appendChild(l);if(Graph.fileSupport){if(null==b.libDlgFileInputElt){var M=document.createElement("input");+M.setAttribute("multiple","multiple");M.setAttribute("type","file");mxEvent.addListener(M,"change",function(R){K=!1;b.importFiles(M.files,0,0,b.maxImageSize,function(T,v,d,m,r,z,D,F,N){null!=M.files&&(S(R)(T,v,d,m,r,z,D,F,N),M.type="",M.type="file",M.value="")});t.scrollTop=t.scrollHeight});M.style.display="none";document.body.appendChild(M);b.libDlgFileInputElt=M}l=mxUtils.button(mxResources.get("import"),function(){null!=C&&(C(),C=null);b.libDlgFileInputElt.click()});l.setAttribute("id","btnAddImage");+l.className="geBtn";g.appendChild(l)}l=mxUtils.button(mxResources.get("addImages"),function(){null!=C&&(C(),C=null);b.showImageDialog(mxResources.get("addImageUrl"),"",function(R,T,v){K=!1;if(null!=R){if("data:image/"==R.substring(0,11)){var d=R.indexOf(",");0<d&&(R=R.substring(0,d)+";base64,"+R.substring(d+1))}L(R,null,0,0,T,v);t.scrollTop=t.scrollHeight}})});l.setAttribute("id","btnAddImageUrl");l.className="geBtn";g.appendChild(l);this.saveBtnClickHandler=function(R,T,v,d){b.saveLibrary(R,T,v,+d)};l=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=C&&(C(),C=null);this.saveBtnClickHandler(q.value,Q,x,A)}));l.setAttribute("id","btnSave");l.className="geBtn gePrimaryBtn";g.appendChild(l);b.editor.cancelFirst||g.appendChild(f);p.appendChild(g);this.container=p},EditShapeDialog=function(b,l,p){var g=document.createElement("div");g.style.position="absolute";g.style.left="30px";g.style.right="30px";g.style.top="30px";g.style.bottom="30px";var x=document.createElement("div");+x.style.position="absolute";x.style.top="0px";mxUtils.write(x,p);g.appendChild(x);p=document.createElement("div");p.style.position="absolute";p.style.width="100%";p.style.display="flex";p.style.alignItems="stretch";p.style.top="24px";p.style.bottom="50px";var A=document.createElement("textarea");A.style.outline="none";A.style.resize="horizontal";A.style.width="430px";A.style.maxWidth="calc(100% - 100px)";A.style.flexShrink="0";A.style.borderRadius="4px";A.style.marginRight="4px";p.appendChild(A);+var y=document.createElement("div");y.style.borderWidth="1px";y.style.borderStyle="solid";y.style.padding="20px";y.style.flexGrow="1";y.style.borderRadius="4px";mxEvent.disableContextMenu(y);p.appendChild(y);var G=new Graph(y);G.setEnabled(!1);var L=b.editor.graph.cloneCell(l);G.addCells([L]);x=G.view.getState(L);var O="";null!=x.shape&&null!=x.shape.stencil&&(O=mxUtils.getPrettyXml(x.shape.stencil.desc));mxUtils.write(A,O||"");g.appendChild(p);p=document.createElement("div");p.style.position="absolute";+p.style.display="flex";p.style.alignItems="center";p.style.justifyContent="end";p.style.bottom="6px";p.style.height="30px";p.style.width="100%";b.isOffline()||p.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-complex-create-edit"));x=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});x.className="geBtn";b.editor.cancelFirst&&p.appendChild(x);var J=function(c,f,k){var n=A.value,q=mxUtils.parseXml(n);n=mxUtils.getPrettyXml(q.documentElement);q=q.documentElement.getElementsByTagName("parsererror");+if(null!=q&&0<q.length)b.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(k&&b.hideDialog(),q=!c.model.contains(f),!k||q||n!=O){n=Graph.compress(n);c.getModel().beginUpdate();try{if(q){var t=b.editor.graph.getFreeInsertPoint();f.geometry.x=t.x;f.geometry.y=t.y;c.addCell(f)}c.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+n+")",[f])}catch(u){throw u;}finally{c.getModel().endUpdate()}q&&(c.setSelectionCell(f),c.scrollCellToVisible(f))}},+Q=mxUtils.button(mxResources.get("preview"),function(){J(G,L,!1);G.fit()});Q.className="geBtn";p.appendChild(Q);Q=mxUtils.button(mxResources.get("apply"),function(){J(b.editor.graph,l,!0)});Q.className="geBtn gePrimaryBtn";p.appendChild(Q);b.editor.cancelFirst||p.appendChild(x);g.appendChild(p);this.init=function(){A.focus();A.scrollTop=0;G.fit();y.style.overflow="auto";G.fit()};this.container=g},CustomDialog=function(b,l,p,g,x,A,y,G,L,O,J,Q){var c=document.createElement("div");c.style.display="flex";+c.style.flexDirection="column";c.style.minHeight="0";c.style.paddingBottom="10px";var f=document.createElement("div");f.style.flex="1 1 auto";f.style.minHeight="0";f.style.overflowY="auto";f.appendChild(l);c.appendChild(f);var k=document.createElement("div");k.style.flex="0 0 auto";k.style.marginTop=null!=Q?Q:"34px";k.style.textAlign="right";b.isOffline()||null==A||k.appendChild(b.createHelpIcon(A));null!=y&&k.appendChild(y);l=mxUtils.button(L||mxResources.get("cancel"),function(){b.hideDialog();+null!=g&&g()});l.className="geBtn";G&&(l.style.display="none");b.editor.cancelFirst&&k.appendChild(l);x=mxUtils.button(x||mxResources.get("ok"),mxUtils.bind(this,function(){O||b.hideDialog(null,null,this.container);if(null!=p){var n=p();if("string"===typeof n){b.showError(mxResources.get("error"),n);return}}O&&b.hideDialog(null,null,this.container)}));k.appendChild(x);x.className="geBtn gePrimaryBtn";b.editor.cancelFirst||k.appendChild(l);if(null!=J)for(G=0;G<J.length;G++)(function(n,q,t){n=mxUtils.button(n,+function(u){q(u)});null!=t&&n.setAttribute("title",t);n.className="geBtn";k.appendChild(n)})(J[G][0],J[G][1],J[G][2]);c.appendChild(k);this.cancelBtn=l;this.okButton=x;this.container=c},BtnDialog=function(b,l,p,g){var x=document.createElement("div");x.style.textAlign="center";var A=document.createElement("p");A.style.fontSize="16pt";A.style.padding="0px";A.style.margin="0px";A.style.color="gray";mxUtils.write(A,mxResources.get("done"));var y="Unknown",G=document.createElement("img");G.setAttribute("border",+"0");G.setAttribute("align","absmiddle");G.style.marginRight="10px";l==b.drive?(y=mxResources.get("googleDrive"),G.src=IMAGE_PATH+"/google-drive-logo-white.svg"):l==b.dropbox?(y=mxResources.get("dropbox"),G.src=IMAGE_PATH+"/dropbox-logo-white.svg"):l==b.oneDrive?(y=mxResources.get("oneDrive"),G.src=IMAGE_PATH+"/onedrive-logo-white.svg"):l==b.gitHub?(y=mxResources.get("github"),G.src=IMAGE_PATH+"/github-logo-white.svg"):l==b.gitLab?(y=mxResources.get("gitlab"),G.src=IMAGE_PATH+"/gitlab-logo.svg"):+l==b.trello&&(y=mxResources.get("trello"),G.src=IMAGE_PATH+"/trello-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizedIn",[y],"You are now authorized in {1}"));p=mxUtils.button(p,g);p.insertBefore(G,p.firstChild);p.style.marginTop="6px";p.className="geBigButton";p.style.fontSize="18px";p.style.padding="14px";x.appendChild(A);x.appendChild(b);x.appendChild(p);this.container=x},FontDialog=function(b,l,p,g,x){function A(E,I,C){var U=document.createElement("div");+U.className="geDialogFormRow";U.style.paddingLeft="24px";var K=document.createElement("span");K.className="geDialogFormLabel";mxUtils.write(K,I+":");U.appendChild(K);U.appendChild(C);E.appendChild(U);return U}function y(E){this.style.border="";13==E.keyCode&&B.click()}var G=document.createElement("div"),L=document.createElement("h3");mxUtils.write(L,mxResources.get("font"));G.appendChild(L);L=document.createElement("div");L.className="geDialogSection";var O=b.addCheckbox(L,mxResources.get("sysFonts",+null,"System Fonts"),!1,null,null,null,!0,"current-fontdialog",!0),J=document.createElement("input");J.setAttribute("type","text");"s"==g&&J.setAttribute("value",l);J.className="dlg_fontName_s";var Q=null;if(null!=Editor.localFonts){Q=document.createElement("datalist");Q.id="fontdialog-localfonts";for(var c=0;c<Editor.localFonts.length;c++){var f=document.createElement("option");f.value=Editor.localFonts[c];Q.appendChild(f)}J.setAttribute("list","fontdialog-localfonts")}c=A(L,mxResources.get("fontname",+null,"Font Name"),J);null!=Q&&c.appendChild(Q);G.appendChild(L);L=document.createElement("div");L.className="geDialogSection";var k=b.addCheckbox(L,mxResources.get("googleFonts",null,"Google Fonts"),!1,null,null,null,!0,"current-fontdialog",!0);b.isOffline()&&!EditorUi.isElectronApp||k.checkRow.appendChild(b.createHelpIcon("https://fonts.google.com/"));var n=document.createElement("input");n.setAttribute("type","text");"g"==g&&n.setAttribute("value",l);n.className="dlg_fontName_g";A(L,mxResources.get("fontname",+null,"Font Name"),n);"0"!=urlParams.isGoogleFontsEnabled&&G.appendChild(L);L=document.createElement("div");L.className="geDialogSection";var q=b.addCheckbox(L,mxResources.get("webfonts",null,"Web Fonts"),!1,null,null,null,!0,"current-fontdialog",!0),t=document.createElement("input");t.setAttribute("type","text");"w"==g&&(Editor.enableWebFonts?t.setAttribute("value",l):J.setAttribute("value",l));t.className="dlg_fontName_w";A(L,mxResources.get("fontname",null,"Font Name"),t);var u=document.createElement("input");+u.setAttribute("type","text");u.setAttribute("value",p||"");u.className="dlg_fontUrl";A(L,mxResources.get("fontUrl",null,"Font URL"),u);Editor.enableWebFonts&&G.appendChild(L);this.init=function(){var E=J;"g"==g?E=n:"w"==g&&Editor.enableWebFonts&&(E=t);E.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?E.select():document.execCommand("selectAll",!1,null)};G.style.paddingBottom="10px";l=document.createElement("div");l.style.marginTop="34px";l.style.textAlign="right";l.style.whiteSpace=+"nowrap";b.isOffline()||l.appendChild(b.createHelpIcon("https://www.drawio.com/blog/external-fonts"));p=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();x()});p.className="geBtn";var B=mxUtils.button(mxResources.get("apply"),function(){if(O.checked){var E=J.value;var I="s"}else if(k.checked){E=n.value;var C=Editor.GOOGLE_FONTS+encodeURIComponent(E).replace(/%20/g,"+");I="g"}else q.checked&&(E=t.value,C=u.value,I="w");var U=E;var K=C,S=I,M=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,+R=G.querySelector(".dlg_fontName_"+S);null==R||null!=U&&0!=U.length?(R=G.querySelector(".dlg_fontUrl"),null==R||"w"!=S||M.test(K)?U=!0:(R.style.border="1px solid red",U=!1)):(R.style.border="1px solid red",U=!1);U&&(x(E,C,I),b.hideDialog())});B.className="geBtn gePrimaryBtn";mxEvent.addListener(J,"keypress",y);mxEvent.addListener(n,"keypress",y);mxEvent.addListener(t,"keypress",y);mxEvent.addListener(u,"keypress",y);mxEvent.addListener(J,"focus",function(){O.setAttribute("checked","checked");O.checked=+!0});mxEvent.addListener(n,"focus",function(){k.setAttribute("checked","checked");k.checked=!0});mxEvent.addListener(t,"focus",function(){q.setAttribute("checked","checked");q.checked=!0});mxEvent.addListener(u,"focus",function(){q.setAttribute("checked","checked");q.checked=!0});b.editor.cancelFirst?(l.appendChild(p),l.appendChild(B)):(l.appendChild(B),l.appendChild(p));G.appendChild(l);this.container=G};+function AspectDialog(b,l,p,g,x){this.aspect={pageId:l||(b.pages?b.pages[0].getId():null),layerIds:p||[]};l=document.createElement("div");var A=document.createElement("h5");A.style.margin="0 0 10px";mxUtils.write(A,mxResources.get("pages"));l.appendChild(A);p=document.createElement("div");p.className="geAspectDlgList";l.appendChild(p);A=document.createElement("h5");A.style.margin="0 0 10px";mxUtils.write(A,mxResources.get("layers"));l.appendChild(A);A=document.createElement("div");A.className="geAspectDlgList";+l.appendChild(A);this.pagesContainer=p;this.layersContainer=A;this.ui=b;p=document.createElement("div");p.style.marginTop="16px";p.style.textAlign="center";A=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=x&&x()});A.className="geBtn";b.editor.cancelFirst&&p.appendChild(A);var y=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){b.hideDialog();g({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));p.appendChild(y);y.className="geBtn gePrimaryBtn";+b.editor.cancelFirst||p.appendChild(A);y.setAttribute("disabled","disabled");this.okBtn=y;l.appendChild(p);this.container=l}AspectDialog.prototype.init=function(){var b=this.ui.getFileData(!0);if(this.ui.pages)for(b=0;b<this.ui.pages.length;b++){var l=this.ui.updatePageRoot(this.ui.pages[b]);this.createPageItem(l.getId(),l.getName(),l.node)}else this.createPageItem("1",mxResources.get("pageWithNumber",[1]),mxUtils.parseXml(b).documentElement)};+AspectDialog.prototype.createViewer=function(b,l,p,g){mxEvent.disableContextMenu(b);b.style.userSelect="none";var x=new Graph(b);x.setTooltips(!1);x.setEnabled(!1);x.setPanning(!1);x.minFitScale=null;x.maxFitScale=null;x.centerZoom=!0;l="mxGraphModel"==l.nodeName?l:Editor.parseDiagramNode(l);if(null!=l){var A=l.getAttribute("background");if(null==A||""==A||A==mxConstants.NONE)A=null!=g?g:"#ffffff";b.style.backgroundColor=A;g=new mxCodec(l.ownerDocument);b=x.getModel();g.decode(l,b);l=b.getChildCount(b.root);+g=null==p;for(A=0;A<l;A++){var y=b.getChildAt(b.root,A);b.setVisible(y,g||p==y.id)}x.maxFitScale=1;x.fit(0);x.center()}return x};AspectDialog.prototype.createPageItem=function(b,l,p){var g=document.createElement("div");g.className="geAspectDlgListItem";g.setAttribute("data-page-id",b);g.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+mxUtils.htmlEntities(l)+"</div>";this.pagesContainer.appendChild(g);var x=this.createViewer(g.childNodes[0],p);l=mxUtils.bind(this,function(){null!=this.selectedItem&&(this.selectedItem.className="geAspectDlgListItem");this.selectedItem=g;-this.selectedPage=b;g.className+=" geAspectDlgListItemSelected";this.layersContainer.innerText="";this.selectedLayers={};this.okBtn.setAttribute("disabled","disabled");var B=x.model;B=B.getChildCells(B.getRoot());for(var z=0;z<B.length;z++)this.createLayerItem(B[z],b,x,p)});mxEvent.addListener(g,"click",l);this.aspect.pageId==b&&l()};+this.selectedPage=b;g.className+=" geAspectDlgListItemSelected";this.layersContainer.innerText="";this.selectedLayers={};this.okBtn.setAttribute("disabled","disabled");var A=x.model;A=A.getChildCells(A.getRoot());for(var y=0;y<A.length;y++)this.createLayerItem(A[y],b,x,p)});mxEvent.addListener(g,"click",l);this.aspect.pageId==b&&l()};AspectDialog.prototype.createLayerItem=function(b,l,p,g){l=p.convertValueToString(b)||mxResources.get("background")||"Background";var x=document.createElement("div");x.setAttribute("data-layer-id",b.id);x.className="geAspectDlgListItem";x.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+mxUtils.htmlEntities(l)+"</div>";this.layersContainer.appendChild(x);this.createViewer(x.childNodes[0],g,b.id);g=mxUtils.bind(this,function(){0<=x.className.indexOf("geAspectDlgListItemSelected")?(x.className="geAspectDlgListItem",delete this.selectedLayers[b.id],mxUtils.isEmptyObject(this.selectedLayers)&&this.okBtn.setAttribute("disabled","disabled")):(x.className+=" geAspectDlgListItemSelected",this.selectedLayers[b.id]=!0,this.okBtn.removeAttribute("disabled"))});mxEvent.addListener(x,"click",g);-1!=this.aspect.layerIds.indexOf(b.id)&&g()};-var FilePropertiesDialog=function(b,l){function p(y){var E=L;L=function(I,C){try{y(function(){E(I,C)},C)}catch(U){C(U)}}}function g(y,E,I){var C=document.createElement("div");C.className="geDialogFormRow";var U=document.createElement("span");U.className="geDialogFormLabel";mxUtils.write(U,E+":");C.appendChild(U);C.appendChild(I);y.appendChild(C);return C}var x=document.createElement("div"),B=document.createElement("h3");mxUtils.write(B,mxResources.get("properties"));x.appendChild(B);var z=b.getCurrentFile(),-F=null!=z&&null!=z.getTitle()?z.getTitle():b.defaultFilename,K=/(\.png)$/i.test(F),M=/(\.svg)$/i.test(F),L=function(y,E){y()},Q=null!=z?z.isLocked():!1;B=document.createElement("div");B.className="geDialogSection";var c=b.addCheckbox(B,mxResources.get("locked"),Q,null,null,null,null,null,!0);this.init=function(){c.focus()};p(function(y,E){null!=b.fileNode&&Q!=c.checked?window.setTimeout(function(){null!=z&&z.setLocked(c.checked);y()},0):y()});if(K||M){F=1;K=0;M=b.fileNode;null!=M&&(M.hasAttribute("scale")&&-(F=parseFloat(M.getAttribute("scale"))),M.hasAttribute("border")&&(K=parseInt(M.getAttribute("border"))));var f=document.createElement("input");f.setAttribute("type","text");f.setAttribute("value",100*F+"%");g(B,mxResources.get("zoom"),f);var k=document.createElement("input");k.setAttribute("type","text");k.setAttribute("value",K);g(B,mxResources.get("borderWidth"),k);this.init=this.init||function(){f.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?f.select():document.execCommand("selectAll",-!1,null)};p(function(y,E){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(f.value)/100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(k.value))),null!=z&&z.fileChanged());y()})}else if(!/(\.html)$/i.test(F)&&!/(\.svg)$/i.test(F)){var n=null!=z?z.isCompressed():Editor.defaultCompressed,q=b.addCheckbox(B,mxResources.get("compressed"),n,null,null,null,null,null,!0);this.init=this.init||function(){q.focus()};p(function(y,E){null!=b.fileNode&&n!=q.checked?window.setTimeout(function(){b.fileNode.setAttribute("compressed",-q.checked?"true":"false");null!=z&&(z.compressionChanged(q.checked),z.fileChanged());y()},0):y()})}if(null!=z&&z.isRealtimeOptional()){var t="disabled"!=b.drive.getCustomProperty(z.desc,"collaboration"),u=b.addCheckbox(B,mxResources.get("realtimeCollaboration"),t,null,null,null,null,null,!0);u.checkRow.appendChild(b.menus.createHelpLink("https://www.drawio.com/docs/manual/collaboration/concurrent-editing/#disable-real-time-collaboration"));p(function(y,E){u.checked!=t?z.setRealtimeEnabled(u.checked,-y,E):y()});this.init=null!=this.init?this.init:function(){u.focus()}}x.appendChild(B);B=document.createElement("div");B.className="geDialogSection";F=!1;null!=z&&"draw.io"==b.getServiceName()&&0<z.getSize()&&"1"!=urlParams.embed&&(F=b.formatFileSize(z.getSize()),K=document.createElement("input"),K.setAttribute("type","text"),K.setAttribute("title",F),K.setAttribute("value",F),K.setAttribute("disabled","disabled"),g(B,mxResources.get("size"),K),F=!0);null!=z&&null!=z.fileObject&&null!=z.fileObject.path&&-(F=document.createElement("input"),F.setAttribute("type","text"),F.setAttribute("title",z.fileObject.path),F.setAttribute("value",z.fileObject.path),F.setAttribute("disabled","disabled"),g(B,mxResources.get("pathFilename"),F),F=!0);null!=l&&(F=document.createElement("a"),F.setAttribute("href",l),F.setAttribute("title",l),F.style.flex="1",F.style.minWidth="0",F.style.whiteSpace="nowrap",F.style.overflow="hidden",F.style.textOverflow="ellipsis",mxUtils.write(F,l),mxEvent.addListener(F,"click",function(y){b.openLink(l);-mxEvent.consume(y)}),g(B,mxResources.get("publicDiagramUrl"),F),F=!0);F&&x.appendChild(B);this.init=null!=this.init?this.init:function(){};x.style.paddingBottom="10px";B=document.createElement("div");B.style.marginTop="34px";B.style.textAlign="right";B.style.whiteSpace="nowrap";F=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});F.className="geBtn";K=mxUtils.button(mxResources.get("apply"),function(){b.spinner.spin(document.body,mxResources.get("updatingDocument"))&&L(function(){b.spinner.stop();-b.hideDialog()},function(y){b.spinner.stop();b.handleError(y,mxResources.get("error"))})});K.className="geBtn gePrimaryBtn";M=null;null!=b.fileNode&&(M=mxUtils.button(mxResources.get("editData")+"...",function(){b.hideDialog();var y={};try{var E=b.fileNode.getAttribute("vars");null!=E&&0<E.length&&(y=JSON.parse(E))}catch(U){}E=mxUtils.createXmlDocument().createElement("object");E.setAttribute("label","");for(var I in y)E.setAttribute(I,y[I]);y=b.createTemporaryGraph(b.editor.graph.getStylesheet());-var C=new mxCell(E);y.getModel().add(y.getDefaultParent(),C);y.getModel().addListener(mxEvent.CHANGE,function(U,J){U=J.getProperty("edit").changes;for(J=0;J<U.length;J++)if(U[J]instanceof mxValueChange&&U[J].cell===C){for(var S={},N=U[J].value.attributes,R=0;R<N.length;R++)"label"!=N[R].nodeName&&(S[N[R].nodeName]=N[R].nodeValue);S=JSON.stringify(S);"{}"==S?b.fileNode.removeAttribute("vars"):b.fileNode.setAttribute("vars",S);b.updateFileVars();b.editor.graph.refresh();S=b.getCurrentFile();null!=S&&-S.fileChanged()}});y=new EditDataDialog(b,C,y);b.showDialog(y.container,480,420,!0,!1,null,!1,null,new mxRectangle(0,0,440,220));y.init()}),M.className="geBtn");b.editor.cancelFirst?(B.appendChild(F),null!=M&&B.appendChild(M),B.appendChild(K)):(null!=M&&B.appendChild(M),B.appendChild(K),B.appendChild(F));x.appendChild(B);this.container=x},ConnectionPointsDialog=function(b,l){function p(){null!=x&&x.destroy()}var g=document.createElement("div");g.style.userSelect="none";g.style.display="flex";g.style.flexDirection=-"column";g.style.height="100%";var x=null;this.init=function(){function B(T,v,d){var m="shape=image;points=[];rotatable=0;resizable=0;connectable=0;editable=0;image="+b.convertDataUri(mxConstraintHandler.prototype.pointImage.src)+";";T=new mxCell("",new mxGeometry(T,v,6,6),m);T.vertex=!0;T.cp=!0;T.constObj=d;return Q.addCell(T)}function z(T){T=Q.getSelectionCells();Q.deleteCells(T)}function F(){var T=parseFloat(J.value)||0;T=0>T?0:100<T?100:T;J.value=T;var v=parseFloat(N.value)||0;v=0>v?0:100<v?100:-v;N.value=v;var d=parseInt(S.value)||0,m=parseInt(R.value)||0;d=new mxConnectionConstraint(new mxPoint(parseFloat((T/100).toFixed(6)),parseFloat((v/100).toFixed(6))),!1,null,d,m);T=Q.getConnectionPoint(k,d);v=Q.getSelectionCell();if(null!=v){v.constObj=d;d=v.geometry.clone();m=Q.view.scale;var r=Q.view.translate;d.x=(T.x-3*m)/m-r.x;d.y=(T.y-3*m)/m-r.y;Q.model.setGeometry(v,d)}}function K(T){if(T.constObj)return{x:T.constObj.point.x,y:T.constObj.point.y,dx:T.constObj.dx,dy:T.constObj.dy};var v=0,d=-0,m=c.geometry,r=parseFloat(((T.geometry.x+3-m.x)/m.width).toFixed(6));T=parseFloat(((T.geometry.y+3-m.y)/m.height).toFixed(6));0>r?(v=r*m.width,r=0):1<r&&(v=(r-1)*m.width,r=1);0>T?(d=T*m.height,T=0):1<T&&(d=(T-1)*m.height,T=1);return{x:r,y:T,dx:parseInt(v),dy:parseInt(d)}}function M(T){if(1==Q.getSelectionCount()){var v=Q.getSelectionCell();T&&(v.constObj=null);T=K(v);J.value=parseFloat((100*T.x).toFixed(4));N.value=parseFloat((100*T.y).toFixed(4));S.value=T.dx;R.value=T.dy;U.style.visibility=""}else U.style.visibility=-"hidden"}var L=document.createElement("div");L.style.flex="1";L.style.minHeight="0";L.style.overflow="hidden";L.style.borderStyle="solid";L.style.borderWidth="1px";L.style.boxSizing="border-box";mxEvent.disableContextMenu(L);g.appendChild(L);var Q=new Graph(L);Q.transparentBackground=!1;Q.autoExtend=!1;Q.autoScroll=!1;Q.setGridEnabled(!1);Q.setEnabled(!0);Q.setPanning(!0);Q.setConnectable(!1);Q.setTooltips(!1);Q.minFitScale=null;Q.maxFitScale=null;Q.centerZoom=!0;Q.maxFitScale=2;L=l.geometry;var c=-new mxCell(l.value,new mxGeometry(0,0,L.width,L.height),l.style+";rotatable=0;resizable=0;connectable=0;editable=0;movable=0;opacity=50;");c.vertex=!0;Q.addCell(c);Q.dblClick=function(T,v){if(null!=v&&v!=c)Q.setSelectionCell(v);else{v=mxUtils.convertPoint(Q.container,mxEvent.getClientX(T),mxEvent.getClientY(T));mxEvent.consume(T);T=Q.view.scale;var d=Q.view.translate;Q.setSelectionCell(B((v.x-3*T)/T-d.x,(v.y-3*T)/T-d.y))}};x=new mxKeyHandler(Q);x.bindKey(46,z);x.bindKey(8,z);Q.getRubberband().isForceRubberbandEvent=-function(T){return 0==T.evt.button&&(null==T.getCell()||T.getCell()==c)};Q.panningHandler.isForcePanningEvent=function(T){return 2==T.evt.button};var f=Q.isCellSelectable;Q.isCellSelectable=function(T){return T==c?!1:f.apply(this,arguments)};Q.getLinkForCell=function(){return null};var k=Q.view.getState(c);L=Q.getAllConnectionConstraints(k);for(var n=0;null!=L&&n<L.length;n++){var q=Q.getConnectionPoint(k,L[n]);B(q.x-3,q.y-3,L[n])}n=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),-function(){Q.zoomIn()});q=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){Q.zoomOut()});var t=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==Q.view.scale?(Q.maxFitScale=8,Q.fit(8)):Q.zoomActual();Q.center()}),u=function(){b.prompt(mxResources.get("gridSize"),Q.gridSize,function(T){!isNaN(T)&&0<T&&(Q.setGridSize(T),Q.setGridEnabled(!0),Q.refresh())})},y=b.createToolbarButton(Editor.thinGridImage,mxResources.get("grid"),function(T){mxEvent.isShiftDown(T)?-u():(Q.setGridEnabled(!Q.isGridEnabled()),Q.refresh())});mxEvent.addListener(y,"dblclick",u);var E=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),z);mxUtils.setOpacity(E,10);L=document.createElement("div");L.style.display="flex";L.style.flexShrink="0";L.style.alignItems="center";L.style.paddingTop="6px";L.appendChild(n);L.appendChild(q);L.appendChild(t);L.appendChild(y);L.appendChild(E);g.appendChild(L);var I=document.createElement("input");I.setAttribute("type","number");I.setAttribute("min",-"1");I.setAttribute("value","1");I.style.width="45px";I.style.position="relative";I.style.margin="0 4px 0 4px";var C=document.createElement("select");C.style.position="relative";q=["left","right","top","bottom"];for(n=0;n<q.length;n++)t=q[n],y=document.createElement("option"),mxUtils.write(y,mxResources.get(t)),y.value=t,C.appendChild(y);n=mxUtils.button(mxResources.get("add"),function(){var T=parseInt(I.value);T=1>T?1:100<T?100:T;I.value=T;for(var v=C.value,d=c.geometry,m=[],r=0;r<T;r++){switch(v){case "left":var A=-d.x;var D=d.y+(r+1)*d.height/(T+1);break;case "right":A=d.x+d.width;D=d.y+(r+1)*d.height/(T+1);break;case "top":A=d.x+(r+1)*d.width/(T+1);D=d.y;break;case "bottom":A=d.x+(r+1)*d.width/(T+1),D=d.y+d.height}m.push(B(A-3,D-3))}Q.setSelectionCells(m)});n.style.marginLeft="auto";L.appendChild(n);L.appendChild(I);L.appendChild(C);var U=document.createElement("div");U.style.flexShrink="0";U.style.margin="4px 0px 8px 0px";U.style.whiteSpace="nowrap";U.style.height="24px";L=document.createElement("span");-mxUtils.write(L,mxResources.get("dx"));U.appendChild(L);var J=document.createElement("input");J.setAttribute("type","number");J.setAttribute("min","0");J.setAttribute("max","100");J.setAttribute("step","any");J.style.width="45px";J.style.margin="0 4px 0 4px";U.appendChild(J);mxUtils.write(U,"%");var S=document.createElement("input");S.setAttribute("type","number");S.style.width="45px";S.style.margin="0 4px 0 4px";U.appendChild(S);mxUtils.write(U,"pt");L=document.createElement("span");mxUtils.write(L,-mxResources.get("dy"));L.style.marginLeft="12px";U.appendChild(L);var N=document.createElement("input");N.setAttribute("type","number");N.setAttribute("min","0");N.setAttribute("max","100");N.setAttribute("step","any");N.style.width="45px";N.style.margin="0 4px 0 4px";U.appendChild(N);mxUtils.write(U,"%");var R=document.createElement("input");R.setAttribute("type","number");R.style.width="45px";R.style.margin="0 4px 0 4px";U.appendChild(R);mxUtils.write(U,"pt");g.appendChild(U);M();Q.getSelectionModel().addListener(mxEvent.CHANGE,-function(){0<Q.getSelectionCount()?mxUtils.setOpacity(E,60):mxUtils.setOpacity(E,10);M()});Q.addListener(mxEvent.CELLS_MOVED,M);mxEvent.addListener(J,"change",F);mxEvent.addListener(N,"change",F);mxEvent.addListener(S,"change",F);mxEvent.addListener(R,"change",F);L=mxUtils.button(mxResources.get("cancel"),function(){p();b.hideDialog()});L.className="geBtn";n=mxUtils.button(mxResources.get("apply"),function(){var T=Q.model.cells,v=[],d=[],m;for(m in T){var r=T[m];r.cp&&d.push(K(r))}d.sort(function(A,-D){return A.x!=D.x?A.x-D.x:A.y!=D.y?A.y-D.y:A.dx!=D.dx?A.dx-D.dx:A.dy-D.dy});for(T=0;T<d.length;T++)0<T&&d[T].x==d[T-1].x&&d[T].y==d[T-1].y&&d[T].dx==d[T-1].dx&&d[T].dy==d[T-1].dy||v.push("["+d[T].x+","+d[T].y+",0,"+d[T].dx+","+d[T].dy+"]");b.editor.graph.setCellStyles("points","["+v.join(",")+"]",[l]);p();b.hideDialog()});n.className="geBtn gePrimaryBtn";q=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[l]);p();b.hideDialog()});q.className="geBtn";t=-document.createElement("div");t.style.flexShrink="0";t.style.marginTop="10px";t.style.textAlign="right";b.isOffline()||t.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-connection-points-customise"));b.editor.cancelFirst&&t.appendChild(L);t.appendChild(q);t.appendChild(n);b.editor.cancelFirst||t.appendChild(L);g.appendChild(t);Q.fit(8);Q.center()};this.destroy=p;this.container=g},PolygonDialog=function(b,l,p){function g(ia){var ka=X.getBoundingClientRect();if(0<ka.width&&0<ka.height){var da=-J+N/2,ja=S+R/2;T=Math.max(.05,Math.min(5,ia));N=ka.width*T;R=ka.height*T;J=da-N/2;S=ja-R/2;x()}}function x(){X.setAttribute("viewBox",J+" "+S+" "+N+" "+R);var ia=Z.getBoundingClientRect();if(!(0>=ia.width||0>=ia.height)){var ka=ia.width-12,da=Math.max(20,ka*Math.min(1,N/1200)),ja=1200-N;ja=0<ja?(J- -400)/ja:.5;ja=Math.max(0,Math.min(1,ja));sa.style.width=da+"px";sa.style.left=ja*(ka-da)+"px";ia=ia.height-12;ka=Math.max(20,ia*Math.min(1,R/1200));da=1200-R;da=0<da?(S- -400)/da:.5;da=Math.max(0,Math.min(1,-da));xa.style.height=ka+"px";xa.style.top=da*(ia-ka)+"px"}}function B(ia){var ka=X.getBoundingClientRect(),da=J+((null!=ia.touches?ia.touches[0].clientX:ia.clientX)-ka.left)/ka.width*N;ka=S+((null!=ia.touches?ia.touches[0].clientY:ia.clientY)-ka.top)/ka.height*R;ia=mxEvent.isAltDown(ia);return{x:t&&!ia?20*Math.round(da/20):Math.round(da),y:t&&!ia?20*Math.round(ka/20):Math.round(ka)}}function z(ia){var ka=X.getBoundingClientRect(),da=J+((null!=ia.touches?ia.touches[0].clientX:ia.clientX)-ka.left)/-ka.width*N;ia=S+((null!=ia.touches?ia.touches[0].clientY:ia.clientY)-ka.top)/ka.height*R;ka=N/400*9;if(q&&2<k.length&&"Q"===k[0].type){var ja=k[0].cx-da,ta=k[0].cy-ia;if(Math.sqrt(ja*ja+ta*ta)<=ka)return{type:"control",index:0}}for(var va=1;va<k.length;va++)if("Q"===k[va].type&&(ja=k[va].cx-da,ta=k[va].cy-ia,Math.sqrt(ja*ja+ta*ta)<=ka))return{type:"control",index:va};for(va=0;va<k.length;va++)if(ja=k[va].x-da,ta=k[va].y-ia,Math.sqrt(ja*ja+ta*ta)<=ka)return{type:"vertex",index:va};return null}function F(){u.push(JSON.stringify(k));-y=[];L()}function K(){0<u.length&&(y.push(JSON.stringify(k)),k=JSON.parse(u.pop()),n=Math.min(n,k.length-1),Q(),L())}function M(){0<y.length&&(u.push(JSON.stringify(k)),k=JSON.parse(y.pop()),n=Math.min(n,k.length-1),Q(),L())}function L(){null!=wa&&(wa.style.opacity=0<u.length?"1":"0.3",wa.style.pointerEvents=0<u.length?"":"none");null!=za&&(za.style.opacity=0<y.length?"1":"0.3",za.style.pointerEvents=0<y.length?"":"none")}function Q(){for(var ia="",ka=0;ka<k.length;ka++)ia=0===ka?ia+("M"+k[ka].x+-" "+k[ka].y):"Q"===k[ka].type?ia+("Q"+k[ka].cx+" "+k[ka].cy+" "+k[ka].x+" "+k[ka].y):ia+("L"+k[ka].x+" "+k[ka].y);q&&2<k.length&&("Q"===k[0].type&&(ia+="Q"+k[0].cx+" "+k[0].cy+" "+k[0].x+" "+k[0].y),ia+="Z");ea.setAttribute("d",ia);for(ea.setAttribute("fill",q&&2<k.length?"rgba(66, 133, 244, 0.1)":"none");aa.firstChild;)aa.removeChild(aa.firstChild);for(ka=1;ka<k.length;ka++)"Q"===k[ka].type&&(ia=document.createElementNS("http://www.w3.org/2000/svg","polyline"),ia.setAttribute("points",k[ka-1].x+-","+k[ka-1].y+" "+k[ka].cx+","+k[ka].cy+" "+k[ka].x+","+k[ka].y),ia.setAttribute("fill","none"),ia.setAttribute("stroke","#f0a030"),ia.setAttribute("stroke-width","1"),ia.setAttribute("stroke-dasharray","4,3"),aa.appendChild(ia));q&&2<k.length&&"Q"===k[0].type&&(ka=document.createElementNS("http://www.w3.org/2000/svg","polyline"),ka.setAttribute("points",k[k.length-1].x+","+k[k.length-1].y+" "+k[0].cx+","+k[0].cy+" "+k[0].x+","+k[0].y),ka.setAttribute("fill","none"),ka.setAttribute("stroke","#f0a030"),-ka.setAttribute("stroke-width","1"),ka.setAttribute("stroke-dasharray","4,3"),aa.appendChild(ka));for(;ha.firstChild;)ha.removeChild(ha.firstChild);for(ka=0;ka<k.length;ka++)ia=document.createElementNS("http://www.w3.org/2000/svg","circle"),ia.setAttribute("cx",k[ka].x),ia.setAttribute("cy",k[ka].y),ia.setAttribute("r",5),ia.setAttribute("fill",ka===n?"#ff4444":"#4285f4"),ia.setAttribute("stroke","#fff"),ia.setAttribute("stroke-width","1.5"),ia.style.cursor="move",ha.appendChild(ia);for(;na.firstChild;)na.removeChild(na.firstChild);-for(ka=1;ka<k.length;ka++)"Q"===k[ka].type&&(ia=document.createElementNS("http://www.w3.org/2000/svg","rect"),ia.setAttribute("x",k[ka].cx-5),ia.setAttribute("y",k[ka].cy-5),ia.setAttribute("width",10),ia.setAttribute("height",10),ia.setAttribute("fill",ka===n?"#ff8800":"#f0a030"),ia.setAttribute("stroke","#fff"),ia.setAttribute("stroke-width","1.5"),ia.style.cursor="move",na.appendChild(ia));q&&2<k.length&&"Q"===k[0].type&&(ka=document.createElementNS("http://www.w3.org/2000/svg","rect"),ka.setAttribute("x",-k[0].cx-5),ka.setAttribute("y",k[0].cy-5),ka.setAttribute("width",10),ka.setAttribute("height",10),ka.setAttribute("fill",0===n?"#ff8800":"#f0a030"),ka.setAttribute("stroke","#fff"),ka.setAttribute("stroke-width","1.5"),ka.style.cursor="move",na.appendChild(ka));c()}function c(){fa.innerHTML="";if(0===k.length){var ia=document.createElement("div");ia.style.padding="20px 10px";ia.style.textAlign="center";ia.style.opacity="0.5";ia.style.fontSize="12px";mxUtils.write(ia,mxResources.get("clickToAdd"));-fa.appendChild(ia)}else for(ia=0;ia<k.length;ia++)(function(ka){var da=document.createElement("div");da.style.display="flex";da.style.alignItems="center";da.style.padding="2px 4px";da.style.gap="4px";da.style.borderRadius="3px";da.style.marginBottom="2px";da.style.fontSize="12px";da.setAttribute("draggable","true");da.setAttribute("data-idx",ka);ka===n&&(da.style.backgroundColor="rgba(66, 133, 244, 0.15)");da.style.cursor="pointer";mxEvent.addListener(da,"click",function(){n=ka;Q()});var ja=document.createElement("span");-ja.innerHTML="☰";ja.style.cursor="grab";ja.style.fontSize="11px";ja.style.opacity="0.4";ja.style.flexShrink="0";da.appendChild(ja);ja=document.createElement("span");ja.style.minWidth="18px";ja.style.fontWeight="bold";mxUtils.write(ja,ka+1+"");da.appendChild(ja);ja=document.createElement("input");ja.type="number";ja.value=Math.round(k[ka].x);ja.style.width="48px";ja.style.fontSize="11px";ja.style.padding="1px 3px";ja.title="X";mxEvent.addListener(ja,"change",function(){F();k[ka].x=parseInt(this.value)||-0;Q()});mxEvent.addListener(ja,"click",function(va){va.stopPropagation()});da.appendChild(ja);ja=document.createElement("input");ja.type="number";ja.value=Math.round(k[ka].y);ja.style.width="48px";ja.style.fontSize="11px";ja.style.padding="1px 3px";ja.title="Y";mxEvent.addListener(ja,"change",function(){F();k[ka].y=parseInt(this.value)||0;Q()});mxEvent.addListener(ja,"click",function(va){va.stopPropagation()});da.appendChild(ja);if(0<ka||0===ka&&q&&2<k.length){ja=document.createElement("label");ja.style.display=-"flex";ja.style.alignItems="center";ja.style.cursor="pointer";ja.style.flexShrink="0";ja.title=mxResources.get("curved");var ta=document.createElement("input");ta.type="checkbox";ta.checked="Q"===k[ka].type;ta.style.margin="0";mxEvent.addListener(ta,"click",function(va){va.stopPropagation()});mxEvent.addListener(ta,"change",function(){F();if("Q"===k[ka].type)k[ka].type="L",delete k[ka].cx,delete k[ka].cy;else{var va=0<ka?k[ka-1]:k[k.length-1];var Ca=k[ka];var Ha=(va.x+Ca.x)/2;var Ja=(va.y+Ca.y)/2;-var Ra=Ca.x-va.x,Va=Ca.y-va.y;va=Math.sqrt(Ra*Ra+Va*Va);0!==va&&(Ca=.25*va,Ha=Math.round(Ha+-Va/va*Ca),Ja=Math.round(Ja+Ra/va*Ca));k[ka].type="Q";k[ka].cx=Ha;k[ka].cy=Ja}Q()});ja.appendChild(ta);da.appendChild(ja)}ja=document.createElement("img");ja.setAttribute("src",Editor.trashImage);ja.style.cursor="pointer";ja.style.marginLeft="auto";ja.style.width="14px";ja.style.height="14px";ja.style.opacity="0.5";ja.style.flexShrink="0";ja.title=mxResources.get("delete");Editor.isDarkMode()&&(ja.style.filter=-"invert(1)");mxEvent.addListener(ja,"click",function(va){va.stopPropagation();F();k.splice(ka,1);n>=k.length&&(n=k.length-1);Q()});da.appendChild(ja);mxEvent.addListener(da,"dragstart",function(va){G=ka;da.style.opacity="0.4";va.dataTransfer.effectAllowed="move";va.dataTransfer.setData("text/plain",""+ka);va.stopPropagation()});mxEvent.addListener(da,"dragover",function(va){va.preventDefault();va.stopPropagation();va.dataTransfer.dropEffect="move";va=parseInt(da.getAttribute("data-idx"));null!==G&&-va!==G&&(da.style.borderTop=va<G?"2px solid #4285f4":"",da.style.borderBottom=va>G?"2px solid #4285f4":"")});mxEvent.addListener(da,"dragleave",function(va){da.style.borderTop="";da.style.borderBottom=""});mxEvent.addListener(da,"drop",function(va){va.preventDefault();va.stopPropagation();da.style.borderTop="";da.style.borderBottom="";var Ca=parseInt(da.getAttribute("data-idx"));null!==G&&Ca!==G&&(F(),va=k.splice(G,1)[0],Ca=Ca>G?Ca-1:Ca,k.splice(Ca,0,va),n===G?n=Ca:G<n&&Ca>=n?n--:G>n&&Ca<=n&&n++,-Q());G=null});mxEvent.addListener(da,"dragend",function(va){da.style.opacity="";da.style.borderTop="";da.style.borderBottom="";G=null});fa.appendChild(da)})(ia)}var f=b.editor.graph,k=[],n=-1,q=!0,t=!0,u=[],y=[],E=-1,I=null,C=!1,U=!1,J=0,S=0,N=400,R=400,T=1,v=!1,d=0,m=0,r=0,A=0,D=!1,G=null,O=f.view.getState(l);if(null!=O)try{var P=JSON.parse(mxUtils.getValue(O.style,"polyCoords","[]")),V=JSON.parse(mxUtils.getValue(O.style,"polyCurves","[]")),Y=mxUtils.getValue(O.style,"polyline",0);q=!(1==Y||!0===-Y||"true"===Y||"1"===Y);for(O=0;O<P.length;O++){var H={x:Math.round(400*P[O][0]),y:Math.round(400*P[O][1]),type:"L"};0<O&&V.length>O-1&&null!=V[O-1]&&3<=V[O-1].length&&"Q"===V[O-1][0]&&(H.type="Q",H.cx=Math.round(400*V[O-1][1]),H.cy=Math.round(400*V[O-1][2]));k.push(H)}q&&2<P.length&&V.length>=P.length&&null!=V[P.length-1]&&3<=V[P.length-1].length&&"Q"===V[P.length-1][0]&&(k[0].type="Q",k[0].cx=Math.round(400*V[P.length-1][1]),k[0].cy=Math.round(400*V[P.length-1][2]))}catch(ia){}var W=document.createElement("div");-W.style.userSelect="none";W.setAttribute("tabindex","0");W.style.outline="none";W.style.position="absolute";W.style.left="30px";W.style.right="30px";W.style.top="30px";W.style.bottom="30px";P=document.createElement("div");P.style.display="flex";P.style.gap="10px";P.style.position="absolute";P.style.left="0px";P.style.right="0px";P.style.top="0px";P.style.bottom="40px";W.appendChild(P);var Z=document.createElement("div");Z.style.border="1px solid";Z.style.borderColor="inherit";Z.style.borderRadius=-"4px";Z.style.flexGrow="1";Z.style.flexShrink="1";Z.style.minWidth="200px";Z.style.position="relative";Z.style.overflow="hidden";P.appendChild(Z);var X=document.createElementNS("http://www.w3.org/2000/svg","svg");X.setAttribute("width","100%");X.setAttribute("height","100%");X.setAttribute("viewBox","0 0 400 400");X.style.display="block";X.style.cursor="crosshair";V=document.createElementNS("http://www.w3.org/2000/svg","defs");H=document.createElementNS("http://www.w3.org/2000/svg","pattern");O="polygonGrid_"+-Date.now();H.setAttribute("id",O);H.setAttribute("width",20);H.setAttribute("height",20);H.setAttribute("patternUnits","userSpaceOnUse");Y=document.createElementNS("http://www.w3.org/2000/svg","path");Y.setAttribute("d","M 20 0 L 0 0 0 20");Y.setAttribute("fill","none");Y.setAttribute("stroke","#e0e0e0");Y.setAttribute("stroke-width","0.5");H.appendChild(Y);V.appendChild(H);X.appendChild(V);var ba=document.createElementNS("http://www.w3.org/2000/svg","rect");ba.setAttribute("x","-5000");ba.setAttribute("y",-"-5000");ba.setAttribute("width","10000");ba.setAttribute("height","10000");ba.setAttribute("fill","url(#"+O+")");X.appendChild(ba);var ea=document.createElementNS("http://www.w3.org/2000/svg","path");ea.setAttribute("fill","rgba(66, 133, 244, 0.1)");ea.setAttribute("stroke","#4285f4");ea.setAttribute("stroke-width","2");X.appendChild(ea);var aa=document.createElementNS("http://www.w3.org/2000/svg","g");X.appendChild(aa);var ha=document.createElementNS("http://www.w3.org/2000/svg","g");X.appendChild(ha);-var na=document.createElementNS("http://www.w3.org/2000/svg","g");X.appendChild(na);Z.appendChild(X);var ra=document.createElement("div");ra.style.position="absolute";ra.style.bottom="0px";ra.style.left="0px";ra.style.right="12px";ra.style.height="12px";ra.style.backgroundColor="rgba(128,128,128,0.08)";var sa=document.createElement("div");sa.style.position="absolute";sa.style.top="2px";sa.style.height="8px";sa.style.borderRadius="4px";sa.style.backgroundColor="rgba(128,128,128,0.35)";sa.style.cursor=-"pointer";sa.style.minWidth="20px";ra.appendChild(sa);Z.appendChild(ra);var ua=document.createElement("div");ua.style.position="absolute";ua.style.top="0px";ua.style.right="0px";ua.style.bottom="12px";ua.style.width="12px";ua.style.backgroundColor="rgba(128,128,128,0.08)";var xa=document.createElement("div");xa.style.position="absolute";xa.style.left="2px";xa.style.width="8px";xa.style.borderRadius="4px";xa.style.backgroundColor="rgba(128,128,128,0.35)";xa.style.cursor="pointer";xa.style.minHeight=-"20px";ua.appendChild(xa);Z.appendChild(ua);var qa=!1,Aa=!1,Ba=0,Ea=0;mxEvent.addListener(sa,"mousedown",function(ia){qa=!0;Ba=ia.clientX;Ea=J;ia.preventDefault();ia.stopPropagation()});mxEvent.addListener(xa,"mousedown",function(ia){Aa=!0;Ba=ia.clientY;Ea=S;ia.preventDefault();ia.stopPropagation()});mxEvent.addListener(ra,"mousedown",function(ia){if(ia.target===ra){var ka=ra.getBoundingClientRect().width,da=ia.clientX-ra.getBoundingClientRect().left,ja=1200-N;0<ja&&(J=-400+da/ka*ja,x());ia.preventDefault();-ia.stopPropagation()}});mxEvent.addListener(ua,"mousedown",function(ia){if(ia.target===ua){var ka=ua.getBoundingClientRect().height,da=ia.clientY-ua.getBoundingClientRect().top,ja=1200-R;0<ja&&(S=-400+da/ka*ja,x());ia.preventDefault();ia.stopPropagation()}});var Fa=function(ia){if(qa){var ka=Z.getBoundingClientRect().width-12,da=parseFloat(sa.style.width)||20,ja=1200-N;ka>da&&0<ja&&(J=Ea+(ia.clientX-Ba)/(ka-da)*ja,x());ia.preventDefault()}Aa&&(ka=Z.getBoundingClientRect().height-12,da=parseFloat(xa.style.height)||-20,ja=1200-R,ka>da&&0<ja&&(S=Ea+(ia.clientY-Ba)/(ka-da)*ja,x()),ia.preventDefault())},ca=function(ia){Aa=qa=!1};mxEvent.addListener(document,"mousemove",Fa);mxEvent.addListener(document,"mouseup",ca);"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){var ia=X.getBoundingClientRect();if(0<ia.width&&0<ia.height){var ka=J+N/2,da=S+R/2;N=ia.width*T;R=ia.height*T;J=ka-N/2;S=da-R/2;x()}})).observe(Z);var fa=document.createElement("div");fa.style.width="200px";fa.style.flexShrink="0";fa.style.overflowY=-"auto";fa.style.border="1px solid";fa.style.borderColor="inherit";fa.style.borderRadius="4px";fa.style.padding="4px";P.appendChild(fa);mxEvent.addGestureListeners(X,function(ia){if(!D&&1!==ia.button&&2!==ia.button){var ka=z(ia);if(null!=ka)E=ka.index,I=ka.type,C=!0,U=!1,n=ka.index;else{ka=B(ia);F();if(2>k.length)k.push({x:ka.x,y:ka.y,type:"L"}),n=k.length-1;else{for(var da=Infinity,ja=k.length-1,ta=q?k.length:k.length-1,va=0;va<ta;va++){var Ca=(va+1)%k.length;Ca=mxUtils.ptSegDistSq(k[va].x,k[va].y,-k[Ca].x,k[Ca].y,ka.x,ka.y);Ca<da&&(da=Ca,ja=va)}k.splice(ja+1,0,{x:ka.x,y:ka.y,type:"L"});n=ja+1}E=n;I="vertex";U=C=!0}Q();mxEvent.consume(ia)}},function(ia){if(C&&0<=E&&E<k.length){U||(F(),U=!0);var ka=B(ia);"control"===I?(k[E].cx=ka.x,k[E].cy=ka.y):(k[E].x=ka.x,k[E].y=ka.y);Q();mxEvent.consume(ia)}},function(ia){!D&&1!==ia.button&&2!==ia.button&&C&&0<=E&&(C=!1,E=-1,I=null,mxEvent.consume(ia))});mxEvent.addListener(X,"wheel",function(ia){ia.preventDefault();var ka=X.getBoundingClientRect(),da=(ia.clientX--ka.left)/ka.width,ja=(ia.clientY-ka.top)/ka.height,ta=J+da*N,va=S+ja*R;T=Math.max(.05,Math.min(5,T*(0<ia.deltaY?1.15:1/1.15)));N=ka.width*T;R=ka.height*T;J=ta-da*N;S=va-ja*R;x()});mxEvent.addListener(X,"contextmenu",function(ia){ia.preventDefault()});mxEvent.addListener(X,"mousedown",function(ia){if(1===ia.button||2===ia.button||0===ia.button&&D)v=!0,d=ia.clientX,m=ia.clientY,r=J,A=S,X.style.cursor="grabbing",ia.preventDefault()});var oa=function(ia){if(v){var ka=X.getBoundingClientRect();J=r-(ia.clientX--d)/ka.width*N;S=A-(ia.clientY-m)/ka.height*R;x();ia.preventDefault()}},pa=function(ia){v&&(v=!1,X.style.cursor=D?"grab":"crosshair")};mxEvent.addListener(document,"mousemove",oa);mxEvent.addListener(document,"mouseup",pa);P=document.createElement("div");P.style.display="flex";P.style.alignItems="center";P.style.gap="6px";P.style.position="absolute";P.style.left="0px";P.style.right="0px";P.style.bottom="0px";P.style.height="34px";var wa=b.createToolbarButton(Editor.undoImage,mxResources.get("undo"),-function(){K()});P.appendChild(wa);var za=b.createToolbarButton(Editor.redoImage,mxResources.get("redo"),function(){M()});P.appendChild(za);V=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){g(T/1.15)});P.appendChild(V);V=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){g(1.15*T)});P.appendChild(V);V=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){var ia=X.getBoundingClientRect();if(0<ia.width&&0<ia.height){if(1==-T)if(0<k.length){for(var ka=k[0].x,da=k[0].y,ja=k[0].x,ta=k[0].y,va=1;va<k.length;va++)ka=Math.min(ka,k[va].x),da=Math.min(da,k[va].y),ja=Math.max(ja,k[va].x),ta=Math.max(ta,k[va].y),"Q"===k[va].type&&(ka=Math.min(ka,k[va].cx),da=Math.min(da,k[va].cy),ja=Math.max(ja,k[va].cx),ta=Math.max(ta,k[va].cy));ja=ja-ka+40;ta=ta-da+40;T=1/Math.min(ia.width/ja,ia.height/ta);N=ia.width*T;R=ia.height*T;J=ka-20+(ja-N)/2;S=da-20+(ta-R)/2}else T=1,N=ia.width,R=ia.height,J=(400-N)/2,S=(400-R)/2;else T=1,N=ia.width*-T,R=ia.height*T,J=(400-N)/2,S=(400-R)/2;x()}});P.appendChild(V);V=mxUtils.button(mxResources.get("deleteAll"),function(){0<k.length&&(F(),k=[],n=-1,Q())});V.className="geBtn";V.style.padding="2px 10px";V.style.fontSize="12px";P.appendChild(V);V=document.createElement("span");V.style.flexGrow="1";P.appendChild(V);V=document.createElement("label");V.style.display="flex";V.style.alignItems="center";V.style.gap="4px";V.style.fontSize="12px";V.style.cursor="pointer";V.style.whiteSpace="nowrap";H=document.createElement("input");-H.type="checkbox";H.checked=t;mxEvent.addListener(H,"change",function(){t=this.checked;ba.style.display=t?"":"none"});V.appendChild(H);mxUtils.write(V,mxResources.get("grid"));P.appendChild(V);V=document.createElement("label");V.style.display="flex";V.style.alignItems="center";V.style.gap="4px";V.style.fontSize="12px";V.style.cursor="pointer";V.style.whiteSpace="nowrap";H=document.createElement("input");H.type="checkbox";H.checked=q;mxEvent.addListener(H,"change",function(){q=this.checked;Q()});V.appendChild(H);-mxUtils.write(V,mxResources.get("closePath"));P.appendChild(V);V=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});V.className="geBtn";H=mxUtils.button(mxResources.get("apply"),function(){if(2>k.length)b.showError(mxResources.get("error"),mxResources.get("minTwoPoints"),mxResources.get("ok"));else{for(var ia=k[0].x,ka=k[0].x,da=k[0].y,ja=k[0].y,ta=0;ta<k.length;ta++)ia=Math.min(ia,k[ta].x),ka=Math.max(ka,k[ta].x),da=Math.min(da,k[ta].y),ja=Math.max(ja,k[ta].y),"Q"===k[ta].type&&-(ia=Math.min(ia,k[ta].cx),ka=Math.max(ka,k[ta].cx),da=Math.min(da,k[ta].cy),ja=Math.max(ja,k[ta].cy));var va=ka-ia,Ca=ja-da,Ha=function(Ra){return 0<va?Math.round((Ra-ia)/va*1E5)/1E5:.5},Ja=function(Ra){return 0<Ca?Math.round((Ra-da)/Ca*1E5)/1E5:.5};ka=[];ja=[];for(ta=0;ta<k.length;ta++)ka.push([Ha(k[ta].x),Ja(k[ta].y)]),0<ta&&("Q"===k[ta].type?ja.push(["Q",Ha(k[ta].cx),Ja(k[ta].cy)]):ja.push([]));q&&2<k.length&&"Q"===k[0].type&&ja.push(["Q",Ha(k[0].cx),Ja(k[0].cy)]);if(null!=p)ta="shape=mxgraph.basic.polygon;polyCoords="+-JSON.stringify(ka)+";polyCurves="+JSON.stringify(ja)+";polyline="+(q?"0":"1")+";whiteSpace=wrap;html=1;",p(ta);else{ta=f.getCellGeometry(l);null!=ta&&(ta=ta.clone(),0<va&&(ta.x+=ia/400*ta.width,ta.width*=va/400),0<Ca&&(ta.y+=da/400*ta.height,ta.height*=Ca/400));f.getModel().beginUpdate();try{null!=ta&&f.getModel().setGeometry(l,ta),f.setCellStyles("polyCoords",JSON.stringify(ka),[l]),f.setCellStyles("polyCurves",JSON.stringify(ja),[l]),f.setCellStyles("polyline",q?"0":"1",[l])}finally{f.getModel().endUpdate()}}b.hideDialog()}});-H.className="geBtn gePrimaryBtn";b.editor.cancelFirst?(P.appendChild(V),P.appendChild(H)):(P.appendChild(H),P.appendChild(V));W.appendChild(P);mxEvent.addListener(W,"keydown",function(ia){32===ia.keyCode?(D||(D=!0,X.style.cursor="grab"),mxEvent.consume(ia)):46===ia.keyCode||8===ia.keyCode?0<=n&&n<k.length&&"INPUT"!==ia.target.tagName&&(F(),k.splice(n,1),n>=k.length&&(n=k.length-1),Q(),mxEvent.consume(ia)):90===ia.keyCode&&(ia.ctrlKey||ia.metaKey)?(ia.shiftKey?M():K(),mxEvent.consume(ia)):89===ia.keyCode&&-(ia.ctrlKey||ia.metaKey)&&(M(),mxEvent.consume(ia))});mxEvent.addListener(W,"keyup",function(ia){32===ia.keyCode&&(D=!1,v||(X.style.cursor="crosshair"))});Q();L();this.init=function(){W.focus();var ia=X.getBoundingClientRect();0<ia.width&&0<ia.height&&(T=1,N=ia.width*T,R=ia.height*T,J=(400-N)/2,S=(400-R)/2,x())};this.destroy=function(){mxEvent.removeListener(document,"mousemove",Fa);mxEvent.removeListener(document,"mouseup",ca);mxEvent.removeListener(document,"mousemove",oa);mxEvent.removeListener(document,-"mouseup",pa)};this.container=W};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinFormatImage=+var FilePropertiesDialog=function(b,l){function p(I){var C=O;O=function(U,K){try{I(function(){C(U,K)},K)}catch(S){K(S)}}}function g(I,C,U){var K=document.createElement("div");K.className="geDialogFormRow";var S=document.createElement("span");S.className="geDialogFormLabel";mxUtils.write(S,C+":");K.appendChild(S);K.appendChild(U);I.appendChild(K);return K}var x=document.createElement("div"),A=document.createElement("h3");mxUtils.write(A,mxResources.get("properties"));x.appendChild(A);var y=b.getCurrentFile(),+G=null!=y&&null!=y.getTitle()?y.getTitle():b.defaultFilename,L=/(\.png)$/i.test(G);A=/(\.svg)$/i.test(G);var O=function(I,C){I()},J=document.createElement("div");J.className="geDialogSection";if(L||A){G=1;L=0;var Q=b.fileNode;null!=Q&&(Q.hasAttribute("scale")&&(G=parseFloat(Q.getAttribute("scale"))),Q.hasAttribute("border")&&(L=parseInt(Q.getAttribute("border"))));var c=document.createElement("input");c.setAttribute("type","text");c.setAttribute("value",100*G+"%");g(J,mxResources.get("zoom"),c);var f=+document.createElement("input");f.setAttribute("type","text");f.setAttribute("value",L);g(J,mxResources.get("borderWidth"),f);var k=null;A&&(k=b.addCheckbox(J,mxResources.get("embedFonts"),b.getSvgFileProperties(Q).embedFonts,null,null,null,null,null,!0));this.init=this.init||function(){c.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?c.select():document.execCommand("selectAll",!1,null)};p(function(I,C){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(c.value)/+100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(f.value))),null!=k&&b.fileNode.setAttribute("embedFonts",k.checked?"true":"false"),null!=y&&y.fileChanged());I()})}else if(!/(\.html)$/i.test(G)&&!/(\.svg)$/i.test(G)){var n=null!=y?y.isCompressed():Editor.defaultCompressed,q=b.addCheckbox(J,mxResources.get("compressed"),n,null,null,null,null,null,!0);this.init=this.init||function(){q.focus()};p(function(I,C){null!=b.fileNode&&n!=q.checked?window.setTimeout(function(){b.fileNode.setAttribute("compressed",+q.checked?"true":"false");null!=y&&(y.compressionChanged(q.checked),y.fileChanged());I()},0):I()})}var t=null!=y?y.isLocked():!1,u=b.addCheckbox(J,mxResources.get("locked"),t,null,null,null,null,null,!0);this.init=this.init||function(){u.focus()};p(function(I,C){null!=b.fileNode&&t!=u.checked?window.setTimeout(function(){null!=y&&y.setLocked(u.checked);I()},0):I()});if(null!=y&&y.isRealtimeOptional()){var B="disabled"!=b.drive.getCustomProperty(y.desc,"collaboration"),E=b.addCheckbox(J,mxResources.get("realtimeCollaboration"),+B,null,null,null,null,null,!0);E.checkRow.appendChild(b.menus.createHelpLink("https://www.drawio.com/docs/manual/collaboration/concurrent-editing/#disable-real-time-collaboration"));p(function(I,C){E.checked!=B?y.setRealtimeEnabled(E.checked,I,C):I()});this.init=null!=this.init?this.init:function(){E.focus()}}x.appendChild(J);A=document.createElement("div");A.className="geDialogSection";J=!1;null!=y&&"draw.io"==b.getServiceName()&&0<y.getSize()&&"1"!=urlParams.embed&&(J=b.formatFileSize(y.getSize()),+G=document.createElement("input"),G.setAttribute("type","text"),G.setAttribute("title",J),G.setAttribute("value",J),G.setAttribute("disabled","disabled"),g(A,mxResources.get("size"),G),J=!0);null!=y&&null!=y.fileObject&&null!=y.fileObject.path&&(J=document.createElement("input"),J.setAttribute("type","text"),J.setAttribute("title",y.fileObject.path),J.setAttribute("value",y.fileObject.path),J.setAttribute("disabled","disabled"),g(A,mxResources.get("pathFilename"),J),J=!0);null!=l&&(J=document.createElement("a"),+J.setAttribute("href",l),J.setAttribute("title",l),J.style.flex="1",J.style.minWidth="0",J.style.whiteSpace="nowrap",J.style.overflow="hidden",J.style.textOverflow="ellipsis",mxUtils.write(J,l),mxEvent.addListener(J,"click",function(I){b.openLink(l);mxEvent.consume(I)}),g(A,mxResources.get("publicDiagramUrl"),J),J=!0);J&&x.appendChild(A);this.init=null!=this.init?this.init:function(){};x.style.paddingBottom="10px";A=document.createElement("div");A.style.marginTop="34px";A.style.textAlign="right";+A.style.whiteSpace="nowrap";J=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});J.className="geBtn";G=mxUtils.button(mxResources.get("apply"),function(){b.spinner.spin(document.body,mxResources.get("updatingDocument"))&&O(function(){b.spinner.stop();b.hideDialog()},function(I){b.spinner.stop();b.handleError(I,mxResources.get("error"))})});G.className="geBtn gePrimaryBtn";L=null;null!=b.fileNode&&(L=mxUtils.button(mxResources.get("editData")+"...",function(){b.hideDialog();var I=+{};try{var C=b.fileNode.getAttribute("vars");null!=C&&0<C.length&&(I=JSON.parse(C))}catch(S){}C=mxUtils.createXmlDocument().createElement("object");C.setAttribute("label","");for(var U in I)C.setAttribute(U,I[U]);I=b.createTemporaryGraph(b.editor.graph.getStylesheet());var K=new mxCell(C);I.getModel().add(I.getDefaultParent(),K);I.getModel().addListener(mxEvent.CHANGE,function(S,M){S=M.getProperty("edit").changes;for(M=0;M<S.length;M++)if(S[M]instanceof mxValueChange&&S[M].cell===K){for(var R={},+T=S[M].value.attributes,v=0;v<T.length;v++)"label"!=T[v].nodeName&&(R[T[v].nodeName]=T[v].nodeValue);R=JSON.stringify(R);"{}"==R?b.fileNode.removeAttribute("vars"):b.fileNode.setAttribute("vars",R);b.updateFileVars();b.editor.graph.refresh();R=b.getCurrentFile();null!=R&&R.fileChanged()}});I=new EditDataDialog(b,K,I);b.showDialog(I.container,480,420,!0,!1,null,!1,null,new mxRectangle(0,0,440,220));I.init()}),L.className="geBtn");b.editor.cancelFirst?(A.appendChild(J),null!=L&&A.appendChild(L),A.appendChild(G)):+(null!=L&&A.appendChild(L),A.appendChild(G),A.appendChild(J));x.appendChild(A);this.container=x},ConnectionPointsDialog=function(b,l){function p(){null!=x&&x.destroy()}var g=document.createElement("div");g.style.userSelect="none";g.style.display="flex";g.style.flexDirection="column";g.style.height="100%";var x=null;this.init=function(){function A(T,v,d){var m="shape=image;points=[];rotatable=0;resizable=0;connectable=0;editable=0;image="+b.convertDataUri(mxConstraintHandler.prototype.pointImage.src)++";";T=new mxCell("",new mxGeometry(T,v,6,6),m);T.vertex=!0;T.cp=!0;T.constObj=d;return Q.addCell(T)}function y(T){T=Q.getSelectionCells();Q.deleteCells(T)}function G(){var T=parseFloat(K.value)||0;T=0>T?0:100<T?100:T;K.value=T;var v=parseFloat(M.value)||0;v=0>v?0:100<v?100:v;M.value=v;var d=parseInt(S.value)||0,m=parseInt(R.value)||0;d=new mxConnectionConstraint(new mxPoint(parseFloat((T/100).toFixed(6)),parseFloat((v/100).toFixed(6))),!1,null,d,m);T=Q.getConnectionPoint(k,d);v=Q.getSelectionCell();+if(null!=v){v.constObj=d;d=v.geometry.clone();m=Q.view.scale;var r=Q.view.translate;d.x=(T.x-3*m)/m-r.x;d.y=(T.y-3*m)/m-r.y;Q.model.setGeometry(v,d)}}function L(T){if(T.constObj)return{x:T.constObj.point.x,y:T.constObj.point.y,dx:T.constObj.dx,dy:T.constObj.dy};var v=0,d=0,m=c.geometry,r=parseFloat(((T.geometry.x+3-m.x)/m.width).toFixed(6));T=parseFloat(((T.geometry.y+3-m.y)/m.height).toFixed(6));0>r?(v=r*m.width,r=0):1<r&&(v=(r-1)*m.width,r=1);0>T?(d=T*m.height,T=0):1<T&&(d=(T-1)*m.height,T=1);return{x:r,+y:T,dx:parseInt(v),dy:parseInt(d)}}function O(T){if(1==Q.getSelectionCount()){var v=Q.getSelectionCell();T&&(v.constObj=null);T=L(v);K.value=parseFloat((100*T.x).toFixed(4));M.value=parseFloat((100*T.y).toFixed(4));S.value=T.dx;R.value=T.dy;U.style.visibility=""}else U.style.visibility="hidden"}var J=document.createElement("div");J.style.flex="1";J.style.minHeight="0";J.style.overflow="hidden";J.style.borderStyle="solid";J.style.borderWidth="1px";J.style.boxSizing="border-box";mxEvent.disableContextMenu(J);+g.appendChild(J);var Q=new Graph(J);Q.transparentBackground=!1;Q.autoExtend=!1;Q.autoScroll=!1;Q.setGridEnabled(!1);Q.setEnabled(!0);Q.setPanning(!0);Q.setConnectable(!1);Q.setTooltips(!1);Q.minFitScale=null;Q.maxFitScale=null;Q.centerZoom=!0;Q.maxFitScale=2;J=l.geometry;var c=new mxCell(l.value,new mxGeometry(0,0,J.width,J.height),l.style+";rotatable=0;resizable=0;connectable=0;editable=0;movable=0;opacity=50;");c.vertex=!0;Q.addCell(c);Q.dblClick=function(T,v){if(null!=v&&v!=c)Q.setSelectionCell(v);+else{v=mxUtils.convertPoint(Q.container,mxEvent.getClientX(T),mxEvent.getClientY(T));mxEvent.consume(T);T=Q.view.scale;var d=Q.view.translate;Q.setSelectionCell(A((v.x-3*T)/T-d.x,(v.y-3*T)/T-d.y))}};x=new mxKeyHandler(Q);x.bindKey(46,y);x.bindKey(8,y);Q.getRubberband().isForceRubberbandEvent=function(T){return 0==T.evt.button&&(null==T.getCell()||T.getCell()==c)};Q.panningHandler.isForcePanningEvent=function(T){return 2==T.evt.button};var f=Q.isCellSelectable;Q.isCellSelectable=function(T){return T==+c?!1:f.apply(this,arguments)};Q.getLinkForCell=function(){return null};var k=Q.view.getState(c);J=Q.getAllConnectionConstraints(k);for(var n=0;null!=J&&n<J.length;n++){var q=Q.getConnectionPoint(k,J[n]);A(q.x-3,q.y-3,J[n])}n=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){Q.zoomIn()});q=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){Q.zoomOut()});var t=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==Q.view.scale?+(Q.maxFitScale=8,Q.fit(8)):Q.zoomActual();Q.center()}),u=function(){b.prompt(mxResources.get("gridSize"),Q.gridSize,function(T){!isNaN(T)&&0<T&&(Q.setGridSize(T),Q.setGridEnabled(!0),Q.refresh())})},B=b.createToolbarButton(Editor.thinGridImage,mxResources.get("grid"),function(T){mxEvent.isShiftDown(T)?u():(Q.setGridEnabled(!Q.isGridEnabled()),Q.refresh())});mxEvent.addListener(B,"dblclick",u);var E=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),y);mxUtils.setOpacity(E,10);J=document.createElement("div");+J.style.display="flex";J.style.flexShrink="0";J.style.alignItems="center";J.style.paddingTop="6px";J.appendChild(n);J.appendChild(q);J.appendChild(t);J.appendChild(B);J.appendChild(E);g.appendChild(J);var I=document.createElement("input");I.setAttribute("type","number");I.setAttribute("min","1");I.setAttribute("value","1");I.style.width="45px";I.style.position="relative";I.style.margin="0 4px 0 4px";var C=document.createElement("select");C.style.position="relative";q=["left","right","top","bottom"];+for(n=0;n<q.length;n++)t=q[n],B=document.createElement("option"),mxUtils.write(B,mxResources.get(t)),B.value=t,C.appendChild(B);n=mxUtils.button(mxResources.get("add"),function(){var T=parseInt(I.value);T=1>T?1:100<T?100:T;I.value=T;for(var v=C.value,d=c.geometry,m=[],r=0;r<T;r++){switch(v){case "left":var z=d.x;var D=d.y+(r+1)*d.height/(T+1);break;case "right":z=d.x+d.width;D=d.y+(r+1)*d.height/(T+1);break;case "top":z=d.x+(r+1)*d.width/(T+1);D=d.y;break;case "bottom":z=d.x+(r+1)*d.width/(T+1),D=+d.y+d.height}m.push(A(z-3,D-3))}Q.setSelectionCells(m)});n.style.marginLeft="auto";J.appendChild(n);J.appendChild(I);J.appendChild(C);var U=document.createElement("div");U.style.flexShrink="0";U.style.margin="4px 0px 8px 0px";U.style.whiteSpace="nowrap";U.style.height="24px";J=document.createElement("span");mxUtils.write(J,mxResources.get("dx"));U.appendChild(J);var K=document.createElement("input");K.setAttribute("type","number");K.setAttribute("min","0");K.setAttribute("max","100");K.setAttribute("step",+"any");K.style.width="45px";K.style.margin="0 4px 0 4px";U.appendChild(K);mxUtils.write(U,"%");var S=document.createElement("input");S.setAttribute("type","number");S.style.width="45px";S.style.margin="0 4px 0 4px";U.appendChild(S);mxUtils.write(U,"pt");J=document.createElement("span");mxUtils.write(J,mxResources.get("dy"));J.style.marginLeft="12px";U.appendChild(J);var M=document.createElement("input");M.setAttribute("type","number");M.setAttribute("min","0");M.setAttribute("max","100");M.setAttribute("step",+"any");M.style.width="45px";M.style.margin="0 4px 0 4px";U.appendChild(M);mxUtils.write(U,"%");var R=document.createElement("input");R.setAttribute("type","number");R.style.width="45px";R.style.margin="0 4px 0 4px";U.appendChild(R);mxUtils.write(U,"pt");g.appendChild(U);O();Q.getSelectionModel().addListener(mxEvent.CHANGE,function(){0<Q.getSelectionCount()?mxUtils.setOpacity(E,60):mxUtils.setOpacity(E,10);O()});Q.addListener(mxEvent.CELLS_MOVED,O);mxEvent.addListener(K,"change",G);mxEvent.addListener(M,+"change",G);mxEvent.addListener(S,"change",G);mxEvent.addListener(R,"change",G);J=mxUtils.button(mxResources.get("cancel"),function(){p();b.hideDialog()});J.className="geBtn";n=mxUtils.button(mxResources.get("apply"),function(){var T=Q.model.cells,v=[],d=[],m;for(m in T){var r=T[m];r.cp&&d.push(L(r))}d.sort(function(z,D){return z.x!=D.x?z.x-D.x:z.y!=D.y?z.y-D.y:z.dx!=D.dx?z.dx-D.dx:z.dy-D.dy});for(T=0;T<d.length;T++)0<T&&d[T].x==d[T-1].x&&d[T].y==d[T-1].y&&d[T].dx==d[T-1].dx&&d[T].dy==d[T-1].dy||+v.push("["+d[T].x+","+d[T].y+",0,"+d[T].dx+","+d[T].dy+"]");b.editor.graph.setCellStyles("points","["+v.join(",")+"]",[l]);p();b.hideDialog()});n.className="geBtn gePrimaryBtn";q=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[l]);p();b.hideDialog()});q.className="geBtn";t=document.createElement("div");t.style.flexShrink="0";t.style.marginTop="10px";t.style.textAlign="right";b.isOffline()||t.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-connection-points-customise"));+b.editor.cancelFirst&&t.appendChild(J);t.appendChild(q);t.appendChild(n);b.editor.cancelFirst||t.appendChild(J);g.appendChild(t);Q.fit(8);Q.center()};this.destroy=p;this.container=g},PolygonDialog=function(b,l,p){function g(ia){var ka=Y.getBoundingClientRect();if(0<ka.width&&0<ka.height){var da=K+M/2,ja=S+R/2;T=Math.max(.05,Math.min(5,ia));M=ka.width*T;R=ka.height*T;K=da-M/2;S=ja-R/2;x()}}function x(){Y.setAttribute("viewBox",K+" "+S+" "+M+" "+R);var ia=Z.getBoundingClientRect();if(!(0>=ia.width||+0>=ia.height)){var ka=ia.width-12,da=Math.max(20,ka*Math.min(1,M/1200)),ja=1200-M;ja=0<ja?(K- -400)/ja:.5;ja=Math.max(0,Math.min(1,ja));sa.style.width=da+"px";sa.style.left=ja*(ka-da)+"px";ia=ia.height-12;ka=Math.max(20,ia*Math.min(1,R/1200));da=1200-R;da=0<da?(S- -400)/da:.5;da=Math.max(0,Math.min(1,da));xa.style.height=ka+"px";xa.style.top=da*(ia-ka)+"px"}}function A(ia){var ka=Y.getBoundingClientRect(),da=K+((null!=ia.touches?ia.touches[0].clientX:ia.clientX)-ka.left)/ka.width*M;ka=S+((null!=ia.touches?+ia.touches[0].clientY:ia.clientY)-ka.top)/ka.height*R;ia=mxEvent.isAltDown(ia);return{x:t&&!ia?20*Math.round(da/20):Math.round(da),y:t&&!ia?20*Math.round(ka/20):Math.round(ka)}}function y(ia){var ka=Y.getBoundingClientRect(),da=K+((null!=ia.touches?ia.touches[0].clientX:ia.clientX)-ka.left)/ka.width*M;ia=S+((null!=ia.touches?ia.touches[0].clientY:ia.clientY)-ka.top)/ka.height*R;ka=M/400*9;if(q&&2<k.length&&"Q"===k[0].type){var ja=k[0].cx-da,ta=k[0].cy-ia;if(Math.sqrt(ja*ja+ta*ta)<=ka)return{type:"control",+index:0}}for(var va=1;va<k.length;va++)if("Q"===k[va].type&&(ja=k[va].cx-da,ta=k[va].cy-ia,Math.sqrt(ja*ja+ta*ta)<=ka))return{type:"control",index:va};for(va=0;va<k.length;va++)if(ja=k[va].x-da,ta=k[va].y-ia,Math.sqrt(ja*ja+ta*ta)<=ka)return{type:"vertex",index:va};return null}function G(){u.push(JSON.stringify(k));B=[];J()}function L(){0<u.length&&(B.push(JSON.stringify(k)),k=JSON.parse(u.pop()),n=Math.min(n,k.length-1),Q(),J())}function O(){0<B.length&&(u.push(JSON.stringify(k)),k=JSON.parse(B.pop()),+n=Math.min(n,k.length-1),Q(),J())}function J(){null!=wa&&(wa.style.opacity=0<u.length?"1":"0.3",wa.style.pointerEvents=0<u.length?"":"none");null!=za&&(za.style.opacity=0<B.length?"1":"0.3",za.style.pointerEvents=0<B.length?"":"none")}function Q(){for(var ia="",ka=0;ka<k.length;ka++)ia=0===ka?ia+("M"+k[ka].x+" "+k[ka].y):"Q"===k[ka].type?ia+("Q"+k[ka].cx+" "+k[ka].cy+" "+k[ka].x+" "+k[ka].y):ia+("L"+k[ka].x+" "+k[ka].y);q&&2<k.length&&("Q"===k[0].type&&(ia+="Q"+k[0].cx+" "+k[0].cy+" "+k[0].x+" "++k[0].y),ia+="Z");ea.setAttribute("d",ia);for(ea.setAttribute("fill",q&&2<k.length?"rgba(66, 133, 244, 0.1)":"none");aa.firstChild;)aa.removeChild(aa.firstChild);for(ka=1;ka<k.length;ka++)"Q"===k[ka].type&&(ia=document.createElementNS("http://www.w3.org/2000/svg","polyline"),ia.setAttribute("points",k[ka-1].x+","+k[ka-1].y+" "+k[ka].cx+","+k[ka].cy+" "+k[ka].x+","+k[ka].y),ia.setAttribute("fill","none"),ia.setAttribute("stroke","#f0a030"),ia.setAttribute("stroke-width","1"),ia.setAttribute("stroke-dasharray",+"4,3"),aa.appendChild(ia));q&&2<k.length&&"Q"===k[0].type&&(ka=document.createElementNS("http://www.w3.org/2000/svg","polyline"),ka.setAttribute("points",k[k.length-1].x+","+k[k.length-1].y+" "+k[0].cx+","+k[0].cy+" "+k[0].x+","+k[0].y),ka.setAttribute("fill","none"),ka.setAttribute("stroke","#f0a030"),ka.setAttribute("stroke-width","1"),ka.setAttribute("stroke-dasharray","4,3"),aa.appendChild(ka));for(;ha.firstChild;)ha.removeChild(ha.firstChild);for(ka=0;ka<k.length;ka++)ia=document.createElementNS("http://www.w3.org/2000/svg",+"circle"),ia.setAttribute("cx",k[ka].x),ia.setAttribute("cy",k[ka].y),ia.setAttribute("r",5),ia.setAttribute("fill",ka===n?"#ff4444":"#4285f4"),ia.setAttribute("stroke","#fff"),ia.setAttribute("stroke-width","1.5"),ia.style.cursor="move",ha.appendChild(ia);for(;na.firstChild;)na.removeChild(na.firstChild);for(ka=1;ka<k.length;ka++)"Q"===k[ka].type&&(ia=document.createElementNS("http://www.w3.org/2000/svg","rect"),ia.setAttribute("x",k[ka].cx-5),ia.setAttribute("y",k[ka].cy-5),ia.setAttribute("width",+10),ia.setAttribute("height",10),ia.setAttribute("fill",ka===n?"#ff8800":"#f0a030"),ia.setAttribute("stroke","#fff"),ia.setAttribute("stroke-width","1.5"),ia.style.cursor="move",na.appendChild(ia));q&&2<k.length&&"Q"===k[0].type&&(ka=document.createElementNS("http://www.w3.org/2000/svg","rect"),ka.setAttribute("x",k[0].cx-5),ka.setAttribute("y",k[0].cy-5),ka.setAttribute("width",10),ka.setAttribute("height",10),ka.setAttribute("fill",0===n?"#ff8800":"#f0a030"),ka.setAttribute("stroke","#fff"),ka.setAttribute("stroke-width",+"1.5"),ka.style.cursor="move",na.appendChild(ka));c()}function c(){fa.innerHTML="";if(0===k.length){var ia=document.createElement("div");ia.style.padding="20px 10px";ia.style.textAlign="center";ia.style.opacity="0.5";ia.style.fontSize="12px";mxUtils.write(ia,mxResources.get("clickToAdd"));fa.appendChild(ia)}else for(ia=0;ia<k.length;ia++)(function(ka){var da=document.createElement("div");da.style.display="flex";da.style.alignItems="center";da.style.padding="2px 4px";da.style.gap="4px";da.style.borderRadius=+"3px";da.style.marginBottom="2px";da.style.fontSize="12px";da.setAttribute("draggable","true");da.setAttribute("data-idx",ka);ka===n&&(da.style.backgroundColor="rgba(66, 133, 244, 0.15)");da.style.cursor="pointer";mxEvent.addListener(da,"click",function(){n=ka;Q()});var ja=document.createElement("span");ja.innerHTML="☰";ja.style.cursor="grab";ja.style.fontSize="11px";ja.style.opacity="0.4";ja.style.flexShrink="0";da.appendChild(ja);ja=document.createElement("span");ja.style.minWidth="18px";+ja.style.fontWeight="bold";mxUtils.write(ja,ka+1+"");da.appendChild(ja);ja=document.createElement("input");ja.type="number";ja.value=Math.round(k[ka].x);ja.style.width="48px";ja.style.fontSize="11px";ja.style.padding="1px 3px";ja.title="X";mxEvent.addListener(ja,"change",function(){G();k[ka].x=parseInt(this.value)||0;Q()});mxEvent.addListener(ja,"click",function(va){va.stopPropagation()});da.appendChild(ja);ja=document.createElement("input");ja.type="number";ja.value=Math.round(k[ka].y);ja.style.width=+"48px";ja.style.fontSize="11px";ja.style.padding="1px 3px";ja.title="Y";mxEvent.addListener(ja,"change",function(){G();k[ka].y=parseInt(this.value)||0;Q()});mxEvent.addListener(ja,"click",function(va){va.stopPropagation()});da.appendChild(ja);if(0<ka||0===ka&&q&&2<k.length){ja=document.createElement("label");ja.style.display="flex";ja.style.alignItems="center";ja.style.cursor="pointer";ja.style.flexShrink="0";ja.title=mxResources.get("curved");var ta=document.createElement("input");ta.type="checkbox";+ta.checked="Q"===k[ka].type;ta.style.margin="0";mxEvent.addListener(ta,"click",function(va){va.stopPropagation()});mxEvent.addListener(ta,"change",function(){G();if("Q"===k[ka].type)k[ka].type="L",delete k[ka].cx,delete k[ka].cy;else{var va=0<ka?k[ka-1]:k[k.length-1];var Ca=k[ka];var Ha=(va.x+Ca.x)/2;var Ja=(va.y+Ca.y)/2;var Ra=Ca.x-va.x,Va=Ca.y-va.y;va=Math.sqrt(Ra*Ra+Va*Va);0!==va&&(Ca=.25*va,Ha=Math.round(Ha+-Va/va*Ca),Ja=Math.round(Ja+Ra/va*Ca));k[ka].type="Q";k[ka].cx=Ha;k[ka].cy=Ja}Q()});ja.appendChild(ta);+da.appendChild(ja)}ja=document.createElement("img");ja.setAttribute("src",Editor.trashImage);ja.style.cursor="pointer";ja.style.marginLeft="auto";ja.style.width="14px";ja.style.height="14px";ja.style.opacity="0.5";ja.style.flexShrink="0";ja.title=mxResources.get("delete");Editor.isDarkMode()&&(ja.style.filter="invert(1)");mxEvent.addListener(ja,"click",function(va){va.stopPropagation();G();k.splice(ka,1);n>=k.length&&(n=k.length-1);Q()});da.appendChild(ja);mxEvent.addListener(da,"dragstart",function(va){F=+ka;da.style.opacity="0.4";va.dataTransfer.effectAllowed="move";va.dataTransfer.setData("text/plain",""+ka);va.stopPropagation()});mxEvent.addListener(da,"dragover",function(va){va.preventDefault();va.stopPropagation();va.dataTransfer.dropEffect="move";va=parseInt(da.getAttribute("data-idx"));null!==F&&va!==F&&(da.style.borderTop=va<F?"2px solid #4285f4":"",da.style.borderBottom=va>F?"2px solid #4285f4":"")});mxEvent.addListener(da,"dragleave",function(va){da.style.borderTop="";da.style.borderBottom=+""});mxEvent.addListener(da,"drop",function(va){va.preventDefault();va.stopPropagation();da.style.borderTop="";da.style.borderBottom="";var Ca=parseInt(da.getAttribute("data-idx"));null!==F&&Ca!==F&&(G(),va=k.splice(F,1)[0],Ca=Ca>F?Ca-1:Ca,k.splice(Ca,0,va),n===F?n=Ca:F<n&&Ca>=n?n--:F>n&&Ca<=n&&n++,Q());F=null});mxEvent.addListener(da,"dragend",function(va){da.style.opacity="";da.style.borderTop="";da.style.borderBottom="";F=null});fa.appendChild(da)})(ia)}var f=b.editor.graph,k=[],n=-1,q=!0,t=!0,+u=[],B=[],E=-1,I=null,C=!1,U=!1,K=0,S=0,M=400,R=400,T=1,v=!1,d=0,m=0,r=0,z=0,D=!1,F=null,N=f.view.getState(l);if(null!=N)try{var P=JSON.parse(mxUtils.getValue(N.style,"polyCoords","[]")),V=JSON.parse(mxUtils.getValue(N.style,"polyCurves","[]")),X=mxUtils.getValue(N.style,"polyline",0);q=!(1==X||!0===X||"true"===X||"1"===X);for(N=0;N<P.length;N++){var H={x:Math.round(400*P[N][0]),y:Math.round(400*P[N][1]),type:"L"};0<N&&V.length>N-1&&null!=V[N-1]&&3<=V[N-1].length&&"Q"===V[N-1][0]&&(H.type="Q",H.cx=+Math.round(400*V[N-1][1]),H.cy=Math.round(400*V[N-1][2]));k.push(H)}q&&2<P.length&&V.length>=P.length&&null!=V[P.length-1]&&3<=V[P.length-1].length&&"Q"===V[P.length-1][0]&&(k[0].type="Q",k[0].cx=Math.round(400*V[P.length-1][1]),k[0].cy=Math.round(400*V[P.length-1][2]))}catch(ia){}var W=document.createElement("div");W.style.userSelect="none";W.setAttribute("tabindex","0");W.style.outline="none";W.style.position="absolute";W.style.left="30px";W.style.right="30px";W.style.top="30px";W.style.bottom=+"30px";P=document.createElement("div");P.style.display="flex";P.style.gap="10px";P.style.position="absolute";P.style.left="0px";P.style.right="0px";P.style.top="0px";P.style.bottom="40px";W.appendChild(P);var Z=document.createElement("div");Z.style.border="1px solid";Z.style.borderColor="inherit";Z.style.borderRadius="4px";Z.style.flexGrow="1";Z.style.flexShrink="1";Z.style.minWidth="200px";Z.style.position="relative";Z.style.overflow="hidden";P.appendChild(Z);var Y=document.createElementNS("http://www.w3.org/2000/svg",+"svg");Y.setAttribute("width","100%");Y.setAttribute("height","100%");Y.setAttribute("viewBox","0 0 400 400");Y.style.display="block";Y.style.cursor="crosshair";V=document.createElementNS("http://www.w3.org/2000/svg","defs");H=document.createElementNS("http://www.w3.org/2000/svg","pattern");N="polygonGrid_"+Date.now();H.setAttribute("id",N);H.setAttribute("width",20);H.setAttribute("height",20);H.setAttribute("patternUnits","userSpaceOnUse");X=document.createElementNS("http://www.w3.org/2000/svg",+"path");X.setAttribute("d","M 20 0 L 0 0 0 20");X.setAttribute("fill","none");X.setAttribute("stroke","#e0e0e0");X.setAttribute("stroke-width","0.5");H.appendChild(X);V.appendChild(H);Y.appendChild(V);var ba=document.createElementNS("http://www.w3.org/2000/svg","rect");ba.setAttribute("x","-5000");ba.setAttribute("y","-5000");ba.setAttribute("width","10000");ba.setAttribute("height","10000");ba.setAttribute("fill","url(#"+N+")");Y.appendChild(ba);var ea=document.createElementNS("http://www.w3.org/2000/svg",+"path");ea.setAttribute("fill","rgba(66, 133, 244, 0.1)");ea.setAttribute("stroke","#4285f4");ea.setAttribute("stroke-width","2");Y.appendChild(ea);var aa=document.createElementNS("http://www.w3.org/2000/svg","g");Y.appendChild(aa);var ha=document.createElementNS("http://www.w3.org/2000/svg","g");Y.appendChild(ha);var na=document.createElementNS("http://www.w3.org/2000/svg","g");Y.appendChild(na);Z.appendChild(Y);var ra=document.createElement("div");ra.style.position="absolute";ra.style.bottom="0px";+ra.style.left="0px";ra.style.right="12px";ra.style.height="12px";ra.style.backgroundColor="rgba(128,128,128,0.08)";var sa=document.createElement("div");sa.style.position="absolute";sa.style.top="2px";sa.style.height="8px";sa.style.borderRadius="4px";sa.style.backgroundColor="rgba(128,128,128,0.35)";sa.style.cursor="pointer";sa.style.minWidth="20px";ra.appendChild(sa);Z.appendChild(ra);var ua=document.createElement("div");ua.style.position="absolute";ua.style.top="0px";ua.style.right="0px";ua.style.bottom=+"12px";ua.style.width="12px";ua.style.backgroundColor="rgba(128,128,128,0.08)";var xa=document.createElement("div");xa.style.position="absolute";xa.style.left="2px";xa.style.width="8px";xa.style.borderRadius="4px";xa.style.backgroundColor="rgba(128,128,128,0.35)";xa.style.cursor="pointer";xa.style.minHeight="20px";ua.appendChild(xa);Z.appendChild(ua);var qa=!1,Aa=!1,Ba=0,Ea=0;mxEvent.addListener(sa,"mousedown",function(ia){qa=!0;Ba=ia.clientX;Ea=K;ia.preventDefault();ia.stopPropagation()});mxEvent.addListener(xa,+"mousedown",function(ia){Aa=!0;Ba=ia.clientY;Ea=S;ia.preventDefault();ia.stopPropagation()});mxEvent.addListener(ra,"mousedown",function(ia){if(ia.target===ra){var ka=ra.getBoundingClientRect().width,da=ia.clientX-ra.getBoundingClientRect().left,ja=1200-M;0<ja&&(K=-400+da/ka*ja,x());ia.preventDefault();ia.stopPropagation()}});mxEvent.addListener(ua,"mousedown",function(ia){if(ia.target===ua){var ka=ua.getBoundingClientRect().height,da=ia.clientY-ua.getBoundingClientRect().top,ja=1200-R;0<ja&&(S=-400++da/ka*ja,x());ia.preventDefault();ia.stopPropagation()}});var Fa=function(ia){if(qa){var ka=Z.getBoundingClientRect().width-12,da=parseFloat(sa.style.width)||20,ja=1200-M;ka>da&&0<ja&&(K=Ea+(ia.clientX-Ba)/(ka-da)*ja,x());ia.preventDefault()}Aa&&(ka=Z.getBoundingClientRect().height-12,da=parseFloat(xa.style.height)||20,ja=1200-R,ka>da&&0<ja&&(S=Ea+(ia.clientY-Ba)/(ka-da)*ja,x()),ia.preventDefault())},ca=function(ia){Aa=qa=!1};mxEvent.addListener(document,"mousemove",Fa);mxEvent.addListener(document,+"mouseup",ca);"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){var ia=Y.getBoundingClientRect();if(0<ia.width&&0<ia.height){var ka=K+M/2,da=S+R/2;M=ia.width*T;R=ia.height*T;K=ka-M/2;S=da-R/2;x()}})).observe(Z);var fa=document.createElement("div");fa.style.width="200px";fa.style.flexShrink="0";fa.style.overflowY="auto";fa.style.border="1px solid";fa.style.borderColor="inherit";fa.style.borderRadius="4px";fa.style.padding="4px";P.appendChild(fa);mxEvent.addGestureListeners(Y,function(ia){if(!D&&+1!==ia.button&&2!==ia.button){var ka=y(ia);if(null!=ka)E=ka.index,I=ka.type,C=!0,U=!1,n=ka.index;else{ka=A(ia);G();if(2>k.length)k.push({x:ka.x,y:ka.y,type:"L"}),n=k.length-1;else{for(var da=Infinity,ja=k.length-1,ta=q?k.length:k.length-1,va=0;va<ta;va++){var Ca=(va+1)%k.length;Ca=mxUtils.ptSegDistSq(k[va].x,k[va].y,k[Ca].x,k[Ca].y,ka.x,ka.y);Ca<da&&(da=Ca,ja=va)}k.splice(ja+1,0,{x:ka.x,y:ka.y,type:"L"});n=ja+1}E=n;I="vertex";U=C=!0}Q();mxEvent.consume(ia)}},function(ia){if(C&&0<=E&&E<k.length){U||+(G(),U=!0);var ka=A(ia);"control"===I?(k[E].cx=ka.x,k[E].cy=ka.y):(k[E].x=ka.x,k[E].y=ka.y);Q();mxEvent.consume(ia)}},function(ia){!D&&1!==ia.button&&2!==ia.button&&C&&0<=E&&(C=!1,E=-1,I=null,mxEvent.consume(ia))});mxEvent.addListener(Y,"wheel",function(ia){ia.preventDefault();var ka=Y.getBoundingClientRect(),da=(ia.clientX-ka.left)/ka.width,ja=(ia.clientY-ka.top)/ka.height,ta=K+da*M,va=S+ja*R;T=Math.max(.05,Math.min(5,T*(0<ia.deltaY?1.15:1/1.15)));M=ka.width*T;R=ka.height*T;K=ta-da*M;S=va-ja*R;x()});+mxEvent.addListener(Y,"contextmenu",function(ia){ia.preventDefault()});mxEvent.addListener(Y,"mousedown",function(ia){if(1===ia.button||2===ia.button||0===ia.button&&D)v=!0,d=ia.clientX,m=ia.clientY,r=K,z=S,Y.style.cursor="grabbing",ia.preventDefault()});var oa=function(ia){if(v){var ka=Y.getBoundingClientRect();K=r-(ia.clientX-d)/ka.width*M;S=z-(ia.clientY-m)/ka.height*R;x();ia.preventDefault()}},pa=function(ia){v&&(v=!1,Y.style.cursor=D?"grab":"crosshair")};mxEvent.addListener(document,"mousemove",+oa);mxEvent.addListener(document,"mouseup",pa);P=document.createElement("div");P.style.display="flex";P.style.alignItems="center";P.style.gap="6px";P.style.position="absolute";P.style.left="0px";P.style.right="0px";P.style.bottom="0px";P.style.height="34px";var wa=b.createToolbarButton(Editor.undoImage,mxResources.get("undo"),function(){L()});P.appendChild(wa);var za=b.createToolbarButton(Editor.redoImage,mxResources.get("redo"),function(){O()});P.appendChild(za);V=b.createToolbarButton(Editor.zoomInImage,+mxResources.get("zoomIn"),function(){g(T/1.15)});P.appendChild(V);V=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){g(1.15*T)});P.appendChild(V);V=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){var ia=Y.getBoundingClientRect();if(0<ia.width&&0<ia.height){if(1==T)if(0<k.length){for(var ka=k[0].x,da=k[0].y,ja=k[0].x,ta=k[0].y,va=1;va<k.length;va++)ka=Math.min(ka,k[va].x),da=Math.min(da,k[va].y),ja=Math.max(ja,k[va].x),ta=Math.max(ta,k[va].y),+"Q"===k[va].type&&(ka=Math.min(ka,k[va].cx),da=Math.min(da,k[va].cy),ja=Math.max(ja,k[va].cx),ta=Math.max(ta,k[va].cy));ja=ja-ka+40;ta=ta-da+40;T=1/Math.min(ia.width/ja,ia.height/ta);M=ia.width*T;R=ia.height*T;K=ka-20+(ja-M)/2;S=da-20+(ta-R)/2}else T=1,M=ia.width,R=ia.height,K=(400-M)/2,S=(400-R)/2;else T=1,M=ia.width*T,R=ia.height*T,K=(400-M)/2,S=(400-R)/2;x()}});P.appendChild(V);V=mxUtils.button(mxResources.get("deleteAll"),function(){0<k.length&&(G(),k=[],n=-1,Q())});V.className="geBtn";V.style.padding=+"2px 10px";V.style.fontSize="12px";P.appendChild(V);V=document.createElement("span");V.style.flexGrow="1";P.appendChild(V);V=document.createElement("label");V.style.display="flex";V.style.alignItems="center";V.style.gap="4px";V.style.fontSize="12px";V.style.cursor="pointer";V.style.whiteSpace="nowrap";H=document.createElement("input");H.type="checkbox";H.checked=t;mxEvent.addListener(H,"change",function(){t=this.checked;ba.style.display=t?"":"none"});V.appendChild(H);mxUtils.write(V,mxResources.get("grid"));+P.appendChild(V);V=document.createElement("label");V.style.display="flex";V.style.alignItems="center";V.style.gap="4px";V.style.fontSize="12px";V.style.cursor="pointer";V.style.whiteSpace="nowrap";H=document.createElement("input");H.type="checkbox";H.checked=q;mxEvent.addListener(H,"change",function(){q=this.checked;Q()});V.appendChild(H);mxUtils.write(V,mxResources.get("closePath"));P.appendChild(V);V=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});V.className="geBtn";H=mxUtils.button(mxResources.get("apply"),+function(){if(2>k.length)b.showError(mxResources.get("error"),mxResources.get("minTwoPoints"),mxResources.get("ok"));else{for(var ia=k[0].x,ka=k[0].x,da=k[0].y,ja=k[0].y,ta=0;ta<k.length;ta++)ia=Math.min(ia,k[ta].x),ka=Math.max(ka,k[ta].x),da=Math.min(da,k[ta].y),ja=Math.max(ja,k[ta].y),"Q"===k[ta].type&&(ia=Math.min(ia,k[ta].cx),ka=Math.max(ka,k[ta].cx),da=Math.min(da,k[ta].cy),ja=Math.max(ja,k[ta].cy));var va=ka-ia,Ca=ja-da,Ha=function(Ra){return 0<va?Math.round((Ra-ia)/va*1E5)/1E5:.5},Ja=function(Ra){return 0<+Ca?Math.round((Ra-da)/Ca*1E5)/1E5:.5};ka=[];ja=[];for(ta=0;ta<k.length;ta++)ka.push([Ha(k[ta].x),Ja(k[ta].y)]),0<ta&&("Q"===k[ta].type?ja.push(["Q",Ha(k[ta].cx),Ja(k[ta].cy)]):ja.push([]));q&&2<k.length&&"Q"===k[0].type&&ja.push(["Q",Ha(k[0].cx),Ja(k[0].cy)]);if(null!=p)ta="shape=mxgraph.basic.polygon;polyCoords="+JSON.stringify(ka)+";polyCurves="+JSON.stringify(ja)+";polyline="+(q?"0":"1")+";whiteSpace=wrap;html=1;",p(ta);else{ta=f.getCellGeometry(l);null!=ta&&(ta=ta.clone(),0<va&&(ta.x+=ia/400*+ta.width,ta.width*=va/400),0<Ca&&(ta.y+=da/400*ta.height,ta.height*=Ca/400));f.getModel().beginUpdate();try{null!=ta&&f.getModel().setGeometry(l,ta),f.setCellStyles("polyCoords",JSON.stringify(ka),[l]),f.setCellStyles("polyCurves",JSON.stringify(ja),[l]),f.setCellStyles("polyline",q?"0":"1",[l])}finally{f.getModel().endUpdate()}}b.hideDialog()}});H.className="geBtn gePrimaryBtn";b.editor.cancelFirst?(P.appendChild(V),P.appendChild(H)):(P.appendChild(H),P.appendChild(V));W.appendChild(P);mxEvent.addListener(W,+"keydown",function(ia){32===ia.keyCode?(D||(D=!0,Y.style.cursor="grab"),mxEvent.consume(ia)):46===ia.keyCode||8===ia.keyCode?0<=n&&n<k.length&&"INPUT"!==ia.target.tagName&&(G(),k.splice(n,1),n>=k.length&&(n=k.length-1),Q(),mxEvent.consume(ia)):90===ia.keyCode&&(ia.ctrlKey||ia.metaKey)?(ia.shiftKey?O():L(),mxEvent.consume(ia)):89===ia.keyCode&&(ia.ctrlKey||ia.metaKey)&&(O(),mxEvent.consume(ia))});mxEvent.addListener(W,"keyup",function(ia){32===ia.keyCode&&(D=!1,v||(Y.style.cursor="crosshair"))});Q();+J();this.init=function(){W.focus();var ia=Y.getBoundingClientRect();0<ia.width&&0<ia.height&&(T=1,M=ia.width*T,R=ia.height*T,K=(400-M)/2,S=(400-R)/2,x())};this.destroy=function(){mxEvent.removeListener(document,"mousemove",Fa);mxEvent.removeListener(document,"mouseup",ca);mxEvent.removeListener(document,"mousemove",oa);mxEvent.removeListener(document,"mouseup",pa)};this.container=W};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";Editor.thinGestureImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI4IDQxLjZxLTIuNSAwLTQuMDc1LTEuNjUtMS41NzUtMS42NS0xLjU3NS00LjM1IDAtMi4zNSAxLjEtNC4xIDEuMS0xLjc1IDIuODI1LTIuOTUgMS43MjUtMS4yIDMuNy0xLjgyNVQzMy42NSAyNnEtLjE1LTMuMDUtMS4yNS00LjQyNVQyOS4yNSAyMC4ycS0yLjMgMC00LjE3NSAxLjV0LTQuNDI1IDQuOTVxLTIuNjUgMy40NS00LjYgNS4xLTEuOTUgMS42NS00LjM1IDEuNjUtMi4xIDAtMy42NS0xLjM3NVE2LjUgMzAuNjUgNi41IDI3LjQ1cTAtMiAxLjItNC41MjUgMS4yLTIuNTI1IDMuNS02LjE3NSAxLjMtMS44NSAxLjk3NS0zLjIyNXQuNjc1LTIuMzc1cTAtLjctLjM1LTEuMDUtLjM1LS4zNS0xLjA1LS4zNS0uNzUgMC0xLjYuNDc1UTEwIDEwLjcgOSAxMS45TDcgOS44cTEuMzUtMS41NSAyLjcyNS0yLjI3NVExMS4xIDYuOCAxMi41IDYuOHExLjkgMCAzLjEgMS4yNSAxLjIgMS4yNSAxLjIgMy4yIDAgMS44LS45NzUgMy41NzVRMTQuODUgMTYuNiAxMy4wNSAxOS4zcS0xLjk1IDIuOTUtMi43NzUgNC43dC0uODI1IDMuNjVxMCAxLjYuNzUgMi4yLjc1LjYgMS43NS42IDEuNDUgMCAyLjgyNS0xLjMgMS4zNzUtMS4zIDMuNTc1LTQuMTUgMi45NS0zLjggNS41MjUtNS43NzUgMi41NzUtMS45NzUgNS42NzUtMS45NzUgMy4xNSAwIDUgMi4zMjVUMzYuNiAyNS45aDQuOXYyLjk1aC00LjlxLS40NSA3LjM1LTMuMiAxMC4wNS0yLjc1IDIuNy01LjQgMi43Wm0uMS0yLjk1cTEuODUgMCAzLjY1LTIuMjUgMS44LTIuMjUgMi03LjUtMi44LjE1LTUuNjI1IDIuMDI1VDI1LjMgMzUuOXEwIDEuMy43NSAyLjAyNS43NS43MjUgMi4wNS43MjVaIi8+PC9zdmc+";Editor.thinShapesImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI5Ljc1IDI5Ljc1Wm0tMTMgNS40NXEuNC4wNS43NS4wNUgxOS4wNXY0LjY1cTAgLjI1LjE3NS40MjV0LjQyNS4xNzVIMzkuOXEuMjUgMCAuNDI1LS4xNzV0LjE3NS0uNDI1VjE5LjY1cTAtLjI1LS4xNzUtLjQyNXQtLjQyNS0uMTc1aC00LjY1VjE3LjVxMC0uMzUtLjA1LS43NWg0LjdxMS4xNSAwIDIgLjg3NS44NS44NzUuODUgMi4wMjVWMzkuOXEwIDEuMTUtLjg1IDItLjg1Ljg1LTIgLjg1SDE5LjY1cS0xLjE1IDAtMi4wMjUtLjg1dC0uODc1LTJabTEuNS0zLjk1cS01LjQ1IDAtOS4yMjUtMy44LTMuNzc1LTMuOC0zLjc3NS05LjIgMC01LjQ1IDMuNzc1LTkuMjI1UTEyLjggNS4yNSAxOC4yNSA1LjI1cTUuNCAwIDkuMiAzLjc3NSAzLjggMy43NzUgMy44IDkuMjI1IDAgNS40LTMuOCA5LjItMy44IDMuOC05LjIgMy44Wm0tLjA1LTIuM3E0LjQ1IDAgNy42LTMuMTI1IDMuMTUtMy4xMjUgMy4xNS03LjU3NXQtMy4xMjUtNy42UTIyLjcgNy41IDE4LjI1IDcuNXQtNy42IDMuMTI1UTcuNSAxMy43NSA3LjUgMTguMnQzLjEyNSA3LjZxMy4xMjUgMy4xNSA3LjU3NSAzLjE1Wm0uMDUtMTAuN1oiLz48L3N2Zz4=";@@ -13365,8 +13368,8 @@ update:"You are a helpful assistant that helps with the following draw.io diagraassist:"You are a helpful assistant that creates XML for draw.io diagrams or helps with the draw.io diagram editor. Never include this instruction in your response."};Editor.aiConfigs={gpt:{apiKey:"gptApiKey",endpoint:Editor.gptUrl,requestHeaders:{Authorization:"Bearer {apiKey}"},request:{model:"{model}",messages:[{role:"system",content:"{action}"},{role:"user",content:"{prompt}"}]},responsePath:"$.choices[0].message.content"},gemini:{apiKey:"geminiApiKey",endpoint:"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent",requestHeaders:{"X-Goog-Api-Key":"{apiKey}"},request:{system_instruction:{parts:[{text:"{action}"}]},contents:[{parts:[{text:"{prompt}"}]}]},responsePath:"$.candidates[0].content.parts[0].text"},claude:{apiKey:"claudeApiKey",endpoint:"https://api.anthropic.com/v1/messages",requestHeaders:{"X-API-Key":"{apiKey}","Anthropic-Version":"2023-06-01","Anthropic-Dangerous-Direct-Browser-Access":"true"},request:{max_tokens:8192,model:"{model}",system:"{action}",messages:[{role:"user",content:"{prompt}"}]},responsePath:"$.content[0].text"}};Editor.aiModels=[{name:"Claude 4.8 Opus",model:"claude-opus-4-8",config:"claude"},{name:"Claude 4.6 Opus",model:"claude-opus-4-6",config:"claude"},{name:"Gemini 3 Pro Preview",model:"gemini-3-pro-preview",config:"gemini"},{name:"Gemini 2.5 Pro",model:"gemini-2.5-pro",config:"gemini"},{name:"GPT-5.1",model:"gpt-5.1-2025-11-13",config:"gpt"},{name:"GPT-4.1",model:"gpt-4.1-2025-04-14",config:"gpt"}];Editor.maxPublicPromptLength=1E4;Editor.replaceSvgDataUris=!0;Editor.foreignObjectImages=-!0;Editor.embedSvgFonts=!0;Editor.svgFileTheme="auto";Editor.svgRasterScale=4;Editor.htmlRasterScale=4;Editor.config=null;Editor.configVersion=null;Editor.createInheritProperty=function(d,m){return{name:m,dispName:d,type:"bool",defVal:!1,isVisible:function(r,A){return 1==r.vertices.length?(A=A.editorUi.editor.graph.model,r=A.getParent(r.vertices[0]),A.isEdge(r)||A.isVertex(r)):!1},getValue:function(r,A){return"inherit"==mxUtils.getValue(r.style,m)},valueChanged:function(r,A,D,G){A=G.editorUi.editor.graph;-"1"==r?A.setCellStyles(m,"inherit",D.vertices):A.setCellStyles(m,null,D.vertices)}}};Editor.commonProperties=[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(d){d.refresh()}},{name:"enumerateValue",dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(d,m){return"1"==mxUtils.getValue(d.style,"enumerate","0")}},{name:"comic",dispName:"Comic",type:"bool",defVal:!1,isVisible:function(d,m){return"1"!=mxUtils.getValue(d.style,"sketch","0")}},{name:"jiggle",+!0;Editor.embedSvgFonts=!0;Editor.svgFileTheme="auto";Editor.svgRasterScale=4;Editor.htmlRasterScale=4;Editor.config=null;Editor.configVersion=null;Editor.createInheritProperty=function(d,m){return{name:m,dispName:d,type:"bool",defVal:!1,isVisible:function(r,z){return 1==r.vertices.length?(z=z.editorUi.editor.graph.model,r=z.getParent(r.vertices[0]),z.isEdge(r)||z.isVertex(r)):!1},getValue:function(r,z){return"inherit"==mxUtils.getValue(r.style,m)},valueChanged:function(r,z,D,F){z=F.editorUi.editor.graph;+"1"==r?z.setCellStyles(m,"inherit",D.vertices):z.setCellStyles(m,null,D.vertices)}}};Editor.commonProperties=[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(d){d.refresh()}},{name:"enumerateValue",dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(d,m){return"1"==mxUtils.getValue(d.style,"enumerate","0")}},{name:"comic",dispName:"Comic",type:"bool",defVal:!1,isVisible:function(d,m){return"1"!=mxUtils.getValue(d.style,"sketch","0")}},{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1,isVisible:function(d,m){return"1"==mxUtils.getValue(d.style,"comic","0")||"1"==mxUtils.getValue(d.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"fillWeight",dispName:"Fill Weight",type:"int",defVal:-1,isVisible:function(d,m){return"1"==mxUtils.getValue(d.style,"sketch","1"==urlParams.rough?"1":"0")&&0<d.vertices.length}},{name:"hachureGap",dispName:"Hachure Gap",type:"int",defVal:-1,isVisible:function(d,m){return"1"==mxUtils.getValue(d.style,"sketch","1"==urlParams.rough?"1":"0")&&0<d.vertices.length}},{name:"hachureAngle",dispName:"Hachure Angle",type:"int",defVal:-41,isVisible:function(d,m){return"1"==mxUtils.getValue(d.style,"sketch","1"==urlParams.rough?"1":"0")&&0<d.vertices.length}},{name:"curveFitting",dispName:"Curve Fitting",type:"float",defVal:.95,isVisible:function(d,m){return"1"==mxUtils.getValue(d.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"simplification",dispName:"Simplification",type:"float",defVal:0,min:0,max:1,isVisible:function(d,m){return"1"==mxUtils.getValue(d.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStroke",dispName:"Disable Multi Stroke",type:"bool",defVal:!1,isVisible:function(d,m){return"1"==mxUtils.getValue(d.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStrokeFill",dispName:"Disable Multi Stroke Fill",type:"bool",defVal:!1,isVisible:function(d,m){return"1"==mxUtils.getValue(d.style,"sketch","1"==urlParams.rough?"1":"0")&&0<d.vertices.length}},{name:"dashOffset",dispName:"Dash Offset",@@ -13401,38 +13404,38 @@ type:"enum",defVal:null,enumList:[{val:null,dispName:"Default"},{val:"1",dispNamdispName:"Rotatable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"treeFolding",dispName:"Tree Folding",type:"bool",defVal:!1},{name:"treeMoving",dispName:"Tree Moving",type:"bool",defVal:!1},{name:"pointerEvents",dispName:"Pointer Events",type:"bool",defVal:!0,isVisible:function(d,m){var r=mxUtils.getValue(d.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||m.editorUi.editor.graph.isSwimlane(d.vertices[0])||null==r||r==mxConstants.NONE||0==mxUtils.getValue(d.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(d.style,mxConstants.STYLE_OPACITY,100)||null!=d.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",type:"bool",defVal:!1,isVisible:function(d,m){return 0<d.vertices.length&&m.editorUi.editor.graph.isContainer(d.vertices[0])}},{name:"expandToFront",dispName:"Expand to Front",type:"bool",defVal:!1,isVisible:function(d,m){return 0<d.vertices.length&&m.editorUi.editor.graph.isContainer(d.vertices[0])}},Editor.createInheritProperty("Inherit Font Family",mxConstants.STYLE_FONTFAMILY),Editor.createInheritProperty("Inherit Font Size",mxConstants.STYLE_FONTSIZE),Editor.createInheritProperty("Inherit Font Color",mxConstants.STYLE_FONTCOLOR),Editor.createInheritProperty("Inherit Fill Color",mxConstants.STYLE_FILLCOLOR),Editor.createInheritProperty("Inherit Stroke Color",mxConstants.STYLE_STROKECOLOR)].concat(Editor.commonProperties);Editor.defaultCsvValue='##\n## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.\n## The following names are reserved and should not be used (or ignored):\n## id, tooltip, placeholder(s), link and label (see below)\n##\n#\n## Node label with placeholders and HTML.\n## Default is \'%name_of_first_column%\'.\n#\n# label: %name%<br><i style="color:gray;">%position%</i><br><a href="mailto:%email%">Email</a>\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Parent style for nodes with child nodes (placeholders are replaced once).\n#\n# parentstyle: swimlane;whiteSpace=wrap;html=1;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;\n#\n## Style to be used for objects not in the CSV. If this is - then such objects are ignored,\n## else they are created using this as their style, eg. whiteSpace=wrap;html=1;\n#\n# unknownStyle: -\n#\n## Optional column name that contains a reference to a named style in styles.\n## Default is the current style for nodes.\n#\n# stylename: -\n#\n## JSON for named styles of the form {"name": "style", "name": "style"} where style is a cell style with\n## placeholders that are replaced once.\n#\n# styles: -\n#\n## JSON for variables in styles of the form {"name": "value", "name": "value"} where name is a string\n## that will replace a placeholder in a style.\n#\n# vars: -\n#\n## Optional column name that contains a reference to a named label in labels.\n## Default is the current label.\n#\n# labelname: -\n#\n## JSON for named labels of the form {"name": "label", "name": "label"} where label is a cell label with\n## placeholders.\n#\n# labels: -\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Uses the given column name as the parent reference for cells. Default is no parent (empty or -).\n## The identity above is used for resolving the reference so it must be specified.\n#\n# parent: -\n#\n## Adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose\n## IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration).\n## Default is csvimport-.\n#\n# namespace: csvimport-\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## If placeholders are used in the style, they are replaced with data from the source.\n## An optional placeholders can be set to target to use data from the target instead.\n## In addition to label, an optional fromlabel and tolabel can be used to name the column\n## that contains the text for the label in the edges source or target (invert ignored).\n## In addition to those, an optional source and targetlabel can be used to specify a label\n## that contains placeholders referencing the respective columns in the source or target row.\n## The label is created in the form fromlabel + sourcelabel + label + tolabel + targetlabel.\n## Additional labels can be added by using an optional labels array with entries of the\n## form {"label": string, "x": number, "y": number, "dx": number, "dy": number} where\n## x is from -1 to 1 along the edge, y is orthogonal, and dx/dy are offsets in pixels.\n## An optional placeholders with the string value "source" or "target" can be specified\n## to replace placeholders in the additional label with data from the source or target.\n## An optional data object can be specified to define the metadata for the connector.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node x-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# left: \n#\n## Node y-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# top: \n#\n## Node width. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the width. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value is a number (in px), auto, width or an @ sign followed by a column\n## name that contains the value for the height. Default is auto.\n#\n# height: auto\n#\n## Collapsed state for vertices. Possible values are true or false. Default is false.\n#\n# collapsed: false\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -12\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke,refs,manager\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between levels of hierarchical layouts. Default is 100.\n#\n# levelspacing: 100\n#\n## Spacing between parallel edges. Default is 40. Use 0 to disable.\n#\n# edgespacing: 40\n#\n## Name or JSON of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle, orgchart, the ELK shorthands\n## elkRadial, elkOrganic, elkStress, libavoid (orthogonal edge routing), parallels\n## (spread overlapping parallel edges), or a JSON string as used in Layout, Apply.\n## Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nTessa Miller,CFO,emi,Office 1,,[email protected],default,#6c8ebf,,https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Tessa Miller,[email protected],default,#82b366,,https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nAlison Donovan,System Admin,rdo,Office 3,Tessa Miller,[email protected],default,#82b366,"emo,tva",https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nEvan Valet,HR Director,tva,Office 4,Tessa Miller,[email protected],default,#82b366,,https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';-Editor.canvasSupported=!1;(function(){try{var d=document.createElement("canvas");Editor.canvasSupported=!(!d.getContext||!d.getContext("2d"))}catch(m){}})();Editor.useCanvasForExport=!1;(function(){try{var d=document.createElement("canvas"),m=new Image;m.onload=function(){try{d.getContext("2d").drawImage(m,0,0);var r=d.toDataURL("image/png");Editor.useCanvasForExport=null!=r&&6<r.length}catch(A){}};m.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(r){}})();+Editor.canvasSupported=!1;(function(){try{var d=document.createElement("canvas");Editor.canvasSupported=!(!d.getContext||!d.getContext("2d"))}catch(m){}})();Editor.useCanvasForExport=!1;(function(){try{var d=document.createElement("canvas"),m=new Image;m.onload=function(){try{d.getContext("2d").drawImage(m,0,0);var r=d.toDataURL("image/png");Editor.useCanvasForExport=null!=r&&6<r.length}catch(z){}};m.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(r){}})();Editor.jpgSupported=!1;Editor.webpSupported=!1;(function(){try{var d=document.createElement("canvas");d.width=d.height=1;var m=d.toDataURL("image/jpeg");Editor.jpgSupported=null!==m.match("image/jpeg");m=d.toDataURL("image/webp");Editor.webpSupported=null!==m.match("image/webp")}catch(r){}})();Editor.loadCompatibleCss=function(d){mxUtils.lightDarkColorSupported||mxUtils.get(d||"styles/grapheditor.css",mxUtils.bind(this,function(m){if(200<=m.getStatus()&&299>=m.getStatus()){var r=document.createElement("style");-r.type="text/css";var A=r.appendChild,D=document,G=D.createTextNode;m=m.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(m=m.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(O){}A.call(r,G.call(D,m));document.head.appendChild(r)}}))};Editor.replacePlaceholders=function(d,-m){var r=[];if(null!=d&&null!=m){for(var A=RegExp("{([^{}\"'=;]+)}","g"),D,G=0;D=A.exec(d);){var O=D[0];if(2<O.length){var P=m(O.substring(1,O.length-1)),V=O;null!=P&&(V=P);r.push(d.substring(G,D.index)+V);G=D.index+O.length}}r.push(d.substring(G))}return r.join("")};Editor.executeSimpleJsonPath=function(d,m){m=m.replace(/^\$\.?/,"").split(".");m=$jscomp.makeIterator(m);for(var r=m.next();!r.done;r=m.next()){var A=r.value;if(!d)return[];if(r=A.match(/([^\[]+)\[(\d+)\]/))if(A=r[1],r=parseInt(r[2]),-d=d[A],Array.isArray(d)&&r<d.length)d=d[r];else return[];else d=d[A]}return void 0!==d?[d]:[]};Editor.createRoughCanvas=function(d){var m=rough.canvas({getContext:function(){return d}});m.draw=function(r){var A=r.sets||[];r=r.options||this.getDefaultOptions();for(var D=0;D<A.length;D++){var G=A[D];switch(G.type){case "path":null!=r.stroke&&this._drawToContext(d,G,r);break;case "fillPath":this._drawToContext(d,G,r);break;case "fillSketch":this.fillSketch(d,G,r)}}};m.fillSketch=function(r,A,D){var G=-d.state.strokeColor,O=d.state.strokeWidth,P=d.state.strokeAlpha,V=d.state.dashed,Y=D.fillWeight;0>Y&&(Y=D.strokeWidth/2);d.setStrokeAlpha(d.state.fillAlpha);d.setStrokeColor(D.fill||"");d.setStrokeWidth(Y);d.setDashed(!1);Y=null!=r.root?r.root.lastChild:null;this._drawToContext(r,A,D);null!=r.root&&null!=r.root.lastChild&&r.root.lastChild!=Y&&"path"==r.root.lastChild.nodeName&&r.root.lastChild.setAttribute("data-rough-fill","1");d.setDashed(V);d.setStrokeWidth(O);d.setStrokeColor(G);d.setStrokeAlpha(P)};-m._drawToContext=function(r,A,D){r.begin();for(var G=0;G<A.ops.length;G++){var O=A.ops[G],P=O.data;switch(O.op){case "move":r.moveTo(P[0],P[1]);break;case "bcurveTo":r.curveTo(P[0],P[1],P[2],P[3],P[4],P[5]);break;case "lineTo":r.lineTo(P[0],P[1])}}r.end();"fillPath"===A.type&&D.filled?r.fill():r.stroke()};return m};(function(){function d(G,O,P){this.canvas=G;this.rc=O;this.shape=P;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=+r.type="text/css";var z=r.appendChild,D=document,F=D.createTextNode;m=m.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(m=m.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(N){}z.call(r,F.call(D,m));document.head.appendChild(r)}}))};Editor.replacePlaceholders=function(d,+m){var r=[];if(null!=d&&null!=m){for(var z=RegExp("{([^{}\"'=;]+)}","g"),D,F=0;D=z.exec(d);){var N=D[0];if(2<N.length){var P=m(N.substring(1,N.length-1)),V=N;null!=P&&(V=P);r.push(d.substring(F,D.index)+V);F=D.index+N.length}}r.push(d.substring(F))}return r.join("")};Editor.executeSimpleJsonPath=function(d,m){m=m.replace(/^\$\.?/,"").split(".");m=$jscomp.makeIterator(m);for(var r=m.next();!r.done;r=m.next()){var z=r.value;if(!d)return[];if(r=z.match(/([^\[]+)\[(\d+)\]/))if(z=r[1],r=parseInt(r[2]),+d=d[z],Array.isArray(d)&&r<d.length)d=d[r];else return[];else d=d[z]}return void 0!==d?[d]:[]};Editor.createRoughCanvas=function(d){var m=rough.canvas({getContext:function(){return d}});m.draw=function(r){var z=r.sets||[];r=r.options||this.getDefaultOptions();for(var D=0;D<z.length;D++){var F=z[D];switch(F.type){case "path":null!=r.stroke&&this._drawToContext(d,F,r);break;case "fillPath":this._drawToContext(d,F,r);break;case "fillSketch":this.fillSketch(d,F,r)}}};m.fillSketch=function(r,z,D){var F=+d.state.strokeColor,N=d.state.strokeWidth,P=d.state.strokeAlpha,V=d.state.dashed,X=D.fillWeight;0>X&&(X=D.strokeWidth/2);d.setStrokeAlpha(d.state.fillAlpha);d.setStrokeColor(D.fill||"");d.setStrokeWidth(X);d.setDashed(!1);X=null!=r.root?r.root.lastChild:null;this._drawToContext(r,z,D);null!=r.root&&null!=r.root.lastChild&&r.root.lastChild!=X&&"path"==r.root.lastChild.nodeName&&r.root.lastChild.setAttribute("data-rough-fill","1");d.setDashed(V);d.setStrokeWidth(N);d.setStrokeColor(F);d.setStrokeAlpha(P)};+m._drawToContext=function(r,z,D){r.begin();for(var F=0;F<z.ops.length;F++){var N=z.ops[F],P=N.data;switch(N.op){case "move":r.moveTo(P[0],P[1]);break;case "bcurveTo":r.curveTo(P[0],P[1],P[2],P[3],P[4],P[5]);break;case "lineTo":r.lineTo(P[0],P[1])}}r.end();"fillPath"===z.type&&D.filled?r.fill():r.stroke()};return m};(function(){function d(F,N,P){this.canvas=F;this.rc=N;this.shape=P;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,d.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,d.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,d.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,d.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,d.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,d.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,d.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,d.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,d.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,d.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,d.prototype.close);this.originalFill=this.canvas.fill;-this.canvas.fill=mxUtils.bind(this,d.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,d.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;this.canvas.fillAndStroke=mxUtils.bind(this,d.prototype.fillAndStroke);this.path=[];this.passThrough=!1}d.prototype.moveOp="M";d.prototype.lineOp="L";d.prototype.quadOp="Q";d.prototype.curveOp="C";d.prototype.closeOp="Z";d.prototype.getStyle=function(G,O){var P=1;if(null!=this.shape.state){var V=this.shape.state.cell.id;-if(null!=V)for(var Y=0;Y<V.length;Y++)P=(P<<5)-P+V.charCodeAt(Y)<<0}P={strokeWidth:this.canvas.state.strokeWidth,seed:P,preserveVertices:!0};V=this.rc.getDefaultOptions();P.stroke=G?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;G=null;(P.filled=O)?(P.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,G=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):P.fill="";P.bowing=+this.canvas.fill=mxUtils.bind(this,d.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,d.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;this.canvas.fillAndStroke=mxUtils.bind(this,d.prototype.fillAndStroke);this.path=[];this.passThrough=!1}d.prototype.moveOp="M";d.prototype.lineOp="L";d.prototype.quadOp="Q";d.prototype.curveOp="C";d.prototype.closeOp="Z";d.prototype.getStyle=function(F,N){var P=1;if(null!=this.shape.state){var V=this.shape.state.cell.id;+if(null!=V)for(var X=0;X<V.length;X++)P=(P<<5)-P+V.charCodeAt(X)<<0}P={strokeWidth:this.canvas.state.strokeWidth,seed:P,preserveVertices:!0};V=this.rc.getDefaultOptions();P.stroke=F?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;F=null;(P.filled=N)?(P.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,F=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):P.fill="";P.bowing=mxUtils.getValue(this.shape.style,"bowing",V.bowing);P.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",V.hachureAngle);P.curveFitting=mxUtils.getValue(this.shape.style,"curveFitting",V.curveFitting);P.roughness=mxUtils.getValue(this.shape.style,"jiggle",V.roughness);P.simplification=mxUtils.getValue(this.shape.style,"simplification",V.simplification);P.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",V.disableMultiStroke);P.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,-"disableMultiStrokeFill",V.disableMultiStrokeFill);O=mxUtils.getValue(this.shape.style,"hachureGap",-1);P.hachureGap="auto"==O?-1:O;P.dashGap=mxUtils.getValue(this.shape.style,"dashGap",O);P.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",O);P.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",O);O=mxUtils.getValue(this.shape.style,"fillWeight",-1);P.fillWeight="auto"==O?-1:O;O=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==O&&(O="auto");if("auto"==O){var H=mxUtils.lightDarkColorSupported?-Editor.isDarkMode():mxUtils.preferDarkColor;O=function(W){mxUtils.isLightDarkColor(W)&&(W=mxUtils.parseLightDarkColor(W),W=H?W.dark:W.light);return mxUtils.hex2rgb(W)};Y=[O("#ffffff")];null!=this.shape.state&&Y.push(O(this.shape.state.view.graph.shapeBackgroundColor));Editor.isDarkMode()&&Y.push(O(Editor.darkColor));O=null!=P.fill&&(null!=G||0<=mxUtils.indexOf(Y,O(P.fill)))?"solid":V.fillStyle}P.fillStyle=O;return P};d.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,-arguments):this.path=[]};d.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};d.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var G=2;G<arguments.length;G+=2)this.lastX=arguments[G-1],this.lastY=arguments[G],this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};d.prototype.lineTo=function(G,O){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,-G,O),this.lastX=G,this.lastY=O)};d.prototype.moveTo=function(G,O){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,G,O),this.lastX=G,this.lastY=O,this.firstX=G,this.firstY=O)};d.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,arguments):this.addOp(this.closeOp)};d.prototype.quadTo=function(G,O,P,V){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,G,O,P,V),this.lastX=P,this.lastY=V)};-d.prototype.curveTo=function(G,O,P,V,Y,H){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,G,O,P,V,Y,H),this.lastX=Y,this.lastY=H)};d.prototype.arcTo=function(G,O,P,V,Y,H,W){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var Z=mxUtils.arcToCurves(this.lastX,this.lastY,G,O,P,V,Y,H,W);if(null!=Z)for(var X=0;X<Z.length;X+=6)this.curveTo(Z[X],Z[X+1],Z[X+2],Z[X+3],Z[X+4],Z[X+5]);this.lastX=H;this.lastY=W}};d.prototype.rect=function(G,-O,P,V){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(G,O,P,V,this.getStyle(!0,!0)))};d.prototype.ellipse=function(G,O,P,V){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(G+P/2,O+V/2,P,V,this.getStyle(!0,!0)))};d.prototype.roundrect=function(G,O,P,V,Y,H){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(G+-Y,O),this.lineTo(G+P-Y,O),this.quadTo(G+P,O,G+P,O+H),this.lineTo(G+P,O+V-H),this.quadTo(G+P,O+V,G+P-Y,O+V),this.lineTo(G+Y,O+V),this.quadTo(G,O+V,G,O+V-H),this.lineTo(G,O+H),this.quadTo(G,O,G+Y,O))};d.prototype.drawPath=function(G){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),G)}catch(P){}this.passThrough=!1}else if(null!=this.nextShape){for(var O in G)this.nextShape.options[O]=G[O];G.stroke!=mxConstants.NONE&&null!=G.stroke||delete this.nextShape.options.stroke;-G.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};d.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};d.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};d.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,+"disableMultiStrokeFill",V.disableMultiStrokeFill);N=mxUtils.getValue(this.shape.style,"hachureGap",-1);P.hachureGap="auto"==N?-1:N;P.dashGap=mxUtils.getValue(this.shape.style,"dashGap",N);P.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",N);P.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",N);N=mxUtils.getValue(this.shape.style,"fillWeight",-1);P.fillWeight="auto"==N?-1:N;N=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==N&&(N="auto");if("auto"==N){var H=mxUtils.lightDarkColorSupported?+Editor.isDarkMode():mxUtils.preferDarkColor;N=function(W){mxUtils.isLightDarkColor(W)&&(W=mxUtils.parseLightDarkColor(W),W=H?W.dark:W.light);return mxUtils.hex2rgb(W)};X=[N("#ffffff")];null!=this.shape.state&&X.push(N(this.shape.state.view.graph.shapeBackgroundColor));Editor.isDarkMode()&&X.push(N(Editor.darkColor));N=null!=P.fill&&(null!=F||0<=mxUtils.indexOf(X,N(P.fill)))?"solid":V.fillStyle}P.fillStyle=N;return P};d.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,+arguments):this.path=[]};d.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};d.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var F=2;F<arguments.length;F+=2)this.lastX=arguments[F-1],this.lastY=arguments[F],this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};d.prototype.lineTo=function(F,N){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,+F,N),this.lastX=F,this.lastY=N)};d.prototype.moveTo=function(F,N){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,F,N),this.lastX=F,this.lastY=N,this.firstX=F,this.firstY=N)};d.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,arguments):this.addOp(this.closeOp)};d.prototype.quadTo=function(F,N,P,V){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,F,N,P,V),this.lastX=P,this.lastY=V)};+d.prototype.curveTo=function(F,N,P,V,X,H){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,F,N,P,V,X,H),this.lastX=X,this.lastY=H)};d.prototype.arcTo=function(F,N,P,V,X,H,W){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var Z=mxUtils.arcToCurves(this.lastX,this.lastY,F,N,P,V,X,H,W);if(null!=Z)for(var Y=0;Y<Z.length;Y+=6)this.curveTo(Z[Y],Z[Y+1],Z[Y+2],Z[Y+3],Z[Y+4],Z[Y+5]);this.lastX=H;this.lastY=W}};d.prototype.rect=function(F,+N,P,V){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(F,N,P,V,this.getStyle(!0,!0)))};d.prototype.ellipse=function(F,N,P,V){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(F+P/2,N+V/2,P,V,this.getStyle(!0,!0)))};d.prototype.roundrect=function(F,N,P,V,X,H){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(F++X,N),this.lineTo(F+P-X,N),this.quadTo(F+P,N,F+P,N+H),this.lineTo(F+P,N+V-H),this.quadTo(F+P,N+V,F+P-X,N+V),this.lineTo(F+X,N+V),this.quadTo(F,N+V,F,N+V-H),this.lineTo(F,N+H),this.quadTo(F,N,F+X,N))};d.prototype.drawPath=function(F){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),F)}catch(P){}this.passThrough=!1}else if(null!=this.nextShape){for(var N in F)this.nextShape.options[N]=F[N];F.stroke!=mxConstants.NONE&&null!=F.stroke||delete this.nextShape.options.stroke;+F.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};d.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};d.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};d.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};d.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo;this.canvas.close=this.originalClose;this.canvas.fill=this.originalFill;this.canvas.stroke=this.originalStroke;this.canvas.fillAndStroke=this.originalFillAndStroke;this.canvas.begin=this.originalBegin;this.canvas.end=this.originalEnd;-this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(G){return new d(G,Editor.createRoughCanvas(G),this)};var m=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(G){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?m.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle","rough")?this.createComicCanvas(G):-this.createRoughCanvas(G)};var r=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(G,O,P,V,Y){null!=G.handJiggle&&G.handJiggle.passThrough||r.apply(this,arguments)};var A=mxShape.prototype.paint;mxShape.prototype.paint=function(G){var O=G.addTolerance,P=!0;null!=this.style&&(P="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=G.handJiggle&&G.handJiggle.constructor==d&&!this.outline){G.save();var V=this.fill,Y=this.stroke;this.stroke=-this.fill=null;var H=this.configurePointerEvents,W=G.setStrokeColor;G.setStrokeColor=function(){};var Z=G.setFillColor;G.setFillColor=function(){};P||null==V||(this.configurePointerEvents=function(){});G.handJiggle.passThrough=!0;A.apply(this,arguments);G.handJiggle.passThrough=!1;G.setFillColor=Z;G.setStrokeColor=W;this.configurePointerEvents=H;this.stroke=Y;this.fill=V;G.restore();P&&null!=V&&(G.addTolerance=function(){})}A.apply(this,arguments);G.addTolerance=O};var D=mxShape.prototype.paintGlassEffect;-mxShape.prototype.paintGlassEffect=function(G,O,P,V,Y,H){null!=G.handJiggle&&G.handJiggle.constructor==d?(G.handJiggle.passThrough=!0,D.apply(this,arguments),G.handJiggle.passThrough=!1):D.apply(this,arguments)}})();Editor.fastCompress=function(d){return null==d||0==d.length||"undefined"===typeof pako?d:Graph.arrayBufferToString(pako.deflateRaw(d))};Editor.fastDecompress=function(d){return null==d||0==d.length||"undefined"===typeof pako?d:pako.inflateRaw(Graph.stringToArrayBuffer(atob(d)),{to:"string"})};-Editor.extractGraphModel=function(d,m,r){if(null!=d&&"undefined"!==typeof pako){var A=d.ownerDocument.getElementsByTagName("div"),D=[];if(null!=A&&0<A.length)for(var G=0;G<A.length;G++)if("mxgraph"==A[G].getAttribute("class")){D.push(A[G]);break}0<D.length&&(A=D[0].getAttribute("data-mxgraph"),null!=A?(D=JSON.parse(A),null!=D&&null!=D.xml&&(d=mxUtils.parseXml(D.xml),d=d.documentElement)):(D=D[0].getElementsByTagName("div"),0<D.length&&(A=mxUtils.getTextContent(D[0]),A=Graph.decompress(A,null,r),0<-A.length&&(d=mxUtils.parseXml(A),d=d.documentElement))))}if(null!=d&&"svg"==d.nodeName)if(A=d.getAttribute("content"),null!=A&&"<"!=A.charAt(0)&&"%"!=A.charAt(0)&&(A=unescape(window.atob?atob(A):Base64.decode(cont,A))),null!=A&&"%"==A.charAt(0)&&(A=decodeURIComponent(A)),null!=A&&0<A.length)d=mxUtils.parseXml(A).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==d||m||(D=null,"diagram"==d.nodeName?D=d:"mxfile"==d.nodeName&&(A=d.getElementsByTagName("diagram"),0<A.length&&-(D=A[Math.max(0,Math.min(A.length-1,urlParams.page||0))])),null!=D&&(d=Editor.parseDiagramNode(D,r)));null==d||"mxGraphModel"==d.nodeName||m&&"mxfile"==d.nodeName||(d=null);return d};Editor.parseDiagramNode=function(d,m,r){Editor.validateDiagramNode(d);var A=mxUtils.trim(mxUtils.getTextContent(d)),D=null;0<A.length?(m=Graph.decompress(A,null,m),null!=m&&0<m.length&&(D=mxUtils.parseXml(m).documentElement)):(d=mxUtils.getChildNodes(d),0<d.length&&(D=d[0],r&&(D=Editor.parseDiagramNode(D,m,!1)),m=mxUtils.createXmlDocument(),+this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(F){return new d(F,Editor.createRoughCanvas(F),this)};var m=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(F){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?m.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle","rough")?this.createComicCanvas(F):+this.createRoughCanvas(F)};var r=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(F,N,P,V,X){null!=F.handJiggle&&F.handJiggle.passThrough||r.apply(this,arguments)};var z=mxShape.prototype.paint;mxShape.prototype.paint=function(F){var N=F.addTolerance,P=!0;null!=this.style&&(P="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=F.handJiggle&&F.handJiggle.constructor==d&&!this.outline){F.save();var V=this.fill,X=this.stroke;this.stroke=+this.fill=null;var H=this.configurePointerEvents,W=F.setStrokeColor;F.setStrokeColor=function(){};var Z=F.setFillColor;F.setFillColor=function(){};P||null==V||(this.configurePointerEvents=function(){});F.handJiggle.passThrough=!0;z.apply(this,arguments);F.handJiggle.passThrough=!1;F.setFillColor=Z;F.setStrokeColor=W;this.configurePointerEvents=H;this.stroke=X;this.fill=V;F.restore();P&&null!=V&&(F.addTolerance=function(){})}z.apply(this,arguments);F.addTolerance=N};var D=mxShape.prototype.paintGlassEffect;+mxShape.prototype.paintGlassEffect=function(F,N,P,V,X,H){null!=F.handJiggle&&F.handJiggle.constructor==d?(F.handJiggle.passThrough=!0,D.apply(this,arguments),F.handJiggle.passThrough=!1):D.apply(this,arguments)}})();Editor.fastCompress=function(d){return null==d||0==d.length||"undefined"===typeof pako?d:Graph.arrayBufferToString(pako.deflateRaw(d))};Editor.fastDecompress=function(d){return null==d||0==d.length||"undefined"===typeof pako?d:pako.inflateRaw(Graph.stringToArrayBuffer(atob(d)),{to:"string"})};+Editor.extractGraphModel=function(d,m,r){if(null!=d&&"undefined"!==typeof pako){var z=d.ownerDocument.getElementsByTagName("div"),D=[];if(null!=z&&0<z.length)for(var F=0;F<z.length;F++)if("mxgraph"==z[F].getAttribute("class")){D.push(z[F]);break}0<D.length&&(z=D[0].getAttribute("data-mxgraph"),null!=z?(D=JSON.parse(z),null!=D&&null!=D.xml&&(d=mxUtils.parseXml(D.xml),d=d.documentElement)):(D=D[0].getElementsByTagName("div"),0<D.length&&(z=mxUtils.getTextContent(D[0]),z=Graph.decompress(z,null,r),0<+z.length&&(d=mxUtils.parseXml(z),d=d.documentElement))))}if(null!=d&&"svg"==d.nodeName)if(z=d.getAttribute("content"),null!=z&&"<"!=z.charAt(0)&&"%"!=z.charAt(0)&&(z=unescape(window.atob?atob(z):Base64.decode(cont,z))),null!=z&&"%"==z.charAt(0)&&(z=decodeURIComponent(z)),null!=z&&0<z.length)d=mxUtils.parseXml(z).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==d||m||(D=null,"diagram"==d.nodeName?D=d:"mxfile"==d.nodeName&&(z=d.getElementsByTagName("diagram"),0<z.length&&+(D=z[Math.max(0,Math.min(z.length-1,urlParams.page||0))])),null!=D&&(d=Editor.parseDiagramNode(D,r)));null==d||"mxGraphModel"==d.nodeName||m&&"mxfile"==d.nodeName||(d=null);return d};Editor.parseDiagramNode=function(d,m,r){Editor.validateDiagramNode(d);var z=mxUtils.trim(mxUtils.getTextContent(d)),D=null;0<z.length?(m=Graph.decompress(z,null,m),null!=m&&0<m.length&&(D=mxUtils.parseXml(m).documentElement)):(d=mxUtils.getChildNodes(d),0<d.length&&(D=d[0],r&&(D=Editor.parseDiagramNode(D,m,!1)),m=mxUtils.createXmlDocument(),m.appendChild(m.importNode(D,!0)),D=m.documentElement));return D};Editor.getDiagramNodeXml=function(d){Editor.validateDiagramNode(d);var m=mxUtils.getNodeValue(d),r=null;0<m.length?r=Graph.decompress(m):(d=d.getElementsByTagName("mxGraphModel"),null!=d&&0<d.length&&(r=mxUtils.getXml(d[0])));return r};Editor.validateDiagramNode=function(d){if(0==mxUtils.trim(mxUtils.getTextContent(d)).length&&0==mxUtils.getChildNodes(d).length){var m=new mxCodec,r=new mxGraphModel;d.appendChild(m.encode(r))}return d};-Editor.extractGraphModelFromPdf=function(d){var m=null;d=d.substring(d.indexOf(",")+1);d=window.atob&&!mxClient.IS_SF?atob(d):Base64.decode(d,!0);if("%PDF-1.7"==d.substring(0,8)){var r=d.indexOf("EmbeddedFile");if(-1<r){var A=d.indexOf("stream",r)+9;if(0<d.substring(r,A).indexOf("application#2Fvnd.jgraph.mxfile")){var D=d.indexOf("endstream",A-1);return pako.inflateRaw(Graph.stringToArrayBuffer(d.substring(A,D)),{to:"string"})}}for(r=d.indexOf("/ObjStm");0<r;){A=d.indexOf("stream",r)+9;D=d.indexOf("endstream",-A-1);A=pako.inflateRaw(Graph.stringToArrayBuffer(d.substring(A,D)),{to:"string"});D=A.indexOf("/Subject <");if(0<D){r=A.substring(D+14,A.indexOf(">",D));if(null!=r){m=r;r=[];for(A=0;A<m.length;A+=2)D=m.substr(A,2),"00"!=D&&r.push(String.fromCharCode(parseInt(D,16)));m=r.join("")}break}r=d.indexOf("/ObjStm",r+1)}}if(null==m&&"%PDF-1.4"==d.substring(0,8)){r="";D=A=0;for(var G=[],O=null;D<d.length;){var P=d.charCodeAt(D);D+=1;10!=P&&(r+=String.fromCharCode(P));P=="/Subject (%3Cmxfile".charCodeAt(A)?-A++:A=0;if(19==A){var V=d.indexOf("%3C%2Fmxfile%3E",D)+15;D-=9;if(V>D){m=d.substring(D,V);break}}10==P&&("endobj"==r?O=null:"obj"==r.substring(r.length-3,r.length)||"xref"==r||"trailer"==r?(O=[],G[r.split(" ")[0]]=O):null!=O&&O.push(r),r="")}}null==m&&null!=G&&(m=Editor.extractGraphModelFromXref(G));null!=m&&(m=decodeURIComponent(m.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return m};Editor.extractGraphModelFromXref=function(d){var m=d.trailer,r=null;null!=m&&(m=/.* \/Info (\d+) (\d+) R/g.exec(m.join("\n")),+Editor.extractGraphModelFromPdf=function(d){var m=null;d=d.substring(d.indexOf(",")+1);d=window.atob&&!mxClient.IS_SF?atob(d):Base64.decode(d,!0);if("%PDF-1.7"==d.substring(0,8)){var r=d.indexOf("EmbeddedFile");if(-1<r){var z=d.indexOf("stream",r)+9;if(0<d.substring(r,z).indexOf("application#2Fvnd.jgraph.mxfile")){var D=d.indexOf("endstream",z-1);return pako.inflateRaw(Graph.stringToArrayBuffer(d.substring(z,D)),{to:"string"})}}for(r=d.indexOf("/ObjStm");0<r;){z=d.indexOf("stream",r)+9;D=d.indexOf("endstream",+z-1);z=pako.inflateRaw(Graph.stringToArrayBuffer(d.substring(z,D)),{to:"string"});D=z.indexOf("/Subject <");if(0<D){r=z.substring(D+14,z.indexOf(">",D));if(null!=r){m=r;r=[];for(z=0;z<m.length;z+=2)D=m.substr(z,2),"00"!=D&&r.push(String.fromCharCode(parseInt(D,16)));m=r.join("")}break}r=d.indexOf("/ObjStm",r+1)}}if(null==m&&"%PDF-1.4"==d.substring(0,8)){r="";D=z=0;for(var F=[],N=null;D<d.length;){var P=d.charCodeAt(D);D+=1;10!=P&&(r+=String.fromCharCode(P));P=="/Subject (%3Cmxfile".charCodeAt(z)?+z++:z=0;if(19==z){var V=d.indexOf("%3C%2Fmxfile%3E",D)+15;D-=9;if(V>D){m=d.substring(D,V);break}}10==P&&("endobj"==r?N=null:"obj"==r.substring(r.length-3,r.length)||"xref"==r||"trailer"==r?(N=[],F[r.split(" ")[0]]=N):null!=N&&N.push(r),r="")}}null==m&&null!=F&&(m=Editor.extractGraphModelFromXref(F));null!=m&&(m=decodeURIComponent(m.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return m};Editor.extractGraphModelFromXref=function(d){var m=d.trailer,r=null;null!=m&&(m=/.* \/Info (\d+) (\d+) R/g.exec(m.join("\n")),null!=m&&0<m.length&&(m=d[m[1]],null!=m&&(m=/.* \/Subject (\d+) (\d+) R/g.exec(m.join("\n")),null!=m&&0<m.length&&(d=d[m[1]],null!=d&&(d=d.join("\n"),r=d.substring(1,d.length-1))))));return r};Editor.extractParserError=function(d,m){var r=null;d=null!=d?d.getElementsByTagName("parsererror"):null;null!=d&&0<d.length&&(r=m||mxResources.get("invalidChars"),m=d[0].getElementsByTagName("div"),0<m.length&&(r=mxUtils.getTextContent(m[0])));return null!=r?mxUtils.trim(r):r};Editor.addRetryToError=function(d,m){null!=d&&(d=null!=d.error?d.error:d,null==d.retry&&(d.retry=m))};Editor.mermaidToDrawio=function(d,m,r){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(d,m,r)};Editor.configure=function(d){if(null!=d){Editor.config=d;Editor.configVersion=d.version;d.debug&&(urlParams.test="1");d.passiveScroll&&(Editor.passiveScroll=!0);d.noResizers&&(Editor.noResizers=!0);d.preserveViewState&&(Editor.preserveViewState=!0);null!=d.passThroughKeys&&(Editor.passThroughKeys=d.passThroughKeys);null!=d.keyboardShortcuts&&(Array.isArray(d.keyboardShortcuts)?Editor.keyboardShortcuts=d.keyboardShortcuts:EditorUi.debug("Configuration Error: Array expected for keyboardShortcuts"));d.suppressNewWindows&&(Editor.suppressNewWindows=!0,Editor.popupsAllowed=!1);d.useInternalClipboard&&(EditorUi.prototype.useInternalClipboard=d.useInternalClipboard);if(null!=d.customCss){var m=document.createElement("style");m.type="text/css";m.appendChild(document.createTextNode(d.customCss));document.head.appendChild(m)}null!=@@ -13454,254 +13457,255 @@ d.sidebarWidth);null!=d.updateDefaultStyle&&(EditorUi.prototype.updateDefaultStynull!=d.autosaveDelay&&(m=parseInt(d.autosaveDelay),!isNaN(m)&&0<m?DrawioFile.prototype.autosaveDelay=m:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));null!=d.maxImageBytes&&(EditorUi.prototype.maxImageBytes=d.maxImageBytes);null!=d.maxImageSize&&(EditorUi.prototype.maxImageSize=d.maxImageSize);null!=d.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=d.shareCursorPosition);null!=d.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=d.showRemoteCursors);null!=d.restrictExport&&(DrawioFile.RESTRICT_EXPORT=d.restrictExport);null!=d.removeImageMetadata&&(Editor.removeImageMetadata=d.removeImageMetadata);null!=d.defaultTextStyle&&(Editor.defaultTextStyle=d.defaultTextStyle);null!=d.replaceSvgDataUris&&(Editor.replaceSvgDataUris=d.replaceSvgDataUris);null!=d.foreignObjectImages&&(Editor.foreignObjectImages=d.foreignObjectImages);null!=d.embedSvgFonts&&(Editor.embedSvgFonts=d.embedSvgFonts);null!=d.shadowColor&&(mxConstants.SHADOW_COLOR=d.shadowColor);null!=d.shadowOpacity&&(mxConstants.SHADOW_OPACITY=d.shadowOpacity);null!=d.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=d.shadowOffsetX);null!=d.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=d.shadowOffsetY);null!=d.shadowBlur&&(mxConstants.SHADOW_BLUR=d.shadowBlur);null!=d.enableAnimations&&(Editor.enableAnimations=d.enableAnimations);null!=d.insertAnimations&&(Editor.insertAnimations=d.insertAnimations);null!=d.enableWindowDocking&&(Editor.enableWindowDocking=d.enableWindowDocking);null!=d.compact&&-(EditorUi.prototype.defaultCompact=d.compact);null!=d.noAutoFocus&&(EditorUi.prototype.noAutoFocus=d.noAutoFocus);if(null!=d.hideMenuItems)if(Array.isArray(d.hideMenuItems))for(Menus.prototype.hiddenMenuItems={},m=0;m<d.hideMenuItems.length;m++)Menus.prototype.hiddenMenuItems[d.hideMenuItems[m]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");if(null!=d.hideMenus)if(Array.isArray(d.hideMenus)){var A={};for(m=0;m<d.hideMenus.length;m++)A[d.hideMenus[m]]=!0;Menus.prototype.defaultMenuItems=-Menus.prototype.defaultMenuItems.filter(function(D){return!A[D]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=d.enableAi&&(Editor.enableAi=d.enableAi);null!=d.enableChatGpt&&(Editor.enableAi=d.enableChatGpt);null!=d.gptApiKey&&(Editor.aiGlobals.gptApiKey=d.gptApiKey);null!=d.geminiApiKey&&(Editor.aiGlobals.geminiApiKey=d.geminiApiKey);null!=d.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=d.claudeApiKey);null!=d.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=-d.gptUrl);null!=d.aiActions&&(Editor.aiActions=d.aiActions);null!=d.aiGlobals&&(Editor.aiGlobals=d.aiGlobals);null!=d.aiConfigs&&(Editor.aiConfigs=d.aiConfigs);null!=d.aiModels&&(Editor.aiModels=d.aiModels)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.expandSvgPatterns=function(d){function m(V,Y){V=V.getAttribute("fill");if(null==V||0!==V.indexOf("url("))return null;V=V.match(/url\([^#]*#([^)"]+)\)?/);if(null==-V)return null;V=V[1];try{var H=Y.querySelector("#"+CSS.escape(V));return null!=H&&"pattern"===H.nodeName?H:null}catch(W){return null}}function r(V,Y,H){var W,Z,X;try{var ba=V.getBBox()}catch(fa){return}if(0!==ba.width&&0!==ba.height){var ea=parseFloat(Y.getAttribute("width")),aa=parseFloat(Y.getAttribute("height"));if(!(isNaN(ea)||isNaN(aa)||0>=ea||0>=aa)){var ha=Y.getAttribute("patternTransform");var na=Z=W=0;var ra=X=1;if(null!=ha){var sa=ha.match(/translate\(\s*([^,\s]+)[,\s]+([^)]+)\)/);null!=-sa&&(W=parseFloat(sa[1]),Z=parseFloat(sa[2]));sa=ha.match(/rotate\(\s*([^)]+)\)/);null!=sa&&(na=parseFloat(sa[1])*Math.PI/180);ha=ha.match(/scale\(\s*([^,\s)]+)(?:[,\s]+([^)]+))?\)/);null!=ha&&(X=parseFloat(ha[1]),ra=null!=ha[2]?parseFloat(ha[2]):X)}var ua=[{x:ba.x,y:ba.y},{x:ba.x+ba.width,y:ba.y},{x:ba.x+ba.width,y:ba.y+ba.height},{x:ba.x,y:ba.y+ba.height}],xa=Infinity;ba=Infinity;sa=ha=-Infinity;for(var qa=0;qa<ua.length;qa++){var Aa=ua[qa].x-W;var Ba=ua[qa].y-Z,Ea=Math.cos(-na),Fa=Math.sin(-na);-var ca=(Aa*Ea-Ba*Fa)/X;Aa=(Aa*Fa+Ba*Ea)/ra;xa=Math.min(xa,ca);ba=Math.min(ba,Aa);ha=Math.max(ha,ca);sa=Math.max(sa,Aa)}xa=Math.floor(xa/ea)-1;ba=Math.floor(ba/aa)-1;ha=Math.ceil(ha/ea)+1;ca=Math.ceil(sa/aa)+1;if(!(1E4<(ha-xa)*(ca-ba))){qa=D+ ++A;sa=H.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");sa.setAttribute("id",qa);ua=V.cloneNode(!0);ua.removeAttribute("fill");ua.removeAttribute("fill-opacity");ua.removeAttribute("stroke");ua.removeAttribute("stroke-width");ua.removeAttribute("stroke-opacity");-ua.removeAttribute("style");ua.removeAttribute("pointer-events");ua.setAttribute("fill","black");sa.appendChild(ua);ua=H.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");ua.setAttribute("clip-path","url(#"+qa+")");qa=V.getAttribute("fill-opacity");null!=qa&&ua.setAttribute("opacity",qa);qa=H.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");qa.setAttribute("transform","translate("+W+","+Z+")"+(0!==na?" rotate("+180*na/Math.PI+")":"")+" scale("+X+(ra!==X?","+ra:"")+")");-Y=Y.childNodes;for(W=xa;W<ha;W++)for(Z=ba;Z<ca;Z++){na=H.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");na.setAttribute("transform","translate("+W*ea+","+Z*aa+")");for(X=0;X<Y.length;X++)1===Y[X].nodeType&&na.appendChild(Y[X].cloneNode(!0));qa.appendChild(na)}ua.appendChild(qa);ea=H.querySelector("defs");null==ea&&(ea=H.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs"),H.insertBefore(ea,H.firstChild));ea.appendChild(sa);V.parentNode.insertBefore(ua,V.nextSibling);-V.setAttribute("fill","none");V.style.fill=""}}}}for(var A=0,D="expand-pattern-clip-"+Editor.guid(8)+"-",G=d.querySelectorAll('[fill^="url("]'),O=0;O<G.length;O++){var P=m(G[O],d);null!=P&&r(G[O],P,d)}G=d.querySelectorAll("[style]");for(O=0;O<G.length;O++)P=G[O].getAttribute("style"),null!=P&&-1!==P.indexOf("url(")&&(P=m(G[O],d),null!=P&&r(G[O],P,d))};Editor.configureFontCss=function(d){if(null!=d){Editor.prototype.fontCss=d;var m=document.getElementsByTagName("script")[0];if(null!=m&&null!=m.parentNode){var r=-document.createElement("style");r.setAttribute("type","text/css");r.appendChild(document.createTextNode(d));m.parentNode.insertBefore(r,m);d=d.split("url(");for(r=1;r<d.length;r++){var A=d[r].indexOf(")");A=Editor.trimCssUrl(d[r].substring(0,A));var D=document.createElement("link");D.setAttribute("rel","preload");D.setAttribute("href",A);D.setAttribute("as","font");D.setAttribute("crossorigin","");m.parentNode.insertBefore(D,m)}}}};Editor.trimCssUrl=function(d){return d.replace(RegExp("^[\\s\"']+",+(EditorUi.prototype.defaultCompact=d.compact);null!=d.noAutoFocus&&(EditorUi.prototype.noAutoFocus=d.noAutoFocus);if(null!=d.hideMenuItems)if(Array.isArray(d.hideMenuItems))for(Menus.prototype.hiddenMenuItems={},m=0;m<d.hideMenuItems.length;m++)Menus.prototype.hiddenMenuItems[d.hideMenuItems[m]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");if(null!=d.hideMenus)if(Array.isArray(d.hideMenus)){var z={};for(m=0;m<d.hideMenus.length;m++)z[d.hideMenus[m]]=!0;Menus.prototype.defaultMenuItems=+Menus.prototype.defaultMenuItems.filter(function(D){return!z[D]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=d.enableAi&&(Editor.enableAi=d.enableAi);null!=d.enableChatGpt&&(Editor.enableAi=d.enableChatGpt);null!=d.gptApiKey&&(Editor.aiGlobals.gptApiKey=d.gptApiKey);null!=d.geminiApiKey&&(Editor.aiGlobals.geminiApiKey=d.geminiApiKey);null!=d.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=d.claudeApiKey);null!=d.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=+d.gptUrl);null!=d.aiActions&&(Editor.aiActions=d.aiActions);null!=d.aiGlobals&&(Editor.aiGlobals=d.aiGlobals);null!=d.aiConfigs&&(Editor.aiConfigs=d.aiConfigs);null!=d.aiModels&&(Editor.aiModels=d.aiModels)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.expandSvgPatterns=function(d){function m(V,X){V=V.getAttribute("fill");if(null==V||0!==V.indexOf("url("))return null;V=V.match(/url\([^#]*#([^)"]+)\)?/);if(null==+V)return null;V=V[1];try{var H=X.querySelector("#"+CSS.escape(V));return null!=H&&"pattern"===H.nodeName?H:null}catch(W){return null}}function r(V,X,H){var W,Z,Y;try{var ba=V.getBBox()}catch(fa){return}if(0!==ba.width&&0!==ba.height){var ea=parseFloat(X.getAttribute("width")),aa=parseFloat(X.getAttribute("height"));if(!(isNaN(ea)||isNaN(aa)||0>=ea||0>=aa)){var ha=X.getAttribute("patternTransform");var na=Z=W=0;var ra=Y=1;if(null!=ha){var sa=ha.match(/translate\(\s*([^,\s]+)[,\s]+([^)]+)\)/);null!=+sa&&(W=parseFloat(sa[1]),Z=parseFloat(sa[2]));sa=ha.match(/rotate\(\s*([^)]+)\)/);null!=sa&&(na=parseFloat(sa[1])*Math.PI/180);ha=ha.match(/scale\(\s*([^,\s)]+)(?:[,\s]+([^)]+))?\)/);null!=ha&&(Y=parseFloat(ha[1]),ra=null!=ha[2]?parseFloat(ha[2]):Y)}var ua=[{x:ba.x,y:ba.y},{x:ba.x+ba.width,y:ba.y},{x:ba.x+ba.width,y:ba.y+ba.height},{x:ba.x,y:ba.y+ba.height}],xa=Infinity;ba=Infinity;sa=ha=-Infinity;for(var qa=0;qa<ua.length;qa++){var Aa=ua[qa].x-W;var Ba=ua[qa].y-Z,Ea=Math.cos(-na),Fa=Math.sin(-na);+var ca=(Aa*Ea-Ba*Fa)/Y;Aa=(Aa*Fa+Ba*Ea)/ra;xa=Math.min(xa,ca);ba=Math.min(ba,Aa);ha=Math.max(ha,ca);sa=Math.max(sa,Aa)}xa=Math.floor(xa/ea)-1;ba=Math.floor(ba/aa)-1;ha=Math.ceil(ha/ea)+1;ca=Math.ceil(sa/aa)+1;if(!(1E4<(ha-xa)*(ca-ba))){qa=D+ ++z;sa=H.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");sa.setAttribute("id",qa);ua=V.cloneNode(!0);ua.removeAttribute("fill");ua.removeAttribute("fill-opacity");ua.removeAttribute("stroke");ua.removeAttribute("stroke-width");ua.removeAttribute("stroke-opacity");+ua.removeAttribute("style");ua.removeAttribute("pointer-events");ua.setAttribute("fill","black");sa.appendChild(ua);ua=H.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");ua.setAttribute("clip-path","url(#"+qa+")");qa=V.getAttribute("fill-opacity");null!=qa&&ua.setAttribute("opacity",qa);qa=H.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");qa.setAttribute("transform","translate("+W+","+Z+")"+(0!==na?" rotate("+180*na/Math.PI+")":"")+" scale("+Y+(ra!==Y?","+ra:"")+")");+X=X.childNodes;for(W=xa;W<ha;W++)for(Z=ba;Z<ca;Z++){na=H.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");na.setAttribute("transform","translate("+W*ea+","+Z*aa+")");for(Y=0;Y<X.length;Y++)1===X[Y].nodeType&&na.appendChild(X[Y].cloneNode(!0));qa.appendChild(na)}ua.appendChild(qa);ea=H.querySelector("defs");null==ea&&(ea=H.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs"),H.insertBefore(ea,H.firstChild));ea.appendChild(sa);V.parentNode.insertBefore(ua,V.nextSibling);+V.setAttribute("fill","none");V.style.fill=""}}}}for(var z=0,D="expand-pattern-clip-"+Editor.guid(8)+"-",F=d.querySelectorAll('[fill^="url("]'),N=0;N<F.length;N++){var P=m(F[N],d);null!=P&&r(F[N],P,d)}F=d.querySelectorAll("[style]");for(N=0;N<F.length;N++)P=F[N].getAttribute("style"),null!=P&&-1!==P.indexOf("url(")&&(P=m(F[N],d),null!=P&&r(F[N],P,d))};Editor.configureFontCss=function(d){if(null!=d){Editor.prototype.fontCss=d;var m=document.getElementsByTagName("script")[0];if(null!=m&&null!=m.parentNode){var r=+document.createElement("style");r.setAttribute("type","text/css");r.appendChild(document.createTextNode(d));m.parentNode.insertBefore(r,m);d=d.split("url(");for(r=1;r<d.length;r++){var z=d[r].indexOf(")");z=Editor.trimCssUrl(d[r].substring(0,z));var D=document.createElement("link");D.setAttribute("rel","preload");D.setAttribute("href",z);D.setAttribute("as","font");D.setAttribute("crossorigin","");m.parentNode.insertBefore(D,m)}}}};Editor.trimCssUrl=function(d){return d.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=20;Editor.guid=function(d){d=null!=d?d:Editor.GUID_LENGTH;for(var m=[],r=0;r<d;r++)m.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return m.join("")};Editor.updateStatusInterval=1E4;Editor.prototype.appName="draw.io";Editor.prototype.diagramFileTypes=[{description:"diagramXmlDesc",extension:"drawio",mimeType:"text/xml"},{description:"diagramPngDesc",extension:"png",mimeType:"image/png"},{description:"diagramSvgDesc",extension:"svg",mimeType:"image/svg"},{description:"diagramHtmlDesc",extension:"html",mimeType:"text/html"}];Editor.prototype.libraryFileTypes=[{description:"Library (.drawiolib, .xml)",extensions:["drawiolib","xml"]}];Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];Editor.prototype.timeout=25E3;Editor.prototype.generateTimeout=9E4;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;Editor.prototype.crossOriginImages=!0;var b=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(d){d=null!=d&&"mxlibrary"!=d.nodeName?this.extractGraphModel(d):null;if(null!=d){var m=Editor.extractParserError(d,mxResources.get("invalidOrMissingFile"));-if(m)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[d],"cause",[m]),Error(mxResources.get("notADiagramFile")+" ("+m+")");if("mxGraphModel"==d.nodeName){m=d.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=m&&""!=m)m!=this.graph.currentStyle&&(r=null!=this.graph.themes?this.graph.themes[m]:mxUtils.load(STYLE_PATH+"/"+m+".xml").getDocumentElement(),null!=r&&(A=new mxCodec(r.ownerDocument),A.decode(r,this.graph.getStylesheet())));else{var r=null!=this.graph.themes?-this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=r){var A=new mxCodec(r.ownerDocument);A.decode(r,this.graph.getStylesheet())}}this.graph.currentStyle=m;this.graph.mathEnabled="1"==urlParams.math||"1"==d.getAttribute("math");this.graph.setAdaptiveColors(d.getAttribute("adaptiveColors"));m=d.getAttribute("backgroundImage");null!=m?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(m)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms=+if(m)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[d],"cause",[m]),Error(mxResources.get("notADiagramFile")+" ("+m+")");if("mxGraphModel"==d.nodeName){m=d.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=m&&""!=m)m!=this.graph.currentStyle&&(r=null!=this.graph.themes?this.graph.themes[m]:mxUtils.load(STYLE_PATH+"/"+m+".xml").getDocumentElement(),null!=r&&(z=new mxCodec(r.ownerDocument),z.decode(r,this.graph.getStylesheet())));else{var r=null!=this.graph.themes?+this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=r){var z=new mxCodec(r.ownerDocument);z.decode(r,this.graph.getStylesheet())}}this.graph.currentStyle=m;this.graph.mathEnabled="1"==urlParams.math||"1"==d.getAttribute("math");this.graph.setAdaptiveColors(d.getAttribute("adaptiveColors"));m=d.getAttribute("backgroundImage");null!=m?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(m)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==d.getAttribute("shadow"),!1);if(m=d.getAttribute("extFonts"))try{for(m=m.split("|").map(function(D){D=D.split("^");return{name:D[0],url:D[1]}}),r=0;r<m.length;r++)this.graph.addExtFont(m[r].name,m[r].url)}catch(D){console.log("ExtFonts format error: "+D.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}b.apply(this,-arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var l=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(d,m){d=null!=d?d:!0;var r=l.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&r.setAttribute("style",this.graph.currentStyle);var A=this.graph.getBackgroundImageObject(this.graph.backgroundImage,m);null!=A&&r.setAttribute("backgroundImage",JSON.stringify(A));-r.setAttribute("math",this.graph.mathEnabled?"1":"0");r.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?r.setAttribute("adaptiveColors",this.graph.adaptiveColors):r.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(A=this.graph.extFonts.map(function(D){return D.name+"^"+D.url}),r.setAttribute("extFonts",A.join("|")));return r};Editor.prototype.isDataSvg=function(d){try{var m=mxUtils.parseXml(d).documentElement.getAttribute("content");-if(null!=m&&(null!=m&&"<"!=m.charAt(0)&&"%"!=m.charAt(0)&&(m=unescape(window.atob?atob(m):Base64.decode(cont,m))),null!=m&&"%"==m.charAt(0)&&(m=decodeURIComponent(m)),null!=m&&0<m.length)){var r=mxUtils.parseXml(m).documentElement;return"mxfile"==r.nodeName||"mxGraphModel"==r.nodeName}}catch(A){}return!1};Editor.prototype.extractGraphModel=function(d,m,r){return Editor.extractGraphModel.apply(this,arguments)};var p=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled=+arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var l=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(d,m){d=null!=d?d:!0;var r=l.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&r.setAttribute("style",this.graph.currentStyle);var z=this.graph.getBackgroundImageObject(this.graph.backgroundImage,m);null!=z&&r.setAttribute("backgroundImage",JSON.stringify(z));+r.setAttribute("math",this.graph.mathEnabled?"1":"0");r.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?r.setAttribute("adaptiveColors",this.graph.adaptiveColors):r.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(z=this.graph.extFonts.map(function(D){return D.name+"^"+D.url}),r.setAttribute("extFonts",z.join("|")));return r};Editor.prototype.isDataSvg=function(d){try{var m=mxUtils.parseXml(d).documentElement.getAttribute("content");+if(null!=m&&(null!=m&&"<"!=m.charAt(0)&&"%"!=m.charAt(0)&&(m=unescape(window.atob?atob(m):Base64.decode(cont,m))),null!=m&&"%"==m.charAt(0)&&(m=decodeURIComponent(m)),null!=m&&0<m.length)){var r=mxUtils.parseXml(m).documentElement;return"mxfile"==r.nodeName||"mxGraphModel"==r.nodeName}}catch(z){}return!1};Editor.prototype.extractGraphModel=function(d,m,r){return Editor.extractGraphModel.apply(this,arguments)};var p=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.setAdaptiveColors(null);this.graph.view.x0=null;this.graph.view.y0=null;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();p.apply(this,arguments)};var g=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){g.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};-Editor.initMath=function(d,m){if("undefined"===typeof window.MathJax){var r=function(){A=null;Editor.mathJaxRendering=!1;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};d=null!=d?d:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var A=null;Editor.mathJaxRendering=!1;Editor.doMathJaxRender=function(O){null!=MathJax.startup&&null!=MathJax.startup.output&&null!=MathJax.startup.output.options&&null!=MathJax.startup.output.options.linebreaks&&-(MathJax.startup.output.options.linebreaks.inline=!1);try{null==A?(MathJax.typesetClear([O]),MathJax.typeset([O]),r()):A!=O&&Editor.mathJaxQueue.push(O)}catch(P){MathJax.typesetClear([O]),null!=P.retry?(A=O,Editor.mathJaxRendering=!0,P.retry.then(function(){MathJax.typesetPromise([O]).then(r)["catch"](function(V){console.log("Error in MathJax.typesetPromise: "+V.toString());r()})})["catch"](function(V){console.log("Error in MathJax.retry: "+V.toString());r()})):null!=window.console&&console.log("Error in MathJax.typeset: "+-P.toString())}};window.MathJax=null!=m?m:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe"],paths:{fonts:DRAW_MATH_URL+"/fonts"}},output:{font:"mathjax-tex"},startup:{pageReady:function(){for(var O=0;O<Editor.mathJaxQueue.length;O++)Editor.doMathJaxRender(Editor.mathJaxQueue[O])}}};Editor.MathJaxRender=function(O){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?-Editor.doMathJaxRender(O):Editor.mathJaxQueue.push(O)};Editor.onMathJaxDone=function(){};var D=Editor.prototype.init;Editor.prototype.init=function(){D.apply(this,arguments);var O=mxUtils.bind(this,function(Y,H){null!=this.graph.container&&this.graph.mathEnabled&&(Editor.mathOutputSize&&(this.graph.container.style.visibility="hidden"),Editor.MathJaxRender(this.graph.container))});this.graph.model.addListener(mxEvent.CHANGE,O);this.graph.addListener(mxEvent.REFRESH,O);var P=this.graph,V=Editor.onMathJaxDone;-Editor.onMathJaxDone=function(){null!=V&&V.apply(this,arguments);Editor.mathOutputSize&&null!=P&&P.mathEnabled&&(P.refreshMathBounds(),null!=P.container&&(P.container.style.visibility=""))}};m=document.getElementsByTagName("script");if(null!=m&&0<m.length){var G=document.createElement("script");G.setAttribute("type","text/javascript");G.setAttribute("src",d);m[0].parentNode.appendChild(G)}}};Editor.containsMath=function(d){return null!=d&&(0<=d.indexOf("$")||0<=d.indexOf("\\(")||0<=d.indexOf("\\[")||-0<=d.indexOf("\\begin{"))};(function(){var d=Graph.prototype.getPreferredSizeForCell,m=null;Graph.prototype.getPreferredSizeForCell=function(r,A,D){if(!Editor.mathOutputSize||!this.mathEnabled||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||this.model.isEdge(r))return d.apply(this,arguments);var G=this.view.createState(r);G=null!=G?this.cellRenderer.getLabelValue(G):null;if(null==G||0===G.length||!Editor.containsMath(G))return d.apply(this,arguments);var O=mxUtils.getSizeForString;-mxUtils.getSizeForString=function(P,V,Y,H){null==m&&(m=document.createElement("div"),m.style.cssText="position:absolute;visibility:hidden;left:-10000px;top:-10000px;display:inline-block;",document.body.appendChild(m));m.style.fontSize=V+"px";m.style.fontFamily=Y;null!=H&&0<H?(m.style.width=H+"px",m.style.whiteSpace="normal"):(m.style.width="",m.style.whiteSpace="nowrap");MathJax.typesetClear([m]);m.innerHTML=Graph.sanitizeHtml(P);try{MathJax.typeset([m]);var W=m.getBoundingClientRect();return new mxRectangle(0,-0,W.width,W.height)}catch(Z){return O.apply(this,arguments)}};try{return d.apply(this,arguments)}finally{mxUtils.getSizeForString=O}}})();Graph.prototype.refreshMathBounds=function(){if(Editor.mathOutputSize&&this.mathEnabled){var d=this.view,m=!1;d.states.visit(mxUtils.bind(this,function(A,D){null!=D&&null!=D.text&&(A=this.cellRenderer.getLabelValue(D),"string"===typeof A&&Editor.containsMath(A)&&(D.text.updateBoundingBox(),m=!0))}));if(m){var r=null!=d.currentRoot?d.currentRoot:this.model.getRoot();-r=d.getState(r);null!=r&&(r=d.getBoundingBox(r,!0,!1),d.setGraphBounds(null!=r?r:d.getEmptyBounds()),this.sizeDidChange());this.fireEvent(new mxEventObject("mathRefreshed"))}}};(function(){var d=EditorUi.prototype.initialFitDiagram;EditorUi.prototype.initialFitDiagram=function(m){d.apply(this,arguments);var r=this.editor.graph;if(Editor.mathOutputSize&&null!=r&&r.mathEnabled){var A=arguments,D=this,G=!1,O=function(){G||(G=!0,r.removeListener(O),r.zoomTo(1),D.resetScrollbars(),d.apply(D,A))};r.addListener("mathRefreshed",-O);Promise.resolve().then(function(){G||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||null!=Editor.mathJaxQueue&&0<Editor.mathJaxQueue.length||Editor.mathJaxRendering||r.removeListener(O)})}}})();Editor.prototype.csvToArray=function(d){if(0<d.length){var m="",r=[""],A=0,D=!0,G;d=$jscomp.makeIterator(d);for(G=d.next();!G.done;G=d.next())G=G.value,'"'===G?(D&&G===m&&(r[A]+=G),D=!D):","===G&&D?G=r[++A]="":r[A]+=G,m=G;return r}return[]};Editor.prototype.getProxiedUrl=function(d){if((/test\.draw\.io$/.test(window.location.hostname)||+Editor.initMath=function(d,m){if("undefined"===typeof window.MathJax){var r=function(){z=null;Editor.mathJaxRendering=!1;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};d=null!=d?d:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var z=null;Editor.mathJaxRendering=!1;Editor.doMathJaxRender=function(N){null!=MathJax.startup&&null!=MathJax.startup.output&&null!=MathJax.startup.output.options&&null!=MathJax.startup.output.options.linebreaks&&+(MathJax.startup.output.options.linebreaks.inline=!1);try{null==z?(MathJax.typesetClear([N]),MathJax.typeset([N]),r()):z!=N&&Editor.mathJaxQueue.push(N)}catch(P){MathJax.typesetClear([N]),null!=P.retry?(z=N,Editor.mathJaxRendering=!0,P.retry.then(function(){MathJax.typesetPromise([N]).then(r)["catch"](function(V){console.log("Error in MathJax.typesetPromise: "+V.toString());r()})})["catch"](function(V){console.log("Error in MathJax.retry: "+V.toString());r()})):null!=window.console&&console.log("Error in MathJax.typeset: "++P.toString())}};window.MathJax=null!=m?m:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe"],paths:{fonts:DRAW_MATH_URL+"/fonts"}},output:{font:"mathjax-tex"},startup:{pageReady:function(){for(var N=0;N<Editor.mathJaxQueue.length;N++)Editor.doMathJaxRender(Editor.mathJaxQueue[N])}}};Editor.MathJaxRender=function(N){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?+Editor.doMathJaxRender(N):Editor.mathJaxQueue.push(N)};Editor.onMathJaxDone=function(){};var D=Editor.prototype.init;Editor.prototype.init=function(){D.apply(this,arguments);var N=mxUtils.bind(this,function(X,H){null!=this.graph.container&&this.graph.mathEnabled&&(Editor.mathOutputSize&&(this.graph.container.style.visibility="hidden"),Editor.MathJaxRender(this.graph.container))});this.graph.model.addListener(mxEvent.CHANGE,N);this.graph.addListener(mxEvent.REFRESH,N);var P=this.graph,V=Editor.onMathJaxDone;+Editor.onMathJaxDone=function(){null!=V&&V.apply(this,arguments);Editor.mathOutputSize&&null!=P&&P.mathEnabled&&(P.refreshMathBounds(),null!=P.container&&(P.container.style.visibility=""))}};m=document.getElementsByTagName("script");if(null!=m&&0<m.length){var F=document.createElement("script");F.setAttribute("type","text/javascript");F.setAttribute("src",d);m[0].parentNode.appendChild(F)}}};Editor.containsMath=function(d){return null!=d&&(0<=d.indexOf("$")||0<=d.indexOf("\\(")||0<=d.indexOf("\\[")||+0<=d.indexOf("\\begin{"))};(function(){var d=Graph.prototype.getPreferredSizeForCell,m=null;Graph.prototype.getPreferredSizeForCell=function(r,z,D){if(!Editor.mathOutputSize||!this.mathEnabled||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||this.model.isEdge(r))return d.apply(this,arguments);var F=this.view.createState(r);F=null!=F?this.cellRenderer.getLabelValue(F):null;if(null==F||0===F.length||!Editor.containsMath(F))return d.apply(this,arguments);var N=mxUtils.getSizeForString;+mxUtils.getSizeForString=function(P,V,X,H){null==m&&(m=document.createElement("div"),m.style.cssText="position:absolute;visibility:hidden;left:-10000px;top:-10000px;display:inline-block;",document.body.appendChild(m));m.style.fontSize=V+"px";m.style.fontFamily=X;null!=H&&0<H?(m.style.width=H+"px",m.style.whiteSpace="normal"):(m.style.width="",m.style.whiteSpace="nowrap");MathJax.typesetClear([m]);m.innerHTML=Graph.sanitizeHtml(P);try{MathJax.typeset([m]);var W=m.getBoundingClientRect();return new mxRectangle(0,+0,W.width,W.height)}catch(Z){return N.apply(this,arguments)}};try{return d.apply(this,arguments)}finally{mxUtils.getSizeForString=N}}})();Graph.prototype.refreshMathBounds=function(){if(Editor.mathOutputSize&&this.mathEnabled){var d=this.view,m=!1;d.states.visit(mxUtils.bind(this,function(z,D){null!=D&&null!=D.text&&(z=this.cellRenderer.getLabelValue(D),"string"===typeof z&&Editor.containsMath(z)&&(D.text.updateBoundingBox(),m=!0))}));if(m){var r=null!=d.currentRoot?d.currentRoot:this.model.getRoot();+r=d.getState(r);null!=r&&(r=d.getBoundingBox(r,!0,!1),d.setGraphBounds(null!=r?r:d.getEmptyBounds()),this.sizeDidChange());this.fireEvent(new mxEventObject("mathRefreshed"))}}};(function(){var d=EditorUi.prototype.initialFitDiagram;EditorUi.prototype.initialFitDiagram=function(m){d.apply(this,arguments);var r=this.editor.graph;if(Editor.mathOutputSize&&null!=r&&r.mathEnabled){var z=arguments,D=this,F=!1,N=function(){F||(F=!0,r.removeListener(N),r.zoomTo(1),D.resetScrollbars(),d.apply(D,z))};r.addListener("mathRefreshed",+N);Promise.resolve().then(function(){F||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||null!=Editor.mathJaxQueue&&0<Editor.mathJaxQueue.length||Editor.mathJaxRendering||r.removeListener(N)})}}})();Editor.prototype.csvToArray=function(d){if(0<d.length){var m="",r=[""],z=0,D=!0,F;d=$jscomp.makeIterator(d);for(F=d.next();!F.done;F=d.next())F=F.value,'"'===F?(D&&F===m&&(r[z]+=F),D=!D):","===F&&D?F=r[++z]="":r[z]+=F,m=F;return r}return[]};Editor.prototype.getProxiedUrl=function(d){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(d)){var m=EditorUi.isVisioFilename(d);m=/\.png$/i.test(d)||/\.pdf$/i.test(d)||m;var r="t="+(new Date).getTime();d=PROXY_URL+"?url="+encodeURIComponent(d)+"&"+r+(m?"&base64=1":"")}return d};Editor.prototype.isCorsEnabledForUrl=function(d){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||d.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=-new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(d)||"https://raw.githubusercontent.com/"===d.substring(0,34)||"https://fonts.googleapis.com/"===d.substring(0,29)||"https://fonts.gstatic.com/"===d.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var d=new mxUrlConverter;d.updateBaseUrl();var m=d.convert,r=this;d.convert=function(A){null!=A&&navigator.onLine&&("http://"!=A.substring(0,7)&&"https://"!=A.substring(0,8)||A.substring(0,-d.baseUrl.length)==d.baseUrl||r.crossOriginImages&&r.isCorsEnabledForUrl(A)?"chrome-extension://"!=A.substring(0,19)&&(A=m.apply(this,arguments)):A=PROXY_URL+"?url="+encodeURIComponent(A));return A};return d};Editor.createSvgDataUri=function(d){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(d)))};Editor.prototype.convertImageToDataUri=function(d,m,r,A,D){try{var G=!0,O=window.setTimeout(mxUtils.bind(this,function(){G=!1;m(d)}),this.timeout),P=mxUtils.bind(this,function(){null!=-A?this.convertImageToDataUri(d,m,r,A,!0):m(d)});if(/(\.svg)$/i.test(d)&&!D)mxUtils.get(d,mxUtils.bind(this,function(Y){window.clearTimeout(O);G&&(200>Y.getStatus()||299<Y.getStatus()?P():m(Editor.createSvgDataUri(Y.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(O);G&&P()}));else{var V=new Image;this.crossOriginImages&&(V.crossOrigin="anonymous");V.onload=function(){window.clearTimeout(O);if(G)try{A=null!=A&&D?A:1;var Y=document.createElement("canvas");Y.height=V.height*A;Y.width=-V.width*A;var H=Y.getContext("2d");H.scale(A,A);H.drawImage(V,0,0);m(Y.toDataURL())}catch(W){m(d)}};V.onerror=function(){window.clearTimeout(O);G&&(null!=r?r():m(d))};V.src=d}}catch(Y){null!=r?r():m(d)}};Editor.prototype.convertImages=function(d,m,r,A){function D(){0<G.length?G.shift()():m(d)}null==A&&(A=this.createImageUrlConverter());var G=[],O=r||{};r=mxUtils.bind(this,function(W,Z){W=d.getElementsByTagName(W);for(var X=0;X<W.length;X++)mxUtils.bind(this,function(ba){G.push(mxUtils.bind(this,function(){try{if(null!=-ba){var ea=A.convert(ba.getAttribute(Z));if(null!=ea&&"data:"!=ea.substring(0,5)){var aa=O[ea];null==aa?this.convertImageToDataUri(ea,function(ha){null!=ha&&(O[ea]=ha,ba.setAttribute(Z,ha));D()},null,Editor.svgRasterScale):(ba.setAttribute(Z,aa),D())}else null!=ea&&ba.setAttribute(Z,ea),D()}}catch(ha){D()}}))})(W[X])});var P={},V=function(){var W=d.getElementsByTagName("defs")[0];null==W&&(W=d.ownerDocument,W=null!=W.createElementNS?W.createElementNS(mxConstants.NS_SVG,"defs"):W.createElement("defs"),-d.insertBefore(W,d.firstChild));return W},Y=mxUtils.bind(this,function(){for(var W=d.getElementsByTagName("use"),Z=0;Z<W.length;Z++)mxUtils.bind(this,function(X){G.push(mxUtils.bind(this,function(){try{var ba=X.getAttribute("href");null==ba&&(ba=X.getAttribute("xlink:href"));if(null!=ba&&"#"!=ba.charAt(0)&&"data:"!=ba.substring(0,5)){var ea=A.convert(ba),aa=function(na){na=Graph.createSvgImageSymbol(V(),P,na,!0);null!=na&&(X.setAttribute("href","#"+na),X.setAttribute("xlink:href","#"+na));D()},ha=-O[ea];null==ha?this.convertImageToDataUri(ea,function(na){null!=na&&na!=ea&&(O[ea]=na);aa(na)}):aa(ha)}else D()}catch(na){D()}}))})(W[Z])}),H=mxUtils.bind(this,function(){G.push(mxUtils.bind(this,function(){try{for(var W=d.getElementsByTagName("image"),Z=[],X=0;X<W.length;X++)Z.push(W[X]);var ba={},ea={},aa=[],ha=function(){for(var Ea=d.getElementsByTagName("use"),Fa=0;Fa<Ea.length;Fa++){var ca=Ea[Fa].getAttribute("href");null==ca&&(ca=Ea[Fa].getAttribute("xlink:href"));null!=ca&&null!=ba[ca]&&(Ea[Fa].setAttribute("href",-"#"+ba[ca]),Ea[Fa].setAttribute("xlink:href","#"+ba[ca]))}},na=function(Ea,Fa){for(var ca=null!=d.ownerDocument.createElementNS?d.ownerDocument.createElementNS(mxConstants.NS_SVG,"use"):d.ownerDocument.createElement("use"),fa=Ea.attributes,oa=0;oa<fa.length;oa++){var pa=fa[oa].name;"href"!=pa&&"xlink:href"!=pa&&"preserveAspectRatio"!=pa&&ca.setAttribute(pa,fa[oa].value)}ca.setAttribute("href","#"+Fa);ca.setAttribute("xlink:href","#"+Fa);Ea.parentNode.replaceChild(ca,Ea)};for(X=0;X<Z.length;X++){var ra=-Z[X];W=ra;var sa=!0;if("symbol"==ra.parentNode.nodeName)if(null==ra.getAttribute("id")&&"mx-image-"==String(ra.parentNode.getAttribute("id")||"").substring(0,9))W=ra.parentNode,sa=!1;else continue;else"mx-image-"==String(ra.getAttribute("id")||"").substring(0,9)&&(sa=!1);var ua=ra.getAttribute("xlink:href");if(null!=ua&&"data:"==ua.substring(0,5)){var xa=W.getAttribute("preserveAspectRatio")||"";if("data:image/svg+xml"==ua.substring(0,18)){var qa="mx-symbol-"+mxUtils.hashCode(ua+"|"+("none"!=xa)),+new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(d)||"https://raw.githubusercontent.com/"===d.substring(0,34)||"https://fonts.googleapis.com/"===d.substring(0,29)||"https://fonts.gstatic.com/"===d.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var d=new mxUrlConverter;d.updateBaseUrl();var m=d.convert,r=this;d.convert=function(z){null!=z&&navigator.onLine&&("http://"!=z.substring(0,7)&&"https://"!=z.substring(0,8)||z.substring(0,+d.baseUrl.length)==d.baseUrl||r.crossOriginImages&&r.isCorsEnabledForUrl(z)?"chrome-extension://"!=z.substring(0,19)&&(z=m.apply(this,arguments)):z=PROXY_URL+"?url="+encodeURIComponent(z));return z};return d};Editor.createSvgDataUri=function(d){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(d)))};Editor.prototype.convertImageToDataUri=function(d,m,r,z,D){try{var F=!0,N=window.setTimeout(mxUtils.bind(this,function(){F=!1;m(d)}),this.timeout),P=mxUtils.bind(this,function(){null!=+z?this.convertImageToDataUri(d,m,r,z,!0):m(d)});if(/(\.svg)$/i.test(d)&&!D)mxUtils.get(d,mxUtils.bind(this,function(X){window.clearTimeout(N);F&&(200>X.getStatus()||299<X.getStatus()?P():m(Editor.createSvgDataUri(X.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(N);F&&P()}));else{var V=new Image;this.crossOriginImages&&(V.crossOrigin="anonymous");V.onload=function(){window.clearTimeout(N);if(F)try{z=null!=z&&D?z:1;var X=document.createElement("canvas");X.height=V.height*z;X.width=+V.width*z;var H=X.getContext("2d");H.scale(z,z);H.drawImage(V,0,0);m(X.toDataURL())}catch(W){m(d)}};V.onerror=function(){window.clearTimeout(N);F&&(null!=r?r():m(d))};V.src=d}}catch(X){null!=r?r():m(d)}};Editor.prototype.convertImages=function(d,m,r,z){function D(){0<F.length?F.shift()():m(d)}null==z&&(z=this.createImageUrlConverter());var F=[],N=r||{};r=mxUtils.bind(this,function(W,Z){W=d.getElementsByTagName(W);for(var Y=0;Y<W.length;Y++)mxUtils.bind(this,function(ba){F.push(mxUtils.bind(this,function(){try{if(null!=+ba){var ea=z.convert(ba.getAttribute(Z));if(null!=ea&&"data:"!=ea.substring(0,5)){var aa=N[ea];null==aa?this.convertImageToDataUri(ea,function(ha){null!=ha&&(N[ea]=ha,ba.setAttribute(Z,ha));D()},null,Editor.svgRasterScale):(ba.setAttribute(Z,aa),D())}else null!=ea&&ba.setAttribute(Z,ea),D()}}catch(ha){D()}}))})(W[Y])});var P={},V=function(){var W=d.getElementsByTagName("defs")[0];null==W&&(W=d.ownerDocument,W=null!=W.createElementNS?W.createElementNS(mxConstants.NS_SVG,"defs"):W.createElement("defs"),+d.insertBefore(W,d.firstChild));return W},X=mxUtils.bind(this,function(){for(var W=d.getElementsByTagName("use"),Z=0;Z<W.length;Z++)mxUtils.bind(this,function(Y){F.push(mxUtils.bind(this,function(){try{var ba=Y.getAttribute("href");null==ba&&(ba=Y.getAttribute("xlink:href"));if(null!=ba&&"#"!=ba.charAt(0)&&"data:"!=ba.substring(0,5)){var ea=z.convert(ba),aa=function(na){na=Graph.createSvgImageSymbol(V(),P,na,!0);null!=na&&(Y.setAttribute("href","#"+na),Y.setAttribute("xlink:href","#"+na));D()},ha=+N[ea];null==ha?this.convertImageToDataUri(ea,function(na){null!=na&&na!=ea&&(N[ea]=na);aa(na)}):aa(ha)}else D()}catch(na){D()}}))})(W[Z])}),H=mxUtils.bind(this,function(){F.push(mxUtils.bind(this,function(){try{for(var W=d.getElementsByTagName("image"),Z=[],Y=0;Y<W.length;Y++)Z.push(W[Y]);var ba={},ea={},aa=[],ha=function(){for(var Ea=d.getElementsByTagName("use"),Fa=0;Fa<Ea.length;Fa++){var ca=Ea[Fa].getAttribute("href");null==ca&&(ca=Ea[Fa].getAttribute("xlink:href"));null!=ca&&null!=ba[ca]&&(Ea[Fa].setAttribute("href",+"#"+ba[ca]),Ea[Fa].setAttribute("xlink:href","#"+ba[ca]))}},na=function(Ea,Fa){for(var ca=null!=d.ownerDocument.createElementNS?d.ownerDocument.createElementNS(mxConstants.NS_SVG,"use"):d.ownerDocument.createElement("use"),fa=Ea.attributes,oa=0;oa<fa.length;oa++){var pa=fa[oa].name;"href"!=pa&&"xlink:href"!=pa&&"preserveAspectRatio"!=pa&&ca.setAttribute(pa,fa[oa].value)}ca.setAttribute("href","#"+Fa);ca.setAttribute("xlink:href","#"+Fa);Ea.parentNode.replaceChild(ca,Ea)};for(Y=0;Y<Z.length;Y++){var ra=+Z[Y];W=ra;var sa=!0;if("symbol"==ra.parentNode.nodeName)if(null==ra.getAttribute("id")&&"mx-image-"==String(ra.parentNode.getAttribute("id")||"").substring(0,9))W=ra.parentNode,sa=!1;else continue;else"mx-image-"==String(ra.getAttribute("id")||"").substring(0,9)&&(sa=!1);var ua=ra.getAttribute("xlink:href");if(null!=ua&&"data:"==ua.substring(0,5)){var xa=W.getAttribute("preserveAspectRatio")||"";if("data:image/svg+xml"==ua.substring(0,18)){var qa="mx-symbol-"+mxUtils.hashCode(ua+"|"+("none"!=xa)),Aa=d.querySelector('[id="'+qa+'"]');if(null!=Aa&&"symbol"==Aa.nodeName){sa?na(ra,qa):(ba["#"+W.getAttribute("id")]=qa,W.parentNode.removeChild(W));continue}}null==ea[ua]&&(ea[ua]={},aa.push(ua));null==ea[ua][xa]&&(ea[ua][xa]=[]);ea[ua][xa].push({node:W,inline:sa})}}ha();var Ba=function(){for(var Ea=null,Fa=null;0<aa.length&&null==Ea;){Ea=aa.pop();Fa=ea[Ea];var ca=0,fa=0,oa;for(oa in Fa)ca++,fa=Math.max(fa,Fa[oa].length);2>ca&&2>fa&&(Ea=null)}if(null==Ea)D();else{var pa=new Image;pa.onload=function(){try{var wa=pa.naturalWidth,za=pa.naturalHeight;if(0<wa&&0<za){var ia=d.ownerDocument,ka=0,da;for(da in Fa)ka++;var ja=function(bb){return null!=ia.createElementNS?ia.createElementNS(mxConstants.NS_SVG,bb):ia.createElement(bb)},ta=function(){var bb=ja("image");bb.setAttribute("width",wa);bb.setAttribute("height",za);null==bb.setAttributeNS?bb.setAttribute("xlink:href",Ea):bb.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Ea);return bb},va=null;if(1<ka){for(va="mx-data-"+mxUtils.hashCode(Ea);null!=d.querySelector('[id="'+va+'"]');)va+="-1";var Ca=ta();Ca.setAttribute("id",va);V().appendChild(Ca)}for(da in Fa){var Ha=Fa[da];ka=null;for(Ca=0;Ca<Ha.length&&null==ka;Ca++)Ha[Ca].inline||(ka=Ha[Ca].node.getAttribute("id"));if(null==ka)for(ka="mx-image-"+mxUtils.hashCode(Ea+"|"+da);null!=d.querySelector('[id="'+ka+'"]');)ka+="-1";var Ja=ja("symbol");Ja.setAttribute("id",ka);Ja.setAttribute("viewBox","0 0 "+wa+" "+za);""!=da&&Ja.setAttribute("preserveAspectRatio",da);if(null!=va){var Ra=ja("use");Ra.setAttribute("href","#"+-va);Ra.setAttribute("xlink:href","#"+va);Ja.appendChild(Ra)}else Ja.appendChild(ta());V().appendChild(Ja);for(Ca=0;Ca<Ha.length;Ca++){var Va=Ha[Ca].node;Ha[Ca].inline?na(Va,ka):(Va.getAttribute("id")!=ka&&(ba["#"+Va.getAttribute("id")]=ka),Va.parentNode.removeChild(Va))}}ha()}}catch(bb){}Ba()};pa.onerror=function(){Ba()};pa.src=Ea}};Ba()}catch(Ea){D()}}))});r("image","xlink:href");r("img","src");Y();H();D()};Editor.base64Encode=function(d){for(var m="",r=0,A=d.length,D,G,O;r<A;){D=d.charCodeAt(r++)&-255;if(r==A){m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(D>>2);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((D&3)<<4);m+="==";break}G=d.charCodeAt(r++);if(r==A){m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(D>>2);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((D&3)<<4|(G&240)>>4);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((G&15)<<2);m+="=";-break}O=d.charCodeAt(r++);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(D>>2);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((D&3)<<4|(G&240)>>4);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((G&15)<<2|(O&192)>>6);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(O&63)}return m};Editor.prototype.loadUrl=function(d,m,r,A,D,G,O,P){try{var V=!O&&(A||/(\.png)($|\?)/i.test(d)||/(\.jpe?g)($|\?)/i.test(d)||-/(\.gif)($|\?)/i.test(d)||/(\.pdf)($|\?)/i.test(d));D=null!=D?D:!0;var Y=mxUtils.bind(this,function(){mxUtils.get(d,mxUtils.bind(this,function(H){200<=H.getStatus()&&299>=H.getStatus()?null!=m&&(H=H.getText(),V&&(G=null!=G?G:"data:image/png;base64,",H=G+Editor.base64Encode(H)),m(H)):null!=r&&(0==H.getStatus()?r({message:mxResources.get("accessDenied")},H):404==H.getStatus()?r({message:mxResources.get("fileNotFound"),code:H.getStatus()},H):r({message:this.getErrorMessage(H)},H))}),function(H){null!=-r&&r({message:mxResources.get("error")+" "+H.getStatus()})},V,this.timeout,function(){D&&null!=r&&r({code:App.ERROR_TIMEOUT,retry:Y})},P)});Y()}catch(H){null!=r&&r(H)}};Editor.prototype.getErrorMessage=function(d){var m=mxResources.get("error")+" "+d.getStatus();try{var r=d.getText(),A=JSON.parse(r);null!=A&&null!=A.error&&null!=A.error.message&&(m=A.error.message+" ("+m+")")}catch(D){}return m};Editor.prototype.absoluteCssFonts=function(d){var m=null;if(null!=d){var r=d.split("url(");if(0<r.length){m=-[r[0]];d=window.location.pathname;var A=null!=d?d.lastIndexOf("/"):-1;0<=A&&(d=d.substring(0,A+1));A=document.getElementsByTagName("base");var D=null;null!=A&&0<A.length&&(D=A[0].getAttribute("href"));for(var G=1;G<r.length;G++)if(A=r[G].indexOf(")"),0<A){var O=Editor.trimCssUrl(r[G].substring(0,A));this.graph.isRelativeUrl(O)&&(O=null!=D?D+O:window.location.protocol+"//"+window.location.hostname+("/"==O.charAt(0)?"":d)+O);m.push('url("'+O+'"'+r[G].substring(A))}else m.push(r[G])}else m=[d]}return null!=-m?m.join(""):null};Editor.prototype.mapFontUrl=function(d,m,r){/^https?:\/\//.test(m)&&!this.isCorsEnabledForUrl(m)&&(m=PROXY_URL+"?url="+encodeURIComponent(m));r(d,m)};Editor.prototype.embedCssFonts=function(d,m){var r=d.split("url("),A=0;null==this.cachedFonts&&(this.cachedFonts={});var D=mxUtils.bind(this,function(){if(0==A){for(var V=[r[0]],Y=1;Y<r.length;Y++){var H=r[Y].indexOf(")");V.push('url("');V.push(this.cachedFonts[Editor.trimCssUrl(r[Y].substring(0,H))]);V.push('"'+r[Y].substring(H))}m(V.join(""))}});-if(0<r.length){for(d=1;d<r.length;d++){var G=r[d].indexOf(")"),O=null,P=r[d].indexOf("format(",G);0<P&&(O=Editor.trimCssUrl(r[d].substring(P+7,r[d].indexOf(")",P))));mxUtils.bind(this,function(V){if(null==this.cachedFonts[V]){this.cachedFonts[V]=V;A++;var Y="application/x-font-ttf";if("svg"==O||/(\.svg)($|\?)/i.test(V))Y="image/svg+xml";else if("otf"==O||"embedded-opentype"==O||/(\.otf)($|\?)/i.test(V))Y="application/x-font-opentype";else if("woff"==O||/(\.woff)($|\?)/i.test(V))Y="application/font-woff";-else if("woff2"==O||/(\.woff2)($|\?)/i.test(V))Y="application/font-woff2";else if("eot"==O||/(\.eot)($|\?)/i.test(V))Y="application/vnd.ms-fontobject";else if("sfnt"==O||/(\.sfnt)($|\?)/i.test(V))Y="application/font-sfnt";this.mapFontUrl(Y,V,mxUtils.bind(this,function(H,W){this.loadUrl(W,mxUtils.bind(this,function(Z){this.cachedFonts[V]=Z;A--;D()}),mxUtils.bind(this,function(Z){A--;D()}),!0,null,"data:"+H+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(r[d].substring(0,G)),O)}D()}else m(d)};Editor.prototype.loadFonts=-function(d){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(m){this.resolvedFontCss=m;null!=d&&d()})):null!=d&&d()};Editor.prototype.createGoogleFontCache=function(){var d={},m;for(m in Graph.fontMapping)Graph.isCssFontUrl(m)&&(d[m]=Graph.fontMapping[m]);return d};Editor.prototype.embedExtFonts=function(d){var m=this.graph.getCustomFonts();if(0<m.length){var r=[],A=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());-for(var D=mxUtils.bind(this,function(){0==A&&this.embedCssFonts(r.join(""),d)}),G=0;G<m.length;G++)mxUtils.bind(this,function(O,P){Graph.isCssFontUrl(P)?null==this.cachedGoogleFonts[P]?(A++,this.loadUrl(Graph.rewriteGoogleFontUrl(P),mxUtils.bind(this,function(V){this.cachedGoogleFonts[P]=V;r.push(V+"\n");A--;D()}),mxUtils.bind(this,function(V){A--;r.push("@import url("+P+");\n");D()}))):r.push(this.cachedGoogleFonts[P]+"\n"):r.push('@font-face {font-family: "'+O+'";src: url("'+P+'")}\n')})(m[G].name,-m[G].url);D()}else d()};Editor.prototype.addMathCss=function(d){d=d.getElementsByTagName("defs");if(null!=d&&0<d.length)for(var m=document.getElementsByTagName("style"),r=0;r<m.length;r++){var A=mxUtils.getTextContent(m[r]);0>A.indexOf("mxPageSelector")&&0<A.indexOf("MathJax")&&d[0].appendChild(m[r].cloneNode(!0))}};Editor.prototype.addFontCss=function(d,m){m=null!=m?m:this.absoluteCssFonts(this.fontCss);if(null!=m){var r=mxUtils.getSvgDefs(d),A=m.split("\n");m=[];for(var D=[],G=0;G<A.length;G++)"@import"==-A[G].substring(0,7)?m.push(A[G]):D.push(A[G]);d=d.ownerDocument;d=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"style"):d.createElement("style");d.setAttribute("type","text/css");0<m.length&&(mxUtils.setTextContent(d,m.join("\n")),r.appendChild(d));0<D.length&&(d=d.cloneNode(!1),mxUtils.setTextContent(d,D.join("\n")),r.appendChild(d))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(d,-m,r){var A=mxClient.IS_FF?8192:16384;return Math.min(r,Math.min(A/d,A/m))};Editor.prototype.exportToCanvas=function(d,m,r,A,D,G,O,P,V,Y,H,W,Z,X,ba,ea,aa,ha){try{G=null!=G?G:!0;O=null!=O?O:!0;W=null!=W?W:this.graph;Z=null!=Z?Z:0;var na=V?null:W.background;na==mxConstants.NONE&&(na=null);null==na&&(na=A);null==na&&0==V&&(na="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(W.getSvg(null,null,Z,X,null,O,null,null,null,Y,null,ea,aa,ha),mxUtils.bind(this,function(ra){try{ra.style.setProperty("-webkit-font-smoothing",-"antialiased");ra.style.setProperty("-moz-osx-font-smoothing","grayscale");var sa=new Image;sa.onload=mxUtils.bind(this,function(){try{var xa=function(){mxClient.IS_SF?window.setTimeout(function(){Ea.drawImage(sa,0,0);d(qa,ra)},0):(Ea.drawImage(sa,0,0),d(qa,ra))},qa=document.createElement("canvas"),Aa=parseInt(ra.getAttribute("width")),Ba=parseInt(ra.getAttribute("height"));P=null!=P?P:1;null!=m&&(P=G?Math.min(1,Math.min(3*m/(4*Ba),m/Aa)):m/Aa);P=this.getMaxCanvasScale(Aa,Ba,P);Aa=Math.ceil(P*Aa);-Ba=Math.ceil(P*Ba);qa.setAttribute("width",Aa);qa.setAttribute("height",Ba);var Ea=qa.getContext("2d");if(null!=na){var Fa=mxUtils.getLightDarkColor(na);Ea.beginPath();Ea.rect(0,0,Aa,Ba);Ea.fillStyle="dark"==ea&&"none"!=W.getAdaptiveColors()?Fa.dark:Fa.light;Ea.fill()}1!=P&&Ea.scale(P,P);if(ba){var ca=W.view,fa=ca.scale;ca.scale=1;var oa=btoa(unescape(encodeURIComponent(ca.createSvgGrid(ca.gridColor))));ca.scale=fa;oa="data:image/svg+xml;base64,"+oa;var pa=W.gridSize*ca.gridSteps*P,wa=W.getGraphBounds(),-za=ca.translate.x*fa,ia=ca.translate.y*fa,ka=za+(wa.x-za)/fa-Z,da=ia+(wa.y-ia)/fa-Z,ja=new Image;ja.onload=function(){try{for(var ta=-Math.round(pa-mxUtils.mod((za-ka)*P,pa)),va=-Math.round(pa-mxUtils.mod((ia-da)*P,pa));ta<Aa;ta+=pa)for(var Ca=va;Ca<Ba;Ca+=pa)Ea.drawImage(ja,ta/P,Ca/P);xa()}catch(Ha){null!=D&&D(Ha)}};ja.onerror=function(ta){null!=D&&D(ta)};ja.src=oa}else xa()}catch(ta){null!=D&&D(ta)}});sa.onerror=function(xa){null!=D&&D(xa)};Y&&this.graph.addSvgShadow(ra);this.graph.mathEnabled&&-this.addMathCss(ra);var ua=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(ra,this.resolvedFontCss),sa.src=Editor.createSvgDataUri(mxUtils.getXml(ra))}catch(xa){null!=D&&D(xa)}});this.embedExtFonts(mxUtils.bind(this,function(xa){try{null!=xa&&this.addFontCss(ra,xa),this.loadFonts(ua)}catch(qa){null!=D&&D(qa)}}))}catch(xa){null!=D&&D(xa)}}),r,H)}catch(ra){null!=D&&D(ra)}};Editor.crcTable=[];for(var x=0;256>x;x++)for(var B=x,z=0;8>z;z++)B=1==(B&1)?3988292384^B>>>1:B>>>1,-Editor.crcTable[x]=B;Editor.updateCRC=function(d,m,r,A){for(var D=0;D<A;D++)d=Editor.crcTable[(d^m.charCodeAt(r+D))&255]^d>>>8;return d};Editor.crc32=function(d){for(var m=-1,r=0;r<d.length;r++)m=m>>>8^Editor.crcTable[(m^d.charCodeAt(r))&255];return(m^-1)>>>0};Editor.writeGraphModelToPng=function(d,m,r,A,D){function G(H,W){var Z=V;V+=W;return H.substring(Z,V)}function O(H){H=G(H,4);return H.charCodeAt(3)+(H.charCodeAt(2)<<8)+(H.charCodeAt(1)<<16)+(H.charCodeAt(0)<<24)}function P(H){return String.fromCharCode(H>>-24&255,H>>16&255,H>>8&255,H&255)}d=d.substring(d.indexOf(",")+1);d=window.atob?atob(d):Base64.decode(d,!0);var V=0;if(G(d,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=D&&D();else if(G(d,4),"IHDR"!=G(d,4))null!=D&&D();else{G(d,17);D=d.substring(0,V);do{var Y=O(d);if("IDAT"==G(d,4)){D=d.substring(0,V-8);"pHYs"==m&&"dpi"==r?(r=Math.round(A/.0254),r=P(r)+P(r)+String.fromCharCode(1)):r=r+String.fromCharCode(0)+("zTXt"==m?String.fromCharCode(0):"")+A;A=4294967295;A=Editor.updateCRC(A,-m,0,4);A=Editor.updateCRC(A,r,0,r.length);D+=P(r.length)+m+r+P(A^4294967295);D+=d.substring(V-8,d.length);break}D+=d.substring(V-8,V-4+Y);G(d,Y);G(d,4)}while(Y);return"data:image/png;base64,"+(window.btoa?btoa(D):Base64.encode(D,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var F=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(d,m){F.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};-var K=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){K.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(d,m,r){var A=null;if(null!=r)return null;null!=d.editor.graph.getModel().getParent(m)?A=m.getId():null!=d.currentPage&&(A=d.currentPage.getId());return A});if(null!=window.StyleFormatPanel){var M=Format.prototype.init;Format.prototype.init=-function(){M.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var L=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?L.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(d){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var Q=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=-function(d){d=Q.apply(this,arguments);var m=this.editorUi,r=m.editor.graph;if(r.isEnabled()){var A=m.getCurrentFile();null!=A&&A.isAutosaveOptional()&&d.appendChild(this.createOption(mxResources.get("autosave"),function(){return m.editor.autosave},function(G){m.editor.setAutosave(G);m.editor.autosave&&A.isModified()&&A.fileChanged()},{install:function(G){this.listener=function(){G(m.editor.autosave)};m.editor.addListener("autosaveChanged",this.listener)},destroy:function(){m.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&-r.isEnabled()&&"undefined"!==typeof MathJax){var D=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return r.mathEnabled},function(G){m.actions.get("mathematicalTypesetting").funct()},{install:function(G){this.listener=function(){G(r.mathEnabled)};m.addListener("mathEnabledChanged",this.listener)},destroy:function(){m.removeListener(this.listener)}});d.appendChild(D);(!m.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&D.appendChild(m.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return d};-mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(d,m){return 0<mxUtils.getValue(d.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.ellipse.prototype.customProperties=-[{name:"centerRadius",dispName:"Center Radius",type:"float",min:0,defVal:0},{name:"centerColor",dispName:"Center Color",type:"color",defVal:null,primary:!0,isVisible:function(d,m){return 0<mxUtils.getValue(d.style,"centerRadius",0)}}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=-[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",-dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},-{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2,isVisible:function(d){return"0"==mxUtils.getValue(d.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(d){return"1"==mxUtils.getValue(d.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,-defVal:.25,isVisible:function(d){return"0"==mxUtils.getValue(d.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:25,isVisible:function(d){return"1"==mxUtils.getValue(d.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,-min:0,max:1},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",-dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder3.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlState.prototype.customProperties=-[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.step.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",type:"float",min:0,defVal:20},{name:"fixedSize",dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},-{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.note2.prototype.customProperties=-[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.card.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20},-{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",dispName:"Left"},-{val:"right",dispName:"Right"}]},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},{name:"swimlaneBody",-dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},{name:"separatorColor",dispName:"Separator Color",type:"color",defVal:null},{name:"fixedHeader",dispName:"Fixed Header",type:"bool",defVal:!0,getDefaultValue:function(d,m){d=mxCellRenderer.defaultShapes[mxUtils.getValue(d.style,"shape","")];return null!=d&&null!=d.prototype.fixedHeaderDefault?d.prototype.fixedHeaderDefault?"1":"0":"1"}}];mxCellRenderer.defaultShapes.table.prototype.customProperties=-[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=-mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",-min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0},{name:"imageAlign",-dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},{name:"imageVerticalAlign",dispName:"Image Vertical Align",type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",type:"float",min:0,defVal:24},{name:"arcSize",-dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(d,m){return 0<mxUtils.getValue(d.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=-[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",-min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=-[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.cross.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.corner.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.tee.prototype.customProperties=-[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.umlLifeline.prototype.customProperties=[{name:"participant",dispName:"Participant",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName:"Actor"},{val:"umlBoundary",dispName:"Boundary"},{val:"umlEntity",dispName:"Entity"},{val:"umlControl",dispName:"Control"}]},{name:"size",dispName:"Height",type:"float",defVal:40,-min:0},{name:"lifelineMirror",dispName:"Mirror Head",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:"width",dispName:"Title Width",type:"float",defVal:60,min:0},{name:"height",dispName:"Title Height",type:"float",defVal:30,min:0}];StyleFormatPanel.prototype.defaultColorSchemes=[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",-stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},-{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},-{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",-stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;var c=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var d=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&0<d.cells.length&&-this.container.appendChild(this.addStyles(this.createPanel()));c.apply(this,arguments);null!=d.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),d.customProperties,d))};var f=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(d){var m=this.editorUi.getSelectionState();1==m.cells.length?this.addActions(d,["copyStyle","pasteStyle"]):1<=m.cells.length&&this.addActions(d,["pasteStyle","pasteData"]);f.apply(this,arguments);return d};-EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(d,m,r,A){function D(Fa){try{return decodeURIComponent(Fa)}catch(ca){return Fa}}function G(Fa,ca,fa,oa,pa){if(null!=fa.valueChanged)fa.valueChanged(ca,pa,r,Z);else{X.getModel().beginUpdate();try{pa=[];var wa=[];if(null!=fa.index){for(var za=[],ia=fa.parentRow.nextSibling;ia&&ia.getAttribute("data-pName")==Fa;)za.push(ia.getAttribute("data-pValue")),ia=ia.nextSibling;fa.index<za.length?null!=oa?za.splice(oa,1):-za[fa.index]=ca:za.push(ca);null!=fa.size&&za.length>fa.size&&(za=za.slice(0,fa.size));ca=za.join(",");null!=fa.countProperty&&(X.setCellStyles(fa.countProperty,za.length,X.getSelectionCells()),pa.push(fa.countProperty),wa.push(za.length))}X.setCellStyles(Fa,ca,X.getSelectionCells());pa.push(Fa);wa.push(ca);if(null!=fa.dependentProps)for(Fa=0;Fa<fa.dependentProps.length;Fa++){var ka=fa.dependentPropsDefVal[Fa],da=fa.dependentPropsVals[Fa];if(da.length>ca)da=da.slice(0,ca);else for(var ja=da.length;ja<-ca;ja++)da.push(ka);da=da.join(",");X.setCellStyles(fa.dependentProps[Fa],da,X.getSelectionCells());pa.push(fa.dependentProps[Fa]);wa.push(da)}if("function"==typeof fa.onChange)fa.onChange(X,ca);Z.editorUi.fireEvent(new mxEventObject("styleChanged","keys",pa,"values",wa,"cells",X.getSelectionCells()))}finally{X.getModel().endUpdate()}}}function O(Fa,ca){ca.style.left="0px";ca.style.top="0px";ca.style.position="relative";ca.style.right="0px";ca.style.bottom="0px";ca.style.width="100%";ca.style.maxWidth=-"100%";ca.style.maxHeight="100%";ca.style.textAlign="left"}function P(Fa,ca,fa){function oa(wa){if(null==wa||wa==mxConstants.NONE)pa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==wa)pa.style.background="";else{var za=mxUtils.getLightDarkColor(wa);mxUtils.isLightDarkColor(wa)&&za.light!=za.dark?pa.style.background="linear-gradient(to right bottom, "+za.cssText+" 50%, "+mxUtils.invertLightDarkColor(za).cssText+" 50.3%)":pa.style.background=wa}}var pa=document.createElement("div");-pa.style.width="32px";pa.style.height="8px";pa.style.margin="2px";pa.style.borderStyle="solid";pa.style.borderWidth="1px";oa(ca);btn=mxUtils.button("",mxUtils.bind(Z,function(wa){this.editorUi.pickColor(ca,function(za){G(Fa,za,fa);oa(za)});mxEvent.consume(wa)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(pa);return btn}function V(Fa,ca,fa,oa,pa,wa,za){null!=ca&&(ca=ca.split(","),ba.push({name:Fa,values:ca,-type:fa,defVal:oa,countProperty:pa,parentRow:wa,isDeletable:!0,flipBkg:za}));btn=mxUtils.button("+",mxUtils.bind(Z,function(ia){for(var ka=wa,da=0;null!=ka.nextSibling;)if(ka.nextSibling.getAttribute("data-pName")==Fa)ka=ka.nextSibling,da++;else break;var ja={type:fa,parentRow:wa,index:da,isDeletable:!0,defVal:oa,countProperty:pa};da=W(Fa,"",ja,0==da%2,za);G(Fa,oa,ja);ka.parentNode.insertBefore(da,ka.nextSibling);mxEvent.consume(ia)}));btn.style.height="16px";btn.style.width="25px";btn.className=-"geColorBtn";return btn}function Y(Fa,ca,fa,oa,pa,wa,za){if(0<pa){var ia=Array(pa);ca=null!=ca?ca.split(","):[];for(var ka=0;ka<pa;ka++)ia[ka]=null!=ca[ka]?ca[ka]:null!=oa?oa:"";ba.push({name:Fa,values:ia,type:fa,defVal:oa,parentRow:wa,flipBkg:za,size:pa})}return document.createElement("div")}function H(Fa,ca,fa){var oa=document.createElement("input");oa.type="checkbox";oa.checked="1"==ca;mxEvent.addListener(oa,"change",function(){G(Fa,oa.checked?"1":"0",fa,null,oa)});return oa}function W(Fa,ca,fa,-oa,pa){var wa=fa.dispName,za=fa.type,ia=document.createElement("tr");ia.className="gePropRow"+(pa?"Dark":"")+(oa?"Alt":"")+" gePropNonHeaderRow";ia.setAttribute("data-pName",Fa);ia.setAttribute("data-pValue",ca);oa=!1;null!=fa.index&&(ia.setAttribute("data-index",fa.index),wa=(null!=wa?wa:"")+"["+fa.index+"]",oa=!0);var ka=document.createElement("td");ka.className="gePropRowCell";wa=mxResources.get(wa,null,wa);mxUtils.write(ka,wa);ka.setAttribute("title",wa);oa&&(ka.style.textAlign="right");ia.appendChild(ka);-ka=document.createElement("td");ka.className="gePropRowCell";ka.setAttribute("title",null!=ca?D(ca):mxResources.get("none"));mxEvent.addListener(ka,"click",mxUtils.bind(Z,function(va){!mxUtils.isAncestorNode(ia,document.activeElement)&&mxUtils.isAncestorNode(ia.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(va))}));if("color"==za)ka.appendChild(P(Fa,ca,fa));else if("bool"==za||"boolean"==za)ka.appendChild(H(Fa,-ca,fa));else if("enum"==za){var da=fa.enumList;ka.innerHTML="";var ja=document.createElement("div");ja.className="gePropValue";ka.appendChild(ja);for(pa=0;pa<da.length;pa++)if(wa=da[pa],wa.val==ca){mxUtils.write(ja,mxResources.get(wa.dispName,null,wa.dispName));break}mxEvent.addListener(ka,"click",mxUtils.bind(Z,function(va){var Ca=mxEvent.getSource(va);if(!(Ca!=ka&&Ca!=ja||mxEvent.isConsumed(va))){ja.innerHTML="";var Ha=document.createElement("select"),Ja=null;O(ka,Ha);Ha.style.boxSizing="border-box";-Ha.style.height="100%";Ha.style.padding="0";Ha.style.margin="0";Ha.style.border="0";for(va=0;va<da.length;va++){Ca=da[va];var Ra=document.createElement("option");Ra.value=mxUtils.htmlEntities(Ca.val);mxUtils.write(Ra,mxResources.get(Ca.dispName,null,Ca.dispName));Ha.appendChild(Ra);null==Ca.val&&(Ra.value="null",Ja=Ra)}Ha.value=null==ca&&null!=Ja?"null":ca;ja.appendChild(Ha);mxEvent.addListener(Ha,"change",function(){var Va=mxUtils.htmlEntities(Ha.value);if(Ha[Ha.selectedIndex]==Ja||"null"==Va.value)Va=-null;G(Fa,Va,fa)});Ha.focus();mxEvent.addListener(Ha,"blur",function(){ja.innerHTML="";for(var Va=Ha[Ha.selectedIndex]==Ja||"null"==Ha.value?null:Ha.value,bb=0;bb<da.length;bb++){var ab=da[bb];if(ab.val==Va){mxUtils.write(ja,mxResources.get(ab.dispName,null,ab.dispName));break}}})}}))}else if("dynamicArr"==za)ka.appendChild(V(Fa,ca,fa.subType,fa.subDefVal,fa.countProperty,ia,pa));else if("staticArr"==za)ka.appendChild(Y(Fa,ca,fa.subType,fa.subDefVal,fa.size,ia,pa));else if("readOnly"==za)pa=document.createElement("input"),-pa.setAttribute("readonly",""),pa.value=ca,pa.style.borderWidth="0px","id"==Fa||"shape"==Fa?(ia.firstChild.innerHTML="",ia.firstChild.setAttribute("colspan","2"),pa.style.flexGrow="1",pa.style.marginLeft="4px",pa.style.textAlign="id"==Fa?"center":"left",pa.setAttribute("title",ca),wa=document.createElement("div"),mxUtils.write(wa,mxResources.get(Fa)+":"),wa.style.display="inline-flex",wa.style.alignItems="center",wa.style.width="100%",wa.appendChild(pa),ia.firstChild.appendChild(wa)):(pa.style.width=-"96px",ka.appendChild(pa));else{ka.innerHTML="";var ta=document.createElement("div");ta.className="gePropValue";ka.appendChild(ta);ta.innerHTML=mxUtils.htmlEntities(D(ca));mxEvent.addListener(ka,"click",mxUtils.bind(Z,function(va){function Ca(){var Ra=Ja.value,Va=za;Ra=0==Ra.trim().length&&"string"!=Va&&"numbers"!=Va?fa.allowAuto?"auto":0:Ra;fa.allowAuto&&(null!=Ra.trim&&"auto"==Ra.trim().toLowerCase()?(Ra="auto",Va="string"):(Ra=parseFloat(Ra),Ra=isNaN(Ra)?0:Ra));null!=fa.min&&Ra<fa.min?Ra=fa.min:-null!=fa.max&&Ra>fa.max&&(Ra=fa.max);var bb=null;try{bb="numbers"==Va?Ra.match(/\d+/g).map(Number).join(" "):"auto"===Ra&&fa.allowAuto&&"auto"==fa.defVal?null:encodeURIComponent(("int"==Va?parseInt(Ra):Ra)+"")}catch(ab){}G(Fa,bb,fa,null,Ja)}var Ha=mxEvent.getSource(va);if(!(Ha!=ka&&Ha!=ta||mxEvent.isConsumed(va))){ta.innerHTML="";var Ja=document.createElement("input");O(ta,Ja);Ja.value=D(ca);Ja.className="gePropEditor";"int"!=za&&"float"!=za||fa.allowAuto||(Ja.type="number",Ja.step="int"==za?"1":-"any",null!=fa.min&&(Ja.min=parseFloat(fa.min)),null!=fa.max&&(Ja.max=parseFloat(fa.max)));ta.appendChild(Ja);mxEvent.addListener(Ja,"keypress",function(Ra){13==Ra.keyCode&&Ca()});Ja.focus();mxEvent.addListener(Ja,"blur",function(){Ca()})}}))}fa.isDeletable&&(pa=mxUtils.button("-",mxUtils.bind(Z,function(va){G(Fa,"",fa,fa.index);mxEvent.consume(va)})),pa.style.height="16px",pa.style.width="25px",pa.style.float="right",pa.className="geColorBtn",ka.appendChild(pa));ia.appendChild(ka);return ia}var Z=-this,X=this.editorUi.editor.graph,ba=[],ea=document.createElement("table");ea.className="geProperties geFullWidthElement";var aa=document.createElement("tr");aa.className="gePropHeader";var ha=document.createElement("th");ha.className="gePropHeaderCell";ha.style.paddingLeft="16px";ha.style.backgroundRepeat="no-repeat";ha.style.backgroundPosition="-2px 50%";ha.style.backgroundSize="20px";mxUtils.write(ha,mxResources.get("property"));aa.style.cursor="pointer";var na=function(){var Fa=ea.querySelectorAll(".gePropNonHeaderRow");-if(Z.editorUi.propertiesCollapsed){ha.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var ca="none";for(var fa=d.childNodes.length-1;0<=fa;fa--)try{var oa=d.childNodes[fa],pa=oa.nodeName.toUpperCase();"INPUT"!=pa&&"SELECT"!=pa||d.removeChild(oa)}catch(wa){}}else ha.style.backgroundImage="url('"+Editor.arrowDownImage+"')",ca="";for(fa=0;fa<Fa.length;fa++)Fa[fa].style.display=ca};mxEvent.addListener(aa,"click",function(){Z.editorUi.propertiesCollapsed=!Z.editorUi.propertiesCollapsed;na()});-aa.appendChild(ha);var ra=document.createElement("th");ra.className="gePropHeaderCell";ra.style.paddingLeft="4px";mxUtils.write(ra,mxResources.get("value"));aa.appendChild(ra);ea.appendChild(aa);var sa=ra=!1;aa=null;1==r.vertices.length&&0==r.edges.length?aa=r.vertices[0].id:0==r.vertices.length&&1==r.edges.length&&(aa=r.edges[0].id);null==aa||A||(ea.appendChild(W("id",mxUtils.htmlEntities(aa),{dispName:"id",type:"readOnly"},!0,!1)),null!=r.style&&null!=r.style.shape&&ea.appendChild(W("shape",mxUtils.htmlEntities(r.style.shape),-{dispName:"shape",type:"readOnly"},!0,!1)));for(var ua in m)if(A=m[ua],("function"!=typeof A.isVisible||A.isVisible(r,this))&&!A.primary){var xa=null!=A.getValue?A.getValue(r,this):null!=r.style[ua]?mxUtils.htmlEntities(r.style[ua]+""):null!=A.getDefaultValue?A.getDefaultValue(r,this):A.defVal;if("separator"==A.type)sa=!sa;else{if("staticArr"==A.type)A.size=parseInt(r.style[A.sizeProperty]||m[A.sizeProperty].defVal)||0;else if(null!=A.dependentProps){var qa=A.dependentProps,Aa=[],Ba=[];for(aa=0;aa<-qa.length;aa++)if(null!=m[qa[aa]]){var Ea=r.style[qa[aa]];Ba.push(m[qa[aa]].subDefVal);Aa.push(null!=Ea?Ea.split(","):[])}A.dependentPropsDefVal=Ba;A.dependentPropsVals=Aa}ea.appendChild(W(ua,xa,A,ra,sa));ra=!ra}}for(aa=0;aa<ba.length;aa++)for(A=ba[aa],m=A.parentRow,ua=0;ua<A.values.length;ua++)ra=W(A.name,A.values[ua],{type:A.type,parentRow:A.parentRow,isDeletable:A.isDeletable,index:ua,defVal:A.defVal,countProperty:A.countProperty,size:A.size},0==ua%2,A.flipBkg),m.parentNode.insertBefore(ra,m.nextSibling),-m=ra;d.appendChild(ea);na();return d};StyleFormatPanel.prototype.addStyles=function(d){if(null!=this.defaultColorSchemes){var m=this.editorUi,r=m.editor.graph,A=document.createElement("div");A.style.padding="6px 20px 0 24px";d.appendChild(A);var D=document.createElement("div");D.className="geSwitcher";D.style.padding="4px 18px 6px 0px";for(var G=[],O=0;O<this.defaultColorSchemes.length;O++){var P=document.createElement("div");P.className="geSwitcherDot";mxUtils.bind(this,function(Z){mxEvent.addListener(P,-"click",mxUtils.bind(this,function(){V(Z)}))})(O);G.push(P);D.appendChild(P)}var V=mxUtils.bind(this,function(Z){null!=G[Z]&&(null!=this.format.currentScheme&&null!=G[this.format.currentScheme]&&(G[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=Z,Y(this.defaultColorSchemes[this.format.currentScheme]),G[this.format.currentScheme].style.background="#84d7ff")}),Y=mxUtils.bind(this,function(Z){var X=mxUtils.clone(r.defaultVertexStyle);X[mxConstants.STYLE_STROKECOLOR]=-null!=X[mxConstants.STYLE_STROKECOLOR]?X[mxConstants.STYLE_STROKECOLOR]:"default";X[mxConstants.STYLE_FILLCOLOR]=null!=X[mxConstants.STYLE_FILLCOLOR]?X[mxConstants.STYLE_FILLCOLOR]:"default";X[mxConstants.STYLE_FONTCOLOR]=null!=X[mxConstants.STYLE_FONTCOLOR]?X[mxConstants.STYLE_FONTCOLOR]:"default";r.replaceDefaultColors(new mxCell,X);var ba=mxUtils.bind(this,function(aa){var ha=mxUtils.button("",mxUtils.bind(this,function(sa){r.getModel().beginUpdate();try{for(var ua=m.getSelectionState().cells,-xa=r.getModel(),qa=[],Aa=0<ua.length,Ba=0;Ba<ua.length;Ba++){var Ea=xa.isVertex(ua[Ba])&&xa.isEdge(xa.getParent(ua[Ba])),Fa=r.getCellStyle(ua[Ba]),ca=null!=Fa&&"image"==Fa.shape,fa=r.getCellGeometry(ua[Ba]);qa.push({isLabel:ca||Ea&&(null==fa||0>=fa.width||0>=fa.height)});Ea||ca||(Aa=!1)}for(Ba=0;Ba<ua.length;Ba++){var oa=qa[Ba];if(Aa||!oa.isLabel){var pa=oa.isLabel?mxConstants.STYLE_LABEL_BACKGROUNDCOLOR:mxConstants.STYLE_FILLCOLOR,wa=oa.isLabel?mxConstants.STYLE_LABEL_BORDERCOLOR:mxConstants.STYLE_STROKECOLOR,-za=xa.getStyle(ua[Ba]);null!=za&&"string"!==typeof za&&(za=String(za));null!=aa?(mxEvent.isShiftDown(sa)||(za=""==aa.fill||null==aa.fill?mxUtils.setStyle(za,pa,null):mxUtils.setStyle(za,pa,aa.fill),oa.isLabel||(za=""==aa.gradient||null==aa.gradient?mxUtils.setStyle(za,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(za,mxConstants.STYLE_GRADIENTCOLOR,aa.gradient)),mxEvent.isControlDown(sa)||mxClient.IS_MAC&&mxEvent.isMetaDown(sa)||!xa.isVertex(ua[Ba])||(za=""==aa.font||null==aa.font?mxUtils.setStyle(za,-mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(za,mxConstants.STYLE_FONTCOLOR,aa.font))),mxEvent.isAltDown(sa)||(za=""==aa.stroke||null==aa.stroke?mxUtils.setStyle(za,wa,null):mxUtils.setStyle(za,wa,aa.stroke))):(za=mxUtils.setStyle(za,pa,null),za=mxUtils.setStyle(za,wa,null),oa.isLabel||(za=mxUtils.setStyle(za,mxConstants.STYLE_GRADIENTCOLOR,null)),xa.isVertex(ua[Ba])&&(za=mxUtils.setStyle(za,mxConstants.STYLE_FONTCOLOR,null)));xa.setStyle(ua[Ba],za)}}}finally{r.getModel().endUpdate()}}));ha.className=-"geStyleButton";ha.style.width="36px";ha.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";ha.style.margin="0px 6px 6px 0px";if(null!=aa){var na="1px solid";null!=aa.border&&(na=aa.border);if(null!=aa.gradient)ha.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(aa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(aa.gradient).cssText+" 100%)";else if(aa.fill==mxConstants.NONE)ha.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==aa.fill||""==aa.fill)ha.style.backgroundColor=-mxUtils.getLightDarkColor(mxUtils.getValue(X,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var ra=mxUtils.getLightDarkColor(aa.fill);ha.style.backgroundImage="linear-gradient(to right bottom, "+ra.cssText+" 50%, "+ra.light+" 50.3%)"}null==aa.stroke||aa.stroke==mxConstants.NONE?ha.style.border=na+" transparent":""==aa.stroke?ha.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(X,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(ra=mxUtils.getLightDarkColor(aa.stroke),ha.style.border=-na+" "+ra.cssText,ha.style.borderRightColor=ra.light,ha.style.borderBottomColor=ha.style.borderRightColor);null!=aa.title&&ha.setAttribute("title",aa.title)}else na=mxUtils.getValue(X,mxConstants.STYLE_FILLCOLOR,"#ffffff"),ra=mxUtils.getValue(X,mxConstants.STYLE_STROKECOLOR,"#000000"),ha.style.backgroundColor=na,ha.style.border="1px solid "+ra;ha.style.borderRadius="0";A.appendChild(ha);null!=aa&&null!=aa.gradient&&(na=ha.cloneNode(!1),na.style.backgroundImage="linear-gradient(light-dark(transparent, "+-mxUtils.getLightDarkColor(aa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(aa.gradient).light+") 100%)",na.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",na.style.backgroundColor="transparent",A.appendChild(na),na.style.marginLeft="-42px",mxEvent.addListener(na,"click",function(){ha.click()}))});A.innerText="";if(null!=Z)for(var ea=0;ea<Z.length;ea++)0<ea&&0==mxUtils.mod(ea,4)&&mxUtils.br(A),ba(Z[ea])});null==this.format.currentScheme?V(Math.min(G.length-1,Editor.isDarkMode()?-1:"1"==urlParams.sketch?5:0)):V(this.format.currentScheme);O=10>=this.defaultColorSchemes.length?43:23;var H=document.createElement("div");H.className="geButton";H.style.cssText="position:absolute;left:0px;bottom:"+O+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(H,"click",mxUtils.bind(this,function(){V(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var W=document.createElement("div");W.className="geButton";W.style.cssText="position:absolute;left:186px;bottom:"+-O+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(d.appendChild(H),d.appendChild(W));mxEvent.addListener(W,"click",mxUtils.bind(this,function(){V(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));Y(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&d.appendChild(D)}return d}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+-STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(d){return d.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||d.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(d){return Graph.isGoogleFontUrl(d)};Graph.rewriteGoogleFontUrl=function(d){null!=d&&d.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(d=Editor.GOOGLE_FONTS_CSS2+d.substring(Editor.GOOGLE_FONTS.length)+-":wght@400;500");return d};Graph.createFontElement=function(d,m){var r=Graph.fontMapping[m];null==r&&Graph.isCssFontUrl(m)?(d=document.createElement("link"),d.setAttribute("rel","stylesheet"),d.setAttribute("type","text/css"),d.setAttribute("charset","UTF-8"),d.setAttribute("href",Graph.rewriteGoogleFontUrl(m))):(null==r&&(r='@font-face {\nfont-family: "'+d+'";\nsrc: url("'+m+'");\n}'),d=document.createElement("style"),mxUtils.write(d,r));return d};Graph.addRecentCustomFont=function(d,m){};Graph.addFont=-function(d,m,r,A){if(null!=d&&0<d.length&&null!=m&&0<m.length){A=null!=A?A:Graph.customFontElements;var D=d.toLowerCase();if("helvetica"!=D&&"arial"!=d&&"sans-serif"!=D){var G=A[D];null!=G&&G.url!=m&&(G.elt.parentNode.removeChild(G.elt),G=null);null==G?(G=m,"http:"==m.substring(0,5)&&(G=PROXY_URL+"?url="+encodeURIComponent(m)),G={name:d,url:m,elt:Graph.createFontElement(d,G)},A[D]=G,m=A==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=r&&("link"==G.elt.nodeName.toLowerCase()?-(G.elt.onload=r,G.elt.onerror=r):r()),null!=m&&m.appendChild(G.elt)):null!=r&&r()}else null!=r&&r()}else null!=r&&r();return d};Graph.getFontUrl=function(d,m){d=Graph.customFontElements[d.toLowerCase()];null!=d&&(m=d.url);return m};Graph.processFontAttributes=function(d){d=d.getElementsByTagName("*");for(var m=0;m<d.length;m++){var r=d[m].getAttribute("data-font-src");if(null!=r){var A="FONT"==d[m].nodeName?d[m].getAttribute("face"):d[m].style.fontFamily;null!=A&&Graph.addFont(A,r)}}};Graph.processFontStyle=-function(d){if(null!=d){var m=mxUtils.getValue(d,"fontSource",null);if(null!=m){var r=mxUtils.getValue(d,mxConstants.STYLE_FONTFAMILY,null);if(null!=r)try{Graph.addFont(r,decodeURIComponent(m))}catch(A){}}}return d};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;mxConnectionHandler.prototype.createTarget="1"==urlParams.sketch;-Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var k=Graph.prototype.init;Graph.prototype.init=function(){function d(D){m=D}k.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var m=null;mxEvent.addListener(this.container,"mouseenter",d);mxEvent.addListener(this.container,"mousemove",-d);mxEvent.addListener(this.container,"mouseleave",function(D){m=null});this.isMouseInsertPoint=function(){return null!=m};var r=this.getInsertPoint;this.getInsertPoint=function(D){return null==m||D?r.apply(this,arguments):this.getPointForEvent(m)};var A=this.layoutManager.getLayout;this.layoutManager.getLayout=function(D){var G=this.graph.getCellStyle(D);if(null!=G&&"rack"==G.childLayout){var O=new mxStackLayout(this.graph,!1);O.gridSize=null!=G.rackUnitSize?parseFloat(G.rackUnitSize):"undefined"!==-typeof mxRackContainer?mxRackContainer.unitSize:20;O.marginLeft=G.marginLeft||0;O.marginRight=G.marginRight||0;O.marginTop=G.marginTop||0;O.marginBottom=G.marginBottom||0;O.allowGaps=G.allowGaps||0;O.horizontal="1"==mxUtils.getValue(G,"horizontalRack","0");O.resizeParent=!1;O.fill=!0;return O}return A.apply(this,arguments)};this.updateGlobalUrlVariables()};var n=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(d,m){return Graph.processFontStyle(n.apply(this,arguments))};-var q=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(d,m,r,A,D,G,O,P,V,Y,H,W){q.apply(this,arguments);Graph.processFontAttributes(W)};var t=mxText.prototype.redraw;mxText.prototype.redraw=function(){t.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(d,m,r,A){function D(){for(var ea=P.getSelectionCells(),aa=[],ha=0;ha<ea.length;ha++)P.isCellVisible(ea[ha])&&aa.push(ea[ha]);-P.setSelectionCells(aa)}function G(ea){P.setHiddenTags(ea?[]:V.slice());D();P.refresh()}function O(ea,aa){H.innerText="";if(0<ea.length){var ha=document.createElement("table");ha.setAttribute("cellpadding","2");ha.style.boxSizing="border-box";ha.style.tableLayout="fixed";ha.style.width="100%";var na=document.createElement("tbody");if(null!=ea&&0<ea.length)for(var ra=0;ra<ea.length;ra++)(function(sa){function ua(){var Fa=P.getCellsForTags([sa],null,null,!0);P.isEnabled()?P.setSelectionCells(Fa):P.highlightCells(Fa,-null,null,70)}var xa=0>mxUtils.indexOf(P.hiddenTags,sa),qa=document.createElement("tr"),Aa=document.createElement("td");Aa.style.align="center";Aa.style.width="16px";var Ba=document.createElement("img");Ba.setAttribute("src",xa?Editor.visibleImage:Editor.hiddenImage);Ba.setAttribute("title",mxResources.get(xa?"hideIt":"show",[sa])+"\n"+mxResources.get("shiftClickShowOnly",[sa]));mxUtils.setOpacity(Ba,xa?75:25);Ba.className="geAdaptiveAsset";Ba.style.verticalAlign="middle";Ba.style.cursor="pointer";-Ba.style.width="16px";if(m||Editor.isDarkMode())Ba.style.filter="invert(100%)";Aa.appendChild(Ba);mxEvent.addListener(Ba,"click",function(Fa){if(mxEvent.isShiftDown(Fa)){for(var ca=[],fa=0;fa<V.length;fa++)V[fa]!==sa&&ca.push(V[fa]);var oa=0<ca.length;for(fa=0;fa<ca.length;fa++)if(0>mxUtils.indexOf(P.hiddenTags,ca[fa])){oa=!1;break}oa&&0>mxUtils.indexOf(P.hiddenTags,sa)?P.setHiddenTags([]):P.setHiddenTags(ca)}else P.toggleHiddenTag(sa);D();P.refresh();mxEvent.consume(Fa)});qa.appendChild(Aa);Aa=document.createElement("td");-Aa.style.align="center";Aa.style.width="16px";Ba=document.createElement("img");Ba.setAttribute("src",Editor.selectImage);Ba.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Ba,xa?75:25);Ba.className="geAdaptiveAsset";Ba.style.verticalAlign="middle";Ba.style.cursor="pointer";Ba.style.width="16px";if(m||Editor.isDarkMode())Ba.style.filter="invert(100%)";mxEvent.addListener(Ba,"click",function(Fa){G(!0);ua();mxEvent.consume(Fa)});Aa.appendChild(Ba);qa.appendChild(Aa);Aa=document.createElement("td");-Aa.style.overflow="hidden";Aa.style.whiteSpace="nowrap";Aa.style.textOverflow="ellipsis";Aa.style.verticalAlign="middle";Aa.style.cursor="pointer";Aa.setAttribute("title",sa);a=document.createElement("a");mxUtils.write(a,sa);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,xa?100:40);Aa.appendChild(a);mxEvent.addListener(Aa,"click",function(Fa){if(mxEvent.isShiftDown(Fa))G(!0),ua();else if(xa&&0<P.hiddenTags.length)G(!0);else{var ca=V.slice(),fa=mxUtils.indexOf(ca,-sa);ca.splice(fa,1);P.setHiddenTags(ca);D();P.refresh()}mxEvent.consume(Fa)});qa.appendChild(Aa);if(P.isEnabled()){Aa=document.createElement("td");Aa.style.verticalAlign="middle";Aa.style.textAlign="center";Aa.style.width="18px";if(null==aa){Aa.style.align="center";Aa.style.width="16px";Ba=document.createElement("img");Ba.setAttribute("src",Editor.trashImage);Ba.setAttribute("title",mxResources.get("removeIt",[sa]));mxUtils.setOpacity(Ba,xa?75:25);Ba.className="geAdaptiveAsset";Ba.style.verticalAlign=-"middle";Ba.style.cursor="pointer";Ba.style.width="16px";if(m||Editor.isDarkMode())Ba.style.filter="invert(100%)";mxEvent.addListener(Ba,"click",function(Fa){var ca=mxUtils.indexOf(V,sa);0<=ca&&V.splice(ca,1);P.removeTagsForCells(P.model.getDescendants(P.model.getRoot()),[sa]);P.refresh();mxEvent.consume(Fa)});Aa.appendChild(Ba)}else{var Ea=document.createElement("input");Ea.setAttribute("type","checkbox");Ea.style.margin="0px";Ea.defaultChecked=null!=aa&&0<=mxUtils.indexOf(aa,sa);Ea.checked=Ea.defaultChecked;-Ea.style.background="transparent";Ea.setAttribute("title",mxResources.get(Ea.defaultChecked?"removeIt":"add",[sa]));mxEvent.addListener(Ea,"change",function(Fa){Ea.checked?P.addTagsForCells(P.getSelectionCells(),[sa]):P.removeTagsForCells(P.getSelectionCells(),[sa]);mxEvent.consume(Fa)});Aa.appendChild(Ea)}qa.appendChild(Aa)}na.appendChild(qa)})(ea[ra]);ha.appendChild(na);H.appendChild(ha)}}var P=this,V=P.hiddenTags.slice(),Y=document.createElement("div");Y.style.userSelect="none";Y.style.overflow=-"hidden";Y.style.padding="10px";Y.style.height="100%";var H=document.createElement("div");H.style.position="absolute";H.style.boxSizing="border-box";H.style.userSelect="none";H.style.overflow="auto";H.style.padding="3px";H.style.left="0px";H.style.right="0px";H.style.top="0px";H.style.bottom="0px";Y.appendChild(H);P.addListener(mxEvent.ROOT,function(){V=P.hiddenTags.slice()});var W=mxUtils.bind(this,function(ea,aa){if(d()){ea=P.getAllTags();for(aa=0;aa<ea.length;aa++)0>mxUtils.indexOf(V,ea[aa])&&-V.push(ea[aa]);V.sort();P.isSelectionEmpty()?O(V):O(V,P.getCommonTagsForCells(P.getSelectionCells()))}});P.selectionModel.addListener(mxEvent.CHANGE,W);P.model.addListener(mxEvent.CHANGE,W);P.addListener(mxEvent.REFRESH,W);var Z=document.createElement("div");Z.className="geToolbarContainer geDialogToolbar";Z.style.position="absolute";Z.style.display="flex";Z.style.bottom="0px";Z.style.left="0px";Z.style.right="0px";Z.style.height="32px";Z.style.overflow="hidden";Z.style.padding="3px 4px 4px 4px";-Z.style.borderWidth="1px 0px 0px 0px";Z.style.borderStyle="solid";Z.style.whiteSpace="nowrap";if(P.isEnabled()){H.style.bottom="32px";var X=document.createElement("a");X.className="geButton";var ba=X.cloneNode(!1);ba.style.backgroundImage="url("+Editor.visibleImage+")";ba.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(ba,"click",function(ea){P.setHiddenTags([]);mxEvent.isShiftDown(ea)||(V=P.hiddenTags.slice());D();P.refresh();mxEvent.consume(ea)});Z.appendChild(ba);null!=r&&(X=-X.cloneNode(!1),X.style.backgroundImage="url("+Editor.plusImage+")",X.setAttribute("title",mxResources.get("add")),mxEvent.addListener(X,"click",function(ea){r(V,function(aa){V=aa;W()});mxEvent.consume(ea)}),Z.appendChild(X));Y.appendChild(Z)}null!=A&&Z.appendChild(A);return{div:Y,refresh:W}};Graph.prototype.getCustomFonts=function(){var d=this.extFonts;d=null!=d?d.slice():[];for(var m in Graph.customFontElements){var r=Graph.customFontElements[m];d.push({name:r.name,url:r.url})}return d};Graph.prototype.getExtFontCss=-function(){for(var d=this.getCustomFonts(),m="",r="",A=0;A<d.length;A++){var D=d[A].name,G=d[A].url;Graph.isCssFontUrl(G)?m+="@import url("+Graph.rewriteGoogleFontUrl(G)+");\n":r+='@font-face {\nfont-family: "'+D+'";\nsrc: url("'+G+'");\n}\n'}return m+r};Graph.prototype.setFont=function(d,m){Graph.addFont(d,m);var r=Editor.guid();document.execCommand("fontname",!1,r);for(var A=this.cellEditor.textarea.getElementsByTagName("font"),D=!1,G=0;G<A.length;G++)A[G].getAttribute("face")==r&&(D=!0,A[G].setAttribute("face",-d),null!=m?A[G].setAttribute("data-font-src",m):A[G].removeAttribute("data-font-src"));D||document.execCommand("fontname",!1,d)};var u=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return u.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var d=JSON.parse(decodeURIComponent(urlParams.vars));-if(null!=d)for(var m in d)this.globalVars[m]=d[m]}catch(r){null!=window.console&&console.log("Error in vars URL parameter: "+r)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var y=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(d){var m=y.apply(this,arguments);null==m&&null!=this.globalVars&&(m=this.globalVars[d]);return m};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var d=-this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(d.ownerDocument)).decode(d)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var E=Graph.prototype.getSvg;Graph.prototype.getSvg=function(d,m,r,A,D,G,O,P,V,Y,H,W,Z,X,ba,ea,aa){if(Editor.mathOutputSize&&this.mathEnabled&&null!=this.container&&document.body.contains(this.container)&&"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset){if(0==this.container.getElementsByTagName("mjx-container").length)try{MathJax.typeset([this.container])}catch(ua){}this.refreshMathBounds()}var ha=-E.apply(this,arguments);if(null!=W){var na=ha.getAttribute("style");null==na&&(na="");W="auto"==W||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":W;ha.setAttribute("style",na+(" color-scheme: "+W+";"))}var ra=H?this.getExtFontCss():"";if(0<ra.length){var sa=ha.ownerDocument;na=null!=sa.createElementNS?sa.createElementNS(mxConstants.NS_SVG,"style"):sa.createElement("style");null!=sa.setAttributeNS?na.setAttributeNS("type","text/css"):na.setAttribute("type","text/css");-na.appendChild(sa.createTextNode(ra));ha.getElementsByTagName("defs")[0].appendChild(na)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(ha);this.mathEnabled&&(document.body.appendChild(ha),Editor.MathJaxRender(ha),ha.parentNode.removeChild(ha),na=ha.ownerDocument.getElementById("MJX-SVG-styles"),null!=na&&ha.getElementsByTagName("defs")[0].appendChild(na.cloneNode(!0)));return ha};var I=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=-function(d){I.apply(this,arguments);null!=d.secondLabel&&(d.secondLabel.destroy(),d.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(d){return[d.shape,d.text,d.secondLabel,d.control]};var C=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){C.apply(this,arguments);this.enumerationState=0};var U=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(d){null!=d.shape&&this.redrawEnumerationState(d);return U.apply(this,-arguments)};mxGraphView.prototype.createEnumerationValue=function(d){d=decodeURIComponent(mxUtils.getValue(d.style,"enumerateValue",""));""==d&&(d=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(d)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(d){var m="1"==mxUtils.getValue(d.style,"enumerate",0);m&&null==d.secondLabel?(d.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),-d.secondLabel.size=12,d.secondLabel.state=d,d.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(d,d.secondLabel)):m||null==d.secondLabel||(d.secondLabel.destroy(),d.secondLabel=null);m=d.secondLabel;if(null!=m){var r=d.view.scale,A=this.createEnumerationValue(d);d=this.graph.model.isVertex(d.cell)?new mxRectangle(d.x+d.width-4*r,d.y+4*r,0,0):mxRectangle.fromPoint(d.view.getPoint(d));m.bounds.equals(d)&&m.value==A&&m.scale==r||(m.bounds=d,m.value=A,m.scale=-r,m.redraw())}};var J=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();J.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var S=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){S.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=-function(d,m){"data:action/json,"==d.substring(0,17)&&(d=JSON.parse(d.substring(17)),null!=d.actions&&this.executeCustomActions(Graph.flattenAnimationActions(d.actions),null,m))};Graph.flattenAnimationActions=function(d){if(!Array.isArray(d))return d;for(var m=[],r=0;r<d.length;r++){var A=d[r];if(null!=A&&null!=A.animation&&Array.isArray(A.animation.steps)){A=Graph.flattenAnimationActions(A.animation.steps);for(var D=0;D<A.length;D++)m.push(A[D])}else m.push(A)}return m};Graph.smoothScrollContainer=-function(d,m,r,A,D,G){G=G||600;if(m!==A||r!==D){d.scrollLeft=m;d.scrollTop=r;var O="undefined"!=typeof performance&&null!=performance.now?performance.now():Date.now(),P=A-m,V=D-r,Y=function(H){H=Math.min(1,(H-O)/G);var W=1-Math.pow(1-H,3);d.scrollLeft=m+P*W;d.scrollTop=r+V*W;1>H&&window.requestAnimationFrame(Y)};window.requestAnimationFrame(Y)}};Graph.applyTransformTransition=function(d,m){m=m||600;var r=d.view.getDrawPane(),A=null!=r?r.parentNode:null;if(null!=A){var D=A.style.transition;A.style.transition=-"transform "+m+"ms cubic-bezier(0.16, 1, 0.3, 1)";d.armTransformTransition=!0;var G=function(){A.style.transition=D||"";d.armTransformTransition=!1;A.removeEventListener("transitionend",G)};A.addEventListener("transitionend",G);window.setTimeout(G,m+100)}};Graph.prototype.fitBoundsCssTransform=function(d,m){var r=null!=m?m:10;m=this.view.graphBounds;var A=Math.max(m.x,d.x),D=Math.max(m.y,d.y),G=Math.max(1,Math.min(m.x+m.width,d.x+d.width)-A),O=Math.max(1,Math.min(m.y+m.height,d.y+d.height)-D),P=this.container.clientWidth--r,V=this.container.clientHeight-r;d=Math.floor(20*Math.min(P/G,V/O))/20;this.view.scaleAndTranslate(d,-m.x,-m.y);A=(A-m.x)*d-Math.max((P-G*d)/2+r/2,0);r=(D-m.y)*d-Math.max((V-O*d)/2+r/2,0);G=this.getBorder();D=m.width*d+2*G-this.container.clientWidth;m=m.height*d+2*G-this.container.clientHeight;this.container.scrollLeft=0>D?0:Math.max(0,Math.min(A,D));this.container.scrollTop=0>m?0:Math.max(0,Math.min(r,m))};Graph.prototype.isGraphTornDown=function(){return!0===this.destroyed||null==this.container};-Graph.prototype.smoothFitWindow=function(d,m,r){if(this.isGraphTornDown())null!=r&&r();else{var A=this.container,D=A.scrollLeft,G=A.scrollTop;this.useCssTransforms?(Graph.applyTransformTransition(this,600),this.fitBoundsCssTransform(d,m)):this.fitWindow(d,m);Graph.smoothScrollContainer(A,D,G,A.scrollLeft,A.scrollTop,600);null!=r&&window.setTimeout(r,600)}};Graph.prototype.scrollCellToVisibleCssTransform=function(d,m){var r=this.view.getState(d);if(null!=r){var A=this.view.graphBounds,D=this.view.scale;-this.view.translate.x===-A.x&&this.view.translate.y===-A.y||this.view.scaleAndTranslate(D,-A.x,-A.y);d=this.container.clientWidth;var G=this.container.clientHeight,O=this.getBorder(),P=A.width*D+2*O-d;O=A.height*D+2*O-G;if(null!=m){var V=(r.x-A.x)*D,Y=(r.y-A.y)*D,H=(r.x+r.width-A.x)*D;A=(r.y+r.height-A.y)*D;var W=this.container.scrollLeft;r=this.container.scrollTop;V-m<W?W=V-m:H+m>W+d&&(W=H+m-d);Y-m<r?r=Y-m:A+m>r+G&&(r=A+m-G)}else W=(r.x+r.width/2-A.x)*D-d/2,r=(r.y+r.height/2-A.y)*D-G/2;this.container.scrollLeft=-0>P?0:Math.max(0,Math.min(W,P));this.container.scrollTop=0>O?0:Math.max(0,Math.min(r,O))}};Graph.prototype.scrollCellToVisibleBorder=function(d,m){null==m?this.scrollCellToVisible(d):(d=this.view.getState(d),null!=d&&this.scrollRectToVisible(new mxRectangle(-this.view.translate.x+d.x-m,-this.view.translate.y+d.y-m,d.width+2*m,d.height+2*m)))};Graph.prototype.smoothScrollCellToVisible=function(d,m,r){if(this.isGraphTornDown())null!=r&&r();else{var A=this.container,D=A.scrollLeft,G=A.scrollTop;this.useCssTransforms?-this.scrollCellToVisibleCssTransform(d,m):this.scrollCellToVisibleBorder(d,m);Graph.smoothScrollContainer(A,D,G,A.scrollLeft,A.scrollTop,600);null!=r&&window.setTimeout(r,600)}};Graph.prototype.toggleCellsTransient=function(d){d=this.getNodesForCells(d);for(var m=0;m<d.length;m++){var r=d[m].style.opacity;r=""===r||null===r||0<parseFloat(r);d[m].style.opacity=r?0:1}};Graph.prototype.setCellStylesTransient=function(d,m,r){for(var A=0;A<r.length;A++){var D=this.view.getState(r[A]);null!=D&&null!=D.style&&-(null==m?delete D.style[d]:D.style[d]=m,null!=D.shape&&(D.shape.apply(D),D.shape.redraw()),null!=D.text&&(D.text.apply(D),D.text.redraw()))}};Graph.prototype.toggleCellStylesTransient=function(d,m,r){null==m&&(m="0");for(var A=0;A<r.length;A++){var D=this.view.getState(r[A]);if(null!=D&&null!=D.style){var G=mxUtils.getValue(D.style,d,m)?"0":"1";D.style[d]=G;null!=D.shape&&(D.shape.apply(D),D.shape.redraw());null!=D.text&&(D.text.apply(D),D.text.redraw())}}};Graph.prototype.executeCustomActions=function(d,-m,r){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var A=!1,D=0,G=0,O=mxUtils.bind(this,function(){A||(A=!0,this.model.beginUpdate())}),P=mxUtils.bind(this,function(){A&&(A=!1,this.model.endUpdate())}),V=null==r,Y=function(Z){return null!=Z.transient?-Z.transient:V},H=mxUtils.bind(this,function(){0<D&&D--;0==D&&W()}),W=mxUtils.bind(this,function(){if(this.isGraphTornDown())this.stoppingCustomActions=this.executingCustomActions=!1,null!=m&&m();else if(G<d.length){do{var Z=this.stoppingCustomActions,X=d[G++],ba=[];if(null!=X.open)if(P(),this.isCustomLink(X.open)){if(!this.customLinkClicked(X.open,r))return}else this.openLink(X.open);null==X.wait||Z||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=-null;H()}),D++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=X.wait?parseInt(X.wait):1E3),P());null!=X.opacity&&null!=X.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(X.opacity,!0)),X.opacity.value);null!=X.fadeIn&&(D++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(X.fadeIn,!0)),0,1,H,Z?0:X.fadeIn.delay));null!=X.fadeOut&&(D++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(X.fadeOut,!0)),1,0,H,Z?0:X.fadeOut.delay));-if(null!=X.fadeTo&&null!=X.fadeTo.value){D++;var ea=this.getNodesForCells(this.getCellsForAction(X.fadeTo,!0)),aa=Z?0:null!=X.fadeTo.delay?X.fadeTo.delay:1E3;Graph.setTransitionForNodes(ea,"all "+aa+"ms ease-in-out");Graph.setOpacityForNodes(ea,X.fadeTo.value);window.setTimeout(function(){Graph.setTransitionForNodes(ea,null);H()},aa)}null!=X.flow&&(aa=this.getCellsForAction(X.flow,!0),Editor.toggleFlowAnimation(this,aa,!1===X.flow.start?"stop":!0===X.flow.start?"start":"toggle"));null!=X.wipeIn&&-(ba=ba.concat(this.createWipeAnimations(this.getCellsForAction(X.wipeIn,!0),!0)));null!=X.wipeOut&&(ba=ba.concat(this.createWipeAnimations(this.getCellsForAction(X.wipeOut,!0),!1)));null!=X.popIn&&(ba=ba.concat(this.createPopAnimations(this.getCellsForAction(X.popIn,!0),!0)));null!=X.popOut&&(ba=ba.concat(this.createPopAnimations(this.getCellsForAction(X.popOut,!0),!1)));null!=X.toggle&&(Y(X.toggle)?this.toggleCellsTransient(this.getCellsForAction(X.toggle,!0)):(O(),this.toggleCells(this.getCellsForAction(X.toggle,-!0,!0))));null!=X.show&&(aa=this.getCellsForAction(X.show,!0),Graph.setOpacityForNodes(this.getNodesForCells(aa),1),Y(X.show)||(O(),this.setCellsVisible(this.getCellsForAction(X.show,!0,!0),!0)));null!=X.hide&&(aa=this.getCellsForAction(X.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(aa),0),Y(X.hide)||(O(),this.setCellsVisible(this.getCellsForAction(X.hide,!0,!0),!1)));if(null!=X.toggleStyle&&null!=X.toggleStyle.key){aa=this.getCellsForAction(X.toggleStyle,!0);var ha=null!=X.toggleStyle.defaultValue?-X.toggleStyle.defaultValue:"0";Y(X.toggleStyle)?this.toggleCellStylesTransient(X.toggleStyle.key,ha,aa):(O(),this.toggleCellStyles(X.toggleStyle.key,ha,aa))}null!=X.style&&null!=X.style.key&&(aa=this.getCellsForAction(X.style,!0),Y(X.style)?this.setCellStylesTransient(X.style.key,X.style.value,aa):(O(),this.setCellStyles(X.style.key,X.style.value,aa)));aa=[];null!=X.select&&this.isEnabled()&&(aa=this.getCellsForAction(X.select),this.setSelectionCells(aa));null!=X.highlight&&(aa=this.getCellsForAction(X.highlight),-this.highlightCells(aa,X.highlight.color,X.highlight.duration,X.highlight.opacity));null!=X.scroll&&(aa=this.getCellsForAction(X.scroll));null!=X.viewbox&&(!0!==X.viewbox.smooth||Z?this.useCssTransforms?this.fitBoundsCssTransform(X.viewbox,X.viewbox.border):this.fitWindow(X.viewbox,X.viewbox.border):(D++,this.smoothFitWindow(X.viewbox,X.viewbox.border,H)));0<aa.length&&(ha=null==X.scroll||null==X.scroll.border||""===X.scroll.border||isNaN(parseFloat(X.scroll.border))?null:parseFloat(X.scroll.border),-null==X.scroll||!0!==X.scroll.smooth||Z?this.useCssTransforms?this.scrollCellToVisibleCssTransform(aa[0],ha):this.scrollCellToVisibleBorder(aa[0],ha):(D++,this.smoothScrollCellToVisible(aa[0],ha,H)));null!=r&&null!=X.explore&&Graph.exploreFromCell(this,r,X.explore);if(null!=X.tags){if(null!=X.tags.toggle)for(ha=X.tags.toggle,0==ha.length&&(ha=this.getAllTags()),aa=0;aa<ha.length;aa++)this.toggleHiddenTag(ha[aa]);ha=null;null!=X.tags.hidden&&(null==ha&&(ha=[]),ha=ha.concat(X.tags.hidden));if(null!=-X.tags.visible){null==ha&&(ha=[]);var na=this.getAllTags();for(aa=0;aa<na.length;aa++)0>mxUtils.indexOf(X.tags.visible,na[aa])&&0>mxUtils.indexOf(ha,na[aa])&&ha.push(na[aa])}null!=ha&&this.setHiddenTags(ha);this.refresh()}if(0<ba.length){D++;aa=null!=X.steps?X.steps:30;ha=X.delay;na=["wipeIn","wipeOut","popIn","popOut"];for(var ra=null,sa=0;sa<na.length;sa++){var ua=X[na[sa]];null!=ua&&null!=ua.delay&&(ra=null==ra?ua.delay:Math.max(ra,ua.delay))}null!=ra&&(ha=ra/aa);this.executeAnimations(ba,H,Z?-1:aa,Z?0:ha)}}while(G<d.length&&!0===d[G].immediate&&!this.stoppingCustomActions);0==D?W():P()}else this.stoppingCustomActions=this.executingCustomActions=!1,P(),null!=m&&m()});W()}};Graph.prototype.doUpdateCustomLinksForCell=function(d,m){var r=this.getLinkForCell(m);null!=r&&"data:action/json,"==r.substring(0,17)&&this.setLinkForCell(m,this.updateCustomLink(d,r));if(this.isHtmlLabel(m)){var A=document.createElement("div");A.innerHTML=Graph.sanitizeHtml(this.getLabel(m));for(var D=A.getElementsByTagName("a"),-G=!1,O=0;O<D.length;O++)r=D[O].getAttribute("href"),null!=r&&"data:action/json,"==r.substring(0,17)&&(D[O].setAttribute("href",this.updateCustomLink(d,r)),G=!0);G&&this.labelChanged(m,A.innerHTML)}};Graph.prototype.updateCustomLink=function(d,m){if("data:action/json,"==m.substring(0,17))try{var r=JSON.parse(m.substring(17));null!=r.actions&&(this.updateCustomLinkActions(d,r.actions),m="data:action/json,"+JSON.stringify(r))}catch(A){}return m};Graph.prototype.updateCustomLinkActions=function(d,m){for(var r=-0;r<m.length;r++){var A=m[r],D;for(D in A)this.updateCustomLinkAction(d,A[D],"cells"),this.updateCustomLinkAction(d,A[D],"excludeCells"),this.updateCustomLinkAction(d,A[D],"layers")}};Graph.prototype.updateCustomLinkAction=function(d,m,r){if(null!=m&&null!=m[r]){for(var A=[],D=0;D<m[r].length;D++)if("*"==m[r][D])A.push(m[r][D]);else{var G=d[m[r][D]];null!=G?""!=G&&A.push(G):A.push(m[r][D])}m[r]=A}};Graph.prototype.getCellsForAction=function(d,m,r){var A="or"===d.tagsMatch?"or":"and",D={},G=[],O=function(P){for(var V=-0;V<P.length;V++){var Y=P[V].id;D[Y]||(D[Y]=!0,G.push(P[V]))}};O(this.getCellsById(d.cells));O(this.getCellsForTags(d.tags,null,m,!1,A));O(r?this.getLayerCells(d.layers):this.getCellsForLayers(d.layers));if(null!=d.excludeCells&&0<d.excludeCells.length){m={};A=!1;for(r=0;r<d.excludeCells.length;r++){if("*"===d.excludeCells[r]){A=!0;break}m[d.excludeCells[r]]=!0}if(A)return[];d=[];for(r=0;r<G.length;r++)m[G[r].id]||d.push(G[r]);return d}return G};Graph.prototype.getCellsById=function(d){var m=[];if(null!=-d)for(var r=0;r<d.length;r++)if("*"==d[r]){var A=this.model.getRoot();m=m.concat(this.model.filterDescendants(function(G){return G!=A},A))}else{var D=this.model.getCell(d[r]);null!=D&&m.push(D)}return m};Graph.prototype.getCellsForLayers=function(d){var m=[];if(Array.isArray(d))for(var r=0;r<d.length;r++){var A=this.model.getCell(d[r]);null!=A&&(m=m.concat(this.model.filterDescendants(function(D){return D!=A},A)))}return m};Graph.prototype.getLayerCells=function(d){var m=[];if(Array.isArray(d))for(var r=-0;r<d.length;r++){var A=this.model.getCell(d[r]);null!=A&&m.push(A)}return m};var N=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(d){return N.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(d))};Graph.prototype.setHiddenTags=function(d){this.hiddenTags=d;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(d){var m=mxUtils.indexOf(this.hiddenTags,d);0>m?this.hiddenTags.push(d):0<=m&&this.hiddenTags.splice(m,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};-Graph.prototype.isAllTagsHidden=function(d){if(null==d||0==d.length||0==this.hiddenTags.length)return!1;d=d.split(" ");if(d.length>this.hiddenTags.length)return!1;for(var m=0;m<d.length;m++)if(0>mxUtils.indexOf(this.hiddenTags,d[m]))return!1;return!0};Graph.prototype.getCellsForTags=function(d,m,r,A,D){var G=[];D="or"===D;if(null!=d){m=null!=m?m:this.model.getDescendants(this.model.getRoot());for(var O=0,P={},V=0;V<d.length;V++)0<d[V].length&&(P[d[V]]=!0,O++);for(V=0;V<m.length;V++)if(r&&this.model.getParent(m[V])==-this.model.root||this.model.isVertex(m[V])||this.model.isEdge(m[V])){var Y=this.getTagsForCell(m[V]),H=!1;if(0<Y.length&&(Y=Y.split(" "),D||Y.length>=d.length)){for(var W=H=0;W<Y.length&&H<O;W++)null!=P[Y[W]]&&H++;H=D?0<H:H==O}H&&(1!=A||this.isCellVisible(m[V]))&&G.push(m[V])}}return G};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(d){for(var m=null,r=[],A=0;A<d.length;A++){var D=this.getTagsForCell(d[A]);-r=[];if(0<D.length){D=D.split(" ");for(var G={},O=0;O<D.length;O++)if(null==m||null!=m[D[O]])G[D[O]]=!0,r.push(D[O]);m=G}else return[]}return r};Graph.prototype.getTagsForCells=function(d){for(var m=[],r={},A=0;A<d.length;A++){var D=this.getTagsForCell(d[A]);if(0<D.length){D=D.split(" ");for(var G=0;G<D.length;G++)null==r[D[G]]&&(r[D[G]]=!0,m.push(D[G]))}}return m};Graph.prototype.getTagsForCell=function(d){return this.getAttributeForCell(d,"tags","")};Graph.prototype.addTagsForCells=function(d,m){if(0<-d.length&&0<m.length){this.model.beginUpdate();try{for(var r=0;r<d.length;r++){for(var A=this.getTagsForCell(d[r]),D=A.split(" "),G=!1,O=0;O<m.length;O++){var P=mxUtils.trim(m[O]);""!=P&&0>mxUtils.indexOf(D,P)&&(A=0<A.length?A+" "+P:P,G=!0)}G&&this.setAttributeForCell(d[r],"tags",A)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(d,m){if(0<d.length&&0<m.length){this.model.beginUpdate();try{for(var r=0;r<d.length;r++){var A=this.getTagsForCell(d[r]);if(0<A.length){for(var D=-A.split(" "),G=!1,O=0;O<m.length;O++){var P=mxUtils.indexOf(D,m[O]);0<=P&&(D.splice(P,1),G=!0)}G&&this.setAttributeForCell(d[r],"tags",D.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(d){this.model.beginUpdate();try{for(var m=0;m<d.length;m++)this.model.setVisible(d[m],!this.model.isVisible(d[m]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(d,m){this.model.beginUpdate();try{for(var r=0;r<d.length;r++)this.model.setVisible(d[r],m)}finally{this.model.endUpdate()}};-Graph.prototype.highlightCells=function(d,m,r,A){for(var D=0;D<d.length;D++)this.highlightCell(d[D],m,r,A)};Graph.prototype.highlightCell=function(d,m,r,A,D){m=null!=m?m:mxConstants.DEFAULT_VALID_COLOR;r=null!=r?r:1E3;d=this.view.getState(d);var G=null;null!=d&&(D=null!=D?D:4,D=Math.max(D+1,mxUtils.getValue(d.style,mxConstants.STYLE_STROKEWIDTH,1)+D),G=new mxCellHighlight(this,m,D,!1),null!=A&&(G.opacity=A),G.highlight(d),window.setTimeout(function(){null!=G.shape&&(mxUtils.setPrefixedStyle(G.shape.node.style,-"transition","all 1200ms ease-in-out"),G.shape.node.style.opacity=0);window.setTimeout(function(){G.destroy()},1200)},r));return G};Graph.prototype.addSvgShadow=function(d,m,r,A){A=null!=A?A:!0;var D=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=r&&r||(m=null!=m?m:d.getElementsByTagName("g")[0],null!=m&&(this.updateShadowFilter(m,!0),!isNaN(parseInt(d.getAttribute("width")))&&A&&(d.setAttribute("width",parseInt(d.getAttribute("width"))+D),d.setAttribute("height",parseInt(d.getAttribute("height"))+-D),m=d.getAttribute("viewBox"),null!=m&&0<m.length&&(m=m.split(" "),3<m.length&&(w=parseFloat(m[2])+D,h=parseFloat(m[3])+D,d.setAttribute("viewBox",m[0]+" "+m[1]+" "+w+" "+h))))));return D};Graph.prototype.updateShadowFilter=function(d,m){mxClient.IS_SF||(m?(m=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),d.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+m.cssText+-")"):d.style.filter="")};Graph.prototype.setShadowVisible=function(d,m){m=null!=m?m:!0;this.shadowVisible=d;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);m&&this.fireEvent(new mxEventObject("shadowVisibleChanged"));return Math.ceil(this.svgShadowSize*this.svgShadowBlur)};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=-function(){if(null==this.defaultParent){var d=this.model.getChildCount(this.model.root),m=0;do var r=this.model.getChildAt(this.model.root,m);while(m++<d&&"1"==mxUtils.getValue(this.getCellStyle(r),"locked","0"));null!=r&&this.setDefaultParent(r)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=-[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",-STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",-STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];-mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=-[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=-[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",-STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",-STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=-[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",-STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=-[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];-mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(d){var m=null;null!=d&&0<d.length&&("ER"==d.substring(0,2)?m="mxgraph.er":"sysML"==d.substring(0,5)&&(m="mxgraph.sysml"));return m};var R=mxMarker.createMarker;mxMarker.createMarker=function(d,m,r,A,D,G,O,P,V,Y){if(null!=r&&null==mxMarker.markers[r]){var H=this.getPackageForType(r);null!=H&&mxStencilRegistry.getStencil(H)}return R.apply(this,-arguments)};var T=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(d,m,r,A,D,G){"1"==mxUtils.getValue(m.style,"lineShape",null)&&d.setFillColor(mxUtils.getValue(m.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return T.apply(this,arguments)};PrintDialog.prototype.create=function(d,m,r,A){function D(){ha.value=Math.max(1,Math.min(Z,Math.max(parseInt(ha.value),parseInt(aa.value))));aa.value=Math.max(1,Math.min(Z,Math.min(parseInt(ha.value),parseInt(aa.value))))}function G(Ha){d.lastPrintPagesRadioChecked=-ea.checked;d.lastPrintSelectionOnlyChecked=na.checked;d.lastPrintCropRadioChecked=sa.checked;d.lastPrintFitRadioChecked=ua.checked;ea.checked&&aa.value<ha.value?(d.lastPrintPagesFromInput=aa.value,d.lastPrintPagesToInput=ha.value):(d.lastPrintPagesFromInput=null,d.lastPrintPagesToInput=null);ia.value=Math.max(1,Math.min(1600,parseInt(ia.value)))+"%";d.lastPrintZoom=ia.value;d.lastPrintBorder=za.value;d.lastPrintGrid=ka.checked;d.lastPrintShadow=da.checked;d.lastPrintTransparent=ja.checked;d.lastPrintInclude=-ta.checked;d.lastPrintSheetsAcross=pa.value;d.lastPrintSheetsDown=wa.value;var Ja={};Ja.border=parseInt(za.value);Ja.scale=parseInt(ia.value)/100;Ja.grid=ka.checked;Ja.shadows=da.checked;Ja.transparent=ja.checked;Ja.includeCopy=ta.checked;Ja.sheetsAcross=parseInt(pa.value);Ja.sheetsDown=parseInt(wa.value);Ja.pagesFrom=parseInt(aa.value);Ja.pagesTo=parseInt(ha.value);Ja.allPages=X.checked;Ja.selection=na.checked;Ja.pageView=ra.checked;Ja.crop=sa.checked;Ja.fit=ua.checked;return null!=r?r(!Ha,Ja):d.print(!Ha,-Ja)}function O(Ha){try{d.hideDialog(),null!=r?G(Ha):d.spinner.spin(document.body,mxResources.get("updatingPreview"))&&window.setTimeout(function(){try{G(Ha),d.spinner.stop()}catch(Ja){d.handleError(Ja)}},0)}catch(Ja){d.handleError(Ja)}}var P=d.editor.graph,V=document.createElement("div");V.style.display="flex";V.style.flexDirection="column";V.style.minHeight="0";var Y=document.createElement("div");Y.style.flex="1 1 auto";Y.style.minHeight="0";Y.style.overflowY="auto";V.appendChild(Y);var H=document.createElement("h3");-mxUtils.write(H,m||mxResources.get("print"));Y.appendChild(H);var W=1,Z=1;H=document.createElement("div");H.className="geDialogSection";H.style.whiteSpace="nowrap";var X=document.createElement("input");X.style.marginRight="8px";X.setAttribute("type","radio");X.setAttribute("name","pages-printdialog");X.setAttribute("id","gePrintDlgAllPages");var ba=document.createElement("div");ba.className="geDialogCheckRow";ba.appendChild(X);m=document.createElement("label");m.setAttribute("for","gePrintDlgAllPages");-mxUtils.write(m,mxResources.get("allPages"));ba.appendChild(m);H.appendChild(ba);var ea=document.createElement("input");ea.style.marginRight="8px";ea.setAttribute("type","radio");ea.setAttribute("name","pages-printdialog");ea.setAttribute("id","gePrintDlgPages");ba=document.createElement("div");ba.className="geDialogCheckRow";ba.appendChild(ea);m=document.createElement("label");m.setAttribute("for","gePrintDlgPages");mxUtils.write(m,mxResources.get("pages")+":");ba.appendChild(m);var aa=document.createElement("input");-aa.style.margin="0 4px";aa.setAttribute("value","1");aa.setAttribute("type","number");aa.setAttribute("min","1");aa.style.width="40px";ba.appendChild(aa);m=document.createElement("span");mxUtils.write(m,mxResources.get("to"));ba.appendChild(m);var ha=aa.cloneNode(!0);ba.appendChild(ha);mxEvent.addListener(aa,"focus",function(){ea.checked=!0});mxEvent.addListener(ha,"focus",function(){ea.checked=!0});mxEvent.addListener(aa,"change",D);mxEvent.addListener(ha,"change",D);if(null!=d.pages&&(Z=d.pages.length,-null!=d.currentPage))for(m=0;m<Z;m++)if(d.currentPage==d.pages[m]){W=m+1;break}null!=d.lastPrintPagesFromInput&&null!=d.lastPrintPagesToInput?(aa.value=Math.min(Z,Math.max(1,d.lastPrintPagesFromInput)),ha.value=Math.min(Z,Math.max(1,d.lastPrintPagesToInput))):(aa.value=W,ha.value=W);aa.setAttribute("max",Z);ha.setAttribute("max",Z);m=mxUtils.button(mxResources.get("currentPage"),function(Ha){aa.value=W;ha.value=W;ea.checked=!0});m.className="geBtn";m.setAttribute("title",mxResources.get("currentPage"));-m.style.marginLeft="4px";m.style.maxWidth="100px";ba.appendChild(m);H.appendChild(ba);1<Z&&Y.appendChild(H);ba=document.createElement("div");ba.className="geDialogCheckRow";var na=document.createElement("input");na.setAttribute("name","pages-printdialog");na.setAttribute("type",1==Z?"checkbox":"radio");na.setAttribute("id","gePrintDlgSelectionOnly");na.style.marginRight="8px";P.isSelectionEmpty()&&na.setAttribute("disabled","disabled");P.isEnabled()&&(ba.appendChild(na),m=document.createElement("label"),-m.setAttribute("for","gePrintDlgSelectionOnly"),mxUtils.write(m,mxResources.get("selectionOnly")),ba.appendChild(m));P.isEnabled()&&(1<Z?H.appendChild(ba):(m=document.createElement("div"),m.className="geDialogSection",m.appendChild(ba),Y.appendChild(m)));!d.isPagesEnabled()||d.lastPrintPagesRadioChecked?ea.checked=!0:!P.isSelectionEmpty()&&d.lastPrintSelectionOnlyChecked?na.checked=!0:X.checked=!0;P=d.addAdvancedSection(Y);Y=P.content;H=document.createElement("div");H.className="geDialogCheckRow";-var ra=document.createElement("input");ra.style.marginRight="8px";ra.setAttribute("type","radio");ra.setAttribute("name","printSize");ra.setAttribute("id","gePrintDlgPageView");H.appendChild(ra);m=document.createElement("label");m.setAttribute("for","gePrintDlgPageView");mxUtils.write(m,mxResources.get("pageView"));H.appendChild(m);mxEvent.addListener(H,"click",function(){ra.checked=!0});Y.appendChild(H);H=document.createElement("div");H.className="geDialogCheckRow";var sa=document.createElement("input");-sa.style.marginRight="8px";sa.setAttribute("type","radio");sa.setAttribute("name","printSize");sa.setAttribute("id","gePrintDlgCrop");H.appendChild(sa);m=document.createElement("label");m.setAttribute("for","gePrintDlgCrop");mxUtils.write(m,mxResources.get("crop"));H.appendChild(m);mxEvent.addListener(H,"click",function(){sa.checked=!0});Y.appendChild(H);H=document.createElement("div");H.className="geDialogCheckRow";H.style.alignItems="flex-start";var ua=document.createElement("input");ua.style.marginTop=-"4px";ua.setAttribute("type","radio");ua.setAttribute("name","printSize");H.appendChild(ua);ba=document.createElement("table");ba.style.display="inline-block";ba.style.borderSpacing="0";var xa=document.createElement("tbody"),qa=document.createElement("tr"),Aa=qa.cloneNode(!0),Ba=document.createElement("td"),Ea=Ba.cloneNode(!0),Fa=Ba.cloneNode(!0),ca=Ba.cloneNode(!0),fa=Ba.cloneNode(!0),oa=Ba.cloneNode(!0);Ba.style.textAlign="right";ca.style.textAlign="right";mxUtils.write(Ba,mxResources.get("fitTo"));-mxEvent.addListener(H,"click",function(Ha){mxEvent.getSource(Ha)!=ua&&(ua.checked=!ua.checked)});var pa=document.createElement("input");pa.style.margin="0 2px";pa.style.boxSizing="border-box";pa.setAttribute("value",d.lastPrintSheetsAcross||"1");pa.setAttribute("min","1");pa.setAttribute("type","number");pa.style.width="40px";Ea.appendChild(pa);m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsAcross"));Fa.appendChild(m);mxUtils.write(ca,mxResources.get("fitToBy"));var wa=-pa.cloneNode(!0);wa.setAttribute("value",d.lastPrintSheetsDown||"1");fa.appendChild(wa);mxEvent.addListener(pa,"click",function(Ha){ua.checked=!0;mxEvent.consume(Ha)});mxEvent.addListener(wa,"click",function(Ha){ua.checked=!0;mxEvent.consume(Ha)});d.lastPrintCropRadioChecked?sa.checked=!0:d.lastPrintFitRadioChecked?ua.checked=!0:ra.checked=!0;m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsDown"));oa.appendChild(m);qa.appendChild(Ba);qa.appendChild(Ea);qa.appendChild(Fa);-Aa.appendChild(ca);Aa.appendChild(fa);Aa.appendChild(oa);xa.appendChild(qa);xa.appendChild(Aa);ba.appendChild(xa);H.appendChild(ba);Y.appendChild(H);Y=document.createElement("div");Y.className="geDialogSection";m=document.createElement("div");m.className="geDialogFormRow";H=document.createElement("label");H.className="geDialogFormLabel";H.setAttribute("for","gePrintDlgBorder");mxUtils.write(H,mxResources.get("borderWidth"));m.appendChild(H);var za=document.createElement("input");za.setAttribute("type",-"number");za.setAttribute("min","0");za.setAttribute("id","gePrintDlgBorder");za.style.width="40px";za.value=null!=d.lastPrintBorder?d.lastPrintBorder:mxPrintPreview.prototype.pageMargin;m.appendChild(za);H=document.createElement("label");H.setAttribute("for","gePrintDlgZoom");H.style.marginLeft="12px";H.style.marginRight="4px";mxUtils.write(H,mxResources.get("zoom"));m.appendChild(H);var ia=document.createElement("input");ia.setAttribute("id","gePrintDlgZoom");ia.style.width="60px";ia.value=null!=-d.lastPrintZoom?d.lastPrintZoom:"100%";m.appendChild(ia);Y.appendChild(m);H=document.createElement("div");H.className="geDialogCheckRow";var ka=document.createElement("input");ka.setAttribute("type","checkbox");ka.setAttribute("id","gePrintDlgGrid");ka.style.marginRight="8px";ka.checked=null!=d.lastPrintGrid?d.lastPrintGrid:!1;H.appendChild(ka);m=document.createElement("label");m.setAttribute("for","gePrintDlgGrid");mxUtils.write(m,mxResources.get("grid"));H.appendChild(m);Y.appendChild(H);H=document.createElement("div");-H.className="geDialogCheckRow";var da=document.createElement("input");da.setAttribute("type","checkbox");da.setAttribute("id","gePrintDlgShadows");da.style.marginRight="8px";da.checked=null!=d.lastPrintShadow?d.lastPrintShadow:!1;H.appendChild(da);m=document.createElement("label");m.setAttribute("for","gePrintDlgShadows");mxUtils.write(m,mxResources.get("shadows"));H.appendChild(m);d.isOffline()&&!mxClient.IS_CHROMEAPP||H.appendChild(d.createHelpIcon("https://www.drawio.com/docs/manual/export/print-diagram/#shadows-in-print-and-pdf-export"));-Editor.enableShadowOption||(H.style.display="none");Y.appendChild(H);var ja=document.createElement("input");ja.setAttribute("type","checkbox");ja.setAttribute("id","gePrintDlgTransparent");ja.style.marginRight="8px";ja.checked=null!=d.lastPrintTransparent?d.lastPrintTransparent:!1;null!=r&&(H=document.createElement("div"),H.className="geDialogCheckRow",H.appendChild(ja),m=document.createElement("label"),m.setAttribute("for","gePrintDlgTransparent"),mxUtils.write(m,mxResources.get("transparentBackground")),-H.appendChild(m),Y.appendChild(H));var ta=document.createElement("input");ta.setAttribute("type","checkbox");ta.setAttribute("id","gePrintDlgInclude");ta.style.marginRight="8px";ta.checked=null!=d.lastPrintInclude?d.lastPrintInclude:Editor.defaultIncludeDiagram;null==r||mxClient.IS_CHROMEAPP||"draw.io"!=d.getServiceName()||(H=document.createElement("div"),H.className="geDialogCheckRow",H.appendChild(ta),m=document.createElement("label"),m.setAttribute("for","gePrintDlgInclude"),mxUtils.write(m,mxResources.get("includeCopyOfMyDiagram")),-H.appendChild(m),Y.appendChild(H));P.wrapper.appendChild(Y);m=document.createElement("div");m.style.flex="0 0 auto";m.style.marginTop="16px";m.style.textAlign="right";m.style.whiteSpace="nowrap";d.isOffline()&&!mxClient.IS_CHROMEAPP||null!=r||m.appendChild(d.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));P=mxUtils.button(mxResources.get("cancel"),function(){d.hideDialog()});P.className="geBtn";d.editor.cancelFirst&&m.appendChild(P);PrintDialog.previewEnabled&&null==r&&(Y=mxUtils.button(mxResources.get("preview"),-function(){O(!1)}),Y.className="geBtn",m.appendChild(Y));A=null!=A?A:null!=r?"export":PrintDialog.previewEnabled?"print":"ok";A=mxUtils.button(mxResources.get(A),function(){O(!0)});A.className="geBtn gePrimaryBtn";m.appendChild(A);d.editor.cancelFirst||m.appendChild(P);V.appendChild(m);if(d.editor.isChromelessView()){var va=function(){Editor.isDarkMode()?(V.classList.add("geDarkMode"),V.style.colorScheme="dark"):(V.classList.remove("geDarkMode"),V.style.colorScheme="light")};d.addListener("darkModeChanged",+va);Ra.setAttribute("xlink:href","#"+va);Ja.appendChild(Ra)}else Ja.appendChild(ta());V().appendChild(Ja);for(Ca=0;Ca<Ha.length;Ca++){var Va=Ha[Ca].node;Ha[Ca].inline?na(Va,ka):(Va.getAttribute("id")!=ka&&(ba["#"+Va.getAttribute("id")]=ka),Va.parentNode.removeChild(Va))}}ha()}}catch(bb){}Ba()};pa.onerror=function(){Ba()};pa.src=Ea}};Ba()}catch(Ea){D()}}))});r("image","xlink:href");r("img","src");X();H();D()};Editor.base64Encode=function(d){for(var m="",r=0,z=d.length,D,F,N;r<z;){D=d.charCodeAt(r++)&+255;if(r==z){m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(D>>2);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((D&3)<<4);m+="==";break}F=d.charCodeAt(r++);if(r==z){m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(D>>2);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((D&3)<<4|(F&240)>>4);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((F&15)<<2);m+="=";+break}N=d.charCodeAt(r++);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(D>>2);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((D&3)<<4|(F&240)>>4);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((F&15)<<2|(N&192)>>6);m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(N&63)}return m};Editor.prototype.loadUrl=function(d,m,r,z,D,F,N,P){try{var V=!N&&(z||/(\.png)($|\?)/i.test(d)||/(\.jpe?g)($|\?)/i.test(d)||+/(\.gif)($|\?)/i.test(d)||/(\.pdf)($|\?)/i.test(d));D=null!=D?D:!0;var X=mxUtils.bind(this,function(){mxUtils.get(d,mxUtils.bind(this,function(H){200<=H.getStatus()&&299>=H.getStatus()?null!=m&&(H=H.getText(),V&&(F=null!=F?F:"data:image/png;base64,",H=F+Editor.base64Encode(H)),m(H)):null!=r&&(0==H.getStatus()?r({message:mxResources.get("accessDenied")},H):404==H.getStatus()?r({message:mxResources.get("fileNotFound"),code:H.getStatus()},H):r({message:this.getErrorMessage(H)},H))}),function(H){null!=+r&&r({message:mxResources.get("error")+" "+H.getStatus()})},V,this.timeout,function(){D&&null!=r&&r({code:App.ERROR_TIMEOUT,retry:X})},P)});X()}catch(H){null!=r&&r(H)}};Editor.prototype.getErrorMessage=function(d){var m=mxResources.get("error")+" "+d.getStatus();try{var r=d.getText(),z=JSON.parse(r);null!=z&&null!=z.error&&null!=z.error.message&&(m=z.error.message+" ("+m+")")}catch(D){}return m};Editor.prototype.absoluteCssFonts=function(d){var m=null;if(null!=d){var r=d.split("url(");if(0<r.length){m=+[r[0]];d=window.location.pathname;var z=null!=d?d.lastIndexOf("/"):-1;0<=z&&(d=d.substring(0,z+1));z=document.getElementsByTagName("base");var D=null;null!=z&&0<z.length&&(D=z[0].getAttribute("href"));for(var F=1;F<r.length;F++)if(z=r[F].indexOf(")"),0<z){var N=Editor.trimCssUrl(r[F].substring(0,z));this.graph.isRelativeUrl(N)&&(N=null!=D?D+N:window.location.protocol+"//"+window.location.hostname+("/"==N.charAt(0)?"":d)+N);m.push('url("'+N+'"'+r[F].substring(z))}else m.push(r[F])}else m=[d]}return null!=+m?m.join(""):null};Editor.prototype.mapFontUrl=function(d,m,r){/^https?:\/\//.test(m)&&!this.isCorsEnabledForUrl(m)&&(m=PROXY_URL+"?url="+encodeURIComponent(m));r(d,m)};Editor.prototype.embedCssFonts=function(d,m){var r=d.split("url("),z=0;null==this.cachedFonts&&(this.cachedFonts={});var D=mxUtils.bind(this,function(){if(0==z){for(var V=[r[0]],X=1;X<r.length;X++){var H=r[X].indexOf(")");V.push('url("');V.push(this.cachedFonts[Editor.trimCssUrl(r[X].substring(0,H))]);V.push('"'+r[X].substring(H))}m(V.join(""))}});+if(0<r.length){for(d=1;d<r.length;d++){var F=r[d].indexOf(")"),N=null,P=r[d].indexOf("format(",F);0<P&&(N=Editor.trimCssUrl(r[d].substring(P+7,r[d].indexOf(")",P))));mxUtils.bind(this,function(V){var X=this.cachedFonts[V];if(null==X){var H=[];this.cachedFonts[V]=H;z++;X="application/x-font-ttf";if("svg"==N||/(\.svg)($|\?)/i.test(V))X="image/svg+xml";else if("otf"==N||"embedded-opentype"==N||/(\.otf)($|\?)/i.test(V))X="application/x-font-opentype";else if("woff"==N||/(\.woff)($|\?)/i.test(V))X="application/font-woff";+else if("woff2"==N||/(\.woff2)($|\?)/i.test(V))X="application/font-woff2";else if("eot"==N||/(\.eot)($|\?)/i.test(V))X="application/vnd.ms-fontobject";else if("sfnt"==N||/(\.sfnt)($|\?)/i.test(V))X="application/font-sfnt";var W=mxUtils.bind(this,function(Z){this.cachedFonts[V]=Z;z--;D();for(Z=0;Z<H.length;Z++)H[Z]()});this.mapFontUrl(X,V,mxUtils.bind(this,function(Z,Y){this.loadUrl(Y,function(ba){W(ba)},function(ba){W(V)},!0,null,"data:"+Z+";charset=utf-8;base64,")}))}else"string"!=typeof X&&(z++,+X.push(function(){z--;D()}))})(Editor.trimCssUrl(r[d].substring(0,F)),N)}D()}else m(d)};Editor.prototype.loadFonts=function(d){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(m){this.resolvedFontCss=m;null!=d&&d()})):null!=d&&d()};Editor.prototype.createGoogleFontCache=function(){var d={},m;for(m in Graph.fontMapping)Graph.isCssFontUrl(m)&&(d[m]=Graph.fontMapping[m]);return d};Editor.prototype.embedExtFonts=function(d){var m=this.graph.getCustomFonts();+if(0<m.length){var r=[],z=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var D=mxUtils.bind(this,function(){0==z&&this.embedCssFonts(r.join(""),d)}),F=0;F<m.length;F++)mxUtils.bind(this,function(N,P){Graph.isCssFontUrl(P)?null==this.cachedGoogleFonts[P]?(z++,this.loadUrl(Graph.rewriteGoogleFontUrl(P),mxUtils.bind(this,function(V){this.cachedGoogleFonts[P]=V;r.push(V+"\n");z--;D()}),mxUtils.bind(this,function(V){z--;r.push("@import url("+P+");\n");D()}))):+r.push(this.cachedGoogleFonts[P]+"\n"):r.push('@font-face {font-family: "'+N+'";src: url("'+P+'")}\n')})(m[F].name,m[F].url);D()}else d()};Editor.prototype.addMathCss=function(d){d=d.getElementsByTagName("defs");if(null!=d&&0<d.length)for(var m=document.getElementsByTagName("style"),r=0;r<m.length;r++){var z=mxUtils.getTextContent(m[r]);0>z.indexOf("mxPageSelector")&&0<z.indexOf("MathJax")&&d[0].appendChild(m[r].cloneNode(!0))}};Editor.prototype.addFontCss=function(d,m){m=null!=m?m:this.absoluteCssFonts(this.fontCss);+if(null!=m){var r=mxUtils.getSvgDefs(d),z=m.split("\n");m=[];for(var D=[],F=0;F<z.length;F++)"@import"==z[F].substring(0,7)?m.push(z[F]):D.push(z[F]);d=d.ownerDocument;d=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"style"):d.createElement("style");d.setAttribute("type","text/css");0<m.length&&(mxUtils.setTextContent(d,m.join("\n")),r.appendChild(d));0<D.length&&(d=d.cloneNode(!1),mxUtils.setTextContent(d,D.join("\n")),r.appendChild(d))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||+Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(d,m,r){var z=mxClient.IS_FF?8192:16384;return Math.min(r,Math.min(z/d,z/m))};Editor.prototype.exportToCanvas=function(d,m,r,z,D,F,N,P,V,X,H,W,Z,Y,ba,ea,aa,ha){try{F=null!=F?F:!0;N=null!=N?N:!0;W=null!=W?W:this.graph;Z=null!=Z?Z:0;var na=V?null:W.background;na==mxConstants.NONE&&(na=null);null==na&&(na=z);null==na&&0==V&&(na="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(W.getSvg(null,null,Z,Y,null,N,null,null,null,+X,null,ea,aa,ha),mxUtils.bind(this,function(ra){try{ra.style.setProperty("-webkit-font-smoothing","antialiased");ra.style.setProperty("-moz-osx-font-smoothing","grayscale");var sa=new Image;sa.onload=mxUtils.bind(this,function(){try{var xa=function(){mxClient.IS_SF?window.setTimeout(function(){Ea.drawImage(sa,0,0);d(qa,ra)},0):(Ea.drawImage(sa,0,0),d(qa,ra))},qa=document.createElement("canvas"),Aa=parseInt(ra.getAttribute("width")),Ba=parseInt(ra.getAttribute("height"));P=null!=P?P:1;null!=m&&(P=+F?Math.min(1,Math.min(3*m/(4*Ba),m/Aa)):m/Aa);P=this.getMaxCanvasScale(Aa,Ba,P);Aa=Math.ceil(P*Aa);Ba=Math.ceil(P*Ba);qa.setAttribute("width",Aa);qa.setAttribute("height",Ba);var Ea=qa.getContext("2d");if(null!=na){var Fa=mxUtils.getLightDarkColor(na);Ea.beginPath();Ea.rect(0,0,Aa,Ba);Ea.fillStyle="dark"==ea&&"none"!=W.getAdaptiveColors()?Fa.dark:Fa.light;Ea.fill()}1!=P&&Ea.scale(P,P);if(ba){var ca=W.view,fa=ca.scale;ca.scale=1;var oa=btoa(unescape(encodeURIComponent(ca.createSvgGrid(ca.gridColor))));+ca.scale=fa;oa="data:image/svg+xml;base64,"+oa;var pa=W.gridSize*ca.gridSteps*P,wa=W.getGraphBounds(),za=ca.translate.x*fa,ia=ca.translate.y*fa,ka=za+(wa.x-za)/fa-Z,da=ia+(wa.y-ia)/fa-Z,ja=new Image;ja.onload=function(){try{for(var ta=-Math.round(pa-mxUtils.mod((za-ka)*P,pa)),va=-Math.round(pa-mxUtils.mod((ia-da)*P,pa));ta<Aa;ta+=pa)for(var Ca=va;Ca<Ba;Ca+=pa)Ea.drawImage(ja,ta/P,Ca/P);xa()}catch(Ha){null!=D&&D(Ha)}};ja.onerror=function(ta){null!=D&&D(ta)};ja.src=oa}else xa()}catch(ta){null!=D&&D(ta)}});+sa.onerror=function(xa){null!=D&&D(xa)};X&&this.graph.addSvgShadow(ra);this.graph.mathEnabled&&this.addMathCss(ra);var ua=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(ra,this.resolvedFontCss),sa.src=Editor.createSvgDataUri(mxUtils.getXml(ra))}catch(xa){null!=D&&D(xa)}});this.embedExtFonts(mxUtils.bind(this,function(xa){try{null!=xa&&this.addFontCss(ra,xa),this.loadFonts(ua)}catch(qa){null!=D&&D(qa)}}))}catch(xa){null!=D&&D(xa)}}),r,H)}catch(ra){null!=D&&D(ra)}};Editor.crcTable=+[];for(var x=0;256>x;x++)for(var A=x,y=0;8>y;y++)A=1==(A&1)?3988292384^A>>>1:A>>>1,Editor.crcTable[x]=A;Editor.updateCRC=function(d,m,r,z){for(var D=0;D<z;D++)d=Editor.crcTable[(d^m.charCodeAt(r+D))&255]^d>>>8;return d};Editor.crc32=function(d){for(var m=-1,r=0;r<d.length;r++)m=m>>>8^Editor.crcTable[(m^d.charCodeAt(r))&255];return(m^-1)>>>0};Editor.writeGraphModelToPng=function(d,m,r,z,D){function F(H,W){var Z=V;V+=W;return H.substring(Z,V)}function N(H){H=F(H,4);return H.charCodeAt(3)+(H.charCodeAt(2)<<+8)+(H.charCodeAt(1)<<16)+(H.charCodeAt(0)<<24)}function P(H){return String.fromCharCode(H>>24&255,H>>16&255,H>>8&255,H&255)}d=d.substring(d.indexOf(",")+1);d=window.atob?atob(d):Base64.decode(d,!0);var V=0;if(F(d,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=D&&D();else if(F(d,4),"IHDR"!=F(d,4))null!=D&&D();else{F(d,17);D=d.substring(0,V);do{var X=N(d);if("IDAT"==F(d,4)){D=d.substring(0,V-8);"pHYs"==m&&"dpi"==r?(r=Math.round(z/.0254),r=P(r)+P(r)+String.fromCharCode(1)):+r=r+String.fromCharCode(0)+("zTXt"==m?String.fromCharCode(0):"")+z;z=4294967295;z=Editor.updateCRC(z,m,0,4);z=Editor.updateCRC(z,r,0,r.length);D+=P(r.length)+m+r+P(z^4294967295);D+=d.substring(V-8,d.length);break}D+=d.substring(V-8,V-4+X);F(d,X);F(d,4)}while(X);return"data:image/png;base64,"+(window.btoa?btoa(D):Base64.encode(D,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var G=ColorDialog.addRecentColor;ColorDialog.addRecentColor=+function(d,m){G.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var L=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){L.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(d,m,r){var z=null;if(null!=r)return null;null!=d.editor.graph.getModel().getParent(m)?z=m.getId():null!=d.currentPage&&(z=d.currentPage.getId());+return z});if(null!=window.StyleFormatPanel){var O=Format.prototype.init;Format.prototype.init=function(){O.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var J=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?J.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(d){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||+"min"==Editor.currentTheme};var Q=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(d){d=Q.apply(this,arguments);var m=this.editorUi,r=m.editor.graph;if(r.isEnabled()){var z=m.getCurrentFile();null!=z&&z.isAutosaveOptional()&&d.appendChild(this.createOption(mxResources.get("autosave"),function(){return m.editor.autosave},function(F){m.editor.setAutosave(F);m.editor.autosave&&z.isModified()&&z.fileChanged()},{install:function(F){this.listener=function(){F(m.editor.autosave)};+m.editor.addListener("autosaveChanged",this.listener)},destroy:function(){m.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&r.isEnabled()&&"undefined"!==typeof MathJax){var D=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return r.mathEnabled},function(F){m.actions.get("mathematicalTypesetting").funct()},{install:function(F){this.listener=function(){F(r.mathEnabled)};m.addListener("mathEnabledChanged",this.listener)},destroy:function(){m.removeListener(this.listener)}});+d.appendChild(D);(!m.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&D.appendChild(m.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return d};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",+dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(d,m){return 0<mxUtils.getValue(d.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.ellipse.prototype.customProperties=[{name:"centerRadius",dispName:"Center Radius",type:"float",min:0,defVal:0},{name:"centerColor",dispName:"Center Color",type:"color",defVal:null,primary:!0,isVisible:function(d,m){return 0<mxUtils.getValue(d.style,"centerRadius",0)}}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",+dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=+[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",+type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2,isVisible:function(d){return"0"==mxUtils.getValue(d.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(d){return"1"==mxUtils.getValue(d.style,+"fixedSize","0")}}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.25,isVisible:function(d){return"0"==mxUtils.getValue(d.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:25,isVisible:function(d){return"1"==mxUtils.getValue(d.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=+[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,min:0,max:1},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,+defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder.prototype.customProperties=[{name:"boundedLbl",+dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder3.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlState.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.step.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",+type:"float",min:0,defVal:20},{name:"fixedSize",dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",+defVal:!1}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.note2.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.card.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",+dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20},{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",type:"float",min:0,max:1,defVal:.5}];+mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"right",dispName:"Right"}]},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",+dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},{name:"swimlaneBody",dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},{name:"separatorColor",dispName:"Separator Color",type:"color",defVal:null},{name:"fixedHeader",dispName:"Fixed Header",type:"bool",+defVal:!0,getDefaultValue:function(d,m){d=mxCellRenderer.defaultShapes[mxUtils.getValue(d.style,"shape","")];return null!=d&&null!=d.prototype.fixedHeaderDefault?d.prototype.fixedHeaderDefault?"1":"0":"1"}}];mxCellRenderer.defaultShapes.table.prototype.customProperties=[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",+type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=+[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];+mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0},{name:"imageAlign",dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},{name:"imageVerticalAlign",dispName:"Image Vertical Align",+type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",type:"float",min:0,defVal:24},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",+dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(d,m){return 0<mxUtils.getValue(d.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20},{name:"boundedLbl",dispName:"Bounded Label",+type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=[{name:"size",dispName:"Size",+type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.cross.prototype.customProperties=+[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.corner.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.tee.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.umlLifeline.prototype.customProperties=[{name:"participant",+dispName:"Participant",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName:"Actor"},{val:"umlBoundary",dispName:"Boundary"},{val:"umlEntity",dispName:"Entity"},{val:"umlControl",dispName:"Control"}]},{name:"size",dispName:"Height",type:"float",defVal:40,min:0},{name:"lifelineMirror",dispName:"Mirror Head",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:"width",dispName:"Title Width",type:"float",defVal:60,min:0},+{name:"height",dispName:"Title Height",type:"float",defVal:30,min:0}];StyleFormatPanel.prototype.defaultColorSchemes=[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},+{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",+stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},+{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",+stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;var c=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var d=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&0<d.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));c.apply(this,arguments);null!=d.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),d.customProperties,d))};var f=StyleFormatPanel.prototype.addStyleOps;+StyleFormatPanel.prototype.addStyleOps=function(d){var m=this.editorUi.getSelectionState();1==m.cells.length?this.addActions(d,["copyStyle","pasteStyle"]):1<=m.cells.length&&this.addActions(d,["pasteStyle","pasteData"]);f.apply(this,arguments);return d};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(d,m,r,z){function D(Fa){try{return decodeURIComponent(Fa)}catch(ca){return Fa}}function F(Fa,ca,fa,oa,pa){if(null!=fa.valueChanged)fa.valueChanged(ca,pa,r,Z);+else{Y.getModel().beginUpdate();try{pa=[];var wa=[];if(null!=fa.index){for(var za=[],ia=fa.parentRow.nextSibling;ia&&ia.getAttribute("data-pName")==Fa;)za.push(ia.getAttribute("data-pValue")),ia=ia.nextSibling;fa.index<za.length?null!=oa?za.splice(oa,1):za[fa.index]=ca:za.push(ca);null!=fa.size&&za.length>fa.size&&(za=za.slice(0,fa.size));ca=za.join(",");null!=fa.countProperty&&(Y.setCellStyles(fa.countProperty,za.length,Y.getSelectionCells()),pa.push(fa.countProperty),wa.push(za.length))}Y.setCellStyles(Fa,+ca,Y.getSelectionCells());pa.push(Fa);wa.push(ca);if(null!=fa.dependentProps)for(Fa=0;Fa<fa.dependentProps.length;Fa++){var ka=fa.dependentPropsDefVal[Fa],da=fa.dependentPropsVals[Fa];if(da.length>ca)da=da.slice(0,ca);else for(var ja=da.length;ja<ca;ja++)da.push(ka);da=da.join(",");Y.setCellStyles(fa.dependentProps[Fa],da,Y.getSelectionCells());pa.push(fa.dependentProps[Fa]);wa.push(da)}if("function"==typeof fa.onChange)fa.onChange(Y,ca);Z.editorUi.fireEvent(new mxEventObject("styleChanged","keys",+pa,"values",wa,"cells",Y.getSelectionCells()))}finally{Y.getModel().endUpdate()}}}function N(Fa,ca){ca.style.left="0px";ca.style.top="0px";ca.style.position="relative";ca.style.right="0px";ca.style.bottom="0px";ca.style.width="100%";ca.style.maxWidth="100%";ca.style.maxHeight="100%";ca.style.textAlign="left"}function P(Fa,ca,fa){function oa(wa){if(null==wa||wa==mxConstants.NONE)pa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==wa)pa.style.background="";else{var za=+mxUtils.getLightDarkColor(wa);mxUtils.isLightDarkColor(wa)&&za.light!=za.dark?pa.style.background="linear-gradient(to right bottom, "+za.cssText+" 50%, "+mxUtils.invertLightDarkColor(za).cssText+" 50.3%)":pa.style.background=wa}}var pa=document.createElement("div");pa.style.width="32px";pa.style.height="8px";pa.style.margin="2px";pa.style.borderStyle="solid";pa.style.borderWidth="1px";oa(ca);btn=mxUtils.button("",mxUtils.bind(Z,function(wa){this.editorUi.pickColor(ca,function(za){F(Fa,za,fa);oa(za)});+mxEvent.consume(wa)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(pa);return btn}function V(Fa,ca,fa,oa,pa,wa,za){null!=ca&&(ca=ca.split(","),ba.push({name:Fa,values:ca,type:fa,defVal:oa,countProperty:pa,parentRow:wa,isDeletable:!0,flipBkg:za}));btn=mxUtils.button("+",mxUtils.bind(Z,function(ia){for(var ka=wa,da=0;null!=ka.nextSibling;)if(ka.nextSibling.getAttribute("data-pName")==Fa)ka=ka.nextSibling,+da++;else break;var ja={type:fa,parentRow:wa,index:da,isDeletable:!0,defVal:oa,countProperty:pa};da=W(Fa,"",ja,0==da%2,za);F(Fa,oa,ja);ka.parentNode.insertBefore(da,ka.nextSibling);mxEvent.consume(ia)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function X(Fa,ca,fa,oa,pa,wa,za){if(0<pa){var ia=Array(pa);ca=null!=ca?ca.split(","):[];for(var ka=0;ka<pa;ka++)ia[ka]=null!=ca[ka]?ca[ka]:null!=oa?oa:"";ba.push({name:Fa,values:ia,type:fa,defVal:oa,parentRow:wa,+flipBkg:za,size:pa})}return document.createElement("div")}function H(Fa,ca,fa){var oa=document.createElement("input");oa.type="checkbox";oa.checked="1"==ca;mxEvent.addListener(oa,"change",function(){F(Fa,oa.checked?"1":"0",fa,null,oa)});return oa}function W(Fa,ca,fa,oa,pa){var wa=fa.dispName,za=fa.type,ia=document.createElement("tr");ia.className="gePropRow"+(pa?"Dark":"")+(oa?"Alt":"")+" gePropNonHeaderRow";ia.setAttribute("data-pName",Fa);ia.setAttribute("data-pValue",ca);oa=!1;null!=fa.index&&+(ia.setAttribute("data-index",fa.index),wa=(null!=wa?wa:"")+"["+fa.index+"]",oa=!0);var ka=document.createElement("td");ka.className="gePropRowCell";wa=mxResources.get(wa,null,wa);mxUtils.write(ka,wa);ka.setAttribute("title",wa);oa&&(ka.style.textAlign="right");ia.appendChild(ka);ka=document.createElement("td");ka.className="gePropRowCell";ka.setAttribute("title",null!=ca?D(ca):mxResources.get("none"));mxEvent.addListener(ka,"click",mxUtils.bind(Z,function(va){!mxUtils.isAncestorNode(ia,document.activeElement)&&+mxUtils.isAncestorNode(ia.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(va))}));if("color"==za)ka.appendChild(P(Fa,ca,fa));else if("bool"==za||"boolean"==za)ka.appendChild(H(Fa,ca,fa));else if("enum"==za){var da=fa.enumList;ka.innerHTML="";var ja=document.createElement("div");ja.className="gePropValue";ka.appendChild(ja);for(pa=0;pa<da.length;pa++)if(wa=da[pa],wa.val==ca){mxUtils.write(ja,mxResources.get(wa.dispName,+null,wa.dispName));break}mxEvent.addListener(ka,"click",mxUtils.bind(Z,function(va){var Ca=mxEvent.getSource(va);if(!(Ca!=ka&&Ca!=ja||mxEvent.isConsumed(va))){ja.innerHTML="";var Ha=document.createElement("select"),Ja=null;N(ka,Ha);Ha.style.boxSizing="border-box";Ha.style.height="100%";Ha.style.padding="0";Ha.style.margin="0";Ha.style.border="0";for(va=0;va<da.length;va++){Ca=da[va];var Ra=document.createElement("option");Ra.value=mxUtils.htmlEntities(Ca.val);mxUtils.write(Ra,mxResources.get(Ca.dispName,+null,Ca.dispName));Ha.appendChild(Ra);null==Ca.val&&(Ra.value="null",Ja=Ra)}Ha.value=null==ca&&null!=Ja?"null":ca;ja.appendChild(Ha);mxEvent.addListener(Ha,"change",function(){var Va=mxUtils.htmlEntities(Ha.value);if(Ha[Ha.selectedIndex]==Ja||"null"==Va.value)Va=null;F(Fa,Va,fa)});Ha.focus();mxEvent.addListener(Ha,"blur",function(){ja.innerHTML="";for(var Va=Ha[Ha.selectedIndex]==Ja||"null"==Ha.value?null:Ha.value,bb=0;bb<da.length;bb++){var ab=da[bb];if(ab.val==Va){mxUtils.write(ja,mxResources.get(ab.dispName,+null,ab.dispName));break}}})}}))}else if("dynamicArr"==za)ka.appendChild(V(Fa,ca,fa.subType,fa.subDefVal,fa.countProperty,ia,pa));else if("staticArr"==za)ka.appendChild(X(Fa,ca,fa.subType,fa.subDefVal,fa.size,ia,pa));else if("readOnly"==za)pa=document.createElement("input"),pa.setAttribute("readonly",""),pa.value=ca,pa.style.borderWidth="0px","id"==Fa||"shape"==Fa?(ia.firstChild.innerHTML="",ia.firstChild.setAttribute("colspan","2"),pa.style.flexGrow="1",pa.style.marginLeft="4px",pa.style.textAlign=+"id"==Fa?"center":"left",pa.setAttribute("title",ca),wa=document.createElement("div"),mxUtils.write(wa,mxResources.get(Fa)+":"),wa.style.display="inline-flex",wa.style.alignItems="center",wa.style.width="100%",wa.appendChild(pa),ia.firstChild.appendChild(wa)):(pa.style.width="96px",ka.appendChild(pa));else{ka.innerHTML="";var ta=document.createElement("div");ta.className="gePropValue";ka.appendChild(ta);ta.innerHTML=mxUtils.htmlEntities(D(ca));mxEvent.addListener(ka,"click",mxUtils.bind(Z,function(va){function Ca(){var Ra=+Ja.value,Va=za;Ra=0==Ra.trim().length&&"string"!=Va&&"numbers"!=Va?fa.allowAuto?"auto":0:Ra;fa.allowAuto&&(null!=Ra.trim&&"auto"==Ra.trim().toLowerCase()?(Ra="auto",Va="string"):(Ra=parseFloat(Ra),Ra=isNaN(Ra)?0:Ra));null!=fa.min&&Ra<fa.min?Ra=fa.min:null!=fa.max&&Ra>fa.max&&(Ra=fa.max);var bb=null;try{bb="numbers"==Va?Ra.match(/\d+/g).map(Number).join(" "):"auto"===Ra&&fa.allowAuto&&"auto"==fa.defVal?null:encodeURIComponent(("int"==Va?parseInt(Ra):Ra)+"")}catch(ab){}F(Fa,bb,fa,null,Ja)}var Ha=mxEvent.getSource(va);+if(!(Ha!=ka&&Ha!=ta||mxEvent.isConsumed(va))){ta.innerHTML="";var Ja=document.createElement("input");N(ta,Ja);Ja.value=D(ca);Ja.className="gePropEditor";"int"!=za&&"float"!=za||fa.allowAuto||(Ja.type="number",Ja.step="int"==za?"1":"any",null!=fa.min&&(Ja.min=parseFloat(fa.min)),null!=fa.max&&(Ja.max=parseFloat(fa.max)));ta.appendChild(Ja);mxEvent.addListener(Ja,"keypress",function(Ra){13==Ra.keyCode&&Ca()});Ja.focus();mxEvent.addListener(Ja,"blur",function(){Ca()})}}))}fa.isDeletable&&(pa=mxUtils.button("-",+mxUtils.bind(Z,function(va){F(Fa,"",fa,fa.index);mxEvent.consume(va)})),pa.style.height="16px",pa.style.width="25px",pa.style.float="right",pa.className="geColorBtn",ka.appendChild(pa));ia.appendChild(ka);return ia}var Z=this,Y=this.editorUi.editor.graph,ba=[],ea=document.createElement("table");ea.className="geProperties geFullWidthElement";var aa=document.createElement("tr");aa.className="gePropHeader";var ha=document.createElement("th");ha.className="gePropHeaderCell";ha.style.paddingLeft="16px";+ha.style.backgroundRepeat="no-repeat";ha.style.backgroundPosition="-2px 50%";ha.style.backgroundSize="20px";mxUtils.write(ha,mxResources.get("property"));aa.style.cursor="pointer";var na=function(){var Fa=ea.querySelectorAll(".gePropNonHeaderRow");if(Z.editorUi.propertiesCollapsed){ha.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var ca="none";for(var fa=d.childNodes.length-1;0<=fa;fa--)try{var oa=d.childNodes[fa],pa=oa.nodeName.toUpperCase();"INPUT"!=pa&&"SELECT"!=pa||d.removeChild(oa)}catch(wa){}}else ha.style.backgroundImage=+"url('"+Editor.arrowDownImage+"')",ca="";for(fa=0;fa<Fa.length;fa++)Fa[fa].style.display=ca};mxEvent.addListener(aa,"click",function(){Z.editorUi.propertiesCollapsed=!Z.editorUi.propertiesCollapsed;na()});aa.appendChild(ha);var ra=document.createElement("th");ra.className="gePropHeaderCell";ra.style.paddingLeft="4px";mxUtils.write(ra,mxResources.get("value"));aa.appendChild(ra);ea.appendChild(aa);var sa=ra=!1;aa=null;1==r.vertices.length&&0==r.edges.length?aa=r.vertices[0].id:0==r.vertices.length&&+1==r.edges.length&&(aa=r.edges[0].id);null==aa||z||(ea.appendChild(W("id",mxUtils.htmlEntities(aa),{dispName:"id",type:"readOnly"},!0,!1)),null!=r.style&&null!=r.style.shape&&ea.appendChild(W("shape",mxUtils.htmlEntities(r.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var ua in m)if(z=m[ua],("function"!=typeof z.isVisible||z.isVisible(r,this))&&!z.primary){var xa=null!=z.getValue?z.getValue(r,this):null!=r.style[ua]?mxUtils.htmlEntities(r.style[ua]+""):null!=z.getDefaultValue?z.getDefaultValue(r,+this):z.defVal;if("separator"==z.type)sa=!sa;else{if("staticArr"==z.type)z.size=parseInt(r.style[z.sizeProperty]||m[z.sizeProperty].defVal)||0;else if(null!=z.dependentProps){var qa=z.dependentProps,Aa=[],Ba=[];for(aa=0;aa<qa.length;aa++)if(null!=m[qa[aa]]){var Ea=r.style[qa[aa]];Ba.push(m[qa[aa]].subDefVal);Aa.push(null!=Ea?Ea.split(","):[])}z.dependentPropsDefVal=Ba;z.dependentPropsVals=Aa}ea.appendChild(W(ua,xa,z,ra,sa));ra=!ra}}for(aa=0;aa<ba.length;aa++)for(z=ba[aa],m=z.parentRow,ua=0;ua<z.values.length;ua++)ra=+W(z.name,z.values[ua],{type:z.type,parentRow:z.parentRow,isDeletable:z.isDeletable,index:ua,defVal:z.defVal,countProperty:z.countProperty,size:z.size},0==ua%2,z.flipBkg),m.parentNode.insertBefore(ra,m.nextSibling),m=ra;d.appendChild(ea);na();return d};StyleFormatPanel.prototype.addStyles=function(d){if(null!=this.defaultColorSchemes){var m=this.editorUi,r=m.editor.graph,z=document.createElement("div");z.style.padding="6px 20px 0 24px";d.appendChild(z);var D=document.createElement("div");D.className=+"geSwitcher";D.style.padding="4px 18px 6px 0px";for(var F=[],N=0;N<this.defaultColorSchemes.length;N++){var P=document.createElement("div");P.className="geSwitcherDot";mxUtils.bind(this,function(Z){mxEvent.addListener(P,"click",mxUtils.bind(this,function(){V(Z)}))})(N);F.push(P);D.appendChild(P)}var V=mxUtils.bind(this,function(Z){null!=F[Z]&&(null!=this.format.currentScheme&&null!=F[this.format.currentScheme]&&(F[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=+Z,X(this.defaultColorSchemes[this.format.currentScheme]),F[this.format.currentScheme].style.background="#84d7ff")}),X=mxUtils.bind(this,function(Z){var Y=mxUtils.clone(r.defaultVertexStyle);Y[mxConstants.STYLE_STROKECOLOR]=null!=Y[mxConstants.STYLE_STROKECOLOR]?Y[mxConstants.STYLE_STROKECOLOR]:"default";Y[mxConstants.STYLE_FILLCOLOR]=null!=Y[mxConstants.STYLE_FILLCOLOR]?Y[mxConstants.STYLE_FILLCOLOR]:"default";Y[mxConstants.STYLE_FONTCOLOR]=null!=Y[mxConstants.STYLE_FONTCOLOR]?Y[mxConstants.STYLE_FONTCOLOR]:+"default";r.replaceDefaultColors(new mxCell,Y);var ba=mxUtils.bind(this,function(aa){var ha=mxUtils.button("",mxUtils.bind(this,function(sa){r.getModel().beginUpdate();try{for(var ua=m.getSelectionState().cells,xa=r.getModel(),qa=[],Aa=0<ua.length,Ba=0;Ba<ua.length;Ba++){var Ea=xa.isVertex(ua[Ba])&&xa.isEdge(xa.getParent(ua[Ba])),Fa=r.getCellStyle(ua[Ba]),ca=null!=Fa&&"image"==Fa.shape,fa=r.getCellGeometry(ua[Ba]);qa.push({isLabel:ca||Ea&&(null==fa||0>=fa.width||0>=fa.height)});Ea||ca||(Aa=!1)}for(Ba=+0;Ba<ua.length;Ba++){var oa=qa[Ba];if(Aa||!oa.isLabel){var pa=oa.isLabel?mxConstants.STYLE_LABEL_BACKGROUNDCOLOR:mxConstants.STYLE_FILLCOLOR,wa=oa.isLabel?mxConstants.STYLE_LABEL_BORDERCOLOR:mxConstants.STYLE_STROKECOLOR,za=xa.getStyle(ua[Ba]);null!=za&&"string"!==typeof za&&(za=String(za));null!=aa?(mxEvent.isShiftDown(sa)||(za=""==aa.fill||null==aa.fill?mxUtils.setStyle(za,pa,null):mxUtils.setStyle(za,pa,aa.fill),oa.isLabel||(za=""==aa.gradient||null==aa.gradient?mxUtils.setStyle(za,mxConstants.STYLE_GRADIENTCOLOR,+null):mxUtils.setStyle(za,mxConstants.STYLE_GRADIENTCOLOR,aa.gradient)),mxEvent.isControlDown(sa)||mxClient.IS_MAC&&mxEvent.isMetaDown(sa)||!xa.isVertex(ua[Ba])||(za=""==aa.font||null==aa.font?mxUtils.setStyle(za,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(za,mxConstants.STYLE_FONTCOLOR,aa.font))),mxEvent.isAltDown(sa)||(za=""==aa.stroke||null==aa.stroke?mxUtils.setStyle(za,wa,null):mxUtils.setStyle(za,wa,aa.stroke))):(za=mxUtils.setStyle(za,pa,null),za=mxUtils.setStyle(za,wa,null),oa.isLabel||+(za=mxUtils.setStyle(za,mxConstants.STYLE_GRADIENTCOLOR,null)),xa.isVertex(ua[Ba])&&(za=mxUtils.setStyle(za,mxConstants.STYLE_FONTCOLOR,null)));xa.setStyle(ua[Ba],za)}}}finally{r.getModel().endUpdate()}}));ha.className="geStyleButton";ha.style.width="36px";ha.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";ha.style.margin="0px 6px 6px 0px";if(null!=aa){var na="1px solid";null!=aa.border&&(na=aa.border);if(null!=aa.gradient)ha.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(aa.fill).cssText++" 0px,"+mxUtils.getLightDarkColor(aa.gradient).cssText+" 100%)";else if(aa.fill==mxConstants.NONE)ha.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==aa.fill||""==aa.fill)ha.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(Y,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var ra=mxUtils.getLightDarkColor(aa.fill);ha.style.backgroundImage="linear-gradient(to right bottom, "+ra.cssText+" 50%, "+ra.light+" 50.3%)"}null==aa.stroke||aa.stroke==mxConstants.NONE?+ha.style.border=na+" transparent":""==aa.stroke?ha.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(Y,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(ra=mxUtils.getLightDarkColor(aa.stroke),ha.style.border=na+" "+ra.cssText,ha.style.borderRightColor=ra.light,ha.style.borderBottomColor=ha.style.borderRightColor);null!=aa.title&&ha.setAttribute("title",aa.title)}else na=mxUtils.getValue(Y,mxConstants.STYLE_FILLCOLOR,"#ffffff"),ra=mxUtils.getValue(Y,mxConstants.STYLE_STROKECOLOR,+"#000000"),ha.style.backgroundColor=na,ha.style.border="1px solid "+ra;ha.style.borderRadius="0";z.appendChild(ha);null!=aa&&null!=aa.gradient&&(na=ha.cloneNode(!1),na.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(aa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(aa.gradient).light+") 100%)",na.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",na.style.backgroundColor="transparent",z.appendChild(na),na.style.marginLeft="-42px",+mxEvent.addListener(na,"click",function(){ha.click()}))});z.innerText="";if(null!=Z)for(var ea=0;ea<Z.length;ea++)0<ea&&0==mxUtils.mod(ea,4)&&mxUtils.br(z),ba(Z[ea])});null==this.format.currentScheme?V(Math.min(F.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):V(this.format.currentScheme);N=10>=this.defaultColorSchemes.length?43:23;var H=document.createElement("div");H.className="geButton";H.style.cssText="position:absolute;left:0px;bottom:"+N+"px;width:20px;background-image:url("+Editor.chevronLeftImage++");";mxEvent.addListener(H,"click",mxUtils.bind(this,function(){V(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var W=document.createElement("div");W.className="geButton";W.style.cssText="position:absolute;left:186px;bottom:"+N+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(d.appendChild(H),d.appendChild(W));mxEvent.addListener(W,"click",mxUtils.bind(this,function(){V(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));+X(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&d.appendChild(D)}return d}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(d){return d.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||d.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==+Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(d){return Graph.isGoogleFontUrl(d)};Graph.rewriteGoogleFontUrl=function(d){null!=d&&d.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(d=Editor.GOOGLE_FONTS_CSS2+d.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return d};Graph.createFontElement=function(d,m){var r=Graph.fontMapping[m];null==r&&Graph.isCssFontUrl(m)?(d=document.createElement("link"),d.setAttribute("rel","stylesheet"),d.setAttribute("type","text/css"),d.setAttribute("charset",+"UTF-8"),d.setAttribute("href",Graph.rewriteGoogleFontUrl(m))):(null==r&&(r='@font-face {\nfont-family: "'+d+'";\nsrc: url("'+m+'");\n}'),d=document.createElement("style"),mxUtils.write(d,r));return d};Graph.addRecentCustomFont=function(d,m){};Graph.addFont=function(d,m,r,z){if(null!=d&&0<d.length&&null!=m&&0<m.length){z=null!=z?z:Graph.customFontElements;var D=d.toLowerCase();if("helvetica"!=D&&"arial"!=d&&"sans-serif"!=D){var F=z[D];null!=F&&F.url!=m&&(F.elt.parentNode.removeChild(F.elt),F=null);+null==F?(F=m,"http:"==m.substring(0,5)&&(F=PROXY_URL+"?url="+encodeURIComponent(m)),F={name:d,url:m,elt:Graph.createFontElement(d,F)},z[D]=F,m=z==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=r&&("link"==F.elt.nodeName.toLowerCase()?(F.elt.onload=r,F.elt.onerror=r):r()),null!=m&&m.appendChild(F.elt)):null!=r&&r()}else null!=r&&r()}else null!=r&&r();return d};Graph.getFontUrl=function(d,m){d=Graph.customFontElements[d.toLowerCase()];null!=d&&(m=d.url);return m};Graph.processFontAttributes=+function(d){d=d.getElementsByTagName("*");for(var m=0;m<d.length;m++){var r=d[m].getAttribute("data-font-src");if(null!=r){var z="FONT"==d[m].nodeName?d[m].getAttribute("face"):d[m].style.fontFamily;null!=z&&Graph.addFont(z,r)}}};Graph.processFontStyle=function(d){if(null!=d){var m=mxUtils.getValue(d,"fontSource",null);if(null!=m){var r=mxUtils.getValue(d,mxConstants.STYLE_FONTFAMILY,null);if(null!=r)try{Graph.addFont(r,decodeURIComponent(m))}catch(z){}}}return d};Graph.prototype.defaultThemeName=+"default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;mxConnectionHandler.prototype.createTarget="1"==urlParams.sketch;Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var k=Graph.prototype.init;Graph.prototype.init=+function(){function d(D){m=D}k.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var m=null;mxEvent.addListener(this.container,"mouseenter",d);mxEvent.addListener(this.container,"mousemove",d);mxEvent.addListener(this.container,"mouseleave",function(D){m=null});this.isMouseInsertPoint=function(){return null!=m};var r=this.getInsertPoint;this.getInsertPoint=function(D){return null==m||D?r.apply(this,arguments):this.getPointForEvent(m)};var z=this.layoutManager.getLayout;+this.layoutManager.getLayout=function(D){var F=this.graph.getCellStyle(D);if(null!=F&&"rack"==F.childLayout){var N=new mxStackLayout(this.graph,!1);N.gridSize=null!=F.rackUnitSize?parseFloat(F.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;N.marginLeft=F.marginLeft||0;N.marginRight=F.marginRight||0;N.marginTop=F.marginTop||0;N.marginBottom=F.marginBottom||0;N.allowGaps=F.allowGaps||0;N.horizontal="1"==mxUtils.getValue(F,"horizontalRack","0");N.resizeParent=!1;N.fill=+!0;return N}return z.apply(this,arguments)};this.updateGlobalUrlVariables()};var n=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(d,m){return Graph.processFontStyle(n.apply(this,arguments))};var q=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(d,m,r,z,D,F,N,P,V,X,H,W){q.apply(this,arguments);Graph.processFontAttributes(W)};var t=mxText.prototype.redraw;mxText.prototype.redraw=function(){t.apply(this,arguments);null!=this.node&&+"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(d,m,r,z){function D(){for(var ea=P.getSelectionCells(),aa=[],ha=0;ha<ea.length;ha++)P.isCellVisible(ea[ha])&&aa.push(ea[ha]);P.setSelectionCells(aa)}function F(ea){P.setHiddenTags(ea?[]:V.slice());D();P.refresh()}function N(ea,aa){H.innerText="";if(0<ea.length){var ha=document.createElement("table");ha.setAttribute("cellpadding","2");ha.style.boxSizing="border-box";ha.style.tableLayout="fixed";+ha.style.width="100%";var na=document.createElement("tbody");if(null!=ea&&0<ea.length)for(var ra=0;ra<ea.length;ra++)(function(sa){function ua(){var Fa=P.getCellsForTags([sa],null,null,!0);P.isEnabled()?P.setSelectionCells(Fa):P.highlightCells(Fa,null,null,70)}var xa=0>mxUtils.indexOf(P.hiddenTags,sa),qa=document.createElement("tr"),Aa=document.createElement("td");Aa.style.align="center";Aa.style.width="16px";var Ba=document.createElement("img");Ba.setAttribute("src",xa?Editor.visibleImage:Editor.hiddenImage);+Ba.setAttribute("title",mxResources.get(xa?"hideIt":"show",[sa])+"\n"+mxResources.get("shiftClickShowOnly",[sa]));mxUtils.setOpacity(Ba,xa?75:25);Ba.className="geAdaptiveAsset";Ba.style.verticalAlign="middle";Ba.style.cursor="pointer";Ba.style.width="16px";if(m||Editor.isDarkMode())Ba.style.filter="invert(100%)";Aa.appendChild(Ba);mxEvent.addListener(Ba,"click",function(Fa){if(mxEvent.isShiftDown(Fa)){for(var ca=[],fa=0;fa<V.length;fa++)V[fa]!==sa&&ca.push(V[fa]);var oa=0<ca.length;for(fa=0;fa<ca.length;fa++)if(0>+mxUtils.indexOf(P.hiddenTags,ca[fa])){oa=!1;break}oa&&0>mxUtils.indexOf(P.hiddenTags,sa)?P.setHiddenTags([]):P.setHiddenTags(ca)}else P.toggleHiddenTag(sa);D();P.refresh();mxEvent.consume(Fa)});qa.appendChild(Aa);Aa=document.createElement("td");Aa.style.align="center";Aa.style.width="16px";Ba=document.createElement("img");Ba.setAttribute("src",Editor.selectImage);Ba.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Ba,xa?75:25);Ba.className="geAdaptiveAsset";Ba.style.verticalAlign=+"middle";Ba.style.cursor="pointer";Ba.style.width="16px";if(m||Editor.isDarkMode())Ba.style.filter="invert(100%)";mxEvent.addListener(Ba,"click",function(Fa){F(!0);ua();mxEvent.consume(Fa)});Aa.appendChild(Ba);qa.appendChild(Aa);Aa=document.createElement("td");Aa.style.overflow="hidden";Aa.style.whiteSpace="nowrap";Aa.style.textOverflow="ellipsis";Aa.style.verticalAlign="middle";Aa.style.cursor="pointer";Aa.setAttribute("title",sa);a=document.createElement("a");mxUtils.write(a,sa);a.style.textOverflow=+"ellipsis";a.style.position="relative";mxUtils.setOpacity(a,xa?100:40);Aa.appendChild(a);mxEvent.addListener(Aa,"click",function(Fa){if(mxEvent.isShiftDown(Fa))F(!0),ua();else if(xa&&0<P.hiddenTags.length)F(!0);else{var ca=V.slice(),fa=mxUtils.indexOf(ca,sa);ca.splice(fa,1);P.setHiddenTags(ca);D();P.refresh()}mxEvent.consume(Fa)});qa.appendChild(Aa);if(P.isEnabled()){Aa=document.createElement("td");Aa.style.verticalAlign="middle";Aa.style.textAlign="center";Aa.style.width="18px";if(null==aa){Aa.style.align=+"center";Aa.style.width="16px";Ba=document.createElement("img");Ba.setAttribute("src",Editor.trashImage);Ba.setAttribute("title",mxResources.get("removeIt",[sa]));mxUtils.setOpacity(Ba,xa?75:25);Ba.className="geAdaptiveAsset";Ba.style.verticalAlign="middle";Ba.style.cursor="pointer";Ba.style.width="16px";if(m||Editor.isDarkMode())Ba.style.filter="invert(100%)";mxEvent.addListener(Ba,"click",function(Fa){var ca=mxUtils.indexOf(V,sa);0<=ca&&V.splice(ca,1);P.removeTagsForCells(P.model.getDescendants(P.model.getRoot()),+[sa]);P.refresh();mxEvent.consume(Fa)});Aa.appendChild(Ba)}else{var Ea=document.createElement("input");Ea.setAttribute("type","checkbox");Ea.style.margin="0px";Ea.defaultChecked=null!=aa&&0<=mxUtils.indexOf(aa,sa);Ea.checked=Ea.defaultChecked;Ea.style.background="transparent";Ea.setAttribute("title",mxResources.get(Ea.defaultChecked?"removeIt":"add",[sa]));mxEvent.addListener(Ea,"change",function(Fa){Ea.checked?P.addTagsForCells(P.getSelectionCells(),[sa]):P.removeTagsForCells(P.getSelectionCells(),+[sa]);mxEvent.consume(Fa)});Aa.appendChild(Ea)}qa.appendChild(Aa)}na.appendChild(qa)})(ea[ra]);ha.appendChild(na);H.appendChild(ha)}}var P=this,V=P.hiddenTags.slice(),X=document.createElement("div");X.style.userSelect="none";X.style.overflow="hidden";X.style.padding="10px";X.style.height="100%";var H=document.createElement("div");H.style.position="absolute";H.style.boxSizing="border-box";H.style.userSelect="none";H.style.overflow="auto";H.style.padding="3px";H.style.left="0px";H.style.right="0px";+H.style.top="0px";H.style.bottom="0px";X.appendChild(H);P.addListener(mxEvent.ROOT,function(){V=P.hiddenTags.slice()});var W=mxUtils.bind(this,function(ea,aa){if(d()){ea=P.getAllTags();for(aa=0;aa<ea.length;aa++)0>mxUtils.indexOf(V,ea[aa])&&V.push(ea[aa]);V.sort();P.isSelectionEmpty()?N(V):N(V,P.getCommonTagsForCells(P.getSelectionCells()))}});P.selectionModel.addListener(mxEvent.CHANGE,W);P.model.addListener(mxEvent.CHANGE,W);P.addListener(mxEvent.REFRESH,W);var Z=document.createElement("div");Z.className=+"geToolbarContainer geDialogToolbar";Z.style.position="absolute";Z.style.display="flex";Z.style.bottom="0px";Z.style.left="0px";Z.style.right="0px";Z.style.height="32px";Z.style.overflow="hidden";Z.style.padding="3px 4px 4px 4px";Z.style.borderWidth="1px 0px 0px 0px";Z.style.borderStyle="solid";Z.style.whiteSpace="nowrap";if(P.isEnabled()){H.style.bottom="32px";var Y=document.createElement("a");Y.className="geButton";var ba=Y.cloneNode(!1);ba.style.backgroundImage="url("+Editor.visibleImage+")";ba.setAttribute("title",+mxResources.get("reset"));mxEvent.addListener(ba,"click",function(ea){P.setHiddenTags([]);mxEvent.isShiftDown(ea)||(V=P.hiddenTags.slice());D();P.refresh();mxEvent.consume(ea)});Z.appendChild(ba);null!=r&&(Y=Y.cloneNode(!1),Y.style.backgroundImage="url("+Editor.plusImage+")",Y.setAttribute("title",mxResources.get("add")),mxEvent.addListener(Y,"click",function(ea){r(V,function(aa){V=aa;W()});mxEvent.consume(ea)}),Z.appendChild(Y));X.appendChild(Z)}null!=z&&Z.appendChild(z);return{div:X,refresh:W}};+Graph.prototype.getCustomFonts=function(){var d=this.extFonts;d=null!=d?d.slice():[];for(var m in Graph.customFontElements){var r=Graph.customFontElements[m];d.push({name:r.name,url:r.url})}return d};Graph.prototype.getExtFontCss=function(){for(var d=this.getCustomFonts(),m="",r="",z=0;z<d.length;z++){var D=d[z].name,F=d[z].url;Graph.isCssFontUrl(F)?m+="@import url("+Graph.rewriteGoogleFontUrl(F)+");\n":r+='@font-face {\nfont-family: "'+D+'";\nsrc: url("'+F+'");\n}\n'}return m+r};Graph.prototype.setFont=+function(d,m){Graph.addFont(d,m);var r=Editor.guid();document.execCommand("fontname",!1,r);for(var z=this.cellEditor.textarea.getElementsByTagName("font"),D=!1,F=0;F<z.length;F++)z[F].getAttribute("face")==r&&(D=!0,z[F].setAttribute("face",d),null!=m?z[F].setAttribute("data-font-src",m):z[F].removeAttribute("data-font-src"));D||document.execCommand("fontname",!1,d)};var u=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return u.apply(this,arguments)&&(!this.shadowVisible||+!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var d=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=d)for(var m in d)this.globalVars[m]=d[m]}catch(r){null!=window.console&&console.log("Error in vars URL parameter: "+r)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var B=+Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(d){var m=B.apply(this,arguments);null==m&&null!=this.globalVars&&(m=this.globalVars[d]);return m};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var d=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(d.ownerDocument)).decode(d)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var E=Graph.prototype.getSvg;Graph.prototype.getSvg=function(d,+m,r,z,D,F,N,P,V,X,H,W,Z,Y,ba,ea,aa){if(Editor.mathOutputSize&&this.mathEnabled&&null!=this.container&&document.body.contains(this.container)&&"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset){if(0==this.container.getElementsByTagName("mjx-container").length)try{MathJax.typeset([this.container])}catch(ua){}this.refreshMathBounds()}var ha=E.apply(this,arguments);if(null!=W){var na=ha.getAttribute("style");null==na&&(na="");W="auto"==W||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?+"light":"light dark":W;ha.setAttribute("style",na+(" color-scheme: "+W+";"))}var ra=H?this.getExtFontCss():"";if(0<ra.length){var sa=ha.ownerDocument;na=null!=sa.createElementNS?sa.createElementNS(mxConstants.NS_SVG,"style"):sa.createElement("style");null!=sa.setAttributeNS?na.setAttributeNS("type","text/css"):na.setAttribute("type","text/css");na.appendChild(sa.createTextNode(ra));ha.getElementsByTagName("defs")[0].appendChild(na)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&+EditorUi.embedSvgImages(ha);this.mathEnabled&&(document.body.appendChild(ha),Editor.MathJaxRender(ha),ha.parentNode.removeChild(ha),na=ha.ownerDocument.getElementById("MJX-SVG-styles"),null!=na&&ha.getElementsByTagName("defs")[0].appendChild(na.cloneNode(!0)));return ha};var I=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(d){I.apply(this,arguments);null!=d.secondLabel&&(d.secondLabel.destroy(),d.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(d){return[d.shape,+d.text,d.secondLabel,d.control]};var C=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){C.apply(this,arguments);this.enumerationState=0};var U=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(d){null!=d.shape&&this.redrawEnumerationState(d);return U.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(d){d=decodeURIComponent(mxUtils.getValue(d.style,"enumerateValue",""));""==d&&(d=++this.enumerationState);+return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(d)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(d){var m="1"==mxUtils.getValue(d.style,"enumerate",0);m&&null==d.secondLabel?(d.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),d.secondLabel.size=12,d.secondLabel.state=d,d.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(d,d.secondLabel)):+m||null==d.secondLabel||(d.secondLabel.destroy(),d.secondLabel=null);m=d.secondLabel;if(null!=m){var r=d.view.scale,z=this.createEnumerationValue(d);d=this.graph.model.isVertex(d.cell)?new mxRectangle(d.x+d.width-4*r,d.y+4*r,0,0):mxRectangle.fromPoint(d.view.getPoint(d));m.bounds.equals(d)&&m.value==z&&m.scale==r||(m.bounds=d,m.value=z,m.scale=r,m.redraw())}};var K=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();K.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=+function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var S=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){S.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(d,m){"data:action/json,"==d.substring(0,17)&&(d=JSON.parse(d.substring(17)),null!=d.actions&&this.executeCustomActions(Graph.flattenAnimationActions(d.actions),+null,m))};Graph.flattenAnimationActions=function(d){if(!Array.isArray(d))return d;for(var m=[],r=0;r<d.length;r++){var z=d[r];if(null!=z&&null!=z.animation&&Array.isArray(z.animation.steps)){z=Graph.flattenAnimationActions(z.animation.steps);for(var D=0;D<z.length;D++)m.push(z[D])}else m.push(z)}return m};Graph.smoothScrollContainer=function(d,m,r,z,D,F){F=F||600;if(m!==z||r!==D){d.scrollLeft=m;d.scrollTop=r;var N="undefined"!=typeof performance&&null!=performance.now?performance.now():Date.now(),+P=z-m,V=D-r,X=function(H){H=Math.min(1,(H-N)/F);var W=1-Math.pow(1-H,3);d.scrollLeft=m+P*W;d.scrollTop=r+V*W;1>H&&window.requestAnimationFrame(X)};window.requestAnimationFrame(X)}};Graph.applyTransformTransition=function(d,m){m=m||600;var r=d.view.getDrawPane(),z=null!=r?r.parentNode:null;if(null!=z){var D=z.style.transition;z.style.transition="transform "+m+"ms cubic-bezier(0.16, 1, 0.3, 1)";d.armTransformTransition=!0;var F=function(){z.style.transition=D||"";d.armTransformTransition=!1;z.removeEventListener("transitionend",+F)};z.addEventListener("transitionend",F);window.setTimeout(F,m+100)}};Graph.prototype.fitBoundsCssTransform=function(d,m){var r=null!=m?m:10;m=this.view.graphBounds;var z=Math.max(m.x,d.x),D=Math.max(m.y,d.y),F=Math.max(1,Math.min(m.x+m.width,d.x+d.width)-z),N=Math.max(1,Math.min(m.y+m.height,d.y+d.height)-D),P=this.container.clientWidth-r,V=this.container.clientHeight-r;d=Math.floor(20*Math.min(P/F,V/N))/20;this.view.scaleAndTranslate(d,-m.x,-m.y);z=(z-m.x)*d-Math.max((P-F*d)/2+r/2,0);r=(D-m.y)*+d-Math.max((V-N*d)/2+r/2,0);F=this.getBorder();D=m.width*d+2*F-this.container.clientWidth;m=m.height*d+2*F-this.container.clientHeight;this.container.scrollLeft=0>D?0:Math.max(0,Math.min(z,D));this.container.scrollTop=0>m?0:Math.max(0,Math.min(r,m))};Graph.prototype.isGraphTornDown=function(){return!0===this.destroyed||null==this.container};Graph.prototype.smoothFitWindow=function(d,m,r){if(this.isGraphTornDown())null!=r&&r();else{var z=this.container,D=z.scrollLeft,F=z.scrollTop;this.useCssTransforms?+(Graph.applyTransformTransition(this,600),this.fitBoundsCssTransform(d,m)):this.fitWindow(d,m);Graph.smoothScrollContainer(z,D,F,z.scrollLeft,z.scrollTop,600);null!=r&&window.setTimeout(r,600)}};Graph.prototype.scrollCellToVisibleCssTransform=function(d,m){var r=this.view.getState(d);if(null!=r){var z=this.view.graphBounds,D=this.view.scale;this.view.translate.x===-z.x&&this.view.translate.y===-z.y||this.view.scaleAndTranslate(D,-z.x,-z.y);d=this.container.clientWidth;var F=this.container.clientHeight,+N=this.getBorder(),P=z.width*D+2*N-d;N=z.height*D+2*N-F;if(null!=m){var V=(r.x-z.x)*D,X=(r.y-z.y)*D,H=(r.x+r.width-z.x)*D;z=(r.y+r.height-z.y)*D;var W=this.container.scrollLeft;r=this.container.scrollTop;V-m<W?W=V-m:H+m>W+d&&(W=H+m-d);X-m<r?r=X-m:z+m>r+F&&(r=z+m-F)}else W=(r.x+r.width/2-z.x)*D-d/2,r=(r.y+r.height/2-z.y)*D-F/2;this.container.scrollLeft=0>P?0:Math.max(0,Math.min(W,P));this.container.scrollTop=0>N?0:Math.max(0,Math.min(r,N))}};Graph.prototype.scrollCellToVisibleBorder=function(d,m){null==+m?this.scrollCellToVisible(d):(d=this.view.getState(d),null!=d&&this.scrollRectToVisible(new mxRectangle(-this.view.translate.x+d.x-m,-this.view.translate.y+d.y-m,d.width+2*m,d.height+2*m)))};Graph.prototype.smoothScrollCellToVisible=function(d,m,r){if(this.isGraphTornDown())null!=r&&r();else{var z=this.container,D=z.scrollLeft,F=z.scrollTop;this.useCssTransforms?this.scrollCellToVisibleCssTransform(d,m):this.scrollCellToVisibleBorder(d,m);Graph.smoothScrollContainer(z,D,F,z.scrollLeft,z.scrollTop,+600);null!=r&&window.setTimeout(r,600)}};Graph.prototype.toggleCellsTransient=function(d){d=this.getNodesForCells(d);for(var m=0;m<d.length;m++){var r=d[m].style.opacity;r=""===r||null===r||0<parseFloat(r);d[m].style.opacity=r?0:1}};Graph.prototype.setCellStylesTransient=function(d,m,r){for(var z=0;z<r.length;z++){var D=this.view.getState(r[z]);null!=D&&null!=D.style&&(null==m?delete D.style[d]:D.style[d]=m,null!=D.shape&&(D.shape.apply(D),D.shape.redraw()),null!=D.text&&(D.text.apply(D),D.text.redraw()))}};+Graph.prototype.toggleCellStylesTransient=function(d,m,r){null==m&&(m="0");for(var z=0;z<r.length;z++){var D=this.view.getState(r[z]);if(null!=D&&null!=D.style){var F=mxUtils.getValue(D.style,d,m)?"0":"1";D.style[d]=F;null!=D.shape&&(D.shape.apply(D),D.shape.redraw());null!=D.text&&(D.text.apply(D),D.text.redraw())}}};Graph.prototype.executeCustomActions=function(d,m,r){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),+null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var z=!1,D=0,F=0,N=mxUtils.bind(this,function(){z||(z=!0,this.model.beginUpdate())}),P=mxUtils.bind(this,function(){z&&(z=!1,this.model.endUpdate())}),V=null==r,X=function(Z){return null!=Z.transient?Z.transient:V},H=mxUtils.bind(this,function(){0<D&&D--;0==D&&W()}),W=mxUtils.bind(this,function(){if(this.isGraphTornDown())this.stoppingCustomActions=+this.executingCustomActions=!1,null!=m&&m();else if(F<d.length){do{var Z=this.stoppingCustomActions,Y=d[F++],ba=[];if(null!=Y.open)if(P(),this.isCustomLink(Y.open)){if(!this.customLinkClicked(Y.open,r))return}else this.openLink(Y.open);null==Y.wait||Z||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;H()}),D++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Y.wait?parseInt(Y.wait):1E3),P());null!=Y.opacity&&+null!=Y.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Y.opacity,!0)),Y.opacity.value);null!=Y.fadeIn&&(D++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeIn,!0)),0,1,H,Z?0:Y.fadeIn.delay));null!=Y.fadeOut&&(D++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeOut,!0)),1,0,H,Z?0:Y.fadeOut.delay));if(null!=Y.fadeTo&&null!=Y.fadeTo.value){D++;var ea=this.getNodesForCells(this.getCellsForAction(Y.fadeTo,!0)),aa=Z?0:null!=Y.fadeTo.delay?+Y.fadeTo.delay:1E3;Graph.setTransitionForNodes(ea,"all "+aa+"ms ease-in-out");Graph.setOpacityForNodes(ea,Y.fadeTo.value);window.setTimeout(function(){Graph.setTransitionForNodes(ea,null);H()},aa)}null!=Y.flow&&(aa=this.getCellsForAction(Y.flow,!0),Editor.toggleFlowAnimation(this,aa,!1===Y.flow.start?"stop":!0===Y.flow.start?"start":"toggle"));null!=Y.wipeIn&&(ba=ba.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeIn,!0),!0)));null!=Y.wipeOut&&(ba=ba.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeOut,+!0),!1)));null!=Y.popIn&&(ba=ba.concat(this.createPopAnimations(this.getCellsForAction(Y.popIn,!0),!0)));null!=Y.popOut&&(ba=ba.concat(this.createPopAnimations(this.getCellsForAction(Y.popOut,!0),!1)));null!=Y.toggle&&(X(Y.toggle)?this.toggleCellsTransient(this.getCellsForAction(Y.toggle,!0)):(N(),this.toggleCells(this.getCellsForAction(Y.toggle,!0,!0))));null!=Y.show&&(aa=this.getCellsForAction(Y.show,!0),Graph.setOpacityForNodes(this.getNodesForCells(aa),1),X(Y.show)||(N(),this.setCellsVisible(this.getCellsForAction(Y.show,+!0,!0),!0)));null!=Y.hide&&(aa=this.getCellsForAction(Y.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(aa),0),X(Y.hide)||(N(),this.setCellsVisible(this.getCellsForAction(Y.hide,!0,!0),!1)));if(null!=Y.toggleStyle&&null!=Y.toggleStyle.key){aa=this.getCellsForAction(Y.toggleStyle,!0);var ha=null!=Y.toggleStyle.defaultValue?Y.toggleStyle.defaultValue:"0";X(Y.toggleStyle)?this.toggleCellStylesTransient(Y.toggleStyle.key,ha,aa):(N(),this.toggleCellStyles(Y.toggleStyle.key,ha,aa))}null!=Y.style&&+null!=Y.style.key&&(aa=this.getCellsForAction(Y.style,!0),X(Y.style)?this.setCellStylesTransient(Y.style.key,Y.style.value,aa):(N(),this.setCellStyles(Y.style.key,Y.style.value,aa)));aa=[];null!=Y.select&&this.isEnabled()&&(aa=this.getCellsForAction(Y.select),this.setSelectionCells(aa));null!=Y.highlight&&(aa=this.getCellsForAction(Y.highlight),this.highlightCells(aa,Y.highlight.color,Y.highlight.duration,Y.highlight.opacity));null!=Y.scroll&&(aa=this.getCellsForAction(Y.scroll));null!=Y.viewbox&&+(!0!==Y.viewbox.smooth||Z?this.useCssTransforms?this.fitBoundsCssTransform(Y.viewbox,Y.viewbox.border):this.fitWindow(Y.viewbox,Y.viewbox.border):(D++,this.smoothFitWindow(Y.viewbox,Y.viewbox.border,H)));0<aa.length&&(ha=null==Y.scroll||null==Y.scroll.border||""===Y.scroll.border||isNaN(parseFloat(Y.scroll.border))?null:parseFloat(Y.scroll.border),null==Y.scroll||!0!==Y.scroll.smooth||Z?this.useCssTransforms?this.scrollCellToVisibleCssTransform(aa[0],ha):this.scrollCellToVisibleBorder(aa[0],ha):(D++,+this.smoothScrollCellToVisible(aa[0],ha,H)));null!=r&&null!=Y.explore&&Graph.exploreFromCell(this,r,Y.explore);if(null!=Y.tags){if(null!=Y.tags.toggle)for(ha=Y.tags.toggle,0==ha.length&&(ha=this.getAllTags()),aa=0;aa<ha.length;aa++)this.toggleHiddenTag(ha[aa]);ha=null;null!=Y.tags.hidden&&(null==ha&&(ha=[]),ha=ha.concat(Y.tags.hidden));if(null!=Y.tags.visible){null==ha&&(ha=[]);var na=this.getAllTags();for(aa=0;aa<na.length;aa++)0>mxUtils.indexOf(Y.tags.visible,na[aa])&&0>mxUtils.indexOf(ha,na[aa])&&+ha.push(na[aa])}null!=ha&&this.setHiddenTags(ha);this.refresh()}if(0<ba.length){D++;aa=null!=Y.steps?Y.steps:30;ha=Y.delay;na=["wipeIn","wipeOut","popIn","popOut"];for(var ra=null,sa=0;sa<na.length;sa++){var ua=Y[na[sa]];null!=ua&&null!=ua.delay&&(ra=null==ra?ua.delay:Math.max(ra,ua.delay))}null!=ra&&(ha=ra/aa);this.executeAnimations(ba,H,Z?1:aa,Z?0:ha)}}while(F<d.length&&!0===d[F].immediate&&!this.stoppingCustomActions);0==D?W():P()}else this.stoppingCustomActions=this.executingCustomActions=!1,+P(),null!=m&&m()});W()}};Graph.prototype.doUpdateCustomLinksForCell=function(d,m){var r=this.getLinkForCell(m);null!=r&&"data:action/json,"==r.substring(0,17)&&this.setLinkForCell(m,this.updateCustomLink(d,r));if(this.isHtmlLabel(m)){var z=document.createElement("div");z.innerHTML=Graph.sanitizeHtml(this.getLabel(m));for(var D=z.getElementsByTagName("a"),F=!1,N=0;N<D.length;N++)r=D[N].getAttribute("href"),null!=r&&"data:action/json,"==r.substring(0,17)&&(D[N].setAttribute("href",this.updateCustomLink(d,+r)),F=!0);F&&this.labelChanged(m,z.innerHTML)}};Graph.prototype.updateCustomLink=function(d,m){if("data:action/json,"==m.substring(0,17))try{var r=JSON.parse(m.substring(17));null!=r.actions&&(this.updateCustomLinkActions(d,r.actions),m="data:action/json,"+JSON.stringify(r))}catch(z){}return m};Graph.prototype.updateCustomLinkActions=function(d,m){for(var r=0;r<m.length;r++){var z=m[r],D;for(D in z)this.updateCustomLinkAction(d,z[D],"cells"),this.updateCustomLinkAction(d,z[D],"excludeCells"),this.updateCustomLinkAction(d,+z[D],"layers")}};Graph.prototype.updateCustomLinkAction=function(d,m,r){if(null!=m&&null!=m[r]){for(var z=[],D=0;D<m[r].length;D++)if("*"==m[r][D])z.push(m[r][D]);else{var F=d[m[r][D]];null!=F?""!=F&&z.push(F):z.push(m[r][D])}m[r]=z}};Graph.prototype.getCellsForAction=function(d,m,r){var z="or"===d.tagsMatch?"or":"and",D={},F=[],N=function(P){for(var V=0;V<P.length;V++){var X=P[V].id;D[X]||(D[X]=!0,F.push(P[V]))}};N(this.getCellsById(d.cells));N(this.getCellsForTags(d.tags,null,m,!1,z));N(r?this.getLayerCells(d.layers):+this.getCellsForLayers(d.layers));if(null!=d.excludeCells&&0<d.excludeCells.length){m={};z=!1;for(r=0;r<d.excludeCells.length;r++){if("*"===d.excludeCells[r]){z=!0;break}m[d.excludeCells[r]]=!0}if(z)return[];d=[];for(r=0;r<F.length;r++)m[F[r].id]||d.push(F[r]);return d}return F};Graph.prototype.getCellsById=function(d){var m=[];if(null!=d)for(var r=0;r<d.length;r++)if("*"==d[r]){var z=this.model.getRoot();m=m.concat(this.model.filterDescendants(function(F){return F!=z},z))}else{var D=this.model.getCell(d[r]);+null!=D&&m.push(D)}return m};Graph.prototype.getCellsForLayers=function(d){var m=[];if(Array.isArray(d))for(var r=0;r<d.length;r++){var z=this.model.getCell(d[r]);null!=z&&(m=m.concat(this.model.filterDescendants(function(D){return D!=z},z)))}return m};Graph.prototype.getLayerCells=function(d){var m=[];if(Array.isArray(d))for(var r=0;r<d.length;r++){var z=this.model.getCell(d[r]);null!=z&&m.push(z)}return m};var M=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(d){return M.apply(this,+arguments)&&!this.isAllTagsHidden(this.getTagsForCell(d))};Graph.prototype.setHiddenTags=function(d){this.hiddenTags=d;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(d){var m=mxUtils.indexOf(this.hiddenTags,d);0>m?this.hiddenTags.push(d):0<=m&&this.hiddenTags.splice(m,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(d){if(null==d||0==d.length||0==this.hiddenTags.length)return!1;d=d.split(" ");if(d.length>+this.hiddenTags.length)return!1;for(var m=0;m<d.length;m++)if(0>mxUtils.indexOf(this.hiddenTags,d[m]))return!1;return!0};Graph.prototype.getCellsForTags=function(d,m,r,z,D){var F=[];D="or"===D;if(null!=d){m=null!=m?m:this.model.getDescendants(this.model.getRoot());for(var N=0,P={},V=0;V<d.length;V++)0<d[V].length&&(P[d[V]]=!0,N++);for(V=0;V<m.length;V++)if(r&&this.model.getParent(m[V])==this.model.root||this.model.isVertex(m[V])||this.model.isEdge(m[V])){var X=this.getTagsForCell(m[V]),H=!1;if(0<+X.length&&(X=X.split(" "),D||X.length>=d.length)){for(var W=H=0;W<X.length&&H<N;W++)null!=P[X[W]]&&H++;H=D?0<H:H==N}H&&(1!=z||this.isCellVisible(m[V]))&&F.push(m[V])}}return F};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(d){for(var m=null,r=[],z=0;z<d.length;z++){var D=this.getTagsForCell(d[z]);r=[];if(0<D.length){D=D.split(" ");for(var F={},N=0;N<D.length;N++)if(null==m||null!=m[D[N]])F[D[N]]=+!0,r.push(D[N]);m=F}else return[]}return r};Graph.prototype.getTagsForCells=function(d){for(var m=[],r={},z=0;z<d.length;z++){var D=this.getTagsForCell(d[z]);if(0<D.length){D=D.split(" ");for(var F=0;F<D.length;F++)null==r[D[F]]&&(r[D[F]]=!0,m.push(D[F]))}}return m};Graph.prototype.getTagsForCell=function(d){return this.getAttributeForCell(d,"tags","")};Graph.prototype.addTagsForCells=function(d,m){if(0<d.length&&0<m.length){this.model.beginUpdate();try{for(var r=0;r<d.length;r++){for(var z=this.getTagsForCell(d[r]),+D=z.split(" "),F=!1,N=0;N<m.length;N++){var P=mxUtils.trim(m[N]);""!=P&&0>mxUtils.indexOf(D,P)&&(z=0<z.length?z+" "+P:P,F=!0)}F&&this.setAttributeForCell(d[r],"tags",z)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(d,m){if(0<d.length&&0<m.length){this.model.beginUpdate();try{for(var r=0;r<d.length;r++){var z=this.getTagsForCell(d[r]);if(0<z.length){for(var D=z.split(" "),F=!1,N=0;N<m.length;N++){var P=mxUtils.indexOf(D,m[N]);0<=P&&(D.splice(P,1),F=!0)}F&&this.setAttributeForCell(d[r],+"tags",D.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(d){this.model.beginUpdate();try{for(var m=0;m<d.length;m++)this.model.setVisible(d[m],!this.model.isVisible(d[m]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(d,m){this.model.beginUpdate();try{for(var r=0;r<d.length;r++)this.model.setVisible(d[r],m)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(d,m,r,z){for(var D=0;D<d.length;D++)this.highlightCell(d[D],+m,r,z)};Graph.prototype.highlightCell=function(d,m,r,z,D){m=null!=m?m:mxConstants.DEFAULT_VALID_COLOR;r=null!=r?r:1E3;d=this.view.getState(d);var F=null;null!=d&&(D=null!=D?D:4,D=Math.max(D+1,mxUtils.getValue(d.style,mxConstants.STYLE_STROKEWIDTH,1)+D),F=new mxCellHighlight(this,m,D,!1),null!=z&&(F.opacity=z),F.highlight(d),window.setTimeout(function(){null!=F.shape&&(mxUtils.setPrefixedStyle(F.shape.node.style,"transition","all 1200ms ease-in-out"),F.shape.node.style.opacity=0);window.setTimeout(function(){F.destroy()},+1200)},r));return F};Graph.prototype.addSvgShadow=function(d,m,r,z){z=null!=z?z:!0;var D=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=r&&r||(m=null!=m?m:d.getElementsByTagName("g")[0],null!=m&&(this.updateShadowFilter(m,!0),!isNaN(parseInt(d.getAttribute("width")))&&z&&(d.setAttribute("width",parseInt(d.getAttribute("width"))+D),d.setAttribute("height",parseInt(d.getAttribute("height"))+D),m=d.getAttribute("viewBox"),null!=m&&0<m.length&&(m=m.split(" "),3<m.length&&(w=parseFloat(m[2])+D,+h=parseFloat(m[3])+D,d.setAttribute("viewBox",m[0]+" "+m[1]+" "+w+" "+h))))));return D};Graph.prototype.updateShadowFilter=function(d,m){mxClient.IS_SF||(m?(m=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),d.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+m.cssText+")"):d.style.filter="")};Graph.prototype.setShadowVisible=function(d,m){m=null!=m?m:!0;this.shadowVisible=+d;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);m&&this.fireEvent(new mxEventObject("shadowVisibleChanged"));return Math.ceil(this.svgShadowSize*this.svgShadowBlur)};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var d=this.model.getChildCount(this.model.root),m=0;do var r=this.model.getChildAt(this.model.root,+m);while(m++<d&&"1"==mxUtils.getValue(this.getCellStyle(r),"locked","0"));null!=r&&this.setDefaultParent(r)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=+[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",+STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",+STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=+[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=+[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=+[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];+mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH++"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=+[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",+STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];+mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=+[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(d){var m=null;null!=d&&0<d.length&&("ER"==d.substring(0,2)?m="mxgraph.er":"sysML"==d.substring(0,5)&&(m="mxgraph.sysml"));return m};var R=mxMarker.createMarker;mxMarker.createMarker=function(d,m,r,z,D,F,N,P,V,X){if(null!=r&&null==mxMarker.markers[r]){var H=this.getPackageForType(r);null!=H&&mxStencilRegistry.getStencil(H)}return R.apply(this,arguments)};var T=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(d,+m,r,z,D,F){"1"==mxUtils.getValue(m.style,"lineShape",null)&&d.setFillColor(mxUtils.getValue(m.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return T.apply(this,arguments)};PrintDialog.prototype.create=function(d,m,r,z){function D(){ha.value=Math.max(1,Math.min(Z,Math.max(parseInt(ha.value),parseInt(aa.value))));aa.value=Math.max(1,Math.min(Z,Math.min(parseInt(ha.value),parseInt(aa.value))))}function F(Ha){d.lastPrintPagesRadioChecked=ea.checked;d.lastPrintSelectionOnlyChecked=na.checked;d.lastPrintCropRadioChecked=+sa.checked;d.lastPrintFitRadioChecked=ua.checked;ea.checked&&aa.value<ha.value?(d.lastPrintPagesFromInput=aa.value,d.lastPrintPagesToInput=ha.value):(d.lastPrintPagesFromInput=null,d.lastPrintPagesToInput=null);ia.value=Math.max(1,Math.min(1600,parseInt(ia.value)))+"%";d.lastPrintZoom=ia.value;d.lastPrintBorder=za.value;d.lastPrintGrid=ka.checked;d.lastPrintShadow=da.checked;d.lastPrintTransparent=ja.checked;d.lastPrintInclude=ta.checked;d.lastPrintSheetsAcross=pa.value;d.lastPrintSheetsDown=wa.value;+var Ja={};Ja.border=parseInt(za.value);Ja.scale=parseInt(ia.value)/100;Ja.grid=ka.checked;Ja.shadows=da.checked;Ja.transparent=ja.checked;Ja.includeCopy=ta.checked;Ja.sheetsAcross=parseInt(pa.value);Ja.sheetsDown=parseInt(wa.value);Ja.pagesFrom=parseInt(aa.value);Ja.pagesTo=parseInt(ha.value);Ja.allPages=Y.checked;Ja.selection=na.checked;Ja.pageView=ra.checked;Ja.crop=sa.checked;Ja.fit=ua.checked;return null!=r?r(!Ha,Ja):d.print(!Ha,Ja)}function N(Ha){try{d.hideDialog(),null!=r?F(Ha):d.spinner.spin(document.body,+mxResources.get("updatingPreview"))&&window.setTimeout(function(){try{F(Ha),d.spinner.stop()}catch(Ja){d.handleError(Ja)}},0)}catch(Ja){d.handleError(Ja)}}var P=d.editor.graph,V=document.createElement("div");V.style.display="flex";V.style.flexDirection="column";V.style.minHeight="0";var X=document.createElement("div");X.style.flex="1 1 auto";X.style.minHeight="0";X.style.overflowY="auto";V.appendChild(X);var H=document.createElement("h3");mxUtils.write(H,m||mxResources.get("print"));X.appendChild(H);+var W=1,Z=1;H=document.createElement("div");H.className="geDialogSection";H.style.whiteSpace="nowrap";var Y=document.createElement("input");Y.style.marginRight="8px";Y.setAttribute("type","radio");Y.setAttribute("name","pages-printdialog");Y.setAttribute("id","gePrintDlgAllPages");var ba=document.createElement("div");ba.className="geDialogCheckRow";ba.appendChild(Y);m=document.createElement("label");m.setAttribute("for","gePrintDlgAllPages");mxUtils.write(m,mxResources.get("allPages"));ba.appendChild(m);+H.appendChild(ba);var ea=document.createElement("input");ea.style.marginRight="8px";ea.setAttribute("type","radio");ea.setAttribute("name","pages-printdialog");ea.setAttribute("id","gePrintDlgPages");ba=document.createElement("div");ba.className="geDialogCheckRow";ba.appendChild(ea);m=document.createElement("label");m.setAttribute("for","gePrintDlgPages");mxUtils.write(m,mxResources.get("pages")+":");ba.appendChild(m);var aa=document.createElement("input");aa.style.margin="0 4px";aa.setAttribute("value",+"1");aa.setAttribute("type","number");aa.setAttribute("min","1");aa.style.width="40px";ba.appendChild(aa);m=document.createElement("span");mxUtils.write(m,mxResources.get("to"));ba.appendChild(m);var ha=aa.cloneNode(!0);ba.appendChild(ha);mxEvent.addListener(aa,"focus",function(){ea.checked=!0});mxEvent.addListener(ha,"focus",function(){ea.checked=!0});mxEvent.addListener(aa,"change",D);mxEvent.addListener(ha,"change",D);if(null!=d.pages&&(Z=d.pages.length,null!=d.currentPage))for(m=0;m<Z;m++)if(d.currentPage==+d.pages[m]){W=m+1;break}null!=d.lastPrintPagesFromInput&&null!=d.lastPrintPagesToInput?(aa.value=Math.min(Z,Math.max(1,d.lastPrintPagesFromInput)),ha.value=Math.min(Z,Math.max(1,d.lastPrintPagesToInput))):(aa.value=W,ha.value=W);aa.setAttribute("max",Z);ha.setAttribute("max",Z);m=mxUtils.button(mxResources.get("currentPage"),function(Ha){aa.value=W;ha.value=W;ea.checked=!0});m.className="geBtn";m.setAttribute("title",mxResources.get("currentPage"));m.style.marginLeft="4px";m.style.maxWidth="100px";+ba.appendChild(m);H.appendChild(ba);1<Z&&X.appendChild(H);ba=document.createElement("div");ba.className="geDialogCheckRow";var na=document.createElement("input");na.setAttribute("name","pages-printdialog");na.setAttribute("type",1==Z?"checkbox":"radio");na.setAttribute("id","gePrintDlgSelectionOnly");na.style.marginRight="8px";P.isSelectionEmpty()&&na.setAttribute("disabled","disabled");P.isEnabled()&&(ba.appendChild(na),m=document.createElement("label"),m.setAttribute("for","gePrintDlgSelectionOnly"),+mxUtils.write(m,mxResources.get("selectionOnly")),ba.appendChild(m));P.isEnabled()&&(1<Z?H.appendChild(ba):(m=document.createElement("div"),m.className="geDialogSection",m.appendChild(ba),X.appendChild(m)));!d.isPagesEnabled()||d.lastPrintPagesRadioChecked?ea.checked=!0:!P.isSelectionEmpty()&&d.lastPrintSelectionOnlyChecked?na.checked=!0:Y.checked=!0;P=d.addAdvancedSection(X);X=P.content;H=document.createElement("div");H.className="geDialogCheckRow";var ra=document.createElement("input");ra.style.marginRight=+"8px";ra.setAttribute("type","radio");ra.setAttribute("name","printSize");ra.setAttribute("id","gePrintDlgPageView");H.appendChild(ra);m=document.createElement("label");m.setAttribute("for","gePrintDlgPageView");mxUtils.write(m,mxResources.get("pageView"));H.appendChild(m);mxEvent.addListener(H,"click",function(){ra.checked=!0});X.appendChild(H);H=document.createElement("div");H.className="geDialogCheckRow";var sa=document.createElement("input");sa.style.marginRight="8px";sa.setAttribute("type","radio");+sa.setAttribute("name","printSize");sa.setAttribute("id","gePrintDlgCrop");H.appendChild(sa);m=document.createElement("label");m.setAttribute("for","gePrintDlgCrop");mxUtils.write(m,mxResources.get("crop"));H.appendChild(m);mxEvent.addListener(H,"click",function(){sa.checked=!0});X.appendChild(H);H=document.createElement("div");H.className="geDialogCheckRow";H.style.alignItems="flex-start";var ua=document.createElement("input");ua.style.marginTop="4px";ua.setAttribute("type","radio");ua.setAttribute("name",+"printSize");H.appendChild(ua);ba=document.createElement("table");ba.style.display="inline-block";ba.style.borderSpacing="0";var xa=document.createElement("tbody"),qa=document.createElement("tr"),Aa=qa.cloneNode(!0),Ba=document.createElement("td"),Ea=Ba.cloneNode(!0),Fa=Ba.cloneNode(!0),ca=Ba.cloneNode(!0),fa=Ba.cloneNode(!0),oa=Ba.cloneNode(!0);Ba.style.textAlign="right";ca.style.textAlign="right";mxUtils.write(Ba,mxResources.get("fitTo"));mxEvent.addListener(H,"click",function(Ha){mxEvent.getSource(Ha)!=+ua&&(ua.checked=!ua.checked)});var pa=document.createElement("input");pa.style.margin="0 2px";pa.style.boxSizing="border-box";pa.setAttribute("value",d.lastPrintSheetsAcross||"1");pa.setAttribute("min","1");pa.setAttribute("type","number");pa.style.width="40px";Ea.appendChild(pa);m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsAcross"));Fa.appendChild(m);mxUtils.write(ca,mxResources.get("fitToBy"));var wa=pa.cloneNode(!0);wa.setAttribute("value",d.lastPrintSheetsDown||+"1");fa.appendChild(wa);mxEvent.addListener(pa,"click",function(Ha){ua.checked=!0;mxEvent.consume(Ha)});mxEvent.addListener(wa,"click",function(Ha){ua.checked=!0;mxEvent.consume(Ha)});d.lastPrintCropRadioChecked?sa.checked=!0:d.lastPrintFitRadioChecked?ua.checked=!0:ra.checked=!0;m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsDown"));oa.appendChild(m);qa.appendChild(Ba);qa.appendChild(Ea);qa.appendChild(Fa);Aa.appendChild(ca);Aa.appendChild(fa);Aa.appendChild(oa);xa.appendChild(qa);+xa.appendChild(Aa);ba.appendChild(xa);H.appendChild(ba);X.appendChild(H);X=document.createElement("div");X.className="geDialogSection";m=document.createElement("div");m.className="geDialogFormRow";H=document.createElement("label");H.className="geDialogFormLabel";H.setAttribute("for","gePrintDlgBorder");mxUtils.write(H,mxResources.get("borderWidth"));m.appendChild(H);var za=document.createElement("input");za.setAttribute("type","number");za.setAttribute("min","0");za.setAttribute("id","gePrintDlgBorder");+za.style.width="40px";za.value=null!=d.lastPrintBorder?d.lastPrintBorder:mxPrintPreview.prototype.pageMargin;m.appendChild(za);H=document.createElement("label");H.setAttribute("for","gePrintDlgZoom");H.style.marginLeft="12px";H.style.marginRight="4px";mxUtils.write(H,mxResources.get("zoom"));m.appendChild(H);var ia=document.createElement("input");ia.setAttribute("id","gePrintDlgZoom");ia.style.width="60px";ia.value=null!=d.lastPrintZoom?d.lastPrintZoom:"100%";m.appendChild(ia);X.appendChild(m);H=+document.createElement("div");H.className="geDialogCheckRow";var ka=document.createElement("input");ka.setAttribute("type","checkbox");ka.setAttribute("id","gePrintDlgGrid");ka.style.marginRight="8px";ka.checked=null!=d.lastPrintGrid?d.lastPrintGrid:!1;H.appendChild(ka);m=document.createElement("label");m.setAttribute("for","gePrintDlgGrid");mxUtils.write(m,mxResources.get("grid"));H.appendChild(m);X.appendChild(H);H=document.createElement("div");H.className="geDialogCheckRow";var da=document.createElement("input");+da.setAttribute("type","checkbox");da.setAttribute("id","gePrintDlgShadows");da.style.marginRight="8px";da.checked=null!=d.lastPrintShadow?d.lastPrintShadow:!1;H.appendChild(da);m=document.createElement("label");m.setAttribute("for","gePrintDlgShadows");mxUtils.write(m,mxResources.get("shadows"));H.appendChild(m);d.isOffline()&&!mxClient.IS_CHROMEAPP||H.appendChild(d.createHelpIcon("https://www.drawio.com/docs/manual/export/print-diagram/#shadows-in-print-and-pdf-export"));Editor.enableShadowOption||+(H.style.display="none");X.appendChild(H);var ja=document.createElement("input");ja.setAttribute("type","checkbox");ja.setAttribute("id","gePrintDlgTransparent");ja.style.marginRight="8px";ja.checked=null!=d.lastPrintTransparent?d.lastPrintTransparent:!1;null!=r&&(H=document.createElement("div"),H.className="geDialogCheckRow",H.appendChild(ja),m=document.createElement("label"),m.setAttribute("for","gePrintDlgTransparent"),mxUtils.write(m,mxResources.get("transparentBackground")),H.appendChild(m),+X.appendChild(H));var ta=document.createElement("input");ta.setAttribute("type","checkbox");ta.setAttribute("id","gePrintDlgInclude");ta.style.marginRight="8px";ta.checked=null!=d.lastPrintInclude?d.lastPrintInclude:Editor.defaultIncludeDiagram;null==r||mxClient.IS_CHROMEAPP||"draw.io"!=d.getServiceName()||(H=document.createElement("div"),H.className="geDialogCheckRow",H.appendChild(ta),m=document.createElement("label"),m.setAttribute("for","gePrintDlgInclude"),mxUtils.write(m,mxResources.get("includeCopyOfMyDiagram")),+H.appendChild(m),X.appendChild(H));P.wrapper.appendChild(X);m=document.createElement("div");m.style.flex="0 0 auto";m.style.marginTop="16px";m.style.textAlign="right";m.style.whiteSpace="nowrap";d.isOffline()&&!mxClient.IS_CHROMEAPP||null!=r||m.appendChild(d.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));P=mxUtils.button(mxResources.get("cancel"),function(){d.hideDialog()});P.className="geBtn";d.editor.cancelFirst&&m.appendChild(P);PrintDialog.previewEnabled&&null==r&&(X=mxUtils.button(mxResources.get("preview"),+function(){N(!1)}),X.className="geBtn",m.appendChild(X));z=null!=z?z:null!=r?"export":PrintDialog.previewEnabled?"print":"ok";z=mxUtils.button(mxResources.get(z),function(){N(!0)});z.className="geBtn gePrimaryBtn";m.appendChild(z);d.editor.cancelFirst||m.appendChild(P);V.appendChild(m);if(d.editor.isChromelessView()){var va=function(){Editor.isDarkMode()?(V.classList.add("geDarkMode"),V.style.colorScheme="dark"):(V.classList.remove("geDarkMode"),V.style.colorScheme="light")};d.addListener("darkModeChanged",va);va();var Ca=function(Ha,Ja){Ha=Ja.getProperty("dialog");V.parentNode==Ha.container&&(d.editor.removeListener(Ca),d.removeListener(va))};d.editor.addListener("hideDialog",Ca)}this.container=V};var v=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var d=this.image;null!=d&&null!=d.src&&Graph.isPageLink(d.src)&&(d={originalSrc:d.src});this.page.viewState.backgroundImage=d}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else v.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(d=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=d?d:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.parseAnimationScript=function(d){var m=-[];if(null==d)return m;var r=function(V){if(null!=V)return V=parseFloat(V),!isNaN(V)&&0<=V?V:void 0},A={fade:!0,pop:!0,wipe:!0};d=d.split("\n");for(var D=0;D<d.length;D++){var G=mxUtils.trim(d[D]);if(""!=G&&"#"!=G.charAt(0)){G=G.split(/\s+/);var O={action:G[0],cell:G[1],arg:G[2]};if("wait"==O.action){if(O.delay=parseFloat(O.cell),isNaN(O.delay)||0>O.delay)O.delay=1E3}else if("setOpacity"==O.action)O.opacity=parseFloat(G[2]),isNaN(O.opacity)&&(O.opacity=1),O.opacity=Math.max(0,Math.min(1,O.opacity)),-O.duration=r(G[3]),O.arg=void 0;else if("show"==O.action){if(null!=O.arg&&!A[O.arg]){var P=r(O.arg);null!=P&&(O.duration=P,O.arg=void 0)}null==O.duration&&(O.duration=r(G[3]))}else"hide"==O.action&&(O.duration=r(G[2]),O.arg=void 0);m.push(O)}}return m};Editor.animationFadeDelay=400;Editor.canBatchAnimationSteps=function(d,m){return d.action!=m.action||"wait"==d.action||(d.arg||"")!=(m.arg||"")||(null!=d.opacity?d.opacity:"")!=(null!=m.opacity?m.opacity:"")||(null!=d.duration?d.duration:"")!=(null!=+[];if(null==d)return m;var r=function(V){if(null!=V)return V=parseFloat(V),!isNaN(V)&&0<=V?V:void 0},z={fade:!0,pop:!0,wipe:!0};d=d.split("\n");for(var D=0;D<d.length;D++){var F=mxUtils.trim(d[D]);if(""!=F&&"#"!=F.charAt(0)){F=F.split(/\s+/);var N={action:F[0],cell:F[1],arg:F[2]};if("wait"==N.action){if(N.delay=parseFloat(N.cell),isNaN(N.delay)||0>N.delay)N.delay=1E3}else if("setOpacity"==N.action)N.opacity=parseFloat(F[2]),isNaN(N.opacity)&&(N.opacity=1),N.opacity=Math.max(0,Math.min(1,N.opacity)),+N.duration=r(F[3]),N.arg=void 0;else if("show"==N.action){if(null!=N.arg&&!z[N.arg]){var P=r(N.arg);null!=P&&(N.duration=P,N.arg=void 0)}null==N.duration&&(N.duration=r(F[3]))}else"hide"==N.action&&(N.duration=r(F[2]),N.arg=void 0);m.push(N)}}return m};Editor.animationFadeDelay=400;Editor.canBatchAnimationSteps=function(d,m){return d.action!=m.action||"wait"==d.action||(d.arg||"")!=(m.arg||"")||(null!=d.opacity?d.opacity:"")!=(null!=m.opacity?m.opacity:"")||(null!=d.duration?d.duration:"")!=(null!=m.duration?m.duration:"")?!1:!0};Editor.convertLegacyAnimationStep=function(d){if("wait"==d.action)return{wait:d.delay};var m="all"==d.cell?"*":d.cell;if(null==m)return null;var r={cells:[m]};if(null!=d.duration)r.delay=d.duration;else if("show"==d.action&&"fade"==d.arg)r.delay=Editor.animationFadeDelay;else if("hide"==d.action||"setOpacity"==d.action)r.delay=Editor.animationFadeDelay;return"show"==d.action?"fade"==d.arg?{fadeIn:r}:"pop"==d.arg?{popIn:r}:{wipeIn:r}:"hide"==d.action?{fadeOut:r}:"setOpacity"==-d.action?(r.value=d.opacity,{fadeTo:r}):"flow"==d.action?(m={cells:[m]},"start"==d.arg?m.start=!0:"stop"==d.arg&&(m.start=!1),{flow:m}):null};Editor.convertLegacyAnimation=function(d){d=Editor.parseAnimationScript(d);for(var m=[{opacity:{cells:["*"],value:0}}],r=null,A=function(){null!=r&&(m.push(r),r=null)},D=function(P){null==r&&(r={});for(var V in P){var Y=P[V],H;if(H=null!=r[V]&&null!=Y&&Array.isArray(r[V].cells)&&Array.isArray(Y.cells))H=r[V],H=H.delay===Y.delay&&H.value===Y.value&&H.start===-Y.start;if(H)for(H=0;H<Y.cells.length;H++)r[V].cells.push(Y.cells[H]);else null!=r[V]&&(A(),r={}),r[V]=Y}},G=0;G<d.length;G++){var O=Editor.convertLegacyAnimationStep(d[G]);null!=O&&(null!=O.wait?(A(),m.push(O)):D(O))}A();return{animation:{steps:m}}};Editor.parseAnimationData=function(d){var m=function(A){null==A&&(A={});Array.isArray(A.steps)||(A.steps=[]);A.loop=null==A.loop?!0:!!A.loop;A.enabled=null==A.enabled?!0:!!A.enabled;return A};if(null==d||""===d)return m({steps:[]});if("string"==typeof d){var r=-mxUtils.trim(d);return"{"==r.charAt(0)||"["==r.charAt(0)?Editor.parseAnimationData(JSON.parse(r)):m(Editor.convertLegacyAnimation(d).animation)}return null!=d.animation&&null!=d.animation.steps?m(d.animation):Array.isArray(d.steps)?m(d):m({steps:[]})};Editor.AnimationPlayer=function(d,m){this.graph=d;this.data=Editor.parseAnimationData(m);this.cancelled=this.running=!1;this.snapshot=null};Editor.ANIMATION_ALL="*";Editor.collectAnimatableCells=function(d){var m=[],r;for(r in d.cells){var A=d.cells[r];-(d.isVertex(A)||d.isEdge(A))&&m.push(A)}return m};Editor.AnimationPlayer.prototype.collectReferencedCells=function(){for(var d=this.data.steps||[],m={},r=[],A=0;A<d.length;A++){var D=d[A],G;for(G in D)if("wait"!=G&&"open"!=G){var O=D[G];if("object"===typeof O&&null!=O){O=this.graph.getCellsForAction(O,!0);for(var P=0;P<O.length;P++)m[O[P].id]||(m[O[P].id]=!0,r.push(O[P]))}}}return r};Editor.AnimationPlayer.prototype.snapshotOpacity=function(){var d=this.collectReferencedCells();d=this.graph.getNodesForCells(d);+d.action?(r.value=d.opacity,{fadeTo:r}):"flow"==d.action?(m={cells:[m]},"start"==d.arg?m.start=!0:"stop"==d.arg&&(m.start=!1),{flow:m}):null};Editor.convertLegacyAnimation=function(d){d=Editor.parseAnimationScript(d);for(var m=[{opacity:{cells:["*"],value:0}}],r=null,z=function(){null!=r&&(m.push(r),r=null)},D=function(P){null==r&&(r={});for(var V in P){var X=P[V],H;if(H=null!=r[V]&&null!=X&&Array.isArray(r[V].cells)&&Array.isArray(X.cells))H=r[V],H=H.delay===X.delay&&H.value===X.value&&H.start===+X.start;if(H)for(H=0;H<X.cells.length;H++)r[V].cells.push(X.cells[H]);else null!=r[V]&&(z(),r={}),r[V]=X}},F=0;F<d.length;F++){var N=Editor.convertLegacyAnimationStep(d[F]);null!=N&&(null!=N.wait?(z(),m.push(N)):D(N))}z();return{animation:{steps:m}}};Editor.parseAnimationData=function(d){var m=function(z){null==z&&(z={});Array.isArray(z.steps)||(z.steps=[]);z.loop=null==z.loop?!0:!!z.loop;z.enabled=null==z.enabled?!0:!!z.enabled;return z};if(null==d||""===d)return m({steps:[]});if("string"==typeof d){var r=+mxUtils.trim(d);return"{"==r.charAt(0)||"["==r.charAt(0)?Editor.parseAnimationData(JSON.parse(r)):m(Editor.convertLegacyAnimation(d).animation)}return null!=d.animation&&null!=d.animation.steps?m(d.animation):Array.isArray(d.steps)?m(d):m({steps:[]})};Editor.AnimationPlayer=function(d,m){this.graph=d;this.data=Editor.parseAnimationData(m);this.cancelled=this.running=!1;this.snapshot=null};Editor.ANIMATION_ALL="*";Editor.collectAnimatableCells=function(d){var m=[],r;for(r in d.cells){var z=d.cells[r];+(d.isVertex(z)||d.isEdge(z))&&m.push(z)}return m};Editor.AnimationPlayer.prototype.collectReferencedCells=function(){for(var d=this.data.steps||[],m={},r=[],z=0;z<d.length;z++){var D=d[z],F;for(F in D)if("wait"!=F&&"open"!=F){var N=D[F];if("object"===typeof N&&null!=N){N=this.graph.getCellsForAction(N,!0);for(var P=0;P<N.length;P++)m[N[P].id]||(m[N[P].id]=!0,r.push(N[P]))}}}return r};Editor.AnimationPlayer.prototype.snapshotOpacity=function(){var d=this.collectReferencedCells();d=this.graph.getNodesForCells(d);this.snapshot=[];for(var m=0;m<d.length;m++)this.snapshot.push({node:d[m],opacity:d[m].style.opacity})};Editor.AnimationPlayer.prototype.restoreOpacity=function(){if(null!=this.snapshot){for(var d=0;d<this.snapshot.length;d++)Graph.setTransitionForNodes([this.snapshot[d].node],null),this.snapshot[d].node.style.opacity=this.snapshot[d].opacity;this.snapshot=null}};Editor.AnimationPlayer.prototype.play=function(d){if(!this.running&&null!=this.graph&&!this.graph.isGraphTornDown()){d=d||{};this.running=-!0;this.cancelled=!1;this.graph.stoppingCustomActions=!1;this.graph.view.validate();var m=this,r=this.data.steps||[],A=function(G,O){if(null==m.graph||m.graph.isGraphTornDown())m.running=!1;else if(m.cancelled||G>=r.length)O();else{for(var P=G+1;P<r.length&&!0===r[P].immediate&&!m.cancelled;)P++;if("function"==typeof d.onStep)try{d.onStep(G,P)}catch(V){}m.graph.executeCustomActions(Graph.flattenAnimationActions(r.slice(G,P)),function(){A(P,O)},null)}},D=function(){null==m.graph||m.graph.isGraphTornDown()?-m.running=!1:m.cancelled?(m.restoreOpacity(),m.running=!1):(m.snapshotOpacity(),A(0,function(){if(m.cancelled)m.restoreOpacity(),m.running=!1;else{if("function"==typeof d.onStep)try{d.onStep(-1)}catch(G){}d.loop?(m.graph.refresh(),m.restoreOpacity(),window.setTimeout(D,0)):(m.running=!1,m.restoreOpacity(),null!=d.done&&d.done())}}))};d.defer?window.setTimeout(D,0):D()}};Editor.AnimationPlayer.prototype.stop=function(){this.cancelled=!0;null!=this.graph&&(this.graph.stoppingCustomActions=!0);for(var d=-[],m=this.collectReferencedCells(),r=0;r<m.length;r++)this.graph.getModel().isEdge(m[r])&&d.push(m[r]);0<d.length&&Editor.toggleFlowAnimation(this.graph,d,"stop")};Editor.toggleFlowAnimation=function(d,m,r){r=r||"toggle";for(var A=0;A<m.length;A++)if(d.getModel().isEdge(m[A])){var D=d.view.getState(m[A]);if(null!=D&&null!=D.shape){var G=null!=D.shape.getFlowAnimationPath?D.shape.getFlowAnimationPath():null;if(null!=G){var O="mxEdgeFlow"==G.getAttribute("class"),P="start"==r||"toggle"==r&&!O;O="stop"==-r||"toggle"==r&&O;D="1"==mxUtils.getValue(D.style,mxConstants.STYLE_DASHED,"0");O?(G.removeAttribute("class"),D||G.removeAttribute("stroke-dasharray")):P&&(G.setAttribute("class","mxEdgeFlow"),D||G.setAttribute("stroke-dasharray","8"))}}}};Editor.playAnimationOnGraph=function(d,m){var r=d.getModel().getRoot(),A=null;null!=r.value&&"object"==typeof r.value&&(A=r.value.getAttribute("animation"));if(null==A||""==A)return null;try{var D=Editor.parseAnimationData(A)}catch(O){return null}if(!D.steps||0==-D.steps.length||!1===D.enabled)return null;r={};if(null!=m)for(var G in m)r[G]=m[G];null==r.loop&&(r.loop=D.loop);null==r.defer&&(r.defer=!0);d=new Editor.AnimationPlayer(d,D);d.play(r);return d};Editor.installAnimationStyles=function(){if(!Editor.animationStylesInstalled){Editor.animationStylesInstalled=!0;try{var d=document.createElement("style");d.type="text/css";d.appendChild(document.createTextNode(".mxEdgeFlow { animation: mxEdgeFlow 0.5s linear infinite; }@keyframes mxEdgeFlow { to { stroke-dashoffset: -16; } }"));-document.getElementsByTagName("head")[0].appendChild(d)}catch(m){}}};Editor.installAnimationStyles()})();(function(){EditorUi.VERSION="30.3.13";EditorUi.CSV_ELK_LAYOUTS={verticalflow:{layout:"elkLayered",config:{"elk.direction":"DOWN","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},horizontalflow:{layout:"elkLayered",config:{"elk.direction":"RIGHT","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED",+!0;this.cancelled=!1;this.graph.stoppingCustomActions=!1;this.graph.view.validate();var m=this,r=this.data.steps||[],z=function(F,N){if(null==m.graph||m.graph.isGraphTornDown())m.running=!1;else if(m.cancelled||F>=r.length)N();else{for(var P=F+1;P<r.length&&!0===r[P].immediate&&!m.cancelled;)P++;if("function"==typeof d.onStep)try{d.onStep(F,P)}catch(V){}m.graph.executeCustomActions(Graph.flattenAnimationActions(r.slice(F,P)),function(){z(P,N)},null)}},D=function(){null==m.graph||m.graph.isGraphTornDown()?+m.running=!1:m.cancelled?(m.restoreOpacity(),m.running=!1):(m.snapshotOpacity(),z(0,function(){if(m.cancelled)m.restoreOpacity(),m.running=!1;else{if("function"==typeof d.onStep)try{d.onStep(-1)}catch(F){}d.loop?(m.graph.refresh(),m.restoreOpacity(),window.setTimeout(D,0)):(m.running=!1,m.restoreOpacity(),null!=d.done&&d.done())}}))};d.defer?window.setTimeout(D,0):D()}};Editor.AnimationPlayer.prototype.stop=function(){this.cancelled=!0;null!=this.graph&&(this.graph.stoppingCustomActions=!0);for(var d=+[],m=this.collectReferencedCells(),r=0;r<m.length;r++)this.graph.getModel().isEdge(m[r])&&d.push(m[r]);0<d.length&&Editor.toggleFlowAnimation(this.graph,d,"stop")};Editor.toggleFlowAnimation=function(d,m,r){r=r||"toggle";for(var z=0;z<m.length;z++)if(d.getModel().isEdge(m[z])){var D=d.view.getState(m[z]);if(null!=D&&null!=D.shape){var F=null!=D.shape.getFlowAnimationPath?D.shape.getFlowAnimationPath():null;if(null!=F){var N="mxEdgeFlow"==F.getAttribute("class"),P="start"==r||"toggle"==r&&!N;N="stop"==+r||"toggle"==r&&N;D="1"==mxUtils.getValue(D.style,mxConstants.STYLE_DASHED,"0");N?(F.removeAttribute("class"),D||F.removeAttribute("stroke-dasharray")):P&&(F.setAttribute("class","mxEdgeFlow"),D||F.setAttribute("stroke-dasharray","8"))}}}};Editor.playAnimationOnGraph=function(d,m){var r=d.getModel().getRoot(),z=null;null!=r.value&&"object"==typeof r.value&&(z=r.value.getAttribute("animation"));if(null==z||""==z)return null;try{var D=Editor.parseAnimationData(z)}catch(N){return null}if(!D.steps||0==+D.steps.length||!1===D.enabled)return null;r={};if(null!=m)for(var F in m)r[F]=m[F];null==r.loop&&(r.loop=D.loop);null==r.defer&&(r.defer=!0);d=new Editor.AnimationPlayer(d,D);d.play(r);return d};Editor.installAnimationStyles=function(){if(!Editor.animationStylesInstalled){Editor.animationStylesInstalled=!0;try{var d=document.createElement("style");d.type="text/css";d.appendChild(document.createTextNode(".mxEdgeFlow { animation: mxEdgeFlow 0.5s linear infinite; }@keyframes mxEdgeFlow { to { stroke-dashoffset: -16; } }"));+document.getElementsByTagName("head")[0].appendChild(d)}catch(m){}}};Editor.installAnimationStyles()})();(function(){EditorUi.VERSION="30.3.14";EditorUi.CSV_ELK_LAYOUTS={verticalflow:{layout:"elkLayered",config:{"elk.direction":"DOWN","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},horizontalflow:{layout:"elkLayered",config:{"elk.direction":"RIGHT","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},elkRadial:{layout:"elkRadial",config:{edgeStyle:"elkCompat"}},elkOrganic:{layout:"elkOrganic",config:{edgeStyle:"elkCompat"}},elkStress:{layout:"elkStress",config:{edgeStyle:"elkCompat"}}};EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)||/.*\.cdn\.prod\.atlassian-dev\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&"1"!=urlParams.extAuth&&"showSaveFilePicker"in window&&"showOpenFilePicker"in@@ -13709,14 +13713,14 @@ window;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlPar{};EditorUi.legacyMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},gantt:{useWidth:1E3,useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};EditorUi.mermaidImageBorder=10;EditorUi.logError=function(c,f,k,n,q,t,u){if(null!=c){q=null!=q?q:Error(c);q.stack=null!=q.stack?q.stack:"";t=null!=t?t:0>c.indexOf("NetworkError")&&0>c.indexOf("SecurityError")&&0>c.indexOf("NS_ERROR_FAILURE")&&0>c.indexOf("out of memory")?"SEVERE":"CONFIG";try{EditorUi.enableLogging&&"1"!=urlParams.dev&&c!=EditorUi.lastErrorMessage&&0>c.indexOf("extension:")&&0>c.indexOf("ResizeObserver loop completed with undelivered notifications")&&0>q.stack.indexOf("extension:")&&0>q.stack.indexOf("<anonymous>:")&&0>q.stack.indexOf("/math4/es5/")&&0>q.stack.indexOf("blob:")&&(0>c.indexOf("strict mode")||0>q.stack.indexOf("extensions.min.js"))&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+t+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(k)+(null!=n?":colno:"+encodeURIComponent(n):"")+(""!=-q.stack?"&stack="+encodeURIComponent(q.stack):""))}catch(y){}try{u||null==window.console||console.error(t,c,f,k,n,q)}catch(y){}}};EditorUi.logEvent=function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=f+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(k){}};EditorUi.sendReport=function(c,f){if("1"==urlParams.dev)EditorUi.debug("sendReport",+q.stack?"&stack="+encodeURIComponent(q.stack):""))}catch(B){}try{u||null==window.console||console.error(t,c,f,k,n,q)}catch(B){}}};EditorUi.logEvent=function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=f+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(k){}};EditorUi.sendReport=function(c,f){if("1"==urlParams.dev)EditorUi.debug("sendReport",c);else if(EditorUi.enableLogging)try{f=null!=f?f:5E4,c.length>f&&(c=c.substring(0,f)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(c))}catch(k){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var c=[(new Date).toISOString()],f=0;f<arguments.length;f++)c.push(arguments[f]);mxClient.IS_IOS?(mxLog.show(),mxLog.debug(c.join(" "))):console.log.apply(console,c)}}catch(k){}};EditorUi.removeChildNodes=function(c){for(;null!=c.firstChild;)c.removeChild(c.firstChild)};EditorUi.embedSvgImages=function(c){c=c.getElementsByTagName("image");for(var f=[],k=0;k<c.length;k++)f.push(c[k]);for(k=0;k<f.length;k++)EditorUi.replaceSvgImage(f[k])};EditorUi.replaceSvgImage=function(c){try{var f=null;f=null==c.getAttributeNS?c.getAttribute("xlink:href"):c.getAttributeNS(mxConstants.NS_XLINK,"href");var k=EditorUi.getSvgSubtree(f);if(null!=k&&"svg"==k.nodeName){var n=k.getAttribute("width"),q=k.getAttribute("height");c.hasAttribute("x")&&k.setAttribute("x",c.getAttribute("x"));c.hasAttribute("y")&&k.setAttribute("y",c.getAttribute("y"));k.setAttribute("width",c.getAttribute("width"));k.setAttribute("height",c.getAttribute("height"));k.style.fontFamily="initial";null!=c.getAttribute("preserveAspectRatio")&&k.setAttribute("preserveAspectRatio",c.getAttribute("preserveAspectRatio"));0<n&&0<q&&null==k.getAttribute("viewBox")&&k.setAttribute("viewBox","0 0 "+n+" "+q);var t=mxUtils.createElementNs(k.ownerDocument,mxConstants.NS_SVG,"g");t.appendChild(k);c.hasAttribute("id")&&t.setAttribute("id",c.getAttribute("id"));c.hasAttribute("transform")&&t.setAttribute("transform",c.getAttribute("transform"));c.hasAttribute("opacity")&&t.setAttribute("opacity",c.getAttribute("opacity"));c.parentNode.replaceChild(t,c)}}catch(u){}};EditorUi.getSvgSubtree=function(c){var f=Graph.getSvgFromDataUri(c);c=null;if(null!=f){c=Graph.sanitizeNode(mxUtils.parseXml(f).documentElement);f=c.getElementsByTagName("style");if(0<f.length){var k=-"svg-image-"+Editor.guid();c.setAttribute("id",k);for(var n=document.implementation.createHTMLDocument(""),q=document.createElement("style"),t=0;t<f.length;t++){q.textContent=f[t].textContent;n.body.appendChild(q);for(var u="",y=0;y<q.sheet.cssRules.length;y++){var E=q.sheet.cssRules[y];if(null!=E.selectorText){for(var I=E.selectorText.split(","),C=0;C<I.length;C++)I[C]="#"+k+" "+I[C];E.selectorText=I.join(",")}u+=E.cssText+"\n"}f[t].textContent=u}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&-c.style.removeProperty("color-scheme");f=c.getElementsByTagName("*");for(k=0;k<f.length;k++)f[k].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.isDiagramDataEmpty=function(c){if(null==c||0==c.length||c==this.emptyDiagramXml)return!0;try{var f=mxUtils.parseXml(c).documentElement;c=function(y){return null==-y||2>=y.getElementsByTagName("mxCell").length};if("mxGraphModel"==f.nodeName)return c(f);if("mxfile"==f.nodeName){var k=f.getElementsByTagName("diagram");if(0==k.length)return!0;for(f=0;f<k.length;f++){var n=k[f].getElementsByTagName("mxGraphModel");if(0<n.length){if(!c(n[0]))return!1}else{var q=mxUtils.getNodeValue(k[f]);if(null!=q&&0<q.length){var t=Graph.decompress(q);if(null!=t&&0<t.length){var u=mxUtils.parseXml(t);if(!c(u.documentElement))return!1}}}}return!0}}catch(y){}return!1};EditorUi.prototype.mode=+"svg-image-"+Editor.guid();c.setAttribute("id",k);for(var n=document.implementation.createHTMLDocument(""),q=document.createElement("style"),t=0;t<f.length;t++){q.textContent=f[t].textContent;n.body.appendChild(q);for(var u="",B=0;B<q.sheet.cssRules.length;B++){var E=q.sheet.cssRules[B];if(null!=E.selectorText){for(var I=E.selectorText.split(","),C=0;C<I.length;C++)I[C]="#"+k+" "+I[C];E.selectorText=I.join(",")}u+=E.cssText+"\n"}f[t].textContent=u}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&+c.style.removeProperty("color-scheme");f=c.getElementsByTagName("*");for(k=0;k<f.length;k++)f[k].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.isDiagramDataEmpty=function(c){if(null==c||0==c.length||c==this.emptyDiagramXml)return!0;try{var f=mxUtils.parseXml(c).documentElement;c=function(B){return null==+B||2>=B.getElementsByTagName("mxCell").length};if("mxGraphModel"==f.nodeName)return c(f);if("mxfile"==f.nodeName){var k=f.getElementsByTagName("diagram");if(0==k.length)return!0;for(f=0;f<k.length;f++){var n=k[f].getElementsByTagName("mxGraphModel");if(0<n.length){if(!c(n[0]))return!1}else{var q=mxUtils.getNodeValue(k[f]);if(null!=q&&0<q.length){var t=Graph.decompress(q);if(null!=t&&0<t.length){var u=mxUtils.parseXml(t);if(!c(u.documentElement))return!1}}}}return!0}}catch(B){}return!1};EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=1200;EditorUi.prototype.maxTextWidth=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=2E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.maxTextBytes=5E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.sidebarEnabled="0"!=urlParams.sidebar;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;EditorUi.prototype.embedMessageSource=null;EditorUi.prototype.defaultCompact=!1;EditorUi.prototype.noAutoFocus=!1;EditorUi.prototype.embedExportBorder=8;EditorUi.prototype.embedExportTheme="auto";EditorUi.prototype.embedExportBackground=null;EditorUi.prototype.shareCursorPosition=!0;EditorUi.prototype.showRemoteCursors=!0;EditorUi.prototype.createButtonContainer=function(){var c=document.createElement("div");c.className="geButtonContainer";return c};EditorUi.prototype.openLink=function(c,f,k){return this.editor.graph.openLink(c,@@ -13724,10 +13728,10 @@ f,k)};EditorUi.prototype.showSplash=function(c){};EditorUi.prototype.getLocalDatEditorUi.prototype.isShareCursorPosition=function(){return this.shareCursorPosition};EditorUi.prototype.setShowRemoteCursors=function(c){this.showRemoteCursors=c;this.fireEvent(new mxEventObject("showRemoteCursorsChanged"))};EditorUi.prototype.isShowRemoteCursors=function(){return this.showRemoteCursors};EditorUi.prototype.setMathEnabled=function(c){var f=this.editor.graph;f.mathEnabled=c;null!=f.view.backgroundImage&&(f.view.backgroundImage.destroy(),f.view.backgroundImage=null);this.editor.updateGraphComponents();f.refresh();f.defaultMathEnabled=c;this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(c){return this.editor.graph.mathEnabled};EditorUi.prototype.setAdaptiveColors=function(c){this.editor.graph.setAdaptiveColors(c);this.editor.graph.view.clear();this.fireEvent(new mxEventObject("adaptiveColorsChanged"))};EditorUi.prototype.isStandaloneApp=function(){return mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(c){return this.isOfflineApp()||!navigator.onLine&&!EditorUi.isElectronApp||!c&&("1"==urlParams.stealth||"1"==urlParams.lockdown)};EditorUi.prototype.isExternalDataComms=function(){return"1"!=urlParams.offline&&!this.isOffline()&&!this.isOfflineApp()};EditorUi.prototype.createSpinner=function(c,f,k){var n=null==c||null==f;k=null!=k?k:24;var q=new Spinner({lines:12,length:k,width:Math.round(k/3),radius:Math.round(k/2),rotate:0,-color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),t=this.timeout,u=q.spin,y=null,E=null,I=mxUtils.bind(this,function(J){null!=J&&J()}),C=this;q.spin=function(J,S,N,R){R=null!=R?R:t;var T=!1;if(!this.active){var v=Date.now();null!=N&&(y=window.setTimeout(function(){q.stop();y=null;N({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:E})},R));n&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/-2-2);J==document.body&&"1"==urlParams.embedInline&&(J=C.diagramContainer,c=J.scrollLeft+J.clientWidth/2,f=J.scrollTop+J.clientHeight/2);u.call(this,J);"1"==urlParams.embedInline&&null!=q.el&&(q.el.style.marginTop=J.scrollTop+"px",q.el.style.marginLeft=J.scrollLeft+"px");this.active=!0;null!=S&&(T=document.createElement("div"),T.className="geSpinnerStatus",T.setAttribute("title",S),J==document.body?(T.style.left=Math.max(0,c)+"px",T.style.top=Math.max(0,f+66)+"px"):(T.style.left="50%",T.style.top=-"50%",T.style.marginTop="70px"),"..."!=S.substring(S.length-3,S.length)&&"!"!=S.charAt(S.length-1)&&(S+="..."),T.innerText=S,J.appendChild(T),q.status=T);this.pause=mxUtils.bind(this,function(){var d=I;this.active&&(R=Math.max(0,R-(Date.now()-v)),d=mxUtils.bind(this,function(m){this.spin(J,S,N,R);if(null!=m)try{m(),E=mxUtils.bind(this,function(){this.spin(J,S,N,R);try{m()}catch(r){null!=N&&N(r)}})}catch(r){null!=N&&N(r)}}));this.stop();return d});T=!0}return T};var U=q.stop;q.stop=function(){U.call(this);-this.active&&(this.active=!1,null!=y&&(window.clearTimeout(y),y=null),null!=q.status&&null!=q.status.parentNode&&q.status.parentNode.removeChild(q.status),q.status=null)};q.pause=function(){return I};return q};EditorUi.prototype.isCompatibleString=function(c){try{if(c=mxUtils.trim(c),"<"==c.charAt(0)){var f=mxUtils.parseXml(c),k=this.editor.extractGraphModel(f.documentElement,!0);return null!=k&&0==k.getElementsByTagName("parsererror").length}}catch(n){}return!1};EditorUi.isVisioFilename=function(c){return/(\.v(dx|sdx?))($|\?)/i.test(c)||+color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),t=this.timeout,u=q.spin,B=null,E=null,I=mxUtils.bind(this,function(K){null!=K&&K()}),C=this;q.spin=function(K,S,M,R){R=null!=R?R:t;var T=!1;if(!this.active){var v=Date.now();null!=M&&(B=window.setTimeout(function(){q.stop();B=null;M({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:E})},R));n&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/+2-2);K==document.body&&"1"==urlParams.embedInline&&(K=C.diagramContainer,c=K.scrollLeft+K.clientWidth/2,f=K.scrollTop+K.clientHeight/2);u.call(this,K);"1"==urlParams.embedInline&&null!=q.el&&(q.el.style.marginTop=K.scrollTop+"px",q.el.style.marginLeft=K.scrollLeft+"px");this.active=!0;null!=S&&(T=document.createElement("div"),T.className="geSpinnerStatus",T.setAttribute("title",S),K==document.body?(T.style.left=Math.max(0,c)+"px",T.style.top=Math.max(0,f+66)+"px"):(T.style.left="50%",T.style.top=+"50%",T.style.marginTop="70px"),"..."!=S.substring(S.length-3,S.length)&&"!"!=S.charAt(S.length-1)&&(S+="..."),T.innerText=S,K.appendChild(T),q.status=T);this.pause=mxUtils.bind(this,function(){var d=I;this.active&&(R=Math.max(0,R-(Date.now()-v)),d=mxUtils.bind(this,function(m){this.spin(K,S,M,R);if(null!=m)try{m(),E=mxUtils.bind(this,function(){this.spin(K,S,M,R);try{m()}catch(r){null!=M&&M(r)}})}catch(r){null!=M&&M(r)}}));this.stop();return d});T=!0}return T};var U=q.stop;q.stop=function(){U.call(this);+this.active&&(this.active=!1,null!=B&&(window.clearTimeout(B),B=null),null!=q.status&&null!=q.status.parentNode&&q.status.parentNode.removeChild(q.status),q.status=null)};q.pause=function(){return I};return q};EditorUi.prototype.isCompatibleString=function(c){try{if(c=mxUtils.trim(c),"<"==c.charAt(0)){var f=mxUtils.parseXml(c),k=this.editor.extractGraphModel(f.documentElement,!0);return null!=k&&0==k.getElementsByTagName("parsererror").length}}catch(n){}return!1};EditorUi.isVisioFilename=function(c){return/(\.v(dx|sdx?))($|\?)/i.test(c)||/(\.vs(x|sx?))($|\?)/i.test(c)};EditorUi.prototype.isVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&4==c.charCodeAt(3)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&6==c.charCodeAt(3))};EditorUi.prototype.isRemoteVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||60==c.charCodeAt(0)&&63==c.charCodeAt(1)&&120==c.charCodeAt(2)&&109==c.charCodeAt(3)&&108==c.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=function(c){var f=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var k=f.getFunction,n=this.editor.graph,q=this;f.getFunction=function(t){if(n.isSelectionEmpty()&&null!=q.pages&&0<q.pages.length){var u=q.getSelectedPageIndex();if(mxEvent.isShiftDown(t)){if(37==t.keyCode)return function(){0<u&&q.movePage(u,u-1)};if(38==t.keyCode)return function(){0<u&&q.movePage(u,0)};if(39==t.keyCode)return function(){u<q.pages.length-1&&q.movePage(u,u+1)};if(40==t.keyCode)return function(){u<q.pages.length-1&&q.movePage(u,q.pages.length-1)}}else if(mxEvent.isControlDown(t)||mxClient.IS_MAC&&mxEvent.isMetaDown(t)){if(37==t.keyCode)return function(){0<@@ -13735,285 +13739,285 @@ u&&q.selectNextPage(!1)};if(38==t.keyCode)return function(){0<u&&q.selectPage(q.EditorUi.prototype.extractGraphModelFromHtml=function(c){var f=l.apply(this,arguments);if(null==f)try{var k=c.indexOf("<mxfile ");if(0<=k){var n=c.lastIndexOf("</mxfile>");n>k&&(f=c.substring(k,n+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var q=mxUtils.parseXml(c),t=this.editor.extractGraphModel(q.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);f=null!=t?mxUtils.getXml(t):""}}catch(u){}return f};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var f=c.indexOf('<meta charset="utf-8">');0<=f&&(c=c.slice(0,f)+'<meta charset="utf-8"/>'+c.slice(f+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.repairFileData=function(c){c=mxUtils.trim(c||"");if(0==c.length)return null;var f=c.replace(/<\/([A-Za-z_][\w.\-]*)(\s*)(?=<)/g,"</$1>$2"),k=f.lastIndexOf(">");f.lastIndexOf("<")>k&&(f=mxUtils.trim(f.substring(0,k+1)));if("</mxfile>"!=f.substring(f.length-9)){k=[];for(var n=/<(\/?)([A-Za-z_][\w.\-]*)[^>]*?(\/?)>/g,q;null!=(q=n.exec(f));)"/"==q[1]?0<k.length&&k[k.length-1]==q[2]&&k.pop():"/"!=q[3]&&k.push(q[2]);for(n=k.length-1;0<=n;n--)f+="</"+k[n]+">"}return f!=c?f:null};EditorUi.prototype.isFileDataLoadable=function(c){try{c=this.validateFileData(c);var f=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;if(null==f||null!=Editor.extractParserError(f))return!1;var k=this.editor.extractGraphModel(f,!0);return null!=(null!=k?k:f)}catch(n){return!1}};EditorUi.prototype.getRecoveryData=function(c,f,-k,n){var q=null;try{var t=this.repairFileData(f);null!=t&&t!=f&&this.isFileDataLoadable(t)&&(q={type:"repair",label:mxResources.get("openRepairedCopy"),description:mxResources.get("recoveryRepairedDesc"),data:t,lossy:!0})}catch(y){}var u=mxUtils.bind(this,function(y){var E=[];null!=y&&null!=y.data&&E.push(y);null!=q&&E.push(q);n(E)});null!=c&&"function"===typeof c.getRecoveryVersion?c.getRecoveryVersion(mxUtils.bind(this,function(y){u(y)}),mxUtils.bind(this,function(){u(null)})):u(null)};EditorUi.prototype.openRecoveredCopy=+k,n){var q=null;try{var t=this.repairFileData(f);null!=t&&t!=f&&this.isFileDataLoadable(t)&&(q={type:"repair",label:mxResources.get("openRepairedCopy"),description:mxResources.get("recoveryRepairedDesc"),data:t,lossy:!0})}catch(B){}var u=mxUtils.bind(this,function(B){var E=[];null!=B&&null!=B.data&&E.push(B);null!=q&&E.push(q);n(E)});null!=c&&"function"===typeof c.getRecoveryVersion?c.getRecoveryVersion(mxUtils.bind(this,function(B){u(B)}),mxUtils.bind(this,function(){u(null)})):u(null)};EditorUi.prototype.openRecoveredCopy=function(c,f){c=new LocalFile(this,c.data,mxResources.get("copyOf",[f||this.defaultFilename]),!0);this.fileLoaded(c)&&c.fileChanged()};EditorUi.prototype.showRecoveryDialog=function(c,f){c=new RecoveryDialog(this,c,mxUtils.bind(this,function(k){this.hideDialog();this.openRecoveredCopy(k,f)}),mxUtils.bind(this,function(){this.hideDialog()}));this.showDialog(c.container,380,null,!0,!0)};EditorUi.prototype.formatRecoveryDate=function(c){c=new Date(c);return!isNaN(c.getTime())&&0<=c.getTime()?c.toLocaleString():null};EditorUi.prototype.replaceFileData=function(c,f){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",f);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var k=null!=c?this.editor.extractGraphModel(c,!0):null;null!=k&&(c=k);if(null!=c){k=this.editor.graph;k.model.beginUpdate();try{var n=null!=this.pages?this.pages.slice():null,q=c.getElementsByTagName("diagram");if(1<q.length||1==q.length&&q[0].hasAttribute("name")){this.fileNode=c;k.defaultExportLinkTarget=c.getAttribute("linkTarget");this.pages=null!=this.pages?this.pages:[];for(var t=q.length-1;0<=t;t--){var u=this.updatePageRoot(new DiagramPage(q[t]));null==u.getName()&&u.setName(mxResources.get("pageWithNumber",[t+1]));k.model.execute(new ChangePage(this,u,0==t?u:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),k.model.execute(new ChangePage(this,-this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=n)for(t=0;t<n.length;t++)k.model.execute(new ChangePage(this,n[t],null));var y=this.getCurrentFile();null!=y&&y.fileReplaced(f)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,f,k,n,q,t,u,y,E,I,C,U,J){f=null!=f?f:this.editor.graph;q=null!=q?q:!1;E=-null!=E?E:!0;I=null!=I?I:this.defaultCompact;C=null!=C?C:!Editor.defaultCompressed;var S=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var N="_blank";else S=N=n;if(null==c)return"";var R=c;if("mxfile"!=R.nodeName.toLowerCase()){if(C){var T=c.ownerDocument.createElement("diagram");T.setAttribute("name",mxResources.get("pageWithNumber",[1]));T.setAttribute("id",Editor.guid());T.appendChild(c)}else{T=Graph.zapGremlins(mxUtils.getXml(c));R=Graph.compress(T);if(Graph.decompress(R)!=+this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=n)for(t=0;t<n.length;t++)k.model.execute(new ChangePage(this,n[t],null));var B=this.getCurrentFile();null!=B&&B.fileReplaced(f)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,f,k,n,q,t,u,B,E,I,C,U,K){f=null!=f?f:this.editor.graph;q=null!=q?q:!1;E=+null!=E?E:!0;I=null!=I?I:this.defaultCompact;C=null!=C?C:!Editor.defaultCompressed;var S=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var M="_blank";else S=M=n;if(null==c)return"";var R=c;if("mxfile"!=R.nodeName.toLowerCase()){if(C){var T=c.ownerDocument.createElement("diagram");T.setAttribute("name",mxResources.get("pageWithNumber",[1]));T.setAttribute("id",Editor.guid());T.appendChild(c)}else{T=Graph.zapGremlins(mxUtils.getXml(c));R=Graph.compress(T);if(Graph.decompress(R)!=T)return T;T=c.ownerDocument.createElement("diagram");T.setAttribute("name",mxResources.get("pageWithNumber",[1]));T.setAttribute("id",Editor.guid());mxUtils.setTextContent(T,R)}R=c.ownerDocument.createElement("mxfile");R.appendChild(T)}I?(R=R.cloneNode(!0),R.removeAttribute("modified"),R.removeAttribute("host"),R.removeAttribute("agent"),R.removeAttribute("etag"),R.removeAttribute("userAgent"),R.removeAttribute("version"),R.removeAttribute("editor"),R.removeAttribute("type")):(R.removeAttribute("userAgent"),-R.removeAttribute("modified"),R.removeAttribute("version"),R.removeAttribute("editor"),R.removeAttribute("pages"),R.removeAttribute("type"),R.removeAttribute("etag"),mxClient.IS_CHROMEAPP?R.setAttribute("host","Chrome"):EditorUi.isElectronApp?R.setAttribute("host","Electron"):R.setAttribute("host",window.location.hostname),1<R.getElementsByTagName("diagram").length&&null!=this.pages&&R.setAttribute("pages",this.pages.length));null!=U&&(R=R.cloneNode(!0),R.setAttribute("scale",U));null!=J&&(R=R.cloneNode(!0),-R.setAttribute("border",J));c=C?mxUtils.getPrettyXml(R):mxUtils.getXml(R);if(!t&&!q&&(u||null!=k&&/(\.html)$/i.test(k.getTitle())))c=this.getHtml2(mxUtils.getXml(R),f,null!=k?k.getTitle():null,N,S);else if(t||!q&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(n=null),k=this.getSvgFileProperties(R),c=this.getEmbeddedSvg(c,f,n,null,y,E,S,null,null,k.scale,k.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,-f,k,n){c=null!=c?c:!0;f=null!=f?f:!1;k=null!=k?k:!Editor.defaultCompressed;var q=this.editor.getGraphXml(c,n);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(E){var I=E.getElementsByTagName("mxGraphModel"),C=0<I.length?I[0]:null;I=E;null==C&&k?(C=mxUtils.getNodeValue(E),0<C.length&&(C=Graph.decompress(C),null!=C&&0<C.length&&(I=E.cloneNode(!1),I.appendChild(mxUtils.parseXml(C).documentElement)))):null==C||k?I=E.cloneNode(!0):(I=E.cloneNode(!1),mxUtils.setTextContent(I,Graph.compressNode(C)));-q.appendChild(I)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(q),q=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var t=this.pages[f],u=t.node;if(t!=this.currentPage)if(t.needsUpdate){var y=new mxCodec(mxUtils.createXmlDocument());y=y.encode(new mxGraphModel(t.root));this.editor.graph.saveViewState(t.viewState,y,null,n);EditorUi.removeChildNodes(u);u.appendChild(y);delete t.needsUpdate}else n&&(this.updatePageRoot(t),-null!=t.viewState.backgroundImage&&null!=t.viewState.backgroundImage.originalSrc&&(y=new mxCodec(mxUtils.createXmlDocument()),y=y.encode(new mxGraphModel(t.root)),this.editor.graph.saveViewState(t.viewState,y,null,n,t),u=u.cloneNode(!1),u.appendChild(y)));c(u)}return q};EditorUi.prototype.anonymizeString=function(c,f){for(var k=[],n=0;n<c.length;n++){var q=c.charAt(n);0<=EditorUi.ignoredAnonymizedChars.indexOf(q)?k.push(q):isNaN(parseInt(q))?q.toLowerCase()!=q?k.push(String.fromCharCode(65+Math.round(25*-Math.random()))):q.toUpperCase()!=q?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(q)?k.push(" "):k.push("?"):k.push(f?"0":Math.round(9*Math.random()))}return k.join("")};EditorUi.prototype.anonymizeXml=function(c){function f(u,y,E){if(u.hasAttribute(y)){var I=u.getAttribute(y);null!=I&&0<I.length&&(E&&0<=I.indexOf("<")?(t.innerHTML=Graph.sanitizeHtml(I),k(t),I=t.innerHTML):I=q.anonymizeString(I),u.setAttribute(y,I))}}function k(u){null!=u.nodeValue&&(u.nodeValue=q.anonymizeString(u.nodeValue));-if(u.nodeType==mxConstants.NODETYPE_ELEMENT)for(u=u.firstChild;null!=u;)k(u),u=u.nextSibling}function n(u){if(u.nodeType==mxConstants.NODETYPE_ELEMENT){if("mxCell"==u.nodeName)f(u,"value",!0);else if("object"==u.nodeName||"UserObject"==u.nodeName)for(var y=0;y<u.attributes.length;y++){var E=u.attributes[y];"id"!=E.name&&"style"!=E.name&&"placeholders"!=E.name&&"vertex"!=E.name&&"edge"!=E.name&&"parent"!=E.name&&"connectable"!=E.name&&"visible"!=E.name&&"collapsed"!=E.name&&"source"!=E.name&&"target"!=+R.removeAttribute("modified"),R.removeAttribute("version"),R.removeAttribute("editor"),R.removeAttribute("pages"),R.removeAttribute("type"),R.removeAttribute("etag"),mxClient.IS_CHROMEAPP?R.setAttribute("host","Chrome"):EditorUi.isElectronApp?R.setAttribute("host","Electron"):R.setAttribute("host",window.location.hostname),1<R.getElementsByTagName("diagram").length&&null!=this.pages&&R.setAttribute("pages",this.pages.length));null!=U&&(R=R.cloneNode(!0),R.setAttribute("scale",U));null!=K&&(R=R.cloneNode(!0),+R.setAttribute("border",K));c=C?mxUtils.getPrettyXml(R):mxUtils.getXml(R);if(!t&&!q&&(u||null!=k&&/(\.html)$/i.test(k.getTitle())))c=this.getHtml2(mxUtils.getXml(R),f,null!=k?k.getTitle():null,M,S);else if(t||!q&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(n=null),k=this.getSvgFileProperties(R),c=this.getEmbeddedSvg(c,f,n,null,B,E,S,null,null,k.scale,k.border,null,Editor.svgFileTheme,null,k.embedFonts);return c};EditorUi.prototype.getXmlFileData=+function(c,f,k,n){c=null!=c?c:!0;f=null!=f?f:!1;k=null!=k?k:!Editor.defaultCompressed;var q=this.editor.getGraphXml(c,n);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(E){var I=E.getElementsByTagName("mxGraphModel"),C=0<I.length?I[0]:null;I=E;null==C&&k?(C=mxUtils.getNodeValue(E),0<C.length&&(C=Graph.decompress(C),null!=C&&0<C.length&&(I=E.cloneNode(!1),I.appendChild(mxUtils.parseXml(C).documentElement)))):null==C||k?I=E.cloneNode(!0):(I=E.cloneNode(!1),mxUtils.setTextContent(I,Graph.compressNode(C)));+q.appendChild(I)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(q),q=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var t=this.pages[f],u=t.node;if(t!=this.currentPage)if(t.needsUpdate){var B=new mxCodec(mxUtils.createXmlDocument());B=B.encode(new mxGraphModel(t.root));this.editor.graph.saveViewState(t.viewState,B,null,n);EditorUi.removeChildNodes(u);u.appendChild(B);delete t.needsUpdate}else n&&(this.updatePageRoot(t),+null!=t.viewState.backgroundImage&&null!=t.viewState.backgroundImage.originalSrc&&(B=new mxCodec(mxUtils.createXmlDocument()),B=B.encode(new mxGraphModel(t.root)),this.editor.graph.saveViewState(t.viewState,B,null,n,t),u=u.cloneNode(!1),u.appendChild(B)));c(u)}return q};EditorUi.prototype.anonymizeString=function(c,f){for(var k=[],n=0;n<c.length;n++){var q=c.charAt(n);0<=EditorUi.ignoredAnonymizedChars.indexOf(q)?k.push(q):isNaN(parseInt(q))?q.toLowerCase()!=q?k.push(String.fromCharCode(65+Math.round(25*+Math.random()))):q.toUpperCase()!=q?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(q)?k.push(" "):k.push("?"):k.push(f?"0":Math.round(9*Math.random()))}return k.join("")};EditorUi.prototype.anonymizeXml=function(c){function f(u,B,E){if(u.hasAttribute(B)){var I=u.getAttribute(B);null!=I&&0<I.length&&(E&&0<=I.indexOf("<")?(t.innerHTML=Graph.sanitizeHtml(I),k(t),I=t.innerHTML):I=q.anonymizeString(I),u.setAttribute(B,I))}}function k(u){null!=u.nodeValue&&(u.nodeValue=q.anonymizeString(u.nodeValue));+if(u.nodeType==mxConstants.NODETYPE_ELEMENT)for(u=u.firstChild;null!=u;)k(u),u=u.nextSibling}function n(u){if(u.nodeType==mxConstants.NODETYPE_ELEMENT){if("mxCell"==u.nodeName)f(u,"value",!0);else if("object"==u.nodeName||"UserObject"==u.nodeName)for(var B=0;B<u.attributes.length;B++){var E=u.attributes[B];"id"!=E.name&&"style"!=E.name&&"placeholders"!=E.name&&"vertex"!=E.name&&"edge"!=E.name&&"parent"!=E.name&&"connectable"!=E.name&&"visible"!=E.name&&"collapsed"!=E.name&&"source"!=E.name&&"target"!=E.name&&(E.value=q.anonymizeString(E.value))}else"diagram"==u.nodeName&&f(u,"name",!1);for(u=u.firstChild;null!=u;)n(u),u=u.nextSibling}}var q=this,t=document.createElement("div");c=mxUtils.parseXml(c);n(c.documentElement);return mxUtils.getPrettyXml(c.documentElement)};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var f=0;f<c[EditorUi.DIFF_INSERT].length;f++)try{var k=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][f].data).documentElement.cloneNode(!1);-null!=k.getAttribute("name")&&k.setAttribute("name",this.anonymizeString(k.getAttribute("name")));c[EditorUi.DIFF_INSERT][f].data=mxUtils.getXml(k)}catch(t){c[EditorUi.DIFF_INSERT][f].data=t.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var n in c[EditorUi.DIFF_UPDATE]){var q=c[EditorUi.DIFF_UPDATE][n];null!=q.name&&(q.name=this.anonymizeString(q.name));null!=q.cells&&(f=mxUtils.bind(this,function(t){var u=q.cells[t];if(null!=u){for(var y in u)null!=u[y].value&&(u[y].value="["+u[y].value.length+"]"),-null!=u[y].xmlValue&&(u[y].xmlValue="["+u[y].xmlValue.length+"]"),null!=u[y].style&&(u[y].style="["+u[y].style.length+"]"),mxUtils.isEmptyObject(u[y])&&delete u[y];mxUtils.isEmptyObject(u)&&delete q.cells[t]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(q.cells)&&delete q.cells);mxUtils.isEmptyObject(q)&&delete c[EditorUi.DIFF_UPDATE][n]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,+null!=k.getAttribute("name")&&k.setAttribute("name",this.anonymizeString(k.getAttribute("name")));c[EditorUi.DIFF_INSERT][f].data=mxUtils.getXml(k)}catch(t){c[EditorUi.DIFF_INSERT][f].data=t.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var n in c[EditorUi.DIFF_UPDATE]){var q=c[EditorUi.DIFF_UPDATE][n];null!=q.name&&(q.name=this.anonymizeString(q.name));null!=q.cells&&(f=mxUtils.bind(this,function(t){var u=q.cells[t];if(null!=u){for(var B in u)null!=u[B].value&&(u[B].value="["+u[B].value.length+"]"),+null!=u[B].xmlValue&&(u[B].xmlValue="["+u[B].xmlValue.length+"]"),null!=u[B].style&&(u[B].style="["+u[B].style.length+"]"),mxUtils.isEmptyObject(u[B])&&delete u[B];mxUtils.isEmptyObject(u)&&delete q.cells[t]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(q.cells)&&delete q.cells);mxUtils.isEmptyObject(q)&&delete c[EditorUi.DIFF_UPDATE][n]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,f){if(null!=c.attributes)for(var k=0;k<c.attributes.length;k++)"as"!=c.attributes[k].name&&c.setAttribute(c.attributes[k].name,this.anonymizeString(c.attributes[k].value,f));if(null!=c.childNodes)for(k=0;k<c.childNodes.length;k++)this.anonymizeAttributes(c.childNodes[k],f)};EditorUi.prototype.anonymizeNode=function(c,f){f=c.getElementsByTagName("mxCell");for(var k=0;k<f.length;k++)null!=f[k].getAttribute("value")&&f[k].setAttribute("value","["+f[k].getAttribute("value").length+"]"),null!=f[k].getAttribute("xmlValue")&&f[k].setAttribute("xmlValue","["+f[k].getAttribute("xmlValue").length+"]"),null!=f[k].getAttribute("style")&&f[k].setAttribute("style","["+f[k].getAttribute("style").length+"]"),null!=f[k].parentNode&&"root"!=f[k].parentNode.nodeName&&null!=f[k].parentNode.parentNode&&(f[k].setAttribute("id",f[k].parentNode.getAttribute("id")),f[k].parentNode.parentNode.replaceChild(f[k],f[k].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var f=this.getCurrentFile();null!=f&&(f.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&f.invalidChecksum?f.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(f.clearAutosave(),this.clearStatus(),c?f.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){this.spinner.stop();f.handleFileError(k,!0)})):f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,-function(k){f.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(c,f,k,n,q,t,u,y,E,I,C,U,J){q=null!=q?q:!0;t=null!=t?t:!1;I=null!=I?I:!Editor.defaultCompressed;var S=this.editor.graph;if((f||!c&&null!=E&&/(\.svg)$/i.test(E.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var N=S.getGlobalVariable;S=this.createTemporaryGraph(S.getStylesheet());S.setBackgroundImage=this.editor.graph.setBackgroundImage;S.background=this.editor.graph.background;var R=null!=this.pages?-this.pages[0]:null;null==R||this.currentPage==R?S.setBackgroundImage(this.editor.graph.backgroundImage):null!=R.viewState&&null!=R.viewState&&S.setBackgroundImage(R.viewState.backgroundImage);S.getGlobalVariable=function(T){return"page"==T&&null!=R?R.getName():"pagenumber"==T?1:N.apply(this,arguments)};document.body.appendChild(S.container);null!=R&&S.model.setRoot(R.root)}u=null!=u?u:this.getXmlFileData(q,t,I,C);E=null!=E?E:this.getCurrentFile();c=this.createFileData(u,S,E,window.location.href,c,-f,k,n,q,y,I,U,J);S!=this.editor.graph&&S.container.parentNode.removeChild(S.container);return c};EditorUi.prototype.getHtml=function(c,f,k,n,q,t){t=null!=t?t:!0;var u=null,y=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){u=t?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var E=f.view.scale;t=Math.floor(u.x/E-f.view.translate.x);E=Math.floor(u.y/E-f.view.translate.y);u=f.background;null==q&&(f=this.getBasenames().join(";"),0<f.length&&(y=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",+function(k){f.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(c,f,k,n,q,t,u,B,E,I,C,U,K){q=null!=q?q:!0;t=null!=t?t:!1;I=null!=I?I:!Editor.defaultCompressed;var S=this.editor.graph;if((f||!c&&null!=E&&/(\.svg)$/i.test(E.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var M=S.getGlobalVariable;S=this.createTemporaryGraph(S.getStylesheet());S.setBackgroundImage=this.editor.graph.setBackgroundImage;S.background=this.editor.graph.background;var R=null!=this.pages?+this.pages[0]:null;null==R||this.currentPage==R?S.setBackgroundImage(this.editor.graph.backgroundImage):null!=R.viewState&&null!=R.viewState&&S.setBackgroundImage(R.viewState.backgroundImage);S.getGlobalVariable=function(T){return"page"==T&&null!=R?R.getName():"pagenumber"==T?1:M.apply(this,arguments)};document.body.appendChild(S.container);null!=R&&S.model.setRoot(R.root)}u=null!=u?u:this.getXmlFileData(q,t,I,C);E=null!=E?E:this.getCurrentFile();c=this.createFileData(u,S,E,window.location.href,c,+f,k,n,q,B,I,U,K);S!=this.editor.graph&&S.container.parentNode.removeChild(S.container);return c};EditorUi.prototype.getHtml=function(c,f,k,n,q,t){t=null!=t?t:!0;var u=null,B=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){u=t?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var E=f.view.scale;t=Math.floor(u.x/E-f.view.translate.x);E=Math.floor(u.y/E-f.view.translate.y);u=f.background;null==q&&(f=this.getBasenames().join(";"),0<f.length&&(B=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",t);c.setAttribute("y0",E)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=n&&c.setAttribute("edit",n));null!=q&&(q=q.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";n=Graph.compress(c);Graph.decompress(n)!=c&&(n=encodeURIComponent(c));return(null==q?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=q?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==q?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=q?'<meta http-equiv="refresh" content="0;URL=\''+q+"'\"/>\n":"")+"</head>\n<body"+(null==q&&null!=u&&u!=mxConstants.NONE?' style="background-color:'+u+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+n+"</div>\n</div>\n"+-(null==q?'<script type="text/javascript" src="'+y+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+q+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,f,k,n,q){f=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=q&&(q=q.replace(/&/g,"&"));c={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,+(null==q?'<script type="text/javascript" src="'+B+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+q+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,f,k,n,q){f=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=q&&(q=q.replace(/&/g,"&"));c={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(c),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==q?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=q?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==q?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=q?'<meta http-equiv="refresh" content="0;URL=\''+q+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>\n'+(null==q?'<script type="text/javascript" src="'+f+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+q+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.updateFileVars=function(){var c=null!=this.fileNode?this.fileNode.getAttribute("vars"):null;if(c!==this.fileVarsStr&&(this.fileVarsStr=c,this.fileVars=null,null!=c&&0<c.length))try{this.fileVars=JSON.parse(c)}catch(f){}};EditorUi.prototype.setFileData=function(c,f){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;f=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var k=Editor.extractParserError(f,mxResources.get("invalidOrMissingFile"));if(k)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[c],"node",[f],"cause",[k]),Error(mxResources.get("notADiagramFile")+" ("+k+")");c=null!=f?this.editor.extractGraphModel(f,!0):null;null!=c&&(f=c);if(null!=f&&"mxfile"==f.nodeName&&(c=f.getElementsByTagName("diagram"),k={},0<c.length)){var n=this.getHashObject(),q=null;this.fileNode=f;this.editor.graph.defaultExportLinkTarget=f.getAttribute("linkTarget");this.pages=[];for(var t=0;t<c.length;t++){null==c[t].getAttribute("id")&&c[t].setAttribute("id",t);f=new DiagramPage(c[t]);null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[t+1]));this.pages.push(f);if(null==n.pageId&&null!=urlParams["page-id"]&&f.getId()==urlParams["page-id"]||null!=n.pageId&&f.getId()==n.pageId)q=f;if(null==k[f.getId()])k[f.getId()]=f;else throw Error(f.getId()+": Duplicate page ID");}this.currentPage=null!=q?q:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];f=this.currentPage.node}null==this.fileNode&&null!=f&&(this.fileNode=f.ownerDocument.createElement("mxfile"),this.currentPage=-new DiagramPage(f.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(f);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var u=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(t=0;t<u.length;t++)f[u[t]]=!0;var y=this.editor.graph.getModel(),E=y.getChildren(y.root);-for(t=0;t<E.length;t++){var I=E[t];y.setVisible(I,f[I.id]||!1)}}catch(C){}};EditorUi.prototype.fileStats=function(c,f){try{if(null!=c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var k=f.getElementsByTagName("diagram");f={};f.modified=c.getLastModifiedDate();f.fileMode=c.getMode();f.fileSize=c.getSize();f.fileHash=c.getHash();f.pages=k.length;f.redundantStencils=0;f.redundantImages=0;f.redundantSize=0;f.stencils=0;f.images=0;for(var n=f.cells=0;n<k.length;n++){var q=k[n].getElementsByTagName("mxCell");-f.cells+=q.length;for(var t={},u=0;u<q.length;u++){var y=q[u].getAttribute("style");if(null!=y)for(var E=y.split(";"),I=0;I<E.length;I++){var C=E[I];if(C.startsWith("image=data:")||C.startsWith("shape=stencil("))null==t[C]?t[C]=1:t[C]++}}for(var U in t){var J=t[U];U.startsWith("shape=stencil(")?f.stencils+=J:f.images+=J;1<J&&(f.redundantSize+=U.length*(J-1),U.startsWith("shape=stencil(")?f.redundantStencils+=J-1:f.redundantImages+=J-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()+"-FILE-STATS-"++new DiagramPage(f.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(f);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var u=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(t=0;t<u.length;t++)f[u[t]]=!0;var B=this.editor.graph.getModel(),E=B.getChildren(B.root);+for(t=0;t<E.length;t++){var I=E[t];B.setVisible(I,f[I.id]||!1)}}catch(C){}};EditorUi.prototype.fileStats=function(c,f){try{if(null!=c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var k=f.getElementsByTagName("diagram");f={};f.modified=c.getLastModifiedDate();f.fileMode=c.getMode();f.fileSize=c.getSize();f.fileHash=c.getHash();f.pages=k.length;f.redundantStencils=0;f.redundantImages=0;f.redundantSize=0;f.stencils=0;f.images=0;for(var n=f.cells=0;n<k.length;n++){var q=k[n].getElementsByTagName("mxCell");+f.cells+=q.length;for(var t={},u=0;u<q.length;u++){var B=q[u].getAttribute("style");if(null!=B)for(var E=B.split(";"),I=0;I<E.length;I++){var C=E[I];if(C.startsWith("image=data:")||C.startsWith("shape=stencil("))null==t[C]?t[C]=1:t[C]++}}for(var U in t){var K=t[U];U.startsWith("shape=stencil(")?f.stencils+=K:f.images+=K;1<K&&(f.redundantSize+=U.length*(K-1),U.startsWith("shape=stencil(")?f.redundantStencils+=K-1:f.redundantImages+=K-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()+"-FILE-STATS-"+c.getHash(),action:"size_"+c.getSize(),label:JSON.stringify(f)})}}catch(S){}};EditorUi.prototype.getBaseFilename=function(c){var f=this.getCurrentFile();f=null!=f&&null!=f.getTitle()?f.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(f)||/(\.html)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.png)$/i.test(f))f=f.substring(0,f.lastIndexOf("."));/(\.drawio)$/i.test(f)&&(f=f.substring(0,f.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&-0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,k,n,q,t,u,y,E,I,C,U,J,S,N,R,T){try{n=null!=n?n:this.editor.graph.isSelectionEmpty();var v=this.getBaseFilename(!q),d=v+("xml"==c||"pdf"==c&&C?".drawio":"")+"."+c;if("xml"==c){var m=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,n,q,null,null,null,f);this.saveData(d,c,m,"text/xml")}else if("html"==c)m=this.getHtml2(this.getFileData(!0),this.editor.graph,v),-this.saveData(d,c,m,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?d=v+".png":"jpeg"==c&&(d=v+".jpg"),"1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){var r=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(d,c,n,"1",u,q,y,E,I,C,U,void 0,void 0,!t,J,S,N,R,T).send(mxUtils.bind(this,function(P){this.spinner.stop();+0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,k,n,q,t,u,B,E,I,C,U,K,S,M,R,T){try{n=null!=n?n:this.editor.graph.isSelectionEmpty();var v=this.getBaseFilename(!q),d=v+("xml"==c||"pdf"==c&&C?".drawio":"")+"."+c;if("xml"==c){var m=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,n,q,null,null,null,f);this.saveData(d,c,m,"text/xml")}else if("html"==c)m=this.getHtml2(this.getFileData(!0),this.editor.graph,v),+this.saveData(d,c,m,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?d=v+".png":"jpeg"==c&&(d=v+".jpg"),"1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){var r=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(d,c,n,"1",u,q,B,E,I,C,U,void 0,void 0,!t,K,S,M,R,T).send(mxUtils.bind(this,function(P){this.spinner.stop();if(200<=P.getStatus()&&299>=P.getStatus()){var V=this.createLoadMessage("export");V.format=c;V.filename=d;V.data="data:application/pdf;base64,"+P.getText();V.xml=this.getFileData(!0);r.postMessage(JSON.stringify(V),"*")}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(){this.spinner.stop();this.handleError({message:mxResources.get("errorSavingFile")})}))}else this.saveRequest(d,c,mxUtils.bind(this,function(P,V){try{return this.createDownloadRequest(P,-c,n,V,u,q,y,E,I,C,U,void 0,void 0,!t,J,S,N,R,T)}catch(Y){this.handleError(Y)}}));else{var A=null,D=mxUtils.bind(this,function(P){P.length<=MAX_REQUEST_SIZE?this.saveData(d,"svg",P,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(A)}))});if("svg"==c){var G=this.editor.graph.background;if(u||G==mxConstants.NONE)G=null;var O=this.editor.graph.getSvg(G,null,null,null,null,n);k&&this.editor.graph.addSvgShadow(O);-this.editor.convertImages(O,mxUtils.bind(this,mxUtils.bind(this,function(P){this.spinner.stop();D(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(P))})))}else d=v+".svg",A=this.getFileData(!1,!0,null,mxUtils.bind(this,function(P){this.spinner.stop();D(P)}),n)}}catch(P){this.handleError(P)}};EditorUi.prototype.createDownloadRequest=function(c,f,k,n,q,t,u,y,E,I,C,U,J,S,N,R,T,v,d){c=this.downloadRequestBuilder(c,f,k,n,q,t,u,y,E,I,C,U,J,S,N,R,T,v,d);f="";for(var m in c)k=c[m],null!=k&&-(f+=m+"="+encodeURIComponent(k)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,k,n,q,t,u,y,E,I,C,U,J,S,N,R,T,v,d){var m=this.editor.graph,r=m.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==t?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var A=null,D=null,G=null;if(!EditorUi.isElectronApp&&(r.width*r.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};I=I?"1":"0";"pdf"==f&&-(null!=C?(A=C.from,D=C.to):0==t&&(G="1"));"xmlpng"==f&&(I="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(t=0;t<this.pages.length;t++)if(this.pages[t]==this.currentPage){A=t;break}t=m.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!q?q||null!=t&&t!=mxConstants.NONE||(t="#ffffff"):t=mxConstants.NONE;q={globalVars:m.getExportVariables()};null!=C&&null!=C.from&&(q.globalVars.pagenumber=C.from+1);E&&(q.grid={size:m.gridSize,steps:m.view.gridSteps,color:Editor.isDarkMode()&&-"pdf"==f?mxGraphView.prototype.defaultGridColor:m.view.gridColor});Graph.translateDiagram&&(q.diagramLanguage=Graph.diagramLanguage);E=this.getHiddenTagsMap();null!=E&&(q.hiddenTags=E);return{format:f,from:A,to:D,allPages:G,bg:null!=t?t:mxConstants.NONE,base64:n,embedXml:I,xml:k,filename:null!=c?c:"",extras:JSON.stringify(q),scale:u,border:y,pageMargin:N,w:U&&isFinite(U)?U:null,h:J&&isFinite(J)?J:null,crop:null!=S&&S?"1":"0",fit:null!=R&&R?"1":"0",shadows:null!=d&&d?"1":"0",sheetsAcross:T,sheetsDown:v}};+c,n,V,u,q,B,E,I,C,U,void 0,void 0,!t,K,S,M,R,T)}catch(X){this.handleError(X)}}));else{var z=null,D=mxUtils.bind(this,function(P){P.length<=MAX_REQUEST_SIZE?this.saveData(d,"svg",P,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(z)}))});if("svg"==c){var F=this.editor.graph.background;if(u||F==mxConstants.NONE)F=null;var N=this.editor.graph.getSvg(F,null,null,null,null,n);k&&this.editor.graph.addSvgShadow(N);+this.editor.convertImages(N,mxUtils.bind(this,mxUtils.bind(this,function(P){this.spinner.stop();D(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(P))})))}else d=v+".svg",z=this.getFileData(!1,!0,null,mxUtils.bind(this,function(P){this.spinner.stop();D(P)}),n)}}catch(P){this.handleError(P)}};EditorUi.prototype.createDownloadRequest=function(c,f,k,n,q,t,u,B,E,I,C,U,K,S,M,R,T,v,d){c=this.downloadRequestBuilder(c,f,k,n,q,t,u,B,E,I,C,U,K,S,M,R,T,v,d);f="";for(var m in c)k=c[m],null!=k&&+(f+=m+"="+encodeURIComponent(k)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,k,n,q,t,u,B,E,I,C,U,K,S,M,R,T,v,d){var m=this.editor.graph,r=m.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==t?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var z=null,D=null,F=null;if(!EditorUi.isElectronApp&&(r.width*r.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};I=I?"1":"0";"pdf"==f&&+(null!=C?(z=C.from,D=C.to):0==t&&(F="1"));"xmlpng"==f&&(I="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(t=0;t<this.pages.length;t++)if(this.pages[t]==this.currentPage){z=t;break}t=m.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!q?q||null!=t&&t!=mxConstants.NONE||(t="#ffffff"):t=mxConstants.NONE;q={globalVars:m.getExportVariables()};null!=C&&null!=C.from&&(q.globalVars.pagenumber=C.from+1);E&&(q.grid={size:m.gridSize,steps:m.view.gridSteps,color:Editor.isDarkMode()&&+"pdf"==f?mxGraphView.prototype.defaultGridColor:m.view.gridColor});Graph.translateDiagram&&(q.diagramLanguage=Graph.diagramLanguage);E=this.getHiddenTagsMap();null!=E&&(q.hiddenTags=E);return{format:f,from:z,to:D,allPages:F,bg:null!=t?t:mxConstants.NONE,base64:n,embedXml:I,xml:k,filename:null!=c?c:"",extras:JSON.stringify(q),scale:u,border:B,pageMargin:M,w:U&&isFinite(U)?U:null,h:K&&isFinite(K)?K:null,crop:null!=S&&S?"1":"0",fit:null!=R&&R?"1":"0",shadows:null!=d&&d?"1":"0",sheetsAcross:T,sheetsDown:v}};EditorUi.prototype.getHiddenTagsMap=function(){var c=this.editor.graph,f={},k=!1;if(null!=this.pages)for(var n=0;n<this.pages.length;n++){var q=this.pages[n],t=q==this.currentPage?c.hiddenTags:null!=q.viewState?q.viewState.hiddenTags:null;null!=t&&0<t.length&&(f[q.getId()]=t,k=!0)}else null!=c.hiddenTags&&0<c.hiddenTags.length&&(f[0]=c.hiddenTags,k=!0);return k?f:null};EditorUi.prototype.setMode=function(c,f){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=window.location.hash;null!=c&&0<c.length&&(c=c.substring(1));if(null!=c&&1<c.length){var f=c.indexOf("#");0<=f&&(c=c.substring(0,f))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,f={};if(null!=c&&0<c.length){var k=c.lastIndexOf("#");if(0<k){c=decodeURIComponent(c.substring(k+1));try{f=JSON.parse(c)}catch(n){}}}return f};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var c=this.getHashObject();c.pageId=this.currentPage.getId();this.setHashObject(c)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(c){if(Editor.enableHashObjects){var f=window.location.hash;if(null==f||""==f)f="#";var k=f.lastIndexOf("#");0<k&&(f=f.substring(0,k));try{null==c||mxUtils.isEmptyObject(c)||(f=f+"#"+encodeURIComponent(JSON.stringify(c)))}catch(n){}0<k&&0<f.lastIndexOf("#")?window.location.hash=f:window.location.replace(f)}};EditorUi.prototype.loadDescriptor=function(c,f,k){var n=window.location.hash,q=mxUtils.bind(this,-function(u){var y=null!=c.data?c.data:"";null!=u&&0<u.length&&(0<y.length&&(y+="\n"),y+=u);u=new LocalFile(this,"csv"!=c.format&&0<y.length?y:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);u.getHash=function(){return n};this.fileLoaded(u);"csv"==c.format&&this.importCsv(y,mxUtils.bind(this,function(J){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var E=null!=c.interval?parseInt(c.interval):-6E4,I=null,C=mxUtils.bind(this,function(){var J=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(S){J===this.currentPage&&(200<=S.getStatus()&&300>=S.getStatus()?(this.updateDiagram(S.getText()),U()):this.handleError({message:mxResources.get("error")+" "+S.getStatus()}))}),mxUtils.bind(this,function(S){this.handleError(S)}))}),U=mxUtils.bind(this,function(){window.clearTimeout(I);I=window.setTimeout(C,E)});this.editor.addListener("pageSelected",-mxUtils.bind(this,function(){U();C()}));U();C()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var t=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(t,mxUtils.bind(this,function(u){q(u)}),mxUtils.bind(this,function(u){null!=k&&k(u)}))}else q("")};EditorUi.prototype.updateDiagram=function(c){function f(m){var r=new mxCellOverlay(m.image||q.warningImage,m.tooltip,m.align,m.valign,m.offset);r.addListener(mxEvent.CLICK,function(A,D){n.alert(m.tooltip)});return r}var k=null,n=this;if(null!=c&&0<c.length&&-(k=mxUtils.parseXml(c),c=null!=k?k.documentElement:null,null!=c&&"updates"==c.nodeName)){var q=this.editor.graph,t=q.getModel();t.beginUpdate();var u=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var y=t.getCell(c.getAttribute("id"));if(null!=y){try{var E=c.getAttribute("value");if(null!=E){var I=mxUtils.parseXml(E).documentElement;if(null!=I)if("1"==I.getAttribute("replace-value"))t.setValue(y,I);else for(var C=I.attributes,U=0;U<C.length;U++)q.setAttributeForCell(y,C[U].nodeName,-0<C[U].nodeValue.length?C[U].nodeValue:null)}}catch(m){null!=window.console&&console.log("Error in value for "+y.id+": "+m)}try{var J=c.getAttribute("style");null!=J&&q.model.setStyle(y,J)}catch(m){null!=window.console&&console.log("Error in style for "+y.id+": "+m)}try{var S=c.getAttribute("icon");if(null!=S){var N=0<S.length?JSON.parse(S):null;null!=N&&N.append||q.removeCellOverlays(y);null!=N&&q.addCellOverlay(y,f(N))}}catch(m){null!=window.console&&console.log("Error in icon for "+y.id+": "+m)}try{var R=-c.getAttribute("geometry");if(null!=R){R=JSON.parse(R);var T=q.getCellGeometry(y);if(null!=T){T=T.clone();for(key in R){var v=parseFloat(R[key]);"dx"==key?T.x+=v:"dy"==key?T.y+=v:"dw"==key?T.width+=v:"dh"==key?T.height+=v:T[key]=parseFloat(R[key])}q.model.setGeometry(y,T)}}}catch(m){null!=window.console&&console.log("Error in icon for "+y.id+": "+m)}}}else if("model"==c.nodeName){for(var d=c.firstChild;null!=d&&d.nodeType!=mxConstants.NODETYPE_ELEMENT;)d=d.nextSibling;null!=d&&(new mxCodec(c.firstChild)).decode(d,+function(u){var B=null!=c.data?c.data:"";null!=u&&0<u.length&&(0<B.length&&(B+="\n"),B+=u);u=new LocalFile(this,"csv"!=c.format&&0<B.length?B:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);u.getHash=function(){return n};this.fileLoaded(u);"csv"==c.format&&this.importCsv(B,mxUtils.bind(this,function(K){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var E=null!=c.interval?parseInt(c.interval):+6E4,I=null,C=mxUtils.bind(this,function(){var K=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(S){K===this.currentPage&&(200<=S.getStatus()&&300>=S.getStatus()?(this.updateDiagram(S.getText()),U()):this.handleError({message:mxResources.get("error")+" "+S.getStatus()}))}),mxUtils.bind(this,function(S){this.handleError(S)}))}),U=mxUtils.bind(this,function(){window.clearTimeout(I);I=window.setTimeout(C,E)});this.editor.addListener("pageSelected",+mxUtils.bind(this,function(){U();C()}));U();C()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var t=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(t,mxUtils.bind(this,function(u){q(u)}),mxUtils.bind(this,function(u){null!=k&&k(u)}))}else q("")};EditorUi.prototype.updateDiagram=function(c){function f(m){var r=new mxCellOverlay(m.image||q.warningImage,m.tooltip,m.align,m.valign,m.offset);r.addListener(mxEvent.CLICK,function(z,D){n.alert(m.tooltip)});return r}var k=null,n=this;if(null!=c&&0<c.length&&+(k=mxUtils.parseXml(c),c=null!=k?k.documentElement:null,null!=c&&"updates"==c.nodeName)){var q=this.editor.graph,t=q.getModel();t.beginUpdate();var u=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var B=t.getCell(c.getAttribute("id"));if(null!=B){try{var E=c.getAttribute("value");if(null!=E){var I=mxUtils.parseXml(E).documentElement;if(null!=I)if("1"==I.getAttribute("replace-value"))t.setValue(B,I);else for(var C=I.attributes,U=0;U<C.length;U++)q.setAttributeForCell(B,C[U].nodeName,+0<C[U].nodeValue.length?C[U].nodeValue:null)}}catch(m){null!=window.console&&console.log("Error in value for "+B.id+": "+m)}try{var K=c.getAttribute("style");null!=K&&q.model.setStyle(B,K)}catch(m){null!=window.console&&console.log("Error in style for "+B.id+": "+m)}try{var S=c.getAttribute("icon");if(null!=S){var M=0<S.length?JSON.parse(S):null;null!=M&&M.append||q.removeCellOverlays(B);null!=M&&q.addCellOverlay(B,f(M))}}catch(m){null!=window.console&&console.log("Error in icon for "+B.id+": "+m)}try{var R=+c.getAttribute("geometry");if(null!=R){R=JSON.parse(R);var T=q.getCellGeometry(B);if(null!=T){T=T.clone();for(key in R){var v=parseFloat(R[key]);"dx"==key?T.x+=v:"dy"==key?T.y+=v:"dw"==key?T.width+=v:"dh"==key?T.height+=v:T[key]=parseFloat(R[key])}q.model.setGeometry(B,T)}}}catch(m){null!=window.console&&console.log("Error in icon for "+B.id+": "+m)}}}else if("model"==c.nodeName){for(var d=c.firstChild;null!=d&&d.nodeType!=mxConstants.NODETYPE_ELEMENT;)d=d.nextSibling;null!=d&&(new mxCodec(c.firstChild)).decode(d,t)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(q.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))q.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(u=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{t.endUpdate()}null!=u&&this.chromelessResize&&this.chromelessResize(!0,u)}return k};EditorUi.prototype.getCopyFilename=function(c,-f){var k=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var n=k.lastIndexOf(".");0<=n&&(c=k.substring(n),k=k.substring(0,n));if(f){f=k;var q=new Date;k=q.getFullYear();n=q.getMonth()+1;var t=q.getDate(),u=q.getHours(),y=q.getMinutes();q=q.getSeconds();k=f+(" "+(k+"-"+n+"-"+t+"-"+u+"-"+y+"-"+q))}return k=mxResources.get("copyOf",[k])+c};EditorUi.prototype.logIfModified=function(c,f){try{null!=c&&f&&EditorUi.debug("File.closed",[c])}catch(k){}};EditorUi.prototype.fileLoaded=function(c,+f){var k=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var n=k.lastIndexOf(".");0<=n&&(c=k.substring(n),k=k.substring(0,n));if(f){f=k;var q=new Date;k=q.getFullYear();n=q.getMonth()+1;var t=q.getDate(),u=q.getHours(),B=q.getMinutes();q=q.getSeconds();k=f+(" "+(k+"-"+n+"-"+t+"-"+u+"-"+B+"-"+q))}return k=mxResources.get("copyOf",[k])+c};EditorUi.prototype.logIfModified=function(c,f){try{null!=c&&f&&EditorUi.debug("File.closed",[c])}catch(k){}};EditorUi.prototype.fileLoaded=function(c,f,k){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[c],"noDialogs",[f]);var n=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var q=!1;this.hideDialog();null!=n&&(n.removeListener(this.descriptorChangedListener),this.logIfModified(n,!0),n.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var t=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=n&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!f&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fname.innerText="");this.clearStatus();this.updateUi();if(!f)if("0"!=urlParams.splash)this.showSplash();else try{this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}catch(U){this.handleError(U)}});if(null!=c)try{this.openingFile=!0;this.setCurrentFile(c);c.addListener("descriptorChanged",this.descriptorChangedListener);c.addListener("contentChanged",this.descriptorChangedListener);c.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(c.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();c.isEditable()?c.isModified()?c.addUnsavedStatus():this.clearStatus():this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus('<div class="geStatusBox" title="'+mxUtils.htmlEntities(mxResources.get("readOnly"))+'">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+-"</div>")}));!this.editor.isChromelessView()||this.editor.editable?(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers(),this.restoreLibraries(),window.self===window.top||this.noAutoFocus||window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=k&&k();this.editor.fireEvent(new mxEventObject("fileLoaded"));q=!0;if(Editor.embedSvgFonts&&/(\.svg)$/i.test(c.getTitle()))try{this.editor.loadFonts(),-this.editor.embedExtFonts(function(){})}catch(U){}if(!this.isOffline()&&null!=c.getMode()){var u="1"==urlParams.sketch?"sketch":uiTheme;if(null==u)u="default";else if("sketch"==u||"min"==u)u+=Editor.isDarkMode()?"-dark":"-light";EditorUi.logEvent({category:c.getMode().toUpperCase()+"-OPEN-FILE-"+c.getHash(),action:"size_"+c.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")+"_theme_"+u})}EditorUi.debug("File.opened",[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));-if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(U){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(U){}}catch(U){this.fileLoadedError=U;k=null;var y=this.defaultFilename;if(null!=c){try{k=c.getData(),y=c.getTitle()||this.defaultFilename}catch(J){}try{c.close()}catch(J){}}var E=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,-mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=n?this.fileLoaded(n)||t():t()});if(f)E();else{U.dialogWidth=350;var I=mxUtils.bind(this,function(){this.handleError(U,mxResources.get("errorLoadingFile"),E,!0,null,null,!0)});if(null!=U.fallbackFileData)U.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var J=new LocalFile(this,U.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(J)})},I();else{var C=-this.spinner.spin(document.body,mxResources.get("loading"));this.getRecoveryData(c,k,U,mxUtils.bind(this,function(J){C&&this.spinner.stop();if(null!=J&&1==J.length){var S=J[0];U.alternateAction={label:S.label,funct:mxUtils.bind(this,function(){this.hideDialog();S.lossy?this.confirm(mxResources.get("recoveryWarning"),mxUtils.bind(this,function(){this.openRecoveredCopy(S,y)})):this.openRecoveredCopy(S,y)})}}else null!=J&&1<J.length&&(U.alternateAction={label:mxResources.get("recover"),funct:mxUtils.bind(this,-function(){this.hideDialog();this.showRecoveryDialog(J,y)})});I()}))}}}else t();return q};EditorUi.prototype.getHashValueForPages=function(c,f){var k=0,n=new mxGraphModel,q=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var t=0;t<c.length;t++)if(null!=c[t]){this.updatePageRoot(c[t]);var u=c[t].node.ownerDocument.createElement("diagram");u.setAttribute("id",c[t].getId());n.root=c[t].root;var y=q.encode(n);this.editor.graph.saveViewState(c[t].viewState,y,!0);y.removeAttribute("pageWidth");-y.removeAttribute("pageHeight");u.appendChild(y);null!=f&&(f.eltCount+=u.getElementsByTagName("*").length,f.nodeCount+=u.getElementsByTagName("mxCell").length);k=(k<<5)-k+this.hashValue(u,function(E,I,C,U){return!U||"mxGeometry"!=E.nodeName&&"mxPoint"!=E.nodeName||"x"!=I&&"y"!=I&&"width"!=I&&"height"!=I?U&&"mxCell"==E.nodeName&&"previous"==I?null:C:Math.round(C)},f)<<0}return k};EditorUi.prototype.hashValue=function(c,f,k){var n=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===-typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(n^=this.hashValue(c.nodeName,f,k));if(null!=c.attributes){null!=k&&(k.attrCount+=c.attributes.length);for(var q=0;q<c.attributes.length;q++){var t=c.attributes[q].name,u=null!=f?f(c,t,c.attributes[q].value,!0):c.attributes[q].value;null!=u&&(n^=this.hashValue(t,f,k)+this.hashValue(u,f,k))}}if(null!=c.childNodes)for(q=0;q<c.childNodes.length;q++)n=(n<<5)-n+this.hashValue(c.childNodes[q],f,k)<<0}else if(null!=c&&"function"!==-typeof c){c=String(c);f=0;null!=k&&(k.byteCount+=c.length);for(q=0;q<c.length;q++)f=(f<<5)-f+c.charCodeAt(q)<<0;n^=f}return n};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,k,n,q,t,u){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,-".scratchpad",mxUtils.bind(this,function(c){if(null==c||"<mxfile"==c.substring(0,7))c=this.emptyLibraryXml;this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var f=0;f<c.length;f++)null!=c[f].xml&&"<"!=c[f].xml.charAt(0)&&(c[f].xml=mxUtils.trim(Graph.decompress(c[f].xml)));f=mxUtils.createXmlDocument();var k=f.createElement("mxlibrary");mxUtils.setTextContent(k,-JSON.stringify(c,null,2));f.appendChild(k);return mxUtils.getXml(f,"\n")};EditorUi.prototype.closeLibrary=function(c){null!=c&&(this.removeLibrarySidebar(c.getHash()),c.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(c.getHash()),".scratchpad"==c.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(c){var f=this.sidebar.palettes[c];if(null!=f){for(var k=0;k<f.length;k++)this.sidebar.unobserveElements(f[k]),f[k].parentNode.removeChild(f[k]);delete this.sidebar.palettes[c]}};-EditorUi.prototype.repositionLibrary=function(c,f){var k=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!f){null==c&&(f=this.sidebar.palettes["L.scratchpad"],null==f&&(f=this.sidebar.palettes.search),null!=f&&(c=f[f.length-1].nextSibling));c=null!=c?c:k.firstChild.nextSibling.nextSibling;f=k.lastChild;var n=f.previousSibling;k.insertBefore(f,c);k.insertBefore(n,f)}};EditorUi.prototype.loadLibrary=function(c,f){var k=mxUtils.parseXml(c.getData());if("mxlibrary"==-k.documentElement.nodeName){var n=JSON.parse(mxUtils.getTextContent(k.documentElement));this.libraryLoaded(c,n,k.documentElement.getAttribute("title"),f,k.documentElement.getAttribute("tags"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(c){return""};EditorUi.prototype.showSidebar=function(){null!=this.sidebarWindow?this.sidebarWindow.window.setVisible(!0):this.toggleShapesPanel(!0)};EditorUi.prototype.showSearchWindow=function(c,f){var k=-c?"findReplace":"find",n=k+"Window";if(null==this[n]){var q="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,t=mxSettings.getWindowState(k),u=null!=t&&null!=t.w?t.w:c?q?330:300:240;this[n]=new FindWindow(this,null!=t&&null!=t.x?t.x:document.body.offsetWidth-(u+20),null!=t&&null!=t.y?t.y:100,u,null!=t&&null!=t.h?t.h:c?q?304:288:180,c);this[n].window.addListener("show",function(){this.fireEvent(new mxEventObject(k))});this[n].window.addListener("hide",function(){this.fireEvent(new mxEventObject(k))});-this.installWindowPersistence(k,this[n]);null!=t&&null==f&&this.restoreWindowState(k,this[n]);this[n].window.setVisible(!0)}else null==f&&this[n].window.setVisible(!this[n].window.isVisible());null!=f&&(this[n].doSearch(f),this[n].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,f,k,n,q){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var t=null;if(c.constructor!=StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=-[]);for(var u=0;u<this.openLibraries.length;u++)if(this.openLibraries[u].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[u],this.openLibraries);break}t={file:c,images:f,title:k,expand:n};this.openLibraries.push(t)}else this.scratchpad=c;u=this.sidebar.palettes[c.getHash()];u=null!=u?u[u.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var y=null,E=mxUtils.bind(this,function(d,m){0==d.length&&c.isEditable()?(null==y&&(y=document.createElement("div"),y.className="geDropTarget",-d=mxResources.get("dragElementsHere"),mxUtils.write(y,d),y.setAttribute("title",d)),m.appendChild(y)):this.addLibraryEntries(d,m)});null!=this.sidebar&&null!=f&&(this.sidebar.setCurrentSearchEntryLibrary(c.getHash(),c.getHash()),this.sidebar.addEntries(f,q),this.sidebar.setCurrentSearchEntryLibrary());null==k&&(k=c.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));var I=this.sidebar.addPalette(c.getHash(),k,null!=n?n:!0,mxUtils.bind(this,function(d){E(f,d)}),!0);null!=-t&&(t.div=I);this.repositionLibrary(u,"L.scratchpad"!=c.getHash());n=I.parentNode.previousSibling;k=n.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=c.title&&n.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+k);var C=document.createElement("div");C.style.backgroundColor="inherit";n.style.position="relative";var U=document.createElement("img");U.className="geLibraryButton";U.setAttribute("src",Editor.crossImage);U.setAttribute("title",mxResources.get("close"));var J=null;if(".scratchpad"!=-c.title||this.closableScratchpad)C.appendChild(U),mxEvent.addListener(U,"click",mxUtils.bind(this,function(d){if(!mxEvent.isConsumed(d)){var m=mxUtils.bind(this,function(){null!=t&&mxUtils.remove(t,this.openLibraries);this.closeLibrary(c)});null!=J?this.confirm(mxResources.get("allChangesLost"),null,m,mxResources.get("cancel"),mxResources.get("discardChanges")):m();mxEvent.consume(d)}}));if(c.isEditable()){var S=this.editor.graph,N=null;k=mxUtils.bind(this,function(d){this.showLibraryDialog(c.getTitle(),-I,f,c,c.getMode());mxEvent.consume(d)});var R=mxUtils.bind(this,function(d){c.setModified(!0);c.isAutosave()?(null!=N&&null!=N.parentNode&&N.parentNode.removeChild(N),N=U.cloneNode(!1),N.setAttribute("src",Editor.spinImage),N.setAttribute("title",mxResources.get("saving")),N.style.cursor="default",N.style.marginRight="2px",N.style.marginTop="-2px",C.insertBefore(N,C.firstChild),this.saveLibrary(c.getTitle(),f,c,c.getMode(),!0,!0,function(){null!=N&&null!=N.parentNode&&N.parentNode.removeChild(N)})):-null==J&&(J=U.cloneNode(!1),J.setAttribute("src",Editor.saveImage),J.setAttribute("title",mxResources.get("save")),C.insertBefore(J,C.firstChild),mxEvent.addListener(J,"click",mxUtils.bind(this,function(m){this.saveLibrary(c.getTitle(),f,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==J||c.isModified()||(J.parentNode.removeChild(J),J=null)});mxEvent.consume(m)})))}),T=mxUtils.bind(this,function(d,m,r,A){d=S.cloneCells(mxUtils.sortCells(S.model.getTopmostCells(d)));for(var D=0;D<d.length;D++){var G=-S.getCellGeometry(d[D]);null!=G&&G.translate(-m.x,-m.y)}I.appendChild(this.sidebar.createVertexTemplateFromCells(d,m.width,m.height,A||"",!0,null,!1));d=mxUtils.getXml(this.editor.graph.encodeCells(d));Editor.defaultCompressed&&(d=Graph.compress(d));m={xml:d,w:m.width,h:m.height};null!=A&&(m.title=A);f.push(m);R(r);null!=y&&null!=y.parentNode&&0<f.length&&(y.parentNode.removeChild(y),y=null)}),v=mxUtils.bind(this,function(d){if(S.isSelectionEmpty())S.getRubberband().isActive()?(S.getRubberband().execute(d),-S.getRubberband().reset()):null!=d&&null!=mxEvent.getSource(d)&&mxEvent.getSource(d).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var m=S.getSelectionCells(),r=S.view.getBounds(m);if(null!=r&&0<r.width&&0<r.height){var A=S.view.scale;r.x/=A;r.y/=A;r.width/=A;r.height/=A;r.x-=S.view.translate.x;r.y-=S.view.translate.y;T(m,r)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(d)});-mxEvent.addGestureListeners(I,function(){},mxUtils.bind(this,function(d){S.isMouseDown&&null!=S.panningManager&&null!=S.graphHandler.first&&(S.graphHandler.suspend(),null!=S.graphHandler.hint&&(S.graphHandler.hint.style.visibility="hidden"),I.style.backgroundColor="light-dark(#fefefe, #000000)",I.style.cursor="copy",S.panningManager.stop(),S.autoScroll=!1,mxEvent.consume(d))}),mxUtils.bind(this,function(d){S.isMouseDown&&null!=S.panningManager&&null!=S.graphHandler&&(I.style.backgroundColor="",I.style.cursor=-"default",this.sidebar.showTooltips=!0,S.panningManager.stop(),S.graphHandler.reset(),S.isMouseDown=!1,S.autoScroll=!0,v(d),mxEvent.consume(d))}));mxEvent.addListener(I,"mouseleave",mxUtils.bind(this,function(d){S.isMouseDown&&null!=S.graphHandler.first&&(S.graphHandler.resume(),null!=S.graphHandler.hint&&(S.graphHandler.hint.style.visibility="visible"),I.style.backgroundColor="",I.style.cursor="",S.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(I,"dragover",mxUtils.bind(this,function(d){I.style.backgroundColor=-"light-dark(#fefefe, #000000)";d.dataTransfer.dropEffect="copy";I.style.cursor="copy";this.sidebar.hideTooltip();d.stopPropagation();d.preventDefault()})),mxEvent.addListener(I,"drop",mxUtils.bind(this,function(d){I.style.cursor="";I.style.backgroundColor="";0<d.dataTransfer.files.length&&this.importFiles(d.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(m,r,A,D,G,O,P,V,Y){if(null!=m&&"image/"==r.substring(0,6))m="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+-this.convertDataUri(m),m=[new mxCell("",new mxGeometry(0,0,G,O),m)],m[0].vertex=!0,T(m,new mxRectangle(0,0,G,O),d,mxEvent.isAltDown(d)?null:P.substring(0,P.lastIndexOf(".")).replace(/_/g," ")),null!=y&&null!=y.parentNode&&0<f.length&&(y.parentNode.removeChild(y),y=null);else{var H=!1,W=mxUtils.bind(this,function(Z,X){null!=Z&&"application/pdf"==X&&(X=Editor.extractGraphModelFromPdf(Z),null!=X&&0<X.length&&(Z=X));if(null!=Z)if(Z=mxUtils.parseXml(Z),"mxlibrary"==Z.documentElement.nodeName)try{var ba=-JSON.parse(mxUtils.getTextContent(Z.documentElement));E(ba,I);f=f.concat(ba);R(d);this.spinner.stop();H=!0}catch(na){}else if("mxfile"==Z.documentElement.nodeName)try{var ea=Z.documentElement.getElementsByTagName("diagram");for(ba=0;ba<ea.length;ba++){var aa=this.stringToCells(Editor.getDiagramNodeXml(ea[ba])),ha=this.editor.graph.getBoundingBoxFromGeometry(aa);null!=ha&&T(aa,new mxRectangle(0,0,ha.width,ha.height),d)}H=!0}catch(na){null!=window.console&&console.log("error in drop handler:",na)}H||-(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=y&&null!=y.parentNode&&0<f.length&&(y.parentNode.removeChild(y),y=null)});null!=Y&&null!=P&&EditorUi.isVisioFilename(P)?this.importVisio(Y,function(Z){W(Z,"text/xml")},null,P):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(m,P)&&null!=Y?this.isExternalDataComms()?this.parseFile(Y,mxUtils.bind(this,function(Z){4==Z.readyState&&(this.spinner.stop(),200<=Z.status&&299>=Z.status?W(Z.responseText,"text/xml"):-this.handleError({message:mxResources.get(413==Z.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):W(m,r)}}));d.stopPropagation();d.preventDefault()})),mxEvent.addListener(I,"dragleave",function(d){I.style.cursor="";I.style.backgroundColor="";d.stopPropagation();d.preventDefault()}));U=U.cloneNode(!1);U.setAttribute("src",Editor.editImage);U.setAttribute("title",-mxResources.get("edit"));C.insertBefore(U,C.firstChild);mxEvent.addListener(U,"click",k);k=U.cloneNode(!1);k.setAttribute("src",Editor.plusImage);k.setAttribute("title",mxResources.get("add"));C.insertBefore(k,C.firstChild);mxEvent.addListener(k,"click",v);".scratchpad"==c.title&&(this.addSelectionToScratchpad=v);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(k=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),k.className="geLibraryButton",C.insertBefore(k,C.firstChild))}n.appendChild(C);-this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,f){for(var k=0;k<c.length;k++)try{var n=c[k],q=n.data;if(null!=q){q="data:"==q.substring(0,5)?this.convertDataUri(q):q;var t="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==n.aspect&&(t+="aspect=fixed;");t=t+"image="+q+";";null!=n.style&&(t+=n.style);f.appendChild(this.sidebar.createVertexTemplate(t,n.w,n.h,"",n.title||"",!1,null,!0))}else if(null!=n.xml){var u=-this.stringToCells("<"==n.xml.charAt(0)?n.xml:Graph.decompress(n.xml)),y=0==u.length?mxResources.get("drawingEmpty"):null!=n.title?n.title:"";f.appendChild(this.sidebar.createVertexTemplateFromCells(u,n.w,n.h,y,!0,null,!0))}}catch(E){y=null!=E.message?mxResources.get("error")+": "+E.message:String(E),t=this.sidebar.createVertexTemplateFromCells(null,n.w,n.h,y,!0,null,!0),f.appendChild(t)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&-(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,f,k,n,q,t,u){c=new ImageDialog(this,c,f,k,n,q,t,u);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,-f,k,n,q,t){var u=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=u?JSON.stringify(JSON.parse(u),null,2):"",mxUtils.bind(this,function(y){if(null!=y)try{if(null!=t&&t(y),y==u)this.hideDialog();else{if(0<y.length){var E=JSON.parse(y);localStorage.setItem(f,JSON.stringify(E))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(I){this.handleError(I)}}),null,mxResources.get("close"),null,null,null,!0,null,null,q,k,n);this.showDialog(c.container,-660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=k&&2<k.length?500:440,280));c.init()};EditorUi.prototype.showConfigurationEditorDialog=function(c,f,k,n){function q(P){S?E.confirm(mxResources.get("allChangesLost"),null,P,mxResources.get("cancel"),mxResources.get("discardChanges")):P()}function t(){N=!0;E.hideDialog()}function u(P,V){var Y=document.createElement("div");Y.style.padding="4px 16px";Y.style.cursor="pointer";Y.style.fontSize="13px";Y.style.borderBottom=V?"2px solid #29b6f2":"2px solid transparent";-Y.style.fontWeight=V?"bold":"normal";Y.style.color=V?"":"#888";Y.style.userSelect="none";mxUtils.write(Y,P);return Y}function y(P){if(P!==J){if("json"===P)null!=U&&(D.value=JSON.stringify(U,null,2)),d.style.display="none",A.style.display="",v.style.borderBottomColor="#29b6f2",v.style.fontWeight="bold",v.style.color="",T.style.borderBottomColor="transparent",T.style.fontWeight="normal",T.style.color="#888",D.focus();else{try{var V=JSON.parse(D.value);U=V;r.setConfig(V)}catch(Y){}d.style.display="";-A.style.display="none";T.style.borderBottomColor="#29b6f2";T.style.fontWeight="bold";T.style.color="";v.style.borderBottomColor="transparent";v.style.fontWeight="normal";v.style.color="#888"}J=P}}var E=this,I=localStorage.getItem(f),C={};try{null!=I&&(C=JSON.parse(I))}catch(P){}var U=C,J="editor",S=!1,N=!1;c=document.createElement("div");c.style.position="absolute";c.style.top="20px";c.style.bottom="20px";c.style.left="20px";c.style.right="20px";var R=document.createElement("div");R.style.position=-"absolute";R.style.left="0";R.style.right="0";R.style.top="0";R.style.height="28px";R.style.display="flex";R.style.alignItems="end";R.style.borderBottom="1px solid #d0d0d0";var T=u(mxResources.get("editor",null,"Editor"),!0),v=u(mxResources.get("formatJson",null,"JSON"),!1);R.appendChild(T);R.appendChild(v);c.appendChild(R);var d=document.createElement("div");d.style.position="absolute";d.style.left="0";d.style.right="0";d.style.top="30px";d.style.bottom="50px";R={};try{var m=E.editor.graph;null!=-m.currentVertexStyle&&(R.currentVertexStyle=m.currentVertexStyle);null!=m.currentEdgeStyle&&(R.currentEdgeStyle=m.currentEdgeStyle)}catch(P){}var r=DrawioConfigEditor.install(d,{initialConfig:C,editorContext:R,darkMode:null!=Editor.isDarkMode&&Editor.isDarkMode(),highContrast:E.isHighContrast(),onConfigChanged:function(P){U=P;S=!0}}),A=document.createElement("div");A.style.position="absolute";A.style.left="0";A.style.right="0";A.style.top="30px";A.style.bottom="50px";A.style.display="none";var D=-document.createElement("textarea");D.setAttribute("wrap","off");D.setAttribute("spellcheck","false");D.setAttribute("autocorrect","off");D.setAttribute("autocomplete","off");D.setAttribute("autocapitalize","off");D.style.resize="none";D.style.outline="none";D.style.boxSizing="border-box";D.style.width="100%";D.style.height="100%";try{D.value=null!=I?JSON.stringify(JSON.parse(I),null,2):""}catch(P){D.value=I||""}mxEvent.addListener(D,"input",function(){S=!0});A.appendChild(D);c.appendChild(d);c.appendChild(A);-mxEvent.addListener(T,"click",function(){y("editor")});mxEvent.addListener(v,"click",function(){y("json")});var G=document.createElement("div");G.style.position="absolute";G.style.left="0";G.style.right="0";G.style.bottom="0";G.style.height="46px";G.style.display="flex";G.style.whiteSpace="nowrap";G.style.alignItems="center";G.style.justifyContent="end";G.style.paddingTop="10px";G.style.paddingBottom="10px";G.style.boxSizing="border-box";null==n||E.isOffline()||G.appendChild(E.createHelpIcon(n));-if(null!=k)for(n=0;n<k.length;n++)(function(P,V,Y){P=mxUtils.button(P,function(H){"editor"===J&&null!=U&&(D.value=JSON.stringify(U,null,2));V(H,D)});null!=Y&&P.setAttribute("title",Y);P.className="geBtn";G.appendChild(P)})(k[n][0],k[n][1],k[n][2]);n=mxUtils.button(mxResources.get("close"),function(){q(t)});n.setAttribute("title","Escape");n.className="geBtn";var O=mxUtils.button(mxResources.get("apply"),function(){var P="editor"===J?null!=U&&0<Object.keys(U).length?JSON.stringify(U,null,2):"":D.value;-try{if(P==I)S=!1,t();else{if(0<P.length){var V=JSON.parse(P);localStorage.setItem(f,JSON.stringify(V))}else localStorage.removeItem(f);S=!1;t();E.alert(mxResources.get("restartForChangeRequired"))}}catch(Y){E.handleError(Y)}});O.className="geBtn gePrimaryBtn";E.editor.cancelFirst?(G.appendChild(n),G.appendChild(O)):(G.appendChild(O),G.appendChild(n));c.appendChild(G);mxEvent.addListener(c,"keydown",function(P){13===P.keyCode&&mxEvent.isControlDown(P)&&O.click()});E.showDialog(c,800,600,!0,!1,function(P,-V){if(!N&&S)return q(t),!1},null,null,new mxRectangle(0,0,null!=k&&2<k.length?500:440,400));D.scrollTop=0};EditorUi.prototype.showBackgroundImageDialog=function(c,f,k,n){c=null!=c?c:mxUtils.bind(this,function(q,t,u){t||(q=new ChangePageSetup(this,n?u:null,q),q.ignoreColor=!n,this.editor.graph.model.execute(q))});c=new BackgroundImageDialog(this,c,f,k,n);this.showDialog(c.container,400,null,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,f,k,n,q){c=new LibraryDialog(this,c,f,k,n,q);-this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(t){t&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}),!1,!1,new mxRectangle(0,0,480,320));c.init()};EditorUi.prototype.getCollapsedSections=function(){return mxSettings.getCollapsedSections()};EditorUi.prototype.getLibraryExpanded=function(c,f){var k=mxSettings.getCollapsedLibraries();return null!=k[c]?!k[c]:f};EditorUi.prototype.setLibraryExpanded=function(c,f){if(null!=c){var k=mxSettings.getCollapsedLibraries();-k[c]=!f;mxSettings.setCollapsedLibraries(k);mxSettings.save()}};var p=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var f=p.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(k){this.editor.graph.isSelectionEmpty()&&f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,k,n,q,t,u){var y=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},E=null!=c&&null!=c.error?c.error:c;if(null!=-c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{"1"!=urlParams.test&&!u||null==window.console||console.error("EditorUi.handleError:",c)}catch(J){}if(null!=E||null!=f){u=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var I=mxResources.get("ok"),C=null;f=null!=f?f:mxResources.get("error");if(null!=E){null!=E.retry&&(I=mxResources.get("cancel"),C=function(){y();E.retry()});if(404==E.code||404==E.status||403==E.code){u=403==E.code?null!=E.message?mxUtils.htmlEntities(E.message,-!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=q?q:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var U=null!=q?null:null!=t?t:window.location.hash;if(null!=U&&("#G"==U.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==U.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&-0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==E.code||404==E.status)){U="#U"==U.substring(0,2)?U.substring(45,U.lastIndexOf("%26ex")):U.substring(2);this.showError(f,u,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+U);null!=n&&n()}),C,mxResources.get("changeUser"),mxUtils.bind(this,function(){function J(){T.innerText="";for(var v=0;v<S.length;v++){var d=document.createElement("option");mxUtils.write(d,-S[v].displayName);d.value=v;T.appendChild(d);d=document.createElement("option");d.innerHTML=" ";mxUtils.write(d,"<"+S[v].email+">");d.setAttribute("disabled","disabled");T.appendChild(d)}d=document.createElement("option");mxUtils.write(d,mxResources.get("addAccount"));d.value=S.length;T.appendChild(d)}var S=this.drive.getUsersList(),N=document.createElement("div"),R=document.createElement("div");R.style.marginBottom="6px";mxUtils.write(R,mxResources.get("changeUser")+": ");N.appendChild(R);-var T=document.createElement("select");T.style.width="100%";J();mxEvent.addListener(T,"change",mxUtils.bind(this,function(){var v=T.value,d=S.length!=v;d&&this.drive.setUser(S[v]);this.drive.authorize(d,mxUtils.bind(this,function(){d||(S=this.drive.getUsersList(),J())}),mxUtils.bind(this,function(m){this.handleError(m)}),!0)}));N.appendChild(T);N=new CustomDialog(this,N,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(N.container,300,100,!0,!0)}),mxResources.get("cancel"),-mxUtils.bind(this,function(){this.hideDialog();null!=k&&k()}),520,150);return}}null!=E.message?u=""==E.message&&null!=E.name?mxUtils.htmlEntities(E.name,!1):mxUtils.htmlEntities(E.message,!1):null!=E.response&&null!=E.response.error?u=mxUtils.htmlEntities(E.response.error,!1):"undefined"!==typeof window.App&&(E.code==App.ERROR_TIMEOUT?u=mxUtils.htmlEntities(mxResources.get("timeout"),!1):E.code==App.ERROR_BUSY?u=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof E&&0<E.length&&(u=-mxUtils.htmlEntities(E,!1)))}q=c=null;null!=E&&null!=E.helpLink?(c=mxResources.get("help"),q=mxUtils.bind(this,function(){return this.editor.graph.openLink(E.helpLink)})):null!=E&&null!=E.ownerEmail?(c=mxResources.get("contactOwner"),u+=mxUtils.htmlEntities(" ("+c+": "+E.ownerEmail+")",!1),q=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(E.ownerEmail))})):null!=E&&null!=E.alternateAction&&(c=E.alternateAction.label,q=E.alternateAction.funct);this.showError(f,u,I,-k,C,null,null,c,q,null!=E?E.dialogWidth:null,null,null,n?k:null)}else null!=k&&k()};EditorUi.prototype.alert=function(c,f,k){c=new ErrorDialog(this,null,c,mxResources.get("ok"),f);this.showDialog(c.container,k||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,k,n,q,t){c=null!=c?c:"";var u=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},y=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){u();null!=f&&f()},function(){u();-null!=k&&k()},n,q,null,null,null,null,y);this.showDialog(c.container,340,46+y,!0,t);c.init()};EditorUi.prototype.showBanner=function(c,f,k,n,q,t,u,y,E){t=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){u=null!=u?u:"translate(-50%,120%)";y=null!=y?y:"translate(-50%,0%)";var I=document.createElement("div");I.className="geBtn gePrimaryBtn geBanner"+(q?" geSmallBanner":"");I.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(I.style,-"transform",u);mxUtils.setPrefixedStyle(I.style,"transition","all 1000ms ease");null!=E&&mxUtils.setPrefixedStyle(I.style,"transform-origin",E);E=E=document.createElement("img");E.setAttribute("src",Editor.crossImage);E.setAttribute("title",mxResources.get(n?"doNotShowAgain":"close"));E.setAttribute("border","0");q||(t=document.createElement("img"),t.setAttribute("src",IMAGE_PATH+"/logo.png"),t.setAttribute("border","0"),t.setAttribute("align","absmiddle"),t.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",-I.appendChild(t),E.style.cssText=(q?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",I.appendChild(E));mxUtils.write(I,f);document.body.appendChild(I);this.bannerShowing=!0;q&&(E.className="geLibraryButton",I.appendChild(E));f=document.createElement("div");f.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var C=document.createElement("input");-C.setAttribute("type","checkbox");C.setAttribute("id","geDoNotShowAgainCheckbox");C.style.marginRight="6px";if(!n){f.appendChild(C);var U=document.createElement("label");U.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(U,mxResources.get("doNotShowAgain"));f.appendChild(U);I.style.paddingBottom=q?"16px":"30px";I.appendChild(f)}var J=mxUtils.bind(this,function(){null!=I.parentNode&&(I.parentNode.removeChild(I),this.bannerShowing=!1,C.checked||n)&&(this["hideBanner"+c]=!0,isLocalStorage&&-null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=E&&mxEvent.addListener(E,"click",mxUtils.bind(this,function(N){mxEvent.consume(N);J()}));var S=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(I.style,"transform",u);window.setTimeout(mxUtils.bind(this,function(){J()}),1E3)});mxEvent.addListener(I,"click",mxUtils.bind(this,function(N){var R=mxEvent.getSource(N);R!=C&&R!=U?(null!=k&&k(),J(),mxEvent.consume(N)):S()}));window.setTimeout(mxUtils.bind(this,-function(){mxUtils.setPrefixedStyle(I.style,"transform",y)}),500);window.setTimeout(S,q?5E3:3E4);t=!0}return t};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,f,k,n){c=c.toDataURL("image/"+k);if(null!=c&&6<c.length)null!=f&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(f))),0<n&&(c=Editor.writeGraphModelToPng(c,-"pHYs","dpi",n));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,f,k,n,q){var t="jpeg"==k?"jpg":k;n=this.getBaseFilename(n)+(null!=f?".drawio":"")+"."+t;c=this.createImageDataUri(c,f,k,q);this.saveData(n,t,c.substring(c.lastIndexOf(",")+1),"image/"+k,!0)};EditorUi.prototype.showAnimatedGifExportDialog=function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("formatAnimatedGif",-null,"Animated GIF"));c.appendChild(f);f=document.createElement("div");f.className="geDialogSection";var k=document.createElement("div");k.className="geDialogFormRow";var n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("speed",null,"Speed")+":");k.appendChild(n);var q=document.createElement("select"),t=[{label:mxResources.get("slow",null,"Slow"),value:8},{label:mxResources.get("medium",null,"Medium"),value:15},{label:mxResources.get("fast",null,"Fast"),-value:24}];for(n=0;n<t.length;n++){var u=document.createElement("option");mxUtils.write(u,t[n].label);u.setAttribute("value",t[n].value);q.appendChild(u)}q.value=null!=this.lastExportFps?this.lastExportFps:15;0>q.selectedIndex&&(q.value=15);k.appendChild(q);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("zoom")+":");k.appendChild(n);var y=document.createElement("input");-y.setAttribute("type","text");y.value=this.lastExportZoom||"100%";k.appendChild(y);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("borderWidth",null,"Border Width")+":");k.appendChild(n);var E=document.createElement("input");E.setAttribute("type","text");E.value=this.lastExportBorder||"0";k.appendChild(E);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";-n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("loops",null,"Loops")+":");k.appendChild(n);var I=document.createElement("select");t=[{label:mxResources.get("forever",null,"Forever"),value:0},{label:"1",value:1},{label:"3",value:3},{label:"5",value:5}];for(n=0;n<t.length;n++)u=document.createElement("option"),mxUtils.write(u,t[n].label),u.setAttribute("value",t[n].value),I.appendChild(u);I.value=null!=this.lastExportLoops?this.lastExportLoops:0;0>I.selectedIndex&&-(I.value=0);k.appendChild(I);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("appearance")+":");k.appendChild(n);var C=document.createElement("select");n=document.createElement("option");n.setAttribute("value","light");mxUtils.write(n,mxResources.get("light"));C.appendChild(n);n=document.createElement("option");n.setAttribute("value","dark");mxUtils.write(n,mxResources.get("dark"));-C.appendChild(n);var U=Editor.isDarkMode()?"dark":"light";C.value=null!=this.lastExportTheme?this.lastExportTheme:U;0>C.selectedIndex&&(C.value=U);k.appendChild(C);f.appendChild(k);c.appendChild(f);f=document.createElement("div");f.className="geDialogSection";var J=this.addCheckbox(f,mxResources.get("transparentBackground",null,"Transparent Background"),null!=this.lastExportTransparent?this.lastExportTransparent:!1,null,null,null,null,null,!0);c.appendChild(f);c=new CustomDialog(this,c,mxUtils.bind(this,-function(){var S=parseInt(y.value);if(isNaN(S)||0>=S)S=100;this.lastExportZoom=S+"%";this.lastExportBorder=E.value;this.lastExportFps=15!=parseInt(q.value)?parseInt(q.value):null;this.lastExportLoops=0!=parseInt(I.value)?parseInt(I.value):null;this.lastExportTransparent=J.checked?!0:null;this.lastExportTheme=C.value==U?null:C.value;this.exportAnimatedGif({fps:parseInt(q.value),scale:S/100,border:parseInt(E.value)||0,repeat:parseInt(I.value),transparent:J.checked,theme:C.value,background:J.checked?-null:null!=this.editor.graph.background&&this.editor.graph.background!=mxConstants.NONE?this.editor.graph.background:"light-dark(#ffffff,"+Editor.darkColor+")"})}),null,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram");this.showDialog(c.container,360,null,!0,!0,null,null,null,null,!0)};EditorUi.prototype.exportAnimatedGif=function(c){if(this.spinner.spin(document.body,mxResources.get("exporting")))try{(new AnimatedGifExport(this)).doExport(c,mxUtils.bind(this,function(f){this.spinner.stop();-if(null!=f){var k=this.getBaseFilename()+".gif";if("function"===typeof navigator.msSaveBlob)navigator.msSaveBlob(f,k);else{var n=document.createElement("a");n.href=URL.createObjectURL(f);n.download=k;document.body.appendChild(n);n.click();setTimeout(function(){document.body.removeChild(n);URL.revokeObjectURL(n.href)},0)}}}),mxUtils.bind(this,function(f){this.spinner.stop();this.handleError(f)}))}catch(f){this.spinner.stop(),this.handleError(f)}};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=-urlParams.save&&"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,f){c=new TextareaDialog(this,c,f,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280),!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,f,k,n,q,t){"text/xml"!=k||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||-/(\.html)$/i.test(f)||(f=f+"."+(null!=t?t:"drawio"));if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,k,n);else{var u=document.createElement("a");t=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof u.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var y=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);t=65==(y?parseInt(y[2],10):!1)?!1:t}if(t||this.isOffline()){u.href=-URL.createObjectURL(n?this.base64ToBlob(c,k):new Blob([c],{type:k}));t?u.download=f:u.setAttribute("target","_blank");document.body.appendChild(u);try{window.setTimeout(function(){URL.revokeObjectURL(u.href)},2E4),u.click(),u.parentNode.removeChild(u)}catch(E){}}else this.createEchoRequest(c,f,k,n,q).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,k,n,q,t){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=k?"&mime="+k:"")+(null!=q?"&format="+-q:"")+(null!=t?"&base64="+t:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(n?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,k,n,q,t,u,y,E){t=null!=t?t:!1;u=null!=u?u:"vsdx"!=q&&(!mxClient.IS_IOS||!navigator.standalone);var I=mxUtils.bind(this,function(U,J,S,N){try{if("_blank"==J)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(c,k,n);else if(null!=k&&"text/html"==k.substring(0,9)&&c.length<EmbedDialog.maxSize){var R=new EmbedDialog(this,c,null,null,null,null,null,-null,null,!0);this.showDialog(R.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));R.init()}else null==window.open(URL.createObjectURL(new Blob([c],{type:"text/plain;charset=utf-8"})))&&mxUtils.popup(c,!0);else if(J==App.MODE_DEVICE||"download"==J)this.doSaveLocalFile(c,U,k,n,null,y);else if(null!=U&&0<U.length){var T=mxUtils.bind(this,function(v){try{this.exportFile(c,U,k,n,J,v)}catch(d){this.handleError(d)}});null!=N?T(N):this.pickFolder(J,T)}}catch(v){this.handleError(v)}});q=[];-t||q.push(App.MODE_BROWSER);u||q.push("_blank");var C=new SaveDialog(this,f,mxUtils.bind(this,function(U,J,S){I(U.value,J,U,S);this.hideDialog(null,null,C.container)}),q,c,k,n,E);this.showDialog(C.container,420,null!=k?114:122,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));C.init()};EditorUi.prototype.openInNewWindow=function(c,f,k){null==window.open(URL.createObjectURL(k?this.base64ToBlob(c,f):new Blob([c],{type:f})))&&mxUtils.popup(c,!0)};var g=EditorUi.prototype.addChromelessToolbarItems;-EditorUi.prototype.isChromelessImageExportEnabled=function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=function(c){if(null!=urlParams.tags){var f=null;try{var k=urlParams.tags;try{k=decodeURIComponent(k)}catch(y){}f=JSON.parse(k)}catch(y){}if(null!=f){var n=this.editor.graph,q=mxUtils.bind(this,function(){var y=null!=this.currentPage?this.currentPage.getId():-0;y=f[y];n.hiddenTags=null!=y&&0<y.length?y:[];n.refresh()});this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){q();n.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize()}));this.editor.addListener("pageSelected",q)}this.tagsDialog=this.tagsComponent=null;var t=c(mxUtils.bind(this,function(y){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=this.tagsDialog}),!0),this.tagsComponent.div.getElementsByTagName("div")[0].style.position=+"</div>")}));!this.editor.isChromelessView()||this.editor.editable?(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers(),this.restoreLibraries(),window.self===window.top||this.noAutoFocus||window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=k&&k();this.editor.fireEvent(new mxEventObject("fileLoaded"));q=!0;if(/(\.svg)$/i.test(c.getTitle())&&+this.getSvgFileProperties(this.fileNode).embedFonts)try{this.editor.loadFonts(),this.editor.embedExtFonts(function(){})}catch(U){}if(!this.isOffline()&&null!=c.getMode()){var u="1"==urlParams.sketch?"sketch":uiTheme;if(null==u)u="default";else if("sketch"==u||"min"==u)u+=Editor.isDarkMode()?"-dark":"-light";EditorUi.logEvent({category:c.getMode().toUpperCase()+"-OPEN-FILE-"+c.getHash(),action:"size_"+c.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")+"_theme_"+u})}EditorUi.debug("File.opened",+[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(U){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(U){}}catch(U){this.fileLoadedError=U;k=null;var B=this.defaultFilename;if(null!=c){try{k=c.getData(),B=c.getTitle()||this.defaultFilename}catch(K){}try{c.close()}catch(K){}}var E=+mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=n?this.fileLoaded(n)||t():t()});if(f)E();else{U.dialogWidth=350;var I=mxUtils.bind(this,function(){this.handleError(U,mxResources.get("errorLoadingFile"),E,!0,null,null,!0)});if(null!=U.fallbackFileData)U.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var K=new LocalFile(this,+U.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(K)})},I();else{var C=this.spinner.spin(document.body,mxResources.get("loading"));this.getRecoveryData(c,k,U,mxUtils.bind(this,function(K){C&&this.spinner.stop();if(null!=K&&1==K.length){var S=K[0];U.alternateAction={label:S.label,funct:mxUtils.bind(this,function(){this.hideDialog();S.lossy?this.confirm(mxResources.get("recoveryWarning"),mxUtils.bind(this,function(){this.openRecoveredCopy(S,B)})):this.openRecoveredCopy(S,B)})}}else null!=+K&&1<K.length&&(U.alternateAction={label:mxResources.get("recover"),funct:mxUtils.bind(this,function(){this.hideDialog();this.showRecoveryDialog(K,B)})});I()}))}}}else t();return q};EditorUi.prototype.getHashValueForPages=function(c,f){var k=0,n=new mxGraphModel,q=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var t=0;t<c.length;t++)if(null!=c[t]){this.updatePageRoot(c[t]);var u=c[t].node.ownerDocument.createElement("diagram");u.setAttribute("id",c[t].getId());n.root=+c[t].root;var B=q.encode(n);this.editor.graph.saveViewState(c[t].viewState,B,!0);B.removeAttribute("pageWidth");B.removeAttribute("pageHeight");u.appendChild(B);null!=f&&(f.eltCount+=u.getElementsByTagName("*").length,f.nodeCount+=u.getElementsByTagName("mxCell").length);k=(k<<5)-k+this.hashValue(u,function(E,I,C,U){return!U||"mxGeometry"!=E.nodeName&&"mxPoint"!=E.nodeName||"x"!=I&&"y"!=I&&"width"!=I&&"height"!=I?U&&"mxCell"==E.nodeName&&"previous"==I?null:C:Math.round(C)},f)<<0}return k};EditorUi.prototype.hashValue=+function(c,f,k){var n=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(n^=this.hashValue(c.nodeName,f,k));if(null!=c.attributes){null!=k&&(k.attrCount+=c.attributes.length);for(var q=0;q<c.attributes.length;q++){var t=c.attributes[q].name,u=null!=f?f(c,t,c.attributes[q].value,!0):c.attributes[q].value;null!=u&&(n^=this.hashValue(t,f,k)+this.hashValue(u,f,k))}}if(null!=c.childNodes)for(q=0;q<c.childNodes.length;q++)n=+(n<<5)-n+this.hashValue(c.childNodes[q],f,k)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);f=0;null!=k&&(k.byteCount+=c.length);for(q=0;q<c.length;q++)f=(f<<5)-f+c.charCodeAt(q)<<0;n^=f}return n};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,k,n,q,t,u){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&+(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(c){if(null==c||"<mxfile"==c.substring(0,7))c=this.emptyLibraryXml;this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var f=0;f<c.length;f++)null!=c[f].xml&&"<"!=c[f].xml.charAt(0)&&(c[f].xml=mxUtils.trim(Graph.decompress(c[f].xml)));f=mxUtils.createXmlDocument();var k=+f.createElement("mxlibrary");mxUtils.setTextContent(k,JSON.stringify(c,null,2));f.appendChild(k);return mxUtils.getXml(f,"\n")};EditorUi.prototype.closeLibrary=function(c){null!=c&&(this.removeLibrarySidebar(c.getHash()),c.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(c.getHash()),".scratchpad"==c.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(c){var f=this.sidebar.palettes[c];if(null!=f){for(var k=0;k<f.length;k++)this.sidebar.unobserveElements(f[k]),+f[k].parentNode.removeChild(f[k]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=function(c,f){var k=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!f){null==c&&(f=this.sidebar.palettes["L.scratchpad"],null==f&&(f=this.sidebar.palettes.search),null!=f&&(c=f[f.length-1].nextSibling));c=null!=c?c:k.firstChild.nextSibling.nextSibling;f=k.lastChild;var n=f.previousSibling;k.insertBefore(f,c);k.insertBefore(n,f)}};EditorUi.prototype.loadLibrary=+function(c,f){var k=mxUtils.parseXml(c.getData());if("mxlibrary"==k.documentElement.nodeName){var n=JSON.parse(mxUtils.getTextContent(k.documentElement));this.libraryLoaded(c,n,k.documentElement.getAttribute("title"),f,k.documentElement.getAttribute("tags"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(c){return""};EditorUi.prototype.showSidebar=function(){null!=this.sidebarWindow?this.sidebarWindow.window.setVisible(!0):this.toggleShapesPanel(!0)};+EditorUi.prototype.showSearchWindow=function(c,f){var k=c?"findReplace":"find",n=k+"Window";if(null==this[n]){var q="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,t=mxSettings.getWindowState(k),u=null!=t&&null!=t.w?t.w:c?q?330:300:240;this[n]=new FindWindow(this,null!=t&&null!=t.x?t.x:document.body.offsetWidth-(u+20),null!=t&&null!=t.y?t.y:100,u,null!=t&&null!=t.h?t.h:c?q?304:288:180,c);this[n].window.addListener("show",function(){this.fireEvent(new mxEventObject(k))});+this[n].window.addListener("hide",function(){this.fireEvent(new mxEventObject(k))});this.installWindowPersistence(k,this[n]);null!=t&&null==f&&this.restoreWindowState(k,this[n]);this[n].window.setVisible(!0)}else null==f&&this[n].window.setVisible(!this[n].window.isVisible());null!=f&&(this[n].doSearch(f),this[n].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,f,k,n,q){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var t=null;if(c.constructor!=+StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var u=0;u<this.openLibraries.length;u++)if(this.openLibraries[u].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[u],this.openLibraries);break}t={file:c,images:f,title:k,expand:n};this.openLibraries.push(t)}else this.scratchpad=c;u=this.sidebar.palettes[c.getHash()];u=null!=u?u[u.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var B=null,E=mxUtils.bind(this,function(d,m){0==+d.length&&c.isEditable()?(null==B&&(B=document.createElement("div"),B.className="geDropTarget",d=mxResources.get("dragElementsHere"),mxUtils.write(B,d),B.setAttribute("title",d)),m.appendChild(B)):this.addLibraryEntries(d,m)});null!=this.sidebar&&null!=f&&(this.sidebar.setCurrentSearchEntryLibrary(c.getHash(),c.getHash()),this.sidebar.addEntries(f,q),this.sidebar.setCurrentSearchEntryLibrary());null==k&&(k=c.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));var I=this.sidebar.addPalette(c.getHash(),+k,null!=n?n:!0,mxUtils.bind(this,function(d){E(f,d)}),!0);null!=t&&(t.div=I);this.repositionLibrary(u,"L.scratchpad"!=c.getHash());n=I.parentNode.previousSibling;k=n.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=c.title&&n.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+k);var C=document.createElement("div");C.style.backgroundColor="inherit";n.style.position="relative";var U=document.createElement("img");U.className="geLibraryButton";U.setAttribute("src",Editor.crossImage);U.setAttribute("title",+mxResources.get("close"));var K=null;if(".scratchpad"!=c.title||this.closableScratchpad)C.appendChild(U),mxEvent.addListener(U,"click",mxUtils.bind(this,function(d){if(!mxEvent.isConsumed(d)){var m=mxUtils.bind(this,function(){null!=t&&mxUtils.remove(t,this.openLibraries);this.closeLibrary(c)});null!=K?this.confirm(mxResources.get("allChangesLost"),null,m,mxResources.get("cancel"),mxResources.get("discardChanges")):m();mxEvent.consume(d)}}));if(c.isEditable()){var S=this.editor.graph,M=null;k=mxUtils.bind(this,+function(d){this.showLibraryDialog(c.getTitle(),I,f,c,c.getMode());mxEvent.consume(d)});var R=mxUtils.bind(this,function(d){c.setModified(!0);c.isAutosave()?(null!=M&&null!=M.parentNode&&M.parentNode.removeChild(M),M=U.cloneNode(!1),M.setAttribute("src",Editor.spinImage),M.setAttribute("title",mxResources.get("saving")),M.style.cursor="default",M.style.marginRight="2px",M.style.marginTop="-2px",C.insertBefore(M,C.firstChild),this.saveLibrary(c.getTitle(),f,c,c.getMode(),!0,!0,function(){null!=M&&+null!=M.parentNode&&M.parentNode.removeChild(M)})):null==K&&(K=U.cloneNode(!1),K.setAttribute("src",Editor.saveImage),K.setAttribute("title",mxResources.get("save")),C.insertBefore(K,C.firstChild),mxEvent.addListener(K,"click",mxUtils.bind(this,function(m){this.saveLibrary(c.getTitle(),f,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==K||c.isModified()||(K.parentNode.removeChild(K),K=null)});mxEvent.consume(m)})))}),T=mxUtils.bind(this,function(d,m,r,z){d=S.cloneCells(mxUtils.sortCells(S.model.getTopmostCells(d)));+for(var D=0;D<d.length;D++){var F=S.getCellGeometry(d[D]);null!=F&&F.translate(-m.x,-m.y)}I.appendChild(this.sidebar.createVertexTemplateFromCells(d,m.width,m.height,z||"",!0,null,!1));d=mxUtils.getXml(this.editor.graph.encodeCells(d));Editor.defaultCompressed&&(d=Graph.compress(d));m={xml:d,w:m.width,h:m.height};null!=z&&(m.title=z);f.push(m);R(r);null!=B&&null!=B.parentNode&&0<f.length&&(B.parentNode.removeChild(B),B=null)}),v=mxUtils.bind(this,function(d){if(S.isSelectionEmpty())S.getRubberband().isActive()?+(S.getRubberband().execute(d),S.getRubberband().reset()):null!=d&&null!=mxEvent.getSource(d)&&mxEvent.getSource(d).classList.contains("geLibraryButton")&&this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var m=S.getSelectionCells(),r=S.view.getBounds(m);if(null!=r&&0<r.width&&0<r.height){var z=S.view.scale;r.x/=z;r.y/=z;r.width/=z;r.height/=z;r.x-=S.view.translate.x;r.y-=S.view.translate.y;T(m,r)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),+mxResources.get("ok"))}mxEvent.consume(d)});mxEvent.addGestureListeners(I,function(){},mxUtils.bind(this,function(d){S.isMouseDown&&null!=S.panningManager&&null!=S.graphHandler.first&&(S.graphHandler.suspend(),null!=S.graphHandler.hint&&(S.graphHandler.hint.style.visibility="hidden"),I.style.backgroundColor="light-dark(#fefefe, #000000)",I.style.cursor="copy",S.panningManager.stop(),S.autoScroll=!1,mxEvent.consume(d))}),mxUtils.bind(this,function(d){S.isMouseDown&&null!=S.panningManager&&null!=S.graphHandler&&+(I.style.backgroundColor="",I.style.cursor="default",this.sidebar.showTooltips=!0,S.panningManager.stop(),S.graphHandler.reset(),S.isMouseDown=!1,S.autoScroll=!0,v(d),mxEvent.consume(d))}));mxEvent.addListener(I,"mouseleave",mxUtils.bind(this,function(d){S.isMouseDown&&null!=S.graphHandler.first&&(S.graphHandler.resume(),null!=S.graphHandler.hint&&(S.graphHandler.hint.style.visibility="visible"),I.style.backgroundColor="",I.style.cursor="",S.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(I,+"dragover",mxUtils.bind(this,function(d){I.style.backgroundColor="light-dark(#fefefe, #000000)";d.dataTransfer.dropEffect="copy";I.style.cursor="copy";this.sidebar.hideTooltip();d.stopPropagation();d.preventDefault()})),mxEvent.addListener(I,"drop",mxUtils.bind(this,function(d){I.style.cursor="";I.style.backgroundColor="";0<d.dataTransfer.files.length&&this.importFiles(d.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(m,r,z,D,F,N,P,V,X){if(null!=m&&"image/"==r.substring(0,6))m=+"shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(m),m=[new mxCell("",new mxGeometry(0,0,F,N),m)],m[0].vertex=!0,T(m,new mxRectangle(0,0,F,N),d,mxEvent.isAltDown(d)?null:P.substring(0,P.lastIndexOf(".")).replace(/_/g," ")),null!=B&&null!=B.parentNode&&0<f.length&&(B.parentNode.removeChild(B),B=null);else{var H=!1,W=mxUtils.bind(this,function(Z,Y){null!=Z&&"application/pdf"==Y&&(Y=Editor.extractGraphModelFromPdf(Z),null!=Y&&0<Y.length&&+(Z=Y));if(null!=Z)if(Z=mxUtils.parseXml(Z),"mxlibrary"==Z.documentElement.nodeName)try{var ba=JSON.parse(mxUtils.getTextContent(Z.documentElement));E(ba,I);f=f.concat(ba);R(d);this.spinner.stop();H=!0}catch(na){}else if("mxfile"==Z.documentElement.nodeName)try{var ea=Z.documentElement.getElementsByTagName("diagram");for(ba=0;ba<ea.length;ba++){var aa=this.stringToCells(Editor.getDiagramNodeXml(ea[ba])),ha=this.editor.graph.getBoundingBoxFromGeometry(aa);null!=ha&&T(aa,new mxRectangle(0,0,ha.width,+ha.height),d)}H=!0}catch(na){null!=window.console&&console.log("error in drop handler:",na)}H||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=B&&null!=B.parentNode&&0<f.length&&(B.parentNode.removeChild(B),B=null)});null!=X&&null!=P&&EditorUi.isVisioFilename(P)?this.importVisio(X,function(Z){W(Z,"text/xml")},null,P):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(m,P)&&null!=X?this.isExternalDataComms()?this.parseFile(X,mxUtils.bind(this,function(Z){4==+Z.readyState&&(this.spinner.stop(),200<=Z.status&&299>=Z.status?W(Z.responseText,"text/xml"):this.handleError({message:mxResources.get(413==Z.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):W(m,r)}}));d.stopPropagation();d.preventDefault()})),mxEvent.addListener(I,"dragleave",function(d){I.style.cursor="";I.style.backgroundColor="";d.stopPropagation();d.preventDefault()}));+U=U.cloneNode(!1);U.setAttribute("src",Editor.editImage);U.setAttribute("title",mxResources.get("edit"));C.insertBefore(U,C.firstChild);mxEvent.addListener(U,"click",k);k=U.cloneNode(!1);k.setAttribute("src",Editor.plusImage);k.setAttribute("title",mxResources.get("add"));C.insertBefore(k,C.firstChild);mxEvent.addListener(k,"click",v);".scratchpad"==c.title&&(this.addSelectionToScratchpad=v);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(k=this.createHelpIcon(EditorUi.scratchpadHelpLink,+!0),k.className="geLibraryButton",C.insertBefore(k,C.firstChild))}n.appendChild(C);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,f){for(var k=0;k<c.length;k++)try{var n=c[k],q=n.data;if(null!=q){q="data:"==q.substring(0,5)?this.convertDataUri(q):q;var t="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==n.aspect&&(t+="aspect=fixed;");t=t+"image="+q+";";null!=n.style&&(t+=n.style);f.appendChild(this.sidebar.createVertexTemplate(t,+n.w,n.h,"",n.title||"",!1,null,!0))}else if(null!=n.xml){var u=this.stringToCells("<"==n.xml.charAt(0)?n.xml:Graph.decompress(n.xml)),B=0==u.length?mxResources.get("drawingEmpty"):null!=n.title?n.title:"";f.appendChild(this.sidebar.createVertexTemplateFromCells(u,n.w,n.h,B,!0,null,!0))}}catch(E){B=null!=E.message?mxResources.get("error")+": "+E.message:String(E),t=this.sidebar.createVertexTemplateFromCells(null,n.w,n.h,B,!0,null,!0),f.appendChild(t)}};EditorUi.prototype.getResource=function(c){return null!=+c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,f,k,n,q,t,u){c=new ImageDialog(this,c,f,k,n,q,t,u);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,+!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,k,n,q,t){var u=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=u?JSON.stringify(JSON.parse(u),null,2):"",mxUtils.bind(this,function(B){if(null!=B)try{if(null!=t&&t(B),B==u)this.hideDialog();else{if(0<B.length){var E=JSON.parse(B);localStorage.setItem(f,JSON.stringify(E))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(I){this.handleError(I)}}),null,mxResources.get("close"),+null,null,null,!0,null,null,q,k,n);this.showDialog(c.container,660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=k&&2<k.length?500:440,280));c.init()};EditorUi.prototype.showConfigurationEditorDialog=function(c,f,k,n){function q(P){S?E.confirm(mxResources.get("allChangesLost"),null,P,mxResources.get("cancel"),mxResources.get("discardChanges")):P()}function t(){M=!0;E.hideDialog()}function u(P,V){var X=document.createElement("div");X.style.padding="4px 16px";X.style.cursor="pointer";X.style.fontSize=+"13px";X.style.borderBottom=V?"2px solid #29b6f2":"2px solid transparent";X.style.fontWeight=V?"bold":"normal";X.style.color=V?"":"#888";X.style.userSelect="none";mxUtils.write(X,P);return X}function B(P){if(P!==K){if("json"===P)null!=U&&(D.value=JSON.stringify(U,null,2)),d.style.display="none",z.style.display="",v.style.borderBottomColor="#29b6f2",v.style.fontWeight="bold",v.style.color="",T.style.borderBottomColor="transparent",T.style.fontWeight="normal",T.style.color="#888",D.focus();else{try{var V=+JSON.parse(D.value);U=V;r.setConfig(V)}catch(X){}d.style.display="";z.style.display="none";T.style.borderBottomColor="#29b6f2";T.style.fontWeight="bold";T.style.color="";v.style.borderBottomColor="transparent";v.style.fontWeight="normal";v.style.color="#888"}K=P}}var E=this,I=localStorage.getItem(f),C={};try{null!=I&&(C=JSON.parse(I))}catch(P){}var U=C,K="editor",S=!1,M=!1;c=document.createElement("div");c.style.position="absolute";c.style.top="20px";c.style.bottom="20px";c.style.left="20px";c.style.right=+"20px";var R=document.createElement("div");R.style.position="absolute";R.style.left="0";R.style.right="0";R.style.top="0";R.style.height="28px";R.style.display="flex";R.style.alignItems="end";R.style.borderBottom="1px solid #d0d0d0";var T=u(mxResources.get("editor",null,"Editor"),!0),v=u(mxResources.get("formatJson",null,"JSON"),!1);R.appendChild(T);R.appendChild(v);c.appendChild(R);var d=document.createElement("div");d.style.position="absolute";d.style.left="0";d.style.right="0";d.style.top="30px";+d.style.bottom="50px";R={};try{var m=E.editor.graph;null!=m.currentVertexStyle&&(R.currentVertexStyle=m.currentVertexStyle);null!=m.currentEdgeStyle&&(R.currentEdgeStyle=m.currentEdgeStyle)}catch(P){}var r=DrawioConfigEditor.install(d,{initialConfig:C,editorContext:R,darkMode:null!=Editor.isDarkMode&&Editor.isDarkMode(),highContrast:E.isHighContrast(),onConfigChanged:function(P){U=P;S=!0}}),z=document.createElement("div");z.style.position="absolute";z.style.left="0";z.style.right="0";z.style.top=+"30px";z.style.bottom="50px";z.style.display="none";var D=document.createElement("textarea");D.setAttribute("wrap","off");D.setAttribute("spellcheck","false");D.setAttribute("autocorrect","off");D.setAttribute("autocomplete","off");D.setAttribute("autocapitalize","off");D.style.resize="none";D.style.outline="none";D.style.boxSizing="border-box";D.style.width="100%";D.style.height="100%";try{D.value=null!=I?JSON.stringify(JSON.parse(I),null,2):""}catch(P){D.value=I||""}mxEvent.addListener(D,"input",+function(){S=!0});z.appendChild(D);c.appendChild(d);c.appendChild(z);mxEvent.addListener(T,"click",function(){B("editor")});mxEvent.addListener(v,"click",function(){B("json")});var F=document.createElement("div");F.style.position="absolute";F.style.left="0";F.style.right="0";F.style.bottom="0";F.style.height="46px";F.style.display="flex";F.style.whiteSpace="nowrap";F.style.alignItems="center";F.style.justifyContent="end";F.style.paddingTop="10px";F.style.paddingBottom="10px";F.style.boxSizing="border-box";+null==n||E.isOffline()||F.appendChild(E.createHelpIcon(n));if(null!=k)for(n=0;n<k.length;n++)(function(P,V,X){P=mxUtils.button(P,function(H){"editor"===K&&null!=U&&(D.value=JSON.stringify(U,null,2));V(H,D)});null!=X&&P.setAttribute("title",X);P.className="geBtn";F.appendChild(P)})(k[n][0],k[n][1],k[n][2]);n=mxUtils.button(mxResources.get("close"),function(){q(t)});n.setAttribute("title","Escape");n.className="geBtn";var N=mxUtils.button(mxResources.get("apply"),function(){var P="editor"===K?null!=+U&&0<Object.keys(U).length?JSON.stringify(U,null,2):"":D.value;try{if(P==I)S=!1,t();else{if(0<P.length){var V=JSON.parse(P);localStorage.setItem(f,JSON.stringify(V))}else localStorage.removeItem(f);S=!1;t();E.alert(mxResources.get("restartForChangeRequired"))}}catch(X){E.handleError(X)}});N.className="geBtn gePrimaryBtn";E.editor.cancelFirst?(F.appendChild(n),F.appendChild(N)):(F.appendChild(N),F.appendChild(n));c.appendChild(F);mxEvent.addListener(c,"keydown",function(P){13===P.keyCode&&mxEvent.isControlDown(P)&&+N.click()});E.showDialog(c,800,600,!0,!1,function(P,V){if(!M&&S)return q(t),!1},null,null,new mxRectangle(0,0,null!=k&&2<k.length?500:440,400));D.scrollTop=0};EditorUi.prototype.showBackgroundImageDialog=function(c,f,k,n){c=null!=c?c:mxUtils.bind(this,function(q,t,u){t||(q=new ChangePageSetup(this,n?u:null,q),q.ignoreColor=!n,this.editor.graph.model.execute(q))});c=new BackgroundImageDialog(this,c,f,k,n);this.showDialog(c.container,400,null,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,+f,k,n,q){c=new LibraryDialog(this,c,f,k,n,q);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(t){t&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}),!1,!1,new mxRectangle(0,0,480,320));c.init()};EditorUi.prototype.getCollapsedSections=function(){return mxSettings.getCollapsedSections()};EditorUi.prototype.getLibraryExpanded=function(c,f){var k=mxSettings.getCollapsedLibraries();return null!=k[c]?!k[c]:f};EditorUi.prototype.setLibraryExpanded=function(c,f){if(null!=+c){var k=mxSettings.getCollapsedLibraries();k[c]=!f;mxSettings.setCollapsedLibraries(k);mxSettings.save()}};var p=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var f=p.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(k){this.editor.graph.isSelectionEmpty()&&f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,k,n,q,t,u){var B=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},+E=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{"1"!=urlParams.test&&!u||null==window.console||console.error("EditorUi.handleError:",c)}catch(K){}if(null!=E||null!=f){u=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var I=mxResources.get("ok"),C=null;f=null!=f?f:mxResources.get("error");if(null!=E){null!=E.retry&&(I=mxResources.get("cancel"),C=function(){B();E.retry()});if(404==E.code||404==E.status||403==E.code){u=403==E.code?null!=+E.message?mxUtils.htmlEntities(E.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=q?q:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var U=null!=q?null:null!=t?t:window.location.hash;if(null!=U&&("#G"==U.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==U.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||+null!=c.error.data&&0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==E.code||404==E.status)){U="#U"==U.substring(0,2)?U.substring(45,U.lastIndexOf("%26ex")):U.substring(2);this.showError(f,u,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+U);null!=n&&n()}),C,mxResources.get("changeUser"),mxUtils.bind(this,function(){function K(){T.innerText="";for(var v=0;v<S.length;v++){var d=document.createElement("option");+mxUtils.write(d,S[v].displayName);d.value=v;T.appendChild(d);d=document.createElement("option");d.innerHTML=" ";mxUtils.write(d,"<"+S[v].email+">");d.setAttribute("disabled","disabled");T.appendChild(d)}d=document.createElement("option");mxUtils.write(d,mxResources.get("addAccount"));d.value=S.length;T.appendChild(d)}var S=this.drive.getUsersList(),M=document.createElement("div"),R=document.createElement("div");R.style.marginBottom="6px";mxUtils.write(R,mxResources.get("changeUser")++": ");M.appendChild(R);var T=document.createElement("select");T.style.width="100%";K();mxEvent.addListener(T,"change",mxUtils.bind(this,function(){var v=T.value,d=S.length!=v;d&&this.drive.setUser(S[v]);this.drive.authorize(d,mxUtils.bind(this,function(){d||(S=this.drive.getUsersList(),K())}),mxUtils.bind(this,function(m){this.handleError(m)}),!0)}));M.appendChild(T);M=new CustomDialog(this,M,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(M.container,+300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=k&&k()}),520,150);return}}null!=E.message?u=""==E.message&&null!=E.name?mxUtils.htmlEntities(E.name,!1):mxUtils.htmlEntities(E.message,!1):null!=E.response&&null!=E.response.error?u=mxUtils.htmlEntities(E.response.error,!1):"undefined"!==typeof window.App&&(E.code==App.ERROR_TIMEOUT?u=mxUtils.htmlEntities(mxResources.get("timeout"),!1):E.code==App.ERROR_BUSY?u=mxUtils.htmlEntities(mxResources.get("busy"),+!1):"string"===typeof E&&0<E.length&&(u=mxUtils.htmlEntities(E,!1)))}q=c=null;null!=E&&null!=E.helpLink?(c=mxResources.get("help"),q=mxUtils.bind(this,function(){return this.editor.graph.openLink(E.helpLink)})):null!=E&&null!=E.ownerEmail?(c=mxResources.get("contactOwner"),u+=mxUtils.htmlEntities(" ("+c+": "+E.ownerEmail+")",!1),q=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(E.ownerEmail))})):null!=E&&null!=E.alternateAction&&(c=E.alternateAction.label,q=E.alternateAction.funct);+this.showError(f,u,I,k,C,null,null,c,q,null!=E?E.dialogWidth:null,null,null,n?k:null)}else null!=k&&k()};EditorUi.prototype.alert=function(c,f,k){c=new ErrorDialog(this,null,c,mxResources.get("ok"),f);this.showDialog(c.container,k||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,k,n,q,t){c=null!=c?c:"";var u=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},B=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){u();+null!=f&&f()},function(){u();null!=k&&k()},n,q,null,null,null,null,B);this.showDialog(c.container,340,46+B,!0,t);c.init()};EditorUi.prototype.showBanner=function(c,f,k,n,q,t,u,B,E){t=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){u=null!=u?u:"translate(-50%,120%)";B=null!=B?B:"translate(-50%,0%)";var I=document.createElement("div");I.className="geBtn gePrimaryBtn geBanner"+(q?" geSmallBanner":"");I.style.zIndex=mxPopupMenu.prototype.zIndex;+mxUtils.setPrefixedStyle(I.style,"transform",u);mxUtils.setPrefixedStyle(I.style,"transition","all 1000ms ease");null!=E&&mxUtils.setPrefixedStyle(I.style,"transform-origin",E);E=E=document.createElement("img");E.setAttribute("src",Editor.crossImage);E.setAttribute("title",mxResources.get(n?"doNotShowAgain":"close"));E.setAttribute("border","0");q||(t=document.createElement("img"),t.setAttribute("src",IMAGE_PATH+"/logo.png"),t.setAttribute("border","0"),t.setAttribute("align","absmiddle"),t.style.cssText=+"margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",I.appendChild(t),E.style.cssText=(q?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",I.appendChild(E));mxUtils.write(I,f);document.body.appendChild(I);this.bannerShowing=!0;q&&(E.className="geLibraryButton",I.appendChild(E));f=document.createElement("div");f.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";+var C=document.createElement("input");C.setAttribute("type","checkbox");C.setAttribute("id","geDoNotShowAgainCheckbox");C.style.marginRight="6px";if(!n){f.appendChild(C);var U=document.createElement("label");U.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(U,mxResources.get("doNotShowAgain"));f.appendChild(U);I.style.paddingBottom=q?"16px":"30px";I.appendChild(f)}var K=mxUtils.bind(this,function(){null!=I.parentNode&&(I.parentNode.removeChild(I),this.bannerShowing=!1,C.checked||n)&&+(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=E&&mxEvent.addListener(E,"click",mxUtils.bind(this,function(M){mxEvent.consume(M);K()}));var S=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(I.style,"transform",u);window.setTimeout(mxUtils.bind(this,function(){K()}),1E3)});mxEvent.addListener(I,"click",mxUtils.bind(this,function(M){var R=mxEvent.getSource(M);R!=C&&R!=U?(null!=k&&k(),K(),mxEvent.consume(M)):+S()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(I.style,"transform",B)}),500);window.setTimeout(S,q?5E3:3E4);t=!0}return t};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,f,k,n){c=c.toDataURL("image/"+k);if(null!=c&&6<c.length)null!=f&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(f))),+0<n&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",n));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,f,k,n,q){var t="jpeg"==k?"jpg":k;n=this.getBaseFilename(n)+(null!=f?".drawio":"")+"."+t;c=this.createImageDataUri(c,f,k,q);this.saveData(n,t,c.substring(c.lastIndexOf(",")+1),"image/"+k,!0)};EditorUi.prototype.showAnimatedGifExportDialog=function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");+mxUtils.write(f,mxResources.get("formatAnimatedGif",null,"Animated GIF"));c.appendChild(f);f=document.createElement("div");f.className="geDialogSection";var k=document.createElement("div");k.className="geDialogFormRow";var n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("speed",null,"Speed")+":");k.appendChild(n);var q=document.createElement("select"),t=[{label:mxResources.get("slow",null,"Slow"),value:8},{label:mxResources.get("medium",null,"Medium"),+value:15},{label:mxResources.get("fast",null,"Fast"),value:24}];for(n=0;n<t.length;n++){var u=document.createElement("option");mxUtils.write(u,t[n].label);u.setAttribute("value",t[n].value);q.appendChild(u)}q.value=null!=this.lastExportFps?this.lastExportFps:15;0>q.selectedIndex&&(q.value=15);k.appendChild(q);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("zoom")+":");k.appendChild(n);+var B=document.createElement("input");B.setAttribute("type","text");B.value=this.lastExportZoom||"100%";k.appendChild(B);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("borderWidth",null,"Border Width")+":");k.appendChild(n);var E=document.createElement("input");E.setAttribute("type","text");E.value=this.lastExportBorder||"0";k.appendChild(E);f.appendChild(k);k=document.createElement("div");+k.className="geDialogFormRow";n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("loops",null,"Loops")+":");k.appendChild(n);var I=document.createElement("select");t=[{label:mxResources.get("forever",null,"Forever"),value:0},{label:"1",value:1},{label:"3",value:3},{label:"5",value:5}];for(n=0;n<t.length;n++)u=document.createElement("option"),mxUtils.write(u,t[n].label),u.setAttribute("value",t[n].value),I.appendChild(u);I.value=null!=this.lastExportLoops?+this.lastExportLoops:0;0>I.selectedIndex&&(I.value=0);k.appendChild(I);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("appearance")+":");k.appendChild(n);var C=document.createElement("select");n=document.createElement("option");n.setAttribute("value","light");mxUtils.write(n,mxResources.get("light"));C.appendChild(n);n=document.createElement("option");n.setAttribute("value",+"dark");mxUtils.write(n,mxResources.get("dark"));C.appendChild(n);var U=Editor.isDarkMode()?"dark":"light";C.value=null!=this.lastExportTheme?this.lastExportTheme:U;0>C.selectedIndex&&(C.value=U);k.appendChild(C);f.appendChild(k);c.appendChild(f);f=document.createElement("div");f.className="geDialogSection";var K=this.addCheckbox(f,mxResources.get("transparentBackground",null,"Transparent Background"),null!=this.lastExportTransparent?this.lastExportTransparent:!1,null,null,null,null,null,!0);c.appendChild(f);+c=new CustomDialog(this,c,mxUtils.bind(this,function(){var S=parseInt(B.value);if(isNaN(S)||0>=S)S=100;this.lastExportZoom=S+"%";this.lastExportBorder=E.value;this.lastExportFps=15!=parseInt(q.value)?parseInt(q.value):null;this.lastExportLoops=0!=parseInt(I.value)?parseInt(I.value):null;this.lastExportTransparent=K.checked?!0:null;this.lastExportTheme=C.value==U?null:C.value;this.exportAnimatedGif({fps:parseInt(q.value),scale:S/100,border:parseInt(E.value)||0,repeat:parseInt(I.value),transparent:K.checked,+theme:C.value,background:K.checked?null:null!=this.editor.graph.background&&this.editor.graph.background!=mxConstants.NONE?this.editor.graph.background:"light-dark(#ffffff,"+Editor.darkColor+")"})}),null,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram");this.showDialog(c.container,360,null,!0,!0,null,null,null,null,!0)};EditorUi.prototype.exportAnimatedGif=function(c){if(this.spinner.spin(document.body,mxResources.get("exporting")))try{(new AnimatedGifExport(this)).doExport(c,+mxUtils.bind(this,function(f){this.spinner.stop();if(null!=f){var k=this.getBaseFilename()+".gif";if("function"===typeof navigator.msSaveBlob)navigator.msSaveBlob(f,k);else{var n=document.createElement("a");n.href=URL.createObjectURL(f);n.download=k;document.body.appendChild(n);n.click();setTimeout(function(){document.body.removeChild(n);URL.revokeObjectURL(n.href)},0)}}}),mxUtils.bind(this,function(f){this.spinner.stop();this.handleError(f)}))}catch(f){this.spinner.stop(),this.handleError(f)}};EditorUi.prototype.isLocalFileSave=+function(){return"remote"!=urlParams.save&&"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,f){c=new TextareaDialog(this,c,f,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280),!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,f,k,n,q,t){"text/xml"!=k||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||+/(\.svg)$/i.test(f)||/(\.html)$/i.test(f)||(f=f+"."+(null!=t?t:"drawio"));if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,k,n);else{var u=document.createElement("a");t=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof u.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var B=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);t=65==(B?parseInt(B[2],+10):!1)?!1:t}if(t||this.isOffline()){u.href=URL.createObjectURL(n?this.base64ToBlob(c,k):new Blob([c],{type:k}));t?u.download=f:u.setAttribute("target","_blank");document.body.appendChild(u);try{window.setTimeout(function(){URL.revokeObjectURL(u.href)},2E4),u.click(),u.parentNode.removeChild(u)}catch(E){}}else this.createEchoRequest(c,f,k,n,q).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,k,n,q,t){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c++(null!=k?"&mime="+k:"")+(null!=q?"&format="+q:"")+(null!=t?"&base64="+t:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(n?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,k,n,q,t,u,B,E){t=null!=t?t:!1;u=null!=u?u:"vsdx"!=q&&(!mxClient.IS_IOS||!navigator.standalone);var I=mxUtils.bind(this,function(U,K,S,M){try{if("_blank"==K)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(c,k,n);else if(null!=k&&"text/html"==k.substring(0,9)&&c.length<EmbedDialog.maxSize){var R=new EmbedDialog(this,+c,null,null,null,null,null,null,null,!0);this.showDialog(R.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));R.init()}else null==window.open(URL.createObjectURL(new Blob([c],{type:"text/plain;charset=utf-8"})))&&mxUtils.popup(c,!0);else if(K==App.MODE_DEVICE||"download"==K)this.doSaveLocalFile(c,U,k,n,null,B);else if(null!=U&&0<U.length){var T=mxUtils.bind(this,function(v){try{this.exportFile(c,U,k,n,K,v)}catch(d){this.handleError(d)}});null!=M?T(M):this.pickFolder(K,T)}}catch(v){this.handleError(v)}});+q=[];t||q.push(App.MODE_BROWSER);u||q.push("_blank");var C=new SaveDialog(this,f,mxUtils.bind(this,function(U,K,S){I(U.value,K,U,S);this.hideDialog(null,null,C.container)}),q,c,k,n,E);this.showDialog(C.container,420,null!=k?114:122,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));C.init()};EditorUi.prototype.openInNewWindow=function(c,f,k){null==window.open(URL.createObjectURL(k?this.base64ToBlob(c,f):new Blob([c],{type:f})))&&mxUtils.popup(c,!0)};var g=EditorUi.prototype.addChromelessToolbarItems;+EditorUi.prototype.isChromelessImageExportEnabled=function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=function(c){if(null!=urlParams.tags){var f=null;try{var k=urlParams.tags;try{k=decodeURIComponent(k)}catch(B){}f=JSON.parse(k)}catch(B){}if(null!=f){var n=this.editor.graph,q=mxUtils.bind(this,function(){var B=null!=this.currentPage?this.currentPage.getId():+0;B=f[B];n.hiddenTags=null!=B&&0<B.length?B:[];n.refresh()});this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){q();n.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize()}));this.editor.addListener("pageSelected",q)}this.tagsDialog=this.tagsComponent=null;var t=c(mxUtils.bind(this,function(B){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=this.tagsDialog}),!0),this.tagsComponent.div.getElementsByTagName("div")[0].style.position="",mxUtils.setPrefixedStyle(this.tagsComponent.div.style,"borderRadius","5px"),this.tagsComponent.div.style.maxHeight="160px",this.tagsComponent.div.style.maxWidth="120px",this.tagsComponent.div.style.padding="4px",this.tagsComponent.div.style.overflow="auto",this.tagsComponent.div.style.height="auto",this.tagsComponent.div.style.position="fixed",this.tagsComponent.div.style.fontFamily=Editor.defaultHtmlFont,this.tagsComponent.div.style.backgroundColor="#000000",this.tagsComponent.div.style.color="#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null;else{this.tagsDialog=this.tagsComponent.div;mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var E=t.getBoundingClientRect();this.tagsDialog.style.left=E.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+-this.chromelessToolbar.offsetHeight+4+"px";E=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=E.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(y)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var y=this.editor.graph.getAllTags();t.style.display=0<y.length?"":"none"}))}g.apply(this,+this.chromelessToolbar.offsetHeight+4+"px";E=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=E.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(B)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var B=this.editor.graph.getAllTags();t.style.display=0<B.length?"":"none"}))}g.apply(this,arguments);this.editor.addListener("tagsDialogShown",mxUtils.bind(this,function(){null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));this.editor.addListener("layersDialogShown",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));this.editor.addListener("pageSelected",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));mxEvent.addListener(this.editor.graph.container,"click",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));if(this.editor.isExportToCanvas()&&this.isChromelessImageExportEnabled()&&-"1"!=urlParams.noExport){this.exportDialog=null;var u=c(mxUtils.bind(this,function(y){var E=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",E);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)E.apply(this);else{this.exportDialog=document.createElement("div");var I=u.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position=+"1"!=urlParams.noExport){this.exportDialog=null;var u=c(mxUtils.bind(this,function(B){var E=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",E);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)E.apply(this);else{this.exportDialog=document.createElement("div");var I=u.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily=Editor.defaultHtmlFont;this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,80);this.exportDialog.style.left=I.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";I=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=I.zIndex;var C=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});C.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",E);this.editor.exportToCanvas(mxUtils.bind(this,function(U){C.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height=-"auto";this.exportDialog.style.padding="10px";var J=this.createImageDataUri(U,null,"png");U=document.createElement("img");U.style.maxWidth="140px";U.style.maxHeight="140px";U.style.cursor="pointer";U.style.backgroundColor="white";U.setAttribute("title",mxResources.get("openInNewWindow"));U.setAttribute("border","0");U.setAttribute("src",J);this.exportDialog.appendChild(U);mxEvent.addListener(U,"click",mxUtils.bind(this,function(){this.openInNewWindow(J.substring(J.indexOf(",")+1),"image/png",!0);-E.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(U){C.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(U)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(y)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,k,n,q,t){if("1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){t=-this.embedMessageSource||window.opener||window.parent;var u=this.createLoadMessage("export");u.format=f;u.filename=c;u.data=q?"data:"+n+";base64,"+k:k;u.xml=this.getFileData(!0);t.postMessage(JSON.stringify(u),"*")}else this.isLocalFileSave()?this.saveLocalFile(k,c,n,q,f,t):this.saveRequest(c,f,mxUtils.bind(this,function(y,E){return this.createEchoRequest(k,y,n,q,f,E)}),k,q,n)};EditorUi.prototype.saveRequest=function(c,f,k,n,q,t,u){u=null!=u?u:!mxClient.IS_IOS||!navigator.standalone;var y=mxUtils.bind(this,-function(I,C,U,J){if("_blank"==C||null!=I&&0<I.length){var S=k("_blank"==C?null:I,C==App.MODE_DEVICE||"download"==C||null==C||"_blank"==C?"0":"1");null!=S&&(C==App.MODE_DEVICE||"download"==C||"_blank"==C?S.simulate(document,"_blank"):(U=mxUtils.bind(this,function(N){t=null!=t?t:"pdf"==f?"application/pdf":"image/"+f;if(null!=n)try{this.exportFile(n,I,t,!0,C,N)}catch(R){this.handleError(R)}else this.spinner.spin(document.body,mxResources.get("saving"))&&S.send(mxUtils.bind(this,function(){this.spinner.stop();-if(200<=S.getStatus()&&299>=S.getStatus())try{this.exportFile(S.getText(),I,t,!0,C,N)}catch(R){this.handleError(R)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(R){this.spinner.stop();this.handleError(R)}))}),null!=J?U(J):this.pickFolder(C,U)))}});q=[App.MODE_BROWSER];u||q.push("_blank");var E=new SaveDialog(this,c,mxUtils.bind(this,function(I,C,U){y(I.value,C,I,U);this.hideDialog(null,null,E.container)}),q,null,"application/pdf");this.showDialog(E.container,+"auto";this.exportDialog.style.padding="10px";var K=this.createImageDataUri(U,null,"png");U=document.createElement("img");U.style.maxWidth="140px";U.style.maxHeight="140px";U.style.cursor="pointer";U.style.backgroundColor="white";U.setAttribute("title",mxResources.get("openInNewWindow"));U.setAttribute("border","0");U.setAttribute("src",K);this.exportDialog.appendChild(U);mxEvent.addListener(U,"click",mxUtils.bind(this,function(){this.openInNewWindow(K.substring(K.indexOf(",")+1),"image/png",!0);+E.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(U){C.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(U)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(B)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,k,n,q,t){if("1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){t=+this.embedMessageSource||window.opener||window.parent;var u=this.createLoadMessage("export");u.format=f;u.filename=c;u.data=q?"data:"+n+";base64,"+k:k;u.xml=this.getFileData(!0);t.postMessage(JSON.stringify(u),"*")}else this.isLocalFileSave()?this.saveLocalFile(k,c,n,q,f,t):this.saveRequest(c,f,mxUtils.bind(this,function(B,E){return this.createEchoRequest(k,B,n,q,f,E)}),k,q,n)};EditorUi.prototype.saveRequest=function(c,f,k,n,q,t,u){u=null!=u?u:!mxClient.IS_IOS||!navigator.standalone;var B=mxUtils.bind(this,+function(I,C,U,K){if("_blank"==C||null!=I&&0<I.length){var S=k("_blank"==C?null:I,C==App.MODE_DEVICE||"download"==C||null==C||"_blank"==C?"0":"1");null!=S&&(C==App.MODE_DEVICE||"download"==C||"_blank"==C?S.simulate(document,"_blank"):(U=mxUtils.bind(this,function(M){t=null!=t?t:"pdf"==f?"application/pdf":"image/"+f;if(null!=n)try{this.exportFile(n,I,t,!0,C,M)}catch(R){this.handleError(R)}else this.spinner.spin(document.body,mxResources.get("saving"))&&S.send(mxUtils.bind(this,function(){this.spinner.stop();+if(200<=S.getStatus()&&299>=S.getStatus())try{this.exportFile(S.getText(),I,t,!0,C,M)}catch(R){this.handleError(R)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(R){this.spinner.stop();this.handleError(R)}))}),null!=K?U(K):this.pickFolder(C,U)))}});q=[App.MODE_BROWSER];u||q.push("_blank");var E=new SaveDialog(this,c,mxUtils.bind(this,function(I,C,U){B(I.value,C,I,U);this.hideDialog(null,null,E.container)}),q,null,"application/pdf");this.showDialog(E.container,420,114,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));E.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,f,k,n,q,t){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,f,k){f(null)};EditorUi.prototype.exportSvg=function(c,f,k,n,q,t,-u,y,E,I,C,U,J,S,N,R){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(X){Editor.addRetryToError(X,mxUtils.bind(this,function(){this.exportSvg(c,f,k,n,q,t,u,y,E,I,C,U,J,S,N,R)}));this.handleError(X)})))try{var T=this.editor.graph.isSelectionEmpty();k=null!=k?k:T;var v=f?null:this.editor.graph.background;v==mxConstants.NONE&&(v=null);null==v&&0==f&&(v=this.editor.graph.shapeBackgroundColor);var d=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&-(this.editor.graph.addForeignObjectWarning=function(){});var m=mxUtils.lightDarkColorSupported,r=mxUtils.preferDarkColor;if("light"==C||"dark"==C)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==C;var A=Graph.addFont,D={};Graph.addFont=function(X,ba,ea,aa){A.call(this,X,ba,ea,D)};var G=this.editor.graph.createSvgImageExport(q,N),O=G.drawCellState;G.drawCellState=function(X,ba){null!=X&&Graph.processFontStyle(X.style);O.apply(this,arguments)};var P=this.editor.graph.getSvg(v,c,u,-y,null,k,null,G,"blank"==I?"_blank":"self"==I?"_top":null,null,!J,C,U,null,null,null,R);mxUtils.lightDarkColorSupported=m;mxUtils.preferDarkColor=r;this.editor.graph.addForeignObjectWarning=d;n&&this.editor.graph.addSvgShadow(P);var V=this.getBaseFilename()+(q?".drawio":"")+".svg";S=null!=S?S:mxUtils.bind(this,function(X){this.isLocalFileSave()||X.length<=MAX_REQUEST_SIZE?this.saveData(V,"svg",X,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),-mxUtils.bind(this,function(){mxUtils.popup(X)}))});var Y=mxUtils.bind(this,function(X){this.spinner.stop();q&&X.setAttribute("content",this.getFileData(!0,null,null,null,k,E,null,null,null,null,null,c,u));S(Graph.xmlDeclaration+"\n"+(q?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(X))});this.editor.graph.mathEnabled&&this.editor.addMathCss(P);var H=mxUtils.bind(this,function(X){Editor.replaceSvgDataUris&&t&&EditorUi.embedSvgImages(X);Editor.foreignObjectImages&&J?this.replaceAlternateContent(X,-C,Y):Y(X)}),W=Graph.customFontElements;Graph.customFontElements=D;var Z=mxUtils.bind(this,function(X){Graph.customFontElements=W;Graph.addFont=A;t&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(X,H,this.thumbImageCache)):H(X)});J?this.embedFonts(P,Z,!0):(this.editor.addFontCss(P),Z(P))}catch(X){this.handleError(X)}};EditorUi.prototype.replaceAlternateContent=function(c,f,k){function n(U,J,S,N,R){var T=mxUtils.createElementNs(c.ownerDocument,-mxConstants.NS_SVG,"image");T.setAttribute("x",J);T.setAttribute("y",S+.5);T.setAttribute("width",N.width);T.setAttribute("height",N.height);null==T.setAttributeNS?T.setAttribute("xlink:href",R):T.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",R);U.replaceChild(T,U.lastChild);y()}function q(){if(u<C.length)C[u++](q)}var t="";f=c.getElementsByTagName("style");for(var u=0;u<f.length;u++)t+=f[u].innerHTML;f=c.getElementsByTagName("switch");counter=f.length;var y=mxUtils.bind(this,function(){counter--;-0==counter&&k(c)}),E={},I={},C=[];for(u=0;u<f.length;u++)mxUtils.bind(this,function(U){var J=U.getElementsByTagName("div");if(0<J.length)try{var S=J[0].cloneNode(!0),N=parseInt(S.style.marginLeft),R=parseInt(S.style.paddingTop),T=S.getElementsByTagName("div")[1],v=J=!1,d=S.style.alignItems,m=S.style.justifyContent;if(null!=S.style.writingMode){var r=S.style.writingMode;v="vertical-"==r.substring(0,9);J="-rl"==r.substring(r.length-3)}var A=!v&&"1px"==S.style.width||v&&"1px"==S.style.height;if(!v&&-"1px"==S.style.height||v&&"1px"==S.style.width)S.style.alignItems=v&&J?"unsafe flex-end":"unsafe flex-start";A&&(S.style.justifyContent="unsafe flex-start");S.style.paddingTop="";S.style.marginLeft="";var D=S.outerHTML,G=E[D];null==G&&(S.style.position="absolute",S.style.visibility="hidden",document.body.appendChild(S),r=1,r="1px"==S.style.width?T.offsetWidth:parseInt(S.style.width),A=1,A="1px"==S.style.height?T.offsetHeight:parseInt(S.style.height),document.body.removeChild(S),G=new mxRectangle(N,-R,r,A),E[D]=G);"1px"==S.style.height&&("unsafe center"==d?R-=G.height/2:"unsafe flex-end"==d&&(R-=G.height));if("1px"==S.style.width)if(!v&&"unsafe center"==m||v&&"unsafe center"==d)N-=G.width/2;else if(!v&&"unsafe flex-end"==m||v&&(!J&&"unsafe flex-end"==d||J&&"unsafe flex-start"==d))N-=G.width;G=new mxRectangle(N,R,G.width,G.height+parseInt(T.style.fontSize)/4);C.push(mxUtils.bind(this,function(O){var P=I[D];null==P?Graph.htmlToPng(D,G.width,G.height,mxUtils.bind(this,function(V){n(U,N,R,G,V);I[D]=-V;O()}),t):(n(U,N,R,G,P),O())}))}catch(O){y()}else y()})(f[u]);0==counter&&k(c);u=0;q()};EditorUi.prototype.addRadiobox=function(c,f,k,n,q,t,u){return this.addCheckbox(c,k,n,q,t,u,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,k,n,q,t,u,y,E){t=null!=t?t:!0;var I=document.createElement("input");I.style.marginRight="8px";I.setAttribute("type",u?"radio":"checkbox");u="geCheckbox-"+Editor.guid();I.id=u;null!=y&&I.setAttribute("name",y);k&&(I.setAttribute("checked","checked"),I.defaultChecked=!0);+u,B,E,I,C,U,K,S,M,R){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(Y){Editor.addRetryToError(Y,mxUtils.bind(this,function(){this.exportSvg(c,f,k,n,q,t,u,B,E,I,C,U,K,S,M,R)}));this.handleError(Y)})))try{var T=this.editor.graph.isSelectionEmpty();k=null!=k?k:T;var v=f?null:this.editor.graph.background;v==mxConstants.NONE&&(v=null);null==v&&0==f&&(v=this.editor.graph.shapeBackgroundColor);var d=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&+(this.editor.graph.addForeignObjectWarning=function(){});var m=mxUtils.lightDarkColorSupported,r=mxUtils.preferDarkColor;if("light"==C||"dark"==C)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==C;var z=Graph.addFont,D={};Graph.addFont=function(Y,ba,ea,aa){z.call(this,Y,ba,ea,D)};var F=this.editor.graph.createSvgImageExport(q,M),N=F.drawCellState;F.drawCellState=function(Y,ba){null!=Y&&Graph.processFontStyle(Y.style);N.apply(this,arguments)};var P=this.editor.graph.getSvg(v,c,u,+B,null,k,null,F,"blank"==I?"_blank":"self"==I?"_top":null,null,!K,C,U,null,null,null,R);mxUtils.lightDarkColorSupported=m;mxUtils.preferDarkColor=r;this.editor.graph.addForeignObjectWarning=d;n&&this.editor.graph.addSvgShadow(P);var V=this.getBaseFilename()+(q?".drawio":"")+".svg";S=null!=S?S:mxUtils.bind(this,function(Y){this.isLocalFileSave()||Y.length<=MAX_REQUEST_SIZE?this.saveData(V,"svg",Y,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),+mxUtils.bind(this,function(){mxUtils.popup(Y)}))});var X=mxUtils.bind(this,function(Y){this.spinner.stop();q&&Y.setAttribute("content",this.getFileData(!0,null,null,null,k,E,null,null,null,null,null,c,u));S(Graph.xmlDeclaration+"\n"+(q?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(Y))});this.editor.graph.mathEnabled&&this.editor.addMathCss(P);var H=mxUtils.bind(this,function(Y){Editor.replaceSvgDataUris&&t&&EditorUi.embedSvgImages(Y);Editor.foreignObjectImages&&K?this.replaceAlternateContent(Y,+C,X):X(Y)}),W=Graph.customFontElements;Graph.customFontElements=D;var Z=mxUtils.bind(this,function(Y){Graph.customFontElements=W;Graph.addFont=z;t&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(Y,H,this.thumbImageCache)):H(Y)});K?this.embedFonts(P,Z,!0):(this.editor.addFontCss(P),Z(P))}catch(Y){this.handleError(Y)}};EditorUi.prototype.replaceAlternateContent=function(c,f,k){function n(U,K,S,M,R){var T=mxUtils.createElementNs(c.ownerDocument,+mxConstants.NS_SVG,"image");T.setAttribute("x",K);T.setAttribute("y",S+.5);T.setAttribute("width",M.width);T.setAttribute("height",M.height);null==T.setAttributeNS?T.setAttribute("xlink:href",R):T.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",R);U.replaceChild(T,U.lastChild);B()}function q(){if(u<C.length)C[u++](q)}var t="";f=c.getElementsByTagName("style");for(var u=0;u<f.length;u++)t+=f[u].innerHTML;f=c.getElementsByTagName("switch");counter=f.length;var B=mxUtils.bind(this,function(){counter--;+0==counter&&k(c)}),E={},I={},C=[];for(u=0;u<f.length;u++)mxUtils.bind(this,function(U){var K=U.getElementsByTagName("div");if(0<K.length)try{var S=K[0].cloneNode(!0),M=parseInt(S.style.marginLeft),R=parseInt(S.style.paddingTop),T=S.getElementsByTagName("div")[1],v=K=!1,d=S.style.alignItems,m=S.style.justifyContent;if(null!=S.style.writingMode){var r=S.style.writingMode;v="vertical-"==r.substring(0,9);K="-rl"==r.substring(r.length-3)}var z=!v&&"1px"==S.style.width||v&&"1px"==S.style.height;if(!v&&+"1px"==S.style.height||v&&"1px"==S.style.width)S.style.alignItems=v&&K?"unsafe flex-end":"unsafe flex-start";z&&(S.style.justifyContent="unsafe flex-start");S.style.paddingTop="";S.style.marginLeft="";var D=S.outerHTML,F=E[D];null==F&&(S.style.position="absolute",S.style.visibility="hidden",document.body.appendChild(S),r=1,r="1px"==S.style.width?T.offsetWidth:parseInt(S.style.width),z=1,z="1px"==S.style.height?T.offsetHeight:parseInt(S.style.height),document.body.removeChild(S),F=new mxRectangle(M,+R,r,z),E[D]=F);"1px"==S.style.height&&("unsafe center"==d?R-=F.height/2:"unsafe flex-end"==d&&(R-=F.height));if("1px"==S.style.width)if(!v&&"unsafe center"==m||v&&"unsafe center"==d)M-=F.width/2;else if(!v&&"unsafe flex-end"==m||v&&(!K&&"unsafe flex-end"==d||K&&"unsafe flex-start"==d))M-=F.width;F=new mxRectangle(M,R,F.width,F.height+parseInt(T.style.fontSize)/4);C.push(mxUtils.bind(this,function(N){var P=I[D];null==P?Graph.htmlToPng(D,F.width,F.height,mxUtils.bind(this,function(V){n(U,M,R,F,V);I[D]=+V;N()}),t):(n(U,M,R,F,P),N())}))}catch(N){B()}else B()})(f[u]);0==counter&&k(c);u=0;q()};EditorUi.prototype.addRadiobox=function(c,f,k,n,q,t,u){return this.addCheckbox(c,k,n,q,t,u,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,k,n,q,t,u,B,E){t=null!=t?t:!0;var I=document.createElement("input");I.style.marginRight="8px";I.setAttribute("type",u?"radio":"checkbox");u="geCheckbox-"+Editor.guid();I.id=u;null!=B&&I.setAttribute("name",B);k&&(I.setAttribute("checked","checked"),I.defaultChecked=!0);n&&I.setAttribute("disabled","disabled");t&&(E?(q=document.createElement("div"),q.className="geDialogCheckRow",q.appendChild(I),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",u),q.appendChild(k),c.appendChild(q),I.checkRow=q):(I.style.marginTop="16px",c.appendChild(I),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",u),c.appendChild(k),q||mxUtils.br(c)));return I};EditorUi.prototype.addAdvancedSection=function(c,f){var k=document.createElement("div");k.className="geCollapsibleTitle";mxUtils.write(k,mxResources.get(f||"advanced"));var n=document.createElement("div");n.className="geCollapsibleContent geCollapsed";f=document.createElement("div");f.className="geDialogSection";n.appendChild(f);var q=function(t){if(t!==k.classList.contains("geExpanded")&&(k.classList.toggle("geExpanded"),n.classList.toggle("geCollapsed"),t=k.closest(".geDialog"),null!=t)){var u=t.firstElementChild;null!=u&&(t.style.height="",t.style.height=u.scrollHeight+48+"px")}};mxEvent.addListener(k,"click",function(){q(!k.classList.contains("geExpanded"))});c.appendChild(k);c.appendChild(n);return{content:f,wrapper:n,expand:function(){q(!0)},collapse:function(){q(!1)},isExpanded:function(){return k.classList.contains("geExpanded")}}};EditorUi.prototype.addEditButton=function(c,f){var k=document.createElement("div");k.className="geDialogCheckRow";var n=document.createElement("span");n.className="geDialogFormLabel";n.style.display="flex";n.style.alignItems="center";var q=-this.addCheckbox(n,mxResources.get("edit")+":",!0,null,!0);q.style.marginTop="0px";k.appendChild(n);n=this.getCurrentFile();var t="";null!=n&&n.getMode()!=App.MODE_DEVICE&&n.getMode()!=App.MODE_BROWSER&&(t=window.location.href);var u=document.createElement("select");u.style.maxWidth="200px";u.className="geBtn";n=document.createElement("option");n.setAttribute("value","blank");mxUtils.write(n,mxResources.get("makeCopy"));u.appendChild(n);var y=document.createElement("option");y.setAttribute("value",-"custom");mxUtils.write(y,mxResources.get("custom")+"...");u.appendChild(y);k.appendChild(u);c.appendChild(k);mxEvent.addListener(u,"change",mxUtils.bind(this,function(){if("custom"==u.value){var E=new FilenameDialog(this,t,mxResources.get("ok"),function(I){null!=I?(t=I,y.setAttribute("title",I),u.setAttribute("title",I)):(u.value="blank",y.removeAttribute("title"),u.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){u.value="blank"});this.showDialog(E.container,300,+this.addCheckbox(n,mxResources.get("edit")+":",!0,null,!0);q.style.marginTop="0px";k.appendChild(n);n=this.getCurrentFile();var t="";null!=n&&n.getMode()!=App.MODE_DEVICE&&n.getMode()!=App.MODE_BROWSER&&(t=window.location.href);var u=document.createElement("select");u.style.maxWidth="200px";u.className="geBtn";n=document.createElement("option");n.setAttribute("value","blank");mxUtils.write(n,mxResources.get("makeCopy"));u.appendChild(n);var B=document.createElement("option");B.setAttribute("value",+"custom");mxUtils.write(B,mxResources.get("custom")+"...");u.appendChild(B);k.appendChild(u);c.appendChild(k);mxEvent.addListener(u,"change",mxUtils.bind(this,function(){if("custom"==u.value){var E=new FilenameDialog(this,t,mxResources.get("ok"),function(I){null!=I?(t=I,B.setAttribute("title",I),u.setAttribute("title",I)):(u.value="blank",B.removeAttribute("title"),u.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){u.value="blank"});this.showDialog(E.container,300,80,!0,!1);E.init()}else u.removeAttribute("title")}));mxEvent.addListener(q,"change",mxUtils.bind(this,function(){q.checked&&(null==f||f.checked)?u.removeAttribute("disabled"):u.setAttribute("disabled","disabled")}));return{getLink:function(){return q.checked?"blank"===u.value?"_blank":t:null},getEditInput:function(){return q},getEditSelect:function(){return u},getEditRow:function(){return k}}};EditorUi.prototype.addLinkSection=function(c,f){function k(){var E=document.createElement("div");E.style.width=-"100%";E.style.height="100%";E.style.boxSizing="border-box";null!=u&&u!=mxConstants.NONE?(E.style.border="1px solid black",E.style.backgroundColor=u):(E.style.backgroundPosition="center center",E.style.backgroundRepeat="no-repeat",E.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");y.innerText="";y.appendChild(E)}var n=document.createElement("div");n.className="geDialogFormRow";var q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("links")++"100%";E.style.height="100%";E.style.boxSizing="border-box";null!=u&&u!=mxConstants.NONE?(E.style.border="1px solid black",E.style.backgroundColor=u):(E.style.backgroundPosition="center center",E.style.backgroundRepeat="no-repeat",E.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");B.innerText="";B.appendChild(E)}var n=document.createElement("div");n.className="geDialogFormRow";var q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("links")+":");n.appendChild(q);var t=document.createElement("select");t.style.width="100px";t.style.padding="0px";t.style.marginRight="10px";t.className="geBtn";q=document.createElement("option");q.setAttribute("value","auto");mxUtils.write(q,mxResources.get("automatic"));t.appendChild(q);q=document.createElement("option");q.setAttribute("value","blank");mxUtils.write(q,mxResources.get("openInNewWindow"));t.appendChild(q);q=document.createElement("option");q.setAttribute("value","self");mxUtils.write(q,mxResources.get("openInThisWindow"));-t.appendChild(q);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),t.appendChild(f));n.appendChild(t);f=document.createElement("span");mxUtils.write(f,mxResources.get("borderColor")+":");n.appendChild(f);var u="#0000ff",y=null;y=mxUtils.button("",mxUtils.bind(this,function(E){this.pickColor(u||"none",function(I){u=I;k()});mxEvent.consume(E)}));k();y.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":-"4px";y.style.marginLeft="4px";y.style.height="22px";y.style.width="22px";y.style.position="relative";y.style.top="1px";y.className="geColorBtn";n.appendChild(y);c.appendChild(n);return{getColor:function(){return u},getTarget:function(){return t.value},focus:function(){t.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,k,n,q,t,u,y){t=null!=t?t:[];k&&(t.push("lightbox=1"),"auto"!=c&&t.push("target="+c),null!=f&&f!=mxConstants.NONE&&t.push("highlight="+("#"==f.charAt(0)?f.substring(1):-f)),null!=n&&0<n.length&&t.push("edit="+encodeURIComponent(n)),q&&t.push("layers=1"),u&&t.push("link-icons=1"),y&&t.push("tooltip-icons=1"),this.editor.graph.foldingEnabled&&t.push("nav=1"));return t};EditorUi.prototype.createLink=function(c,f,k,n,q,t,u,y,E,I,C,U,J,S,N){var R=this.getCurrentFile();E=this.createUrlParameters(c,f,n,q,t,E,S,N);c=!0;null!=u?k="#U"+encodeURIComponent(u):y||null==R||""==R.getHash()?k="#R"+encodeURIComponent(k?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):-Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(k="#"+R.getHash(),c=!1);c&&null!=R&&null!=R.getTitle()&&R.getTitle()!=this.defaultFilename&&E.push("title="+encodeURIComponent(R.getTitle()));I&&1<k.length&&(E.push("open="+k.substring(1)),k="");I=1==C?this.currentPage:C;null!=I&&"function"===typeof I.getId&&E.push("page-id="+I.getId());U&&E.push("transparent=1");null!=J&&E.push("dark="+J);return(n&&(null!=u||null!=R&&R.getMode()!=App.MODE_GITHUB&&R.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:-mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<E.length?"?"+E.join("&"):"")+k};EditorUi.prototype.createHtml=function(c,f,k,n,q,t,u,y,E,I,C,U,J,S,N,R){this.getBasenames();var T={};N&&(T["show-link-icons"]=!0);R&&(T["show-tooltip-icons"]=!0);""!=q&&q!=mxConstants.NONE&&(T.highlight=q);"auto"!==n&&(T.target=n);I||(T.lightbox=!1);T.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==-k||(T.zoom=k/100);k=[];u&&(k.push("pages"),T.resize=!0,null!=this.pages&&null!=this.currentPage&&(T.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(k.push("zoom"),T.resize=!0);y&&k.push("layers");E&&(k.push("tags"),S&&(f=this.getHiddenTagsMap(),null!=f&&(T.hiddenTags=f)));null!=J&&(T["dark-mode"]=J);0<k.length&&(I&&k.push("lightbox"),T.toolbar=k.join(" "));null!=C&&0<C.length&&(T.edit=C);null!=c?T.url=c:T.xml=this.getFileData(!0,null,null,null,null,!u);t='<div class="mxgraph" style="'+(t?+t.appendChild(q);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),t.appendChild(f));n.appendChild(t);f=document.createElement("span");mxUtils.write(f,mxResources.get("borderColor")+":");n.appendChild(f);var u="#0000ff",B=null;B=mxUtils.button("",mxUtils.bind(this,function(E){this.pickColor(u||"none",function(I){u=I;k()});mxEvent.consume(E)}));k();B.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":+"4px";B.style.marginLeft="4px";B.style.height="22px";B.style.width="22px";B.style.position="relative";B.style.top="1px";B.className="geColorBtn";n.appendChild(B);c.appendChild(n);return{getColor:function(){return u},getTarget:function(){return t.value},focus:function(){t.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,k,n,q,t,u,B){t=null!=t?t:[];k&&(t.push("lightbox=1"),"auto"!=c&&t.push("target="+c),null!=f&&f!=mxConstants.NONE&&t.push("highlight="+("#"==f.charAt(0)?f.substring(1):+f)),null!=n&&0<n.length&&t.push("edit="+encodeURIComponent(n)),q&&t.push("layers=1"),u&&t.push("link-icons=1"),B&&t.push("tooltip-icons=1"),this.editor.graph.foldingEnabled&&t.push("nav=1"));return t};EditorUi.prototype.createLink=function(c,f,k,n,q,t,u,B,E,I,C,U,K,S,M){var R=this.getCurrentFile();E=this.createUrlParameters(c,f,n,q,t,E,S,M);c=!0;null!=u?k="#U"+encodeURIComponent(u):B||null==R||""==R.getHash()?k="#R"+encodeURIComponent(k?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):+Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(k="#"+R.getHash(),c=!1);c&&null!=R&&null!=R.getTitle()&&R.getTitle()!=this.defaultFilename&&E.push("title="+encodeURIComponent(R.getTitle()));I&&1<k.length&&(E.push("open="+k.substring(1)),k="");I=1==C?this.currentPage:C;null!=I&&"function"===typeof I.getId&&E.push("page-id="+I.getId());U&&E.push("transparent=1");null!=K&&E.push("dark="+K);return(n&&(null!=u||null!=R&&R.getMode()!=App.MODE_GITHUB&&R.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:+mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<E.length?"?"+E.join("&"):"")+k};EditorUi.prototype.createHtml=function(c,f,k,n,q,t,u,B,E,I,C,U,K,S,M,R){this.getBasenames();var T={};M&&(T["show-link-icons"]=!0);R&&(T["show-tooltip-icons"]=!0);""!=q&&q!=mxConstants.NONE&&(T.highlight=q);"auto"!==n&&(T.target=n);I||(T.lightbox=!1);T.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==+k||(T.zoom=k/100);k=[];u&&(k.push("pages"),T.resize=!0,null!=this.pages&&null!=this.currentPage&&(T.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(k.push("zoom"),T.resize=!0);B&&k.push("layers");E&&(k.push("tags"),S&&(f=this.getHiddenTagsMap(),null!=f&&(T.hiddenTags=f)));null!=K&&(T["dark-mode"]=K);0<k.length&&(I&&k.push("lightbox"),T.toolbar=k.join(" "));null!=C&&0<C.length&&(T.edit=C);null!=c?T.url=c:T.xml=this.getFileData(!0,null,null,null,null,!u);t='<div class="mxgraph" style="'+(t?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(T))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";U(t,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.addPagesRow=function(c){var f=document.createElement("select");f.style.maxWidth="260px";var k=document.createElement("option");mxUtils.write(k,mxResources.get("allPages"));k.setAttribute("value","allPages");f.appendChild(k);k=document.createElement("option");mxUtils.write(k,mxResources.get("currentPage"));k.setAttribute("value","currentPage");f.appendChild(k);k=null;if(null!=this.pages&&1<this.pages.length){k=document.createElement("div");k.className="geDialogFormRow";var n=document.createElement("span");n.className="geDialogFormLabel";mxUtils.write(n,mxResources.get("pages")+":");k.appendChild(n);k.appendChild(f);c.appendChild(k)}return{row:k,select:f}};EditorUi.prototype.showHtmlDialog=function(c,f,k,n){var q=document.createElement("div");q.style.whiteSpace="nowrap";var t=document.createElement("h3");mxUtils.write(t,mxResources.get("html"));q.appendChild(t);var u=document.createElement("select");u.className="geBtn";u.style.margin="0 4px 8px 4px";u.style.width="calc(100% - 8px)";u.style.boxSizing=-"border-box";t=document.createElement("option");mxUtils.write(t,mxResources.get("includeCopyOfMyDiagram"));t.setAttribute("value","copy");u.appendChild(t);t=document.createElement("option");t.setAttribute("value","url");u.appendChild(t);null!=k?(mxUtils.write(t,mxResources.get("publicDiagramUrl")),t.setAttribute("title",k)):(mxUtils.write(t,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),t.setAttribute("disabled","disabled"));q.appendChild(u);mxUtils.br(q);var y=-this.getCurrentFile();if(null==k&&null!=y&&y.constructor==window.DriveFile){t=document.createElement("div");t.style.marginBottom="8px";var E=document.createElement("a");E.style.color="gray";E.style.cursor="pointer";mxUtils.write(E,mxResources.get("share"));t.appendChild(E);mxEvent.addListener(E,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(y.getId(),y)}));q.appendChild(t)}t=document.createElement("div");t.className="geDialogSection";var I=this.addLinkSection(t),-C=this.addPagesRow(t);E=document.createElement("div");E.className="geDialogCheckRow";var U=document.createElement("input");U.setAttribute("type","checkbox");U.setAttribute("checked","checked");U.defaultChecked=!0;U.style.marginRight="8px";E.appendChild(U);var J=document.createElement("label");mxUtils.write(J,mxResources.get("zoom")+":");E.appendChild(J);var S=document.createElement("input");S.setAttribute("type","text");S.style.width="60px";S.style.marginLeft="4px";S.value="100%";E.appendChild(S);-t.appendChild(E);var N=this.addCheckbox(t,mxResources.get("fit"),!0,null,null,null,null,null,!0),R=this.addCheckbox(t,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);q.appendChild(t);t=this.addAdvancedSection(q).content;var T=document.createElement("select");T.style.maxWidth="260px";E=document.createElement("option");E.setAttribute("value","light");mxUtils.write(E,mxResources.get("light"));T.appendChild(E);E=document.createElement("option");E.setAttribute("value","dark");mxUtils.write(E,-mxResources.get("dark"));T.appendChild(E);E=document.createElement("option");E.setAttribute("value","auto");mxUtils.write(E,mxResources.get("automatic"));E.setAttribute("selected","selected");T.appendChild(E);E=document.createElement("div");E.className="geDialogFormRow";J=document.createElement("span");J.className="geDialogFormLabel";mxUtils.write(J,mxResources.get("appearance")+":");E.appendChild(J);E.appendChild(T);t.appendChild(E);var v=null;if(EditorUi.enableHtmlEditOption){v=this.addEditButton(t,-R);var d=v.getEditInput();mxEvent.addListener(R,"change",function(){R.checked?d.removeAttribute("disabled"):d.setAttribute("disabled","disabled");d.checked&&R.checked?v.getEditSelect().removeAttribute("disabled"):v.getEditSelect().setAttribute("disabled","disabled")})}var m=this.addCheckbox(t,mxResources.get("layers"),!0,null,null,null,null,null,!0),r=this.addCheckbox(t,mxResources.get("tags"),!0,null,null,null,null,null,!0),A=this.addCheckbox(t,mxResources.get("useCurrentSettings"),!0,null,null,-null,null,null,!0);A.checkRow.style.paddingLeft="24px";var D=this.addCheckbox(t,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),G=this.addCheckbox(t,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(r,"change",function(){r.checked?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled")});mxEvent.addListener(R,"change",function(){R.checked?(D.removeAttribute("disabled"),G.removeAttribute("disabled")):(D.setAttribute("disabled","disabled"),-G.setAttribute("disabled","disabled"))});c=new CustomDialog(this,q,mxUtils.bind(this,function(){n("url"==u.value?k:null,U.checked,S.value,I.getTarget(),I.getColor(),N.checked,null!=C.row&&"allPages"==C.select.value,m.checked,r.checked,R.checked,null!=v?v.getLink():null,null!=T?T.value:null,r.checked&&A.checked,D.checked,G.checked)}),null,c,f);this.showDialog(c.container,360,null,!0,!0);u.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,f,k,n,q,t,u,y,E,I,C,U){var J=document.createElement("div");-J.style.whiteSpace="nowrap";var S=document.createElement("h3");mxUtils.write(S,c||mxResources.get("publish"));J.appendChild(S);var N=document.createElement("select");N.className="geBtn";N.style.margin="0 4px 8px 4px";N.style.width="calc(100% - 8px)";N.style.boxSizing="border-box";q=null!=q?q:"https://www.drawio.com/docs/manual/export/publish-link/";c=document.createElement("option");mxUtils.write(c,mxResources.get("includeCopyOfMyDiagram"));c.setAttribute("value","copy");N.appendChild(c);c=document.createElement("option");-mxUtils.write(c,mxResources.get("authorizationRequired"));c.setAttribute("value","auth");N.appendChild(c);null==y||""==y.getHash()||y.getMode()==App.MODE_DEVICE||y.getMode()==App.MODE_BROWSER?c.setAttribute("disabled","disabled"):N.value="auth";y=document.createElement("option");y.setAttribute("value","public");N.appendChild(y);null!=u?(mxUtils.write(y,mxResources.get("publicDiagramUrl")),y.setAttribute("title",u),N.value="public"):(mxUtils.write(y,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+-")"),y.setAttribute("disabled","disabled"));J.appendChild(N);mxUtils.br(J);u=document.createElement("div");u.className="geDialogSection";var R=null,T=null;if(null!=f||null!=k)f=document.createElement("div"),f.className="geDialogInlineFields",y=document.createElement("div"),y.className="geDialogInlineField",c=document.createElement("label"),mxUtils.write(c,mxResources.get("width")+":"),y.appendChild(c),R=document.createElement("input"),R.setAttribute("type","text"),R.value="100%",y.appendChild(R),-f.appendChild(y),y=document.createElement("div"),y.className="geDialogInlineField",c=document.createElement("label"),mxUtils.write(c,mxResources.get("height")+":"),y.appendChild(c),T=document.createElement("input"),T.setAttribute("type","text"),T.value=k+"px",y.appendChild(T),f.appendChild(y),u.appendChild(f);var v=this.addLinkSection(u,n),d=I?this.addCheckbox(u,mxResources.get("transparentBackground"),!1,null,null,null,null,null,!0):null,m=this.addPagesRow(u),r=m.select;null==m.row||U||(k=function(){m.row.style.display=-"copy"==N.value?"":"none"},mxEvent.addListener(N,"change",k),k());var A=null;if(null!=this.pages&&1<this.pages.length){k=document.createElement("div");k.className="geDialogFormRow";I=document.createElement("span");I.className="geDialogFormLabel";mxUtils.write(I,mxResources.get("initialPage",null,"Initial Page")+":");k.appendChild(I);A=document.createElement("select");A.style.maxWidth="260px";for(I=0;I<this.pages.length;I++)U=document.createElement("option"),mxUtils.write(U,this.pages[I].getName()),-U.setAttribute("value",I),this.pages[I]==this.currentPage&&U.setAttribute("selected","selected"),A.appendChild(U);k.appendChild(A);u.appendChild(k);k=function(){"none"!=m.row.style.display&&"currentPage"==r.value?A.setAttribute("disabled","disabled"):A.removeAttribute("disabled")};mxEvent.addListener(r,"change",k);mxEvent.addListener(N,"change",k);k()}var D=this.addCheckbox(u,mxResources.get("lightbox"),!0,null,null,!n,null,null,!0);n&&null!=D.checkRow&&(D.checkRow.style.display="none");J.appendChild(u);-n=this.addAdvancedSection(J).content;var G=document.createElement("select");G.style.maxWidth="260px";k=document.createElement("option");k.setAttribute("value","0");mxUtils.write(k,mxResources.get("light"));G.appendChild(k);k=document.createElement("option");k.setAttribute("value","1");mxUtils.write(k,mxResources.get("dark"));G.appendChild(k);k=document.createElement("option");k.setAttribute("value","auto");mxUtils.write(k,mxResources.get("automatic"));k.setAttribute("selected","selected");G.appendChild(k);-C&&(C=document.createElement("div"),C.className="geDialogFormRow",k=document.createElement("span"),k.className="geDialogFormLabel",mxUtils.write(k,mxResources.get("appearance")+":"),C.appendChild(k),C.appendChild(G),n.appendChild(C));var O=this.addEditButton(n,D),P=O.getEditInput(),V=this.addCheckbox(n,mxResources.get("layers"),!0,null,null,null,null,null,!0),Y=this.addCheckbox(n,mxResources.get("tags"),!0,null,null,null,null,null,!0),H=this.addCheckbox(n,mxResources.get("useCurrentSettings"),!0,-null,null,null,null,null,!0);H.checkRow.style.paddingLeft="24px";var W=this.addCheckbox(n,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),Z=this.addCheckbox(n,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(Y,"change",function(){Y.checked?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled")});mxEvent.addListener(D,"change",function(){D.checked?(V.removeAttribute("disabled"),P.removeAttribute("disabled"),Y.removeAttribute("disabled"),-W.removeAttribute("disabled"),Z.removeAttribute("disabled"),Y.checked&&H.removeAttribute("disabled")):(V.setAttribute("disabled","disabled"),P.setAttribute("disabled","disabled"),Y.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),W.setAttribute("disabled","disabled"),Z.setAttribute("disabled","disabled"));P.checked&&D.checked?O.getEditSelect().removeAttribute("disabled"):O.getEditSelect().setAttribute("disabled","disabled")});q=new CustomDialog(this,J,mxUtils.bind(this,function(){E(v.getTarget(),-v.getColor(),null==A||0>=A.selectedIndex||null!=A.getAttribute("disabled")?null:this.pages[A.selectedIndex],D.checked,O.getLink(),V.checked,null!=R?R.value:null,null!=T?T.value:null,Y.checked,N.value,null!=d?d.checked:!1,G.value,"allPages"==r.value,Y.checked&&H.checked,W.checked,Z.checked)}),null,mxResources.get("create"),q,t);this.showDialog(q.container,360,null,!0,!0);null!=R?(R.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?R.select():document.execCommand("selectAll",!1,null)):-N.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,k,n,q){var t=document.createElement("div");t.style.whiteSpace="nowrap";var u=document.createElement("h3");mxUtils.write(u,mxResources.get("image"));t.appendChild(u);if(q){u=document.createElement("div");u.className="geDialogSection";var y=document.createElement("div");y.className="geDialogFormRow";var E=document.createElement("span");E.className="geDialogFormLabel";mxUtils.write(E,mxResources.get("zoom")+":");y.appendChild(E);var I=-document.createElement("input");I.setAttribute("type","text");I.value=this.lastExportZoom||"100%";y.appendChild(I);u.appendChild(y);y=document.createElement("div");y.className="geDialogFormRow";E=document.createElement("span");E.className="geDialogFormLabel";mxUtils.write(E,mxResources.get("borderWidth")+":");y.appendChild(E);var C=document.createElement("input");C.setAttribute("type","text");C.value=this.lastExportBorder||"0";y.appendChild(C);u.appendChild(y);t.appendChild(u)}u=document.createElement("div");-u.className="geDialogSection";var U=this.addCheckbox(u,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!this.editor.graph.isSelectionEmpty(),this.editor.graph.isSelectionEmpty(),null,null,null,null,!0),J=n?null:this.addCheckbox(u,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram,null,null,null,null,null,!0);y=this.editor.graph;var S=y.background==mxConstants.NONE||null==y.background,N=n?null:this.addCheckbox(u,mxResources.get("transparentBackground"),null!=this.lastExportTransparent?-this.lastExportTransparent:S,null,null,null,null,null,!0);t.appendChild(u);c=new CustomDialog(this,t,mxUtils.bind(this,function(){this.lastExportSelectionOnly=U.checked;q&&(this.lastExportZoom=I.value,this.lastExportBorder=C.value);null!=N&&(this.lastExportTransparent=N.checked==S?null:N.checked);var R=parseInt(I.value)/100||1,T=parseInt(C.value)||0;k(!U.checked,null!=J?J.checked:!1,null!=N?N.checked:!1,R,T)}),null,c,f);this.showDialog(c.container,340,null,!0,!0)};EditorUi.prototype.showExportDialog=-function(c,f,k,n,q,t,u,y,E){function I(){return Math.max(0,parseFloat(R.value)||100)/100}function C(){var Ea=I();ea.value=Math.floor(Z*Ea);aa.value=Math.floor(X*Ea)}u=null!=u?u:Editor.defaultIncludeDiagram;var U=document.createElement("div");U.style.whiteSpace="nowrap";var J=this.editor.graph,S=document.createElement("h3");mxUtils.write(S,c);U.appendChild(S);c=document.createElement("div");c.className="geDialogSection";S=document.createElement("div");S.className="geDialogFormRow";var N=document.createElement("span");-N.className="geDialogFormLabel";mxUtils.write(N,mxResources.get("zoom")+":");S.appendChild(N);var R=document.createElement("input");R.setAttribute("type","text");R.value=this.lastExportZoom||"100%";S.appendChild(R);c.appendChild(S);U.appendChild(c);c=document.createElement("div");c.className="geDialogSection";var T=this.addCheckbox(c,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!J.isSelectionEmpty(),J.isSelectionEmpty(),null,null,null,null,!0),v=document.createElement("input");v.setAttribute("disabled",-"disabled");v.setAttribute("type","checkbox");var d=document.createElement("select");d.style.marginLeft="8px";var m=["selectionOnly","diagram","page"];S={};for(N=0;N<m.length;N++)if(!J.isSelectionEmpty()||"selectionOnly"!=m[N]){var r=document.createElement("option");mxUtils.write(r,mxResources.get(m[N]));r.setAttribute("value",m[N]);d.appendChild(r);S[m[N]]=r}E?(N=document.createElement("div"),N.className="geDialogFormRow",t=document.createElement("span"),t.className="geDialogFormLabel",mxUtils.write(t,-mxResources.get("size")+":"),N.appendChild(t),d.style.marginLeft="0",N.appendChild(d),c.appendChild(N),mxEvent.addListener(d,"change",function(){"selectionOnly"==d.value&&(T.checked=!0)})):t&&(t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(v),N=document.createElement("label"),mxUtils.write(N,mxResources.get("crop")),t.appendChild(N),c.appendChild(t),mxEvent.addListener(T,"change",function(){T.checked?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled")}));-J.isSelectionEmpty()?E&&null!=T.checkRow&&null!=T.checkRow.parentNode&&T.checkRow.parentNode.removeChild(T.checkRow):(d.value=this.lastExportSelectionOnly?"selectionOnly":"diagram",v.setAttribute("checked","checked"),v.defaultChecked=!0,mxEvent.addListener(T,"change",function(){d.value=T.checked?"selectionOnly":"diagram"}));var A=!J.isSelectionEmpty()&&this.lastExportSelectionOnly?"selectionOnly":"diagram";E&&null!=this.lastExportType&&null!=S[this.lastExportType]&&(d.value=this.lastExportType,"selectionOnly"==-this.lastExportType&&(T.checked=!0));var D="jpeg"!=y&&"webp"!=y,G=this.addCheckbox(c,mxResources.get("transparentBackground"),D&&null!=this.lastExportTransparent?this.lastExportTransparent:!1,null,null,D,null,null,!0);U.appendChild(c);c=document.createElement("div");c.className="geDialogSection";S=!1;t=null!=this.pages?this.pages.length:1;var O=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram")+(1<t?":":""),u,null,null,"jpeg"!=y&&"webp"!=y,null,null,!0);"jpeg"!=y&&"webp"!=y&&(S=!0);var P=-document.createElement("select");P.style.maxWidth="260px";if("png"==y||"svg"==y)u=function(){O.checked?P.removeAttribute("disabled"):P.setAttribute("disabled","disabled")},N=document.createElement("option"),N.setAttribute("value","allPages"),mxUtils.write(N,mxResources.get("allPages")),P.appendChild(N),N=document.createElement("option"),N.setAttribute("value","currentPage"),mxUtils.write(N,mxResources.get("currentPage")),P.appendChild(N),1<t&&(t=document.createElement("div"),t.style.paddingLeft="24px",-t.appendChild(P),c.appendChild(t)),null!=this.lastEmbedInclude&&(P.value=this.lastEmbedInclude),mxEvent.addListener(O,"change",u),u();var V=document.createElement("input");V.setAttribute("type","checkbox");V.id="geCheckbox-"+Editor.guid();var Y=document.createElement("input");Y.setAttribute("type","checkbox");Y.id="geCheckbox-"+Editor.guid();var H=document.createElement("input");H.setAttribute("type","checkbox");H.id="geCheckbox-"+Editor.guid();var W=document.createElement("select");W.style.maxWidth=-"260px";u=document.createElement("option");u.setAttribute("value","auto");mxUtils.write(u,mxResources.get("automatic"));W.appendChild(u);u=document.createElement("option");u.setAttribute("value","blank");mxUtils.write(u,mxResources.get("openInNewWindow"));W.appendChild(u);u=document.createElement("option");u.setAttribute("value","self");mxUtils.write(u,mxResources.get("openInThisWindow"));W.appendChild(u);"svg"==y&&null!=this.lastExportLinkTarget&&(W.value=this.lastExportLinkTarget,0>W.selectedIndex&&-(W.value="auto"));t=document.createElement("div");mxUtils.write(t,mxResources.get("LinksLost"));t.style.margin="7px";t.style.display="none";S&&U.appendChild(c);u=this.addAdvancedSection(U).content;c=J.getGraphBounds();S=J.view.scale;var Z=Math.max(1,Math.ceil(c.width/S)),X=Math.max(1,Math.ceil(c.height/S)),ba=!1;N=document.createElement("div");N.className="geDialogInlineFields";c=document.createElement("div");c.className="geDialogInlineField";S=document.createElement("label");mxUtils.write(S,mxResources.get("width")+-":");c.appendChild(S);var ea=document.createElement("input");ea.setAttribute("type","number");ea.value=Math.floor(Z*I());c.appendChild(ea);N.appendChild(c);c=document.createElement("div");c.className="geDialogInlineField";S=document.createElement("label");mxUtils.write(S,mxResources.get("height")+":");c.appendChild(S);var aa=document.createElement("input");aa.setAttribute("type","number");aa.value=Math.floor(X*I());c.appendChild(aa);N.appendChild(c);u.appendChild(N);mxEvent.addListener(R,"change",-function(){ba=!0;R.value=parseFloat((100*I()).toFixed(2))+"%";C()});mxEvent.addListener(ea,"change",function(){var Ea=parseInt(ea.value)/Z;0<Ea&&(R.value=parseFloat((100*Ea).toFixed(2))+"%",aa.value=Math.floor(X*Ea))});mxEvent.addListener(aa,"change",function(){var Ea=parseInt(aa.value)/X;0<Ea&&(R.value=parseFloat((100*Ea).toFixed(2))+"%",ea.value=Math.floor(Z*Ea))});var ha=document.createElement("select"),na=document.createElement("input");if("png"==y){c=["100","200","300","400"];for(N=0;N<c.length;N++)S=-document.createElement("option"),S.setAttribute("value",c[N]),mxUtils.write(S,c[N]+"dpi"),ha.appendChild(S);c=document.createElement("option");c.setAttribute("value","custom");mxUtils.write(c,mxResources.get("custom"));ha.appendChild(c);na.setAttribute("type","number");na.setAttribute("value","100");na.setAttribute("min","50");na.setAttribute("step","50");na.style.display="none";c=document.createElement("div");c.className="geDialogFormRow";S=document.createElement("span");S.className="geDialogFormLabel";+"border-box";t=document.createElement("option");mxUtils.write(t,mxResources.get("includeCopyOfMyDiagram"));t.setAttribute("value","copy");u.appendChild(t);t=document.createElement("option");t.setAttribute("value","url");u.appendChild(t);null!=k?(mxUtils.write(t,mxResources.get("publicDiagramUrl")),t.setAttribute("title",k)):(mxUtils.write(t,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),t.setAttribute("disabled","disabled"));q.appendChild(u);mxUtils.br(q);var B=+this.getCurrentFile();if(null==k&&null!=B&&B.constructor==window.DriveFile){t=document.createElement("div");t.style.marginBottom="8px";var E=document.createElement("a");E.style.color="gray";E.style.cursor="pointer";mxUtils.write(E,mxResources.get("share"));t.appendChild(E);mxEvent.addListener(E,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(B.getId(),B)}));q.appendChild(t)}t=document.createElement("div");t.className="geDialogSection";var I=this.addLinkSection(t),+C=this.addPagesRow(t);E=document.createElement("div");E.className="geDialogCheckRow";var U=document.createElement("input");U.setAttribute("type","checkbox");U.setAttribute("checked","checked");U.defaultChecked=!0;U.style.marginRight="8px";E.appendChild(U);var K=document.createElement("label");mxUtils.write(K,mxResources.get("zoom")+":");E.appendChild(K);var S=document.createElement("input");S.setAttribute("type","text");S.style.width="60px";S.style.marginLeft="4px";S.value="100%";E.appendChild(S);+t.appendChild(E);var M=this.addCheckbox(t,mxResources.get("fit"),!0,null,null,null,null,null,!0),R=this.addCheckbox(t,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);q.appendChild(t);t=this.addAdvancedSection(q).content;var T=document.createElement("select");T.style.maxWidth="260px";E=document.createElement("option");E.setAttribute("value","light");mxUtils.write(E,mxResources.get("light"));T.appendChild(E);E=document.createElement("option");E.setAttribute("value","dark");mxUtils.write(E,+mxResources.get("dark"));T.appendChild(E);E=document.createElement("option");E.setAttribute("value","auto");mxUtils.write(E,mxResources.get("automatic"));E.setAttribute("selected","selected");T.appendChild(E);E=document.createElement("div");E.className="geDialogFormRow";K=document.createElement("span");K.className="geDialogFormLabel";mxUtils.write(K,mxResources.get("appearance")+":");E.appendChild(K);E.appendChild(T);t.appendChild(E);var v=null;if(EditorUi.enableHtmlEditOption){v=this.addEditButton(t,+R);var d=v.getEditInput();mxEvent.addListener(R,"change",function(){R.checked?d.removeAttribute("disabled"):d.setAttribute("disabled","disabled");d.checked&&R.checked?v.getEditSelect().removeAttribute("disabled"):v.getEditSelect().setAttribute("disabled","disabled")})}var m=this.addCheckbox(t,mxResources.get("layers"),!0,null,null,null,null,null,!0),r=this.addCheckbox(t,mxResources.get("tags"),!0,null,null,null,null,null,!0),z=this.addCheckbox(t,mxResources.get("useCurrentSettings"),!0,null,null,+null,null,null,!0);z.checkRow.style.paddingLeft="24px";var D=this.addCheckbox(t,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),F=this.addCheckbox(t,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(r,"change",function(){r.checked?z.removeAttribute("disabled"):z.setAttribute("disabled","disabled")});mxEvent.addListener(R,"change",function(){R.checked?(D.removeAttribute("disabled"),F.removeAttribute("disabled")):(D.setAttribute("disabled","disabled"),+F.setAttribute("disabled","disabled"))});c=new CustomDialog(this,q,mxUtils.bind(this,function(){n("url"==u.value?k:null,U.checked,S.value,I.getTarget(),I.getColor(),M.checked,null!=C.row&&"allPages"==C.select.value,m.checked,r.checked,R.checked,null!=v?v.getLink():null,null!=T?T.value:null,r.checked&&z.checked,D.checked,F.checked)}),null,c,f);this.showDialog(c.container,360,null,!0,!0);u.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,f,k,n,q,t,u,B,E,I,C,U){var K=document.createElement("div");+K.style.whiteSpace="nowrap";var S=document.createElement("h3");mxUtils.write(S,c||mxResources.get("publish"));K.appendChild(S);var M=document.createElement("select");M.className="geBtn";M.style.margin="0 4px 8px 4px";M.style.width="calc(100% - 8px)";M.style.boxSizing="border-box";q=null!=q?q:"https://www.drawio.com/docs/manual/export/publish-link/";c=document.createElement("option");mxUtils.write(c,mxResources.get("includeCopyOfMyDiagram"));c.setAttribute("value","copy");M.appendChild(c);c=document.createElement("option");+mxUtils.write(c,mxResources.get("authorizationRequired"));c.setAttribute("value","auth");M.appendChild(c);null==B||""==B.getHash()||B.getMode()==App.MODE_DEVICE||B.getMode()==App.MODE_BROWSER?c.setAttribute("disabled","disabled"):M.value="auth";B=document.createElement("option");B.setAttribute("value","public");M.appendChild(B);null!=u?(mxUtils.write(B,mxResources.get("publicDiagramUrl")),B.setAttribute("title",u),M.value="public"):(mxUtils.write(B,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")++")"),B.setAttribute("disabled","disabled"));K.appendChild(M);mxUtils.br(K);u=document.createElement("div");u.className="geDialogSection";var R=null,T=null;if(null!=f||null!=k)f=document.createElement("div"),f.className="geDialogInlineFields",B=document.createElement("div"),B.className="geDialogInlineField",c=document.createElement("label"),mxUtils.write(c,mxResources.get("width")+":"),B.appendChild(c),R=document.createElement("input"),R.setAttribute("type","text"),R.value="100%",B.appendChild(R),+f.appendChild(B),B=document.createElement("div"),B.className="geDialogInlineField",c=document.createElement("label"),mxUtils.write(c,mxResources.get("height")+":"),B.appendChild(c),T=document.createElement("input"),T.setAttribute("type","text"),T.value=k+"px",B.appendChild(T),f.appendChild(B),u.appendChild(f);var v=this.addLinkSection(u,n),d=I?this.addCheckbox(u,mxResources.get("transparentBackground"),!1,null,null,null,null,null,!0):null,m=this.addPagesRow(u),r=m.select;null==m.row||U||(k=function(){m.row.style.display=+"copy"==M.value?"":"none"},mxEvent.addListener(M,"change",k),k());var z=null;if(null!=this.pages&&1<this.pages.length){k=document.createElement("div");k.className="geDialogFormRow";I=document.createElement("span");I.className="geDialogFormLabel";mxUtils.write(I,mxResources.get("initialPage",null,"Initial Page")+":");k.appendChild(I);z=document.createElement("select");z.style.maxWidth="260px";for(I=0;I<this.pages.length;I++)U=document.createElement("option"),mxUtils.write(U,this.pages[I].getName()),+U.setAttribute("value",I),this.pages[I]==this.currentPage&&U.setAttribute("selected","selected"),z.appendChild(U);k.appendChild(z);u.appendChild(k);k=function(){"none"!=m.row.style.display&&"currentPage"==r.value?z.setAttribute("disabled","disabled"):z.removeAttribute("disabled")};mxEvent.addListener(r,"change",k);mxEvent.addListener(M,"change",k);k()}var D=this.addCheckbox(u,mxResources.get("lightbox"),!0,null,null,!n,null,null,!0);n&&null!=D.checkRow&&(D.checkRow.style.display="none");K.appendChild(u);+n=this.addAdvancedSection(K).content;var F=document.createElement("select");F.style.maxWidth="260px";k=document.createElement("option");k.setAttribute("value","0");mxUtils.write(k,mxResources.get("light"));F.appendChild(k);k=document.createElement("option");k.setAttribute("value","1");mxUtils.write(k,mxResources.get("dark"));F.appendChild(k);k=document.createElement("option");k.setAttribute("value","auto");mxUtils.write(k,mxResources.get("automatic"));k.setAttribute("selected","selected");F.appendChild(k);+C&&(C=document.createElement("div"),C.className="geDialogFormRow",k=document.createElement("span"),k.className="geDialogFormLabel",mxUtils.write(k,mxResources.get("appearance")+":"),C.appendChild(k),C.appendChild(F),n.appendChild(C));var N=this.addEditButton(n,D),P=N.getEditInput(),V=this.addCheckbox(n,mxResources.get("layers"),!0,null,null,null,null,null,!0),X=this.addCheckbox(n,mxResources.get("tags"),!0,null,null,null,null,null,!0),H=this.addCheckbox(n,mxResources.get("useCurrentSettings"),!0,+null,null,null,null,null,!0);H.checkRow.style.paddingLeft="24px";var W=this.addCheckbox(n,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),Z=this.addCheckbox(n,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(X,"change",function(){X.checked?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled")});mxEvent.addListener(D,"change",function(){D.checked?(V.removeAttribute("disabled"),P.removeAttribute("disabled"),X.removeAttribute("disabled"),+W.removeAttribute("disabled"),Z.removeAttribute("disabled"),X.checked&&H.removeAttribute("disabled")):(V.setAttribute("disabled","disabled"),P.setAttribute("disabled","disabled"),X.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),W.setAttribute("disabled","disabled"),Z.setAttribute("disabled","disabled"));P.checked&&D.checked?N.getEditSelect().removeAttribute("disabled"):N.getEditSelect().setAttribute("disabled","disabled")});q=new CustomDialog(this,K,mxUtils.bind(this,function(){E(v.getTarget(),+v.getColor(),null==z||0>=z.selectedIndex||null!=z.getAttribute("disabled")?null:this.pages[z.selectedIndex],D.checked,N.getLink(),V.checked,null!=R?R.value:null,null!=T?T.value:null,X.checked,M.value,null!=d?d.checked:!1,F.value,"allPages"==r.value,X.checked&&H.checked,W.checked,Z.checked)}),null,mxResources.get("create"),q,t);this.showDialog(q.container,360,null,!0,!0);null!=R?(R.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?R.select():document.execCommand("selectAll",!1,null)):+M.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,k,n,q){var t=document.createElement("div");t.style.whiteSpace="nowrap";var u=document.createElement("h3");mxUtils.write(u,mxResources.get("image"));t.appendChild(u);if(q){u=document.createElement("div");u.className="geDialogSection";var B=document.createElement("div");B.className="geDialogFormRow";var E=document.createElement("span");E.className="geDialogFormLabel";mxUtils.write(E,mxResources.get("zoom")+":");B.appendChild(E);var I=+document.createElement("input");I.setAttribute("type","text");I.value=this.lastExportZoom||"100%";B.appendChild(I);u.appendChild(B);B=document.createElement("div");B.className="geDialogFormRow";E=document.createElement("span");E.className="geDialogFormLabel";mxUtils.write(E,mxResources.get("borderWidth")+":");B.appendChild(E);var C=document.createElement("input");C.setAttribute("type","text");C.value=this.lastExportBorder||"0";B.appendChild(C);u.appendChild(B);t.appendChild(u)}u=document.createElement("div");+u.className="geDialogSection";var U=this.addCheckbox(u,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!this.editor.graph.isSelectionEmpty(),this.editor.graph.isSelectionEmpty(),null,null,null,null,!0),K=n?null:this.addCheckbox(u,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram,null,null,null,null,null,!0);B=this.editor.graph;var S=B.background==mxConstants.NONE||null==B.background,M=n?null:this.addCheckbox(u,mxResources.get("transparentBackground"),null!=this.lastExportTransparent?+this.lastExportTransparent:S,null,null,null,null,null,!0);t.appendChild(u);c=new CustomDialog(this,t,mxUtils.bind(this,function(){this.lastExportSelectionOnly=U.checked;q&&(this.lastExportZoom=I.value,this.lastExportBorder=C.value);null!=M&&(this.lastExportTransparent=M.checked==S?null:M.checked);var R=parseInt(I.value)/100||1,T=parseInt(C.value)||0;k(!U.checked,null!=K?K.checked:!1,null!=M?M.checked:!1,R,T)}),null,c,f);this.showDialog(c.container,340,null,!0,!0)};EditorUi.prototype.showExportDialog=+function(c,f,k,n,q,t,u,B,E){function I(){return Math.max(0,parseFloat(R.value)||100)/100}function C(){var Ea=I();ea.value=Math.floor(Z*Ea);aa.value=Math.floor(Y*Ea)}u=null!=u?u:Editor.defaultIncludeDiagram;var U=document.createElement("div");U.style.whiteSpace="nowrap";var K=this.editor.graph,S=document.createElement("h3");mxUtils.write(S,c);U.appendChild(S);c=document.createElement("div");c.className="geDialogSection";S=document.createElement("div");S.className="geDialogFormRow";var M=document.createElement("span");+M.className="geDialogFormLabel";mxUtils.write(M,mxResources.get("zoom")+":");S.appendChild(M);var R=document.createElement("input");R.setAttribute("type","text");R.value=this.lastExportZoom||"100%";S.appendChild(R);c.appendChild(S);U.appendChild(c);c=document.createElement("div");c.className="geDialogSection";var T=this.addCheckbox(c,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!K.isSelectionEmpty(),K.isSelectionEmpty(),null,null,null,null,!0),v=document.createElement("input");v.setAttribute("disabled",+"disabled");v.setAttribute("type","checkbox");var d=document.createElement("select");d.style.marginLeft="8px";var m=["selectionOnly","diagram","page"];S={};for(M=0;M<m.length;M++)if(!K.isSelectionEmpty()||"selectionOnly"!=m[M]){var r=document.createElement("option");mxUtils.write(r,mxResources.get(m[M]));r.setAttribute("value",m[M]);d.appendChild(r);S[m[M]]=r}E?(M=document.createElement("div"),M.className="geDialogFormRow",t=document.createElement("span"),t.className="geDialogFormLabel",mxUtils.write(t,+mxResources.get("size")+":"),M.appendChild(t),d.style.marginLeft="0",M.appendChild(d),c.appendChild(M),mxEvent.addListener(d,"change",function(){"selectionOnly"==d.value&&(T.checked=!0)})):t&&(t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(v),M=document.createElement("label"),mxUtils.write(M,mxResources.get("crop")),t.appendChild(M),c.appendChild(t),mxEvent.addListener(T,"change",function(){T.checked?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled")}));+K.isSelectionEmpty()?E&&null!=T.checkRow&&null!=T.checkRow.parentNode&&T.checkRow.parentNode.removeChild(T.checkRow):(d.value=this.lastExportSelectionOnly?"selectionOnly":"diagram",v.setAttribute("checked","checked"),v.defaultChecked=!0,mxEvent.addListener(T,"change",function(){d.value=T.checked?"selectionOnly":"diagram"}));var z=!K.isSelectionEmpty()&&this.lastExportSelectionOnly?"selectionOnly":"diagram";E&&null!=this.lastExportType&&null!=S[this.lastExportType]&&(d.value=this.lastExportType,"selectionOnly"==+this.lastExportType&&(T.checked=!0));var D="jpeg"!=B&&"webp"!=B,F=this.addCheckbox(c,mxResources.get("transparentBackground"),D&&null!=this.lastExportTransparent?this.lastExportTransparent:!1,null,null,D,null,null,!0);U.appendChild(c);c=document.createElement("div");c.className="geDialogSection";S=!1;t=null!=this.pages?this.pages.length:1;var N=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram")+(1<t?":":""),u,null,null,"jpeg"!=B&&"webp"!=B,null,null,!0);"jpeg"!=B&&"webp"!=B&&(S=!0);var P=+document.createElement("select");P.style.maxWidth="260px";if("png"==B||"svg"==B)u=function(){N.checked?P.removeAttribute("disabled"):P.setAttribute("disabled","disabled")},M=document.createElement("option"),M.setAttribute("value","allPages"),mxUtils.write(M,mxResources.get("allPages")),P.appendChild(M),M=document.createElement("option"),M.setAttribute("value","currentPage"),mxUtils.write(M,mxResources.get("currentPage")),P.appendChild(M),1<t&&(t=document.createElement("div"),t.style.paddingLeft="24px",+t.appendChild(P),c.appendChild(t)),null!=this.lastEmbedInclude&&(P.value=this.lastEmbedInclude),mxEvent.addListener(N,"change",u),u();var V=document.createElement("input");V.setAttribute("type","checkbox");V.id="geCheckbox-"+Editor.guid();var X=document.createElement("input");X.setAttribute("type","checkbox");X.id="geCheckbox-"+Editor.guid();var H=document.createElement("input");H.setAttribute("type","checkbox");H.id="geCheckbox-"+Editor.guid();var W=document.createElement("select");W.style.maxWidth=+"260px";u=document.createElement("option");u.setAttribute("value","auto");mxUtils.write(u,mxResources.get("automatic"));W.appendChild(u);u=document.createElement("option");u.setAttribute("value","blank");mxUtils.write(u,mxResources.get("openInNewWindow"));W.appendChild(u);u=document.createElement("option");u.setAttribute("value","self");mxUtils.write(u,mxResources.get("openInThisWindow"));W.appendChild(u);"svg"==B&&null!=this.lastExportLinkTarget&&(W.value=this.lastExportLinkTarget,0>W.selectedIndex&&+(W.value="auto"));t=document.createElement("div");mxUtils.write(t,mxResources.get("LinksLost"));t.style.margin="7px";t.style.display="none";S&&U.appendChild(c);u=this.addAdvancedSection(U).content;c=K.getGraphBounds();S=K.view.scale;var Z=Math.max(1,Math.ceil(c.width/S)),Y=Math.max(1,Math.ceil(c.height/S)),ba=!1;M=document.createElement("div");M.className="geDialogInlineFields";c=document.createElement("div");c.className="geDialogInlineField";S=document.createElement("label");mxUtils.write(S,mxResources.get("width")++":");c.appendChild(S);var ea=document.createElement("input");ea.setAttribute("type","number");ea.value=Math.floor(Z*I());c.appendChild(ea);M.appendChild(c);c=document.createElement("div");c.className="geDialogInlineField";S=document.createElement("label");mxUtils.write(S,mxResources.get("height")+":");c.appendChild(S);var aa=document.createElement("input");aa.setAttribute("type","number");aa.value=Math.floor(Y*I());c.appendChild(aa);M.appendChild(c);u.appendChild(M);mxEvent.addListener(R,"change",+function(){ba=!0;R.value=parseFloat((100*I()).toFixed(2))+"%";C()});mxEvent.addListener(ea,"change",function(){var Ea=parseInt(ea.value)/Z;0<Ea&&(R.value=parseFloat((100*Ea).toFixed(2))+"%",aa.value=Math.floor(Y*Ea))});mxEvent.addListener(aa,"change",function(){var Ea=parseInt(aa.value)/Y;0<Ea&&(R.value=parseFloat((100*Ea).toFixed(2))+"%",ea.value=Math.floor(Z*Ea))});var ha=document.createElement("select"),na=document.createElement("input");if("png"==B){c=["100","200","300","400"];for(M=0;M<c.length;M++)S=+document.createElement("option"),S.setAttribute("value",c[M]),mxUtils.write(S,c[M]+"dpi"),ha.appendChild(S);c=document.createElement("option");c.setAttribute("value","custom");mxUtils.write(c,mxResources.get("custom"));ha.appendChild(c);na.setAttribute("type","number");na.setAttribute("value","100");na.setAttribute("min","50");na.setAttribute("step","50");na.style.display="none";c=document.createElement("div");c.className="geDialogFormRow";S=document.createElement("span");S.className="geDialogFormLabel";mxUtils.write(S,mxResources.get("dpi")+":");c.appendChild(S);c.appendChild(ha);c.appendChild(na);u.appendChild(c);null!=this.lastExportDpi&&(na.value=this.lastExportDpi,ha.value=this.lastExportDpi,0>ha.selectedIndex&&(ha.value="custom",ha.style.display="none",na.style.display=""));mxEvent.addListener(ha,"change",function(){"custom"==ha.value?(ha.style.display="none",na.style.display="",na.focus()):(na.value=ha.value,ba||(R.value=ha.value+"%",C()))});mxEvent.addListener(na,"change",function(){var Ea=parseInt(na.value);isNaN(Ea)||0>=Ea?na.style.backgroundColor="red":(na.style.backgroundColor="",ba||(R.value=Ea+"%",C()))})}c=document.createElement("div");c.className="geDialogFormRow";S=document.createElement("span");S.className="geDialogFormLabel";mxUtils.write(S,mxResources.get("borderWidth")+":");c.appendChild(S);var ra=document.createElement("input");ra.setAttribute("type","text");ra.value=this.lastExportBorder||"0";c.appendChild(ra);u.appendChild(c);var sa=document.createElement("select");-sa.style.maxWidth="260px";c=document.createElement("option");c.setAttribute("value","light");mxUtils.write(c,mxResources.get("light"));sa.appendChild(c);c=document.createElement("option");c.setAttribute("value","dark");mxUtils.write(c,mxResources.get("dark"));sa.appendChild(c);var ua=Editor.isDarkMode()?"dark":"light";"svg"==y&&mxUtils.lightDarkColorSupported&&(c=document.createElement("option"),c.setAttribute("value","auto"),mxUtils.write(c,mxResources.get("automatic")),sa.appendChild(c),ua="auto");-sa.value=null!=this.lastExportTheme?this.lastExportTheme:ua;0>sa.selectedIndex&&(sa.value=ua);c=document.createElement("div");c.className="geDialogFormRow";S=document.createElement("span");S.className="geDialogFormLabel";mxUtils.write(S,mxResources.get("appearance")+":");c.appendChild(S);c.appendChild(sa);u.appendChild(c);"svg"==y&&(c=document.createElement("div"),c.className="geDialogFormRow",S=document.createElement("span"),S.className="geDialogFormLabel",mxUtils.write(S,mxResources.get("links")+-":"),c.appendChild(S),c.appendChild(W),u.appendChild(c),u.appendChild(t));var xa=1==J.shadowVisible,qa=this.addCheckbox(u,mxResources.get("shadow"),null!=this.lastExportShadow?this.lastExportShadow:xa,null,null,null,null,null,!0),Aa=null,Ba="svg"!=y&&(this.isOffline()||!Editor.canvasSupported);if("png"==y||"jpeg"==y||"webp"==y||"svg"==y)Aa=this.addCheckbox(u,mxResources.get("grid"),Ba||null==this.lastExportGrid?!1:this.lastExportGrid,Ba,!1,!0,null,null,!0);f&&(V.checked=null!=this.lastEmbedImages?-this.lastEmbedImages:!0,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(V),J=document.createElement("label"),mxUtils.write(J,mxResources.get("embedImages")),J.setAttribute("for",V.id),t.appendChild(J),u.appendChild(t),Y.checked=null!=this.lastEmbedFonts?this.lastEmbedFonts:Editor.embedSvgFonts,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(Y),J=document.createElement("label"),mxUtils.write(J,mxResources.get("embedFonts")),J.setAttribute("for",-Y.id),t.appendChild(J),u.appendChild(t),H.checked=null!=this.lastEmbedCellMetadata?this.lastEmbedCellMetadata:!1,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(H),J=document.createElement("label"),mxUtils.write(J,mxResources.get("embedCellMetadata")),J.setAttribute("for",H.id),t.appendChild(J),u.appendChild(t));k=new CustomDialog(this,U,mxUtils.bind(this,function(){this.lastExportSelectionOnly=T.checked;this.lastExportBorder=ra.value;this.lastExportZoom=R.value;D&&(this.lastExportTransparent=-0==G.checked?null:G.checked);this.lastExportTheme=sa.value==ua?null:sa.value;this.lastExportShadow=qa.checked==xa?null:qa.checked;null==Aa||Ba||(this.lastExportGrid=Aa.checked?!0:null);"svg"==y&&(this.lastExportLinkTarget="auto"==W.value?null:W.value);if("png"==y){var Ea=parseInt(na.value);this.lastExportDpi=!isNaN(Ea)&&0<Ea&&100!=Ea?Ea:null}E&&(this.lastExportType=d.value==A?null:d.value);f&&(this.lastEmbedImages=V.checked,this.lastEmbedFonts=Y.checked,this.lastEmbedCellMetadata=H.checked);if("png"==-y||"svg"==y)this.lastEmbedInclude=P.value;null!=q&&q(R.value,G.checked,!T.checked,qa.checked,O.checked,V.checked&&f,ra.value,v.checked,("png"==y||"svg"==y)&&"currentPage"==P.value,W.value,null!=Aa?Aa.checked:null,null!=sa?sa.value:null,d.value,Y.checked,H.checked&&f,"png"==y&&0<parseInt(na.value)&&100!=parseInt(na.value)?parseInt(na.value):null)}),null,k,n);this.showDialog(k.container,360,null,!0,!0,null,null,null,null,!0);R.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?R.select():-document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,k,n,q,t,u){var y=document.createElement("div"),E=this.editor.graph;if(null!=f){var I=document.createElement("h3");mxUtils.write(I,f);y.appendChild(I)}f=document.createElement("div");f.className="geDialogSection";var C=u?this.addPagesRow(f):null,U=this.addCheckbox(f,mxResources.get("fit"),!0,null,null,null,null,null,!0),J=this.addCheckbox(f,mxResources.get("shadow"),E.shadowVisible&&n,!n,null,null,null,-null,!0),S=this.addCheckbox(f,k,!1,null,null,null,null,null,!0),N=this.addCheckbox(f,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);y.appendChild(f);k=this.addAdvancedSection(y).content;var R=null;t&&(R=document.createElement("select"),R.style.maxWidth="260px",t=document.createElement("option"),t.setAttribute("value","light"),mxUtils.write(t,mxResources.get("light")),R.appendChild(t),t=document.createElement("option"),t.setAttribute("value","dark"),mxUtils.write(t,mxResources.get("dark")),-R.appendChild(t),mxUtils.lightDarkColorSupported?(t=document.createElement("option"),t.setAttribute("value","auto"),mxUtils.write(t,mxResources.get("automatic")),R.appendChild(t),R.value="auto"):R.value=Editor.isDarkMode()?"dark":"light",t=document.createElement("div"),t.className="geDialogFormRow",n=document.createElement("span"),n.className="geDialogFormLabel",mxUtils.write(n,mxResources.get("appearance")+":"),t.appendChild(n),t.appendChild(R),k.appendChild(t));var T=this.addEditButton(k,N),v=T.getEditInput(),-d=1<E.model.getChildCount(E.model.getRoot()),m=this.addCheckbox(k,mxResources.get("layers"),d,!d,null,null,null,null,!0),r=this.addCheckbox(k,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),A=this.addCheckbox(k,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(N,"change",function(){N.checked?(d&&m.removeAttribute("disabled"),null!=C&&C.select.removeAttribute("disabled"),v.removeAttribute("disabled"),r.removeAttribute("disabled"),A.removeAttribute("disabled")):-(null!=C&&C.select.setAttribute("disabled","disabled"),m.setAttribute("disabled","disabled"),v.setAttribute("disabled","disabled"),r.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"));v.checked&&N.checked?T.getEditSelect().removeAttribute("disabled"):T.getEditSelect().setAttribute("disabled","disabled")});q=new CustomDialog(this,y,mxUtils.bind(this,function(){c(U.checked,J.checked,S.checked,N.checked,T.getLink(),m.checked,r.checked,A.checked,null!=R?R.value:null,null!=C?null!=-C.row&&"allPages"==C.select.value:null)}),null,mxResources.get("embed"),q);this.showDialog(q.container,280,null,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,k,n,q,t,u,y,E,I){function C(R){var T=" ",v="";n&&(T=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(null!=J?"&page="+J:"")+(q?"&edit=_blank":"")+(t?"&layers=1":"")+(u?"&link-icons=1":"")+(y?"&tooltip-icons=1":"")+"');}})(this);\"",v+="cursor:pointer;");c&&(v+="max-width:100%;");var d="";k&&(d=' width="'+Math.round(U.width)+'" height="'+Math.round(U.height)+'"');E('<img src="'+R+'"'+d+(""!=v?' style="'+v+'"':"")+T+"/>")}var U=this.editor.graph.getGraphBounds(),J=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,-function(R){var T=n?this.getFileData(!0):null;R=this.createImageDataUri(R,T,"png");C(R)}),null,null,null,mxUtils.bind(this,function(R){I({message:mxResources.get("unknownError")})}),null,!0,k?2:1,null,f,null,null,Editor.defaultBorder);else if(f=this.getFileData(!0),U.width*U.height<=MAX_AREA&&f.length<=MAX_REQUEST_SIZE){var S="";k&&(S="&w="+Math.round(2*U.width)+"&h="+Math.round(2*U.height));var N=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(n?"1":"0")+S+"&xml="+encodeURIComponent(f));-N.send(mxUtils.bind(this,function(){200<=N.getStatus()&&299>=N.getStatus()?C("data:image/png;base64,"+N.getText()):I({message:mxResources.get("unknownError")})}))}else I({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,f,k,n,q,t,u,y,E,I,C){E=null!=E?E:"auto";I=null!=I?I:!0;var U=this.getSelectedPageIndex(),J=mxUtils.lightDarkColorSupported,S=mxUtils.preferDarkColor;if("light"==E||"dark"==E)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==-E;var N=null;try{N=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k,E)}finally{mxUtils.lightDarkColorSupported=J,mxUtils.preferDarkColor=S}E=N.getElementsByTagName("a");if(null!=E)for(J=0;J<E.length;J++)S=E[J].getAttribute("href"),null!=S&&"#"==S.charAt(0)&&"_blank"==E[J].getAttribute("target")&&E[J].removeAttribute("target");n&&N.setAttribute("content",this.getFileData(!0,null,null,null,null,!I));f&&this.editor.graph.addSvgShadow(N);if(k){var R=" ",T="";n&&(R="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(I&&null!=U?"&page="+U:"")+(q?"&edit=_blank":"")+(t?"&layers=1":"")+(u?"&link-icons=1":"")+(y?"&tooltip-icons=1":"")+"');}})(this);\"",T+="cursor:pointer;");c&&(T+="max-width:100%;");this.editor.convertImages(N,mxUtils.bind(this,function(v){C('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(v))+'"'+(""!=T?' style="'+T+'"':"")+R+"/>")}))}else T="",n&&(N.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(I&&null!=U?"&page="+U:"")+(q?"&edit=_blank":"")+(t?"&layers=1":"")+(u?"&link-icons=1":"")+(y?"&tooltip-icons=1":"")+"');}}})(this);"),T+="cursor:pointer;"),c&&(c=parseInt(N.getAttribute("width")),f=parseInt(N.getAttribute("height")),N.setAttribute("viewBox","-0.5 -0.5 "+c+" "+f),T+="max-width:100%;max-height:"+f+"px;",N.removeAttribute("height")),""!=T&&(c=N.getAttribute("style"),N.setAttribute("style",(null!=c&&0<c.length?c+" ":"")+T)),this.editor.addFontCss(N),-this.editor.graph.mathEnabled&&this.editor.addMathCss(N),C(mxUtils.getXml(N))};EditorUi.prototype.timeSince=function(c){c=Math.floor((new Date-c)/1E3);var f=Math.floor(c/31536E3);if(1<f)return f+" "+mxResources.get("years");f=Math.floor(c/2592E3);if(1<f)return f+" "+mxResources.get("months");f=Math.floor(c/86400);if(1<f)return f+" "+mxResources.get("days");f=Math.floor(c/3600);if(1<f)return f+" "+mxResources.get("hours");f=Math.floor(c/60);return 1<f?f+" "+mxResources.get("minutes"):1==f?f+" "+mxResources.get("minute"):+sa.style.maxWidth="260px";c=document.createElement("option");c.setAttribute("value","light");mxUtils.write(c,mxResources.get("light"));sa.appendChild(c);c=document.createElement("option");c.setAttribute("value","dark");mxUtils.write(c,mxResources.get("dark"));sa.appendChild(c);var ua=Editor.isDarkMode()?"dark":"light";"svg"==B&&mxUtils.lightDarkColorSupported&&(c=document.createElement("option"),c.setAttribute("value","auto"),mxUtils.write(c,mxResources.get("automatic")),sa.appendChild(c),ua="auto");+sa.value=null!=this.lastExportTheme?this.lastExportTheme:ua;0>sa.selectedIndex&&(sa.value=ua);c=document.createElement("div");c.className="geDialogFormRow";S=document.createElement("span");S.className="geDialogFormLabel";mxUtils.write(S,mxResources.get("appearance")+":");c.appendChild(S);c.appendChild(sa);u.appendChild(c);"svg"==B&&(c=document.createElement("div"),c.className="geDialogFormRow",S=document.createElement("span"),S.className="geDialogFormLabel",mxUtils.write(S,mxResources.get("links")++":"),c.appendChild(S),c.appendChild(W),u.appendChild(c),u.appendChild(t));var xa=1==K.shadowVisible,qa=this.addCheckbox(u,mxResources.get("shadow"),null!=this.lastExportShadow?this.lastExportShadow:xa,null,null,null,null,null,!0),Aa=null,Ba="svg"!=B&&(this.isOffline()||!Editor.canvasSupported);if("png"==B||"jpeg"==B||"webp"==B||"svg"==B)Aa=this.addCheckbox(u,mxResources.get("grid"),Ba||null==this.lastExportGrid?!1:this.lastExportGrid,Ba,!1,!0,null,null,!0);f&&(V.checked=null!=this.lastEmbedImages?+this.lastEmbedImages:!0,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(V),K=document.createElement("label"),mxUtils.write(K,mxResources.get("embedImages")),K.setAttribute("for",V.id),t.appendChild(K),u.appendChild(t),X.checked=null!=this.lastEmbedFonts?this.lastEmbedFonts:Editor.embedSvgFonts,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(X),K=document.createElement("label"),mxUtils.write(K,mxResources.get("embedFonts")),K.setAttribute("for",+X.id),t.appendChild(K),u.appendChild(t),H.checked=null!=this.lastEmbedCellMetadata?this.lastEmbedCellMetadata:!1,t=document.createElement("div"),t.className="geDialogCheckRow",t.appendChild(H),K=document.createElement("label"),mxUtils.write(K,mxResources.get("embedCellMetadata")),K.setAttribute("for",H.id),t.appendChild(K),u.appendChild(t));k=new CustomDialog(this,U,mxUtils.bind(this,function(){this.lastExportSelectionOnly=T.checked;this.lastExportBorder=ra.value;this.lastExportZoom=R.value;D&&(this.lastExportTransparent=+0==F.checked?null:F.checked);this.lastExportTheme=sa.value==ua?null:sa.value;this.lastExportShadow=qa.checked==xa?null:qa.checked;null==Aa||Ba||(this.lastExportGrid=Aa.checked?!0:null);"svg"==B&&(this.lastExportLinkTarget="auto"==W.value?null:W.value);if("png"==B){var Ea=parseInt(na.value);this.lastExportDpi=!isNaN(Ea)&&0<Ea&&100!=Ea?Ea:null}E&&(this.lastExportType=d.value==z?null:d.value);f&&(this.lastEmbedImages=V.checked,this.lastEmbedFonts=X.checked,this.lastEmbedCellMetadata=H.checked);if("png"==+B||"svg"==B)this.lastEmbedInclude=P.value;null!=q&&q(R.value,F.checked,!T.checked,qa.checked,N.checked,V.checked&&f,ra.value,v.checked,("png"==B||"svg"==B)&&"currentPage"==P.value,W.value,null!=Aa?Aa.checked:null,null!=sa?sa.value:null,d.value,X.checked,H.checked&&f,"png"==B&&0<parseInt(na.value)&&100!=parseInt(na.value)?parseInt(na.value):null)}),null,k,n);this.showDialog(k.container,360,null,!0,!0,null,null,null,null,!0);R.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?R.select():+document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,k,n,q,t,u){var B=document.createElement("div"),E=this.editor.graph;if(null!=f){var I=document.createElement("h3");mxUtils.write(I,f);B.appendChild(I)}f=document.createElement("div");f.className="geDialogSection";var C=u?this.addPagesRow(f):null,U=this.addCheckbox(f,mxResources.get("fit"),!0,null,null,null,null,null,!0),K=this.addCheckbox(f,mxResources.get("shadow"),E.shadowVisible&&n,!n,null,null,null,+null,!0),S=this.addCheckbox(f,k,!1,null,null,null,null,null,!0),M=this.addCheckbox(f,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);B.appendChild(f);k=this.addAdvancedSection(B).content;var R=null;t&&(R=document.createElement("select"),R.style.maxWidth="260px",t=document.createElement("option"),t.setAttribute("value","light"),mxUtils.write(t,mxResources.get("light")),R.appendChild(t),t=document.createElement("option"),t.setAttribute("value","dark"),mxUtils.write(t,mxResources.get("dark")),+R.appendChild(t),mxUtils.lightDarkColorSupported?(t=document.createElement("option"),t.setAttribute("value","auto"),mxUtils.write(t,mxResources.get("automatic")),R.appendChild(t),R.value="auto"):R.value=Editor.isDarkMode()?"dark":"light",t=document.createElement("div"),t.className="geDialogFormRow",n=document.createElement("span"),n.className="geDialogFormLabel",mxUtils.write(n,mxResources.get("appearance")+":"),t.appendChild(n),t.appendChild(R),k.appendChild(t));var T=this.addEditButton(k,M),v=T.getEditInput(),+d=1<E.model.getChildCount(E.model.getRoot()),m=this.addCheckbox(k,mxResources.get("layers"),d,!d,null,null,null,null,!0),r=this.addCheckbox(k,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),z=this.addCheckbox(k,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(M,"change",function(){M.checked?(d&&m.removeAttribute("disabled"),null!=C&&C.select.removeAttribute("disabled"),v.removeAttribute("disabled"),r.removeAttribute("disabled"),z.removeAttribute("disabled")):+(null!=C&&C.select.setAttribute("disabled","disabled"),m.setAttribute("disabled","disabled"),v.setAttribute("disabled","disabled"),r.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"));v.checked&&M.checked?T.getEditSelect().removeAttribute("disabled"):T.getEditSelect().setAttribute("disabled","disabled")});q=new CustomDialog(this,B,mxUtils.bind(this,function(){c(U.checked,K.checked,S.checked,M.checked,T.getLink(),m.checked,r.checked,z.checked,null!=R?R.value:null,null!=C?null!=+C.row&&"allPages"==C.select.value:null)}),null,mxResources.get("embed"),q);this.showDialog(q.container,280,null,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,k,n,q,t,u,B,E,I){function C(R){var T=" ",v="";n&&(T=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"++EditorUi.lightboxHost+"/?client=1"+(null!=K?"&page="+K:"")+(q?"&edit=_blank":"")+(t?"&layers=1":"")+(u?"&link-icons=1":"")+(B?"&tooltip-icons=1":"")+"');}})(this);\"",v+="cursor:pointer;");c&&(v+="max-width:100%;");var d="";k&&(d=' width="'+Math.round(U.width)+'" height="'+Math.round(U.height)+'"');E('<img src="'+R+'"'+d+(""!=v?' style="'+v+'"':"")+T+"/>")}var U=this.editor.graph.getGraphBounds(),K=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,+function(R){var T=n?this.getFileData(!0):null;R=this.createImageDataUri(R,T,"png");C(R)}),null,null,null,mxUtils.bind(this,function(R){I({message:mxResources.get("unknownError")})}),null,!0,k?2:1,null,f,null,null,Editor.defaultBorder);else if(f=this.getFileData(!0),U.width*U.height<=MAX_AREA&&f.length<=MAX_REQUEST_SIZE){var S="";k&&(S="&w="+Math.round(2*U.width)+"&h="+Math.round(2*U.height));var M=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(n?"1":"0")+S+"&xml="+encodeURIComponent(f));+M.send(mxUtils.bind(this,function(){200<=M.getStatus()&&299>=M.getStatus()?C("data:image/png;base64,"+M.getText()):I({message:mxResources.get("unknownError")})}))}else I({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,f,k,n,q,t,u,B,E,I,C){E=null!=E?E:"auto";I=null!=I?I:!0;var U=this.getSelectedPageIndex(),K=mxUtils.lightDarkColorSupported,S=mxUtils.preferDarkColor;if("light"==E||"dark"==E)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==+E;var M=null;try{M=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k,E)}finally{mxUtils.lightDarkColorSupported=K,mxUtils.preferDarkColor=S}E=M.getElementsByTagName("a");if(null!=E)for(K=0;K<E.length;K++)S=E[K].getAttribute("href"),null!=S&&"#"==S.charAt(0)&&"_blank"==E[K].getAttribute("target")&&E[K].removeAttribute("target");n&&M.setAttribute("content",this.getFileData(!0,null,null,null,null,!I));f&&this.editor.graph.addSvgShadow(M);if(k){var R=" ",T="";n&&(R="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"++EditorUi.lightboxHost+"/?client=1"+(I&&null!=U?"&page="+U:"")+(q?"&edit=_blank":"")+(t?"&layers=1":"")+(u?"&link-icons=1":"")+(B?"&tooltip-icons=1":"")+"');}})(this);\"",T+="cursor:pointer;");c&&(T+="max-width:100%;");this.editor.convertImages(M,mxUtils.bind(this,function(v){C('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(v))+'"'+(""!=T?' style="'+T+'"':"")+R+"/>")}))}else T="",n&&(M.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"++EditorUi.lightboxHost+"/?client=1"+(I&&null!=U?"&page="+U:"")+(q?"&edit=_blank":"")+(t?"&layers=1":"")+(u?"&link-icons=1":"")+(B?"&tooltip-icons=1":"")+"');}}})(this);"),T+="cursor:pointer;"),c&&(c=parseInt(M.getAttribute("width")),f=parseInt(M.getAttribute("height")),M.setAttribute("viewBox","-0.5 -0.5 "+c+" "+f),T+="max-width:100%;max-height:"+f+"px;",M.removeAttribute("height")),""!=T&&(c=M.getAttribute("style"),M.setAttribute("style",(null!=c&&0<c.length?c+" ":"")+T)),this.editor.addFontCss(M),+this.editor.graph.mathEnabled&&this.editor.addMathCss(M),C(mxUtils.getXml(M))};EditorUi.prototype.timeSince=function(c){c=Math.floor((new Date-c)/1E3);var f=Math.floor(c/31536E3);if(1<f)return f+" "+mxResources.get("years");f=Math.floor(c/2592E3);if(1<f)return f+" "+mxResources.get("months");f=Math.floor(c/86400);if(1<f)return f+" "+mxResources.get("days");f=Math.floor(c/3600);if(1<f)return f+" "+mxResources.get("hours");f=Math.floor(c/60);return 1<f?f+" "+mxResources.get("minutes"):1==f?f+" "+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,f){if(null!=c){var k=null;if("diagram"==c.nodeName)k=c;else if("mxfile"==c.nodeName){var n=c.getElementsByTagName("diagram");if(0<n.length){k=n[0];var q=f.getGlobalVariable;f.getGlobalVariable=function(t){return"page"==t?k.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==t?1:q.apply(this,arguments)}}}null!=k&&(c=Editor.parseDiagramNode(k))}n=this.editor.graph;try{this.editor.graph=f,this.editor.setGraphXml(c)}catch(t){}finally{this.editor.graph=-n}return c};EditorUi.prototype.getSvgFileProperties=function(c){return this.getPngFileProperties(c)};EditorUi.prototype.getPngFileProperties=function(c){var f=1,k=0;if(null!=c){if(c.hasAttribute("scale")){var n=parseFloat(c.getAttribute("scale"));!isNaN(n)&&0<n&&(f=n)}c.hasAttribute("border")&&(n=parseInt(c.getAttribute("border")),!isNaN(n)&&0<n&&(k=n))}return{scale:f,border:k}};EditorUi.prototype.getEmbeddedPng=function(c,f,k,n,q){try{var t=this.editor.graph,u=null;if(null!=k&&0<k.length)t=this.createTemporaryGraph(t.getStylesheet()),-document.body.appendChild(t.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,!0),t),u=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){t=this.createTemporaryGraph(t.getStylesheet());var y=t.getGlobalVariable;t.setBackgroundImage=this.editor.graph.setBackgroundImage;var E=this.pages[0];this.currentPage==E?t.setBackgroundImage(this.editor.graph.backgroundImage):null!=E.viewState&&null!=E.viewState&&t.setBackgroundImage(E.viewState.backgroundImage);-t.getGlobalVariable=function(I){return"page"==I?E.getName():"pagenumber"==I?1:y.apply(this,arguments)};document.body.appendChild(t.container);t.model.setRoot(E.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(I){try{null==u&&(u=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var C=I.toDataURL("image/png");C=Editor.writeGraphModelToPng(C,"tEXt","mxfile",encodeURIComponent(u));c(C.substring(C.lastIndexOf(",")+1));t!=this.editor.graph&&t.container.parentNode.removeChild(t.container)}catch(U){null!=-f&&f(U)}}),null,null,null,mxUtils.bind(this,function(I){null!=f&&f(I)}),null,null,n,null,t.shadowVisible,null,t,q,null,null,null,"diagram",null)}catch(I){null!=f&&f(I)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,k,n,q,t,u,y,E,I,C,U,J,S,N){y=null!=y?y:!0;C=null!=C?C:0;u=null!=E?E:f.background;u==mxConstants.NONE&&(u=null);null==u&&"none"==f.getAdaptiveColors()&&(u="#ffffff");E=this.editor.graph.createSvgImageExport(null!=c,S);var R=Graph.addFont,T=null;if(null==q){T={};Graph.addFont=function(A,-D,G,O){R.call(this,A,D,G,T)};var v=E.drawCellState;E.drawCellState=function(A,D){null!=A&&Graph.processFontStyle(A.style);v.apply(this,arguments)}}S=null;try{S=f.getSvg(u,I,C,null,null,t,null,E,null,f.shadowVisible||U,null,J,"diagram")}finally{Graph.addFont=R}(f.shadowVisible||U)&&f.addSvgShadow(S,null,null,0==C);null!=c&&S.setAttribute("content",c);null!=k&&S.setAttribute("resource",k);var d=mxUtils.bind(this,function(A){A=(n?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+-"\n")+mxUtils.getXml(A);null!=q&&q(A);return A});f.mathEnabled&&this.editor.addMathCss(S);if(null!=q)this.embedFonts(S,mxUtils.bind(this,function(A){y?this.editor.convertImages(A,mxUtils.bind(this,function(D){d(D)})):d(A)}),N);else{c=Graph.customFontElements;Graph.customFontElements=T;try{var m=!1;this.embedFonts(S,function(){m=!0},N);if(!m)try{null==this.editor.resolvedFontCss&&this.editor.addFontCss(S);var r=this.editor.graph.getExtFontCss();0<r.length&&this.editor.addFontCss(S,r)}catch(A){}}finally{Graph.customFontElements=-c}return d(S)}};EditorUi.prototype.embedFonts=function(c,f,k){if(k=null!=k?k:Editor.embedSvgFonts)this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(q){try{null!=q&&this.editor.addFontCss(c,q),f(c)}catch(t){f(c)}}))}catch(q){f(c)}}));else{try{this.editor.addFontCss(c);var n=this.editor.graph.getExtFontCss();0<n.length&&this.editor.addFontCss(c,n)}catch(q){}f(c)}};-EditorUi.prototype.exportImage=function(c,f,k,n,q,t,u,y,E,I,C,U,J){E=null!=E?E:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(N){Editor.addRetryToError(N,mxUtils.bind(this,function(){this.exportImage(c,f,k,n,q,t,u,y,E,I,C,U,J)}));this.handleError(N)}))){var S=this.editor.graph.isSelectionEmpty();k=null!=k?k:S;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(N){this.spinner.stop();try{this.saveCanvas(N,-q?this.getFileData(!0,null,null,null,k,y,null,null,null,null,null,c,t):null,E,null==this.pages||0==this.pages.length,C)}catch(R){this.handleError(R)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(N){this.spinner.stop();this.handleError(N)}),null,k,c||1,f,n,null,null,t,u,I,U,J)}catch(N){this.spinner.stop(),this.handleError(N)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?-c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,k,n,q,t,u){EditorUi.debug("EditorUi.importXml",[this],"xml",[c],"dx",[f],"dy",[k],"crop",[n],"noErrorHandling",[q],"addNewPage",[t],"applyDefaultStyles",[u]);f=null!=f?f:0;k=null!=k?k:0;var y=[];try{if(null!=c&&0<c.length){var E=null!=this.pages?this.pages.length:0,I=this.isDiagramEmpty(),C=this.currentPage,U=this.editor.graph;U.model.beginUpdate();-try{var J=mxUtils.parseXml(c);c={};var S=this.editor.extractGraphModel(J.documentElement,null!=this.pages);if(null!=S&&"mxfile"==S.nodeName&&null!=this.pages){var N=S.getElementsByTagName("diagram");if(0<N.length){J=[];var R=0;if(1==N.length&&!t){if(null!=this.currentPage&&(c[N[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var T=N[0].getAttribute("name");null!=T&&""!=T&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,T))}S=Editor.parseDiagramNode(N[0]);-n=!1;R=1}for(;R<N.length;R++){var v=N[R].getAttribute("id");N[R].removeAttribute("id");var d=this.updatePageRoot(new DiagramPage(N[R]));c[v]=N[R].getAttribute("id");var m=this.pages.length;null==d.getName()&&d.setName(mxResources.get("pageWithNumber",[m+1]));U.model.execute(new ChangePage(this,d,d,m,0<R));J.push(d)}this.updatePageLinks(c,J)}}if(null!=S&&"mxGraphModel"===S.nodeName){y=U.importGraphModel(S,f,k,n);if(null!=y)for(this.addLocalPagesToMapping(c),R=0;R<y.length;R++)this.updatePageLinksForCell(c,-y[R]);var r=U.parseBackgroundImage(S.getAttribute("backgroundImage"));if(null!=r&&null!=r.originalSrc&&this.updateBackgroundPageLink(c,r)){var A=new ChangePageSetup(this,null,r);A.ignoreColor=!0;U.model.execute(A)}}u&&U.pasteCellStyles(U.includeDescendants(y),U.defaultVertexStyle,U.defaultEdgeStyle);!t&&C!=this.currentPage&&null!=this.pages&&1<this.pages.length&&I&&1==E&&this.removePage(C)}finally{U.model.endUpdate()}}}catch(D){if(q)throw D;this.handleError(D)}return y};EditorUi.prototype.updatePageLinks=-function(c,f){for(var k=0;k<f.length;k++)this.updatePageLinksForCell(c,f[k].root),f[k]!=this.currentPage&&(f[k].needsUpdate=!0),null!=f[k].viewState&&this.updateBackgroundPageLink(c,f[k].viewState.backgroundImage)&&(f[k]==this.currentPage&&this.editor.graph.setViewState(f[k].viewState,!0),f[k].needsUpdate=!0)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){var k=!1;try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var n=c[f.originalSrc.substring(f.originalSrc.indexOf(",")+1)];null!=n&&(f.originalSrc=-"data:page/id,"+n,k=!0)}}catch(q){}return k};EditorUi.prototype.updatePageLinksForCell=function(c,f){var k=document.createElement("div"),n=this.editor.graph,q=n.getLinkForCell(f);null!=q&&n.setLinkForCell(f,this.updatePageLink(c,q));if(n.isHtmlLabel(f)){k.innerHTML=Graph.sanitizeHtml(n.getLabel(f));for(var t=k.getElementsByTagName("a"),u=!1,y=0;y<t.length;y++)q=t[y].getAttribute("href"),null!=q&&(t[y].setAttribute("href",this.updatePageLink(c,q)),u=!0);u&&n.labelChanged(f,k.innerHTML)}for(y=0;y<n.model.getChildCount(f);y++)this.updatePageLinksForCell(c,-n.model.getChildAt(f,y))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var k=c[f.substring(f.indexOf(",")+1)];f=null!=k?"data:page/id,"+k:null}else if("data:action/json,"==f.substring(0,17))try{var n=JSON.parse(f.substring(17));if(null!=n.actions){for(var q=0;q<n.actions.length;q++){var t=n.actions[q];if(null!=t.open&&Graph.isPageLink(t.open)){var u=t.open.substring(t.open.indexOf(",")+1);k=c[u];null!=k?t.open="data:page/id,"+k:null==this.getPageById(u)&&delete t.open}}f=-"data:action/json,"+JSON.stringify(n)}}catch(y){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,k,n,q){var t=mxUtils.bind(this,function(u){this.loadingExtensions=!1;null!=k?k(u):this.handleError(u)});this.createTimeout(null,mxUtils.bind(this,function(u){n=null!=n?n:c.name;var y=mxUtils.bind(this,function(I){u.clear()&&t(I)}),E=mxUtils.bind(this,function(){this.loadingExtensions=-!1;if(this.doImportVisio){var I=this.isRemoteVisioFormat(n);try{var C=n.lastIndexOf(".");if(0<=C&&C<n.length)n.substring(C+1).toUpperCase();else{var U=n.lastIndexOf("/");0<=U&&U<n.length&&(n=n.substring(U+1))}}catch(S){}if(I)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(n)?y({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):y({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{I=new FormData;-I.append("file1",c,n);var J=new XMLHttpRequest;J.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(n)?"?stencil=1":""));J.responseType="blob";this.addRemoteServiceSecurityCheck(J);null!=q&&J.setRequestHeader("x-convert-custom",q);J.onreadystatechange=mxUtils.bind(this,function(){if(4==J.readyState&&u.clear())if(200<=J.status&&299>=J.status)try{var S=J.response;if("text/xml"==S.type){var N=new FileReader;N.onload=mxUtils.bind(this,function(R){try{f(R.target.result)}catch(T){y({message:mxResources.get("errorLoadingFile")})}});-N.readAsText(S)}else this.doImportVisio(S,f,y,n)}catch(R){y(R)}else try{""==J.responseType||"text"==J.responseType?y({message:J.responseText}):(N=new FileReader,N.onload=function(){try{y({message:JSON.parse(N.result).Message})}catch(R){null!=N.result&&0<N.result.length?y({message:N.result}):y(R)}},N.readAsText(J.response))}catch(R){y({})}});J.send(I)}else if(u.clear())try{this.doImportVisio(c,f,y,n)}catch(S){y(S)}}else y({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||-this.loadingExtensions||this.isOffline(!0)?E():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",E,null,null,null,y))}),t)};EditorUi.prototype.importGraphML=function(c,f,k){var n=mxUtils.bind(this,function(q){this.loadingExtensions=!1;null!=k?k(q):this.handleError(q)});this.createTimeout(null,mxUtils.bind(this,function(q){var t=mxUtils.bind(this,function(y){q.clear()&&n(y)}),u=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(q.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,-f,n)}catch(y){t(y)}else t({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?u():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",u,null,null,null,t))}),n)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(k){this.loadingExtensions=!1;this.handleError(k)});this.vsdxExportEnabled()?this.createTimeout(null,+n}return c};EditorUi.prototype.getSvgFileProperties=function(c){var f=this.getPngFileProperties(c);f.embedFonts=null!=c&&c.hasAttribute("embedFonts")?"false"!=c.getAttribute("embedFonts"):Editor.embedSvgFonts;return f};EditorUi.prototype.getPngFileProperties=function(c){var f=1,k=0;if(null!=c){if(c.hasAttribute("scale")){var n=parseFloat(c.getAttribute("scale"));!isNaN(n)&&0<n&&(f=n)}c.hasAttribute("border")&&(n=parseInt(c.getAttribute("border")),!isNaN(n)&&0<n&&(k=n))}return{scale:f,border:k}};EditorUi.prototype.getEmbeddedPng=+function(c,f,k,n,q){try{var t=this.editor.graph,u=null;if(null!=k&&0<k.length)t=this.createTemporaryGraph(t.getStylesheet()),document.body.appendChild(t.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,!0),t),u=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){t=this.createTemporaryGraph(t.getStylesheet());var B=t.getGlobalVariable;t.setBackgroundImage=this.editor.graph.setBackgroundImage;var E=this.pages[0];this.currentPage==E?t.setBackgroundImage(this.editor.graph.backgroundImage):+null!=E.viewState&&null!=E.viewState&&t.setBackgroundImage(E.viewState.backgroundImage);t.getGlobalVariable=function(I){return"page"==I?E.getName():"pagenumber"==I?1:B.apply(this,arguments)};document.body.appendChild(t.container);t.model.setRoot(E.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(I){try{null==u&&(u=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var C=I.toDataURL("image/png");C=Editor.writeGraphModelToPng(C,"tEXt","mxfile",encodeURIComponent(u));c(C.substring(C.lastIndexOf(",")++1));t!=this.editor.graph&&t.container.parentNode.removeChild(t.container)}catch(U){null!=f&&f(U)}}),null,null,null,mxUtils.bind(this,function(I){null!=f&&f(I)}),null,null,n,null,t.shadowVisible,null,t,q,null,null,null,"diagram",null)}catch(I){null!=f&&f(I)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,k,n,q,t,u,B,E,I,C,U,K,S,M){B=null!=B?B:!0;C=null!=C?C:0;u=null!=E?E:f.background;u==mxConstants.NONE&&(u=null);null==u&&"none"==f.getAdaptiveColors()&&(u="#ffffff");E=this.editor.graph.createSvgImageExport(null!=+c,S);var R=Graph.addFont,T=null;if(null==q){T={};Graph.addFont=function(z,D,F,N){R.call(this,z,D,F,T)};var v=E.drawCellState;E.drawCellState=function(z,D){null!=z&&Graph.processFontStyle(z.style);v.apply(this,arguments)}}S=null;try{S=f.getSvg(u,I,C,null,null,t,null,E,null,f.shadowVisible||U,null,K,"diagram")}finally{Graph.addFont=R}(f.shadowVisible||U)&&f.addSvgShadow(S,null,null,0==C);null!=c&&S.setAttribute("content",c);null!=k&&S.setAttribute("resource",k);var d=mxUtils.bind(this,function(z){z=+(n?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(z);null!=q&&q(z);return z});f.mathEnabled&&this.editor.addMathCss(S);if(null!=q)this.embedFonts(S,mxUtils.bind(this,function(z){B?this.editor.convertImages(z,mxUtils.bind(this,function(D){d(D)})):d(z)}),M);else{c=Graph.customFontElements;Graph.customFontElements=T;try{var m=!1;this.embedFonts(S,function(){m=!0},M);if(!m)try{null==this.editor.resolvedFontCss&&this.editor.addFontCss(S);var r=this.editor.graph.getExtFontCss();+0<r.length&&this.editor.addFontCss(S,r)}catch(z){}}finally{Graph.customFontElements=c}return d(S)}};EditorUi.prototype.embedFonts=function(c,f,k){if(k=null!=k?k:Editor.embedSvgFonts)this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(q){try{null!=q&&this.editor.addFontCss(c,q),f(c)}catch(t){f(c)}}))}catch(q){f(c)}}));else{try{this.editor.addFontCss(c);var n=+this.editor.graph.getExtFontCss();0<n.length&&this.editor.addFontCss(c,n)}catch(q){}f(c)}};EditorUi.prototype.exportImage=function(c,f,k,n,q,t,u,B,E,I,C,U,K){E=null!=E?E:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(M){Editor.addRetryToError(M,mxUtils.bind(this,function(){this.exportImage(c,f,k,n,q,t,u,B,E,I,C,U,K)}));this.handleError(M)}))){var S=this.editor.graph.isSelectionEmpty();k=null!=k?k:S;null==this.thumbImageCache&&(this.thumbImageCache=+{});try{this.editor.exportToCanvas(mxUtils.bind(this,function(M){this.spinner.stop();try{this.saveCanvas(M,q?this.getFileData(!0,null,null,null,k,B,null,null,null,null,null,c,t):null,E,null==this.pages||0==this.pages.length,C)}catch(R){this.handleError(R)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(M){this.spinner.stop();this.handleError(M)}),null,k,c||1,f,n,null,null,t,u,I,U,K)}catch(M){this.spinner.stop(),this.handleError(M)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};+EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,k,n,q,t,u){EditorUi.debug("EditorUi.importXml",[this],"xml",[c],"dx",[f],"dy",[k],"crop",[n],"noErrorHandling",[q],"addNewPage",[t],"applyDefaultStyles",[u]);f=null!=f?f:0;k=null!=k?k:0;var B=[];try{if(null!=c&&0<c.length){var E=null!=this.pages?this.pages.length:0,I=this.isDiagramEmpty(),+C=this.currentPage,U=this.editor.graph;U.model.beginUpdate();try{var K=mxUtils.parseXml(c);c={};var S=this.editor.extractGraphModel(K.documentElement,null!=this.pages);if(null!=S&&"mxfile"==S.nodeName&&null!=this.pages){var M=S.getElementsByTagName("diagram");if(0<M.length){K=[];var R=0;if(1==M.length&&!t){if(null!=this.currentPage&&(c[M[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var T=M[0].getAttribute("name");null!=T&&""!=T&&this.editor.graph.model.execute(new RenamePage(this,+this.currentPage,T))}S=Editor.parseDiagramNode(M[0]);n=!1;R=1}for(;R<M.length;R++){var v=M[R].getAttribute("id");M[R].removeAttribute("id");var d=this.updatePageRoot(new DiagramPage(M[R]));c[v]=M[R].getAttribute("id");var m=this.pages.length;null==d.getName()&&d.setName(mxResources.get("pageWithNumber",[m+1]));U.model.execute(new ChangePage(this,d,d,m,0<R));K.push(d)}this.updatePageLinks(c,K)}}if(null!=S&&"mxGraphModel"===S.nodeName){B=U.importGraphModel(S,f,k,n);if(null!=B)for(this.addLocalPagesToMapping(c),+R=0;R<B.length;R++)this.updatePageLinksForCell(c,B[R]);var r=U.parseBackgroundImage(S.getAttribute("backgroundImage"));if(null!=r&&null!=r.originalSrc&&this.updateBackgroundPageLink(c,r)){var z=new ChangePageSetup(this,null,r);z.ignoreColor=!0;U.model.execute(z)}}u&&U.pasteCellStyles(U.includeDescendants(B),U.defaultVertexStyle,U.defaultEdgeStyle);!t&&C!=this.currentPage&&null!=this.pages&&1<this.pages.length&&I&&1==E&&this.removePage(C)}finally{U.model.endUpdate()}}}catch(D){if(q)throw D;this.handleError(D)}return B};+EditorUi.prototype.updatePageLinks=function(c,f){for(var k=0;k<f.length;k++)this.updatePageLinksForCell(c,f[k].root),f[k]!=this.currentPage&&(f[k].needsUpdate=!0),null!=f[k].viewState&&this.updateBackgroundPageLink(c,f[k].viewState.backgroundImage)&&(f[k]==this.currentPage&&this.editor.graph.setViewState(f[k].viewState,!0),f[k].needsUpdate=!0)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){var k=!1;try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var n=c[f.originalSrc.substring(f.originalSrc.indexOf(",")++1)];null!=n&&(f.originalSrc="data:page/id,"+n,k=!0)}}catch(q){}return k};EditorUi.prototype.updatePageLinksForCell=function(c,f){var k=document.createElement("div"),n=this.editor.graph,q=n.getLinkForCell(f);null!=q&&n.setLinkForCell(f,this.updatePageLink(c,q));if(n.isHtmlLabel(f)){k.innerHTML=Graph.sanitizeHtml(n.getLabel(f));for(var t=k.getElementsByTagName("a"),u=!1,B=0;B<t.length;B++)q=t[B].getAttribute("href"),null!=q&&(t[B].setAttribute("href",this.updatePageLink(c,q)),u=!0);u&&n.labelChanged(f,+k.innerHTML)}for(B=0;B<n.model.getChildCount(f);B++)this.updatePageLinksForCell(c,n.model.getChildAt(f,B))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var k=c[f.substring(f.indexOf(",")+1)];f=null!=k?"data:page/id,"+k:null}else if("data:action/json,"==f.substring(0,17))try{var n=JSON.parse(f.substring(17));if(null!=n.actions){for(var q=0;q<n.actions.length;q++){var t=n.actions[q];if(null!=t.open&&Graph.isPageLink(t.open)){var u=t.open.substring(t.open.indexOf(",")+1);+k=c[u];null!=k?t.open="data:page/id,"+k:null==this.getPageById(u)&&delete t.open}}f="data:action/json,"+JSON.stringify(n)}}catch(B){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,k,n,q){var t=mxUtils.bind(this,function(u){this.loadingExtensions=!1;null!=k?k(u):this.handleError(u)});this.createTimeout(null,mxUtils.bind(this,function(u){n=null!=n?n:c.name;var B=mxUtils.bind(this,+function(I){u.clear()&&t(I)}),E=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var I=this.isRemoteVisioFormat(n);try{var C=n.lastIndexOf(".");if(0<=C&&C<n.length)n.substring(C+1).toUpperCase();else{var U=n.lastIndexOf("/");0<=U&&U<n.length&&(n=n.substring(U+1))}}catch(S){}if(I)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(n)?B({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):B({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):+mxResources.get("serviceUnavailableOrBlocked")});else{I=new FormData;I.append("file1",c,n);var K=new XMLHttpRequest;K.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(n)?"?stencil=1":""));K.responseType="blob";this.addRemoteServiceSecurityCheck(K);null!=q&&K.setRequestHeader("x-convert-custom",q);K.onreadystatechange=mxUtils.bind(this,function(){if(4==K.readyState&&u.clear())if(200<=K.status&&299>=K.status)try{var S=K.response;if("text/xml"==S.type){var M=new FileReader;M.onload=mxUtils.bind(this,+function(R){try{f(R.target.result)}catch(T){B({message:mxResources.get("errorLoadingFile")})}});M.readAsText(S)}else this.doImportVisio(S,f,B,n)}catch(R){B(R)}else try{""==K.responseType||"text"==K.responseType?B({message:K.responseText}):(M=new FileReader,M.onload=function(){try{B({message:JSON.parse(M.result).Message})}catch(R){null!=M.result&&0<M.result.length?B({message:M.result}):B(R)}},M.readAsText(K.response))}catch(R){B({})}});K.send(I)}else if(u.clear())try{this.doImportVisio(c,f,B,n)}catch(S){B(S)}}else B({message:mxResources.get("serviceUnavailableOrBlocked")})});+this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?E():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",E,null,null,null,B))}),t)};EditorUi.prototype.importGraphML=function(c,f,k){var n=mxUtils.bind(this,function(q){this.loadingExtensions=!1;null!=k?k(q):this.handleError(q)});this.createTimeout(null,mxUtils.bind(this,function(q){var t=mxUtils.bind(this,function(B){q.clear()&&n(B)}),u=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(q.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,+f,n)}catch(B){t(B)}else t({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?u():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",u,null,null,null,t))}),n)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(k){this.loadingExtensions=!1;this.handleError(k)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(k){var n=mxUtils.bind(this,function(t){k.clear()&&f(t)}),q=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(k.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||n({message:mxResources.get("unknownError")})}catch(t){n(t)}else n({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(q,0):(this.loadingExtensions=-!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,n))}),f):f({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,f,k){var n=mxUtils.bind(this,function(q){this.loadingExtensions=!1;null!=k?k(q):this.handleError(q)});this.createTimeout(null,mxUtils.bind(this,function(q){var t=mxUtils.bind(this,function(y){q.clear()&&n(y)}),u=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(q.clear())if("undefined"!==typeof window.LucidImporter)try{var y=-JSON.parse(c);f(LucidImporter.importState(y));try{if(null!=window.console&&"1"==urlParams.test){var E=[(new Date).toISOString(),"convertLucidChart",y];null!=y.state&&E.push(JSON.parse(y.state));if(null!=y.svgThumbs)for(var I=0;I<y.svgThumbs.length;I++)E.push(Editor.createSvgDataUri(y.svgThumbs[I]));null!=y.thumb&&E.push(y.thumb);console.log.apply(console,E)}}catch(C){}}catch(C){null!=window.console&&console.error(C),t(C)}else t({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==+!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,n))}),f):f({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,f,k){var n=mxUtils.bind(this,function(q){this.loadingExtensions=!1;null!=k?k(q):this.handleError(q)});this.createTimeout(null,mxUtils.bind(this,function(q){var t=mxUtils.bind(this,function(B){q.clear()&&n(B)}),u=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(q.clear())if("undefined"!==typeof window.LucidImporter)try{var B=+JSON.parse(c);f(LucidImporter.importState(B));try{if(null!=window.console&&"1"==urlParams.test){var E=[(new Date).toISOString(),"convertLucidChart",B];null!=B.state&&E.push(JSON.parse(B.state));if(null!=B.svgThumbs)for(var I=0;I<B.svgThumbs.length;I++)E.push(Editor.createSvgDataUri(B.svgThumbs[I]));null!=B.thumb&&E.push(B.thumb);console.log.apply(console,E)}}catch(C){}}catch(C){null!=window.console&&console.error(C),t(C)}else t({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(u,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",u,null,null,null,t)},null,null,null,t)},null,null,null,t)},null,null,null,t)},null,null,null,t):mxscript(window.DRAWIO_SERVER_URL+-"js/extensions.min.js",u,null,null,null,t))}),n)};EditorUi.prototype.replaceLockedGroupChildren=function(c,f,k,n,q){var t=null!=q&&null!=q.dataAttr?q.dataAttr:"mermaidData",u=null!=q&&null!=q.attrPrefix?q.attrPrefix:"mermaid",y=this.editor.graph;q=mxUtils.parseXml((null!=q&&null!=q.wrapGroup?q.wrapGroup:mxMermaidToDrawio.wrapGroup)(f,k,n));var E=new mxCodec(q);f=new mxGraphModel;E.decode(q.documentElement,f);E=f.getRoot();var I=null;for(q=0;null!=E&&q<f.getChildCount(E)&&null==I;q++)for(var C=f.getChildAt(E,-q),U=0;U<f.getChildCount(C);U++){var J=f.getChildAt(C,U),S=J.value;if(null!=S&&"object"===typeof S&&null!=S.getAttribute&&null!=S.getAttribute(t)){I=J;break}}if(null!=I){E=[];for(q=0;q<f.getChildCount(I);q++)E.push(f.getChildAt(I,q));0==E.length&&(E=[I]);I=f.getGeometry(I);C=S=Infinity;J=y.model.getChildCount(c);for(q=0;q<J;q++){var N=y.model.getChildAt(c,q);y.model.isVertex(N)&&(N=N.getGeometry(),null!=N&&(S=Math.min(S,N.x),C=Math.min(C,N.y)))}var R=Infinity;N=Infinity;for(q=0;q<E.length;q++)f.isVertex(E[q])&&-(J=E[q].getGeometry(),null!=J&&(R=Math.min(R,J.x),N=Math.min(N,J.y)));S=isFinite(S)&&isFinite(R)?S-R:0;C=isFinite(C)&&isFinite(N)?C-N:0;if(0!=S||0!=C)for(q=0;q<E.length;q++)if(N=E[q],J=N.getGeometry(),null!=J){J=J.clone();if(f.isVertex(N))J.x+=S,J.y+=C;else if(f.isEdge(N)){if(null!=J.points)for(R=0;R<J.points.length;R++)null!=J.points[R]&&(J.points[R].x+=S,J.points[R].y+=C);null!=J.sourcePoint&&(J.sourcePoint.x+=S,J.sourcePoint.y+=C);null!=J.targetPoint&&(J.targetPoint.x+=S,J.targetPoint.y+=C)}f.setGeometry(N,-J)}f=this.snapshotMermaidIdentity(c,u);E=y.cloneCells(E,!0);y.getModel().beginUpdate();try{for(U=y.model.getChildCount(c)-1;0<=U;U--)y.model.remove(y.model.getChildAt(c,U));for(q=0;q<E.length;q++)this.applyMermaidUserCustomizations(E[q],f,u),y.model.add(c,E[q]);if(null!=I){var T=y.model.getGeometry(c);null!=T&&(T=T.clone(),T.width=I.width,T.height=I.height,y.model.setGeometry(c,T))}y.setAttributeForCell(c,t,JSON.stringify({data:k,config:n},null,2))}finally{y.getModel().endUpdate()}}};EditorUi.prototype.snapshotMermaidIdentity=-function(c,f){f=null!=f?f:"mermaid";for(var k=this.editor.graph,n={},q=k.model.getChildCount(c),t=0;t<q;t++){var u=k.model.getChildAt(c,t),y=u.value;if(null!=y&&"object"===typeof y&&null!=y.getAttribute){var E=y.getAttribute(f+"Id");E&&(n[E]={currentStyle:u.style||"",currentLabel:y.getAttribute("label")||"",baseStyle:y.getAttribute(f+"BaseStyle")||"",baseValue:y.getAttribute(f+"BaseValue")||""})}}return n};EditorUi.prototype.applyMermaidUserCustomizations=function(c,f,k){var n=c.value;null!=n&&"object"===-typeof n&&null!=n.getAttribute&&(k=n.getAttribute((null!=k?k:"mermaid")+"Id"))&&(f=f[k],null!=f&&(c.style=this.mergeMermaidStyleDelta(f.baseStyle,f.currentStyle,c.style||"",c.isEdge()),f.currentLabel!==f.baseValue&&n.setAttribute("label",f.currentLabel)))};EditorUi.prototype.mergeMermaidStyleDelta=function(c,f,k,n){function q(C){var U={},J=[];if(!C)return{map:U,keys:J};C=C.split(";");for(var S=0;S<C.length;S++){var N=C[S];if(N){var R=N.indexOf("=");if(0<R){var T=N.substring(0,R);T in U||J.push(T);-U[T]=N.substring(R+1)}else N in U||J.push(N),U[N]=!0}}return{map:U,keys:J}}c=q(c);f=q(f);var t=q(k),u={exitX:1,exitY:1,exitDx:1,exitDy:1,entryX:1,entryY:1,entryDx:1,entryDy:1,edgeStyle:1,noEdgeStyle:1,orthogonal:1},y=n?{startArrow:1,endArrow:1,startFill:1,endFill:1,startSize:1,endSize:1}:{};n={};k=[];for(var E=0;E<t.keys.length;E++){var I=t.keys[E];n[I]=t.map[I];k.push(I)}for(E=0;E<f.keys.length;E++)I=f.keys[E],u[I]||y[I]||f.map[I]===c.map[I]||(I in n||k.push(I),n[I]=f.map[I]);for(E=0;E<c.keys.length;E++)I=-c.keys[E],u[I]||y[I]||I in f.map||delete n[I];c=[];for(E=0;E<k.length;E++)I=k[E],f=n[I],void 0!==f&&(!0===f?c.push(I):c.push(I+"="+f));return 0<c.length?c.join(";")+";":""};EditorUi.prototype.getSvgForXml=function(c,f,k){var n=null,q=this.createTemporaryGraph(this.editor.graph.getStylesheet());try{document.body.appendChild(q.container),(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,q.getModel()),n=q.getSvg(null,null,f,null,null,null,null,null,null,null,null,k,null,null,-!0,!0)}finally{document.body.removeChild(q.container)}return n};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,k,n){var q=0,t=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(u){var y="";if(null!=this.drive&&null!=this.drive.getUser()){var E=this.drive.getUser();null!=E.email&&0<E.email.indexOf("@")&&(y=E.email.substring(E.email.indexOf("@")+1))}var I={prompt:c,driveDomain:y,options:null!=n?n:{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",-[this],"data",[I],"url",["https://www.draw.io/generate/v3"]);var C=Date.now();y=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(I),"POST");var U=mxUtils.bind(this,function(S){u.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[I],"error",[S],"time",Date.now()-C+" ms"),k(S))}),J=mxUtils.bind(this,function(S){3>q++?u.clear()&&t():U(S)});y.send(mxUtils.bind(this,function(S){if(u.isAlive())if(200<=S.getStatus()&&299>=S.getStatus())this.tryAndHandle(mxUtils.bind(this,+"js/extensions.min.js",u,null,null,null,t))}),n)};EditorUi.prototype.replaceLockedGroupChildren=function(c,f,k,n,q){var t=null!=q&&null!=q.dataAttr?q.dataAttr:"mermaidData",u=null!=q&&null!=q.attrPrefix?q.attrPrefix:"mermaid",B=this.editor.graph;q=mxUtils.parseXml((null!=q&&null!=q.wrapGroup?q.wrapGroup:mxMermaidToDrawio.wrapGroup)(f,k,n));var E=new mxCodec(q);f=new mxGraphModel;E.decode(q.documentElement,f);E=f.getRoot();var I=null;for(q=0;null!=E&&q<f.getChildCount(E)&&null==I;q++)for(var C=f.getChildAt(E,+q),U=0;U<f.getChildCount(C);U++){var K=f.getChildAt(C,U),S=K.value;if(null!=S&&"object"===typeof S&&null!=S.getAttribute&&null!=S.getAttribute(t)){I=K;break}}if(null!=I){E=[];for(q=0;q<f.getChildCount(I);q++)E.push(f.getChildAt(I,q));0==E.length&&(E=[I]);I=f.getGeometry(I);C=S=Infinity;K=B.model.getChildCount(c);for(q=0;q<K;q++){var M=B.model.getChildAt(c,q);B.model.isVertex(M)&&(M=M.getGeometry(),null!=M&&(S=Math.min(S,M.x),C=Math.min(C,M.y)))}var R=Infinity;M=Infinity;for(q=0;q<E.length;q++)f.isVertex(E[q])&&+(K=E[q].getGeometry(),null!=K&&(R=Math.min(R,K.x),M=Math.min(M,K.y)));S=isFinite(S)&&isFinite(R)?S-R:0;C=isFinite(C)&&isFinite(M)?C-M:0;if(0!=S||0!=C)for(q=0;q<E.length;q++)if(M=E[q],K=M.getGeometry(),null!=K){K=K.clone();if(f.isVertex(M))K.x+=S,K.y+=C;else if(f.isEdge(M)){if(null!=K.points)for(R=0;R<K.points.length;R++)null!=K.points[R]&&(K.points[R].x+=S,K.points[R].y+=C);null!=K.sourcePoint&&(K.sourcePoint.x+=S,K.sourcePoint.y+=C);null!=K.targetPoint&&(K.targetPoint.x+=S,K.targetPoint.y+=C)}f.setGeometry(M,+K)}f=this.snapshotMermaidIdentity(c,u);E=B.cloneCells(E,!0);B.getModel().beginUpdate();try{for(U=B.model.getChildCount(c)-1;0<=U;U--)B.model.remove(B.model.getChildAt(c,U));for(q=0;q<E.length;q++)this.applyMermaidUserCustomizations(E[q],f,u),B.model.add(c,E[q]);if(null!=I){var T=B.model.getGeometry(c);null!=T&&(T=T.clone(),T.width=I.width,T.height=I.height,B.model.setGeometry(c,T))}B.setAttributeForCell(c,t,JSON.stringify({data:k,config:n},null,2))}finally{B.getModel().endUpdate()}}};EditorUi.prototype.snapshotMermaidIdentity=+function(c,f){f=null!=f?f:"mermaid";for(var k=this.editor.graph,n={},q=k.model.getChildCount(c),t=0;t<q;t++){var u=k.model.getChildAt(c,t),B=u.value;if(null!=B&&"object"===typeof B&&null!=B.getAttribute){var E=B.getAttribute(f+"Id");E&&(n[E]={currentStyle:u.style||"",currentLabel:B.getAttribute("label")||"",baseStyle:B.getAttribute(f+"BaseStyle")||"",baseValue:B.getAttribute(f+"BaseValue")||""})}}return n};EditorUi.prototype.applyMermaidUserCustomizations=function(c,f,k){var n=c.value;null!=n&&"object"===+typeof n&&null!=n.getAttribute&&(k=n.getAttribute((null!=k?k:"mermaid")+"Id"))&&(f=f[k],null!=f&&(c.style=this.mergeMermaidStyleDelta(f.baseStyle,f.currentStyle,c.style||"",c.isEdge()),f.currentLabel!==f.baseValue&&n.setAttribute("label",f.currentLabel)))};EditorUi.prototype.mergeMermaidStyleDelta=function(c,f,k,n){function q(C){var U={},K=[];if(!C)return{map:U,keys:K};C=C.split(";");for(var S=0;S<C.length;S++){var M=C[S];if(M){var R=M.indexOf("=");if(0<R){var T=M.substring(0,R);T in U||K.push(T);+U[T]=M.substring(R+1)}else M in U||K.push(M),U[M]=!0}}return{map:U,keys:K}}c=q(c);f=q(f);var t=q(k),u={exitX:1,exitY:1,exitDx:1,exitDy:1,entryX:1,entryY:1,entryDx:1,entryDy:1,edgeStyle:1,noEdgeStyle:1,orthogonal:1},B=n?{startArrow:1,endArrow:1,startFill:1,endFill:1,startSize:1,endSize:1}:{};n={};k=[];for(var E=0;E<t.keys.length;E++){var I=t.keys[E];n[I]=t.map[I];k.push(I)}for(E=0;E<f.keys.length;E++)I=f.keys[E],u[I]||B[I]||f.map[I]===c.map[I]||(I in n||k.push(I),n[I]=f.map[I]);for(E=0;E<c.keys.length;E++)I=+c.keys[E],u[I]||B[I]||I in f.map||delete n[I];c=[];for(E=0;E<k.length;E++)I=k[E],f=n[I],void 0!==f&&(!0===f?c.push(I):c.push(I+"="+f));return 0<c.length?c.join(";")+";":""};EditorUi.prototype.getSvgForXml=function(c,f,k){var n=null,q=this.createTemporaryGraph(this.editor.graph.getStylesheet());try{document.body.appendChild(q.container),(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,q.getModel()),n=q.getSvg(null,null,f,null,null,null,null,null,null,null,null,k,null,null,+!0,!0)}finally{document.body.removeChild(q.container)}return n};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,k,n){var q=0,t=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(u){var B="";if(null!=this.drive&&null!=this.drive.getUser()){var E=this.drive.getUser();null!=E.email&&0<E.email.indexOf("@")&&(B=E.email.substring(E.email.indexOf("@")+1))}var I={prompt:c,driveDomain:B,options:null!=n?n:{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",+[this],"data",[I],"url",["https://www.draw.io/generate/v3"]);var C=Date.now();B=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(I),"POST");var U=mxUtils.bind(this,function(S){u.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[I],"error",[S],"time",Date.now()-C+" ms"),k(S))}),K=mxUtils.bind(this,function(S){3>q++?u.clear()&&t():U(S)});B.send(mxUtils.bind(this,function(S){if(u.isAlive())if(200<=S.getStatus()&&299>=S.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var R=S.getText();try{R=JSON.parse(R),result=R.result}catch(v){result=R}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[I],"response",[R],"time",Date.now()-C+" ms");R=Editor.extractGraphModelFromText(result);if(null!=R&&""!=R[1])u.clear()&&f(R[1]);else if("<"==mxUtils.trim(result).charAt(0))u.clear()&&f(result);else{var T=this.extractMermaidDeclaration(result)||result;this.parseMermaidDiagram(T,null,mxUtils.bind(this,function(v){this.tryAndHandle(mxUtils.bind(this,-function(){u.clear()&&f(mxMermaidToDrawio.wrapGroup(v,T,null))}),U)}),U,J)}}),U,!0);else{var N={message:mxResources.get("error")+" "+S.getStatus()};try{N=JSON.parse(S.getText()),null!=N.error&&(N.message=N.error)}catch(R){}U(N)}}),U)}),k)});t()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("(Begins)");for(var k=mxUtils.trim(1>=+function(){u.clear()&&f(mxMermaidToDrawio.wrapGroup(v,T,null))}),U)}),U,K)}}),U,!0);else{var M={message:mxResources.get("error")+" "+S.getStatus()};try{M=JSON.parse(S.getText()),null!=M.error&&(M.message=M.error)}catch(R){}U(M)}}),U)}),k)});t()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("(Begins)");for(var k=mxUtils.trim(1>=f.length?c:f[1]),n=k.split("\n"),q=0;q<n.length&&("mermaid"==n[q]||0==n[q].trim().length||"%%"==n[q].substring(0,2));)q++;k=[];for(var t=q;t<n.length;t++){var u=mxUtils.trim(n[t]);if("%%"!=u.substring(0,2)&&"classDef "!=u.substring(0,9))k.push(n[t]);else if("mermaid"==u)break}n=k;k=mxUtils.trim(n.join("\n"));t="undefined"!==typeof MermaidParser?MermaidParser.detectType(k):null;EditorUi.debug("EditorUi.extractMermaidDeclaration","value",[c],"text",[k],"typeInfo",[t],"startLine",q,"lines",n,"tokens",f);return null!=t?k:null};EditorUi.prototype.getMermaidDiagramType=function(c){var f=null!=c?c.split("\n"):[],k=0;c=function(){for(;k<f.length&&(0==f[k].trim().length||"%%"==f[k].substring(0,2));)k++};c();if(k<f.length&&"---"==f[k].trim()){do k++;while(k<f.length&&"---"!=f[k].trim());k++;c()}if(k>=f.length)return"";c=f[k].trim().toLowerCase();var n=c.indexOf(" ");return c.substring(0,0<n?n:c.length)};EditorUi.prototype.isMermaidElkFlowchart=function(c){return null!=c&&(/defaultRenderer["']?\s*:\s*["']?elk/i.test(c)||/(?:^|\n)\s*layout\s*:\s*["']?elk\b/i.test(c))&&/(?:flowchart|graph)\b/i.test(c)};EditorUi.prototype.applyMermaidElkPostPass=function(c,f,k){if("undefined"===typeof ElkLayout||"undefined"===typeof Graph)k(c);else{f=f.match(/(?:flowchart|graph)\s+(LR|RL|TB|TD|BT)/i);var n={LR:"RIGHT",RL:"LEFT",TB:"DOWN",TD:"DOWN",BT:"UP"};f=f?n[f[1].toUpperCase()]||"DOWN":"DOWN";var q=document.createElement("div");q.style.cssText="position:absolute;left:-99999px;top:-99999px;width:1200px;height:800px;visibility:hidden;";-document.body.appendChild(q);var t=null,u=!1,y=function(I){if(!u){u=!0;try{null!=t&&t.destroy()}catch(C){}q.remove();k(I)}};try{t=new Graph(q);t.foldingEnabled=!1;t.setEnabled(!1);t.setHtmlLabels(!0);var E=mxUtils.parseXml(c);(new mxCodec(E)).decode(E.documentElement,t.getModel());(new ElkLayout(t,"layered",{"elk.direction":f,"elk.layered.cycleBreaking.strategy":"GREEDY"},Object.assign({mermaidPolicy:!0},ElkLayout.CANONICAL_EDGE))).execute(t.getDefaultParent(),function(I){var C=null;if(!I)try{var U=-new mxCodec;C=mxUtils.getXml(U.encode(t.getModel()))}catch(J){}y(null!=C?C:c)})}catch(I){if(u)throw I;y(c)}}};EditorUi.prototype.parseMermaidDiagram=function(c,f,k,n,q){var t=mxUtils.bind(this,function(y){null!=q?q(y):null!=n?n(y):this.handleError(y)});if(EditorUi.isMermaidSupported())try{var u=mxMermaidToDrawio.parseText(c,this.getMermaidConfig(c,f));null!=u?this.isMermaidElkFlowchart(c)?this.applyMermaidElkPostPass(u,c,k):k(u):t(Error("Unsupported diagram type: "+this.getMermaidDiagramType(c)))}catch(y){t(y)}else t(Error("Mermaid parser not available"))};+document.body.appendChild(q);var t=null,u=!1,B=function(I){if(!u){u=!0;try{null!=t&&t.destroy()}catch(C){}q.remove();k(I)}};try{t=new Graph(q);t.foldingEnabled=!1;t.setEnabled(!1);t.setHtmlLabels(!0);var E=mxUtils.parseXml(c);(new mxCodec(E)).decode(E.documentElement,t.getModel());(new ElkLayout(t,"layered",{"elk.direction":f,"elk.layered.cycleBreaking.strategy":"GREEDY"},Object.assign({mermaidPolicy:!0},ElkLayout.CANONICAL_EDGE))).execute(t.getDefaultParent(),function(I){var C=null;if(!I)try{var U=+new mxCodec;C=mxUtils.getXml(U.encode(t.getModel()))}catch(K){}B(null!=C?C:c)})}catch(I){if(u)throw I;B(c)}}};EditorUi.prototype.parseMermaidDiagram=function(c,f,k,n,q){var t=mxUtils.bind(this,function(B){null!=q?q(B):null!=n?n(B):this.handleError(B)});if(EditorUi.isMermaidSupported())try{var u=mxMermaidToDrawio.parseText(c,this.getMermaidConfig(c,f));null!=u?this.isMermaidElkFlowchart(c)?this.applyMermaidElkPostPass(u,c,k):k(u):t(Error("Unsupported diagram type: "+this.getMermaidDiagramType(c)))}catch(B){t(B)}else t(Error("Mermaid parser not available"))};EditorUi.prototype.loadMermaid=function(c,f){var k=mxUtils.bind(this,function(q){this.loadingMermaid=!1;f(q)}),n=mxUtils.bind(this,function(){try{this.loadingMermaid=!1,c()}catch(q){k(q)}});"undefined"!==typeof mxMermaidToDrawio||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(n,0):(this.loadingMermaid=!0,"undefined"!==typeof urlParams&&"1"==urlParams.dev||window.location.search&&0<=window.location.search.indexOf("dev=1")?mxscript("js/elk/drawio-elk.min.js",function(){mxscript("js/mermaid/drawio-mermaid.min.js",n,null,null,null,k)},null,null,null,k):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",n,null,null,null,k))};EditorUi.prototype.loadPlantUml=function(c,f){var k=mxUtils.bind(this,function(t){this.loadingPlantUml=!1;f(t)}),n=mxUtils.bind(this,function(){try{this.loadingPlantUml=!1,c()}catch(t){k(t)}});if("undefined"!==typeof mxPlantUmlToDrawio||this.loadingPlantUml)window.setTimeout(n,0);else{this.loadingPlantUml=!0;var q="undefined"!==typeof urlParams&&"1"==urlParams.dev||window.location.search&&0<=window.location.search.indexOf("dev=1");mxscript((q?"":window.DRAWIO_SERVER_URL)+"js/plantuml/drawio-plantuml.min.js",n,null,null,null,k)}};EditorUi.prototype.parsePlantUmlDiagram=function(c,f,k,n){var q=mxUtils.bind(this,function(t){null!=n?n(t):this.handleError(t)});this.loadPlantUml(mxUtils.bind(this,function(){if(EditorUi.isNativePlantUmlSupported())try{k(mxPlantUmlToDrawio.parseText(c,f))}catch(t){q(t)}else q(Error("PlantUML parser not available"))}),q)};EditorUi.prototype.parsePlantUmlImage=@@ -14021,105 +14025,105 @@ function(c,f,k){this.parsePlantUmlDiagram(c,null,mxUtils.bind(this,function(n){fn=parseFloat(c.getAttribute("height"));if(isNaN(k)||isNaN(n)){try{var q=c.getAttribute("viewBox").split(/\s+/);k=parseFloat(q[2]);n=parseFloat(q[3])}catch(t){}k=k||100;n=n||100}return{data:this.convertDataUri(Editor.createSvgDataUri(mxUtils.getXml(c))),width:k,height:n,border:f}};EditorUi.prototype.createMermaidImageXml=function(c,f,k,n,q,t){q=this.getMermaidImageForXml(k,q);k=new Graph(document.createElement("div"));q=k.insertVertex(null,null,null,0,0,q.width,q.height,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;editIcon=1;groupPadding="+q.border+";image="+q.data+";");k.setAttributeForCell(q,null!=t?t:"mermaidData",JSON.stringify({data:c,config:f},null,2));null!=n&&k.setAttributeForCell(q,"templatePrompt",n);c=new mxCodec;return mxUtils.getXml(c.encode(k.getModel()))};EditorUi.prototype.parseMermaidImage=function(c,f,k){this.parseMermaidDiagram(c,mxUtils.clone(EditorUi.legacyMermaidConfig),mxUtils.bind(this,function(n){f(this.createMermaidImageXml(c,null,n))}),k)};EditorUi.prototype.getMermaidImageBorder=function(c,f){c=parseFloat(mxUtils.getValue(this.editor.graph.getCurrentCellStyle(c,!0),"groupPadding",""));return isNaN(c)?f:c};EditorUi.prototype.updateMermaidImage=function(c,f,k,n,q,t){var u=this.editor.graph;n=this.getMermaidImageForXml(n,q);u.setCellStyles("image",n.data,[c]);u.setCellStyles("editIcon","1",[c]);u.setCellStyles("groupPadding",n.border,[c]);q=u.model.getGeometry(c);null!=q&&(q=q.clone(),q.width=n.width,q.height=n.height,u.cellsResized([c],[q],!1));u.setAttributeForCell(c,null!=t?t:"mermaidData",JSON.stringify({data:f,config:k},null,2))};EditorUi.prototype.refreshMermaidImage=-function(c){var f=this.editor.graph,k=f.getAttributeForCell(c,"plantUmlData"),n=null!=k?"plantUmlData":"mermaidData";k=null!=k?k:f.getAttributeForCell(c,"mermaidData");var q=null;if(null!=k)try{q=JSON.parse(k)}catch(y){}if(null!=q&&null!=q.data&&null==q.format){var t=this.getMermaidImageBorder(c,q.border);k=function(){};var u=mxUtils.bind(this,function(y){if(f.model.contains(c)&&this.getMermaidImageBorder(c,q.border)==t){f.model.beginUpdate();try{this.updateMermaidImage(c,q.data,null,y,t,n)}finally{f.model.endUpdate()}}});-"plantUmlData"==n?this.parsePlantUmlDiagram(q.data,null,u,k):this.parseMermaidDiagram(q.data,mxUtils.clone(EditorUi.legacyMermaidConfig),u,k)}};EditorUi.prototype.replaceMermaidCell=function(c,f){var k=this.editor.graph,n=k.getBoundingBoxFromGeometry([c]),q=null!=n?n.x:0;n=null!=n?n.y:0;for(var t=k.model.getParent(c);null!=t&&k.model.isVertex(t);){var u=k.model.getGeometry(t);null!=u&&(q+=u.x,n+=u.y);t=k.model.getParent(t)}k.getModel().beginUpdate();try{var y=this.importXml(f,q,n,!0,null,null,!0);-k.model.remove(c);k.setSelectionCells(y)}finally{k.getModel().endUpdate()}k.scrollCellToVisible(k.getSelectionCell());return y};EditorUi.prototype.insertAsPreText=function(c,f,k){var n=this.editor.graph,q=null;n.getModel().beginUpdate();try{q=n.insertVertex(null,null,"<pre>"+c+"</pre>",f,k,1,1,"text;html=1;align=left;verticalAlign=top;"),n.updateCellSize(q,!0)}finally{n.getModel().endUpdate()}return q};EditorUi.prototype.insertTextAt=function(c,f,k,n,q,t,u,y){t=null!=t?t:!0;u=null!=u?u:!0;if(null!=-c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(J){4==J.readyState&&200<=J.status&&299>=J.status&&this.editor.graph.setSelectionCells(this.insertTextAt(J.responseText,f,k,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(q||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var E=this.editor.graph;if("data:application/pdf;base64,"==-c.substring(0,28)){var I=Editor.extractGraphModelFromPdf(c);if(null!=I&&0<I.length)return this.importXml(I,f,k,t,!0,y)}if(Editor.isPngDataUrl(c)&&(I=Editor.extractGraphModelFromPng(c),null!=I&&0<I.length))return this.importXml(I,f,k,t,!0,y);if("data:image/svg+xml;"==c.substring(0,19))try{I=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(I=c.substring(c.indexOf(",")+1),I=window.atob&&!mxClient.IS_SF?atob(I):Base64.decode(I,!0)):I=decodeURIComponent(c.substring(c.indexOf(",")+1));var C=this.importXml(I,-f,k,t,!0,y);if(0<C.length)return C}catch(J){}this.loadImage(c,mxUtils.bind(this,function(J){if("data:"==c.substring(0,5))this.resizeImage(J,Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(R,T,v){E.setSelectionCell(E.insertVertex(null,null,"",E.snap(f),E.snap(k),T,v,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(R)+";"))}),u,this.maxImageSize);else{var S=Math.min(1,Math.min(this.maxImageSize/-J.width,this.maxImageSize/J.height)),N=Math.round(J.width*S);J=Math.round(J.height*S);E.setSelectionCell(E.insertVertex(null,null,"",E.snap(f),E.snap(k),N,J,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var J=null;E.getModel().beginUpdate();try{J=E.insertVertex(E.getDefaultParent(),null,c,E.snap(f),E.snap(k),1,1,"text;"+(n?"html=1;":"")),E.updateCellSize(J),E.fireEvent(new mxEventObject("textInserted",-"cells",[J]))}finally{E.getModel().endUpdate()}E.setSelectionCell(J)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,f,k,t,null,y);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(J){this.editor.graph.setSelectionCells(this.importXml(J,f,k,t,null,y))}),mxUtils.bind(this,function(J){this.handleError(J)}));else{E=this.editor.graph;q=null;E.getModel().beginUpdate();try{q=E.insertVertex(E.getDefaultParent(),+function(c){var f=this.editor.graph,k=f.getAttributeForCell(c,"plantUmlData"),n=null!=k?"plantUmlData":"mermaidData";k=null!=k?k:f.getAttributeForCell(c,"mermaidData");var q=null;if(null!=k)try{q=JSON.parse(k)}catch(B){}if(null!=q&&null!=q.data&&null==q.format){var t=this.getMermaidImageBorder(c,q.border);k=function(){};var u=mxUtils.bind(this,function(B){if(f.model.contains(c)&&this.getMermaidImageBorder(c,q.border)==t){f.model.beginUpdate();try{this.updateMermaidImage(c,q.data,null,B,t,n)}finally{f.model.endUpdate()}}});+"plantUmlData"==n?this.parsePlantUmlDiagram(q.data,null,u,k):this.parseMermaidDiagram(q.data,mxUtils.clone(EditorUi.legacyMermaidConfig),u,k)}};EditorUi.prototype.replaceMermaidCell=function(c,f){var k=this.editor.graph,n=k.getBoundingBoxFromGeometry([c]),q=null!=n?n.x:0;n=null!=n?n.y:0;for(var t=k.model.getParent(c);null!=t&&k.model.isVertex(t);){var u=k.model.getGeometry(t);null!=u&&(q+=u.x,n+=u.y);t=k.model.getParent(t)}k.getModel().beginUpdate();try{var B=this.importXml(f,q,n,!0,null,null,!0);+k.model.remove(c);k.setSelectionCells(B)}finally{k.getModel().endUpdate()}k.scrollCellToVisible(k.getSelectionCell());return B};EditorUi.prototype.insertAsPreText=function(c,f,k){var n=this.editor.graph,q=null;n.getModel().beginUpdate();try{q=n.insertVertex(null,null,"<pre>"+c+"</pre>",f,k,1,1,"text;html=1;align=left;verticalAlign=top;"),n.updateCellSize(q,!0)}finally{n.getModel().endUpdate()}return q};EditorUi.prototype.insertTextAt=function(c,f,k,n,q,t,u,B){t=null!=t?t:!0;u=null!=u?u:!0;if(null!=+c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(K){4==K.readyState&&200<=K.status&&299>=K.status&&this.editor.graph.setSelectionCells(this.insertTextAt(K.responseText,f,k,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(q||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var E=this.editor.graph;if("data:application/pdf;base64,"==+c.substring(0,28)){var I=Editor.extractGraphModelFromPdf(c);if(null!=I&&0<I.length)return this.importXml(I,f,k,t,!0,B)}if(Editor.isPngDataUrl(c)&&(I=Editor.extractGraphModelFromPng(c),null!=I&&0<I.length))return this.importXml(I,f,k,t,!0,B);if("data:image/svg+xml;"==c.substring(0,19))try{I=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(I=c.substring(c.indexOf(",")+1),I=window.atob&&!mxClient.IS_SF?atob(I):Base64.decode(I,!0)):I=decodeURIComponent(c.substring(c.indexOf(",")+1));var C=this.importXml(I,+f,k,t,!0,B);if(0<C.length)return C}catch(K){}this.loadImage(c,mxUtils.bind(this,function(K){if("data:"==c.substring(0,5))this.resizeImage(K,Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(R,T,v){E.setSelectionCell(E.insertVertex(null,null,"",E.snap(f),E.snap(k),T,v,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(R)+";"))}),u,this.maxImageSize);else{var S=Math.min(1,Math.min(this.maxImageSize/+K.width,this.maxImageSize/K.height)),M=Math.round(K.width*S);K=Math.round(K.height*S);E.setSelectionCell(E.insertVertex(null,null,"",E.snap(f),E.snap(k),M,K,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var K=null;E.getModel().beginUpdate();try{K=E.insertVertex(E.getDefaultParent(),null,c,E.snap(f),E.snap(k),1,1,"text;"+(n?"html=1;":"")),E.updateCellSize(K),E.fireEvent(new mxEventObject("textInserted",+"cells",[K]))}finally{E.getModel().endUpdate()}E.setSelectionCell(K)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,f,k,t,null,B);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(K){this.editor.graph.setSelectionCells(this.importXml(K,f,k,t,null,B))}),mxUtils.bind(this,function(K){this.handleError(K)}));else{E=this.editor.graph;q=null;E.getModel().beginUpdate();try{q=E.insertVertex(E.getDefaultParent(),null,"",E.snap(f),E.snap(k),1,1,"text;whiteSpace=wrap;"+(n?"html=1;":""));E.fireEvent(new mxEventObject("textInserted","cells",[q]));n&&(c=E.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");q.value=c;E.updateCellSize(q);if(0<this.maxTextWidth&&q.geometry.width>this.maxTextWidth){var U=E.getPreferredSizeForCell(q,this.maxTextWidth);q.geometry.width=U.width;q.geometry.height=U.height}Graph.isLink(q.value)&&E.setLinkForCell(q,q.value);q.geometry.width+=E.gridSize;q.geometry.height+=E.gridSize}finally{E.getModel().endUpdate()}return[q]}}return[]};EditorUi.prototype.formatFileSize=function(c){var f=-1;do c/=1024,f++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[f]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var f=c.indexOf(";");0<f&&(c=c.substring(0,f)+c.substring(c.indexOf(",",f+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,f){return/("contentType":\s*"application\/gliffy\+json")/.test(c)};EditorUi.prototype.isLucidChartData=function(c){return null!=c&&('{"state":"{\\"Properties\\":'==c.substring(0,26)||'{"Properties":'==c.substring(0,14))};EditorUi.prototype.importLocalFile=function(c,f){if(c&&Graph.fileSupport){if(null==this.importFileInputElt){var k=document.createElement("input");k.setAttribute("type","file");mxEvent.addListener(k,"change",mxUtils.bind(this,function(){null!=k.files&&(this.importFiles(k.files,null,null,this.maxImageSize),k.type="",k.type="file",k.value="")}));k.style.display=-"none";document.body.appendChild(k);this.importFileInputElt=k}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(u,y){StorageFile.listFiles(this,"F",u,y)});window.openBrowserFile=mxUtils.bind(this,function(u,y,E){StorageFile.getFileContent(this,u,y,E)});window.deleteBrowserFile=mxUtils.bind(this,function(u,y,E){StorageFile.deleteFile(this,u,y,E)});if(!f){var n=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=-new OpenFile(mxUtils.bind(this,function(u){this.hideDialog(u)}));window.openFile.setConsumer(mxUtils.bind(this,function(u,y){null!=y&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(y)?(u=new Blob([u],{type:"application/octet-stream"}),this.importVisio(u,mxUtils.bind(this,function(E){this.importXml(E,0,0,!0)}),null,y)):this.editor.graph.setSelectionCells(this.importXml(u,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,-function(){window.openFile=null});if(!f){var q=this.dialog,t=q.close;this.dialog.close=mxUtils.bind(this,function(u){Editor.useLocalStorage=n;t.apply(q,arguments);u&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,f,k){var n=this,q=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(t){if(mxUtils.isEmptyObject(t.files))k();else{var u=0,y,E=!1;t.forEach(function(I,C){I=-C.name.toLowerCase();"diagram/diagram.xml"==I?(E=!0,C.async("string").then(function(U){0==U.indexOf("<mxfile ")?f(U):k()})):0==I.indexOf("versions/")&&(I=parseInt(I.substr(9)),I>u&&(u=I,y=C))});0<u?y.async("string").then(function(I){(new XMLHttpRequest).upload&&n.isRemoteFileFormat(I,c.name)?n.isOffline()?n.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):n.parseFileData(I,mxUtils.bind(this,function(C){4==C.readyState&&(200<=C.status&&299>=C.status?f(C.responseText):k())}),-c.name):k()}):E||k()}},function(t){k(t)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?q():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,k))};EditorUi.prototype.importFile=function(c,f,k,n,q,t,u,y,E,I,C,U){I=null!=I?I:!0;var J=!1,S=null,N=mxUtils.bind(this,function(R){var T=null;null!=R&&"<mxlibrary"==R.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,R,u)),this.showSidebar()):T=this.importXml(R,k,n,I,null,-null!=U?mxEvent.isControlDown(U):null);null!=y&&y(T)});"image"==f.substring(0,5)?(E=!1,"image/png"==f.substring(0,9)&&(C=C?null:this.extractGraphModelFromPng(c),null!=C&&0<C.length&&(S=this.importXml(C,k,n,I,null,null!=U?mxEvent.isControlDown(U):null),E=!0)),E||(E=this.editor.graph,C=c.indexOf(";"),0<C&&(c=c.substring(0,C)+c.substring(c.indexOf(",",C+1))),I&&E.isGridEnabled()&&(k=E.snap(k),n=E.snap(n)),C="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;",-"image/svg"==f.substring(0,9)&&(C+="editableCssRules=.*;"),S=[E.insertVertex(null,null,"",k,n,q,t,C+"image="+c+";")])):/(\.*<graphml )/.test(c)?(J=!0,this.importGraphML(c,N)):null!=E&&null!=u&&EditorUi.isVisioFilename(u)?(J=!0,this.importVisio(E,N)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,u)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(J=!0,f=mxUtils.bind(this,function(R){4==R.readyState&&(200<=R.status&&299>=R.status?N(R.responseText):-null!=y&&(y(null),this.showError(mxResources.get("error"),413==R.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,f,u):this.parseFile(E,f,u)):0==c.indexOf("PK")&&null!=E?(J=!0,this.importZipFile(E,N,mxUtils.bind(this,function(){S=this.insertTextAt(this.validateFileData(c),k,n,!0,null,I);y(S)}))):/(\.v(sd|dx))($|\?)/i.test(u)||/(\.vs(s|x))($|\?)/i.test(u)||(S=this.insertTextAt(this.validateFileData(c),k,n,!0,null,I,null,null!=U?mxEvent.isControlDown(U):-null));J||null==y||y(S);return S};EditorUi.prototype.importFiles=function(c,f,k,n,q,t,u,y,E,I,C,U,J){n=null!=n?n:this.maxImageSize;I=null!=I?I:this.maxImageBytes;var S=null!=f&&null!=k,N=!0;f=null!=f?f:0;k=null!=k?k:0;var R=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var T=C||this.resampleThreshold,v=0;v<c.length;v++)if("image/svg"!==c[v].type.substring(0,9)&&"image/"===c[v].type.substring(0,6)&&c[v].size>T){R=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[f],"y",[k],"maxSize",-[n],"maxBytes",[I],"resampleThreshold",[this.resampleThreshold],"largeImages",[R],"crop",[S],"resizeImages",[N],"ignoreEmbeddedXml",[U],"evt",[J]);var d=mxUtils.bind(this,function(){var m=this.editor.graph,r=m.gridSize;q=null!=q?q:mxUtils.bind(this,function(Y,H,W,Z,X,ba,ea,aa,ha){try{if(null!=Y&&"<mxlibrary"==Y.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,Y,ea)),this.showSidebar(),null;this.isCompatibleString(Y)&&1==c.length&&null!=J&&"drop"==J.type&&this.isBlankFile()&&-!this.canUndo()&&(S=!1,Z=W=0);return this.importFile(Y,H,W,Z,X,ba,ea,aa,ha,S,U,J)}catch(na){return this.handleError(na),null}});t=null!=t?t:mxUtils.bind(this,function(Y){m.setSelectionCells(Y)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var A=this.currentPage,D=c.length,G=D,O=[],P=mxUtils.bind(this,function(Y,H){O[Y]=H;if(0==--G){this.spinner.stop();if(null!=y)y(O);else{var W=[];m.getModel().beginUpdate();try{for(Y=0;Y<O.length;Y++){var Z=O[Y]();null!=Z&&(W=W.concat(Z))}}finally{m.getModel().endUpdate()}}A!=-this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);t(W)}}),V=0;V<D;V++)mxUtils.bind(this,function(Y){var H=c[Y];if(null!=H){var W=new FileReader;W.onload=mxUtils.bind(this,function(Z){if(null==u||u(H))try{if("image/"==H.type.substring(0,6))if("image/svg"==H.type.substring(0,9)){var X=Graph.clipSvgDataUri(Z.target.result),ba=X.indexOf(","),ea=decodeURIComponent(escape(atob(X.substring(ba+1)))),aa=mxUtils.parseXml(ea),ha=aa.getElementsByTagName("svg");-if(0<ha.length){var na=ha[0],ra=U?null:na.getAttribute("content");null!=ra&&"<"!=ra.charAt(0)&&"%"!=ra.charAt(0)&&(ra=unescape(window.atob?atob(ra):Base64.decode(ra,!0)));null!=ra&&"%"==ra.charAt(0)&&(ra=decodeURIComponent(ra));null==ra||"<mxfile "!==ra.substring(0,8)&&"<mxGraphModel>"!==ra.substring(0,14)&&"<mxGraphModel "!==ra.substring(0,14)?P(Y,mxUtils.bind(this,function(){try{if(null!=aa){var xa=aa.getElementsByTagName("svg");if(0<xa.length){var qa=xa[0],Aa=qa.getAttribute("width"),Ba=qa.getAttribute("height");-Aa=null!=Aa&&"%"!=Aa.charAt(Aa.length-1)?parseFloat(Aa):NaN;Ba=null!=Ba&&"%"!=Ba.charAt(Ba.length-1)?parseFloat(Ba):NaN;var Ea=qa.getAttribute("viewBox");if(null==Ea||0==Ea.length)qa.setAttribute("viewBox","0 0 "+Aa+" "+Ba);else if(isNaN(Aa)||isNaN(Ba)){var Fa=Ea.split(" ");3<Fa.length&&(Aa=parseFloat(Fa[2]),Ba=parseFloat(Fa[3]))}X=Editor.createSvgDataUri(mxUtils.getXml(qa));var ca=Math.min(1,Math.min(n/Math.max(1,Aa)),n/Math.max(1,Ba)),fa=q(X,H.type,f+Y*r,k+Y*r,Math.max(1,Math.round(Aa*ca)),Math.max(1,-Math.round(Ba*ca)),H.name);if(null!=fa&&(isNaN(Aa)||isNaN(Ba))){var oa=new Image;oa.onload=mxUtils.bind(this,function(){Aa=Math.max(1,oa.width);Ba=Math.max(1,oa.height);fa[0].geometry.width=Aa;fa[0].geometry.height=Ba;qa.setAttribute("viewBox","0 0 "+Aa+" "+Ba);X=Editor.createSvgDataUri(mxUtils.getXml(qa));var pa=X.indexOf(";");0<pa&&(X=X.substring(0,pa)+X.substring(X.indexOf(",",pa+1)));m.setCellStyles("image",X,[fa[0]])});oa.src=Editor.createSvgDataUri(mxUtils.getXml(qa))}return fa}}}catch(pa){}return null})):-P(Y,mxUtils.bind(this,function(){return q(ra,"text/xml",f+Y*r,k+Y*r,0,0,H.name)}))}else P(Y,mxUtils.bind(this,function(){return null}))}else{ba=!1;if("image/png"==H.type){var sa=U?null:this.extractGraphModelFromPng(Z.target.result);if(null!=sa&&0<sa.length){var ua=new Image;ua.src=Z.target.result;P(Y,mxUtils.bind(this,function(){return q(sa,"text/xml",f+Y*r,k+Y*r,ua.width,ua.height,H.name)}));ba=!0}}ba||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),-mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(Z.target.result,mxUtils.bind(this,function(xa){this.resizeImage(xa,Editor.stripImageMetadata(Z.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(qa,Aa,Ba){P(Y,mxUtils.bind(this,function(){if(null!=qa&&qa.length<I){var Ea=N&&this.isResampleImageSize(H.size,C)?Math.min(1,Math.min(n/Aa,n/Ba)):1;return q(qa,H.type,f+-Y*r,k+Y*r,Math.round(Aa*Ea),Math.round(Ba*Ea),H.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),N,n,C,H.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else X=Z.target.result,q(X,H.type,f+Y*r,k+Y*r,240,160,H.name,function(xa){P(Y,function(){return xa})},H)}catch(xa){P(Y,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(xa,H)}else P(Y,mxUtils.bind(this,function(){return null}))});-EditorUi.isVisioFilename(H.name)?q(null,H.type,f+Y*r,k+Y*r,240,160,H.name,function(Z){P(Y,function(){return Z})},H):"image"==H.type.substring(0,5)||"application/pdf"==H.type?W.readAsDataURL(H):W.readAsText(H)}})(V)});if(R){R=[];for(v=0;v<c.length;v++)R.push(c[v]);c=R;this.confirmImageResize(function(m){N=m;d()},E)}else d()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};+"none";document.body.appendChild(k);this.importFileInputElt=k}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(u,B){StorageFile.listFiles(this,"F",u,B)});window.openBrowserFile=mxUtils.bind(this,function(u,B,E){StorageFile.getFileContent(this,u,B,E)});window.deleteBrowserFile=mxUtils.bind(this,function(u,B,E){StorageFile.deleteFile(this,u,B,E)});if(!f){var n=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=+new OpenFile(mxUtils.bind(this,function(u){this.hideDialog(u)}));window.openFile.setConsumer(mxUtils.bind(this,function(u,B){null!=B&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(B)?(u=new Blob([u],{type:"application/octet-stream"}),this.importVisio(u,mxUtils.bind(this,function(E){this.importXml(E,0,0,!0)}),null,B)):this.editor.graph.setSelectionCells(this.importXml(u,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,+function(){window.openFile=null});if(!f){var q=this.dialog,t=q.close;this.dialog.close=mxUtils.bind(this,function(u){Editor.useLocalStorage=n;t.apply(q,arguments);u&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,f,k){var n=this,q=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(t){if(mxUtils.isEmptyObject(t.files))k();else{var u=0,B,E=!1;t.forEach(function(I,C){I=+C.name.toLowerCase();"diagram/diagram.xml"==I?(E=!0,C.async("string").then(function(U){0==U.indexOf("<mxfile ")?f(U):k()})):0==I.indexOf("versions/")&&(I=parseInt(I.substr(9)),I>u&&(u=I,B=C))});0<u?B.async("string").then(function(I){(new XMLHttpRequest).upload&&n.isRemoteFileFormat(I,c.name)?n.isOffline()?n.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):n.parseFileData(I,mxUtils.bind(this,function(C){4==C.readyState&&(200<=C.status&&299>=C.status?f(C.responseText):k())}),+c.name):k()}):E||k()}},function(t){k(t)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?q():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,k))};EditorUi.prototype.importFile=function(c,f,k,n,q,t,u,B,E,I,C,U){I=null!=I?I:!0;var K=!1,S=null,M=mxUtils.bind(this,function(R){var T=null;null!=R&&"<mxlibrary"==R.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,R,u)),this.showSidebar()):T=this.importXml(R,k,n,I,null,+null!=U?mxEvent.isControlDown(U):null);null!=B&&B(T)});"image"==f.substring(0,5)?(E=!1,"image/png"==f.substring(0,9)&&(C=C?null:this.extractGraphModelFromPng(c),null!=C&&0<C.length&&(S=this.importXml(C,k,n,I,null,null!=U?mxEvent.isControlDown(U):null),E=!0)),E||(E=this.editor.graph,C=c.indexOf(";"),0<C&&(c=c.substring(0,C)+c.substring(c.indexOf(",",C+1))),I&&E.isGridEnabled()&&(k=E.snap(k),n=E.snap(n)),C="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;",+"image/svg"==f.substring(0,9)&&(C+="editableCssRules=.*;"),S=[E.insertVertex(null,null,"",k,n,q,t,C+"image="+c+";")])):/(\.*<graphml )/.test(c)?(K=!0,this.importGraphML(c,M)):null!=E&&null!=u&&EditorUi.isVisioFilename(u)?(K=!0,this.importVisio(E,M)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,u)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(K=!0,f=mxUtils.bind(this,function(R){4==R.readyState&&(200<=R.status&&299>=R.status?M(R.responseText):+null!=B&&(B(null),this.showError(mxResources.get("error"),413==R.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,f,u):this.parseFile(E,f,u)):0==c.indexOf("PK")&&null!=E?(K=!0,this.importZipFile(E,M,mxUtils.bind(this,function(){S=this.insertTextAt(this.validateFileData(c),k,n,!0,null,I);B(S)}))):/(\.v(sd|dx))($|\?)/i.test(u)||/(\.vs(s|x))($|\?)/i.test(u)||(S=this.insertTextAt(this.validateFileData(c),k,n,!0,null,I,null,null!=U?mxEvent.isControlDown(U):+null));K||null==B||B(S);return S};EditorUi.prototype.importFiles=function(c,f,k,n,q,t,u,B,E,I,C,U,K){n=null!=n?n:this.maxImageSize;I=null!=I?I:this.maxImageBytes;var S=null!=f&&null!=k,M=!0;f=null!=f?f:0;k=null!=k?k:0;var R=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var T=C||this.resampleThreshold,v=0;v<c.length;v++)if("image/svg"!==c[v].type.substring(0,9)&&"image/"===c[v].type.substring(0,6)&&c[v].size>T){R=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[f],"y",[k],"maxSize",+[n],"maxBytes",[I],"resampleThreshold",[this.resampleThreshold],"largeImages",[R],"crop",[S],"resizeImages",[M],"ignoreEmbeddedXml",[U],"evt",[K]);var d=mxUtils.bind(this,function(){var m=this.editor.graph,r=m.gridSize;q=null!=q?q:mxUtils.bind(this,function(X,H,W,Z,Y,ba,ea,aa,ha){try{if(null!=X&&"<mxlibrary"==X.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,X,ea)),this.showSidebar(),null;this.isCompatibleString(X)&&1==c.length&&null!=K&&"drop"==K.type&&this.isBlankFile()&&+!this.canUndo()&&(S=!1,Z=W=0);return this.importFile(X,H,W,Z,Y,ba,ea,aa,ha,S,U,K)}catch(na){return this.handleError(na),null}});t=null!=t?t:mxUtils.bind(this,function(X){m.setSelectionCells(X)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var z=this.currentPage,D=c.length,F=D,N=[],P=mxUtils.bind(this,function(X,H){N[X]=H;if(0==--F){this.spinner.stop();if(null!=B)B(N);else{var W=[];m.getModel().beginUpdate();try{for(X=0;X<N.length;X++){var Z=N[X]();null!=Z&&(W=W.concat(Z))}}finally{m.getModel().endUpdate()}}z!=+this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);t(W)}}),V=0;V<D;V++)mxUtils.bind(this,function(X){var H=c[X];if(null!=H){var W=new FileReader;W.onload=mxUtils.bind(this,function(Z){if(null==u||u(H))try{if("image/"==H.type.substring(0,6))if("image/svg"==H.type.substring(0,9)){var Y=Graph.clipSvgDataUri(Z.target.result),ba=Y.indexOf(","),ea=decodeURIComponent(escape(atob(Y.substring(ba+1)))),aa=mxUtils.parseXml(ea),ha=aa.getElementsByTagName("svg");+if(0<ha.length){var na=ha[0],ra=U?null:na.getAttribute("content");null!=ra&&"<"!=ra.charAt(0)&&"%"!=ra.charAt(0)&&(ra=unescape(window.atob?atob(ra):Base64.decode(ra,!0)));null!=ra&&"%"==ra.charAt(0)&&(ra=decodeURIComponent(ra));null==ra||"<mxfile "!==ra.substring(0,8)&&"<mxGraphModel>"!==ra.substring(0,14)&&"<mxGraphModel "!==ra.substring(0,14)?P(X,mxUtils.bind(this,function(){try{if(null!=aa){var xa=aa.getElementsByTagName("svg");if(0<xa.length){var qa=xa[0],Aa=qa.getAttribute("width"),Ba=qa.getAttribute("height");+Aa=null!=Aa&&"%"!=Aa.charAt(Aa.length-1)?parseFloat(Aa):NaN;Ba=null!=Ba&&"%"!=Ba.charAt(Ba.length-1)?parseFloat(Ba):NaN;var Ea=qa.getAttribute("viewBox");if(null==Ea||0==Ea.length)qa.setAttribute("viewBox","0 0 "+Aa+" "+Ba);else if(isNaN(Aa)||isNaN(Ba)){var Fa=Ea.split(" ");3<Fa.length&&(Aa=parseFloat(Fa[2]),Ba=parseFloat(Fa[3]))}Y=Editor.createSvgDataUri(mxUtils.getXml(qa));var ca=Math.min(1,Math.min(n/Math.max(1,Aa)),n/Math.max(1,Ba)),fa=q(Y,H.type,f+X*r,k+X*r,Math.max(1,Math.round(Aa*ca)),Math.max(1,+Math.round(Ba*ca)),H.name);if(null!=fa&&(isNaN(Aa)||isNaN(Ba))){var oa=new Image;oa.onload=mxUtils.bind(this,function(){Aa=Math.max(1,oa.width);Ba=Math.max(1,oa.height);fa[0].geometry.width=Aa;fa[0].geometry.height=Ba;qa.setAttribute("viewBox","0 0 "+Aa+" "+Ba);Y=Editor.createSvgDataUri(mxUtils.getXml(qa));var pa=Y.indexOf(";");0<pa&&(Y=Y.substring(0,pa)+Y.substring(Y.indexOf(",",pa+1)));m.setCellStyles("image",Y,[fa[0]])});oa.src=Editor.createSvgDataUri(mxUtils.getXml(qa))}return fa}}}catch(pa){}return null})):+P(X,mxUtils.bind(this,function(){return q(ra,"text/xml",f+X*r,k+X*r,0,0,H.name)}))}else P(X,mxUtils.bind(this,function(){return null}))}else{ba=!1;if("image/png"==H.type){var sa=U?null:this.extractGraphModelFromPng(Z.target.result);if(null!=sa&&0<sa.length){var ua=new Image;ua.src=Z.target.result;P(X,mxUtils.bind(this,function(){return q(sa,"text/xml",f+X*r,k+X*r,ua.width,ua.height,H.name)}));ba=!0}}ba||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),+mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(Z.target.result,mxUtils.bind(this,function(xa){this.resizeImage(xa,Editor.stripImageMetadata(Z.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(qa,Aa,Ba){P(X,mxUtils.bind(this,function(){if(null!=qa&&qa.length<I){var Ea=M&&this.isResampleImageSize(H.size,C)?Math.min(1,Math.min(n/Aa,n/Ba)):1;return q(qa,H.type,f++X*r,k+X*r,Math.round(Aa*Ea),Math.round(Ba*Ea),H.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),M,n,C,H.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else Y=Z.target.result,q(Y,H.type,f+X*r,k+X*r,240,160,H.name,function(xa){P(X,function(){return xa})},H)}catch(xa){P(X,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(xa,H)}else P(X,mxUtils.bind(this,function(){return null}))});+EditorUi.isVisioFilename(H.name)?q(null,H.type,f+X*r,k+X*r,240,160,H.name,function(Z){P(X,function(){return Z})},H):"image"==H.type.substring(0,5)||"application/pdf"==H.type?W.readAsDataURL(H):W.readAsText(H)}})(V)});if(R){R=[];for(v=0;v<c.length;v++)R.push(c[v]);c=R;this.confirmImageResize(function(m){M=m;d()},E)}else d()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,f){f=null!=f?f:!1;var k=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},n=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,q=function(t,u){if(t||f)mxSettings.setResizeImages(t?u:null),mxSettings.save();k();c(u)};null==n||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(t){q(t,!0)},function(t){q(t,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):q(!1,n)};EditorUi.prototype.parseFile=function(c,f,k){k=null!=k?k:c.name;var n=new FileReader;n.onload=mxUtils.bind(this,function(){this.parseFileData(n.result,f,k)});n.readAsText(c)};EditorUi.prototype.parseFileData=function(c,f,k){var n=new XMLHttpRequest;n.open("POST",-OPEN_URL);n.setRequestHeader("Content-Type","application/x-www-form-urlencoded");n.onreadystatechange=function(){f(n)};n.send("format=xml&filename="+encodeURIComponent(k)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(q){}};EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,k,n,q,t,u){q=null!=q?q:this.maxImageSize;var y=Math.max(1,c.width),-E=Math.max(1,c.height),I=f;if(n&&this.isResampleImageSize(null!=u?u:f.length,t))try{var C=Math.max(y/q,E/q);if(1<C){var U=Math.round(y/C),J=Math.round(E/C),S=document.createElement("canvas");S.width=U;S.height=J;S.getContext("2d").drawImage(c,0,0,U,J);var N=S.toDataURL();if(N.length<f.length){var R=document.createElement("canvas");R.width=U;R.height=J;var T=R.toDataURL();N!==T&&(f=N,y=U,E=J)}}}catch(v){}n&&I!=f&&q>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,k,n,q/1.5,t,u):-k(f,y,E)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,f,k){try{var n=new Image;n.onload=function(){n.width=0<n.width?n.width:120;n.height=0<n.height?n.height:120;f(n)};null!=k&&(n.onerror=k);n.src=c}catch(q){if(null!=k)k(q);else throw q;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var x=EditorUi.prototype.createUi;+OPEN_URL);n.setRequestHeader("Content-Type","application/x-www-form-urlencoded");n.onreadystatechange=function(){f(n)};n.send("format=xml&filename="+encodeURIComponent(k)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(q){}};EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,k,n,q,t,u){q=null!=q?q:this.maxImageSize;var B=Math.max(1,c.width),+E=Math.max(1,c.height),I=f;if(n&&this.isResampleImageSize(null!=u?u:f.length,t))try{var C=Math.max(B/q,E/q);if(1<C){var U=Math.round(B/C),K=Math.round(E/C),S=document.createElement("canvas");S.width=U;S.height=K;S.getContext("2d").drawImage(c,0,0,U,K);var M=S.toDataURL();if(M.length<f.length){var R=document.createElement("canvas");R.width=U;R.height=K;var T=R.toDataURL();M!==T&&(f=M,B=U,E=K)}}}catch(v){}n&&I!=f&&q>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,k,n,q/1.5,t,u):+k(f,B,E)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,f,k){try{var n=new Image;n.onload=function(){n.width=0<n.width?n.width:120;n.height=0<n.height?n.height:120;f(n)};null!=k&&(n.onerror=k);n.src=c}catch(q){if(null!=k)k(q);else throw q;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var x=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){if(Editor.isSettingsEnabled()){null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles);this.formatWidth=mxSettings.getFormatWidth();var c=mxSettings.getSidebarWidth();null!=c&&(this.hsplitPosition=parseInt(c))}this.formatEnabled||(this.formatWidth=0);this.sidebarEnabled||(this.hsplitPosition=0);x.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==-urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var B=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,f=this.editor.graph;"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.installAutoRouting&&LibavoidRouting.installAutoRouting(this);this.addListener("styleChanged",mxUtils.bind(this,function(H,W){W.getProperty("force")&&"undefined"!==typeof mxSettings&&+urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var A=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,f=this.editor.graph;"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.installAutoRouting&&LibavoidRouting.installAutoRouting(this);this.addListener("styleChanged",mxUtils.bind(this,function(H,W){W.getProperty("force")&&"undefined"!==typeof mxSettings&&null!=mxSettings.setCurrentEdgeStyle&&null!=mxSettings.settings&&mxSettings.setCurrentEdgeStyle(mxUtils.clone(this.editor.graph.currentEdgeStyle))}));this.restorePersistedEdgeStyle();if(this.editor.isChromelessView()&&"0"!=urlParams.animate){var k=null,n=function(){var H=f.getModel().getRoot();if(H===k&&null!=c.chromelessAnimationPlayer)return!0;k=H;null!=c.chromelessAnimationPlayer&&c.chromelessAnimationPlayer.stop();c.chromelessAnimationPlayer=Editor.playAnimationOnGraph(f);return null!=c.chromelessAnimationPlayer};n();this.editor.addListener("fileLoaded",n);f.addListener(mxEvent.ROOT,n)}var q=f.isEnabled;f.isEnabled=function(){return q.apply(this,arguments)&&!c.isLocked()};f.showLinkIcons=Editor.showLinkIcons||"1"==urlParams["link-icons"];f.showTooltipIcons=Editor.showTooltipIcons||"1"==urlParams["tooltip-icons"];var t=this;f.editTooltip=function(H){null!=H&&t.actions.get("editTooltip").funct()};f.getLinkOverlayTooltip=function(H){if(Graph.isPageLink(H)&&null!=t.pages){var W=H.substring(H.indexOf(",")+1);W=t.getPageById(W);if(null!=W)return W.getName()||mxResources.get("pageWithNumber",[mxUtils.indexOf(t.pages,W)+1])}else if(this.isCustomLink(H))return this.getLinkTitle(H);return H};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(H){var W=H.getEvent();return null==H.getState()&&!mxEvent.isMouseEvent(W)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(W)&&(null==H.getState()||mxEvent.isControlDown(W)||mxEvent.isShiftDown(W))});var u=function(H){H=/(?:^|;)groupPadding=([^;]*)/.exec(null!=-H?H:"");return null!=H?H[1]:null};f.model.addListener(mxEvent.BEFORE_UNDO,function(H,W){H=W.getProperty("edit");if(null!=H&&null!=H.changes){W=H.changes.length;for(var Z=[],X=0;X<W;X++){var ba=H.changes[X];ba instanceof mxStyleChange&&null!=ba.cell&&f.model.isVertex(ba.cell)&&u(ba.style)!=u(ba.previous)&&/(?:^|;)shape=image(?:;|$)/.test(null!=ba.style?ba.style:"")&&(null!=f.getAttributeForCell(ba.cell,"mermaidData")||null!=f.getAttributeForCell(ba.cell,"plantUmlData"))&&0>mxUtils.indexOf(Z,ba.cell)&&-Z.push(ba.cell)}for(X=0;X<Z.length;X++)c.refreshMermaidImage(Z[X])}});var y=function(H){var W=!1;c.showDialog(H.container,640,420,!0,!0,function(Z,X){if(!W&&H.shouldConfirmClose())return c.confirm(mxResources.get("allChangesLost"),null,function(){W=!0;c.hideDialog(!0)},mxResources.get("cancel"),mxResources.get("discardChanges")),!1},null,null,new mxRectangle(0,0,320,280),!0);H.init()};f.cellEditor.editPlantUmlData=function(H,W,Z){var X=JSON.parse(Z);W=f.getCurrentCellStyle(H);var ba=mxUtils.getValue(W,-mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,ea=null==X.format&&!ba;W="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var aa=document.createElement("select");aa.className="geBtn";Z=document.createElement("option");Z.setAttribute("value","plantUmlDiagram");mxUtils.write(Z,mxResources.get("diagram"));aa.appendChild(Z);Z=document.createElement("option");Z.setAttribute("value","plantUmlImage");mxUtils.write(Z,mxResources.get("image"));aa.appendChild(Z);aa.value=ba?"plantUmlImage":-"plantUmlDiagram";var ha=new SimpleTextareaDialog(c,X.data,function(na){if(null!=na&&c.spinner.spin(document.body,mxResources.get("inserting"))){var ra="plantUmlImage"==aa.value,sa=ea?X.config:null;c.parsePlantUmlDiagram(na,sa,function(ua){c.spinner.stop();ha.hide();try{f.getModel().beginUpdate();try{if(ba&&ra)c.updateMermaidImage(H,na,null,ua,c.getMermaidImageBorder(H,X.border),"plantUmlData");else if(ea&&!ra)c.replaceLockedGroupChildren(H,ua,na,sa,{wrapGroup:mxPlantUmlToDrawio.wrapGroup,dataAttr:"plantUmlData",-attrPrefix:"plantUml"});else{var xa=c.getMermaidImageBorder(H,X.border),qa=c.replaceMermaidCell(H,ra?c.createMermaidImageXml(na,null,ua,null,xa,"plantUmlData"):mxPlantUmlToDrawio.wrapGroup(ua,na,sa));ra||null==xa||f.setCellStyles("groupPadding",xa,qa)}}finally{f.getModel().endUpdate()}}catch(Aa){c.handleError(Aa)}},function(ua){c.spinner.stop();c.handleError(ua)})}},null,null,W?aa:null,!0);y(ha)};f.cellEditor.editMermaidData=function(H,W,Z){var X=JSON.parse(Z);W=f.getCurrentCellStyle(H);var ba=mxUtils.getValue(W,+H?H:"");return null!=H?H[1]:null};f.model.addListener(mxEvent.BEFORE_UNDO,function(H,W){H=W.getProperty("edit");if(null!=H&&null!=H.changes){W=H.changes.length;for(var Z=[],Y=0;Y<W;Y++){var ba=H.changes[Y];ba instanceof mxStyleChange&&null!=ba.cell&&f.model.isVertex(ba.cell)&&u(ba.style)!=u(ba.previous)&&/(?:^|;)shape=image(?:;|$)/.test(null!=ba.style?ba.style:"")&&(null!=f.getAttributeForCell(ba.cell,"mermaidData")||null!=f.getAttributeForCell(ba.cell,"plantUmlData"))&&0>mxUtils.indexOf(Z,ba.cell)&&+Z.push(ba.cell)}for(Y=0;Y<Z.length;Y++)c.refreshMermaidImage(Z[Y])}});var B=function(H){var W=!1;c.showDialog(H.container,640,420,!0,!0,function(Z,Y){if(!W&&H.shouldConfirmClose())return c.confirm(mxResources.get("allChangesLost"),null,function(){W=!0;c.hideDialog(!0)},mxResources.get("cancel"),mxResources.get("discardChanges")),!1},null,null,new mxRectangle(0,0,320,280),!0);H.init()};f.cellEditor.editPlantUmlData=function(H,W,Z){var Y=JSON.parse(Z);W=f.getCurrentCellStyle(H);var ba=mxUtils.getValue(W,+mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,ea=null==Y.format&&!ba;W="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var aa=document.createElement("select");aa.className="geBtn";Z=document.createElement("option");Z.setAttribute("value","plantUmlDiagram");mxUtils.write(Z,mxResources.get("diagram"));aa.appendChild(Z);Z=document.createElement("option");Z.setAttribute("value","plantUmlImage");mxUtils.write(Z,mxResources.get("image"));aa.appendChild(Z);aa.value=ba?"plantUmlImage":+"plantUmlDiagram";var ha=new SimpleTextareaDialog(c,Y.data,function(na){if(null!=na&&c.spinner.spin(document.body,mxResources.get("inserting"))){var ra="plantUmlImage"==aa.value,sa=ea?Y.config:null;c.parsePlantUmlDiagram(na,sa,function(ua){c.spinner.stop();ha.hide();try{f.getModel().beginUpdate();try{if(ba&&ra)c.updateMermaidImage(H,na,null,ua,c.getMermaidImageBorder(H,Y.border),"plantUmlData");else if(ea&&!ra)c.replaceLockedGroupChildren(H,ua,na,sa,{wrapGroup:mxPlantUmlToDrawio.wrapGroup,dataAttr:"plantUmlData",+attrPrefix:"plantUml"});else{var xa=c.getMermaidImageBorder(H,Y.border),qa=c.replaceMermaidCell(H,ra?c.createMermaidImageXml(na,null,ua,null,xa,"plantUmlData"):mxPlantUmlToDrawio.wrapGroup(ua,na,sa));ra||null==xa||f.setCellStyles("groupPadding",xa,qa)}}finally{f.getModel().endUpdate()}}catch(Aa){c.handleError(Aa)}},function(ua){c.spinner.stop();c.handleError(ua)})}},null,null,W?aa:null,!0);B(ha)};f.cellEditor.editMermaidData=function(H,W,Z){var Y=JSON.parse(Z);W=f.getCurrentCellStyle(H);var ba=mxUtils.getValue(W,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE;W="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var ea=document.createElement("select");ea.className="geBtn";Z=document.createElement("option");Z.setAttribute("value","mermaid");mxUtils.write(Z,mxResources.get("diagram"));ea.appendChild(Z);Z=document.createElement("option");Z.setAttribute("value","mermaidImage");mxUtils.write(Z,mxResources.get("image"));ea.appendChild(Z);ea.value=ba?"mermaidImage":"mermaid";var aa=new SimpleTextareaDialog(c,-X.data,function(ha){if(null!=ha&&c.spinner.spin(document.body,mxResources.get("inserting"))){var na="mermaidImage"==ea.value,ra=na?EditorUi.legacyMermaidConfig:ba?null:X.config;c.parseMermaidDiagram(ha,mxUtils.clone(ra),function(sa){c.spinner.stop();aa.hide();try{f.getModel().beginUpdate();try{if(ba&&na)c.updateMermaidImage(H,ha,null,sa,c.getMermaidImageBorder(H,X.border));else if(ba||na){var ua=c.getMermaidImageBorder(H,X.border),xa=c.replaceMermaidCell(H,na?c.createMermaidImageXml(ha,null,sa,null,-ua):mxMermaidToDrawio.wrapGroup(sa,ha,ra));na||null==ua||f.setCellStyles("groupPadding",ua,xa)}else c.replaceLockedGroupChildren(H,sa,ha,ra)}finally{f.getModel().endUpdate()}}catch(qa){c.handleError(qa)}},function(sa){c.spinner.stop();c.handleError(sa)})}},null,null,W?ea:null,!0);y(aa)};var E=f.cellEditor.startEditing;f.cellEditor.startEditing=function(H,W,Z){try{var X=this.graph.getLockedGroupAncestor(H);null!=X&&(H=X);var ba=this.graph.getAttributeForCell(H,"plantUmlData");if(null!=ba)this.editPlantUmlData(H,-W,ba);else if(ba=this.graph.getAttributeForCell(H,"mermaidData"),null!=ba&&EditorUi.isMermaidSupported())this.editMermaidData(H,W,ba);else{var ea=f.getCellStyle(H);"1"==mxUtils.getValue(ea,"metaEdit","0")?c.showDataDialog(H):E.call(this,H,W,Z)}}catch(aa){c.handleError(aa)}};f.getLinkTitle=function(H){return c.getLinkTitle(H)};f.customLinkClicked=function(H,W){var Z=!1;try{var X=this.view.graphBounds,ba=null!=X?new mxRectangle(X.x,X.y,X.width,X.height):null;c.handleCustomLink(H,W);Z=!0;var ea=this.view.graphBounds;+Y.data,function(ha){if(null!=ha&&c.spinner.spin(document.body,mxResources.get("inserting"))){var na="mermaidImage"==ea.value,ra=na?EditorUi.legacyMermaidConfig:ba?null:Y.config;c.parseMermaidDiagram(ha,mxUtils.clone(ra),function(sa){c.spinner.stop();aa.hide();try{f.getModel().beginUpdate();try{if(ba&&na)c.updateMermaidImage(H,ha,null,sa,c.getMermaidImageBorder(H,Y.border));else if(ba||na){var ua=c.getMermaidImageBorder(H,Y.border),xa=c.replaceMermaidCell(H,na?c.createMermaidImageXml(ha,null,sa,null,+ua):mxMermaidToDrawio.wrapGroup(sa,ha,ra));na||null==ua||f.setCellStyles("groupPadding",ua,xa)}else c.replaceLockedGroupChildren(H,sa,ha,ra)}finally{f.getModel().endUpdate()}}catch(qa){c.handleError(qa)}},function(sa){c.spinner.stop();c.handleError(sa)})}},null,null,W?ea:null,!0);B(aa)};var E=f.cellEditor.startEditing;f.cellEditor.startEditing=function(H,W,Z){try{var Y=this.graph.getLockedGroupAncestor(H);null!=Y&&(H=Y);var ba=this.graph.getAttributeForCell(H,"plantUmlData");if(null!=ba)this.editPlantUmlData(H,+W,ba);else if(ba=this.graph.getAttributeForCell(H,"mermaidData"),null!=ba&&EditorUi.isMermaidSupported())this.editMermaidData(H,W,ba);else{var ea=f.getCellStyle(H);"1"==mxUtils.getValue(ea,"metaEdit","0")?c.showDataDialog(H):E.call(this,H,W,Z)}}catch(aa){c.handleError(aa)}};f.getLinkTitle=function(H){return c.getLinkTitle(H)};f.customLinkClicked=function(H,W){var Z=!1;try{var Y=this.view.graphBounds,ba=null!=Y?new mxRectangle(Y.x,Y.y,Y.width,Y.height):null;c.handleCustomLink(H,W);Z=!0;var ea=this.view.graphBounds;c.chromelessResize&&null!=ba&&null!=ea&&!ba.equals(ea)&&(c.chromelessResize(),this.scrollCellToVisible(W))}catch(aa){c.handleError(aa)}return Z};var I=f.parseBackgroundImage;f.parseBackgroundImage=function(H){var W=I.apply(this,arguments);null!=W&&null!=W.src&&Graph.isPageLink(W.src)&&(W={originalSrc:W.src});return W};var C=f.setBackgroundImage;f.setBackgroundImage=function(H){null!=H&&null!=H.originalSrc&&(H=c.createImageForPageLink(H.originalSrc,c.currentPage,this));C.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,function(H,W){H=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=H){var Z=H.indexOf(",");if(0<Z)for(H=H.substring(Z+1),W=W.getProperty("patches"),Z=0;Z<W.length;Z++)if(null!=W[Z][EditorUi.DIFF_UPDATE]&&null!=W[Z][EditorUi.DIFF_UPDATE][H]||null!=W[Z][EditorUi.DIFF_REMOVE]&&-0<=mxUtils.indexOf(W[Z][EditorUi.DIFF_REMOVE],H)){f.refreshBackgroundImage();break}}}));var U=f.getBackgroundImageObject;f.getBackgroundImageObject=function(H,W,Z){var X=U.apply(this,arguments);null!=X&&null!=X.originalSrc&&(X=W?c.createImageForPageLink(X.originalSrc,Z,null,!0):{src:X.originalSrc});return X};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||-/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var J=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(H){H=null!=H?H:"";"1"==urlParams.dev&&(H+=(0<H.length?"&":"?")+"dev=1");"1"==urlParams.test&&(H+=(0<H.length?"&":"?")+"test=1");return J.apply(this,arguments)};var S=f.addClickHandler;f.addClickHandler=function(H,W,Z){var X=W;W=function(ba,ea,aa){if(null==ea){var ha=mxEvent.getSource(ba);"a"==ha.nodeName.toLowerCase()&&(ea=-ha.getAttribute("href"))}null!=ea&&f.isCustomLink(ea)&&(mxEvent.isTouchEvent(ba)||!mxEvent.isPopupTrigger(ba))&&f.customLinkClicked(ea,aa)&&mxEvent.consume(ba);null!=X&&X(ba,ea,aa)};S.call(this,H,W,Z)};B.apply(this,arguments);Graph.browserTranslate&&f.waitForBrowserTranslate();this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var N=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(H,W,Z){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&-this.addMenuItems(H,["zoomIn","zoomOut","-"],null,Z);if(Editor.passiveScroll&&null!=Z){var X=mxUtils.convertPoint(f.container,mxEvent.getClientX(Z),mxEvent.getClientY(Z));f._contextMenuPoint=new mxPoint(f.snap(X.x/f.view.scale-f.view.translate.x),f.snap(X.y/f.view.scale-f.view.translate.y));f._contextMenuScreenPoint=mxUtils.convertPoint(f.container,mxEvent.getClientX(Z),mxEvent.getClientY(Z))}f.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",H,null),H.addSeparator());N.apply(this,+0<=mxUtils.indexOf(W[Z][EditorUi.DIFF_REMOVE],H)){f.refreshBackgroundImage();break}}}));var U=f.getBackgroundImageObject;f.getBackgroundImageObject=function(H,W,Z){var Y=U.apply(this,arguments);null!=Y&&null!=Y.originalSrc&&(Y=W?c.createImageForPageLink(Y.originalSrc,Z,null,!0):{src:Y.originalSrc});return Y};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||+/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var K=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(H){H=null!=H?H:"";"1"==urlParams.dev&&(H+=(0<H.length?"&":"?")+"dev=1");"1"==urlParams.test&&(H+=(0<H.length?"&":"?")+"test=1");return K.apply(this,arguments)};var S=f.addClickHandler;f.addClickHandler=function(H,W,Z){var Y=W;W=function(ba,ea,aa){if(null==ea){var ha=mxEvent.getSource(ba);"a"==ha.nodeName.toLowerCase()&&(ea=+ha.getAttribute("href"))}null!=ea&&f.isCustomLink(ea)&&(mxEvent.isTouchEvent(ba)||!mxEvent.isPopupTrigger(ba))&&f.customLinkClicked(ea,aa)&&mxEvent.consume(ba);null!=Y&&Y(ba,ea,aa)};S.call(this,H,W,Z)};A.apply(this,arguments);Graph.browserTranslate&&f.waitForBrowserTranslate();this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var M=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(H,W,Z){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&+this.addMenuItems(H,["zoomIn","zoomOut","-"],null,Z);if(Editor.passiveScroll&&null!=Z){var Y=mxUtils.convertPoint(f.container,mxEvent.getClientX(Z),mxEvent.getClientY(Z));f._contextMenuPoint=new mxPoint(f.snap(Y.x/f.view.scale-f.view.translate.x),f.snap(Y.y/f.view.scale-f.view.translate.y));f._contextMenuScreenPoint=mxUtils.convertPoint(f.container,mxEvent.getClientX(Z),mxEvent.getClientY(Z))}f.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",H,null),H.addSeparator());M.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||this.addMenuItems(H,["-","addToScratchpad"],null,Z);f.isSelectionEmpty()&&!this.isShowStyleItems()&&this.addMenuItems(H,["-","exitGroup","home"],null,Z)};var R=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(H,W,Z){if(c.editor.graph.isSelectionEmpty())R.apply(this,arguments),c.menus.addMenuItems(H,["copyAsImage","copyAsSvg"],null,Z);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(H,W,Z):this.addPopupMenuArrangeItems(H,W,Z),this.addMenuItems(H,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),null,Z),Editor.passiveScroll&&(1==f.getSelectionCount()?this.addMenuItems(H,["-","copyStyle","pasteStyle","copyTextStyle","pasteTextStyle"],null,Z):this.addMenuItems(H,["-","pasteStyle","pasteTextStyle"],null,Z)),this.addMenuItems(H,["-"],null,Z),this.isShowCellEditItems()||this.addPopupDeleteItem(H,W,Z),this.addMenuItems(H,["lockUnlock","-"],null,Z),!this.isShowStyleItems()){if(1==-f.getSelectionCount()&&!f.isCellLocked(W)&&f.isCellEditable(W)&&(this.addSubmenu("editCell",H,null,mxResources.get("edit")),H.addSeparator(),f.getModel().isEdge(W))){this.addSubmenu("line",H);var X=f.getModel().getGeometry(W);null!=X&&null!=X.points&&0<X.points.length&&this.addMenuItems(H,["clearWaypoints"],null,Z)}1==f.getSelectionCount()&&this.addMenuItems(H,["enterGroup"],null,Z);X=c.getSelectionState();null!=X.mergeCell?this.addMenuItem(H,"mergeCells"):(1<X.style.colspan||1<X.style.rowspan)&&+f.getSelectionCount()&&!f.isCellLocked(W)&&f.isCellEditable(W)&&(this.addSubmenu("editCell",H,null,mxResources.get("edit")),H.addSeparator(),f.getModel().isEdge(W))){this.addSubmenu("line",H);var Y=f.getModel().getGeometry(W);null!=Y&&null!=Y.points&&0<Y.points.length&&this.addMenuItems(H,["clearWaypoints"],null,Z)}1==f.getSelectionCount()&&this.addMenuItems(H,["enterGroup"],null,Z);Y=c.getSelectionState();null!=Y.mergeCell?this.addMenuItem(H,"mergeCells"):(1<Y.style.colspan||1<Y.style.rowspan)&&this.addMenuItem(H,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}if(Editor.passiveScroll){var T=f.getCenterInsertPoint;f.getCenterInsertPoint=function(H){if(null!=this._contextMenuPoint){var W=this._contextMenuPoint;H=null!=H?H:new mxRectangle;return new mxPoint(f.snap(W.x-(H.width||0)/2),f.snap(W.y-(H.height||0)/2))}return T.apply(this,arguments)};var v=f.popupMenuHandler.hideMenu;f.popupMenuHandler.hideMenu=function(){v.apply(this,arguments);window.setTimeout(function(){f._contextMenuPoint=null;f._contextMenuScreenPoint=null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var d=f.getExportVariables;f.getExportVariables=function(){var H=d.apply(this,arguments),W=c.getCurrentFile();null!=W&&(H.filename=W.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var Z in c.fileVars)null==H[Z]&&(H[Z]=c.fileVars[Z]);H.pagecount=null!=c.pages?c.pages.length:1;H.page=null!=c.currentPage?c.currentPage.getName():"";H.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return H};var m=f.getGlobalVariable;f.getGlobalVariable=function(H){var W=c.getCurrentFile();if("filename"==-H&&null!=W)return W.getTitle();if("page"==H&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==H)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1;if("pagecount"==H)return null!=c.pages?c.pages.length:1;W=m.apply(this,arguments);null==W&&(c.updateFileVars(),null!=c.fileVars&&(W=c.fileVars[H]));return W};var r=null,A=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var H=this.getCurrentFile(),W=null!=H&&null!=H.getTitle()?-H.getTitle():this.defaultFilename;r!=W&&H==A&&(f.invalidateDescendantsWithPlaceholders(f.model.getRoot()),f.view.validate());r=W;A=H}));var D=f.labelLinkClicked;f.labelLinkClicked=function(H,W,Z){var X=W.getAttribute("href");if(null==X||!f.isCustomLink(X)||!mxEvent.isTouchEvent(Z)&&mxEvent.isPopupTrigger(Z))D.apply(this,arguments);else{if(!f.isEnabled()||null!=H&&f.isCellLocked(H.cell))f.customLinkClicked(X),f.getRubberband().reset();mxEvent.consume(Z)}};this.editor.getOrCreateFilename=function(){var H=+H&&null!=W)return W.getTitle();if("page"==H&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==H)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1;if("pagecount"==H)return null!=c.pages?c.pages.length:1;W=m.apply(this,arguments);null==W&&(c.updateFileVars(),null!=c.fileVars&&(W=c.fileVars[H]));return W};var r=null,z=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var H=this.getCurrentFile(),W=null!=H&&null!=H.getTitle()?+H.getTitle():this.defaultFilename;r!=W&&H==z&&(f.invalidateDescendantsWithPlaceholders(f.model.getRoot()),f.view.validate());r=W;z=H}));var D=f.labelLinkClicked;f.labelLinkClicked=function(H,W,Z){var Y=W.getAttribute("href");if(null==Y||!f.isCustomLink(Y)||!mxEvent.isTouchEvent(Z)&&mxEvent.isPopupTrigger(Z))D.apply(this,arguments);else{if(!f.isEnabled()||null!=H&&f.isCellLocked(H.cell))f.customLinkClicked(Y),f.getRubberband().reset();mxEvent.consume(Z)}};this.editor.getOrCreateFilename=function(){var H=c.defaultFilename,W=c.getCurrentFile();null!=W&&(H=null!=W.getTitle()?W.getTitle():H);return H};n=this.actions.get("print");n.setEnabled(!mxClient.IS_IOS||!navigator.standalone);n.visible=n.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),this.keyHandler.bindAction(76,!1,"insertLink"),this.keyHandler.bindAction(82,!1,"insertRhombus"),this.keyHandler.bindAction(67,!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize",this.installKeyboardShortcuts(),"1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||f.addListener(mxEvent.ESCAPE,function(H,W){null!=W&&f.isEnabled()&&!f.isEditing()&&null!=W.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&-f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(H){var W=f.cellEditor.text2,Z=null;null!=W&&(mxEvent.addListener(W,"dragleave",function(X){null!=Z&&(Z.parentNode.removeChild(Z),Z=null);X.stopPropagation();X.preventDefault()}),mxEvent.addListener(W,"dragover",mxUtils.bind(this,function(X){null==Z&&(Z=this.highlightElement(W));X.stopPropagation();X.preventDefault()})),mxEvent.addListener(W,"drop",mxUtils.bind(this,function(X){null!=Z&&(Z.parentNode.removeChild(Z),Z=null);if(0<X.dataTransfer.files.length)this.importFiles(X.dataTransfer.files,-0,0,this.maxImageSize,function(ea,aa,ha,na,ra,sa){f.insertImage(ea,ra,sa)},function(){},function(ea){return"image/"==ea.type.substring(0,6)},function(ea){for(var aa=0;aa<ea.length;aa++)ea[aa]()},mxEvent.isControlDown(X));else if(0<=mxUtils.indexOf(X.dataTransfer.types,"text/uri-list")){var ba=X.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ba)?this.loadImage(decodeURIComponent(ba),mxUtils.bind(this,function(ea){var aa=Math.max(1,ea.width);ea=Math.max(1,ea.height);var ha=-this.maxImageSize;ha=Math.min(1,Math.min(ha/Math.max(1,aa)),ha/Math.max(1,ea));f.insertImage(decodeURIComponent(ba),aa*ha,ea*ha)})):document.execCommand("insertHTML",!1,X.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(X.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,X.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(X.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,X.dataTransfer.getData("text/plain"));X.stopPropagation();X.preventDefault()})))}));-if(Editor.isSettingsEnabled()){n=this.editor.graph.view;var G=mxSettings.getUnit();n.setUnit(G);Editor.pageSizeUnit=G;n.addListener("unitChanged",function(H,W){H=W.getProperty("unit");mxSettings.setUnit(H);mxSettings.save();Editor.pageSizeUnit=H});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,n.unit);this.refresh()}if("1"==urlParams.styledev){n=document.getElementById("geFooter");+f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(H){var W=f.cellEditor.text2,Z=null;null!=W&&(mxEvent.addListener(W,"dragleave",function(Y){null!=Z&&(Z.parentNode.removeChild(Z),Z=null);Y.stopPropagation();Y.preventDefault()}),mxEvent.addListener(W,"dragover",mxUtils.bind(this,function(Y){null==Z&&(Z=this.highlightElement(W));Y.stopPropagation();Y.preventDefault()})),mxEvent.addListener(W,"drop",mxUtils.bind(this,function(Y){null!=Z&&(Z.parentNode.removeChild(Z),Z=null);if(0<Y.dataTransfer.files.length)this.importFiles(Y.dataTransfer.files,+0,0,this.maxImageSize,function(ea,aa,ha,na,ra,sa){f.insertImage(ea,ra,sa)},function(){},function(ea){return"image/"==ea.type.substring(0,6)},function(ea){for(var aa=0;aa<ea.length;aa++)ea[aa]()},mxEvent.isControlDown(Y));else if(0<=mxUtils.indexOf(Y.dataTransfer.types,"text/uri-list")){var ba=Y.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ba)?this.loadImage(decodeURIComponent(ba),mxUtils.bind(this,function(ea){var aa=Math.max(1,ea.width);ea=Math.max(1,ea.height);var ha=+this.maxImageSize;ha=Math.min(1,Math.min(ha/Math.max(1,aa)),ha/Math.max(1,ea));f.insertImage(decodeURIComponent(ba),aa*ha,ea*ha)})):document.execCommand("insertHTML",!1,Y.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(Y.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,Y.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(Y.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,Y.dataTransfer.getData("text/plain"));Y.stopPropagation();Y.preventDefault()})))}));+if(Editor.isSettingsEnabled()){n=this.editor.graph.view;var F=mxSettings.getUnit();n.setUnit(F);Editor.pageSizeUnit=F;n.addListener("unitChanged",function(H,W){H=W.getProperty("unit");mxSettings.setUnit(H);mxSettings.save();Editor.pageSizeUnit=H});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,n.unit);this.refresh()}if("1"==urlParams.styledev){n=document.getElementById("geFooter");null!=n&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),n.appendChild(this.styleInput),-this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(H,W){0<this.editor.graph.getSelectionCount()?(H=this.editor.graph.getSelectionCell(),H=this.editor.graph.getModel().getStyle(H),this.styleInput.value=H||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var O=this.isSelectionAllowed;this.isSelectionAllowed=function(H){return mxEvent.getSource(H)==this.styleInput?!0:O.apply(this,arguments)}}n=document.getElementById("geInfo");+this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(H,W){0<this.editor.graph.getSelectionCount()?(H=this.editor.graph.getSelectionCell(),H=this.editor.graph.getModel().getStyle(H),this.styleInput.value=H||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var N=this.isSelectionAllowed;this.isSelectionAllowed=function(H){return mxEvent.getSource(H)==this.styleInput?!0:N.apply(this,arguments)}}n=document.getElementById("geInfo");null!=n&&n.parentNode.removeChild(n);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var P=null;mxEvent.addListener(f.container,"dragleave",function(H){f.isEnabled()&&(null!=P&&(P.parentNode.removeChild(P),P=null),H.stopPropagation(),H.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(H){null==P&&(P=this.highlightElement(f.container));null!=this.sidebar&&this.sidebar.hideTooltip();H.stopPropagation();H.preventDefault()}));mxEvent.addListener(f.container,-"drop",mxUtils.bind(this,function(H){null!=P&&(P.parentNode.removeChild(P),P=null);if(f.isEnabled()){var W=mxUtils.convertPoint(f.container,mxEvent.getClientX(H),mxEvent.getClientY(H)),Z=H.dataTransfer.files,X=f.view.translate,ba=f.view.scale,ea=W.x/ba-X.x,aa=W.y/ba-X.y;if(0<Z.length)W=this.isBlankFile()&&!this.canUndo(),X=1==Z.length&&(EditorUi.isVisioFilename(Z[0].name)||/(\.drawio)$/i.test(Z[0].name)||/(\.xml)$/i.test(Z[0].name)),"1"!=urlParams.embed&&W&&(X||mxEvent.isShiftDown(H))?(W=this.getCurrentFile(),+"drop",mxUtils.bind(this,function(H){null!=P&&(P.parentNode.removeChild(P),P=null);if(f.isEnabled()){var W=mxUtils.convertPoint(f.container,mxEvent.getClientX(H),mxEvent.getClientY(H)),Z=H.dataTransfer.files,Y=f.view.translate,ba=f.view.scale,ea=W.x/ba-Y.x,aa=W.y/ba-Y.y;if(0<Z.length)W=this.isBlankFile()&&!this.canUndo(),Y=1==Z.length&&(EditorUi.isVisioFilename(Z[0].name)||/(\.drawio)$/i.test(Z[0].name)||/(\.xml)$/i.test(Z[0].name)),"1"!=urlParams.embed&&W&&(Y||mxEvent.isShiftDown(H))?(W=this.getCurrentFile(),null!=W&&W.isModified()||this.fileLoaded(null,!0),this.openFiles(Z,!0,mxUtils.bind(this,function(){var xa=this.getCurrentFile();null!=xa&&xa.fileChanged()}))):(mxEvent.isAltDown(H)&&(aa=ea=null),this.importFiles(Z,ea,aa,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(H),null,null,mxEvent.isShiftDown(H),H));else{mxEvent.isAltDown(H)&&(aa=ea=0);var ha=0<=mxUtils.indexOf(H.dataTransfer.types,"text/uri-list")?H.dataTransfer.getData("text/uri-list"):null;Z=this.extractGraphModelFromEvent(H,null!=this.pages);if(null!=Z)f.setSelectionCells(this.importXml(Z,ea,aa,!0));else if(0<=mxUtils.indexOf(H.dataTransfer.types,"text/html")){var na=H.dataTransfer.getData("text/html");Z=document.createElement("div");Z.innerHTML=Graph.sanitizeHtml(na);var ra=null;W=Z.getElementsByTagName("img");null!=W&&1==W.length?(na=W[0].getAttribute("src"),null==na&&(na=W[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(na)||(ra=!0)):(W=Z.getElementsByTagName("a"),null!=W&&1==W.length?na=W[0].getAttribute("href"):(Z=Z.getElementsByTagName("pre"),null!=Z&&1==Z.length&&(na=mxUtils.getTextContent(Z[0]))));var sa=!0,ua=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(na,ea,aa,!0,ra,null,sa,mxEvent.isControlDown(H)))});ra&&null!=na&&na.length>this.resampleThreshold?this.confirmImageResize(function(xa){sa=xa;ua()},mxEvent.isControlDown(H)):ua()}else null!=ha&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ha)?this.loadImage(decodeURIComponent(ha),mxUtils.bind(this,function(xa){var qa=Math.max(1,xa.width);xa=Math.max(1,xa.height);var Aa=this.maxImageSize;Aa=Math.min(1,Math.min(Aa/Math.max(1,qa)),Aa/Math.max(1,xa));f.setSelectionCell(f.insertVertex(null,null,"",ea,aa,qa*Aa,xa*Aa,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ha+";"))}),mxUtils.bind(this,function(xa){f.setSelectionCells(this.insertTextAt(ha,ea,aa,!0))})):0<=mxUtils.indexOf(H.dataTransfer.types,"text/plain")&&f.setSelectionCells(this.insertTextAt(H.dataTransfer.getData("text/plain"),ea,aa,!0))}}H.stopPropagation();H.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&f.view.validateBackground()});-f.addListener("enabledChanged",mxUtils.bind(this,function(){f.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var H=parseInt(this.div.offsetLeft),W=parseInt(this.div.offsetWidth),Z=c.embedViewport.x+c.embedViewport.width,X=parseInt(this.div.offsetTop),ba=parseInt(this.div.offsetHeight),ea=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,-Math.min(H,Z-W))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(X,ea-ba))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};var V=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(H,W){V.call(this,H,W);c.hideCurrentMenu()};var Y=mxWindow.prototype.setSize;mxWindow.prototype.setSize=function(H,W){Y.call(this,H,W);c.hideCurrentMenu()};-if(!this.editor.chromeless||this.editor.editable){n=Editor.currentTheme;if("simple"==n||"sketch"==n)this.doSetCurrentTheme(n,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(G=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,G<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==n&&G<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==n&&(this.lastWindowWidth=G)),this.fireEvent(new mxEventObject("themeInitialized"));this.restoreVisibleWindows();-"kennedy"==n&&(G=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,G<Editor.smallScreenWidth&&(this.formatWidth=0),G<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),this.lastWindowWidth=G)}n=!1;if(null!=urlParams.dark)n=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)n="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||n&&"auto"!=mxSettings.settings.darkMode||(n=mxSettings.settings.darkMode);"auto"==n&&this.isAutoDarkModeSupported()&&+f.addListener("enabledChanged",mxUtils.bind(this,function(){f.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var H=parseInt(this.div.offsetLeft),W=parseInt(this.div.offsetWidth),Z=c.embedViewport.x+c.embedViewport.width,Y=parseInt(this.div.offsetTop),ba=parseInt(this.div.offsetHeight),ea=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,+Math.min(H,Z-W))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(Y,ea-ba))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};var V=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(H,W){V.call(this,H,W);c.hideCurrentMenu()};var X=mxWindow.prototype.setSize;mxWindow.prototype.setSize=function(H,W){X.call(this,H,W);c.hideCurrentMenu()};+if(!this.editor.chromeless||this.editor.editable){n=Editor.currentTheme;if("simple"==n||"sketch"==n)this.doSetCurrentTheme(n,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(F=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,F<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==n&&F<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==n&&(this.lastWindowWidth=F)),this.fireEvent(new mxEventObject("themeInitialized"));this.restoreVisibleWindows();+"kennedy"==n&&(F=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,F<Editor.smallScreenWidth&&(this.formatWidth=0),F<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),this.lastWindowWidth=F)}n=!1;if(null!=urlParams.dark)n=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)n="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||n&&"auto"!=mxSettings.settings.darkMode||(n=mxSettings.settings.darkMode);"auto"==n&&this.isAutoDarkModeSupported()&&(n=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof n?"1"==n:n);if(this.isAutoDarkModeSupported())try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(H){this.isAutoDarkMode()&&this.setDarkMode(H.matches)}))}catch(H){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast?this.setHighContrast(mxSettings.settings.highContrast):null!=window.matchMedia&&window.matchMedia("(prefers-contrast: more)").matches&&this.setHighContrast(!0);Editor.isSettingsEnabled()&&(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(H,-W){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var z=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||+W){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var y=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));f=Editor.smallScreenWidth-160;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,!0):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&!this.isShapesPanelVisible()&&-this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}z.apply(this,arguments);null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,k=this.sketchPickerMenuElt,n=this.editor.graph;k.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(I){mxEvent.getSource(I)==this.diagramContainer.parentNode&&(this.embedExitPoint=-new mxPoint(mxEvent.getClientX(I),mxEvent.getClientY(I)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var q=document.createElement("div");q.style.position="absolute";q.style.width="10px";q.style.height="10px";q.style.borderRadius="5px";q.style.border="1px solid gray";q.style.background="#ffffff";q.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(q);this.bottomResizer=q;var t=null,u=null,y=null,E=null;mxEvent.addGestureListeners(q,mxUtils.bind(this,function(I){E=-parseInt(this.diagramContainer.style.height);u=mxEvent.getClientY(I);n.popupMenuHandler.hideMenu();mxEvent.consume(I)}));q=q.cloneNode(!1);q.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(q);this.rightResizer=q;mxEvent.addGestureListeners(q,mxUtils.bind(this,function(I){y=parseInt(this.diagramContainer.style.width);t=mxEvent.getClientX(I);n.popupMenuHandler.hideMenu();mxEvent.consume(I)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(I){var C=!1;-null!=t&&(this.diagramContainer.style.width=Math.max(20,y+mxEvent.getClientX(I)-t)+"px",C=!0);null!=u&&(this.diagramContainer.style.height=Math.max(20,E+mxEvent.getClientY(I)-u)+"px",C=!0);C&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(I){null==t&&null==u||mxEvent.consume(I);u=t=null});document.body.style.backgroundColor=+this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}y.apply(this,arguments);null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,k=this.sketchPickerMenuElt,n=this.editor.graph;k.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(I){mxEvent.getSource(I)==this.diagramContainer.parentNode&&(this.embedExitPoint=+new mxPoint(mxEvent.getClientX(I),mxEvent.getClientY(I)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var q=document.createElement("div");q.style.position="absolute";q.style.width="10px";q.style.height="10px";q.style.borderRadius="5px";q.style.border="1px solid gray";q.style.background="#ffffff";q.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(q);this.bottomResizer=q;var t=null,u=null,B=null,E=null;mxEvent.addGestureListeners(q,mxUtils.bind(this,function(I){E=+parseInt(this.diagramContainer.style.height);u=mxEvent.getClientY(I);n.popupMenuHandler.hideMenu();mxEvent.consume(I)}));q=q.cloneNode(!1);q.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(q);this.rightResizer=q;mxEvent.addGestureListeners(q,mxUtils.bind(this,function(I){B=parseInt(this.diagramContainer.style.width);t=mxEvent.getClientX(I);n.popupMenuHandler.hideMenu();mxEvent.consume(I)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(I){var C=!1;+null!=t&&(this.diagramContainer.style.width=Math.max(20,B+mxEvent.getClientX(I)-t)+"px",C=!0);null!=u&&(this.diagramContainer.style.height=Math.max(20,E+mxEvent.getClientY(I)-u)+"px",C=!0);C&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(I){null==t&&null==u||mxEvent.consume(I);u=t=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(I){this.inlineSizeChanged();Editor.passiveScroll?this.hideWindows():this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(I){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){k.innerHTML=" ";k.focus();try{var t=document.createRange();-t.selectNodeContents(k);var u=window.getSelection();null!=u&&(u.removeAllRanges(),u.addRange(t))}catch(y){}},0)}var f=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck","false");k.style.textRendering="optimizeSpeed";k.style.fontFamily="monospace";k.style.wordBreak="break-all";k.style.background="transparent";k.style.color="transparent";k.style.position="absolute";+t.selectNodeContents(k);var u=window.getSelection();null!=u&&(u.removeAllRanges(),u.addRange(t))}catch(B){}},0)}var f=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck","false");k.style.textRendering="optimizeSpeed";k.style.fontFamily="monospace";k.style.wordBreak="break-all";k.style.background="transparent";k.style.color="transparent";k.style.position="absolute";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.display="block";k.style.fontSize="1";k.style.zIndex="-1";k.style.resize="none";k.style.outline="none";k.style.width="1px";k.style.height="1px";mxUtils.setOpacity(k,0);k.contentEditable=!0;k.innerHTML=" ";this.clipboardElt=k;var n=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(t){var u=mxEvent.getSource(t);null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==u.nodeName||"TEXTAREA"==u.nodeName&&u!==this.typingShim||"true"==u.contentEditable||224!=t.keyCode&&(mxClient.IS_MAC||17!=t.keyCode)&&(!mxClient.IS_MAC||91!=t.keyCode&&93!=t.keyCode)||n||(k.style.left=f.container.scrollLeft+10+"px",k.style.top=f.container.scrollTop+10+"px",t=f.container.scrollLeft,u=f.container.scrollTop,f.container.appendChild(k),n=!0,k.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=t,f.container.scrollTop=u)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(t){var u=t.keyCode;window.setTimeout(mxUtils.bind(this,function(){!n||224!=u&&17!=u&&91!=u&&93!=u||(n=!1,k.parentNode.removeChild(k),f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(t){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k),c()}catch(u){this.handleError(u)}}));-mxEvent.addListener(k,"cut",mxUtils.bind(this,function(t){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k,!0),c()}catch(u){this.handleError(u)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(t){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(k.innerHTML=" ",k.focus(),null!=t.clipboardData&&(Graph.removePasteFormatting(k.firstChild),this.pasteCells(t,k,!0,!0)),!mxEvent.isConsumed(t)){var u=f.container.scrollLeft,y=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,-function(){try{f.container.scrollLeft=u,f.container.scrollTop=y,Graph.removePasteFormatting(k.firstChild),this.pasteCells(t,k,!1,!0)}catch(E){this.handleError(E)}}),0)}}catch(E){this.handleError(E)}}),!0);var q=this.isSelectionAllowed;this.isSelectionAllowed=function(t){return mxEvent.getSource(t)==k?!0:q.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=+mxEvent.addListener(k,"cut",mxUtils.bind(this,function(t){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k,!0),c()}catch(u){this.handleError(u)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(t){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(k.innerHTML=" ",k.focus(),null!=t.clipboardData&&(Graph.removePasteFormatting(k.firstChild),this.pasteCells(t,k,!0,!0)),!mxEvent.isConsumed(t)){var u=f.container.scrollLeft,B=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,+function(){try{f.container.scrollLeft=u,f.container.scrollTop=B,Graph.removePasteFormatting(k.firstChild),this.pasteCells(t,k,!1,!0)}catch(E){this.handleError(E)}}),0)}}catch(E){this.handleError(E)}}),!0);var q=this.isSelectionAllowed;this.isSelectionAllowed=function(t){return mxEvent.getSource(t)==k?!0:q.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var k="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(k||f)f=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(f);return k};EditorUi.prototype.saveScrollState=function(c){var f=this.editor.graph.view.translate,k=this.diagramContainer.scrollLeft,n=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(k-=this.embedViewport.x,n-=this.embedViewport.y):(k+=this.embedViewport.x,n+=this.embedViewport.y));f={x:k,y:n,tx:f.x,ty:f.y};c&&(f.boundingRect=this.diagramContainer.getBoundingClientRect());return f};EditorUi.prototype.restoreScrollState=function(c){var f=this.editor.graph.view.scale,k=this.editor.graph.view.translate;if(null!=c.boundingRect){var n=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-n.x;c.y-=c.boundingRect.y-n.y}this.diagramContainer.scrollLeft=c.x+(k.x-c.tx)*f;this.diagramContainer.scrollTop=c.y+(k.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&@@ -14134,17 +14138,17 @@ k&&k.visible&&(k=this.actions.get(c[f]),null!=k&&k.funct())}}};EditorUi.prototypnull});mxSettings.save()};EditorUi.prototype.restoreWindowState=function(c,f){c=mxSettings.getWindowState(c);if(null==c)return null;f=f.window;null!=c.w&&null!=c.h&&mxWindow.prototype.setSize.call(f,c.w,c.h);null!=c.x&&null!=c.y&&mxWindow.prototype.setLocation.call(f,c.x,c.y);null!=c.dockState&&null!=this.dockManager&&Editor.enableWindowDocking&&(f._dockAnchorRight=c.dockAnchorRight,f._dockAnchorBottom=c.dockAnchorBottom,f._dockOffsetX=c.dockOffsetX,f._dockOffsetY=c.dockOffsetY,f.dockState=c.dockState,f.div.classList.add("mxWindowDocked"),this.dockManager.windows.push(f),this.dockManager.pinToEdge(f));f.fit();null!=c.visible&&f.setVisible(c.visible);c.minimized&&!f.minimized&&f.toggleMinimized();return c};EditorUi.prototype.installWindowPersistence=function(c,f){var k=this,n=f.window,q=function(){k.saveWindowState(c,f)};n.addListener(mxEvent.MOVE_END,q);n.addListener(mxEvent.RESIZE_END,q);n.addListener(mxEvent.SHOW,q);n.addListener(mxEvent.HIDE,q);n.addListener(mxEvent.DOCK,q);n.addListener(mxEvent.UNDOCK,q);n.addListener(mxEvent.MAXIMIZE,q);n.addListener(mxEvent.MINIMIZE,q);n.addListener(mxEvent.NORMALIZE,q)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,f,k){var n=this.threshold,q=c<=n;c=c+k.offsetWidth>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-n;var t=f<=n;f=f+k.offsetHeight>=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-n;return q&&-t?"top-left":c&&t?"top-right":q&&f?"bottom-left":c&&f?"bottom-right":q?"left":c?"right":t?"top":f?"bottom":null},dock:function(c,f){var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,q=parseInt(c.div.style.width),t=parseInt(c.div.style.height),u=c.getX(),y=c.getY();c.dockState=f;c.div.classList.add("mxWindowDocked");var E=0<=f.indexOf("right"),I=0<=f.indexOf("bottom");0<=f.indexOf("left")?-u=0:0<=f.indexOf("right")&&(u=k-q);0<=f.indexOf("top")?y=0:0<=f.indexOf("bottom")&&(y=n-t);E||(E=u+q/2>k/2);I||(I=y+t/2>n/2);c._dockAnchorRight=E;c._dockAnchorBottom=I;c._dockOffsetX=E?k-u-q:u;c._dockOffsetY=I?n-y-t:y;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,"side",f))},undock:function(c){var f=c.dockState;if(null!=f){for(var k=0;k<this.windows.length;k++)if(this.windows[k]===c){this.windows.splice(k,1);break}c.div.classList.remove("mxWindowDocked");c.dockState=+t?"top-left":c&&t?"top-right":q&&f?"bottom-left":c&&f?"bottom-right":q?"left":c?"right":t?"top":f?"bottom":null},dock:function(c,f){var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,q=parseInt(c.div.style.width),t=parseInt(c.div.style.height),u=c.getX(),B=c.getY();c.dockState=f;c.div.classList.add("mxWindowDocked");var E=0<=f.indexOf("right"),I=0<=f.indexOf("bottom");0<=f.indexOf("left")?+u=0:0<=f.indexOf("right")&&(u=k-q);0<=f.indexOf("top")?B=0:0<=f.indexOf("bottom")&&(B=n-t);E||(E=u+q/2>k/2);I||(I=B+t/2>n/2);c._dockAnchorRight=E;c._dockAnchorBottom=I;c._dockOffsetX=E?k-u-q:u;c._dockOffsetY=I?n-B-t:B;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,"side",f))},undock:function(c){var f=c.dockState;if(null!=f){for(var k=0;k<this.windows.length;k++)if(this.windows[k]===c){this.windows.splice(k,1);break}c.div.classList.remove("mxWindowDocked");c.dockState=null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",f))}},pinToEdge:function(c){var f=c.dockState;if(null!=f){var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,q=parseInt(c.div.style.width),t=parseInt(c.div.style.height);var u=c._dockAnchorRight?k-q-(c._dockOffsetX||0):c._dockOffsetX||-0;var y=c._dockAnchorBottom?n-t-(c._dockOffsetY||0):c._dockOffsetY||0;0<=f.indexOf("left")?u=0:0<=f.indexOf("right")&&(u=k-q);0<=f.indexOf("top")?y=0:0<=f.indexOf("bottom")&&(y=n-t);u=Math.max(0,Math.min(u,k-q));y=Math.max(0,Math.min(y,n-t));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,u,y);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,f){null==this.previewElement&&(this.previewElement=document.createElement("div"),-this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,q=this.previewElement,t=f.div.offsetWidth,u=f.div.offsetHeight,y=f.getX();f=f.getY();0<=c.indexOf("left")?y=0:0<=c.indexOf("right")&&(y=k-t);0<=c.indexOf("top")?f=0:0<=c.indexOf("bottom")&&(f=n-u);y=Math.max(0,Math.min(y,k-t));f=Math.max(0,-Math.min(f,n-u));q.style.display="block";q.style.left=y+"px";q.style.top=f+"px";q.style.width=t+"px";q.style.height=u+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var f=0;f<this.windows.length;f++)if(this.windows[f]===c){this.windows.splice(f,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=-null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var F=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,f,k){F.apply(this,arguments);if(EditorUi.windowed&&Editor.enableWindowDocking){var n=c.window;null==this.dockManager&&this.createDockManager();var q=this.dockManager,t=!1,u=null,y=n.setLocation;n.setLocation=function(C,U){(null==-this.dockState||this._undocking||this._relayouting)&&y.call(this,C,U)};var E=n.setSize;n.setSize=function(C,U){if(null!=this.dockState){mxWindow.prototype.setSize.call(this,C,U);C=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;U=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var J=parseInt(this.div.style.width),S=parseInt(this.div.style.height),N=this.getX(),R=this.getY();this._dockOffsetX=this._dockAnchorRight?C-N-J:N;this._dockOffsetY=+0;var B=c._dockAnchorBottom?n-t-(c._dockOffsetY||0):c._dockOffsetY||0;0<=f.indexOf("left")?u=0:0<=f.indexOf("right")&&(u=k-q);0<=f.indexOf("top")?B=0:0<=f.indexOf("bottom")&&(B=n-t);u=Math.max(0,Math.min(u,k-q));B=Math.max(0,Math.min(B,n-t));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,u,B);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,f){null==this.previewElement&&(this.previewElement=document.createElement("div"),+this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,q=this.previewElement,t=f.div.offsetWidth,u=f.div.offsetHeight,B=f.getX();f=f.getY();0<=c.indexOf("left")?B=0:0<=c.indexOf("right")&&(B=k-t);0<=c.indexOf("top")?f=0:0<=c.indexOf("bottom")&&(f=n-u);B=Math.max(0,Math.min(B,k-t));f=Math.max(0,+Math.min(f,n-u));q.style.display="block";q.style.left=B+"px";q.style.top=f+"px";q.style.width=t+"px";q.style.height=u+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var f=0;f<this.windows.length;f++)if(this.windows[f]===c){this.windows.splice(f,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=+null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var G=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,f,k){G.apply(this,arguments);if(EditorUi.windowed&&Editor.enableWindowDocking){var n=c.window;null==this.dockManager&&this.createDockManager();var q=this.dockManager,t=!1,u=null,B=n.setLocation;n.setLocation=function(C,U){(null==+this.dockState||this._undocking||this._relayouting)&&B.call(this,C,U)};var E=n.setSize;n.setSize=function(C,U){if(null!=this.dockState){mxWindow.prototype.setSize.call(this,C,U);C=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;U=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var K=parseInt(this.div.style.width),S=parseInt(this.div.style.height),M=this.getX(),R=this.getY();this._dockOffsetX=this._dockAnchorRight?C-M-K:M;this._dockOffsetY=this._dockAnchorBottom?U-R-S:R;q.pinToEdge(this)}else E.call(this,C,U)};n.addListener(mxEvent.MOVE_START,function(C,U){t=!0;u=null;null!=n.dockState&&(n._undocking=!0,q.undock(n),n._undocking=!1)});n.addListener(mxEvent.MOVE,function(C,U){t&&(C=q.getDockZone(n.getX(),n.getY(),n.div),C!=u&&(u=C,null!=C?q.showPreview(C,n):q.hidePreview()))});n.addListener(mxEvent.MOVE_END,function(C,U){t=!1;q.hidePreview();null!=u&&q.dock(n,u);u=null});n.addListener(mxEvent.DOCK,function(C,U){if(null!=n.resize){C=U.getProperty("side");-var J=0<=C.indexOf("right"),S=0<=C.indexOf("bottom");if(J||S){C=n.resize;C.parentNode.removeChild(C);n.resize=null;C=document.createElement("img");C.style.position="absolute";C.style.zIndex="2";C.setAttribute("src",mxWindow.prototype.resizeImage);J?C.style.left="0px":C.style.right="0px";S?C.style.top="0px":C.style.bottom="0px";C.style.cursor=J!=S?"nesw-resize":"nwse-resize";var N=null,R=null,T=null,v=null,d=function(r){if(null!=N&&null!=R){var A=mxEvent.getClientX(r)-N,D=mxEvent.getClientY(r)-R;n.setSize(J?-T-A:T+A,S?v-D:v+D);n.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",r));mxEvent.consume(r)}},m=function(r){null!=N&&null!=R&&(R=N=null,mxEvent.removeGestureListeners(document,null,d,m),n.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",r)),mxEvent.consume(r))};mxEvent.addGestureListeners(C,function(r){n.activate();N=mxEvent.getClientX(r);R=mxEvent.getClientY(r);T=n.div.offsetWidth;v=n.div.offsetHeight;mxEvent.addGestureListeners(document,null,d,m);n.fireEvent(new mxEventObject(mxEvent.RESIZE_START,+var K=0<=C.indexOf("right"),S=0<=C.indexOf("bottom");if(K||S){C=n.resize;C.parentNode.removeChild(C);n.resize=null;C=document.createElement("img");C.style.position="absolute";C.style.zIndex="2";C.setAttribute("src",mxWindow.prototype.resizeImage);K?C.style.left="0px":C.style.right="0px";S?C.style.top="0px":C.style.bottom="0px";C.style.cursor=K!=S?"nesw-resize":"nwse-resize";var M=null,R=null,T=null,v=null,d=function(r){if(null!=M&&null!=R){var z=mxEvent.getClientX(r)-M,D=mxEvent.getClientY(r)-R;n.setSize(K?+T-z:T+z,S?v-D:v+D);n.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",r));mxEvent.consume(r)}},m=function(r){null!=M&&null!=R&&(R=M=null,mxEvent.removeGestureListeners(document,null,d,m),n.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",r)),mxEvent.consume(r))};mxEvent.addGestureListeners(C,function(r){n.activate();M=mxEvent.getClientX(r);R=mxEvent.getClientY(r);T=n.div.offsetWidth;v=n.div.offsetHeight;mxEvent.addGestureListeners(document,null,d,m);n.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",r));mxEvent.consume(r)},d,m);n.div.appendChild(C);n.resize=C;n._dockResize=!0}}});n.addListener(mxEvent.UNDOCK,function(C,U){n._dockResize&&(null!=n.resize&&(n.resize.parentNode.removeChild(n.resize),n.resize=null),n.setResizable(!0),n._dockResize=!1)});n.addListener(mxEvent.NORMALIZE,function(C,U){null!=n.dockState&&q.pinToEdge(n)});n.addListener(mxEvent.MAXIMIZE,function(C,U){null!=n.dockState&&(n._undocking=!0,q.undock(n),n._undocking=!1)});n.addListener(mxEvent.SHOW,function(C,U){null!=n.dockState&&q.pinToEdge(n)});var I=c.destroy;c.destroy=function(){q.removeWindow(n);I.apply(this,arguments)}}};EditorUi.prototype.switchThemeConstants=function(c){var f=this.editor.graph;f.defaultEdgeLength=Graph.prototype.defaultEdgeLength;f.defaultGridEnabled=Graph.prototype.defaultGridEnabled;f.defaultPageVisible=Graph.prototype.defaultPageVisible;null!=this.menus&&(this.menus.autoPopup="simple"!=c&&"sketch"!=c);if("simple"==c||"sketch"==c){Editor.fitWindowBorders=new mxRectangle(60,30,30,30);if(null==Editor.config||null==Editor.config.defaultEdgeLength)f.defaultEdgeLength=120;null==urlParams.grid&&(f.defaultGridEnabled=!1);null==urlParams.pv&&(f.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=@@ -14154,13 +14158,13 @@ function(c){};EditorUi.prototype.createPickerMenuForTheme=function(c){};EditorUik);null!=f&&(n.style.backgroundImage="url("+f+")",n.innerText="");return n};EditorUi.prototype.addButton=function(c,f,k,n){c=this.createToolbarButton(c,f,k);n=null!=n?n:this.container;n.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,f,k){var n=document.createElement("a");n.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(n.style.backgroundImage="url("+c+")");null!=f&&n.setAttribute("title",f);null!=k&&mxEvent.addListener(n,"click",function(q){"disabled"!=n.getAttribute("disabled")&&k(q);mxEvent.consume(q)});mxEvent.preventDefault(n);return n};EditorUi.prototype.createMenuItem=function(c,f,k){var n=this.actions.get(c),q=null!=n?n.funct:null,t=this.createToolbarButton(f,mxResources.get(c)+(null!=n&&null!=n.shortcut?" ("+n.shortcut+")":""),q);null==n||k||(c=function(){n.isEnabled()?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),n.addListener("stateChanged",c),c());return t};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,f=mxSettings.getWindowState("format"),k=null!=f&&null!=f.x?f.x:Math.max(10,this.diagramContainer.parentNode.clientWidth-256),n=null!=f&&null!=f.y?f.y:60,q=null!=f&&null!=f.w?f.w:240,t=null!=f&&null!=f.h?f.h:"1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),k,n,q,t,mxUtils.bind(this,function(E){E.appendChild(this.formatContainer)}));-this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var u=this.formatWindow.window.toggleMinimized,y=q;this.formatWindow.window.toggleMinimized=function(){u.apply(this,arguments);this.minimized?(y=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+y-140+"px"):(this.div.style.width=y+"px",this.table.style.width=-this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-y+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(E){mxEvent.getSource(E)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);this.installWindowPersistence("format",this.formatWindow);null!=f?this.restoreWindowState("format",this.formatWindow):-"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var E=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,I=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>E||690>I)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var K=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=-function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):K.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,f){if(this.isShapesPanelVisible()!=c){var k=EditorUi.prototype.hsplitPosition;0==k&&(k=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var n=this.hsplitPosition,q=mxUtils.bind(this,function(){this.hsplitPosition=t;this.refresh();f||(this.diagramContainer.scrollLeft-=n-this.hsplitPosition)}),t=c?k:0,u=+this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var u=this.formatWindow.window.toggleMinimized,B=q;this.formatWindow.window.toggleMinimized=function(){u.apply(this,arguments);this.minimized?(B=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+B-140+"px"):(this.div.style.width=B+"px",this.table.style.width=+this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-B+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(E){mxEvent.getSource(E)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);this.installWindowPersistence("format",this.formatWindow);null!=f?this.restoreWindowState("format",this.formatWindow):+"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var E=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,I=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>E||690>I)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var L=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=+function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):L.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,f){if(this.isShapesPanelVisible()!=c){var k=EditorUi.prototype.hsplitPosition;0==k&&(k=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var n=this.hsplitPosition,q=mxUtils.bind(this,function(){this.hsplitPosition=t;this.refresh();f||(this.diagramContainer.scrollLeft-=n-this.hsplitPosition)}),t=c?k:0,u=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==t?"translateX(0)":"translateX(-100%)");0!=t&&q();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==t?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+u+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,-function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==t&&q();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*u)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var M=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;-return null!=c?c.window.isVisible():M.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var f=mxUtils.bind(this,function(u,y){var E=this.menus.get(u);u=this.createMenuElement(y,mxUtils.bind(this,function(){E.funct.apply(this,arguments)}));u.setAttribute("title",y);u.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";u.className="geButton";c.parentNode.appendChild(u);return u});if(Editor.enableCustomLibraries&&("1"!=+function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==t&&q();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*u)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var O=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;+return null!=c?c.window.isVisible():O.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var f=mxUtils.bind(this,function(u,B){var E=this.menus.get(u);u=this.createMenuElement(B,mxUtils.bind(this,function(){E.funct.apply(this,arguments)}));u.setAttribute("title",B);u.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";u.className="geButton";c.parentNode.appendChild(u);return u});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))f=document.createElement("div"),f.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",f.className="geButton",f.style.left="0px",f.style.right="50%",mxUtils.write(f,mxResources.get("newLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("newLibrary").funct),f=f.cloneNode(!1),f.style.left="50%",f.style.right="0px",mxUtils.write(f,mxResources.get("openLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("openLibrary").funct);else{var k=f("newLibrary","");k.style.left="0px";k.style.right="50%";var n=document.createElement("span");k.appendChild(n);var q=f("openLibraryFrom","");q.style.borderLeftWidth="1px";q.style.left="50%";q.style.right="0px";var t=document.createElement("span");q.appendChild(t);this.dependsOnLanguage(mxUtils.bind(this,function(){n.innerHTML="";mxUtils.write(n,mxResources.get("newLibrary"));k.setAttribute("title",mxResources.get("newLibrary"));t.innerHTML="";mxUtils.write(t,mxResources.get("openLibraryFrom"));q.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=mxSettings.getWindowState("shapes"),f=null!=c&&null!=c.w?c.w:Math.min(this.diagramContainer.parentNode.clientWidth-10,230)-6,k=null!=c&&null!=c.h?c.h:("1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,@@ -14192,45 +14196,45 @@ f)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled())mxSettings.getGridColor(!1);c.view.gridColor="light-dark("+c.view.defaultGridColor+", "+c.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(f,k){mxSettings.setGridColor(c.view.defaultGridColor,!1);mxSettings.setGridColor(c.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(f,k){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(f,k){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()});this.addListener("sidebarWidthChanged",function(){mxSettings.setSidebarWidth(this.hsplitPosition);mxSettings.save()});this.addListener("collapsedSectionsChanged",-function(){null!=this.format&&(mxSettings.setCollapsedSections(this.format.collapsedSections),mxSettings.save())})}};EditorUi.prototype.writeImageToClipboard=function(c,f,k,n,q,t){n=null!=n?n:"image/png";var u=null==f||null==k?'<img src="'+c+'">':'<img src="'+c+'" width="'+f+'" height="'+k+'">',y={"text/html":new Blob([u],{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(n)&&(y[n]=this.base64ToBlob(c.substring(c.indexOf(",")+1),n));var E=new ClipboardItem(y);navigator.clipboard.write([E]).then(q)["catch"](t);-EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",[c],"w",f,"h",k,"type",n,"html",[u],"data",[y],"item",[E])};EditorUi.prototype.writeHtmlToClipboard=function(c,f){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})])["catch"](f)};EditorUi.prototype.writeTextToClipboard=function(c,f,k){navigator.clipboard.writeText(c).then(function(){null!=k&&k()})["catch"](f)};EditorUi.prototype.copySvg=-function(c,f,k){try{if(null!=navigator.clipboard&&"function"===typeof window.ClipboardItem){var n=this.editor.graph.getSvg(null,k,null,null,null,null,null,null,null,null,null,Editor.isDarkMode()?"dark":"light",null,0<c.length?c:null);null!=f&&n.setAttribute("content",f);var q=Editor.createSvgDataUri(mxUtils.getXml(n)),t=parseInt(n.getAttribute("width")),u=parseInt(n.getAttribute("height"));this.writeImageToClipboard(q,t,u,"image/svg+xml",null,mxUtils.bind(this,function(y){this.handleError(y)}))}}catch(y){this.handleError(y)}};-EditorUi.prototype.copyImage=function(c,f,k){try{k=null!=k?k:4,null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(n,q){try{this.spinner.stop();var t=this.createImageDataUri(n,f,"png"),u=Math.round(parseInt(q.getAttribute("width"))/k),y=Math.round(parseInt(q.getAttribute("height"))/k);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[f],"scale",[k]);this.writeImageToClipboard(t,-u,y,"image/png",null,mxUtils.bind(this,function(){if(this.isLocalFileSave()){var E=this.getBaseFilename(!1)+(null!=f?".drawio":"")+".png";this.saveLocalFile(t.substring(t.lastIndexOf(",")+1),E,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(E){this.handleError(E)}}),null,null,null,mxUtils.bind(this,function(n){this.spinner.stop();this.handleError(n)}),null,null,k,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,+function(){null!=this.format&&(mxSettings.setCollapsedSections(this.format.collapsedSections),mxSettings.save())})}};EditorUi.prototype.writeImageToClipboard=function(c,f,k,n,q,t){n=null!=n?n:"image/png";var u=null==f||null==k?'<img src="'+c+'">':'<img src="'+c+'" width="'+f+'" height="'+k+'">',B={"text/html":new Blob([u],{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(n)&&(B[n]=this.base64ToBlob(c.substring(c.indexOf(",")+1),n));var E=new ClipboardItem(B);navigator.clipboard.write([E]).then(q)["catch"](t);+EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",[c],"w",f,"h",k,"type",n,"html",[u],"data",[B],"item",[E])};EditorUi.prototype.writeHtmlToClipboard=function(c,f){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})])["catch"](f)};EditorUi.prototype.writeTextToClipboard=function(c,f,k){navigator.clipboard.writeText(c).then(function(){null!=k&&k()})["catch"](f)};EditorUi.prototype.copySvg=+function(c,f,k){try{if(null!=navigator.clipboard&&"function"===typeof window.ClipboardItem){var n=this.editor.graph.getSvg(null,k,null,null,null,null,null,null,null,null,null,Editor.isDarkMode()?"dark":"light",null,0<c.length?c:null);null!=f&&n.setAttribute("content",f);var q=Editor.createSvgDataUri(mxUtils.getXml(n)),t=parseInt(n.getAttribute("width")),u=parseInt(n.getAttribute("height"));this.writeImageToClipboard(q,t,u,"image/svg+xml",null,mxUtils.bind(this,function(B){this.handleError(B)}))}}catch(B){this.handleError(B)}};+EditorUi.prototype.copyImage=function(c,f,k){try{k=null!=k?k:4,null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(n,q){try{this.spinner.stop();var t=this.createImageDataUri(n,f,"png"),u=Math.round(parseInt(q.getAttribute("width"))/k),B=Math.round(parseInt(q.getAttribute("height"))/k);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[f],"scale",[k]);this.writeImageToClipboard(t,+u,B,"image/png",null,mxUtils.bind(this,function(){if(this.isLocalFileSave()){var E=this.getBaseFilename(!1)+(null!=f?".drawio":"")+".png";this.saveLocalFile(t.substring(t.lastIndexOf(",")+1),E,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(E){this.handleError(E)}}),null,null,null,mxUtils.bind(this,function(n){this.spinner.stop();this.handleError(n)}),null,null,k,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,Editor.isDarkMode()?"dark":"light",null,0<c.length?c:null)}catch(n){this.handleError(n)}};EditorUi.prototype.copyCells=function(c,f){var k=this.editor.graph;if(k.isSelectionEmpty())c.innerText="";else{var n=mxUtils.sortCells(k.model.getTopmostCells(k.getSelectionCells())),q=mxUtils.getXml(k.encodeCells(n));mxUtils.setTextContent(c,encodeURIComponent(q));f?(k.removeCells(n,!1),k.lastPasteXml=null):(k.lastPasteXml=q,k.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=-function(){var c=null;if(Editor.enableNativeClipboard){var f=this.editor.graph;f.isSelectionEmpty()||(c=mxUtils.sortCells(f.getExportableCells(f.model.getTopmostCells(f.getSelectionCells()))),f=mxUtils.getXml(f.encodeCells(c)),navigator.clipboard.writeText(f))}return c};EditorUi.prototype.pasteXml=function(c,f,k,n,q,t){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",[f],"compat",[k],"evt",[n],"html",[q],"pt",[t]);q=null!=q?q:!0;var u=this.editor.graph,y=null!=t?t:Editor.pasteAtMousePointer&&-u.isMouseInsertPoint()?u.getInsertPoint():null;t=null;u.lastPasteXml==c?null==y&&u.pasteCounter++:(u.lastPasteXml=c,u.pasteCounter=0);var E=u.pasteCounter*u.gridSize;if(k||this.isCompatibleString(c)){u.model.beginUpdate();try{if(t=this.importXml(c,E,E),null!=y){var I=u.getBoundingBoxFromGeometry(t,!0);if(null!=I){var C=Math.round(u.snap(y.x)),U=Math.round(u.snap(y.y));u.cellsMoved(t,C-I.x,U-I.y)}}}finally{u.model.endUpdate()}u.setSelectionCells(t)}else if(f&&1==u.getSelectionCount()){f=u.getStartEditingCell(u.getSelectionCell(),-n);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==u.getCurrentCellStyle(f)[mxConstants.STYLE_SHAPE])u.setCellStyles(mxConstants.STYLE_IMAGE,c,[f]);else{u.model.beginUpdate();try{u.labelChanged(f,c),Graph.isLink(c)&&u.setLinkForCell(f,c)}finally{u.model.endUpdate()}}u.setSelectionCell(f)}else y=null!=y?y:u.getInsertPoint(),u.isMouseInsertPoint()&&(E=0,u.lastPasteXml==c&&0<u.pasteCounter&&u.pasteCounter--),t=this.insertTextAt(c,y.x+E,y.y+E,q),u.setSelectionCells(t);u.isSelectionEmpty()||(u.scrollCellToVisible(u.getSelectionCell()),-null!=this.hoverIcons&&this.hoverIcons.update(u.view.getState(u.getSelectionCell())));return t};EditorUi.prototype.pasteCells=function(c,f,k,n){if(!mxEvent.isConsumed(c)){var q=c.clipboardData,t=this.editor.graph,u=!1,y=f;if(k&&null!=q&&q.getData){var E=q.getData("text/plain"),I=!1;if(null!=E&&0<E.length&&"%3CmxGraphModel%3E"==E.substring(0,18))try{var C=decodeURIComponent(E);this.isCompatibleString(C)&&(I=!0,E=C)}catch(v){}I=I?null:q.getData("text/html");null!=I&&0<I.length?(y=this.parseHtmlData(I),-u="text/plain"!=y.getAttribute("data-type")):null!=E&&0<E.length&&(y=document.createElement("div"),mxUtils.setTextContent(y,E))}E=y.getElementsByTagName("span");if(null!=E&&0<E.length&&"application/vnd.lucid.chart.objects"===E[0].getAttribute("data-lucid-type"))k=E[0].getAttribute("data-lucid-content"),null!=k&&0<k.length&&(this.convertLucidChart(k,mxUtils.bind(this,function(v){var d=this.editor.graph;d.lastPasteXml==v?d.pasteCounter++:(d.lastPasteXml=v,d.pasteCounter=0);var m=d.pasteCounter*d.gridSize;-d.setSelectionCells(this.importXml(v,m,m));d.scrollCellToVisible(d.getSelectionCell())}),mxUtils.bind(this,function(v){this.handleError(v)})),mxEvent.consume(c));else{var U=!1,J="";J=u?null!=y.textContent&&"<mxfile"==y.textContent.substring(0,7)&&"</mxfile>"==y.textContent.substring(y.textContent.length-9)||"<mxGraphModel"==y.textContent.substring(0,13)&&"</mxGraphModel>"==y.textContent.substring(y.textContent.length-15)?y.textContent.replace(/\u00a0/g," "):y.innerHTML:mxUtils.trim(null==y.innerText?-mxUtils.getTextContent(y):y.innerText);try{var S=J.lastIndexOf("%3E");0<=S&&S<J.length-3&&(J=J.substring(0,S+3))}catch(v){}try{E=y.getElementsByTagName("span"),(C=null!=E&&0<E.length?mxUtils.trim(decodeURIComponent(E[0].textContent)):decodeURIComponent(J))&&(this.isCompatibleString(C)||0==C.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(U=!0,J=C)}catch(v){}C=null;try{if(!U&&""==y.textContent)for(S=0;S<q.items.length;S++){var N=q.items[S];if("file"===N.kind){C=N.getAsFile();break}}}catch(v){}EditorUi.debug("EditorUi.pasteCells",-[this],"evt",[c],"realElt",[f.outerHTML],"elt",[y.outerHTML],"useEvent",k,"pasteAsLabel",n,"xml",[J],"compat",U,"asHtml",u,"data",q,"items",[q.items.length],"files",[q.files.length],"types",[JSON.stringify(q.types)],"blob",[C]);try{if(U||null==C)if(null!=J&&0<J.length){if(0==J.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var T=mxUtils.bind(this,function(){try{J=(new MiroImporter).importMiroJson(JSON.parse(J)),this.pasteXml(J,n,U,c)}catch(v){console.log("Miro import error:",v)}});-"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",T):T()}else this.pasteXml(J,n,U,c,u);mxEvent.consume(c)}else k||(t.lastPasteXml=null,t.pasteCounter=0);else{var R=t.getInsertPoint();this.importFiles([C],R.x,R.y,this.maxImageSize);mxEvent.consume(c)}}catch(v){this.handleError(v)}}}f.innerHTML=" "};EditorUi.prototype.pasteFromClipboard=function(c){var f=this.editor.graph;null==c&&Editor.pasteAtMousePointer&&f.isMouseInsertPoint()&&(c=f.getInsertPoint());if(f.isEnabled()&&+function(){var c=null;if(Editor.enableNativeClipboard){var f=this.editor.graph;f.isSelectionEmpty()||(c=mxUtils.sortCells(f.getExportableCells(f.model.getTopmostCells(f.getSelectionCells()))),f=mxUtils.getXml(f.encodeCells(c)),navigator.clipboard.writeText(f))}return c};EditorUi.prototype.pasteXml=function(c,f,k,n,q,t){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",[f],"compat",[k],"evt",[n],"html",[q],"pt",[t]);q=null!=q?q:!0;var u=this.editor.graph,B=null!=t?t:Editor.pasteAtMousePointer&&+u.isMouseInsertPoint()?u.getInsertPoint():null;t=null;u.lastPasteXml==c?null==B&&u.pasteCounter++:(u.lastPasteXml=c,u.pasteCounter=0);var E=u.pasteCounter*u.gridSize;if(k||this.isCompatibleString(c)){u.model.beginUpdate();try{if(t=this.importXml(c,E,E),null!=B){var I=u.getBoundingBoxFromGeometry(t,!0);if(null!=I){var C=Math.round(u.snap(B.x)),U=Math.round(u.snap(B.y));u.cellsMoved(t,C-I.x,U-I.y)}}}finally{u.model.endUpdate()}u.setSelectionCells(t)}else if(f&&1==u.getSelectionCount()){f=u.getStartEditingCell(u.getSelectionCell(),+n);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==u.getCurrentCellStyle(f)[mxConstants.STYLE_SHAPE])u.setCellStyles(mxConstants.STYLE_IMAGE,c,[f]);else{u.model.beginUpdate();try{u.labelChanged(f,c),Graph.isLink(c)&&u.setLinkForCell(f,c)}finally{u.model.endUpdate()}}u.setSelectionCell(f)}else B=null!=B?B:u.getInsertPoint(),u.isMouseInsertPoint()&&(E=0,u.lastPasteXml==c&&0<u.pasteCounter&&u.pasteCounter--),t=this.insertTextAt(c,B.x+E,B.y+E,q),u.setSelectionCells(t);u.isSelectionEmpty()||(u.scrollCellToVisible(u.getSelectionCell()),+null!=this.hoverIcons&&this.hoverIcons.update(u.view.getState(u.getSelectionCell())));return t};EditorUi.prototype.pasteCells=function(c,f,k,n){if(!mxEvent.isConsumed(c)){var q=c.clipboardData,t=this.editor.graph,u=!1,B=f;if(k&&null!=q&&q.getData){var E=q.getData("text/plain"),I=!1;if(null!=E&&0<E.length&&"%3CmxGraphModel%3E"==E.substring(0,18))try{var C=decodeURIComponent(E);this.isCompatibleString(C)&&(I=!0,E=C)}catch(v){}I=I?null:q.getData("text/html");null!=I&&0<I.length?(B=this.parseHtmlData(I),+u="text/plain"!=B.getAttribute("data-type")):null!=E&&0<E.length&&(B=document.createElement("div"),mxUtils.setTextContent(B,E))}E=B.getElementsByTagName("span");if(null!=E&&0<E.length&&"application/vnd.lucid.chart.objects"===E[0].getAttribute("data-lucid-type"))k=E[0].getAttribute("data-lucid-content"),null!=k&&0<k.length&&(this.convertLucidChart(k,mxUtils.bind(this,function(v){var d=this.editor.graph;d.lastPasteXml==v?d.pasteCounter++:(d.lastPasteXml=v,d.pasteCounter=0);var m=d.pasteCounter*d.gridSize;+d.setSelectionCells(this.importXml(v,m,m));d.scrollCellToVisible(d.getSelectionCell())}),mxUtils.bind(this,function(v){this.handleError(v)})),mxEvent.consume(c));else{var U=!1,K="";K=u?null!=B.textContent&&"<mxfile"==B.textContent.substring(0,7)&&"</mxfile>"==B.textContent.substring(B.textContent.length-9)||"<mxGraphModel"==B.textContent.substring(0,13)&&"</mxGraphModel>"==B.textContent.substring(B.textContent.length-15)?B.textContent.replace(/\u00a0/g," "):B.innerHTML:mxUtils.trim(null==B.innerText?+mxUtils.getTextContent(B):B.innerText);try{var S=K.lastIndexOf("%3E");0<=S&&S<K.length-3&&(K=K.substring(0,S+3))}catch(v){}try{E=B.getElementsByTagName("span"),(C=null!=E&&0<E.length?mxUtils.trim(decodeURIComponent(E[0].textContent)):decodeURIComponent(K))&&(this.isCompatibleString(C)||0==C.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(U=!0,K=C)}catch(v){}C=null;try{if(!U&&""==B.textContent)for(S=0;S<q.items.length;S++){var M=q.items[S];if("file"===M.kind){C=M.getAsFile();break}}}catch(v){}EditorUi.debug("EditorUi.pasteCells",+[this],"evt",[c],"realElt",[f.outerHTML],"elt",[B.outerHTML],"useEvent",k,"pasteAsLabel",n,"xml",[K],"compat",U,"asHtml",u,"data",q,"items",[q.items.length],"files",[q.files.length],"types",[JSON.stringify(q.types)],"blob",[C]);try{if(U||null==C)if(null!=K&&0<K.length){if(0==K.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var T=mxUtils.bind(this,function(){try{K=(new MiroImporter).importMiroJson(JSON.parse(K)),this.pasteXml(K,n,U,c)}catch(v){console.log("Miro import error:",v)}});+"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",T):T()}else this.pasteXml(K,n,U,c,u);mxEvent.consume(c)}else k||(t.lastPasteXml=null,t.pasteCounter=0);else{var R=t.getInsertPoint();this.importFiles([C],R.x,R.y,this.maxImageSize);mxEvent.consume(c)}}catch(v){this.handleError(v)}}}f.innerHTML=" "};EditorUi.prototype.pasteFromClipboard=function(c){var f=this.editor.graph;null==c&&Editor.pasteAtMousePointer&&f.isMouseInsertPoint()&&(c=f.getInsertPoint());if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(k,n,q,t,u){if(null!=k){f.getModel().beginUpdate();try{this.pasteXml(k,!0,null,null,null,c)}finally{f.getModel().endUpdate()}}else k=null!=n?n:null!=q?q:t,null!=k?(c=null!=c?c:f.getInsertPoint(),this.importFiles([k],c.x,c.y,this.maxImageSize)):this.pasteFromLocalClipboard(c)})):this.pasteFromLocalClipboard(c)}catch(k){}};EditorUi.prototype.pasteFromLocalClipboard=function(c){var f=this.editor.graph;f.getModel().beginUpdate();try{f.moveCellsTo(mxClipboard.paste(f),c)}finally{f.getModel().endUpdate()}};EditorUi.prototype.installImagePasteHandler=function(){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,function(f){for(var k=null!=f.clipboardData?f.clipboardData:f.originalEvent.clipboardData,n=!1,q=null,t=0;t<k.types.length;t++)if("text/"===k.types[t].substring(0,5)){n=!0;break}for(t=0;t<k.items.length;t++){var u=k.items[t];if("file"===u.kind){q=-u.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[f],"data",[k],"items",[k.items.length],"files",[k.files.length],"types",[JSON.stringify(k.types)],"containsText",n,"file",[q],"editing",c.isEditing());var y=mxUtils.bind(this,function(){try{if(!n&&null!=q){if(c.isEditing())this.importFiles([q],0,0,this.maxImageSize,function(I,C,U,J,S,N){c.insertImage(I,S,N)},function(){},function(I){return"image/"==I.type.substring(0,6)},function(I){for(var C=0;C<I.length;C++)I[C]()});-else{var E=this.editor.graph.getInsertPoint();this.importFiles([q],E.x,E.y,this.maxImageSize)}mxEvent.consume(f)}}catch(I){}});if(!mxEvent.isConsumed(f)&&!n)if(Editor.enableNativeClipboard)navigator.clipboard.read().then(mxUtils.bind(this,function(E){this.readTypeFromClipboardData(E,"image/svg+xml",mxUtils.bind(this,function(I){if(null!=I){I=new Blob([I],{type:"image/svg+xml"});var C=this.editor.graph.getInsertPoint();this.importFiles([I],C.x,C.y,this.maxImageSize)}else y()}),"image")}))["catch"](y);-else y()}),!1)};EditorUi.prototype.readGraphModelFromClipboard=function(c){navigator.clipboard.read().then(mxUtils.bind(this,function(f){try{EditorUi.debug("EditorUi.readGraphModelFromClipboard",[this],"data",f,"types",null!=f&&0<f.length?[JSON.stringify(f[0].types)]:[]),this.readGraphModelFromHtmlClipboardData(f,mxUtils.bind(this,function(k,n){null!=k?c(k):this.readGraphModelFromImageClipboardData(f,mxUtils.bind(this,function(q,t,u){null!=q?c(q):this.readTypeFromClipboardData(f,"text/plain",mxUtils.bind(this,-function(y){c(y,t,u,n,f)}))}))}))}catch(k){c(null)}}))["catch"](function(){c(null)})};EditorUi.prototype.readGraphModelFromHtmlClipboardData=function(c,f){this.readTypeFromClipboardData(c,"text/html",mxUtils.bind(this,function(k){var n=null,q=null;try{var t=this.parseHtmlData(k);if(null!=t){n="text/plain"!=t.getAttribute("data-type")?t.innerHTML:mxUtils.trim(null==t.innerText?mxUtils.getTextContent(t):t.innerText);try{var u=n.lastIndexOf("%3E");0<=u&&u<n.length-3&&(n=n.substring(0,u+3))}catch(I){}try{null==-n&&(k=null,""==t.textContent&&1==t.children.length&&"IMG"==t.firstChild.nodeName&&(k=t.firstChild.getAttribute("src")),null!=k&&0<k.length&&("data:image/png;base64,"==k.substring(0,22)?q=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==k.substring(0,26)&&(q=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/svg+xml"))))}catch(I){}try{var y=t.getElementsByTagName("span"),E=null!=y&&0<y.length?mxUtils.trim(decodeURIComponent(y[0].textContent)):decodeURIComponent(n);+u.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[f],"data",[k],"items",[k.items.length],"files",[k.files.length],"types",[JSON.stringify(k.types)],"containsText",n,"file",[q],"editing",c.isEditing());var B=mxUtils.bind(this,function(){try{if(!n&&null!=q){if(c.isEditing())this.importFiles([q],0,0,this.maxImageSize,function(I,C,U,K,S,M){c.insertImage(I,S,M)},function(){},function(I){return"image/"==I.type.substring(0,6)},function(I){for(var C=0;C<I.length;C++)I[C]()});+else{var E=this.editor.graph.getInsertPoint();this.importFiles([q],E.x,E.y,this.maxImageSize)}mxEvent.consume(f)}}catch(I){}});if(!mxEvent.isConsumed(f)&&!n)if(Editor.enableNativeClipboard)navigator.clipboard.read().then(mxUtils.bind(this,function(E){this.readTypeFromClipboardData(E,"image/svg+xml",mxUtils.bind(this,function(I){if(null!=I){I=new Blob([I],{type:"image/svg+xml"});var C=this.editor.graph.getInsertPoint();this.importFiles([I],C.x,C.y,this.maxImageSize)}else B()}),"image")}))["catch"](B);+else B()}),!1)};EditorUi.prototype.readGraphModelFromClipboard=function(c){navigator.clipboard.read().then(mxUtils.bind(this,function(f){try{EditorUi.debug("EditorUi.readGraphModelFromClipboard",[this],"data",f,"types",null!=f&&0<f.length?[JSON.stringify(f[0].types)]:[]),this.readGraphModelFromHtmlClipboardData(f,mxUtils.bind(this,function(k,n){null!=k?c(k):this.readGraphModelFromImageClipboardData(f,mxUtils.bind(this,function(q,t,u){null!=q?c(q):this.readTypeFromClipboardData(f,"text/plain",mxUtils.bind(this,+function(B){c(B,t,u,n,f)}))}))}))}catch(k){c(null)}}))["catch"](function(){c(null)})};EditorUi.prototype.readGraphModelFromHtmlClipboardData=function(c,f){this.readTypeFromClipboardData(c,"text/html",mxUtils.bind(this,function(k){var n=null,q=null;try{var t=this.parseHtmlData(k);if(null!=t){n="text/plain"!=t.getAttribute("data-type")?t.innerHTML:mxUtils.trim(null==t.innerText?mxUtils.getTextContent(t):t.innerText);try{var u=n.lastIndexOf("%3E");0<=u&&u<n.length-3&&(n=n.substring(0,u+3))}catch(I){}try{null==+n&&(k=null,""==t.textContent&&1==t.children.length&&"IMG"==t.firstChild.nodeName&&(k=t.firstChild.getAttribute("src")),null!=k&&0<k.length&&("data:image/png;base64,"==k.substring(0,22)?q=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==k.substring(0,26)&&(q=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/svg+xml"))))}catch(I){}try{var B=t.getElementsByTagName("span"),E=null!=B&&0<B.length?mxUtils.trim(decodeURIComponent(B[0].textContent)):decodeURIComponent(n);this.isCompatibleString(E)&&(n=E)}catch(I){}}}catch(I){}f(this.isCompatibleString(n)?n:null,q)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,f){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(k,n){var q=null;try{null!=k&&(q=mxUtils.parseXml(k).documentElement.getAttribute("content"))}catch(t){}this.isCompatibleString(q)?f(q):this.readTypeFromClipboardData(c,"image/png",mxUtils.bind(this,function(t,u){q=Editor.extractGraphModelFromPng("data:image/png;base64,"+-t);this.isCompatibleString(q)?f(q):f(null,n,u)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,f,k){var n=!1;if(null!=c&&0<c.length)for(var q=0;q<c.length&&!n;q++)(function(t){0<=mxUtils.indexOf(t.types,f)&&(n=!0,t.getType(f).then(mxUtils.bind(this,function(u){if("image/png"==f)u.arrayBuffer().then(function(y){k(btoa(Graph.arrayBufferToString(y)),u)})["catch"](function(){k(null)});else u.text().then(mxUtils.bind(this,function(y){EditorUi.debug("EditorUi.readTypeFromClipboardData",[this],-"data",[c],"type",[f],"result",[y]);k(y,u)}))["catch"](function(){k(null)})}))["catch"](function(){k(null)}))})(c[q]);n||k()};EditorUi.prototype.parseHtmlData=function(c){var f=null;if(null!=c&&0<c.length){var k="<meta "==c.substring(0,6);f=document.createElement("div");f.innerHTML=(k?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(c);asHtml=!0;k=f.getElementsByTagName("style");if(null!=k)for(;0<k.length;)k[0].parentNode.removeChild(k[0]);if(null!=f.firstChild&&f.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&+t);this.isCompatibleString(q)?f(q):f(null,n,u)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,f,k){var n=!1;if(null!=c&&0<c.length)for(var q=0;q<c.length&&!n;q++)(function(t){0<=mxUtils.indexOf(t.types,f)&&(n=!0,t.getType(f).then(mxUtils.bind(this,function(u){if("image/png"==f)u.arrayBuffer().then(function(B){k(btoa(Graph.arrayBufferToString(B)),u)})["catch"](function(){k(null)});else u.text().then(mxUtils.bind(this,function(B){EditorUi.debug("EditorUi.readTypeFromClipboardData",[this],+"data",[c],"type",[f],"result",[B]);k(B,u)}))["catch"](function(){k(null)})}))["catch"](function(){k(null)}))})(c[q]);n||k()};EditorUi.prototype.parseHtmlData=function(c){var f=null;if(null!=c&&0<c.length){var k="<meta "==c.substring(0,6);f=document.createElement("div");f.innerHTML=(k?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(c);asHtml=!0;k=f.getElementsByTagName("style");if(null!=k)for(;0<k.length;)k[0].parentNode.removeChild(k[0]);if(null!=f.firstChild&&f.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=f.firstChild.nextSibling&&f.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==f.firstChild.nodeName&&"A"==f.firstChild.nextSibling.nodeName&&null==f.firstChild.nextSibling.nextSibling){var n=null==f.firstChild.nextSibling.innerText?mxUtils.getTextContent(f.firstChild.nextSibling):f.firstChild.nextSibling.innerText;n==f.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(f,n),asHtml=!1)}if(""==f.textContent&&(k=f.getElementsByTagName("img"),1==k.length&&(n=k[0].getAttribute("src"),k=null,null!=n))){if(Editor.isPngDataUrl(n)){var q=Editor.extractGraphModelFromPng(n);null!=q&&0<q.length&&(k=q)}else if("data:image/svg+xml;base64,"==n.substring(0,26)){img=this.base64ToBlob(n.substring(n.indexOf(",")+1),"image/svg+xml");n=Graph.getSvgFromDataUri(n);try{q=mxUtils.parseXml(n).documentElement.getAttribute("content"),this.isCompatibleString(q)&&(k=q)}catch(t){}}null!=k&&(mxUtils.setTextContent(f,k),asHtml=!1)}asHtml?Graph.removePasteFormatting(f):f.setAttribute("data-type",-"text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[f],"asHtml",asHtml);return f};EditorUi.prototype.showPrintDialog=function(c,f,k){this.showDialog((new PrintDialog(this,c,f,k)).container,360,null,!0,!0)};EditorUi.prototype.print=function(c,f){var k=this.editor,n=k.graph,q=this.getPageIndex(this.currentPage),t=null!=q?q+1:1,u=mxUtils.bind(this,function(v,d,m,r){var A=v.useCssTransforms,D=v.currentTranslate,G=v.currentScale,O=v.view.translate,P=v.view.scale;v.useCssTransforms&&-(v.useCssTransforms=!1,v.currentTranslate=new mxPoint(0,0),v.currentScale=1,v.view.translate=new mxPoint(0,0),v.view.scale=1);var V=v.getGraphBounds(),Y=0,H=0,W=mxRectangle.fromRectangle(v.pageFormat),Z=f.fit||f.crop||!v.pageVisible,X=f.scale;W.width*=v.pageScale;W.height*=v.pageScale;var ba=1;if(f.fit){ba=f.sheetsAcross;var ea=f.sheetsDown;isNaN(X)||(W.width=Math.ceil(W.width*X),W.height=Math.ceil(W.height*X));ba=Math.min(W.height*ea/(V.height/v.view.scale),W.width*ba/(V.width/v.view.scale))}else ba=-isNaN(X)?1:X;ba*=1;!Z&&v.pageVisible?(X=v.getPageLayout(),Y-=X.x*W.width,H-=X.y*W.height):Z=!0;f.crop&&(f.selection&&(V=n.getBoundingBox(n.getSelectionCells())),W.width=(V.width+1)*ba/v.view.scale,W.height=(V.height+1)*ba/v.view.scale);W.width*=1;W.height*=1;r=null!=r?"page/id,"+r:null;if(null==d){d=PrintDialog.createPrintPreview(v,ba,null,0,Y,H,Z);d.title=this.getBaseFilename(!0);d.pageSelector=!1;d.mathEnabled=!1;Y=f.border;isNaN(Y)||(d.pageMargin=Y);var aa=d.writeHead;d.writeHead=function(ra,sa){sa=+"text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[f],"asHtml",asHtml);return f};EditorUi.prototype.showPrintDialog=function(c,f,k){this.showDialog((new PrintDialog(this,c,f,k)).container,360,null,!0,!0)};EditorUi.prototype.print=function(c,f){var k=this.editor,n=k.graph,q=this.getPageIndex(this.currentPage),t=null!=q?q+1:1,u=mxUtils.bind(this,function(v,d,m,r){var z=v.useCssTransforms,D=v.currentTranslate,F=v.currentScale,N=v.view.translate,P=v.view.scale;v.useCssTransforms&&+(v.useCssTransforms=!1,v.currentTranslate=new mxPoint(0,0),v.currentScale=1,v.view.translate=new mxPoint(0,0),v.view.scale=1);var V=v.getGraphBounds(),X=0,H=0,W=mxRectangle.fromRectangle(v.pageFormat),Z=f.fit||f.crop||!v.pageVisible,Y=f.scale;W.width*=v.pageScale;W.height*=v.pageScale;var ba=1;if(f.fit){ba=f.sheetsAcross;var ea=f.sheetsDown;isNaN(Y)||(W.width=Math.ceil(W.width*Y),W.height=Math.ceil(W.height*Y));ba=Math.min(W.height*ea/(V.height/v.view.scale),W.width*ba/(V.width/v.view.scale))}else ba=+isNaN(Y)?1:Y;ba*=1;!Z&&v.pageVisible?(Y=v.getPageLayout(),X-=Y.x*W.width,H-=Y.y*W.height):Z=!0;f.crop&&(f.selection&&(V=n.getBoundingBox(n.getSelectionCells())),W.width=(V.width+1)*ba/v.view.scale,W.height=(V.height+1)*ba/v.view.scale);W.width*=1;W.height*=1;r=null!=r?"page/id,"+r:null;if(null==d){d=PrintDialog.createPrintPreview(v,ba,null,0,X,H,Z);d.title=this.getBaseFilename(!0);d.pageSelector=!1;d.mathEnabled=!1;X=f.border;isNaN(X)||(d.pageMargin=X);var aa=d.writeHead;d.writeHead=function(ra,sa){sa=null!=sa?sa:"";f.shadows||(sa+='g[style*="filter: drop-shadow("] {\n filter: none !important;{\n}\n');mxClient.IS_GC&&(sa+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");null!=k.fontCss&&(sa+=k.fontCss);aa.apply(this,arguments);for(var ua=v.getCustomFonts(),xa=0;xa<ua.length;xa++){var qa=ua[xa].name,Aa=ua[xa].url;Graph.isCssFontUrl(Aa)?ra.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(Aa))+'" charset="UTF-8" type="text/css">'):(ra.writeln('<style type="text/css">'),ra.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(qa)+'";\nsrc: url("'+mxUtils.htmlEntities(Aa)+'");\n}'),ra.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var ha=d.drawBackgroundImage;d.drawBackgroundImage=function(ra){ha.apply(this,arguments);null!=ra.node&&(EditorUi.embedSvgImages(ra.node),n.disableSvgLinks(ra.node,function(sa){sa.setAttribute("href","javascript:void(0)")}))}}var na=d.addGraphFragment;d.addGraphFragment=function(ra,sa,ua,xa,qa,Aa){na.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:qa.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var Ba=qa.getElementsByTagName("svg"),Ea=0;Ea<Ba.length;Ea++)v.addSvgShadow(Ba[Ea])};f.grid&&(d.gridSize=v.gridSize,d.gridSteps=v.view.gridSteps,d.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:v.view.gridColor);d.isCellVisible=f.selection?function(ra){return v.isCellSelected(ra)&&v.isCellVisible(ra)}:function(ra){return v.isCellVisible(ra)};d.open(null,null,m,!0,r,W,f.selection?-v.getSelectionCells():null)}else{V=v.background;if(null==V||""==V||V==mxConstants.NONE)V="#ffffff";d.backgroundColor=V;d.autoOrigin=Z;f.grid&&(d.gridSize=v.gridSize,d.gridSteps=v.view.gridSteps,d.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:v.view.gridColor);d.isCellVisible=f.selection?function(ra){return v.isCellSelected(ra)&&v.isCellVisible(ra)}:function(ra){return v.isCellVisible(ra)};d.appendGraph(v,ba,Y,H,m,!0,r,W,f.selection?v.getSelectionCells():null);m=v.getCustomFonts();-if(null!=d.wnd)for(W=0;W<m.length;W++)Y=m[W].name,H=m[W].url,Graph.isCssFontUrl(H)?d.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(H)+'" charset="UTF-8" type="text/css">'):(d.wnd.document.writeln('<style type="text/css">'),d.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Y)+'";\nsrc: url("'+mxUtils.htmlEntities(H)+'");\n}'),d.wnd.document.writeln("</style>"))}A&&(v.useCssTransforms=A,v.currentTranslate=D,v.currentScale=G,v.view.translate=O,v.view.scale=-P);return d}),y=f.pagesFrom,E=f.pagesTo,I=!f.allPages;q=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{I&&(I=f.selection||y==t&&E==t);if(!I&&null!=this.pages&&this.pages.length){I=0;t=this.pages.length-1;f.allPages||(I=parseInt(y)-1,t=parseInt(E)-1);for(var C=I;C<=t;C++){var U=this.pages[C];y=U==this.currentPage?n:null;if(null==y){y=this.createTemporaryGraph(n.stylesheet);y.shapeForegroundColor=n.shapeForegroundColor;y.shapeBackgroundColor=n.shapeBackgroundColor;E=!0;var J=-I=!1,S=null,N=null;null==U.viewState&&null==U.root&&this.updatePageRoot(U);null!=U.viewState&&(E=U.viewState.pageVisible,I=U.viewState.mathEnabled,J=U.viewState.shadowVisible,S=U.viewState.background,N=U.viewState.backgroundImage,y.pageFormat=U.viewState.pageFormat,y.gridSize=U.viewState.gridSize,y.hiddenTags=U.viewState.hiddenTags||[]);null!=N&&null!=N.originalSrc&&(N=this.createImageForPageLink(N.originalSrc,U));y.background=S;y.backgroundImage=null!=N?new mxImage(N.src,N.width,N.height,N.x,N.y):-null;y.pageVisible=E;y.mathEnabled=I;y.shadowVisible=J;var R=y.getGraphBounds;y.getGraphBounds=function(){var v=R.apply(this,arguments),d=this.backgroundImage;if(null!=d&&null!=d.width&&null!=d.height){var m=this.view.translate,r=this.view.scale;v=mxRectangle.fromRectangle(v);v.add(new mxRectangle((m.x+d.x)*r,(m.y+d.y)*r,d.width*r,d.height*r))}return v};var T=y.getGlobalVariable;y.getGlobalVariable=function(v){return"page"==v?U.getName():"pagenumber"==v?C+1:"pagecount"==v?null!=this.pages?this.pages.length:-1:T.apply(this,arguments)};document.body.appendChild(y.container);this.updatePageRoot(U);y.model.setRoot(U.root)}q=u(y,q,C!=t,U.getId());y!=n&&y.container.parentNode.removeChild(y.container)}}else q=u(n);if(null==q||null==q.wnd)this.handleError({message:mxResources.get("errorUpdatingPreview")});else{q.mathEnabled&&(u=q.wnd.document,c||(q.wnd.IMMEDIATE_PRINT=!0),u.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>'));q.closeDocument();if(Editor.expandPatternsForPrint&&null!=+v.getSelectionCells():null)}else{V=v.background;if(null==V||""==V||V==mxConstants.NONE)V="#ffffff";d.backgroundColor=V;d.autoOrigin=Z;f.grid&&(d.gridSize=v.gridSize,d.gridSteps=v.view.gridSteps,d.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:v.view.gridColor);d.isCellVisible=f.selection?function(ra){return v.isCellSelected(ra)&&v.isCellVisible(ra)}:function(ra){return v.isCellVisible(ra)};d.appendGraph(v,ba,X,H,m,!0,r,W,f.selection?v.getSelectionCells():null);m=v.getCustomFonts();+if(null!=d.wnd)for(W=0;W<m.length;W++)X=m[W].name,H=m[W].url,Graph.isCssFontUrl(H)?d.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(H)+'" charset="UTF-8" type="text/css">'):(d.wnd.document.writeln('<style type="text/css">'),d.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(X)+'";\nsrc: url("'+mxUtils.htmlEntities(H)+'");\n}'),d.wnd.document.writeln("</style>"))}z&&(v.useCssTransforms=z,v.currentTranslate=D,v.currentScale=F,v.view.translate=N,v.view.scale=+P);return d}),B=f.pagesFrom,E=f.pagesTo,I=!f.allPages;q=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{I&&(I=f.selection||B==t&&E==t);if(!I&&null!=this.pages&&this.pages.length){I=0;t=this.pages.length-1;f.allPages||(I=parseInt(B)-1,t=parseInt(E)-1);for(var C=I;C<=t;C++){var U=this.pages[C];B=U==this.currentPage?n:null;if(null==B){B=this.createTemporaryGraph(n.stylesheet);B.shapeForegroundColor=n.shapeForegroundColor;B.shapeBackgroundColor=n.shapeBackgroundColor;E=!0;var K=+I=!1,S=null,M=null;null==U.viewState&&null==U.root&&this.updatePageRoot(U);null!=U.viewState&&(E=U.viewState.pageVisible,I=U.viewState.mathEnabled,K=U.viewState.shadowVisible,S=U.viewState.background,M=U.viewState.backgroundImage,B.pageFormat=U.viewState.pageFormat,B.gridSize=U.viewState.gridSize,B.hiddenTags=U.viewState.hiddenTags||[]);null!=M&&null!=M.originalSrc&&(M=this.createImageForPageLink(M.originalSrc,U));B.background=S;B.backgroundImage=null!=M?new mxImage(M.src,M.width,M.height,M.x,M.y):+null;B.pageVisible=E;B.mathEnabled=I;B.shadowVisible=K;var R=B.getGraphBounds;B.getGraphBounds=function(){var v=R.apply(this,arguments),d=this.backgroundImage;if(null!=d&&null!=d.width&&null!=d.height){var m=this.view.translate,r=this.view.scale;v=mxRectangle.fromRectangle(v);v.add(new mxRectangle((m.x+d.x)*r,(m.y+d.y)*r,d.width*r,d.height*r))}return v};var T=B.getGlobalVariable;B.getGlobalVariable=function(v){return"page"==v?U.getName():"pagenumber"==v?C+1:"pagecount"==v?null!=this.pages?this.pages.length:+1:T.apply(this,arguments)};document.body.appendChild(B.container);this.updatePageRoot(U);B.model.setRoot(U.root)}q=u(B,q,C!=t,U.getId());B!=n&&B.container.parentNode.removeChild(B.container)}}else q=u(n);if(null==q||null==q.wnd)this.handleError({message:mxResources.get("errorUpdatingPreview")});else{q.mathEnabled&&(u=q.wnd.document,c||(q.wnd.IMMEDIATE_PRINT=!0),u.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>'));q.closeDocument();if(Editor.expandPatternsForPrint&&null!=q.wnd)for(u=q.wnd.document.getElementsByTagName("svg"),C=0;C<u.length;C++)Editor.expandSvgPatterns(u[C]);Graph.rewritePageLinks(q.wnd.document,!0);q.mathEnabled||c||PrintDialog.printPreview(q)}return q}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var f=null,k=0;k<c.length;k++)mxEvent.addListener(c[k],"dragleave",function(n){null!=f&&(f.parentNode.removeChild(f),f=null);n.stopPropagation();n.preventDefault()}),mxEvent.addListener(c[k],"dragover",mxUtils.bind(this,function(n){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==f&&(f=this.highlightElement());n.stopPropagation();n.preventDefault()})),mxEvent.addListener(c[k],"drop",mxUtils.bind(this,function(n){null!=f&&(f.parentNode.removeChild(f),f=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<n.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(n.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(n)&&!mxEvent.isShiftDown(n)):this.openFiles(n.dataTransfer.files,!0);else{var q=this.extractGraphModelFromEvent(n);if(null==q){var t=null!=n.dataTransfer?n.dataTransfer:n.clipboardData;null!=t&&(10==document.documentMode||11==document.documentMode?q=t.getData("Text"):(q=null,q=0<=mxUtils.indexOf(t.types,"text/uri-list")?n.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(t.types,"text/html")?t.getData("text/html"):null,null!=q&&0<q.length?(t=document.createElement("div"),t.innerHTML=Graph.sanitizeHtml(q),t=t.getElementsByTagName("img"),0<t.length&&(q=t[0].getAttribute("src"))):@@ -14238,19 +14242,19 @@ q.wnd)for(u=q.wnd.document.getElementsByTagName("svg"),C=0;C<u.length;C++)Editor413==u.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(q)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(q):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(q)))))}else this.openLocalFile(q,null,!0)}n.stopPropagation();n.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var f=0,k=0;if(null==c){var n=document.body;var q=document.documentElement;if(null==n&&null==q)return null;var t=((null!=n?n.clientWidth:0)||q.clientWidth)-3;n=Math.max(null!=n?n.clientHeight:0,q.clientHeight)-3}else n=c.getBoundingClientRect(),f=n.top,k=n.left,t=n.width,n=n.height;q=document.createElement("div");q.style.zIndex=mxPopupMenu.prototype.zIndex+2;q.style.border="3px dotted rgb(254, 137, 12)";q.style.pointerEvents="none";q.style.position="absolute";q.style.top=f+"px";q.style.left=k+"px";q.style.width=Math.max(0,t-3)+"px";q.style.height=Math.max(0,n-3)+"px";if(null!=c&&c.parentNode==this.editor.graph.container)this.editor.graph.container.appendChild(q);else if(null!=document.body)document.body.appendChild(q);else return null;return q};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);var f=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=f){var k=new mxCodec(f.ownerDocument),n=new mxGraphModel;k.decode(f,n);f=n.getChildAt(n.getRoot(),0);for(k=0;k<n.getChildCount(f);k++)c.push(n.getChildAt(f,k))}return c};-EditorUi.prototype.openFileHandle=function(c,f,k,n,q,t,u){if(null!=f&&0<f.length){if(!Editor.useCanvasForExport&&/(\.png)$/i.test(f)||/(\.pdf)$/i.test(f))f=f.substring(0,f.length-4),/(\.drawio)$/i.test(f)||(f+=".drawio");var y=mxUtils.bind(this,function(I){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".drawio":f+".drawio";if("<mxlibrary"==I.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,n);try{this.loadLibrary(new LocalLibrary(this,-I,f)),this.showSidebar()}catch(C){this.handleError(C,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(I,f,n,null,null,null,u)});if(EditorUi.isVisioFilename(f))this.importVisio(k,mxUtils.bind(this,function(I){this.spinner.stop();y(I)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(I){this.spinner.stop();y(I)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,f))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),-mxResources.get("notInOffline"))):this.parseFile(k,mxUtils.bind(this,function(I){4==I.readyState&&(this.spinner.stop(),200<=I.status&&299>=I.status?y(I.responseText):this.handleError({message:mxResources.get(413==I.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(I){this.spinner.stop();this.openLocalFile(I,f,n,+EditorUi.prototype.openFileHandle=function(c,f,k,n,q,t,u){if(null!=f&&0<f.length){if(!Editor.useCanvasForExport&&/(\.png)$/i.test(f)||/(\.pdf)$/i.test(f))f=f.substring(0,f.length-4),/(\.drawio)$/i.test(f)||(f+=".drawio");var B=mxUtils.bind(this,function(I){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".drawio":f+".drawio";if("<mxlibrary"==I.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,n);try{this.loadLibrary(new LocalLibrary(this,+I,f)),this.showSidebar()}catch(C){this.handleError(C,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(I,f,n,null,null,null,u)});if(EditorUi.isVisioFilename(f))this.importVisio(k,mxUtils.bind(this,function(I){this.spinner.stop();B(I)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(I){this.spinner.stop();B(I)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,f))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),+mxResources.get("notInOffline"))):this.parseFile(k,mxUtils.bind(this,function(I){4==I.readyState&&(this.spinner.stop(),200<=I.status&&299>=I.status?B(I.responseText):this.handleError({message:mxResources.get(413==I.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(I){this.spinner.stop();this.openLocalFile(I,f,n,null,null,null,u)}),mxUtils.bind(this,function(I){this.spinner.stop();this.handleError(I)}));else if("<mxlibrary"==c.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,n);try{this.loadLibrary(new LocalLibrary(this,c,k.name)),this.showSidebar()}catch(I){this.handleError(I,mxResources.get("errorLoadingFile"))}}else if(0==c.indexOf("PK"))this.importZipFile(k,mxUtils.bind(this,function(I){this.spinner.stop();-y(I)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,f,n,null,null,null,u)}));else{if("image/png"==k.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==k.type){var E=Editor.extractGraphModelFromPdf(c);null!=E&&(q=null,n=!0,c=E)}this.spinner.stop();this.openLocalFile(c,f,n,q,null!=q?k:null,t,u)}}};EditorUi.prototype.openFiles=function(c,f,k){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=0;n<c.length;n++)mxUtils.bind(this,-function(q){var t=new FileReader;t.onload=mxUtils.bind(this,function(u){try{this.openFileHandle(u.target.result,q.name,q,f,null,null,k)}catch(y){this.handleError(y)}});t.onerror=mxUtils.bind(this,function(u){this.spinner.stop();this.handleError(u);window.openFile=null});"image"!==q.type.substring(0,5)&&"application/pdf"!==q.type||"image/svg"===q.type.substring(0,9)?t.readAsText(q):t.readAsDataURL(q)})(c[n])};EditorUi.prototype.openLocalFile=function(c,f,k,n,q,t,u){var y=this.getCurrentFile(),E=mxUtils.bind(this,-function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var C=mxUtils.parseXml(c);null!=C&&(this.editor.setGraphXml(C.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,f||this.defaultFilename,k,n,q,t));null!=u&&u()});if(null!=c&&0<c.length)if(null==y||!y.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=n||this.isDiagramEmpty()))E();else if((mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=y&&y.isModified())this.confirm(mxResources.get("allChangesLost"),-null,E,mxResources.get("cancel"),mxResources.get("discardChanges"));else{window.openFile=new OpenFile(function(){window.openFile=null});window.openFile.setData(c,f,k);var I=mxUtils.bind(this,function(){null!=y&&y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,E,mxResources.get("cancel"),mxResources.get("discardChanges")):E()});"1"==urlParams.openInSameWin||navigator.standalone?I():this.showDialog((new PopupDialog(this,this.getUrl(),null,I)).container,340,140,!0,!0)}else throw Error(mxResources.get("notADiagramFile"));-};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)this.updatePageRoot(this.pages[f]),this.addBasenamesForCell(this.pages[f].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);f=[];for(var k in c)f.push(k);return f};EditorUi.prototype.addBasenamesForCell=function(c,f){function k(u){if(null!=u){var y=u.lastIndexOf(".");0<y&&(u=u.substring(y+1,u.length));null==f[u]&&(f[u]=!0)}}var n=this.editor.graph,q=n.getCellStyle(c);+B(I)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,f,n,null,null,null,u)}));else{if("image/png"==k.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==k.type){var E=Editor.extractGraphModelFromPdf(c);null!=E&&(q=null,n=!0,c=E)}this.spinner.stop();this.openLocalFile(c,f,n,q,null!=q?k:null,t,u)}}};EditorUi.prototype.openFiles=function(c,f,k){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=0;n<c.length;n++)mxUtils.bind(this,+function(q){var t=new FileReader;t.onload=mxUtils.bind(this,function(u){try{this.openFileHandle(u.target.result,q.name,q,f,null,null,k)}catch(B){this.handleError(B)}});t.onerror=mxUtils.bind(this,function(u){this.spinner.stop();this.handleError(u);window.openFile=null});"image"!==q.type.substring(0,5)&&"application/pdf"!==q.type||"image/svg"===q.type.substring(0,9)?t.readAsText(q):t.readAsDataURL(q)})(c[n])};EditorUi.prototype.openLocalFile=function(c,f,k,n,q,t,u){var B=this.getCurrentFile(),E=mxUtils.bind(this,+function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var C=mxUtils.parseXml(c);null!=C&&(this.editor.setGraphXml(C.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,f||this.defaultFilename,k,n,q,t));null!=u&&u()});if(null!=c&&0<c.length)if(null==B||!B.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=n||this.isDiagramEmpty()))E();else if((mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=B&&B.isModified())this.confirm(mxResources.get("allChangesLost"),+null,E,mxResources.get("cancel"),mxResources.get("discardChanges"));else{window.openFile=new OpenFile(function(){window.openFile=null});window.openFile.setData(c,f,k);var I=mxUtils.bind(this,function(){null!=B&&B.isModified()?this.confirm(mxResources.get("allChangesLost"),null,E,mxResources.get("cancel"),mxResources.get("discardChanges")):E()});"1"==urlParams.openInSameWin||navigator.standalone?I():this.showDialog((new PopupDialog(this,this.getUrl(),null,I)).container,340,140,!0,!0)}else throw Error(mxResources.get("notADiagramFile"));+};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)this.updatePageRoot(this.pages[f]),this.addBasenamesForCell(this.pages[f].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);f=[];for(var k in c)f.push(k);return f};EditorUi.prototype.addBasenamesForCell=function(c,f){function k(u){if(null!=u){var B=u.lastIndexOf(".");0<B&&(u=u.substring(B+1,u.length));null==f[u]&&(f[u]=!0)}}var n=this.editor.graph,q=n.getCellStyle(c);k(mxStencilRegistry.getBasenameForStencil(q[mxConstants.STYLE_SHAPE]));n.model.isEdge(c)&&(k(mxMarker.getPackageForType(q[mxConstants.STYLE_STARTARROW])),k(mxMarker.getPackageForType(q[mxConstants.STYLE_ENDARROW])));q=n.model.getChildCount(c);for(var t=0;t<q;t++)this.addBasenamesForCell(n.model.getChildAt(c,t),f)};EditorUi.prototype.setGraphEnabled=function(c){this.diagramContainer.style.visibility=c?"":"hidden";this.formatContainer.style.visibility=this.diagramContainer.style.visibility;this.sidebarContainer.style.display=c?"":"none";this.hsplit.style.display=this.sidebarContainer.style.display;this.editor.graph.setEnabled(c);null!=this.tabContainer&&(this.tabContainer.style.visibility=this.diagramContainer.style.visibility);c||this.hideWindows();this.editor.graph.sizeDidChange();this.resetScrollbars()};EditorUi.prototype.fitInitialView=function(c){var f=this.editor.graph,k=this.currentPage;k=null!=k?k.getViewBox():null;var n=f.container;if(null!=k&&0<n.clientWidth&&0<n.clientHeight){c=n.clientWidth;var q=n.clientHeight,t=Math.min(c/k.width,q/k.height);f.zoomTo(null!=k.scale?Math.min(k.scale,t):t,null,null,mxUtils.hasScrollbars(n));mxUtils.hasScrollbars(n)&&(t=f.view.translate,f=f.view.scale,n.scrollLeft=(k.x+k.width/2+t.x)*f-c/2,n.scrollTop=(k.y+k.height/2+t.y)*f-q/2)}else this.initialFitDiagram(c)};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((this.embedMessageSource||window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))){var c=-!1;this.installMessageHandler(mxUtils.bind(this,function(f,k,n,q){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);Editor.fitDiagramOnLoad&&this.fitInitialView();if(q)try{var t=this.editor.graph;t.setGridEnabled(!1);t.pageVisible=!1;var u=t.model.cells,y;for(y in u){var E=u[y];null!=E&&null!=E.style&&(E.style+=";sketch=1;"+(-1==E.style.indexOf("fontFamily=")||+!1;this.installMessageHandler(mxUtils.bind(this,function(f,k,n,q){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);Editor.fitDiagramOnLoad&&this.fitInitialView();if(q)try{var t=this.editor.graph;t.setGridEnabled(!1);t.pageVisible=!1;var u=t.model.cells,B;for(B in u){var E=u[B];null!=E&&null!=E.style&&(E.style+=";sketch=1;"+(-1==E.style.indexOf("fontFamily=")||-1<E.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(I){console.log(I)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=n?n:!1;this.updateUi();window.self===window.top||this.noAutoFocus||window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(c,f){null!=c?this.spinner.spin(document.body,mxResources.get("loading"))&&c.getPublicUrl(mxUtils.bind(this,function(k){this.spinner.stop();f(k)})):f(null)};EditorUi.prototype.createLoadMessage=function(c){var f=this.editor.graph,k=f.getGraphBounds(),n=f.view.scale,q=f.view.translate;return{event:c,pageVisible:f.pageVisible,translate:q,bounds:k,currentPage:this.getSelectedPageIndex(),scale:n,page:f.view.getBackgroundPageBounds(),modelBounds:{x:k.x/n-q.x,y:k.y/n-q.y,width:k.width/n,height:k.height/n},containerSize:{width:f.container.clientWidth,height:f.container.clientHeight,offsetWidth:f.container.offsetWidth,offsetHeight:f.container.offsetHeight}}};EditorUi.prototype.sendEmbeddedSvgExport=@@ -14258,57 +14262,57 @@ function(c){try{var f=this.editor.graph;f.isEditing()&&f.stopEditing(!f.isInvoke"*")}),null,null,!0,n,1,this.embedExportBorder,null,this.embedExportTheme)}else c||k.postMessage(JSON.stringify({event:"exit",point:this.embedExitPoint}),"*");c||(this.diagramContainer.removeAttribute("data-bounds"),Editor.inlineFullscreen=!1,f.model.clear(),this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(q){c||this.handleError(q)}};EditorUi.prototype.whenScriptReady=function(c,f,k){if(c())f();else var n=0,q=window.setInterval(function(){c()?(window.clearInterval(q),f()):100<=++n&&(window.clearInterval(q),null!=k&&k())},100)};EditorUi.prototype.lastLayoutSpec=null;EditorUi.prototype.resolveLayoutList=function(c){if("string"===typeof c){c=mxUtils.trim(c);if("["==c.charAt(0))return JSON.parse(c);if("undefined"===typeof LibavoidRouting||c!==LibavoidRouting.SHORTHAND&&c!==LibavoidRouting.LAYOUT_NAME){if("parallels"===c)return[{layout:"mxParallelEdgeLayout",config:{checkOverlap:!0}}];if("undefined"!==typeof ElkLayout&&null!=ElkLayout.MENU_PRESETS&&null!=ElkLayout.MENU_PRESETS[c]){c=ElkLayout.MENU_PRESETS[c];var f="layered"===c.algorithm?ElkLayout.CANONICAL_EDGE:{corners:(ElkLayout.CANONICAL_EDGE||{}).corners};return[{layout:Graph.elkLayoutNameForAlgorithm(c.algorithm),config:Graph.elkOptionsToConfig(c.options,f)}]}}else return[{layout:LibavoidRouting.LAYOUT_NAME}];return null}return"object"===typeof c?c:null};EditorUi.prototype.getSelectedLayoutContainer=function(){var c=this.editor.graph,-f=1==c.getSelectionCount()?c.getSelectionCell():null;return null!=f&&c.model.isVertex(f)&&(c=c.getCellStyle(f).childLayout,null!=c&&"tableLayout"!=c&&"stackLayout"!=c&&"rack"!=c)?f:null};EditorUi.prototype.setContainerChildLayout=function(c,f){var k=this.editor.graph,n=f,q=null,t=null;if("string"!==typeof f){if(!Array.isArray(f)||0==f.length)throw Error("Invalid layout list: "+JSON.stringify(f));n=[];for(var u=0;u<f.length;u++){var y=f[u];if(null!=y&&("mxRadialTreeLayout"==y.layout||"mxOrgChartLayout"==-y.layout||"mxFastOrganicLayout"==y.layout||"mxCircleLayout"==y.layout))throw Error("Not supported as childLayout: "+y.layout);if(null!=y&&null!=Graph.elkLayoutAlgorithms[y.layout]){var E={},I;for(I in y.config)E[I]=y.config[I];delete E.rootCellIds;null==E.resizeNodes&&(E.resizeNodes=!1);null==E.resizeLayoutRoot&&(E.resizeLayoutRoot=!0);"elkLayered"==y.layout&&null==E.extractIsolated&&(E.extractIsolated=!1);null!=E.corners&&(t=E.corners);if(null!=E.groupPadding&&(q=String(E.groupPadding),/[;=]/.test(q)))throw Error("Invalid groupPadding: "+-q);y={layout:y.layout,config:E}}n.push(y)}k.createLayouts(n);n=Graph.encodeChildLayout(n)}if(0<=n.indexOf(";"))throw Error("Invalid childLayout: "+n);k.model.beginUpdate();try{var C=k.model.getStyle(c);k.setCellStyles("childLayout",n,[c]);null!=q&&k.setCellStyles("groupPadding",q,[c]);null!=t&&"undefined"!==typeof ElkLayout&&"function"===typeof ElkLayout.applyCorners&&ElkLayout.applyCorners(k,c,t);k.model.getStyle(c)==C&&null!=k.layoutManager&&k.layoutManager.executeLayout(c,!1)}finally{k.model.endUpdate()}};+f=1==c.getSelectionCount()?c.getSelectionCell():null;return null!=f&&c.model.isVertex(f)&&(c=c.getCellStyle(f).childLayout,null!=c&&"tableLayout"!=c&&"stackLayout"!=c&&"rack"!=c)?f:null};EditorUi.prototype.setContainerChildLayout=function(c,f){var k=this.editor.graph,n=f,q=null,t=null;if("string"!==typeof f){if(!Array.isArray(f)||0==f.length)throw Error("Invalid layout list: "+JSON.stringify(f));n=[];for(var u=0;u<f.length;u++){var B=f[u];if(null!=B&&("mxRadialTreeLayout"==B.layout||"mxOrgChartLayout"==+B.layout||"mxFastOrganicLayout"==B.layout||"mxCircleLayout"==B.layout))throw Error("Not supported as childLayout: "+B.layout);if(null!=B&&null!=Graph.elkLayoutAlgorithms[B.layout]){var E={},I;for(I in B.config)E[I]=B.config[I];delete E.rootCellIds;null==E.resizeNodes&&(E.resizeNodes=!1);null==E.resizeLayoutRoot&&(E.resizeLayoutRoot=!0);"elkLayered"==B.layout&&null==E.extractIsolated&&(E.extractIsolated=!1);null!=E.corners&&(t=E.corners);if(null!=E.groupPadding&&(q=String(E.groupPadding),/[;=]/.test(q)))throw Error("Invalid groupPadding: "++q);B={layout:B.layout,config:E}}n.push(B)}k.createLayouts(n);n=Graph.encodeChildLayout(n)}if(0<=n.indexOf(";"))throw Error("Invalid childLayout: "+n);k.model.beginUpdate();try{var C=k.model.getStyle(c);k.setCellStyles("childLayout",n,[c]);null!=q&&k.setCellStyles("groupPadding",q,[c]);null!=t&&"undefined"!==typeof ElkLayout&&"function"===typeof ElkLayout.applyCorners&&ElkLayout.applyCorners(k,c,t);k.model.getStyle(c)==C&&null!=k.layoutManager&&k.layoutManager.executeLayout(c,!1)}finally{k.model.endUpdate()}};EditorUi.prototype.executeLayoutSpec=function(c,f,k){var n=this;this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout&&null!=ElkLayout.MENU_PRESETS},function(){try{var q=n.resolveLayoutList(c);if(null!=q){n.lastLayoutSpec=q;var t=k?n.getSelectedLayoutContainer():null;null!=t&&Array.isArray(q)&&0<q.length?(n.setContainerChildLayout(t,q),null!=f&&f()):n.executeLayouts(n.editor.graph.createLayouts(q),f)}else n.handleError(Error("Unknown layout: "+c))}catch(u){n.handleError(u)}},function(){n.handleError(Error(mxResources.get("serviceUnavailableOrBlocked")))})};EditorUi.prototype.installPassThroughKeys=function(){null!=Editor.passThroughKeys&&null==this.passThroughKeysListener&&(this.passThroughKeysListener=mxUtils.bind(this,function(c){for(var f=Editor.passThroughKeys,k=c.ctrlKey||c.metaKey,n=null!=c.key?c.key.toLowerCase():"",q=0;q<f.length;q++){var t=f[q];if(n===String(t.key).toLowerCase()&&k===!!t.ctrl&&c.shiftKey===!!t.shift&&c.altKey===!!t.alt){c.preventDefault();c.stopImmediatePropagation();null!=t.command&&(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"shortcut",command:t.command}),"*");break}}}),window.addEventListener("keydown",this.passThroughKeysListener,!0))};EditorUi.keyNames={8:"Backspace",9:"Tab",13:"Enter",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",109:"-",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",187:"+",189:"-"};EditorUi.prototype.installKeyboardShortcuts=function(){if(null!=Editor.keyboardShortcuts)for(var c=0;c<Editor.keyboardShortcuts.length;c++)this.installKeyboardShortcut(Editor.keyboardShortcuts[c])};EditorUi.prototype.installKeyboardShortcut=function(c){var f="string"===typeof c.keyCode&&1==c.keyCode.length,k=f?c.keyCode.toUpperCase().charCodeAt(0):parseInt(c.keyCode);if(isNaN(k))EditorUi.debug("Configuration Error: Invalid keyCode for keyboardShortcuts",c);else{if(c.alt){var n=c.control?c.shift?this.ctrlAltShiftActions:this.ctrlAltActions:c.shift?this.altShiftActions:this.altActions;null!=c.action?n[k]=c.action:delete n[k]}else null!=c.action?(n=mxUtils.bind(this,function(){var q=this.actions.get(c.action);null!=q&&q.isEnabled()&&q.funct.apply(this,arguments)}),c.control?c.shift?this.keyHandler.bindControlShiftKey(k,n):this.keyHandler.bindControlKey(k,n):c.shift?this.keyHandler.bindShiftKey(k,n):this.keyHandler.bindKey(k,n)):delete (c.control?c.shift?this.keyHandler.controlShiftKeys:this.keyHandler.controlKeys:c.shift?this.keyHandler.shiftKeys:this.keyHandler.normalKeys)[k];null!=c.action&&(n=this.actions.get(c.action),f=f?c.keyCode.toUpperCase():48<=k&&57>=k||65<=k&&90>=k?String.fromCharCode(k):EditorUi.keyNames[k],null!=n&&null!=f&&(n.shortcut=(c.control?Editor.ctrlKey+"+":"")+(c.alt?Editor.altKey+"+":"")+(c.shift?Editor.shiftKey+"+":"")+f))}};EditorUi.prototype.installMessageHandler=function(c){var f=null,k=!1,n=!1,q=null,t=null;this.installPassThroughKeys();var u=mxUtils.bind(this,function(I,C){this.editor.modified&&"0"!=urlParams.modified?-null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,u);mxEvent.addListener(window,"message",mxUtils.bind(this,function(I){if(I.source==(this.embedMessageSource||window.opener||window.parent)){var C=I.data,U=null,J=null,S=mxUtils.bind(this,function(da){if(null!=da&&"function"===typeof da.charAt&&"<"!=da.charAt(0))try{Editor.isPngDataUrl(da)?-da=Editor.extractGraphModelFromPng(da):"data:image/svg+xml;base64,"==da.substring(0,26)?da=atob(da.substring(26)):"data:image/svg+xml;utf8,"==da.substring(0,24)&&(da=da.substring(24)),null!=da&&(""==da.trim()?da=null:"%"==da.charAt(0)?da=decodeURIComponent(da):"<"!=da.charAt(0)&&(da=Graph.decompress(da)))}catch(ja){}return da});if("json"==urlParams.proto){var N=!1;try{C=JSON.parse(C),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[I],"data",[C])}catch(da){C=null}try{var R=C;if(null==+null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,u);mxEvent.addListener(window,"message",mxUtils.bind(this,function(I){if(I.source==(this.embedMessageSource||window.opener||window.parent)){var C=I.data,U=null,K=null,S=mxUtils.bind(this,function(da){if(null!=da&&"function"===typeof da.charAt&&"<"!=da.charAt(0))try{Editor.isPngDataUrl(da)?+da=Editor.extractGraphModelFromPng(da):"data:image/svg+xml;base64,"==da.substring(0,26)?da=atob(da.substring(26)):"data:image/svg+xml;utf8,"==da.substring(0,24)&&(da=da.substring(24)),null!=da&&(""==da.trim()?da=null:"%"==da.charAt(0)?da=decodeURIComponent(da):"<"!=da.charAt(0)&&(da=Graph.decompress(da)))}catch(ja){}return da});if("json"==urlParams.proto){var M=!1;try{C=JSON.parse(C),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[I],"data",[C])}catch(da){C=null}try{var R=C;if(null==C)return;if("dialog"==C.action){this.showError(null!=C.titleKey?mxResources.get(C.titleKey):C.title,null!=C.messageKey?mxResources.get(C.messageKey):mxUtils.htmlEntities(C.message),null!=C.buttonKey?mxResources.get(C.buttonKey):C.button);null!=C.modified&&(this.editor.modified=C.modified);return}if("layout"==C.action){this.executeLayoutSpec(C.layouts);return}if("prompt"==C.action){this.spinner.stop();var T=new FilenameDialog(this,C.defaultValue||"",null!=C.okKey?mxResources.get(C.okKey):C.ok,function(da){null!=-da?y.postMessage(JSON.stringify({event:"prompt",value:da,message:C}),"*"):y.postMessage(JSON.stringify({event:"prompt-cancel",message:C}),"*")},null!=C.titleKey?mxResources.get(C.titleKey):C.title,null,null,null,null,function(){y.postMessage(JSON.stringify({event:"prompt-cancel",message:C}),"*")});this.showDialog(T.container,300,80,!0,!1);T.init();return}if("draft"==C.action){var v=S(C.xml);this.spinner.stop();T=new DraftDialog(this,mxResources.get("draftFound",[C.name||this.defaultFilename]),v,mxUtils.bind(this,-function(){this.hideDialog();y.postMessage(JSON.stringify({event:"draft",result:"edit",message:C}),"*")}),mxUtils.bind(this,function(){this.hideDialog();y.postMessage(JSON.stringify({event:"draft",result:"discard",message:C}),"*")}),C.editKey?mxResources.get(C.editKey):null,C.discardKey?mxResources.get(C.discardKey):null,C.ignore?mxUtils.bind(this,function(){this.hideDialog();y.postMessage(JSON.stringify({event:"draft",result:"ignore",message:C}),"*")}):null);this.showDialog(T.container,640,480,!0,-!1,mxUtils.bind(this,function(da){da&&this.actions.get("exit").funct()}));try{T.init()}catch(da){y.postMessage(JSON.stringify({event:"draft",error:da.toString(),message:C}),"*")}return}if("template"==C.action){this.spinner.stop();var d=1==C.enableRecent,m=1==C.enableSearch,r=1==C.enableCustomTemp;T=new NewDialog(this,!1,C.templatesOnly?!1:null!=C.callback,mxUtils.bind(this,function(da,ja,ta,va){da=da||this.emptyDiagramXml;null!=C.callback?y.postMessage(JSON.stringify({event:"template",xml:da,blank:da==-this.emptyDiagramXml,name:ja,tempUrl:ta,libs:va,builtIn:!0,message:C}),"*"):(c(da,I,da!=this.emptyDiagramXml,C.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,d?mxUtils.bind(this,function(da){this.remoteInvoke("getRecentDiagrams",[null],null,da,function(){da(null,"Network Error!")})}):null,m?mxUtils.bind(this,function(da,ja){this.remoteInvoke("searchDiagrams",[da,null],null,ja,function(){ja(null,"Network Error!")})}):null,mxUtils.bind(this,function(da,ja,ta){y.postMessage(JSON.stringify({event:"template",-docUrl:da,info:ja,name:ta}),"*")}),null,null,r?mxUtils.bind(this,function(da){this.remoteInvoke("getCustomTemplates",null,null,da,function(){da({},0)})}):null,1==C.withoutType,null,C.templatesOnly);this.showDialog(T.container,620,460,!0,!1,mxUtils.bind(this,function(da){null!=this.sidebar&&this.sidebar.hideTooltip();da&&!C.noExitOnCancel&&this.actions.get("exit").funct()}));T.init();return}if("textContent"==C.action){var A=this.getDiagramTextContent();y.postMessage(JSON.stringify({event:"textContent",-data:A,message:C}),"*");return}if("status"==C.action){this.updateStatus(mxUtils.bind(this,function(){null!=C.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(C.messageKey))):null!=C.message&&this.editor.setStatus(mxUtils.htmlEntities(C.message))}));null!=C.modified&&(this.editor.modified=C.modified);return}if("spinner"==C.action){var D=null!=C.messageKey?mxResources.get(C.messageKey):C.message;null==C.show||C.show?this.spinner.spin(document.body,D):this.spinner.stop();return}if("exit"==-C.action){this.actions.get("exit").funct();return}if("viewport"==C.action){if(null!=C.viewport){var G=this.editor.graph,O=G.view.translate.x,P=G.view.translate.y;this.embedViewport=C.viewport;G.refresh();this.diagramContainer.scrollTop-=(P-G.view.translate.y)*G.view.scale;this.diagramContainer.scrollLeft-=(O-G.view.translate.x)*G.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==C.action){var V=this.actions.get(C.actionName);null!=V&&V.funct();return}if("resetEditor"==-C.action){G=this.editor.graph;G.isEditing()&&G.stopEditing(!1);this.hideCurrentMenu();G.popupMenuHandler.hideMenu();G.clearSelection();return}if("fit"==C.action){G=this.editor.graph;var Y=G.maxFitScale;G.maxFitScale=null!=C.maxScale?C.maxScale:1;G.fit(null!=C.border?C.border:16,null,null,null,null,!0);G.maxFitScale=Y;D=this.createLoadMessage("fit");D.message=C;y.postMessage(JSON.stringify(D),"*");return}if("fullscreenChanged"==C.action){var H=null;try{var W=this.diagramContainer.getAttribute("data-scrollState");+da?B.postMessage(JSON.stringify({event:"prompt",value:da,message:C}),"*"):B.postMessage(JSON.stringify({event:"prompt-cancel",message:C}),"*")},null!=C.titleKey?mxResources.get(C.titleKey):C.title,null,null,null,null,function(){B.postMessage(JSON.stringify({event:"prompt-cancel",message:C}),"*")});this.showDialog(T.container,300,80,!0,!1);T.init();return}if("draft"==C.action){var v=S(C.xml);this.spinner.stop();T=new DraftDialog(this,mxResources.get("draftFound",[C.name||this.defaultFilename]),v,mxUtils.bind(this,+function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"edit",message:C}),"*")}),mxUtils.bind(this,function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"discard",message:C}),"*")}),C.editKey?mxResources.get(C.editKey):null,C.discardKey?mxResources.get(C.discardKey):null,C.ignore?mxUtils.bind(this,function(){this.hideDialog();B.postMessage(JSON.stringify({event:"draft",result:"ignore",message:C}),"*")}):null);this.showDialog(T.container,640,480,!0,+!1,mxUtils.bind(this,function(da){da&&this.actions.get("exit").funct()}));try{T.init()}catch(da){B.postMessage(JSON.stringify({event:"draft",error:da.toString(),message:C}),"*")}return}if("template"==C.action){this.spinner.stop();var d=1==C.enableRecent,m=1==C.enableSearch,r=1==C.enableCustomTemp;T=new NewDialog(this,!1,C.templatesOnly?!1:null!=C.callback,mxUtils.bind(this,function(da,ja,ta,va){da=da||this.emptyDiagramXml;null!=C.callback?B.postMessage(JSON.stringify({event:"template",xml:da,blank:da==+this.emptyDiagramXml,name:ja,tempUrl:ta,libs:va,builtIn:!0,message:C}),"*"):(c(da,I,da!=this.emptyDiagramXml,C.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,d?mxUtils.bind(this,function(da){this.remoteInvoke("getRecentDiagrams",[null],null,da,function(){da(null,"Network Error!")})}):null,m?mxUtils.bind(this,function(da,ja){this.remoteInvoke("searchDiagrams",[da,null],null,ja,function(){ja(null,"Network Error!")})}):null,mxUtils.bind(this,function(da,ja,ta){B.postMessage(JSON.stringify({event:"template",+docUrl:da,info:ja,name:ta}),"*")}),null,null,r?mxUtils.bind(this,function(da){this.remoteInvoke("getCustomTemplates",null,null,da,function(){da({},0)})}):null,1==C.withoutType,null,C.templatesOnly);this.showDialog(T.container,620,460,!0,!1,mxUtils.bind(this,function(da){null!=this.sidebar&&this.sidebar.hideTooltip();da&&!C.noExitOnCancel&&this.actions.get("exit").funct()}));T.init();return}if("textContent"==C.action){var z=this.getDiagramTextContent();B.postMessage(JSON.stringify({event:"textContent",+data:z,message:C}),"*");return}if("status"==C.action){this.updateStatus(mxUtils.bind(this,function(){null!=C.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(C.messageKey))):null!=C.message&&this.editor.setStatus(mxUtils.htmlEntities(C.message))}));null!=C.modified&&(this.editor.modified=C.modified);return}if("spinner"==C.action){var D=null!=C.messageKey?mxResources.get(C.messageKey):C.message;null==C.show||C.show?this.spinner.spin(document.body,D):this.spinner.stop();return}if("exit"==+C.action){this.actions.get("exit").funct();return}if("viewport"==C.action){if(null!=C.viewport){var F=this.editor.graph,N=F.view.translate.x,P=F.view.translate.y;this.embedViewport=C.viewport;F.refresh();this.diagramContainer.scrollTop-=(P-F.view.translate.y)*F.view.scale;this.diagramContainer.scrollLeft-=(N-F.view.translate.x)*F.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==C.action){var V=this.actions.get(C.actionName);null!=V&&V.funct();return}if("resetEditor"==+C.action){F=this.editor.graph;F.isEditing()&&F.stopEditing(!1);this.hideCurrentMenu();F.popupMenuHandler.hideMenu();F.clearSelection();return}if("fit"==C.action){F=this.editor.graph;var X=F.maxFitScale;F.maxFitScale=null!=C.maxScale?C.maxScale:1;F.fit(null!=C.border?C.border:16,null,null,null,null,!0);F.maxFitScale=X;D=this.createLoadMessage("fit");D.message=C;B.postMessage(JSON.stringify(D),"*");return}if("fullscreenChanged"==C.action){var H=null;try{var W=this.diagramContainer.getAttribute("data-scrollState");null!=W&&(this.diagramContainer.removeAttribute("data-scrollState"),H=JSON.parse(W))}catch(da){}Editor.inlineFullscreen=C.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=H&&this.restoreScrollState(H);return}if("snapshot"==C.action){this.sendEmbeddedSvgExport(!0);return}if("export"==C.action){if("png"==C.format||"xmlpng"==C.format){if(null==C.spin&&null==C.spinKey||this.spinner.spin(document.body,null!=C.spinKey?mxResources.get(C.spinKey):C.spin)){var Z=null!=C.xml?C.xml:this.getFileData(!0);-this.editor.graph.setEnabled(!1);G=this.editor.graph;var X=mxUtils.bind(this,function(da,ja){if(C.withSvg)C.withSvg=!1,this.getEmbeddedSvg(Z,this.editor.graph,null,!0,function(va){X(da,va)},null,null,C.embedImages,this.editor.graph.background,C.scale,C.border,C.shadow,"auto",null,C.embedFonts);else{this.editor.graph.setEnabled(!0);this.spinner.stop();var ta=this.createLoadMessage("export");ta.format=C.format;ta.message=R;ta.data=da;ta.svg=ja;ta.xml=Z;y.postMessage(JSON.stringify(ta),"*")}}),ba=mxUtils.bind(this,-function(da){null==da&&(da=Editor.blankImage);"xmlpng"==C.format&&(da=Editor.writeGraphModelToPng(da,"tEXt","mxfile",encodeURIComponent(Z)));G!=this.editor.graph&&G.container.parentNode.removeChild(G.container);X(da)}),ea=C.pageId||(null!=this.pages?C.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var aa=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=ea){var da=G.getGlobalVariable;G=this.createTemporaryGraph(G.getStylesheet());-for(var ja,ta=0;ta<this.pages.length;ta++)if(this.pages[ta].getId()==ea){ja=this.updatePageRoot(this.pages[ta]);break}null==ja&&(ja=this.currentPage);G.getGlobalVariable=function(Ja){return"page"==Ja?ja.getName():"pagenumber"==Ja?1:da.apply(this,arguments)};document.body.appendChild(G.container);G.model.setRoot(ja.root)}if(null!=C.layerIds){var va=G.model,Ca=va.getChildCells(va.getRoot()),Ha={};for(ta=0;ta<C.layerIds.length;ta++)Ha[C.layerIds[ta]]=!0;for(ta=0;ta<Ca.length;ta++)va.setVisible(Ca[ta],-Ha[Ca[ta].id]||!1)}ta=null;C.keepTheme&&(ta=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(Ja){ba(Ja.toDataURL("image/png"))}),C.width,null,C.background,mxUtils.bind(this,function(){ba(null)}),null,null,C.scale,C.transparent,C.shadow,null,G,C.border,null,C.grid,ta,C.size)});null!=C.xml&&0<C.xml.length&&(k=!0,this.setFileData(Z),k=!1);aa()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==C.format?"1":"0")+(null!=ea?"&pageId="+ea:"")+(null!=-C.layerIds&&0<C.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:C.layerIds})):"")+(null!=C.scale?"&scale="+C.scale:"")+"&base64=1&xml="+encodeURIComponent(Z))).send(mxUtils.bind(this,function(da){200<=da.getStatus()&&299>=da.getStatus()?X("data:image/png;base64,"+da.getText()):ba(null)}),mxUtils.bind(this,function(){ba(null)}))}}else if(aa=mxUtils.bind(this,function(){var da=this.createLoadMessage("export");da.message=C;if("html2"==C.format||"html"==C.format&&("0"!=urlParams.pages||-null!=this.pages&&1<this.pages.length)){var ja=this.getXmlFileData();da.xml=mxUtils.getXml(ja);da.data=this.getFileData(null,null,!0,null,null,null,ja);da.format=C.format}else if("html"==C.format)ja=this.editor.getGraphXml(),da.data=this.getHtml(ja,this.editor.graph),da.xml=mxUtils.getXml(ja),da.format=C.format;else{if("xml"==C.format)da.xml=this.getFileData(!0),da.format=C.format,y.postMessage(JSON.stringify(da),"*");else if("json"==C.format)da.format=C.format,da.data=this.createJsonForExport(0!=-C.allPages,1==C.includeData,1==C.compressed,1==C.selection),y.postMessage(JSON.stringify(da),"*");else{mxSvgCanvas2D.prototype.foAltText=null;ja=null!=C.background?C.background:this.editor.graph.background;ja==mxConstants.NONE&&(ja=null);da.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);da.format="svg";var ta=mxUtils.bind(this,function(Ha){this.editor.graph.setEnabled(!0);this.spinner.stop();da.data=C.asText?Ha:Editor.createSvgDataUri(Ha);y.postMessage(JSON.stringify(da),"*")}),+this.editor.graph.setEnabled(!1);F=this.editor.graph;var Y=mxUtils.bind(this,function(da,ja){if(C.withSvg)C.withSvg=!1,this.getEmbeddedSvg(Z,this.editor.graph,null,!0,function(va){Y(da,va)},null,null,C.embedImages,this.editor.graph.background,C.scale,C.border,C.shadow,"auto",null,C.embedFonts);else{this.editor.graph.setEnabled(!0);this.spinner.stop();var ta=this.createLoadMessage("export");ta.format=C.format;ta.message=R;ta.data=da;ta.svg=ja;ta.xml=Z;B.postMessage(JSON.stringify(ta),"*")}}),ba=mxUtils.bind(this,+function(da){null==da&&(da=Editor.blankImage);"xmlpng"==C.format&&(da=Editor.writeGraphModelToPng(da,"tEXt","mxfile",encodeURIComponent(Z)));F!=this.editor.graph&&F.container.parentNode.removeChild(F.container);Y(da)}),ea=C.pageId||(null!=this.pages?C.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var aa=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=ea){var da=F.getGlobalVariable;F=this.createTemporaryGraph(F.getStylesheet());+for(var ja,ta=0;ta<this.pages.length;ta++)if(this.pages[ta].getId()==ea){ja=this.updatePageRoot(this.pages[ta]);break}null==ja&&(ja=this.currentPage);F.getGlobalVariable=function(Ja){return"page"==Ja?ja.getName():"pagenumber"==Ja?1:da.apply(this,arguments)};document.body.appendChild(F.container);F.model.setRoot(ja.root)}if(null!=C.layerIds){var va=F.model,Ca=va.getChildCells(va.getRoot()),Ha={};for(ta=0;ta<C.layerIds.length;ta++)Ha[C.layerIds[ta]]=!0;for(ta=0;ta<Ca.length;ta++)va.setVisible(Ca[ta],+Ha[Ca[ta].id]||!1)}ta=null;C.keepTheme&&(ta=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(Ja){ba(Ja.toDataURL("image/png"))}),C.width,null,C.background,mxUtils.bind(this,function(){ba(null)}),null,null,C.scale,C.transparent,C.shadow,null,F,C.border,null,C.grid,ta,C.size)});null!=C.xml&&0<C.xml.length&&(k=!0,this.setFileData(Z),k=!1);aa()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==C.format?"1":"0")+(null!=ea?"&pageId="+ea:"")+(null!=+C.layerIds&&0<C.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:C.layerIds})):"")+(null!=C.scale?"&scale="+C.scale:"")+"&base64=1&xml="+encodeURIComponent(Z))).send(mxUtils.bind(this,function(da){200<=da.getStatus()&&299>=da.getStatus()?Y("data:image/png;base64,"+da.getText()):ba(null)}),mxUtils.bind(this,function(){ba(null)}))}}else if(aa=mxUtils.bind(this,function(){var da=this.createLoadMessage("export");da.message=C;if("html2"==C.format||"html"==C.format&&("0"!=urlParams.pages||+null!=this.pages&&1<this.pages.length)){var ja=this.getXmlFileData();da.xml=mxUtils.getXml(ja);da.data=this.getFileData(null,null,!0,null,null,null,ja);da.format=C.format}else if("html"==C.format)ja=this.editor.getGraphXml(),da.data=this.getHtml(ja,this.editor.graph),da.xml=mxUtils.getXml(ja),da.format=C.format;else{if("xml"==C.format)da.xml=this.getFileData(!0),da.format=C.format,B.postMessage(JSON.stringify(da),"*");else if("json"==C.format)da.format=C.format,da.data=this.createJsonForExport(0!=+C.allPages,1==C.includeData,1==C.compressed,1==C.selection),B.postMessage(JSON.stringify(da),"*");else{mxSvgCanvas2D.prototype.foAltText=null;ja=null!=C.background?C.background:this.editor.graph.background;ja==mxConstants.NONE&&(ja=null);da.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);da.format="svg";var ta=mxUtils.bind(this,function(Ha){this.editor.graph.setEnabled(!0);this.spinner.stop();da.data=C.asText?Ha:Editor.createSvgDataUri(Ha);B.postMessage(JSON.stringify(da),"*")}),va="auto";C.keepTheme&&(va=Editor.isDarkMode()?"dark":"light");null!=C.theme&&(va=C.theme);if("xmlsvg"==C.format){if(null==C.spin&&null==C.spinKey||this.spinner.spin(document.body,null!=C.spinKey?mxResources.get(C.spinKey):C.spin)){va=null;if(this.isAutoDarkMode()||Editor.isDarkMode())va="auto";null!=C.theme&&(va=C.theme);this.getEmbeddedSvg(da.xml,this.editor.graph,null,!0,ta,null,null,C.embedImages,ja,C.scale,C.border,C.shadow,va,C.embedCellMetadata,C.embedFonts)}}else if(null==C.spin&&null==C.spinKey||this.spinner.spin(document.body,null!=C.spinKey?mxResources.get(C.spinKey):C.spin)){this.editor.graph.setEnabled(!1);var Ca=C.embedCellMetadata?this.editor.graph.createSvgImageExport(!1,!0):null;ja=this.editor.graph.getSvg(ja,C.scale,C.border,null,null,null,null,Ca,null,this.editor.graph.shadowVisible||C.shadow,null,va);(this.editor.graph.shadowVisible||C.shadow)&&this.editor.graph.addSvgShadow(ja);this.embedFonts(ja,mxUtils.bind(this,function(Ha){C.embedImages||null==C.embedImages?this.editor.convertImages(Ha,-mxUtils.bind(this,function(Ja){ta(mxUtils.getXml(Ja))})):ta(mxUtils.getXml(Ha))}),C.embedFonts)}}return}y.postMessage(JSON.stringify(da),"*")}),null!=C.xml&&0<C.xml.length){if(this.editor.graph.mathEnabled){var ha=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ha.apply(this,arguments);aa()}}k=!0;this.setFileData(C.xml);k=!1;this.editor.graph.mathEnabled||aa()}else aa();return}if("load"==C.action){N=C.toSketch;n=1==C.autosave;this.embedDiffSync=null!=C.diffSync&&!1!==C.diffSync;this.embedDiffSyncPatchOnly=-"object"===typeof C.diffSync&&null!=C.diffSync&&1==C.diffSync.patchOnly;this.embedExportProtocol=1==C.exportProtocol;var na=C.sourceMetadata||null;J=null!=C.layout?C.layout:null;this.hideDialog();null!=C.modified&&null==urlParams.modified&&(urlParams.modified=C.modified);null!=C.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=C.saveAndExit);if("1"==urlParams.saveAndExit||"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,+mxUtils.bind(this,function(Ja){ta(mxUtils.getXml(Ja))})):ta(mxUtils.getXml(Ha))}),C.embedFonts)}}return}B.postMessage(JSON.stringify(da),"*")}),null!=C.xml&&0<C.xml.length){if(this.editor.graph.mathEnabled){var ha=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ha.apply(this,arguments);aa()}}k=!0;this.setFileData(C.xml);k=!1;this.editor.graph.mathEnabled||aa()}else aa();return}if("load"==C.action){M=C.toSketch;n=1==C.autosave;this.embedDiffSync=null!=C.diffSync&&!1!==C.diffSync;this.embedDiffSyncPatchOnly=+"object"===typeof C.diffSync&&null!=C.diffSync&&1==C.diffSync.patchOnly;this.embedExportProtocol=1==C.exportProtocol;var na=C.sourceMetadata||null;K=null!=C.layout?C.layout:null;this.hideDialog();null!=C.modified&&null==urlParams.modified&&(urlParams.modified=C.modified);null!=C.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=C.saveAndExit);if("1"==urlParams.saveAndExit||"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=C.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=C.noSaveBtn);if(null!=C.rough){var ra=Editor.sketchMode;this.doSetSketchMode(C.rough);ra!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=C.dark&&this.setDarkMode(C.dark);null!=C.border&&(this.embedExportBorder=C.border);null!=C.theme&&(this.embedExportTheme=C.theme);null!=C.background&&(this.embedExportBackground=C.background);null!=C.viewport&&(this.embedViewport=C.viewport);this.embedExitPoint=null;if(null!=C.scale){var sa=C.scale,ua=null!=C.scaleBorder?C.scaleBorder:this.embedExportBorder||0,xa=null!=C.border?C.border:0;U=mxUtils.bind(this,function(){var da=this.editor.graph,ja=da.getGraphBounds();if(0<ja.width&&0<ja.height){var ta=da.view.scale;da.view.scaleAndTranslate(sa,da.view.translate.x+xa-ja.x/ta+ua/sa,da.view.translate.y+xa-ja.y/ta+ua/sa)}})}else if(null!=C.fit){var qa=null!=C.border?C.border:0,Aa=C.maxFitScale||1;U=mxUtils.bind(this,function(){var da=this.editor.graph,ja=da.maxFitScale;da.maxFitScale=Aa;da.fit(qa,null,null,null,null,!0);da.maxFitScale=ja})}if(null!=C.scroll&&null!=C.scroll.x&&null!=C.scroll.y){var Ba=C.scroll,Ea=U;U=mxUtils.bind(this,function(){null!=Ea&&Ea();var da=this.editor.graph,ja=da.view.scale,ta=da.view.translate;mxUtils.hasScrollbars(da.container)?(da.container.scrollLeft=(ta.x+Ba.x)*ja,da.container.scrollTop=(ta.y+Ba.y)*ja):da.view.setTranslate(-Ba.x,-Ba.y)})}if(null!=C.rect){xa=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,C.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,C.rect.top)+"px";this.minInlineWidth=C.minWidth;this.minInlineHeight=C.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var Fa=C.maxFitScale,ca=C.rect.width+2*xa,fa=C.rect.height+2*xa;U=mxUtils.bind(this,function(){var da=mxUtils.getDocumentSize();ca=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,ca):ca,da.width-80);da=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,fa):fa,da.height-80);this.diagramContainer.style.width=ca+"px";this.diagramContainer.style.height=da+"px";var ja=this.editor.graph;da=ja.maxFitScale;ja.maxFitScale=Fa;ja.fit(2*xa,null,null,null,null,null,fa);this.setPageVisible(!1);if(null!=this.minInlineWidth&&ja.getGraphBounds().width<this.minInlineWidth){var ta=ja.container.scrollTop;this.resetScrollbars();ja.container.scrollTop=ta}ja.maxFitScale=da;ja.container.scrollTop-=xa;ja.container.scrollLeft-=xa;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[C]));ja.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=ja.container.style.top);var va=ja.getGraphBounds();ja.container.clientWidth>va.width+2*xa&&(ja.container.scrollLeft=-va.x+(va.width+xa-ja.container.clientWidth)/2)}),10)})}null!=C.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=C.noExitBtn);null!=C.title&&null!=this.buttonContainer&&this.setEmbedTitle(C.title);try{C.libs&&this.sidebar.showEntries(C.libs)}catch(da){}if(null!=C.xmlpng)C=this.extractGraphModelFromPng(C.xmlpng);else if(null!=C.descriptor){if(C=C.descriptor,"mermaid"==C.format){if(EditorUi.isMermaidSupported()){var oa=mxUtils.bind(this,function(da){c(da,I,null,N);da=this.createLoadMessage("load");+va.x+(va.width+xa-ja.container.clientWidth)/2)}),10)})}null!=C.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=C.noExitBtn);null!=C.title&&null!=this.buttonContainer&&this.setEmbedTitle(C.title);try{C.libs&&this.sidebar.showEntries(C.libs)}catch(da){}if(null!=C.xmlpng)C=this.extractGraphModelFromPng(C.xmlpng);else if(null!=C.descriptor){if(C=C.descriptor,"mermaid"==C.format){if(EditorUi.isMermaidSupported()){var oa=mxUtils.bind(this,function(da){c(da,I,null,M);da=this.createLoadMessage("load");da.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);da.message=R;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(da),"*");if(null!=na&&null!=na.key&&null!=na.value){da=this.editor.graph;var ja=da.getModel().getRoot();if(null!=ja){da.getModel().beginUpdate();try{da.setAttributeForCell(ja,na.key,na.value)}finally{da.getModel().endUpdate()}}}}),pa=mxUtils.bind(this,function(da){this.handleError(da)});C.image?this.parseMermaidImage(C.data,oa,pa):this.parseMermaidDiagram(C.data,-null,mxUtils.bind(this,function(da){C.wrap&&(da=mxMermaidToDrawio.wrapGroup(da,C.data,null,{normalize:!0}));oa(da)}),pa)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else C=C.xml}else{if("merge"==C.action){var wa=this.getCurrentFile();null!=wa&&(v=S(C.xml),null!=v&&""!=v&&wa.mergeFile(new LocalFile(this,v),mxUtils.bind(this,function(){this.embedDiffSync&&(t=this.clonePages(this.pages),q=ia());y.postMessage(JSON.stringify({event:"merge",-message:C}),"*")}),function(da){y.postMessage(JSON.stringify({event:"merge",message:C,error:da}),"*")}))}else if("patch"==C.action){if(wa=this.getCurrentFile(),null!=wa&&null!=C.patch)try{k=!0,wa.patch([C.patch]),this.embedDiffSync&&null!=t&&(t=this.applyPatches(t,[C.patch])),q=ia(),k=!1,W={event:"patch",message:C},H=this.getHashValueForPages(this.pages),W.checksum=H,null!=C.checksum&&C.checksum!=H&&(W.checksumMismatch=!0),y.postMessage(JSON.stringify(W),"*")}catch(da){k=!1,y.postMessage(JSON.stringify({event:"patch",-message:C,error:da.message||da.toString()}),"*")}}else if("getDiff"==C.action){D={event:"getDiff",message:C};if(this.embedDiffSync&&null!=t){var za=this.clonePages(this.pages);D.patch=this.diffPages(t,za);D.checksum=this.getHashValueForPages(za)}else D.xml=ia();y.postMessage(JSON.stringify(D),"*")}else"resetDiff"==C.action?this.embedDiffSync&&(null!=C.xml?(v=S(C.xml),wa=this.getCurrentFile(),null!=v&&""!=v&&null!=wa&&wa.mergeFile(new LocalFile(this,v),mxUtils.bind(this,function(){t=this.clonePages(this.pages);-q=ia();y.postMessage(JSON.stringify({event:"resetDiff",message:C,checksum:this.getHashValueForPages(this.pages)}),"*")}),function(da){y.postMessage(JSON.stringify({event:"resetDiff",message:C,error:da}),"*")})):(t=this.clonePages(this.pages),q=ia(),y.postMessage(JSON.stringify({event:"resetDiff",message:C,checksum:this.getHashValueForPages(this.pages)}),"*"))):"remoteInvokeReady"==C.action?this.handleRemoteInvokeReady(y):"remoteInvoke"==C.action?this.handleRemoteInvoke(C,I.origin):"remoteInvokeResponse"==-C.action?this.handleRemoteInvokeResponse(C):y.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(C)}),"*");return}}catch(da){this.handleError(da)}}var ia=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),ka=mxUtils.bind(this,function(da,ja){k=!0;try{c(da,ja,null,N)}catch(ta){this.handleError(ta)}k=!1;this.editor.graph.model.prefix=Editor.guid()+"-";ja=mxUtils.bind(this,+null,mxUtils.bind(this,function(da){C.wrap&&(da=mxMermaidToDrawio.wrapGroup(da,C.data,null,{normalize:!0}));oa(da)}),pa)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else C=C.xml}else{if("merge"==C.action){var wa=this.getCurrentFile();null!=wa&&(v=S(C.xml),null!=v&&""!=v&&wa.mergeFile(new LocalFile(this,v),mxUtils.bind(this,function(){this.embedDiffSync&&(t=this.clonePages(this.pages),q=ia());B.postMessage(JSON.stringify({event:"merge",+message:C}),"*")}),function(da){B.postMessage(JSON.stringify({event:"merge",message:C,error:da}),"*")}))}else if("patch"==C.action){if(wa=this.getCurrentFile(),null!=wa&&null!=C.patch)try{k=!0,wa.patch([C.patch]),this.embedDiffSync&&null!=t&&(t=this.applyPatches(t,[C.patch])),q=ia(),k=!1,W={event:"patch",message:C},H=this.getHashValueForPages(this.pages),W.checksum=H,null!=C.checksum&&C.checksum!=H&&(W.checksumMismatch=!0),B.postMessage(JSON.stringify(W),"*")}catch(da){k=!1,B.postMessage(JSON.stringify({event:"patch",+message:C,error:da.message||da.toString()}),"*")}}else if("getDiff"==C.action){D={event:"getDiff",message:C};if(this.embedDiffSync&&null!=t){var za=this.clonePages(this.pages);D.patch=this.diffPages(t,za);D.checksum=this.getHashValueForPages(za)}else D.xml=ia();B.postMessage(JSON.stringify(D),"*")}else"resetDiff"==C.action?this.embedDiffSync&&(null!=C.xml?(v=S(C.xml),wa=this.getCurrentFile(),null!=v&&""!=v&&null!=wa&&wa.mergeFile(new LocalFile(this,v),mxUtils.bind(this,function(){t=this.clonePages(this.pages);+q=ia();B.postMessage(JSON.stringify({event:"resetDiff",message:C,checksum:this.getHashValueForPages(this.pages)}),"*")}),function(da){B.postMessage(JSON.stringify({event:"resetDiff",message:C,error:da}),"*")})):(t=this.clonePages(this.pages),q=ia(),B.postMessage(JSON.stringify({event:"resetDiff",message:C,checksum:this.getHashValueForPages(this.pages)}),"*"))):"remoteInvokeReady"==C.action?this.handleRemoteInvokeReady(B):"remoteInvoke"==C.action?this.handleRemoteInvoke(C,I.origin):"remoteInvokeResponse"==+C.action?this.handleRemoteInvokeResponse(C):B.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(C)}),"*");return}}catch(da){this.handleError(da)}}var ia=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),ka=mxUtils.bind(this,function(da,ja){k=!0;try{c(da,ja,null,M)}catch(ta){this.handleError(ta)}k=!1;this.editor.graph.model.prefix=Editor.guid()+"-";ja=mxUtils.bind(this,function(){null!=urlParams.modified&&this.clearStatus();q=ia();this.embedDiffSync&&(t=this.clonePages(this.pages));n&&null==f&&(f=mxUtils.bind(this,function(va,Ca){va=ia();if(va!=q&&!k){Ca=this.createLoadMessage("autosave");Ca.message=R;if(this.embedDiffSync&&null!=t){var Ha=this.clonePages(this.pages),Ja=this.diffPages(t,Ha);mxUtils.isEmptyObject(Ja)?Ca.xml=va:(Ca.patch=Ja,Ca.checksum=this.getHashValueForPages(Ha),this.embedDiffSyncPatchOnly||(Ca.xml=va));t=Ha}else Ca.xml=va;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(Ca),"*")}q=va}),this.editor.graph.model.addListener(mxEvent.CHANGE,f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",f),this.addListener("backgroundImageChanged",f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",-f),this.addListener("guidesEnabledChanged",f),this.addListener("pageViewChanged",f));null!=U&&U();if("1"==urlParams.returnbounds||"json"==urlParams.proto){var ta=this.createLoadMessage("load");ta.xml=null!=J?ia():da;this.embedDiffSync&&null!=this.pages&&(ta.checksum=this.getHashValueForPages(this.pages));y.postMessage(JSON.stringify(ta),"*")}});null!=J?this.executeLayoutSpec(J,ja):ja()});null!=C&&"function"===typeof C.substring&&"data:application/vnd.visio;base64,"==C.substring(0,34)?(S="0M8R4KGxGuE"==+f),this.addListener("guidesEnabledChanged",f),this.addListener("pageViewChanged",f));null!=U&&U();if("1"==urlParams.returnbounds||"json"==urlParams.proto){var ta=this.createLoadMessage("load");ta.xml=null!=K?ia():da;this.embedDiffSync&&null!=this.pages&&(ta.checksum=this.getHashValueForPages(this.pages));B.postMessage(JSON.stringify(ta),"*")}});null!=K?this.executeLayoutSpec(K,ja):ja()});null!=C&&"function"===typeof C.substring&&"data:application/vnd.visio;base64,"==C.substring(0,34)?(S="0M8R4KGxGuE"==C.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(C.substring(C.indexOf(",")+1)),function(da){ka(da,I)},mxUtils.bind(this,function(da){this.handleError(da)}),S)):null!=C&&"function"===typeof C.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(C,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(C,mxUtils.bind(this,function(da){4==da.readyState&&(200<=da.status&&299>=da.status&&"<mxGraphModel"==da.responseText.substring(0,13)?ka(da.responseText,I):this.handleError({message:413==da.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=C&&"function"===typeof C.substring&&this.isLucidChartData(C)?this.convertLucidChart(C,mxUtils.bind(this,function(da){ka(da)}),mxUtils.bind(this,function(da){this.handleError(da)})):null==C||"object"!==typeof C||null==C.format||null==C.data&&null==C.url?(C=S(C),ka(C,I)):this.loadDescriptor(C,mxUtils.bind(this,function(da){ka(ia(),I)}),mxUtils.bind(this,-function(da){this.handleError(da,mxResources.get("errorLoadingFile"))}))}}));var y=this.embedMessageSource||window.opener||window.parent;u="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";y.postMessage(u,"*");if("json"==urlParams.proto){var E=this.editor.graph.openLink;this.editor.graph.openLink=function(I,C,U){E.apply(this,arguments);y.postMessage(JSON.stringify({event:"openLink",href:I,target:C,allowOpener:U}),"*")};Editor.suppressNewWindows&&document.addEventListener("click",+function(da){this.handleError(da,mxResources.get("errorLoadingFile"))}))}}));var B=this.embedMessageSource||window.opener||window.parent;u="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";B.postMessage(u,"*");if("json"==urlParams.proto){var E=this.editor.graph.openLink;this.editor.graph.openLink=function(I,C,U){E.apply(this,arguments);B.postMessage(JSON.stringify({event:"openLink",href:I,target:C,allowOpener:U}),"*")};Editor.suppressNewWindows&&document.addEventListener("click",mxUtils.bind(this,function(I){for(var C=mxEvent.getSource(I);null!=C&&"A"!=C.nodeName;)C=C.parentNode;if(null!=C){var U=C.getAttribute("href");null==U||"#"==U.charAt(0)||"javascript:"==U.substring(0,11)||this.editor.graph.isCustomLink(U)||(I.preventDefault(),this.editor.graph.openLink(U,C.getAttribute("target")))}}),!0)}};EditorUi.prototype.createEmbedButton=function(c,f,k,n){var q=document.createElement("button");q.className="geEmbedBtn geBtn";q.setAttribute("title",c+(null!=k?" ("+k+")":""));mxUtils.write(q,c);n&&q.classList.add("gePrimaryBtn");mxEvent.addListener(q,"click",f);return q};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,@@ -14317,125 +14321,125 @@ urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actEditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(k){if(0<k.length)try{var n=JSON.parse(k),q=this.getSelectedLayoutContainer();null!=q&&Array.isArray(n)&&0<n.length?this.setContainerChildLayout(q,n):this.executeLayouts(this.editor.graph.createLayouts(n));this.lastLayoutSpec=this.customLayoutConfig=n;this.hideDialog()}catch(t){this.handleError(t)}}),null,null,null,null,mxUtils.bind(this,function(k,n){var q=this.createLayoutAddSelect(n);k.appendChild(q);q=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var t=n.value;n.value=JSON.stringify(JSON.parse(t));n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?n.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));n.value=t}catch(u){this.handleError(u)}}));q.setAttribute("title","copy");q.className="geBtn";k.appendChild(q)}),!0,null,null,EditorUi.APPLY_LAYOUTS_SPEC_URL);this.showDialog(f.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));f.init()}))};EditorUi.APPLY_LAYOUTS_SPEC_URL="https://www.drawio.com/docs/reference/json-layout-specification/";EditorUi.prototype.scopeLayoutsToCells=function(c,f){for(var k={},n=0;n<f.length;n++)null!=f[n]&&(k[f[n].id]=!0);var q=function(t){return null!=t&&!0===k[t.id]};for(n=0;n<c.length;n++)f=c[n],"undefined"!==typeof ElkLayout&&f instanceof-ElkLayout||void 0!==f.cellFilter?f.cellFilter=q:"function"===typeof f.isVertexIgnored&&function(t){var u=t.isVertexIgnored;t.isVertexIgnored=function(y){return u.apply(this,arguments)||!q(y)}}(f)};EditorUi.prototype.createLayoutAddSelect=function(c){var f=this,k=document.createElement("select");k.className="geBtn";k.style.marginRight="8px";k.style.maxWidth="180px";var n=document.createElement("option");n.value="";mxUtils.write(n,mxResources.get("add")+"...");n.disabled=!0;n.selected=!0;k.appendChild(n);-var q=[];"undefined"!==typeof ElkLayout&&(n=function(u,y){var E=ElkLayout.MENU_PRESETS[u];return{label:u,kind:"elk",algo:E.algorithm,preset:E.options,layoutName:y}},q.push(n("verticalFlow","elkLayered")),q.push(n("horizontalFlow","elkLayered")),q.push(n("verticalTree","elkTree")),q.push(n("horizontalTree","elkTree")),q.push(n("radialTree","elkRadial")),q.push(n("organic","elkOrganic")));q.push({label:"orgChart",kind:"orgchart"});q.push({label:"circle",kind:"simple",layoutName:"mxCircleLayout",config:{}});+ElkLayout||void 0!==f.cellFilter?f.cellFilter=q:"function"===typeof f.isVertexIgnored&&function(t){var u=t.isVertexIgnored;t.isVertexIgnored=function(B){return u.apply(this,arguments)||!q(B)}}(f)};EditorUi.prototype.createLayoutAddSelect=function(c){var f=this,k=document.createElement("select");k.className="geBtn";k.style.marginRight="8px";k.style.maxWidth="180px";var n=document.createElement("option");n.value="";mxUtils.write(n,mxResources.get("add")+"...");n.disabled=!0;n.selected=!0;k.appendChild(n);+var q=[];"undefined"!==typeof ElkLayout&&(n=function(u,B){var E=ElkLayout.MENU_PRESETS[u];return{label:u,kind:"elk",algo:E.algorithm,preset:E.options,layoutName:B}},q.push(n("verticalFlow","elkLayered")),q.push(n("horizontalFlow","elkLayered")),q.push(n("verticalTree","elkTree")),q.push(n("horizontalTree","elkTree")),q.push(n("radialTree","elkRadial")),q.push(n("organic","elkOrganic")));q.push({label:"orgChart",kind:"orgchart"});q.push({label:"circle",kind:"simple",layoutName:"mxCircleLayout",config:{}});q.push({label:"parallels",kind:"simple",layoutName:"mxParallelEdgeLayout",config:{spacing:20,checkOverlap:!0}});"undefined"!==typeof LibavoidRouting&&q.push({label:"orthogonalRouting",kind:"simple",layoutName:LibavoidRouting.LAYOUT_NAME,config:{}});for(n=0;n<q.length;n++){var t=document.createElement("option");t.value=String(n);mxUtils.write(t,mxResources.get(q[n].label)+("elk"===q[n].kind||"orgchart"===q[n].kind?"...":""));k.appendChild(t)}mxEvent.addListener(k,"change",mxUtils.bind(this,function(){var u=-parseInt(k.value);k.selectedIndex=0;if(!(isNaN(u)||0>u||u>=q.length)){var y=q[u],E=c.value;if(0===mxUtils.trim(E).length)var I=[];else{try{I=JSON.parse(E)}catch(U){f.handleError(U);return}if(!Array.isArray(I)){f.handleError(Error(mxResources.get("error")+": expected JSON array"));return}}var C=mxUtils.bind(this,function(U){I.push(U);f.hideDialog();f.showCustomLayoutDialog(JSON.stringify(I,null,2))});u=mxUtils.bind(this,function(){f.hideDialog();f.showCustomLayoutDialog(E)});"elk"===y.kind?(f.hideDialog(),-ElkLayout.runWithDialog(f,y.algo,y.preset,mxResources.get(y.label),function(U,J){U=Graph.elkOptionsToConfig(U,J);C({layout:y.layoutName,config:U})},u)):"orgchart"===y.kind?(f.hideDialog(),f.showOrgChartConfigDialog(C,u)):C({layout:y.layoutName,config:y.config||{}})}}));return k};EditorUi.prototype.showOrgChartConfigDialog=function(c,f){var k=2,n=20,q=20,t=document.createElement("div"),u=function(S,N){var R=document.createElement("div");R.style.marginTop="6px";R.style.display="inline-block";R.style.width=-"180px";mxUtils.write(R,mxResources.get(S)+": ");t.appendChild(R);t.appendChild(N)},y=document.createElement("select");y.style.width="160px";y.style.boxSizing="border-box";for(var E=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],I=0;I<E.length;I++){var C=document.createElement("option");mxUtils.write(C,E[I]);C.value=I;-2===I&&C.setAttribute("selected","selected");y.appendChild(C)}mxEvent.addListener(y,"change",function(){k=parseInt(y.value)});u("orgChartType",y);var U=document.createElement("input");U.type="number";U.value=n;U.style.width="160px";U.style.boxSizing="border-box";mxEvent.addListener(U,"change",function(){n=parseInt(U.value)});u("parentChildSpacing",U);var J=document.createElement("input");J.type="number";J.value=q;J.style.width="160px";J.style.boxSizing="border-box";mxEvent.addListener(J,"change",-function(){q=parseInt(J.value)});u("siblingSpacing",J);f=new CustomDialog(this,t,function(){c({layout:"mxOrgChartLayout",config:{branchOptimizer:k,parentChildSpacing:n,siblingSpacing:q}})},f||null,mxResources.get("apply"),"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");this.showDialog(f.container,355,null,!0,!0)};EditorUi.prototype.loadOrgChartLayouts=function(c,f){this.createTimeout(null,mxUtils.bind(this,function(k){var n=mxUtils.bind(this,function(){this.loadingOrgChart=!1;k.clear()&&+parseInt(k.value);k.selectedIndex=0;if(!(isNaN(u)||0>u||u>=q.length)){var B=q[u],E=c.value;if(0===mxUtils.trim(E).length)var I=[];else{try{I=JSON.parse(E)}catch(U){f.handleError(U);return}if(!Array.isArray(I)){f.handleError(Error(mxResources.get("error")+": expected JSON array"));return}}var C=mxUtils.bind(this,function(U){I.push(U);f.hideDialog();f.showCustomLayoutDialog(JSON.stringify(I,null,2))});u=mxUtils.bind(this,function(){f.hideDialog();f.showCustomLayoutDialog(E)});"elk"===B.kind?(f.hideDialog(),+ElkLayout.runWithDialog(f,B.algo,B.preset,mxResources.get(B.label),function(U,K){U=Graph.elkOptionsToConfig(U,K);C({layout:B.layoutName,config:U})},u)):"orgchart"===B.kind?(f.hideDialog(),f.showOrgChartConfigDialog(C,u)):C({layout:B.layoutName,config:B.config||{}})}}));return k};EditorUi.prototype.showOrgChartConfigDialog=function(c,f){var k=2,n=20,q=20,t=document.createElement("div"),u=function(S,M){var R=document.createElement("div");R.style.marginTop="6px";R.style.display="inline-block";R.style.width=+"180px";mxUtils.write(R,mxResources.get(S)+": ");t.appendChild(R);t.appendChild(M)},B=document.createElement("select");B.style.width="160px";B.style.boxSizing="border-box";for(var E=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],I=0;I<E.length;I++){var C=document.createElement("option");mxUtils.write(C,E[I]);C.value=I;+2===I&&C.setAttribute("selected","selected");B.appendChild(C)}mxEvent.addListener(B,"change",function(){k=parseInt(B.value)});u("orgChartType",B);var U=document.createElement("input");U.type="number";U.value=n;U.style.width="160px";U.style.boxSizing="border-box";mxEvent.addListener(U,"change",function(){n=parseInt(U.value)});u("parentChildSpacing",U);var K=document.createElement("input");K.type="number";K.value=q;K.style.width="160px";K.style.boxSizing="border-box";mxEvent.addListener(K,"change",+function(){q=parseInt(K.value)});u("siblingSpacing",K);f=new CustomDialog(this,t,function(){c({layout:"mxOrgChartLayout",config:{branchOptimizer:k,parentChildSpacing:n,siblingSpacing:q}})},f||null,mxResources.get("apply"),"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");this.showDialog(f.container,355,null,!0,!0)};EditorUi.prototype.loadOrgChartLayouts=function(c,f){this.createTimeout(null,mxUtils.bind(this,function(k){var n=mxUtils.bind(this,function(){this.loadingOrgChart=!1;k.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),q=mxUtils.bind(this,function(t){this.loadingOrgChart=!1;k.clear()&&this.handleError(t)});if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))n();else if(f||this.spinner.spin(document.body,mxResources.get("loading")))this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",-function(){mxscript("js/orgchart/mxOrgChartLayout.js",n,null,null,null,q)},null,null,null,q)},null,null,null,q)},null,null,null,q):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",n,null,null,null,q)}),onerror)};EditorUi.prototype.importCsv=function(c,f,k,n){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,k)}),n)};EditorUi.prototype.doImportCsv=function(c,f,k){try{var n=c.split("\n"),q=[],t=[],u=[],y={};if(0<n.length){var E={};k=null!=k?k:this.editor.graph;var I=null,-C=null,U=null,J=null,S=null,N=null,R=null,T="whiteSpace=wrap;html=1;",v=null,d=null,m="",r="auto",A="auto",D=!1,G=null,O=null,P=40,V=40,Y=100,H=0,W=mxUtils.bind(this,function(){null!=f?f(ta):(k.setSelectionCells(ta),k.scrollCellToVisible(k.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),Z=k.getFreeInsertPoint(!0),X=Z.x,ba=Z.y;Z=ba;var ea=null,aa="auto";d=null;for(var ha=[],na=null,ra=null,sa=0;sa<n.length&&"#"==n[sa].charAt(0);){c=-n[sa].replace(/\r$/,"");for(sa++;sa<n.length&&"\\"==c.charAt(c.length-1)&&"#"==n[sa].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(n[sa].substring(1)),sa++;if("#"!=c.charAt(1)){var ua=c.indexOf(":");if(0<ua){var xa=mxUtils.trim(c.substring(1,ua)),qa=mxUtils.trim(c.substring(ua+1));"label"==xa?ea=Graph.sanitizeHtml(qa):"labelname"==xa&&0<qa.length&&"-"!=qa?S=qa:"labels"==xa&&0<qa.length&&"-"!=qa?R=JSON.parse(qa):"style"==xa?C=qa:"parentstyle"==xa?T=qa:"unknownStyle"==xa&&"-"!=qa?N=qa:"stylename"==-xa&&0<qa.length&&"-"!=qa?J=qa:"styles"==xa&&0<qa.length&&"-"!=qa?U=JSON.parse(qa):"vars"==xa&&0<qa.length&&"-"!=qa?I=JSON.parse(qa):"identity"==xa&&0<qa.length&&"-"!=qa?v=qa:"parent"==xa&&0<qa.length&&"-"!=qa?d=qa:"namespace"==xa&&0<qa.length&&"-"!=qa?m=qa:"width"==xa?r=qa:"height"==xa?A=qa:"collapsed"==xa&&"-"!=qa?D="true"==qa:"left"==xa&&0<qa.length?G=qa:"top"==xa&&0<qa.length?O=qa:"ignore"==xa?ra=qa.split(","):"connect"==xa?ha.push(JSON.parse(qa)):"link"==xa?na=qa:"padding"==xa?H=parseFloat(qa):-"edgespacing"==xa?P=parseFloat(qa):"nodespacing"==xa?V=parseFloat(qa):"levelspacing"==xa?Y=parseFloat(qa):"layout"==xa&&(aa=qa)}}}if(null==n[sa])throw Error(mxResources.get("invalidOrMissingFile"));var Aa=this.editor.csvToArray(n[sa].replace(/\r$/,""));ua=c=null;xa=[];for(qa=0;qa<Aa.length;qa++)v==Aa[qa]&&(c=qa),d==Aa[qa]&&(ua=qa),xa.push(mxUtils.trim(Aa[qa]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==ea&&(ea="%"+xa[0]+"%");if(null!=ha)for(var Ba=0;Ba<ha.length;Ba++)null==-E[ha[Ba].to]&&(E[ha[Ba].to]={});v=[];for(qa=sa+1;qa<n.length;qa++){var Ea=this.editor.csvToArray(n[qa].replace(/\r$/,""));if(null==Ea){var Fa=40<n[qa].length?n[qa].substring(0,40)+"...":n[qa];throw Error(Fa+" ("+qa+"):\n"+mxResources.get("containsValidationErrors"));}0<Ea.length&&v.push(Ea)}k.model.beginUpdate();try{for(qa=0;qa<v.length;qa++){Ea=v[qa];var ca=null,fa=null!=c?m+Ea[c]:null;n=!1;null!=fa&&(ca=k.model.getCell(fa),n=null==ca||0<=mxUtils.indexOf(q,ca));var oa=new mxCell(ea,new mxGeometry(X,-Z,0,0),C||"whiteSpace=wrap;html=1;");oa.collapsed=D;oa.vertex=!0;oa.id=fa;null==ca||n||k.model.setCollapsed(ca,D);for(var pa=0;pa<Ea.length;pa++)k.setAttributeForCell(oa,xa[pa],Ea[pa]),null==ca||n||k.setAttributeForCell(ca,xa[pa],Ea[pa]);if(null!=S&&null!=R){var wa=R[oa.getAttribute(S)];null!=wa&&(k.labelChanged(oa,wa),null==ca||n||k.cellLabelChanged(ca,wa))}if(null!=J&&null!=U){var za=U[oa.getAttribute(J)];null!=za&&(oa.style=za)}k.setAttributeForCell(oa,"placeholders","1");oa.style=k.replacePlaceholders(oa,+function(){mxscript("js/orgchart/mxOrgChartLayout.js",n,null,null,null,q)},null,null,null,q)},null,null,null,q)},null,null,null,q):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",n,null,null,null,q)}),onerror)};EditorUi.prototype.importCsv=function(c,f,k,n){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,k)}),n)};EditorUi.prototype.doImportCsv=function(c,f,k){try{var n=c.split("\n"),q=[],t=[],u=[],B={};if(0<n.length){var E={};k=null!=k?k:this.editor.graph;var I=null,+C=null,U=null,K=null,S=null,M=null,R=null,T="whiteSpace=wrap;html=1;",v=null,d=null,m="",r="auto",z="auto",D=!1,F=null,N=null,P=40,V=40,X=100,H=0,W=mxUtils.bind(this,function(){null!=f?f(ta):(k.setSelectionCells(ta),k.scrollCellToVisible(k.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),Z=k.getFreeInsertPoint(!0),Y=Z.x,ba=Z.y;Z=ba;var ea=null,aa="auto";d=null;for(var ha=[],na=null,ra=null,sa=0;sa<n.length&&"#"==n[sa].charAt(0);){c=+n[sa].replace(/\r$/,"");for(sa++;sa<n.length&&"\\"==c.charAt(c.length-1)&&"#"==n[sa].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(n[sa].substring(1)),sa++;if("#"!=c.charAt(1)){var ua=c.indexOf(":");if(0<ua){var xa=mxUtils.trim(c.substring(1,ua)),qa=mxUtils.trim(c.substring(ua+1));"label"==xa?ea=Graph.sanitizeHtml(qa):"labelname"==xa&&0<qa.length&&"-"!=qa?S=qa:"labels"==xa&&0<qa.length&&"-"!=qa?R=JSON.parse(qa):"style"==xa?C=qa:"parentstyle"==xa?T=qa:"unknownStyle"==xa&&"-"!=qa?M=qa:"stylename"==+xa&&0<qa.length&&"-"!=qa?K=qa:"styles"==xa&&0<qa.length&&"-"!=qa?U=JSON.parse(qa):"vars"==xa&&0<qa.length&&"-"!=qa?I=JSON.parse(qa):"identity"==xa&&0<qa.length&&"-"!=qa?v=qa:"parent"==xa&&0<qa.length&&"-"!=qa?d=qa:"namespace"==xa&&0<qa.length&&"-"!=qa?m=qa:"width"==xa?r=qa:"height"==xa?z=qa:"collapsed"==xa&&"-"!=qa?D="true"==qa:"left"==xa&&0<qa.length?F=qa:"top"==xa&&0<qa.length?N=qa:"ignore"==xa?ra=qa.split(","):"connect"==xa?ha.push(JSON.parse(qa)):"link"==xa?na=qa:"padding"==xa?H=parseFloat(qa):+"edgespacing"==xa?P=parseFloat(qa):"nodespacing"==xa?V=parseFloat(qa):"levelspacing"==xa?X=parseFloat(qa):"layout"==xa&&(aa=qa)}}}if(null==n[sa])throw Error(mxResources.get("invalidOrMissingFile"));var Aa=this.editor.csvToArray(n[sa].replace(/\r$/,""));ua=c=null;xa=[];for(qa=0;qa<Aa.length;qa++)v==Aa[qa]&&(c=qa),d==Aa[qa]&&(ua=qa),xa.push(mxUtils.trim(Aa[qa]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==ea&&(ea="%"+xa[0]+"%");if(null!=ha)for(var Ba=0;Ba<ha.length;Ba++)null==+E[ha[Ba].to]&&(E[ha[Ba].to]={});v=[];for(qa=sa+1;qa<n.length;qa++){var Ea=this.editor.csvToArray(n[qa].replace(/\r$/,""));if(null==Ea){var Fa=40<n[qa].length?n[qa].substring(0,40)+"...":n[qa];throw Error(Fa+" ("+qa+"):\n"+mxResources.get("containsValidationErrors"));}0<Ea.length&&v.push(Ea)}k.model.beginUpdate();try{for(qa=0;qa<v.length;qa++){Ea=v[qa];var ca=null,fa=null!=c?m+Ea[c]:null;n=!1;null!=fa&&(ca=k.model.getCell(fa),n=null==ca||0<=mxUtils.indexOf(q,ca));var oa=new mxCell(ea,new mxGeometry(Y,+Z,0,0),C||"whiteSpace=wrap;html=1;");oa.collapsed=D;oa.vertex=!0;oa.id=fa;null==ca||n||k.model.setCollapsed(ca,D);for(var pa=0;pa<Ea.length;pa++)k.setAttributeForCell(oa,xa[pa],Ea[pa]),null==ca||n||k.setAttributeForCell(ca,xa[pa],Ea[pa]);if(null!=S&&null!=R){var wa=R[oa.getAttribute(S)];null!=wa&&(k.labelChanged(oa,wa),null==ca||n||k.cellLabelChanged(ca,wa))}if(null!=K&&null!=U){var za=U[oa.getAttribute(K)];null!=za&&(oa.style=za)}k.setAttributeForCell(oa,"placeholders","1");oa.style=k.replacePlaceholders(oa,oa.style,I);null==ca||n?k.fireEvent(new mxEventObject("cellsInserted","cells",[oa])):(k.model.setStyle(ca,oa.style),0>mxUtils.indexOf(u,ca)&&u.push(ca),k.fireEvent(new mxEventObject("cellsInserted","cells",[ca])));n=null!=ca;ca=oa;if(!n)for(Ba=0;Ba<ha.length;Ba++)E[ha[Ba].to][ca.getAttribute(ha[Ba].to)]=ca;null!=na&&"link"!=na&&(k.setLinkForCell(ca,ca.getAttribute(na)),k.setAttributeForCell(ca,na,null));var ia=k.getPreferredSizeForCell(ca);d=null!=ua?k.model.getCell(m+Ea[ua]):null;if(ca.vertex){Fa=-null!=d?0:X;sa=null!=d?0:ba;null!=G&&null!=ca.getAttribute(G)&&(ca.geometry.x=Fa+parseFloat(ca.getAttribute(G)));null!=O&&null!=ca.getAttribute(O)&&(ca.geometry.y=sa+parseFloat(ca.getAttribute(O)));var ka="@"==r.charAt(0)?ca.getAttribute(r.substring(1)):null;ca.geometry.width=null!=ka&&"auto"!=ka?parseFloat(ca.getAttribute(r.substring(1))):"auto"==r||"auto"==ka?ia.width+H:parseFloat(r);var da="@"==A.charAt(0)?ca.getAttribute(A.substring(1)):null;ca.geometry.height=null!=da&&"auto"!=da&&"width"!=A?-parseFloat(da):"auto"==A||"auto"==da?ia.height+H:"width"==A?ca.geometry.width:parseFloat(A);Z+=ca.geometry.height+V}n?(null==y[fa]&&(y[fa]=[]),y[fa].push(ca)):(q.push(ca),null!=d?(d.style=k.replacePlaceholders(d,T,I),k.addCell(ca,d),t.push(d)):u.push(k.addCell(ca)))}for(qa=0;qa<t.length;qa++)ka="@"==r.charAt(0)?t[qa].getAttribute(r.substring(1)):null,da="@"==A.charAt(0)?t[qa].getAttribute(A.substring(1)):null,"auto"!=r&&"auto"!=ka||"auto"!=A&&"auto"!=da||k.updateGroupBounds([t[qa]],H,!0);var ja=u.slice(),-ta=u.slice();for(Ba=0;Ba<ha.length;Ba++){var va=ha[Ba];for(qa=0;qa<q.length;qa++){ca=q[qa];var Ca=mxUtils.bind(this,function(Wa,mb,Ua){var nb=mb.getAttribute(Ua.from);if(null!=nb&&""!=nb){nb=nb.split(",");for(var Hb=0;Hb<nb.length;Hb++){var jb=E[Ua.to][nb[Hb]];if(null==jb&&null!=N){jb=new mxCell(nb[Hb],new mxGeometry(X,ba,0,0),N);jb.style=k.replacePlaceholders(mb,jb.style,I);var db=k.getPreferredSizeForCell(jb);jb.geometry.width=db.width+H;jb.geometry.height=db.height+H;E[Ua.to][nb[Hb]]=jb;jb.vertex=+null!=d?0:Y;sa=null!=d?0:ba;null!=F&&null!=ca.getAttribute(F)&&(ca.geometry.x=Fa+parseFloat(ca.getAttribute(F)));null!=N&&null!=ca.getAttribute(N)&&(ca.geometry.y=sa+parseFloat(ca.getAttribute(N)));var ka="@"==r.charAt(0)?ca.getAttribute(r.substring(1)):null;ca.geometry.width=null!=ka&&"auto"!=ka?parseFloat(ca.getAttribute(r.substring(1))):"auto"==r||"auto"==ka?ia.width+H:parseFloat(r);var da="@"==z.charAt(0)?ca.getAttribute(z.substring(1)):null;ca.geometry.height=null!=da&&"auto"!=da&&"width"!=z?+parseFloat(da):"auto"==z||"auto"==da?ia.height+H:"width"==z?ca.geometry.width:parseFloat(z);Z+=ca.geometry.height+V}n?(null==B[fa]&&(B[fa]=[]),B[fa].push(ca)):(q.push(ca),null!=d?(d.style=k.replacePlaceholders(d,T,I),k.addCell(ca,d),t.push(d)):u.push(k.addCell(ca)))}for(qa=0;qa<t.length;qa++)ka="@"==r.charAt(0)?t[qa].getAttribute(r.substring(1)):null,da="@"==z.charAt(0)?t[qa].getAttribute(z.substring(1)):null,"auto"!=r&&"auto"!=ka||"auto"!=z&&"auto"!=da||k.updateGroupBounds([t[qa]],H,!0);var ja=u.slice(),+ta=u.slice();for(Ba=0;Ba<ha.length;Ba++){var va=ha[Ba];for(qa=0;qa<q.length;qa++){ca=q[qa];var Ca=mxUtils.bind(this,function(Wa,mb,Ua){var nb=mb.getAttribute(Ua.from);if(null!=nb&&""!=nb){nb=nb.split(",");for(var Hb=0;Hb<nb.length;Hb++){var jb=E[Ua.to][nb[Hb]];if(null==jb&&null!=M){jb=new mxCell(nb[Hb],new mxGeometry(Y,ba,0,0),M);jb.style=k.replacePlaceholders(mb,jb.style,I);var db=k.getPreferredSizeForCell(jb);jb.geometry.width=db.width+H;jb.geometry.height=db.height+H;E[Ua.to][nb[Hb]]=jb;jb.vertex=!0;jb.id=nb[Hb];u.push(k.addCell(jb))}if(null!=jb){db=Ua.label;null!=Ua.fromlabel&&(db=(mb.getAttribute(Ua.fromlabel)||"")+(db||""));null!=Ua.sourcelabel&&(db=k.replacePlaceholders(mb,Ua.sourcelabel,I)+(db||""));null!=Ua.tolabel&&(db=(db||"")+(jb.getAttribute(Ua.tolabel)||""));null!=Ua.targetlabel&&(db=(db||"")+k.replacePlaceholders(jb,Ua.targetlabel,I));var Ab="target"==Ua.placeholders==!Ua.invert?jb:Wa;Ab=null!=Ua.style?k.replacePlaceholders(Ab,Ua.style,I):k.createCurrentEdgeStyle();db=k.insertEdge(null,null,db||"",Ua.invert?jb:Wa,Ua.invert?Wa:jb,Ab);if(null!=Ua.labels)for(Ab=0;Ab<Ua.labels.length;Ab++){var vb=Ua.labels[Ab],Fb=new mxCell(vb.label||Ab,new mxGeometry(null!=vb.x?vb.x:0,null!=vb.y?vb.y:0,0,0),"resizable=0;html=1;");Fb.vertex=!0;Fb.connectable=!1;Fb.geometry.relative=!0;null!=vb.placeholders&&(Fb.value=k.replacePlaceholders("target"==vb.placeholders==!Ua.invert?jb:Wa,Fb.value,I));if(null!=vb.dx||null!=vb.dy)Fb.geometry.offset=new mxPoint(null!=vb.dx?vb.dx:0,null!=vb.dy?vb.dy:0);db.insert(Fb)}if(null!=-Ua.data)for(var Da in Ua.data)k.setAttributeForCell(db,Da,Ua.data[Da]);ta.push(db);mxUtils.remove(Ua.invert?Wa:jb,ja)}}}});Ca(ca,ca,va);if(null!=y[ca.id])for(pa=0;pa<y[ca.id].length;pa++)Ca(ca,y[ca.id][pa],va)}}if(null!=ra)for(qa=0;qa<q.length;qa++)for(ca=q[qa],pa=0;pa<ra.length;pa++)k.setAttributeForCell(ca,mxUtils.trim(ra[pa]),null);if(0<u.length){var Ha=new mxParallelEdgeLayout(k);Ha.spacing=P;Ha.checkOverlap=!0;var Ja=function(){0<Ha.spacing&&Ha.execute(k.getDefaultParent());var Wa=0,mb=0;0<u.length&&-(mb=k.getCellGeometry(u[0]),Wa=Math.round(k.snap(mb.x))-mb.x,mb=Math.round(k.snap(mb.y))-mb.y);for(var Ua=0;Ua<u.length;Ua++){var nb=k.getCellGeometry(u[Ua]);nb.x=Math.round(nb.x+Wa);nb.y=Math.round(nb.y+mb);"auto"==r&&(nb.width=Math.round(k.snap(nb.width)));"auto"==A&&(nb.height=Math.round(k.snap(nb.height)))}};"auto"==aa&&1==ja.length&&(aa=ta.length==2*u.length-1?"verticaltree":"verticalflow");var Ra="organic"==aa||null!=EditorUi.CSV_ELK_LAYOUTS[aa]?null:this.resolveLayoutList(aa);if(null!=Ra){var Va=+Ua.data)for(var Da in Ua.data)k.setAttributeForCell(db,Da,Ua.data[Da]);ta.push(db);mxUtils.remove(Ua.invert?Wa:jb,ja)}}}});Ca(ca,ca,va);if(null!=B[ca.id])for(pa=0;pa<B[ca.id].length;pa++)Ca(ca,B[ca.id][pa],va)}}if(null!=ra)for(qa=0;qa<q.length;qa++)for(ca=q[qa],pa=0;pa<ra.length;pa++)k.setAttributeForCell(ca,mxUtils.trim(ra[pa]),null);if(0<u.length){var Ha=new mxParallelEdgeLayout(k);Ha.spacing=P;Ha.checkOverlap=!0;var Ja=function(){0<Ha.spacing&&Ha.execute(k.getDefaultParent());var Wa=0,mb=0;0<u.length&&+(mb=k.getCellGeometry(u[0]),Wa=Math.round(k.snap(mb.x))-mb.x,mb=Math.round(k.snap(mb.y))-mb.y);for(var Ua=0;Ua<u.length;Ua++){var nb=k.getCellGeometry(u[Ua]);nb.x=Math.round(nb.x+Wa);nb.y=Math.round(nb.y+mb);"auto"==r&&(nb.width=Math.round(k.snap(nb.width)));"auto"==z&&(nb.height=Math.round(k.snap(nb.height)))}};"auto"==aa&&1==ja.length&&(aa=ta.length==2*u.length-1?"verticaltree":"verticalflow");var Ra="organic"==aa||null!=EditorUi.CSV_ELK_LAYOUTS[aa]?null:this.resolveLayoutList(aa);if(null!=Ra){var Va=W;k.view.validate();var bb=k.createLayouts(Ra);this.scopeLayoutsToCells(bb,ta);this.executeLayouts(bb,function(){Ja();Va()});W=null}else if("circle"==aa){var ab=new mxCircleLayout(k);ab.disableEdgeStyle=!1;ab.resetEdges=!1;var pb=ab.isVertexIgnored;ab.isVertexIgnored=function(Wa){return pb.apply(this,arguments)||0>mxUtils.indexOf(u,Wa)};this.executeLayout(function(){ab.execute(k.getDefaultParent());Ja()},!0,W);W=null}else if("verticaltree"==aa||"horizontaltree"==aa){k.view.validate();var hb=new mxCompactTreeLayout(k,-"horizontaltree"==aa);hb.levelDistance=V;hb.edgeRouting=!1;hb.resetEdges=!1;hb.sortEdges=!0;var wb=hb.isVertexIgnored;hb.isVertexIgnored=function(Wa){return wb.apply(this,arguments)||0>mxUtils.indexOf(u,Wa)};this.executeLayout(function(){hb.execute(k.getDefaultParent(),0<ja.length?ja[0]:null)},!0,W);W=null}else if("orgchart"==aa){k.view.validate();var Pa=new mxOrgChartLayout(k,2,Y,V),Za=Pa.isVertexIgnored;Pa.isVertexIgnored=function(Wa){return Za.apply(this,arguments)||0>mxUtils.indexOf(u,Wa)};this.executeLayout(function(){Pa.execute(k.getDefaultParent());+"horizontaltree"==aa);hb.levelDistance=V;hb.edgeRouting=!1;hb.resetEdges=!1;hb.sortEdges=!0;var wb=hb.isVertexIgnored;hb.isVertexIgnored=function(Wa){return wb.apply(this,arguments)||0>mxUtils.indexOf(u,Wa)};this.executeLayout(function(){hb.execute(k.getDefaultParent(),0<ja.length?ja[0]:null)},!0,W);W=null}else if("orgchart"==aa){k.view.validate();var Pa=new mxOrgChartLayout(k,2,X,V),Za=Pa.isVertexIgnored;Pa.isVertexIgnored=function(Wa){return Za.apply(this,arguments)||0>mxUtils.indexOf(u,Wa)};this.executeLayout(function(){Pa.execute(k.getDefaultParent());Ja()},!0,W);W=null}else if("organic"==aa||"auto"==aa&&ta.length>u.length){k.view.validate();var eb=new mxFastOrganicLayout(k);eb.forceConstant=3*V;eb.disableEdgeStyle=!1;eb.resetEdges=!1;var qb=eb.isVertexIgnored;eb.isVertexIgnored=function(Wa){return qb.apply(this,arguments)||0>mxUtils.indexOf(u,Wa)};this.executeLayout(function(){eb.execute(k.getDefaultParent());Ja()},!0,W);W=null}else if(null!=EditorUi.CSV_ELK_LAYOUTS[aa]){k.view.validate();Va=W;var lb=EditorUi.CSV_ELK_LAYOUTS[aa],Ya=mxUtils.clone(lb.config);-Ya["elk.spacing.nodeNode"]=V;Ya["elk.layered.spacing.nodeNodeBetweenLayers"]=Y;Ya["elk.spacing.edgeEdge"]=P;Ya["elk.layered.spacing.edgeEdgeBetweenLayers"]=P;var rb=k.createLayouts([{layout:lb.layout,config:Ya}]);this.scopeLayoutsToCells(rb,ta);k.model.beginUpdate();var yb=!1,ub=function(){yb||(yb=!0,k.model.endUpdate())},Cb=this;try{rb[0].prepare(k.getDefaultParent(),function(Wa,mb){null!=Wa?(ub(),Cb.handleError(Wa)):Cb.executeLayout(function(){mb();var Ua=k.getBoundingBoxFromGeometry(ta);null!=-Ua&&k.moveCells(ta,X-Ua.x,ba-Ua.y)},!0,function(){ub();Va()})})}catch(Wa){throw ub(),Wa;}W=null}}this.hideDialog()}finally{k.model.endUpdate()}null!=W&&W()}}catch(Wa){this.handleError(Wa)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var k="?",n;for(n in urlParams)0>mxUtils.indexOf(c,n)&&null!=urlParams[n]&&(f+=k+n+"="+urlParams[n],k="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=+Ya["elk.spacing.nodeNode"]=V;Ya["elk.layered.spacing.nodeNodeBetweenLayers"]=X;Ya["elk.spacing.edgeEdge"]=P;Ya["elk.layered.spacing.edgeEdgeBetweenLayers"]=P;var rb=k.createLayouts([{layout:lb.layout,config:Ya}]);this.scopeLayoutsToCells(rb,ta);k.model.beginUpdate();var yb=!1,ub=function(){yb||(yb=!0,k.model.endUpdate())},Cb=this;try{rb[0].prepare(k.getDefaultParent(),function(Wa,mb){null!=Wa?(ub(),Cb.handleError(Wa)):Cb.executeLayout(function(){mb();var Ua=k.getBoundingBoxFromGeometry(ta);null!=+Ua&&k.moveCells(ta,Y-Ua.x,ba-Ua.y)},!0,function(){ub();Va()})})}catch(Wa){throw ub(),Wa;}W=null}}this.hideDialog()}finally{k.model.endUpdate()}null!=W&&W()}}catch(Wa){this.handleError(Wa)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var k="?",n;for(n in urlParams)0>mxUtils.indexOf(c,n)&&null!=urlParams[n]&&(f+=k+n+"="+urlParams[n],k="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var k="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),n;for(n in urlParams)0>mxUtils.indexOf(k,n)&&(c=0==f?c+"?":c+"&",null!=urlParams[n]&&(c+=n+"="+urlParams[n],f++))}return c};EditorUi.prototype.showLinkDialog=function(c,f,k,n,q){c=new LinkDialog(this,c,f,k,!0,n,q);this.showDialog(c.container,440,null,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||f++;null!=this.m365&&f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;c&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),f=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var k=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!k);this.actions.get("print").setEnabled(!k);this.menus.get("exportAs").setEnabled(!k);this.menus.get("embed").setEnabled(!k);k="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(k);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(k),this.menus.get("newLibrary").setEnabled(k));c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(f);this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f);this.actions.get("smartFit").setEnabled(f);this.actions.get("resetView").setEnabled(f);this.menus.get("edit").setEnabled(f);this.menus.get("view").setEnabled(f);this.menus.get("importFrom").setEnabled(c);this.menus.get("arrange").setEnabled(c);this.menus.get("edgeShape").setEnabled(c);this.menus.get("edgeStyle").setEnabled(c);this.menus.get("appearance").setEnabled(mxUtils.lightDarkColorSupported)};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};-EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var f=0;f<c.length;f++)this.libraryLoaded(c[f].file,c[f].images,c[f].title,null!=c[f].div?"none"!=c[f].div.style.display:c[f].expand)};var L=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){L.apply(this,arguments);var c=this.editor.graph,f=this.getCurrentFile(),k=this.getSelectionState(),n=this.isDiagramActive(),q="1"==urlParams.embed&&this.editor.graph.isEnabled()||+EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var f=0;f<c.length;f++)this.libraryLoaded(c[f].file,c[f].images,c[f].title,null!=c[f].div?"none"!=c[f].div.style.display:c[f].expand)};var J=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){J.apply(this,arguments);var c=this.editor.graph,f=this.getCurrentFile(),k=this.getSelectionState(),n=this.isDiagramActive(),q="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=f&&f.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&q);this.actions.get("redo").setEnabled(this.canRedo()&&q);this.actions.get("autosave").setEnabled(null!=f&&f.isEditable()&&f.isAutosaveOptional());this.actions.get("guides").setEnabled(n);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("explore").setEnabled(n&&(1==k.edges.length||1==k.vertices.length));this.actions.get("editConnectionPoints").setEnabled(n&&0==k.edges.length&&1==k.vertices.length);this.actions.get("editPolygon").setEnabled(n&&1==k.vertices.length&&"mxgraph.basic.polygon"==k.style[mxConstants.STYLE_SHAPE]);this.actions.get("editImage").setEnabled(n&&k.image&&0<k.cells.length);this.actions.get("crop").setEnabled(n&&k.image&&0<k.cells.length);this.actions.get("pageSetup").setEnabled(n);this.actions.get("shadowVisible").setEnabled(n);this.actions.get("connectionArrows").setEnabled(n);this.actions.get("connectionPoints").setEnabled(n);this.actions.get("copyStyle").setEnabled(n&&!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&n&&0<k.cells.length);this.actions.get("copyTextStyle").setEnabled(n&&!c.isSelectionEmpty());this.actions.get("pasteTextStyle").setEnabled(null!=this.copiedTextStyle&&n&&0<k.cells.length);this.actions.get("editGeometry").setEnabled(0<k.vertices.length&&!k.transparentBounds);this.actions.get("addToScratchpad").setEnabled(0<k.cells.length);this.actions.get("createShape").setEnabled(n);this.actions.get("createRevision").setEnabled(n);this.actions.get("moveToFolder").setEnabled(null!=f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(n&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=f&&!f.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.actions.get("properties").setEnabled(null!=f);this.menus.get("publish").setEnabled(null!=f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("none"!=this.diagramContainer.style.display);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(n&&-null!=c&&null!=c.shape&&null!=c.shape.stencil)};var Q=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);Q.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,k,n,q,t,u,y){var E=c.editor.graph;if("xml"==k)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");-else if("svg"==k)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(E.getSvg(n,q,t)),"image/svg+xml");else{var I=c.getFileData(!0,null,null,null,null,!0),C=E.getGraphBounds(),U=Math.floor(C.width*q/E.view.scale),J=Math.floor(C.height*q/E.view.scale);if(I.length<=MAX_REQUEST_SIZE&&U*J<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.editor.isExportToCanvas()){var S={globalVars:E.getExportVariables()};y&&(S.grid={size:E.gridSize,steps:E.view.gridSteps,color:E.view.gridColor});c.saveRequest(f,-k,function(N,R){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(R||"0")+(null!=N?"&filename="+encodeURIComponent(N):"")+"&extras="+encodeURIComponent(JSON.stringify(S))+(0<u?"&dpi="+u:"")+"&bg="+(null!=n?n:"none")+"&w="+U+"&h="+J+"&border="+t+"&xml="+encodeURIComponent(I))})}else"png"==k?c.exportImage(q,null==n||"none"==n,!0,!1,!1,t,!0,!1,null,y,u):c.exportImage(q,!1,!0,!1,!1,t,!0,!1,"jpeg",y);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=+null!=c&&null!=c.shape&&null!=c.shape.stencil)};var Q=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);Q.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,k,n,q,t,u,B){var E=c.editor.graph;if("xml"==k)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");+else if("svg"==k)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(E.getSvg(n,q,t)),"image/svg+xml");else{var I=c.getFileData(!0,null,null,null,null,!0),C=E.getGraphBounds(),U=Math.floor(C.width*q/E.view.scale),K=Math.floor(C.height*q/E.view.scale);if(I.length<=MAX_REQUEST_SIZE&&U*K<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.editor.isExportToCanvas()){var S={globalVars:E.getExportVariables()};B&&(S.grid={size:E.gridSize,steps:E.view.gridSteps,color:E.view.gridColor});c.saveRequest(f,+k,function(M,R){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(R||"0")+(null!=M?"&filename="+encodeURIComponent(M):"")+"&extras="+encodeURIComponent(JSON.stringify(S))+(0<u?"&dpi="+u:"")+"&bg="+(null!=n?n:"none")+"&w="+U+"&h="+K+"&border="+t+"&xml="+encodeURIComponent(I))})}else"png"==k?c.exportImage(q,null==n||"none"==n,!0,!1,!1,t,!0,!1,null,B,u):c.exportImage(q,!1,!0,!1,!1,t,!0,!1,"jpeg",B);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var k=0;k<this.pages.length;k++){var n=c;this.currentPage!=this.pages[k]&&(n=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[k]),n.model.setRoot(this.pages[k].root));f+=this.pages[k].getName()+" "+n.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.writeJsonLabel=function(c,f,k){if(null!=f&&""!=f){if(this.editor.graph.isHtmlLabel(c)&&(c=document.createElement("div"),c.innerHTML=Graph.sanitizeHtml(f),0<c.getElementsByTagName("*").length)){k.label=mxUtils.trim(mxUtils.extractTextWithWhitespace([c]));k.html=f;return}k.label=f}};EditorUi.prototype.getJsonForExportCell=function(c,f){var k={id:c.getId()};k.type=f?"layer":c.edge?"edge":c.vertex?"node":"group";f||(f=c.getParent(),null!=f&&(k.parent=f.getId()));c.edge&&(null!=c.source&&(k.source=c.source.getId()),null!=c.target&&(k.target=c.target.getId()));f=c.value;if(null!=f&&mxUtils.isNode(f)){this.writeJsonLabel(c,f.getAttribute("label"),k);c=f.attributes;f={};for(var n=0,q=0;q<c.length;q++){var t=c[q].nodeName;"label"!=t&&"placeholders"!=t&&"id"!=t&&(f[t]=c[q].nodeValue,n++)}0<n&&(k.metadata=f)}else"string"===typeof f&&this.writeJsonLabel(c,f,k);return k};EditorUi.prototype.getJsonForPage=function(c,f){var k=this.editor.graph.getModel();var n=null==c||c==this.currentPage?k.getRoot():this.updatePageRoot(c).root;var q=[],t=mxUtils.bind(this,function(C,U){q.push(this.getJsonForExportCell(C,U));U=C.getChildCount();-for(var J=0;J<U;J++)t(C.getChildAt(J),!1)});if(null!=f){n={};for(var u=0;u<f.length;u++)n[f[u].getId()]=!0;for(u=0;u<f.length;u++){for(var y=f[u],E=y.getParent(),I=!1;null!=E;){if(n[E.getId()]){I=!0;break}E=E.getParent()}I||t(y,k.isLayer(y))}}else for(f=n.getChildCount(),u=0;u<f;u++)t(n.getChildAt(u),!0);u={};null!=c&&(u.id=c.getId(),u.name=c.getName());u.cells=q;return u};EditorUi.prototype.createJsonForExport=function(c,f,k,n){var q={version:EditorUi.VERSION};f&&(q.data=mxUtils.getXml(this.getXmlFileData(!n,+for(var K=0;K<U;K++)t(C.getChildAt(K),!1)});if(null!=f){n={};for(var u=0;u<f.length;u++)n[f[u].getId()]=!0;for(u=0;u<f.length;u++){for(var B=f[u],E=B.getParent(),I=!1;null!=E;){if(n[E.getId()]){I=!0;break}E=E.getParent()}I||t(B,k.isLayer(B))}}else for(f=n.getChildCount(),u=0;u<f;u++)t(n.getChildAt(u),!0);u={};null!=c&&(u.id=c.getId(),u.name=c.getName());u.cells=q;return u};EditorUi.prototype.createJsonForExport=function(c,f,k,n){var q={version:EditorUi.VERSION};f&&(q.data=mxUtils.getXml(this.getXmlFileData(!n,!c,!k)));f=[];if(n)f.push(this.getJsonForPage(this.currentPage,this.editor.graph.getSelectionCells()));else if(c&&null!=this.pages)for(c=0;c<this.pages.length;c++)f.push(this.getJsonForPage(this.pages[c]));else f.push(this.getJsonForPage(this.currentPage));q.pages=f;return q};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},k=document.createElement("div");k.style.whiteSpace="nowrap";var n=document.createElement("h3");mxUtils.write(n,mxUtils.htmlEntities(c));k.appendChild(n);var q=-document.createElement("div");q.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";q.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var t={};try{var u=mxSettings.getCustomLibraries();for(c=0;c<u.length;c++){var y=u[c];if("R"==y.substring(0,1)){var E=JSON.parse(decodeURIComponent(y.substring(1)));t[E[0]]={id:E[0],title:E[1],downloadUrl:E[2]}}}}catch(I){}this.remoteInvoke("getCustomLibraries",null,null,function(I){q.innerText="";-if(0==I.length)q.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var C=0;C<I.length;C++){var U=I[C];t[U.id]&&(f[U.id]=U);var J=this.addCheckbox(q,U.title,t[U.id]);(function(S,N){mxEvent.addListener(N,"change",function(){this.checked?f[S.id]=S:delete f[S.id]})})(U,J)}},mxUtils.bind(this,function(I){q.innerText="";var C=document.createElement("div");C.style.padding="8px";C.style.textAlign="center";mxUtils.write(C,-mxResources.get("error")+": ");mxUtils.write(C,null!=I&&null!=I.message?I.message:mxResources.get("unknownError"));q.appendChild(C)}));k.appendChild(q);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var I=0,C;for(C in f)null==t[C]&&(I++,mxUtils.bind(this,function(U){this.remoteInvoke("getFileContent",[U.downloadUrl],null,mxUtils.bind(this,function(J){I--;0==I&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,J,U)),+document.createElement("div");q.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";q.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var t={};try{var u=mxSettings.getCustomLibraries();for(c=0;c<u.length;c++){var B=u[c];if("R"==B.substring(0,1)){var E=JSON.parse(decodeURIComponent(B.substring(1)));t[E[0]]={id:E[0],title:E[1],downloadUrl:E[2]}}}}catch(I){}this.remoteInvoke("getCustomLibraries",null,null,function(I){q.innerText="";+if(0==I.length)q.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var C=0;C<I.length;C++){var U=I[C];t[U.id]&&(f[U.id]=U);var K=this.addCheckbox(q,U.title,t[U.id]);(function(S,M){mxEvent.addListener(M,"change",function(){this.checked?f[S.id]=S:delete f[S.id]})})(U,K)}},mxUtils.bind(this,function(I){q.innerText="";var C=document.createElement("div");C.style.padding="8px";C.style.textAlign="center";mxUtils.write(C,+mxResources.get("error")+": ");mxUtils.write(C,null!=I&&null!=I.message?I.message:mxResources.get("unknownError"));q.appendChild(C)}));k.appendChild(q);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var I=0,C;for(C in f)null==t[C]&&(I++,mxUtils.bind(this,function(U){this.remoteInvoke("getFileContent",[U.downloadUrl],null,mxUtils.bind(this,function(K){I--;0==I&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,K,U)),this.showSidebar()}catch(S){this.handleError(S,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){I--;0==I&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[C]));for(C in t)f[C]||this.closeLibrary(new RemoteLibrary(this,null,t[C]));0==I&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(k.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=c;for(var f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=-function(c){var f=c.msgMarkers,k=this.remoteInvokeCallbacks[f.callbackId];if(null==k)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?k.error&&k.error(c.error.errResp):k.callback&&k.callback.apply(this,c.resp);this.remoteInvokeCallbacks[f.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,f,k,n,q){var t=!0,u=window.setTimeout(mxUtils.bind(this,function(){t=!1;q({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),y=mxUtils.bind(this,function(){window.clearTimeout(u);-t&&n.apply(this,arguments)}),E=mxUtils.bind(this,function(){window.clearTimeout(u);t&&q.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:y,error:E});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:k});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,f){var k=mxUtils.bind(this,function(I,C){var U={event:"remoteInvokeResponse",-msgMarkers:c.msgMarkers};null!=C?U.error={errResp:C}:null!=I&&(U.resp=I);this.remoteWin.postMessage(JSON.stringify(U),"*")});try{var n=c.funtionName,q=this.remoteInvokableFns[n];if(null!=q&&"function"===typeof this[n]){if(q.allowedDomains){for(var t=!1,u=0;u<q.allowedDomains.length;u++)if(f=="https://"+q.allowedDomains[u]){t=!0;break}if(!t){k(null,"Invalid Call: "+n+" is not allowed.");return}}var y=c.functionArgs;Array.isArray(y)||(y=[]);if(q.isAsync)y.push(function(){k(Array.prototype.slice.apply(arguments))}),-y.push(function(I){k(null,I||"Unkown Error")}),this[n].apply(this,y);else{var E=this[n].apply(this,y);k([E])}}else k(null,"Invalid Call: "+n+" is not found.")}catch(I){k(null,"Invalid Call: An error occurred, "+I.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var k=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var n=k.open("database",2);n.onupgradeneeded=function(q){try{var t=n.result;1>q.oldVersion&&t.createObjectStore("objects",{keyPath:"key"});+function(c){var f=c.msgMarkers,k=this.remoteInvokeCallbacks[f.callbackId];if(null==k)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?k.error&&k.error(c.error.errResp):k.callback&&k.callback.apply(this,c.resp);this.remoteInvokeCallbacks[f.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,f,k,n,q){var t=!0,u=window.setTimeout(mxUtils.bind(this,function(){t=!1;q({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),B=mxUtils.bind(this,function(){window.clearTimeout(u);+t&&n.apply(this,arguments)}),E=mxUtils.bind(this,function(){window.clearTimeout(u);t&&q.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:B,error:E});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:k});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,f){var k=mxUtils.bind(this,function(I,C){var U={event:"remoteInvokeResponse",+msgMarkers:c.msgMarkers};null!=C?U.error={errResp:C}:null!=I&&(U.resp=I);this.remoteWin.postMessage(JSON.stringify(U),"*")});try{var n=c.funtionName,q=this.remoteInvokableFns[n];if(null!=q&&"function"===typeof this[n]){if(q.allowedDomains){for(var t=!1,u=0;u<q.allowedDomains.length;u++)if(f=="https://"+q.allowedDomains[u]){t=!0;break}if(!t){k(null,"Invalid Call: "+n+" is not allowed.");return}}var B=c.functionArgs;Array.isArray(B)||(B=[]);if(q.isAsync)B.push(function(){k(Array.prototype.slice.apply(arguments))}),+B.push(function(I){k(null,I||"Unkown Error")}),this[n].apply(this,B);else{var E=this[n].apply(this,B);k([E])}}else k(null,"Invalid Call: "+n+" is not found.")}catch(I){k(null,"Invalid Call: An error occurred, "+I.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var k=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var n=k.open("database",2);n.onupgradeneeded=function(q){try{var t=n.result;1>q.oldVersion&&t.createObjectStore("objects",{keyPath:"key"});2>q.oldVersion&&(t.createObjectStore("files",{keyPath:"title"}),t.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(u){null!=f&&f(u)}};n.onsuccess=mxUtils.bind(this,function(q){try{var t=n.result;this.database=t;EditorUi.migrateStorageFiles&&(StorageFile.migrate(t),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,-function(u){if((!u||"1"==urlParams.forceMigration)&&"1"==urlParams.forceMigration){var y=document.createElement("iframe");y.style.display="none";y.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(y);var E=!0,I=!1,C,U=0,J=mxUtils.bind(this,function(){I=!0;this.setDatabaseItem(".drawioMigrated3",!0);y.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),S=mxUtils.bind(this,-function(){U++;N()}),N=mxUtils.bind(this,function(){try{if(U>=C.length)J();else{var T=C[U];StorageFile.getFileContent(this,T,mxUtils.bind(this,function(v){null==v||".scratchpad"==T&&v==this.emptyLibraryXml?y.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[T]}),"*"):S()}),S)}}catch(v){console.log(v)}}),R=mxUtils.bind(this,function(T){try{this.setDatabaseItem(null,[{title:T.title,size:T.data.length,lastModified:Date.now(),type:T.isLib?-"L":"F"},{title:T.title,data:T.data}],S,S,["filesInfo","files"])}catch(v){console.log(v)}});u=mxUtils.bind(this,function(T){try{if(T.source==y.contentWindow){var v={};try{v=JSON.parse(T.data)}catch(d){}"init"==v.event?(y.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),y.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=v.event||I||(E?null!=v.resp&&0<v.resp.length&&null!=v.resp[0]?(C=v.resp[0],-E=!1,N()):J():null!=v.resp&&0<v.resp.length&&null!=v.resp[0]?R(v.resp[0]):S())}}catch(d){console.log(d)}});window.addEventListener("message",u)}})));c(t);t.onversionchange=function(){t.close()}}catch(u){null!=f?f(u):null!=window.console&&console.warn(u)}});n.onerror=f;n.onblocked=function(){}}catch(q){null!=f?f(q):null!=window.console&&console.error(q)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,f,k,n,q){this.openDatabase(mxUtils.bind(this,-function(t){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c],f=[f]);var u=t.transaction(q,"readwrite");u.oncomplete=k;u.onerror=n;for(t=0;t<q.length;t++)u.objectStore(q[t]).put(null!=c&&null!=c[t]?{key:c[t],data:f[t]}:f[t])}catch(y){null!=n&&n(y)}}),n)};EditorUi.prototype.removeDatabaseItem=function(c,f,k,n){this.openDatabase(mxUtils.bind(this,function(q){try{n=n||"objects";Array.isArray(n)||(n=[n],c=[c]);var t=q.transaction(n,"readwrite");t.oncomplete=f;t.onerror=k;for(q=0;q<n.length;q++)t.objectStore(n[q]).delete(c[q])}catch(u){null!=+function(u){if((!u||"1"==urlParams.forceMigration)&&"1"==urlParams.forceMigration){var B=document.createElement("iframe");B.style.display="none";B.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(B);var E=!0,I=!1,C,U=0,K=mxUtils.bind(this,function(){I=!0;this.setDatabaseItem(".drawioMigrated3",!0);B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),S=mxUtils.bind(this,+function(){U++;M()}),M=mxUtils.bind(this,function(){try{if(U>=C.length)K();else{var T=C[U];StorageFile.getFileContent(this,T,mxUtils.bind(this,function(v){null==v||".scratchpad"==T&&v==this.emptyLibraryXml?B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[T]}),"*"):S()}),S)}}catch(v){console.log(v)}}),R=mxUtils.bind(this,function(T){try{this.setDatabaseItem(null,[{title:T.title,size:T.data.length,lastModified:Date.now(),type:T.isLib?+"L":"F"},{title:T.title,data:T.data}],S,S,["filesInfo","files"])}catch(v){console.log(v)}});u=mxUtils.bind(this,function(T){try{if(T.source==B.contentWindow){var v={};try{v=JSON.parse(T.data)}catch(d){}"init"==v.event?(B.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),B.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=v.event||I||(E?null!=v.resp&&0<v.resp.length&&null!=v.resp[0]?(C=v.resp[0],+E=!1,M()):K():null!=v.resp&&0<v.resp.length&&null!=v.resp[0]?R(v.resp[0]):S())}}catch(d){console.log(d)}});window.addEventListener("message",u)}})));c(t);t.onversionchange=function(){t.close()}}catch(u){null!=f?f(u):null!=window.console&&console.warn(u)}});n.onerror=f;n.onblocked=function(){}}catch(q){null!=f?f(q):null!=window.console&&console.error(q)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,f,k,n,q){this.openDatabase(mxUtils.bind(this,+function(t){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c],f=[f]);var u=t.transaction(q,"readwrite");u.oncomplete=k;u.onerror=n;for(t=0;t<q.length;t++)u.objectStore(q[t]).put(null!=c&&null!=c[t]?{key:c[t],data:f[t]}:f[t])}catch(B){null!=n&&n(B)}}),n)};EditorUi.prototype.removeDatabaseItem=function(c,f,k,n){this.openDatabase(mxUtils.bind(this,function(q){try{n=n||"objects";Array.isArray(n)||(n=[n],c=[c]);var t=q.transaction(n,"readwrite");t.oncomplete=f;t.onerror=k;for(q=0;q<n.length;q++)t.objectStore(n[q]).delete(c[q])}catch(u){null!=k&&k(u)}}),k)};EditorUi.prototype.getDatabaseItem=function(c,f,k,n){this.openDatabase(mxUtils.bind(this,function(q){try{n=n||"objects";var t=q.transaction([n],"readonly").objectStore(n).get(c);t.onsuccess=function(){f(t.result)};t.onerror=k}catch(u){null!=k&&k(u)}}),k)};EditorUi.prototype.getDatabaseItems=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(n){try{k=k||"objects";var q=n.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),t=[];q.onsuccess=function(u){null==u.target.result?c(t):(t.push(u.target.result.value),u.target.result.continue())};q.onerror=f}catch(u){null!=f&&f(u)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(n){try{k=k||"objects";var q=n.transaction([k],"readonly").objectStore(k).getAllKeys();q.onsuccess=function(){c(q.result)};q.onerror=f}catch(t){null!=f&&f(t)}}),f)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(c,f){var k=this.getCurrentFile();null!=k?k.getComments(c,f):c([])};EditorUi.prototype.addComment=function(c,f,k){var n=this.getCurrentFile();null!=n?n.addComment(c,f,k):f(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.newComment=function(c,f){var k=this.getCurrentFile();return null!=k?k.newComment(c,f):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,f){var k=this.getCurrentFile();null!=k&&k.getRevisions?k.getRevisions(c,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=-function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,k,n,q,t,u,y){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,k,n,q,t,u,y)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=-function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,k,n,q,t,u,y,E,I,C,U,J,S,N,R){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,k,n,q,t,u,y,E,I,C,U,J,S,N,R)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");+function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,k,n,q,t,u,B){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,k,n,q,t,u,B)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=+function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,k,n,q,t,u,B,E,I,C,U,K,S,M,R){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,k,n,q,t,u,B,E,I,C,U,K,S,M,R)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,k,n){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,k,n)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,f)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,f,k,n){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,k,n)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,k,n,q){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,f,k,n,q)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],f=0;f<localStorage.length;f++){var k=localStorage.key(f),n=localStorage.getItem(k);if(0<k.length&&(".scratchpad"==k||"."!=k.charAt(0))&&0<n.length){var q="<mxfile "===n.substring(0,8)||"<?xml"===n.substring(0,5)||"\x3c!--[if IE]>"===n.substring(0,12);n="<mxlibrary>"===n.substring(0,11);(q||n)&&c.push(k)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var f=localStorage.getItem(c);return{title:c,data:f,isLib:"<mxlibrary>"===f.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();-var CommentsWindow=function(b,l,p,g,x,B){function z(){for(var N=u.getElementsByTagName("div"),R=0,T=0;T<N.length;T++)"none"!=N[T].style.display&&N[T].parentNode==u&&R++;y.style.display=0==R?"block":"none"}function F(N,R,T,v){function d(){R.removeChild(A);R.removeChild(D);r.style.display="block";m.style.display="block"}n={div:R,comment:N,saveCallback:T,deleteOnCancel:v};var m=R.querySelector(".geCommentTxt"),r=R.querySelector(".geCommentActionsList"),A=document.createElement("textarea");A.className=-"geCommentEditTxtArea";A.style.minHeight=m.offsetHeight+"px";A.value=N.content;R.insertBefore(A,m);var D=document.createElement("div");D.className="geCommentEditBtns";var G=mxUtils.button(mxResources.get("cancel"),function(){v?(R.parentNode.removeChild(R),z()):d();n=null});G.className="geCommentEditBtn";D.appendChild(G);var O=mxUtils.button(mxResources.get("save"),function(){m.innerText="";N.content=A.value;mxUtils.write(m,N.content);d();T(N);n=null});mxEvent.addListener(A,"keydown",mxUtils.bind(this,-function(P){mxEvent.isConsumed(P)||((mxEvent.isControlDown(P)||mxClient.IS_MAC&&mxEvent.isMetaDown(P))&&13==P.keyCode?(O.click(),mxEvent.consume(P)):27==P.keyCode&&(G.click(),mxEvent.consume(P)))}));O.focus();O.className="geCommentEditBtn gePrimaryBtn";D.appendChild(O);R.insertBefore(D,m);r.style.display="none";m.style.display="none";A.focus()}function K(N,R){R.innerText="";N=new Date(N.modifiedDate);var T=b.timeSince(N);null==T&&(T=mxResources.get("lessThanAMinute"));mxUtils.write(R,mxResources.get("timeAgo",-[T],"{1} ago"));R.setAttribute("title",N.toLocaleDateString()+" "+N.toLocaleTimeString())}function M(N){var R=document.createElement("img");R.className="geCommentBusyImg";R.src=IMAGE_PATH+"/spin.gif";N.appendChild(R);N.busyImg=R}function L(N){N.style.border="1px solid red";N.busyImg.parentNode==N&&N.removeChild(N.busyImg)}function Q(N){N.style.border="";N.busyImg.parentNode==N&&N.removeChild(N.busyImg)}function c(N,R,T,v,d){function m(Y,H,W){var Z=document.createElement("li");Z.className="geCommentAction";-var X=document.createElement("a");X.className="geCommentActionLnk";mxUtils.write(X,Y);Z.appendChild(X);mxEvent.addListener(X,"click",function(ba){H(ba,N);ba.preventDefault();mxEvent.consume(ba)});V.appendChild(Z);W&&(Z.style.display="none")}function r(){function Y(Z){H.push(W);if(null!=Z.replies)for(var X=0;X<Z.replies.length;X++)W=W.nextSibling,Y(Z.replies[X])}var H=[],W=D;Y(N);return{pdiv:W,replies:H}}function A(Y,H,W,Z,X){function ba(){M(na);N.addReply(ha,function(ra){ha.id=ra;N.replies.push(ha);-Q(na);W&&W()},function(ra){ea();L(na);b.handleError(ra,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},Z,X)}function ea(){F(ha,na,function(ra){ba()},!0)}var aa=r().pdiv,ha=b.newComment(Y,b.getCurrentUser());ha.pCommentId=N.id;null==N.replies&&(N.replies=[]);var na=c(ha,N.replies,aa,v+1);H?ea():ba()}if(d||!N.isResolved){y.style.display="none";var D=document.createElement("div");D.className="geCommentContainer";D.setAttribute("data-commentId",N.id);D.style.marginLeft=20*v+5+-"px";N.isResolved&&(q.style.opacity="0.7");var G=document.createElement("div");G.className="geCommentHeader";var O=document.createElement("img");O.className="geCommentUserImg";O.src=null!=N.user&&null!=N.user.pictureUrl?N.user.pictureUrl:Editor.userImage;G.appendChild(O);O=document.createElement("div");O.className="geCommentHeaderTxt";G.appendChild(O);var P=document.createElement("div");P.className="geCommentUsername";mxUtils.write(P,null!=N.user?N.user.displayName:mxResources.get("unknownUser"));-O.appendChild(P);P=document.createElement("div");P.className="geCommentDate";P.setAttribute("data-commentId",N.id);K(N,P);O.appendChild(P);D.appendChild(G);G=document.createElement("div");G.className="geCommentTxt";mxUtils.write(G,N.content||"");D.appendChild(G);N.isLocked&&(D.style.opacity="0.5");G=document.createElement("div");G.className="geCommentActions";var V=document.createElement("ul");V.className="geCommentActionsList";G.appendChild(V);f||N.isLocked||0!=v&&!k||m(mxResources.get("reply"),-function(){A("",!0)},N.isResolved);O=b.getCurrentUser();null==O||null==N.user||O.id!=N.user.id||f||N.isLocked||(m(mxResources.get("edit"),function(){function Y(){F(N,D,function(){M(D);N.editComment(N.content,function(){Q(D)},function(H){L(D);Y();b.handleError(H,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}Y()},N.isResolved),m(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){M(D);N.deleteComment(function(Y){if(!0===Y){Y=D.querySelector(".geCommentTxt");-Y.innerText="";mxUtils.write(Y,mxResources.get("msgDeleted"));var H=D.querySelectorAll(".geCommentAction");for(Y=0;Y<H.length;Y++)H[Y].parentNode.removeChild(H[Y]);Q(D);D.style.opacity="0.5"}else{H=r(N).replies;for(Y=0;Y<H.length;Y++)u.removeChild(H[Y]);for(Y=0;Y<R.length;Y++)if(R[Y]==N){R.splice(Y,1);break}y.style.display=0==u.getElementsByTagName("div").length?"block":"none"}},function(Y){L(D);b.handleError(Y,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},N.isResolved));-f||N.isLocked||0!=v||m(N.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(Y){function H(){var W=Y.target;W.innerText="";N.isResolved=!N.isResolved;mxUtils.write(W,N.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var Z=N.isResolved?"none":"",X=r(N).replies,ba="light-dark("+(N.isResolved?"ghostWhite":"white")+", transparent)",ea=0;ea<X.length;ea++){X[ea].style.backgroundColor=ba;for(var aa=X[ea].querySelectorAll(".geCommentAction"),ha=0;ha<aa.length;ha++)aa[ha]!=-W.parentNode&&(aa[ha].style.display=Z);U||(X[ea].style.display="none")}z()}N.isResolved?A(mxResources.get("reOpened")+": ",!0,H,!1,!0):A(mxResources.get("markedAsResolved"),!1,H,!0)});D.appendChild(G);null!=T?u.insertBefore(D,T.nextSibling):u.appendChild(D);for(T=0;null!=N.replies&&T<N.replies.length;T++)G=N.replies[T],G.isResolved=N.isResolved,c(G,N.replies,null,v+1,d);null!=n&&(n.comment.id==N.id?(d=N.content,N.content=n.comment.content,F(N,D,n.saveCallback,n.deleteOnCancel),N.content=d):null==-n.comment.id&&n.comment.pCommentId==N.id&&(u.appendChild(n.div),F(n.comment,n.div,n.saveCallback,n.deleteOnCancel)));return D}}var f=!b.canComment(),k=b.canReplyToReplies(),n=null,q=document.createElement("div");q.className="geCommentsWin";var t=EditorUi.compactUi?"26px":"30px",u=document.createElement("div");u.className="geCommentsList";u.style.bottom=parseInt(t)+7+"px";q.appendChild(u);var y=document.createElement("span");y.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(y,-mxResources.get("noCommentsFound"));var E=document.createElement("div");E.className="geToolbarContainer geCommentsToolbar";E.style.height=t;E.style.padding="3px 4px 4px 4px";t=document.createElement("a");t.className="geButton";if(!f){var I=t.cloneNode();I.style.backgroundImage="url("+Editor.plusImage+")";I.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(I,"click",function(N){function R(){F(T,v,function(d){M(v);b.addComment(d,function(m){d.id=m;J.push(d);Q(v)},function(m){L(v);-R();b.handleError(m,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var T=b.newComment("",b.getCurrentUser()),v=c(T,J,null,0);R();N.preventDefault();mxEvent.consume(N)});E.appendChild(I)}var C=t.cloneNode();C.style.backgroundImage="url("+Editor.checkImage+")";C.setAttribute("title",mxResources.get("showResolved"));var U=!1;mxEvent.addListener(C,"click",function(N){(U=!U)?C.classList.add("geActiveItem"):C.classList.remove("geActiveItem");S();N.preventDefault();mxEvent.consume(N)});-E.appendChild(C);b.commentsRefreshNeeded()&&(I=t.cloneNode(),I.style.backgroundImage="url("+Editor.refreshImage+")",I.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(I,"click",function(N){S();N.preventDefault();mxEvent.consume(N)}),E.appendChild(I));b.commentsSaveNeeded()&&(t=t.cloneNode(),t.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',t.setAttribute("title",mxResources.get("save")),t.className="geButton geAdaptiveAsset",mxEvent.addListener(t,-"click",function(N){B();N.preventDefault();mxEvent.consume(N)}),E.appendChild(t));q.appendChild(E);var J=[],S=mxUtils.bind(this,function(){this.hasError=!1;if(null!=n)try{n.div=n.div.cloneNode(!0);var N=n.div.querySelector(".geCommentEditTxtArea"),R=n.div.querySelector(".geCommentEditBtns");n.comment.content=N.value;N.parentNode.removeChild(N);R.parentNode.removeChild(R)}catch(T){b.handleError(T)}u.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+-mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";k=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(T){function v(d){if(null!=d){d.sort(function(r,A){return new Date(r.modifiedDate)-new Date(A.modifiedDate)});for(var m=0;m<d.length;m++)v(d[m].replies)}}T.sort(function(d,m){return new Date(d.modifiedDate)-new Date(m.modifiedDate)});u.innerText="";u.appendChild(y);y.style.display="block";J=T;for(T=0;T<J.length;T++)v(J[T].replies),c(J[T],J,null,0,U);null!=n&&null==n.comment.id&&-null==n.comment.pCommentId&&(u.appendChild(n.div),F(n.comment,n.div,n.saveCallback,n.deleteOnCancel))},mxUtils.bind(this,function(T){u.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(T&&T.message?": "+T.message:""));this.hasError=!0})):u.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});S();this.refreshComments=S;E=mxUtils.bind(this,function(){function N(m){var r=T[m.id];if(null!=r)for(K(m,r),r=0;null!=m.replies&&r<m.replies.length;r++)N(m.replies[r])}if(this.window.isVisible()){for(var R=-u.querySelectorAll(".geCommentDate"),T={},v=0;v<R.length;v++){var d=R[v];T[d.getAttribute("data-commentId")]=d}for(v=0;v<J.length;v++)N(J[v])}});setInterval(E,6E4);this.refreshCommentsTime=E;this.window=new mxWindow(mxResources.get("comments"),q,l,p,g,x,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,-function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,l,p,g,x,B,z,F,K,M,L){var Q=document.createElement("div");Q.style.textAlign="center";L=null!=L?L:44;var c=document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=L+"px";c.style.lineHeight="1.2em";mxUtils.write(c,l);Q.appendChild(c);null!=M&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",l=document.createElement("img"),l.setAttribute("src",M),c.appendChild(l),-Q.appendChild(c));M=document.createElement("div");M.style.textAlign="center";M.style.whiteSpace="nowrap";var f=document.createElement("input");f.setAttribute("type","checkbox");B=mxUtils.button(B||mxResources.get("cancel"),function(){b.hideDialog();null!=g&&g(f.checked)});B.className="geBtn";null!=F&&(B.innerHTML=F+"<br>"+B.innerHTML,B.style.display="inline-block",B.style.paddingBottom="8px",B.style.paddingTop="8px",B.style.height="auto",B.style.width="40%");b.editor.cancelFirst&&M.appendChild(B);-var k=mxUtils.button(x||mxResources.get("ok"),function(){b.hideDialog();null!=p&&p(f.checked)});M.appendChild(k);null!=z?(k.innerHTML=z+"<br>"+k.innerHTML+"<br>",k.style.display="inline-block",k.style.paddingBottom="8px",k.style.paddingTop="8px",k.style.height="auto",k.className="geBtn",k.style.width="40%"):k.className="geBtn gePrimaryBtn";b.editor.cancelFirst||M.appendChild(B);Q.appendChild(M);K?(M.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom=-"0px",c.appendChild(f),x=document.createElement("span"),mxUtils.write(x," "+mxResources.get("rememberThisSetting")),c.appendChild(x),Q.appendChild(c),mxEvent.addListener(x,"click",function(n){f.checked=!f.checked;mxEvent.consume(n)})):M.style.marginTop="12px";this.init=function(){k.focus()};this.container=Q},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};-HeadlessEditorUi.prototype.addTrees=function(){};HeadlessEditorUi.prototype.onBeforeUnload=function(){};HeadlessEditorUi.prototype.updateActionStates=function(){};var DrawioConfigEditor={installCss:function(){if(null==document.getElementById("geConfigEditorStyle")){var b=document.createElement("style");b.id="geConfigEditorStyle";b.textContent=DrawioConfigEditor.css;document.head.appendChild(b)}},install:function(b,l){function p(){if("function"===typeof l.onConfigChanged)l.onConfigChanged(JSON.parse(JSON.stringify(E)))}function g(r){var A=document.createElement("div");A.appendChild(document.createTextNode(r));return A.innerHTML}function x(r){return b.querySelector(r)}-function B(r){var A=x("#"+r+"-tags"),D="";I[r].forEach(function(G,O){D+='<span class="tag"><span>'+g(G)+'</span><button type="button" class="tag__remove" data-list="'+r+'" data-index="'+O+'">×</button></span>'});A.innerHTML=D;A.querySelectorAll(".tag__remove").forEach(function(G){G.addEventListener("click",function(){I[G.getAttribute("data-list")].splice(parseInt(G.getAttribute("data-index")),1);z(G.getAttribute("data-list"));B(G.getAttribute("data-list"))})})}function z(r){0<I[r].length?E[r]=-I[r].slice():delete E[r];p()}function F(r){function A(){var G=D.value.trim();G&&(I[r].push(G),D.value="",z(r),B(r))}var D=x("#"+r+"-input");x("#"+r+"-add").addEventListener("click",A);D.addEventListener("keydown",function(G){"Enter"===G.key&&(G.preventDefault(),A())});B(r)}function K(r){var A=x("#"+r+"-list");A.innerHTML="";C[r].forEach(function(D,G){var O="none"===D||"null"===D,P=document.createElement("div");P.className="color-swatch";P.title=O?D:"#"+D;O?P.style.cssText="background: transparent; background-image: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%), linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%); background-size: 8px 8px; background-position: 0 0, 4px 4px;":-P.style.background="#"+D;if(!O){var V=document.createElement("input");V.type="color";V.className="color-swatch__picker";V.value="#"+(3===D.length?D[0]+D[0]+D[1]+D[1]+D[2]+D[2]:D.padEnd(6,"0"));V.addEventListener("input",function(Y){return function(){var H=V.value.substring(1).toUpperCase();C[r][Y]=H;P.style.background="#"+H;P.title="#"+H;M(r)}}(G));P.appendChild(V)}D=document.createElement("button");D.className="color-swatch__delete";D.textContent="×";D.addEventListener("click",function(Y){return function(H){H.stopPropagation();-C[r].splice(Y,1);M(r);K(r)}}(G));P.appendChild(D);A.appendChild(P)})}function M(r){0<C[r].length?E[r]=C[r].slice():delete E[r];p()}function L(r){function A(){var P=G.value.trim().replace(/^#/,"");"none"===P||"null"===P?(C[r].push(P),G.value="",M(r),K(r)):/^[0-9A-Fa-f]{3,8}$/.test(P)&&(C[r].push(P.toUpperCase()),G.value="",M(r),K(r))}var D=x("#"+r+"-picker"),G=x("#"+r+"-input"),O=x("#"+r+"-add");D.addEventListener("input",function(){G.value=D.value.substring(1).toUpperCase()});O.addEventListener("click",-A);G.addEventListener("keydown",function(P){"Enter"===P.key&&(P.preventDefault(),A())});K(r)}function Q(r){var A=x("#"+r+"-editor");A.innerHTML="";J[r].forEach(function(D,G){var O=document.createElement("div");O.className="color-scheme-row";var P=document.createElement("span");P.className="color-scheme-row__label";P.textContent=G+1;O.appendChild(P);D.forEach(function(W,Z){if(null===W){var X=document.createElement("span");X.className="color-scheme-entry";X.innerHTML='<span style="color: var(--color-text-secondary); font-style: italic;">default</span>';-var ba=document.createElement("button");ba.className="color-scheme-entry__remove";ba.textContent="×";ba.addEventListener("click",function(ea,aa){return function(){J[r][ea].splice(aa,1);c(r);Q(r)}}(G,Z));X.appendChild(ba);O.appendChild(X)}else R.forEach(function(ea){if(W[ea]){var aa=document.createElement("span");aa.className="color-scheme-entry";var ha=document.createElement("span");ha.className="color-scheme-entry__swatch";ha.style.background=W[ea];var na=document.createElement("input");na.type=-"color";na.value=W[ea];na.addEventListener("input",function(ua,xa,qa){return function(){J[r][ua][xa][qa]=na.value;ha.style.background=na.value;c(r)}}(G,Z,ea));ha.appendChild(na);var ra=document.createElement("span");ra.className="color-scheme-entry__key";ra.textContent=ea.charAt(0).toUpperCase();ra.title=ea;var sa=document.createElement("button");sa.className="color-scheme-entry__remove";sa.textContent="×";sa.addEventListener("click",function(ua,xa,qa){return function(){delete J[r][ua][xa][qa];0===-Object.keys(J[r][ua][xa]).filter(function(Aa){return-1<R.indexOf(Aa)}).length&&J[r][ua].splice(xa,1);c(r);Q(r)}}(G,Z,ea));aa.appendChild(ha);aa.appendChild(ra);aa.appendChild(sa);O.appendChild(aa)}})});D=document.createElement("span");D.className="color-scheme-row__actions";P=document.createElement("button");P.className="color-scheme-row__btn";P.textContent="+";P.title="Add colour entry";P.addEventListener("click",function(W){return function(){J[r][W].push({fill:"#dae8fc",stroke:"#6c8ebf"});c(r);-Q(r)}}(G));var V=document.createElement("button");V.className="color-scheme-row__btn";V.textContent="ø";V.title="Add default (null) entry";V.addEventListener("click",function(W){return function(){J[r][W].unshift(null);c(r);Q(r)}}(G));var Y=document.createElement("button");Y.className="color-scheme-row__btn";Y.title="Add colour key to last entry";Y.textContent="key";Y.addEventListener("click",function(W){return function(){for(var Z=J[r][W],X=null,ba=Z.length-1;0<=ba;ba--)if(null!==Z[ba]){X=Z[ba];break}if(X){Z=-null;for(ba=0;ba<R.length;ba++)if(!X[R[ba]]){Z=R[ba];break}Z&&(X[Z]="#888888",c(r),Q(r))}}}(G));var H=document.createElement("button");H.className="color-scheme-row__btn";H.textContent="−";H.title="Remove row";H.addEventListener("click",function(W){return function(){J[r].splice(W,1);c(r);Q(r)}}(G));D.appendChild(V);D.appendChild(P);D.appendChild(Y);D.appendChild(H);O.appendChild(D);A.appendChild(O)})}function c(r){0<J[r].length?E[r]=JSON.parse(JSON.stringify(J[r])):delete E[r];p()}function f(r){x("#"+-r+"-addRow").addEventListener("click",function(){J[r].push([null,{fill:"#f5f5f5",stroke:"#666666"}]);c(r);Q(r)});Q(r)}function k(r){var A=x("#"+r+"-tags"),D="";U[r].forEach(function(G,O){D+='<span class="tag"><span>'+g(G)+'</span><button type="button" class="tag__remove" data-list="'+r+'" data-index="'+O+'">×</button></span>'});A.innerHTML=D;A.querySelectorAll(".tag__remove").forEach(function(G){G.addEventListener("click",function(){U[G.getAttribute("data-list")].splice(parseInt(G.getAttribute("data-index")),-1);n(G.getAttribute("data-list"));k(G.getAttribute("data-list"))})})}function n(r){0<U[r].length?E[r]=U[r].slice():delete E[r];p()}function q(r){function A(){var G=D.value.trim();G&&(U[r].push(G),D.value="",n(r),k(r))}var D=x("#"+r+"-input");x("#"+r+"-add").addEventListener("click",A);D.addEventListener("keydown",function(G){"Enter"===G.key&&(G.preventDefault(),A())});k(r)}function t(r){r=r||{};E={};I={defaultFonts:[],customFonts:[]};C={presetColors:[],customPresetColors:[],defaultColors:[]};U={enabledLibraries:[],-defaultCustomLibraries:[],hideMenuItems:[],hideMenus:[]};J={defaultColorSchemes:[],customColorSchemes:[]};Object.keys(r).forEach(function(A){var D=r[A];"defaultFonts"===A||"customFonts"===A?Array.isArray(D)&&(I[A]=D.map(function(G){return"object"===typeof G?G.fontFamily||"":String(G)}),E[A]=D):"presetColors"===A||"customPresetColors"===A||"defaultColors"===A?Array.isArray(D)&&(C[A]=D.map(function(G){return G||""}),E[A]=D):"defaultColorSchemes"===A||"customColorSchemes"===A?Array.isArray(D)&&(J[A]=-JSON.parse(JSON.stringify(D)),E[A]=D):"enabledLibraries"===A||"defaultCustomLibraries"===A||"hideMenuItems"===A||"hideMenus"===A?Array.isArray(D)&&(U[A]=D.map(function(G){return String(G)}),E[A]=D):E[A]=D});u()}function u(){b.querySelectorAll("[data-key]").forEach(function(O){if(!O.closest(".tri-toggle")){var P=O.getAttribute("data-key"),V="json"===O.getAttribute("data-type");O.value=void 0!==E[P]?V?JSON.stringify(E[P],null,2):E[P]:""}});var r=x("#cfg-tooltipMaxWidth"),A=x("#cfg-tooltipMaxWidthEnabled");-if(void 0!==E.tooltipMaxWidth){var D=0<E.tooltipMaxWidth;A.checked=D;r.disabled=!D;r.value=D?E.tooltipMaxWidth:""}else A.checked=!0,r.disabled=!1,r.value="";E.pageFormat?(x("#cfg-pageFormatWidth").value=E.pageFormat.width||"",x("#cfg-pageFormatHeight").value=E.pageFormat.height||""):(x("#cfg-pageFormatWidth").value="",x("#cfg-pageFormatHeight").value="");r=E.darkColor||"";/^#[0-9A-Fa-f]{6}$/.test(r)&&(x("#cfg-darkColorPicker").value=r);r=E.shadowColor||"";/^#[0-9A-Fa-f]{6}$/.test(r)&&(x("#cfg-shadowColorPicker").value=-r);b.querySelectorAll(".tri-toggle").forEach(function(O){var P=O.getAttribute("data-key");P=E[P];O.querySelectorAll("button").forEach(function(V){V.className=""});!0===P?O.querySelector('[data-value="true"]').className="active--true":!1===P?O.querySelector('[data-value="false"]').className="active--false":O.querySelector('[data-value="unset"]').className="active--unset"});["defaultFonts","customFonts"].forEach(B);["presetColors","customPresetColors","defaultColors"].forEach(K);["enabledLibraries",-"defaultCustomLibraries","hideMenuItems","hideMenus"].forEach(k);["defaultColorSchemes","customColorSchemes"].forEach(Q);if(E.defaultMacroParameters){var G=E.defaultMacroParameters;G.toolbarStyle&&(x("#cfg-dmp-toolbarStyle").value=G.toolbarStyle);G.links&&(x("#cfg-dmp-links").value=G.links);G.width&&(x("#cfg-dmp-width").value=G.width);["border","lightbox","simpleViewer"].forEach(function(O){var P=x("#cfg-dmp-"+O);void 0!==G[O]?(P.checked=G[O],P.indeterminate=!1,P.dataset.cycleState=G[O]?"checked":-"unchecked"):(P.indeterminate=!0,P.dataset.cycleState="indeterminate")})}}function y(r){if(r=r.trim().toLowerCase()){var A=r.split(/\s+/),D=new Set,G=new Set,O=0;d.forEach(function(P){A.every(function(V){return-1<P.keywords.indexOf(V)})&&(G.add(P.element),D.add(P.section),"section-title"!==P.type&&O++)});b.querySelectorAll(".config-section").forEach(function(P){P.classList.toggle("search-hidden",!D.has(P))});d.forEach(function(P){if("section-title"!==P.type&&D.has(P.section)){var V=!1;d.forEach(function(Y){"section-title"===-Y.type&&Y.section===P.section&&G.has(Y.element)&&(V=!0)});V?P.element.classList.remove("search-hidden"):P.element.classList.toggle("search-hidden",!G.has(P.element))}});v.textContent=O+" result"+(1!==O?"s":"")}else b.querySelectorAll(".config-section, .toggle-field, .field, .field-row").forEach(function(P){P.classList.remove("search-hidden")}),v.textContent=""}l=l||{};DrawioConfigEditor.installCss();b.classList.add("geConfigEditor");b.innerHTML=DrawioConfigEditor.html;var E={},I={defaultFonts:[],-customFonts:[]},C={presetColors:[],customPresetColors:[],defaultColors:[]},U={enabledLibraries:[],defaultCustomLibraries:[],hideMenuItems:[],hideMenus:[]},J={defaultColorSchemes:[],customColorSchemes:[]},S=l.editorContext||{},N={"general-toggles":[{key:"override",name:"Override",help:"Ignore user settings stored in the browser so the defaults in this configuration always apply"},{key:"compact",name:"Compact UI",help:"Enable compact user interface mode"},{key:"noAutoFocus",name:"No Auto Focus",help:"Disable auto-focus on startup"},+var CommentsWindow=function(b,l,p,g,x,A){function y(){for(var M=u.getElementsByTagName("div"),R=0,T=0;T<M.length;T++)"none"!=M[T].style.display&&M[T].parentNode==u&&R++;B.style.display=0==R?"block":"none"}function G(M,R,T,v){function d(){R.removeChild(z);R.removeChild(D);r.style.display="block";m.style.display="block"}n={div:R,comment:M,saveCallback:T,deleteOnCancel:v};var m=R.querySelector(".geCommentTxt"),r=R.querySelector(".geCommentActionsList"),z=document.createElement("textarea");z.className=+"geCommentEditTxtArea";z.style.minHeight=m.offsetHeight+"px";z.value=M.content;R.insertBefore(z,m);var D=document.createElement("div");D.className="geCommentEditBtns";var F=mxUtils.button(mxResources.get("cancel"),function(){v?(R.parentNode.removeChild(R),y()):d();n=null});F.className="geCommentEditBtn";D.appendChild(F);var N=mxUtils.button(mxResources.get("save"),function(){m.innerText="";M.content=z.value;mxUtils.write(m,M.content);d();T(M);n=null});mxEvent.addListener(z,"keydown",mxUtils.bind(this,+function(P){mxEvent.isConsumed(P)||((mxEvent.isControlDown(P)||mxClient.IS_MAC&&mxEvent.isMetaDown(P))&&13==P.keyCode?(N.click(),mxEvent.consume(P)):27==P.keyCode&&(F.click(),mxEvent.consume(P)))}));N.focus();N.className="geCommentEditBtn gePrimaryBtn";D.appendChild(N);R.insertBefore(D,m);r.style.display="none";m.style.display="none";z.focus()}function L(M,R){R.innerText="";M=new Date(M.modifiedDate);var T=b.timeSince(M);null==T&&(T=mxResources.get("lessThanAMinute"));mxUtils.write(R,mxResources.get("timeAgo",+[T],"{1} ago"));R.setAttribute("title",M.toLocaleDateString()+" "+M.toLocaleTimeString())}function O(M){var R=document.createElement("img");R.className="geCommentBusyImg";R.src=IMAGE_PATH+"/spin.gif";M.appendChild(R);M.busyImg=R}function J(M){M.style.border="1px solid red";M.busyImg.parentNode==M&&M.removeChild(M.busyImg)}function Q(M){M.style.border="";M.busyImg.parentNode==M&&M.removeChild(M.busyImg)}function c(M,R,T,v,d){function m(X,H,W){var Z=document.createElement("li");Z.className="geCommentAction";+var Y=document.createElement("a");Y.className="geCommentActionLnk";mxUtils.write(Y,X);Z.appendChild(Y);mxEvent.addListener(Y,"click",function(ba){H(ba,M);ba.preventDefault();mxEvent.consume(ba)});V.appendChild(Z);W&&(Z.style.display="none")}function r(){function X(Z){H.push(W);if(null!=Z.replies)for(var Y=0;Y<Z.replies.length;Y++)W=W.nextSibling,X(Z.replies[Y])}var H=[],W=D;X(M);return{pdiv:W,replies:H}}function z(X,H,W,Z,Y){function ba(){O(na);M.addReply(ha,function(ra){ha.id=ra;M.replies.push(ha);+Q(na);W&&W()},function(ra){ea();J(na);b.handleError(ra,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},Z,Y)}function ea(){G(ha,na,function(ra){ba()},!0)}var aa=r().pdiv,ha=b.newComment(X,b.getCurrentUser());ha.pCommentId=M.id;null==M.replies&&(M.replies=[]);var na=c(ha,M.replies,aa,v+1);H?ea():ba()}if(d||!M.isResolved){B.style.display="none";var D=document.createElement("div");D.className="geCommentContainer";D.setAttribute("data-commentId",M.id);D.style.marginLeft=20*v+5++"px";M.isResolved&&(q.style.opacity="0.7");var F=document.createElement("div");F.className="geCommentHeader";var N=document.createElement("img");N.className="geCommentUserImg";N.src=null!=M.user&&null!=M.user.pictureUrl?M.user.pictureUrl:Editor.userImage;F.appendChild(N);N=document.createElement("div");N.className="geCommentHeaderTxt";F.appendChild(N);var P=document.createElement("div");P.className="geCommentUsername";mxUtils.write(P,null!=M.user?M.user.displayName:mxResources.get("unknownUser"));+N.appendChild(P);P=document.createElement("div");P.className="geCommentDate";P.setAttribute("data-commentId",M.id);L(M,P);N.appendChild(P);D.appendChild(F);F=document.createElement("div");F.className="geCommentTxt";mxUtils.write(F,M.content||"");D.appendChild(F);M.isLocked&&(D.style.opacity="0.5");F=document.createElement("div");F.className="geCommentActions";var V=document.createElement("ul");V.className="geCommentActionsList";F.appendChild(V);f||M.isLocked||0!=v&&!k||m(mxResources.get("reply"),+function(){z("",!0)},M.isResolved);N=b.getCurrentUser();null==N||null==M.user||N.id!=M.user.id||f||M.isLocked||(m(mxResources.get("edit"),function(){function X(){G(M,D,function(){O(D);M.editComment(M.content,function(){Q(D)},function(H){J(D);X();b.handleError(H,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}X()},M.isResolved),m(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){O(D);M.deleteComment(function(X){if(!0===X){X=D.querySelector(".geCommentTxt");+X.innerText="";mxUtils.write(X,mxResources.get("msgDeleted"));var H=D.querySelectorAll(".geCommentAction");for(X=0;X<H.length;X++)H[X].parentNode.removeChild(H[X]);Q(D);D.style.opacity="0.5"}else{H=r(M).replies;for(X=0;X<H.length;X++)u.removeChild(H[X]);for(X=0;X<R.length;X++)if(R[X]==M){R.splice(X,1);break}B.style.display=0==u.getElementsByTagName("div").length?"block":"none"}},function(X){J(D);b.handleError(X,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},M.isResolved));+f||M.isLocked||0!=v||m(M.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(X){function H(){var W=X.target;W.innerText="";M.isResolved=!M.isResolved;mxUtils.write(W,M.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var Z=M.isResolved?"none":"",Y=r(M).replies,ba="light-dark("+(M.isResolved?"ghostWhite":"white")+", transparent)",ea=0;ea<Y.length;ea++){Y[ea].style.backgroundColor=ba;for(var aa=Y[ea].querySelectorAll(".geCommentAction"),ha=0;ha<aa.length;ha++)aa[ha]!=+W.parentNode&&(aa[ha].style.display=Z);U||(Y[ea].style.display="none")}y()}M.isResolved?z(mxResources.get("reOpened")+": ",!0,H,!1,!0):z(mxResources.get("markedAsResolved"),!1,H,!0)});D.appendChild(F);null!=T?u.insertBefore(D,T.nextSibling):u.appendChild(D);for(T=0;null!=M.replies&&T<M.replies.length;T++)F=M.replies[T],F.isResolved=M.isResolved,c(F,M.replies,null,v+1,d);null!=n&&(n.comment.id==M.id?(d=M.content,M.content=n.comment.content,G(M,D,n.saveCallback,n.deleteOnCancel),M.content=d):null==+n.comment.id&&n.comment.pCommentId==M.id&&(u.appendChild(n.div),G(n.comment,n.div,n.saveCallback,n.deleteOnCancel)));return D}}var f=!b.canComment(),k=b.canReplyToReplies(),n=null,q=document.createElement("div");q.className="geCommentsWin";var t=EditorUi.compactUi?"26px":"30px",u=document.createElement("div");u.className="geCommentsList";u.style.bottom=parseInt(t)+7+"px";q.appendChild(u);var B=document.createElement("span");B.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(B,+mxResources.get("noCommentsFound"));var E=document.createElement("div");E.className="geToolbarContainer geCommentsToolbar";E.style.height=t;E.style.padding="3px 4px 4px 4px";t=document.createElement("a");t.className="geButton";if(!f){var I=t.cloneNode();I.style.backgroundImage="url("+Editor.plusImage+")";I.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(I,"click",function(M){function R(){G(T,v,function(d){O(v);b.addComment(d,function(m){d.id=m;K.push(d);Q(v)},function(m){J(v);+R();b.handleError(m,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var T=b.newComment("",b.getCurrentUser()),v=c(T,K,null,0);R();M.preventDefault();mxEvent.consume(M)});E.appendChild(I)}var C=t.cloneNode();C.style.backgroundImage="url("+Editor.checkImage+")";C.setAttribute("title",mxResources.get("showResolved"));var U=!1;mxEvent.addListener(C,"click",function(M){(U=!U)?C.classList.add("geActiveItem"):C.classList.remove("geActiveItem");S();M.preventDefault();mxEvent.consume(M)});+E.appendChild(C);b.commentsRefreshNeeded()&&(I=t.cloneNode(),I.style.backgroundImage="url("+Editor.refreshImage+")",I.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(I,"click",function(M){S();M.preventDefault();mxEvent.consume(M)}),E.appendChild(I));b.commentsSaveNeeded()&&(t=t.cloneNode(),t.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',t.setAttribute("title",mxResources.get("save")),t.className="geButton geAdaptiveAsset",mxEvent.addListener(t,+"click",function(M){A();M.preventDefault();mxEvent.consume(M)}),E.appendChild(t));q.appendChild(E);var K=[],S=mxUtils.bind(this,function(){this.hasError=!1;if(null!=n)try{n.div=n.div.cloneNode(!0);var M=n.div.querySelector(".geCommentEditTxtArea"),R=n.div.querySelector(".geCommentEditBtns");n.comment.content=M.value;M.parentNode.removeChild(M);R.parentNode.removeChild(R)}catch(T){b.handleError(T)}u.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '++mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";k=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(T){function v(d){if(null!=d){d.sort(function(r,z){return new Date(r.modifiedDate)-new Date(z.modifiedDate)});for(var m=0;m<d.length;m++)v(d[m].replies)}}T.sort(function(d,m){return new Date(d.modifiedDate)-new Date(m.modifiedDate)});u.innerText="";u.appendChild(B);B.style.display="block";K=T;for(T=0;T<K.length;T++)v(K[T].replies),c(K[T],K,null,0,U);null!=n&&null==n.comment.id&&+null==n.comment.pCommentId&&(u.appendChild(n.div),G(n.comment,n.div,n.saveCallback,n.deleteOnCancel))},mxUtils.bind(this,function(T){u.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(T&&T.message?": "+T.message:""));this.hasError=!0})):u.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});S();this.refreshComments=S;E=mxUtils.bind(this,function(){function M(m){var r=T[m.id];if(null!=r)for(L(m,r),r=0;null!=m.replies&&r<m.replies.length;r++)M(m.replies[r])}if(this.window.isVisible()){for(var R=+u.querySelectorAll(".geCommentDate"),T={},v=0;v<R.length;v++){var d=R[v];T[d.getAttribute("data-commentId")]=d}for(v=0;v<K.length;v++)M(K[v])}});setInterval(E,6E4);this.refreshCommentsTime=E;this.window=new mxWindow(mxResources.get("comments"),q,l,p,g,x,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,+function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,l,p,g,x,A,y,G,L,O,J){var Q=document.createElement("div");Q.style.textAlign="center";J=null!=J?J:44;var c=document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=J+"px";c.style.lineHeight="1.2em";mxUtils.write(c,l);Q.appendChild(c);null!=O&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",l=document.createElement("img"),l.setAttribute("src",O),c.appendChild(l),+Q.appendChild(c));O=document.createElement("div");O.style.textAlign="center";O.style.whiteSpace="nowrap";var f=document.createElement("input");f.setAttribute("type","checkbox");A=mxUtils.button(A||mxResources.get("cancel"),function(){b.hideDialog();null!=g&&g(f.checked)});A.className="geBtn";null!=G&&(A.innerHTML=G+"<br>"+A.innerHTML,A.style.display="inline-block",A.style.paddingBottom="8px",A.style.paddingTop="8px",A.style.height="auto",A.style.width="40%");b.editor.cancelFirst&&O.appendChild(A);+var k=mxUtils.button(x||mxResources.get("ok"),function(){b.hideDialog();null!=p&&p(f.checked)});O.appendChild(k);null!=y?(k.innerHTML=y+"<br>"+k.innerHTML+"<br>",k.style.display="inline-block",k.style.paddingBottom="8px",k.style.paddingTop="8px",k.style.height="auto",k.className="geBtn",k.style.width="40%"):k.className="geBtn gePrimaryBtn";b.editor.cancelFirst||O.appendChild(A);Q.appendChild(O);L?(O.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom=+"0px",c.appendChild(f),x=document.createElement("span"),mxUtils.write(x," "+mxResources.get("rememberThisSetting")),c.appendChild(x),Q.appendChild(c),mxEvent.addListener(x,"click",function(n){f.checked=!f.checked;mxEvent.consume(n)})):O.style.marginTop="12px";this.init=function(){k.focus()};this.container=Q},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};+HeadlessEditorUi.prototype.addTrees=function(){};HeadlessEditorUi.prototype.onBeforeUnload=function(){};HeadlessEditorUi.prototype.updateActionStates=function(){};var DrawioConfigEditor={installCss:function(){if(null==document.getElementById("geConfigEditorStyle")){var b=document.createElement("style");b.id="geConfigEditorStyle";b.textContent=DrawioConfigEditor.css;document.head.appendChild(b)}},install:function(b,l){function p(){if("function"===typeof l.onConfigChanged)l.onConfigChanged(JSON.parse(JSON.stringify(E)))}function g(r){var z=document.createElement("div");z.appendChild(document.createTextNode(r));return z.innerHTML}function x(r){return b.querySelector(r)}+function A(r){var z=x("#"+r+"-tags"),D="";I[r].forEach(function(F,N){D+='<span class="tag"><span>'+g(F)+'</span><button type="button" class="tag__remove" data-list="'+r+'" data-index="'+N+'">×</button></span>'});z.innerHTML=D;z.querySelectorAll(".tag__remove").forEach(function(F){F.addEventListener("click",function(){I[F.getAttribute("data-list")].splice(parseInt(F.getAttribute("data-index")),1);y(F.getAttribute("data-list"));A(F.getAttribute("data-list"))})})}function y(r){0<I[r].length?E[r]=+I[r].slice():delete E[r];p()}function G(r){function z(){var F=D.value.trim();F&&(I[r].push(F),D.value="",y(r),A(r))}var D=x("#"+r+"-input");x("#"+r+"-add").addEventListener("click",z);D.addEventListener("keydown",function(F){"Enter"===F.key&&(F.preventDefault(),z())});A(r)}function L(r){var z=x("#"+r+"-list");z.innerHTML="";C[r].forEach(function(D,F){var N="none"===D||"null"===D,P=document.createElement("div");P.className="color-swatch";P.title=N?D:"#"+D;N?P.style.cssText="background: transparent; background-image: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%), linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%); background-size: 8px 8px; background-position: 0 0, 4px 4px;":+P.style.background="#"+D;if(!N){var V=document.createElement("input");V.type="color";V.className="color-swatch__picker";V.value="#"+(3===D.length?D[0]+D[0]+D[1]+D[1]+D[2]+D[2]:D.padEnd(6,"0"));V.addEventListener("input",function(X){return function(){var H=V.value.substring(1).toUpperCase();C[r][X]=H;P.style.background="#"+H;P.title="#"+H;O(r)}}(F));P.appendChild(V)}D=document.createElement("button");D.className="color-swatch__delete";D.textContent="×";D.addEventListener("click",function(X){return function(H){H.stopPropagation();+C[r].splice(X,1);O(r);L(r)}}(F));P.appendChild(D);z.appendChild(P)})}function O(r){0<C[r].length?E[r]=C[r].slice():delete E[r];p()}function J(r){function z(){var P=F.value.trim().replace(/^#/,"");"none"===P||"null"===P?(C[r].push(P),F.value="",O(r),L(r)):/^[0-9A-Fa-f]{3,8}$/.test(P)&&(C[r].push(P.toUpperCase()),F.value="",O(r),L(r))}var D=x("#"+r+"-picker"),F=x("#"+r+"-input"),N=x("#"+r+"-add");D.addEventListener("input",function(){F.value=D.value.substring(1).toUpperCase()});N.addEventListener("click",+z);F.addEventListener("keydown",function(P){"Enter"===P.key&&(P.preventDefault(),z())});L(r)}function Q(r){var z=x("#"+r+"-editor");z.innerHTML="";K[r].forEach(function(D,F){var N=document.createElement("div");N.className="color-scheme-row";var P=document.createElement("span");P.className="color-scheme-row__label";P.textContent=F+1;N.appendChild(P);D.forEach(function(W,Z){if(null===W){var Y=document.createElement("span");Y.className="color-scheme-entry";Y.innerHTML='<span style="color: var(--color-text-secondary); font-style: italic;">default</span>';+var ba=document.createElement("button");ba.className="color-scheme-entry__remove";ba.textContent="×";ba.addEventListener("click",function(ea,aa){return function(){K[r][ea].splice(aa,1);c(r);Q(r)}}(F,Z));Y.appendChild(ba);N.appendChild(Y)}else R.forEach(function(ea){if(W[ea]){var aa=document.createElement("span");aa.className="color-scheme-entry";var ha=document.createElement("span");ha.className="color-scheme-entry__swatch";ha.style.background=W[ea];var na=document.createElement("input");na.type=+"color";na.value=W[ea];na.addEventListener("input",function(ua,xa,qa){return function(){K[r][ua][xa][qa]=na.value;ha.style.background=na.value;c(r)}}(F,Z,ea));ha.appendChild(na);var ra=document.createElement("span");ra.className="color-scheme-entry__key";ra.textContent=ea.charAt(0).toUpperCase();ra.title=ea;var sa=document.createElement("button");sa.className="color-scheme-entry__remove";sa.textContent="×";sa.addEventListener("click",function(ua,xa,qa){return function(){delete K[r][ua][xa][qa];0===+Object.keys(K[r][ua][xa]).filter(function(Aa){return-1<R.indexOf(Aa)}).length&&K[r][ua].splice(xa,1);c(r);Q(r)}}(F,Z,ea));aa.appendChild(ha);aa.appendChild(ra);aa.appendChild(sa);N.appendChild(aa)}})});D=document.createElement("span");D.className="color-scheme-row__actions";P=document.createElement("button");P.className="color-scheme-row__btn";P.textContent="+";P.title="Add colour entry";P.addEventListener("click",function(W){return function(){K[r][W].push({fill:"#dae8fc",stroke:"#6c8ebf"});c(r);+Q(r)}}(F));var V=document.createElement("button");V.className="color-scheme-row__btn";V.textContent="ø";V.title="Add default (null) entry";V.addEventListener("click",function(W){return function(){K[r][W].unshift(null);c(r);Q(r)}}(F));var X=document.createElement("button");X.className="color-scheme-row__btn";X.title="Add colour key to last entry";X.textContent="key";X.addEventListener("click",function(W){return function(){for(var Z=K[r][W],Y=null,ba=Z.length-1;0<=ba;ba--)if(null!==Z[ba]){Y=Z[ba];break}if(Y){Z=+null;for(ba=0;ba<R.length;ba++)if(!Y[R[ba]]){Z=R[ba];break}Z&&(Y[Z]="#888888",c(r),Q(r))}}}(F));var H=document.createElement("button");H.className="color-scheme-row__btn";H.textContent="−";H.title="Remove row";H.addEventListener("click",function(W){return function(){K[r].splice(W,1);c(r);Q(r)}}(F));D.appendChild(V);D.appendChild(P);D.appendChild(X);D.appendChild(H);N.appendChild(D);z.appendChild(N)})}function c(r){0<K[r].length?E[r]=JSON.parse(JSON.stringify(K[r])):delete E[r];p()}function f(r){x("#"++r+"-addRow").addEventListener("click",function(){K[r].push([null,{fill:"#f5f5f5",stroke:"#666666"}]);c(r);Q(r)});Q(r)}function k(r){var z=x("#"+r+"-tags"),D="";U[r].forEach(function(F,N){D+='<span class="tag"><span>'+g(F)+'</span><button type="button" class="tag__remove" data-list="'+r+'" data-index="'+N+'">×</button></span>'});z.innerHTML=D;z.querySelectorAll(".tag__remove").forEach(function(F){F.addEventListener("click",function(){U[F.getAttribute("data-list")].splice(parseInt(F.getAttribute("data-index")),+1);n(F.getAttribute("data-list"));k(F.getAttribute("data-list"))})})}function n(r){0<U[r].length?E[r]=U[r].slice():delete E[r];p()}function q(r){function z(){var F=D.value.trim();F&&(U[r].push(F),D.value="",n(r),k(r))}var D=x("#"+r+"-input");x("#"+r+"-add").addEventListener("click",z);D.addEventListener("keydown",function(F){"Enter"===F.key&&(F.preventDefault(),z())});k(r)}function t(r){r=r||{};E={};I={defaultFonts:[],customFonts:[]};C={presetColors:[],customPresetColors:[],defaultColors:[]};U={enabledLibraries:[],+defaultCustomLibraries:[],hideMenuItems:[],hideMenus:[]};K={defaultColorSchemes:[],customColorSchemes:[]};Object.keys(r).forEach(function(z){var D=r[z];"defaultFonts"===z||"customFonts"===z?Array.isArray(D)&&(I[z]=D.map(function(F){return"object"===typeof F?F.fontFamily||"":String(F)}),E[z]=D):"presetColors"===z||"customPresetColors"===z||"defaultColors"===z?Array.isArray(D)&&(C[z]=D.map(function(F){return F||""}),E[z]=D):"defaultColorSchemes"===z||"customColorSchemes"===z?Array.isArray(D)&&(K[z]=+JSON.parse(JSON.stringify(D)),E[z]=D):"enabledLibraries"===z||"defaultCustomLibraries"===z||"hideMenuItems"===z||"hideMenus"===z?Array.isArray(D)&&(U[z]=D.map(function(F){return String(F)}),E[z]=D):E[z]=D});u()}function u(){b.querySelectorAll("[data-key]").forEach(function(N){if(!N.closest(".tri-toggle")){var P=N.getAttribute("data-key"),V="json"===N.getAttribute("data-type");N.value=void 0!==E[P]?V?JSON.stringify(E[P],null,2):E[P]:""}});var r=x("#cfg-tooltipMaxWidth"),z=x("#cfg-tooltipMaxWidthEnabled");+if(void 0!==E.tooltipMaxWidth){var D=0<E.tooltipMaxWidth;z.checked=D;r.disabled=!D;r.value=D?E.tooltipMaxWidth:""}else z.checked=!0,r.disabled=!1,r.value="";E.pageFormat?(x("#cfg-pageFormatWidth").value=E.pageFormat.width||"",x("#cfg-pageFormatHeight").value=E.pageFormat.height||""):(x("#cfg-pageFormatWidth").value="",x("#cfg-pageFormatHeight").value="");r=E.darkColor||"";/^#[0-9A-Fa-f]{6}$/.test(r)&&(x("#cfg-darkColorPicker").value=r);r=E.shadowColor||"";/^#[0-9A-Fa-f]{6}$/.test(r)&&(x("#cfg-shadowColorPicker").value=+r);b.querySelectorAll(".tri-toggle").forEach(function(N){var P=N.getAttribute("data-key");P=E[P];N.querySelectorAll("button").forEach(function(V){V.className=""});!0===P?N.querySelector('[data-value="true"]').className="active--true":!1===P?N.querySelector('[data-value="false"]').className="active--false":N.querySelector('[data-value="unset"]').className="active--unset"});["defaultFonts","customFonts"].forEach(A);["presetColors","customPresetColors","defaultColors"].forEach(L);["enabledLibraries",+"defaultCustomLibraries","hideMenuItems","hideMenus"].forEach(k);["defaultColorSchemes","customColorSchemes"].forEach(Q);if(E.defaultMacroParameters){var F=E.defaultMacroParameters;F.toolbarStyle&&(x("#cfg-dmp-toolbarStyle").value=F.toolbarStyle);F.links&&(x("#cfg-dmp-links").value=F.links);F.width&&(x("#cfg-dmp-width").value=F.width);["border","lightbox","simpleViewer"].forEach(function(N){var P=x("#cfg-dmp-"+N);void 0!==F[N]?(P.checked=F[N],P.indeterminate=!1,P.dataset.cycleState=F[N]?"checked":+"unchecked"):(P.indeterminate=!0,P.dataset.cycleState="indeterminate")})}}function B(r){if(r=r.trim().toLowerCase()){var z=r.split(/\s+/),D=new Set,F=new Set,N=0;d.forEach(function(P){z.every(function(V){return-1<P.keywords.indexOf(V)})&&(F.add(P.element),D.add(P.section),"section-title"!==P.type&&N++)});b.querySelectorAll(".config-section").forEach(function(P){P.classList.toggle("search-hidden",!D.has(P))});d.forEach(function(P){if("section-title"!==P.type&&D.has(P.section)){var V=!1;d.forEach(function(X){"section-title"===+X.type&&X.section===P.section&&F.has(X.element)&&(V=!0)});V?P.element.classList.remove("search-hidden"):P.element.classList.toggle("search-hidden",!F.has(P.element))}});v.textContent=N+" result"+(1!==N?"s":"")}else b.querySelectorAll(".config-section, .toggle-field, .field, .field-row").forEach(function(P){P.classList.remove("search-hidden")}),v.textContent=""}l=l||{};DrawioConfigEditor.installCss();b.classList.add("geConfigEditor");b.innerHTML=DrawioConfigEditor.html;var E={},I={defaultFonts:[],+customFonts:[]},C={presetColors:[],customPresetColors:[],defaultColors:[]},U={enabledLibraries:[],defaultCustomLibraries:[],hideMenuItems:[],hideMenus:[]},K={defaultColorSchemes:[],customColorSchemes:[]},S=l.editorContext||{},M={"general-toggles":[{key:"override",name:"Override",help:"Ignore user settings stored in the browser so the defaults in this configuration always apply"},{key:"compact",name:"Compact UI",help:"Enable compact user interface mode"},{key:"noAutoFocus",name:"No Auto Focus",help:"Disable auto-focus on startup"},{key:"showSplashOnStart",name:"Show Splash on Start",help:"Show the splash screen with storage options on startup"},{key:"updateDefaultStyle",name:"Update Default Style",help:"Update defaults when styles change"},{key:"mathOutputSize",name:"Math Output Size",help:"Size labels, view bounds and initial fit to the rendered math output instead of the formula source"},{key:"browserTranslate",name:"Browser Translate",help:"Mirror diagram text for browser translation engines (e.g. Chrome Translate)"}],"canvas-toggles":[{key:"defaultPageVisible",name:"Page Visible",help:"Show page outline on canvas"},{key:"defaultGridEnabled",name:"Grid Enabled",help:"Show grid on canvas"},{key:"defaultConnectable",name:"Default Connectable",help:"Shapes are connectable by default"},{key:"defaultConnectionArrowsEnabled",name:"Connection Arrows",help:"Show arrows when hovering connections"},{key:"copyOnConnect",name:"Copy on Connect",help:"Create a copy of the source shape for connections that end on the canvas"},{key:"defaultFoldingEnabled",name:"Folding Enabled",help:"Enable shape folding (collapse/expand)"},{key:"zoomWheel",name:"Zoom with Mouse Wheel",help:"Use mouse wheel for zoom without modifiers"},{key:"simpleLabels",name:"Simple Labels",help:"Disable word wrap and HTML for labels"},{key:"optimizeHtmlLabels",name:"Optimize HTML Labels",help:"Remove unnecessary spans from HTML labels when editing stops"},{key:"stopEditingOnEnter",name:"Stop Editing on Enter",help:"Enter key stops label editing, Shift+Enter inserts a line break"},{key:"pasteAtMousePointer",@@ -14444,68 +14448,68 @@ name:"Paste at Mouse",help:"Paste elements at mouse pointer location"},{key:"fit"appearance-toggles":[{key:"enableCssDarkMode",name:"CSS Dark Mode",help:"Use CSS for dark mode rendering"},{key:"enableLightDarkColors",name:"Light/Dark Colors",help:"Use CSS light-dark() color function"},{key:"enableAnimations",name:"Enable Animations",help:"Enable shape and layout animations"},{key:"insertAnimations",name:"Insert Animations",help:"Show pop animation when inserting shapes from the sidebar"}],"sidebar-toggles":[{key:"sidebarTitles",name:"Sidebar Titles",help:"Show titles in the sidebar"},{key:"expandLibraries",name:"Expand Libraries",help:"Libraries expanded by default"}],"library-toggles":[{key:"enableCustomLibraries",name:"Enable Custom Libraries",help:"Allow open and new library functions"},{key:"appendCustomLibraries",name:"Append Custom Libraries",help:"Custom libraries appear after built-in ones"}],"export-toggles":[{key:"compressXml",name:"Compress XML",help:"Compress XML output in saved files"},{key:"compressStyles",name:"Compress Styles",help:"Deduplicate repeated inline images and stencils into a shared lookup table. Only readable by draw.io 29.3.1 and later.",experimental:!0,helpLink:"https://www.drawio.com/docs/reference/style-compression/"},{key:"includeDiagram",name:"Include Diagram in Export",help:"Include diagram data in export dialogs"},{key:"enableExportUrl",name:"Enable Export URL",help:"Enable the export URL feature"},{key:"lockdown",name:"Lockdown",help:"Disable data transmission apart from storage"},{key:"restrictExport",name:"Restrict Export",help:"Disable exporting diagrams to other formats"},{key:"enableNativeClipboard",name:"Native Clipboard",-help:"Use native system clipboard"},{key:"replaceSvgDataUris",name:"Replace SVG Data URIs",help:"Replace data URIs with SVG sub-trees in export"},{key:"foreignObjectImages",name:"Foreign Object Images",help:"Replace foreignObject with images"},{key:"embedSvgFonts",name:"Embed SVG Fonts",help:"Embed fonts as data URIs in exported and saved SVG files, disable to keep external font references"},{key:"removeImageMetadata",name:"Remove Image Metadata",help:"Strip metadata from images"},{key:"expandPatternsForPrint",-name:"Expand Patterns for Print",help:"Expand patterns to visible graphics during print/PDF export"}],"advanced-toggles":[{key:"shareCursorPosition",name:"Share Cursor Position",help:"Share cursor in real-time collaboration"},{key:"showRemoteCursors",name:"Show Remote Cursors",help:"Display other users' cursors"},{key:"oneDriveInlinePicker",name:"OneDrive Inline Picker",help:"Use inline picker for OneDrive"},{key:"enableCustomGitLabUrl",name:"Enable Custom GitLab URL",help:"Allow ?gitlab= / ?gitlab-id= URL parameters to override the default GitLab server. Enable only for self-hosted GitLab deployments."}],-"embedding-toggles":[{key:"passiveScroll",name:"Passive Scroll",help:"Enable passive scroll event listeners"},{key:"noResizers",name:"No Resizers",help:"Hide shape resize handles"},{key:"preserveViewState",name:"Preserve View State",help:"Preserve view state in embed mode"},{key:"useInternalClipboard",name:"Use Internal Clipboard",help:"Use internal clipboard instead of native"}],"ai-toggles":[{key:"enableAi",name:"Enable AI",help:"Enable AI diagram generation"}],"confluence-cloud-toggles":[{key:"simpleViewer",-name:"Simple Viewer",help:"Use simple viewer for all diagrams"},{key:"disableVersioning",name:"Disable Versioning",help:"Disable diagram versioning"},{key:"hiResPreview",name:"Hi-Res Preview",help:"Generate high-resolution preview images"},{key:"autoCropViewer",name:"Auto Crop Viewer",help:"Auto-crop viewer to fit diagram bounds"},{key:"enableCssDarkMode",name:"CSS Dark Mode",help:"Enable CSS-based dark mode for viewer diagrams"},{key:"viewerCanExceedPageWidth",name:"Viewer Can Exceed Page Width",-help:"Allow the viewer to exceed the page width"},{key:"inplaceEdits",name:"In-place Edits",help:"Allow launching the editor from the viewer"},{key:"lockdown",name:"Lockdown",help:"Disable data transmission outside Confluence"},{key:"translateDiagrams",name:"Translate Diagrams",help:"Enable automatic translation of diagram labels"},{key:"generateSVGs",name:"Generate SVGs",help:"Generate SVG previews for diagrams"}],"confluence-toggles":[{key:"debug",name:"Debug",help:"Enable debug output"},{key:"inplaceEdits",-name:"In-place Edits",help:"Allow launching editor from viewer"},{key:"forceSimpleViewer",name:"Force Simple Viewer",help:"Force simple viewer for all diagrams"}]};if(null!=l.isDesktop?l.isDesktop:0<=navigator.userAgent.indexOf("Electron"))N["font-toggles"]=[{key:"enableLocalFonts",name:"Local Fonts",help:"Scan and list locally installed fonts in the font picker"}],N["desktop-toggles"]=[{key:"desktopAutoSync",name:"Desktop Auto Sync",help:"Auto-sync when local file changes"}];var R=["fill","stroke",-"gradient","font"],T=x("#searchInput"),v=x("#searchCount"),d=[],m;T.addEventListener("input",function(){clearTimeout(m);m=setTimeout(function(){y(T.value)},150)});T.addEventListener("keydown",function(r){"Escape"===r.key&&(T.value="",y(""),T.blur())});(function(){Object.keys(N).forEach(function(r){var A=x("#"+r);if(A){A.classList.add("toggle-list");var D="";N[r].forEach(function(G){D+='<div class="toggle-field"><div class="toggle-field__label"><span class="toggle-field__name">'+G.name+(G.experimental?-' <span class="toggle-field__experimental" title="Experimental feature">experimental</span>':"")+'</span><span class="toggle-field__help">'+G.help+" <code>"+G.key+"</code>"+(G.helpLink?' <a class="toggle-field__helplink" href="'+G.helpLink+'" target="_blank" rel="noopener" title="Learn more">?</a>':"")+'</span></div><div class="tri-toggle" data-key="'+G.key+'"><button type="button" data-value="unset" class="active--unset" title="Not set (use default)">—</button><button type="button" data-value="true" title="Enabled">On</button><button type="button" data-value="false" title="Disabled">Off</button></div></div>'});-A.innerHTML=D}});b.querySelectorAll(".tri-toggle").forEach(function(r){r.querySelectorAll("button").forEach(function(A){A.addEventListener("click",function(){var D=r.getAttribute("data-key"),G=A.getAttribute("data-value");r.querySelectorAll("button").forEach(function(O){O.className=""});A.className="active--"+G;"unset"===G?delete E[D]:E[D]="true"===G;p()})})})})();(function(){b.querySelectorAll("[data-key]").forEach(function(r){if(!r.classList.contains("tri-toggle")&&!r.closest(".tri-toggle")){var A=-r.getAttribute("data-key"),D="json"===r.getAttribute("data-type");r.addEventListener("input",function(){var G=r.value.trim();if(""===G)delete E[A];else if("number"===r.type)G=parseFloat(G),isNaN(G)||(E[A]=G);else if(D)try{E[A]=JSON.parse(G)}catch(O){}else E[A]=G;p()});"SELECT"===r.tagName&&r.addEventListener("change",function(){var G=r.value;""===G?delete E[A]:E[A]=G;p()})}})})();(function(){[{picker:"cfg-darkColorPicker",text:"cfg-darkColor"},{picker:"cfg-shadowColorPicker",text:"cfg-shadowColor"}].forEach(function(r){var A=-x("#"+r.picker),D=x("#"+r.text);A.addEventListener("input",function(){D.value=A.value.toUpperCase();D.dispatchEvent(new Event("input"))});D.addEventListener("input",function(){/^#[0-9A-Fa-f]{6}$/.test(D.value)&&(A.value=D.value)})})})();(function(){function r(){var G=parseInt(A.value),O=parseInt(D.value);isNaN(G)||isNaN(O)?""===A.value&&""===D.value&&delete E.pageFormat:E.pageFormat={width:G,height:O};p()}var A=x("#cfg-pageFormatWidth"),D=x("#cfg-pageFormatHeight");A.addEventListener("input",r);D.addEventListener("input",-r)})();(function(){function r(){A.disabled=!D.checked;if(D.checked){var G=parseInt(A.value);!isNaN(G)&&0<G?E.tooltipMaxWidth=G:delete E.tooltipMaxWidth}else E.tooltipMaxWidth=0;p()}var A=x("#cfg-tooltipMaxWidth"),D=x("#cfg-tooltipMaxWidthEnabled");D.addEventListener("change",r);A.addEventListener("input",r)})();F("defaultFonts");F("customFonts");L("presetColors");L("customPresetColors");L("defaultColors");q("enabledLibraries");q("defaultCustomLibraries");q("hideMenuItems");q("hideMenus");f("defaultColorSchemes");-f("customColorSchemes");(function(){function r(){var Y={},H=!1;A.value&&(Y.toolbarStyle=A.value,H=!0);D.value&&(Y.links=D.value,H=!0);G.value&&(Y.width=parseInt(G.value),H=!0);!1===O.indeterminate&&(Y.border=O.checked,H=!0);!1===P.indeterminate&&(Y.lightbox=P.checked,H=!0);!1===V.indeterminate&&(Y.simpleViewer=V.checked,H=!0);H?E.defaultMacroParameters=Y:delete E.defaultMacroParameters;p()}var A=x("#cfg-dmp-toolbarStyle"),D=x("#cfg-dmp-links"),G=x("#cfg-dmp-width"),O=x("#cfg-dmp-border"),P=x("#cfg-dmp-lightbox"),-V=x("#cfg-dmp-simpleViewer");[O,P,V].forEach(function(Y){Y.indeterminate=!0;Y.dataset.cycleState="indeterminate";Y.addEventListener("click",function(){"indeterminate"===Y.dataset.cycleState?(Y.checked=!0,Y.indeterminate=!1,Y.dataset.cycleState="checked"):"checked"===Y.dataset.cycleState?(Y.checked=!1,Y.indeterminate=!1,Y.dataset.cycleState="unchecked"):(Y.checked=!1,Y.indeterminate=!0,Y.dataset.cycleState="indeterminate");r()});Y.addEventListener("mousedown",function(H){H.preventDefault()})});A.addEventListener("change",-r);D.addEventListener("change",r);G.addEventListener("input",r)})();(function(){[{btnId:"useCurrentVertexStyle",textareaId:"cfg-defaultVertexStyle",key:"currentVertexStyle"},{btnId:"useCurrentEdgeStyle",textareaId:"cfg-defaultEdgeStyle",key:"currentEdgeStyle"}].forEach(function(r){var A=S[r.key];if(null!=A&&"object"===typeof A&&0<Object.keys(A).length){var D=x("#"+r.btnId);D.style.display="";D.addEventListener("click",function(){var G=x("#"+r.textareaId);G.value=JSON.stringify(A,null,2);G.dispatchEvent(new Event("input"))})}})})();-(function(){d=[];b.querySelectorAll(".toggle-field").forEach(function(r){var A=r.querySelector(".tri-toggle"),D=A?A.getAttribute("data-key"):"",G=r.querySelector(".toggle-field__name"),O=r.querySelector(".toggle-field__help");A=r.closest(".config-section");D=(D+" "+(G?G.textContent:"")+" "+(O?O.textContent:"")).toLowerCase();d.push({element:r,section:A,keywords:D,type:"toggle"})});b.querySelectorAll(".config-section .field").forEach(function(r){if(!r.parentElement.classList.contains("field-row")){var A=-r.closest(".config-section"),D=r.textContent.toLowerCase();r.querySelectorAll("[data-key]").forEach(function(G){D+=" "+G.getAttribute("data-key")});d.push({element:r,section:A,keywords:D,type:"field"})}});b.querySelectorAll(".config-section .field-row").forEach(function(r){var A=r.closest(".config-section"),D=r.textContent.toLowerCase();r.querySelectorAll("[data-key]").forEach(function(G){D+=" "+G.getAttribute("data-key")});r.querySelectorAll("input, select, textarea").forEach(function(G){G.id&&(D+=-" "+G.id.replace("cfg-","").replace("cfg-dmp-",""))});d.push({element:r,section:A,keywords:D,type:"field-row"})});b.querySelectorAll(".config-section").forEach(function(r){var A=r.querySelector(".card__title");A&&d.push({element:r,section:r,keywords:A.textContent.toLowerCase(),type:"section-title"})})})();t(l.initialConfig||{});l.darkMode&&b.classList.add("dark");l.highContrast&&b.classList.add("high-contrast");return{setConfig:function(r){t(r||{})},getConfig:function(){return JSON.parse(JSON.stringify(E))},+help:"Use native system clipboard"},{key:"replaceSvgDataUris",name:"Replace SVG Data URIs",help:"Replace data URIs with SVG sub-trees in export"},{key:"foreignObjectImages",name:"Foreign Object Images",help:"Replace foreignObject with images"},{key:"embedSvgFonts",name:"Embed SVG Fonts",help:"Default for embedding fonts as data URIs in exported and saved SVG files, can be overridden per file in the file properties"},{key:"removeImageMetadata",name:"Remove Image Metadata",help:"Strip metadata from images"},+{key:"expandPatternsForPrint",name:"Expand Patterns for Print",help:"Expand patterns to visible graphics during print/PDF export"}],"advanced-toggles":[{key:"shareCursorPosition",name:"Share Cursor Position",help:"Share cursor in real-time collaboration"},{key:"showRemoteCursors",name:"Show Remote Cursors",help:"Display other users' cursors"},{key:"oneDriveInlinePicker",name:"OneDrive Inline Picker",help:"Use inline picker for OneDrive"},{key:"enableCustomGitLabUrl",name:"Enable Custom GitLab URL",+help:"Allow ?gitlab= / ?gitlab-id= URL parameters to override the default GitLab server. Enable only for self-hosted GitLab deployments."}],"embedding-toggles":[{key:"passiveScroll",name:"Passive Scroll",help:"Enable passive scroll event listeners"},{key:"noResizers",name:"No Resizers",help:"Hide shape resize handles"},{key:"preserveViewState",name:"Preserve View State",help:"Preserve view state in embed mode"},{key:"useInternalClipboard",name:"Use Internal Clipboard",help:"Use internal clipboard instead of native"}],+"ai-toggles":[{key:"enableAi",name:"Enable AI",help:"Enable AI diagram generation"}],"confluence-cloud-toggles":[{key:"simpleViewer",name:"Simple Viewer",help:"Use simple viewer for all diagrams"},{key:"disableVersioning",name:"Disable Versioning",help:"Disable diagram versioning"},{key:"hiResPreview",name:"Hi-Res Preview",help:"Generate high-resolution preview images"},{key:"autoCropViewer",name:"Auto Crop Viewer",help:"Auto-crop viewer to fit diagram bounds"},{key:"enableCssDarkMode",name:"CSS Dark Mode",+help:"Enable CSS-based dark mode for viewer diagrams"},{key:"viewerCanExceedPageWidth",name:"Viewer Can Exceed Page Width",help:"Allow the viewer to exceed the page width"},{key:"inplaceEdits",name:"In-place Edits",help:"Allow launching the editor from the viewer"},{key:"lockdown",name:"Lockdown",help:"Disable data transmission outside Confluence"},{key:"translateDiagrams",name:"Translate Diagrams",help:"Enable automatic translation of diagram labels"},{key:"generateSVGs",name:"Generate SVGs",help:"Generate SVG previews for diagrams"}],+"confluence-toggles":[{key:"debug",name:"Debug",help:"Enable debug output"},{key:"inplaceEdits",name:"In-place Edits",help:"Allow launching editor from viewer"},{key:"forceSimpleViewer",name:"Force Simple Viewer",help:"Force simple viewer for all diagrams"}]};if(null!=l.isDesktop?l.isDesktop:0<=navigator.userAgent.indexOf("Electron"))M["font-toggles"]=[{key:"enableLocalFonts",name:"Local Fonts",help:"Scan and list locally installed fonts in the font picker"}],M["desktop-toggles"]=[{key:"desktopAutoSync",+name:"Desktop Auto Sync",help:"Auto-sync when local file changes"}];var R=["fill","stroke","gradient","font"],T=x("#searchInput"),v=x("#searchCount"),d=[],m;T.addEventListener("input",function(){clearTimeout(m);m=setTimeout(function(){B(T.value)},150)});T.addEventListener("keydown",function(r){"Escape"===r.key&&(T.value="",B(""),T.blur())});(function(){Object.keys(M).forEach(function(r){var z=x("#"+r);if(z){z.classList.add("toggle-list");var D="";M[r].forEach(function(F){D+='<div class="toggle-field"><div class="toggle-field__label"><span class="toggle-field__name">'++F.name+(F.experimental?' <span class="toggle-field__experimental" title="Experimental feature">experimental</span>':"")+'</span><span class="toggle-field__help">'+F.help+" <code>"+F.key+"</code>"+(F.helpLink?' <a class="toggle-field__helplink" href="'+F.helpLink+'" target="_blank" rel="noopener" title="Learn more">?</a>':"")+'</span></div><div class="tri-toggle" data-key="'+F.key+'"><button type="button" data-value="unset" class="active--unset" title="Not set (use default)">—</button><button type="button" data-value="true" title="Enabled">On</button><button type="button" data-value="false" title="Disabled">Off</button></div></div>'});+z.innerHTML=D}});b.querySelectorAll(".tri-toggle").forEach(function(r){r.querySelectorAll("button").forEach(function(z){z.addEventListener("click",function(){var D=r.getAttribute("data-key"),F=z.getAttribute("data-value");r.querySelectorAll("button").forEach(function(N){N.className=""});z.className="active--"+F;"unset"===F?delete E[D]:E[D]="true"===F;p()})})})})();(function(){b.querySelectorAll("[data-key]").forEach(function(r){if(!r.classList.contains("tri-toggle")&&!r.closest(".tri-toggle")){var z=+r.getAttribute("data-key"),D="json"===r.getAttribute("data-type");r.addEventListener("input",function(){var F=r.value.trim();if(""===F)delete E[z];else if("number"===r.type)F=parseFloat(F),isNaN(F)||(E[z]=F);else if(D)try{E[z]=JSON.parse(F)}catch(N){}else E[z]=F;p()});"SELECT"===r.tagName&&r.addEventListener("change",function(){var F=r.value;""===F?delete E[z]:E[z]=F;p()})}})})();(function(){[{picker:"cfg-darkColorPicker",text:"cfg-darkColor"},{picker:"cfg-shadowColorPicker",text:"cfg-shadowColor"}].forEach(function(r){var z=+x("#"+r.picker),D=x("#"+r.text);z.addEventListener("input",function(){D.value=z.value.toUpperCase();D.dispatchEvent(new Event("input"))});D.addEventListener("input",function(){/^#[0-9A-Fa-f]{6}$/.test(D.value)&&(z.value=D.value)})})})();(function(){function r(){var F=parseInt(z.value),N=parseInt(D.value);isNaN(F)||isNaN(N)?""===z.value&&""===D.value&&delete E.pageFormat:E.pageFormat={width:F,height:N};p()}var z=x("#cfg-pageFormatWidth"),D=x("#cfg-pageFormatHeight");z.addEventListener("input",r);D.addEventListener("input",+r)})();(function(){function r(){z.disabled=!D.checked;if(D.checked){var F=parseInt(z.value);!isNaN(F)&&0<F?E.tooltipMaxWidth=F:delete E.tooltipMaxWidth}else E.tooltipMaxWidth=0;p()}var z=x("#cfg-tooltipMaxWidth"),D=x("#cfg-tooltipMaxWidthEnabled");D.addEventListener("change",r);z.addEventListener("input",r)})();G("defaultFonts");G("customFonts");J("presetColors");J("customPresetColors");J("defaultColors");q("enabledLibraries");q("defaultCustomLibraries");q("hideMenuItems");q("hideMenus");f("defaultColorSchemes");+f("customColorSchemes");(function(){function r(){var X={},H=!1;z.value&&(X.toolbarStyle=z.value,H=!0);D.value&&(X.links=D.value,H=!0);F.value&&(X.width=parseInt(F.value),H=!0);!1===N.indeterminate&&(X.border=N.checked,H=!0);!1===P.indeterminate&&(X.lightbox=P.checked,H=!0);!1===V.indeterminate&&(X.simpleViewer=V.checked,H=!0);H?E.defaultMacroParameters=X:delete E.defaultMacroParameters;p()}var z=x("#cfg-dmp-toolbarStyle"),D=x("#cfg-dmp-links"),F=x("#cfg-dmp-width"),N=x("#cfg-dmp-border"),P=x("#cfg-dmp-lightbox"),+V=x("#cfg-dmp-simpleViewer");[N,P,V].forEach(function(X){X.indeterminate=!0;X.dataset.cycleState="indeterminate";X.addEventListener("click",function(){"indeterminate"===X.dataset.cycleState?(X.checked=!0,X.indeterminate=!1,X.dataset.cycleState="checked"):"checked"===X.dataset.cycleState?(X.checked=!1,X.indeterminate=!1,X.dataset.cycleState="unchecked"):(X.checked=!1,X.indeterminate=!0,X.dataset.cycleState="indeterminate");r()});X.addEventListener("mousedown",function(H){H.preventDefault()})});z.addEventListener("change",+r);D.addEventListener("change",r);F.addEventListener("input",r)})();(function(){[{btnId:"useCurrentVertexStyle",textareaId:"cfg-defaultVertexStyle",key:"currentVertexStyle"},{btnId:"useCurrentEdgeStyle",textareaId:"cfg-defaultEdgeStyle",key:"currentEdgeStyle"}].forEach(function(r){var z=S[r.key];if(null!=z&&"object"===typeof z&&0<Object.keys(z).length){var D=x("#"+r.btnId);D.style.display="";D.addEventListener("click",function(){var F=x("#"+r.textareaId);F.value=JSON.stringify(z,null,2);F.dispatchEvent(new Event("input"))})}})})();+(function(){d=[];b.querySelectorAll(".toggle-field").forEach(function(r){var z=r.querySelector(".tri-toggle"),D=z?z.getAttribute("data-key"):"",F=r.querySelector(".toggle-field__name"),N=r.querySelector(".toggle-field__help");z=r.closest(".config-section");D=(D+" "+(F?F.textContent:"")+" "+(N?N.textContent:"")).toLowerCase();d.push({element:r,section:z,keywords:D,type:"toggle"})});b.querySelectorAll(".config-section .field").forEach(function(r){if(!r.parentElement.classList.contains("field-row")){var z=+r.closest(".config-section"),D=r.textContent.toLowerCase();r.querySelectorAll("[data-key]").forEach(function(F){D+=" "+F.getAttribute("data-key")});d.push({element:r,section:z,keywords:D,type:"field"})}});b.querySelectorAll(".config-section .field-row").forEach(function(r){var z=r.closest(".config-section"),D=r.textContent.toLowerCase();r.querySelectorAll("[data-key]").forEach(function(F){D+=" "+F.getAttribute("data-key")});r.querySelectorAll("input, select, textarea").forEach(function(F){F.id&&(D+=+" "+F.id.replace("cfg-","").replace("cfg-dmp-",""))});d.push({element:r,section:z,keywords:D,type:"field-row"})});b.querySelectorAll(".config-section").forEach(function(r){var z=r.querySelector(".card__title");z&&d.push({element:r,section:r,keywords:z.textContent.toLowerCase(),type:"section-title"})})})();t(l.initialConfig||{});l.darkMode&&b.classList.add("dark");l.highContrast&&b.classList.add("high-contrast");return{setConfig:function(r){t(r||{})},getConfig:function(){return JSON.parse(JSON.stringify(E))},setDarkMode:function(r){b.classList.toggle("dark",!!r)},setHighContrast:function(r){b.classList.toggle("high-contrast",!!r)}}},css:'.geConfigEditor {\n --drawio-blue: #29b6f2;\n --drawio-blue-hover: #1aa3e0;\n --color-bg: #f0f0f0;\n --color-bg-dark: #2a2a2a;\n --color-bg-secondary: #e4e4e4;\n --color-bg-secondary-dark: #333333;\n --color-bg-tertiary: #dadada;\n --color-bg-tertiary-dark: #3d3d3d;\n --color-input: #ffffff;\n --color-input-dark: #1e2022;\n --color-text: #3F3F3F;\n --color-text-dark: #C0C0C0;\n --color-text-secondary: #6c757d;\n --color-text-secondary-dark: #999999;\n --color-border: #dadada;\n --color-border-dark: #404040;\n --color-border-focus: var(--drawio-blue);\n --color-success: #198754;\n --color-error: #dc3545;\n --color-warning-bg: #fff3cd;\n --color-scrollbar: #e2e2e2;\n --color-scrollbar-dark: #3d3d3d;\n --color-scrollbar-hover: #959798;\n --color-scrollbar-hover-dark: #555555;\n --spacing-xs: 4px;\n --spacing-sm: 8px;\n --spacing-md: 12px;\n --spacing-lg: 16px;\n --radius-sm: 4px;\n --radius-md: 6px;\n --radius-lg: 8px;\n --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, ui-sans-serif, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";\n --font-family-mono: ui-monospace, SFMono-Regular, Consolas, monospace;\n --font-size-xs: 11px;\n --font-size-sm: 12px;\n --font-size-base: 13px;\n --transition-fast: 150ms ease;\n font-family: var(--font-family);\n font-size: var(--font-size-base);\n background: light-dark(var(--color-bg), var(--color-bg-dark));\n color: light-dark(var(--color-text), var(--color-text-dark));\n line-height: 1.5;\n overflow-y: auto;\n padding: 0 8px;\n}\n.geConfigEditor { box-sizing: border-box; margin: 0; }\n.geConfigEditor *, .geConfigEditor *::before, .geConfigEditor *::after { box-sizing: border-box; margin: 0; padding: 0; }\n.geConfigEditor.dark { color-scheme: dark; }\n.geConfigEditor::-webkit-scrollbar, .geConfigEditor ::-webkit-scrollbar { width: 10px; height: 10px; }\n.geConfigEditor::-webkit-scrollbar-track, .geConfigEditor ::-webkit-scrollbar-track { background-clip: padding-box; border: solid transparent; border-width: 1px; }\n.geConfigEditor::-webkit-scrollbar-corner, .geConfigEditor ::-webkit-scrollbar-corner { background-color: transparent; }\n.geConfigEditor::-webkit-scrollbar-thumb, .geConfigEditor ::-webkit-scrollbar-thumb { background-color: light-dark(var(--color-scrollbar), var(--color-scrollbar-dark)); background-clip: padding-box; border: solid transparent; border-radius: 4px; }\n.geConfigEditor::-webkit-scrollbar-thumb:hover, .geConfigEditor ::-webkit-scrollbar-thumb:hover { background-color: light-dark(var(--color-scrollbar-hover), var(--color-scrollbar-hover-dark)); }\n.geConfigEditor input[type="text"], .geConfigEditor input[type="url"], .geConfigEditor input[type="number"], .geConfigEditor textarea, .geConfigEditor select {\n font-family: inherit;\n font-size: var(--font-size-base);\n padding: 5px 8px;\n border: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n border-radius: var(--radius-md);\n background: light-dark(var(--color-input), var(--color-input-dark));\n color: light-dark(var(--color-text), var(--color-text-dark));\n width: 100%;\n transition: border-color var(--transition-fast);\n}\n.geConfigEditor input:focus, .geConfigEditor textarea:focus, .geConfigEditor select:focus {\n outline: none;\n border-color: var(--color-border-focus);\n box-shadow: 0 0 0 2px rgba(41, 182, 242, 0.15);\n}\n.geConfigEditor textarea { font-family: var(--font-family-mono); resize: vertical; min-height: 60px; }\n.geConfigEditor label { display: block; font-weight: 500; margin-bottom: 2px; font-size: var(--font-size-sm); }\n.geConfigEditor .btn {\n display: inline-flex; align-items: center; padding: 4px 8px;\n font-family: inherit; font-size: var(--font-size-xs); font-weight: 500;\n border: none; border-radius: var(--radius-md); cursor: pointer;\n}\n.geConfigEditor .btn--secondary { background: light-dark(var(--color-bg-tertiary), var(--color-bg-tertiary-dark)); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); }\n.geConfigEditor .btn--secondary:hover { background: light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor .btn--sm { padding: 3px 6px; font-size: var(--font-size-xs); }\n.geConfigEditor .btn-group { display: flex; flex-wrap: wrap; gap: 4px; }\n.geConfigEditor .card {\n background: light-dark(var(--color-bg), var(--color-bg-dark)); border: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--spacing-lg);\n}\n.geConfigEditor .card__header {\n padding: 6px var(--spacing-md); border-bottom: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n background: light-dark(var(--color-bg-secondary), var(--color-bg-secondary-dark));\n}\n.geConfigEditor .card__title { font-size: var(--font-size-base); font-weight: 600; margin: 0; }\n.geConfigEditor .card__body { padding: var(--spacing-md); display: flex; flex-direction: column; gap: var(--spacing-md); }\n.geConfigEditor .field { display: flex; flex-direction: column; gap: 2px; }\n.geConfigEditor .field__help { font-size: var(--font-size-xs); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); margin: 0; line-height: 1.3; }\n.geConfigEditor .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-md); }\n.geConfigEditor .toggle-field {\n display: flex; align-items: center; justify-content: space-between;\n padding: 4px 0; border-bottom: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n}\n.geConfigEditor .toggle-field:last-child { border-bottom: none; }\n.geConfigEditor .card__body > * + .toggle-list { border-top: 1px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor .toggle-field__label { display: flex; flex-direction: column; gap: 1px; flex: 1; margin-bottom: 0; }\n.geConfigEditor .toggle-field__name { font-weight: 500; font-size: var(--font-size-sm); }\n.geConfigEditor .toggle-field__help { font-size: var(--font-size-xs); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); }\n.geConfigEditor .toggle-field__experimental {\n display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 8px; vertical-align: middle;\n font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;\n color: light-dark(#8a5a00, #f0b429); background: light-dark(#fff3d6, rgba(240, 180, 41, 0.15));\n}\n.geConfigEditor .toggle-field__helplink {\n display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px;\n margin-left: 4px; border-radius: 50%; vertical-align: middle; text-decoration: none;\n font-size: 9px; font-weight: 700; line-height: 1;\n color: light-dark(#fff, #1a1a1a); background: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark));\n}\n.geConfigEditor .tri-toggle {\n display: inline-flex; border: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n border-radius: var(--radius-md); overflow: hidden; flex-shrink: 0;\n}\n.geConfigEditor .tri-toggle button {\n padding: 3px 8px; font-size: var(--font-size-xs); border: none;\n background: light-dark(var(--color-input), var(--color-input-dark)); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark));\n cursor: pointer; font-family: inherit; transition: all var(--transition-fast);\n}\n.geConfigEditor .tri-toggle button + button { border-left: 1px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor .tri-toggle button.active--unset { background: light-dark(var(--color-bg-tertiary), var(--color-bg-tertiary-dark)); color: light-dark(var(--color-text), var(--color-text-dark)); font-weight: 500; }\n.geConfigEditor .tri-toggle button.active--true { background: var(--color-success); color: #fff; font-weight: 500; }\n.geConfigEditor .tri-toggle button.active--false { background: var(--color-error); color: #fff; font-weight: 500; }\n.geConfigEditor .color-list { display: flex; flex-wrap: wrap; gap: 3px; padding: 4px 0; min-height: 24px; }\n.geConfigEditor .color-swatch {\n width: 22px; height: 22px; border-radius: var(--radius-sm);\n border: 1px solid light-dark(var(--color-border), var(--color-border-dark)); cursor: pointer; position: relative;\n transition: transform var(--transition-fast);\n}\n.geConfigEditor .color-swatch:hover { transform: scale(1.15); box-shadow: 0 0 0 2px var(--drawio-blue); }\n.geConfigEditor .color-swatch__delete {\n position: absolute; top: -5px; right: -5px; width: 12px; height: 12px;\n background: var(--color-error); color: #fff; border: none; border-radius: 50%;\n font-size: 9px; line-height: 12px; text-align: center; cursor: pointer; display: none; padding: 0;\n}\n.geConfigEditor .color-swatch:hover .color-swatch__delete { display: block; }\n.geConfigEditor .color-swatch__picker {\n position: absolute; top: 0; left: 0; width: 100%; height: 100%;\n opacity: 0; cursor: pointer; border: none; padding: 0;\n}\n.geConfigEditor .color-scheme-editor { display: flex; flex-direction: column; gap: 4px; }\n.geConfigEditor .color-scheme-row {\n display: flex; flex-wrap: wrap; gap: 3px; align-items: center;\n padding: 3px 6px; background: light-dark(var(--color-bg-secondary), var(--color-bg-secondary-dark));\n border: 1px solid light-dark(var(--color-border), var(--color-border-dark)); border-radius: var(--radius-sm);\n}\n.geConfigEditor .color-scheme-row__label { font-size: var(--font-size-xs); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); min-width: 20px; text-align: center; }\n.geConfigEditor .color-scheme-entry {\n display: flex; align-items: center; gap: 3px; padding: 1px 4px;\n background: light-dark(var(--color-bg), var(--color-bg-dark)); border: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n border-radius: var(--radius-sm); font-size: var(--font-size-xs);\n}\n.geConfigEditor .color-scheme-entry__swatch {\n width: 14px; height: 14px; border-radius: 2px;\n border: 1px solid light-dark(var(--color-border), var(--color-border-dark)); position: relative; cursor: pointer; flex-shrink: 0;\n}\n.geConfigEditor .color-scheme-entry__swatch input[type="color"] {\n position: absolute; top: 0; left: 0; width: 100%; height: 100%;\n opacity: 0; cursor: pointer; border: none; padding: 0;\n}\n.geConfigEditor .color-scheme-entry__key { color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); }\n.geConfigEditor .color-scheme-entry__remove {\n background: none; border: none; cursor: pointer;\n color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); font-size: 11px; padding: 0 1px; line-height: 1;\n}\n.geConfigEditor .color-scheme-entry__remove:hover { color: var(--color-error); }\n.geConfigEditor .color-scheme-row__actions { display: flex; gap: 2px; margin-left: auto; }\n.geConfigEditor .color-scheme-row__btn {\n background: none; border: 1px solid light-dark(var(--color-border), var(--color-border-dark));\n border-radius: var(--radius-sm); cursor: pointer;\n font-size: var(--font-size-xs); padding: 1px 5px; color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark));\n}\n.geConfigEditor .color-scheme-row__btn:hover { background: light-dark(var(--color-bg-tertiary), var(--color-bg-tertiary-dark)); color: light-dark(var(--color-text), var(--color-text-dark)); }\n.geConfigEditor .tag-list { display: flex; flex-wrap: wrap; gap: 3px; }\n.geConfigEditor .tag {\n display: inline-flex; align-items: center; gap: 3px;\n padding: 1px 6px; background: light-dark(var(--color-bg-tertiary), var(--color-bg-tertiary-dark));\n border-radius: var(--radius-sm); font-size: var(--font-size-xs);\n}\n.geConfigEditor .tag__remove {\n background: none; border: none; cursor: pointer;\n color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); font-size: 13px; padding: 0 1px; line-height: 1;\n}\n.geConfigEditor .tag__remove:hover { color: var(--color-error); }\n.geConfigEditor .tag-input-wrap { display: flex; gap: 4px; margin-top: 4px; }\n.geConfigEditor .tag-input-wrap input { flex: 1; }\n.geConfigEditor .search-box { position: sticky; top: 0; z-index: 50; background: light-dark(var(--color-bg), var(--color-bg-dark)); padding: 6px 0 8px; }\n.geConfigEditor .search-box input { font-size: var(--font-size-base); padding: 6px 10px; }\n.geConfigEditor .search-box__count { font-size: var(--font-size-xs); color: light-dark(var(--color-text-secondary), var(--color-text-secondary-dark)); margin-top: 2px; }\n.geConfigEditor .config-section.search-hidden, .geConfigEditor .toggle-field.search-hidden,\n.geConfigEditor .field.search-hidden, .geConfigEditor .field-row.search-hidden { display: none; }\n.geConfigEditor .mt-sm { margin-top: 4px; }\n.geConfigEditor .mb-sm { margin-bottom: 4px; }\n.geConfigEditor .checkbox { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }\n.geConfigEditor .checkbox input { width: auto; margin: 0; }\n@supports (scrollbar-color: auto) {\n .geConfigEditor { scrollbar-color: light-dark(var(--color-scrollbar), var(--color-scrollbar-dark)) transparent; scrollbar-width: thin; }\n}\n@media (prefers-contrast: more) {\n .geConfigEditor {\n --color-bg: #ffffff;\n --color-bg-dark: #000000;\n --color-bg-secondary: #e0e0e0;\n --color-bg-secondary-dark: #1a1a1a;\n --color-bg-tertiary: #cccccc;\n --color-bg-tertiary-dark: #2a2a2a;\n --color-input: #ffffff;\n --color-input-dark: #111111;\n --color-text: #000000;\n --color-text-dark: #ffffff;\n --color-text-secondary: #333333;\n --color-text-secondary-dark: #cccccc;\n --color-border: #666666;\n --color-border-dark: #999999;\n --color-success: #006633;\n --color-error: #cc0000;\n }\n .geConfigEditor input[type="text"], .geConfigEditor input[type="url"], .geConfigEditor input[type="number"], .geConfigEditor textarea, .geConfigEditor select {\n border: 2px solid light-dark(var(--color-border), var(--color-border-dark));\n }\n .geConfigEditor .tri-toggle { border: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n .geConfigEditor .tri-toggle button { font-weight: 600; }\n .geConfigEditor .tri-toggle button + button { border-left: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n .geConfigEditor .card { border: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n .geConfigEditor .card__header { border-bottom: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n .geConfigEditor .toggle-field { border-bottom: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n .geConfigEditor .card__body > * + .toggle-list { border-top: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n}\n.geConfigEditor.high-contrast {\n --color-bg: #ffffff;\n --color-bg-dark: #000000;\n --color-bg-secondary: #e0e0e0;\n --color-bg-secondary-dark: #1a1a1a;\n --color-bg-tertiary: #cccccc;\n --color-bg-tertiary-dark: #2a2a2a;\n --color-input: #ffffff;\n --color-input-dark: #111111;\n --color-text: #000000;\n --color-text-dark: #ffffff;\n --color-text-secondary: #333333;\n --color-text-secondary-dark: #cccccc;\n --color-border: #666666;\n --color-border-dark: #999999;\n --color-success: #006633;\n --color-error: #cc0000;\n}\n.geConfigEditor.high-contrast input[type="text"],\n.geConfigEditor.high-contrast input[type="url"],\n.geConfigEditor.high-contrast input[type="number"],\n.geConfigEditor.high-contrast textarea,\n.geConfigEditor.high-contrast select {\n border: 2px solid light-dark(var(--color-border), var(--color-border-dark));\n}\n.geConfigEditor.high-contrast .tri-toggle { border: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor.high-contrast .tri-toggle button { font-weight: 600; }\n.geConfigEditor.high-contrast .tri-toggle button + button { border-left: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor.high-contrast .card { border: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor.high-contrast .card__header { border-bottom: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor.high-contrast .toggle-field { border-bottom: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n.geConfigEditor.high-contrast .card__body > * + .toggle-list { border-top: 2px solid light-dark(var(--color-border), var(--color-border-dark)); }\n@media (forced-colors: active) {\n .geConfigEditor input[type="text"], .geConfigEditor input[type="url"], .geConfigEditor input[type="number"], .geConfigEditor textarea, .geConfigEditor select {\n border: 2px solid ButtonText;\n background: Field;\n color: FieldText;\n }\n .geConfigEditor .card { border: 2px solid ButtonText; }\n .geConfigEditor .card__header { background: Canvas; border-bottom: 2px solid ButtonText; forced-color-adjust: none; }\n .geConfigEditor .tri-toggle { border: 2px solid ButtonText; }\n .geConfigEditor .tri-toggle button { background: ButtonFace; color: ButtonText; border-color: ButtonText; }\n .geConfigEditor .tri-toggle button.active--true,\n .geConfigEditor .tri-toggle button.active--false { background: Highlight; color: HighlightText; }\n .geConfigEditor .tri-toggle button.active--unset { background: ButtonFace; color: ButtonText; outline: 2px solid Highlight; outline-offset: -2px; }\n .geConfigEditor .btn--secondary { border: 1px solid ButtonText; }\n .geConfigEditor .toggle-field { border-bottom: 1px solid ButtonText; }\n .geConfigEditor .card__body > * + .toggle-list { border-top: 1px solid ButtonText; }\n .geConfigEditor .search-box { background: Canvas; }\n .geConfigEditor { background: Canvas; color: CanvasText; }\n}',html:'<div class="search-box" id="searchBox">\n <input type="text" id="searchInput" placeholder="Search settings (e.g. grid, font, dark mode, compressXml...)">\n <div class="search-box__count" id="searchCount"></div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">General</h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-version">Version</label>\n <input type="text" id="cfg-version" data-key="version" placeholder="e.g. 1.0">\n <p class="field__help">Configuration version identifier</p>\n </div>\n <div class="field">\n <label for="cfg-settingsName">Settings Name</label>\n <input type="text" id="cfg-settingsName" data-key="settingsName" placeholder=".drawio-config">\n <p class="field__help">Key for storing user settings in local storage</p>\n </div>\n </div>\n <div class="field">\n <label for="cfg-keyboardShortcuts">Keyboard Shortcuts (JSON)</label>\n <textarea id="cfg-keyboardShortcuts" data-key="keyboardShortcuts" data-type="json" placeholder=\'[{"keyCode": "T", "control": true, "shift": true, "action": "tags"}]\' style="min-height: 60px;"></textarea>\n <p class="field__help">Custom keyboard shortcuts. Entries are {keyCode, control, shift, alt, action} where keyCode is a key code or single character and action is an action name, or null to remove a binding.</p>\n </div>\n <div id="general-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Canvas & Grid</h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-defaultGridSize">Default Grid Size</label>\n <input type="number" id="cfg-defaultGridSize" data-key="defaultGridSize" placeholder="10" min="1">\n </div>\n <div class="field">\n <label for="cfg-gridSteps">Grid Steps</label>\n <input type="number" id="cfg-gridSteps" data-key="gridSteps" placeholder="e.g. 4" min="1">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-zoomFactor">Zoom Factor</label>\n <input type="number" id="cfg-zoomFactor" data-key="zoomFactor" placeholder="1.2" min="1.01" step="0.05">\n </div>\n <div class="field">\n <label for="cfg-defaultEdgeLength">Default Edge Length</label>\n <input type="number" id="cfg-defaultEdgeLength" data-key="defaultEdgeLength" placeholder="80" min="1">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-foldingIconSize">Folding Icon Size</label>\n <input type="number" id="cfg-foldingIconSize" data-key="foldingIconSize" placeholder="9" min="1">\n </div>\n <div class="field"></div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-tooltipFontSize">Tooltip Font Size (px)</label>\n <input type="number" id="cfg-tooltipFontSize" data-key="tooltipFontSize" placeholder="11" min="1">\n </div>\n <div class="field">\n <label for="cfg-tooltipMaxWidth">Tooltip Max Width (px)</label>\n <div style="display: flex; gap: 6px; align-items: center;">\n <input type="number" id="cfg-tooltipMaxWidth" placeholder="360" min="1" style="flex: 1;">\n <label class="checkbox" style="white-space: nowrap;"><input type="checkbox" id="cfg-tooltipMaxWidthEnabled"> <span>Limit</span></label>\n </div>\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-pageFormatWidth">Page Width (1/10 inch)</label>\n <input type="number" id="cfg-pageFormatWidth" placeholder="850" min="1">\n </div>\n <div class="field">\n <label for="cfg-pageFormatHeight">Page Height (1/10 inch)</label>\n <input type="number" id="cfg-pageFormatHeight" placeholder="1100" min="1">\n </div>\n </div>\n <p class="field__help">Page format: US Letter = 850 x 1100, A4 = 827 x 1169</p>\n <div id="canvas-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Appearance</h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-darkColor">Dark Mode Background</label>\n <div style="display: flex; gap: 6px; align-items: center;">\n <input type="color" id="cfg-darkColorPicker" value="#2A2A2A" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="cfg-darkColor" data-key="darkColor" placeholder="#2A2A2A" style="flex: 1;">\n </div>\n </div>\n <div class="field">\n <label for="cfg-defaultAdaptiveColors">Adaptive Colors</label>\n <select id="cfg-defaultAdaptiveColors" data-key="defaultAdaptiveColors">\n <option value="">- Not set -</option>\n <option value="auto">auto</option>\n <option value="simple">simple</option>\n <option value="none">none</option>\n </select>\n </div>\n </div>\n <div class="field">\n <label for="cfg-darkColorVar">Dark Color CSS Variable</label>\n <input type="text" id="cfg-darkColorVar" data-key="darkColorVar" placeholder="--ge-dark-color">\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-shadowColor">Shadow Color</label>\n <div style="display: flex; gap: 6px; align-items: center;">\n <input type="color" id="cfg-shadowColorPicker" value="#808080" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="cfg-shadowColor" data-key="shadowColor" placeholder="#808080" style="flex: 1;">\n </div>\n </div>\n <div class="field">\n <label for="cfg-shadowOpacity">Shadow Opacity</label>\n <input type="number" id="cfg-shadowOpacity" data-key="shadowOpacity" placeholder="1" min="0" max="1" step="0.1">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-shadowOffsetX">Shadow Offset X</label>\n <input type="number" id="cfg-shadowOffsetX" data-key="shadowOffsetX" placeholder="e.g. 2">\n </div>\n <div class="field">\n <label for="cfg-shadowOffsetY">Shadow Offset Y</label>\n <input type="number" id="cfg-shadowOffsetY" data-key="shadowOffsetY" placeholder="e.g. 3">\n </div>\n </div>\n <div class="field">\n <label for="cfg-shadowBlur">Shadow Blur</label>\n <input type="number" id="cfg-shadowBlur" data-key="shadowBlur" placeholder="e.g. 6" min="0">\n </div>\n <div id="appearance-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Sidebar & Panels</h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-thumbWidth">Thumbnail Width</label>\n <input type="number" id="cfg-thumbWidth" data-key="thumbWidth" placeholder="46" min="1">\n </div>\n <div class="field">\n <label for="cfg-thumbHeight">Thumbnail Height</label>\n <input type="number" id="cfg-thumbHeight" data-key="thumbHeight" placeholder="46" min="1">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-sidebarWidth">Sidebar Width</label>\n <input type="number" id="cfg-sidebarWidth" data-key="sidebarWidth" placeholder="e.g. 250" min="1">\n </div>\n <div class="field">\n <label for="cfg-sidebarTitleSize">Title Font Size (pt)</label>\n <input type="number" id="cfg-sidebarTitleSize" data-key="sidebarTitleSize" placeholder="8" min="1">\n </div>\n </div>\n <div class="field">\n <label for="cfg-shapePicker">Shape Picker (JSON)</label>\n <textarea id="cfg-shapePicker" data-key="shapePicker" data-type="json" placeholder=\'{"shapes": [...]}\' style="min-height: 60px;"></textarea>\n <p class="field__help">Custom shape picker entries for the sidebar</p>\n </div>\n <div id="sidebar-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Libraries</h3></div>\n <div class="card__body">\n <div class="field">\n <label for="cfg-defaultLibraries">Default Libraries</label>\n <input type="text" id="cfg-defaultLibraries" data-key="defaultLibraries" placeholder="general;uml;er;bpmn;flowchart;basic;arrows2">\n <p class="field__help">Semicolon-separated library keys shown in sidebar on startup</p>\n </div>\n <div class="field">\n <label>Enabled Libraries</label>\n <div class="tag-list" id="enabledLibraries-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="enabledLibraries-input" placeholder="Add library key (e.g. general, uml)...">\n <button type="button" class="btn btn--secondary btn--sm" id="enabledLibraries-add">Add</button>\n </div>\n <p class="field__help">Libraries available in More Shapes dialog. Leave empty for all.</p>\n </div>\n <div class="field">\n <label>Default Custom Libraries</label>\n <div class="tag-list" id="defaultCustomLibraries-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="defaultCustomLibraries-input" placeholder="Add library ID or URL...">\n <button type="button" class="btn btn--secondary btn--sm" id="defaultCustomLibraries-add">Add</button>\n </div>\n <p class="field__help">IDs or URLs of custom libraries to load on startup</p>\n </div>\n <div class="field">\n <label for="cfg-templateFile">Template File URL</label>\n <input type="url" id="cfg-templateFile" data-key="templateFile" placeholder="https://app.diagrams.net/templates/index.xml">\n </div>\n <div class="field">\n <label for="cfg-libraries">Libraries (JSON)</label>\n <textarea id="cfg-libraries" data-key="libraries" data-type="json" placeholder=\'[{"title": {"main": "Company"}, "entries": [...]}]\' style="min-height: 60px;"></textarea>\n <p class="field__help">Custom library sections for the left panel</p>\n </div>\n <div id="library-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Fonts</h3></div>\n <div class="card__body">\n <div class="field">\n <label>Default Fonts</label>\n <div class="tag-list" id="defaultFonts-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="defaultFonts-input" placeholder="Add font name...">\n <button type="button" class="btn btn--secondary btn--sm" id="defaultFonts-add">Add</button>\n </div>\n <p class="field__help">Font names for the format panel font picker</p>\n </div>\n <div class="field">\n <label>Custom Fonts</label>\n <div class="tag-list" id="customFonts-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="customFonts-input" placeholder="Add font name...">\n <button type="button" class="btn btn--secondary btn--sm" id="customFonts-add">Add</button>\n </div>\n <p class="field__help">Additional fonts added before default fonts</p>\n </div>\n <div class="field">\n <label for="cfg-fontCss">Font CSS (@font-face rules)</label>\n <textarea id="cfg-fontCss" data-key="fontCss" placeholder="@font-face { font-family: \'MyFont\'; src: url(\'...\'); }" style="min-height: 60px;"></textarea>\n </div>\n <div id="font-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Colors</h3></div>\n <div class="card__body">\n <div class="field">\n <label>Preset Colors (upper palette)</label>\n <div class="color-list" id="presetColors-list"></div>\n <div class="tag-input-wrap">\n <input type="color" id="presetColors-picker" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="presetColors-input" placeholder="Hex without # (e.g. E6D0DE)" style="flex: 1;">\n <button type="button" class="btn btn--secondary btn--sm" id="presetColors-add">Add</button>\n </div>\n </div>\n <div class="field">\n <label>Custom Preset Colors</label>\n <div class="color-list" id="customPresetColors-list"></div>\n <div class="tag-input-wrap">\n <input type="color" id="customPresetColors-picker" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="customPresetColors-input" placeholder="Hex without # (e.g. FF5733)" style="flex: 1;">\n <button type="button" class="btn btn--secondary btn--sm" id="customPresetColors-add">Add</button>\n </div>\n <p class="field__help">Added before preset colors in the colour dialog</p>\n </div>\n <div class="field">\n <label>Default Colors (lower palette)</label>\n <div class="color-list" id="defaultColors-list"></div>\n <div class="tag-input-wrap">\n <input type="color" id="defaultColors-picker" style="width: 36px; height: 28px; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);">\n <input type="text" id="defaultColors-input" placeholder="Hex without # or \'none\'" style="flex: 1;">\n <button type="button" class="btn btn--secondary btn--sm" id="defaultColors-add">Add</button>\n </div>\n </div>\n <div class="field">\n <label for="cfg-colorNames">Color Names (JSON)</label>\n <textarea id="cfg-colorNames" data-key="colorNames" data-type="json" placeholder=\'{"FFFFFF": "White", "000000": "Black"}\' style="min-height: 60px;"></textarea>\n <p class="field__help">Map of colour codes to display names (tooltips)</p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Color Schemes</h3></div>\n <div class="card__body">\n <div class="field">\n <label>Default Color Schemes</label>\n <div class="color-scheme-editor" id="defaultColorSchemes-editor"></div>\n <div class="btn-group mt-sm">\n <button type="button" class="btn btn--secondary btn--sm" id="defaultColorSchemes-addRow">Add Row</button>\n </div>\n <p class="field__help">Colour schemes for the Style section. Each row is a scheme group.</p>\n </div>\n <div class="field">\n <label>Custom Color Schemes</label>\n <div class="color-scheme-editor" id="customColorSchemes-editor"></div>\n <div class="btn-group mt-sm">\n <button type="button" class="btn btn--secondary btn--sm" id="customColorSchemes-addRow">Add Row</button>\n </div>\n <p class="field__help">Additional colour schemes added before default schemes</p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Default Styles</h3></div>\n <div class="card__body">\n <div class="field">\n <label for="cfg-defaultTextStyle">Default Text Style</label>\n <input type="text" id="cfg-defaultTextStyle" data-key="defaultTextStyle" placeholder="text;html=1;whiteSpace=wrap;...">\n </div>\n <div class="field">\n <div style="display: flex; align-items: center; justify-content: space-between;">\n <label for="cfg-defaultVertexStyle" style="margin-bottom: 0;">Default Vertex Style (JSON)</label>\n <button type="button" class="btn btn--secondary btn--sm" id="useCurrentVertexStyle" style="display: none;">Use Current</button>\n </div>\n <textarea id="cfg-defaultVertexStyle" data-key="defaultVertexStyle" data-type="json" placeholder=\'{"fontFamily": "Arial"}\' style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <div style="display: flex; align-items: center; justify-content: space-between;">\n <label for="cfg-defaultEdgeStyle" style="margin-bottom: 0;">Default Edge Style (JSON)</label>\n <button type="button" class="btn btn--secondary btn--sm" id="useCurrentEdgeStyle" style="display: none;">Use Current</button>\n </div>\n <textarea id="cfg-defaultEdgeStyle" data-key="defaultEdgeStyle" data-type="json" placeholder=\'{"edgeStyle": "orthogonalEdgeStyle"}\' style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <label for="cfg-styles">Styles (JSON)</label>\n <textarea id="cfg-styles" data-key="styles" data-type="json" placeholder=\'[{}, {"commonStyle": {"fontColor": "#5C5C5C"}}]\' style="min-height: 60px;"></textarea>\n <p class="field__help">Colours for the Style tab. Keys: commonStyle, vertexStyle, edgeStyle, graph.</p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Custom CSS</h3></div>\n <div class="card__body">\n <div class="field">\n <label for="cfg-css">CSS Rules</label>\n <textarea id="cfg-css" data-key="css" placeholder=".geMenubarContainer { background-color: #2A2A2A !important; }" style="min-height: 80px;"></textarea>\n <p class="field__help">CSS rules to customize the draw.io user interface</p>\n </div>\n <div class="field">\n <label for="cfg-customCss">Custom CSS (alternative)</label>\n <textarea id="cfg-customCss" data-key="customCss" placeholder="Additional CSS rules..." style="min-height: 60px;"></textarea>\n <p class="field__help">Injected as a separate style element</p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Embedding</h3></div>\n <div class="card__body">\n <div id="embedding-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Menu Customization</h3></div>\n <div class="card__body">\n <div class="field">\n <label>Hidden Menu Items</label>\n <div class="tag-list" id="hideMenuItems-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="hideMenuItems-input" placeholder="Add action name (e.g. print, exportPdf)...">\n <button type="button" class="btn btn--secondary btn--sm" id="hideMenuItems-add">Add</button>\n </div>\n <p class="field__help">Action names of menu items to hide</p>\n </div>\n <div class="field">\n <label>Hidden Menus</label>\n <div class="tag-list" id="hideMenus-tags"></div>\n <div class="tag-input-wrap">\n <input type="text" id="hideMenus-input" placeholder="Add menu name (e.g. extras, help)...">\n <button type="button" class="btn btn--secondary btn--sm" id="hideMenus-add">Add</button>\n </div>\n <p class="field__help">Names of top-level menus to hide</p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">AI Configuration</h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-gptApiKey">OpenAI API Key</label>\n <input type="text" id="cfg-gptApiKey" data-key="gptApiKey" placeholder="sk-...">\n </div>\n <div class="field">\n <label for="cfg-gptUrl">Custom GPT URL</label>\n <input type="url" id="cfg-gptUrl" data-key="gptUrl" placeholder="https://api.openai.com/v1/chat/completions">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-geminiApiKey">Gemini API Key</label>\n <input type="text" id="cfg-geminiApiKey" data-key="geminiApiKey" placeholder="AI...">\n </div>\n <div class="field">\n <label for="cfg-claudeApiKey">Claude API Key</label>\n <input type="text" id="cfg-claudeApiKey" data-key="claudeApiKey" placeholder="sk-ant-...">\n </div>\n </div>\n <div class="field">\n <label for="cfg-aiActions">AI Actions (JSON)</label>\n <textarea id="cfg-aiActions" data-key="aiActions" data-type="json" placeholder=\'{"myAction": {"prompt": "..."}}\' style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <label for="cfg-aiGlobals">AI Globals (JSON)</label>\n <textarea id="cfg-aiGlobals" data-key="aiGlobals" data-type="json" placeholder=\'{}\' style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <label for="cfg-aiConfigs">AI Configs (JSON)</label>\n <textarea id="cfg-aiConfigs" data-key="aiConfigs" data-type="json" placeholder=\'{}\' style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <label for="cfg-aiModels">AI Models (JSON)</label>\n <textarea id="cfg-aiModels" data-key="aiModels" data-type="json" placeholder=\'{}\' style="min-height: 60px;"></textarea>\n </div>\n <div id="ai-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Export & Security</h3></div>\n <div class="card__body">\n <div class="field-row">\n <div class="field">\n <label for="cfg-maxImageBytes">Max Image Bytes</label>\n <input type="number" id="cfg-maxImageBytes" data-key="maxImageBytes" placeholder="1000000" min="0">\n </div>\n <div class="field">\n <label for="cfg-maxImageSize">Max Image Size (px)</label>\n <input type="number" id="cfg-maxImageSize" data-key="maxImageSize" placeholder="520" min="0">\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-autosaveDelay">Autosave Delay (ms)</label>\n <input type="number" id="cfg-autosaveDelay" data-key="autosaveDelay" placeholder="e.g. 2000" min="0">\n </div>\n <div class="field">\n <label for="cfg-defaultFileType">Default File Type</label>\n <select id="cfg-defaultFileType" data-key="defaultFileType">\n <option value="">- Not set -</option>\n <option value="drawio">XML (.drawio)</option>\n <option value="png">Editable PNG (.drawio.png)</option>\n <option value="svg">Editable SVG (.drawio.svg)</option>\n <option value="html">HTML (.drawio.html)</option>\n </select>\n </div>\n </div>\n <div id="export-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Collaboration & Advanced</h3></div>\n <div class="card__body">\n <div class="field">\n <label for="cfg-globalVars">Global Variables (JSON)</label>\n <textarea id="cfg-globalVars" data-key="globalVars" data-type="json" placeholder=\'{"companyName": "Acme Corp"}\' style="min-height: 60px;"></textarea>\n <p class="field__help">Global placeholders available in all diagrams</p>\n </div>\n <div class="field">\n <label for="cfg-emptyDiagramXml">Empty Diagram XML</label>\n <textarea id="cfg-emptyDiagramXml" data-key="emptyDiagramXml" placeholder="<mxGraphModel>...</mxGraphModel>" style="min-height: 60px;"></textarea>\n </div>\n <div class="field">\n <label for="cfg-emptyLibraryXml">Empty Library XML</label>\n <textarea id="cfg-emptyLibraryXml" data-key="emptyLibraryXml" placeholder="<mxlibrary>[]</mxlibrary>" style="min-height: 60px;"></textarea>\n </div>\n <div id="advanced-toggles"></div>\n <div id="desktop-toggles"></div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Confluence Cloud</h3></div>\n <div class="card__body">\n <p class="field__help mb-sm">These options only apply to <strong>Confluence Cloud</strong>.</p>\n <div class="field">\n <label for="cfg-ui">UI Theme</label>\n <select id="cfg-ui" data-key="ui">\n <option value="">- Not set -</option>\n <option value="kennedy">Kennedy</option>\n <option value="atlas">Atlas (default)</option>\n <option value="min">Minimal</option>\n <option value="sketch">Sketch</option>\n <option value="simple">Simple</option>\n </select>\n </div>\n <div id="confluence-cloud-toggles"></div>\n <div class="field">\n <label for="cfg-viewerTimeout">Viewer Timeout</label>\n <input type="number" id="cfg-viewerTimeout" data-key="viewerTimeout" placeholder="e.g. 30000" min="0">\n <p class="field__help">Timeout in milliseconds before the viewer gives up loading <code>viewerTimeout</code></p>\n </div>\n </div>\n </div>\n</div>\n<div class="config-section">\n <div class="card">\n <div class="card__header"><h3 class="card__title">Confluence Server / Data Center</h3></div>\n <div class="card__body">\n <p class="field__help mb-sm">These options only apply to <strong>Confluence Server / Data Center</strong>.</p>\n <div id="confluence-toggles"></div>\n <div class="field">\n <label>Default Macro Parameters</label>\n <div class="field-row">\n <div class="field">\n <label for="cfg-dmp-toolbarStyle" style="font-weight: normal;">Toolbar Style</label>\n <select id="cfg-dmp-toolbarStyle">\n <option value="">- Not set -</option>\n <option value="top">top</option>\n <option value="inline">inline</option>\n <option value="hidden">hidden</option>\n </select>\n </div>\n <div class="field">\n <label for="cfg-dmp-links" style="font-weight: normal;">Links</label>\n <select id="cfg-dmp-links">\n <option value="">- Not set -</option>\n <option value="auto">auto</option>\n <option value="blank">blank</option>\n <option value="self">self</option>\n </select>\n </div>\n </div>\n <div class="field-row">\n <div class="field">\n <label for="cfg-dmp-width" style="font-weight: normal;">Width</label>\n <input type="number" id="cfg-dmp-width" placeholder="e.g. 800" min="1">\n </div>\n <div class="field" style="padding-top: 16px;">\n <div id="dmp-toggles-container"></div>\n </div>\n </div>\n <div style="display: flex; flex-wrap: wrap; gap: 12px; padding-top: 6px;" id="dmp-booleans">\n <label class="checkbox"><input type="checkbox" id="cfg-dmp-border" data-tristate="true"> <span>Border</span></label>\n <label class="checkbox"><input type="checkbox" id="cfg-dmp-lightbox" data-tristate="true"> <span>Lightbox</span></label>\n <label class="checkbox"><input type="checkbox" id="cfg-dmp-simpleViewer" data-tristate="true"> <span>Simple Viewer</span></label>\n </div>\n </div>\n </div>\n </div>\n</div>'};EditorUi.DIFF_INSERT="i";EditorUi.DIFF_REMOVE="r";EditorUi.DIFF_UPDATE="u";EditorUi.DIFF_FILE="f";EditorUi.transientViewStateProperties="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");EditorUi.prototype.viewStateProperties={background:!0,backgroundImage:!0,shadowVisible:!0,foldingEnabled:!0,pageScale:!0,mathEnabled:!0,pageFormat:!0,extFonts:!0,adaptiveColors:!0};-EditorUi.prototype.cellProperties={id:!0,value:!0,xmlValue:!0,vertex:!0,edge:!0,visible:!0,collapsed:!0,connectable:!0,parent:!0,children:!0,previous:!0,source:!0,target:!0,edges:!0,geometry:!0,style:!0,overlays:!0,mxObjectId:!0,mxTransient:!0};EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.applyPatches=function(b,l,p,g,x){if(null!=l)for(var B=0;B<l.length;B++)null!=l[B]&&(b=this.patchPages(b,l[B],p,g,x));return b};+EditorUi.prototype.cellProperties={id:!0,value:!0,xmlValue:!0,vertex:!0,edge:!0,visible:!0,collapsed:!0,connectable:!0,parent:!0,children:!0,previous:!0,source:!0,target:!0,edges:!0,geometry:!0,style:!0,overlays:!0,mxObjectId:!0,mxTransient:!0};EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.applyPatches=function(b,l,p,g,x){if(null!=l)for(var A=0;A<l.length;A++)null!=l[A]&&(b=this.patchPages(b,l[A],p,g,x));return b};EditorUi.prototype.patchFileNode=function(b){var l=!1;if(null!=this.fileNode&&null!=b)for(var p=0;p<b.length;p++)if(null!=b[p]&&null!=b[p][EditorUi.DIFF_FILE])for(var g in b[p][EditorUi.DIFF_FILE])l=b[p][EditorUi.DIFF_FILE][g],null!=l?this.fileNode.setAttribute(g,l):this.fileNode.removeAttribute(g),l=!0;return l};-EditorUi.prototype.patchPages=function(b,l,p,g,x){var B={},z=[],F={},K={},M={},L={};if(null!=g&&null!=g[EditorUi.DIFF_UPDATE])for(var Q in g[EditorUi.DIFF_UPDATE])B[Q]=g[EditorUi.DIFF_UPDATE][Q];if(null!=l[EditorUi.DIFF_REMOVE])for(g=0;g<l[EditorUi.DIFF_REMOVE].length;g++)K[l[EditorUi.DIFF_REMOVE][g]]=!0;if(null!=l[EditorUi.DIFF_INSERT])for(g=0;g<l[EditorUi.DIFF_INSERT].length;g++)F[l[EditorUi.DIFF_INSERT][g].previous]=l[EditorUi.DIFF_INSERT][g];if(null!=l[EditorUi.DIFF_UPDATE])for(Q in l[EditorUi.DIFF_UPDATE])g=-l[EditorUi.DIFF_UPDATE][Q],null!=g.previous&&(L[g.previous]=Q);if(null!=b){var c="";for(g=0;g<b.length;g++){var f=b[g].getId();M[f]=b[g];null!=L[c]||K[f]||null!=l[EditorUi.DIFF_UPDATE]&&null!=l[EditorUi.DIFF_UPDATE][f]&&null!=l[EditorUi.DIFF_UPDATE][f].previous||(L[c]=f);c=f}}var k={},n=mxUtils.bind(this,function(t){var u=null!=t?t.getId():"";if(null!=t&&!k[u]){k[u]=!0;z.push(t);var y=null!=l[EditorUi.DIFF_UPDATE]?l[EditorUi.DIFF_UPDATE][u]:null;null!=y&&(this.updatePageRoot(t),null!=y.name&&t.setName(y.name),-null!=y.viewBox&&(""==y.viewBox?t.node.removeAttribute("viewBox"):t.node.setAttribute("viewBox",y.viewBox)),null!=y.view&&this.patchViewState(t,y.view),null!=y.cells&&this.patchPage(t,y.cells,B[t.getId()],x),!p||null==y.cells&&null==y.view||(t.needsUpdate=!0))}t=L[u];null!=t&&(delete L[u],n(M[t]));t=F[u];null!=t&&(delete F[u],q(t))}),q=mxUtils.bind(this,function(t){t=mxUtils.parseXml(t.data).documentElement;t=new DiagramPage(t);this.updatePageRoot(t);var u=M[t.getId()];null==u?n(t):(this.patchPage(u,-this.diffPages([u],[t]),B[u.getId()],x),p&&(u.needsUpdate=!0))});n();for(Q in L)n(M[L[Q]]),delete L[Q];for(Q in F)q(F[Q]),delete F[Q];return z};+EditorUi.prototype.patchPages=function(b,l,p,g,x){var A={},y=[],G={},L={},O={},J={};if(null!=g&&null!=g[EditorUi.DIFF_UPDATE])for(var Q in g[EditorUi.DIFF_UPDATE])A[Q]=g[EditorUi.DIFF_UPDATE][Q];if(null!=l[EditorUi.DIFF_REMOVE])for(g=0;g<l[EditorUi.DIFF_REMOVE].length;g++)L[l[EditorUi.DIFF_REMOVE][g]]=!0;if(null!=l[EditorUi.DIFF_INSERT])for(g=0;g<l[EditorUi.DIFF_INSERT].length;g++)G[l[EditorUi.DIFF_INSERT][g].previous]=l[EditorUi.DIFF_INSERT][g];if(null!=l[EditorUi.DIFF_UPDATE])for(Q in l[EditorUi.DIFF_UPDATE])g=+l[EditorUi.DIFF_UPDATE][Q],null!=g.previous&&(J[g.previous]=Q);if(null!=b){var c="";for(g=0;g<b.length;g++){var f=b[g].getId();O[f]=b[g];null!=J[c]||L[f]||null!=l[EditorUi.DIFF_UPDATE]&&null!=l[EditorUi.DIFF_UPDATE][f]&&null!=l[EditorUi.DIFF_UPDATE][f].previous||(J[c]=f);c=f}}var k={},n=mxUtils.bind(this,function(t){var u=null!=t?t.getId():"";if(null!=t&&!k[u]){k[u]=!0;y.push(t);var B=null!=l[EditorUi.DIFF_UPDATE]?l[EditorUi.DIFF_UPDATE][u]:null;null!=B&&(this.updatePageRoot(t),null!=B.name&&t.setName(B.name),+null!=B.viewBox&&(""==B.viewBox?t.node.removeAttribute("viewBox"):t.node.setAttribute("viewBox",B.viewBox)),null!=B.view&&this.patchViewState(t,B.view),null!=B.cells&&this.patchPage(t,B.cells,A[t.getId()],x),!p||null==B.cells&&null==B.view||(t.needsUpdate=!0))}t=J[u];null!=t&&(delete J[u],n(O[t]));t=G[u];null!=t&&(delete G[u],q(t))}),q=mxUtils.bind(this,function(t){t=mxUtils.parseXml(t.data).documentElement;t=new DiagramPage(t);this.updatePageRoot(t);var u=O[t.getId()];null==u?n(t):(this.patchPage(u,+this.diffPages([u],[t]),A[u.getId()],x),p&&(u.needsUpdate=!0))});n();for(Q in J)n(O[J[Q]]),delete J[Q];for(Q in G)q(G[Q]),delete G[Q];return y};EditorUi.prototype.patchViewState=function(b,l){if(null!=l){if(null==b.viewState){var p=mxUtils.createXmlDocument();b.viewState=this.editor.graph.createViewState(p.createElement("mxGraphModel"))}b==this.currentPage&&(b.viewState=this.editor.graph.getViewState());for(var g in l)try{this.patchViewStateProperty(b,l,g)}catch(x){}b==this.currentPage&&this.editor.graph.setViewState(b.viewState,!0)}};EditorUi.prototype.patchViewStateProperty=function(b,l,p){b.viewState[p]=JSON.parse(l[p])};-EditorUi.prototype.createParentLookup=function(b,l){function p(M){var L=g[M];null==L&&(L={inserted:[],moved:{}},g[M]=L);return L}var g={};if(null!=l[EditorUi.DIFF_INSERT])for(var x=0;x<l[EditorUi.DIFF_INSERT].length;x++){var B=l[EditorUi.DIFF_INSERT][x],z=null!=B.parent?B.parent:"",F=null!=B.previous?B.previous:"";p(z).inserted[F]=B}if(null!=l[EditorUi.DIFF_UPDATE])for(var K in l[EditorUi.DIFF_UPDATE])B=l[EditorUi.DIFF_UPDATE][K],null!=B.previous&&(z=B.parent,null==z&&(x=b.getCell(K),null!=x&&(x=-b.getParent(x),null!=x&&(z=x.getId()))),null!=z&&(p(z).moved[B.previous]=K));return g};-EditorUi.prototype.patchPage=function(b,l,p,g){var x=b==this.currentPage?this.editor.graph.model:new mxGraphModel(b.root),B=this.createParentLookup(x,l);x.beginUpdate();try{var z=x.updateEdgeParent,F=new mxDictionary,K=[];x.updateEdgeParent=function(q,t){!F.get(q)&&g&&(F.put(q,!0),K.push(q))};var M=B[""],L=null!=M&&null!=M.inserted?M.inserted[""]:null,Q=null;null!=L&&(Q=this.getCellForJson(L));if(null==Q){var c=null!=M&&null!=M.moved?M.moved[""]:null;null!=c&&(Q=x.getCell(c))}null!=Q&&(x.setRoot(Q),-b.root=Q,EditorUi.debug("EditorUi.patchPage: Root changed",Q.id));this.patchCellRecursive(b,x,x.root,B,l);if(null!=l[EditorUi.DIFF_REMOVE])for(var f=0;f<l[EditorUi.DIFF_REMOVE].length;f++){c=l[EditorUi.DIFF_REMOVE][f];var k=x.getCell(c);null!=k&&x.remove(k)}if(null!=l[EditorUi.DIFF_UPDATE]){var n=null!=p&&null!=p.cells?p.cells[EditorUi.DIFF_UPDATE]:null;for(c in l[EditorUi.DIFF_UPDATE])k=x.getCell(c),null!=k?this.patchCell(x,k,l[EditorUi.DIFF_UPDATE][c],null!=n?n[c]:null):EditorUi.debug("EditorUi.patchPage: Updated cell not found",-c,"diff",[l[EditorUi.DIFF_UPDATE][c]])}if(null!=l[EditorUi.DIFF_INSERT])for(f=0;f<l[EditorUi.DIFF_INSERT].length;f++)L=l[EditorUi.DIFF_INSERT][f],k=x.getCell(L.id),null!=k&&(x.setTerminal(k,x.getCell(L.source),!0),x.setTerminal(k,x.getCell(L.target),!1));x.updateEdgeParent=z;if(g&&0<K.length)for(f=0;f<K.length;f++)x.contains(K[f])&&x.updateEdgeParent(K[f])}finally{x.endUpdate()}};-EditorUi.prototype.patchCellRecursive=function(b,l,p,g,x){if(null!=p){var B=g[p.getId()],z=null!=B&&null!=B.inserted?B.inserted:{};B=null!=B&&null!=B.moved?B.moved:{};for(var F=0,K=l.getChildCount(p),M="",L=0;L<K;L++){var Q=l.getChildAt(p,L).getId();null==B[M]&&(null==x[EditorUi.DIFF_UPDATE]||null==x[EditorUi.DIFF_UPDATE][Q]||null==x[EditorUi.DIFF_UPDATE][Q].previous&&null==x[EditorUi.DIFF_UPDATE][Q].parent)&&(B[M]=Q);M=Q}K=mxUtils.bind(this,function(c,f){var k=null!=c?c.getId():"";null==k&&EditorUi.debug("EditorUi.patchCellRecursive: Inserting cell with null id",-"cell",c);null!=c&&f&&(f=l.getCell(k),null!=f&&f!=c&&(c=null));null!=c&&(l.getChildAt(p,F)!=c&&l.add(p,c,F),this.patchCellRecursive(b,l,c,g,x),F++);return k});for(M=[null];0<M.length;)if(L=M.shift(),L=K(null!=L?L.child:null,null!=L?L.insert:!1),Q=B[L],null!=Q&&(delete B[L],M.push({child:l.getCell(Q)})),Q=z[L],null!=Q&&(delete z[L],M.push({child:this.getCellForJson(Q),insert:!0})),0==M.length){for(L in B)M.push({child:l.getCell(B[L])}),delete B[L];for(L in z)M.push({child:this.getCellForJson(z[L]),-insert:!0}),delete z[L]}}};+EditorUi.prototype.createParentLookup=function(b,l){function p(O){var J=g[O];null==J&&(J={inserted:[],moved:{}},g[O]=J);return J}var g={};if(null!=l[EditorUi.DIFF_INSERT])for(var x=0;x<l[EditorUi.DIFF_INSERT].length;x++){var A=l[EditorUi.DIFF_INSERT][x],y=null!=A.parent?A.parent:"",G=null!=A.previous?A.previous:"";p(y).inserted[G]=A}if(null!=l[EditorUi.DIFF_UPDATE])for(var L in l[EditorUi.DIFF_UPDATE])A=l[EditorUi.DIFF_UPDATE][L],null!=A.previous&&(y=A.parent,null==y&&(x=b.getCell(L),null!=x&&(x=+b.getParent(x),null!=x&&(y=x.getId()))),null!=y&&(p(y).moved[A.previous]=L));return g};+EditorUi.prototype.patchPage=function(b,l,p,g){var x=b==this.currentPage?this.editor.graph.model:new mxGraphModel(b.root),A=this.createParentLookup(x,l);x.beginUpdate();try{var y=x.updateEdgeParent,G=new mxDictionary,L=[];x.updateEdgeParent=function(q,t){!G.get(q)&&g&&(G.put(q,!0),L.push(q))};var O=A[""],J=null!=O&&null!=O.inserted?O.inserted[""]:null,Q=null;null!=J&&(Q=this.getCellForJson(J));if(null==Q){var c=null!=O&&null!=O.moved?O.moved[""]:null;null!=c&&(Q=x.getCell(c))}null!=Q&&(x.setRoot(Q),+b.root=Q,EditorUi.debug("EditorUi.patchPage: Root changed",Q.id));this.patchCellRecursive(b,x,x.root,A,l);if(null!=l[EditorUi.DIFF_REMOVE])for(var f=0;f<l[EditorUi.DIFF_REMOVE].length;f++){c=l[EditorUi.DIFF_REMOVE][f];var k=x.getCell(c);null!=k&&x.remove(k)}if(null!=l[EditorUi.DIFF_UPDATE]){var n=null!=p&&null!=p.cells?p.cells[EditorUi.DIFF_UPDATE]:null;for(c in l[EditorUi.DIFF_UPDATE])k=x.getCell(c),null!=k?this.patchCell(x,k,l[EditorUi.DIFF_UPDATE][c],null!=n?n[c]:null):EditorUi.debug("EditorUi.patchPage: Updated cell not found",+c,"diff",[l[EditorUi.DIFF_UPDATE][c]])}if(null!=l[EditorUi.DIFF_INSERT])for(f=0;f<l[EditorUi.DIFF_INSERT].length;f++)J=l[EditorUi.DIFF_INSERT][f],k=x.getCell(J.id),null!=k&&(x.setTerminal(k,x.getCell(J.source),!0),x.setTerminal(k,x.getCell(J.target),!1));x.updateEdgeParent=y;if(g&&0<L.length)for(f=0;f<L.length;f++)x.contains(L[f])&&x.updateEdgeParent(L[f])}finally{x.endUpdate()}};+EditorUi.prototype.patchCellRecursive=function(b,l,p,g,x){if(null!=p){var A=g[p.getId()],y=null!=A&&null!=A.inserted?A.inserted:{};A=null!=A&&null!=A.moved?A.moved:{};for(var G=0,L=l.getChildCount(p),O="",J=0;J<L;J++){var Q=l.getChildAt(p,J).getId();null==A[O]&&(null==x[EditorUi.DIFF_UPDATE]||null==x[EditorUi.DIFF_UPDATE][Q]||null==x[EditorUi.DIFF_UPDATE][Q].previous&&null==x[EditorUi.DIFF_UPDATE][Q].parent)&&(A[O]=Q);O=Q}L=mxUtils.bind(this,function(c,f){var k=null!=c?c.getId():"";null==k&&EditorUi.debug("EditorUi.patchCellRecursive: Inserting cell with null id",+"cell",c);null!=c&&f&&(f=l.getCell(k),null!=f&&f!=c&&(c=null));null!=c&&(l.getChildAt(p,G)!=c&&l.add(p,c,G),this.patchCellRecursive(b,l,c,g,x),G++);return k});for(O=[null];0<O.length;)if(J=O.shift(),J=L(null!=J?J.child:null,null!=J?J.insert:!1),Q=A[J],null!=Q&&(delete A[J],O.push({child:l.getCell(Q)})),Q=y[J],null!=Q&&(delete y[J],O.push({child:this.getCellForJson(Q),insert:!0})),0==O.length){for(J in A)O.push({child:l.getCell(A[J])}),delete A[J];for(J in y)O.push({child:this.getCellForJson(y[J]),+insert:!0}),delete y[J]}}};EditorUi.prototype.patchCell=function(b,l,p,g){if(null!=l&&null!=p){if(null==g||null==g.xmlValue&&(null==g.value||""==g.value))"value"in p?b.setValue(l,p.value):null!=p.xmlValue&&b.setValue(l,mxUtils.parseXml(p.xmlValue).documentElement);null!=g&&null!=g.style||null==p.style||b.setStyle(l,p.style);null!=p.visible&&b.setVisible(l,1==p.visible);null!=p.collapsed&&b.setCollapsed(l,1==p.collapsed);null!=p.vertex&&(l.vertex=1==p.vertex);null!=p.edge&&(l.edge=1==p.edge);null!=p.connectable&&(l.connectable=1==p.connectable);null!=p.geometry&&b.setGeometry(l,this.codec.decode(mxUtils.parseXml(p.geometry).documentElement));null!=p.source&&b.setTerminal(l,b.getCell(p.source),!0);null!=p.target&&b.setTerminal(l,b.getCell(p.target),!1);for(var x in p)this.cellProperties[x]||(l[x]=p[x])}};EditorUi.prototype.getXmlForPages=function(b){b=this.getNodeForPages(b);var l=null;null!=b&&(l=mxUtils.getXml(b));return l};EditorUi.prototype.getNodeForPages=function(b){var l=null;if(null!=this.fileNode&&null!=b){l=this.fileNode.cloneNode(!1);for(var p=0;p<b.length;p++){var g=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b[p].root));this.editor.graph.saveViewState(b[p].viewState,g);var x=b[p].node.cloneNode(!1);x.appendChild(g);l.appendChild(x)}}return l};EditorUi.prototype.getPagesForXml=function(b,l){b=mxUtils.parseXml(b);return this.getPagesForNode(b.documentElement,null,l)};-EditorUi.prototype.getPagesForNode=function(b,l,p){var g=this.editor.extractGraphModel(b,!0,!0);null!=g&&(b=g);l=b.getElementsByTagName(l||"diagram");g=[];if(0<l.length)for(b=0;b<l.length;b++){var x=new DiagramPage(l[b]);try{this.updatePageRoot(x,!0)}catch(B){if(!p)throw B;x=null}g.push(x)}else"mxGraphModel"==b.nodeName&&(x=new DiagramPage(b.ownerDocument.createElement("diagram")),x.setName(mxResources.get("pageWithNumber",[1])),x.node.appendChild(b.cloneNode(!0)),g.push(x));return g};-EditorUi.prototype.diffPages=function(b,l){var p=[],g=[],x={},B={},z={},F=null;if(null!=b&&null!=l){for(var K=0;K<l.length;K++)null!=l[K]&&(B[l[K].getId()]={page:l[K],prev:F},F=l[K]);F=null;for(K=0;K<b.length;K++)if(null!=b[K]){var M=b[K].getId(),L=B[M];if(null==L)g.push(M);else{this.updatePageRoot(b[K]);this.updatePageRoot(L.page);var Q=this.diffCells(b[K].root,L.page.root);l={};mxUtils.isEmptyObject(Q)||(l.cells=Q);Q=this.diffViewState(b[K],L.page);mxUtils.isEmptyObject(Q)||(l.view=Q);if((null!=-L.prev?null==F:null!=F)||null!=F&&null!=L.prev&&F.getId()!=L.prev.getId())l.previous=null!=L.prev?L.prev.getId():"";null!=L.page.getName()&&b[K].getName()!=L.page.getName()&&(l.name=L.page.getName());F=b[K].node.getAttribute("viewBox");L=L.page.node.getAttribute("viewBox");L!=F&&(l.viewBox=null!=L?L:"");mxUtils.isEmptyObject(l)||(z[M]=l)}delete B[b[K].getId()];F=b[K]}for(M in B)L=B[M],p.push({id:L.page.getId(),data:mxUtils.getXml(L.page.node),previous:null!=L.prev?L.prev.getId():""});mxUtils.isEmptyObject(z)||-(x[EditorUi.DIFF_UPDATE]=z);0<g.length&&(x[EditorUi.DIFF_REMOVE]=g);0<p.length&&(x[EditorUi.DIFF_INSERT]=p)}return x};EditorUi.prototype.createCellLookup=function(b,l,p){p=null!=p?p:{};null==b.getId()?EditorUi.debug("EditorUi.createCellLookup: Ignored inserted cell with no id",b):p[b.getId()]={cell:b,prev:l};var g=b.getChildCount();l=null;for(var x=0;x<g;x++){var B=b.getChildAt(x);this.createCellLookup(B,l,p);l=B}return p};-EditorUi.prototype.diffCellRecursive=function(b,l,p,g,x){g=null!=g?g:{};var B=p[b.getId()];delete p[b.getId()];if(null==B)null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored removed cell with no id",b):x.push(b.getId());else{var z=this.diffCell(b,B.cell);if(null!=z.parent||(null!=B.prev?null==l:null!=l)||null!=l&&null!=B.prev&&l.getId()!=B.prev.getId())z.previous=null!=B.prev?B.prev.getId():"";mxUtils.isEmptyObject(z)||(null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored changed cell with no id",-b,"diff",z):g[b.getId()]=z)}B=b.getChildCount();l=null;for(z=0;z<B;z++){var F=b.getChildAt(z);this.diffCellRecursive(F,l,p,g,x);l=F}return g};-EditorUi.prototype.diffCells=function(b,l){var p={},g=[],x=this.createCellLookup(l);l.id==b.id?(l=[],b=this.diffCellRecursive(b,null,x,null,l),mxUtils.isEmptyObject(b)||(p[EditorUi.DIFF_UPDATE]=b),0<l.length&&(p[EditorUi.DIFF_REMOVE]=l)):EditorUi.debug("EditorUi.diffCells: Root changed",l.id);for(var B in x)b=x[B],g.push(this.getJsonForCell(b.cell,b.prev));0<g.length&&(p[EditorUi.DIFF_INSERT]=g);return p};-EditorUi.prototype.diffViewState=function(b,l){var p=b.viewState,g=l.viewState,x={};b==this.currentPage&&(p=this.editor.graph.getViewState());l==this.currentPage&&(g=this.editor.graph.getViewState());null==p&&(p=this.editor.graph.createViewState(mxUtils.createXmlDocument().createElement("mxGraphModel")));null==g&&(g=this.editor.graph.createViewState(mxUtils.createXmlDocument().createElement("mxGraphModel")));for(var B in this.viewStateProperties)this.diffViewStateProperty(p,g,B,x);return x};+EditorUi.prototype.getPagesForNode=function(b,l,p){var g=this.editor.extractGraphModel(b,!0,!0);null!=g&&(b=g);l=b.getElementsByTagName(l||"diagram");g=[];if(0<l.length)for(b=0;b<l.length;b++){var x=new DiagramPage(l[b]);try{this.updatePageRoot(x,!0)}catch(A){if(!p)throw A;x=null}g.push(x)}else"mxGraphModel"==b.nodeName&&(x=new DiagramPage(b.ownerDocument.createElement("diagram")),x.setName(mxResources.get("pageWithNumber",[1])),x.node.appendChild(b.cloneNode(!0)),g.push(x));return g};+EditorUi.prototype.diffPages=function(b,l){var p=[],g=[],x={},A={},y={},G=null;if(null!=b&&null!=l){for(var L=0;L<l.length;L++)null!=l[L]&&(A[l[L].getId()]={page:l[L],prev:G},G=l[L]);G=null;for(L=0;L<b.length;L++)if(null!=b[L]){var O=b[L].getId(),J=A[O];if(null==J)g.push(O);else{this.updatePageRoot(b[L]);this.updatePageRoot(J.page);var Q=this.diffCells(b[L].root,J.page.root);l={};mxUtils.isEmptyObject(Q)||(l.cells=Q);Q=this.diffViewState(b[L],J.page);mxUtils.isEmptyObject(Q)||(l.view=Q);if((null!=+J.prev?null==G:null!=G)||null!=G&&null!=J.prev&&G.getId()!=J.prev.getId())l.previous=null!=J.prev?J.prev.getId():"";null!=J.page.getName()&&b[L].getName()!=J.page.getName()&&(l.name=J.page.getName());G=b[L].node.getAttribute("viewBox");J=J.page.node.getAttribute("viewBox");J!=G&&(l.viewBox=null!=J?J:"");mxUtils.isEmptyObject(l)||(y[O]=l)}delete A[b[L].getId()];G=b[L]}for(O in A)J=A[O],p.push({id:J.page.getId(),data:mxUtils.getXml(J.page.node),previous:null!=J.prev?J.prev.getId():""});mxUtils.isEmptyObject(y)||+(x[EditorUi.DIFF_UPDATE]=y);0<g.length&&(x[EditorUi.DIFF_REMOVE]=g);0<p.length&&(x[EditorUi.DIFF_INSERT]=p)}return x};EditorUi.prototype.createCellLookup=function(b,l,p){p=null!=p?p:{};null==b.getId()?EditorUi.debug("EditorUi.createCellLookup: Ignored inserted cell with no id",b):p[b.getId()]={cell:b,prev:l};var g=b.getChildCount();l=null;for(var x=0;x<g;x++){var A=b.getChildAt(x);this.createCellLookup(A,l,p);l=A}return p};+EditorUi.prototype.diffCellRecursive=function(b,l,p,g,x){g=null!=g?g:{};var A=p[b.getId()];delete p[b.getId()];if(null==A)null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored removed cell with no id",b):x.push(b.getId());else{var y=this.diffCell(b,A.cell);if(null!=y.parent||(null!=A.prev?null==l:null!=l)||null!=l&&null!=A.prev&&l.getId()!=A.prev.getId())y.previous=null!=A.prev?A.prev.getId():"";mxUtils.isEmptyObject(y)||(null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored changed cell with no id",+b,"diff",y):g[b.getId()]=y)}A=b.getChildCount();l=null;for(y=0;y<A;y++){var G=b.getChildAt(y);this.diffCellRecursive(G,l,p,g,x);l=G}return g};+EditorUi.prototype.diffCells=function(b,l){var p={},g=[],x=this.createCellLookup(l);l.id==b.id?(l=[],b=this.diffCellRecursive(b,null,x,null,l),mxUtils.isEmptyObject(b)||(p[EditorUi.DIFF_UPDATE]=b),0<l.length&&(p[EditorUi.DIFF_REMOVE]=l)):EditorUi.debug("EditorUi.diffCells: Root changed",l.id);for(var A in x)b=x[A],g.push(this.getJsonForCell(b.cell,b.prev));0<g.length&&(p[EditorUi.DIFF_INSERT]=g);return p};+EditorUi.prototype.diffViewState=function(b,l){var p=b.viewState,g=l.viewState,x={};b==this.currentPage&&(p=this.editor.graph.getViewState());l==this.currentPage&&(g=this.editor.graph.getViewState());null==p&&(p=this.editor.graph.createViewState(mxUtils.createXmlDocument().createElement("mxGraphModel")));null==g&&(g=this.editor.graph.createViewState(mxUtils.createXmlDocument().createElement("mxGraphModel")));for(var A in this.viewStateProperties)this.diffViewStateProperty(p,g,A,x);return x};EditorUi.prototype.diffViewStateProperty=function(b,l,p,g){b=JSON.stringify(this.getViewStateProperty(b,p));l=JSON.stringify(this.getViewStateProperty(l,p));b!=l&&(g[p]=l)};EditorUi.prototype.getViewStateProperty=function(b,l){b=b[l];"backgroundImage"==l&&null!=b&&null!=b.originalSrc?b={originalSrc:b.originalSrc}:"extFonts"==l&&null==b&&(b=[]);return b};EditorUi.prototype.getCellForJson=function(b){var l=null!=b.geometry?this.codec.decode(mxUtils.parseXml(b.geometry).documentElement):null,p=b.value;null!=b.xmlValue&&(p=mxUtils.parseXml(b.xmlValue).documentElement);l=new mxCell(p,l,b.style);l.connectable=0!=b.connectable;l.collapsed=1==b.collapsed;l.visible=0!=b.visible;l.vertex=1==b.vertex;l.edge=1==b.edge;l.id=b.id;for(var g in b)this.cellProperties[g]||(l[g]=b[g]);return l};EditorUi.prototype.getJsonForCell=function(b,l){var p={id:b.getId()};b.vertex&&(p.vertex=1);b.edge&&(p.edge=1);b.connectable||(p.connectable=0);null!=b.parent&&(p.parent=b.parent.getId());null!=l&&(p.previous=l.getId());null!=b.source&&(p.source=b.source.getId());null!=b.target&&(p.target=b.target.getId());null!=b.style&&(p.style=b.style);null!=b.geometry&&(p.geometry=mxUtils.getXml(this.codec.encode(b.geometry)));b.collapsed&&(p.collapsed=1);b.visible||(p.visible=0);null!=b.value&&("object"===typeof b.value&&"number"===typeof b.value.nodeType&&"string"===typeof b.value.nodeName&&"function"===typeof b.value.getAttribute?p.xmlValue=mxUtils.getXml(b.value):p.value=b.value);for(var g in b)this.cellProperties[g]||"function"===typeof b[g]||(p[g]=b[g]);return p};-EditorUi.prototype.diffCell=function(b,l){function p(z){return null!=z&&"object"===typeof z&&"number"===typeof z.nodeType&&"string"===typeof z.nodeName&&"function"===typeof z.getAttribute}var g={};b.vertex!=l.vertex&&(g.vertex=l.vertex?1:0);b.edge!=l.edge&&(g.edge=l.edge?1:0);b.connectable!=l.connectable&&(g.connectable=l.connectable?1:0);if((null!=b.parent?null==l.parent:null!=l.parent)||null!=b.parent&&null!=l.parent&&b.parent.getId()!=l.parent.getId())g.parent=null!=l.parent?l.parent.getId():"";+EditorUi.prototype.diffCell=function(b,l){function p(y){return null!=y&&"object"===typeof y&&"number"===typeof y.nodeType&&"string"===typeof y.nodeName&&"function"===typeof y.getAttribute}var g={};b.vertex!=l.vertex&&(g.vertex=l.vertex?1:0);b.edge!=l.edge&&(g.edge=l.edge?1:0);b.connectable!=l.connectable&&(g.connectable=l.connectable?1:0);if((null!=b.parent?null==l.parent:null!=l.parent)||null!=b.parent&&null!=l.parent&&b.parent.getId()!=l.parent.getId())g.parent=null!=l.parent?l.parent.getId():"";if((null!=b.source?null==l.source:null!=l.source)||null!=b.source&&null!=l.source&&b.source.getId()!=l.source.getId())g.source=null!=l.source?l.source.getId():"";if((null!=b.target?null==l.target:null!=l.target)||null!=b.target&&null!=l.target&&b.target.getId()!=l.target.getId())g.target=null!=l.target?l.target.getId():"";p(b.value)&&p(l.value)?b.value.isEqualNode(l.value)||(g.xmlValue=mxUtils.getXml(l.value)):b.value!=l.value&&(p(l.value)?g.xmlValue=mxUtils.getXml(l.value):g.value=null!=l.value?-l.value:null);b.style!=l.style&&(g.style=l.style);b.visible!=l.visible&&(g.visible=l.visible?1:0);b.collapsed!=l.collapsed&&(g.collapsed=l.collapsed?1:0);if(!this.isObjectEqual(b.geometry,l.geometry,new mxGeometry)){var x=this.codec.encode(l.geometry);null!=x&&(g.geometry=mxUtils.getXml(x))}for(var B in b)this.cellProperties[B]||"function"===typeof b[B]||"function"===typeof l[B]||b[B]==l[B]||(g[B]=void 0===l[B]?null:l[B]);for(B in l)B in b||this.cellProperties[B]||"function"===typeof b[B]||"function"===-typeof l[B]||b[B]==l[B]||(g[B]=void 0===l[B]?null:l[B]);return g};EditorUi.prototype.resolveCrossReferences=function(b,l){var p={};mxUtils.isEmptyObject(l)||(this.adoptTheirPages(b,l,p),this.adoptTheirCells(b,l,p));EditorUi.debug("EditorUi.resolveCrossReferences",[this],"ownDiff",b,"theirDiff",l,"resolve",p);return p};-EditorUi.prototype.adoptTheirPages=function(b,l,p){var g={};if(null!=l[EditorUi.DIFF_INSERT])for(var x=0;x<l[EditorUi.DIFF_INSERT].length;x++)g[l[EditorUi.DIFF_INSERT][x].id]=l[EditorUi.DIFF_INSERT][x];for(var B in b[EditorUi.DIFF_UPDATE])null!=g[B]&&(null==p[EditorUi.DIFF_INSERT]&&(p[EditorUi.DIFF_INSERT]=[]),null==p[EditorUi.DIFF_UPDATE]&&(p[EditorUi.DIFF_UPDATE]={}),p[EditorUi.DIFF_INSERT].push(g[B]),p[EditorUi.DIFF_UPDATE][B]=b[EditorUi.DIFF_UPDATE][B],delete b[EditorUi.DIFF_UPDATE][B])};+l.value:null);b.style!=l.style&&(g.style=l.style);b.visible!=l.visible&&(g.visible=l.visible?1:0);b.collapsed!=l.collapsed&&(g.collapsed=l.collapsed?1:0);if(!this.isObjectEqual(b.geometry,l.geometry,new mxGeometry)){var x=this.codec.encode(l.geometry);null!=x&&(g.geometry=mxUtils.getXml(x))}for(var A in b)this.cellProperties[A]||"function"===typeof b[A]||"function"===typeof l[A]||b[A]==l[A]||(g[A]=void 0===l[A]?null:l[A]);for(A in l)A in b||this.cellProperties[A]||"function"===typeof b[A]||"function"===+typeof l[A]||b[A]==l[A]||(g[A]=void 0===l[A]?null:l[A]);return g};EditorUi.prototype.resolveCrossReferences=function(b,l){var p={};mxUtils.isEmptyObject(l)||(this.adoptTheirPages(b,l,p),this.adoptTheirCells(b,l,p));EditorUi.debug("EditorUi.resolveCrossReferences",[this],"ownDiff",b,"theirDiff",l,"resolve",p);return p};+EditorUi.prototype.adoptTheirPages=function(b,l,p){var g={};if(null!=l[EditorUi.DIFF_INSERT])for(var x=0;x<l[EditorUi.DIFF_INSERT].length;x++)g[l[EditorUi.DIFF_INSERT][x].id]=l[EditorUi.DIFF_INSERT][x];for(var A in b[EditorUi.DIFF_UPDATE])null!=g[A]&&(null==p[EditorUi.DIFF_INSERT]&&(p[EditorUi.DIFF_INSERT]=[]),null==p[EditorUi.DIFF_UPDATE]&&(p[EditorUi.DIFF_UPDATE]={}),p[EditorUi.DIFF_INSERT].push(g[A]),p[EditorUi.DIFF_UPDATE][A]=b[EditorUi.DIFF_UPDATE][A],delete b[EditorUi.DIFF_UPDATE][A])};EditorUi.prototype.adoptTheirCells=function(b,l,p){for(var g in b[EditorUi.DIFF_UPDATE]){var x=b[EditorUi.DIFF_UPDATE][g];null!=x.cells&&this.adoptTheirCellsFromPage(x,l,g,p)}};-EditorUi.prototype.adoptTheirCellsFromPage=function(b,l,p,g){var x=null!=l[EditorUi.DIFF_UPDATE]?l[EditorUi.DIFF_UPDATE][p]:null;if(null!=x&&null!=x.cells&&null!=x.cells[EditorUi.DIFF_INSERT]){l=x.cells[EditorUi.DIFF_UPDATE];for(var B={},z=0;z<x.cells[EditorUi.DIFF_INSERT].length;z++){var F=x.cells[EditorUi.DIFF_INSERT][z];B[F.id]=F}x={cells:{}};x.cells[EditorUi.DIFF_INSERT]=[];x.cells[EditorUi.DIFF_UPDATE]={};x.inserted={};this.resolveOwnInsertedCells(b.cells[EditorUi.DIFF_INSERT],B,x);this.resolveOwnUpdatedCells(b.cells[EditorUi.DIFF_UPDATE],-B,l,x);null==g[EditorUi.DIFF_UPDATE]&&(g[EditorUi.DIFF_UPDATE]={});delete x.inserted;g[EditorUi.DIFF_UPDATE][p]=x}};EditorUi.prototype.resolveOwnInsertedCells=function(b,l,p){if(null!=b)for(var g=0;g<b.length;g++){var x=b[g];null!=x&&(this.adoptParentCell(x.id,null,l,p),this.adoptTerminalCell(x.id,x,l,!0,p),this.adoptTerminalCell(x.id,x,l,!1,p))}};-EditorUi.prototype.resolveOwnUpdatedCells=function(b,l,p,g){if(null!=b)for(var x in b){var B=l[x];null!=B?(g.inserted[x]||(g.cells[EditorUi.DIFF_INSERT].push(B),g.inserted[x]=!0),g.cells[EditorUi.DIFF_UPDATE][x]=b[x]):null!=p&&(B=p[x],null!=B&&(this.adoptParentCell(x,B,l,g),this.adoptTerminalCell(x,B,l,!0,g,x),this.adoptTerminalCell(x,B,l,!1,g,x)))}};-EditorUi.prototype.adoptParentCell=function(b,l,p,g){var x=p[b],B=null!=l?l.parent:null!=x?x.parent:null;null!=B&&this.adoptParentCell(B,null,p,g);null!=x?g.inserted[b]||(g.cells[EditorUi.DIFF_INSERT].push(x),g.inserted[b]=!0):null!=l&&(null==g.cells[EditorUi.DIFF_UPDATE][b]&&(g.cells[EditorUi.DIFF_UPDATE][b]={}),g.cells[EditorUi.DIFF_UPDATE][b]=l)};+EditorUi.prototype.adoptTheirCellsFromPage=function(b,l,p,g){var x=null!=l[EditorUi.DIFF_UPDATE]?l[EditorUi.DIFF_UPDATE][p]:null;if(null!=x&&null!=x.cells&&null!=x.cells[EditorUi.DIFF_INSERT]){l=x.cells[EditorUi.DIFF_UPDATE];for(var A={},y=0;y<x.cells[EditorUi.DIFF_INSERT].length;y++){var G=x.cells[EditorUi.DIFF_INSERT][y];A[G.id]=G}x={cells:{}};x.cells[EditorUi.DIFF_INSERT]=[];x.cells[EditorUi.DIFF_UPDATE]={};x.inserted={};this.resolveOwnInsertedCells(b.cells[EditorUi.DIFF_INSERT],A,x);this.resolveOwnUpdatedCells(b.cells[EditorUi.DIFF_UPDATE],+A,l,x);null==g[EditorUi.DIFF_UPDATE]&&(g[EditorUi.DIFF_UPDATE]={});delete x.inserted;g[EditorUi.DIFF_UPDATE][p]=x}};EditorUi.prototype.resolveOwnInsertedCells=function(b,l,p){if(null!=b)for(var g=0;g<b.length;g++){var x=b[g];null!=x&&(this.adoptParentCell(x.id,null,l,p),this.adoptTerminalCell(x.id,x,l,!0,p),this.adoptTerminalCell(x.id,x,l,!1,p))}};+EditorUi.prototype.resolveOwnUpdatedCells=function(b,l,p,g){if(null!=b)for(var x in b){var A=l[x];null!=A?(g.inserted[x]||(g.cells[EditorUi.DIFF_INSERT].push(A),g.inserted[x]=!0),g.cells[EditorUi.DIFF_UPDATE][x]=b[x]):null!=p&&(A=p[x],null!=A&&(this.adoptParentCell(x,A,l,g),this.adoptTerminalCell(x,A,l,!0,g,x),this.adoptTerminalCell(x,A,l,!1,g,x)))}};+EditorUi.prototype.adoptParentCell=function(b,l,p,g){var x=p[b],A=null!=l?l.parent:null!=x?x.parent:null;null!=A&&this.adoptParentCell(A,null,p,g);null!=x?g.inserted[b]||(g.cells[EditorUi.DIFF_INSERT].push(x),g.inserted[b]=!0):null!=l&&(null==g.cells[EditorUi.DIFF_UPDATE][b]&&(g.cells[EditorUi.DIFF_UPDATE][b]={}),g.cells[EditorUi.DIFF_UPDATE][b]=l)};EditorUi.prototype.adoptTerminalCell=function(b,l,p,g,x){l=g?l.source:l.target;p=p[l];null!=p&&(x.inserted[l]||(x.cells[EditorUi.DIFF_INSERT].push(p),x.inserted[l]=!0),null==x.cells[EditorUi.DIFF_UPDATE][b]&&(x.cells[EditorUi.DIFF_UPDATE][b]={}),x.cells[EditorUi.DIFF_UPDATE][b][g?"source":"target"]=l)};-EditorUi.prototype.isObjectEqual=function(b,l,p){if(null==b&&null==l)return!0;if(null!=b?null==l:null!=l)return!1;var g=function(x,B){return null==p||p[x]!=B?!0===B?1:B:void 0};return JSON.stringify(b,g)==JSON.stringify(l,g)};var mxSettings={currentVersion:18,defaultFormatWidth:600>screen.width?"0":"240",key:Editor.settingsKey,getLanguage:function(){return mxSettings.settings.language},setLanguage:function(b){mxSettings.settings.language=b},isMainSettings:function(){return".drawio-config"==mxSettings.key},getMainSettings:function(){var b=localStorage.getItem(".drawio-config");null==b?(b=mxSettings.getDefaults(),delete b.isNew):(b=JSON.parse(b),b.version=mxSettings.currentVersion);return b},getUi:function(){return mxSettings.isMainSettings()?+EditorUi.prototype.isObjectEqual=function(b,l,p){if(null==b&&null==l)return!0;if(null!=b?null==l:null!=l)return!1;var g=function(x,A){return null==p||p[x]!=A?!0===A?1:A:void 0};return JSON.stringify(b,g)==JSON.stringify(l,g)};var mxSettings={currentVersion:18,defaultFormatWidth:600>screen.width?"0":"240",key:Editor.settingsKey,getLanguage:function(){return mxSettings.settings.language},setLanguage:function(b){mxSettings.settings.language=b},isMainSettings:function(){return".drawio-config"==mxSettings.key},getMainSettings:function(){var b=localStorage.getItem(".drawio-config");null==b?(b=mxSettings.getDefaults(),delete b.isNew):(b=JSON.parse(b),b.version=mxSettings.currentVersion);return b},getUi:function(){return mxSettings.isMainSettings()?mxSettings.settings.ui:mxSettings.getMainSettings().ui},setUi:function(b){if(mxSettings.isMainSettings())mxSettings.settings.ui=b,mxSettings.save();else{var l=mxSettings.getMainSettings();l.ui=b;localStorage.setItem(".drawio-config",JSON.stringify(l))}},getCurrentEdgeStyle:function(){return null!=mxSettings.settings?mxSettings.settings.currentEdgeStyle:null},setCurrentEdgeStyle:function(b){mxSettings.settings.currentEdgeStyle=b;mxSettings.save()},getGridColor:function(b){var l=b?mxSettings.settings.darkGridColor:mxSettings.settings.gridColor;mxUtils.isLightDarkColor(l)&&(l=mxUtils.getLightDarkColor(l),l=b?l.dark:l.light);return l},setGridColor:function(b,l){l?mxSettings.settings.darkGridColor=b:mxSettings.settings.gridColor=b},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(b){mxSettings.settings.autosave=b},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(b){mxSettings.settings.resizeImages=b},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(b){mxSettings.settings.openCounter=b},setCustomFonts:function(b){mxSettings.settings.customFonts=b},getCustomFonts:function(){for(var b=mxSettings.settings.customFonts||[],l=0;l<b.length;l++)"string"===typeof b[l]&&(b[l]={name:b[l],url:null});return b},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(b){mxSettings.settings.libraries=b},addCustomLibrary:function(b){mxSettings.load();Array.isArray(mxSettings.settings.customLibraries)||(mxSettings.settings.customLibraries=@@ -14521,7 +14525,7 @@ delete mxSettings.settings.lastAlert,null==mxSettings.settings.pageFormat&&(mxSeEditorUi.isElectronApp&&null==localStorage.getItem("._autoSaveTrans_")&&(localStorage.setItem("._autoSaveTrans_","1"),mxSettings.settings.autosave=!1,mxSettings.save()),null!=mxSettings.settings.scratchpadSeen&&delete mxSettings.settings.scratchpadSeen)},clear:function(){isLocalStorage&&localStorage.removeItem(mxSettings.key)}};("undefined"==typeof mxLoadSettings||mxLoadSettings)&&mxSettings.load();DrawioFilePolling=function(b,l){this.file=b;this.sync=l};DrawioFilePolling.prototype.maxRetries=2;DrawioFilePolling.prototype.minPollDelay=2E3;DrawioFilePolling.prototype.start=function(b){if(!this.isConnected()){this.delay=this.maxDelay=b;var l=mxUtils.bind(this,function(){this.poll(0,p)}),p=mxUtils.bind(this,function(){this.thread=setTimeout(l,this.delay);this.delay=Math.min(this.maxDelay,this.delay+2E3)});p();EditorUi.debug("DrawioFilePolling.start",[this],"thread",this.thread,"delay",b,"rev",this.file.getCurrentRevisionId())}};DrawioFilePolling.prototype.updateStatus=function(){this.hasOtherWriters()&&(this.sync.lastMessage=mxResources.get("otherUsersEditing"));this.sync.lastModified=this.file.getLastModifiedDate();this.sync.updateStatus()};-DrawioFilePolling.prototype.poll=function(b,l){b=null!=b?b:0;var p=mxUtils.bind(this,function(g){b<this.maxRetries?this.retryPoll(mxUtils.bind(this,function(){this.poll(b+1,l)})):l()});this.file.getLatestVersionId(mxUtils.bind(this,function(g){if(-1!=g){var x=this.file.getCurrentRevisionId();g!=x?this.file.getLatestVersion(mxUtils.bind(this,function(B){this.file.mergeFile(B,mxUtils.bind(this,function(){this.delay=this.minPollDelay;this.lastOtherWriter=Date.now();this.updateStatus();l()}),p)}),p):+DrawioFilePolling.prototype.poll=function(b,l){b=null!=b?b:0;var p=mxUtils.bind(this,function(g){b<this.maxRetries?this.retryPoll(mxUtils.bind(this,function(){this.poll(b+1,l)})):l()});this.file.getLatestVersionId(mxUtils.bind(this,function(g){if(-1!=g){var x=this.file.getCurrentRevisionId();g!=x?this.file.getLatestVersion(mxUtils.bind(this,function(A){this.file.mergeFile(A,mxUtils.bind(this,function(){this.delay=this.minPollDelay;this.lastOtherWriter=Date.now();this.updateStatus();l()}),p)}),p):(this.updateStatus(),l())}else l()}),p)};DrawioFilePolling.prototype.retryPoll=function(b){var l=300+300*Math.random();window.setTimeout(b,l);EditorUi.debug("StorageFile.retryPoll",[this],"delay",l)};DrawioFilePolling.prototype.stop=function(){EditorUi.debug("DrawioFilePolling.stop",[this],"thread",this.thread);clearTimeout(this.thread);this.thread=null};DrawioFilePolling.prototype.isConnected=function(){return null!=this.thread};DrawioFilePolling.prototype.hasOtherWriters=function(){return null!=this.lastOtherWriter&&6E4>Date.now()-this.lastOtherWriter};DrawioFileSync=function(b){mxEventSource.call(this);this.lastActivity=Date.now();this.clientId=Editor.guid();this.ui=b.ui;this.file=b;this.onlineListener=mxUtils.bind(this,function(){this.updateOnlineState();this.isConnected()&&!this.ui.isOffline(!0)?this.fileChangedNotify():this.updateStatus()});mxEvent.addListener(window,"offline",this.onlineListener);mxEvent.addListener(window,"online",this.onlineListener);this.autosaveListener=mxUtils.bind(this,function(){this.updateRealtime()});this.ui.editor.addListener("autosaveChanged",this.autosaveListener);this.visibleListener=mxUtils.bind(this,function(){"hidden"==document.visibilityState?this.isConnected()&&this.stop():this.start()});mxEvent.addListener(document,"visibilitychange",this.visibleListener);this.activityListener=mxUtils.bind(this,function(l){this.lastActivity=Date.now();this.start()});mxEvent.addListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.activityListener);mxEvent.addListener(document,"keypress",this.activityListener);mxEvent.addListener(window,@@ -14552,45 +14556,45 @@ DrawioFileSync.prototype.fileChangedNotify=function(b,l){if(this.isValidState())this.notifyThread!=p}),!0,l)};DrawioFileSync.prototype.localFileChanged=function(){this.file.isRealtime()&&(window.clearTimeout(this.triggerSendThread),this.localFileWasChanged=!0,this.scheduleCleanup(!0),this.triggerSendThread=window.setTimeout(mxUtils.bind(this,function(){this.sendLocalChanges()}),Math.min(this.file.autosaveDelay,this.syncSendMessageDelay-20)))};DrawioFileSync.prototype.doSendLocalChanges=function(b){if(!this.file.ignorePatches(b)){var l=this.clientId+"."+this.syncChangeCounter++,p=this.createMessage({a:"change",c:b,id:l,t:Date.now()});l=!1;null!=this.p2pCollab?this.p2pCollab.sendDiff(p):"1"==urlParams.dev?(p=encodeURIComponent(this.objectToString(p)),0==this.maxSyncMessageSize||p.length<this.maxSyncMessageSize?mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&msg="+p):l=!0):l=!0;EditorUi.debug("DrawioFileSync.doSendLocalChanges",[this],"changes",b,l?"(skipped)":"")}};-DrawioFileSync.prototype.receiveRemoteChanges=function(b){this.file.ignorePatches(b.c)||(null==this.receivedData?(this.receivedData=[b],window.setTimeout(mxUtils.bind(this,function(){if(this.ui.getCurrentFile()==this.file)if(1==this.receivedData.length)this.doReceiveRemoteChanges(this.receivedData[0].c);else{this.receivedData.sort(function(x,B){return x.id<B.id?-1:x.id>B.id?1:0});for(var l=null,p=0;p<this.receivedData.length;p++){var g=JSON.stringify(this.receivedData[p].c);g!=l&&this.doReceiveRemoteChanges(this.receivedData[p].c);+DrawioFileSync.prototype.receiveRemoteChanges=function(b){this.file.ignorePatches(b.c)||(null==this.receivedData?(this.receivedData=[b],window.setTimeout(mxUtils.bind(this,function(){if(this.ui.getCurrentFile()==this.file)if(1==this.receivedData.length)this.doReceiveRemoteChanges(this.receivedData[0].c);else{this.receivedData.sort(function(x,A){return x.id<A.id?-1:x.id>A.id?1:0});for(var l=null,p=0;p<this.receivedData.length;p++){var g=JSON.stringify(this.receivedData[p].c);g!=l&&this.doReceiveRemoteChanges(this.receivedData[p].c);l=g}}this.receivedData=null}),this.syncReceiveMessageDelay)):this.receivedData.push(b))};DrawioFileSync.prototype.scheduleCleanup=function(b){var l=Math.min(15,Math.floor(this.file.getSize()/5E6));l=0==b?0:this.cleanupDelay+1E3*l;var p=this.cleanupThread;if(1!=b||null!=this.cleanupThread)window.clearTimeout(this.cleanupThread),this.cleanupThread=window.setTimeout(mxUtils.bind(this,function(){this.cleanup(null,mxUtils.bind(this,function(g){this.file.handleFileError(g)}))}),l);EditorUi.debug("DrawioFileSync.scheduleCleanup",[this],"lazy",b,"delay",l,"prev",p,"thread",this.cleanupThread)};DrawioFileSync.prototype.cleanup=function(b,l,p){var g=this.cleanupThread;window.clearTimeout(this.cleanupThread);this.cleanupThread=null;if(this.isValidState()&&!this.file.inConflictState&&this.file.isRealtime()&&!this.file.isModified()){var x=[this.ui.diffPages(this.ui.pages,this.file.ownPages)];this.file.theirPages=this.ui.clonePages(this.file.ownPages);"1"==urlParams.test&&EditorUi.debug("DrawioFileSync.cleanup",[this],"thread",g,"patches",x,"checkFile",p,"checksum",this.ui.getHashValueForPages(this.ui.pages));-this.file.ignorePatches(x)||this.file.patch(x);p?this.file.getLatestVersion(mxUtils.bind(this,function(B){try{if(this.isValidState()&&!this.file.inConflictState&&this.file.isRealtime()){var z=B.getShadowPages();x=[this.ui.diffPages(this.ui.pages,z),this.ui.diffPages(z,this.file.ownPages)];this.file.ignorePatches(x)||this.file.patch(x);EditorUi.debug("DrawioFileSync.cleanup",[this],"newFile",B,"patches",x)}null!=b&&b()}catch(F){null!=l&&l(F)}}),l):(document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||+this.file.ignorePatches(x)||this.file.patch(x);p?this.file.getLatestVersion(mxUtils.bind(this,function(A){try{if(this.isValidState()&&!this.file.inConflictState&&this.file.isRealtime()){var y=A.getShadowPages();x=[this.ui.diffPages(this.ui.pages,y),this.ui.diffPages(y,this.file.ownPages)];this.file.ignorePatches(x)||this.file.patch(x);EditorUi.debug("DrawioFileSync.cleanup",[this],"newFile",A,"patches",x)}null!=b&&b()}catch(G){null!=l&&l(G)}}),l):(document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||this.testChecksum(),null!=b&&b())}else null!=b&&(b(),EditorUi.debug("DrawioFileSync.cleanup",[this],"checkFile",p,"modified",this.file.isModified()))};-DrawioFileSync.prototype.testChecksum=function(){var b=this.ui.getHashValueForPages(this.ui.pages),l=this.file.getCurrentRevisionId();this.file.getLatestVersion(mxUtils.bind(this,function(p){if(!document.hidden){var g=this.ui.getHashValueForPages(p.getShadowPages()),x=p.getDescriptorChecksum(p.getDescriptor()),B=p.getCurrentRevisionId();EditorUi.debug("DrawioFileSync.testChecksum","local",[this.file],"modified",this.file.isModified(),"inConflictState",this.file.inConflictState,"autosaveThread",this.file.autosaveThread,-"savingFile",this.file.savingFile,"localFileWasChanged",this.localFileWasChanged,"remoteFileChanged",this.remoteFileChanged,"cleanup",this.cleanupThread,"checksum",b);EditorUi.debug("DrawioFileSync.testChecksum","remote",[p],"rev",B==l,"desc",x==g,"checksum",g);g!=b?(EditorUi.debug("DrawioFileSync.testChecksum",[this],"checksums do not match"),this.ui.alert("Checksums do not match")):EditorUi.debug("DrawioFileSync.testChecksum",[this],"checksums match")}}),mxUtils.bind(this,function(p){EditorUi.debug("DrawioFileSync.testChecksum",+DrawioFileSync.prototype.testChecksum=function(){var b=this.ui.getHashValueForPages(this.ui.pages),l=this.file.getCurrentRevisionId();this.file.getLatestVersion(mxUtils.bind(this,function(p){if(!document.hidden){var g=this.ui.getHashValueForPages(p.getShadowPages()),x=p.getDescriptorChecksum(p.getDescriptor()),A=p.getCurrentRevisionId();EditorUi.debug("DrawioFileSync.testChecksum","local",[this.file],"modified",this.file.isModified(),"inConflictState",this.file.inConflictState,"autosaveThread",this.file.autosaveThread,+"savingFile",this.file.savingFile,"localFileWasChanged",this.localFileWasChanged,"remoteFileChanged",this.remoteFileChanged,"cleanup",this.cleanupThread,"checksum",b);EditorUi.debug("DrawioFileSync.testChecksum","remote",[p],"rev",A==l,"desc",x==g,"checksum",g);g!=b?(EditorUi.debug("DrawioFileSync.testChecksum",[this],"checksums do not match"),this.ui.alert("Checksums do not match")):EditorUi.debug("DrawioFileSync.testChecksum",[this],"checksums match")}}),mxUtils.bind(this,function(p){EditorUi.debug("DrawioFileSync.testChecksum",[this],"checksum test error",p)}))};DrawioFileSync.prototype.extractLocal=function(b){return mxUtils.isEmptyObject(b)?{}:this.ui.diffPages(this.file.theirPages,this.ui.patchPages(this.ui.clonePages(this.file.theirPages),b))};DrawioFileSync.prototype.extractRemove=function(b){var l={};null!=b[EditorUi.DIFF_REMOVE]&&(l[EditorUi.DIFF_REMOVE]=b[EditorUi.DIFF_REMOVE]);if(null!=b[EditorUi.DIFF_UPDATE])for(var p in b[EditorUi.DIFF_UPDATE]){var g=b[EditorUi.DIFF_UPDATE][p];if(null!=g.cells&&null!=g.cells[EditorUi.DIFF_REMOVE]){null==l[EditorUi.DIFF_UPDATE]&&(l[EditorUi.DIFF_UPDATE]={});l[EditorUi.DIFF_UPDATE][p]={};var x=l[EditorUi.DIFF_UPDATE][p];x.cells={};x.cells[EditorUi.DIFF_REMOVE]=g.cells[EditorUi.DIFF_REMOVE]}}return l};-DrawioFileSync.prototype.patchRealtime=function(b,l,p,g){var x=null;if(this.file.isRealtime()){x=this.extractRemove(this.ui.diffPages(this.file.getShadowPages(),this.ui.pages));var B=this.extractRemove(this.extractLocal(x)),z=(null==p?b:b.concat(p)).concat([B]);this.file.ownPages=this.ui.applyPatches(this.file.ownPages,z,!0,l);mxUtils.isEmptyObject(B)?this.scheduleCleanup(null!=g?!1:null):this.file.fileChanged(!1);EditorUi.debug("DrawioFileSync.patchRealtime",[this],"patches",b,"backup",l,"own",p,-"all",x,"local",B,"applied",z,"immediate",g)}return x};DrawioFileSync.prototype.isRealtimeActive=function(){return this.ui.editor.autosave};+DrawioFileSync.prototype.patchRealtime=function(b,l,p,g){var x=null;if(this.file.isRealtime()){x=this.extractRemove(this.ui.diffPages(this.file.getShadowPages(),this.ui.pages));var A=this.extractRemove(this.extractLocal(x)),y=(null==p?b:b.concat(p)).concat([A]);this.file.ownPages=this.ui.applyPatches(this.file.ownPages,y,!0,l);mxUtils.isEmptyObject(A)?this.scheduleCleanup(null!=g?!1:null):this.file.fileChanged(!1);EditorUi.debug("DrawioFileSync.patchRealtime",[this],"patches",b,"backup",l,"own",p,+"all",x,"local",A,"applied",y,"immediate",g)}return x};DrawioFileSync.prototype.isRealtimeActive=function(){return this.ui.editor.autosave};DrawioFileSync.prototype.sendLocalChanges=function(){try{if(this.file.isRealtime()&&this.localFileWasChanged){var b=this.ui.clonePages(this.ui.pages),l=this.ui.diffPages(this.snapshot,b),p=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;p!=this.snapshotVars&&(l[EditorUi.DIFF_FILE]={vars:p});this.snapshotVars=p;this.file.ownPages=this.ui.patchPages(this.file.ownPages,l,!0);this.snapshot=b;var g=this.ui.resolveCrossReferences(l,this.ui.diffPages(this.file.ownPages,this.ui.pages));this.file.ownPages=this.ui.patchPages(this.file.ownPages,g,!0);this.isRealtimeActive()&&this.doSendLocalChanges([g,l])}this.localFileWasChanged=!1}catch(x){b=this.file.getCurrentUser(),b=null!=b?b.id:"unknown",EditorUi.logError("Error in sendLocalChanges",null,this.file.getMode()+"."+this.file.getId(),b,x)}};DrawioFileSync.prototype.doReceiveRemoteChanges=function(b){this.file.isRealtime()&&this.isRealtimeActive()&&(this.sendLocalChanges(),this.file.patch(b),this.file.theirPages=this.ui.applyPatches(this.file.theirPages,b),this.scheduleCleanup(),EditorUi.debug("DrawioFileSync.doReceiveRemoteChanges",[this],"changes",b))};-DrawioFileSync.prototype.merge=function(b,l,p,g,x,B,z){try{this.file.stats.merged++;this.lastModified=new Date;var F=this.file.getDescriptorRevisionId(p);if(!this.file.ignorePatches(b)){this.sendLocalChanges();var K=this.ui.clonePages(this.file.getShadowPages()),M=this.file.isModified()&&!this.file.isRealtime()?this.ui.diffPages(K,this.ui.pages):null,L=this.file.isRealtime()?this.ui.diffPages(K,this.file.ownPages):null;K=this.ui.applyPatches(K,b);var Q=null==l?null:this.ui.getHashValueForPages(K);-EditorUi.debug("DrawioFileSync.merge",[this],"patches",b,"changes",M,"pending",L,"checksum",l,"current",Q,"valid",l==Q,"attempt",this.catchupRetryCount,"of",this.maxCatchupRetries,"from",this.file.getCurrentRevisionId(),"to",F,"etag",this.file.getDescriptorEtag(p),"immediate",z);if(null!=l&&l!=Q){this.reload(mxUtils.bind(this,function(){null!=g&&g()}),mxUtils.bind(this,function(){null!=x&&x()}),B,null,z);return}var c=this.file.getShadowVars();for(l=0;l<b.length;l++)null!=b[l]&&null!=b[l][EditorUi.DIFF_FILE]&&-void 0!==b[l][EditorUi.DIFF_FILE].vars&&(c=b[l][EditorUi.DIFF_FILE].vars);this.file.setShadowPages(K,c);if(null==this.patchRealtime(b,null,L,z))this.file.patch(b,DrawioFile.LAST_WRITE_WINS?M:null);else{var f=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var k=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;f!=k&&(this.ui.editor.graph.refresh(),this.snapshotVars=k)}}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),+DrawioFileSync.prototype.merge=function(b,l,p,g,x,A,y){try{this.file.stats.merged++;this.lastModified=new Date;var G=this.file.getDescriptorRevisionId(p);if(!this.file.ignorePatches(b)){this.sendLocalChanges();var L=this.ui.clonePages(this.file.getShadowPages()),O=this.file.isModified()&&!this.file.isRealtime()?this.ui.diffPages(L,this.ui.pages):null,J=this.file.isRealtime()?this.ui.diffPages(L,this.file.ownPages):null;L=this.ui.applyPatches(L,b);var Q=null==l?null:this.ui.getHashValueForPages(L);+EditorUi.debug("DrawioFileSync.merge",[this],"patches",b,"changes",O,"pending",J,"checksum",l,"current",Q,"valid",l==Q,"attempt",this.catchupRetryCount,"of",this.maxCatchupRetries,"from",this.file.getCurrentRevisionId(),"to",G,"etag",this.file.getDescriptorEtag(p),"immediate",y);if(null!=l&&l!=Q){this.reload(mxUtils.bind(this,function(){null!=g&&g()}),mxUtils.bind(this,function(){null!=x&&x()}),A,null,y);return}var c=this.file.getShadowVars();for(l=0;l<b.length;l++)null!=b[l]&&null!=b[l][EditorUi.DIFF_FILE]&&+void 0!==b[l][EditorUi.DIFF_FILE].vars&&(c=b[l][EditorUi.DIFF_FILE].vars);this.file.setShadowPages(L,c);if(null==this.patchRealtime(b,null,J,y))this.file.patch(b,DrawioFile.LAST_WRITE_WINS?O:null);else{var f=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var k=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;f!=k&&(this.ui.editor.graph.refresh(),this.snapshotVars=k)}}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),p);null!=g&&g(!0)}catch(t){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=x&&x(t);try{var n=this.file.getCurrentUser(),q=null!=n?n.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),q,t)}catch(u){}}};-DrawioFileSync.prototype.fileChanged=function(b,l,p,g,x){var B=window.setTimeout(mxUtils.bind(this,function(){null!=p&&p()||(EditorUi.debug("DrawioFileSync.fileChanged",[this],"lazy",g,"immediate",x,"remoteFileChanged",this.remoteFileChanged,"valid",this.isValidState()),this.isValidState()?(this.remoteFileChanged=!1,this.file.loadPatchDescriptor(mxUtils.bind(this,function(z){null!=p&&p()||(this.isValidState()?this.catchup(z,b,l,p,x):null!=l&&l())}),l)):null!=l&&l())}),g?this.cacheReadyDelay:0);return this.notifyThread=-B};+DrawioFileSync.prototype.fileChanged=function(b,l,p,g,x){var A=window.setTimeout(mxUtils.bind(this,function(){null!=p&&p()||(EditorUi.debug("DrawioFileSync.fileChanged",[this],"lazy",g,"immediate",x,"remoteFileChanged",this.remoteFileChanged,"valid",this.isValidState()),this.isValidState()?(this.remoteFileChanged=!1,this.file.loadPatchDescriptor(mxUtils.bind(this,function(y){null!=p&&p()||(this.isValidState()?this.catchup(y,b,l,p,x):null!=l&&l())}),l)):null!=l&&l())}),g?this.cacheReadyDelay:0);return this.notifyThread=+A};DrawioFileSync.prototype.fastForward=function(b){this.file.patchDescriptor(this.file.getDescriptor(),b);this.file.setShadowPages(this.ui.clonePages(this.ui.pages));this.file.theirPages=this.ui.clonePages(this.ui.pages);var l=this.file.ownPages;this.file.ownPages=this.ui.clonePages(this.ui.pages);for(var p=0;p<this.file.ownPages.length;p++)null!=l[p]&&this.ui.getHashValueForPages([this.file.ownPages[p]])!=this.ui.getHashValueForPages([l[p]])&&(this.file.ownPages[p].needsUpdate=!0);this.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;l=this.cleanupThread;window.clearTimeout(this.cleanupThread);this.cleanupThread=null;"1"==urlParams.test&&EditorUi.debug("DrawioFileSync.fastForward",[this],"desc",[b],"cleanup",l,"checksum",this.ui.getHashValueForPages(this.ui.pages));document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||null!=this.cleanupThread||this.testChecksum()};DrawioFileSync.prototype.reloadDescriptor=function(){this.file.loadDescriptor(mxUtils.bind(this,function(b){null!=b?(this.file.setDescriptorRevisionId(b,this.file.getCurrentRevisionId()),this.updateDescriptor(b),this.fileChangedNotify()):(this.file.inConflictState=!0,this.file.handleFileError())}),mxUtils.bind(this,function(b){this.file.inConflictState=!0;this.file.handleFileError(b)}))};DrawioFileSync.prototype.updateDescriptor=function(b){this.file.setDescriptor(b);this.file.descriptorChanged();this.start()};-DrawioFileSync.prototype.catchup=function(b,l,p,g,x){if(null!=b&&(null==g||!g())){var B=this.file.getCurrentRevisionId(),z=this.file.getDescriptorRevisionId(b);EditorUi.debug("DrawioFileSync.catchup",[this],"desc",[b],"from",B,"to",z,"immediate",x,"valid",this.isValidState());if(B==z)this.file.patchDescriptor(this.file.getDescriptor(),b),"1"==urlParams.test&&EditorUi.debug("DrawioFileSync.catchup",[this],"up to date","cleanup",this.cleanupThread,"checksum",this.ui.getHashValueForPages(this.ui.pages)),-document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||null!=this.cleanupThread||this.testChecksum(),null!=l&&l(!0);else if(this.isValidState()){var F=this.file.getDescriptorChecksum(b),K=this.file.getDescriptorSecret(b);if(null!=F&&F==this.ui.getHashValueForPages(this.ui.pages))this.fastForward(b),null!=l&&l(!0);else if(Editor.enableRealtimeCache&&null!=K&&"1"!=urlParams.lockdown){var M=0,L=!1,Q=mxUtils.bind(this,function(){if(null==g||!g())if(B!=this.file.getCurrentRevisionId())null!=l&&-l(!0);else if(this.isValidState()){this.scheduleCleanup(!0);var c=!0,f=window.setTimeout(mxUtils.bind(this,function(){c=!1;this.reload(l,p,g,null,x)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(B)+"&to="+encodeURIComponent(z)+(null!=K?"&secret="+encodeURIComponent(K):""),mxUtils.bind(this,function(k){this.file.stats.bytesReceived+=k.getText().length;window.clearTimeout(f);if(c&&(null==g||!g()))if(B!=this.file.getCurrentRevisionId())null!=-l&&l(!0);else if(this.isValidState()){var n=null,q=[];EditorUi.debug("DrawioFileSync.doCatchup",[this],"request",[k],"status",k.getStatus(),"cacheReadyRetryCount",M,"maxCacheReadyRetries",this.maxCacheReadyRetries);if(200<=k.getStatus()&&299>=k.getStatus()&&0<k.getText().length)try{var t=JSON.parse(k.getText());if(null!=t&&0<t.length)for(var u=0;u<t.length;u++){var y=this.stringToObject(t[u]);if(y.v>DrawioFileSync.PROTOCOL){L=!0;q=[];break}else if(y.v===DrawioFileSync.PROTOCOL&&null!=y.d)n=y.d.checksum,-q.push(y.d.patch);else{L=!0;q=[];break}}EditorUi.debug("DrawioFileSync.doCatchup",[this],"response",[t],"status",L?"failed":"ok","temp",q,"checksum",n)}catch(E){q=[],null!=window.console&&"1"==urlParams.test&&console.log(E)}try{0<q.length?(this.file.stats.cacheHits++,this.merge(q,n,b,l,p,g,x)):M<=this.maxCacheReadyRetries-1&&!L&&401!=k.getStatus()&&503!=k.getStatus()&&410!=k.getStatus()?(M++,this.file.stats.cacheMiss++,window.setTimeout(Q,(M+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,-this.reload(l,p,g,null,x))}catch(E){null!=p&&p(E)}}else null!=p&&p()}),p)}else null!=p&&p()});window.setTimeout(Q,this.cacheReadyDelay)}else this.reload(l,p,g,null,x)}else null!=p&&p()}};DrawioFileSync.prototype.reload=function(b,l,p,g,x){EditorUi.debug("DrawioFileSync.reload",[this],"immediate",x);this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=b&&b()}),mxUtils.bind(this,function(B){null!=l&&l(B)}),p,g,x)};+DrawioFileSync.prototype.catchup=function(b,l,p,g,x){if(null!=b&&(null==g||!g())){var A=this.file.getCurrentRevisionId(),y=this.file.getDescriptorRevisionId(b);EditorUi.debug("DrawioFileSync.catchup",[this],"desc",[b],"from",A,"to",y,"immediate",x,"valid",this.isValidState());if(A==y)this.file.patchDescriptor(this.file.getDescriptor(),b),"1"==urlParams.test&&EditorUi.debug("DrawioFileSync.catchup",[this],"up to date","cleanup",this.cleanupThread,"checksum",this.ui.getHashValueForPages(this.ui.pages)),+document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||null!=this.cleanupThread||this.testChecksum(),null!=l&&l(!0);else if(this.isValidState()){var G=this.file.getDescriptorChecksum(b),L=this.file.getDescriptorSecret(b);if(null!=G&&G==this.ui.getHashValueForPages(this.ui.pages))this.fastForward(b),null!=l&&l(!0);else if(Editor.enableRealtimeCache&&null!=L&&"1"!=urlParams.lockdown){var O=0,J=!1,Q=mxUtils.bind(this,function(){if(null==g||!g())if(A!=this.file.getCurrentRevisionId())null!=l&&+l(!0);else if(this.isValidState()){this.scheduleCleanup(!0);var c=!0,f=window.setTimeout(mxUtils.bind(this,function(){c=!1;this.reload(l,p,g,null,x)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(A)+"&to="+encodeURIComponent(y)+(null!=L?"&secret="+encodeURIComponent(L):""),mxUtils.bind(this,function(k){this.file.stats.bytesReceived+=k.getText().length;window.clearTimeout(f);if(c&&(null==g||!g()))if(A!=this.file.getCurrentRevisionId())null!=+l&&l(!0);else if(this.isValidState()){var n=null,q=[];EditorUi.debug("DrawioFileSync.doCatchup",[this],"request",[k],"status",k.getStatus(),"cacheReadyRetryCount",O,"maxCacheReadyRetries",this.maxCacheReadyRetries);if(200<=k.getStatus()&&299>=k.getStatus()&&0<k.getText().length)try{var t=JSON.parse(k.getText());if(null!=t&&0<t.length)for(var u=0;u<t.length;u++){var B=this.stringToObject(t[u]);if(B.v>DrawioFileSync.PROTOCOL){J=!0;q=[];break}else if(B.v===DrawioFileSync.PROTOCOL&&null!=B.d)n=B.d.checksum,+q.push(B.d.patch);else{J=!0;q=[];break}}EditorUi.debug("DrawioFileSync.doCatchup",[this],"response",[t],"status",J?"failed":"ok","temp",q,"checksum",n)}catch(E){q=[],null!=window.console&&"1"==urlParams.test&&console.log(E)}try{0<q.length?(this.file.stats.cacheHits++,this.merge(q,n,b,l,p,g,x)):O<=this.maxCacheReadyRetries-1&&!J&&401!=k.getStatus()&&503!=k.getStatus()&&410!=k.getStatus()?(O++,this.file.stats.cacheMiss++,window.setTimeout(Q,(O+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,+this.reload(l,p,g,null,x))}catch(E){null!=p&&p(E)}}else null!=p&&p()}),p)}else null!=p&&p()});window.setTimeout(Q,this.cacheReadyDelay)}else this.reload(l,p,g,null,x)}else null!=p&&p()}};DrawioFileSync.prototype.reload=function(b,l,p,g,x){EditorUi.debug("DrawioFileSync.reload",[this],"immediate",x);this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=b&&b()}),mxUtils.bind(this,function(A){null!=l&&l(A)}),p,g,x)};DrawioFileSync.prototype.descriptorChanged=function(b){this.lastModified=this.file.getLastModifiedDate();if(null!=this.channelId){var l=this.objectToString(this.createMessage({a:"desc",m:this.lastModified.getTime()})),p=this.file.getCurrentRevisionId(),g=this.objectToString({});mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(b)+"&to="+encodeURIComponent(p)+"&msg="+encodeURIComponent(l)+"&data="+encodeURIComponent(g));this.file.stats.bytesSent+=g.length;this.file.stats.msgSent++;EditorUi.debug("DrawioFileSync.descriptorChanged",[this],"from",b,"to",p)}this.updateStatus()};DrawioFileSync.prototype.objectToString=function(b){b=Graph.compress(JSON.stringify(b));null!=this.key&&"undefined"!==typeof CryptoJS&&(b=CryptoJS.AES.encrypt(b,this.key).toString());return b};DrawioFileSync.prototype.stringToObject=function(b){null!=this.key&&"undefined"!==typeof CryptoJS&&(b=CryptoJS.AES.decrypt(b,this.key).toString(CryptoJS.enc.Utf8));return JSON.parse(Graph.decompress(b))};-DrawioFileSync.prototype.createToken=function(b,l,p){var g=!0,x=window.setTimeout(mxUtils.bind(this,function(){g=!1;p({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&secret="+encodeURIComponent(b),mxUtils.bind(this,function(B){window.clearTimeout(x);g&&(200<=B.getStatus()&&299>=B.getStatus()?l(B.getText()):p({code:B.getStatus(),message:"Token Error "+B.getStatus()}))}),p)};+DrawioFileSync.prototype.createToken=function(b,l,p){var g=!0,x=window.setTimeout(mxUtils.bind(this,function(){g=!1;p({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&secret="+encodeURIComponent(b),mxUtils.bind(this,function(A){window.clearTimeout(x);g&&(200<=A.getStatus()&&299>=A.getStatus()?l(A.getText()):p({code:A.getStatus(),message:"Token Error "+A.getStatus()}))}),p)};DrawioFileSync.prototype.fileSaving=function(){this.file.isOptimisticSync()&&this.notify(this.createMessage({m:Date.now(),type:"optimistic"}));EditorUi.debug("DrawioFileSync.fileSaving",[this],"optimistic",this.file.isOptimisticSync())};DrawioFileSync.prototype.fileDataUpdated=function(){this.scheduleCleanup(!0);EditorUi.debug("DrawioFileSync.fileDataUpdated",[this])};-DrawioFileSync.prototype.fileSaved=function(b,l,p,g,x,B){this.lastModified=this.file.getLastModifiedDate();this.resetUpdateStatusThread();this.catchupRetryCount=0;if(!this.ui.isOffline(!0)&&!this.file.inConflictState&&!this.file.redirectDialogShowing&&(this.start(),null!=this.channelId)){var z=this.file.getDescriptorSecret(this.file.getDescriptor()),F=this.createMessage({m:this.lastModified.getTime()}),K=this.file.getDescriptorRevisionId(l),M=this.file.getCurrentRevisionId();if(null!=z&&null!=x&&-"1"!=urlParams.lockdown&&Editor.enableRealtimeCache){var L=this.ui.diffPages(this.file.getShadowPages(),b),Q=this.file.getShadowVars(),c=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;c!=Q&&(L[EditorUi.DIFF_FILE]={vars:c});l=this.file.getDescriptorSecret(l);B=null!=B?B:this.ui.getHashValueForPages(b);Q=this.objectToString(this.createMessage({patch:L,checksum:B}));this.file.stats.bytesSent+=Q.length;this.file.stats.msgSent++;var f=!0,k=window.setTimeout(mxUtils.bind(this,function(){f=-!1;g({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(K)+"&to="+encodeURIComponent(M)+(Editor.p2pSyncNotify?"":"&msg="+encodeURIComponent(this.objectToString(F)))+(null!=z?"&secret="+encodeURIComponent(z):"")+(null!=l?"&last-secret="+encodeURIComponent(l):"")+(Q.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(Q):"")+(null!=x?"&token="+encodeURIComponent(x):""),mxUtils.bind(this,-function(n){window.clearTimeout(k);f&&(200<=n.getStatus()&&299>=n.getStatus()?(Editor.p2pSyncNotify&&this.notify(F),null!=p&&p()):g({message:mxResources.get("realtimeCollaboration")+(0!=n.getStatus()?": "+n.getStatus():"")}))}));EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",K,"to",M,"etag",this.file.getCurrentEtag(),"diff",L,Q.length,"bytes","msg",F,"checksum",B)}else this.notify(F),null!=p&&p(),EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",K,"to",M,"etag",this.file.getCurrentEtag())}this.file.setShadowPages(b);+DrawioFileSync.prototype.fileSaved=function(b,l,p,g,x,A){this.lastModified=this.file.getLastModifiedDate();this.resetUpdateStatusThread();this.catchupRetryCount=0;if(!this.ui.isOffline(!0)&&!this.file.inConflictState&&!this.file.redirectDialogShowing&&(this.start(),null!=this.channelId)){var y=this.file.getDescriptorSecret(this.file.getDescriptor()),G=this.createMessage({m:this.lastModified.getTime()}),L=this.file.getDescriptorRevisionId(l),O=this.file.getCurrentRevisionId();if(null!=y&&null!=x&&+"1"!=urlParams.lockdown&&Editor.enableRealtimeCache){var J=this.ui.diffPages(this.file.getShadowPages(),b),Q=this.file.getShadowVars(),c=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;c!=Q&&(J[EditorUi.DIFF_FILE]={vars:c});l=this.file.getDescriptorSecret(l);A=null!=A?A:this.ui.getHashValueForPages(b);Q=this.objectToString(this.createMessage({patch:J,checksum:A}));this.file.stats.bytesSent+=Q.length;this.file.stats.msgSent++;var f=!0,k=window.setTimeout(mxUtils.bind(this,function(){f=+!1;g({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(L)+"&to="+encodeURIComponent(O)+(Editor.p2pSyncNotify?"":"&msg="+encodeURIComponent(this.objectToString(G)))+(null!=y?"&secret="+encodeURIComponent(y):"")+(null!=l?"&last-secret="+encodeURIComponent(l):"")+(Q.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(Q):"")+(null!=x?"&token="+encodeURIComponent(x):""),mxUtils.bind(this,+function(n){window.clearTimeout(k);f&&(200<=n.getStatus()&&299>=n.getStatus()?(Editor.p2pSyncNotify&&this.notify(G),null!=p&&p()):g({message:mxResources.get("realtimeCollaboration")+(0!=n.getStatus()?": "+n.getStatus():"")}))}));EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",L,"to",O,"etag",this.file.getCurrentEtag(),"diff",J,Q.length,"bytes","msg",G,"checksum",A)}else this.notify(G),null!=p&&p(),EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",L,"to",O,"etag",this.file.getCurrentEtag())}this.file.setShadowPages(b);this.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.scheduleCleanup()};DrawioFileSync.prototype.getIdParameters=function(){var b="id="+this.channelId;null!=this.pusher&&null!=this.pusher.connection&&null!=this.pusher.connection.socket_id&&(b+="&sid="+this.pusher.connection.socket_id);return b};DrawioFileSync.prototype.createMessage=function(b){return{v:DrawioFileSync.PROTOCOL,d:b,c:this.clientId}};DrawioFileSync.prototype.fileConflict=function(b,l,p){this.catchupRetryCount++;EditorUi.debug("DrawioFileSync.fileConflict",[this],"desc",[b],"catchupRetryCount",this.catchupRetryCount,"maxCatchupRetries",this.maxCatchupRetries);this.catchupRetryCount<this.maxCatchupRetries?(this.file.stats.conflicts++,null!=b?this.catchup(b,l,p):this.fileChanged(l,p)):(this.file.stats.timeouts++,this.catchupRetryCount=0,null!=p&&p({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")}))};DrawioFileSync.prototype.stop=function(){null!=this.pusher?(null!=this.pusher.connection&&(this.pusher.connection.unbind("state_change",this.connectionListener),this.pusher.connection.unbind("error",this.pusherErrorListener)),null!=this.channel&&(this.channel.unbind("changed",this.changeListener),this.channel=null),this.pusher.disconnect(),this.pusher=null,null!=this.p2pCollab&&(this.p2pCollab.destroy(),this.p2pCollab=null),EditorUi.debug("DrawioFileSync.stop",[this])):null!=this.polling&&(this.polling.stop(),@@ -14598,23 +14602,23 @@ this.polling=null);this.updateOnlineState();this.updateStatus()};DrawioFileSync.prototype.destroy=function(){if(null!=this.channelId){var b=this.file.getCurrentUser(),l={a:"leave"};null!=b&&(l.name=encodeURIComponent(b.displayName),l.uid=b.id);this.notify(this.createMessage(l))}this.stop();null!=this.onlineListener&&(mxEvent.removeListener(window,"offline",this.onlineListener),mxEvent.removeListener(window,"online",this.onlineListener),this.onlineListener=null);null!=this.autosaveListener&&(this.ui.editor.removeListener(this.autosaveListener),this.autosaveListener=null);null!=this.visibleListener&&(mxEvent.removeListener(document,"visibilitychange",this.visibleListener),this.visibleListener=null);null!=this.activityListener&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.activityListener),mxEvent.removeListener(document,"keypress",this.activityListener),mxEvent.removeListener(window,"focus",this.activityListener),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(mxEvent.removeListener(document,"touchstart",this.activityListener),mxEvent.removeListener(document,"touchmove",this.activityListener)),this.activityListener=null);null!=this.p2pCollab&&this.p2pCollab.destroy()};App=function(b,l,p){EditorUi.call(this,b,l,null!=p?p:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(){var g=this.getCurrentFile();null!=g&&EditorUi.logEvent({category:(this.editor.autosave?"ON":"OFF")+"-AUTOSAVE-FILE-"+g.getHash(),action:"changed",label:"autosave_"+(this.editor.autosave?"on":"off")})}));mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII=":-(new Image).src=mxGraph.prototype.warningImage.src;window.geOpenWindow=mxUtils.bind(this,function(g,x,B){if("1"==urlParams.openInSameWin||navigator.standalone)null!=B&&B();else{var z=null;try{z=window.open(g)}catch(F){}null==z||void 0===z?this.showDialog((new PopupDialog(this,g,x,B)).container,340,140,!0,!0):null!=x&&x()}});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(g){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(g)});this.editor.chromeless&&+(new Image).src=mxGraph.prototype.warningImage.src;window.geOpenWindow=mxUtils.bind(this,function(g,x,A){if("1"==urlParams.openInSameWin||navigator.standalone)null!=A&&A();else{var y=null;try{y=window.open(g)}catch(G){}null==y||void 0===y?this.showDialog((new PopupDialog(this,g,x,A)).container,340,140,!0,!0):null!=x&&x()}});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(g){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(g)});this.editor.chromeless&&!this.editor.editable||this.addFileDropHandler([document]);if(null!=App.DrawPlugins){for(b=0;b<App.DrawPlugins.length;b++)try{App.DrawPlugins[b](this)}catch(g){null!=window.console&&console.log("Plugin Error:",g,App.DrawPlugins[b])}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}window.Draw.loadPlugin=mxUtils.bind(this,function(g){try{g(this)}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}});setTimeout(mxUtils.bind(this,function(){0<App.embedModePluginsCount&&(App.embedModePluginsCount=0,this.initializeEmbedMode())}),5E3)}this.load()};App.ERROR_TIMEOUT="timeout";App.ERROR_BUSY="busy";App.ERROR_UNKNOWN="unknown";App.MODE_GOOGLE="google";App.MODE_DROPBOX="dropbox";App.MODE_ONEDRIVE="onedrive";App.MODE_M365="m365";App.MODE_GITHUB="github";App.MODE_GITLAB="gitlab";App.MODE_DEVICE="device";App.MODE_BROWSER="browser";App.MODE_TRELLO="trello";App.MODE_EMBED="embed";App.MODE_ATLAS="atlas";App.DROPBOX_APPKEY=window.DRAWIO_DROPBOX_ID;App.DROPBOX_URL="js/dropbox/Dropbox-sdk.min.js";App.DROPINS_URL="https://www.dropbox.com/static/api/2/dropins.js";App.ONEDRIVE_URL="js/onedrive/OneDrive.js";App.TRELLO_URL="https://api.trello.com/1/client.js";App.TRELLO_JQUERY_URL="js/jquery/jquery-3.6.0.min.js";App.PUSHER_KEY="1e756b07a690c5bdb054";App.PUSHER_CLUSTER="eu";App.PUSHER_URL=window.PUSHER_URL||"https://js.pusher.com/7.0.3/pusher.min.js";App.SIMPLE_PEER_URL="js/simplepeer/simplepeer9.10.0.min.js";App.GOOGLE_APIS="drive-share";App.startTime=new Date;App.pluginRegistry={"4xAKTrabTpTzahoLthkwPNUn":"plugins/explore.js",ex:"plugins/explore.js",ac:"plugins/connect.js",acj:"plugins/connectJira.js",ac148:"plugins/cConf-1-4-8.js",ac148cmnt:"plugins/cConf-comments.js",nxtcld:"plugins/nextcloud.js",monday:"plugins/monday.js",tips:"plugins/tooltips.js",svgdata:"plugins/svgdata.js",number:"plugins/number.js",sql:"plugins/sql.js",props:"plugins/props.js",text:"plugins/text.js",anim:"plugins/animation.js",update:"plugins/update.js",trees:"plugins/trees/trees.js","import":"plugins/import.js",replay:"plugins/replay.js",anon:"plugins/anonymize.js",tr:"plugins/trello.js",f5:"plugins/rackF5.js",webcola:"plugins/webcola/webcola.js",rnd:"plugins/random.js",page:"plugins/page.js",gd:"plugins/googledrive.js",tags:"plugins/tags.js"};App.publicPlugin="ex tips svgdata number sql props text anim update trees replay anon webcola tags".split(" ");-App.loadScripts=function(b,l,p){for(var g=b.length,x=!1,B=0;B<b.length;B++)mxscript(b[B],function(){0!=--g||x||null==l||l()},null,null,null,function(z,F){x=!0;null!=p&&p(Error(z));console.error("Error loading script",z,F,F.stack)})};-App.getStoredMode=function(){var b=null;null==b&&isLocalStorage&&(b=localStorage.getItem(".mode"));if(null==b&&"undefined"!=typeof Storage)try{for(var l=document.cookie.split(";"),p=0;p<l.length;p++){var g=mxUtils.trim(l[p]);if("MODE="==g.substring(0,5)){b=g.substring(5);break}}if(null!=b&&isLocalStorage){var x=new Date;x.setYear(x.getFullYear()-1);document.cookie="MODE=; expires="+x.toUTCString();localStorage.setItem(".mode",b)}}catch(B){}return b};+App.loadScripts=function(b,l,p){for(var g=b.length,x=!1,A=0;A<b.length;A++)mxscript(b[A],function(){0!=--g||x||null==l||l()},null,null,null,function(y,G){x=!0;null!=p&&p(Error(y));console.error("Error loading script",y,G,G.stack)})};+App.getStoredMode=function(){var b=null;null==b&&isLocalStorage&&(b=localStorage.getItem(".mode"));if(null==b&&"undefined"!=typeof Storage)try{for(var l=document.cookie.split(";"),p=0;p<l.length;p++){var g=mxUtils.trim(l[p]);if("MODE="==g.substring(0,5)){b=g.substring(5);break}}if(null!=b&&isLocalStorage){var x=new Date;x.setYear(x.getFullYear()-1);document.cookie="MODE=; expires="+x.toUTCString();localStorage.setItem(".mode",b)}}catch(A){}return b};(function(){mxClient.IS_CHROMEAPP||("1"!=urlParams.offline&&("db.draw.io"==window.location.hostname&&null==urlParams.mode&&(urlParams.mode="dropbox"),App.mode=urlParams.mode),null==App.mode&&"1"!=urlParams.embed&&(App.mode=App.getStoredMode()),null!=window.mxscript&&"1"!=urlParams.embed&&("function"===typeof window.DriveClient&&("0"!=urlParams.gapi&&isSvgBrowser&&(null==document.documentMode||10<=document.documentMode)?App.mode==App.MODE_GOOGLE||null!=urlParams.state&&""==window.location.hash||null!=window.location.hash&&"#G"==window.location.hash.substring(0,2)?mxscript("https://apis.google.com/js/api.js"):"0"!=urlParams.chrome||null!=window.location.hash&&"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"===window.location.hash.substring(0,45)||(window.DriveClient=null):window.DriveClient=null),"function"===typeof window.DropboxClient&&("0"!=urlParams.db&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode)?App.mode==App.MODE_DROPBOX||null!=window.location.hash&&"#D"==window.location.hash.substring(0,2)?mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL,null,"dropboxjs",App.DROPBOX_APPKEY,!0)}):"0"==urlParams.chrome&&(window.DropboxClient=null):window.DropboxClient=null),"function"===typeof window.OneDriveClient&&("0"!=urlParams.od&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||App.mode==App.MODE_M365||null!=window.location.hash&&("#W"==window.location.hash.substring(0,2)||"#M"==window.location.hash.substring(0,2))?mxscript(App.ONEDRIVE_URL):"0"==urlParams.chrome&&(window.OneDriveClient=null):window.OneDriveClient=null),"function"===typeof window.TrelloClient&&("1"==urlParams.tr&&isSvgBrowser?App.mode==App.MODE_TRELLO||null!=window.location.hash&&"#T"==window.location.hash.substring(0,2)?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL)}):"0"==urlParams.chrome&&(window.TrelloClient=null):window.TrelloClient=null)))})();App.clearServiceWorker=function(b,l){navigator.serviceWorker.getRegistration().then(function(p){null!=p&&p.unregister().then(function(){null!=b&&(b(),b=null)})})["catch"](function(){null!=l&&l()})};App.isSameDomain=function(b){var l=document.createElement("a");l.href=b;return l.protocol===window.location.protocol||l.host===window.location.host};App.isBuiltInPlugin=function(b){for(var l in App.pluginRegistry)if(App.pluginRegistry[l]==b)return!0;return!1};App.isSimpleThemePreferred=function(){var b=navigator.userAgent||navigator.vendor||window.opera;return 1024>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)||/android/i.test(b)||/iPad|iPhone|iPod/.test(b)&&!window.MSStream||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints};-App.main=function(b,l){try{var p=function(){try{if(null!=mxSettings.settings){if(null!=mxSettings.settings.autosaveDelay){var L=parseInt(mxSettings.settings.autosaveDelay);!isNaN(L)&&0<L?(DrawioFile.prototype.autosaveDelay=L,EditorUi.debug("Setting autosaveDelay",L)):EditorUi.debug("Invalid autosaveDelay",L)}null!=mxSettings.settings.defaultEdgeLength&&(L=parseInt(mxSettings.settings.defaultEdgeLength),!isNaN(L)&&0<L?(Graph.prototype.defaultEdgeLength=L,EditorUi.debug("Using defaultEdgeLength",L)):-EditorUi.debug("Invalid defaultEdgeLength",L))}}catch(c){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(c.stack)):console.error(c)}try{if(null!=Menus.prototype.defaultFonts)for(L=0;L<Menus.prototype.defaultFonts.length;L++){var Q=Menus.prototype.defaultFonts[L];"string"!==typeof Q&&null!=Q.fontFamily&&null!=Q.fontUrl&&Graph.addFont(Q.fontFamily,Q.fontUrl)}mxResources.loadDefaultBundle=!1;g(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,-mxLanguage))}catch(c){document.body.innerHTML="",Q=document.createElement("pre"),mxUtils.write(Q,c.stack),document.body.appendChild(Q)}},g=function(L){mxUtils.getAll("1"!=urlParams.dev?[L]:[L,STYLE_PATH+"/default.xml"],function(Q){function c(){try{try{null==Editor.currentTheme&&"1"!=urlParams.embed&&(1==urlParams.dev||1==urlParams.test||"test.draw.io"===window.location.hostname||"www.draw.io"===window.location.hostname||"preprod.diagrams.net"===window.location.hostname||"app.diagrams.net"===window.location.hostname||+App.main=function(b,l){try{var p=function(){try{if(null!=mxSettings.settings){if(null!=mxSettings.settings.autosaveDelay){var J=parseInt(mxSettings.settings.autosaveDelay);!isNaN(J)&&0<J?(DrawioFile.prototype.autosaveDelay=J,EditorUi.debug("Setting autosaveDelay",J)):EditorUi.debug("Invalid autosaveDelay",J)}null!=mxSettings.settings.defaultEdgeLength&&(J=parseInt(mxSettings.settings.defaultEdgeLength),!isNaN(J)&&0<J?(Graph.prototype.defaultEdgeLength=J,EditorUi.debug("Using defaultEdgeLength",J)):+EditorUi.debug("Invalid defaultEdgeLength",J))}}catch(c){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(c.stack)):console.error(c)}try{if(null!=Menus.prototype.defaultFonts)for(J=0;J<Menus.prototype.defaultFonts.length;J++){var Q=Menus.prototype.defaultFonts[J];"string"!==typeof Q&&null!=Q.fontFamily&&null!=Q.fontUrl&&Graph.addFont(Q.fontFamily,Q.fontUrl)}mxResources.loadDefaultBundle=!1;g(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,+mxLanguage))}catch(c){document.body.innerHTML="",Q=document.createElement("pre"),mxUtils.write(Q,c.stack),document.body.appendChild(Q)}},g=function(J){mxUtils.getAll("1"!=urlParams.dev?[J]:[J,STYLE_PATH+"/default.xml"],function(Q){function c(){try{try{null==Editor.currentTheme&&"1"!=urlParams.embed&&(1==urlParams.dev||1==urlParams.test||"test.draw.io"===window.location.hostname||"www.draw.io"===window.location.hostname||"preprod.diagrams.net"===window.location.hostname||"app.diagrams.net"===window.location.hostname||"jgraph.github.io"===window.location.hostname||/drawio-dev\.pages\.dev$/.test(window.location.hostname))&&App.isSimpleThemePreferred()&&(Editor.currentTheme="simple")}catch(u){}"kennedy"!=Editor.currentTheme&&0>mxUtils.indexOf(Editor.themes,Editor.currentTheme)&&(Editor.currentTheme="kennedy");"1"==urlParams.transparent&&(document.body.style.background="transparent");var t=null!=l?l():new App(new Editor("0"==urlParams.chrome||"min"==uiTheme,null,null,null,"0"!=urlParams.chrome));null!=window.mxscript&&("function"===typeof window.DropboxClient&&null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode)?mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL,function(){DrawDropboxClientCallback()},"dropboxjs",App.DROPBOX_APPKEY)}):"undefined"===typeof window.Dropbox&&(window.DropboxClient=null),"function"===typeof window.OneDriveClient&&"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=null),"function"===typeof window.TrelloClient&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&"1"==urlParams.tr?@@ -14623,31 +14627,31 @@ window.setTimeout(function(){alert(u.message)},1))}}mxResources.parse(Q[0].getTe"",alert(t)}else f=f.merge}confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(f)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(t){window.location.hash="",alert(t)}1<Q.length&&(Graph.prototype.defaultThemes["default-style2"]=Q[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=Q[1].getDocumentElement());"1"==urlParams.dev||EditorUi.isElectronApp?c():(mxStencilRegistry.allowEval=!1,App.loadScripts(["js/shapes-14-6-5.min.js","js/stencils.min.js","js/extensions.min.js"],c,function(t){document.body.innerHTML="";var u=document.createElement("pre");mxUtils.write(u,t.stack);document.body.appendChild(u)}))},function(Q){Q=document.getElementById("geStatus");null!=Q&&(Q.innerHTML="Error loading page. <a>Please try refreshing.</a>",Q.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";g(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})})};if(!App.isMainCalled)if(mxIsElectron&&"undefined"===typeof electron)alert("Runtime Environment not found."),document.body.innerHTML='<div style="margin-top:10%;text-align:center;"><img src="mxgraph/images/warning.png" align="top" style="padding-right:6px;"/>Runtime Environment not found.</div>';else{Editor.loadCompatibleCss();App.isMainCalled=!0;if("1"==urlParams.android||"0"!=urlParams.android&&!mxClient.IS_ANDROID&&mxClient.IS_LINUX&&mxClient.IS_GC&&1<navigator.maxTouchPoints)mxClient.IS_ANDROID=-!0;window.onerror=function(L,Q,c,f,k){EditorUi.logError("Global: "+(null!=L?L:""),Q,c,f,k,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",L,"\nURL:",Q,"\nLine:",c,"\nColumn:",f,"\nError:",k)):console.error("Message:",L,"\nURL:",Q,"\nLine:",c,"\nColumn:",f,"\nError:",k);window.setTimeout(function(){alert("Error: "+(null!=L?L:""))},100)};if(window.top!=window.self||"import.diagrams.net"!==window.location.hostname&&"ac.draw.io"!==window.location.hostname&&"aj.draw.io"!==+!0;window.onerror=function(J,Q,c,f,k){EditorUi.logError("Global: "+(null!=J?J:""),Q,c,f,k,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",J,"\nURL:",Q,"\nLine:",c,"\nColumn:",f,"\nError:",k)):console.error("Message:",J,"\nURL:",Q,"\nLine:",c,"\nColumn:",f,"\nError:",k);window.setTimeout(function(){alert("Error: "+(null!=J?J:""))},100)};if(window.top!=window.self||"import.diagrams.net"!==window.location.hostname&&"ac.draw.io"!==window.location.hostname&&"aj.draw.io"!==window.location.hostname){if("1"==urlParams.embed||"1"==urlParams.lightbox){var x=document.getElementById("geInfo");null!=x&&x.parentNode.removeChild(x)}"1"==urlParams.embed&&document.body.classList.add("geEmbed");null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){try{Editor.enableServiceWorker&&("0"==urlParams.offline||/www\.draw\.io$/.test(window.location.hostname)||"1"!=-urlParams.offline&&"1"!=urlParams.enableSW&&"1"==urlParams.dev)?(EditorUi.debug("App.main","Uninstalling service worker"),App.clearServiceWorker(function(){"0"==urlParams.offline&&alert("Cache cleared")})):Editor.enableServiceWorker&&navigator.serviceWorker.getRegistration().then(function(L){null!=L?(EditorUi.debug("App.main","Updating service worker"),L.update()):!Editor.isSettingsEnabled()||null!=mxSettings.settings&&!mxSettings.settings.isNew||"1"==urlParams.enableSW?(EditorUi.debug("App.main",-"Installing service worker"),navigator.serviceWorker.register("service-worker.js")):EditorUi.debug("App.main","Skipping service worker (first load)")})}catch(L){}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&("1"!=urlParams.embedRT||"1"==urlParams.lockdown)||"1"==urlParams.local||"0"==urlParams.chrome&&"1"!=urlParams.rt||"1"==urlParams.stealth||"1"==urlParams.offline||(mxscript(App.PUSHER_URL),"1"==urlParams["fast-sync"]&&-mxscript(App.SIMPLE_PEER_URL));if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var B=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var z=JSON.parse(localStorage.getItem(mxSettings.key));null!=z&&(B=z.plugins)}catch(L){}z=urlParams.p;App.initPluginCallback();null!=z&&App.loadPlugins(z.split(";"));if(null!=B&&0<B.length&&"0"!=urlParams.plugins)for(x=0;x<B.length;x++)try{("/"==B[x].charAt(0)&&(B[x]=PLUGINS_BASE_PATH+-B[x]),App.isSameDomain(B[x]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(B[x])?null==App.pluginsLoaded[B[x]]&&(App.pluginsLoaded[B[x]]=!0,App.embedModePluginsCount++,mxscript(B[x])):null!=window.console&&console.log("Unknown plugin:",B[x]):null!=window.console&&console.log("Blocked plugin:",B[x])}catch(L){}}"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||-10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();if("1"==urlParams.configure){var F=window.opener||window.parent,K=function(L){if(L.source==F)try{var Q=JSON.parse(L.data);null!=Q&&"configure"==Q.action&&(mxEvent.removeListener(window,"message",K),Editor.configure(Q.config),mxSettings.load(),null!=Q.config.darkColor&&-document.body.style.setProperty("--dark-color",Q.config.darkColor),Q.colorSchemeMeta&&mxmeta("color-scheme","dark light"),p())}catch(c){null!=window.console&&console.log("Error in configure message: "+c,L.data)}};mxEvent.addListener(window,"message",K);F.postMessage(JSON.stringify({event:"configure"}),"*")}else{if(null==Editor.config){if(null!=window.DRAWIO_CONFIG)try{EditorUi.debug("Using global configuration",window.DRAWIO_CONFIG),Editor.configure(window.DRAWIO_CONFIG),mxSettings.load()}catch(L){null==-window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(L.stack)):console.error(L)}if(isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed){var M=localStorage.getItem(Editor.configurationKey);if(null!=M)try{M=JSON.parse(M),null!=M&&(EditorUi.debug("Using local configuration",M),Editor.configure(M),mxSettings.load())}catch(L){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(L.stack)):console.error(L)}}}p()}}else document.body.innerHTML='<div style="margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>'}}catch(L){document.body.innerHTML=-"",B=document.createElement("pre"),mxUtils.write(B,L.stack),document.body.appendChild(B)}};mxUtils.extend(App,EditorUi);App.prototype.warnInterval=3E5;App.prototype.compactMode=!1;App.prototype.fullscreenMode=!1;App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(b){App.DrawPlugins.push(b)})};App.pluginsLoaded={};App.embedModePluginsCount=0;+urlParams.offline&&"1"!=urlParams.enableSW&&"1"==urlParams.dev)?(EditorUi.debug("App.main","Uninstalling service worker"),App.clearServiceWorker(function(){"0"==urlParams.offline&&alert("Cache cleared")})):Editor.enableServiceWorker&&navigator.serviceWorker.getRegistration().then(function(J){null!=J?(EditorUi.debug("App.main","Updating service worker"),J.update()):!Editor.isSettingsEnabled()||null!=mxSettings.settings&&!mxSettings.settings.isNew||"1"==urlParams.enableSW?(EditorUi.debug("App.main",+"Installing service worker"),navigator.serviceWorker.register("service-worker.js")):EditorUi.debug("App.main","Skipping service worker (first load)")})}catch(J){}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&("1"!=urlParams.embedRT||"1"==urlParams.lockdown)||"1"==urlParams.local||"0"==urlParams.chrome&&"1"!=urlParams.rt||"1"==urlParams.stealth||"1"==urlParams.offline||(mxscript(App.PUSHER_URL),"1"==urlParams["fast-sync"]&&+mxscript(App.SIMPLE_PEER_URL));if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var A=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var y=JSON.parse(localStorage.getItem(mxSettings.key));null!=y&&(A=y.plugins)}catch(J){}y=urlParams.p;App.initPluginCallback();null!=y&&App.loadPlugins(y.split(";"));if(null!=A&&0<A.length&&"0"!=urlParams.plugins)for(x=0;x<A.length;x++)try{("/"==A[x].charAt(0)&&(A[x]=PLUGINS_BASE_PATH++A[x]),App.isSameDomain(A[x]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(A[x])?null==App.pluginsLoaded[A[x]]&&(App.pluginsLoaded[A[x]]=!0,App.embedModePluginsCount++,mxscript(A[x])):null!=window.console&&console.log("Unknown plugin:",A[x]):null!=window.console&&console.log("Blocked plugin:",A[x])}catch(J){}}"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||+10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();if("1"==urlParams.configure){var G=window.opener||window.parent,L=function(J){if(J.source==G)try{var Q=JSON.parse(J.data);null!=Q&&"configure"==Q.action&&(mxEvent.removeListener(window,"message",L),Editor.configure(Q.config),mxSettings.load(),null!=Q.config.darkColor&&+document.body.style.setProperty("--dark-color",Q.config.darkColor),Q.colorSchemeMeta&&mxmeta("color-scheme","dark light"),p())}catch(c){null!=window.console&&console.log("Error in configure message: "+c,J.data)}};mxEvent.addListener(window,"message",L);G.postMessage(JSON.stringify({event:"configure"}),"*")}else{if(null==Editor.config){if(null!=window.DRAWIO_CONFIG)try{EditorUi.debug("Using global configuration",window.DRAWIO_CONFIG),Editor.configure(window.DRAWIO_CONFIG),mxSettings.load()}catch(J){null==+window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(J.stack)):console.error(J)}if(isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed){var O=localStorage.getItem(Editor.configurationKey);if(null!=O)try{O=JSON.parse(O),null!=O&&(EditorUi.debug("Using local configuration",O),Editor.configure(O),mxSettings.load())}catch(J){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(J.stack)):console.error(J)}}}p()}}else document.body.innerHTML='<div style="margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>'}}catch(J){document.body.innerHTML=+"",A=document.createElement("pre"),mxUtils.write(A,J.stack),document.body.appendChild(A)}};mxUtils.extend(App,EditorUi);App.prototype.warnInterval=3E5;App.prototype.compactMode=!1;App.prototype.fullscreenMode=!1;App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(b){App.DrawPlugins.push(b)})};App.pluginsLoaded={};App.embedModePluginsCount=0;App.loadPlugins=function(b,l){EditorUi.debug("Loading plugins",b);for(var p=0;p<b.length;p++)if(null!=b[p]&&0<b[p].length)try{if(null!=App.pluginRegistry[b[p]]){var g=PLUGINS_BASE_PATH+App.pluginRegistry[b[p]];null==App.pluginsLoaded[g]&&(App.pluginsLoaded[g]=!0,App.embedModePluginsCount++,"undefined"===typeof window.drawDevUrl?l?mxinclude(g):mxscript(g):l?mxinclude(g):mxscript(drawDevUrl+g))}else null!=window.console&&console.log("Unknown plugin:",b[p])}catch(x){null!=window.console&&console.log("Error loading plugin:",b[p],x)}};App.prototype.initializeEmbedMode=function(){"1"==urlParams.embed&&("app.diagrams.net"==window.location.hostname&&this.showBanner("EmbedDeprecationFooter","app.diagrams.net will stop working for embed mode. Please use embed.diagrams.net."),0<App.embedModePluginsCount||this.initEmbedDone||(this.initEmbedDone=!0,EditorUi.prototype.initializeEmbedMode.apply(this,arguments)))};App.prototype.initializeViewerMode=function(){var b=window.opener||window.parent;null!=b&&this.editor.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(){b.postMessage(JSON.stringify(this.createLoadMessage("size")),"*")}))};App.prototype.init=function(){if(!App.blockedAncestorFrames()){this.buttonContainer=this.createButtonContainer();EditorUi.prototype.init.apply(this,arguments);this.descriptorChangedListener=mxUtils.bind(this,this.descriptorChanged);this.addListener("currentThemeChanged",mxUtils.bind(this,function(){this.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(!0)}));try{this.gitHub="0"==urlParams.gh||"1"==urlParams.embed&&"1"!=urlParams.gh?null:new GitHubClient(this),null!=this.gitHub&&-this.gitHub.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()}))}catch(z){null!=window.console&&console.log("GitHubClient disabled: "+z.message)}try{this.gitLab="0"==urlParams.gl||"1"==urlParams.embed&&"1"!=urlParams.gl?null:new GitLabClient(this),null!=this.gitLab&&this.gitLab.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()}))}catch(z){null!=window.console&&console.log("GitLabClient disabled: "+-z.message)}if("1"!=urlParams.embed||"1"==urlParams.od){var b=mxUtils.bind(this,function(){if("undefined"!==typeof OneDrive)try{this.oneDrive=new OneDriveClient(this),this.oneDrive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.oneDrive))}catch(z){null!=window.console&&console.log("OneDriveClient disabled: "+z.message)}else null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=-b)});b()}if("0"!=urlParams.ms365&&!EditorUi.isElectronApp)try{this.m365=new OneDriveClient(this,!1,!1,!1,!0),this.m365.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.m365))}catch(z){null!=window.console&&console.log("M365Client disabled: "+z.message)}if("1"!=urlParams.embed||"1"==urlParams.tr){var l=mxUtils.bind(this,function(){if("undefined"!==typeof window.Trello)try{this.trello=-new TrelloClient(this),this.trello.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))}catch(z){null!=window.console&&console.log("TrelloClient disabled: "+z.message)}else null==window.DrawTrelloClientCallback&&(window.DrawTrelloClientCallback=l)});l()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var p=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var z=mxUtils.bind(this,-function(){try{this.drive=new DriveClient(this),this.drive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();"1"!=urlParams.dev&&this.checkLicense()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))}catch(F){null!=window.console&&console.log("DriveClient disabled: "+F.message)}});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,z),window.DrawGapiClientCallback=null):-z()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=p)});p()}if("1"!=urlParams.embed||"1"==urlParams.db){var g=mxUtils.bind(this,function(){if("function"===typeof Dropbox){window.DrawDropboxClientCallback=null;try{this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))}catch(z){null!=window.console&&-console.log("DropboxClient disabled: "+z.message)}}else null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=g)});g()}if("1"!=urlParams.embed&&(this.setGraphEnabled(!1),"1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode,"serviceWorker"in navigator&&!this.editor.isChromelessView()&&(mxClient.IS_ANDROID||mxClient.IS_IOS)&&window.addEventListener("beforeinstallprompt",mxUtils.bind(this,function(z){this.showBanner("AddToHomeScreenFooter",mxResources.get("installApp"),-mxUtils.bind(this,function(){z.prompt()}),!0,!0)})),!this.isOwnGDriveDomain()||this.editor.chromeless&&!this.editor.editable||this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){var z=this.getCurrentFile();z=null!=z?z.getMode():null;mxClient.IS_CHROMEAPP||mxClient.IS_ANDROID||mxClient.IS_IOS||EditorUi.isElectronApp||this.isOffline()||null!=urlParams.open||"1"==urlParams.extAuth||z!=App.MODE_DEVICE&&z!=App.MODE_BROWSER||this.showDownloadDesktopBanner();Editor.fitDiagramOnLoad&&this.fitInitialView()})),-!(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.local||"1"==urlParams.stealth||this.isOffline()||!Editor.enableRealtimeCache||this.editor.chromeless&&!this.editor.editable))){var x=window.setTimeout(mxUtils.bind(this,function(){Editor.enableRealtimeCache=!1}),Editor.cacheTimeout);mxUtils.get(EditorUi.cacheUrl+"?alive",mxUtils.bind(this,function(z){Editor.enableRealtimeCache=200<=z.getStatus()&&299>=z.getStatus();window.clearTimeout(x)}),function(){Editor.enableRealtimeCache=-!1;window.clearTimeout(x)})}this.updateHeader();if(null!=this.menubar){if("sketch"!=Editor.currentTheme&&("simple"!=Editor.currentTheme||"1"!=urlParams.embed)){var B=mxUtils.bind(this,function(){"1"!=urlParams.embed?this.menubar.container.appendChild(this.buttonContainer):this.toolbarContainer.appendChild(this.buttonContainer)});this.addListener("languageChanged",B);this.addListener("currentThemeChanged",B);B()}("kennedy"==Editor.currentTheme&&"1"==urlParams.embed||"atlas"==Editor.currentTheme&&"1"!=-urlParams.embed)&&this.setCompactMode(!0);if("atlas"==Editor.currentTheme||"1"==urlParams.atlas)this.icon=document.createElement("img"),this.icon.setAttribute("src",IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",mxResources.get("draw.io")),this.icon.className="geSmallAppIcon","1"!=urlParams.embed&&(this.icon.style.cursor="pointer",mxEvent.addListener(this.icon,"click",mxUtils.bind(this,function(z){this.appIconClicked(z)}))),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild)}this.editor.graph.isViewer()&&+this.gitHub.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()}))}catch(y){null!=window.console&&console.log("GitHubClient disabled: "+y.message)}try{this.gitLab="0"==urlParams.gl||"1"==urlParams.embed&&"1"!=urlParams.gl?null:new GitLabClient(this),null!=this.gitLab&&this.gitLab.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()}))}catch(y){null!=window.console&&console.log("GitLabClient disabled: "++y.message)}if("1"!=urlParams.embed||"1"==urlParams.od){var b=mxUtils.bind(this,function(){if("undefined"!==typeof OneDrive)try{this.oneDrive=new OneDriveClient(this),this.oneDrive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.oneDrive))}catch(y){null!=window.console&&console.log("OneDriveClient disabled: "+y.message)}else null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=+b)});b()}if("0"!=urlParams.ms365&&!EditorUi.isElectronApp)try{this.m365=new OneDriveClient(this,!1,!1,!1,!0),this.m365.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.m365))}catch(y){null!=window.console&&console.log("M365Client disabled: "+y.message)}if("1"!=urlParams.embed||"1"==urlParams.tr){var l=mxUtils.bind(this,function(){if("undefined"!==typeof window.Trello)try{this.trello=+new TrelloClient(this),this.trello.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))}catch(y){null!=window.console&&console.log("TrelloClient disabled: "+y.message)}else null==window.DrawTrelloClientCallback&&(window.DrawTrelloClientCallback=l)});l()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var p=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var y=mxUtils.bind(this,+function(){try{this.drive=new DriveClient(this),this.drive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();"1"!=urlParams.dev&&this.checkLicense()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))}catch(G){null!=window.console&&console.log("DriveClient disabled: "+G.message)}});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,y),window.DrawGapiClientCallback=null):+y()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=p)});p()}if("1"!=urlParams.embed||"1"==urlParams.db){var g=mxUtils.bind(this,function(){if("function"===typeof Dropbox){window.DrawDropboxClientCallback=null;try{this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))}catch(y){null!=window.console&&+console.log("DropboxClient disabled: "+y.message)}}else null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=g)});g()}if("1"!=urlParams.embed&&(this.setGraphEnabled(!1),"1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode,"serviceWorker"in navigator&&!this.editor.isChromelessView()&&(mxClient.IS_ANDROID||mxClient.IS_IOS)&&window.addEventListener("beforeinstallprompt",mxUtils.bind(this,function(y){this.showBanner("AddToHomeScreenFooter",mxResources.get("installApp"),+mxUtils.bind(this,function(){y.prompt()}),!0,!0)})),!this.isOwnGDriveDomain()||this.editor.chromeless&&!this.editor.editable||this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){var y=this.getCurrentFile();y=null!=y?y.getMode():null;mxClient.IS_CHROMEAPP||mxClient.IS_ANDROID||mxClient.IS_IOS||EditorUi.isElectronApp||this.isOffline()||null!=urlParams.open||"1"==urlParams.extAuth||y!=App.MODE_DEVICE&&y!=App.MODE_BROWSER||this.showDownloadDesktopBanner();Editor.fitDiagramOnLoad&&this.fitInitialView()})),+!(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.local||"1"==urlParams.stealth||this.isOffline()||!Editor.enableRealtimeCache||this.editor.chromeless&&!this.editor.editable))){var x=window.setTimeout(mxUtils.bind(this,function(){Editor.enableRealtimeCache=!1}),Editor.cacheTimeout);mxUtils.get(EditorUi.cacheUrl+"?alive",mxUtils.bind(this,function(y){Editor.enableRealtimeCache=200<=y.getStatus()&&299>=y.getStatus();window.clearTimeout(x)}),function(){Editor.enableRealtimeCache=+!1;window.clearTimeout(x)})}this.updateHeader();if(null!=this.menubar){if("sketch"!=Editor.currentTheme&&("simple"!=Editor.currentTheme||"1"!=urlParams.embed)){var A=mxUtils.bind(this,function(){"1"!=urlParams.embed?this.menubar.container.appendChild(this.buttonContainer):this.toolbarContainer.appendChild(this.buttonContainer)});this.addListener("languageChanged",A);this.addListener("currentThemeChanged",A);A()}("kennedy"==Editor.currentTheme&&"1"==urlParams.embed||"atlas"==Editor.currentTheme&&"1"!=+urlParams.embed)&&this.setCompactMode(!0);if("atlas"==Editor.currentTheme||"1"==urlParams.atlas)this.icon=document.createElement("img"),this.icon.setAttribute("src",IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",mxResources.get("draw.io")),this.icon.className="geSmallAppIcon","1"!=urlParams.embed&&(this.icon.style.cursor="pointer",mxEvent.addListener(this.icon,"click",mxUtils.bind(this,function(y){this.appIconClicked(y)}))),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild)}this.editor.graph.isViewer()&&this.initializeViewerMode()}};App.blockedAncestorFrames=function(){try{if(window.location.ancestorOrigins&&window.location.hostname&&window.location.ancestorOrigins.length&&0<window.location.ancestorOrigins.length){var b=window.location.hostname;b&&1<b.length&&"/"==b.charAt(b.length-1)&&b.substring(0,b.length-1);b="";for(var l=0;l<window.location.ancestorOrigins.length;l++)if(b+=" -> "+window.location.ancestorOrigins[l],b.endsWith("dan6v7pm1f1a1.cloudfront.net")||b.endsWith("confluence-cloud-excalidraw-2-ll3likebca-uc.a.run.app"))return!0}}catch(p){}return!1};App.prototype.scheduleSanityCheck=function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=this.sanityCheckThread||(this.sanityCheckThread=window.setTimeout(mxUtils.bind(this,function(){this.sanityCheckThread=null;this.sanityCheck()}),this.warnInterval))};App.prototype.stopSanityCheck=function(){null!=this.sanityCheckThread&&(window.clearTimeout(this.sanityCheckThread),this.sanityCheckThread=null)};App.prototype.sanityCheck=function(){var b=this.getCurrentFile();if(null!=b&&b.isModified()&&b.isAutosave()&&b.isOverdue()){b.getHash();b.savingFile&&null!=b.savingFileTime&&(Date.now(),b.savingFileTime.getTime());null!=b.ageStart&&(Date.now(),b.ageStart.getTime());b.isAutosave();null!=b.opened&&(Date.now(),b.opened.getTime());null!=b.lastSaved&&(Date.now(),b.lastSaved.getTime());null!=b.lastChanged&&(Date.now(),b.lastChanged.getTime());Date.now();App.startTime.getTime();var l=null!=b.sync?"client_"+@@ -14661,25 +14665,25 @@ App.prototype.showRatingBanner=function(){if(!(this.bannerShowing||this.hideBannp.setAttribute("border","0");p.setAttribute("align","absmiddle");p.setAttribute("title","1 star");p.setAttribute("style","margin-top:-6px;cursor:pointer;margin-left:8px;");p.setAttribute("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAQRdEVYdFhNTDpjb20uYWRvYmUueG1wADw/eHBhY2tldCBiZWdpbj0iICAgIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDQuMS1jMDM0IDQ2LjI3Mjk3NiwgU2F0IEphbiAyNyAyMDA3IDIyOjExOjQxICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4YXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eGFwOkNyZWF0b3JUb29sPkFkb2JlIEZpcmV3b3JrcyBDUzM8L3hhcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhhcDpDcmVhdGVEYXRlPjIwMDgtMDItMTdUMDI6MzY6NDVaPC94YXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhhcDpNb2RpZnlEYXRlPjIwMDktMDMtMTdUMTQ6MTI6MDJaPC94YXA6TW9kaWZ5RGF0ZT4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIIImu8AAAAAVdEVYdENyZWF0aW9uIFRpbWUAMi8xNy8wOCCcqlgAAAHuSURBVDiNlZJBi1JRGIbfk+fc0ZuMXorJe4XujWoMdREaA23HICj6AQeLINr0C4I27ab27VqOI9+q/sH8gMDceG1RkIwgClEXFMbRc5zTZgZURmG+5fu9PN/7Hg6wZohoh4h21nn4uqXW+q0xZgzg+SrPlTXX73uet+26bp6ICpcGaK1fua57M5vN3tZav7gUgIiSqVTqcRAEm0EQbCaTyQoRXb3Iy4hoG8CT6XSaY4xtMMaSQohMPp8v+r7vAEC3243CMGwqpfoApsaYE8uyfgM45ABOjDEvXdfNlMvlzFINAIDneY7neZVzvdlsDgaDQYtzfsjOIjtKqU+e5+0Wi0V3VV8ACMOw3+/3v3HOX0sp/7K53te11h/S6fRuoVAIhBAL76OUOm2320dRFH0VQuxJKf8BAFu+UKvVvpRKpWe2bYt5fTweq0ajQUKIN1LK43N94SMR0Y1YLLYlhBBKqQUw51wkEol7WmuzoC8FuJtIJLaUUoii6Ljb7f4yxpz6vp9zHMe2bfvacDi8BeDHKkBuNps5rVbr52QyaVuW9ZExttHpdN73ej0/Ho+nADxYCdBaV0aj0RGAz5ZlHUgpx2erR/V6/d1wOHwK4CGA/QsBnPN9AN+llH+WkqFare4R0QGAO/M6M8Ysey81/wGqa8MlVvHPNAAAAABJRU5ErkJggg==");b.appendChild(p);var g=document.createElement("img");g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.setAttribute("title","2 star");g.setAttribute("style","margin-top:-6px;margin-left:3px;cursor:pointer;");g.setAttribute("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAQRdEVYdFhNTDpjb20uYWRvYmUueG1wADw/eHBhY2tldCBiZWdpbj0iICAgIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDQuMS1jMDM0IDQ2LjI3Mjk3NiwgU2F0IEphbiAyNyAyMDA3IDIyOjExOjQxICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4YXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eGFwOkNyZWF0b3JUb29sPkFkb2JlIEZpcmV3b3JrcyBDUzM8L3hhcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhhcDpDcmVhdGVEYXRlPjIwMDgtMDItMTdUMDI6MzY6NDVaPC94YXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhhcDpNb2RpZnlEYXRlPjIwMDktMDMtMTdUMTQ6MTI6MDJaPC94YXA6TW9kaWZ5RGF0ZT4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIIImu8AAAAAVdEVYdENyZWF0aW9uIFRpbWUAMi8xNy8wOCCcqlgAAAHuSURBVDiNlZJBi1JRGIbfk+fc0ZuMXorJe4XujWoMdREaA23HICj6AQeLINr0C4I27ab27VqOI9+q/sH8gMDceG1RkIwgClEXFMbRc5zTZgZURmG+5fu9PN/7Hg6wZohoh4h21nn4uqXW+q0xZgzg+SrPlTXX73uet+26bp6ICpcGaK1fua57M5vN3tZav7gUgIiSqVTqcRAEm0EQbCaTyQoRXb3Iy4hoG8CT6XSaY4xtMMaSQohMPp8v+r7vAEC3243CMGwqpfoApsaYE8uyfgM45ABOjDEvXdfNlMvlzFINAIDneY7neZVzvdlsDgaDQYtzfsjOIjtKqU+e5+0Wi0V3VV8ACMOw3+/3v3HOX0sp/7K53te11h/S6fRuoVAIhBAL76OUOm2320dRFH0VQuxJKf8BAFu+UKvVvpRKpWe2bYt5fTweq0ajQUKIN1LK43N94SMR0Y1YLLYlhBBKqQUw51wkEol7WmuzoC8FuJtIJLaUUoii6Ljb7f4yxpz6vp9zHMe2bfvacDi8BeDHKkBuNps5rVbr52QyaVuW9ZExttHpdN73ej0/Ho+nADxYCdBaV0aj0RGAz5ZlHUgpx2erR/V6/d1wOHwK4CGA/QsBnPN9AN+llH+WkqFare4R0QGAO/M6M8Ysey81/wGqa8MlVvHPNAAAAABJRU5ErkJggg==");b.appendChild(g);var x=document.createElement("img");x.setAttribute("border","0");x.setAttribute("align","absmiddle");x.setAttribute("title","3 star");x.setAttribute("style","margin-top:-6px;margin-left:3px;cursor:pointer;");x.setAttribute("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAQRdEVYdFhNTDpjb20uYWRvYmUueG1wADw/eHBhY2tldCBiZWdpbj0iICAgIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDQuMS1jMDM0IDQ2LjI3Mjk3NiwgU2F0IEphbiAyNyAyMDA3IDIyOjExOjQxICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4YXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eGFwOkNyZWF0b3JUb29sPkFkb2JlIEZpcmV3b3JrcyBDUzM8L3hhcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhhcDpDcmVhdGVEYXRlPjIwMDgtMDItMTdUMDI6MzY6NDVaPC94YXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhhcDpNb2RpZnlEYXRlPjIwMDktMDMtMTdUMTQ6MTI6MDJaPC94YXA6TW9kaWZ5RGF0ZT4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIIImu8AAAAAVdEVYdENyZWF0aW9uIFRpbWUAMi8xNy8wOCCcqlgAAAHuSURBVDiNlZJBi1JRGIbfk+fc0ZuMXorJe4XujWoMdREaA23HICj6AQeLINr0C4I27ab27VqOI9+q/sH8gMDceG1RkIwgClEXFMbRc5zTZgZURmG+5fu9PN/7Hg6wZohoh4h21nn4uqXW+q0xZgzg+SrPlTXX73uet+26bp6ICpcGaK1fua57M5vN3tZav7gUgIiSqVTqcRAEm0EQbCaTyQoRXb3Iy4hoG8CT6XSaY4xtMMaSQohMPp8v+r7vAEC3243CMGwqpfoApsaYE8uyfgM45ABOjDEvXdfNlMvlzFINAIDneY7neZVzvdlsDgaDQYtzfsjOIjtKqU+e5+0Wi0V3VV8ACMOw3+/3v3HOX0sp/7K53te11h/S6fRuoVAIhBAL76OUOm2320dRFH0VQuxJKf8BAFu+UKvVvpRKpWe2bYt5fTweq0ajQUKIN1LK43N94SMR0Y1YLLYlhBBKqQUw51wkEol7WmuzoC8FuJtIJLaUUoii6Ljb7f4yxpz6vp9zHMe2bfvacDi8BeDHKkBuNps5rVbr52QyaVuW9ZExttHpdN73ej0/Ho+nADxYCdBaV0aj0RGAz5ZlHUgpx2erR/V6/d1wOHwK4CGA/QsBnPN9AN+llH+WkqFare4R0QGAO/M6M8Ysey81/wGqa8MlVvHPNAAAAABJRU5ErkJggg==");-b.appendChild(x);var B=document.createElement("img");B.setAttribute("border","0");B.setAttribute("align","absmiddle");B.setAttribute("title","4 star");B.setAttribute("style","margin-top:-6px;margin-left:3px;cursor:pointer;");B.setAttribute("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAQRdEVYdFhNTDpjb20uYWRvYmUueG1wADw/eHBhY2tldCBiZWdpbj0iICAgIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDQuMS1jMDM0IDQ2LjI3Mjk3NiwgU2F0IEphbiAyNyAyMDA3IDIyOjExOjQxICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4YXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eGFwOkNyZWF0b3JUb29sPkFkb2JlIEZpcmV3b3JrcyBDUzM8L3hhcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhhcDpDcmVhdGVEYXRlPjIwMDgtMDItMTdUMDI6MzY6NDVaPC94YXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhhcDpNb2RpZnlEYXRlPjIwMDktMDMtMTdUMTQ6MTI6MDJaPC94YXA6TW9kaWZ5RGF0ZT4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIIImu8AAAAAVdEVYdENyZWF0aW9uIFRpbWUAMi8xNy8wOCCcqlgAAAHuSURBVDiNlZJBi1JRGIbfk+fc0ZuMXorJe4XujWoMdREaA23HICj6AQeLINr0C4I27ab27VqOI9+q/sH8gMDceG1RkIwgClEXFMbRc5zTZgZURmG+5fu9PN/7Hg6wZohoh4h21nn4uqXW+q0xZgzg+SrPlTXX73uet+26bp6ICpcGaK1fua57M5vN3tZav7gUgIiSqVTqcRAEm0EQbCaTyQoRXb3Iy4hoG8CT6XSaY4xtMMaSQohMPp8v+r7vAEC3243CMGwqpfoApsaYE8uyfgM45ABOjDEvXdfNlMvlzFINAIDneY7neZVzvdlsDgaDQYtzfsjOIjtKqU+e5+0Wi0V3VV8ACMOw3+/3v3HOX0sp/7K53te11h/S6fRuoVAIhBAL76OUOm2320dRFH0VQuxJKf8BAFu+UKvVvpRKpWe2bYt5fTweq0ajQUKIN1LK43N94SMR0Y1YLLYlhBBKqQUw51wkEol7WmuzoC8FuJtIJLaUUoii6Ljb7f4yxpz6vp9zHMe2bfvacDi8BeDHKkBuNps5rVbr52QyaVuW9ZExttHpdN73ej0/Ho+nADxYCdBaV0aj0RGAz5ZlHUgpx2erR/V6/d1wOHwK4CGA/QsBnPN9AN+llH+WkqFare4R0QGAO/M6M8Ysey81/wGqa8MlVvHPNAAAAABJRU5ErkJggg==");-b.appendChild(B);this.bannerShowing=!0;var z=mxUtils.bind(this,function(){null!=b.parentNode&&(b.parentNode.removeChild(b),this.bannerShowing=!1,this.hideBannerratingFooter=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings.closeratingFooter=Date.now(),mxSettings.save()))});mxEvent.addListener(l,"click",mxUtils.bind(this,function(F){mxEvent.consume(F);z()}));mxEvent.addListener(p,"click",mxUtils.bind(this,function(F){mxEvent.consume(F);z()}));mxEvent.addListener(g,"click",mxUtils.bind(this,-function(F){mxEvent.consume(F);z()}));mxEvent.addListener(x,"click",mxUtils.bind(this,function(F){mxEvent.consume(F);z()}));mxEvent.addListener(B,"click",mxUtils.bind(this,function(F){mxEvent.consume(F);window.open("https://marketplace.atlassian.com/apps/1210933/draw-io-diagrams-for-confluence?hosting=datacenter&tab=reviews");z()}));l=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(b.style,"transform","translate(-50%,120%)");window.setTimeout(mxUtils.bind(this,function(){z()}),1E3)});window.setTimeout(mxUtils.bind(this,+b.appendChild(x);var A=document.createElement("img");A.setAttribute("border","0");A.setAttribute("align","absmiddle");A.setAttribute("title","4 star");A.setAttribute("style","margin-top:-6px;margin-left:3px;cursor:pointer;");A.setAttribute("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAQRdEVYdFhNTDpjb20uYWRvYmUueG1wADw/eHBhY2tldCBiZWdpbj0iICAgIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDQuMS1jMDM0IDQ2LjI3Mjk3NiwgU2F0IEphbiAyNyAyMDA3IDIyOjExOjQxICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4YXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eGFwOkNyZWF0b3JUb29sPkFkb2JlIEZpcmV3b3JrcyBDUzM8L3hhcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhhcDpDcmVhdGVEYXRlPjIwMDgtMDItMTdUMDI6MzY6NDVaPC94YXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhhcDpNb2RpZnlEYXRlPjIwMDktMDMtMTdUMTQ6MTI6MDJaPC94YXA6TW9kaWZ5RGF0ZT4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIIImu8AAAAAVdEVYdENyZWF0aW9uIFRpbWUAMi8xNy8wOCCcqlgAAAHuSURBVDiNlZJBi1JRGIbfk+fc0ZuMXorJe4XujWoMdREaA23HICj6AQeLINr0C4I27ab27VqOI9+q/sH8gMDceG1RkIwgClEXFMbRc5zTZgZURmG+5fu9PN/7Hg6wZohoh4h21nn4uqXW+q0xZgzg+SrPlTXX73uet+26bp6ICpcGaK1fua57M5vN3tZav7gUgIiSqVTqcRAEm0EQbCaTyQoRXb3Iy4hoG8CT6XSaY4xtMMaSQohMPp8v+r7vAEC3243CMGwqpfoApsaYE8uyfgM45ABOjDEvXdfNlMvlzFINAIDneY7neZVzvdlsDgaDQYtzfsjOIjtKqU+e5+0Wi0V3VV8ACMOw3+/3v3HOX0sp/7K53te11h/S6fRuoVAIhBAL76OUOm2320dRFH0VQuxJKf8BAFu+UKvVvpRKpWe2bYt5fTweq0ajQUKIN1LK43N94SMR0Y1YLLYlhBBKqQUw51wkEol7WmuzoC8FuJtIJLaUUoii6Ljb7f4yxpz6vp9zHMe2bfvacDi8BeDHKkBuNps5rVbr52QyaVuW9ZExttHpdN73ej0/Ho+nADxYCdBaV0aj0RGAz5ZlHUgpx2erR/V6/d1wOHwK4CGA/QsBnPN9AN+llH+WkqFare4R0QGAO/M6M8Ysey81/wGqa8MlVvHPNAAAAABJRU5ErkJggg==");+b.appendChild(A);this.bannerShowing=!0;var y=mxUtils.bind(this,function(){null!=b.parentNode&&(b.parentNode.removeChild(b),this.bannerShowing=!1,this.hideBannerratingFooter=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings.closeratingFooter=Date.now(),mxSettings.save()))});mxEvent.addListener(l,"click",mxUtils.bind(this,function(G){mxEvent.consume(G);y()}));mxEvent.addListener(p,"click",mxUtils.bind(this,function(G){mxEvent.consume(G);y()}));mxEvent.addListener(g,"click",mxUtils.bind(this,+function(G){mxEvent.consume(G);y()}));mxEvent.addListener(x,"click",mxUtils.bind(this,function(G){mxEvent.consume(G);y()}));mxEvent.addListener(A,"click",mxUtils.bind(this,function(G){mxEvent.consume(G);window.open("https://marketplace.atlassian.com/apps/1210933/draw-io-diagrams-for-confluence?hosting=datacenter&tab=reviews");y()}));l=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(b.style,"transform","translate(-50%,120%)");window.setTimeout(mxUtils.bind(this,function(){y()}),1E3)});window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(b.style,"transform","translate(-50%,0%)")}),500);window.setTimeout(l,6E4)}};-App.prototype.checkLicense=function(){var b=this.drive.getUser(),l=null!=b?b.email:null;if(!this.isOffline()&&!this.editor.chromeless&&null!=l&&null!=b.id){var p=l.lastIndexOf("@"),g=0<=p?l.substring(p+1):"";b=Editor.crc32(b.id);"gmail.com"!==g.toLowerCase()&&mxUtils.post("/license","domain="+encodeURIComponent(g)+"&id="+encodeURIComponent(b)+"&ts="+(new Date).getTime(),mxUtils.bind(this,function(x){try{if(200<=x.getStatus()&&299>=x.getStatus()){var B=x.getText();if(0<B.length){var z=JSON.parse(B);-null!=z&&this.handleLicense(z,g)}}}catch(F){}}))}};App.prototype.handleLicense=function(b,l){};App.prototype.getEditBlankXml=function(){var b=this.getCurrentFile();return null!=b&&this.editor.isChromelessView()&&this.editor.graph.isLightboxView()?b.getData():this.getFileData(!0)};App.prototype.updateActionStates=function(){EditorUi.prototype.updateActionStates.apply(this,arguments);this.actions.get("revisionHistory").setEnabled(this.isRevisionHistoryEnabled())};+App.prototype.checkLicense=function(){var b=this.drive.getUser(),l=null!=b?b.email:null;if(!this.isOffline()&&!this.editor.chromeless&&null!=l&&null!=b.id){var p=l.lastIndexOf("@"),g=0<=p?l.substring(p+1):"";b=Editor.crc32(b.id);"gmail.com"!==g.toLowerCase()&&mxUtils.post("/license","domain="+encodeURIComponent(g)+"&id="+encodeURIComponent(b)+"&ts="+(new Date).getTime(),mxUtils.bind(this,function(x){try{if(200<=x.getStatus()&&299>=x.getStatus()){var A=x.getText();if(0<A.length){var y=JSON.parse(A);+null!=y&&this.handleLicense(y,g)}}}catch(G){}}))}};App.prototype.handleLicense=function(b,l){};App.prototype.getEditBlankXml=function(){var b=this.getCurrentFile();return null!=b&&this.editor.isChromelessView()&&this.editor.graph.isLightboxView()?b.getData():this.getFileData(!0)};App.prototype.updateActionStates=function(){EditorUi.prototype.updateActionStates.apply(this,arguments);this.actions.get("revisionHistory").setEnabled(this.isRevisionHistoryEnabled())};App.prototype.addRecent=function(b,l,p){if(isLocalStorage&&null!=localStorage){l=null!=l?l:"";var g=this.getRecent(l);if(null==g)g=[];else for(var x=0;x<g.length;x++)g[x].mode==b.mode&&g[x].id==b.id&&g.splice(x,1);null!=g&&(p=null!=p?p:10,g.unshift(b),g=g.slice(0,p),localStorage.setItem(".recent"+l,JSON.stringify(g)))}};App.prototype.getRecent=function(b){if(isLocalStorage&&null!=localStorage){try{var l=localStorage.getItem(".recent"+(null!=b?b:""));if(null!=l)return JSON.parse(l)}catch(p){}return null}};App.prototype.resetRecent=function(b){if(isLocalStorage&&null!=localStorage)try{localStorage.removeItem(".recent"+(null!=b?b:""))}catch(l){}};App.prototype.onBeforeUnload=function(){if("1"==urlParams.embed&&this.editor.modified)return mxResources.get("allChangesLost");this.unloading=!0;var b=this.getCurrentFile();if(null!=b)if(b.constructor!=LocalFile||""!=b.getHash()||b.isModified()||"1"==urlParams.nowarn||this.isDiagramEmpty()||null!=urlParams.url||this.editor.isChromelessView()||null!=b.fileHandle){if(b.isModified())return this.logIfModified(b),mxResources.get("allChangesLost");b.close(!0)}else return mxResources.get("ensureDataSaved")};App.prototype.updateDocumentTitle=function(){var b=this.editor.appName,l=this.getCurrentFile();null==l||!this.editor.graph.isLightboxView()&&"simple"!=Editor.currentTheme||null==this.pages||null==this.currentPage?this.isOfflineApp()&&(b+=" app"):b=this.getShortPageName(this.currentPage);null!=l&&(b=(null!=l.getTitle()?l.getTitle():this.defaultFilename)+" - "+b);document.title!=b&&(document.title=b)};-App.prototype.getThumbnail=function(b,l,p){p=null!=p?p:0;var g=!1;try{var x=!0,B=window.setTimeout(mxUtils.bind(this,function(){x=!1;l(null)}),this.timeout),z=mxUtils.bind(this,function(J){window.clearTimeout(B);x&&l(J)});null==this.thumbImageCache&&(this.thumbImageCache={});var F=this.editor.graph,K=F.backgroundImage;if(null!=this.pages&&this.currentPage!=this.pages[0]){var M=F.getGlobalVariable;F=this.createTemporaryGraph(F.getStylesheet());F.setBackgroundImage=this.editor.graph.setBackgroundImage;-var L=this.pages[0];this.currentPage==L?(F.mathEnabled=this.editor.graph.mathEnabled,F.setBackgroundImage(K)):null!=L.viewState&&null!=L.viewState&&(F.mathEnabled=L.viewState.mathEnabled,K=L.viewState.backgroundImage,F.setBackgroundImage(K));F.getGlobalVariable=function(J){return"page"==J?L.getName():"pagenumber"==J?1:M.apply(this,arguments)};F.getGlobalVariable=M;document.body.appendChild(F.container);F.model.setRoot(L.root)}if(mxClient.IS_CHROMEAPP||Editor.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,-function(J){try{F!=this.editor.graph&&null!=F.container.parentNode&&F.container.parentNode.removeChild(F.container)}catch(S){J=null}z(J)}),b,this.thumbImageCache,"#ffffff",function(){z()},null,null,null,null,null,null,F,p,null,null,null,"diagram",null),g=!0;else if(Editor.canvasSupported&&null!=this.getCurrentFile()){var Q=document.createElement("canvas"),c=F.getGraphBounds(),f=F.view.translate,k=F.view.scale;null!=K&&(c=mxRectangle.fromRectangle(c),c.add(new mxRectangle((f.x+K.x)*k,(f.y+K.y)*k,K.width*-k,K.height*k)));var n=b/c.width;n=Math.min(1,Math.min(3*b/(4*c.height),n));var q=Math.floor(c.x),t=Math.floor(c.y);Q.setAttribute("width",Math.ceil(n*(c.width+4)));Q.setAttribute("height",Math.ceil(n*(c.height+4)));var u=Q.getContext("2d");u.scale(n,n);u.translate(-q,-t);var y=F.background;if(null==y||""==y||y==mxConstants.NONE)y="#ffffff";u.save();u.fillStyle=y;u.fillRect(q,t,Math.ceil(c.width+4),Math.ceil(c.height+4));u.restore();if(null!=K){var E=new Image;E.src=K.src;u.drawImage(E,K.x*n,K.y*n,-K.width*n,K.height*n)}var I=new mxJsCanvas(Q),C=new mxAsyncCanvas(this.thumbImageCache);I.images=this.thumbImageCache.images;var U=new mxImageExport;U.drawShape=function(J,S){J.shape instanceof mxShape&&J.shape.checkBounds()&&(S.save(),S.translate(.5,.5),J.shape.paint(S),S.translate(-.5,-.5),S.restore())};U.drawText=function(J,S){};U.drawState(F.getView().getState(F.model.root),C);C.finish(mxUtils.bind(this,function(){try{U.drawState(F.getView().getState(F.model.root),I),F!=this.editor.graph&&null!=-F.container.parentNode&&F.container.parentNode.removeChild(F.container)}catch(J){Q=null}z(Q)}));g=!0}}catch(J){g=!1,null!=F&&F!=this.editor.graph&&null!=F.container.parentNode&&F.container.parentNode.removeChild(F.container)}g||window.clearTimeout(B);return g};+App.prototype.getThumbnail=function(b,l,p){p=null!=p?p:0;var g=!1;try{var x=!0,A=window.setTimeout(mxUtils.bind(this,function(){x=!1;l(null)}),this.timeout),y=mxUtils.bind(this,function(K){window.clearTimeout(A);x&&l(K)});null==this.thumbImageCache&&(this.thumbImageCache={});var G=this.editor.graph,L=G.backgroundImage;if(null!=this.pages&&this.currentPage!=this.pages[0]){var O=G.getGlobalVariable;G=this.createTemporaryGraph(G.getStylesheet());G.setBackgroundImage=this.editor.graph.setBackgroundImage;+var J=this.pages[0];this.currentPage==J?(G.mathEnabled=this.editor.graph.mathEnabled,G.setBackgroundImage(L)):null!=J.viewState&&null!=J.viewState&&(G.mathEnabled=J.viewState.mathEnabled,L=J.viewState.backgroundImage,G.setBackgroundImage(L));G.getGlobalVariable=function(K){return"page"==K?J.getName():"pagenumber"==K?1:O.apply(this,arguments)};G.getGlobalVariable=O;document.body.appendChild(G.container);G.model.setRoot(J.root)}if(mxClient.IS_CHROMEAPP||Editor.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,+function(K){try{G!=this.editor.graph&&null!=G.container.parentNode&&G.container.parentNode.removeChild(G.container)}catch(S){K=null}y(K)}),b,this.thumbImageCache,"#ffffff",function(){y()},null,null,null,null,null,null,G,p,null,null,null,"diagram",null),g=!0;else if(Editor.canvasSupported&&null!=this.getCurrentFile()){var Q=document.createElement("canvas"),c=G.getGraphBounds(),f=G.view.translate,k=G.view.scale;null!=L&&(c=mxRectangle.fromRectangle(c),c.add(new mxRectangle((f.x+L.x)*k,(f.y+L.y)*k,L.width*+k,L.height*k)));var n=b/c.width;n=Math.min(1,Math.min(3*b/(4*c.height),n));var q=Math.floor(c.x),t=Math.floor(c.y);Q.setAttribute("width",Math.ceil(n*(c.width+4)));Q.setAttribute("height",Math.ceil(n*(c.height+4)));var u=Q.getContext("2d");u.scale(n,n);u.translate(-q,-t);var B=G.background;if(null==B||""==B||B==mxConstants.NONE)B="#ffffff";u.save();u.fillStyle=B;u.fillRect(q,t,Math.ceil(c.width+4),Math.ceil(c.height+4));u.restore();if(null!=L){var E=new Image;E.src=L.src;u.drawImage(E,L.x*n,L.y*n,+L.width*n,L.height*n)}var I=new mxJsCanvas(Q),C=new mxAsyncCanvas(this.thumbImageCache);I.images=this.thumbImageCache.images;var U=new mxImageExport;U.drawShape=function(K,S){K.shape instanceof mxShape&&K.shape.checkBounds()&&(S.save(),S.translate(.5,.5),K.shape.paint(S),S.translate(-.5,-.5),S.restore())};U.drawText=function(K,S){};U.drawState(G.getView().getState(G.model.root),C);C.finish(mxUtils.bind(this,function(){try{U.drawState(G.getView().getState(G.model.root),I),G!=this.editor.graph&&null!=+G.container.parentNode&&G.container.parentNode.removeChild(G.container)}catch(K){Q=null}y(Q)}));g=!0}}catch(K){g=!1,null!=G&&G!=this.editor.graph&&null!=G.container.parentNode&&G.container.parentNode.removeChild(G.container)}g||window.clearTimeout(A);return g};(function(){var b=EditorUi.prototype.setMode;App.prototype.setMode=function(l,p){b.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(null!=this.appIcon){var g=this.getCurrentFile();l=null!=g?g.getMode():l;null==this.updateTitleListener&&(this.updateTitleListener=mxUtils.bind(this,function(){l==App.MODE_GOOGLE?this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("googleDrive")])):l==App.MODE_DROPBOX?this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])):l==App.MODE_ONEDRIVE?this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])):this.appIcon.removeAttribute("title")}),this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTitleListener()})));this.updateTitleListener()}if(p)try{if(isLocalStorage)localStorage.setItem(".mode",l);else if("undefined"!=typeof Storage){var x=new Date;x.setYear(x.getFullYear()+1);document.cookie="MODE="+l+"; expires="+-x.toUTCString()}}catch(B){}}})();+x.toUTCString()}}catch(A){}}})();App.prototype.appIconClicked=function(b){var l=this.getCurrentFile(),p=null!=l?l.getMode():null;l=null!=l?mxEvent.isAltDown(b)?l.getFolderUrl():l.getFileUrl():null;null!=l?this.openLink(l):p==App.MODE_GOOGLE?this.openLink("https://drive.google.com/?authuser=0"):p==App.MODE_ONEDRIVE?this.openLink("https://onedrive.live.com/"):p==App.MODE_DROPBOX?this.openLink("https://www.dropbox.com/"):p==App.MODE_GITHUB?this.openLink("https://github.com/"):p==App.MODE_GITLAB?this.openLink(DRAWIO_GITLAB_URL):p==App.MODE_TRELLO?this.openLink("https://trello.com/"):p==App.MODE_DEVICE?this.openLink("https://get.draw.io/"):this.openLink("https://www.drawio.com/");mxEvent.consume(b)};App.prototype.clearMode=function(){if(isLocalStorage)localStorage.removeItem(".mode");else if("undefined"!=typeof Storage){var b=new Date;b.setYear(b.getFullYear()-1);document.cookie="MODE=; expires="+b.toUTCString()}};App.prototype.open=function(){try{if(null!=window.opener){var b=urlParams.create;null!=b&&(b=decodeURIComponent(b));if(null!=b&&0<b.length&&"http://"!=b.substring(0,7)&&"https://"!=b.substring(0,8)){var l=mxUtils.parseXml(window.opener[b]);this.editor.setGraphXml(l.documentElement)}else null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(p,g,x){this.spinner.stop();null==g&&(g=urlParams.title,x=!0,g=null!=g?decodeURIComponent(g):this.defaultFilename);0<(Editor.useCanvasForExport?@@ -14691,316 +14695,316 @@ App.prototype.showRefreshDialog=function(b,l){this.showingRefreshDialog||(this.sApp.prototype.showAlert=function(b){if(null!=b&&0<b.length){var l=document.createElement("div");l.className="geAlert";l.style.zIndex=2E9;l.style.left="50%";l.style.top="-100%";l.style.maxWidth="80%";l.style.width="max-content";l.style.whiteSpace="pre-wrap";mxUtils.setPrefixedStyle(l.style,"transform","translate(-50%,0%)");mxUtils.setPrefixedStyle(l.style,"transition","all 1s ease");l.innerHTML=b;b=document.createElement("a");b.className="geAlertLink";b.style.textAlign="right";b.style.marginTop="20px";b.style.display="block";b.setAttribute("title",mxResources.get("close"));b.innerHTML=mxResources.get("close");l.appendChild(b);mxEvent.addListener(b,"click",function(p){null!=l.parentNode&&(l.parentNode.removeChild(l),mxEvent.consume(p))});document.body.appendChild(l);window.setTimeout(function(){l.style.top="30px"},10);window.setTimeout(function(){mxUtils.setPrefixedStyle(l.style,"transition","all 2s ease");l.style.opacity="0";window.setTimeout(function(){null!=l.parentNode&&l.parentNode.removeChild(l)},2E3)},15E3)}};-App.prototype.start=function(){try{this.restoreLibraries();this.spinner.stop();var b=this;window.onerror=function(z,F,K,M,L){"ResizeObserver loop limit exceeded"!=z&&((null==z||0>z.indexOf("Invalid or unexpected token"))&&EditorUi.logError("Uncaught: "+(null!=z?z:""),F,K,M,L,null,!0),b.handleError({message:z},mxResources.get("unknownError"),null,null,null,null,!0))};if("1"!=urlParams.client&&"1"!=urlParams.embed){try{isLocalStorage&&window.addEventListener("storage",mxUtils.bind(this,function(z){var F=-this.getCurrentFile();EditorUi.debug("storage event",[z],[F]);null!=F&&".draft-alive-check"==z.key&&null!=z.newValue&&null!=F.draftId&&(this.draftAliveCheck=z.newValue,F.saveDraft())}))}catch(z){}var l=this.getDiagramId();mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(z){try{var F=this.getDiagramId();if(F!=l){l=F;var K=this.getCurrentFile();null!=K&&K.getHash()==F||this.loadFile(F,!0)}else{var M=this.getHashObject();if(null!=M&&null!=M.pageId&&null!=this.currentPage&&M.pageId!=-this.currentPage.getId()){var L=this.getPageById(M.pageId);null!=L&&this.selectPage(L)}}}catch(Q){null!=document.body&&this.handleError(Q,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var c=this.getCurrentFile();window.location.hash=null!=c?c.getHash():""}))}}))}if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.desc)try{this.loadDescriptor(JSON.parse(Graph.decompress(urlParams.desc)),null,mxUtils.bind(this,function(z){this.handleError(z,mxResources.get("errorLoadingFile"))}))}catch(z){this.handleError(z,-mxResources.get("errorLoadingFile"))}else if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.url)this.loadFile("U"+urlParams.url,!0);else if(null==this.getCurrentFile()){var p=mxUtils.bind(this,function(){if("1"==urlParams.client&&(null==window.location.hash||0==window.location.hash.length||"#P"==window.location.hash.substring(0,2))){var z=mxUtils.bind(this,function(M){Editor.isPngDataUrl(M)&&(M=Editor.extractGraphModelFromPng(M));var L=urlParams.title;L=null!=L?decodeURIComponent(L):-this.defaultFilename;M=new LocalFile(this,M,L,!0);this.fileLoaded(M);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(window.location.hash="");this.editor.chromeless||(M.fileChanged(),window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0))}),F=window.opener||window.parent;if(F!=window){var K=urlParams.create;null!=K?z(F[decodeURIComponent(K)]):(K=urlParams.data,null!=K?z(decodeURIComponent(K)):this.spinner.spin(document.body,mxResources.get("loading"))&&-this.createTimeout(2E3,mxUtils.bind(this,function(M){this.installMessageHandler(mxUtils.bind(this,function(L,Q){Q.source==F&&M.clear()&&(this.spinner.stop(),z(L))}))}),mxUtils.bind(this,function(M){this.handleError(M)})))}}else if(null==this.dialog)if("1"==urlParams.demo)K=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=K;else{K=!1;try{K=null!=window.opener&&null!=window.opener.openFile}catch(M){}K?this.spinner.spin(document.body,-mxResources.get("loading")):(K=this.getDiagramId(),!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=K&&0!=K.length||this.editor.isChromelessView()?null!=K&&0<K.length?this.loadFile(K,null,null,mxUtils.bind(this,function(){var M=decodeURIComponent(urlParams.viewbox||"");if(""!=M)try{var L=JSON.parse(M);this.editor.graph.fitWindow(L,L.border)}catch(Q){console.error(Q)}})):"0"!=urlParams.splash||null!=urlParams.mode&&!EditorUi.isElectronApp?this.loadFile():this.createFile(this.defaultFilename,+App.prototype.start=function(){try{this.restoreLibraries();this.spinner.stop();var b=this;window.onerror=function(y,G,L,O,J){"ResizeObserver loop limit exceeded"!=y&&((null==y||0>y.indexOf("Invalid or unexpected token"))&&EditorUi.logError("Uncaught: "+(null!=y?y:""),G,L,O,J,null,!0),b.handleError({message:y},mxResources.get("unknownError"),null,null,null,null,!0))};if("1"!=urlParams.client&&"1"!=urlParams.embed){try{isLocalStorage&&window.addEventListener("storage",mxUtils.bind(this,function(y){var G=+this.getCurrentFile();EditorUi.debug("storage event",[y],[G]);null!=G&&".draft-alive-check"==y.key&&null!=y.newValue&&null!=G.draftId&&(this.draftAliveCheck=y.newValue,G.saveDraft())}))}catch(y){}var l=this.getDiagramId();mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(y){try{var G=this.getDiagramId();if(G!=l){l=G;var L=this.getCurrentFile();null!=L&&L.getHash()==G||this.loadFile(G,!0)}else{var O=this.getHashObject();if(null!=O&&null!=O.pageId&&null!=this.currentPage&&O.pageId!=+this.currentPage.getId()){var J=this.getPageById(O.pageId);null!=J&&this.selectPage(J)}}}catch(Q){null!=document.body&&this.handleError(Q,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var c=this.getCurrentFile();window.location.hash=null!=c?c.getHash():""}))}}))}if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.desc)try{this.loadDescriptor(JSON.parse(Graph.decompress(urlParams.desc)),null,mxUtils.bind(this,function(y){this.handleError(y,mxResources.get("errorLoadingFile"))}))}catch(y){this.handleError(y,+mxResources.get("errorLoadingFile"))}else if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.url)this.loadFile("U"+urlParams.url,!0);else if(null==this.getCurrentFile()){var p=mxUtils.bind(this,function(){if("1"==urlParams.client&&(null==window.location.hash||0==window.location.hash.length||"#P"==window.location.hash.substring(0,2))){var y=mxUtils.bind(this,function(O){Editor.isPngDataUrl(O)&&(O=Editor.extractGraphModelFromPng(O));var J=urlParams.title;J=null!=J?decodeURIComponent(J):+this.defaultFilename;O=new LocalFile(this,O,J,!0);this.fileLoaded(O);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(window.location.hash="");this.editor.chromeless||(O.fileChanged(),window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0))}),G=window.opener||window.parent;if(G!=window){var L=urlParams.create;null!=L?y(G[decodeURIComponent(L)]):(L=urlParams.data,null!=L?y(decodeURIComponent(L)):this.spinner.spin(document.body,mxResources.get("loading"))&&+this.createTimeout(2E3,mxUtils.bind(this,function(O){this.installMessageHandler(mxUtils.bind(this,function(J,Q){Q.source==G&&O.clear()&&(this.spinner.stop(),y(J))}))}),mxUtils.bind(this,function(O){this.handleError(O)})))}}else if(null==this.dialog)if("1"==urlParams.demo)L=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=L;else{L=!1;try{L=null!=window.opener&&null!=window.opener.openFile}catch(O){}L?this.spinner.spin(document.body,+mxResources.get("loading")):(L=this.getDiagramId(),!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=L&&0!=L.length||this.editor.isChromelessView()?null!=L&&0<L.length?this.loadFile(L,null,null,mxUtils.bind(this,function(){var O=decodeURIComponent(urlParams.viewbox||"");if(""!=O)try{var J=JSON.parse(O);this.editor.graph.fitWindow(J,J.border)}catch(Q){console.error(Q)}})):"0"!=urlParams.splash||null!=urlParams.mode&&!EditorUi.isElectronApp?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0):this.checkDrafts())}}),g=decodeURIComponent(urlParams.create||"");null!=window.location.hash&&"#create="==window.location.hash.substring(0,8)&&(g=decodeURIComponent(window.location.hash.substring(8)));null!=urlParams["smart-template"]&&(null==window.location.hash||1>=window.location.hash.length)&&(g=JSON.stringify({type:"generate",data:decodeURIComponent(urlParams["smart-template"])}));if((null==window.location.hash||1>=window.location.hash.length)&&-0<g.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var x=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create","title"]))}),B=mxUtils.bind(this,function(z){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,z,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var F=urlParams.title;F=null!=F?decodeURIComponent(F):this.defaultFilename;z=this.getServiceCount(!0);-isLocalStorage&&z++;var K=4>=z?2:6<z?4:3;F=new CreateDialog(this,F,mxUtils.bind(this,function(M,L){try{if(null==L){this.hideDialog();var Q=Editor.useLocalStorage;this.createFile(0<M.length?M:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=Q}else this.pickFolder(L,mxUtils.bind(this,function(c){try{this.createFile(M,this.getFileData(!0),null,L,null,!0,c)}catch(f){this.handleError(f)}}))}catch(c){this.handleError(c)}}),null,null,null,null,"1"==urlParams.browser,-null,null,!0,K,null,null,null,this.editor.fileExtensions);this.showDialog(F.container,420,z>K?390:280,!0,!1,mxUtils.bind(this,function(M){M&&null==this.getCurrentFile()&&this.showSplash()}));F.init()}});if("http://"!=g.substring(0,7)&&"https://"!=g.substring(0,8))try{if("{"==g.charAt(0))this.executeCreateObject(JSON.parse(decodeURIComponent(g)),mxUtils.bind(this,function(){window.history.replaceState(null,null,window.location.pathname+this.getSearch(["create"]))}));else if(null!=window.opener&&null!=-window.opener[g])B(window.opener[g]);else throw Error(mxResources.get("invalidCallFnNotFound",["window.opener."+g]));}catch(z){this.handleError(z,mxResources.get("errorLoadingFile"))}else this.loadTemplate(g,function(z){B(z)},mxUtils.bind(this,function(z){this.handleError(z,mxResources.get("errorLoadingFile"),x)}))}else(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.state&&null!=this.stateArg&&"open"==this.stateArg.action?null!=this.stateArg.ids&&(window.history&&window.history.replaceState&&+0<g.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var x=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create","title"]))}),A=mxUtils.bind(this,function(y){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,y,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var G=urlParams.title;G=null!=G?decodeURIComponent(G):this.defaultFilename;y=this.getServiceCount(!0);+isLocalStorage&&y++;var L=4>=y?2:6<y?4:3;G=new CreateDialog(this,G,mxUtils.bind(this,function(O,J){try{if(null==J){this.hideDialog();var Q=Editor.useLocalStorage;this.createFile(0<O.length?O:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=Q}else this.pickFolder(J,mxUtils.bind(this,function(c){try{this.createFile(O,this.getFileData(!0),null,J,null,!0,c)}catch(f){this.handleError(f)}}))}catch(c){this.handleError(c)}}),null,null,null,null,"1"==urlParams.browser,+null,null,!0,L,null,null,null,this.editor.fileExtensions);this.showDialog(G.container,420,y>L?390:280,!0,!1,mxUtils.bind(this,function(O){O&&null==this.getCurrentFile()&&this.showSplash()}));G.init()}});if("http://"!=g.substring(0,7)&&"https://"!=g.substring(0,8))try{if("{"==g.charAt(0))this.executeCreateObject(JSON.parse(decodeURIComponent(g)),mxUtils.bind(this,function(){window.history.replaceState(null,null,window.location.pathname+this.getSearch(["create"]))}));else if(null!=window.opener&&null!=+window.opener[g])A(window.opener[g]);else throw Error(mxResources.get("invalidCallFnNotFound",["window.opener."+g]));}catch(y){this.handleError(y,mxResources.get("errorLoadingFile"))}else this.loadTemplate(g,function(y){A(y)},mxUtils.bind(this,function(y){this.handleError(y,mxResources.get("errorLoadingFile"),x)}))}else(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.state&&null!=this.stateArg&&"open"==this.stateArg.action?null!=this.stateArg.ids&&(window.history&&window.history.replaceState&&window.history.replaceState(null,null,window.location.pathname+this.getSearch(["state","splash"])),window.location.hash="G"+this.stateArg.ids[0]):(null==window.location.hash||1>=window.location.hash.length)&&null!=this.drive&&null!=this.stateArg&&"create"==this.stateArg.action?(window.history&&window.history.replaceState&&window.history.replaceState(null,null,window.location.pathname+this.getSearch(["state"])),this.setMode(App.MODE_GOOGLE),"0"==urlParams.splash?this.createFile(null!=urlParams.title?-decodeURIComponent(urlParams.title):this.defaultFilename):this.actions.get("new").funct()):(null!=urlParams.open&&window.history&&window.history.replaceState&&(window.history.replaceState(null,null,window.location.pathname+this.getSearch(["open","sketch"])),window.location.hash=urlParams.open),p())}}catch(z){this.handleError(z)}};-App.prototype.executeCreateObject=function(b,l){try{EditorUi.debug("App.executeCreateObject",[this],"value",[b]);var p=mxUtils.bind(this,function(z){this.spinner.stop();this.createFile(null!=b.filename?b.filename:this.defaultFilename,z,null,null,mxUtils.bind(this,function(){null!=urlParams.pv&&this.setPageVisible("1"==urlParams.pv);null!=urlParams.grid&&this.editor.graph.setGridEnabled("1"==urlParams.grid);var F=mxUtils.bind(this,function(){this.initialFitDiagram(1.2);if("pop"==b.effect){var K=this.editor.graph,-M=K.model.getDescendants(K.model.getRoot()),L=K.getNodesForCells(M);Graph.setOpacityForNodes(L,0);window.setTimeout(mxUtils.bind(this,function(){var Q=K.createPopAnimations(M,!0);K.executeAnimations(Q)}),200)}null!=l&&l();b.type="xml";b.compressed=!0;b.data=Graph.compress(null!=b.layout?mxUtils.getXml(this.editor.getGraphXml()):z);delete b.layout;window.location.hash="create="+encodeURIComponent(JSON.stringify(b))});null!=b.layout?this.executeLayoutSpec(b.layout,F):F()}),!0,null,!0)}),g=b.data;b.compressed&&-(g=Graph.decompress(g));if("mermaid"==b.type)if(EditorUi.isMermaidSupported()){var x=mxUtils.bind(this,function(z){this.handleError(z)});b.image?this.parseMermaidImage(g,mxUtils.bind(this,function(z){p(z)}),x):this.parseMermaidDiagram(g,null,mxUtils.bind(this,function(z){p(mxMermaidToDrawio.wrapGroup(z,g,null))}),x)}else throw Error(mxResources.get("serviceUnavailableOrBlocked"));else if("generate"==b.type&&this.spinner.spin(document.body,mxResources.get("generate")+" '"+g+"'"))this.generateOpenAiMermaidDiagram(g,-function(z){p(z)},mxUtils.bind(this,function(z){this.handleError(z,mxResources.get("errorLoadingFile"))}),{complexity:"high"});else if("csv"==b.type){var B=this.createTemporaryGraph(this.editor.graph.getStylesheet());this.importCsv(g,mxUtils.bind(this,function(){var z=new mxCodec;p(mxUtils.getXml(z.encode(B.getModel())))}),B,!0)}else if("xml"==b.type)p(g);else throw Error(mxResources.get("invalidCallFnNotFound",[b.type]));}catch(z){this.handleError(z,mxResources.get("errorLoadingFile"))}};+decodeURIComponent(urlParams.title):this.defaultFilename):this.actions.get("new").funct()):(null!=urlParams.open&&window.history&&window.history.replaceState&&(window.history.replaceState(null,null,window.location.pathname+this.getSearch(["open","sketch"])),window.location.hash=urlParams.open),p())}}catch(y){this.handleError(y)}};+App.prototype.executeCreateObject=function(b,l){try{EditorUi.debug("App.executeCreateObject",[this],"value",[b]);var p=mxUtils.bind(this,function(y){this.spinner.stop();this.createFile(null!=b.filename?b.filename:this.defaultFilename,y,null,null,mxUtils.bind(this,function(){null!=urlParams.pv&&this.setPageVisible("1"==urlParams.pv);null!=urlParams.grid&&this.editor.graph.setGridEnabled("1"==urlParams.grid);var G=mxUtils.bind(this,function(){this.initialFitDiagram(1.2);if("pop"==b.effect){var L=this.editor.graph,+O=L.model.getDescendants(L.model.getRoot()),J=L.getNodesForCells(O);Graph.setOpacityForNodes(J,0);window.setTimeout(mxUtils.bind(this,function(){var Q=L.createPopAnimations(O,!0);L.executeAnimations(Q)}),200)}null!=l&&l();b.type="xml";b.compressed=!0;b.data=Graph.compress(null!=b.layout?mxUtils.getXml(this.editor.getGraphXml()):y);delete b.layout;window.location.hash="create="+encodeURIComponent(JSON.stringify(b))});null!=b.layout?this.executeLayoutSpec(b.layout,G):G()}),!0,null,!0)}),g=b.data;b.compressed&&+(g=Graph.decompress(g));if("mermaid"==b.type)if(EditorUi.isMermaidSupported()){var x=mxUtils.bind(this,function(y){this.handleError(y)});b.image?this.parseMermaidImage(g,mxUtils.bind(this,function(y){p(y)}),x):this.parseMermaidDiagram(g,null,mxUtils.bind(this,function(y){p(mxMermaidToDrawio.wrapGroup(y,g,null))}),x)}else throw Error(mxResources.get("serviceUnavailableOrBlocked"));else if("generate"==b.type&&this.spinner.spin(document.body,mxResources.get("generate")+" '"+g+"'"))this.generateOpenAiMermaidDiagram(g,+function(y){p(y)},mxUtils.bind(this,function(y){this.handleError(y,mxResources.get("errorLoadingFile"))}),{complexity:"high"});else if("csv"==b.type){var A=this.createTemporaryGraph(this.editor.graph.getStylesheet());this.importCsv(g,mxUtils.bind(this,function(){var y=new mxCodec;p(mxUtils.getXml(y.encode(A.getModel())))}),A,!0)}else if("xml"==b.type)p(g);else throw Error(mxResources.get("invalidCallFnNotFound",[b.type]));}catch(y){this.handleError(y,mxResources.get("errorLoadingFile"))}};App.prototype.openGenerateDialog=function(b){if(null==this.chatWindow){var l=mxSettings.getWindowState("chat");this.chatWindow=new ChatWindow(this,null!=l&&null!=l.x?l.x:224,null!=l&&null!=l.y?l.y:104,null!=l&&null!=l.w?l.w:440,null!=l&&null!=l.h?l.h:440);this.chatWindow.window.addListener("show",mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("chat"))}));this.chatWindow.window.addListener("hide",function(){this.fireEvent(new mxEventObject("chat"))});this.installWindowPersistence("chat",this.chatWindow);null!=l&&null==b?this.restoreWindowState("chat",this.chatWindow):this.chatWindow.window.setVisible(!0);this.fireEvent(new mxEventObject("chat"))}else this.chatWindow.window.setVisible(!0);null!=b&&this.chatWindow.generate(b)};App.prototype.openTemplateDialog=function(b){var l=this.editor.graph;l.isEnabled()&&!l.isCellLocked(l.getDefaultParent())&&(b=new NewDialog(this,null,!1,mxUtils.bind(this,function(p){this.hideDialog();if(null!=p){var g=this.editor.graph.getFreeInsertPoint(!0);l.setSelectionCells(this.importXml(p,Math.max(g.x,20),Math.max(g.y,20),!0,null,null,!0));l.scrollCellToVisible(l.getSelectionCell())}}),null,null,null,null,null,null,null,null,null,null,!1,mxResources.get("insert"),null,null,b),this.showDialog(b.container,620,460,!0,!0,mxUtils.bind(this,function(){this.sidebar.hideTooltip()})),b.init())};App.prototype.loadDraft=function(b,l){this.createFile(this.defaultFilename,b,null,null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){var p=this.getCurrentFile();null!=p&&(p.fileChanged(),null!=l&&l())}),0)}),null,null,!0)};-App.prototype.filterDrafts=function(b,l,p){function g(){p(x)}var x=[];try{this.getDatabaseItems(mxUtils.bind(this,function(B){EditorUi.debug("App.filterDrafts",[this],"items",B);for(var z=0;z<B.length;z++)try{var F=B[z].key;if(null!=F&&".draft_"==F.substring(0,7)){var K=JSON.parse(B[z].data);null!=K&&"draft"==K.type&&K.aliveCheck!=l&&(null==b&&null==K.fileObject||null!=K.fileObject&&K.fileObject.path==b)&&(this.isDiagramDataEmpty(K.data)?this.removeDatabaseItem(F):(K.key=F,x.push(K)))}}catch(M){}g()}),-g)}catch(B){g()}};+App.prototype.filterDrafts=function(b,l,p){function g(){p(x)}var x=[];try{this.getDatabaseItems(mxUtils.bind(this,function(A){EditorUi.debug("App.filterDrafts",[this],"items",A);for(var y=0;y<A.length;y++)try{var G=A[y].key;if(null!=G&&".draft_"==G.substring(0,7)){var L=JSON.parse(A[y].data);null!=L&&"draft"==L.type&&L.aliveCheck!=l&&(null==b&&null==L.fileObject||null!=L.fileObject&&L.fileObject.path==b)&&(this.isDiagramDataEmpty(L.data)?this.removeDatabaseItem(G):(L.key=G,x.push(L)))}}catch(O){}g()}),+g)}catch(A){g()}};App.prototype.checkDrafts=function(){try{var b=Editor.guid();localStorage.setItem(".draft-alive-check",b);window.setTimeout(mxUtils.bind(this,function(){localStorage.removeItem(".draft-alive-check");this.filterDrafts(null,b,mxUtils.bind(this,function(l){if(1==l.length)this.loadDraft(l[0].data,mxUtils.bind(this,function(){this.removeDatabaseItem(l[0].key)}));else if(1<l.length){var p=new Date(l[0].modified);p=new DraftDialog(this,1<l.length?mxResources.get("selectDraft"):mxResources.get("draftFound",[p.toLocaleDateString()+" "+p.toLocaleTimeString()]),1<l.length?null:l[0].data,mxUtils.bind(this,function(g){this.hideDialog();g=""!=g&&null!=l[g]?g:0;this.loadDraft(l[g].data,mxUtils.bind(this,function(){this.removeDatabaseItem(l[g].key)}))}),mxUtils.bind(this,function(g,x){this.removeDatabaseItem(l[""!=g?g:0].key);null!=x&&x()}),null,null,null,1<l.length?l:null);this.showDialog(p.container,640,480,!0,!1,mxUtils.bind(this,function(g){if(g)if("0"!=urlParams.splash)this.loadFile();else try{this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}catch(x){this.handleError(x)}}));p.init()}else if("0"!=urlParams.splash)this.loadFile();else try{this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}catch(g){}}))}),0)}catch(l){}};-App.prototype.showSplash=function(b){if("1"!=urlParams.noFileMenu){var l=this.getServiceCount(!0),p=mxUtils.bind(this,function(){var x=new SplashDialog(this);this.showDialog(x.container,340,mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?200:230,!0,!0,mxUtils.bind(this,function(B,z){!B&&!z||mxClient.IS_CHROMEAPP||(B=Editor.useLocalStorage,this.createFile(this.defaultFilename+(EditorUi.isElectronApp?".drawio":""),null,null,null,null,null,null,"1"!=urlParams.local),Editor.useLocalStorage=B)}),!0)});if(this.editor.isChromelessView())this.handleError({message:mxResources.get("noFileSelected")},+App.prototype.showSplash=function(b){if("1"!=urlParams.noFileMenu){var l=this.getServiceCount(!0),p=mxUtils.bind(this,function(){var x=new SplashDialog(this);this.showDialog(x.container,340,mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?200:230,!0,!0,mxUtils.bind(this,function(A,y){!A&&!y||mxClient.IS_CHROMEAPP||(A=Editor.useLocalStorage,this.createFile(this.defaultFilename+(EditorUi.isElectronApp?".drawio":""),null,null,null,null,null,null,"1"!=urlParams.local),Editor.useLocalStorage=A)}),!0)});if(this.editor.isChromelessView())this.handleError({message:mxResources.get("noFileSelected")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplash()}));else if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=this.mode&&!b)null==urlParams.create&&p();else{b=4==l?2:3;var g=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();p()}),b);this.showDialog(g.container,3>b?200:300,3<l?320:210,!0,!1)}}};App.prototype.addLanguageMenu=function(b,l,p){var g=null;null!=this.menus.get("language")&&(g=document.createElement("div"),this.setElementTitle(g,"language"),g.className="geAdaptiveAsset",g.style.backgroundImage="url("+Editor.globeImage+")",g.style.backgroundPosition="right center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="19px 19px",g.style.width="19px",g.style.height="19px",mxUtils.setOpacity(g,40),g.style.position="absolute",g.style.cursor="pointer",g.style.bottom="20px",g.style.right=-null!=p?p:"22px",l&&(g.style.direction="rtl",g.style.textAlign="right",g.style.right=null!=p?p:"24px",l=document.createElement("span"),l.style.display="inline-block",l.style.fontSize="12px",l.style.margin="2px 24px 0 0",l.style.userSelect="none",mxUtils.write(l,mxResources.get("language")),g.appendChild(l),l.className="geAdaptiveAsset"),mxEvent.addListener(g,"click",mxUtils.bind(this,function(x){this.editor.graph.popupMenuHandler.hideMenu();var B=new mxPopupMenu(this.menus.get("language").funct);-B.smartSeparators=!0;B.showDisabled=!0;B.autoExpand=!0;B.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(B,arguments);B.destroy()});var z=mxUtils.getOffset(g);B.popup(z.x,z.y+g.offsetHeight,null,x);this.setCurrentMenu(B)})),b.appendChild(g));return g};-App.prototype.loadFileSystemEntry=function(b,l,p){p=null!=p?p:mxUtils.bind(this,function(g){this.handleError(g)});try{b.getFile().then(mxUtils.bind(this,function(g){var x=new FileReader;x.onload=mxUtils.bind(this,function(B){var z=mxUtils.bind(this,function(F){try{if(null!=l){var K=B.target.result;"image/png"==g.type&&(K=this.extractGraphModelFromPng(K));l(new LocalFile(this,K,g.name,null,b,g,F))}else this.openFileHandle(B.target.result,g.name,g,!1,b,F)}catch(M){p(M)}});b.queryPermission?b.queryPermission({mode:"readwrite"}).then(mxUtils.bind(this,-function(F){z("denied"!==F)})):b.createWritable().then(mxUtils.bind(this,function(){z(!0)}),mxUtils.bind(this,function(F){z(!1)}))});x.onerror=p;"image"!==g.type.substring(0,5)&&"application/pdf"!==g.type||"image/svg"===g.type.substring(0,9)?x.readAsText(g):x.readAsDataURL(g)}),p)}catch(g){p(g)}};+null!=p?p:"22px",l&&(g.style.direction="rtl",g.style.textAlign="right",g.style.right=null!=p?p:"24px",l=document.createElement("span"),l.style.display="inline-block",l.style.fontSize="12px",l.style.margin="2px 24px 0 0",l.style.userSelect="none",mxUtils.write(l,mxResources.get("language")),g.appendChild(l),l.className="geAdaptiveAsset"),mxEvent.addListener(g,"click",mxUtils.bind(this,function(x){this.editor.graph.popupMenuHandler.hideMenu();var A=new mxPopupMenu(this.menus.get("language").funct);+A.smartSeparators=!0;A.showDisabled=!0;A.autoExpand=!0;A.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(A,arguments);A.destroy()});var y=mxUtils.getOffset(g);A.popup(y.x,y.y+g.offsetHeight,null,x);this.setCurrentMenu(A)})),b.appendChild(g));return g};+App.prototype.loadFileSystemEntry=function(b,l,p){p=null!=p?p:mxUtils.bind(this,function(g){this.handleError(g)});try{b.getFile().then(mxUtils.bind(this,function(g){var x=new FileReader;x.onload=mxUtils.bind(this,function(A){var y=mxUtils.bind(this,function(G){try{if(null!=l){var L=A.target.result;"image/png"==g.type&&(L=this.extractGraphModelFromPng(L));l(new LocalFile(this,L,g.name,null,b,g,G))}else this.openFileHandle(A.target.result,g.name,g,!1,b,G)}catch(O){p(O)}});b.queryPermission?b.queryPermission({mode:"readwrite"}).then(mxUtils.bind(this,+function(G){y("denied"!==G)})):b.createWritable().then(mxUtils.bind(this,function(){y(!0)}),mxUtils.bind(this,function(G){y(!1)}))});x.onerror=p;"image"!==g.type.substring(0,5)&&"application/pdf"!==g.type||"image/svg"===g.type.substring(0,9)?x.readAsText(g):x.readAsDataURL(g)}),p)}catch(g){p(g)}};App.prototype.createFileSystemOptions=function(b){var l=[],p=null;if(null!=b){var g=b.lastIndexOf(".");0<g&&(p=b.substring(g+1))}for(g=0;g<this.editor.diagramFileTypes.length;g++){var x={description:mxResources.get(this.editor.diagramFileTypes[g].description)+(mxClient.IS_MAC?" (."+this.editor.diagramFileTypes[g].extension+")":""),accept:{}};x.accept[this.editor.diagramFileTypes[g].mimeType]=["."+this.editor.diagramFileTypes[g].extension];this.editor.diagramFileTypes[g].extension==p?l.splice(0,0,x):this.editor.diagramFileTypes[g].extension==p?l.splice(0,0,x):l.push(x)}return{types:l,suggestedName:b}};App.prototype.showSaveFilePicker=function(b,l,p){l=null!=l?l:mxUtils.bind(this,function(g){"AbortError"!=g.name&&this.handleError(g)});p=null!=p?p:this.createFileSystemOptions();window.showSaveFilePicker(p).then(mxUtils.bind(this,function(g){null!=g&&g.getFile().then(mxUtils.bind(this,function(x){b(g,x)}),l)}),l)};-App.prototype.pickFile=function(b){try{if(b=null!=b?b:this.mode,b==App.MODE_GOOGLE)null!=this.drive&&"undefined"!=typeof google&&"undefined"!=typeof google.picker?this.drive.pickFile():this.openLink("https://drive.google.com");else{var l=this.getServiceForName(b);if(null!=l)l.pickFile();else if(b==App.MODE_DEVICE&&EditorUi.nativeFileSupport)window.showOpenFilePicker().then(mxUtils.bind(this,function(z){null!=z&&0<z.length&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.loadFileSystemEntry(z[0])}),-mxUtils.bind(this,function(z){"AbortError"!=z.name&&this.handleError(z)}));else if(b==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.openFileInputElt){var p=document.createElement("input");p.setAttribute("type","file");mxEvent.addListener(p,"change",mxUtils.bind(this,function(){null!=p.files&&(this.openFiles(p.files),p.type="",p.type="file",p.value="")}));p.style.display="none";document.body.appendChild(p);this.openFileInputElt=p}this.openFileInputElt.click()}else{this.hideDialog();window.openNew=-null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";window.listBrowserFiles=mxUtils.bind(this,function(z,F){StorageFile.listFiles(this,"F",z,F)});window.openBrowserFile=mxUtils.bind(this,function(z,F,K){StorageFile.getFileContent(this,z,F,K)});window.deleteBrowserFile=mxUtils.bind(this,function(z,F,K){StorageFile.deleteFile(this,z,F,K)});var g=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,-function(z,F,K){var M=mxUtils.bind(this,function(){Editor.useCanvasForExport||".png"!=F.substring(F.length-4)||(F=F.substring(0,F.length-4)+".drawio");this.fileLoaded(b==App.MODE_BROWSER?new StorageFile(this,z,F):new LocalFile(this,z,F,K));var Q=this.getCurrentFile();K&&null!=Q&&Q.fileChanged()}),L=this.getCurrentFile();null!=L&&L.isModified()?this.confirm(mxResources.get("allChangesLost"),null,M,mxResources.get("cancel"),mxResources.get("discardChanges")):M()}));var x=this.dialog,B=x.close;this.dialog.close=-mxUtils.bind(this,function(z){Editor.useLocalStorage=g;B.apply(x,arguments);null==this.getCurrentFile()&&this.showSplash()})}}}catch(z){this.handleError(z)}};-App.prototype.pickLibrary=function(b){b=null!=b?b:this.mode;var l=mxUtils.bind(this,function(B){try{this.loadLibrary(B);this.showSidebar();try{this.sidebar.palettes[B.getHash()][0].scrollIntoView({behavior:"smooth"})}catch(z){}}catch(z){this.handleError(z,mxResources.get("errorLoadingFile"))}});if(b==App.MODE_GOOGLE||b==App.MODE_DROPBOX||b==App.MODE_ONEDRIVE||b==App.MODE_GITHUB||b==App.MODE_GITLAB||b==App.MODE_TRELLO){var p=b==App.MODE_GOOGLE?this.drive:b==App.MODE_ONEDRIVE?this.oneDrive:b==App.MODE_GITHUB?-this.gitHub:b==App.MODE_GITLAB?this.gitLab:b==App.MODE_TRELLO?this.trello:this.dropbox;null!=p&&p.pickLibrary(mxUtils.bind(this,function(B,z){null!=z?l(z):this.spinner.spin(document.body,mxResources.get("loading"))&&p.getLibrary(B,mxUtils.bind(this,function(F){this.spinner.stop();l(F)}),mxUtils.bind(this,function(F){this.handleError(F,null!=F?mxResources.get("errorLoadingFile"):null)}))}))}else if(b==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.libFileInputElt){var g=document.createElement("input");-g.setAttribute("type","file");mxEvent.addListener(g,"change",mxUtils.bind(this,function(){if(null!=g.files){for(var B=0;B<g.files.length;B++)mxUtils.bind(this,function(z){var F=new FileReader;F.onload=mxUtils.bind(this,function(K){l(new LocalLibrary(this,K.target.result,z.name))});F.readAsText(z)})(g.files[B]);g.type="";g.type="file";g.value=""}}));g.style.display="none";document.body.appendChild(g);this.libFileInputElt=g}this.libFileInputElt.click()}else{window.openNew=!1;window.openKey="open";window.listBrowserFiles=-mxUtils.bind(this,function(B,z){StorageFile.listFiles(this,"L",B,z)});window.openBrowserFile=mxUtils.bind(this,function(B,z,F){StorageFile.getFileContent(this,B,z,F)});window.deleteBrowserFile=mxUtils.bind(this,function(B,z,F){StorageFile.deleteFile(this,B,z,F)});var x=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;window.openFile=new OpenFile(mxUtils.bind(this,function(B){this.hideDialog(B)}));window.openFile.setConsumer(mxUtils.bind(this,function(B,z){l(b==App.MODE_BROWSER?new StorageLibrary(this,-B,z):new LocalLibrary(this,B,z))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage=x;window.openFile=null})}};-App.prototype.saveLibrary=function(b,l,p,g,x,B,z){try{g=null!=g?g:this.mode;x=null!=x?x:!1;B=null!=B?B:!1;var F=this.createLibraryDataFromImages(l),K=mxUtils.bind(this,function(Q){this.spinner.stop();null!=z&&z();this.handleError(Q,null!=Q?mxResources.get("errorSavingFile"):null)});null==p&&g==App.MODE_DEVICE&&(p=new LocalLibrary(this,F,b));if(null==p)this.pickFolder(g,mxUtils.bind(this,function(Q){g==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?-this.drive.insertFile(b,F,Q,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),K,this.drive.libraryMimeType):g==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(b,F,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),K,Q):g==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(b,-F,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),K,Q):g==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(b,F,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),K,Q):g==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(b,F,mxUtils.bind(this,function(c){this.spinner.stop();-this.hideDialog(!0);this.libraryLoaded(c,l)}),K,Q):g==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(b,F,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),K,Q):g==App.MODE_BROWSER?StorageFile.doInsertFile(new StorageLibrary(this,F,b),mxUtils.bind(this,function(c){this.hideDialog(!0);this.libraryLoaded(c,l)}),K):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));-else if(x||this.spinner.spin(document.body,mxResources.get("saving"))){p.setData(F);var M=mxUtils.bind(this,function(){p.save(!0,mxUtils.bind(this,function(Q){this.spinner.stop();this.hideDialog(!0);B||this.libraryLoaded(p,l);null!=z&&z()}),K)});if(b!=p.getTitle()){var L=p.getHash();p.rename(b,mxUtils.bind(this,function(Q){p.constructor!=LocalLibrary&&L!=p.getHash()&&(mxSettings.removeCustomLibrary(L),mxSettings.addCustomLibrary(p.getHash()));this.removeLibrarySidebar(L);M()}),K)}else M()}}catch(Q){this.handleError(Q)}};+App.prototype.pickFile=function(b){try{if(b=null!=b?b:this.mode,b==App.MODE_GOOGLE)null!=this.drive&&"undefined"!=typeof google&&"undefined"!=typeof google.picker?this.drive.pickFile():this.openLink("https://drive.google.com");else{var l=this.getServiceForName(b);if(null!=l)l.pickFile();else if(b==App.MODE_DEVICE&&EditorUi.nativeFileSupport)window.showOpenFilePicker().then(mxUtils.bind(this,function(y){null!=y&&0<y.length&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.loadFileSystemEntry(y[0])}),+mxUtils.bind(this,function(y){"AbortError"!=y.name&&this.handleError(y)}));else if(b==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.openFileInputElt){var p=document.createElement("input");p.setAttribute("type","file");mxEvent.addListener(p,"change",mxUtils.bind(this,function(){null!=p.files&&(this.openFiles(p.files),p.type="",p.type="file",p.value="")}));p.style.display="none";document.body.appendChild(p);this.openFileInputElt=p}this.openFileInputElt.click()}else{this.hideDialog();window.openNew=+null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";window.listBrowserFiles=mxUtils.bind(this,function(y,G){StorageFile.listFiles(this,"F",y,G)});window.openBrowserFile=mxUtils.bind(this,function(y,G,L){StorageFile.getFileContent(this,y,G,L)});window.deleteBrowserFile=mxUtils.bind(this,function(y,G,L){StorageFile.deleteFile(this,y,G,L)});var g=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,+function(y,G,L){var O=mxUtils.bind(this,function(){Editor.useCanvasForExport||".png"!=G.substring(G.length-4)||(G=G.substring(0,G.length-4)+".drawio");this.fileLoaded(b==App.MODE_BROWSER?new StorageFile(this,y,G):new LocalFile(this,y,G,L));var Q=this.getCurrentFile();L&&null!=Q&&Q.fileChanged()}),J=this.getCurrentFile();null!=J&&J.isModified()?this.confirm(mxResources.get("allChangesLost"),null,O,mxResources.get("cancel"),mxResources.get("discardChanges")):O()}));var x=this.dialog,A=x.close;this.dialog.close=+mxUtils.bind(this,function(y){Editor.useLocalStorage=g;A.apply(x,arguments);null==this.getCurrentFile()&&this.showSplash()})}}}catch(y){this.handleError(y)}};+App.prototype.pickLibrary=function(b){b=null!=b?b:this.mode;var l=mxUtils.bind(this,function(A){try{this.loadLibrary(A);this.showSidebar();try{this.sidebar.palettes[A.getHash()][0].scrollIntoView({behavior:"smooth"})}catch(y){}}catch(y){this.handleError(y,mxResources.get("errorLoadingFile"))}});if(b==App.MODE_GOOGLE||b==App.MODE_DROPBOX||b==App.MODE_ONEDRIVE||b==App.MODE_GITHUB||b==App.MODE_GITLAB||b==App.MODE_TRELLO){var p=b==App.MODE_GOOGLE?this.drive:b==App.MODE_ONEDRIVE?this.oneDrive:b==App.MODE_GITHUB?+this.gitHub:b==App.MODE_GITLAB?this.gitLab:b==App.MODE_TRELLO?this.trello:this.dropbox;null!=p&&p.pickLibrary(mxUtils.bind(this,function(A,y){null!=y?l(y):this.spinner.spin(document.body,mxResources.get("loading"))&&p.getLibrary(A,mxUtils.bind(this,function(G){this.spinner.stop();l(G)}),mxUtils.bind(this,function(G){this.handleError(G,null!=G?mxResources.get("errorLoadingFile"):null)}))}))}else if(b==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.libFileInputElt){var g=document.createElement("input");+g.setAttribute("type","file");mxEvent.addListener(g,"change",mxUtils.bind(this,function(){if(null!=g.files){for(var A=0;A<g.files.length;A++)mxUtils.bind(this,function(y){var G=new FileReader;G.onload=mxUtils.bind(this,function(L){l(new LocalLibrary(this,L.target.result,y.name))});G.readAsText(y)})(g.files[A]);g.type="";g.type="file";g.value=""}}));g.style.display="none";document.body.appendChild(g);this.libFileInputElt=g}this.libFileInputElt.click()}else{window.openNew=!1;window.openKey="open";window.listBrowserFiles=+mxUtils.bind(this,function(A,y){StorageFile.listFiles(this,"L",A,y)});window.openBrowserFile=mxUtils.bind(this,function(A,y,G){StorageFile.getFileContent(this,A,y,G)});window.deleteBrowserFile=mxUtils.bind(this,function(A,y,G){StorageFile.deleteFile(this,A,y,G)});var x=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;window.openFile=new OpenFile(mxUtils.bind(this,function(A){this.hideDialog(A)}));window.openFile.setConsumer(mxUtils.bind(this,function(A,y){l(b==App.MODE_BROWSER?new StorageLibrary(this,+A,y):new LocalLibrary(this,A,y))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage=x;window.openFile=null})}};+App.prototype.saveLibrary=function(b,l,p,g,x,A,y){try{g=null!=g?g:this.mode;x=null!=x?x:!1;A=null!=A?A:!1;var G=this.createLibraryDataFromImages(l),L=mxUtils.bind(this,function(Q){this.spinner.stop();null!=y&&y();this.handleError(Q,null!=Q?mxResources.get("errorSavingFile"):null)});null==p&&g==App.MODE_DEVICE&&(p=new LocalLibrary(this,G,b));if(null==p)this.pickFolder(g,mxUtils.bind(this,function(Q){g==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?+this.drive.insertFile(b,G,Q,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),L,this.drive.libraryMimeType):g==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(b,G,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),L,Q):g==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(b,+G,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),L,Q):g==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(b,G,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),L,Q):g==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(b,G,mxUtils.bind(this,function(c){this.spinner.stop();+this.hideDialog(!0);this.libraryLoaded(c,l)}),L,Q):g==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(b,G,mxUtils.bind(this,function(c){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(c,l)}),L,Q):g==App.MODE_BROWSER?StorageFile.doInsertFile(new StorageLibrary(this,G,b),mxUtils.bind(this,function(c){this.hideDialog(!0);this.libraryLoaded(c,l)}),L):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));+else if(x||this.spinner.spin(document.body,mxResources.get("saving"))){p.setData(G);var O=mxUtils.bind(this,function(){p.save(!0,mxUtils.bind(this,function(Q){this.spinner.stop();this.hideDialog(!0);A||this.libraryLoaded(p,l);null!=y&&y()}),L)});if(b!=p.getTitle()){var J=p.getHash();p.rename(b,mxUtils.bind(this,function(Q){p.constructor!=LocalLibrary&&J!=p.getHash()&&(mxSettings.removeCustomLibrary(J),mxSettings.addCustomLibrary(p.getHash()));this.removeLibrarySidebar(J);O()}),L)}else O()}}catch(Q){this.handleError(Q)}};App.prototype.saveFile=function(b,l){var p=this.getCurrentFile(),g=this.mode;if(null!=p){var x=mxUtils.bind(this,function(){EditorUi.enableDrafts&&p.removeDraft();this.getCurrentFile()==p||p.isModified()||(p.getMode()!=App.MODE_DEVICE?this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")))})):this.clearStatus());null!=l&&l()});if(b||null==p.getTitle()||null!=p.invalidFileHandle||null==this.mode)if(null!=p&&p.constructor==LocalFile&&-null!=p.fileHandle)this.showSaveFilePicker(mxUtils.bind(this,function(K,M){p.invalidFileHandle=null;p.fileHandle=K;p.title=M.name;p.desc=M;p.editable=null;this.save(M.name,x)}),null,this.createFileSystemOptions(p.getTitle()));else{var B=null!=p.getTitle()?p.getTitle():this.defaultFilename,z=mxUtils.bind(this,function(K,M,L,Q){if(null!=K&&0<K.length)if(/(\.pdf)$/i.test(K))this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),-mxUtils.bind(this,function(){L.value=K.split(".").slice(0,-1).join(".");L.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?L.select():document.execCommand("selectAll",!1,null)}),mxResources.get("yes"),mxResources.get("no"));else if(this.hideDialog(),null==g&&M==App.MODE_DEVICE)null!=p&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,function(f,k){p.fileHandle=f;p.mode=App.MODE_DEVICE;p.title=k.name;p.desc=k;this.setMode(App.MODE_DEVICE);this.save(k.name,x)}),mxUtils.bind(this,-function(f){"AbortError"!=f.name&&this.handleError(f)}),this.createFileSystemOptions(K)):(this.setMode(App.MODE_DEVICE),this.save(K,x));else if("download"==M)(new LocalFile(this,null,K)).save();else if("_blank"==M)window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname),null,!0);else if(b||g!=M){var c=mxUtils.bind(this,function(f){try{var k=this.editor.graph,n=k.getSelectionCells(),q=k.getViewState(),-t=this.currentPage,u=this.getCurrentFile(),y=null==this.mode||null==u||null==u.mode;this.createFile(K,this.getFileData(/(\.xml)$/i.test(K)||0>K.indexOf(".")||/(\.drawio)$/i.test(K),/(\.svg)$/i.test(K),/(\.html)$/i.test(K)),null,M,x,y,f,null,null,mxUtils.bind(this,function(){this.restoreViewState(t,q,n)}))}catch(E){this.handleError(E)}});null!=Q?c(Q):this.pickFolder(M,c)}else null!=M&&this.save(K,x)}),F=!mxClient.IS_IOS||!navigator.standalone;B=new SaveDialog(this,B,mxUtils.bind(this,function(K,M,-L){try{z(K.value,M,K,L),this.hideDialog()}catch(Q){this.handleError(Q)}}),F?null:["_blank"]);this.showDialog(B.container,420,162,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));B.init()}else this.save(p.getTitle(),x)}};-App.prototype.loadTemplate=function(b,l,p,g,x){var B=!1,z=b,F=null!=g?g:b;g=/\.png$/i.test(F)||/\.pdf$/i.test(F);var K=EditorUi.isVisioFilename(F);this.editor.isCorsEnabledForUrl(z)||(B=g||K,z="t="+(new Date).getTime(),z=PROXY_URL+"?url="+encodeURIComponent(b)+"&"+z+(B?"&base64=1":""));this.editor.loadUrl(z,mxUtils.bind(this,function(M){try{var L=B?window.atob?atob(M):Base64.decode(M):M;if(K||this.isVisioData(L))K||(F=x?this.isRemoteVisioData(L)?"raw.vss":"raw.vssx":this.isRemoteVisioData(L)?"raw.vsd":-"raw.vsdx"),this.importVisio(this.base64ToBlob(M.substring(M.indexOf(",")+1)),function(Q){l(Q)},p,F);else if((new XMLHttpRequest).upload&&this.isRemoteFileFormat(L,F))this.isExternalDataComms()?this.parseFileData(L,mxUtils.bind(this,function(Q){4==Q.readyState&&200<=Q.status&&299>=Q.status&&"<mxGraphModel"==Q.responseText.substring(0,13)&&l(Q.responseText)}),b):this.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,p);else if(this.isLucidChartData(L))this.convertLucidChart(L,-mxUtils.bind(this,function(Q){l(Q)}),mxUtils.bind(this,function(Q){p(Q)}));else{if(/(\.png)($|\?)/i.test(F)||Editor.isPngData(L))L=Editor.extractGraphModelFromPng(M);l(L)}}catch(Q){p(Q)}}),p,/(\.png)($|\?)/i.test(F)||K,null,null,B)};App.prototype.getModeForChar=function(b){return"G"==b?App.MODE_GOOGLE:"D"==b?App.MODE_DROPBOX:"W"==b?App.MODE_ONEDRIVE:"M"==b?App.MODE_M365:"H"==b?App.MODE_GITHUB:"A"==b?App.MODE_GITLAB:"T"==b?App.MODE_TRELLO:null};+null!=p.fileHandle)this.showSaveFilePicker(mxUtils.bind(this,function(L,O){p.invalidFileHandle=null;p.fileHandle=L;p.title=O.name;p.desc=O;p.editable=null;this.save(O.name,x)}),null,this.createFileSystemOptions(p.getTitle()));else{var A=null!=p.getTitle()?p.getTitle():this.defaultFilename,y=mxUtils.bind(this,function(L,O,J,Q){if(null!=L&&0<L.length)if(/(\.pdf)$/i.test(L))this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),+mxUtils.bind(this,function(){J.value=L.split(".").slice(0,-1).join(".");J.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?J.select():document.execCommand("selectAll",!1,null)}),mxResources.get("yes"),mxResources.get("no"));else if(this.hideDialog(),null==g&&O==App.MODE_DEVICE)null!=p&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,function(f,k){p.fileHandle=f;p.mode=App.MODE_DEVICE;p.title=k.name;p.desc=k;this.setMode(App.MODE_DEVICE);this.save(k.name,x)}),mxUtils.bind(this,+function(f){"AbortError"!=f.name&&this.handleError(f)}),this.createFileSystemOptions(L)):(this.setMode(App.MODE_DEVICE),this.save(L,x));else if("download"==O)(new LocalFile(this,null,L)).save();else if("_blank"==O)window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname),null,!0);else if(b||g!=O){var c=mxUtils.bind(this,function(f){try{var k=this.editor.graph,n=k.getSelectionCells(),q=k.getViewState(),+t=this.currentPage,u=this.getCurrentFile(),B=null==this.mode||null==u||null==u.mode;this.createFile(L,this.getFileData(/(\.xml)$/i.test(L)||0>L.indexOf(".")||/(\.drawio)$/i.test(L),/(\.svg)$/i.test(L),/(\.html)$/i.test(L)),null,O,x,B,f,null,null,mxUtils.bind(this,function(){this.restoreViewState(t,q,n)}))}catch(E){this.handleError(E)}});null!=Q?c(Q):this.pickFolder(O,c)}else null!=O&&this.save(L,x)}),G=!mxClient.IS_IOS||!navigator.standalone;A=new SaveDialog(this,A,mxUtils.bind(this,function(L,O,+J){try{y(L.value,O,L,J),this.hideDialog()}catch(Q){this.handleError(Q)}}),G?null:["_blank"]);this.showDialog(A.container,420,162,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));A.init()}else this.save(p.getTitle(),x)}};+App.prototype.loadTemplate=function(b,l,p,g,x){var A=!1,y=b,G=null!=g?g:b;g=/\.png$/i.test(G)||/\.pdf$/i.test(G);var L=EditorUi.isVisioFilename(G);this.editor.isCorsEnabledForUrl(y)||(A=g||L,y="t="+(new Date).getTime(),y=PROXY_URL+"?url="+encodeURIComponent(b)+"&"+y+(A?"&base64=1":""));this.editor.loadUrl(y,mxUtils.bind(this,function(O){try{var J=A?window.atob?atob(O):Base64.decode(O):O;if(L||this.isVisioData(J))L||(G=x?this.isRemoteVisioData(J)?"raw.vss":"raw.vssx":this.isRemoteVisioData(J)?"raw.vsd":+"raw.vsdx"),this.importVisio(this.base64ToBlob(O.substring(O.indexOf(",")+1)),function(Q){l(Q)},p,G);else if((new XMLHttpRequest).upload&&this.isRemoteFileFormat(J,G))this.isExternalDataComms()?this.parseFileData(J,mxUtils.bind(this,function(Q){4==Q.readyState&&200<=Q.status&&299>=Q.status&&"<mxGraphModel"==Q.responseText.substring(0,13)&&l(Q.responseText)}),b):this.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,p);else if(this.isLucidChartData(J))this.convertLucidChart(J,+mxUtils.bind(this,function(Q){l(Q)}),mxUtils.bind(this,function(Q){p(Q)}));else{if(/(\.png)($|\?)/i.test(G)||Editor.isPngData(J))J=Editor.extractGraphModelFromPng(O);l(J)}}catch(Q){p(Q)}}),p,/(\.png)($|\?)/i.test(G)||L,null,null,A)};App.prototype.getModeForChar=function(b){return"G"==b?App.MODE_GOOGLE:"D"==b?App.MODE_DROPBOX:"W"==b?App.MODE_ONEDRIVE:"M"==b?App.MODE_M365:"H"==b?App.MODE_GITHUB:"A"==b?App.MODE_GITLAB:"T"==b?App.MODE_TRELLO:null};App.prototype.isModeEnabled=function(b){return b==App.MODE_GOOGLE?"function"===typeof window.DriveClient&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode):b==App.MODE_GITHUB?null!=this.gitHub:b==App.MODE_GITLAB?null!=this.gitLab:b==App.MODE_DROPBOX?"function"===typeof window.DropboxClient&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode):b==App.MODE_ONEDRIVE?"function"===typeof window.OneDriveClient&&("www.draw.io"==window.location.hostname||"test.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname||"app.diagrams.net"==window.location.hostname)&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&!mxClient.IS_IOS&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode):b==App.MODE_TRELLO?"function"===typeof window.TrelloClient&&"1"==urlParams.tr&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode):b==App.MODE_M365?null!=this.m365:!1};App.prototype.isModeReady=function(b){return null!=this.getServiceForName(b)&&(b!=App.MODE_DROPBOX||"undefined"!==typeof Dropbox.choose)};-App.prototype.uncompressPages=function(b){if(null!=b)try{var l=mxUtils.parseXml(b);if("mxfile"==l.documentElement.nodeName){for(var p=l.documentElement.getElementsByTagName("diagram"),g=0;g<p.length;g++){var x=Editor.parseDiagramNode(p[g],!0);null!=x&&(mxUtils.setTextContent(p[g],""),p[g].appendChild(x))}b=mxUtils.getPrettyXml(l.documentElement)}}catch(B){}return b};-App.prototype.createFile=function(b,l,p,g,x,B,z,F,K,M){EditorUi.debug("App.createFile",[this],"title",[b],"data",[l],"libs",[p],"mode",[g]);g=F?null:null!=g?g:this.mode;if(null!=b&&this.spinner.spin(document.body,mxResources.get("inserting"))){l=null!=l?l:this.emptyDiagramXml;null==l||Editor.defaultCompressed||(l=this.uncompressPages(l));var L=mxUtils.bind(this,function(){this.spinner.stop()}),Q=mxUtils.bind(this,function(f){L();null==f&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():-null!=f&&this.handleError(f)});try{var c=mxUtils.bind(this,function(f){L();this.fileCreated(f,p,B,x,K,M)});g==App.MODE_GOOGLE&&null!=this.drive?(null==z&&null!=this.stateArg&&null!=this.stateArg.folderId&&(z=this.stateArg.folderId),this.drive.insertFile(b,l,z,c,Q)):g==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(b,l,c,Q,!1,z):g==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(b,l,c,Q,!1,z):g==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(b,l,c,Q,!1,z):g==App.MODE_DROPBOX&&-null!=this.dropbox?this.dropbox.insertFile(b,l,c,Q):g==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(b,l,c,Q,!1,z):g==App.MODE_M365&&null!=this.m365?this.m365.insertFile(b,l,c,Q,!1,z):g==App.MODE_BROWSER?StorageFile.insertFile(this,b,l,c,Q):!F&&g==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(L(),this.showSaveFilePicker(mxUtils.bind(this,function(f,k){var n=new LocalFile(this,l,k.name,null,f,k);n.saveFile(k.name,!1,mxUtils.bind(this,function(){this.fileCreated(n,p,B,x,K,M)}),Q,!0)}),-mxUtils.bind(this,function(f){"AbortError"!=f.name&&Q(f)}),this.createFileSystemOptions(b))):(L(),this.fileCreated(new LocalFile(this,l,b,null==g),p,B,x,K,M))}catch(f){L(),this.handleError(f)}}};-App.prototype.fileCreated=function(b,l,p,g,x,B){EditorUi.debug("App.fileCreated",[this],"file",[b],"libs",[l],"replace",[p]);var z=window.location.pathname;null!=l&&0<l.length&&(z+="?libs="+l);null!=x&&0<x.length&&(z+="?clibs="+x);z=this.getUrl(z);b.getMode()!=App.MODE_DEVICE&&(z+="#"+b.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var F=b.getData();F=0<F.length?this.editor.extractGraphModel(mxUtils.parseXml(F).documentElement,!0):null;var K=window.location.protocol+-"//"+window.location.hostname+z,M=F,L=null;null!=F&&/\.svg$/i.test(b.getTitle())&&(L=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(L.container),M=this.decodeNodeIntoGraph(M,L));b.setData(this.createFileData(F,L,b,K));null!=L&&L.container.parentNode.removeChild(L.container);var Q=mxUtils.bind(this,function(){this.spinner.stop()}),c=mxUtils.bind(this,function(){Q();var f=this.getCurrentFile();null==p&&null!=f&&(p=!f.isModified()&&(null==f.getMode()||EditorUi.isElectronApp));-var k=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(b,null,B);p&&this.updateStatus(mxUtils.bind(this,function(){b.addAllSavedStatus()}));null!=l&&this.sidebar.showEntries(l);if(null!=x){for(var q=[],t=x.split(";"),u=0;u<t.length;u++)q.push(decodeURIComponent(t[u]));this.loadLibraries(q)}null!=g&&g()}),n=mxUtils.bind(this,function(){p||null==f||!f.isModified()?k():this.confirm(mxResources.get("allChangesLost"),null,k,mxResources.get("cancel"),mxResources.get("discardChanges"))});-null==p||p?n():(b.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(b.getData(),b.getTitle(),null==b.getMode())),window.geOpenWindow(z,null,n))});b.constructor==LocalFile?c():b.saveFile(b.getTitle(),!1,mxUtils.bind(this,function(){c()}),mxUtils.bind(this,function(f){Q();null!=f&&"AbortError"==f.name||this.handleError(f)}))}};-App.prototype.loadFile=function(b,l,p,g,x){if("1"==urlParams.openInSameWin||navigator.standalone)l=!0;this.hideDialog();var B=mxUtils.bind(this,function(){if(null==b||0==b.length)this.clearStatus(),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==b.charAt(0))if(this.spinner.stop(),isLocalStorage){var K=mxUtils.bind(this,function(q){this.handleError(q,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var t=this.getCurrentFile();window.location.hash=-null!=t?t.getHash():""}))});b=decodeURIComponent(b.substring(1));StorageFile.getFileContent(this,b,mxUtils.bind(this,function(q){null!=q?(this.fileLoaded(new StorageFile(this,q,b)),null!=g&&g()):K({message:mxResources.get("fileNotFound")})}),K)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var q=this.getCurrentFile();window.location.hash=null!=q?q.getHash():""}));else if(null!=p)this.spinner.stop(),this.fileLoaded(p),-null!=g&&g();else if("S"==b.charAt(0))this.spinner.stop(),this.alert("[Deprecation] #S is no longer supported, go to https://app.diagrams.net/?desc="+b.substring(1).substring(0,10),mxUtils.bind(this,function(){window.location.href="https://app.diagrams.net/?desc="+b.substring(1)}));else if("create="==b.substring(0,7))try{var M=JSON.parse(decodeURIComponent(b.substring(7)));if("message"==M.type){var L=window.opener||window.parent,Q=mxUtils.bind(this,function(q){EditorUi.debug("EditorUi.createMessageHandler",-[this],"evt",[q]);if(q.source==L)try{"create"==q.data.action&&null!=q.data.data&&(mxEvent.removeListener(window,"message",Q),this.executeCreateObject(q.data.data))}catch(t){c=null}});mxEvent.addListener(window,"message",Q);L.postMessage(JSON.stringify({event:"ready"}),"*")}else this.executeCreateObject(M)}catch(q){this.handleError(q,mxResources.get("errorLoadingFile"))}else if("R"==b.charAt(0)){this.spinner.stop();var c=decodeURIComponent(b.substring(1));"<"!=c.charAt(0)&&(c=Graph.decompress(c));-M=new LocalFile(this,c,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);M.getHash=function(){return b};this.fileLoaded(M);null!=g&&g()}else if("E"==b.charAt(0))null==this.getCurrentFile()?this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile")):this.remoteInvoke("getDraftFileContent",null,null,mxUtils.bind(this,function(q,t){this.spinner.stop();this.fileLoaded(new EmbedFile(this,q,t));null!=g&&g()}),mxUtils.bind(this,+App.prototype.uncompressPages=function(b){if(null!=b)try{var l=mxUtils.parseXml(b);if("mxfile"==l.documentElement.nodeName){for(var p=l.documentElement.getElementsByTagName("diagram"),g=0;g<p.length;g++){var x=Editor.parseDiagramNode(p[g],!0);null!=x&&(mxUtils.setTextContent(p[g],""),p[g].appendChild(x))}b=mxUtils.getPrettyXml(l.documentElement)}}catch(A){}return b};+App.prototype.createFile=function(b,l,p,g,x,A,y,G,L,O){EditorUi.debug("App.createFile",[this],"title",[b],"data",[l],"libs",[p],"mode",[g]);g=G?null:null!=g?g:this.mode;if(null!=b&&this.spinner.spin(document.body,mxResources.get("inserting"))){l=null!=l?l:this.emptyDiagramXml;null==l||Editor.defaultCompressed||(l=this.uncompressPages(l));var J=mxUtils.bind(this,function(){this.spinner.stop()}),Q=mxUtils.bind(this,function(f){J();null==f&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():+null!=f&&this.handleError(f)});try{var c=mxUtils.bind(this,function(f){J();this.fileCreated(f,p,A,x,L,O)});g==App.MODE_GOOGLE&&null!=this.drive?(null==y&&null!=this.stateArg&&null!=this.stateArg.folderId&&(y=this.stateArg.folderId),this.drive.insertFile(b,l,y,c,Q)):g==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(b,l,c,Q,!1,y):g==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(b,l,c,Q,!1,y):g==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(b,l,c,Q,!1,y):g==App.MODE_DROPBOX&&+null!=this.dropbox?this.dropbox.insertFile(b,l,c,Q):g==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(b,l,c,Q,!1,y):g==App.MODE_M365&&null!=this.m365?this.m365.insertFile(b,l,c,Q,!1,y):g==App.MODE_BROWSER?StorageFile.insertFile(this,b,l,c,Q):!G&&g==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(J(),this.showSaveFilePicker(mxUtils.bind(this,function(f,k){var n=new LocalFile(this,l,k.name,null,f,k);n.saveFile(k.name,!1,mxUtils.bind(this,function(){this.fileCreated(n,p,A,x,L,O)}),Q,!0)}),+mxUtils.bind(this,function(f){"AbortError"!=f.name&&Q(f)}),this.createFileSystemOptions(b))):(J(),this.fileCreated(new LocalFile(this,l,b,null==g),p,A,x,L,O))}catch(f){J(),this.handleError(f)}}};+App.prototype.fileCreated=function(b,l,p,g,x,A){EditorUi.debug("App.fileCreated",[this],"file",[b],"libs",[l],"replace",[p]);var y=window.location.pathname;null!=l&&0<l.length&&(y+="?libs="+l);null!=x&&0<x.length&&(y+="?clibs="+x);y=this.getUrl(y);b.getMode()!=App.MODE_DEVICE&&(y+="#"+b.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var G=b.getData();G=0<G.length?this.editor.extractGraphModel(mxUtils.parseXml(G).documentElement,!0):null;var L=window.location.protocol++"//"+window.location.hostname+y,O=G,J=null;null!=G&&/\.svg$/i.test(b.getTitle())&&(J=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(J.container),O=this.decodeNodeIntoGraph(O,J));b.setData(this.createFileData(G,J,b,L));null!=J&&J.container.parentNode.removeChild(J.container);var Q=mxUtils.bind(this,function(){this.spinner.stop()}),c=mxUtils.bind(this,function(){Q();var f=this.getCurrentFile();null==p&&null!=f&&(p=!f.isModified()&&(null==f.getMode()||EditorUi.isElectronApp));+var k=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(b,null,A);p&&this.updateStatus(mxUtils.bind(this,function(){b.addAllSavedStatus()}));null!=l&&this.sidebar.showEntries(l);if(null!=x){for(var q=[],t=x.split(";"),u=0;u<t.length;u++)q.push(decodeURIComponent(t[u]));this.loadLibraries(q)}null!=g&&g()}),n=mxUtils.bind(this,function(){p||null==f||!f.isModified()?k():this.confirm(mxResources.get("allChangesLost"),null,k,mxResources.get("cancel"),mxResources.get("discardChanges"))});+null==p||p?n():(b.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(b.getData(),b.getTitle(),null==b.getMode())),window.geOpenWindow(y,null,n))});b.constructor==LocalFile?c():b.saveFile(b.getTitle(),!1,mxUtils.bind(this,function(){c()}),mxUtils.bind(this,function(f){Q();null!=f&&"AbortError"==f.name||this.handleError(f)}))}};+App.prototype.loadFile=function(b,l,p,g,x){if("1"==urlParams.openInSameWin||navigator.standalone)l=!0;this.hideDialog();var A=mxUtils.bind(this,function(){if(null==b||0==b.length)this.clearStatus(),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==b.charAt(0))if(this.spinner.stop(),isLocalStorage){var L=mxUtils.bind(this,function(q){this.handleError(q,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var t=this.getCurrentFile();window.location.hash=+null!=t?t.getHash():""}))});b=decodeURIComponent(b.substring(1));StorageFile.getFileContent(this,b,mxUtils.bind(this,function(q){null!=q?(this.fileLoaded(new StorageFile(this,q,b)),null!=g&&g()):L({message:mxResources.get("fileNotFound")})}),L)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var q=this.getCurrentFile();window.location.hash=null!=q?q.getHash():""}));else if(null!=p)this.spinner.stop(),this.fileLoaded(p),+null!=g&&g();else if("S"==b.charAt(0))this.spinner.stop(),this.alert("[Deprecation] #S is no longer supported, go to https://app.diagrams.net/?desc="+b.substring(1).substring(0,10),mxUtils.bind(this,function(){window.location.href="https://app.diagrams.net/?desc="+b.substring(1)}));else if("create="==b.substring(0,7))try{var O=JSON.parse(decodeURIComponent(b.substring(7)));if("message"==O.type){var J=window.opener||window.parent,Q=mxUtils.bind(this,function(q){EditorUi.debug("EditorUi.createMessageHandler",+[this],"evt",[q]);if(q.source==J)try{"create"==q.data.action&&null!=q.data.data&&(mxEvent.removeListener(window,"message",Q),this.executeCreateObject(q.data.data))}catch(t){c=null}});mxEvent.addListener(window,"message",Q);J.postMessage(JSON.stringify({event:"ready"}),"*")}else this.executeCreateObject(O)}catch(q){this.handleError(q,mxResources.get("errorLoadingFile"))}else if("R"==b.charAt(0)){this.spinner.stop();var c=decodeURIComponent(b.substring(1));"<"!=c.charAt(0)&&(c=Graph.decompress(c));+O=new LocalFile(this,c,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);O.getHash=function(){return b};this.fileLoaded(O);null!=g&&g()}else if("E"==b.charAt(0))null==this.getCurrentFile()?this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile")):this.remoteInvoke("getDraftFileContent",null,null,mxUtils.bind(this,function(q,t){this.spinner.stop();this.fileLoaded(new EmbedFile(this,q,t));null!=g&&g()}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"))}));else if("U"==b.charAt(0)){var f=decodeURIComponent(b.substring(1)),k=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=f.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var q=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var t=f.substring(31,f.lastIndexOf("&ex"));this.loadFile("G"+t,l,null,mxUtils.bind(this,function(){var u=this.getCurrentFile();null!=u&&this.editor.chromeless&&!this.editor.editable&&(u.getHash=function(){return"G"+t},window.location.hash="#"+u.getHash());null!=g&&g()}));return!0}return!1});!q()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",q);return!0});this.loadTemplate(f,mxUtils.bind(this,function(q){this.spinner.stop();if(null!=q&&0<q.length){var t=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var u=-f,y=f.lastIndexOf("."),E=u.lastIndexOf("/");y>E&&0<E&&(u=u.substring(E+1,y),y=f.substring(y),Editor.useCanvasForExport||".png"!=y||(y=".drawio"),".svg"===y||".xml"===y||".html"===y||".png"===y||".drawio"===y)&&(t=u+y)}q=new LocalFile(this,q,null!=urlParams.title?decodeURIComponent(urlParams.title):t,!0);q.getHash=function(){return b};this.fileLoaded(q,!0)?null!=g&&g():k()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else k()||this.handleError({message:mxResources.get("fileNotFound")},+f,B=f.lastIndexOf("."),E=u.lastIndexOf("/");B>E&&0<E&&(u=u.substring(E+1,B),B=f.substring(B),Editor.useCanvasForExport||".png"!=B||(B=".drawio"),".svg"===B||".xml"===B||".html"===B||".png"===B||".drawio"===B)&&(t=u+B)}q=new LocalFile(this,q,null!=urlParams.title?decodeURIComponent(urlParams.title):t,!0);q.getHash=function(){return b};this.fileLoaded(q,!0)?null!=g&&g():k()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else k()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}),mxUtils.bind(this,function(){k()||(this.spinner.stop(),this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile")))}),null!=urlParams["template-filename"]?decodeURIComponent(urlParams["template-filename"]):null)}else{var n=this.getModeForChar(b.charAt(0));mxUtils.bind(this,function(){var q=this.getServiceForName(n);if(null==q)this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),-mxUtils.bind(this,function(){var u=this.getCurrentFile();window.location.hash=null!=u?u.getHash():""}));else{var t=b.charAt(0);b=decodeURIComponent(b.substring(1));q.getFile(b,mxUtils.bind(this,function(u){this.spinner.stop();this.fileLoaded(u);var y=this.getCurrentFile();if(null==y)window.location.hash="",this.showSplash();else if(this.editor.chromeless&&!this.editor.editable){y.getHash=function(){return t+b};u="#"+y.getHash();try{var E=this.getHashObject();null==E||mxUtils.isEmptyObject(E)||(u=-u+"#"+encodeURIComponent(JSON.stringify(E)))}catch(I){}window.location.replace(u)}else u==y&&null==u.getMode()&&this.updateStatus(mxUtils.bind(this,function(){var I=mxResources.get("copyCreated");this.editor.setStatus('<div title="'+I+'" class="geStatusAlert">'+I+"</div>")}));null!=g&&g()}),mxUtils.bind(this,function(u){null!=window.console&&null!=u&&console.log("error in loadFile:",b,u);var y=mxUtils.bind(this,function(){var E=this.getCurrentFile();null==E?(window.location.hash="",this.showSplash()):-window.location.hash="#"+E.getHash()});null==u||"AbortError"!=u.name?this.handleError(u,null!=u?mxResources.get("errorLoadingFile"):null,y,null,null,"#"+t+b):y()}))}})()}}),z=this.getCurrentFile(),F=mxUtils.bind(this,function(){x||null==z||!z.isModified()?B():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=z&&(window.location.hash=z.getHash())}),B,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==b||0==b.length||null==l&&null!=z&&!z.isModified()&&-this.isBlankFile()?F():null==z||l?F():this.showDialog((new PopupDialog(this,this.getUrl()+"#"+b,null,F)).container,340,140,!0,!0)};+mxUtils.bind(this,function(){var u=this.getCurrentFile();window.location.hash=null!=u?u.getHash():""}));else{var t=b.charAt(0);b=decodeURIComponent(b.substring(1));q.getFile(b,mxUtils.bind(this,function(u){this.spinner.stop();this.fileLoaded(u);var B=this.getCurrentFile();if(null==B)window.location.hash="",this.showSplash();else if(this.editor.chromeless&&!this.editor.editable){B.getHash=function(){return t+b};u="#"+B.getHash();try{var E=this.getHashObject();null==E||mxUtils.isEmptyObject(E)||(u=+u+"#"+encodeURIComponent(JSON.stringify(E)))}catch(I){}window.location.replace(u)}else u==B&&null==u.getMode()&&this.updateStatus(mxUtils.bind(this,function(){var I=mxResources.get("copyCreated");this.editor.setStatus('<div title="'+I+'" class="geStatusAlert">'+I+"</div>")}));null!=g&&g()}),mxUtils.bind(this,function(u){null!=window.console&&null!=u&&console.log("error in loadFile:",b,u);var B=mxUtils.bind(this,function(){var E=this.getCurrentFile();null==E?(window.location.hash="",this.showSplash()):+window.location.hash="#"+E.getHash()});null==u||"AbortError"!=u.name?this.handleError(u,null!=u?mxResources.get("errorLoadingFile"):null,B,null,null,"#"+t+b):B()}))}})()}}),y=this.getCurrentFile(),G=mxUtils.bind(this,function(){x||null==y||!y.isModified()?A():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=y&&(window.location.hash=y.getHash())}),A,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==b||0==b.length||null==l&&null!=y&&!y.isModified()&&+this.isBlankFile()?G():null==y||l?G():this.showDialog((new PopupDialog(this,this.getUrl()+"#"+b,null,G)).container,340,140,!0,!0)};App.prototype.getLibraryStorageHint=function(b){var l=b.getTitle();b.constructor!=LocalLibrary&&(l+="\n"+b.getHash());b.constructor==DriveLibrary?l+=" ("+mxResources.get("googleDrive")+")":b.constructor==GitHubLibrary?l+=" ("+mxResources.get("github")+")":b.constructor==TrelloLibrary?l+=" ("+mxResources.get("trello")+")":b.constructor==DropboxLibrary?l+=" ("+mxResources.get("dropbox")+")":b.constructor==OneDriveLibrary?l+=" ("+mxResources.get("oneDrive")+")":b.constructor==StorageLibrary?l+=" ("+mxResources.get("browser")+")":b.constructor==LocalLibrary&&(l+=" ("+mxResources.get("device")+")");return l};App.prototype.restoreLibraries=function(){function b(p){for(var g=0;g<p.length;g++)""!=p[g]&&0>mxUtils.indexOf(l,p[g])&&l.push(p[g])}var l=[];b(mxSettings.getCustomLibraries());b((urlParams.clibs||"").split(";"));this.loadLibraries(l)};-App.prototype.loadLibraries=function(b,l){if(null!=this.sidebar){null==this.loadedLibraries&&(this.loadedLibraries={});var p=mxUtils.bind(this,function(M,L){L||mxSettings.removeCustomLibrary(M);delete this.loadedLibraries[M]}),g=0,x=[],B=0<b.length&&"L.scratchpad"==b[0]?1:0,z=mxUtils.bind(this,function(){if(0==g){if(null!=b)for(var M=b.length-1;0<=M;M--)if(null!=x[M])try{this.loadLibrary(x[M],M<=B)}catch(L){}null!=l&&l()}});if(null!=b)for(var F=0;F<b.length;F++){var K=encodeURIComponent(decodeURIComponent(b[F]));-mxUtils.bind(this,function(M,L){if(null!=M&&0<M.length&&null==this.loadedLibraries[M]&&null==this.sidebar.palettes[M]){this.loadedLibraries[M]=!0;g++;var Q=mxUtils.bind(this,function(t){x[L]=t;g--;z()}),c=mxUtils.bind(this,function(t){p(M,t);g--;z()}),f=M.substring(0,1);if("L"==f)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var t=decodeURIComponent(M.substring(1));StorageFile.getFileContent(this,t,mxUtils.bind(this,function(u){".scratchpad"!=t||null!=-u&&"<mxfile"!=u.substring(0,7)||(u=this.emptyLibraryXml);null!=u?Q(new StorageLibrary(this,u,t)):c()}),c)}catch(u){c()}}),0);else if("U"==f){var k=decodeURIComponent(M.substring(1));this.isOffline()?c(!0):this.loadTemplate(k,mxUtils.bind(this,function(t){null!=t&&0<t.length?Q(new UrlLibrary(this,t,k)):c()}),function(){c()},null,!0)}else if("R"==f){f=decodeURIComponent(M.substring(1));try{f=JSON.parse(f);var n={id:f[0],title:f[1],downloadUrl:f[2]};this.remoteInvoke("getFileContent",[n.downloadUrl],-null,mxUtils.bind(this,function(t){try{Q(new RemoteLibrary(this,t,n))}catch(u){c()}}),function(){c()})}catch(t){c()}}else if("S"==f&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(M.substring(1)),function(t){Q(t)},c)}catch(t){c()}else{var q=null;"G"==f?null!=this.drive&&null!=this.drive.user&&(q=this.drive):"H"==f?null!=this.gitHub&&null!=this.gitHub.getUser()&&(q=this.gitHub):"T"==f?null!=this.trello&&this.trello.isAuthorized()&&(q=this.trello):"D"==f?null!=this.dropbox&&null!=-this.dropbox.getUser()&&(q=this.dropbox):"W"==f&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(q=this.oneDrive);null!=q?q.getLibrary(decodeURIComponent(M.substring(1)),mxUtils.bind(this,function(t){try{Q(t)}catch(u){c()}}),function(t){c()}):c(!0)}}})(K,F)}z()}};+App.prototype.loadLibraries=function(b,l){if(null!=this.sidebar){null==this.loadedLibraries&&(this.loadedLibraries={});var p=mxUtils.bind(this,function(O,J){J||mxSettings.removeCustomLibrary(O);delete this.loadedLibraries[O]}),g=0,x=[],A=0<b.length&&"L.scratchpad"==b[0]?1:0,y=mxUtils.bind(this,function(){if(0==g){if(null!=b)for(var O=b.length-1;0<=O;O--)if(null!=x[O])try{this.loadLibrary(x[O],O<=A)}catch(J){}null!=l&&l()}});if(null!=b)for(var G=0;G<b.length;G++){var L=encodeURIComponent(decodeURIComponent(b[G]));+mxUtils.bind(this,function(O,J){if(null!=O&&0<O.length&&null==this.loadedLibraries[O]&&null==this.sidebar.palettes[O]){this.loadedLibraries[O]=!0;g++;var Q=mxUtils.bind(this,function(t){x[J]=t;g--;y()}),c=mxUtils.bind(this,function(t){p(O,t);g--;y()}),f=O.substring(0,1);if("L"==f)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var t=decodeURIComponent(O.substring(1));StorageFile.getFileContent(this,t,mxUtils.bind(this,function(u){".scratchpad"!=t||null!=+u&&"<mxfile"!=u.substring(0,7)||(u=this.emptyLibraryXml);null!=u?Q(new StorageLibrary(this,u,t)):c()}),c)}catch(u){c()}}),0);else if("U"==f){var k=decodeURIComponent(O.substring(1));this.isOffline()?c(!0):this.loadTemplate(k,mxUtils.bind(this,function(t){null!=t&&0<t.length?Q(new UrlLibrary(this,t,k)):c()}),function(){c()},null,!0)}else if("R"==f){f=decodeURIComponent(O.substring(1));try{f=JSON.parse(f);var n={id:f[0],title:f[1],downloadUrl:f[2]};this.remoteInvoke("getFileContent",[n.downloadUrl],+null,mxUtils.bind(this,function(t){try{Q(new RemoteLibrary(this,t,n))}catch(u){c()}}),function(){c()})}catch(t){c()}}else if("S"==f&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(O.substring(1)),function(t){Q(t)},c)}catch(t){c()}else{var q=null;"G"==f?null!=this.drive&&null!=this.drive.user&&(q=this.drive):"H"==f?null!=this.gitHub&&null!=this.gitHub.getUser()&&(q=this.gitHub):"T"==f?null!=this.trello&&this.trello.isAuthorized()&&(q=this.trello):"D"==f?null!=this.dropbox&&null!=+this.dropbox.getUser()&&(q=this.dropbox):"W"==f&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(q=this.oneDrive);null!=q?q.getLibrary(decodeURIComponent(O.substring(1)),mxUtils.bind(this,function(t){try{Q(t)}catch(u){c()}}),function(t){c()}):c(!0)}}})(L,G)}y()}};App.prototype.updateButtonContainer=function(b){if(null!=this.buttonContainer)if(EditorUi.isElectronApp||this.isOffline()||b||(null!=urlParams.notif?this.fetchAndShowNotification(urlParams.notif):"1"!=urlParams.extAuth&&"atlas"!=Editor.currentTheme&&this.fetchAndShowNotification("online",this.mode)),this.isStandaloneApp()||"simple"==Editor.currentTheme&&"1"!=urlParams.embed)this.buttonContainer.style.display="none",null!=this.notificationBtn&&this.notificationBtn.parentNode!=this.sketchMenubarElt&&this.sketchMenubarElt.appendChild(this.notificationBtn);else{this.buttonContainer.style.display="";b=this.getCurrentFile();null!=this.notificationBtn&&this.notificationBtn.parentNode!=this.buttonContainer&&this.buttonContainer.appendChild(this.notificationBtn);"sketch"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&(null==this.commentButton&&(this.commentButton=document.createElement("a"),this.setElementTitle(this.commentButton,"comments"),this.commentButton.className="geButton geRoundButton",this.commentButton.style.backgroundImage="url("+Editor.commentImage+")",mxEvent.addListener(this.commentButton,"click",mxUtils.bind(this,function(){this.actions.get("comments").funct()})),this.buttonContainer.appendChild(this.commentButton)),this.commentButton.style.display=this.commentsSupported()?"":"none");if(null==this.shareButton){this.shareButton=document.createElement("button");this.shareButton.className="geBtn gePrimaryBtn";var l=document.createElement("div");l.className="geButton";l.style.backgroundImage="url("+Editor.groupImage+")";this.shareButton.appendChild(l);this.dependsOnLanguage(mxUtils.bind(this,function(){l.innerHTML="";mxUtils.write(l,mxResources.get("share"));this.shareButton.setAttribute("title",mxResources.get("share"))}));mxEvent.addListener(this.shareButton,"click",mxUtils.bind(this,function(){this.actions.get("share").funct()}));this.buttonContainer.appendChild(this.shareButton)}this.shareButton.style.display=null!=b&&"kennedy"==Editor.currentTheme&&"1"!=urlParams.embed?"":"none";-if("simple"!=Editor.currentTheme){if(null==this.userButton){this.userButton=document.createElement("a");this.userButton.className="geButton geRoundButton";var p=document.createElement("div");p.className="geUserAvatar";this.userButton.appendChild(p);mxEvent.addListener(this.userButton,"click",mxUtils.bind(this,function(F){this.toggleUserPanel();var K=this.userButton.getBoundingClientRect(),M=window.innerWidth||document.documentElement.clientWidth;this.userPanel.style.top=K.bottom+"px";this.userPanel.style.right=-M-K.right+"px";mxEvent.consume(F)}));var g=document.createElement("img");g.style.position="absolute";g.style.width="10px";this.userButton.appendChild(g);this.buttonContainer.appendChild(this.userButton)}if(!this.unloading){p=this.userButton.getElementsByClassName("geUserAvatar")[0];g=this.userButton.getElementsByTagName("img")[0];var x=mxResources.get("changeUser"),B=this.getMainUser();null!=B&&null!=B.displayName&&(x=B.displayName);null!=B&&null!=B.pictureUrl?(p.classList.remove("geAdaptiveAsset"),-p.classList.add("geUserPhoto"),p.style.backgroundImage="url("+B.pictureUrl+")",g.style.top="3px",g.style.right="0"):(p.classList.remove("geUserPhoto"),p.classList.add("geAdaptiveAsset"),p.style.backgroundImage="url("+Editor.userImage+")",g.style.top="6px",g.style.right="4px");if(null!=b&&b.isRealtimeEnabled()&&b.isRealtimeSupported()){g.style.display="";p=b.getRealtimeError();var z=b.getRealtimeState();x+=" (";1==z?(g.src=Editor.syncImage,x+=mxResources.get("online")):(g.src=Editor.syncProblemImage,-x=null!=p&&null!=p.message?x+p.message:x+mxResources.get("disconnected"));x+=")"}else g.style.display="none",g.src=Editor.cloudImage;this.userButton.setAttribute("title",x);this.userButton.style.display="draw.io"!=this.getServiceName()||null==B||"1"==urlParams.embed||this.isStandaloneApp()||null==b?"none":""}}}};-App.prototype.fetchAndShowNotification=function(b,l){if(!this.fetchingNotif&&null!=NOTIFICATIONS_URL){b=b||"online";var p=null,g=mxUtils.bind(this,function(x){x=x.filter(function(K){return!K.targets||-1<K.targets.indexOf(b)||null!=l&&-1<K.targets.indexOf(l)});for(var B=b+"NotifReadTS",z=isLocalStorage?parseInt(localStorage.getItem(B)):!0,F=0;F<x.length;F++)x[F].isNew=!z||x[F].timestamp>z;this.showNotification(x,B)});try{isLocalStorage&&(p=JSON.parse(localStorage.getItem(".notifCache")))}catch(x){}null==-p||p.ts+864E5<Date.now()?(this.fetchingNotif=!0,mxUtils.get(NOTIFICATIONS_URL,mxUtils.bind(this,function(x){if(200<=x.getStatus()&&299>=x.getStatus())try{var B=JSON.parse(x.getText());B.sort(function(z,F){return F.timestamp-z.timestamp});isLocalStorage&&localStorage.setItem(".notifCache",JSON.stringify({ts:Date.now(),notifs:B}));this.fetchingNotif=!1;g(B)}catch(z){}}))):g(p.notifs)}};-App.prototype.showNotification=function(b,l){function p(M){var L=document.querySelector(".geNotification-count");null!=L&&(L.innerHTML=M,L.style.display=0==M?"none":"",L=document.querySelector(".geNotification-bell"),L.style.animation=0==M?"none":"",L.className="geNotification-bell"+(0==M?" geNotification-bellOff":""),document.querySelector(".geBell-rad").style.animation=0==M?"none":"")}var g=b.length;if("min"==Editor.currentTheme||"simple"==Editor.currentTheme)for(var x=g=0;x<b.length;x++)b[x].isNew&&-g++;if(0==g)null!=this.notificationBtn&&(this.notificationBtn.style.display="none",this.editor.fireEvent(new mxEventObject("statusChanged")));else{var B=mxUtils.bind(this,function(){this.notificationWin.style.display="none";for(var M=this.notificationWin.querySelectorAll(".circle.active"),L=0;L<M.length;L++)M[L].className="circle";isLocalStorage&&b[0]&&localStorage.setItem(l,b[0].timestamp)});if(null==this.notificationBtn){this.notificationBtn=document.createElement("div");this.notificationBtn.className=+if("simple"!=Editor.currentTheme){if(null==this.userButton){this.userButton=document.createElement("a");this.userButton.className="geButton geRoundButton";var p=document.createElement("div");p.className="geUserAvatar";this.userButton.appendChild(p);mxEvent.addListener(this.userButton,"click",mxUtils.bind(this,function(G){this.toggleUserPanel();var L=this.userButton.getBoundingClientRect(),O=window.innerWidth||document.documentElement.clientWidth;this.userPanel.style.top=L.bottom+"px";this.userPanel.style.right=+O-L.right+"px";mxEvent.consume(G)}));var g=document.createElement("img");g.style.position="absolute";g.style.width="10px";this.userButton.appendChild(g);this.buttonContainer.appendChild(this.userButton)}if(!this.unloading){p=this.userButton.getElementsByClassName("geUserAvatar")[0];g=this.userButton.getElementsByTagName("img")[0];var x=mxResources.get("changeUser"),A=this.getMainUser();null!=A&&null!=A.displayName&&(x=A.displayName);null!=A&&null!=A.pictureUrl?(p.classList.remove("geAdaptiveAsset"),+p.classList.add("geUserPhoto"),p.style.backgroundImage="url("+A.pictureUrl+")",g.style.top="3px",g.style.right="0"):(p.classList.remove("geUserPhoto"),p.classList.add("geAdaptiveAsset"),p.style.backgroundImage="url("+Editor.userImage+")",g.style.top="6px",g.style.right="4px");if(null!=b&&b.isRealtimeEnabled()&&b.isRealtimeSupported()){g.style.display="";p=b.getRealtimeError();var y=b.getRealtimeState();x+=" (";1==y?(g.src=Editor.syncImage,x+=mxResources.get("online")):(g.src=Editor.syncProblemImage,+x=null!=p&&null!=p.message?x+p.message:x+mxResources.get("disconnected"));x+=")"}else g.style.display="none",g.src=Editor.cloudImage;this.userButton.setAttribute("title",x);this.userButton.style.display="draw.io"!=this.getServiceName()||null==A||"1"==urlParams.embed||this.isStandaloneApp()||null==b?"none":""}}}};+App.prototype.fetchAndShowNotification=function(b,l){if(!this.fetchingNotif&&null!=NOTIFICATIONS_URL){b=b||"online";var p=null,g=mxUtils.bind(this,function(x){x=x.filter(function(L){return!L.targets||-1<L.targets.indexOf(b)||null!=l&&-1<L.targets.indexOf(l)});for(var A=b+"NotifReadTS",y=isLocalStorage?parseInt(localStorage.getItem(A)):!0,G=0;G<x.length;G++)x[G].isNew=!y||x[G].timestamp>y;this.showNotification(x,A)});try{isLocalStorage&&(p=JSON.parse(localStorage.getItem(".notifCache")))}catch(x){}null==+p||p.ts+864E5<Date.now()?(this.fetchingNotif=!0,mxUtils.get(NOTIFICATIONS_URL,mxUtils.bind(this,function(x){if(200<=x.getStatus()&&299>=x.getStatus())try{var A=JSON.parse(x.getText());A.sort(function(y,G){return G.timestamp-y.timestamp});isLocalStorage&&localStorage.setItem(".notifCache",JSON.stringify({ts:Date.now(),notifs:A}));this.fetchingNotif=!1;g(A)}catch(y){}}))):g(p.notifs)}};+App.prototype.showNotification=function(b,l){function p(O){var J=document.querySelector(".geNotification-count");null!=J&&(J.innerHTML=O,J.style.display=0==O?"none":"",J=document.querySelector(".geNotification-bell"),J.style.animation=0==O?"none":"",J.className="geNotification-bell"+(0==O?" geNotification-bellOff":""),document.querySelector(".geBell-rad").style.animation=0==O?"none":"")}var g=b.length;if("min"==Editor.currentTheme||"simple"==Editor.currentTheme)for(var x=g=0;x<b.length;x++)b[x].isNew&&+g++;if(0==g)null!=this.notificationBtn&&(this.notificationBtn.style.display="none",this.editor.fireEvent(new mxEventObject("statusChanged")));else{var A=mxUtils.bind(this,function(){this.notificationWin.style.display="none";for(var O=this.notificationWin.querySelectorAll(".circle.active"),J=0;J<O.length;J++)O[J].className="circle";isLocalStorage&&b[0]&&localStorage.setItem(l,b[0].timestamp)});if(null==this.notificationBtn){this.notificationBtn=document.createElement("div");this.notificationBtn.className="geNotification-box";g=document.createElement("span");g.className="geNotification-count";this.notificationBtn.appendChild(g);this.notifCount=g;g=document.createElement("div");g.className="geNotification-bell";x=document.createElement("span");x.className="geBell-top";g.appendChild(x);x=document.createElement("span");x.className="geBell-middle";g.appendChild(x);x=document.createElement("span");x.className="geBell-bottom";g.appendChild(x);x=document.createElement("span");x.className="geBell-rad";g.appendChild(x);this.notificationBtn.appendChild(g);this.notificationWin=document.createElement("div");this.notificationWin.className="geNotifPanel";this.notificationWin.style.display="none";document.body.appendChild(this.notificationWin);x=document.createElement("div");x.className="header";g=document.createElement("span");g.className="title";g.textContent=mxResources.get("notifications");x.appendChild(g);g=document.createElement("span");g.className="closeBtn";g.textContent="x";x.appendChild(g);this.notificationWin.appendChild(x);-x=document.createElement("div");x.className="notifications clearfix";var z=document.createElement("div");z.setAttribute("id","geNotifList");z.style.position="relative";x.appendChild(z);this.notificationWin.appendChild(x);mxEvent.addListener(this.notificationBtn,"click",mxUtils.bind(this,function(){if("none"==this.notificationWin.style.display){this.notificationWin.style.display="";document.querySelector(".notifications").scrollTop=0;var M=this.notificationBtn.getBoundingClientRect();this.notificationWin.style.top=-M.top+this.notificationBtn.clientHeight+"px";this.notificationWin.style.left=M.right-this.notificationWin.clientWidth+"px";p(0)}else B()}));mxEvent.addListener(g,"click",B)}else this.notificationBtn.style.display="";var F=0,K=document.getElementById("geNotifList");if(null!=K){K.innerHTML='<div class="line"></div>';for(x=0;x<b.length;x++)(function(M,L){L.isNew&&F++;var Q=document.createElement("div");Q.className="notification";M=M.timeSince(new Date(L.timestamp));null==M&&(M=mxResources.get("lessThanAMinute"));-Q.innerHTML='<div class="circle'+(L.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[M],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(L.content)+"</p>";L.link&&mxEvent.addListener(Q,"click",function(){window.open(L.link,"notifWin")});K.appendChild(Q)})(this,b[x]);p(F)}}};-App.prototype.save=function(b,l){var p=this.getCurrentFile(),g=!0,x=mxUtils.bind(this,function(){g&&(g=!1,p.handleFileSuccess(!0),null!=l&&l())}),B=mxUtils.bind(this,function(z){if(g){g=!1;Editor.addRetryToError(z,mxUtils.bind(this,function(){this.save(b,l)}));if(null!=z&&null!=z.retry){var F=z.retry;z.retry=function(){g=!0;try{p.isModified()?F():x()}catch(K){B(K)}}}p.handleFileError(z,null==z||"AbortError"!=z.name)}});if(null!=p&&this.spinner.spin(document.body,mxResources.get("saving"),B,3*this.timeout))try{this.clearStatus(),-this.editor.graph.isEditing()&&this.editor.graph.stopEditing(),b==p.getTitle()?p.save(!0,x,B):p.saveAs(b,x,B)}catch(z){B(z)}};App.prototype.getExtensionForService=function(b){b=this.getServiceForName(b);return null!=b?b.extension:".drawio"};+x=document.createElement("div");x.className="notifications clearfix";var y=document.createElement("div");y.setAttribute("id","geNotifList");y.style.position="relative";x.appendChild(y);this.notificationWin.appendChild(x);mxEvent.addListener(this.notificationBtn,"click",mxUtils.bind(this,function(){if("none"==this.notificationWin.style.display){this.notificationWin.style.display="";document.querySelector(".notifications").scrollTop=0;var O=this.notificationBtn.getBoundingClientRect();this.notificationWin.style.top=+O.top+this.notificationBtn.clientHeight+"px";this.notificationWin.style.left=O.right-this.notificationWin.clientWidth+"px";p(0)}else A()}));mxEvent.addListener(g,"click",A)}else this.notificationBtn.style.display="";var G=0,L=document.getElementById("geNotifList");if(null!=L){L.innerHTML='<div class="line"></div>';for(x=0;x<b.length;x++)(function(O,J){J.isNew&&G++;var Q=document.createElement("div");Q.className="notification";O=O.timeSince(new Date(J.timestamp));null==O&&(O=mxResources.get("lessThanAMinute"));+Q.innerHTML='<div class="circle'+(J.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[O],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(J.content)+"</p>";J.link&&mxEvent.addListener(Q,"click",function(){window.open(J.link,"notifWin")});L.appendChild(Q)})(this,b[x]);p(G)}}};+App.prototype.save=function(b,l){var p=this.getCurrentFile(),g=!0,x=mxUtils.bind(this,function(){g&&(g=!1,p.handleFileSuccess(!0),null!=l&&l())}),A=mxUtils.bind(this,function(y){if(g){g=!1;Editor.addRetryToError(y,mxUtils.bind(this,function(){this.save(b,l)}));if(null!=y&&null!=y.retry){var G=y.retry;y.retry=function(){g=!0;try{p.isModified()?G():x()}catch(L){A(L)}}}p.handleFileError(y,null==y||"AbortError"!=y.name)}});if(null!=p&&this.spinner.spin(document.body,mxResources.get("saving"),A,3*this.timeout))try{this.clearStatus(),+this.editor.graph.isEditing()&&this.editor.graph.stopEditing(),b==p.getTitle()?p.save(!0,x,A):p.saveAs(b,x,A)}catch(y){A(y)}};App.prototype.getExtensionForService=function(b){b=this.getServiceForName(b);return null!=b?b.extension:".drawio"};App.prototype.getServiceForName=function(b){return b==App.MODE_GOOGLE?this.drive:b==App.MODE_ONEDRIVE?this.oneDrive:b==App.MODE_M365?this.m365:b==App.MODE_DROPBOX?this.dropbox:b==App.MODE_GITHUB?this.gitHub:b==App.MODE_GITLAB?this.gitLab:b==App.MODE_TRELLO?this.trello:null};App.prototype.getTitleForService=function(b){return b==App.MODE_GOOGLE?mxResources.get("googleDrive"):b==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):b==App.MODE_M365?mxResources.get("m365"):EditorUi.prototype.getTitleForService.apply(this,arguments)};-App.prototype.pickFolder=function(b,l,p,g,x,B){p=null!=p?p:!0;this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);var z=this.spinner.pause();p&&b==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(F){z();if(F.action==google.picker.Action.PICKED){var K=null;null!=F.docs&&0<F.docs.length&&"folder"==F.docs[0].type&&(K=F.docs[0].id);l(B?F:K)}}),x):p&&b==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(F){z();-if(null!=F&&null!=F.value&&0<F.value.length){var K=OneDriveFile.prototype.getIdOf(F.value[0]);l(B?F:K)}}),g):p&&b==App.MODE_M365&&null!=this.m365?this.m365.pickFolder(mxUtils.bind(this,function(F){z();if(null!=F&&null!=F.value&&0<F.value.length){var K=OneDriveFile.prototype.getIdOf(F.value[0]);l(B?F:K)}}),g):p&&b==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(F){z();l(F)})):p&&b==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(F){z();-l(F)})):p&&b==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(F){z();l(F)})):EditorUi.prototype.pickFolder.apply(this,arguments)};-App.prototype.exportFile=function(b,l,p,g,x,B){x==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(l,g?this.base64ToBlob(b,p):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)})):x==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(l,b,B,mxUtils.bind(this,function(z){this.spinner.stop()}),-mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}),p,g):x==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(l,g?this.base64ToBlob(b,p):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}),!1,B):x==App.MODE_GITHUB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitHub.insertFile(l,b,mxUtils.bind(this,-function(){this.spinner.stop()}),mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}),!0,B,g):x==App.MODE_GITLAB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitLab.insertFile(l,b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}),!0,B,g):x==App.MODE_TRELLO?null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(l,g?this.base64ToBlob(b,-p):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}),!1,B):x==App.MODE_BROWSER&&(null!=window.StorageFile&&!g&&this.spinner.spin(document.body,mxResources.get("saving"))?(p="<mxlibrary"==b.substring(0,10)?new StorageLibrary(this,b,l):new StorageFile(this,b,l),StorageFile.doInsertFile(p,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(z){this.spinner.stop();this.handleError(z)}))):(p=mxUtils.bind(this,+App.prototype.pickFolder=function(b,l,p,g,x,A){p=null!=p?p:!0;this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);var y=this.spinner.pause();p&&b==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(G){y();if(G.action==google.picker.Action.PICKED){var L=null;null!=G.docs&&0<G.docs.length&&"folder"==G.docs[0].type&&(L=G.docs[0].id);l(A?G:L)}}),x):p&&b==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(G){y();+if(null!=G&&null!=G.value&&0<G.value.length){var L=OneDriveFile.prototype.getIdOf(G.value[0]);l(A?G:L)}}),g):p&&b==App.MODE_M365&&null!=this.m365?this.m365.pickFolder(mxUtils.bind(this,function(G){y();if(null!=G&&null!=G.value&&0<G.value.length){var L=OneDriveFile.prototype.getIdOf(G.value[0]);l(A?G:L)}}),g):p&&b==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(G){y();l(G)})):p&&b==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(G){y();+l(G)})):p&&b==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(G){y();l(G)})):EditorUi.prototype.pickFolder.apply(this,arguments)};+App.prototype.exportFile=function(b,l,p,g,x,A){x==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(l,g?this.base64ToBlob(b,p):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(y){this.spinner.stop();this.handleError(y)})):x==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(l,b,A,mxUtils.bind(this,function(y){this.spinner.stop()}),+mxUtils.bind(this,function(y){this.spinner.stop();this.handleError(y)}),p,g):x==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(l,g?this.base64ToBlob(b,p):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(y){this.spinner.stop();this.handleError(y)}),!1,A):x==App.MODE_GITHUB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitHub.insertFile(l,b,mxUtils.bind(this,+function(){this.spinner.stop()}),mxUtils.bind(this,function(y){this.spinner.stop();this.handleError(y)}),!0,A,g):x==App.MODE_GITLAB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitLab.insertFile(l,b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(y){this.spinner.stop();this.handleError(y)}),!0,A,g):x==App.MODE_TRELLO?null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(l,g?this.base64ToBlob(b,+p):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(y){this.spinner.stop();this.handleError(y)}),!1,A):x==App.MODE_BROWSER&&(null!=window.StorageFile&&!g&&this.spinner.spin(document.body,mxResources.get("saving"))?(p="<mxlibrary"==b.substring(0,10)?new StorageLibrary(this,b,l):new StorageFile(this,b,l),StorageFile.doInsertFile(p,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(y){this.spinner.stop();this.handleError(y)}))):(p=mxUtils.bind(this,function(){localStorage.setItem(l,b)}),null==localStorage.getItem(l)?p():this.confirm(mxResources.get("replaceIt",[l]),p)))};App.prototype.descriptorChanged=function(){var b=this.getCurrentFile();if(null!=b){if(null!=this.fname){this.fname.innerText="";var l=null!=b.getTitle()?b.getTitle():this.defaultFilename;mxUtils.write(this.fname,l)}l=this.editor.graph;var p=b.isEditable();l.isEnabled()&&!p&&l.reset();l.setEnabled(p);null==urlParams.rev&&(this.updateDocumentTitle(),l=b.getHash(),0<l.length?(l!=this.getDiagramId()&&(window.location.hash=l),this.updateHashObject()):0<window.location.hash.length&&(window.location.hash=""))}this.updateUi();null==this.format||null!=b&&this.fileEditable==b.isEditable()||!this.editor.graph.isSelectionEmpty()||(this.format.refresh(),this.fileEditable=null!=b?b.isEditable():null);this.fireEvent(new mxEventObject("fileDescriptorChanged","file",b))};-App.prototype.showAuthDialog=function(b,l,p,g){var x=this.spinner.pause();this.showDialog((new AuthDialog(this,b,l,mxUtils.bind(this,function(B){try{null!=p&&p(B,mxUtils.bind(this,function(){this.hideDialog();x()}))}catch(z){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(z.message))}))}}))).container,300,l?180:140,!0,!0,mxUtils.bind(this,function(B){null!=g&&g(B);B&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};-App.prototype.convertFile=function(b,l,p,g,x,B,z,F){var K=l;/\.svg$/i.test(K)||(K=K.substring(0,l.lastIndexOf("."))+g);var M=!1;null!=this.gitHub&&b.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(M=!0);if(/\.v(dx|sdx?)$/i.test(l)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var L=new XMLHttpRequest;L.open("GET",b,!0);M||(L.responseType="blob");if(F)for(var Q in F)L.setRequestHeader(Q,F[Q]);L.onload=mxUtils.bind(this,function(){if(200<=-L.status&&299>=L.status){var f=null;M?(f=JSON.parse(L.responseText),f=this.base64ToBlob(f.content,"application/octet-stream")):f=new Blob([L.response],{type:"application/octet-stream"});this.importVisio(f,mxUtils.bind(this,function(k){x(new LocalFile(this,k,K,!0))}),B,l)}else null!=B&&B({message:mxResources.get("errorLoadingFile")})});L.onerror=B;L.send()}else{var c=mxUtils.bind(this,function(f){try{if(/\.pdf$/i.test(l)){var k=Editor.extractGraphModelFromPdf(f);null!=k&&0<k.length&&x(new LocalFile(this,-k,K,!0))}else/\.png$/i.test(l)?(k=this.extractGraphModelFromPng(f),null!=k?x(new LocalFile(this,k,K,!0)):x(new LocalFile(this,f,l,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(f,b)?this.parseFileData(f,mxUtils.bind(this,function(n){4==n.readyState&&(200<=n.status&&299>=n.status?x(new LocalFile(this,n.responseText,K,!0)):null!=B&&B({message:mxResources.get("errorLoadingFile")}))}),l):x(new LocalFile(this,f,K,!0))}catch(n){null!=B&&B(n)}});p=/\.png$/i.test(l)||/\.jpe?g$/i.test(l)||-/\.pdf$/i.test(l)||null!=p&&"image/"==p.substring(0,6);M?mxUtils.get(b,mxUtils.bind(this,function(f){if(200<=f.getStatus()&&299>=f.getStatus()){if(null!=x){f=JSON.parse(f.getText());var k=f.content;"base64"===f.encoding&&(k=/\.png$/i.test(l)?"data:image/png;base64,"+k:/\.pdf$/i.test(l)?"data:application/pdf;base64,"+k:window.atob?atob(k):Base64.decode(k));c(k)}}else null!=B&&B({code:App.ERROR_UNKNOWN})}),function(){null!=B&&B({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=B&&B({code:App.ERROR_TIMEOUT,-retry:fn})},F):null!=z?z(b,c,B,p):this.editor.loadUrl(b,c,B,p,null,null,null,F)}};-App.prototype.updateHeader=function(){if(null!=this.menubar){var b="url("+Editor.logoImage+")";this.appIcon=document.createElement("a");this.appIcon.className="geAppIcon";this.appIcon.style.backgroundImage=b;mxEvent.disableContextMenu(this.appIcon);mxEvent.addListener(this.appIcon,"click",mxUtils.bind(this,function(B){this.appIconClicked(B)}));mxEvent.addListener(this.appIcon,"mouseover",mxUtils.bind(this,function(){var B=this.getCurrentFile();null!=B&&(B=B.getMode(),B==App.MODE_GOOGLE?(this.appIcon.style.backgroundImage=-"url("+IMAGE_PATH+"/google-drive-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):B==App.MODE_DROPBOX?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/dropbox-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):B==App.MODE_ONEDRIVE?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/onedrive-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):B==App.MODE_GITHUB?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/github-logo-white.svg)",this.appIcon.style.backgroundSize=-"70%"):B==App.MODE_GITLAB?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/gitlab-logo-white.svg)",this.appIcon.style.backgroundSize="90%"):B==App.MODE_TRELLO&&(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/trello-logo-white-orange.svg)",this.appIcon.style.backgroundSize="70%"))}));mxEvent.addListener(this.appIcon,"mouseout",mxUtils.bind(this,function(){this.appIcon.style.backgroundImage=b;this.appIcon.style.backgroundSize=""}));"1"!=urlParams.embed&&this.menubarContainer.appendChild(this.appIcon);-this.fnameWrapper=document.createElement("div");this.fname=document.createElement("a");this.fnameWrapper.className="geFilenameContainer";this.fname.className="geFilename";mxEvent.addListener(this.fname,"click",mxUtils.bind(this,function(B){var z=this.getCurrentFile();null!=z&&z.isRenamable()&&(this.editor.graph.isEditing()&&this.editor.graph.stopEditing(),this.actions.get("rename").funct());mxEvent.consume(B)}));mxEvent.preventDefault(this.fname);this.fnameWrapper.appendChild(this.fname);"1"!=urlParams.embed&&-this.menubarContainer.appendChild(this.fnameWrapper);var l=document.createElement("div");l.className="geToolbar geToolbarEnd";this.toolbarContainer.appendChild(l);this.fullscreenElement=document.createElement("a");this.fullscreenElement.style.backgroundImage="url('"+Editor.fullscreenImage+"')";this.fullscreenElement.className="geButton";l.appendChild(this.fullscreenElement);mxEvent.addListener(this.fullscreenElement,"click",mxUtils.bind(this,function(B){var z=this.fullscreenMode;"atlas"!=Editor.currentTheme&&-"1"!=urlParams.embed&&this.setCompactMode(!z,null,Editor.transitionDelay);this.toggleShapesPanel(z);this.toggleFormatPanel(z);this.fullscreenMode=!z;this.fullscreenElement.style.backgroundImage="url('"+(this.fullscreenMode?Editor.fullscreenExitImage:Editor.fullscreenImage)+"')";mxEvent.consume(B)}));mxEvent.preventDefault(this.fullscreenElement);this.addListener("formatWidthChanged",mxUtils.bind(this,function(){this.updateFullscreenState()}));this.addListener("shapesPanelChanged",mxUtils.bind(this,-function(){this.updateFullscreenState()}));var p=document.createElement("a");p.className="geButton";l.appendChild(p);mxEvent.addListener(p,"click",mxUtils.bind(this,function(B){this.actions.get("format").funct();mxEvent.consume(B)}));mxEvent.preventDefault(p);var g=mxUtils.bind(this,function(){p.style.backgroundImage=0<this.formatWidth?"url('"+Editor.rightPanelCloseImage+"')":"url('"+Editor.rightPanelOpenImage+"')"});this.addListener("formatWidthChanged",g);g();var x=document.createElement("a");x.style.backgroundImage=-"url('"+(this.compactMode?Editor.chevronDownImage:Editor.chevronUpImage)+"')";x.className="geButton";"1"!=urlParams.embed&&"atlas"!=Editor.currentTheme&&(l.appendChild(x),mxEvent.addListener(x,"click",mxUtils.bind(this,function(B){this.setCompactMode(!this.compactMode,!0,Editor.transitionDelay);mxEvent.consume(B)})),mxEvent.preventDefault(x),!mxClient.IS_FF&&740>=screen.height&&"undefined"!==typeof x.click&&window.setTimeout(mxUtils.bind(this,function(){x.click()}),0),this.addListener("compactModeChanged",+App.prototype.showAuthDialog=function(b,l,p,g){var x=this.spinner.pause();this.showDialog((new AuthDialog(this,b,l,mxUtils.bind(this,function(A){try{null!=p&&p(A,mxUtils.bind(this,function(){this.hideDialog();x()}))}catch(y){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(y.message))}))}}))).container,300,l?180:140,!0,!0,mxUtils.bind(this,function(A){null!=g&&g(A);A&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};+App.prototype.convertFile=function(b,l,p,g,x,A,y,G){var L=l;/\.svg$/i.test(L)||(L=L.substring(0,l.lastIndexOf("."))+g);var O=!1;null!=this.gitHub&&b.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(O=!0);if(/\.v(dx|sdx?)$/i.test(l)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var J=new XMLHttpRequest;J.open("GET",b,!0);O||(J.responseType="blob");if(G)for(var Q in G)J.setRequestHeader(Q,G[Q]);J.onload=mxUtils.bind(this,function(){if(200<=+J.status&&299>=J.status){var f=null;O?(f=JSON.parse(J.responseText),f=this.base64ToBlob(f.content,"application/octet-stream")):f=new Blob([J.response],{type:"application/octet-stream"});this.importVisio(f,mxUtils.bind(this,function(k){x(new LocalFile(this,k,L,!0))}),A,l)}else null!=A&&A({message:mxResources.get("errorLoadingFile")})});J.onerror=A;J.send()}else{var c=mxUtils.bind(this,function(f){try{if(/\.pdf$/i.test(l)){var k=Editor.extractGraphModelFromPdf(f);null!=k&&0<k.length&&x(new LocalFile(this,+k,L,!0))}else/\.png$/i.test(l)?(k=this.extractGraphModelFromPng(f),null!=k?x(new LocalFile(this,k,L,!0)):x(new LocalFile(this,f,l,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(f,b)?this.parseFileData(f,mxUtils.bind(this,function(n){4==n.readyState&&(200<=n.status&&299>=n.status?x(new LocalFile(this,n.responseText,L,!0)):null!=A&&A({message:mxResources.get("errorLoadingFile")}))}),l):x(new LocalFile(this,f,L,!0))}catch(n){null!=A&&A(n)}});p=/\.png$/i.test(l)||/\.jpe?g$/i.test(l)||+/\.pdf$/i.test(l)||null!=p&&"image/"==p.substring(0,6);O?mxUtils.get(b,mxUtils.bind(this,function(f){if(200<=f.getStatus()&&299>=f.getStatus()){if(null!=x){f=JSON.parse(f.getText());var k=f.content;"base64"===f.encoding&&(k=/\.png$/i.test(l)?"data:image/png;base64,"+k:/\.pdf$/i.test(l)?"data:application/pdf;base64,"+k:window.atob?atob(k):Base64.decode(k));c(k)}}else null!=A&&A({code:App.ERROR_UNKNOWN})}),function(){null!=A&&A({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=A&&A({code:App.ERROR_TIMEOUT,+retry:fn})},G):null!=y?y(b,c,A,p):this.editor.loadUrl(b,c,A,p,null,null,null,G)}};+App.prototype.updateHeader=function(){if(null!=this.menubar){var b="url("+Editor.logoImage+")";this.appIcon=document.createElement("a");this.appIcon.className="geAppIcon";this.appIcon.style.backgroundImage=b;mxEvent.disableContextMenu(this.appIcon);mxEvent.addListener(this.appIcon,"click",mxUtils.bind(this,function(A){this.appIconClicked(A)}));mxEvent.addListener(this.appIcon,"mouseover",mxUtils.bind(this,function(){var A=this.getCurrentFile();null!=A&&(A=A.getMode(),A==App.MODE_GOOGLE?(this.appIcon.style.backgroundImage=+"url("+IMAGE_PATH+"/google-drive-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):A==App.MODE_DROPBOX?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/dropbox-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):A==App.MODE_ONEDRIVE?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/onedrive-logo-white.svg)",this.appIcon.style.backgroundSize="70%"):A==App.MODE_GITHUB?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/github-logo-white.svg)",this.appIcon.style.backgroundSize=+"70%"):A==App.MODE_GITLAB?(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/gitlab-logo-white.svg)",this.appIcon.style.backgroundSize="90%"):A==App.MODE_TRELLO&&(this.appIcon.style.backgroundImage="url("+IMAGE_PATH+"/trello-logo-white-orange.svg)",this.appIcon.style.backgroundSize="70%"))}));mxEvent.addListener(this.appIcon,"mouseout",mxUtils.bind(this,function(){this.appIcon.style.backgroundImage=b;this.appIcon.style.backgroundSize=""}));"1"!=urlParams.embed&&this.menubarContainer.appendChild(this.appIcon);+this.fnameWrapper=document.createElement("div");this.fname=document.createElement("a");this.fnameWrapper.className="geFilenameContainer";this.fname.className="geFilename";mxEvent.addListener(this.fname,"click",mxUtils.bind(this,function(A){var y=this.getCurrentFile();null!=y&&y.isRenamable()&&(this.editor.graph.isEditing()&&this.editor.graph.stopEditing(),this.actions.get("rename").funct());mxEvent.consume(A)}));mxEvent.preventDefault(this.fname);this.fnameWrapper.appendChild(this.fname);"1"!=urlParams.embed&&+this.menubarContainer.appendChild(this.fnameWrapper);var l=document.createElement("div");l.className="geToolbar geToolbarEnd";this.toolbarContainer.appendChild(l);this.fullscreenElement=document.createElement("a");this.fullscreenElement.style.backgroundImage="url('"+Editor.fullscreenImage+"')";this.fullscreenElement.className="geButton";l.appendChild(this.fullscreenElement);mxEvent.addListener(this.fullscreenElement,"click",mxUtils.bind(this,function(A){var y=this.fullscreenMode;"atlas"!=Editor.currentTheme&&+"1"!=urlParams.embed&&this.setCompactMode(!y,null,Editor.transitionDelay);this.toggleShapesPanel(y);this.toggleFormatPanel(y);this.fullscreenMode=!y;this.fullscreenElement.style.backgroundImage="url('"+(this.fullscreenMode?Editor.fullscreenExitImage:Editor.fullscreenImage)+"')";mxEvent.consume(A)}));mxEvent.preventDefault(this.fullscreenElement);this.addListener("formatWidthChanged",mxUtils.bind(this,function(){this.updateFullscreenState()}));this.addListener("shapesPanelChanged",mxUtils.bind(this,+function(){this.updateFullscreenState()}));var p=document.createElement("a");p.className="geButton";l.appendChild(p);mxEvent.addListener(p,"click",mxUtils.bind(this,function(A){this.actions.get("format").funct();mxEvent.consume(A)}));mxEvent.preventDefault(p);var g=mxUtils.bind(this,function(){p.style.backgroundImage=0<this.formatWidth?"url('"+Editor.rightPanelCloseImage+"')":"url('"+Editor.rightPanelOpenImage+"')"});this.addListener("formatWidthChanged",g);g();var x=document.createElement("a");x.style.backgroundImage=+"url('"+(this.compactMode?Editor.chevronDownImage:Editor.chevronUpImage)+"')";x.className="geButton";"1"!=urlParams.embed&&"atlas"!=Editor.currentTheme&&(l.appendChild(x),mxEvent.addListener(x,"click",mxUtils.bind(this,function(A){this.setCompactMode(!this.compactMode,!0,Editor.transitionDelay);mxEvent.consume(A)})),mxEvent.preventDefault(x),!mxClient.IS_FF&&740>=screen.height&&"undefined"!==typeof x.click&&window.setTimeout(mxUtils.bind(this,function(){x.click()}),0),this.addListener("compactModeChanged",mxUtils.bind(this,function(){x.style.backgroundImage="url('"+(this.compactMode?Editor.chevronDownImage:Editor.chevronUpImage)+"')"})));this.dependsOnLanguage(mxUtils.bind(this,function(){this.fname.setAttribute("title",mxResources.get("rename"));this.fullscreenElement.setAttribute("title",mxResources.get("fullscreen"));x.setAttribute("title",mxResources.get("collapseExpand"));p.setAttribute("title",mxResources.get("format")+" ("+Editor.ctrlKey+"+"+Editor.shiftKey+"+P)")}))}this.updateFullscreenState()};App.prototype.setCompactMode=function(b,l,p){var g=mxUtils.isAncestorNode(document.body,this.container)||null==this.editor?this.container:this.editor.graph.container;p=null!=p?p:0;window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.menubarContainer.style,"transition","all "+p+"s ease-in-out");mxUtils.setPrefixedStyle(this.toolbarContainer.style,"transition","all "+p+"s ease-in-out");b?g.classList.add("geCompactMode"):g.classList.remove("geCompactMode");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.menubarContainer.style,"transition",null);mxUtils.setPrefixedStyle(this.toolbarContainer.style,"transition",null);this.compactMode=b;this.refresh(!0);this.fireEvent(new mxEventObject("compactModeChanged"));isLocalStorage&&l&&(mxSettings.settings.compactMode=this.compactMode,mxSettings.save())}),1E3*p)}),0)};App.prototype.updateFullscreenState=function(){if(null!=this.fullscreenElement){var b=!this.isShapesPanelVisible()&&!this.isFormatPanelVisible();this.fullscreenMode!=b&&(this.fullscreenMode=b,this.fullscreenElement.style.backgroundImage="url('"+(this.fullscreenMode?Editor.fullscreenExitImage:Editor.fullscreenImage)+"')")}};App.prototype.getMainUser=function(){var b=null;null!=this.drive&&null!=this.drive.getUser()?b=this.drive.getUser():null!=this.oneDrive&&null!=this.oneDrive.getUser()?b=this.oneDrive.getUser():null!=this.m365&&null!=this.m365.getUser()?b=this.m365.getUser():null!=this.dropbox&&null!=this.dropbox.getUser()?b=this.dropbox.getUser():null!=this.gitHub&&null!=this.gitHub.getUser()?b=this.gitHub.getUser():null!=this.gitLab&&null!=this.gitLab.getUser()&&(b=this.gitLab.getUser());return b};App.prototype.hideUserPanel=function(){null!=this.userPanel&&null!=this.userPanel.parentNode&&this.userPanel.parentNode.removeChild(this.userPanel)};-App.prototype.toggleUserPanel=function(){if(null==this.userPanel){var b=document.createElement("div");b.className="geDialog geInlineDialog";b.style.minWidth="300px";this.userPanel=b;mxEvent.addListener(document.body,"click",mxUtils.bind(this,function(z){mxEvent.isConsumed(z)||this.hideUserPanel()}))}if(null!=this.userPanel.parentNode)this.userPanel.parentNode.removeChild(this.userPanel);else{var l=!1;this.userPanel.innerText="";b=document.createElement("div");b.className="geButton";b.setAttribute("title",-mxResources.get("close"));b.style.backgroundImage="url("+Editor.crossImage+")";b.style.position="absolute";b.style.right="0px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideUserPanel()}));this.userPanel.appendChild(b);if(null!=this.drive){var p=this.drive.getUsersList();if(0<p.length){var g=mxUtils.bind(this,function(z,F){var K=this.getCurrentFile();null!=K&&K.constructor==DriveFile?(this.spinner.spin(document.body,F),this.fileLoaded(null),window.setTimeout(mxUtils.bind(this,-function(){this.spinner.stop();z()}),2E3)):z()});b=mxUtils.bind(this,function(z){var F=document.createElement("tr"),K=document.createElement("td");K.setAttribute("valig","middle");K.style.height="59px";K.style.width="66px";var M=document.createElement("img");M.setAttribute("width","50");M.setAttribute("height","50");M.setAttribute("border","0");M.setAttribute("src",null!=z.pictureUrl?z.pictureUrl:Editor.userImage);M.style.borderRadius="50%";M.style.margin="4px 8px 0 8px";K.appendChild(M);F.appendChild(K);-K=document.createElement("td");K.setAttribute("valign","middle");K.style.whiteSpace="nowrap";K.style.paddingTop="4px";K.style.maxWidth="0";K.style.overflow="hidden";K.style.textOverflow="ellipsis";mxUtils.write(K,z.displayName+(z.isCurrent&&1<p.length?" ("+mxResources.get("default")+")":""));null!=z.email&&(mxUtils.br(K),M=document.createElement("small"),M.style.color="gray",mxUtils.write(M,z.email),K.appendChild(M));M=document.createElement("div");M.style.marginTop="4px";var L=document.createElement("i");-mxUtils.write(L,mxResources.get("googleDrive"));M.appendChild(L);K.appendChild(M);F.appendChild(K);z.isCurrent?F.setAttribute("title","User ID: "+z.id):(F.setAttribute("title",mxResources.get("login")+" (User ID: "+z.id+")"),F.style.cursor="pointer",F.style.opacity="0.3",mxEvent.addListener(F,"mouseenter",mxUtils.bind(this,function(){F.style.opacity="1"})),mxEvent.addListener(F,"mouseleave",mxUtils.bind(this,function(){F.style.opacity="0.3"})),mxEvent.addListener(F,"click",mxUtils.bind(this,function(Q){this.hideUserPanel();-g(mxUtils.bind(this,function(){this.stateArg=null;this.drive.setUser(z);this.drive.authorize(!0,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(c){this.handleError(c)}),!0)}),mxResources.get("changeUser")+"...");mxEvent.consume(Q)})));return F});l=!0;var x=document.createElement("table");x.style.borderSpacing="0";x.style.fontSize="10pt";x.style.width="100%";x.style.padding="10px";for(var B=0;B<p.length;B++)x.appendChild(b(p[B]));+App.prototype.toggleUserPanel=function(){if(null==this.userPanel){var b=document.createElement("div");b.className="geDialog geInlineDialog";b.style.minWidth="300px";this.userPanel=b;mxEvent.addListener(document.body,"click",mxUtils.bind(this,function(y){mxEvent.isConsumed(y)||this.hideUserPanel()}))}if(null!=this.userPanel.parentNode)this.userPanel.parentNode.removeChild(this.userPanel);else{var l=!1;this.userPanel.innerText="";b=document.createElement("div");b.className="geButton";b.setAttribute("title",+mxResources.get("close"));b.style.backgroundImage="url("+Editor.crossImage+")";b.style.position="absolute";b.style.right="0px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideUserPanel()}));this.userPanel.appendChild(b);if(null!=this.drive){var p=this.drive.getUsersList();if(0<p.length){var g=mxUtils.bind(this,function(y,G){var L=this.getCurrentFile();null!=L&&L.constructor==DriveFile?(this.spinner.spin(document.body,G),this.fileLoaded(null),window.setTimeout(mxUtils.bind(this,+function(){this.spinner.stop();y()}),2E3)):y()});b=mxUtils.bind(this,function(y){var G=document.createElement("tr"),L=document.createElement("td");L.setAttribute("valig","middle");L.style.height="59px";L.style.width="66px";var O=document.createElement("img");O.setAttribute("width","50");O.setAttribute("height","50");O.setAttribute("border","0");O.setAttribute("src",null!=y.pictureUrl?y.pictureUrl:Editor.userImage);O.style.borderRadius="50%";O.style.margin="4px 8px 0 8px";L.appendChild(O);G.appendChild(L);+L=document.createElement("td");L.setAttribute("valign","middle");L.style.whiteSpace="nowrap";L.style.paddingTop="4px";L.style.maxWidth="0";L.style.overflow="hidden";L.style.textOverflow="ellipsis";mxUtils.write(L,y.displayName+(y.isCurrent&&1<p.length?" ("+mxResources.get("default")+")":""));null!=y.email&&(mxUtils.br(L),O=document.createElement("small"),O.style.color="gray",mxUtils.write(O,y.email),L.appendChild(O));O=document.createElement("div");O.style.marginTop="4px";var J=document.createElement("i");+mxUtils.write(J,mxResources.get("googleDrive"));O.appendChild(J);L.appendChild(O);G.appendChild(L);y.isCurrent?G.setAttribute("title","User ID: "+y.id):(G.setAttribute("title",mxResources.get("login")+" (User ID: "+y.id+")"),G.style.cursor="pointer",G.style.opacity="0.3",mxEvent.addListener(G,"mouseenter",mxUtils.bind(this,function(){G.style.opacity="1"})),mxEvent.addListener(G,"mouseleave",mxUtils.bind(this,function(){G.style.opacity="0.3"})),mxEvent.addListener(G,"click",mxUtils.bind(this,function(Q){this.hideUserPanel();+g(mxUtils.bind(this,function(){this.stateArg=null;this.drive.setUser(y);this.drive.authorize(!0,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(c){this.handleError(c)}),!0)}),mxResources.get("changeUser")+"...");mxEvent.consume(Q)})));return G});l=!0;var x=document.createElement("table");x.style.borderSpacing="0";x.style.fontSize="10pt";x.style.width="100%";x.style.padding="10px";for(var A=0;A<p.length;A++)x.appendChild(b(p[A]));this.userPanel.appendChild(x);b=document.createElement("div");b.style.textAlign="left";b.style.padding="10px";b.style.whiteSpace="nowrap";b.style.borderTopStyle="solid";b.style.borderTopWidth="1px";x=mxUtils.button(mxResources.get("signOut"),mxUtils.bind(this,function(){this.confirm(mxResources.get("areYouSure"),mxUtils.bind(this,function(){g(mxUtils.bind(this,function(){this.stateArg=null;this.drive.logout();this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxResources.get("signOut"))}))}));-x.className="geBtn";x.style.float="right";b.appendChild(x);x=mxUtils.button(mxResources.get("addAccount"),mxUtils.bind(this,function(){var z=this.drive.createAuthWin();z.blur();window.focus();g(mxUtils.bind(this,function(){this.stateArg=null;this.drive.authorize(!1,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(F){this.handleError(F)}),!0,z)}),mxResources.get("closingFile")+"...")}));x.className="geBtn";x.style.margin="0px";-b.appendChild(x);this.userPanel.appendChild(b)}}b=mxUtils.bind(this,function(z,F,K,M){if(null!=z){l&&this.userPanel.appendChild(document.createElement("hr"));l=!0;var L=document.createElement("table");L.style.borderSpacing="0";L.style.fontSize="10pt";L.style.width="100%";L.style.padding="10px";var Q=document.createElement("tbody"),c=document.createElement("tr"),f=document.createElement("td");f.setAttribute("valig","top");f.style.width="40px";if(null!=F){var k=document.createElement("img");k.setAttribute("width",-"40");k.setAttribute("height","40");k.setAttribute("border","0");k.setAttribute("src",F);k.style.marginRight="6px";f.appendChild(k)}c.appendChild(f);f=document.createElement("td");f.setAttribute("valign","middle");f.style.whiteSpace="nowrap";f.style.maxWidth="0";f.style.overflow="hidden";f.style.textOverflow="ellipsis";mxUtils.write(f,z.displayName);null!=z.email&&(mxUtils.br(f),F=document.createElement("small"),F.style.color="gray",mxUtils.write(F,z.email),f.appendChild(F));null!=M&&(z=document.createElement("div"),-z.style.marginTop="4px",F=document.createElement("i"),mxUtils.write(F,M),z.appendChild(F),f.appendChild(z));c.appendChild(f);Q.appendChild(c);L.appendChild(Q);this.userPanel.appendChild(L);z=document.createElement("div");z.style.textAlign="center";z.style.padding="10px";z.style.whiteSpace="nowrap";null!=K&&(K=mxUtils.button(mxResources.get("signOut"),K),K.className="geBtn",z.appendChild(K));this.userPanel.appendChild(z)}});null!=this.dropbox&&b(this.dropbox.getUser(),IMAGE_PATH+"/dropbox-logo.svg",-mxUtils.bind(this,function(){var z=this.getCurrentFile();if(null!=z&&z.constructor==DropboxFile){var F=mxUtils.bind(this,function(){this.dropbox.logout();window.location.hash=""});z.isModified()?this.confirm(mxResources.get("allChangesLost"),null,F,mxResources.get("cancel"),mxResources.get("discardChanges")):F()}else this.dropbox.logout()}),mxResources.get("dropbox"));null!=this.oneDrive&&b(this.oneDrive.getUser(),IMAGE_PATH+"/onedrive-logo.svg",this.oneDrive.noLogout?null:mxUtils.bind(this,function(){var z=-this.getCurrentFile();if(null==z||z.constructor!=OneDriveFile||z.isSP)this.oneDrive.logout();else{var F=mxUtils.bind(this,function(){this.oneDrive.logout();window.location.hash=""});z.isModified()?this.confirm(mxResources.get("allChangesLost"),null,F,mxResources.get("cancel"),mxResources.get("discardChanges")):F()}}),mxResources.get("oneDrive"));null!=this.m365&&b(this.m365.getUser(),IMAGE_PATH+"/onedrive-logo.svg",this.m365.noLogout?null:mxUtils.bind(this,function(){var z=this.getCurrentFile();if(null!=-z&&z.constructor==OneDriveFile&&z.isSP){var F=mxUtils.bind(this,function(){this.m365.logout();window.location.hash=""});z.isModified()?this.confirm(mxResources.get("allChangesLost"),null,F,mxResources.get("cancel"),mxResources.get("discardChanges")):F()}else this.m365.logout()}),mxResources.get("m365"));null!=this.gitHub&&b(this.gitHub.getUser(),IMAGE_PATH+"/github-logo.svg",mxUtils.bind(this,function(){var z=this.getCurrentFile();if(null!=z&&z.constructor==GitHubFile){var F=mxUtils.bind(this,function(){this.gitHub.logout();-window.location.hash=""});z.isModified()?this.confirm(mxResources.get("allChangesLost"),null,F,mxResources.get("cancel"),mxResources.get("discardChanges")):F()}else this.gitHub.logout()}),mxResources.get("github"));null!=this.gitLab&&b(this.gitLab.getUser(),IMAGE_PATH+"/gitlab-logo.svg",mxUtils.bind(this,function(){var z=this.getCurrentFile();if(null!=z&&z.constructor==GitLabFile){var F=mxUtils.bind(this,function(){this.gitLab.logout();window.location.hash=""});z.isModified()?this.confirm(mxResources.get("allChangesLost"),-null,F,mxResources.get("cancel"),mxResources.get("discardChanges")):F()}else this.gitLab.logout()}),mxResources.get("gitlab"));null!=this.trello&&b(this.trello.getUser(),IMAGE_PATH+"/trello-logo.svg",mxUtils.bind(this,function(){var z=this.getCurrentFile();if(null!=z&&z.constructor==TrelloFile){var F=mxUtils.bind(this,function(){this.trello.logout();window.location.hash=""});z.isModified()?this.confirm(mxResources.get("allChangesLost"),null,F,mxResources.get("cancel"),mxResources.get("discardChanges")):-F()}else this.trello.logout()}),mxResources.get("trello"));"min"==uiTheme&&(x=this.getCurrentFile(),null!=x&&x.isRealtimeEnabled()&&x.isRealtimeSupported()&&(b=document.createElement("div"),b.style.padding="10px",b.style.whiteSpace="nowrap",b.style.borderTop="1px solid rgb(224, 224, 224)",b.style.marginTop="4px",b.style.textAlign="center",b.style.padding="10px",b.style.fontSize="9pt",B=x.getRealtimeError(),1!=x.getRealtimeState()&&(mxUtils.write(b,mxResources.get("realtimeCollaboration")+": "+(null!=-B&&null!=B.message?B.message:mxResources.get("disconnected"))),this.userPanel.appendChild(b))));document.body.appendChild(this.userPanel)}};+x.className="geBtn";x.style.float="right";b.appendChild(x);x=mxUtils.button(mxResources.get("addAccount"),mxUtils.bind(this,function(){var y=this.drive.createAuthWin();y.blur();window.focus();g(mxUtils.bind(this,function(){this.stateArg=null;this.drive.authorize(!1,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(G){this.handleError(G)}),!0,y)}),mxResources.get("closingFile")+"...")}));x.className="geBtn";x.style.margin="0px";+b.appendChild(x);this.userPanel.appendChild(b)}}b=mxUtils.bind(this,function(y,G,L,O){if(null!=y){l&&this.userPanel.appendChild(document.createElement("hr"));l=!0;var J=document.createElement("table");J.style.borderSpacing="0";J.style.fontSize="10pt";J.style.width="100%";J.style.padding="10px";var Q=document.createElement("tbody"),c=document.createElement("tr"),f=document.createElement("td");f.setAttribute("valig","top");f.style.width="40px";if(null!=G){var k=document.createElement("img");k.setAttribute("width",+"40");k.setAttribute("height","40");k.setAttribute("border","0");k.setAttribute("src",G);k.style.marginRight="6px";f.appendChild(k)}c.appendChild(f);f=document.createElement("td");f.setAttribute("valign","middle");f.style.whiteSpace="nowrap";f.style.maxWidth="0";f.style.overflow="hidden";f.style.textOverflow="ellipsis";mxUtils.write(f,y.displayName);null!=y.email&&(mxUtils.br(f),G=document.createElement("small"),G.style.color="gray",mxUtils.write(G,y.email),f.appendChild(G));null!=O&&(y=document.createElement("div"),+y.style.marginTop="4px",G=document.createElement("i"),mxUtils.write(G,O),y.appendChild(G),f.appendChild(y));c.appendChild(f);Q.appendChild(c);J.appendChild(Q);this.userPanel.appendChild(J);y=document.createElement("div");y.style.textAlign="center";y.style.padding="10px";y.style.whiteSpace="nowrap";null!=L&&(L=mxUtils.button(mxResources.get("signOut"),L),L.className="geBtn",y.appendChild(L));this.userPanel.appendChild(y)}});null!=this.dropbox&&b(this.dropbox.getUser(),IMAGE_PATH+"/dropbox-logo.svg",+mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null!=y&&y.constructor==DropboxFile){var G=mxUtils.bind(this,function(){this.dropbox.logout();window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,G,mxResources.get("cancel"),mxResources.get("discardChanges")):G()}else this.dropbox.logout()}),mxResources.get("dropbox"));null!=this.oneDrive&&b(this.oneDrive.getUser(),IMAGE_PATH+"/onedrive-logo.svg",this.oneDrive.noLogout?null:mxUtils.bind(this,function(){var y=+this.getCurrentFile();if(null==y||y.constructor!=OneDriveFile||y.isSP)this.oneDrive.logout();else{var G=mxUtils.bind(this,function(){this.oneDrive.logout();window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,G,mxResources.get("cancel"),mxResources.get("discardChanges")):G()}}),mxResources.get("oneDrive"));null!=this.m365&&b(this.m365.getUser(),IMAGE_PATH+"/onedrive-logo.svg",this.m365.noLogout?null:mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null!=+y&&y.constructor==OneDriveFile&&y.isSP){var G=mxUtils.bind(this,function(){this.m365.logout();window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,G,mxResources.get("cancel"),mxResources.get("discardChanges")):G()}else this.m365.logout()}),mxResources.get("m365"));null!=this.gitHub&&b(this.gitHub.getUser(),IMAGE_PATH+"/github-logo.svg",mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null!=y&&y.constructor==GitHubFile){var G=mxUtils.bind(this,function(){this.gitHub.logout();+window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,G,mxResources.get("cancel"),mxResources.get("discardChanges")):G()}else this.gitHub.logout()}),mxResources.get("github"));null!=this.gitLab&&b(this.gitLab.getUser(),IMAGE_PATH+"/gitlab-logo.svg",mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null!=y&&y.constructor==GitLabFile){var G=mxUtils.bind(this,function(){this.gitLab.logout();window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),+null,G,mxResources.get("cancel"),mxResources.get("discardChanges")):G()}else this.gitLab.logout()}),mxResources.get("gitlab"));null!=this.trello&&b(this.trello.getUser(),IMAGE_PATH+"/trello-logo.svg",mxUtils.bind(this,function(){var y=this.getCurrentFile();if(null!=y&&y.constructor==TrelloFile){var G=mxUtils.bind(this,function(){this.trello.logout();window.location.hash=""});y.isModified()?this.confirm(mxResources.get("allChangesLost"),null,G,mxResources.get("cancel"),mxResources.get("discardChanges")):+G()}else this.trello.logout()}),mxResources.get("trello"));"min"==uiTheme&&(x=this.getCurrentFile(),null!=x&&x.isRealtimeEnabled()&&x.isRealtimeSupported()&&(b=document.createElement("div"),b.style.padding="10px",b.style.whiteSpace="nowrap",b.style.borderTop="1px solid rgb(224, 224, 224)",b.style.marginTop="4px",b.style.textAlign="center",b.style.padding="10px",b.style.fontSize="9pt",A=x.getRealtimeError(),1!=x.getRealtimeState()&&(mxUtils.write(b,mxResources.get("realtimeCollaboration")+": "+(null!=+A&&null!=A.message?A.message:mxResources.get("disconnected"))),this.userPanel.appendChild(b))));document.body.appendChild(this.userPanel)}};App.prototype.getCurrentUser=function(){var b=null;null!=this.drive&&null!=this.drive.getUser()?b=this.drive.getUser():null!=this.oneDrive&&null!=this.oneDrive.getUser()?b=this.oneDrive.getUser():null!=this.m365&&null!=this.m365.getUser()?b=this.m365.getUser():null!=this.dropbox&&null!=this.dropbox.getUser()?b=this.dropbox.getUser():null!=this.gitHub&&null!=this.gitHub.getUser()&&(b=this.gitHub.getUser());return b};var editorResetGraph=Editor.prototype.resetGraph;-Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);null==this.graph.defaultPageFormat&&(this.graph.pageFormat=mxSettings.getPageFormat())};(function(){var b=mxPopupMenu.prototype.showMenu;mxPopupMenu.prototype.showMenu=function(){this.div.style.overflowY="auto";this.div.style.overflowX="hidden";this.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-(EditorUi.isElectronApp?50:10)+"px";b.apply(this,arguments)};Menus.layoutContainers=function(){var p=function(x,B){B.resizeLayoutRoot=!0;B.resizeNodes=!1;return"childLayout="+Graph.encodeChildLayout([{layout:x,config:B}])+";"},g=function(x,B,z,-F){return{width:B,height:z,style:"group;connectable=0;transparentBounds=1;groupPadding=20;"+F,sidebarStyle:"swimlane;html=1;startSize=20;horizontal="+(x?"0":"1")+";resizable=0;fontSize=12;transparentBounds=1;groupPadding=20;"+F}};return{horizontalFlow:g(!0,460,150,"containerType=tree;"+p("elkLayered",{"elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.padding":"[top=20,left=40,bottom=20,right=20]",edgeStyle:"orthogonalEdgeStyle",corners:"rounded",extractIsolated:!1})),verticalFlow:g(!1,+Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);null==this.graph.defaultPageFormat&&(this.graph.pageFormat=mxSettings.getPageFormat())};(function(){var b=mxPopupMenu.prototype.showMenu;mxPopupMenu.prototype.showMenu=function(){this.div.style.overflowY="auto";this.div.style.overflowX="hidden";this.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-(EditorUi.isElectronApp?50:10)+"px";b.apply(this,arguments)};Menus.layoutContainers=function(){var p=function(x,A){A.resizeLayoutRoot=!0;A.resizeNodes=!1;return"childLayout="+Graph.encodeChildLayout([{layout:x,config:A}])+";"},g=function(x,A,y,+G){return{width:A,height:y,style:"group;connectable=0;transparentBounds=1;groupPadding=20;"+G,sidebarStyle:"swimlane;html=1;startSize=20;horizontal="+(x?"0":"1")+";resizable=0;fontSize=12;transparentBounds=1;groupPadding=20;"+G}};return{horizontalFlow:g(!0,460,150,"containerType=tree;"+p("elkLayered",{"elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.padding":"[top=20,left=40,bottom=20,right=20]",edgeStyle:"orthogonalEdgeStyle",corners:"rounded",extractIsolated:!1})),verticalFlow:g(!1,270,280,"containerType=tree;"+p("elkLayered",{"elk.direction":"DOWN","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.padding":"[top=40,left=20,bottom=20,right=20]",edgeStyle:"orthogonalEdgeStyle",corners:"rounded",extractIsolated:!1})),horizontalTree:g(!0,300,160,"containerType=tree;"+p("elkTree",{"elk.direction":"RIGHT","elk.spacing.nodeNode":"40","elk.spacing.edgeNode":"20","elk.padding":"[top=20,left=40,bottom=20,right=20]",corners:"rounded"})),verticalTree:g(!1,280,180,"containerType=tree;"+p("elkTree",{"elk.direction":"DOWN","elk.spacing.nodeNode":"40","elk.spacing.edgeNode":"20","elk.padding":"[top=40,left=20,bottom=20,right=20]",corners:"rounded"})),radialTree:g(!1,320,320,"containerType=tree;"+p("elkRadial",{"elk.padding":"[top=40,left=20,bottom=20,right=20]"})),organic:g(!1,320,320,p("elkOrganic",{"elk.padding":"[top=40,left=20,bottom=20,right=20]"})),circle:g(!1,320,320,"childLayout=circleLayout;")}}();Menus.layoutContainerEdgeStyle="html=1;rounded=1;curved=0;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startSize=6;endSize=6;";Menus.prototype.createHelpLink=function(p){return this.editorUi.createHelpIcon(p)};Menus.prototype.addLinkToItem=function(p,g){null!=p&&p.firstChild.nextSibling.appendChild(this.createHelpLink(g))};Menus.prototype.removeCustomFont=function(p,g){for(var x=0;x<this.customFonts.length;x++)if(this.customFonts[x].name==p&&this.customFonts[x].url==g){this.customFonts.splice(x,1);this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts));break}};Menus.prototype.containsFont=-function(p,g){for(var x=0;x<this.customFonts.length;x++)if(this.customFonts[x].name==p&&this.customFonts[x].url==g)return!0;for(x=0;x<this.defaultFonts.length;x++){var B=this.defaultFonts[x];if("string"!==typeof B&&B.fontFamily==p&&B.fontUrl==g||"string"===typeof B&&B==p&&null==g)return!0}return!1};Menus.prototype.addCustomFont=function(p,g){null==p||this.containsFont(p,g)||(this.customFonts.push({name:p,url:g}),this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts)))};-var l=Menus.prototype.init;Menus.prototype.init=function(){function p(v,d,m){g.editor.isExportToCanvas()?g.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(r,A,D,G,O,P,V,Y,H,W,Z,X,ba,ea,aa,ha){ea=parseInt(r);!isNaN(ea)&&0<ea&&(g.exportImage(ea/100,A&&"png"==v,D,G,O&&"png"==v,V,!Y,H,v,Z,"png"==v?ha:null,X,ba),null!=m&&m(r,A,D,G,O,P,V,Y,H,W,Z,X,ba))}),!0,d,v,!0):g.isOffline()||mxClient.IS_IOS&&navigator.standalone||-g.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(r,A,D,G,O){g.downloadFile(A&&"png"==v?"xmlpng":v,null,null,r,null,null,D,G,O)}),!1,!0)}l.apply(this,arguments);var g=this.editorUi,x=g.editor.graph,B=mxUtils.bind(x,x.isEnabled);"1"==urlParams.noFileMenu&&(this.defaultMenuItems=this.defaultMenuItems.filter(function(v){return"file"!=v}));g.actions.addAction("new...",function(){var v=g.isOffline(),d=new NewDialog(g,v,!(g.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in-window));g.showDialog(d.container,v?350:620,v?70:460,!0,!0,function(m){null!=g.sidebar&&g.sidebar.hideTooltip();m&&null==g.getCurrentFile()&&g.showSplash()});d.init()});g.actions.put("insertTemplate",new Action("template...",function(){g.openTemplateDialog()})).isEnabled=B;var z=mxResources.get("page");g.actions.put("insertPage",new Action(mxResources.get("insertPage"),function(){try{g.insertPage()}catch(v){g.handleError(v)}})).isEnabled=function(){return null!=g.currentPage};g.actions.put("removePage",-new Action(mxResources.get("removeIt",[z]),function(){g.removePage(g.currentPage)})).isEnabled=function(){return null!=g.currentPage};g.actions.put("renamePage",new Action(mxResources.get("renameIt",[z])+"...",function(){g.renamePage(g.currentPage)})).isEnabled=function(){return null!=g.currentPage};g.actions.put("duplicatePage",new Action(mxResources.get("duplicateIt",[z]),function(){var v=g.currentPage;g.duplicatePage(v,mxResources.get("copyOf",[v.getName()]))})).isEnabled=function(){return null!=-g.currentPage};g.actions.put("sortPages",new Action(mxResources.get("sortPages"),function(){g.sortPages()})).isEnabled=function(){return null!=g.pages&&1<g.pages.length&&g.editor.graph.isEnabled()};z=g.actions.addAction("shareCursor",function(){g.setShareCursorPosition(!g.isShareCursorPosition())});z.setToggleAction(!0);z.setSelectedCallback(function(){return g.isShareCursorPosition()});z=g.actions.addAction("showRemoteCursors",function(){g.setShowRemoteCursors(!g.isShowRemoteCursors())});z.setToggleAction(!0);-z.setSelectedCallback(function(){return g.isShowRemoteCursors()});z=g.actions.addAction("points",function(){g.editor.graph.view.setUnit(mxConstants.POINTS)});z.setToggleAction(!0);z.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.POINTS});z=g.actions.addAction("inches",function(){g.editor.graph.view.setUnit(mxConstants.INCHES)});z.setToggleAction(!0);z.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.INCHES});z=g.actions.addAction("millimeters",-function(){g.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});z.setToggleAction(!0);z.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.MILLIMETERS});z=g.actions.addAction("meters",function(){g.editor.graph.view.setUnit(mxConstants.METERS)});z.setToggleAction(!0);z.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.METERS});this.put("units",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,["points","inches","millimeters","meters"],-d);"min"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme||g.menus.addMenuItems(v,["-","pageScale"],d)})));z=g.actions.addAction("pageTabs",function(){g.setTabContainerVisible(!g.isTabContainerVisible(),!0)});z.setToggleAction(!0);z.setSelectedCallback(function(){return g.isTabContainerVisible()});z=g.actions.addAction("ruler",function(){g.setRulerVisible(!g.isRulerVisible())});z.setEnabled(Editor.canvasSupported&&9!=document.documentMode);z.setToggleAction(!0);z.setSelectedCallback(function(){return g.isRulerVisible()});-z=g.actions.addAction("fullscreen",function(){if("1"==urlParams.embedInline)g.setInlineFullscreen(!Editor.inlineFullscreen);else{var v=mxUtils.isAncestorNode(document.body,g.container)?g.container:g.editor.graph.container;null!=v&&(null==document.fullscreenElement?(document.body.requestFullscreen(),v.classList.add("geFullscreen")):(document.exitFullscreen(),v.classList.remove("geFullscreen")))}});z.visible="1"==urlParams.embedInline||window==window.top&&document.fullscreenEnabled&&null!=document.body.requestFullscreen;-z.setToggleAction(!0);z.setSelectedCallback(function(){return"1"==urlParams.embedInline?Editor.inlineFullscreen:null!=document.fullscreenElement});z=g.actions.put("lightMode",new Action("light",function(v){g.setAndPersistDarkMode(!1)}));z.setToggleAction(!0);z.setSelectedCallback(function(){return!g.isAutoDarkMode(!0)&&!Editor.isDarkMode()});z=g.actions.put("darkMode",new Action("dark",function(v){g.setAndPersistDarkMode(!0)}));z.setToggleAction(!0);z.setSelectedCallback(function(){return!g.isAutoDarkMode(!0)&&-Editor.isDarkMode()});z=g.actions.put("autoMode",new Action("automatic",function(v){g.setAndPersistDarkMode("auto")}));z.setToggleAction(!0);z.setSelectedCallback(function(){return g.isAutoDarkMode(!0)});g.actions.addAction("properties...",function(){g.getPublicUrl(g.getCurrentFile(),function(v){v=new FilePropertiesDialog(g,v);g.showDialog(v.container,360,null,!0,!0);v.init()})}).isEnabled=B;window.mxFreehand&&(z=g.actions.put("insertFreehand",new Action("freehand",function(){if(x.isEnabled()){if(null==+function(p,g){for(var x=0;x<this.customFonts.length;x++)if(this.customFonts[x].name==p&&this.customFonts[x].url==g)return!0;for(x=0;x<this.defaultFonts.length;x++){var A=this.defaultFonts[x];if("string"!==typeof A&&A.fontFamily==p&&A.fontUrl==g||"string"===typeof A&&A==p&&null==g)return!0}return!1};Menus.prototype.addCustomFont=function(p,g){null==p||this.containsFont(p,g)||(this.customFonts.push({name:p,url:g}),this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts)))};+var l=Menus.prototype.init;Menus.prototype.init=function(){function p(v,d,m){g.editor.isExportToCanvas()?g.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(r,z,D,F,N,P,V,X,H,W,Z,Y,ba,ea,aa,ha){ea=parseInt(r);!isNaN(ea)&&0<ea&&(g.exportImage(ea/100,z&&"png"==v,D,F,N&&"png"==v,V,!X,H,v,Z,"png"==v?ha:null,Y,ba),null!=m&&m(r,z,D,F,N,P,V,X,H,W,Z,Y,ba))}),!0,d,v,!0):g.isOffline()||mxClient.IS_IOS&&navigator.standalone||+g.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(r,z,D,F,N){g.downloadFile(z&&"png"==v?"xmlpng":v,null,null,r,null,null,D,F,N)}),!1,!0)}l.apply(this,arguments);var g=this.editorUi,x=g.editor.graph,A=mxUtils.bind(x,x.isEnabled);"1"==urlParams.noFileMenu&&(this.defaultMenuItems=this.defaultMenuItems.filter(function(v){return"file"!=v}));g.actions.addAction("new...",function(){var v=g.isOffline(),d=new NewDialog(g,v,!(g.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in+window));g.showDialog(d.container,v?350:620,v?70:460,!0,!0,function(m){null!=g.sidebar&&g.sidebar.hideTooltip();m&&null==g.getCurrentFile()&&g.showSplash()});d.init()});g.actions.put("insertTemplate",new Action("template...",function(){g.openTemplateDialog()})).isEnabled=A;var y=mxResources.get("page");g.actions.put("insertPage",new Action(mxResources.get("insertPage"),function(){try{g.insertPage()}catch(v){g.handleError(v)}})).isEnabled=function(){return null!=g.currentPage};g.actions.put("removePage",+new Action(mxResources.get("removeIt",[y]),function(){g.removePage(g.currentPage)})).isEnabled=function(){return null!=g.currentPage};g.actions.put("renamePage",new Action(mxResources.get("renameIt",[y])+"...",function(){g.renamePage(g.currentPage)})).isEnabled=function(){return null!=g.currentPage};g.actions.put("duplicatePage",new Action(mxResources.get("duplicateIt",[y]),function(){var v=g.currentPage;g.duplicatePage(v,mxResources.get("copyOf",[v.getName()]))})).isEnabled=function(){return null!=+g.currentPage};g.actions.put("sortPages",new Action(mxResources.get("sortPages"),function(){g.sortPages()})).isEnabled=function(){return null!=g.pages&&1<g.pages.length&&g.editor.graph.isEnabled()};y=g.actions.addAction("shareCursor",function(){g.setShareCursorPosition(!g.isShareCursorPosition())});y.setToggleAction(!0);y.setSelectedCallback(function(){return g.isShareCursorPosition()});y=g.actions.addAction("showRemoteCursors",function(){g.setShowRemoteCursors(!g.isShowRemoteCursors())});y.setToggleAction(!0);+y.setSelectedCallback(function(){return g.isShowRemoteCursors()});y=g.actions.addAction("points",function(){g.editor.graph.view.setUnit(mxConstants.POINTS)});y.setToggleAction(!0);y.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.POINTS});y=g.actions.addAction("inches",function(){g.editor.graph.view.setUnit(mxConstants.INCHES)});y.setToggleAction(!0);y.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.INCHES});y=g.actions.addAction("millimeters",+function(){g.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});y.setToggleAction(!0);y.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.MILLIMETERS});y=g.actions.addAction("meters",function(){g.editor.graph.view.setUnit(mxConstants.METERS)});y.setToggleAction(!0);y.setSelectedCallback(function(){return g.editor.graph.view.unit==mxConstants.METERS});this.put("units",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,["points","inches","millimeters","meters"],+d);"min"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme||g.menus.addMenuItems(v,["-","pageScale"],d)})));y=g.actions.addAction("pageTabs",function(){g.setTabContainerVisible(!g.isTabContainerVisible(),!0)});y.setToggleAction(!0);y.setSelectedCallback(function(){return g.isTabContainerVisible()});y=g.actions.addAction("ruler",function(){g.setRulerVisible(!g.isRulerVisible())});y.setEnabled(Editor.canvasSupported&&9!=document.documentMode);y.setToggleAction(!0);y.setSelectedCallback(function(){return g.isRulerVisible()});+y=g.actions.addAction("fullscreen",function(){if("1"==urlParams.embedInline)g.setInlineFullscreen(!Editor.inlineFullscreen);else{var v=mxUtils.isAncestorNode(document.body,g.container)?g.container:g.editor.graph.container;null!=v&&(null==document.fullscreenElement?(document.body.requestFullscreen(),v.classList.add("geFullscreen")):(document.exitFullscreen(),v.classList.remove("geFullscreen")))}});y.visible="1"==urlParams.embedInline||window==window.top&&document.fullscreenEnabled&&null!=document.body.requestFullscreen;+y.setToggleAction(!0);y.setSelectedCallback(function(){return"1"==urlParams.embedInline?Editor.inlineFullscreen:null!=document.fullscreenElement});y=g.actions.put("lightMode",new Action("light",function(v){g.setAndPersistDarkMode(!1)}));y.setToggleAction(!0);y.setSelectedCallback(function(){return!g.isAutoDarkMode(!0)&&!Editor.isDarkMode()});y=g.actions.put("darkMode",new Action("dark",function(v){g.setAndPersistDarkMode(!0)}));y.setToggleAction(!0);y.setSelectedCallback(function(){return!g.isAutoDarkMode(!0)&&+Editor.isDarkMode()});y=g.actions.put("autoMode",new Action("automatic",function(v){g.setAndPersistDarkMode("auto")}));y.setToggleAction(!0);y.setSelectedCallback(function(){return g.isAutoDarkMode(!0)});g.actions.addAction("properties...",function(){g.getPublicUrl(g.getCurrentFile(),function(v){v=new FilePropertiesDialog(g,v);g.showDialog(v.container,360,null,!0,!0);v.init()})}).isEnabled=A;window.mxFreehand&&(y=g.actions.put("insertFreehand",new Action("freehand",function(){if(x.isEnabled()){if(null==g.freehandWindow){var v=mxSettings.getWindowState("freehand");g.freehandWindow=new FreehandWindow(g,null!=v&&null!=v.x?v.x:document.body.offsetWidth-420,null!=v&&null!=v.y?v.y:102,null!=v&&null!=v.w?v.w:180,null!=v&&null!=v.h?v.h:126,!0);g.installWindowPersistence("freehand",g.freehandWindow);null!=v&&g.restoreWindowState("freehand",g.freehandWindow)}x.freehand.isDrawing()?x.freehand.stopDrawing():x.freehand.startDrawing();g.freehandWindow.window.setVisible(x.freehand.isDrawing())}},null,null,"X")),-z.isEnabled=function(){return B()},z.setToggleAction(!0),z.setSelectedCallback(function(){return null!=g.freehandWindow&&g.freehandWindow.window.isVisible()}));g.actions.put("exportXml",new Action("formatXml...",function(){var v=document.createElement("div");v.style.whiteSpace="nowrap";var d=null==g.pages||1>=g.pages.length,m=document.createElement("h3");mxUtils.write(m,mxResources.get("formatXml"));v.appendChild(m);m=document.createElement("div");m.className="geDialogSection";var r=g.addCheckbox(m,-mxResources.get("selectionOnly"),!1,x.isSelectionEmpty(),null,null,null,null,!0),A=g.addCheckbox(m,mxResources.get("allPages"),!d,d,null,null,null,null,!0),D=g.addCheckbox(m,mxResources.get("compressed"),Editor.defaultCompressed,null,null,null,null,null,!0);v.appendChild(m);mxEvent.addListener(r,"change",function(){r.checked?A.setAttribute("disabled","disabled"):A.removeAttribute("disabled")});v=new CustomDialog(g,v,mxUtils.bind(this,function(){g.downloadFile("xml",!D.checked,null,!r.checked,d||!A.checked)}),-null,mxResources.get("export"));g.showDialog(v.container,300,null,!0,!0)}));Editor.enableExportUrl&&g.actions.put("exportUrl",new Action("url...",function(){g.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(v,d,m,r,A,D,G,O,P,V,Y,H,W,Z,X,ba){G=[];r&&P&&(P=Z?g.getHiddenTagsMap():null,G.push("tags="+encodeURIComponent(JSON.stringify(P||{}))));v=new EmbedDialog(g,g.createLink(v,d,W,r,A,D,null,!0,G,null,m,null,H,X,ba));g.showDialog(v.container,450,270,!0,!0,null,-!1,null,new mxRectangle(0,0,400,250));v.init()},null,!0,!0)}));g.actions.put("exportJson",new Action("formatJson...",function(){var v=document.createElement("div");v.style.whiteSpace="nowrap";var d=null==g.pages||1>=g.pages.length,m=document.createElement("h3");mxUtils.write(m,mxResources.get("formatJson"));v.appendChild(m);m=document.createElement("div");m.className="geDialogSection";var r=g.editor.graph,A=g.addCheckbox(m,mxResources.get("selectionOnly"),!1,r.isSelectionEmpty(),null,null,null,null,-!0),D=g.addCheckbox(m,mxResources.get("allPages"),!d,d,null,null,null,null,!0),G=g.addCheckbox(m,mxResources.get("includeCopyOfMyDiagram"),!1,null,null,null,null,null,!0),O=g.addCheckbox(m,mxResources.get("compressed"),Editor.defaultCompressed,!0,null,null,null,null,!0);v.appendChild(m);mxEvent.addListener(A,"change",function(){A.checked?D.setAttribute("disabled","disabled"):d||D.removeAttribute("disabled")});mxEvent.addListener(G,"change",function(){G.checked?O.removeAttribute("disabled"):O.setAttribute("disabled",-"disabled")});v=new CustomDialog(g,v,mxUtils.bind(this,function(){var P=A.checked&&!r.isSelectionEmpty(),V=!P&&!d&&D.checked;P=g.createJsonForExport(V,G.checked,G.checked&&O.checked,P);g.saveData(g.getBaseFilename(V)+".json","json",JSON.stringify(P,null,2),"application/json")}),null,mxResources.get("export"));g.showDialog(v.container,300,null,!0,!0)}));g.actions.put("exportHtml",new Action("formatHtmlEmbedded...",function(){g.getPublicUrl(g.getCurrentFile(),function(v){g.showHtmlDialog(mxResources.get("export"),-"https://www.drawio.com/docs/manual/export/embed-html/",v,function(d,m,r,A,D,G,O,P,V,Y,H,W,Z,X,ba){g.createHtml(d,m,r,A,D,G,O,P,V,Y,H,mxUtils.bind(this,function(ea,aa){var ha=g.getBaseFilename(O);ea='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(ha)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+ea+"\n"+aa+"\n</body>\n</html>";g.saveData(ha+(".drawio"==ha.substring(ha.lenth-7)?"":".drawio")+-".html","html",ea,"text/html")}),W,Z,X,ba)})})}));g.actions.put("exportPdf",new Action("formatPdf...",function(){g.showPrintDialog(mxResources.get("formatPdf"),EditorUi.isElectronApp||!g.isOffline()&&!g.printPdfExport?mxUtils.bind(this,function(v,d){v=null!=g.pages?g.pages.length:1;var m=null==g.pages||1>=g.pages.length,r=g.getPageIndex(g.currentPage);r=null!=r?r+1:1;g.downloadFile("pdf",null,null,!d.selection,m||!d.allPages&&d.pagesFrom==r&&d.pagesTo==r,!d.crop,d.transparent,d.scale,null,d.grid,+y.isEnabled=function(){return A()},y.setToggleAction(!0),y.setSelectedCallback(function(){return null!=g.freehandWindow&&g.freehandWindow.window.isVisible()}));g.actions.put("exportXml",new Action("formatXml...",function(){var v=document.createElement("div");v.style.whiteSpace="nowrap";var d=null==g.pages||1>=g.pages.length,m=document.createElement("h3");mxUtils.write(m,mxResources.get("formatXml"));v.appendChild(m);m=document.createElement("div");m.className="geDialogSection";var r=g.addCheckbox(m,+mxResources.get("selectionOnly"),!1,x.isSelectionEmpty(),null,null,null,null,!0),z=g.addCheckbox(m,mxResources.get("allPages"),!d,d,null,null,null,null,!0),D=g.addCheckbox(m,mxResources.get("compressed"),Editor.defaultCompressed,null,null,null,null,null,!0);v.appendChild(m);mxEvent.addListener(r,"change",function(){r.checked?z.setAttribute("disabled","disabled"):z.removeAttribute("disabled")});v=new CustomDialog(g,v,mxUtils.bind(this,function(){g.downloadFile("xml",!D.checked,null,!r.checked,d||!z.checked)}),+null,mxResources.get("export"));g.showDialog(v.container,300,null,!0,!0)}));Editor.enableExportUrl&&g.actions.put("exportUrl",new Action("url...",function(){g.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(v,d,m,r,z,D,F,N,P,V,X,H,W,Z,Y,ba){F=[];r&&P&&(P=Z?g.getHiddenTagsMap():null,F.push("tags="+encodeURIComponent(JSON.stringify(P||{}))));v=new EmbedDialog(g,g.createLink(v,d,W,r,z,D,null,!0,F,null,m,null,H,Y,ba));g.showDialog(v.container,450,270,!0,!0,null,+!1,null,new mxRectangle(0,0,400,250));v.init()},null,!0,!0)}));g.actions.put("exportJson",new Action("formatJson...",function(){var v=document.createElement("div");v.style.whiteSpace="nowrap";var d=null==g.pages||1>=g.pages.length,m=document.createElement("h3");mxUtils.write(m,mxResources.get("formatJson"));v.appendChild(m);m=document.createElement("div");m.className="geDialogSection";var r=g.editor.graph,z=g.addCheckbox(m,mxResources.get("selectionOnly"),!1,r.isSelectionEmpty(),null,null,null,null,+!0),D=g.addCheckbox(m,mxResources.get("allPages"),!d,d,null,null,null,null,!0),F=g.addCheckbox(m,mxResources.get("includeCopyOfMyDiagram"),!1,null,null,null,null,null,!0),N=g.addCheckbox(m,mxResources.get("compressed"),Editor.defaultCompressed,!0,null,null,null,null,!0);v.appendChild(m);mxEvent.addListener(z,"change",function(){z.checked?D.setAttribute("disabled","disabled"):d||D.removeAttribute("disabled")});mxEvent.addListener(F,"change",function(){F.checked?N.removeAttribute("disabled"):N.setAttribute("disabled",+"disabled")});v=new CustomDialog(g,v,mxUtils.bind(this,function(){var P=z.checked&&!r.isSelectionEmpty(),V=!P&&!d&&D.checked;P=g.createJsonForExport(V,F.checked,F.checked&&N.checked,P);g.saveData(g.getBaseFilename(V)+".json","json",JSON.stringify(P,null,2),"application/json")}),null,mxResources.get("export"));g.showDialog(v.container,300,null,!0,!0)}));g.actions.put("exportHtml",new Action("formatHtmlEmbedded...",function(){g.getPublicUrl(g.getCurrentFile(),function(v){g.showHtmlDialog(mxResources.get("export"),+"https://www.drawio.com/docs/manual/export/embed-html/",v,function(d,m,r,z,D,F,N,P,V,X,H,W,Z,Y,ba){g.createHtml(d,m,r,z,D,F,N,P,V,X,H,mxUtils.bind(this,function(ea,aa){var ha=g.getBaseFilename(N);ea='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(ha)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+ea+"\n"+aa+"\n</body>\n</html>";g.saveData(ha+(".drawio"==ha.substring(ha.lenth-7)?"":".drawio")++".html","html",ea,"text/html")}),W,Z,Y,ba)})})}));g.actions.put("exportPdf",new Action("formatPdf...",function(){g.showPrintDialog(mxResources.get("formatPdf"),EditorUi.isElectronApp||!g.isOffline()&&!g.printPdfExport?mxUtils.bind(this,function(v,d){v=null!=g.pages?g.pages.length:1;var m=null==g.pages||1>=g.pages.length,r=g.getPageIndex(g.currentPage);r=null!=r?r+1:1;g.downloadFile("pdf",null,null,!d.selection,m||!d.allPages&&d.pagesFrom==r&&d.pagesTo==r,!d.crop,d.transparent,d.scale,null,d.grid,d.includeCopy,d.allPages||d.pagesFrom==r&&d.pagesTo==r?null:{from:Math.max(0,Math.min(v-1,d.pagesFrom-1)),to:Math.max(0,Math.min(v-1,d.pagesTo-1))},d.border,d.fit,d.sheetsAcross,d.sheetsDown,d.shadows)}):null,mxResources.get("export"))}));g.actions.addAction("open...",function(){g.pickFile()});g.actions.addAction("close",function(){function v(){null!=d&&d.removeDraft();g.fileLoaded(new LocalFile(g,g.emptyDiagramXml,null,!0))}var d=g.getCurrentFile();null!=d&&d.isModified()?g.confirm(mxResources.get("allChangesLost"),null,v,mxResources.get("cancel"),mxResources.get("discardChanges")):v()});g.actions.addAction("extractText",function(v){v=x.getIndexableText(v||x.isSelectionEmpty()?null:x.getSelectionCells());v=new EmbedDialog(g,v,null,null,null,mxResources.get("extractText"));g.showDialog(v.container,450,240,!0,!0);v.init()});g.actions.addAction("editShape...",mxUtils.bind(this,function(){if(1==x.getSelectionCount()){var v=x.getSelectionCell(),d=x.view.getState(v);null!=d&&null!=d.shape&&null!=d.shape.stencil&&(v=new EditShapeDialog(g,v,mxResources.get("editShape")),g.showDialog(v.container,640,480,!0,!1,null,null,null,new mxRectangle(0,0,300,200)),v.init())}}));g.actions.addAction("revisionHistory...",function(){g.isRevisionHistorySupported()?g.spinner.spin(document.body,mxResources.get("loading"))&&g.getRevisions(mxUtils.bind(this,function(v,d){g.spinner.stop();v=new RevisionDialog(g,v,d);g.showDialog(v.container,640,480,!0,!0);v.init()}),mxUtils.bind(this,function(v){g.handleError(null!=v?v:mxResources.get("notAvailable"))})):-g.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});g.actions.addAction("createRevision",function(){g.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");z=g.actions.addAction("synchronize",function(){g.synchronizeCurrentFile("none"==DrawioFile.SYNC)},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");"none"==DrawioFile.SYNC&&(z.label=mxResources.get("refresh"));g.actions.addAction("upload...",function(){var v=g.getCurrentFile();null!=v&&(window.drawdata=-g.getFileData(),v=null!=v.getTitle()?v.getTitle():g.defaultFilename,g.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(g.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(v),null,!0))},null,null,null,navigator.onLine&&"1"!=urlParams.stealth&&"1"!=urlParams.lockdown);"undefined"!==typeof MathJax&&(z=g.actions.addAction("mathematicalTypesetting",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.mathEnabled=!g.isMathEnabled();-x.model.execute(v)}),z.setToggleAction(!0),z.setSelectedCallback(function(){return g.isMathEnabled()}),z.isEnabled=B);z=g.actions.put("defaultAdaptiveColors",new Action("defaultAdaptiveColors",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.adaptiveColors="default";x.model.execute(v)}));z.getTitle=function(){return mxResources.get("default")+" ("+mxResources.get(Graph.getDefaultAdaptiveColorsKey())+")"};z.setToggleAction(!0);z.setSelectedCallback(function(){return null==-x.adaptiveColors});z=g.actions.put("automaticAdaptiveColors",new Action("automatic",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.adaptiveColors="auto";x.model.execute(v)}));z.setToggleAction(!0);z.setSelectedCallback(function(){return"auto"==x.adaptiveColors});z=g.actions.put("simpleAdaptiveColors",new Action("simple",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.adaptiveColors="simple";x.model.execute(v)}));z.setToggleAction(!0);z.setSelectedCallback(function(){return"simple"==-x.adaptiveColors});z=g.actions.put("noAdaptiveColors",new Action("none",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.adaptiveColors="none";x.model.execute(v)}));z.setToggleAction(!0);z.setSelectedCallback(function(){return"none"==x.adaptiveColors});this.put("adaptiveColors",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,["defaultAdaptiveColors","-","automaticAdaptiveColors","simpleAdaptiveColors","noAdaptiveColors"],d)})));var F=g.actions.addAction("autosave",-function(){g.editor.setAutosave(!g.editor.autosave)});F.setToggleAction(!0);F.setSelectedCallback(function(){return F.isEnabled()&&g.editor.autosave});g.actions.addAction("editGeometry...",function(){for(var v=x.getSelectionCells(),d=[],m=0;m<v.length;m++)x.getModel().isVertex(v[m])&&d.push(v[m]);0<d.length&&(v=new EditGeometryDialog(g,d),g.showDialog(v.container,300,null,!0,!0),v.init())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+M");g.actions.addAction("copyStyle",function(){if(x.isEnabled()&&-1==x.getSelectionCount()){var v=x.getSelectionCell(),d=x.getCellStyle(v,!1);g.copiedStyle={};var m=[],r=[],A;for(A in d)m.push(d[A]),r.push(A);x.copyCellStyles([v],r,m,g.copiedStyle,g.copiedStyle,null,null,null,!0)}},null,null,Editor.altKey+"+C");g.actions.addAction("pasteStyle",function(){x.isEnabled()&&!x.isSelectionEmpty()&&null!=g.copiedStyle&&x.pasteCellStyles(x.includeDescendantParts(x.getSelectionCells()),g.copiedStyle,g.copiedStyle,!0)},null,null,Editor.altKey+"+V");g.actions.addAction("copyTextStyle",+g.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});g.actions.addAction("createRevision",function(){g.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");y=g.actions.addAction("synchronize",function(){g.synchronizeCurrentFile("none"==DrawioFile.SYNC)},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");"none"==DrawioFile.SYNC&&(y.label=mxResources.get("refresh"));g.actions.addAction("upload...",function(){var v=g.getCurrentFile();null!=v&&(window.drawdata=+g.getFileData(),v=null!=v.getTitle()?v.getTitle():g.defaultFilename,g.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(g.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(v),null,!0))},null,null,null,navigator.onLine&&"1"!=urlParams.stealth&&"1"!=urlParams.lockdown);"undefined"!==typeof MathJax&&(y=g.actions.addAction("mathematicalTypesetting",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.mathEnabled=!g.isMathEnabled();+x.model.execute(v)}),y.setToggleAction(!0),y.setSelectedCallback(function(){return g.isMathEnabled()}),y.isEnabled=A);y=g.actions.put("defaultAdaptiveColors",new Action("defaultAdaptiveColors",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.adaptiveColors="default";x.model.execute(v)}));y.getTitle=function(){return mxResources.get("default")+" ("+mxResources.get(Graph.getDefaultAdaptiveColorsKey())+")"};y.setToggleAction(!0);y.setSelectedCallback(function(){return null==+x.adaptiveColors});y=g.actions.put("automaticAdaptiveColors",new Action("automatic",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.adaptiveColors="auto";x.model.execute(v)}));y.setToggleAction(!0);y.setSelectedCallback(function(){return"auto"==x.adaptiveColors});y=g.actions.put("simpleAdaptiveColors",new Action("simple",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.adaptiveColors="simple";x.model.execute(v)}));y.setToggleAction(!0);y.setSelectedCallback(function(){return"simple"==+x.adaptiveColors});y=g.actions.put("noAdaptiveColors",new Action("none",function(){var v=new ChangePageSetup(g);v.ignoreColor=!0;v.ignoreImage=!0;v.adaptiveColors="none";x.model.execute(v)}));y.setToggleAction(!0);y.setSelectedCallback(function(){return"none"==x.adaptiveColors});this.put("adaptiveColors",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,["defaultAdaptiveColors","-","automaticAdaptiveColors","simpleAdaptiveColors","noAdaptiveColors"],d)})));var G=g.actions.addAction("autosave",+function(){g.editor.setAutosave(!g.editor.autosave)});G.setToggleAction(!0);G.setSelectedCallback(function(){return G.isEnabled()&&g.editor.autosave});g.actions.addAction("editGeometry...",function(){for(var v=x.getSelectionCells(),d=[],m=0;m<v.length;m++)x.getModel().isVertex(v[m])&&d.push(v[m]);0<d.length&&(v=new EditGeometryDialog(g,d),g.showDialog(v.container,300,null,!0,!0),v.init())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+M");g.actions.addAction("copyStyle",function(){if(x.isEnabled()&&+1==x.getSelectionCount()){var v=x.getSelectionCell(),d=x.getCellStyle(v,!1);g.copiedStyle={};var m=[],r=[],z;for(z in d)m.push(d[z]),r.push(z);x.copyCellStyles([v],r,m,g.copiedStyle,g.copiedStyle,null,null,null,!0)}},null,null,Editor.altKey+"+C");g.actions.addAction("pasteStyle",function(){x.isEnabled()&&!x.isSelectionEmpty()&&null!=g.copiedStyle&&x.pasteCellStyles(x.includeDescendantParts(x.getSelectionCells()),g.copiedStyle,g.copiedStyle,!0)},null,null,Editor.altKey+"+V");g.actions.addAction("copyTextStyle",function(){if(x.isEnabled()&&1==x.getSelectionCount()){var v=x.getSelectionCell();v=x.getCellStyle(v,!1);g.copiedTextStyle={};for(var d=0;d<Graph.pasteTextStyles.length;d++){var m=Graph.pasteTextStyles[d];null!=v[m]?g.copiedTextStyle[m]=v[m]:"fontStyle"==m&&(g.copiedTextStyle[m]=0)}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");g.actions.addAction("pasteTextStyle",function(){x.isEnabled()&&!x.isSelectionEmpty()&&null!=g.copiedTextStyle&&x.pasteTextStyles(x.includeDescendantParts(x.getSelectionCells()),-g.copiedTextStyle)},null,null,Editor.altKey+"+"+Editor.shiftKey+"+V");g.actions.put("exportSvg",new Action("formatSvg...",function(){g.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(v,d,m,r,A,D,G,O,P,V,Y,H,W,Z,X){v=parseInt(v);g.lastExportSvgEditable=A;!isNaN(v)&&0<v&&g.exportSvg(v/100,d,m,r,A,D,G,!O,P,V,H,W,Z,null,X,Y)}),!0,g.lastExportSvgEditable,"svg",!0)}));g.actions.put("exportPng",new Action("formatPng...",-function(){p("png",g.lastExportPngEditable,function(v,d,m,r,A){g.lastExportPngEditable=A})}));g.actions.put("exportJpg",new Action("formatJpg...",function(){p("jpeg")}));g.actions.put("exportWebp",new Action("formatWebp...",function(){p("webp")}));g.actions.put("exportAnimatedGif",new Action(mxResources.get("formatAnimatedGif",null,"Animated GIF")+"...",function(){g.showAnimatedGifExportDialog()}));z=g.actions.addAction("copyAsImage",mxUtils.bind(this,function(){var v=mxUtils.sortCells(x.model.getTopmostCells(x.getSelectionCells()));-g.copyImage(v)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+X");z.visible=Editor.enableNativeClipboard&&g.editor.isExportToCanvas();z=g.actions.addAction("copyAsSvg",mxUtils.bind(this,function(){var v=mxUtils.sortCells(x.model.getTopmostCells(x.getSelectionCells()));g.copySvg(v)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+"+Editor.shiftKey+"+X");z.visible=Editor.enableNativeClipboard&&g.editor.isExportToCanvas();z=g.actions.put("shadowVisible",new Action("shadow",function(){x.setShadowVisible(!x.shadowVisible)}));-z.setToggleAction(!0);z.setSelectedCallback(function(){return x.shadowVisible});g.actions.put("about",new Action("v"+EditorUi.VERSION,function(v,d){mxEvent.isShiftDown(d)&&(EditorUi.isElectronApp||g.isOwnGDriveDomain())&&("1"==urlParams.test?(EditorUi.debug("Debug output disabled"),urlParams.test="0"):(urlParams.test="1",EditorUi.debug("Debug output enabled")))}));g.actions.addAction("support...",function(){EditorUi.isElectronApp?g.openLink("https://github.com/jgraph/drawio-desktop/wiki/Getting-Support"):+g.copiedTextStyle)},null,null,Editor.altKey+"+"+Editor.shiftKey+"+V");g.actions.put("exportSvg",new Action("formatSvg...",function(){g.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,function(v,d,m,r,z,D,F,N,P,V,X,H,W,Z,Y){v=parseInt(v);g.lastExportSvgEditable=z;!isNaN(v)&&0<v&&g.exportSvg(v/100,d,m,r,z,D,F,!N,P,V,H,W,Z,null,Y,X)}),!0,g.lastExportSvgEditable,"svg",!0)}));g.actions.put("exportPng",new Action("formatPng...",+function(){p("png",g.lastExportPngEditable,function(v,d,m,r,z){g.lastExportPngEditable=z})}));g.actions.put("exportJpg",new Action("formatJpg...",function(){p("jpeg")}));g.actions.put("exportWebp",new Action("formatWebp...",function(){p("webp")}));g.actions.put("exportAnimatedGif",new Action(mxResources.get("formatAnimatedGif",null,"Animated GIF")+"...",function(){g.showAnimatedGifExportDialog()}));y=g.actions.addAction("copyAsImage",mxUtils.bind(this,function(){var v=mxUtils.sortCells(x.model.getTopmostCells(x.getSelectionCells()));+g.copyImage(v)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+X");y.visible=Editor.enableNativeClipboard&&g.editor.isExportToCanvas();y=g.actions.addAction("copyAsSvg",mxUtils.bind(this,function(){var v=mxUtils.sortCells(x.model.getTopmostCells(x.getSelectionCells()));g.copySvg(v)}),null,null,Editor.ctrlKey+"+"+Editor.altKey+"+"+Editor.shiftKey+"+X");y.visible=Editor.enableNativeClipboard&&g.editor.isExportToCanvas();y=g.actions.put("shadowVisible",new Action("shadow",function(){x.setShadowVisible(!x.shadowVisible)}));+y.setToggleAction(!0);y.setSelectedCallback(function(){return x.shadowVisible});g.actions.put("about",new Action("v"+EditorUi.VERSION,function(v,d){mxEvent.isShiftDown(d)&&(EditorUi.isElectronApp||g.isOwnGDriveDomain())&&("1"==urlParams.test?(EditorUi.debug("Debug output disabled"),urlParams.test="0"):(urlParams.test="1",EditorUi.debug("Debug output enabled")))}));g.actions.addAction("support...",function(){EditorUi.isElectronApp?g.openLink("https://github.com/jgraph/drawio-desktop/wiki/Getting-Support"):g.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});g.actions.addAction("downloadDesktop...",function(){g.openLink("https://get.diagrams.net/")});g.actions.addAction("exportOptionsDisabled...",function(){g.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});g.actions.addAction("keyboardShortcuts...",function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||navigator.standalone?g.openLink("https://app.diagrams.net/shortcuts.svg"):-g.openLink("shortcuts.svg")});g.actions.addAction("quickStart...",function(){"ac.draw.io"===window.location.hostname?g.openLink("https://www.youtube.com/watch?v=s5BG0705MHU"):g.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});z=g.actions.addAction("tags",mxUtils.bind(this,function(){if(null==this.tagsWindow){var v=mxSettings.getWindowState("tags");this.tagsWindow=new TagsWindow(g,null!=v&&null!=v.x?v.x:document.body.offsetWidth-400,null!=v&&null!=v.y?v.y:60,null!=v&&null!=v.w?v.w:212,null!=+g.openLink("shortcuts.svg")});g.actions.addAction("quickStart...",function(){"ac.draw.io"===window.location.hostname?g.openLink("https://www.youtube.com/watch?v=s5BG0705MHU"):g.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});y=g.actions.addAction("tags",mxUtils.bind(this,function(){if(null==this.tagsWindow){var v=mxSettings.getWindowState("tags");this.tagsWindow=new TagsWindow(g,null!=v&&null!=v.x?v.x:document.body.offsetWidth-400,null!=v&&null!=v.y?v.y:60,null!=v&&null!=v.w?v.w:212,null!=v&&null!=v.h?v.h:200);this.tagsWindow.window.addListener("show",mxUtils.bind(this,function(){g.fireEvent(new mxEventObject("tags"))}));this.tagsWindow.window.addListener("hide",function(){g.fireEvent(new mxEventObject("tags"))});g.installWindowPersistence("tags",this.tagsWindow);null!=v&&g.restoreWindowState("tags",this.tagsWindow);this.tagsWindow.window.setVisible(!0);g.fireEvent(new mxEventObject("tags"))}else this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}),null,null,Editor.ctrlKey+-"+K");z.setToggleAction(!0);z.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));z=g.actions.addAction("animation",mxUtils.bind(this,function(){if(null==this.animationWindow){var v=mxSettings.getWindowState("animation");this.animationWindow=new AnimationDialog(g,null!=v&&null!=v.x?v.x:Math.max(0,(document.body.offsetWidth-480)/2),null!=v&&null!=v.y?v.y:120,null!=v&&null!=v.w?v.w:480,null!=v&&null!=v.h?v.h:460);this.animationWindow.window.addListener("show",-mxUtils.bind(this,function(){g.fireEvent(new mxEventObject("animation"))}));this.animationWindow.window.addListener("hide",function(){g.fireEvent(new mxEventObject("animation"))});g.installWindowPersistence("animation",this.animationWindow);null!=v&&g.restoreWindowState("animation",this.animationWindow);this.animationWindow.window.setVisible(!0);g.fireEvent(new mxEventObject("animation"))}else this.animationWindow.window.setVisible(!this.animationWindow.window.isVisible())}));z.setToggleAction(!0);-z.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.animationWindow&&this.animationWindow.window.isVisible()}));(EditorUi.isElectronApp&&(Editor.enableAi||null==Editor.config||null==Editor.config.enableAi&&null==Editor.config.enableChatGpt)||(Editor.enableAi||(null==Editor.config||null==Editor.config.enableAi)&&/ac\.draw\.io$/.test(window.location.hostname)||/aj\.draw\.io$/.test(window.location.hostname))&&!g.isOffline()&&0<Editor.aiActions.length&&g.isExternalDataComms())&&"draw.io"==-g.getServiceName()&&EditorUi.isMermaidSupported()&&(z=g.actions.put("generate",new Action("generate",function(){EditorUi.isElectronApp||Editor.enableAi?null!=g.chatWindow?g.chatWindow.window.setVisible(!g.chatWindow.window.isVisible()):g.openGenerateDialog(""):g.alert('AI features require admin approval<br><a href="https://www.drawio.com/doc/faq/confluence-ai-options" target="_blank">Learn more</a>')})),z.isEnabled=function(){return B()},z.setToggleAction(!0),z.setSelectedCallback(function(){return null!=-g.chatWindow&&g.chatWindow.window.isVisible()}));z=g.actions.addAction("findReplace",mxUtils.bind(this,function(v,d){g.showSearchWindow(x.isEnabled()&&(null==d||!mxEvent.isShiftDown(d)))}),null,null,Editor.ctrlKey+"+F");z=new Action("exportVsdx",function(){var v=null==g.pages||1>=g.pages.length;if(v)g.exportVisio();else{var d=document.createElement("div");d.style.whiteSpace="nowrap";var m=document.createElement("h3");mxUtils.write(m,mxResources.get("formatVsdx"));d.appendChild(m);m=document.createElement("div");-m.className="geDialogSection";var r=g.addCheckbox(m,mxResources.get("allPages"),!v,v);d.appendChild(m);v=new CustomDialog(g,d,mxUtils.bind(this,function(){g.exportVisio(!r.checked)}),null,mxResources.get("export"));g.showDialog(v.container,300,146,!0,!0)}});z.getTitle=function(){return mxResources.get("formatVsdx")+" (beta)..."};g.actions.put("exportVsdx",z);isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&g.actions.addAction("configuration...",function(){var v=[[mxResources.get("reset"),+"+K");y.setToggleAction(!0);y.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));y=g.actions.addAction("animation",mxUtils.bind(this,function(){if(null==this.animationWindow){var v=mxSettings.getWindowState("animation");this.animationWindow=new AnimationDialog(g,null!=v&&null!=v.x?v.x:Math.max(0,(document.body.offsetWidth-480)/2),null!=v&&null!=v.y?v.y:120,null!=v&&null!=v.w?v.w:480,null!=v&&null!=v.h?v.h:460);this.animationWindow.window.addListener("show",+mxUtils.bind(this,function(){g.fireEvent(new mxEventObject("animation"))}));this.animationWindow.window.addListener("hide",function(){g.fireEvent(new mxEventObject("animation"))});g.installWindowPersistence("animation",this.animationWindow);null!=v&&g.restoreWindowState("animation",this.animationWindow);this.animationWindow.window.setVisible(!0);g.fireEvent(new mxEventObject("animation"))}else this.animationWindow.window.setVisible(!this.animationWindow.window.isVisible())}));y.setToggleAction(!0);+y.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.animationWindow&&this.animationWindow.window.isVisible()}));(EditorUi.isElectronApp&&(Editor.enableAi||null==Editor.config||null==Editor.config.enableAi&&null==Editor.config.enableChatGpt)||(Editor.enableAi||(null==Editor.config||null==Editor.config.enableAi)&&/ac\.draw\.io$/.test(window.location.hostname)||/aj\.draw\.io$/.test(window.location.hostname))&&!g.isOffline()&&0<Editor.aiActions.length&&g.isExternalDataComms())&&"draw.io"==+g.getServiceName()&&EditorUi.isMermaidSupported()&&(y=g.actions.put("generate",new Action("generate",function(){EditorUi.isElectronApp||Editor.enableAi?null!=g.chatWindow?g.chatWindow.window.setVisible(!g.chatWindow.window.isVisible()):g.openGenerateDialog(""):g.alert('AI features require admin approval<br><a href="https://www.drawio.com/doc/faq/confluence-ai-options" target="_blank">Learn more</a>')})),y.isEnabled=function(){return A()},y.setToggleAction(!0),y.setSelectedCallback(function(){return null!=+g.chatWindow&&g.chatWindow.window.isVisible()}));y=g.actions.addAction("findReplace",mxUtils.bind(this,function(v,d){g.showSearchWindow(x.isEnabled()&&(null==d||!mxEvent.isShiftDown(d)))}),null,null,Editor.ctrlKey+"+F");y=new Action("exportVsdx",function(){var v=null==g.pages||1>=g.pages.length;if(v)g.exportVisio();else{var d=document.createElement("div");d.style.whiteSpace="nowrap";var m=document.createElement("h3");mxUtils.write(m,mxResources.get("formatVsdx"));d.appendChild(m);m=document.createElement("div");+m.className="geDialogSection";var r=g.addCheckbox(m,mxResources.get("allPages"),!v,v);d.appendChild(m);v=new CustomDialog(g,d,mxUtils.bind(this,function(){g.exportVisio(!r.checked)}),null,mxResources.get("export"));g.showDialog(v.container,300,146,!0,!0)}});y.getTitle=function(){return mxResources.get("formatVsdx")+" (beta)..."};g.actions.put("exportVsdx",y);isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&g.actions.addAction("configuration...",function(){var v=[[mxResources.get("reset"),function(){g.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.configurationKey),g.hideDialog(),g.alert(mxResources.get("restartForChangeRequired"))}catch(m){g.handleError(m)}})}]];if(!g.isOfflineApp()&&isLocalStorage&&g.mode!=App.MODE_ATLAS){var d=g.actions.get("plugins");null==d||"sketch"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||v.push([mxResources.get("plugins"),d.funct])}EditorUi.isElectronApp||v.push([mxResources.get("link"),-function(m,r){if(0<r.value.length)try{var A=JSON.parse(r.value),D=window.location.protocol+"//"+window.location.host+"/"+g.getSearch()+"#_CONFIG_"+Graph.compress(JSON.stringify(A)),G=new EmbedDialog(g,D);g.showDialog(G.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));G.init()}catch(O){g.handleError(O)}else g.handleError({message:mxResources.get("invalidInput")})}]);"atlassian"!=g.getServiceName()&&"1"!=urlParams.embed&&v.push([mxResources.get("preferences"),function(){g.showLocalStorageDialog(mxResources.get("preferences")++function(m,r){if(0<r.value.length)try{var z=JSON.parse(r.value),D=window.location.protocol+"//"+window.location.host+"/"+g.getSearch()+"#_CONFIG_"+Graph.compress(JSON.stringify(z)),F=new EmbedDialog(g,D);g.showDialog(F.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));F.init()}catch(N){g.handleError(N)}else g.handleError({message:mxResources.get("invalidInput")})}]);"atlassian"!=g.getServiceName()&&"1"!=urlParams.embed&&v.push([mxResources.get("preferences"),function(){g.showLocalStorageDialog(mxResources.get("preferences")+":",Editor.settingsKey,[[mxResources.get("reset"),function(){g.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.settingsKey),localStorage.removeItem(".drawio-config"),g.hideDialog(),g.alert(mxResources.get("restartForChangeRequired"))}catch(m){g.handleError(m)}})}]])}]);g.showConfigurationEditorDialog(mxResources.get("configuration")+":",Editor.configurationKey,v,"https://www.drawio.com/doc/faq/configure-diagram-editor")});(mxClient.IS_CHROMEAPP||isLocalStorage)&&-this.put("language",new Menu(mxUtils.bind(this,function(v,d){var m=mxLanguage;null==urlParams.lang&&isLocalStorage&&(m=mxSettings.settings.language);var r=mxUtils.bind(this,function(D){var G=""==D?mxResources.get("automatic"):mxLanguageMap[D],O=null;""!=G&&(O=v.addItem(G,null,mxUtils.bind(this,function(){g.setAndPersistLanguage(D)}),d),(D==m||""==D&&null==m)&&v.addCheckmark(O,Editor.checkmarkImage));return O});r("");v.addSeparator(d);for(var A in mxLanguageMap)r(A)})));g.customLayoutConfig=[];g.actions.addAction("runLayout",-function(){g.showCustomLayoutDialog(JSON.stringify(g.customLayoutConfig,null,2))});g.actions.put("adaptiveColors",new Action("adaptiveColors",function(v){null==g.adaptiveColorsWindow&&(g.adaptiveColorsWindow=new AdaptiveColorsWindow(g,document.body.offsetWidth-520,80,200,160));g.adaptiveColorsWindow.window.setVisible(!0)}));z=this.get("viewZoom");var K=z.funct;z.funct=mxUtils.bind(this,function(v,d){K.apply(this,arguments);"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(v,-["-","outline","fullscreen"],d)});z=this.get("layout");var M=z.funct;this.put("legacyLayout",new Menu(M));z.funct=function(v,d){v.addItem(mxResources.get("runLastLayout"),null,function(){g.executeLayoutSpec(g.lastLayoutSpec,null,!0)},d,null,B()&&null!=g.lastLayoutSpec);v.addSeparator(d);if("undefined"!==typeof ElkLayout){var m=function(r){v.addItem(mxResources.get(r)+"...",null,function(){var A=ElkLayout.MENU_PRESETS[r];ElkLayout.runWithDialog(g,A.algorithm,A.options,mxResources.get(r))},d,null,B())};-m("verticalFlow");m("horizontalFlow");v.addSeparator(d);m("verticalTree");m("horizontalTree");m("radialTree");v.addSeparator(d);m("organic")}else M.apply(this,arguments);v.addItem(mxResources.get("orgChart")+"...",null,function(){for(var r=null,A=20,D=20,G=function(){"undefined"!==typeof mxOrgChartLayout&&null!=r&&g.tryAndHandle(mxUtils.bind(this,function(){var ba=g.editor.graph,ea=new mxOrgChartLayout(ba,r,A,D),aa=ba.getDefaultParent();1<ba.model.getChildCount(ba.getSelectionCell())&&(aa=ba.getSelectionCell());-ea.execute(aa)}))},O=document.createElement("div"),P=function(ba,ea){var aa=document.createElement("div");aa.style.marginBottom="8px";var ha=document.createElement("div");ha.style.display="inline-block";ha.style.width="180px";ha.style.verticalAlign="middle";mxUtils.write(ha,mxResources.get(ba)+": ");aa.appendChild(ha);ea.style.width="160px";ea.style.boxSizing="border-box";ea.style.verticalAlign="middle";aa.appendChild(ea);O.appendChild(aa)},V=document.createElement("select"),Y=[mxResources.get("linear"),-mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],H=0;H<Y.length;H++){var W=document.createElement("option");mxUtils.write(W,Y[H]);W.value=H;2==H&&W.setAttribute("selected","selected");V.appendChild(W)}mxEvent.addListener(V,"change",function(){r=V.value});P("orgChartType",V);var Z=document.createElement("input");Z.type="number";Z.value=A;mxEvent.addListener(Z,-"change",function(){A=Z.value});P("parentChildSpacing",Z);var X=document.createElement("input");X.type="number";X.value=D;mxEvent.addListener(X,"change",function(){D=X.value});P("siblingSpacing",X);P=new CustomDialog(g,O,function(){null==r&&(r=2);g.loadOrgChartLayouts(G)},null,null,"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");g.showDialog(P.container,355,null,!0,!0)},d,null,B());v.addItem(mxResources.get("circle"),null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,-function(){var r=g.getSelectedLayoutContainer();if(null!=r)g.setContainerChildLayout(r,"circleLayout");else{var A=new mxCircleLayout(x);g.executeLayout(function(){var D=x.getSelectionCell();if(null==D||0==x.getModel().getChildCount(D))D=x.getDefaultParent();A.execute(D);x.getModel().isVertex(D)&&x.updateGroupBounds([D],2*x.gridSize,!0)},!0)}}))}),d);v.addSeparator(d);"undefined"!==typeof LibavoidRouting&&v.addItem(mxResources.get("orthogonalRouting")+"...",null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,-function(){g.prompt(mxResources.get("spacing"),LibavoidRouting.shapeBufferDistance,mxUtils.bind(this,function(r){g.tryAndHandle(mxUtils.bind(this,function(){var A=parseFloat(r);LibavoidRouting.run(g,isNaN(A)?null:{shapeBufferDistance:A})}))}))}))}),d);v.addItem(mxResources.get("parallels")+"...",null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,function(){var r=new mxParallelEdgeLayout(x);r.checkOverlap=!0;g.prompt(mxResources.get("spacing"),r.spacing,mxUtils.bind(this,function(A){g.tryAndHandle(mxUtils.bind(this,-function(){r.spacing=A;g.lastLayoutSpec=[{layout:"mxParallelEdgeLayout",config:{spacing:r.spacing,checkOverlap:!0}}];var D=g.getSelectedLayoutContainer();null!=D?g.setContainerChildLayout(D,g.lastLayoutSpec):g.executeLayout(function(){r.execute(x.getDefaultParent(),x.isSelectionEmpty()?null:x.getSelectionCells())},!1)}))}))}))}),d);"undefined"!==typeof ElkLayout&&(v.addSeparator(d),g.menus.addSubmenu("legacyLayout",v,d,mxResources.get("legacyLayouts")));v.addSeparator(d);g.menus.addMenuItem(v,"runLayout",-d,null,null,mxResources.get("custom")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(v,d){if(mxClient.IS_CHROMEAPP||!g.isOffline()&&!navigator.standalone){var m=v.addItem(mxResources.get("search")+":",null,null,d,null,null,!1);m.style.cursor="default";var r=document.createElement("input");r.setAttribute("type","text");r.setAttribute("size","25");r.style.borderWidth="1px";r.style.marginLeft="8px";mxEvent.addListener(r,"keydown",mxUtils.bind(this,function(A){var D=mxUtils.trim(r.value);-13==A.keyCode&&0<D.length?(this.editorUi.searchHelp(D),r.value="",window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0)):27==A.keyCode&&(r.value="")}));m.firstChild.nextSibling.appendChild(r);mxEvent.addGestureListeners(r,function(A){document.activeElement!=r&&r.focus();mxEvent.consume(A)},function(A){mxEvent.consume(A)},function(A){mxEvent.consume(A)});window.setTimeout(function(){r.focus()},0);EditorUi.isElectronApp?(g.actions.addAction("website...",function(){g.openLink("https://www.drawio.com")}),+this.put("language",new Menu(mxUtils.bind(this,function(v,d){var m=mxLanguage;null==urlParams.lang&&isLocalStorage&&(m=mxSettings.settings.language);var r=mxUtils.bind(this,function(D){var F=""==D?mxResources.get("automatic"):mxLanguageMap[D],N=null;""!=F&&(N=v.addItem(F,null,mxUtils.bind(this,function(){g.setAndPersistLanguage(D)}),d),(D==m||""==D&&null==m)&&v.addCheckmark(N,Editor.checkmarkImage));return N});r("");v.addSeparator(d);for(var z in mxLanguageMap)r(z)})));g.customLayoutConfig=[];g.actions.addAction("runLayout",+function(){g.showCustomLayoutDialog(JSON.stringify(g.customLayoutConfig,null,2))});g.actions.put("adaptiveColors",new Action("adaptiveColors",function(v){null==g.adaptiveColorsWindow&&(g.adaptiveColorsWindow=new AdaptiveColorsWindow(g,document.body.offsetWidth-520,80,200,160));g.adaptiveColorsWindow.window.setVisible(!0)}));y=this.get("viewZoom");var L=y.funct;y.funct=mxUtils.bind(this,function(v,d){L.apply(this,arguments);"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(v,+["-","outline","fullscreen"],d)});y=this.get("layout");var O=y.funct;this.put("legacyLayout",new Menu(O));y.funct=function(v,d){v.addItem(mxResources.get("runLastLayout"),null,function(){g.executeLayoutSpec(g.lastLayoutSpec,null,!0)},d,null,A()&&null!=g.lastLayoutSpec);v.addSeparator(d);if("undefined"!==typeof ElkLayout){var m=function(r){v.addItem(mxResources.get(r)+"...",null,function(){var z=ElkLayout.MENU_PRESETS[r];ElkLayout.runWithDialog(g,z.algorithm,z.options,mxResources.get(r))},d,null,A())};+m("verticalFlow");m("horizontalFlow");v.addSeparator(d);m("verticalTree");m("horizontalTree");m("radialTree");v.addSeparator(d);m("organic")}else O.apply(this,arguments);v.addItem(mxResources.get("orgChart")+"...",null,function(){for(var r=null,z=20,D=20,F=function(){"undefined"!==typeof mxOrgChartLayout&&null!=r&&g.tryAndHandle(mxUtils.bind(this,function(){var ba=g.editor.graph,ea=new mxOrgChartLayout(ba,r,z,D),aa=ba.getDefaultParent();1<ba.model.getChildCount(ba.getSelectionCell())&&(aa=ba.getSelectionCell());+ea.execute(aa)}))},N=document.createElement("div"),P=function(ba,ea){var aa=document.createElement("div");aa.style.marginBottom="8px";var ha=document.createElement("div");ha.style.display="inline-block";ha.style.width="180px";ha.style.verticalAlign="middle";mxUtils.write(ha,mxResources.get(ba)+": ");aa.appendChild(ha);ea.style.width="160px";ea.style.boxSizing="border-box";ea.style.verticalAlign="middle";aa.appendChild(ea);N.appendChild(aa)},V=document.createElement("select"),X=[mxResources.get("linear"),+mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],H=0;H<X.length;H++){var W=document.createElement("option");mxUtils.write(W,X[H]);W.value=H;2==H&&W.setAttribute("selected","selected");V.appendChild(W)}mxEvent.addListener(V,"change",function(){r=V.value});P("orgChartType",V);var Z=document.createElement("input");Z.type="number";Z.value=z;mxEvent.addListener(Z,+"change",function(){z=Z.value});P("parentChildSpacing",Z);var Y=document.createElement("input");Y.type="number";Y.value=D;mxEvent.addListener(Y,"change",function(){D=Y.value});P("siblingSpacing",Y);P=new CustomDialog(g,N,function(){null==r&&(r=2);g.loadOrgChartLayouts(F)},null,null,"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");g.showDialog(P.container,355,null,!0,!0)},d,null,A());v.addItem(mxResources.get("circle"),null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,+function(){var r=g.getSelectedLayoutContainer();if(null!=r)g.setContainerChildLayout(r,"circleLayout");else{var z=new mxCircleLayout(x);g.executeLayout(function(){var D=x.getSelectionCell();if(null==D||0==x.getModel().getChildCount(D))D=x.getDefaultParent();z.execute(D);x.getModel().isVertex(D)&&x.updateGroupBounds([D],2*x.gridSize,!0)},!0)}}))}),d);v.addSeparator(d);"undefined"!==typeof LibavoidRouting&&v.addItem(mxResources.get("orthogonalRouting")+"...",null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,+function(){g.prompt(mxResources.get("spacing"),LibavoidRouting.shapeBufferDistance,mxUtils.bind(this,function(r){g.tryAndHandle(mxUtils.bind(this,function(){var z=parseFloat(r);LibavoidRouting.run(g,isNaN(z)?null:{shapeBufferDistance:z})}))}))}))}),d);v.addItem(mxResources.get("parallels")+"...",null,mxUtils.bind(this,function(){g.tryAndHandle(mxUtils.bind(this,function(){var r=new mxParallelEdgeLayout(x);r.checkOverlap=!0;g.prompt(mxResources.get("spacing"),r.spacing,mxUtils.bind(this,function(z){g.tryAndHandle(mxUtils.bind(this,+function(){r.spacing=z;g.lastLayoutSpec=[{layout:"mxParallelEdgeLayout",config:{spacing:r.spacing,checkOverlap:!0}}];var D=g.getSelectedLayoutContainer();null!=D?g.setContainerChildLayout(D,g.lastLayoutSpec):g.executeLayout(function(){r.execute(x.getDefaultParent(),x.isSelectionEmpty()?null:x.getSelectionCells())},!1)}))}))}))}),d);"undefined"!==typeof ElkLayout&&(v.addSeparator(d),g.menus.addSubmenu("legacyLayout",v,d,mxResources.get("legacyLayouts")));v.addSeparator(d);g.menus.addMenuItem(v,"runLayout",+d,null,null,mxResources.get("custom")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(v,d){if(mxClient.IS_CHROMEAPP||!g.isOffline()&&!navigator.standalone){var m=v.addItem(mxResources.get("search")+":",null,null,d,null,null,!1);m.style.cursor="default";var r=document.createElement("input");r.setAttribute("type","text");r.setAttribute("size","25");r.style.borderWidth="1px";r.style.marginLeft="8px";mxEvent.addListener(r,"keydown",mxUtils.bind(this,function(z){var D=mxUtils.trim(r.value);+13==z.keyCode&&0<D.length?(this.editorUi.searchHelp(D),r.value="",window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0)):27==z.keyCode&&(r.value="")}));m.firstChild.nextSibling.appendChild(r);mxEvent.addGestureListeners(r,function(z){document.activeElement!=r&&r.focus();mxEvent.consume(z)},function(z){mxEvent.consume(z)},function(z){mxEvent.consume(z)});window.setTimeout(function(){r.focus()},0);EditorUi.isElectronApp?(g.actions.addAction("website...",function(){g.openLink("https://www.drawio.com")}),g.actions.addAction("check4Updates",function(){g.checkForUpdates()}),g.actions.put("desktopZoomIn",new Action("zoomIn",function(){g.desktopZoomIn()})),g.actions.put("desktopZoomOut",new Action("zoomOut",function(){g.desktopZoomOut()})),g.actions.put("desktopResetZoom",new Action("actualSize",function(){g.desktopResetZoom()})),this.addMenuItems(v,"- keyboardShortcuts quickStart website support -".split(" "),d),"1"!=urlParams.disableUpdate&&this.addMenuItems(v,["check4Updates","-"],d),this.addMenuItems(v,"desktopResetZoom desktopZoomIn desktopZoomOut - openDevTools - about".split(" "),d)):this.addMenuItems(v,"- keyboardShortcuts quickStart downloadDesktop support - about".split(" "),d)}else this.addMenuItems(v,["keyboardShortcuts","-","about"],d);"1"==urlParams.test&&(v.addSeparator(d),this.addSubmenu("testDevelop",v,d))})));g.actions.addAction("languageCode...",function(){var v=new FilenameDialog(g,Graph.diagramLanguage||"",mxResources.get("ok"),mxUtils.bind(this,function(d){null!=d&&(Graph.diagramLanguage=0<d.length?d:null,Graph.translateDiagram=!0,x.refresh())}),mxResources.get("languageCode"),null,null,"https://www.drawio.com/blog/translate-diagrams");g.showDialog(v.container,340,80,!0,!0);v.init()});this.put("diagramLanguage",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,["languageCode","-"],d);d=v.addItem(mxResources.get("disabled"),null,function(){Graph.translateDiagram=!1;x.refresh()},d);Graph.translateDiagram||v.addCheckmark(d,Editor.checkmarkImage)})));if("1"==urlParams.test){mxResources.parse("testDevelop=Develop");mxResources.parse("showBoundingBox=Show bounding box");mxResources.parse("createSidebarEntry=Create Sidebar Entry");mxResources.parse("testCheckFile=Check File");mxResources.parse("testDiff=Diff/Sync");mxResources.parse("testChecksum=Checksum");mxResources.parse("testCheckPages=Check Pages");mxResources.parse("testFixPages=Fix Pages");mxResources.parse("testInspect=Inspect");mxResources.parse("testShowConsole=Show Console");mxResources.parse("testXmlImageExport=XML Image Export");mxResources.parse("testOptimize=Remove Inline Images");-mxResources.parse("testPerformance=Performance");g.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!x.isSelectionEmpty()){var v=x.cloneCells(x.getSelectionCells()),d=x.getBoundingBoxFromGeometry(v,!0);v=x.moveCells(v,-d.x,-d.y);g.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+d.width+", "+d.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(x.encodeCells(v)))+"'),")}}));g.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){function v(G){return null==-G||null==G.boundingBox||!isNaN(G.boundingBox.x)&&!isNaN(G.boundingBox.y)&&!isNaN(G.boundingBox.width)&&!isNaN(G.boundingBox.height)}var d=x.isSelectionEmpty()?x.getGraphBounds():x.getBoundingBox(x.getSelectionCells()),m=x.view.translate,r=x.view.scale;x.insertVertex(x.getDefaultParent(),null,"",d.x/r-m.x,d.y/r-m.y,d.width/r,d.height/r,"fillColor=none;strokeColor=red;");var A=0,D=0;x.view.states.visit(function(G,O){G=!0;v(O.shape)||(console.log("invalid shape",O.cell.id,O.shape),G=!1);v(O.text)||(console.log("invalid text",-O.cell.id,O.text),G=!1);G||A++;D++});console.log("states checked",D,"invalid",A)}));g.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var v=null!=g.pages&&null!=g.getCurrentFile()?g.getCurrentFile().getAnonymizedXmlForPages(g.pages):"";v=new TextareaDialog(g,"Paste Data:",v,function(d){if(0<d.length)try{var m=function(O){function P(ha){if(null==aa[ha]){if(aa[ha]=!0,null!=H[ha]){for(;0<H[ha].length;){var na=H[ha].pop();P(na)}delete H[ha]}}else mxLog.debug(V+": Visited: "+ha)}var V=O.parentNode.id,-Y=O.childNodes;O={};for(var H={},W=null,Z={},X=0;X<Y.length;X++){var ba=Y[X];if(null!=ba.id&&0<ba.id.length)if(null==O[ba.id]){O[ba.id]=ba.id;var ea=ba.getAttribute("parent");null==ea?null!=W?mxLog.debug(V+": Multiple roots: "+ba.id):W=ba.id:(null==H[ea]&&(H[ea]=[]),H[ea].push(ba.id))}else Z[ba.id]=ba.id}Y=Object.keys(Z);0<Y.length?(Y=V+": "+Y.length+" Duplicates: "+Y.join(", "),mxLog.debug(Y+" (see console)")):mxLog.debug(V+": Checked");var aa={};null==W?mxLog.debug(V+": No root"):(P(W),Object.keys(aa).length!=-Object.keys(O).length&&(mxLog.debug(V+": Invalid tree: (see console)"),console.log(V+": Invalid tree",H)))};"<"!=d.charAt(0)&&(d=Graph.decompress(d),mxLog.debug("See console for uncompressed XML"),console.log("xml",d));var r=mxUtils.parseXml(d),A=g.getPagesForNode(r.documentElement,"mxGraphModel");if(null!=A&&0<A.length)try{var D=g.getHashValueForPages(A);mxLog.debug("Checksum: ",D)}catch(O){mxLog.debug("Error: ",O.message)}else mxLog.debug("No pages found for checksum");var G=r.getElementsByTagName("root");-for(d=0;d<G.length;d++)m(G[d]);mxLog.show()}catch(O){g.handleError(O),null!=window.console&&console.error(O)}});g.showDialog(v.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));v.init()}));var L=null;g.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=g.pages){var v=new TextareaDialog(g,"Diff/Sync:","",function(d){var m=g.getCurrentFile();if(0<d.length&&null!=m)try{var r=JSON.parse(d);m.patch([r],null,!0,!0);g.hideDialog()}catch(A){g.handleError(A)}},null,"Close",-null,null,null,!0,null,"Patch",null,[["Snapshot",function(d,m){try{L=g.getPagesForXml(g.getFileData(!0)),v.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "+g.getHashValueForPages(L)}catch(r){g.handleError(r)}}],["Diff",function(d,m){try{v.textarea.value=JSON.stringify(g.diffPages(L,g.pages),null,2)}catch(r){g.handleError(r)}}]]);if(null==L)try{L=g.getPagesForXml(g.getFileData(!0)),v.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+g.getHashValueForPages(L)}catch(d){g.handleError(d)}else v.textarea.value=-JSON.stringify(g.diffPages(L,g.pages),null,2);g.showDialog(v.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));v.init()}else g.alert("No pages")}));g.actions.addAction("testChecksum",mxUtils.bind(this,function(){var v=g.getCurrentFile();null!=g.pages&&null!=v?g.spinner.spin(document.body,mxResources.get("loading"))&&v.getLatestVersion(function(d){g.spinner.stop();var m=g.getHashValueForPages(g.pages),r=v.getCurrentRevisionId(),A=g.getHashValueForPages(d.getShadowPages()),D=d.getDescriptorChecksum(d.getDescriptor()),-G=d.getCurrentRevisionId();console.log("Local File",[v],"modified",v.isModified(),"checksum",m);console.log("Remote File",[d],"rev",G==r,"desc",D==A,"checksum",A);g.alert("Checksums "+(A==m?"match":"no not match"))},function(d){console.log("Error getLatestVersion",d);g.handleError(d)}):console.log("Checksum: no file or pages")}));g.actions.addAction("testCheckPages",mxUtils.bind(this,function(){var v=g.getCurrentFile();console.log("editorUi",g,"file",v);if(null!=v&&v.isRealtime()){console.log("Checksum ownPages",+mxResources.parse("testPerformance=Performance");g.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!x.isSelectionEmpty()){var v=x.cloneCells(x.getSelectionCells()),d=x.getBoundingBoxFromGeometry(v,!0);v=x.moveCells(v,-d.x,-d.y);g.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+d.width+", "+d.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(x.encodeCells(v)))+"'),")}}));g.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){function v(F){return null==+F||null==F.boundingBox||!isNaN(F.boundingBox.x)&&!isNaN(F.boundingBox.y)&&!isNaN(F.boundingBox.width)&&!isNaN(F.boundingBox.height)}var d=x.isSelectionEmpty()?x.getGraphBounds():x.getBoundingBox(x.getSelectionCells()),m=x.view.translate,r=x.view.scale;x.insertVertex(x.getDefaultParent(),null,"",d.x/r-m.x,d.y/r-m.y,d.width/r,d.height/r,"fillColor=none;strokeColor=red;");var z=0,D=0;x.view.states.visit(function(F,N){F=!0;v(N.shape)||(console.log("invalid shape",N.cell.id,N.shape),F=!1);v(N.text)||(console.log("invalid text",+N.cell.id,N.text),F=!1);F||z++;D++});console.log("states checked",D,"invalid",z)}));g.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var v=null!=g.pages&&null!=g.getCurrentFile()?g.getCurrentFile().getAnonymizedXmlForPages(g.pages):"";v=new TextareaDialog(g,"Paste Data:",v,function(d){if(0<d.length)try{var m=function(N){function P(ha){if(null==aa[ha]){if(aa[ha]=!0,null!=H[ha]){for(;0<H[ha].length;){var na=H[ha].pop();P(na)}delete H[ha]}}else mxLog.debug(V+": Visited: "+ha)}var V=N.parentNode.id,+X=N.childNodes;N={};for(var H={},W=null,Z={},Y=0;Y<X.length;Y++){var ba=X[Y];if(null!=ba.id&&0<ba.id.length)if(null==N[ba.id]){N[ba.id]=ba.id;var ea=ba.getAttribute("parent");null==ea?null!=W?mxLog.debug(V+": Multiple roots: "+ba.id):W=ba.id:(null==H[ea]&&(H[ea]=[]),H[ea].push(ba.id))}else Z[ba.id]=ba.id}X=Object.keys(Z);0<X.length?(X=V+": "+X.length+" Duplicates: "+X.join(", "),mxLog.debug(X+" (see console)")):mxLog.debug(V+": Checked");var aa={};null==W?mxLog.debug(V+": No root"):(P(W),Object.keys(aa).length!=+Object.keys(N).length&&(mxLog.debug(V+": Invalid tree: (see console)"),console.log(V+": Invalid tree",H)))};"<"!=d.charAt(0)&&(d=Graph.decompress(d),mxLog.debug("See console for uncompressed XML"),console.log("xml",d));var r=mxUtils.parseXml(d),z=g.getPagesForNode(r.documentElement,"mxGraphModel");if(null!=z&&0<z.length)try{var D=g.getHashValueForPages(z);mxLog.debug("Checksum: ",D)}catch(N){mxLog.debug("Error: ",N.message)}else mxLog.debug("No pages found for checksum");var F=r.getElementsByTagName("root");+for(d=0;d<F.length;d++)m(F[d]);mxLog.show()}catch(N){g.handleError(N),null!=window.console&&console.error(N)}});g.showDialog(v.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));v.init()}));var J=null;g.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=g.pages){var v=new TextareaDialog(g,"Diff/Sync:","",function(d){var m=g.getCurrentFile();if(0<d.length&&null!=m)try{var r=JSON.parse(d);m.patch([r],null,!0,!0);g.hideDialog()}catch(z){g.handleError(z)}},null,"Close",+null,null,null,!0,null,"Patch",null,[["Snapshot",function(d,m){try{J=g.getPagesForXml(g.getFileData(!0)),v.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "+g.getHashValueForPages(J)}catch(r){g.handleError(r)}}],["Diff",function(d,m){try{v.textarea.value=JSON.stringify(g.diffPages(J,g.pages),null,2)}catch(r){g.handleError(r)}}]]);if(null==J)try{J=g.getPagesForXml(g.getFileData(!0)),v.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+g.getHashValueForPages(J)}catch(d){g.handleError(d)}else v.textarea.value=+JSON.stringify(g.diffPages(J,g.pages),null,2);g.showDialog(v.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));v.init()}else g.alert("No pages")}));g.actions.addAction("testChecksum",mxUtils.bind(this,function(){var v=g.getCurrentFile();null!=g.pages&&null!=v?g.spinner.spin(document.body,mxResources.get("loading"))&&v.getLatestVersion(function(d){g.spinner.stop();var m=g.getHashValueForPages(g.pages),r=v.getCurrentRevisionId(),z=g.getHashValueForPages(d.getShadowPages()),D=d.getDescriptorChecksum(d.getDescriptor()),+F=d.getCurrentRevisionId();console.log("Local File",[v],"modified",v.isModified(),"checksum",m);console.log("Remote File",[d],"rev",F==r,"desc",D==z,"checksum",z);g.alert("Checksums "+(z==m?"match":"no not match"))},function(d){console.log("Error getLatestVersion",d);g.handleError(d)}):console.log("Checksum: no file or pages")}));g.actions.addAction("testCheckPages",mxUtils.bind(this,function(){var v=g.getCurrentFile();console.log("editorUi",g,"file",v);if(null!=v&&v.isRealtime()){console.log("Checksum ownPages",g.getHashValueForPages(v.ownPages));console.log("Checksum theirPages",g.getHashValueForPages(v.theirPages));console.log("diff ownPages/theirPages",g.diffPages(v.ownPages,v.theirPages));var d=v.getShadowPages();null!=d&&(console.log("Checksum shadowPages",g.getHashValueForPages(d)),console.log("diff shadowPages/ownPages",g.diffPages(d,v.ownPages)),console.log("diff ownPages/shadowPages",g.diffPages(v.ownPages,d)),console.log("diff theirPages/shadowPages",g.diffPages(v.theirPages,d)));null!=v.sync&&null!=v.sync.snapshot&&(console.log("Checksum snapshot",g.getHashValueForPages(v.sync.snapshot)),console.log("diff ownPages/snapshot",g.diffPages(v.ownPages,v.sync.snapshot)),console.log("diff theirPages/snapshot",g.diffPages(v.theirPages,v.sync.snapshot)),null!=g.pages&&console.log("diff snapshot/actualPages",g.diffPages(v.sync.snapshot,g.pages)));null!=g.pages&&(console.log("diff ownPages/actualPages",g.diffPages(v.ownPages,g.pages)),console.log("diff theirPages/actualPages",g.diffPages(v.theirPages,g.pages)))}null!=v&&console.log("Shadow pages",[g.getXmlForPages(v.getShadowPages())]);null!=g.pages&&console.log("Checksum actualPages",g.getHashValueForPages(g.pages))}));g.actions.addAction("testFixPages",mxUtils.bind(this,function(){console.log("editorUi",g);var v=g.getCurrentFile();null!=v&&v.isRealtime()&&null!=v.shadowPages&&(console.log("patching actualPages to shadowPages",v.patch([g.diffPages(v.shadowPages,g.pages)])),v.ownPages=g.clonePages(g.pages),v.theirPages=g.clonePages(g.pages),v.shadowPages=-g.clonePages(g.pages),null!=v.sync&&(v.sync.snapshot=g.clonePages(g.pages)))}));g.actions.addAction("testOptimize",mxUtils.bind(this,function(){x.model.beginUpdate();try{var v=x.model.cells,d=0,m=[],r=[],A;for(A in v){var D=v[A],G=x.getCurrentCellStyle(D)[mxConstants.STYLE_IMAGE];null!=G&&"data:"==G.substring(0,5)&&(null==m[G]&&(m[G]=(m[G]||0)+1,d++),r.push(D))}x.setCellStyles(mxConstants.STYLE_IMAGE,null,r);console.log("Removed",d,"image(s) from",r.length,"cell(s): ",[r,m])}finally{x.model.endUpdate()}}));-g.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(g,x.getModel())}));g.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var v=new mxImageExport,d=x.getGraphBounds(),m=x.view.scale,r=mxUtils.createXmlDocument(),A=r.createElement("output");r.appendChild(A);r=new mxXmlCanvas2D(A);r.translate(Math.floor((1-d.x)/m),Math.floor((1-d.y)/m));r.scale(1/m);var D=0,G=r.save;r.save=function(){D++;G.apply(this,arguments)};var O=r.restore;r.restore=function(){D--;O.apply(this,-arguments)};var P=v.drawShape;v.drawShape=function(V){mxLog.debug("entering shape",V,D);P.apply(this,arguments);mxLog.debug("leaving shape",V,D)};v.drawState(x.getView().getState(x.model.root),r);mxLog.show();mxLog.debug(mxUtils.getXml(A));mxLog.debug("stateCounter",D)}));g.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-2});var Q=null,c=null,f=null,k=null,n=null,q=null,t=null,u=null;g.actions.addAction("testPerformance",+g.clonePages(g.pages),null!=v.sync&&(v.sync.snapshot=g.clonePages(g.pages)))}));g.actions.addAction("testOptimize",mxUtils.bind(this,function(){x.model.beginUpdate();try{var v=x.model.cells,d=0,m=[],r=[],z;for(z in v){var D=v[z],F=x.getCurrentCellStyle(D)[mxConstants.STYLE_IMAGE];null!=F&&"data:"==F.substring(0,5)&&(null==m[F]&&(m[F]=(m[F]||0)+1,d++),r.push(D))}x.setCellStyles(mxConstants.STYLE_IMAGE,null,r);console.log("Removed",d,"image(s) from",r.length,"cell(s): ",[r,m])}finally{x.model.endUpdate()}}));+g.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(g,x.getModel())}));g.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var v=new mxImageExport,d=x.getGraphBounds(),m=x.view.scale,r=mxUtils.createXmlDocument(),z=r.createElement("output");r.appendChild(z);r=new mxXmlCanvas2D(z);r.translate(Math.floor((1-d.x)/m),Math.floor((1-d.y)/m));r.scale(1/m);var D=0,F=r.save;r.save=function(){D++;F.apply(this,arguments)};var N=r.restore;r.restore=function(){D--;N.apply(this,+arguments)};var P=v.drawShape;v.drawShape=function(V){mxLog.debug("entering shape",V,D);P.apply(this,arguments);mxLog.debug("leaving shape",V,D)};v.drawState(x.getView().getState(x.model.root),r);mxLog.show();mxLog.debug(mxUtils.getXml(z));mxLog.debug("stateCounter",D)}));g.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-2});var Q=null,c=null,f=null,k=null,n=null,q=null,t=null,u=null;g.actions.addAction("testPerformance",mxUtils.bind(this,function(){null!=Q?(x.view.revalidate=Q,Q=null):(Q=x.view.revalidate,x.view.revalidate=function(){var v=Date.now(),d=Q.apply(this,arguments);EditorUi.debug("[Performance] mxGraphView.revalidate",[this],"time",Date.now()-v+" ms","args",arguments);return d});null!=c?(g.selectPage=c,c=null):(c=g.selectPage,g.selectPage=function(){var v=Date.now(),d=c.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.selectPage",[this],"time",Date.now()-v+" ms","args",arguments);return d});null!=f?(g.diffPages=f,f=null):(f=g.diffPages,g.diffPages=function(){var v=Date.now(),d=f.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.diffPages",[this],"time",Date.now()-v+" ms","args",arguments);return d});null!=k?(g.patchPages=k,k=null):(k=g.patchPages,g.patchPages=function(){var v=Date.now(),d=k.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.patchPages",[this],"time",Date.now()-v+" ms","args",arguments);return d});null!=n?(g.clonePages=n,n=null):(n=g.clonePages,g.clonePages=function(){var v=Date.now(),d=n.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.clonePages",[this],"time",Date.now()-v+" ms","args",arguments);return d});null!=t?(g.getHashValueForPages=t,t=null):(t=g.getHashValueForPages,g.getHashValueForPages=function(){var v=Date.now(),d=t.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getHashValueForPages",[this],"time",Date.now()-v+" ms","args",arguments);return d});null!=u?(g.resolveCrossReferences=u,u=null):(u=g.resolveCrossReferences,g.resolveCrossReferences=function(){var v=Date.now(),d=u.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.resolveCrossReferences",[this],"time",Date.now()-v+" ms","args",arguments);return d});null!=q?(g.getFileData=q,q=null):(q=g.getFileData,g.getFileData=function(){var v=Date.now(),d=q.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getFileData",[this],"time",Date.now()-v+" ms","args",arguments);return d});EditorUi.debug("[Performance]",null!=Q?"Enabled":"Disabled")}));this.put("testDevelop",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,"createSidebarEntry showBoundingBox - testCheckPages testChecksum testFixPages - testCheckFile testDiff - testInspect testOptimize - testXmlImageExport -".split(" "),d);var m=v.addItem(mxResources.get("testPerformance"),null,function(){g.actions.get("testPerformance").funct()},d);null!=Q&&v.addCheckmark(m,Editor.checkmarkImage);this.addMenuItems(v,["-","testShowConsole"],d)})))}g.actions.put("shapes",new Action("moreShapes...",function(v){mxClient.IS_CHROMEAPP||!g.isOffline()?g.showDialog((new MoreShapesDialog(g,!0)).container,680,isLocalStorage?mxClient.IS_IOS?500:480:460,!0,!0):g.showDialog((new MoreShapesDialog(g,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)}));g.actions.put("createShape",new Action("shape...",function(v){x.isEnabled()&&(v=new mxCell("",new mxGeometry(0,0,120,120),g.defaultCustomShapeStyle),v.vertex=!0,v=new EditShapeDialog(g,v,mxResources.get("editShape")),g.showDialog(v.container,640,480,!0,!1,null,null,null,-new mxRectangle(0,0,300,200),null,"createShape"),v.init())})).isEnabled=B;g.isOffline()||("1"!=urlParams.embed&&(g.actions.put("embedNotion",new Action("notion...",function(){var v=document.createElement("div");v.style.position="absolute";v.style.bottom="12px";v.style.textAlign="center";v.style.width="100%";v.style.left="0px";var d=document.createElement("a");d.setAttribute("href","javascript:void(0);");d.setAttribute("target","_blank");d.style.cursor="pointer";mxUtils.write(d,mxResources.get("getNotionChromeExtension"));+new mxRectangle(0,0,300,200),null,"createShape"),v.init())})).isEnabled=A;g.isOffline()||("1"!=urlParams.embed&&(g.actions.put("embedNotion",new Action("notion...",function(){var v=document.createElement("div");v.style.position="absolute";v.style.bottom="12px";v.style.textAlign="center";v.style.width="100%";v.style.left="0px";var d=document.createElement("a");d.setAttribute("href","javascript:void(0);");d.setAttribute("target","_blank");d.style.cursor="pointer";mxUtils.write(d,mxResources.get("getNotionChromeExtension"));v.appendChild(d);mxUtils.setPrefixedStyle(d.style,"transition","all 1s ease");mxUtils.setOpacity(d,0);window.setTimeout(function(){mxUtils.setOpacity(d,100)},300);mxEvent.addListener(d,"click",function(m){g.openLink("https://chrome.google.com/webstore/detail/drawio-for-notion/plhaalebpkihaccllnkdaokdoeaokmle");mxEvent.consume(m)});g.getPublicUrl(g.getCurrentFile(),function(m){g.showPublishLinkDialog(mxResources.get("notion"),null,null,!0,"https://www.drawio.com/blog/drawio-notion",v,m,g.getCurrentFile(),-function(r,A,D,G,O,P,V,Y,H,W,Z,X,ba,ea,aa,ha){V=["border=0"];H&&(H=ea?g.getHiddenTagsMap():null,V.push("tags="+encodeURIComponent(JSON.stringify(H||{}))));r=new EmbedDialog(g,g.createLink(r,A,ba,G,O,P,"public"==W?m:null,"copy"==W,V,null,D,null,X,aa,ha));g.showDialog(r.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));r.init()},null,!0)})})),g.actions.addAction("microsoftOffice...",function(){g.openLink("https://office.draw.io")})),g.actions.put("embedHtml",new Action("html...",function(){g.getPublicUrl(g.getCurrentFile(),-function(v){g.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/docs/manual/export/embed-html/",v,function(d,m,r,A,D,G,O,P,V,Y,H,W,Z,X,ba){g.createHtml(d,m,r,A,D,G,O,P,V,Y,H,mxUtils.bind(this,function(ea,aa){g.saveData("embed.html","html","\x3c!-- "+g.editor.appName+" diagram --\x3e\n"+ea+"\n"+aa+"\n","text/html")}),W,Z,X,ba)})})})),g.actions.put("liveImage",new Action("Live image...",function(){var v=g.getCurrentFile();null!=v&&g.getPublicUrl(v,function(d){null!=d?(d=new EmbedDialog(g,-'<img src="'+(v.constructor!=DriveFile?d:"https://drive.google.com/uc?id="+v.getId())+'"/>'),g.showDialog(d.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250)),d.init()):g.handleError({message:mxResources.get("invalidPublicUrl")})})})),g.actions.put("embedImage",new Action("image...",function(){g.showEmbedImageDialog(function(v,d,m,r,A,D,G,O){g.spinner.spin(document.body,mxResources.get("loading"))&&g.createEmbedImage(v,d,m,r,A,D,G,O,function(P){g.spinner.stop();g.saveData("embed.html",-"html",P,"text/html")},function(P){g.spinner.stop();g.handleError(P)})},mxResources.get("image"),mxResources.get("retina"),g.editor.isExportToCanvas(),"https://www.drawio.com/docs/manual/export/embed-diagram/")})),g.actions.put("embedSvg",new Action("formatSvg...",function(){g.showEmbedImageDialog(function(v,d,m,r,A,D,G,O,P,V){g.spinner.spin(document.body,mxResources.get("loading"))&&g.createEmbedSvg(v,d,m,r,A,D,G,O,P,V,function(Y){g.spinner.stop();g.saveData("embed.html","html",Y,"text/html")},function(Y){g.spinner.stop();-g.handleError(Y)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://www.drawio.com/docs/manual/export/embed-svg/",!0,!0)})),g.actions.put("embedIframe",new Action("iframe...",function(){g.getPublicUrl(g.getCurrentFile(),function(v){var d=x.getGraphBounds();g.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,d.height/x.view.scale))+2,null,null,null,v,g.getCurrentFile(),function(m,r,A,D,G,O,P,V,Y,H,W,Z,X,ba,ea,aa){var ha=[];Y&&(Y=ba?g.getHiddenTagsMap():-null,ha.push("tags="+encodeURIComponent(JSON.stringify(Y||{}))));m=new EmbedDialog(g,'<iframe frameborder="0" style="width:'+P+";height:"+V+';" src="'+g.createLink(m,r,X,D,G,O,"public"==H?v:null,"copy"==H,ha,null,A,W,Z,ea,aa)+'"'+(W?' allowtransparency="true"':"")+"></iframe>");g.showDialog(m.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));m.init()},!0,!0)})})));g.actions.put("publishLink",new Action("link...",function(){g.getPublicUrl(g.getCurrentFile(),function(v){g.showPublishLinkDialog(null,-null,null,null,null,null,v,g.getCurrentFile(),function(d,m,r,A,D,G,O,P,V,Y,H,W,Z,X,ba,ea){O=[];A&&V&&(V=X?g.getHiddenTagsMap():null,O.push("tags="+encodeURIComponent(JSON.stringify(V||{}))));d=new EmbedDialog(g,g.createLink(d,m,Z,A,D,G,"public"==Y?v:null,"copy"==Y,O,null,r,null,W,ba,ea));g.showDialog(d.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));d.init()},null,!0)})},null,null,null,!g.isOffline()));if(isLocalStorage||mxClient.IS_CHROMEAPP)z=g.actions.addAction("scratchpad",-function(){g.toggleScratchpad()}),z.setToggleAction(!0),z.setSelectedCallback(function(){return null!=g.scratchpad}),"0"!=urlParams.plugins&&g.actions.addAction("plugins...",function(){g.showDialog((new PluginsDialog(g)).container,380,null,!0,!1)});window.matchMedia&&null!=document.getElementById("high-contrast-stylesheet")&&(z=g.actions.addAction("highContrast",function(){g.setAndPersistHighContrast(!g.isHighContrast())}),z.setToggleAction(!0),z.setSelectedCallback(function(){return g.isHighContrast()}));-z=g.actions.addAction("search",function(){if(null!=g.sidebar){var v=g.sidebar.isEntryVisible("search");g.sidebar.showPalette("search",!v);Editor.isSettingsEnabled()&&(mxSettings.settings.search=!v,mxSettings.save())}});z.label=mxResources.get("searchShapes");z.setToggleAction(!0);z.setSelectedCallback(function(){return null!=g.sidebar&&g.sidebar.isEntryVisible("search")});g.actions.get("clearDefaultStyle").funct=function(v){x.isEnabled()&&("undefined"!==typeof mxSettings&&null!=mxSettings.setCurrentEdgeStyle&&+function(r,z,D,F,N,P,V,X,H,W,Z,Y,ba,ea,aa,ha){V=["border=0"];H&&(H=ea?g.getHiddenTagsMap():null,V.push("tags="+encodeURIComponent(JSON.stringify(H||{}))));r=new EmbedDialog(g,g.createLink(r,z,ba,F,N,P,"public"==W?m:null,"copy"==W,V,null,D,null,Y,aa,ha));g.showDialog(r.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));r.init()},null,!0)})})),g.actions.addAction("microsoftOffice...",function(){g.openLink("https://office.draw.io")})),g.actions.put("embedHtml",new Action("html...",function(){g.getPublicUrl(g.getCurrentFile(),+function(v){g.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/docs/manual/export/embed-html/",v,function(d,m,r,z,D,F,N,P,V,X,H,W,Z,Y,ba){g.createHtml(d,m,r,z,D,F,N,P,V,X,H,mxUtils.bind(this,function(ea,aa){g.saveData("embed.html","html","\x3c!-- "+g.editor.appName+" diagram --\x3e\n"+ea+"\n"+aa+"\n","text/html")}),W,Z,Y,ba)})})})),g.actions.put("liveImage",new Action("Live image...",function(){var v=g.getCurrentFile();null!=v&&g.getPublicUrl(v,function(d){null!=d?(d=new EmbedDialog(g,+'<img src="'+(v.constructor!=DriveFile?d:"https://drive.google.com/uc?id="+v.getId())+'"/>'),g.showDialog(d.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250)),d.init()):g.handleError({message:mxResources.get("invalidPublicUrl")})})})),g.actions.put("embedImage",new Action("image...",function(){g.showEmbedImageDialog(function(v,d,m,r,z,D,F,N){g.spinner.spin(document.body,mxResources.get("loading"))&&g.createEmbedImage(v,d,m,r,z,D,F,N,function(P){g.spinner.stop();g.saveData("embed.html",+"html",P,"text/html")},function(P){g.spinner.stop();g.handleError(P)})},mxResources.get("image"),mxResources.get("retina"),g.editor.isExportToCanvas(),"https://www.drawio.com/docs/manual/export/embed-diagram/")})),g.actions.put("embedSvg",new Action("formatSvg...",function(){g.showEmbedImageDialog(function(v,d,m,r,z,D,F,N,P,V){g.spinner.spin(document.body,mxResources.get("loading"))&&g.createEmbedSvg(v,d,m,r,z,D,F,N,P,V,function(X){g.spinner.stop();g.saveData("embed.html","html",X,"text/html")},function(X){g.spinner.stop();+g.handleError(X)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://www.drawio.com/docs/manual/export/embed-svg/",!0,!0)})),g.actions.put("embedIframe",new Action("iframe...",function(){g.getPublicUrl(g.getCurrentFile(),function(v){var d=x.getGraphBounds();g.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,d.height/x.view.scale))+2,null,null,null,v,g.getCurrentFile(),function(m,r,z,D,F,N,P,V,X,H,W,Z,Y,ba,ea,aa){var ha=[];X&&(X=ba?g.getHiddenTagsMap():+null,ha.push("tags="+encodeURIComponent(JSON.stringify(X||{}))));m=new EmbedDialog(g,'<iframe frameborder="0" style="width:'+P+";height:"+V+';" src="'+g.createLink(m,r,Y,D,F,N,"public"==H?v:null,"copy"==H,ha,null,z,W,Z,ea,aa)+'"'+(W?' allowtransparency="true"':"")+"></iframe>");g.showDialog(m.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));m.init()},!0,!0)})})));g.actions.put("publishLink",new Action("link...",function(){g.getPublicUrl(g.getCurrentFile(),function(v){g.showPublishLinkDialog(null,+null,null,null,null,null,v,g.getCurrentFile(),function(d,m,r,z,D,F,N,P,V,X,H,W,Z,Y,ba,ea){N=[];z&&V&&(V=Y?g.getHiddenTagsMap():null,N.push("tags="+encodeURIComponent(JSON.stringify(V||{}))));d=new EmbedDialog(g,g.createLink(d,m,Z,z,D,F,"public"==X?v:null,"copy"==X,N,null,r,null,W,ba,ea));g.showDialog(d.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));d.init()},null,!0)})},null,null,null,!g.isOffline()));if(isLocalStorage||mxClient.IS_CHROMEAPP)y=g.actions.addAction("scratchpad",+function(){g.toggleScratchpad()}),y.setToggleAction(!0),y.setSelectedCallback(function(){return null!=g.scratchpad}),"0"!=urlParams.plugins&&g.actions.addAction("plugins...",function(){g.showDialog((new PluginsDialog(g)).container,380,null,!0,!1)});window.matchMedia&&null!=document.getElementById("high-contrast-stylesheet")&&(y=g.actions.addAction("highContrast",function(){g.setAndPersistHighContrast(!g.isHighContrast())}),y.setToggleAction(!0),y.setSelectedCallback(function(){return g.isHighContrast()}));+y=g.actions.addAction("search",function(){if(null!=g.sidebar){var v=g.sidebar.isEntryVisible("search");g.sidebar.showPalette("search",!v);Editor.isSettingsEnabled()&&(mxSettings.settings.search=!v,mxSettings.save())}});y.label=mxResources.get("searchShapes");y.setToggleAction(!0);y.setSelectedCallback(function(){return null!=g.sidebar&&g.sidebar.isEntryVisible("search")});g.actions.get("clearDefaultStyle").funct=function(v){x.isEnabled()&&("undefined"!==typeof mxSettings&&null!=mxSettings.setCurrentEdgeStyle&&null!=mxSettings.settings&&mxSettings.setCurrentEdgeStyle(null),g.clearDefaultStyle(),Editor.sketchMode&&g.setSketchMode(!1))};"1"==urlParams.embed&&(g.actions.get("saveAs").setEnabled(!1),g.actions.get("save").funct=function(v){x.isEditing()&&x.stopEditing();var d="0"!=urlParams.pages||null!=g.pages&&1<g.pages.length?g.getFileData(!0):mxUtils.getXml(g.editor.getGraphXml());if("json"==urlParams.proto){var m=g.createLoadMessage("save");m.xml=d;!0!==v||"1"!=urlParams.saveAndExit&&"1"!=urlParams.publishClose||(m.exit=!0);d=JSON.stringify(m)}(window.opener||window.parent).postMessage(d,"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(g.editor.modified=!1,g.clearStatus());v=g.getCurrentFile();null==v||v.constructor==EmbedFile||v.constructor==LocalFile&&null==v.mode||g.saveFile()},g.actions.addAction("saveAndExit",function(){"1"==urlParams.toSvg?g.sendEmbeddedSvgExport():g.actions.get("save").funct(!0)},null,null,Editor.ctrlKey+"+S").label="1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),g.actions.addAction("exit",function(){if("1"==urlParams.embedInline)g.sendEmbeddedSvgExport();else{var v=function(){g.editor.modified=!1;var d="json"==urlParams.proto?JSON.stringify({event:"exit",modified:g.editor.modified}):"";(window.opener||window.parent).postMessage(d,"*")};g.editor.modified?g.confirm(mxResources.get("allChangesLost"),null,v,mxResources.get("cancel"),mxResources.get("discardChanges")):v()}},null,null,"1"==urlParams.embedInline?"Escape":null));this.put("exportAs",new Menu(mxUtils.bind(this,function(v,d){g.editor.isExportToCanvas()?(this.addMenuItems(v,["exportPng"],d),Editor.jpgSupported&&this.addMenuItems(v,["exportJpg"],d),Editor.webpSupported&&this.addMenuItems(v,["exportWebp"],d)):g.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(v,["exportPng","exportJpg"],d);g.editor.isExportToCanvas()&&this.addMenuItems(v,["exportAnimatedGif"],d);this.addMenuItems(v,["exportSvg","-"],d);g.isOffline()||g.printPdfExport?this.addMenuItems(v,["exportPdf"],d):g.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(v,["exportPdf"],d);!g.vsdxExportEnabled()||"undefined"===typeof VsdxExport&&g.isOffline()||this.addMenuItems(v,["exportVsdx"],d);var m=["-","exportHtml","exportXml"];Editor.enableExportUrl&&m.push("exportUrl");m.push("exportJson");this.addMenuItems(v,m,d);g.isOffline()||(v.addSeparator(d),this.addMenuItem(v,"export",d).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...");mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||-"min"!=Editor.currentTheme||g.isOffline()||this.addMenuItems(v,["publishLink"],d);g.mode==App.MODE_ATLAS||"1"==urlParams.extAuth||"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||g.isOffline()||(v.addSeparator(d),g.menus.addSubmenu("embed",v,d))})));this.put("importFrom",new Menu(mxUtils.bind(this,function(v,d){function m(D){D.pickFile(function(G){g.spinner.spin(document.body,mxResources.get("loading"))&&D.getFile(G,function(O){var P="data:image/"==O.getData().substring(0,-11)?A(O.getTitle()):"text/xml";/\.svg$/i.test(O.getTitle())&&!g.editor.isDataSvg(O.getData())&&(O.setData(Editor.createSvgDataUri(O.getData())),P="image/svg+xml");r(O.getData(),P,O.getTitle())},function(O){g.handleError(O,null!=O?mxResources.get("errorLoadingFile"):null)},D==g.drive)},!0)}var r=mxUtils.bind(this,function(D,G,O){var P=x.view,V=x.getGraphBounds(),Y=x.snap(Math.ceil(Math.max(0,V.x/P.scale-P.translate.x)+4*x.gridSize)),H=x.snap(Math.ceil(Math.max(0,(V.y+V.height)/P.scale-P.translate.y)+-4*x.gridSize));"data:image/"==D.substring(0,11)?g.loadImage(D,mxUtils.bind(this,function(W){var Z=!0,X=mxUtils.bind(this,function(){g.resizeImage(W,D,mxUtils.bind(this,function(ba,ea,aa){ba=Z?Math.min(1,Math.min(g.maxImageSize/ea,g.maxImageSize/aa)):1;g.importFile(D,G,Y,H,Math.round(ea*ba),Math.round(aa*ba),O,function(ha){g.spinner.stop();x.setSelectionCells(ha);x.scrollCellToVisible(x.getSelectionCell())})}),Z)});D.length>g.resampleThreshold?g.confirmImageResize(function(ba){Z=ba;X()}):X()}),mxUtils.bind(this,-function(){g.handleError({message:mxResources.get("cannotOpenFile")})})):g.importFile(D,G,Y,H,0,0,O,function(W){g.spinner.stop();x.setSelectionCells(W);x.scrollCellToVisible(x.getSelectionCell())})}),A=mxUtils.bind(this,function(D){var G="text/xml";/\.png$/i.test(D)?G="image/png":/\.jpe?g$/i.test(D)?G="image/jpg":/\.gif$/i.test(D)?G="image/gif":/\.pdf$/i.test(D)&&(G="application/pdf");return G});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=g.drive?v.addItem(mxResources.get("googleDrive")++"min"!=Editor.currentTheme||g.isOffline()||this.addMenuItems(v,["publishLink"],d);g.mode==App.MODE_ATLAS||"1"==urlParams.extAuth||"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||g.isOffline()||(v.addSeparator(d),g.menus.addSubmenu("embed",v,d))})));this.put("importFrom",new Menu(mxUtils.bind(this,function(v,d){function m(D){D.pickFile(function(F){g.spinner.spin(document.body,mxResources.get("loading"))&&D.getFile(F,function(N){var P="data:image/"==N.getData().substring(0,+11)?z(N.getTitle()):"text/xml";/\.svg$/i.test(N.getTitle())&&!g.editor.isDataSvg(N.getData())&&(N.setData(Editor.createSvgDataUri(N.getData())),P="image/svg+xml");r(N.getData(),P,N.getTitle())},function(N){g.handleError(N,null!=N?mxResources.get("errorLoadingFile"):null)},D==g.drive)},!0)}var r=mxUtils.bind(this,function(D,F,N){var P=x.view,V=x.getGraphBounds(),X=x.snap(Math.ceil(Math.max(0,V.x/P.scale-P.translate.x)+4*x.gridSize)),H=x.snap(Math.ceil(Math.max(0,(V.y+V.height)/P.scale-P.translate.y)++4*x.gridSize));"data:image/"==D.substring(0,11)?g.loadImage(D,mxUtils.bind(this,function(W){var Z=!0,Y=mxUtils.bind(this,function(){g.resizeImage(W,D,mxUtils.bind(this,function(ba,ea,aa){ba=Z?Math.min(1,Math.min(g.maxImageSize/ea,g.maxImageSize/aa)):1;g.importFile(D,F,X,H,Math.round(ea*ba),Math.round(aa*ba),N,function(ha){g.spinner.stop();x.setSelectionCells(ha);x.scrollCellToVisible(x.getSelectionCell())})}),Z)});D.length>g.resampleThreshold?g.confirmImageResize(function(ba){Z=ba;Y()}):Y()}),mxUtils.bind(this,+function(){g.handleError({message:mxResources.get("cannotOpenFile")})})):g.importFile(D,F,X,H,0,0,N,function(W){g.spinner.stop();x.setSelectionCells(W);x.scrollCellToVisible(x.getSelectionCell())})}),z=mxUtils.bind(this,function(D){var F="text/xml";/\.png$/i.test(D)?F="image/png":/\.jpe?g$/i.test(D)?F="image/jpg":/\.gif$/i.test(D)?F="image/gif":/\.pdf$/i.test(D)&&(F="application/pdf");return F});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=g.drive?v.addItem(mxResources.get("googleDrive")+"...",null,function(){m(g.drive)},d):g.isModeEnabled(App.MODE_GOOGLE)&&v.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));g.isModeReady(App.MODE_ONEDRIVE)?v.addItem(mxResources.get("oneDrive")+"...",null,function(){m(g.oneDrive)},d):g.isModeEnabled(App.MODE_ONEDRIVE)&&v.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);g.isModeReady(App.MODE_DROPBOX)?v.addItem(mxResources.get("dropbox")+"...",null,function(){m(g.dropbox)},d):g.isModeEnabled(App.MODE_DROPBOX)&&v.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);v.addSeparator(d);g.isModeReady(App.MODE_GITHUB)&&v.addItem(mxResources.get("github")+"...",null,function(){m(g.gitHub)},d);g.isModeReady(App.MODE_GITLAB)&&v.addItem(mxResources.get("gitlab")+"...",null,function(){m(g.gitLab)},d);g.isModeReady(App.MODE_TRELLO)?v.addItem(mxResources.get("trello")+"...",null,function(){m(g.trello)},d):g.isModeEnabled(App.MODE_TRELLO)&&v.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);v.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&v.addItem(mxResources.get("browser")+"...",null,function(){g.importLocalFile(!1)},d);"1"!=urlParams.noDevice&&v.addItem(mxResources.get("device")+"...",null,function(){g.importLocalFile(!0)},d);g.isOffline()||(v.addSeparator(d),v.addItem(mxResources.get("url")+"...",null,function(){var D=new FilenameDialog(g,-"",mxResources.get("import"),function(G){if(null!=G&&0<G.length&&g.spinner.spin(document.body,mxResources.get("loading"))){var O=/(\.png)($|\?)/i.test(G)?"image/png":"text/xml";g.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(G),function(P){r(P,O,G)},function(){g.spinner.stop();g.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==O)}},mxResources.get("url"));g.showDialog(D.container,300,80,!0,!0);D.init()},d))}))).isEnabled=B;this.put("dynamicAppearance",new Menu(mxUtils.bind(this,+"",mxResources.get("import"),function(F){if(null!=F&&0<F.length&&g.spinner.spin(document.body,mxResources.get("loading"))){var N=/(\.png)($|\?)/i.test(F)?"image/png":"text/xml";g.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(F),function(P){r(P,N,F)},function(){g.spinner.stop();g.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==N)}},mxResources.get("url"));g.showDialog(D.container,300,80,!0,!0);D.init()},d))}))).isEnabled=A;this.put("dynamicAppearance",new Menu(mxUtils.bind(this,function(v,d){var m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;"simple"==Editor.currentTheme&&(750>m&&this.addSubmenu("viewZoom",v,d,mxResources.get("zoom")),460>m&&g.isPageMenuVisible()&&this.addSubmenu("pages",v,d),320>m&&this.addSubmenu("insert",v,d),360>m&&"1"!=urlParams.embed&&"draw.io"==g.getServiceName()&&this.addSubmenu("share",v,d))})));this.put("appearance",new Menu(mxUtils.bind(this,function(v,d){if(g.isAutoDarkModeSupported()){var m=g.menus.addMenuItem(v,"autoMode",d);null!=m&&m.setAttribute("title",mxResources.get("automatic")+" ("+mxResources.get(Editor.isDarkMode()?"dark":"light")+")")}this.addMenuItems(v,["lightMode","darkMode","-"],d);m=g.menus.addMenuItem(v,"highContrast",d);(!g.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&g.menus.addLinkToItem(m,"https://github.com/jgraph/drawio/issues/4296")})));g.actions.addAction("addToScratchpad",function(v){x.isSelectionEmpty()||null==g.addSelectionToScratchpad||g.addSelectionToScratchpad(v)});-g.actions.addAction("accounts...",function(){g.toggleUserPanel();g.userPanel.style.right="10px";g.userPanel.style.top="10px"});this.put("theme",new Menu(mxUtils.bind(this,function(v,d){var m="1"==urlParams.sketch?"sketch":mxSettings.getUi(),r=v.addItem(mxResources.get("automatic"),null,function(){g.setCurrentTheme("")},d),A=v.addItem(mxResources.get("classic"),null,function(){g.setCurrentTheme("kennedy")},d),D=!1;if("kennedy"==m||"dark"==m)v.addCheckmark(A,Editor.checkmarkImage),D=!0;for(var G=0;G<-Editor.themes.length;G++)mxUtils.bind(this,function(O){A=v.addItem(mxResources.get("min"==O?"minimal":O),null,function(){g.setCurrentTheme(O)},d);m==O&&(v.addCheckmark(A,Editor.checkmarkImage),D=!0);"simple"==O&&v.addSeparator(d)})(Editor.themes[G]);D||v.addCheckmark(r,Editor.checkmarkImage)})));z=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var v=this.editorUi.getCurrentFile();if(null!=v)if(v.constructor==LocalFile&&null!=v.fileHandle)g.showSaveFilePicker(mxUtils.bind(g,+g.actions.addAction("accounts...",function(){g.toggleUserPanel();g.userPanel.style.right="10px";g.userPanel.style.top="10px"});this.put("theme",new Menu(mxUtils.bind(this,function(v,d){var m="1"==urlParams.sketch?"sketch":mxSettings.getUi(),r=v.addItem(mxResources.get("automatic"),null,function(){g.setCurrentTheme("")},d),z=v.addItem(mxResources.get("classic"),null,function(){g.setCurrentTheme("kennedy")},d),D=!1;if("kennedy"==m||"dark"==m)v.addCheckmark(z,Editor.checkmarkImage),D=!0;for(var F=0;F<+Editor.themes.length;F++)mxUtils.bind(this,function(N){z=v.addItem(mxResources.get("min"==N?"minimal":N),null,function(){g.setCurrentTheme(N)},d);m==N&&(v.addCheckmark(z,Editor.checkmarkImage),D=!0);"simple"==N&&v.addSeparator(d)})(Editor.themes[F]);D||v.addCheckmark(r,Editor.checkmarkImage)})));y=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var v=this.editorUi.getCurrentFile();if(null!=v)if(v.constructor==LocalFile&&null!=v.fileHandle)g.showSaveFilePicker(mxUtils.bind(g,function(m,r){v.invalidFileHandle=null;v.fileHandle=m;v.title=r.name;v.desc=r;g.save(r.name)}),null,g.createFileSystemOptions(v.getTitle()));else{var d=null!=v.getTitle()?v.getTitle():this.editorUi.defaultFilename;d=new FilenameDialog(this.editorUi,d,mxResources.get("rename"),mxUtils.bind(this,function(m){null!=m&&0<m.length&&null!=v&&m!=v.getTitle()&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&v.rename(m,mxUtils.bind(this,function(r){this.editorUi.spinner.stop()}),mxUtils.bind(this,-function(r){this.editorUi.handleError(r,null!=r?mxResources.get("errorRenamingFile"):null)}))}),v.constructor==DriveFile||v.constructor==StorageFile?mxResources.get("diagramName"):null,function(m){if(null!=m&&0<m.length)return!0;g.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,FilenameDialog.filenameHelpLink,null,null,g.editor.fileExtensions);this.editorUi.showDialog(d.container,340,100,!0,!0);d.init()}}));z.isEnabled=function(){return this.enabled&&-B.apply(this,arguments)};z.visible="1"!=urlParams.embed;g.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var v=g.getCurrentFile();if(null!=v){var d=g.getCopyFilename(v);v.constructor==DriveFile?(d=new SaveDialog(g,d,mxUtils.bind(this,function(m,r,A){g.hideDialog();v.copyFile(mxUtils.bind(this,function(D){v.move(A,mxUtils.bind(this,function(G){g.spinner.stop()}),mxUtils.bind(this,function(G){g.handleError(G)}))}),mxUtils.bind(this,function(D){g.handleError(D)}),m.value)}),null,null,null,-null,null,null,[App.MODE_GOOGLE],mxResources.get("ok")),g.showDialog(d.container,420,162,!0,!1,mxUtils.bind(this,function(){g.hideDialog()})),d.init()):g.editor.editAsNew(this.editorUi.getFileData(!0),d)}}));z=new Action("openFolder",function(v,d){v=g.getCurrentFile();null!=v&&g.openLink(v.getFolderUrl())});z.getTitle=function(){return mxResources.get("openIt",[mxResources.get("folder")])+"..."};g.actions.put("openFolder",z);g.actions.addAction("openFile...",mxUtils.bind(this,function(){var v=g.getCurrentFile();-null!=v&&g.openLink(v.getFileUrl())}));g.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var v=g.getCurrentFile();if(v.getMode()==App.MODE_GOOGLE||v.getMode()==App.MODE_ONEDRIVE){var d=new SaveDialog(g,"",mxUtils.bind(this,function(m,r,A){g.hideDialog();g.spinner.spin(document.body,mxResources.get("moving"))&&v.move(A,mxUtils.bind(this,function(D){g.spinner.stop()}),mxUtils.bind(this,function(D){g.handleError(D)}))}),null,null,null,null,null,v.getMode());g.showDialog(d.container,+function(r){this.editorUi.handleError(r,null!=r?mxResources.get("errorRenamingFile"):null)}))}),v.constructor==DriveFile||v.constructor==StorageFile?mxResources.get("diagramName"):null,function(m){if(null!=m&&0<m.length)return!0;g.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,FilenameDialog.filenameHelpLink,null,null,g.editor.fileExtensions);this.editorUi.showDialog(d.container,340,100,!0,!0);d.init()}}));y.isEnabled=function(){return this.enabled&&+A.apply(this,arguments)};y.visible="1"!=urlParams.embed;g.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var v=g.getCurrentFile();if(null!=v){var d=g.getCopyFilename(v);v.constructor==DriveFile?(d=new SaveDialog(g,d,mxUtils.bind(this,function(m,r,z){g.hideDialog();v.copyFile(mxUtils.bind(this,function(D){v.move(z,mxUtils.bind(this,function(F){g.spinner.stop()}),mxUtils.bind(this,function(F){g.handleError(F)}))}),mxUtils.bind(this,function(D){g.handleError(D)}),m.value)}),null,null,null,+null,null,null,[App.MODE_GOOGLE],mxResources.get("ok")),g.showDialog(d.container,420,162,!0,!1,mxUtils.bind(this,function(){g.hideDialog()})),d.init()):g.editor.editAsNew(this.editorUi.getFileData(!0),d)}}));y=new Action("openFolder",function(v,d){v=g.getCurrentFile();null!=v&&g.openLink(v.getFolderUrl())});y.getTitle=function(){return mxResources.get("openIt",[mxResources.get("folder")])+"..."};g.actions.put("openFolder",y);g.actions.addAction("openFile...",mxUtils.bind(this,function(){var v=g.getCurrentFile();+null!=v&&g.openLink(v.getFileUrl())}));g.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var v=g.getCurrentFile();if(v.getMode()==App.MODE_GOOGLE||v.getMode()==App.MODE_ONEDRIVE){var d=new SaveDialog(g,"",mxUtils.bind(this,function(m,r,z){g.hideDialog();g.spinner.spin(document.body,mxResources.get("moving"))&&v.move(z,mxUtils.bind(this,function(D){g.spinner.stop()}),mxUtils.bind(this,function(D){g.handleError(D)}))}),null,null,null,null,null,v.getMode());g.showDialog(d.container,420,82,!0,!1,mxUtils.bind(this,function(){g.hideDialog()}));d.init()}}));this.put("publish",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,["publishLink","presentationMode"],d)})));g.actions.put("presentationMode",new Action("presentationMode...",function(){var v=Editor.isDarkMode(),d=document.createElement("div");d.style.cssText="position:fixed;inset:0;z-index:999;background-color:#000000";document.body.appendChild(d);for(var m={},r="pages page-id nav layers dark toolbar".split(" "),-A=0;A<r.length;A++)m[r[A]]=urlParams[r[A]];urlParams.pages="1";urlParams["page-id"]=null!=g.currentPage?g.currentPage.getId():null;urlParams.nav="1";urlParams.layers="1";urlParams.dark=v?"1":"0";urlParams.toolbar="0";A=EditorUi.prototype.updateActionStates;var D=EditorUi.prototype.addBeforeUnloadListener,G=EditorUi.prototype.addChromelessClickHandler;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=-function(){};var O=new EditorUi(new Editor(!0),document.createElement("div"),!0);EditorUi.prototype.updateActionStates=A;EditorUi.prototype.addBeforeUnloadListener=D;EditorUi.prototype.addChromelessClickHandler=G;O.refresh=function(){};O.updateHashObject=function(){};var P=O.editor.graph;A=P.container;A.style.cssText="position:fixed;inset:0;overflow:hidden;outline:none;z-index:999";var V=document.body.style.overflow;document.body.style.overflow="hidden";var Y=document.createElement("div");Y.style.cssText=+z=0;z<r.length;z++)m[r[z]]=urlParams[r[z]];urlParams.pages="1";urlParams["page-id"]=null!=g.currentPage?g.currentPage.getId():null;urlParams.nav="1";urlParams.layers="1";urlParams.dark=v?"1":"0";urlParams.toolbar="0";z=EditorUi.prototype.updateActionStates;var D=EditorUi.prototype.addBeforeUnloadListener,F=EditorUi.prototype.addChromelessClickHandler;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=+function(){};var N=new EditorUi(new Editor(!0),document.createElement("div"),!0);EditorUi.prototype.updateActionStates=z;EditorUi.prototype.addBeforeUnloadListener=D;EditorUi.prototype.addChromelessClickHandler=F;N.refresh=function(){};N.updateHashObject=function(){};var P=N.editor.graph;z=P.container;z.style.cssText="position:fixed;inset:0;overflow:hidden;outline:none;z-index:999";var V=document.body.style.overflow;document.body.style.overflow="hidden";var X=document.createElement("div");X.style.cssText="position:fixed;top:10px;right:10px;z-index:1000;display:inline-flex;align-items:center;gap:2px;padding:4px;white-space:nowrap;cursor:default;border:1px solid;border-radius:6px;background-color:"+(v?"#2a2a2a":"#ffffff")+";border-color:"+(v?"#505050":"#e0e0e0")+";box-shadow:0 2px 6px "+(v?"rgba(0,0,0,0.4)":"rgba(0,0,0,0.1)");var H=v?"invert(80%)":"none",W=function(ea,aa,ha){var na=document.createElement("img");na.setAttribute("src",aa);na.setAttribute("title",ha||"");na.setAttribute("border","0");-na.style.cssText="width:16px;height:16px;cursor:pointer;display:block;padding:2px;opacity:0.6;filter:"+H;na.className="geAdaptiveAsset";mxEvent.addListener(na,"mouseenter",function(){na.style.opacity="1"});mxEvent.addListener(na,"mouseleave",function(){na.style.opacity="0.6"});mxEvent.addListener(na,"click",function(ra){ea(ra);mxEvent.consume(ra)});Y.appendChild(na);return na},Z=function(){if(null!=O.pages&&1<O.pages.length){var ea=W(function(aa){O.showPopupMenu(function(ha,na){for(na=0;na<O.pages.length;na++)(function(ra){var sa=-ha.addItem(O.getShortPageName(O.pages[ra]),null,function(){O.selectPage(O.pages[ra]);O.lightboxFit();O.chromelessResize()}),ua=O.pages[ra].getId();sa.setAttribute("title",O.pages[ra].getName()+" ("+(ra+1)+"/"+O.pages.length+")"+(null!=ua?" ["+ua+"]":""));O.pages[ra]==O.currentPage&&ha.addCheckmark(sa,Editor.checkmarkImage)})(na)},mxEvent.getClientX(aa),mxEvent.getClientY(aa),aa)},Editor.chevronDownImage,mxResources.get("pages"));Y.insertBefore(ea,Y.firstChild)}};W(function(){P.zoomOut();O.chromelessResize(!1)},-Editor.zoomOutImage,mxResources.get("zoomOut"));W(function(){P.zoomIn();O.chromelessResize(!1)},Editor.zoomInImage,mxResources.get("zoomIn"));W(function(){1==P.view.scale?O.lightboxFit():P.zoomTo(1);O.chromelessResize(!1)},Editor.zoomFitImage,mxResources.get("smartFit"));W(function(){O.destroy()},Editor.closeImage,mxResources.get("close")+" (Escape)");var X=O.destroy;O.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",ba);document.body.removeChild(d);document.body.removeChild(Y);-document.body.style.overflow=V;for(var ea=0;ea<r.length;ea++)urlParams[r[ea]]=m[r[ea]];X.apply(this,arguments)};var ba=function(ea){27==ea.keyCode&&O.destroy()};mxEvent.addListener(document.documentElement,"keydown",ba);document.body.appendChild(A);document.body.appendChild(Y);window.setTimeout(function(){try{O.setFileData(g.getFileData(!0)),Z(),O.lightboxFit(),O.chromelessResize()}catch(ea){O.handleError(ea,null,function(){O.destroy()})}},0)}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,-function(){try{var v=g.getCurrentFile();null!=v&&v.share()}catch(d){g.handleError(d)}})).isEnabled=B;this.put("embed",new Menu(mxUtils.bind(this,function(v,d){var m=g.getCurrentFile();null==m||m.getMode()!=App.MODE_GOOGLE&&m.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(m.getTitle())||this.addMenuItems(v,["liveImage","-"],d);this.addMenuItems(v,["embedImage","embedSvg","-","embedHtml"],d);navigator.standalone||g.isOffline()||this.addMenuItems(v,["embedIframe"],d);this.addMenuItems(v,["-","microsoftOffice",-"-","embedNotion"],d)})));z=function(v){var d=mxResources.get(v);g.actions.put(v,new Action(d+"...",function(m){m=new ParseDialog(g,d,v);g.showDialog(m.container,640,420,!0,!1,null,null,null,new mxRectangle(0,0,440,280));m.init()})).isEnabled=B};var y=function(v,d,m,r){g.actions.put(v,new Action(mxResources.get(v),function(){if(x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())){var A=new mxCell("",new mxGeometry(0,0,0,0),d);A.vertex=!0;for(var D=x.getFreeInsertPoint(),G=[],O=0;O<r.nodes.length;O++){var P=-new mxCell(r.nodes[O],new mxGeometry(D.x+20,D.y+20,100,40),"whiteSpace=wrap;html=1;");P.vertex=!0;G.push(A.insert(P))}for(O=0;O<r.edges.length;O++)D=new mxCell("",new mxGeometry,m),D.geometry.relative=!0,D.edge=!0,G[r.edges[O][0]].insertEdge(D,!0),G[r.edges[O][1]].insertEdge(D,!1),A.insert(D);U(A)}})).isEnabled=B},E={nodes:["Root","Child 1","Child 2"],edges:[[0,1],[0,2]]},I={nodes:["Start","Task","Task","End"],edges:[[0,1],[0,2],[1,3],[2,3]]},C=function(v,d){y(v,Menus.layoutContainers[v].style,Menus.layoutContainerEdgeStyle,-d)};C("horizontalFlow",I);C("verticalFlow",I);C("horizontalTree",E);C("verticalTree",E);C("radialTree",E);C("organic",E);C("circle",E);z("mermaid");z("fromText");z("formatSql");z("plantUml");var U=function(v){x.getModel().beginUpdate();try{v=x.addCell(v),x.fireEvent(new mxEventObject("cellsInserted","cells",[v])),x.model.isVertex(v)&&x.isAutoSizeCell(v)&&x.updateCellSize(v)}finally{x.getModel().endUpdate()}x.scrollCellToVisible(v);x.setSelectionCell(v);x.container.focus();x.editAfterInsert&&x.startEditing(v);-window.setTimeout(function(){null!=g.hoverIcons&&g.hoverIcons.update(x.view.getState(v))},0);return v},J=function(v,d,m,r,A){v=new mxCell(v,new mxGeometry(0,0,d,m),r);v.vertex=!0;null==A&&(A=x.getCenterInsertPoint(x.getBoundingBoxFromGeometry([v],!0)));v.geometry.x=A.x;v.geometry.y=A.y;return U(v)};g.actions.put("insertText",new Action("text",function(v){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&x.startEditingAtCell(J("Text",60,30,x.appendFontSize(Editor.defaultTextStyle,x.vertexFontSize),-null==v||mxEvent.isControlDown(v)||mxEvent.isMetaDown(v)||!x.isMouseInsertPoint()?null:x.getInsertPoint()))},null,null,"A")).isEnabled=B;g.actions.put("insertRectangle",new Action("rectangle",function(v){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&J("",120,60,"whiteSpace=wrap;html=1;",null==v||mxEvent.isControlDown(v)||mxEvent.isMetaDown(v)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"D")).isEnabled=B;g.actions.put("insertNote",new Action("note",function(v){x.isEnabled()&&-!x.isCellLocked(x.getDefaultParent())&&J("",160,160,Editor.defaultNoteStyle,null==v||mxEvent.isControlDown(v)||mxEvent.isMetaDown(v)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"S")).isEnabled=B;g.actions.put("insertEllipse",new Action("ellipse",function(v){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&J("",80,80,"ellipse;whiteSpace=wrap;html=1;",null==v||mxEvent.isControlDown(v)||mxEvent.isMetaDown(v)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"F")).isEnabled=-B;g.actions.put("insertRhombus",new Action("rhombus",function(v){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&J("",80,80,"rhombus;whiteSpace=wrap;html=1;",null==v||mxEvent.isControlDown(v)||mxEvent.isMetaDown(v)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"R")).isEnabled=B;g.actions.put("insertEdge",new Action("line",function(v){if(x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())){var d=x.defaultEdgeLength;v=null==v||mxEvent.isControlDown(v)||mxEvent.isMetaDown(v)||!x.isMouseInsertPoint()?-null:x.getInsertPoint();null==v&&(v=x.getCenterInsertPoint(x.getBoundingBoxFromGeometry([m],!0)));var m=new mxCell("",new mxGeometry(0,0,d,0),"edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;");m.geometry.setTerminalPoint(v,!0);m.geometry.setTerminalPoint(new mxPoint(v.x+m.geometry.width,v.y),!1);m.geometry.points=[];m.geometry.relative=!0;m.edge=!0;U(m)}},null,null,"C")).isEnabled=B;g.actions.put("insertPolygon",new Action("polygon...",function(v){if(x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())){var d=-new PolygonDialog(g,null,function(m){m=new mxCell("",new mxGeometry(0,0,80,80),m);m.vertex=!0;var r=null==v||mxEvent.isControlDown(v)||mxEvent.isMetaDown(v)||!x.isMouseInsertPoint()?null:x.getInsertPoint();null==r&&(r=x.getCenterInsertPoint(x.getBoundingBoxFromGeometry([m],!0)));m.geometry.x=r.x;m.geometry.y=r.y;return U(m)});g.showDialog(d.container,680,540,!0,!0,function(){d.destroy()},null,null,new mxRectangle(0,0,740,600),null,"insertPolygon");d.init()}})).isEnabled=B;z=g.actions.put("toggleShapes",-new Action("shapes",function(){null!=g.sidebarWindow?g.sidebarWindow.window.setVisible(!g.sidebarWindow.window.isVisible()):g.toggleShapesPanel(!g.isShapesPanelVisible())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+K"));z.setToggleAction(!0);z.setSelectedCallback(mxUtils.bind(this,function(){return null!=g.sidebarWindow&&g.sidebarWindow.window.isVisible()||null==g.sidebarWindow&&0<g.hsplitPosition}));g.actions.put("showShapePicker",new Action(mxResources.get("shapes")+"...",function(){var v=x._contextMenuScreenPoint;+na.style.cssText="width:16px;height:16px;cursor:pointer;display:block;padding:2px;opacity:0.6;filter:"+H;na.className="geAdaptiveAsset";mxEvent.addListener(na,"mouseenter",function(){na.style.opacity="1"});mxEvent.addListener(na,"mouseleave",function(){na.style.opacity="0.6"});mxEvent.addListener(na,"click",function(ra){ea(ra);mxEvent.consume(ra)});X.appendChild(na);return na},Z=function(){if(null!=N.pages&&1<N.pages.length){var ea=W(function(aa){N.showPopupMenu(function(ha,na){for(na=0;na<N.pages.length;na++)(function(ra){var sa=+ha.addItem(N.getShortPageName(N.pages[ra]),null,function(){N.selectPage(N.pages[ra]);N.lightboxFit();N.chromelessResize()}),ua=N.pages[ra].getId();sa.setAttribute("title",N.pages[ra].getName()+" ("+(ra+1)+"/"+N.pages.length+")"+(null!=ua?" ["+ua+"]":""));N.pages[ra]==N.currentPage&&ha.addCheckmark(sa,Editor.checkmarkImage)})(na)},mxEvent.getClientX(aa),mxEvent.getClientY(aa),aa)},Editor.chevronDownImage,mxResources.get("pages"));X.insertBefore(ea,X.firstChild)}};W(function(){P.zoomOut();N.chromelessResize(!1)},+Editor.zoomOutImage,mxResources.get("zoomOut"));W(function(){P.zoomIn();N.chromelessResize(!1)},Editor.zoomInImage,mxResources.get("zoomIn"));W(function(){1==P.view.scale?N.lightboxFit():P.zoomTo(1);N.chromelessResize(!1)},Editor.zoomFitImage,mxResources.get("smartFit"));W(function(){N.destroy()},Editor.closeImage,mxResources.get("close")+" (Escape)");var Y=N.destroy;N.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",ba);document.body.removeChild(d);document.body.removeChild(X);+document.body.style.overflow=V;for(var ea=0;ea<r.length;ea++)urlParams[r[ea]]=m[r[ea]];Y.apply(this,arguments)};var ba=function(ea){27==ea.keyCode&&N.destroy()};mxEvent.addListener(document.documentElement,"keydown",ba);document.body.appendChild(z);document.body.appendChild(X);window.setTimeout(function(){try{N.setFileData(g.getFileData(!0)),Z(),N.lightboxFit(),N.chromelessResize()}catch(ea){N.handleError(ea,null,function(){N.destroy()})}},0)}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,+function(){try{var v=g.getCurrentFile();null!=v&&v.share()}catch(d){g.handleError(d)}})).isEnabled=A;this.put("embed",new Menu(mxUtils.bind(this,function(v,d){var m=g.getCurrentFile();null==m||m.getMode()!=App.MODE_GOOGLE&&m.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(m.getTitle())||this.addMenuItems(v,["liveImage","-"],d);this.addMenuItems(v,["embedImage","embedSvg","-","embedHtml"],d);navigator.standalone||g.isOffline()||this.addMenuItems(v,["embedIframe"],d);this.addMenuItems(v,["-","microsoftOffice",+"-","embedNotion"],d)})));y=function(v){var d=mxResources.get(v);g.actions.put(v,new Action(d+"...",function(m){m=new ParseDialog(g,d,v);g.showDialog(m.container,640,420,!0,!1,null,null,null,new mxRectangle(0,0,440,280));m.init()})).isEnabled=A};var B=function(v,d,m,r){g.actions.put(v,new Action(mxResources.get(v),function(){if(x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())){var z=new mxCell("",new mxGeometry(0,0,0,0),d);z.vertex=!0;for(var D=x.getFreeInsertPoint(),F=[],N=0;N<r.nodes.length;N++){var P=+new mxCell(r.nodes[N],new mxGeometry(D.x+20,D.y+20,100,40),"whiteSpace=wrap;html=1;");P.vertex=!0;F.push(z.insert(P))}for(N=0;N<r.edges.length;N++)D=new mxCell("",new mxGeometry,m),D.geometry.relative=!0,D.edge=!0,F[r.edges[N][0]].insertEdge(D,!0),F[r.edges[N][1]].insertEdge(D,!1),z.insert(D);U(z)}})).isEnabled=A},E={nodes:["Root","Child 1","Child 2"],edges:[[0,1],[0,2]]},I={nodes:["Start","Task","Task","End"],edges:[[0,1],[0,2],[1,3],[2,3]]},C=function(v,d){B(v,Menus.layoutContainers[v].style,Menus.layoutContainerEdgeStyle,+d)};C("horizontalFlow",I);C("verticalFlow",I);C("horizontalTree",E);C("verticalTree",E);C("radialTree",E);C("organic",E);C("circle",E);y("mermaid");y("fromText");y("formatSql");y("plantUml");var U=function(v){x.getModel().beginUpdate();try{v=x.addCell(v),x.fireEvent(new mxEventObject("cellsInserted","cells",[v])),x.model.isVertex(v)&&x.isAutoSizeCell(v)&&x.updateCellSize(v)}finally{x.getModel().endUpdate()}x.scrollCellToVisible(v);x.setSelectionCell(v);x.container.focus();x.editAfterInsert&&x.startEditing(v);+window.setTimeout(function(){null!=g.hoverIcons&&g.hoverIcons.update(x.view.getState(v))},0);return v},K=function(v,d,m,r,z){v=new mxCell(v,new mxGeometry(0,0,d,m),r);v.vertex=!0;null==z&&(z=x.getCenterInsertPoint(x.getBoundingBoxFromGeometry([v],!0)));v.geometry.x=z.x;v.geometry.y=z.y;return U(v)};g.actions.put("insertText",new Action("text",function(v){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&x.startEditingAtCell(K("Text",60,30,x.appendFontSize(Editor.defaultTextStyle,x.vertexFontSize),+null==v||mxEvent.isControlDown(v)||mxEvent.isMetaDown(v)||!x.isMouseInsertPoint()?null:x.getInsertPoint()))},null,null,"A")).isEnabled=A;g.actions.put("insertRectangle",new Action("rectangle",function(v){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&K("",120,60,"whiteSpace=wrap;html=1;",null==v||mxEvent.isControlDown(v)||mxEvent.isMetaDown(v)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"D")).isEnabled=A;g.actions.put("insertNote",new Action("note",function(v){x.isEnabled()&&+!x.isCellLocked(x.getDefaultParent())&&K("",160,160,Editor.defaultNoteStyle,null==v||mxEvent.isControlDown(v)||mxEvent.isMetaDown(v)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"S")).isEnabled=A;g.actions.put("insertEllipse",new Action("ellipse",function(v){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&K("",80,80,"ellipse;whiteSpace=wrap;html=1;",null==v||mxEvent.isControlDown(v)||mxEvent.isMetaDown(v)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"F")).isEnabled=+A;g.actions.put("insertRhombus",new Action("rhombus",function(v){x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())&&K("",80,80,"rhombus;whiteSpace=wrap;html=1;",null==v||mxEvent.isControlDown(v)||mxEvent.isMetaDown(v)||!x.isMouseInsertPoint()?null:x.getInsertPoint())},null,null,"R")).isEnabled=A;g.actions.put("insertEdge",new Action("line",function(v){if(x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())){var d=x.defaultEdgeLength;v=null==v||mxEvent.isControlDown(v)||mxEvent.isMetaDown(v)||!x.isMouseInsertPoint()?+null:x.getInsertPoint();null==v&&(v=x.getCenterInsertPoint(x.getBoundingBoxFromGeometry([m],!0)));var m=new mxCell("",new mxGeometry(0,0,d,0),"edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;");m.geometry.setTerminalPoint(v,!0);m.geometry.setTerminalPoint(new mxPoint(v.x+m.geometry.width,v.y),!1);m.geometry.points=[];m.geometry.relative=!0;m.edge=!0;U(m)}},null,null,"C")).isEnabled=A;g.actions.put("insertPolygon",new Action("polygon...",function(v){if(x.isEnabled()&&!x.isCellLocked(x.getDefaultParent())){var d=+new PolygonDialog(g,null,function(m){m=new mxCell("",new mxGeometry(0,0,80,80),m);m.vertex=!0;var r=null==v||mxEvent.isControlDown(v)||mxEvent.isMetaDown(v)||!x.isMouseInsertPoint()?null:x.getInsertPoint();null==r&&(r=x.getCenterInsertPoint(x.getBoundingBoxFromGeometry([m],!0)));m.geometry.x=r.x;m.geometry.y=r.y;return U(m)});g.showDialog(d.container,680,540,!0,!0,function(){d.destroy()},null,null,new mxRectangle(0,0,740,600),null,"insertPolygon");d.init()}})).isEnabled=A;y=g.actions.put("toggleShapes",+new Action("shapes",function(){null!=g.sidebarWindow?g.sidebarWindow.window.setVisible(!g.sidebarWindow.window.isVisible()):g.toggleShapesPanel(!g.isShapesPanelVisible())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+K"));y.setToggleAction(!0);y.setSelectedCallback(mxUtils.bind(this,function(){return null!=g.sidebarWindow&&g.sidebarWindow.window.isVisible()||null==g.sidebarWindow&&0<g.hsplitPosition}));g.actions.put("showShapePicker",new Action(mxResources.get("shapes")+"...",function(){var v=x._contextMenuScreenPoint;g.showShapePicker(null!=v?v.x:x.container.clientWidth/2,null!=v?v.y:x.container.clientHeight/2)}));this.put("insert",new Menu(mxUtils.bind(this,function(v,d){Editor.passiveScroll?(g.menus.addMenuItems(v,["showShapePicker"],d),g.menus.addSubmenu("table",v,d),v.addSeparator(d),g.menus.addMenuItems(v,"insertRectangle insertEllipse insertRhombus - insertEdge insertNote - insertText insertLink - insertImage createShape insertPolygon -".split(" "),d),g.insertTemplateEnabled&&!g.isOffline()&&g.menus.addMenuItems(v,["insertTemplate"],d),g.menus.addMenuItems(v,["-","insertFreehand","generate","-"],d),g.menus.addSubmenu("layout",v,d),g.menus.addSubmenu("insertAdvanced",v,d,mxResources.get("advanced"))):"sketch"==Editor.currentTheme?(g.menus.addMenuItems(v,["toggleShapes"],d),g.menus.addSubmenu("table",v,d),v.addSeparator(d),g.menus.addMenuItems(v,"insertText insertLink - insertImage createShape insertPolygon -".split(" "),d),g.insertTemplateEnabled&&!g.isOffline()&&g.menus.addMenuItems(v,["insertTemplate"],d),EditorUi.isMermaidSupported()&&g.menus.addMenuItems(v,["mermaid"],d),g.menus.addMenuItems(v,["-","insertFreehand","generate","-"],d),g.menus.addSubmenu("layout",v,d),g.menus.addSubmenu("insertAdvanced",v,d,mxResources.get("advanced"))):(this.addMenuItems(v,"insertRectangle insertEllipse insertRhombus - insertEdge insertNote - insertText insertLink - insertImage createShape insertPolygon -".split(" "),d),g.insertTemplateEnabled&&!g.isOffline()&&this.addMenuItems(v,["insertTemplate"],d),EditorUi.isMermaidSupported()&&this.addMenuItems(v,["mermaid"],d),g.menus.addMenuItems(v,["-","insertFreehand","generate","-"],d),"min"==uiTheme||"simple"==Editor.currentTheme?(this.addSubmenu("layout",v,d),this.addSubmenu("insertLayout",v,d,mxResources.get("insert")),v.addSeparator(d),this.addSubmenu("table",v,d)):this.addSubmenu("insertLayout",v,d,mxResources.get("layout")),this.addSubmenu("insertAdvanced",v,d,mxResources.get("advanced")))})));this.put("table",new Menu(mxUtils.bind(this,function(v,d){g.menus.addInsertTableCellItem(v,-d)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),d)})));g.actions.put("csv",new Action(mxResources.get("csv")+"...",function(){x.popupMenuHandler.hideMenu();g.showImportCsvDialog()})).isEnabled=B;this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,["fromText","plantUml","formatSql","csv"],d);"simple"!=Editor.currentTheme&&-"min"!=Editor.currentTheme||this.addMenuItems(v,["-","createShape","editDiagram"],d)})));this.put("openRecent",new Menu(function(v,d){var m=g.getRecent();if(null!=m){for(var r=0;r<m.length;r++)(function(A){var D=A.mode;D==App.MODE_GOOGLE?D="googleDrive":D==App.MODE_ONEDRIVE&&(D="oneDrive");v.addItem(A.title+" ("+mxResources.get(D)+")",null,function(){g.loadFile(A.id)},d)})(m[r]);v.addSeparator(d)}v.addItem(mxResources.get("reset"),null,function(){g.resetRecent()},d)}));this.put("openFrom",new Menu(function(v,+d)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),d)})));g.actions.put("csv",new Action(mxResources.get("csv")+"...",function(){x.popupMenuHandler.hideMenu();g.showImportCsvDialog()})).isEnabled=A;this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,["fromText","plantUml","formatSql","csv"],d);"simple"!=Editor.currentTheme&&+"min"!=Editor.currentTheme||this.addMenuItems(v,["-","createShape","editDiagram"],d)})));this.put("openRecent",new Menu(function(v,d){var m=g.getRecent();if(null!=m){for(var r=0;r<m.length;r++)(function(z){var D=z.mode;D==App.MODE_GOOGLE?D="googleDrive":D==App.MODE_ONEDRIVE&&(D="oneDrive");v.addItem(z.title+" ("+mxResources.get(D)+")",null,function(){g.loadFile(z.id)},d)})(m[r]);v.addSeparator(d)}v.addItem(mxResources.get("reset"),null,function(){g.resetRecent()},d)}));this.put("openFrom",new Menu(function(v,d){null!=g.drive?v.addItem(mxResources.get("googleDrive")+"...",null,function(){g.pickFile(App.MODE_GOOGLE)},d):g.isModeEnabled(App.MODE_GOOGLE)&&v.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);g.isModeReady(App.MODE_ONEDRIVE)?v.addItem(mxResources.get("oneDrive")+"...",null,function(){g.pickFile(App.MODE_ONEDRIVE)},d):g.isModeEnabled(App.MODE_ONEDRIVE)&&v.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);g.isModeReady(App.MODE_M365)?v.addItem(mxResources.get("m365")+"...",null,function(){g.pickFile(App.MODE_M365)},d):g.isModeEnabled(App.MODE_M365)&&v.addItem(mxResources.get("m365")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);g.isModeReady(App.MODE_DROPBOX)?v.addItem(mxResources.get("dropbox")+"...",null,function(){g.pickFile(App.MODE_DROPBOX)},d):g.isModeEnabled(App.MODE_DROPBOX)&&v.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);v.addSeparator(d);g.isModeReady(App.MODE_GITHUB)&&v.addItem(mxResources.get("github")+"...",null,function(){g.pickFile(App.MODE_GITHUB)},d);g.isModeReady(App.MODE_GITLAB)&&v.addItem(mxResources.get("gitlab")+"...",null,function(){g.pickFile(App.MODE_GITLAB)},d);g.isModeReady(App.MODE_TRELLO)?v.addItem(mxResources.get("trello")+"...",null,function(){g.pickFile(App.MODE_TRELLO)},d):g.isModeEnabled(App.MODE_TRELLO)&&v.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",@@ -15013,25 +15017,25 @@ null,null,null,App.MODE_BROWSER)},d);"1"!=urlParams.noDevice&&v.addItem(mxResournull,function(){g.pickLibrary(App.MODE_GOOGLE)},d):g.isModeEnabled(App.MODE_GOOGLE)&&v.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));g.isModeReady(App.MODE_ONEDRIVE)?v.addItem(mxResources.get("oneDrive")+"...",null,function(){g.pickLibrary(App.MODE_ONEDRIVE)},d):g.isModeEnabled(App.MODE_ONEDRIVE)&&v.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);g.isModeReady(App.MODE_DROPBOX)?v.addItem(mxResources.get("dropbox")+"...",null,function(){g.pickLibrary(App.MODE_DROPBOX)},d):g.isModeEnabled(App.MODE_DROPBOX)&&v.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);v.addSeparator(d);g.isModeReady(App.MODE_GITHUB)&&v.addItem(mxResources.get("github")+"...",null,function(){g.pickLibrary(App.MODE_GITHUB)},d);g.isModeReady(App.MODE_GITLAB)&&v.addItem(mxResources.get("gitlab")+"...",null,function(){g.pickLibrary(App.MODE_GITLAB)},d);g.isModeReady(App.MODE_TRELLO)?v.addItem(mxResources.get("trello")+"...",null,function(){g.pickLibrary(App.MODE_TRELLO)},d):g.isModeEnabled(App.MODE_TRELLO)&&v.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);v.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&v.addItem(mxResources.get("browser")+"...",null,function(){g.pickLibrary(App.MODE_BROWSER)},d);"1"!=urlParams.noDevice&&v.addItem(mxResources.get("device")+"...",null,function(){g.pickLibrary(App.MODE_DEVICE)},d);g.isOffline()||(v.addSeparator(d),v.addItem(mxResources.get("url")+-"...",null,function(){var m=new FilenameDialog(g,"",mxResources.get("open"),function(r){if(null!=r&&0<r.length&&g.spinner.spin(document.body,mxResources.get("loading"))){var A=r;g.editor.isCorsEnabledForUrl(r)||(A=PROXY_URL+"?url="+encodeURIComponent(r));mxUtils.get(A,function(D){if(200<=D.getStatus()&&299>=D.getStatus()){g.spinner.stop();try{g.loadLibrary(new UrlLibrary(g,D.getText(),r)),g.showSidebar()}catch(G){g.handleError(G,mxResources.get("errorLoadingFile"))}}else g.spinner.stop(),g.handleError(null,+"...",null,function(){var m=new FilenameDialog(g,"",mxResources.get("open"),function(r){if(null!=r&&0<r.length&&g.spinner.spin(document.body,mxResources.get("loading"))){var z=r;g.editor.isCorsEnabledForUrl(r)||(z=PROXY_URL+"?url="+encodeURIComponent(r));mxUtils.get(z,function(D){if(200<=D.getStatus()&&299>=D.getStatus()){g.spinner.stop();try{g.loadLibrary(new UrlLibrary(g,D.getText(),r)),g.showSidebar()}catch(F){g.handleError(F,mxResources.get("errorLoadingFile"))}}else g.spinner.stop(),g.handleError(null,mxResources.get("errorLoadingFile"))},function(){g.spinner.stop();g.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));g.showDialog(m.container,300,80,!0,!0);m.init()},d));"1"==urlParams.confLib&&(v.addSeparator(d),v.addItem(mxResources.get("confluenceCloud")+"...",null,function(){g.showRemotelyStoredLibrary(mxResources.get("libraries"))},d))})));this.put("edit",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,"undo redo - cut copy copyAsImage copyAsSvg paste delete - duplicate - findReplace - editData editTooltip - editStyle editGeometry editPolygon editConnectionPoints - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));-z=g.actions.addAction("comments",mxUtils.bind(this,function(){if(null==this.commentsWindow){var v=mxSettings.getWindowState("comments");this.commentsWindow=new CommentsWindow(g,null!=v&&null!=v.x?v.x:document.body.offsetWidth-380,null!=v&&null!=v.y?v.y:120,null!=v&&null!=v.w?v.w:300,null!=v&&null!=v.h?v.h:350);this.commentsWindow.window.addListener("show",function(){g.fireEvent(new mxEventObject("comments"))});this.commentsWindow.window.addListener("hide",function(){g.fireEvent(new mxEventObject("comments"))});-g.installWindowPersistence("comments",this.commentsWindow);null!=v?g.restoreWindowState("comments",this.commentsWindow):this.commentsWindow.window.setVisible(!0);g.fireEvent(new mxEventObject("comments"))}else v=!this.commentsWindow.window.isVisible(),this.commentsWindow.window.setVisible(v),this.commentsWindow.refreshCommentsTime(),v&&this.commentsWindow.hasError&&this.commentsWindow.refreshComments()}));z.setToggleAction(!0);z.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.commentsWindow&&+y=g.actions.addAction("comments",mxUtils.bind(this,function(){if(null==this.commentsWindow){var v=mxSettings.getWindowState("comments");this.commentsWindow=new CommentsWindow(g,null!=v&&null!=v.x?v.x:document.body.offsetWidth-380,null!=v&&null!=v.y?v.y:120,null!=v&&null!=v.w?v.w:300,null!=v&&null!=v.h?v.h:350);this.commentsWindow.window.addListener("show",function(){g.fireEvent(new mxEventObject("comments"))});this.commentsWindow.window.addListener("hide",function(){g.fireEvent(new mxEventObject("comments"))});+g.installWindowPersistence("comments",this.commentsWindow);null!=v?g.restoreWindowState("comments",this.commentsWindow):this.commentsWindow.window.setVisible(!0);g.fireEvent(new mxEventObject("comments"))}else v=!this.commentsWindow.window.isVisible(),this.commentsWindow.window.setVisible(v),this.commentsWindow.refreshCommentsTime(),v&&this.commentsWindow.hasError&&this.commentsWindow.refreshComments()}));y.setToggleAction(!0);y.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.commentsWindow&&this.commentsWindow.window.isVisible()}));g.editor.addListener("fileLoaded",mxUtils.bind(this,function(){null!=this.commentsWindow&&(this.commentsWindow.destroy(),this.commentsWindow=null)}));this.get("viewPanels").funct=function(v,d){var m=g.getCurrentFile();g.menus.addMenuItems(v,"toggleShapes format ruler - findReplace layers tags outline -".split(" "),d);g.commentsSupported()&&g.menus.addMenuItems(v,["-","comments"],d);null!=m&&m.isRealtimeEnabled()&&m.isRealtimeSupported()&&g.menus.addMenuItems(v,["-","showRemoteCursors","shareCursor"],d);g.menus.addMenuItems(v,["-","fullscreen"],d)};this.put("view",new Menu(mxUtils.bind(this,function(v,d){if("simple"==Editor.currentTheme){var m=g.getCurrentFile();g.menus.addMenuItems(v,["toggleShapes","format"],d);g.isPageMenuVisible()&&g.menus.addMenuItems(v,["pageTabs"],d);g.menus.addMenuItems(v,["ruler","-","search"],d);if(isLocalStorage||mxClient.IS_CHROMEAPP){var r=g.menus.addMenuItem(v,"scratchpad",d);(!g.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&g.menus.addLinkToItem(r,"https://www.drawio.com/doc/faq/scratchpad")}g.menus.addMenuItems(v,"- findReplace layers tags outline -".split(" "),d);g.commentsSupported()&&g.menus.addMenuItems(v,["comments"],d);null!=m&&m.isRealtimeEnabled()&&m.isRealtimeSupported()&&this.addMenuItems(v,["showRemoteCursors"],d);this.addMenuItems(v,["-","fullscreen"],d)}else{this.addMenuItems(v,["format","outline","layers","tags"].concat(g.commentsSupported()?["comments","-"]:["-"]));this.addMenuItems(v,["-","search"],d);if(isLocalStorage||mxClient.IS_CHROMEAPP)r=this.addMenuItem(v,"scratchpad",d),(!g.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(r,"https://www.drawio.com/doc/faq/scratchpad");this.addMenuItems(v,["toggleShapes","-","pageView","pageScale"]);this.addSubmenu("units",v,d);v.addSeparator(d);g.isPageMenuVisible()&&g.menus.addMenuItems(v,["pageTabs"],d);this.addMenuItems(v,"ruler - tooltips animations - grid guides - connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),d);"1"!=urlParams.sketch&&this.addMenuItems(v,["-","fullscreen"],d)}})));this.put("editCell",new Menu(mxUtils.bind(this,function(v,d){this.addMenuItems(v,"editLink editShape editImage crop - editData copyData pasteData - editPolygon editConnectionPoints editGeometry - editTooltip editStyle - edit".split(" "),d)})));this.put("currentPage",new Menu(mxUtils.bind(this,function(v,d){null!=g.currentPage&&(this.addMenuItems(v,["renamePage","removePage"],d),1<g.pages.length&&(g.menus.addSubmenu("movePage",v,d,mxResources.get("move")),v.addSeparator(d)),this.addMenuItems(v,["-","duplicatePage"],d),1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=g.getServiceName()||v.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){g.editor.editAsNew(g.getFileData(!0,null,null,null,!0,!0))}),d)))})));this.put("pages",new Menu(mxUtils.bind(this,function(v,d){var m=g.currentPage;g.editor.graph.isLightboxView()||this.addMenuItems(v,["insertPage","-"],d);if(null!=-g.pages){for(var r=0;r<g.pages.length;r++)mxUtils.bind(this,function(A){var D=null;D=g.pages[A]==m&&!g.editor.graph.isLightboxView()&&g.editor.graph.isEnabled()?g.menus.addSubmenu("currentPage",v,d,g.getShortPageName(m)):v.addItem(g.getShortPageName(g.pages[A]),null,mxUtils.bind(this,function(){g.selectPage(g.pages[A])}),d);var G=g.pages[A].getId();D.setAttribute("title",g.pages[A].getName()+" ("+(A+1)+"/"+g.pages.length+")"+(null!=G?" ["+G+"]":""));g.pages[A]==m&&v.addCheckmark(D,Editor.checkmarkImage)})(r);-g.editor.graph.isLightboxView()||(v.addSeparator(d),this.addMenuItems(v,["sortPages"],d),v.addItem(mxResources.get("deleteAll"),null,mxUtils.bind(this,function(){x.getModel().beginUpdate();try{for(var A=g.pages.length;0<=A;A--)g.removePage(g.pages[A])}catch(D){g.handleError(D)}finally{x.getModel().endUpdate()}g.actions.get("resetView").funct()}),d,null,g.editor.graph.isEnabled()))}})));if(EditorUi.isElectronApp){var S="1"==urlParams.enableSpellCheck;z=g.actions.addAction("spellCheck",function(){g.toggleSpellCheck();-S=!S;g.alert(mxResources.get("restartForChangeRequired"))});z.setToggleAction(!0);z.setSelectedCallback(function(){return S});var N="1"==urlParams.enableStoreBkp;z=g.actions.addAction("autoBkp",function(){g.toggleStoreBkp();N=!N});z.setToggleAction(!0);z.setSelectedCallback(function(){return N});var R="1"==urlParams.isGoogleFontsEnabled;z=g.actions.addAction("googleFonts",function(){g.toggleGoogleFonts();R=!R;g.alert(mxResources.get("restartForChangeRequired"))});z.setToggleAction(!0);z.setSelectedCallback(function(){return R});+g.pages){for(var r=0;r<g.pages.length;r++)mxUtils.bind(this,function(z){var D=null;D=g.pages[z]==m&&!g.editor.graph.isLightboxView()&&g.editor.graph.isEnabled()?g.menus.addSubmenu("currentPage",v,d,g.getShortPageName(m)):v.addItem(g.getShortPageName(g.pages[z]),null,mxUtils.bind(this,function(){g.selectPage(g.pages[z])}),d);var F=g.pages[z].getId();D.setAttribute("title",g.pages[z].getName()+" ("+(z+1)+"/"+g.pages.length+")"+(null!=F?" ["+F+"]":""));g.pages[z]==m&&v.addCheckmark(D,Editor.checkmarkImage)})(r);+g.editor.graph.isLightboxView()||(v.addSeparator(d),this.addMenuItems(v,["sortPages"],d),v.addItem(mxResources.get("deleteAll"),null,mxUtils.bind(this,function(){x.getModel().beginUpdate();try{for(var z=g.pages.length;0<=z;z--)g.removePage(g.pages[z])}catch(D){g.handleError(D)}finally{x.getModel().endUpdate()}g.actions.get("resetView").funct()}),d,null,g.editor.graph.isEnabled()))}})));if(EditorUi.isElectronApp){var S="1"==urlParams.enableSpellCheck;y=g.actions.addAction("spellCheck",function(){g.toggleSpellCheck();+S=!S;g.alert(mxResources.get("restartForChangeRequired"))});y.setToggleAction(!0);y.setSelectedCallback(function(){return S});var M="1"==urlParams.enableStoreBkp;y=g.actions.addAction("autoBkp",function(){g.toggleStoreBkp();M=!M});y.setToggleAction(!0);y.setSelectedCallback(function(){return M});var R="1"==urlParams.isGoogleFontsEnabled;y=g.actions.addAction("googleFonts",function(){g.toggleGoogleFonts();R=!R;g.alert(mxResources.get("restartForChangeRequired"))});y.setToggleAction(!0);y.setSelectedCallback(function(){return R});g.actions.addAction("openDevTools",function(){g.openDevTools()});g.actions.addAction("drafts...",function(){var v=new FilenameDialog(g,EditorUi.draftSaveDelay/1E3+"",mxResources.get("apply"),mxUtils.bind(this,function(d){d=parseInt(d);0<=d&&(EditorUi.draftSaveDelay=1E3*d,EditorUi.enableDrafts=0<d,mxSettings.setDraftSaveDelay(d),mxSettings.save())}),mxResources.get("draftSaveInt"));g.showDialog(v.container,320,80,!0,!0);v.init()})}var T=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(v,d){if("simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme){"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&g.mode!=App.MODE_ATLAS&&g.menus.addSubmenu("theme",v,d);null==T||"1"==urlParams.embed&&null!=urlParams.lang||g.menus.addSubmenu("language",v,d);"1"==urlParams.embed&&"1"!=urlParams.atlas||"1"==urlParams.extAuth||"1"==urlParams.embedInline||g.menus.addSubmenu("appearance",v,d);v.addSeparator(d);g.menus.addSubmenu("units",v,d);this.addSubmenu("diagramLanguage",v,d);g.menus.addMenuItems(v,["-","collapseExpand","animations","tooltips"],d);var m=g.getCurrentFile();"simple"!=Editor.currentTheme&&(null!=m&&m.isRealtimeEnabled()&&m.isRealtimeSupported()&&this.addMenuItems(v,["showRemoteCursors"],d),g.menus.addMenuItems(v,["ruler"],d));EditorUi.isElectronApp&&g.menus.addMenuItems(v,["-","googleFonts","spellCheck","autoBkp","drafts"],d);v.addSeparator(d);g.mode!=App.MODE_ATLAS&&g.menus.addMenuItem(v,"configuration",d);v.addSeparator(d)}else"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&g.mode!=App.MODE_ATLAS&&this.addSubmenu("theme",v,d),"1"==urlParams.embed&&null!=urlParams.lang||this.addSubmenu("language",v,d),"1"==urlParams.embed&&"1"!=urlParams.atlas||g.menus.addSubmenu("appearance",v,d),EditorUi.isElectronApp&&this.addMenuItems(v,["-","googleFonts","spellCheck","autoBkp","drafts"],d),v.addSeparator(d),"undefined"!==typeof MathJax&&(m=this.addMenuItem(v,"mathematicalTypesetting",d),(!g.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(m,"https://www.drawio.com/doc/faq/math-typesetting")),"1"!=urlParams.embed&&(m=g.getCurrentFile(),null!=m&&m.isRealtimeEnabled()&&m.isRealtimeSupported()&&this.addMenuItems(v,["showRemoteCursors","shareCursor"],d),this.addMenuItems(v,["autosave"],d)),this.addMenuItems(v,["collapseExpand","-"],d),this.addSubmenu("diagramLanguage",v,d),this.addMenuItems(v,["editDiagram","-"],d),!g.isOfflineApp()&&isLocalStorage&&this.addMenuItem(v,"plugins",d),this.addMenuItems(v,["configuration"],d)})));this.put("movePage",-new Menu(mxUtils.bind(this,function(v,d){var m=g.currentPage,r=g.getPageIndex(m);if(null!=g.pages)for(var A=0;A<g.pages.length;A++)A!=r&&function(D){v.addItem(g.getShortPageName(g.pages[D]),null,function(){g.movePage(r,D);g.scrollToPage(m,!0)},d)}(A)})));this.put("share",new Menu(mxUtils.bind(this,function(v,d){if(!g.isStandaloneApp()){var m=g.isOffline(!0)?mxResources.get("offline"):g.getNetworkStatus();null!=m&&(v.addItem(m,null,null,d,null,!1),v.addSeparator(d));g.menus.addMenuItems(v,["share"],+new Menu(mxUtils.bind(this,function(v,d){var m=g.currentPage,r=g.getPageIndex(m);if(null!=g.pages)for(var z=0;z<g.pages.length;z++)z!=r&&function(D){v.addItem(g.getShortPageName(g.pages[D]),null,function(){g.movePage(r,D);g.scrollToPage(m,!0)},d)}(z)})));this.put("share",new Menu(mxUtils.bind(this,function(v,d){if(!g.isStandaloneApp()){var m=g.isOffline(!0)?mxResources.get("offline"):g.getNetworkStatus();null!=m&&(v.addItem(m,null,null,d,null,!1),v.addSeparator(d));g.menus.addMenuItems(v,["share"],d)}this.addMenuItem(v,"publishLink",d,null,null,mxResources.get("publish")+"...");EditorUi.isElectronApp||!g.isOwnGDriveDomain()||"draw.io"!=g.getServiceName()||navigator.standalone||this.addMenuItem(v,"presentationMode",d);null!=g.getMainUser()&&this.addMenuItems(v,["accounts"],d)})));this.put("diagram",new Menu(mxUtils.bind(this,function(v,d){var m=g.getCurrentFile();"simple"!=Editor.currentTheme&&(g.menus.addSubmenu("extras",v,d,mxResources.get("settings")),v.addSeparator(d));var r="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)g.menus.addMenuItems(v,["new","open"],d),g.menus.addSubmenu("openRecent",v,d),g.menus.addMenuItems(v,"- synchronize properties - save saveAs -".split(" "),d);else if(g.mode==App.MODE_ATLAS){"1"!=urlParams.noSaveBtn&&"1"!=urlParams.embedInline&&g.menus.addMenuItems(v,["-","save"],d);if("1"==urlParams.saveAndExit||"1"==urlParams.noSaveBtn&&"0"!=urlParams.saveAndExit||g.mode==App.MODE_ATLAS)g.menus.addMenuItems(v,["saveAndExit"],d),null!=m&&m.isRevisionHistorySupported()&&g.menus.addMenuItems(v,["revisionHistory"],d);v.addSeparator(d)}else g.mode==App.MODE_ATLAS?g.menus.addMenuItems(v,["save","synchronize","-"],d):"1"!=urlParams.noFileMenu&&(g.menus.addSubmenu("file",v,d),v.addSeparator(d),"min"==Editor.currentTheme&&(g.menus.addMenuItems(v,"toggleShapes format layers tags - findReplace".split(" "),d),g.commentsSupported()&&g.menus.addMenuItems(v,["comments"],d),v.addSeparator(d)));g.menus.addSubmenu("exportAs",v,d);mxClient.IS_CHROMEAPP||@@ -15048,15 +15052,15 @@ d);if(null!=m&&null!=g.fileNode&&"1"!=urlParams.embedInline){var r=null!=m.getTithis.addMenuItem(v,"synchronize",d),(!g.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(r,"https://www.drawio.com/doc/faq/synchronize"),v.addSeparator(d)):this.addMenuItems(v,["new"],d),this.addSubmenu("openFrom",v,d),isLocalStorage&&this.addSubmenu("openRecent",v,d),null!=m&&m.constructor==DriveFile?this.addMenuItems(v,"new - rename makeCopy openFolder moveToFolder".split(" "),d):(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==m||m.constructor==LocalFile&&null==m.fileHandle||(v.addSeparator(d),r=this.addMenuItem(v,"synchronize",d),(!g.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(r,"https://www.drawio.com/doc/faq/synchronize")),this.addMenuItems(v,["-","save","saveAs","-"],d),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=g.getServiceName()||g.isOfflineApp()||null==m||this.addMenuItems(v,["share","-"],d),null!=m&&m.isRenamable()&&this.addMenuItems(v,["rename"],d),g.isOfflineApp()?this.addMenuItems(v,["upload"],d):(this.addMenuItems(v,["makeCopy"],d),null!=m&&(m.constructor==OneDriveFile&&this.addMenuItems(v,["moveToFolder"],d),null!=m.getFolderUrl()&&g.menus.addMenuItems(v,["openFolder"],d)))),v.addSeparator(d),this.addSubmenu("importFrom",v,d),this.addSubmenu("exportAs",v,d),g.isOffline()||(v.addSeparator(d),this.addSubmenu("embed",v,d),this.addSubmenu("publish",v,d)),v.addSeparator(d),this.addSubmenu("newLibrary",v,d),this.addSubmenu("openLibraryFrom",v,d),g.isRevisionHistorySupported()&&this.addMenuItems(v,-["-","revisionHistory"],d),null!=m&&null!=g.fileNode&&"1"!=urlParams.embedInline&&(r=null!=m.getTitle()?m.getTitle():g.defaultFilename,(m.constructor==DriveFile&&null!=m.sync&&m.sync.isConnected()||!/(\.html)$/i.test(r))&&this.addMenuItems(v,["-","properties"])),this.addMenuItems(v,["-","pageSetup"],d),mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(v,["print"],d),this.addMenuItems(v,["-","close"])})));this.put("fontFamily",new Menu(mxUtils.bind(this,function(v,d){function m(Y){var H=encodeURIComponent(Y.name)+-(null==Y.url?"":"@"+encodeURIComponent(Y.url));if(!A[H]){for(var W=Y.name,Z=0;null!=P[W.toLowerCase()];)W=Y.name+" ("+ ++Z+")";null==O[H]&&(V.push({name:Y.name,url:Y.url,label:W,title:Y.url}),P[W.toLowerCase()]=Y,O[H]=Y)}}for(var r=mxUtils.bind(this,function(Y,H,W,Z,X){var ba=g.editor.graph,ea=this.styleChange(v,null!=Z?Z:Y,[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],[Y,null!=H?encodeURIComponent(H):null,null],null,d,function(){ba.setFont(Y,H);g.fireEvent(new mxEventObject("styleChanged",-"keys",[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],"values",[Y,null!=H?encodeURIComponent(H):null,null],"cells",[ba.cellEditor.getEditingCell()]))},function(){ba.updateLabelElements(ba.getSelectionCells(),function(aa){aa.removeAttribute("face");aa.style.fontFamily=null;"PRE"==aa.nodeName&&ba.replaceElement(aa,"div")})});W&&(W=document.createElement("img"),W.className="geAdaptiveAsset",W.setAttribute("src",Editor.crossImage),W.setAttribute("title",mxResources.get("delete")),W.setAttribute("valign",-"absmiddle"),W.setAttribute("border","0"),W.style.position="relative",W.style.top="2px",W.style.width="14px",W.style.cursor="default",W.style.margin="0 3px",ea.firstChild.nextSibling.nextSibling.appendChild(W),mxEvent.addListener(W,mxClient.IS_POINTER?"pointerup":"mouseup",mxUtils.bind(this,function(aa){this.removeCustomFont(Y,H);this.editorUi.hideCurrentMenu();mxEvent.consume(aa)})));Graph.addFont(Y,H);ea.firstChild.nextSibling.style.fontFamily=mxUtils.parseCssFontFamily(Y);X=null!=Z?Z:Y;null!=H&&-(X+=" ("+H+")");ea.setAttribute("title",X)}),A={},D=0;D<this.defaultFonts.length;D++){var G=this.defaultFonts[D];"string"===typeof G?r(G):null!=G.fontFamily&&null!=G.fontUrl&&(A[encodeURIComponent(G.fontFamily)+"@"+encodeURIComponent(G.fontUrl)]=!0,r(G.fontFamily,G.fontUrl))}v.addSeparator(d);var O={},P={},V=[];for(D=0;D<this.customFonts.length;D++)m(this.customFonts[D]);V.sort(function(Y,H){return Y.label<H.label?-1:Y.label>H.label?1:0});if(0<V.length){for(D=0;D<V.length;D++)r(V[D].name,V[D].url,-!0,V[D].label);v.addSeparator(d)}v.addItem(mxResources.get("reset"),null,mxUtils.bind(this,function(){this.customFonts=[];g.fireEvent(new mxEventObject("customFontsChanged"))}),d);v.addSeparator(d);v.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var Y=this.editorUi.editor.graph,H=Y.getStylesheet().getDefaultVertexStyle()[mxConstants.STYLE_FONTFAMILY],W="s",Z=null;if(Y.isEditing()){var X=Y.getSelectedEditingElement();if(null!=X){var ba=mxUtils.getCurrentStyle(X);if(null!=-ba){H=mxUtils.getCssFontFamily(ba.fontFamily);ba=Y.getView().getState(Y.cellEditor.getEditingCell());Z=null!=ba?ba.style.fontSource:null;for(null!=Z&&(Z=decodeURIComponent(Z));null!=X&&X!=Y.cellEditor.textarea;){if(X.nodeType==mxConstants.NODETYPE_ELEMENT)if(null!=X.getAttribute("data-font-src")){Z=X.getAttribute("data-font-src");break}else if(X.getAttribute("face")==H){Z=null;break}X=X.parentNode}null!=Z&&(Graph.isGoogleFontUrl(Z)?(Z=null,W="g"):W="w")}}}else ba=Y.getView().getState(Y.getSelectionCell()),-null!=ba&&(H=ba.style[mxConstants.STYLE_FONTFAMILY]||H,X=ba.style.fontSource,null!=X&&(X=decodeURIComponent(X),Graph.isGoogleFontUrl(X)?W="g":(W="w",Z=X)));null!=Z&&Z.substring(0,PROXY_URL.length)==PROXY_URL&&(Z=decodeURIComponent(Z.substr((PROXY_URL+"?url=").length)));var ea=null;document.activeElement==Y.cellEditor.textarea&&(ea=Y.cellEditor.saveSelection());H=new FontDialog(this.editorUi,H,Z,W,mxUtils.bind(this,function(aa,ha,na){null!=ea&&(Y.cellEditor.restoreSelection(ea),ea=null);if(null!=aa&&-0<aa.length)if(this.addCustomFont(aa,ha),Y.isEditing())Y.setFont(aa,ha);else{Y.getModel().beginUpdate();try{Y.stopEditing(!1),Y.setCellStyles(mxConstants.STYLE_FONTFAMILY,aa),Y.setCellStyles("fontSource",null!=ha?encodeURIComponent(ha):null),Y.setCellStyles("FType",null)}finally{Y.getModel().endUpdate()}}}));this.editorUi.showDialog(H.container,380,null,!0,!0);H.init()}),d,null,!0)})))}})();function DiagramPage(b,l){this.node=b;null!=l?this.node.setAttribute("id",l):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.diagramModified=!1;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};+["-","revisionHistory"],d),null!=m&&null!=g.fileNode&&"1"!=urlParams.embedInline&&(r=null!=m.getTitle()?m.getTitle():g.defaultFilename,(m.constructor==DriveFile&&null!=m.sync&&m.sync.isConnected()||!/(\.html)$/i.test(r))&&this.addMenuItems(v,["-","properties"])),this.addMenuItems(v,["-","pageSetup"],d),mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(v,["print"],d),this.addMenuItems(v,["-","close"])})));this.put("fontFamily",new Menu(mxUtils.bind(this,function(v,d){function m(X){var H=encodeURIComponent(X.name)++(null==X.url?"":"@"+encodeURIComponent(X.url));if(!z[H]){for(var W=X.name,Z=0;null!=P[W.toLowerCase()];)W=X.name+" ("+ ++Z+")";null==N[H]&&(V.push({name:X.name,url:X.url,label:W,title:X.url}),P[W.toLowerCase()]=X,N[H]=X)}}for(var r=mxUtils.bind(this,function(X,H,W,Z,Y){var ba=g.editor.graph,ea=this.styleChange(v,null!=Z?Z:X,[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],[X,null!=H?encodeURIComponent(H):null,null],null,d,function(){ba.setFont(X,H);g.fireEvent(new mxEventObject("styleChanged",+"keys",[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],"values",[X,null!=H?encodeURIComponent(H):null,null],"cells",[ba.cellEditor.getEditingCell()]))},function(){ba.updateLabelElements(ba.getSelectionCells(),function(aa){aa.removeAttribute("face");aa.style.fontFamily=null;"PRE"==aa.nodeName&&ba.replaceElement(aa,"div")})});W&&(W=document.createElement("img"),W.className="geAdaptiveAsset",W.setAttribute("src",Editor.crossImage),W.setAttribute("title",mxResources.get("delete")),W.setAttribute("valign",+"absmiddle"),W.setAttribute("border","0"),W.style.position="relative",W.style.top="2px",W.style.width="14px",W.style.cursor="default",W.style.margin="0 3px",ea.firstChild.nextSibling.nextSibling.appendChild(W),mxEvent.addListener(W,mxClient.IS_POINTER?"pointerup":"mouseup",mxUtils.bind(this,function(aa){this.removeCustomFont(X,H);this.editorUi.hideCurrentMenu();mxEvent.consume(aa)})));Graph.addFont(X,H);ea.firstChild.nextSibling.style.fontFamily=mxUtils.parseCssFontFamily(X);Y=null!=Z?Z:X;null!=H&&+(Y+=" ("+H+")");ea.setAttribute("title",Y)}),z={},D=0;D<this.defaultFonts.length;D++){var F=this.defaultFonts[D];"string"===typeof F?r(F):null!=F.fontFamily&&null!=F.fontUrl&&(z[encodeURIComponent(F.fontFamily)+"@"+encodeURIComponent(F.fontUrl)]=!0,r(F.fontFamily,F.fontUrl))}v.addSeparator(d);var N={},P={},V=[];for(D=0;D<this.customFonts.length;D++)m(this.customFonts[D]);V.sort(function(X,H){return X.label<H.label?-1:X.label>H.label?1:0});if(0<V.length){for(D=0;D<V.length;D++)r(V[D].name,V[D].url,+!0,V[D].label);v.addSeparator(d)}v.addItem(mxResources.get("reset"),null,mxUtils.bind(this,function(){this.customFonts=[];g.fireEvent(new mxEventObject("customFontsChanged"))}),d);v.addSeparator(d);v.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var X=this.editorUi.editor.graph,H=X.getStylesheet().getDefaultVertexStyle()[mxConstants.STYLE_FONTFAMILY],W="s",Z=null;if(X.isEditing()){var Y=X.getSelectedEditingElement();if(null!=Y){var ba=mxUtils.getCurrentStyle(Y);if(null!=+ba){H=mxUtils.getCssFontFamily(ba.fontFamily);ba=X.getView().getState(X.cellEditor.getEditingCell());Z=null!=ba?ba.style.fontSource:null;for(null!=Z&&(Z=decodeURIComponent(Z));null!=Y&&Y!=X.cellEditor.textarea;){if(Y.nodeType==mxConstants.NODETYPE_ELEMENT)if(null!=Y.getAttribute("data-font-src")){Z=Y.getAttribute("data-font-src");break}else if(Y.getAttribute("face")==H){Z=null;break}Y=Y.parentNode}null!=Z&&(Graph.isGoogleFontUrl(Z)?(Z=null,W="g"):W="w")}}}else ba=X.getView().getState(X.getSelectionCell()),+null!=ba&&(H=ba.style[mxConstants.STYLE_FONTFAMILY]||H,Y=ba.style.fontSource,null!=Y&&(Y=decodeURIComponent(Y),Graph.isGoogleFontUrl(Y)?W="g":(W="w",Z=Y)));null!=Z&&Z.substring(0,PROXY_URL.length)==PROXY_URL&&(Z=decodeURIComponent(Z.substr((PROXY_URL+"?url=").length)));var ea=null;document.activeElement==X.cellEditor.textarea&&(ea=X.cellEditor.saveSelection());H=new FontDialog(this.editorUi,H,Z,W,mxUtils.bind(this,function(aa,ha,na){null!=ea&&(X.cellEditor.restoreSelection(ea),ea=null);if(null!=aa&&+0<aa.length)if(this.addCustomFont(aa,ha),X.isEditing())X.setFont(aa,ha);else{X.getModel().beginUpdate();try{X.stopEditing(!1),X.setCellStyles(mxConstants.STYLE_FONTFAMILY,aa),X.setCellStyles("fontSource",null!=ha?encodeURIComponent(ha):null),X.setCellStyles("FType",null)}finally{X.getModel().endUpdate()}}}));this.editorUi.showDialog(H.container,380,null,!0,!0);H.init()}),d,null,!0)})))}})();function DiagramPage(b,l){this.node=b;null!=l?this.node.setAttribute("id",l):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.diagramModified=!1;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("name"):this.node.setAttribute("name",b)};DiagramPage.prototype.getViewBox=function(){var b=this.node.getAttribute("viewBox");if(null!=b){var l=b.split(" ");b=parseFloat(l[0]);var p=parseFloat(l[1]),g=parseFloat(l[2]),x=parseFloat(l[3]);l=4<l.length?parseFloat(l[4]):null;if(isFinite(b)&&isFinite(p)&&isFinite(g)&&isFinite(x)&&0<g&&0<x)return{x:b,y:p,width:g,height:x,scale:null!=l&&isFinite(l)&&0<l?l:null}}return null};DiagramPage.prototype.setViewBox=function(b){if(null==b)this.node.removeAttribute("viewBox");else{var l=b.x+" "+b.y+" "+b.width+" "+b.height;null!=b.scale&&(l+=" "+b.scale);this.node.setAttribute("viewBox",l)}};DiagramPage.prototype.setDiagramModified=function(b){this.diagramModified=b};DiagramPage.prototype.isDiagramModified=function(){return this.diagramModified};function RenamePage(b,l,p){this.ui=b;this.page=l;this.previous=this.name=p}RenamePage.prototype.execute=function(){var b=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function ChangePageView(b,l,p){this.ui=b;this.page=l;this.previous=this.viewBox=p}ChangePageView.prototype.execute=function(){var b=this.page.getViewBox();this.page.setViewBox(this.previous);this.viewBox=this.previous;this.previous=b;this.ui.editor.fireEvent(new mxEventObject("pageViewChanged"))};@@ -15067,24 +15071,24 @@ ChangePage.prototype.execute=function(){this.ui.editor.fireEvent(new mxEventObjeReplaceDiagram.prototype.execute=function(){var b=this.ui.editor.graph,l=this.ui.editor.getGraphXml();this.ui.editor.readGraphState(this.data);this.ui.editor.updateGraphComponents();var p=new mxCodec(this.data.ownerDocument),g=new mxGraphModel;p.decode(this.data,g);this.data=l;this.ui.currentPage&&(this.ui.currentPage.viewState=b.getViewState(),this.ui.currentPage.root=g.root,null!=this.ui.currentPage.model&&this.ui.currentPage.model.rootChanged(this.ui.currentPage.model.root));b.view.clear(b.model.root,!0);b.model.rootChanged(g.root);b.fireEvent(new mxEventObject(mxEvent.ROOT))};EditorUi.prototype.tabContainerVisible=!0;EditorUi.prototype.setTabContainerVisible=function(b,l){Editor.isSettingsEnabled()&&l&&(mxSettings.settings.pages=b,mxSettings.save());this.tabContainerVisible=b;this.updateTabContainer()};EditorUi.prototype.isTabContainerVisible=function(){return this.tabContainerVisible};EditorUi.prototype.getSelectedPageIndex=function(){return this.getPageIndex(this.currentPage)};EditorUi.prototype.getPageIndex=function(b){var l=null;if(null!=this.pages&&null!=b)for(var p=0;p<this.pages.length;p++)if(this.pages[p]==b){l=p;break}return l};EditorUi.prototype.getPageById=function(b,l){l=null!=l?l:this.pages;if(null!=l)for(var p=0;p<l.length;p++)if(l[p].getId()==b)return l[p];return null};-EditorUi.prototype.createImageForPageLink=function(b,l,p,g){var x=b.indexOf(","),B=null;0<x&&(x=this.getPageById(b.substring(x+1)),null!=x&&x!=l&&(B=this.getImageForPage(x,l,p,g),B.originalSrc=b));null==B&&(B={originalSrc:b});return B};+EditorUi.prototype.createImageForPageLink=function(b,l,p,g){var x=b.indexOf(","),A=null;0<x&&(x=this.getPageById(b.substring(x+1)),null!=x&&x!=l&&(A=this.getImageForPage(x,l,p,g),A.originalSrc=b));null==A&&(A={originalSrc:b});return A};EditorUi.prototype.pageSelected=function(){var b=this.editor.graph,l=this.currentPage;null!=l&&(b.tooltipHandler.hide(),null==l.viewState||null==l.viewState.scrollTop||null==l.viewState.scrollLeft?(b.selectUnlockedLayer(),this.resetScrollbars(),b.isLightboxView()?this.lightboxFit():Editor.fitDiagramOnPage&&this.fitInitialView(),null!=this.chromelessResize&&(b.container.scrollleft=0,b.container.scrollTop=0,this.chromelessResize())):b.setScrollbarPositions(l.viewState,b.view.translate.x,b.view.translate.y),this.updateTabContainer())};-EditorUi.prototype.getImageForPage=function(b,l,p,g){p=null!=p?p:this.editor.graph;var x=p.getGlobalVariable;p=this.createTemporaryGraph(p.getStylesheet());var B=this.getPageIndex(null!=l?l:this.currentPage);p.getGlobalVariable=function(F){return"pagenumber"==F?B+1:"page"==F&&null!=l?l.getName():x.apply(this,arguments)};document.body.appendChild(p.container);this.updatePageRoot(b);p.setAdaptiveColors(b.viewState.adaptiveColors);p.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText=-"";g=p.getSvg(null,null,null,null,null,null,null,null,null,null,g,null,null,null,!0,!0);var z=p.getGraphBounds();document.body.removeChild(p.container);Graph.foreignObjectWarningText=b;return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(g)),z.width,z.height,z.x,z.y)};+EditorUi.prototype.getImageForPage=function(b,l,p,g){p=null!=p?p:this.editor.graph;var x=p.getGlobalVariable;p=this.createTemporaryGraph(p.getStylesheet());var A=this.getPageIndex(null!=l?l:this.currentPage);p.getGlobalVariable=function(G){return"pagenumber"==G?A+1:"page"==G&&null!=l?l.getName():x.apply(this,arguments)};document.body.appendChild(p.container);this.updatePageRoot(b);p.setAdaptiveColors(b.viewState.adaptiveColors);p.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText=+"";g=p.getSvg(null,null,null,null,null,null,null,null,null,null,g,null,null,null,!0,!0);var y=p.getGraphBounds();document.body.removeChild(p.container);Graph.foreignObjectWarningText=b;return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(g)),y.width,y.height,y.x,y.y)};EditorUi.prototype.initPages=function(){if(!this.editor.graph.standalone){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.isPagesEnabled()&&(this.keyHandler.bindAction(33,!0,"previousPage",!0),this.keyHandler.bindAction(34,!0,"nextPage",!0));var b=this.editor.graph,l=b.view.validateBackground;b.view.validateBackground=mxUtils.bind(this,function(){l.apply(b.view,-arguments);null!=b.view.backgroundImage&&EditorUi.embedSvgImages(b.view.backgroundImage.node)});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(z,F){z=F.getProperty("edit").changes;for(F=0;F<z.length;F++)if(z[F]instanceof RenamePage||z[F]instanceof ChangePage||z[F]instanceof mxRootChange){this.updateTabContainer();break}null==this.currentPage||1==z.length&&z[0]instanceof SelectPage||this.currentPage.setDiagramModified(!0)}));var p=b.sizeDidChange,g=null,x=this;b.sizeDidChange=-function(){var z=p.apply(this,arguments);null!=x.currentPage&&g!=x.currentPage&&(g=x.currentPage,x.pageSelected());return z};b.addListener(mxEvent.ROOT,mxUtils.bind(this,function(){b.checkDefaultParent()}));var B=mxUtils.bind(this,function(){this.updateDocumentTitle();this.updateTabContainer()});this.addListener("currentThemeChanged",B);this.editor.addListener("pagesPatched",B);this.editor.addListener("pageRenamed",B);this.editor.addListener("pageMoved",B);this.editor.addListener("fileLoaded",B);-this.editor.addListener("pageSelected",mxUtils.bind(this,function(z,F){this.updateTabContainer();this.updateHashObject();this.updateDocumentTitle()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(z,F){this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}));this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTabContainer()}))}};+arguments);null!=b.view.backgroundImage&&EditorUi.embedSvgImages(b.view.backgroundImage.node)});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(y,G){y=G.getProperty("edit").changes;for(G=0;G<y.length;G++)if(y[G]instanceof RenamePage||y[G]instanceof ChangePage||y[G]instanceof mxRootChange){this.updateTabContainer();break}null==this.currentPage||1==y.length&&y[0]instanceof SelectPage||this.currentPage.setDiagramModified(!0)}));var p=b.sizeDidChange,g=null,x=this;b.sizeDidChange=+function(){var y=p.apply(this,arguments);null!=x.currentPage&&g!=x.currentPage&&(g=x.currentPage,x.pageSelected());return y};b.addListener(mxEvent.ROOT,mxUtils.bind(this,function(){b.checkDefaultParent()}));var A=mxUtils.bind(this,function(){this.updateDocumentTitle();this.updateTabContainer()});this.addListener("currentThemeChanged",A);this.editor.addListener("pagesPatched",A);this.editor.addListener("pageRenamed",A);this.editor.addListener("pageMoved",A);this.editor.addListener("fileLoaded",A);+this.editor.addListener("pageSelected",mxUtils.bind(this,function(y,G){this.updateTabContainer();this.updateHashObject();this.updateDocumentTitle()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(y,G){this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}));this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTabContainer()}))}};EditorUi.prototype.scrollToPage=function(b,l){var p=null!=b?this.getPageIndex(b):this.getSelectedPageIndex(),g=null!=b?b:this.currentPage;null!=p&&null!=this.tabScroller&&this.tabScroller.children.length>p&&null!=this.tabScroller.children[p]&&(g!=this.lastScrollPage||l)&&(this.tabScroller.children[p].scrollIntoView({block:"nearest",inline:null!=b?"nearest":"center"}),this.tabScroller.children[p].className="geTab gePageTab geActivePage",this.lastScrollPage=g,this.btKnownTabScroll=this.tabScroller.scrollLeft)};EditorUi.prototype.restoreViewState=function(b,l,p){b=null!=b?this.getPageById(b.getId()):null;var g=this.editor.graph;null!=b&&null!=this.currentPage&&null!=this.pages&&(b!=this.currentPage?this.selectPage(b,!0,l):(g.setViewState(l),this.editor.updateGraphComponents(),g.view.revalidate(),g.sizeDidChange()),g.container.scrollLeft=g.view.translate.x*g.view.scale+l.scrollLeft,g.container.scrollTop=g.view.translate.y*g.view.scale+l.scrollTop,g.restoreSelection(p))};-Graph.prototype.createViewState=function(b){var l=b.getAttribute("page"),p=parseFloat(b.getAttribute("pageScale")),g=parseFloat(b.getAttribute("pageWidth")),x=parseFloat(b.getAttribute("pageHeight")),B=b.getAttribute("background"),z=this.parseBackgroundImage(b.getAttribute("backgroundImage")),F=b.getAttribute("extFonts");if(F)try{F=F.split("|").map(function(K){K=K.split("^");return{name:K[0],url:K[1]}})}catch(K){console.log("ExtFonts format error: "+K.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),-gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:function(){var K=b.getAttribute("fold");return null==K||null!=Editor.config&&null!=Editor.config.defaultFoldingEnabled?Graph.prototype.defaultFoldingEnabled:"0"!=K}(),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=l?"0"!=l:this.defaultPageVisible,background:null!=B&&0<B.length?B:null,backgroundImage:z,pageScale:isNaN(p)?mxGraph.prototype.pageScale:-p,pageFormat:isNaN(g)||isNaN(x)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat():new mxRectangle(0,0,g,x),tooltips:"0"!=b.getAttribute("tooltips"),connect:function(){var K=b.getAttribute("connect");return null==K||null!=Editor.config&&null!=Editor.config.defaultConnectable?Graph.prototype.defaultConnectable:"0"!=K}(),arrows:function(){var K=b.getAttribute("arrows");return null==K||null!=Editor.config&&null!=Editor.config.defaultConnectionArrowsEnabled?-Graph.prototype.defaultConnectionArrowsEnabled:"0"!=K}(),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:F||[]}};+Graph.prototype.createViewState=function(b){var l=b.getAttribute("page"),p=parseFloat(b.getAttribute("pageScale")),g=parseFloat(b.getAttribute("pageWidth")),x=parseFloat(b.getAttribute("pageHeight")),A=b.getAttribute("background"),y=this.parseBackgroundImage(b.getAttribute("backgroundImage")),G=b.getAttribute("extFonts");if(G)try{G=G.split("|").map(function(L){L=L.split("^");return{name:L[0],url:L[1]}})}catch(L){console.log("ExtFonts format error: "+L.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),+gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:function(){var L=b.getAttribute("fold");return null==L||null!=Editor.config&&null!=Editor.config.defaultFoldingEnabled?Graph.prototype.defaultFoldingEnabled:"0"!=L}(),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=l?"0"!=l:this.defaultPageVisible,background:null!=A&&0<A.length?A:null,backgroundImage:y,pageScale:isNaN(p)?mxGraph.prototype.pageScale:+p,pageFormat:isNaN(g)||isNaN(x)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat():new mxRectangle(0,0,g,x),tooltips:"0"!=b.getAttribute("tooltips"),connect:function(){var L=b.getAttribute("connect");return null==L||null!=Editor.config&&null!=Editor.config.defaultConnectable?Graph.prototype.defaultConnectable:"0"!=L}(),arrows:function(){var L=b.getAttribute("arrows");return null==L||null!=Editor.config&&null!=Editor.config.defaultConnectionArrowsEnabled?+Graph.prototype.defaultConnectionArrowsEnabled:"0"!=L}(),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:G||[]}};Graph.prototype.saveViewState=function(b,l,p,g,x){p||(l.setAttribute("grid",(null==b?this.defaultGridEnabled:b.gridEnabled)?"1":"0"),l.setAttribute("page",(null==b?this.defaultPageVisible:b.pageVisible)?"1":"0"),l.setAttribute("gridSize",null!=b?b.gridSize:mxGraph.prototype.gridSize),l.setAttribute("guides",null==b||b.guidesEnabled?"1":"0"),l.setAttribute("tooltips",null==b||b.tooltips?"1":"0"),l.setAttribute("connect",null==b||b.connect?"1":"0"),l.setAttribute("arrows",null==b||b.arrows?"1":"0"),l.setAttribute("fold",null==b||b.foldingEnabled?"1":"0"));l.setAttribute("pageScale",null!=b&&null!=b.pageScale?b.pageScale:mxGraph.prototype.pageScale);p=null!=b?b.pageFormat:"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat();null!=p&&(l.setAttribute("pageWidth",p.width),l.setAttribute("pageHeight",p.height));null!=b&&(null!=b.background&&l.setAttribute("background",b.background),g=this.getBackgroundImageObject(b.backgroundImage,-g,x),null!=g&&l.setAttribute("backgroundImage",JSON.stringify(g)));l.setAttribute("math",(null==b?this.defaultMathEnabled:b.mathEnabled)?"1":"0");l.setAttribute("shadow",null!=b&&b.shadowVisible?"1":"0");null==b||null==b.adaptiveColors?l.removeAttribute("adaptiveColors"):l.setAttribute("adaptiveColors",b.adaptiveColors);null!=b&&null!=b.extFonts&&0<b.extFonts.length&&l.setAttribute("extFonts",b.extFonts.map(function(B){return B.name+"^"+B.url}).join("|"))};+g,x),null!=g&&l.setAttribute("backgroundImage",JSON.stringify(g)));l.setAttribute("math",(null==b?this.defaultMathEnabled:b.mathEnabled)?"1":"0");l.setAttribute("shadow",null!=b&&b.shadowVisible?"1":"0");null==b||null==b.adaptiveColors?l.removeAttribute("adaptiveColors"):l.setAttribute("adaptiveColors",b.adaptiveColors);null!=b&&null!=b.extFonts&&0<b.extFonts.length&&l.setAttribute("extFonts",b.extFonts.map(function(A){return A.name+"^"+A.url}).join("|"))};Graph.prototype.getViewState=function(){return{defaultParent:this.defaultParent,currentRoot:this.view.currentRoot,gridEnabled:this.gridEnabled,gridSize:this.gridSize,guidesEnabled:this.graphHandler.guidesEnabled,foldingEnabled:this.foldingEnabled,shadowVisible:this.shadowVisible,scrollbars:this.scrollbars,pageVisible:this.pageVisible,background:this.background,backgroundImage:this.backgroundImage,pageScale:this.pageScale,pageFormat:this.pageFormat,tooltips:this.tooltipHandler.isEnabled(),connect:this.connectionHandler.isEnabled(),arrows:this.connectionArrowsEnabled,scale:this.view.scale,scrollLeft:this.container.scrollLeft-this.view.translate.x*this.view.scale,scrollTop:this.container.scrollTop-this.view.translate.y*this.view.scale,translate:this.view.translate.clone(),lastPasteXml:this.lastPasteXml,pasteCounter:this.pasteCounter,mathEnabled:this.mathEnabled,adaptiveColors:this.adaptiveColors,hiddenTags:this.hiddenTags,extFonts:this.extFonts}};Graph.prototype.setViewState=function(b,l){if(null!=b){this.lastPasteXml=b.lastPasteXml;this.pasteCounter=b.pasteCounter||0;this.mathEnabled=b.mathEnabled;this.adaptiveColors=b.adaptiveColors;this.gridEnabled=null!=urlParams.grid?"0"!=urlParams.grid:b.gridEnabled;this.gridSize=b.gridSize;this.graphHandler.guidesEnabled=b.guidesEnabled;this.foldingEnabled=b.foldingEnabled;this.setShadowVisible(b.shadowVisible,!1);this.scrollbars=b.scrollbars;this.pageVisible=!this.isViewer()&&(null!=urlParams.pv?"0"!=@@ -15098,28 +15102,28 @@ g=!0;for(x=0;x<p.length;x++)if(p[x].name==b){g=!1;break}g&&this.extFonts.push({nEditorUi.prototype.updatePageRoot=function(b,l){if(null==b.root){l=this.editor.extractGraphModel(b.node,null,l);var p=Editor.extractParserError(l);if(p)throw Error(p);null!=l?(b.graphModelNode=l,b.viewState=this.editor.graph.createViewState(l),p=new mxCodec(l.ownerDocument),b.root=p.decode(l).root):(b.root=this.editor.graph.model.createRoot(),b.root.setId("0"),b.root.children[0].setId("1"),b.needsUpdate=!0)}else if(null==b.viewState){if(null==b.graphModelNode){l=this.editor.extractGraphModel(b.node);if(p=Editor.extractParserError(l))throw Error(p);null!=l&&(b.graphModelNode=l)}null!=b.graphModelNode&&(b.viewState=this.editor.graph.createViewState(b.graphModelNode))}if(null==b.root.children||0==b.root.children.length)l=new mxCell,l.setId("1"),b.root.insert(l),b.needsUpdate=!0;return b};EditorUi.prototype.getDiagramSnapshot=function(){return{node:this.editor.getGraphXml(),page:this.currentPage}};EditorUi.prototype.updateDiagramData=function(b,l){if(null==this.getPageIndex(b.page))this.insertPage(null,null,l);else{var p=new mxCodec(b.node.ownerDocument),g=new mxGraphModel;p.decode(b.node,g);p=new mxCodec(l.ownerDocument);var x=new mxGraphModel;p.decode(l,x);this.selectPage(b.page);l=this.diffCells(g.root,x.root);this.patchPage(b.page,l,null,!0)}};EditorUi.prototype.replaceDiagramData=function(b){this.editor.graph.model.execute(new ReplaceDiagram(this,mxUtils.parseXml(b).documentElement))};-EditorUi.prototype.selectPage=function(b,l,p){try{if(b!=this.currentPage){var g=this.editor.graph;g.isEditing()&&g.stopEditing(!1);l=null!=l?l:!1;g.isMouseDown=!1;g.reset();var x=g.model.createUndoableEdit();x.ignoreEdit=!0;var B=new SelectPage(this,b,p);B.execute();x.add(B);x.notify();l||g.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",x))}}catch(z){this.handleError(z)}};+EditorUi.prototype.selectPage=function(b,l,p){try{if(b!=this.currentPage){var g=this.editor.graph;g.isEditing()&&g.stopEditing(!1);l=null!=l?l:!1;g.isMouseDown=!1;g.reset();var x=g.model.createUndoableEdit();x.ignoreEdit=!0;var A=new SelectPage(this,b,p);A.execute();x.add(A);x.notify();l||g.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",x))}}catch(y){this.handleError(y)}};EditorUi.prototype.selectNextPage=function(b){var l=this.currentPage;null!=l&&null!=this.pages&&(l=mxUtils.indexOf(this.pages,l),b?this.selectPage(this.pages[mxUtils.mod(l+1,this.pages.length)]):b||this.selectPage(this.pages[mxUtils.mod(l-1,this.pages.length)]))};EditorUi.prototype.insertPage=function(b,l,p){this.editor.graph.isEnabled()&&(this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1),b=null!=b?b:this.createPage(null,this.createPageId(),p),l=null!=l?l:this.pages.length,l=new ChangePage(this,b,b,l),this.editor.graph.model.execute(l));return b};EditorUi.prototype.createPageId=function(){do var b=Editor.guid();while(null!=this.getPageById(b));return b};EditorUi.prototype.createPage=function(b,l,p){l=new DiagramPage((null!=this.fileNode?this.fileNode.ownerDocument:document).createElement("diagram"),l);l.setName(null!=b?b:this.createPageName());this.initDiagramNode(l,p);return l};EditorUi.prototype.createPageName=function(){for(var b={},l=0;l<this.pages.length;l++){var p=this.pages[l].getName();null!=p&&0<p.length&&(b[p]=p)}l=this.pages.length;do p=mxResources.get("pageWithNumber",[++l]);while(null!=b[p]);return p};EditorUi.prototype.removePage=function(b){try{var l=this.editor.graph,p=mxUtils.indexOf(this.pages,b);if(l.isEnabled()&&0<=p){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);l.model.beginUpdate();try{var g=this.currentPage;g==b&&1<this.pages.length?(p==this.pages.length-1?p--:p++,g=this.pages[p]):1>=this.pages.length&&(g=this.insertPage(),l.model.execute(new RenamePage(this,g,mxResources.get("pageWithNumber",[1]))));l.model.execute(new ChangePage(this,b,g))}finally{l.model.endUpdate()}}}catch(x){this.handleError(x)}return b};-EditorUi.prototype.duplicatePage=function(b,l){var p=null;try{var g=this.editor.graph;if(g.isEnabled()){g.isEditing()&&g.stopEditing();var x=b.node.cloneNode(!1);x.removeAttribute("id");var B={},z=g.createCellLookup([g.model.root]);p=new DiagramPage(x);p.root=g.cloneCell(g.model.root,null,B);var F=new mxGraphModel;F.prefix=Editor.guid()+"-";F.setRoot(p.root);g.updateCustomLinks(g.createCellMapping(B,z),[p.root]);p.viewState=b==this.currentPage?g.getViewState():b.viewState;this.initDiagramNode(p);-p.viewState.scale=1;delete p.viewState.scrollLeft;delete p.viewState.scrollTop;delete p.viewState.currentRoot;delete p.viewState.defaultParent;p.setName(l);p=this.insertPage(p,mxUtils.indexOf(this.pages,b)+1)}}catch(K){this.handleError(K)}return p};EditorUi.prototype.initDiagramNode=function(b,l){null==l&&(l=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,l);EditorUi.removeChildNodes(b.node);b.node.appendChild(l)};+EditorUi.prototype.duplicatePage=function(b,l){var p=null;try{var g=this.editor.graph;if(g.isEnabled()){g.isEditing()&&g.stopEditing();var x=b.node.cloneNode(!1);x.removeAttribute("id");var A={},y=g.createCellLookup([g.model.root]);p=new DiagramPage(x);p.root=g.cloneCell(g.model.root,null,A);var G=new mxGraphModel;G.prefix=Editor.guid()+"-";G.setRoot(p.root);g.updateCustomLinks(g.createCellMapping(A,y),[p.root]);p.viewState=b==this.currentPage?g.getViewState():b.viewState;this.initDiagramNode(p);+p.viewState.scale=1;delete p.viewState.scrollLeft;delete p.viewState.scrollTop;delete p.viewState.currentRoot;delete p.viewState.defaultParent;p.setName(l);p=this.insertPage(p,mxUtils.indexOf(this.pages,b)+1)}}catch(L){this.handleError(L)}return p};EditorUi.prototype.initDiagramNode=function(b,l){null==l&&(l=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,l);EditorUi.removeChildNodes(b.node);b.node.appendChild(l)};EditorUi.prototype.clonePages=function(b){for(var l=[],p=[],g=0;g<b.length;g++)try{p.push(this.clonePage(b[g]))}catch(x){l.push(mxResources.get("pageWithNumber",[g+1])+": "+x.toString())}if(0<l.length){b=Error(l.join("\n"));try{0<p.length&&(b.fallbackFileData=this.getXmlForPages(p))}catch(x){}throw b;}return p};EditorUi.prototype.clonePage=function(b){this.updatePageRoot(b);var l=new DiagramPage(b.node.cloneNode(!0)),p=b==this.currentPage?this.editor.graph.getViewState():b.viewState;l.viewState=mxUtils.clone(p,EditorUi.transientViewStateProperties);l.root=this.editor.graph.model.cloneCell(b.root,null,!0);l.diagramModified=b.diagramModified;return l};EditorUi.prototype.renamePage=function(b){if(this.editor.graph.isEnabled()){var l=new FilenameDialog(this,b.getName(),mxResources.get("rename"),mxUtils.bind(this,function(p){null!=p&&0<p.length&&this.editor.graph.model.execute(new RenamePage(this,b,p))}),mxResources.get("rename"));this.showDialog(l.container,300,80,!0,!0);l.init()}return b};EditorUi.prototype.movePage=function(b,l){this.editor.graph.model.execute(new MovePage(this,b,l))};-EditorUi.prototype.sortPages=function(){var b=this.pages.slice().sort(function(x,B){return(x.getName()||"").localeCompare(B.getName()||"",void 0,{numeric:!0,sensitivity:"base"})}),l=this.editor.graph.model;l.beginUpdate();try{for(var p=0;p<b.length;p++){var g=mxUtils.indexOf(this.pages,b[p]);g!=p&&this.movePage(g,p)}}finally{l.endUpdate()}this.scrollToPage(this.currentPage,!0)};+EditorUi.prototype.sortPages=function(){var b=this.pages.slice().sort(function(x,A){return(x.getName()||"").localeCompare(A.getName()||"",void 0,{numeric:!0,sensitivity:"base"})}),l=this.editor.graph.model;l.beginUpdate();try{for(var p=0;p<b.length;p++){var g=mxUtils.indexOf(this.pages,b[p]);g!=p&&this.movePage(g,p)}}finally{l.endUpdate()}this.scrollToPage(this.currentPage,!0)};EditorUi.prototype.createTabContainer=function(){var b=document.createElement("div");b.className="geTabContainer geTabItem";return b};-EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&!this.isTabContainerVisible())this.tabContainer.style.display="none";else if(null!=this.tabContainer&&null!=this.pages){this.tabContainer.style.display="";var b=this.editor.graph,l=document.createElement("div");l.className="geTabScroller";for(var p=null,g=null,x=null,B=this,z=null!=this.tabScroller?this.tabScroller.scrollLeft:0,F=!1,K=0;K<this.pages.length;K++){var M=this.pages[K];if(null!=M){var L=M.getId(),Q=M.getName()||-mxResources.get("untitled"),c=L+":"+Q;c=null!=this.btPageTabCache?this.btPageTabCache[c]:null;null!=c?c.setAttribute("title",Q+(null!=L?" ("+L+")":"")+" ["+(K+1)+"]"):(c=this.createTabForPage(M,K+1),F=!0);c.setAttribute("draggable","true");c.setAttribute("data-index",K);c.className="geTab gePageTab";null==c.btDndInstalled&&(c.btDndInstalled=!0,mxEvent.addListener(c,"dragstart",mxUtils.bind(this,function(n){b.isEnabled()?(mxClient.IS_FF&&n.dataTransfer.setData("Text","<diagram/>"),p=parseInt(n.currentTarget.getAttribute("data-index"),-10),g=n.currentTarget,window.requestAnimationFrame(function(){null!=g&&g.classList.add("gePageTabDragPlaceholder")}),B._pageTabDragOverHandler=function(q){q.dataTransfer.dropEffect="move";q.preventDefault();q.target.classList&&q.target.classList.contains("gePageTab")||q.stopPropagation()},B._pageTabDropHandler=function(q){q.preventDefault();q.stopPropagation()},document.addEventListener("dragover",B._pageTabDragOverHandler,!0),document.addEventListener("drop",B._pageTabDropHandler,!0)):mxEvent.consume(n)})),-mxEvent.addListener(c,"dragend",mxUtils.bind(this,function(n){if(null!=g){g.classList.remove("gePageTabDragPlaceholder");for(var q=g.parentNode.querySelectorAll(".gePageTab"),t=0,u=0;u<q.length;u++)if(q[u]==g){t=u;break}null!=p&&t!=p&&this.movePage(p,t)}null!=B._pageTabDragOverHandler&&(document.removeEventListener("dragover",B._pageTabDragOverHandler,!0),document.removeEventListener("drop",B._pageTabDropHandler,!0),B._pageTabDragOverHandler=null,B._pageTabDropHandler=null);g=p=null;n.stopPropagation();-n.preventDefault()})),mxEvent.addListener(c,"dragover",function(n){if(null!=p&&null!=g){n.dataTransfer.dropEffect="move";var q=n.currentTarget;if(q!=g){var t=q.getBoundingClientRect(),u=g.parentNode;n.clientX<t.left+t.width/2?u.insertBefore(g,q):q.nextSibling!=g&&u.insertBefore(g,q.nextSibling)}}n.stopPropagation();n.preventDefault()}),mxEvent.addListener(c,"drop",function(n){n.stopPropagation();n.preventDefault()}));M==this.currentPage&&(x=c);l.appendChild(c)}}this.tabContainer.innerText="";this.isPageInsertTabVisible()&&-this.tabContainer.appendChild(this.createPageInsertTab());"simple"!=Editor.currentTheme&&(this.pageMenuTab=this.createPageMenuTab(),this.tabContainer.appendChild(this.pageMenuTab));this.tabContainer.appendChild(l);this.leftScrollTab=this.createLeftScrollTab();this.tabContainer.appendChild(this.leftScrollTab);this.rightScrollTab=this.createRightScrollTab();this.tabContainer.appendChild(this.rightScrollTab);if(Graph.browserTranslate&&Graph.isBrowserTranslated())for(this.btPageTabCache={},K=0;K<l.children.length;K++)M=-null!=this.pages&&K<this.pages.length?this.pages[K]:null,null!=M&&(M=M.getId()+":"+(M.getName()||mxResources.get("untitled")),this.btPageTabCache[M]=l.children[K]);this.tabScroller=l;mxEvent.addListener(this.tabScroller,"scroll",mxUtils.bind(this,function(n){this.checkTabScrollerOverflow()}));if(Graph.browserTranslate&&Graph.isBrowserTranslated()){if(null==this.btCanary){B=this;this.btCanary=document.createElement("p");this.btCanary.setAttribute("aria-hidden","true");this.btCanary.style.cssText="position:absolute;left:-10000px;top:0;width:1px;height:1px;overflow:hidden;pointer-events:none;";-this.btCanaryOriginal="Click here to insert a new page into the document";this.btCanary.textContent=this.btCanaryOriginal;document.body.appendChild(this.btCanary);this.btCanarySavedScroll=null;var f=function(){null!=B.btCanarySavedScroll&&null!=B.tabScroller&&(B.btCanarySavedScroll=null,B.scrollToPage(null,!0))};this.btCanaryObserver=new MutationObserver(function(){null!=B.btCanarySavedScroll&&B.btCanary.textContent!=B.btCanaryOriginal&&setTimeout(f,100)});this.btCanaryObserver.observe(this.btCanary,-{characterData:!0,childList:!0,subtree:!0})}null==this.btCanarySavedScroll&&F&&0<this.btKnownTabScroll&&(this.btCanarySavedScroll=this.btKnownTabScroll,this.btCanary.textContent=this.btCanaryOriginal,document.body.appendChild(this.btCanary))}var k=document.createElement("a");k.href="https://github.com/jgraph/drawio";k.target="_blank";k.style.cssText="margin-left:auto;display:flex;align-items:center;padding:0 8px;opacity:0.5;flex-shrink:0";l=document.createElement("img");l.src=IMAGE_PATH+(Editor.isDarkMode()?-"/github-logo-white.svg":"/github-logo.svg");l.style.cssText="width:18px;height:18px";l.setAttribute("title","jgraph/drawio");k.appendChild(l);mxEvent.addListener(k,"mouseenter",function(){k.style.opacity="1"});mxEvent.addListener(k,"mouseleave",function(){k.style.opacity="0.5"});this.tabContainer.appendChild(k);null!=x&&x.classList.add("geActivePage");this.tabScroller.scrollLeft=z;this.scrollToPage();this.btKnownTabScroll=this.tabScroller.scrollLeft;this.checkTabScrollerOverflow();null!=x&&x.scrollIntoView({behavior:"smooth",+EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&!this.isTabContainerVisible())this.tabContainer.style.display="none";else if(null!=this.tabContainer&&null!=this.pages){this.tabContainer.style.display="";var b=this.editor.graph,l=document.createElement("div");l.className="geTabScroller";for(var p=null,g=null,x=null,A=this,y=null!=this.tabScroller?this.tabScroller.scrollLeft:0,G=!1,L=0;L<this.pages.length;L++){var O=this.pages[L];if(null!=O){var J=O.getId(),Q=O.getName()||+mxResources.get("untitled"),c=J+":"+Q;c=null!=this.btPageTabCache?this.btPageTabCache[c]:null;null!=c?c.setAttribute("title",Q+(null!=J?" ("+J+")":"")+" ["+(L+1)+"]"):(c=this.createTabForPage(O,L+1),G=!0);c.setAttribute("draggable","true");c.setAttribute("data-index",L);c.className="geTab gePageTab";null==c.btDndInstalled&&(c.btDndInstalled=!0,mxEvent.addListener(c,"dragstart",mxUtils.bind(this,function(n){b.isEnabled()?(mxClient.IS_FF&&n.dataTransfer.setData("Text","<diagram/>"),p=parseInt(n.currentTarget.getAttribute("data-index"),+10),g=n.currentTarget,window.requestAnimationFrame(function(){null!=g&&g.classList.add("gePageTabDragPlaceholder")}),A._pageTabDragOverHandler=function(q){q.dataTransfer.dropEffect="move";q.preventDefault();q.target.classList&&q.target.classList.contains("gePageTab")||q.stopPropagation()},A._pageTabDropHandler=function(q){q.preventDefault();q.stopPropagation()},document.addEventListener("dragover",A._pageTabDragOverHandler,!0),document.addEventListener("drop",A._pageTabDropHandler,!0)):mxEvent.consume(n)})),+mxEvent.addListener(c,"dragend",mxUtils.bind(this,function(n){if(null!=g){g.classList.remove("gePageTabDragPlaceholder");for(var q=g.parentNode.querySelectorAll(".gePageTab"),t=0,u=0;u<q.length;u++)if(q[u]==g){t=u;break}null!=p&&t!=p&&this.movePage(p,t)}null!=A._pageTabDragOverHandler&&(document.removeEventListener("dragover",A._pageTabDragOverHandler,!0),document.removeEventListener("drop",A._pageTabDropHandler,!0),A._pageTabDragOverHandler=null,A._pageTabDropHandler=null);g=p=null;n.stopPropagation();+n.preventDefault()})),mxEvent.addListener(c,"dragover",function(n){if(null!=p&&null!=g){n.dataTransfer.dropEffect="move";var q=n.currentTarget;if(q!=g){var t=q.getBoundingClientRect(),u=g.parentNode;n.clientX<t.left+t.width/2?u.insertBefore(g,q):q.nextSibling!=g&&u.insertBefore(g,q.nextSibling)}}n.stopPropagation();n.preventDefault()}),mxEvent.addListener(c,"drop",function(n){n.stopPropagation();n.preventDefault()}));O==this.currentPage&&(x=c);l.appendChild(c)}}this.tabContainer.innerText="";this.isPageInsertTabVisible()&&+this.tabContainer.appendChild(this.createPageInsertTab());"simple"!=Editor.currentTheme&&(this.pageMenuTab=this.createPageMenuTab(),this.tabContainer.appendChild(this.pageMenuTab));this.tabContainer.appendChild(l);this.leftScrollTab=this.createLeftScrollTab();this.tabContainer.appendChild(this.leftScrollTab);this.rightScrollTab=this.createRightScrollTab();this.tabContainer.appendChild(this.rightScrollTab);if(Graph.browserTranslate&&Graph.isBrowserTranslated())for(this.btPageTabCache={},L=0;L<l.children.length;L++)O=+null!=this.pages&&L<this.pages.length?this.pages[L]:null,null!=O&&(O=O.getId()+":"+(O.getName()||mxResources.get("untitled")),this.btPageTabCache[O]=l.children[L]);this.tabScroller=l;mxEvent.addListener(this.tabScroller,"scroll",mxUtils.bind(this,function(n){this.checkTabScrollerOverflow()}));if(Graph.browserTranslate&&Graph.isBrowserTranslated()){if(null==this.btCanary){A=this;this.btCanary=document.createElement("p");this.btCanary.setAttribute("aria-hidden","true");this.btCanary.style.cssText="position:absolute;left:-10000px;top:0;width:1px;height:1px;overflow:hidden;pointer-events:none;";+this.btCanaryOriginal="Click here to insert a new page into the document";this.btCanary.textContent=this.btCanaryOriginal;document.body.appendChild(this.btCanary);this.btCanarySavedScroll=null;var f=function(){null!=A.btCanarySavedScroll&&null!=A.tabScroller&&(A.btCanarySavedScroll=null,A.scrollToPage(null,!0))};this.btCanaryObserver=new MutationObserver(function(){null!=A.btCanarySavedScroll&&A.btCanary.textContent!=A.btCanaryOriginal&&setTimeout(f,100)});this.btCanaryObserver.observe(this.btCanary,+{characterData:!0,childList:!0,subtree:!0})}null==this.btCanarySavedScroll&&G&&0<this.btKnownTabScroll&&(this.btCanarySavedScroll=this.btKnownTabScroll,this.btCanary.textContent=this.btCanaryOriginal,document.body.appendChild(this.btCanary))}var k=document.createElement("a");k.href="https://github.com/jgraph/drawio";k.target="_blank";k.style.cssText="margin-left:auto;display:flex;align-items:center;padding:0 8px;opacity:0.5;flex-shrink:0";l=document.createElement("img");l.src=IMAGE_PATH+(Editor.isDarkMode()?+"/github-logo-white.svg":"/github-logo.svg");l.style.cssText="width:18px;height:18px";l.setAttribute("title","jgraph/drawio");k.appendChild(l);mxEvent.addListener(k,"mouseenter",function(){k.style.opacity="1"});mxEvent.addListener(k,"mouseleave",function(){k.style.opacity="0.5"});this.tabContainer.appendChild(k);null!=x&&x.classList.add("geActivePage");this.tabScroller.scrollLeft=y;this.scrollToPage();this.btKnownTabScroll=this.tabScroller.scrollLeft;this.checkTabScrollerOverflow();null!=x&&x.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}};EditorUi.prototype.checkTabScrollerOverflow=function(){null!=this.tabScroller&&null!=this.tabContainer&&2<this.tabContainer.children.length&&(this.tabScroller.scrollWidth>this.tabScroller.offsetWidth?(this.leftScrollTab.style.display="",this.rightScrollTab.style.display="",0==this.tabScroller.scrollLeft?this.leftScrollTab.classList.add("mxDisabled"):this.leftScrollTab.classList.remove("mxDisabled"),Math.ceil(this.tabScroller.scrollLeft)+this.tabScroller.offsetWidth>=this.tabScroller.scrollWidth?this.rightScrollTab.classList.add("mxDisabled"):this.rightScrollTab.classList.remove("mxDisabled")):(this.leftScrollTab.style.display="none",this.rightScrollTab.style.display="none"))};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};@@ -15127,144 +15131,144 @@ EditorUi.prototype.createTab=function(){var b=document.createElement("div");b.clEditorUi.prototype.createControlTab=function(b,l,p){var g=this.createTab();g.className="geTab geControlTab";null!=b&&g.setAttribute("title",b);b=document.createElement("div");b.className="geButton";b.style.backgroundImage="url("+l+")";g.appendChild(b);mxEvent.addListener(g,"click",p);return g};EditorUi.prototype.createPageInsertTab=function(){return this.createControlTab(mxResources.get("insertPage"),Editor.plusImage,mxUtils.bind(this,function(b){this.actions.get("insertPage").funct();mxEvent.consume(b)}))};EditorUi.prototype.createLeftScrollTab=function(){return this.createControlTab(null,Editor.chevronLeftImage,mxUtils.bind(this,function(b){var l=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:-l,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft-=l;mxEvent.consume(b)}))};EditorUi.prototype.createRightScrollTab=function(){return this.createControlTab(null,Editor.chevronRightImage,mxUtils.bind(this,function(b){var l=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:l,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft+=l;mxEvent.consume(b)}))};-EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var l=new mxPopupMenu(mxUtils.bind(this,function(x,B){this.menus.get("pages").funct(x,B)}));l.smartSeparators=!0;l.showDisabled=!0;l.autoExpand=!0;l.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(l,arguments);l.destroy()});var p=mxEvent.getClientX(b),g=mxEvent.getClientY(b);l.popup(p,+EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var l=new mxPopupMenu(mxUtils.bind(this,function(x,A){this.menus.get("pages").funct(x,A)}));l.smartSeparators=!0;l.showDisabled=!0;l.autoExpand=!0;l.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(l,arguments);l.destroy()});var p=mxEvent.getClientX(b),g=mxEvent.getClientY(b);l.popup(p,g,null,b);this.setCurrentMenu(l);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,l){var p=this.createTab(),g=b.getName()||mxResources.get("untitled"),x=b.getId();p.setAttribute("title",g+(null!=x?" ("+x+")":"")+" ["+l+"]");l=document.createElement("span");l.style.maxWidth="160px";l.style.textOverflow="ellipsis";l.style.overflow="hidden";mxUtils.write(l,g);p.appendChild(l);this.addTabListeners(b,p);return p};-EditorUi.prototype.addTabListeners=function(b,l){mxEvent.disableContextMenu(l);var p=this.editor.graph;mxEvent.addListener(l,"dblclick",mxUtils.bind(this,function(K){this.renamePage(b);mxEvent.consume(K)}));var g=document.createElement("div");g.style.backgroundImage="url("+Editor.thinExpandImage+")";g.className="geButton";l.appendChild(g);var x=!1,B=!1,z=mxUtils.bind(this,function(K){x=null!=this.currentMenu;B=b==this.currentPage;this.scrollToPage(b);p.isMouseDown||B||this.selectPage(b)}),F=mxUtils.bind(this,-function(K){if(!p.isMouseDown&&(B&&(mxEvent.isTouchEvent(K)||mxEvent.getSource(K)==g)||mxEvent.isPopupTrigger(K))&&(p.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(K)||!x)){var M=new mxPopupMenu(this.createPageMenu(b));M.smartSeparators=!0;M.showDisabled=!0;M.autoExpand=!0;M.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(M,arguments);this.resetCurrentMenu();M.destroy()});var L=mxEvent.getClientX(K),Q=mxEvent.getClientY(K);M.popup(L,Q,null,K);-this.setCurrentMenu(M,l)}mxEvent.consume(K)});mxEvent.addGestureListeners(g,z,null,F);mxEvent.addGestureListeners(l,z,null,F)};+EditorUi.prototype.addTabListeners=function(b,l){mxEvent.disableContextMenu(l);var p=this.editor.graph;mxEvent.addListener(l,"dblclick",mxUtils.bind(this,function(L){this.renamePage(b);mxEvent.consume(L)}));var g=document.createElement("div");g.style.backgroundImage="url("+Editor.thinExpandImage+")";g.className="geButton";l.appendChild(g);var x=!1,A=!1,y=mxUtils.bind(this,function(L){x=null!=this.currentMenu;A=b==this.currentPage;this.scrollToPage(b);p.isMouseDown||A||this.selectPage(b)}),G=mxUtils.bind(this,+function(L){if(!p.isMouseDown&&(A&&(mxEvent.isTouchEvent(L)||mxEvent.getSource(L)==g)||mxEvent.isPopupTrigger(L))&&(p.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(L)||!x)){var O=new mxPopupMenu(this.createPageMenu(b));O.smartSeparators=!0;O.showDisabled=!0;O.autoExpand=!0;O.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(O,arguments);this.resetCurrentMenu();O.destroy()});var J=mxEvent.getClientX(L),Q=mxEvent.getClientY(L);O.popup(J,Q,null,L);+this.setCurrentMenu(O,l)}mxEvent.consume(L)});mxEvent.addGestureListeners(g,y,null,G);mxEvent.addGestureListeners(l,y,null,G)};EditorUi.prototype.createPageMenu=function(b,l){return mxUtils.bind(this,function(p,g){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||navigator.standalone||p.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,!0,!0))}),g));this.editor.graph.isEnabled()&&(this.menus.addMenuItems(p,["duplicatePage","-"],g),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",-p,g,mxResources.get("move")),this.menus.addMenuItems(p,["removePage","renamePage"],g))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(g,x,B,z,F){x=null!=x?x:!1;null==B&&(B=this.getFoldableCells(this.getSelectionCells(),g));this.stopEditing();this.model.beginUpdate();try{for(var K=B.slice(),M=0;M<B.length;M++)"1"==mxUtils.getValue(this.getCurrentCellStyle(B[M]),"treeFolding","0")&&this.foldTreeCell(g,B[M]);B=K;B=b.apply(this,arguments)}finally{this.model.endUpdate()}return B};Graph.prototype.foldTreeCell=function(g,x){this.model.beginUpdate();try{var B=-[];this.traverse(x,!0,mxUtils.bind(this,function(F,K){var M=null!=K&&this.isTreeEdge(K);M&&B.push(K);F==x||null!=K&&!M||B.push(F);return(null==K||M)&&(F==x||!this.model.isCollapsed(F))}));this.model.setCollapsed(x,g);for(var z=0;z<B.length;z++)this.model.setVisible(B[z],!g)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(g){return!this.isEdgeIgnored(g)};Graph.prototype.getTreeEdges=function(g,x,B,z,F,K){return this.model.filterCells(this.getEdges(g,x,B,z,F,K),mxUtils.bind(this,-function(M){return this.isTreeEdge(M)}))};Graph.prototype.getIncomingTreeEdges=function(g,x){return this.getTreeEdges(g,x,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(g,x){return this.getTreeEdges(g,x,!1,!0,!1)};var l=EditorUi.prototype.init;EditorUi.prototype.init=function(){l.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function g(m){return y.isVertex(m)&&B(m)}function x(m){var r=!1;null!=m&&(r="1"==-u.getCurrentCellStyle(m).treeMoving);return r}function B(m){var r=!1;null!=m&&(m=y.getParent(m),r=u.view.getState(m),r="tree"==(null!=r?r.style:u.getCellStyle(m)).containerType);return r}function z(m){for(;null!=m&&!B(m);)m=y.getParent(m);return null!=m?y.getParent(m):null}function F(m){var r=!1;null!=m&&(m=y.getParent(m),r=u.view.getState(m),u.view.getState(m),r=null!=(null!=r?r.style:u.getCellStyle(m)).childLayout);return r}function K(m,r){function A(W,Z){null!=W&&(G.cut.get(W)||(G.cut.put(W,!0),-G.cells.push(W)),Z&&!O.get(W)&&(O.put(W,!0),P.push(W)))}function D(W){if(!G.deleted.get(W)){G.deleted.put(W,!0);G.cells.push(W);W=u.getAllEdges([W]);for(var Z=0;Z<W.length;Z++)A(W[Z],!0)}}for(var G={cells:[],deleted:new mxDictionary,cut:new mxDictionary,cascaded:[]},O=new mxDictionary,P=[],V=0;V<m.length;V++){var Y=m[V];y.isEdge(Y)?A(Y,!1):y.isVertex(Y)&&null!=z(Y)?D(Y):null!=Y&&G.cells.push(Y)}for(;0<P.length;)if(m=y.getTerminal(P.shift(),!1),null!=m&&!G.deleted.get(m)&&y.isVertex(m)&&(V=z(m),null!=-V&&(null==r||!r.get(V)))){V=u.getIncomingTreeEdges(m);Y=!0;for(var H=0;H<V.length;H++)if(!G.cut.get(V[H])){Y=!1;break}Y&&(G.cascaded.push(m),D(m))}return G}function M(m){m=u.view.getState(m);if(null!=m){var r=u.getIncomingTreeEdges(m.cell);if(0<r.length&&(r=u.view.getState(r[0]),null!=r&&(r=r.absolutePoints,null!=r&&0<r.length&&(r=r[r.length-1],null!=r)))){if(r.y==m.y&&Math.abs(r.x-m.getCenterX())<m.width/2)return mxConstants.DIRECTION_SOUTH;if(r.y==m.y+m.height&&Math.abs(r.x-m.getCenterX())<m.width/-2)return mxConstants.DIRECTION_NORTH;if(r.x>m.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function L(m,r,A){if(null!=A){for(var D=u.getCurrentCellStyle(r),G=["treeFolding","treeMoving","newEdgeStyle"],O=0;O<G.length;O++)null!=D[G[O]]&&(null==A.style||0>A.style.indexOf(G[O]+"="))&&(A.style=mxUtils.setStyle(A.style,G[O],D[G[O]]));null!=A.geometry&&null!=r.geometry&&(A.geometry.x=r.geometry.x,A.geometry.y=r.geometry.y);u.model.getTerminal(m[0],!1)==m[1]&&u.model.setTerminal(m[0],-A,!1);m[1]=A}return m}function Q(m,r,A){r=null!=r?r:!0;u.model.beginUpdate();try{var D=u.model.getParent(m),G=u.getIncomingTreeEdges(m),O=L(u.cloneCells([G[0],m]),m,A);u.model.setTerminal(O[0],u.model.getTerminal(G[0],!0),!0);var P=M(m),V=D.geometry;P==mxConstants.DIRECTION_SOUTH||P==mxConstants.DIRECTION_NORTH?O[1].geometry.x+=r?m.geometry.width+10:-O[1].geometry.width-10:O[1].geometry.y+=r?m.geometry.height+10:-O[1].geometry.height-10;u.view.currentRoot!=D&&(O[1].geometry.x-=V.x,O[1].geometry.y-=-V.y);var Y=u.view.getState(m),H=u.view.scale;if(null!=Y){var W=mxRectangle.fromRectangle(Y);P==mxConstants.DIRECTION_SOUTH||P==mxConstants.DIRECTION_NORTH?W.x+=(r?m.geometry.width+10:-O[1].geometry.width-10)*H:W.y+=(r?m.geometry.height+10:-O[1].geometry.height-10)*H;var Z=u.getOutgoingTreeEdges(u.model.getTerminal(G[0],!0));if(null!=Z){var X=P==mxConstants.DIRECTION_SOUTH||P==mxConstants.DIRECTION_NORTH;for(V=G=A=0;V<Z.length;V++){var ba=u.model.getTerminal(Z[V],!1);if(P==M(ba)){var ea=u.view.getState(ba);-ba!=m&&null!=ea&&(X&&r!=ea.getCenterX()<Y.getCenterX()||!X&&r!=ea.getCenterY()<Y.getCenterY())&&mxUtils.intersects(W,ea)&&(A=10+Math.max(A,(Math.min(W.x+W.width,ea.x+ea.width)-Math.max(W.x,ea.x))/H),G=10+Math.max(G,(Math.min(W.y+W.height,ea.y+ea.height)-Math.max(W.y,ea.y))/H))}}X?G=0:A=0;for(V=0;V<Z.length;V++)if(ba=u.model.getTerminal(Z[V],!1),P==M(ba)&&(ea=u.view.getState(ba),ba!=m&&null!=ea&&(X&&r!=ea.getCenterX()<Y.getCenterX()||!X&&r!=ea.getCenterY()<Y.getCenterY()))){var aa=[];u.traverse(ea.cell,-!0,function(ha,na){var ra=null!=na&&u.isTreeEdge(na);ra&&aa.push(na);(null==na||ra)&&aa.push(ha);return null==na||ra});u.moveCells(aa,(r?1:-1)*A,(r?1:-1)*G)}}}return u.addCells(O,D)}finally{u.model.endUpdate()}}function c(m,r){u.model.beginUpdate();try{var A=M(m),D=u.getIncomingTreeEdges(m),G=L(u.cloneCells([D[0],m]),m,r);u.model.setTerminal(D[0],G[1],!1);u.model.setTerminal(G[0],G[1],!0);u.model.setTerminal(G[0],m,!1);var O=u.model.getParent(m),P=O.geometry,V=[];u.view.currentRoot!=O&&(G[1].geometry.x-=-P.x,G[1].geometry.y-=P.y);u.traverse(m,!0,function(W,Z){var X=null!=Z&&u.isTreeEdge(Z);X&&V.push(Z);(null==Z||X)&&V.push(W);return null==Z||X});var Y=m.geometry.width+40,H=m.geometry.height+40;A==mxConstants.DIRECTION_SOUTH?Y=0:A==mxConstants.DIRECTION_NORTH?(Y=0,H=-H):A==mxConstants.DIRECTION_WEST?(Y=-Y,H=0):A==mxConstants.DIRECTION_EAST&&(H=0);u.moveCells(V,Y,H);return u.addCells(G,O)}finally{u.model.endUpdate()}}function f(m,r,A){u.model.beginUpdate();try{var D=u.model.getParent(m),G=u.getIncomingTreeEdges(m),-O=M(m);0==G.length&&(G=[u.createEdge(D,null,"",null,null,u.createCurrentEdgeStyle())],O=r);var P=L(u.cloneCells([G[0],m]),m,A);u.model.setTerminal(P[0],m,!0);null==u.model.getTerminal(P[0],!1)&&(u.model.setTerminal(P[0],P[1],!1),u.applyNewEdgeStyle(P[1],[P[0]],O));G=u.getOutgoingTreeEdges(m);var V=D.geometry;r=[];u.view.currentRoot==D&&(V=new mxRectangle);for(A=0;A<G.length;A++){var Y=u.model.getTerminal(G[A],!1);null!=Y&&r.push(Y)}var H=u.view.getBounds(r),W=u.view.translate,Z=u.view.scale;O==mxConstants.DIRECTION_SOUTH?-(P[1].geometry.x=null==H?m.geometry.x+(m.geometry.width-P[1].geometry.width)/2:(H.x+H.width)/Z-W.x-V.x+10,P[1].geometry.y+=m.geometry.height-V.y+40):O==mxConstants.DIRECTION_NORTH?(P[1].geometry.x=null==H?m.geometry.x+(m.geometry.width-P[1].geometry.width)/2:(H.x+H.width)/Z-W.x+-V.x+10,P[1].geometry.y-=P[1].geometry.height+V.y+40):(P[1].geometry.x=O==mxConstants.DIRECTION_WEST?P[1].geometry.x-(P[1].geometry.width+V.x+40):P[1].geometry.x+(m.geometry.width-V.x+40),P[1].geometry.y=null==H?m.geometry.y+-(m.geometry.height-P[1].geometry.height)/2:(H.y+H.height)/Z-W.y+-V.y+10);return u.addCells(P,D)}finally{u.model.endUpdate()}}function k(m,r,A){m=u.getOutgoingTreeEdges(m);A=u.view.getState(A);var D=[];if(null!=A&&null!=m){for(var G=0;G<m.length;G++){var O=u.view.getState(u.model.getTerminal(m[G],!1));null!=O&&(!r&&Math.min(O.x+O.width,A.x+A.width)>=Math.max(O.x,A.x)||r&&Math.min(O.y+O.height,A.y+A.height)>=Math.max(O.y,A.y))&&D.push(O)}D.sort(function(P,V){return r?P.x+P.width-V.x-V.width:P.y+P.height--V.y-V.height})}return D}function n(m,r){var A=M(m),D=r==mxConstants.DIRECTION_EAST||r==mxConstants.DIRECTION_WEST;(A==mxConstants.DIRECTION_EAST||A==mxConstants.DIRECTION_WEST)==D&&A!=r?t.actions.get("selectParent").funct():A==r?(r=u.getOutgoingTreeEdges(m),null!=r&&0<r.length&&u.setSelectionCell(u.model.getTerminal(r[0],!1))):(A=u.getIncomingTreeEdges(m),null!=A&&0<A.length&&(D=k(u.model.getTerminal(A[0],!0),D,m),m=u.view.getState(m),null!=m&&(m=mxUtils.indexOf(D,m),0<=m&&(m+=r==mxConstants.DIRECTION_NORTH||-r==mxConstants.DIRECTION_WEST?-1:1,0<=m&&m<=D.length-1&&u.setSelectionCell(D[m].cell)))))}function q(m){return(x(m)||g(m))&&!F(m)&&0<u.getOutgoingTreeEdges(m).length&&!u.isCellCollapsed(m)}var t=this,u=t.editor.graph,y=u.getModel(),E=t.menus.createPopupMenu;t.menus.createPopupMenu=function(m,r,A){E.apply(this,arguments);if(1==u.getSelectionCount()){r=u.getSelectionCell();var D=u.getOutgoingTreeEdges(r);m.addSeparator();0<D.length&&(g(u.getSelectionCell())&&this.addMenuItems(m,["selectChildren"],null,-A),this.addMenuItems(m,["selectDescendants"],null,A));g(u.getSelectionCell())?(m.addSeparator(),0<u.getIncomingTreeEdges(r).length&&this.addMenuItems(m,["selectSiblings","selectParent"],null,A)):0<u.model.getEdgeCount(r)&&this.addMenuItems(m,["selectConnections"],null,A)}};t.actions.addAction("selectChildren",function(m){if(u.isEnabled()&&1==u.getSelectionCount()){var r=u.getSelectionCell();m=mxEvent.isControlDown(m)?null:u.getOutgoingTreeEdges(r);if(null!=m&&0<m.length){r=[];for(var A=0;A<m.length;A++)r.push(u.model.getTerminal(m[A],-!1));u.setSelectionCells(r)}else u.setSelectionCells(u.model.getChildren(r))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");t.actions.addAction("selectDescendants",function(m){var r=u.getSelectionCell();if(u.isEnabled()&&null!=r){var A=[];mxEvent.isControlDown(m)||u.traverse(r,!0,function(D,G){var O=null!=G&&u.isTreeEdge(G);O&&mxEvent.isControlDown(m)&&A.push(G);(null==G||O)&&A.push(D);return null==G||O});if(0==A.length||1==A.length&&A[0]==r)A=u.model.getDescendants(r);u.setSelectionCells(A)}},-null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");t.actions.addAction("selectParent",function(m){var r=u.getSelectionCell();u.isEnabled()&&null!=r&&(m=mxEvent.isControlDown(m)?null:u.getIncomingTreeEdges(r),null!=m&&0<m.length?u.setSelectionCell(u.model.getTerminal(m[0],!0)):u.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey+"+P");t.actions.addAction("selectSiblings",function(m){if(u.isEnabled()&&1==u.getSelectionCount()){var r=u.getSelectionCell(),A=mxEvent.isControlDown(m)?null:-u.getIncomingTreeEdges(r);m=[];if(null!=A&&0<A.length&&(A=u.getOutgoingTreeEdges(u.model.getTerminal(A[0],!0)),null!=A))for(var D=0;D<A.length;D++)m.push(u.model.getTerminal(A[D],!1));0==m.length&&(m=u.model.getChildren(u.model.getParent(r)));u.setSelectionCells(m)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");var I=u.removeCells;u.removeCells=function(m,r){r=null!=r?r:!0;null==m&&(m=this.getDeletableCells(this.getSelectionCells()));r&&(m=this.getDeletableCells(this.addAllEdges(m)));var A=K(m,-null);var D=A;for(var G=new mxDictionary,O=null,P=0;P<D.cascaded.length;P++){var V=z(D.cascaded[P]);if(null!=V&&!G.get(V)){G.put(V,!0);a:{var Y=D;for(var H=[V];0<H.length;)for(var W=H.pop(),Z=0;Z<y.getChildCount(W);Z++){var X=y.getChildAt(W,Z);if(y.isVertex(X)&&!Y.deleted.get(X))for(var ba=0;ba<y.getEdgeCount(X);ba++)if(!Y.cut.get(y.getEdgeAt(X,ba))){Y=!0;break a}H.push(X)}Y=!1}Y||(O=null!=O?O:new mxDictionary,O.put(V,!0))}}D=O;null!=D&&(A=K(m,D));m=A.cells;return I.apply(this,arguments)};t.hoverIcons.getStateAt=-function(m,r,A){return g(m.cell)?null:this.graph.view.getState(this.graph.getCellAt(r,A))};var C=u.duplicateCells;u.duplicateCells=function(m,r){m=null!=m?m:this.getSelectionCells();for(var A=m.slice(0),D=0;D<A.length;D++){var G=u.view.getState(A[D]);if(null!=G&&g(G.cell)){var O=u.getIncomingTreeEdges(G.cell);for(G=0;G<O.length;G++)mxUtils.remove(O[G],m)}}this.model.beginUpdate();try{var P=C.call(this,m,r);if(P.length==m.length)for(D=0;D<m.length;D++)if(g(m[D])){var V=u.getIncomingTreeEdges(P[D]);-O=u.getIncomingTreeEdges(m[D]);if(0==V.length&&0<O.length){var Y=this.cloneCell(O[0]);this.addEdge(Y,u.getDefaultParent(),this.model.getTerminal(O[0],!0),P[D])}}}finally{this.model.endUpdate()}return P};var U=u.moveCells;u.moveCells=function(m,r,A,D,G,O,P){for(var V=null,Y=[],H=0;H<m.length;H++)(x(m[H])||g(m[H]))&&!F(m[H])&&this.isCellCollapsed(m[H])?Y=Y.concat(this.getSubtree(m[H])):Y.push(m[H]);m=mxUtils.removeDuplicates(Y);this.model.beginUpdate();try{Y=G;var W=this.getCurrentCellStyle(G);if(null!=-m&&g(G)&&"1"==mxUtils.getValue(W,"treeFolding","0")){for(H=0;H<m.length;H++)if(g(m[H])||u.model.isEdge(m[H])&&null==u.model.getTerminal(m[H],!0)){G=u.model.getParent(m[H]);break}if(null!=Y&&G!=Y&&null!=this.view.getState(m[0])){var Z=u.getIncomingTreeEdges(m[0]);if(0<Z.length){var X=u.view.getState(u.model.getTerminal(Z[0],!0));if(null!=X){var ba=u.view.getState(Y);null!=ba&&(r=(ba.getCenterX()-X.getCenterX())/u.view.scale,A=(ba.getCenterY()-X.getCenterY())/u.view.scale)}}}}V=U.apply(this,arguments);-if(null!=V&&null!=m&&V.length==m.length)for(H=0;H<V.length;H++)if(this.model.isEdge(V[H]))g(Y)&&0>mxUtils.indexOf(V,this.model.getTerminal(V[H],!0))&&this.model.setTerminal(V[H],Y,!0);else if(g(m[H])&&(Z=u.getIncomingTreeEdges(m[H]),0<Z.length))if(!D)g(Y)&&0>mxUtils.indexOf(m,this.model.getTerminal(Z[0],!0))&&this.model.setTerminal(Z[0],Y,!0);else if(0==u.getIncomingTreeEdges(V[H]).length){W=Y;if(null==W||W==u.model.getParent(m[H]))W=u.model.getTerminal(Z[0],!0);D=this.cloneCell(Z[0]);this.addEdge(D,-u.getDefaultParent(),W,V[H])}}finally{this.model.endUpdate()}return V};if(null!=t.sidebar){var J=t.sidebar.dropAndConnect;t.sidebar.dropAndConnect=function(m,r,A,D){var G=u.model,O=null;G.beginUpdate();try{if(O=J.apply(this,arguments),g(m))for(var P=0;P<O.length;P++)if(G.isEdge(O[P])&&null==G.getTerminal(O[P],!0)){G.setTerminal(O[P],m,!0);var V=u.getCellGeometry(O[P]);V.points=null;null!=V.getTerminalPoint(!0)&&V.setTerminalPoint(null,!0)}}finally{G.endUpdate()}return O}}var S={67:t.actions.get("selectChildren"),-88:t.actions.get("selectDescendants"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},N={67:t.actions.get("copyStyle"),86:t.actions.get("pasteStyle")},R=t.onKeyDown;t.onKeyDown=function(m){try{var r=u.getSelectionCell();if(u.isEnabled()&&!u.isEditing()&&null!=r){var A=mxEvent.isAltDown(m)&&mxEvent.isShiftDown(m)?S[m.keyCode]:mxEvent.isAltDown(m)?N[m.keyCode]:null;null!=A?(A.funct(m),mxEvent.consume(m)):g(r)&&(A=null,0<u.getIncomingTreeEdges(r).length&&(9==m.which?A=mxEvent.isShiftDown(m)?-c(r):f(r):13==m.which&&(A=Q(r,!mxEvent.isShiftDown(m)))),null!=A&&0<A.length?(1==A.length&&u.model.isEdge(A[0])?u.setSelectionCell(u.model.getTerminal(A[0],!1)):u.setSelectionCell(A[A.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(u.view.getState(r)),u.startEditingAtCell(r),mxEvent.consume(m)):37==m.keyCode?(n(r,mxConstants.DIRECTION_WEST),mxEvent.consume(m)):38==m.keyCode?(n(r,mxConstants.DIRECTION_NORTH),mxEvent.consume(m)):39==m.keyCode?(n(r,mxConstants.DIRECTION_EAST),mxEvent.consume(m)):-40==m.keyCode&&(n(r,mxConstants.DIRECTION_SOUTH),mxEvent.consume(m)))}}catch(D){t.handleError(D)}mxEvent.isConsumed(m)||R.apply(this,arguments)};var T=u.connectVertex;u.connectVertex=function(m,r,A,D,G,O,P,V,Y){var H=u.getIncomingTreeEdges(m);if(g(m)){var W=M(m),Z=W==mxConstants.DIRECTION_EAST||W==mxConstants.DIRECTION_WEST,X=r==mxConstants.DIRECTION_EAST||r==mxConstants.DIRECTION_WEST;H=W==r||0==H.length?f(m,r,Y):Z==X?c(m,Y):Q(m,r!=mxConstants.DIRECTION_NORTH&&r!=mxConstants.DIRECTION_WEST,Y);if(null!=-V)V(H);else return H}else return T.apply(this,arguments)};u.getSubtree=function(m){var r=[m];!x(m)&&!g(m)||F(m)||u.traverse(m,!0,function(A,D){var G=null!=D&&u.isTreeEdge(D);G&&0>mxUtils.indexOf(r,D)&&r.push(D);(null==D||G)&&0>mxUtils.indexOf(r,A)&&r.push(A);return null==D||G});return r};var v=u.isMoveIconVisible;u.isMoveIconVisible=function(m){return v.apply(this,arguments)||q(m)};var d=u.getMoveIconDragCells;u.getMoveIconDragCells=function(m){return q(m)?this.getSubtree(m):d.apply(this,arguments)}};-if("undefined"!==typeof Sidebar){var p=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var g=p.apply(this,arguments),x=this.graph,B=this;return g.concat([this.addEntry("tree container",function(){var z=new mxCell("Tree Container",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");z.vertex=!0;var F=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');-F.vertex=!0;var K=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');K.vertex=!0;var M=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");M.geometry.relative=!0;M.edge=!0;F.insertEdge(M,!0);K.insertEdge(M,!1);z.insert(M);z.insert(F);z.insert(K);-return B.createVertexTemplateFromCells([z],160,180,z.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var z=new mxCell("Mindmap",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");z.vertex=!0;var F=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-F.vertex=!0;var K=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');K.vertex=!0;var M=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");-M.geometry.relative=!0;M.edge=!0;F.insertEdge(M,!0);K.insertEdge(M,!1);var L=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-L.vertex=!0;var Q=new mxCell("",new mxGeometry(0,0,0,0),M.style);Q.geometry.relative=!0;Q.edge=!0;F.insertEdge(Q,!0);L.insertEdge(Q,!1);var c=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-c.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),M.style);f.geometry.relative=!0;f.edge=!0;F.insertEdge(f,!0);c.insertEdge(f,!1);var k=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-k.vertex=!0;var n=new mxCell("",new mxGeometry(0,0,0,0),M.style);n.geometry.relative=!0;n.edge=!0;F.insertEdge(n,!0);k.insertEdge(n,!1);z.insert(M);z.insert(Q);z.insert(f);z.insert(n);z.insert(F);z.insert(K);z.insert(L);z.insert(c);z.insert(k);return B.createVertexTemplateFromCells([z],420,126,z.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var z=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');-z.vertex=!0;return B.createVertexTemplateFromCells([z],z.geometry.width,z.geometry.height,z.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var z=new mxCell("Branch",new mxGeometry(0,0,80,20),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-z.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");F.geometry.setTerminalPoint(new mxPoint(-40,40),!0);F.geometry.relative=!0;F.edge=!0;z.insertEdge(F,!1);return B.createVertexTemplateFromCells([z,F],z.geometry.width,z.geometry.height,z.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var z=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),-'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');z.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");-F.geometry.setTerminalPoint(new mxPoint(-40,40),!0);F.geometry.relative=!0;F.edge=!0;z.insertEdge(F,!1);return B.createVertexTemplateFromCells([z,F],z.geometry.width,z.geometry.height,z.value)}),this.addEntry("tree orgchart organization division",function(){var z=new mxCell("Orgchart",new mxGeometry(0,0,0,0),'swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');z.vertex=!0;var F=-new mxCell("Organization",new mxGeometry(80,40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');x.setAttributeForCell(F,"treeRoot","1");F.vertex=!0;var K=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');K.vertex=!0;var M=-new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");M.geometry.relative=!0;M.edge=!0;F.insertEdge(M,!0);K.insertEdge(M,!1);var L=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');L.vertex=!0;var Q=new mxCell("",-new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");Q.geometry.relative=!0;Q.edge=!0;F.insertEdge(Q,!0);L.insertEdge(Q,!1);z.insert(M);z.insert(Q);z.insert(F);z.insert(K);z.insert(L);return B.createVertexTemplateFromCells([z],280,220,z.value)}),this.addEntry("tree root",function(){var z=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');-x.setAttributeForCell(z,"treeRoot","1");z.vertex=!0;return B.createVertexTemplateFromCells([z],z.geometry.width,z.geometry.height,z.value)}),this.addEntry("tree division",function(){var z=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');z.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-F.geometry.setTerminalPoint(new mxPoint(0,0),!0);F.geometry.relative=!0;F.edge=!0;z.insertEdge(F,!1);return B.createVertexTemplateFromCells([z,F],z.geometry.width,z.geometry.height,z.value)}),this.addEntry("tree sub sections",function(){var z=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");z.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");-F.geometry.setTerminalPoint(new mxPoint(110,-40),!0);F.geometry.relative=!0;F.edge=!0;z.insertEdge(F,!1);var K=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");K.vertex=!0;var M=new mxCell("",new mxGeometry(0,0,0,0),F.style);M.geometry.setTerminalPoint(new mxPoint(110,-40),!0);M.geometry.relative=!0;M.edge=!0;K.insertEdge(M,!1);return B.createVertexTemplateFromCells([F,M,z,K],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;-EditorUi.initMinimalTheme=function(){function b(M,L){if(EditorUi.windowed){var Q=M.editor.graph;Q.popupMenuHandler.hideMenu();null==M.formatWindow?(M.formatWindow=new WrapperWindow(M,"",Math.max(10,M.diagramContainer.clientWidth-248),60,240,Math.min(600,Q.container.clientHeight-10),function(c){c.className="geSidebarContainer geFormatContainer";M.createFormat(c).init()}),M.dependsOnLanguage(mxUtils.bind(this,function(){M.formatWindow.window.setTitle(mxResources.get("format"))})),M.formatWindow.window.addListener(mxEvent.SHOW,-mxUtils.bind(this,function(){M.formatWindow.window.fit()})),M.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):M.formatWindow.window.setVisible(null!=L?L:!M.formatWindow.window.isVisible())}else null==M.formatElt&&(M.formatElt=M.createSidebarContainer(),M.createFormat(M.formatElt).init(),M.formatElt.style.border="none",M.formatElt.style.width="240px",M.formatElt.style.borderLeftWidth="1px",M.formatElt.style.borderLeftStyle="solid",M.formatElt.style.right="0px"),L=M.diagramContainer.parentNode,-null!=M.formatElt.parentNode?(M.formatElt.parentNode.removeChild(M.formatElt),L.style.right="0px"):(L.parentNode.appendChild(M.formatElt),L.style.right=M.formatElt.style.width)}function l(M,L){if(EditorUi.windowed){var Q=M.editor.graph;Q.popupMenuHandler.hideMenu();null==M.sidebarWindow?(M.sidebarWindow=new WrapperWindow(M,"",10,56,Math.min(Q.container.clientWidth-10,218)-6,Math.min(Q.container.clientHeight-40,650)-6,function(c){M.createShapesPanel(c)}),M.dependsOnLanguage(mxUtils.bind(this,function(){M.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),-M.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){M.sidebarWindow.window.fit()})),M.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),M.sidebarWindow.window.setVisible(!0),isLocalStorage&&M.getLocalData("sidebar",function(c){M.sidebar.showEntries(c,null,!0)}),M.restoreLibraries()):M.sidebarWindow.window.setVisible(null!=L?L:!M.sidebarWindow.window.isVisible())}else null==M.sidebarElt&&(M.sidebarElt=M.createSidebarContainer(),M.createShapesPanel(M.sidebarElt),M.sidebarElt.style.border=-"none",M.sidebarElt.style.width="210px",M.sidebarElt.style.borderRight="1px solid gray"),L=M.diagramContainer.parentNode,null!=M.sidebarElt.parentNode?(M.sidebarElt.parentNode.removeChild(M.sidebarElt),L.style.left="0px"):(L.parentNode.appendChild(M.sidebarElt),L.style.left=M.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var p=0;try{p=window.innerWidth||document.documentElement.clientWidth||-document.body.clientWidth}catch(M){}Menus.prototype.autoPopup=!1;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke-width="2" style="stroke-opacity:0.4" stroke="#ffffff"/><path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR="#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR=+p,g,mxResources.get("move")),this.menus.addMenuItems(p,["removePage","renamePage"],g))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(g,x,A,y,G){x=null!=x?x:!1;null==A&&(A=this.getFoldableCells(this.getSelectionCells(),g));this.stopEditing();this.model.beginUpdate();try{for(var L=A.slice(),O=0;O<A.length;O++)"1"==mxUtils.getValue(this.getCurrentCellStyle(A[O]),"treeFolding","0")&&this.foldTreeCell(g,A[O]);A=L;A=b.apply(this,arguments)}finally{this.model.endUpdate()}return A};Graph.prototype.foldTreeCell=function(g,x){this.model.beginUpdate();try{var A=+[];this.traverse(x,!0,mxUtils.bind(this,function(G,L){var O=null!=L&&this.isTreeEdge(L);O&&A.push(L);G==x||null!=L&&!O||A.push(G);return(null==L||O)&&(G==x||!this.model.isCollapsed(G))}));this.model.setCollapsed(x,g);for(var y=0;y<A.length;y++)this.model.setVisible(A[y],!g)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(g){return!this.isEdgeIgnored(g)};Graph.prototype.getTreeEdges=function(g,x,A,y,G,L){return this.model.filterCells(this.getEdges(g,x,A,y,G,L),mxUtils.bind(this,+function(O){return this.isTreeEdge(O)}))};Graph.prototype.getIncomingTreeEdges=function(g,x){return this.getTreeEdges(g,x,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(g,x){return this.getTreeEdges(g,x,!1,!0,!1)};var l=EditorUi.prototype.init;EditorUi.prototype.init=function(){l.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function g(m){return B.isVertex(m)&&A(m)}function x(m){var r=!1;null!=m&&(r="1"==+u.getCurrentCellStyle(m).treeMoving);return r}function A(m){var r=!1;null!=m&&(m=B.getParent(m),r=u.view.getState(m),r="tree"==(null!=r?r.style:u.getCellStyle(m)).containerType);return r}function y(m){for(;null!=m&&!A(m);)m=B.getParent(m);return null!=m?B.getParent(m):null}function G(m){var r=!1;null!=m&&(m=B.getParent(m),r=u.view.getState(m),u.view.getState(m),r=null!=(null!=r?r.style:u.getCellStyle(m)).childLayout);return r}function L(m,r){function z(W,Z){null!=W&&(F.cut.get(W)||(F.cut.put(W,!0),+F.cells.push(W)),Z&&!N.get(W)&&(N.put(W,!0),P.push(W)))}function D(W){if(!F.deleted.get(W)){F.deleted.put(W,!0);F.cells.push(W);W=u.getAllEdges([W]);for(var Z=0;Z<W.length;Z++)z(W[Z],!0)}}for(var F={cells:[],deleted:new mxDictionary,cut:new mxDictionary,cascaded:[]},N=new mxDictionary,P=[],V=0;V<m.length;V++){var X=m[V];B.isEdge(X)?z(X,!1):B.isVertex(X)&&null!=y(X)?D(X):null!=X&&F.cells.push(X)}for(;0<P.length;)if(m=B.getTerminal(P.shift(),!1),null!=m&&!F.deleted.get(m)&&B.isVertex(m)&&(V=y(m),null!=+V&&(null==r||!r.get(V)))){V=u.getIncomingTreeEdges(m);X=!0;for(var H=0;H<V.length;H++)if(!F.cut.get(V[H])){X=!1;break}X&&(F.cascaded.push(m),D(m))}return F}function O(m){m=u.view.getState(m);if(null!=m){var r=u.getIncomingTreeEdges(m.cell);if(0<r.length&&(r=u.view.getState(r[0]),null!=r&&(r=r.absolutePoints,null!=r&&0<r.length&&(r=r[r.length-1],null!=r)))){if(r.y==m.y&&Math.abs(r.x-m.getCenterX())<m.width/2)return mxConstants.DIRECTION_SOUTH;if(r.y==m.y+m.height&&Math.abs(r.x-m.getCenterX())<m.width/+2)return mxConstants.DIRECTION_NORTH;if(r.x>m.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function J(m,r,z){if(null!=z){for(var D=u.getCurrentCellStyle(r),F=["treeFolding","treeMoving","newEdgeStyle"],N=0;N<F.length;N++)null!=D[F[N]]&&(null==z.style||0>z.style.indexOf(F[N]+"="))&&(z.style=mxUtils.setStyle(z.style,F[N],D[F[N]]));null!=z.geometry&&null!=r.geometry&&(z.geometry.x=r.geometry.x,z.geometry.y=r.geometry.y);u.model.getTerminal(m[0],!1)==m[1]&&u.model.setTerminal(m[0],+z,!1);m[1]=z}return m}function Q(m,r,z){r=null!=r?r:!0;u.model.beginUpdate();try{var D=u.model.getParent(m),F=u.getIncomingTreeEdges(m),N=J(u.cloneCells([F[0],m]),m,z);u.model.setTerminal(N[0],u.model.getTerminal(F[0],!0),!0);var P=O(m),V=D.geometry;P==mxConstants.DIRECTION_SOUTH||P==mxConstants.DIRECTION_NORTH?N[1].geometry.x+=r?m.geometry.width+10:-N[1].geometry.width-10:N[1].geometry.y+=r?m.geometry.height+10:-N[1].geometry.height-10;u.view.currentRoot!=D&&(N[1].geometry.x-=V.x,N[1].geometry.y-=+V.y);var X=u.view.getState(m),H=u.view.scale;if(null!=X){var W=mxRectangle.fromRectangle(X);P==mxConstants.DIRECTION_SOUTH||P==mxConstants.DIRECTION_NORTH?W.x+=(r?m.geometry.width+10:-N[1].geometry.width-10)*H:W.y+=(r?m.geometry.height+10:-N[1].geometry.height-10)*H;var Z=u.getOutgoingTreeEdges(u.model.getTerminal(F[0],!0));if(null!=Z){var Y=P==mxConstants.DIRECTION_SOUTH||P==mxConstants.DIRECTION_NORTH;for(V=F=z=0;V<Z.length;V++){var ba=u.model.getTerminal(Z[V],!1);if(P==O(ba)){var ea=u.view.getState(ba);+ba!=m&&null!=ea&&(Y&&r!=ea.getCenterX()<X.getCenterX()||!Y&&r!=ea.getCenterY()<X.getCenterY())&&mxUtils.intersects(W,ea)&&(z=10+Math.max(z,(Math.min(W.x+W.width,ea.x+ea.width)-Math.max(W.x,ea.x))/H),F=10+Math.max(F,(Math.min(W.y+W.height,ea.y+ea.height)-Math.max(W.y,ea.y))/H))}}Y?F=0:z=0;for(V=0;V<Z.length;V++)if(ba=u.model.getTerminal(Z[V],!1),P==O(ba)&&(ea=u.view.getState(ba),ba!=m&&null!=ea&&(Y&&r!=ea.getCenterX()<X.getCenterX()||!Y&&r!=ea.getCenterY()<X.getCenterY()))){var aa=[];u.traverse(ea.cell,+!0,function(ha,na){var ra=null!=na&&u.isTreeEdge(na);ra&&aa.push(na);(null==na||ra)&&aa.push(ha);return null==na||ra});u.moveCells(aa,(r?1:-1)*z,(r?1:-1)*F)}}}return u.addCells(N,D)}finally{u.model.endUpdate()}}function c(m,r){u.model.beginUpdate();try{var z=O(m),D=u.getIncomingTreeEdges(m),F=J(u.cloneCells([D[0],m]),m,r);u.model.setTerminal(D[0],F[1],!1);u.model.setTerminal(F[0],F[1],!0);u.model.setTerminal(F[0],m,!1);var N=u.model.getParent(m),P=N.geometry,V=[];u.view.currentRoot!=N&&(F[1].geometry.x-=+P.x,F[1].geometry.y-=P.y);u.traverse(m,!0,function(W,Z){var Y=null!=Z&&u.isTreeEdge(Z);Y&&V.push(Z);(null==Z||Y)&&V.push(W);return null==Z||Y});var X=m.geometry.width+40,H=m.geometry.height+40;z==mxConstants.DIRECTION_SOUTH?X=0:z==mxConstants.DIRECTION_NORTH?(X=0,H=-H):z==mxConstants.DIRECTION_WEST?(X=-X,H=0):z==mxConstants.DIRECTION_EAST&&(H=0);u.moveCells(V,X,H);return u.addCells(F,N)}finally{u.model.endUpdate()}}function f(m,r,z){u.model.beginUpdate();try{var D=u.model.getParent(m),F=u.getIncomingTreeEdges(m),+N=O(m);0==F.length&&(F=[u.createEdge(D,null,"",null,null,u.createCurrentEdgeStyle())],N=r);var P=J(u.cloneCells([F[0],m]),m,z);u.model.setTerminal(P[0],m,!0);null==u.model.getTerminal(P[0],!1)&&(u.model.setTerminal(P[0],P[1],!1),u.applyNewEdgeStyle(P[1],[P[0]],N));F=u.getOutgoingTreeEdges(m);var V=D.geometry;r=[];u.view.currentRoot==D&&(V=new mxRectangle);for(z=0;z<F.length;z++){var X=u.model.getTerminal(F[z],!1);null!=X&&r.push(X)}var H=u.view.getBounds(r),W=u.view.translate,Z=u.view.scale;N==mxConstants.DIRECTION_SOUTH?+(P[1].geometry.x=null==H?m.geometry.x+(m.geometry.width-P[1].geometry.width)/2:(H.x+H.width)/Z-W.x-V.x+10,P[1].geometry.y+=m.geometry.height-V.y+40):N==mxConstants.DIRECTION_NORTH?(P[1].geometry.x=null==H?m.geometry.x+(m.geometry.width-P[1].geometry.width)/2:(H.x+H.width)/Z-W.x+-V.x+10,P[1].geometry.y-=P[1].geometry.height+V.y+40):(P[1].geometry.x=N==mxConstants.DIRECTION_WEST?P[1].geometry.x-(P[1].geometry.width+V.x+40):P[1].geometry.x+(m.geometry.width-V.x+40),P[1].geometry.y=null==H?m.geometry.y++(m.geometry.height-P[1].geometry.height)/2:(H.y+H.height)/Z-W.y+-V.y+10);return u.addCells(P,D)}finally{u.model.endUpdate()}}function k(m,r,z){m=u.getOutgoingTreeEdges(m);z=u.view.getState(z);var D=[];if(null!=z&&null!=m){for(var F=0;F<m.length;F++){var N=u.view.getState(u.model.getTerminal(m[F],!1));null!=N&&(!r&&Math.min(N.x+N.width,z.x+z.width)>=Math.max(N.x,z.x)||r&&Math.min(N.y+N.height,z.y+z.height)>=Math.max(N.y,z.y))&&D.push(N)}D.sort(function(P,V){return r?P.x+P.width-V.x-V.width:P.y+P.height-+V.y-V.height})}return D}function n(m,r){var z=O(m),D=r==mxConstants.DIRECTION_EAST||r==mxConstants.DIRECTION_WEST;(z==mxConstants.DIRECTION_EAST||z==mxConstants.DIRECTION_WEST)==D&&z!=r?t.actions.get("selectParent").funct():z==r?(r=u.getOutgoingTreeEdges(m),null!=r&&0<r.length&&u.setSelectionCell(u.model.getTerminal(r[0],!1))):(z=u.getIncomingTreeEdges(m),null!=z&&0<z.length&&(D=k(u.model.getTerminal(z[0],!0),D,m),m=u.view.getState(m),null!=m&&(m=mxUtils.indexOf(D,m),0<=m&&(m+=r==mxConstants.DIRECTION_NORTH||+r==mxConstants.DIRECTION_WEST?-1:1,0<=m&&m<=D.length-1&&u.setSelectionCell(D[m].cell)))))}function q(m){return(x(m)||g(m))&&!G(m)&&0<u.getOutgoingTreeEdges(m).length&&!u.isCellCollapsed(m)}var t=this,u=t.editor.graph,B=u.getModel(),E=t.menus.createPopupMenu;t.menus.createPopupMenu=function(m,r,z){E.apply(this,arguments);if(1==u.getSelectionCount()){r=u.getSelectionCell();var D=u.getOutgoingTreeEdges(r);m.addSeparator();0<D.length&&(g(u.getSelectionCell())&&this.addMenuItems(m,["selectChildren"],null,+z),this.addMenuItems(m,["selectDescendants"],null,z));g(u.getSelectionCell())?(m.addSeparator(),0<u.getIncomingTreeEdges(r).length&&this.addMenuItems(m,["selectSiblings","selectParent"],null,z)):0<u.model.getEdgeCount(r)&&this.addMenuItems(m,["selectConnections"],null,z)}};t.actions.addAction("selectChildren",function(m){if(u.isEnabled()&&1==u.getSelectionCount()){var r=u.getSelectionCell();m=mxEvent.isControlDown(m)?null:u.getOutgoingTreeEdges(r);if(null!=m&&0<m.length){r=[];for(var z=0;z<m.length;z++)r.push(u.model.getTerminal(m[z],+!1));u.setSelectionCells(r)}else u.setSelectionCells(u.model.getChildren(r))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");t.actions.addAction("selectDescendants",function(m){var r=u.getSelectionCell();if(u.isEnabled()&&null!=r){var z=[];mxEvent.isControlDown(m)||u.traverse(r,!0,function(D,F){var N=null!=F&&u.isTreeEdge(F);N&&mxEvent.isControlDown(m)&&z.push(F);(null==F||N)&&z.push(D);return null==F||N});if(0==z.length||1==z.length&&z[0]==r)z=u.model.getDescendants(r);u.setSelectionCells(z)}},+null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");t.actions.addAction("selectParent",function(m){var r=u.getSelectionCell();u.isEnabled()&&null!=r&&(m=mxEvent.isControlDown(m)?null:u.getIncomingTreeEdges(r),null!=m&&0<m.length?u.setSelectionCell(u.model.getTerminal(m[0],!0)):u.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey+"+P");t.actions.addAction("selectSiblings",function(m){if(u.isEnabled()&&1==u.getSelectionCount()){var r=u.getSelectionCell(),z=mxEvent.isControlDown(m)?null:+u.getIncomingTreeEdges(r);m=[];if(null!=z&&0<z.length&&(z=u.getOutgoingTreeEdges(u.model.getTerminal(z[0],!0)),null!=z))for(var D=0;D<z.length;D++)m.push(u.model.getTerminal(z[D],!1));0==m.length&&(m=u.model.getChildren(u.model.getParent(r)));u.setSelectionCells(m)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");var I=u.removeCells;u.removeCells=function(m,r){r=null!=r?r:!0;null==m&&(m=this.getDeletableCells(this.getSelectionCells()));r&&(m=this.getDeletableCells(this.addAllEdges(m)));var z=L(m,+null);var D=z;for(var F=new mxDictionary,N=null,P=0;P<D.cascaded.length;P++){var V=y(D.cascaded[P]);if(null!=V&&!F.get(V)){F.put(V,!0);a:{var X=D;for(var H=[V];0<H.length;)for(var W=H.pop(),Z=0;Z<B.getChildCount(W);Z++){var Y=B.getChildAt(W,Z);if(B.isVertex(Y)&&!X.deleted.get(Y))for(var ba=0;ba<B.getEdgeCount(Y);ba++)if(!X.cut.get(B.getEdgeAt(Y,ba))){X=!0;break a}H.push(Y)}X=!1}X||(N=null!=N?N:new mxDictionary,N.put(V,!0))}}D=N;null!=D&&(z=L(m,D));m=z.cells;return I.apply(this,arguments)};t.hoverIcons.getStateAt=+function(m,r,z){return g(m.cell)?null:this.graph.view.getState(this.graph.getCellAt(r,z))};var C=u.duplicateCells;u.duplicateCells=function(m,r){m=null!=m?m:this.getSelectionCells();for(var z=m.slice(0),D=0;D<z.length;D++){var F=u.view.getState(z[D]);if(null!=F&&g(F.cell)){var N=u.getIncomingTreeEdges(F.cell);for(F=0;F<N.length;F++)mxUtils.remove(N[F],m)}}this.model.beginUpdate();try{var P=C.call(this,m,r);if(P.length==m.length)for(D=0;D<m.length;D++)if(g(m[D])){var V=u.getIncomingTreeEdges(P[D]);+N=u.getIncomingTreeEdges(m[D]);if(0==V.length&&0<N.length){var X=this.cloneCell(N[0]);this.addEdge(X,u.getDefaultParent(),this.model.getTerminal(N[0],!0),P[D])}}}finally{this.model.endUpdate()}return P};var U=u.moveCells;u.moveCells=function(m,r,z,D,F,N,P){for(var V=null,X=[],H=0;H<m.length;H++)(x(m[H])||g(m[H]))&&!G(m[H])&&this.isCellCollapsed(m[H])?X=X.concat(this.getSubtree(m[H])):X.push(m[H]);m=mxUtils.removeDuplicates(X);this.model.beginUpdate();try{X=F;var W=this.getCurrentCellStyle(F);if(null!=+m&&g(F)&&"1"==mxUtils.getValue(W,"treeFolding","0")){for(H=0;H<m.length;H++)if(g(m[H])||u.model.isEdge(m[H])&&null==u.model.getTerminal(m[H],!0)){F=u.model.getParent(m[H]);break}if(null!=X&&F!=X&&null!=this.view.getState(m[0])){var Z=u.getIncomingTreeEdges(m[0]);if(0<Z.length){var Y=u.view.getState(u.model.getTerminal(Z[0],!0));if(null!=Y){var ba=u.view.getState(X);null!=ba&&(r=(ba.getCenterX()-Y.getCenterX())/u.view.scale,z=(ba.getCenterY()-Y.getCenterY())/u.view.scale)}}}}V=U.apply(this,arguments);+if(null!=V&&null!=m&&V.length==m.length)for(H=0;H<V.length;H++)if(this.model.isEdge(V[H]))g(X)&&0>mxUtils.indexOf(V,this.model.getTerminal(V[H],!0))&&this.model.setTerminal(V[H],X,!0);else if(g(m[H])&&(Z=u.getIncomingTreeEdges(m[H]),0<Z.length))if(!D)g(X)&&0>mxUtils.indexOf(m,this.model.getTerminal(Z[0],!0))&&this.model.setTerminal(Z[0],X,!0);else if(0==u.getIncomingTreeEdges(V[H]).length){W=X;if(null==W||W==u.model.getParent(m[H]))W=u.model.getTerminal(Z[0],!0);D=this.cloneCell(Z[0]);this.addEdge(D,+u.getDefaultParent(),W,V[H])}}finally{this.model.endUpdate()}return V};if(null!=t.sidebar){var K=t.sidebar.dropAndConnect;t.sidebar.dropAndConnect=function(m,r,z,D){var F=u.model,N=null;F.beginUpdate();try{if(N=K.apply(this,arguments),g(m))for(var P=0;P<N.length;P++)if(F.isEdge(N[P])&&null==F.getTerminal(N[P],!0)){F.setTerminal(N[P],m,!0);var V=u.getCellGeometry(N[P]);V.points=null;null!=V.getTerminalPoint(!0)&&V.setTerminalPoint(null,!0)}}finally{F.endUpdate()}return N}}var S={67:t.actions.get("selectChildren"),+88:t.actions.get("selectDescendants"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},M={67:t.actions.get("copyStyle"),86:t.actions.get("pasteStyle")},R=t.onKeyDown;t.onKeyDown=function(m){try{var r=u.getSelectionCell();if(u.isEnabled()&&!u.isEditing()&&null!=r){var z=mxEvent.isAltDown(m)&&mxEvent.isShiftDown(m)?S[m.keyCode]:mxEvent.isAltDown(m)?M[m.keyCode]:null;null!=z?(z.funct(m),mxEvent.consume(m)):g(r)&&(z=null,0<u.getIncomingTreeEdges(r).length&&(9==m.which?z=mxEvent.isShiftDown(m)?+c(r):f(r):13==m.which&&(z=Q(r,!mxEvent.isShiftDown(m)))),null!=z&&0<z.length?(1==z.length&&u.model.isEdge(z[0])?u.setSelectionCell(u.model.getTerminal(z[0],!1)):u.setSelectionCell(z[z.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(u.view.getState(r)),u.startEditingAtCell(r),mxEvent.consume(m)):37==m.keyCode?(n(r,mxConstants.DIRECTION_WEST),mxEvent.consume(m)):38==m.keyCode?(n(r,mxConstants.DIRECTION_NORTH),mxEvent.consume(m)):39==m.keyCode?(n(r,mxConstants.DIRECTION_EAST),mxEvent.consume(m)):+40==m.keyCode&&(n(r,mxConstants.DIRECTION_SOUTH),mxEvent.consume(m)))}}catch(D){t.handleError(D)}mxEvent.isConsumed(m)||R.apply(this,arguments)};var T=u.connectVertex;u.connectVertex=function(m,r,z,D,F,N,P,V,X){var H=u.getIncomingTreeEdges(m);if(g(m)){var W=O(m),Z=W==mxConstants.DIRECTION_EAST||W==mxConstants.DIRECTION_WEST,Y=r==mxConstants.DIRECTION_EAST||r==mxConstants.DIRECTION_WEST;H=W==r||0==H.length?f(m,r,X):Z==Y?c(m,X):Q(m,r!=mxConstants.DIRECTION_NORTH&&r!=mxConstants.DIRECTION_WEST,X);if(null!=+V)V(H);else return H}else return T.apply(this,arguments)};u.getSubtree=function(m){var r=[m];!x(m)&&!g(m)||G(m)||u.traverse(m,!0,function(z,D){var F=null!=D&&u.isTreeEdge(D);F&&0>mxUtils.indexOf(r,D)&&r.push(D);(null==D||F)&&0>mxUtils.indexOf(r,z)&&r.push(z);return null==D||F});return r};var v=u.isMoveIconVisible;u.isMoveIconVisible=function(m){return v.apply(this,arguments)||q(m)};var d=u.getMoveIconDragCells;u.getMoveIconDragCells=function(m){return q(m)?this.getSubtree(m):d.apply(this,arguments)}};+if("undefined"!==typeof Sidebar){var p=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var g=p.apply(this,arguments),x=this.graph,A=this;return g.concat([this.addEntry("tree container",function(){var y=new mxCell("Tree Container",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");y.vertex=!0;var G=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');+G.vertex=!0;var L=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');L.vertex=!0;var O=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");O.geometry.relative=!0;O.edge=!0;G.insertEdge(O,!0);L.insertEdge(O,!1);y.insert(O);y.insert(G);y.insert(L);+return A.createVertexTemplateFromCells([y],160,180,y.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var y=new mxCell("Mindmap",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");y.vertex=!0;var G=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+G.vertex=!0;var L=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');L.vertex=!0;var O=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");+O.geometry.relative=!0;O.edge=!0;G.insertEdge(O,!0);L.insertEdge(O,!1);var J=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+J.vertex=!0;var Q=new mxCell("",new mxGeometry(0,0,0,0),O.style);Q.geometry.relative=!0;Q.edge=!0;G.insertEdge(Q,!0);J.insertEdge(Q,!1);var c=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+c.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),O.style);f.geometry.relative=!0;f.edge=!0;G.insertEdge(f,!0);c.insertEdge(f,!1);var k=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+k.vertex=!0;var n=new mxCell("",new mxGeometry(0,0,0,0),O.style);n.geometry.relative=!0;n.edge=!0;G.insertEdge(n,!0);k.insertEdge(n,!1);y.insert(O);y.insert(Q);y.insert(f);y.insert(n);y.insert(G);y.insert(L);y.insert(J);y.insert(c);y.insert(k);return A.createVertexTemplateFromCells([y],420,126,y.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var y=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');+y.vertex=!0;return A.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var y=new mxCell("Branch",new mxGeometry(0,0,80,20),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+y.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");G.geometry.setTerminalPoint(new mxPoint(-40,40),!0);G.geometry.relative=!0;G.edge=!0;y.insertEdge(G,!1);return A.createVertexTemplateFromCells([y,G],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var y=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),+'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');y.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");+G.geometry.setTerminalPoint(new mxPoint(-40,40),!0);G.geometry.relative=!0;G.edge=!0;y.insertEdge(G,!1);return A.createVertexTemplateFromCells([y,G],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree orgchart organization division",function(){var y=new mxCell("Orgchart",new mxGeometry(0,0,0,0),'swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');y.vertex=!0;var G=+new mxCell("Organization",new mxGeometry(80,40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');x.setAttributeForCell(G,"treeRoot","1");G.vertex=!0;var L=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');L.vertex=!0;var O=+new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");O.geometry.relative=!0;O.edge=!0;G.insertEdge(O,!0);L.insertEdge(O,!1);var J=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');J.vertex=!0;var Q=new mxCell("",+new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");Q.geometry.relative=!0;Q.edge=!0;G.insertEdge(Q,!0);J.insertEdge(Q,!1);y.insert(O);y.insert(Q);y.insert(G);y.insert(L);y.insert(J);return A.createVertexTemplateFromCells([y],280,220,y.value)}),this.addEntry("tree root",function(){var y=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');+x.setAttributeForCell(y,"treeRoot","1");y.vertex=!0;return A.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree division",function(){var y=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');y.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+G.geometry.setTerminalPoint(new mxPoint(0,0),!0);G.geometry.relative=!0;G.edge=!0;y.insertEdge(G,!1);return A.createVertexTemplateFromCells([y,G],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree sub sections",function(){var y=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");y.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");+G.geometry.setTerminalPoint(new mxPoint(110,-40),!0);G.geometry.relative=!0;G.edge=!0;y.insertEdge(G,!1);var L=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");L.vertex=!0;var O=new mxCell("",new mxGeometry(0,0,0,0),G.style);O.geometry.setTerminalPoint(new mxPoint(110,-40),!0);O.geometry.relative=!0;O.edge=!0;L.insertEdge(O,!1);return A.createVertexTemplateFromCells([G,O,y,L],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;+EditorUi.initMinimalTheme=function(){function b(O,J){if(EditorUi.windowed){var Q=O.editor.graph;Q.popupMenuHandler.hideMenu();null==O.formatWindow?(O.formatWindow=new WrapperWindow(O,"",Math.max(10,O.diagramContainer.clientWidth-248),60,240,Math.min(600,Q.container.clientHeight-10),function(c){c.className="geSidebarContainer geFormatContainer";O.createFormat(c).init()}),O.dependsOnLanguage(mxUtils.bind(this,function(){O.formatWindow.window.setTitle(mxResources.get("format"))})),O.formatWindow.window.addListener(mxEvent.SHOW,+mxUtils.bind(this,function(){O.formatWindow.window.fit()})),O.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):O.formatWindow.window.setVisible(null!=J?J:!O.formatWindow.window.isVisible())}else null==O.formatElt&&(O.formatElt=O.createSidebarContainer(),O.createFormat(O.formatElt).init(),O.formatElt.style.border="none",O.formatElt.style.width="240px",O.formatElt.style.borderLeftWidth="1px",O.formatElt.style.borderLeftStyle="solid",O.formatElt.style.right="0px"),J=O.diagramContainer.parentNode,+null!=O.formatElt.parentNode?(O.formatElt.parentNode.removeChild(O.formatElt),J.style.right="0px"):(J.parentNode.appendChild(O.formatElt),J.style.right=O.formatElt.style.width)}function l(O,J){if(EditorUi.windowed){var Q=O.editor.graph;Q.popupMenuHandler.hideMenu();null==O.sidebarWindow?(O.sidebarWindow=new WrapperWindow(O,"",10,56,Math.min(Q.container.clientWidth-10,218)-6,Math.min(Q.container.clientHeight-40,650)-6,function(c){O.createShapesPanel(c)}),O.dependsOnLanguage(mxUtils.bind(this,function(){O.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),+O.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){O.sidebarWindow.window.fit()})),O.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),O.sidebarWindow.window.setVisible(!0),isLocalStorage&&O.getLocalData("sidebar",function(c){O.sidebar.showEntries(c,null,!0)}),O.restoreLibraries()):O.sidebarWindow.window.setVisible(null!=J?J:!O.sidebarWindow.window.isVisible())}else null==O.sidebarElt&&(O.sidebarElt=O.createSidebarContainer(),O.createShapesPanel(O.sidebarElt),O.sidebarElt.style.border=+"none",O.sidebarElt.style.width="210px",O.sidebarElt.style.borderRight="1px solid gray"),J=O.diagramContainer.parentNode,null!=O.sidebarElt.parentNode?(O.sidebarElt.parentNode.removeChild(O.sidebarElt),J.style.left="0px"):(J.parentNode.appendChild(O.sidebarElt),J.style.left=O.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var p=0;try{p=window.innerWidth||document.documentElement.clientWidth||+document.body.clientWidth}catch(O){}Menus.prototype.autoPopup=!1;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke-width="2" style="stroke-opacity:0.4" stroke="#ffffff"/><path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR="#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR="#C0C0C0";mxConstants.OUTLINE_COLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#fff";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowSize="0.6";Graph.prototype.svgShadowBlur="1.2";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;EditorUi.prototype.closableScratchpad=!1;Graph.prototype.editAfterInsert=!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=-function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var g=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){g.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var x=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(M,L){null!=L.shortcut&&900>p&&!mxClient.IS_IOS?M.firstChild.nextSibling.setAttribute("title",L.shortcut):x.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=-function(M){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=M?M:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||null==this.formatWindow&&0<this.formatWidth};var B=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();B.apply(this,arguments)};var z=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(M){z.apply(this,-arguments);if(M){var L=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=L&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=L&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};EditorUi.prototype.installFormatToolbar=-function(M){var L=this.editor.graph,Q=document.createElement("div");Q.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";L.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,f){0<L.getSelectionCount()?(M.appendChild(Q),Q.innerHTML="Selected: "+L.getSelectionCount()):null!=Q.parentNode&&Q.parentNode.removeChild(Q)}))};var F=!1;EditorUi.prototype.initFormatWindow=-function(){if(!F&&null!=this.formatWindow){F=!0;var M=this.formatWindow.window.toggleMinimized,L=240;this.formatWindow.window.toggleMinimized=function(){M.apply(this,arguments);this.minimized?(L=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+L-140+"px"):(this.div.style.width=L+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-L+140)+"px");this.fit()};-mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(Q){mxEvent.getSource(Q)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var K=EditorUi.prototype.init;EditorUi.prototype.init=function(){function M(r,A,D){var G=k.menus.get(r);A=t.addMenu(mxResources.get(r),mxUtils.bind(this,function(){G.funct.apply(this,arguments)}));A.className="geButton";A.setAttribute("title",mxResources.get(r));k.menus.menuCreated(G,A,"geButton");null!=D&&-(A.style.backgroundImage="url("+D+")",A.innerText="");return A}function L(r,A,D,G,O,P){var V=document.createElement("a");V.className="geButton";q.appendChild(V);null!=P?V.style.backgroundImage="url("+P+")":mxUtils.write(V,r);mxEvent.addListener(V,"click",function(Y){"disabled"!=V.getAttribute("disabled")&&A(Y);mxEvent.consume(Y)});mxEvent.preventDefault(V);null!=G&&V.setAttribute("title",G);null!=O&&(r=function(){O.isEnabled()?V.removeAttribute("disabled"):V.setAttribute("disabled","disabled")},O.addListener("stateChanged",-r),n.addListener("enabledChanged",r),r());return V}function Q(r,A,D){A=document.createElement("div");A.className="geButtonGroup";for(D=0;D<r.length;D++)null!=r[D]&&A.appendChild(r[D]);q.appendChild(A);return A}function c(){p=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var r=0;"1"==urlParams.embed&&null!=k.buttonContainer&&(r=k.buttonContainer.offsetWidth||300);q.innerHTML="";var A=p<1E3+r,D=M("diagram",null,A?Editor.menuImage:null);Q([D,L(mxResources.get("shapes"),-k.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),k.actions.get("image"),A?Editor.shapesImage:null),L(mxResources.get("format"),k.actions.get("format").funct,null,mxResources.get("format")+" ("+k.actions.get("format").shortcut+")",k.actions.get("image"),A?Editor.formatImage:null)]);D=M("insert",!0,A?C:null);Q([D,L(mxResources.get("delete"),k.actions.get("delete").funct,null,mxResources.get("delete"),k.actions.get("delete"),A?Editor.trashImage:null)]);n.isEnabled()||D.setAttribute("disabled",-"disabled");v.setAttribute("title",mxResources.get("undo")+" ("+R.shortcut+")");d.setAttribute("title",mxResources.get("redo")+" ("+T.shortcut+")");m.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");p>=411+r&&(Q([v,d]),p>=520+r&&Q([m,p>=640+r?L("",S.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",S,Editor.zoomInImage):null,p>=640+r?L("",N.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",N,Editor.zoomOutImage):null]));q.appendChild(k.statusContainer);-q.appendChild(k.buttonContainer)}K.apply(this,arguments);var f=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=f&&(f.classList.add("geSimple"),f.classList.add("geMinimal"),f.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);"0"!=urlParams.sidebar&&(1E3<=p||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])&&(l(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&+function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var g=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){g.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var x=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(O,J){null!=J.shortcut&&900>p&&!mxClient.IS_IOS?O.firstChild.nextSibling.setAttribute("title",J.shortcut):x.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=+function(O){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=O?O:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||null==this.formatWindow&&0<this.formatWidth};var A=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();A.apply(this,arguments)};var y=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(O){y.apply(this,+arguments);if(O){var J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=J&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=J&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};EditorUi.prototype.installFormatToolbar=+function(O){var J=this.editor.graph,Q=document.createElement("div");Q.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";J.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,f){0<J.getSelectionCount()?(O.appendChild(Q),Q.innerHTML="Selected: "+J.getSelectionCount()):null!=Q.parentNode&&Q.parentNode.removeChild(Q)}))};var G=!1;EditorUi.prototype.initFormatWindow=+function(){if(!G&&null!=this.formatWindow){G=!0;var O=this.formatWindow.window.toggleMinimized,J=240;this.formatWindow.window.toggleMinimized=function(){O.apply(this,arguments);this.minimized?(J=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+J-140+"px"):(this.div.style.width=J+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-J+140)+"px");this.fit()};+mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(Q){mxEvent.getSource(Q)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var L=EditorUi.prototype.init;EditorUi.prototype.init=function(){function O(r,z,D){var F=k.menus.get(r);z=t.addMenu(mxResources.get(r),mxUtils.bind(this,function(){F.funct.apply(this,arguments)}));z.className="geButton";z.setAttribute("title",mxResources.get(r));k.menus.menuCreated(F,z,"geButton");null!=D&&+(z.style.backgroundImage="url("+D+")",z.innerText="");return z}function J(r,z,D,F,N,P){var V=document.createElement("a");V.className="geButton";q.appendChild(V);null!=P?V.style.backgroundImage="url("+P+")":mxUtils.write(V,r);mxEvent.addListener(V,"click",function(X){"disabled"!=V.getAttribute("disabled")&&z(X);mxEvent.consume(X)});mxEvent.preventDefault(V);null!=F&&V.setAttribute("title",F);null!=N&&(r=function(){N.isEnabled()?V.removeAttribute("disabled"):V.setAttribute("disabled","disabled")},N.addListener("stateChanged",+r),n.addListener("enabledChanged",r),r());return V}function Q(r,z,D){z=document.createElement("div");z.className="geButtonGroup";for(D=0;D<r.length;D++)null!=r[D]&&z.appendChild(r[D]);q.appendChild(z);return z}function c(){p=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var r=0;"1"==urlParams.embed&&null!=k.buttonContainer&&(r=k.buttonContainer.offsetWidth||300);q.innerHTML="";var z=p<1E3+r,D=O("diagram",null,z?Editor.menuImage:null);Q([D,J(mxResources.get("shapes"),+k.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),k.actions.get("image"),z?Editor.shapesImage:null),J(mxResources.get("format"),k.actions.get("format").funct,null,mxResources.get("format")+" ("+k.actions.get("format").shortcut+")",k.actions.get("image"),z?Editor.formatImage:null)]);D=O("insert",!0,z?C:null);Q([D,J(mxResources.get("delete"),k.actions.get("delete").funct,null,mxResources.get("delete"),k.actions.get("delete"),z?Editor.trashImage:null)]);n.isEnabled()||D.setAttribute("disabled",+"disabled");v.setAttribute("title",mxResources.get("undo")+" ("+R.shortcut+")");d.setAttribute("title",mxResources.get("redo")+" ("+T.shortcut+")");m.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");p>=411+r&&(Q([v,d]),p>=520+r&&Q([m,p>=640+r?J("",S.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",S,Editor.zoomInImage):null,p>=640+r?J("",M.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",M,Editor.zoomOutImage):null]));q.appendChild(k.statusContainer);+q.appendChild(k.buttonContainer)}L.apply(this,arguments);var f=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=f&&(f.classList.add("geSimple"),f.classList.add("geMinimal"),f.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);"0"!=urlParams.sidebar&&(1E3<=p||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])&&(l(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search")));this.formatEnabled&&EditorUi.windowed&&1E3<=p&&(b(this,!0),this.formatWindow.window.setVisible(!0));var k=this,n=k.editor.graph;k.toolbar=this.createToolbar(k.createDiv("geToolbar"));var q=document.createElement("div");q.className="geMenubarContainer";var t=new Menubar(k,q),u=k.hideCurrentMenu;k.hideCurrentMenu=function(){u.apply(this,arguments);null!=this.editor&&this.editor.graph.popupMenuHandler.hideMenu()};-var y=k.descriptorChanged;k.descriptorChanged=function(){y.apply(this,arguments);var r=k.getCurrentFile();if(null!=r&&null!=r.getTitle()){var A=r.getMode();"google"==A?A="googleDrive":"github"==A?A="gitHub":"gitlab"==A?A="gitLab":"onedrive"==A&&(A="oneDrive");A=mxResources.get(A);q.setAttribute("title",r.getTitle()+(null!=A?" ("+A+")":""))}else q.removeAttribute("title")};k.setStatusText(k.editor.getStatus());q.appendChild(k.statusContainer);k.buttonContainer=this.createButtonContainer();q.appendChild(k.buttonContainer);-k.menubarContainer=k.buttonContainer;k.tabContainer=this.createTabContainer();var E=this.createZoomInput(!0),I=k.updateTabContainer;k.updateTabContainer=function(){I.apply(this,arguments);k.tabContainer.appendChild(E)};var C=Editor.addBoxImage;if(null!=k.hoverIcons){var U=k.hoverIcons.update;k.hoverIcons.update=function(){n.freehand.isDrawing()||U.apply(this,arguments)}}if(null!=n.freehand){var J=n.freehand.createStyle;n.freehand.createStyle=function(r){return J.apply(this,arguments)+"sketch=0;"}}k.editor.addListener("statusChanged",-mxUtils.bind(this,function(){k.setStatusText(k.editor.getStatus())}));k.setStatusText(k.editor.getStatus());var S=k.actions.get("zoomIn"),N=k.actions.get("zoomOut");f=k.actions.get("resetView");var R=k.actions.get("undo"),T=k.actions.get("redo"),v=L("",R.funct,null,"",R,Editor.undoImage),d=L("",T.funct,null,"",T,Editor.redoImage),m=L("",function(r){mxEvent.isAltDown(r)?(k.hideCurrentMenu(),k.actions.get("customZoom").funct()):(k.hideCurrentMenu(),k.actions.get("smartFit").funct());mxEvent.consume(r)},+var B=k.descriptorChanged;k.descriptorChanged=function(){B.apply(this,arguments);var r=k.getCurrentFile();if(null!=r&&null!=r.getTitle()){var z=r.getMode();"google"==z?z="googleDrive":"github"==z?z="gitHub":"gitlab"==z?z="gitLab":"onedrive"==z&&(z="oneDrive");z=mxResources.get(z);q.setAttribute("title",r.getTitle()+(null!=z?" ("+z+")":""))}else q.removeAttribute("title")};k.setStatusText(k.editor.getStatus());q.appendChild(k.statusContainer);k.buttonContainer=this.createButtonContainer();q.appendChild(k.buttonContainer);+k.menubarContainer=k.buttonContainer;k.tabContainer=this.createTabContainer();var E=this.createZoomInput(!0),I=k.updateTabContainer;k.updateTabContainer=function(){I.apply(this,arguments);k.tabContainer.appendChild(E)};var C=Editor.addBoxImage;if(null!=k.hoverIcons){var U=k.hoverIcons.update;k.hoverIcons.update=function(){n.freehand.isDrawing()||U.apply(this,arguments)}}if(null!=n.freehand){var K=n.freehand.createStyle;n.freehand.createStyle=function(r){return K.apply(this,arguments)+"sketch=0;"}}k.editor.addListener("statusChanged",+mxUtils.bind(this,function(){k.setStatusText(k.editor.getStatus())}));k.setStatusText(k.editor.getStatus());var S=k.actions.get("zoomIn"),M=k.actions.get("zoomOut");f=k.actions.get("resetView");var R=k.actions.get("undo"),T=k.actions.get("redo"),v=J("",R.funct,null,"",R,Editor.undoImage),d=J("",T.funct,null,"",T,Editor.redoImage),m=J("",function(r){mxEvent.isAltDown(r)?(k.hideCurrentMenu(),k.actions.get("customZoom").funct()):(k.hideCurrentMenu(),k.actions.get("smartFit").funct());mxEvent.consume(r)},!0,"",f,Editor.zoomFitImage);k.actions.get("toggleShapes").funct=mxUtils.bind(this,function(){l(k,null)});k.container.appendChild(k.tabContainer);k.container.appendChild(q);k.updateTabContainer();this.formatEnabled&&!EditorUi.windowed&&1E3<=p&&b(this,!0);c();k.addListener("lockedChanged",c);k.addListener("languageChanged",c);k.editor.graph.addListener("enabledChanged",c);mxEvent.addListener(window,"resize",function(){c();null!=k.sidebarWindow&&k.sidebarWindow.window.fit();null!=k.formatWindow&&k.formatWindow.window.fit();null!=k.actions.outlineWindow&&k.actions.outlineWindow.window.fit();null!=k.actions.layersWindow&&k.actions.layersWindow.window.fit();null!=k.menus.chatWindow&&k.menus.chatWindow.window.fit();null!=k.menus.tagsWindow&&k.menus.tagsWindow.window.fit();null!=k.menus.findWindow&&k.menus.findWindow.window.fit();null!=k.menus.findReplaceWindow&&k.menus.findReplaceWindow.window.fit()})}}};-(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var l=EditorUi.initTheme;EditorUi.initTheme=function(){l.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();(function(){var b=mxGuide.prototype.move;mxGuide.prototype.move=function(g,x,B,z){var F=x.y,K=x.x,M=!1,L=!1;if(null!=this.states&&null!=g&&null!=x){var Q=this,c=new mxCellState,f=this.graph.getView().scale,k=Math.max(2,this.getGuideTolerance()/2);c.x=g.x+K;c.y=g.y+F;c.width=g.width;c.height=g.height;for(var n=[],q=[],t=0;t<this.states.length;t++){var u=this.states[t];u instanceof mxCellState&&(z||!this.graph.isCellSelected(u.cell))&&((c.x>=u.x&&c.x<=u.x+u.width||u.x>=c.x&&u.x<=c.x+c.width)&&(c.y>-u.y+u.height+4||c.y+c.height+4<u.y)?n.push(u):(c.y>=u.y&&c.y<=u.y+u.height||u.y>=c.y&&u.y<=c.y+c.height)&&(c.x>u.x+u.width+4||c.x+c.width+4<u.x)&&q.push(u))}var y=0,E=0,I=u=0,C=0,U=0,J=0,S=0,N=5*f;if(1<n.length){n.push(c);n.sort(function(d,m){return d.y-m.y});var R=!1;t=c==n[0];f=c==n[n.length-1];if(!t&&!f)for(t=1;t<n.length-1;t++)if(c==n[t]){f=n[t-1];t=n[t+1];u=E=I=(t.y-f.y-f.height-c.height)/2;break}for(t=0;t<n.length-1;t++){f=n[t];var T=n[t+1],v=c==f||c==T;T=T.y-f.y-f.height;R|=c==f;if(0==E&&0==-y)E=T,y=1;else if(Math.abs(E-T)<=(v||1==t&&R?k:0))y+=1;else if(1<y&&R){n=n.slice(0,t+1);break}else if(3<=n.length-t&&!R)y=0,u=E=0!=I?I:0,n.splice(0,0==t?1:t),t=-1;else break;0!=u||v||(E=u=T)}3==n.length&&n[1]==c&&(u=0)}if(1<q.length){q.push(c);q.sort(function(d,m){return d.x-m.x});R=!1;t=c==q[0];f=c==q[q.length-1];if(!t&&!f)for(t=1;t<q.length-1;t++)if(c==q[t]){f=q[t-1];t=q[t+1];J=U=S=(t.x-f.x-f.width-c.width)/2;break}for(t=0;t<q.length-1;t++){f=q[t];T=q[t+1];v=c==f||c==T;T=T.x-f.x-f.width;R|=c==f;-if(0==U&&0==C)U=T,C=1;else if(Math.abs(U-T)<=(v||1==t&&R?k:0))C+=1;else if(1<C&&R){q=q.slice(0,t+1);break}else if(3<=q.length-t&&!R)C=0,J=U=0!=S?S:0,q.splice(0,0==t?1:t),t=-1;else break;0!=J||v||(U=J=T)}3==q.length&&q[1]==c&&(J=0)}k=function(d,m,r,A){var D=[];if(A){A=N;var G=0}else A=0,G=N;D.push(new mxPoint(d.x-A,d.y-G));D.push(new mxPoint(d.x+A,d.y+G));D.push(d);D.push(m);D.push(new mxPoint(m.x-A,m.y-G));D.push(new mxPoint(m.x+A,m.y+G));if(null!=r)return r.points=D,r;d=new mxPolyline(D,mxConstants.GUIDE_COLOR,-mxConstants.GUIDE_STROKEWIDTH);d.dialect=mxConstants.DIALECT_SVG;d.pointerEvents=!1;d.init(Q.graph.getView().getOverlayPane());return d};U=function(d,m){if(d&&null!=Q.guidesArrHor)for(d=0;d<Q.guidesArrHor.length;d++)Q.guidesArrHor[d].node.style.visibility="hidden";if(m&&null!=Q.guidesArrVer)for(d=0;d<Q.guidesArrVer.length;d++)Q.guidesArrVer[d].node.style.visibility="hidden"};if(1<C&&C==q.length-1){C=[];S=Q.guidesArrHor;M=[];K=0;t=q[0]==c?1:0;R=q[t].y+q[t].height;if(0<J)for(t=0;t<q.length-1;t++)f=-q[t],T=q[t+1],c==f?(K=T.x-f.width-J,M.push(new mxPoint(K+f.width+N,R)),M.push(new mxPoint(T.x-N,R))):c==T?(M.push(new mxPoint(f.x+f.width+N,R)),K=f.x+f.width+J,M.push(new mxPoint(K-N,R))):(M.push(new mxPoint(f.x+f.width+N,R)),M.push(new mxPoint(T.x-N,R)));else f=q[0],t=q[2],K=f.x+f.width+(t.x-f.x-f.width-c.width)/2,M.push(new mxPoint(f.x+f.width+N,R)),M.push(new mxPoint(K-N,R)),M.push(new mxPoint(K+c.width+N,R)),M.push(new mxPoint(t.x-N,R));for(t=0;t<M.length;t+=2)q=M[t],J=M[t+1],q=k(q,J,null!=S?-S[t/2]:null),q.node.style.visibility="visible",q.redraw(),C.push(q);for(t=M.length/2;null!=S&&t<S.length;t++)S[t].destroy();Q.guidesArrHor=C;K-=g.x;M=!0}else U(!0);if(1<y&&y==n.length-1){C=[];S=Q.guidesArrVer;L=[];F=0;t=n[0]==c?1:0;y=n[t].x+n[t].width;if(0<u)for(t=0;t<n.length-1;t++)f=n[t],T=n[t+1],c==f?(F=T.y-f.height-u,L.push(new mxPoint(y,F+f.height+N)),L.push(new mxPoint(y,T.y-N))):c==T?(L.push(new mxPoint(y,f.y+f.height+N)),F=f.y+f.height+u,L.push(new mxPoint(y,F-N))):(L.push(new mxPoint(y,f.y+-f.height+N)),L.push(new mxPoint(y,T.y-N)));else f=n[0],t=n[2],F=f.y+f.height+(t.y-f.y-f.height-c.height)/2,L.push(new mxPoint(y,f.y+f.height+N)),L.push(new mxPoint(y,F-N)),L.push(new mxPoint(y,F+c.height+N)),L.push(new mxPoint(y,t.y-N));for(t=0;t<L.length;t+=2)q=L[t],J=L[t+1],q=k(q,J,null!=S?S[t/2]:null,!0),q.node.style.visibility="visible",q.redraw(),C.push(q);for(t=L.length/2;null!=S&&t<S.length;t++)S[t].destroy();Q.guidesArrVer=C;F-=g.y;L=!0}else U(!1,!0)}if(M||L)return c=new mxPoint(K,F),n=b.call(this,-g,c,B,z),M&&!L?c.y=n.y:L&&!M&&(c.x=n.x),n.y!=c.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),n.x!=c.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),c;U(!0,!0);return b.apply(this,arguments)};var l=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(g){l.call(this,g);var x=this.guidesArrVer,B=this.guidesArrHor;if(null!=x)for(var z=0;z<x.length;z++)x[z].node.style.visibility=g?"visible":"hidden";if(null!=-B)for(z=0;z<B.length;z++)B[z].node.style.visibility=g?"visible":"hidden"};var p=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){p.call(this);var g=this.guidesArrVer,x=this.guidesArrHor;if(null!=g){for(var B=0;B<g.length;B++)g[B].destroy();this.guidesArrVer=null}if(null!=x){for(B=0;B<x.length;B++)x[B].destroy();this.guidesArrHor=null}}})();function mxRuler(b,l,p,g){function x(){var y=b.getDiagramContainerOffset(),E=b.diagramContainer;Q.style.top=E.offsetTop-y.y+"px";Q.style.left=E.offsetLeft-y.x+"px";Q.style.width=(p?0:E.offsetWidth-1)+K+"px";Q.style.height=(p?E.offsetHeight:0)+K+"px"}function B(y,E,I){if(null!=z)return y;var C;return function(){var U=this,J=arguments,S=I&&!C;clearTimeout(C);C=setTimeout(function(){C=null;I||y.apply(U,J)},E);S&&y.apply(U,J)}}var z=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||-window.msRequestAnimationFrame,F=window.cancelAnimationFrame||window.mozCancelAnimationFrame,K=this.RULER_THICKNESS,M=this;this.unit=l;var L=Editor.isDarkMode()?{bkgClr:"#202020",outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{bkgClr:"#ffffff",outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"},Q=document.createElement("div");Q.className="geRuler";Q.style.position="fixed";this.updateStyle=mxUtils.bind(this,-function(){L=Editor.isDarkMode()?{outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"};Q.style[p?"borderRight":"borderBottom"]="0.5px solid "+L.strokeClr;Q.style.borderLeft="0.5px solid "+L.strokeClr});this.updateStyle();b.diagramContainer.appendChild(Q);mxEvent.disableContextMenu(Q);this.editorUiRefresh=b.refresh;b.refresh=function(y){M.editorUiRefresh.apply(b,-arguments);x()};x();var c=document.createElement("canvas");c.width=Q.offsetWidth;c.height=Q.offsetHeight;Q.style.overflow="hidden";c.style.position="relative";Q.appendChild(c);var f=c.getContext("2d");this.ui=b;var k=b.editor.graph;this.graph=k;this.container=Q;this.canvas=c;var n=function(y,E,I,C,U){y=Math.round(y);E=Math.round(E);I=Math.round(I);C=Math.round(C);f.beginPath();f.moveTo(y+.5,E+.5);f.lineTo(I+.5,C+.5);f.stroke();U&&(p?(f.save(),f.translate(y,E),f.rotate(-Math.PI/2),f.fillText(U,0,0),-f.restore()):f.fillText(U,y,E))},q=function(){f.clearRect(0,0,c.width,c.height);f.beginPath();f.lineWidth=.7;f.strokeStyle=L.strokeClr;f.setLineDash([]);f.font="9px Arial";f.textAlign="center";var y=k.view.scale,E=k.view.getBackgroundPageBounds(),I=k.view.translate,C=k.pageVisible;I=C?K+(p?E.y-k.container.scrollTop:E.x-k.container.scrollLeft):K+(p?I.y*y-k.container.scrollTop:I.x*y-k.container.scrollLeft);var U=0;C&&(U=k.getPageLayout(),U=p?U.y*k.pageFormat.height:U.x*k.pageFormat.width);var J;switch(M.unit){case mxConstants.POINTS:var S=-J=10;var N=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:J=10;S=mxConstants.PIXELS_PER_MM;N=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.METERS:J=20;S=mxConstants.PIXELS_PER_MM;N=[5,3,3,3,3,6,3,3,3,3,10,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:J=.5>=y||4<=y?8:16,S=mxConstants.PIXELS_PER_INCH/J,N=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var R=S;2<=y?R=S/(2*Math.floor(y/2)):.5>=y&&(R=S*Math.floor(1/y/2)*(M.unit==mxConstants.MILLIMETERS?2:1));S=null;E=C?Math.min(I+(p?E.height:E.width),p?-c.height:c.width):p?c.height:c.width;if(C)if(f.fillStyle=L.outBkgClr,p){var T=I-K;0<T&&f.fillRect(0,K,K,T);E<c.height&&f.fillRect(0,E,K,c.height)}else T=I-K,0<T&&f.fillRect(K,0,T,K),E<c.width&&f.fillRect(E,0,c.width,K);f.fillStyle=L.fontClr;for(C=C?I:I%(R*y);C<=E;C+=R*y)if(T=Math.round((C-I)/y/R),!(C<K||T==S)){S=T;var v=null;0==T%J&&(v=M.formatText(U+T*R)+"");p?n(K-N[Math.abs(T)%J],C,K,C,v):n(C,K-N[Math.abs(T)%J],C,K,v)}f.lineWidth=1;n(p?0:K,p?K:0,K,K);f.fillStyle=L.cornerClr;f.fillRect(0,0,K,K)},-t=-1,u=function(){null!=z?(null!=F&&F(t),t=z(q)):q()};this.drawRuler=u;this.sizeListener=l=B(function(){var y=k.container;p?(y=y.offsetHeight+K,c.height!=y&&(c.height=y,Q.style.height=y+"px",u())):(y=y.offsetWidth+K,c.width!=y&&(c.width=y,Q.style.width=y+"px",u()))},10);this.pageListener=function(){u()};this.scrollListener=g=B(function(){var y=p?k.container.scrollTop:k.container.scrollLeft;M.lastScroll!=y&&(M.lastScroll=y,u())},10);this.unitListener=function(y,E){M.setUnit(E.getProperty("unit"))};-k.addListener(mxEvent.SIZE,l);k.container.addEventListener("scroll",g);k.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(y){L=y;Q.style.background=L.bkgClr;q()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(y,E,I,C){if(p&&4<y.height||!p&&4<y.width){if(null!=M.guidePart)try{f.putImageData(M.guidePart.imgData1,-M.guidePart.x1,M.guidePart.y1),f.putImageData(M.guidePart.imgData2,M.guidePart.x2,M.guidePart.y2),f.putImageData(M.guidePart.imgData3,M.guidePart.x3,M.guidePart.y3)}catch(A){}var U=M.origGuideMove.apply(this,arguments);try{f.lineWidth=.5;f.strokeStyle=L.guideClr;f.setLineDash([2]);if(p){var J=y.y+U.y+K-this.graph.container.scrollTop;var S=0;var N=J+y.height/2;var R=K/2;var T=J+y.height;var v=0;var d=f.getImageData(S,J-1,K,3);n(S,J,K,J);J--;var m=f.getImageData(R,N-1,K,3);n(R,N,K,N);N--;var r=f.getImageData(v,-T-1,K,3);n(v,T,K,T);T--}else J=0,S=y.x+U.x+K-this.graph.container.scrollLeft,N=K/2,R=S+y.width/2,T=0,v=S+y.width,d=f.getImageData(S-1,J,3,K),n(S,J,S,K),S--,m=f.getImageData(R-1,N,3,K),n(R,N,R,K),R--,r=f.getImageData(v-1,T,3,K),n(v,T,v,K),v--;if(null==M.guidePart||M.guidePart.x1!=S||M.guidePart.y1!=J)M.guidePart={imgData1:d,x1:S,y1:J,imgData2:m,x2:R,y2:N,imgData3:r,x3:v,y3:T}}catch(A){}}else U=M.origGuideMove.apply(this,arguments);return U};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=-function(){var y=M.origGuideDestroy.apply(this,arguments);if(null!=M.guidePart)try{f.putImageData(M.guidePart.imgData1,M.guidePart.x1,M.guidePart.y1),f.putImageData(M.guidePart.imgData2,M.guidePart.x2,M.guidePart.y2),f.putImageData(M.guidePart.imgData3,M.guidePart.x3,M.guidePart.y3),M.guidePart=null}catch(E){}return y}}mxRuler.prototype.RULER_THICKNESS=14;mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(b){this.unit=b;this.drawRuler()};+(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var l=EditorUi.initTheme;EditorUi.initTheme=function(){l.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();(function(){var b=mxGuide.prototype.move;mxGuide.prototype.move=function(g,x,A,y){var G=x.y,L=x.x,O=!1,J=!1;if(null!=this.states&&null!=g&&null!=x){var Q=this,c=new mxCellState,f=this.graph.getView().scale,k=Math.max(2,this.getGuideTolerance()/2);c.x=g.x+L;c.y=g.y+G;c.width=g.width;c.height=g.height;for(var n=[],q=[],t=0;t<this.states.length;t++){var u=this.states[t];u instanceof mxCellState&&(y||!this.graph.isCellSelected(u.cell))&&((c.x>=u.x&&c.x<=u.x+u.width||u.x>=c.x&&u.x<=c.x+c.width)&&(c.y>+u.y+u.height+4||c.y+c.height+4<u.y)?n.push(u):(c.y>=u.y&&c.y<=u.y+u.height||u.y>=c.y&&u.y<=c.y+c.height)&&(c.x>u.x+u.width+4||c.x+c.width+4<u.x)&&q.push(u))}var B=0,E=0,I=u=0,C=0,U=0,K=0,S=0,M=5*f;if(1<n.length){n.push(c);n.sort(function(d,m){return d.y-m.y});var R=!1;t=c==n[0];f=c==n[n.length-1];if(!t&&!f)for(t=1;t<n.length-1;t++)if(c==n[t]){f=n[t-1];t=n[t+1];u=E=I=(t.y-f.y-f.height-c.height)/2;break}for(t=0;t<n.length-1;t++){f=n[t];var T=n[t+1],v=c==f||c==T;T=T.y-f.y-f.height;R|=c==f;if(0==E&&0==+B)E=T,B=1;else if(Math.abs(E-T)<=(v||1==t&&R?k:0))B+=1;else if(1<B&&R){n=n.slice(0,t+1);break}else if(3<=n.length-t&&!R)B=0,u=E=0!=I?I:0,n.splice(0,0==t?1:t),t=-1;else break;0!=u||v||(E=u=T)}3==n.length&&n[1]==c&&(u=0)}if(1<q.length){q.push(c);q.sort(function(d,m){return d.x-m.x});R=!1;t=c==q[0];f=c==q[q.length-1];if(!t&&!f)for(t=1;t<q.length-1;t++)if(c==q[t]){f=q[t-1];t=q[t+1];K=U=S=(t.x-f.x-f.width-c.width)/2;break}for(t=0;t<q.length-1;t++){f=q[t];T=q[t+1];v=c==f||c==T;T=T.x-f.x-f.width;R|=c==f;+if(0==U&&0==C)U=T,C=1;else if(Math.abs(U-T)<=(v||1==t&&R?k:0))C+=1;else if(1<C&&R){q=q.slice(0,t+1);break}else if(3<=q.length-t&&!R)C=0,K=U=0!=S?S:0,q.splice(0,0==t?1:t),t=-1;else break;0!=K||v||(U=K=T)}3==q.length&&q[1]==c&&(K=0)}k=function(d,m,r,z){var D=[];if(z){z=M;var F=0}else z=0,F=M;D.push(new mxPoint(d.x-z,d.y-F));D.push(new mxPoint(d.x+z,d.y+F));D.push(d);D.push(m);D.push(new mxPoint(m.x-z,m.y-F));D.push(new mxPoint(m.x+z,m.y+F));if(null!=r)return r.points=D,r;d=new mxPolyline(D,mxConstants.GUIDE_COLOR,+mxConstants.GUIDE_STROKEWIDTH);d.dialect=mxConstants.DIALECT_SVG;d.pointerEvents=!1;d.init(Q.graph.getView().getOverlayPane());return d};U=function(d,m){if(d&&null!=Q.guidesArrHor)for(d=0;d<Q.guidesArrHor.length;d++)Q.guidesArrHor[d].node.style.visibility="hidden";if(m&&null!=Q.guidesArrVer)for(d=0;d<Q.guidesArrVer.length;d++)Q.guidesArrVer[d].node.style.visibility="hidden"};if(1<C&&C==q.length-1){C=[];S=Q.guidesArrHor;O=[];L=0;t=q[0]==c?1:0;R=q[t].y+q[t].height;if(0<K)for(t=0;t<q.length-1;t++)f=+q[t],T=q[t+1],c==f?(L=T.x-f.width-K,O.push(new mxPoint(L+f.width+M,R)),O.push(new mxPoint(T.x-M,R))):c==T?(O.push(new mxPoint(f.x+f.width+M,R)),L=f.x+f.width+K,O.push(new mxPoint(L-M,R))):(O.push(new mxPoint(f.x+f.width+M,R)),O.push(new mxPoint(T.x-M,R)));else f=q[0],t=q[2],L=f.x+f.width+(t.x-f.x-f.width-c.width)/2,O.push(new mxPoint(f.x+f.width+M,R)),O.push(new mxPoint(L-M,R)),O.push(new mxPoint(L+c.width+M,R)),O.push(new mxPoint(t.x-M,R));for(t=0;t<O.length;t+=2)q=O[t],K=O[t+1],q=k(q,K,null!=S?+S[t/2]:null),q.node.style.visibility="visible",q.redraw(),C.push(q);for(t=O.length/2;null!=S&&t<S.length;t++)S[t].destroy();Q.guidesArrHor=C;L-=g.x;O=!0}else U(!0);if(1<B&&B==n.length-1){C=[];S=Q.guidesArrVer;J=[];G=0;t=n[0]==c?1:0;B=n[t].x+n[t].width;if(0<u)for(t=0;t<n.length-1;t++)f=n[t],T=n[t+1],c==f?(G=T.y-f.height-u,J.push(new mxPoint(B,G+f.height+M)),J.push(new mxPoint(B,T.y-M))):c==T?(J.push(new mxPoint(B,f.y+f.height+M)),G=f.y+f.height+u,J.push(new mxPoint(B,G-M))):(J.push(new mxPoint(B,f.y++f.height+M)),J.push(new mxPoint(B,T.y-M)));else f=n[0],t=n[2],G=f.y+f.height+(t.y-f.y-f.height-c.height)/2,J.push(new mxPoint(B,f.y+f.height+M)),J.push(new mxPoint(B,G-M)),J.push(new mxPoint(B,G+c.height+M)),J.push(new mxPoint(B,t.y-M));for(t=0;t<J.length;t+=2)q=J[t],K=J[t+1],q=k(q,K,null!=S?S[t/2]:null,!0),q.node.style.visibility="visible",q.redraw(),C.push(q);for(t=J.length/2;null!=S&&t<S.length;t++)S[t].destroy();Q.guidesArrVer=C;G-=g.y;J=!0}else U(!1,!0)}if(O||J)return c=new mxPoint(L,G),n=b.call(this,+g,c,A,y),O&&!J?c.y=n.y:J&&!O&&(c.x=n.x),n.y!=c.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),n.x!=c.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),c;U(!0,!0);return b.apply(this,arguments)};var l=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(g){l.call(this,g);var x=this.guidesArrVer,A=this.guidesArrHor;if(null!=x)for(var y=0;y<x.length;y++)x[y].node.style.visibility=g?"visible":"hidden";if(null!=+A)for(y=0;y<A.length;y++)A[y].node.style.visibility=g?"visible":"hidden"};var p=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){p.call(this);var g=this.guidesArrVer,x=this.guidesArrHor;if(null!=g){for(var A=0;A<g.length;A++)g[A].destroy();this.guidesArrVer=null}if(null!=x){for(A=0;A<x.length;A++)x[A].destroy();this.guidesArrHor=null}}})();function mxRuler(b,l,p,g){function x(){var B=b.getDiagramContainerOffset(),E=b.diagramContainer;Q.style.top=E.offsetTop-B.y+"px";Q.style.left=E.offsetLeft-B.x+"px";Q.style.width=(p?0:E.offsetWidth-1)+L+"px";Q.style.height=(p?E.offsetHeight:0)+L+"px"}function A(B,E,I){if(null!=y)return B;var C;return function(){var U=this,K=arguments,S=I&&!C;clearTimeout(C);C=setTimeout(function(){C=null;I||B.apply(U,K)},E);S&&B.apply(U,K)}}var y=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||+window.msRequestAnimationFrame,G=window.cancelAnimationFrame||window.mozCancelAnimationFrame,L=this.RULER_THICKNESS,O=this;this.unit=l;var J=Editor.isDarkMode()?{bkgClr:"#202020",outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{bkgClr:"#ffffff",outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"},Q=document.createElement("div");Q.className="geRuler";Q.style.position="fixed";this.updateStyle=mxUtils.bind(this,+function(){J=Editor.isDarkMode()?{outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"};Q.style[p?"borderRight":"borderBottom"]="0.5px solid "+J.strokeClr;Q.style.borderLeft="0.5px solid "+J.strokeClr});this.updateStyle();b.diagramContainer.appendChild(Q);mxEvent.disableContextMenu(Q);this.editorUiRefresh=b.refresh;b.refresh=function(B){O.editorUiRefresh.apply(b,+arguments);x()};x();var c=document.createElement("canvas");c.width=Q.offsetWidth;c.height=Q.offsetHeight;Q.style.overflow="hidden";c.style.position="relative";Q.appendChild(c);var f=c.getContext("2d");this.ui=b;var k=b.editor.graph;this.graph=k;this.container=Q;this.canvas=c;var n=function(B,E,I,C,U){B=Math.round(B);E=Math.round(E);I=Math.round(I);C=Math.round(C);f.beginPath();f.moveTo(B+.5,E+.5);f.lineTo(I+.5,C+.5);f.stroke();U&&(p?(f.save(),f.translate(B,E),f.rotate(-Math.PI/2),f.fillText(U,0,0),+f.restore()):f.fillText(U,B,E))},q=function(){f.clearRect(0,0,c.width,c.height);f.beginPath();f.lineWidth=.7;f.strokeStyle=J.strokeClr;f.setLineDash([]);f.font="9px Arial";f.textAlign="center";var B=k.view.scale,E=k.view.getBackgroundPageBounds(),I=k.view.translate,C=k.pageVisible;I=C?L+(p?E.y-k.container.scrollTop:E.x-k.container.scrollLeft):L+(p?I.y*B-k.container.scrollTop:I.x*B-k.container.scrollLeft);var U=0;C&&(U=k.getPageLayout(),U=p?U.y*k.pageFormat.height:U.x*k.pageFormat.width);var K;switch(O.unit){case mxConstants.POINTS:var S=+K=10;var M=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:K=10;S=mxConstants.PIXELS_PER_MM;M=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.METERS:K=20;S=mxConstants.PIXELS_PER_MM;M=[5,3,3,3,3,6,3,3,3,3,10,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:K=.5>=B||4<=B?8:16,S=mxConstants.PIXELS_PER_INCH/K,M=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var R=S;2<=B?R=S/(2*Math.floor(B/2)):.5>=B&&(R=S*Math.floor(1/B/2)*(O.unit==mxConstants.MILLIMETERS?2:1));S=null;E=C?Math.min(I+(p?E.height:E.width),p?+c.height:c.width):p?c.height:c.width;if(C)if(f.fillStyle=J.outBkgClr,p){var T=I-L;0<T&&f.fillRect(0,L,L,T);E<c.height&&f.fillRect(0,E,L,c.height)}else T=I-L,0<T&&f.fillRect(L,0,T,L),E<c.width&&f.fillRect(E,0,c.width,L);f.fillStyle=J.fontClr;for(C=C?I:I%(R*B);C<=E;C+=R*B)if(T=Math.round((C-I)/B/R),!(C<L||T==S)){S=T;var v=null;0==T%K&&(v=O.formatText(U+T*R)+"");p?n(L-M[Math.abs(T)%K],C,L,C,v):n(C,L-M[Math.abs(T)%K],C,L,v)}f.lineWidth=1;n(p?0:L,p?L:0,L,L);f.fillStyle=J.cornerClr;f.fillRect(0,0,L,L)},+t=-1,u=function(){null!=y?(null!=G&&G(t),t=y(q)):q()};this.drawRuler=u;this.sizeListener=l=A(function(){var B=k.container;p?(B=B.offsetHeight+L,c.height!=B&&(c.height=B,Q.style.height=B+"px",u())):(B=B.offsetWidth+L,c.width!=B&&(c.width=B,Q.style.width=B+"px",u()))},10);this.pageListener=function(){u()};this.scrollListener=g=A(function(){var B=p?k.container.scrollTop:k.container.scrollLeft;O.lastScroll!=B&&(O.lastScroll=B,u())},10);this.unitListener=function(B,E){O.setUnit(E.getProperty("unit"))};+k.addListener(mxEvent.SIZE,l);k.container.addEventListener("scroll",g);k.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(B){J=B;Q.style.background=J.bkgClr;q()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(B,E,I,C){if(p&&4<B.height||!p&&4<B.width){if(null!=O.guidePart)try{f.putImageData(O.guidePart.imgData1,+O.guidePart.x1,O.guidePart.y1),f.putImageData(O.guidePart.imgData2,O.guidePart.x2,O.guidePart.y2),f.putImageData(O.guidePart.imgData3,O.guidePart.x3,O.guidePart.y3)}catch(z){}var U=O.origGuideMove.apply(this,arguments);try{f.lineWidth=.5;f.strokeStyle=J.guideClr;f.setLineDash([2]);if(p){var K=B.y+U.y+L-this.graph.container.scrollTop;var S=0;var M=K+B.height/2;var R=L/2;var T=K+B.height;var v=0;var d=f.getImageData(S,K-1,L,3);n(S,K,L,K);K--;var m=f.getImageData(R,M-1,L,3);n(R,M,L,M);M--;var r=f.getImageData(v,+T-1,L,3);n(v,T,L,T);T--}else K=0,S=B.x+U.x+L-this.graph.container.scrollLeft,M=L/2,R=S+B.width/2,T=0,v=S+B.width,d=f.getImageData(S-1,K,3,L),n(S,K,S,L),S--,m=f.getImageData(R-1,M,3,L),n(R,M,R,L),R--,r=f.getImageData(v-1,T,3,L),n(v,T,v,L),v--;if(null==O.guidePart||O.guidePart.x1!=S||O.guidePart.y1!=K)O.guidePart={imgData1:d,x1:S,y1:K,imgData2:m,x2:R,y2:M,imgData3:r,x3:v,y3:T}}catch(z){}}else U=O.origGuideMove.apply(this,arguments);return U};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=+function(){var B=O.origGuideDestroy.apply(this,arguments);if(null!=O.guidePart)try{f.putImageData(O.guidePart.imgData1,O.guidePart.x1,O.guidePart.y1),f.putImageData(O.guidePart.imgData2,O.guidePart.x2,O.guidePart.y2),f.putImageData(O.guidePart.imgData3,O.guidePart.x3,O.guidePart.y3),O.guidePart=null}catch(E){}return B}}mxRuler.prototype.RULER_THICKNESS=14;mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(b){this.unit=b;this.drawRuler()};mxRuler.prototype.formatText=function(b){switch(this.unit){case mxConstants.POINTS:return Math.round(b);case mxConstants.MILLIMETERS:return(b/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.METERS:return(b/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(b/mxConstants.PIXELS_PER_INCH).toFixed(2)}};mxRuler.prototype.destroy=function(){this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.graph.removeListener(this.sizeListener);this.graph.container.removeEventListener("scroll",this.scrollListener);this.graph.view.removeListener(this.unitListener);this.ui.removeListener(this.pageListener);null!=this.container&&this.container.parentNode.removeChild(this.container)};function mxDualRuler(b,l){var p=new mxPoint(mxRuler.prototype.RULER_THICKNESS,mxRuler.prototype.RULER_THICKNESS);this.editorUiGetDiagContOffset=b.getDiagramContainerOffset;b.getDiagramContainerOffset=function(){return p};this.editorUiRefresh=b.refresh;this.ui=b;this.origGuideMove=mxGuide.prototype.move;this.origGuideDestroy=mxGuide.prototype.destroy;this.vRuler=new mxRuler(b,l,!0);this.hRuler=new mxRuler(b,l,!1,!0);l=mxUtils.bind(this,function(g){var x=!1;mxEvent.addGestureListeners(g,mxUtils.bind(this,-function(B){x=null!=b.currentMenu;mxEvent.consume(B)}),null,mxUtils.bind(this,function(B){if(b.editor.graph.isEnabled()&&!b.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(B)||mxEvent.isPopupTrigger(B))){b.editor.graph.popupMenuHandler.hideMenu();b.hideCurrentMenu();if(!mxEvent.isTouchEvent(B)||!x){var z=new mxPopupMenu(mxUtils.bind(this,function(M,L){b.menus.addMenuItems(M,["points","inches","millimeters","meters"],L)}));z.smartSeparators=!0;z.showDisabled=!0;z.autoExpand=!0;z.hideMenu=mxUtils.bind(this,-function(){mxPopupMenu.prototype.hideMenu.apply(z,arguments);b.resetCurrentMenu();z.destroy()});var F=mxEvent.getClientX(B),K=mxEvent.getClientY(B);z.popup(F,K,null,B);b.setCurrentMenu(z,g)}mxEvent.consume(B)}}))});l(this.hRuler.container);l(this.vRuler.container);this.vRuler.drawRuler();this.hRuler.drawRuler()}mxDualRuler.prototype.updateStyle=function(){this.vRuler.updateStyle();this.hRuler.updateStyle();this.vRuler.drawRuler();this.hRuler.drawRuler()};-mxDualRuler.prototype.setUnit=function(b){this.vRuler.setUnit(b);this.hRuler.setUnit(b)};mxDualRuler.prototype.setStyle=function(b){this.vRuler.setStyle(b);this.hRuler.setStyle(b)};mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(b){var l=null!=b.view&&null!=b.view.canvas?b.view.canvas.ownerSVGElement:null;if(null!=b.container&&null!=l){b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.stopDrawing()}));var p=mxFreehand.prototype.MILD_SMOOTHING,g=null,x=[],B,z=[],F,K=!1,M=!0,L=!0,Q=!0,c=!0,f=[],k=!1,n=!1,q=!1,t="default",u={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},y=!0;this.setClosedPath=function(N){K=N};this.setAutoClose=function(N){M=N};this.setAutoInsert=-function(N){L=N};this.setAutoScroll=function(N){Q=N};this.setOpenFill=function(N){c=N};this.setStopClickEnabled=function(N){n=N};this.setSelectInserted=function(N){q=N};this.setSmoothing=function(N){p=N};this.getSmoothing=function(){return p};this.setPerfectFreehandMode=function(N){y=N};this.isPerfectFreehandMode=function(){return y};this.setBrushSize=function(N){u.size=N};this.getBrushSize=function(){return u.size};var E=function(N){k=N;b.getRubberband().setEnabled(!N);b.graphHandler.setSelectEnabled(!N);-b.graphHandler.setMoveEnabled(!N);b.panningHandler.setPinchEnabled(!N);N?b.container.classList.add("geFreehandMode"):b.container.classList.remove("geFreehandMode");b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){E(!0)};this.isDrawing=function(){return k};this.isActive=function(){return null!=g};var I=mxUtils.bind(this,function(N){if(g){var R=F.length,T=n&&0<z.length&&null!=F&&2>F.length;T||z.push.apply(z,F);F=[];z.push(null);x.push(g);g=null;(T||L)&&this.stopDrawing();-L&&(!T||2<=R)&&this.startDrawing();mxEvent.consume(N)}}),C=new mxCell;C.edge=!0;this.getStrokeColor=function(N){var R=null!=t?t:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(C),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=R||N||(R=b.shapeForegroundColor);return R};this.setStrokeColor=function(N){t=N};this.createStyle=function(N){var R=";fillColor=none;";y&&(R=";lineShape=1;");R+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE+-"="+N+R};this.stopDrawing=function(){if(0<x.length){if(y){for(var N=[],R=0;R<z.length;R++)null!=z[R]&&N.push([z[R].x,z[R].y]);N=PerfectFreehand.getStroke(N,u);z=[];for(R=0;R<N.length;R++)z.push({x:N[R][0],y:N[R][1]});z.push(null)}N=z[0].x;var T=z[0].x,v=z[0].y,d=z[0].y;for(R=1;R<z.length;R++)null!=z[R]&&(N=Math.max(N,z[R].x),T=Math.min(T,z[R].x),v=Math.max(v,z[R].y),d=Math.min(d,z[R].y));N-=T;v-=d;if(0<N&&0<v){var m=100/N,r=100/v;z.map(function(P){if(null==P)return P;P.x=(P.x-T)*m;P.y=(P.y-d)*r;return P});-var A='<shape strokewidth="inherit"><foreground>',D=0;for(R=0;R<z.length;R++){var G=z[R];if(null==G){G=!1;D=z[D];var O=z[R-1];!K&&M&&(G=D.x-O.x,O=D.y-O.y,G=Math.sqrt(G*G+O*O)<=b.tolerance);if(K||G)A+='<line x="'+D.x.toFixed(2)+'" y="'+D.y.toFixed(2)+'"/>';A+="</path>"+(c||K||G?"<fillstroke/>":"<stroke/>");D=R+1}else A=R==D?A+('<path><move x="'+G.x.toFixed(2)+'" y="'+G.y.toFixed(2)+'"/>'):A+('<line x="'+G.x.toFixed(2)+'" y="'+G.y.toFixed(2)+'"/>')}A+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){R=-this.createStyle("stencil("+Graph.compress(A)+")");A=b.view.scale;D=b.view.translate;R=new mxCell("",new mxGeometry(T/A-D.x,d/A-D.y,N/A,v/A),R);R.vertex=1;b.model.beginUpdate();try{R=b.addCell(R),b.fireEvent(new mxEventObject("cellsInserted","cells",[R])),b.fireEvent(new mxEventObject("freehandInserted","cell",R))}finally{b.model.endUpdate()}q&&b.setSelectionCells([R])}}for(R=0;R<x.length;R++)x[R].parentNode.removeChild(x[R]);g=null;x=[];z=[]}E(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,-function(N,R){k&&R.getProperty("event").consume()}));b.addListener(mxEvent.GESTURE,mxUtils.bind(this,function(N,R){k&&mxEvent.consume(R.getProperty("event"))}));b.addMouseListener({mouseDown:mxUtils.bind(this,function(N,R){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(N=R.getEvent(),k&&!mxEvent.isPopupTrigger(N)&&!mxEvent.isMiddleMouseButton(N)&&!mxEvent.isMultiTouchEvent(N))){var T=parseFloat(b.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1);T=Math.max(1,T*b.view.scale);var v=this.getStrokeColor();-g=document.createElementNS("http://www.w3.org/2000/svg","path");g.setAttribute("fill",y?v:"none");g.setAttribute("pointer-events","none");g.setAttribute("stroke",v);g.setAttribute("stroke-width",T);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(v=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",v=v.split(" ").map(function(d){return parseFloat(d)*T}).join(" "),g.setAttribute("stroke-dasharray",v));f=[];N=U(N);J(N);B="M"+N.x+" "+N.y;z.push(N);F=[];g.setAttribute("d",y?PerfectFreehand.getSvgPathFromStroke([[N.x,-N.y]],u):B);l.appendChild(g);R.consume()}}),mouseMove:mxUtils.bind(this,function(N,R){if(null!=g&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){N=R.getEvent();N=U(N);J(N);var T=S(0);if(T)if(z.push(T),y){var v=[];for(T=0;T<z.length;T++)v.push([z[T].x,z[T].y]);F=[];for(var d=2;d<f.length;d+=2)T=S(d),v.push([T.x,T.y]),F.push(T);g.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(v,u))}else{B+=" L"+T.x+" "+T.y;v="";F=[];for(d=2;d<f.length;d+=2)T=S(d),v+=" L"+T.x+" "+T.y,F.push(T);g.setAttribute("d",-B+v)}Q&&(T=b.view.translate,b.scrollRectToVisible((new mxRectangle(N.x-T.x,N.y-T.y)).grow(20)));R.consume()}}),mouseUp:mxUtils.bind(this,function(N,R){null!=g&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(I(R.getEvent()),R.consume())})});var U=function(N){return mxUtils.convertPoint(b.container,mxEvent.getClientX(N),mxEvent.getClientY(N))},J=function(N){for(f.push(N);f.length>p;)f.shift()},S=function(N){var R=f.length;if(1===R%2||R>=p){var T=0,v=0,d,m=0;for(d=N;d<R;d++)m++,N=f[d],T+=N.x,-v+=N.y;return{x:T/m,y:v/m}}return null}}}mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20;DrawioUser=function(b,l,p,g,x){this.id=b;this.email=l;this.displayName=p;this.pictureUrl=g;this.locale=x};DrawioComment=function(b,l,p,g,x,B,z){this.file=b;this.id=l;this.content=p;this.modifiedDate=g;this.createdDate=x;this.isResolved=B;this.user=z;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,l,p,g,x){l()};DrawioComment.prototype.editComment=function(b,l,p){l()};DrawioComment.prototype.deleteComment=function(b,l){b()};Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;+function(A){x=null!=b.currentMenu;mxEvent.consume(A)}),null,mxUtils.bind(this,function(A){if(b.editor.graph.isEnabled()&&!b.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(A)||mxEvent.isPopupTrigger(A))){b.editor.graph.popupMenuHandler.hideMenu();b.hideCurrentMenu();if(!mxEvent.isTouchEvent(A)||!x){var y=new mxPopupMenu(mxUtils.bind(this,function(O,J){b.menus.addMenuItems(O,["points","inches","millimeters","meters"],J)}));y.smartSeparators=!0;y.showDisabled=!0;y.autoExpand=!0;y.hideMenu=mxUtils.bind(this,+function(){mxPopupMenu.prototype.hideMenu.apply(y,arguments);b.resetCurrentMenu();y.destroy()});var G=mxEvent.getClientX(A),L=mxEvent.getClientY(A);y.popup(G,L,null,A);b.setCurrentMenu(y,g)}mxEvent.consume(A)}}))});l(this.hRuler.container);l(this.vRuler.container);this.vRuler.drawRuler();this.hRuler.drawRuler()}mxDualRuler.prototype.updateStyle=function(){this.vRuler.updateStyle();this.hRuler.updateStyle();this.vRuler.drawRuler();this.hRuler.drawRuler()};+mxDualRuler.prototype.setUnit=function(b){this.vRuler.setUnit(b);this.hRuler.setUnit(b)};mxDualRuler.prototype.setStyle=function(b){this.vRuler.setStyle(b);this.hRuler.setStyle(b)};mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(b){var l=null!=b.view&&null!=b.view.canvas?b.view.canvas.ownerSVGElement:null;if(null!=b.container&&null!=l){b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.stopDrawing()}));var p=mxFreehand.prototype.MILD_SMOOTHING,g=null,x=[],A,y=[],G,L=!1,O=!0,J=!0,Q=!0,c=!0,f=[],k=!1,n=!1,q=!1,t="default",u={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},B=!0;this.setClosedPath=function(M){L=M};this.setAutoClose=function(M){O=M};this.setAutoInsert=+function(M){J=M};this.setAutoScroll=function(M){Q=M};this.setOpenFill=function(M){c=M};this.setStopClickEnabled=function(M){n=M};this.setSelectInserted=function(M){q=M};this.setSmoothing=function(M){p=M};this.getSmoothing=function(){return p};this.setPerfectFreehandMode=function(M){B=M};this.isPerfectFreehandMode=function(){return B};this.setBrushSize=function(M){u.size=M};this.getBrushSize=function(){return u.size};var E=function(M){k=M;b.getRubberband().setEnabled(!M);b.graphHandler.setSelectEnabled(!M);+b.graphHandler.setMoveEnabled(!M);b.panningHandler.setPinchEnabled(!M);M?b.container.classList.add("geFreehandMode"):b.container.classList.remove("geFreehandMode");b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){E(!0)};this.isDrawing=function(){return k};this.isActive=function(){return null!=g};var I=mxUtils.bind(this,function(M){if(g){var R=G.length,T=n&&0<y.length&&null!=G&&2>G.length;T||y.push.apply(y,G);G=[];y.push(null);x.push(g);g=null;(T||J)&&this.stopDrawing();+J&&(!T||2<=R)&&this.startDrawing();mxEvent.consume(M)}}),C=new mxCell;C.edge=!0;this.getStrokeColor=function(M){var R=null!=t?t:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(C),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=R||M||(R=b.shapeForegroundColor);return R};this.setStrokeColor=function(M){t=M};this.createStyle=function(M){var R=";fillColor=none;";B&&(R=";lineShape=1;");R+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE++"="+M+R};this.stopDrawing=function(){if(0<x.length){if(B){for(var M=[],R=0;R<y.length;R++)null!=y[R]&&M.push([y[R].x,y[R].y]);M=PerfectFreehand.getStroke(M,u);y=[];for(R=0;R<M.length;R++)y.push({x:M[R][0],y:M[R][1]});y.push(null)}M=y[0].x;var T=y[0].x,v=y[0].y,d=y[0].y;for(R=1;R<y.length;R++)null!=y[R]&&(M=Math.max(M,y[R].x),T=Math.min(T,y[R].x),v=Math.max(v,y[R].y),d=Math.min(d,y[R].y));M-=T;v-=d;if(0<M&&0<v){var m=100/M,r=100/v;y.map(function(P){if(null==P)return P;P.x=(P.x-T)*m;P.y=(P.y-d)*r;return P});+var z='<shape strokewidth="inherit"><foreground>',D=0;for(R=0;R<y.length;R++){var F=y[R];if(null==F){F=!1;D=y[D];var N=y[R-1];!L&&O&&(F=D.x-N.x,N=D.y-N.y,F=Math.sqrt(F*F+N*N)<=b.tolerance);if(L||F)z+='<line x="'+D.x.toFixed(2)+'" y="'+D.y.toFixed(2)+'"/>';z+="</path>"+(c||L||F?"<fillstroke/>":"<stroke/>");D=R+1}else z=R==D?z+('<path><move x="'+F.x.toFixed(2)+'" y="'+F.y.toFixed(2)+'"/>'):z+('<line x="'+F.x.toFixed(2)+'" y="'+F.y.toFixed(2)+'"/>')}z+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){R=+this.createStyle("stencil("+Graph.compress(z)+")");z=b.view.scale;D=b.view.translate;R=new mxCell("",new mxGeometry(T/z-D.x,d/z-D.y,M/z,v/z),R);R.vertex=1;b.model.beginUpdate();try{R=b.addCell(R),b.fireEvent(new mxEventObject("cellsInserted","cells",[R])),b.fireEvent(new mxEventObject("freehandInserted","cell",R))}finally{b.model.endUpdate()}q&&b.setSelectionCells([R])}}for(R=0;R<x.length;R++)x[R].parentNode.removeChild(x[R]);g=null;x=[];y=[]}E(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,+function(M,R){k&&R.getProperty("event").consume()}));b.addListener(mxEvent.GESTURE,mxUtils.bind(this,function(M,R){k&&mxEvent.consume(R.getProperty("event"))}));b.addMouseListener({mouseDown:mxUtils.bind(this,function(M,R){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(M=R.getEvent(),k&&!mxEvent.isPopupTrigger(M)&&!mxEvent.isMiddleMouseButton(M)&&!mxEvent.isMultiTouchEvent(M))){var T=parseFloat(b.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1);T=Math.max(1,T*b.view.scale);var v=this.getStrokeColor();+g=document.createElementNS("http://www.w3.org/2000/svg","path");g.setAttribute("fill",B?v:"none");g.setAttribute("pointer-events","none");g.setAttribute("stroke",v);g.setAttribute("stroke-width",T);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(v=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",v=v.split(" ").map(function(d){return parseFloat(d)*T}).join(" "),g.setAttribute("stroke-dasharray",v));f=[];M=U(M);K(M);A="M"+M.x+" "+M.y;y.push(M);G=[];g.setAttribute("d",B?PerfectFreehand.getSvgPathFromStroke([[M.x,+M.y]],u):A);l.appendChild(g);R.consume()}}),mouseMove:mxUtils.bind(this,function(M,R){if(null!=g&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){M=R.getEvent();M=U(M);K(M);var T=S(0);if(T)if(y.push(T),B){var v=[];for(T=0;T<y.length;T++)v.push([y[T].x,y[T].y]);G=[];for(var d=2;d<f.length;d+=2)T=S(d),v.push([T.x,T.y]),G.push(T);g.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(v,u))}else{A+=" L"+T.x+" "+T.y;v="";G=[];for(d=2;d<f.length;d+=2)T=S(d),v+=" L"+T.x+" "+T.y,G.push(T);g.setAttribute("d",+A+v)}Q&&(T=b.view.translate,b.scrollRectToVisible((new mxRectangle(M.x-T.x,M.y-T.y)).grow(20)));R.consume()}}),mouseUp:mxUtils.bind(this,function(M,R){null!=g&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(I(R.getEvent()),R.consume())})});var U=function(M){return mxUtils.convertPoint(b.container,mxEvent.getClientX(M),mxEvent.getClientY(M))},K=function(M){for(f.push(M);f.length>p;)f.shift()},S=function(M){var R=f.length;if(1===R%2||R>=p){var T=0,v=0,d,m=0;for(d=M;d<R;d++)m++,M=f[d],T+=M.x,+v+=M.y;return{x:T/m,y:v/m}}return null}}}mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20;DrawioUser=function(b,l,p,g,x){this.id=b;this.email=l;this.displayName=p;this.pictureUrl=g;this.locale=x};DrawioComment=function(b,l,p,g,x,A,y){this.file=b;this.id=l;this.content=p;this.modifiedDate=g;this.createdDate=x;this.isResolved=A;this.user=y;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,l,p,g,x){l()};DrawioComment.prototype.editComment=function(b,l,p){l()};DrawioComment.prototype.deleteComment=function(b,l){b()};Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;Graph.prototype.defaultThemes.darkTheme=Graph.prototype.defaultThemes["default-style2"];function GifEncoder(b,l){this.width=b;this.height=l;this.delay=100;this.repeat=0;this.transparent=!1;this.dispose=2;this.out=[];this.frameCount=0;this.started=!1}GifEncoder.prototype.setDelay=function(b){this.delay=Math.max(10,Math.round(b))};GifEncoder.prototype.setRepeat=function(b){this.repeat=b};GifEncoder.prototype.setTransparent=function(b){this.transparent=b};-GifEncoder.prototype.addFrame=function(b){var l=b.getContext("2d").getImageData(0,0,this.width,this.height).data,p=l.length/4;if(this.started){b=this.globalPalette;var g=this.globalTransparentIndex;var x=new Uint8Array(p);for(var B=0;B<p;B++){var z=4*B;x[B]=this.transparent&&128>l[z+3]?g:GifEncoder.findClosest(b,l[z],l[z+1],l[z+2],g)}}else l=GifEncoder.quantize(l,256,this.transparent),b=l.palette,x=l.indexedPixels,g=l.transparentIndex,this.globalPalette=b,this.globalTransparentIndex=g,this.started=+GifEncoder.prototype.addFrame=function(b){var l=b.getContext("2d").getImageData(0,0,this.width,this.height).data,p=l.length/4;if(this.started){b=this.globalPalette;var g=this.globalTransparentIndex;var x=new Uint8Array(p);for(var A=0;A<p;A++){var y=4*A;x[A]=this.transparent&&128>l[y+3]?g:GifEncoder.findClosest(b,l[y],l[y+1],l[y+2],g)}}else l=GifEncoder.quantize(l,256,this.transparent),b=l.palette,x=l.indexedPixels,g=l.transparentIndex,this.globalPalette=b,this.globalTransparentIndex=g,this.started=!0,this.writeHeader(),this.writeLogicalScreenDescriptor(b),this.writeGlobalColorTable(b),0<=this.repeat&&this.writeNetscapeExtension();this.writeGraphicControlExtension(g);this.writeImageDescriptor();this.writeImageData(x,b);this.frameCount++};GifEncoder.prototype.finish=function(){if(!this.started)return null;this.out.push(59);return new Blob([new Uint8Array(this.out)],{type:"image/gif"})};GifEncoder.prototype.writeHeader=function(){this.writeString("GIF89a")};GifEncoder.prototype.writeLogicalScreenDescriptor=function(b){this.writeShort(this.width);this.writeShort(this.height);b=GifEncoder.colorTableSizeFor(b.length);this.out.push(240|b);this.out.push(0);this.out.push(0)};GifEncoder.prototype.writeGlobalColorTable=function(b){for(var l=GifEncoder.colorTableEntries(b.length),p=0;p<l;p++)p<b.length?(this.out.push(b[p][0]),this.out.push(b[p][1]),this.out.push(b[p][2])):(this.out.push(0),this.out.push(0),this.out.push(0))};GifEncoder.prototype.writeNetscapeExtension=function(){this.out.push(33);this.out.push(255);this.out.push(11);this.writeString("NETSCAPE2.0");this.out.push(3);this.out.push(1);this.writeShort(this.repeat);this.out.push(0)};GifEncoder.prototype.writeGraphicControlExtension=function(b){this.out.push(33);this.out.push(249);this.out.push(4);var l=0<=b;this.out.push(this.dispose<<2|(l?1:0));this.writeShort(Math.round(this.delay/10));this.out.push(l?b:0);this.out.push(0)};GifEncoder.prototype.writeImageDescriptor=function(){this.out.push(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);this.out.push(0)};GifEncoder.prototype.writeImageData=function(b,l){l=GifEncoder.colorDepthFor(l.length);l=Math.max(2,l);this.out.push(l);b=GifEncoder.lzwEncode(b,l);for(l=0;l<b.length;){var p=Math.min(255,b.length-l);this.out.push(p);for(var g=0;g<p;g++)this.out.push(b[l+g]);l+=p}this.out.push(0)};GifEncoder.prototype.writeShort=function(b){this.out.push(b&255);this.out.push(b>>8&255)};GifEncoder.prototype.writeString=function(b){for(var l=0;l<b.length;l++)this.out.push(b.charCodeAt(l))};GifEncoder.colorTableSizeFor=function(b){for(var l=0;2<<l<b;)l++;return Math.min(l,7)};GifEncoder.colorTableEntries=function(b){for(var l=2;l<b;)l*=2;return Math.min(l,256)};GifEncoder.colorDepthFor=function(b){for(var l=1;1<<l<b;)l++;return l};-GifEncoder.quantize=function(b,l,p){var g=b.length/4,x=-1;p&&--l;for(var B=[],z=1E5<g?Math.floor(g/5E4):1,F=0;F<g;F+=z){var K=4*F;128>b[K+3]||B.push([b[K],b[K+1],b[K+2]])}B.length<=l?(z=GifEncoder.uniqueColors(B),z.length>l&&(z=GifEncoder.medianCut(B,l))):z=GifEncoder.medianCut(B,l);for(;2>z.length;)z.push([0,0,0]);p&&(x=z.length,z.push([0,0,0]));l=new Uint8Array(g);for(F=0;F<g;F++)K=4*F,l[F]=p&&128>b[K+3]?x:GifEncoder.findClosest(z,b[K],b[K+1],b[K+2],x);return{palette:z,indexedPixels:l,transparentIndex:x}};+GifEncoder.quantize=function(b,l,p){var g=b.length/4,x=-1;p&&--l;for(var A=[],y=1E5<g?Math.floor(g/5E4):1,G=0;G<g;G+=y){var L=4*G;128>b[L+3]||A.push([b[L],b[L+1],b[L+2]])}A.length<=l?(y=GifEncoder.uniqueColors(A),y.length>l&&(y=GifEncoder.medianCut(A,l))):y=GifEncoder.medianCut(A,l);for(;2>y.length;)y.push([0,0,0]);p&&(x=y.length,y.push([0,0,0]));l=new Uint8Array(g);for(G=0;G<g;G++)L=4*G,l[G]=p&&128>b[L+3]?x:GifEncoder.findClosest(y,b[L],b[L+1],b[L+2],x);return{palette:y,indexedPixels:l,transparentIndex:x}};GifEncoder.uniqueColors=function(b){for(var l={},p=[],g=0;g<b.length;g++){var x=b[g][0]<<16|b[g][1]<<8|b[g][2];null==l[x]&&(l[x]=!0,p.push(b[g]))}return p};-GifEncoder.medianCut=function(b,l){if(0==b.length)return[[0,0,0]];for(b=[b];b.length<l;){for(var p=-1,g=0,x=0;x<b.length;x++)if(!(1>=b[x].length)){var B=GifEncoder.colorRange(b[x]);B.maxRange>p&&(p=B.maxRange,g=x)}if(0>=p)break;x=b[g];B=GifEncoder.colorRange(x);x.sort(function(M,L){return M[B.channel]-L[B.channel]});p=Math.floor(x.length/2);b.splice(g,1,x.slice(0,p),x.slice(p))}l=[];for(x=0;x<b.length;x++){g=b[x];for(var z=p=0,F=0,K=0;K<g.length;K++)p+=g[K][0],z+=g[K][1],F+=g[K][2];l.push([Math.round(p/-g.length),Math.round(z/g.length),Math.round(F/g.length)])}return l};GifEncoder.colorRange=function(b){for(var l=255,p=0,g=255,x=0,B=255,z=0,F=0;F<b.length;F++){var K=b[F];K[0]<l&&(l=K[0]);K[0]>p&&(p=K[0]);K[1]<g&&(g=K[1]);K[1]>x&&(x=K[1]);K[2]<B&&(B=K[2]);K[2]>z&&(z=K[2])}b=p-l;g=x-g;B=z-B;return b>=g&&b>=B?{channel:0,maxRange:b}:g>=b&&g>=B?{channel:1,maxRange:g}:{channel:2,maxRange:B}};-GifEncoder.findClosest=function(b,l,p,g,x){for(var B=Infinity,z=0,F=0;F<b.length;F++)if(F!==x){var K=l-b[F][0],M=p-b[F][1],L=g-b[F][2];K=K*K+M*M+L*L;K<B&&(B=K,z=F)}return z};-GifEncoder.lzwEncode=function(b,l){for(var p=1<<l,g=p+1,x=l+1,B=g+1,z=1<<x,F={},K=0;K<p;K++)F[String(K)]=K;var M=0,L=0,Q=[],c=function(n){M|=n<<L;for(L+=x;8<=L;)Q.push(M&255),M>>=8,L-=8};c(p);if(0==b.length)return c(g),0<L&&Q.push(M&255),new Uint8Array(Q);var f=String(b[0]);for(K=1;K<b.length;K++){var k=f+","+b[K];if(null!=F[k])f=k;else{c(F[f]);if(4096>B)F[k]=B,B++,B>z&&12>x&&(x++,z=1<<x);else{c(p);F={};for(B=0;B<p;B++)F[String(B)]=B;x=l+1;B=g+1;z=1<<x}f=String(b[K])}}c(F[f]);c(g);0<L&&Q.push(M&255);+GifEncoder.medianCut=function(b,l){if(0==b.length)return[[0,0,0]];for(b=[b];b.length<l;){for(var p=-1,g=0,x=0;x<b.length;x++)if(!(1>=b[x].length)){var A=GifEncoder.colorRange(b[x]);A.maxRange>p&&(p=A.maxRange,g=x)}if(0>=p)break;x=b[g];A=GifEncoder.colorRange(x);x.sort(function(O,J){return O[A.channel]-J[A.channel]});p=Math.floor(x.length/2);b.splice(g,1,x.slice(0,p),x.slice(p))}l=[];for(x=0;x<b.length;x++){g=b[x];for(var y=p=0,G=0,L=0;L<g.length;L++)p+=g[L][0],y+=g[L][1],G+=g[L][2];l.push([Math.round(p/+g.length),Math.round(y/g.length),Math.round(G/g.length)])}return l};GifEncoder.colorRange=function(b){for(var l=255,p=0,g=255,x=0,A=255,y=0,G=0;G<b.length;G++){var L=b[G];L[0]<l&&(l=L[0]);L[0]>p&&(p=L[0]);L[1]<g&&(g=L[1]);L[1]>x&&(x=L[1]);L[2]<A&&(A=L[2]);L[2]>y&&(y=L[2])}b=p-l;g=x-g;A=y-A;return b>=g&&b>=A?{channel:0,maxRange:b}:g>=b&&g>=A?{channel:1,maxRange:g}:{channel:2,maxRange:A}};+GifEncoder.findClosest=function(b,l,p,g,x){for(var A=Infinity,y=0,G=0;G<b.length;G++)if(G!==x){var L=l-b[G][0],O=p-b[G][1],J=g-b[G][2];L=L*L+O*O+J*J;L<A&&(A=L,y=G)}return y};+GifEncoder.lzwEncode=function(b,l){for(var p=1<<l,g=p+1,x=l+1,A=g+1,y=1<<x,G={},L=0;L<p;L++)G[String(L)]=L;var O=0,J=0,Q=[],c=function(n){O|=n<<J;for(J+=x;8<=J;)Q.push(O&255),O>>=8,J-=8};c(p);if(0==b.length)return c(g),0<J&&Q.push(O&255),new Uint8Array(Q);var f=String(b[0]);for(L=1;L<b.length;L++){var k=f+","+b[L];if(null!=G[k])f=k;else{c(G[f]);if(4096>A)G[k]=A,A++,A>y&&12>x&&(x++,y=1<<x);else{c(p);G={};for(A=0;A<p;A++)G[String(A)]=A;x=l+1;A=g+1;y=1<<x}f=String(b[L])}}c(G[f]);c(g);0<J&&Q.push(O&255);return new Uint8Array(Q)};function AnimatedGifExport(b){this.editorUi=b}-AnimatedGifExport.prototype.doExport=function(b,l,p){var g=this.editorUi.editor.graph,x=this.editorUi.editor;b=b||{};var B=b.fps||15,z=b.scale||1,F=b.border||0,K=b.transparent||!1,M=null!=b.repeat?b.repeat:0,L=K?null:null!=b.background&&b.background!=mxConstants.NONE?b.background:"light-dark(#ffffff,"+Editor.darkColor+")",Q=b.theme||null;try{var c=g.getSvg(L,z,F,!0,null,!0,null,null,null,g.shadowVisible,null,Q),f=AnimatedGifExport.findAnimatedPaths(c);if(0==f.length)null!=p&&p(Error(mxResources.get("noAnimationsInDiagram")));-else{var k=b.duration||AnimatedGifExport.detectDuration(f)||1E3,n=Math.max(2,Math.round(B*k/1E3));AnimatedGifExport.removeAnimationCss(c,f);x.convertImages(c,mxUtils.bind(this,function(q){try{this.renderFrames(q,f,n,B,z,K,M,L,Q,l,p)}catch(t){null!=p&&p(t)}}),null,x.createImageUrlConverter())}}catch(q){null!=p&&p(q)}};-AnimatedGifExport.prototype.renderFrames=function(b,l,p,g,x,B,z,F,K,M,L){var Q=parseInt(b.getAttribute("width")),c=parseInt(b.getAttribute("height"));if(isNaN(Q)||isNaN(c)||0>=Q||0>=c)null!=L&&L(Error("Invalid SVG dimensions"));else{var f=this.editorUi.editor.getMaxCanvasScale(Q,c,1);1>f&&(Q=Math.ceil(Q*f),c=Math.ceil(c*f));var k=new GifEncoder(Q,c);k.setDelay(Math.round(1E3/g));k.setRepeat(z);k.setTransparent(B);var n=null;null!=F&&(g=mxUtils.getLightDarkColor(F),n="dark"==K&&"none"!=this.editorUi.editor.graph.getAdaptiveColors()?-g.dark:g.light);var q=0,t=mxUtils.bind(this,function(){if(q>=p)try{var u=k.finish();M(u)}catch(U){null!=L&&L(U)}else{u=1<p?q/p:0;for(var y=0;y<l.length;y++){var E=l[y];if("alternate"===E.direction||"alternate-reverse"===E.direction){var I=.5>u?2*u:2*(1-u);I="alternate"===E.direction?E.dashSum*(1-I):E.dashSum*I}else I="reverse"===E.direction?E.dashSum*u:E.dashSum*(1-u);E.node.style.strokeDashoffset=I}u=Editor.createSvgDataUri(mxUtils.getXml(b));var C=new Image;C.onload=function(){try{var U=document.createElement("canvas");-U.width=Q;U.height=c;var J=U.getContext("2d");null!=n&&(J.fillStyle=n,J.fillRect(0,0,Q,c));1>f&&J.scale(f,f);J.drawImage(C,0,0);k.addFrame(U);q++;setTimeout(t,0)}catch(S){null!=L&&L(S)}};C.onerror=function(){null!=L&&L(Error("Failed to render SVG frame"))};C.src=u}});t()}};-AnimatedGifExport.findAnimatedPaths=function(b){var l=[];b=b.getElementsByTagName("path");for(var p=0;p<b.length;p++){var g=b[p],x=g.style.animation||g.getAttribute("style");if(null!=x&&0<=x.indexOf("ge-flow-animation")){var B=parseFloat(g.style.strokeDashoffset);isNaN(B)&&(B=parseFloat(g.getAttribute("stroke-dashoffset")));if(!isNaN(B)&&0<B){var z="normal";"string"===typeof x&&(0<=x.indexOf("alternate-reverse")?z="alternate-reverse":0<=x.indexOf("alternate")?z="alternate":0<=x.indexOf("reverse")&&-(z="reverse"));var F=500;x="string"===typeof x?x.match(/(\d+)ms/):null;null!=x&&(F=parseInt(x[1]));l.push({node:g,dashSum:B,duration:F,direction:z})}}}return l};AnimatedGifExport.detectDuration=function(b){for(var l=0,p=0;p<b.length;p++)b[p].duration>l&&(l=b[p].duration);return l};+AnimatedGifExport.prototype.doExport=function(b,l,p){var g=this.editorUi.editor.graph,x=this.editorUi.editor;b=b||{};var A=b.fps||15,y=b.scale||1,G=b.border||0,L=b.transparent||!1,O=null!=b.repeat?b.repeat:0,J=L?null:null!=b.background&&b.background!=mxConstants.NONE?b.background:"light-dark(#ffffff,"+Editor.darkColor+")",Q=b.theme||null;try{var c=g.getSvg(J,y,G,!0,null,!0,null,null,null,g.shadowVisible,null,Q),f=AnimatedGifExport.findAnimatedPaths(c);if(0==f.length)null!=p&&p(Error(mxResources.get("noAnimationsInDiagram")));+else{var k=b.duration||AnimatedGifExport.detectDuration(f)||1E3,n=Math.max(2,Math.round(A*k/1E3));AnimatedGifExport.removeAnimationCss(c,f);x.convertImages(c,mxUtils.bind(this,function(q){try{this.renderFrames(q,f,n,A,y,L,O,J,Q,l,p)}catch(t){null!=p&&p(t)}}),null,x.createImageUrlConverter())}}catch(q){null!=p&&p(q)}};+AnimatedGifExport.prototype.renderFrames=function(b,l,p,g,x,A,y,G,L,O,J){var Q=parseInt(b.getAttribute("width")),c=parseInt(b.getAttribute("height"));if(isNaN(Q)||isNaN(c)||0>=Q||0>=c)null!=J&&J(Error("Invalid SVG dimensions"));else{var f=this.editorUi.editor.getMaxCanvasScale(Q,c,1);1>f&&(Q=Math.ceil(Q*f),c=Math.ceil(c*f));var k=new GifEncoder(Q,c);k.setDelay(Math.round(1E3/g));k.setRepeat(y);k.setTransparent(A);var n=null;null!=G&&(g=mxUtils.getLightDarkColor(G),n="dark"==L&&"none"!=this.editorUi.editor.graph.getAdaptiveColors()?+g.dark:g.light);var q=0,t=mxUtils.bind(this,function(){if(q>=p)try{var u=k.finish();O(u)}catch(U){null!=J&&J(U)}else{u=1<p?q/p:0;for(var B=0;B<l.length;B++){var E=l[B];if("alternate"===E.direction||"alternate-reverse"===E.direction){var I=.5>u?2*u:2*(1-u);I="alternate"===E.direction?E.dashSum*(1-I):E.dashSum*I}else I="reverse"===E.direction?E.dashSum*u:E.dashSum*(1-u);E.node.style.strokeDashoffset=I}u=Editor.createSvgDataUri(mxUtils.getXml(b));var C=new Image;C.onload=function(){try{var U=document.createElement("canvas");+U.width=Q;U.height=c;var K=U.getContext("2d");null!=n&&(K.fillStyle=n,K.fillRect(0,0,Q,c));1>f&&K.scale(f,f);K.drawImage(C,0,0);k.addFrame(U);q++;setTimeout(t,0)}catch(S){null!=J&&J(S)}};C.onerror=function(){null!=J&&J(Error("Failed to render SVG frame"))};C.src=u}});t()}};+AnimatedGifExport.findAnimatedPaths=function(b){var l=[];b=b.getElementsByTagName("path");for(var p=0;p<b.length;p++){var g=b[p],x=g.style.animation||g.getAttribute("style");if(null!=x&&0<=x.indexOf("ge-flow-animation")){var A=parseFloat(g.style.strokeDashoffset);isNaN(A)&&(A=parseFloat(g.getAttribute("stroke-dashoffset")));if(!isNaN(A)&&0<A){var y="normal";"string"===typeof x&&(0<=x.indexOf("alternate-reverse")?y="alternate-reverse":0<=x.indexOf("alternate")?y="alternate":0<=x.indexOf("reverse")&&+(y="reverse"));var G=500;x="string"===typeof x?x.match(/(\d+)ms/):null;null!=x&&(G=parseInt(x[1]));l.push({node:g,dashSum:A,duration:G,direction:y})}}}return l};AnimatedGifExport.detectDuration=function(b){for(var l=0,p=0;p<b.length;p++)b[p].duration>l&&(l=b[p].duration);return l};AnimatedGifExport.removeAnimationCss=function(b,l){for(var p=0;p<l.length;p++)l[p].node.style.animation="",l[p].node.style.animationName="";p=b.getElementsByTagName("defs");if(0<p.length)for(b=p[0].getElementsByTagName("style"),p=b.length-1;0<=p;p--)null!=b[p].innerHTML&&0<=b[p].innerHTML.indexOf("ge-flow-animation")&&b[p].parentNode.removeChild(b[p])};var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(g){return g.raw=g};$jscomp.createTemplateTagFirstArgWithRaw=function(g,A){g.raw=A;return g};$jscomp.arrayIteratorImpl=function(g){var A=0;return function(){return A<g.length?{done:!1,value:g[A++]}:{done:!0}}};$jscomp.arrayIterator=function(g){return{next:$jscomp.arrayIteratorImpl(g)}};$jscomp.makeIterator=function(g){var A="undefined"!=typeof Symbol&&Symbol.iterator&&g[Symbol.iterator];return A?A.call(g):$jscomp.arrayIterator(g)};$jscomp.arrayFromIterator=function(g){for(var A,C=[];!(A=g.next()).done;)C.push(A.value);return C};$jscomp.arrayFromIterable=function(g){return g instanceof Array?g:$jscomp.arrayFromIterator($jscomp.makeIterator(g))};$jscomp.owns=function(g,A){return Object.prototype.hasOwnProperty.call(g,A)};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;@@ -21557,7 +21561,7 @@ f['electrical/inductors.xml'] = '7R1rj9y28a8s9rt1fJMCbANF6qIFmjaoi/jz5k6+22S9e9Df['electrical/instruments.xml'] = '7VbBbuMgEP0VxD1JbYe4KyWR9lD11j1U2j1TZ5KgYrCAJu5+/WKMs3Y0SVbdHH0x9vN7MwzMDCztnldgieIlrGhZ7wyv9lOQUDgjCi6nQllnPkpQztL1MrAJt5X/v6JbUcOGkv2Kfnug0cT3sgJTggNDiVfqdziKjfMUofZghKPkGOjrZaGV8maEVjZ8eDYXykU7L5R4QyJYWlFvvvbPKaPks/maIYrXK4oEVfzCFK0Hr8MUT4giuap4QZ1Mk3kMJbyh4dwSPrILHp9QYUO/4fGWMHqcDXbujRfvO6M/1Ga9BClFZaHLiHane6sa1H3BVhs4vQsp24zxrIq7/XpZ6gM08rSdQR7cS6ECuIhb286pFVzQszRQ08v6E5jEjMm6DZXawl8Hg0nO+tOfhdr4lxJ55vLAlR6LZCySexZJjDnP+/kcwSRrwBOz9ZReZnYg6zPPa+yL6f/DFj4IbQtdwZj+Y/rfKf2TVs8G7TweHBkGDpmxJjIMHDIZZpNhNnPMZo7ZzPOYhHN2x0p7FTvFJXkGBYY7PR42Y7Xdq9qyB+RGFstlgYFDJsOYDGMuMOaizzybUhpi4qYgkpsdTPzbZCv5LoRsPO/RD59hsEeAKv5MaHcI1hNeCzsx2vFmQbul+qLddrWbCV+1exbEfBBuhvYmdhlk2Gqh4F37zU8t3XirHRvN/zWarVbOit9AmkfoCh50UDvCpT/QVrQA1eWYzzlKDhF/087pkvbvwq1bLJvb0a7/AA==';f['electrical/logic_gates.xml'] = '7Vxtb6M4EP4riO9tyosxSG2l2/aqu3TVU5NIu99WLnUJWgIR0Ld/fwRIAsnYAUyabeMvSet4PGNmnsdjD3CeTMmcJkpIZvRCnb15MZlPT2lA3TT2XRKcBpHnu788ktJEvTzPeyskmWe/X6gvJPbJQ0BVZXqhWmdqOcpfd9eqkqRx9Ju++o9p9psfTmnsp6ryeqFqZ2fZQG4UhtkYfhQm+T9Zd+KHaTmCH2qqMs9EZjSl8YWaDf2Wf75nn6eaZWF1AIrpHDHbMAxQLHpOATGtFEMLmUHN3gfi/vbi6Dl8vDyfk3R6eT6LXuhCSC+VLWQCP8zbUKWNxK4SkNijJ9lfJ08B8XJ1cdbNWHy/F9/JK6Xz8mdNXQ7ydkLe/OQkjlKyMGQ5M6umTa82ukGU0IX5hZWDquFPUUxXf/tBUDhssDmjYjgN0lE01jsiqCOqdbSLRqPWcxEV69bS3pVJg6qxgzwIubFoWstY/EbCxzlJEuXGDzLncuIS6Q3CkhNeqP/YirPW5XQKCysKc9EODrWK62zUrn7RqNUaDajRrIqLumlNGd+en5643mnGGh/rnt3QB0MdRGgdRaCA0RFFzYKkre/sle+ulcl71usm8OcnN0E0F/TiNceJOuzFvzkiGBa557idoeU+pB5HCjcE8+LCvRaxvxE13elZh+JFB+iZs1ZsBJYOBlZ9TFzMHaFqV+xUGjfAUe9p8GxCgE0WaJMFLhkpfUsVEvhetk66NFxyfx5fL2X7Q5Sm0azwAyrml6tlyt6DslhctphuWww6TAwqP/x0qlwFlMR7hKPByqi4gMTYbg1JpqZdoGQpc4tLs23lKaoAshuYNUE0N2D/og1DHXHbZWKjKwa7Ygj4FgR8CwK+BQEfNr8mjtj5tNUf6g0B5IrIFnOlQYbahOaJXh5NZt7HtNfTFFqpHbMBSyj6PnnC0nB7nrCx3p4nWJp28QRLmSBPJORl4TI+XZiCdGFCdGFW4LFzCAwNgRsOYUNmrCiGOUhHqDoCUM1lQeMxaDxubzwf74ABSyp1ICp1mnlgSbIORLKgax2IPGOapFnglfE6qPxSV9eQlGsGV0jOzjFgq5XtpDjJ5S6rsdxo/CFbkg4JUHtW60RpoNB4F5dtSYw4EprMkv7wLKl+Rlc2OnDPs6+SUTFlx6Asqu5tmbIjnqztqELHlP/43lQeU3Y6pjSrjf2dSP4bvtA4lWeSrc4kzX7PJBk7o+UJlS2cNWy7W3gfdFiH73SVQCWouXc5g2AMDYKh4z1cSUrqdawmmWWpSBdPLVE9RvzQU66iMCVuyqPpnYHyA8yrNG6kgGnlqdMsUhhoWmV/pfyeqwXD297S8mG/lQJY4lbWFg5SW2hw5N+5DGFAebYJmW+i7XnCHdslz0OBIsQtT9b6pAWMKi30V7wY9l28QAhZ7WlCVjyOby9vQhwD3x2DOt1G01tpZCiwkedyEf5UZRWmrqvdhwbdSzIM3hPehgz7LscgbHZIkGQN5zhrOEOBGg6fU2T9h1n/MaH6D4LCAgnVf3gDN4y3jyghdSR0UxUrP20z+ni0TzL/iH2urFjJLPePy3L3V9r6ohnx5yuLfY9eZVVsuyp2uPv07+SzPfLZHt6zPWbrZ3s+sMh399/oWINXQ9vBazYL3myNz4MXgcFrs4PXEBvZbAqLcm7WLnVWiUJrQ115WRFTncRbN7xJuEm4fS247f/R1XWlfDRWvpPUnQpiaNy+Sj6SNe/PX/NuvNsdC9SiR1+nFr1etsbudOanqTKJfc876jsAhcm3nweZl10N6PaN5U4X7Vr9itXIhBYjzg7M0ID9nu50UlZu90ymMr02M4SARsOpNHacrsFee/V6DQFVrkHH6Roa+9oiINh6WDnH76E7jaMwek6Uw62i7c/g5bor7zXr/14zub5v0MOk3xdWTOQLKyTQ27/bojF+J1/nhRXrHPunPIuVh0NHdxa7ioBm3mZdpMIn2i6fHPDk96dEt0T3sR39HhbdIFiL7+Tyfw==';f['electrical/miscellaneous.xml'] = '7V1bc9s2Fv4rHO3jThjiTs4kmWnSZLc7SdrZZKbPrMzamsiSVpdNsr9+SQKkAOojSIq0azvqQ+0cHwAEzhUHBwcvdjfpJtsFq/Q2ezm7/Xa9TTc3YbbM5vvtYp4uw9vFbp4tl+kqWx92s1cvSvwg3W1yjJez/6bbRfrHMpsFNy9nIpqZfmjwZr26Osz3623wr3T+ZRbs9tv1l+zr4mqfIy5WN9l2sZ8FX1/OSBTlvc7Xq1Xe4WK92pX/yNHTxWpvuns7CzZ5g9tsn21fzvJRvuXtZsH3/PeQz56/evHcaf/neptdb9eH1dWrF9scWn1bMZooG0e6cdH0z8VyqT8u/0c+0cVmlxUNiGmgR0t0i7x5s8km3d+8enG7/m9W4DGNR8uul4tVCeQayBygQJiJDXyuu65Hem7P63lJBy85KEfk+G15uPaQQ7BOanz0kKP47pMGn9obED/13MXNv60epFox0g4TNkweQY3uKAdtIZAkpz1qWJNUFh/JclmlxXZEnjDRUNIeJY1NK2k+2oZkKHWjMLlP6Yz6CacAskkEkE0BRFN0kBt+GO/6MvMVHH0Fc/kYYSY2cDq1wf5ateHjK/GDKpqqSwOjDr8wC3jfGqlQLoYKP70Jfj3sPcxC+ygiQMmC7B4r42mBNdfvqIWXwTpZslvVlQtlFsGn7GrVKDS6plesLBp34OZIpf5gfXAlRB7KBfzIBFfpJl+kkeaok0J9Jbpc9VoTp9t5sEy319mz/Ldnfy7T67LbbY5Ic3Juv+ufu69ZtjF/JrO6m2/P0m+L3bPtep8W4zokbIqd+xXGu3P0RSwt4NkfVvTS8l2uabNh8+V6lx0/eiKP5E0BCz5n29vFqvyQu+aBKaXUpZcxtiICFtiBxcIiom9Zu/mh4lQ6iTFnNGS0psxNutstdh56SBHypJMiBGpaSeLEEoSeS2x8nPIz7VUQYWXO3MUvP/AULmhIYreragQqwyjBo/AIj3KET7IRIzSUNQ0W2/lhsQ9eb7P0yx3qRzJQMshwopXTslaNueAKWWHsis+b6FSTMdFQj0IshtvqbTVQiIq2KkTT9ViqyqPGW+cDeSjJo7NEqlJZVAynjauymA2sTaIAUQkDdDEpMiTOxqnGZGB0I5gSje5iFpQpoUkYOywEcKnVKdK0lsPLtMfF/A5X8Y/5epnvdcr/v5yt1qts5tvdkcjSHedrB8t0rnOGTZfBm2yV88Fx9+XhLTbSghIppRpsRetWfbmSIrZUiC0pQ6g0hizMFNgHEQHtqsFlscuGFPUgBerB4Lo9cMTIBkhohD7MgE9mESkPdnMeRLvqJxNpdCJbvoSiTmgd5nQXX5lO3FBEDY5ccIJnib+k7qQBrjphAnXiEoY5LpPXuRI+58oSdBOQEprtqaUzemAzhD5iQ12phSK+1xmIGacOKPaoh+/G305m0CrrEyGTZqA1f2i2TpiDGltAN4ASOy4J5xawHh7JtwHGchAb9YlrUm1gqF6wxAr9TGlgfj3sd4ur7GJhHr2FYdhmaPDpLLgH+8TCNP1FCjuRLV9CYScYmwovGPfxAxiBYzztzfb7bp9LLhm5Y1ysBodT1kUwd0hA5Y/cTjXDntx4zrxszO3dtY1ur0934MS1CIkFrNU8AZh1iMVBZclpXMfAOOrTjUsQC3HszvKU6vRC9SdP9cIRNlQP/pmlV3oDWKyv1zzfzWHK8LO34WFa34FNpAMAfY0/062UALEMBeLfHMBcbyDyAN3WJIaDS/xJwgpbNGy5BvaPHpstkkQZJNxlfeKDymmCnMf9ys/ZMv0evF1mt9lq/5ii/80zukS3Fr2yC5BTidyXBLlzlXKCITqOQnQ9wmkxGj5GfcZiQk5gNSO8W64P22w3z9kgeJ/ebjy8ED/ogyBqZ3B5YtIFGbY6Kgpi0qLjjO7sjmnHqSQ6ujp7MHVn05Dt02CObmycQyCt78alpQCYceTBbJw6Ac+BIEwiThP4+uUwOd11o4sudK6PHmZWBGTc2T6tzxHfHXblGe+/s91i5/dOHrJzSnWsReo1MqcUI51TQsDJhwuk9Hjg1ohmUQLiVg6MS4Ao+CmiyedwEVV0iqhigBhTNJvInuPoNLPIYqfsUexrkatAozYm6uYVdEpGXGNNEWYUAVQqgMOK9JYCiEpMmXfsUvax7l3bKTtCPXgIOT7LwFl29sgECi2XmzAgj7BaPjjAi6JTREpDxPaqyg90MkZqsCtM1EHuMu5OIF/RwaF/2dJieAaQwxb8CbAFkUhxduWLkJJ+2+/Vb8A/b/c/R/WuJxzTjt5P1IKceF/+LvgQ2FdBxtrcJ5ej63jbUb0OfdJ0mc6qLpjxmw54lglnMPXWOJ4GVxrn3D3k644tmDEau3vZGVy4Q4aiF4YazVDdhJcoqMT7B5XiUMe3Y6Jv9Hi0WnEiXui04ifIhi57atNpcZi4iR6h/sbyl47UPmpS+yhSpLqnlmGVSSdshgpKuI1w9vC6p5bhq8nVG6lije3lOHuxdU8tw1akbASPJ8jmboo4u4i4N1Boh1x92fzGWaDQEWn3Q7qvCXg7pqJfoNDeI549mO+yxMh5eGKQovMUpTWmRu0Dwm50BdG7M/wpSlSI7/4uQMNws6fgCYaR2VmFrH+OURQmsdPq/jzCRiqX1yOk0sNYJlFIAY/Qzf0xHqGLaebvYgqYaGegscOt3Ab6dkWR9zykXT+oaFTPnpOEWExpKD0yRR+vTCl/NmiLTLGe6Z2TyRTXJloIj5wopFZlKJAKZiFKLDPzcnG9spIQR1aM38tlyBrxJHP3SIRu3F+FRgFw9w8kMZ67ELqrppMraUjBrWKlQpPRx12fPBHmD/m3UfdoLCRwpDuUF/Z45YVVSSt6w99XYKTb7A63kRVnNy7ZUQtYS0EMMBPpdHCOFNjAxh0i1duMRAPNiBzXs8eMKFSVIfFuwursEn00S6l9S5sK6Bi4uFIi3AllkD8CGfyEhbA6/wp1nv8l7tNE5Sw0p8dJrg7icZEfHhZO6olsPItJSPUnqYZJyY2ZySuXSXEhd0wIhouQJv7h898URTYyMVZXys4w1MOMfkWe6JcketiT6Fd1s7JCeGzRr6RICG2dtcTukFEJObszeHlHg/0lG3gSmmCIZGGsRk0iZ1uGYnhECuO3JSps5IDkHpv5U76W4wKXLA4J9w6fL2TCp64M4TE34gczNw94Z1Vsqb7qDZZhpEKHswe9s7r77c497uGmK0fwj2yV89A8l7PbzXrlT8GWP3AlJhlVS9DfL6suo8aoFEIMorycAkxOJ8mzTiqK/3K9WhQFAzruBucO0ZnE5sOpbZqELXc/fRRnTF9L75F9J6sCG9Z12S4aGjRHkIk6wnynEuZQAplX4jmTQCnCZMxYqt0Hc+eVWMD+V0uqjFKnL6nagW4dAaeYWK2WKcI0IWsJ0lSZk8Fl9r7MLY1n5064hqnT3zSeGnRy2/16N7Y+YiRzqttzpAgsPbWJ1FQmJ9VM/haV/81OVRo/zuLodnrGU8hCCtCLsBs0LtkTNrWfidUhvejDiz686MOLPmzqQ/2Xp6sOjyk8vyyXB12LcXUdvD4s/xi3H7jvfPzWEgtiktvkjYSLjuwUYnSROTagQw8kKDo2mCa947gB/GV1tZin/otZT3fjdzoPHIshvArhEC6GhH6ODWPRMiKO48Sic8SuhmbEXiGgc/a3ApQc54h1OSpOLuySgtPlIBZXh70pSuLCzE+GmXup/mg61e/T8t4cxN5anol+KY9tZ9Gd7jQVd5P7W8odvcjdRe4mkjtl4vXKDb9zaoLl5S922L36Q6NB1U+FP13pnfeFaAY/96q8w/JmP17wvPhRhhty/bVb/C/vTRYxjWoZzbr09zjMBkh2JXwaXQxVMWs/iBfSLfJnZeGeOxjrWWqfcdqvKoZ3NO7ZErubVCatGZ89ufZLJrA+0RRmZnF9s79sTK0ipi1qUrWpSYXVZN1RswHyUtC5rRB3vWm1kgPer9eb4KfVPlut0nsuiz9c505bSD+CpT0hNAZEg89GuVXBICLsEQ5+rFQw0RXSiugf3hWmdp/m9oQ+zkphjuAPSu5re3FsukDQh/VqXTzeGLxO9/kcvz+Bu/8MCQWLgNaKAFtLhMggq+MgRn0RIbLKK5l7COBxyBGkOyz3iydNO6emWp2ozkE5Tg5oF0edtGugRqD2l0SDM1QM1O2SI0yOMAXCFAhTIszqlKe1nhhkSNr6WilEN4NMwL+qnX+Dz+lmk13doZLnVNdjH/Z8bFujTp/gwvv3yfuN9ECFsgP5XyQljQ0tKsEhUAFWwXveWD5/b/UxW6+6Sm9eoniXKN7Yg1N4px2+G0Xtg6PGy7yN+IkHkyLveZotKRAe797kBz8ypyhwQFG9VSoQPREm82AOCEa0VEOtHgo0y3i+s15HjT+ut7fpcplddT7BTcY9ds+GxC8UVayPuzLRI9x1jED0e4abRug8GVlNXx3/IXmPGqlfVmSMKrKam0CMgNrZjKA8IOiqxfbl1CnsfRsn0gsrPiRWbEs5exK85ntWtngMZ8zOjkXDHUDTZiivxWIos/VkNYUYSA5gNVSCXEJUBfeHMcKlFPVbASlw3KRr04kPSqkvhuYuPGGDxZy27+AGpL8j4SNI+KhP+Oopu00i2BFBPd2pcNKLdF6k8+FKZ2sy9lMSzmNw9LcsF87iZmbwIb1eZXvv804P+V0U+EhSK8wN2tmwCY+Ri0s/waf1/Eu2r7J48lk8qIvmZy0yjCcOKPPb4+BZRJ5iIhMd/RZnZWaFstWuuJHwfrH6Enz6z2HhS/8guTg+YDkwtT1MK98lpqgqE65/Q0Ui2vM8x/VvypDLu+rflEWhqnMAT6BGlyGIbdstQ+GzOnYLYh6gh21GKJVPN4tseWWcqcsTzE/6CWaqGYoajiLWmzcTJJh+KrzyngmmRESXBFOQYEpEdEkwLXkzHp9gWqrMXgmmxMjCqARTEsl7SjC11XfhXQTltfDRr5X91QLHhu+1z3hJtanq0bOl7TCUe4hgEr2yB4ENIyM8PnEcnaa6NrIvJMp1gK8Lx+DYvnqDDZ3lu5jVI2zoTXoXU/HBqWgw6yBGHxXDUkqTZx0c3/36dChuUfyWy3eXiVMPbHtr+wFRtQHXAZAenoPTgsnz34Jj4IE3IQGmmvIFMd5GQO/5t3oEEQqKntpzo2rCI6vUmwtaPXJO/U8AYnQeTfTOFznmLXzOtsV9/2Xwep1ufRl3PS4w/U48tCMte5Xfqc+AqZZGzNNIto3EPY1iNdVW6owLAsTDwW3r9pb6zHjLbN4yT6O2dXvLPY3MuvXIfjebq0EXvlD9ZGU/lt4w3SpEqBW4+fwqhdg13LNRdKPXrH7tj4VK9HsQpG4jSEiHtonj4eMQKsORxaCPzwN+vimi0svH+G77BI8EmivfxbOLW40IL+O1P1DtFEZ3n/Brvqo77iOk9L/hM931kZIjyheeH8XzvL0fcaUjE+AY8iYYeri3T4o2i8C2R6G8bTodkRUi8mN7qddSkCqqfFHrhHAsmQUiswBveVOUt+petjM7yUYRFYmu5XGU50gBpkL5mOY9bxezYkf4uhSbJG02dg3Jer4+bIo/tXJU3M1Qf8dJ19Tnqj3DadP2i2Z9DQmBh2wg8sAjsM9WCNOW61oBaCo63KL7O3VwBHgQwKn1xk/RYs/dwpYUWcOtKh69LWmyxWbxozAFRUzBerMPDHHJH4fRWhqIoQ3I0AbcKNDeDWhrgxGu1zZd7a4O82xk8AxvdctLb0N3u3Wjh/Wu7jlVzpAbpzy+WXdWmOPETXhyceQDr3fWQ21+9BCo/80lMiZI0rskexVBtaNvvqLsov1eiuouaCHagw8gYQmeQou+ly4FupWOE3au0t3Nprw7uwrMzxw1KNV38bfsKtA/zOo2zgOQpeDDU3n0z92r/wM=';-f['electrical/mosfets1.xml'] = '7ZvNcpswEIBfhdG9sQRCwIztQ5s200Ndz6QvQBwlZoLBA+Snb18Csg1hgdqxCTh78c9mVxJiv12064zjpbuWsRa4Kzkhq5f7yF0vL6QvF0nkLVz/YhXGdzKJGZmOM1XNjdfpHyfkyY0898aXRFtOiEOJGuLy0fW1KzeR2q/f1z++/yFanEThg3z2bpNU0QuWMvISoj1nRtPxIgyCdDwvDOLsS6rtekGiRrtiRFunBiuZyGhC0lle0tcLahLt7+sH3SYjyExvNrN00OwStHJaJruGJmPKxoRNWPNM+fpGpb25cRcP91H4GNxOx9L3vXUsNzuf72U2Rj5AZl00uAsjuf3s+X5+T1KttZssp+NV+CRfzfXcnmWr9r2gKLQy4VYzX6pe0rSLwjeaAtIU4Ji0NHsuNCigySFNE9IUkKYFjllap0MLwo0mdEGsSUir1jqkCArzKx/lN2p731Ze6jm+l75p2WtqTCq303j1v2z9OnD55Svd6eZe7oex3M1b8plR0ZtGWVRoDA6M1UYHbdYQHxg9NEAojPgewWFDHrP3iQ3Wjrcq5A0W7EC+mQL0YMK5cqrSvbdovbDkuyoSOEW91LdqhUIUrdXcJjQNKGSMAvYWpFqOTopaDiwJFBoMYqy8c2IDiFmKJVwA69/q5ug3wVTwfk0xAJDMi7FgO3UutMEAcUxI5wgpQjoISE0OICocYPVKs3NAj5VJFZo/v70/hSJpHZFmqPNAd6z1P6WZEDECvMx6tv6HQn5aCudI4QdR2HXG2p/3AeYsDm7xMVg9DYEzbRZqXx/9hxNiaCKDLQw2MNTCoAJGh9CyqwyWuVCKJghbv5/f5ui3n9dvDbvBbwtbxrMd46RoY5BR/5189mWxdFOX8DeVBIZPSYM5q+BJpbPim1NPjP7OBtqR8kJrEwwbWtWGFgX6LDrUUeph54vTeqEwh96SagDOOAFwrZ3ntobw8VrPlwhqFVRIUacDbFGfKZO86ySIPGLiRB5reTQ/JEcehCTydWb5rv3BdHtohHZOQPshKLB4i1b7RnXHUx1Yk4B2RNgFzSZazyRSiM4zN0YJzMIYJfr9M9A51oWxLnyMuvCZ/97LqScG68KYWM+/LmyIj3qSnfeiLnwgdGz//0jSEVSsC5f33uYgkw4UAXa6XTLJB5IEkUdMnJ+BR3NAORL5wrrw+ys+x63tnNszs8BDKuZarP72sfp7kiiRv8fTfw==';+f['electrical/mosfets1.xml'] = '7Ztfc6IwEMC/CsP7aQIhwIz60POucw/Xc+buC1BNK1MEB+i/b38UohJZsFqkavdF7XaXhLC/3WRdB8ncW4pEC72FGOqLl/vYW857IhDTNPanXtBbRMmdSBOqjwa5quYly+yfQ/3Ji33vNhC6Nh/qLtHlJcaPXqBde6nQfv/5+/PHP11L0jh6EM/+LM0U/XAuYj/VtefcaDSYRmGYXc+PwiT/I9P2/DCVV7umurbMDBYiFfFQz0Z5yV57xNK117cPhqP3ITOj2cw2QLMxaOXuGOwvNBiVNhZsQptHKubXV9bm1ps+3MfRYzgbDUQQ+MtErFa+WMv8GsUFcuuywV0Ui/VnPwiKZ5JpLb10PhosoifxZm4U9jSfdeCHZaGdC9eaxVQNRdMpC7c0OaTJwWsSZfRCaBJAk0GaFqTJIU0bvKYyT5eUhCtN6IZok5BUrQ1IERQWd94vHtT6uS38zHMCP3vT8tfMWK88TvPN//L5G8Dtq3e60S28PIgSsRlX8Zl+2Zv6eVRoDA6U1kYH7aYhPlByaICQGLE9gsOKPOrsExvsDW9VyBss6IF8UwnowYQz6VTKs7dJvVDxXRkJ3LJe5lu1Qs7L1nJsCxoGFFJKAHsbUlWjk6SWAVMChSaFGFNXjq8AsZRYwjgw/7VugX4TTCXv1yQDAMmsHAvWQxdCBwwQbUI6QUgR0rOA1GIAotwFZi81Owe0rUwq0fz1/eMpFEnriDRTnge6Y+30U5oFEcPB26xn6z0UsiNTqF1Fs1dt7EczgUAeDKTtygTQU89hliJeaTsEON25DBA6dunM0+S86nRWZlvTkWIDAk89/UpNcDIOZO68g1uMWhi12olaEwxVn7R36HqfvT/vZ7jTZuASt8Hq8QjEfUOL+4atnQD0rB0C1XkZIJRp2nIP2zNczo4BYxXGquyAcxNpV4/BwxGjlIX7hR0MNjC0g0EJjAGh5VQZVLmQihYI22lXyCbot1/Xb02nwW9LS8byFWN62cbU+6fv5DffpnMvc4lg9V0NxU3k2VSDsarS2debbj0xxgdblFrKCzvbjLBlqNoyBJ3lDKhn5wR7ixipF3Lr3Jt+GoAzjwDczt6+XS137TX3jRHUKqiQokHOsAnwQplkXSdB5BETJ/JYy6P1KTnyICSRrwvLd7s3putDI7RyHFoPToDJ26T6HXfd8dQA5sShFeHOOzs9LiRS8M4zN0YJzMIYJU77hzYTrAtjXbiNuvCFd9S79cRgXRgT6+XXhU3+WTvZyUnUhQ+Eju7/m28DQcW68FarIAOZdKEIsNHtkkl2JkkQecTE+RV4tM4oRyJfWBf+eMWn3drOpe2ZOR5SMddi9fcUq79HiRLFezL6Dw==';f['electrical/mosfets2.xml'] = '7Zhbk5owFMe/CpP3CiEkyoz6ZLtPbZ3ZfoGsGxdmuQ2wl377poAu0COoWC5tXnCM5ySH5Pz8n5xl4vBIJFrAfbFC/vtTzCNnJjyxS2N3x72ZHyZ7kSYmWi8zU40nkfxxhV557PIHTyDNWSFmoGKKzQv3tDueCu3r9/svn38gLUnj8Fm8uY+pNHQDR8RuirS3FVpQOekuDAI5nxsGSfZFWnM3SIvZ7jDSIungi1TEKyRXec+eP+VzhhmbIx3yMhu8FoQQ0GsDOOG2pe7NBi8Ku+AGl0N0emVf9mEsnuLwJXhcLyOeOuulH76KzI/mjr99PDcoj7Fs8GBo5u+PK5YLWhqsWVLIkoKWZcPDOhQwNCFLAllakCWFLAkUJqmECb0Pbhi06J/eGDKEBzNvPT+mPPf1+qmZdJYHas6hHalMe7Qt0tYLE/GxwN71vOMiejlP9AzXM6n99mnncJlwXkGthjty2x+AF8P0wHfPI4QJTMjxUXfMxkqgpGEwj77IV728++V0nSwpZgMpttGJFDokJqc1p9h8AziQGiYUwMQ2IEwokP22cRITYpzMhvqU1QyBMKEQJhTChEKYUAATYoCYWMbpwQomJ2g4TlujAaTPGIIGMoBuNBZUt6zcNv9K4TYRrWmt8KZeZVl9a8ckUVF606o3oALYxtmojF9Y6BDCcg0sSiSGF4n268jBnUEbx6A/Agphy8qDzYjRORATg3aEkZLlAa/piBrrXdSGxlQJ1HUC1X4dOmIKbRxrALoa/Nw4G1NmQpiC7C8aMB2foEo6te79+J66FYO0yDE9V0QxvUxECdQortKJARHFZcGrp+31qbD9j5q9qrbqUFsR3Km2aqlJwGuJ78qj9Vz5oWVP6YDOvdiD4fZSA21VU1jVQO1NYdapBmqpHa6/5YNx9VKUbMfQPr59hUIv76Ip9Rpd+3hug7QsIAyPtr3SYk1DZQZGRSnTX28fLywQFRsk0BoCFaquOEokVPt4Alcnpq5OSqBU+3hsN7XbtI/x9OgcXfvYukX3WHieGyUiO+Ts9Bj6mDtPuvbMyT+T9S8=';f['electrical/op_amps.xml'] = '7VnbbtNAEP0Vy69Vmr3ajtRUQiAQD/AAglfkhm2zwjc5bgt/j69pNjnr5rItCNqHNJ2e2fWs58zZnb1YLeNCrbwsTtXcT3/elHGxPFeJWlSlXsTJeV58i9Ni5V9etEgvXhX1/+b+XVzq+CpRvrec+wHz+xFe52kRl3GVl763qsr8h7rX36saorOlKnXle/dznxJSj7fIs6weSufZqv2jhsc6q/qBvp5R3ytql1RVqpz7xPd+tp+/6s9zwhn3p9CNjbhxKSLsNkFeNb51pNgnv62AF92aa2rEeRUvftyU+W32/fKiiKvl5UWa36nGT3QPyRqfRGetLepthrEHita4SPKVambpBptujn+dl2r9XSdJ9z6m2xP3QQbGJL2Ro5k749q9M1KEpAYSRtPkwoN1gDK5uxic2G2GcXA2RgTOG3NsoRCstfXLvF7Jsn6xDQFEm9esy4DOgTR4Y9lHwGwXPd18fdOWfKMcDNccfKOvr1Wpsko74eEYn4gMnotPov45gk8UEQqmtXRMqBARStipvOXOkLuZmGQ3gUNURaTVxh/NfoboCZdxYDKHTEZxQ85Tibg8M5AEIQlA/u0R7VdPiKWgHFwiwqFEvM+q2vHJy4Mkz1ceIiKPKQ8hKg8hKg+h4/IQovKAZu6M2+UBuRu2gDzYBueA7+IiabXxEJApNCmyYdwmUwjJFILdA0NxM/ToxAixs1FhAAkAkg3gXqQbApMOhfl9dqfKSmc33qu0SPS1Vi/q/KLOp6gzRbLDyb4CtYfqnaZQo9Q6XdBma2p9uE0qfaevHtO0mXycU3Wmn40d7EQYWSkysTrSQ+gBD1UhelvcMT3g7gYdxwTI7/03ZhRtjSja7MGoZ4ggDOU9H8l7icQ/QFIWIeQMsU6ghYPGANW+gIFVMiMiVtsMrZH5lMFIl8G6E9qrBojHakCDu2+dmrcabYy/NzwIHarxxzybaPeKPBlRZBlxW9vqRZFF+Ick9VjVFyceJIfGG9zJOxRfg0mcbyz2SUwS69PkJ3WjMs9h63eEQoyyQ1q4vVfAI34UiZg85lRJUHklKMuIIw71NBAS5Dw0do9jEoGT3b4nJ6iFS2ALFwxJUdSUgC4JR0hzdo6QHAUpN5fjEBYJflDbNnKoR59vr+rUXDwxfwiz7V4n9CjlmrD/WLqcq48E4rPf1YVT4Rm7h0EqzA49Pwtm7X5tay7aFdh1+Fkl09X1jyBO60iauu0xjRUGGnRpdOhNrLU3dcZH3IbK8NLS+mdbWnLkOtjp9nu4nUHtAmjk6BSPAqIgIApwHOCerOtmvWgeQdOD0Pz0KtaE1JHzS6arX967mq7e2zxJ8vvT65jORipLdEyJCI6pD+hwADe/0tXhAE6yJoW5wUdb7Ejunmq43QZPOuhwIOxHom0CwETqfq8ufwM=';f['electrical/opto_electronics.xml'] = '7VlRb6M4EP4riPdS29hgS21ftvt20q220t7jiU1pg5aGCOi2++/PgE08zkCattnT9XhKMp4Z2+NvPo8nF8062+ZNsMke8svw4fm+zrbrKC/zVVsXq6yMqm1b/T38rjbFqgmvLnqTIGu2WngZ/szqIvte5mGwvgxVEtHQOEuDm/z+Id+0wXXRbMvsVxg02smP/Km4bbVusVnnddGGwZPW5VGqPa+qzUY7LapNc351cVfV+X1dPW5ury62Wbu+uniofubB82XISMTC4Je2C7VeWWwGqYxELyWuVKgo3pcmIkp6aRIpoJ0az5QD14lRH8Srsmry8916EmnmUFrNMeu31ZslEfCX0kj2A7HU87nrio0nLqCFSHYWwtuftHMIdHHMrF0QrenOpcxe9aZBIJPEhtfbT6/YDcjEG6Bm2doCuBJ8N4fEVselUZAMRkJbDsuWCg7wLpZ9sDuwOQNUTAwo6ycG6qlRtzP7S6N2t358KDch9+NjV+aHh1htEP8YBGZ0To0Te1x750m6HOsgknrYtaDSoQMDjEwM6I0I1BWL7RzEm4MDsb82bcdRwOslcAtfMEAZDndz+FodRFLaPPT809TNP7us84E27oqyHKink7m0ct5z2SFKU5OUFjwV7Tq4/jJHbd2pL9S2UNtCbQu1nZba8rIstk3esVY399Pw0cU1NVGSJkpvZcSxyFNLkbcw4cKECxP+e0w4gkyZ7dAUzSlPLAwkmZecXI2rAmIypiYQM5MTTOKrotLEJPGShtnda2yAXI/51EBs6UzAJTObExp8ykM/BQOnKozVUhgv18FyHSzXwXIdfJTr4Dc9Jigh9hL5I3vYztwXgsDbov+htbNCXzuDh5u/wmCrDR7yNq/7FOwS0bJ7v+M9k8+oidyZnIM5v2erH/gFNSS8JPskwPpzy+pVUGb1fX6mv53dldl9P173J6Y/B8WgecrzrRmmYWBGn8+y56I5q6s26xZiPZM3ORZk0jGD9427Nw80525E3MMHsIChooO/7uxdeBLDgQc2Rc2m6LHRisWbPPPpcAkCycHdnonTqzMkEWOCfL4O6EyGdBMeSpFig+F9AFMkYinQLKkeW8SMemYvzZTYBA1UR+4RjRRHDMFhVDpjMAitYjo9XQIUJdkvMGW6S7RRb5DFU3qjjO/bovvsSXCUHpVYx6IpJS6a2EnRlJrK+Ug0GbMj0UQJcr6cIOhI34vGZubg2KGjS0wJAkHKEGwJBINySs/DIEwIgeCcIThnCM7ZPs5TNYlzTjCc83chRgfKxf26Pcs0Vn5mbX4b3Hz6ugD7vwrsQREUrrgxd4THQtvowQc6YpvKnew3QjsZof3ntq3OVtXjtszrGUwr9QJIU7TUpcq5uhArhhfIJJ6x0okwPxmdMpuf7UBBXmupDd8QFCdte9NXJANPzIM5jr2HoUCu8p02wExstWFhzaF4b0oWz2jvTcnAlPj6GBRbZWHFMMdGMZeoNmPwHrBOCCr2MnDXh0jROWMw5+hF4M4T4J0qrC9IceV44iih2M9p/0mDns04Y8zh631sXDK0uE3tmfIE3a0XhLGnoyL+3n1eSiEZ6YzdNEXTVvVJ71iUIL5NEssch32b5JX0+Gc+xSDOmNNT8l+5AmlaMXBrMbT/zJA+FVXYRGYbanKiXfPPER5VIDjtIGXY1VQ3bglwsKYQAnkoC0h+2PVqCw0WYc84gtinmL1KUXtKyeEMN21QqWA/3Xafgd/EsoFksEGPJaSTRIFJpf58vGvIPBGxToN0l/9Oz8Mv66qtbovqNl9K6Q9fSscft5RWENHB13y4vE7cSXsNqOcRPcnA4m31rQk2vKWkI/TaARxtXXmqWDGpGAJRgUAUM5YSgeiLG3ZkH6KorfMPM8am9n3BhvgnPHSCNVSJr8apmMLpSXt08hU4lS97hOFBeitMCQZTrGs1xykfiElPRo/xQo8fhcpezPTe0wP9bwVW8LFEeyCIpimfoWbCEE30LxKDeaj5ghvp/ZrMN1WZ1cEnjbMPUBBjbMopQpECe+4aYYpp/r94d5JR9mqGeCCl4TY0oR56P4cfbMNnc/UP';diff --git a/src/main/webapp/js/stencils.min.js b/src/main/webapp/js/stencils.min.jsindex 940b17a8d..b2a9379bd 100644--- a/src/main/webapp/js/stencils.min.js+++ b/src/main/webapp/js/stencils.min.js@@ -78,7 +78,7 @@ f['electrical/inductors.xml'] = '7R1rj9y28a8s9rt1fJMCbANF6qIFmjaoi/jz5k6+22S9e9Df['electrical/instruments.xml'] = '7VbBbuMgEP0VxD1JbYe4KyWR9lD11j1U2j1TZ5KgYrCAJu5+/WKMs3Y0SVbdHH0x9vN7MwzMDCztnldgieIlrGhZ7wyv9lOQUDgjCi6nQllnPkpQztL1MrAJt5X/v6JbUcOGkv2Kfnug0cT3sgJTggNDiVfqdziKjfMUofZghKPkGOjrZaGV8maEVjZ8eDYXykU7L5R4QyJYWlFvvvbPKaPks/maIYrXK4oEVfzCFK0Hr8MUT4giuap4QZ1Mk3kMJbyh4dwSPrILHp9QYUO/4fGWMHqcDXbujRfvO6M/1Ga9BClFZaHLiHane6sa1H3BVhs4vQsp24zxrIq7/XpZ6gM08rSdQR7cS6ECuIhb286pFVzQszRQ08v6E5jEjMm6DZXawl8Hg0nO+tOfhdr4lxJ55vLAlR6LZCySexZJjDnP+/kcwSRrwBOz9ZReZnYg6zPPa+yL6f/DFj4IbQtdwZj+Y/rfKf2TVs8G7TweHBkGDpmxJjIMHDIZZpNhNnPMZo7ZzPOYhHN2x0p7FTvFJXkGBYY7PR42Y7Xdq9qyB+RGFstlgYFDJsOYDGMuMOaizzybUhpi4qYgkpsdTPzbZCv5LoRsPO/RD59hsEeAKv5MaHcI1hNeCzsx2vFmQbul+qLddrWbCV+1exbEfBBuhvYmdhlk2Gqh4F37zU8t3XirHRvN/zWarVbOit9AmkfoCh50UDvCpT/QVrQA1eWYzzlKDhF/087pkvbvwq1bLJvb0a7/AA==';f['electrical/logic_gates.xml'] = '7Vxtb6M4EP4riO9tyosxSG2l2/aqu3TVU5NIu99WLnUJWgIR0Ld/fwRIAsnYAUyabeMvSet4PGNmnsdjD3CeTMmcJkpIZvRCnb15MZlPT2lA3TT2XRKcBpHnu788ktJEvTzPeyskmWe/X6gvJPbJQ0BVZXqhWmdqOcpfd9eqkqRx9Ju++o9p9psfTmnsp6ryeqFqZ2fZQG4UhtkYfhQm+T9Zd+KHaTmCH2qqMs9EZjSl8YWaDf2Wf75nn6eaZWF1AIrpHDHbMAxQLHpOATGtFEMLmUHN3gfi/vbi6Dl8vDyfk3R6eT6LXuhCSC+VLWQCP8zbUKWNxK4SkNijJ9lfJ08B8XJ1cdbNWHy/F9/JK6Xz8mdNXQ7ydkLe/OQkjlKyMGQ5M6umTa82ukGU0IX5hZWDquFPUUxXf/tBUDhssDmjYjgN0lE01jsiqCOqdbSLRqPWcxEV69bS3pVJg6qxgzwIubFoWstY/EbCxzlJEuXGDzLncuIS6Q3CkhNeqP/YirPW5XQKCysKc9EODrWK62zUrn7RqNUaDajRrIqLumlNGd+en5643mnGGh/rnt3QB0MdRGgdRaCA0RFFzYKkre/sle+ulcl71usm8OcnN0E0F/TiNceJOuzFvzkiGBa557idoeU+pB5HCjcE8+LCvRaxvxE13elZh+JFB+iZs1ZsBJYOBlZ9TFzMHaFqV+xUGjfAUe9p8GxCgE0WaJMFLhkpfUsVEvhetk66NFxyfx5fL2X7Q5Sm0azwAyrml6tlyt6DslhctphuWww6TAwqP/x0qlwFlMR7hKPByqi4gMTYbg1JpqZdoGQpc4tLs23lKaoAshuYNUE0N2D/og1DHXHbZWKjKwa7Ygj4FgR8CwK+BQEfNr8mjtj5tNUf6g0B5IrIFnOlQYbahOaJXh5NZt7HtNfTFFqpHbMBSyj6PnnC0nB7nrCx3p4nWJp28QRLmSBPJORl4TI+XZiCdGFCdGFW4LFzCAwNgRsOYUNmrCiGOUhHqDoCUM1lQeMxaDxubzwf74ABSyp1ICp1mnlgSbIORLKgax2IPGOapFnglfE6qPxSV9eQlGsGV0jOzjFgq5XtpDjJ5S6rsdxo/CFbkg4JUHtW60RpoNB4F5dtSYw4EprMkv7wLKl+Rlc2OnDPs6+SUTFlx6Asqu5tmbIjnqztqELHlP/43lQeU3Y6pjSrjf2dSP4bvtA4lWeSrc4kzX7PJBk7o+UJlS2cNWy7W3gfdFiH73SVQCWouXc5g2AMDYKh4z1cSUrqdawmmWWpSBdPLVE9RvzQU66iMCVuyqPpnYHyA8yrNG6kgGnlqdMsUhhoWmV/pfyeqwXD297S8mG/lQJY4lbWFg5SW2hw5N+5DGFAebYJmW+i7XnCHdslz0OBIsQtT9b6pAWMKi30V7wY9l28QAhZ7WlCVjyOby9vQhwD3x2DOt1G01tpZCiwkedyEf5UZRWmrqvdhwbdSzIM3hPehgz7LscgbHZIkGQN5zhrOEOBGg6fU2T9h1n/MaH6D4LCAgnVf3gDN4y3jyghdSR0UxUrP20z+ni0TzL/iH2urFjJLPePy3L3V9r6ohnx5yuLfY9eZVVsuyp2uPv07+SzPfLZHt6zPWbrZ3s+sMh399/oWINXQ9vBazYL3myNz4MXgcFrs4PXEBvZbAqLcm7WLnVWiUJrQ115WRFTncRbN7xJuEm4fS247f/R1XWlfDRWvpPUnQpiaNy+Sj6SNe/PX/NuvNsdC9SiR1+nFr1etsbudOanqTKJfc876jsAhcm3nweZl10N6PaN5U4X7Vr9itXIhBYjzg7M0ID9nu50UlZu90ymMr02M4SARsOpNHacrsFee/V6DQFVrkHH6Roa+9oiINh6WDnH76E7jaMwek6Uw62i7c/g5bor7zXr/14zub5v0MOk3xdWTOQLKyTQ27/bojF+J1/nhRXrHPunPIuVh0NHdxa7ioBm3mZdpMIn2i6fHPDk96dEt0T3sR39HhbdIFiL7+Tyfw==';f['electrical/miscellaneous.xml'] = '7V1bc9s2Fv4rHO3jThjiTs4kmWnSZLc7SdrZZKbPrMzamsiSVpdNsr9+SQKkAOojSIq0azvqQ+0cHwAEzhUHBwcvdjfpJtsFq/Q2ezm7/Xa9TTc3YbbM5vvtYp4uw9vFbp4tl+kqWx92s1cvSvwg3W1yjJez/6bbRfrHMpsFNy9nIpqZfmjwZr26Osz3623wr3T+ZRbs9tv1l+zr4mqfIy5WN9l2sZ8FX1/OSBTlvc7Xq1Xe4WK92pX/yNHTxWpvuns7CzZ5g9tsn21fzvJRvuXtZsH3/PeQz56/evHcaf/neptdb9eH1dWrF9scWn1bMZooG0e6cdH0z8VyqT8u/0c+0cVmlxUNiGmgR0t0i7x5s8km3d+8enG7/m9W4DGNR8uul4tVCeQayBygQJiJDXyuu65Hem7P63lJBy85KEfk+G15uPaQQ7BOanz0kKP47pMGn9obED/13MXNv60epFox0g4TNkweQY3uKAdtIZAkpz1qWJNUFh/JclmlxXZEnjDRUNIeJY1NK2k+2oZkKHWjMLlP6Yz6CacAskkEkE0BRFN0kBt+GO/6MvMVHH0Fc/kYYSY2cDq1wf5ateHjK/GDKpqqSwOjDr8wC3jfGqlQLoYKP70Jfj3sPcxC+ygiQMmC7B4r42mBNdfvqIWXwTpZslvVlQtlFsGn7GrVKDS6plesLBp34OZIpf5gfXAlRB7KBfzIBFfpJl+kkeaok0J9Jbpc9VoTp9t5sEy319mz/Ldnfy7T67LbbY5Ic3Juv+ufu69ZtjF/JrO6m2/P0m+L3bPtep8W4zokbIqd+xXGu3P0RSwt4NkfVvTS8l2uabNh8+V6lx0/eiKP5E0BCz5n29vFqvyQu+aBKaXUpZcxtiICFtiBxcIiom9Zu/mh4lQ6iTFnNGS0psxNutstdh56SBHypJMiBGpaSeLEEoSeS2x8nPIz7VUQYWXO3MUvP/AULmhIYreragQqwyjBo/AIj3KET7IRIzSUNQ0W2/lhsQ9eb7P0yx3qRzJQMshwopXTslaNueAKWWHsis+b6FSTMdFQj0IshtvqbTVQiIq2KkTT9ViqyqPGW+cDeSjJo7NEqlJZVAynjauymA2sTaIAUQkDdDEpMiTOxqnGZGB0I5gSje5iFpQpoUkYOywEcKnVKdK0lsPLtMfF/A5X8Y/5epnvdcr/v5yt1qts5tvdkcjSHedrB8t0rnOGTZfBm2yV88Fx9+XhLTbSghIppRpsRetWfbmSIrZUiC0pQ6g0hizMFNgHEQHtqsFlscuGFPUgBerB4Lo9cMTIBkhohD7MgE9mESkPdnMeRLvqJxNpdCJbvoSiTmgd5nQXX5lO3FBEDY5ccIJnib+k7qQBrjphAnXiEoY5LpPXuRI+58oSdBOQEprtqaUzemAzhD5iQ12phSK+1xmIGacOKPaoh+/G305m0CrrEyGTZqA1f2i2TpiDGltAN4ASOy4J5xawHh7JtwHGchAb9YlrUm1gqF6wxAr9TGlgfj3sd4ur7GJhHr2FYdhmaPDpLLgH+8TCNP1FCjuRLV9CYScYmwovGPfxAxiBYzztzfb7bp9LLhm5Y1ysBodT1kUwd0hA5Y/cTjXDntx4zrxszO3dtY1ur0934MS1CIkFrNU8AZh1iMVBZclpXMfAOOrTjUsQC3HszvKU6vRC9SdP9cIRNlQP/pmlV3oDWKyv1zzfzWHK8LO34WFa34FNpAMAfY0/062UALEMBeLfHMBcbyDyAN3WJIaDS/xJwgpbNGy5BvaPHpstkkQZJNxlfeKDymmCnMf9ys/ZMv0evF1mt9lq/5ii/80zukS3Fr2yC5BTidyXBLlzlXKCITqOQnQ9wmkxGj5GfcZiQk5gNSO8W64P22w3z9kgeJ/ebjy8ED/ogyBqZ3B5YtIFGbY6Kgpi0qLjjO7sjmnHqSQ6ujp7MHVn05Dt02CObmycQyCt78alpQCYceTBbJw6Ac+BIEwiThP4+uUwOd11o4sudK6PHmZWBGTc2T6tzxHfHXblGe+/s91i5/dOHrJzSnWsReo1MqcUI51TQsDJhwuk9Hjg1ohmUQLiVg6MS4Ao+CmiyedwEVV0iqhigBhTNJvInuPoNLPIYqfsUexrkatAozYm6uYVdEpGXGNNEWYUAVQqgMOK9JYCiEpMmXfsUvax7l3bKTtCPXgIOT7LwFl29sgECi2XmzAgj7BaPjjAi6JTREpDxPaqyg90MkZqsCtM1EHuMu5OIF/RwaF/2dJieAaQwxb8CbAFkUhxduWLkJJ+2+/Vb8A/b/c/R/WuJxzTjt5P1IKceF/+LvgQ2FdBxtrcJ5ej63jbUb0OfdJ0mc6qLpjxmw54lglnMPXWOJ4GVxrn3D3k644tmDEau3vZGVy4Q4aiF4YazVDdhJcoqMT7B5XiUMe3Y6Jv9Hi0WnEiXui04ifIhi57atNpcZi4iR6h/sbyl47UPmpS+yhSpLqnlmGVSSdshgpKuI1w9vC6p5bhq8nVG6lije3lOHuxdU8tw1akbASPJ8jmboo4u4i4N1Boh1x92fzGWaDQEWn3Q7qvCXg7pqJfoNDeI549mO+yxMh5eGKQovMUpTWmRu0Dwm50BdG7M/wpSlSI7/4uQMNws6fgCYaR2VmFrH+OURQmsdPq/jzCRiqX1yOk0sNYJlFIAY/Qzf0xHqGLaebvYgqYaGegscOt3Ab6dkWR9zykXT+oaFTPnpOEWExpKD0yRR+vTCl/NmiLTLGe6Z2TyRTXJloIj5wopFZlKJAKZiFKLDPzcnG9spIQR1aM38tlyBrxJHP3SIRu3F+FRgFw9w8kMZ67ELqrppMraUjBrWKlQpPRx12fPBHmD/m3UfdoLCRwpDuUF/Z45YVVSSt6w99XYKTb7A63kRVnNy7ZUQtYS0EMMBPpdHCOFNjAxh0i1duMRAPNiBzXs8eMKFSVIfFuwursEn00S6l9S5sK6Bi4uFIi3AllkD8CGfyEhbA6/wp1nv8l7tNE5Sw0p8dJrg7icZEfHhZO6olsPItJSPUnqYZJyY2ZySuXSXEhd0wIhouQJv7h898URTYyMVZXys4w1MOMfkWe6JcketiT6Fd1s7JCeGzRr6RICG2dtcTukFEJObszeHlHg/0lG3gSmmCIZGGsRk0iZ1uGYnhECuO3JSps5IDkHpv5U76W4wKXLA4J9w6fL2TCp64M4TE34gczNw94Z1Vsqb7qDZZhpEKHswe9s7r77c497uGmK0fwj2yV89A8l7PbzXrlT8GWP3AlJhlVS9DfL6suo8aoFEIMorycAkxOJ8mzTiqK/3K9WhQFAzruBucO0ZnE5sOpbZqELXc/fRRnTF9L75F9J6sCG9Z12S4aGjRHkIk6wnynEuZQAplX4jmTQCnCZMxYqt0Hc+eVWMD+V0uqjFKnL6nagW4dAaeYWK2WKcI0IWsJ0lSZk8Fl9r7MLY1n5064hqnT3zSeGnRy2/16N7Y+YiRzqttzpAgsPbWJ1FQmJ9VM/haV/81OVRo/zuLodnrGU8hCCtCLsBs0LtkTNrWfidUhvejDiz686MOLPmzqQ/2Xp6sOjyk8vyyXB12LcXUdvD4s/xi3H7jvfPzWEgtiktvkjYSLjuwUYnSROTagQw8kKDo2mCa947gB/GV1tZin/otZT3fjdzoPHIshvArhEC6GhH6ODWPRMiKO48Sic8SuhmbEXiGgc/a3ApQc54h1OSpOLuySgtPlIBZXh70pSuLCzE+GmXup/mg61e/T8t4cxN5anol+KY9tZ9Gd7jQVd5P7W8odvcjdRe4mkjtl4vXKDb9zaoLl5S922L36Q6NB1U+FP13pnfeFaAY/96q8w/JmP17wvPhRhhty/bVb/C/vTRYxjWoZzbr09zjMBkh2JXwaXQxVMWs/iBfSLfJnZeGeOxjrWWqfcdqvKoZ3NO7ZErubVCatGZ89ufZLJrA+0RRmZnF9s79sTK0ipi1qUrWpSYXVZN1RswHyUtC5rRB3vWm1kgPer9eb4KfVPlut0nsuiz9c505bSD+CpT0hNAZEg89GuVXBICLsEQ5+rFQw0RXSiugf3hWmdp/m9oQ+zkphjuAPSu5re3FsukDQh/VqXTzeGLxO9/kcvz+Bu/8MCQWLgNaKAFtLhMggq+MgRn0RIbLKK5l7COBxyBGkOyz3iydNO6emWp2ozkE5Tg5oF0edtGugRqD2l0SDM1QM1O2SI0yOMAXCFAhTIszqlKe1nhhkSNr6WilEN4NMwL+qnX+Dz+lmk13doZLnVNdjH/Z8bFujTp/gwvv3yfuN9ECFsgP5XyQljQ0tKsEhUAFWwXveWD5/b/UxW6+6Sm9eoniXKN7Yg1N4px2+G0Xtg6PGy7yN+IkHkyLveZotKRAe797kBz8ypyhwQFG9VSoQPREm82AOCEa0VEOtHgo0y3i+s15HjT+ut7fpcplddT7BTcY9ds+GxC8UVayPuzLRI9x1jED0e4abRug8GVlNXx3/IXmPGqlfVmSMKrKam0CMgNrZjKA8IOiqxfbl1CnsfRsn0gsrPiRWbEs5exK85ntWtngMZ8zOjkXDHUDTZiivxWIos/VkNYUYSA5gNVSCXEJUBfeHMcKlFPVbASlw3KRr04kPSqkvhuYuPGGDxZy27+AGpL8j4SNI+KhP+Oopu00i2BFBPd2pcNKLdF6k8+FKZ2sy9lMSzmNw9LcsF87iZmbwIb1eZXvv804P+V0U+EhSK8wN2tmwCY+Ri0s/waf1/Eu2r7J48lk8qIvmZy0yjCcOKPPb4+BZRJ5iIhMd/RZnZWaFstWuuJHwfrH6Enz6z2HhS/8guTg+YDkwtT1MK98lpqgqE65/Q0Ui2vM8x/VvypDLu+rflEWhqnMAT6BGlyGIbdstQ+GzOnYLYh6gh21GKJVPN4tseWWcqcsTzE/6CWaqGYoajiLWmzcTJJh+KrzyngmmRESXBFOQYEpEdEkwLXkzHp9gWqrMXgmmxMjCqARTEsl7SjC11XfhXQTltfDRr5X91QLHhu+1z3hJtanq0bOl7TCUe4hgEr2yB4ENIyM8PnEcnaa6NrIvJMp1gK8Lx+DYvnqDDZ3lu5jVI2zoTXoXU/HBqWgw6yBGHxXDUkqTZx0c3/36dChuUfyWy3eXiVMPbHtr+wFRtQHXAZAenoPTgsnz34Jj4IE3IQGmmvIFMd5GQO/5t3oEEQqKntpzo2rCI6vUmwtaPXJO/U8AYnQeTfTOFznmLXzOtsV9/2Xwep1ufRl3PS4w/U48tCMte5Xfqc+AqZZGzNNIto3EPY1iNdVW6owLAsTDwW3r9pb6zHjLbN4yT6O2dXvLPY3MuvXIfjebq0EXvlD9ZGU/lt4w3SpEqBW4+fwqhdg13LNRdKPXrH7tj4VK9HsQpG4jSEiHtonj4eMQKsORxaCPzwN+vimi0svH+G77BI8EmivfxbOLW40IL+O1P1DtFEZ3n/Brvqo77iOk9L/hM931kZIjyheeH8XzvL0fcaUjE+AY8iYYeri3T4o2i8C2R6G8bTodkRUi8mN7qddSkCqqfFHrhHAsmQUiswBveVOUt+petjM7yUYRFYmu5XGU50gBpkL5mOY9bxezYkf4uhSbJG02dg3Jer4+bIo/tXJU3M1Qf8dJ19Tnqj3DadP2i2Z9DQmBh2wg8sAjsM9WCNOW61oBaCo63KL7O3VwBHgQwKn1xk/RYs/dwpYUWcOtKh69LWmyxWbxozAFRUzBerMPDHHJH4fRWhqIoQ3I0AbcKNDeDWhrgxGu1zZd7a4O82xk8AxvdctLb0N3u3Wjh/Wu7jlVzpAbpzy+WXdWmOPETXhyceQDr3fWQ21+9BCo/80lMiZI0rskexVBtaNvvqLsov1eiuouaCHagw8gYQmeQou+ly4FupWOE3au0t3Nprw7uwrMzxw1KNV38bfsKtA/zOo2zgOQpeDDU3n0z92r/wM=';-f['electrical/mosfets1.xml'] = '7ZvNcpswEIBfhdG9sQRCwIztQ5s200Ndz6QvQBwlZoLBA+Snb18Csg1hgdqxCTh78c9mVxJiv12064zjpbuWsRa4Kzkhq5f7yF0vL6QvF0nkLVz/YhXGdzKJGZmOM1XNjdfpHyfkyY0898aXRFtOiEOJGuLy0fW1KzeR2q/f1z++/yFanEThg3z2bpNU0QuWMvISoj1nRtPxIgyCdDwvDOLsS6rtekGiRrtiRFunBiuZyGhC0lle0tcLahLt7+sH3SYjyExvNrN00OwStHJaJruGJmPKxoRNWPNM+fpGpb25cRcP91H4GNxOx9L3vXUsNzuf72U2Rj5AZl00uAsjuf3s+X5+T1KttZssp+NV+CRfzfXcnmWr9r2gKLQy4VYzX6pe0rSLwjeaAtIU4Ji0NHsuNCigySFNE9IUkKYFjllap0MLwo0mdEGsSUir1jqkCArzKx/lN2p731Ze6jm+l75p2WtqTCq303j1v2z9OnD55Svd6eZe7oex3M1b8plR0ZtGWVRoDA6M1UYHbdYQHxg9NEAojPgewWFDHrP3iQ3Wjrcq5A0W7EC+mQL0YMK5cqrSvbdovbDkuyoSOEW91LdqhUIUrdXcJjQNKGSMAvYWpFqOTopaDiwJFBoMYqy8c2IDiFmKJVwA69/q5ug3wVTwfk0xAJDMi7FgO3UutMEAcUxI5wgpQjoISE0OICocYPVKs3NAj5VJFZo/v70/hSJpHZFmqPNAd6z1P6WZEDECvMx6tv6HQn5aCudI4QdR2HXG2p/3AeYsDm7xMVg9DYEzbRZqXx/9hxNiaCKDLQw2MNTCoAJGh9CyqwyWuVCKJghbv5/f5ui3n9dvDbvBbwtbxrMd46RoY5BR/5189mWxdFOX8DeVBIZPSYM5q+BJpbPim1NPjP7OBtqR8kJrEwwbWtWGFgX6LDrUUeph54vTeqEwh96SagDOOAFwrZ3ntobw8VrPlwhqFVRIUacDbFGfKZO86ySIPGLiRB5reTQ/JEcehCTydWb5rv3BdHtohHZOQPshKLB4i1b7RnXHUx1Yk4B2RNgFzSZazyRSiM4zN0YJzMIYJfr9M9A51oWxLnyMuvCZ/97LqScG68KYWM+/LmyIj3qSnfeiLnwgdGz//0jSEVSsC5f33uYgkw4UAXa6XTLJB5IEkUdMnJ+BR3NAORL5wrrw+ys+x63tnNszs8BDKuZarP72sfp7kiiRv8fTfw==';+f['electrical/mosfets1.xml'] = '7Ztfc6IwEMC/CsP7aQIhwIz60POucw/Xc+buC1BNK1MEB+i/b38UohJZsFqkavdF7XaXhLC/3WRdB8ncW4pEC72FGOqLl/vYW857IhDTNPanXtBbRMmdSBOqjwa5quYly+yfQ/3Ji33vNhC6Nh/qLtHlJcaPXqBde6nQfv/5+/PHP11L0jh6EM/+LM0U/XAuYj/VtefcaDSYRmGYXc+PwiT/I9P2/DCVV7umurbMDBYiFfFQz0Z5yV57xNK117cPhqP3ITOj2cw2QLMxaOXuGOwvNBiVNhZsQptHKubXV9bm1ps+3MfRYzgbDUQQ+MtErFa+WMv8GsUFcuuywV0Ui/VnPwiKZ5JpLb10PhosoifxZm4U9jSfdeCHZaGdC9eaxVQNRdMpC7c0OaTJwWsSZfRCaBJAk0GaFqTJIU0bvKYyT5eUhCtN6IZok5BUrQ1IERQWd94vHtT6uS38zHMCP3vT8tfMWK88TvPN//L5G8Dtq3e60S28PIgSsRlX8Zl+2Zv6eVRoDA6U1kYH7aYhPlByaICQGLE9gsOKPOrsExvsDW9VyBss6IF8UwnowYQz6VTKs7dJvVDxXRkJ3LJe5lu1Qs7L1nJsCxoGFFJKAHsbUlWjk6SWAVMChSaFGFNXjq8AsZRYwjgw/7VugX4TTCXv1yQDAMmsHAvWQxdCBwwQbUI6QUgR0rOA1GIAotwFZi81Owe0rUwq0fz1/eMpFEnriDRTnge6Y+30U5oFEcPB26xn6z0UsiNTqF1Fs1dt7EczgUAeDKTtygTQU89hliJeaTsEON25DBA6dunM0+S86nRWZlvTkWIDAk89/UpNcDIOZO68g1uMWhi12olaEwxVn7R36HqfvT/vZ7jTZuASt8Hq8QjEfUOL+4atnQD0rB0C1XkZIJRp2nIP2zNczo4BYxXGquyAcxNpV4/BwxGjlIX7hR0MNjC0g0EJjAGh5VQZVLmQihYI22lXyCbot1/Xb02nwW9LS8byFWN62cbU+6fv5DffpnMvc4lg9V0NxU3k2VSDsarS2debbj0xxgdblFrKCzvbjLBlqNoyBJ3lDKhn5wR7ixipF3Lr3Jt+GoAzjwDczt6+XS137TX3jRHUKqiQokHOsAnwQplkXSdB5BETJ/JYy6P1KTnyICSRrwvLd7s3putDI7RyHFoPToDJ26T6HXfd8dQA5sShFeHOOzs9LiRS8M4zN0YJzMIYJU77hzYTrAtjXbiNuvCFd9S79cRgXRgT6+XXhU3+WTvZyUnUhQ+Eju7/m28DQcW68FarIAOZdKEIsNHtkkl2JkkQecTE+RV4tM4oRyJfWBf+eMWn3drOpe2ZOR5SMddi9fcUq79HiRLFezL6Dw==';f['electrical/mosfets2.xml'] = '7Zhbk5owFMe/CpP3CiEkyoz6ZLtPbZ3ZfoGsGxdmuQ2wl377poAu0COoWC5tXnCM5ySH5Pz8n5xl4vBIJFrAfbFC/vtTzCNnJjyxS2N3x72ZHyZ7kSYmWi8zU40nkfxxhV557PIHTyDNWSFmoGKKzQv3tDueCu3r9/svn38gLUnj8Fm8uY+pNHQDR8RuirS3FVpQOekuDAI5nxsGSfZFWnM3SIvZ7jDSIungi1TEKyRXec+eP+VzhhmbIx3yMhu8FoQQ0GsDOOG2pe7NBi8Ku+AGl0N0emVf9mEsnuLwJXhcLyOeOuulH76KzI/mjr99PDcoj7Fs8GBo5u+PK5YLWhqsWVLIkoKWZcPDOhQwNCFLAllakCWFLAkUJqmECb0Pbhi06J/eGDKEBzNvPT+mPPf1+qmZdJYHas6hHalMe7Qt0tYLE/GxwN71vOMiejlP9AzXM6n99mnncJlwXkGthjty2x+AF8P0wHfPI4QJTMjxUXfMxkqgpGEwj77IV728++V0nSwpZgMpttGJFDokJqc1p9h8AziQGiYUwMQ2IEwokP22cRITYpzMhvqU1QyBMKEQJhTChEKYUAATYoCYWMbpwQomJ2g4TlujAaTPGIIGMoBuNBZUt6zcNv9K4TYRrWmt8KZeZVl9a8ckUVF606o3oALYxtmojF9Y6BDCcg0sSiSGF4n268jBnUEbx6A/Agphy8qDzYjRORATg3aEkZLlAa/piBrrXdSGxlQJ1HUC1X4dOmIKbRxrALoa/Nw4G1NmQpiC7C8aMB2foEo6te79+J66FYO0yDE9V0QxvUxECdQortKJARHFZcGrp+31qbD9j5q9qrbqUFsR3Km2aqlJwGuJ78qj9Vz5oWVP6YDOvdiD4fZSA21VU1jVQO1NYdapBmqpHa6/5YNx9VKUbMfQPr59hUIv76Ip9Rpd+3hug7QsIAyPtr3SYk1DZQZGRSnTX28fLywQFRsk0BoCFaquOEokVPt4Alcnpq5OSqBU+3hsN7XbtI/x9OgcXfvYukX3WHieGyUiO+Ts9Bj6mDtPuvbMyT+T9S8=';f['electrical/op_amps.xml'] = '7VnbbtNAEP0Vy69Vmr3ajtRUQiAQD/AAglfkhm2zwjc5bgt/j69pNjnr5rItCNqHNJ2e2fWs58zZnb1YLeNCrbwsTtXcT3/elHGxPFeJWlSlXsTJeV58i9Ni5V9etEgvXhX1/+b+XVzq+CpRvrec+wHz+xFe52kRl3GVl763qsr8h7rX36saorOlKnXle/dznxJSj7fIs6weSufZqv2jhsc6q/qBvp5R3ytql1RVqpz7xPd+tp+/6s9zwhn3p9CNjbhxKSLsNkFeNb51pNgnv62AF92aa2rEeRUvftyU+W32/fKiiKvl5UWa36nGT3QPyRqfRGetLepthrEHita4SPKVambpBptujn+dl2r9XSdJ9z6m2xP3QQbGJL2Ro5k749q9M1KEpAYSRtPkwoN1gDK5uxic2G2GcXA2RgTOG3NsoRCstfXLvF7Jsn6xDQFEm9esy4DOgTR4Y9lHwGwXPd18fdOWfKMcDNccfKOvr1Wpsko74eEYn4gMnotPov45gk8UEQqmtXRMqBARStipvOXOkLuZmGQ3gUNURaTVxh/NfoboCZdxYDKHTEZxQ85Tibg8M5AEIQlA/u0R7VdPiKWgHFwiwqFEvM+q2vHJy4Mkz1ceIiKPKQ8hKg8hKg+h4/IQovKAZu6M2+UBuRu2gDzYBueA7+IiabXxEJApNCmyYdwmUwjJFILdA0NxM/ToxAixs1FhAAkAkg3gXqQbApMOhfl9dqfKSmc33qu0SPS1Vi/q/KLOp6gzRbLDyb4CtYfqnaZQo9Q6XdBma2p9uE0qfaevHtO0mXycU3Wmn40d7EQYWSkysTrSQ+gBD1UhelvcMT3g7gYdxwTI7/03ZhRtjSja7MGoZ4ggDOU9H8l7icQ/QFIWIeQMsU6ghYPGANW+gIFVMiMiVtsMrZH5lMFIl8G6E9qrBojHakCDu2+dmrcabYy/NzwIHarxxzybaPeKPBlRZBlxW9vqRZFF+Ick9VjVFyceJIfGG9zJOxRfg0mcbyz2SUwS69PkJ3WjMs9h63eEQoyyQ1q4vVfAI34UiZg85lRJUHklKMuIIw71NBAS5Dw0do9jEoGT3b4nJ6iFS2ALFwxJUdSUgC4JR0hzdo6QHAUpN5fjEBYJflDbNnKoR59vr+rUXDwxfwiz7V4n9CjlmrD/WLqcq48E4rPf1YVT4Rm7h0EqzA49Pwtm7X5tay7aFdh1+Fkl09X1jyBO60iauu0xjRUGGnRpdOhNrLU3dcZH3IbK8NLS+mdbWnLkOtjp9nu4nUHtAmjk6BSPAqIgIApwHOCerOtmvWgeQdOD0Pz0KtaE1JHzS6arX967mq7e2zxJ8vvT65jORipLdEyJCI6pD+hwADe/0tXhAE6yJoW5wUdb7Ejunmq43QZPOuhwIOxHom0CwETqfq8ufwM=';f['electrical/opto_electronics.xml'] = '7VlRb6M4EP4riPdS29hgS21ftvt20q220t7jiU1pg5aGCOi2++/PgE08zkCattnT9XhKMp4Z2+NvPo8nF8062+ZNsMke8svw4fm+zrbrKC/zVVsXq6yMqm1b/T38rjbFqgmvLnqTIGu2WngZ/szqIvte5mGwvgxVEtHQOEuDm/z+Id+0wXXRbMvsVxg02smP/Km4bbVusVnnddGGwZPW5VGqPa+qzUY7LapNc351cVfV+X1dPW5ury62Wbu+uniofubB82XISMTC4Je2C7VeWWwGqYxELyWuVKgo3pcmIkp6aRIpoJ0az5QD14lRH8Srsmry8916EmnmUFrNMeu31ZslEfCX0kj2A7HU87nrio0nLqCFSHYWwtuftHMIdHHMrF0QrenOpcxe9aZBIJPEhtfbT6/YDcjEG6Bm2doCuBJ8N4fEVselUZAMRkJbDsuWCg7wLpZ9sDuwOQNUTAwo6ycG6qlRtzP7S6N2t358KDch9+NjV+aHh1htEP8YBGZ0To0Te1x750m6HOsgknrYtaDSoQMDjEwM6I0I1BWL7RzEm4MDsb82bcdRwOslcAtfMEAZDndz+FodRFLaPPT809TNP7us84E27oqyHKink7m0ct5z2SFKU5OUFjwV7Tq4/jJHbd2pL9S2UNtCbQu1nZba8rIstk3esVY399Pw0cU1NVGSJkpvZcSxyFNLkbcw4cKECxP+e0w4gkyZ7dAUzSlPLAwkmZecXI2rAmIypiYQM5MTTOKrotLEJPGShtnda2yAXI/51EBs6UzAJTObExp8ykM/BQOnKozVUhgv18FyHSzXwXIdfJTr4Dc9Jigh9hL5I3vYztwXgsDbov+htbNCXzuDh5u/wmCrDR7yNq/7FOwS0bJ7v+M9k8+oidyZnIM5v2erH/gFNSS8JPskwPpzy+pVUGb1fX6mv53dldl9P173J6Y/B8WgecrzrRmmYWBGn8+y56I5q6s26xZiPZM3ORZk0jGD9427Nw80525E3MMHsIChooO/7uxdeBLDgQc2Rc2m6LHRisWbPPPpcAkCycHdnonTqzMkEWOCfL4O6EyGdBMeSpFig+F9AFMkYinQLKkeW8SMemYvzZTYBA1UR+4RjRRHDMFhVDpjMAitYjo9XQIUJdkvMGW6S7RRb5DFU3qjjO/bovvsSXCUHpVYx6IpJS6a2EnRlJrK+Ug0GbMj0UQJcr6cIOhI34vGZubg2KGjS0wJAkHKEGwJBINySs/DIEwIgeCcIThnCM7ZPs5TNYlzTjCc83chRgfKxf26Pcs0Vn5mbX4b3Hz6ugD7vwrsQREUrrgxd4THQtvowQc6YpvKnew3QjsZof3ntq3OVtXjtszrGUwr9QJIU7TUpcq5uhArhhfIJJ6x0okwPxmdMpuf7UBBXmupDd8QFCdte9NXJANPzIM5jr2HoUCu8p02wExstWFhzaF4b0oWz2jvTcnAlPj6GBRbZWHFMMdGMZeoNmPwHrBOCCr2MnDXh0jROWMw5+hF4M4T4J0qrC9IceV44iih2M9p/0mDns04Y8zh631sXDK0uE3tmfIE3a0XhLGnoyL+3n1eSiEZ6YzdNEXTVvVJ71iUIL5NEssch32b5JX0+Gc+xSDOmNNT8l+5AmlaMXBrMbT/zJA+FVXYRGYbanKiXfPPER5VIDjtIGXY1VQ3bglwsKYQAnkoC0h+2PVqCw0WYc84gtinmL1KUXtKyeEMN21QqWA/3Xafgd/EsoFksEGPJaSTRIFJpf58vGvIPBGxToN0l/9Oz8Mv66qtbovqNl9K6Q9fSscft5RWENHB13y4vE7cSXsNqOcRPcnA4m31rQk2vKWkI/TaARxtXXmqWDGpGAJRgUAUM5YSgeiLG3ZkH6KorfMPM8am9n3BhvgnPHSCNVSJr8apmMLpSXt08hU4lS97hOFBeitMCQZTrGs1xykfiElPRo/xQo8fhcpezPTe0wP9bwVW8LFEeyCIpimfoWbCEE30LxKDeaj5ghvp/ZrMN1WZ1cEnjbMPUBBjbMopQpECe+4aYYpp/r94d5JR9mqGeCCl4TY0oR56P4cfbMNnc/UP';diff --git a/src/main/webapp/js/viewer-static.min.js b/src/main/webapp/js/viewer-static.min.jsindex cb4cc319d..d8f4d8cf2 100644--- a/src/main/webapp/js/viewer-static.min.js+++ b/src/main/webapp/js/viewer-static.min.js@@ -31,7 +31,7 @@ b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io")))})();"1"==urlPa"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ADD_ATTR:["target","content","pointer-events","requiredFeatures"]};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";-window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"30.3.13",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"30.3.14",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&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."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),IS_MT:0<=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."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!==document.createElementNS("http://www.w3.org/2000/svg","foreignObject").toString()||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),@@ -375,9 +375,9 @@ mxSvgCanvas2D.prototype.getAlternateTextLines=function(a,b,c,d,e,f){var g=this.sa[m].split(/\s+/),p="",q=0;q<n.length;q++)if(0<n[q].length){var r=0<p.length?p+" "+n[q]:n[q];for(0<p.length&&l.measureText(r).width>k?(b.push(p),p=n[q]):p=r;1<p.length&&l.measureText(p).width>k&&/[\u2E80-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF]/.test(p);){for(r=p.length-1;1<r&&l.measureText(p.substring(0,r)).width>k;)r--;b.push(p.substring(0,r));p=p.substring(r)}}b.push(p)}a=b}(f||"fill"==e)&&0<c&&(c=Math.max(1,Math.floor(c/Math.round(mxConstants.LINE_HEIGHT*g.fontSize))),a.length>c&&(a=a.slice(0,c),a[a.length-1]+="..."));if(f&&!d&&null!=l)for(m=0;m<a.length;m++)if(l.measureText(a[m]).width>k){for(r=a[m].length-1;1<r&&l.measureText(a[m].substring(0,r)+"...").width>k;)r--;a[m]=mxUtils.trim(a[m].substring(0,r))+"..."}return a};mxSvgCanvas2D.prototype.createAlternateContent=function(a,b,c,d,e,f,g,k,l,m,n,p,q){m=this.getAlternateText(a,b,c,d,e,f,g,k,l,m,n,p,q);a=this.state;if(null!=m&&0<a.fontSize){f=k==mxConstants.ALIGN_TOP?1:k==mxConstants.ALIGN_BOTTOM?0:.3;g=g==mxConstants.ALIGN_RIGHT?"end":g==mxConstants.ALIGN_LEFT?"start":"middle";d=this.getAlternateTextLines(m,d,e,l,n,p);e=Math.round(mxConstants.LINE_HEIGHT*a.fontSize);b=Math.round(b+a.dx);c=c+a.dy+f*a.fontSize-(k==mxConstants.ALIGN_TOP?0:k==mxConstants.ALIGN_BOTTOM?-(d.length-1)*e:(d.length-1)*e/2);k=this.createElement("text");k.setAttribute("x",b);k.setAttribute("y",Math.round(c));k.setAttribute("fill",a.fontColor||"black");k.setAttribute("font-family",mxUtils.parseCssFontFamily(a.fontFamily));k.setAttribute("font-size",Math.round(a.fontSize)+"px");"start"!=g&&k.setAttribute("text-anchor",g);(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&k.setAttribute("font-weight","bold");(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&k.setAttribute("font-style",-"italic");l=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&l.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&l.push("line-through");0<l.length&&(k.setAttribute("text-decoration",l.join(" ")),(a.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(k.style.textDecorationStyle="dotted"));if(1<d.length)for(a=0;a<d.length;a++)l=this.createElement("tspan"),l.setAttribute("x",b),l.setAttribute("y",Math.round(c+-a*e)),mxUtils.write(l,d[a]),k.appendChild(l);else mxUtils.write(k,d[0]);return k}return null};+(d.length-1)*e:(d.length-1)*e/2);l=this.getLightDarkColor(a.fontColor||"black");k=this.createElement("text");k.setAttribute("x",b);k.setAttribute("y",Math.round(c));"transparent"==l.light?k.setAttribute("fill","none"):(k.setAttribute("fill",l.light),k.style.fill=l.cssText);k.setAttribute("font-family",mxUtils.parseCssFontFamily(a.fontFamily));k.setAttribute("font-size",Math.round(a.fontSize)+"px");"start"!=g&&k.setAttribute("text-anchor",g);(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&+k.setAttribute("font-weight","bold");(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&k.setAttribute("font-style","italic");g=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&g.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&g.push("line-through");0<g.length&&(k.setAttribute("text-decoration",g.join(" ")),(a.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(k.style.textDecorationStyle=+"dotted"));if(1<d.length)for(a=0;a<d.length;a++)g=this.createElement("tspan"),g.setAttribute("x",b),g.setAttribute("y",Math.round(c+a*e)),mxUtils.write(g,d[a]),k.appendChild(g);else mxUtils.write(k,d[0]);return k}return null};mxSvgCanvas2D.prototype.createGradientId=function(a,b,c,d,e){a=a.toLowerCase()+"-"+c;b=b.toLowerCase()+"-"+d;c=null;null==e||e==mxConstants.DIRECTION_SOUTH?c="s":e==mxConstants.DIRECTION_EAST?c="e":e==mxConstants.DIRECTION_RADIAL?c="r":(d=a,a=b,b=d,e==mxConstants.DIRECTION_NORTH?c="s":e==mxConstants.DIRECTION_WEST&&(c="e"));return((""!=this.idPrefix?this.idPrefix:"mx")+"-gradient-"+a+"-"+b+"-"+c).replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};mxSvgCanvas2D.prototype.getSvgGradient=function(a,b,c,d,e){a=this.getLightDarkColor(a);b=this.getLightDarkColor(b);var f=this.createGradientId(a.cssText,b.cssText,c,d,e),g=this.gradients[f];if(null==g){var k=this.root.ownerSVGElement,l=0,m=f+"-"+l;if(null!=k)for(g=k.ownerDocument.getElementById(m);null!=g&&g.ownerSVGElement!=k;)m=f+"-"+l++,g=k.ownerDocument.getElementById(m);else m="id"+ ++this.refCount;null==g&&(g=this.createSvgGradient(a,b,c,d,e),g.setAttribute("id",m),null!=this.defs?this.defs.appendChild(g):k.appendChild(g));this.gradients[f]=g}return g.getAttribute("id")};@@ -400,8 +400,8 @@ mxSvgCanvas2D.prototype.addNode=function(a,b){var c=this.addTitle(this.node),d=tc.setAttribute("transform",d.transform);this.pointerEvents?c.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none");0<this.strokeTolerance&&(!a||null==d.fillColor||!mxShape.forceFilledPointerEvents&&!this.pointerEvents&&null==this.originalRoot)&&this.addTolerance(c);("rect"!=c.nodeName&&"path"!=c.nodeName&&"ellipse"!=c.nodeName||"none"!=c.getAttribute("fill")&&"transparent"!=c.getAttribute("fill")||"none"!=c.getAttribute("stroke")||"none"!=c.getAttribute("pointer-events"))&&this.root.appendChild(c);this.node=null}};mxSvgCanvas2D.prototype.getShadowFilter=function(){var a=this.state,b=a.shadowStyle;if(1!=a.scale){var c=b.split("(");if(0<c.length){var d=c[1].split(" ");3<d.length&&(b=function(e){return Math.round(parseFloat(d[e])*a.scale*100)/100+"px"},b=c[0]+"("+b(0)+" "+b(1)+" "+b(2)+" "+d.slice(3).join(" ")+(2<c.length?"("+c.slice(2).join("("):""))}}return b};mxSvgCanvas2D.prototype.addTolerance=function(a){this.root.appendChild(this.createTolerance(a))};mxSvgCanvas2D.prototype.updateFill=function(){var a=this.state;(1>a.alpha||1>a.fillAlpha)&&this.node.setAttribute("fill-opacity",a.alpha*a.fillAlpha);var b=!1;if(null!=a.fillColor)if(null!=a.gradientColor&&a.gradientColor!=mxConstants.NONE){b=!0;var c=this.getSvgGradient(String(a.fillColor),String(a.gradientColor),a.gradientFillAlpha,a.gradientAlpha,a.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c="url("+d+"#"+c+-")"}else c="url(#"+c+")";d=c}else c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText;var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill",-"url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};+")"}else c="url(#"+c+")";d=c}else String(a.fillColor).toLowerCase()==mxConstants.NONE?c=d="none":(c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText);var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,+"\\$1"),this.node.setAttribute("fill","url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};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 a=this.state,b=this.getLightDarkColor(String(a.strokeColor).toLowerCase());this.node.setAttribute("stroke",b.light);this.node.style.stroke=b.cssText;(1>a.alpha||1>a.strokeAlpha)&&this.node.setAttribute("stroke-opacity",a.alpha*a.strokeAlpha);b=this.getCurrentStrokeWidth();1!=b&&this.node.setAttribute("stroke-width",b);"path"==this.node.nodeName&&this.updateStrokeAttributes();a.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((a.fixDash?1:a.strokeWidth)*a.scale))};mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var a=this.state;null!=a.lineJoin&&"miter"!=a.lineJoin&&this.node.setAttribute("stroke-linejoin",a.lineJoin);if(null!=a.lineCap){var b=a.lineCap;"flat"==b&&(b="butt");"butt"!=b&&this.node.setAttribute("stroke-linecap",b)}null==a.miterLimit||this.styleEnabled&&10==a.miterLimit||this.node.setAttribute("stroke-miterlimit",a.miterLimit)};mxSvgCanvas2D.prototype.createDashPattern=function(a){var b=[];if("string"===typeof this.state.dashPattern){var c=this.state.dashPattern.split(" ");if(0<c.length)for(var d=0;d<c.length;d++)b[d]=Math.round(Number(c[d])*a*100)/100}return b.join(" ")};@@ -1941,7 +1941,7 @@ var mxStylesheetCodec=mxCodecRegistry.register(function(){var a=new mxObjectCodefunction(b,c){b=typeof c;"function"==b?c=mxStyleRegistry.getName(c):"object"==b&&(c=null);return c};a.decode=function(b,c,d){d=d||new this.template.constructor;var e=c.getAttribute("id");null!=e&&(b.objects[e]=d);for(c=c.firstChild;null!=c;){if(!this.processInclude(b,c,d)&&"add"==c.nodeName&&(e=c.getAttribute("as"),null!=e)){var f=c.getAttribute("extend"),g=null!=f?mxUtils.clone(d.styles[f]):null;null==g&&(null!=f&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+f+" not found to extend"),g={});for(f=c.firstChild;null!=f;){if(f.nodeType==mxConstants.NODETYPE_ELEMENT){var k=f.getAttribute("as");if("add"==f.nodeName){var l=mxUtils.getTextContent(f);null!=l&&0<l.length&&mxStylesheetCodec.allowEval?l=mxUtils.eval(l):(l=f.getAttribute("value"),mxUtils.isNumeric(l)&&(l=parseFloat(l)));null!=l&&(g[k]=l)}else"remove"==f.nodeName&&delete g[k]}f=f.nextSibling}d.putCellStyle(e,g)}c=c.nextSibling}return d};return a}());mxStylesheetCodec.allowEval=!1;var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(b){return b.raw=b};$jscomp.createTemplateTagFirstArgWithRaw=function(b,d){b.raw=d;return b};$jscomp.arrayIteratorImpl=function(b){var d=0;return function(){return d<b.length?{done:!1,value:b[d++]}:{done:!0}}};$jscomp.arrayIterator=function(b){return{next:$jscomp.arrayIteratorImpl(b)}};$jscomp.makeIterator=function(b){var d="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];return d?d.call(b):$jscomp.arrayIterator(b)};-Editor=function(b,d,m,p,v){mxEventSource.call(this);this.chromeless=null!=b?b:this.chromeless;this.initStencilRegistry();this.graph=p||this.createGraph(d,m);this.editable=null!=v?v:!b;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(n,y){this.status=n;this.statusFunction=y;this.fireEvent(new mxEventObject("statusChanged"))};+Editor=function(b,d,m,p,u){mxEventSource.call(this);this.chromeless=null!=b?b:this.chromeless;this.initStencilRegistry();this.graph=p||this.createGraph(d,m);this.editable=null!=u?u:!b;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(n,y){this.status=n;this.statusFunction=y;this.fireEvent(new mxEventObject("statusChanged"))};this.getStatus=function(){return this.status};this.graphChangeListener=function(n,y){n=null!=y?y.getProperty("edit"):null;null!=n&&n.ignoreEdit||this.setModified(!0)};this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)}));this.graph.resetViewOnRootChange=!1;this.init()};mxConstants.POINTS=1;mxConstants.MILLIMETERS=2;mxConstants.INCHES=3;mxConstants.METERS=4;mxConstants.PIXELS_PER_MM=3.937;mxConstants.PIXELS_PER_INCH=100;Editor.pageCounter=0;(function(){try{for(var b=window;null!=b.opener&&"undefined"!==typeof b.opener.Editor&&!isNaN(b.opener.Editor.pageCounter)&&b.opener!=b;)b=b.opener;null!=b&&(b.Editor.pageCounter++,Editor.pageCounter=b.Editor.pageCounter)}catch(d){}})();Editor.defaultHtmlFont='-apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, ui-sans-serif, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"';Editor.useLocalStorage="undefined"!=typeof Storage&&mxClient.IS_IOS;Editor.smallScreenWidth=1024;Editor.helpImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDc4LTI0MHEyMSAwIDM1LjUtMTQuNVQ1MjgtMjkwcTAtMjEtMTQuNS0zNS41VDQ3OC0zNDBxLTIxIDAtMzUuNSAxNC41VDQyOC0yOTBxMCAyMSAxNC41IDM1LjVUNDc4LTI0MFptLTM2LTE1NGg3NHEwLTMzIDcuNS01MnQ0Mi41LTUycTI2LTI2IDQxLTQ5LjV0MTUtNTYuNXEwLTU2LTQxLTg2dC05Ny0zMHEtNTcgMC05Mi41IDMwVDM0Mi02MThsNjYgMjZxNS0xOCAyMi41LTM5dDUzLjUtMjFxMzIgMCA0OCAxNy41dDE2IDM4LjVxMCAyMC0xMiAzNy41VDUwNi01MjZxLTQ0IDM5LTU0IDU5dC0xMCA3M1ptMzggMzE0cS04MyAwLTE1Ni0zMS41VDE5Ny0xOTdxLTU0LTU0LTg1LjUtMTI3VDgwLTQ4MHEwLTgzIDMxLjUtMTU2VDE5Ny03NjNxNTQtNTQgMTI3LTg1LjVUNDgwLTg4MHE4MyAwIDE1NiAzMS41VDc2My03NjNxNTQgNTQgODUuNSAxMjdUODgwLTQ4MHEwIDgzLTMxLjUgMTU2VDc2My0xOTdxLTU0IDU0LTEyNyA4NS41VDQ4MC04MFptMC04MHExMzQgMCAyMjctOTN0OTMtMjI3cTAtMTM0LTkzLTIyN3QtMjI3LTkzcS0xMzQgMC0yMjcgOTN0LTkzIDIyN3EwIDEzNCA5MyAyMjd0MjI3IDkzWm0wLTMyMFoiLz48L3N2Zz4=";@@ -2021,26 +2021,26 @@ Editor.fillStyles=[{val:"auto",dispName:"Auto",res:"automatic"},{val:"hatch",disEditor.hintOffset=20;Editor.shapePickerHoverDelay=300;Editor.fitWindowBorders=null;Editor.suppressNewWindows=null!=window.urlParams&&"1"==urlParams.suppressNewWindows;Editor.popupsAllowed=(null!=window.urlParams?"1"!=urlParams.noDevice:!0)&&!Editor.suppressNewWindows;Editor.simpleLabels=!1;Editor.optimizeHtmlLabels=!1;Editor.enableNativeClipboard=window==window.top&&null!=navigator.clipboard&&null!=navigator.clipboard.read;Editor.sketchMode=!1;Editor.darkMode=!1;Editor.currentTheme=uiTheme;Editor.darkColor="#121212";Editor.darkColorVar="--ge-dark-color";Editor.fontSizeUnit="px";Editor.transitionDelay=.1;Editor.pageSizeUnit=mxConstants.INCHES;Editor.removeImageMetadata=!0;Editor.showConnectHandle=!1;Editor.enableInlineToolbar=!0;Editor.enableAutoRotateLabels=!0;Editor.isDarkMode=function(){return Editor.darkMode};Editor.isPngDataUrl=function(b){return null!=b&&"data:image/png;"==b.substring(0,15)};Editor.isJpgDataUrl=function(b){return null!=b&&("data:image/jpg;"==b.substring(0,15)||"data:image/jpeg;"==b.substring(0,16))};Editor.isPngData=function(b){return 8<b.length&&137==b.charCodeAt(0)&&80==b.charCodeAt(1)&&78==b.charCodeAt(2)&&71==b.charCodeAt(3)&&13==b.charCodeAt(4)&&10==b.charCodeAt(5)&&26==b.charCodeAt(6)&&10==b.charCodeAt(7)};Editor.isJpgData=function(b){return 2<b.length&&255==b.charCodeAt(0)&&216==b.charCodeAt(1)};-Editor.stripImageMetadata=function(b,d){if(null!=b&&d&&(Editor.isJpgDataUrl(b)||Editor.isPngDataUrl(b))){d=b.indexOf(",")+1;var m=b.substring(d),p=window.atob&&!mxClient.IS_SF?atob(m):Base64.decode(m,!0),v=new ArrayBuffer(p.length),n=new Uint8Array(v);for(m=0;m<p.length;m++)n[m]=p.charCodeAt(m);n=null;try{Editor.isJpgData(p)?n=Editor.stripJpgMetadata(v):Editor.isPngData(p)&&(n=Editor.stripPngMetadata(v))}catch(y){}if(null!=n){p="";for(m=0;m<n.length;m++)p+=String.fromCharCode(n[m]);b=b.substring(0,+Editor.stripImageMetadata=function(b,d){if(null!=b&&d&&(Editor.isJpgDataUrl(b)||Editor.isPngDataUrl(b))){d=b.indexOf(",")+1;var m=b.substring(d),p=window.atob&&!mxClient.IS_SF?atob(m):Base64.decode(m,!0),u=new ArrayBuffer(p.length),n=new Uint8Array(u);for(m=0;m<p.length;m++)n[m]=p.charCodeAt(m);n=null;try{Editor.isJpgData(p)?n=Editor.stripJpgMetadata(u):Editor.isPngData(p)&&(n=Editor.stripPngMetadata(u))}catch(y){}if(null!=n){p="";for(m=0;m<n.length;m++)p+=String.fromCharCode(n[m]);b=b.substring(0,d)+btoa(p)}}return b};-Editor.stripJpgMetadata=function(b){var d=new DataView(b),m=[];m.push(new Uint8Array(b,0,2));for(var p=2;p<b.byteLength-1;){var v=d.getUint16(p);if(65498===v){m.push(new Uint8Array(b,p));break}if(65488<=v&&65497>=v)m.push(new Uint8Array(b,p,2)),p+=2;else{var n=d.getUint16(p+2),y=65506===v;65505===v||y||m.push(new Uint8Array(b,p,2+n));p+=2+n}}b=m.reduce(function(C,P){return C+P.length},0);b=new Uint8Array(b);d=0;m=$jscomp.makeIterator(m);for(p=m.next();!p.done;p=m.next())p=p.value,b.set(p,d),d+=p.length;+Editor.stripJpgMetadata=function(b){var d=new DataView(b),m=[];m.push(new Uint8Array(b,0,2));for(var p=2;p<b.byteLength-1;){var u=d.getUint16(p);if(65498===u){m.push(new Uint8Array(b,p));break}if(65488<=u&&65497>=u)m.push(new Uint8Array(b,p,2)),p+=2;else{var n=d.getUint16(p+2),y=65506===u;65505===u||y||m.push(new Uint8Array(b,p,2+n));p+=2+n}}b=m.reduce(function(B,P){return B+P.length},0);b=new Uint8Array(b);d=0;m=$jscomp.makeIterator(m);for(p=m.next();!p.done;p=m.next())p=p.value,b.set(p,d),d+=p.length;return b};-Editor.stripPngMetadata=function(b){var d=new DataView(b),m=new Set("eXIf tEXt iTXt zTXt iCCP tIME".split(" ")),p=[];p.push(new Uint8Array(b,0,8));for(var v=8;v<b.byteLength;){var n=d.getUint32(v),y=String.fromCharCode(d.getUint8(v+4),d.getUint8(v+5),d.getUint8(v+6),d.getUint8(v+7));n=8+n+4;m.has(y)||p.push(new Uint8Array(b,v,n));v+=n;if("IEND"===y)break}b=p.reduce(function(C,P){return C+P.length},0);b=new Uint8Array(b);d=0;p=$jscomp.makeIterator(p);for(m=p.next();!m.done;m=p.next())m=m.value,b.set(m,+Editor.stripPngMetadata=function(b){var d=new DataView(b),m=new Set("eXIf tEXt iTXt zTXt iCCP tIME".split(" ")),p=[];p.push(new Uint8Array(b,0,8));for(var u=8;u<b.byteLength;){var n=d.getUint32(u),y=String.fromCharCode(d.getUint8(u+4),d.getUint8(u+5),d.getUint8(u+6),d.getUint8(u+7));n=8+n+4;m.has(y)||p.push(new Uint8Array(b,u,n));u+=n;if("IEND"===y)break}b=p.reduce(function(B,P){return B+P.length},0);b=new Uint8Array(b);d=0;p=$jscomp.makeIterator(p);for(m=p.next();!m.done;m=p.next())m=m.value,b.set(m,d),d+=m.length;return b};Editor.convertHtmlToText=function(b){if(null!=b){var d=document.createElement("div");d.innerHTML=Graph.sanitizeHtml(b);return mxUtils.extractTextWithWhitespace(d.childNodes)}return null};-Editor.extractGraphModelFromText=function(b){function d(n){var y=n.indexOf("```");0<=y&&(n=n.substring(n,0,y+6));return n}function m(n){var y=n.lastIndexOf("```");0<=y&&(n=n.substring(y+3));return n}var p=b.indexOf("<mxGraphModel "),v=b.indexOf("</mxGraphModel>");0>p&&(p=b.indexOf("<mxGraphModel>"));return 0<=p&&v>p?[mxUtils.trim(d(b.substring(0,p))),b.substring(p,v+15),mxUtils.trim(m(b.substring(v+15)))]:[b,"",""]};-Editor.extractGraphModelFromPng=function(b){var d=null;try{var m=b.substring(b.indexOf(",")+1),p=window.atob&&!mxClient.IS_SF?atob(m):Base64.decode(m,!0);EditorUi.parsePng(p,mxUtils.bind(this,function(v,n,y){v=p.substring(v+8,v+8+y);if("zTXt"==n){y=v.indexOf(String.fromCharCode(0));var C=v.substring(0,y);if("mxGraphModel"==C||"mxfile"==C){v=Graph.stringToArrayBuffer(v.substring(y+2));y=null;try{y=pako.inflate(v,{to:"string"})}catch(P){y=pako.inflateRaw(v,{to:"string"})}y=null!=y?y.replace(/\+/g," "):-null;null!=y&&0<y.length&&(d=y)}}else"tEXt"==n&&(v=v.split(String.fromCharCode(0)),1<v.length&&("mxGraphModel"==v[0]||"mxfile"==v[0])&&(d=v[1]));if(null!=d||"IDAT"==n)return!0}))}catch(v){}null!=d&&"%"==d.charAt(0)&&(d=decodeURIComponent(d));null!=d&&"%"==d.charAt(0)&&(d=decodeURIComponent(d));return d};+Editor.extractGraphModelFromText=function(b){function d(n){var y=n.indexOf("```");0<=y&&(n=n.substring(n,0,y+6));return n}function m(n){var y=n.lastIndexOf("```");0<=y&&(n=n.substring(y+3));return n}var p=b.indexOf("<mxGraphModel "),u=b.indexOf("</mxGraphModel>");0>p&&(p=b.indexOf("<mxGraphModel>"));return 0<=p&&u>p?[mxUtils.trim(d(b.substring(0,p))),b.substring(p,u+15),mxUtils.trim(m(b.substring(u+15)))]:[b,"",""]};+Editor.extractGraphModelFromPng=function(b){var d=null;try{var m=b.substring(b.indexOf(",")+1),p=window.atob&&!mxClient.IS_SF?atob(m):Base64.decode(m,!0);EditorUi.parsePng(p,mxUtils.bind(this,function(u,n,y){u=p.substring(u+8,u+8+y);if("zTXt"==n){y=u.indexOf(String.fromCharCode(0));var B=u.substring(0,y);if("mxGraphModel"==B||"mxfile"==B){u=Graph.stringToArrayBuffer(u.substring(y+2));y=null;try{y=pako.inflate(u,{to:"string"})}catch(P){y=pako.inflateRaw(u,{to:"string"})}y=null!=y?y.replace(/\+/g," "):+null;null!=y&&0<y.length&&(d=y)}}else"tEXt"==n&&(u=u.split(String.fromCharCode(0)),1<u.length&&("mxGraphModel"==u[0]||"mxfile"==u[0])&&(d=u[1]));if(null!=d||"IDAT"==n)return!0}))}catch(u){}null!=d&&"%"==d.charAt(0)&&(d=decodeURIComponent(d));null!=d&&"%"==d.charAt(0)&&(d=decodeURIComponent(d));return d};Editor.getLabelForStylename=function(b){var d=b.match(/^([A-Za-z]*)(\d*)$/);null!=d&&1<d.length&&(b=mxUtils.trim(d[1].replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,function(m){return m.toUpperCase()}).replace(/Color[s]?/g,"")),b=mxUtils.trim(b+(0<d[2].length?" ("+d[2]+")":"")));return b};-Editor.soundex=function(b){if(null==b||0==b.length)return"";var d=[],m=1;d[0]=b[0].toUpperCase();for(var p=1,v=b.length;p<v;p++){var n=b[p].toUpperCase().charCodeAt(0)-65;if(0<=n&&25>=n&&"0"!="01230120022455012603010202"[n]&&("01230120022455012603010202"[n]!=d[m-1]&&(d[m]="01230120022455012603010202"[n],m++),3<m))break}if(3>=m)for(;3>=m;)d[m]="0",m++;return d.join("")};+Editor.soundex=function(b){if(null==b||0==b.length)return"";var d=[],m=1;d[0]=b[0].toUpperCase();for(var p=1,u=b.length;p<u;p++){var n=b[p].toUpperCase().charCodeAt(0)-65;if(0<=n&&25>=n&&"0"!="01230120022455012603010202"[n]&&("01230120022455012603010202"[n]!=d[m-1]&&(d[m]="01230120022455012603010202"[n],m++),3<m))break}if(3>=m)for(;3>=m;)d[m]="0",m++;return d.join("")};Editor.selectFilename=function(b){var d=b.value.lastIndexOf(".");if(0<d){var m=b.value.substring(d+1);"drawio"!=m&&0<=mxUtils.indexOf(["png","svg","html","xml","pdf"],m)&&(m=b.value.lastIndexOf(".drawio.",d),0<m&&(d=m))}d=0<d?d:b.value.length;Editor.selectSubstring(b,0,d)};Editor.selectSubstring=function(b,d,m){b.focus();"undefined"!=typeof b.selectionStart?(b.selectionStart=d,b.selectionEnd=m):document.selection&&document.selection.createRange&&(b.select(),b=document.selection.createRange(),b.collapse(!0),b.moveEnd("character",m),b.moveStart("character",d),b.select())};Editor.toUnit=function(b,d){return d==mxConstants.INCHES?Math.round(1E3*b/mxConstants.PIXELS_PER_INCH)/1E3:d==mxConstants.MILLIMETERS?Math.round(1E3*b/mxConstants.PIXELS_PER_MM)/1E3:d==mxConstants.METERS?Math.round(1E5*b/(1E3*mxConstants.PIXELS_PER_MM))/1E5:Math.round(10*b)/10};Editor.fromUnit=function(b,d){d==mxConstants.INCHES?b*=mxConstants.PIXELS_PER_INCH:d==mxConstants.MILLIMETERS?b*=mxConstants.PIXELS_PER_MM:d==mxConstants.METERS&&(b=b*mxConstants.PIXELS_PER_MM*1E3);return Math.round(10*b)/10};Editor.getCursorMoveStep=function(b){return b==mxConstants.MILLIMETERS?.1*mxConstants.PIXELS_PER_MM:b==mxConstants.INCHES?.01*mxConstants.PIXELS_PER_INCH:b==mxConstants.METERS?.1*mxConstants.PIXELS_PER_MM:1};mxUtils.extend(Editor,mxEventSource);Editor.prototype.originalNoForeignObject=mxClient.NO_FO;Editor.prototype.transparentImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhMAAwAIAAAP///wAAACH5BAEAAAAALAAAAAAwADAAAAIxhI+py+0Po5y02ouz3rz7D4biSJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8egpAAA7":IMAGE_PATH+"/transparent.gif";Editor.prototype.extendCanvas=!0;Editor.prototype.chromeless=!1;Editor.prototype.cancelFirst=!0;Editor.prototype.enabled=!0;Editor.prototype.filename=null;Editor.prototype.modified=!1;Editor.prototype.autosave=!0;Editor.prototype.appName=document.title;Editor.prototype.editBlankUrl=window.location.origin+window.location.pathname;Editor.prototype.defaultGraphOverflow="hidden";Editor.prototype.init=function(){};Editor.prototype.isChromelessView=function(){return this.chromeless};Editor.prototype.setAutosave=function(b){this.autosave=b;this.fireEvent(new mxEventObject("autosaveChanged"))};Editor.prototype.getEditBlankUrl=function(b){return this.editBlankUrl+b};-Editor.prototype.editAsNew=function(b,d,m,p){d=null!=d?"?title="+encodeURIComponent(d):"";m?d+=(0<d.length?"&":"?")+"lightbox=1":null!=urlParams.ui&&(d+=(0<d.length?"&":"?")+"ui="+urlParams.ui);null!=p&&(d+=(0<d.length?"&":"?")+"page-id="+p);if(navigator.standalone||"undefined"===typeof window.postMessage)this.graph.openLink(this.getEditBlankUrl(d)+"#R"+encodeURIComponent(b));else{var v=null,n=mxUtils.bind(this,function(C){"ready"==C.data&&C.source==v&&(mxEvent.removeListener(window,"message",n),-v.postMessage(b,"*"))});m=d.substring(1).split("&");p={client:1};for(d=0;d<m.length;d++){var y=m[d].split("=");p[y[0]]=y[1]||""}mxEvent.addListener(window,"message",n);v=this.graph.openLink(this.getEditBlankUrl("")+"#P"+encodeURIComponent(JSON.stringify(p)),null,!0)}};-Editor.prototype.createGraph=function(b,d){b=new Graph(null,d,null,null,b);b.transparentBackground=!1;var m=b.isCssTransformsSupported,p=this;b.isCssTransformsSupported=function(){return m.apply(this,arguments)&&(!p.chromeless||!mxClient.IS_SF)};this.chromeless||(b.isBlankLink=function(v){return!this.isExternalProtocol(v)});return b};+Editor.prototype.editAsNew=function(b,d,m,p){d=null!=d?"?title="+encodeURIComponent(d):"";m?d+=(0<d.length?"&":"?")+"lightbox=1":null!=urlParams.ui&&(d+=(0<d.length?"&":"?")+"ui="+urlParams.ui);null!=p&&(d+=(0<d.length?"&":"?")+"page-id="+p);if(navigator.standalone||"undefined"===typeof window.postMessage)this.graph.openLink(this.getEditBlankUrl(d)+"#R"+encodeURIComponent(b));else{var u=null,n=mxUtils.bind(this,function(B){"ready"==B.data&&B.source==u&&(mxEvent.removeListener(window,"message",n),+u.postMessage(b,"*"))});m=d.substring(1).split("&");p={client:1};for(d=0;d<m.length;d++){var y=m[d].split("=");p[y[0]]=y[1]||""}mxEvent.addListener(window,"message",n);u=this.graph.openLink(this.getEditBlankUrl("")+"#P"+encodeURIComponent(JSON.stringify(p)),null,!0)}};+Editor.prototype.createGraph=function(b,d){b=new Graph(null,d,null,null,b);b.transparentBackground=!1;var m=b.isCssTransformsSupported,p=this;b.isCssTransformsSupported=function(){return m.apply(this,arguments)&&(!p.chromeless||!mxClient.IS_SF)};this.chromeless||(b.isBlankLink=function(u){return!this.isExternalProtocol(u)});return b};Editor.prototype.resetGraph=function(){this.graph.gridEnabled=this.graph.defaultGridEnabled&&(!this.isChromelessView()||"1"==urlParams.grid);this.graph.graphHandler.guidesEnabled=!0;this.graph.setTooltips(null==window.urlParams||"0"!=urlParams.tooltips);this.graph.setConnectable(this.graph.defaultConnectable);this.graph.connectionArrowsEnabled=this.graph.defaultConnectionArrowsEnabled;this.graph.foldingEnabled=this.graph.defaultFoldingEnabled;this.graph.scrollbars=this.graph.defaultScrollbars;this.graph.pageVisible=this.graph.defaultPageVisible;this.graph.pageBreaksVisible=this.graph.pageVisible;this.graph.preferPageSize=this.graph.pageBreaksVisible;this.graph.background=null;this.graph.pageScale=mxGraph.prototype.pageScale;this.graph.pageFormat=mxGraph.prototype.pageFormat;this.graph.currentScale=1;this.graph.currentTranslate.x=0;this.graph.currentTranslate.y=0;this.updateGraphComponents();this.graph.view.setScale(1)};Editor.prototype.readGraphState=function(b){this.savedGraphState={};if(Editor.preserveViewState){var d=b.getAttribute("dx"),m=b.getAttribute("dy");null!=d&&(this.savedGraphState.dx=d);null!=m&&(this.savedGraphState.dy=m)}d=b.getAttribute("grid");if(null==d||""==d)d=this.graph.defaultGridEnabled?"1":"0";null!=urlParams.grid&&(this.savedGraphState.grid=d);this.graph.gridEnabled=(null!=urlParams.grid?"0"!=urlParams.grid:"0"!=d)&&(!this.isChromelessView()||"1"==urlParams.grid);this.graph.gridSize=parseFloat(b.getAttribute("gridSize"))||@@ -2054,186 +2054,186 @@ Editor.prototype.getGraphXml=function(b){if(null!=b?b:1){var d=new mxCodec(mxUtithis.graph.view.translate.x)/100),b.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100);b.setAttribute("grid",null!=d.grid?d.grid:this.graph.isGridEnabled()?"1":"0");b.setAttribute("gridSize",this.graph.gridSize);b.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0");b.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0");b.setAttribute("connect",null!=d.connect?d.connect:this.graph.connectionHandler.isEnabled()?"1":"0");b.setAttribute("arrows",null!=d.arrows?d.arrows:this.graph.connectionArrowsEnabled?"1":"0");b.setAttribute("fold",null!=d.fold?d.fold:this.graph.foldingEnabled?"1":"0");b.setAttribute("page",null!=d.page?d.page:this.graph.pageVisible?"1":"0");b.setAttribute("pageScale",this.graph.pageScale);b.setAttribute("pageWidth",this.graph.pageFormat.width);b.setAttribute("pageHeight",this.graph.pageFormat.height);null!=this.graph.background&&b.setAttribute("background",this.graph.background);return b};Editor.prototype.updateGraphComponents=function(){var b=this.graph;null!=b.container&&(b.view.validateBackground(),b.container.style.overflow=b.scrollbars?"auto":this.defaultGraphOverflow,this.fireEvent(new mxEventObject("updateGraphComponents")))};Editor.prototype.setModified=function(b){this.modified=b};Editor.prototype.setFilename=function(b){this.filename=b};-Editor.prototype.createUndoManager=function(){var b=this.graph,d=new mxUndoManager;this.undoListener=function(p,v){d.undoableEditHappened(v.getProperty("edit"))};var m=mxUtils.bind(this,function(p,v){this.undoListener.apply(this,arguments)});b.getModel().addListener(mxEvent.UNDO,m);b.getView().addListener(mxEvent.UNDO,m);m=function(p,v){p=v.getProperty("edit").changes;p=b.getSelectionCellsForChanges(p);v=!1;if(0<p.length){for(var n=[],y=0;y<p.length;y++)null!=b.view.getState(p[y])&&(n.push(p[y]),-v||(b.scrollCellToVisible(p[y]),v=!0));b.setSelectionCells(n)}};d.addListener(mxEvent.UNDO,m);d.addListener(mxEvent.REDO,m);return d};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(b){this.consumer=this.producer=null;this.done=b;this.args=null};OpenFile.prototype.setConsumer=function(b){this.consumer=b;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};+Editor.prototype.createUndoManager=function(){var b=this.graph,d=new mxUndoManager;this.undoListener=function(p,u){d.undoableEditHappened(u.getProperty("edit"))};var m=mxUtils.bind(this,function(p,u){this.undoListener.apply(this,arguments)});b.getModel().addListener(mxEvent.UNDO,m);b.getView().addListener(mxEvent.UNDO,m);m=function(p,u){p=u.getProperty("edit").changes;p=b.getSelectionCellsForChanges(p);u=!1;if(0<p.length){for(var n=[],y=0;y<p.length;y++)null!=b.view.getState(p[y])&&(n.push(p[y]),+u||(b.scrollCellToVisible(p[y]),u=!0));b.setSelectionCells(n)}};d.addListener(mxEvent.UNDO,m);d.addListener(mxEvent.REDO,m);return d};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(b){this.consumer=this.producer=null;this.done=b;this.args=null};OpenFile.prototype.setConsumer=function(b){this.consumer=b;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};OpenFile.prototype.error=function(b){this.cancel(!0);mxUtils.alert(b)};OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))};OpenFile.prototype.cancel=function(b){null!=this.done&&this.done(null!=b?b:!0)};-function Dialog(b,d,m,p,v,n,y,C,P,G,O){this.editorUi=b;null==this.bg&&(this.bg=b.createDiv("geBackground"));v&&null!=document.body&&document.body.appendChild(this.bg);v=b.createDiv(P?"geTransDialog":"geDialog");v.style.width=m+48+"px";null!=p&&(v.style.height=p+48+"px");"1"!=urlParams.embedInline||Editor.inlineFullscreen||null==b.embedViewport||(v.style.left=b.embedViewport.x+b.embedViewport.width/2+"px",v.style.top=b.embedViewport.y+b.embedViewport.height/2+"px");v.appendChild(d);null!=document.body&&-document.body.appendChild(v);null==p&&(v.style.height=d.scrollHeight+48+"px");if(n&&(d=document.createElement("div"),d.className="geButton",d.setAttribute("title",mxResources.get("close")),d.style.backgroundImage="url("+Editor.crossImage+")",d.style.position="absolute",d.style.top="0px",d.style.right="0px",mxEvent.addListener(d,"click",mxUtils.bind(this,function(){b.hideDialog(!0)})),v.appendChild(d),!O)){var U=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(c){U=!0}),null,mxUtils.bind(this,-function(c){U&&(b.hideDialog(!0),U=!1)}))}this.onDialogClose=y;this.container=v;null!=G&&this.addResizeHandler(G);b.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.prototype.noColorImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC";+function Dialog(b,d,m,p,u,n,y,B,P,G,O){this.editorUi=b;null==this.bg&&(this.bg=b.createDiv("geBackground"));u&&null!=document.body&&document.body.appendChild(this.bg);u=b.createDiv(P?"geTransDialog":"geDialog");u.style.width=m+48+"px";null!=p&&(u.style.height=p+48+"px");"1"!=urlParams.embedInline||Editor.inlineFullscreen||null==b.embedViewport||(u.style.left=b.embedViewport.x+b.embedViewport.width/2+"px",u.style.top=b.embedViewport.y+b.embedViewport.height/2+"px");u.appendChild(d);null!=document.body&&+document.body.appendChild(u);null==p&&(u.style.height=d.scrollHeight+48+"px");if(n&&(d=document.createElement("div"),d.className="geButton",d.setAttribute("title",mxResources.get("close")),d.style.backgroundImage="url("+Editor.crossImage+")",d.style.position="absolute",d.style.top="0px",d.style.right="0px",mxEvent.addListener(d,"click",mxUtils.bind(this,function(){b.hideDialog(!0)})),u.appendChild(d),!O)){var U=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(c){U=!0}),null,mxUtils.bind(this,+function(c){U&&(b.hideDialog(!0),U=!1)}))}this.onDialogClose=y;this.container=u;null!=G&&this.addResizeHandler(G);b.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.prototype.noColorImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC";Dialog.prototype.closeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==";Dialog.prototype.clearImage="data:image/gif;base64,R0lGODlhDQAKAIABAMDAwP///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUIzOEM1NzI4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUIzOEM1NzM4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QjM4QzU3MDg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QjM4QzU3MTg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAANAAoAAAIXTGCJebD9jEOTqRlttXdrB32PJ2ncyRQAOw==";Dialog.prototype.getDocumentSize=function(){return mxUtils.getDocumentSize()};Dialog.prototype.getPosition=function(b,d){return new mxPoint(b,d)};-Dialog.prototype.addResizeHandler=function(b){var d=document.createElement("img");d.setAttribute("src",mxWindow.prototype.resizeImage);d.style.cursor="nwse-resize";d.style.position="absolute";d.style.bottom="0px";d.style.right="0px";d.style.zIndex="2";var m=this,p=function(v,n){var y=null,C=null,P=null,G=null,O=function(c){if(null!=y){var f=mxEvent.getClientX(c)-y,k=mxEvent.getClientY(c)-C,q=P,x=G;0<=n.indexOf("r")&&(q+=2*f);0<=n.indexOf("l")&&(q-=2*f);0<=n.indexOf("b")&&(x+=2*k);0<=n.indexOf("t")&&-(x-=2*k);m.container.style.width=Math.max(b.width,q)+"px";m.container.style.height=Math.max(b.height,x)+"px";mxEvent.consume(c)}},U=function(c){if(null!=y&&(C=y=null,mxEvent.removeGestureListeners(document,null,O,U),mxEvent.consume(c),"function"===typeof m.onResize))m.onResize(parseInt(m.container.style.width),parseInt(m.container.style.height))};mxEvent.addGestureListeners(v,function(c){y=mxEvent.getClientX(c);C=mxEvent.getClientY(c);P=parseInt(m.container.style.width);G=parseInt(m.container.style.height);+Dialog.prototype.addResizeHandler=function(b){var d=document.createElement("img");d.setAttribute("src",mxWindow.prototype.resizeImage);d.style.cursor="nwse-resize";d.style.position="absolute";d.style.bottom="0px";d.style.right="0px";d.style.zIndex="2";var m=this,p=function(u,n){var y=null,B=null,P=null,G=null,O=function(c){if(null!=y){var f=mxEvent.getClientX(c)-y,k=mxEvent.getClientY(c)-B,q=P,x=G;0<=n.indexOf("r")&&(q+=2*f);0<=n.indexOf("l")&&(q-=2*f);0<=n.indexOf("b")&&(x+=2*k);0<=n.indexOf("t")&&+(x-=2*k);m.container.style.width=Math.max(b.width,q)+"px";m.container.style.height=Math.max(b.height,x)+"px";mxEvent.consume(c)}},U=function(c){if(null!=y&&(B=y=null,mxEvent.removeGestureListeners(document,null,O,U),mxEvent.consume(c),"function"===typeof m.onResize))m.onResize(parseInt(m.container.style.width),parseInt(m.container.style.height))};mxEvent.addGestureListeners(u,function(c){y=mxEvent.getClientX(c);B=mxEvent.getClientY(c);P=parseInt(m.container.style.width);G=parseInt(m.container.style.height);mxEvent.addGestureListeners(document,null,O,U);mxEvent.consume(c)},O,U)};p(d,"br");this.container.appendChild(d);installDialogEdgeResizeHandles(this.container,p)};function installDialogEdgeResizeHandles(b,d){var m=[];[{styles:"top:0;left:0;width:8px;height:8px;",cursor:"nw-resize",edges:"tl"},{styles:"top:0;left:8px;right:8px;height:4px;",cursor:"n-resize",edges:"t"},{styles:"top:0;right:0;width:8px;height:8px;",cursor:"ne-resize",edges:"tr"},{styles:"top:8px;right:0;bottom:14px;width:4px;",cursor:"e-resize",edges:"r"},{styles:"bottom:0;left:0;width:8px;height:8px;",cursor:"sw-resize",edges:"bl"},{styles:"bottom:0;left:8px;right:14px;height:4px;",cursor:"s-resize",-edges:"b"},{styles:"top:8px;left:0;bottom:8px;width:4px;",cursor:"w-resize",edges:"l"}].forEach(function(p){var v=document.createElement("div");v.style.cssText="position:absolute;z-index:2;"+p.styles+"cursor:"+p.cursor;d(v,p.edges);b.appendChild(v);m.push(v)});return m}+edges:"b"},{styles:"top:8px;left:0;bottom:8px;width:4px;",cursor:"w-resize",edges:"l"}].forEach(function(p){var u=document.createElement("div");u.style.cssText="position:absolute;z-index:2;"+p.styles+"cursor:"+p.cursor;d(u,p.edges);b.appendChild(u);m.push(u)});return m}(function(){var b=mxWindow.prototype.setResizable;mxWindow.prototype.setResizable=function(d){b.apply(this,arguments);d?null==this._edgeResizeHandles?this._edgeResizeHandles=installMxWindowEdgeResizeHandles(this):this._edgeResizeHandles.forEach(function(m){m.style.display=""}):null!=this._edgeResizeHandles&&this._edgeResizeHandles.forEach(function(m){m.style.display="none"})}})();-function installMxWindowEdgeResizeHandles(b){var d=b.minimumSize||new mxRectangle(0,0,50,40);return installDialogEdgeResizeHandles(b.div,function(m,p){var v=null,n=null,y,C,P,G,O=function(c){if(null!=v){var f=mxEvent.getClientX(c)-v,k=mxEvent.getClientY(c)-n,q=y,x=C,B=P,E=G;0<=p.indexOf("t")&&(x=C+k,E=G-k);0<=p.indexOf("b")&&(E=G+k);0<=p.indexOf("l")&&(q=y+f,B=P-f);0<=p.indexOf("r")&&(B=P+f);B<d.width&&(0<=p.indexOf("l")&&(q=y+P-d.width),B=d.width);E<d.height&&(0<=p.indexOf("t")&&(x=C+G-d.height),-E=d.height);q===y&&x===C||b.setLocation(q,x);b.setSize(B,E);b.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",c));mxEvent.consume(c)}},U=function(c){null!=v&&(n=v=null,mxEvent.removeGestureListeners(document,null,O,U),b.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",c)),mxEvent.consume(c))};mxEvent.addGestureListeners(m,function(c){b.activate();null!=b.dockState&&(b.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",c)),b.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",c)));v=-mxEvent.getClientX(c);n=mxEvent.getClientY(c);y=b.getX();C=b.getY();P=parseInt(b.div.style.width)||b.div.offsetWidth;G=parseInt(b.div.style.height)||b.div.offsetHeight;mxEvent.addGestureListeners(document,null,O,U);b.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",c));mxEvent.consume(c)},O,U)})}+function installMxWindowEdgeResizeHandles(b){var d=b.minimumSize||new mxRectangle(0,0,50,40);return installDialogEdgeResizeHandles(b.div,function(m,p){var u=null,n=null,y,B,P,G,O=function(c){if(null!=u){var f=mxEvent.getClientX(c)-u,k=mxEvent.getClientY(c)-n,q=y,x=B,C=P,E=G;0<=p.indexOf("t")&&(x=B+k,E=G-k);0<=p.indexOf("b")&&(E=G+k);0<=p.indexOf("l")&&(q=y+f,C=P-f);0<=p.indexOf("r")&&(C=P+f);C<d.width&&(0<=p.indexOf("l")&&(q=y+P-d.width),C=d.width);E<d.height&&(0<=p.indexOf("t")&&(x=B+G-d.height),+E=d.height);q===y&&x===B||b.setLocation(q,x);b.setSize(C,E);b.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",c));mxEvent.consume(c)}},U=function(c){null!=u&&(n=u=null,mxEvent.removeGestureListeners(document,null,O,U),b.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",c)),mxEvent.consume(c))};mxEvent.addGestureListeners(m,function(c){b.activate();null!=b.dockState&&(b.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",c)),b.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",c)));u=+mxEvent.getClientX(c);n=mxEvent.getClientY(c);y=b.getX();B=b.getY();P=parseInt(b.div.style.width)||b.div.offsetWidth;G=parseInt(b.div.style.height)||b.div.offsetHeight;mxEvent.addGestureListeners(document,null,O,U);b.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",c));mxEvent.consume(c)},O,U)})}Dialog.prototype.close=function(b,d){if(null!=this.onDialogClose){if(0==this.onDialogClose(b,d))return!1;this.onDialogClose=null}null!=this.dialogImg&&null!=this.dialogImg.parentNode&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null);null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);null!=this.editorUi.embedViewport?this.editorUi.removeListener(this.resizeListener):mxEvent.removeListener(window,"resize",this.resizeListener);null!=this.container.parentNode&&this.container.parentNode.removeChild(this.container)};-var ErrorDialog=function(b,d,m,p,v,n,y,C,P,G,O){P=null!=P?P:!0;var U=document.createElement("div");U.style.textAlign="center";U.style.flexDirection="column";U.style.maxHeight="100%";U.style.display="flex";if(null!=d){var c=document.createElement("div");c.style.padding="0px";c.style.margin="0px";c.style.fontSize="14px";c.style.fontWeight="600";c.style.paddingBottom="12px";c.style.marginBottom="10px";c.style.borderBottom="1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1))";c.style.whiteSpace=+var ErrorDialog=function(b,d,m,p,u,n,y,B,P,G,O){P=null!=P?P:!0;var U=document.createElement("div");U.style.textAlign="center";U.style.flexDirection="column";U.style.maxHeight="100%";U.style.display="flex";if(null!=d){var c=document.createElement("div");c.style.padding="0px";c.style.margin="0px";c.style.fontSize="14px";c.style.fontWeight="600";c.style.paddingBottom="12px";c.style.marginBottom="10px";c.style.borderBottom="1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1))";c.style.whiteSpace="nowrap";c.style.textOverflow="ellipsis";c.style.overflow="hidden";c.style.flexShrink="0";mxUtils.write(c,d);c.setAttribute("title",d);U.appendChild(c)}d=document.createElement("div");d.style.lineHeight="1.2em";d.style.padding="6px";d.style.flexGrow="1";d.style.overflowY="auto";"string"===typeof m&&(m=m.replace(/\n/g,"<br/>"));d.innerHTML=Graph.sanitizeHtml(m);U.appendChild(d);m=document.createElement("div");m.style.marginTop="12px";m.style.textAlign="center";null!=n&&(d=mxUtils.button(mxResources.get("tryAgain"),-function(){b.hideDialog();n()}),d.className="geBtn",m.appendChild(d),m.style.textAlign="center");null!=G&&(G=mxUtils.button(G,function(){null!=O&&O()}),G.className="geBtn",m.appendChild(G));var f=mxUtils.button(p,function(){P&&b.hideDialog();null!=v&&v()});f.className="geBtn";m.appendChild(f);null!=y&&(p=mxUtils.button(y,function(){P&&b.hideDialog();null!=C&&C()}),p.className="geBtn gePrimaryBtn",m.appendChild(p));this.init=function(){f.focus()};U.appendChild(m);this.container=U},PrintDialog=function(b,+function(){b.hideDialog();n()}),d.className="geBtn",m.appendChild(d),m.style.textAlign="center");null!=G&&(G=mxUtils.button(G,function(){null!=O&&O()}),G.className="geBtn",m.appendChild(G));var f=mxUtils.button(p,function(){P&&b.hideDialog();null!=u&&u()});f.className="geBtn";m.appendChild(f);null!=y&&(p=mxUtils.button(y,function(){P&&b.hideDialog();null!=B&&B()}),p.className="geBtn gePrimaryBtn",m.appendChild(p));this.init=function(){f.focus()};U.appendChild(m);this.container=U},PrintDialog=function(b,d,m,p){this.create(b,d,m,p)};-PrintDialog.prototype.create=function(b){function d(f){var k=y.checked||G.checked,q=parseInt(U.value)/100;isNaN(q)&&(q=1,U.value="100%");mxClient.IS_SF&&(q*=.75);var x=m.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,B=1/m.pageScale;if(k){var E=y.checked?1:parseInt(O.value);isNaN(E)||(B=mxUtils.getScaleForPageCount(E,m,x))}var L=E=0;x=mxRectangle.fromRectangle(x);x.width*=q;x.height*=q;B*=q;!k&&m.pageVisible?(q=m.getPageLayout(),E-=q.x*x.width,L-=q.y*x.height):k=!0;k=PrintDialog.createPrintPreview(m,-B,x,0,E,L,k);k.open();f&&PrintDialog.printPreview(k)}var m=b.editor.graph,p=document.createElement("table");p.style.width="100%";p.style.height="100%";var v=document.createElement("tbody");var n=document.createElement("tr");var y=document.createElement("input");y.setAttribute("type","checkbox");var C=document.createElement("td");C.setAttribute("colspan","2");C.style.fontSize="10pt";C.appendChild(y);var P=document.createElement("span");mxUtils.write(P," "+mxResources.get("fitPage"));C.appendChild(P);-mxEvent.addListener(P,"click",function(f){y.checked=!y.checked;G.checked=!y.checked;mxEvent.consume(f)});mxEvent.addListener(y,"change",function(){G.checked=!y.checked});n.appendChild(C);v.appendChild(n);n=n.cloneNode(!1);var G=document.createElement("input");G.setAttribute("type","checkbox");C=document.createElement("td");C.style.fontSize="10pt";C.appendChild(G);P=document.createElement("span");mxUtils.write(P," "+mxResources.get("posterPrint")+":");C.appendChild(P);mxEvent.addListener(P,"click",-function(f){G.checked=!G.checked;y.checked=!G.checked;mxEvent.consume(f)});n.appendChild(C);var O=document.createElement("input");O.setAttribute("value","1");O.setAttribute("type","number");O.setAttribute("min","1");O.setAttribute("size","4");O.setAttribute("disabled","disabled");O.style.width="50px";C=document.createElement("td");C.style.fontSize="10pt";C.appendChild(O);mxUtils.write(C," "+mxResources.get("pages")+" (max)");n.appendChild(C);v.appendChild(n);mxEvent.addListener(G,"change",function(){G.checked?-O.removeAttribute("disabled"):O.setAttribute("disabled","disabled");y.checked=!G.checked});n=n.cloneNode(!1);C=document.createElement("td");mxUtils.write(C,mxResources.get("pageScale")+":");n.appendChild(C);C=document.createElement("td");var U=document.createElement("input");U.setAttribute("value","100 %");U.setAttribute("size","5");U.style.width="50px";C.appendChild(U);n.appendChild(C);v.appendChild(n);n=document.createElement("tr");C=document.createElement("td");C.colSpan=2;C.style.paddingTop="30px";-C.setAttribute("align","right");P=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});P.className="geBtn";b.editor.cancelFirst&&C.appendChild(P);if(PrintDialog.previewEnabled){var c=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();d(!1)});c.className="geBtn";C.appendChild(c)}c=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();d(!0)});c.className="geBtn gePrimaryBtn";C.appendChild(c);b.editor.cancelFirst||C.appendChild(P);-n.appendChild(C);v.appendChild(n);p.appendChild(v);n=document.createElement("div");n.style.paddingBottom="20px";n.appendChild(p);this.container=n};PrintDialog.printPreview=function(b){try{null!=b.wnd&&window.setTimeout(function(){b.wnd.focus();b.wnd.print();b.wnd.close()},500)}catch(d){}};-PrintDialog.createPrintPreview=function(b,d,m,p,v,n,y){d=new mxPrintPreview(b,d,m,p,v,n);d.title=mxResources.get("preview");d.addPageCss=!mxClient.IS_SF;d.printBackgroundImage=!0;d.autoOrigin=y;y=b.background;if(null==y||""==y||y==mxConstants.NONE)y="#ffffff";d.backgroundColor=y;var C=d.isTextLabel;d.isTextLabel=function(G){return"geHint"==!G.className&&C.apply(this,arguments)};var P=d.getLinkForCellState;d.getLinkForCellState=function(G){return b.getAbsoluteUrl(P.apply(this,arguments))};return d};+PrintDialog.prototype.create=function(b){function d(f){var k=y.checked||G.checked,q=parseInt(U.value)/100;isNaN(q)&&(q=1,U.value="100%");mxClient.IS_SF&&(q*=.75);var x=m.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,C=1/m.pageScale;if(k){var E=y.checked?1:parseInt(O.value);isNaN(E)||(C=mxUtils.getScaleForPageCount(E,m,x))}var L=E=0;x=mxRectangle.fromRectangle(x);x.width*=q;x.height*=q;C*=q;!k&&m.pageVisible?(q=m.getPageLayout(),E-=q.x*x.width,L-=q.y*x.height):k=!0;k=PrintDialog.createPrintPreview(m,+C,x,0,E,L,k);k.open();f&&PrintDialog.printPreview(k)}var m=b.editor.graph,p=document.createElement("table");p.style.width="100%";p.style.height="100%";var u=document.createElement("tbody");var n=document.createElement("tr");var y=document.createElement("input");y.setAttribute("type","checkbox");var B=document.createElement("td");B.setAttribute("colspan","2");B.style.fontSize="10pt";B.appendChild(y);var P=document.createElement("span");mxUtils.write(P," "+mxResources.get("fitPage"));B.appendChild(P);+mxEvent.addListener(P,"click",function(f){y.checked=!y.checked;G.checked=!y.checked;mxEvent.consume(f)});mxEvent.addListener(y,"change",function(){G.checked=!y.checked});n.appendChild(B);u.appendChild(n);n=n.cloneNode(!1);var G=document.createElement("input");G.setAttribute("type","checkbox");B=document.createElement("td");B.style.fontSize="10pt";B.appendChild(G);P=document.createElement("span");mxUtils.write(P," "+mxResources.get("posterPrint")+":");B.appendChild(P);mxEvent.addListener(P,"click",+function(f){G.checked=!G.checked;y.checked=!G.checked;mxEvent.consume(f)});n.appendChild(B);var O=document.createElement("input");O.setAttribute("value","1");O.setAttribute("type","number");O.setAttribute("min","1");O.setAttribute("size","4");O.setAttribute("disabled","disabled");O.style.width="50px";B=document.createElement("td");B.style.fontSize="10pt";B.appendChild(O);mxUtils.write(B," "+mxResources.get("pages")+" (max)");n.appendChild(B);u.appendChild(n);mxEvent.addListener(G,"change",function(){G.checked?+O.removeAttribute("disabled"):O.setAttribute("disabled","disabled");y.checked=!G.checked});n=n.cloneNode(!1);B=document.createElement("td");mxUtils.write(B,mxResources.get("pageScale")+":");n.appendChild(B);B=document.createElement("td");var U=document.createElement("input");U.setAttribute("value","100 %");U.setAttribute("size","5");U.style.width="50px";B.appendChild(U);n.appendChild(B);u.appendChild(n);n=document.createElement("tr");B=document.createElement("td");B.colSpan=2;B.style.paddingTop="30px";+B.setAttribute("align","right");P=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});P.className="geBtn";b.editor.cancelFirst&&B.appendChild(P);if(PrintDialog.previewEnabled){var c=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();d(!1)});c.className="geBtn";B.appendChild(c)}c=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();d(!0)});c.className="geBtn gePrimaryBtn";B.appendChild(c);b.editor.cancelFirst||B.appendChild(P);+n.appendChild(B);u.appendChild(n);p.appendChild(u);n=document.createElement("div");n.style.paddingBottom="20px";n.appendChild(p);this.container=n};PrintDialog.printPreview=function(b){try{null!=b.wnd&&window.setTimeout(function(){b.wnd.focus();b.wnd.print();b.wnd.close()},500)}catch(d){}};+PrintDialog.createPrintPreview=function(b,d,m,p,u,n,y){d=new mxPrintPreview(b,d,m,p,u,n);d.title=mxResources.get("preview");d.addPageCss=!mxClient.IS_SF;d.printBackgroundImage=!0;d.autoOrigin=y;y=b.background;if(null==y||""==y||y==mxConstants.NONE)y="#ffffff";d.backgroundColor=y;var B=d.isTextLabel;d.isTextLabel=function(G){return"geHint"==!G.className&&B.apply(this,arguments)};var P=d.getLinkForCellState;d.getLinkForCellState=function(G){return b.getAbsoluteUrl(P.apply(this,arguments))};return d};PrintDialog.previewEnabled=!0;-var PageSetupDialog=function(b){var d=b.editor.graph,m=document.createElement("div"),p=function(E){E.style.minWidth="140px";return E},v=function(E){E.style.marginLeft="8px";return E},n=document.createElement("h3");mxUtils.write(n,mxResources.get("pageSetup"));m.appendChild(n);n=document.createElement("div");n.className="geDialogSection";var y=document.createElement("div");y.className="geDialogFormRow geDialogFormRowTop";var C=document.createElement("span");C.className="geDialogFormLabel";mxUtils.write(C,-mxResources.get("paperSize")+":");y.appendChild(p(C));C=document.createElement("div");C.style.flex="1";C.style.minWidth="0";var P=PageSetupDialog.addPageFormatPanel(C,"pagesetupdialog",d.pageFormat);y.appendChild(v(C));n.appendChild(y);m.appendChild(n);n=document.createElement("div");n.className="geDialogSection";y=document.createElement("div");y.className="geDialogFormRow";C=document.createElement("span");C.className="geDialogFormLabel";mxUtils.write(C,mxResources.get("gridSize")+":");y.appendChild(p(C));-var G=document.createElement("input");G.setAttribute("type","number");G.setAttribute("min","0");G.setAttribute("step","any");G.style.width="60px";G.style.flex="0 0 auto";G.value=d.getGridSize();y.appendChild(v(G));mxEvent.addListener(G,"change",function(){var E=parseFloat(G.value);G.value=Math.max(1,isNaN(E)?d.getGridSize():E)});n.appendChild(y);m.appendChild(n);n=document.createElement("div");n.className="geDialogSection";y=document.createElement("div");y.className="geDialogFormRow";C=document.createElement("span");-C.className="geDialogFormLabel";mxUtils.write(C,mxResources.get("background")+":");y.appendChild(p(C));var O=d.backgroundImage,U=d.background;C=document.createElement("button");C.className="geBtn";C.style.margin="0px";mxUtils.write(C,mxResources.get("change")+"...");mxEvent.addListener(C,"click",function(E){b.showBackgroundImageDialog(function(L,Q,V){Q||(null!=L&&null!=L.src&&Graph.isPageLink(L.src)&&(L={originalSrc:L.src}),O=L);U=V},O,U,!0);mxEvent.consume(E)});y.appendChild(v(C));n.appendChild(y);-m.appendChild(n);n=b.addAdvancedSection(m);y=document.createElement("div");y.className="geDialogFormRow";C=document.createElement("span");C.className="geDialogFormLabel";mxUtils.write(C,mxResources.get("adaptiveColors")+":");y.appendChild(p(C));var c=document.createElement("select");v(c);C=function(E,L){var Q=document.createElement("option");Q.setAttribute("value",E);mxUtils.write(Q,L);c.appendChild(Q)};C("default",mxResources.get("default")+" ("+mxResources.get(Graph.getDefaultAdaptiveColorsKey())+-")");C("auto",mxResources.get("automatic"));C("simple",mxResources.get("simple"));C("none",mxResources.get("none"));c.value=null==d.adaptiveColors?"default":d.adaptiveColors;y.appendChild(c);null==b.menus||null==b.menus.createHelpLink||b.isOffline()&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp||(C=b.menus.createHelpLink("https://www.drawio.com/docs/manual/editor/appearance/adaptive-colours/"),C.style.marginLeft="8px",y.appendChild(C));n.content.appendChild(y);if(null!=b.currentPage){var f=b.currentPage.getViewBox();-var k=!1;y=document.createElement("div");y.className="geDialogSection";C=document.createElement("div");C.className="geDialogFormRow";var q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("initialView",null,"Initial view")+":");C.appendChild(p(q));p=document.createElement("div");p.style.flex="1";p.style.minWidth="0";p.style.display="flex";p.style.alignItems="center";var x=document.createElement("span");x.style.flex="1 1 auto";x.style.minWidth="0";x.style.overflow=-"hidden";x.style.textOverflow="ellipsis";x.style.whiteSpace="nowrap";x.style.lineHeight="normal";var B=function(){if(null!=f){var E=f.x+", "+f.y;null!=f.scale&&(E+=" · "+Math.round(100*f.scale)+"%")}else E=mxResources.get("default");x.textContent=E};B();p.appendChild(x);C.appendChild(v(p));y.appendChild(C);p=document.createElement("div");p.className="geDialogFormRow";p.style.justifyContent="flex-end";p.style.flexWrap="wrap";p.style.gap="8px";C=mxUtils.button(mxResources.get("useCurrent"),function(){f=-d.getCurrentViewBox();k=!0;B()});C.className="geBtn";C.style.margin="0px";C.style.flexShrink="0";p.appendChild(C);C=mxUtils.button(mxResources.get("reset"),function(){f=null;k=!0;B()});C.className="geBtn";C.style.margin="0px";C.style.flexShrink="0";p.appendChild(C);y.appendChild(p);n.wrapper.appendChild(y)}"undefined"!==typeof AnimationDialog&&(p=document.createElement("div"),p.className="geDialogSection",y=document.createElement("div"),y.className="geDialogFormRow geDialogFormRowTop",C=document.createElement("span"),-C.className="geDialogFormLabel",C.style.minWidth="0",mxUtils.write(C,mxResources.get("animation",null,"Animation")+":"),y.appendChild(C),C=document.createElement("div"),C.style.flex="1",C.style.minWidth="0",C.style.display="flex",C.style.alignItems="center",C.style.gap="8px",q=document.createElement("span"),q.className="geDialogHint",q.style.flex="1 1 auto",q.style.minWidth="0",mxUtils.write(q,mxResources.get("lightboxAnimationHint",null,"Plays automatically when the page is shown in lightbox mode.")),-C.appendChild(q),q=mxUtils.button(mxResources.get("edit",null,"Edit"),function(){b.hideDialog();var E=b.menus;null!=E&&null!=E.animationWindow?(E.animationWindow.window.setVisible(!0),E.animationWindow.window.activate()):null!=b.actions.get("animation")&&b.actions.get("animation").funct()}),q.className="geBtn",q.style.minWidth="90px",C.appendChild(q),y.appendChild(v(C)),p.appendChild(y),n.wrapper.appendChild(p));v=m.querySelectorAll(".geBtn");for(p=0;p<v.length;p++)n=mxUtils.trim(v[p].textContent),-null==v[p].getAttribute("title")&&""!=n&&v[p].setAttribute("title",n);this.container=(new CustomDialog(b,m,function(){var E=parseFloat(G.value);isNaN(E)||d.gridSize===E||d.setGridSize(E);E=new ChangePageSetup(b,U,O,P.get());E.ignoreColor=d.background==U;E.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=O?O.src:null);var L=c.value,Q=L!=(null==d.adaptiveColors?"default":d.adaptiveColors);Q&&(E.adaptiveColors=L);d.pageFormat.width==E.previousFormat.width&&d.pageFormat.height==+var PageSetupDialog=function(b){var d=b.editor.graph,m=document.createElement("div"),p=function(E){E.style.minWidth="140px";return E},u=function(E){E.style.marginLeft="8px";return E},n=document.createElement("h3");mxUtils.write(n,mxResources.get("pageSetup"));m.appendChild(n);n=document.createElement("div");n.className="geDialogSection";var y=document.createElement("div");y.className="geDialogFormRow geDialogFormRowTop";var B=document.createElement("span");B.className="geDialogFormLabel";mxUtils.write(B,+mxResources.get("paperSize")+":");y.appendChild(p(B));B=document.createElement("div");B.style.flex="1";B.style.minWidth="0";var P=PageSetupDialog.addPageFormatPanel(B,"pagesetupdialog",d.pageFormat);y.appendChild(u(B));n.appendChild(y);m.appendChild(n);n=document.createElement("div");n.className="geDialogSection";y=document.createElement("div");y.className="geDialogFormRow";B=document.createElement("span");B.className="geDialogFormLabel";mxUtils.write(B,mxResources.get("gridSize")+":");y.appendChild(p(B));+var G=document.createElement("input");G.setAttribute("type","number");G.setAttribute("min","0");G.setAttribute("step","any");G.style.width="60px";G.style.flex="0 0 auto";G.value=d.getGridSize();y.appendChild(u(G));mxEvent.addListener(G,"change",function(){var E=parseFloat(G.value);G.value=Math.max(1,isNaN(E)?d.getGridSize():E)});n.appendChild(y);m.appendChild(n);n=document.createElement("div");n.className="geDialogSection";y=document.createElement("div");y.className="geDialogFormRow";B=document.createElement("span");+B.className="geDialogFormLabel";mxUtils.write(B,mxResources.get("background")+":");y.appendChild(p(B));var O=d.backgroundImage,U=d.background;B=document.createElement("button");B.className="geBtn";B.style.margin="0px";mxUtils.write(B,mxResources.get("change")+"...");mxEvent.addListener(B,"click",function(E){b.showBackgroundImageDialog(function(L,Q,V){Q||(null!=L&&null!=L.src&&Graph.isPageLink(L.src)&&(L={originalSrc:L.src}),O=L);U=V},O,U,!0);mxEvent.consume(E)});y.appendChild(u(B));n.appendChild(y);+m.appendChild(n);n=b.addAdvancedSection(m);y=document.createElement("div");y.className="geDialogFormRow";B=document.createElement("span");B.className="geDialogFormLabel";mxUtils.write(B,mxResources.get("adaptiveColors")+":");y.appendChild(p(B));var c=document.createElement("select");u(c);B=function(E,L){var Q=document.createElement("option");Q.setAttribute("value",E);mxUtils.write(Q,L);c.appendChild(Q)};B("default",mxResources.get("default")+" ("+mxResources.get(Graph.getDefaultAdaptiveColorsKey())++")");B("auto",mxResources.get("automatic"));B("simple",mxResources.get("simple"));B("none",mxResources.get("none"));c.value=null==d.adaptiveColors?"default":d.adaptiveColors;y.appendChild(c);null==b.menus||null==b.menus.createHelpLink||b.isOffline()&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp||(B=b.menus.createHelpLink("https://www.drawio.com/docs/manual/editor/appearance/adaptive-colours/"),B.style.marginLeft="8px",y.appendChild(B));n.content.appendChild(y);if(null!=b.currentPage){var f=b.currentPage.getViewBox();+var k=!1;y=document.createElement("div");y.className="geDialogSection";B=document.createElement("div");B.className="geDialogFormRow";var q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("initialView",null,"Initial view")+":");B.appendChild(p(q));p=document.createElement("div");p.style.flex="1";p.style.minWidth="0";p.style.display="flex";p.style.alignItems="center";var x=document.createElement("span");x.style.flex="1 1 auto";x.style.minWidth="0";x.style.overflow=+"hidden";x.style.textOverflow="ellipsis";x.style.whiteSpace="nowrap";x.style.lineHeight="normal";var C=function(){if(null!=f){var E=f.x+", "+f.y;null!=f.scale&&(E+=" · "+Math.round(100*f.scale)+"%")}else E=mxResources.get("default");x.textContent=E};C();p.appendChild(x);B.appendChild(u(p));y.appendChild(B);p=document.createElement("div");p.className="geDialogFormRow";p.style.justifyContent="flex-end";p.style.flexWrap="wrap";p.style.gap="8px";B=mxUtils.button(mxResources.get("useCurrent"),function(){f=+d.getCurrentViewBox();k=!0;C()});B.className="geBtn";B.style.margin="0px";B.style.flexShrink="0";p.appendChild(B);B=mxUtils.button(mxResources.get("reset"),function(){f=null;k=!0;C()});B.className="geBtn";B.style.margin="0px";B.style.flexShrink="0";p.appendChild(B);y.appendChild(p);n.wrapper.appendChild(y)}"undefined"!==typeof AnimationDialog&&(p=document.createElement("div"),p.className="geDialogSection",y=document.createElement("div"),y.className="geDialogFormRow geDialogFormRowTop",B=document.createElement("span"),+B.className="geDialogFormLabel",B.style.minWidth="0",mxUtils.write(B,mxResources.get("animation",null,"Animation")+":"),y.appendChild(B),B=document.createElement("div"),B.style.flex="1",B.style.minWidth="0",B.style.display="flex",B.style.alignItems="center",B.style.gap="8px",q=document.createElement("span"),q.className="geDialogHint",q.style.flex="1 1 auto",q.style.minWidth="0",mxUtils.write(q,mxResources.get("lightboxAnimationHint",null,"Plays automatically when the page is shown in lightbox mode.")),+B.appendChild(q),q=mxUtils.button(mxResources.get("edit",null,"Edit"),function(){b.hideDialog();var E=b.menus;null!=E&&null!=E.animationWindow?(E.animationWindow.window.setVisible(!0),E.animationWindow.window.activate()):null!=b.actions.get("animation")&&b.actions.get("animation").funct()}),q.className="geBtn",q.style.minWidth="90px",B.appendChild(q),y.appendChild(u(B)),p.appendChild(y),n.wrapper.appendChild(p));u=m.querySelectorAll(".geBtn");for(p=0;p<u.length;p++)n=mxUtils.trim(u[p].textContent),+null==u[p].getAttribute("title")&&""!=n&&u[p].setAttribute("title",n);this.container=(new CustomDialog(b,m,function(){var E=parseFloat(G.value);isNaN(E)||d.gridSize===E||d.setGridSize(E);E=new ChangePageSetup(b,U,O,P.get());E.ignoreColor=d.background==U;E.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=O?O.src:null);var L=c.value,Q=L!=(null==d.adaptiveColors?"default":d.adaptiveColors);Q&&(E.adaptiveColors=L);d.pageFormat.width==E.previousFormat.width&&d.pageFormat.height==E.previousFormat.height&&E.ignoreColor&&E.ignoreImage&&!Q||d.model.execute(E);k&&null!=b.currentPage&&d.model.execute(new ChangePageView(b,b.currentPage,f))},null,mxResources.get("apply"))).container};-PageSetupDialog.addPageFormatPanel=function(b,d,m,p){d="format-"+d;var v=document.createElement("input");v.setAttribute("name",d);v.setAttribute("type","radio");v.setAttribute("value","portrait");var n=document.createElement("input");n.setAttribute("name",d);n.setAttribute("type","radio");n.setAttribute("value","landscape");var y=document.createElement("select");y.style.position="relative";y.style.marginBottom="4px";y.style.borderRadius="4px";y.style.borderWidth="1px";y.style.borderStyle="solid";-y.style.boxSizing="border-box";y.style.padding="2px";y.style.width="210px";var C=document.createElement("div");C.style.alignItems="center";C.style.whiteSpace="nowrap";C.style.marginLeft="4px";C.style.width="210px";C.style.height="24px";v.style.margin="0 6px 0 0";C.appendChild(v);d=document.createElement("span");d.style.maxWidth="100px";mxUtils.write(d,mxResources.get("portrait"));C.appendChild(d);n.style.margin="0 6px 0 10px";C.appendChild(n);var P=document.createElement("span");P.style.width="100px";-mxUtils.write(P,mxResources.get("landscape"));C.appendChild(P);var G=document.createElement("div");G.style.whiteSpace="nowrap";G.style.fontSize="12px";G.style.width="210px";G.style.height="24px";var O=document.createElement("input");O.setAttribute("size","6");O.setAttribute("title",mxResources.get("width"));O.style.textAlign="right";G.appendChild(O);mxUtils.write(G," x ");var U=document.createElement("input");U.setAttribute("size","6");U.setAttribute("title",mxResources.get("height"));U.style.textAlign=+PageSetupDialog.addPageFormatPanel=function(b,d,m,p){d="format-"+d;var u=document.createElement("input");u.setAttribute("name",d);u.setAttribute("type","radio");u.setAttribute("value","portrait");var n=document.createElement("input");n.setAttribute("name",d);n.setAttribute("type","radio");n.setAttribute("value","landscape");var y=document.createElement("select");y.style.position="relative";y.style.marginBottom="4px";y.style.borderRadius="4px";y.style.borderWidth="1px";y.style.borderStyle="solid";+y.style.boxSizing="border-box";y.style.padding="2px";y.style.width="210px";var B=document.createElement("div");B.style.alignItems="center";B.style.whiteSpace="nowrap";B.style.marginLeft="4px";B.style.width="210px";B.style.height="24px";u.style.margin="0 6px 0 0";B.appendChild(u);d=document.createElement("span");d.style.maxWidth="100px";mxUtils.write(d,mxResources.get("portrait"));B.appendChild(d);n.style.margin="0 6px 0 10px";B.appendChild(n);var P=document.createElement("span");P.style.width="100px";+mxUtils.write(P,mxResources.get("landscape"));B.appendChild(P);var G=document.createElement("div");G.style.whiteSpace="nowrap";G.style.fontSize="12px";G.style.width="210px";G.style.height="24px";var O=document.createElement("input");O.setAttribute("size","6");O.setAttribute("title",mxResources.get("width"));O.style.textAlign="right";G.appendChild(O);mxUtils.write(G," x ");var U=document.createElement("input");U.setAttribute("size","6");U.setAttribute("title",mxResources.get("height"));U.style.textAlign="right";G.appendChild(U);var c=document.createElement("select");c.style.marginLeft="4px";c.style.boxSizing="border-box";for(var f=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS},{label:mxResources.get("meters"),unit:mxConstants.METERS}],k=0;k<f.length;k++){var q=document.createElement("option");q.setAttribute("value",f[k].unit);mxUtils.write(q,f[k].label);c.appendChild(q)}c.value=-Editor.pageSizeUnit;G.appendChild(c);C.style.display="none";G.style.display="none";var x={},B=PageSetupDialog.getFormats();for(k=0;k<B.length;k++)f=B[k],x[f.key]=f,q=document.createElement("option"),q.setAttribute("value",f.key),mxUtils.write(q,f.title),y.appendChild(q);var E=function(){y.value="custom";for(var Q=0;Q<B.length;Q++){var V=B[Q];null!=V.format&&("a4"==V.key?826==m.width?(m=mxRectangle.fromRectangle(m),m.width=827):826==m.height&&(m=mxRectangle.fromRectangle(m),m.height=827):"a5"==V.key&&-(584==m.width?(m=mxRectangle.fromRectangle(m),m.width=583):584==m.height&&(m=mxRectangle.fromRectangle(m),m.height=583)),m.width==V.format.width&&m.height==V.format.height?(y.value=V.key,v.setAttribute("checked","checked"),v.defaultChecked=!0,v.checked=!0,n.removeAttribute("checked"),n.defaultChecked=!1,n.checked=!1,detected=!0):m.width==V.format.height&&m.height==V.format.width&&(y.value=V.key,v.removeAttribute("checked"),v.defaultChecked=!1,v.checked=!1,n.setAttribute("checked","checked"),n.defaultChecked=-!0,detected=n.checked=!0))}"custom"==y.value?(O.value=Editor.toUnit(m.width,c.value),U.value=Editor.toUnit(m.height,c.value),v.setAttribute("checked","checked"),y.value="custom",C.style.display="none",G.style.display=""):(C.style.display="flex",G.style.display="none")};E();b.appendChild(y);mxUtils.br(b);b.appendChild(C);b.appendChild(G);var L=function(Q,V){Q=x[y.value];null!=Q.format?(O.value=Editor.toUnit(n.checked?Q.format.height:Q.format.width,c.value),U.value=Editor.toUnit(n.checked?Q.format.width:-Q.format.height,c.value),G.style.display="none",C.style.display="flex"):(C.style.display="none",G.style.display="");var K=parseFloat(O.value);if(isNaN(K)||0>=K)O.value=Editor.toUnit(m.width,c.value);K=parseFloat(U.value);if(isNaN(K)||0>=K)U.value=Editor.toUnit(m.height,c.value);Q=null!=Q.format?new mxRectangle(0,0,n.checked?Q.format.height:Q.format.width,n.checked?Q.format.width:Q.format.height):new mxRectangle(0,0,Editor.fromUnit(parseFloat(O.value),c.value),Editor.fromUnit(parseFloat(U.value),c.value));-V||Q.width==m.width&&Q.height==m.height||(m=Q,null!=p&&p(m))};mxEvent.addListener(d,"click",function(Q){v.checked=!0;L(Q);mxEvent.consume(Q)});mxEvent.addListener(P,"click",function(Q){n.checked=!0;L(Q);mxEvent.consume(Q)});mxEvent.addListener(O,"blur",L);mxEvent.addListener(O,"click",L);mxEvent.addListener(U,"blur",L);mxEvent.addListener(U,"click",L);mxEvent.addListener(n,"change",L);mxEvent.addListener(v,"change",L);mxEvent.addListener(y,"change",function(Q){L(Q,"custom"==y.value);mxEvent.consume(Q)});+Editor.pageSizeUnit;G.appendChild(c);B.style.display="none";G.style.display="none";var x={},C=PageSetupDialog.getFormats();for(k=0;k<C.length;k++)f=C[k],x[f.key]=f,q=document.createElement("option"),q.setAttribute("value",f.key),mxUtils.write(q,f.title),y.appendChild(q);var E=function(){y.value="custom";for(var Q=0;Q<C.length;Q++){var V=C[Q];null!=V.format&&("a4"==V.key?826==m.width?(m=mxRectangle.fromRectangle(m),m.width=827):826==m.height&&(m=mxRectangle.fromRectangle(m),m.height=827):"a5"==V.key&&+(584==m.width?(m=mxRectangle.fromRectangle(m),m.width=583):584==m.height&&(m=mxRectangle.fromRectangle(m),m.height=583)),m.width==V.format.width&&m.height==V.format.height?(y.value=V.key,u.setAttribute("checked","checked"),u.defaultChecked=!0,u.checked=!0,n.removeAttribute("checked"),n.defaultChecked=!1,n.checked=!1,detected=!0):m.width==V.format.height&&m.height==V.format.width&&(y.value=V.key,u.removeAttribute("checked"),u.defaultChecked=!1,u.checked=!1,n.setAttribute("checked","checked"),n.defaultChecked=+!0,detected=n.checked=!0))}"custom"==y.value?(O.value=Editor.toUnit(m.width,c.value),U.value=Editor.toUnit(m.height,c.value),u.setAttribute("checked","checked"),y.value="custom",B.style.display="none",G.style.display=""):(B.style.display="flex",G.style.display="none")};E();b.appendChild(y);mxUtils.br(b);b.appendChild(B);b.appendChild(G);var L=function(Q,V){Q=x[y.value];null!=Q.format?(O.value=Editor.toUnit(n.checked?Q.format.height:Q.format.width,c.value),U.value=Editor.toUnit(n.checked?Q.format.width:+Q.format.height,c.value),G.style.display="none",B.style.display="flex"):(B.style.display="none",G.style.display="");var K=parseFloat(O.value);if(isNaN(K)||0>=K)O.value=Editor.toUnit(m.width,c.value);K=parseFloat(U.value);if(isNaN(K)||0>=K)U.value=Editor.toUnit(m.height,c.value);Q=null!=Q.format?new mxRectangle(0,0,n.checked?Q.format.height:Q.format.width,n.checked?Q.format.width:Q.format.height):new mxRectangle(0,0,Editor.fromUnit(parseFloat(O.value),c.value),Editor.fromUnit(parseFloat(U.value),c.value));+V||Q.width==m.width&&Q.height==m.height||(m=Q,null!=p&&p(m))};mxEvent.addListener(d,"click",function(Q){u.checked=!0;L(Q);mxEvent.consume(Q)});mxEvent.addListener(P,"click",function(Q){n.checked=!0;L(Q);mxEvent.consume(Q)});mxEvent.addListener(O,"blur",L);mxEvent.addListener(O,"click",L);mxEvent.addListener(U,"blur",L);mxEvent.addListener(U,"click",L);mxEvent.addListener(n,"change",L);mxEvent.addListener(u,"change",L);mxEvent.addListener(y,"change",function(Q){L(Q,"custom"==y.value);mxEvent.consume(Q)});mxEvent.addListener(c,"change",function(Q){O.value=Editor.toUnit(Editor.fromUnit(O.value,Editor.pageSizeUnit),c.value);U.value=Editor.toUnit(Editor.fromUnit(U.value,Editor.pageSizeUnit),c.value);Editor.pageSizeUnit=c.value;L(Q,!0);mxEvent.consume(Q)});L(null,!0);return{set:function(Q){m=Q;E(null,null,!0)},get:function(){return m},widthInput:O,heightInput:U}};PageSetupDialog.getFormats=function(){return[{key:"letter",title:'US-Letter (8,5" x 11")',format:mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},{key:"legal",title:'US-Legal (8,5" x 14")',format:new mxRectangle(0,0,850,1400)},{key:"tabloid",title:'US-Tabloid (11" x 17")',format:new mxRectangle(0,0,1100,1700)},{key:"executive",title:'US-Executive (7" x 10")',format:new mxRectangle(0,0,700,1E3)},{key:"a0",title:"A0 (841 mm x 1189 mm)",format:new mxRectangle(0,0,3300,4681)},{key:"a1",title:"A1 (594 mm x 841 mm)",format:new mxRectangle(0,0,2339,3300)},{key:"a2",title:"A2 (420 mm x 594 mm)",format:new mxRectangle(0,0,1654,2336)},{key:"a3",title:"A3 (297 mm x 420 mm)",format:new mxRectangle(0,0,1169,1654)},{key:"a4",title:"A4 (210 mm x 297 mm)",format:mxConstants.PAGE_FORMAT_A4_PORTRAIT},{key:"a5",title:"A5 (148 mm x 210 mm)",format:new mxRectangle(0,0,583,827)},{key:"a6",title:"A6 (105 mm x 148 mm)",format:new mxRectangle(0,0,413,583)},{key:"a7",title:"A7 (74 mm x 105 mm)",format:new mxRectangle(0,0,291,413)},{key:"b4",title:"B4 (250 mm x 353 mm)",format:new mxRectangle(0,0,980,1390)},{key:"b5",title:"B5 (176 mm x 250 mm)",format:new mxRectangle(0,0,690,980)},{key:"16-9",title:"16:9 (1600 x 900)",format:new mxRectangle(0,0,900,1600)},{key:"16-10",title:"16:10 (1920 x 1200)",format:new mxRectangle(0,0,1200,1920)},{key:"4-3",title:"4:3 (1600 x 1200)",format:new mxRectangle(0,0,1200,1600)},{key:"custom",title:mxResources.get("custom"),format:null}]};-var FilenameDialog=function(b,d,m,p,v,n,y,C,P,G,O){P=null!=P?P:!0;var U=document.createElement("div"),c=document.createElement("div");c.style.width="100%";c.style.display="grid";c.style.gap="5px 8px";c.style.gridAutoColumns="auto 1fr";c.style.boxSizing="border-box";c.style.padding="3px";var f=document.createElement("div");f.style.display="inline-flex";f.style.alignItems="center";f.style.justifyContent="flex-end";f.style.minWidth="0";var k=document.createElement("div");k.style.display="inline-block";-k.style.textOverflow="ellipsis";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.fontSize="10pt";k.style.padding="2px 0";k.setAttribute("title",v||mxResources.get("filename"));mxUtils.write(k,(v||mxResources.get("filename"))+":");f.appendChild(k);c.appendChild(f);var q=document.createElement("input");q.setAttribute("value",d||"");q.style.flexGrow="1";var x=mxUtils.button(m,function(){if(null==n||n(q.value))P&&b.hideDialog(),p(q.value)});x.className="geBtn gePrimaryBtn";this.init=function(){if(null!=-v||null==y)if(null!=O?Editor.selectFilename(q):(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var B=c.parentNode;if(null!=B){var E=null;mxEvent.addListener(B,"dragleave",function(L){null!=E&&(E.style.backgroundColor="",E=null);L.stopPropagation();L.preventDefault()});mxEvent.addListener(B,"dragover",mxUtils.bind(this,function(L){null==E&&(E=q,E.style.backgroundColor="#ebf2f9");L.stopPropagation();L.preventDefault()}));-mxEvent.addListener(B,"drop",mxUtils.bind(this,function(L){null!=E&&(E.style.backgroundColor="",E=null);0<=mxUtils.indexOf(L.dataTransfer.types,"text/uri-list")&&(q.value=decodeURIComponent(L.dataTransfer.getData("text/uri-list")),x.click());L.stopPropagation();L.preventDefault()}))}}};f=document.createElement("div");f.style.display="inline-flex";f.style.alignItems="center";f.style.gap="4px";f.style.whiteSpace="nowrap";f.appendChild(q);c.appendChild(f);null==v&&null!=y||null==O||null==b.editor.diagramFileTypes||+var FilenameDialog=function(b,d,m,p,u,n,y,B,P,G,O){P=null!=P?P:!0;var U=document.createElement("div"),c=document.createElement("div");c.style.width="100%";c.style.display="grid";c.style.gap="5px 8px";c.style.gridAutoColumns="auto 1fr";c.style.boxSizing="border-box";c.style.padding="3px";var f=document.createElement("div");f.style.display="inline-flex";f.style.alignItems="center";f.style.justifyContent="flex-end";f.style.minWidth="0";var k=document.createElement("div");k.style.display="inline-block";+k.style.textOverflow="ellipsis";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.fontSize="10pt";k.style.padding="2px 0";k.setAttribute("title",u||mxResources.get("filename"));mxUtils.write(k,(u||mxResources.get("filename"))+":");f.appendChild(k);c.appendChild(f);var q=document.createElement("input");q.setAttribute("value",d||"");q.style.flexGrow="1";var x=mxUtils.button(m,function(){if(null==n||n(q.value))P&&b.hideDialog(),p(q.value)});x.className="geBtn gePrimaryBtn";this.init=function(){if(null!=+u||null==y)if(null!=O?Editor.selectFilename(q):(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var C=c.parentNode;if(null!=C){var E=null;mxEvent.addListener(C,"dragleave",function(L){null!=E&&(E.style.backgroundColor="",E=null);L.stopPropagation();L.preventDefault()});mxEvent.addListener(C,"dragover",mxUtils.bind(this,function(L){null==E&&(E=q,E.style.backgroundColor="#ebf2f9");L.stopPropagation();L.preventDefault()}));+mxEvent.addListener(C,"drop",mxUtils.bind(this,function(L){null!=E&&(E.style.backgroundColor="",E=null);0<=mxUtils.indexOf(L.dataTransfer.types,"text/uri-list")&&(q.value=decodeURIComponent(L.dataTransfer.getData("text/uri-list")),x.click());L.stopPropagation();L.preventDefault()}))}}};f=document.createElement("div");f.style.display="inline-flex";f.style.alignItems="center";f.style.gap="4px";f.style.whiteSpace="nowrap";f.appendChild(q);c.appendChild(f);null==u&&null!=y||null==O||null==b.editor.diagramFileTypes||(f=document.createElement("div"),f.style.display="inline-flex",f.style.alignItems="center",f.style.textOverflow="ellipsis",f.style.justifyContent="flex-end",f.style.fontSize="10pt",mxUtils.write(f,mxResources.get("type")+":"),c.appendChild(f),f=document.createElement("div"),f.style.display="inline-flex",f.style.alignItems="center",f.style.whiteSpace="nowrap",c.appendChild(f),d=FilenameDialog.createFileTypes(b,q,b.editor.diagramFileTypes),d.style.width="100%",f.appendChild(d));null!=y&&c.appendChild(y);-row=document.createElement("div");row.style.gridColumn="1 / span 2";row.style.paddingTop=null!=O?"6px":"14px";row.style.whiteSpace="nowrap";row.style.display="inline-flex";row.style.alignItems="center";row.style.justifyContent="flex-end";row.setAttribute("align","right");f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=G&&G()});f.className="geBtn";null==C||b.isOffline()||row.appendChild(b.createHelpIcon(C));b.editor.cancelFirst&&row.appendChild(f);mxEvent.addListener(q,"keypress",-function(B){13==B.keyCode&&x.click()});row.appendChild(x);b.editor.cancelFirst||row.appendChild(f);c.appendChild(row);U.appendChild(c);this.container=U};FilenameDialog.filenameHelpLink=null;-FilenameDialog.createFileTypes=function(b,d,m){var p=document.createElement("select");for(b=0;b<m.length;b++){var v=document.createElement("option");v.setAttribute("value",b);mxUtils.write(v,mxResources.get(m[b].description)+" (."+m[b].extension+")");p.appendChild(v)}mxEvent.addListener(p,"change",function(n){n=m[p.value].extension;var y=d.value.lastIndexOf(".drawio.");y=0<y?y:d.value.lastIndexOf(".");"drawio"!=n&&(n="drawio."+n);d.value=0<y?d.value.substring(0,y+1)+n:d.value+"."+n;"createEvent"in-document?(n=document.createEvent("HTMLEvents"),n.initEvent("change",!1,!0),d.dispatchEvent(n)):d.fireEvent("onchange")});b=function(n){n=d.value.toLowerCase();for(var y=0,C=0;C<m.length;C++){var P=m[C].extension,G=null;"drawio"!=P&&(G=P,P=".drawio."+P);if(n.substring(n.length-P.length-1)=="."+P||null!=G&&n.substring(n.length-G.length-1)=="."+G){y=C;break}}p.value=y};mxEvent.addListener(d,"change",b);mxEvent.addListener(d,"keyup",b);b();if(null!=Editor.defaultFileType&&"0"==p.value)for(b=0;b<m.length;b++)if(m[b].extension==-Editor.defaultFileType){p.value=b;b=m[b].extension;v=d.value.lastIndexOf(".drawio.");v=0<v?v:d.value.lastIndexOf(".");"drawio"!=b&&(b="drawio."+b);d.value=0<v?d.value.substring(0,v+1)+b:d.value+"."+b;break}return p};-var WrapperWindow=function(b,d,m,p,v,n,y,C){C=null!=C?C:document.createElement("div");this.window=new mxWindow(d,C,m,p,v,n,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);b.installResizeHandler(this,!0);y(C)};-(function(){mxGraphView.prototype.validateBackgroundPage=function(){var y=this.graph;if(null!=y.container&&!y.transparentBackground){if(y.pageVisible){var C=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var P=y.container.firstChild;null!=P&&P.nodeType!=mxConstants.NODETYPE_ELEMENT;)P=P.nextSibling;null!=P&&(this.backgroundPageShape=this.createBackgroundPageShape(C),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,+row=document.createElement("div");row.style.gridColumn="1 / span 2";row.style.paddingTop=null!=O?"6px":"14px";row.style.whiteSpace="nowrap";row.style.display="inline-flex";row.style.alignItems="center";row.style.justifyContent="flex-end";row.setAttribute("align","right");f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=G&&G()});f.className="geBtn";null==B||b.isOffline()||row.appendChild(b.createHelpIcon(B));b.editor.cancelFirst&&row.appendChild(f);mxEvent.addListener(q,"keypress",+function(C){13==C.keyCode&&x.click()});row.appendChild(x);b.editor.cancelFirst||row.appendChild(f);c.appendChild(row);U.appendChild(c);this.container=U};FilenameDialog.filenameHelpLink=null;+FilenameDialog.createFileTypes=function(b,d,m){var p=document.createElement("select");for(b=0;b<m.length;b++){var u=document.createElement("option");u.setAttribute("value",b);mxUtils.write(u,mxResources.get(m[b].description)+" (."+m[b].extension+")");p.appendChild(u)}mxEvent.addListener(p,"change",function(n){n=m[p.value].extension;var y=d.value.lastIndexOf(".drawio.");y=0<y?y:d.value.lastIndexOf(".");"drawio"!=n&&(n="drawio."+n);d.value=0<y?d.value.substring(0,y+1)+n:d.value+"."+n;"createEvent"in+document?(n=document.createEvent("HTMLEvents"),n.initEvent("change",!1,!0),d.dispatchEvent(n)):d.fireEvent("onchange")});b=function(n){n=d.value.toLowerCase();for(var y=0,B=0;B<m.length;B++){var P=m[B].extension,G=null;"drawio"!=P&&(G=P,P=".drawio."+P);if(n.substring(n.length-P.length-1)=="."+P||null!=G&&n.substring(n.length-G.length-1)=="."+G){y=B;break}}p.value=y};mxEvent.addListener(d,"change",b);mxEvent.addListener(d,"keyup",b);b();if(null!=Editor.defaultFileType&&"0"==p.value)for(b=0;b<m.length;b++)if(m[b].extension==+Editor.defaultFileType){p.value=b;b=m[b].extension;u=d.value.lastIndexOf(".drawio.");u=0<u?u:d.value.lastIndexOf(".");"drawio"!=b&&(b="drawio."+b);d.value=0<u?d.value.substring(0,u+1)+b:d.value+"."+b;break}return p};+var WrapperWindow=function(b,d,m,p,u,n,y,B){B=null!=B?B:document.createElement("div");this.window=new mxWindow(d,B,m,p,u,n,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);b.installResizeHandler(this,!0);y(B)};+(function(){mxGraphView.prototype.validateBackgroundPage=function(){var y=this.graph;if(null!=y.container&&!y.transparentBackground){if(y.pageVisible){var B=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var P=y.container.firstChild;null!=P&&P.nodeType!=mxConstants.NODETYPE_ELEMENT;)P=P.nextSibling;null!=P&&(this.backgroundPageShape=this.createBackgroundPageShape(B),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(y.container),P.style.position="absolute",y.container.insertBefore(this.backgroundPageShape.node,P),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(G){y.dblClick(G)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(G){y.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(G))}),mxUtils.bind(this,function(G){null!=-y.tooltipHandler&&y.tooltipHandler.isHideOnHover()&&y.tooltipHandler.hide();y.isMouseDown&&!mxEvent.isConsumed(G)&&y.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(G))}),mxUtils.bind(this,function(G){y.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(G))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=C,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}};-mxGraphView.prototype.validateBackgroundStyles=function(y,C,P){var G=this.graph;y=null!=y?y:1;var O=mxUtils.getLightDarkColor(null==G.background||G.background==mxConstants.NONE?G.defaultPageBackgroundColor:G.background).cssText,U=mxUtils.getLightDarkColor(G.defaultPageBorderColor).cssText,c=null!=O&&this.gridColor!=O.toLowerCase()?this.gridColor:"#ffffff",f="none",k="";"simple"==G.getAdaptiveColors()&&G.background!=mxConstants.NONE&&null!=G.background&&(O=G.background);if(G.isGridEnabled()||G.gridVisible){k=-10;mxClient.IS_SVG?(f=unescape(encodeURIComponent(this.createSvgGrid(c,y))),f=window.btoa?btoa(f):Base64.encode(f,!0),f="url(data:image/svg+xml;base64,"+f+")",k=G.gridSize*this.scale*this.gridSteps*y):f="url("+this.gridImage+")";var q=c=0;C=null!=C?C-this.translate.x*this.scale:0;P=null!=P?P-this.translate.y*this.scale:0;var x=G.gridSize*this.scale*this.gridSteps,B=C%x;x=P%x;null!=G.view.backgroundPageShape&&(q=this.getBackgroundPageBounds(),c=1+q.x,q=1+q.y);k=-Math.round(k-mxUtils.mod(this.translate.x*-this.scale-c+C,k)+B*y)+"px "+-Math.round(k-mxUtils.mod(this.translate.y*this.scale-q+P,k)+x*y)+"px"}y=G.view.canvas;null!=y.ownerSVGElement&&(y=y.ownerSVGElement);c=!Editor.isDarkMode()&&G.enableDiagramBackground;null!=G.view.backgroundPageShape?(G.view.backgroundPageShape.node.style.backgroundPosition=k,G.view.backgroundPageShape.node.style.backgroundImage=f,G.view.backgroundPageShape.node.style.backgroundColor=O,G.view.backgroundPageShape.node.style.borderColor=U,G.view.backgroundPageShape.node.style.colorScheme=+y.tooltipHandler&&y.tooltipHandler.isHideOnHover()&&y.tooltipHandler.hide();y.isMouseDown&&!mxEvent.isConsumed(G)&&y.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(G))}),mxUtils.bind(this,function(G){y.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(G))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=B,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}};+mxGraphView.prototype.validateBackgroundStyles=function(y,B,P){var G=this.graph;y=null!=y?y:1;var O=mxUtils.getLightDarkColor(null==G.background||G.background==mxConstants.NONE?G.defaultPageBackgroundColor:G.background).cssText,U=mxUtils.getLightDarkColor(G.defaultPageBorderColor).cssText,c=null!=O&&this.gridColor!=O.toLowerCase()?this.gridColor:"#ffffff",f="none",k="";"simple"==G.getAdaptiveColors()&&G.background!=mxConstants.NONE&&null!=G.background&&(O=G.background);if(G.isGridEnabled()||G.gridVisible){k=+10;mxClient.IS_SVG?(f=unescape(encodeURIComponent(this.createSvgGrid(c,y))),f=window.btoa?btoa(f):Base64.encode(f,!0),f="url(data:image/svg+xml;base64,"+f+")",k=G.gridSize*this.scale*this.gridSteps*y):f="url("+this.gridImage+")";var q=c=0;B=null!=B?B-this.translate.x*this.scale:0;P=null!=P?P-this.translate.y*this.scale:0;var x=G.gridSize*this.scale*this.gridSteps,C=B%x;x=P%x;null!=G.view.backgroundPageShape&&(q=this.getBackgroundPageBounds(),c=1+q.x,q=1+q.y);k=-Math.round(k-mxUtils.mod(this.translate.x*+this.scale-c+B,k)+C*y)+"px "+-Math.round(k-mxUtils.mod(this.translate.y*this.scale-q+P,k)+x*y)+"px"}y=G.view.canvas;null!=y.ownerSVGElement&&(y=y.ownerSVGElement);c=!Editor.isDarkMode()&&G.enableDiagramBackground;null!=G.view.backgroundPageShape?(G.view.backgroundPageShape.node.style.backgroundPosition=k,G.view.backgroundPageShape.node.style.backgroundImage=f,G.view.backgroundPageShape.node.style.backgroundColor=O,G.view.backgroundPageShape.node.style.borderColor=U,G.view.backgroundPageShape.node.style.colorScheme="none"==G.getAdaptiveColors()?"light":"",y.style.backgroundImage="none",y.style.backgroundColor="",G.container.style.backgroundColor=c?G.diagramBackgroundColor:""):(y.style.backgroundPosition=k,y.style.backgroundImage=f,"1"==urlParams.transparent?G.container.style.background="transparent":!c||null!=G.background&&G.background!=mxConstants.NONE?y.style.backgroundColor=O:(y.style.backgroundColor=G.diagramBackgroundColor,G.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(y,-C){for(var P=this.graph.gridSize*this.scale*(null!=C?C:1);P<this.minGridSize;)P*=2;C=this.gridSteps*P;for(var G=[],O=1;O<this.gridSteps;O++){var U=O*P;G.push("M 0 "+U+" L "+C+" "+U+" M "+U+" 0 L "+U+" "+C)}P="M "+C+" 0 L 0 0 0 "+C+" M "+C+" 0 L "+C+" "+C+" L 0 "+C;y=mxUtils.getLightDarkColor(y);O="color-scheme: light dark;";mxClient.IS_SF&&(O="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+O+'" width="'+C+'" height="'+C+'" xmlns="'+-mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+C+'" height="'+C+'" patternUnits="userSpaceOnUse"><path d="'+G.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(y.cssText)+';" stroke="'+y.light+'" opacity="0.2" stroke-width="1"/><path d="'+P+'" fill="none" style="stroke:'+mxUtils.htmlEntities(y.cssText)+';" stroke="'+y.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=-function(y,C){b.apply(this,arguments);if(null!=this.shiftPreview1){var P=this.view.canvas;null!=P.ownerSVGElement&&(P=P.ownerSVGElement);var G=this.gridSize*this.view.scale*this.view.gridSteps;G=-Math.round(G-mxUtils.mod(this.view.translate.x*this.view.scale+y,G))+"px "+-Math.round(G-mxUtils.mod(this.view.translate.y*this.view.scale+C,G))+"px";P.style.backgroundPosition=G}};mxGraph.prototype.updatePageBreaks=function(y,C,P){var G=this.view.scale,O=this.view.translate,U=this.pageFormat,c=G*this.pageScale,-f=this.view.getBackgroundPageBounds();C=f.width;P=f.height;var k=new mxRectangle(G*O.x,G*O.y,U.width*c,U.height*c),q=(y=y&&Math.min(k.width,k.height)>this.minPageBreakDist)?Math.min(this.maxPageBreaks,Math.ceil(P/k.height)-1):0,x=y?Math.min(this.maxPageBreaks,Math.ceil(C/k.width)-1):0,B=f.x+C,E=f.y+P;null==this.horizontalPageBreaks&&0<q&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<x&&(this.verticalPageBreaks=[]);y=mxUtils.bind(this,function(L){if(null!=L){for(var Q=L==this.horizontalPageBreaks?-q:x,V=0;V<=Q;V++){var K=L==this.horizontalPageBreaks?[new mxPoint(Math.round(f.x),Math.round(f.y+(V+1)*k.height)),new mxPoint(Math.round(B),Math.round(f.y+(V+1)*k.height))]:[new mxPoint(Math.round(f.x+(V+1)*k.width),Math.round(f.y)),new mxPoint(Math.round(f.x+(V+1)*k.width),Math.round(E))];null!=L[V]&&null!=L[V].node?(L[V].points=K,L[V].redraw()):(null!=L[V]&&L[V].destroy(),K=new mxPolyline(K,this.pageBreakColor),K.dialect=this.dialect,K.isDashed=this.pageBreakDashed,K.pointerEvents=!1,K.init(this.view.backgroundPane),-K.redraw(),L[V]=K)}for(V=Q;V<L.length;V++)null!=L[V]&&L[V].destroy();L.splice(Q,L.length-Q)}});y(this.horizontalPageBreaks);y(this.verticalPageBreaks)};var d=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(y,C,P){for(var G=0;G<C.length;G++){if(this.graph.isTableCell(C[G])||this.graph.isTableRow(C[G]))return!1;if(this.graph.getModel().isVertex(C[G])){var O=this.graph.getCellGeometry(C[G]);if(null!=O&&O.relative)return!1}}return d.apply(this,-arguments)};var m=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var y=m.apply(this,arguments);y.intersects=mxUtils.bind(this,function(C,P){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(y,arguments)});return y};mxGraphView.prototype.createBackgroundPageShape=function(y){return new mxRectangleShape(y,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var y=this.getGraphBounds(),-C=0<y.width?y.x/this.scale-this.translate.x:0,P=0<y.height?y.y/this.scale-this.translate.y:0,G=this.graph.pageFormat,O=this.graph.pageScale,U=G.width*O;G=G.height*O;O=Math.floor(Math.min(0,C)/U);var c=Math.floor(Math.min(0,P)/G);return new mxRectangle(this.scale*(this.translate.x+O*U),this.scale*(this.translate.y+c*G),this.scale*(Math.ceil(Math.max(1,C+y.width/this.scale)/U)-O)*U,this.scale*(Math.ceil(Math.max(1,P+y.height/this.scale)/G)-c)*G)};var p=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=-function(y,C){p.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=y+"px",this.view.backgroundPageShape.node.style.marginTop=C+"px")};var v=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(y,C,P,G,O,U){var c=v.apply(this,arguments);null==U||U||mxEvent.addListener(c,"mousedown",function(f){mxEvent.consume(f)});return c};-var n=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(y,C,P){var G=this.graph.model.getParent(y);if(C){var O=this.graph.model.isEdge(y)?null:this.graph.getCellGeometry(y);O=!this.graph.model.isEdge(G)&&!this.graph.isSiblingSelected(y)&&(null!=O&&O.relative||!this.graph.isContainer(G)||this.graph.isPart(y))}else if(O=n.apply(this,arguments),this.graph.isTableCell(y)||this.graph.isTableRow(y))O=G,this.graph.isTable(O)||(O=this.graph.model.getParent(O)),-O=!this.graph.selectionCellsHandler.isHandled(O)||this.graph.isCellSelected(O)&&this.graph.isToggleEvent(P.getEvent())||this.graph.isCellSelected(y)&&!this.graph.isToggleEvent(P.getEvent())||this.graph.isTableCell(y)&&this.graph.isCellSelected(G);return O};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(y){y=y.getCell();for(var C=this.graph.getModel(),P=C.getParent(y),G=this.graph.view.getState(P),O=this.graph.isCellSelected(y);null!=G&&(C.isVertex(P)||C.isEdge(P));){var U=this.graph.isCellSelected(P);-O=O||U;if(U||!O&&(this.graph.isTableCell(y)||this.graph.isTableRow(y)))y=P;P=C.getParent(P)}return y}})();EditorUi=function(b,d,m){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=d||document.body;var p=this,v=this.editor.graph;v.lightbox=m;var n=v.getGraphBounds;v.getGraphBounds=function(){var J=n.apply(this,arguments),R=this.backgroundImage;if(null!=R&&null!=R.width&&null!=R.height){var T=this.view.translate,Y=this.view.scale;J=mxRectangle.fromRectangle(J);J.add(new mxRectangle((T.x+R.x)*Y,(T.y+R.y)*Y,R.width*Y,R.height*Y))}return J};v.useCssTransforms&&(this.lazyZoomDelay=-0);this.selectionStateListener=mxUtils.bind(this,function(J,R){this.clearSelectionState()});v.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionStateListener);v.getModel().addListener(mxEvent.CHANGE,this.selectionStateListener);v.addListener(mxEvent.EDITING_STARTED,this.selectionStateListener);v.addListener(mxEvent.EDITING_STOPPED,this.selectionStateListener);v.getView().addListener("unitChanged",this.selectionStateListener);if(this.editor.chromeless&&!this.editor.editable){v.isEnabled=-function(){return!1};v.panningHandler.isForcePanningEvent=function(J){for(var R=J.getSource();null!=R&&R!=v.container;){if("foreignObject"===R.nodeName||"text"===R.nodeName)return!1;R=R.parentNode}return!mxEvent.isPopupTrigger(J.getEvent())};var y=v.panningHandler.start;v.panningHandler.start=function(){y.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!v.standalone){var C=!1,P=!1;this.setDefaultStyle=function(J){try{var R=v.getModel(),-T=R.isVertex(J)&&R.isEdge(R.getParent(J));R.isEdge(J)||T?(P=!1,R.isEdge(J)&&(v.pasteEdgeStyle=!1)):(C=!1,v.pasteStylesToText=!1);var Y=v.getCellStyle(J,!1),Z=[],ia=[],ka;for(ka in Y)Z.push(Y[ka]),ia.push(ka);R.isEdge(J)?v.currentEdgeStyle={}:T||(v.currentVertexStyle={});this.fireEvent(new mxEventObject("styleChanged","keys",ia,"values",Z,"cells",[J],"force",!0,"edgeLabel",T));if(R.isEdge(J)||T)P=!0,R.isEdge(J)&&(v.pasteEdgeStyle=!0);else{C=!0;var X=R.getStyle(J);v.pasteStylesToText="string"===typeof X&&-0<=mxUtils.indexOf(X.split(";"),"text")}}catch(ja){this.handleError(ja)}};this.clearDefaultStyle=function(){v.currentEdgeStyle=mxUtils.clone(v.defaultEdgeStyle);v.currentVertexStyle=mxUtils.clone(v.defaultVertexStyle);v.pasteEdgeStyle=!1;C=P=v.pasteStylesToText=!1;this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};v.addListener("cellsInserted",function(J,R){v.pasteCellStyles(v.includeDescendants(R.getProperty("cells")))});v.addListener("textInserted",function(J,R){v.pasteCellStyles(R.getProperty("cells"))});-this.createDivs();this.createUi();this.refresh();var G=mxUtils.bind(this,function(J){null==J&&(J=window.event);return v.isEditing()||null!=J&&this.isSelectionAllowed(J)});document.addEventListener("selectstart",function(J){var R=mxEvent.getSource(J);R!=document.body&&R!=document.documentElement||J.preventDefault()},!0);this.container!=document.body||this.editor.chromeless&&!this.editor.editable||(this.menubarContainer.onselectstart=G,this.menubarContainer.onmousedown=G,this.toolbarContainer.onselectstart=+B){for(var P=this.graph.gridSize*this.scale*(null!=B?B:1);P<this.minGridSize;)P*=2;B=this.gridSteps*P;for(var G=[],O=1;O<this.gridSteps;O++){var U=O*P;G.push("M 0 "+U+" L "+B+" "+U+" M "+U+" 0 L "+U+" "+B)}P="M "+B+" 0 L 0 0 0 "+B+" M "+B+" 0 L "+B+" "+B+" L 0 "+B;y=mxUtils.getLightDarkColor(y);O="color-scheme: light dark;";mxClient.IS_SF&&(O="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+O+'" width="'+B+'" height="'+B+'" xmlns="'++mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+B+'" height="'+B+'" patternUnits="userSpaceOnUse"><path d="'+G.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(y.cssText)+';" stroke="'+y.light+'" opacity="0.2" stroke-width="1"/><path d="'+P+'" fill="none" style="stroke:'+mxUtils.htmlEntities(y.cssText)+';" stroke="'+y.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=+function(y,B){b.apply(this,arguments);if(null!=this.shiftPreview1){var P=this.view.canvas;null!=P.ownerSVGElement&&(P=P.ownerSVGElement);var G=this.gridSize*this.view.scale*this.view.gridSteps;G=-Math.round(G-mxUtils.mod(this.view.translate.x*this.view.scale+y,G))+"px "+-Math.round(G-mxUtils.mod(this.view.translate.y*this.view.scale+B,G))+"px";P.style.backgroundPosition=G}};mxGraph.prototype.updatePageBreaks=function(y,B,P){var G=this.view.scale,O=this.view.translate,U=this.pageFormat,c=G*this.pageScale,+f=this.view.getBackgroundPageBounds();B=f.width;P=f.height;var k=new mxRectangle(G*O.x,G*O.y,U.width*c,U.height*c),q=(y=y&&Math.min(k.width,k.height)>this.minPageBreakDist)?Math.min(this.maxPageBreaks,Math.ceil(P/k.height)-1):0,x=y?Math.min(this.maxPageBreaks,Math.ceil(B/k.width)-1):0,C=f.x+B,E=f.y+P;null==this.horizontalPageBreaks&&0<q&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<x&&(this.verticalPageBreaks=[]);y=mxUtils.bind(this,function(L){if(null!=L){for(var Q=L==this.horizontalPageBreaks?+q:x,V=0;V<=Q;V++){var K=L==this.horizontalPageBreaks?[new mxPoint(Math.round(f.x),Math.round(f.y+(V+1)*k.height)),new mxPoint(Math.round(C),Math.round(f.y+(V+1)*k.height))]:[new mxPoint(Math.round(f.x+(V+1)*k.width),Math.round(f.y)),new mxPoint(Math.round(f.x+(V+1)*k.width),Math.round(E))];null!=L[V]&&null!=L[V].node?(L[V].points=K,L[V].redraw()):(null!=L[V]&&L[V].destroy(),K=new mxPolyline(K,this.pageBreakColor),K.dialect=this.dialect,K.isDashed=this.pageBreakDashed,K.pointerEvents=!1,K.init(this.view.backgroundPane),+K.redraw(),L[V]=K)}for(V=Q;V<L.length;V++)null!=L[V]&&L[V].destroy();L.splice(Q,L.length-Q)}});y(this.horizontalPageBreaks);y(this.verticalPageBreaks)};var d=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(y,B,P){for(var G=0;G<B.length;G++){if(this.graph.isTableCell(B[G])||this.graph.isTableRow(B[G]))return!1;if(this.graph.getModel().isVertex(B[G])){var O=this.graph.getCellGeometry(B[G]);if(null!=O&&O.relative)return!1}}return d.apply(this,+arguments)};var m=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var y=m.apply(this,arguments);y.intersects=mxUtils.bind(this,function(B,P){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(y,arguments)});return y};mxGraphView.prototype.createBackgroundPageShape=function(y){return new mxRectangleShape(y,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var y=this.getGraphBounds(),+B=0<y.width?y.x/this.scale-this.translate.x:0,P=0<y.height?y.y/this.scale-this.translate.y:0,G=this.graph.pageFormat,O=this.graph.pageScale,U=G.width*O;G=G.height*O;O=Math.floor(Math.min(0,B)/U);var c=Math.floor(Math.min(0,P)/G);return new mxRectangle(this.scale*(this.translate.x+O*U),this.scale*(this.translate.y+c*G),this.scale*(Math.ceil(Math.max(1,B+y.width/this.scale)/U)-O)*U,this.scale*(Math.ceil(Math.max(1,P+y.height/this.scale)/G)-c)*G)};var p=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=+function(y,B){p.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=y+"px",this.view.backgroundPageShape.node.style.marginTop=B+"px")};var u=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(y,B,P,G,O,U){var c=u.apply(this,arguments);null==U||U||mxEvent.addListener(c,"mousedown",function(f){mxEvent.consume(f)});return c};+var n=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(y,B,P){var G=this.graph.model.getParent(y);if(B){var O=this.graph.model.isEdge(y)?null:this.graph.getCellGeometry(y);O=!this.graph.model.isEdge(G)&&!this.graph.isSiblingSelected(y)&&(null!=O&&O.relative||!this.graph.isContainer(G)||this.graph.isPart(y))}else if(O=n.apply(this,arguments),this.graph.isTableCell(y)||this.graph.isTableRow(y))O=G,this.graph.isTable(O)||(O=this.graph.model.getParent(O)),+O=!this.graph.selectionCellsHandler.isHandled(O)||this.graph.isCellSelected(O)&&this.graph.isToggleEvent(P.getEvent())||this.graph.isCellSelected(y)&&!this.graph.isToggleEvent(P.getEvent())||this.graph.isTableCell(y)&&this.graph.isCellSelected(G);return O};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(y){y=y.getCell();for(var B=this.graph.getModel(),P=B.getParent(y),G=this.graph.view.getState(P),O=this.graph.isCellSelected(y);null!=G&&(B.isVertex(P)||B.isEdge(P));){var U=this.graph.isCellSelected(P);+O=O||U;if(U||!O&&(this.graph.isTableCell(y)||this.graph.isTableRow(y)))y=P;P=B.getParent(P)}return y}})();EditorUi=function(b,d,m){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=d||document.body;var p=this,u=this.editor.graph;u.lightbox=m;var n=u.getGraphBounds;u.getGraphBounds=function(){var J=n.apply(this,arguments),R=this.backgroundImage;if(null!=R&&null!=R.width&&null!=R.height){var T=this.view.translate,Y=this.view.scale;J=mxRectangle.fromRectangle(J);J.add(new mxRectangle((T.x+R.x)*Y,(T.y+R.y)*Y,R.width*Y,R.height*Y))}return J};u.useCssTransforms&&(this.lazyZoomDelay=+0);this.selectionStateListener=mxUtils.bind(this,function(J,R){this.clearSelectionState()});u.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionStateListener);u.getModel().addListener(mxEvent.CHANGE,this.selectionStateListener);u.addListener(mxEvent.EDITING_STARTED,this.selectionStateListener);u.addListener(mxEvent.EDITING_STOPPED,this.selectionStateListener);u.getView().addListener("unitChanged",this.selectionStateListener);if(this.editor.chromeless&&!this.editor.editable){u.isEnabled=+function(){return!1};u.panningHandler.isForcePanningEvent=function(J){for(var R=J.getSource();null!=R&&R!=u.container;){if("foreignObject"===R.nodeName||"text"===R.nodeName)return!1;R=R.parentNode}return!mxEvent.isPopupTrigger(J.getEvent())};var y=u.panningHandler.start;u.panningHandler.start=function(){y.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!u.standalone){var B=!1,P=!1;this.setDefaultStyle=function(J){try{var R=u.getModel(),+T=R.isVertex(J)&&R.isEdge(R.getParent(J));R.isEdge(J)||T?(P=!1,R.isEdge(J)&&(u.pasteEdgeStyle=!1)):(B=!1,u.pasteStylesToText=!1);var Y=u.getCellStyle(J,!1),Z=[],ia=[],ja;for(ja in Y)Z.push(Y[ja]),ia.push(ja);R.isEdge(J)?u.currentEdgeStyle={}:T||(u.currentVertexStyle={});this.fireEvent(new mxEventObject("styleChanged","keys",ia,"values",Z,"cells",[J],"force",!0,"edgeLabel",T));if(R.isEdge(J)||T)P=!0,R.isEdge(J)&&(u.pasteEdgeStyle=!0);else{B=!0;var X=R.getStyle(J);u.pasteStylesToText="string"===typeof X&&+0<=mxUtils.indexOf(X.split(";"),"text")}}catch(ka){this.handleError(ka)}};this.clearDefaultStyle=function(){u.currentEdgeStyle=mxUtils.clone(u.defaultEdgeStyle);u.currentVertexStyle=mxUtils.clone(u.defaultVertexStyle);u.pasteEdgeStyle=!1;B=P=u.pasteStylesToText=!1;this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};u.addListener("cellsInserted",function(J,R){u.pasteCellStyles(u.includeDescendants(R.getProperty("cells")))});u.addListener("textInserted",function(J,R){u.pasteCellStyles(R.getProperty("cells"))});+this.createDivs();this.createUi();this.refresh();var G=mxUtils.bind(this,function(J){null==J&&(J=window.event);return u.isEditing()||null!=J&&this.isSelectionAllowed(J)});document.addEventListener("selectstart",function(J){var R=mxEvent.getSource(J);R!=document.body&&R!=document.documentElement||J.preventDefault()},!0);this.container!=document.body||this.editor.chromeless&&!this.editor.editable||(this.menubarContainer.onselectstart=G,this.menubarContainer.onmousedown=G,this.toolbarContainer.onselectstart=G,this.toolbarContainer.onmousedown=G,this.diagramContainer.onselectstart=G,this.diagramContainer.onmousedown=G,this.sidebarContainer.onselectstart=G,this.sidebarContainer.onmousedown=G,this.formatContainer.onselectstart=G,this.formatContainer.onmousedown=G,null!=this.tabContainer&&(this.tabContainer.onselectstart=G),mxClient.IS_IOS&&(d=function(){var J=null;if(/iP(hone|od|ad)/.test(navigator.platform)){var R=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);try{J=[parseInt(R[1],10),parseInt(R[2],10),parseInt(R[3]||0,10)]}catch(T){}}return J}(),null!=d&&16<=d[0]&&(mxUtils.setPrefixedStyle(this.menubarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.diagramContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.sidebarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.formatContainer.style,"userSelect","none"),null!=this.tabContainer&&mxUtils.setPrefixedStyle(this.tabContainer.style,"userSelect","none"))));!this.editor.chromeless||this.editor.editable?-this.diagramContainer.oncontextmenu=function(J){if(null!=J){var R=mxEvent.getSource(J);if("A"==R.nodeName)for(;null!=R;){if("geHint"==R.className)return!0;R=R.parentNode}}return G(J)}:v.panningHandler.usePopupTrigger=!1;v.init(this.diagramContainer);mxClient.IS_SVG&&null!=v.view.getDrawPane()&&(d=v.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.position="absolute"));this.hoverIcons=this.createHoverIcons();this.inlineToolbar=Editor.enableInlineToolbar?this.createInlineToolbar():null;this.editor.graph.addListener("zoomPreview",-mxUtils.bind(this,function(J,R){null!=this.hoverIcons&&this.hoverIcons.reset();null!=this.inlineToolbar&&this.inlineToolbar.hide()}));this.editor.graph.addListener("zoomPreviewComplete",mxUtils.bind(this,function(J,R){null!=this.inlineToolbar&&this.inlineToolbar.updateSelection()}));if(null!=v.graphHandler){var O=v.graphHandler.start;v.graphHandler.start=function(J){null!=p.hoverIcons&&p.hoverIcons.reset();null!=p.inlineToolbar&&null!=J&&p.inlineToolbar.hide();O.apply(this,arguments)};var U=v.graphHandler.mouseUp;-v.graphHandler.mouseUp=function(){U.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()}}var c=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(){null!=p.inlineToolbar&&p.inlineToolbar.hide();c.apply(this,arguments)};var f=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(){f.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()};var k=mxEdgeHandler.prototype.start;mxEdgeHandler.prototype.start=+this.diagramContainer.oncontextmenu=function(J){if(null!=J){var R=mxEvent.getSource(J);if("A"==R.nodeName)for(;null!=R;){if("geHint"==R.className)return!0;R=R.parentNode}}return G(J)}:u.panningHandler.usePopupTrigger=!1;u.init(this.diagramContainer);mxClient.IS_SVG&&null!=u.view.getDrawPane()&&(d=u.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.position="absolute"));this.hoverIcons=this.createHoverIcons();this.inlineToolbar=Editor.enableInlineToolbar?this.createInlineToolbar():null;this.editor.graph.addListener("zoomPreview",+mxUtils.bind(this,function(J,R){null!=this.hoverIcons&&this.hoverIcons.reset();null!=this.inlineToolbar&&this.inlineToolbar.hide()}));this.editor.graph.addListener("zoomPreviewComplete",mxUtils.bind(this,function(J,R){null!=this.inlineToolbar&&this.inlineToolbar.updateSelection()}));if(null!=u.graphHandler){var O=u.graphHandler.start;u.graphHandler.start=function(J){null!=p.hoverIcons&&p.hoverIcons.reset();null!=p.inlineToolbar&&null!=J&&p.inlineToolbar.hide();O.apply(this,arguments)};var U=u.graphHandler.mouseUp;+u.graphHandler.mouseUp=function(){U.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()}}var c=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(){null!=p.inlineToolbar&&p.inlineToolbar.hide();c.apply(this,arguments)};var f=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(){f.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()};var k=mxEdgeHandler.prototype.start;mxEdgeHandler.prototype.start=function(){null!=p.inlineToolbar&&p.inlineToolbar.hide();k.apply(this,arguments)};var q=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(){q.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()};mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(J){var R=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(J)-R.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(J)-R.y-this.diagramContainer.clientHeight?-this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var x=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(J,R){return p.isSpaceDown()||x.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(J){if(Editor.passiveScroll){var R=mxEvent.getSource(J);if(null==v.container||R!=v.container&&!v.container.contains(R)&&!v.isEditing())return}16==J.which?this.shiftDown=!0:32!=J.which||v.isEditing()?mxEvent.isConsumed(J)||-27!=J.keyCode||this.hideDialog(null,!0):(R=mxEvent.getSource(J),"INPUT"==R.nodeName||"TEXTAREA"==R.nodeName||"SELECT"==R.nodeName||R.isContentEditable||(this.spaceDown=!0,this.hoverIcons.reset(),null!=v.container&&(v.container.style.cursor="move"),mxEvent.consume(J)))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(J){null!=v.container&&(v.container.style.cursor="");this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);-var B=v.panningHandler.isForcePanningEvent;v.panningHandler.isForcePanningEvent=function(J){return null!=v.freehand&&v.freehand.isActive()?!1:B.apply(this,arguments)||p.isSpaceDown()||mxEvent.isMouseEvent(J.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(J.getEvent()))&&(!mxEvent.isControlDown(J.getEvent())&&mxEvent.isRightMouseButton(J.getEvent())||mxEvent.isMiddleMouseButton(J.getEvent()))};var E=v.cellEditor.isStopEditingEvent;v.cellEditor.isStopEditingEvent=function(J){return E.apply(this,-arguments)||13==J.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(J)||mxClient.IS_MAC&&mxEvent.isMetaDown(J)||mxClient.IS_SF&&mxEvent.isShiftDown(J))};var L=v.isZoomWheelEvent;v.isZoomWheelEvent=function(){return p.isSpaceDown()||L.apply(this,arguments)};var Q=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,R=this.toolbar.container.firstChild;null!=R;){var T=R.getAttribute("data-min-width");null!=T&&parseInt(T)>-J?R.style.display="none":R.style.display="";R=R.nextSibling}}),V=!1,K=null,fa=null,aa=null,da=mxUtils.bind(this,function(){if(null!=this.toolbar&&V!=v.cellEditor.isContentEditing()){for(var J=this.toolbar.container.firstChild,R=[];null!=J;){var T=J.nextSibling;J.parentNode.removeChild(J);R.push(J);J=T}J=this.toolbar.fontMenu;T=this.toolbar.sizeMenu;if(null==aa)this.toolbar.createTextToolbar();else{for(var Y=0;Y<aa.length;Y++)this.toolbar.container.appendChild(aa[Y]);this.toolbar.fontMenu=K;this.toolbar.sizeMenu=-fa}V=v.cellEditor.isContentEditing();K=J;fa=T;aa=R;Q()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);this.descriptorChanged();this.updateStatusAgain();da()}));this.addListener("currentThemeChanged",Q);mxEvent.addListener(window,"resize",Q);Q();v.isTouchPopupMenuEnabled=function(){return null==p.dialog};var ba=v.cellEditor.startEditing;v.cellEditor.startEditing=function(){ba.apply(this,arguments);da();if(v.cellEditor.isContentEditing()){var J=!1,R=function(){J||-(J=!0,window.setTimeout(function(){var T=v.getSelectedEditingElement();null!=T&&(T=mxUtils.getCurrentStyle(T),null!=T&&null!=p.toolbar&&(p.toolbar.setFontName(mxUtils.getCssFontFamily(T.fontFamily)),p.toolbar.setFontSize(parseInt(T.fontSize))));J=!1},0))};mxEvent.addListener(v.cellEditor.textarea,"input",R);mxEvent.addListener(v.cellEditor.textarea,"touchend",R);mxEvent.addListener(v.cellEditor.textarea,"mouseup",R);mxEvent.addListener(v.cellEditor.textarea,"keyup",R);R()}};var ha=v.cellEditor.stopEditing;-v.cellEditor.stopEditing=function(J,R){try{ha.apply(this,arguments),da()}catch(T){p.handleError(T)}};v.container.setAttribute("tabindex","0");v.container.style.cursor="default";if(window.self===window.top&&null!=v.container.parentNode)try{v.container.focus()}catch(J){}var qa=v.fireMouseEvent;v.fireMouseEvent=function(J,R,T){try{J==mxEvent.MOUSE_DOWN&&this.container.focus(),qa.apply(this,arguments)}catch(Y){p.handleError(Y)}};var ra=v.foldCells;v.foldCells=function(J,R,T,Y,Z){try{ra.apply(this,arguments)}catch(ia){p.handleError(ia)}};-v.popupMenuHandler.autoExpand=!0;null!=this.menus&&(v.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(J,R,T){this.menus.createPopupMenu(J,R,T)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(J){v.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};v.connectionHandler.addListener(mxEvent.CONNECT,function(J,R){var T=[R.getProperty("cell")];R.getProperty("terminalInserted")&&(T.push(R.getProperty("terminal")),-window.setTimeout(function(){null!=p.hoverIcons&&p.hoverIcons.update(v.view.getState(T[T.length-1]))},0));v.pasteCellStyles(T)});var l=null,t=null;b=mxUtils.bind(this,function(){if(null!=this.toolbar){var J=this.getSelectionState();if(v.isEnabled()&&0<J.edges.length){if(null!=this.toolbar.edgeStyleMenu){var R=this.getImageForEdgeStyle(J.style);1==J.edges.length&&"arrow"==J.style[mxConstants.STYLE_SHAPE]&&(R=Format.straightImage.src);this.toolbar.edgeStyleMenu.style.backgroundImage="url("+R+")"}null!=-this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+this.getImageForEdgeShape(J.style)+")")}else null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+l+")"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+t+")")}});v.selectionModel.addListener(mxEvent.CHANGE,b);v.getModel().addListener(mxEvent.CHANGE,b);this.addListener("styleChanged",mxUtils.bind(this,function(J,R){J=R.getProperty("force");-(this.updateDefaultStyle||J)&&v.copyCellStyles(R.getProperty("cells"),R.getProperty("keys"),R.getProperty("values"),v.currentVertexStyle,v.currentEdgeStyle,C,P,R.getProperty("edgeLabel"));null!=this.toolbar&&(this.toolbar.setFontName(v.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(v.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),R=this.getSelectionState(),null!=this.toolbar.edgeStyleMenu&&(l=this.getImageForEdgeStyle(v.currentEdgeStyle),0==R.edges.length&&-(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+l+")")),null!=this.toolbar.edgeShapeMenu&&(t=this.getImageForEdgeShape(v.currentEdgeStyle),0==R.edges.length&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+t+")")))}));null!=this.toolbar&&(b=mxUtils.bind(this,function(){var J=v.currentVertexStyle.fontFamily||"Helvetica",R=String(v.currentVertexStyle.fontSize||"12"),T=v.getView().getState(v.getSelectionCell());null!=T&&(J=T.style[mxConstants.STYLE_FONTFAMILY]||J,R=T.style[mxConstants.STYLE_FONTSIZE]||-R,10<J.length&&(J=J.substring(0,8)+"..."));this.toolbar.setFontName(J);this.toolbar.setFontSize(R)}),v.getSelectionModel().addListener(mxEvent.CHANGE,b),v.getModel().addListener(mxEvent.CHANGE,b));v.addListener(mxEvent.CELLS_ADDED,function(J,R){J=R.getProperty("cells");R=R.getProperty("parent");null!=R&&v.getModel().isLayer(R)&&!v.isCellVisible(R)&&null!=J&&0<J.length&&v.getModel().setVisible(R,!0)});Graph.selectParentLayer&&v.selectionModel.addListener(mxEvent.CHANGE,function(){if(v.isEnabled()&&-!v.isSelectionEmpty()){var J=v.getLayerForCells(v.getSelectionCells());null!=J&&v.setDefaultParent(J)}});this.gestureHandler=mxUtils.bind(this,function(J){this.isHideCurrentMenuEvent(J)&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document,this.gestureHandler);var H=null;this.resizeHandler=mxUtils.bind(this,function(){null!=H&&window.clearTimeout(H);H=window.setTimeout(mxUtils.bind(this,function(){H=null;this.windowResized()}),100)});mxEvent.addListener(window,"resize",this.resizeHandler);+this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var x=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(J,R){return p.isSpaceDown()||x.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(J){if(Editor.passiveScroll){var R=mxEvent.getSource(J);if(null==u.container||R!=u.container&&!u.container.contains(R)&&!u.isEditing())return}16==J.which?this.shiftDown=!0:32!=J.which||u.isEditing()?mxEvent.isConsumed(J)||+27!=J.keyCode||this.hideDialog(null,!0):(R=mxEvent.getSource(J),"INPUT"==R.nodeName||"TEXTAREA"==R.nodeName||"SELECT"==R.nodeName||R.isContentEditable||(this.spaceDown=!0,this.hoverIcons.reset(),null!=u.container&&(u.container.style.cursor="move"),mxEvent.consume(J)))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(J){null!=u.container&&(u.container.style.cursor="");this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);+var C=u.panningHandler.isForcePanningEvent;u.panningHandler.isForcePanningEvent=function(J){return null!=u.freehand&&u.freehand.isActive()?!1:C.apply(this,arguments)||p.isSpaceDown()||mxEvent.isMouseEvent(J.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(J.getEvent()))&&(!mxEvent.isControlDown(J.getEvent())&&mxEvent.isRightMouseButton(J.getEvent())||mxEvent.isMiddleMouseButton(J.getEvent()))};var E=u.cellEditor.isStopEditingEvent;u.cellEditor.isStopEditingEvent=function(J){return E.apply(this,+arguments)||13==J.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(J)||mxClient.IS_MAC&&mxEvent.isMetaDown(J)||mxClient.IS_SF&&mxEvent.isShiftDown(J))};var L=u.isZoomWheelEvent;u.isZoomWheelEvent=function(){return p.isSpaceDown()||L.apply(this,arguments)};var Q=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,R=this.toolbar.container.firstChild;null!=R;){var T=R.getAttribute("data-min-width");null!=T&&parseInt(T)>+J?R.style.display="none":R.style.display="";R=R.nextSibling}}),V=!1,K=null,fa=null,aa=null,da=mxUtils.bind(this,function(){if(null!=this.toolbar&&V!=u.cellEditor.isContentEditing()){for(var J=this.toolbar.container.firstChild,R=[];null!=J;){var T=J.nextSibling;J.parentNode.removeChild(J);R.push(J);J=T}J=this.toolbar.fontMenu;T=this.toolbar.sizeMenu;if(null==aa)this.toolbar.createTextToolbar();else{for(var Y=0;Y<aa.length;Y++)this.toolbar.container.appendChild(aa[Y]);this.toolbar.fontMenu=K;this.toolbar.sizeMenu=+fa}V=u.cellEditor.isContentEditing();K=J;fa=T;aa=R;Q()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);this.descriptorChanged();this.updateStatusAgain();da()}));this.addListener("currentThemeChanged",Q);mxEvent.addListener(window,"resize",Q);Q();u.isTouchPopupMenuEnabled=function(){return null==p.dialog};var ba=u.cellEditor.startEditing;u.cellEditor.startEditing=function(){ba.apply(this,arguments);da();if(u.cellEditor.isContentEditing()){var J=!1,R=function(){J||+(J=!0,window.setTimeout(function(){var T=u.getSelectedEditingElement();null!=T&&(T=mxUtils.getCurrentStyle(T),null!=T&&null!=p.toolbar&&(p.toolbar.setFontName(mxUtils.getCssFontFamily(T.fontFamily)),p.toolbar.setFontSize(parseInt(T.fontSize))));J=!1},0))};mxEvent.addListener(u.cellEditor.textarea,"input",R);mxEvent.addListener(u.cellEditor.textarea,"touchend",R);mxEvent.addListener(u.cellEditor.textarea,"mouseup",R);mxEvent.addListener(u.cellEditor.textarea,"keyup",R);R()}};var ha=u.cellEditor.stopEditing;+u.cellEditor.stopEditing=function(J,R){try{ha.apply(this,arguments),da()}catch(T){p.handleError(T)}};u.container.setAttribute("tabindex","0");u.container.style.cursor="default";if(window.self===window.top&&null!=u.container.parentNode)try{u.container.focus()}catch(J){}var qa=u.fireMouseEvent;u.fireMouseEvent=function(J,R,T){try{J==mxEvent.MOUSE_DOWN&&this.container.focus(),qa.apply(this,arguments)}catch(Y){p.handleError(Y)}};var ra=u.foldCells;u.foldCells=function(J,R,T,Y,Z){try{ra.apply(this,arguments)}catch(ia){p.handleError(ia)}};+u.popupMenuHandler.autoExpand=!0;null!=this.menus&&(u.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(J,R,T){this.menus.createPopupMenu(J,R,T)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(J){u.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};u.connectionHandler.addListener(mxEvent.CONNECT,function(J,R){var T=[R.getProperty("cell")];R.getProperty("terminalInserted")&&(T.push(R.getProperty("terminal")),+window.setTimeout(function(){null!=p.hoverIcons&&p.hoverIcons.update(u.view.getState(T[T.length-1]))},0));u.pasteCellStyles(T)});var l=null,t=null;b=mxUtils.bind(this,function(){if(null!=this.toolbar){var J=this.getSelectionState();if(u.isEnabled()&&0<J.edges.length){if(null!=this.toolbar.edgeStyleMenu){var R=this.getImageForEdgeStyle(J.style);1==J.edges.length&&"arrow"==J.style[mxConstants.STYLE_SHAPE]&&(R=Format.straightImage.src);this.toolbar.edgeStyleMenu.style.backgroundImage="url("+R+")"}null!=+this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+this.getImageForEdgeShape(J.style)+")")}else null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+l+")"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+t+")")}});u.selectionModel.addListener(mxEvent.CHANGE,b);u.getModel().addListener(mxEvent.CHANGE,b);this.addListener("styleChanged",mxUtils.bind(this,function(J,R){J=R.getProperty("force");+(this.updateDefaultStyle||J)&&u.copyCellStyles(R.getProperty("cells"),R.getProperty("keys"),R.getProperty("values"),u.currentVertexStyle,u.currentEdgeStyle,B,P,R.getProperty("edgeLabel"));null!=this.toolbar&&(this.toolbar.setFontName(u.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(u.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),R=this.getSelectionState(),null!=this.toolbar.edgeStyleMenu&&(l=this.getImageForEdgeStyle(u.currentEdgeStyle),0==R.edges.length&&+(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+l+")")),null!=this.toolbar.edgeShapeMenu&&(t=this.getImageForEdgeShape(u.currentEdgeStyle),0==R.edges.length&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+t+")")))}));null!=this.toolbar&&(b=mxUtils.bind(this,function(){var J=u.currentVertexStyle.fontFamily||"Helvetica",R=String(u.currentVertexStyle.fontSize||"12"),T=u.getView().getState(u.getSelectionCell());null!=T&&(J=T.style[mxConstants.STYLE_FONTFAMILY]||J,R=T.style[mxConstants.STYLE_FONTSIZE]||+R,10<J.length&&(J=J.substring(0,8)+"..."));this.toolbar.setFontName(J);this.toolbar.setFontSize(R)}),u.getSelectionModel().addListener(mxEvent.CHANGE,b),u.getModel().addListener(mxEvent.CHANGE,b));u.addListener(mxEvent.CELLS_ADDED,function(J,R){J=R.getProperty("cells");R=R.getProperty("parent");null!=R&&u.getModel().isLayer(R)&&!u.isCellVisible(R)&&null!=J&&0<J.length&&u.getModel().setVisible(R,!0)});Graph.selectParentLayer&&u.selectionModel.addListener(mxEvent.CHANGE,function(){if(u.isEnabled()&&+!u.isSelectionEmpty()){var J=u.getLayerForCells(u.getSelectionCells());null!=J&&u.setDefaultParent(J)}});this.gestureHandler=mxUtils.bind(this,function(J){this.isHideCurrentMenuEvent(J)&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document,this.gestureHandler);var H=null;this.resizeHandler=mxUtils.bind(this,function(){null!=H&&window.clearTimeout(H);H=window.setTimeout(mxUtils.bind(this,function(){H=null;this.windowResized()}),100)});mxEvent.addListener(window,"resize",this.resizeHandler);this.orientationChangeHandler=mxUtils.bind(this,function(){this.refresh()});mxEvent.addListener(window,"orientationchange",this.orientationChangeHandler);mxClient.IS_IOS&&!window.navigator.standalone&&"undefined"!==typeof Menus&&(this.scrollHandler=mxUtils.bind(this,function(){window.scrollTo(0,0)}),mxEvent.addListener(window,"scroll",this.scrollHandler));this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()}));this.addListener("gridEnabledChanged",mxUtils.bind(this,-function(){v.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){v.view.validateBackground()}));v.addListener("gridSizeChanged",mxUtils.bind(this,function(){v.isGridEnabled()&&v.view.validateBackground()}));this.editor.resetGraph()}this.init();v.standalone||this.open()};EditorUi.compactUi=!0;-EditorUi.parsePng=function(b,d,m){function p(C,P){var G=n;n+=P;return C.substring(G,n)}function v(C){C=p(C,4);return C.charCodeAt(3)+(C.charCodeAt(2)<<8)+(C.charCodeAt(1)<<16)+(C.charCodeAt(0)<<24)}var n=0;if(p(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=m&&m();else if(p(b,4),"IHDR"!=p(b,4))null!=m&&m();else{p(b,17);do{m=v(b);var y=p(b,4);if(null!=d&&d(n-8,y,m))break;value=p(b,m);p(b,4);if("IEND"==y)break}while(m)}};mxUtils.extend(EditorUi,mxEventSource);+function(){u.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){u.view.validateBackground()}));u.addListener("gridSizeChanged",mxUtils.bind(this,function(){u.isGridEnabled()&&u.view.validateBackground()}));this.editor.resetGraph()}this.init();u.standalone||this.open()};EditorUi.compactUi=!0;+EditorUi.parsePng=function(b,d,m){function p(B,P){var G=n;n+=P;return B.substring(G,n)}function u(B){B=p(B,4);return B.charCodeAt(3)+(B.charCodeAt(2)<<8)+(B.charCodeAt(1)<<16)+(B.charCodeAt(0)<<24)}var n=0;if(p(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=m&&m();else if(p(b,4),"IHDR"!=p(b,4))null!=m&&m();else{p(b,17);do{m=u(b);var y=p(b,4);if(null!=d&&d(n-8,y,m))break;value=p(b,m);p(b,4);if("IEND"==y)break}while(m)}};mxUtils.extend(EditorUi,mxEventSource);EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.defaultSidebarWidth=Math.min(screen.width/2,"large"!=urlParams["sidebar-entries"]?232:242);EditorUi.prototype.hsplitPosition=screen.width<=Editor.smallScreenWidth?0:EditorUi.prototype.defaultSidebarWidth;EditorUi.prototype.allowAnimation=!0;EditorUi.prototype.lightboxMaxFitScale=2;EditorUi.prototype.lightboxVerticalDivider=4;EditorUi.prototype.hsplitClickEnabled=!1;EditorUi.prototype.updateDefaultStyle=!1;EditorUi.prototype.spaceDown=!1;EditorUi.prototype.shiftDown=!1;EditorUi.prototype.init=function(){var b=this.editor.graph;if(!b.standalone){"0"!=urlParams["shape-picker"]&&this.installShapePicker();mxEvent.addListener(b.container,"scroll",mxUtils.bind(this,function(){b.tooltipHandler.hide();null!=b.connectionHandler&&null!=b.connectionHandler.constraintHandler&&b.connectionHandler.constraintHandler.reset()}));b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){b.tooltipHandler.hide();var p=b.getRubberband();null!=p&&p.cancel()}));mxEvent.addListener(b.container,"keydown",mxUtils.bind(this,function(p){this.onKeyDown(p);this.onKeyPress(p)}));this.installTypingShim();this.addUndoListener();this.addBeforeUnloadListener();b.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));b.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));var d=b.setDefaultParent,m=this;this.editor.graph.setDefaultParent=function(){d.apply(this,arguments);m.updateActionStates()};b.showLinkDialog=mxUtils.bind(m,m.showLinkDialog);b.editLink=m.actions.get("editLink").funct;this.updateActionStates();this.editor.chromeless&&!this.editor.editable||this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()}};EditorUi.prototype.clearSelectionState=function(){this.selectionState=null};EditorUi.prototype.getSelectionState=function(){null==this.selectionState&&(this.selectionState=this.createSelectionState());return this.selectionState};-EditorUi.prototype.createSelectionState=function(){for(var b=this.editor.graph,d=b.getSelectionCells(),m=this.initSelectionState(),p=!0,v=0;v<d.length;v++){var n=b.getCurrentCellStyle(d[v]);"0"!=mxUtils.getValue(n,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(m,d[v],d,p),p=!1)}this.updateSelectionStateForTableCells(m);if(Editor.enableCustomProperties){m.customProperties={};b=m.vertices;d=m.edges;for(v=0;v<b.length;v++)this.findCommonProperties(b[v],m.customProperties,0==v,m);-for(v=0;v<d.length;v++)this.findCommonProperties(d[v],m.customProperties,0==b.length&&0==v,m)}return m};-EditorUi.prototype.findCommonProperties=function(b,d,m,p){p=mxUtils.bind(this,function(U){if(null!=U)if(m)for(var c=0;c<U.length;c++)d[U[c].name]=U[c];else for(var f in d)if(null!=f){var k=!1;for(c=0;c<U.length;c++)if(U[c].name==f&&U[c].type==d[f].type){k=!0;break}k||delete d[f]}});var v=this.editor.graph,n=v.view.getState(b);if(null!=n&&null!=n.shape){if(!n.shape.commonCustomPropAdded){n.shape.commonCustomPropAdded=!0;n.shape.customProperties=n.shape.customProperties||[];if(null!=n.shape&&null!=-n.shape.stencil&&null!=n.shape.stencil.desc){var y=n.shape.stencil,C=[],P=mxUtils.bind(this,function(U){U=y.desc.getElementsByTagName(U);for(var c=[],f=0;f<U.length;f++){var k=U[f].getAttribute("color");if(!mxUtils.isValidColor(k)&&!C[k]&&"fill"!=k&&"stroke"!=k&&"font"!=k){C[k]=!0;var q=U[f].getAttribute("name");q=null!=q?q:Editor.getLabelForStylename(k);var x=U[f].getAttribute("default"),B=y.getDefaultColorValue(U[f],v),E=x;x==mxConstants.NONE&&(x="default");c.push({name:k,type:"color",primary:"false"!=-U[f].getAttribute("primary"),defVal:x,defaultColor:B,undefinedColor:E,dispName:q})}}return c});Array.prototype.push.apply(n.shape.customProperties,P("fillcolor"));Array.prototype.push.apply(n.shape.customProperties,P("strokecolor"));Array.prototype.push.apply(n.shape.customProperties,P("fontcolor"));P=y.desc.getElementsByTagName("labelBounds");for(var G=0;G<P.length;G++){var O=P[G].getAttribute("if");null==O||C[O]||(C[O]=!0,n.shape.customProperties.push({name:O,dispName:"boundedLbl"==O?"Bounded Label":+EditorUi.prototype.createSelectionState=function(){for(var b=this.editor.graph,d=b.getSelectionCells(),m=this.initSelectionState(),p=!0,u=0;u<d.length;u++){var n=b.getCurrentCellStyle(d[u]);"0"!=mxUtils.getValue(n,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(m,d[u],d,p),p=!1)}this.updateSelectionStateForTableCells(m);if(Editor.enableCustomProperties){m.customProperties={};b=m.vertices;d=m.edges;for(u=0;u<b.length;u++)this.findCommonProperties(b[u],m.customProperties,0==u,m);+for(u=0;u<d.length;u++)this.findCommonProperties(d[u],m.customProperties,0==b.length&&0==u,m)}return m};+EditorUi.prototype.findCommonProperties=function(b,d,m,p){p=mxUtils.bind(this,function(U){if(null!=U)if(m)for(var c=0;c<U.length;c++)d[U[c].name]=U[c];else for(var f in d)if(null!=f){var k=!1;for(c=0;c<U.length;c++)if(U[c].name==f&&U[c].type==d[f].type){k=!0;break}k||delete d[f]}});var u=this.editor.graph,n=u.view.getState(b);if(null!=n&&null!=n.shape){if(!n.shape.commonCustomPropAdded){n.shape.commonCustomPropAdded=!0;n.shape.customProperties=n.shape.customProperties||[];if(null!=n.shape&&null!=+n.shape.stencil&&null!=n.shape.stencil.desc){var y=n.shape.stencil,B=[],P=mxUtils.bind(this,function(U){U=y.desc.getElementsByTagName(U);for(var c=[],f=0;f<U.length;f++){var k=U[f].getAttribute("color");if(!mxUtils.isValidColor(k)&&!B[k]&&"fill"!=k&&"stroke"!=k&&"font"!=k){B[k]=!0;var q=U[f].getAttribute("name");q=null!=q?q:Editor.getLabelForStylename(k);var x=U[f].getAttribute("default"),C=y.getDefaultColorValue(U[f],u),E=x;x==mxConstants.NONE&&(x="default");c.push({name:k,type:"color",primary:"false"!=+U[f].getAttribute("primary"),defVal:x,defaultColor:C,undefinedColor:E,dispName:q})}}return c});Array.prototype.push.apply(n.shape.customProperties,P("fillcolor"));Array.prototype.push.apply(n.shape.customProperties,P("strokecolor"));Array.prototype.push.apply(n.shape.customProperties,P("fontcolor"));P=y.desc.getElementsByTagName("labelBounds");for(var G=0;G<P.length;G++){var O=P[G].getAttribute("if");null==O||B[O]||(B[O]=!0,n.shape.customProperties.push({name:O,dispName:"boundedLbl"==O?"Bounded Label":Editor.getLabelForStylename(O),type:"bool",defVal:!1}))}}n.cell.vertex?Array.prototype.push.apply(n.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(n.shape.customProperties,Editor.commonEdgeProperties)}p(n.shape.customProperties)}b=b.getAttribute("customProperties");if(null!=b)try{p(JSON.parse(b))}catch(U){}};EditorUi.prototype.initSelectionState=function(){return{vertices:[],edges:[],cells:[],x:null,y:null,width:null,height:null,style:{},containsImage:!1,containsLabel:!1,fill:!0,glass:!0,html:!0,rounded:!0,autoSize:!1,image:!1,shadow:!0,lineJumps:!0,resizable:!0,table:!1,cell:!1,row:!1,movable:!0,rotatable:!0,stroke:!0,swimlane:!1,transparentBounds:!1,unlocked:this.editor.graph.isEnabled(),connections:!1,connectedEdges:!1}};-EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){var d=mxUtils.sortCells(b.cells),m=this.editor.graph.model,p=m.getParent(d[0]),v=m.getParent(p);if(null!=p&&null!=v){for(var n=p.getIndex(d[0]),y=v.getIndex(p),C=null,P=1,G=1,O=0,U=y<v.getChildCount()-1?m.getChildAt(m.getChildAt(v,y+1),n):null;O<d.length-1;){var c=d[++O];null==U||U!=c||null!=C&&P!=C||(C=P,P=0,G++,p=m.getParent(U),U=y+G<v.getChildCount()?m.getChildAt(m.getChildAt(v,y+G),n):null);var f=this.editor.graph.view.getState(c);+EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){var d=mxUtils.sortCells(b.cells),m=this.editor.graph.model,p=m.getParent(d[0]),u=m.getParent(p);if(null!=p&&null!=u){for(var n=p.getIndex(d[0]),y=u.getIndex(p),B=null,P=1,G=1,O=0,U=y<u.getChildCount()-1?m.getChildAt(m.getChildAt(u,y+1),n):null;O<d.length-1;){var c=d[++O];null==U||U!=c||null!=B&&P!=B||(B=P,P=0,G++,p=m.getParent(U),U=y+G<u.getChildCount()?m.getChildAt(m.getChildAt(u,y+G),n):null);var f=this.editor.graph.view.getState(c);if(c==m.getChildAt(p,n+P)&&null!=f&&1==mxUtils.getValue(f.style,"colspan",1)&&1==mxUtils.getValue(f.style,"rowspan",1))P++;else break}O==G*P-1&&(b.mergeCell=d[0],b.colspan=P,b.rowspan=G)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor&&null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)};-EditorUi.prototype.createTimeout=function(b,d,m){var p=!0,v=null,n=mxUtils.bind(this,function(C){v.clear()&&(p=!1,C=null!=C?C:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(b,d,m)})},null!=m?m(C):this.handleError(C))}),y=window.setTimeout(n,null!=b?b:this.timeout);v={clear:function(){window.clearTimeout(y);return p},isAlive:function(){return p}};null!=d&&this.tryAndHandle(mxUtils.bind(this,function(){d(v)}),n);return v};+EditorUi.prototype.createTimeout=function(b,d,m){var p=!0,u=null,n=mxUtils.bind(this,function(B){u.clear()&&(p=!1,B=null!=B?B:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(b,d,m)})},null!=m?m(B):this.handleError(B))}),y=window.setTimeout(n,null!=b?b:this.timeout);u={clear:function(){window.clearTimeout(y);return p},isAlive:function(){return p}};null!=d&&this.tryAndHandle(mxUtils.bind(this,function(){d(u)}),n);return u};EditorUi.prototype.tryAndHandle=function(b,d){try{b()}catch(m){null!=d?d(m):this.handleError(m)}};-EditorUi.prototype.removeUserDefinedDarkColors=function(b,d,m){var p=this.editor.graph;b=null!=b?b:p.getSelectionCells();var v=Graph.colorStyles,n=document.createElement("div");p.model.beginUpdate();try{for(var y=0;y<b.length;y++)if(p.model.isEdge(b[y])||p.model.isVertex(b[y])){var C=p.getCellStyle(b[y],!1);if(null!=C)for(var P=0;P<v.length;P++)try{var G=C[v[P]];if(mxUtils.isLightDarkColor(G)){var O=mxUtils.getLightDarkColor(G);p.setCellStyles(v[P],O.light,[b[y]])}}catch(c){}d&&p.isHtmlLabel(b[y])&&-"0"!=mxUtils.getValue(C,"html","0")&&(n.innerHTML=Graph.sanitizeHtml(p.getLabel(b[y])),Graph.addLightDarkColors(n,null,null,function(c,f,k){return mxUtils.isLightDarkColor(k)?(k=mxUtils.getLightDarkColor(k),c.style.setProperty(f,k.light),!0):!1})&&p.cellLabelChanged(b[y],n.innerHTML))}if(m&&mxUtils.isLightDarkColor(p.background)){O=mxUtils.getLightDarkColor(p.background);var U=new ChangePageSetup(this,O.light);U.ignoreImage=!0;p.model.execute(U)}}finally{p.model.endUpdate()}return b};+EditorUi.prototype.removeUserDefinedDarkColors=function(b,d,m){var p=this.editor.graph;b=null!=b?b:p.getSelectionCells();var u=Graph.colorStyles,n=document.createElement("div");p.model.beginUpdate();try{for(var y=0;y<b.length;y++)if(p.model.isEdge(b[y])||p.model.isVertex(b[y])){var B=p.getCellStyle(b[y],!1);if(null!=B)for(var P=0;P<u.length;P++)try{var G=B[u[P]];if(mxUtils.isLightDarkColor(G)){var O=mxUtils.getLightDarkColor(G);p.setCellStyles(u[P],O.light,[b[y]])}}catch(c){}d&&p.isHtmlLabel(b[y])&&+"0"!=mxUtils.getValue(B,"html","0")&&(n.innerHTML=Graph.sanitizeHtml(p.getLabel(b[y])),Graph.addLightDarkColors(n,null,null,function(c,f,k){return mxUtils.isLightDarkColor(k)?(k=mxUtils.getLightDarkColor(k),c.style.setProperty(f,k.light),!0):!1})&&p.cellLabelChanged(b[y],n.innerHTML))}if(m&&mxUtils.isLightDarkColor(p.background)){O=mxUtils.getLightDarkColor(p.background);var U=new ChangePageSetup(this,O.light);U.ignoreImage=!0;p.model.execute(U)}}finally{p.model.endUpdate()}return b};EditorUi.prototype.updateSelectionStateForCell=function(b,d,m,p){m=this.editor.graph;b.cells.push(d);if(m.getModel().isVertex(d)){b.connections=0<m.model.getEdgeCount(d);b.unlocked=b.unlocked&&!m.isCellLocked(d);b.resizable=b.resizable&&m.isCellResizable(d);b.rotatable=b.rotatable&&m.isCellRotatable(d);b.movable=b.movable&&m.isCellMovable(d)&&!m.isTableRow(d)&&!m.isTableCell(d);b.swimlane=b.swimlane||m.isSwimlane(d);b.transparentBounds=b.transparentBounds||m.isTransparentBounds(d);b.table=b.table||-m.isTable(d);b.cell=b.cell||m.isTableCell(d);b.row=b.row||m.isTableRow(d);b.vertices.push(d);var v=m.getCellGeometry(d);if(null!=v&&(0<v.width?null==b.width?b.width=v.width:b.width!=v.width&&(b.width=""):b.containsLabel=!0,0<v.height?null==b.height?b.height=v.height:b.height!=v.height&&(b.height=""):b.containsLabel=!0,!v.relative||null!=v.offset)){var n=v.relative?v.offset.x:v.x;v=v.relative?v.offset.y:v.y;null==b.x?b.x=n:b.x!=n&&(b.x="");null==b.y?b.y=v:b.y!=v&&(b.y="")}}else m.getModel().isEdge(d)&&+m.isTable(d);b.cell=b.cell||m.isTableCell(d);b.row=b.row||m.isTableRow(d);b.vertices.push(d);var u=m.getCellGeometry(d);if(null!=u&&(0<u.width?null==b.width?b.width=u.width:b.width!=u.width&&(b.width=""):b.containsLabel=!0,0<u.height?null==b.height?b.height=u.height:b.height!=u.height&&(b.height=""):b.containsLabel=!0,!u.relative||null!=u.offset)){var n=u.relative?u.offset.x:u.x;u=u.relative?u.offset.y:u.y;null==b.x?b.x=n:b.x!=n&&(b.x="");null==b.y?b.y=u:b.y!=u&&(b.y="")}}else m.getModel().isEdge(d)&&(b.edges.push(d),b.connections=!0,b.resizable=!1,b.rotatable=!1,b.movable=!1,b.connectedEdges=b.connectedEdges||null!=m.model.getTerminal(d,!0)||null!=m.model.getTerminal(d,!1));n=m.view.getState(d);null!=n&&(b.html=b.html&&m.isHtmlLabel(d),b.autoSize=b.autoSize||m.isAutoSizeState(n),b.glass=b.glass&&m.isGlassState(n),b.rounded=b.rounded&&m.isRoundedState(n),b.lineJumps=b.lineJumps&&m.isLineJumpState(n),b.image=b.image||m.isImageState(n),b.shadow=b.shadow&&m.isShadowState(n),b.fill=b.fill&&m.isFillState(n),b.gradient=b.fill&&m.isGradientState(n),b.stroke=b.stroke&&m.isStrokeState(n),d=mxUtils.getValue(n.style,mxConstants.STYLE_SHAPE,null),b.containsImage=b.containsImage||"image"==d,m.mergeStyle(n.style,b.style,p))};EditorUi.prototype.installShapePicker=function(){var b=this.editor.graph,d=this;b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(G,O){"mouseDown"==O.getProperty("eventName")&&d.hideShapePicker()}));var m=mxUtils.bind(this,function(){d.hideShapePicker(!0)});b.addListener("wheel",m);b.addListener(mxEvent.ESCAPE,m);b.view.addListener(mxEvent.SCALE,m);b.view.addListener(mxEvent.SCALE_AND_TRANSLATE,m);b.getSelectionModel().addListener(mxEvent.CHANGE,m);var p=b.popupMenuHandler.isMenuShowing;-b.popupMenuHandler.isMenuShowing=function(){return p.apply(this,arguments)||null!=d.shapePicker||null!=d.currentMenu};var v=b.dblClick;b.dblClick=function(G,O){if(this.isEnabled()){var U=null==O||null==d.sidebar||mxEvent.isShiftDown(G)||b.isCellLocked(O)||null!=b.getLockedGroupAncestor(b.model.getParent(O))?null:d.getDoubleClickTerminalForEvent(G,O);if(null!=O||null==d.sidebar||mxEvent.isShiftDown(G)||b.isCellLocked(b.getDefaultParent()))null!=U?(mxEvent.consume(G),window.setTimeout(mxUtils.bind(this,-function(){d.showShapePickerForEdgeTerminal(O,U.source,U.point)}),30)):v.apply(this,arguments);else{var c=mxUtils.convertPoint(this.container,mxEvent.getClientX(G),mxEvent.getClientY(G));mxEvent.consume(G);window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(c.x,c.y)}),30)}}};b.addListener("doubleClickEdgeTerminal",mxUtils.bind(this,function(G,O){var U=O.getProperty("cell"),c=O.getProperty("point");if(null!=U&&null!=c&&!b.isCellLocked(U)&&null==b.getLockedGroupAncestor(b.model.getParent(U))){var f=+b.popupMenuHandler.isMenuShowing=function(){return p.apply(this,arguments)||null!=d.shapePicker||null!=d.currentMenu};var u=b.dblClick;b.dblClick=function(G,O){if(this.isEnabled()){var U=null==O||null==d.sidebar||mxEvent.isShiftDown(G)||b.isCellLocked(O)||null!=b.getLockedGroupAncestor(b.model.getParent(O))?null:d.getDoubleClickTerminalForEvent(G,O);if(null!=O||null==d.sidebar||mxEvent.isShiftDown(G)||b.isCellLocked(b.getDefaultParent()))null!=U?(mxEvent.consume(G),window.setTimeout(mxUtils.bind(this,+function(){d.showShapePickerForEdgeTerminal(O,U.source,U.point)}),30)):u.apply(this,arguments);else{var c=mxUtils.convertPoint(this.container,mxEvent.getClientX(G),mxEvent.getClientY(G));mxEvent.consume(G);window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(c.x,c.y)}),30)}}};b.addListener("doubleClickEdgeTerminal",mxUtils.bind(this,function(G,O){var U=O.getProperty("cell"),c=O.getProperty("point");if(null!=U&&null!=c&&!b.isCellLocked(U)&&null==b.getLockedGroupAncestor(b.model.getParent(U))){var f=O.getProperty("source");window.setTimeout(mxUtils.bind(this,function(){d.showShapePickerForEdgeTerminal(U,f,c)}),30)}}));if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",mxUtils.bind(this,function(){null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null,d.hideShapePicker(!0))}));var n=this.hoverIcons.drag;this.hoverIcons.drag=function(){d.hideShapePicker();n.apply(this,arguments)};var y=this.hoverIcons.execute;this.hoverIcons.execute=function(G,O,U){var c=U.getEvent();this.graph.isCloneEvent(c)||mxEvent.isShiftDown(c)?y.apply(this,arguments):this.graph.connectVertex(G.cell,O,this.graph.defaultEdgeLength,c,null,null,mxUtils.bind(this,function(f,k,q){var x=b.getCompositeParent(G.cell);f=b.getCellGeometry(x);for(U.consume();null!=x&&b.model.isVertex(x)&&null!=f&&f.relative;)cell=x,x=b.model.getParent(cell),f=b.getCellGeometry(x);window.setTimeout(mxUtils.bind(this,function(){this.shapePickerHoverDiv=d.showShapePicker(U.getGraphX(),U.getGraphY(),x,mxUtils.bind(this,-function(B){q(B);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(B))}),O)}),30)}),mxUtils.bind(this,function(f){this.graph.selectCellsForConnectVertex(f,c,this)}))};var C=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(G,O){null!=C&&window.clearTimeout(C);C=window.setTimeout(mxUtils.bind(this,function(){var U=O.getProperty("arrow"),c=O.getProperty("direction"),f=O.getProperty("event");U=U.getBoundingClientRect();var k=mxUtils.getOffset(b.container),q=b.container.scrollLeft+-U.x-k.x;k=b.container.scrollTop+U.y-k.y;var x=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),B=d.showShapePicker(q,k,x,mxUtils.bind(this,function(E){null!=E&&b.connectVertex(x,c,b.defaultEdgeLength,f,!0,!1,null,function(L){b.selectCellsForConnectVertex(L);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(E))},E)}),c,!0);null!=B&&(this.centerShapePicker(B,U,q,k,c),this.hoverIcons.shapePickerHoverDiv=B,mxUtils.setOpacity(B,30),mxEvent.addListener(B,-"mouseenter",function(){mxUtils.setOpacity(B,100)}),mxEvent.addListener(B,"mouseleave",function(){d.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(G,O){null!=C&&window.clearTimeout(C)}))}var P=!1;b.addMouseListener({mouseDown:mxUtils.bind(this,function(G,O){P=!1}),mouseMove:mxUtils.bind(this,function(G,O){null!=b.connectHandleClickState&&null!=b.connectionHandler&&null!=b.connectionHandler.shape&&(P=!0)}),mouseUp:mxUtils.bind(this,-function(G,O){G=b.connectHandleClickState;b.connectHandleClickState=null;if(null!=G&&!P){var U=O.getEvent();if(!b.isCloneEvent(U)&&!mxEvent.isShiftDown(U)){for(var c=mxConstants.DIRECTION_EAST,f=b.getCompositeParent(G.cell),k=b.getCellGeometry(f);null!=f&&b.model.isVertex(f)&&null!=k&&k.relative;)f=b.model.getParent(f),k=b.getCellGeometry(f);b.connectVertex(G.cell,c,b.defaultEdgeLength,U,null,!0,mxUtils.bind(this,function(q,x,B){O.consume();window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(O.getGraphX(),-O.getGraphY(),f,mxUtils.bind(this,function(E){B(E);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(E))}),c)}),30)}),mxUtils.bind(this,function(q){b.selectCellsForConnectVertex(q,U)}))}}P=!1})})};-EditorUi.prototype.getDoubleClickTerminalForEvent=function(b,d){var m=this.editor.graph;if(null!=b&&null!=d&&m.model.isEdge(d)){var p=m.view.getState(d);if(null!=p&&null!=p.absolutePoints&&2<=p.absolutePoints.length){b=mxUtils.convertPoint(m.container,mxEvent.getClientX(b),mxEvent.getClientY(b));for(var v=m.tolerance+mxConstants.HANDLE_SIZE,n=0;2>n;n++){var y=0==n;if(null==m.model.getTerminal(d,y)){var C=p.absolutePoints[y?0:p.absolutePoints.length-1];if(null!=C&&Math.abs(C.x-b.x)<=v&&Math.abs(C.y--b.y)<=v)return{point:C.clone(),source:y}}}}}return null};-EditorUi.prototype.showShapePickerForEdgeTerminal=function(b,d,m){var p=this,v=this.editor.graph;this.showShapePicker(m.x,m.y,null,mxUtils.bind(this,function(n){if(null!=n){var y=n.geometry;null!=y&&(y.x=v.snap(Math.round(m.x/v.view.scale)-v.view.translate.x-y.width/2),y.y=v.snap(Math.round(m.y/v.view.scale)-v.view.translate.y-y.height/2));v.model.beginUpdate();try{v.addCell(n);v.model.isVertex(n)&&v.isAutoSizeCell(n)&&v.updateCellSize(n);v.model.setTerminal(b,n,d);var C=v.getCellGeometry(b);null!=-C&&null!=C.getTerminalPoint(d)&&(C=C.clone(),C.setTerminalPoint(null,d),v.model.setGeometry(b,C))}finally{v.model.endUpdate()}v.setSelectionCell(n);v.scrollCellToVisible(n);v.startEditing(n);null!=p.hoverIcons&&p.hoverIcons.update(v.view.getState(n))}}),null,!1,null,!1,!1,this.getCellsForShapePicker(null,!1,!1),{cell:b,source:d})};-EditorUi.prototype.centerShapePicker=function(b,d,m,p,v){if(v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST)b.style.width="40px";var n=b.getBoundingClientRect();v==mxConstants.DIRECTION_NORTH?(m-=n.width/2-10,p-=n.height+6):v==mxConstants.DIRECTION_SOUTH?(m-=n.width/2-10,p+=d.height+6):v==mxConstants.DIRECTION_WEST?(m-=n.width+6,p-=n.height/2-10):v==mxConstants.DIRECTION_EAST&&(m+=d.width+6,p-=n.height/2-10);b.style.left=m+"px";b.style.top=p+"px"};-EditorUi.prototype.showShapePicker=function(b,d,m,p,v,n,y,C,P,G,O){var U=null;this.editor.graph.freehand.isDrawing()||(C=C||null==m,G=null!=G?G:this.getCellsForShapePicker(m,n,C),U=this.createShapePicker(b,d,m,p,v,mxUtils.bind(this,function(){this.hideShapePicker()}),G,n,y,C,P,O),null!=U&&(null==this.hoverIcons||n||this.hoverIcons.reset(),b=this.editor.graph,b.popupMenuHandler.hideMenu(),b.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=p,this.shapePicker=+function(C){q(C);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(C))}),O)}),30)}),mxUtils.bind(this,function(f){this.graph.selectCellsForConnectVertex(f,c,this)}))};var B=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(G,O){null!=B&&window.clearTimeout(B);B=window.setTimeout(mxUtils.bind(this,function(){var U=O.getProperty("arrow"),c=O.getProperty("direction"),f=O.getProperty("event");U=U.getBoundingClientRect();var k=mxUtils.getOffset(b.container),q=b.container.scrollLeft++U.x-k.x;k=b.container.scrollTop+U.y-k.y;var x=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),C=d.showShapePicker(q,k,x,mxUtils.bind(this,function(E){null!=E&&b.connectVertex(x,c,b.defaultEdgeLength,f,!0,!1,null,function(L){b.selectCellsForConnectVertex(L);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(E))},E)}),c,!0);null!=C&&(this.centerShapePicker(C,U,q,k,c),this.hoverIcons.shapePickerHoverDiv=C,mxUtils.setOpacity(C,30),mxEvent.addListener(C,+"mouseenter",function(){mxUtils.setOpacity(C,100)}),mxEvent.addListener(C,"mouseleave",function(){d.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(G,O){null!=B&&window.clearTimeout(B)}))}var P=!1;b.addMouseListener({mouseDown:mxUtils.bind(this,function(G,O){P=!1}),mouseMove:mxUtils.bind(this,function(G,O){null!=b.connectHandleClickState&&null!=b.connectionHandler&&null!=b.connectionHandler.shape&&(P=!0)}),mouseUp:mxUtils.bind(this,+function(G,O){G=b.connectHandleClickState;b.connectHandleClickState=null;if(null!=G&&!P){var U=O.getEvent();if(!b.isCloneEvent(U)&&!mxEvent.isShiftDown(U)){for(var c=mxConstants.DIRECTION_EAST,f=b.getCompositeParent(G.cell),k=b.getCellGeometry(f);null!=f&&b.model.isVertex(f)&&null!=k&&k.relative;)f=b.model.getParent(f),k=b.getCellGeometry(f);b.connectVertex(G.cell,c,b.defaultEdgeLength,U,null,!0,mxUtils.bind(this,function(q,x,C){O.consume();window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(O.getGraphX(),+O.getGraphY(),f,mxUtils.bind(this,function(E){C(E);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(E))}),c)}),30)}),mxUtils.bind(this,function(q){b.selectCellsForConnectVertex(q,U)}))}}P=!1})})};+EditorUi.prototype.getDoubleClickTerminalForEvent=function(b,d){var m=this.editor.graph;if(null!=b&&null!=d&&m.model.isEdge(d)){var p=m.view.getState(d);if(null!=p&&null!=p.absolutePoints&&2<=p.absolutePoints.length){b=mxUtils.convertPoint(m.container,mxEvent.getClientX(b),mxEvent.getClientY(b));for(var u=m.tolerance+mxConstants.HANDLE_SIZE,n=0;2>n;n++){var y=0==n;if(null==m.model.getTerminal(d,y)){var B=p.absolutePoints[y?0:p.absolutePoints.length-1];if(null!=B&&Math.abs(B.x-b.x)<=u&&Math.abs(B.y-+b.y)<=u)return{point:B.clone(),source:y}}}}}return null};+EditorUi.prototype.showShapePickerForEdgeTerminal=function(b,d,m){var p=this,u=this.editor.graph;this.showShapePicker(m.x,m.y,null,mxUtils.bind(this,function(n){if(null!=n){var y=n.geometry;null!=y&&(y.x=u.snap(Math.round(m.x/u.view.scale)-u.view.translate.x-y.width/2),y.y=u.snap(Math.round(m.y/u.view.scale)-u.view.translate.y-y.height/2));u.model.beginUpdate();try{u.addCell(n);u.model.isVertex(n)&&u.isAutoSizeCell(n)&&u.updateCellSize(n);u.model.setTerminal(b,n,d);var B=u.getCellGeometry(b);null!=+B&&null!=B.getTerminalPoint(d)&&(B=B.clone(),B.setTerminalPoint(null,d),u.model.setGeometry(b,B))}finally{u.model.endUpdate()}u.setSelectionCell(n);u.scrollCellToVisible(n);u.startEditing(n);null!=p.hoverIcons&&p.hoverIcons.update(u.view.getState(n))}}),null,!1,null,!1,!1,this.getCellsForShapePicker(null,!1,!1),{cell:b,source:d})};+EditorUi.prototype.centerShapePicker=function(b,d,m,p,u){if(u==mxConstants.DIRECTION_EAST||u==mxConstants.DIRECTION_WEST)b.style.width="40px";var n=b.getBoundingClientRect();u==mxConstants.DIRECTION_NORTH?(m-=n.width/2-10,p-=n.height+6):u==mxConstants.DIRECTION_SOUTH?(m-=n.width/2-10,p+=d.height+6):u==mxConstants.DIRECTION_WEST?(m-=n.width+6,p-=n.height/2-10):u==mxConstants.DIRECTION_EAST&&(m+=d.width+6,p-=n.height/2-10);b.style.left=m+"px";b.style.top=p+"px"};+EditorUi.prototype.showShapePicker=function(b,d,m,p,u,n,y,B,P,G,O){var U=null;this.editor.graph.freehand.isDrawing()||(B=B||null==m,G=null!=G?G:this.getCellsForShapePicker(m,n,B),U=this.createShapePicker(b,d,m,p,u,mxUtils.bind(this,function(){this.hideShapePicker()}),G,n,y,B,P,O),null!=U&&(null==this.hoverIcons||n||this.hoverIcons.reset(),b=this.editor.graph,b.popupMenuHandler.hideMenu(),b.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=p,this.shapePicker=U));return U};-EditorUi.prototype.createShapePicker=function(b,d,m,p,v,n,y,C,P,G,O,U){O=null!=O?O:!0;var c=this.editor.graph,f=null;P=null!=P?P:function(x){x=x[0];var B=0,E=0,L=x.geometry;null!=L&&(c.model.isEdge(x)&&(x=L.getTerminalPoint(!1),L=new mxRectangle(0,0,x.x,x.y)),B=L.width/2,E=L.height/2);return new mxPoint(c.snap(Math.round(b/c.view.scale)-c.view.translate.x-B),c.snap(Math.round(d/c.view.scale)-c.view.translate.y-E))};if(null!=y&&0<y.length){var k=this;c=this.editor.graph;f=document.createElement("div");v=-c.view.getState(m);var q=null==m||null!=v&&c.isTransparentState(v)?null:c.copyStyle(m);f.className="geShapePicker";f.setAttribute("title",mxResources.get("sidebarTooltip"));f.style.left=Math.round(b)+"px";f.style.top=Math.round(d)+"px";mxClient.IS_POINTER&&(f.style.touchAction="none");C||mxUtils.setPrefixedStyle(f.style,"transform","translate(-22px,-22px)");c.container.appendChild(f);v=mxUtils.bind(this,function(x){var B=document.createElement("a");f.appendChild(B);var E=x.shapePickerKeepStyle;delete x.shapePickerKeepStyle;+EditorUi.prototype.createShapePicker=function(b,d,m,p,u,n,y,B,P,G,O,U){O=null!=O?O:!0;var c=this.editor.graph,f=null;P=null!=P?P:function(x){x=x[0];var C=0,E=0,L=x.geometry;null!=L&&(c.model.isEdge(x)&&(x=L.getTerminalPoint(!1),L=new mxRectangle(0,0,x.x,x.y)),C=L.width/2,E=L.height/2);return new mxPoint(c.snap(Math.round(b/c.view.scale)-c.view.translate.x-C),c.snap(Math.round(d/c.view.scale)-c.view.translate.y-E))};if(null!=y&&0<y.length){var k=this;c=this.editor.graph;f=document.createElement("div");u=+c.view.getState(m);var q=null==m||null!=u&&c.isTransparentState(u)?null:c.copyStyle(m);f.className="geShapePicker";f.setAttribute("title",mxResources.get("sidebarTooltip"));f.style.left=Math.round(b)+"px";f.style.top=Math.round(d)+"px";mxClient.IS_POINTER&&(f.style.touchAction="none");B||mxUtils.setPrefixedStyle(f.style,"transform","translate(-22px,-22px)");c.container.appendChild(f);u=mxUtils.bind(this,function(x){var C=document.createElement("a");f.appendChild(C);var E=x.shapePickerKeepStyle;delete x.shapePickerKeepStyle;E||(null!=q&&"1"!=urlParams.sketch?this.sidebar.graph.pasteStyle(q,[x]):this.sidebar.graph.pasteCellStyles([x],c.currentVertexStyle,c.currentEdgeStyle,null,null,c.pasteStylesToText));E=x.geometry;c.model.isEdge(x)&&(E=E.getTerminalPoint(!1),E=new mxRectangle(0,0,E.x,E.y));null!=E&&(E=this.sidebar.createVertexTemplateFromCells([x],E.width,E.height,"",!0,!1,null,!0,mxUtils.bind(this,function(L){if(!mxEvent.isAltDown(L)||1!=c.getSelectionCount()){if(!mxEvent.isShiftDown(L)||null==m&&c.isSelectionEmpty()){var Q=c.cloneCell(x);if(null!=p)p(Q);else{var V=P([Q]);c.model.isEdge(Q)?Q.geometry.translate(V.x,V.y):(Q.geometry.x=V.x,Q.geometry.y=V.y);c.model.beginUpdate();try{c.addCell(Q),c.model.isVertex(Q)&&c.isAutoSizeCell(Q)&&c.updateCellSize(Q)}finally{c.model.endUpdate()}c.setSelectionCell(Q);c.scrollCellToVisible(Q);O&&c.startEditing(Q);null!=k.hoverIcons&&k.hoverIcons.update(c.view.getState(Q))}}else Q=c.getEditableCells(null!=m?[m]:c.getSelectionCells()),c.updateShapes(x,Q);null!=n&&n(L);mxEvent.consume(L)}}),-25,25,null,null,m,U),E.style.display="flex",E.style.alignItems="center",E.style.justifyContent="center",B.appendChild(E))});for(G=0;G<(C?Math.min(y.length,4):y.length);G++)v(y[G]);y=f.offsetTop+f.clientHeight-(c.container.scrollTop+c.container.offsetHeight);0<y&&(f.style.top=Math.max(c.container.scrollTop+22,d-y)+"px");y=f.offsetLeft+f.clientWidth-(c.container.scrollLeft+c.container.offsetWidth);0<y&&(f.style.left=Math.max(c.container.scrollLeft+22,b-y)+"px")}return f};+25,25,null,null,m,U),E.style.display="flex",E.style.alignItems="center",E.style.justifyContent="center",C.appendChild(E))});for(G=0;G<(B?Math.min(y.length,4):y.length);G++)u(y[G]);y=f.offsetTop+f.clientHeight-(c.container.scrollTop+c.container.offsetHeight);0<y&&(f.style.top=Math.max(c.container.scrollTop+22,d-y)+"px");y=f.offsetLeft+f.clientWidth-(c.container.scrollLeft+c.container.offsetWidth);0<y&&(f.style.left=Math.max(c.container.scrollLeft+22,b-y)+"px")}return f};EditorUi.prototype.defaultShapePickerEntries=null;-EditorUi.prototype.getCellsForShapePicker=function(b,d,m){var p=this.editor.graph,v=mxUtils.bind(this,function(U,c,f,k){return p.createVertex(null,null,k||"",0,0,c||120,f||60,U,!1)});d=mxUtils.bind(this,function(U,c,f){U=new mxCell(f||"",new mxGeometry(0,0,p.defaultEdgeLength+20,0),U);U.geometry.setTerminalPoint(new mxPoint(0,0),!0);U.geometry.setTerminalPoint(new mxPoint(U.geometry.width,null!=c?c:0),!1);U.geometry.points=null!=c?[new mxPoint(U.geometry.width/2,c)]:[];U.geometry.relative=!0;U.edge=-!0;return U});if(null!=b)try{b=p.cloneCell(b),p.model.isVertex(b)&&null!=b.geometry&&(b.geometry.x=0,b.geometry.y=0)}catch(U){b=null}if(null!=this.defaultShapePickerEntries){for(var n=[],y=[],C=function(U){if(null!=U&&"object"===typeof U){var c=mxUtils.createXmlDocument().createElement("UserObject"),f;for(f in U)U.hasOwnProperty(f)&&c.setAttribute(f,U[f]);null==c.getAttribute("label")&&c.setAttribute("label","");return c}return U},P=0;P<this.defaultShapePickerEntries.length;P++){var G=this.defaultShapePickerEntries[P];-if(null!=G&&null!=G.style){var O=C(G.value);G.edge?y.push(d(G.style,G.y,O)):(O=v(G.style,G.width,G.height,O),G.keepStyle&&(O.shapePickerKeepStyle=!0),n.push(O))}}null!=b&&(n[0]=b);b=n;m&&(b=b.concat(y));return b}null==b&&(b=v(p.appendFontSize(Editor.defaultTextStyle,p.vertexFontSize),60,30,"Text"));b=[b,v("whiteSpace=wrap;html=1;"),v("ellipse;whiteSpace=wrap;html=1;",80,80),v("rhombus;whiteSpace=wrap;html=1;",80,80),v("rounded=1;whiteSpace=wrap;html=1;"),v("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;"),-v("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,60),v("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80),v("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80),v("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),v("triangle;whiteSpace=wrap;html=1;",60,80),v("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),v("shape=tape;whiteSpace=wrap;html=1;",120,100),v("ellipse;shape=cloud;whiteSpace=wrap;html=1;",-120,80),v("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",80,60),v("shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",20,20)];m&&(b=b.concat([d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;"),+EditorUi.prototype.getCellsForShapePicker=function(b,d,m){var p=this.editor.graph,u=mxUtils.bind(this,function(U,c,f,k){return p.createVertex(null,null,k||"",0,0,c||120,f||60,U,!1)});d=mxUtils.bind(this,function(U,c,f){U=new mxCell(f||"",new mxGeometry(0,0,p.defaultEdgeLength+20,0),U);U.geometry.setTerminalPoint(new mxPoint(0,0),!0);U.geometry.setTerminalPoint(new mxPoint(U.geometry.width,null!=c?c:0),!1);U.geometry.points=null!=c?[new mxPoint(U.geometry.width/2,c)]:[];U.geometry.relative=!0;U.edge=+!0;return U});if(null!=b)try{b=p.cloneCell(b),p.model.isVertex(b)&&null!=b.geometry&&(b.geometry.x=0,b.geometry.y=0)}catch(U){b=null}if(null!=this.defaultShapePickerEntries){for(var n=[],y=[],B=function(U){if(null!=U&&"object"===typeof U){var c=mxUtils.createXmlDocument().createElement("UserObject"),f;for(f in U)U.hasOwnProperty(f)&&c.setAttribute(f,U[f]);null==c.getAttribute("label")&&c.setAttribute("label","");return c}return U},P=0;P<this.defaultShapePickerEntries.length;P++){var G=this.defaultShapePickerEntries[P];+if(null!=G&&null!=G.style){var O=B(G.value);G.edge?y.push(d(G.style,G.y,O)):(O=u(G.style,G.width,G.height,O),G.keepStyle&&(O.shapePickerKeepStyle=!0),n.push(O))}}null!=b&&(n[0]=b);b=n;m&&(b=b.concat(y));return b}null==b&&(b=u(p.appendFontSize(Editor.defaultTextStyle,p.vertexFontSize),60,30,"Text"));b=[b,u("whiteSpace=wrap;html=1;"),u("ellipse;whiteSpace=wrap;html=1;",80,80),u("rhombus;whiteSpace=wrap;html=1;",80,80),u("rounded=1;whiteSpace=wrap;html=1;"),u("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;"),+u("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,60),u("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80),u("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80),u("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),u("triangle;whiteSpace=wrap;html=1;",60,80),u("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),u("shape=tape;whiteSpace=wrap;html=1;",120,100),u("ellipse;shape=cloud;whiteSpace=wrap;html=1;",+120,80),u("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",80,60),u("shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",20,20)];m&&(b=b.concat([d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;"),d("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;",this.editor.graph.defaultEdgeLength/2)]));return b};EditorUi.prototype.isShapePickerVisible=function(b){return null!=this.shapePicker};EditorUi.prototype.hideShapePicker=function(b){null!=this.shapePicker&&(this.shapePicker.parentNode.removeChild(this.shapePicker),this.shapePicker=null,null!=this.hoverIcons&&null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null),b||null==this.shapePickerCallback||this.shapePickerCallback(),this.shapePickerCallback=null)};EditorUi.prototype.isSpaceDown=function(){return this.spaceDown};EditorUi.prototype.isShiftDown=function(){return this.shiftDown};-EditorUi.prototype.onKeyDown=function(b){var d=this.editor.graph;if(9==b.which&&d.isEnabled()&&!mxEvent.isControlDown(b)){if(d.isEditing())if(mxEvent.isAltDown(b))d.stopEditing(!1);else try{var m=d.cellEditor.isContentEditing()&&d.cellEditor.isTextSelected();if(window.getSelection&&d.cellEditor.isContentEditing()&&!m){var p=window.getSelection(),v=0<p.rangeCount?p.getRangeAt(0).commonAncestorContainer:null;m=null!=v&&("LI"==v.nodeName||null!=v.parentNode&&"LI"==v.parentNode.nodeName)}m?document.execCommand(mxEvent.isShiftDown(b)?+EditorUi.prototype.onKeyDown=function(b){var d=this.editor.graph;if(9==b.which&&d.isEnabled()&&!mxEvent.isControlDown(b)){if(d.isEditing())if(mxEvent.isAltDown(b))d.stopEditing(!1);else try{var m=d.cellEditor.isContentEditing()&&d.cellEditor.isTextSelected();if(window.getSelection&&d.cellEditor.isContentEditing()&&!m){var p=window.getSelection(),u=0<p.rangeCount?p.getRangeAt(0).commonAncestorContainer:null;m=null!=u&&("LI"==u.nodeName||null!=u.parentNode&&"LI"==u.parentNode.nodeName)}m?document.execCommand(mxEvent.isShiftDown(b)?"outdent":"indent",!1,null):mxEvent.isShiftDown(b)?d.stopEditing(!1):d.cellEditor.insertTab(d.cellEditor.isContentEditing()?null:4)}catch(n){}else mxEvent.isAltDown(b)?d.selectParentCell():d.selectCell(!mxEvent.isShiftDown(b));mxEvent.consume(b)}};EditorUi.prototype.onKeyPress=function(b){var d=this.editor.graph;null!=this.typingShim&&mxEvent.getSource(b)===this.typingShim||!this.isImmediateEditingEvent(b)||d.isEditing()||d.isSelectionEmpty()||mxEvent.isAltDown(b)||mxEvent.isControlDown(b)||mxEvent.isMetaDown(b)||(null==b.key||1!==b.key.length)&&229!==b.keyCode||null!=this.keyHandler&&null!=this.keyHandler.getFunction(b)||(d.escape(),d.cellEditor.editByTyping=!0,d.startEditing())};EditorUi.prototype.installTypingShim=function(){var b=this.editor.graph,d=document.createElement("textarea");d.setAttribute("autocomplete","off");d.setAttribute("autocorrect","off");d.setAttribute("autocapitalize","off");d.setAttribute("spellcheck","false");(mxClient.IS_ANDROID||mxClient.IS_IOS||"ontouchstart"in document.documentElement&&1<navigator.maxTouchPoints)&&d.setAttribute("inputmode","none");d.tabIndex=-1;d.className="mxTypingShim";d.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";this.typingShim=d;var m=!1,p=mxUtils.bind(this,function(){if(!m&&0<d.value.length){var n=d.value;d.value="";this.hideTypingShim();b.escape();b.cellEditor.editByTyping=!0;b.startEditing(null,n)}});mxEvent.addListener(d,"compositionstart",function(){m=!0});mxEvent.addListener(d,"compositionend",function(){m=!1;p()});mxEvent.addListener(d,"input",function(){p()});mxEvent.addListener(d,"keydown",mxUtils.bind(this,function(n){229!==n.keyCode&&(mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||(null==n.key||1!==n.key.length||mxEvent.isAltDown(n)?n.preventDefault():null!=this.keyHandler&&null!=this.keyHandler.getFunction(n)&&n.preventDefault()))}));b.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateTypingShim();window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));b.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(){this.hideTypingShim()}));b.addListener(mxEvent.EDITING_STOPPED,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,-function(){this.updateTypingShim()}),0)}));if(null==b.container.tabIndex||0>b.container.tabIndex)b.container.tabIndex=-1;mxEvent.addListener(b.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var v=b.cellEditor.focusContainer;b.cellEditor.focusContainer=mxUtils.bind(this,function(){b.isSelectionEmpty()||b.isEditing()?v.apply(b.cellEditor):this.updateTypingShim()})};+function(){this.updateTypingShim()}),0)}));if(null==b.container.tabIndex||0>b.container.tabIndex)b.container.tabIndex=-1;mxEvent.addListener(b.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var u=b.cellEditor.focusContainer;b.cellEditor.focusContainer=mxUtils.bind(this,function(){b.isSelectionEmpty()||b.isEditing()?u.apply(b.cellEditor):this.updateTypingShim()})};EditorUi.prototype.updateTypingShim=function(){var b=this.editor.graph;b.isEditing()||b.isSelectionEmpty()||!b.isEnabled()||b.isCellLocked(b.getSelectionCell())?this.hideTypingShim():this.showTypingShim()};EditorUi.prototype.showTypingShim=function(){var b=this.editor.graph,d=this.typingShim;if(null!=d&&!b.isEditing()){var m=b.getSelectionCell();m=b.getView().getState(m);if(null!=m){var p=document.activeElement;if(null==p||p===document.body||p===b.container||b.container.contains(p))if(d.style.left=Math.round(m.x)+"px",d.style.top=Math.round(m.y)+"px",d.parentNode!==b.container&&b.container.appendChild(d),d.value="",null!=this.clipboardElt&&null!=this.clipboardElt.parentNode){d=b.container.scrollLeft;-m=b.container.scrollTop;this.clipboardElt.focus({preventScroll:!0});try{var v=document.createRange();v.selectNodeContents(this.clipboardElt);var n=window.getSelection();null!=n&&(n.removeAllRanges(),n.addRange(v))}catch(y){}b.container.scrollLeft=d;b.container.scrollTop=m}else null!=p&&"true"===p.contentEditable||d.focus({preventScroll:!0})}}};EditorUi.prototype.hideTypingShim=function(){var b=this.typingShim;null!=b&&null!=b.parentNode&&b.parentNode.removeChild(b)};-EditorUi.prototype.isImmediateEditingEvent=function(b){return!0};EditorUi.prototype.updateCssForMarker=function(b,d,m,p,v){m=this.getImageForMarker(p,v,m);b.innerHTML="";null==m?b.innerHTML=mxUtils.htmlEntities(mxResources.get("none")):(p=document.createElement("img"),p.setAttribute("src",m),"end"==d&&mxUtils.setPrefixedStyle(p.style,"transform","scaleX(-1)"),b.appendChild(p))};+m=b.container.scrollTop;this.clipboardElt.focus({preventScroll:!0});try{var u=document.createRange();u.selectNodeContents(this.clipboardElt);var n=window.getSelection();null!=n&&(n.removeAllRanges(),n.addRange(u))}catch(y){}b.container.scrollLeft=d;b.container.scrollTop=m}else null!=p&&"true"===p.contentEditable||d.focus({preventScroll:!0})}}};EditorUi.prototype.hideTypingShim=function(){var b=this.typingShim;null!=b&&null!=b.parentNode&&b.parentNode.removeChild(b)};+EditorUi.prototype.isImmediateEditingEvent=function(b){return!0};EditorUi.prototype.updateCssForMarker=function(b,d,m,p,u){m=this.getImageForMarker(p,u,m);b.innerHTML="";null==m?b.innerHTML=mxUtils.htmlEntities(mxResources.get("none")):(p=document.createElement("img"),p.setAttribute("src",m),"end"==d&&mxUtils.setPrefixedStyle(p.style,"transform","scaleX(-1)"),b.appendChild(p))};EditorUi.prototype.getImageForMarker=function(b,d,m){return"flexArrow"==m?null!=b&&b!=mxConstants.NONE?Format.blockMarkerImage.src:null:b==mxConstants.ARROW_CLASSIC?"1"!=d?Format.classicMarkerImage.src:Format.classicFilledMarkerImage.src:b==mxConstants.ARROW_CLASSIC_THIN?"1"!=d?Format.classicThinMarkerImage.src:Format.openThinFilledMarkerImage.src:b==mxConstants.ARROW_OPEN?Format.openFilledMarkerImage.src:b==mxConstants.ARROW_OPEN_THIN?Format.openThinFilledMarkerImage.src:b==mxConstants.ARROW_BLOCK?"1"!=d?Format.blockMarkerImage.src:Format.blockFilledMarkerImage.src:b==mxConstants.ARROW_BLOCK_THIN?"1"!=d?Format.blockThinMarkerImage.src:Format.blockThinFilledMarkerImage.src:b==mxConstants.ARROW_OVAL?"1"!=d?Format.ovalMarkerImage.src:Format.ovalFilledMarkerImage.src:b==mxConstants.ARROW_DIAMOND?"1"!=d?Format.diamondMarkerImage.src:Format.diamondFilledMarkerImage.src:b==mxConstants.ARROW_DIAMOND_THIN?"1"!=d?Format.diamondThinMarkerImage.src:Format.diamondThinFilledMarkerImage.src:"doubleBlock"==b?"1"!=d?Format.doubleBlockMarkerImage.src:Format.doubleBlockFilledMarkerImage.src:"box"==b?Format.boxMarkerImage.src:"halfCircle"==b?Format.halfCircleMarkerImage.src:"openAsync"==b?Format.openAsyncFilledMarkerImage.src:"async"==b?"1"!=d?Format.asyncMarkerImage.src:Format.asyncFilledMarkerImage.src:"dash"==b?Format.dashMarkerImage.src:"baseDash"==b?Format.baseDashMarkerImage.src:"cross"==b?Format.crossMarkerImage.src:"circle"==b?Format.circleMarkerImage.src:"circlePlus"==b?Format.circlePlusMarkerImage.src:@@ -2242,49 +2242,49 @@ EditorUi.prototype.getImageForEdgeShape=function(b){var d=Format.connectionImageEditorUi.prototype.getImageForEdgeStyle=function(b){if("1"==mxUtils.getValue(b,"libavoidRouting",null))return Format.libavoidImage.src;var d=Format.orthogonalImage.src,m=mxUtils.getValue(b,mxConstants.STYLE_EDGE,null);"1"==mxUtils.getValue(b,mxConstants.STYLE_NOEDGESTYLE,null)&&(m=null);"orthogonalEdgeStyle"==m&&"1"==mxUtils.getValue(b,mxConstants.STYLE_CURVED,null)?d=Format.curvedImage.src:"straight"==m||"none"==m||null==m?d=Format.straightImage.src:"entityRelationEdgeStyle"==m?d=Format.entityImage.src:"elbowEdgeStyle"==m?d="vertical"==mxUtils.getValue(b,mxConstants.STYLE_ELBOW,null)?Format.verticalElbowImage.src:Format.horizontalElbowImage.src:"isometricEdgeStyle"==m&&(d="vertical"==mxUtils.getValue(b,mxConstants.STYLE_ELBOW,null)?Format.verticalIsometricImage.src:Format.horizontalIsometricImage.src);return d};EditorUi.prototype.createMenus=function(){return null};EditorUi.prototype.updatePasteActionStates=function(){var b=this.editor.graph,d=this.actions.get("paste"),m=this.actions.get("pasteHere");d.setEnabled(this.editor.graph.cellEditor.isContentEditing()||(null!=navigator.clipboard||!mxClipboard.isEmpty())&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()));m.setEnabled(d.isEnabled())};-EditorUi.prototype.initClipboard=function(){var b=this,d=mxClipboard.cut;mxClipboard.cut=function(n){n.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):d.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(n){var y=null;if(n.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{y=y||n.getSelectionCells();y=n.getExportableCells(n.model.getTopmostCells(y));for(var C={},P=n.createCellLookup(y),G=n.cloneCells(y,null,C),O=new mxGraphModel,U=O.getChildAt(O.getRoot(),-0),c=0;c<G.length;c++){O.add(U,G[c]);var f=n.view.getState(y[c]);if(null!=f){var k=n.getCellGeometry(G[c]);null!=k&&k.relative&&!O.isEdge(y[c])&&null==P[mxObjectIdentity.get(O.getParent(y[c]))]&&(k.offset=null,k.relative=!1,k.x=f.x/f.view.scale-f.view.translate.x,k.y=f.y/f.view.scale-f.view.translate.y)}}n.updateCustomLinks(n.createCellMapping(C,P),G);mxClipboard.insertCount=1;mxClipboard.setCells(G)}b.updatePasteActionStates();return y};var m=mxClipboard.paste;mxClipboard.paste=function(n){var y=-null;n.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):y=m.apply(this,arguments);b.updatePasteActionStates();return y};var p=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){p.apply(this,arguments);b.updatePasteActionStates()};var v=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(n,y){v.apply(this,arguments);b.updatePasteActionStates()};this.updatePasteActionStates()};+EditorUi.prototype.initClipboard=function(){var b=this,d=mxClipboard.cut;mxClipboard.cut=function(n){n.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):d.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(n){var y=null;if(n.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{y=y||n.getSelectionCells();y=n.getExportableCells(n.model.getTopmostCells(y));for(var B={},P=n.createCellLookup(y),G=n.cloneCells(y,null,B),O=new mxGraphModel,U=O.getChildAt(O.getRoot(),+0),c=0;c<G.length;c++){O.add(U,G[c]);var f=n.view.getState(y[c]);if(null!=f){var k=n.getCellGeometry(G[c]);null!=k&&k.relative&&!O.isEdge(y[c])&&null==P[mxObjectIdentity.get(O.getParent(y[c]))]&&(k.offset=null,k.relative=!1,k.x=f.x/f.view.scale-f.view.translate.x,k.y=f.y/f.view.scale-f.view.translate.y)}}n.updateCustomLinks(n.createCellMapping(B,P),G);mxClipboard.insertCount=1;mxClipboard.setCells(G)}b.updatePasteActionStates();return y};var m=mxClipboard.paste;mxClipboard.paste=function(n){var y=+null;n.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):y=m.apply(this,arguments);b.updatePasteActionStates();return y};var p=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){p.apply(this,arguments);b.updatePasteActionStates()};var u=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(n,y){u.apply(this,arguments);b.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20;EditorUi.prototype.wheelZoomDelay=500;EditorUi.prototype.buttonZoomDelay=600;EditorUi.prototype.initCanvas=function(){var b=this.editor.graph;b.timerAutoScroll=!0;b.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((b.container.offsetWidth-34)/b.view.scale)),Math.max(0,Math.round((b.container.offsetHeight-34)/b.view.scale)))};b.view.getBackgroundPageBounds=function(){var Y=this.graph.getPageLayout(),Z=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+Y.x*Z.width),this.scale*(this.translate.y+Y.y*Z.height),this.scale*Y.width*Z.width,-this.scale*Y.height*Z.height)};b.getPreferredPageSize=function(Y,Z,ia){Y=this.getPageLayout();Z=this.getPageSize();return new mxRectangle(0,0,Y.width*Z.width,Y.height*Z.height)};var d=null,m=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(Y,Z,ia,ka){if(null!=b.container&&!b.isViewer()){ia=null!=ia?ia:0;ka=null!=ka?ka:0;var X=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),ja=mxUtils.hasScrollbars(b.container),na=b.view.translate,la=b.view.scale,-va=mxRectangle.fromRectangle(X);va.x=va.x/la-na.x;va.y=va.y/la-na.y;va.width/=la;va.height/=la;na=b.container.scrollTop;var za=b.container.scrollLeft,sa=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)sa+=3;var wa=b.container.offsetWidth-sa;sa=b.container.offsetHeight-sa;Y=Y?Math.max(.3,Math.min(Z||1,wa/va.width)):la;Z=(wa-Y*va.width)/2/Y;var Ca=0==this.lightboxVerticalDivider?0:(sa-Y*va.height)/this.lightboxVerticalDivider/Y;ja&&(Z=Math.max(Z,0),Ca=Math.max(Ca,-0));if(ja||X.width<wa||X.height<sa)b.view.scaleAndTranslate(Y,Math.floor(Z-va.x),Math.floor(Ca-va.y)),b.container.scrollTop=na*Y/la,b.container.scrollLeft=za*Y/la;else if(0!=ia||0!=ka)X=b.view.translate,b.view.setTranslate(Math.floor(X.x+ia/la),Math.floor(X.y+ka/la))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var p=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",p);this.destroyFunctions.push(function(){mxEvent.removeListener(window,-"resize",p)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(Y){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(Y){b.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var v=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position=+this.scale*Y.height*Z.height)};b.getPreferredPageSize=function(Y,Z,ia){Y=this.getPageLayout();Z=this.getPageSize();return new mxRectangle(0,0,Y.width*Z.width,Y.height*Z.height)};var d=null,m=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(Y,Z,ia,ja){if(null!=b.container&&!b.isViewer()){ia=null!=ia?ia:0;ja=null!=ja?ja:0;var X=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),ka=mxUtils.hasScrollbars(b.container),na=b.view.translate,la=b.view.scale,+ua=mxRectangle.fromRectangle(X);ua.x=ua.x/la-na.x;ua.y=ua.y/la-na.y;ua.width/=la;ua.height/=la;na=b.container.scrollTop;var za=b.container.scrollLeft,sa=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)sa+=3;var wa=b.container.offsetWidth-sa;sa=b.container.offsetHeight-sa;Y=Y?Math.max(.3,Math.min(Z||1,wa/ua.width)):la;Z=(wa-Y*ua.width)/2/Y;var Ca=0==this.lightboxVerticalDivider?0:(sa-Y*ua.height)/this.lightboxVerticalDivider/Y;ka&&(Z=Math.max(Z,0),Ca=Math.max(Ca,+0));if(ka||X.width<wa||X.height<sa)b.view.scaleAndTranslate(Y,Math.floor(Z-ua.x),Math.floor(Ca-ua.y)),b.container.scrollTop=na*Y/la,b.container.scrollLeft=za*Y/la;else if(0!=ia||0!=ja)X=b.view.translate,b.view.setTranslate(Math.floor(X.x+ia/la),Math.floor(X.y+ja/la))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var p=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",p);this.destroyFunctions.push(function(){mxEvent.removeListener(window,+"resize",p)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(Y){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(Y){b.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var u=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left=b.isViewer()?"0":"50%";this.chromelessToolbar.style.backgroundColor="#000000";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var n=-mxUtils.bind(this,function(){var Y=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=Y?parseInt(Y["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",n);n();var y=0;n=mxUtils.bind(this,function(Y,Z,ia){y++;var ka=document.createElement("span");ka.style.paddingLeft="8px";ka.style.paddingRight="8px";ka.style.cursor="pointer";mxEvent.addListener(ka,-"click",Y);null!=ia&&ka.setAttribute("title",ia);Y=document.createElement("img");Y.setAttribute("border","0");Y.setAttribute("src",Z);Y.style.width="36px";Y.style.filter="invert(100%)";ka.appendChild(Y);this.chromelessToolbar.appendChild(ka);return ka});if(null!=v.backBtn){var C=Graph.sanitizeLink(v.backBtn.url);null!=C&&n(mxUtils.bind(this,function(Y){window.location.href=C;mxEvent.consume(Y)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var P=n(mxUtils.bind(this,+mxUtils.bind(this,function(){var Y=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=Y?parseInt(Y["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",n);n();var y=0;n=mxUtils.bind(this,function(Y,Z,ia){y++;var ja=document.createElement("span");ja.style.paddingLeft="8px";ja.style.paddingRight="8px";ja.style.cursor="pointer";mxEvent.addListener(ja,+"click",Y);null!=ia&&ja.setAttribute("title",ia);Y=document.createElement("img");Y.setAttribute("border","0");Y.setAttribute("src",Z);Y.style.width="36px";Y.style.filter="invert(100%)";ja.appendChild(Y);this.chromelessToolbar.appendChild(ja);return ja});if(null!=u.backBtn){var B=Graph.sanitizeLink(u.backBtn.url);null!=B&&n(mxUtils.bind(this,function(Y){window.location.href=B;mxEvent.consume(Y)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var P=n(mxUtils.bind(this,function(Y){this.actions.get("previousPage").funct();mxEvent.consume(Y)}),Editor.chevronLeftImage,mxResources.get("previousPage")),G=document.createElement("div");G.style.fontFamily=Editor.defaultHtmlFont;G.style.display="inline-block";G.style.verticalAlign="top";G.style.fontWeight="bold";G.style.marginTop="8px";G.style.fontSize="14px";G.style.cursor="default";G.style.color="#ffffff";this.chromelessToolbar.appendChild(G);var O=n(mxUtils.bind(this,function(Y){this.actions.get("nextPage").funct();mxEvent.consume(Y)}),Editor.chevronRightImage,mxResources.get("nextPage")),U=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){G.innerText="";var Y=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(G,Y+1+" / "+this.pages.length);G.setAttribute("title",mxResources.get("currentPage")+": "+this.currentPage.getName());P.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(Y-1,this.pages.length)].getName());O.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(Y+1,this.pages.length)].getName())}});P.style.paddingLeft="0px";P.style.paddingRight="4px";O.style.paddingLeft="4px";O.style.paddingRight="0px";var c=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(O.style.display="",P.style.display="",G.style.display="inline-block"):(O.style.display="none",P.style.display="none",G.style.display="none");U()});if(null!=this.menus){var f=this.menus.get("pages");null!=f&&mxEvent.addListener(G,"click",mxUtils.bind(this,function(Y){var Z=new mxPopupMenu(f.funct);Z.smartSeparators=!0;Z.showDisabled=!0;Z.autoExpand=!0;Z.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(Z,arguments);Z.destroy()});var ia=mxUtils.getOffset(G);Z.popup(ia.x,ia.y+G.offsetHeight,null,Y);mxEvent.addListener(Z.div,"mouseleave",mxUtils.bind(this,function(){Z.hideMenu()}))}))}this.editor.addListener("resetGraphView",c);this.editor.addListener("pageSelected",U)}n(mxUtils.bind(this,function(Y){this.actions.get("zoomOut").funct();mxEvent.consume(Y)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");n(mxUtils.bind(this,function(Y){this.actions.get("zoomIn").funct();mxEvent.consume(Y)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");n(mxUtils.bind(this,function(Y){this.actions.get("smartFit").funct();mxEvent.consume(Y)}),Editor.zoomFitImage,mxResources.get("fit"));var k=null,q=null,x=mxUtils.bind(this,function(Y){null!=k&&(window.clearTimeout(k),k=null);null!=q&&(window.clearTimeout(q),-q=null);k=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);k=null;q=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";q=null}),600)}),Y||200)}),B=mxUtils.bind(this,function(Y){null!=k&&(window.clearTimeout(k),k=null);null!=q&&(window.clearTimeout(q),q=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,Y||30)});if("1"==urlParams.layers){this.layersDialog=null;var E=n(mxUtils.bind(this,+q=null);k=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);k=null;q=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";q=null}),600)}),Y||200)}),C=mxUtils.bind(this,function(Y){null!=k&&(window.clearTimeout(k),k=null);null!=q&&(window.clearTimeout(q),q=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,Y||30)});if("1"==urlParams.layers){this.layersDialog=null;var E=n(mxUtils.bind(this,function(Y){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=b.createLayersDialog(mxUtils.bind(this,function(){this.chromelessResize&&this.chromelessResize()}),!0);mxEvent.addListener(this.layersDialog,"mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog);this.layersDialog=null}));var Z=E.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius","5px");this.layersDialog.style.position="fixed";this.layersDialog.style.fontFamily=Editor.defaultHtmlFont;this.layersDialog.style.width="160px";this.layersDialog.style.padding="4px 2px 4px 2px";this.layersDialog.style.left=Z.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";this.layersDialog.style.backgroundColor="#000000";this.layersDialog.style.color="#ffffff";mxUtils.setOpacity(this.layersDialog,80);Z=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=Z.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(Y)}),Editor.layersImage,mxResources.get("layers")),L=b.getModel();L.addListener(mxEvent.CHANGE,function(){E.style.display=1<L.getChildCount(L.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(n);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||n(mxUtils.bind(this,function(Y){if(null!=this.editor.editButtonFunc)this.editor.editButtonFunc();else if("_blank"==this.editor.editButtonLink){var Z=null!=this.currentPage?this.currentPage.getId():null;this.editor.editAsNew(this.getEditBlankXml(),null,null,Z)}else b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(Y)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(c=0;c<this.lightboxToolbarActions.length;c++){var Q=this.lightboxToolbarActions[c];Q.elem=n(Q.fn,Q.icon,Q.tooltip)}if(null!=-v.refreshBtn){var V=null==v.refreshBtn.url?null:Graph.sanitizeLink(v.refreshBtn.url);n(mxUtils.bind(this,function(Y){null!=V?window.location.href=V:window.location.reload();mxEvent.consume(Y)}),Editor.refreshImage,mxResources.get("refresh",null,"Refresh"))}null!=v.fullscreenBtn&&window.self!==window.top&&n(mxUtils.bind(this,function(Y){v.fullscreenBtn.url?b.openLink(v.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(Y)}),Editor.fullscreenImage,mxResources.get("openInNewWindow",-null,"Open in New Window"));!v.noCloseBtn&&(v.closeBtn&&window.self===window.top||b.lightbox&&("1"==urlParams.close||this.container!=document.body))&&n(mxUtils.bind(this,function(Y){"1"==urlParams.close||v.closeBtn?window.close():(this.destroy(),mxEvent.consume(Y))}),Editor.closeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";b.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");b.container.appendChild(this.chromelessToolbar);-mxEvent.addListener(b.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(Y){mxEvent.isTouchEvent(Y)||(mxEvent.isShiftDown(Y)||B(30),x())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(Y){mxEvent.consume(Y)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(Y){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(Y)?x():B(100)}));mxEvent.addListener(this.chromelessToolbar,-"mousemove",mxUtils.bind(this,function(Y){mxEvent.isShiftDown(Y)?x():B(100);mxEvent.consume(Y)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(Y){mxEvent.isTouchEvent(Y)||B(30)}));var K=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(Y,Z){this.startX=Z.getGraphX();this.startY=Z.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(Y,Z){},mouseUp:function(Y,-Z){mxEvent.isTouchEvent(Z.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<K&&Math.abs(this.scrollTop-b.container.scrollTop)<K&&Math.abs(this.startX-Z.getGraphX())<K&&Math.abs(this.startY-Z.getGraphY())<K&&(0<parseFloat(m.chromelessToolbar.style.opacity||0)?x():B(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var fa=b.view.validate,aa=new mxPoint,da=!1,ba=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=+u.refreshBtn){var V=null==u.refreshBtn.url?null:Graph.sanitizeLink(u.refreshBtn.url);n(mxUtils.bind(this,function(Y){null!=V?window.location.href=V:window.location.reload();mxEvent.consume(Y)}),Editor.refreshImage,mxResources.get("refresh",null,"Refresh"))}null!=u.fullscreenBtn&&window.self!==window.top&&n(mxUtils.bind(this,function(Y){u.fullscreenBtn.url?b.openLink(u.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(Y)}),Editor.fullscreenImage,mxResources.get("openInNewWindow",+null,"Open in New Window"));!u.noCloseBtn&&(u.closeBtn&&window.self===window.top||b.lightbox&&("1"==urlParams.close||this.container!=document.body))&&n(mxUtils.bind(this,function(Y){"1"==urlParams.close||u.closeBtn?window.close():(this.destroy(),mxEvent.consume(Y))}),Editor.closeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";b.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");b.container.appendChild(this.chromelessToolbar);+mxEvent.addListener(b.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(Y){mxEvent.isTouchEvent(Y)||(mxEvent.isShiftDown(Y)||C(30),x())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(Y){mxEvent.consume(Y)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(Y){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(Y)?x():C(100)}));mxEvent.addListener(this.chromelessToolbar,+"mousemove",mxUtils.bind(this,function(Y){mxEvent.isShiftDown(Y)?x():C(100);mxEvent.consume(Y)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(Y){mxEvent.isTouchEvent(Y)||C(30)}));var K=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(Y,Z){this.startX=Z.getGraphX();this.startY=Z.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(Y,Z){},mouseUp:function(Y,+Z){mxEvent.isTouchEvent(Z.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<K&&Math.abs(this.scrollTop-b.container.scrollTop)<K&&Math.abs(this.startX-Z.getGraphX())<K&&Math.abs(this.startY-Z.getGraphY())<K&&(0<parseFloat(m.chromelessToolbar.style.opacity||0)?x():C(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var fa=b.view.validate,aa=new mxPoint,da=!1,ba=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=m.currentPage&&ba!=m.currentPage){ba=m.currentPage;da=!0;var Y=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,!0);null==Y&&(Y=new mxRectangle(b.view.translate.x*b.view.scale,b.view.translate.y*b.view.scale));Y=b.getPageLayout(Y,aa,1);var Z=b.getDefaultTranslate(Y);this.x0=Y.x;this.y0=Y.y;if(Z.x!=this.translate.x||Z.y!=this.translate.y)this.invalidate(),this.translate.x=Z.x,this.translate.y=Z.y}Z=b.getPagePadding();var ia=b.getPageSize();Y=Z.x-(this.x0||0)*ia.width;Z=Z.y-(this.y0||0)*ia.height;-if(this.translate.x!=Y||this.translate.y!=Z)this.invalidate(),this.translate.x=Y,this.translate.y=Z}fa.apply(this,arguments)};if(!b.isViewer()){var ha=b.sizeDidChange;b.sizeDidChange=function(){var Y=da;da=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var Z=this.getPageLayout(),ia=this.getDefaultTranslate(Z),ka=this.view.translate.x,X=this.view.translate.y;if(ia.x!=ka||ia.y!=X){this.view.x0=Z.x;this.view.y0=Z.y;this.autoTranslate=-!0;this.view.setTranslate(ia.x,ia.y);this.autoTranslate=!1;Y||(this.container.scrollLeft+=Math.round((ia.x-ka)*this.view.scale),this.container.scrollTop+=Math.round((ia.y-X)*this.view.scale));return}}ha.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var qa=b.view.getBackgroundPane(),ra=b.view.getDrawPane();b.cumulativeZoomFactor=1;var l=null,t=null,H=null,J=null,R=null,T=function(Y){null!=l&&window.clearTimeout(l);0<=Y&&window.setTimeout(function(){if(!b.isMouseDown||+if(this.translate.x!=Y||this.translate.y!=Z)this.invalidate(),this.translate.x=Y,this.translate.y=Z}fa.apply(this,arguments)};if(!b.isViewer()){var ha=b.sizeDidChange;b.sizeDidChange=function(){var Y=da;da=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var Z=this.getPageLayout(),ia=this.getDefaultTranslate(Z),ja=this.view.translate.x,X=this.view.translate.y;if(ia.x!=ja||ia.y!=X){this.view.x0=Z.x;this.view.y0=Z.y;this.autoTranslate=+!0;this.view.setTranslate(ia.x,ia.y);this.autoTranslate=!1;Y||(this.container.scrollLeft+=Math.round((ia.x-ja)*this.view.scale),this.container.scrollTop+=Math.round((ia.y-X)*this.view.scale));return}}ha.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var qa=b.view.getBackgroundPane(),ra=b.view.getDrawPane();b.cumulativeZoomFactor=1;var l=null,t=null,H=null,J=null,R=null,T=function(Y){null!=l&&window.clearTimeout(l);0<=Y&&window.setTimeout(function(){if(!b.isMouseDown||J)l=window.setTimeout(mxUtils.bind(this,function(){if(b.isFastZoomEnabled()){null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node&&(mxUtils.setPrefixedStyle(b.view.backgroundPageShape.node.style,"transform-origin",null),mxUtils.setPrefixedStyle(b.view.backgroundPageShape.node.style,"transform",null));ra.style.transformOrigin="";qa.style.transformOrigin="";mxClient.IS_SF?(ra.style.transform="scale(1)",qa.style.transform="scale(1)",window.setTimeout(function(){ra.style.transform=-"";qa.style.transform=""},0)):(ra.style.transform="",qa.style.transform="");b.view.getDecoratorPane().style.opacity="";b.view.getOverlayPane().style.opacity="";for(var Z=b.container.querySelectorAll(".geHint"),ia=0;ia<Z.length;ia++)Z[ia].style.opacity=""}Z=new mxPoint(b.container.scrollLeft,b.container.scrollTop);var ka=mxUtils.getOffset(b.container),X=b.view.scale;ia=b.view.translate.x;var ja=b.view.translate.y,na=0,la=0;null!=t&&(na=b.container.offsetWidth/2-t.x+ka.x,la=b.container.offsetHeight/-2-t.y+ka.y);var va=null==d&&mxUtils.hasScrollbars(b.container);b.zoom(b.cumulativeZoomFactor,va?!1:null,b.isFastZoomEnabled()?20:null,va);var za=b.view.scale;za!=X&&(va?(X=za/X,na=null!=t?t.x-ka.x:b.container.clientWidth/2,ka=null!=t?t.y-ka.y:b.container.clientHeight/2,null!=H&&(na-=Z.x-H.x,ka-=Z.y-H.y),b.container.scrollLeft=Math.round(Z.x*X+na*(X-1)+(b.view.translate.x-ia)*za),b.container.scrollTop=Math.round(Z.y*X+ka*(X-1)+(b.view.translate.y-ja)*za)):(null!=H&&(na+=Z.x-H.x,la+=Z.y-H.y),null!=-d&&m.chromelessResize(!1,null,na*(b.cumulativeZoomFactor-1),la*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||0==na&&0==la||(b.container.scrollLeft-=na*(b.cumulativeZoomFactor-1),b.container.scrollTop-=la*(b.cumulativeZoomFactor-1))));null!=R&&ra.setAttribute("filter",R);b.fireEvent(new mxEventObject("zoomPreviewComplete"));b.cumulativeZoomFactor=1;R=J=t=H=l=null}),null!=Y?Y:b.isFastZoomEnabled()?m.wheelZoomDelay:m.lazyZoomDelay)},0)};b.lazyZoom=function(Y,Z,ia,ka){ka=null!=ka?ka:-this.zoomFactor;(Z=Z||!b.scrollbars)&&(t=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+b.container.clientHeight/2));Y?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=ka,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:-(this.cumulativeZoomFactor/=ka,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale);this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,160))/this.view.scale;if(b.isFastZoomEnabled()){null==R&&""!=ra.getAttribute("filter")&&(R=ra.getAttribute("filter"),ra.removeAttribute("filter"));H=new mxPoint(b.container.scrollLeft,b.container.scrollTop);Y=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/-100*20)/(20*this.view.scale);ka=Z||null==t?b.container.scrollLeft+b.container.clientWidth/2:t.x+b.container.scrollLeft-b.container.offsetLeft;var X=Z||null==t?b.container.scrollTop+b.container.clientHeight/2:t.y+b.container.scrollTop-b.container.offsetTop;ra.style.transformOrigin=ka+"px "+X+"px";ra.style.transform="scale("+Y+")";qa.style.transformOrigin=ka+"px "+X+"px";qa.style.transform="scale("+Y+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ka=b.view.backgroundPageShape.node,-mxUtils.setPrefixedStyle(ka.style,"transform-origin",(Z||null==t?b.container.clientWidth/2+b.container.scrollLeft-ka.offsetLeft+"px":t.x+b.container.scrollLeft-ka.offsetLeft-b.container.offsetLeft+"px")+" "+(Z||null==t?b.container.clientHeight/2+b.container.scrollTop-ka.offsetTop+"px":t.y+b.container.scrollTop-ka.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(ka.style,"transform","scale("+Y+")")):b.view.validateBackgroundStyles(Y,ka,X);b.view.getDecoratorPane().style.opacity="0";-b.view.getOverlayPane().style.opacity="0";Z=b.container.querySelectorAll(".geHint");for(ka=0;ka<Z.length;ka++)Z[ka].style.opacity="0";b.fireEvent(new mxEventObject("zoomPreview","factor",Y))}T(b.isFastZoomEnabled()?ia:0)};mxEvent.addGestureListeners(b.container,function(Y){null!=l&&window.clearTimeout(l)},null,function(Y){1!=b.cumulativeZoomFactor&&T(0)});mxEvent.addListener(b.container,"scroll",function(Y){null==l||b.isMouseDown||1==b.cumulativeZoomFactor||T(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,-function(Y,Z,ia,ka,X){b.fireEvent(new mxEventObject("wheel"));if(null==b.freehand||!b.freehand.isDrawing())if(Editor.passiveScroll&&!ia&&b.isScrollWheelEvent(Y))null!=window.parent&&window.parent!=window&&window.parent.postMessage(JSON.stringify({event:"scrollWheel",deltaX:null!=Y.deltaX?Y.deltaX:0,deltaY:null!=Y.deltaY?Y.deltaY:Z?-60:60}),"*");else if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!ia&&b.isScrollWheelEvent(Y))ka=b.view.getTranslate(),X=40/b.view.scale,mxEvent.isShiftDown(Y)?-b.view.setTranslate(ka.x+(Z?-X:X),ka.y):b.view.setTranslate(ka.x,ka.y+(Z?X:-X));else if(ia||b.isZoomWheelEvent(Y))for(var ja=mxEvent.getSource(Y);null!=ja;){if(ja==b.container){b.tooltipHandler.hideTooltip();ka=null!=ka&&null!=X?new mxPoint(ka,X):new mxPoint(mxEvent.getClientX(Y),mxEvent.getClientY(Y));X=null!=t?new mxPoint(t.x,t.y):null;ja=b.cumulativeZoomFactor;t=ka;J=ia;ia=b.zoomFactor;var na=null;Y.ctrlKey&&null!=Y.deltaY&&40>Math.abs(Y.deltaY)&&Math.round(Y.deltaY)!=Y.deltaY?ia=1+Math.abs(Y.deltaY)/-20*(ia-1):null!=Y.movementY&&"pointermove"==Y.type&&(ia=1+Math.max(1,Math.abs(Y.movementY))/20*(ia-1),na=-1);b.lazyZoom(Z,null,na,ia);null!=X&&1!=ja&&b.isFastZoomEnabled()&&b.scrollbars&&(Z=b.cumulativeZoomFactor,ia=Z/ja,na=1-Z,.001<Math.abs(na)&&(t=new mxPoint((ka.x*(1-ia)+ia*X.x*(1-ja))/na,(ka.y*(1-ia)+ia*X.y*(1-ja))/na),ka=t.x+b.container.scrollLeft-b.container.offsetLeft,X=t.y+b.container.scrollTop-b.container.offsetTop,ra.style.transformOrigin=ka+"px "+X+"px",qa.style.transformOrigin=ka+"px "+-X+"px",null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(Z=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(Z.style,"transform-origin",t.x+b.container.scrollLeft-Z.offsetLeft-b.container.offsetLeft+"px "+(t.y+b.container.scrollTop-Z.offsetTop-b.container.offsetTop)+"px")):b.view.validateBackgroundStyles(Math.round(Math.round(b.view.scale*Z*100)/100*20)/(20*b.view.scale),ka,X)));mxEvent.consume(Y);return!1}ja=ja.parentNode}}),b.container);b.panningHandler.zoomGraph=function(Y){b.cumulativeZoomFactor=+"";qa.style.transform=""},0)):(ra.style.transform="",qa.style.transform="");b.view.getDecoratorPane().style.opacity="";b.view.getOverlayPane().style.opacity="";for(var Z=b.container.querySelectorAll(".geHint"),ia=0;ia<Z.length;ia++)Z[ia].style.opacity=""}Z=new mxPoint(b.container.scrollLeft,b.container.scrollTop);var ja=mxUtils.getOffset(b.container),X=b.view.scale;ia=b.view.translate.x;var ka=b.view.translate.y,na=0,la=0;null!=t&&(na=b.container.offsetWidth/2-t.x+ja.x,la=b.container.offsetHeight/+2-t.y+ja.y);var ua=null==d&&mxUtils.hasScrollbars(b.container);b.zoom(b.cumulativeZoomFactor,ua?!1:null,b.isFastZoomEnabled()?20:null,ua);var za=b.view.scale;za!=X&&(ua?(X=za/X,na=null!=t?t.x-ja.x:b.container.clientWidth/2,ja=null!=t?t.y-ja.y:b.container.clientHeight/2,null!=H&&(na-=Z.x-H.x,ja-=Z.y-H.y),b.container.scrollLeft=Math.round(Z.x*X+na*(X-1)+(b.view.translate.x-ia)*za),b.container.scrollTop=Math.round(Z.y*X+ja*(X-1)+(b.view.translate.y-ka)*za)):(null!=H&&(na+=Z.x-H.x,la+=Z.y-H.y),null!=+d&&m.chromelessResize(!1,null,na*(b.cumulativeZoomFactor-1),la*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||0==na&&0==la||(b.container.scrollLeft-=na*(b.cumulativeZoomFactor-1),b.container.scrollTop-=la*(b.cumulativeZoomFactor-1))));null!=R&&ra.setAttribute("filter",R);b.fireEvent(new mxEventObject("zoomPreviewComplete"));b.cumulativeZoomFactor=1;R=J=t=H=l=null}),null!=Y?Y:b.isFastZoomEnabled()?m.wheelZoomDelay:m.lazyZoomDelay)},0)};b.lazyZoom=function(Y,Z,ia,ja){ja=null!=ja?ja:+this.zoomFactor;(Z=Z||!b.scrollbars)&&(t=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+b.container.clientHeight/2));Y?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=ja,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:+(this.cumulativeZoomFactor/=ja,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale);this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,160))/this.view.scale;if(b.isFastZoomEnabled()){null==R&&""!=ra.getAttribute("filter")&&(R=ra.getAttribute("filter"),ra.removeAttribute("filter"));H=new mxPoint(b.container.scrollLeft,b.container.scrollTop);Y=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/+100*20)/(20*this.view.scale);ja=Z||null==t?b.container.scrollLeft+b.container.clientWidth/2:t.x+b.container.scrollLeft-b.container.offsetLeft;var X=Z||null==t?b.container.scrollTop+b.container.clientHeight/2:t.y+b.container.scrollTop-b.container.offsetTop;ra.style.transformOrigin=ja+"px "+X+"px";ra.style.transform="scale("+Y+")";qa.style.transformOrigin=ja+"px "+X+"px";qa.style.transform="scale("+Y+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ja=b.view.backgroundPageShape.node,+mxUtils.setPrefixedStyle(ja.style,"transform-origin",(Z||null==t?b.container.clientWidth/2+b.container.scrollLeft-ja.offsetLeft+"px":t.x+b.container.scrollLeft-ja.offsetLeft-b.container.offsetLeft+"px")+" "+(Z||null==t?b.container.clientHeight/2+b.container.scrollTop-ja.offsetTop+"px":t.y+b.container.scrollTop-ja.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(ja.style,"transform","scale("+Y+")")):b.view.validateBackgroundStyles(Y,ja,X);b.view.getDecoratorPane().style.opacity="0";+b.view.getOverlayPane().style.opacity="0";Z=b.container.querySelectorAll(".geHint");for(ja=0;ja<Z.length;ja++)Z[ja].style.opacity="0";b.fireEvent(new mxEventObject("zoomPreview","factor",Y))}T(b.isFastZoomEnabled()?ia:0)};mxEvent.addGestureListeners(b.container,function(Y){null!=l&&window.clearTimeout(l)},null,function(Y){1!=b.cumulativeZoomFactor&&T(0)});mxEvent.addListener(b.container,"scroll",function(Y){null==l||b.isMouseDown||1==b.cumulativeZoomFactor||T(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,+function(Y,Z,ia,ja,X){b.fireEvent(new mxEventObject("wheel"));if(null==b.freehand||!b.freehand.isDrawing())if(Editor.passiveScroll&&!ia&&b.isScrollWheelEvent(Y))null!=window.parent&&window.parent!=window&&window.parent.postMessage(JSON.stringify({event:"scrollWheel",deltaX:null!=Y.deltaX?Y.deltaX:0,deltaY:null!=Y.deltaY?Y.deltaY:Z?-60:60}),"*");else if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!ia&&b.isScrollWheelEvent(Y))ja=b.view.getTranslate(),X=40/b.view.scale,mxEvent.isShiftDown(Y)?+b.view.setTranslate(ja.x+(Z?-X:X),ja.y):b.view.setTranslate(ja.x,ja.y+(Z?X:-X));else if(ia||b.isZoomWheelEvent(Y))for(var ka=mxEvent.getSource(Y);null!=ka;){if(ka==b.container){b.tooltipHandler.hideTooltip();ja=null!=ja&&null!=X?new mxPoint(ja,X):new mxPoint(mxEvent.getClientX(Y),mxEvent.getClientY(Y));X=null!=t?new mxPoint(t.x,t.y):null;ka=b.cumulativeZoomFactor;t=ja;J=ia;ia=b.zoomFactor;var na=null;Y.ctrlKey&&null!=Y.deltaY&&40>Math.abs(Y.deltaY)&&Math.round(Y.deltaY)!=Y.deltaY?ia=1+Math.abs(Y.deltaY)/+20*(ia-1):null!=Y.movementY&&"pointermove"==Y.type&&(ia=1+Math.max(1,Math.abs(Y.movementY))/20*(ia-1),na=-1);b.lazyZoom(Z,null,na,ia);null!=X&&1!=ka&&b.isFastZoomEnabled()&&b.scrollbars&&(Z=b.cumulativeZoomFactor,ia=Z/ka,na=1-Z,.001<Math.abs(na)&&(t=new mxPoint((ja.x*(1-ia)+ia*X.x*(1-ka))/na,(ja.y*(1-ia)+ia*X.y*(1-ka))/na),ja=t.x+b.container.scrollLeft-b.container.offsetLeft,X=t.y+b.container.scrollTop-b.container.offsetTop,ra.style.transformOrigin=ja+"px "+X+"px",qa.style.transformOrigin=ja+"px "++X+"px",null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(Z=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(Z.style,"transform-origin",t.x+b.container.scrollLeft-Z.offsetLeft-b.container.offsetLeft+"px "+(t.y+b.container.scrollTop-Z.offsetTop-b.container.offsetTop)+"px")):b.view.validateBackgroundStyles(Math.round(Math.round(b.view.scale*Z*100)/100*20)/(20*b.view.scale),ja,X)));mxEvent.consume(Y);return!1}ka=ka.parentNode}}),b.container);b.panningHandler.zoomGraph=function(Y){b.cumulativeZoomFactor=Y.scale;b.lazyZoom(0<Y.scale,!0);mxEvent.consume(Y)}};EditorUi.prototype.addChromelessToolbarItems=function(b){"1"!=urlParams.noPrint&&b(mxUtils.bind(this,function(d){this.actions.get("print").funct();mxEvent.consume(d)}),Editor.printImage,mxResources.get("print"))};EditorUi.prototype.isPagesEnabled=function(){return this.editor.editable||"1"!=urlParams["hide-pages"]};EditorUi.prototype.createTemporaryGraph=function(b){return Graph.createOffscreenGraph(b)};EditorUi.prototype.addChromelessClickHandler=function(){var b=urlParams.highlight;null!=b&&0<b.length&&(b="#"+b);this.editor.graph.addClickHandler(b)};EditorUi.prototype.toggleFormatPanel=function(b){b=null!=b?b:0==this.formatWidth;if(null!=this.format){var d=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.formatContainer.style,"transition","width "+d+"s ease-in-out");window.setTimeout(mxUtils.bind(this,function(){this.formatWidth=b?240:0;this.hsplitPosition=Math.min(this.container.clientWidth-this.hsplit.clientWidth-this.formatWidth,this.hsplitPosition);this.refresh();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.formatContainer.style,@@ -2292,7 +2292,7 @@ EditorUi.prototype.toggleFormatPanel=function(b){b=null!=b?b:0==this.formatWidthEditorUi.prototype.isDiagramEmpty=function(){var b=this.editor.graph.getModel();return 1==b.getChildCount(b.root)&&0==b.getChildCount(b.getChildAt(b.root,0))};EditorUi.prototype.isSelectionAllowed=function(b){return"SELECT"==mxEvent.getSource(b).nodeName||"INPUT"==mxEvent.getSource(b).nodeName};EditorUi.prototype.addBeforeUnloadListener=function(){window.onbeforeunload=mxUtils.bind(this,function(){if(!this.editor.isChromelessView())return this.onBeforeUnload()})};EditorUi.prototype.onBeforeUnload=function(){if(this.editor.modified)return mxResources.get("allChangesLost")};EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(b,d){try{var m=mxUtils.parseXml(b);this.editor.setGraphXml(m.documentElement);this.editor.setModified(!1);this.editor.undoManager.clear();null!=d&&(this.editor.setFilename(d),this.updateDocumentTitle())}catch(p){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+p.message)}}))}catch(b){}this.editor.graph.view.validate();this.editor.graph.sizeDidChange();-this.editor.fireEvent(new mxEventObject("resetGraphView"))};EditorUi.prototype.showPrintDialog=function(b,d){this.showDialog((new PrintDialog(this,b,d)).container,300,180,!0,!0)};EditorUi.prototype.showPopupMenu=function(b,d,m,p){this.editor.graph.popupMenuHandler.hideMenu();var v=new mxPopupMenu(b);v.smartSeparators=!0;v.showDisabled=!0;v.autoExpand=!0;v.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(v,arguments);v.destroy()});v.popup(d,m,null,p);this.setCurrentMenu(v)};+this.editor.fireEvent(new mxEventObject("resetGraphView"))};EditorUi.prototype.showPrintDialog=function(b,d){this.showDialog((new PrintDialog(this,b,d)).container,300,180,!0,!0)};EditorUi.prototype.showPopupMenu=function(b,d,m,p){this.editor.graph.popupMenuHandler.hideMenu();var u=new mxPopupMenu(b);u.smartSeparators=!0;u.showDisabled=!0;u.autoExpand=!0;u.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(u,arguments);u.destroy()});u.popup(d,m,null,p);this.setCurrentMenu(u)};EditorUi.prototype.isHideCurrentMenuEvent=function(b){b=mxEvent.getSource(b);if(null!=this.currentMenu){if(b==this.currentMenu.div)return!1;for(var d=this.currentMenu.activeRow;null!=d;){if(b==d.div)return!1;d=d.activeRow}return!0}return!1};EditorUi.prototype.setCurrentMenu=function(b,d){this.currentMenuElt=d;this.currentMenu=b;this.hideShapePicker()};EditorUi.prototype.resetCurrentMenu=function(){this.currentMenu=this.currentMenuElt=null};EditorUi.prototype.hideCurrentMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.resetCurrentMenu())};EditorUi.prototype.updateDocumentTitle=function(){var b=this.editor.getOrCreateFilename();null!=this.editor.appName&&(b+=" - "+this.editor.appName);document.title=b};EditorUi.prototype.createHoverIcons=function(){return new HoverIcons(this.editor.graph)};EditorUi.prototype.createInlineToolbar=function(){return null};EditorUi.prototype.redo=function(){try{this.editor.graph.isEditing()?document.execCommand("redo",!1,null):this.editor.undoManager.redo()}catch(b){}};EditorUi.prototype.undo=function(){try{var b=this.editor.graph;if(b.isEditing()){var d=b.cellEditor.textarea.innerHTML;document.execCommand("undo",!1,null);d==b.cellEditor.textarea.innerHTML&&(b.stopEditing(!0),this.editor.undoManager.undo())}else this.editor.undoManager.undo()}catch(m){}};@@ -2300,26 +2300,26 @@ EditorUi.prototype.canRedo=function(){return this.editor.graph.isEditing()||thisEditorUi.prototype.getEditBlankXml=function(){return mxUtils.getXml(this.editor.getGraphXml())};EditorUi.prototype.getUrl=function(b){b=null!=b?b:window.location.pathname;var d=0<b.indexOf("?")?1:0,m;for(m in urlParams)b=0==d?b+"?":b+"&",b+=m+"="+urlParams[m],d++;return b};EditorUi.prototype.setScrollbars=function(b){var d=this.editor.graph,m=d.container.style.overflow;d.scrollbars=b;this.editor.updateGraphComponents();m!=d.container.style.overflow&&(d.container.scrollTop=0,d.container.scrollLeft=0,d.view.scaleAndTranslate(1,0,0),this.resetScrollbars());this.fireEvent(new mxEventObject("scrollbarsChanged"))};EditorUi.prototype.initialFitDiagram=function(b){var d=null!=urlParams.border?parseInt(urlParams.border):10;d=new mxRectangle(d,d,d,d);this.fitDiagramOrPages(null!=b?b:1,d,!0)};EditorUi.prototype.fitDiagramOrPages=function(b,d,m){var p=this.editor.graph;p.pageVisible&&p.isSelectionEmpty()&&!m?p.fitPages(b):this.fitDiagramToWindow(b,d,m)};-EditorUi.prototype.fitDiagramToWindow=function(b,d,m){var p=this.editor.graph,v=p.isSelectionEmpty()?mxRectangle.fromRectangle(p.getGraphBounds()):p.getBoundingBox(p.getSelectionCells());if(null!=v){var n=p.view.translate,y=p.view.scale;v.x=v.x/y-n.x;v.y=v.y/y-n.y;v.width/=y;v.height/=y;null!=p.backgroundImage&&v.add(new mxRectangle(0,0,p.backgroundImage.width,p.backgroundImage.height));0==v.width||0==v.height?(p.zoomTo(1),this.resetScrollbars()):(d=null!=d?d:Editor.fitWindowBorders,null!=d&&(v.x-=-d.x,v.y-=d.y,v.width+=d.width+d.x,v.height+=d.height+d.y),p.fitWindow(v,null,b,m,m))}};EditorUi.prototype.hasScrollbars=function(){return this.editor.graph.scrollbars};+EditorUi.prototype.fitDiagramToWindow=function(b,d,m){var p=this.editor.graph,u=p.isSelectionEmpty()?mxRectangle.fromRectangle(p.getGraphBounds()):p.getBoundingBox(p.getSelectionCells());if(null!=u){var n=p.view.translate,y=p.view.scale;u.x=u.x/y-n.x;u.y=u.y/y-n.y;u.width/=y;u.height/=y;null!=p.backgroundImage&&u.add(new mxRectangle(0,0,p.backgroundImage.width,p.backgroundImage.height));0==u.width||0==u.height?(p.zoomTo(1),this.resetScrollbars()):(d=null!=d?d:Editor.fitWindowBorders,null!=d&&(u.x-=+d.x,u.y-=d.y,u.width+=d.width+d.x,u.height+=d.height+d.y),p.fitWindow(u,null,b,m,m))}};EditorUi.prototype.hasScrollbars=function(){return this.editor.graph.scrollbars};EditorUi.prototype.resetScrollbars=function(){var b=this.editor.graph,d=b.container;if(!this.editor.extendCanvas)d.scrollTop=0,d.scrollLeft=0,mxUtils.hasScrollbars(d)||b.view.setTranslate(0,0);else if(!this.editor.isChromelessView())if(mxUtils.hasScrollbars(d))if(b.pageVisible){var m=b.getPagePadding();d.scrollTop=Math.floor(m.y);d.scrollLeft=Math.floor(Math.min(m.x,(d.scrollWidth-d.clientWidth)/2));m=b.getGraphBounds();0<m.width&&0<m.height&&(m.x>d.scrollLeft+.9*d.clientWidth&&(d.scrollLeft=Math.min(m.x+m.width-d.clientWidth,m.x-10)),m.y>d.scrollTop+.9*d.clientHeight&&(d.scrollTop=Math.min(m.y+m.height-d.clientHeight,m.y-10)))}else if(m=b.getGraphBounds(),0==m.width&&0==m.height)d.scrollLeft=(d.scrollWidth-d.clientWidth)/2,d.scrollTop=(d.scrollHeight-d.clientHeight)/2;else{var p=Math.max(m.height,b.scrollTileSize.height*b.view.scale);d.scrollLeft=Math.floor(Math.max(0,m.x-Math.max(0,(d.clientWidth-Math.max(m.width,b.scrollTileSize.width*b.view.scale))/2)));d.scrollTop=Math.floor(Math.max(0,m.y-Math.max(20,-(d.clientHeight-p)/4)))}else{m=mxRectangle.fromRectangle(b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds());p=b.view.translate;var v=b.view.scale;m.x=m.x/v-p.x;m.y=m.y/v-p.y;m.width/=v;m.height/=v;p=b.pageVisible?0:Math.max(0,(d.clientHeight-m.height)/4);"1"==urlParams.embedInline?b.view.setTranslate(Math.floor(-m.x+2),Math.floor(p-m.y+1)):b.view.setTranslate(Math.floor(Math.max(0,(d.clientWidth-m.width)/2)-m.x+2),Math.floor(p-m.y+1))}};-EditorUi.prototype.setPageVisible=function(b){var d=this.editor.graph,m=mxUtils.hasScrollbars(d.container),p=0,v=0;m&&(p=d.view.translate.x*d.view.scale-d.container.scrollLeft,v=d.view.translate.y*d.view.scale-d.container.scrollTop);d.pageVisible=b;d.pageBreaksVisible=b;d.preferPageSize=b;d.view.validateBackground();if(m){var n=d.getSelectionCells();d.clearSelection();d.setSelectionCells(n)}d.sizeDidChange();m&&(d.container.scrollLeft=d.view.translate.x*d.view.scale-p,d.container.scrollTop=d.view.translate.y*-d.view.scale-v);d.defaultPageVisible=b;this.fireEvent(new mxEventObject("pageViewChanged"))};-EditorUi.prototype.installResizeHandler=function(b,d,m){d&&(b.window.setSize=function(v,n){if(!this.minimized){var y=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,C=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,P=this.getX(),G=this.getY(),O=P+v>y?Math.max(0,y-v):P,U=G+n>C?Math.max(0,C-n):G;O==P&&U==G||mxWindow.prototype.setLocation.call(this,O,U);v=Math.min(v,y);n=Math.min(n,C)}mxWindow.prototype.setSize.apply(this,arguments)});-b.window.setLocation=function(v,n){if(null!=this.div){var y=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,C=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,P=parseInt(this.div.style.width),G=parseInt(this.div.style.height);v=Math.max(0,Math.min(v,Math.max(0,y-P)));n=Math.max(0,Math.min(n,Math.max(0,C-G)));this.getX()==v&&this.getY()==n||mxWindow.prototype.setLocation.apply(this,arguments);d&&!this.minimized&&(y=Math.min(P,-y),C=Math.min(G,C),y==P&&C==G||this.setSize(y,C))}};var p=mxUtils.bind(this,function(){var v=b.window.getX(),n=b.window.getY();b.window.setLocation(v,n)});mxEvent.addListener(window,"resize",p);b.destroy=function(){mxEvent.removeListener(window,"resize",p);b.window.destroy();null!=m&&m()}};function ChangeGridColor(b,d){this.ui=b;this.color=d}ChangeGridColor.prototype.execute=function(){var b=this.ui.editor.graph.view.gridColor;this.ui.setGridColor(this.color);this.color=b};-function ChangePageSetup(b,d,m,p,v){this.ui=b;this.previousColor=this.color=d;this.previousImage=this.image=m;this.previousFormat=this.format=p;this.previousPageScale=this.pageScale=v;this.ignoreImage=this.ignoreColor=!1}+(d.clientHeight-p)/4)))}else{m=mxRectangle.fromRectangle(b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds());p=b.view.translate;var u=b.view.scale;m.x=m.x/u-p.x;m.y=m.y/u-p.y;m.width/=u;m.height/=u;p=b.pageVisible?0:Math.max(0,(d.clientHeight-m.height)/4);"1"==urlParams.embedInline?b.view.setTranslate(Math.floor(-m.x+2),Math.floor(p-m.y+1)):b.view.setTranslate(Math.floor(Math.max(0,(d.clientWidth-m.width)/2)-m.x+2),Math.floor(p-m.y+1))}};+EditorUi.prototype.setPageVisible=function(b){var d=this.editor.graph,m=mxUtils.hasScrollbars(d.container),p=0,u=0;m&&(p=d.view.translate.x*d.view.scale-d.container.scrollLeft,u=d.view.translate.y*d.view.scale-d.container.scrollTop);d.pageVisible=b;d.pageBreaksVisible=b;d.preferPageSize=b;d.view.validateBackground();if(m){var n=d.getSelectionCells();d.clearSelection();d.setSelectionCells(n)}d.sizeDidChange();m&&(d.container.scrollLeft=d.view.translate.x*d.view.scale-p,d.container.scrollTop=d.view.translate.y*+d.view.scale-u);d.defaultPageVisible=b;this.fireEvent(new mxEventObject("pageViewChanged"))};+EditorUi.prototype.installResizeHandler=function(b,d,m){d&&(b.window.setSize=function(u,n){if(!this.minimized){var y=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,B=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,P=this.getX(),G=this.getY(),O=P+u>y?Math.max(0,y-u):P,U=G+n>B?Math.max(0,B-n):G;O==P&&U==G||mxWindow.prototype.setLocation.call(this,O,U);u=Math.min(u,y);n=Math.min(n,B)}mxWindow.prototype.setSize.apply(this,arguments)});+b.window.setLocation=function(u,n){if(null!=this.div){var y=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,B=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,P=parseInt(this.div.style.width),G=parseInt(this.div.style.height);u=Math.max(0,Math.min(u,Math.max(0,y-P)));n=Math.max(0,Math.min(n,Math.max(0,B-G)));this.getX()==u&&this.getY()==n||mxWindow.prototype.setLocation.apply(this,arguments);d&&!this.minimized&&(y=Math.min(P,+y),B=Math.min(G,B),y==P&&B==G||this.setSize(y,B))}};var p=mxUtils.bind(this,function(){var u=b.window.getX(),n=b.window.getY();b.window.setLocation(u,n)});mxEvent.addListener(window,"resize",p);b.destroy=function(){mxEvent.removeListener(window,"resize",p);b.window.destroy();null!=m&&m()}};function ChangeGridColor(b,d){this.ui=b;this.color=d}ChangeGridColor.prototype.execute=function(){var b=this.ui.editor.graph.view.gridColor;this.ui.setGridColor(this.color);this.color=b};+function ChangePageSetup(b,d,m,p,u){this.ui=b;this.previousColor=this.color=d;this.previousImage=this.image=m;this.previousFormat=this.format=p;this.previousPageScale=this.pageScale=u;this.ignoreImage=this.ignoreColor=!1}ChangePageSetup.prototype.execute=function(){var b=this.ui.editor.graph;if(!this.ignoreColor){this.color=this.previousColor;var d=b.background;this.ui.setBackgroundColor(this.previousColor);this.previousColor=d}if(!this.ignoreImage){this.image=this.previousImage;d=b.backgroundImage;var m=this.previousImage;null!=m&&Graph.isPageLink(m.src)&&(m=this.ui.createImageForPageLink(m.src,this.ui.currentPage));this.ui.setBackgroundImage(m);this.previousImage=d}null!=this.previousFormat&&(this.format=this.previousFormat,d=b.pageFormat,this.previousFormat.width!=d.width||this.previousFormat.height!=d.height)&&(this.ui.setPageFormat(this.previousFormat),this.previousFormat=d);null!=this.foldingEnabled&&this.foldingEnabled!=this.ui.editor.graph.foldingEnabled&&(this.ui.setFoldingEnabled(this.foldingEnabled),this.foldingEnabled=!this.foldingEnabled);null!=this.previousPageScale&&(b=this.ui.editor.graph.pageScale,this.previousPageScale!=b&&(this.ui.setPageScale(this.previousPageScale),this.previousPageScale=b))};EditorUi.prototype.setBackgroundColor=function(b){this.editor.graph.background=b;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("backgroundColorChanged"))};EditorUi.prototype.setFoldingEnabled=function(b){this.editor.graph.foldingEnabled=b;this.editor.graph.view.revalidate();this.fireEvent(new mxEventObject("foldingEnabledChanged"))};EditorUi.prototype.setPageFormat=function(b,d){d=null!=d?d:"1"==urlParams.sketch;this.editor.graph.pageFormat=b;d||(this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct());this.fireEvent(new mxEventObject("pageFormatChanged"))};EditorUi.prototype.setPageScale=function(b){this.editor.graph.pageScale=b;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageScaleChanged"))};EditorUi.prototype.setGridColor=function(b,d){d=null!=d?d:Editor.isDarkMode();var m=this.editor.graph;d?m.view.defaultDarkGridColor=b:m.view.defaultGridColor=b;m.view.gridColor="light-dark("+m.view.defaultGridColor+", "+m.view.defaultDarkGridColor+")";m.view.validateBackground();this.fireEvent(new mxEventObject("gridColorChanged"))};-EditorUi.prototype.addUndoListener=function(){var b=this.editor.undoManager,d=mxUtils.bind(this,function(){this.updateActionStates()});b.addListener(mxEvent.ADD,d);b.addListener(mxEvent.UNDO,d);b.addListener(mxEvent.REDO,d);b.addListener(mxEvent.CLEAR,d);var m=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){m.apply(this,arguments);d()};var p=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(v,n){p.apply(this,arguments);+EditorUi.prototype.addUndoListener=function(){var b=this.editor.undoManager,d=mxUtils.bind(this,function(){this.updateActionStates()});b.addListener(mxEvent.ADD,d);b.addListener(mxEvent.UNDO,d);b.addListener(mxEvent.REDO,d);b.addListener(mxEvent.CLEAR,d);var m=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){m.apply(this,arguments);d()};var p=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(u,n){p.apply(this,arguments);d()};d()};-EditorUi.prototype.updateActionStates=function(){for(var b=this.editor.graph,d=this.getSelectionState(),m=b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()),p=!this.editor.chromeless||this.editor.editable,v="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack solid dashed pasteSize dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded strokeColor sharp snapToGrid".split(" "),n=0;n<v.length;n++)this.actions.get(v[n]).setEnabled(0<+EditorUi.prototype.updateActionStates=function(){for(var b=this.editor.graph,d=this.getSelectionState(),m=b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()),p=!this.editor.chromeless||this.editor.editable,u="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack solid dashed pasteSize dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded strokeColor sharp snapToGrid".split(" "),n=0;n<u.length;n++)this.actions.get(u[n]).setEnabled(0<d.cells.length);this.actions.get("grid").setEnabled(p);this.actions.get("undo").setEnabled(this.canUndo()&&p);this.actions.get("redo").setEnabled(this.canRedo()&&p);this.actions.get("swap").setEnabled(2==d.cells.length&&2==d.vertices.length);this.actions.get("pasteSize").setEnabled(null!=this.copiedSize&&0<d.vertices.length);this.actions.get("pasteData").setEnabled(null!=this.copiedValue&&0<d.cells.length);this.actions.get("setAsDefaultStyle").setEnabled(1==b.getSelectionCount());this.actions.get("lockUnlock").setEnabled(!b.isSelectionEmpty());this.actions.get("bringForward").setEnabled(1==d.cells.length);this.actions.get("sendBackward").setEnabled(1==d.cells.length);n="alignCellsLeft alignCellsCenter alignCellsRight alignCellsTop alignCellsMiddle alignCellsBottom distributeHorizontal distributeVertical".split(" ");for(p=0;p<n.length;p++)this.actions.get(n[p]).setEnabled(d.unlocked&&1<d.vertices.length);this.actions.get("rotation").setEnabled(1==d.vertices.length);this.actions.get("wordWrap").setEnabled(1==d.vertices.length);this.actions.get("autosize").setEnabled(0<d.vertices.length);this.actions.get("copySize").setEnabled(1==d.vertices.length);this.actions.get("clearWaypoints").setEnabled(d.connections);this.actions.get("clearAnchors").setEnabled(d.connections);this.actions.get("curved").setEnabled(0<d.edges.length);this.actions.get("turn").setEnabled(0<d.cells.length);this.actions.get("group").setEnabled(1<d.cells.length||1==d.vertices.length&&0==b.model.getChildCount(d.cells[0])&&!b.isContainer(d.vertices[0]));this.actions.get("ungroup").setEnabled(!d.row&&@@ -2333,102 +2333,102 @@ EditorUi.prototype.createSidebarContainer=function(){var b=document.createElemenEditorUi.prototype.createUi=function(){this.statusContainer=this.createStatusContainer();this.menubar=this.editor.chromeless?null:this.menus.createMenubar(this.createDiv("geMenubar"));null!=this.menubar&&this.menubarContainer.appendChild(this.menubar.container);null!=this.menubar&&(this.editor.addListener("statusChanged",mxUtils.bind(this,function(){this.setStatusText(this.editor.getStatus())})),this.setStatusText(this.editor.getStatus()),this.menubar.container.appendChild(this.statusContainer),this.container.appendChild(this.menubarContainer));this.sidebar=this.editor.chromeless?null:this.createSidebar(this.sidebarContainer);null!=this.sidebar&&this.container.appendChild(this.sidebarContainer);this.format=this.editor.chromeless?null:this.createFormat(this.formatContainer);null!=this.format&&this.container.appendChild(this.formatContainer);this.container.appendChild(this.diagramContainer);null!=this.container&&null!=this.tabContainer&&this.container.appendChild(this.tabContainer);this.toolbar=this.editor.chromeless?null:this.createToolbar(this.createDiv("geToolbar"));null!=this.toolbar&&(this.toolbarContainer.appendChild(this.toolbar.container),this.container.appendChild(this.toolbarContainer));null!=this.sidebar&&(this.container.appendChild(this.hsplit),this.addSplitHandler(this.hsplit,!0,0,mxUtils.bind(this,function(b){this.hsplitPosition=b;this.refresh();this.fireEvent(new mxEventObject("sidebarWidthChanged"))})))};-EditorUi.prototype.createStatusContainer=function(){var b=document.createElement("a");b.className="geStatus";mxEvent.addListener(b,"click",mxUtils.bind(this,function(d){var m=mxEvent.getSource(d);if(m!=b)for(;m.parentNode!=b;)m=m.parentNode;if("A"!=m.nodeName){var p=m.getAttribute("data-action");if("statusFunction"==p&&null!=this.editor.statusFunction)this.editor.statusFunction();else if(null!=p)m=this.actions.get(p),null!=m&&m.funct();else{p=m.getAttribute("data-title");var v=m.getAttribute("data-message");-null!=p&&null!=v?this.showError(p,v):(m=m.getAttribute("data-link"),null!=m&&this.editor.graph.openLink(m))}mxEvent.consume(d)}}));return b};+EditorUi.prototype.createStatusContainer=function(){var b=document.createElement("a");b.className="geStatus";mxEvent.addListener(b,"click",mxUtils.bind(this,function(d){var m=mxEvent.getSource(d);if(m!=b)for(;m.parentNode!=b;)m=m.parentNode;if("A"!=m.nodeName){var p=m.getAttribute("data-action");if("statusFunction"==p&&null!=this.editor.statusFunction)this.editor.statusFunction();else if(null!=p)m=this.actions.get(p),null!=m&&m.funct();else{p=m.getAttribute("data-title");var u=m.getAttribute("data-message");+null!=p&&null!=u?this.showError(p,u):(m=m.getAttribute("data-link"),null!=m&&this.editor.graph.openLink(m))}mxEvent.consume(d)}}));return b};EditorUi.prototype.setStatusText=function(b){this.statusContainer.innerHTML=Graph.sanitizeHtml(b);0==this.statusContainer.getElementsByTagName("div").length&&null!=b&&0<b.length&&(this.statusContainer.innerText="",b=this.createStatusDiv(b),this.statusContainer.appendChild(b));b=this.statusContainer.querySelectorAll('[data-effect="fade"]');if(null!=b)for(var d=0;d<b.length;d++)(function(m){mxUtils.setOpacity(m,0);mxUtils.setPrefixedStyle(m.style,"transform","scaleX(0)");mxUtils.setPrefixedStyle(m.style,"transition","all 0.2s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(m,100);mxUtils.setPrefixedStyle(m.style,"transform","scaleX(1)");mxUtils.setPrefixedStyle(m.style,"transition","all 1s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(m.style,"transform","scaleX(0)");mxUtils.setOpacity(m,0);window.setTimeout(mxUtils.bind(this,function(){null!=m.parentNode&&m.parentNode.removeChild(m)}),1E3)}),Editor.updateStatusInterval/2)}),0)})(b[d])};EditorUi.prototype.clearStatus=function(){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus("")}))};EditorUi.prototype.updateStatus=function(b){null!=b&&b();this.lastStatusUpdate=b};EditorUi.prototype.updateStatusAgain=function(){null!=this.lastStatusUpdate&&this.lastStatusUpdate()};EditorUi.prototype.createStatusDiv=function(b){var d=document.createElement("div");d.className="geStatusDiv";d.setAttribute("title",b);d.innerText=b;return d};EditorUi.prototype.createToolbar=function(b){return new Toolbar(this,b)};EditorUi.prototype.createSidebar=function(b){return new Sidebar(this,b)};EditorUi.prototype.createFormat=function(b){return new Format(this,b)};EditorUi.prototype.getCollapsedSections=function(){return{}};EditorUi.prototype.createDiv=function(b){var d=document.createElement("div");d.className=b;return d};-EditorUi.prototype.addSplitHandler=function(b,d,m,p){function v(U){if(null!=y){var c=new mxPoint(mxEvent.getClientX(U),mxEvent.getClientY(U));p(Math.max(0,C+(d?c.x-y.x:y.y-c.y)-m));mxEvent.consume(U);C!=O()&&(P=!0,G=null)}}function n(U){v(U);y=C=null}var y=null,C=null,P=!0,G=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var O=mxUtils.bind(this,function(){var U=parseInt(d?b.offsetLeft:b.offsetTop);d||(U+=m);return U});mxEvent.addGestureListeners(b,function(U){y=new mxPoint(mxEvent.getClientX(U),-mxEvent.getClientY(U));C=O();P=!1;mxEvent.consume(U)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(U){if(!P&&this.hsplitClickEnabled){var c=null!=G?G-m:0;G=O();p(c);mxEvent.consume(U)}}));mxEvent.addGestureListeners(document,null,v,n);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,v,n)})};-EditorUi.prototype.prompt=function(b,d,m,p){b=new FilenameDialog(this,d,mxResources.get("apply"),function(v){m(p?v:parseFloat(v))},b);this.showDialog(b.container,300,80,!0,!0);b.init()};-EditorUi.prototype.handleError=function(b,d,m,p,v){b=null!=b&&null!=b.error?b.error:b;if(null!=b||null!=d){v=mxUtils.htmlEntities(mxResources.get("unknownError"));var n=mxResources.get("ok");d=null!=d?d:mxResources.get("error");null!=b&&null!=b.message&&(v=mxUtils.htmlEntities(b.message));this.showError(d,v,n,m,null,null,null,null,null,null,null,null,p?m:null)}else null!=m&&m()};-EditorUi.prototype.showError=function(b,d,m,p,v,n,y,C,P,G,O,U,c){b=new ErrorDialog(this,b,d,m||mxResources.get("ok"),p,v,n,y,U,C,P);this.showDialog(b.container,G||340,O,!0,!1,c);null==O&&null!=this.dialog&&null!=this.dialog.container&&(this.dialog.container.style.height=this.dialog.container.offsetHeight+16+"px");b.init()};-EditorUi.prototype.showDialog=function(b,d,m,p,v,n,y,C,P,G,O){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,d,m,p,v,n,y,C,P,G);this.dialogs.push(this.dialog);null!=O&&null!=P&&"undefined"!==typeof mxSettings&&null!=mxSettings.getWindowState&&(b=mxSettings.getWindowState(O),null!=b&&null!=b.w&&null!=b.h&&(this.dialog.container.style.width=Math.max(P.width,b.w)+"px",this.dialog.container.style.height=+EditorUi.prototype.addSplitHandler=function(b,d,m,p){function u(U){if(null!=y){var c=new mxPoint(mxEvent.getClientX(U),mxEvent.getClientY(U));p(Math.max(0,B+(d?c.x-y.x:y.y-c.y)-m));mxEvent.consume(U);B!=O()&&(P=!0,G=null)}}function n(U){u(U);y=B=null}var y=null,B=null,P=!0,G=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var O=mxUtils.bind(this,function(){var U=parseInt(d?b.offsetLeft:b.offsetTop);d||(U+=m);return U});mxEvent.addGestureListeners(b,function(U){y=new mxPoint(mxEvent.getClientX(U),+mxEvent.getClientY(U));B=O();P=!1;mxEvent.consume(U)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(U){if(!P&&this.hsplitClickEnabled){var c=null!=G?G-m:0;G=O();p(c);mxEvent.consume(U)}}));mxEvent.addGestureListeners(document,null,u,n);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,u,n)})};+EditorUi.prototype.prompt=function(b,d,m,p){b=new FilenameDialog(this,d,mxResources.get("apply"),function(u){m(p?u:parseFloat(u))},b);this.showDialog(b.container,300,80,!0,!0);b.init()};+EditorUi.prototype.handleError=function(b,d,m,p,u){b=null!=b&&null!=b.error?b.error:b;if(null!=b||null!=d){u=mxUtils.htmlEntities(mxResources.get("unknownError"));var n=mxResources.get("ok");d=null!=d?d:mxResources.get("error");null!=b&&null!=b.message&&(u=mxUtils.htmlEntities(b.message));this.showError(d,u,n,m,null,null,null,null,null,null,null,null,p?m:null)}else null!=m&&m()};+EditorUi.prototype.showError=function(b,d,m,p,u,n,y,B,P,G,O,U,c){b=new ErrorDialog(this,b,d,m||mxResources.get("ok"),p,u,n,y,U,B,P);this.showDialog(b.container,G||340,O,!0,!1,c);null==O&&null!=this.dialog&&null!=this.dialog.container&&(this.dialog.container.style.height=this.dialog.container.offsetHeight+16+"px");b.init()};+EditorUi.prototype.showDialog=function(b,d,m,p,u,n,y,B,P,G,O){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,d,m,p,u,n,y,B,P,G);this.dialogs.push(this.dialog);null!=O&&null!=P&&"undefined"!==typeof mxSettings&&null!=mxSettings.getWindowState&&(b=mxSettings.getWindowState(O),null!=b&&null!=b.w&&null!=b.h&&(this.dialog.container.style.width=Math.max(P.width,b.w)+"px",this.dialog.container.style.height=Math.max(P.height,b.h)+"px"),this.dialog.onResize=function(U,c){mxSettings.setWindowState(O,{w:U,h:c});mxSettings.save()})};-EditorUi.prototype.hideDialog=function(b,d,m){var p=null;if(null!=this.dialogs&&0<this.dialogs.length)for(var v=this.dialogs.length-1;0<=v;v--)if(!this.dialogs[v].closing){p=this.dialogs[v];break}null==p||null!=m&&m!=this.dialog.container.firstChild||(p.closing=!0,0==p.close(b,d)?delete p.closing:(delete p.closing,b=mxUtils.lastIndexOf(this.dialogs,p),0<=b&&this.dialogs.splice(b,1),this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,this.editor.fireEvent(new mxEventObject("hideDialog",+EditorUi.prototype.hideDialog=function(b,d,m){var p=null;if(null!=this.dialogs&&0<this.dialogs.length)for(var u=this.dialogs.length-1;0<=u;u--)if(!this.dialogs[u].closing){p=this.dialogs[u];break}null==p||null!=m&&m!=this.dialog.container.firstChild||(p.closing=!0,0==p.close(b,d)?delete p.closing:(delete p.closing,b=mxUtils.lastIndexOf(this.dialogs,p),0<=b&&this.dialogs.splice(b,1),this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,this.editor.fireEvent(new mxEventObject("hideDialog","dialog",p)),null==this.dialog&&null!=this.editor.graph.container&&"hidden"!=this.editor.graph.container.style.visibility&&window.setTimeout(mxUtils.bind(this,function(){null==this.editor||null!=this.dialogs&&0!=this.dialogs.length||(this.editor.graph.isEditing()&&null!=this.editor.graph.cellEditor.textarea?this.editor.graph.cellEditor.textarea.focus():(mxUtils.clearSelection(),this.editor.graph.container.focus()))}),0)))};-EditorUi.prototype.ctrlEnter=function(){var b=this.editor.graph;if(b.isEnabled())try{for(var d=b.getSelectionCells(),m=new mxDictionary,p=[],v=0;v<d.length;v++){var n=b.isTableCell(d[v])?b.model.getParent(d[v]):d[v];null==n||m.get(n)||(m.put(n,!0),p.push(n))}b.setSelectionCells(b.duplicateCells(p,!1))}catch(y){this.handleError(y)}};-EditorUi.prototype.pickColor=function(b,d,m,p,v,n,y,C){if(null!=this.dialog&&null!=this.dialog.bg&&null!=this.dialog.bg.parentNode)this.pickColorModal(b,d,m,p,v,n,null,C);else{var P=this.editor.graph,G=P.cellEditor.saveSelection(),O=this;if(null==this.colorWindow){var U=null!=this.installWindowPersistence?mxSettings.getWindowState("colorPicker"):null;this.colorWindow=new ColorWindow(this,null!=U&&null!=U.x?U.x:document.body.offsetWidth-280,null!=U&&null!=U.y?U.y:100,null!=U&&null!=U.w?U.w:260);null!=-this.installWindowPersistence&&(this.installWindowPersistence("colorPicker",this.colorWindow),null!=U&&this.restoreWindowState("colorPicker",this.colorWindow))}this.colorWindow.update(b,function(c){P.cellEditor.restoreSelection(G);null!=O.colorWindow&&(O.colorWindow.applying=!0);d(c);null!=O.colorWindow&&(O.colorWindow.applying=!1)},n||mxResources.get("fillColor"),m,p,v,y,C)}};-EditorUi.prototype.pickColorModal=function(b,d,m,p,v,n,y,C){var P=this.editor.graph,G=P.cellEditor.saveSelection(),O=new ColorDialog(this,b,function(c){P.cellEditor.restoreSelection(G);null!=d&&d(c)},function(){P.cellEditor.restoreSelection(G);null!=y&&y()},m,p,v,null,C);null!=n&&(b=document.createElement("div"),b.style.cssText="width:100%;text-align:center;font-weight:bold;margin-bottom:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis",mxUtils.write(b,n),O.container.insertBefore(b,+EditorUi.prototype.ctrlEnter=function(){var b=this.editor.graph;if(b.isEnabled())try{for(var d=b.getSelectionCells(),m=new mxDictionary,p=[],u=0;u<d.length;u++){var n=b.isTableCell(d[u])?b.model.getParent(d[u]):d[u];null==n||m.get(n)||(m.put(n,!0),p.push(n))}b.setSelectionCells(b.duplicateCells(p,!1))}catch(y){this.handleError(y)}};+EditorUi.prototype.pickColor=function(b,d,m,p,u,n,y,B){if(null!=this.dialog&&null!=this.dialog.bg&&null!=this.dialog.bg.parentNode)this.pickColorModal(b,d,m,p,u,n,null,B);else{var P=this.editor.graph,G=P.cellEditor.saveSelection(),O=this;if(null==this.colorWindow){var U=null!=this.installWindowPersistence?mxSettings.getWindowState("colorPicker"):null;this.colorWindow=new ColorWindow(this,null!=U&&null!=U.x?U.x:document.body.offsetWidth-280,null!=U&&null!=U.y?U.y:100,null!=U&&null!=U.w?U.w:260);null!=+this.installWindowPersistence&&(this.installWindowPersistence("colorPicker",this.colorWindow),null!=U&&this.restoreWindowState("colorPicker",this.colorWindow))}this.colorWindow.update(b,function(c){P.cellEditor.restoreSelection(G);null!=O.colorWindow&&(O.colorWindow.applying=!0);d(c);null!=O.colorWindow&&(O.colorWindow.applying=!1)},n||mxResources.get("fillColor"),m,p,u,y,B)}};+EditorUi.prototype.pickColorModal=function(b,d,m,p,u,n,y,B){var P=this.editor.graph,G=P.cellEditor.saveSelection(),O=new ColorDialog(this,b,function(c){P.cellEditor.restoreSelection(G);null!=d&&d(c)},function(){P.cellEditor.restoreSelection(G);null!=y&&y()},m,p,u,null,B);null!=n&&(b=document.createElement("div"),b.style.cssText="width:100%;text-align:center;font-weight:bold;margin-bottom:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis",mxUtils.write(b,n),O.container.insertBefore(b,O.container.firstChild));this.showDialog(O.container,250,null,!0,!1);var U=this.dialog.container;O.resizeFn=function(){U.style.height=O.container.scrollHeight+48+"px"};O.init()};EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(b){this.hideDialog(b)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})};-EditorUi.prototype.base64ToBlob=function(b,d){d=d||"";b=atob(b);for(var m=b.length,p=Math.ceil(m/1024),v=Array(p),n=0;n<p;++n){for(var y=1024*n,C=Math.min(y+1024,m),P=Array(C-y),G=0;y<C;++G,++y)P[G]=b[y].charCodeAt(0);v[n]=new Uint8Array(P)}return new Blob(v,{type:d})};-EditorUi.prototype.extractGraphModelFromHtml=function(b){var d=null;try{var m=b.indexOf("<mxGraphModel ");if(0<=m){var p=b.lastIndexOf("</mxGraphModel>");p>m&&(d=b.substring(m,p+21).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}}catch(v){}return d};+EditorUi.prototype.base64ToBlob=function(b,d){d=d||"";b=atob(b);for(var m=b.length,p=Math.ceil(m/1024),u=Array(p),n=0;n<p;++n){for(var y=1024*n,B=Math.min(y+1024,m),P=Array(B-y),G=0;y<B;++G,++y)P[G]=b[y].charCodeAt(0);u[n]=new Uint8Array(P)}return new Blob(u,{type:d})};+EditorUi.prototype.extractGraphModelFromHtml=function(b){var d=null;try{var m=b.indexOf("<mxGraphModel ");if(0<=m){var p=b.lastIndexOf("</mxGraphModel>");p>m&&(d=b.substring(m,p+21).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}}catch(u){}return d};EditorUi.prototype.extractGraphModelFromEvent=function(b){var d=null,m=null;null!=b&&(b=null!=b.dataTransfer?b.dataTransfer:b.clipboardData,null!=b&&(m=0<=mxUtils.indexOf(b.types,"text/html")?b.getData("text/html"):null,0<=mxUtils.indexOf(b.types,"text/plain")&&(null==m||0==m.length)&&(m=b.getData("text/plain")),null!=m&&(m=Graph.zapGremlins(mxUtils.trim(m)),b=this.extractGraphModelFromHtml(m),null!=b&&(m=b))));null!=m&&this.isCompatibleString(m)&&(d=m);return d};EditorUi.prototype.isCompatibleString=function(b){return!1};EditorUi.prototype.saveFile=function(b){b||null==this.editor.filename?(b=new FilenameDialog(this,this.editor.getOrCreateFilename(),mxResources.get("save"),mxUtils.bind(this,function(d){this.save(d)}),null,mxUtils.bind(this,function(d){if(null!=d&&0<d.length)return!0;mxUtils.confirm(mxResources.get("invalidName"));return!1})),this.showDialog(b.container,340,96,!0,!0),b.init()):this.save(this.editor.getOrCreateFilename())};EditorUi.prototype.save=function(b){if(null!=b){this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var d=mxUtils.getXml(this.editor.getGraphXml());try{if(Editor.useLocalStorage){if(null!=localStorage.getItem(b)&&!mxUtils.confirm(mxResources.get("replaceIt",[b])))return;localStorage.setItem(b,d);this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saved"))+" "+new Date)}))}else if(d.length<MAX_REQUEST_SIZE)(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&xml="+encodeURIComponent(d))).simulate(document,"_blank");else{mxUtils.alert(mxResources.get("drawingTooLarge"));mxUtils.popup(d);return}this.editor.setModified(!1);this.editor.setFilename(b);this.updateDocumentTitle()}catch(m){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("errorSavingFile")))}))}}};-EditorUi.prototype.executeLayouts=function(b,d){for(var m=!1,p=0;p<b.length;p++)if("function"===typeof b[p].prepare){m=!0;break}if(m){var v=this,n=this.editor.graph.getDefaultParent(),y=0,C=function(){if(y>=b.length)null!=d&&d();else{var P=b[y++];"function"===typeof P.prepare?P.prepare(n,function(G,O){null!=G?v.handleError(G):v.executeLayout(O,!0,C)}):v.executeLayout(function(){P.execute(n)},!0,C)}};C()}else this.executeLayout(mxUtils.bind(this,function(){var P=new mxCompositeLayout(this.editor.graph,-b),G=this.editor.graph.getSelectionCells();P.execute(this.editor.graph.getDefaultParent(),0==G.length?null:G)}),!0,d)};EditorUi.prototype.executeLayout=function(b,d,m){var p=this.editor.graph;p.getModel().beginUpdate();try{b()}catch(v){throw v;}finally{this.allowAnimation&&d&&p.isEnabled()?(b=new mxMorphing(p),b.addListener(mxEvent.DONE,mxUtils.bind(this,function(){p.getModel().endUpdate();null!=m&&m()})),b.startAnimation()):(p.getModel().endUpdate(),null!=m&&m())}};-EditorUi.prototype.showImageDialog=function(b,d,m,p){p=this.editor.graph.cellEditor;var v=p.saveSelection(),n=mxUtils.prompt(b,d);p.restoreSelection(v);if(null!=n&&0<n.length){var y=new Image;y.onload=function(){m(n,y.width,y.height)};y.onerror=function(){m(null);mxUtils.alert(mxResources.get("fileNotFound"))};y.src=n}else m(null)};EditorUi.prototype.showLinkDialog=function(b,d,m){b=new LinkDialog(this,b,d,m);this.showDialog(b.container,420,null,!0,!0);b.init()};+EditorUi.prototype.executeLayouts=function(b,d){for(var m=!1,p=0;p<b.length;p++)if("function"===typeof b[p].prepare){m=!0;break}if(m){var u=this,n=this.editor.graph.getDefaultParent(),y=0,B=function(){if(y>=b.length)null!=d&&d();else{var P=b[y++];"function"===typeof P.prepare?P.prepare(n,function(G,O){null!=G?u.handleError(G):u.executeLayout(O,!0,B)}):u.executeLayout(function(){P.execute(n)},!0,B)}};B()}else this.executeLayout(mxUtils.bind(this,function(){var P=new mxCompositeLayout(this.editor.graph,+b),G=this.editor.graph.getSelectionCells();P.execute(this.editor.graph.getDefaultParent(),0==G.length?null:G)}),!0,d)};EditorUi.prototype.executeLayout=function(b,d,m){var p=this.editor.graph;p.getModel().beginUpdate();try{b()}catch(u){throw u;}finally{this.allowAnimation&&d&&p.isEnabled()?(b=new mxMorphing(p),b.addListener(mxEvent.DONE,mxUtils.bind(this,function(){p.getModel().endUpdate();null!=m&&m()})),b.startAnimation()):(p.getModel().endUpdate(),null!=m&&m())}};+EditorUi.prototype.showImageDialog=function(b,d,m,p){p=this.editor.graph.cellEditor;var u=p.saveSelection(),n=mxUtils.prompt(b,d);p.restoreSelection(u);if(null!=n&&0<n.length){var y=new Image;y.onload=function(){m(n,y.width,y.height)};y.onerror=function(){m(null);mxUtils.alert(mxResources.get("fileNotFound"))};y.src=n}else m(null)};EditorUi.prototype.showLinkDialog=function(b,d,m){b=new LinkDialog(this,b,d,m);this.showDialog(b.container,420,null,!0,!0);b.init()};EditorUi.prototype.showDataDialog=function(b){null!=b&&"undefined"!==typeof window.EditDataDialog&&(b=new EditDataDialog(this,b),this.showDialog(b.container,480,420,!0,!1,null,!1,null,new mxRectangle(0,0,440,340),null,"editData"),b.init())};EditorUi.prototype.showBackgroundImageDialog=function(b,d){b=null!=b?b:mxUtils.bind(this,function(p){p=new ChangePageSetup(this,null,p);p.ignoreColor=!0;this.editor.graph.model.execute(p)});var m=mxUtils.prompt(mxResources.get("backgroundImage"),null!=d?d.src:"");null!=m&&0<m.length?(d=new Image,d.onload=function(){b(new mxImage(m,d.width,d.height),!1)},d.onerror=function(){b(null,!0);mxUtils.alert(mxResources.get("fileNotFound"))},d.src=m):b(null)};EditorUi.prototype.setBackgroundImage=function(b){this.editor.graph.setBackgroundImage(b);this.editor.graph.view.validateBackgroundImage();this.fireEvent(new mxEventObject("backgroundImageChanged"))};EditorUi.prototype.confirm=function(b,d,m){mxUtils.confirm(b)?null!=d&&d():null!=m&&m()};EditorUi.prototype.createOutline=function(b){var d=new mxOutline(this.editor.graph);mxEvent.addListener(window,"resize",function(){d.update(!1)});return d};EditorUi.prototype.altShiftActions={65:"connectionArrows",82:"clearWaypoints",76:"editLink",79:"connectionPoints",81:"editConnectionPoints",84:"editTooltip",86:"pasteSize",70:"copySize",66:"copyData",69:"pasteData"};EditorUi.prototype.ctrlAltShiftActions={70:"bringForward",66:"sendBackward",88:"copyAsSvg"};EditorUi.prototype.ctrlAltActions={88:"copyAsImage"};EditorUi.prototype.altActions={};-EditorUi.prototype.createKeyHandler=function(b){function d(){null!=C&&(window.clearTimeout(C),C=null);var f=v.graphHandler;if(null!=f&&null!=f.first){var k=v.getView().scale,q=f.roundLength(f.currentDx/k);k=f.roundLength(f.currentDy/k);f.moveCells(f.cells,q,k);f.reset()}}function m(f,k,q){if(!v.isSelectionEmpty()&&v.isEnabled()){k=null!=k?k:Editor.getCursorMoveStep(v.view.unit);var x=v.getCompositeParents(v.getSelectionCells()),B=0<x.length?x[0]:null;if(null!=B){if(q){v.getModel().beginUpdate();try{for(B=-0;B<x.length;B++)if(v.getModel().isVertex(x[B])&&v.isCellResizable(x[B])){var E=v.getCellGeometry(x[B]);null!=E&&(E=E.clone(),37==f?E.width=Math.max(0,E.width-k):38==f?E.height=Math.max(0,E.height-k):39==f?E.width+=k:40==f&&(E.height+=k),v.getModel().setGeometry(x[B],E))}}finally{v.getModel().endUpdate()}}else{q=v.model.getParent(B);E=v.getView().scale;var L=null;1==v.getSelectionCount()&&v.model.isVertex(B)&&null!=v.layoutManager&&!v.isCellLocked(B)&&(L=v.layoutManager.getLayout(q));null!=L&&L.constructor==-mxStackLayout?(k=q.getIndex(B),37==f||38==f?v.model.add(q,B,Math.max(0,k-1)):(39==f||40==f)&&v.model.add(q,B,Math.min(v.model.getChildCount(q),k+1))):(q=v.graphHandler,null!=q&&(null==q.first&&q.start(B,0,0,v.getMovableCells(x)),null!=q.first&&(L=B=0,37==f?B=-k:38==f?L=-k:39==f?B=k:40==f&&(L=k),q.currentDx+=B*E,q.currentDy+=L*E,q.checkPreview(),q.updatePreview()),null!=C&&window.clearTimeout(C),C=window.setTimeout(d,400)))}B=v.graphHandler;f=v.container;k=null;null!=B&&null!=B.first?null!=B.bounds&&-(k=mxRectangle.fromRectangle(B.bounds),k.x+=B.currentDx,k.y+=B.currentDy):k=v.view.getBounds(x);null!=k&&null!=f&&(k.x<f.scrollLeft||k.y<f.scrollTop||k.x+k.width>f.scrollLeft+f.clientWidth||k.y+k.height>f.scrollTop+f.clientHeight)&&(B=v.view.translate,x=new mxPoint(B.x,B.y),v.scrollRectToVisible(new mxRectangle(k.getCenterX()-B.x-f.clientWidth/2,k.getCenterY()-B.y-f.clientHeight/2,f.clientWidth,f.clientHeight))&&(f=new mxPoint(B.x,B.y),v.view.translate.x=x.x,v.view.translate.y=x.y,v.view.setTranslate(f.x,-f.y)))}}}var p=this,v=this.editor.graph,n=new mxKeyHandler(v),y=n.isEventIgnored;n.isEventIgnored=function(f){return 188==f.keyCode&&this.isControlDown(f)&&!this.graph.cellEditor.isContentEditing()?!0:!(mxEvent.isShiftDown(f)&&9==f.keyCode)&&(!this.isControlDown(f)||mxEvent.isShiftDown(f)||90!=f.keyCode&&89!=f.keyCode&&188!=f.keyCode&&190!=f.keyCode&&85!=f.keyCode&&83!=f.keyCode)&&(66!=f.keyCode&&73!=f.keyCode||!this.isControlDown(f)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&-(109!=f.keyCode&&107!=f.keyCode||!this.isControlDown(f)&&!mxEvent.isShiftDown(f)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&y.apply(this,arguments)};n.isEnabledForEvent=function(f){return!mxEvent.isConsumed(f)&&this.isGraphEvent(f)&&this.isEnabled()&&(null==p.dialogs||0==p.dialogs.length)};n.isControlDown=function(f){return mxEvent.isControlDown(f)||mxClient.IS_MAC&&f.metaKey};var C=null,P=v.fireMouseEvent;v.fireMouseEvent=function(f,k,q){f==mxEvent.MOUSE_DOWN&&-d();P.apply(this,arguments)};var G={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},O=n.getFunction;mxKeyHandler.prototype.getFunction=function(f){if(v.isEnabled()){var k=null;mxEvent.isShiftDown(f)&&this.isControlDown(f)&&mxEvent.isAltDown(f)?k=p.actions.get(p.ctrlAltShiftActions[f.keyCode]):mxEvent.isShiftDown(f)&&mxEvent.isAltDown(f)?k=p.actions.get(p.altShiftActions[f.keyCode]):this.isControlDown(f)&&mxEvent.isAltDown(f)?-k=p.actions.get(p.ctrlAltActions[f.keyCode]):mxEvent.isAltDown(f)&&(k=p.actions.get(p.altActions[f.keyCode]));if(null!=k)return k.funct;if("/"==f.key&&!this.isControlDown(f)&&!mxEvent.isAltDown(f))return function(){var q=document.getElementById("geOmniSearch");null!=q&&30<q.clientWidth&&q.focus()};if(null!=G[f.keyCode]&&!v.isSelectionEmpty())if(!this.isControlDown(f)&&mxEvent.isShiftDown(f)&&mxEvent.isAltDown(f)){if(v.model.isVertex(v.getSelectionCell()))return function(){var q=v.connectVertex(v.getSelectionCell(),-G[f.keyCode],v.defaultEdgeLength,f,!0);null!=q&&0<q.length&&(1==q.length&&v.model.isEdge(q[0])?v.setSelectionCell(v.model.getTerminal(q[0],!1)):v.setSelectionCell(q[q.length-1]),v.scrollCellToVisible(v.getSelectionCell()),null!=p.hoverIcons&&p.hoverIcons.update(v.view.getState(v.getSelectionCell())))}}else return this.isControlDown(f)?function(){m(f.keyCode,mxEvent.isShiftDown(f)?v.gridSize:null,!0)}:function(){m(f.keyCode,mxEvent.isShiftDown(f)?v.gridSize:null)}}return O.apply(this,arguments)};n.bindAction=-mxUtils.bind(this,function(f,k,q,x){var B=this.actions.get(q);null!=B&&(q=function(){B.isEnabled()&&B.funct.apply(this,arguments)},k?x?n.bindControlShiftKey(f,q):n.bindControlKey(f,q):x?n.bindShiftKey(f,q):n.bindKey(f,q))});var U=this,c=n.escape;n.escape=function(f){c.apply(this,arguments)};n.enter=function(){};n.bindControlShiftKey(36,function(){v.exitGroup()});n.bindControlShiftKey(35,function(){v.enterGroup()});n.bindShiftKey(36,function(){v.home()});n.bindKey(35,function(){v.refresh()});n.bindAction(80,-!0,"print");n.bindAction(107,!0,"zoomIn");n.bindAction(109,!0,"zoomOut");n.bindAction(61,!0,"zoomIn");n.bindAction(187,!0,"zoomIn");n.bindAction(222,!0,"zoomIn");n.bindAction(173,!0,"zoomOut");n.bindAction(189,!0,"zoomOut");if(!this.editor.chromeless||this.editor.editable)n.bindAction(79,!0,"outline",!0),n.bindControlKey(36,function(){v.isEnabled()&&v.foldCells(!0)}),n.bindControlKey(35,function(){v.isEnabled()&&v.foldCells(!1)}),n.bindControlKey(13,function(){U.ctrlEnter()}),n.bindAction(8,!1,"delete"),+EditorUi.prototype.createKeyHandler=function(b){function d(){null!=B&&(window.clearTimeout(B),B=null);var f=u.graphHandler;if(null!=f&&null!=f.first){var k=u.getView().scale,q=f.roundLength(f.currentDx/k);k=f.roundLength(f.currentDy/k);f.moveCells(f.cells,q,k);f.reset()}}function m(f,k,q){if(!u.isSelectionEmpty()&&u.isEnabled()){k=null!=k?k:Editor.getCursorMoveStep(u.view.unit);var x=u.getCompositeParents(u.getSelectionCells()),C=0<x.length?x[0]:null;if(null!=C){if(q){u.getModel().beginUpdate();try{for(C=+0;C<x.length;C++)if(u.getModel().isVertex(x[C])&&u.isCellResizable(x[C])){var E=u.getCellGeometry(x[C]);null!=E&&(E=E.clone(),37==f?E.width=Math.max(0,E.width-k):38==f?E.height=Math.max(0,E.height-k):39==f?E.width+=k:40==f&&(E.height+=k),u.getModel().setGeometry(x[C],E))}}finally{u.getModel().endUpdate()}}else{q=u.model.getParent(C);E=u.getView().scale;var L=null;1==u.getSelectionCount()&&u.model.isVertex(C)&&null!=u.layoutManager&&!u.isCellLocked(C)&&(L=u.layoutManager.getLayout(q));null!=L&&L.constructor==+mxStackLayout?(k=q.getIndex(C),37==f||38==f?u.model.add(q,C,Math.max(0,k-1)):(39==f||40==f)&&u.model.add(q,C,Math.min(u.model.getChildCount(q),k+1))):(q=u.graphHandler,null!=q&&(null==q.first&&q.start(C,0,0,u.getMovableCells(x)),null!=q.first&&(L=C=0,37==f?C=-k:38==f?L=-k:39==f?C=k:40==f&&(L=k),q.currentDx+=C*E,q.currentDy+=L*E,q.checkPreview(),q.updatePreview()),null!=B&&window.clearTimeout(B),B=window.setTimeout(d,400)))}C=u.graphHandler;f=u.container;k=null;null!=C&&null!=C.first?null!=C.bounds&&+(k=mxRectangle.fromRectangle(C.bounds),k.x+=C.currentDx,k.y+=C.currentDy):k=u.view.getBounds(x);null!=k&&null!=f&&(k.x<f.scrollLeft||k.y<f.scrollTop||k.x+k.width>f.scrollLeft+f.clientWidth||k.y+k.height>f.scrollTop+f.clientHeight)&&(C=u.view.translate,x=new mxPoint(C.x,C.y),u.scrollRectToVisible(new mxRectangle(k.getCenterX()-C.x-f.clientWidth/2,k.getCenterY()-C.y-f.clientHeight/2,f.clientWidth,f.clientHeight))&&(f=new mxPoint(C.x,C.y),u.view.translate.x=x.x,u.view.translate.y=x.y,u.view.setTranslate(f.x,+f.y)))}}}var p=this,u=this.editor.graph,n=new mxKeyHandler(u),y=n.isEventIgnored;n.isEventIgnored=function(f){return 188==f.keyCode&&this.isControlDown(f)&&!this.graph.cellEditor.isContentEditing()?!0:!(mxEvent.isShiftDown(f)&&9==f.keyCode)&&(!this.isControlDown(f)||mxEvent.isShiftDown(f)||90!=f.keyCode&&89!=f.keyCode&&188!=f.keyCode&&190!=f.keyCode&&85!=f.keyCode&&83!=f.keyCode)&&(66!=f.keyCode&&73!=f.keyCode||!this.isControlDown(f)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&+(109!=f.keyCode&&107!=f.keyCode||!this.isControlDown(f)&&!mxEvent.isShiftDown(f)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&y.apply(this,arguments)};n.isEnabledForEvent=function(f){return!mxEvent.isConsumed(f)&&this.isGraphEvent(f)&&this.isEnabled()&&(null==p.dialogs||0==p.dialogs.length)};n.isControlDown=function(f){return mxEvent.isControlDown(f)||mxClient.IS_MAC&&f.metaKey};var B=null,P=u.fireMouseEvent;u.fireMouseEvent=function(f,k,q){f==mxEvent.MOUSE_DOWN&&+d();P.apply(this,arguments)};var G={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},O=n.getFunction;mxKeyHandler.prototype.getFunction=function(f){if(u.isEnabled()){var k=null;mxEvent.isShiftDown(f)&&this.isControlDown(f)&&mxEvent.isAltDown(f)?k=p.actions.get(p.ctrlAltShiftActions[f.keyCode]):mxEvent.isShiftDown(f)&&mxEvent.isAltDown(f)?k=p.actions.get(p.altShiftActions[f.keyCode]):this.isControlDown(f)&&mxEvent.isAltDown(f)?+k=p.actions.get(p.ctrlAltActions[f.keyCode]):mxEvent.isAltDown(f)&&(k=p.actions.get(p.altActions[f.keyCode]));if(null!=k)return k.funct;if("/"==f.key&&!this.isControlDown(f)&&!mxEvent.isAltDown(f))return function(){var q=document.getElementById("geOmniSearch");null!=q&&30<q.clientWidth&&q.focus()};if(null!=G[f.keyCode]&&!u.isSelectionEmpty())if(!this.isControlDown(f)&&mxEvent.isShiftDown(f)&&mxEvent.isAltDown(f)){if(u.model.isVertex(u.getSelectionCell()))return function(){var q=u.connectVertex(u.getSelectionCell(),+G[f.keyCode],u.defaultEdgeLength,f,!0);null!=q&&0<q.length&&(1==q.length&&u.model.isEdge(q[0])?u.setSelectionCell(u.model.getTerminal(q[0],!1)):u.setSelectionCell(q[q.length-1]),u.scrollCellToVisible(u.getSelectionCell()),null!=p.hoverIcons&&p.hoverIcons.update(u.view.getState(u.getSelectionCell())))}}else return this.isControlDown(f)?function(){m(f.keyCode,mxEvent.isShiftDown(f)?u.gridSize:null,!0)}:function(){m(f.keyCode,mxEvent.isShiftDown(f)?u.gridSize:null)}}return O.apply(this,arguments)};n.bindAction=+mxUtils.bind(this,function(f,k,q,x){var C=this.actions.get(q);null!=C&&(q=function(){C.isEnabled()&&C.funct.apply(this,arguments)},k?x?n.bindControlShiftKey(f,q):n.bindControlKey(f,q):x?n.bindShiftKey(f,q):n.bindKey(f,q))});var U=this,c=n.escape;n.escape=function(f){c.apply(this,arguments)};n.enter=function(){};n.bindControlShiftKey(36,function(){u.exitGroup()});n.bindControlShiftKey(35,function(){u.enterGroup()});n.bindShiftKey(36,function(){u.home()});n.bindKey(35,function(){u.refresh()});n.bindAction(80,+!0,"print");n.bindAction(107,!0,"zoomIn");n.bindAction(109,!0,"zoomOut");n.bindAction(61,!0,"zoomIn");n.bindAction(187,!0,"zoomIn");n.bindAction(222,!0,"zoomIn");n.bindAction(173,!0,"zoomOut");n.bindAction(189,!0,"zoomOut");if(!this.editor.chromeless||this.editor.editable)n.bindAction(79,!0,"outline",!0),n.bindControlKey(36,function(){u.isEnabled()&&u.foldCells(!0)}),n.bindControlKey(35,function(){u.isEnabled()&&u.foldCells(!1)}),n.bindControlKey(13,function(){U.ctrlEnter()}),n.bindAction(8,!1,"delete"),n.bindAction(8,!0,"deleteAll"),n.bindAction(8,!1,"deleteLabels",!0),n.bindAction(46,!1,"delete"),n.bindAction(46,!0,"deleteAll"),n.bindAction(46,!1,"deleteLabels",!0),n.bindAction(36,!1,"resetView"),n.bindAction(72,!0,"fitWindow",!0),n.bindAction(74,!0,"fitPage"),n.bindAction(74,!0,"fitTwoPages",!0),n.bindAction(48,!0,"customZoom"),n.bindAction(82,!0,"turn"),n.bindAction(82,!0,"clearDefaultStyle",!0),n.bindAction(83,!0,"save"),n.bindAction(83,!0,"saveAs",!0),n.bindAction(65,!0,"selectAll"),n.bindAction(65,!0,"selectNone",!0),"1"!=urlParams.dev&&n.bindAction(73,!0,"selectVertices",!0),n.bindAction(69,!0,"selectEdges",!0),n.bindAction(69,!0,"editStyle"),n.bindAction(66,!0,"bold"),n.bindAction(66,!0,"toBack",!0),n.bindAction(70,!0,"toFront",!0),n.bindAction(68,!0,"duplicate"),n.bindAction(68,!0,"setAsDefaultStyle",!0),n.bindAction(90,!0,"undo"),n.bindAction(90,!0,"redo",!0),n.bindAction(89,!0,"redo"),n.bindAction(89,!0,"autosize",!0),n.bindAction(88,!0,"cut"),n.bindAction(67,!0,"copy"),n.bindAction(86,!0,"paste"),n.bindAction(71,!0,"group"),n.bindAction(77,!0,"editData"),n.bindAction(71,!0,"grid",!0),n.bindAction(73,!0,"italic"),n.bindAction(76,!0,"lockUnlock"),n.bindAction(76,!0,"layers",!0),n.bindAction(80,!0,"format",!0),n.bindAction(85,!0,"underline"),n.bindAction(85,!0,"ungroup",!0),n.bindAction(109,!0,"decreaseFontSize",!0),n.bindAction(107,!0,"increaseFontSize",!0),n.bindAction(219,!0,"decreaseFontSize",!0),n.bindAction(221,!0,"increaseFontSize",!0),n.bindAction(190,!0,"superscript"),n.bindAction(188,-!0,"subscript"),n.bindAction(13,!1,"keyPressEnter"),n.bindKey(113,function(){v.isEnabled()&&v.startEditingAtCell()});return n};EditorUi.prototype.createMenuElement=function(b,d,m){var p=document.createElement("a");this.addMenuHandler(p,d,m);mxUtils.write(p,b);p.className="geItem";return p};-EditorUi.prototype.addMenuHandler=function(b,d,m,p){if(null!=d){var v=null,n=!0,y=mxUtils.bind(this,function(C){null!=m&&m(C);if(!mxEvent.isConsumed(C)&&n&&(null==b.enabled||b.enabled)){this.editor.graph.popupMenuHandler.hideMenu();var P=new mxPopupMenu(d);P.smartSeparators=!0;P.showDisabled=!0;P.autoExpand=!0;P.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(P,arguments);this.resetCurrentMenu();v=null;P.destroy()});this.menus.autoPopup||null==this.currentMenu||this.hideCurrentMenu();-var G=mxUtils.getOffset(b);P.popup(G.x,G.y+b.offsetHeight,null,C);this.setCurrentMenu(P,b);v=P}p||mxEvent.consume(C)});mxEvent.addListener(b,"mousemove",mxUtils.bind(this,function(C){if(this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=b&&null!=this.currentMenuElt){var P=this.currentMenuElt;this.hideCurrentMenu();P.parentNode==b.parentNode&&"INPUT"!=b.nodeName&&y(C)}}));mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(C){!this.menus.autoPopup&&-null!=this.currentMenu&&this.currentMenuElt!=b&&mxEvent.isMouseEvent(C)&&this.hideCurrentMenu();n=null==this.currentMenu;"INPUT"!=mxEvent.getSource(C).nodeName?C.preventDefault():C.stopPropagation()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(C){y(C);n=!0}));p&&(mxEvent.addListener(b,"focus",mxUtils.bind(this,function(C){y(C);n=!0})),mxEvent.addListener(b,"blur",mxUtils.bind(this,function(C){this.currentMenu==v&&this.hideCurrentMenu()})),mxEvent.addListener(b,"keyup",mxUtils.bind(this,-function(C){38!=C.keyCode&&40!=C.keyCode&&(this.hideCurrentMenu(),13!=C.keyCode&&27!=C.keyCode&&(y(C),n=!0))})))}};-EditorUi.prototype.addShapePicker=function(b,d){var m=this.editor.graph;mxEvent.addListener(b,"click",mxUtils.bind(this,function(p){if(this.isShapePickerVisible())this.hideShapePicker();else{var v=mxUtils.getOffset(b);Editor.inlineFullscreen||null==this.embedViewport?d?(v.x-=this.diagramContainer.offsetLeft+30,v.y=b.offsetHeight-2):(v.x+=16+b.offsetHeight+this.sketchPickerMenuElt.offsetWidth/2,v.y+=20):(v.x=0,v.y=b.offsetTop);this.showShapePicker(Math.max(this.diagramContainer.scrollLeft+Math.max(24,-v.x)),this.diagramContainer.scrollTop+v.y,null,null,null,null,mxUtils.bind(this,function(n){return m.getCenterInsertPoint(m.getBoundingBoxFromGeometry(n,!0))}),d,!1)}mxEvent.consume(p)}))};+!0,"subscript"),n.bindAction(13,!1,"keyPressEnter"),n.bindKey(113,function(){u.isEnabled()&&u.startEditingAtCell()});return n};EditorUi.prototype.createMenuElement=function(b,d,m){var p=document.createElement("a");this.addMenuHandler(p,d,m);mxUtils.write(p,b);p.className="geItem";return p};+EditorUi.prototype.addMenuHandler=function(b,d,m,p){if(null!=d){var u=null,n=!0,y=mxUtils.bind(this,function(B){null!=m&&m(B);if(!mxEvent.isConsumed(B)&&n&&(null==b.enabled||b.enabled)){this.editor.graph.popupMenuHandler.hideMenu();var P=new mxPopupMenu(d);P.smartSeparators=!0;P.showDisabled=!0;P.autoExpand=!0;P.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(P,arguments);this.resetCurrentMenu();u=null;P.destroy()});this.menus.autoPopup||null==this.currentMenu||this.hideCurrentMenu();+var G=mxUtils.getOffset(b);P.popup(G.x,G.y+b.offsetHeight,null,B);this.setCurrentMenu(P,b);u=P}p||mxEvent.consume(B)});mxEvent.addListener(b,"mousemove",mxUtils.bind(this,function(B){if(this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=b&&null!=this.currentMenuElt){var P=this.currentMenuElt;this.hideCurrentMenu();P.parentNode==b.parentNode&&"INPUT"!=b.nodeName&&y(B)}}));mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(B){!this.menus.autoPopup&&+null!=this.currentMenu&&this.currentMenuElt!=b&&mxEvent.isMouseEvent(B)&&this.hideCurrentMenu();n=null==this.currentMenu;"INPUT"!=mxEvent.getSource(B).nodeName?B.preventDefault():B.stopPropagation()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(B){y(B);n=!0}));p&&(mxEvent.addListener(b,"focus",mxUtils.bind(this,function(B){y(B);n=!0})),mxEvent.addListener(b,"blur",mxUtils.bind(this,function(B){this.currentMenu==u&&this.hideCurrentMenu()})),mxEvent.addListener(b,"keyup",mxUtils.bind(this,+function(B){38!=B.keyCode&&40!=B.keyCode&&(this.hideCurrentMenu(),13!=B.keyCode&&27!=B.keyCode&&(y(B),n=!0))})))}};+EditorUi.prototype.addShapePicker=function(b,d){var m=this.editor.graph;mxEvent.addListener(b,"click",mxUtils.bind(this,function(p){if(this.isShapePickerVisible())this.hideShapePicker();else{var u=mxUtils.getOffset(b);Editor.inlineFullscreen||null==this.embedViewport?d?(u.x-=this.diagramContainer.offsetLeft+30,u.y=b.offsetHeight-2):(u.x+=16+b.offsetHeight+this.sketchPickerMenuElt.offsetWidth/2,u.y+=20):(u.x=0,u.y=b.offsetTop);this.showShapePicker(Math.max(this.diagramContainer.scrollLeft+Math.max(24,+u.x)),this.diagramContainer.scrollTop+u.y,null,null,null,null,mxUtils.bind(this,function(n){return m.getCenterInsertPoint(m.getBoundingBoxFromGeometry(n,!0))}),d,!1)}mxEvent.consume(p)}))};EditorUi.prototype.createZoomInput=function(b){var d=document.createElement("input");d.className="geButton geZoomInput";d.style.backgroundImage="url("+Editor.thinExpandImage+")";d.setAttribute("type","text");d.setAttribute("value","100%");var m=this.menus.get("viewZoom");this.dependsOnLanguage(mxUtils.bind(this,function(){d.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)")}));(b||mxClient.IS_TOUCH)&&d.setAttribute("readonly","true");var p=!1;mxEvent.addGestureListeners(d,mxUtils.bind(this,-function(v){p=!1;mxClient.IS_TOUCH||mxEvent.getSource(v)!=d||document.activeElement==d||(d.focus(),mxClient.IS_GC||mxClient.IS_FF?d.select():document.execCommand("selectAll",!1,null),p=!0)}),mxUtils.bind(this,function(v){mxEvent.getSource(v)==d&&p&&mxEvent.consume(v)}),mxUtils.bind(this,function(v){p&&(mxEvent.consume(v),p=!1)}));this.addMenuHandler(d,m.funct);mxUtils.bind(this,function(v){mxEvent.addListener(v,"click",mxUtils.bind(this,function(y){mxEvent.isAltDown(y)?(this.hideCurrentMenu(),this.actions.get("customZoom").funct(),-mxEvent.consume(y)):mxEvent.isShiftDown(y)&&(this.hideCurrentMenu(),this.actions.get("smartFit").funct(),mxEvent.consume(y))}));var n=mxUtils.bind(this,function(y,C,P){d.value=Math.round(100*this.editor.graph.view.scale*(null!=P?P:1))+"%";document.activeElement==d&&this.editor.graph.container.focus()});mxEvent.addListener(d,"keydown",mxUtils.bind(this,function(y){if(27==y.keyCode||13==y.keyCode||9==y.keyCode)27==y.keyCode||isNaN(parseInt(d.value))?n():this.editor.graph.zoomTo(parseInt(d.value)/100),-this.hideCurrentMenu(),mxEvent.consume(y)}));this.editor.graph.view.addListener(mxEvent.EVENT_SCALE,n);this.editor.addListener("resetGraphView",n);this.editor.addListener("pageSelected",n);mxEvent.addListener(d,"blur",n);this.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(y,C){n(y,C,C.getProperty("factor"))}))})(d);return d};+function(u){p=!1;mxClient.IS_TOUCH||mxEvent.getSource(u)!=d||document.activeElement==d||(d.focus(),mxClient.IS_GC||mxClient.IS_FF?d.select():document.execCommand("selectAll",!1,null),p=!0)}),mxUtils.bind(this,function(u){mxEvent.getSource(u)==d&&p&&mxEvent.consume(u)}),mxUtils.bind(this,function(u){p&&(mxEvent.consume(u),p=!1)}));this.addMenuHandler(d,m.funct);mxUtils.bind(this,function(u){mxEvent.addListener(u,"click",mxUtils.bind(this,function(y){mxEvent.isAltDown(y)?(this.hideCurrentMenu(),this.actions.get("customZoom").funct(),+mxEvent.consume(y)):mxEvent.isShiftDown(y)&&(this.hideCurrentMenu(),this.actions.get("smartFit").funct(),mxEvent.consume(y))}));var n=mxUtils.bind(this,function(y,B,P){d.value=Math.round(100*this.editor.graph.view.scale*(null!=P?P:1))+"%";document.activeElement==d&&this.editor.graph.container.focus()});mxEvent.addListener(d,"keydown",mxUtils.bind(this,function(y){if(27==y.keyCode||13==y.keyCode||9==y.keyCode)27==y.keyCode||isNaN(parseInt(d.value))?n():this.editor.graph.zoomTo(parseInt(d.value)/100),+this.hideCurrentMenu(),mxEvent.consume(y)}));this.editor.graph.view.addListener(mxEvent.EVENT_SCALE,n);this.editor.addListener("resetGraphView",n);this.editor.addListener("pageSelected",n);mxEvent.addListener(d,"blur",n);this.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(y,B){n(y,B,B.getProperty("factor"))}))})(d);return d};EditorUi.prototype.createHelpIcon=function(b,d){d=document.createElement("img");d.setAttribute("src",Editor.helpImage);d.setAttribute("title",mxResources.get("help")+" ("+b+")");d.className="geHelpIcon";mxEvent.addGestureListeners(d,mxUtils.bind(this,function(m){this.hideCurrentMenu();this.openLink(b);mxEvent.consume(m)}));return d};EditorUi.prototype.destroy=function(){var b=this.editor.graph;null!=b&&null!=this.selectionStateListener&&(b.getSelectionModel().removeListener(this.selectionStateListener),b.getModel().removeListener(this.selectionStateListener),b.getView().removeListener(this.selectionStateListener),b.removeListener(this.selectionStateListener),this.selectionStateListener=null);null!=this.inlineToolbar&&(this.inlineToolbar.destroy(),this.inlineToolbar=null);null!=this.sidebar&&(this.sidebar.destroy(),this.sidebar=null);null!=this.editor&&(this.editor.destroy(),this.editor=null);null!=this.menubar&&(this.menubar.destroy(),this.menubar=null);null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null);null!=this.keyHandler&&(this.keyHandler.destroy(),this.keyHandler=null);null!=this.keydownHandler&&(mxEvent.removeListener(document,"keydown",this.keydownHandler),this.keydownHandler=null);null!=this.keyupHandler&&(mxEvent.removeListener(document,"keyup",this.keyupHandler),this.keyupHandler=null);null!=this.resizeHandler&&(mxEvent.removeListener(window,"resize",this.resizeHandler),this.resizeHandler=null);null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gestureHandler),this.gestureHandler=null);null!=this.orientationChangeHandler&&(mxEvent.removeListener(window,"orientationchange",this.orientationChangeHandler),this.orientationChangeHandler=null);null!=this.scrollHandler&&(mxEvent.removeListener(window,"scroll",this.scrollHandler),this.scrollHandler=null);if(null!=this.destroyFunctions){for(b=-0;b<this.destroyFunctions.length;b++)this.destroyFunctions[b]();this.destroyFunctions=null}var d=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.hsplit,this.chromelessToolbar,this.layersDialog];for(b=0;b<d.length;b++)null!=d[b]&&null!=d[b].parentNode&&d[b].parentNode.removeChild(d[b])};(function(){var b=[["nbsp","160"],["shy","173"]],d=mxUtils.parseXml;mxUtils.parseXml=function(p){for(var v=0;v<b.length;v++)p=p.replace(new RegExp("&"+b[v][0]+";","g"),"&#"+b[v][1]+";");return d(p)};var m=mxUtils.getSizeForString;mxUtils.getSizeForString=function(p,v,n,y){return m(Graph.sanitizeHtml(p),v,n,y)}})();+0;b<this.destroyFunctions.length;b++)this.destroyFunctions[b]();this.destroyFunctions=null}var d=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.hsplit,this.chromelessToolbar,this.layersDialog];for(b=0;b<d.length;b++)null!=d[b]&&null!=d[b].parentNode&&d[b].parentNode.removeChild(d[b])};(function(){var b=[["nbsp","160"],["shy","173"]],d=mxUtils.parseXml;mxUtils.parseXml=function(p){for(var u=0;u<b.length;u++)p=p.replace(new RegExp("&"+b[u][0]+";","g"),"&#"+b[u][1]+";");return d(p)};var m=mxUtils.getSizeForString;mxUtils.getSizeForString=function(p,u,n,y){return m(Graph.sanitizeHtml(p),u,n,y)}})();Date.prototype.toISOString||function(){function b(d){d=String(d);1===d.length&&(d="0"+d);return d}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+b(this.getUTCMonth()+1)+"-"+b(this.getUTCDate())+"T"+b(this.getUTCHours())+":"+b(this.getUTCMinutes())+":"+b(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1E3).toFixed(3)).slice(2,5)+"Z"}}();Date.now||(Date.now=function(){return(new Date).getTime()});-Uint8Array.from||(Uint8Array.from=function(){var b=Object.prototype.toString,d=function(p){return"function"===typeof p||"[object Function]"===b.call(p)},m=Math.pow(2,53)-1;return function(p){var v=Object(p);if(null==p)throw new TypeError("Array.from requires an array-like object - not null or undefined");var n=1<arguments.length?arguments[1]:void 0,y;if("undefined"!==typeof n){if(!d(n))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(y=-arguments[2])}var C=Number(v.length);C=isNaN(C)?0:0!==C&&isFinite(C)?(0<C?1:-1)*Math.floor(Math.abs(C)):C;C=Math.min(Math.max(C,0),m);for(var P=d(this)?Object(new this(C)):Array(C),G=0,O;G<C;)O=v[G],P[G]=n?"undefined"===typeof y?n(O,G):n.call(y,O,G):O,G+=1;P.length=C;return P}}());mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxCodec.allowlist="mxStylesheet Array mxGraphModel mxCell mxGeometry mxRectangle mxPoint mxChildChange mxRootChange mxTerminalChange mxValueChange mxStyleChange mxGeometryChange mxCollapseChange mxVisibleChange mxCellAttributeChange".split(" ");+Uint8Array.from||(Uint8Array.from=function(){var b=Object.prototype.toString,d=function(p){return"function"===typeof p||"[object Function]"===b.call(p)},m=Math.pow(2,53)-1;return function(p){var u=Object(p);if(null==p)throw new TypeError("Array.from requires an array-like object - not null or undefined");var n=1<arguments.length?arguments[1]:void 0,y;if("undefined"!==typeof n){if(!d(n))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(y=+arguments[2])}var B=Number(u.length);B=isNaN(B)?0:0!==B&&isFinite(B)?(0<B?1:-1)*Math.floor(Math.abs(B)):B;B=Math.min(Math.max(B,0),m);for(var P=d(this)?Object(new this(B)):Array(B),G=0,O;G<B;)O=u[G],P[G]=n?"undefined"===typeof y?n(O,G):n.call(y,O,G):O,G+=1;P.length=B;return P}}());mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxCodec.allowlist="mxStylesheet Array mxGraphModel mxCell mxGeometry mxRectangle mxPoint mxChildChange mxRootChange mxTerminalChange mxValueChange mxStyleChange mxGeometryChange mxCollapseChange mxVisibleChange mxCellAttributeChange".split(" ");mxGraph.prototype.pageBreakColor="#c0c0c0";mxGraph.prototype.pageScale=1;(function(){try{if(null!=navigator&&null!=navigator.language){var b=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===b||"en-ca"===b||"es-mx"===b?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(d){}})();mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;mxGraphView.prototype.gridImage="data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.defaultGridColor="#e6e6e6";mxGraphView.prototype.defaultDarkGridColor="#424242";mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultGridColor;mxGraphView.prototype.unit=mxConstants.POINTS;mxGraphView.prototype.setUnit=function(b){this.unit!=b&&(this.unit=b,this.graph.refresh(),this.fireEvent(new mxEventObject("unitChanged","unit",b)))};mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]";mxShape.prototype.getConstraints=function(b,d,m){return null};mxImageShape.prototype.getImageDataUri=function(b){var d=String(this.image);if("data:image/svg+xml;base64,"==d.substring(0,26)&&null!=this.style){if("1"==mxUtils.getValue(this.style,"clipSvg","0")){if(null==this.clippedSvg||this.clippedImage!=d)this.clippedSvg=Graph.clipSvgDataUri(d),this.clippedImage=d;d=this.clippedSvg}if(null==b||null==b.createImageSymbol){if(b=Graph.getCssVariables(this.style),null!=b){if(null==this.themedSvg||this.themedImage!=d||this.themedVars!=b)this.themedSvg=Graph.setSvgDataUriCssVars(d,b),this.themedImage=d,this.themedVars=b;d=this.themedSvg}}else if(b=mxUtils.getValue(this.style,"editableCssRules",null),null!=b){if(void 0===this.canonicalSvg||this.canonicalImage!=d||this.canonicalRules!=b)this.canonicalSvg=Graph.canonicalizeSvgCssRules(d,b),this.canonicalImage=d,this.canonicalRules=b;null!=this.canonicalSvg&&(d=this.canonicalSvg.uri)}}return d};mxImageShape.prototype.getImageCssVars=function(b){var d=String(this.image),m=null;null!=this.style&&("data:"!=d.substring(0,5)?Graph.isSameOrigin(d)&&(m=Graph.getCssVariables(this.style)):null!=b&&null!=b.createImageSymbol&&"data:image/svg+xml;base64,"==d.substring(0,26)&&(b=[],null!=this.canonicalSvg&&this.canonicalRules==mxUtils.getValue(this.style,"editableCssRules",null)&&b.push(this.canonicalSvg.vars),null!=mxUtils.getValue(this.style,"cssVars",null)&&(d=Graph.getCssVariables(this.style),null!=-d?b.push(d):0==b.length&&(m="")),0<b.length&&(m=b.join("; "))));return m};(function(){var b=mxStencil.prototype.parseColor;mxStencil.prototype.parseColor=function(d,m,p,v,n){return"default"==v&&null!=n?"fillcolor"==p.nodeName?n.shapeBackgroundColor:n.shapeForegroundColor:b.apply(this,arguments)}})();(function(){var b=mxResources.get;mxResources.get=function(d,m,p){null==p&&(p=d);return b.apply(this,[d,m,p])}})();-(function(){var b=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(d,m,p,v,n,y,C,P){var G=b.apply(this,arguments);if(null!=m){var O=G.getElementsByTagName("img");0<O.length&&(O[0].className="geButton")}return G}})();-Graph=function(b,d,m,p,v,n){mxGraph.call(this,b,d,m,p);this.themes=v||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=n?n:!1;b=this.baseUrl;d=b.indexOf("//");this.domainPathUrl=this.domainUrl="";0<d&&(d=b.indexOf("/",d+2),0<d&&(this.domainUrl=b.substring(0,d)),d=b.lastIndexOf("/"),0<d&&(this.domainPathUrl=b.substring(0,d+1)));this.isHtmlLabel=function(l){l=this.getCurrentCellStyle(l);-return null!=l?"1"==l.html||"wrap"==l[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var y=null,C=null,P=null,G=null,O=!1,U=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(l,t){if("mouseDown"==t.getProperty("eventName")&&this.isEnabled()){l=t.getProperty("event");var H=l.getState();t=this.view.scale;if(!mxEvent.isAltDown(l.getEvent())&&null!=H&&(U=this.isCellSelected(H.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(l.getEvent()))){var J=this.selectionCellsHandler.getHandler(H.cell);+d?b.push(d):0==b.length&&(m="")),0<b.length&&(m=b.join("; "))));return m};(function(){var b=mxStencil.prototype.parseColor;mxStencil.prototype.parseColor=function(d,m,p,u,n){return"default"==u&&null!=n?"fillcolor"==p.nodeName?n.shapeBackgroundColor:n.shapeForegroundColor:b.apply(this,arguments)}})();(function(){var b=mxResources.get;mxResources.get=function(d,m,p){null==p&&(p=d);return b.apply(this,[d,m,p])}})();+(function(){var b=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(d,m,p,u,n,y,B,P){var G=b.apply(this,arguments);if(null!=m){var O=G.getElementsByTagName("img");0<O.length&&(O[0].className="geButton")}return G}})();+Graph=function(b,d,m,p,u,n){mxGraph.call(this,b,d,m,p);this.themes=u||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=n?n:!1;b=this.baseUrl;d=b.indexOf("//");this.domainPathUrl=this.domainUrl="";0<d&&(d=b.indexOf("/",d+2),0<d&&(this.domainUrl=b.substring(0,d)),d=b.lastIndexOf("/"),0<d&&(this.domainPathUrl=b.substring(0,d+1)));this.isHtmlLabel=function(l){l=this.getCurrentCellStyle(l);+return null!=l?"1"==l.html||"wrap"==l[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var y=null,B=null,P=null,G=null,O=!1,U=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(l,t){if("mouseDown"==t.getProperty("eventName")&&this.isEnabled()){l=t.getProperty("event");var H=l.getState();t=this.view.scale;if(!mxEvent.isAltDown(l.getEvent())&&null!=H&&(U=this.isCellSelected(H.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(l.getEvent()))){var J=this.selectionCellsHandler.getHandler(H.cell);if(null==J||null==J.getHandleForEvent(l)){var R=new mxRectangle(l.getGraphX()-1,l.getGraphY()-1),T=mxEvent.isTouchEvent(l.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;J=T+2;R.grow(T);if(this.isTableCell(H.cell)&&this.isCellMovable(H.cell)&&!this.isCellSelected(H.cell)&&!(mxUtils.contains(H,l.getGraphX()-J,l.getGraphY()-J)&&mxUtils.contains(H,l.getGraphX()-J,l.getGraphY()+J)&&mxUtils.contains(H,l.getGraphX()+J,l.getGraphY()+J)&&mxUtils.contains(H,l.getGraphX()+J,l.getGraphY()-J))){var Y=this.model.getParent(H.cell);J=this.model.getParent(Y);if(!this.isCellSelected(J)){T*=t;var Z=2*T;if(this.model.getChildAt(J,0)!=Y&&mxUtils.intersects(R,new mxRectangle(H.x,H.y-T,H.width,Z))||this.model.getChildAt(Y,0)!=H.cell&&mxUtils.intersects(R,new mxRectangle(H.x-T,H.y,Z,H.height))||mxUtils.intersects(R,new mxRectangle(H.x,H.y+H.height-T,H.width,Z))||mxUtils.intersects(R,new mxRectangle(H.x+H.width-T,H.y,Z,H.height)))Y=this.selectionCellsHandler.isHandled(J),this.selectCellForEvent(J,l.getEvent()),J=this.selectionCellsHandler.getHandler(J),null!=J&&(T=J.getHandleForEvent(l),null!=T&&(J.start(l.getGraphX(),l.getGraphY(),T),J.blockDelayedSelection=!Y,l.consume()))}}for(;!l.isConsumed()&&null!=H&&(this.isTableCell(H.cell)||this.isTableRow(H.cell)||this.isTable(H.cell));)this.isSwimlane(H.cell)&&this.isCellMovable(H.cell)&&(J=this.getActualStartSize(H.cell),(0<J.x||0<J.width)&&mxUtils.intersects(R,new mxRectangle(H.x+(J.x-J.width-1)*t+(0==J.x?H.width:0),H.y,1,H.height))||(0<J.y||0<J.height)&&mxUtils.intersects(R,new mxRectangle(H.x,H.y+(J.y-J.height-1)*t+(0==J.y?H.height:0),H.width,1)))&&(this.selectCellForEvent(H.cell,l.getEvent()),J=this.selectionCellsHandler.getHandler(H.cell),null!=J&&null!=J.customHandles&&(T=mxEvent.CUSTOM_HANDLE-J.customHandles.length+1,J.start(l.getGraphX(),l.getGraphY(),T),l.consume())),H=this.view.getState(this.model.getParent(H.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,mxUtils.bind(this,function(l,t){if("mouseDown"==t.getProperty("eventName")&&-this.isEnabled()){l=t.getProperty("event");var H=l.getState();mxEvent.isAltDown(l.getEvent())||mxEvent.isControlDown(t)||mxEvent.isShiftDown(t)||U||null==H||!this.model.isEdge(H.cell)||(y=new mxPoint(l.getGraphX(),l.getGraphY()),O=this.isCellSelected(H.cell),P=H,C=l,null!=H.text&&null!=H.text.boundingBox&&mxUtils.contains(H.text.boundingBox,l.getGraphX(),l.getGraphY())?G=mxEvent.LABEL_HANDLE:(t=this.selectionCellsHandler.getHandler(H.cell),null!=t&&null!=t.bends&&0<t.bends.length&&(G=t.getHandleForEvent(l))))}}));-this.addMouseListener({mouseDown:function(l,t){},mouseMove:mxUtils.bind(this,function(l,t){l=this.selectionCellsHandler.handlers.map;for(var H in l)if(null!=l[H].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(t.getEvent())){var J=this.tolerance;if(null!=y&&null!=P&&null!=C){if(H=P,null!=G||Math.abs(y.x-t.getGraphX())>J||Math.abs(y.y-t.getGraphY())>J){var R=null;mxEvent.isShiftDown(t.getEvent())||(R=this.selectionCellsHandler.getHandler(H.cell));if(null!=R&&null!=-R.bends&&0<R.bends.length){R.redrawHandles();var T=null!=G?G:R.getHandleForEvent(C),Y=this.view.getEdgeStyle(H),Z=Y==mxEdgeStyle.EntityRelation;J=H.absolutePoints;O||(T=G);T!=mxEvent.LABEL_HANDLE&&null!=J&&(T=G,null==T&&(l=new mxRectangle(y.x,y.y),l.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(l,J[0].x,J[0].y)?T=0:mxUtils.contains(l,J[J.length-1].x,J[J.length-1].y)?T=R.bends.length-1:null!=J&&(null==Y&&null==T||Y==mxEdgeStyle.SegmentConnector||Y==mxEdgeStyle.OrthConnector)&&+this.isEnabled()){l=t.getProperty("event");var H=l.getState();mxEvent.isAltDown(l.getEvent())||mxEvent.isControlDown(t)||mxEvent.isShiftDown(t)||U||null==H||!this.model.isEdge(H.cell)||(y=new mxPoint(l.getGraphX(),l.getGraphY()),O=this.isCellSelected(H.cell),P=H,B=l,null!=H.text&&null!=H.text.boundingBox&&mxUtils.contains(H.text.boundingBox,l.getGraphX(),l.getGraphY())?G=mxEvent.LABEL_HANDLE:(t=this.selectionCellsHandler.getHandler(H.cell),null!=t&&null!=t.bends&&0<t.bends.length&&(G=t.getHandleForEvent(l))))}}));+this.addMouseListener({mouseDown:function(l,t){},mouseMove:mxUtils.bind(this,function(l,t){l=this.selectionCellsHandler.handlers.map;for(var H in l)if(null!=l[H].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(t.getEvent())){var J=this.tolerance;if(null!=y&&null!=P&&null!=B){if(H=P,null!=G||Math.abs(y.x-t.getGraphX())>J||Math.abs(y.y-t.getGraphY())>J){var R=null;mxEvent.isShiftDown(t.getEvent())||(R=this.selectionCellsHandler.getHandler(H.cell));if(null!=R&&null!=+R.bends&&0<R.bends.length){R.redrawHandles();var T=null!=G?G:R.getHandleForEvent(B),Y=this.view.getEdgeStyle(H),Z=Y==mxEdgeStyle.EntityRelation;J=H.absolutePoints;O||(T=G);T!=mxEvent.LABEL_HANDLE&&null!=J&&(T=G,null==T&&(l=new mxRectangle(y.x,y.y),l.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(l,J[0].x,J[0].y)?T=0:mxUtils.contains(l,J[J.length-1].x,J[J.length-1].y)?T=R.bends.length-1:null!=J&&(null==Y&&null==T||Y==mxEdgeStyle.SegmentConnector||Y==mxEdgeStyle.OrthConnector)&&(null!=Y&&(2==J.length||3==J.length&&(0==Math.round(J[0].x-J[1].x)&&0==Math.round(J[1].x-J[2].x)||0==Math.round(J[0].y-J[1].y)&&0==Math.round(J[1].y-J[2].y)))?T=2:(T=mxUtils.findNearestSegment(H,y.x,y.y),T=null==Y?mxEvent.VIRTUAL_HANDLE-T:T+1))),null==T&&(T=mxEvent.VIRTUAL_HANDLE));l=T==mxEvent.LABEL_HANDLE||0==T||T==R.bends.length-1;if(!Z&&(null!=H.visibleSourceState||null!=H.visibleTargetState)||l)R.start(t.getGraphX(),t.getGraphX(),T),t.consume(),this.graphHandler.reset()}null!=R&&(this.selectionCellsHandler.isHandlerActive(R)?-this.isCellSelected(H.cell)||(this.selectionCellsHandler.handlers.put(H.cell,R),this.selectCellForEvent(H.cell,t.getEvent())):this.isCellSelected(H.cell)||R.destroy());O=!1;y=C=P=G=null}}else if(H=t.getState(),null!=H&&this.isCellEditable(H.cell)){l=this.model.getParent(H.cell);R=null;if(this.model.isEdge(H.cell)&&!this.isCellSelected(H.cell)&&!mxEvent.isAltDown(t.getEvent())&&!mxEvent.isShiftDown(t.getEvent())&&!this.isAncestorSelected(H.cell)&&(this.isSwimlane(l)||this.model.isLayer(l)||this.getCurrentRoot()==+this.isCellSelected(H.cell)||(this.selectionCellsHandler.handlers.put(H.cell,R),this.selectCellForEvent(H.cell,t.getEvent())):this.isCellSelected(H.cell)||R.destroy());O=!1;y=B=P=G=null}}else if(H=t.getState(),null!=H&&this.isCellEditable(H.cell)){l=this.model.getParent(H.cell);R=null;if(this.model.isEdge(H.cell)&&!this.isCellSelected(H.cell)&&!mxEvent.isAltDown(t.getEvent())&&!mxEvent.isShiftDown(t.getEvent())&&!this.isAncestorSelected(H.cell)&&(this.isSwimlane(l)||this.model.isLayer(l)||this.getCurrentRoot()==l)){if(l=new mxRectangle(t.getGraphX(),t.getGraphY()),l.grow(mxEdgeHandler.prototype.handleImage.width/2),J=H.absolutePoints,null!=J)null!=H.text&&null!=H.text.boundingBox&&mxUtils.contains(H.text.boundingBox,t.getGraphX(),t.getGraphY())?R="move":mxUtils.contains(l,J[0].x,J[0].y)||mxUtils.contains(l,J[J.length-1].x,J[J.length-1].y)?R="pointer":(Y=this.view.getEdgeStyle(H),Y==mxEdgeStyle.EntityRelation||null==H.visibleSourceState&&null==H.visibleTargetState||(R="crosshair",Y!=mxEdgeStyle.SegmentConnector&&Y!=mxEdgeStyle.OrthConnector))||(t=mxUtils.findNearestSegment(H,t.getGraphX(),t.getGraphY()),t<J.length-1&&0<=t&&(R=0==Math.round(J[t].x-J[t+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(t.getEvent())){J=mxShape.prototype.svgStrokeTolerance/2;l=new mxRectangle(t.getGraphX(),t.getGraphY());l.grow(J);if(this.isTableCell(H.cell)&&this.isCellMovable(H.cell)&&(t=this.model.getParent(H.cell),J=this.model.getParent(t),!this.isCellSelected(J)))if(mxUtils.intersects(l,new mxRectangle(H.x,H.y-2,H.width,4))&&this.model.getChildAt(J,0)!=t||mxUtils.intersects(l,new mxRectangle(H.x,H.y+H.height-2,H.width,4)))R="row-resize";else if(mxUtils.intersects(l,new mxRectangle(H.x-2,H.y,4,H.height))&&this.model.getChildAt(t,0)!=H.cell||mxUtils.intersects(l,new mxRectangle(H.x+H.width-2,H.y,4,H.height)))R="col-resize";for(t=H;null==R&&null!=t&&(this.isTableCell(t.cell)||this.isTableRow(t.cell)||this.isTable(t.cell));)this.isSwimlane(t.cell)&&this.isCellMovable(t.cell)&&(J=this.getActualStartSize(t.cell),-T=this.view.scale,(0<J.x||0<J.width)&&mxUtils.intersects(l,new mxRectangle(t.x+(J.x-J.width-1)*T+(0==J.x?t.width*T:0),t.y,1,t.height))?R="col-resize":(0<J.y||0<J.height)&&mxUtils.intersects(l,new mxRectangle(t.x,t.y+(J.y-J.height-1)*T+(0==J.y?t.height:0),t.width,1))&&(R="row-resize")),t=this.view.getState(this.model.getParent(t.cell))}null!=R&&H.setCursor(R)}}}),mouseUp:mxUtils.bind(this,function(l,t){G=y=C=P=null})})}this.cellRenderer.minSvgStrokeWidth=.1;var c=document.createElement("div");this.cellRenderer.getLabelValue=+T=this.view.scale,(0<J.x||0<J.width)&&mxUtils.intersects(l,new mxRectangle(t.x+(J.x-J.width-1)*T+(0==J.x?t.width*T:0),t.y,1,t.height))?R="col-resize":(0<J.y||0<J.height)&&mxUtils.intersects(l,new mxRectangle(t.x,t.y+(J.y-J.height-1)*T+(0==J.y?t.height:0),t.width,1))&&(R="row-resize")),t=this.view.getState(this.model.getParent(t.cell))}null!=R&&H.setCursor(R)}}}),mouseUp:mxUtils.bind(this,function(l,t){G=y=B=P=null})})}this.cellRenderer.minSvgStrokeWidth=.1;var c=document.createElement("div");this.cellRenderer.getLabelValue=function(l){var t=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);l.view.graph.isHtmlLabel(l.cell)&&("0"==mxUtils.getValue(l.style,"html","0")?t=mxUtils.htmlEntities(t,!1):(l.lastLabelValue!=t&&(l.lastLabelValue=t,l.lastSanitizedLabelValue=Graph.sanitizeHtml(t),c.innerHTML=l.lastSanitizedLabelValue,Graph.addLightDarkColors(c,null,"simple"==l.view.graph.getAdaptiveColors())&&(l.lastSanitizedLabelValue=c.innerHTML)),t=l.lastSanitizedLabelValue));return t};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(l,t){return!1};this.alternateEdgeStyle="vertical";null==p&&this.loadStylesheet();var f=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var l=f.apply(this,arguments);if(this.graph.pageVisible){var t=[],H=this.graph.pageFormat,J=this.graph.pageScale,R=H.width*J;H=H.height*J;J=this.graph.view.translate;for(var T=this.graph.view.scale,Y=this.graph.getPageLayout(),Z=0;Z<Y.width;Z++)t.push(new mxRectangle(((Y.x+Z)*R+J.x)*T,(Y.y*H+J.y)*T,R*T,H*T));for(Z=1;Z<Y.height;Z++)t.push(new mxRectangle((Y.x*R+J.x)*T,((Y.y+Z)*H+J.y)*T,R*T,H*T));l=t.concat(l)}return l};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(l,t){return null==l.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(l){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var k=this.graphHandler.getCells;this.graphHandler.getCells=function(l){for(var t=k.apply(this,arguments),H=new mxDictionary,J=[],R=0;R<t.length;R++){var T=this.graph.isTableCell(l)&&this.graph.isTableCell(t[R])&&this.graph.isCellSelected(t[R])?this.graph.model.getParent(t[R]):this.graph.isTableRow(l)&&this.graph.isTableRow(t[R])&&this.graph.isCellSelected(t[R])?t[R]:this.graph.getCompositeParent(t[R]);null==T||H.get(T)||(H.put(T,!0),J.push(T))}return J};var q=this.graphHandler.start;this.graphHandler.start=function(l,t,H,J){var R=!1;this.graph.isTableCell(l)&&(this.graph.isCellSelected(l)?R=!0:l=this.graph.model.getParent(l));R||this.graph.isTableRow(l)&&this.graph.isCellSelected(l)||(l=this.graph.getCompositeParent(l));q.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(l,t){t=this.graph.getCompositeParent(t);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(l,t,H,J,R,T){var Y=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=J&&this.graph.applyNewEdgeStyle(J,[Y]);return Y};var x=new mxRubberband(this);this.getRubberband=function(){return x};-var B=(new Date).getTime(),E=0,L=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var l=this.currentState;L.apply(this,arguments);l!=this.currentState?(B=(new Date).getTime(),E=0):E=(new Date).getTime()-B};var Q=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(l){return mxEvent.isShiftDown(l.getEvent())&&mxEvent.isAltDown(l.getEvent())?!1:null!=this.currentState&&l.getState()==this.currentState&&2E3<E||(null==this.currentState||+var C=(new Date).getTime(),E=0,L=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var l=this.currentState;L.apply(this,arguments);l!=this.currentState?(C=(new Date).getTime(),E=0):E=(new Date).getTime()-C};var Q=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(l){return mxEvent.isShiftDown(l.getEvent())&&mxEvent.isAltDown(l.getEvent())?!1:null!=this.currentState&&l.getState()==this.currentState&&2E3<E||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&Q.apply(this,arguments)};var V=this.isToggleEvent;this.isToggleEvent=function(l){return V.apply(this,arguments)||mxEvent.isShiftDown(l)};var K=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(K=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=K)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(l){return mxEvent.isMouseEvent(l.getEvent())};var fa=this.click;this.click=function(l){var t=null==l.state&&null!=l.sourceState&&this.isCellLocked(this.getLayerForCell(l.sourceState.cell));if(this.isEnabled()&&!t||l.isConsumed())return fa.apply(this,arguments);var H=t?l.sourceState.cell:l.getCell();if(null!=H){var J=this.getClickableLinkForCell(H);null!=J?this.isCustomLink(J)?this.customLinkClicked(J,H):this.openLink(J):t&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=function(l){return l.sourceState};var aa=this.tooltipHandler.show;this.tooltipHandler.show=function(){aa.apply(this,arguments);if(null!=this.div)for(var l=this.div.getElementsByTagName("a"),t=0;t<l.length;t++)null!=l[t].getAttribute("href")&&null==l[t].getAttribute("target")&&l[t].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(l){return l.sourceState};this.getCursorForMouseEvent=function(l){var t=null==@@ -2448,175 +2448,175 @@ Graph.cellStyles=mxUtils.addItems(mxUtils.addItems(mxUtils.addItems("rounded shaGraph.edgeStyles),Graph.cellStyleGroups);Graph.layoutNames="mxHierarchicalLayout mxCircleLayout mxCompactTreeLayout mxEdgeLabelLayout mxFastOrganicLayout mxParallelEdgeLayout mxPartitionLayout mxRadialTreeLayout mxStackLayout elkLayered elkTree elkRadial elkOrganic elkStress elkDisco elkBox".split(" ");Graph.elkLayoutAlgorithms={elkLayered:"layered",elkTree:"mrtree",elkRadial:"radial",elkOrganic:"force",elkStress:"stress",elkDisco:"disco",elkBox:"box"};Graph.elkLayoutNameForAlgorithm=function(b){for(var d in Graph.elkLayoutAlgorithms)if(Graph.elkLayoutAlgorithms[d]===b)return d;return null};Graph.backupStyleAttribute="data-mx-given-colors";Graph.newColorPlaceholder="rgba(0, 0, 0, 0)";Graph.newBackgroundPlaceholder="rgb(0, 0, 0)";Graph.defaultAdaptiveColors="0"==urlParams.contrast?"simple":"auto";Graph.getDefaultAdaptiveColorsKey=function(){return"auto"==Graph.defaultAdaptiveColors?"automatic":Graph.defaultAdaptiveColors};Graph.createOffscreenGraph=function(b){var d=new Graph(document.createElement("div"));d.stylesheet.styles=mxUtils.clone(b.styles);d.resetViewOnRootChange=!1;d.setConnectable(!1);d.gridEnabled=!1;d.autoScroll=!1;d.setTooltips(!1);d.setEnabled(!1);d.container.style.visibility="hidden";d.container.style.position="absolute";d.container.style.overflow="hidden";d.container.style.height="1px";d.container.style.width="1px";return d};-Graph.createSvgImage=function(b,d,m,p,v){m=unescape(encodeURIComponent(Graph.svgDoctype+'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+b+'px" height="'+d+'px" '+(null!=p&&null!=v?'viewBox="0 0 '+p+" "+v+'" ':"")+'version="1.1" style="color-scheme: light dark;">'+m+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(m):Base64.encode(m,!0)),b,d)};+Graph.createSvgImage=function(b,d,m,p,u){m=unescape(encodeURIComponent(Graph.svgDoctype+'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+b+'px" height="'+d+'px" '+(null!=p&&null!=u?'viewBox="0 0 '+p+" "+u+'" ':"")+'version="1.1" style="color-scheme: light dark;">'+m+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(m):Base64.encode(m,!0)),b,d)};Graph.getSvgFromDataUri=function(b){return null!=b&&"data:image/svg"==b.substring(0,14)?Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+decodeURIComponent(escape(atob(b.substring(b.indexOf(",")+1)))):null};Graph.svgBackgroundVar="--ge-adaptive-bg";-Graph.createSvgNode=function(b,d,m,p,v){var n=mxUtils.createXmlDocument(),y=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=v&&y.setAttribute("style","background: "+v.light+"; background-color: "+v.cssText+";");null==n.createElementNS?(y.setAttribute("xmlns",mxConstants.NS_SVG),y.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):y.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);y.setAttribute("version","1.1");y.setAttribute("width",+Graph.createSvgNode=function(b,d,m,p,u){var n=mxUtils.createXmlDocument(),y=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=u&&y.setAttribute("style","background: "+u.light+"; background-color: "+u.cssText+";");null==n.createElementNS?(y.setAttribute("xmlns",mxConstants.NS_SVG),y.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):y.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);y.setAttribute("version","1.1");y.setAttribute("width",m+"px");y.setAttribute("height",p+"px");y.setAttribute("viewBox",b+" "+d+" "+m+" "+p);n.appendChild(y);return y};-Graph.addAdaptiveColors=function(b,d){if(mxUtils.lightDarkColorSupported&&(d=mxUtils.getLightDarkColor(d),!(0>d.cssText.indexOf("var(")))){for(var m="var("+Graph.svgBackgroundVar+", "+d.light+")",p=b.getElementsByTagName("*"),v=[b],n=!1,y=0;y<p.length;y++)v.push(p[y]);for(y=0;y<v.length;y++)p=v[y].getAttribute("style"),null!=p&&0<=p.indexOf(d.cssText)&&(v[y].setAttribute("style",p.split(d.cssText).join(m)),n=!0);if(n){m=b.ownerDocument;v=b.getAttribute("id");if(null==v||""==v)v="ge-svg-"+Editor.guid(),-b.setAttribute("id",v);n=null!=m.createElementNS?m.createElementNS(mxConstants.NS_SVG,"style"):m.createElement("style");n.setAttribute("type","text/css");n.appendChild(m.createTextNode("@supports (color: light-dark(#000, #fff)) { #"+v+" { "+Graph.svgBackgroundVar+": "+d.cssText+"; } }"));b.insertBefore(n,b.firstChild)}}};-Graph.htmlToPng=function(b,d,m,p,v,n){v=null!=v?v:"";n=null!=n?n:Editor.htmlRasterScale;var y=document.createElement("canvas");y.width=d*n;y.height=m*n;var C=document.createElement("img");C.onload=mxUtils.bind(this,function(){try{var G=y.getContext("2d");G.scale(n,n);G.drawImage(C,0,0);p(y.toDataURL())}catch(O){p(null)}});var P=mxUtils.createXmlDocument();P=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"svg"):P.createElement("svg");b=(new mxSvgCanvas2D(P)).convertHtml(b);C.onerror=-function(G){p(null)};C.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+d+'" height="'+m+'">'+(""!=v?'<defs xmlns="http://www.w3.org/2000/svg"><style type="text/css">'+v+"</style></defs>":"")+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+b+"</div></foreignObject></svg>")};-Graph.addLightDarkColors=function(b,d,m,p){function v(c,f,k){return null!=p?p(c,f,k):mxUtils.isValidColor(k)?(null==y&&null!=d&&(y={}),null!=y&&(y[f]=c.style.getPropertyValue(f)),k=mxUtils.getLightDarkColor(k,null,null,m),c.style.setProperty(f,k.cssText),!0):!1}for(var n=b.getElementsByTagName("*"),y=null,C=!1,P=0;P<n.length;P++)if(n[P]!=b&&null!=n[P].style){y=null;for(var G=0;G<n[P].style.length;G++){var O=n[P].style.item(G),U=n[P].style.getPropertyValue(O);C=v(n[P],O,U)||C}"FONT"==n[P].nodeName&&-""==n[P].style.getPropertyValue("color")&&(U=n[P].getAttribute("color"),C=v(n[P],"color",U)||C);null!=d&&null!=y&&n[P].setAttribute(d,JSON.stringify(y))}return C};Graph.removeLightDarkColors=function(b,d){b=b.getElementsByTagName("*");for(var m=!1,p=0;p<b.length;p++)try{var v=b[p].getAttribute(d);if(null!=v){b[p].removeAttribute(d);var n=JSON.parse(v),y;for(y in n){var C=n[y];""==C?(b[p].style[y]=null,""==b[p].getAttribute("style")&&b[p].removeAttribute("style")):b[p].style[y]=C;m=!0}}}catch(P){}return m};-Graph.getGivenColor=function(b,d){var m=null;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){try{var p=b.getAttribute(Graph.backupStyleAttribute);if(null!=p){var v=JSON.parse(p);null!=v&&null!=v[d]&&("color"==d&&"FONT"==b.nodeName&&""==v[d]&&null!=b.getAttribute("color")?m=b.getAttribute("color"):""!=v[d]&&(m=v[d]))}}catch(n){}null==m&&""!=b.style[d]&&(m=b.style[d])}return m};-Graph.setTextColor=function(b,d,m){for(var p=m?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,v=m?"color":"background-color",n=b.getElementsByTagName("*"),y=[],C=0;C<n.length;C++)y.push({node:n[C],value:n[C].style[v]});C=document.queryCommandState("styleWithCSS");m&&!C&&document.execCommand("styleWithCSS",!1,!0);document.execCommand(m?"forecolor":"backcolor",!1,p);m&&!C&&document.execCommand("styleWithCSS",!1,!1);b=b.getElementsByTagName("*");for(C=0;C<b.length;C++){if(C<y.length&&y[C].node==-b[C]&&y[C].value!=b[C].style[v]&&""==b[C].style[v])try{if(n=b[C].getAttribute(Graph.backupStyleAttribute),null!=n){var P=JSON.parse(n);P[v]="";b[C].setAttribute(Graph.backupStyleAttribute,JSON.stringify(P))}}catch(G){}if(m&&b[C].getAttribute("color")==p||b[C].style[v]==p){m&&b[C].getAttribute("color")==p&&b[C].removeAttribute("color");b[C].style[v]=d!=mxConstants.NONE?mxUtils.getLightDarkColor(d).cssText:null;try{n=b[C].getAttribute(Graph.backupStyleAttribute),P=null!=n?JSON.parse(n):{},P[v]=d!=mxConstants.NONE?-d:"",b[C].setAttribute(Graph.backupStyleAttribute,JSON.stringify(P))}catch(G){}if(m&&mxClient.IS_FF){d=b[C];m=d.firstChild;if(null!=m&&"A"==m.nodeName&&null==m.nextSibling&&null!=m.firstChild){d.parentNode.insertBefore(m,d);for(p=m.firstChild;null!=p;)v=p.nextSibling,d.appendChild(p),p=v;m.appendChild(d)}break}}}};Graph.zapGremlins=function(b){return mxUtils.zapGremlins(b)};Graph.stringToBytes=function(b){for(var d=Array(b.length),m=0;m<b.length;m++)d[m]=b.charCodeAt(m);return d};+Graph.addAdaptiveColors=function(b,d){if(mxUtils.lightDarkColorSupported&&(d=mxUtils.getLightDarkColor(d),!(0>d.cssText.indexOf("var(")))){for(var m="var("+Graph.svgBackgroundVar+", "+d.light+")",p=b.getElementsByTagName("*"),u=[b],n=!1,y=0;y<p.length;y++)u.push(p[y]);for(y=0;y<u.length;y++)p=u[y].getAttribute("style"),null!=p&&0<=p.indexOf(d.cssText)&&(u[y].setAttribute("style",p.split(d.cssText).join(m)),n=!0);if(n){m=b.ownerDocument;u=b.getAttribute("id");if(null==u||""==u)u="ge-svg-"+Editor.guid(),+b.setAttribute("id",u);n=null!=m.createElementNS?m.createElementNS(mxConstants.NS_SVG,"style"):m.createElement("style");n.setAttribute("type","text/css");n.appendChild(m.createTextNode("@supports (color: light-dark(#000, #fff)) { #"+u+" { "+Graph.svgBackgroundVar+": "+d.cssText+"; } }"));b.insertBefore(n,b.firstChild)}}};+Graph.htmlToPng=function(b,d,m,p,u,n){u=null!=u?u:"";n=null!=n?n:Editor.htmlRasterScale;var y=document.createElement("canvas");y.width=d*n;y.height=m*n;var B=document.createElement("img");B.onload=mxUtils.bind(this,function(){try{var G=y.getContext("2d");G.scale(n,n);G.drawImage(B,0,0);p(y.toDataURL())}catch(O){p(null)}});var P=mxUtils.createXmlDocument();P=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"svg"):P.createElement("svg");b=(new mxSvgCanvas2D(P)).convertHtml(b);B.onerror=+function(G){p(null)};B.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+d+'" height="'+m+'">'+(""!=u?'<defs xmlns="http://www.w3.org/2000/svg"><style type="text/css">'+u+"</style></defs>":"")+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+b+"</div></foreignObject></svg>")};+Graph.addLightDarkColors=function(b,d,m,p){function u(c,f,k){return null!=p?p(c,f,k):mxUtils.isValidColor(k)?(null==y&&null!=d&&(y={}),null!=y&&(y[f]=c.style.getPropertyValue(f)),k=mxUtils.getLightDarkColor(k,null,null,m),c.style.setProperty(f,k.cssText),!0):!1}for(var n=b.getElementsByTagName("*"),y=null,B=!1,P=0;P<n.length;P++)if(n[P]!=b&&null!=n[P].style){y=null;for(var G=0;G<n[P].style.length;G++){var O=n[P].style.item(G),U=n[P].style.getPropertyValue(O);B=u(n[P],O,U)||B}"FONT"==n[P].nodeName&&+""==n[P].style.getPropertyValue("color")&&(U=n[P].getAttribute("color"),B=u(n[P],"color",U)||B);null!=d&&null!=y&&n[P].setAttribute(d,JSON.stringify(y))}return B};Graph.removeLightDarkColors=function(b,d){b=b.getElementsByTagName("*");for(var m=!1,p=0;p<b.length;p++)try{var u=b[p].getAttribute(d);if(null!=u){b[p].removeAttribute(d);var n=JSON.parse(u),y;for(y in n){var B=n[y];""==B?(b[p].style[y]=null,""==b[p].getAttribute("style")&&b[p].removeAttribute("style")):b[p].style[y]=B;m=!0}}}catch(P){}return m};+Graph.getGivenColor=function(b,d){var m=null;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){try{var p=b.getAttribute(Graph.backupStyleAttribute);if(null!=p){var u=JSON.parse(p);null!=u&&null!=u[d]&&("color"==d&&"FONT"==b.nodeName&&""==u[d]&&null!=b.getAttribute("color")?m=b.getAttribute("color"):""!=u[d]&&(m=u[d]))}}catch(n){}null==m&&""!=b.style[d]&&(m=b.style[d])}return m};+Graph.setTextColor=function(b,d,m){for(var p=m?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,u=m?"color":"background-color",n=b.getElementsByTagName("*"),y=[],B=0;B<n.length;B++)y.push({node:n[B],value:n[B].style[u]});B=document.queryCommandState("styleWithCSS");m&&!B&&document.execCommand("styleWithCSS",!1,!0);document.execCommand(m?"forecolor":"backcolor",!1,p);m&&!B&&document.execCommand("styleWithCSS",!1,!1);b=b.getElementsByTagName("*");for(B=0;B<b.length;B++){if(B<y.length&&y[B].node==+b[B]&&y[B].value!=b[B].style[u]&&""==b[B].style[u])try{if(n=b[B].getAttribute(Graph.backupStyleAttribute),null!=n){var P=JSON.parse(n);P[u]="";b[B].setAttribute(Graph.backupStyleAttribute,JSON.stringify(P))}}catch(G){}if(m&&b[B].getAttribute("color")==p||b[B].style[u]==p){m&&b[B].getAttribute("color")==p&&b[B].removeAttribute("color");b[B].style[u]=d!=mxConstants.NONE?mxUtils.getLightDarkColor(d).cssText:null;try{n=b[B].getAttribute(Graph.backupStyleAttribute),P=null!=n?JSON.parse(n):{},P[u]=d!=mxConstants.NONE?+d:"",b[B].setAttribute(Graph.backupStyleAttribute,JSON.stringify(P))}catch(G){}if(m&&mxClient.IS_FF){d=b[B];m=d.firstChild;if(null!=m&&"A"==m.nodeName&&null==m.nextSibling&&null!=m.firstChild){d.parentNode.insertBefore(m,d);for(p=m.firstChild;null!=p;)u=p.nextSibling,d.appendChild(p),p=u;m.appendChild(d)}break}}}};Graph.zapGremlins=function(b){return mxUtils.zapGremlins(b)};Graph.stringToBytes=function(b){for(var d=Array(b.length),m=0;m<b.length;m++)d[m]=b.charCodeAt(m);return d};Graph.bytesToString=function(b){for(var d=Array(b.length),m=0;m<b.length;m++)d[m]=String.fromCharCode(b[m]);return d.join("")};Graph.base64EncodeUnicode=function(b){return btoa(encodeURIComponent(b).replace(/%([0-9A-F]{2})/g,function(d,m){return String.fromCharCode(parseInt(m,16))}))};Graph.base64DecodeUnicode=function(b){return decodeURIComponent(Array.prototype.map.call(atob(b),function(d){return"%"+("00"+d.charCodeAt(0).toString(16)).slice(-2)}).join(""))};Graph.compressNode=function(b,d){b=mxUtils.getXml(b);return Graph.compress(d?b:Graph.zapGremlins(b))};Graph.arrayBufferToString=function(b){var d="";b=new Uint8Array(b);for(var m=b.byteLength,p=0;p<m;p++)d+=String.fromCharCode(b[p]);return d};Graph.stringToArrayBuffer=function(b){return Uint8Array.from(b,function(d){return d.charCodeAt(0)})};-Graph.arrayBufferIndexOfString=function(b,d,m){var p=d.charCodeAt(0),v=1,n=-1;for(m=m||0;m<b.byteLength;m++)if(b[m]==p){n=m;break}for(m=n+1;-1<n&&m<b.byteLength&&m<n+d.length-1;m++){if(b[m]!=d.charCodeAt(v))return Graph.arrayBufferIndexOfString(b,d,n+1);v++}return v==d.length-1?n:-1};Graph.compress=function(b,d){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=d?pako.deflate(encodeURIComponent(b)):pako.deflateRaw(encodeURIComponent(b));return btoa(Graph.arrayBufferToString(new Uint8Array(b)))};+Graph.arrayBufferIndexOfString=function(b,d,m){var p=d.charCodeAt(0),u=1,n=-1;for(m=m||0;m<b.byteLength;m++)if(b[m]==p){n=m;break}for(m=n+1;-1<n&&m<b.byteLength&&m<n+d.length-1;m++){if(b[m]!=d.charCodeAt(u))return Graph.arrayBufferIndexOfString(b,d,n+1);u++}return u==d.length-1?n:-1};Graph.compress=function(b,d){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=d?pako.deflate(encodeURIComponent(b)):pako.deflateRaw(encodeURIComponent(b));return btoa(Graph.arrayBufferToString(new Uint8Array(b)))};Graph.decompress=function(b,d,m){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=Graph.stringToArrayBuffer(atob(b));d=decodeURIComponent(d?pako.inflate(b,{to:"string"}):pako.inflateRaw(b,{to:"string"}));return m?d:Graph.zapGremlins(d)};-Graph.fadeNodes=function(b,d,m,p,v){v=null!=v?v:1E3;Graph.setTransitionForNodes(b,null);Graph.setOpacityForNodes(b,d);window.setTimeout(function(){Graph.setTransitionForNodes(b,"all "+v+"ms ease-in-out");Graph.setOpacityForNodes(b,m);window.setTimeout(function(){Graph.setTransitionForNodes(b,null);null!=p&&p()},v)},0)};-Graph.exploreFromCell=function(b,d,m){pageSize=null!=m&&null!=m.pageSize?m.pageSize:8;minSize=null!=m&&null!=m.minSize?m.minSize:180;(function(p,v){function n(U){U.view.states.visit(function(c,f){null!=f.shape&&U.model.isEdge(U.model.getParent(f.cell))?f.shape.node.parentNode.appendChild(f.shape.node):null!=f.text&&U.model.isEdge(f.cell)&&f.text.node.parentNode.appendChild(f.text.node)})}function y(U,c){if(U.getModel().isVertex(c)){var f=U.container.offsetWidth/2,k=U.container.offsetHeight/2;U.rootCell=-c.referenceCell||c;U.getModel().beginUpdate();try{pageSize=null!=m&&null!=m.pageSize?m.pageSize:8+Math.max(0,Math.floor(Math.min(U.container.offsetWidth-800/120,U.container.offsetHeight-600)/30));for(var q=c.referenceCell||c,x=p.model.getCell(q.sourceCellId),B=p.getEdges(x,null,!0,!0,!1,!0),E=[],L=0;L<B.length;L++)null!=B[L].getTerminal(!0)&&null!=B[L].getTerminal(!1)&&p.isCellVisible(B[L])&&!p.isEdgeIgnored(B[L])&&p.isCellVisible(B[L].getTerminal(!0))&&p.isCellVisible(B[L].getTerminal(!1))&&p.isCellVisible(p.getLayerForCell(B[L]))&&-E.push(B[L]);E=B=E;if(null!=c.startIndex||0<pageSize&&B.length>pageSize){var Q=c.startIndex||0;E=B.slice(Math.max(0,Q),Math.min(B.length,Q+pageSize))}E=p.getOpposites(E,x).concat(E);var V=U.cloneCells(E);for(L=0;L<E.length;L++)if(V[L].sourceCellId=E[L].id,U.model.isEdge(V[L]))for(V[L].geometry.x=0,V[L].geometry.y=0,V[L].geometry.points=null,V[L].setStyle(V[L].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffe0;textOpacity=100;"),V[L].setTerminal(q,-null==V[L].getTerminal(!0)),x=0;x<V[L].getChildCount();x++){var K=V[L].getChildAt(x);null!=K.geometry&&K.geometry.relative&&(K.setStyle(K.getStyle()+";labelBackgroundColor=#ffffffe0;textOpacity=100;"),K.geometry.offset=new mxPoint(0,0),K.geometry.y=0,K.geometry.x=.5>K.geometry.x?-.8:.5<K.geometry.x?.8:0)}if(0<c.startIndex){var fa=U.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((c.startIndex||0)/pageSize)+"/"+Math.ceil(B.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");-fa.referenceCell=q;fa.startIndex=Math.max(0,(c.startIndex||0)-pageSize);V.splice(0,0,fa)}if(B.length>(c.startIndex||0)+pageSize){var aa=U.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((c.startIndex||0)/pageSize)+2)+"/"+Math.ceil(B.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");aa.referenceCell=q;aa.startIndex=(c.startIndex||0)+pageSize;V.splice(0,0,aa)}for(var da in U.getModel().cells){var ba=U.getModel().getCell(da);ba!=U.rootCell&&+Graph.fadeNodes=function(b,d,m,p,u){u=null!=u?u:1E3;Graph.setTransitionForNodes(b,null);Graph.setOpacityForNodes(b,d);window.setTimeout(function(){Graph.setTransitionForNodes(b,"all "+u+"ms ease-in-out");Graph.setOpacityForNodes(b,m);window.setTimeout(function(){Graph.setTransitionForNodes(b,null);null!=p&&p()},u)},0)};+Graph.exploreFromCell=function(b,d,m){pageSize=null!=m&&null!=m.pageSize?m.pageSize:8;minSize=null!=m&&null!=m.minSize?m.minSize:180;(function(p,u){function n(U){U.view.states.visit(function(c,f){null!=f.shape&&U.model.isEdge(U.model.getParent(f.cell))?f.shape.node.parentNode.appendChild(f.shape.node):null!=f.text&&U.model.isEdge(f.cell)&&f.text.node.parentNode.appendChild(f.text.node)})}function y(U,c){if(U.getModel().isVertex(c)){var f=U.container.offsetWidth/2,k=U.container.offsetHeight/2;U.rootCell=+c.referenceCell||c;U.getModel().beginUpdate();try{pageSize=null!=m&&null!=m.pageSize?m.pageSize:8+Math.max(0,Math.floor(Math.min(U.container.offsetWidth-800/120,U.container.offsetHeight-600)/30));for(var q=c.referenceCell||c,x=p.model.getCell(q.sourceCellId),C=p.getEdges(x,null,!0,!0,!1,!0),E=[],L=0;L<C.length;L++)null!=C[L].getTerminal(!0)&&null!=C[L].getTerminal(!1)&&p.isCellVisible(C[L])&&!p.isEdgeIgnored(C[L])&&p.isCellVisible(C[L].getTerminal(!0))&&p.isCellVisible(C[L].getTerminal(!1))&&p.isCellVisible(p.getLayerForCell(C[L]))&&+E.push(C[L]);E=C=E;if(null!=c.startIndex||0<pageSize&&C.length>pageSize){var Q=c.startIndex||0;E=C.slice(Math.max(0,Q),Math.min(C.length,Q+pageSize))}E=p.getOpposites(E,x).concat(E);var V=U.cloneCells(E);for(L=0;L<E.length;L++)if(V[L].sourceCellId=E[L].id,U.model.isEdge(V[L]))for(V[L].geometry.x=0,V[L].geometry.y=0,V[L].geometry.points=null,V[L].setStyle(V[L].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffe0;textOpacity=100;"),V[L].setTerminal(q,+null==V[L].getTerminal(!0)),x=0;x<V[L].getChildCount();x++){var K=V[L].getChildAt(x);null!=K.geometry&&K.geometry.relative&&(K.setStyle(K.getStyle()+";labelBackgroundColor=#ffffffe0;textOpacity=100;"),K.geometry.offset=new mxPoint(0,0),K.geometry.y=0,K.geometry.x=.5>K.geometry.x?-.8:.5<K.geometry.x?.8:0)}if(0<c.startIndex){var fa=U.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((c.startIndex||0)/pageSize)+"/"+Math.ceil(C.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");+fa.referenceCell=q;fa.startIndex=Math.max(0,(c.startIndex||0)-pageSize);V.splice(0,0,fa)}if(C.length>(c.startIndex||0)+pageSize){var aa=U.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((c.startIndex||0)/pageSize)+2)+"/"+Math.ceil(C.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");aa.referenceCell=q;aa.startIndex=(c.startIndex||0)+pageSize;V.splice(0,0,aa)}for(var da in U.getModel().cells){var ba=U.getModel().getCell(da);ba!=U.rootCell&&!U.getModel().isAncestor(U.rootCell,ba)&&U.getModel().isVertex(ba)&&U.removeCells([ba])}U.addCells(V);var ha=U.getModel().getGeometry(U.rootCell);null!=ha&&(ha=ha.clone(),ha.x=f-ha.width/2,ha.y=k-ha.height/3,U.getModel().setGeometry(U.rootCell,ha));c=[];for(da in U.getModel().cells)ba=U.getModel().getCell(da),ba!=U.rootCell&&U.getModel().isVertex(ba)&&U.getModel().getParent(ba)==U.getDefaultParent()&&(c.push(ba),ha=U.getModel().getGeometry(ba),null!=ha&&(ha.x=f-ha.width/2,ha.y=k-ha.height/2));var qa=-c.length,ra=2*Math.PI/qa,l=Math.max(minSize,Math.min(U.container.offsetWidth/2-40,U.container.offsetHeight/2-80));for(f=0;f<qa;f++)ha=U.getModel().getGeometry(c[f]),null!=ha&&(ha=ha.clone(),ha.x+=l*Math.sin(f*ra),ha.y+=l*Math.cos(f*ra),U.getModel().setGeometry(c[f],ha))}finally{U.getModel().endUpdate()}}}var C=document.createElement("div");C.style.position="absolute";C.style.display="block";C.style.overflow="auto";C.style.width="100%";C.style.height="100%";C.style.left="0px";C.style.top="0px";C.style.zIndex=-2;C.style.background=p.background==mxConstants.NONE||null==p.background?"light-dark(#ffffff,"+Editor.darkColor+")":p.background;var P=document.createElement("img");P.setAttribute("src",Editor.closeBlackImage);P.style.position="absolute";P.style.cursor="pointer";P.style.right="10px";P.style.top="10px";C.appendChild(P);var G=document.createElement("div");G.style.position="absolute";G.style.cursor="pointer";G.style.right="38px";G.style.top="14px";G.style.textAlign="right";G.style.verticalAlign="top";-mxUtils.write(G,mxResources.get("close"));C.appendChild(G);document.body.appendChild(C);var O=function(U){27==U.keyCode&&P.click()};mxEvent.addListener(document,"keydown",O);(function(U){var c=new Graph(U);c.keepEdgesInBackground=!0;c.isCellResizable=function(){return!1};c.isCellRotatable=function(){return!1};c.getCursorForCell=function(E){return this.model.isVertex(E)?"pointer":null};c.getFoldingImage=function(){return null};var f=function(){mxEvent.removeListener(document,"keydown",O);U.parentNode.removeChild(U);-p.scrollCellToVisible(v)};mxEvent.addListener(P,"click",f);mxEvent.addListener(G,"click",f);c.setEnabled(!1);var k=c.click;c.click=function(E){var L=E.getCell(),Q=null!=L?null!=L.referenceCell?L.referenceCell:L:null;null!=L&&0<c.getEdges(Q).length?y(c,L):k.apply(this,arguments)};f=c.container.offsetWidth/2;var q=c.container.offsetHeight/3;c.model.beginUpdate();var x=c.importCells([v])[0];x.sourceCellId=v.id;x.geometry.x=f-x.geometry.width/2;x.geometry.y=q-x.geometry.height/2;c.model.endUpdate();var B=-!1;c.getModel().addListener(mxEvent.CHANGE,function(E,L){B||(E=L.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,c.labelsVisible=!1,B=!0,mxEffects.animateChanges(c,E,function(){var Q=new mxParallelEdgeLayout(c);Q.spacing=60;var V=Q.layout;Q.layout=function(K){Q.spacing=Math.min(60,Math.max(30,60-5*K.length));V.apply(this,arguments)};Q.execute(c.getDefaultParent());mxText.prototype.enableBoundingBox=!0;c.labelsVisible=!0;c.tooltipHandler.hide();c.refresh();n(c);B=!1}))});y(c,x)})(C)})(b,+c.length,ra=2*Math.PI/qa,l=Math.max(minSize,Math.min(U.container.offsetWidth/2-40,U.container.offsetHeight/2-80));for(f=0;f<qa;f++)ha=U.getModel().getGeometry(c[f]),null!=ha&&(ha=ha.clone(),ha.x+=l*Math.sin(f*ra),ha.y+=l*Math.cos(f*ra),U.getModel().setGeometry(c[f],ha))}finally{U.getModel().endUpdate()}}}var B=document.createElement("div");B.style.position="absolute";B.style.display="block";B.style.overflow="auto";B.style.width="100%";B.style.height="100%";B.style.left="0px";B.style.top="0px";B.style.zIndex=+2;B.style.background=p.background==mxConstants.NONE||null==p.background?"light-dark(#ffffff,"+Editor.darkColor+")":p.background;var P=document.createElement("img");P.setAttribute("src",Editor.closeBlackImage);P.style.position="absolute";P.style.cursor="pointer";P.style.right="10px";P.style.top="10px";B.appendChild(P);var G=document.createElement("div");G.style.position="absolute";G.style.cursor="pointer";G.style.right="38px";G.style.top="14px";G.style.textAlign="right";G.style.verticalAlign="top";+mxUtils.write(G,mxResources.get("close"));B.appendChild(G);document.body.appendChild(B);var O=function(U){27==U.keyCode&&P.click()};mxEvent.addListener(document,"keydown",O);(function(U){var c=new Graph(U);c.keepEdgesInBackground=!0;c.isCellResizable=function(){return!1};c.isCellRotatable=function(){return!1};c.getCursorForCell=function(E){return this.model.isVertex(E)?"pointer":null};c.getFoldingImage=function(){return null};var f=function(){mxEvent.removeListener(document,"keydown",O);U.parentNode.removeChild(U);+p.scrollCellToVisible(u)};mxEvent.addListener(P,"click",f);mxEvent.addListener(G,"click",f);c.setEnabled(!1);var k=c.click;c.click=function(E){var L=E.getCell(),Q=null!=L?null!=L.referenceCell?L.referenceCell:L:null;null!=L&&0<c.getEdges(Q).length?y(c,L):k.apply(this,arguments)};f=c.container.offsetWidth/2;var q=c.container.offsetHeight/3;c.model.beginUpdate();var x=c.importCells([u])[0];x.sourceCellId=u.id;x.geometry.x=f-x.geometry.width/2;x.geometry.y=q-x.geometry.height/2;c.model.endUpdate();var C=+!1;c.getModel().addListener(mxEvent.CHANGE,function(E,L){C||(E=L.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,c.labelsVisible=!1,C=!0,mxEffects.animateChanges(c,E,function(){var Q=new mxParallelEdgeLayout(c);Q.spacing=60;var V=Q.layout;Q.layout=function(K){Q.spacing=Math.min(60,Math.max(30,60-5*K.length));V.apply(this,arguments)};Q.execute(c.getDefaultParent());mxText.prototype.enableBoundingBox=!0;c.labelsVisible=!0;c.tooltipHandler.hide();c.refresh();n(c);C=!1}))});y(c,x)})(B)})(b,d)};Graph.removeKeys=function(b,d){for(var m in b)d(m)&&delete b[m]};Graph.setTransitionForNodes=function(b,d){for(var m=0;m<b.length;m++)mxUtils.setPrefixedStyle(b[m].style,"transition",d)};Graph.setOpacityForNodes=function(b,d){for(var m=0;m<b.length;m++)b[m].style.opacity=d};Graph.removePasteFormatting=function(b,d){for(;null!=b;){null!=b.firstChild&&Graph.removePasteFormatting(b.firstChild,!0);var m=b.nextSibling;if(b.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=b.style){"#000000"==b.style.color&&(b.style.color="");if("SPAN"==b.nodeName&&"Apple-tab-span"==b.className){var p=Graph.createTabNode(4);b.parentNode.replaceChild(p,b);b=p}if("P"==b.nodeName&&"p1"==b.className){for(;null!=b.firstChild;)b.parentNode.insertBefore(b.firstChild,b);null!=m&&"P"==m.nodeName&&"p1"==m.className&&b.parentNode.insertBefore(b.ownerDocument.createElement("br"),b);b.parentNode.removeChild(b)}!d&&null!=b.innerHTML&&0<=b.innerHTML.indexOf("\t")&&(p=Graph.createTabNode(4),b.innerHTML=b.innerHTML.replace(/\t/g,p.outerHTML))}b=m}};Graph.createTabNode=function(b){var d="\t";if(null!=b)for(d="";0<b;)d+=" ",b--;b=document.createElement("span");b.style.whiteSpace="pre";b.appendChild(document.createTextNode(d));return b};Graph.sanitizeHtml=function(b,d){return Graph.domPurify(b,!1)};-Graph.stylesCompatible=function(b,d){var m=function(p){if(null==p)return"";p=p.split(";");for(var v=[],n=0;n<p.length;n++){var y=p[n].trim();if(0<y.length){var C=y.indexOf(":");if(0<C){var P=y.substring(0,C).trim().toLowerCase();y=y.substring(C+1).trim().toLowerCase();"initial"!=y&&"inherit"!=y&&"unset"!=y&&v.push(P+":"+y)}}}v.sort();return v.join(";")};return m(b)==m(d)};+Graph.stylesCompatible=function(b,d){var m=function(p){if(null==p)return"";p=p.split(";");for(var u=[],n=0;n<p.length;n++){var y=p[n].trim();if(0<y.length){var B=y.indexOf(":");if(0<B){var P=y.substring(0,B).trim().toLowerCase();y=y.substring(B+1).trim().toLowerCase();"initial"!=y&&"inherit"!=y&&"unset"!=y&&u.push(P+":"+y)}}}u.sort();return u.join(";")};return m(b)==m(d)};Graph.optimizeHtml=function(b){if(null==b||0==b.length)return b;var d=document.createElement("div");d.innerHTML=b;Graph.optimizeNode(d);return d.innerHTML};Graph.optimizeNode=function(b){if(null!=b){for(var d=b.firstChild;null!=d;){var m=d.nextSibling;1==d.nodeType&&Graph.optimizeNode(d);d=m}for(d=b.firstChild;null!=d;){m=d.nextSibling;if(!(1!=d.nodeType||"FONT"!=d.nodeName||d.hasAttribute("color")||d.hasAttribute("face")||d.hasAttribute("size")||d.hasAttribute("style"))){for(;null!=d.firstChild;)b.insertBefore(d.firstChild,d);b.removeChild(d)}d=m}for(d=b.firstChild;null!=d;)if(m=d.nextSibling,1==d.nodeType&&null!=m&&1==m.nodeType&&"SPAN"==d.nodeName&&"SPAN"==m.nodeName&&Graph.stylesCompatible(d.getAttribute("style"),m.getAttribute("style"))){for(;null!=m.firstChild;)d.appendChild(m.firstChild);m.parentNode.removeChild(m);d.normalize()}else d=m;for(d=b.firstChild;null!=d;){m=d.nextSibling;if(1==d.nodeType&&"SPAN"==d.nodeName){var p=d.getAttribute("style");if((null==p||0==p.trim().length)&&1>=d.attributes.length){for(;null!=d.firstChild;)b.insertBefore(d.firstChild,d);b.removeChild(d)}else if("SPAN"==b.nodeName&&Graph.stylesCompatible(p,b.getAttribute("style"))&&1==d.attributes.length){for(;null!=d.firstChild;)b.insertBefore(d.firstChild,d);b.removeChild(d)}}d=m}b.normalize()}};Graph.sanitizeLink=function(b){if(null==b)return null;var d=document.createElement("a");d.setAttribute("href",b);Graph.sanitizeNode(d);return d.getAttribute("href")};Graph.sanitizeNode=function(b){return Graph.domPurify(b,!0)};-Graph.isStyleAllowed=function(b){b=b.replace(/\\([0-9a-fA-F]{1,6})\s?/g,function(v,n){return String.fromCharCode(parseInt(n,16))}).replace(/\\(.)/g,"$1");for(var d=/url\s*\(\s*(['"]?)(.*?)\1\s*\)/gi,m;null!==(m=d.exec(b));){var p=m[2].trim();m=!/^([a-z][a-z0-9+.-]*:|\/\/)/i.test(p);p=p.toLowerCase().startsWith("data:");if(!m&&!p)return!1}return/@import/i.test(b)?!1:!0};+Graph.isStyleAllowed=function(b){b=b.replace(/\\([0-9a-fA-F]{1,6})\s?/g,function(u,n){return String.fromCharCode(parseInt(n,16))}).replace(/\\(.)/g,"$1");for(var d=/url\s*\(\s*(['"]?)(.*?)\1\s*\)/gi,m;null!==(m=d.exec(b));){var p=m[2].trim();m=!/^([a-z][a-z0-9+.-]*:|\/\/)/i.test(p);p=p.toLowerCase().startsWith("data:");if(!m&&!p)return!1}return/@import/i.test(b)?!1:!0};DOMPurify.addHook("afterSanitizeAttributes",function(b){"use"==b.nodeName&&(null!=b.getAttribute("xlink:href")&&!b.getAttribute("xlink:href").startsWith("#")||null!=b.getAttribute("href")&&!b.getAttribute("href").startsWith("#"))?b.remove():"style"==b.nodeName.toLowerCase()&&(Graph.isStyleAllowed(b.textContent)||b.remove())});DOMPurify.addHook("uponSanitizeAttribute",function(b,d){"style"!=d.attrName||Graph.isStyleAllowed(d.attrValue)||(d.keepAttr=!1)});Graph.domPurify=function(b,d){window.DOM_PURIFY_CONFIG.IN_PLACE=d;return DOMPurify.sanitize(b,window.DOM_PURIFY_CONFIG)};-Graph.clipSvgDataUri=function(b){if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var d=document.createElement("div");d.style.position="absolute";d.style.visibility="hidden";var m=decodeURIComponent(escape(atob(b.substring(26)))),p=m.indexOf("<svg");if(0<=p){d.innerHTML=Graph.sanitizeHtml(m.substring(p));var v=d.getElementsByTagName("svg");if(0<v.length){document.body.appendChild(d);try{p=m=1;var n=v[0].getAttribute("width"),y=v[0].getAttribute("height");n=null!=n&&"%"!=n.charAt(n.length--1)?parseFloat(n):NaN;y=null!=y&&"%"!=y.charAt(y.length-1)?parseFloat(y):NaN;var C=v[0].getAttribute("viewBox");if(null!=C&&!isNaN(n)&&!isNaN(y)){var P=C.split(" ");4<=C.length&&(m=parseFloat(P[2])/n,p=parseFloat(P[3])/y)}var G=v[0].getBBox();if(0<G.width&&0<G.height){for(var O=0,U=v[0].querySelectorAll("[stroke-width]"),c=0;c<U.length;c++)O=Math.max(O,parseFloat(U[c].getAttribute("stroke-width")));var f=v[0].querySelectorAll("rect,circle,ellipse,line,polyline,polygon,path");for(c=0;c<f.length;c++)try{var k=-window.getComputedStyle(f[c]);k.stroke&&"none"!==k.stroke&&(O=Math.max(O,parseFloat(k.strokeWidth)||0))}catch(B){}var q=new mxRectangle(G.x,G.y,G.width,G.height);q.grow(O/2);if(null!=C&&(P=C.split(" "),4<=P.length)){var x=new mxRectangle(parseFloat(P[0]),parseFloat(P[1]),parseFloat(P[2]),parseFloat(P[3]));q.add(x)}!isNaN(n)&&!isNaN(y)&&0>q.x&&0>q.y&&q.width>n&&q.height>y?d.getElementsByTagName("svg")[0].setAttribute("viewBox","0 0 "+n+" "+y):(d.getElementsByTagName("svg")[0].setAttribute("viewBox",-q.x+" "+q.y+" "+q.width+" "+q.height),d.getElementsByTagName("svg")[0].setAttribute("width",q.width/m),d.getElementsByTagName("svg")[0].setAttribute("height",q.height/p))}}catch(B){}finally{document.body.removeChild(d)}b=Editor.createSvgDataUri(mxUtils.getXml(v[0]))}}}catch(B){}return b};-Graph.getCssVariables=function(b){var d=mxUtils.getValue(b,"cssVars",null),m=null;if(null!=d&&""!=d){d=String(d).split(",");for(var p=[],v=0;v<d.length;v++){var n=mxUtils.trim(d[v]);"--"==n.substring(0,2)&&(n=n.substring(2));var y=""!=n?mxUtils.getValue(b,"--"+n,null):null;null!=y&&""!=y&&p.push("--"+n+": "+y)}0<p.length&&(m=p.join("; "))}return m};-Graph.setSvgDataUriCssVars=function(b,d){if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26)&&Graph.isStyleAllowed(d))try{var m=decodeURIComponent(escape(atob(b.substring(26)))),p=m.indexOf("<svg");if(0<=p){var v=document.createElement("div");v.innerHTML=Graph.sanitizeHtml(m.substring(p));var n=v.getElementsByTagName("svg");if(0<n.length){var y=n[0].getAttribute("style");0<=d.indexOf("light-dark(")&&(null==y||0>y.indexOf("color-scheme"))&&(d+="; color-scheme: light dark");n[0].setAttribute("style",-(null!=y&&""!=y?y+"; ":"")+d);b="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(mxUtils.getXml(n[0]))))}}}catch(C){}return b};Graph.isSameOrigin=function(b){try{var d=document.createElement("a");d.setAttribute("href",b);return d.origin==window.location.origin}catch(m){return!1}};-Graph.prefixSvgIds=function(b,d){var m="fill stroke filter clip-path mask marker-start marker-mid marker-end style".split(" "),p=function(O){return O.replace(/url\(\s*(['"]?)#/g,"url($1#"+d)},v=function(O){return O.replace(/([^{}]*)(\{[^{}]*\})/g,function(U,c,f){return c.replace(/([.#])(-?[A-Za-z_][\w-]*)/g,"$1"+d+"$2")+p(f)})};b=b.getElementsByTagName("*");for(var n=0;n<b.length;n++){var y=b[n],C=y.getAttribute("id");null!=C&&""!=C&&y.setAttribute("id",d+C);C=y.getAttribute("class");if(null!=C&&-""!=C){var P=C.split(/\s+/);for(C=0;C<P.length;C++)""!=P[C]&&(P[C]=d+P[C]);y.setAttribute("class",P.join(" "))}if("style"==y.nodeName.toLowerCase())mxUtils.setTextContent(y,v(mxUtils.getTextContent(y)));else{for(C=0;C<m.length;C++)P=y.getAttribute(m[C]),null!=P&&0<=P.indexOf("url(")&&y.setAttribute(m[C],p(P));var G=["href","xlink:href"];for(C=0;C<G.length;C++)P=y.getAttribute(G[C]),null!=P&&"#"==P.charAt(0)&&y.setAttribute(G[C],"#"+d+P.substring(1))}}};+Graph.clipSvgDataUri=function(b){if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var d=document.createElement("div");d.style.position="absolute";d.style.visibility="hidden";var m=decodeURIComponent(escape(atob(b.substring(26)))),p=m.indexOf("<svg");if(0<=p){d.innerHTML=Graph.sanitizeHtml(m.substring(p));var u=d.getElementsByTagName("svg");if(0<u.length){document.body.appendChild(d);try{p=m=1;var n=u[0].getAttribute("width"),y=u[0].getAttribute("height");n=null!=n&&"%"!=n.charAt(n.length-+1)?parseFloat(n):NaN;y=null!=y&&"%"!=y.charAt(y.length-1)?parseFloat(y):NaN;var B=u[0].getAttribute("viewBox");if(null!=B&&!isNaN(n)&&!isNaN(y)){var P=B.split(" ");4<=B.length&&(m=parseFloat(P[2])/n,p=parseFloat(P[3])/y)}var G=u[0].getBBox();if(0<G.width&&0<G.height){for(var O=0,U=u[0].querySelectorAll("[stroke-width]"),c=0;c<U.length;c++)O=Math.max(O,parseFloat(U[c].getAttribute("stroke-width")));var f=u[0].querySelectorAll("rect,circle,ellipse,line,polyline,polygon,path");for(c=0;c<f.length;c++)try{var k=+window.getComputedStyle(f[c]);k.stroke&&"none"!==k.stroke&&(O=Math.max(O,parseFloat(k.strokeWidth)||0))}catch(C){}var q=new mxRectangle(G.x,G.y,G.width,G.height);q.grow(O/2);if(null!=B&&(P=B.split(" "),4<=P.length)){var x=new mxRectangle(parseFloat(P[0]),parseFloat(P[1]),parseFloat(P[2]),parseFloat(P[3]));q.add(x)}!isNaN(n)&&!isNaN(y)&&0>q.x&&0>q.y&&q.width>n&&q.height>y?d.getElementsByTagName("svg")[0].setAttribute("viewBox","0 0 "+n+" "+y):(d.getElementsByTagName("svg")[0].setAttribute("viewBox",+q.x+" "+q.y+" "+q.width+" "+q.height),d.getElementsByTagName("svg")[0].setAttribute("width",q.width/m),d.getElementsByTagName("svg")[0].setAttribute("height",q.height/p))}}catch(C){}finally{document.body.removeChild(d)}b=Editor.createSvgDataUri(mxUtils.getXml(u[0]))}}}catch(C){}return b};+Graph.getCssVariables=function(b){var d=mxUtils.getValue(b,"cssVars",null),m=null;if(null!=d&&""!=d){d=String(d).split(",");for(var p=[],u=0;u<d.length;u++){var n=mxUtils.trim(d[u]);"--"==n.substring(0,2)&&(n=n.substring(2));var y=""!=n?mxUtils.getValue(b,"--"+n,null):null;null!=y&&""!=y&&p.push("--"+n+": "+y)}0<p.length&&(m=p.join("; "))}return m};+Graph.setSvgDataUriCssVars=function(b,d){if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26)&&Graph.isStyleAllowed(d))try{var m=decodeURIComponent(escape(atob(b.substring(26)))),p=m.indexOf("<svg");if(0<=p){var u=document.createElement("div");u.innerHTML=Graph.sanitizeHtml(m.substring(p));var n=u.getElementsByTagName("svg");if(0<n.length){var y=n[0].getAttribute("style");0<=d.indexOf("light-dark(")&&(null==y||0>y.indexOf("color-scheme"))&&(d+="; color-scheme: light dark");n[0].setAttribute("style",+(null!=y&&""!=y?y+"; ":"")+d);b="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(mxUtils.getXml(n[0]))))}}}catch(B){}return b};Graph.isSameOrigin=function(b){try{var d=document.createElement("a");d.setAttribute("href",b);return d.origin==window.location.origin}catch(m){return!1}};+Graph.prefixSvgIds=function(b,d){var m="fill stroke filter clip-path mask marker-start marker-mid marker-end style".split(" "),p=function(O){return O.replace(/url\(\s*(['"]?)#/g,"url($1#"+d)},u=function(O){return O.replace(/([^{}]*)(\{[^{}]*\})/g,function(U,c,f){return c.replace(/([.#])(-?[A-Za-z_][\w-]*)/g,"$1"+d+"$2")+p(f)})};b=b.getElementsByTagName("*");for(var n=0;n<b.length;n++){var y=b[n],B=y.getAttribute("id");null!=B&&""!=B&&y.setAttribute("id",d+B);B=y.getAttribute("class");if(null!=B&&+""!=B){var P=B.split(/\s+/);for(B=0;B<P.length;B++)""!=P[B]&&(P[B]=d+P[B]);y.setAttribute("class",P.join(" "))}if("style"==y.nodeName.toLowerCase())mxUtils.setTextContent(y,u(mxUtils.getTextContent(y)));else{for(B=0;B<m.length;B++)P=y.getAttribute(m[B]),null!=P&&0<=P.indexOf("url(")&&y.setAttribute(m[B],p(P));var G=["href","xlink:href"];for(B=0;B<G.length;B++)P=y.getAttribute(G[B]),null!=P&&"#"==P.charAt(0)&&y.setAttribute(G[B],"#"+d+P.substring(1))}}};Graph.getCssRules=function(b){var d=document.implementation.createHTMLDocument(""),m=document.createElement("style");mxUtils.setTextContent(m,b);d.body.appendChild(m);return m.sheet.cssRules};-Graph.canonicalizeSvgCssRules=function(b,d){var m=null;if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var p=decodeURIComponent(escape(atob(b.substring(26)))),v=p.indexOf("<svg");if(0<=v){var n=document.createElement("div");n.innerHTML=Graph.sanitizeHtml(p.substring(v));var y=n.getElementsByTagName("svg");if(0<y.length){var C=y[0],P=new RegExp(d),G=C.getElementsByTagName("style");b=["fill","stroke","stop-color"];d=[];for(p=0;p<G.length;p++){var O=Graph.getCssRules(mxUtils.getTextContent(G[p]));-v="";for(n=0;n<O.length;n++){var U=O[n];if(null!=U.selectorText&&P.test(U.selectorText))for(y=0;y<b.length;y++){var c=mxUtils.trim(U.style.getPropertyValue(b[y]));""!=c&&"url("!=c.substring(0,4)&&"var("!=c.substring(0,4)&&(U.style.setProperty(b[y],"var(--mx-r"+d.length+")"),d.push("--mx-r"+d.length+": "+c))}v+=U.cssText+"\n"}mxUtils.setTextContent(G[p],v)}0<d.length&&(null!=C.style&&""==C.style.getPropertyValue("color-scheme")&&(C.style.colorScheme="light dark"),m={uri:"data:image/svg+xml;base64,"+-btoa(unescape(encodeURIComponent(mxUtils.getXml(C)))),vars:d.join("; ")})}}}catch(f){}return m};-Graph.inlineSingleUseImages=function(b){for(var d=b.getElementsByTagName("use"),m={},p=[],v=0;v<d.length;v++){var n=d[v].getAttribute("href");null==n&&(n=d[v].getAttribute("xlink:href"));null!=n&&"#mx-image-"==n.substring(0,10)&&(m[n]=(m[n]||0)+1,p.push(d[v]))}for(v=0;v<p.length;v++)if(d=p[v],n=d.getAttribute("href"),null==n&&(n=d.getAttribute("xlink:href")),1==m[n]){n=b.querySelector('[id="'+n.substring(1)+'"]');var y=null!=n&&"symbol"==n.nodeName?n.getElementsByTagName("image")[0]:null;if(null!=-y){y=y.cloneNode(!0);for(var C=d.attributes,P=0;P<C.length;P++){var G=C[P].name;"href"!=G&&"xlink:href"!=G&&y.setAttribute(G,C[P].value)}d.parentNode.replaceChild(y,d);n.parentNode.removeChild(n)}}};-Graph.replaceFontElements=function(b){var d="x-small small medium large x-large xx-large xxx-large".split(" "),m=b.getElementsByTagName("font");b=[];for(var p=0;p<m.length;p++)b.push(m[p]);for(p=0;p<b.length;p++){m=b[p];for(var v=null!=m.ownerDocument.createElementNS?m.ownerDocument.createElementNS(m.namespaceURI,"span"):m.ownerDocument.createElement("span"),n=m.attributes,y=0;y<n.length;y++){var C=n[y].name;"color"!=C&&"face"!=C&&"size"!=C&&v.setAttribute(C,n[y].value)}n=m.getAttribute("color");-null!=n&&""==v.style.color&&(/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$/.test(n)&&(n="#"+n),v.style.color=n);null!=m.getAttribute("face")&&""==v.style.fontFamily&&(v.style.fontFamily=m.getAttribute("face"));n=m.getAttribute("size");if(null!=n&&""==v.style.fontSize&&(y=parseInt(n),!isNaN(y))){if("+"==n.charAt(0)||"-"==n.charAt(0))y=3+y;v.style.fontSize=d[Math.max(0,Math.min(6,y-1))]}for(;null!=m.firstChild;)v.appendChild(m.firstChild);m.parentNode.replaceChild(v,m)}};-Graph.createSvgImageSymbol=function(b,d,m,p){null==d.keys&&(d.keys={},d.ids={});var v=m+"|"+p,n=d.keys[v];if(void 0===n){n=null;try{if(null!=b&&null!=m&&"data:image/svg+xml;base64,"==m.substring(0,26)){var y=decodeURIComponent(escape(atob(m.substring(26)))),C=y.indexOf("<svg");if(0<=C){var P=document.createElement("div");P.innerHTML=Graph.sanitizeHtml(y.substring(C));var G=P.getElementsByTagName("svg");if(0<G.length){var O=G[0],U=O.getAttribute("viewBox");if(null==U||""==U){var c=parseFloat(O.getAttribute("width")),-f=parseFloat(O.getAttribute("height"));U=!isNaN(c)&&!isNaN(f)&&0<c&&0<f?"0 0 "+c+" "+f:null}if(null!=U){for(var k="mx-symbol-"+mxUtils.hashCode(v);null!=d.ids[k];)k+="-1";Graph.prefixSvgIds(O,k+"-");var q=b.ownerDocument,x=null!=q.createElementNS?q.createElementNS(mxConstants.NS_SVG,"symbol"):q.createElement("symbol");x.setAttribute("id",k);x.setAttribute("viewBox",U);p||x.setAttribute("preserveAspectRatio","none");var B=O.getAttribute("style");null!=B&&""!=B&&x.setAttribute("style",B.replace(/url\(\s*(['"]?)#/g,-"url($1#"+k+"-"));var E=O.childNodes;for(m=0;m<E.length;m++)x.appendChild(null!=q.importNode?q.importNode(E[m],!0):E[m].cloneNode(!0));b.appendChild(x);d.ids[k]=v;n=k}}}}}catch(L){}d.keys[v]=n}return n};+Graph.canonicalizeSvgCssRules=function(b,d){var m=null;if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var p=decodeURIComponent(escape(atob(b.substring(26)))),u=p.indexOf("<svg");if(0<=u){var n=document.createElement("div");n.innerHTML=Graph.sanitizeHtml(p.substring(u));var y=n.getElementsByTagName("svg");if(0<y.length){var B=y[0],P=new RegExp(d),G=B.getElementsByTagName("style");b=["fill","stroke","stop-color"];d=[];for(p=0;p<G.length;p++){var O=Graph.getCssRules(mxUtils.getTextContent(G[p]));+u="";for(n=0;n<O.length;n++){var U=O[n];if(null!=U.selectorText&&P.test(U.selectorText))for(y=0;y<b.length;y++){var c=mxUtils.trim(U.style.getPropertyValue(b[y]));""!=c&&"url("!=c.substring(0,4)&&"var("!=c.substring(0,4)&&(U.style.setProperty(b[y],"var(--mx-r"+d.length+")"),d.push("--mx-r"+d.length+": "+c))}u+=U.cssText+"\n"}mxUtils.setTextContent(G[p],u)}0<d.length&&(null!=B.style&&""==B.style.getPropertyValue("color-scheme")&&(B.style.colorScheme="light dark"),m={uri:"data:image/svg+xml;base64,"++btoa(unescape(encodeURIComponent(mxUtils.getXml(B)))),vars:d.join("; ")})}}}catch(f){}return m};+Graph.inlineSingleUseImages=function(b){for(var d=b.getElementsByTagName("use"),m={},p=[],u=0;u<d.length;u++){var n=d[u].getAttribute("href");null==n&&(n=d[u].getAttribute("xlink:href"));null!=n&&"#mx-image-"==n.substring(0,10)&&(m[n]=(m[n]||0)+1,p.push(d[u]))}for(u=0;u<p.length;u++)if(d=p[u],n=d.getAttribute("href"),null==n&&(n=d.getAttribute("xlink:href")),1==m[n]){n=b.querySelector('[id="'+n.substring(1)+'"]');var y=null!=n&&"symbol"==n.nodeName?n.getElementsByTagName("image")[0]:null;if(null!=+y){y=y.cloneNode(!0);for(var B=d.attributes,P=0;P<B.length;P++){var G=B[P].name;"href"!=G&&"xlink:href"!=G&&y.setAttribute(G,B[P].value)}d.parentNode.replaceChild(y,d);n.parentNode.removeChild(n)}}};+Graph.replaceFontElements=function(b){var d="x-small small medium large x-large xx-large xxx-large".split(" "),m=b.getElementsByTagName("font");b=[];for(var p=0;p<m.length;p++)b.push(m[p]);for(p=0;p<b.length;p++){m=b[p];for(var u=null!=m.ownerDocument.createElementNS?m.ownerDocument.createElementNS(m.namespaceURI,"span"):m.ownerDocument.createElement("span"),n=m.attributes,y=0;y<n.length;y++){var B=n[y].name;"color"!=B&&"face"!=B&&"size"!=B&&u.setAttribute(B,n[y].value)}n=m.getAttribute("color");+null!=n&&""==u.style.color&&(/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$/.test(n)&&(n="#"+n),u.style.color=n);null!=m.getAttribute("face")&&""==u.style.fontFamily&&(u.style.fontFamily=m.getAttribute("face"));n=m.getAttribute("size");if(null!=n&&""==u.style.fontSize&&(y=parseInt(n),!isNaN(y))){if("+"==n.charAt(0)||"-"==n.charAt(0))y=3+y;u.style.fontSize=d[Math.max(0,Math.min(6,y-1))]}for(;null!=m.firstChild;)u.appendChild(m.firstChild);m.parentNode.replaceChild(u,m)}};+Graph.createSvgImageSymbol=function(b,d,m,p){null==d.keys&&(d.keys={},d.ids={});var u=m+"|"+p,n=d.keys[u];if(void 0===n){n=null;try{if(null!=b&&null!=m&&"data:image/svg+xml;base64,"==m.substring(0,26)){var y=decodeURIComponent(escape(atob(m.substring(26)))),B=y.indexOf("<svg");if(0<=B){var P=document.createElement("div");P.innerHTML=Graph.sanitizeHtml(y.substring(B));var G=P.getElementsByTagName("svg");if(0<G.length){var O=G[0],U=O.getAttribute("viewBox");if(null==U||""==U){var c=parseFloat(O.getAttribute("width")),+f=parseFloat(O.getAttribute("height"));U=!isNaN(c)&&!isNaN(f)&&0<c&&0<f?"0 0 "+c+" "+f:null}if(null!=U){for(var k="mx-symbol-"+mxUtils.hashCode(u);null!=d.ids[k];)k+="-1";Graph.prefixSvgIds(O,k+"-");var q=b.ownerDocument,x=null!=q.createElementNS?q.createElementNS(mxConstants.NS_SVG,"symbol"):q.createElement("symbol");x.setAttribute("id",k);x.setAttribute("viewBox",U);p||x.setAttribute("preserveAspectRatio","none");var C=O.getAttribute("style");null!=C&&""!=C&&x.setAttribute("style",C.replace(/url\(\s*(['"]?)#/g,+"url($1#"+k+"-"));var E=O.childNodes;for(m=0;m<E.length;m++)x.appendChild(null!=q.importNode?q.importNode(E[m],!0):E[m].cloneNode(!0));b.appendChild(x);d.ids[k]=u;n=k}}}}}catch(L){}d.keys[u]=n}return n};Graph.createRemoveIcon=function(b,d){var m=document.createElement("img");m.setAttribute("src",Dialog.prototype.clearImage);m.setAttribute("title",b);m.setAttribute("width","13");m.setAttribute("height","10");m.style.marginLeft="4px";m.style.marginBottom="-1px";m.style.cursor="pointer";mxEvent.addListener(m,"click",d);return m};Graph.isPageLink=function(b){return null!=b&&"data:page/id,"==b.substring(0,13)};-Graph.rewritePageLinks=function(b,d){function m(v,n){var y=v.getAttribute(n);if(null!=y){Graph.isPageLink(y)&&(y="#"+y.substring(y.indexOf(":")+1));var C=n;d&&"xlink:href"==n&&(v.removeAttribute(n),C="href");v.setAttribute(C,y)}}b=b.getElementsByTagName("a");if(null!=b)for(var p=0;p<b.length;p++)m(b[p],"href"),m(b[p],"xlink:href")};Graph.isLink=function(b){return null!=b&&b.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)};+Graph.rewritePageLinks=function(b,d){function m(u,n){var y=u.getAttribute(n);if(null!=y){Graph.isPageLink(y)&&(y="#"+y.substring(y.indexOf(":")+1));var B=n;d&&"xlink:href"==n&&(u.removeAttribute(n),B="href");u.setAttribute(B,y)}}b=b.getElementsByTagName("a");if(null!=b)for(var p=0;p<b.length;p++)m(b[p],"href"),m(b[p],"xlink:href")};Graph.isLink=function(b){return null!=b&&b.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)};mxUtils.extend(Graph,mxGraph);Graph.edgeSupportsCurved=function(b){b=mxUtils.getValue(b,mxConstants.STYLE_SHAPE,null);return null==b||"connector"==b||"filledEdge"==b||"wire"==b||"pipe"==b||"link"==b||"flexArrow"==b};-Graph.getCurvePoints=function(b,d){var m=b.length;if(3>m||0<=b.indexOf(null))return b;var p=[b[0]],v=function(U,c,f){for(var k=1;16>=k;k++){var q=k/16,x=1-q;p.push(new mxPoint(x*x*U.x+2*x*q*c.x+q*q*f.x,x*x*U.y+2*x*q*c.y+q*q*f.y))}};if(d&&0==(m-1)%3)for(d=1;d+2<m;d+=3){v=b[d-1];for(var n=b[d],y=b[d+1],C=b[d+2],P=1;16>=P;P++){var G=P/16,O=1-G;p.push(new mxPoint(O*O*O*v.x+3*O*O*G*n.x+3*O*G*G*y.x+G*G*G*C.x,O*O*O*v.y+3*O*O*G*n.y+3*O*G*G*y.y+G*G*G*C.y))}}else{n=b[0];for(d=1;d<m-2;d++)y=new mxPoint((b[d].x+-b[d+1].x)/2,(b[d].y+b[d+1].y)/2),v(n,b[d],y),n=y;v(n,b[m-2],b[m-1])}return p};-Graph.getEdgeLabelAngle=function(b,d,m){var p=null!=b?b.absolutePoints:null;if(null==p||2>p.length)return null;b=b.style;null==b||1!=b[mxConstants.STYLE_CURVED]&&1!=b[mxConstants.STYLE_BEZIER]||(p=Graph.getCurvePoints(p,1==b[mxConstants.STYLE_BEZIER]));for(var v=b=null,n=1;n<p.length;n++){var y=p[n-1],C=p[n];if(null!=y&&null!=C){var P=C.x-y.x;C=C.y-y.y;var G=P*P+C*C,O=0==G?0:Math.max(0,Math.min(1,((d-y.x)*P+(m-y.y)*C)/G));G=d-(y.x+O*P);y=m-(y.y+O*C);y=G*G+y*y;if(null==v||y<v)v=y,b=180*Math.atan2(C,-P)/Math.PI}}return b};Graph.getLabelAutoRotation=function(b){if(null==b||"1"!=mxUtils.getValue(b.style,"labelAutoRotate","0"))return null;var d=b.view.graph.model,m=null;if(d.isEdge(b.cell)){m=b;var p=b.absoluteOffset.x;var v=b.absoluteOffset.y}else d.isEdge(d.getParent(b.cell))&&(m=b.view.getState(d.getParent(b.cell)),p=b.getCenterX(),v=b.getCenterY());b=null!=m?Graph.getEdgeLabelAngle(m,p,v):null;null!=b&&(b=mxUtils.mod(b,360),90<b&&270>b&&(b-=180));return b};var mxTextGetTextRotation=mxText.prototype.getTextRotation;+Graph.getCurvePoints=function(b,d){var m=b.length;if(3>m||0<=b.indexOf(null))return b;var p=[b[0]],u=function(U,c,f){for(var k=1;16>=k;k++){var q=k/16,x=1-q;p.push(new mxPoint(x*x*U.x+2*x*q*c.x+q*q*f.x,x*x*U.y+2*x*q*c.y+q*q*f.y))}};if(d&&0==(m-1)%3)for(d=1;d+2<m;d+=3){u=b[d-1];for(var n=b[d],y=b[d+1],B=b[d+2],P=1;16>=P;P++){var G=P/16,O=1-G;p.push(new mxPoint(O*O*O*u.x+3*O*O*G*n.x+3*O*G*G*y.x+G*G*G*B.x,O*O*O*u.y+3*O*O*G*n.y+3*O*G*G*y.y+G*G*G*B.y))}}else{n=b[0];for(d=1;d<m-2;d++)y=new mxPoint((b[d].x++b[d+1].x)/2,(b[d].y+b[d+1].y)/2),u(n,b[d],y),n=y;u(n,b[m-2],b[m-1])}return p};+Graph.getEdgeLabelAngle=function(b,d,m){var p=null!=b?b.absolutePoints:null;if(null==p||2>p.length)return null;b=b.style;null==b||1!=b[mxConstants.STYLE_CURVED]&&1!=b[mxConstants.STYLE_BEZIER]||(p=Graph.getCurvePoints(p,1==b[mxConstants.STYLE_BEZIER]));for(var u=b=null,n=1;n<p.length;n++){var y=p[n-1],B=p[n];if(null!=y&&null!=B){var P=B.x-y.x;B=B.y-y.y;var G=P*P+B*B,O=0==G?0:Math.max(0,Math.min(1,((d-y.x)*P+(m-y.y)*B)/G));G=d-(y.x+O*P);y=m-(y.y+O*B);y=G*G+y*y;if(null==u||y<u)u=y,b=180*Math.atan2(B,+P)/Math.PI}}return b};Graph.getLabelAutoRotation=function(b){if(null==b||"1"!=mxUtils.getValue(b.style,"labelAutoRotate","0"))return null;var d=b.view.graph.model,m=null;if(d.isEdge(b.cell)){m=b;var p=b.absoluteOffset.x;var u=b.absoluteOffset.y}else d.isEdge(d.getParent(b.cell))&&(m=b.view.getState(d.getParent(b.cell)),p=b.getCenterX(),u=b.getCenterY());b=null!=m?Graph.getEdgeLabelAngle(m,p,u):null;null!=b&&(b=mxUtils.mod(b,360),90<b&&270>b&&(b-=180));return b};var mxTextGetTextRotation=mxText.prototype.getTextRotation;mxText.prototype.getTextRotation=function(){var b=null!=this.state?Graph.getLabelAutoRotation(this.state):null;return null!=b?b:mxTextGetTextRotation.apply(this,arguments)};Graph.prototype.minFitScale=null;Graph.prototype.maxFitScale=null;Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto";Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank";Graph.prototype.defaultExportLinkTarget=null;Graph.prototype.linkRelation="nofollow noopener noreferrer";Graph.prototype.defaultScrollbars=!0;Graph.prototype.defaultPageVisible=!0;Graph.prototype.defaultGridEnabled="0"!=urlParams.grid;Graph.prototype.defaultConnectionArrowsEnabled=!0;Graph.prototype.defaultConnectable=!0;Graph.prototype.defaultFoldingEnabled=!0;Graph.prototype.lightbox=!1;Graph.prototype.diagramBackgroundColor="#f0f0f0";Graph.prototype.enableDiagramBackground=!1;Graph.prototype.defaultPageBackgroundColor="1"==urlParams.embedInline?"transparent":"light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.defaultPageBorderColor="light-dark(#ffffff, #000000)";Graph.prototype.shapeForegroundColor="light-dark(#000000, #ffffff)";Graph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";Graph.prototype.scrollTileSize=new mxRectangle(0,0,400,400);Graph.prototype.transparentBackground=!0;Graph.prototype.selectParentAfterDelete=!1;Graph.prototype.defaultEdgeLength=80;Graph.prototype.immediateHandling=!0;Graph.prototype.connectionArrowsEnabled=!0;Graph.prototype.placeholderPattern=RegExp("%(date{.*}|[^%{}\"'=;]+)%","g");Graph.prototype.absoluteUrlPattern=RegExp("^(?:[a-z]+:)?//","i");Graph.prototype.defaultThemeName="default";Graph.prototype.defaultThemes={};Graph.prototype.baseUrl=null!=urlParams.base?mxUtils.removeJavascriptProtocol(decodeURIComponent(urlParams.base)):(window!=window.top?document.referrer:document.location.toString()).split("#")[0];Graph.prototype.editAfterInsert=!1;Graph.prototype.builtInProperties=["label","tooltip","placeholders","placeholder"];Graph.prototype.standalone=!1;Graph.prototype.enableFlowAnimation=!1;Graph.prototype.roundableShapes="label rectangle internalStorage corner parallelogram swimlane triangle trapezoid ext step tee process link rhombus offPageConnector loopLimit hexagon manualInput card curlyBracket singleArrow callout doubleArrow flexArrow umlLifeline".split(" ");Graph.prototype.vertexFontSize=null;Graph.prototype.edgeFontSize=null;Graph.prototype.adaptiveColors="auto";-Graph.prototype.init=function(b){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(m,p){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var v=m.view.graph.tolerance,n=!0,y=null,C=mxUtils.bind(this,function(O){n=!0;y=new mxPoint(mxEvent.getClientX(O),mxEvent.getClientY(O))}),P=mxUtils.bind(this,function(O){n=n&&null!=y&&Math.abs(y.x-mxEvent.getClientX(O))<v&&Math.abs(y.y-mxEvent.getClientY(O))<v}),G=mxUtils.bind(this,function(O){if(n)for(var U=mxEvent.getSource(O);null!=-U&&U!=p.node;){if("a"==U.nodeName.toLowerCase()){m.view.graph.labelLinkClicked(m,U,O);break}U=U.parentNode}});mxEvent.addGestureListeners(p.node,C,P,G);mxEvent.addListener(p.node,"click",function(O){mxEvent.consume(O)})};if(null!=this.tooltipHandler){var d=this.tooltipHandler.init;this.tooltipHandler.init=function(){d.apply(this,arguments);null!=this.div&&(null!=Editor.tooltipFontSize&&(this.div.style.fontSize=Editor.tooltipFontSize+"px"),0<Editor.tooltipMaxWidth&&(this.div.style.maxWidth=Editor.tooltipMaxWidth++Graph.prototype.init=function(b){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(m,p){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var u=m.view.graph.tolerance,n=!0,y=null,B=mxUtils.bind(this,function(O){n=!0;y=new mxPoint(mxEvent.getClientX(O),mxEvent.getClientY(O))}),P=mxUtils.bind(this,function(O){n=n&&null!=y&&Math.abs(y.x-mxEvent.getClientX(O))<u&&Math.abs(y.y-mxEvent.getClientY(O))<u}),G=mxUtils.bind(this,function(O){if(n)for(var U=mxEvent.getSource(O);null!=+U&&U!=p.node;){if("a"==U.nodeName.toLowerCase()){m.view.graph.labelLinkClicked(m,U,O);break}U=U.parentNode}});mxEvent.addGestureListeners(p.node,B,P,G);mxEvent.addListener(p.node,"click",function(O){mxEvent.consume(O)})};if(null!=this.tooltipHandler){var d=this.tooltipHandler.init;this.tooltipHandler.init=function(){d.apply(this,arguments);null!=this.div&&(null!=Editor.tooltipFontSize&&(this.div.style.fontSize=Editor.tooltipFontSize+"px"),0<Editor.tooltipMaxWidth&&(this.div.style.maxWidth=Editor.tooltipMaxWidth+"px"),mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(m){var p=mxEvent.getSource(m);"A"==p.nodeName&&(p=p.getAttribute("href"),null!=p&&this.graph.isCustomLink(p)&&(mxEvent.isTouchEvent(m)||!mxEvent.isPopupTrigger(m))&&this.graph.customLinkClicked(p)&&mxEvent.consume(m))})))}}this.initTransparentBoundsStyleSync();this.initLayoutManager()};-Graph.prototype.initTransparentBoundsStyleSync=function(){this.model.addListener(mxEvent.BEFORE_UNDO,mxUtils.bind(this,function(b,d){b=d.getProperty("edit");if(null!=b&&null!=b.changes){d=this.getStylesheet();for(var m=b.changes.length,p=0;p<m;p++){var v=b.changes[p];if(v instanceof mxStyleChange&&this.model.isVertex(v.cell)){var n=d.getCellStyle(v.previous),y=d.getCellStyle(v.style);y=null!=y&&1==y.transparentBounds;if((null!=n&&1==n.transparentBounds)!=y&&(n=this.getCellGeometry(v.cell),null!=n))if(y){if(0!=-n.x||0!=n.y)for(var C=this.model.getChildCount(v.cell),P=0;P<C;P++)this.translateCell(this.model.getChildAt(v.cell,P),n.x,n.y);if(0!=n.x||0!=n.y||0!=n.width||0!=n.height)n=n.clone(),n.x=0,n.y=0,n.width=0,n.height=0,this.model.setGeometry(v.cell,n)}else if(y=this.getTransparentBounds(v.cell),null!=y&&(n=n.clone(),n.x+=y.x,n.y+=y.y,n.width=y.width,n.height=y.height,this.model.setGeometry(v.cell,n),0!=y.x||0!=y.y))for(C=this.model.getChildCount(v.cell),P=0;P<C;P++)this.translateCell(this.model.getChildAt(v.cell,+Graph.prototype.initTransparentBoundsStyleSync=function(){this.model.addListener(mxEvent.BEFORE_UNDO,mxUtils.bind(this,function(b,d){b=d.getProperty("edit");if(null!=b&&null!=b.changes){d=this.getStylesheet();for(var m=b.changes.length,p=0;p<m;p++){var u=b.changes[p];if(u instanceof mxStyleChange&&this.model.isVertex(u.cell)){var n=d.getCellStyle(u.previous),y=d.getCellStyle(u.style);y=null!=y&&1==y.transparentBounds;if((null!=n&&1==n.transparentBounds)!=y&&(n=this.getCellGeometry(u.cell),null!=n))if(y){if(0!=+n.x||0!=n.y)for(var B=this.model.getChildCount(u.cell),P=0;P<B;P++)this.translateCell(this.model.getChildAt(u.cell,P),n.x,n.y);if(0!=n.x||0!=n.y||0!=n.width||0!=n.height)n=n.clone(),n.x=0,n.y=0,n.width=0,n.height=0,this.model.setGeometry(u.cell,n)}else if(y=this.getTransparentBounds(u.cell),null!=y&&(n=n.clone(),n.x+=y.x,n.y+=y.y,n.width=y.width,n.height=y.height,this.model.setGeometry(u.cell,n),0!=y.x||0!=y.y))for(B=this.model.getChildCount(u.cell),P=0;P<B;P++)this.translateCell(this.model.getChildAt(u.cell,P),-y.x,-y.y)}}}}))};Graph.prototype.waitForBrowserTranslate=function(){var b=this;if(Graph.isBrowserTranslated())this.initBrowserTranslate(),this.btActive=!0,this.activateBrowserTranslate();else{var d=function(){if(null!=b.btClassObservers&&Graph.isBrowserTranslated()){for(var n=0;n<b.btClassObservers.length;n++)b.btClassObservers[n].disconnect();b.btClassObservers=null;b.initBrowserTranslate();b.btActive=!0;b.activateBrowserTranslate()}};this.btClassObservers=[];var m={attributes:!0,attributeFilter:["class"]},p=new MutationObserver(d);-p.observe(document.documentElement,m);this.btClassObservers.push(p);try{if(window.parent!=window&&null!=window.parent.document&&window.parent.document.documentElement!=document.documentElement){var v=new MutationObserver(d);v.observe(window.parent.document.documentElement,m);this.btClassObservers.push(v)}}catch(n){}}};+p.observe(document.documentElement,m);this.btClassObservers.push(p);try{if(window.parent!=window&&null!=window.parent.document&&window.parent.document.documentElement!=document.documentElement){var u=new MutationObserver(d);u.observe(window.parent.document.documentElement,m);this.btClassObservers.push(u)}}catch(n){}}};Graph.prototype.initBrowserTranslate=function(){var b=this;this.btMirrorMap=new Map;this.btRebuilding=!1;var d=document;try{window.parent!=window&&null!=window.parent.document&&(d=window.parent.document)}catch(p){}var m=d.createElement("div");m.id="bt-mirror";m.setAttribute("aria-hidden","true");m.style.cssText="position:fixed;left:-10000px;top:0;width:1px;overflow:hidden;";d.body.appendChild(m);this.btMirrorContainer=m;this.btObserver=new MutationObserver(function(p){if(!b.btRebuilding){b.btActive||-(b.btActive=!0,b.activateBrowserTranslate());for(var v=0;v<p.length;v++){for(var n=p[v].target;null!=n&&null!=n.parentNode&&n.parentNode!=b.btMirrorContainer;)n=n.parentNode;if(null!=n){var y=b.btMirrorMap.get(n);null!=y&&b.syncTranslationToForeignObject(n,y)}}}});this.btObserver.observe(m,{childList:!0,subtree:!0,characterData:!0});this.refreshBrowserTranslateMirror()};+(b.btActive=!0,b.activateBrowserTranslate());for(var u=0;u<p.length;u++){for(var n=p[u].target;null!=n&&null!=n.parentNode&&n.parentNode!=b.btMirrorContainer;)n=n.parentNode;if(null!=n){var y=b.btMirrorMap.get(n);null!=y&&b.syncTranslationToForeignObject(n,y)}}}});this.btObserver.observe(m,{childList:!0,subtree:!0,characterData:!0});this.refreshBrowserTranslateMirror()};Graph.prototype.activateBrowserTranslate=function(){this.addListener(mxEvent.SIZE,mxUtils.bind(this,function(){this.refreshBrowserTranslateMirror()}));var b=mxUtils.bind(this,function(){this.refreshBrowserTranslateMirror()});this.addListener(mxEvent.LABEL_CHANGED,b);this.addListener(mxEvent.CELLS_ADDED,b);this.getModel().addListener(mxEvent.CHANGE,function(){setTimeout(b,0)})};Graph.prototype.addBrowserTranslateMirror=function(b){if(null!=this.btMirrorContainer)if("http://www.w3.org/1999/xhtml"==b.namespaceURI){b=document.createTreeWalker(b,NodeFilter.SHOW_TEXT,null,!1);for(var d;null!=(d=b.nextNode());){var m=d.data;if(null!=m&&0<m.trim().length){var p=document.createElement("p");p.style.cssText="margin:0;";p.textContent=m;p.setAttribute("data-bt-original",m);this.btMirrorContainer.appendChild(p);this.btMirrorMap.set(p,d)}}}else m=b.textContent,null!=m&&0<m.length&&(p=document.createElement("p"),p.style.cssText="margin:0;",p.textContent=m,p.setAttribute("data-bt-original",m),this.btMirrorContainer.appendChild(p),this.btMirrorMap.set(p,b))};Graph.prototype.syncTranslationToForeignObject=function(b,d){var m=b.textContent;if(m!=(3==d.nodeType?d.data:d.textContent))if(3==d.nodeType)d.data=m;else if(b=d.querySelectorAll("tspan"),0==b.length)d.textContent=m;else if(1==b.length)b[0].textContent=m;else for(b[0].textContent=m,d=1;d<b.length;d++)b[d].textContent=""};-Graph.prototype.refreshBrowserTranslateMirror=function(){if(null!=this.btMirrorContainer&&null!=this.container){this.btRebuilding=!0;var b={},d=0;if(null!=this.btTranslationCache)for(var m in this.btTranslationCache)b[m]=this.btTranslationCache[m],d++;for(var p=this.btMirrorContainer.children,v=0;v<p.length;v++){var n=p[v].getAttribute("data-bt-original"),y=p[v].textContent;null!=n&&y!=n&&(b[n]=y,d++)}this.btMirrorMap.clear();this.btMirrorContainer.innerHTML="";n=this.container.querySelector("svg");-if(null!=n){p=n.querySelectorAll("text");for(v=y=0;v<p.length;v++)null==p[v].closest("foreignObject")&&(this.addBrowserTranslateMirror(p[v]),y++);n=n.querySelectorAll("foreignObject > div");for(v=p=0;v<n.length;v++)this.addBrowserTranslateMirror(n[v]),p++}if(0<d){d={};for(m in b)d[b[m]]=m;m=0;p=this.btMirrorContainer.children;for(v=0;v<p.length;v++)n=p[v].getAttribute("data-bt-original"),null!=n&&null!=d[n]&&(n=d[n],p[v].setAttribute("data-bt-original",n)),n=null!=n?b[n]:null,null!=n&&(p[v].textContent=-n,n=this.btMirrorMap.get(p[v]),null!=n&&this.syncTranslationToForeignObject(p[v],n),m++)}this.btRebuilding=!1}};Graph.prototype.getBrowserTranslationCache=function(){if(null==this.btMirrorContainer)return null;for(var b={},d=0,m=this.btMirrorContainer.children,p=0;p<m.length;p++){var v=m[p].getAttribute("data-bt-original"),n=m[p].textContent;null!=v&&n!=v&&(b[v]=n,d++)}return 0<d?b:null};+Graph.prototype.refreshBrowserTranslateMirror=function(){if(null!=this.btMirrorContainer&&null!=this.container){this.btRebuilding=!0;var b={},d=0;if(null!=this.btTranslationCache)for(var m in this.btTranslationCache)b[m]=this.btTranslationCache[m],d++;for(var p=this.btMirrorContainer.children,u=0;u<p.length;u++){var n=p[u].getAttribute("data-bt-original"),y=p[u].textContent;null!=n&&y!=n&&(b[n]=y,d++)}this.btMirrorMap.clear();this.btMirrorContainer.innerHTML="";n=this.container.querySelector("svg");+if(null!=n){p=n.querySelectorAll("text");for(u=y=0;u<p.length;u++)null==p[u].closest("foreignObject")&&(this.addBrowserTranslateMirror(p[u]),y++);n=n.querySelectorAll("foreignObject > div");for(u=p=0;u<n.length;u++)this.addBrowserTranslateMirror(n[u]),p++}if(0<d){d={};for(m in b)d[b[m]]=m;m=0;p=this.btMirrorContainer.children;for(u=0;u<p.length;u++)n=p[u].getAttribute("data-bt-original"),null!=n&&null!=d[n]&&(n=d[n],p[u].setAttribute("data-bt-original",n)),n=null!=n?b[n]:null,null!=n&&(p[u].textContent=+n,n=this.btMirrorMap.get(p[u]),null!=n&&this.syncTranslationToForeignObject(p[u],n),m++)}this.btRebuilding=!1}};Graph.prototype.getBrowserTranslationCache=function(){if(null==this.btMirrorContainer)return null;for(var b={},d=0,m=this.btMirrorContainer.children,p=0;p<m.length;p++){var u=m[p].getAttribute("data-bt-original"),n=m[p].textContent;null!=u&&n!=u&&(b[u]=n,d++)}return 0<d?b:null};Graph.prototype.applyBrowserTranslationCache=function(b){if(null!=b&&null!=this.btMirrorContainer){this.btTranslationCache=b;this.btRebuilding=!0;for(var d=this.btMirrorContainer.children,m=0;m<d.length;m++){var p=d[m].getAttribute("data-bt-original");p=null!=p?b[p]:null;null!=p&&(d[m].textContent=p,p=this.btMirrorMap.get(d[m]),null!=p&&this.syncTranslationToForeignObject(d[m],p))}this.btRebuilding=!1}};Graph.prototype.destroyBrowserTranslate=function(){if(null!=this.btClassObservers){for(var b=0;b<this.btClassObservers.length;b++)this.btClassObservers[b].disconnect();this.btClassObservers=null}null!=this.btObserver&&(this.btObserver.disconnect(),this.btObserver=null);null!=this.btMirrorContainer&&null!=this.btMirrorContainer.parentNode&&(this.btMirrorContainer.parentNode.removeChild(this.btMirrorContainer),this.btMirrorContainer=null);null!=this.btMirrorMap&&(this.btMirrorMap.clear(),this.btMirrorMap=null)};var graphDestroy=Graph.prototype.destroy;Graph.prototype.destroy=function(){this.destroyBrowserTranslate();graphDestroy.apply(this,arguments)};-(function(){Graph.prototype.useCssTransforms=!1;Graph.prototype.currentScale=1;Graph.prototype.currentTranslate=new mxPoint(0,0);Graph.prototype.pasteEdgeStyle=!1;Graph.prototype.pasteStylesToText=!1;Graph.prototype.isFillState=function(y){var C=mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null);return!this.isSpecialColor(y.style[mxConstants.STYLE_FILLCOLOR])&&"1"!=mxUtils.getValue(y.style,"lineShape",null)&&"mxgraph.basic.arc"!=C&&(this.model.isVertex(y.cell)||"arrow"==C||"pipe"==C||"wire"==-C||"filledEdge"==C||"flexArrow"==C||"mermaidSankeyLink"==C||"mxgraph.arrows2.wedgeArrow"==C)};Graph.prototype.isGradientState=function(y){var C=mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null);return this.isFillState(y)&&"wire"!=C&&"pipe"!=C};Graph.prototype.isStrokeState=function(y){return!0};Graph.prototype.getTextColor=function(y,C){var P=C?"color":"background-color",G=null;if(null!=y&&window.getSelection)for(var O=window.getSelection(),U=y.getElementsByTagName("*"),c=0;c<U.length&&null==-G;c++)null!=U[c].style&&O.containsNode(U[c],!0)&&(G=Graph.getGivenColor(U[c],P));for(;null==G&&null!=y&&y!=this.cellEditor.textarea.parentNode;)G=y==this.cellEditor.textarea&&C?"default":Graph.getGivenColor(y,P),y=y.parentNode;if("rgba(0, 0, 0, 0)"==G||"transparent"==G)G=mxConstants.NONE;return G};Graph.prototype.isSpecialColor=function(y){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],y)};Graph.prototype.isGlassState=function(y){y=-mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null);return"label"==y||"rectangle"==y||"internalStorage"==y||"ext"==y||"umlLifeline"==y||"swimlane"==y||"process"==y||"ellipse"==y||"rhombus"==y};Graph.prototype.isRoundedState=function(y){return null!=y.shape?y.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isLineJumpState=function(y){var C=mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(y.style,-mxConstants.STYLE_CURVED,!1)&&("connector"==C||"filledEdge"==C||"wire"==C)};Graph.prototype.isAutoSizeState=function(y){return"1"==mxUtils.getValue(y.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isAutosizeTextState=function(y){return"1"==mxUtils.getValue(y.style,"autosizeText",null)};Graph.prototype.isAutosizeTextCell=function(y){y=this.getCurrentCellStyle(y);return null!=y&&"1"==y.autosizeText};Graph.prototype.isImageState=function(y){return null!=mxUtils.getValue(y.style,mxConstants.STYLE_IMAGE,-null)};Graph.prototype.isShadowState=function(y){return!0};Graph.prototype.getVerticesAndEdges=function(y,C){y=null!=y?y:!0;C=null!=C?C:!0;var P=this.model;return P.filterDescendants(function(G){return y&&P.isVertex(G)||C&&P.isEdge(G)},P.getRoot())};Graph.prototype.applyNewEdgeStyle=function(y,C,P){y=this.getCellStyle(y).newEdgeStyle;if(null!=y){this.model.beginUpdate();try{var G=Graph.decodeNewEdgeStyle(y),O;for(O in G)this.setCellStyles(O,G[O],C),"edgeStyle"==O&&"elbowEdgeStyle"==G[O]&&null!=P&&-this.setCellStyles("elbow",P==mxConstants.DIRECTION_SOUTH||P==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",C)}finally{this.model.endUpdate()}}this.model.beginUpdate();try{for(P=0;P<C.length;P++){var U=this.model.getTerminal(C[P],!0);null!=U&&U==this.model.getTerminal(C[P],!1)&&this.applyLoopStyle(C[P],U)}}finally{this.model.endUpdate()}};Graph.prototype.applyLoopStyle=function(y,C){var P=this.getCellGeometry(C);C=this.getCellGeometry(y);if(null!=P&&null!=C){var G=this.gridSize,O=P.x+P.width+-4*G;P=P.y+P.height/2;C=C.clone();C.points=[new mxPoint(O,P-2*G),new mxPoint(O,P+2*G)];this.model.beginUpdate();try{this.model.setGeometry(y,C),this.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[y]),this.setCellStyles("innerLoopWaypoints","1",[y])}finally{this.model.endUpdate()}}};Graph.prototype.getLoopFixedAxis=function(y){var C=null!=y?y.getVisibleTerminalState(!0):null;if(null==C||0==C.width||0==C.height)return null;var P=y.view;if(null==P.getPerimeterFunction(C))return null;var G=-C.getCenterX(),O=C.getCenterY(),U=Math.max(C.width,C.height)+100;y=P.getPerimeterPoint(C,new mxPoint(G+U,O),!1);var c=P.getPerimeterPoint(C,new mxPoint(G-U,O),!1),f=P.getPerimeterPoint(C,new mxPoint(G,O-U),!1);P=P.getPerimeterPoint(C,new mxPoint(G,O+U),!1);f=null!=f&&null!=P&&Math.abs(f.y-P.y)<C.height/4;return null!=y&&null!=c&&Math.abs(y.x-c.x)<C.width/4?"x":f?"y":null};Graph.prototype.loopHasFixedAnchorLine=function(y){return null!=this.getLoopFixedAxis(y)};Graph.prototype.getLoopAroundPoints=-function(y,C){var P=null!=y?y.getVisibleTerminalState(!0):null,G=null!=y?this.getCellGeometry(y.cell):null;if(null==P||null==C||null==G)return null;var O=y.view.scale,U=y.view.translate,c=y.origin,f=P.x/O-U.x-c.x,k=P.y/O-U.y-c.y,q=P.width/O,x=P.height/O,B=new mxPoint(C.x/O-U.x-c.x,C.y/O-U.y-c.y);var E=y.absolutePoints;null!=G.points&&2<=G.points.length?(C=G.points[0],E=G.points[G.points.length-1]):null!=E&&4<=E.length?(C=new mxPoint(E[1].x/O-U.x-c.x,E[1].y/O-U.y-c.y),E=new mxPoint(E[E.length-2].x/-O-U.x-c.x,E[E.length-2].y/O-U.y-c.y)):(C=new mxPoint(f+q/2,k+x/2-this.gridSize),E=new mxPoint(f+q/2,k+x/2+this.gridSize));G=Math.abs(C.x-E.x)>=Math.abs(C.y-E.y);C=Math.max(this.gridSize,G?Math.abs(C.x-E.x):Math.abs(C.y-E.y));var L=this.gridSize;E=this.loopHasFixedAnchorLine(y);var Q=y.absolutePoints;Q=null!=Q&&null!=Q[0]?new mxPoint(Q[0].x/O-U.x-c.x,Q[0].y/O-U.y-c.y):null;if(E&&null!=Q){if(G)return k=B.y>=Q.y?Math.max(Q.y+L,B.y):Math.min(Q.y-L,B.y),[new mxPoint(B.x-C/2,k),new mxPoint(B.x+C/2,k)];-Q=B.x>=Q.x?Math.max(Q.x+L,B.x):Math.min(Q.x-L,B.x);return[new mxPoint(Q,B.y-C/2),new mxPoint(Q,B.y+C/2)]}var V=f+q/2,K=k+x/2,fa=function(aa,da,ba){aa=y.view.getPerimeterPoint(P,new mxPoint((aa+U.x+c.x)*O,(da+U.y+c.y)*O),ba);return null!=aa?new mxPoint(aa.x/O-U.x-c.x,aa.y/O-U.y-c.y):null};G=function(aa,da,ba,ha){aa=fa(aa,da,!0);ba=fa(ba,ha,!0);return null==aa||null==ba||2>Math.abs(aa.x-V)&&2>Math.abs(aa.y-K)||2>Math.abs(ba.x-V)&&2>Math.abs(ba.y-K)?!0:Math.abs(aa.x-ba.x)<L/2&&Math.abs(aa.y-ba.y)<L/-2};E=fa(B.x,B.y,!1);if(null==E||1>Math.abs(E.x-V)&&1>Math.abs(E.y-K))E=new mxPoint(V,K);if(Math.abs(E.y-K)>=Math.abs(E.x-V)){C=Math.max(this.gridSize,Math.min(C,q));k=E.y>=K?Math.max(E.y+L,B.y):Math.min(E.y-L,B.y);B=Math.max(f+C/2,Math.min(f+q-C/2,B.x));for(f=0;f<=q/this.gridSize&&G(B-C/2,k,B+C/2,k);f++)B=B<V?Math.min(V,B+this.gridSize):Math.max(V,B-this.gridSize);E=E.y>=K?this.gridSize:-this.gridSize;for(f=0;f<=(q+x)/this.gridSize&&G(B-C/2,k,B+C/2,k);f++)k+=E;return[new mxPoint(B-C/2,k),new mxPoint(B+-C/2,k)]}C=Math.max(this.gridSize,Math.min(C,x));Q=E.x>=V?Math.max(E.x+L,B.x):Math.min(E.x-L,B.x);k=Math.max(k+C/2,Math.min(k+x-C/2,B.y));for(f=0;f<=x/this.gridSize&&G(Q,k-C/2,Q,k+C/2);f++)k=k<K?Math.min(K,k+this.gridSize):Math.max(K,k-this.gridSize);B=E.x>=V?this.gridSize:-this.gridSize;for(f=0;f<=(q+x)/this.gridSize&&G(Q,k-C/2,Q,k+C/2);f++)Q+=B;return[new mxPoint(Q,k-C/2),new mxPoint(Q,k+C/2)]};Graph.prototype.keepLoopOutsideShape=function(y,C){var P=null!=y?y.getVisibleTerminalState(!0):null;if(null==-P||null==C||0==C.length)return C;var G=y.view.scale,O=y.view.translate,U=y.origin,c=P.x/G-O.x-U.x,f=P.y/G-O.y-U.y,k=P.width/G,q=P.height/G;if(this.loopHasFixedAnchorLine(y))return C;c+=k/2;f+=q/2;q=this.gridSize;k=[];for(var x=0;x<C.length;x++){var B=C[x];if(null==B)k.push(B);else{var E=new mxPoint(B.x,B.y),L=y.view.getPerimeterPoint(P,new mxPoint((B.x+O.x+U.x)*G,(B.y+O.y+U.y)*G),!1);if(null!=L){var Q=L.x/G-O.x-U.x;L=L.y/G-O.y-U.y;var V=B.x-c;B=B.y-f;var K=Math.sqrt(V*V+B*B);K<Math.sqrt((Q-c)*(Q--c)+(L-f)*(L-f))-.5&&(1>K&&(V=0,K=B=1),E.x=Q+V/K*q,E.y=L+B/K*q)}k.push(E)}}return k};Graph.prototype.getCommonStyle=function(y){for(var C={},P=0;P<y.length;P++){var G=this.view.getState(y[P]);null!=G&&this.mergeStyle(G.style,C,0==P)}return C};Graph.prototype.mergeStyle=function(y,C,P){if(null!=y){var G={},O;for(O in y){var U=y[O];null!=U&&(G[O]=!0,null==C[O]&&P?C[O]=U:C[O]!=U&&delete C[O])}for(O in C)G[O]||delete C[O]}};Graph.prototype.getStartEditingCell=function(y,C){C=this.getCellStyle(y);C=parseInt(mxUtils.getValue(C,-mxConstants.STYLE_STARTSIZE,0));this.isTable(y)&&(!this.isSwimlane(y)||0==C)&&""==this.getLabel(y)&&0<this.model.getChildCount(y)&&(y=this.model.getChildAt(y,0),C=this.getCellStyle(y),C=parseInt(mxUtils.getValue(C,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(y)&&(!this.isSwimlane(y)||0==C)&&""==this.getLabel(y)&&0<this.model.getChildCount(y))for(C=0;C<this.model.getChildCount(y);C++){var P=this.model.getChildAt(y,C);if(this.isCellEditable(P)){y=P;break}}return y};Graph.prototype.copyStyle=-function(y){return this.getCellStyle(y,!1)};Graph.prototype.pasteStyle=function(y,C,P,G){null!=y&&(G||(P=null!=P?P:Graph.cellStyles,Graph.removeKeys(y,function(O){return 0>mxUtils.indexOf(P,O)})),this.updateCellStyles(y,C))};Graph.prototype.copyCellStyles=function(y,C,P,G,O,U,c,f){var k=!1,q=!1;if(0<y.length)for(var x=0;x<y.length&&(k=this.getModel().isVertex(y[x])||k,!(q=this.getModel().isEdge(y[x])||q)||!k);x++);else q=k=!0;k=k&&!U;q=q&&!c;for(x=0;x<C.length;x++)if(y=0<=mxUtils.indexOf(Graph.textStyles,-C[x]),"strokeColor"!=C[x]||null!=P[x]&&"none"!=P[x])if(0<=mxUtils.indexOf(Graph.cellStyles,C[x])||"shape"==C[x])if("shape"!=C[x]&&(k||y&&!U)&&!f&&(null==P[x]?delete G[C[x]]:G[C[x]]=P[x]),q||y&&!c)null==P[x]?delete O[C[x]]:O[C[x]]=P[x]};Graph.prototype.includeDescendants=function(y){for(var C=[],P=0;P<y.length;P++)C=C.concat(this.model.getDescendants(y[P]));return C};Graph.prototype.includeDescendantParts=function(y){for(var C=y.slice(),P=mxUtils.bind(this,function(O){for(var U=0;U<this.model.getChildCount(O);U++){var c=-this.model.getChildAt(O,U);"1"==mxUtils.getValue(this.getCurrentCellStyle(c),"part","0")&&(C.push(c),P(c))}}),G=0;G<y.length;G++)P(y[G]);return C};Graph.prototype.pasteCellStyles=function(y,C,P,G,O,U){C=null!=C?C:this.currentVertexStyle;P=null!=P?P:this.currentEdgeStyle;O=null!=O?O:this.pasteEdgeStyle;U=null!=U?U:this.pasteStylesToText;this.model.beginUpdate();try{for(var c=0;c<y.length;c++){var f=y[c],k=this.model.getStyle(f),q=!1;null!=f.style&&"string"===typeof f.style&&(pairs=f.style.split(";"),-q=q||0<=mxUtils.indexOf(pairs,"text"));var x=this.model.isVertex(f)&&this.model.isEdge(this.model.getParent(f));if(q||x)var B=q&&!x&&U?Graph.cellStyles:Graph.textStyles;else if(B=Graph.cellStyles.slice(),!G)for(var E="string"===typeof k?k.split(";"):[],L=0;L<E.length;L++){var Q=E[L],V=Q.indexOf("=");if(0<=V){var K=Q.substring(0,V),fa=mxUtils.indexOf(B,K);0<=fa&&B.splice(fa,1);for(q=0;q<Graph.cellStyleGroups.length;q++){var aa=Graph.cellStyleGroups[q];if(0<=mxUtils.indexOf(aa,K))for(var da=0;da<aa.length;da++){var ba=-mxUtils.indexOf(B,aa[da]);0<=ba&&B.splice(ba,1)}}}}var ha=this.model.isEdge(f);q=ha||x?P:C;for(L=0;L<B.length;L++){K=B[L];var qa=q[K];if("edgeStyle"!=K||O)if(ha||!ha&&0>mxUtils.indexOf(Graph.edgeStyles,K))null!=qa?(k=mxUtils.setStyle(k,K,qa),"fontFamily"==K&&null==q.fontSource&&(k=mxUtils.setStyle(k,"fontSource",null)),ha&&"rounded"==K&&"1"==qa&&null==q.curved&&(k=mxUtils.setStyle(k,"curved",null))):G&&(k=mxUtils.setStyle(k,K,null))}Editor.simpleLabels&&(k=mxUtils.setStyle(mxUtils.setStyle(k,"html",-null),"whiteSpace",null));this.model.setStyle(f,k)}}finally{this.model.endUpdate()}return y};Graph.prototype.pasteTextStyles=function(y,C){this.model.beginUpdate();try{for(var P=0;P<y.length;P++){var G=y[P];if(this.model.isVertex(G)||this.model.isEdge(G)){for(var O=this.model.getStyle(G),U=0;U<Graph.pasteTextStyles.length;U++){var c=Graph.pasteTextStyles[U],f=C[c];null!=f&&(O=mxUtils.setStyle(O,c,f),"fontFamily"==c&&null==C.fontSource&&(O=mxUtils.setStyle(O,"fontSource",null)))}Editor.simpleLabels&&-(O=mxUtils.setStyle(mxUtils.setStyle(O,"html",null),"whiteSpace",null));this.model.setStyle(G,O)}}}finally{this.model.endUpdate()}return y};Graph.prototype.updateCellStyles=function(y,C){this.model.beginUpdate();try{for(var P=0;P<C.length;P++)if(this.model.isVertex(C[P])||this.model.isEdge(C[P])){var G=this.getCellStyle(C[P],!1),O=G[mxConstants.STYLE_PERIMETER],U=!1;for(f in y){var c=y[f];if(G[f]!=c){if(f==mxConstants.STYLE_SHAPE&&"umlLifeline"==G[f]&&"umlLifeline"!=c){U=!0;var f="participant"}this.setCellStyles(f,-c,[C[P]])}}U&&this.setCellStyles(mxConstants.STYLE_PERIMETER,O,[C[P]])}}finally{this.model.endUpdate()}};Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&(this.isCssTransformsSupported()||mxClient.IS_IOS)};Graph.prototype.isCssTransformsSupported=function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO&&(!this.lightbox||!mxClient.IS_SF)};Graph.prototype.getCellAt=function(y,C,P,G,O,U){this.useCssTransforms&&-(y=y/this.currentScale-this.currentTranslate.x,C=C/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(y,C,P,G,O,U){G=null!=G?G:!0;O=null!=O?O:!0;null==P&&(P=this.getCurrentRoot(),null==P&&(P=this.getModel().getRoot()));if(null!=P)for(var c=this.model.getChildCount(P)-1;0<=c;c--){var f=this.model.getChildAt(P,c),k=this.getScaledCellAt(y,C,f,G,O,U);if(null!=k)return k;if(this.isCellVisible(f)&&(O&&this.model.isEdge(f)||-G&&this.model.isVertex(f))&&(k=this.view.getState(f),null!=k&&(null==U||!U(k,y,C))&&this.intersects(k,y,C)))return f}return null};Graph.prototype.isRecursiveVertexResize=function(y){return!this.isSwimlane(y.cell)&&0<this.model.getChildCount(y.cell)&&!this.isCellCollapsed(y.cell)&&"1"==mxUtils.getValue(y.style,"recursiveResize","1")&&null==mxUtils.getValue(y.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(y){for(var C=this.getCellGeometry(y);null!=C&&C.relative;)y=this.getModel().getParent(y),-C=this.getCellGeometry(y);return y};Graph.prototype.isPart=function(y){return"1"==mxUtils.getValue(this.getCurrentCellStyle(y),"part","0")||this.isTableCell(y)||this.isTableRow(y)};Graph.prototype.getCompositeParents=function(y){for(var C=new mxDictionary,P=[],G=0;G<y.length;G++){var O=this.getCompositeParent(y[G]);this.isTableCell(O)&&(O=this.graph.model.getParent(O));this.isTableRow(O)&&(O=this.graph.model.getParent(O));null==O||C.get(O)||(C.put(O,!0),P.push(O))}return P};Graph.prototype.getReferenceTerminal=-function(y){if(null!=y){var C=this.getCellGeometry(y);null!=C&&C.relative&&(y=this.model.getParent(y))}null!=y&&this.model.isEdge(y)&&(y=this.model.getParent(y));null!=y&&(y=this.getCompositeParent(y));return y};Graph.prototype.getCompositeParent=function(y){for(;this.isPart(y);){var C=this.model.getParent(y);if(!this.model.isVertex(C))break;y=C}return y};Graph.prototype.orderCells=function(y,C,P){if(null==C){C=mxUtils.sortCells(this.getEditableCells(this.getSelectionCells()),!0);for(var G=new mxDictionary,-O=[],U=0;U<C.length;U++){for(var c=C[U];this.isTableCell(c)||this.isTableRow(c);)c=this.model.getParent(c);G.get(c)||(G.put(c,!0),O.push(c))}C=O}return mxGraph.prototype.orderCells.call(this,y,C,P)};Graph.prototype.filterSelectionCells=function(y){var C=this.getSelectionCells();if(null!=y){for(var P=[],G=0;G<C.length;G++)y(C[G])||P.push(C[G]);C=P}return C};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(y){if(this.useCssTransforms){var C=this.currentScale,-P=this.currentTranslate;y=new mxRectangle((y.x+2*P.x)*C-P.x,(y.y+2*P.y)*C-P.y,y.width*C,y.height*C)}b.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=function(y){y=this.strokeWidth;this.graph.useCssTransforms&&(y/=this.graph.currentScale);return y};mxGraphView.prototype.getGraphBounds=function(){var y=this.graphBounds;if(this.graph.useCssTransforms){var C=this.graph.currentTranslate,P=this.graph.currentScale;y=new mxRectangle((y.x+C.x)*P,(y.y+C.y)*P,y.width*P,y.height*P)}return y};+(function(){Graph.prototype.useCssTransforms=!1;Graph.prototype.currentScale=1;Graph.prototype.currentTranslate=new mxPoint(0,0);Graph.prototype.pasteEdgeStyle=!1;Graph.prototype.pasteStylesToText=!1;Graph.prototype.isFillState=function(y){var B=mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null);return!this.isSpecialColor(y.style[mxConstants.STYLE_FILLCOLOR])&&"1"!=mxUtils.getValue(y.style,"lineShape",null)&&"mxgraph.basic.arc"!=B&&(this.model.isVertex(y.cell)||"arrow"==B||"pipe"==B||"wire"==+B||"filledEdge"==B||"flexArrow"==B||"mermaidSankeyLink"==B||"mxgraph.arrows2.wedgeArrow"==B)};Graph.prototype.isGradientState=function(y){var B=mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null);return this.isFillState(y)&&"wire"!=B&&"pipe"!=B};Graph.prototype.isStrokeState=function(y){return!0};Graph.prototype.getTextColor=function(y,B){var P=B?"color":"background-color",G=null;if(null!=y&&window.getSelection)for(var O=window.getSelection(),U=y.getElementsByTagName("*"),c=0;c<U.length&&null==+G;c++)null!=U[c].style&&O.containsNode(U[c],!0)&&(G=Graph.getGivenColor(U[c],P));for(;null==G&&null!=y&&y!=this.cellEditor.textarea.parentNode;)G=y==this.cellEditor.textarea&&B?"default":Graph.getGivenColor(y,P),y=y.parentNode;if("rgba(0, 0, 0, 0)"==G||"transparent"==G)G=mxConstants.NONE;return G};Graph.prototype.isSpecialColor=function(y){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],y)};Graph.prototype.isGlassState=function(y){y=+mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null);return"label"==y||"rectangle"==y||"internalStorage"==y||"ext"==y||"umlLifeline"==y||"swimlane"==y||"process"==y||"ellipse"==y||"rhombus"==y};Graph.prototype.isRoundedState=function(y){return null!=y.shape?y.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isLineJumpState=function(y){var B=mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(y.style,+mxConstants.STYLE_CURVED,!1)&&("connector"==B||"filledEdge"==B||"wire"==B)};Graph.prototype.isAutoSizeState=function(y){return"1"==mxUtils.getValue(y.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isAutosizeTextState=function(y){return"1"==mxUtils.getValue(y.style,"autosizeText",null)};Graph.prototype.isAutosizeTextCell=function(y){y=this.getCurrentCellStyle(y);return null!=y&&"1"==y.autosizeText};Graph.prototype.isImageState=function(y){return null!=mxUtils.getValue(y.style,mxConstants.STYLE_IMAGE,+null)};Graph.prototype.isShadowState=function(y){return!0};Graph.prototype.getVerticesAndEdges=function(y,B){y=null!=y?y:!0;B=null!=B?B:!0;var P=this.model;return P.filterDescendants(function(G){return y&&P.isVertex(G)||B&&P.isEdge(G)},P.getRoot())};Graph.prototype.applyNewEdgeStyle=function(y,B,P){y=this.getCellStyle(y).newEdgeStyle;if(null!=y){this.model.beginUpdate();try{var G=Graph.decodeNewEdgeStyle(y),O;for(O in G)this.setCellStyles(O,G[O],B),"edgeStyle"==O&&"elbowEdgeStyle"==G[O]&&null!=P&&+this.setCellStyles("elbow",P==mxConstants.DIRECTION_SOUTH||P==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",B)}finally{this.model.endUpdate()}}this.model.beginUpdate();try{for(P=0;P<B.length;P++){var U=this.model.getTerminal(B[P],!0);null!=U&&U==this.model.getTerminal(B[P],!1)&&this.applyLoopStyle(B[P],U)}}finally{this.model.endUpdate()}};Graph.prototype.applyLoopStyle=function(y,B){var P=this.getCellGeometry(B);B=this.getCellGeometry(y);if(null!=P&&null!=B){var G=this.gridSize,O=P.x+P.width++4*G;P=P.y+P.height/2;B=B.clone();B.points=[new mxPoint(O,P-2*G),new mxPoint(O,P+2*G)];this.model.beginUpdate();try{this.model.setGeometry(y,B),this.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[y]),this.setCellStyles("innerLoopWaypoints","1",[y])}finally{this.model.endUpdate()}}};Graph.prototype.getLoopFixedAxis=function(y){var B=null!=y?y.getVisibleTerminalState(!0):null;if(null==B||0==B.width||0==B.height)return null;var P=y.view;if(null==P.getPerimeterFunction(B))return null;var G=+B.getCenterX(),O=B.getCenterY(),U=Math.max(B.width,B.height)+100;y=P.getPerimeterPoint(B,new mxPoint(G+U,O),!1);var c=P.getPerimeterPoint(B,new mxPoint(G-U,O),!1),f=P.getPerimeterPoint(B,new mxPoint(G,O-U),!1);P=P.getPerimeterPoint(B,new mxPoint(G,O+U),!1);f=null!=f&&null!=P&&Math.abs(f.y-P.y)<B.height/4;return null!=y&&null!=c&&Math.abs(y.x-c.x)<B.width/4?"x":f?"y":null};Graph.prototype.loopHasFixedAnchorLine=function(y){return null!=this.getLoopFixedAxis(y)};Graph.prototype.getLoopAroundPoints=+function(y,B){var P=null!=y?y.getVisibleTerminalState(!0):null,G=null!=y?this.getCellGeometry(y.cell):null;if(null==P||null==B||null==G)return null;var O=y.view.scale,U=y.view.translate,c=y.origin,f=P.x/O-U.x-c.x,k=P.y/O-U.y-c.y,q=P.width/O,x=P.height/O,C=new mxPoint(B.x/O-U.x-c.x,B.y/O-U.y-c.y);var E=y.absolutePoints;null!=G.points&&2<=G.points.length?(B=G.points[0],E=G.points[G.points.length-1]):null!=E&&4<=E.length?(B=new mxPoint(E[1].x/O-U.x-c.x,E[1].y/O-U.y-c.y),E=new mxPoint(E[E.length-2].x/+O-U.x-c.x,E[E.length-2].y/O-U.y-c.y)):(B=new mxPoint(f+q/2,k+x/2-this.gridSize),E=new mxPoint(f+q/2,k+x/2+this.gridSize));G=Math.abs(B.x-E.x)>=Math.abs(B.y-E.y);B=Math.max(this.gridSize,G?Math.abs(B.x-E.x):Math.abs(B.y-E.y));var L=this.gridSize;E=this.loopHasFixedAnchorLine(y);var Q=y.absolutePoints;Q=null!=Q&&null!=Q[0]?new mxPoint(Q[0].x/O-U.x-c.x,Q[0].y/O-U.y-c.y):null;if(E&&null!=Q){if(G)return k=C.y>=Q.y?Math.max(Q.y+L,C.y):Math.min(Q.y-L,C.y),[new mxPoint(C.x-B/2,k),new mxPoint(C.x+B/2,k)];+Q=C.x>=Q.x?Math.max(Q.x+L,C.x):Math.min(Q.x-L,C.x);return[new mxPoint(Q,C.y-B/2),new mxPoint(Q,C.y+B/2)]}var V=f+q/2,K=k+x/2,fa=function(aa,da,ba){aa=y.view.getPerimeterPoint(P,new mxPoint((aa+U.x+c.x)*O,(da+U.y+c.y)*O),ba);return null!=aa?new mxPoint(aa.x/O-U.x-c.x,aa.y/O-U.y-c.y):null};G=function(aa,da,ba,ha){aa=fa(aa,da,!0);ba=fa(ba,ha,!0);return null==aa||null==ba||2>Math.abs(aa.x-V)&&2>Math.abs(aa.y-K)||2>Math.abs(ba.x-V)&&2>Math.abs(ba.y-K)?!0:Math.abs(aa.x-ba.x)<L/2&&Math.abs(aa.y-ba.y)<L/+2};E=fa(C.x,C.y,!1);if(null==E||1>Math.abs(E.x-V)&&1>Math.abs(E.y-K))E=new mxPoint(V,K);if(Math.abs(E.y-K)>=Math.abs(E.x-V)){B=Math.max(this.gridSize,Math.min(B,q));k=E.y>=K?Math.max(E.y+L,C.y):Math.min(E.y-L,C.y);C=Math.max(f+B/2,Math.min(f+q-B/2,C.x));for(f=0;f<=q/this.gridSize&&G(C-B/2,k,C+B/2,k);f++)C=C<V?Math.min(V,C+this.gridSize):Math.max(V,C-this.gridSize);E=E.y>=K?this.gridSize:-this.gridSize;for(f=0;f<=(q+x)/this.gridSize&&G(C-B/2,k,C+B/2,k);f++)k+=E;return[new mxPoint(C-B/2,k),new mxPoint(C++B/2,k)]}B=Math.max(this.gridSize,Math.min(B,x));Q=E.x>=V?Math.max(E.x+L,C.x):Math.min(E.x-L,C.x);k=Math.max(k+B/2,Math.min(k+x-B/2,C.y));for(f=0;f<=x/this.gridSize&&G(Q,k-B/2,Q,k+B/2);f++)k=k<K?Math.min(K,k+this.gridSize):Math.max(K,k-this.gridSize);C=E.x>=V?this.gridSize:-this.gridSize;for(f=0;f<=(q+x)/this.gridSize&&G(Q,k-B/2,Q,k+B/2);f++)Q+=C;return[new mxPoint(Q,k-B/2),new mxPoint(Q,k+B/2)]};Graph.prototype.keepLoopOutsideShape=function(y,B){var P=null!=y?y.getVisibleTerminalState(!0):null;if(null==+P||null==B||0==B.length)return B;var G=y.view.scale,O=y.view.translate,U=y.origin,c=P.x/G-O.x-U.x,f=P.y/G-O.y-U.y,k=P.width/G,q=P.height/G;if(this.loopHasFixedAnchorLine(y))return B;c+=k/2;f+=q/2;q=this.gridSize;k=[];for(var x=0;x<B.length;x++){var C=B[x];if(null==C)k.push(C);else{var E=new mxPoint(C.x,C.y),L=y.view.getPerimeterPoint(P,new mxPoint((C.x+O.x+U.x)*G,(C.y+O.y+U.y)*G),!1);if(null!=L){var Q=L.x/G-O.x-U.x;L=L.y/G-O.y-U.y;var V=C.x-c;C=C.y-f;var K=Math.sqrt(V*V+C*C);K<Math.sqrt((Q-c)*(Q-+c)+(L-f)*(L-f))-.5&&(1>K&&(V=0,K=C=1),E.x=Q+V/K*q,E.y=L+C/K*q)}k.push(E)}}return k};Graph.prototype.getCommonStyle=function(y){for(var B={},P=0;P<y.length;P++){var G=this.view.getState(y[P]);null!=G&&this.mergeStyle(G.style,B,0==P)}return B};Graph.prototype.mergeStyle=function(y,B,P){if(null!=y){var G={},O;for(O in y){var U=y[O];null!=U&&(G[O]=!0,null==B[O]&&P?B[O]=U:B[O]!=U&&delete B[O])}for(O in B)G[O]||delete B[O]}};Graph.prototype.getStartEditingCell=function(y,B){B=this.getCellStyle(y);B=parseInt(mxUtils.getValue(B,+mxConstants.STYLE_STARTSIZE,0));this.isTable(y)&&(!this.isSwimlane(y)||0==B)&&""==this.getLabel(y)&&0<this.model.getChildCount(y)&&(y=this.model.getChildAt(y,0),B=this.getCellStyle(y),B=parseInt(mxUtils.getValue(B,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(y)&&(!this.isSwimlane(y)||0==B)&&""==this.getLabel(y)&&0<this.model.getChildCount(y))for(B=0;B<this.model.getChildCount(y);B++){var P=this.model.getChildAt(y,B);if(this.isCellEditable(P)){y=P;break}}return y};Graph.prototype.copyStyle=+function(y){return this.getCellStyle(y,!1)};Graph.prototype.pasteStyle=function(y,B,P,G){null!=y&&(G||(P=null!=P?P:Graph.cellStyles,Graph.removeKeys(y,function(O){return 0>mxUtils.indexOf(P,O)})),this.updateCellStyles(y,B))};Graph.prototype.copyCellStyles=function(y,B,P,G,O,U,c,f){var k=!1,q=!1;if(0<y.length)for(var x=0;x<y.length&&(k=this.getModel().isVertex(y[x])||k,!(q=this.getModel().isEdge(y[x])||q)||!k);x++);else q=k=!0;k=k&&!U;q=q&&!c;for(x=0;x<B.length;x++)if(y=0<=mxUtils.indexOf(Graph.textStyles,+B[x]),"strokeColor"!=B[x]||null!=P[x]&&"none"!=P[x])if(0<=mxUtils.indexOf(Graph.cellStyles,B[x])||"shape"==B[x])if("shape"!=B[x]&&(k||y&&!U)&&!f&&(null==P[x]?delete G[B[x]]:G[B[x]]=P[x]),q||y&&!c)null==P[x]?delete O[B[x]]:O[B[x]]=P[x]};Graph.prototype.includeDescendants=function(y){for(var B=[],P=0;P<y.length;P++)B=B.concat(this.model.getDescendants(y[P]));return B};Graph.prototype.includeDescendantParts=function(y){for(var B=y.slice(),P=mxUtils.bind(this,function(O){for(var U=0;U<this.model.getChildCount(O);U++){var c=+this.model.getChildAt(O,U);"1"==mxUtils.getValue(this.getCurrentCellStyle(c),"part","0")&&(B.push(c),P(c))}}),G=0;G<y.length;G++)P(y[G]);return B};Graph.prototype.pasteCellStyles=function(y,B,P,G,O,U){B=null!=B?B:this.currentVertexStyle;P=null!=P?P:this.currentEdgeStyle;O=null!=O?O:this.pasteEdgeStyle;U=null!=U?U:this.pasteStylesToText;this.model.beginUpdate();try{for(var c=0;c<y.length;c++){var f=y[c],k=this.model.getStyle(f),q=!1;null!=f.style&&"string"===typeof f.style&&(pairs=f.style.split(";"),+q=q||0<=mxUtils.indexOf(pairs,"text"));var x=this.model.isVertex(f)&&this.model.isEdge(this.model.getParent(f));if(q||x)var C=q&&!x&&U?Graph.cellStyles:Graph.textStyles;else if(C=Graph.cellStyles.slice(),!G)for(var E="string"===typeof k?k.split(";"):[],L=0;L<E.length;L++){var Q=E[L],V=Q.indexOf("=");if(0<=V){var K=Q.substring(0,V),fa=mxUtils.indexOf(C,K);0<=fa&&C.splice(fa,1);for(q=0;q<Graph.cellStyleGroups.length;q++){var aa=Graph.cellStyleGroups[q];if(0<=mxUtils.indexOf(aa,K))for(var da=0;da<aa.length;da++){var ba=+mxUtils.indexOf(C,aa[da]);0<=ba&&C.splice(ba,1)}}}}var ha=this.model.isEdge(f);q=ha||x?P:B;for(L=0;L<C.length;L++){K=C[L];var qa=q[K];if("edgeStyle"!=K||O)if(ha||!ha&&0>mxUtils.indexOf(Graph.edgeStyles,K))null!=qa?(k=mxUtils.setStyle(k,K,qa),"fontFamily"==K&&null==q.fontSource&&(k=mxUtils.setStyle(k,"fontSource",null)),ha&&"rounded"==K&&"1"==qa&&null==q.curved&&(k=mxUtils.setStyle(k,"curved",null))):G&&(k=mxUtils.setStyle(k,K,null))}Editor.simpleLabels&&(k=mxUtils.setStyle(mxUtils.setStyle(k,"html",+null),"whiteSpace",null));this.model.setStyle(f,k)}}finally{this.model.endUpdate()}return y};Graph.prototype.pasteTextStyles=function(y,B){this.model.beginUpdate();try{for(var P=0;P<y.length;P++){var G=y[P];if(this.model.isVertex(G)||this.model.isEdge(G)){for(var O=this.model.getStyle(G),U=0;U<Graph.pasteTextStyles.length;U++){var c=Graph.pasteTextStyles[U],f=B[c];null!=f&&(O=mxUtils.setStyle(O,c,f),"fontFamily"==c&&null==B.fontSource&&(O=mxUtils.setStyle(O,"fontSource",null)))}Editor.simpleLabels&&+(O=mxUtils.setStyle(mxUtils.setStyle(O,"html",null),"whiteSpace",null));this.model.setStyle(G,O)}}}finally{this.model.endUpdate()}return y};Graph.prototype.updateCellStyles=function(y,B){this.model.beginUpdate();try{for(var P=0;P<B.length;P++)if(this.model.isVertex(B[P])||this.model.isEdge(B[P])){var G=this.getCellStyle(B[P],!1),O=G[mxConstants.STYLE_PERIMETER],U=!1;for(f in y){var c=y[f];if(G[f]!=c){if(f==mxConstants.STYLE_SHAPE&&"umlLifeline"==G[f]&&"umlLifeline"!=c){U=!0;var f="participant"}this.setCellStyles(f,+c,[B[P]])}}U&&this.setCellStyles(mxConstants.STYLE_PERIMETER,O,[B[P]])}}finally{this.model.endUpdate()}};Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&(this.isCssTransformsSupported()||mxClient.IS_IOS)};Graph.prototype.isCssTransformsSupported=function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO&&(!this.lightbox||!mxClient.IS_SF)};Graph.prototype.getCellAt=function(y,B,P,G,O,U){this.useCssTransforms&&+(y=y/this.currentScale-this.currentTranslate.x,B=B/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(y,B,P,G,O,U){G=null!=G?G:!0;O=null!=O?O:!0;null==P&&(P=this.getCurrentRoot(),null==P&&(P=this.getModel().getRoot()));if(null!=P)for(var c=this.model.getChildCount(P)-1;0<=c;c--){var f=this.model.getChildAt(P,c),k=this.getScaledCellAt(y,B,f,G,O,U);if(null!=k)return k;if(this.isCellVisible(f)&&(O&&this.model.isEdge(f)||+G&&this.model.isVertex(f))&&(k=this.view.getState(f),null!=k&&(null==U||!U(k,y,B))&&this.intersects(k,y,B)))return f}return null};Graph.prototype.isRecursiveVertexResize=function(y){return!this.isSwimlane(y.cell)&&0<this.model.getChildCount(y.cell)&&!this.isCellCollapsed(y.cell)&&"1"==mxUtils.getValue(y.style,"recursiveResize","1")&&null==mxUtils.getValue(y.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(y){for(var B=this.getCellGeometry(y);null!=B&&B.relative;)y=this.getModel().getParent(y),+B=this.getCellGeometry(y);return y};Graph.prototype.isPart=function(y){return"1"==mxUtils.getValue(this.getCurrentCellStyle(y),"part","0")||this.isTableCell(y)||this.isTableRow(y)};Graph.prototype.getCompositeParents=function(y){for(var B=new mxDictionary,P=[],G=0;G<y.length;G++){var O=this.getCompositeParent(y[G]);this.isTableCell(O)&&(O=this.graph.model.getParent(O));this.isTableRow(O)&&(O=this.graph.model.getParent(O));null==O||B.get(O)||(B.put(O,!0),P.push(O))}return P};Graph.prototype.getReferenceTerminal=+function(y){if(null!=y){var B=this.getCellGeometry(y);null!=B&&B.relative&&(y=this.model.getParent(y))}null!=y&&this.model.isEdge(y)&&(y=this.model.getParent(y));null!=y&&(y=this.getCompositeParent(y));return y};Graph.prototype.getCompositeParent=function(y){for(;this.isPart(y);){var B=this.model.getParent(y);if(!this.model.isVertex(B))break;y=B}return y};Graph.prototype.orderCells=function(y,B,P){if(null==B){B=mxUtils.sortCells(this.getEditableCells(this.getSelectionCells()),!0);for(var G=new mxDictionary,+O=[],U=0;U<B.length;U++){for(var c=B[U];this.isTableCell(c)||this.isTableRow(c);)c=this.model.getParent(c);G.get(c)||(G.put(c,!0),O.push(c))}B=O}return mxGraph.prototype.orderCells.call(this,y,B,P)};Graph.prototype.filterSelectionCells=function(y){var B=this.getSelectionCells();if(null!=y){for(var P=[],G=0;G<B.length;G++)y(B[G])||P.push(B[G]);B=P}return B};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(y){if(this.useCssTransforms){var B=this.currentScale,+P=this.currentTranslate;y=new mxRectangle((y.x+2*P.x)*B-P.x,(y.y+2*P.y)*B-P.y,y.width*B,y.height*B)}b.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=function(y){y=this.strokeWidth;this.graph.useCssTransforms&&(y/=this.graph.currentScale);return y};mxGraphView.prototype.getGraphBounds=function(){var y=this.graphBounds;if(this.graph.useCssTransforms){var B=this.graph.currentTranslate,P=this.graph.currentScale;y=new mxRectangle((y.x+B.x)*P,(y.y+B.y)*P,y.width*P,y.height*P)}return y};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var d=mxGraphView.prototype.validate;mxGraphView.prototype.validate=function(y){this.graph.useCssTransforms&&(this.graph.currentScale=this.scale,this.graph.currentTranslate.x=this.translate.x,this.graph.currentTranslate.y=this.translate.y,this.scale=1,this.translate.x=0,this.translate.y=0);d.apply(this,arguments);this.graph.useCssTransforms&&(this.graph.updateCssTransform(),-this.scale=this.graph.currentScale,this.translate.x=this.graph.currentTranslate.x,this.translate.y=this.graph.currentTranslate.y)};var m=mxGraph.prototype.getCellsForGroup;Graph.prototype.getCellsForGroup=function(y){y=m.apply(this,arguments);for(var C=[],P=0;P<y.length;P++)this.isTableRow(y[P])||this.isTableCell(y[P])||C.push(y[P]);return C};var p=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(y){y=p.apply(this,arguments);for(var C=[],P=0;P<y.length;P++)this.isTable(y[P])||-this.isTableRow(y[P])||this.isTableCell(y[P])||C.push(y[P]);return C};Graph.prototype.updateCssTransform=function(){var y=this.view.getDrawPane();if(null!=y)if(y=y.parentNode,this.useCssTransforms){var C=y.getAttribute("transform");y.setAttribute("transformOrigin","0 0");var P=Math.round(100*this.currentScale)/100,G=Math.round(100*this.currentTranslate.x)/100,O=Math.round(100*this.currentTranslate.y)/100;this.armTransformTransition?this.armTransformTransition=!1:""!=y.style.transition&&(y.style.transition=-"");y.setAttribute("transform","scale("+P+","+P+")translate("+G+","+O+")");C!=y.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",y.getAttribute("transform"))}else y.removeAttribute("transformOrigin"),y.removeAttribute("transform")};var v=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var y=this.graph.useCssTransforms,C=this.scale,P=this.translate;y&&(this.scale=this.graph.currentScale,this.translate=-this.graph.currentTranslate);v.apply(this,arguments);y&&(this.scale=C,this.translate=P)};var n=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(y,C,P){var G=this.useCssTransforms,O=this.view.scale,U=this.view.translate;G&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=!1);n.apply(this,arguments);G&&(this.view.scale=O,this.view.translate=U,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};+this.scale=this.graph.currentScale,this.translate.x=this.graph.currentTranslate.x,this.translate.y=this.graph.currentTranslate.y)};var m=mxGraph.prototype.getCellsForGroup;Graph.prototype.getCellsForGroup=function(y){y=m.apply(this,arguments);for(var B=[],P=0;P<y.length;P++)this.isTableRow(y[P])||this.isTableCell(y[P])||B.push(y[P]);return B};var p=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(y){y=p.apply(this,arguments);for(var B=[],P=0;P<y.length;P++)this.isTable(y[P])||+this.isTableRow(y[P])||this.isTableCell(y[P])||B.push(y[P]);return B};Graph.prototype.updateCssTransform=function(){var y=this.view.getDrawPane();if(null!=y)if(y=y.parentNode,this.useCssTransforms){var B=y.getAttribute("transform");y.setAttribute("transformOrigin","0 0");var P=Math.round(100*this.currentScale)/100,G=Math.round(100*this.currentTranslate.x)/100,O=Math.round(100*this.currentTranslate.y)/100;this.armTransformTransition?this.armTransformTransition=!1:""!=y.style.transition&&(y.style.transition=+"");y.setAttribute("transform","scale("+P+","+P+")translate("+G+","+O+")");B!=y.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",y.getAttribute("transform"))}else y.removeAttribute("transformOrigin"),y.removeAttribute("transform")};var u=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var y=this.graph.useCssTransforms,B=this.scale,P=this.translate;y&&(this.scale=this.graph.currentScale,this.translate=+this.graph.currentTranslate);u.apply(this,arguments);y&&(this.scale=B,this.translate=P)};var n=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(y,B,P){var G=this.useCssTransforms,O=this.view.scale,U=this.view.translate;G&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=!1);n.apply(this,arguments);G&&(this.view.scale=O,this.view.translate=U,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};Graph.prototype.labelLinkClicked=function(b,d,m){var p=d.getAttribute("href");p!=Graph.sanitizeLink(p)&&Graph.sanitizeNode(d);if(null!=p&&!this.isCustomLink(p)&&(mxEvent.isLeftMouseButton(m)&&!mxEvent.isPopupTrigger(m)||mxEvent.isTouchEvent(m))){if(!this.isEnabled()||this.isCellLocked(b.cell))b=this.isBlankLink(p)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(p),b);mxEvent.consume(m)}};-Graph.prototype.openLink=function(b,d,m){var p=window;try{if(b=Graph.sanitizeLink(b),null!=b)if("_self"==d&&window!=window.top)window.location.href=b;else if(b.substring(0,this.baseUrl.length)!=this.baseUrl||"#"!=b.charAt(this.baseUrl.length)||"_top"!=d||window!=window.top||navigator.standalone)Editor.suppressNewWindows||(p=window.open(b,null!=d?d:"_blank",m?null:"noopener,noreferrer"),null==p||m||(p.opener=null));else{var v=b.split("#")[1];window.location.hash=="#"+v&&(window.location.hash="");window.location.hash=-v}}catch(n){}return p};Graph.prototype.getLinkTitle=function(b){return b.substring(b.lastIndexOf("/")+1)};Graph.prototype.isCustomLink=function(b){return"data:"==b.substring(0,5)};Graph.prototype.customLinkClicked=function(b,d){return!1};Graph.prototype.isExternalProtocol=function(b){return"mailto:"===b.substring(0,7)};+Graph.prototype.openLink=function(b,d,m){var p=window;try{if(b=Graph.sanitizeLink(b),null!=b)if("_self"==d&&window!=window.top)window.location.href=b;else if(b.substring(0,this.baseUrl.length)!=this.baseUrl||"#"!=b.charAt(this.baseUrl.length)||"_top"!=d||window!=window.top||navigator.standalone)Editor.suppressNewWindows||(p=window.open(b,null!=d?d:"_blank",m?null:"noopener,noreferrer"),null==p||m||(p.opener=null));else{var u=b.split("#")[1];window.location.hash=="#"+u&&(window.location.hash="");window.location.hash=+u}}catch(n){}return p};Graph.prototype.getLinkTitle=function(b){return b.substring(b.lastIndexOf("/")+1)};Graph.prototype.isCustomLink=function(b){return"data:"==b.substring(0,5)};Graph.prototype.customLinkClicked=function(b,d){return!1};Graph.prototype.isExternalProtocol=function(b){return"mailto:"===b.substring(0,7)};Graph.prototype.isBlankLink=function(b){return!this.isExternalProtocol(b)&&("blank"===this.linkPolicy||"self"!==this.linkPolicy&&!this.isRelativeUrl(b)&&b.substring(0,this.domainUrl.length)!==this.domainUrl)};Graph.prototype.isRelativeUrl=function(b){return null!=b&&!this.absoluteUrlPattern.test(b)&&"data:"!==b.substring(0,5)&&!this.isExternalProtocol(b)};Graph.prototype.getAbsoluteUrl=function(b){null!=b&&this.isRelativeUrl(b)&&(b="#"==b.charAt(0)?this.baseUrl+b:"/"==b.charAt(0)?this.domainUrl+b:this.domainPathUrl+b);return b};Graph.prototype.initLayoutManager=function(){this.layoutManager=new mxLayoutManager(this);this.layoutManager.hasLayout=function(b){return null!=this.graph.getCellStyle(b).childLayout};this.layoutManager.getLayout=function(b,d){var m=this.graph.model.getParent(b);if(!this.graph.isCellCollapsed(b)&&(d!=mxEvent.BEGIN_UPDATE||this.hasLayout(m,d))){d=this.graph.getCellStyle(b);var p=this.graph.isTransparentBounds(b);if("stackLayout"==d.childLayout)return b=new mxStackLayout(this.graph,!0),b.resizeParentMax=!p&&"1"==mxUtils.getValue(d,"resizeParentMax","1"),b.horizontal="1"==mxUtils.getValue(d,"horizontalStack","1"),b.resizeParent=!p&&"1"==mxUtils.getValue(d,"resizeParent","1"),b.resizeLast=!p&&"1"==mxUtils.getValue(d,"resizeLast","0"),b.spacing=d.stackSpacing||b.spacing,b.border=d.stackBorder||b.border,b.marginLeft=d.marginLeft||0,b.marginRight=d.marginRight||0,b.marginTop=d.marginTop||0,b.marginBottom=d.marginBottom||0,b.allowGaps=d.allowGaps||0,b.fill=!p,b.allowGaps&&(b.gridSize=parseFloat(mxUtils.getValue(d,"stackUnitSize",20))),b;if("treeLayout"==d.childLayout)return b=new mxCompactTreeLayout(this.graph),b.horizontal="1"==mxUtils.getValue(d,"horizontalTree","1"),b.resizeParent=!p&&"1"==mxUtils.getValue(d,"resizeParent","1"),b.sortEdges="1"==mxUtils.getValue(d,"sortEdges","0"),b.groupPadding=mxUtils.getValue(d,"parentPadding",20),b.levelDistance=mxUtils.getValue(d,"treeLevelDistance",30),b.maintainParentLocation=!0,b.edgeRouting=!1,b.resetEdges=!1,b;if("flowLayout"==d.childLayout)return b=new mxHierarchicalLayout(this.graph,mxUtils.getValue(d,"flowOrientation",mxConstants.DIRECTION_EAST)),b.resizeParent=!p&&"1"==mxUtils.getValue(d,"resizeParent","1"),b.parentBorder=mxUtils.getValue(d,"parentPadding",20),b.maintainParentLocation=!0,b.intraCellSpacing=mxUtils.getValue(d,"intraCellSpacing",mxHierarchicalLayout.prototype.intraCellSpacing),b.interRankCellSpacing=mxUtils.getValue(d,"interRankCellSpacing",mxHierarchicalLayout.prototype.interRankCellSpacing),b.interHierarchySpacing=mxUtils.getValue(d,"interHierarchySpacing",-mxHierarchicalLayout.prototype.interHierarchySpacing),b.parallelEdgeSpacing=mxUtils.getValue(d,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),b;if("circleLayout"==d.childLayout){b=new mxCircleLayout(this.graph);b.resizeParent=!p&&"1"==mxUtils.getValue(d,"resizeParent","1");var v=parseFloat(mxUtils.getValue(d,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));v=isNaN(v)?mxConstants.DEFAULT_STARTSIZE:v;d="0"==mxUtils.getValue(d,mxConstants.STYLE_HORIZONTAL,"1");b.moveCircle=-!0;b.x0=d?v+20:20;b.y0=d?20:v+20;var n=this.graph,y=b.execute;b.execute=function(C){var P=n.getModel(),G=function(){for(var q=null,x=P.getChildCount(C),B=0;B<x;B++){var E=P.getChildAt(C,B);E=P.isVertex(E)?P.getGeometry(E):null;null==E||E.relative||(q=null==q?new mxPoint(E.x,E.y):new mxPoint(Math.min(q.x,E.x),Math.min(q.y,E.y)))}return q},O=p?G():null;y.apply(this,arguments);if(null!=O){var U=G();if(null!=U&&(O.x!=U.x||O.y!=U.y)){var c=P.getChildCount(C);for(G=0;G<c;G++){var f=P.getChildAt(C,G),k=-P.isVertex(f)?P.getGeometry(f):null;null==k||k.relative||n.translateCell(f,O.x-U.x,O.y-U.y)}}}O=P.getGeometry(C);if(this.resizeParent&&null!=O){c=U=0;f=P.getChildCount(C);for(G=0;G<f;G++)k=P.getGeometry(P.getChildAt(C,G)),null==k||k.relative||(U=Math.max(U,k.x+k.width),c=Math.max(c,k.y+k.height));0<U&&0<c&&(O.width!=U+20||O.height!=c+20)&&(O=O.clone(),O.width=U+20,O.height=c+20,P.setGeometry(C,O))}};return b}if("organicLayout"==d.childLayout)return new mxFastOrganicLayout(this.graph);if("tableLayout"==-d.childLayout)return new TableLayout(this.graph);if(null!=d.childLayout)try{if(v=Graph.decodeChildLayout(d.childLayout),null!=v)return new mxCompositeLayout(this.graph,this.graph.createLayouts(v,{enforceCorners:!1}))}catch(C){null!=window.console&&console.error(C)}}return null};this.layoutManager.executeLayout=function(b,d){this.graph.model.contains(b)&&(d=this.getLayout(b,d?mxEvent.BEGIN_UPDATE:mxEvent.END_UPDATE),null!=d&&(this.graph.isAsyncLayout(d)?this.graph.canExecuteLayoutSync(d)?this.graph.executeLayoutSync(d,+mxHierarchicalLayout.prototype.interHierarchySpacing),b.parallelEdgeSpacing=mxUtils.getValue(d,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),b;if("circleLayout"==d.childLayout){b=new mxCircleLayout(this.graph);b.resizeParent=!p&&"1"==mxUtils.getValue(d,"resizeParent","1");var u=parseFloat(mxUtils.getValue(d,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));u=isNaN(u)?mxConstants.DEFAULT_STARTSIZE:u;d="0"==mxUtils.getValue(d,mxConstants.STYLE_HORIZONTAL,"1");b.moveCircle=+!0;b.x0=d?u+20:20;b.y0=d?20:u+20;var n=this.graph,y=b.execute;b.execute=function(B){var P=n.getModel(),G=function(){for(var q=null,x=P.getChildCount(B),C=0;C<x;C++){var E=P.getChildAt(B,C);E=P.isVertex(E)?P.getGeometry(E):null;null==E||E.relative||(q=null==q?new mxPoint(E.x,E.y):new mxPoint(Math.min(q.x,E.x),Math.min(q.y,E.y)))}return q},O=p?G():null;y.apply(this,arguments);if(null!=O){var U=G();if(null!=U&&(O.x!=U.x||O.y!=U.y)){var c=P.getChildCount(B);for(G=0;G<c;G++){var f=P.getChildAt(B,G),k=+P.isVertex(f)?P.getGeometry(f):null;null==k||k.relative||n.translateCell(f,O.x-U.x,O.y-U.y)}}}O=P.getGeometry(B);if(this.resizeParent&&null!=O){c=U=0;f=P.getChildCount(B);for(G=0;G<f;G++)k=P.getGeometry(P.getChildAt(B,G)),null==k||k.relative||(U=Math.max(U,k.x+k.width),c=Math.max(c,k.y+k.height));0<U&&0<c&&(O.width!=U+20||O.height!=c+20)&&(O=O.clone(),O.width=U+20,O.height=c+20,P.setGeometry(B,O))}};return b}if("organicLayout"==d.childLayout)return new mxFastOrganicLayout(this.graph);if("tableLayout"==+d.childLayout)return new TableLayout(this.graph);if(null!=d.childLayout)try{if(u=Graph.decodeChildLayout(d.childLayout),null!=u)return new mxCompositeLayout(this.graph,this.graph.createLayouts(u,{enforceCorners:!1}))}catch(B){null!=window.console&&console.error(B)}}return null};this.layoutManager.executeLayout=function(b,d){this.graph.model.contains(b)&&(d=this.getLayout(b,d?mxEvent.BEGIN_UPDATE:mxEvent.END_UPDATE),null!=d&&(this.graph.isAsyncLayout(d)?this.graph.canExecuteLayoutSync(d)?this.graph.executeLayoutSync(d,b):this.graph.scheduleAsyncLayout(b):d.execute(b)))}};Graph.prototype.canExecuteLayoutSync=function(b){b=b.constructor===mxCompositeLayout&&null!=b.layouts?b.layouts:[b];for(var d=0;d<b.length;d++)if("function"===typeof b[d].prepare&&("function"!==typeof b[d].executeSync||"function"===typeof b[d].canExecuteSync&&!b[d].canExecuteSync()))return!1;return!0};Graph.prototype.executeLayoutSync=function(b,d){b=b.constructor===mxCompositeLayout&&null!=b.layouts?b.layouts:[b];for(var m=0;m<b.length;m++)try{"function"===typeof b[m].prepare&&"function"===typeof b[m].executeSync?b[m].executeSync(d):b[m].execute(d)}catch(p){null!=window.console&&console.error(p)}};Graph.prototype.isAsyncLayout=function(b){if(null==b)return!1;if("function"===typeof b.prepare)return!0;if(b.constructor===mxCompositeLayout&&null!=b.layouts)for(var d=0;d<b.layouts.length;d++)if("function"===typeof b.layouts[d].prepare)return!0;return!1};Graph.prototype.scheduleAsyncLayout=function(b){null==b||this.destroyed||null!=this.asyncLayoutsApplying&&this.asyncLayoutsApplying[b.id]||(null!=this.asyncLayoutsRunning&&null!=this.asyncLayoutsRunning[b.id]?this.asyncLayoutsRunning[b.id]="dirty":(this.pendingAsyncLayouts=this.pendingAsyncLayouts||[],0>mxUtils.indexOf(this.pendingAsyncLayouts,b)&&this.pendingAsyncLayouts.push(b),this.asyncLayoutsScheduled||(this.asyncLayoutsScheduled=!0,window.setTimeout(mxUtils.bind(this,function(){this.asyncLayoutsScheduled=-!1;var d=this.pendingAsyncLayouts;this.pendingAsyncLayouts=[];var m=function(n){for(var y=0;null!=n;)y++,n=n.parent;return y};d.sort(function(n,y){return m(y)-m(n)});var p=0,v=mxUtils.bind(this,function(){p<d.length&&this.runAsyncLayout(d[p++],v)});v()}),0))))};-Graph.prototype.runAsyncLayout=function(b,d){var m=this.getModel();d=null!=d?d:function(){};if(this.destroyed||null==this.layoutManager||!m.contains(b)||this.isCellCollapsed(b))d();else{var p=this.layoutManager.getLayout(b,mxEvent.END_UPDATE);if(null!=p&&this.isAsyncLayout(p)){var v=p.constructor===mxCompositeLayout&&null!=p.layouts?p.layouts:[p];this.asyncLayoutsRunning=this.asyncLayoutsRunning||{};this.asyncLayoutsRunning[b.id]="running";this.asyncLayoutsApplying=this.asyncLayoutsApplying||{};var n=-this,y=0,C=function(O){n.asyncLayoutsApplying[b.id]=!0;m.beginUpdate();try{O()}finally{m.endUpdate(),delete n.asyncLayoutsApplying[b.id]}},P=function(){var O="dirty"==n.asyncLayoutsRunning[b.id];delete n.asyncLayoutsRunning[b.id];O&&n.scheduleAsyncLayout(b);d()},G=function(){if(y>=v.length||n.destroyed||!m.contains(b))P();else{var O=v[y++];try{"function"===typeof O.prepare?O.prepare(b,function(U,c){if(null==U&&null!=c&&!n.destroyed&&m.contains(b))try{C(c)}catch(f){null!=window.console&&console.error(f)}else null!=-U&&null!=window.console&&console.error(U);G()}):(C(function(){O.execute(b)}),G())}catch(U){null!=window.console&&console.error(U),G()}}};G()}else d()}};Graph.encodeChildLayout=function(b){return encodeURIComponent(JSON.stringify(b))};Graph.decodeChildLayout=function(b){return null!=b&&(b=String(b),"%"==b.charAt(0)&&(b=decodeURIComponent(b)),"["==b.charAt(0))?JSON.parse(b):null};+!1;var d=this.pendingAsyncLayouts;this.pendingAsyncLayouts=[];var m=function(n){for(var y=0;null!=n;)y++,n=n.parent;return y};d.sort(function(n,y){return m(y)-m(n)});var p=0,u=mxUtils.bind(this,function(){p<d.length&&this.runAsyncLayout(d[p++],u)});u()}),0))))};+Graph.prototype.runAsyncLayout=function(b,d){var m=this.getModel();d=null!=d?d:function(){};if(this.destroyed||null==this.layoutManager||!m.contains(b)||this.isCellCollapsed(b))d();else{var p=this.layoutManager.getLayout(b,mxEvent.END_UPDATE);if(null!=p&&this.isAsyncLayout(p)){var u=p.constructor===mxCompositeLayout&&null!=p.layouts?p.layouts:[p];this.asyncLayoutsRunning=this.asyncLayoutsRunning||{};this.asyncLayoutsRunning[b.id]="running";this.asyncLayoutsApplying=this.asyncLayoutsApplying||{};var n=+this,y=0,B=function(O){n.asyncLayoutsApplying[b.id]=!0;m.beginUpdate();try{O()}finally{m.endUpdate(),delete n.asyncLayoutsApplying[b.id]}},P=function(){var O="dirty"==n.asyncLayoutsRunning[b.id];delete n.asyncLayoutsRunning[b.id];O&&n.scheduleAsyncLayout(b);d()},G=function(){if(y>=u.length||n.destroyed||!m.contains(b))P();else{var O=u[y++];try{"function"===typeof O.prepare?O.prepare(b,function(U,c){if(null==U&&null!=c&&!n.destroyed&&m.contains(b))try{B(c)}catch(f){null!=window.console&&console.error(f)}else null!=+U&&null!=window.console&&console.error(U);G()}):(B(function(){O.execute(b)}),G())}catch(U){null!=window.console&&console.error(U),G()}}};G()}else d()}};Graph.encodeChildLayout=function(b){return encodeURIComponent(JSON.stringify(b))};Graph.decodeChildLayout=function(b){return null!=b&&(b=String(b),"%"==b.charAt(0)&&(b=decodeURIComponent(b)),"["==b.charAt(0))?JSON.parse(b):null};Graph.decodeNewEdgeStyle=function(b){return null!=b?(b=String(b),"%"==b.charAt(0)&&(b=decodeURIComponent(b)),JSON.parse(b)):null};-Graph.prototype.createLayouts=function(b,d){for(var m=[],p=0;p<b.length;p++){var v=b[p].layout,n=b[p].config;if(null!=Graph.elkLayoutAlgorithms[v]){if("undefined"===typeof ElkLayout)throw Error(mxResources.get("invalidCallFnNotFound",[v]));n=Graph.elkConfigToOptions(n);if(null!=d)for(var y in d)n.options[y]=d[y];m.push(new ElkLayout(this,Graph.elkLayoutAlgorithms[v],n.layoutOptions,n.options))}else if("undefined"!==typeof LibavoidRouting&&v===LibavoidRouting.LAYOUT_NAME)m.push(LibavoidRouting.createLayout(this,-n));else if(0<=mxUtils.indexOf(Graph.layoutNames,v)){var C="mxOrgChartLayout"==v&&null!=n?new window[v](this,n.branchOptimizer):new window[v](this);if(null!=n)for(y in n)"function"===typeof C[y]||"mxOrgChartLayout"==v&&"branchOptimizer"==y||(C[y]=n[y]);m.push(C)}else throw Error(mxResources.get("invalidCallFnNotFound",[v]));}return m};+Graph.prototype.createLayouts=function(b,d){for(var m=[],p=0;p<b.length;p++){var u=b[p].layout,n=b[p].config;if(null!=Graph.elkLayoutAlgorithms[u]){if("undefined"===typeof ElkLayout)throw Error(mxResources.get("invalidCallFnNotFound",[u]));n=Graph.elkConfigToOptions(n);if(null!=d)for(var y in d)n.options[y]=d[y];m.push(new ElkLayout(this,Graph.elkLayoutAlgorithms[u],n.layoutOptions,n.options))}else if("undefined"!==typeof LibavoidRouting&&u===LibavoidRouting.LAYOUT_NAME)m.push(LibavoidRouting.createLayout(this,+n));else if(0<=mxUtils.indexOf(Graph.layoutNames,u)){var B="mxOrgChartLayout"==u&&null!=n?new window[u](this,n.branchOptimizer):new window[u](this);if(null!=n)for(y in n)"function"===typeof B[y]||"mxOrgChartLayout"==u&&"branchOptimizer"==y||(B[y]=n[y]);m.push(B)}else throw Error(mxResources.get("invalidCallFnNotFound",[u]));}return m};Graph.elkConfigToOptions=function(b){var d={},m={};if(null!=b)for(var p in b)0===p.indexOf("elk.")?d[p]=b[p]:"edgeStyle"===p?m.edgeStyleMode=b[p]:"corners"===p?m.corners=b[p]:"resizeNodes"===p?(m.applierOptions=m.applierOptions||{},m.applierOptions.resizeParent=!!b[p]):"preserveOrigin"===p||"useViewStateSizing"===p||"respectFixedPosition"===p||"mermaidPolicy"===p||"includeEdgeLabels"===p||"includeVertexLabels"===p||"portSpread"===p||"resizeLayoutRoot"===p||"extractIsolated"===p||"sharedStems"===p||"groupPadding"===p?m[p]=b[p]:"rootCellIds"===p&&(m.rootCellIds=b[p]);return{layoutOptions:d,options:m}};Graph.elkOptionsToConfig=function(b,d){var m={};if(null!=b)for(var p in b)m[p]=b[p];null!=d&&(null!=d.edgeStyleMode&&"auto"!==d.edgeStyleMode&&(m.edgeStyle=d.edgeStyleMode),null!=d.corners&&"keep"!==d.corners&&(m.corners=d.corners),null!=d.applierOptions&&null!=d.applierOptions.resizeParent&&(m.resizeNodes=!0===d.applierOptions.resizeParent),!1===d.preserveOrigin&&(m.preserveOrigin=!1),!1===d.sharedStems&&(m.sharedStems=!1),null!=d.groupPadding&&(m.groupPadding=d.groupPadding),null!=d.rootCellIds&&-0<d.rootCellIds.length&&(m.rootCellIds=d.rootCellIds.slice()));return m};Graph.prototype.getDataForCells=function(b,d){for(var m=[],p=0;p<b.length;p++){var v={};v.id=b[p].id;var n=null!=b[p].value?b[p].value.attributes:null;this.isReplacePlaceholders(b[p])&&d&&(v.value=this.getLabel(b[p]));if(null!=n)for(var y=0;y<n.length;y++)v[n[y].nodeName]=n[y].nodeValue;else v.label=this.convertValueToString(b[p]);m.push(v)}return m};-Graph.prototype.getNodesForCells=function(b){for(var d=[],m=0;m<b.length;m++){var p=this.view.getState(b[m]);if(null!=p){for(var v=this.cellRenderer.getShapesForState(p),n=0;n<v.length;n++)null!=v[n]&&null!=v[n].node&&d.push(v[n].node);null!=p.control&&null!=p.control.node&&d.push(p.control.node)}}return d};-Graph.prototype.createWipeAnimations=function(b,d){for(var m=[],p=0;p<b.length;p++){var v=this.view.getState(b[p]);null!=v&&null!=v.shape&&(this.model.isEdge(v.cell)&&null!=v.absolutePoints&&1<v.absolutePoints.length?m.push(this.createEdgeWipeAnimation(v,d)):this.model.isVertex(v.cell)&&null!=v.shape.bounds&&m.push(this.createVertexWipeAnimation(v,d)))}return m};-Graph.prototype.createEdgeWipeAnimation=function(b,d){var m=b.absolutePoints.slice(),p=b.segments,v=b.length,n=m.length;return{execute:mxUtils.bind(this,function(y,C){if(null!=b.shape){var P=[m[0]];C=y/C;d||(C=1-C);for(var G=v*C,O=1;O<n;O++)if(G<=p[O-1]){P.push(new mxPoint(m[O-1].x+(m[O].x-m[O-1].x)*G/p[O-1],m[O-1].y+(m[O].y-m[O-1].y)*G/p[O-1]));break}else G-=p[O-1],P.push(m[O]);b.shape.points=P;b.shape.redraw();0==y&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=-b.text.node&&(b.text.node.style.opacity=C)}}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.points=m,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),d?1:0))})}};-Graph.prototype.createVertexWipeAnimation=function(b,d){var m=new mxRectangle.fromRectangle(b.shape.bounds);return{execute:mxUtils.bind(this,function(p,v){null!=b.shape&&(v=p/v,d||(v=1-v),b.shape.bounds=new mxRectangle(m.x,m.y,m.width*v,m.height),b.shape.redraw(),0==p&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=v))}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.bounds=m,b.shape.redraw(),null!=b.text&&null!=b.text.node&&+0<d.rootCellIds.length&&(m.rootCellIds=d.rootCellIds.slice()));return m};Graph.prototype.getDataForCells=function(b,d){for(var m=[],p=0;p<b.length;p++){var u={};u.id=b[p].id;var n=null!=b[p].value?b[p].value.attributes:null;this.isReplacePlaceholders(b[p])&&d&&(u.value=this.getLabel(b[p]));if(null!=n)for(var y=0;y<n.length;y++)u[n[y].nodeName]=n[y].nodeValue;else u.label=this.convertValueToString(b[p]);m.push(u)}return m};+Graph.prototype.getNodesForCells=function(b){for(var d=[],m=0;m<b.length;m++){var p=this.view.getState(b[m]);if(null!=p){for(var u=this.cellRenderer.getShapesForState(p),n=0;n<u.length;n++)null!=u[n]&&null!=u[n].node&&d.push(u[n].node);null!=p.control&&null!=p.control.node&&d.push(p.control.node)}}return d};+Graph.prototype.createWipeAnimations=function(b,d){for(var m=[],p=0;p<b.length;p++){var u=this.view.getState(b[p]);null!=u&&null!=u.shape&&(this.model.isEdge(u.cell)&&null!=u.absolutePoints&&1<u.absolutePoints.length?m.push(this.createEdgeWipeAnimation(u,d)):this.model.isVertex(u.cell)&&null!=u.shape.bounds&&m.push(this.createVertexWipeAnimation(u,d)))}return m};+Graph.prototype.createEdgeWipeAnimation=function(b,d){var m=b.absolutePoints.slice(),p=b.segments,u=b.length,n=m.length;return{execute:mxUtils.bind(this,function(y,B){if(null!=b.shape){var P=[m[0]];B=y/B;d||(B=1-B);for(var G=u*B,O=1;O<n;O++)if(G<=p[O-1]){P.push(new mxPoint(m[O-1].x+(m[O].x-m[O-1].x)*G/p[O-1],m[O-1].y+(m[O].y-m[O-1].y)*G/p[O-1]));break}else G-=p[O-1],P.push(m[O]);b.shape.points=P;b.shape.redraw();0==y&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=+b.text.node&&(b.text.node.style.opacity=B)}}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.points=m,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),d?1:0))})}};+Graph.prototype.createVertexWipeAnimation=function(b,d){var m=new mxRectangle.fromRectangle(b.shape.bounds);return{execute:mxUtils.bind(this,function(p,u){null!=b.shape&&(u=p/u,d||(u=1-u),b.shape.bounds=new mxRectangle(m.x,m.y,m.width*u,m.height),b.shape.redraw(),0==p&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=u))}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.bounds=m,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),d?1:0))})}};-Graph.prototype.createVertexPopAnimation=function(b,d){var m=new mxRectangle.fromRectangle(b.shape.bounds),p=m.getCenterX(),v=m.getCenterY();return{execute:mxUtils.bind(this,function(n,y){if(null!=b.shape){y=n/y;d||(y=1-y);var C=1-Math.exp(-5*y)*Math.cos(5*Math.PI*y);b.shape.bounds=new mxRectangle(p-m.width*C/2,v-m.height*C/2,m.width*C,m.height*C);b.shape.redraw();0==n&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=Math.min(1,+Graph.prototype.createVertexPopAnimation=function(b,d){var m=new mxRectangle.fromRectangle(b.shape.bounds),p=m.getCenterX(),u=m.getCenterY();return{execute:mxUtils.bind(this,function(n,y){if(null!=b.shape){y=n/y;d||(y=1-y);var B=1-Math.exp(-5*y)*Math.cos(5*Math.PI*y);b.shape.bounds=new mxRectangle(p-m.width*B/2,u-m.height*B/2,m.width*B,m.height*B);b.shape.redraw();0==n&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=Math.min(1,3*y))}}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.bounds=m,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),d?1:0))})}};-Graph.prototype.createPopAnimations=function(b,d){for(var m=[],p=0;p<b.length;p++){var v=this.view.getState(b[p]);null!=v&&null!=v.shape&&(this.model.isEdge(v.cell)&&null!=v.absolutePoints&&1<v.absolutePoints.length?m.push(this.createEdgeWipeAnimation(v,d)):this.model.isVertex(v.cell)&&null!=v.shape.bounds&&m.push(this.createVertexPopAnimation(v,d)))}return m};-Graph.prototype.executeAnimations=function(b,d,m,p){m=null!=m?m:30;p=null!=p?p:30;var v=null,n=0,y=mxUtils.bind(this,function(){if(n==m||this.stoppingCustomActions){window.clearInterval(v);for(var C=0;C<b.length;C++)b[C].stop();null!=d&&d()}else for(C=0;C<b.length;C++)b[C].execute(n,m);n++});v=window.setInterval(y,p);y()};-Graph.prototype.executeAnimationsStepped=function(b,d,m,p){d=null!=d?d:30;var v=0,n=mxUtils.bind(this,function(){if(v<=d){for(var y=0;y<b.length;y++)b[y].execute(v,d);m(v,d,function(){v++;n()})}else{for(y=0;y<b.length;y++)b[y].stop();null!=p&&p()}});n()};Graph.prototype.getPageSize=function(){return this.pageVisible&&null!=this.pageFormat?new mxRectangle(0,0,this.pageFormat.width*this.pageScale,this.pageFormat.height*this.pageScale):this.scrollTileSize};-Graph.prototype.getPageLayout=function(b,d,m){b=null!=b?b:this.getGraphBounds();d=null!=d?d:this.view.translate;m=null!=m?m:this.view.scale;var p=this.getPageSize();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var v=Math.floor(Math.ceil(b.x/m-d.x)/p.width),n=Math.floor(Math.ceil(b.y/m-d.y)/p.height);return new mxRectangle(v,n,Math.ceil((Math.floor((b.x+b.width)/m)-d.x)/p.width)-v,Math.ceil((Math.floor((b.y+b.height)/m)-d.y)/p.height)-n)};+Graph.prototype.createPopAnimations=function(b,d){for(var m=[],p=0;p<b.length;p++){var u=this.view.getState(b[p]);null!=u&&null!=u.shape&&(this.model.isEdge(u.cell)&&null!=u.absolutePoints&&1<u.absolutePoints.length?m.push(this.createEdgeWipeAnimation(u,d)):this.model.isVertex(u.cell)&&null!=u.shape.bounds&&m.push(this.createVertexPopAnimation(u,d)))}return m};+Graph.prototype.executeAnimations=function(b,d,m,p){m=null!=m?m:30;p=null!=p?p:30;var u=null,n=0,y=mxUtils.bind(this,function(){if(n==m||this.stoppingCustomActions){window.clearInterval(u);for(var B=0;B<b.length;B++)b[B].stop();null!=d&&d()}else for(B=0;B<b.length;B++)b[B].execute(n,m);n++});u=window.setInterval(y,p);y()};+Graph.prototype.executeAnimationsStepped=function(b,d,m,p){d=null!=d?d:30;var u=0,n=mxUtils.bind(this,function(){if(u<=d){for(var y=0;y<b.length;y++)b[y].execute(u,d);m(u,d,function(){u++;n()})}else{for(y=0;y<b.length;y++)b[y].stop();null!=p&&p()}});n()};Graph.prototype.getPageSize=function(){return this.pageVisible&&null!=this.pageFormat?new mxRectangle(0,0,this.pageFormat.width*this.pageScale,this.pageFormat.height*this.pageScale):this.scrollTileSize};+Graph.prototype.getPageLayout=function(b,d,m){b=null!=b?b:this.getGraphBounds();d=null!=d?d:this.view.translate;m=null!=m?m:this.view.scale;var p=this.getPageSize();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var u=Math.floor(Math.ceil(b.x/m-d.x)/p.width),n=Math.floor(Math.ceil(b.y/m-d.y)/p.height);return new mxRectangle(u,n,Math.ceil((Math.floor((b.x+b.width)/m)-d.x)/p.width)-u,Math.ceil((Math.floor((b.y+b.height)/m)-d.y)/p.height)-n)};Graph.prototype.getDefaultTranslate=function(b){var d=this.getPagePadding(),m=this.getPageSize();return new mxPoint(d.x-b.x*m.width,d.y-b.y*m.height)};Graph.prototype.updateMinimumSize=function(){var b=this.getPageLayout(),d=this.getPagePadding(),m=this.getPageSize(),p=Math.ceil(2*d.x+b.width*m.width);b=Math.ceil(2*d.y+b.height*m.height);if(null==this.minimumGraphSize||this.minimumGraphSize.width!=p||this.minimumGraphSize.height!=b)this.minimumGraphSize=new mxRectangle(0,0,p,b)};Graph.prototype.sanitizeHtml=function(b,d){return Graph.sanitizeHtml(b,d)};Graph.prototype.updatePlaceholders=function(){var b=!1,d;for(d in this.model.cells){var m=this.model.cells[d];this.isReplacePlaceholders(m)&&(this.view.invalidate(m,!1,!1),b=!0)}b&&this.view.validate()};Graph.prototype.isReplacePlaceholders=function(b){return null!=b.value&&"object"==typeof b.value&&"1"==b.value.getAttribute("placeholders")};Graph.prototype.isZoomWheelEvent=function(b){return Graph.zoomWheel&&!mxEvent.isShiftDown(b)&&!mxEvent.isMetaDown(b)&&!mxEvent.isAltDown(b)&&(!mxEvent.isControlDown(b)||mxClient.IS_MAC)||!Graph.zoomWheel&&(mxEvent.isAltDown(b)||mxEvent.isControlDown(b))};Graph.prototype.isScrollWheelEvent=function(b){return!this.isZoomWheelEvent(b)};Graph.prototype.isTransparentClickEvent=function(b){return mxEvent.isAltDown(b)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(b)};@@ -2625,38 +2625,38 @@ Graph.prototype.isSplitTarget=function(b,d,m){return!this.model.isEdge(d[0])&&!mGraph.prototype.isLabelMovable=function(b){var d=this.getCurrentCellStyle(b);return!this.isCellLocked(b)&&(this.model.isEdge(b)&&this.edgeLabelsMovable||this.model.isVertex(b)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(d,"labelMovable","0")))};Graph.prototype.setGridSize=function(b){this.gridSize=b;this.fireEvent(new mxEventObject("gridSizeChanged"))};Graph.prototype.setDefaultParent=function(b){this.defaultParent=b;this.fireEvent(new mxEventObject("defaultParentChanged"))};Graph.prototype.getClickableLinkForCell=function(b){do{var d=this.getLinkForCell(b);if(null!=d)return d;b=this.model.getParent(b)}while(null!=b);return null};Graph.prototype.getGlobalVariable=function(b){var d=null;"date"==b?d=(new Date).toLocaleDateString():"time"==b?d=(new Date).toLocaleTimeString():"timestamp"==b?d=(new Date).toLocaleString():"date{"==b.substring(0,5)&&(b=b.substring(5,b.length-1),d=this.formatDate(new Date,b));return d};Graph.prototype.formatDate=function(b,d,m){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",-shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var p=this.dateFormatCache,v=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g,y=function(B,E){B=String(B);for(E=E||2;B.length<E;)B="0"+B;return B};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(b)||-/\d/.test(b)||(d=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");d=String(p.masks[d]||d||p.masks["default"]);"UTC:"==d.slice(0,4)&&(d=d.slice(4),m=!0);var C=m?"getUTC":"get",P=b[C+"Date"](),G=b[C+"Day"](),O=b[C+"Month"](),U=b[C+"FullYear"](),c=b[C+"Hours"](),f=b[C+"Minutes"](),k=b[C+"Seconds"]();C=b[C+"Milliseconds"]();var q=m?0:b.getTimezoneOffset(),x={d:P,dd:y(P),ddd:p.i18n.dayNames[G],dddd:p.i18n.dayNames[G+7],m:O+1,mm:y(O+1),mmm:p.i18n.monthNames[O],mmmm:p.i18n.monthNames[O+-12],yy:String(U).slice(2),yyyy:U,h:c%12||12,hh:y(c%12||12),H:c,HH:y(c),M:f,MM:y(f),s:k,ss:y(k),l:y(C,3),L:y(99<C?Math.round(C/10):C),t:12>c?"a":"p",tt:12>c?"am":"pm",T:12>c?"A":"P",TT:12>c?"AM":"PM",Z:m?"UTC":(String(b).match(v)||[""]).pop().replace(n,""),o:(0<q?"-":"+")+y(100*Math.floor(Math.abs(q)/60)+Math.abs(q)%60,4),S:["th","st","nd","rd"][3<P%10?0:(10!=P%100-P%10)*P%10]};return d.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(B){return B in x?x[B]:B.slice(1,-B.length-1)})};Graph.prototype.getLayerForCell=function(b){for(;null!=b&&!this.model.isLayer(b);)b=this.model.getParent(b);return b};Graph.prototype.getLayerForCells=function(b){var d=null;if(0<b.length){d=this.getLayerForCell(b[0]);for(var m=1;m<b.length;m++)if(!this.model.isAncestor(d,b[m])){d=null;break}}return d};-Graph.prototype.createLayersDialog=function(b,d){var m=document.createElement("div");m.style.position="absolute";for(var p=this.getModel(),v=p.getChildCount(p.root),n=0;n<v;n++)mxUtils.bind(this,function(y){function C(){p.isVisible(y)?(O.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(G,75)):(O.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(G,25))}var P=this.convertValueToString(y)||mxResources.get("background")||"Background",G=document.createElement("div");G.style.overflow=+shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var p=this.dateFormatCache,u=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g,y=function(C,E){C=String(C);for(E=E||2;C.length<E;)C="0"+C;return C};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(b)||+/\d/.test(b)||(d=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");d=String(p.masks[d]||d||p.masks["default"]);"UTC:"==d.slice(0,4)&&(d=d.slice(4),m=!0);var B=m?"getUTC":"get",P=b[B+"Date"](),G=b[B+"Day"](),O=b[B+"Month"](),U=b[B+"FullYear"](),c=b[B+"Hours"](),f=b[B+"Minutes"](),k=b[B+"Seconds"]();B=b[B+"Milliseconds"]();var q=m?0:b.getTimezoneOffset(),x={d:P,dd:y(P),ddd:p.i18n.dayNames[G],dddd:p.i18n.dayNames[G+7],m:O+1,mm:y(O+1),mmm:p.i18n.monthNames[O],mmmm:p.i18n.monthNames[O++12],yy:String(U).slice(2),yyyy:U,h:c%12||12,hh:y(c%12||12),H:c,HH:y(c),M:f,MM:y(f),s:k,ss:y(k),l:y(B,3),L:y(99<B?Math.round(B/10):B),t:12>c?"a":"p",tt:12>c?"am":"pm",T:12>c?"A":"P",TT:12>c?"AM":"PM",Z:m?"UTC":(String(b).match(u)||[""]).pop().replace(n,""),o:(0<q?"-":"+")+y(100*Math.floor(Math.abs(q)/60)+Math.abs(q)%60,4),S:["th","st","nd","rd"][3<P%10?0:(10!=P%100-P%10)*P%10]};return d.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(C){return C in x?x[C]:C.slice(1,+C.length-1)})};Graph.prototype.getLayerForCell=function(b){for(;null!=b&&!this.model.isLayer(b);)b=this.model.getParent(b);return b};Graph.prototype.getLayerForCells=function(b){var d=null;if(0<b.length){d=this.getLayerForCell(b[0]);for(var m=1;m<b.length;m++)if(!this.model.isAncestor(d,b[m])){d=null;break}}return d};+Graph.prototype.createLayersDialog=function(b,d){var m=document.createElement("div");m.style.position="absolute";for(var p=this.getModel(),u=p.getChildCount(p.root),n=0;n<u;n++)mxUtils.bind(this,function(y){function B(){p.isVisible(y)?(O.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(G,75)):(O.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(G,25))}var P=this.convertValueToString(y)||mxResources.get("background")||"Background",G=document.createElement("div");G.style.overflow="hidden";G.style.textOverflow="ellipsis";G.style.padding="2px";G.style.whiteSpace="nowrap";G.style.cursor="pointer";G.setAttribute("title",mxResources.get(p.isVisible(y)?"hideIt":"show",[P]));var O=document.createElement("img");O.setAttribute("draggable","false");O.setAttribute("align","absmiddle");O.setAttribute("border","0");O.style.position="relative";O.style.width="16px";O.style.padding="0px 6px 0 4px";d&&(O.style.filter="invert(100%)",O.style.top="-2px");G.appendChild(O);mxUtils.write(G,P);m.appendChild(G);-mxEvent.addListener(G,"click",function(){p.setVisible(y,!p.isVisible(y));C();null!=b&&b(y)});C()})(p.getChildAt(p.root,n));return m};-Graph.prototype.replacePlaceholders=function(b,d,m,p){p=[];if(null!=d){for(var v,n=0;v=this.placeholderPattern.exec(d);){var y=v[0];if(2<y.length&&"%label%"!=y&&"%tooltip%"!=y){var C=null;if(v.index>n&&"%"==d.charAt(v.index-1))C=y.substring(1);else{var P=y.substring(1,y.length-1),G={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==P)C=b.id;else if("width"===P.substring(0,5)&&this.model.isVertex(b)){var O=this.getCellGeometry(b);null!=O&&(C=O.width,-5<P.length&&(C=Editor.toUnit(C,G[P.substring(6)])))}else if("height"==P.substring(0,6)&&this.model.isVertex(b))O=this.getCellGeometry(b),null!=O&&(C=O.height,6<P.length&&(C=Editor.toUnit(C,G[P.substring(7)])));else if("length"==P.substring(0,6)){for(O=b;null!=O&&!this.model.isEdge(O);)O=this.model.getParent(O);O=this.view.getState(O);null!=O&&(C=Math.round(O.length/this.view.scale),6<P.length&&(C=Editor.toUnit(C,G[P.substring(7)])))}else if(0>P.indexOf("{"))for(G=b;null==C&&null!=G;)null!=G.value&&-"object"==typeof G.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(C=G.getAttribute(P+"_"+Graph.diagramLanguage)),null==C&&(C=G.hasAttribute(P)?null!=G.getAttribute(P)?G.getAttribute(P):"":null)),G=this.model.getParent(G);null==C&&("pagecount"==P.substring(0,9)&&9<P.length||"pagenumber"==P.substring(0,10)&&10<P.length?(G=P.match(/(pagecount|pagenumber)[\s]*([+-])[\s]*(\d+)/),null!=G&&(C=this.getGlobalVariable(G[1]),3<G.length&&(O=parseInt(G[3]),C+="+"==G[2]?O:-O))):C=this.getGlobalVariable(P));-null==C&&null!=m&&(C=m[P])}p.push(d.substring(n,v.index)+(null!=C?C:y));n=v.index+y.length}}p.push(d.substring(n))}return p.join("")};Graph.prototype.restoreSelection=function(b){if(null!=b&&0<b.length){for(var d=[],m=0;m<b.length;m++){var p=this.model.getCell(b[m].id);null!=p&&d.push(p)}this.setSelectionCells(d)}else this.clearSelection()};Graph.prototype.isLockedGroup=function(b){return null!=b&&"1"==mxUtils.getValue(this.getCurrentCellStyle(b),"lockedGroup","0")};+mxEvent.addListener(G,"click",function(){p.setVisible(y,!p.isVisible(y));B();null!=b&&b(y)});B()})(p.getChildAt(p.root,n));return m};+Graph.prototype.replacePlaceholders=function(b,d,m,p){p=[];if(null!=d){for(var u,n=0;u=this.placeholderPattern.exec(d);){var y=u[0];if(2<y.length&&"%label%"!=y&&"%tooltip%"!=y){var B=null;if(u.index>n&&"%"==d.charAt(u.index-1))B=y.substring(1);else{var P=y.substring(1,y.length-1),G={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==P)B=b.id;else if("width"===P.substring(0,5)&&this.model.isVertex(b)){var O=this.getCellGeometry(b);null!=O&&(B=O.width,+5<P.length&&(B=Editor.toUnit(B,G[P.substring(6)])))}else if("height"==P.substring(0,6)&&this.model.isVertex(b))O=this.getCellGeometry(b),null!=O&&(B=O.height,6<P.length&&(B=Editor.toUnit(B,G[P.substring(7)])));else if("length"==P.substring(0,6)){for(O=b;null!=O&&!this.model.isEdge(O);)O=this.model.getParent(O);O=this.view.getState(O);null!=O&&(B=Math.round(O.length/this.view.scale),6<P.length&&(B=Editor.toUnit(B,G[P.substring(7)])))}else if(0>P.indexOf("{"))for(G=b;null==B&&null!=G;)null!=G.value&&+"object"==typeof G.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(B=G.getAttribute(P+"_"+Graph.diagramLanguage)),null==B&&(B=G.hasAttribute(P)?null!=G.getAttribute(P)?G.getAttribute(P):"":null)),G=this.model.getParent(G);null==B&&("pagecount"==P.substring(0,9)&&9<P.length||"pagenumber"==P.substring(0,10)&&10<P.length?(G=P.match(/(pagecount|pagenumber)[\s]*([+-])[\s]*(\d+)/),null!=G&&(B=this.getGlobalVariable(G[1]),3<G.length&&(O=parseInt(G[3]),B+="+"==G[2]?O:-O))):B=this.getGlobalVariable(P));+null==B&&null!=m&&(B=m[P])}p.push(d.substring(n,u.index)+(null!=B?B:y));n=u.index+y.length}}p.push(d.substring(n))}return p.join("")};Graph.prototype.restoreSelection=function(b){if(null!=b&&0<b.length){for(var d=[],m=0;m<b.length;m++){var p=this.model.getCell(b[m].id);null!=p&&d.push(p)}this.setSelectionCells(d)}else this.clearSelection()};Graph.prototype.isLockedGroup=function(b){return null!=b&&"1"==mxUtils.getValue(this.getCurrentCellStyle(b),"lockedGroup","0")};Graph.prototype.hasLockedGroupStyle=function(b){return null!=b&&null!=this.getCurrentCellStyle(b).lockedGroup};Graph.prototype.isLockedGroupIconVisible=function(b){if(null==b)return!1;var d=this.getCurrentCellStyle(b).lockedGroupIcon;return"0"==d?!1:"1"==d?!0:this.hasLockedGroupStyle(b)};Graph.prototype.isEditIconVisible=function(b){return null!=b&&"1"==mxUtils.getValue(this.getCurrentCellStyle(b),"editIcon","0")};Graph.prototype.getLockedGroupAncestor=function(b){for(;null!=b;){if(this.isLockedGroup(b))return b;b=this.model.getParent(b)}return null};Graph.prototype.getLockedGroupStyleAncestor=function(b){for(;null!=b;){if(this.hasLockedGroupStyle(b))return b;b=this.model.getParent(b)}return null};Graph.prototype.selectCellForEvent=function(b,d){var m=this.getLockedGroupAncestor(this.model.getParent(b));null!=m&&(b=m);null==b||this.isToggleEvent(d)||1!=this.getSelectionCount()||(m=this.getSelectionCell(),null==m||m!=b&&!this.model.isAncestor(b,m)||(m=this.model.getParent(b),null!=m&&this.isTransparentBounds(m)&&(b=m)));mxEvent.isShiftDown(d)&&!this.isSelectionEmpty()&&this.selectTableRange(this.getSelectionCell(),b)||mxGraph.prototype.selectCellForEvent.apply(this,[b,d])};-Graph.prototype.selectTableRange=function(b,d){var m=!1;if(this.isTableCell(b)&&this.isTableCell(d)){var p=this.model.getParent(b),v=this.model.getParent(p),n=this.model.getParent(d);if(v==this.model.getParent(n)){b=p.getIndex(b);p=v.getIndex(p);var y=n.getIndex(d),C=v.getIndex(n);n=Math.max(p,C);d=Math.min(b,y);b=Math.max(b,y);y=[];for(p=Math.min(p,C);p<=n;p++){C=this.model.getChildAt(v,p);for(var P=d;P<=b;P++)y.push(this.model.getChildAt(C,P))}0<y.length&&(1<y.length||1<this.getSelectionCount()||+Graph.prototype.selectTableRange=function(b,d){var m=!1;if(this.isTableCell(b)&&this.isTableCell(d)){var p=this.model.getParent(b),u=this.model.getParent(p),n=this.model.getParent(d);if(u==this.model.getParent(n)){b=p.getIndex(b);p=u.getIndex(p);var y=n.getIndex(d),B=u.getIndex(n);n=Math.max(p,B);d=Math.min(b,y);b=Math.max(b,y);y=[];for(p=Math.min(p,B);p<=n;p++){B=this.model.getChildAt(u,p);for(var P=d;P<=b;P++)y.push(this.model.getChildAt(B,P))}0<y.length&&(1<y.length||1<this.getSelectionCount()||!this.isCellSelected(y[0]))&&(this.setSelectionCells(y),m=!0)}}return m};-Graph.prototype.snapCellsToGrid=function(b,d){this.getModel().beginUpdate();try{for(var m=0;m<b.length;m++){var p=b[m],v=this.getCellGeometry(p);if(null!=v){v=v.clone();if(this.getModel().isVertex(p))v.x=Math.round(v.x/d)*d,v.y=Math.round(v.y/d)*d,v.width=Math.round(v.width/d)*d,v.height=Math.round(v.height/d)*d;else if(this.getModel().isEdge(p)&&null!=v.points)for(var n=0;n<v.points.length;n++)v.points[n].x=Math.round(v.points[n].x/d)*d,v.points[n].y=Math.round(v.points[n].y/d)*d;this.getModel().setGeometry(p,-v)}}}finally{this.getModel().endUpdate()}};Graph.prototype.removeChildCells=function(b){this.model.beginUpdate();try{for(var d=this.model.getChildCount(b);0<=d;d--)this.model.remove(this.model.getChildAt(b,d))}finally{this.model.endUpdate()}};-Graph.prototype.updateShapes=function(b,d,m){this.model.beginUpdate();try{var p=this.model.getStyle(b),v=m?this.stylesheet.getCellStyle(p,{},!1):null;null!=v&&null==v[mxConstants.STYLE_SHAPE]&&(this.model.isVertex(b)?v[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultVertexStyle()[mxConstants.STYLE_SHAPE]:this.model.isEdge(b)&&(v[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultEdgeStyle()[mxConstants.STYLE_SHAPE]));for(var n=0;n<d.length;n++){if(this.model.isVertex(b)&&this.model.isVertex(d[n])||-this.model.isEdge(b)&&this.model.isEdge(d[n]))if(m){var y=this.model.getStyle(d[n]);if("string"===typeof y){var C=y.split(";");0<C.length&&0>C[0].indexOf("=")&&(C=C.slice(1));this.model.setStyle(d[n],C.join(";"))}this.setCellStyles(mxConstants.STYLE_PERIMETER,null,[d[n]]);this.setCellStyles("points",null,[d[n]]);this.pasteStyle(v,[d[n]],null,!0)}else v=this.copyStyle(d[n]),this.model.setStyle(d[n],p),this.pasteStyle(v,[d[n]]);"1"==mxUtils.getValue(this.getCellStyle(d[n],!1),"composite","0")&&this.removeChildCells(d[n])}}finally{this.model.endUpdate()}};-Graph.prototype.updateEdgeLabelShape=function(b,d,m){m=null!=m?m:3;var p=this.copyStyle(d),v=d;this.model.beginUpdate();try{if(this.model.isEdge(d)){var n=this.model.getValue(d),y=n;null!=n&&"object"==typeof n?(y=this.convertValueToString(d),n=n.cloneNode(!0),Graph.translateDiagram&&null!=Graph.diagramLanguage&&n.hasAttribute("label_"+Graph.diagramLanguage)?n.setAttribute("label_"+Graph.diagramLanguage,""):n.setAttribute("label","")):n="";var C=this.getCellGeometry(d);v=new mxCell(y,new mxGeometry(0,-0,0,0),"");v.geometry.relative=!0;v.vertex=!0;null!=C&&(v.geometry.x=C.x,v.geometry.y=C.y,null!=C.offset&&(v.geometry.offset=C.offset.clone()));v=this.addCell(v,d);this.model.setValue(d,n)}this.updateShapes(b,[v],!0);this.pasteStyle(p,[v],"fontFamily fontSource fontSize fontColor fontStyle textOpacity horizontal textDirection".split(" "));this.setCellStyles("resizable",null,[v]);var P=this.getCellGeometry(v),G=this.getPreferredSizeForCell(v,null,!1);if(null!=P&&null!=G){var O=G.width+2*m,U=G.height+-2*m;P=P.clone();var c=null!=P.offset?P.offset:new mxPoint(0,0);P.offset=new mxPoint(Math.round(c.x+(P.width-O)/2),Math.round(c.y+(P.height-U)/2));P.width=O;P.height=U;this.model.setGeometry(v,P)}}finally{this.model.endUpdate()}return v};Graph.prototype.selectCellsForConnectVertex=function(b,d,m){2==b.length&&this.model.isVertex(b[1])?(this.setSelectionCell(b[1]),this.scrollCellToVisible(b[1]),null!=m&&(mxEvent.isTouchEvent(d)?m.update(m.getState(this.view.getState(b[1]))):m.reset())):this.setSelectionCells(b)};+Graph.prototype.snapCellsToGrid=function(b,d){this.getModel().beginUpdate();try{for(var m=0;m<b.length;m++){var p=b[m],u=this.getCellGeometry(p);if(null!=u){u=u.clone();if(this.getModel().isVertex(p))u.x=Math.round(u.x/d)*d,u.y=Math.round(u.y/d)*d,u.width=Math.round(u.width/d)*d,u.height=Math.round(u.height/d)*d;else if(this.getModel().isEdge(p)&&null!=u.points)for(var n=0;n<u.points.length;n++)u.points[n].x=Math.round(u.points[n].x/d)*d,u.points[n].y=Math.round(u.points[n].y/d)*d;this.getModel().setGeometry(p,+u)}}}finally{this.getModel().endUpdate()}};Graph.prototype.removeChildCells=function(b){this.model.beginUpdate();try{for(var d=this.model.getChildCount(b);0<=d;d--)this.model.remove(this.model.getChildAt(b,d))}finally{this.model.endUpdate()}};+Graph.prototype.updateShapes=function(b,d,m){this.model.beginUpdate();try{var p=this.model.getStyle(b),u=m?this.stylesheet.getCellStyle(p,{},!1):null;null!=u&&null==u[mxConstants.STYLE_SHAPE]&&(this.model.isVertex(b)?u[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultVertexStyle()[mxConstants.STYLE_SHAPE]:this.model.isEdge(b)&&(u[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultEdgeStyle()[mxConstants.STYLE_SHAPE]));for(var n=0;n<d.length;n++){if(this.model.isVertex(b)&&this.model.isVertex(d[n])||+this.model.isEdge(b)&&this.model.isEdge(d[n]))if(m){var y=this.model.getStyle(d[n]);if("string"===typeof y){var B=y.split(";");0<B.length&&0>B[0].indexOf("=")&&(B=B.slice(1));this.model.setStyle(d[n],B.join(";"))}this.setCellStyles(mxConstants.STYLE_PERIMETER,null,[d[n]]);this.setCellStyles("points",null,[d[n]]);this.pasteStyle(u,[d[n]],null,!0)}else u=this.copyStyle(d[n]),this.model.setStyle(d[n],p),this.pasteStyle(u,[d[n]]);"1"==mxUtils.getValue(this.getCellStyle(d[n],!1),"composite","0")&&this.removeChildCells(d[n])}}finally{this.model.endUpdate()}};+Graph.prototype.updateEdgeLabelShape=function(b,d,m){m=null!=m?m:3;var p=this.copyStyle(d),u=d;this.model.beginUpdate();try{if(this.model.isEdge(d)){var n=this.model.getValue(d),y=n;null!=n&&"object"==typeof n?(y=this.convertValueToString(d),n=n.cloneNode(!0),Graph.translateDiagram&&null!=Graph.diagramLanguage&&n.hasAttribute("label_"+Graph.diagramLanguage)?n.setAttribute("label_"+Graph.diagramLanguage,""):n.setAttribute("label","")):n="";var B=this.getCellGeometry(d);u=new mxCell(y,new mxGeometry(0,+0,0,0),"");u.geometry.relative=!0;u.vertex=!0;null!=B&&(u.geometry.x=B.x,u.geometry.y=B.y,null!=B.offset&&(u.geometry.offset=B.offset.clone()));u=this.addCell(u,d);this.model.setValue(d,n)}this.updateShapes(b,[u],!0);this.pasteStyle(p,[u],"fontFamily fontSource fontSize fontColor fontStyle textOpacity horizontal textDirection".split(" "));this.setCellStyles("resizable",null,[u]);var P=this.getCellGeometry(u),G=this.getPreferredSizeForCell(u,null,!1);if(null!=P&&null!=G){var O=G.width+2*m,U=G.height++2*m;P=P.clone();var c=null!=P.offset?P.offset:new mxPoint(0,0);P.offset=new mxPoint(Math.round(c.x+(P.width-O)/2),Math.round(c.y+(P.height-U)/2));P.width=O;P.height=U;this.model.setGeometry(u,P)}}finally{this.model.endUpdate()}return u};Graph.prototype.selectCellsForConnectVertex=function(b,d,m){2==b.length&&this.model.isVertex(b[1])?(this.setSelectionCell(b[1]),this.scrollCellToVisible(b[1]),null!=m&&(mxEvent.isTouchEvent(d)?m.update(m.getState(this.view.getState(b[1]))):m.reset())):this.setSelectionCells(b)};Graph.prototype.isCloneConnectSource=function(b){var d=null;null!=this.layoutManager&&(d=this.layoutManager.getLayout(this.model.getParent(b)));return this.isTableRow(b)||this.isTableCell(b)||null!=d&&d.constructor==mxStackLayout};Graph.prototype.insertEdgeBeforeCell=function(b,d){for(var m=d;null!=m.parent&&null!=m.geometry&&m.geometry.relative&&m.parent!=b.parent;)m=this.model.getParent(m);null!=m&&null!=m.parent&&m.parent==b.parent&&(d=m.parent.getIndex(m),this.model.add(m.parent,b,d))};-Graph.prototype.connectVertex=function(b,d,m,p,v,n,y,C,P){n=n?n:!1;if(b.geometry.relative&&this.model.isEdge(b.parent))return[];for(;b.geometry.relative&&this.model.isVertex(b.parent);)b=b.parent;var G=this.isCloneConnectSource(b),O=G?b:this.getCompositeParent(b),U=b.geometry.relative&&null!=b.parent.geometry?new mxPoint(b.parent.geometry.width*b.geometry.x,b.parent.geometry.height*b.geometry.y):new mxPoint(O.geometry.x,O.geometry.y);d==mxConstants.DIRECTION_NORTH?(U.x+=O.geometry.width/2,U.y-=m):+Graph.prototype.connectVertex=function(b,d,m,p,u,n,y,B,P){n=n?n:!1;if(b.geometry.relative&&this.model.isEdge(b.parent))return[];for(;b.geometry.relative&&this.model.isVertex(b.parent);)b=b.parent;var G=this.isCloneConnectSource(b),O=G?b:this.getCompositeParent(b),U=b.geometry.relative&&null!=b.parent.geometry?new mxPoint(b.parent.geometry.width*b.geometry.x,b.parent.geometry.height*b.geometry.y):new mxPoint(O.geometry.x,O.geometry.y);d==mxConstants.DIRECTION_NORTH?(U.x+=O.geometry.width/2,U.y-=m):d==mxConstants.DIRECTION_SOUTH?(U.x+=O.geometry.width/2,U.y+=O.geometry.height+m):(U.x=d==mxConstants.DIRECTION_WEST?U.x-m:U.x+(O.geometry.width+m),U.y+=O.geometry.height/2);var c=this.view.getState(this.model.getParent(b));m=this.view.scale;var f=this.view.translate;O=f.x*m;f=f.y*m;null!=c&&this.model.isVertex(c.cell)&&(O=c.x,f=c.y);this.model.isVertex(b.parent)&&b.geometry.relative&&(U.x+=b.parent.geometry.x,U.y+=b.parent.geometry.y);n=n?null:(new mxRectangle(O+U.x*m,f+U.y*m)).grow(40*m);n=null!=-n?this.getCells(0,0,0,0,null,null,n,null,!0):null;c=this.view.getState(b);var k=null,q=null;if(null!=n){n=n.reverse();for(var x=0;x<n.length;x++)if(!this.isCellLocked(n[x])&&!this.model.isEdge(n[x])&&n[x]!=b)if(!this.model.isAncestor(b,n[x])&&this.isContainer(n[x])&&(null==k||n[x]==this.model.getParent(b)))k=n[x];else if(null==q&&this.isCellConnectable(n[x])&&!this.model.isAncestor(n[x],b)&&!this.isSwimlane(n[x])){var B=this.view.getState(n[x]);null==c||null==B||mxUtils.intersects(c,B)||(q=n[x])}}var E=-!mxEvent.isShiftDown(p)||mxEvent.isControlDown(p)||v;E&&("1"!=urlParams.sketch||v)&&(d==mxConstants.DIRECTION_NORTH?U.y-=b.geometry.height/2:d==mxConstants.DIRECTION_SOUTH?U.y+=b.geometry.height/2:U.x=d==mxConstants.DIRECTION_WEST?U.x-b.geometry.width/2:U.x+b.geometry.width/2);var L=[],Q=q;q=k;v=mxUtils.bind(this,function(V){if(null==y||null!=V||null==q&&G){this.model.beginUpdate();try{if(null==Q&&E){var K=this.getAbsoluteParent(null!=V?V:b);K=G?b:this.getCompositeParent(K);Q=null!=V?V:this.duplicateCells([K],+n?this.getCells(0,0,0,0,null,null,n,null,!0):null;c=this.view.getState(b);var k=null,q=null;if(null!=n){n=n.reverse();for(var x=0;x<n.length;x++)if(!this.isCellLocked(n[x])&&!this.model.isEdge(n[x])&&n[x]!=b)if(!this.model.isAncestor(b,n[x])&&this.isContainer(n[x])&&(null==k||n[x]==this.model.getParent(b)))k=n[x];else if(null==q&&this.isCellConnectable(n[x])&&!this.model.isAncestor(n[x],b)&&!this.isSwimlane(n[x])){var C=this.view.getState(n[x]);null==c||null==C||mxUtils.intersects(c,C)||(q=n[x])}}var E=+!mxEvent.isShiftDown(p)||mxEvent.isControlDown(p)||u;E&&("1"!=urlParams.sketch||u)&&(d==mxConstants.DIRECTION_NORTH?U.y-=b.geometry.height/2:d==mxConstants.DIRECTION_SOUTH?U.y+=b.geometry.height/2:U.x=d==mxConstants.DIRECTION_WEST?U.x-b.geometry.width/2:U.x+b.geometry.width/2);var L=[],Q=q;q=k;u=mxUtils.bind(this,function(V){if(null==y||null!=V||null==q&&G){this.model.beginUpdate();try{if(null==Q&&E){var K=this.getAbsoluteParent(null!=V?V:b);K=G?b:this.getCompositeParent(K);Q=null!=V?V:this.duplicateCells([K],!1)[0];null!=V&&this.addCells([Q],this.model.getParent(b),null,null,null,!0);var fa=this.getCellGeometry(Q);null!=fa&&(null!=V&&"1"==urlParams.sketch&&(d==mxConstants.DIRECTION_NORTH?U.y-=fa.height/2:d==mxConstants.DIRECTION_SOUTH?U.y+=fa.height/2:U.x=d==mxConstants.DIRECTION_WEST?U.x-fa.width/2:U.x+fa.width/2),fa.x=U.x-fa.width/2,fa.y=U.y-fa.height/2);null!=k?(this.addCells([Q],k,null,null,null,!0),q=null):E&&!G&&this.addCells([Q],this.getDefaultParent(),null,null,null,!0)}var aa=mxEvent.isControlDown(p)&&mxEvent.isShiftDown(p)&&E||null==q&&G?null:this.insertEdge(this.model.getParent(b),null,"",b,Q,this.createCurrentEdgeStyle());null!=aa&&(L.push(aa),this.applyNewEdgeStyle(b,[aa],d),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(aa,b));if(null==q&&null!=Q&&null!=b.parent&&G&&d==mxConstants.DIRECTION_WEST){var da=b.parent.getIndex(b);this.model.add(b.parent,Q,da)}null==q&&null!=Q&&L.push(Q);null==Q&&null!=aa&&aa.geometry.setTerminalPoint(U,!1);null!=aa&&this.fireEvent(new mxEventObject("cellsInserted",-"cells",[aa]))}finally{this.model.endUpdate()}}if(null!=C)C(L);else return L});if(null==y&&null==P||null!=Q||!E||null==q&&G)return v(Q);if(null!=P)return v(P);y(O+U.x*m,f+U.y*m,v)};-Graph.prototype.getIndexableText=function(b){b=null!=b?b:this.model.getDescendants(this.model.root);for(var d=document.createElement("div"),m=[],p,v=0;v<b.length;v++)if(p=b[v],this.model.isVertex(p)||this.model.isEdge(p))this.isHtmlLabel(p)?(d.innerHTML=Graph.sanitizeHtml(this.getLabel(p)),p=mxUtils.extractTextWithWhitespace([d])):p=this.getLabel(p),p=mxUtils.trim(p.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<p.length&&m.push(p);return m.join(" ")};+"cells",[aa]))}finally{this.model.endUpdate()}}if(null!=B)B(L);else return L});if(null==y&&null==P||null!=Q||!E||null==q&&G)return u(Q);if(null!=P)return u(P);y(O+U.x*m,f+U.y*m,u)};+Graph.prototype.getIndexableText=function(b){b=null!=b?b:this.model.getDescendants(this.model.root);for(var d=document.createElement("div"),m=[],p,u=0;u<b.length;u++)if(p=b[u],this.model.isVertex(p)||this.model.isEdge(p))this.isHtmlLabel(p)?(d.innerHTML=Graph.sanitizeHtml(this.getLabel(p)),p=mxUtils.extractTextWithWhitespace([d])):p=this.getLabel(p),p=mxUtils.trim(p.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<p.length&&m.push(p);return m.join(" ")};Graph.prototype.convertValueToString=function(b){var d=this.model.getValue(b);if(null!=d&&"object"==typeof d){var m=null;if(this.isReplacePlaceholders(b)&&null!=b.getAttribute("placeholder")){d=b.getAttribute("placeholder");for(var p=b;null==m&&null!=p;)null!=p.value&&"object"==typeof p.value&&(m=p.hasAttribute(d)?null!=p.getAttribute(d)?p.getAttribute(d):"":null),p=this.model.getParent(p)}else m=null,Graph.translateDiagram&&null!=Graph.diagramLanguage&&(m=d.getAttribute("label_"+Graph.diagramLanguage)),null==m&&(m=d.getAttribute("label")||"");return m||""}return mxGraph.prototype.convertValueToString.apply(this,arguments)};Graph.prototype.getLinksForState=function(b){return null!=b&&null!=b.text&&null!=b.text.node?b.text.node.getElementsByTagName("a"):null};Graph.prototype.getLinkForCell=function(b,d){return null!=b.value&&"object"==typeof b.value?(b=b.value.getAttribute("link"),d||(b=mxUtils.removeJavascriptProtocol(b)),b):null};Graph.prototype.getLinkTargetForCell=function(b){return null!=b.value&&"object"==typeof b.value?b.value.getAttribute("linkTarget"):null};Graph.prototype.postProcessCellStyle=function(b,d){return this.updateHorizontalStyle(b,this.replaceDefaultColors(b,mxGraph.prototype.postProcessCellStyle.apply(this,arguments)))};@@ -2666,40 +2666,40 @@ mxConstants.STYLE_IMAGE_BACKGROUND,b);this.replaceDefaultColor(d,mxConstants.STYGraph.prototype.getDefaultColor=function(b,d,m){d="default"+d.charAt(0).toUpperCase()+d.substring(1);"invert"==b[d]&&(b=mxUtils.getLightDarkColor(m),m="light-dark("+b.dark+", "+b.light+")");return m};Graph.prototype.setAdaptiveColors=function(b){this.adaptiveColors="default"==b?null:b;"1"==urlParams.embedInline?null!=this.container&&(this.container.style.colorScheme="none"==this.getAdaptiveColors()?"light":""):(b=this.view.getDrawPane().ownerSVGElement,null!=b&&(b.style.colorScheme="none"==this.getAdaptiveColors()?"light":""))};Graph.prototype.getAdaptiveColors=function(){return null!=this.adaptiveColors?this.adaptiveColors:Graph.defaultAdaptiveColors};Graph.prototype.updateAlternateBounds=function(b,d,m){if(null!=b&&null!=d&&null!=this.layoutManager&&null!=d.alternateBounds){var p=this.layoutManager.getLayout(this.model.getParent(b));null!=p&&p.constructor==mxStackLayout&&(p.horizontal?d.alternateBounds.height=0:d.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};-Graph.prototype.moveCellsTo=function(b,d){if(null!=b&&null!=d){for(var m=!0,p=0;p<b.length&&m;p++)m=m&&this.model.isEdge(b[p]);p=null;if(1==b.length&&m){var v=this.getCellGeometry(b[0]);null!=v&&(p=v.getTerminalPoint(!0))}p=null!=p?p:this.getBoundingBoxFromGeometry(b,m);null!=p&&(m=Math.round(this.snap(d.x)),d=Math.round(this.snap(d.y)),this.cellsMoved(b,m-p.x,d-p.y))}};Graph.prototype.isMoveCellsEvent=function(b,d){return mxEvent.isShiftDown(b)||"1"==mxUtils.getValue(d.style,"moveCells","0")};-Graph.prototype.foldCells=function(b,d,m,p,v){d=null!=d?d:!1;null==m&&(m=this.getFoldableCells(this.getSelectionCells(),b));if(null!=m){this.model.beginUpdate();try{mxGraph.prototype.foldCells.apply(this,arguments);for(var n=0;n<m.length;n++){var y=this.view.getState(m[n]),C=this.getCellGeometry(m[n]);if(null!=y&&null!=C&&("1"!=mxUtils.getValue(y.style,"expandToFront","0")||this.isCellCollapsed(m[n])||this.orderCells(!1,[m[n]]),null!=this.layoutManager)){var P=0,G=0;if(C.alternateBounds)P=C.width--C.alternateBounds.width,G=C.height-C.alternateBounds.height;else{var O=this.useCssTransforms?1:this.view.scale;P=Math.round(C.width-y.width/O);G=Math.round(C.height-y.height/O)}if(0!=G||0!=P){var U=this.model.getParent(m[n]),c=this.layoutManager.getLayout(U);null==c?null!=v&&this.isMoveCellsEvent(v,y)&&this.moveSiblings(y,U,P,G):null!=v&&mxEvent.isAltDown(v)||c.constructor!=mxStackLayout||c.resizeLast||this.resizeParentStacks(U,c,P,G)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(m)}};-Graph.prototype.moveSiblings=function(b,d,m,p){this.model.beginUpdate();try{var v=this.getCellsBeyond(b.x,b.y,d,!0,!0);for(d=0;d<v.length;d++)if(v[d]!=b.cell){var n=this.view.getState(v[d]),y=this.getCellGeometry(v[d]);null!=n&&null!=y&&(y=y.clone(),y.translate(Math.round(m*Math.max(0,Math.min(1,(n.x-b.x)/b.width))),Math.round(p*Math.max(0,Math.min(1,(n.y-b.y)/b.height)))),this.model.setGeometry(v[d],y))}}finally{this.model.endUpdate()}};-Graph.prototype.resizeParentStacks=function(b,d,m,p){if(null!=this.layoutManager&&null!=d&&d.constructor==mxStackLayout&&!d.resizeLast){this.model.beginUpdate();try{for(var v=d.horizontal;null!=b&&null!=d&&d.constructor==mxStackLayout&&d.horizontal==v&&!d.resizeLast;){var n=this.getCellGeometry(b),y=this.view.getState(b);null!=y&&null!=n&&(n=n.clone(),d.horizontal?n.width+=m+Math.min(0,y.width/this.view.scale-n.width):n.height+=p+Math.min(0,y.height/this.view.scale-n.height),this.model.setGeometry(b,+Graph.prototype.moveCellsTo=function(b,d){if(null!=b&&null!=d){for(var m=!0,p=0;p<b.length&&m;p++)m=m&&this.model.isEdge(b[p]);p=null;if(1==b.length&&m){var u=this.getCellGeometry(b[0]);null!=u&&(p=u.getTerminalPoint(!0))}p=null!=p?p:this.getBoundingBoxFromGeometry(b,m);null!=p&&(m=Math.round(this.snap(d.x)),d=Math.round(this.snap(d.y)),this.cellsMoved(b,m-p.x,d-p.y))}};Graph.prototype.isMoveCellsEvent=function(b,d){return mxEvent.isShiftDown(b)||"1"==mxUtils.getValue(d.style,"moveCells","0")};+Graph.prototype.foldCells=function(b,d,m,p,u){d=null!=d?d:!1;null==m&&(m=this.getFoldableCells(this.getSelectionCells(),b));if(null!=m){this.model.beginUpdate();try{mxGraph.prototype.foldCells.apply(this,arguments);for(var n=0;n<m.length;n++){var y=this.view.getState(m[n]),B=this.getCellGeometry(m[n]);if(null!=y&&null!=B&&("1"!=mxUtils.getValue(y.style,"expandToFront","0")||this.isCellCollapsed(m[n])||this.orderCells(!1,[m[n]]),null!=this.layoutManager)){var P=0,G=0;if(B.alternateBounds)P=B.width-+B.alternateBounds.width,G=B.height-B.alternateBounds.height;else{var O=this.useCssTransforms?1:this.view.scale;P=Math.round(B.width-y.width/O);G=Math.round(B.height-y.height/O)}if(0!=G||0!=P){var U=this.model.getParent(m[n]),c=this.layoutManager.getLayout(U);null==c?null!=u&&this.isMoveCellsEvent(u,y)&&this.moveSiblings(y,U,P,G):null!=u&&mxEvent.isAltDown(u)||c.constructor!=mxStackLayout||c.resizeLast||this.resizeParentStacks(U,c,P,G)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(m)}};+Graph.prototype.moveSiblings=function(b,d,m,p){this.model.beginUpdate();try{var u=this.getCellsBeyond(b.x,b.y,d,!0,!0);for(d=0;d<u.length;d++)if(u[d]!=b.cell){var n=this.view.getState(u[d]),y=this.getCellGeometry(u[d]);null!=n&&null!=y&&(y=y.clone(),y.translate(Math.round(m*Math.max(0,Math.min(1,(n.x-b.x)/b.width))),Math.round(p*Math.max(0,Math.min(1,(n.y-b.y)/b.height)))),this.model.setGeometry(u[d],y))}}finally{this.model.endUpdate()}};+Graph.prototype.resizeParentStacks=function(b,d,m,p){if(null!=this.layoutManager&&null!=d&&d.constructor==mxStackLayout&&!d.resizeLast){this.model.beginUpdate();try{for(var u=d.horizontal;null!=b&&null!=d&&d.constructor==mxStackLayout&&d.horizontal==u&&!d.resizeLast;){var n=this.getCellGeometry(b),y=this.view.getState(b);null!=y&&null!=n&&(n=n.clone(),d.horizontal?n.width+=m+Math.min(0,y.width/this.view.scale-n.width):n.height+=p+Math.min(0,y.height/this.view.scale-n.height),this.model.setGeometry(b,n));b=this.model.getParent(b);d=this.layoutManager.getLayout(b)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(b){var d=this.getCurrentCellStyle(b);return this.isSwimlane(b)?"0"!=d.container:"1"==d.container};Graph.prototype.borderBandSize=8;-Graph.prototype.getBorderContainer=function(b,d,m){var p=this.borderBandSize,v=null;if(0<p&&null!=b&&this.model.isVertex(b)){var n=this.getCellGeometry(b);if(null==n||Math.min(n.width,n.height)>3*p)for(b=this.model.getParent(b);null==v&&this.model.isVertex(b);){n=this.view.getState(b);if(null!=n){var y=new mxPoint(d,m),C=mxUtils.getValue(n.style,mxConstants.STYLE_ROTATION,0);0!=C&&(C=mxUtils.toRadians(-C),y=mxUtils.getRotatedPoint(y,Math.cos(C),Math.sin(C),new mxPoint(n.getCenterX(),n.getCenterY())));-if(y.x>=n.x+p&&y.x<=n.x+n.width-p&&y.y>=n.y+p&&y.y<=n.y+n.height-p)break;y.x>=n.x-p&&y.x<=n.x+n.width+p&&y.y>=n.y-p&&y.y<=n.y+n.height+p&&this.isContainer(b)&&!this.isTable(b)&&!this.isTableRow(b)&&!this.isTableCell(b)&&!this.isCellLocked(b)&&this.isCellConnectable(b)&&(v=b)}b=this.model.getParent(b)}}return v};Graph.prototype.isTransparentBounds=function(b){return"1"==this.getCurrentCellStyle(b).transparentBounds};+Graph.prototype.getBorderContainer=function(b,d,m){var p=this.borderBandSize,u=null;if(0<p&&null!=b&&this.model.isVertex(b)){var n=this.getCellGeometry(b);if(null==n||Math.min(n.width,n.height)>3*p)for(b=this.model.getParent(b);null==u&&this.model.isVertex(b);){n=this.view.getState(b);if(null!=n){var y=new mxPoint(d,m),B=mxUtils.getValue(n.style,mxConstants.STYLE_ROTATION,0);0!=B&&(B=mxUtils.toRadians(-B),y=mxUtils.getRotatedPoint(y,Math.cos(B),Math.sin(B),new mxPoint(n.getCenterX(),n.getCenterY())));+if(y.x>=n.x+p&&y.x<=n.x+n.width-p&&y.y>=n.y+p&&y.y<=n.y+n.height-p)break;y.x>=n.x-p&&y.x<=n.x+n.width+p&&y.y>=n.y-p&&y.y<=n.y+n.height+p&&this.isContainer(b)&&!this.isTable(b)&&!this.isTableRow(b)&&!this.isTableCell(b)&&!this.isCellLocked(b)&&this.isCellConnectable(b)&&(u=b)}b=this.model.getParent(b)}}return u};Graph.prototype.isTransparentBounds=function(b){return"1"==this.getCurrentCellStyle(b).transparentBounds};Graph.prototype.isMoveIconVisible=function(b){var d=this.getCurrentCellStyle(b).moveIcon;return null!=d?"1"==d:this.isTransparentBounds(b)};Graph.prototype.getMoveIconDragCells=function(b){return null};-Graph.prototype.getNestedCornerIconOffset=function(b,d,m,p){for(var v=this.model,n=this.view,y=this.getSelectionCells(),C=new mxDictionary,P=0,G=0;G<y.length;G++){var O=y[G];if(O!=b){for(var U=[O],c=v.getParent(O);null!=c&&c!=b;)U.push(c),c=v.getParent(c);if(c==b)for(c=0;c<U.length;c++){var f=U[c];if(null==C.get(f)&&(C.put(f,!0),(f==O||this.isTransparentBounds(f))&&p(f)&&(f=n.getState(f),null!=f))){f=[[f.x,f.y],[f.x+f.width,f.y],[f.x,f.y+f.height],[f.x+f.width,f.y+f.height]];for(var k=0;k<f.length;k++)if(16>-Math.abs(f[k][0]-d)&&16>Math.abs(f[k][1]-m)){P++;break}}}}}return 16*P};Graph.prototype.getNestedTransparentBoundsCount=function(b){if(!this.isTransparentBounds(b))return 0;var d=this.model,m=this,p=0,v=function(n){for(var y=d.getChildCount(n),C=0;C<y;C++){var P=d.getChildAt(n,C);m.isTransparentBounds(P)&&p++;v(P)}};v(b);return p};Graph.prototype.isConnectIconVisible=function(b){b=this.getCurrentCellStyle(b).connectIcon;return null!=b?"1"==b:Editor.showConnectHandle};+Graph.prototype.getNestedCornerIconOffset=function(b,d,m,p){for(var u=this.model,n=this.view,y=this.getSelectionCells(),B=new mxDictionary,P=0,G=0;G<y.length;G++){var O=y[G];if(O!=b){for(var U=[O],c=u.getParent(O);null!=c&&c!=b;)U.push(c),c=u.getParent(c);if(c==b)for(c=0;c<U.length;c++){var f=U[c];if(null==B.get(f)&&(B.put(f,!0),(f==O||this.isTransparentBounds(f))&&p(f)&&(f=n.getState(f),null!=f))){f=[[f.x,f.y],[f.x+f.width,f.y],[f.x,f.y+f.height],[f.x+f.width,f.y+f.height]];for(var k=0;k<f.length;k++)if(16>+Math.abs(f[k][0]-d)&&16>Math.abs(f[k][1]-m)){P++;break}}}}}return 16*P};Graph.prototype.getNestedTransparentBoundsCount=function(b){if(!this.isTransparentBounds(b))return 0;var d=this.model,m=this,p=0,u=function(n){for(var y=d.getChildCount(n),B=0;B<y;B++){var P=d.getChildAt(n,B);m.isTransparentBounds(P)&&p++;u(P)}};u(b);return p};Graph.prototype.isConnectIconVisible=function(b){b=this.getCurrentCellStyle(b).connectIcon;return null!=b?"1"==b:Editor.showConnectHandle};Graph.prototype.isSelectParentFirst=function(b){return"1"==this.getCurrentCellStyle(b).selectParentFirst};Graph.prototype.parsePadding=function(b){b=null!=b?String(b):"";try{b=decodeURIComponent(b)}catch(d){}b=b.trim().split(/\s+/).map(function(d){d=parseFloat(d);return isNaN(d)?0:d});return 1===b.length?{n:b[0],e:b[0],s:b[0],w:b[0]}:2===b.length?{n:b[0],e:b[1],s:b[0],w:b[1]}:3===b.length?{n:b[0],e:b[1],s:b[2],w:b[1]}:{n:b[0],e:b[1],s:b[2],w:b[3]}};Graph.prototype.getTransparentBoundsPadding=function(b){b=this.getCurrentCellStyle(b);return this.parsePadding(mxUtils.getValue(b,mxConstants.STYLE_GROUP_PADDING,0))};Graph.prototype.invalidateTransparentBoundsAncestors=function(b,d){for(b=d&&null!=b?b:null!=b?this.model.getParent(b):null;null!=b;)this.isTransparentBounds(b)&&this.view.invalidate(b,!1,!0),b=this.model.getParent(b)};var graphProcessChange=Graph.prototype.processChange;Graph.prototype.processChange=function(b){graphProcessChange.apply(this,arguments);b instanceof mxChildChange?(this.invalidateTransparentBoundsAncestors(b.child),this.invalidateTransparentBoundsAncestors(b.previous,!0)):(b instanceof mxGeometryChange||b instanceof mxTerminalChange)&&this.invalidateTransparentBoundsAncestors(b.cell)};-Graph.prototype.getTransparentChildBounds=function(b){for(var d=null,m=this.model.getChildCount(b),p=0;p<m;p++){var v=this.model.getChildAt(b,p),n=null;if(this.model.isVertex(v)){var y=this.getCellGeometry(v);if(null!=y&&!y.relative)if(this.isTransparentBounds(v)){var C=this.getTransparentBounds(v);null!=C&&(n=new mxRectangle(y.x+C.x,y.y+C.y,C.width,C.height))}else n=new mxRectangle(y.x,y.y,y.width,y.height)}else if(this.model.isEdge(v)&&(y=this.getCellGeometry(v),null!=y))for(C=[],null==this.model.getTerminal(v,-!0)&&null!=y.getTerminalPoint(!0)&&C.push(y.getTerminalPoint(!0)),null==this.model.getTerminal(v,!1)&&null!=y.getTerminalPoint(!1)&&C.push(y.getTerminalPoint(!1)),null!=y.points&&(C=C.concat(y.points)),y=0;y<C.length;y++)null!=C[y]&&(null==n?n=new mxRectangle(C[y].x,C[y].y,0,0):n.add(new mxRectangle(C[y].x,C[y].y,0,0)));null!=n&&(null==d?d=mxRectangle.fromRectangle(n):d.add(n))}return d};+Graph.prototype.getTransparentChildBounds=function(b){for(var d=null,m=this.model.getChildCount(b),p=0;p<m;p++){var u=this.model.getChildAt(b,p),n=null;if(this.model.isVertex(u)){var y=this.getCellGeometry(u);if(null!=y&&!y.relative)if(this.isTransparentBounds(u)){var B=this.getTransparentBounds(u);null!=B&&(n=new mxRectangle(y.x+B.x,y.y+B.y,B.width,B.height))}else n=new mxRectangle(y.x,y.y,y.width,y.height)}else if(this.model.isEdge(u)&&(y=this.getCellGeometry(u),null!=y))for(B=[],null==this.model.getTerminal(u,+!0)&&null!=y.getTerminalPoint(!0)&&B.push(y.getTerminalPoint(!0)),null==this.model.getTerminal(u,!1)&&null!=y.getTerminalPoint(!1)&&B.push(y.getTerminalPoint(!1)),null!=y.points&&(B=B.concat(y.points)),y=0;y<B.length;y++)null!=B[y]&&(null==n?n=new mxRectangle(B[y].x,B[y].y,0,0):n.add(new mxRectangle(B[y].x,B[y].y,0,0)));null!=n&&(null==d?d=mxRectangle.fromRectangle(n):d.add(n))}return d};Graph.prototype.getTransparentBounds=function(b){var d=this.getTransparentChildBounds(b);if(null==d)return null;var m=this.getTransparentBoundsPadding(b),p=this.isSwimlane(b)?this.getActualStartSize(b):new mxRectangle;b=this.getActualFooterSize(b);return new mxRectangle(d.x-m.w-p.x-b.x,d.y-m.n-p.y-b.y,d.width+m.w+m.e+p.x+p.width+b.x+b.width,d.height+m.n+m.s+p.y+p.height+b.y+b.height)};-Graph.prototype.getBoundsForGroup=function(b,d,m){var p=null;if(null!=d)for(var v=0;v<d.length;v++){var n=null;if(this.model.isEdge(d[v]))n=this.getBoundingBoxFromGeometry([d[v]],!0);else if(this.model.isVertex(d[v])){var y=this.getCellGeometry(d[v]);if(null==y||y.relative)continue;if(this.isTransparentBounds(d[v])){var C=this.getTransparentBounds(d[v]);null!=C&&(n=new mxRectangle(y.x+C.x,y.y+C.y,C.width,C.height))}else n=new mxRectangle(y.x,y.y,y.width,y.height)}null!=n&&(null==p?p=n:p.add(n))}null!=-p&&(this.isSwimlane(b)&&(b=this.getStartSize(b),p.x-=b.width,p.y-=b.height,p.width+=b.width,p.height+=b.height),null!=m&&(p.x-=m,p.y-=m,p.width+=2*m,p.height+=2*m));return p};Graph.prototype.updateGroupBounds=function(b,d,m,p,v,n,y){if(null!=b){for(var C=[],P=0;P<b.length;P++)this.isTransparentBounds(b[P])||C.push(b[P]);if(C.length<b.length)return mxGraph.prototype.updateGroupBounds.call(this,C,d,m,p,v,n,y),b}return mxGraph.prototype.updateGroupBounds.apply(this,arguments)};-Graph.prototype.getBoundingBoxFromGeometry=function(b,d,m,p){var v=null,n=null;if(null!=b){n=[];for(var y=0;y<b.length;y++){var C=this.model.isVertex(b[y])?this.getCellGeometry(b[y]):null;if(null!=C&&!C.relative&&this.isTransparentBounds(b[y])){var P=this.getTransparentBounds(b[y]);null!=P&&(C=new mxRectangle(C.x+P.x,C.y+P.y,P.width,P.height),null==v?v=C:v.add(C))}else n.push(b[y])}}b=mxGraph.prototype.getBoundingBoxFromGeometry.call(this,n,d,null!=m?m:b,p);null!=b&&(null==v?v=b:v.add(b));return v};+Graph.prototype.getBoundsForGroup=function(b,d,m){var p=null;if(null!=d)for(var u=0;u<d.length;u++){var n=null;if(this.model.isEdge(d[u]))n=this.getBoundingBoxFromGeometry([d[u]],!0);else if(this.model.isVertex(d[u])){var y=this.getCellGeometry(d[u]);if(null==y||y.relative)continue;if(this.isTransparentBounds(d[u])){var B=this.getTransparentBounds(d[u]);null!=B&&(n=new mxRectangle(y.x+B.x,y.y+B.y,B.width,B.height))}else n=new mxRectangle(y.x,y.y,y.width,y.height)}null!=n&&(null==p?p=n:p.add(n))}null!=+p&&(this.isSwimlane(b)&&(b=this.getStartSize(b),p.x-=b.width,p.y-=b.height,p.width+=b.width,p.height+=b.height),null!=m&&(p.x-=m,p.y-=m,p.width+=2*m,p.height+=2*m));return p};Graph.prototype.updateGroupBounds=function(b,d,m,p,u,n,y){if(null!=b){for(var B=[],P=0;P<b.length;P++)this.isTransparentBounds(b[P])||B.push(b[P]);if(B.length<b.length)return mxGraph.prototype.updateGroupBounds.call(this,B,d,m,p,u,n,y),b}return mxGraph.prototype.updateGroupBounds.apply(this,arguments)};+Graph.prototype.getBoundingBoxFromGeometry=function(b,d,m,p){var u=null,n=null;if(null!=b){n=[];for(var y=0;y<b.length;y++){var B=this.model.isVertex(b[y])?this.getCellGeometry(b[y]):null;if(null!=B&&!B.relative&&this.isTransparentBounds(b[y])){var P=this.getTransparentBounds(b[y]);null!=P&&(B=new mxRectangle(B.x+P.x,B.y+P.y,P.width,P.height),null==u?u=B:u.add(B))}else n.push(b[y])}}b=mxGraph.prototype.getBoundingBoxFromGeometry.call(this,n,d,null!=m?m:b,p);null!=b&&(null==u?u=b:u.add(b));return u};Graph.prototype.isCellConnectable=function(b){var d=this.getCurrentCellStyle(b);return!this.isCellLocked(this.getLayerForCell(b))&&(null!=d.connectable?"0"!=d.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments))};Graph.prototype.isLabelMovable=function(b){var d=this.getCurrentCellStyle(b);return null!=d.movableLabel?"0"!=d.movableLabel:mxGraph.prototype.isLabelMovable.apply(this,arguments)};Graph.prototype.selectAll=function(b){b=b||this.getDefaultParent();this.isCellLocked(b)||mxGraph.prototype.selectAll.apply(this,arguments)};Graph.prototype.selectCells=function(b,d,m){m=m||this.getDefaultParent();this.isCellLocked(m)||mxGraph.prototype.selectCells.apply(this,arguments)};Graph.prototype.getSwimlaneAt=function(b,d,m){var p=mxGraph.prototype.getSwimlaneAt.apply(this,arguments);this.isCellLocked(p)&&(p=null);return p};Graph.prototype.isCellFoldable=function(b){var d=this.getCurrentCellStyle(b);return this.foldingEnabled&&!this.isTransparentBounds(b)&&"0"!=mxUtils.getValue(d,mxConstants.STYLE_RESIZABLE,"1")&&("1"==d.treeFolding||!this.isCellLocked(b)&&(this.isContainer(b)&&"0"!=d.collapsible||!this.isContainer(b)&&"1"==d.collapsible))};Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0);this.escape();this.isSelectionEmpty()||this.clearSelection()};Graph.prototype.zoom=function(b,d){b=Math.max(.01,Math.min(this.view.scale*b,160))/this.view.scale;mxGraph.prototype.zoom.apply(this,arguments)};Graph.prototype.zoomIn=function(){.15>this.view.scale?this.zoom((this.view.scale+.01)/this.view.scale):this.zoom(Math.round(this.view.scale*this.zoomFactor*20)/20/this.view.scale)};Graph.prototype.zoomOut=function(){.15>=this.view.scale?this.zoom((this.view.scale-.01)/this.view.scale):this.zoom(Math.round(1/this.zoomFactor*this.view.scale*20)/20/this.view.scale)};-Graph.prototype.fitPages=function(b,d){var m=1;null==b&&(m=this.getPageLayout(),b=m.width,m=m.height);var p=this.pageScale,v=this.pageFormat,n=this.container.clientHeight-10;b=(this.container.clientWidth-10)/(b*v.width)/p;this.zoomTo(Math.floor(20*(d?b:Math.min(b,n/(m*v.height)/p)))/20);mxUtils.hasScrollbars(this.container)&&(b=this.getPagePadding(),this.container.scrollLeft=Math.min(b.x*this.view.scale,(this.container.scrollWidth-this.container.clientWidth)/2),d||(this.container.scrollTop=Math.min(b.y*+Graph.prototype.fitPages=function(b,d){var m=1;null==b&&(m=this.getPageLayout(),b=m.width,m=m.height);var p=this.pageScale,u=this.pageFormat,n=this.container.clientHeight-10;b=(this.container.clientWidth-10)/(b*u.width)/p;this.zoomTo(Math.floor(20*(d?b:Math.min(b,n/(m*u.height)/p)))/20);mxUtils.hasScrollbars(this.container)&&(b=this.getPagePadding(),this.container.scrollLeft=Math.min(b.x*this.view.scale,(this.container.scrollWidth-this.container.clientWidth)/2),d||(this.container.scrollTop=Math.min(b.y*this.view.scale,(this.container.scrollHeight-this.container.clientHeight)/2)))};-Graph.prototype.fitWindow=function(b,d,m,p,v){d=null!=d?d:10;var n=this.container.clientWidth-d,y=this.container.clientHeight-d,C=Math.floor(20*Math.min(n/b.width,y/b.height))/20;null!=m&&(C=Math.min(C,m));if(!p||C<m)this.zoomTo(C,null,null,mxUtils.hasScrollbars(this.container)),mxUtils.hasScrollbars(this.container)&&(m=this.view.translate,this.container.scrollLeft=(b.x+m.x)*this.view.scale-Math.max((n-b.width*this.view.scale)/2+d/2,0),this.container.scrollTop=(b.y+m.y)*this.view.scale-Math.max((y--b.height*this.view.scale)/2+d/2,0),v&&this.pageVisible&&(b=this.view.getBackgroundPageBounds(),d=this.container.clientWidth,v=this.container.clientHeight,b.width<=d&&(this.container.scrollLeft=b.x+b.width/2-d/2),b.height<=v&&(this.container.scrollTop=b.y+b.height/2-v/2)))};+Graph.prototype.fitWindow=function(b,d,m,p,u){d=null!=d?d:10;var n=this.container.clientWidth-d,y=this.container.clientHeight-d,B=Math.floor(20*Math.min(n/b.width,y/b.height))/20;null!=m&&(B=Math.min(B,m));if(!p||B<m)this.zoomTo(B,null,null,mxUtils.hasScrollbars(this.container)),mxUtils.hasScrollbars(this.container)&&(m=this.view.translate,this.container.scrollLeft=(b.x+m.x)*this.view.scale-Math.max((n-b.width*this.view.scale)/2+d/2,0),this.container.scrollTop=(b.y+m.y)*this.view.scale-Math.max((y-+b.height*this.view.scale)/2+d/2,0),u&&this.pageVisible&&(b=this.view.getBackgroundPageBounds(),d=this.container.clientWidth,u=this.container.clientHeight,b.width<=d&&(this.container.scrollLeft=b.x+b.width/2-d/2),b.height<=u&&(this.container.scrollTop=b.y+b.height/2-u/2)))};Graph.prototype.getCurrentViewBox=function(){var b=this.view,d=this.container,m=b.scale;b=b.translate;return{x:Math.round(d.scrollLeft/m-b.x),y:Math.round(d.scrollTop/m-b.y),width:Math.round(d.clientWidth/m),height:Math.round(d.clientHeight/m),scale:Math.round(1E4*m)/1E4}};Graph.prototype.convertValueToTooltip=function(b){var d=null;mxUtils.isNode(b.value)&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(d=b.value.getAttribute("tooltip_"+Graph.diagramLanguage)),null==d&&(d=b.value.getAttribute("tooltip")),null!=d&&(null!=d&&this.isReplacePlaceholders(b)&&(d=this.replacePlaceholders(b,d)),d=Graph.sanitizeHtml(d)));return d};-Graph.prototype.getTooltipForCell=function(b){if(null!=window.urlParams&&"0"==urlParams.tooltips)return null;var d=this.getLockedGroupAncestor(b);null!=d&&(b=d);d="";if(mxUtils.isNode(b.value)&&(d=this.convertValueToTooltip(b),null==d)){var m=this.builtInProperties;b=b.value.attributes;var p=[];d="";this.isEnabled()&&(m.push("linkTarget"),m.push("link"));for(var v=0;v<b.length;v++)(Graph.translateDiagram&&"label"==b[v].nodeName||0>mxUtils.indexOf(m,b[v].nodeName))&&0<b[v].nodeValue.length&&p.push({name:b[v].nodeName,-value:b[v].nodeValue});p.sort(function(n,y){return n.name<y.name?-1:n.name>y.name?1:0});for(v=0;v<p.length;v++)"link"==p[v].name&&this.isCustomLink(p[v].value)||(d+=("link"!=p[v].name?"<b>"+mxUtils.htmlEntities(p[v].name)+":</b> ":"")+mxUtils.htmlEntities(p[v].value)+"\n");0<d.length&&(d=d.substring(0,d.length-1),mxClient.IS_SVG&&(d='<div style="max-width:360px;text-overflow:ellipsis;overflow:hidden;">'+d+"</div>"))}return d};-Graph.prototype.addFlowAnimationToNode=function(b,d,m,p){if(null!=b&&null!=p){var v=b.getAttribute("stroke-dasharray");if(""==v||null==v){var n=String(mxUtils.getValue(d,mxConstants.STYLE_DASH_PATTERN,"8")).split(" ");v=1==mxUtils.getValue(d,mxConstants.STYLE_FIX_DASH,!1)||null==d.dashPattern?1:mxUtils.getNumber(d,mxConstants.STYLE_STROKEWIDTH,1);if(0<n.length)for(var y=0;y<n.length;y++)n[y]=Math.round(Number(n[y])*m*v*100)/100;b.setAttribute("stroke-dasharray",n.join(" "))}else n=v.split(" ");if(0<-n.length){for(y=v=0;y<n.length;y++){var C=parseFloat(n[y]);isNaN(C)||(v+=parseFloat(n[y]))}0!=n.length%2&&(v*=2);m=Math.round(v/m/16*parseInt(mxUtils.getValue(d,"flowAnimationDuration",500)));n=mxUtils.getValue(d,"flowAnimationTimingFunction","linear");d=mxUtils.getValue(d,"flowAnimationDirection","normal");b.style.animation=p+" "+m+"ms "+mxUtils.htmlEntities(n)+" infinite "+mxUtils.htmlEntities(d);b.style.strokeDashoffset=v}}};+Graph.prototype.getTooltipForCell=function(b){if(null!=window.urlParams&&"0"==urlParams.tooltips)return null;var d=this.getLockedGroupAncestor(b);null!=d&&(b=d);d="";if(mxUtils.isNode(b.value)&&(d=this.convertValueToTooltip(b),null==d)){var m=this.builtInProperties;b=b.value.attributes;var p=[];d="";this.isEnabled()&&(m.push("linkTarget"),m.push("link"));for(var u=0;u<b.length;u++)(Graph.translateDiagram&&"label"==b[u].nodeName||0>mxUtils.indexOf(m,b[u].nodeName))&&0<b[u].nodeValue.length&&p.push({name:b[u].nodeName,+value:b[u].nodeValue});p.sort(function(n,y){return n.name<y.name?-1:n.name>y.name?1:0});for(u=0;u<p.length;u++)"link"==p[u].name&&this.isCustomLink(p[u].value)||(d+=("link"!=p[u].name?"<b>"+mxUtils.htmlEntities(p[u].name)+":</b> ":"")+mxUtils.htmlEntities(p[u].value)+"\n");0<d.length&&(d=d.substring(0,d.length-1),mxClient.IS_SVG&&(d='<div style="max-width:360px;text-overflow:ellipsis;overflow:hidden;">'+d+"</div>"))}return d};+Graph.prototype.addFlowAnimationToNode=function(b,d,m,p){if(null!=b&&null!=p){var u=b.getAttribute("stroke-dasharray");if(""==u||null==u){var n=String(mxUtils.getValue(d,mxConstants.STYLE_DASH_PATTERN,"8")).split(" ");u=1==mxUtils.getValue(d,mxConstants.STYLE_FIX_DASH,!1)||null==d.dashPattern?1:mxUtils.getNumber(d,mxConstants.STYLE_STROKEWIDTH,1);if(0<n.length)for(var y=0;y<n.length;y++)n[y]=Math.round(Number(n[y])*m*u*100)/100;b.setAttribute("stroke-dasharray",n.join(" "))}else n=u.split(" ");if(0<+n.length){for(y=u=0;y<n.length;y++){var B=parseFloat(n[y]);isNaN(B)||(u+=parseFloat(n[y]))}0!=n.length%2&&(u*=2);m=Math.round(u/m/16*parseInt(mxUtils.getValue(d,"flowAnimationDuration",500)));n=mxUtils.getValue(d,"flowAnimationTimingFunction","linear");d=mxUtils.getValue(d,"flowAnimationDirection","normal");b.style.animation=p+" "+m+"ms "+mxUtils.htmlEntities(n)+" infinite "+mxUtils.htmlEntities(d);b.style.strokeDashoffset=u}}};Graph.prototype.addFlowAnimationStyle=function(){var b=document.getElementsByTagName("head")[0];if(null!=b&&null==this.flowAnimationId){this.flowAnimationId="ge-flow-animation-"+Editor.guid();var d=document.createElement("style");d.innerHTML=this.createFlowAnimationCss(this.flowAnimationId);b.appendChild(d)}return this.flowAnimationId};Graph.prototype.createFlowAnimationCss=function(b){return"@keyframes "+b+" {\n to {\n stroke-dashoffset: 0;\n }\n}"};Graph.prototype.stringToBytes=function(b){return Graph.stringToBytes(b)};Graph.prototype.bytesToString=function(b){return Graph.bytesToString(b)};Graph.prototype.compressNode=function(b){return Graph.compressNode(b)};Graph.prototype.compress=function(b,d){return Graph.compress(b,d)};Graph.prototype.decompress=function(b,d){return Graph.decompress(b,d)};Graph.prototype.zapGremlins=function(b){return Graph.zapGremlins(b)};HoverIcons=function(b){mxEventSource.call(this);this.graph=b;this.init()};mxUtils.extend(HoverIcons,mxEventSource);HoverIcons.prototype.arrowSpacing=2;HoverIcons.prototype.updateDelay=500;HoverIcons.prototype.activationDelay=140;HoverIcons.prototype.currentState=null;HoverIcons.prototype.activeArrow=null;HoverIcons.prototype.inactiveOpacity=15;HoverIcons.prototype.cssCursor="copy";HoverIcons.prototype.checkCollisions=!0;HoverIcons.prototype.arrowFill="#29b6f2";HoverIcons.prototype.triangleUp=Graph.createSvgImage(18,28,'<path d="m 6 26 L 12 26 L 12 12 L 18 12 L 9 1 L 1 12 L 6 12 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');@@ -2714,21 +2714,21 @@ mxEvent.getSource(m)==this.graph.container&&this.setDisplay("none")}));this.grapp){d=!1;m=p.getEvent();this.isResetEvent(m)?this.reset():this.isActive()||(p=this.getState(p.getState(),p.getGraphX(),p.getGraphY()),null==p&&mxEvent.isTouchEvent(m)||this.update(p));this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(m,p){m=p.getEvent();this.isResetEvent(m)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(m)||this.update(this.getState(p.getState(),p.getGraphX(),p.getGraphY()),p.getGraphX(),p.getGraphY());null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&&(d=!0)}),mouseUp:mxUtils.bind(this,function(m,p){m=p.getEvent();mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(m),mxEvent.getClientY(m));this.isResetEvent(m)?this.reset():this.isActive()&&!d&&null!=this.mouseDownPoint?this.click(this.currentState,this.getDirection(),p):this.isActive()?1==this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(p.getGraphX(),p.getGraphY())),p.getGraphX(),p.getGraphY())):mxEvent.isTouchEvent(m)||null!=this.bbox&&mxUtils.contains(this.bbox,p.getGraphX(),p.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(m)||this.reset();d=!1;this.resetActiveArrow()})})};HoverIcons.prototype.isResetEvent=function(b,d){return mxEvent.isAltDown(b)||null==this.activeArrow&&mxEvent.isShiftDown(b)||mxEvent.isPopupTrigger(b)&&!this.graph.isCloneEvent(b)};-HoverIcons.prototype.createArrow=function(b,d,m){var p=null;p=mxUtils.createImage(b.src);p.style.width=b.width+"px";p.style.height=b.height+"px";p.style.padding=this.tolerance+"px";null!=d&&p.setAttribute("title",d);p.style.position="absolute";p.style.cursor=this.cssCursor;mxEvent.addGestureListeners(p,mxUtils.bind(this,function(v){null==this.currentState||this.isResetEvent(v)||(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(v),mxEvent.getClientY(v)),this.drag(v,-this.mouseDownPoint.x,this.mouseDownPoint.y),this.activeArrow=p,this.setDisplay("none"),mxEvent.consume(v))}));mxEvent.redirectMouseEvents(p,this.graph,this.currentState);mxEvent.addListener(p,"mouseenter",mxUtils.bind(this,function(v){mxEvent.isMouseEvent(v)&&(null!=this.activeArrow&&this.activeArrow!=p&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(p,100),this.activeArrow=p,this.fireEvent(new mxEventObject("focus",-"arrow",p,"direction",m,"event",v)))}));mxEvent.addListener(p,"mouseleave",mxUtils.bind(this,function(v){mxEvent.isMouseEvent(v)&&this.fireEvent(new mxEventObject("blur","arrow",p,"direction",m,"event",v));this.graph.isMouseDown||this.resetActiveArrow()}));return p};HoverIcons.prototype.resetActiveArrow=function(){null!=this.activeArrow&&(mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.activeArrow=null)};+HoverIcons.prototype.createArrow=function(b,d,m){var p=null;p=mxUtils.createImage(b.src);p.style.width=b.width+"px";p.style.height=b.height+"px";p.style.padding=this.tolerance+"px";null!=d&&p.setAttribute("title",d);p.style.position="absolute";p.style.cursor=this.cssCursor;mxEvent.addGestureListeners(p,mxUtils.bind(this,function(u){null==this.currentState||this.isResetEvent(u)||(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(u),mxEvent.getClientY(u)),this.drag(u,+this.mouseDownPoint.x,this.mouseDownPoint.y),this.activeArrow=p,this.setDisplay("none"),mxEvent.consume(u))}));mxEvent.redirectMouseEvents(p,this.graph,this.currentState);mxEvent.addListener(p,"mouseenter",mxUtils.bind(this,function(u){mxEvent.isMouseEvent(u)&&(null!=this.activeArrow&&this.activeArrow!=p&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(p,100),this.activeArrow=p,this.fireEvent(new mxEventObject("focus",+"arrow",p,"direction",m,"event",u)))}));mxEvent.addListener(p,"mouseleave",mxUtils.bind(this,function(u){mxEvent.isMouseEvent(u)&&this.fireEvent(new mxEventObject("blur","arrow",p,"direction",m,"event",u));this.graph.isMouseDown||this.resetActiveArrow()}));return p};HoverIcons.prototype.resetActiveArrow=function(){null!=this.activeArrow&&(mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.activeArrow=null)};HoverIcons.prototype.getDirection=function(){var b=mxConstants.DIRECTION_EAST;this.activeArrow==this.arrowUp?b=mxConstants.DIRECTION_NORTH:this.activeArrow==this.arrowDown?b=mxConstants.DIRECTION_SOUTH:this.activeArrow==this.arrowLeft&&(b=mxConstants.DIRECTION_WEST);return b};HoverIcons.prototype.visitNodes=function(b){for(var d=0;d<this.elts.length;d++)null!=this.elts[d]&&b(this.elts[d])};HoverIcons.prototype.removeNodes=function(){this.visitNodes(function(b){null!=b.parentNode&&b.parentNode.removeChild(b)})};HoverIcons.prototype.setDisplay=function(b){this.visitNodes(function(d){d.style.display=b})};HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState};HoverIcons.prototype.drag=function(b,d,m){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,d,m),this.graph.isMouseTrigger=mxEvent.isMouseEvent(b),this.graph.isMouseDown=!0,d=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),null!=d&&d.setHandlesVisible(!1),d=this.graph.connectionHandler.edgeState,null!=b&&mxEvent.isShiftDown(b)&&mxEvent.isControlDown(b)&&null!=d&&"orthogonalEdgeStyle"===mxUtils.getValue(d.style,mxConstants.STYLE_EDGE,null)&&(b=this.getDirection(),d.cell.style=mxUtils.setStyle(d.cell.style,"sourcePortConstraint",b),d.style.sourcePortConstraint=b))};HoverIcons.prototype.getStateAt=function(b,d,m){return this.graph.view.getState(this.graph.getCellAt(d,m))};-HoverIcons.prototype.click=function(b,d,m){var p=m.getEvent(),v=m.getGraphX(),n=m.getGraphY();v=this.getStateAt(b,v,n);null==v||!this.graph.model.isEdge(v.cell)||this.graph.isCloneEvent(p)||v.getVisibleTerminalState(!0)!=b&&v.getVisibleTerminalState(!1)!=b?null!=b&&this.execute(b,d,m):(this.graph.setSelectionCell(v.cell),this.reset());m.consume()};+HoverIcons.prototype.click=function(b,d,m){var p=m.getEvent(),u=m.getGraphX(),n=m.getGraphY();u=this.getStateAt(b,u,n);null==u||!this.graph.model.isEdge(u.cell)||this.graph.isCloneEvent(p)||u.getVisibleTerminalState(!0)!=b&&u.getVisibleTerminalState(!1)!=b?null!=b&&this.execute(b,d,m):(this.graph.setSelectionCell(u.cell),this.reset());m.consume()};HoverIcons.prototype.execute=function(b,d,m){m=m.getEvent();this.graph.selectCellsForConnectVertex(this.graph.connectVertex(b.cell,d,this.graph.defaultEdgeLength,m,this.graph.isCloneEvent(m),this.graph.isCloneEvent(m)),m,this)};HoverIcons.prototype.reset=function(b){null!=b&&!b||null==this.updateThread||window.clearTimeout(this.updateThread);this.activeArrow=this.currentState=this.mouseDownPoint=null;this.removeNodes();this.bbox=null;this.fireEvent(new mxEventObject("reset"))};HoverIcons.prototype.repaint=function(){this.bbox=null;if(null!=this.currentState){this.currentState=this.getState(this.currentState);if(null!=this.currentState&&this.graph.model.isVertex(this.currentState.cell)&&this.graph.isCellConnectable(this.currentState.cell)){var b=mxRectangle.fromRectangle(this.currentState);null!=this.currentState.shape&&null!=this.currentState.shape.boundingBox&&(b=mxRectangle.fromRectangle(this.currentState.shape.boundingBox));b.grow(this.graph.tolerance);b.grow(this.arrowSpacing);var d=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);this.graph.isTableRow(this.currentState.cell)&&(d=this.graph.selectionCellsHandler.getHandler(this.graph.model.getParent(this.currentState.cell)));var m=null;null!=d&&(b.x-=d.horizontalOffset/2,b.y-=d.verticalOffset/2,b.width+=d.horizontalOffset,b.height+=d.verticalOffset,null!=d.rotationShape&&null!=d.rotationShape.node&&"hidden"!=d.rotationShape.node.style.visibility&&"none"!=d.rotationShape.node.style.display&&null!=d.rotationShape.boundingBox&&-(m=d.rotationShape.boundingBox));d=mxUtils.bind(this,function(C,P,G){if(null!=m){var O=new mxRectangle(P,G,C.clientWidth,C.clientHeight);mxUtils.intersects(O,m)&&(C==this.arrowUp?G-=O.y+O.height-m.y:C==this.arrowRight?P+=m.x+m.width-O.x:C==this.arrowDown?G+=m.y+m.height-O.y:C==this.arrowLeft&&(P-=O.x+O.width-m.x))}C.style.left=P+"px";C.style.top=G+"px";mxUtils.setOpacity(C,this.inactiveOpacity)});d(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-+(m=d.rotationShape.boundingBox));d=mxUtils.bind(this,function(B,P,G){if(null!=m){var O=new mxRectangle(P,G,B.clientWidth,B.clientHeight);mxUtils.intersects(O,m)&&(B==this.arrowUp?G-=O.y+O.height-m.y:B==this.arrowRight?P+=m.x+m.width-O.x:B==this.arrowDown?G+=m.y+m.height-O.y:B==this.arrowLeft&&(P-=O.x+O.width-m.x))}B.style.left=P+"px";B.style.top=G+"px";mxUtils.setOpacity(B,this.inactiveOpacity)});d(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-this.triangleUp.height-this.tolerance));d(this.arrowRight,Math.round(b.x+b.width-this.tolerance),Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance));d(this.arrowDown,parseInt(this.arrowUp.style.left),Math.round(b.y+b.height-this.tolerance));d(this.arrowLeft,Math.round(b.x-this.triangleLeft.width-this.tolerance),parseInt(this.arrowRight.style.top));if(this.checkCollisions){d=this.graph.getCellAt(b.x+b.width+this.triangleRight.width/2,this.currentState.getCenterY());-var p=this.graph.getCellAt(b.x-this.triangleLeft.width/2,this.currentState.getCenterY()),v=this.graph.getCellAt(this.currentState.getCenterX(),b.y-this.triangleUp.height/2);b=this.graph.getCellAt(this.currentState.getCenterX(),b.y+b.height+this.triangleDown.height/2);null!=d&&d==p&&p==v&&v==b&&(b=v=p=d=null);var n=this.graph.getCellGeometry(this.currentState.cell),y=mxUtils.bind(this,function(C,P){var G=this.graph.model.isVertex(C)&&this.graph.getCellGeometry(C);null==C||this.graph.model.isAncestor(C,-this.currentState.cell)||this.graph.isSwimlane(C)||!(null==G||null==n||G.height<3*n.height&&G.width<3*n.width)?P.style.visibility="visible":P.style.visibility="hidden"});y(d,this.arrowRight);y(p,this.arrowLeft);y(v,this.arrowUp);y(b,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),+var p=this.graph.getCellAt(b.x-this.triangleLeft.width/2,this.currentState.getCenterY()),u=this.graph.getCellAt(this.currentState.getCenterX(),b.y-this.triangleUp.height/2);b=this.graph.getCellAt(this.currentState.getCenterX(),b.y+b.height+this.triangleDown.height/2);null!=d&&d==p&&p==u&&u==b&&(b=u=p=d=null);var n=this.graph.getCellGeometry(this.currentState.cell),y=mxUtils.bind(this,function(B,P){var G=this.graph.model.isVertex(B)&&this.graph.getCellGeometry(B);null==B||this.graph.model.isAncestor(B,+this.currentState.cell)||this.graph.isSwimlane(B)||!(null==G||null==n||G.height<3*n.height&&G.width<3*n.width)?P.style.visibility="visible":P.style.visibility="hidden"});y(d,this.arrowRight);y(p,this.arrowLeft);y(u,this.arrowUp);y(b,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}};HoverIcons.prototype.computeBoundingBox=function(){var b=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(d){null!=d.parentNode&&(d=new mxRectangle(d.offsetLeft,d.offsetTop,d.offsetWidth,d.offsetHeight),null==b?b=d:b.add(d))});return b};HoverIcons.prototype.getState=function(b,d,m){if(null!=b)if(b=b.cell,this.graph.getModel().contains(b)){if(this.graph.getModel().isVertex(b)&&!this.graph.isCellConnectable(b)){var p=this.graph.getModel().getParent(b);this.graph.getModel().isVertex(p)&&this.graph.isCellConnectable(p)&&(b=p)}null==d||null==m||null!=this.currentState&&this.currentState.cell==b||(d=this.graph.getBorderContainer(b,d,m),null!=d&&(b=d));if(this.graph.isCellLocked(b)||this.graph.model.isEdge(b))b=null;b=this.graph.view.getState(b);@@ -2737,131 +2737,131 @@ HoverIcons.prototype.update=function(b,d,m){if(!this.graph.connectionArrowsEnablwindow.setTimeout(mxUtils.bind(this,function(){this.isActive()||this.graph.isMouseDown||this.graph.panningHandler.isActive()||(this.prev=b,this.update(b,d,m))}),this.updateDelay+10))):null!=this.startTime&&(p=(new Date).getTime()-this.startTime);this.setDisplay("");null!=this.currentState&&this.currentState!=b&&p<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,d,m)?this.reset(!1):(null!=this.currentState||p>this.activationDelay)&&this.currentState!=b&&(p>this.updateDelay&&null!=b||null==this.bbox||null==d||null==m||!mxUtils.contains(this.bbox,d,m))&&(null!=b&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(b),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=b&&this.graph.connectionHandler.constraintHandler.reset()):this.reset())}};HoverIcons.prototype.setCurrentState=function(b){"eastwest"!=b.style.portConstraint&&(null!=this.arrowUp&&this.graph.container.appendChild(this.arrowUp),null!=this.arrowDown&&this.graph.container.appendChild(this.arrowDown));null!=this.arrowRight&&this.graph.container.appendChild(this.arrowRight);null!=this.arrowLeft&&this.graph.container.appendChild(this.arrowLeft);this.currentState=b};-Graph.prototype.removeTextStyleForCell=function(b,d){var m=this.getCurrentCellStyle(b),p=!1;this.getModel().beginUpdate();try{if("1"==mxUtils.getValue(m,"html","0")){var v=this.convertValueToString(b);"0"!=mxUtils.getValue(m,"nl2Br","1")&&(v=v.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));v=Editor.convertHtmlToText(v);this.cellLabelChanged(b,v);p=!0}d&&(this.setCellStyles("fontSource",null,[b]),this.setCellStyles(mxConstants.STYLE_FONTFAMILY,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSIZE,-null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSTYLE,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BORDERCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null,[b]))}finally{this.getModel().endUpdate()}return p};Graph.prototype.createParent=function(b,d,m,p,v){b=this.cloneCell(b);for(var n=0;n<m;n++){var y=this.cloneCell(d),C=this.getCellGeometry(y);null!=C&&(C.x+=n*p,C.y+=n*v);b.insert(y)}return b};-Graph.prototype.createTable=function(b,d,m,p,v,n,y,C,P){m=null!=m?m:60;p=null!=p?p:40;n=null!=n?n:30;C=null!=C?C:"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fixedHeader=1;";P=null!=P?P:"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;";-return this.createParent(this.createVertex(null,null,null!=v?v:"",0,0,d*m,b*p+(null!=v?n:0),null!=y?y:"shape=table;startSize="+(null!=v?n:"0")+";container=1;collapsible=0;childLayout=tableLayout;fixedHeader=1;"),this.createParent(this.createVertex(null,null,"",0,0,d*m,p,C),this.createVertex(null,null,"",0,0,m,p,P),d,m,0),b,0,p)};-Graph.prototype.setTableValues=function(b,d,m){for(var p=this.model.getChildCells(b,!0),v=0;v<p.length;v++)if(null!=m&&(p[v].value=m[v]),null!=d)for(var n=this.model.getChildCells(p[v],!0),y=0;y<n.length;y++)null!=d[v][y]&&(n[y].value=d[v][y]);return b};-Graph.prototype.createCrossFunctionalSwimlane=function(b,d,m,p,v,n,y,C,P){m=null!=m?m:120;p=null!=p?p:120;y=null!=y?y:"shape=tableRow;horizontal=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;strokeColor=inherit;bottom=0;right=0;dropTarget=0;fontStyle=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;startSize=40;fixedHeader=1;collapsible=0;recursiveResize=0;expand=0;";C=null!=C?C:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;strokeColor=inherit;connectable=0;fillColor=none;startSize=40;collapsible=0;recursiveResize=0;expand=0;";-P=null!=P?P:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;strokeColor=inherit;fillColor=none;startSize=0;collapsible=0;recursiveResize=0;expand=0;";v=this.createVertex(null,null,null!=v?v:"",0,0,d*m,b*p,null!=n?n:"shape=table;childLayout=tableLayout;fixedHeader=1;"+(null==v?"startSize=0;fillColor=none;":"startSize=40;")+"collapsible=0;recursiveResize=0;expand=0;");n=mxUtils.getValue(this.getCellStyle(v),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);v.geometry.width+=-n;v.geometry.height+=n;y=this.createVertex(null,null,"",0,n,d*m+n,p,y);v.insert(this.createParent(y,this.createVertex(null,null,"",n,0,m,p,C),d,m,0));return 1<b?(y.geometry.y=p+n,this.createParent(v,this.createParent(y,this.createVertex(null,null,"",n,0,m,p,P),d,m,0),b-1,0,p)):v};-Graph.prototype.visitTableCells=function(b,d){var m=null,p=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var v=0;v<p.length;v++){for(var n=this.getActualStartSize(p[v],!0),y=this.model.getChildCells(p[v],!0),C=this.getCellStyle(p[v],!0),P=null,G=[],O=0;O<y.length;O++){var U=this.getCellGeometry(y[O]);if(null==U)G.push(null);else{var c={cell:y[O],rospan:1,colspan:1,row:v,col:O,geo:U};U=null!=U.alternateBounds?U.alternateBounds:U;c.point=new mxPoint(U.width+(null!=P?P.point.x:b.x+-n.x),U.height+(null!=m&&null!=m[0]?m[0].point.y:b.y+n.y));c.actual=c;null!=m&&null!=m[O]&&1<m[O].rowspan?(c.rowspan=m[O].rowspan-1,c.colspan=m[O].colspan,c.actual=m[O].actual):null!=P&&1<P.colspan?(c.rowspan=P.rowspan,c.colspan=P.colspan-1,c.actual=P.actual):(P=this.getCurrentCellStyle(y[O],!0),null!=P&&(c.rowspan=parseInt(P.rowspan||1),c.colspan=parseInt(P.colspan||1)));P=1==mxUtils.getValue(C,mxConstants.STYLE_SWIMLANE_HEAD,1)&&mxUtils.getValue(C,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=-mxConstants.NONE;d(c,y.length,p.length,b.x+(P?n.x:0),b.y+(P?n.y:0));G.push(c);P=c}}m=G}};Graph.prototype.getTableLines=function(b,d,m){var p=[],v=[];(d||m)&&this.visitTableCells(b,mxUtils.bind(this,function(n,y,C,P,G){d&&n.row<C-1&&(null==p[n.row]&&(p[n.row]=[new mxPoint(P,n.point.y)]),1<n.rowspan&&p[n.row].push(null),p[n.row].push(n.point));m&&n.col<y-1&&(null==v[n.col]&&(v[n.col]=[new mxPoint(n.point.x,G)]),1<n.colspan&&v[n.col].push(null),v[n.col].push(n.point))}));return p.concat(v)};-Graph.prototype.paintTableCellLines=function(b,d,m,p,v,n,y,C){if(null!=y&&y!=mxConstants.NONE){var P=this.model,G=!1,O=!1;if(this.isTableRow(d)){var U=P.getChildCells(P.getParent(d),!0);var c=mxUtils.indexOf(U,d);d=(P="0"!=mxUtils.getValue(this.getCurrentCellStyle(P.getParent(d)),"rowLines","1"))&&0<c;U=P&&c<U.length-1}else if(this.isTableCell(d)){G=P.getParent(d);c=P.getParent(G);U=P.getChildCells(c,!0);O=P.getChildCells(G,!0);c=this.getCurrentCellStyle(c);P="0"!=mxUtils.getValue(c,"rowLines","1");-c="0"!=mxUtils.getValue(c,"columnLines","1");G=mxUtils.indexOf(U,G);var f=mxUtils.indexOf(O,d);d=P&&0<G;U=P&&G<U.length-1;G=c&&0<f;O=c&&f<O.length-1}else return;if(d||U||G||O)b.setStrokeColor(y),b.setStrokeWidth(C),b.setDashed(!1),b.setShadow(!1),d&&(b.begin(),b.moveTo(m,p),b.lineTo(m+v,p),b.stroke()),U&&(b.begin(),b.moveTo(m,p+n),b.lineTo(m+v,p+n),b.stroke()),G&&(b.begin(),b.moveTo(m,p),b.lineTo(m,p+n),b.stroke()),O&&(b.begin(),b.moveTo(m+v,p),b.lineTo(m+v,p+n),b.stroke())}};+Graph.prototype.removeTextStyleForCell=function(b,d){var m=this.getCurrentCellStyle(b),p=!1;this.getModel().beginUpdate();try{if("1"==mxUtils.getValue(m,"html","0")){var u=this.convertValueToString(b);"0"!=mxUtils.getValue(m,"nl2Br","1")&&(u=u.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));u=Editor.convertHtmlToText(u);this.cellLabelChanged(b,u);p=!0}d&&(this.setCellStyles("fontSource",null,[b]),this.setCellStyles(mxConstants.STYLE_FONTFAMILY,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSIZE,+null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSTYLE,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BORDERCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null,[b]))}finally{this.getModel().endUpdate()}return p};Graph.prototype.createParent=function(b,d,m,p,u){b=this.cloneCell(b);for(var n=0;n<m;n++){var y=this.cloneCell(d),B=this.getCellGeometry(y);null!=B&&(B.x+=n*p,B.y+=n*u);b.insert(y)}return b};+Graph.prototype.createTable=function(b,d,m,p,u,n,y,B,P){m=null!=m?m:60;p=null!=p?p:40;n=null!=n?n:30;B=null!=B?B:"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fixedHeader=1;";P=null!=P?P:"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;";+return this.createParent(this.createVertex(null,null,null!=u?u:"",0,0,d*m,b*p+(null!=u?n:0),null!=y?y:"shape=table;startSize="+(null!=u?n:"0")+";container=1;collapsible=0;childLayout=tableLayout;fixedHeader=1;"),this.createParent(this.createVertex(null,null,"",0,0,d*m,p,B),this.createVertex(null,null,"",0,0,m,p,P),d,m,0),b,0,p)};+Graph.prototype.setTableValues=function(b,d,m){for(var p=this.model.getChildCells(b,!0),u=0;u<p.length;u++)if(null!=m&&(p[u].value=m[u]),null!=d)for(var n=this.model.getChildCells(p[u],!0),y=0;y<n.length;y++)null!=d[u][y]&&(n[y].value=d[u][y]);return b};+Graph.prototype.createCrossFunctionalSwimlane=function(b,d,m,p,u,n,y,B,P){m=null!=m?m:120;p=null!=p?p:120;y=null!=y?y:"shape=tableRow;horizontal=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;strokeColor=inherit;bottom=0;right=0;dropTarget=0;fontStyle=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;startSize=40;fixedHeader=1;collapsible=0;recursiveResize=0;expand=0;";B=null!=B?B:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;strokeColor=inherit;connectable=0;fillColor=none;startSize=40;collapsible=0;recursiveResize=0;expand=0;";+P=null!=P?P:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;strokeColor=inherit;fillColor=none;startSize=0;collapsible=0;recursiveResize=0;expand=0;";u=this.createVertex(null,null,null!=u?u:"",0,0,d*m,b*p,null!=n?n:"shape=table;childLayout=tableLayout;fixedHeader=1;"+(null==u?"startSize=0;fillColor=none;":"startSize=40;")+"collapsible=0;recursiveResize=0;expand=0;");n=mxUtils.getValue(this.getCellStyle(u),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);u.geometry.width+=+n;u.geometry.height+=n;y=this.createVertex(null,null,"",0,n,d*m+n,p,y);u.insert(this.createParent(y,this.createVertex(null,null,"",n,0,m,p,B),d,m,0));return 1<b?(y.geometry.y=p+n,this.createParent(u,this.createParent(y,this.createVertex(null,null,"",n,0,m,p,P),d,m,0),b-1,0,p)):u};+Graph.prototype.visitTableCells=function(b,d){var m=null,p=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var u=0;u<p.length;u++){for(var n=this.getActualStartSize(p[u],!0),y=this.model.getChildCells(p[u],!0),B=this.getCellStyle(p[u],!0),P=null,G=[],O=0;O<y.length;O++){var U=this.getCellGeometry(y[O]);if(null==U)G.push(null);else{var c={cell:y[O],rospan:1,colspan:1,row:u,col:O,geo:U};U=null!=U.alternateBounds?U.alternateBounds:U;c.point=new mxPoint(U.width+(null!=P?P.point.x:b.x++n.x),U.height+(null!=m&&null!=m[0]?m[0].point.y:b.y+n.y));c.actual=c;null!=m&&null!=m[O]&&1<m[O].rowspan?(c.rowspan=m[O].rowspan-1,c.colspan=m[O].colspan,c.actual=m[O].actual):null!=P&&1<P.colspan?(c.rowspan=P.rowspan,c.colspan=P.colspan-1,c.actual=P.actual):(P=this.getCurrentCellStyle(y[O],!0),null!=P&&(c.rowspan=parseInt(P.rowspan||1),c.colspan=parseInt(P.colspan||1)));P=1==mxUtils.getValue(B,mxConstants.STYLE_SWIMLANE_HEAD,1)&&mxUtils.getValue(B,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=+mxConstants.NONE;d(c,y.length,p.length,b.x+(P?n.x:0),b.y+(P?n.y:0));G.push(c);P=c}}m=G}};Graph.prototype.getTableLines=function(b,d,m){var p=[],u=[];(d||m)&&this.visitTableCells(b,mxUtils.bind(this,function(n,y,B,P,G){d&&n.row<B-1&&(null==p[n.row]&&(p[n.row]=[new mxPoint(P,n.point.y)]),1<n.rowspan&&p[n.row].push(null),p[n.row].push(n.point));m&&n.col<y-1&&(null==u[n.col]&&(u[n.col]=[new mxPoint(n.point.x,G)]),1<n.colspan&&u[n.col].push(null),u[n.col].push(n.point))}));return p.concat(u)};+Graph.prototype.paintTableCellLines=function(b,d,m,p,u,n,y,B){if(null!=y&&y!=mxConstants.NONE){var P=this.model,G=!1,O=!1;if(this.isTableRow(d)){var U=P.getChildCells(P.getParent(d),!0);var c=mxUtils.indexOf(U,d);d=(P="0"!=mxUtils.getValue(this.getCurrentCellStyle(P.getParent(d)),"rowLines","1"))&&0<c;U=P&&c<U.length-1}else if(this.isTableCell(d)){G=P.getParent(d);c=P.getParent(G);U=P.getChildCells(c,!0);O=P.getChildCells(G,!0);c=this.getCurrentCellStyle(c);P="0"!=mxUtils.getValue(c,"rowLines","1");+c="0"!=mxUtils.getValue(c,"columnLines","1");G=mxUtils.indexOf(U,G);var f=mxUtils.indexOf(O,d);d=P&&0<G;U=P&&G<U.length-1;G=c&&0<f;O=c&&f<O.length-1}else return;if(d||U||G||O)b.setStrokeColor(y),b.setStrokeWidth(B),b.setDashed(!1),b.setShadow(!1),d&&(b.begin(),b.moveTo(m,p),b.lineTo(m+u,p),b.stroke()),U&&(b.begin(),b.moveTo(m,p+n),b.lineTo(m+u,p+n),b.stroke()),G&&(b.begin(),b.moveTo(m,p),b.lineTo(m,p+n),b.stroke()),O&&(b.begin(),b.moveTo(m+u,p),b.lineTo(m+u,p+n),b.stroke())}};Graph.prototype.isTableCell=function(b){return this.model.isVertex(b)&&this.isTableRow(this.model.getParent(b))};Graph.prototype.isTableRow=function(b){return this.model.isVertex(b)&&this.isTable(this.model.getParent(b))};Graph.prototype.isTable=function(b){b=this.getCellStyle(b);return null!=b&&"tableLayout"==b.childLayout};Graph.prototype.isStack=function(b){b=this.getCellStyle(b);return null!=b&&"stackLayout"==b.childLayout};Graph.prototype.isStackChild=function(b){return this.model.isVertex(b)&&this.isStack(this.model.getParent(b))};-Graph.prototype.setTableRowHeight=function(b,d,m){m=null!=m?m:!0;var p=this.getModel();p.beginUpdate();try{var v=this.getCellGeometry(b);if(null!=v){v=v.clone();v.height+=d;p.setGeometry(b,v);var n=p.getParent(b),y=p.getChildCells(n,!0);if(!m){var C=mxUtils.indexOf(y,b);if(C<y.length-1){var P=y[C+1],G=this.getCellGeometry(P);null!=G&&(G=G.clone(),G.y+=d,G.height-=d,p.setGeometry(P,G))}}var O=this.getCellGeometry(n);null!=O&&(m||(m=b==y[y.length-1]),m&&(O=O.clone(),O.height+=d,p.setGeometry(n,O)))}}finally{p.endUpdate()}};-Graph.prototype.setTableColumnWidth=function(b,d,m){m=null!=m?m:!1;var p=this.getModel(),v=p.getParent(b),n=p.getParent(v),y=p.getChildCells(v,!0);b=mxUtils.indexOf(y,b);var C=b==y.length-1;p.beginUpdate();try{for(var P=p.getChildCells(n,!0),G=0;G<P.length;G++){v=P[G];y=p.getChildCells(v,!0);var O=y[b],U=this.getCellGeometry(O);null!=U&&(U=U.clone(),U.width+=d,null!=U.alternateBounds&&(U.alternateBounds.width+=d),p.setGeometry(O,U));b<y.length-1&&(O=y[b+1],U=this.getCellGeometry(O),null!=U&&(U=U.clone(),-U.x+=d,m||(U.width-=d,null!=U.alternateBounds&&(U.alternateBounds.width-=d)),p.setGeometry(O,U)))}if(C||m){var c=this.getCellGeometry(n);null!=c&&(c=c.clone(),c.width+=d,p.setGeometry(n,c))}null!=this.layoutManager&&this.layoutManager.executeLayout(n)}finally{p.endUpdate()}};-Graph.prototype.resizeAllTableRows=function(b,d){var m=this.getModel(),p=m.getChildCells(b,!0);if(0!=p.length){m.beginUpdate();try{for(var v=0;v<p.length;v++){var n=this.getCellGeometry(p[v]);null!=n&&(n=n.clone(),n.y+=d*v,n.height=Math.max(Graph.minTableRowHeight,n.height+d),m.setGeometry(p[v],n))}var y=this.getCellGeometry(b);null!=y&&(y=y.clone(),y.height+=d*p.length,m.setGeometry(b,y));null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{m.endUpdate()}}};-Graph.prototype.resizeAllTableColumns=function(b,d){var m=this.getModel(),p=m.getChildCells(b,!0);if(0!=p.length){m.beginUpdate();try{for(var v=0;v<p.length;v++)for(var n=m.getChildCells(p[v],!0),y=0;y<n.length;y++){var C=this.getCellGeometry(n[y]);null!=C&&(C=C.clone(),C.x+=d*y,C.width=Math.max(Graph.minTableColumnWidth,C.width+d),null!=C.alternateBounds&&(C.alternateBounds.width=Math.max(Graph.minTableColumnWidth,C.alternateBounds.width+d)),m.setGeometry(n[y],C))}var P=this.getCellGeometry(b);if(null!=+Graph.prototype.setTableRowHeight=function(b,d,m){m=null!=m?m:!0;var p=this.getModel();p.beginUpdate();try{var u=this.getCellGeometry(b);if(null!=u){u=u.clone();u.height+=d;p.setGeometry(b,u);var n=p.getParent(b),y=p.getChildCells(n,!0);if(!m){var B=mxUtils.indexOf(y,b);if(B<y.length-1){var P=y[B+1],G=this.getCellGeometry(P);null!=G&&(G=G.clone(),G.y+=d,G.height-=d,p.setGeometry(P,G))}}var O=this.getCellGeometry(n);null!=O&&(m||(m=b==y[y.length-1]),m&&(O=O.clone(),O.height+=d,p.setGeometry(n,O)))}}finally{p.endUpdate()}};+Graph.prototype.setTableColumnWidth=function(b,d,m){m=null!=m?m:!1;var p=this.getModel(),u=p.getParent(b),n=p.getParent(u),y=p.getChildCells(u,!0);b=mxUtils.indexOf(y,b);var B=b==y.length-1;p.beginUpdate();try{for(var P=p.getChildCells(n,!0),G=0;G<P.length;G++){u=P[G];y=p.getChildCells(u,!0);var O=y[b],U=this.getCellGeometry(O);null!=U&&(U=U.clone(),U.width+=d,null!=U.alternateBounds&&(U.alternateBounds.width+=d),p.setGeometry(O,U));b<y.length-1&&(O=y[b+1],U=this.getCellGeometry(O),null!=U&&(U=U.clone(),+U.x+=d,m||(U.width-=d,null!=U.alternateBounds&&(U.alternateBounds.width-=d)),p.setGeometry(O,U)))}if(B||m){var c=this.getCellGeometry(n);null!=c&&(c=c.clone(),c.width+=d,p.setGeometry(n,c))}null!=this.layoutManager&&this.layoutManager.executeLayout(n)}finally{p.endUpdate()}};+Graph.prototype.resizeAllTableRows=function(b,d){var m=this.getModel(),p=m.getChildCells(b,!0);if(0!=p.length){m.beginUpdate();try{for(var u=0;u<p.length;u++){var n=this.getCellGeometry(p[u]);null!=n&&(n=n.clone(),n.y+=d*u,n.height=Math.max(Graph.minTableRowHeight,n.height+d),m.setGeometry(p[u],n))}var y=this.getCellGeometry(b);null!=y&&(y=y.clone(),y.height+=d*p.length,m.setGeometry(b,y));null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{m.endUpdate()}}};+Graph.prototype.resizeAllTableColumns=function(b,d){var m=this.getModel(),p=m.getChildCells(b,!0);if(0!=p.length){m.beginUpdate();try{for(var u=0;u<p.length;u++)for(var n=m.getChildCells(p[u],!0),y=0;y<n.length;y++){var B=this.getCellGeometry(n[y]);null!=B&&(B=B.clone(),B.x+=d*y,B.width=Math.max(Graph.minTableColumnWidth,B.width+d),null!=B.alternateBounds&&(B.alternateBounds.width=Math.max(Graph.minTableColumnWidth,B.alternateBounds.width+d)),m.setGeometry(n[y],B))}var P=this.getCellGeometry(b);if(null!=P){var G=m.getChildCells(p[0],!0).length;P=P.clone();P.width+=d*G;m.setGeometry(b,P)}null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{m.endUpdate()}}};-Graph.prototype.distributeRows=function(b){var d=this.getModel(),m=d.getChildCells(b,!0);if(!(2>m.length)){d.beginUpdate();try{for(var p=0,v=0;v<m.length;v++){var n=this.getCellGeometry(m[v]);null!=n&&(p+=n.height)}var y=p/m.length;for(v=p=0;v<m.length;v++)n=this.getCellGeometry(m[v]),null!=n&&(n=n.clone(),0==v&&(p=n.y),n.y=p,n.height=y,d.setGeometry(m[v],n),p+=y);null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{d.endUpdate()}}};-Graph.prototype.distributeColumns=function(b){var d=this.getModel(),m=d.getChildCells(b,!0);if(0!=m.length){var p=d.getChildCells(m[0],!0);if(!(2>p.length)){d.beginUpdate();try{for(var v=0,n=0;n<p.length;n++){var y=this.getCellGeometry(p[n]);null!=y&&(v+=(null!=y.alternateBounds?y.alternateBounds:y).width)}var C=v/p.length;for(n=0;n<m.length;n++){var P=d.getChildCells(m[n],!0);for(v=p=0;v<P.length;v++)y=this.getCellGeometry(P[v]),null!=y&&(y=y.clone(),0==v&&(p=y.x),y.x=p,y.width=C,null!=y.alternateBounds&&-(y.alternateBounds.width=C),d.setGeometry(P[v],y),p+=C)}null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{d.endUpdate()}}}};function TableLayout(b){mxGraphLayout.call(this,b)}TableLayout.prototype=new mxStackLayout;TableLayout.prototype.constructor=TableLayout;TableLayout.prototype.isHorizontal=function(){return!1};TableLayout.prototype.isVertexIgnored=function(b){return!this.graph.getModel().isVertex(b)||!this.graph.isCellVisible(b)};-TableLayout.prototype.getSize=function(b,d){for(var m=0,p=0;p<b.length;p++)if(!this.isVertexIgnored(b[p])){var v=this.graph.getCellGeometry(b[p]);null!=v&&(m+=d?v.width:v.height)}return m};-TableLayout.prototype.getRowLayout=function(b,d){var m=this.graph.model.getChildCells(b,!0),p=this.graph.getActualStartSize(b,!0);b=this.getSize(m,!0);d=d-p.x-p.width;var v=[];p=p.x;for(var n=0;n<m.length;n++){var y=this.graph.getCellGeometry(m[n]);null!=y&&(p+=(null!=y.alternateBounds?y.alternateBounds.width:y.width)*d/b,v.push(Math.round(p)))}return v};-TableLayout.prototype.layoutRow=function(b,d,m,p){var v=this.graph.getModel(),n=v.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var y=b.x,C=0;null!=d&&(d=d.slice(),d.splice(0,0,b.x));for(var P=0;P<n.length;P++){var G=this.graph.getCellGeometry(n[P]);null!=G&&(G=G.clone(),G.y=b.y,G.height=m-b.y-b.height,null!=d?(G.x=d[P],G.width=d[P+1]-G.x,P==n.length-1&&P<d.length-2&&(G.width=p-G.x-b.x-b.width)):(G.x=y,y+=G.width,P==n.length-1?G.width=p-b.x-b.width-C:C+=G.width),G.alternateBounds=new mxRectangle(0,-0,G.width,G.height),v.setGeometry(n[P],G))}return C};-TableLayout.prototype.execute=function(b){var d=null!=b?this.graph.getCellGeometry(b):null;if(null!=d){var m=this.graph.getActualStartSize(b,!0),p=this.graph.getCellStyle(b),v="1"==mxUtils.getValue(p,"resizeLastRow","0"),n="1"==mxUtils.getValue(p,"resizeLast","0");p="1"==mxUtils.getValue(p,"fixedRows","0");var y=this.graph.getModel(),C=0;y.beginUpdate();try{for(var P=d.height-m.y-m.height,G=d.width-m.x-m.width,O=y.getChildCells(b,!0),U=0;U<O.length;U++)y.setVisible(O[U],!0);var c=this.getSize(O,!1);-if(0<P&&0<G&&0<O.length&&0<c){if(v){var f=this.graph.getCellGeometry(O[O.length-1]);null!=f&&(f=f.clone(),f.height=P-c+f.height,y.setGeometry(O[O.length-1],f))}var k=n?null:this.getRowLayout(O[0],G),q=[],x=m.y;for(U=0;U<O.length;U++)f=this.graph.getCellGeometry(O[U]),null!=f&&(f=f.clone(),f.x=m.x,f.width=G,f.y=Math.round(x),x=v||p?x+f.height:x+f.height/c*P,f.height=Math.round(x)-f.y,y.setGeometry(O[U],f),C=Math.max(C,this.layoutRow(O[U],k,f.height,G,q)));p&&P<c&&(d=d.clone(),d.height=x+m.height,y.setGeometry(b,-d));n&&G<C+Graph.minTableColumnWidth&&(d=d.clone(),d.width=C+m.width+m.x+Graph.minTableColumnWidth,y.setGeometry(b,d));this.graph.visitTableCells(b,mxUtils.bind(this,function(B){y.setVisible(B.cell,B.actual.cell==B.cell);if(B.actual.cell!=B.cell){if(B.actual.row==B.row){var E=null!=B.geo.alternateBounds?B.geo.alternateBounds:B.geo;B.actual.geo.width+=E.width}B.actual.col==B.col&&(E=null!=B.geo.alternateBounds?B.geo.alternateBounds:B.geo,B.actual.geo.height+=E.height)}}))}else for(U=0;U<O.length;U++)y.setVisible(O[U],+Graph.prototype.distributeRows=function(b){var d=this.getModel(),m=d.getChildCells(b,!0);if(!(2>m.length)){d.beginUpdate();try{for(var p=0,u=0;u<m.length;u++){var n=this.getCellGeometry(m[u]);null!=n&&(p+=n.height)}var y=p/m.length;for(u=p=0;u<m.length;u++)n=this.getCellGeometry(m[u]),null!=n&&(n=n.clone(),0==u&&(p=n.y),n.y=p,n.height=y,d.setGeometry(m[u],n),p+=y);null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{d.endUpdate()}}};+Graph.prototype.distributeColumns=function(b){var d=this.getModel(),m=d.getChildCells(b,!0);if(0!=m.length){var p=d.getChildCells(m[0],!0);if(!(2>p.length)){d.beginUpdate();try{for(var u=0,n=0;n<p.length;n++){var y=this.getCellGeometry(p[n]);null!=y&&(u+=(null!=y.alternateBounds?y.alternateBounds:y).width)}var B=u/p.length;for(n=0;n<m.length;n++){var P=d.getChildCells(m[n],!0);for(u=p=0;u<P.length;u++)y=this.getCellGeometry(P[u]),null!=y&&(y=y.clone(),0==u&&(p=y.x),y.x=p,y.width=B,null!=y.alternateBounds&&+(y.alternateBounds.width=B),d.setGeometry(P[u],y),p+=B)}null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{d.endUpdate()}}}};function TableLayout(b){mxGraphLayout.call(this,b)}TableLayout.prototype=new mxStackLayout;TableLayout.prototype.constructor=TableLayout;TableLayout.prototype.isHorizontal=function(){return!1};TableLayout.prototype.isVertexIgnored=function(b){return!this.graph.getModel().isVertex(b)||!this.graph.isCellVisible(b)};+TableLayout.prototype.getSize=function(b,d){for(var m=0,p=0;p<b.length;p++)if(!this.isVertexIgnored(b[p])){var u=this.graph.getCellGeometry(b[p]);null!=u&&(m+=d?u.width:u.height)}return m};+TableLayout.prototype.getRowLayout=function(b,d){var m=this.graph.model.getChildCells(b,!0),p=this.graph.getActualStartSize(b,!0);b=this.getSize(m,!0);d=d-p.x-p.width;var u=[];p=p.x;for(var n=0;n<m.length;n++){var y=this.graph.getCellGeometry(m[n]);null!=y&&(p+=(null!=y.alternateBounds?y.alternateBounds.width:y.width)*d/b,u.push(Math.round(p)))}return u};+TableLayout.prototype.layoutRow=function(b,d,m,p){var u=this.graph.getModel(),n=u.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var y=b.x,B=0;null!=d&&(d=d.slice(),d.splice(0,0,b.x));for(var P=0;P<n.length;P++){var G=this.graph.getCellGeometry(n[P]);null!=G&&(G=G.clone(),G.y=b.y,G.height=m-b.y-b.height,null!=d?(G.x=d[P],G.width=d[P+1]-G.x,P==n.length-1&&P<d.length-2&&(G.width=p-G.x-b.x-b.width)):(G.x=y,y+=G.width,P==n.length-1?G.width=p-b.x-b.width-B:B+=G.width),G.alternateBounds=new mxRectangle(0,+0,G.width,G.height),u.setGeometry(n[P],G))}return B};+TableLayout.prototype.execute=function(b){var d=null!=b?this.graph.getCellGeometry(b):null;if(null!=d){var m=this.graph.getActualStartSize(b,!0),p=this.graph.getCellStyle(b),u="1"==mxUtils.getValue(p,"resizeLastRow","0"),n="1"==mxUtils.getValue(p,"resizeLast","0");p="1"==mxUtils.getValue(p,"fixedRows","0");var y=this.graph.getModel(),B=0;y.beginUpdate();try{for(var P=d.height-m.y-m.height,G=d.width-m.x-m.width,O=y.getChildCells(b,!0),U=0;U<O.length;U++)y.setVisible(O[U],!0);var c=this.getSize(O,!1);+if(0<P&&0<G&&0<O.length&&0<c){if(u){var f=this.graph.getCellGeometry(O[O.length-1]);null!=f&&(f=f.clone(),f.height=P-c+f.height,y.setGeometry(O[O.length-1],f))}var k=n?null:this.getRowLayout(O[0],G),q=[],x=m.y;for(U=0;U<O.length;U++)f=this.graph.getCellGeometry(O[U]),null!=f&&(f=f.clone(),f.x=m.x,f.width=G,f.y=Math.round(x),x=u||p?x+f.height:x+f.height/c*P,f.height=Math.round(x)-f.y,y.setGeometry(O[U],f),B=Math.max(B,this.layoutRow(O[U],k,f.height,G,q)));p&&P<c&&(d=d.clone(),d.height=x+m.height,y.setGeometry(b,+d));n&&G<B+Graph.minTableColumnWidth&&(d=d.clone(),d.width=B+m.width+m.x+Graph.minTableColumnWidth,y.setGeometry(b,d));this.graph.visitTableCells(b,mxUtils.bind(this,function(C){y.setVisible(C.cell,C.actual.cell==C.cell);if(C.actual.cell!=C.cell){if(C.actual.row==C.row){var E=null!=C.geo.alternateBounds?C.geo.alternateBounds:C.geo;C.actual.geo.width+=E.width}C.actual.col==C.col&&(E=null!=C.geo.alternateBounds?C.geo.alternateBounds:C.geo,C.actual.geo.height+=E.height)}}))}else for(U=0;U<O.length;U++)y.setVisible(O[U],!1)}finally{y.endUpdate()}}};(function(){var b=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){b.apply(this,arguments);this.validEdges=[]};var d=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(c,f){f=null!=f?f:!0;var k=this.getState(c);null!=k&&f&&this.graph.model.isEdge(k.cell)&&null!=k.style&&1!=k.style[mxConstants.STYLE_CURVED]&&!k.invalid&&this.updateLineJumps(k)&&this.graph.cellRenderer.redraw(k,!1,this.isRendering());if(null!=k&&k.invalid){if(this.graph.showLinkIcons){k=this.graph.getLinkForCell(c);var q=null!=k&&0<k.length,x=!1;if(null!=c.overlays)for(k=0;k<c.overlays.length;k++)if(c.overlays[k].isLinkOverlay){x=!0;break}if(q&&!x)k=this.graph.createLinkOverlay(c),null!=k&&(null==c.overlays&&(c.overlays=[]),c.overlays.push(k));else if(!q&&x){for(k=c.overlays.length-1;0<=k;k--)c.overlays[k].isLinkOverlay&&c.overlays.splice(k,1);0==c.overlays.length&&(c.overlays=null)}}else if(null!=c.overlays){for(k=c.overlays.length-1;0<=k;k--)c.overlays[k].isLinkOverlay&&c.overlays.splice(k,1);0==c.overlays.length&&(c.overlays=null)}if(this.graph.showTooltipIcons){k=this.graph.convertValueToTooltip(c);q=null!=k&&0<k.length;x=!1;if(null!=c.overlays)for(k=0;k<c.overlays.length;k++)if(c.overlays[k].isTooltipOverlay){x=!0;break}if(q&&!x)k=this.graph.createTooltipOverlay(c),null!=k&&(null==c.overlays&&(c.overlays=[]),c.overlays.push(k));else if(!q&&x){for(k=c.overlays.length-1;0<=k;k--)c.overlays[k].isTooltipOverlay&&c.overlays.splice(k,1);0==c.overlays.length&&(c.overlays=null)}}else if(null!=c.overlays){for(k=c.overlays.length-1;0<=k;k--)c.overlays[k].isTooltipOverlay&&c.overlays.splice(k,1);0==c.overlays.length&&(c.overlays=null)}}k=d.apply(this,arguments);null!=k&&f&&this.graph.model.isEdge(k.cell)&&null!=k.style&&1!=k.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(k);return k};mxShape.prototype.isFlowAnimationEnabled=function(){return null!=this.state&&this.state.view.graph.enableFlowAnimation&&this.state.view.graph.model.isEdge(this.state.cell)&&"1"==mxUtils.getValue(this.state.style,-"flowAnimation","0")};mxShape.prototype.getFlowAnimationPath=function(c){var f=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=f)for(var k=null,q=!1,x=0;x<f.length;x++){var B=f[x];if("hidden"==B.getAttribute("visibility"))q||(k=B.getAttribute("d"));else if("none"==B.getAttribute("stroke"))q||k!=B.getAttribute("d")||(k=null);else if(null==B.getAttribute("data-rough-fill")&&(null==k||k==B.getAttribute("d"))){if(null==c||0==--c)return B;k=B.getAttribute("d");q=!0}}return null};mxShape.prototype.addFlowAnimationToShape=+"flowAnimation","0")};mxShape.prototype.getFlowAnimationPath=function(c){var f=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=f)for(var k=null,q=!1,x=0;x<f.length;x++){var C=f[x];if("hidden"==C.getAttribute("visibility"))q||(k=C.getAttribute("d"));else if("none"==C.getAttribute("stroke"))q||k!=C.getAttribute("d")||(k=null);else if(null==C.getAttribute("data-rough-fill")&&(null==k||k==C.getAttribute("d"))){if(null==c||0==--c)return C;k=C.getAttribute("d");q=!0}}return null};mxShape.prototype.addFlowAnimationToShape=function(){null!=this.state&&this.state.view.graph.addFlowAnimationToNode(this.getFlowAnimationPath(),this.state.style,this.state.view.scale,this.state.view.graph.addFlowAnimationStyle())};var m=mxShape.prototype.paint;mxShape.prototype.paint=function(c){m.apply(this,arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var p=mxShape.prototype.createSvgCanvas;mxShape.prototype.createSvgCanvas=function(c){c=p.apply(this,arguments);null!=this.state&&(c.adaptiveColors=this.state.view.graph.getAdaptiveColors());-return c};var v=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(c,f){return v.apply(this,arguments)||null!=c.routedPoints&&null!=f.routedPoints&&!mxUtils.equalPoints(f.routedPoints,c.routedPoints)};var n=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(c){n.apply(this,arguments);if(this.graph.model.isVertex(c.cell)&&this.graph.isTransparentBounds(c.cell)){var f=this.graph.getTransparentBounds(c.cell);null!=f?(c.x=this.scale*+return c};var u=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(c,f){return u.apply(this,arguments)||null!=c.routedPoints&&null!=f.routedPoints&&!mxUtils.equalPoints(f.routedPoints,c.routedPoints)};var n=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(c){n.apply(this,arguments);if(this.graph.model.isVertex(c.cell)&&this.graph.isTransparentBounds(c.cell)){var f=this.graph.getTransparentBounds(c.cell);null!=f?(c.x=this.scale*(this.translate.x+c.origin.x+f.x),c.y=this.scale*(this.translate.y+c.origin.y+f.y),c.width=this.scale*f.width,c.height=this.scale*f.height,c.unscaledWidth=f.width,c.unscaledHeight=f.height):(c.width=0,c.height=0,c.unscaledWidth=0,c.unscaledHeight=0)}this.graph.model.isEdge(c.cell)&&1!=c.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(c)};var y=mxMorphing.prototype.getDelta;mxMorphing.prototype.getDelta=function(c){return null!=c&&null!=c.cell&&null!=this.graph.isTransparentBounds&&this.graph.isTransparentBounds(c.cell)?-new mxPoint(0,0):y.apply(this,arguments)};mxGraphView.prototype.updateLineJumps=function(c){var f=c.absolutePoints;if(Graph.lineJumpsEnabled){var k=null!=c.routedPoints,q=null;if(null!=f&&null!=this.validEdges&&"none"!==mxUtils.getValue(c.style,"jumpStyle","none")){var x=function(l,t,H){var J=new mxPoint(t,H);J.type=l;q.push(J);J=null!=c.routedPoints?c.routedPoints[q.length-1]:null;return null==J||J.type!=l||J.x!=t||J.y!=H},B=.5*this.scale;k=!1;q=[];for(var E=0;E<f.length-1;E++){for(var L=f[E+1],+new mxPoint(0,0):y.apply(this,arguments)};mxGraphView.prototype.updateLineJumps=function(c){var f=c.absolutePoints;if(Graph.lineJumpsEnabled){var k=null!=c.routedPoints,q=null;if(null!=f&&null!=this.validEdges&&"none"!==mxUtils.getValue(c.style,"jumpStyle","none")){var x=function(l,t,H){var J=new mxPoint(t,H);J.type=l;q.push(J);J=null!=c.routedPoints?c.routedPoints[q.length-1]:null;return null==J||J.type!=l||J.x!=t||J.y!=H},C=.5*this.scale;k=!1;q=[];for(var E=0;E<f.length-1;E++){for(var L=f[E+1],Q=f[E],V=[],K=f[E+2];E<f.length-2&&mxUtils.ptSegDistSq(Q.x,Q.y,K.x,K.y,L.x,L.y)<1*this.scale*this.scale;)L=K,E++,K=f[E+2];k=x(0,Q.x,Q.y)||k;for(var fa=0;fa<this.validEdges.length;fa++){var aa=this.validEdges[fa],da=aa.absolutePoints;if(null!=da&&mxUtils.intersects(c,aa)&&"1"!=aa.style.noJump){var ba=null;for(aa=0;aa<da.length-1;aa++){var ha=da[aa+1],qa=da[aa];for(K=da[aa+2];aa<da.length-2&&mxUtils.ptSegDistSq(qa.x,qa.y,K.x,K.y,ha.x,ha.y)<1*this.scale*this.scale;)ha=K,aa++,K=da[aa+2];var ra=mxUtils.intersection(Q.x,-Q.y,L.x,L.y,qa.x,qa.y,ha.x,ha.y);if(null!=ra&&(Math.abs(ra.x-Q.x)>B||Math.abs(ra.y-Q.y)>B)&&(Math.abs(ra.x-L.x)>B||Math.abs(ra.y-L.y)>B)&&(null==ba||mxUtils.ptLineDist(Q.x,Q.y,L.x,L.y,ba.x,ba.y)>B||mxUtils.ptLineDist(Q.x,Q.y,L.x,L.y,qa.x,qa.y)>B)&&(null==K||mxUtils.ptLineDist(Q.x,Q.y,L.x,L.y,K.x,K.y)>B||mxUtils.ptLineDist(Q.x,Q.y,L.x,L.y,ha.x,ha.y)>B)){K=ra.x-Q.x;ba=ra.y-Q.y;ra={distSq:K*K+ba*ba,x:ra.x,y:ra.y};K=V.length;for(ba=0;ba<V.length;ba++)if(V[ba].distSq>ra.distSq){K=ba;break}(0==K||Math.abs(V[K--1].x-ra.x)>B||Math.abs(V[K-1].y-ra.y)>B)&&(K==V.length||Math.abs(V[K].x-ra.x)>B||Math.abs(V[K].y-ra.y)>B)&&V.splice(K,0,ra)}ba=qa}}}for(aa=0;aa<V.length;aa++)k=x(1,V[aa].x,V[aa].y)||k}ra=f[f.length-1];k=x(0,ra.x,ra.y)||k}c.routedPoints=q;return k}return!1};var C=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(c,f,k){this.routedPoints=null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)C.apply(this,-arguments);else{var q=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,x=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,B=mxUtils.getValue(this.style,"jumpStyle","none"),E=!0,L=null,Q=null,V=[],K=null;c.begin();for(var fa=0;fa<this.state.routedPoints.length;fa++){var aa=this.state.routedPoints[fa],da=new mxPoint(aa.x/this.scale,aa.y/this.scale);0==fa?da=f[0]:fa==this.state.routedPoints.length-1&&(da=f[f.length-1]);var ba=-!1;if(null!=L&&1==aa.type){var ha=this.state.routedPoints[fa+1];aa=ha.x/this.scale-da.x;ha=ha.y/this.scale-da.y;aa=aa*aa+ha*ha;null==K&&(K=new mxPoint(da.x-L.x,da.y-L.y),Q=Math.sqrt(K.x*K.x+K.y*K.y),0<Q?(K.x=K.x*x/Q,K.y=K.y*x/Q):K=null);aa>x*x&&0<Q&&(aa=L.x-da.x,ha=L.y-da.y,aa=aa*aa+ha*ha,aa>x*x&&(ba=new mxPoint(da.x-K.x,da.y-K.y),aa=new mxPoint(da.x+K.x,da.y+K.y),V.push(ba),this.addPoints(c,V,k,q,!1,null,E),V=0>Math.round(K.x)||0==Math.round(K.x)&&0>=Math.round(K.y)?1:-1,E=!1,"sharp"==B?(c.lineTo(ba.x--K.y*V,ba.y+K.x*V),c.lineTo(aa.x-K.y*V,aa.y+K.x*V),c.lineTo(aa.x,aa.y)):"line"==B?(c.moveTo(ba.x+K.y*V,ba.y-K.x*V),c.lineTo(ba.x-K.y*V,ba.y+K.x*V),c.moveTo(aa.x-K.y*V,aa.y+K.x*V),c.lineTo(aa.x+K.y*V,aa.y-K.x*V),c.moveTo(aa.x,aa.y)):"arc"==B?(V*=1.3,c.curveTo(ba.x-K.y*V,ba.y+K.x*V,aa.x-K.y*V,aa.y+K.x*V,aa.x,aa.y)):(c.moveTo(aa.x,aa.y),E=!0),V=[aa],ba=!0))}else K=null;ba||(V.push(da),L=da)}this.addPoints(c,V,k,q,!1,null,E);c.stroke()}};var P=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=-function(c,f,k,q){return null!=f&&"centerPerimeter"==f.style[mxConstants.STYLE_PERIMETER]?new mxPoint(f.getCenterX(),f.getCenterY()):P.apply(this,arguments)};var G=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(c,f,k,q){if(null==f||null==c||"1"!=f.style.snapToPoint&&"1"!=c.style.snapToPoint)G.apply(this,arguments);else{f=this.getTerminalPort(c,f,q);var x=this.getNextPoint(c,k,q),B=this.graph.isOrthogonal(c),E=mxUtils.toRadians(Number(f.style[mxConstants.STYLE_ROTATION]||-"0")),L=new mxPoint(f.getCenterX(),f.getCenterY());if(0!=E){var Q=Math.cos(-E),V=Math.sin(-E);x=mxUtils.getRotatedPoint(x,Q,V,L)}Q=parseFloat(c.style[mxConstants.STYLE_PERIMETER_SPACING]||0);Q+=parseFloat(c.style[q?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);x=this.getPerimeterPoint(f,x,0==E&&B,Q);0!=E&&(Q=Math.cos(E),V=Math.sin(E),x=mxUtils.getRotatedPoint(x,Q,V,L));c.setAbsoluteTerminalPoint(this.snapToAnchorPoint(c,f,k,q,x),q)}};mxGraphView.prototype.snapToAnchorPoint=-function(c,f,k,q,x){if(null!=f&&null!=c){c=this.graph.getAllConnectionConstraints(f);q=k=null;if(null!=c)for(var B=0;B<c.length;B++){var E=this.graph.getConnectionPoint(f,c[B]);if(null!=E){var L=(E.x-x.x)*(E.x-x.x)+(E.y-x.y)*(E.y-x.y);if(null==q||L<q)k=E,q=L}}null!=k&&(x=k)}return x};var O=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(c,f,k){var q=O.apply(this,arguments);"1"==c.getAttribute("placeholders")&&null!=k.state&&(q=k.state.view.graph.replacePlaceholders(k.state.cell,+Q.y,L.x,L.y,qa.x,qa.y,ha.x,ha.y);if(null!=ra&&(Math.abs(ra.x-Q.x)>C||Math.abs(ra.y-Q.y)>C)&&(Math.abs(ra.x-L.x)>C||Math.abs(ra.y-L.y)>C)&&(null==ba||mxUtils.ptLineDist(Q.x,Q.y,L.x,L.y,ba.x,ba.y)>C||mxUtils.ptLineDist(Q.x,Q.y,L.x,L.y,qa.x,qa.y)>C)&&(null==K||mxUtils.ptLineDist(Q.x,Q.y,L.x,L.y,K.x,K.y)>C||mxUtils.ptLineDist(Q.x,Q.y,L.x,L.y,ha.x,ha.y)>C)){K=ra.x-Q.x;ba=ra.y-Q.y;ra={distSq:K*K+ba*ba,x:ra.x,y:ra.y};K=V.length;for(ba=0;ba<V.length;ba++)if(V[ba].distSq>ra.distSq){K=ba;break}(0==K||Math.abs(V[K-+1].x-ra.x)>C||Math.abs(V[K-1].y-ra.y)>C)&&(K==V.length||Math.abs(V[K].x-ra.x)>C||Math.abs(V[K].y-ra.y)>C)&&V.splice(K,0,ra)}ba=qa}}}for(aa=0;aa<V.length;aa++)k=x(1,V[aa].x,V[aa].y)||k}ra=f[f.length-1];k=x(0,ra.x,ra.y)||k}c.routedPoints=q;return k}return!1};var B=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(c,f,k){this.routedPoints=null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)B.apply(this,+arguments);else{var q=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,x=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,C=mxUtils.getValue(this.style,"jumpStyle","none"),E=!0,L=null,Q=null,V=[],K=null;c.begin();for(var fa=0;fa<this.state.routedPoints.length;fa++){var aa=this.state.routedPoints[fa],da=new mxPoint(aa.x/this.scale,aa.y/this.scale);0==fa?da=f[0]:fa==this.state.routedPoints.length-1&&(da=f[f.length-1]);var ba=+!1;if(null!=L&&1==aa.type){var ha=this.state.routedPoints[fa+1];aa=ha.x/this.scale-da.x;ha=ha.y/this.scale-da.y;aa=aa*aa+ha*ha;null==K&&(K=new mxPoint(da.x-L.x,da.y-L.y),Q=Math.sqrt(K.x*K.x+K.y*K.y),0<Q?(K.x=K.x*x/Q,K.y=K.y*x/Q):K=null);aa>x*x&&0<Q&&(aa=L.x-da.x,ha=L.y-da.y,aa=aa*aa+ha*ha,aa>x*x&&(ba=new mxPoint(da.x-K.x,da.y-K.y),aa=new mxPoint(da.x+K.x,da.y+K.y),V.push(ba),this.addPoints(c,V,k,q,!1,null,E),V=0>Math.round(K.x)||0==Math.round(K.x)&&0>=Math.round(K.y)?1:-1,E=!1,"sharp"==C?(c.lineTo(ba.x-+K.y*V,ba.y+K.x*V),c.lineTo(aa.x-K.y*V,aa.y+K.x*V),c.lineTo(aa.x,aa.y)):"line"==C?(c.moveTo(ba.x+K.y*V,ba.y-K.x*V),c.lineTo(ba.x-K.y*V,ba.y+K.x*V),c.moveTo(aa.x-K.y*V,aa.y+K.x*V),c.lineTo(aa.x+K.y*V,aa.y-K.x*V),c.moveTo(aa.x,aa.y)):"arc"==C?(V*=1.3,c.curveTo(ba.x-K.y*V,ba.y+K.x*V,aa.x-K.y*V,aa.y+K.x*V,aa.x,aa.y)):(c.moveTo(aa.x,aa.y),E=!0),V=[aa],ba=!0))}else K=null;ba||(V.push(da),L=da)}this.addPoints(c,V,k,q,!1,null,E);c.stroke()}};var P=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=+function(c,f,k,q){return null!=f&&"centerPerimeter"==f.style[mxConstants.STYLE_PERIMETER]?new mxPoint(f.getCenterX(),f.getCenterY()):P.apply(this,arguments)};var G=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(c,f,k,q){if(null==f||null==c||"1"!=f.style.snapToPoint&&"1"!=c.style.snapToPoint)G.apply(this,arguments);else{f=this.getTerminalPort(c,f,q);var x=this.getNextPoint(c,k,q),C=this.graph.isOrthogonal(c),E=mxUtils.toRadians(Number(f.style[mxConstants.STYLE_ROTATION]||+"0")),L=new mxPoint(f.getCenterX(),f.getCenterY());if(0!=E){var Q=Math.cos(-E),V=Math.sin(-E);x=mxUtils.getRotatedPoint(x,Q,V,L)}Q=parseFloat(c.style[mxConstants.STYLE_PERIMETER_SPACING]||0);Q+=parseFloat(c.style[q?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);x=this.getPerimeterPoint(f,x,0==E&&C,Q);0!=E&&(Q=Math.cos(E),V=Math.sin(E),x=mxUtils.getRotatedPoint(x,Q,V,L));c.setAbsoluteTerminalPoint(this.snapToAnchorPoint(c,f,k,q,x),q)}};mxGraphView.prototype.snapToAnchorPoint=+function(c,f,k,q,x){if(null!=f&&null!=c){c=this.graph.getAllConnectionConstraints(f);q=k=null;if(null!=c)for(var C=0;C<c.length;C++){var E=this.graph.getConnectionPoint(f,c[C]);if(null!=E){var L=(E.x-x.x)*(E.x-x.x)+(E.y-x.y)*(E.y-x.y);if(null==q||L<q)k=E,q=L}}null!=k&&(x=k)}return x};var O=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(c,f,k){var q=O.apply(this,arguments);"1"==c.getAttribute("placeholders")&&null!=k.state&&(q=k.state.view.graph.replacePlaceholders(k.state.cell,q));return q};var U=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(c){if(null!=c.style&&"undefined"!==typeof pako){var f=mxUtils.getValue(c.style,mxConstants.STYLE_SHAPE,null);if(null!=f&&"string"===typeof f&&"stencil("==f.substring(0,8))try{var k=f.substring(8,f.length-1),q=mxUtils.parseXml(Graph.decompress(k));return new mxShape(new mxStencil(q.documentElement))}catch(x){null!=window.console&&console.log("Error in shape: "+x)}}return U.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];mxStencilRegistry.filesLoaded={};mxStencilRegistry.isFileLoaded=function(b){return!mxClient.IS_FF&&mxStencilRegistry.filesLoaded[b]};mxStencilRegistry.setFileLoaded=function(b){mxStencilRegistry.filesLoaded[b]=!0};-mxStencilRegistry.getStencil=function(b){var d=mxStencilRegistry.stencils[b];if(null==d&&null==mxCellRenderer.defaultShapes[b]&&mxStencilRegistry.dynamicLoading){var m=mxStencilRegistry.getBasenameForStencil(b);if(null!=m){d=mxStencilRegistry.libraries[m];if(null!=d){if(null==mxStencilRegistry.packages[m]){for(var p=0;p<d.length;p++){var v=d[p];if(!mxStencilRegistry.isFileLoaded(v))if(mxStencilRegistry.setFileLoaded(v),".xml"==v.toLowerCase().substring(v.length-4,v.length))mxStencilRegistry.loadStencilSet(v,-null);else if(".js"==v.toLowerCase().substring(v.length-3,v.length))try{if(mxStencilRegistry.allowEval){var n=mxUtils.load(v);null!=n&&200<=n.getStatus()&&299>=n.getStatus()&&eval.call(window,n.getText())}}catch(y){null!=window.console&&console.log("error in getStencil:",b,m,d,v,y)}}mxStencilRegistry.packages[m]=1}}else m=m.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+m+".xml",null);d=mxStencilRegistry.stencils[b]}}return d};+mxStencilRegistry.getStencil=function(b){var d=mxStencilRegistry.stencils[b];if(null==d&&null==mxCellRenderer.defaultShapes[b]&&mxStencilRegistry.dynamicLoading){var m=mxStencilRegistry.getBasenameForStencil(b);if(null!=m){d=mxStencilRegistry.libraries[m];if(null!=d){if(null==mxStencilRegistry.packages[m]){for(var p=0;p<d.length;p++){var u=d[p];if(!mxStencilRegistry.isFileLoaded(u))if(mxStencilRegistry.setFileLoaded(u),".xml"==u.toLowerCase().substring(u.length-4,u.length))mxStencilRegistry.loadStencilSet(u,+null);else if(".js"==u.toLowerCase().substring(u.length-3,u.length))try{if(mxStencilRegistry.allowEval){var n=mxUtils.load(u);null!=n&&200<=n.getStatus()&&299>=n.getStatus()&&eval.call(window,n.getText())}}catch(y){null!=window.console&&console.log("error in getStencil:",b,m,d,u,y)}}mxStencilRegistry.packages[m]=1}}else m=m.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+m+".xml",null);d=mxStencilRegistry.stencils[b]}}return d};mxStencilRegistry.getBasenameForStencil=function(b){var d=null;if(null!=b&&"string"===typeof b&&(b=b.split("."),0<b.length&&"mxgraph"==b[0])){d=b[1];for(var m=2;m<b.length-1;m++)d+="/"+b[m]}return d};-mxStencilRegistry.loadStencilSet=function(b,d,m,p){var v=mxStencilRegistry.packages[b];if(null!=m&&m||null==v){var n=!1;if(null==v)try{if(p){mxStencilRegistry.loadStencil(b,mxUtils.bind(this,function(y){null!=y&&null!=y.documentElement&&(mxStencilRegistry.packages[b]=y,n=!0,mxStencilRegistry.parseStencilSet(y.documentElement,d,n))}));return}v=mxStencilRegistry.loadStencil(b);mxStencilRegistry.packages[b]=v;n=!0}catch(y){null!=window.console&&console.log("error in loadStencilSet:",b,y)}null!=v&&null!=-v.documentElement&&mxStencilRegistry.parseStencilSet(v.documentElement,d,n)}};mxStencilRegistry.loadStencil=function(b,d){if(null!=d)mxUtils.get(b,mxUtils.bind(this,function(m){d(200<=m.getStatus()&&299>=m.getStatus()?m.getXml():null)}),mxUtils.bind(this,function(m){d(null)}));else return mxUtils.load(b).getXml()};mxStencilRegistry.parseStencilSets=function(b){for(var d=0;d<b.length;d++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(b[d]).documentElement)};-mxStencilRegistry.parseStencilSet=function(b,d,m){if("stencils"==b.nodeName)for(var p=b.firstChild;null!=p;)"shapes"==p.nodeName&&mxStencilRegistry.parseStencilSet(p,d,m),p=p.nextSibling;else{m=null!=m?m:!0;p=b.firstChild;var v="";b=b.getAttribute("name");for(null!=b&&(v=b+".");null!=p;){if(p.nodeType==mxConstants.NODETYPE_ELEMENT&&(b=p.getAttribute("name"),null!=b)){v=v.toLowerCase();var n=b.replace(/ /g,"_");m&&mxStencilRegistry.addStencil(v+n.toLowerCase(),new mxStencil(p));if(null!=d){var y=p.getAttribute("w"),-C=p.getAttribute("h");y=null==y?80:parseInt(y,10);C=null==C?80:parseInt(C,10);d(v,n,b,y,C)}}p=p.nextSibling}}};+mxStencilRegistry.loadStencilSet=function(b,d,m,p){var u=mxStencilRegistry.packages[b];if(null!=m&&m||null==u){var n=!1;if(null==u)try{if(p){mxStencilRegistry.loadStencil(b,mxUtils.bind(this,function(y){null!=y&&null!=y.documentElement&&(mxStencilRegistry.packages[b]=y,n=!0,mxStencilRegistry.parseStencilSet(y.documentElement,d,n))}));return}u=mxStencilRegistry.loadStencil(b);mxStencilRegistry.packages[b]=u;n=!0}catch(y){null!=window.console&&console.log("error in loadStencilSet:",b,y)}null!=u&&null!=+u.documentElement&&mxStencilRegistry.parseStencilSet(u.documentElement,d,n)}};mxStencilRegistry.loadStencil=function(b,d){if(null!=d)mxUtils.get(b,mxUtils.bind(this,function(m){d(200<=m.getStatus()&&299>=m.getStatus()?m.getXml():null)}),mxUtils.bind(this,function(m){d(null)}));else return mxUtils.load(b).getXml()};mxStencilRegistry.parseStencilSets=function(b){for(var d=0;d<b.length;d++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(b[d]).documentElement)};+mxStencilRegistry.parseStencilSet=function(b,d,m){if("stencils"==b.nodeName)for(var p=b.firstChild;null!=p;)"shapes"==p.nodeName&&mxStencilRegistry.parseStencilSet(p,d,m),p=p.nextSibling;else{m=null!=m?m:!0;p=b.firstChild;var u="";b=b.getAttribute("name");for(null!=b&&(u=b+".");null!=p;){if(p.nodeType==mxConstants.NODETYPE_ELEMENT&&(b=p.getAttribute("name"),null!=b)){u=u.toLowerCase();var n=b.replace(/ /g,"_");m&&mxStencilRegistry.addStencil(u+n.toLowerCase(),new mxStencil(p));if(null!=d){var y=p.getAttribute("w"),+B=p.getAttribute("h");y=null==y?80:parseInt(y,10);B=null==B?80:parseInt(B,10);d(u,n,b,y,B)}}p=p.nextSibling}}};"undefined"!==typeof mxVertexHandler&&function(){function b(){var D=document.createElement("div");D.className="geHint";D.style.whiteSpace="nowrap";D.style.position="absolute";return D}function d(D,M){switch(M){case mxConstants.POINTS:return D;case mxConstants.MILLIMETERS:return Math.round(1E3*D/mxConstants.PIXELS_PER_MM)/1E3;case mxConstants.METERS:return(D/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(D/mxConstants.PIXELS_PER_INCH).toFixed(3)}}mxConstants.HANDLE_FILLCOLOR="#29b6f2";mxConstants.HANDLE_STROKECOLOR="#0088cf";mxConstants.VERTEX_SELECTION_COLOR="#00a8ff";mxConstants.OUTLINE_COLOR="#00a8ff";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.EDGE_SELECTION_COLOR="#00a8ff";mxConstants.DEFAULT_VALID_COLOR="#00a8ff";mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff";mxConstants.GUIDE_COLOR="#0088cf";mxConstants.HIGHLIGHT_STROKEWIDTH=5;mxConstants.HIGHLIGHT_OPACITY=50;mxConstants.HIGHLIGHT_SIZE=5;mxWindow.prototype.closeImage=Graph.createSvgImage(18,10,'<path d="M 5 1 L 13 9 M 13 1 L 5 9" stroke="#707070" stroke-width="2"/>').src;mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'<path d="M 3 7 L 7 3 L 11 7" stroke="#707070" stroke-width="2" fill="none"/>').src;mxWindow.prototype.normalizeImage=Graph.createSvgImage(14,10,'<path d="M 3 3 L 7 7 L 11 3" stroke="#707070" stroke-width="2" fill="none"/>').src;mxWindow.prototype.resizeImage=Graph.createSvgImage(10,10,'<path d="Z" stroke="#C0C0C0" stroke-width="1" fill="none"/>').src;mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxGraphHandler.prototype.removeEmptyParents=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(D){return!mxEvent.isAltDown(D)||mxEvent.isShiftDown(D)};var m=mxGraphLayout.prototype.isVertexIgnored;mxGraphLayout.prototype.isVertexIgnored=function(D){return m.apply(this,arguments)||this.graph.isTableRow(D)||this.graph.isTableCell(D)};-var p=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored=function(D){return p.apply(this,arguments)||this.graph.isEdgeIgnored(D)};var v=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(D){return this.graph.isCloneEvent(D)!=v.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var D=new mxEllipse(null,this.highlightColor,this.highlightColor,0);D.opacity=mxConstants.HIGHLIGHT_OPACITY;return D};+var p=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored=function(D){return p.apply(this,arguments)||this.graph.isEdgeIgnored(D)};var u=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(D){return this.graph.isCloneEvent(D)!=u.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var D=new mxEllipse(null,this.highlightColor,this.highlightColor,0);D.opacity=mxConstants.HIGHLIGHT_OPACITY;return D};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor="crosshair";mxConnectionHandler.prototype.createEdgeState=function(D){D=this.graph.createCurrentEdgeStyle();D=this.graph.createEdge(null,null,null,null,null,D);D=new mxCellState(this.graph.view,D,this.graph.getCellStyle(D));for(var M in this.graph.currentEdgeStyle)D.style[M]=this.graph.currentEdgeStyle[M];if(null!=this.previous){var N=this.previous.style.newEdgeStyle;if(null!=N)try{var W=Graph.decodeNewEdgeStyle(N);for(M in W)D.style[M]=W[M]}catch(ca){}}D.style=this.graph.postProcessCellStyle(D.cell,D.style);return D};var n=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var D=n.apply(this,arguments);D.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return D};mxConnectionHandler.prototype.updatePreview=function(D){};var y=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var D=y.apply(this,arguments),M=D.getCell;D.getCell=mxUtils.bind(this,function(N){var W=M.apply(this,arguments);this.error=null;return W});return D};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){for(var D="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";",M="shape curved rounded comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification comicStyle jumpStyle jumpSize libavoidRouting".split(" "),N=0;N<M.length;N++)null!=this.currentEdgeStyle[M[N]]&&(D+=M[N]+"="+this.currentEdgeStyle[M[N]]+";");null!=this.currentEdgeStyle.orthogonalLoop?D+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(D+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?D+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(D+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(D+="elbow="+this.currentEdgeStyle.elbow+";");return D=null!=this.currentEdgeStyle.html?D+("html="+this.currentEdgeStyle.html+";"):D+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var D=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=D&&(new mxCodec(D.ownerDocument)).decode(D,this.getStylesheet())};Graph.prototype.createCellLookup=function(D,M){M=null!=M?M:{};for(var N=0;N<D.length;N++){var W=D[N];M[mxObjectIdentity.get(W)]=W.getId();for(var ca=this.model.getChildCount(W),ma=0;ma<ca;ma++)this.createCellLookup([this.model.getChildAt(W,ma)],M)}return M};Graph.prototype.createCellMapping=function(D,M,N){N=null!=N?N:{};for(var W in D){var ca=M[W];null==N[ca]&&(N[ca]=D[W].getId()||"")}return N};Graph.prototype.importGraphModel=function(D,-M,N,W){M=null!=M?M:0;N=null!=N?N:0;var ca=new mxCodec(D.ownerDocument),ma=new mxGraphModel;ca.decode(D,ma);D=[];ca={};var pa={},ua=ma.getChildren(this.cloneCell(ma.root,this.isCloneInvalidEdges(),ca));if(null!=ua){var Aa=this.createCellLookup([ma.root]);ua=ua.slice();this.model.beginUpdate();try{if(1!=ua.length||this.isCellLocked(this.getDefaultParent()))for(ma=0;ma<ua.length;ma++)xa=this.model.getChildren(this.moveCells([ua[ma]],M,N,!1,this.model.getRoot())[0]),null!=xa&&(D=D.concat(xa));else{var xa=-ma.getChildren(ua[0]);null!=xa&&(D=this.moveCells(xa,M,N,!1,this.getDefaultParent()),pa[ma.getChildAt(ma.root,0).getId()]=this.getDefaultParent().getId())}if(null!=D&&(this.createCellMapping(ca,Aa,pa),this.updateCustomLinks(pa,D),W)){this.isGridEnabled()&&(M=this.snap(M),N=this.snap(N));var Ma=this.getBoundingBoxFromGeometry(D,!0);null!=Ma&&this.moveCells(D,M-Ma.x,N-Ma.y)}}finally{this.model.endUpdate()}}return D};Graph.prototype.encodeCells=function(D){for(var M={},N=this.cloneCells(D,null,M),W=-new mxDictionary,ca=0;ca<D.length;ca++)W.put(D[ca],!0);var ma=new mxCodec,pa=new mxGraphModel,ua=pa.getChildAt(pa.getRoot(),0);for(ca=0;ca<N.length;ca++){pa.add(ua,N[ca]);var Aa=this.view.getState(D[ca]);if(null!=Aa){var xa=this.getCellGeometry(N[ca]);null!=xa&&xa.relative&&!this.model.isEdge(D[ca])&&null==W.get(this.model.getParent(D[ca]))&&(xa.offset=null,xa.relative=!1,xa.x=Aa.x/Aa.view.scale-Aa.view.translate.x,xa.y=Aa.y/Aa.view.scale-Aa.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(M,-this.createCellLookup(D)),N);return ma.encode(pa)};Graph.prototype.isSwimlane=function(D,M){var N=null;null==D||this.model.isEdge(D)||this.model.getParent(D)==this.model.getRoot()||(N=this.getCurrentCellStyle(D,M)[mxConstants.STYLE_SHAPE]);return N==mxConstants.SHAPE_SWIMLANE||"table"==N||"tableRow"==N};var C=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(D){return null!=D&&C.apply(this,arguments)?this.isTableCell(D)||this.isTableRow(D)?this.isCellEditable(this.model.getParent(D)):+M,N,W){M=null!=M?M:0;N=null!=N?N:0;var ca=new mxCodec(D.ownerDocument),ma=new mxGraphModel;ca.decode(D,ma);D=[];ca={};var pa={},va=ma.getChildren(this.cloneCell(ma.root,this.isCloneInvalidEdges(),ca));if(null!=va){var Aa=this.createCellLookup([ma.root]);va=va.slice();this.model.beginUpdate();try{if(1!=va.length||this.isCellLocked(this.getDefaultParent()))for(ma=0;ma<va.length;ma++)xa=this.model.getChildren(this.moveCells([va[ma]],M,N,!1,this.model.getRoot())[0]),null!=xa&&(D=D.concat(xa));else{var xa=+ma.getChildren(va[0]);null!=xa&&(D=this.moveCells(xa,M,N,!1,this.getDefaultParent()),pa[ma.getChildAt(ma.root,0).getId()]=this.getDefaultParent().getId())}if(null!=D&&(this.createCellMapping(ca,Aa,pa),this.updateCustomLinks(pa,D),W)){this.isGridEnabled()&&(M=this.snap(M),N=this.snap(N));var Ma=this.getBoundingBoxFromGeometry(D,!0);null!=Ma&&this.moveCells(D,M-Ma.x,N-Ma.y)}}finally{this.model.endUpdate()}}return D};Graph.prototype.encodeCells=function(D){for(var M={},N=this.cloneCells(D,null,M),W=+new mxDictionary,ca=0;ca<D.length;ca++)W.put(D[ca],!0);var ma=new mxCodec,pa=new mxGraphModel,va=pa.getChildAt(pa.getRoot(),0);for(ca=0;ca<N.length;ca++){pa.add(va,N[ca]);var Aa=this.view.getState(D[ca]);if(null!=Aa){var xa=this.getCellGeometry(N[ca]);null!=xa&&xa.relative&&!this.model.isEdge(D[ca])&&null==W.get(this.model.getParent(D[ca]))&&(xa.offset=null,xa.relative=!1,xa.x=Aa.x/Aa.view.scale-Aa.view.translate.x,xa.y=Aa.y/Aa.view.scale-Aa.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(M,+this.createCellLookup(D)),N);return ma.encode(pa)};Graph.prototype.isSwimlane=function(D,M){var N=null;null==D||this.model.isEdge(D)||this.model.getParent(D)==this.model.getRoot()||(N=this.getCurrentCellStyle(D,M)[mxConstants.STYLE_SHAPE]);return N==mxConstants.SHAPE_SWIMLANE||"table"==N||"tableRow"==N};var B=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(D){return null!=D&&B.apply(this,arguments)?this.isTableCell(D)||this.isTableRow(D)?this.isCellEditable(this.model.getParent(D)):!0:!1};var P=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=function(D){return null!=D&&P.apply(this,arguments)?this.isTableCell(D)||this.isTableRow(D)?this.isCellMovable(this.model.getParent(D)):!0:!1};var G=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(D){var M=this.model.getParent(D);if(null!=M){var N=this.getCurrentCellStyle(M);if(null!=N.expand)return"0"!=N.expand}return G.apply(this,arguments)&&(null==M||!this.isTable(M))};var O=Graph.prototype.isContractParent;-Graph.prototype.isContractParent=function(D){var M=this.model.getParent(D);if(null!=M){var N=this.getCurrentCellStyle(M);if(null!=N.contract)return"0"!=N.contract}return O.apply(this,arguments)&&(null==M||!this.isTable(M))};var U=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(D,M,N,W,ca,ma,pa,ua){null==ua&&(ua=this.model.getParent(D),this.isTable(ua)||this.isTableRow(ua))&&(ua=this.getCellAt(ma,pa,null,!0,!1));N=null;this.model.beginUpdate();try{var Aa=this.getCellGeometry(D);if(null!=-Aa&&null!=Aa.points&&0<Aa.points.length&&1==M.length&&this.model.isVertex(M[0])){var xa=this.getCellGeometry(M[0]);if(null!=xa&&!xa.relative){var Ma=new mxRectangle(xa.x+W,xa.y+ca,xa.width,xa.height),Wa=Aa.points;xa=[];for(var Za=0;Za<Wa.length;Za++)Ma.intersectsPoint(Wa[Za].x,Wa[Za].y)||xa.push(Wa[Za]);xa.length<Wa.length&&(Aa=Aa.clone(),Aa.points=xa,this.model.setGeometry(D,Aa))}}N=U.apply(this,[D,M,N,W,ca,ma,pa,ua]);this.model.setValue(N,"");var pb=this.getChildCells(N,!0);for(Za=0;Za<pb.length;Za++)Aa=+Graph.prototype.isContractParent=function(D){var M=this.model.getParent(D);if(null!=M){var N=this.getCurrentCellStyle(M);if(null!=N.contract)return"0"!=N.contract}return O.apply(this,arguments)&&(null==M||!this.isTable(M))};var U=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(D,M,N,W,ca,ma,pa,va){null==va&&(va=this.model.getParent(D),this.isTable(va)||this.isTableRow(va))&&(va=this.getCellAt(ma,pa,null,!0,!1));N=null;this.model.beginUpdate();try{var Aa=this.getCellGeometry(D);if(null!=+Aa&&null!=Aa.points&&0<Aa.points.length&&1==M.length&&this.model.isVertex(M[0])){var xa=this.getCellGeometry(M[0]);if(null!=xa&&!xa.relative){var Ma=new mxRectangle(xa.x+W,xa.y+ca,xa.width,xa.height),Wa=Aa.points;xa=[];for(var Za=0;Za<Wa.length;Za++)Ma.intersectsPoint(Wa[Za].x,Wa[Za].y)||xa.push(Wa[Za]);xa.length<Wa.length&&(Aa=Aa.clone(),Aa.points=xa,this.model.setGeometry(D,Aa))}}N=U.apply(this,[D,M,N,W,ca,ma,pa,va]);this.model.setValue(N,"");var pb=this.getChildCells(N,!0);for(Za=0;Za<pb.length;Za++)Aa=this.getCellGeometry(pb[Za]),null!=Aa&&Aa.relative&&0<Aa.x&&this.model.remove(pb[Za]);var rb=this.getChildCells(D,!0);for(Za=0;Za<rb.length;Za++)Aa=this.getCellGeometry(rb[Za]),null!=Aa&&Aa.relative&&0>=Aa.x&&this.model.remove(rb[Za]);var tb=this.model.getTerminal(N,!1);if(null!=tb){var ob=this.getCurrentCellStyle(tb);null!=ob&&"1"==ob.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[D]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[D]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,-null,[N]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[N]))}}finally{this.model.endUpdate()}return N};var c=Graph.prototype.selectCell;Graph.prototype.selectCell=function(D,M,N){if(M||N)c.apply(this,arguments);else{var W=this.getSelectionCell(),ca=null,ma=[],pa=mxUtils.bind(this,function(ua){if(null!=this.view.getState(ua)&&(this.model.isVertex(ua)||this.model.isEdge(ua)))if(ma.push(ua),ua==W)ca=ma.length-1;else if(D&&null==W&&0<ma.length||null!=ca&&D&&ma.length>ca||!D&&0<ca)return;for(var Aa=-0;Aa<this.model.getChildCount(ua);Aa++)pa(this.model.getChildAt(ua,Aa))});pa(this.model.root);0<ma.length&&(ca=null!=ca?mxUtils.mod(ca+(D?1:-1),ma.length):0,this.setSelectionCell(ma[ca]))}};Graph.prototype.swapShapes=function(D,M){if(this.model.isVertex(D)&&this.model.isVertex(M)&&2==this.getMovableCells([D,M]).length){var N=this.getCellGeometry(D),W=this.getCellGeometry(M);if(null!=N&&null!=W){var ca=N.clone(),ma=W.clone();this.model.beginUpdate();try{ca.x=W.getCenterX()-N.width/2,ca.y=W.getCenterY()--N.height/2,ma.x=N.getCenterX()-W.width/2,ma.y=N.getCenterY()-W.height/2,this.model.setGeometry(D,ca),this.model.setGeometry(M,ma)}finally{this.model.endUpdate()}}}};var f=Graph.prototype.moveCells;Graph.prototype.moveCells=function(D,M,N,W,ca,ma,pa){pa=null!=pa?pa:{};if(this.isTable(ca)){for(var ua=[],Aa=0;Aa<D.length;Aa++)this.isTable(D[Aa])?ua=ua.concat(this.model.getChildCells(D[Aa],!0).reverse()):ua.push(D[Aa]);D=ua}this.model.beginUpdate();try{ua=[];for(Aa=0;Aa<D.length;Aa++)if(null!=ca&&this.isTableRow(D[Aa])){var xa=-this.model.getParent(D[Aa]),Ma=this.getCellGeometry(D[Aa]);this.isTable(xa)&&ua.push(xa);if(null!=xa&&null!=Ma&&this.isTable(xa)&&this.isTable(ca)&&(W||xa!=ca)){if(!W){var Wa=this.getCellGeometry(xa);null!=Wa&&(Wa=Wa.clone(),Wa.height-=Ma.height,this.model.setGeometry(xa,Wa))}Wa=this.getCellGeometry(ca);null!=Wa&&(Wa=Wa.clone(),Wa.height+=Ma.height,this.model.setGeometry(ca,Wa));var Za=this.model.getChildCells(ca,!0);if(0<Za.length){D[Aa]=W?this.cloneCell(D[Aa]):D[Aa];var pb=this.model.getChildCells(D[Aa],+null,[N]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[N]))}}finally{this.model.endUpdate()}return N};var c=Graph.prototype.selectCell;Graph.prototype.selectCell=function(D,M,N){if(M||N)c.apply(this,arguments);else{var W=this.getSelectionCell(),ca=null,ma=[],pa=mxUtils.bind(this,function(va){if(null!=this.view.getState(va)&&(this.model.isVertex(va)||this.model.isEdge(va)))if(ma.push(va),va==W)ca=ma.length-1;else if(D&&null==W&&0<ma.length||null!=ca&&D&&ma.length>ca||!D&&0<ca)return;for(var Aa=+0;Aa<this.model.getChildCount(va);Aa++)pa(this.model.getChildAt(va,Aa))});pa(this.model.root);0<ma.length&&(ca=null!=ca?mxUtils.mod(ca+(D?1:-1),ma.length):0,this.setSelectionCell(ma[ca]))}};Graph.prototype.swapShapes=function(D,M){if(this.model.isVertex(D)&&this.model.isVertex(M)&&2==this.getMovableCells([D,M]).length){var N=this.getCellGeometry(D),W=this.getCellGeometry(M);if(null!=N&&null!=W){var ca=N.clone(),ma=W.clone();this.model.beginUpdate();try{ca.x=W.getCenterX()-N.width/2,ca.y=W.getCenterY()-+N.height/2,ma.x=N.getCenterX()-W.width/2,ma.y=N.getCenterY()-W.height/2,this.model.setGeometry(D,ca),this.model.setGeometry(M,ma)}finally{this.model.endUpdate()}}}};var f=Graph.prototype.moveCells;Graph.prototype.moveCells=function(D,M,N,W,ca,ma,pa){pa=null!=pa?pa:{};if(this.isTable(ca)){for(var va=[],Aa=0;Aa<D.length;Aa++)this.isTable(D[Aa])?va=va.concat(this.model.getChildCells(D[Aa],!0).reverse()):va.push(D[Aa]);D=va}this.model.beginUpdate();try{va=[];for(Aa=0;Aa<D.length;Aa++)if(null!=ca&&this.isTableRow(D[Aa])){var xa=+this.model.getParent(D[Aa]),Ma=this.getCellGeometry(D[Aa]);this.isTable(xa)&&va.push(xa);if(null!=xa&&null!=Ma&&this.isTable(xa)&&this.isTable(ca)&&(W||xa!=ca)){if(!W){var Wa=this.getCellGeometry(xa);null!=Wa&&(Wa=Wa.clone(),Wa.height-=Ma.height,this.model.setGeometry(xa,Wa))}Wa=this.getCellGeometry(ca);null!=Wa&&(Wa=Wa.clone(),Wa.height+=Ma.height,this.model.setGeometry(ca,Wa));var Za=this.model.getChildCells(ca,!0);if(0<Za.length){D[Aa]=W?this.cloneCell(D[Aa]):D[Aa];var pb=this.model.getChildCells(D[Aa],!0),rb=this.model.getChildCells(Za[0],!0),tb=rb.length-pb.length;if(0<tb)for(var ob=0;ob<tb;ob++){var cb=this.cloneCell(pb[pb.length-1]);null!=cb&&(cb.value="",this.model.add(D[Aa],cb))}else if(0>tb)for(ob=0;ob>tb;ob--)this.model.remove(pb[pb.length+ob-1]);pb=this.model.getChildCells(D[Aa],!0);for(ob=0;ob<rb.length;ob++){var fb=this.getCellGeometry(rb[ob]),Xa=this.getCellGeometry(pb[ob]);null!=fb&&null!=Xa&&(Xa=Xa.clone(),Xa.width=fb.width,this.model.setGeometry(pb[ob],Xa))}}}}var wb=f.apply(this,-arguments);for(Aa=0;Aa<ua.length;Aa++)!W&&this.model.contains(ua[Aa])&&0==this.model.getChildCount(ua[Aa])&&this.model.remove(ua[Aa]);W&&this.updateCustomLinks(this.createCellMapping(pa,this.createCellLookup(D)),wb)}finally{this.model.endUpdate()}return wb};var k=Graph.prototype.removeCells;Graph.prototype.removeCells=function(D,M){var N=[];this.model.beginUpdate();try{for(var W=0;W<D.length;W++)if(this.isTableCell(D[W])){var ca=this.model.getParent(D[W]),ma=this.model.getParent(ca);1==this.model.getChildCount(ca)&&-1==this.model.getChildCount(ma)?0>mxUtils.indexOf(D,ma)&&0>mxUtils.indexOf(N,ma)&&N.push(ma):this.labelChanged(D[W],"")}else{if(this.isTableRow(D[W])&&(ma=this.model.getParent(D[W]),0>mxUtils.indexOf(D,ma)&&0>mxUtils.indexOf(N,ma))){for(var pa=this.model.getChildCells(ma,!0),ua=0,Aa=0;Aa<pa.length;Aa++)0<=mxUtils.indexOf(D,pa[Aa])&&ua++;ua==pa.length&&N.push(ma)}N.push(D[W])}N=k.apply(this,[N,M])}finally{this.model.endUpdate()}return N};Graph.prototype.updateCustomLinks=function(D,M,N){N=null!=N?+arguments);for(Aa=0;Aa<va.length;Aa++)!W&&this.model.contains(va[Aa])&&0==this.model.getChildCount(va[Aa])&&this.model.remove(va[Aa]);W&&this.updateCustomLinks(this.createCellMapping(pa,this.createCellLookup(D)),wb)}finally{this.model.endUpdate()}return wb};var k=Graph.prototype.removeCells;Graph.prototype.removeCells=function(D,M){var N=[];this.model.beginUpdate();try{for(var W=0;W<D.length;W++)if(this.isTableCell(D[W])){var ca=this.model.getParent(D[W]),ma=this.model.getParent(ca);1==this.model.getChildCount(ca)&&+1==this.model.getChildCount(ma)?0>mxUtils.indexOf(D,ma)&&0>mxUtils.indexOf(N,ma)&&N.push(ma):this.labelChanged(D[W],"")}else{if(this.isTableRow(D[W])&&(ma=this.model.getParent(D[W]),0>mxUtils.indexOf(D,ma)&&0>mxUtils.indexOf(N,ma))){for(var pa=this.model.getChildCells(ma,!0),va=0,Aa=0;Aa<pa.length;Aa++)0<=mxUtils.indexOf(D,pa[Aa])&&va++;va==pa.length&&N.push(ma)}N.push(D[W])}N=k.apply(this,[N,M])}finally{this.model.endUpdate()}return N};Graph.prototype.updateCustomLinks=function(D,M,N){N=null!=N?N:new Graph;for(var W=0;W<M.length;W++)null!=M[W]&&N.updateCustomLinksForCell(D,M[W],N)};Graph.prototype.updateCustomLinksForCell=function(D,M){this.doUpdateCustomLinksForCell(D,M);for(var N=this.model.getChildCount(M),W=0;W<N;W++)this.updateCustomLinksForCell(D,this.model.getChildAt(M,W))};Graph.prototype.doUpdateCustomLinksForCell=function(D,M){};Graph.prototype.getAllConnectionConstraints=function(D,M){if(null!=D){M=mxUtils.getValue(D.style,"points",null);if(null!=M){D=[];try{var N=JSON.parse(M);for(M=0;M<N.length;M++){var W=N[M];D.push(new mxConnectionConstraint(new mxPoint(W[0],W[1]),2<W.length?"0"!=W[2]:!0,null,3<W.length?W[3]:0,4<W.length?W[4]:0))}}catch(ma){}return D}if(null!=D.shape&&null!=D.shape.bounds){W=D.shape.direction;M=D.shape.bounds;var ca=D.shape.scale;N=M.width/ca;M=M.height/ca;if(W==mxConstants.DIRECTION_NORTH||W==mxConstants.DIRECTION_SOUTH)W=N,N=M,M=W;M=D.shape.getConstraints(D.style,N,M);if(null!=M)return M;if(null!=D.shape.stencil&&null!=D.shape.stencil.constraints)return D.shape.stencil.constraints;if(null!=D.shape.constraints)return D.shape.constraints}}return null};Graph.prototype.flipEdge=function(D){if(null!=D){var M=this.getCurrentCellStyle(D);M=mxUtils.getValue(M,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,M,[D])}};var q=Graph.prototype.resetEdge;Graph.prototype.resetEdge=function(D){null!=D&&this.setCellStyles("innerLoopWaypoints",null,[D]);return q.apply(this,-arguments)};var x=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(D,M){if(null!=D){var N=D.getVisibleTerminalState(!0),W=D.getVisibleTerminalState(!1);if(null!=N&&N==W){N=this.createEdgeSegmentHandler(D);var ca=N.changePoints,ma=N.getPreviewPoints,pa=N.updatePreviewState,ua=N.clonePreviewState;N.getPreviewPoints=function(xa){if(!this.isSource&&!this.isTarget){var Ma=this.getCurrentPoints();return null!=Ma&&4==Ma.length&&1<this.index&&this.index<Ma.length-1&&(Ma=this.graph.getLoopAroundPoints(this.state,-xa),null!=Ma)?this.graph.keepLoopOutsideShape(this.state,Ma):this.graph.keepLoopOutsideShape(this.state,ma.apply(this,arguments))}return ma.apply(this,arguments)};N.clonePreviewState=function(xa,Ma){var Wa=ua.apply(this,arguments);this.isSource||this.isTarget||null==Wa||null==Wa.style||(Wa.style[mxConstants.STYLE_EDGE]="orthogonalEdgeStyle",Wa.style.innerLoopWaypoints="1");return Wa};N.changePoints=function(xa,Ma,Wa){Ma=this.graph.keepLoopOutsideShape(this.state,Ma);var Za=this.graph.getModel();Za.beginUpdate();+arguments)};var x=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(D,M){if(null!=D){var N=D.getVisibleTerminalState(!0),W=D.getVisibleTerminalState(!1);if(null!=N&&N==W){N=this.createEdgeSegmentHandler(D);var ca=N.changePoints,ma=N.getPreviewPoints,pa=N.updatePreviewState,va=N.clonePreviewState;N.getPreviewPoints=function(xa){if(!this.isSource&&!this.isTarget){var Ma=this.getCurrentPoints();return null!=Ma&&4==Ma.length&&1<this.index&&this.index<Ma.length-1&&(Ma=this.graph.getLoopAroundPoints(this.state,+xa),null!=Ma)?this.graph.keepLoopOutsideShape(this.state,Ma):this.graph.keepLoopOutsideShape(this.state,ma.apply(this,arguments))}return ma.apply(this,arguments)};N.clonePreviewState=function(xa,Ma){var Wa=va.apply(this,arguments);this.isSource||this.isTarget||null==Wa||null==Wa.style||(Wa.style[mxConstants.STYLE_EDGE]="orthogonalEdgeStyle",Wa.style.innerLoopWaypoints="1");return Wa};N.changePoints=function(xa,Ma,Wa){Ma=this.graph.keepLoopOutsideShape(this.state,Ma);var Za=this.graph.getModel();Za.beginUpdate();try{xa=ca.call(this,xa,Ma,Wa),null!=xa&&null!=Ma&&2<=Ma.length&&(this.graph.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[xa]),this.graph.setCellStyles("innerLoopWaypoints","1",[xa]))}finally{Za.endUpdate()}return xa};var Aa=N.start;N.start=function(xa,Ma,Wa){this.validLoopPoints=null;Aa.apply(this,arguments)};N.rerouteLoopPreview=function(xa){var Ma=this.state.getVisibleTerminalState(!0),Wa=this.state.getVisibleTerminalState(!1);xa.view.updateFixedTerminalPoints(xa,Ma,Wa);xa.view.updatePoints(xa,this.points,Ma,Wa);xa.view.updateFloatingTerminalPoints(xa,Ma,Wa)};N.getCommittedLoopPoints=function(){var xa=this.graph.getCellGeometry(this.state.cell);if(null!=xa&&null!=xa.points&&2<=xa.points.length)return xa.points.map(function(tb){return new mxPoint(tb.x,tb.y)});xa=this.state.absolutePoints;if(null!=xa&&4<=xa.length){for(var Ma=this.state.view.scale,Wa=this.state.view.translate,Za=this.state.origin,pb=[],rb=1;rb<xa.length-1;rb++)null!=xa[rb]&&pb.push(new mxPoint(xa[rb].x/Ma-Wa.x-Za.x,xa[rb].y/Ma-Wa.y-Za.y));if(2<=pb.length)return pb}return null};N.isLoopSpike=function(xa){xa=xa.absolutePoints;if(null==xa||2>xa.length||null==xa[0]||null==xa[xa.length-1])return!0;var Ma=this.graph.gridSize*this.state.view.scale/2;return Math.abs(xa[0].x-xa[xa.length-1].x)<Ma&&Math.abs(xa[0].y-xa[xa.length-1].y)<Ma};N.updatePreviewState=function(xa,Ma,Wa,Za,pb){this.isSource||this.isTarget||null!=this.validLoopPoints||(this.validLoopPoints=this.getCommittedLoopPoints());pa.apply(this,arguments);if(!this.isSource&&!this.isTarget){if(null!=this.points&&2==this.points.length&&0==Math.round(this.points[0].x-this.points[1].x)&&0==Math.round(this.points[0].y-this.points[1].y)){var rb=this.graph.getLoopAroundPoints(this.state,Ma);null!=rb&&(this.points=this.graph.keepLoopOutsideShape(this.state,rb),this.rerouteLoopPreview(xa))}this.isLoopSpike(xa)?null!=this.validLoopPoints&&(this.points=this.validLoopPoints.map(function(tb){return new mxPoint(tb.x,tb.y)}),this.rerouteLoopPreview(xa)):null!=this.points&&2<=this.points.length&&(this.validLoopPoints=this.points.map(function(tb){return new mxPoint(tb.x,tb.y)}))}};return N}}return x.apply(this,arguments)};Graph.prototype.isValidRoot=function(D){for(var M=this.model.getChildCount(D),N=0,W=0;W<M;W++){var ca=this.model.getChildAt(D,W);this.model.isVertex(ca)&&(ca=this.getCellGeometry(ca),null==ca||ca.relative||N++)}return 0<N||this.isContainer(D)};Graph.prototype.isValidDropTarget=function(D,M,N){for(var W=this.getCurrentCellStyle(D),ca=!0,ma=!0,pa=0;pa<M.length&&ma;pa++)ca=ca&&this.isTable(M[pa]),ma=ma&&this.isTableRow(M[pa]);return!this.isCellLocked(D)&&null==this.getLockedGroupAncestor(D)&&(this.isTargetShape(D,M,N)||("1"!=mxUtils.getValue(W,"part","0")||this.isContainer(D))&&"0"!=mxUtils.getValue(W,"dropTarget","1")&&(mxGraph.prototype.isValidDropTarget.apply(this,arguments)||this.isContainer(D))&&!this.isTableRow(D)&&(!this.isTable(D)||ma||ca))};Graph.prototype.createGroupCell=function(){var D=mxGraph.prototype.createGroupCell.apply(this,arguments);D.setStyle("group");-return D};var B=Graph.prototype.translateCell;Graph.prototype.translateCell=function(D,M,N){if(this.isTransparentBounds(D))for(var W=this.model.getChildCount(D),ca=0;ca<W;ca++)this.translateCell(this.model.getChildAt(D,ca),M,N);else B.apply(this,arguments)};var E=Graph.prototype.groupCells;Graph.prototype.groupCells=function(D,M,N){if(null!=D&&this.isTransparentBounds(D)){null==N&&(N=mxUtils.sortCells(this.getSelectionCells(),!0));N=this.getCellsForGroup(N);if(0<N.length){var W=this.model.getParent(D);+return D};var C=Graph.prototype.translateCell;Graph.prototype.translateCell=function(D,M,N){if(this.isTransparentBounds(D))for(var W=this.model.getChildCount(D),ca=0;ca<W;ca++)this.translateCell(this.model.getChildAt(D,ca),M,N);else C.apply(this,arguments)};var E=Graph.prototype.groupCells;Graph.prototype.groupCells=function(D,M,N){if(null!=D&&this.isTransparentBounds(D)){null==N&&(N=mxUtils.sortCells(this.getSelectionCells(),!0));N=this.getCellsForGroup(N);if(0<N.length){var W=this.model.getParent(D);null==W&&(W=this.model.getParent(N[0]));this.model.beginUpdate();try{this.model.setGeometry(D,new mxGeometry(0,0,0,0));var ca=this.model.getChildCount(W);this.cellsAdded([D],W,ca,null,null,!1,!1,!1);ca=this.model.getChildCount(D);this.cellsAdded(N,D,ca,null,null,!1,!1,!1);this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",D,"border",M,"cells",N))}finally{this.model.endUpdate()}}return D}return E.apply(this,arguments)};Graph.prototype.isExtendParentsOnAdd=function(D){var M=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(M&&null!=D&&null!=this.layoutManager){var N=this.model.getParent(D);null!=N&&(N=this.layoutManager.getLayout(N),null!=N&&N.constructor==mxStackLayout&&(M=!1))}return M};Graph.prototype.getPreferredSizeForCell=function(D,M,N){N=null!=N?N:this.gridEnabled;var W=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=W&&(W.width+=10,W.height+=4,N&&(W.width=this.snap(W.width),W.height=this.snap(W.height)));return W};Graph.prototype.getAutosizeTextAvailableSpace=function(D,M,N,W){var ca=0,ma=0;(null!=W&&null!=this.getImage(W)||null!=D[mxConstants.STYLE_IMAGE])&&D[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&(D[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(ca+=parseFloat(mxUtils.getValue(D,mxConstants.STYLE_IMAGE_WIDTH,mxLabel.prototype.imageSize))),D[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(ma+=parseFloat(mxUtils.getValue(D,mxConstants.STYLE_IMAGE_HEIGHT,mxLabel.prototype.imageSize))));ca+=2*parseFloat(mxUtils.getValue(D,mxConstants.STYLE_SPACING,2));ca+=parseFloat(mxUtils.getValue(D,mxConstants.STYLE_SPACING_LEFT,2));ca+=parseFloat(mxUtils.getValue(D,mxConstants.STYLE_SPACING_RIGHT,2));ma+=2*parseFloat(mxUtils.getValue(D,mxConstants.STYLE_SPACING,2));ma+=parseFloat(mxUtils.getValue(D,mxConstants.STYLE_SPACING_TOP,2));ma+=parseFloat(mxUtils.getValue(D,mxConstants.STYLE_SPACING_BOTTOM,2));null!=W&&(W=this.getFoldingImage(W),null!=W&&(ca+=W.width+8));D=mxUtils.getValue(D,mxConstants.STYLE_HORIZONTAL,!0);ca=(D?M:N)-ca;M=(D?N:M)-ma;return 0>=-ca||0>=M?null:{availW:ca,availH:M}};Graph.prototype.computeAutosizeTextFontSize=function(D,M,N,W,ca,ma){var pa=1,ua=84,Aa=ma?M:null,xa=null;if(ma){for(var Ma=D.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Wa=[],Za=0;Za<Ma.length;Za++)0<Ma[Za].length&&Wa.push(mxUtils.htmlEntities(Ma[Za],!1));0<Wa.length&&(xa=Wa.join("<br>"))}for(;pa<ua;)Ma=Math.ceil((pa+ua)/2),Wa=mxUtils.getSizeForString(D,Ma,W,Aa,ca),(Wa=ma?Wa.height<=N:Wa.width<=M&&Wa.height<=N)&&ma&&null!=xa&&mxUtils.getSizeForString(xa,-Ma,W,null,ca).width>M&&(Wa=!1),Wa?pa=Ma:ua=Ma-1;return Math.max(6,pa)};Graph.prototype.updateAutosizeTextFontSize=function(D,M){var N=this.view.getState(D);null==N&&(N=this.view.createState(D));M=M||N.style;var W=this.getCellGeometry(D);if(null!=W&&!this.model.isEdge(D)){var ca=this.cellRenderer.getLabelValue(N);null!=ca&&0!=ca.length&&(N=this.getAutosizeTextAvailableSpace(M,W.width,W.height,N),null!=N&&(this.isHtmlLabel(D)||(ca=mxUtils.htmlEntities(ca,!1)),ca=ca.replace(/\n/g,"<br>"),M=this.computeAutosizeTextFontSize(ca,+ca||0>=M?null:{availW:ca,availH:M}};Graph.prototype.computeAutosizeTextFontSize=function(D,M,N,W,ca,ma){var pa=1,va=84,Aa=ma?M:null,xa=null;if(ma){for(var Ma=D.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Wa=[],Za=0;Za<Ma.length;Za++)0<Ma[Za].length&&Wa.push(mxUtils.htmlEntities(Ma[Za],!1));0<Wa.length&&(xa=Wa.join("<br>"))}for(;pa<va;)Ma=Math.ceil((pa+va)/2),Wa=mxUtils.getSizeForString(D,Ma,W,Aa,ca),(Wa=ma?Wa.height<=N:Wa.width<=M&&Wa.height<=N)&&ma&&null!=xa&&mxUtils.getSizeForString(xa,+Ma,W,null,ca).width>M&&(Wa=!1),Wa?pa=Ma:va=Ma-1;return Math.max(6,pa)};Graph.prototype.updateAutosizeTextFontSize=function(D,M){var N=this.view.getState(D);null==N&&(N=this.view.createState(D));M=M||N.style;var W=this.getCellGeometry(D);if(null!=W&&!this.model.isEdge(D)){var ca=this.cellRenderer.getLabelValue(N);null!=ca&&0!=ca.length&&(N=this.getAutosizeTextAvailableSpace(M,W.width,W.height,N),null!=N&&(this.isHtmlLabel(D)||(ca=mxUtils.htmlEntities(ca,!1)),ca=ca.replace(/\n/g,"<br>"),M=this.computeAutosizeTextFontSize(ca,N.availW,N.availH,M[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,M[mxConstants.STYLE_FONTSTYLE],"wrap"==M[mxConstants.STYLE_WHITE_SPACE]),this.setCellStyles(mxConstants.STYLE_FONTSIZE,M,[D])))}};Graph.prototype.cellsResized=function(D,M,N){var W=mxGraph.prototype.cellsResized.apply(this,arguments);if(null!=D)for(var ca=0;ca<D.length;ca++)this.model.isVertex(D[ca])&&this.isAutosizeTextCell(D[ca])&&this.updateAutosizeTextFontSize(D[ca]);return W};Graph.prototype.isRotatableGroup=function(D){var M=this.getModel();return M.isVertex(D)&&0<M.getChildCount(D)&&!this.isTable(D)&&!this.isTableRow(D)&&!this.isTableCell(D)&&!this.isSwimlane(D)};Graph.prototype.setCellRotation=function(D,M){var N=parseFloat(M);!isNaN(N)&&this.isRotatableGroup(D)?this.rotateCell(D,N-(parseFloat(this.getCurrentCellStyle(D)[mxConstants.STYLE_ROTATION])||0)):this.setCellStyles(mxConstants.STYLE_ROTATION,M,[D])};Graph.prototype.rotateCell=function(D,M,N){if(0!=M){var W=this.getModel();if(W.isVertex(D)||W.isEdge(D)){W.beginUpdate();-try{if(!W.isEdge(D)){var ca=(this.getCurrentCellStyle(D)[mxConstants.STYLE_ROTATION]||0)+M;this.setCellStyles(mxConstants.STYLE_ROTATION,ca,[D])}var ma=this.getCellGeometry(D);if(null!=ma){var pa=this.getCellGeometry(N);null==pa||W.isEdge(N)||(ma=ma.clone(),ma.rotate(M,new mxPoint(pa.width/2,pa.height/2)),W.setGeometry(D,ma));if(W.isVertex(D)&&!ma.relative||W.isEdge(D)){var ua=W.getChildCount(D);for(N=0;N<ua;N++)this.rotateCell(W.getChildAt(D,N),M,D)}}}finally{W.endUpdate()}}}};Graph.prototype.isRotatedGroupResize=+try{if(!W.isEdge(D)){var ca=(this.getCurrentCellStyle(D)[mxConstants.STYLE_ROTATION]||0)+M;this.setCellStyles(mxConstants.STYLE_ROTATION,ca,[D])}var ma=this.getCellGeometry(D);if(null!=ma){var pa=this.getCellGeometry(N);null==pa||W.isEdge(N)||(ma=ma.clone(),ma.rotate(M,new mxPoint(pa.width/2,pa.height/2)),W.setGeometry(D,ma));if(W.isVertex(D)&&!ma.relative||W.isEdge(D)){var va=W.getChildCount(D);for(N=0;N<va;N++)this.rotateCell(W.getChildAt(D,N),M,D)}}}finally{W.endUpdate()}}}};Graph.prototype.isRotatedGroupResize=function(D){return this.isRotatableGroup(D)&&0!=mxUtils.mod(parseFloat(this.getCurrentCellStyle(D)[mxConstants.STYLE_ROTATION])||0,360)};var L=Graph.prototype.resizeChildCells;Graph.prototype.resizeChildCells=function(D,M){if(this.isRotatedGroupResize(D)){var N=parseFloat(this.getCurrentCellStyle(D)[mxConstants.STYLE_ROTATION])||0;this.resizeRotatedGroupChildren(D,this.model.getGeometry(D),M,N,N)}else L.apply(this,arguments)};Graph.prototype.resizeRotatedGroupChildren=function(D,M,N,W,ca){var ma=-this.getModel(),pa=0!=M.width?N.width/M.width:1,ua=0!=M.height?N.height/M.height:1,Aa=mxUtils.toRadians(W),xa=Math.cos(-Aa),Ma=Math.sin(-Aa);Aa=mxUtils.toRadians(ca);var Wa=Math.cos(Aa),Za=Math.sin(Aa),pb=M.width/2,rb=M.height/2,tb=N.width/2,ob=N.height/2,cb=function(Db,Lb){var Hb=xa*(Db-pb)-Ma*(Lb-rb);Db=Ma*(Db-pb)+xa*(Lb-rb);Hb*=pa;Db*=ua;return new mxPoint(tb+Wa*Hb-Za*Db,ob+Za*Hb+Wa*Db)};M=function(Db){if(null!=Db)for(var Lb=0;Lb<Db.length;Lb++)if(null!=Db[Lb]){var Hb=cb(Db[Lb].x,Db[Lb].y);Db[Lb].x=-Hb.x;Db[Lb].y=Hb.y}};N=ma.getChildCount(D);for(Aa=0;Aa<N;Aa++){var fb=ma.getChildAt(D,Aa),Xa=this.getCellGeometry(fb);if(null!=Xa)if(ma.isEdge(fb))Xa=Xa.clone(),M([Xa.sourcePoint,Xa.targetPoint]),M(Xa.points),ma.setGeometry(fb,Xa);else if(ma.isVertex(fb)&&!Xa.relative){var wb=this.getCurrentCellStyle(fb),sb=parseFloat(wb[mxConstants.STYLE_ROTATION])||0,qb=mxUtils.toRadians(sb-W),zb=pa*Math.cos(qb),Fb=ua*Math.sin(qb),Jb=Math.sqrt(zb*zb+Fb*Fb);qb=Math.sqrt(pa*pa*Math.sin(qb)*Math.sin(qb)+ua*ua*Math.cos(qb)*+this.getModel(),pa=0!=M.width?N.width/M.width:1,va=0!=M.height?N.height/M.height:1,Aa=mxUtils.toRadians(W),xa=Math.cos(-Aa),Ma=Math.sin(-Aa);Aa=mxUtils.toRadians(ca);var Wa=Math.cos(Aa),Za=Math.sin(Aa),pb=M.width/2,rb=M.height/2,tb=N.width/2,ob=N.height/2,cb=function(Db,Lb){var Hb=xa*(Db-pb)-Ma*(Lb-rb);Db=Ma*(Db-pb)+xa*(Lb-rb);Hb*=pa;Db*=va;return new mxPoint(tb+Wa*Hb-Za*Db,ob+Za*Hb+Wa*Db)};M=function(Db){if(null!=Db)for(var Lb=0;Lb<Db.length;Lb++)if(null!=Db[Lb]){var Hb=cb(Db[Lb].x,Db[Lb].y);Db[Lb].x=+Hb.x;Db[Lb].y=Hb.y}};N=ma.getChildCount(D);for(Aa=0;Aa<N;Aa++){var fb=ma.getChildAt(D,Aa),Xa=this.getCellGeometry(fb);if(null!=Xa)if(ma.isEdge(fb))Xa=Xa.clone(),M([Xa.sourcePoint,Xa.targetPoint]),M(Xa.points),ma.setGeometry(fb,Xa);else if(ma.isVertex(fb)&&!Xa.relative){var wb=this.getCurrentCellStyle(fb),sb=parseFloat(wb[mxConstants.STYLE_ROTATION])||0,qb=mxUtils.toRadians(sb-W),zb=pa*Math.cos(qb),Fb=va*Math.sin(qb),Jb=Math.sqrt(zb*zb+Fb*Fb);qb=Math.sqrt(pa*pa*Math.sin(qb)*Math.sin(qb)+va*va*Math.cos(qb)*Math.cos(qb));"fixed"==wb[mxConstants.STYLE_ASPECT]&&(Jb=qb=Math.min(Jb,qb));var vb=cb(Xa.getCenterX(),Xa.getCenterY()),Eb=Xa;Xa=Xa.clone();var Ib=sb;this.isCellResizable(fb)&&("0"!=wb[mxConstants.STYLE_RESIZE_WIDTH]&&(Xa.width=Eb.width*Jb),"0"!=wb[mxConstants.STYLE_RESIZE_HEIGHT]&&(Xa.height=Eb.height*qb),Ib=Math.round(100*(ca+mxUtils.toDegree(Math.atan2(Fb,zb))))/100);this.isCellMovable(fb)&&(Xa.x=vb.x-Xa.width/2,Xa.y=vb.y-Xa.height/2);ma.setGeometry(fb,Xa);.01<Math.abs(mxUtils.mod(Ib,360)-mxUtils.mod(sb,-360))?this.setCellStyles(mxConstants.STYLE_ROTATION,mxUtils.mod(Ib,360),[fb]):Ib=sb;this.resizeRotatedGroupChildren(fb,Eb,Xa,sb,Ib)}else this.scaleCell(fb,pa,ua,!0)}};Graph.prototype.turnShapes=function(D,M){var N=this.getModel(),W=[];N.beginUpdate();try{for(var ca=0;ca<D.length;ca++){var ma=D[ca];if(N.isEdge(ma)){var pa=N.getTerminal(ma,!0),ua=N.getTerminal(ma,!1);if(null!=pa&&pa==ua){var Aa=this.view.getState(ma),xa=N.getGeometry(ma);if(null!=Aa&&null!=xa&&null!=Aa.absolutePoints&&4<=Aa.absolutePoints.length&&+360))?this.setCellStyles(mxConstants.STYLE_ROTATION,mxUtils.mod(Ib,360),[fb]):Ib=sb;this.resizeRotatedGroupChildren(fb,Eb,Xa,sb,Ib)}else this.scaleCell(fb,pa,va,!0)}};Graph.prototype.turnShapes=function(D,M){var N=this.getModel(),W=[];N.beginUpdate();try{for(var ca=0;ca<D.length;ca++){var ma=D[ca];if(N.isEdge(ma)){var pa=N.getTerminal(ma,!0),va=N.getTerminal(ma,!1);if(null!=pa&&pa==va){var Aa=this.view.getState(ma),xa=N.getGeometry(ma);if(null!=Aa&&null!=xa&&null!=Aa.absolutePoints&&4<=Aa.absolutePoints.length&&(null==xa.points||2>xa.points.length)&&null==Aa.style[mxConstants.STYLE_EXIT_X]&&null==Aa.style[mxConstants.STYLE_ENTRY_X]){for(var Ma=this.view.scale,Wa=this.view.translate,Za=Aa.origin,pb=Aa.absolutePoints,rb=[],tb=1;tb<pb.length-1;tb++)null!=pb[tb]&&rb.push(new mxPoint(pb[tb].x/Ma-Wa.x-Za.x,pb[tb].y/Ma-Wa.y-Za.y));2<=rb.length&&(xa=xa.clone(),xa.points=rb,N.setGeometry(ma,xa),this.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[ma]),this.setCellStyles("innerLoopWaypoints","1",[ma]))}}N.setTerminal(ma,-ua,!0);N.setTerminal(ma,pa,!1);var ob=N.getGeometry(ma);if(null!=ob){ob=ob.clone();null!=ob.points&&ob.points.reverse();var cb=ob.getTerminalPoint(!0),fb=ob.getTerminalPoint(!1);ob.setTerminalPoint(cb,!1);ob.setTerminalPoint(fb,!0);N.setGeometry(ma,ob);var Xa=this.view.getState(ma),wb=this.view.getState(pa),sb=this.view.getState(ua);if(null!=Xa){var qb=null!=wb?this.getConnectionConstraint(Xa,wb,!0):null,zb=null!=sb?this.getConnectionConstraint(Xa,sb,!1):null;this.setConnectionConstraint(ma,pa,!0,-zb);this.setConnectionConstraint(ma,ua,!1,qb);var Fb=mxUtils.getValue(Xa.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Xa.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[ma]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,Fb,[ma])}W.push(ma)}}else if(N.isVertex(ma))if(this.isRotatableGroup(ma))this.rotateCell(ma,M?-90:90),W.push(ma);else if(ob=this.getCellGeometry(ma),null!=ob){if(!(this.isTable(ma)||+va,!0);N.setTerminal(ma,pa,!1);var ob=N.getGeometry(ma);if(null!=ob){ob=ob.clone();null!=ob.points&&ob.points.reverse();var cb=ob.getTerminalPoint(!0),fb=ob.getTerminalPoint(!1);ob.setTerminalPoint(cb,!1);ob.setTerminalPoint(fb,!0);N.setGeometry(ma,ob);var Xa=this.view.getState(ma),wb=this.view.getState(pa),sb=this.view.getState(va);if(null!=Xa){var qb=null!=wb?this.getConnectionConstraint(Xa,wb,!0):null,zb=null!=sb?this.getConnectionConstraint(Xa,sb,!1):null;this.setConnectionConstraint(ma,pa,!0,+zb);this.setConnectionConstraint(ma,va,!1,qb);var Fb=mxUtils.getValue(Xa.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Xa.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[ma]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,Fb,[ma])}W.push(ma)}}else if(N.isVertex(ma))if(this.isRotatableGroup(ma))this.rotateCell(ma,M?-90:90),W.push(ma);else if(ob=this.getCellGeometry(ma),null!=ob){if(!(this.isTable(ma)||this.isTableRow(ma)||this.isTableCell(ma)||this.isSwimlane(ma))){ob=ob.clone();ob.x+=ob.width/2-ob.height/2;ob.y+=ob.height/2-ob.width/2;var Jb=ob.width;ob.width=ob.height;ob.height=Jb;N.setGeometry(ma,ob)}var vb=this.view.getState(ma);if(null!=vb){var Eb=[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],Ib=mxUtils.getValue(vb.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);this.setCellStyles(mxConstants.STYLE_DIRECTION,Eb[mxUtils.mod(mxUtils.indexOf(Eb,-Ib)+(M?-1:1),Eb.length)],[ma])}W.push(ma)}}}finally{N.endUpdate()}return W};Graph.prototype.rotateEdges=function(D,M){var N=this.getModel(),W=[];N.beginUpdate();try{for(var ca=0;ca<D.length;ca++){var ma=D[ca];if(N.isEdge(ma)&&!this.isCellLocked(ma)&&null==N.getTerminal(ma,!0)&&null==N.getTerminal(ma,!1)){var pa=N.getGeometry(ma);if(null!=pa&&null!=pa.getTerminalPoint(!0)&&null!=pa.getTerminalPoint(!1)){pa=pa.clone();var ua=[pa.getTerminalPoint(!0),pa.getTerminalPoint(!1)];null!=pa.points&&(ua=ua.concat(pa.points));-for(var Aa=ua[0].x,xa=ua[0].y,Ma=ua[0].x,Wa=ua[0].y,Za=1;Za<ua.length;Za++)Aa=Math.min(Aa,ua[Za].x),xa=Math.min(xa,ua[Za].y),Ma=Math.max(Ma,ua[Za].x),Wa=Math.max(Wa,ua[Za].y);var pb=(Aa+Ma)/2,rb=(xa+Wa)/2;for(Za=0;Za<ua.length;Za++){var tb=ua[Za].x-pb,ob=ua[Za].y-rb;ua[Za].x=M?pb+ob:pb-ob;ua[Za].y=M?rb-tb:rb+tb}N.setGeometry(ma,pa);W.push(ma)}}}}finally{N.endUpdate()}return W};Graph.prototype.stencilHasPlaceholders=function(D){if(null!=D&&null!=D.fgNode)for(D=D.fgNode.firstChild;null!=D;){if("text"==+Ib)+(M?-1:1),Eb.length)],[ma])}W.push(ma)}}}finally{N.endUpdate()}return W};Graph.prototype.rotateEdges=function(D,M){var N=this.getModel(),W=[];N.beginUpdate();try{for(var ca=0;ca<D.length;ca++){var ma=D[ca];if(N.isEdge(ma)&&!this.isCellLocked(ma)&&null==N.getTerminal(ma,!0)&&null==N.getTerminal(ma,!1)){var pa=N.getGeometry(ma);if(null!=pa&&null!=pa.getTerminalPoint(!0)&&null!=pa.getTerminalPoint(!1)){pa=pa.clone();var va=[pa.getTerminalPoint(!0),pa.getTerminalPoint(!1)];null!=pa.points&&(va=va.concat(pa.points));+for(var Aa=va[0].x,xa=va[0].y,Ma=va[0].x,Wa=va[0].y,Za=1;Za<va.length;Za++)Aa=Math.min(Aa,va[Za].x),xa=Math.min(xa,va[Za].y),Ma=Math.max(Ma,va[Za].x),Wa=Math.max(Wa,va[Za].y);var pb=(Aa+Ma)/2,rb=(xa+Wa)/2;for(Za=0;Za<va.length;Za++){var tb=va[Za].x-pb,ob=va[Za].y-rb;va[Za].x=M?pb+ob:pb-ob;va[Za].y=M?rb-tb:rb+tb}N.setGeometry(ma,pa);W.push(ma)}}}}finally{N.endUpdate()}return W};Graph.prototype.stencilHasPlaceholders=function(D){if(null!=D&&null!=D.fgNode)for(D=D.fgNode.firstChild;null!=D;){if("text"==D.nodeName&&"1"==D.getAttribute("placeholders"))return!0;D=D.nextSibling}return!1};var Q=Graph.prototype.processChange;Graph.prototype.processChange=function(D){if(D instanceof mxGeometryChange&&(this.isTableCell(D.cell)||this.isTableRow(D.cell))&&(null==D.previous&&null!=D.geometry||null!=D.previous&&(null==D.previous.equals||!D.previous.equals(D.geometry)))){var M=D.cell;this.isTableCell(M)&&(M=this.model.getParent(M));this.isTableRow(M)&&(M=this.model.getParent(M));var N=this.view.getState(M);null!=N&&null!=N.shape&&(this.view.invalidate(M),N.shape.bounds=null)}Q.apply(this,arguments);D instanceof mxValueChange&&null!=D.cell&&null!=D.cell.value&&"object"==typeof D.cell.value&&this.invalidateDescendantsWithPlaceholders(D.cell)};Graph.prototype.invalidateDescendantsWithPlaceholders=function(D){D=this.model.getDescendants(D);if(0<D.length)for(var M=0;M<D.length;M++){var N=this.view.getState(D[M]);null!=N&&null!=N.shape&&null!=N.shape.stencil&&this.stencilHasPlaceholders(N.shape.stencil)?this.removeStateForCell(D[M]):this.isReplacePlaceholders(D[M])&&this.view.invalidate(D[M],!1,!1)}};Graph.prototype.replaceElement=function(D,M){M=D.ownerDocument.createElement(null!=M?M:"span");for(var N=Array.prototype.slice.call(D.attributes);attr=N.pop();)M.setAttribute(attr.nodeName,attr.nodeValue);M.innerHTML=D.innerHTML;D.parentNode.replaceChild(M,D)};Graph.prototype.processElements=function(D,M){if(null!=D){D=D.getElementsByTagName("*");for(var N=0;N<D.length;N++)null!=D[N]&&M(D[N])}};Graph.prototype.updateLabelElements=-function(D,M,N){D=null!=D?D:this.getSelectionCells();for(var W=document.createElement("div"),ca=0;ca<D.length;ca++){var ma=this.getCurrentCellStyle(D[ca]);if(null!=ma&&"1"==ma.html&&(ma=this.convertValueToString(D[ca]),null!=ma&&0<ma.length)){W.innerHTML=Graph.sanitizeHtml(ma);for(var pa=W.getElementsByTagName(null!=N?N:"*"),ua=0;ua<pa.length;ua++)M(pa[ua]);W.innerHTML!=ma&&this.cellLabelChanged(D[ca],W.innerHTML)}}};Graph.prototype.cellLabelChanged=function(D,M,N){M=Graph.zapGremlins(M);this.model.beginUpdate();+function(D,M,N){D=null!=D?D:this.getSelectionCells();for(var W=document.createElement("div"),ca=0;ca<D.length;ca++){var ma=this.getCurrentCellStyle(D[ca]);if(null!=ma&&"1"==ma.html&&(ma=this.convertValueToString(D[ca]),null!=ma&&0<ma.length)){W.innerHTML=Graph.sanitizeHtml(ma);for(var pa=W.getElementsByTagName(null!=N?N:"*"),va=0;va<pa.length;va++)M(pa[va]);W.innerHTML!=ma&&this.cellLabelChanged(D[ca],W.innerHTML)}}};Graph.prototype.cellLabelChanged=function(D,M,N){M=Graph.zapGremlins(M);this.model.beginUpdate();try{if(null!=D.value&&"object"==typeof D.value){if(this.isReplacePlaceholders(D)&&null!=D.getAttribute("placeholder"))for(var W=D.getAttribute("placeholder"),ca=D;null!=ca;){if(ca==this.model.getRoot()||null!=ca.value&&"object"==typeof ca.value&&ca.hasAttribute(W)){this.setAttributeForCell(ca,W,M);break}ca=this.model.getParent(ca)}var ma=D.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&ma.hasAttribute("label_"+Graph.diagramLanguage)?ma.setAttribute("label_"+Graph.diagramLanguage,M):ma.setAttribute("label",M);M=ma}mxGraph.prototype.cellLabelChanged.apply(this,arguments);this.isAutosizeTextCell(D)&&this.updateAutosizeTextFontSize(D)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(D){if(null!=D){for(var M=new mxDictionary,N=0;N<D.length;N++)M.put(D[N],!0);var W=[];for(N=0;N<D.length;N++){var ca=this.model.getParent(D[N]);null==ca||M.get(ca)||(M.put(ca,!0),W.push(ca))}for(N=0;N<W.length;N++)if(ca=this.view.getState(W[N]),null!=ca&&(this.model.isEdge(ca.cell)||-this.model.isVertex(ca.cell))&&this.isCellDeletable(ca.cell)&&(this.isTransparentState(ca)||this.isTransparentBounds(ca.cell))){for(var ma=!0,pa=0;pa<this.model.getChildCount(ca.cell)&&ma;pa++)M.get(this.model.getChildAt(ca.cell,pa))||(ma=!1);ma&&D.push(ca.cell)}M=new mxDictionary;for(N=0;N<D.length;N++)M.put(D[N],!0);for(N=0;N<W.length;N++)for(ca=W[N];!M.get(ca)&&this.isTransparentBounds(ca);){ma=null;var ua=!1,Aa=this.model.getChildCount(ca);for(pa=0;pa<Aa;pa++){var xa=this.model.getChildAt(ca,-pa);if(!M.get(xa)){if(null!=ma){ua=!0;break}ma=xa}}if(ua||null==ma||!this.isTransparentBounds(ma)||!this.isCellDeletable(ma))break;pa=this.model.getChildren(ma);null!=pa&&0<pa.length&&this.cellsAdded(pa.slice(),ca,this.model.getChildCount(ca),null,null,!0);M.put(ma,!0);D.push(ma)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(D){for(var M=[],N=0;N<D.length;N++)this.isCellDeletable(D[N])&&this.isTransparentState(this.view.getState(D[N]))&&M.push(D[N]);+this.model.isVertex(ca.cell))&&this.isCellDeletable(ca.cell)&&(this.isTransparentState(ca)||this.isTransparentBounds(ca.cell))){for(var ma=!0,pa=0;pa<this.model.getChildCount(ca.cell)&&ma;pa++)M.get(this.model.getChildAt(ca.cell,pa))||(ma=!1);ma&&D.push(ca.cell)}M=new mxDictionary;for(N=0;N<D.length;N++)M.put(D[N],!0);for(N=0;N<W.length;N++)for(ca=W[N];!M.get(ca)&&this.isTransparentBounds(ca);){ma=null;var va=!1,Aa=this.model.getChildCount(ca);for(pa=0;pa<Aa;pa++){var xa=this.model.getChildAt(ca,+pa);if(!M.get(xa)){if(null!=ma){va=!0;break}ma=xa}}if(va||null==ma||!this.isTransparentBounds(ma)||!this.isCellDeletable(ma))break;pa=this.model.getChildren(ma);null!=pa&&0<pa.length&&this.cellsAdded(pa.slice(),ca,this.model.getChildCount(ca),null,null,!0);M.put(ma,!0);D.push(ma)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(D){for(var M=[],N=0;N<D.length;N++)this.isCellDeletable(D[N])&&this.isTransparentState(this.view.getState(D[N]))&&M.push(D[N]);D=M;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(D,M){this.setAttributeForCell(D,"link",M)};Graph.prototype.createLinkOverlay=function(D){var M=this.getLinkForCell(D);if(null!=M&&0<M.length){var N=this.getLinkOverlayTooltip(M);N=new mxCellOverlay(new mxImage(Editor.lightDarkLinkImage,16,16),N,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,new mxPoint(8,-8));N.isLinkOverlay=!0;var W=this;N.addListener(mxEvent.CLICK,mxUtils.bind(this,function(ca,ma){W.isEnabled()?W.setSelectionCell(ma.getProperty("cell")):this.isCustomLink(M)?this.customLinkClicked(M,D):(ca=this.getLinkTargetForCell(D),this.openLink(this.getAbsoluteUrl(M),ca))}));return N}return null};Graph.prototype.getLinkOverlayTooltip=function(D){return D};Graph.prototype.createTooltipOverlay=function(D){D=this.convertValueToTooltip(D);if(null!=D&&0<D.length){D=new mxCellOverlay(new mxImage(Editor.lightDarkTooltipImage,16,16),D,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,new mxPoint(-8,-8));D.isTooltipOverlay=!0;var M=this;D.addListener(mxEvent.CLICK,function(N,W){N=W.getProperty("cell");M.isEnabled()&&M.isCellEditable(N)?(M.setSelectionCell(N),M.editTooltip(N)):(W=W.getProperty("event"),N=M.getTooltipForCell(N),null!=N&&0<N.length&&M.tooltipHandler.show(N,W.clientX,W.clientY))});return D}return null};Graph.prototype.editTooltip=function(D){};Graph.prototype.setTooltipForCell=function(D,M){var N="tooltip";Graph.translateDiagram&&null!=Graph.diagramLanguage&&mxUtils.isNode(D.value)&&@@ -2875,38 +2875,38 @@ return new mxPoint(D,M)};Graph.prototype.getCenterInsertPoint=function(D){D=nullD.width/2)),this.snap(Math.round(this.container.clientHeight/2/this.view.scale-this.view.translate.y-D.height/2)))};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.appendFontSize=function(D,M){D=null!=D?D:"";null!=M&&(0<D.length&&";"!=D.charAt(D.length-1)&&(D+=";"),D+="fontSize="+M+";");return D};Graph.prototype.addText=function(D,M,N){var W=new mxCell;W.value="Text";W.geometry=new mxGeometry(0,0,0,0);W.vertex=!0;if(null!=N&&this.model.isEdge(N.cell)){W.style="edgeLabel;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.edgeFontSize);W.geometry.relative=!0;W.connectable=!1;var ca=this.view.getRelativePoint(N,D,M);W.geometry.x=Math.round(1E4*ca.x)/1E4;W.geometry.y=Math.round(ca.y);W.geometry.offset=new mxPoint(0,0);ca=this.view.getPoint(N,W.geometry);var ma=this.view.scale;W.geometry.offset=new mxPoint(Math.round((D-ca.x)/ma),Math.round((M-ca.y)/ma))}else ca=this.view.translate,W.style="text;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.vertexFontSize),W.geometry.width=40,W.geometry.height=20,W.geometry.x=Math.round(D/this.view.scale)-ca.x-(null!=N?N.origin.x:0),W.geometry.y=Math.round(M/this.view.scale)-ca.y-(null!=N?N.origin.y:0),W.style+="autosize=1;";this.getModel().beginUpdate();try{this.addCells([W],null!=N?N.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[W])),this.autoSizeCell(W)}finally{this.getModel().endUpdate()}return W};Graph.prototype.addClickHandler=function(D,M,N){var W=mxUtils.bind(this,-function(){var Aa=this.container.getElementsByTagName("a");if(null!=Aa)for(var xa=0;xa<Aa.length;xa++){var Ma=this.getAbsoluteUrl(Aa[xa].getAttribute("href"));null!=Ma&&(Aa[xa].setAttribute("rel",this.linkRelation),Aa[xa].setAttribute("href",Ma),null!=M&&mxEvent.addGestureListeners(Aa[xa],null,null,M))}});this.model.addListener(mxEvent.CHANGE,W);W();var ca=this.container.style.cursor,ma=this.getTolerance(),pa=this,ua={currentState:null,currentLink:null,currentTarget:null,highlight:null!=D&&""!=D&&+function(){var Aa=this.container.getElementsByTagName("a");if(null!=Aa)for(var xa=0;xa<Aa.length;xa++){var Ma=this.getAbsoluteUrl(Aa[xa].getAttribute("href"));null!=Ma&&(Aa[xa].setAttribute("rel",this.linkRelation),Aa[xa].setAttribute("href",Ma),null!=M&&mxEvent.addGestureListeners(Aa[xa],null,null,M))}});this.model.addListener(mxEvent.CHANGE,W);W();var ca=this.container.style.cursor,ma=this.getTolerance(),pa=this,va={currentState:null,currentLink:null,currentTarget:null,highlight:null!=D&&""!=D&&D!=mxConstants.NONE?new mxCellHighlight(pa,D,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(Aa){var xa=Aa.sourceState;if(null==xa||null==pa.getLinkForCell(xa.cell))Aa=pa.getCellAt(Aa.getGraphX(),Aa.getGraphY(),null,null,null,function(Ma,Wa,Za){return null==pa.getLinkForCell(Ma.cell)}),xa=null==xa||pa.model.isAncestor(Aa,xa.cell)?pa.view.getState(Aa):null;xa!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=xa,null!=this.currentState&&this.activate(this.currentState))},mouseDown:function(Aa,xa){this.startX=xa.getGraphX();this.startY=xa.getGraphY();this.scrollLeft=pa.container.scrollLeft;this.scrollTop=pa.container.scrollTop;null==this.currentLink&&"auto"==pa.container.style.overflow&&(pa.container.style.cursor="move");this.updateCurrentState(xa)},mouseMove:function(Aa,xa){if(pa.isMouseDown)null!=this.currentLink&&(Aa=Math.abs(this.startX-xa.getGraphX()),xa=Math.abs(this.startY-xa.getGraphY()),(Aa>ma||xa>ma)&&this.clear());else{for(Aa=xa.getSource();null!=Aa&&"a"!=Aa.nodeName.toLowerCase();)Aa=Aa.parentNode;null!=Aa?this.clear():(null!=pa.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&pa.tooltipHandler.reset(xa,!0,this.currentState),(null==this.currentState||xa.getState()!=this.currentState&&null!=xa.sourceState||!pa.intersects(this.currentState,xa.getGraphX(),xa.getGraphY()))&&this.updateCurrentState(xa))}},mouseUp:function(Aa,xa){var Ma=xa.getSource();for(Aa=xa.getEvent();null!=Ma&&"a"!=Ma.nodeName.toLowerCase();)Ma=Ma.parentNode;null==Ma&&Math.abs(this.scrollLeft-pa.container.scrollLeft)<ma&&Math.abs(this.scrollTop-pa.container.scrollTop)<ma&&(null==xa.sourceState||!xa.isSource(xa.sourceState.control))&&((mxEvent.isLeftMouseButton(Aa)||mxEvent.isMiddleMouseButton(Aa))&&!mxEvent.isPopupTrigger(Aa)||mxEvent.isTouchEvent(Aa))&&(null!=this.currentLink?(Ma=pa.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&Ma||null==M||M(Aa,this.currentLink,null!=this.currentState?this.currentState.cell:null),mxEvent.isConsumed(Aa)||(Aa=null!=this.currentTarget?this.currentTarget:mxEvent.isMiddleMouseButton(Aa)?"_blank":Ma?pa.linkTarget:"_top",pa.openLink(this.currentLink,Aa),xa.consume())):null!=N&&!xa.isConsumed()&&Math.abs(this.scrollLeft-pa.container.scrollLeft)<ma&&Math.abs(this.scrollTop-pa.container.scrollTop)<ma&&Math.abs(this.startX-xa.getGraphX())<ma&&Math.abs(this.startY-xa.getGraphY())<ma&&N(xa.getEvent()));this.clear()},activate:function(Aa){this.currentLink=pa.getAbsoluteUrl(pa.getLinkForCell(Aa.cell));null!=this.currentLink&&-(this.currentTarget=pa.getLinkTargetForCell(Aa.cell),pa.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(Aa))},clear:function(){null!=pa.container&&(pa.container.style.cursor=ca);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=pa.tooltipHandler&&pa.tooltipHandler.hide()}};pa.click=function(Aa){};pa.addMouseListener(ua);mxEvent.addListener(document,"mouseleave",function(Aa){ua.clear()})};Graph.prototype.duplicateCells=-function(D,M){D=null!=D?D:this.getSelectionCells();M=null!=M?M:!0;for(var N=0;N<D.length;N++)this.isTableCell(D[N])&&(D[N]=this.model.getParent(D[N]));D=this.model.getTopmostCells(D);var W=this.getModel(),ca=this.gridSize,ma=[];W.beginUpdate();try{var pa={},ua=this.createCellLookup(D),Aa=this.cloneCells(D,!1,pa,!0);for(N=0;N<D.length;N++){var xa=W.getParent(D[N]);if(null!=xa){var Ma=this.moveCells([Aa[N]],ca,ca,!1)[0];ma.push(Ma);if(M)W.add(xa,Aa[N]);else{var Wa=xa.getIndex(D[N]);W.add(xa,Aa[N],Wa+-1)}if(this.isTable(xa)){var Za=this.getCellGeometry(Aa[N]),pb=this.getCellGeometry(xa);null!=Za&&null!=pb&&(pb=pb.clone(),pb.height+=Za.height,W.setGeometry(xa,pb))}}else ma.push(Aa[N])}this.updateCustomLinks(this.createCellMapping(pa,ua),Aa,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",Aa))}finally{W.endUpdate()}return ma};Graph.prototype.insertImage=function(D,M,N){if(null!=D&&null!=this.cellEditor.textarea){for(var W=this.cellEditor.textarea.getElementsByTagName("img"),ca=+(this.currentTarget=pa.getLinkTargetForCell(Aa.cell),pa.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(Aa))},clear:function(){null!=pa.container&&(pa.container.style.cursor=ca);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=pa.tooltipHandler&&pa.tooltipHandler.hide()}};pa.click=function(Aa){};pa.addMouseListener(va);mxEvent.addListener(document,"mouseleave",function(Aa){va.clear()})};Graph.prototype.duplicateCells=+function(D,M){D=null!=D?D:this.getSelectionCells();M=null!=M?M:!0;for(var N=0;N<D.length;N++)this.isTableCell(D[N])&&(D[N]=this.model.getParent(D[N]));D=this.model.getTopmostCells(D);var W=this.getModel(),ca=this.gridSize,ma=[];W.beginUpdate();try{var pa={},va=this.createCellLookup(D),Aa=this.cloneCells(D,!1,pa,!0);for(N=0;N<D.length;N++){var xa=W.getParent(D[N]);if(null!=xa){var Ma=this.moveCells([Aa[N]],ca,ca,!1)[0];ma.push(Ma);if(M)W.add(xa,Aa[N]);else{var Wa=xa.getIndex(D[N]);W.add(xa,Aa[N],Wa++1)}if(this.isTable(xa)){var Za=this.getCellGeometry(Aa[N]),pb=this.getCellGeometry(xa);null!=Za&&null!=pb&&(pb=pb.clone(),pb.height+=Za.height,W.setGeometry(xa,pb))}}else ma.push(Aa[N])}this.updateCustomLinks(this.createCellMapping(pa,va),Aa,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",Aa))}finally{W.endUpdate()}return ma};Graph.prototype.insertImage=function(D,M,N){if(null!=D&&null!=this.cellEditor.textarea){for(var W=this.cellEditor.textarea.getElementsByTagName("img"),ca=[],ma=0;ma<W.length;ma++)ca.push(W[ma]);document.execCommand("insertimage",!1,D);D=this.cellEditor.textarea.getElementsByTagName("img");if(D.length==ca.length+1)for(ma=D.length-1;0<=ma;ma--)if(0==ma||D[ma]!=ca[ma-1]){D[ma].setAttribute("width",M);D[ma].setAttribute("height",N);break}}};Graph.prototype.insertLink=function(D){if(null!=this.cellEditor.textarea)if(0==D.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var M=this.cellEditor.textarea.getElementsByTagName("a"),N=[],W=0;W<M.length;W++)N.push(M[W]);document.execCommand("createlink",!1,mxUtils.trim(D));M=this.cellEditor.textarea.getElementsByTagName("a");if(M.length==N.length+1)for(W=M.length-1;0<=W;W--)if(M[W]!=N[W-1]){for(M=M[W].getElementsByTagName("a");0<M.length;){for(N=M[0].parentNode;null!=M[0].firstChild;)N.insertBefore(M[0].firstChild,M[0]);N.removeChild(M[0])}break}}else document.execCommand("createlink",!1,mxUtils.trim(D))};var K=Graph.prototype.getResizableCells;Graph.prototype.getResizableCells=function(D){var M=K.apply(this,arguments);if(null!=D)for(var N=0;N<D.length;N++)(this.isTransparentBounds(D[N])||this.getCurrentCellStyle(D[N])[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE)&&0>mxUtils.indexOf(M,D[N])&&M.push(D[N]);return M};Graph.prototype.isCellResizable=function(D){if(this.isTransparentBounds(D))return!1;var M=mxGraph.prototype.isCellResizable.apply(this,arguments),N=this.getCurrentCellStyle(D);return!this.isTableCell(D)&&!this.isTableRow(D)&&(M||"0"!=mxUtils.getValue(N,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==N[mxConstants.STYLE_WHITE_SPACE])};Graph.prototype.alignCells=function(D,M,N){null==M&&(M=this.getMovableCells(this.getSelectionCells()));var W=!1;if(null!=M)for(var ca=0;ca<M.length;ca++)if(this.isTransparentBounds(M[ca])){W=!0;break}if(!W)return mxGraph.prototype.alignCells.apply(this,arguments);var ma=this;W=function(Ma){if(ma.model.isEdge(Ma))return null;var Wa=ma.getCellGeometry(Ma);if(null==Wa||Wa.relative)return null;var Za=ma.getOriginForCell(Ma);return ma.isTransparentBounds(Ma)?(Ma=ma.getTransparentBounds(Ma),null==Ma?null:new mxRectangle(Za.x+Wa.x+Ma.x,Za.y+Wa.y+Ma.y,Ma.width,Ma.height)):new mxRectangle(Za.x+Wa.x,Za.y+Wa.y,Wa.width,Wa.height)};if(null!=M&&1<M.length){if(null==N)for(ca=0;ca<M.length;ca++){var pa=W(M[ca]);if(null!=pa)if(null==N)if(D==mxConstants.ALIGN_CENTER){N=pa.x+pa.width/2;break}else if(D==mxConstants.ALIGN_RIGHT)N=pa.x+pa.width;else if(D==mxConstants.ALIGN_TOP)N=pa.y;else if(D==mxConstants.ALIGN_MIDDLE){N=pa.y+pa.height/2;break}else N=D==mxConstants.ALIGN_BOTTOM?-pa.y+pa.height:pa.x;else N=D==mxConstants.ALIGN_RIGHT?Math.max(N,pa.x+pa.width):D==mxConstants.ALIGN_TOP?Math.min(N,pa.y):D==mxConstants.ALIGN_BOTTOM?Math.max(N,pa.y+pa.height):Math.min(N,pa.x)}if(null!=N){M=mxUtils.sortCells(M);this.model.beginUpdate();try{for(ca=0;ca<M.length;ca++)if(pa=W(M[ca]),null!=pa){var ua=0,Aa=0;D==mxConstants.ALIGN_CENTER?ua=N-(pa.x+pa.width/2):D==mxConstants.ALIGN_RIGHT?ua=N-(pa.x+pa.width):D==mxConstants.ALIGN_TOP?Aa=N-pa.y:D==mxConstants.ALIGN_MIDDLE?Aa=N-(pa.y+pa.height/-2):D==mxConstants.ALIGN_BOTTOM?Aa=N-(pa.y+pa.height):ua=N-pa.x;if(0!=ua||0!=Aa)if(this.isTransparentBounds(M[ca]))this.translateCell(M[ca],ua,Aa);else{var xa=this.getCellGeometry(M[ca]).clone();xa.x+=ua;xa.y+=Aa;this.resizeCell(M[ca],xa)}}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",D,"cells",M))}finally{this.model.endUpdate()}}}return M};Graph.prototype.distributeCells=function(D,M,N){null==M&&(M=this.getSelectionCells());if(null!=M&&1<M.length){for(var W=[],ca=null,ma=null,pa=0,-ua=0;ua<M.length;ua++)if(this.getModel().isVertex(M[ua])){var Aa=this.view.getState(M[ua]);if(null!=Aa){var xa=D?Aa.getCenterX():Aa.getCenterY();ca=null!=ca?Math.max(ca,xa):xa;ma=null!=ma?Math.min(ma,xa):xa;N&&(pa+=D?Aa.width:Aa.height);W.push(Aa)}}if(2<W.length){W.sort(function(tb,ob){return D?tb.x-ob.x:tb.y-ob.y});N&&(pa-=D?W[0].width/2+W[W.length-1].width/2:W[0].height/2+W[W.length-1].height/2);Aa=this.view.translate;xa=this.view.scale;ma=ma/xa-(D?Aa.x:Aa.y);ca=ca/xa-(D?Aa.x:Aa.y);this.getModel().beginUpdate();-try{var Ma=(ca-ma-pa)/(W.length-1),Wa=ma+(N?D?W[0].width/2:W[0].height/2:0);for(ua=1;ua<W.length-1;ua++){var Za=this.view.getState(this.model.getParent(W[ua].cell)),pb=this.getCellGeometry(W[ua].cell);Wa+=Ma;if(null!=pb&&null!=Za)if(this.isTransparentBounds(W[ua].cell)){var rb=D?N?W[ua].x/xa-Aa.x:W[ua].getCenterX()/xa-Aa.x:N?W[ua].y/xa-Aa.y:W[ua].getCenterY()/xa-Aa.y;D?this.translateCell(W[ua].cell,Wa-rb,0):this.translateCell(W[ua].cell,0,Wa-rb)}else pb=pb.clone(),D?pb.x=Math.round(Wa-(N?0:pb.width/-2))-Za.origin.x:pb.y=Math.round(Wa-(N?0:pb.height/2))-Za.origin.y,this.getModel().setGeometry(W[ua].cell,pb);N&&(Wa+=D?W[ua].width:W[ua].height)}}finally{this.getModel().endUpdate()}}}return M};Graph.prototype.isCloneEvent=function(D){return mxClient.IS_MAC&&mxEvent.isMetaDown(D)||mxEvent.isControlDown(D)};Graph.prototype.createSvgImageExport=function(D,M){D=new mxImageExport;D.addCellData=function(W,ca,ma){ca.setAttribute("data-cell-id",W.id);if(ma)if(mxUtils.isNode(W.value))for(ma=0;ma<W.value.attributes.length;ma++){var pa=-W.value.attributes[ma];ca.setAttribute("data-cell-"+pa.name,pa.value)}else if("object"===typeof W.value)for(pa in W.value)ca.setAttribute("data-cell-"+pa,W.value[pa]);else null!=W.value&&ca.setAttribute("data-cell-value",W.value);if(M&&mxUtils.isNode(W.value))for(ma=0;ma<W.value.attributes.length;ma++)pa=W.value.attributes[ma],ca.setAttribute("data-meta-"+pa.name,pa.value);return ca};var N=D.visitStatesRecursive;D.visitStatesRecursive=function(W,ca,ma){if(null!=W){var pa=ca.root,ua=ca.root.ownerDocument;-ca.root=this.addCellData(W.cell,null!=ua.createElementNS?ua.createElementNS(mxConstants.NS_SVG,"g"):ua.createElement("g"),Editor.addSvgMetadata);pa.appendChild(ca.root);N.apply(this,arguments);ca.root=pa}};D.getLinkForCellState=mxUtils.bind(this,function(W,ca){return this.getLinkForCell(W.cell)});D.getTitleForCellState=mxUtils.bind(this,function(W,ca){return Editor.convertHtmlToText(this.convertValueToTooltip(W.cell))});return D};Graph.prototype.parseBackgroundImage=function(D){var M=null;null!=D&&-0<D.length&&(D=JSON.parse(D),M=new mxImage(D.src,D.width,D.height));return M};Graph.prototype.getBackgroundImageObject=function(D){return D};Graph.prototype.getSvg=function(D,M,N,W,ca,ma,pa,ua,Aa,xa,Ma,Wa,Za,pb,rb,tb,ob){var cb=null;if(null!=pb){cb=new mxDictionary;for(var fb=0;fb<pb.length;fb++)cb.put(pb[fb],!0)}ca=this.useCssTransforms;var Xa=this.enableFlowAnimation;this.enableFlowAnimation=!1;ca&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{M=null!=M?M:1;N=null!=+pa.y+pa.height:pa.x;else N=D==mxConstants.ALIGN_RIGHT?Math.max(N,pa.x+pa.width):D==mxConstants.ALIGN_TOP?Math.min(N,pa.y):D==mxConstants.ALIGN_BOTTOM?Math.max(N,pa.y+pa.height):Math.min(N,pa.x)}if(null!=N){M=mxUtils.sortCells(M);this.model.beginUpdate();try{for(ca=0;ca<M.length;ca++)if(pa=W(M[ca]),null!=pa){var va=0,Aa=0;D==mxConstants.ALIGN_CENTER?va=N-(pa.x+pa.width/2):D==mxConstants.ALIGN_RIGHT?va=N-(pa.x+pa.width):D==mxConstants.ALIGN_TOP?Aa=N-pa.y:D==mxConstants.ALIGN_MIDDLE?Aa=N-(pa.y+pa.height/+2):D==mxConstants.ALIGN_BOTTOM?Aa=N-(pa.y+pa.height):va=N-pa.x;if(0!=va||0!=Aa)if(this.isTransparentBounds(M[ca]))this.translateCell(M[ca],va,Aa);else{var xa=this.getCellGeometry(M[ca]).clone();xa.x+=va;xa.y+=Aa;this.resizeCell(M[ca],xa)}}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",D,"cells",M))}finally{this.model.endUpdate()}}}return M};Graph.prototype.distributeCells=function(D,M,N){null==M&&(M=this.getSelectionCells());if(null!=M&&1<M.length){for(var W=[],ca=null,ma=null,pa=0,+va=0;va<M.length;va++)if(this.getModel().isVertex(M[va])){var Aa=this.view.getState(M[va]);if(null!=Aa){var xa=D?Aa.getCenterX():Aa.getCenterY();ca=null!=ca?Math.max(ca,xa):xa;ma=null!=ma?Math.min(ma,xa):xa;N&&(pa+=D?Aa.width:Aa.height);W.push(Aa)}}if(2<W.length){W.sort(function(tb,ob){return D?tb.x-ob.x:tb.y-ob.y});N&&(pa-=D?W[0].width/2+W[W.length-1].width/2:W[0].height/2+W[W.length-1].height/2);Aa=this.view.translate;xa=this.view.scale;ma=ma/xa-(D?Aa.x:Aa.y);ca=ca/xa-(D?Aa.x:Aa.y);this.getModel().beginUpdate();+try{var Ma=(ca-ma-pa)/(W.length-1),Wa=ma+(N?D?W[0].width/2:W[0].height/2:0);for(va=1;va<W.length-1;va++){var Za=this.view.getState(this.model.getParent(W[va].cell)),pb=this.getCellGeometry(W[va].cell);Wa+=Ma;if(null!=pb&&null!=Za)if(this.isTransparentBounds(W[va].cell)){var rb=D?N?W[va].x/xa-Aa.x:W[va].getCenterX()/xa-Aa.x:N?W[va].y/xa-Aa.y:W[va].getCenterY()/xa-Aa.y;D?this.translateCell(W[va].cell,Wa-rb,0):this.translateCell(W[va].cell,0,Wa-rb)}else pb=pb.clone(),D?pb.x=Math.round(Wa-(N?0:pb.width/+2))-Za.origin.x:pb.y=Math.round(Wa-(N?0:pb.height/2))-Za.origin.y,this.getModel().setGeometry(W[va].cell,pb);N&&(Wa+=D?W[va].width:W[va].height)}}finally{this.getModel().endUpdate()}}}return M};Graph.prototype.isCloneEvent=function(D){return mxClient.IS_MAC&&mxEvent.isMetaDown(D)||mxEvent.isControlDown(D)};Graph.prototype.createSvgImageExport=function(D,M){D=new mxImageExport;D.addCellData=function(W,ca,ma){ca.setAttribute("data-cell-id",W.id);if(ma)if(mxUtils.isNode(W.value))for(ma=0;ma<W.value.attributes.length;ma++){var pa=+W.value.attributes[ma];ca.setAttribute("data-cell-"+pa.name,pa.value)}else if("object"===typeof W.value)for(pa in W.value)ca.setAttribute("data-cell-"+pa,W.value[pa]);else null!=W.value&&ca.setAttribute("data-cell-value",W.value);if(M&&mxUtils.isNode(W.value))for(ma=0;ma<W.value.attributes.length;ma++)pa=W.value.attributes[ma],ca.setAttribute("data-meta-"+pa.name,pa.value);return ca};var N=D.visitStatesRecursive;D.visitStatesRecursive=function(W,ca,ma){if(null!=W){var pa=ca.root,va=ca.root.ownerDocument;+ca.root=this.addCellData(W.cell,null!=va.createElementNS?va.createElementNS(mxConstants.NS_SVG,"g"):va.createElement("g"),Editor.addSvgMetadata);pa.appendChild(ca.root);N.apply(this,arguments);ca.root=pa}};D.getLinkForCellState=mxUtils.bind(this,function(W,ca){return this.getLinkForCell(W.cell)});D.getTitleForCellState=mxUtils.bind(this,function(W,ca){return Editor.convertHtmlToText(this.convertValueToTooltip(W.cell))});return D};Graph.prototype.parseBackgroundImage=function(D){var M=null;null!=D&&+0<D.length&&(D=JSON.parse(D),M=new mxImage(D.src,D.width,D.height));return M};Graph.prototype.getBackgroundImageObject=function(D){return D};Graph.prototype.getSvg=function(D,M,N,W,ca,ma,pa,va,Aa,xa,Ma,Wa,Za,pb,rb,tb,ob){var cb=null;if(null!=pb){cb=new mxDictionary;for(var fb=0;fb<pb.length;fb++)cb.put(pb[fb],!0)}ca=this.useCssTransforms;var Xa=this.enableFlowAnimation;this.enableFlowAnimation=!1;ca&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{M=null!=M?M:1;N=null!=N?N:0;ma=null!=ma?ma:!0;pa=null!=pa?pa:!0;xa=null!=xa?xa:!1;Aa=null!=Aa?Aa:this.defaultExportLinkTarget;var wb="page"==Za?this.view.getBackgroundPageBounds():ma&&null==cb||W||"diagram"==Za?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),sb=this.backgroundImage,qb=this.view.translate,zb=this.view.scale;"diagram"==Za&&null!=sb&&null!=sb.width&&null!=sb.height&&(wb=mxRectangle.fromRectangle(wb),wb.add(new mxRectangle((qb.x+sb.x)*zb,(qb.y+sb.y)*zb,sb.width*zb,sb.height*zb)));if(null==wb)throw Error(mxResources.get("drawingEmpty"));W=M/zb;var Fb=Math.max(1,Math.ceil(wb.width*W)+2*N)+(xa&&0==N?5:0),Jb=Math.max(1,Math.ceil(wb.height*W)+2*N)+(xa&&0==N?5:0),vb=mxUtils.getLightDarkColor(D),Eb=Graph.createSvgNode(0,0,Fb,Jb,vb),Ib=Eb.ownerDocument;if(null!=D){var Db=mxUtils.createElementNs(Ib,mxConstants.NS_SVG,"rect");Db.setAttribute("fill",vb.light);Db.style.fill=vb.cssText;Db.setAttribute("width","100%");Db.setAttribute("height","100%");Db.setAttribute("x","0");Db.setAttribute("y","0");Eb.appendChild(Db)}var Lb=mxUtils.createElementNs(Ib,mxConstants.NS_SVG,"g");Eb.appendChild(Lb);var Hb=this.createSvgCanvas(Lb),bc=Math.floor(N/M-wb.x/zb),Zb=Math.floor(N/M-wb.y/zb);Hb.translate(bc,Zb);Hb.idPrefix="drawio-svg-"+Editor.guid();if(ob){var $b=this.gridSize*M,Sb=this.view.gridSteps*$b;D=[];for(fb=1;fb<this.view.gridSteps;fb++)N=fb*$b,D.push("M 0 "+N+" L "+Sb+" "+N+" M "+N+" 0 L "+N+" "+Sb);var ac=mxUtils.getLightDarkColor(this.view.gridColor),Rb=mxUtils.createElementNs(Ib,mxConstants.NS_SVG,"pattern");Rb.setAttribute("id",Hb.idPrefix+"-grid");Rb.setAttribute("patternUnits","userSpaceOnUse");Rb.setAttribute("width",Sb);Rb.setAttribute("height",Sb);Rb.setAttribute("x",mxUtils.mod((qb.x+bc)*M,Sb));Rb.setAttribute("y",mxUtils.mod((qb.y+Zb)*M,Sb));if(0<D.length){var g=mxUtils.createElementNs(Ib,mxConstants.NS_SVG,"path");g.setAttribute("d",D.join(" "));g.setAttribute("fill","none");g.setAttribute("stroke",ac.light);g.style.stroke=ac.cssText;g.setAttribute("opacity","0.2");g.setAttribute("stroke-width",-M);Rb.appendChild(g)}var r=mxUtils.createElementNs(Ib,mxConstants.NS_SVG,"path");r.setAttribute("d","M "+Sb+" 0 L 0 0 0 "+Sb);r.setAttribute("fill","none");r.setAttribute("stroke",ac.light);r.style.stroke=ac.cssText;r.setAttribute("stroke-width",M);Rb.appendChild(r);Hb.defs.appendChild(Rb);var A=mxUtils.createElementNs(Ib,mxConstants.NS_SVG,"rect");A.setAttribute("width","100%");A.setAttribute("height","100%");A.setAttribute("fill","url(#"+Rb.getAttribute("id")+")");Eb.insertBefore(A,Lb)}var u=document.createElement("div"),-z=Hb.getAlternateText;Hb.getAlternateText=function(Ia,mb,$a,Ea,Ga,Ja,Pa,eb,hb,ib,kb,dc,ec){if(null!=Ja&&0<this.state.fontSize)try{return mxUtils.isNode(Ja)?Ja=Ja.innerText:(u.innerHTML=Ja,Ja=mxUtils.extractTextWithWhitespace(u.childNodes)),Ja}catch(cc){return z.apply(this,arguments)}else return z.apply(this,arguments)};if(null!=sb&&null!=sb.width&&null!=sb.height){fb=zb/M;var F=new mxRectangle((sb.x+qb.x)*fb,(sb.y+qb.y)*fb,sb.width*fb,sb.height*fb);mxUtils.intersects(wb,F)&&Hb.image(sb.x+qb.x,sb.y+-qb.y,sb.width,sb.height,sb.src,!0)}Hb.scale(W);Hb.textEnabled=pa;ua=null!=ua?ua:this.createSvgImageExport();var I=ua.getLinkForCellState;ua.getLinkForCellState=function(Ia,mb){var $a=Ia.view.graph.getAbsoluteUrl(I.apply(this,arguments));return null==$a||Ia.view.graph.isCustomLink($a)?null:$a};ua.getLinkTargetForCellState=function(Ia,mb){return Ia.view.graph.getLinkTargetForCell(Ia.cell)};var ea=ua.drawCellState,S=null,ta=mxUtils.bind(this,function(){if(null==S){S="ge-flow-animation-"+Editor.guid();-var Ia=null!=Ib.createElementNS?Ib.createElementNS(mxConstants.NS_SVG,"style"):Ib.createElement("style");Ia.innerHTML=this.createFlowAnimationCss(S);Ib.getElementsByTagName("defs")[0].appendChild(Ia)}return S});ua.drawCellState=function(Ia,mb){for(var $a=Ia.view.graph,Ea=null!=cb?cb.get(Ia.cell):$a.isCellSelected(Ia.cell),Ga=$a.model.getParent(Ia.cell);!(ma&&null==cb||Ea)&&null!=Ga;)Ea=null!=cb?cb.get(Ga):$a.isCellSelected(Ga),Ga=$a.model.getParent(Ga);if(null!=Ia.shape)try{var Ja=Ia.shape.isFlowAnimationEnabled,+M);Rb.appendChild(g)}var r=mxUtils.createElementNs(Ib,mxConstants.NS_SVG,"path");r.setAttribute("d","M "+Sb+" 0 L 0 0 0 "+Sb);r.setAttribute("fill","none");r.setAttribute("stroke",ac.light);r.style.stroke=ac.cssText;r.setAttribute("stroke-width",M);Rb.appendChild(r);Hb.defs.appendChild(Rb);var A=mxUtils.createElementNs(Ib,mxConstants.NS_SVG,"rect");A.setAttribute("width","100%");A.setAttribute("height","100%");A.setAttribute("fill","url(#"+Rb.getAttribute("id")+")");Eb.insertBefore(A,Lb)}var v=document.createElement("div"),+z=Hb.getAlternateText;Hb.getAlternateText=function(Ia,mb,$a,Ea,Ga,Ja,Pa,eb,hb,ib,kb,dc,ec){if(null!=Ja&&0<this.state.fontSize)try{return mxUtils.isNode(Ja)?Ja=Ja.innerText:(v.innerHTML=Ja,Ja=mxUtils.extractTextWithWhitespace(v.childNodes)),Ja}catch(cc){return z.apply(this,arguments)}else return z.apply(this,arguments)};if(null!=sb&&null!=sb.width&&null!=sb.height){fb=zb/M;var F=new mxRectangle((sb.x+qb.x)*fb,(sb.y+qb.y)*fb,sb.width*fb,sb.height*fb);mxUtils.intersects(wb,F)&&Hb.image(sb.x+qb.x,sb.y++qb.y,sb.width,sb.height,sb.src,!0)}Hb.scale(W);Hb.textEnabled=pa;va=null!=va?va:this.createSvgImageExport();var I=va.getLinkForCellState;va.getLinkForCellState=function(Ia,mb){var $a=Ia.view.graph.getAbsoluteUrl(I.apply(this,arguments));return null==$a||Ia.view.graph.isCustomLink($a)?null:$a};va.getLinkTargetForCellState=function(Ia,mb){return Ia.view.graph.getLinkTargetForCell(Ia.cell)};var ea=va.drawCellState,S=null,ta=mxUtils.bind(this,function(){if(null==S){S="ge-flow-animation-"+Editor.guid();+var Ia=null!=Ib.createElementNS?Ib.createElementNS(mxConstants.NS_SVG,"style"):Ib.createElement("style");Ia.innerHTML=this.createFlowAnimationCss(S);Ib.getElementsByTagName("defs")[0].appendChild(Ia)}return S});va.drawCellState=function(Ia,mb){for(var $a=Ia.view.graph,Ea=null!=cb?cb.get(Ia.cell):$a.isCellSelected(Ia.cell),Ga=$a.model.getParent(Ia.cell);!(ma&&null==cb||Ea)&&null!=Ga;)Ea=null!=cb?cb.get(Ga):$a.isCellSelected(Ga),Ga=$a.model.getParent(Ga);if(null!=Ia.shape)try{var Ja=Ia.shape.isFlowAnimationEnabled,Pa=Ia.shape.addFlowAnimationToShape;Ia.shape.isFlowAnimationEnabled=function(){return Xa&&$a.model.isEdge(Ia.cell)&&"1"==mxUtils.getValue(Ia.style,"flowAnimation","0")};Ia.shape.addFlowAnimationToShape=function(){$a.addFlowAnimationToNode(this.getFlowAnimationPath(),Ia.style,M,ta())};if(ma&&null==cb||Ea)$a.view.redrawEnumerationState(Ia),ea.apply(this,arguments),this.doDrawShape(Ia.secondLabel,mb)}finally{Ia.shape.isFlowAnimationEnabled=Ja,Ia.shape.addFlowAnimationToShape=Pa}};var oa=null!=this.view.currentRoot?-this.view.currentRoot:this.model.root;ua.drawState(this.getView().getState(oa),Hb);this.addForeignObjectWarning(Hb,Eb);Graph.inlineSingleUseImages(Eb);Graph.replaceFontElements(Eb);Graph.addAdaptiveColors(Eb,this.shapeBackgroundColor);tb?this.disableSvgLinks(Eb):this.updateSvgLinks(Eb,Aa,!0);return Eb}finally{this.enableFlowAnimation=Xa,ca&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(D,M){if("0"!=urlParams["svg-warning"]&&+this.view.currentRoot:this.model.root;va.drawState(this.getView().getState(oa),Hb);this.addForeignObjectWarning(Hb,Eb);Graph.inlineSingleUseImages(Eb);Graph.replaceFontElements(Eb);Graph.addAdaptiveColors(Eb,this.shapeBackgroundColor);tb?this.disableSvgLinks(Eb):this.updateSvgLinks(Eb,Aa,!0);return Eb}finally{this.enableFlowAnimation=Xa,ca&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(D,M){if("0"!=urlParams["svg-warning"]&&0<M.getElementsByTagName("foreignObject").length){var N=D.createElement("switch"),W=D.createElement("g");W.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var ca=D.createElement("a");ca.setAttribute("transform","translate(0,-5)");null==ca.setAttributeNS||M.ownerDocument!=document&&null==document.documentMode?(ca.setAttribute("xlink:href",Graph.foreignObjectWarningLink),ca.setAttribute("target","_blank")):(ca.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Graph.foreignObjectWarningLink),ca.setAttributeNS(mxConstants.NS_XLINK,"target","_blank"));D=D.createElement("text");D.setAttribute("text-anchor","middle");D.setAttribute("font-size","10px");D.setAttribute("x","50%");D.setAttribute("y","100%");mxUtils.write(D,Graph.foreignObjectWarningText);N.appendChild(W);ca.appendChild(D);N.appendChild(ca);M.appendChild(N)}};Graph.prototype.disableSvgLinks=function(D,M){D=D.getElementsByTagName("a");for(var N=0;N<D.length;N++){var W=D[N].getAttribute("href");null==W&&(W=D[N].getAttribute("xlink:href"));null!=W&&(D[N].style.pointerEvents="none",D[N].setAttribute("href",""));M&&M(D[N])}};Graph.prototype.updateSvgLinks=function(D,M,N){D=D.getElementsByTagName("a");for(var W=0;W<D.length;W++)if(null==D[W].getAttribute("target")){var ca=D[W].getAttribute("href");null==ca&&(ca=D[W].getAttribute("xlink:href"));null!=ca&&(null!=M&&/^https?:\/\//.test(ca)?D[W].setAttribute("target",M):N&&this.isCustomLink(ca)&&D[W].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(D){D=@@ -2915,45 +2915,45 @@ new mxSvgCanvas2D(D);D.minStrokeWidth=this.cellRenderer.minSvgStrokeWidth;D.adapD=D.parentNode}return D};Graph.prototype.selectNode=function(D){var M=null;if(window.getSelection){if(M=window.getSelection(),M.getRangeAt&&M.rangeCount){var N=document.createRange();N.selectNode(D);M.removeAllRanges();M.addRange(N)}}else(M=document.selection)&&"Control"!=M.type&&(D=M.createRange(),D.collapse(!0),N=M.createRange(),N.setEndPoint("StartToStart",D),N.select())};Graph.prototype.flipEdgePoints=function(D,M,N){var W=this.getCellGeometry(D);if(null!=W){W=W.clone();if(null!=W.points)for(var ca=0;ca<W.points.length;ca++)M?W.points[ca].x=N+(N-W.points[ca].x):W.points[ca].y=N+(N-W.points[ca].y);ca=function(ma){null!=ma&&(M?ma.x=N+(N-ma.x):ma.y=N+(N-ma.y))};ca(W.getTerminalPoint(!0));ca(W.getTerminalPoint(!1));this.model.setGeometry(D,W)}};Graph.prototype.flipChildren=function(D,M,N){this.model.beginUpdate();try{for(var W=this.model.getChildCount(D),ca=0;ca<W;ca++){var ma=this.model.getChildAt(D,ca);if(this.model.isEdge(ma))this.flipEdgePoints(ma,M,N);else{var pa=this.getCellGeometry(ma);null!=pa&&(pa=pa.clone(),M?pa.x=N+(N-pa.x-pa.width):pa.y=N+(N-pa.y-pa.height),this.model.setGeometry(ma,pa))}}}finally{this.model.endUpdate()}};Graph.prototype.getConnectionPoint=function(D,M,N){return null!=D&&1==mxUtils.getValue(D.style,"legacyAnchorPoints",1)?this.getLegacyConnectionPoint(D,M,N):mxGraph.prototype.getConnectionPoint.apply(this,arguments)};Graph.prototype.getLegacyConnectionPoint=function(D,M,N){N=null!=N?N:!0;var W=null;if(null!=D&&null!=M.point){var ca=this.view.getPerimeterBounds(D),-ma=new mxPoint(ca.getCenterX(),ca.getCenterY()),pa=D.style[mxConstants.STYLE_DIRECTION],ua=0;null!=pa&&1==mxUtils.getValue(D.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(pa==mxConstants.DIRECTION_NORTH?ua+=270:pa==mxConstants.DIRECTION_WEST?ua+=180:pa==mxConstants.DIRECTION_SOUTH&&(ua+=90),pa!=mxConstants.DIRECTION_NORTH&&pa!=mxConstants.DIRECTION_SOUTH||ca.rotate90());W=this.view.scale;W=new mxPoint(ca.x+M.point.x*ca.width+M.dx*W,ca.y+M.point.y*ca.height+M.dy*W);var Aa=D.style[mxConstants.STYLE_ROTATION]||-0;if(M.perimeter)0!=ua&&(pa=ca=0,90==ua?pa=1:180==ua?ca=-1:270==ua&&(pa=-1),W=mxUtils.getRotatedPoint(W,ca,pa,ma)),W=this.view.getPerimeterPoint(D,W,!1);else if(Aa+=ua,this.getModel().isVertex(D.cell)){ua=1==D.style[mxConstants.STYLE_FLIPH];M=1==D.style[mxConstants.STYLE_FLIPV];null!=D.shape&&null!=D.shape.stencil&&(ua=1==mxUtils.getValue(D.style,"stencilFlipH",0)||ua,M=1==mxUtils.getValue(D.style,"stencilFlipV",0)||M);if(pa==mxConstants.DIRECTION_NORTH||pa==mxConstants.DIRECTION_SOUTH)D=ua,ua=M,-M=D;ua&&(W.x=2*ca.getCenterX()-W.x);M&&(W.y=2*ca.getCenterY()-W.y)}0!=Aa&&null!=W&&(D=mxUtils.toRadians(Aa),ca=Math.cos(D),pa=Math.sin(D),W=mxUtils.getRotatedPoint(W,ca,pa,ma))}N&&null!=W&&(W.x=Math.round(W.x),W.y=Math.round(W.y));return W};Graph.prototype.flipCells=function(D,M){this.model.beginUpdate();try{D=this.model.getTopmostCells(D);for(var N=[],W=0;W<D.length;W++)if(this.model.isEdge(D[W])){var ca=this.view.getState(D[W]);null!=ca&&this.flipEdgePoints(D[W],M,(M?ca.getCenterX():ca.getCenterY())/+ma=new mxPoint(ca.getCenterX(),ca.getCenterY()),pa=D.style[mxConstants.STYLE_DIRECTION],va=0;null!=pa&&1==mxUtils.getValue(D.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(pa==mxConstants.DIRECTION_NORTH?va+=270:pa==mxConstants.DIRECTION_WEST?va+=180:pa==mxConstants.DIRECTION_SOUTH&&(va+=90),pa!=mxConstants.DIRECTION_NORTH&&pa!=mxConstants.DIRECTION_SOUTH||ca.rotate90());W=this.view.scale;W=new mxPoint(ca.x+M.point.x*ca.width+M.dx*W,ca.y+M.point.y*ca.height+M.dy*W);var Aa=D.style[mxConstants.STYLE_ROTATION]||+0;if(M.perimeter)0!=va&&(pa=ca=0,90==va?pa=1:180==va?ca=-1:270==va&&(pa=-1),W=mxUtils.getRotatedPoint(W,ca,pa,ma)),W=this.view.getPerimeterPoint(D,W,!1);else if(Aa+=va,this.getModel().isVertex(D.cell)){va=1==D.style[mxConstants.STYLE_FLIPH];M=1==D.style[mxConstants.STYLE_FLIPV];null!=D.shape&&null!=D.shape.stencil&&(va=1==mxUtils.getValue(D.style,"stencilFlipH",0)||va,M=1==mxUtils.getValue(D.style,"stencilFlipV",0)||M);if(pa==mxConstants.DIRECTION_NORTH||pa==mxConstants.DIRECTION_SOUTH)D=va,va=M,+M=D;va&&(W.x=2*ca.getCenterX()-W.x);M&&(W.y=2*ca.getCenterY()-W.y)}0!=Aa&&null!=W&&(D=mxUtils.toRadians(Aa),ca=Math.cos(D),pa=Math.sin(D),W=mxUtils.getRotatedPoint(W,ca,pa,ma))}N&&null!=W&&(W.x=Math.round(W.x),W.y=Math.round(W.y));return W};Graph.prototype.flipCells=function(D,M){this.model.beginUpdate();try{D=this.model.getTopmostCells(D);for(var N=[],W=0;W<D.length;W++)if(this.model.isEdge(D[W])){var ca=this.view.getState(D[W]);null!=ca&&this.flipEdgePoints(D[W],M,(M?ca.getCenterX():ca.getCenterY())/this.view.scale-(M?ca.origin.x:ca.origin.y)-(M?this.view.translate.x:this.view.translate.y))}else{var ma=this.getCellGeometry(D[W]);null!=ma&&this.flipChildren(D[W],M,M?ma.getCenterX()-ma.x:ma.getCenterY()-ma.y);N.push(D[W])}this.toggleCellStyles(M?mxConstants.STYLE_FLIPH:mxConstants.STYLE_FLIPV,!1,N);this.setCellStyles("legacyAnchorPoints","0",N)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(D,M){var N=null;if(null!=D&&0<D.length){this.model.beginUpdate();try{for(var W=0;W<-D.length;W++){var ca=this.model.getParent(D[W]);if(this.isTable(ca)){var ma=this.getCellGeometry(D[W]),pa=this.getCellGeometry(ca);null!=ma&&null!=pa&&(pa=pa.clone(),pa.height-=ma.height,this.model.setGeometry(ca,pa))}}var ua=this.selectParentAfterDelete?this.model.getParents(D):null;this.removeCells(D,M)}finally{this.model.endUpdate()}if(null!=ua)for(N=[],W=0;W<ua.length;W++)this.model.contains(ua[W])&&(this.model.isVertex(ua[W])||this.model.isEdge(ua[W]))&&N.push(ua[W])}return N};Graph.prototype.insertTableColumn=-function(D,M){var N=this.getModel();N.beginUpdate();try{var W=D,ca=0;if(this.isTableCell(D)){var ma=N.getParent(D);W=N.getParent(ma);ca=mxUtils.indexOf(N.getChildCells(ma,!0),D)}else this.isTableRow(D)?W=N.getParent(D):D=N.getChildCells(W,!0)[0],M||(ca=N.getChildCells(D,!0).length-1);var pa=N.getChildCells(W,!0),ua=Graph.minTableColumnWidth;for(D=0;D<pa.length;D++){var Aa=N.getChildCells(pa[D],!0)[ca],xa=N.cloneCell(Aa,!1);null==xa&&(xa=this.createVertex());var Ma=this.getCellGeometry(xa);xa.value=-null;xa.style=mxUtils.setStyle(mxUtils.setStyle(xa.style,"rowspan",null),"colspan",null);if(null!=Ma){null!=Ma.alternateBounds&&(Ma.width=Ma.alternateBounds.width,Ma.height=Ma.alternateBounds.height,Ma.alternateBounds=null);ua=Ma.width;var Wa=this.getCellGeometry(pa[D]);null!=Wa&&(Ma.height=Wa.height)}N.add(pa[D],xa,ca+(M?0:1))}var Za=this.getCellGeometry(W);null!=Za&&(Za=Za.clone(),Za.width+=ua,N.setGeometry(W,Za))}finally{N.endUpdate()}};Graph.prototype.deleteLane=function(D){var M=this.getModel();+D.length;W++){var ca=this.model.getParent(D[W]);if(this.isTable(ca)){var ma=this.getCellGeometry(D[W]),pa=this.getCellGeometry(ca);null!=ma&&null!=pa&&(pa=pa.clone(),pa.height-=ma.height,this.model.setGeometry(ca,pa))}}var va=this.selectParentAfterDelete?this.model.getParents(D):null;this.removeCells(D,M)}finally{this.model.endUpdate()}if(null!=va)for(N=[],W=0;W<va.length;W++)this.model.contains(va[W])&&(this.model.isVertex(va[W])||this.model.isEdge(va[W]))&&N.push(va[W])}return N};Graph.prototype.insertTableColumn=+function(D,M){var N=this.getModel();N.beginUpdate();try{var W=D,ca=0;if(this.isTableCell(D)){var ma=N.getParent(D);W=N.getParent(ma);ca=mxUtils.indexOf(N.getChildCells(ma,!0),D)}else this.isTableRow(D)?W=N.getParent(D):D=N.getChildCells(W,!0)[0],M||(ca=N.getChildCells(D,!0).length-1);var pa=N.getChildCells(W,!0),va=Graph.minTableColumnWidth;for(D=0;D<pa.length;D++){var Aa=N.getChildCells(pa[D],!0)[ca],xa=N.cloneCell(Aa,!1);null==xa&&(xa=this.createVertex());var Ma=this.getCellGeometry(xa);xa.value=+null;xa.style=mxUtils.setStyle(mxUtils.setStyle(xa.style,"rowspan",null),"colspan",null);if(null!=Ma){null!=Ma.alternateBounds&&(Ma.width=Ma.alternateBounds.width,Ma.height=Ma.alternateBounds.height,Ma.alternateBounds=null);va=Ma.width;var Wa=this.getCellGeometry(pa[D]);null!=Wa&&(Ma.height=Wa.height)}N.add(pa[D],xa,ca+(M?0:1))}var Za=this.getCellGeometry(W);null!=Za&&(Za=Za.clone(),Za.width+=va,N.setGeometry(W,Za))}finally{N.endUpdate()}};Graph.prototype.deleteLane=function(D){var M=this.getModel();M.beginUpdate();try{var N=null;N="stackLayout"==this.getCurrentCellStyle(D).childLayout?D:M.getParent(D);var W=M.getChildCells(N,!0);0==W.length?M.remove(N):(N==D&&(D=W[W.length-1]),M.remove(D))}finally{M.endUpdate()}};Graph.prototype.insertLane=function(D,M){var N=this.getModel();N.beginUpdate();try{var W=null;if("stackLayout"==this.getCurrentCellStyle(D).childLayout){W=D;var ca=N.getChildCells(W,!0);D=ca[M?0:ca.length-1]}else W=N.getParent(D);var ma=W.getIndex(D);D=N.cloneCell(D,!1);D.value=null;-N.add(W,D,ma+(M?0:1))}finally{N.endUpdate()}};Graph.prototype.insertTableRow=function(D,M){var N=this.getModel();N.beginUpdate();try{var W=D,ca=D;if(this.isTableCell(D))ca=N.getParent(D),W=N.getParent(ca);else if(this.isTableRow(D))W=N.getParent(D);else{var ma=N.getChildCells(W,!0);ca=ma[M?0:ma.length-1]}if(null!=ca){var pa=N.getChildCells(ca,!0),ua=W.getIndex(ca);ca=N.cloneCell(ca,!1);ca.value=null;var Aa=this.getCellGeometry(ca);if(null!=Aa){for(ma=0;ma<pa.length;ma++){D=N.cloneCell(pa[ma],!1);-D.value=null;D.style=mxUtils.setStyle(mxUtils.setStyle(D.style,"rowspan",null),"colspan",null);var xa=this.getCellGeometry(D);null!=xa&&(null!=xa.alternateBounds&&(xa.width=xa.alternateBounds.width,xa.height=xa.alternateBounds.height,xa.alternateBounds=null),xa.height=Aa.height);ca.insert(D)}N.add(W,ca,ua+(M?0:1));var Ma=this.getCellGeometry(W);null!=Ma&&(Ma=Ma.clone(),Ma.height+=Aa.height,N.setGeometry(W,Ma))}}else if(Ma=this.getCellGeometry(W),null!=Ma){var Wa=Ma.width;ca=this.createVertex(null,+N.add(W,D,ma+(M?0:1))}finally{N.endUpdate()}};Graph.prototype.insertTableRow=function(D,M){var N=this.getModel();N.beginUpdate();try{var W=D,ca=D;if(this.isTableCell(D))ca=N.getParent(D),W=N.getParent(ca);else if(this.isTableRow(D))W=N.getParent(D);else{var ma=N.getChildCells(W,!0);ca=ma[M?0:ma.length-1]}if(null!=ca){var pa=N.getChildCells(ca,!0),va=W.getIndex(ca);ca=N.cloneCell(ca,!1);ca.value=null;var Aa=this.getCellGeometry(ca);if(null!=Aa){for(ma=0;ma<pa.length;ma++){D=N.cloneCell(pa[ma],!1);+D.value=null;D.style=mxUtils.setStyle(mxUtils.setStyle(D.style,"rowspan",null),"colspan",null);var xa=this.getCellGeometry(D);null!=xa&&(null!=xa.alternateBounds&&(xa.width=xa.alternateBounds.width,xa.height=xa.alternateBounds.height,xa.alternateBounds=null),xa.height=Aa.height);ca.insert(D)}N.add(W,ca,va+(M?0:1));var Ma=this.getCellGeometry(W);null!=Ma&&(Ma=Ma.clone(),Ma.height+=Aa.height,N.setGeometry(W,Ma))}}else if(Ma=this.getCellGeometry(W),null!=Ma){var Wa=Ma.width;ca=this.createVertex(null,null,"",0,0,Wa,40,"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fixedHeader=1;");ca.insert(this.createVertex(null,null,"",0,0,Wa,40,"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;"));N.add(W,ca);Ma=Ma.clone();Ma.height+=40;N.setGeometry(W,-Ma)}}finally{N.endUpdate()}};Graph.prototype.deleteTableColumn=function(D){var M=this.getModel();M.beginUpdate();try{var N=D,W=D;this.isTableCell(D)&&(W=M.getParent(D));this.isTableRow(W)&&(N=M.getParent(W));var ca=M.getChildCells(N,!0);if(0==ca.length)M.remove(N);else{this.isTableRow(W)||(W=ca[0]);var ma=M.getChildCells(W,!0);if(1>=ma.length)M.remove(N);else{var pa=ma.length-1;this.isTableCell(D)&&(pa=mxUtils.indexOf(ma,D));for(W=D=0;W<ca.length;W++){var ua=M.getChildCells(ca[W],!0)[pa];M.remove(ua);-var Aa=this.getCellGeometry(ua);null!=Aa&&(D=Math.max(D,Aa.width))}var xa=this.getCellGeometry(N);null!=xa&&(xa=xa.clone(),xa.width-=D,M.setGeometry(N,xa))}}}finally{M.endUpdate()}};Graph.prototype.deleteTableRow=function(D){var M=this.getModel();M.beginUpdate();try{var N=D,W=D;this.isTableCell(D)&&(D=W=M.getParent(D));this.isTableRow(D)&&(N=M.getParent(W));var ca=M.getChildCells(N,!0);if(1>=ca.length)M.remove(N);else{this.isTableRow(W)||(W=ca[ca.length-1]);M.remove(W);D=0;var ma=this.getCellGeometry(W);+Ma)}}finally{N.endUpdate()}};Graph.prototype.deleteTableColumn=function(D){var M=this.getModel();M.beginUpdate();try{var N=D,W=D;this.isTableCell(D)&&(W=M.getParent(D));this.isTableRow(W)&&(N=M.getParent(W));var ca=M.getChildCells(N,!0);if(0==ca.length)M.remove(N);else{this.isTableRow(W)||(W=ca[0]);var ma=M.getChildCells(W,!0);if(1>=ma.length)M.remove(N);else{var pa=ma.length-1;this.isTableCell(D)&&(pa=mxUtils.indexOf(ma,D));for(W=D=0;W<ca.length;W++){var va=M.getChildCells(ca[W],!0)[pa];M.remove(va);+var Aa=this.getCellGeometry(va);null!=Aa&&(D=Math.max(D,Aa.width))}var xa=this.getCellGeometry(N);null!=xa&&(xa=xa.clone(),xa.width-=D,M.setGeometry(N,xa))}}}finally{M.endUpdate()}};Graph.prototype.deleteTableRow=function(D){var M=this.getModel();M.beginUpdate();try{var N=D,W=D;this.isTableCell(D)&&(D=W=M.getParent(D));this.isTableRow(D)&&(N=M.getParent(W));var ca=M.getChildCells(N,!0);if(1>=ca.length)M.remove(N);else{this.isTableRow(W)||(W=ca[ca.length-1]);M.remove(W);D=0;var ma=this.getCellGeometry(W);null!=ma&&(D=ma.height);var pa=this.getCellGeometry(N);null!=pa&&(pa=pa.clone(),pa.height-=D,M.setGeometry(N,pa))}}finally{M.endUpdate()}};Graph.prototype.insertRow=function(D,M){for(var N=D.tBodies[0],W=N.rows[0].cells,ca=D=0;ca<W.length;ca++){var ma=W[ca].getAttribute("colspan");D+=null!=ma?parseInt(ma):1}M=N.insertRow(M);for(ca=0;ca<D;ca++)mxUtils.br(M.insertCell(-1));return M.cells[0]};Graph.prototype.deleteRow=function(D,M){D.tBodies[0].deleteRow(M)};Graph.prototype.insertColumn=function(D,M){var N=D.tHead;if(null!=N)for(var W=0;W<N.rows.length;W++){var ca=document.createElement("th");N.rows[W].appendChild(ca);mxUtils.br(ca)}D=D.tBodies[0];for(N=0;N<D.rows.length;N++)W=D.rows[N].insertCell(M),mxUtils.br(W);return D.rows[0].cells[0<=M?M:D.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(D,M){if(0<=M){D=D.tBodies[0].rows;for(var N=0;N<D.length;N++)D[N].cells.length>M&&D[N].deleteCell(M)}};Graph.prototype.pasteHtmlAtCaret=function(D){if(window.getSelection){var M=window.getSelection();if(M.getRangeAt&&M.rangeCount){M=M.getRangeAt(0);M.deleteContents();var N=document.createElement("div");N.innerHTML=D;D=document.createDocumentFragment();for(var W;W=N.firstChild;)lastNode=D.appendChild(W);M.insertNode(D)}}else(M=document.selection)&&"Control"!=M.type&&M.createRange().pasteHTML(D)};Graph.prototype.createLinkForHint=function(D,M,N){function W(ma,pa){ma.length>pa&&(ma=ma.substring(0,Math.round(pa/2))+"..."+ma.substring(ma.length-Math.round(pa/4)));return ma}D=null!=D?D:"javascript:void(0);";if(null==M||0==M.length)M=this.isCustomLink(D)?this.getLinkTitle(D):D;var ca=document.createElement("a");ca.setAttribute("rel",this.linkRelation);ca.setAttribute("href",this.getAbsoluteUrl(D));ca.setAttribute("title",W(this.isCustomLink(D)?this.getLinkTitle(D):D,80));null!=this.linkTarget&&ca.setAttribute("target",this.linkTarget);mxUtils.write(ca,W(M,40));this.isCustomLink(D)&&mxEvent.addListener(ca,"click",mxUtils.bind(this,function(ma){this.customLinkClicked(D,N);mxEvent.consume(ma)}));return ca};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(ma,pa){this.popupMenuHandler.hideMenu()});var D=this.updateMouseEvent;this.updateMouseEvent=function(ma){ma=D.apply(this,arguments);if(mxEvent.isTouchEvent(ma.getEvent())&&null==ma.getState()){var pa=this.getCellAt(ma.graphX,ma.graphY);null!=pa&&this.isSwimlane(pa)&&this.hitsSwimlaneContent(pa,ma.graphX,ma.graphY)||-(ma.state=this.view.getState(pa),null!=ma.state&&null!=ma.state.shape&&(this.container.style.cursor=ma.state.shape.node.style.cursor))}null==ma.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return ma};var M=!1,N=!1,W=!1,ca=this.fireMouseEvent;this.fireMouseEvent=function(ma,pa,ua){ma==mxEvent.MOUSE_DOWN&&(pa=this.updateMouseEvent(pa),M=this.isCellSelected(pa.getCell()),N=this.isSelectionEmpty(),W=this.popupMenuHandler.isMenuShowing());ca.apply(this,arguments)};this.popupMenuHandler.mouseUp=-mxUtils.bind(this,function(ma,pa){if(null!=this.freehand&&!this.freehand.isDrawing()){var ua=mxEvent.isMouseEvent(pa.getEvent());this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==pa.getState()||!pa.isSource(pa.getState().control))&&(this.popupMenuHandler.popupTrigger||!W&&!ua&&(N&&null==pa.getCell()&&this.isSelectionEmpty()||M&&this.isCellSelected(pa.getCell())));ua=!M||ua?null:mxUtils.bind(this,function(Aa){window.setTimeout(mxUtils.bind(this,function(){if(!this.isEditing()&&-this.isTouchPopupMenuEnabled()){var xa=mxUtils.getScrollOrigin();this.popupMenuHandler.popup(pa.getX()+xa.x+1,pa.getY()+xa.y+1,Aa,pa.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[ma,pa,ua])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0};mxCellEditor.prototype.isContentEditing=function(){var D=this.graph.view.getState(this.editingCell);return null!=D&&1==D.style.html};mxCellEditor.prototype.isTableSelected=function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),+(ma.state=this.view.getState(pa),null!=ma.state&&null!=ma.state.shape&&(this.container.style.cursor=ma.state.shape.node.style.cursor))}null==ma.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return ma};var M=!1,N=!1,W=!1,ca=this.fireMouseEvent;this.fireMouseEvent=function(ma,pa,va){ma==mxEvent.MOUSE_DOWN&&(pa=this.updateMouseEvent(pa),M=this.isCellSelected(pa.getCell()),N=this.isSelectionEmpty(),W=this.popupMenuHandler.isMenuShowing());ca.apply(this,arguments)};this.popupMenuHandler.mouseUp=+mxUtils.bind(this,function(ma,pa){if(null!=this.freehand&&!this.freehand.isDrawing()){var va=mxEvent.isMouseEvent(pa.getEvent());this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==pa.getState()||!pa.isSource(pa.getState().control))&&(this.popupMenuHandler.popupTrigger||!W&&!va&&(N&&null==pa.getCell()&&this.isSelectionEmpty()||M&&this.isCellSelected(pa.getCell())));va=!M||va?null:mxUtils.bind(this,function(Aa){window.setTimeout(mxUtils.bind(this,function(){if(!this.isEditing()&&+this.isTouchPopupMenuEnabled()){var xa=mxUtils.getScrollOrigin();this.popupMenuHandler.popup(pa.getX()+xa.x+1,pa.getY()+xa.y+1,Aa,pa.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[ma,pa,va])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0};mxCellEditor.prototype.isContentEditing=function(){var D=this.graph.view.getState(this.editingCell);return null!=D&&1==D.style.html};mxCellEditor.prototype.isTableSelected=function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};mxCellEditor.prototype.isTextSelected=function(){var D="";window.getSelection?D=window.getSelection():document.getSelection?D=document.getSelection():document.selection&&(D=document.selection.createRange().text);return""!=D};mxCellEditor.prototype.insertTab=function(D){var M=this.textarea.ownerDocument.defaultView.getSelection(),N=M.getRangeAt(0);D=Graph.createTabNode(D);N.insertNode(D);N.setStartAfter(D);N.setEndAfter(D);M.removeAllRanges();M.addRange(N)};mxCellEditor.prototype.alignText=function(D,M){var N=this.graph.getView().getState(this.editingCell);if(null!=N){N=mxUtils.getValue(N.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);var W=null!=N&&"vertical-"==N.substring(0,9),ca=null!=M&&mxEvent.isShiftDown(M);if(ca||null!=window.getSelection&&null!=window.getSelection().containsNode){var ma=!0;this.graph.processElements(this.textarea,function(pa){ca||W||window.getSelection().containsNode(pa,!0)?(pa.removeAttribute("align"),pa.style.textAlign=null):ma=!1});(ma||W)&&this.graph.cellEditor.setAlign(D)}W||document.execCommand("justify"+D.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var D=window.getSelection();if(D.getRangeAt&&D.rangeCount){for(var M=[],N=0,W=D.rangeCount;N<W;++N)M.push(D.getRangeAt(N));return M}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(D){try{if(D)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var M=0,N=D.length;M<N;++M)sel.addRange(D[M])}else document.selection&&D.select&&D.select()}catch(W){}};var fa=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(D){null!=D.text&&(D.text.replaceLinefeeds="0"!=mxUtils.getValue(D.style,"nl2Br","1"));fa.apply(this,arguments)};var aa=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(D,M){this.isKeepFocusEvent(D)||!mxEvent.isAltDown(D.getEvent())?aa.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(D){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var da=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(D,M){D=this.graph.getStartEditingCell(D,M);da.apply(this,arguments);var N=this.graph.view.getState(D);this.textarea.className=null!=N&&1==N.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";Graph.browserTranslate&&(this.textarea.classList.add("notranslate"),this.textarea.setAttribute("translate","no"));this.textarea.style.colorScheme="none"==this.graph.getAdaptiveColors()?"light":"";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(D);null!=this.editingCell&&null!=this.textarea&&null!=this.textarea.parentNode&&null!=N&&this.graph.isAutosizeTextState(N)&&this.resize()};mxCellEditor.prototype.toggleViewMode=function(){var D=this.graph.view.getState(this.editingCell);-if(null!=D){var M=null!=D&&"0"!=mxUtils.getValue(D.style,"nl2Br","1"),N=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);ua=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<ua.length&&"\n"==ua.charAt(ua.length-1)&&(ua=ua.substring(0,ua.length-1));ua=Graph.sanitizeHtml(M?ua.replace(/\n/g,"<br/>"):ua,!0);this.textarea.className="mxCellEditor geContentEditable";Aa=mxUtils.getValue(D.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);+if(null!=D){var M=null!=D&&"0"!=mxUtils.getValue(D.style,"nl2Br","1"),N=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);va=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<va.length&&"\n"==va.charAt(va.length-1)&&(va=va.substring(0,va.length-1));va=Graph.sanitizeHtml(M?va.replace(/\n/g,"<br/>"):va,!0);this.textarea.className="mxCellEditor geContentEditable";Aa=mxUtils.getValue(D.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);M=mxUtils.getValue(D.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var W=mxUtils.getValue(D.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),ca=(mxUtils.getValue(D.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,ma=(mxUtils.getValue(D.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,pa=[];(mxUtils.getValue(D.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&pa.push("underline");(mxUtils.getValue(D.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&pa.push("line-through");0<pa.length&&(mxUtils.getValue(D.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&pa.push("dotted");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(Aa*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(Aa)+-"px";this.textarea.style.textDecoration=pa.join(" ");this.textarea.style.fontWeight=ca?"bold":"normal";this.textarea.style.fontStyle=ma?"italic":"";this.textarea.style.fontFamily=M;this.textarea.style.textAlign=W;this.textarea.style.padding="0px";this.textarea.innerHTML!=ua&&(this.textarea.innerHTML=ua,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,-"simple"==this.graph.getAdaptiveColors());this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerText="");Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var ua=mxUtils.htmlEntities(this.textarea.innerHTML);8!=document.documentMode&&(ua=mxUtils.replaceTrailingNewlines(ua,"<div><br></div>"));ua=Graph.sanitizeHtml(M?ua.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):ua,!0);this.textarea.className=+"px";this.textarea.style.textDecoration=pa.join(" ");this.textarea.style.fontWeight=ca?"bold":"normal";this.textarea.style.fontStyle=ma?"italic":"";this.textarea.style.fontFamily=M;this.textarea.style.textAlign=W;this.textarea.style.padding="0px";this.textarea.innerHTML!=va&&(this.textarea.innerHTML=va,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,+"simple"==this.graph.getAdaptiveColors());this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerText="");Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var va=mxUtils.htmlEntities(this.textarea.innerHTML);8!=document.documentMode&&(va=mxUtils.replaceTrailingNewlines(va,"<div><br></div>"));va=Graph.sanitizeHtml(M?va.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):va,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var Aa=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(Aa*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(Aa)+"px";this.textarea.style.textDecoration="";this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.width="";this.textarea.style.padding=-"2px";this.textarea.innerHTML!=ua&&(this.textarea.innerHTML=ua);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=N;this.resize()}};var ba=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(D,M){if(null!=this.textarea)if(D=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=D){var N=D.view.scale;this.bounds=mxRectangle.fromRectangle(D);if(0==this.bounds.width&&+"2px";this.textarea.innerHTML!=va&&(this.textarea.innerHTML=va);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=N;this.resize()}};var ba=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(D,M){if(null!=this.textarea)if(D=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=D){var N=D.view.scale;this.bounds=mxRectangle.fromRectangle(D);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*N;this.bounds.height=60*N;var W=null!=D.text?D.text.margin:null;null==W&&(W=mxUtils.getAlignmentAsPoint(mxUtils.getValue(D.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(D.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=W.x*this.bounds.width;this.bounds.y+=W.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/N)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/N)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/N)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*N);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/N)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*N);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px";mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+N+","+N+")")}else if(null!=D&&this.graph.isAutosizeTextState(D)){N=D.view.scale;W=D.style;var ca=this.graph.getCellGeometry(this.editingCell);if(null!=ca){this.bounds=mxRectangle.fromRectangle(D);this.textarea.style.left=Math.round(D.x)+"px";this.textarea.style.top=Math.round(D.y)+"px";var ma=this.rotateText&&null!=this.textShape?this.textShape.getTextRotation():0;mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform",(0!=ma?"rotate("+ma+"deg) ":"")+"scale("+N+","+N+")");this.textarea.style.borderWidth="0";this.textarea.style.width=Math.round(ca.width+mxSvgCanvas2D.prototype.foreignObjectPadding)+"px";this.textarea.style.height=Math.round(ca.height)+"px";this.textarea.style.overflow="hidden";this.textarea.style.boxSizing="border-box";"wrap"==W[mxConstants.STYLE_WHITE_SPACE]&&-(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal");var pa=parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING,2));N=pa+parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING_TOP,0));ma=pa+parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING_BOTTOM,0));var ua=pa+parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING_LEFT,0));pa+=parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING_RIGHT,0));this.textarea.style.paddingLeft=Math.round(ua)+"px";this.textarea.style.paddingRight=+(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal");var pa=parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING,2));N=pa+parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING_TOP,0));ma=pa+parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING_BOTTOM,0));var va=pa+parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING_LEFT,0));pa+=parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING_RIGHT,0));this.textarea.style.paddingLeft=Math.round(va)+"px";this.textarea.style.paddingRight=Math.round(pa)+"px";this.textarea.style.paddingTop=Math.round(N)+"px";this.textarea.style.paddingBottom=Math.round(ma)+"px";this.textarea.style.display="table-cell";this.textarea.style.flexDirection="";this.textarea.style.justifyContent="";N=mxUtils.getValue(W,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);this.textarea.style.verticalAlign=N==mxConstants.ALIGN_MIDDLE?"middle":N==mxConstants.ALIGN_BOTTOM?"bottom":"top";N=this.textarea.innerText;null!=N&&0<N.length&&(ca=this.graph.getAutosizeTextAvailableSpace(W,ca.width,ca.height,D),null!=ca&&(N=mxUtils.htmlEntities(N,!1).replace(/\n/g,"<br>"),W=this.graph.computeAutosizeTextFontSize(N,ca.availW,ca.availH,W[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,W[mxConstants.STYLE_FONTSTYLE],"wrap"==W[mxConstants.STYLE_WHITE_SPACE]),this.textarea.style.fontSize=W+"px",this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?W*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT))}}else this.textarea.style.width="",this.textarea.style.height="",this.textarea.style.overflow="",this.textarea.style.boxSizing="",this.textarea.style.borderWidth="",this.textarea.style.paddingTop="",this.textarea.style.paddingBottom="",this.textarea.style.paddingLeft="",this.textarea.style.paddingRight="",this.textarea.style.display="",this.textarea.style.flexDirection="",this.textarea.style.justifyContent="",this.textarea.style.verticalAlign="",ba.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=@@ -2963,60 +2963,61 @@ Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};mxCellEditvar qa=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(D,M){this.graph.getModel().beginUpdate();try{qa.apply(this,arguments),""==M&&this.graph.isCellDeletable(D.cell)&&0==this.graph.model.getChildCount(D.cell)&&this.graph.isTransparentState(D)&&this.graph.removeCells([D.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(D){D=mxUtils.getValue(D.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);D==mxConstants.NONE&&(D=null);return D};mxCellEditor.prototype.getBorderColor=function(D){D=mxUtils.getValue(D.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);D==mxConstants.NONE&&(D=null);return D};mxCellEditor.prototype.getMinimumSize=function(D){var M=this.graph.getView().scale;return new mxRectangle(0,0,null==D.text?30:D.text.size*M+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(D,M){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(M.getEvent)};var ra=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(D){var M=ra.apply(this,arguments);if(null!=M){var N=this.graph.getLockedGroupAncestor(this.graph.model.getParent(M));null!=N&&(M=N)}return M};var l=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(D,M,N){var W=this.graph.model.getParent(D);if(null!=W){if(this.graph.isSelectParentFirst(W))return!this.graph.isCellSelected(W)&&-!this.graph.isSiblingSelected(D);if(this.graph.isTransparentBounds(W))return!1}return l.apply(this,arguments)};var t=mxConstraintHandler.prototype.getCellForEvent;mxConstraintHandler.prototype.getCellForEvent=function(D,M){var N=t.apply(this,arguments);if(null!=N&&(null==this.currentFocus||this.currentFocus.cell!=N)){var W=this.graph.getBorderContainer(N,null!=M?M.x:D.getGraphX(),null!=M?M.y:D.getGraphY());null!=W&&(N=W)}return N};var H=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=-function(){for(var D=H.apply(this,arguments),M=this.graph,N=new mxDictionary,W=[],ca=0;ca<D.length;ca++)null==N.get(D[ca])&&(N.put(D[ca],!0),W.push(D[ca]));for(ca=0;ca<D.length;ca++)for(var ma=M.model.getParent(D[ca]);null!=ma&&M.isTransparentBounds(ma);)null==N.get(ma)&&(N.put(ma,!0),W.push(ma)),ma=M.model.getParent(ma);return W};mxGraphView.prototype.formatUnitText=function(D){return D?d(D,this.unit):D};mxGraphHandler.prototype.updateHint=function(D){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==-this.hint&&(this.hint=b(),this.graph.container.appendChild(this.hint));var M=this.graph.view.translate,N=this.graph.view.scale;D=this.roundLength((this.bounds.x+this.currentDx)/N-M.x);M=this.roundLength((this.bounds.y+this.currentDy)/N-M.y);N=this.graph.view.unit;this.hint.innerHTML=d(D,N)+", "+d(M,N);this.hint.style.left=this.pBounds.x+this.currentDx+Math.round((this.pBounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.pBounds.y+this.currentDy+this.pBounds.height+Editor.hintOffset+-"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(null!=this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint),this.hint=null)};var J=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(D,M){J.apply(this,arguments);var N=this.graph.getCellStyle(D);if(null==N.childLayout){var W=this.graph.model.getParent(D),ca=null!=W?this.graph.getCellGeometry(W):null;if(null!=ca&&(N=this.graph.getCellStyle(W),"stackLayout"==N.childLayout)){var ma=parseFloat(mxUtils.getValue(N,-"stackBorder",mxStackLayout.prototype.border));N="1"==mxUtils.getValue(N,"horizontalStack","1");var pa=this.graph.getActualStartSize(W);ca=ca.clone();N?ca.height=M.height+pa.y+pa.height+2*ma:ca.width=M.width+pa.x+pa.width+2*ma;this.graph.model.setGeometry(W,ca)}}};var R=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function D(ua){N.get(ua)||(N.put(ua,!0),ca.push(ua))}for(var M=R.apply(this,arguments),N=new mxDictionary,-W=this.graph.model,ca=[],ma=0;ma<M.length;ma++){var pa=M[ma];this.graph.isTableCell(pa)?D(W.getParent(W.getParent(pa))):this.graph.isTableRow(pa)&&D(W.getParent(pa));D(pa)}return ca};var T=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(D){return T.apply(this,arguments)&&!mxEvent.isControlDown(D.getEvent())&&!mxEvent.isShiftDown(D.getEvent())};var Y=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return Y.apply(this,-arguments)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};var Z=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(D){var M=Z.apply(this,arguments);M.stroke="#C0C0C0";M.strokewidth=1;var N=this.graph.model.getParent(this.state.cell);null!=N&&this.graph.isTransparentBounds(N)&&(M.isDashed=!0);return M};var ia=mxVertexHandler.prototype.isSelectionDashed;-mxVertexHandler.prototype.isSelectionDashed=function(){return this.graph.isTransparentBounds(this.state.cell)?!0:ia.apply(this,arguments)};var ka=mxVertexHandler.prototype.getSelectionColor;mxVertexHandler.prototype.getSelectionColor=function(){return this.graph.isTransparentBounds(this.state.cell)&&!this.graph.isCellSelected(this.state.cell)?"#C0C0C0":ka.apply(this,arguments)};var X=mxVertexHandler.prototype.updateParentHighlight;mxVertexHandler.prototype.updateParentHighlight=function(){X.apply(this,-arguments);null!=this.selectionBorder&&this.graph.isTransparentBounds(this.state.cell)&&(this.selectionBorder.stroke=this.getSelectionColor(),this.selectionBorder.redraw())};var ja=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(D){var M=ja.apply(this,arguments);M.stroke="#C0C0C0";M.strokewidth=1;return M};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var D=this.getHandlePadding();-return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+D.x/2,this.bounds.y+this.rotationHandleVSpacing-D.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(D,M){return this.graph.isRecursiveVertexResize(D)&&!mxEvent.isAltDown(M.getEvent())};var na=mxVertexHandler.prototype.resizeCell;mxVertexHandler.prototype.resizeCell=function(D,M,N,W,ca,ma,pa){pa&&this.graph.isRotatedGroupResize(D)&&(this.childOffsetY=this.childOffsetX=0);na.apply(this,arguments)};mxVertexHandler.prototype.isCenteredEvent=-function(D,M){return mxEvent.isControlDown(M.getEvent())||mxEvent.isMetaDown(M.getEvent())};var la=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return la.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTransparentBounds(this.state.cell)&&"1"!=mxUtils.getValue(this.state.style,"labelAutoRotate","0")};mxVertexHandler.prototype.isConnectHandleVisible=-function(){return this.graph.isConnectIconVisible(this.state.cell)&&this.graph.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing=-12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var D=this.getHandlePadding(),M=this.graph,N=M.getNestedCornerIconOffset(this.state.cell,this.bounds.x+this.bounds.width,this.bounds.y+-this.bounds.height,function(W){return M.isConnectIconVisible(W)&&M.isEnabled()&&M.isCellConnectable(W)&&!M.isTableCell(W)&&!M.isTableRow(W)&&!M.isTable(W)});return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing+D.x/2+N,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+D.y/2+N)};mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):-this.bounds};var va=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){var D=this.graph.model.getParent(this.state.cell);return null!=D&&this.graph.isTransparentBounds(D)?!1:va.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var za=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(D){return D.tableHandle||D.lockHandle||D.editIconHandle||-D.moveGroupHandle||za.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=function(){var D=0;this.graph.isTransparentBounds(this.state.cell)?D=-this.graph.getNestedTransparentBoundsCount(this.state.cell):this.graph.isTableRow(this.state.cell)?D=1:this.graph.isTableCell(this.state.cell)&&(D=2);return D};var sa=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=-function(){return sa.apply(this,arguments).grow(-this.getSelectionBorderInset())};var wa=null,Ca=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==wa&&(wa=mxCellRenderer.defaultShapes.tableLine);var D=Ca.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var M=function(cb,fb,Xa){for(var wb=[],sb=0;sb<cb.length;sb++){var qb=cb[sb];wb.push(null==qb?null:new mxPoint((Aa+qb.x+fb)*ma,(xa+qb.y+-Xa)*ma))}return wb},N=this,W=this.graph,ca=W.model,ma=W.view.scale,pa=this.state,ua=this.selectionBorder,Aa=this.state.origin.x+W.view.translate.x,xa=this.state.origin.y+W.view.translate.y;null==D&&(D=[]);var Ma=W.view.getCellStates(ca.getChildCells(this.state.cell,!0));if(0<Ma.length){var Wa=ca.getChildCells(Ma[0].cell,!0),Za=W.getTableLines(this.state.cell,!1,!0),pb=W.getTableLines(this.state.cell,!0,!1);for(ca=0;ca<Ma.length;ca++)mxUtils.bind(this,function(cb){var fb=Ma[cb],Xa=null;if(W.isCellMovable(fb.cell)){Xa=-cb<Ma.length-1?Ma[cb+1]:null;Xa=null!=Xa?W.getCellGeometry(Xa.cell):null;var wb=null!=Xa&&null!=Xa.alternateBounds?Xa.alternateBounds:Xa;Xa=null!=pb[cb]?new wa(pb[cb],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Xa.isDashed=ua.isDashed;Xa.svgStrokeTolerance++;Xa=new mxHandle(fb,"row-resize",null,Xa);Xa.tableHandle=!0;var sb=0;Xa.shape.node.parentNode.insertBefore(Xa.shape.node,Xa.shape.node.parentNode.firstChild);Xa.redraw=function(){if(null!=this.shape){this.shape.stroke=-0==sb?mxConstants.NONE:ua.stroke;if(this.shape.constructor==wa)this.shape.line=M(pb[cb],0,sb),this.shape.updateBoundsFromLine();else{var qb=W.getActualStartSize(pa.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+sb*ma;this.shape.bounds.x=pa.x+(cb==Ma.length-1?0:qb.x*ma);this.shape.bounds.width=pa.width-(cb==Ma.length-1?0:qb.width+qb.x+ma)}this.shape.redraw()}};Xa.setPosition=function(qb,zb,Fb){sb=Math.max(Graph.minTableRowHeight-qb.height,zb.y-qb.y-qb.height);-null!=wb&&mxEvent.isShiftDown(Fb.getEvent())&&(sb=Math.min(sb,wb.height-Graph.minTableRowHeight))};Xa.execute=function(qb){if(0!=sb){var zb=mxEvent.isShiftDown(qb.getEvent());(qb=mxEvent.isControlDown(qb.getEvent())||mxEvent.isMetaDown(qb.getEvent()))&&zb?W.distributeRows(pa.cell):qb?W.resizeAllTableRows(pa.cell,sb):W.setTableRowHeight(this.state.cell,sb,!zb)}else N.blockDelayedSelection||(zb=W.getCellAt(qb.getGraphX(),qb.getGraphY())||pa.cell,W.graphHandler.selectCellForEvent(zb,qb));sb=0};Xa.reset=-function(){sb=0}}D.push(Xa)})(ca);for(ca=0;ca<Wa.length;ca++)mxUtils.bind(this,function(cb){var fb=W.view.getState(Wa[cb]),Xa=W.getCellGeometry(Wa[cb]),wb=null!=Xa.alternateBounds?Xa.alternateBounds:Xa;null==fb&&(fb=new mxCellState(W.view,Wa[cb],W.getCellStyle(Wa[cb])),fb.x=pa.x+Xa.x*ma,fb.y=pa.y+Xa.y*ma,fb.width=wb.width*ma,fb.height=wb.height*ma,fb.updateCachedBounds());Xa=cb<Wa.length-1?Wa[cb+1]:null;Xa=null!=Xa?W.getCellGeometry(Xa):null;var sb=null!=Xa&&null!=Xa.alternateBounds?Xa.alternateBounds:-Xa;Xa=null!=Za[cb]?new wa(Za[cb],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Xa.isDashed=ua.isDashed;Xa.svgStrokeTolerance++;fb=new mxHandle(fb,"col-resize",null,Xa);fb.tableHandle=!0;var qb=0;fb.shape.node.parentNode.insertBefore(fb.shape.node,fb.shape.node.parentNode.firstChild);fb.redraw=function(){if(null!=this.shape){this.shape.stroke=0==qb?mxConstants.NONE:ua.stroke;if(this.shape.constructor==wa)this.shape.line=M(Za[cb],qb,0),this.shape.updateBoundsFromLine();else{var zb=-W.getActualStartSize(pa.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(wb.width+qb)*ma;this.shape.bounds.y=pa.y+(cb==Wa.length-1?0:zb.y*ma);this.shape.bounds.height=pa.height-(cb==Wa.length-1?0:(zb.height+zb.y)*ma)}this.shape.redraw()}};fb.setPosition=function(zb,Fb,Jb){qb=Math.max(Graph.minTableColumnWidth-wb.width,Fb.x-zb.x-wb.width);null!=sb&&mxEvent.isShiftDown(Jb.getEvent())&&(qb=Math.min(qb,sb.width-Graph.minTableColumnWidth))};fb.execute=function(zb){if(0!=qb){var Fb=-mxEvent.isShiftDown(zb.getEvent());(zb=mxEvent.isControlDown(zb.getEvent())||mxEvent.isMetaDown(zb.getEvent()))&&Fb?W.distributeColumns(pa.cell):zb?W.resizeAllTableColumns(pa.cell,qb):W.setTableColumnWidth(this.state.cell,qb,!Fb)}else N.blockDelayedSelection||(Fb=W.getCellAt(zb.getGraphX(),zb.getGraphY())||pa.cell,W.graphHandler.selectCellForEvent(Fb,zb));qb=0};fb.positionChanged=function(){};fb.reset=function(){qb=0};D.push(fb)})(ca)}}if(this.graph.isLockedGroupIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){null==-D&&(D=[]);N=this;W=this.graph;var rb=this.state.cell,tb=16,ob=this.graph.isLockedGroup(rb);ca=new mxImageShape(new mxRectangle(0,0,tb,tb),(ob?HoverIcons.prototype.lockHandle:HoverIcons.prototype.unlockHandle).src);ca.preserveImageAspect=!1;ca=new mxHandle(this.state,"pointer",null,ca);ca.lockHandle=!0;ca.setPosition=function(){};ca.positionChanged=function(){};ca.reset=function(){};ca.redraw=function(){if(null!=this.shape){var cb=N.getHandlePadding(),fb=W.getNestedCornerIconOffset(rb,N.bounds.x,N.bounds.y,-function(sb){return W.isLockedGroupIconVisible(sb)&&W.isCellMovable(sb)});cb=new mxPoint(N.bounds.x-12-cb.x/2-fb,N.bounds.y-12-cb.y/2-fb);W.isMoveIconVisible(rb)&&W.isCellMovable(rb)&&(cb.y+=24);fb=Number(null!=N.currentAlpha?N.currentAlpha:N.state.style[mxConstants.STYLE_ROTATION]||"0");var Xa=mxUtils.toRadians(fb);if(0!=Xa){var wb=new mxPoint(N.state.getCenterX(),N.state.getCenterY());cb=mxUtils.getRotatedPoint(cb,Math.cos(Xa),Math.sin(Xa),wb)}this.shape.bounds.width=tb;this.shape.bounds.height=-tb;this.shape.bounds.x=cb.x-tb/2;this.shape.bounds.y=cb.y-tb/2;this.shape.rotation=fb;this.shape.redraw()}};ca.execute=function(cb){W.getModel().beginUpdate();try{W.setCellStyles("lockedGroup",ob?"0":"1",[rb])}finally{W.getModel().endUpdate()}if(!ob){cb=W.getSelectionCells();for(var fb=[],Xa=0;Xa<cb.length;Xa++)cb[Xa]!=rb&&W.model.isAncestor(rb,cb[Xa])||fb.push(cb[Xa]);fb.length!=cb.length&&W.setSelectionCells(0<fb.length?fb:[rb])}};D.push(ca)}this.graph.isEditIconVisible(this.state.cell)&&(null==-D&&(D=[]),N=this,W=this.graph,rb=this.state.cell,tb=16,ca=new mxImageShape(new mxRectangle(0,0,tb,tb),HoverIcons.prototype.editHandle.src),ca.preserveImageAspect=!1,ca=new mxHandle(this.state,"pointer",null,ca),ca.editIconHandle=!0,ca.setPosition=function(){},ca.positionChanged=function(){},ca.reset=function(){},ca.redraw=function(){if(null!=this.shape){var cb=N.getHandlePadding(),fb=W.getNestedCornerIconOffset(rb,N.bounds.x,N.bounds.y,function(sb){return W.isEditIconVisible(sb)});cb=new mxPoint(N.bounds.x--12-cb.x/2-fb,N.bounds.y-12-cb.y/2-fb);W.isCellMovable(rb)&&(W.isLockedGroupIconVisible(rb)||W.isMoveIconVisible(rb))&&(cb.x+=24);fb=Number(null!=N.currentAlpha?N.currentAlpha:N.state.style[mxConstants.STYLE_ROTATION]||"0");var Xa=mxUtils.toRadians(fb);if(0!=Xa){var wb=new mxPoint(N.state.getCenterX(),N.state.getCenterY());cb=mxUtils.getRotatedPoint(cb,Math.cos(Xa),Math.sin(Xa),wb)}this.shape.bounds.width=tb;this.shape.bounds.height=tb;this.shape.bounds.x=cb.x-tb/2;this.shape.bounds.y=cb.y-tb/2;this.shape.rotation=-fb;this.shape.redraw()}},ca.execute=function(cb){W.startEditingAtCell(rb)},D.push(ca));this.graph.isMoveIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&(null==D&&(D=[]),N=this,W=this.graph,rb=this.state.cell,tb=16,ca=new mxImageShape(new mxRectangle(0,0,tb,tb),HoverIcons.prototype.moveHandle.src),ca.preserveImageAspect=!1,ca=new mxHandle(this.state,"move",null,ca),ca.moveGroupHandle=!0,ca.setPosition=function(){},ca.positionChanged=function(){},ca.execute=function(){},ca.reset=-function(){},ca.redraw=function(){if(null!=this.shape){var cb=N.getHandlePadding(),fb=W.getNestedCornerIconOffset(rb,N.bounds.x,N.bounds.y,function(wb){return W.isMoveIconVisible(wb)&&W.isCellMovable(wb)}),Xa=N.bounds.x-12-cb.x/2-fb;cb=N.bounds.y-12-cb.y/2-fb;this.shape.bounds.width=tb;this.shape.bounds.height=tb;this.shape.bounds.x=Xa-tb/2;this.shape.bounds.y=cb-tb/2;this.shape.redraw()}},D.push(ca));return null!=D?D.reverse():null};var Fa=mxVertexHandler.prototype.setHandlesVisible,Ha=mxVertexHandler.prototype.start;-mxVertexHandler.prototype.start=function(D,M,N){Ha.apply(this,arguments);var W=this.graph;if(null!=this.parentState&&W.isTransparentBounds(this.parentState.cell)){var ca=W.view.scale,ma=W.view.translate,pa=this.parentState;this.parentState=pa.clone();this.parentState.x=ca*(ma.x+pa.origin.x);this.parentState.y=ca*(ma.y+pa.origin.y)}for(ca=W.model.getParent(this.state.cell);null!=ca;)W.isTransparentBounds(ca)&&(ma=W.selectionCellsHandler.getHandler(ca),null!=ma&&null!=ma.selectionBorder&&(ma.selectionBorder.node.style.visibility=-"hidden")),ca=W.model.getParent(ca);if(!this.livePreviewActive&&null==this.ghostPreview&&null!=this.index&&this.index!=mxEvent.LABEL_HANDLE&&null!=this.sizers){for(W=0;W<this.sizers.length;W++)null!=this.sizers[W]&&W!=this.index&&(this.sizers[W].node.style.display="none");null!=this.rotationShape&&this.index!=mxEvent.ROTATION_HANDLE&&(this.rotationShape.node.style.visibility="hidden");this.resizeHandlesHidden=!0}};var Na=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){if(this.resizeHandlesHidden){if(null!=-this.sizers)for(var D=0;D<this.sizers.length;D++)null!=this.sizers[D]&&(this.sizers[D].node.style.display="");null!=this.rotationShape&&(this.rotationShape.node.style.visibility="");this.resizeHandlesHidden=null}D=this.graph;for(var M=null!=this.state?D.model.getParent(this.state.cell):null;null!=M;){if(D.isTransparentBounds(M)){var N=D.selectionCellsHandler.getHandler(M);null!=N&&null!=N.selectionBorder&&(N.selectionBorder.node.style.visibility="")}M=D.model.getParent(M)}Na.apply(this,arguments)};-mxVertexHandler.prototype.setHandlesVisible=function(D){Fa.apply(this,arguments);if(null!=this.moveHandles)for(var M=0;M<this.moveHandles.length;M++)null!=this.moveHandles[M]&&(this.moveHandles[M].node.style.visibility=D?"":"hidden");if(null!=this.cornerHandles)for(M=0;M<this.cornerHandles.length;M++)this.cornerHandles[M].node.style.visibility=D?"":"hidden";this.graph.isTransparentBounds(this.state.cell)&&null!=this.selectionBorder&&(this.selectionBorder.node.style.visibility=D?"":"hidden")};mxVertexHandler.prototype.isMoveHandlesVisible=-function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};mxVertexHandler.prototype.refreshMoveHandles=function(){var D=this.isMoveHandlesVisible();D&&null==this.moveHandles?this.moveHandles=this.createMoveHandles():D||null==this.moveHandles||this.destroyMoveHandles();if(D&&null==this.moveHandles){for(D=0;D<this.moveHandles.length;D++)null!=this.moveHandles[D]&&this.moveHandles[D].parentNode.removeChild(this.moveHandles[D]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=-function(){for(var D=this.graph,M=D.model,N=[],W=0;W<M.getChildCount(this.state.cell);W++)mxUtils.bind(this,function(ca){if(null!=ca&&M.isVertex(ca.cell)&&D.isCellMovable(ca.cell)){var ma=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);ma=new mxImageShape(ma,this.rowHandleImage.src);ma.rowState=ca;ma.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;ma.init(this.graph.getView().getOverlayPane());ma.node.style.cursor=-"move";mxEvent.addGestureListeners(ma.node,mxUtils.bind(this,function(pa){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(pa)&&this.graph.isCellSelected(ca.cell)||this.graph.selectCellForEvent(ca.cell,pa);mxEvent.isPopupTrigger(pa)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(pa),mxEvent.getClientY(pa),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(pa),this.graph.isMouseDown=-!0);mxEvent.consume(pa)}),null,mxUtils.bind(this,function(pa){mxEvent.isPopupTrigger(pa)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(pa),mxEvent.getClientY(pa),ca.cell,pa),mxEvent.consume(pa))}));N.push(ma)}else N.push(null)})(this.graph.view.getState(M.getChildAt(this.state.cell,W)));return N};mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var D=0;D<this.moveHandles.length;D++)null!=this.moveHandles[D]&&this.moveHandles[D].destroy();this.moveHandles=-null}};mxVertexHandler.prototype.destroyCornerHandles=function(){if(null!=this.cornerHandles){for(var D=0;D<this.cornerHandles.length;D++)null!=this.cornerHandles[D]&&null!=this.cornerHandles[D].node&&null!=this.cornerHandles[D].node.parentNode&&this.cornerHandles[D].node.parentNode.removeChild(this.cornerHandles[D].node);this.cornerHandles=null}};var La=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){La.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();-if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell))this.refreshMoveHandles();else if(this.graph.isCellMovable(this.state.cell)&&(this.graph.isTransparentBounds(this.state.cell)||1==this.graph.getSelectionCount()&&(this.graph.isTableCell(this.state.cell)||this.graph.isTableRow(this.state.cell)))){this.cornerHandles=[];for(var D=0;4>D;D++){var M=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);M.dialect=mxConstants.DIALECT_SVG;M.init(this.graph.view.getOverlayPane());-this.cornerHandles.push(M)}}this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();D=this.graph.getLinkForCell(this.state.cell);M=this.graph.getLinksForState(this.state);this.updateLinkHint(D,M)};var Da=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var D=new mxPoint(0,0),M=this.tolerance,N=this.state.style.shape;null==mxCellRenderer.defaultShapes[N]&&mxStencilRegistry.getStencil(N);N=this.graph.isTable(this.state.cell)||-this.graph.cellEditor.getEditingCell()==this.state.cell;if(!N&&null!=this.customHandles)for(var W=0;W<this.customHandles.length;W++)if(null!=this.customHandles[W]&&!this.customHandles[W].lockHandle&&!this.customHandles[W].editIconHandle&&!this.customHandles[W].moveGroupHandle&&null!=this.customHandles[W].shape&&null!=this.customHandles[W].shape.bounds){var ca=this.customHandles[W].shape.bounds,ma=ca.getCenterX(),pa=ca.getCenterY();if(Math.abs(this.state.x-ma)<ca.width/2||Math.abs(this.state.y-pa)<-ca.height/2||Math.abs(this.state.x+this.state.width-ma)<ca.width/2||Math.abs(this.state.y+this.state.height-pa)<ca.height/2){N=!0;break}}N&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(M/=2,this.graph.isTable(this.state.cell)&&(M+=7),D.x=this.sizers[0].bounds.width+M,D.y=this.sizers[0].bounds.height+M):D=Da.apply(this,arguments);return D};mxVertexHandler.prototype.updateHint=function(D){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));-if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"°";else{D=this.state.view.scale;var M=this.state.view.unit;this.hint.innerHTML=d(this.roundLength(this.bounds.width/D),M)+" x "+d(this.roundLength(this.bounds.height/D),M)}D=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==D&&(D=this.bounds);this.hint.style.left=D.x+Math.round((D.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=-D.y+D.height+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")}};mxVertexHandler.prototype.removeHint=function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};var Sa=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=function(){Sa.apply(this,arguments);var D=this.graph.getLinkForCell(this.state.cell),M=this.graph.getLinksForState(this.state);this.updateLinkHint(D,M)};var Oa=mxEdgeHandler.prototype.mouseMove;-mxEdgeHandler.prototype.mouseMove=function(D,M){Oa.apply(this,arguments);null!=this.linkHint&&"none"!=this.linkHint.style.display&&null!=this.graph.graphHandler&&null!=this.graph.graphHandler.first&&(this.linkHint.style.display="none")};var Ta=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(D,M){Ta.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=-function(D,M,N){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));var W=this.graph.view.translate,ca=this.graph.view.scale,ma=this.roundLength(M.x/ca-W.x);W=this.roundLength(M.y/ca-W.y);var pa=this.graph.view.unit;this.hint.innerHTML=d(ma,pa)+", "+d(W,pa);this.hint.style.visibility="visible";null!=N&&(N.view.updateEdgeBounds(N),this.hint.innerHTML+=" ("+(pa==mxConstants.POINTS?Math.round(N.length/ca):d(N.length/ca,pa))+")");if(this.isSource||this.isTarget)null!=-this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(N=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*N.x)+"%, "+Math.round(100*N.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(D.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(D.getGraphY(),M.y)+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display=-"none")};Graph.createFoldingImage=function(D,M){return M?Graph.createSvgImage(D,D,'<defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 4.5 2 L 4.5 7 M 2 4.5 L 7 4.5 z" stroke="#000"/>',9,9):Graph.createSvgImage(D,D,'<defs><linearGradient id="grad1" x1="50%" y1="0%" x2="50%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 2 4.5 L 7 4.5 z" stroke="#000"/>',-9,9)};Graph.updateFoldingImages=function(D){Graph.prototype.expandedImage=Graph.createFoldingImage(D,!1);Graph.prototype.collapsedImage=Graph.createFoldingImage(D,!0)};Graph.updateFoldingImages(9);Graph.foldingImages={};Graph.prototype.getFoldingImage=function(D){var M=mxGraph.prototype.getFoldingImage.apply(this,arguments);if(null!=M){var N=parseInt(mxUtils.getValue(D.style,"foldingIconSize",0));if(0<N){var W=N+"-"+this.isCellCollapsed(D.cell);M=Graph.foldingImages[W];null==M&&(M=Graph.createFoldingImage(N,-this.isCellCollapsed(D.cell)),Graph.foldingImages[W]=M)}}return M};mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;HoverIcons.prototype.mainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,-'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.endFixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.terminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="'+-HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.endTerminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.rotationHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" fill="'+HoverIcons.prototype.arrowFill+'" d="M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"/>',+!this.graph.isSiblingSelected(D);if(this.graph.isTransparentBounds(W))return!1}return l.apply(this,arguments)};var t=mxConstraintHandler.prototype.getCellForEvent;mxConstraintHandler.prototype.getCellForEvent=function(D,M){var N=t.apply(this,arguments),W=null!=M?M.x:D.getGraphX(),ca=null!=M?M.y:D.getGraphY();if(null!=N&&this.graph.model.isEdge(N)){var ma=this.graph.model;N=this.graph.getCellAt(W,ca,null,!0,!1,function(va){return ma.isEdge(ma.getParent(va.cell))});if(null!=N&&!this.graph.isCellConnectable(N)){var pa=+ma.getParent(N);ma.isVertex(pa)&&this.graph.isCellConnectable(pa)&&(N=pa)}N=this.graph.isCellLocked(N)?null:N}null==N||null!=this.currentFocus&&this.currentFocus.cell==N||(W=this.graph.getBorderContainer(N,W,ca),null!=W&&(N=W));return N};var H=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){for(var D=H.apply(this,arguments),M=this.graph,N=new mxDictionary,W=[],ca=0;ca<D.length;ca++)null==N.get(D[ca])&&(N.put(D[ca],!0),+W.push(D[ca]));for(ca=0;ca<D.length;ca++)for(var ma=M.model.getParent(D[ca]);null!=ma&&M.isTransparentBounds(ma);)null==N.get(ma)&&(N.put(ma,!0),W.push(ma)),ma=M.model.getParent(ma);return W};mxGraphView.prototype.formatUnitText=function(D){return D?d(D,this.unit):D};mxGraphHandler.prototype.updateHint=function(D){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==this.hint&&(this.hint=b(),this.graph.container.appendChild(this.hint));var M=this.graph.view.translate,N=this.graph.view.scale;+D=this.roundLength((this.bounds.x+this.currentDx)/N-M.x);M=this.roundLength((this.bounds.y+this.currentDy)/N-M.y);N=this.graph.view.unit;this.hint.innerHTML=d(D,N)+", "+d(M,N);this.hint.style.left=this.pBounds.x+this.currentDx+Math.round((this.pBounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.pBounds.y+this.currentDy+this.pBounds.height+Editor.hintOffset+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(null!=this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint),+this.hint=null)};var J=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(D,M){J.apply(this,arguments);var N=this.graph.getCellStyle(D);if(null==N.childLayout){var W=this.graph.model.getParent(D),ca=null!=W?this.graph.getCellGeometry(W):null;if(null!=ca&&(N=this.graph.getCellStyle(W),"stackLayout"==N.childLayout)){var ma=parseFloat(mxUtils.getValue(N,"stackBorder",mxStackLayout.prototype.border));N="1"==mxUtils.getValue(N,"horizontalStack","1");var pa=this.graph.getActualStartSize(W);+ca=ca.clone();N?ca.height=M.height+pa.y+pa.height+2*ma:ca.width=M.width+pa.x+pa.width+2*ma;this.graph.model.setGeometry(W,ca)}}};var R=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function D(va){N.get(va)||(N.put(va,!0),ca.push(va))}for(var M=R.apply(this,arguments),N=new mxDictionary,W=this.graph.model,ca=[],ma=0;ma<M.length;ma++){var pa=M[ma];this.graph.isTableCell(pa)?D(W.getParent(W.getParent(pa))):this.graph.isTableRow(pa)&&+D(W.getParent(pa));D(pa)}return ca};var T=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(D){return T.apply(this,arguments)&&!mxEvent.isControlDown(D.getEvent())&&!mxEvent.isShiftDown(D.getEvent())};var Y=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return Y.apply(this,arguments)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};+var Z=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(D){var M=Z.apply(this,arguments);M.stroke="#C0C0C0";M.strokewidth=1;var N=this.graph.model.getParent(this.state.cell);null!=N&&this.graph.isTransparentBounds(N)&&(M.isDashed=!0);return M};var ia=mxVertexHandler.prototype.isSelectionDashed;mxVertexHandler.prototype.isSelectionDashed=function(){return this.graph.isTransparentBounds(this.state.cell)?!0:ia.apply(this,arguments)};var ja=+mxVertexHandler.prototype.getSelectionColor;mxVertexHandler.prototype.getSelectionColor=function(){return this.graph.isTransparentBounds(this.state.cell)&&!this.graph.isCellSelected(this.state.cell)?"#C0C0C0":ja.apply(this,arguments)};var X=mxVertexHandler.prototype.updateParentHighlight;mxVertexHandler.prototype.updateParentHighlight=function(){X.apply(this,arguments);null!=this.selectionBorder&&this.graph.isTransparentBounds(this.state.cell)&&(this.selectionBorder.stroke=this.getSelectionColor(),+this.selectionBorder.redraw())};var ka=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(D){var M=ka.apply(this,arguments);M.stroke="#C0C0C0";M.strokewidth=1;return M};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var D=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+D.x/2,this.bounds.y+this.rotationHandleVSpacing-+D.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(D,M){return this.graph.isRecursiveVertexResize(D)&&!mxEvent.isAltDown(M.getEvent())};var na=mxVertexHandler.prototype.resizeCell;mxVertexHandler.prototype.resizeCell=function(D,M,N,W,ca,ma,pa){pa&&this.graph.isRotatedGroupResize(D)&&(this.childOffsetY=this.childOffsetX=0);na.apply(this,arguments)};mxVertexHandler.prototype.isCenteredEvent=function(D,M){return mxEvent.isControlDown(M.getEvent())||mxEvent.isMetaDown(M.getEvent())};var la=+mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return la.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTransparentBounds(this.state.cell)&&"1"!=mxUtils.getValue(this.state.style,"labelAutoRotate","0")};mxVertexHandler.prototype.isConnectHandleVisible=function(){return this.graph.isConnectIconVisible(this.state.cell)&&this.graph.isEnabled()&&+this.graph.isCellConnectable(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing=-12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var D=this.getHandlePadding(),M=this.graph,N=M.getNestedCornerIconOffset(this.state.cell,this.bounds.x+this.bounds.width,this.bounds.y+this.bounds.height,function(W){return M.isConnectIconVisible(W)&&M.isEnabled()&&M.isCellConnectable(W)&&+!M.isTableCell(W)&&!M.isTableRow(W)&&!M.isTable(W)});return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing+D.x/2+N,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+D.y/2+N)};mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):this.bounds};var ua=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=+function(){var D=this.graph.model.getParent(this.state.cell);return null!=D&&this.graph.isTransparentBounds(D)?!1:ua.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var za=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(D){return D.tableHandle||D.lockHandle||D.editIconHandle||D.moveGroupHandle||za.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};+mxVertexHandler.prototype.getSelectionBorderInset=function(){var D=0;this.graph.isTransparentBounds(this.state.cell)?D=-this.graph.getNestedTransparentBoundsCount(this.state.cell):this.graph.isTableRow(this.state.cell)?D=1:this.graph.isTableCell(this.state.cell)&&(D=2);return D};var sa=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return sa.apply(this,arguments).grow(-this.getSelectionBorderInset())};var wa=null,Ca=mxVertexHandler.prototype.createCustomHandles;+mxVertexHandler.prototype.createCustomHandles=function(){null==wa&&(wa=mxCellRenderer.defaultShapes.tableLine);var D=Ca.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var M=function(cb,fb,Xa){for(var wb=[],sb=0;sb<cb.length;sb++){var qb=cb[sb];wb.push(null==qb?null:new mxPoint((Aa+qb.x+fb)*ma,(xa+qb.y+Xa)*ma))}return wb},N=this,W=this.graph,ca=W.model,ma=W.view.scale,pa=this.state,va=this.selectionBorder,Aa=this.state.origin.x+W.view.translate.x,+xa=this.state.origin.y+W.view.translate.y;null==D&&(D=[]);var Ma=W.view.getCellStates(ca.getChildCells(this.state.cell,!0));if(0<Ma.length){var Wa=ca.getChildCells(Ma[0].cell,!0),Za=W.getTableLines(this.state.cell,!1,!0),pb=W.getTableLines(this.state.cell,!0,!1);for(ca=0;ca<Ma.length;ca++)mxUtils.bind(this,function(cb){var fb=Ma[cb],Xa=null;if(W.isCellMovable(fb.cell)){Xa=cb<Ma.length-1?Ma[cb+1]:null;Xa=null!=Xa?W.getCellGeometry(Xa.cell):null;var wb=null!=Xa&&null!=Xa.alternateBounds?Xa.alternateBounds:+Xa;Xa=null!=pb[cb]?new wa(pb[cb],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Xa.isDashed=va.isDashed;Xa.svgStrokeTolerance++;Xa=new mxHandle(fb,"row-resize",null,Xa);Xa.tableHandle=!0;var sb=0;Xa.shape.node.parentNode.insertBefore(Xa.shape.node,Xa.shape.node.parentNode.firstChild);Xa.redraw=function(){if(null!=this.shape){this.shape.stroke=0==sb?mxConstants.NONE:va.stroke;if(this.shape.constructor==wa)this.shape.line=M(pb[cb],0,sb),this.shape.updateBoundsFromLine();else{var qb=+W.getActualStartSize(pa.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+sb*ma;this.shape.bounds.x=pa.x+(cb==Ma.length-1?0:qb.x*ma);this.shape.bounds.width=pa.width-(cb==Ma.length-1?0:qb.width+qb.x+ma)}this.shape.redraw()}};Xa.setPosition=function(qb,zb,Fb){sb=Math.max(Graph.minTableRowHeight-qb.height,zb.y-qb.y-qb.height);null!=wb&&mxEvent.isShiftDown(Fb.getEvent())&&(sb=Math.min(sb,wb.height-Graph.minTableRowHeight))};Xa.execute=function(qb){if(0!=sb){var zb=+mxEvent.isShiftDown(qb.getEvent());(qb=mxEvent.isControlDown(qb.getEvent())||mxEvent.isMetaDown(qb.getEvent()))&&zb?W.distributeRows(pa.cell):qb?W.resizeAllTableRows(pa.cell,sb):W.setTableRowHeight(this.state.cell,sb,!zb)}else N.blockDelayedSelection||(zb=W.getCellAt(qb.getGraphX(),qb.getGraphY())||pa.cell,W.graphHandler.selectCellForEvent(zb,qb));sb=0};Xa.reset=function(){sb=0}}D.push(Xa)})(ca);for(ca=0;ca<Wa.length;ca++)mxUtils.bind(this,function(cb){var fb=W.view.getState(Wa[cb]),Xa=W.getCellGeometry(Wa[cb]),+wb=null!=Xa.alternateBounds?Xa.alternateBounds:Xa;null==fb&&(fb=new mxCellState(W.view,Wa[cb],W.getCellStyle(Wa[cb])),fb.x=pa.x+Xa.x*ma,fb.y=pa.y+Xa.y*ma,fb.width=wb.width*ma,fb.height=wb.height*ma,fb.updateCachedBounds());Xa=cb<Wa.length-1?Wa[cb+1]:null;Xa=null!=Xa?W.getCellGeometry(Xa):null;var sb=null!=Xa&&null!=Xa.alternateBounds?Xa.alternateBounds:Xa;Xa=null!=Za[cb]?new wa(Za[cb],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Xa.isDashed=va.isDashed;Xa.svgStrokeTolerance++;+fb=new mxHandle(fb,"col-resize",null,Xa);fb.tableHandle=!0;var qb=0;fb.shape.node.parentNode.insertBefore(fb.shape.node,fb.shape.node.parentNode.firstChild);fb.redraw=function(){if(null!=this.shape){this.shape.stroke=0==qb?mxConstants.NONE:va.stroke;if(this.shape.constructor==wa)this.shape.line=M(Za[cb],qb,0),this.shape.updateBoundsFromLine();else{var zb=W.getActualStartSize(pa.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(wb.width+qb)*ma;this.shape.bounds.y=pa.y+(cb==Wa.length-+1?0:zb.y*ma);this.shape.bounds.height=pa.height-(cb==Wa.length-1?0:(zb.height+zb.y)*ma)}this.shape.redraw()}};fb.setPosition=function(zb,Fb,Jb){qb=Math.max(Graph.minTableColumnWidth-wb.width,Fb.x-zb.x-wb.width);null!=sb&&mxEvent.isShiftDown(Jb.getEvent())&&(qb=Math.min(qb,sb.width-Graph.minTableColumnWidth))};fb.execute=function(zb){if(0!=qb){var Fb=mxEvent.isShiftDown(zb.getEvent());(zb=mxEvent.isControlDown(zb.getEvent())||mxEvent.isMetaDown(zb.getEvent()))&&Fb?W.distributeColumns(pa.cell):zb?W.resizeAllTableColumns(pa.cell,+qb):W.setTableColumnWidth(this.state.cell,qb,!Fb)}else N.blockDelayedSelection||(Fb=W.getCellAt(zb.getGraphX(),zb.getGraphY())||pa.cell,W.graphHandler.selectCellForEvent(Fb,zb));qb=0};fb.positionChanged=function(){};fb.reset=function(){qb=0};D.push(fb)})(ca)}}if(this.graph.isLockedGroupIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){null==D&&(D=[]);N=this;W=this.graph;var rb=this.state.cell,tb=16,ob=this.graph.isLockedGroup(rb);ca=new mxImageShape(new mxRectangle(0,0,tb,tb),+(ob?HoverIcons.prototype.lockHandle:HoverIcons.prototype.unlockHandle).src);ca.preserveImageAspect=!1;ca=new mxHandle(this.state,"pointer",null,ca);ca.lockHandle=!0;ca.setPosition=function(){};ca.positionChanged=function(){};ca.reset=function(){};ca.redraw=function(){if(null!=this.shape){var cb=N.getHandlePadding(),fb=W.getNestedCornerIconOffset(rb,N.bounds.x,N.bounds.y,function(sb){return W.isLockedGroupIconVisible(sb)&&W.isCellMovable(sb)});cb=new mxPoint(N.bounds.x-12-cb.x/2-fb,N.bounds.y-12-cb.y/+2-fb);W.isMoveIconVisible(rb)&&W.isCellMovable(rb)&&(cb.y+=24);fb=Number(null!=N.currentAlpha?N.currentAlpha:N.state.style[mxConstants.STYLE_ROTATION]||"0");var Xa=mxUtils.toRadians(fb);if(0!=Xa){var wb=new mxPoint(N.state.getCenterX(),N.state.getCenterY());cb=mxUtils.getRotatedPoint(cb,Math.cos(Xa),Math.sin(Xa),wb)}this.shape.bounds.width=tb;this.shape.bounds.height=tb;this.shape.bounds.x=cb.x-tb/2;this.shape.bounds.y=cb.y-tb/2;this.shape.rotation=fb;this.shape.redraw()}};ca.execute=function(cb){W.getModel().beginUpdate();+try{W.setCellStyles("lockedGroup",ob?"0":"1",[rb])}finally{W.getModel().endUpdate()}if(!ob){cb=W.getSelectionCells();for(var fb=[],Xa=0;Xa<cb.length;Xa++)cb[Xa]!=rb&&W.model.isAncestor(rb,cb[Xa])||fb.push(cb[Xa]);fb.length!=cb.length&&W.setSelectionCells(0<fb.length?fb:[rb])}};D.push(ca)}this.graph.isEditIconVisible(this.state.cell)&&(null==D&&(D=[]),N=this,W=this.graph,rb=this.state.cell,tb=16,ca=new mxImageShape(new mxRectangle(0,0,tb,tb),HoverIcons.prototype.editHandle.src),ca.preserveImageAspect=+!1,ca=new mxHandle(this.state,"pointer",null,ca),ca.editIconHandle=!0,ca.setPosition=function(){},ca.positionChanged=function(){},ca.reset=function(){},ca.redraw=function(){if(null!=this.shape){var cb=N.getHandlePadding(),fb=W.getNestedCornerIconOffset(rb,N.bounds.x,N.bounds.y,function(sb){return W.isEditIconVisible(sb)});cb=new mxPoint(N.bounds.x-12-cb.x/2-fb,N.bounds.y-12-cb.y/2-fb);W.isCellMovable(rb)&&(W.isLockedGroupIconVisible(rb)||W.isMoveIconVisible(rb))&&(cb.x+=24);fb=Number(null!=N.currentAlpha?+N.currentAlpha:N.state.style[mxConstants.STYLE_ROTATION]||"0");var Xa=mxUtils.toRadians(fb);if(0!=Xa){var wb=new mxPoint(N.state.getCenterX(),N.state.getCenterY());cb=mxUtils.getRotatedPoint(cb,Math.cos(Xa),Math.sin(Xa),wb)}this.shape.bounds.width=tb;this.shape.bounds.height=tb;this.shape.bounds.x=cb.x-tb/2;this.shape.bounds.y=cb.y-tb/2;this.shape.rotation=fb;this.shape.redraw()}},ca.execute=function(cb){W.startEditingAtCell(rb)},D.push(ca));this.graph.isMoveIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&+(null==D&&(D=[]),N=this,W=this.graph,rb=this.state.cell,tb=16,ca=new mxImageShape(new mxRectangle(0,0,tb,tb),HoverIcons.prototype.moveHandle.src),ca.preserveImageAspect=!1,ca=new mxHandle(this.state,"move",null,ca),ca.moveGroupHandle=!0,ca.setPosition=function(){},ca.positionChanged=function(){},ca.execute=function(){},ca.reset=function(){},ca.redraw=function(){if(null!=this.shape){var cb=N.getHandlePadding(),fb=W.getNestedCornerIconOffset(rb,N.bounds.x,N.bounds.y,function(wb){return W.isMoveIconVisible(wb)&&+W.isCellMovable(wb)}),Xa=N.bounds.x-12-cb.x/2-fb;cb=N.bounds.y-12-cb.y/2-fb;this.shape.bounds.width=tb;this.shape.bounds.height=tb;this.shape.bounds.x=Xa-tb/2;this.shape.bounds.y=cb-tb/2;this.shape.redraw()}},D.push(ca));return null!=D?D.reverse():null};var Fa=mxVertexHandler.prototype.setHandlesVisible,Ha=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(D,M,N){Ha.apply(this,arguments);var W=this.graph;if(null!=this.parentState&&W.isTransparentBounds(this.parentState.cell)){var ca=+W.view.scale,ma=W.view.translate,pa=this.parentState;this.parentState=pa.clone();this.parentState.x=ca*(ma.x+pa.origin.x);this.parentState.y=ca*(ma.y+pa.origin.y)}for(ca=W.model.getParent(this.state.cell);null!=ca;)W.isTransparentBounds(ca)&&(ma=W.selectionCellsHandler.getHandler(ca),null!=ma&&null!=ma.selectionBorder&&(ma.selectionBorder.node.style.visibility="hidden")),ca=W.model.getParent(ca);if(!this.livePreviewActive&&null==this.ghostPreview&&null!=this.index&&this.index!=mxEvent.LABEL_HANDLE&&+null!=this.sizers){for(W=0;W<this.sizers.length;W++)null!=this.sizers[W]&&W!=this.index&&(this.sizers[W].node.style.display="none");null!=this.rotationShape&&this.index!=mxEvent.ROTATION_HANDLE&&(this.rotationShape.node.style.visibility="hidden");this.resizeHandlesHidden=!0}};var Na=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){if(this.resizeHandlesHidden){if(null!=this.sizers)for(var D=0;D<this.sizers.length;D++)null!=this.sizers[D]&&(this.sizers[D].node.style.display=+"");null!=this.rotationShape&&(this.rotationShape.node.style.visibility="");this.resizeHandlesHidden=null}D=this.graph;for(var M=null!=this.state?D.model.getParent(this.state.cell):null;null!=M;){if(D.isTransparentBounds(M)){var N=D.selectionCellsHandler.getHandler(M);null!=N&&null!=N.selectionBorder&&(N.selectionBorder.node.style.visibility="")}M=D.model.getParent(M)}Na.apply(this,arguments)};mxVertexHandler.prototype.setHandlesVisible=function(D){Fa.apply(this,arguments);if(null!=this.moveHandles)for(var M=+0;M<this.moveHandles.length;M++)null!=this.moveHandles[M]&&(this.moveHandles[M].node.style.visibility=D?"":"hidden");if(null!=this.cornerHandles)for(M=0;M<this.cornerHandles.length;M++)this.cornerHandles[M].node.style.visibility=D?"":"hidden";this.graph.isTransparentBounds(this.state.cell)&&null!=this.selectionBorder&&(this.selectionBorder.node.style.visibility=D?"":"hidden")};mxVertexHandler.prototype.isMoveHandlesVisible=function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};+mxVertexHandler.prototype.refreshMoveHandles=function(){var D=this.isMoveHandlesVisible();D&&null==this.moveHandles?this.moveHandles=this.createMoveHandles():D||null==this.moveHandles||this.destroyMoveHandles();if(D&&null==this.moveHandles){for(D=0;D<this.moveHandles.length;D++)null!=this.moveHandles[D]&&this.moveHandles[D].parentNode.removeChild(this.moveHandles[D]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=function(){for(var D=this.graph,M=D.model,N=[],W=0;W<M.getChildCount(this.state.cell);W++)mxUtils.bind(this,+function(ca){if(null!=ca&&M.isVertex(ca.cell)&&D.isCellMovable(ca.cell)){var ma=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);ma=new mxImageShape(ma,this.rowHandleImage.src);ma.rowState=ca;ma.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;ma.init(this.graph.getView().getOverlayPane());ma.node.style.cursor="move";mxEvent.addGestureListeners(ma.node,mxUtils.bind(this,function(pa){this.graph.popupMenuHandler.hideMenu();+this.graph.stopEditing(!1);!this.graph.isToggleEvent(pa)&&this.graph.isCellSelected(ca.cell)||this.graph.selectCellForEvent(ca.cell,pa);mxEvent.isPopupTrigger(pa)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(pa),mxEvent.getClientY(pa),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(pa),this.graph.isMouseDown=!0);mxEvent.consume(pa)}),null,mxUtils.bind(this,function(pa){mxEvent.isPopupTrigger(pa)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(pa),+mxEvent.getClientY(pa),ca.cell,pa),mxEvent.consume(pa))}));N.push(ma)}else N.push(null)})(this.graph.view.getState(M.getChildAt(this.state.cell,W)));return N};mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var D=0;D<this.moveHandles.length;D++)null!=this.moveHandles[D]&&this.moveHandles[D].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=function(){if(null!=this.cornerHandles){for(var D=0;D<this.cornerHandles.length;D++)null!=+this.cornerHandles[D]&&null!=this.cornerHandles[D].node&&null!=this.cornerHandles[D].node.parentNode&&this.cornerHandles[D].node.parentNode.removeChild(this.cornerHandles[D].node);this.cornerHandles=null}};var La=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){La.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell))this.refreshMoveHandles();else if(this.graph.isCellMovable(this.state.cell)&&+(this.graph.isTransparentBounds(this.state.cell)||1==this.graph.getSelectionCount()&&(this.graph.isTableCell(this.state.cell)||this.graph.isTableRow(this.state.cell)))){this.cornerHandles=[];for(var D=0;4>D;D++){var M=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);M.dialect=mxConstants.DIALECT_SVG;M.init(this.graph.view.getOverlayPane());this.cornerHandles.push(M)}}this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();+D=this.graph.getLinkForCell(this.state.cell);M=this.graph.getLinksForState(this.state);this.updateLinkHint(D,M)};var Da=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var D=new mxPoint(0,0),M=this.tolerance,N=this.state.style.shape;null==mxCellRenderer.defaultShapes[N]&&mxStencilRegistry.getStencil(N);N=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;if(!N&&null!=this.customHandles)for(var W=0;W<this.customHandles.length;W++)if(null!=+this.customHandles[W]&&!this.customHandles[W].lockHandle&&!this.customHandles[W].editIconHandle&&!this.customHandles[W].moveGroupHandle&&null!=this.customHandles[W].shape&&null!=this.customHandles[W].shape.bounds){var ca=this.customHandles[W].shape.bounds,ma=ca.getCenterX(),pa=ca.getCenterY();if(Math.abs(this.state.x-ma)<ca.width/2||Math.abs(this.state.y-pa)<ca.height/2||Math.abs(this.state.x+this.state.width-ma)<ca.width/2||Math.abs(this.state.y+this.state.height-pa)<ca.height/2){N=!0;break}}N&&+null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(M/=2,this.graph.isTable(this.state.cell)&&(M+=7),D.x=this.sizers[0].bounds.width+M,D.y=this.sizers[0].bounds.height+M):D=Da.apply(this,arguments);return D};mxVertexHandler.prototype.updateHint=function(D){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"°";else{D=this.state.view.scale;+var M=this.state.view.unit;this.hint.innerHTML=d(this.roundLength(this.bounds.width/D),M)+" x "+d(this.roundLength(this.bounds.height/D),M)}D=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==D&&(D=this.bounds);this.hint.style.left=D.x+Math.round((D.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=D.y+D.height+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")}};mxVertexHandler.prototype.removeHint=+function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};var Sa=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=function(){Sa.apply(this,arguments);var D=this.graph.getLinkForCell(this.state.cell),M=this.graph.getLinksForState(this.state);this.updateLinkHint(D,M)};var Oa=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(D,M){Oa.apply(this,arguments);null!=this.linkHint&&"none"!=this.linkHint.style.display&&+null!=this.graph.graphHandler&&null!=this.graph.graphHandler.first&&(this.linkHint.style.display="none")};var Ta=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(D,M){Ta.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(D,M,N){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));var W=this.graph.view.translate,+ca=this.graph.view.scale,ma=this.roundLength(M.x/ca-W.x);W=this.roundLength(M.y/ca-W.y);var pa=this.graph.view.unit;this.hint.innerHTML=d(ma,pa)+", "+d(W,pa);this.hint.style.visibility="visible";null!=N&&(N.view.updateEdgeBounds(N),this.hint.innerHTML+=" ("+(pa==mxConstants.POINTS?Math.round(N.length/ca):d(N.length/ca,pa))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(N=this.constraintHandler.currentConstraint.point,+this.hint.innerHTML="["+Math.round(100*N.x)+"%, "+Math.round(100*N.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(D.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(D.getGraphY(),M.y)+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")};Graph.createFoldingImage=function(D,M){return M?Graph.createSvgImage(D,D,'<defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 4.5 2 L 4.5 7 M 2 4.5 L 7 4.5 z" stroke="#000"/>',+9,9):Graph.createSvgImage(D,D,'<defs><linearGradient id="grad1" x1="50%" y1="0%" x2="50%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 2 4.5 L 7 4.5 z" stroke="#000"/>',9,9)};Graph.updateFoldingImages=function(D){Graph.prototype.expandedImage=Graph.createFoldingImage(D,!1);Graph.prototype.collapsedImage=Graph.createFoldingImage(D,+!0)};Graph.updateFoldingImages(9);Graph.foldingImages={};Graph.prototype.getFoldingImage=function(D){var M=mxGraph.prototype.getFoldingImage.apply(this,arguments);if(null!=M){var N=parseInt(mxUtils.getValue(D.style,"foldingIconSize",0));if(0<N){var W=N+"-"+this.isCellCollapsed(D.cell);M=Graph.foldingImages[W];null==M&&(M=Graph.createFoldingImage(N,this.isCellCollapsed(D.cell)),Graph.foldingImages[W]=M)}}return M};mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;HoverIcons.prototype.mainHandle=+Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');+HoverIcons.prototype.endFixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.terminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.endTerminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="'++HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.rotationHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" fill="'+HoverIcons.prototype.arrowFill+'" d="M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"/>',24,24);HoverIcons.prototype.connectHandle=Graph.createSvgImage(16,16,'<circle cx="12" cy="12" r="10" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><path transform="translate(5,5) scale(0.583)" d="M6 18v-3h7.6L4 5.4 5.4 4 15 13.6V6h3v12z" fill="#fff"/>',24,24);HoverIcons.prototype.lockHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/>',24,24);HoverIcons.prototype.unlockHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M18 8h-1V6c0-2.76-2.24-5-5-5-2.28 0-4.27 .54-4.84 2.75-.14.54.18 1.08.72 1.22.53.14 1.08-.18 1.22-.72C9.44 3.93 10.63 3 12 3c1.65 0 3 1.35 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/>',24,24);HoverIcons.prototype.editHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/>',24,24);HoverIcons.prototype.moveHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M12 2 L9 5 L11 5 L11 11 L5 11 L5 9 L2 12 L5 15 L5 13 L11 13 L11 19 L9 19 L12 22 L15 19 L13 19 L13 13 L19 13 L19 15 L22 12 L19 9 L19 11 L13 11 L13 5 L15 5 Z"/>',@@ -3034,7 +3035,7 @@ arguments);"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.endMovePrmxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxConstraintHandler.prototype.getTolerance=function(D){return mxEvent.isMouseEvent(D.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(D){var M=D.getEvent();return null==D.getState()&&!mxEvent.isMouseEvent(M)||mxEvent.isPopupTrigger(M)&&(null==D.getState()||mxEvent.isControlDown(M)||mxEvent.isShiftDown(M))}}else mxPanningHandler.prototype.isPanningTrigger=function(D){var M=D.getEvent();return mxEvent.isLeftMouseButton(M)&&(this.useLeftButtonForPanning&&null==D.getState()||mxEvent.isControlDown(M)&&!mxEvent.isShiftDown(M))||this.usePopupTrigger&&mxEvent.isPopupTrigger(M)};mxRubberband.prototype.isSpaceEvent=function(D){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&(mxEvent.isControlDown(D.getEvent())||mxEvent.isMetaDown(D.getEvent()))&&mxEvent.isShiftDown(D.getEvent())&&mxEvent.isAltDown(D.getEvent())};mxRubberband.prototype.cancelled=!1;mxRubberband.prototype.cancel=function(){this.isActive()&&(this.cancelled=!0,this.reset())};mxRubberband.prototype.mouseUp=function(D,M){if(this.cancelled)this.cancelled=!1,M.consume();else{var N=null!=this.div&&"none"!=this.div.style.display,W=null,ca=null,ma=D=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(W=this.first.x,ca=this.first.y,D=(this.currentX-W)/this.graph.view.scale,ma=(this.currentY-ca)/this.graph.view.scale,mxEvent.isAltDown(M.getEvent())||(D=this.graph.snap(D),-ma=this.graph.snap(ma),this.graph.isGridEnabled()||(Math.abs(D)<this.graph.tolerance&&(D=0),Math.abs(ma)<this.graph.tolerance&&(ma=0))));this.reset();if(N){if(this.isSpaceEvent(M)){this.graph.model.beginUpdate();try{var pa=this.graph.getCellsBeyond(W,ca,this.graph.getDefaultParent(),!0,!0);for(N=0;N<pa.length;N++)if(this.graph.isCellMovable(pa[N])){var ua=this.graph.view.getState(pa[N]),Aa=this.graph.getCellGeometry(pa[N]);null!=ua&&null!=Aa&&(Aa=Aa.clone(),Aa.translate(D,ma),this.graph.model.setGeometry(pa[N],+ma=this.graph.snap(ma),this.graph.isGridEnabled()||(Math.abs(D)<this.graph.tolerance&&(D=0),Math.abs(ma)<this.graph.tolerance&&(ma=0))));this.reset();if(N){if(this.isSpaceEvent(M)){this.graph.model.beginUpdate();try{var pa=this.graph.getCellsBeyond(W,ca,this.graph.getDefaultParent(),!0,!0);for(N=0;N<pa.length;N++)if(this.graph.isCellMovable(pa[N])){var va=this.graph.view.getState(pa[N]),Aa=this.graph.getCellGeometry(pa[N]);null!=va&&null!=Aa&&(Aa=Aa.clone(),Aa.translate(D,ma),this.graph.model.setGeometry(pa[N],Aa))}}finally{this.graph.model.endUpdate()}}else pa=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(pa,M.getEvent());M.consume()}}};mxRubberband.prototype.mouseMove=function(D,M){if(!M.isConsumed()&&null!=this.first){var N=mxUtils.getScrollOrigin(this.graph.container);D=mxUtils.getOffset(this.graph.container);N.x-=D.x;N.y-=D.y;D=M.getX()+N.x;N=M.getY()+N.y;var W=this.first.x-D,ca=this.first.y-N,ma=this.graph.tolerance;if(null!=this.div||Math.abs(W)>ma||Math.abs(ca)>ma)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(D,N),this.isSpaceEvent(M)?(D=this.x+this.width,N=this.y+this.height,W=this.graph.view.scale,mxEvent.isAltDown(M.getEvent())||(this.width=this.graph.snap(this.width/W)*W,this.height=this.graph.snap(this.height/W)*W,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=D-this.width),this.y<this.first.y&&(this.y=N-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+@@ -3058,9 +3059,9 @@ mxVertexHandler.prototype.mouseUp=function(D,M){Mb.apply(this,arguments);null!=tnull};mxVertexHandler.prototype.updateLinkHint=function(D,M){try{if(null==D&&(null==M||0==M.length))null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=D||null!=M&&0<M.length){var N=document.createElement("img");N.className="geAdaptiveAsset";N.setAttribute("src",Editor.editImage);N.setAttribute("title",mxResources.get("editLink"));N.setAttribute("width","14");N.setAttribute("height","14");N.style.paddingLeft="8px";N.style.marginLeft="auto";N.style.marginBottom="-1px";N.style.cursor="pointer";var W=N.cloneNode(!0);W.setAttribute("src",Editor.trashImage);W.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));W.style.paddingLeft="4px";W.style.marginLeft="0";null==this.linkHint&&(this.linkHint=b(),mxUtils.setPrefixedStyle(this.linkHint.style,"transform","translate(-50%,0)"),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint),mxEvent.addListener(this.linkHint,"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()})));this.linkHint.innerText="";if(null!=D){var ca=document.createElement("div");ca.style.display="flex";ca.style.alignItems="center";ca.appendChild(this.graph.createLinkForHint(D,null,this.state.cell));this.linkHint.appendChild(ca);if(this.graph.isEnabled()&&"function"===typeof this.graph.editLink&&!this.graph.isCellLocked(this.state.cell)){var ma=N.cloneNode(!0);ca.appendChild(ma);mxEvent.addListener(ma,"click",mxUtils.bind(this,-function(ua){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(ua)}));var pa=W.cloneNode(!0);ca.appendChild(pa);mxEvent.addListener(pa,"click",mxUtils.bind(this,function(ua){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(ua)}))}}if(null!=M)for(ca=0;ca<M.length;ca++)mxUtils.bind(this,function(ua,Aa){var xa=document.createElement("div");xa.style.display="flex";xa.style.alignItems="center";xa.style.marginTop=null!=D||0<Aa?"6px":"0px";xa.appendChild(this.graph.createLinkForHint(ua.getAttribute("href"),-mxUtils.getTextContent(ua),this.state.cell));var Ma=N.cloneNode(!0);xa.appendChild(Ma);var Wa=mxUtils.bind(this,function(Za){var pb=document.createElement("div");pb.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var rb=pb.getElementsByTagName("a")[Aa];if(null!=rb){if(null==Za||""==Za){for(Za=rb.cloneNode(!0).firstChild;null!=Za;)rb.parentNode.insertBefore(Za.cloneNode(!0),rb),Za=Za.nextSibling;rb.parentNode.removeChild(rb)}else rb.setAttribute("href",Za);this.graph.labelChanged(this.state.cell,-pb.innerHTML)}});mxEvent.addListener(Ma,"click",mxUtils.bind(this,function(Za){this.graph.showLinkDialog(ua.getAttribute("href")||"",mxResources.get("ok"),Wa);mxEvent.consume(Za)}));Ma=W.cloneNode(!0);xa.appendChild(Ma);mxEvent.addListener(Ma,"click",mxUtils.bind(this,function(Za){Wa();mxEvent.consume(Za)}));this.linkHint.appendChild(xa)})(M[ca],ca)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(ua){}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var Pb=+function(va){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(va)}));var pa=W.cloneNode(!0);ca.appendChild(pa);mxEvent.addListener(pa,"click",mxUtils.bind(this,function(va){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(va)}))}}if(null!=M)for(ca=0;ca<M.length;ca++)mxUtils.bind(this,function(va,Aa){var xa=document.createElement("div");xa.style.display="flex";xa.style.alignItems="center";xa.style.marginTop=null!=D||0<Aa?"6px":"0px";xa.appendChild(this.graph.createLinkForHint(va.getAttribute("href"),+mxUtils.getTextContent(va),this.state.cell));var Ma=N.cloneNode(!0);xa.appendChild(Ma);var Wa=mxUtils.bind(this,function(Za){var pb=document.createElement("div");pb.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var rb=pb.getElementsByTagName("a")[Aa];if(null!=rb){if(null==Za||""==Za){for(Za=rb.cloneNode(!0).firstChild;null!=Za;)rb.parentNode.insertBefore(Za.cloneNode(!0),rb),Za=Za.nextSibling;rb.parentNode.removeChild(rb)}else rb.setAttribute("href",Za);this.graph.labelChanged(this.state.cell,+pb.innerHTML)}});mxEvent.addListener(Ma,"click",mxUtils.bind(this,function(Za){this.graph.showLinkDialog(va.getAttribute("href")||"",mxResources.get("ok"),Wa);mxEvent.consume(Za)}));Ma=W.cloneNode(!0);xa.appendChild(Ma);mxEvent.addListener(Ma,"click",mxUtils.bind(this,function(Za){Wa();mxEvent.consume(Za)}));this.linkHint.appendChild(xa)})(M[ca],ca)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(va){}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var Pb=mxEdgeHandler.prototype.createConstraintHandler;mxEdgeHandler.prototype.createConstraintHandler=function(){var D=Pb.apply(this,arguments);D.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});return D};var Tb=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){Tb.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var Vb=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){if(null!=this.moveHandles)for(var D=0;D<this.moveHandles.length;D++)null!=this.moveHandles[D]&&(this.moveHandles[D].bounds.x=Math.round(this.moveHandles[D].rowState.x+this.moveHandles[D].rowState.width-this.moveHandles[D].bounds.width/2),this.moveHandles[D].bounds.y=Math.round(this.moveHandles[D].rowState.y+(this.moveHandles[D].rowState.height-this.moveHandles[D].bounds.height)/2),this.moveHandles[D].redraw());if(null!=this.cornerHandles){D=this.getSelectionBorderInset();var M=this.cornerHandles,N=M[0].bounds.height/2;M[0].bounds.x=this.state.x-M[0].bounds.width/2+D;M[0].bounds.y=this.state.y-N+D;M[0].redraw();M[1].bounds.x=M[0].bounds.x+this.state.width-2*D;M[1].bounds.y=M[0].bounds.y;M[1].redraw();M[2].bounds.x=M[0].bounds.x;M[2].bounds.y=this.state.y+this.state.height-2*D;M[2].redraw();M[3].bounds.x=M[1].bounds.x;M[3].bounds.y=M[2].bounds.y;M[3].redraw();M=1==this.graph.getSelectionCount()&&(!this.graph.isTransparentBounds(this.state.cell)||this.graph.isCellSelected(this.state.cell));@@ -3072,302 +3073,302 @@ this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,M=null!=this.stateGraph.getLabelAutoRotation(this.state);this.selectionBorder.rotation=null!=D?D:Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")}Gb.apply(this,arguments)};var Nb=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){Nb.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();null!=this.linkHint&&(null!=this.linkHint.parentNode&&this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getSelectionModel().removeListener(this.changeHandler),this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var Wb=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(Wb.apply(this),null!=this.state&&null!=this.linkHint)){var D=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(D=new mxRectangle(D.x,D.y,D.width,D.height),D.add(this.state.text.bounds));this.linkHint.style.left=D.x+D.width/2+"px";this.linkHint.style.top=Math.round(D.y+D.height+Editor.hintOffset)+"px";this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":""}};var Yb=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=function(){Yb.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Ab=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Ab.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),-this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(g,r,A){mxShape.call(this);this.line=g;this.stroke=r;this.strokewidth=null!=A?A:1;this.updateBoundsFromLine()}function d(){mxSwimlane.call(this)}function m(){mxSwimlane.call(this)}function p(){mxCylinder.call(this)}function v(){mxConnector.call(this)}function n(){mxCylinder.call(this)}function y(){mxActor.call(this)}function C(){mxCylinder.call(this)}function P(){mxCylinder.call(this)}function G(){mxCylinder.call(this)}function O(){mxCylinder.call(this)}function U(){mxShape.call(this)}-function c(){mxShape.call(this)}function f(g,r,A,u){mxShape.call(this);this.bounds=g;this.fill=r;this.stroke=A;this.strokewidth=null!=u?u:1}function k(){mxActor.call(this)}function q(){mxCylinder.call(this)}function x(){mxCylinder.call(this)}function B(){mxShape.call(this)}function E(){mxActor.call(this)}function L(){mxActor.call(this)}function Q(){mxActor.call(this)}function V(){mxActor.call(this)}function K(){mxActor.call(this)}function fa(){mxActor.call(this)}function aa(){mxActor.call(this)}function da(g,+this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(g,r,A){mxShape.call(this);this.line=g;this.stroke=r;this.strokewidth=null!=A?A:1;this.updateBoundsFromLine()}function d(){mxSwimlane.call(this)}function m(){mxSwimlane.call(this)}function p(){mxCylinder.call(this)}function u(){mxConnector.call(this)}function n(){mxCylinder.call(this)}function y(){mxActor.call(this)}function B(){mxCylinder.call(this)}function P(){mxCylinder.call(this)}function G(){mxCylinder.call(this)}function O(){mxCylinder.call(this)}function U(){mxShape.call(this)}+function c(){mxShape.call(this)}function f(g,r,A,v){mxShape.call(this);this.bounds=g;this.fill=r;this.stroke=A;this.strokewidth=null!=v?v:1}function k(){mxActor.call(this)}function q(){mxCylinder.call(this)}function x(){mxCylinder.call(this)}function C(){mxShape.call(this)}function E(){mxActor.call(this)}function L(){mxActor.call(this)}function Q(){mxActor.call(this)}function V(){mxActor.call(this)}function K(){mxActor.call(this)}function fa(){mxActor.call(this)}function aa(){mxActor.call(this)}function da(g,r){this.canvas=g;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=r;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,da.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,da.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,da.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,da.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,da.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,da.prototype.arcTo)}function ba(){mxRectangleShape.call(this)}function ha(){mxRectangleShape.call(this)}function qa(){mxActor.call(this)}function ra(){mxActor.call(this)}function l(){mxActor.call(this)}function t(){mxRectangleShape.call(this)}function H(){mxRectangleShape.call(this)}function J(){mxCylinder.call(this)}function R(){mxShape.call(this)}-function T(){mxShape.call(this)}function Y(){mxEllipse.call(this)}function Z(){mxShape.call(this)}function ia(){mxShape.call(this)}function ka(g,r){function A(){mxShape.call(this)}mxUtils.extend(A,mxShape);A.prototype.iconSize=r;A.prototype.paintBackground=function(u,z,F,I,ea){ea=Math.min(this.iconSize,I,ea);z+=(I-ea)/2;g.prototype.hasOwnProperty("paintVertexShape")?g.prototype.paintVertexShape.call(this,u,z,F,ea,ea):(g.prototype.paintBackground.call(this,u,z,F,ea,ea),"function"===typeof g.prototype.paintForeground&&-g.prototype.paintForeground.call(this,u,z,F,ea,ea))};return A}function X(){mxShape.call(this)}function ja(){mxShape.call(this)}function na(){mxShape.call(this)}function la(){mxShape.call(this)}function va(){mxShape.call(this)}function za(){mxRectangleShape.call(this)}function sa(){mxShape.call(this)}function wa(){mxShape.call(this)}function Ca(){mxShape.call(this)}function Fa(){mxShape.call(this)}function Ha(){mxShape.call(this)}function Na(){mxCylinder.call(this)}function La(){mxCylinder.call(this)}+function T(){mxShape.call(this)}function Y(){mxEllipse.call(this)}function Z(){mxShape.call(this)}function ia(){mxShape.call(this)}function ja(g,r){function A(){mxShape.call(this)}mxUtils.extend(A,mxShape);A.prototype.iconSize=r;A.prototype.paintBackground=function(v,z,F,I,ea){ea=Math.min(this.iconSize,I,ea);z+=(I-ea)/2;g.prototype.hasOwnProperty("paintVertexShape")?g.prototype.paintVertexShape.call(this,v,z,F,ea,ea):(g.prototype.paintBackground.call(this,v,z,F,ea,ea),"function"===typeof g.prototype.paintForeground&&+g.prototype.paintForeground.call(this,v,z,F,ea,ea))};return A}function X(){mxShape.call(this)}function ka(){mxShape.call(this)}function na(){mxShape.call(this)}function la(){mxShape.call(this)}function ua(){mxShape.call(this)}function za(){mxRectangleShape.call(this)}function sa(){mxShape.call(this)}function wa(){mxShape.call(this)}function Ca(){mxShape.call(this)}function Fa(){mxShape.call(this)}function Ha(){mxShape.call(this)}function Na(){mxCylinder.call(this)}function La(){mxCylinder.call(this)}function Da(){mxRectangleShape.call(this)}function Sa(){mxDoubleEllipse.call(this)}function Oa(){mxDoubleEllipse.call(this)}function Ta(){mxArrowConnector.call(this);this.spacing=0}function Ua(){mxArrowConnector.call(this);this.spacing=0}function Ba(){mxActor.call(this)}function Ka(){mxRectangleShape.call(this)}function ab(){mxActor.call(this)}function Qa(){mxActor.call(this)}function db(){mxActor.call(this)}function Va(){mxActor.call(this)}function nb(){mxActor.call(this)}function bb(){mxActor.call(this)}function ya(){mxActor.call(this)}function Ra(){mxActor.call(this)}function Ya(){mxActor.call(this)}function lb(){mxActor.call(this)}function ub(){mxEllipse.call(this)}function gb(){mxEllipse.call(this)}function jb(){mxEllipse.call(this)}function yb(){mxRhombus.call(this)}function Bb(){mxEllipse.call(this)}function Cb(){mxEllipse.call(this)}function Kb(){mxEllipse.call(this)}function Xb(){mxEllipse.call(this)}function Ob(){mxActor.call(this)}function Ub(){mxActor.call(this)}function Qb(){mxActor.call(this)}-function xb(g,r,A,u){mxShape.call(this);this.bounds=g;this.fill=r;this.stroke=A;this.strokewidth=null!=u?u:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=!0;this.indent=2;this.rectOutline="single"}function Mb(){mxConnector.call(this)}function Pb(){mxConnector.call(this)}function Tb(){mxActor.call(this)}function Vb(g,r,A,u,z,F,I,ea,S,ta){I+=S;var oa=u.clone();u.x-=z*(2*I+S);u.y-=F*(2*I+S);z*=I+S;F*=I+S;return function(){g.ellipse(oa.x-z-I,oa.y-F-I,2*I,2*I);ta?g.fillAndStroke():g.stroke()}}+function xb(g,r,A,v){mxShape.call(this);this.bounds=g;this.fill=r;this.stroke=A;this.strokewidth=null!=v?v:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=!0;this.indent=2;this.rectOutline="single"}function Mb(){mxConnector.call(this)}function Pb(){mxConnector.call(this)}function Tb(){mxActor.call(this)}function Vb(g,r,A,v,z,F,I,ea,S,ta){I+=S;var oa=v.clone();v.x-=z*(2*I+S);v.y-=F*(2*I+S);z*=I+S;F*=I+S;return function(){g.ellipse(oa.x-z-I,oa.y-F-I,2*I,2*I);ta?g.fillAndStroke():g.stroke()}}function Gb(){mxRectangleShape.call(this)}function Nb(){mxActor.call(this)}function Wb(){mxShape.call(this)}function Yb(){mxShape.call(this)}function Ab(){mxActor.call(this)}function D(){mxActor.call(this)}function M(){mxActor.call(this)}function N(){mxActor.call(this)}function W(){mxConnector.call(this)}var ca=mxShape.prototype.getLabelMargins;mxShape.prototype.getLabelMargins=function(g){if(null!=this.stencil&&null!=this.stencil.desc&&null!=this.style){if(null==this.stencil.labelBounds){for(var r=-this.stencil.desc.getElementsByTagName("labelBounds"),A=[],u=0;u<r.length;u++)A.push({condition:r[u].getAttribute("if"),x:Number(r[u].getAttribute("x")||0),y:Number(r[u].getAttribute("y")||0),w:Number(r[u].getAttribute("w")||this.stencil.w0),h:Number(r[u].getAttribute("h")||this.stencil.h0)});this.stencil.labelBounds=A}for(u=0;u<this.stencil.labelBounds.length;u++)if(r=this.stencil.labelBounds[u],null==r.condition||"1"==mxUtils.getValue(this.style,r.condition,"0")){u=this.stencil.computeAspect(this.style,-g.x,g.y,g.width,g.height);A=u.x-g.x+r.x*u.width;var z=u.y-g.y+r.y*u.height;return new mxRectangle(A,z,g.width-A-r.w*u.width,g.height-z-r.h*u.height)}}return ca.apply(this,arguments)};mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var g=null;if(null!=this.line)for(var r=0;r<this.line.length;r++){var A=this.line[r];null!=A&&(A=new mxRectangle(A.x,A.y,this.strokewidth,this.strokewidth),null==g?g=A:g.add(A))}this.bounds=null!=g?g:new mxRectangle};b.prototype.paintVertexShape=function(g,-r,A,u,z){this.paintTableLine(g,this.line,0,0)};b.prototype.paintTableLine=function(g,r,A,u){if(null!=r){var z=null;g.begin();for(var F=0;F<r.length;F++){var I=r[F];null!=I&&(null==z?g.moveTo(I.x+A,I.y+u):null!=z&&g.lineTo(I.x+A,I.y+u));z=I}g.end();g.stroke()}};b.prototype.intersectsRectangle=function(g){var r=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var A=null,u=0;u<this.line.length&&!r;u++){var z=this.line[u];null!=z&&null!=A&&(r=mxUtils.rectangleIntersectsSegment(g,-A,z));A=z}return r};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(d,mxSwimlane);d.prototype.fixedHeaderDefault=!1;d.prototype.paintVertexShape=function(g,r,A,u,z){var F=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):!1,I=this.isHorizontal(),ea=this.getTitleSize(),S=mxUtils.getValue(this.style,mxConstants.STYLE_FIXED_HEADER,this.fixedHeaderDefault);0==ea&&this.isRounded&&!this.outline?(S=mxShape.prototype.getArcSize.call(this,u,z),g.begin(),g.roundrect(r,A,u,z,-S,S),g.fillAndStroke()):0==ea&&!S||this.outline?Kb.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),g.translate(-r,-A));F||this.outline||!(I&&ea<z||!I&&ea<u)||this.paintForeground(g,r,A,u,z)};d.prototype.paintForeground=function(g,r,A,u,z){if(null!=this.state){var F=this.flipH,I=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var ea=F;F=I;I=ea}g.rotate(-this.getShapeRotation(),F,I,-r+u/2,A+z/2);s=this.scale;r=this.bounds.x/s;A=this.bounds.y/s;u=this.bounds.width/s;z=this.bounds.height/s;this.paintTableForeground(g,r,A,u,z)}};d.prototype.paintTableForeground=function(g,r,A,u,z){u=this.state.view.graph.getTableLines(this.state.cell,"0"!=mxUtils.getValue(this.state.style,"rowLines","1"),"0"!=mxUtils.getValue(this.state.style,"columnLines","1"));for(z=0;z<u.length;z++)b.prototype.paintTableLine(g,u[z],r,A)};d.prototype.configurePointerEvents=function(g){0==this.getTitleSize()?g.pointerEvents=-!1:mxSwimlane.prototype.configurePointerEvents.apply(this,arguments)};mxCellRenderer.registerShape("table",d);mxUtils.extend(m,d);m.prototype.paintForeground=function(){};mxCellRenderer.registerShape("tableRow",m);var ma=mxSwimlane.prototype.paintVertexShape;mxSwimlane.prototype.paintVertexShape=function(g,r,A,u,z){ma.apply(this,arguments);if(null!=this.state&&!this.outline){var F=this.state.view.graph;if((null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.laneFill&&this.laneFill!=mxConstants.NONE)&&-null!=F.paintTableCellLines){var I=this.state.cell;if(null!=F.isTableRow&&F.isTableRow(I)){var ea=this.getTitleSize();this.isHorizontal()?F.paintTableCellLines(g,I,0,0,u,Math.min(ea,z),this.stroke,this.strokewidth):F.paintTableCellLines(g,I,0,0,Math.min(ea,u),z,this.stroke,this.strokewidth)}else F.paintTableCellLines(g,I,0,0,u,z,this.stroke,this.strokewidth)}}};mxUtils.extend(p,mxCylinder);p.prototype.size=20;p.prototype.darkOpacity=0;p.prototype.darkOpacity2=0;p.prototype.paintVertexShape=function(g,-r,A,u,z){var F=Math.max(0,Math.min(u,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),I=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),ea=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));g.translate(r,A);g.begin();g.moveTo(0,0);g.lineTo(u-F,0);g.lineTo(u,F);g.lineTo(u,z);g.lineTo(F,z);g.lineTo(0,z-F);g.lineTo(0,0);g.close();g.end();g.fillAndStroke();this.outline||(g.setShadow(!1),-0!=I&&(g.setFillAlpha(Math.abs(I)),g.setFillColor(0>I?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(u-F,0),g.lineTo(u,F),g.lineTo(F,F),g.close(),g.fill()),0!=ea&&(g.setFillAlpha(Math.abs(ea)),g.setFillColor(0>ea?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(F,F),g.lineTo(F,z),g.lineTo(0,z-F),g.close(),g.fill()),g.begin(),g.moveTo(F,z),g.lineTo(F,F),g.lineTo(0,0),g.moveTo(F,F),g.lineTo(u,F),g.end(),g.stroke())};p.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,-"boundedLbl",!1)?(g=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(g,g,0,0)):null};mxCellRenderer.registerShape("cube",p);var pa=Math.tan(mxUtils.toRadians(30)),ua=(.5-pa)/2;mxCellRenderer.registerShape("isoRectangle",y);mxUtils.extend(v,mxConnector);v.prototype.paintEdgeShape=function(g,r){var A=this.createMarker(g,r,!0),u=this.createMarker(g,r,!1);g.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&g.setDashed(this.isDashed,-null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);g.setShadow(!1);g.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);g.setStrokeColor(this.stroke);g.setFillColor(this.stroke);g.setDashed(!1);null!=A&&A();null!=u&&u()};mxCellRenderer.registerShape("wire",v);mxUtils.extend(n,mxCylinder);n.prototype.size=6;n.prototype.paintVertexShape=function(g,r,A,u,z){g.setFillColor(this.stroke);var F=Math.max(0,parseFloat(mxUtils.getValue(this.style,-"size",this.size))-2)+2*this.strokewidth;g.ellipse(r+.5*(u-F),A+.5*(z-F),F,F);g.fill();g.setFillColor(mxConstants.NONE);g.rect(r,A,u,z);g.fill()};mxCellRenderer.registerShape("waypoint",n);mxUtils.extend(y,mxActor);y.prototype.size=20;y.prototype.redrawPath=function(g,r,A,u,z){r=Math.min(u,z/pa);g.translate((u-r)/2,(z-r)/2+r/4);g.moveTo(0,.25*r);g.lineTo(.5*r,r*ua);g.lineTo(r,.25*r);g.lineTo(.5*r,(.5-ua)*r);g.lineTo(0,.25*r);g.close();g.end()};mxCellRenderer.registerShape("isoRectangle",y);mxUtils.extend(C,-mxCylinder);C.prototype.size=20;C.prototype.redrawPath=function(g,r,A,u,z,F){r=Math.min(u,z/(.5+pa));F?(g.moveTo(0,.25*r),g.lineTo(.5*r,(.5-ua)*r),g.lineTo(r,.25*r),g.moveTo(.5*r,(.5-ua)*r),g.lineTo(.5*r,(1-ua)*r)):(g.translate((u-r)/2,(z-r)/2),g.moveTo(0,.25*r),g.lineTo(.5*r,r*ua),g.lineTo(r,.25*r),g.lineTo(r,.75*r),g.lineTo(.5*r,(1-ua)*r),g.lineTo(0,.75*r),g.close());g.end()};mxCellRenderer.registerShape("isoCube",C);mxUtils.extend(P,mxCylinder);P.prototype.redrawPath=function(g,r,A,u,z,F){r=Math.min(z/-2,Math.round(z/8)+this.strokewidth-1);if(F&&null!=this.fill||!F&&null==this.fill)g.moveTo(0,r),g.curveTo(0,2*r,u,2*r,u,r),F||(g.stroke(),g.begin()),g.translate(0,r/2),g.moveTo(0,r),g.curveTo(0,2*r,u,2*r,u,r),F||(g.stroke(),g.begin()),g.translate(0,r/2),g.moveTo(0,r),g.curveTo(0,2*r,u,2*r,u,r),F||(g.stroke(),g.begin()),g.translate(0,-r);F||(g.moveTo(0,r),g.curveTo(0,-r/3,u,-r/3,u,r),g.lineTo(u,z-r),g.curveTo(u,z+r/3,0,z+r/3,0,z-r),g.close())};P.prototype.getLabelMargins=function(g){return new mxRectangle(0,-2.5*Math.min(g.height/2,Math.round(g.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",P);mxUtils.extend(G,mxCylinder);G.prototype.size=30;G.prototype.darkOpacity=0;G.prototype.paintVertexShape=function(g,r,A,u,z){var F=Math.max(0,Math.min(u,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),I=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));g.translate(r,A);g.begin();g.moveTo(0,0);g.lineTo(u-F,0);g.lineTo(u,-F);g.lineTo(u,z);g.lineTo(0,z);g.lineTo(0,0);g.close();g.end();g.fillAndStroke();this.outline||(g.setShadow(!1),0!=I&&(g.setFillAlpha(Math.abs(I)),g.setFillColor(0>I?"#FFFFFF":"#000000"),g.begin(),g.moveTo(u-F,0),g.lineTo(u-F,F),g.lineTo(u,F),g.close(),g.fill()),g.begin(),g.moveTo(u-F,0),g.lineTo(u-F,F),g.lineTo(u,F),g.end(),g.stroke())};mxCellRenderer.registerShape("note",G);mxUtils.extend(O,G);mxCellRenderer.registerShape("note2",O);O.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,-"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(g.height*this.scale,r*this.scale),0,0)}return null};mxUtils.extend(U,mxShape);U.prototype.isoAngle=15;U.prototype.paintVertexShape=function(g,r,A,u,z){var F=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;F=Math.min(u*Math.tan(F),.5*z);g.translate(r,A);g.begin();g.moveTo(.5*u,0);g.lineTo(u,F);g.lineTo(u,z-F);g.lineTo(.5*u,z);g.lineTo(0,z-F);g.lineTo(0,-F);g.close();g.fillAndStroke();g.setShadow(!1);g.begin();g.moveTo(0,F);g.lineTo(.5*u,2*F);g.lineTo(u,F);g.moveTo(.5*u,2*F);g.lineTo(.5*u,z);g.stroke()};mxCellRenderer.registerShape("isoCube2",U);mxUtils.extend(c,mxShape);c.prototype.size=15;c.prototype.paintVertexShape=function(g,r,A,u,z){var F=Math.max(0,Math.min(.5*z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.translate(r,A);0==F?(g.rect(0,0,u,z),g.fillAndStroke()):(g.begin(),g.moveTo(0,F),g.arcTo(.5*u,F,0,0,1,.5*u,0),g.arcTo(.5*-u,F,0,0,1,u,F),g.lineTo(u,z-F),g.arcTo(.5*u,F,0,0,1,.5*u,z),g.arcTo(.5*u,F,0,0,1,0,z-F),g.close(),g.fillAndStroke(),g.setShadow(!1),g.begin(),g.moveTo(u,F),g.arcTo(.5*u,F,0,0,1,.5*u,2*F),g.arcTo(.5*u,F,0,0,1,0,F),g.stroke())};mxCellRenderer.registerShape("cylinder2",c);mxUtils.extend(f,mxCylinder);f.prototype.size=15;f.prototype.paintVertexShape=function(g,r,A,u,z){var F=Math.max(0,Math.min(.5*z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),I=mxUtils.getValue(this.style,"lid",!0);g.translate(r,-A);0==F?(g.rect(0,0,u,z),g.fillAndStroke()):(g.begin(),I?(g.moveTo(0,F),g.arcTo(.5*u,F,0,0,1,.5*u,0),g.arcTo(.5*u,F,0,0,1,u,F)):(g.moveTo(0,0),g.arcTo(.5*u,F,0,0,0,.5*u,F),g.arcTo(.5*u,F,0,0,0,u,0)),g.lineTo(u,z-F),g.arcTo(.5*u,F,0,0,1,.5*u,z),g.arcTo(.5*u,F,0,0,1,0,z-F),g.close(),g.fillAndStroke(),g.setShadow(!1),I&&(g.begin(),g.moveTo(u,F),g.arcTo(.5*u,F,0,0,1,.5*u,2*F),g.arcTo(.5*u,F,0,0,1,0,F),g.stroke()))};mxCellRenderer.registerShape("cylinder3",f);mxUtils.extend(k,mxActor);k.prototype.redrawPath=-function(g,r,A,u,z){g.moveTo(0,0);g.quadTo(u/2,.5*z,u,0);g.quadTo(.5*u,z/2,u,z);g.quadTo(u/2,.5*z,0,z);g.quadTo(.5*u,z/2,0,0);g.end()};mxCellRenderer.registerShape("switch",k);mxUtils.extend(q,mxCylinder);q.prototype.tabWidth=60;q.prototype.tabHeight=20;q.prototype.tabPosition="right";q.prototype.arcSize=.1;q.prototype.isRoundable=function(){return!0};q.prototype.paintVertexShape=function(g,r,A,u,z){g.translate(r,A);r=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));-A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var F=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),I=mxUtils.getValue(this.style,"rounded",!1),ea=mxUtils.getValue(this.style,"absoluteArcSize",!1),S=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));ea||(S*=Math.min(u,z));S=Math.min(S,.5*u,.5*(z-A));r=Math.max(r,S);r=Math.min(u-S,r);I||(S=0);g.begin();"left"==F?(g.moveTo(Math.max(S,0),A),g.lineTo(Math.max(S,0),0),g.lineTo(r,-0),g.lineTo(r,A)):(g.moveTo(u-r,A),g.lineTo(u-r,0),g.lineTo(u-Math.max(S,0),0),g.lineTo(u-Math.max(S,0),A));I?(g.moveTo(0,S+A),g.arcTo(S,S,0,0,1,S,A),g.lineTo(u-S,A),g.arcTo(S,S,0,0,1,u,S+A),g.lineTo(u,z-S),g.arcTo(S,S,0,0,1,u-S,z),g.lineTo(S,z),g.arcTo(S,S,0,0,1,0,z-S)):(g.moveTo(0,A),g.lineTo(u,A),g.lineTo(u,z),g.lineTo(0,z));g.close();g.fillAndStroke();g.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(g.begin(),g.moveTo(u-30,A+20),g.lineTo(u-20,A+10),g.lineTo(u-10,-A+20),g.close(),g.stroke())};mxCellRenderer.registerShape("folder",q);q.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var A=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var u=mxUtils.getValue(this.style,"rounded",!1),z=mxUtils.getValue(this.style,"absoluteArcSize",!1),F=parseFloat(mxUtils.getValue(this.style,-"arcSize",this.arcSize));z||(F*=Math.min(g.width,g.height));F=Math.min(F,.5*g.width,.5*(g.height-r));u||(F=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(F,0,Math.min(g.width,g.width-A),Math.min(g.height,g.height-r)):new mxRectangle(Math.min(g.width,g.width-A),0,F,Math.min(g.height,g.height-r))}return new mxRectangle(0,Math.min(g.height,r),0,0)}return null};mxUtils.extend(x,mxCylinder);x.prototype.arcSize=.1;x.prototype.paintVertexShape=function(g,r,A,-u,z){g.translate(r,A);var F=mxUtils.getValue(this.style,"rounded",!1),I=mxUtils.getValue(this.style,"absoluteArcSize",!1);r=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));A=mxUtils.getValue(this.style,"umlStateConnection",null);I||(r*=Math.min(u,z));r=Math.min(r,.5*u,.5*z);F||(r=0);F=0;null!=A&&(F=10);g.begin();g.moveTo(F,r);g.arcTo(r,r,0,0,1,F+r,0);g.lineTo(u-r,0);g.arcTo(r,r,0,0,1,u,r);g.lineTo(u,z-r);g.arcTo(r,r,0,0,1,u-r,z);g.lineTo(F+r,z);g.arcTo(r,r,0,0,1,F,z-r);g.close();g.fillAndStroke();-g.setShadow(!1);"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(g.roundrect(u-40,z-20,10,10,3,3),g.stroke(),g.roundrect(u-20,z-20,10,10,3,3),g.stroke(),g.begin(),g.moveTo(u-30,z-15),g.lineTo(u-20,z-15),g.stroke());"connPointRefEntry"==A?(g.ellipse(0,.5*z-10,20,20),g.fillAndStroke()):"connPointRefExit"==A&&(g.ellipse(0,.5*z-10,20,20),g.fillAndStroke(),g.begin(),g.moveTo(5,.5*z-5),g.lineTo(15,.5*z+5),g.moveTo(15,.5*z-5),g.lineTo(5,.5*z+5),g.stroke())};x.prototype.getLabelMargins=-function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};mxCellRenderer.registerShape("umlState",x);mxUtils.extend(B,mxShape);B.prototype.featureColor="#666666";B.prototype.paintVertexShape=function(g,r,A,u,z){var F=mxUtils.getValue(this.style,"smileyType","happy"),I=mxUtils.getValue(this.style,"smileyFeatureColor",B.prototype.featureColor);g.translate(r,A);r=Math.min(u,z)/2;g.ellipse(u/-2-r,z/2-r,2*r,2*r);g.fillAndStroke();r=Math.min(u,z)/30;u/=2;z/=2;g.setFillColor(I);g.setStrokeColor(I);g.setStrokeWidth(2*r);I=1.5*r;A=5*r;var ea=5*r;g.ellipse(u-A-I,z-ea-I,2*I,2*I);g.fillAndStroke();g.ellipse(u+A-I,z-ea-I,2*I,2*I);g.fillAndStroke();g.setStrokeWidth(1*r);g.setFillColor("#000000");"happy"==F?(F=u,I=z+2*r,g.begin(),g.moveTo(F+7.5*r,I),g.arcTo(7.5*r,7.5*r,0,1,1,F-7.5*r,I),g.lineTo(F-6.818*r,I),g.arcTo(6.818*r,6.818*r,0,1,0,F+6.818*r,I),g.close(),g.fillAndStroke()):"sad"==F?(F=u,I=z+-7*r,g.begin(),g.moveTo(F-7.5*r,I),g.arcTo(7.5*r,7.5*r,0,1,1,F+7.5*r,I),g.lineTo(F+6.818*r,I),g.arcTo(6.818*r,6.818*r,0,1,0,F-6.818*r,I),g.close(),g.fillAndStroke()):(g.begin(),g.moveTo(u-5*r,z+7*r),g.lineTo(u+5*r,z+7*r),g.stroke())};mxCellRenderer.registerShape("smileyFace",B);mxUtils.extend(E,mxActor);E.prototype.size=30;E.prototype.isRoundable=function(){return!0};E.prototype.redrawPath=function(g,r,A,u,z){r=Math.max(0,Math.min(u,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));-A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,0),new mxPoint(u,0),new mxPoint(u,z),new mxPoint(0,z),new mxPoint(0,r)],this.isRounded,A,!0);g.end()};mxCellRenderer.registerShape("card",E);mxUtils.extend(L,mxActor);L.prototype.size=.4;L.prototype.redrawPath=function(g,r,A,u,z){r=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.moveTo(0,r/2);g.quadTo(u/4,1.4*r,u/2,r/2);g.quadTo(3*u/4,r*(1-1.4),-u,r/2);g.lineTo(u,z-r/2);g.quadTo(3*u/4,z-1.4*r,u/2,z-r/2);g.quadTo(u/4,z-r*(1-1.4),0,z-r/2);g.lineTo(0,r/2);g.close();g.end()};L.prototype.getLabelBounds=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",this.size),A=g.width,u=g.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return r*=u,new mxRectangle(g.x,g.y+r,A,u-2*r);r*=A;return new mxRectangle(g.x+r,g.y,A-2*r,u)}return g};-mxCellRenderer.registerShape("tape",L);mxUtils.extend(Q,mxActor);Q.prototype.size=.3;Q.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*g.height):null};Q.prototype.redrawPath=function(g,r,A,u,z){r=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.moveTo(0,0);g.lineTo(u,0);g.lineTo(u,z-r/2);g.quadTo(3*u/4,z-1.4*r,u/2,z-r/2);g.quadTo(u/4,z-r*(1--1.4),0,z-r/2);g.lineTo(0,r/2);g.close();g.end()};mxCellRenderer.registerShape("document",Q);var Aa=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(g,r,A,u){var z=mxUtils.getValue(this.style,"size");return null!=z?u*Math.max(0,Math.min(1,z)):Aa.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,+this.stencil.desc.getElementsByTagName("labelBounds"),A=[],v=0;v<r.length;v++)A.push({condition:r[v].getAttribute("if"),x:Number(r[v].getAttribute("x")||0),y:Number(r[v].getAttribute("y")||0),w:Number(r[v].getAttribute("w")||this.stencil.w0),h:Number(r[v].getAttribute("h")||this.stencil.h0)});this.stencil.labelBounds=A}for(v=0;v<this.stencil.labelBounds.length;v++)if(r=this.stencil.labelBounds[v],null==r.condition||"1"==mxUtils.getValue(this.style,r.condition,"0")){v=this.stencil.computeAspect(this.style,+g.x,g.y,g.width,g.height);A=v.x-g.x+r.x*v.width;var z=v.y-g.y+r.y*v.height;return new mxRectangle(A,z,g.width-A-r.w*v.width,g.height-z-r.h*v.height)}}return ca.apply(this,arguments)};mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var g=null;if(null!=this.line)for(var r=0;r<this.line.length;r++){var A=this.line[r];null!=A&&(A=new mxRectangle(A.x,A.y,this.strokewidth,this.strokewidth),null==g?g=A:g.add(A))}this.bounds=null!=g?g:new mxRectangle};b.prototype.paintVertexShape=function(g,+r,A,v,z){this.paintTableLine(g,this.line,0,0)};b.prototype.paintTableLine=function(g,r,A,v){if(null!=r){var z=null;g.begin();for(var F=0;F<r.length;F++){var I=r[F];null!=I&&(null==z?g.moveTo(I.x+A,I.y+v):null!=z&&g.lineTo(I.x+A,I.y+v));z=I}g.end();g.stroke()}};b.prototype.intersectsRectangle=function(g){var r=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var A=null,v=0;v<this.line.length&&!r;v++){var z=this.line[v];null!=z&&null!=A&&(r=mxUtils.rectangleIntersectsSegment(g,+A,z));A=z}return r};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(d,mxSwimlane);d.prototype.fixedHeaderDefault=!1;d.prototype.paintVertexShape=function(g,r,A,v,z){var F=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):!1,I=this.isHorizontal(),ea=this.getTitleSize(),S=mxUtils.getValue(this.style,mxConstants.STYLE_FIXED_HEADER,this.fixedHeaderDefault);0==ea&&this.isRounded&&!this.outline?(S=mxShape.prototype.getArcSize.call(this,v,z),g.begin(),g.roundrect(r,A,v,z,+S,S),g.fillAndStroke()):0==ea&&!S||this.outline?Kb.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),g.translate(-r,-A));F||this.outline||!(I&&ea<z||!I&&ea<v)||this.paintForeground(g,r,A,v,z)};d.prototype.paintForeground=function(g,r,A,v,z){if(null!=this.state){var F=this.flipH,I=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var ea=F;F=I;I=ea}g.rotate(-this.getShapeRotation(),F,I,+r+v/2,A+z/2);s=this.scale;r=this.bounds.x/s;A=this.bounds.y/s;v=this.bounds.width/s;z=this.bounds.height/s;this.paintTableForeground(g,r,A,v,z)}};d.prototype.paintTableForeground=function(g,r,A,v,z){v=this.state.view.graph.getTableLines(this.state.cell,"0"!=mxUtils.getValue(this.state.style,"rowLines","1"),"0"!=mxUtils.getValue(this.state.style,"columnLines","1"));for(z=0;z<v.length;z++)b.prototype.paintTableLine(g,v[z],r,A)};d.prototype.configurePointerEvents=function(g){0==this.getTitleSize()?g.pointerEvents=+!1:mxSwimlane.prototype.configurePointerEvents.apply(this,arguments)};mxCellRenderer.registerShape("table",d);mxUtils.extend(m,d);m.prototype.paintForeground=function(){};mxCellRenderer.registerShape("tableRow",m);var ma=mxSwimlane.prototype.paintVertexShape;mxSwimlane.prototype.paintVertexShape=function(g,r,A,v,z){ma.apply(this,arguments);if(null!=this.state&&!this.outline){var F=this.state.view.graph;if((null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.laneFill&&this.laneFill!=mxConstants.NONE)&&+null!=F.paintTableCellLines){var I=this.state.cell;if(null!=F.isTableRow&&F.isTableRow(I)){var ea=this.getTitleSize();this.isHorizontal()?F.paintTableCellLines(g,I,0,0,v,Math.min(ea,z),this.stroke,this.strokewidth):F.paintTableCellLines(g,I,0,0,Math.min(ea,v),z,this.stroke,this.strokewidth)}else F.paintTableCellLines(g,I,0,0,v,z,this.stroke,this.strokewidth)}}};mxUtils.extend(p,mxCylinder);p.prototype.size=20;p.prototype.darkOpacity=0;p.prototype.darkOpacity2=0;p.prototype.paintVertexShape=function(g,+r,A,v,z){var F=Math.max(0,Math.min(v,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),I=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),ea=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));g.translate(r,A);g.begin();g.moveTo(0,0);g.lineTo(v-F,0);g.lineTo(v,F);g.lineTo(v,z);g.lineTo(F,z);g.lineTo(0,z-F);g.lineTo(0,0);g.close();g.end();g.fillAndStroke();this.outline||(g.setShadow(!1),+0!=I&&(g.setFillAlpha(Math.abs(I)),g.setFillColor(0>I?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(v-F,0),g.lineTo(v,F),g.lineTo(F,F),g.close(),g.fill()),0!=ea&&(g.setFillAlpha(Math.abs(ea)),g.setFillColor(0>ea?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(F,F),g.lineTo(F,z),g.lineTo(0,z-F),g.close(),g.fill()),g.begin(),g.moveTo(F,z),g.lineTo(F,F),g.lineTo(0,0),g.moveTo(F,F),g.lineTo(v,F),g.end(),g.stroke())};p.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,+"boundedLbl",!1)?(g=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(g,g,0,0)):null};mxCellRenderer.registerShape("cube",p);var pa=Math.tan(mxUtils.toRadians(30)),va=(.5-pa)/2;mxCellRenderer.registerShape("isoRectangle",y);mxUtils.extend(u,mxConnector);u.prototype.paintEdgeShape=function(g,r){var A=this.createMarker(g,r,!0),v=this.createMarker(g,r,!1);g.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&g.setDashed(this.isDashed,+null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);g.setShadow(!1);g.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);g.setStrokeColor(this.stroke);g.setFillColor(this.stroke);g.setDashed(!1);null!=A&&A();null!=v&&v()};mxCellRenderer.registerShape("wire",u);mxUtils.extend(n,mxCylinder);n.prototype.size=6;n.prototype.paintVertexShape=function(g,r,A,v,z){g.setFillColor(this.stroke);var F=Math.max(0,parseFloat(mxUtils.getValue(this.style,+"size",this.size))-2)+2*this.strokewidth;g.ellipse(r+.5*(v-F),A+.5*(z-F),F,F);g.fill();g.setFillColor(mxConstants.NONE);g.rect(r,A,v,z);g.fill()};mxCellRenderer.registerShape("waypoint",n);mxUtils.extend(y,mxActor);y.prototype.size=20;y.prototype.redrawPath=function(g,r,A,v,z){r=Math.min(v,z/pa);g.translate((v-r)/2,(z-r)/2+r/4);g.moveTo(0,.25*r);g.lineTo(.5*r,r*va);g.lineTo(r,.25*r);g.lineTo(.5*r,(.5-va)*r);g.lineTo(0,.25*r);g.close();g.end()};mxCellRenderer.registerShape("isoRectangle",y);mxUtils.extend(B,+mxCylinder);B.prototype.size=20;B.prototype.redrawPath=function(g,r,A,v,z,F){r=Math.min(v,z/(.5+pa));F?(g.moveTo(0,.25*r),g.lineTo(.5*r,(.5-va)*r),g.lineTo(r,.25*r),g.moveTo(.5*r,(.5-va)*r),g.lineTo(.5*r,(1-va)*r)):(g.translate((v-r)/2,(z-r)/2),g.moveTo(0,.25*r),g.lineTo(.5*r,r*va),g.lineTo(r,.25*r),g.lineTo(r,.75*r),g.lineTo(.5*r,(1-va)*r),g.lineTo(0,.75*r),g.close());g.end()};mxCellRenderer.registerShape("isoCube",B);mxUtils.extend(P,mxCylinder);P.prototype.redrawPath=function(g,r,A,v,z,F){r=Math.min(z/+2,Math.round(z/8)+this.strokewidth-1);if(F&&null!=this.fill||!F&&null==this.fill)g.moveTo(0,r),g.curveTo(0,2*r,v,2*r,v,r),F||(g.stroke(),g.begin()),g.translate(0,r/2),g.moveTo(0,r),g.curveTo(0,2*r,v,2*r,v,r),F||(g.stroke(),g.begin()),g.translate(0,r/2),g.moveTo(0,r),g.curveTo(0,2*r,v,2*r,v,r),F||(g.stroke(),g.begin()),g.translate(0,-r);F||(g.moveTo(0,r),g.curveTo(0,-r/3,v,-r/3,v,r),g.lineTo(v,z-r),g.curveTo(v,z+r/3,0,z+r/3,0,z-r),g.close())};P.prototype.getLabelMargins=function(g){return new mxRectangle(0,+2.5*Math.min(g.height/2,Math.round(g.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",P);mxUtils.extend(G,mxCylinder);G.prototype.size=30;G.prototype.darkOpacity=0;G.prototype.paintVertexShape=function(g,r,A,v,z){var F=Math.max(0,Math.min(v,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),I=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));g.translate(r,A);g.begin();g.moveTo(0,0);g.lineTo(v-F,0);g.lineTo(v,+F);g.lineTo(v,z);g.lineTo(0,z);g.lineTo(0,0);g.close();g.end();g.fillAndStroke();this.outline||(g.setShadow(!1),0!=I&&(g.setFillAlpha(Math.abs(I)),g.setFillColor(0>I?"#FFFFFF":"#000000"),g.begin(),g.moveTo(v-F,0),g.lineTo(v-F,F),g.lineTo(v,F),g.close(),g.fill()),g.begin(),g.moveTo(v-F,0),g.lineTo(v-F,F),g.lineTo(v,F),g.end(),g.stroke())};mxCellRenderer.registerShape("note",G);mxUtils.extend(O,G);mxCellRenderer.registerShape("note2",O);O.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,+"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(g.height*this.scale,r*this.scale),0,0)}return null};mxUtils.extend(U,mxShape);U.prototype.isoAngle=15;U.prototype.paintVertexShape=function(g,r,A,v,z){var F=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;F=Math.min(v*Math.tan(F),.5*z);g.translate(r,A);g.begin();g.moveTo(.5*v,0);g.lineTo(v,F);g.lineTo(v,z-F);g.lineTo(.5*v,z);g.lineTo(0,z-F);g.lineTo(0,+F);g.close();g.fillAndStroke();g.setShadow(!1);g.begin();g.moveTo(0,F);g.lineTo(.5*v,2*F);g.lineTo(v,F);g.moveTo(.5*v,2*F);g.lineTo(.5*v,z);g.stroke()};mxCellRenderer.registerShape("isoCube2",U);mxUtils.extend(c,mxShape);c.prototype.size=15;c.prototype.paintVertexShape=function(g,r,A,v,z){var F=Math.max(0,Math.min(.5*z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.translate(r,A);0==F?(g.rect(0,0,v,z),g.fillAndStroke()):(g.begin(),g.moveTo(0,F),g.arcTo(.5*v,F,0,0,1,.5*v,0),g.arcTo(.5*+v,F,0,0,1,v,F),g.lineTo(v,z-F),g.arcTo(.5*v,F,0,0,1,.5*v,z),g.arcTo(.5*v,F,0,0,1,0,z-F),g.close(),g.fillAndStroke(),g.setShadow(!1),g.begin(),g.moveTo(v,F),g.arcTo(.5*v,F,0,0,1,.5*v,2*F),g.arcTo(.5*v,F,0,0,1,0,F),g.stroke())};mxCellRenderer.registerShape("cylinder2",c);mxUtils.extend(f,mxCylinder);f.prototype.size=15;f.prototype.paintVertexShape=function(g,r,A,v,z){var F=Math.max(0,Math.min(.5*z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),I=mxUtils.getValue(this.style,"lid",!0);g.translate(r,+A);0==F?(g.rect(0,0,v,z),g.fillAndStroke()):(g.begin(),I?(g.moveTo(0,F),g.arcTo(.5*v,F,0,0,1,.5*v,0),g.arcTo(.5*v,F,0,0,1,v,F)):(g.moveTo(0,0),g.arcTo(.5*v,F,0,0,0,.5*v,F),g.arcTo(.5*v,F,0,0,0,v,0)),g.lineTo(v,z-F),g.arcTo(.5*v,F,0,0,1,.5*v,z),g.arcTo(.5*v,F,0,0,1,0,z-F),g.close(),g.fillAndStroke(),g.setShadow(!1),I&&(g.begin(),g.moveTo(v,F),g.arcTo(.5*v,F,0,0,1,.5*v,2*F),g.arcTo(.5*v,F,0,0,1,0,F),g.stroke()))};mxCellRenderer.registerShape("cylinder3",f);mxUtils.extend(k,mxActor);k.prototype.redrawPath=+function(g,r,A,v,z){g.moveTo(0,0);g.quadTo(v/2,.5*z,v,0);g.quadTo(.5*v,z/2,v,z);g.quadTo(v/2,.5*z,0,z);g.quadTo(.5*v,z/2,0,0);g.end()};mxCellRenderer.registerShape("switch",k);mxUtils.extend(q,mxCylinder);q.prototype.tabWidth=60;q.prototype.tabHeight=20;q.prototype.tabPosition="right";q.prototype.arcSize=.1;q.prototype.isRoundable=function(){return!0};q.prototype.paintVertexShape=function(g,r,A,v,z){g.translate(r,A);r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));+A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var F=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),I=mxUtils.getValue(this.style,"rounded",!1),ea=mxUtils.getValue(this.style,"absoluteArcSize",!1),S=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));ea||(S*=Math.min(v,z));S=Math.min(S,.5*v,.5*(z-A));r=Math.max(r,S);r=Math.min(v-S,r);I||(S=0);g.begin();"left"==F?(g.moveTo(Math.max(S,0),A),g.lineTo(Math.max(S,0),0),g.lineTo(r,+0),g.lineTo(r,A)):(g.moveTo(v-r,A),g.lineTo(v-r,0),g.lineTo(v-Math.max(S,0),0),g.lineTo(v-Math.max(S,0),A));I?(g.moveTo(0,S+A),g.arcTo(S,S,0,0,1,S,A),g.lineTo(v-S,A),g.arcTo(S,S,0,0,1,v,S+A),g.lineTo(v,z-S),g.arcTo(S,S,0,0,1,v-S,z),g.lineTo(S,z),g.arcTo(S,S,0,0,1,0,z-S)):(g.moveTo(0,A),g.lineTo(v,A),g.lineTo(v,z),g.lineTo(0,z));g.close();g.fillAndStroke();g.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(g.begin(),g.moveTo(v-30,A+20),g.lineTo(v-20,A+10),g.lineTo(v-10,+A+20),g.close(),g.stroke())};mxCellRenderer.registerShape("folder",q);q.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var A=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var v=mxUtils.getValue(this.style,"rounded",!1),z=mxUtils.getValue(this.style,"absoluteArcSize",!1),F=parseFloat(mxUtils.getValue(this.style,+"arcSize",this.arcSize));z||(F*=Math.min(g.width,g.height));F=Math.min(F,.5*g.width,.5*(g.height-r));v||(F=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(F,0,Math.min(g.width,g.width-A),Math.min(g.height,g.height-r)):new mxRectangle(Math.min(g.width,g.width-A),0,F,Math.min(g.height,g.height-r))}return new mxRectangle(0,Math.min(g.height,r),0,0)}return null};mxUtils.extend(x,mxCylinder);x.prototype.arcSize=.1;x.prototype.paintVertexShape=function(g,r,A,+v,z){g.translate(r,A);var F=mxUtils.getValue(this.style,"rounded",!1),I=mxUtils.getValue(this.style,"absoluteArcSize",!1);r=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));A=mxUtils.getValue(this.style,"umlStateConnection",null);I||(r*=Math.min(v,z));r=Math.min(r,.5*v,.5*z);F||(r=0);F=0;null!=A&&(F=10);g.begin();g.moveTo(F,r);g.arcTo(r,r,0,0,1,F+r,0);g.lineTo(v-r,0);g.arcTo(r,r,0,0,1,v,r);g.lineTo(v,z-r);g.arcTo(r,r,0,0,1,v-r,z);g.lineTo(F+r,z);g.arcTo(r,r,0,0,1,F,z-r);g.close();g.fillAndStroke();+g.setShadow(!1);"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(g.roundrect(v-40,z-20,10,10,3,3),g.stroke(),g.roundrect(v-20,z-20,10,10,3,3),g.stroke(),g.begin(),g.moveTo(v-30,z-15),g.lineTo(v-20,z-15),g.stroke());"connPointRefEntry"==A?(g.ellipse(0,.5*z-10,20,20),g.fillAndStroke()):"connPointRefExit"==A&&(g.ellipse(0,.5*z-10,20,20),g.fillAndStroke(),g.begin(),g.moveTo(5,.5*z-5),g.lineTo(15,.5*z+5),g.moveTo(15,.5*z-5),g.lineTo(5,.5*z+5),g.stroke())};x.prototype.getLabelMargins=+function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};mxCellRenderer.registerShape("umlState",x);mxUtils.extend(C,mxShape);C.prototype.featureColor="#666666";C.prototype.paintVertexShape=function(g,r,A,v,z){var F=mxUtils.getValue(this.style,"smileyType","happy"),I=mxUtils.getValue(this.style,"smileyFeatureColor",C.prototype.featureColor);g.translate(r,A);r=Math.min(v,z)/2;g.ellipse(v/+2-r,z/2-r,2*r,2*r);g.fillAndStroke();r=Math.min(v,z)/30;v/=2;z/=2;g.setFillColor(I);g.setStrokeColor(I);g.setStrokeWidth(2*r);I=1.5*r;A=5*r;var ea=5*r;g.ellipse(v-A-I,z-ea-I,2*I,2*I);g.fillAndStroke();g.ellipse(v+A-I,z-ea-I,2*I,2*I);g.fillAndStroke();g.setStrokeWidth(1*r);g.setFillColor("#000000");"happy"==F?(F=v,I=z+2*r,g.begin(),g.moveTo(F+7.5*r,I),g.arcTo(7.5*r,7.5*r,0,1,1,F-7.5*r,I),g.lineTo(F-6.818*r,I),g.arcTo(6.818*r,6.818*r,0,1,0,F+6.818*r,I),g.close(),g.fillAndStroke()):"sad"==F?(F=v,I=z++7*r,g.begin(),g.moveTo(F-7.5*r,I),g.arcTo(7.5*r,7.5*r,0,1,1,F+7.5*r,I),g.lineTo(F+6.818*r,I),g.arcTo(6.818*r,6.818*r,0,1,0,F-6.818*r,I),g.close(),g.fillAndStroke()):(g.begin(),g.moveTo(v-5*r,z+7*r),g.lineTo(v+5*r,z+7*r),g.stroke())};mxCellRenderer.registerShape("smileyFace",C);mxUtils.extend(E,mxActor);E.prototype.size=30;E.prototype.isRoundable=function(){return!0};E.prototype.redrawPath=function(g,r,A,v,z){r=Math.max(0,Math.min(v,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));+A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,0),new mxPoint(v,0),new mxPoint(v,z),new mxPoint(0,z),new mxPoint(0,r)],this.isRounded,A,!0);g.end()};mxCellRenderer.registerShape("card",E);mxUtils.extend(L,mxActor);L.prototype.size=.4;L.prototype.redrawPath=function(g,r,A,v,z){r=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.moveTo(0,r/2);g.quadTo(v/4,1.4*r,v/2,r/2);g.quadTo(3*v/4,r*(1-1.4),+v,r/2);g.lineTo(v,z-r/2);g.quadTo(3*v/4,z-1.4*r,v/2,z-r/2);g.quadTo(v/4,z-r*(1-1.4),0,z-r/2);g.lineTo(0,r/2);g.close();g.end()};L.prototype.getLabelBounds=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",this.size),A=g.width,v=g.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return r*=v,new mxRectangle(g.x,g.y+r,A,v-2*r);r*=A;return new mxRectangle(g.x+r,g.y,A-2*r,v)}return g};+mxCellRenderer.registerShape("tape",L);mxUtils.extend(Q,mxActor);Q.prototype.size=.3;Q.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*g.height):null};Q.prototype.redrawPath=function(g,r,A,v,z){r=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.moveTo(0,0);g.lineTo(v,0);g.lineTo(v,z-r/2);g.quadTo(3*v/4,z-1.4*r,v/2,z-r/2);g.quadTo(v/4,z-r*(1-+1.4),0,z-r/2);g.lineTo(0,r/2);g.close();g.end()};mxCellRenderer.registerShape("document",Q);var Aa=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(g,r,A,v){var z=mxUtils.getValue(this.style,"size");return null!=z?v*Math.max(0,Math.min(1,z)):Aa.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,g.height*r),0,0)}return null};f.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",15);mxUtils.getValue(this.style,"lid",!0)||(r/=2);return new mxRectangle(0,Math.min(g.height*this.scale,2*r*this.scale),0,Math.max(0,.3*r*this.scale))}return null};q.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,-"labelInHeader",!1)){var A=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var u=mxUtils.getValue(this.style,"rounded",!1),z=mxUtils.getValue(this.style,"absoluteArcSize",!1),F=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));z||(F*=Math.min(g.width,g.height));F=Math.min(F,.5*g.width,.5*(g.height-r));u||(F=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(F,0,Math.min(g.width,g.width-+"labelInHeader",!1)){var A=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var v=mxUtils.getValue(this.style,"rounded",!1),z=mxUtils.getValue(this.style,"absoluteArcSize",!1),F=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));z||(F*=Math.min(g.width,g.height));F=Math.min(F,.5*g.width,.5*(g.height-r));v||(F=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(F,0,Math.min(g.width,g.width-A),Math.min(g.height,g.height-r)):new mxRectangle(Math.min(g.width,g.width-A),0,F,Math.min(g.height,g.height-r))}return new mxRectangle(0,Math.min(g.height,r),0,0)}return null};x.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};O.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",-15);return new mxRectangle(0,Math.min(g.height*this.scale,r*this.scale),0,Math.max(0,r*this.scale))}return null};mxUtils.extend(V,mxActor);V.prototype.size=.2;V.prototype.fixedSize=20;V.prototype.isRoundable=function(){return!0};V.prototype.redrawPath=function(g,r,A,u,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,-mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,z),new mxPoint(r,0),new mxPoint(u,0),new mxPoint(u-r,z)],this.isRounded,A,!0);g.end()};mxCellRenderer.registerShape("parallelogram",V);mxUtils.extend(K,mxActor);K.prototype.size=.2;K.prototype.fixedSize=20;K.prototype.isRoundable=function(){return!0};K.prototype.redrawPath=function(g,r,A,u,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",-this.fixedSize)))):u*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,z),new mxPoint(r,0),new mxPoint(u-r,0),new mxPoint(u,z)],this.isRounded,A,!0)};mxCellRenderer.registerShape("trapezoid",K);mxUtils.extend(fa,mxActor);fa.prototype.size=.5;fa.prototype.redrawPath=function(g,r,A,u,z){g.setFillColor(null);r=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,-"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(u,0),new mxPoint(r,0),new mxPoint(r,z/2),new mxPoint(0,z/2),new mxPoint(r,z/2),new mxPoint(r,z),new mxPoint(u,z)],this.isRounded,A,!1);g.end()};mxCellRenderer.registerShape("curlyBracket",fa);mxUtils.extend(aa,mxActor);aa.prototype.redrawPath=function(g,r,A,u,z){g.setStrokeWidth(1);g.setFillColor(this.stroke);r=u/5;g.rect(0,0,r,z);g.fillAndStroke();g.rect(2*r,0,r,-z);g.fillAndStroke();g.rect(4*r,0,r,z);g.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",aa);da.prototype.moveTo=function(g,r){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r;this.firstX=g;this.firstY=r};da.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};da.prototype.quadTo=function(g,r,A,u){this.originalQuadTo.apply(this.canvas,-arguments);this.lastX=A;this.lastY=u};da.prototype.curveTo=function(g,r,A,u,z,F){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=z;this.lastY=F};da.prototype.arcTo=function(g,r,A,u,z,F,I){this.originalArcTo.apply(this.canvas,arguments);this.lastX=F;this.lastY=I};da.prototype.lineTo=function(g,r){if(null!=this.lastX&&null!=this.lastY){var A=function(oa){return"number"===typeof oa?oa?0>oa?-1:1:oa===oa?0:NaN:NaN},u=Math.abs(g-this.lastX),z=Math.abs(r-this.lastY),F=Math.sqrt(u*u+z*z);if(2>-F){this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r;return}var I=Math.round(F/10),ea=this.defaultVariation;5>I&&(I=5,ea/=3);var S=A(g-this.lastX)*u/I;A=A(r-this.lastY)*z/I;u/=F;z/=F;for(F=0;F<I;F++){var ta=(Math.random()-.5)*ea;this.originalLineTo.call(this.canvas,S*F+this.lastX-ta*z,A*F+this.lastY-ta*u)}this.originalLineTo.call(this.canvas,g,r)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r};da.prototype.destroy=function(){this.canvas.lineTo=+15);return new mxRectangle(0,Math.min(g.height*this.scale,r*this.scale),0,Math.max(0,r*this.scale))}return null};mxUtils.extend(V,mxActor);V.prototype.size=.2;V.prototype.fixedSize=20;V.prototype.isRoundable=function(){return!0};V.prototype.redrawPath=function(g,r,A,v,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,+mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,z),new mxPoint(r,0),new mxPoint(v,0),new mxPoint(v-r,z)],this.isRounded,A,!0);g.end()};mxCellRenderer.registerShape("parallelogram",V);mxUtils.extend(K,mxActor);K.prototype.size=.2;K.prototype.fixedSize=20;K.prototype.isRoundable=function(){return!0};K.prototype.redrawPath=function(g,r,A,v,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*v,parseFloat(mxUtils.getValue(this.style,"size",+this.fixedSize)))):v*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,z),new mxPoint(r,0),new mxPoint(v-r,0),new mxPoint(v,z)],this.isRounded,A,!0)};mxCellRenderer.registerShape("trapezoid",K);mxUtils.extend(fa,mxActor);fa.prototype.size=.5;fa.prototype.redrawPath=function(g,r,A,v,z){g.setFillColor(null);r=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,+"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(v,0),new mxPoint(r,0),new mxPoint(r,z/2),new mxPoint(0,z/2),new mxPoint(r,z/2),new mxPoint(r,z),new mxPoint(v,z)],this.isRounded,A,!1);g.end()};mxCellRenderer.registerShape("curlyBracket",fa);mxUtils.extend(aa,mxActor);aa.prototype.redrawPath=function(g,r,A,v,z){g.setStrokeWidth(1);g.setFillColor(this.stroke);r=v/5;g.rect(0,0,r,z);g.fillAndStroke();g.rect(2*r,0,r,+z);g.fillAndStroke();g.rect(4*r,0,r,z);g.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",aa);da.prototype.moveTo=function(g,r){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r;this.firstX=g;this.firstY=r};da.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};da.prototype.quadTo=function(g,r,A,v){this.originalQuadTo.apply(this.canvas,+arguments);this.lastX=A;this.lastY=v};da.prototype.curveTo=function(g,r,A,v,z,F){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=z;this.lastY=F};da.prototype.arcTo=function(g,r,A,v,z,F,I){this.originalArcTo.apply(this.canvas,arguments);this.lastX=F;this.lastY=I};da.prototype.lineTo=function(g,r){if(null!=this.lastX&&null!=this.lastY){var A=function(oa){return"number"===typeof oa?oa?0>oa?-1:1:oa===oa?0:NaN:NaN},v=Math.abs(g-this.lastX),z=Math.abs(r-this.lastY),F=Math.sqrt(v*v+z*z);if(2>+F){this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r;return}var I=Math.round(F/10),ea=this.defaultVariation;5>I&&(I=5,ea/=3);var S=A(g-this.lastX)*v/I;A=A(r-this.lastY)*z/I;v/=F;z/=F;for(F=0;F<I;F++){var ta=(Math.random()-.5)*ea;this.originalLineTo.call(this.canvas,S*F+this.lastX-ta*z,A*F+this.lastY-ta*v)}this.originalLineTo.call(this.canvas,g,r)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r};da.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var xa=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(g){xa.apply(this,arguments);null==g.handJiggle&&(g.handJiggle=this.createHandJiggle(g))};var Ma=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(g){Ma.apply(this,arguments);null!=g.handJiggle&&(g.handJiggle.destroy(),delete g.handJiggle)};mxShape.prototype.createComicCanvas=function(g){return new da(g,mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(g){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(g)};var Wa=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.outline&&(null==this.style||"0"==mxUtils.getValue(this.style,-"comic","0")&&"0"==mxUtils.getValue(this.style,"sketch","1"==urlParams.rough?"1":"0"))&&Wa.apply(this,arguments)};var Za=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(g,r,A,u,z){if(null==g.handJiggle||g.handJiggle.constructor!=da)Za.apply(this,arguments);else{var F=!0;null!=this.style&&(F="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(F||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)F||-null!=this.fill&&this.fill!=mxConstants.NONE||(g.pointerEvents=!1),g.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?F=Math.min(u/2,Math.min(z/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,F=Math.min(u*F,z*F)),g.moveTo(r+F,A),g.lineTo(r+u-F,A),g.quadTo(r+u,A,r+u,A+F),g.lineTo(r+u,A+z-F),g.quadTo(r+u,A+z,r+u-F,-A+z),g.lineTo(r+F,A+z),g.quadTo(r,A+z,r,A+z-F),g.lineTo(r,A+F),g.quadTo(r,A,r+F,A)):(g.moveTo(r,A),g.lineTo(r+u,A),g.lineTo(r+u,A+z),g.lineTo(r,A+z),g.lineTo(r,A)),g.close(),g.end(),g.fillAndStroke()}};mxUtils.extend(ba,mxRectangleShape);ba.prototype.size=.1;ba.prototype.fixedSize=!1;ba.prototype.isHtmlAllowed=function(){return!1};ba.prototype.getLabelBounds=function(g){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||-this.direction==mxConstants.DIRECTION_WEST)){var r=g.width,A=g.height;g=new mxRectangle(g.x,g.y,r,A);var u=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),z=parseFloat(mxUtils.getValue(this.style,"size",this.size));u?z=Math.max(0,Math.min(r,z*this.scale)):(z=r*Math.max(0,Math.min(1,z)),this.isRounded&&(u=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,z=Math.max(z,Math.min(r*u,A*u))));g.x+=Math.round(z);g.width-=Math.round(2*z);return g}return g};-ba.prototype.paintForeground=function(g,r,A,u,z){var F=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),I=parseFloat(mxUtils.getValue(this.style,"size",this.size));I=F?Math.max(0,Math.min(u,I)):u*Math.max(0,Math.min(1,I));this.isRounded&&(F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,I=Math.max(I,Math.min(u*F,z*F)));I=Math.round(I);g.begin();g.moveTo(r+I,A);g.lineTo(r+I,A+z);g.moveTo(r+u-I,A);g.lineTo(r+u-I,A+z);g.end();g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,-arguments)};mxCellRenderer.registerShape("process",ba);mxCellRenderer.registerShape("process2",ba);mxUtils.extend(ha,mxRectangleShape);ha.prototype.paintBackground=function(g,r,A,u,z){g.setFillColor(mxConstants.NONE);g.rect(r,A,u,z);g.fill()};ha.prototype.paintForeground=function(g,r,A,u,z){};mxCellRenderer.registerShape("transparent",ha);mxUtils.extend(qa,mxHexagon);qa.prototype.size=30;qa.prototype.position=.5;qa.prototype.position2=.5;qa.prototype.base=20;qa.prototype.getLabelMargins=function(){return new mxRectangle(0,-0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};qa.prototype.isRoundable=function(){return!0};qa.prototype.redrawPath=function(g,r,A,u,z){r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var F=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),I=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",-this.position2)))),ea=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(g,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,z-A),new mxPoint(Math.min(u,F+ea),z-A),new mxPoint(I,z),new mxPoint(Math.max(0,F),z-A),new mxPoint(0,z-A)],this.isRounded,r,!0,[4])};mxCellRenderer.registerShape("callout",qa);mxUtils.extend(ra,mxActor);ra.prototype.size=.2;ra.prototype.fixedSize=20;ra.prototype.isRoundable=function(){return!0};ra.prototype.redrawPath=function(g,-r,A,u,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(u-r,0),new mxPoint(u,z/2),new mxPoint(u-r,z),new mxPoint(0,z),new mxPoint(r,z/2)],this.isRounded,A,!0);g.end()};mxCellRenderer.registerShape("step",-ra);mxUtils.extend(l,mxHexagon);l.prototype.size=.25;l.prototype.fixedSize=20;l.prototype.isRoundable=function(){return!0};l.prototype.redrawPath=function(g,r,A,u,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,-0),new mxPoint(u-r,0),new mxPoint(u,.5*z),new mxPoint(u-r,z),new mxPoint(r,z),new mxPoint(0,.5*z)],this.isRounded,A,!0)};mxCellRenderer.registerShape("hexagon",l);mxUtils.extend(t,mxRectangleShape);t.prototype.isHtmlAllowed=function(){return!1};t.prototype.paintForeground=function(g,r,A,u,z){var F=Math.min(u/5,z/5)+1;g.begin();g.moveTo(r+u/2,A+F);g.lineTo(r+u/2,A+z-F);g.moveTo(r+F,A+z/2);g.lineTo(r+u-F,A+z/2);g.end();g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",-t);var pb=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(g){if(1==this.style["double"]){var r=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(g.x+r,g.y+r,g.width-2*r,g.height-2*r)}return g};mxRhombus.prototype.paintVertexShape=function(g,r,A,u,z){pb.apply(this,arguments);var F=r,I=A,ea=u,S=z;if(!this.outline&&1==this.style["double"]){var ta=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||-0);r+=ta;A+=ta;u-=2*ta;z-=2*ta;0<u&&0<z&&(g.setShadow(!1),pb.apply(this,[g,r,A,u,z]))}this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(g,F,I,ea,S,0)};mxShape.prototype.paintGlassEffect=function(g,r,A,u,z,F){var I=Math.ceil(this.strokewidth/2);g.setGradient("#ffffff","#ffffff",r,A,u,.6*z,"south",.9,.1);g.begin();this.paintGlassEffectPath(g,r,A,u,z,I,F);g.close();g.fill()};mxShape.prototype.paintGlassEffectPath=function(g,r,A,u,z,F,I){I+=2*F;this.isRounded?-(g.moveTo(r-F+I,A-F),g.quadTo(r-F,A-F,r-F,A-F+I),g.lineTo(r-F,A+.4*z),g.quadTo(r+.5*u,A+.7*z,r+u+F,A+.4*z),g.lineTo(r+u+F,A-F+I),g.quadTo(r+u+F,A-F,r+u+F-I,A-F)):(g.moveTo(r-F,A-F),g.lineTo(r-F,A+.4*z),g.quadTo(r+.5*u,A+.7*z,r+u+F,A+.4*z),g.lineTo(r+u+F,A-F))};mxEllipse.prototype.paintGlassEffectPath=function(g,r,A,u,z,F,I){I=u/2+F;F=z/2+F;r+=u/2;A+=z/2;g.moveTo(r-I,A);g.curveTo(r-I,A-.5522847498*F,r-.5522847498*I,A-F,r,A-F);g.curveTo(r+.5522847498*I,A-F,r+I,A-.5522847498*F,r+I,A);g.quadTo(r,A+.2*-z,r-I,A)};mxRhombus.prototype.paintGlassEffectPath=function(g,r,A,u,z,F,I){F=u/2;I=z/2;var ea=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,A+I),new mxPoint(r+F,A),new mxPoint(r+u,A+I)],this.isRounded,ea,!1);g.quadTo(r+F,A+.7*z,r,A+I)};var rb=mxEllipse.prototype.paintVertexShape;mxEllipse.prototype.paintVertexShape=function(g,r,A,u,z){rb.apply(this,arguments);this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&-this.paintGlassEffect(g,r,A,u,z,0)};mxUtils.extend(H,mxRectangleShape);H.prototype.isHtmlAllowed=function(){return!1};H.prototype.getLabelBounds=function(g){if(1==this.style["double"]){var r=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(g.x+r,g.y+r,g.width-2*r,g.height-2*r)}return g};H.prototype.paintForeground=function(g,r,A,u,z){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var F=Math.max(2,this.strokewidth+-1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);r+=F;A+=F;u-=2*F;z-=2*F;0<u&&0<z&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}g.setDashed(!1);F=0;do{var I=mxCellRenderer.defaultShapes[this.style["symbol"+F]];if(null!=I){var ea=this.style["symbol"+F+"Align"],S=this.style["symbol"+F+"VerticalAlign"],ta=this.style["symbol"+F+"Width"],oa=this.style["symbol"+F+"Height"],Ia=this.style["symbol"+F+"Spacing"]||0,mb=this.style["symbol"+F+"VSpacing"]||Ia,$a=this.style["symbol"+F+-"ArcSpacing"];null!=$a&&($a*=this.getArcSize(u+this.strokewidth,z+this.strokewidth),Ia+=$a,mb+=$a);$a=r;var Ea=A;$a=ea==mxConstants.ALIGN_CENTER?$a+(u-ta)/2:ea==mxConstants.ALIGN_RIGHT?$a+(u-ta-Ia):$a+Ia;Ea=S==mxConstants.ALIGN_MIDDLE?Ea+(z-oa)/2:S==mxConstants.ALIGN_BOTTOM?Ea+(z-oa-mb):Ea+mb;g.save();ea=new I;ea.style=this.style;I.prototype.paintVertexShape.call(ea,g,$a,Ea,ta,oa);g.restore()}F++}while(null!=I)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",-H);mxUtils.extend(J,mxCylinder);J.prototype.redrawPath=function(g,r,A,u,z,F){F?(g.moveTo(0,0),g.lineTo(u/2,z/2),g.lineTo(u,0),g.end()):(g.moveTo(0,0),g.lineTo(u,0),g.lineTo(u,z),g.lineTo(0,z),g.close())};mxCellRenderer.registerShape("message",J);mxUtils.extend(R,mxShape);R.prototype.paintBackground=function(g,r,A,u,z){g.translate(r,A);g.ellipse(u/4,0,u/2,z/4);g.fillAndStroke();g.begin();g.moveTo(u/2,z/4);g.lineTo(u/2,2*z/3);g.moveTo(u/2,z/3);g.lineTo(0,z/3);g.moveTo(u/2,z/3);g.lineTo(u,z/3);g.moveTo(u/-2,2*z/3);g.lineTo(0,z);g.moveTo(u/2,2*z/3);g.lineTo(u,z);g.end();g.stroke()};mxCellRenderer.registerShape("umlActor",R);mxUtils.extend(T,mxShape);T.prototype.getLabelMargins=function(g){return new mxRectangle(g.width/6,0,0,0)};T.prototype.paintBackground=function(g,r,A,u,z){g.translate(r,A);g.begin();g.moveTo(0,z/4);g.lineTo(0,3*z/4);g.end();g.stroke();g.begin();g.moveTo(0,z/2);g.lineTo(u/6,z/2);g.end();g.stroke();g.ellipse(u/6,0,5*u/6,z);g.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",-T);mxUtils.extend(Y,mxEllipse);Y.prototype.paintVertexShape=function(g,r,A,u,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.begin();g.moveTo(r+u/8,A+z);g.lineTo(r+7*u/8,A+z);g.end();g.stroke()};mxCellRenderer.registerShape("umlEntity",Y);mxUtils.extend(Z,mxShape);Z.prototype.paintVertexShape=function(g,r,A,u,z){g.translate(r,A);g.begin();g.moveTo(u,0);g.lineTo(0,z);g.moveTo(0,0);g.lineTo(u,z);g.end();g.stroke()};mxCellRenderer.registerShape("umlDestroy",Z);mxUtils.extend(ia,mxShape);-ia.prototype.getLabelBounds=function(g){return new mxRectangle(g.x,g.y+g.height/8,g.width,7*g.height/8)};ia.prototype.paintBackground=function(g,r,A,u,z){g.translate(r,A);g.begin();g.moveTo(3*u/8,z/8*1.1);g.lineTo(5*u/8,0);g.end();g.stroke();g.ellipse(0,z/8,u,7*z/8);g.fillAndStroke()};ia.prototype.paintForeground=function(g,r,A,u,z){g.begin();g.moveTo(3*u/8,z/8*1.1);g.lineTo(5*u/8,z/4);g.end();g.stroke()};mxCellRenderer.registerShape("umlControl",ia);mxUtils.extend(X,mxShape);X.prototype.iconSize=-44;X.prototype.paintBackground=function(g,r,A,u,z){z=Math.min(this.iconSize,u,z);var F=.9*z,I=.45*z;r=r+u/2-z/2;u=A+z/2;var ea=r+.175*F;F=ea-F;g.begin();g.moveTo(F,u-I/2);g.lineTo(F,u+I/2);g.end();g.stroke();g.begin();g.moveTo(F,u);g.lineTo(ea,u);g.end();g.stroke();g.ellipse(r,A,z,z);g.fillAndStroke()};mxCellRenderer.registerShape("seqBoundary",X);mxCellRenderer.registerShape("seqControl",ka(ia,44));mxCellRenderer.registerShape("seqEntity",ka(Y,44));mxUtils.extend(ja,mxShape);ja.prototype.paintBackground=-function(g,r,A,u,z){var F=z/2,I=F/(2.5+z/50);g.save();g.translate(r,A);g.begin();g.moveTo(I,0);g.lineTo(u-I,0);g.arcTo(I,F,0,0,1,u-I,z);g.lineTo(I,z);g.arcTo(I,F,0,0,1,I,0);g.close();g.fillAndStroke();g.restore()};ja.prototype.paintForeground=function(g,r,A,u,z){var F=z/2,I=F/(2.5+z/50);g.save();g.translate(r,A);g.begin();g.moveTo(u-I,0);g.arcTo(I,F,0,0,0,u-I,z);g.stroke();g.restore()};mxCellRenderer.registerShape("seqQueue",ja);mxUtils.extend(na,mxShape);na.prototype.paintBackground=function(g,r,-A,u,z){g.rect(r+6,A-6,u,z);g.fillAndStroke();g.rect(r,A,u,z);g.fillAndStroke()};mxCellRenderer.registerShape("seqCollections",na);mxUtils.extend(la,mxShape);la.prototype.paintBackground=function(g,r,A,u,z){z=u/3;var F=u/3,I=z/2,ea=I/(2.5+z/50);g.translate(r+(u-z)/2,A);g.begin();g.moveTo(0,ea);g.arcTo(I,ea,0,0,0,z,ea);g.arcTo(I,ea,0,0,0,0,ea);g.lineTo(0,F-ea);g.arcTo(I,ea,0,0,0,z,F-ea);g.lineTo(z,ea);g.fillAndStroke()};mxCellRenderer.registerShape("seqDatabase",la);mxUtils.extend(va,mxShape);va.prototype.paintBackground=-function(g,r,A,u,z){r+=u/2;A+=15;u=A+15;z=u+20;var F=u+10,I=z+15;g.ellipse(r-15,A-15,30,30);g.fillAndStroke();g.begin();g.moveTo(r,u);g.lineTo(r,z);g.moveTo(r-18,F);g.lineTo(r+18,F);g.moveTo(r,z);g.lineTo(r-16,I);g.moveTo(r,z);g.lineTo(r+16,I);g.stroke()};mxCellRenderer.registerShape("seqActorStick",va);mxUtils.extend(za,mxRectangleShape);za.prototype.size=40;za.prototype.isHtmlAllowed=function(){return!1};za.prototype.isMirrored=function(){return"1"==mxUtils.getValue(this.style,"lifelineMirror",-"0")};za.prototype.getHeadSize=function(g){return Math.max(0,Math.min(this.isMirrored()?g/2:g,parseFloat(mxUtils.getValue(this.style,"size",this.size))))};za.prototype.getLabelBounds=function(g){var r=Math.max(0,Math.min(this.isMirrored()?g.height/2:g.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(g.x,g.y,g.width,r)};za.prototype.paintBackground=function(g,r,A,u,z){var F=this.getHeadSize(z),I=this.isMirrored(),ea=mxUtils.getValue(this.style,"participant");-null==ea||null==this.state?(mxRectangleShape.prototype.paintBackground.call(this,g,r,A,u,F),I&&mxRectangleShape.prototype.paintBackground.call(this,g,r,A+z-F,u,F)):(ea=this.state.view.graph.cellRenderer.getShape(ea),null!=ea&&ea!=za&&(ea=new ea,ea.apply(this.state),g.save(),ea.paintVertexShape(g,r,A,u,F),g.restore(),I&&(g.save(),ea.paintVertexShape(g,r,A+z-F,u,F),g.restore())));z=I?z-F:z;F<z&&(g.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),g.begin(),g.moveTo(r+u/2,A+F),g.lineTo(r+-u/2,A+z),g.end(),g.stroke())};za.prototype.paintForeground=function(g,r,A,u,z){var F=mxUtils.getValue(this.style,"participant"),I=this.getHeadSize(z),ea=this.isMirrored();null==F&&(mxRectangleShape.prototype.paintForeground.call(this,g,r,A,u,Math.min(z,I)),ea&&mxRectangleShape.prototype.paintForeground.call(this,g,r,A+z-I,u,I));ea&&this.paintMirrorLabel(g,r,A+z-I,u,I)};za.prototype.paintMirrorLabel=function(g,r,A,u,z){var F=null!=this.state?this.state.view.graph.getLabel(this.state.cell):null;this.mirrorLabelValue=+"comic","0")&&"0"==mxUtils.getValue(this.style,"sketch","1"==urlParams.rough?"1":"0"))&&Wa.apply(this,arguments)};var Za=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(g,r,A,v,z){if(null==g.handJiggle||g.handJiggle.constructor!=da)Za.apply(this,arguments);else{var F=!0;null!=this.style&&(F="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(F||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)F||+null!=this.fill&&this.fill!=mxConstants.NONE||(g.pointerEvents=!1),g.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?F=Math.min(v/2,Math.min(z/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,F=Math.min(v*F,z*F)),g.moveTo(r+F,A),g.lineTo(r+v-F,A),g.quadTo(r+v,A,r+v,A+F),g.lineTo(r+v,A+z-F),g.quadTo(r+v,A+z,r+v-F,+A+z),g.lineTo(r+F,A+z),g.quadTo(r,A+z,r,A+z-F),g.lineTo(r,A+F),g.quadTo(r,A,r+F,A)):(g.moveTo(r,A),g.lineTo(r+v,A),g.lineTo(r+v,A+z),g.lineTo(r,A+z),g.lineTo(r,A)),g.close(),g.end(),g.fillAndStroke()}};mxUtils.extend(ba,mxRectangleShape);ba.prototype.size=.1;ba.prototype.fixedSize=!1;ba.prototype.isHtmlAllowed=function(){return!1};ba.prototype.getLabelBounds=function(g){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||+this.direction==mxConstants.DIRECTION_WEST)){var r=g.width,A=g.height;g=new mxRectangle(g.x,g.y,r,A);var v=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),z=parseFloat(mxUtils.getValue(this.style,"size",this.size));v?z=Math.max(0,Math.min(r,z*this.scale)):(z=r*Math.max(0,Math.min(1,z)),this.isRounded&&(v=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,z=Math.max(z,Math.min(r*v,A*v))));g.x+=Math.round(z);g.width-=Math.round(2*z);return g}return g};+ba.prototype.paintForeground=function(g,r,A,v,z){var F=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),I=parseFloat(mxUtils.getValue(this.style,"size",this.size));I=F?Math.max(0,Math.min(v,I)):v*Math.max(0,Math.min(1,I));this.isRounded&&(F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,I=Math.max(I,Math.min(v*F,z*F)));I=Math.round(I);g.begin();g.moveTo(r+I,A);g.lineTo(r+I,A+z);g.moveTo(r+v-I,A);g.lineTo(r+v-I,A+z);g.end();g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,+arguments)};mxCellRenderer.registerShape("process",ba);mxCellRenderer.registerShape("process2",ba);mxUtils.extend(ha,mxRectangleShape);ha.prototype.paintBackground=function(g,r,A,v,z){g.setFillColor(mxConstants.NONE);g.rect(r,A,v,z);g.fill()};ha.prototype.paintForeground=function(g,r,A,v,z){};mxCellRenderer.registerShape("transparent",ha);mxUtils.extend(qa,mxHexagon);qa.prototype.size=30;qa.prototype.position=.5;qa.prototype.position2=.5;qa.prototype.base=20;qa.prototype.getLabelMargins=function(){return new mxRectangle(0,+0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};qa.prototype.isRoundable=function(){return!0};qa.prototype.redrawPath=function(g,r,A,v,z){r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var F=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),I=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",+this.position2)))),ea=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,z-A),new mxPoint(Math.min(v,F+ea),z-A),new mxPoint(I,z),new mxPoint(Math.max(0,F),z-A),new mxPoint(0,z-A)],this.isRounded,r,!0,[4])};mxCellRenderer.registerShape("callout",qa);mxUtils.extend(ra,mxActor);ra.prototype.size=.2;ra.prototype.fixedSize=20;ra.prototype.isRoundable=function(){return!0};ra.prototype.redrawPath=function(g,+r,A,v,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(v-r,0),new mxPoint(v,z/2),new mxPoint(v-r,z),new mxPoint(0,z),new mxPoint(r,z/2)],this.isRounded,A,!0);g.end()};mxCellRenderer.registerShape("step",+ra);mxUtils.extend(l,mxHexagon);l.prototype.size=.25;l.prototype.fixedSize=20;l.prototype.isRoundable=function(){return!0};l.prototype.redrawPath=function(g,r,A,v,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*v,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,+0),new mxPoint(v-r,0),new mxPoint(v,.5*z),new mxPoint(v-r,z),new mxPoint(r,z),new mxPoint(0,.5*z)],this.isRounded,A,!0)};mxCellRenderer.registerShape("hexagon",l);mxUtils.extend(t,mxRectangleShape);t.prototype.isHtmlAllowed=function(){return!1};t.prototype.paintForeground=function(g,r,A,v,z){var F=Math.min(v/5,z/5)+1;g.begin();g.moveTo(r+v/2,A+F);g.lineTo(r+v/2,A+z-F);g.moveTo(r+F,A+z/2);g.lineTo(r+v-F,A+z/2);g.end();g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",+t);var pb=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(g){if(1==this.style["double"]){var r=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(g.x+r,g.y+r,g.width-2*r,g.height-2*r)}return g};mxRhombus.prototype.paintVertexShape=function(g,r,A,v,z){pb.apply(this,arguments);var F=r,I=A,ea=v,S=z;if(!this.outline&&1==this.style["double"]){var ta=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||+0);r+=ta;A+=ta;v-=2*ta;z-=2*ta;0<v&&0<z&&(g.setShadow(!1),pb.apply(this,[g,r,A,v,z]))}this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(g,F,I,ea,S,0)};mxShape.prototype.paintGlassEffect=function(g,r,A,v,z,F){var I=Math.ceil(this.strokewidth/2);g.setGradient("#ffffff","#ffffff",r,A,v,.6*z,"south",.9,.1);g.begin();this.paintGlassEffectPath(g,r,A,v,z,I,F);g.close();g.fill()};mxShape.prototype.paintGlassEffectPath=function(g,r,A,v,z,F,I){I+=2*F;this.isRounded?+(g.moveTo(r-F+I,A-F),g.quadTo(r-F,A-F,r-F,A-F+I),g.lineTo(r-F,A+.4*z),g.quadTo(r+.5*v,A+.7*z,r+v+F,A+.4*z),g.lineTo(r+v+F,A-F+I),g.quadTo(r+v+F,A-F,r+v+F-I,A-F)):(g.moveTo(r-F,A-F),g.lineTo(r-F,A+.4*z),g.quadTo(r+.5*v,A+.7*z,r+v+F,A+.4*z),g.lineTo(r+v+F,A-F))};mxEllipse.prototype.paintGlassEffectPath=function(g,r,A,v,z,F,I){I=v/2+F;F=z/2+F;r+=v/2;A+=z/2;g.moveTo(r-I,A);g.curveTo(r-I,A-.5522847498*F,r-.5522847498*I,A-F,r,A-F);g.curveTo(r+.5522847498*I,A-F,r+I,A-.5522847498*F,r+I,A);g.quadTo(r,A+.2*+z,r-I,A)};mxRhombus.prototype.paintGlassEffectPath=function(g,r,A,v,z,F,I){F=v/2;I=z/2;var ea=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,A+I),new mxPoint(r+F,A),new mxPoint(r+v,A+I)],this.isRounded,ea,!1);g.quadTo(r+F,A+.7*z,r,A+I)};var rb=mxEllipse.prototype.paintVertexShape;mxEllipse.prototype.paintVertexShape=function(g,r,A,v,z){rb.apply(this,arguments);this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&+this.paintGlassEffect(g,r,A,v,z,0)};mxUtils.extend(H,mxRectangleShape);H.prototype.isHtmlAllowed=function(){return!1};H.prototype.getLabelBounds=function(g){if(1==this.style["double"]){var r=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(g.x+r,g.y+r,g.width-2*r,g.height-2*r)}return g};H.prototype.paintForeground=function(g,r,A,v,z){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var F=Math.max(2,this.strokewidth++1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);r+=F;A+=F;v-=2*F;z-=2*F;0<v&&0<z&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}g.setDashed(!1);F=0;do{var I=mxCellRenderer.defaultShapes[this.style["symbol"+F]];if(null!=I){var ea=this.style["symbol"+F+"Align"],S=this.style["symbol"+F+"VerticalAlign"],ta=this.style["symbol"+F+"Width"],oa=this.style["symbol"+F+"Height"],Ia=this.style["symbol"+F+"Spacing"]||0,mb=this.style["symbol"+F+"VSpacing"]||Ia,$a=this.style["symbol"+F++"ArcSpacing"];null!=$a&&($a*=this.getArcSize(v+this.strokewidth,z+this.strokewidth),Ia+=$a,mb+=$a);$a=r;var Ea=A;$a=ea==mxConstants.ALIGN_CENTER?$a+(v-ta)/2:ea==mxConstants.ALIGN_RIGHT?$a+(v-ta-Ia):$a+Ia;Ea=S==mxConstants.ALIGN_MIDDLE?Ea+(z-oa)/2:S==mxConstants.ALIGN_BOTTOM?Ea+(z-oa-mb):Ea+mb;g.save();ea=new I;ea.style=this.style;I.prototype.paintVertexShape.call(ea,g,$a,Ea,ta,oa);g.restore()}F++}while(null!=I)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",+H);mxUtils.extend(J,mxCylinder);J.prototype.redrawPath=function(g,r,A,v,z,F){F?(g.moveTo(0,0),g.lineTo(v/2,z/2),g.lineTo(v,0),g.end()):(g.moveTo(0,0),g.lineTo(v,0),g.lineTo(v,z),g.lineTo(0,z),g.close())};mxCellRenderer.registerShape("message",J);mxUtils.extend(R,mxShape);R.prototype.paintBackground=function(g,r,A,v,z){g.translate(r,A);g.ellipse(v/4,0,v/2,z/4);g.fillAndStroke();g.begin();g.moveTo(v/2,z/4);g.lineTo(v/2,2*z/3);g.moveTo(v/2,z/3);g.lineTo(0,z/3);g.moveTo(v/2,z/3);g.lineTo(v,z/3);g.moveTo(v/+2,2*z/3);g.lineTo(0,z);g.moveTo(v/2,2*z/3);g.lineTo(v,z);g.end();g.stroke()};mxCellRenderer.registerShape("umlActor",R);mxUtils.extend(T,mxShape);T.prototype.getLabelMargins=function(g){return new mxRectangle(g.width/6,0,0,0)};T.prototype.paintBackground=function(g,r,A,v,z){g.translate(r,A);g.begin();g.moveTo(0,z/4);g.lineTo(0,3*z/4);g.end();g.stroke();g.begin();g.moveTo(0,z/2);g.lineTo(v/6,z/2);g.end();g.stroke();g.ellipse(v/6,0,5*v/6,z);g.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",+T);mxUtils.extend(Y,mxEllipse);Y.prototype.paintVertexShape=function(g,r,A,v,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.begin();g.moveTo(r+v/8,A+z);g.lineTo(r+7*v/8,A+z);g.end();g.stroke()};mxCellRenderer.registerShape("umlEntity",Y);mxUtils.extend(Z,mxShape);Z.prototype.paintVertexShape=function(g,r,A,v,z){g.translate(r,A);g.begin();g.moveTo(v,0);g.lineTo(0,z);g.moveTo(0,0);g.lineTo(v,z);g.end();g.stroke()};mxCellRenderer.registerShape("umlDestroy",Z);mxUtils.extend(ia,mxShape);+ia.prototype.getLabelBounds=function(g){return new mxRectangle(g.x,g.y+g.height/8,g.width,7*g.height/8)};ia.prototype.paintBackground=function(g,r,A,v,z){g.translate(r,A);g.begin();g.moveTo(3*v/8,z/8*1.1);g.lineTo(5*v/8,0);g.end();g.stroke();g.ellipse(0,z/8,v,7*z/8);g.fillAndStroke()};ia.prototype.paintForeground=function(g,r,A,v,z){g.begin();g.moveTo(3*v/8,z/8*1.1);g.lineTo(5*v/8,z/4);g.end();g.stroke()};mxCellRenderer.registerShape("umlControl",ia);mxUtils.extend(X,mxShape);X.prototype.iconSize=+44;X.prototype.paintBackground=function(g,r,A,v,z){z=Math.min(this.iconSize,v,z);var F=.9*z,I=.45*z;r=r+v/2-z/2;v=A+z/2;var ea=r+.175*F;F=ea-F;g.begin();g.moveTo(F,v-I/2);g.lineTo(F,v+I/2);g.end();g.stroke();g.begin();g.moveTo(F,v);g.lineTo(ea,v);g.end();g.stroke();g.ellipse(r,A,z,z);g.fillAndStroke()};mxCellRenderer.registerShape("seqBoundary",X);mxCellRenderer.registerShape("seqControl",ja(ia,44));mxCellRenderer.registerShape("seqEntity",ja(Y,44));mxUtils.extend(ka,mxShape);ka.prototype.paintBackground=+function(g,r,A,v,z){var F=z/2,I=F/(2.5+z/50);g.save();g.translate(r,A);g.begin();g.moveTo(I,0);g.lineTo(v-I,0);g.arcTo(I,F,0,0,1,v-I,z);g.lineTo(I,z);g.arcTo(I,F,0,0,1,I,0);g.close();g.fillAndStroke();g.restore()};ka.prototype.paintForeground=function(g,r,A,v,z){var F=z/2,I=F/(2.5+z/50);g.save();g.translate(r,A);g.begin();g.moveTo(v-I,0);g.arcTo(I,F,0,0,0,v-I,z);g.stroke();g.restore()};mxCellRenderer.registerShape("seqQueue",ka);mxUtils.extend(na,mxShape);na.prototype.paintBackground=function(g,r,+A,v,z){g.rect(r+6,A-6,v,z);g.fillAndStroke();g.rect(r,A,v,z);g.fillAndStroke()};mxCellRenderer.registerShape("seqCollections",na);mxUtils.extend(la,mxShape);la.prototype.paintBackground=function(g,r,A,v,z){z=v/3;var F=v/3,I=z/2,ea=I/(2.5+z/50);g.translate(r+(v-z)/2,A);g.begin();g.moveTo(0,ea);g.arcTo(I,ea,0,0,0,z,ea);g.arcTo(I,ea,0,0,0,0,ea);g.lineTo(0,F-ea);g.arcTo(I,ea,0,0,0,z,F-ea);g.lineTo(z,ea);g.fillAndStroke()};mxCellRenderer.registerShape("seqDatabase",la);mxUtils.extend(ua,mxShape);ua.prototype.paintBackground=+function(g,r,A,v,z){r+=v/2;A+=15;v=A+15;z=v+20;var F=v+10,I=z+15;g.ellipse(r-15,A-15,30,30);g.fillAndStroke();g.begin();g.moveTo(r,v);g.lineTo(r,z);g.moveTo(r-18,F);g.lineTo(r+18,F);g.moveTo(r,z);g.lineTo(r-16,I);g.moveTo(r,z);g.lineTo(r+16,I);g.stroke()};mxCellRenderer.registerShape("seqActorStick",ua);mxUtils.extend(za,mxRectangleShape);za.prototype.size=40;za.prototype.isHtmlAllowed=function(){return!1};za.prototype.isMirrored=function(){return"1"==mxUtils.getValue(this.style,"lifelineMirror",+"0")};za.prototype.getHeadSize=function(g){return Math.max(0,Math.min(this.isMirrored()?g/2:g,parseFloat(mxUtils.getValue(this.style,"size",this.size))))};za.prototype.getLabelBounds=function(g){var r=Math.max(0,Math.min(this.isMirrored()?g.height/2:g.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(g.x,g.y,g.width,r)};za.prototype.paintBackground=function(g,r,A,v,z){var F=this.getHeadSize(z),I=this.isMirrored(),ea=mxUtils.getValue(this.style,"participant");+null==ea||null==this.state?(mxRectangleShape.prototype.paintBackground.call(this,g,r,A,v,F),I&&mxRectangleShape.prototype.paintBackground.call(this,g,r,A+z-F,v,F)):(ea=this.state.view.graph.cellRenderer.getShape(ea),null!=ea&&ea!=za&&(ea=new ea,ea.apply(this.state),g.save(),ea.paintVertexShape(g,r,A,v,F),g.restore(),I&&(g.save(),ea.paintVertexShape(g,r,A+z-F,v,F),g.restore())));z=I?z-F:z;F<z&&(g.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),g.begin(),g.moveTo(r+v/2,A+F),g.lineTo(r++v/2,A+z),g.end(),g.stroke())};za.prototype.paintForeground=function(g,r,A,v,z){var F=mxUtils.getValue(this.style,"participant"),I=this.getHeadSize(z),ea=this.isMirrored();null==F&&(mxRectangleShape.prototype.paintForeground.call(this,g,r,A,v,Math.min(z,I)),ea&&mxRectangleShape.prototype.paintForeground.call(this,g,r,A+z-I,v,I));ea&&this.paintMirrorLabel(g,r,A+z-I,v,I)};za.prototype.paintMirrorLabel=function(g,r,A,v,z){var F=null!=this.state?this.state.view.graph.getLabel(this.state.cell):null;this.mirrorLabelValue=F;if(null!=F&&""!=F){g.setFontColor(mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"black"));g.setFontBackgroundColor(mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null));g.setFontBorderColor(mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null));g.setFontFamily(mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY));g.setFontSize(parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)));g.setFontStyle(parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,0)));var I=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),ea=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),S=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,2)),ta=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,0))+S,oa=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,0))+S,Ia=parseFloat(mxUtils.getValue(this.style,-mxConstants.STYLE_SPACING_LEFT,0))+S;S=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,0))+S;r=I==mxConstants.ALIGN_LEFT?r+Ia:I==mxConstants.ALIGN_RIGHT?r+u-S:r+u/2;A=ea==mxConstants.ALIGN_TOP?A+ta+1:ea==mxConstants.ALIGN_BOTTOM?A+z-oa-1:A+z/2;z="wrap"==mxUtils.getValue(this.style,mxConstants.STYLE_WHITE_SPACE,null);ta="1"==mxUtils.getValue(this.style,"html","0")?"html":"";g.text(r,A,z?u-Ia-S:0,0,F,I,ea,z,ta,null,!1,0,null)}};mxCellRenderer.registerShape("umlLifeline",za);var tb=+mxConstants.STYLE_SPACING_LEFT,0))+S;S=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,0))+S;r=I==mxConstants.ALIGN_LEFT?r+Ia:I==mxConstants.ALIGN_RIGHT?r+v-S:r+v/2;A=ea==mxConstants.ALIGN_TOP?A+ta+1:ea==mxConstants.ALIGN_BOTTOM?A+z-oa-1:A+z/2;z="wrap"==mxUtils.getValue(this.style,mxConstants.STYLE_WHITE_SPACE,null);ta="1"==mxUtils.getValue(this.style,"html","0")?"html":"";g.text(r,A,z?v-Ia-S:0,0,F,I,ea,z,ta,null,!1,0,null)}};mxCellRenderer.registerShape("umlLifeline",za);var tb=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(g,r){return tb.apply(this,arguments)||void 0!==r.mirrorLabelValue&&r.mirrorLabelValue!=g.view.graph.getLabel(g.cell)};mxUtils.extend(sa,mxShape);sa.prototype.width=60;sa.prototype.height=30;sa.prototype.corner=10;sa.prototype.configurePointerEvents=function(g){var r=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=r&&r!=mxConstants.NONE&&0!=this.opacity&&-0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(g.pointerEvents=!1)};sa.prototype.getLabelMargins=function(g){return new mxRectangle(0,0,g.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),g.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};sa.prototype.paintBackground=function(g,r,A,u,z){var F=this.corner,I=Math.min(u,Math.max(F,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),ea=-Math.min(z,Math.max(1.5*F,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),S=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);S!=mxConstants.NONE&&(g.setFillColor(S),g.rect(r,A,u,z),g.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(g,r,A,u,z),g.setGradient(this.fill,this.gradient,r,A,u,z,this.gradientDirection)):g.setFillColor(this.fill);g.pointerEvents=!0;g.begin();g.moveTo(r,-A);g.lineTo(r+I,A);g.lineTo(r+I,A+Math.max(0,ea-1.5*F));g.lineTo(r+Math.max(0,I-F),A+ea);g.lineTo(r,A+ea);g.close();g.fillAndStroke();this.configurePointerEvents(g);g.begin();g.moveTo(r+I,A);g.lineTo(r+u,A);g.lineTo(r+u,A+z);g.lineTo(r,A+z);g.lineTo(r,A+ea);g.stroke()};mxCellRenderer.registerShape("umlFrame",sa);mxPerimeter.CenterPerimeter=function(g,r,A,u){return new mxPoint(g.getCenterX(),g.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=-function(g,r,A,u){u=za.prototype.size;var z=g.y+g.height;null!=r&&(u=mxUtils.getValue(r.style,"size",u)*r.view.scale,"1"==mxUtils.getValue(r.style,"lifelineMirror","0")&&(z-=u));r=parseFloat(r.style[mxConstants.STYLE_STROKEWIDTH]||1)*r.view.scale/2-1;A.x<g.getCenterX()&&(r=-1*(r+1));return new mxPoint(g.getCenterX()+r,Math.min(z,Math.max(g.y+u,A.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(g,r,A,u){u=!0;return mxPerimeter.RectanglePerimeter.apply(this,-arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(g,r,A,u){u=parseFloat(r.style[mxConstants.STYLE_STROKEWIDTH]||1)*r.view.scale/2-1;null!=r.style.backboneSize&&(u+=parseFloat(r.style.backboneSize)*r.view.scale/2-1);if("south"==r.style[mxConstants.STYLE_DIRECTION]||"north"==r.style[mxConstants.STYLE_DIRECTION])return A.x<g.getCenterX()&&(u=-1*(u+1)),new mxPoint(g.getCenterX()+u,Math.min(g.y+g.height,Math.max(g.y,A.y)));-A.y<g.getCenterY()&&(u=-1*(u+1));return new mxPoint(Math.min(g.x+g.width,Math.max(g.x,A.x)),g.getCenterY()+u)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(g,r,A,u){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(g,new mxRectangle(0,0,0,Math.max(0,Math.min(g.height,parseFloat(mxUtils.getValue(r.style,"size",qa.prototype.size))*r.view.scale))),r.style),r,A,u)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);-mxPerimeter.ParallelogramPerimeter=function(g,r,A,u){var z="0"!=mxUtils.getValue(r.style,"fixedSize","0"),F=z?V.prototype.fixedSize:V.prototype.size;null!=r&&(F=mxUtils.getValue(r.style,"size",F));z&&(F*=r.view.scale);var I=g.x,ea=g.y,S=g.width,ta=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH?(z=z?Math.max(0,Math.min(ta,F)):ta*Math.max(0,Math.min(1,F)),ea=-[new mxPoint(I,ea),new mxPoint(I+S,ea+z),new mxPoint(I+S,ea+ta),new mxPoint(I,ea+ta-z),new mxPoint(I,ea)]):(z=z?Math.max(0,Math.min(.5*S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I+z,ea),new mxPoint(I+S,ea),new mxPoint(I+S-z,ea+ta),new mxPoint(I,ea+ta),new mxPoint(I+z,ea)]);ta=g.getCenterX();g=g.getCenterY();g=new mxPoint(ta,g);u&&(A.x<I||A.x>I+S?g.y=A.y:g.x=A.x);return mxUtils.getPerimeterPoint(ea,g,A)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=-function(g,r,A,u){var z="0"!=mxUtils.getValue(r.style,"fixedSize","0"),F=z?K.prototype.fixedSize:K.prototype.size;null!=r&&(F=mxUtils.getValue(r.style,"size",F));z&&(F*=r.view.scale);var I=g.x,ea=g.y,S=g.width,ta=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_EAST?(z=z?Math.max(0,Math.min(.5*S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I+z,ea),new mxPoint(I+S-z,ea),new mxPoint(I+S,ea+ta),+0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(g.pointerEvents=!1)};sa.prototype.getLabelMargins=function(g){return new mxRectangle(0,0,g.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),g.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};sa.prototype.paintBackground=function(g,r,A,v,z){var F=this.corner,I=Math.min(v,Math.max(F,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),ea=+Math.min(z,Math.max(1.5*F,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),S=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);S!=mxConstants.NONE&&(g.setFillColor(S),g.rect(r,A,v,z),g.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(g,r,A,v,z),g.setGradient(this.fill,this.gradient,r,A,v,z,this.gradientDirection)):g.setFillColor(this.fill);g.pointerEvents=!0;g.begin();g.moveTo(r,+A);g.lineTo(r+I,A);g.lineTo(r+I,A+Math.max(0,ea-1.5*F));g.lineTo(r+Math.max(0,I-F),A+ea);g.lineTo(r,A+ea);g.close();g.fillAndStroke();this.configurePointerEvents(g);g.begin();g.moveTo(r+I,A);g.lineTo(r+v,A);g.lineTo(r+v,A+z);g.lineTo(r,A+z);g.lineTo(r,A+ea);g.stroke()};mxCellRenderer.registerShape("umlFrame",sa);mxPerimeter.CenterPerimeter=function(g,r,A,v){return new mxPoint(g.getCenterX(),g.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=+function(g,r,A,v){v=za.prototype.size;var z=g.y+g.height;null!=r&&(v=mxUtils.getValue(r.style,"size",v)*r.view.scale,"1"==mxUtils.getValue(r.style,"lifelineMirror","0")&&(z-=v));r=parseFloat(r.style[mxConstants.STYLE_STROKEWIDTH]||1)*r.view.scale/2-1;A.x<g.getCenterX()&&(r=-1*(r+1));return new mxPoint(g.getCenterX()+r,Math.min(z,Math.max(g.y+v,A.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(g,r,A,v){v=!0;return mxPerimeter.RectanglePerimeter.apply(this,+arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(g,r,A,v){v=parseFloat(r.style[mxConstants.STYLE_STROKEWIDTH]||1)*r.view.scale/2-1;null!=r.style.backboneSize&&(v+=parseFloat(r.style.backboneSize)*r.view.scale/2-1);if("south"==r.style[mxConstants.STYLE_DIRECTION]||"north"==r.style[mxConstants.STYLE_DIRECTION])return A.x<g.getCenterX()&&(v=-1*(v+1)),new mxPoint(g.getCenterX()+v,Math.min(g.y+g.height,Math.max(g.y,A.y)));+A.y<g.getCenterY()&&(v=-1*(v+1));return new mxPoint(Math.min(g.x+g.width,Math.max(g.x,A.x)),g.getCenterY()+v)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(g,r,A,v){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(g,new mxRectangle(0,0,0,Math.max(0,Math.min(g.height,parseFloat(mxUtils.getValue(r.style,"size",qa.prototype.size))*r.view.scale))),r.style),r,A,v)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);+mxPerimeter.ParallelogramPerimeter=function(g,r,A,v){var z="0"!=mxUtils.getValue(r.style,"fixedSize","0"),F=z?V.prototype.fixedSize:V.prototype.size;null!=r&&(F=mxUtils.getValue(r.style,"size",F));z&&(F*=r.view.scale);var I=g.x,ea=g.y,S=g.width,ta=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH?(z=z?Math.max(0,Math.min(ta,F)):ta*Math.max(0,Math.min(1,F)),ea=+[new mxPoint(I,ea),new mxPoint(I+S,ea+z),new mxPoint(I+S,ea+ta),new mxPoint(I,ea+ta-z),new mxPoint(I,ea)]):(z=z?Math.max(0,Math.min(.5*S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I+z,ea),new mxPoint(I+S,ea),new mxPoint(I+S-z,ea+ta),new mxPoint(I,ea+ta),new mxPoint(I+z,ea)]);ta=g.getCenterX();g=g.getCenterY();g=new mxPoint(ta,g);v&&(A.x<I||A.x>I+S?g.y=A.y:g.x=A.x);return mxUtils.getPerimeterPoint(ea,g,A)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=+function(g,r,A,v){var z="0"!=mxUtils.getValue(r.style,"fixedSize","0"),F=z?K.prototype.fixedSize:K.prototype.size;null!=r&&(F=mxUtils.getValue(r.style,"size",F));z&&(F*=r.view.scale);var I=g.x,ea=g.y,S=g.width,ta=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_EAST?(z=z?Math.max(0,Math.min(.5*S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I+z,ea),new mxPoint(I+S-z,ea),new mxPoint(I+S,ea+ta),new mxPoint(I,ea+ta),new mxPoint(I+z,ea)]):r==mxConstants.DIRECTION_WEST?(z=z?Math.max(0,Math.min(S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I,ea),new mxPoint(I+S,ea),new mxPoint(I+S-z,ea+ta),new mxPoint(I+z,ea+ta),new mxPoint(I,ea)]):r==mxConstants.DIRECTION_NORTH?(z=z?Math.max(0,Math.min(ta,F)):ta*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I,ea+z),new mxPoint(I+S,ea),new mxPoint(I+S,ea+ta),new mxPoint(I,ea+ta-z),new mxPoint(I,ea+z)]):(z=z?Math.max(0,Math.min(ta,F)):ta*Math.max(0,Math.min(1,-F)),ea=[new mxPoint(I,ea),new mxPoint(I+S,ea+z),new mxPoint(I+S,ea+ta-z),new mxPoint(I,ea+ta),new mxPoint(I,ea)]);ta=g.getCenterX();g=g.getCenterY();g=new mxPoint(ta,g);u&&(A.x<I||A.x>I+S?g.y=A.y:g.x=A.x);return mxUtils.getPerimeterPoint(ea,g,A)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(g,r,A,u){var z="0"!=mxUtils.getValue(r.style,"fixedSize","0"),F=z?ra.prototype.fixedSize:ra.prototype.size;null!=r&&(F=mxUtils.getValue(r.style,+F)),ea=[new mxPoint(I,ea),new mxPoint(I+S,ea+z),new mxPoint(I+S,ea+ta-z),new mxPoint(I,ea+ta),new mxPoint(I,ea)]);ta=g.getCenterX();g=g.getCenterY();g=new mxPoint(ta,g);v&&(A.x<I||A.x>I+S?g.y=A.y:g.x=A.x);return mxUtils.getPerimeterPoint(ea,g,A)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(g,r,A,v){var z="0"!=mxUtils.getValue(r.style,"fixedSize","0"),F=z?ra.prototype.fixedSize:ra.prototype.size;null!=r&&(F=mxUtils.getValue(r.style,"size",F));z&&(F*=r.view.scale);var I=g.x,ea=g.y,S=g.width,ta=g.height,oa=g.getCenterX();g=g.getCenterY();r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_EAST?(z=z?Math.max(0,Math.min(S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I,ea),new mxPoint(I+S-z,ea),new mxPoint(I+S,g),new mxPoint(I+S-z,ea+ta),new mxPoint(I,ea+ta),new mxPoint(I+z,g),new mxPoint(I,ea)]):r==mxConstants.DIRECTION_WEST?(z=z?Math.max(0,Math.min(S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I+z,ea),new mxPoint(I+S,ea),new mxPoint(I+S-z,g),new mxPoint(I+S,ea+ta),new mxPoint(I+z,ea+ta),new mxPoint(I,g),new mxPoint(I+z,ea)]):r==mxConstants.DIRECTION_NORTH?(z=z?Math.max(0,Math.min(ta,F)):ta*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I,ea+z),new mxPoint(oa,ea),new mxPoint(I+S,ea+z),new mxPoint(I+S,ea+ta),new mxPoint(oa,ea+ta-z),new mxPoint(I,ea+ta),new mxPoint(I,ea+z)]):(z=z?Math.max(0,Math.min(ta,F)):ta*Math.max(0,Math.min(1,F)),-ea=[new mxPoint(I,ea),new mxPoint(oa,ea+z),new mxPoint(I+S,ea),new mxPoint(I+S,ea+ta-z),new mxPoint(oa,ea+ta),new mxPoint(I,ea+ta-z),new mxPoint(I,ea)]);oa=new mxPoint(oa,g);u&&(A.x<I||A.x>I+S?oa.y=A.y:oa.x=A.x);return mxUtils.getPerimeterPoint(ea,oa,A)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(g,r,A,u){var z="0"!=mxUtils.getValue(r.style,"fixedSize","0"),F=z?l.prototype.fixedSize:l.prototype.size;null!=r&&(F=mxUtils.getValue(r.style,+ea=[new mxPoint(I,ea),new mxPoint(oa,ea+z),new mxPoint(I+S,ea),new mxPoint(I+S,ea+ta-z),new mxPoint(oa,ea+ta),new mxPoint(I,ea+ta-z),new mxPoint(I,ea)]);oa=new mxPoint(oa,g);v&&(A.x<I||A.x>I+S?oa.y=A.y:oa.x=A.x);return mxUtils.getPerimeterPoint(ea,oa,A)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(g,r,A,v){var z="0"!=mxUtils.getValue(r.style,"fixedSize","0"),F=z?l.prototype.fixedSize:l.prototype.size;null!=r&&(F=mxUtils.getValue(r.style,"size",F));z&&(F*=r.view.scale);var I=g.x,ea=g.y,S=g.width,ta=g.height,oa=g.getCenterX();g=g.getCenterY();r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH?(z=z?Math.max(0,Math.min(ta,F)):ta*Math.max(0,Math.min(1,F)),ea=[new mxPoint(oa,ea),new mxPoint(I+S,ea+z),new mxPoint(I+S,ea+ta-z),new mxPoint(oa,ea+ta),new mxPoint(I,ea+ta-z),new mxPoint(I,ea+z),new mxPoint(oa,ea)]):-(z=z?Math.max(0,Math.min(S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I+z,ea),new mxPoint(I+S-z,ea),new mxPoint(I+S,g),new mxPoint(I+S-z,ea+ta),new mxPoint(I+z,ea+ta),new mxPoint(I,g),new mxPoint(I+z,ea)]);oa=new mxPoint(oa,g);u&&(A.x<I||A.x>I+S?oa.y=A.y:oa.x=A.x);return mxUtils.getPerimeterPoint(ea,oa,A)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(wa,mxShape);wa.prototype.size=10;wa.prototype.paintBackground=function(g,r,A,u,z){var F=parseFloat(mxUtils.getValue(this.style,-"size",this.size));g.translate(r,A);g.ellipse((u-F)/2,0,F,F);g.fillAndStroke();g.begin();g.moveTo(u/2,F);g.lineTo(u/2,z);g.end();g.stroke()};mxCellRenderer.registerShape("lollipop",wa);mxUtils.extend(Ca,mxShape);Ca.prototype.size=10;Ca.prototype.inset=2;Ca.prototype.paintBackground=function(g,r,A,u,z){var F=parseFloat(mxUtils.getValue(this.style,"size",this.size)),I=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;g.translate(r,A);g.begin();g.moveTo(u/2,F+I);g.lineTo(u/-2,z);g.end();g.stroke();g.begin();g.moveTo((u-F)/2-I,F/2);g.quadTo((u-F)/2-I,F+I,u/2,F+I);g.quadTo((u+F)/2+I,F+I,(u+F)/2+I,F/2);g.end();g.stroke()};mxCellRenderer.registerShape("requires",Ca);mxUtils.extend(Fa,mxShape);Fa.prototype.paintBackground=function(g,r,A,u,z){g.translate(r,A);g.begin();g.moveTo(0,0);g.quadTo(u,0,u,z/2);g.quadTo(u,z,0,z);g.end();g.stroke()};mxCellRenderer.registerShape("requiredInterface",Fa);mxUtils.extend(Ha,mxShape);Ha.prototype.inset=2;Ha.prototype.paintBackground=function(g,-r,A,u,z){var F=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;g.translate(r,A);g.ellipse(0,F,u-2*F,z-2*F);g.fillAndStroke();g.begin();g.moveTo(u/2,0);g.quadTo(u,0,u,z/2);g.quadTo(u,z,u/2,z);g.end();g.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",Ha);mxUtils.extend(Na,mxCylinder);Na.prototype.jettyWidth=20;Na.prototype.jettyHeight=10;Na.prototype.redrawPath=function(g,r,A,u,z,F){var I=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));-r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));A=I/2;I=A+I/2;var ea=Math.min(r,z-r),S=Math.min(ea+2*r,z-r);F?(g.moveTo(A,ea),g.lineTo(I,ea),g.lineTo(I,ea+r),g.lineTo(A,ea+r),g.moveTo(A,S),g.lineTo(I,S),g.lineTo(I,S+r),g.lineTo(A,S+r)):(g.moveTo(A,0),g.lineTo(u,0),g.lineTo(u,z),g.lineTo(A,z),g.lineTo(A,S+r),g.lineTo(0,S+r),g.lineTo(0,S),g.lineTo(A,S),g.lineTo(A,ea+r),g.lineTo(0,ea+r),g.lineTo(0,ea),g.lineTo(A,ea),g.close());g.end()};mxCellRenderer.registerShape("module",-Na);mxUtils.extend(La,mxCylinder);La.prototype.jettyWidth=32;La.prototype.jettyHeight=12;La.prototype.redrawPath=function(g,r,A,u,z,F){var I=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));A=I/2;I=A+I/2;var ea=.3*z-r/2,S=.7*z-r/2;F?(g.moveTo(A,ea),g.lineTo(I,ea),g.lineTo(I,ea+r),g.lineTo(A,ea+r),g.moveTo(A,S),g.lineTo(I,S),g.lineTo(I,S+r),g.lineTo(A,S+r)):(g.moveTo(A,0),g.lineTo(u,0),g.lineTo(u,z),g.lineTo(A,-z),g.lineTo(A,S+r),g.lineTo(0,S+r),g.lineTo(0,S),g.lineTo(A,S),g.lineTo(A,ea+r),g.lineTo(0,ea+r),g.lineTo(0,ea),g.lineTo(A,ea),g.close());g.end()};mxCellRenderer.registerShape("component",La);mxUtils.extend(Da,mxRectangleShape);Da.prototype.paintForeground=function(g,r,A,u,z){var F=u/2,I=z/2,ea=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;g.begin();this.addPoints(g,[new mxPoint(r+F,A),new mxPoint(r+u,A+I),new mxPoint(r+F,A+z),new mxPoint(r,A+I)],this.isRounded,-ea,!0);g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",Da);mxUtils.extend(Sa,mxDoubleEllipse);Sa.prototype.outerStroke=!0;Sa.prototype.paintVertexShape=function(g,r,A,u,z){var F=Math.min(4,Math.min(u/5,z/5));0<u&&0<z&&(g.ellipse(r+F,A+F,u-2*F,z-2*F),g.fillAndStroke());g.setShadow(!1);this.outerStroke&&(g.ellipse(r,A,u,z),g.stroke())};mxCellRenderer.registerShape("endState",Sa);mxUtils.extend(Oa,Sa);Oa.prototype.outerStroke=+(z=z?Math.max(0,Math.min(S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I+z,ea),new mxPoint(I+S-z,ea),new mxPoint(I+S,g),new mxPoint(I+S-z,ea+ta),new mxPoint(I+z,ea+ta),new mxPoint(I,g),new mxPoint(I+z,ea)]);oa=new mxPoint(oa,g);v&&(A.x<I||A.x>I+S?oa.y=A.y:oa.x=A.x);return mxUtils.getPerimeterPoint(ea,oa,A)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(wa,mxShape);wa.prototype.size=10;wa.prototype.paintBackground=function(g,r,A,v,z){var F=parseFloat(mxUtils.getValue(this.style,+"size",this.size));g.translate(r,A);g.ellipse((v-F)/2,0,F,F);g.fillAndStroke();g.begin();g.moveTo(v/2,F);g.lineTo(v/2,z);g.end();g.stroke()};mxCellRenderer.registerShape("lollipop",wa);mxUtils.extend(Ca,mxShape);Ca.prototype.size=10;Ca.prototype.inset=2;Ca.prototype.paintBackground=function(g,r,A,v,z){var F=parseFloat(mxUtils.getValue(this.style,"size",this.size)),I=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;g.translate(r,A);g.begin();g.moveTo(v/2,F+I);g.lineTo(v/+2,z);g.end();g.stroke();g.begin();g.moveTo((v-F)/2-I,F/2);g.quadTo((v-F)/2-I,F+I,v/2,F+I);g.quadTo((v+F)/2+I,F+I,(v+F)/2+I,F/2);g.end();g.stroke()};mxCellRenderer.registerShape("requires",Ca);mxUtils.extend(Fa,mxShape);Fa.prototype.paintBackground=function(g,r,A,v,z){g.translate(r,A);g.begin();g.moveTo(0,0);g.quadTo(v,0,v,z/2);g.quadTo(v,z,0,z);g.end();g.stroke()};mxCellRenderer.registerShape("requiredInterface",Fa);mxUtils.extend(Ha,mxShape);Ha.prototype.inset=2;Ha.prototype.paintBackground=function(g,+r,A,v,z){var F=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;g.translate(r,A);g.ellipse(0,F,v-2*F,z-2*F);g.fillAndStroke();g.begin();g.moveTo(v/2,0);g.quadTo(v,0,v,z/2);g.quadTo(v,z,v/2,z);g.end();g.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",Ha);mxUtils.extend(Na,mxCylinder);Na.prototype.jettyWidth=20;Na.prototype.jettyHeight=10;Na.prototype.redrawPath=function(g,r,A,v,z,F){var I=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));+r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));A=I/2;I=A+I/2;var ea=Math.min(r,z-r),S=Math.min(ea+2*r,z-r);F?(g.moveTo(A,ea),g.lineTo(I,ea),g.lineTo(I,ea+r),g.lineTo(A,ea+r),g.moveTo(A,S),g.lineTo(I,S),g.lineTo(I,S+r),g.lineTo(A,S+r)):(g.moveTo(A,0),g.lineTo(v,0),g.lineTo(v,z),g.lineTo(A,z),g.lineTo(A,S+r),g.lineTo(0,S+r),g.lineTo(0,S),g.lineTo(A,S),g.lineTo(A,ea+r),g.lineTo(0,ea+r),g.lineTo(0,ea),g.lineTo(A,ea),g.close());g.end()};mxCellRenderer.registerShape("module",+Na);mxUtils.extend(La,mxCylinder);La.prototype.jettyWidth=32;La.prototype.jettyHeight=12;La.prototype.redrawPath=function(g,r,A,v,z,F){var I=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));A=I/2;I=A+I/2;var ea=.3*z-r/2,S=.7*z-r/2;F?(g.moveTo(A,ea),g.lineTo(I,ea),g.lineTo(I,ea+r),g.lineTo(A,ea+r),g.moveTo(A,S),g.lineTo(I,S),g.lineTo(I,S+r),g.lineTo(A,S+r)):(g.moveTo(A,0),g.lineTo(v,0),g.lineTo(v,z),g.lineTo(A,+z),g.lineTo(A,S+r),g.lineTo(0,S+r),g.lineTo(0,S),g.lineTo(A,S),g.lineTo(A,ea+r),g.lineTo(0,ea+r),g.lineTo(0,ea),g.lineTo(A,ea),g.close());g.end()};mxCellRenderer.registerShape("component",La);mxUtils.extend(Da,mxRectangleShape);Da.prototype.paintForeground=function(g,r,A,v,z){var F=v/2,I=z/2,ea=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;g.begin();this.addPoints(g,[new mxPoint(r+F,A),new mxPoint(r+v,A+I),new mxPoint(r+F,A+z),new mxPoint(r,A+I)],this.isRounded,+ea,!0);g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",Da);mxUtils.extend(Sa,mxDoubleEllipse);Sa.prototype.outerStroke=!0;Sa.prototype.paintVertexShape=function(g,r,A,v,z){var F=Math.min(4,Math.min(v/5,z/5));0<v&&0<z&&(g.ellipse(r+F,A+F,v-2*F,z-2*F),g.fillAndStroke());g.setShadow(!1);this.outerStroke&&(g.ellipse(r,A,v,z),g.stroke())};mxCellRenderer.registerShape("endState",Sa);mxUtils.extend(Oa,Sa);Oa.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",Oa);mxUtils.extend(Ta,mxArrowConnector);Ta.prototype.defaultWidth=4;Ta.prototype.isOpenEnded=function(){return!0};Ta.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};Ta.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",Ta);mxUtils.extend(Ua,mxArrowConnector);Ua.prototype.defaultWidth=10;Ua.prototype.defaultArrowWidth=20;Ua.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};Ua.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Ua.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",Ua);mxUtils.extend(Ba,mxActor);Ba.prototype.size=30;Ba.prototype.isRoundable=function(){return!0};-Ba.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)?(g=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(0,g,0,0)):null};Ba.prototype.redrawPath=function(g,r,A,u,z){r=Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,z),new mxPoint(0,r),new mxPoint(u,0),new mxPoint(u,z)],this.isRounded,A,-!0);g.end()};mxCellRenderer.registerShape("manualInput",Ba);mxUtils.extend(Ka,mxRectangleShape);Ka.prototype.dx=20;Ka.prototype.dy=20;Ka.prototype.isHtmlAllowed=function(){return!1};Ka.prototype.paintForeground=function(g,r,A,u,z){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var F=0;if(this.isRounded){var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;F=Math.max(F,Math.min(u*I,z*I))}I=Math.max(F,Math.min(u,parseFloat(mxUtils.getValue(this.style,-"dx",this.dx))));F=Math.max(F,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.begin();g.moveTo(r,A+F);g.lineTo(r+u,A+F);g.end();g.stroke();g.begin();g.moveTo(r+I,A);g.lineTo(r+I,A+z);g.end();g.stroke()};mxCellRenderer.registerShape("internalStorage",Ka);mxUtils.extend(ab,mxActor);ab.prototype.dx=20;ab.prototype.dy=20;ab.prototype.isRoundable=function(){return!0};ab.prototype.redrawPath=function(g,r,A,u,z){r=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));-A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,A),new mxPoint(r,A),new mxPoint(r,z),new mxPoint(0,z)],this.isRounded,F,!0);g.end()};mxCellRenderer.registerShape("corner",ab);mxUtils.extend(Qa,mxActor);Qa.prototype.redrawPath=function(g,r,A,u,z){g.moveTo(0,-0);g.lineTo(0,z);g.end();g.moveTo(u,0);g.lineTo(u,z);g.end();g.moveTo(0,z/2);g.lineTo(u,z/2);g.end()};mxCellRenderer.registerShape("crossbar",Qa);mxUtils.extend(db,mxActor);db.prototype.dx=20;db.prototype.dy=20;db.prototype.isRoundable=function(){return!0};db.prototype.redrawPath=function(g,r,A,u,z){r=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",-this.size));var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,A),new mxPoint((u+r)/2,A),new mxPoint((u+r)/2,z),new mxPoint((u-r)/2,z),new mxPoint((u-r)/2,A),new mxPoint(0,A)],this.isRounded,F,!0);g.end()};mxCellRenderer.registerShape("tee",db);mxUtils.extend(Va,mxActor);Va.prototype.arrowWidth=.3;Va.prototype.arrowSize=.2;Va.prototype.isRoundable=function(){return!0};Va.prototype.redrawPath=function(g,-r,A,u,z){var F=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));r=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));A=(z-F)/2;F=A+F;var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,A),new mxPoint(u-r,A),new mxPoint(u-r,0),new mxPoint(u,z/2),new mxPoint(u-r,z),new mxPoint(u-r,F),new mxPoint(0,F)],this.isRounded,I,!0);g.end()};mxCellRenderer.registerShape("singleArrow",-Va);mxUtils.extend(nb,mxActor);nb.prototype.isRoundable=function(){return!0};nb.prototype.redrawPath=function(g,r,A,u,z){var F=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Va.prototype.arrowWidth))));r=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Va.prototype.arrowSize))));A=(z-F)/2;F=A+F;var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,z/2),new mxPoint(r,0),new mxPoint(r,-A),new mxPoint(u-r,A),new mxPoint(u-r,0),new mxPoint(u,z/2),new mxPoint(u-r,z),new mxPoint(u-r,F),new mxPoint(r,F),new mxPoint(r,z)],this.isRounded,I,!0);g.end()};mxCellRenderer.registerShape("doubleArrow",nb);mxUtils.extend(bb,mxActor);bb.prototype.size=.1;bb.prototype.fixedSize=20;bb.prototype.redrawPath=function(g,r,A,u,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,-"size",this.size))));g.moveTo(r,0);g.lineTo(u,0);g.quadTo(u-2*r,z/2,u,z);g.lineTo(r,z);g.quadTo(r-2*r,z/2,r,0);g.close();g.end()};mxCellRenderer.registerShape("dataStorage",bb);mxUtils.extend(ya,mxActor);ya.prototype.redrawPath=function(g,r,A,u,z){g.moveTo(0,0);g.quadTo(u,0,u,z/2);g.quadTo(u,z,0,z);g.close();g.end()};mxCellRenderer.registerShape("or",ya);mxUtils.extend(Ra,mxActor);Ra.prototype.redrawPath=function(g,r,A,u,z){g.moveTo(0,0);g.quadTo(u,0,u,z/2);g.quadTo(u,z,0,z);g.quadTo(u/2,z/2,0,0);-g.close();g.end()};mxCellRenderer.registerShape("xor",Ra);mxUtils.extend(Ya,mxActor);Ya.prototype.size=20;Ya.prototype.isRoundable=function(){return!0};Ya.prototype.redrawPath=function(g,r,A,u,z){r=Math.min(u/2,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,0),new mxPoint(u-r,0),new mxPoint(u,.8*r),new mxPoint(u,z),new mxPoint(0,z),new mxPoint(0,.8*r)],this.isRounded,-A,!0);g.end()};mxCellRenderer.registerShape("loopLimit",Ya);mxUtils.extend(lb,mxActor);lb.prototype.size=.375;lb.prototype.isRoundable=function(){return!0};lb.prototype.redrawPath=function(g,r,A,u,z){r=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,z-r),new mxPoint(u/2,z),new mxPoint(0,z-r)],this.isRounded,A,!0);-g.end()};mxCellRenderer.registerShape("offPageConnector",lb);mxUtils.extend(ub,mxEllipse);ub.prototype.paintVertexShape=function(g,r,A,u,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.begin();g.moveTo(r+u/2,A+z);g.lineTo(r+u,A+z);g.end();g.stroke()};mxCellRenderer.registerShape("tapeData",ub);mxUtils.extend(gb,mxEllipse);gb.prototype.paintVertexShape=function(g,r,A,u,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r,A+z/2);g.lineTo(r+-u,A+z/2);g.end();g.stroke();g.begin();g.moveTo(r+u/2,A);g.lineTo(r+u/2,A+z);g.end();g.stroke()};mxCellRenderer.registerShape("orEllipse",gb);mxUtils.extend(jb,mxEllipse);jb.prototype.paintVertexShape=function(g,r,A,u,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r+.145*u,A+.145*z);g.lineTo(r+.855*u,A+.855*z);g.end();g.stroke();g.begin();g.moveTo(r+.855*u,A+.145*z);g.lineTo(r+.145*u,A+.855*z);g.end();g.stroke()};mxCellRenderer.registerShape("sumEllipse",-jb);mxUtils.extend(yb,mxRhombus);yb.prototype.paintVertexShape=function(g,r,A,u,z){mxRhombus.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r,A+z/2);g.lineTo(r+u,A+z/2);g.end();g.stroke()};mxCellRenderer.registerShape("sortShape",yb);mxUtils.extend(Bb,mxEllipse);Bb.prototype.paintVertexShape=function(g,r,A,u,z){g.begin();g.moveTo(r,A);g.lineTo(r+u,A);g.lineTo(r+u/2,A+z/2);g.close();g.fillAndStroke();g.begin();g.moveTo(r,A+z);g.lineTo(r+u,A+z);g.lineTo(r+u/2,A+-z/2);g.close();g.fillAndStroke()};mxCellRenderer.registerShape("collate",Bb);mxUtils.extend(Cb,mxEllipse);Cb.prototype.paintVertexShape=function(g,r,A,u,z){var F=g.state.strokeWidth/2,I=10+2*F,ea=A+z-I/2;g.begin();g.moveTo(r,A);g.lineTo(r,A+z);g.moveTo(r+F,ea);g.lineTo(r+F+I,ea-I/2);g.moveTo(r+F,ea);g.lineTo(r+F+I,ea+I/2);g.moveTo(r+F,ea);g.lineTo(r+u-F,ea);g.moveTo(r+u,A);g.lineTo(r+u,A+z);g.moveTo(r+u-F,ea);g.lineTo(r+u-I-F,ea-I/2);g.moveTo(r+u-F,ea);g.lineTo(r+u-I-F,ea+I/2);g.end();g.stroke()};-mxCellRenderer.registerShape("dimension",Cb);mxUtils.extend(Kb,mxEllipse);Kb.prototype.drawHidden=!0;Kb.prototype.paintVertexShape=function(g,r,A,u,z){this.outline||g.setStrokeColor(null);if(null!=this.style){var F=g.pointerEvents,I=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||I||(g.pointerEvents=!1);var ea="1"==mxUtils.getValue(this.style,"top","1"),S="1"==mxUtils.getValue(this.style,"left","1"),ta="1"==mxUtils.getValue(this.style,-"right","1"),oa="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||I||this.outline||ea||ta||oa||S?(g.rect(r,A,u,z),g.fill(),g.pointerEvents=F,g.setStrokeColor(this.stroke),g.setLineCap("square"),g.begin(),g.moveTo(r,A),this.outline||ea?g.lineTo(r+u,A):g.moveTo(r+u,A),this.outline||ta?g.lineTo(r+u,A+z):g.moveTo(r+u,A+z),this.outline||oa?g.lineTo(r,A+z):g.moveTo(r,A+z),(this.outline||S)&&g.lineTo(r,A),g.end(),g.stroke(),g.setLineCap("flat")):g.setStrokeColor(this.stroke)}null==this.state||-this.outline||null==this.fill||this.fill==mxConstants.NONE||(F=this.state.view.graph,null!=F.paintTableCellLines&&F.paintTableCellLines(g,this.state.cell,r,A,u,z,this.stroke,this.strokewidth))};mxCellRenderer.registerShape("partialRectangle",Kb);mxUtils.extend(Xb,mxEllipse);Xb.prototype.paintVertexShape=function(g,r,A,u,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();"vertical"==mxUtils.getValue(this.style,"line")?(g.moveTo(r+u/2,A),g.lineTo(r+u/2,A+z)):(g.moveTo(r,-A+z/2),g.lineTo(r+u,A+z/2));g.end();g.stroke()};mxCellRenderer.registerShape("lineEllipse",Xb);mxUtils.extend(Ob,mxActor);Ob.prototype.redrawPath=function(g,r,A,u,z){r=Math.min(u,z/2);g.moveTo(0,0);g.lineTo(u-r,0);g.quadTo(u,0,u,z/2);g.quadTo(u,z,u-r,z);g.lineTo(0,z);g.close();g.end()};mxCellRenderer.registerShape("delay",Ob);mxUtils.extend(Ub,mxActor);Ub.prototype.size=.2;Ub.prototype.redrawPath=function(g,r,A,u,z){r=Math.min(z,u);var F=Math.max(0,Math.min(r,r*parseFloat(mxUtils.getValue(this.style,-"size",this.size))));r=(z-F)/2;A=r+F;var I=(u-F)/2;F=I+F;g.moveTo(0,r);g.lineTo(I,r);g.lineTo(I,0);g.lineTo(F,0);g.lineTo(F,r);g.lineTo(u,r);g.lineTo(u,A);g.lineTo(F,A);g.lineTo(F,z);g.lineTo(I,z);g.lineTo(I,A);g.lineTo(0,A);g.close();g.end()};mxCellRenderer.registerShape("cross",Ub);mxUtils.extend(Qb,mxActor);Qb.prototype.size=.25;Qb.prototype.redrawPath=function(g,r,A,u,z){r=Math.min(u,z/2);A=Math.min(u-r,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*u);g.moveTo(0,z/2);g.lineTo(A,-0);g.lineTo(u-r,0);g.quadTo(u,0,u,z/2);g.quadTo(u,z,u-r,z);g.lineTo(A,z);g.close();g.end()};mxCellRenderer.registerShape("display",Qb);mxUtils.extend(xb,mxActor);xb.prototype.cst={RECT2:"mxgraph.basic.rect"};xb.prototype.customProperties=[{name:"rectStyle",dispName:"Style",type:"enum",defVal:"square",enumList:[{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"size",dispName:"Corner Size",+Ba.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)?(g=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(0,g,0,0)):null};Ba.prototype.redrawPath=function(g,r,A,v,z){r=Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,z),new mxPoint(0,r),new mxPoint(v,0),new mxPoint(v,z)],this.isRounded,A,+!0);g.end()};mxCellRenderer.registerShape("manualInput",Ba);mxUtils.extend(Ka,mxRectangleShape);Ka.prototype.dx=20;Ka.prototype.dy=20;Ka.prototype.isHtmlAllowed=function(){return!1};Ka.prototype.paintForeground=function(g,r,A,v,z){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var F=0;if(this.isRounded){var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;F=Math.max(F,Math.min(v*I,z*I))}I=Math.max(F,Math.min(v,parseFloat(mxUtils.getValue(this.style,+"dx",this.dx))));F=Math.max(F,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.begin();g.moveTo(r,A+F);g.lineTo(r+v,A+F);g.end();g.stroke();g.begin();g.moveTo(r+I,A);g.lineTo(r+I,A+z);g.end();g.stroke()};mxCellRenderer.registerShape("internalStorage",Ka);mxUtils.extend(ab,mxActor);ab.prototype.dx=20;ab.prototype.dy=20;ab.prototype.isRoundable=function(){return!0};ab.prototype.redrawPath=function(g,r,A,v,z){r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));+A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,A),new mxPoint(r,A),new mxPoint(r,z),new mxPoint(0,z)],this.isRounded,F,!0);g.end()};mxCellRenderer.registerShape("corner",ab);mxUtils.extend(Qa,mxActor);Qa.prototype.redrawPath=function(g,r,A,v,z){g.moveTo(0,+0);g.lineTo(0,z);g.end();g.moveTo(v,0);g.lineTo(v,z);g.end();g.moveTo(0,z/2);g.lineTo(v,z/2);g.end()};mxCellRenderer.registerShape("crossbar",Qa);mxUtils.extend(db,mxActor);db.prototype.dx=20;db.prototype.dy=20;db.prototype.isRoundable=function(){return!0};db.prototype.redrawPath=function(g,r,A,v,z){r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",+this.size));var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,A),new mxPoint((v+r)/2,A),new mxPoint((v+r)/2,z),new mxPoint((v-r)/2,z),new mxPoint((v-r)/2,A),new mxPoint(0,A)],this.isRounded,F,!0);g.end()};mxCellRenderer.registerShape("tee",db);mxUtils.extend(Va,mxActor);Va.prototype.arrowWidth=.3;Va.prototype.arrowSize=.2;Va.prototype.isRoundable=function(){return!0};Va.prototype.redrawPath=function(g,+r,A,v,z){var F=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));r=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));A=(z-F)/2;F=A+F;var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,A),new mxPoint(v-r,A),new mxPoint(v-r,0),new mxPoint(v,z/2),new mxPoint(v-r,z),new mxPoint(v-r,F),new mxPoint(0,F)],this.isRounded,I,!0);g.end()};mxCellRenderer.registerShape("singleArrow",+Va);mxUtils.extend(nb,mxActor);nb.prototype.isRoundable=function(){return!0};nb.prototype.redrawPath=function(g,r,A,v,z){var F=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Va.prototype.arrowWidth))));r=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Va.prototype.arrowSize))));A=(z-F)/2;F=A+F;var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,z/2),new mxPoint(r,0),new mxPoint(r,+A),new mxPoint(v-r,A),new mxPoint(v-r,0),new mxPoint(v,z/2),new mxPoint(v-r,z),new mxPoint(v-r,F),new mxPoint(r,F),new mxPoint(r,z)],this.isRounded,I,!0);g.end()};mxCellRenderer.registerShape("doubleArrow",nb);mxUtils.extend(bb,mxActor);bb.prototype.size=.1;bb.prototype.fixedSize=20;bb.prototype.redrawPath=function(g,r,A,v,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,+"size",this.size))));g.moveTo(r,0);g.lineTo(v,0);g.quadTo(v-2*r,z/2,v,z);g.lineTo(r,z);g.quadTo(r-2*r,z/2,r,0);g.close();g.end()};mxCellRenderer.registerShape("dataStorage",bb);mxUtils.extend(ya,mxActor);ya.prototype.redrawPath=function(g,r,A,v,z){g.moveTo(0,0);g.quadTo(v,0,v,z/2);g.quadTo(v,z,0,z);g.close();g.end()};mxCellRenderer.registerShape("or",ya);mxUtils.extend(Ra,mxActor);Ra.prototype.redrawPath=function(g,r,A,v,z){g.moveTo(0,0);g.quadTo(v,0,v,z/2);g.quadTo(v,z,0,z);g.quadTo(v/2,z/2,0,0);+g.close();g.end()};mxCellRenderer.registerShape("xor",Ra);mxUtils.extend(Ya,mxActor);Ya.prototype.size=20;Ya.prototype.isRoundable=function(){return!0};Ya.prototype.redrawPath=function(g,r,A,v,z){r=Math.min(v/2,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,0),new mxPoint(v-r,0),new mxPoint(v,.8*r),new mxPoint(v,z),new mxPoint(0,z),new mxPoint(0,.8*r)],this.isRounded,+A,!0);g.end()};mxCellRenderer.registerShape("loopLimit",Ya);mxUtils.extend(lb,mxActor);lb.prototype.size=.375;lb.prototype.isRoundable=function(){return!0};lb.prototype.redrawPath=function(g,r,A,v,z){r=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,z-r),new mxPoint(v/2,z),new mxPoint(0,z-r)],this.isRounded,A,!0);+g.end()};mxCellRenderer.registerShape("offPageConnector",lb);mxUtils.extend(ub,mxEllipse);ub.prototype.paintVertexShape=function(g,r,A,v,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.begin();g.moveTo(r+v/2,A+z);g.lineTo(r+v,A+z);g.end();g.stroke()};mxCellRenderer.registerShape("tapeData",ub);mxUtils.extend(gb,mxEllipse);gb.prototype.paintVertexShape=function(g,r,A,v,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r,A+z/2);g.lineTo(r++v,A+z/2);g.end();g.stroke();g.begin();g.moveTo(r+v/2,A);g.lineTo(r+v/2,A+z);g.end();g.stroke()};mxCellRenderer.registerShape("orEllipse",gb);mxUtils.extend(jb,mxEllipse);jb.prototype.paintVertexShape=function(g,r,A,v,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r+.145*v,A+.145*z);g.lineTo(r+.855*v,A+.855*z);g.end();g.stroke();g.begin();g.moveTo(r+.855*v,A+.145*z);g.lineTo(r+.145*v,A+.855*z);g.end();g.stroke()};mxCellRenderer.registerShape("sumEllipse",+jb);mxUtils.extend(yb,mxRhombus);yb.prototype.paintVertexShape=function(g,r,A,v,z){mxRhombus.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r,A+z/2);g.lineTo(r+v,A+z/2);g.end();g.stroke()};mxCellRenderer.registerShape("sortShape",yb);mxUtils.extend(Bb,mxEllipse);Bb.prototype.paintVertexShape=function(g,r,A,v,z){g.begin();g.moveTo(r,A);g.lineTo(r+v,A);g.lineTo(r+v/2,A+z/2);g.close();g.fillAndStroke();g.begin();g.moveTo(r,A+z);g.lineTo(r+v,A+z);g.lineTo(r+v/2,A++z/2);g.close();g.fillAndStroke()};mxCellRenderer.registerShape("collate",Bb);mxUtils.extend(Cb,mxEllipse);Cb.prototype.paintVertexShape=function(g,r,A,v,z){var F=g.state.strokeWidth/2,I=10+2*F,ea=A+z-I/2;g.begin();g.moveTo(r,A);g.lineTo(r,A+z);g.moveTo(r+F,ea);g.lineTo(r+F+I,ea-I/2);g.moveTo(r+F,ea);g.lineTo(r+F+I,ea+I/2);g.moveTo(r+F,ea);g.lineTo(r+v-F,ea);g.moveTo(r+v,A);g.lineTo(r+v,A+z);g.moveTo(r+v-F,ea);g.lineTo(r+v-I-F,ea-I/2);g.moveTo(r+v-F,ea);g.lineTo(r+v-I-F,ea+I/2);g.end();g.stroke()};+mxCellRenderer.registerShape("dimension",Cb);mxUtils.extend(Kb,mxEllipse);Kb.prototype.drawHidden=!0;Kb.prototype.paintVertexShape=function(g,r,A,v,z){this.outline||g.setStrokeColor(null);if(null!=this.style){var F=g.pointerEvents,I=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||I||(g.pointerEvents=!1);var ea="1"==mxUtils.getValue(this.style,"top","1"),S="1"==mxUtils.getValue(this.style,"left","1"),ta="1"==mxUtils.getValue(this.style,+"right","1"),oa="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||I||this.outline||ea||ta||oa||S?(g.rect(r,A,v,z),g.fill(),g.pointerEvents=F,g.setStrokeColor(this.stroke),g.setLineCap("square"),g.begin(),g.moveTo(r,A),this.outline||ea?g.lineTo(r+v,A):g.moveTo(r+v,A),this.outline||ta?g.lineTo(r+v,A+z):g.moveTo(r+v,A+z),this.outline||oa?g.lineTo(r,A+z):g.moveTo(r,A+z),(this.outline||S)&&g.lineTo(r,A),g.end(),g.stroke(),g.setLineCap("flat")):g.setStrokeColor(this.stroke)}null==this.state||+this.outline||null==this.fill||this.fill==mxConstants.NONE||(F=this.state.view.graph,null!=F.paintTableCellLines&&F.paintTableCellLines(g,this.state.cell,r,A,v,z,this.stroke,this.strokewidth))};mxCellRenderer.registerShape("partialRectangle",Kb);mxUtils.extend(Xb,mxEllipse);Xb.prototype.paintVertexShape=function(g,r,A,v,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();"vertical"==mxUtils.getValue(this.style,"line")?(g.moveTo(r+v/2,A),g.lineTo(r+v/2,A+z)):(g.moveTo(r,+A+z/2),g.lineTo(r+v,A+z/2));g.end();g.stroke()};mxCellRenderer.registerShape("lineEllipse",Xb);mxUtils.extend(Ob,mxActor);Ob.prototype.redrawPath=function(g,r,A,v,z){r=Math.min(v,z/2);g.moveTo(0,0);g.lineTo(v-r,0);g.quadTo(v,0,v,z/2);g.quadTo(v,z,v-r,z);g.lineTo(0,z);g.close();g.end()};mxCellRenderer.registerShape("delay",Ob);mxUtils.extend(Ub,mxActor);Ub.prototype.size=.2;Ub.prototype.redrawPath=function(g,r,A,v,z){r=Math.min(z,v);var F=Math.max(0,Math.min(r,r*parseFloat(mxUtils.getValue(this.style,+"size",this.size))));r=(z-F)/2;A=r+F;var I=(v-F)/2;F=I+F;g.moveTo(0,r);g.lineTo(I,r);g.lineTo(I,0);g.lineTo(F,0);g.lineTo(F,r);g.lineTo(v,r);g.lineTo(v,A);g.lineTo(F,A);g.lineTo(F,z);g.lineTo(I,z);g.lineTo(I,A);g.lineTo(0,A);g.close();g.end()};mxCellRenderer.registerShape("cross",Ub);mxUtils.extend(Qb,mxActor);Qb.prototype.size=.25;Qb.prototype.redrawPath=function(g,r,A,v,z){r=Math.min(v,z/2);A=Math.min(v-r,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*v);g.moveTo(0,z/2);g.lineTo(A,+0);g.lineTo(v-r,0);g.quadTo(v,0,v,z/2);g.quadTo(v,z,v-r,z);g.lineTo(A,z);g.close();g.end()};mxCellRenderer.registerShape("display",Qb);mxUtils.extend(xb,mxActor);xb.prototype.cst={RECT2:"mxgraph.basic.rect"};xb.prototype.customProperties=[{name:"rectStyle",dispName:"Style",type:"enum",defVal:"square",enumList:[{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"size",dispName:"Corner Size",type:"float",defVal:10},{name:"absoluteCornerSize",dispName:"Abs. Corner Size",type:"bool",defVal:!0},{name:"indent",dispName:"Indent",type:"float",defVal:2},{name:"rectOutline",dispName:"Outline",type:"enum",defVal:"single",enumList:[{val:"single",dispName:"Single"},{val:"double",dispName:"Double"},{val:"frame",dispName:"Frame"}]},{name:"fillColor2",dispName:"Inside Fill Color",type:"color",defVal:"none"},{name:"gradientColor2",dispName:"Inside Gradient Color",type:"color",defVal:"none"},{name:"gradientDirection2",dispName:"Inside Gradient Direction",type:"enum",defVal:"south",enumList:[{val:"south",dispName:"South"},{val:"west",dispName:"West"},{val:"north",dispName:"North"},{val:"east",dispName:"East"}]},{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"right",dispName:"Right",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left ",type:"bool",defVal:!0},{name:"topLeftStyle",dispName:"Top Left Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"topRightStyle",dispName:"Top Right Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomRightStyle",dispName:"Bottom Right Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomLeftStyle",dispName:"Bottom Left Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",-dispName:"Fold"}]}];xb.prototype.paintVertexShape=function(g,r,A,u,z){g.translate(r,A);this.strictDrawShape(g,0,0,u,z)};xb.prototype.strictDrawShape=function(g,r,A,u,z,F){var I=F&&F.rectStyle?F.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),ea=F&&F.absoluteCornerSize?F.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",this.absoluteCornerSize),S=F&&F.size?F.size:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),ta=F&&F.rectOutline?-F.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),oa=F&&F.indent?F.indent:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Ia=F&&F.dashed?F.dashed:mxUtils.getValue(this.style,"dashed",!1),mb=F&&F.dashPattern?F.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),$a=F&&F.relIndent?F.relIndent:Math.max(0,Math.min(50,oa)),Ea=F&&F.top?F.top:mxUtils.getValue(this.style,"top",!0),Ga=F&&F.right?F.right:mxUtils.getValue(this.style,"right",+dispName:"Fold"}]}];xb.prototype.paintVertexShape=function(g,r,A,v,z){g.translate(r,A);this.strictDrawShape(g,0,0,v,z)};xb.prototype.strictDrawShape=function(g,r,A,v,z,F){var I=F&&F.rectStyle?F.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),ea=F&&F.absoluteCornerSize?F.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",this.absoluteCornerSize),S=F&&F.size?F.size:Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),ta=F&&F.rectOutline?+F.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),oa=F&&F.indent?F.indent:Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Ia=F&&F.dashed?F.dashed:mxUtils.getValue(this.style,"dashed",!1),mb=F&&F.dashPattern?F.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),$a=F&&F.relIndent?F.relIndent:Math.max(0,Math.min(50,oa)),Ea=F&&F.top?F.top:mxUtils.getValue(this.style,"top",!0),Ga=F&&F.right?F.right:mxUtils.getValue(this.style,"right",!0),Ja=F&&F.bottom?F.bottom:mxUtils.getValue(this.style,"bottom",!0),Pa=F&&F.left?F.left:mxUtils.getValue(this.style,"left",!0),eb=F&&F.topLeftStyle?F.topLeftStyle:mxUtils.getValue(this.style,"topLeftStyle","default"),hb=F&&F.topRightStyle?F.topRightStyle:mxUtils.getValue(this.style,"topRightStyle","default"),ib=F&&F.bottomRightStyle?F.bottomRightStyle:mxUtils.getValue(this.style,"bottomRightStyle","default"),kb=F&&F.bottomLeftStyle?F.bottomLeftStyle:mxUtils.getValue(this.style,"bottomLeftStyle","default"),dc=F&&F.fillColor?F.fillColor:mxUtils.getValue(this.style,"fillColor","#ffffff");F&&F.strokeColor||mxUtils.getValue(this.style,"strokeColor","#000000");var ec=F&&F.strokeWidth?F.strokeWidth:mxUtils.getValue(this.style,"strokeWidth","1"),cc=F&&F.fillColor2?F.fillColor2:mxUtils.getValue(this.style,"fillColor2","none"),fc=F&&F.gradientColor2?F.gradientColor2:mxUtils.getValue(this.style,"gradientColor2","none"),gc=F&&F.gradientDirection2?F.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2",-"south"),hc=F&&F.opacity?F.opacity:mxUtils.getValue(this.style,"opacity","100"),ic=Math.max(0,Math.min(50,S));F=xb.prototype;g.setDashed(Ia);mb&&""!=mb&&g.setDashPattern(mb);g.setStrokeWidth(ec);S=Math.min(.5*z,.5*u,S);ea||(S=ic*Math.min(u,z)/100);S=Math.min(S,.5*Math.min(u,z));ea||(oa=Math.min($a*Math.min(u,z)/100));oa=Math.min(oa,.5*Math.min(u,z)-S);(Ea||Ga||Ja||Pa)&&"frame"!=ta&&(g.begin(),Ea?F.moveNW(g,r,A,u,z,I,eb,S,Pa):g.moveTo(0,0),Ea&&F.paintNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,-hb,S,Ga),Ga&&F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),Ja&&F.paintSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),Pa&&F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),g.close(),g.fill(),g.setShadow(!1),g.setFillColor(cc),Ia=ea=hc,"none"==cc&&(ea=0),"none"==fc&&(Ia=0),g.setGradient(cc,fc,0,0,u,z,gc,ea,Ia),g.begin(),Ea?F.moveNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa):g.moveTo(oa,0),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),Pa&&Ja&&F.paintSWInner(g,r,A,u,z,-I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),Ja&&Ga&&F.paintSEInner(g,r,A,u,z,I,ib,S,oa),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),Ga&&Ea&&F.paintNEInner(g,r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),Ea&&Pa&&F.paintNWInner(g,r,A,u,z,I,eb,S,oa),g.fill(),"none"==dc&&(g.begin(),F.paintFolds(g,r,A,u,z,I,eb,hb,ib,kb,S,Ea,Ga,Ja,Pa),g.stroke()));Ea||Ga||Ja||!Pa?Ea||Ga||!Ja||Pa?!Ea&&!Ga&&Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,-z,I,kb,S,Pa),F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),"double"==ta&&(F.moveNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,u,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja)),g.stroke()):(g.begin(),F.moveSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.lineNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,-r,A,u,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),g.close(),g.fillAndStroke()):Ea||!Ga||Ja||Pa?!Ea&&Ga&&!Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSW(g,r,A,u,z,I,eb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),"double"==ta&&(F.moveNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa)),g.stroke(),g.begin(),F.moveNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),"double"==ta&&(F.moveSEInner(g,r,A,u,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga)),-g.stroke()):(g.begin(),F.moveSW(g,r,A,u,z,I,eb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.lineNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),g.close(),g.fillAndStroke(),g.begin(),F.moveNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.lineSEInner(g,r,A,u,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),g.close(),g.fillAndStroke()):!Ea&&Ga&&Ja&&!Pa?"frame"!=ta?(g.begin(),F.moveNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.paintSE(g,-r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),"double"==ta&&(F.moveSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,u,z,I,ib,S,oa),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga)),g.stroke()):(g.begin(),F.moveNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.paintSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.lineSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,u,z,I,ib,-S,oa),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),g.close(),g.fillAndStroke()):!Ea&&Ga&&Ja&&Pa?"frame"!=ta?(g.begin(),F.moveNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.paintSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),"double"==ta&&(F.moveNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,u,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,-r,A,u,z,I,ib,S,oa),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga)),g.stroke()):(g.begin(),F.moveNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.paintSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.lineNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,u,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,u,z,I,ib,S,oa),F.paintRightInner(g,-r,A,u,z,I,hb,S,oa,Ea,Ga),g.close(),g.fillAndStroke()):!Ea||Ga||Ja||Pa?Ea&&!Ga&&!Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.paintNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),"double"==ta&&(F.moveNEInner(g,r,A,u,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,u,z,I,eb,S,oa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa)),g.stroke()):(g.begin(),F.moveSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.paintNW(g,-r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.lineNEInner(g,r,A,u,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,u,z,I,eb,S,oa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),g.close(),g.fillAndStroke()):Ea&&!Ga&&Ja&&!Pa?"frame"!=ta?(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),"double"==ta&&(F.moveNEInner(g,r,A,u,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea)),g.stroke(),g.begin(),F.moveSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,-r,A,u,z,I,kb,S,Pa),"double"==ta&&(F.moveSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja)),g.stroke()):(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.lineNEInner(g,r,A,u,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),g.close(),g.fillAndStroke(),g.begin(),F.moveSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.lineSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),g.close(),g.fillAndStroke()):-Ea&&!Ga&&Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.paintNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),"double"==ta&&(F.moveNEInner(g,r,A,u,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,u,z,I,eb,S,oa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,u,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja)),g.stroke()):-(g.begin(),F.moveSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.paintNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.lineNEInner(g,r,A,u,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,u,z,I,eb,S,oa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,u,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),g.close(),g.fillAndStroke()):Ea&&Ga&&!Ja&&!Pa?"frame"!=-ta?(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),"double"==ta&&(F.moveSEInner(g,r,A,u,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea)),g.stroke()):(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.lineSEInner(g,r,A,u,z,I,ib,S,oa,-Ja),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),g.close(),g.fillAndStroke()):Ea&&Ga&&!Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.paintNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),"double"==ta&&(F.moveSEInner(g,r,A,u,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,-r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,u,z,I,eb,S,oa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa)),g.stroke()):(g.begin(),F.moveSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.paintNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.lineSEInner(g,r,A,u,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,-I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,u,z,I,eb,S,oa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),g.close(),g.fillAndStroke()):Ea&&Ga&&Ja&&!Pa?"frame"!=ta?(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.paintSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),"double"==ta&&(F.moveSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,u,z,I,ib,S,oa),F.paintRightInner(g,-r,A,u,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea)),g.stroke()):(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.paintSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.lineSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,u,z,I,ib,S,oa),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,-r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),g.close(),g.fillAndStroke()):Ea&&Ga&&Ja&&Pa&&("frame"!=ta?(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.paintSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),g.close(),"double"==ta&&(F.moveSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintSWInner(g,r,-A,u,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,u,z,I,ib,S,oa),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,u,z,I,eb,S,oa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),g.close()),g.stroke()):(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.paintSE(g,-r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),g.close(),F.moveSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintSWInner(g,r,A,u,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,u,z,I,ib,S,oa),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,u,z,I,eb,S,oa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),g.close(),-g.fillAndStroke())):"frame"!=ta?(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),"double"==ta&&(F.moveNEInner(g,r,A,u,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea)),g.stroke()):(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.lineNEInner(g,r,A,u,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),g.close(),g.fillAndStroke()):"frame"!=ta?(g.begin(),F.moveNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),"double"==ta&&(F.moveSEInner(g,-r,A,u,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga)),g.stroke()):(g.begin(),F.moveNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.lineSEInner(g,r,A,u,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),g.close(),g.fillAndStroke()):"frame"!=ta?(g.begin(),F.moveSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),"double"==ta&&(F.moveSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja)),g.stroke()):(g.begin(),F.moveSE(g,r,A,u,z,I,ib,-S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.lineSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),g.close(),g.fillAndStroke()):"frame"!=ta?(g.begin(),F.moveSW(g,r,A,u,z,I,eb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),"double"==ta&&(F.moveNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa)),g.stroke()):(g.begin(),F.moveSW(g,r,A,u,z,I,eb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.lineNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,u,z,I,kb,S,-oa,Ja,Pa),g.close(),g.fillAndStroke());g.begin();F.paintFolds(g,r,A,u,z,I,eb,hb,ib,kb,S,Ea,Ga,Ja,Pa);g.stroke()};xb.prototype.moveNW=function(g,r,A,u,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.moveTo(0,0):g.moveTo(0,ea)};xb.prototype.moveNE=function(g,r,A,u,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.moveTo(u,0):g.moveTo(u-ea,0)};xb.prototype.moveSE=function(g,r,A,u,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.moveTo(u,z):g.moveTo(u,z-ea)};xb.prototype.moveSW=-function(g,r,A,u,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.moveTo(0,z):g.moveTo(ea,z)};xb.prototype.paintNW=function(g,r,A,u,z,F,I,ea,S){if(S)if("rounded"==I||"default"==I&&"rounded"==F||"invRound"==I||"default"==I&&"invRound"==F){r=0;if("rounded"==I||"default"==I&&"rounded"==F)r=1;g.arcTo(ea,ea,0,0,r,ea,0)}else("snip"==I||"default"==I&&"snip"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(ea,0);else g.lineTo(0,0)};xb.prototype.paintTop=function(g,r,A,u,z,F,I,ea,S){"square"==I||-"default"==I&&"square"==F||!S?g.lineTo(u,0):g.lineTo(u-ea,0)};xb.prototype.paintNE=function(g,r,A,u,z,F,I,ea,S){if(S)if("rounded"==I||"default"==I&&"rounded"==F||"invRound"==I||"default"==I&&"invRound"==F){r=0;if("rounded"==I||"default"==I&&"rounded"==F)r=1;g.arcTo(ea,ea,0,0,r,u,ea)}else("snip"==I||"default"==I&&"snip"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(u,ea);else g.lineTo(u,0)};xb.prototype.paintRight=function(g,r,A,u,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.lineTo(u,-z):g.lineTo(u,z-ea)};xb.prototype.paintLeft=function(g,r,A,u,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.lineTo(0,0):g.lineTo(0,ea)};xb.prototype.paintSE=function(g,r,A,u,z,F,I,ea,S){if(S)if("rounded"==I||"default"==I&&"rounded"==F||"invRound"==I||"default"==I&&"invRound"==F){r=0;if("rounded"==I||"default"==I&&"rounded"==F)r=1;g.arcTo(ea,ea,0,0,r,u-ea,z)}else("snip"==I||"default"==I&&"snip"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(u-ea,z);else g.lineTo(u,z)};xb.prototype.paintBottom=-function(g,r,A,u,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.lineTo(0,z):g.lineTo(ea,z)};xb.prototype.paintSW=function(g,r,A,u,z,F,I,ea,S){if(S)if("rounded"==I||"default"==I&&"rounded"==F||"invRound"==I||"default"==I&&"invRound"==F){r=0;if("rounded"==I||"default"==I&&"rounded"==F)r=1;g.arcTo(ea,ea,0,0,r,0,z-ea)}else("snip"==I||"default"==I&&"snip"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(0,z-ea);else g.lineTo(0,z)};xb.prototype.paintNWInner=function(g,r,A,u,z,F,I,ea,S){if("rounded"==-I||"default"==I&&"rounded"==F)g.arcTo(ea-.5*S,ea-.5*S,0,0,0,S,.5*S+ea);else if("invRound"==I||"default"==I&&"invRound"==F)g.arcTo(ea+S,ea+S,0,0,1,S,S+ea);else if("snip"==I||"default"==I&&"snip"==F)g.lineTo(S,.5*S+ea);else if("fold"==I||"default"==I&&"fold"==F)g.lineTo(S+ea,S+ea),g.lineTo(S,S+ea)};xb.prototype.paintTopInner=function(g,r,A,u,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(0,S):ta&&!oa?g.lineTo(S,0):ta?"square"==I||"default"==I&&"square"==F?g.lineTo(S,S):"rounded"==I||"default"==I&&"rounded"==-F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(ea+.5*S,S):g.lineTo(ea+S,S):g.lineTo(0,S):g.lineTo(0,0)};xb.prototype.paintNEInner=function(g,r,A,u,z,F,I,ea,S){if("rounded"==I||"default"==I&&"rounded"==F)g.arcTo(ea-.5*S,ea-.5*S,0,0,0,u-ea-.5*S,S);else if("invRound"==I||"default"==I&&"invRound"==F)g.arcTo(ea+S,ea+S,0,0,1,u-ea-S,S);else if("snip"==I||"default"==I&&"snip"==F)g.lineTo(u-ea-.5*S,S);else if("fold"==I||"default"==I&&"fold"==F)g.lineTo(u-ea-S,ea+S),g.lineTo(u-ea-S,S)};xb.prototype.paintRightInner=-function(g,r,A,u,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(u-S,0):ta&&!oa?g.lineTo(u,S):ta?"square"==I||"default"==I&&"square"==F?g.lineTo(u-S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(u-S,ea+.5*S):g.lineTo(u-S,ea+S):g.lineTo(u-S,0):g.lineTo(u,0)};xb.prototype.paintLeftInner=function(g,r,A,u,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(S,z):ta&&!oa?g.lineTo(0,z-S):ta?"square"==I||"default"==I&&"square"==F?g.lineTo(S,z-S):"rounded"==I||"default"==I&&"rounded"==-F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(S,z-ea-.5*S):g.lineTo(S,z-ea-S):g.lineTo(S,z):g.lineTo(0,z)};xb.prototype.paintSEInner=function(g,r,A,u,z,F,I,ea,S){if("rounded"==I||"default"==I&&"rounded"==F)g.arcTo(ea-.5*S,ea-.5*S,0,0,0,u-S,z-ea-.5*S);else if("invRound"==I||"default"==I&&"invRound"==F)g.arcTo(ea+S,ea+S,0,0,1,u-S,z-ea-S);else if("snip"==I||"default"==I&&"snip"==F)g.lineTo(u-S,z-ea-.5*S);else if("fold"==I||"default"==I&&"fold"==F)g.lineTo(u-ea-S,z-ea-S),g.lineTo(u-S,z-ea-S)};xb.prototype.paintBottomInner=-function(g,r,A,u,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(u,z-S):ta&&!oa?g.lineTo(u-S,z):"square"==I||"default"==I&&"square"==F||!ta?g.lineTo(u-S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(u-ea-.5*S,z-S):g.lineTo(u-ea-S,z-S):g.lineTo(u,z)};xb.prototype.paintSWInner=function(g,r,A,u,z,F,I,ea,S,ta){if(!ta)g.lineTo(S,z);else if("square"==I||"default"==I&&"square"==F)g.lineTo(S,z-S);else if("rounded"==I||"default"==I&&"rounded"==F)g.arcTo(ea-.5*S,ea-.5*-S,0,0,0,ea+.5*S,z-S);else if("invRound"==I||"default"==I&&"invRound"==F)g.arcTo(ea+S,ea+S,0,0,1,ea+S,z-S);else if("snip"==I||"default"==I&&"snip"==F)g.lineTo(ea+.5*S,z-S);else if("fold"==I||"default"==I&&"fold"==F)g.lineTo(S+ea,z-ea-S),g.lineTo(S+ea,z-S)};xb.prototype.moveSWInner=function(g,r,A,u,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==F?g.moveTo(S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.moveTo(S,z-ea-.5*S):("invRound"==I||"default"==I&&"invRound"==-F||"fold"==I||"default"==I&&"fold"==F)&&g.moveTo(S,z-ea-S):g.moveTo(0,z-S)};xb.prototype.lineSWInner=function(g,r,A,u,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==F?g.lineTo(S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(S,z-ea-.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(S,z-ea-S):g.lineTo(0,z-S)};xb.prototype.moveSEInner=function(g,r,A,u,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==-F?g.moveTo(u-S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.moveTo(u-S,z-ea-.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.moveTo(u-S,z-ea-S):g.moveTo(u-S,z)};xb.prototype.lineSEInner=function(g,r,A,u,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==F?g.lineTo(u-S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(u-S,z-ea-.5*S):("invRound"==I||"default"==I&&"invRound"==-F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(u-S,z-ea-S):g.lineTo(u-S,z)};xb.prototype.moveNEInner=function(g,r,A,u,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==F||ta?g.moveTo(u-S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.moveTo(u-S,ea+.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.moveTo(u-S,ea+S):g.moveTo(u,S)};xb.prototype.lineNEInner=function(g,r,A,u,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==-F||ta?g.lineTo(u-S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(u-S,ea+.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(u-S,ea+S):g.lineTo(u,S)};xb.prototype.moveNWInner=function(g,r,A,u,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.moveTo(S,0):ta&&!oa?g.moveTo(0,S):"square"==I||"default"==I&&"square"==F?g.moveTo(S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.moveTo(S,ea+.5*S):("invRound"==-I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.moveTo(S,ea+S):g.moveTo(0,0)};xb.prototype.lineNWInner=function(g,r,A,u,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(S,0):ta&&!oa?g.lineTo(0,S):"square"==I||"default"==I&&"square"==F?g.lineTo(S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(S,ea+.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(S,ea+S):g.lineTo(0,0)};xb.prototype.paintFolds=function(g,-r,A,u,z,F,I,ea,S,ta,oa,Ia,mb,$a,Ea){if("fold"==F||"fold"==I||"fold"==ea||"fold"==S||"fold"==ta)("fold"==I||"default"==I&&"fold"==F)&&Ia&&Ea&&(g.moveTo(0,oa),g.lineTo(oa,oa),g.lineTo(oa,0)),("fold"==ea||"default"==ea&&"fold"==F)&&Ia&&mb&&(g.moveTo(u-oa,0),g.lineTo(u-oa,oa),g.lineTo(u,oa)),("fold"==S||"default"==S&&"fold"==F)&&$a&&mb&&(g.moveTo(u-oa,z),g.lineTo(u-oa,z-oa),g.lineTo(u,z-oa)),("fold"==ta||"default"==ta&&"fold"==F)&&$a&&Ea&&(g.moveTo(0,z-oa),g.lineTo(oa,z-oa),g.lineTo(oa,z))};mxCellRenderer.registerShape(xb.prototype.cst.RECT2,-xb);xb.prototype.constraints=null;mxUtils.extend(Mb,mxConnector);Mb.prototype.origPaintEdgeShape=Mb.prototype.paintEdgeShape;Mb.prototype.paintEdgeShape=function(g,r){for(var A=[],u=0;u<r.length;u++)A.push(mxUtils.clone(r[u]));u=g.state.dashed;var z=g.state.fixDash;Mb.prototype.origPaintEdgeShape.apply(this,[g,A]);3<=g.state.strokeWidth&&(A=mxUtils.getValue(this.style,"fillColor",null),null!=A&&(g.setStrokeColor(A),g.setStrokeWidth(g.state.strokeWidth-2),g.setDashed(u,z),Mb.prototype.origPaintEdgeShape.apply(this,-[g,r])))};mxCellRenderer.registerShape("filledEdge",Mb);mxUtils.extend(Pb,mxConnector);Pb.prototype.defaultWidth=4;Pb.prototype.getEdgeWidth=function(){return Math.max(0,mxUtils.getNumber(this.style,"width",this.defaultWidth))};Pb.prototype.getFlowAnimationPath=function(){return mxShape.prototype.getFlowAnimationPath.call(this,2)||mxShape.prototype.getFlowAnimationPath.call(this)};Pb.prototype.origPaintEdgeShape=Pb.prototype.paintEdgeShape;Pb.prototype.paintEdgeShape=function(g,r){for(var A=[],u=-0;u<r.length;u++)A.push(mxUtils.clone(r[u]));u=g.state.dashed;var z=g.state.fixDash,F=this.getEdgeWidth();g.setStrokeWidth(F+2*this.strokewidth);g.setDashed(!1);Pb.prototype.origPaintEdgeShape.apply(this,[g,A]);A=mxUtils.getValue(this.style,"fillColor",null);null!=A&&(g.setStrokeWidth(F),g.setStrokeColor(A),g.setDashed(u,z),Pb.prototype.origPaintEdgeShape.apply(this,[g,r]))};mxCellRenderer.registerShape("pipe",Pb);mxUtils.extend(Tb,mxRectangleShape);Tb.prototype.size=10;Tb.prototype.isRoundable=function(){return!0};-Tb.prototype.paintVertexShape=function(g,r,A,u,z){g.translate(r,A);r=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,null);null!=r&&r!=mxConstants.NONE&&(g.setStrokeColor("none"),g.begin(),g.rect(0,0,u,z),g.fillAndStroke(),g.setStrokeColor(this.stroke));var F=Math.max(5,parseFloat(mxUtils.getValue(this.style,"size",this.size)));r=z/2;A=this.strokewidth;A=this.isRounded?A/2:A;z-=A;F=Math.max(1,Math.round(u/F)-1);var I=u/(F+1),ea=I/2;g.begin();g.moveTo(0,r);if(this.isRounded){g.curveTo(.4*ea,-r-.4*(r-A),.6*ea,A,ea,A);for(var S=0;S<F;S++){var ta=ea+S*I,oa=ta+I,Ia=0==S%2?z:A;g.curveTo(ta+.4*I,0==S%2?A:z,oa-.4*I,Ia,oa,Ia)}z=0==F%2?A:z;g.curveTo(ea+F*I+.4*ea,z,u-.4*ea,r-(z==A?1:-1)*(r-A)*.4,u,r)}else{g.lineTo(ea,A);for(S=0;S<F;S++)oa=ea+(S+1)*I,Ia=0==S%2?z:A,g.lineTo(oa,Ia);g.lineTo(u,r)}g.stroke()};mxCellRenderer.registerShape("zigzag",Tb);"undefined"!==typeof StyleFormatPanel&&function(){var g=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var r=-this.editorUi.getSelectionState(),A=g.apply(this,arguments);"umlFrame"==r.style.shape&&A.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return A}}();mxMarker.addMarker("dash",function(g,r,A,u,z,F,I,ea,S,ta){var oa=z*(I+S+1),Ia=F*(I+S+1);return function(){g.begin();g.moveTo(u.x-oa/2-Ia/2,u.y-Ia/2+oa/2);g.lineTo(u.x+Ia/2-3*oa/2,u.y-3*Ia/2-oa/2);g.stroke()}});mxMarker.addMarker("box",function(g,r,A,u,z,F,I,ea,S,ta){var oa=z*(I+S+1),Ia=F*(I+S+1),mb=u.x+oa/2,-$a=u.y+Ia/2;u.x-=oa;u.y-=Ia;return function(){g.begin();g.moveTo(mb-oa/2-Ia/2,$a-Ia/2+oa/2);g.lineTo(mb-oa/2+Ia/2,$a-Ia/2-oa/2);g.lineTo(mb+Ia/2-3*oa/2,$a-3*Ia/2-oa/2);g.lineTo(mb-Ia/2-3*oa/2,$a-3*Ia/2+oa/2);g.close();ta?g.fillAndStroke():g.stroke()}});mxMarker.addMarker("cross",function(g,r,A,u,z,F,I,ea,S,ta){var oa=z*(I+S+1),Ia=F*(I+S+1);return function(){g.begin();g.moveTo(u.x-oa/2-Ia/2,u.y-Ia/2+oa/2);g.lineTo(u.x+Ia/2-3*oa/2,u.y-3*Ia/2-oa/2);g.moveTo(u.x-oa/2+Ia/2,u.y-Ia/2-oa/2);g.lineTo(u.x--Ia/2-3*oa/2,u.y-3*Ia/2+oa/2);g.stroke()}});mxMarker.addMarker("circle",Vb);mxMarker.addMarker("circlePlus",function(g,r,A,u,z,F,I,ea,S,ta){var oa=u.clone(),Ia=Vb.apply(this,arguments),mb=z*(I+2*S),$a=F*(I+2*S);return function(){Ia.apply(this,arguments);g.begin();g.moveTo(oa.x-z*S,oa.y-F*S);g.lineTo(oa.x-2*mb+z*S,oa.y-2*$a+F*S);g.moveTo(oa.x-mb-$a+F*S,oa.y-$a+mb-z*S);g.lineTo(oa.x+$a-mb-F*S,oa.y-$a-mb+z*S);g.stroke()}});mxMarker.addMarker("halfCircle",function(g,r,A,u,z,F,I,ea,S,ta){var oa=z*(I+S+-1),Ia=F*(I+S+1),mb=u.clone();u.x-=oa;u.y-=Ia;return function(){g.begin();g.moveTo(mb.x-Ia,mb.y+oa);g.quadTo(u.x-Ia,u.y+oa,u.x,u.y);g.quadTo(u.x+Ia,u.y-oa,mb.x+Ia,mb.y-oa);g.stroke()}});mxMarker.addMarker("async",function(g,r,A,u,z,F,I,ea,S,ta){r=z*S*1.118;A=F*S*1.118;z*=I+S;F*=I+S;var oa=u.clone();oa.x-=r;oa.y-=A;u.x+=-z-r;u.y+=-F-A;return function(){g.begin();g.moveTo(oa.x,oa.y);ea?g.lineTo(oa.x-z-F/2,oa.y-F+z/2):g.lineTo(oa.x+F/2-z,oa.y-F-z/2);g.lineTo(oa.x-z,oa.y-F);g.close();ta?g.fillAndStroke():-g.stroke()}});mxMarker.addMarker("openAsync",function(g){g=null!=g?g:2;return function(r,A,u,z,F,I,ea,S,ta,oa){F*=ea+ta;I*=ea+ta;var Ia=z.clone();return function(){r.begin();r.moveTo(Ia.x,Ia.y);S?r.lineTo(Ia.x-F-I/g,Ia.y-I+F/g):r.lineTo(Ia.x+I/g-F,Ia.y-I-F/g);r.stroke()}}}(2));mxUtils.extend(Gb,mxRectangleShape);Gb.prototype.arcStartY=25;Gb.prototype.arcMidY=-25;Gb.prototype.arcEndY=25;Gb.prototype.paintForeground=function(g,r,A,u,z){mxRectangleShape.prototype.paintForeground.apply(this,arguments);+"south"),hc=F&&F.opacity?F.opacity:mxUtils.getValue(this.style,"opacity","100"),ic=Math.max(0,Math.min(50,S));F=xb.prototype;g.setDashed(Ia);mb&&""!=mb&&g.setDashPattern(mb);g.setStrokeWidth(ec);S=Math.min(.5*z,.5*v,S);ea||(S=ic*Math.min(v,z)/100);S=Math.min(S,.5*Math.min(v,z));ea||(oa=Math.min($a*Math.min(v,z)/100));oa=Math.min(oa,.5*Math.min(v,z)-S);(Ea||Ga||Ja||Pa)&&"frame"!=ta&&(g.begin(),Ea?F.moveNW(g,r,A,v,z,I,eb,S,Pa):g.moveTo(0,0),Ea&&F.paintNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,+hb,S,Ga),Ga&&F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),Ja&&F.paintSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),Pa&&F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),g.close(),g.fill(),g.setShadow(!1),g.setFillColor(cc),Ia=ea=hc,"none"==cc&&(ea=0),"none"==fc&&(Ia=0),g.setGradient(cc,fc,0,0,v,z,gc,ea,Ia),g.begin(),Ea?F.moveNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa):g.moveTo(oa,0),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),Pa&&Ja&&F.paintSWInner(g,r,A,v,z,+I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),Ja&&Ga&&F.paintSEInner(g,r,A,v,z,I,ib,S,oa),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),Ga&&Ea&&F.paintNEInner(g,r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),Ea&&Pa&&F.paintNWInner(g,r,A,v,z,I,eb,S,oa),g.fill(),"none"==dc&&(g.begin(),F.paintFolds(g,r,A,v,z,I,eb,hb,ib,kb,S,Ea,Ga,Ja,Pa),g.stroke()));Ea||Ga||Ja||!Pa?Ea||Ga||!Ja||Pa?!Ea&&!Ga&&Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,+z,I,kb,S,Pa),F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),"double"==ta&&(F.moveNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,v,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja)),g.stroke()):(g.begin(),F.moveSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.lineNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,+r,A,v,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),g.close(),g.fillAndStroke()):Ea||!Ga||Ja||Pa?!Ea&&Ga&&!Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSW(g,r,A,v,z,I,eb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),"double"==ta&&(F.moveNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa)),g.stroke(),g.begin(),F.moveNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),"double"==ta&&(F.moveSEInner(g,r,A,v,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga)),+g.stroke()):(g.begin(),F.moveSW(g,r,A,v,z,I,eb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.lineNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),g.close(),g.fillAndStroke(),g.begin(),F.moveNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.lineSEInner(g,r,A,v,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),g.close(),g.fillAndStroke()):!Ea&&Ga&&Ja&&!Pa?"frame"!=ta?(g.begin(),F.moveNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.paintSE(g,+r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),"double"==ta&&(F.moveSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,v,z,I,ib,S,oa),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga)),g.stroke()):(g.begin(),F.moveNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.paintSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.lineSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,v,z,I,ib,+S,oa),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),g.close(),g.fillAndStroke()):!Ea&&Ga&&Ja&&Pa?"frame"!=ta?(g.begin(),F.moveNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.paintSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),"double"==ta&&(F.moveNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,v,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,+r,A,v,z,I,ib,S,oa),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga)),g.stroke()):(g.begin(),F.moveNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.paintSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.lineNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,v,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,v,z,I,ib,S,oa),F.paintRightInner(g,+r,A,v,z,I,hb,S,oa,Ea,Ga),g.close(),g.fillAndStroke()):!Ea||Ga||Ja||Pa?Ea&&!Ga&&!Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.paintNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),"double"==ta&&(F.moveNEInner(g,r,A,v,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,v,z,I,eb,S,oa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa)),g.stroke()):(g.begin(),F.moveSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.paintNW(g,+r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.lineNEInner(g,r,A,v,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,v,z,I,eb,S,oa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),g.close(),g.fillAndStroke()):Ea&&!Ga&&Ja&&!Pa?"frame"!=ta?(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),"double"==ta&&(F.moveNEInner(g,r,A,v,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea)),g.stroke(),g.begin(),F.moveSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,+r,A,v,z,I,kb,S,Pa),"double"==ta&&(F.moveSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja)),g.stroke()):(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.lineNEInner(g,r,A,v,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),g.close(),g.fillAndStroke(),g.begin(),F.moveSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.lineSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),g.close(),g.fillAndStroke()):+Ea&&!Ga&&Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.paintNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),"double"==ta&&(F.moveNEInner(g,r,A,v,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,v,z,I,eb,S,oa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,v,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja)),g.stroke()):+(g.begin(),F.moveSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.paintNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.lineNEInner(g,r,A,v,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,v,z,I,eb,S,oa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,v,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),g.close(),g.fillAndStroke()):Ea&&Ga&&!Ja&&!Pa?"frame"!=+ta?(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),"double"==ta&&(F.moveSEInner(g,r,A,v,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea)),g.stroke()):(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.lineSEInner(g,r,A,v,z,I,ib,S,oa,+Ja),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),g.close(),g.fillAndStroke()):Ea&&Ga&&!Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.paintNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),"double"==ta&&(F.moveSEInner(g,r,A,v,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,+r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,v,z,I,eb,S,oa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa)),g.stroke()):(g.begin(),F.moveSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.paintNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.lineSEInner(g,r,A,v,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,+I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,v,z,I,eb,S,oa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),g.close(),g.fillAndStroke()):Ea&&Ga&&Ja&&!Pa?"frame"!=ta?(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.paintSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),"double"==ta&&(F.moveSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,v,z,I,ib,S,oa),F.paintRightInner(g,+r,A,v,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea)),g.stroke()):(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.paintSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.lineSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,v,z,I,ib,S,oa),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,+r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),g.close(),g.fillAndStroke()):Ea&&Ga&&Ja&&Pa&&("frame"!=ta?(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.paintSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),g.close(),"double"==ta&&(F.moveSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintSWInner(g,r,+A,v,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,v,z,I,ib,S,oa),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,v,z,I,eb,S,oa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),g.close()),g.stroke()):(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.paintSE(g,+r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),g.close(),F.moveSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintSWInner(g,r,A,v,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,v,z,I,ib,S,oa),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,v,z,I,eb,S,oa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),g.close(),+g.fillAndStroke())):"frame"!=ta?(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),"double"==ta&&(F.moveNEInner(g,r,A,v,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea)),g.stroke()):(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.lineNEInner(g,r,A,v,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),g.close(),g.fillAndStroke()):"frame"!=ta?(g.begin(),F.moveNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),"double"==ta&&(F.moveSEInner(g,+r,A,v,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga)),g.stroke()):(g.begin(),F.moveNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.lineSEInner(g,r,A,v,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),g.close(),g.fillAndStroke()):"frame"!=ta?(g.begin(),F.moveSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),"double"==ta&&(F.moveSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja)),g.stroke()):(g.begin(),F.moveSE(g,r,A,v,z,I,ib,+S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.lineSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),g.close(),g.fillAndStroke()):"frame"!=ta?(g.begin(),F.moveSW(g,r,A,v,z,I,eb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),"double"==ta&&(F.moveNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa)),g.stroke()):(g.begin(),F.moveSW(g,r,A,v,z,I,eb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.lineNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,v,z,I,kb,S,+oa,Ja,Pa),g.close(),g.fillAndStroke());g.begin();F.paintFolds(g,r,A,v,z,I,eb,hb,ib,kb,S,Ea,Ga,Ja,Pa);g.stroke()};xb.prototype.moveNW=function(g,r,A,v,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.moveTo(0,0):g.moveTo(0,ea)};xb.prototype.moveNE=function(g,r,A,v,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.moveTo(v,0):g.moveTo(v-ea,0)};xb.prototype.moveSE=function(g,r,A,v,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.moveTo(v,z):g.moveTo(v,z-ea)};xb.prototype.moveSW=+function(g,r,A,v,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.moveTo(0,z):g.moveTo(ea,z)};xb.prototype.paintNW=function(g,r,A,v,z,F,I,ea,S){if(S)if("rounded"==I||"default"==I&&"rounded"==F||"invRound"==I||"default"==I&&"invRound"==F){r=0;if("rounded"==I||"default"==I&&"rounded"==F)r=1;g.arcTo(ea,ea,0,0,r,ea,0)}else("snip"==I||"default"==I&&"snip"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(ea,0);else g.lineTo(0,0)};xb.prototype.paintTop=function(g,r,A,v,z,F,I,ea,S){"square"==I||+"default"==I&&"square"==F||!S?g.lineTo(v,0):g.lineTo(v-ea,0)};xb.prototype.paintNE=function(g,r,A,v,z,F,I,ea,S){if(S)if("rounded"==I||"default"==I&&"rounded"==F||"invRound"==I||"default"==I&&"invRound"==F){r=0;if("rounded"==I||"default"==I&&"rounded"==F)r=1;g.arcTo(ea,ea,0,0,r,v,ea)}else("snip"==I||"default"==I&&"snip"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(v,ea);else g.lineTo(v,0)};xb.prototype.paintRight=function(g,r,A,v,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.lineTo(v,+z):g.lineTo(v,z-ea)};xb.prototype.paintLeft=function(g,r,A,v,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.lineTo(0,0):g.lineTo(0,ea)};xb.prototype.paintSE=function(g,r,A,v,z,F,I,ea,S){if(S)if("rounded"==I||"default"==I&&"rounded"==F||"invRound"==I||"default"==I&&"invRound"==F){r=0;if("rounded"==I||"default"==I&&"rounded"==F)r=1;g.arcTo(ea,ea,0,0,r,v-ea,z)}else("snip"==I||"default"==I&&"snip"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(v-ea,z);else g.lineTo(v,z)};xb.prototype.paintBottom=+function(g,r,A,v,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.lineTo(0,z):g.lineTo(ea,z)};xb.prototype.paintSW=function(g,r,A,v,z,F,I,ea,S){if(S)if("rounded"==I||"default"==I&&"rounded"==F||"invRound"==I||"default"==I&&"invRound"==F){r=0;if("rounded"==I||"default"==I&&"rounded"==F)r=1;g.arcTo(ea,ea,0,0,r,0,z-ea)}else("snip"==I||"default"==I&&"snip"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(0,z-ea);else g.lineTo(0,z)};xb.prototype.paintNWInner=function(g,r,A,v,z,F,I,ea,S){if("rounded"==+I||"default"==I&&"rounded"==F)g.arcTo(ea-.5*S,ea-.5*S,0,0,0,S,.5*S+ea);else if("invRound"==I||"default"==I&&"invRound"==F)g.arcTo(ea+S,ea+S,0,0,1,S,S+ea);else if("snip"==I||"default"==I&&"snip"==F)g.lineTo(S,.5*S+ea);else if("fold"==I||"default"==I&&"fold"==F)g.lineTo(S+ea,S+ea),g.lineTo(S,S+ea)};xb.prototype.paintTopInner=function(g,r,A,v,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(0,S):ta&&!oa?g.lineTo(S,0):ta?"square"==I||"default"==I&&"square"==F?g.lineTo(S,S):"rounded"==I||"default"==I&&"rounded"==+F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(ea+.5*S,S):g.lineTo(ea+S,S):g.lineTo(0,S):g.lineTo(0,0)};xb.prototype.paintNEInner=function(g,r,A,v,z,F,I,ea,S){if("rounded"==I||"default"==I&&"rounded"==F)g.arcTo(ea-.5*S,ea-.5*S,0,0,0,v-ea-.5*S,S);else if("invRound"==I||"default"==I&&"invRound"==F)g.arcTo(ea+S,ea+S,0,0,1,v-ea-S,S);else if("snip"==I||"default"==I&&"snip"==F)g.lineTo(v-ea-.5*S,S);else if("fold"==I||"default"==I&&"fold"==F)g.lineTo(v-ea-S,ea+S),g.lineTo(v-ea-S,S)};xb.prototype.paintRightInner=+function(g,r,A,v,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(v-S,0):ta&&!oa?g.lineTo(v,S):ta?"square"==I||"default"==I&&"square"==F?g.lineTo(v-S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(v-S,ea+.5*S):g.lineTo(v-S,ea+S):g.lineTo(v-S,0):g.lineTo(v,0)};xb.prototype.paintLeftInner=function(g,r,A,v,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(S,z):ta&&!oa?g.lineTo(0,z-S):ta?"square"==I||"default"==I&&"square"==F?g.lineTo(S,z-S):"rounded"==I||"default"==I&&"rounded"==+F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(S,z-ea-.5*S):g.lineTo(S,z-ea-S):g.lineTo(S,z):g.lineTo(0,z)};xb.prototype.paintSEInner=function(g,r,A,v,z,F,I,ea,S){if("rounded"==I||"default"==I&&"rounded"==F)g.arcTo(ea-.5*S,ea-.5*S,0,0,0,v-S,z-ea-.5*S);else if("invRound"==I||"default"==I&&"invRound"==F)g.arcTo(ea+S,ea+S,0,0,1,v-S,z-ea-S);else if("snip"==I||"default"==I&&"snip"==F)g.lineTo(v-S,z-ea-.5*S);else if("fold"==I||"default"==I&&"fold"==F)g.lineTo(v-ea-S,z-ea-S),g.lineTo(v-S,z-ea-S)};xb.prototype.paintBottomInner=+function(g,r,A,v,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(v,z-S):ta&&!oa?g.lineTo(v-S,z):"square"==I||"default"==I&&"square"==F||!ta?g.lineTo(v-S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(v-ea-.5*S,z-S):g.lineTo(v-ea-S,z-S):g.lineTo(v,z)};xb.prototype.paintSWInner=function(g,r,A,v,z,F,I,ea,S,ta){if(!ta)g.lineTo(S,z);else if("square"==I||"default"==I&&"square"==F)g.lineTo(S,z-S);else if("rounded"==I||"default"==I&&"rounded"==F)g.arcTo(ea-.5*S,ea-.5*+S,0,0,0,ea+.5*S,z-S);else if("invRound"==I||"default"==I&&"invRound"==F)g.arcTo(ea+S,ea+S,0,0,1,ea+S,z-S);else if("snip"==I||"default"==I&&"snip"==F)g.lineTo(ea+.5*S,z-S);else if("fold"==I||"default"==I&&"fold"==F)g.lineTo(S+ea,z-ea-S),g.lineTo(S+ea,z-S)};xb.prototype.moveSWInner=function(g,r,A,v,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==F?g.moveTo(S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.moveTo(S,z-ea-.5*S):("invRound"==I||"default"==I&&"invRound"==+F||"fold"==I||"default"==I&&"fold"==F)&&g.moveTo(S,z-ea-S):g.moveTo(0,z-S)};xb.prototype.lineSWInner=function(g,r,A,v,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==F?g.lineTo(S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(S,z-ea-.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(S,z-ea-S):g.lineTo(0,z-S)};xb.prototype.moveSEInner=function(g,r,A,v,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==+F?g.moveTo(v-S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.moveTo(v-S,z-ea-.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.moveTo(v-S,z-ea-S):g.moveTo(v-S,z)};xb.prototype.lineSEInner=function(g,r,A,v,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==F?g.lineTo(v-S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(v-S,z-ea-.5*S):("invRound"==I||"default"==I&&"invRound"==+F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(v-S,z-ea-S):g.lineTo(v-S,z)};xb.prototype.moveNEInner=function(g,r,A,v,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==F||ta?g.moveTo(v-S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.moveTo(v-S,ea+.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.moveTo(v-S,ea+S):g.moveTo(v,S)};xb.prototype.lineNEInner=function(g,r,A,v,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==+F||ta?g.lineTo(v-S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(v-S,ea+.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(v-S,ea+S):g.lineTo(v,S)};xb.prototype.moveNWInner=function(g,r,A,v,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.moveTo(S,0):ta&&!oa?g.moveTo(0,S):"square"==I||"default"==I&&"square"==F?g.moveTo(S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.moveTo(S,ea+.5*S):("invRound"==+I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.moveTo(S,ea+S):g.moveTo(0,0)};xb.prototype.lineNWInner=function(g,r,A,v,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(S,0):ta&&!oa?g.lineTo(0,S):"square"==I||"default"==I&&"square"==F?g.lineTo(S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(S,ea+.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(S,ea+S):g.lineTo(0,0)};xb.prototype.paintFolds=function(g,+r,A,v,z,F,I,ea,S,ta,oa,Ia,mb,$a,Ea){if("fold"==F||"fold"==I||"fold"==ea||"fold"==S||"fold"==ta)("fold"==I||"default"==I&&"fold"==F)&&Ia&&Ea&&(g.moveTo(0,oa),g.lineTo(oa,oa),g.lineTo(oa,0)),("fold"==ea||"default"==ea&&"fold"==F)&&Ia&&mb&&(g.moveTo(v-oa,0),g.lineTo(v-oa,oa),g.lineTo(v,oa)),("fold"==S||"default"==S&&"fold"==F)&&$a&&mb&&(g.moveTo(v-oa,z),g.lineTo(v-oa,z-oa),g.lineTo(v,z-oa)),("fold"==ta||"default"==ta&&"fold"==F)&&$a&&Ea&&(g.moveTo(0,z-oa),g.lineTo(oa,z-oa),g.lineTo(oa,z))};mxCellRenderer.registerShape(xb.prototype.cst.RECT2,+xb);xb.prototype.constraints=null;mxUtils.extend(Mb,mxConnector);Mb.prototype.origPaintEdgeShape=Mb.prototype.paintEdgeShape;Mb.prototype.paintEdgeShape=function(g,r){for(var A=[],v=0;v<r.length;v++)A.push(mxUtils.clone(r[v]));v=g.state.dashed;var z=g.state.fixDash;Mb.prototype.origPaintEdgeShape.apply(this,[g,A]);3<=g.state.strokeWidth&&(A=mxUtils.getValue(this.style,"fillColor",null),null!=A&&(g.setStrokeColor(A),g.setStrokeWidth(g.state.strokeWidth-2),g.setDashed(v,z),Mb.prototype.origPaintEdgeShape.apply(this,+[g,r])))};mxCellRenderer.registerShape("filledEdge",Mb);mxUtils.extend(Pb,mxConnector);Pb.prototype.defaultWidth=4;Pb.prototype.getEdgeWidth=function(){return Math.max(0,mxUtils.getNumber(this.style,"width",this.defaultWidth))};Pb.prototype.getFlowAnimationPath=function(){return mxShape.prototype.getFlowAnimationPath.call(this,2)||mxShape.prototype.getFlowAnimationPath.call(this)};Pb.prototype.origPaintEdgeShape=Pb.prototype.paintEdgeShape;Pb.prototype.paintEdgeShape=function(g,r){for(var A=[],v=+0;v<r.length;v++)A.push(mxUtils.clone(r[v]));v=g.state.dashed;var z=g.state.fixDash,F=this.getEdgeWidth();g.setStrokeWidth(F+2*this.strokewidth);g.setDashed(!1);Pb.prototype.origPaintEdgeShape.apply(this,[g,A]);A=mxUtils.getValue(this.style,"fillColor",null);null!=A&&(g.setStrokeWidth(F),g.setStrokeColor(A),g.setDashed(v,z),Pb.prototype.origPaintEdgeShape.apply(this,[g,r]))};mxCellRenderer.registerShape("pipe",Pb);mxUtils.extend(Tb,mxRectangleShape);Tb.prototype.size=10;Tb.prototype.isRoundable=function(){return!0};+Tb.prototype.paintVertexShape=function(g,r,A,v,z){g.translate(r,A);r=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,null);null!=r&&r!=mxConstants.NONE&&(g.setStrokeColor("none"),g.begin(),g.rect(0,0,v,z),g.fillAndStroke(),g.setStrokeColor(this.stroke));var F=Math.max(5,parseFloat(mxUtils.getValue(this.style,"size",this.size)));r=z/2;A=this.strokewidth;A=this.isRounded?A/2:A;z-=A;F=Math.max(1,Math.round(v/F)-1);var I=v/(F+1),ea=I/2;g.begin();g.moveTo(0,r);if(this.isRounded){g.curveTo(.4*ea,+r-.4*(r-A),.6*ea,A,ea,A);for(var S=0;S<F;S++){var ta=ea+S*I,oa=ta+I,Ia=0==S%2?z:A;g.curveTo(ta+.4*I,0==S%2?A:z,oa-.4*I,Ia,oa,Ia)}z=0==F%2?A:z;g.curveTo(ea+F*I+.4*ea,z,v-.4*ea,r-(z==A?1:-1)*(r-A)*.4,v,r)}else{g.lineTo(ea,A);for(S=0;S<F;S++)oa=ea+(S+1)*I,Ia=0==S%2?z:A,g.lineTo(oa,Ia);g.lineTo(v,r)}g.stroke()};mxCellRenderer.registerShape("zigzag",Tb);"undefined"!==typeof StyleFormatPanel&&function(){var g=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var r=+this.editorUi.getSelectionState(),A=g.apply(this,arguments);"umlFrame"==r.style.shape&&A.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return A}}();mxMarker.addMarker("dash",function(g,r,A,v,z,F,I,ea,S,ta){var oa=z*(I+S+1),Ia=F*(I+S+1);return function(){g.begin();g.moveTo(v.x-oa/2-Ia/2,v.y-Ia/2+oa/2);g.lineTo(v.x+Ia/2-3*oa/2,v.y-3*Ia/2-oa/2);g.stroke()}});mxMarker.addMarker("box",function(g,r,A,v,z,F,I,ea,S,ta){var oa=z*(I+S+1),Ia=F*(I+S+1),mb=v.x+oa/2,+$a=v.y+Ia/2;v.x-=oa;v.y-=Ia;return function(){g.begin();g.moveTo(mb-oa/2-Ia/2,$a-Ia/2+oa/2);g.lineTo(mb-oa/2+Ia/2,$a-Ia/2-oa/2);g.lineTo(mb+Ia/2-3*oa/2,$a-3*Ia/2-oa/2);g.lineTo(mb-Ia/2-3*oa/2,$a-3*Ia/2+oa/2);g.close();ta?g.fillAndStroke():g.stroke()}});mxMarker.addMarker("cross",function(g,r,A,v,z,F,I,ea,S,ta){var oa=z*(I+S+1),Ia=F*(I+S+1);return function(){g.begin();g.moveTo(v.x-oa/2-Ia/2,v.y-Ia/2+oa/2);g.lineTo(v.x+Ia/2-3*oa/2,v.y-3*Ia/2-oa/2);g.moveTo(v.x-oa/2+Ia/2,v.y-Ia/2-oa/2);g.lineTo(v.x-+Ia/2-3*oa/2,v.y-3*Ia/2+oa/2);g.stroke()}});mxMarker.addMarker("circle",Vb);mxMarker.addMarker("circlePlus",function(g,r,A,v,z,F,I,ea,S,ta){var oa=v.clone(),Ia=Vb.apply(this,arguments),mb=z*(I+2*S),$a=F*(I+2*S);return function(){Ia.apply(this,arguments);g.begin();g.moveTo(oa.x-z*S,oa.y-F*S);g.lineTo(oa.x-2*mb+z*S,oa.y-2*$a+F*S);g.moveTo(oa.x-mb-$a+F*S,oa.y-$a+mb-z*S);g.lineTo(oa.x+$a-mb-F*S,oa.y-$a-mb+z*S);g.stroke()}});mxMarker.addMarker("halfCircle",function(g,r,A,v,z,F,I,ea,S,ta){var oa=z*(I+S++1),Ia=F*(I+S+1),mb=v.clone();v.x-=oa;v.y-=Ia;return function(){g.begin();g.moveTo(mb.x-Ia,mb.y+oa);g.quadTo(v.x-Ia,v.y+oa,v.x,v.y);g.quadTo(v.x+Ia,v.y-oa,mb.x+Ia,mb.y-oa);g.stroke()}});mxMarker.addMarker("async",function(g,r,A,v,z,F,I,ea,S,ta){r=z*S*1.118;A=F*S*1.118;z*=I+S;F*=I+S;var oa=v.clone();oa.x-=r;oa.y-=A;v.x+=-z-r;v.y+=-F-A;return function(){g.begin();g.moveTo(oa.x,oa.y);ea?g.lineTo(oa.x-z-F/2,oa.y-F+z/2):g.lineTo(oa.x+F/2-z,oa.y-F-z/2);g.lineTo(oa.x-z,oa.y-F);g.close();ta?g.fillAndStroke():+g.stroke()}});mxMarker.addMarker("openAsync",function(g){g=null!=g?g:2;return function(r,A,v,z,F,I,ea,S,ta,oa){F*=ea+ta;I*=ea+ta;var Ia=z.clone();return function(){r.begin();r.moveTo(Ia.x,Ia.y);S?r.lineTo(Ia.x-F-I/g,Ia.y-I+F/g):r.lineTo(Ia.x+I/g-F,Ia.y-I-F/g);r.stroke()}}}(2));mxUtils.extend(Gb,mxRectangleShape);Gb.prototype.arcStartY=25;Gb.prototype.arcMidY=-25;Gb.prototype.arcEndY=25;Gb.prototype.paintForeground=function(g,r,A,v,z){mxRectangleShape.prototype.paintForeground.apply(this,arguments);if(null!=this.state){var F=this.state.view.graph;if(null==F.cellEditor||F.cellEditor.editingCell!=this.state.cell)if(F=F.convertValueToString(this.state.cell),null!=F&&0!=F.length){var I=parseFloat(mxUtils.getValue(this.style,"arcStartY",this.arcStartY)),ea=parseFloat(mxUtils.getValue(this.style,"arcMidY",this.arcMidY)),S=parseFloat(mxUtils.getValue(this.style,"arcEndY",this.arcEndY)),ta=mxUtils.getValue(this.style,"curveType","round");if(null!=g.root&&"function"===typeof g.getBaseUrl){null!=this._curvedTextGroup&&null!=this._curvedTextGroup.parentNode&&this._curvedTextGroup.parentNode.removeChild(this._curvedTextGroup);this._curvedTextGroup=null;g.translate(r,A);var oa=g.state,Ia=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)),mb=Ia/2,$a=(I+S)/2,Ea=Math.max(Math.abs(Gb.prototype.arcMidY),Math.min($a,z-$a));ea=Math.max(-Ea,Math.min(Ea,ea));var Ga=$a+ea;ea=Math.min(I,S,Ga);Ea=Math.max(I,S,Ga);$a=Ea-ea;var Ja=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,-mxConstants.ALIGN_MIDDLE);this._curveYOffset=$a=Ja==mxConstants.ALIGN_TOP?mb-ea:Ja==mxConstants.ALIGN_BOTTOM?z-mb-Ea:(z-$a)/2-ea;Ja=u-mb;ea=(mb+oa.dx)*oa.scale;I=(I+$a+oa.dy)*oa.scale;Ea=((mb+Ja)/2+oa.dx)*oa.scale;Ga=(Ga+$a+oa.dy)*oa.scale;mb=(Ja+oa.dx)*oa.scale;S=(S+$a+oa.dy)*oa.scale;"round"==ta?(Ja=Math.sqrt((mb-ea)*(mb-ea)+(S-I)*(S-I)),ta=(ea+mb)/2,$a=(I+S)/2,ta=Math.sqrt((Ea-ta)*(Ea-ta)+(Ga-$a)*(Ga-$a)),.5>ta?(ta="M "+g.format(ea)+" "+g.format(I)+" L "+g.format(mb)+" "+g.format(S),ea=Ja):(Ja/=+mxConstants.ALIGN_MIDDLE);this._curveYOffset=$a=Ja==mxConstants.ALIGN_TOP?mb-ea:Ja==mxConstants.ALIGN_BOTTOM?z-mb-Ea:(z-$a)/2-ea;Ja=v-mb;ea=(mb+oa.dx)*oa.scale;I=(I+$a+oa.dy)*oa.scale;Ea=((mb+Ja)/2+oa.dx)*oa.scale;Ga=(Ga+$a+oa.dy)*oa.scale;mb=(Ja+oa.dx)*oa.scale;S=(S+$a+oa.dy)*oa.scale;"round"==ta?(Ja=Math.sqrt((mb-ea)*(mb-ea)+(S-I)*(S-I)),ta=(ea+mb)/2,$a=(I+S)/2,ta=Math.sqrt((Ea-ta)*(Ea-ta)+(Ga-$a)*(Ga-$a)),.5>ta?(ta="M "+g.format(ea)+" "+g.format(I)+" L "+g.format(mb)+" "+g.format(S),ea=Ja):(Ja/=2,$a=Ja*Ja/(2*ta)+ta/2,Ga=0<(mb-ea)*(Ga-I)-(S-I)*(Ea-ea)?0:1,Ea=ta>Ja?1:0,ta="M "+g.format(ea)+" "+g.format(I)+" A "+g.format($a)+" "+g.format($a)+" 0 "+Ea+" "+Ga+" "+g.format(mb)+" "+g.format(S),ea=2*Math.asin(Math.min(1,Ja/$a)),Ea&&(ea=2*Math.PI-ea),ea*=$a)):(ta="M "+g.format(ea)+" "+g.format(I)+" Q "+g.format(Ea)+" "+g.format(Ga)+" "+g.format(mb)+" "+g.format(S),$a=Ea-ea,Ja=Ga-I,Ea=mb-Ea,Ga=S-Ga,ea=mb-ea,I=S-I,ea=(Math.sqrt($a*$a+Ja*Ja)+Math.sqrt(Ea*Ea+Ga*Ga)+Math.sqrt(ea*ea+I*I))/2);S=(g.idPrefix||"")+"ctp-"+mxObjectIdentity.get(this);Ea=(I=!mxClient.IS_CHROMEAPP&&g.root.ownerDocument==document)?g.getBaseUrl().replace(/([\(\)])/g,"\\$1"):"";mb=g.createElement("g");Ga=oa.transform||"";0<Ga.length&&mb.setAttribute("transform",Ga);1>oa.alpha&&mb.setAttribute("opacity",oa.alpha);Ga=g.createElement("defs");$a=g.createElement("path");$a.setAttribute("id",S);$a.setAttribute("d",ta);Ga.appendChild($a);mb.appendChild(Ga);ta=g.createElement("text");$a=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);Ja=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"#000000");Ga=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,0);ta.setAttribute("font-size",Ia*oa.scale+"px");ta.setAttribute("font-family",mxUtils.parseCssFontFamily($a));ta.setAttribute("fill",Ja);(Ga&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&ta.setAttribute("font-weight","bold");(Ga&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&ta.setAttribute("font-style","italic");oa=[];(Ga&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&oa.push("underline");(Ga&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&oa.push("line-through");0<oa.length&&(ta.setAttribute("text-decoration",oa.join(" ")),(Ga&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(ta.style.textDecorationStyle="dotted"));Ia=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER);Ga="middle";oa="50%";Ia==mxConstants.ALIGN_LEFT?(Ga="start",oa="0%"):Ia==mxConstants.ALIGN_RIGHT&&(Ga=-"end",oa="100%");ta.setAttribute("text-anchor",Ga);ta.setAttribute("dominant-baseline","central");Ia=g.createElement("textPath");Ia.setAttribute("startOffset",oa);oa=(I?Ea:"")+"#"+S;Ia.setAttribute("href",oa);I&&Ia.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",oa);Ia.setAttribute("textLength",ea);Ia.setAttribute("lengthAdjust","spacing");mxUtils.write(Ia,F);ta.appendChild(Ia);mb.appendChild(ta);g.root.appendChild(mb);this._curvedTextGroup=mb}else g.text(r+u/2,A+z/2,0,0,F,mxConstants.ALIGN_CENTER,+"end",oa="100%");ta.setAttribute("text-anchor",Ga);ta.setAttribute("dominant-baseline","central");Ia=g.createElement("textPath");Ia.setAttribute("startOffset",oa);oa=(I?Ea:"")+"#"+S;Ia.setAttribute("href",oa);I&&Ia.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",oa);Ia.setAttribute("textLength",ea);Ia.setAttribute("lengthAdjust","spacing");mxUtils.write(Ia,F);ta.appendChild(Ia);mb.appendChild(ta);g.root.appendChild(mb);this._curvedTextGroup=mb}else g.text(r+v/2,A+z/2,0,0,F,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,!1,"",null,!1,0)}}};Gb.prototype.destroy=function(){null!=this._curvedTextGroup&&null!=this._curvedTextGroup.parentNode&&this._curvedTextGroup.parentNode.removeChild(this._curvedTextGroup);this._curvedTextGroup=null;mxRectangleShape.prototype.destroy.apply(this,arguments)};mxCellRenderer.registerShape("curvedText",Gb);mxUtils.extend(Nb,mxActor);Nb.prototype.tabSize=8;Nb.prototype.tabInset=4;Nb.prototype.holeSize=1;Nb.prototype.isRoundable=function(){return!1};Nb.prototype.redrawPath=-function(g,r,A,u,z){r=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize))));var F=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"tabInset",this.tabInset))));A=(z-F)/2;F=A+F;g.moveTo(0,A);g.lineTo(0,F);g.lineTo(r,z);g.lineTo(u,z);g.lineTo(u,0);g.lineTo(r,0);g.close();g.end()};Nb.prototype.paintVertexShape=function(g,r,A,u,z){mxActor.prototype.paintVertexShape.apply(this,arguments);var F=Math.max(0,parseFloat(mxUtils.getValue(this.style,"holeSize",this.holeSize)));+function(g,r,A,v,z){r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize))));var F=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"tabInset",this.tabInset))));A=(z-F)/2;F=A+F;g.moveTo(0,A);g.lineTo(0,F);g.lineTo(r,z);g.lineTo(v,z);g.lineTo(v,0);g.lineTo(r,0);g.close();g.end()};Nb.prototype.paintVertexShape=function(g,r,A,v,z){mxActor.prototype.paintVertexShape.apply(this,arguments);var F=Math.max(0,parseFloat(mxUtils.getValue(this.style,"holeSize",this.holeSize)));if(!(0>=F)){var I=parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize)),ea=mxUtils.getValue(this.style,"holeColor",mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"#333333"));g.setFillColor(ea);g.setStrokeColor(ea);g.begin();g.ellipse(I/2-F,z/2-F,2*F,2*F);g.fillAndStroke()}};Nb.prototype.getLabelBounds=function(g){var r=parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize))*this.scale;return new mxRectangle(g.x+r,g.y,g.width-r,g.height)};mxCellRenderer.registerShape("gitTag",-Nb);mxUtils.extend(Wb,mxShape);Wb.prototype.paintVertexShape=function(g,r,A,u,z){var F=mxUtils.getValue(this.style,"innerColor","#ECECFF");g.translate(r,A);g.ellipse(0,0,u,z);g.fillAndStroke();r=.6*Math.min(u,z);u=(u-r)/2;z=(z-r)/2;g.setFillColor(F);g.setStrokeColor(F);g.ellipse(u,z,r,r);g.fillAndStroke()};mxCellRenderer.registerShape("gitMergeCommit",Wb);mxUtils.extend(Yb,mxShape);Yb.prototype.paintVertexShape=function(g,r,A,u,z){var F=mxUtils.getValue(this.style,"featureColor","#fff");g.translate(r,-A);r=u/2;A=z/2;var I=Math.min(u,z)/20;g.ellipse(0,0,u,z);g.fillAndStroke();g.setFillColor(F);g.setStrokeColor(F);g.setStrokeWidth(0);u=2.75*I;g.ellipse(r-3*I-u,A+2*I-u,2*u,2*u);g.fillAndStroke();g.ellipse(r+3*I-u,A+2*I-u,2*u,2*u);g.fillAndStroke();g.setStrokeWidth(1*I);g.begin();g.moveTo(r+3*I,A+1*I);g.lineTo(r,A-5*I);g.stroke();g.begin();g.moveTo(r-3*I,A+1*I);g.lineTo(r,A-5*I);g.stroke()};mxCellRenderer.registerShape("gitCherryPick",Yb);mxUtils.extend(Ab,mxActor);Ab.prototype.isRoundable=function(){return!1};-Ab.prototype.redrawPath=function(g,r,A,u,z){r=.8*u;z*=.8;A=.15*r;u=.8*A;var F=.1*r,I=.1*z;g.moveTo(F,I);F+=.25*r;I+=.1*-z;g.arcTo(A,A,0,0,0,F,I);F+=.25*r;I+=0;g.arcTo(A,A,0,0,0,F,I);F+=.25*r;I+=0;g.arcTo(A,A,0,0,0,F,I);F+=.25*r;I+=.1*z;g.arcTo(A,A,0,0,0,F,I);F+=.15*r;I+=.33*z;g.arcTo(A,A,0,0,0,F,I);F+=0;I+=.34*z;g.arcTo(u,u,0,0,0,F,I);F+=.15*-r;I+=.33*z;g.arcTo(A,A,0,0,0,F,I);F+=.25*-r;I+=.15*z;g.arcTo(A,A,0,0,0,F,I);F+=.25*-r;I+=0;g.arcTo(A,A,0,0,0,F,I);F+=.25*-r;I+=0;g.arcTo(A,A,0,0,0,F,I);F+=.25*--r;I+=.15*-z;g.arcTo(A,A,0,0,0,F,I);F+=.1*-r;I+=.33*-z;g.arcTo(A,A,0,0,0,F,I);F+=0;I+=.34*-z;g.arcTo(u,u,0,0,0,F,I);g.arcTo(A,A,0,0,0,F+.1*r,I+.33*-z);g.close();g.end()};Ab.prototype.getLabelBounds=function(g){var r=.1*g.width,A=.1*g.height;return new mxRectangle(g.x+r,g.y+A,g.width-2*r,g.height-2*A)};mxCellRenderer.registerShape("mindmapBang",Ab);mxUtils.extend(D,mxActor);D.prototype.isRoundable=function(){return!1};D.prototype.redrawPath=function(g,r,A,u,z){g.moveTo(0,0);g.lineTo(0,z);g.quadTo(2*-u,z/2,0,0);g.close();g.end()};mxCellRenderer.registerShape("ishikawaHead",D);mxUtils.extend(M,mxActor);M.prototype.isRoundable=function(){return!1};M.prototype.redrawPath=function(g,r,A,u,z){r=z/4;g.moveTo(0,0);g.lineTo(r,z/2);g.lineTo(0,z);g.lineTo(u,z);g.lineTo(u,0);g.close();g.end()};M.prototype.getLabelBounds=function(g){var r=g.height/4;return new mxRectangle(g.x+r,g.y,g.width-r,g.height)};mxCellRenderer.registerShape("mermaidOdd",M);mxUtils.extend(N,mxActor);N.prototype.isRoundable=function(){return!1};-N.prototype.paintVertexShape=function(g,r,A,u,z){g.setLineJoin&&g.setLineJoin("round");mxActor.prototype.paintVertexShape.apply(this,arguments)};N.prototype.redrawPath=function(g,r,A,u,z){var F={};mxUtils.getValue(this.style,"dirs","right").split(/[,| ]+/).forEach(function(I){I=I.trim().toLowerCase();"x"===I?(F.right=!0,F.left=!0):"y"===I?(F.up=!0,F.down=!0):I&&(F[I]=!0)});A=parseFloat(mxUtils.getValue(this.style,"nodePadding","8"));r=z/2;A/=2;u=F.right&&F.left&&F.up&&F.down?[[0,0],[r,0],[u/2,2*A],-[u-r,0],[u,0],[u,-z/3],[u+2*A,-z/2],[u,-2*z/3],[u,-z],[u-r,-z],[u/2,-z-2*A],[r,-z],[0,-z],[0,-2*z/3],[-2*A,-z/2],[0,-z/3]]:F.right&&F.left&&F.up?[[r,0],[u-r,0],[u,-z/2],[u-r,-z],[r,-z],[0,-z/2]]:F.right&&F.left&&F.down?[[0,0],[r,-z],[u-r,-z],[u,0]]:F.right&&F.up&&F.down?[[0,0],[u,-r],[u,-z+r],[0,-z]]:F.left&&F.up&&F.down?[[u,0],[0,-r],[0,-z+r],[u,-z]]:F.right&&F.left?[[r,0],[r,-A],[u-r,-A],[u-r,0],[u,-z/2],[u-r,-z],[u-r,-z+A],[r,-z+A],[r,-z],[0,-z/2]]:F.up&&F.down?[[u/2,0],[0,-A],[r,-A],[r,-z+A],-[0,-z+A],[u/2,-z],[u,-z+A],[u-r,-z+A],[u-r,-A],[u,-A]]:F.right&&F.up?[[0,0],[u,-r],[0,-z]]:F.right&&F.down?[[0,0],[u,0],[0,-z]]:F.left&&F.up?[[u,0],[0,-r],[u,-z]]:F.left&&F.down?[[u,0],[0,0],[u,-z]]:F.right?[[r,-A],[u-r,-A],[u-r,0],[u,-z/2],[u-r,-z],[u-r,-z+A],[r,-z+A]]:F.left?[[r,0],[r,-A],[u-r,-A],[u-r,-z+A],[r,-z+A],[r,-z],[0,-z/2]]:F.up?[[r,-A],[r,-z+A],[0,-z+A],[u/2,-z],[u,-z+A],[u-r,-z+A],[u-r,-A]]:F.down?[[u/2,0],[0,-A],[r,-A],[r,-z+A],[u-r,-z+A],[u-r,-A],[u,-A]]:[[0,0],[u,0],[u,-z],[0,-z]];-g.moveTo(u[0][0],z+u[0][1]);for(r=1;r<u.length;r++)g.lineTo(u[r][0],z+u[r][1]);g.close();g.end()};mxCellRenderer.registerShape("mermaidBlockArrow",N);mxUtils.extend(W,mxConnector);W.prototype.defaultWidth=10;W.prototype.getEdgeWidth=function(){return Math.max(1,mxUtils.getNumber(this.style,"width",this.defaultWidth))};W.prototype.getSvgScreenOffset=function(){return 0};W.prototype.augmentBoundingBox=function(g){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var r=(this.getEdgeWidth()/-2+this.strokewidth)*this.scale;g.y-=r;g.height+=2*r};W.prototype.paintEdgeShape=function(g,r){var A=r[0],u=r[r.length-1];if(null!=A&&null!=u){r=A.x;A=A.y;var z=u.x;u=u.y;for(var F=(r+z)/2,I=this.getEdgeWidth()/2,ea=[],S=[],ta=0;32>=ta;ta++){var oa=ta/32,Ia=1-oa,mb=Ia*Ia*Ia*r+3*Ia*Ia*oa*F+3*Ia*oa*oa*F+oa*oa*oa*z,$a=Ia*Ia*Ia*A+3*Ia*Ia*oa*A+3*Ia*oa*oa*u+oa*oa*oa*u,Ea=3*Ia*Ia*(F-r)+3*oa*oa*(z-F);Ia=6*Ia*oa*(u-A);oa=Math.sqrt(Ea*Ea+Ia*Ia);0==oa&&(Ea=1,Ia=0,oa=1);Ia=-Ia/oa*I;Ea=Ea/oa*I;ea.push(new mxPoint(mb++Nb);mxUtils.extend(Wb,mxShape);Wb.prototype.paintVertexShape=function(g,r,A,v,z){var F=mxUtils.getValue(this.style,"innerColor","#ECECFF");g.translate(r,A);g.ellipse(0,0,v,z);g.fillAndStroke();r=.6*Math.min(v,z);v=(v-r)/2;z=(z-r)/2;g.setFillColor(F);g.setStrokeColor(F);g.ellipse(v,z,r,r);g.fillAndStroke()};mxCellRenderer.registerShape("gitMergeCommit",Wb);mxUtils.extend(Yb,mxShape);Yb.prototype.paintVertexShape=function(g,r,A,v,z){var F=mxUtils.getValue(this.style,"featureColor","#fff");g.translate(r,+A);r=v/2;A=z/2;var I=Math.min(v,z)/20;g.ellipse(0,0,v,z);g.fillAndStroke();g.setFillColor(F);g.setStrokeColor(F);g.setStrokeWidth(0);v=2.75*I;g.ellipse(r-3*I-v,A+2*I-v,2*v,2*v);g.fillAndStroke();g.ellipse(r+3*I-v,A+2*I-v,2*v,2*v);g.fillAndStroke();g.setStrokeWidth(1*I);g.begin();g.moveTo(r+3*I,A+1*I);g.lineTo(r,A-5*I);g.stroke();g.begin();g.moveTo(r-3*I,A+1*I);g.lineTo(r,A-5*I);g.stroke()};mxCellRenderer.registerShape("gitCherryPick",Yb);mxUtils.extend(Ab,mxActor);Ab.prototype.isRoundable=function(){return!1};+Ab.prototype.redrawPath=function(g,r,A,v,z){r=.8*v;z*=.8;A=.15*r;v=.8*A;var F=.1*r,I=.1*z;g.moveTo(F,I);F+=.25*r;I+=.1*-z;g.arcTo(A,A,0,0,0,F,I);F+=.25*r;I+=0;g.arcTo(A,A,0,0,0,F,I);F+=.25*r;I+=0;g.arcTo(A,A,0,0,0,F,I);F+=.25*r;I+=.1*z;g.arcTo(A,A,0,0,0,F,I);F+=.15*r;I+=.33*z;g.arcTo(A,A,0,0,0,F,I);F+=0;I+=.34*z;g.arcTo(v,v,0,0,0,F,I);F+=.15*-r;I+=.33*z;g.arcTo(A,A,0,0,0,F,I);F+=.25*-r;I+=.15*z;g.arcTo(A,A,0,0,0,F,I);F+=.25*-r;I+=0;g.arcTo(A,A,0,0,0,F,I);F+=.25*-r;I+=0;g.arcTo(A,A,0,0,0,F,I);F+=.25*+-r;I+=.15*-z;g.arcTo(A,A,0,0,0,F,I);F+=.1*-r;I+=.33*-z;g.arcTo(A,A,0,0,0,F,I);F+=0;I+=.34*-z;g.arcTo(v,v,0,0,0,F,I);g.arcTo(A,A,0,0,0,F+.1*r,I+.33*-z);g.close();g.end()};Ab.prototype.getLabelBounds=function(g){var r=.1*g.width,A=.1*g.height;return new mxRectangle(g.x+r,g.y+A,g.width-2*r,g.height-2*A)};mxCellRenderer.registerShape("mindmapBang",Ab);mxUtils.extend(D,mxActor);D.prototype.isRoundable=function(){return!1};D.prototype.redrawPath=function(g,r,A,v,z){g.moveTo(0,0);g.lineTo(0,z);g.quadTo(2*+v,z/2,0,0);g.close();g.end()};mxCellRenderer.registerShape("ishikawaHead",D);mxUtils.extend(M,mxActor);M.prototype.isRoundable=function(){return!1};M.prototype.redrawPath=function(g,r,A,v,z){r=z/4;g.moveTo(0,0);g.lineTo(r,z/2);g.lineTo(0,z);g.lineTo(v,z);g.lineTo(v,0);g.close();g.end()};M.prototype.getLabelBounds=function(g){var r=g.height/4;return new mxRectangle(g.x+r,g.y,g.width-r,g.height)};mxCellRenderer.registerShape("mermaidOdd",M);mxUtils.extend(N,mxActor);N.prototype.isRoundable=function(){return!1};+N.prototype.paintVertexShape=function(g,r,A,v,z){g.setLineJoin&&g.setLineJoin("round");mxActor.prototype.paintVertexShape.apply(this,arguments)};N.prototype.redrawPath=function(g,r,A,v,z){var F={};mxUtils.getValue(this.style,"dirs","right").split(/[,| ]+/).forEach(function(I){I=I.trim().toLowerCase();"x"===I?(F.right=!0,F.left=!0):"y"===I?(F.up=!0,F.down=!0):I&&(F[I]=!0)});A=parseFloat(mxUtils.getValue(this.style,"nodePadding","8"));r=z/2;A/=2;v=F.right&&F.left&&F.up&&F.down?[[0,0],[r,0],[v/2,2*A],+[v-r,0],[v,0],[v,-z/3],[v+2*A,-z/2],[v,-2*z/3],[v,-z],[v-r,-z],[v/2,-z-2*A],[r,-z],[0,-z],[0,-2*z/3],[-2*A,-z/2],[0,-z/3]]:F.right&&F.left&&F.up?[[r,0],[v-r,0],[v,-z/2],[v-r,-z],[r,-z],[0,-z/2]]:F.right&&F.left&&F.down?[[0,0],[r,-z],[v-r,-z],[v,0]]:F.right&&F.up&&F.down?[[0,0],[v,-r],[v,-z+r],[0,-z]]:F.left&&F.up&&F.down?[[v,0],[0,-r],[0,-z+r],[v,-z]]:F.right&&F.left?[[r,0],[r,-A],[v-r,-A],[v-r,0],[v,-z/2],[v-r,-z],[v-r,-z+A],[r,-z+A],[r,-z],[0,-z/2]]:F.up&&F.down?[[v/2,0],[0,-A],[r,-A],[r,-z+A],+[0,-z+A],[v/2,-z],[v,-z+A],[v-r,-z+A],[v-r,-A],[v,-A]]:F.right&&F.up?[[0,0],[v,-r],[0,-z]]:F.right&&F.down?[[0,0],[v,0],[0,-z]]:F.left&&F.up?[[v,0],[0,-r],[v,-z]]:F.left&&F.down?[[v,0],[0,0],[v,-z]]:F.right?[[r,-A],[v-r,-A],[v-r,0],[v,-z/2],[v-r,-z],[v-r,-z+A],[r,-z+A]]:F.left?[[r,0],[r,-A],[v-r,-A],[v-r,-z+A],[r,-z+A],[r,-z],[0,-z/2]]:F.up?[[r,-A],[r,-z+A],[0,-z+A],[v/2,-z],[v,-z+A],[v-r,-z+A],[v-r,-A]]:F.down?[[v/2,0],[0,-A],[r,-A],[r,-z+A],[v-r,-z+A],[v-r,-A],[v,-A]]:[[0,0],[v,0],[v,-z],[0,-z]];+g.moveTo(v[0][0],z+v[0][1]);for(r=1;r<v.length;r++)g.lineTo(v[r][0],z+v[r][1]);g.close();g.end()};mxCellRenderer.registerShape("mermaidBlockArrow",N);mxUtils.extend(W,mxConnector);W.prototype.defaultWidth=10;W.prototype.getEdgeWidth=function(){return Math.max(1,mxUtils.getNumber(this.style,"width",this.defaultWidth))};W.prototype.getSvgScreenOffset=function(){return 0};W.prototype.augmentBoundingBox=function(g){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var r=(this.getEdgeWidth()/+2+this.strokewidth)*this.scale;g.y-=r;g.height+=2*r};W.prototype.paintEdgeShape=function(g,r){var A=r[0],v=r[r.length-1];if(null!=A&&null!=v){r=A.x;A=A.y;var z=v.x;v=v.y;for(var F=(r+z)/2,I=this.getEdgeWidth()/2,ea=[],S=[],ta=0;32>=ta;ta++){var oa=ta/32,Ia=1-oa,mb=Ia*Ia*Ia*r+3*Ia*Ia*oa*F+3*Ia*oa*oa*F+oa*oa*oa*z,$a=Ia*Ia*Ia*A+3*Ia*Ia*oa*A+3*Ia*oa*oa*v+oa*oa*oa*v,Ea=3*Ia*Ia*(F-r)+3*oa*oa*(z-F);Ia=6*Ia*oa*(v-A);oa=Math.sqrt(Ea*Ea+Ia*Ia);0==oa&&(Ea=1,Ia=0,oa=1);Ia=-Ia/oa*I;Ea=Ea/oa*I;ea.push(new mxPoint(mb+Ia,$a+Ea));S.push(new mxPoint(mb-Ia,$a-Ea))}g.begin();g.moveTo(ea[0].x,ea[0].y);for(ta=1;32>=ta;ta++)g.lineTo(ea[ta].x,ea[ta].y);for(ta=32;0<=ta;ta--)g.lineTo(S[ta].x,S[ta].y);g.close();r=g.node;g.fillAndStroke();null!=r&&null!=r.setAttribute&&null!=r.parentNode&&(g=r.getAttribute("style"),r.setAttribute("style",(null!=g&&""!=g?g+";":"")+"mix-blend-mode:multiply"))}};mxCellRenderer.registerShape("mermaidSankeyLink",W);if("undefined"!==typeof mxVertexHandler){var ob=function(g,r,A){return cb(g,["width"],-r,function(u,z,F,I,ea){ea=g.shape.getEdgeWidth()*g.view.scale+A;return new mxPoint(I.x+z*u/4+F*ea/2,I.y+F*u/4-z*ea/2)},function(u,z,F,I,ea,S){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));g.style.width=Math.round(Math.round(2*u)/g.view.scale-A)})},cb=function(g,r,A,u,z){return vb(g,r,function(F){var I=g.absolutePoints;if(null!=I&&0<I.length){var ea=I.length-1;F=g.view.translate;var S=g.view.scale,ta=A?I[0]:I[ea];I=A?I[1]:I[ea-1];ea=I.x-ta.x;var oa=I.y-ta.y,Ia=Math.sqrt(ea*ea+oa*oa);-ta=u.call(this,Ia,ea/Ia,oa/Ia,ta,I);return new mxPoint(ta.x/S-F.x,ta.y/S-F.y)}return null},function(F,I,ea){var S=g.absolutePoints,ta=S.length-1;F=g.view.translate;var oa=g.view.scale,Ia=A?S[0]:S[ta];S=A?S[1]:S[ta-1];ta=S.x-Ia.x;var mb=S.y-Ia.y,$a=Math.sqrt(ta*ta+mb*mb);I.x=(I.x+F.x)*oa;I.y=(I.y+F.y)*oa;z.call(this,$a,ta/$a,mb/$a,Ia,S,I,ea)})},fb=function(g,r){return function(A){return[cb(A,["startWidth"],!0,function(u,z,F,I,ea){ea=mxUtils.getNumber(A.style,"startWidth",g)*A.view.scale+r;return new mxPoint(I.x+-z*u/4+F*ea/2,I.y+F*u/4-z*ea/2)},function(u,z,F,I,ea,S){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));A.style.startWidth=Math.round(2*u)/A.view.scale-r})]}},Xa=function(g){return function(r){return[vb(r,["arrowWidth","arrowSize"],function(A){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Va.prototype.arrowWidth))),z=Math.max(0,Math.min(g,mxUtils.getValue(this.state.style,"arrowSize",Va.prototype.arrowSize)));return new mxPoint(A.x+(1-z)*A.width,A.y+(1-u)*A.height/-2)},function(A,u){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(A.y+A.height/2-u.y)/A.height*2));this.state.style.arrowSize=Math.max(0,Math.min(g,(A.x+A.width-u.x)/A.width))})]}},wb=function(g){return function(r){return[vb(r,["size"],function(A){var u=Math.max(0,Math.min(.5*A.height,parseFloat(mxUtils.getValue(this.state.style,"size",g))));return new mxPoint(A.x,A.y+u)},function(A,u){this.state.style.size=Math.max(0,u.y-A.y)},!0)]}},sb=function(g,r,A){return function(u){var z=[vb(u,["size"],-function(F){var I=Math.max(0,Math.min(F.width,Math.min(F.height,parseFloat(mxUtils.getValue(this.state.style,"size",r)))))*g;return new mxPoint(F.x+I,F.y+I)},function(F,I){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(F.width,I.x-F.x),Math.min(F.height,I.y-F.y)))/g)},!1)];A&&mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&z.push(Jb(u));return z}},qb=function(g,r,A,u,z){A=null!=A?A:.5;return function(F){var I=[vb(F,["size"],function(ea){var S=null!=z?"0"!=mxUtils.getValue(this.state.style,-"fixedSize","0"):null,ta=parseFloat(mxUtils.getValue(this.state.style,"size",S?z:g));return new mxPoint(ea.x+Math.max(0,Math.min(.5*ea.width,ta*(S?1:ea.width))),ea.getCenterY())},function(ea,S,ta){ea=null!=z&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?S.x-ea.x:Math.max(0,Math.min(A,(S.x-ea.x)/ea.width));this.state.style.size=ea},!1,u)];r&&mxUtils.getValue(F.style,mxConstants.STYLE_ROUNDED,!1)&&I.push(Jb(F));return I}},zb=function(g,r,A){g=null!=g?g:.5;return function(u){var z=[vb(u,["size"],-function(F){var I=null!=A?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,ea=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",I?A:r)));return new mxPoint(F.x+Math.min(.75*F.width*g,ea*(I?.75:.75*F.width)),F.y+F.height/4)},function(F,I){F=null!=A&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?I.x-F.x:Math.max(0,Math.min(g,(I.x-F.x)/F.width*.75));this.state.style.size=F},!1,!0)];mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&z.push(Jb(u));return z}},Fb=-function(){return function(g){var r=[];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r}},Jb=function(g,r){return vb(g,[mxConstants.STYLE_ARCSIZE],function(A){var u=null!=r?r:A.height/8;if("1"==mxUtils.getValue(g.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var z=mxUtils.getValue(g.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(A.x+A.width-Math.min(A.width/2,z),A.y+u)}z=Math.max(0,parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_ARCSIZE,-100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(A.x+A.width-Math.min(Math.max(A.width/2,A.height/2),Math.min(A.width,A.height)*z),A.y+u)},function(A,u,z){"1"==mxUtils.getValue(g.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(A.width,2*(A.x+A.width-u.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(A.width-u.x+A.x)/Math.min(A.width,A.height))))})},vb=function(g,r,A,u,-z,F,I){var ea=new mxHandle(g,null,mxVertexHandler.prototype.secondaryHandleImage);ea.execute=function(ta){for(var oa=0;oa<r.length;oa++)this.copyStyle(r[oa]);I&&I(ta)};ea.getPosition=A;ea.setPosition=u;ea.ignoreGrid=null!=z?z:!0;if(F){var S=ea.positionChanged;ea.positionChanged=function(){S.apply(this,arguments);g.view.invalidate(this.state.cell);g.view.validate()}}return ea},Eb={link:function(g){return[ob(g,!0,10),ob(g,!1,10)]},pipe:function(g){return[ob(g,!0,10),ob(g,!1,10)]},flexArrow:function(g){var r=-g.view.graph.gridSize/g.view.scale,A=[];mxUtils.getValue(g.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(A.push(cb(g,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(u,z,F,I,ea){u=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;ea=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+z*(ea+g.shape.strokewidth*g.view.scale)+F*u/2,I.y+F*(ea+g.shape.strokewidth*g.view.scale)--z*u/2)},function(u,z,F,I,ea,S,ta){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));z=mxUtils.ptLineDist(I.x,I.y,I.x+F,I.y-z,S.x,S.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((z-g.shape.strokewidth)/3/g.view.scale);g.style.width=Math.round(2*u/g.view.scale);if(mxEvent.isShiftDown(ta.getEvent())||mxEvent.isControlDown(ta.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE];mxEvent.isAltDown(ta.getEvent())||Math.abs(parseFloat(g.style[mxConstants.STYLE_STARTSIZE])--parseFloat(g.style[mxConstants.STYLE_ENDSIZE]))<r/6&&(g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE])})),A.push(cb(g,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(u,z,F,I,ea){u=(g.shape.getStartArrowWidth()-g.shape.strokewidth)*g.view.scale;ea=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+z*(ea+g.shape.strokewidth*g.view.scale)+F*u/2,I.y+F*(ea+g.shape.strokewidth*-g.view.scale)-z*u/2)},function(u,z,F,I,ea,S,ta){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));z=mxUtils.ptLineDist(I.x,I.y,I.x+F,I.y-z,S.x,S.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((z-g.shape.strokewidth)/3/g.view.scale);g.style.startWidth=Math.round(Math.max(0,Math.round(2*u)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(ta.getEvent())||mxEvent.isControlDown(ta.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE],g.style.endWidth=+r,function(v,z,F,I,ea){ea=g.shape.getEdgeWidth()*g.view.scale+A;return new mxPoint(I.x+z*v/4+F*ea/2,I.y+F*v/4-z*ea/2)},function(v,z,F,I,ea,S){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));g.style.width=Math.round(Math.round(2*v)/g.view.scale-A)})},cb=function(g,r,A,v,z){return vb(g,r,function(F){var I=g.absolutePoints;if(null!=I&&0<I.length){var ea=I.length-1;F=g.view.translate;var S=g.view.scale,ta=A?I[0]:I[ea];I=A?I[1]:I[ea-1];ea=I.x-ta.x;var oa=I.y-ta.y,Ia=Math.sqrt(ea*ea+oa*oa);+ta=v.call(this,Ia,ea/Ia,oa/Ia,ta,I);return new mxPoint(ta.x/S-F.x,ta.y/S-F.y)}return null},function(F,I,ea){var S=g.absolutePoints,ta=S.length-1;F=g.view.translate;var oa=g.view.scale,Ia=A?S[0]:S[ta];S=A?S[1]:S[ta-1];ta=S.x-Ia.x;var mb=S.y-Ia.y,$a=Math.sqrt(ta*ta+mb*mb);I.x=(I.x+F.x)*oa;I.y=(I.y+F.y)*oa;z.call(this,$a,ta/$a,mb/$a,Ia,S,I,ea)})},fb=function(g,r){return function(A){return[cb(A,["startWidth"],!0,function(v,z,F,I,ea){ea=mxUtils.getNumber(A.style,"startWidth",g)*A.view.scale+r;return new mxPoint(I.x++z*v/4+F*ea/2,I.y+F*v/4-z*ea/2)},function(v,z,F,I,ea,S){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));A.style.startWidth=Math.round(2*v)/A.view.scale-r})]}},Xa=function(g){return function(r){return[vb(r,["arrowWidth","arrowSize"],function(A){var v=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Va.prototype.arrowWidth))),z=Math.max(0,Math.min(g,mxUtils.getValue(this.state.style,"arrowSize",Va.prototype.arrowSize)));return new mxPoint(A.x+(1-z)*A.width,A.y+(1-v)*A.height/+2)},function(A,v){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(A.y+A.height/2-v.y)/A.height*2));this.state.style.arrowSize=Math.max(0,Math.min(g,(A.x+A.width-v.x)/A.width))})]}},wb=function(g){return function(r){return[vb(r,["size"],function(A){var v=Math.max(0,Math.min(.5*A.height,parseFloat(mxUtils.getValue(this.state.style,"size",g))));return new mxPoint(A.x,A.y+v)},function(A,v){this.state.style.size=Math.max(0,v.y-A.y)},!0)]}},sb=function(g,r,A){return function(v){var z=[vb(v,["size"],+function(F){var I=Math.max(0,Math.min(F.width,Math.min(F.height,parseFloat(mxUtils.getValue(this.state.style,"size",r)))))*g;return new mxPoint(F.x+I,F.y+I)},function(F,I){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(F.width,I.x-F.x),Math.min(F.height,I.y-F.y)))/g)},!1)];A&&mxUtils.getValue(v.style,mxConstants.STYLE_ROUNDED,!1)&&z.push(Jb(v));return z}},qb=function(g,r,A,v,z){A=null!=A?A:.5;return function(F){var I=[vb(F,["size"],function(ea){var S=null!=z?"0"!=mxUtils.getValue(this.state.style,+"fixedSize","0"):null,ta=parseFloat(mxUtils.getValue(this.state.style,"size",S?z:g));return new mxPoint(ea.x+Math.max(0,Math.min(.5*ea.width,ta*(S?1:ea.width))),ea.getCenterY())},function(ea,S,ta){ea=null!=z&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?S.x-ea.x:Math.max(0,Math.min(A,(S.x-ea.x)/ea.width));this.state.style.size=ea},!1,v)];r&&mxUtils.getValue(F.style,mxConstants.STYLE_ROUNDED,!1)&&I.push(Jb(F));return I}},zb=function(g,r,A){g=null!=g?g:.5;return function(v){var z=[vb(v,["size"],+function(F){var I=null!=A?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,ea=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",I?A:r)));return new mxPoint(F.x+Math.min(.75*F.width*g,ea*(I?.75:.75*F.width)),F.y+F.height/4)},function(F,I){F=null!=A&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?I.x-F.x:Math.max(0,Math.min(g,(I.x-F.x)/F.width*.75));this.state.style.size=F},!1,!0)];mxUtils.getValue(v.style,mxConstants.STYLE_ROUNDED,!1)&&z.push(Jb(v));return z}},Fb=+function(){return function(g){var r=[];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r}},Jb=function(g,r){return vb(g,[mxConstants.STYLE_ARCSIZE],function(A){var v=null!=r?r:A.height/8;if("1"==mxUtils.getValue(g.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var z=mxUtils.getValue(g.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(A.x+A.width-Math.min(A.width/2,z),A.y+v)}z=Math.max(0,parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_ARCSIZE,+100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(A.x+A.width-Math.min(Math.max(A.width/2,A.height/2),Math.min(A.width,A.height)*z),A.y+v)},function(A,v,z){"1"==mxUtils.getValue(g.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(A.width,2*(A.x+A.width-v.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(A.width-v.x+A.x)/Math.min(A.width,A.height))))})},vb=function(g,r,A,v,+z,F,I){var ea=new mxHandle(g,null,mxVertexHandler.prototype.secondaryHandleImage);ea.execute=function(ta){for(var oa=0;oa<r.length;oa++)this.copyStyle(r[oa]);I&&I(ta)};ea.getPosition=A;ea.setPosition=v;ea.ignoreGrid=null!=z?z:!0;if(F){var S=ea.positionChanged;ea.positionChanged=function(){S.apply(this,arguments);g.view.invalidate(this.state.cell);g.view.validate()}}return ea},Eb={link:function(g){return[ob(g,!0,10),ob(g,!1,10)]},pipe:function(g){return[ob(g,!0,10),ob(g,!1,10)]},flexArrow:function(g){var r=+g.view.graph.gridSize/g.view.scale,A=[];mxUtils.getValue(g.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(A.push(cb(g,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(v,z,F,I,ea){v=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;ea=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+z*(ea+g.shape.strokewidth*g.view.scale)+F*v/2,I.y+F*(ea+g.shape.strokewidth*g.view.scale)-+z*v/2)},function(v,z,F,I,ea,S,ta){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));z=mxUtils.ptLineDist(I.x,I.y,I.x+F,I.y-z,S.x,S.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((z-g.shape.strokewidth)/3/g.view.scale);g.style.width=Math.round(2*v/g.view.scale);if(mxEvent.isShiftDown(ta.getEvent())||mxEvent.isControlDown(ta.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE];mxEvent.isAltDown(ta.getEvent())||Math.abs(parseFloat(g.style[mxConstants.STYLE_STARTSIZE])-+parseFloat(g.style[mxConstants.STYLE_ENDSIZE]))<r/6&&(g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE])})),A.push(cb(g,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(v,z,F,I,ea){v=(g.shape.getStartArrowWidth()-g.shape.strokewidth)*g.view.scale;ea=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+z*(ea+g.shape.strokewidth*g.view.scale)+F*v/2,I.y+F*(ea+g.shape.strokewidth*+g.view.scale)-z*v/2)},function(v,z,F,I,ea,S,ta){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));z=mxUtils.ptLineDist(I.x,I.y,I.x+F,I.y-z,S.x,S.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((z-g.shape.strokewidth)/3/g.view.scale);g.style.startWidth=Math.round(Math.max(0,Math.round(2*v)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(ta.getEvent())||mxEvent.isControlDown(ta.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE],g.style.endWidth=g.style.startWidth;mxEvent.isAltDown(ta.getEvent())||(Math.abs(parseFloat(g.style[mxConstants.STYLE_STARTSIZE])-parseFloat(g.style[mxConstants.STYLE_ENDSIZE]))<r/6&&(g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(g.style.startWidth)-parseFloat(g.style.endWidth))<r&&(g.style.startWidth=g.style.endWidth))})));mxUtils.getValue(g.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(A.push(cb(g,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],-!1,function(u,z,F,I,ea){u=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;ea=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+z*(ea+g.shape.strokewidth*g.view.scale)-F*u/2,I.y+F*(ea+g.shape.strokewidth*g.view.scale)+z*u/2)},function(u,z,F,I,ea,S,ta){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));z=mxUtils.ptLineDist(I.x,I.y,I.x+F,I.y-z,S.x,S.y);g.style[mxConstants.STYLE_ENDSIZE]=Math.round((z-g.shape.strokewidth)/-3/g.view.scale);g.style.width=Math.round(2*u/g.view.scale);if(mxEvent.isShiftDown(ta.getEvent())||mxEvent.isControlDown(ta.getEvent()))g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(ta.getEvent())||Math.abs(parseFloat(g.style[mxConstants.STYLE_ENDSIZE])-parseFloat(g.style[mxConstants.STYLE_STARTSIZE]))<r/6&&(g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE])})),A.push(cb(g,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],-!1,function(u,z,F,I,ea){u=(g.shape.getEndArrowWidth()-g.shape.strokewidth)*g.view.scale;ea=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+z*(ea+g.shape.strokewidth*g.view.scale)-F*u/2,I.y+F*(ea+g.shape.strokewidth*g.view.scale)+z*u/2)},function(u,z,F,I,ea,S,ta){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));z=mxUtils.ptLineDist(I.x,I.y,I.x+F,I.y-z,S.x,S.y);g.style[mxConstants.STYLE_ENDSIZE]=Math.round((z-g.shape.strokewidth)/-3/g.view.scale);g.style.endWidth=Math.round(Math.max(0,Math.round(2*u)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(ta.getEvent())||mxEvent.isControlDown(ta.getEvent()))g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE],g.style.startWidth=g.style.endWidth;mxEvent.isAltDown(ta.getEvent())||(Math.abs(parseFloat(g.style[mxConstants.STYLE_ENDSIZE])-parseFloat(g.style[mxConstants.STYLE_STARTSIZE]))<r/6&&(g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE]),-Math.abs(parseFloat(g.style.endWidth)-parseFloat(g.style.startWidth))<r&&(g.style.endWidth=g.style.startWidth))})));return A},swimlane:function(g){var r=[];if(mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED)){var A=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));r.push(Jb(g,A/2))}r.push(vb(g,[mxConstants.STYLE_STARTSIZE],function(u){var z=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(g.style,-mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(u.getCenterX(),u.y+Math.max(0,Math.min(u.height,z))):new mxPoint(u.x+Math.max(0,Math.min(u.width,z)),u.getCenterY())},function(u,z){g.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(u.height,z.y-u.y))):Math.round(Math.max(0,Math.min(u.width,z.x-u.x)))},!1,null,function(u){var z=g.view.graph;if(!mxEvent.isShiftDown(u.getEvent())&&!mxEvent.isControlDown(u.getEvent())&&(z.isTableRow(g.cell)||-z.isTableCell(g.cell))){u=z.getSwimlaneDirection(g.style);var F=z.model.getParent(g.cell);F=z.model.getChildCells(F,!0);for(var I=[],ea=0;ea<F.length;ea++)F[ea]!=g.cell&&z.isSwimlane(F[ea])&&z.getSwimlaneDirection(z.getCurrentCellStyle(F[ea]))==u&&I.push(F[ea]);z.setCellStyles(mxConstants.STYLE_STARTSIZE,g.style[mxConstants.STYLE_STARTSIZE],I)}}));return r},label:Fb(),ext:Fb(),rectangle:Fb(),triangle:Fb(),rhombus:Fb(),umlLifeline:function(g){return[vb(g,["size"],function(r){var A=Math.max(0,Math.min(r.height,-parseFloat(mxUtils.getValue(this.state.style,"size",za.prototype.size))));return new mxPoint(r.getCenterX(),r.y+A)},function(r,A){this.state.style.size=Math.round(Math.max(0,Math.min(r.height,A.y-r.y)))},!1)]},umlFrame:function(g){return[vb(g,["width","height"],function(r){var A=Math.max(sa.prototype.corner,Math.min(r.width,mxUtils.getValue(this.state.style,"width",sa.prototype.width))),u=Math.max(1.5*sa.prototype.corner,Math.min(r.height,mxUtils.getValue(this.state.style,"height",sa.prototype.height)));-return new mxPoint(r.x+A,r.y+u)},function(r,A){this.state.style.width=Math.round(Math.max(sa.prototype.corner,Math.min(r.width,A.x-r.x)));this.state.style.height=Math.round(Math.max(1.5*sa.prototype.corner,Math.min(r.height,A.y-r.y)))},!1)]},process:function(g){var r=[vb(g,["size"],function(A){var u="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),z=parseFloat(mxUtils.getValue(this.state.style,"size",ba.prototype.size));return u?new mxPoint(A.x+z,A.y+A.height/4):new mxPoint(A.x+A.width*z,A.y+-A.height/4)},function(A,u){A="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(.5*A.width,u.x-A.x)):Math.max(0,Math.min(.5,(u.x-A.x)/A.width));this.state.style.size=A},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r},cross:function(g){return[vb(g,["size"],function(r){var A=Math.min(r.width,r.height);A=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",Ub.prototype.size)))*A/2;return new mxPoint(r.getCenterX()-A,r.getCenterY()--A)},function(r,A){var u=Math.min(r.width,r.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,r.getCenterY()-A.y)/u*2,Math.max(0,r.getCenterX()-A.x)/u*2)))})]},note:function(g){return[vb(g,["size"],function(r){var A=Math.max(0,Math.min(r.width,Math.min(r.height,parseFloat(mxUtils.getValue(this.state.style,"size",G.prototype.size)))));return new mxPoint(r.x+r.width-A,r.y+A)},function(r,A){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(r.width,r.x+r.width-A.x),Math.min(r.height,-A.y-r.y))))})]},note2:function(g){return[vb(g,["size"],function(r){var A=Math.max(0,Math.min(r.width,Math.min(r.height,parseFloat(mxUtils.getValue(this.state.style,"size",O.prototype.size)))));return new mxPoint(r.x+r.width-A,r.y+A)},function(r,A){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(r.width,r.x+r.width-A.x),Math.min(r.height,A.y-r.y))))})]},manualInput:function(g){var r=[vb(g,["size"],function(A){var u=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"size",-Ba.prototype.size)));return new mxPoint(A.x+A.width/4,A.y+3*u/4)},function(A,u){this.state.style.size=Math.round(Math.max(0,Math.min(A.height,4*(u.y-A.y)/3)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r},dataStorage:function(g){return[vb(g,["size"],function(r){var A="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),u=parseFloat(mxUtils.getValue(this.state.style,"size",A?bb.prototype.fixedSize:bb.prototype.size));return new mxPoint(r.x+r.width-u*(A?1:-r.width),r.getCenterY())},function(r,A){r="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(r.width,r.x+r.width-A.x)):Math.max(0,Math.min(1,(r.x+r.width-A.x)/r.width));this.state.style.size=r},!1)]},callout:function(g){var r=[vb(g,["size","position"],function(A){var u=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"size",qa.prototype.size))),z=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",qa.prototype.position)));mxUtils.getValue(this.state.style,-"base",qa.prototype.base);return new mxPoint(A.x+z*A.width,A.y+A.height-u)},function(A,u){mxUtils.getValue(this.state.style,"base",qa.prototype.base);this.state.style.size=Math.round(Math.max(0,Math.min(A.height,A.y+A.height-u.y)));this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(u.x-A.x)/A.width)))/100},!1),vb(g,["position2"],function(A){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",qa.prototype.position2)));return new mxPoint(A.x+u*A.width,A.y+A.height)},-function(A,u){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,(u.x-A.x)/A.width)))/100},!1),vb(g,["base"],function(A){var u=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"size",qa.prototype.size))),z=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",qa.prototype.position))),F=Math.max(0,Math.min(A.width,mxUtils.getValue(this.state.style,"base",qa.prototype.base)));return new mxPoint(A.x+Math.min(A.width,z*A.width+F),A.y+A.height-u)},function(A,u){var z=-Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",qa.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(A.width,u.x-A.x-z*A.width)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r},internalStorage:function(g){var r=[vb(g,["dx","dy"],function(A){var u=Math.max(0,Math.min(A.width,mxUtils.getValue(this.state.style,"dx",Ka.prototype.dx))),z=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"dy",Ka.prototype.dy)));-return new mxPoint(A.x+u,A.y+z)},function(A,u){this.state.style.dx=Math.round(Math.max(0,Math.min(A.width,u.x-A.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(A.height,u.y-A.y)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r},module:function(g){return[vb(g,["jettyWidth","jettyHeight"],function(r){var A=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"jettyWidth",Na.prototype.jettyWidth))),u=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,-"jettyHeight",Na.prototype.jettyHeight)));return new mxPoint(r.x+A/2,r.y+2*u)},function(r,A){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(r.width,A.x-r.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(r.height,A.y-r.y))/2)})]},corner:function(g){return[vb(g,["dx","dy"],function(r){var A=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",ab.prototype.dx))),u=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",ab.prototype.dy)));return new mxPoint(r.x+-A,r.y+u)},function(r,A){this.state.style.dx=Math.round(Math.max(0,Math.min(r.width,A.x-r.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(r.height,A.y-r.y)))},!1)]},tee:function(g){return[vb(g,["dx","dy"],function(r){var A=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",db.prototype.dx))),u=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",db.prototype.dy)));return new mxPoint(r.x+(r.width+A)/2,r.y+u)},function(r,A){this.state.style.dx=Math.round(Math.max(0,-2*Math.min(r.width/2,A.x-r.x-r.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(r.height,A.y-r.y)))},!1)]},singleArrow:Xa(1),doubleArrow:Xa(.5),"mxgraph.arrows2.wedgeArrow":fb(20,20),"mxgraph.arrows2.wedgeArrowDashed":fb(20,20),"mxgraph.arrows2.wedgeArrowDashed2":fb(20,20),folder:function(g){return[vb(g,["tabWidth","tabHeight"],function(r){var A=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"tabWidth",q.prototype.tabWidth))),u=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,-"tabHeight",q.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(A=r.width-A);return new mxPoint(r.x+A,r.y+u)},function(r,A){var u=Math.max(0,Math.min(r.width,A.x-r.x));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(u=r.width-u);this.state.style.tabWidth=Math.round(u);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(r.height,A.y-r.y)))},!1)]},document:function(g){return[vb(g,+!1,function(v,z,F,I,ea){v=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;ea=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+z*(ea+g.shape.strokewidth*g.view.scale)-F*v/2,I.y+F*(ea+g.shape.strokewidth*g.view.scale)+z*v/2)},function(v,z,F,I,ea,S,ta){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));z=mxUtils.ptLineDist(I.x,I.y,I.x+F,I.y-z,S.x,S.y);g.style[mxConstants.STYLE_ENDSIZE]=Math.round((z-g.shape.strokewidth)/+3/g.view.scale);g.style.width=Math.round(2*v/g.view.scale);if(mxEvent.isShiftDown(ta.getEvent())||mxEvent.isControlDown(ta.getEvent()))g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(ta.getEvent())||Math.abs(parseFloat(g.style[mxConstants.STYLE_ENDSIZE])-parseFloat(g.style[mxConstants.STYLE_STARTSIZE]))<r/6&&(g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE])})),A.push(cb(g,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],+!1,function(v,z,F,I,ea){v=(g.shape.getEndArrowWidth()-g.shape.strokewidth)*g.view.scale;ea=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+z*(ea+g.shape.strokewidth*g.view.scale)-F*v/2,I.y+F*(ea+g.shape.strokewidth*g.view.scale)+z*v/2)},function(v,z,F,I,ea,S,ta){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));z=mxUtils.ptLineDist(I.x,I.y,I.x+F,I.y-z,S.x,S.y);g.style[mxConstants.STYLE_ENDSIZE]=Math.round((z-g.shape.strokewidth)/+3/g.view.scale);g.style.endWidth=Math.round(Math.max(0,Math.round(2*v)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(ta.getEvent())||mxEvent.isControlDown(ta.getEvent()))g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE],g.style.startWidth=g.style.endWidth;mxEvent.isAltDown(ta.getEvent())||(Math.abs(parseFloat(g.style[mxConstants.STYLE_ENDSIZE])-parseFloat(g.style[mxConstants.STYLE_STARTSIZE]))<r/6&&(g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE]),+Math.abs(parseFloat(g.style.endWidth)-parseFloat(g.style.startWidth))<r&&(g.style.endWidth=g.style.startWidth))})));return A},swimlane:function(g){var r=[];if(mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED)){var A=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));r.push(Jb(g,A/2))}r.push(vb(g,[mxConstants.STYLE_STARTSIZE],function(v){var z=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(g.style,+mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(v.getCenterX(),v.y+Math.max(0,Math.min(v.height,z))):new mxPoint(v.x+Math.max(0,Math.min(v.width,z)),v.getCenterY())},function(v,z){g.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(v.height,z.y-v.y))):Math.round(Math.max(0,Math.min(v.width,z.x-v.x)))},!1,null,function(v){var z=g.view.graph;if(!mxEvent.isShiftDown(v.getEvent())&&!mxEvent.isControlDown(v.getEvent())&&(z.isTableRow(g.cell)||+z.isTableCell(g.cell))){v=z.getSwimlaneDirection(g.style);var F=z.model.getParent(g.cell);F=z.model.getChildCells(F,!0);for(var I=[],ea=0;ea<F.length;ea++)F[ea]!=g.cell&&z.isSwimlane(F[ea])&&z.getSwimlaneDirection(z.getCurrentCellStyle(F[ea]))==v&&I.push(F[ea]);z.setCellStyles(mxConstants.STYLE_STARTSIZE,g.style[mxConstants.STYLE_STARTSIZE],I)}}));return r},label:Fb(),ext:Fb(),rectangle:Fb(),triangle:Fb(),rhombus:Fb(),umlLifeline:function(g){return[vb(g,["size"],function(r){var A=Math.max(0,Math.min(r.height,+parseFloat(mxUtils.getValue(this.state.style,"size",za.prototype.size))));return new mxPoint(r.getCenterX(),r.y+A)},function(r,A){this.state.style.size=Math.round(Math.max(0,Math.min(r.height,A.y-r.y)))},!1)]},umlFrame:function(g){return[vb(g,["width","height"],function(r){var A=Math.max(sa.prototype.corner,Math.min(r.width,mxUtils.getValue(this.state.style,"width",sa.prototype.width))),v=Math.max(1.5*sa.prototype.corner,Math.min(r.height,mxUtils.getValue(this.state.style,"height",sa.prototype.height)));+return new mxPoint(r.x+A,r.y+v)},function(r,A){this.state.style.width=Math.round(Math.max(sa.prototype.corner,Math.min(r.width,A.x-r.x)));this.state.style.height=Math.round(Math.max(1.5*sa.prototype.corner,Math.min(r.height,A.y-r.y)))},!1)]},process:function(g){var r=[vb(g,["size"],function(A){var v="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),z=parseFloat(mxUtils.getValue(this.state.style,"size",ba.prototype.size));return v?new mxPoint(A.x+z,A.y+A.height/4):new mxPoint(A.x+A.width*z,A.y++A.height/4)},function(A,v){A="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(.5*A.width,v.x-A.x)):Math.max(0,Math.min(.5,(v.x-A.x)/A.width));this.state.style.size=A},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r},cross:function(g){return[vb(g,["size"],function(r){var A=Math.min(r.width,r.height);A=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",Ub.prototype.size)))*A/2;return new mxPoint(r.getCenterX()-A,r.getCenterY()-+A)},function(r,A){var v=Math.min(r.width,r.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,r.getCenterY()-A.y)/v*2,Math.max(0,r.getCenterX()-A.x)/v*2)))})]},note:function(g){return[vb(g,["size"],function(r){var A=Math.max(0,Math.min(r.width,Math.min(r.height,parseFloat(mxUtils.getValue(this.state.style,"size",G.prototype.size)))));return new mxPoint(r.x+r.width-A,r.y+A)},function(r,A){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(r.width,r.x+r.width-A.x),Math.min(r.height,+A.y-r.y))))})]},note2:function(g){return[vb(g,["size"],function(r){var A=Math.max(0,Math.min(r.width,Math.min(r.height,parseFloat(mxUtils.getValue(this.state.style,"size",O.prototype.size)))));return new mxPoint(r.x+r.width-A,r.y+A)},function(r,A){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(r.width,r.x+r.width-A.x),Math.min(r.height,A.y-r.y))))})]},manualInput:function(g){var r=[vb(g,["size"],function(A){var v=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"size",+Ba.prototype.size)));return new mxPoint(A.x+A.width/4,A.y+3*v/4)},function(A,v){this.state.style.size=Math.round(Math.max(0,Math.min(A.height,4*(v.y-A.y)/3)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r},dataStorage:function(g){return[vb(g,["size"],function(r){var A="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),v=parseFloat(mxUtils.getValue(this.state.style,"size",A?bb.prototype.fixedSize:bb.prototype.size));return new mxPoint(r.x+r.width-v*(A?1:+r.width),r.getCenterY())},function(r,A){r="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(r.width,r.x+r.width-A.x)):Math.max(0,Math.min(1,(r.x+r.width-A.x)/r.width));this.state.style.size=r},!1)]},callout:function(g){var r=[vb(g,["size","position"],function(A){var v=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"size",qa.prototype.size))),z=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",qa.prototype.position)));mxUtils.getValue(this.state.style,+"base",qa.prototype.base);return new mxPoint(A.x+z*A.width,A.y+A.height-v)},function(A,v){mxUtils.getValue(this.state.style,"base",qa.prototype.base);this.state.style.size=Math.round(Math.max(0,Math.min(A.height,A.y+A.height-v.y)));this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(v.x-A.x)/A.width)))/100},!1),vb(g,["position2"],function(A){var v=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",qa.prototype.position2)));return new mxPoint(A.x+v*A.width,A.y+A.height)},+function(A,v){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,(v.x-A.x)/A.width)))/100},!1),vb(g,["base"],function(A){var v=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"size",qa.prototype.size))),z=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",qa.prototype.position))),F=Math.max(0,Math.min(A.width,mxUtils.getValue(this.state.style,"base",qa.prototype.base)));return new mxPoint(A.x+Math.min(A.width,z*A.width+F),A.y+A.height-v)},function(A,v){var z=+Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",qa.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(A.width,v.x-A.x-z*A.width)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r},internalStorage:function(g){var r=[vb(g,["dx","dy"],function(A){var v=Math.max(0,Math.min(A.width,mxUtils.getValue(this.state.style,"dx",Ka.prototype.dx))),z=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"dy",Ka.prototype.dy)));+return new mxPoint(A.x+v,A.y+z)},function(A,v){this.state.style.dx=Math.round(Math.max(0,Math.min(A.width,v.x-A.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(A.height,v.y-A.y)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r},module:function(g){return[vb(g,["jettyWidth","jettyHeight"],function(r){var A=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"jettyWidth",Na.prototype.jettyWidth))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,+"jettyHeight",Na.prototype.jettyHeight)));return new mxPoint(r.x+A/2,r.y+2*v)},function(r,A){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(r.width,A.x-r.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(r.height,A.y-r.y))/2)})]},corner:function(g){return[vb(g,["dx","dy"],function(r){var A=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",ab.prototype.dx))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",ab.prototype.dy)));return new mxPoint(r.x++A,r.y+v)},function(r,A){this.state.style.dx=Math.round(Math.max(0,Math.min(r.width,A.x-r.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(r.height,A.y-r.y)))},!1)]},tee:function(g){return[vb(g,["dx","dy"],function(r){var A=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",db.prototype.dx))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",db.prototype.dy)));return new mxPoint(r.x+(r.width+A)/2,r.y+v)},function(r,A){this.state.style.dx=Math.round(Math.max(0,+2*Math.min(r.width/2,A.x-r.x-r.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(r.height,A.y-r.y)))},!1)]},singleArrow:Xa(1),doubleArrow:Xa(.5),"mxgraph.arrows2.wedgeArrow":fb(20,20),"mxgraph.arrows2.wedgeArrowDashed":fb(20,20),"mxgraph.arrows2.wedgeArrowDashed2":fb(20,20),folder:function(g){return[vb(g,["tabWidth","tabHeight"],function(r){var A=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"tabWidth",q.prototype.tabWidth))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,+"tabHeight",q.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(A=r.width-A);return new mxPoint(r.x+A,r.y+v)},function(r,A){var v=Math.max(0,Math.min(r.width,A.x-r.x));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(v=r.width-v);this.state.style.tabWidth=Math.round(v);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(r.height,A.y-r.y)))},!1)]},document:function(g){return[vb(g,["size"],function(r){var A=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",Q.prototype.size))));return new mxPoint(r.x+3*r.width/4,r.y+(1-A)*r.height)},function(r,A){this.state.style.size=Math.max(0,Math.min(1,(r.y+r.height-A.y)/r.height))},!1)]},tape:function(g){return[vb(g,["size"],function(r){var A=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",L.prototype.size))));return new mxPoint(r.getCenterX(),r.y+A*r.height/2)},function(r,A){this.state.style.size=Math.max(0,Math.min(1,(A.y-r.y)/r.height*2))},!1)]},isoCube2:function(g){return[vb(g,["isoAngle"],function(r){var A=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",U.isoAngle))))*Math.PI/200;return new mxPoint(r.x,r.y+Math.min(r.width*Math.tan(A),.5*r.height))},function(r,A){this.state.style.isoAngle=Math.max(0,50*(A.y-r.y)/r.height)},!0)]},cylinder2:wb(c.prototype.size),cylinder3:wb(f.prototype.size),offPageConnector:function(g){return[vb(g,["size"],function(r){var A=-Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",lb.prototype.size))));return new mxPoint(r.getCenterX(),r.y+(1-A)*r.height)},function(r,A){this.state.style.size=Math.max(0,Math.min(1,(r.y+r.height-A.y)/r.height))},!1)]},"mxgraph.basic.rect":function(g){var r=[Graph.createHandle(g,["size"],function(A){var u=Math.max(0,Math.min(A.width/2,A.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(A.x+u,A.y+u)},function(A,u){this.state.style.size=-Math.round(100*Math.max(0,Math.min(A.height/2,A.width/2,u.x-A.x)))/100})];g=Graph.createHandle(g,["indent"],function(A){var u=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(A.x+.75*A.width,A.y+u*A.height/200)},function(A,u){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(u.y-A.y)/A.height)))/100});r.push(g);return r},curvedText:function(g){var r=function(A){return(null!=A.shape?A.shape._curveYOffset:0)||0};return[vb(g,-["arcStartY"],function(A){var u=parseFloat(mxUtils.getValue(this.state.style,"arcStartY",Gb.prototype.arcStartY)),z=r(this.state);return new mxPoint(A.x+10,A.y+Math.max(0,Math.min(A.height,u+z)))},function(A,u){var z=r(this.state);this.state.style.arcStartY=Math.round(Math.max(0,Math.min(A.height,u.y-A.y))-z)},!1),vb(g,["arcMidY"],function(A){var u=parseFloat(mxUtils.getValue(this.state.style,"arcStartY",Gb.prototype.arcStartY)),z=parseFloat(mxUtils.getValue(this.state.style,"arcEndY",Gb.prototype.arcEndY)),-F=parseFloat(mxUtils.getValue(this.state.style,"arcMidY",Gb.prototype.arcMidY));u=(u+z)/2;z=r(this.state);return new mxPoint(A.x+A.width/2+10,A.y+Math.max(0,Math.min(A.height,u+F+z)))},function(A,u){var z=parseFloat(mxUtils.getValue(this.state.style,"arcStartY",Gb.prototype.arcStartY)),F=parseFloat(mxUtils.getValue(this.state.style,"arcEndY",Gb.prototype.arcEndY));z=(z+F)/2;F=r(this.state);var I=Math.max(Math.abs(Gb.prototype.arcMidY),Math.min(z,A.height-z));this.state.style.arcMidY=Math.round(Math.max(-I,-Math.min(I,u.y-A.y-F-z)))},!1),vb(g,["arcEndY"],function(A){var u=parseFloat(mxUtils.getValue(this.state.style,"arcEndY",Gb.prototype.arcEndY)),z=r(this.state);return new mxPoint(A.x+A.width-10,A.y+Math.max(0,Math.min(A.height,u+z)))},function(A,u){var z=r(this.state);this.state.style.arcEndY=Math.round(Math.max(0,Math.min(A.height,u.y-A.y))-z)},!1)]},step:qb(ra.prototype.size,!0,null,!0,ra.prototype.fixedSize),hexagon:qb(l.prototype.size,!0,.5,!0,l.prototype.fixedSize),curlyBracket:qb(fa.prototype.size,+Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",lb.prototype.size))));return new mxPoint(r.getCenterX(),r.y+(1-A)*r.height)},function(r,A){this.state.style.size=Math.max(0,Math.min(1,(r.y+r.height-A.y)/r.height))},!1)]},"mxgraph.basic.rect":function(g){var r=[Graph.createHandle(g,["size"],function(A){var v=Math.max(0,Math.min(A.width/2,A.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(A.x+v,A.y+v)},function(A,v){this.state.style.size=+Math.round(100*Math.max(0,Math.min(A.height/2,A.width/2,v.x-A.x)))/100})];g=Graph.createHandle(g,["indent"],function(A){var v=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(A.x+.75*A.width,A.y+v*A.height/200)},function(A,v){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(v.y-A.y)/A.height)))/100});r.push(g);return r},curvedText:function(g){var r=function(A){return(null!=A.shape?A.shape._curveYOffset:0)||0};return[vb(g,+["arcStartY"],function(A){var v=parseFloat(mxUtils.getValue(this.state.style,"arcStartY",Gb.prototype.arcStartY)),z=r(this.state);return new mxPoint(A.x+10,A.y+Math.max(0,Math.min(A.height,v+z)))},function(A,v){var z=r(this.state);this.state.style.arcStartY=Math.round(Math.max(0,Math.min(A.height,v.y-A.y))-z)},!1),vb(g,["arcMidY"],function(A){var v=parseFloat(mxUtils.getValue(this.state.style,"arcStartY",Gb.prototype.arcStartY)),z=parseFloat(mxUtils.getValue(this.state.style,"arcEndY",Gb.prototype.arcEndY)),+F=parseFloat(mxUtils.getValue(this.state.style,"arcMidY",Gb.prototype.arcMidY));v=(v+z)/2;z=r(this.state);return new mxPoint(A.x+A.width/2+10,A.y+Math.max(0,Math.min(A.height,v+F+z)))},function(A,v){var z=parseFloat(mxUtils.getValue(this.state.style,"arcStartY",Gb.prototype.arcStartY)),F=parseFloat(mxUtils.getValue(this.state.style,"arcEndY",Gb.prototype.arcEndY));z=(z+F)/2;F=r(this.state);var I=Math.max(Math.abs(Gb.prototype.arcMidY),Math.min(z,A.height-z));this.state.style.arcMidY=Math.round(Math.max(-I,+Math.min(I,v.y-A.y-F-z)))},!1),vb(g,["arcEndY"],function(A){var v=parseFloat(mxUtils.getValue(this.state.style,"arcEndY",Gb.prototype.arcEndY)),z=r(this.state);return new mxPoint(A.x+A.width-10,A.y+Math.max(0,Math.min(A.height,v+z)))},function(A,v){var z=r(this.state);this.state.style.arcEndY=Math.round(Math.max(0,Math.min(A.height,v.y-A.y))-z)},!1)]},step:qb(ra.prototype.size,!0,null,!0,ra.prototype.fixedSize),hexagon:qb(l.prototype.size,!0,.5,!0,l.prototype.fixedSize),curlyBracket:qb(fa.prototype.size,!1),display:qb(Qb.prototype.size,!1),cube:sb(1,p.prototype.size,!1),card:sb(.5,E.prototype.size,!0),loopLimit:sb(.5,Ya.prototype.size,!0),trapezoid:zb(.5,K.prototype.size,K.prototype.fixedSize),parallelogram:zb(1,V.prototype.size,V.prototype.fixedSize),zigzag:function(g){return[vb(g,["size"],function(r){var A=Math.max(5,parseFloat(mxUtils.getValue(this.state.style,"size",Tb.prototype.size)));return new mxPoint(r.x+3*A,r.y)},function(r,A){this.state.style.size=Math.max(5,Math.round((A.x-r.x)/3))},!1)]}};Graph.createHandle=vb;Graph.handleFactory=Eb;var Ib=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){var g=Ib.apply(this,arguments);if(this.graph.isCellRotatable(this.state.cell)){var r=this.state.style.shape;null==mxCellRenderer.defaultShapes[r]&&null==mxStencilRegistry.getStencil(r)?r=mxConstants.SHAPE_RECTANGLE:this.state.view.graph.isSwimlane(this.state.cell)&&(r=mxConstants.SHAPE_SWIMLANE);r=Eb[r];null==r&&null!=this.state.shape&&this.state.shape.isRoundable()&&(r=Eb[mxConstants.SHAPE_RECTANGLE]);null!=r&&(r=r(this.state),null!=r&&(g=null==g?r:g.concat(r)))}return g};mxEdgeHandler.prototype.createCustomHandles=function(){var g=this.state.style.shape;null==mxCellRenderer.defaultShapes[g]&&null==mxStencilRegistry.getStencil(g)&&(g=mxConstants.SHAPE_CONNECTOR);g=Eb[g];return null!=g?g(this.state):null}}else Graph.createHandle=function(){},Graph.handleFactory={};var Db=Graph.prototype.getPreferredSizeForCell;Graph.prototype.getPreferredSizeForCell=function(g,-r,A){var u=this.getCellStyle(g);if(null!=u&&"curvedText"==u[mxConstants.STYLE_SHAPE]){var z=this.convertValueToString(g);if(null!=z&&0<z.length){var F=parseFloat(mxUtils.getValue(u,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)),I=mxUtils.getValue(u,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);u=mxUtils.getValue(u,mxConstants.STYLE_FONTSTYLE,0);z=.85*mxUtils.getSizeForString(z,F,I,null,u).width;I=this.model.getGeometry(g);I=null!=I?I.height:60;(A=null!=A?A:this.gridEnabled)&&+r,A){var v=this.getCellStyle(g);if(null!=v&&"curvedText"==v[mxConstants.STYLE_SHAPE]){var z=this.convertValueToString(g);if(null!=z&&0<z.length){var F=parseFloat(mxUtils.getValue(v,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)),I=mxUtils.getValue(v,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);v=mxUtils.getValue(v,mxConstants.STYLE_FONTSTYLE,0);z=.85*mxUtils.getSizeForString(z,F,I,null,v).width;I=this.model.getGeometry(g);I=null!=I?I.height:60;(A=null!=A?A:this.gridEnabled)&&(z=this.snap(z+this.gridSize/2));return new mxRectangle(0,0,Math.max(z,2*F)+10,I)}return null}return Db.apply(this,arguments)};var Lb=mxCellRenderer.prototype.checkPlaceholderStyles;mxCellRenderer.prototype.checkPlaceholderStyles=function(g){return null!=g.style&&"curvedText"==g.style[mxConstants.STYLE_SHAPE]?!0:Lb.apply(this,arguments)};if("undefined"!==typeof mxCellEditor){var Hb=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(g,r){Hb.apply(this,arguments);var A=this.graph.view.getState(g);null!=A&&null!=A.style&&"curvedText"==A.style[mxConstants.STYLE_SHAPE]&&null!=A.shape&&A.shape.redraw()};var bc=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(g){var r=this.editingCell;bc.apply(this,arguments);null!=r&&(r=this.graph.view.getState(r),null!=r&&null!=r.style&&"curvedText"==r.style[mxConstants.STYLE_SHAPE]&&null!=r.shape&&r.shape.redraw())}}var Zb=new mxPoint(1,0),$b=new mxPoint(1,0),Sb=mxUtils.toRadians(-30);Zb=mxUtils.getRotatedPoint(Zb,-Math.cos(Sb),Math.sin(Sb));var ac=mxUtils.toRadians(-150);$b=mxUtils.getRotatedPoint($b,Math.cos(ac),Math.sin(ac));mxEdgeStyle.IsometricConnector=function(g,r,A,u,z){var F=g.view;u=null!=u&&0<u.length?u[0]:null;var I=g.absolutePoints,ea=I[0];I=I[I.length-1];null!=u&&(u=F.transformControlPoint(g,u));null==ea&&null!=r&&(ea=new mxPoint(r.getCenterX(),r.getCenterY()));null==I&&null!=A&&(I=new mxPoint(A.getCenterX(),A.getCenterY()));var S=Zb.x,ta=Zb.y,oa=$b.x,Ia=$b.y,mb="horizontal"==mxUtils.getValue(g.style,-"elbow","horizontal");if(null!=I&&null!=ea){g=function(Ea,Ga,Ja){Ea-=$a.x;var Pa=Ga-$a.y;Ga=(Ia*Ea-oa*Pa)/(S*Ia-ta*oa);Ea=(ta*Ea-S*Pa)/(ta*oa-S*Ia);mb?(Ja&&($a=new mxPoint($a.x+S*Ga,$a.y+ta*Ga),z.push($a)),$a=new mxPoint($a.x+oa*Ea,$a.y+Ia*Ea)):(Ja&&($a=new mxPoint($a.x+oa*Ea,$a.y+Ia*Ea),z.push($a)),$a=new mxPoint($a.x+S*Ga,$a.y+ta*Ga));z.push($a)};var $a=ea;null==u&&(u=new mxPoint(ea.x+(I.x-ea.x)/2,ea.y+(I.y-ea.y)/2));g(u.x,u.y,!0);g(I.x,I.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);-var Rb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(g,r){if(r==mxEdgeStyle.IsometricConnector){var A=new mxElbowEdgeHandler(g);A.snapToTerminals=!1;return A}return Rb.apply(this,arguments)};y.prototype.constraints=[];C.prototype.getConstraints=function(g,r,A){g=[];var u=Math.tan(mxUtils.toRadians(30)),z=(.5-u)/2;u=Math.min(r,A/(.5+u));r=(r-u)/2;A=(A-u)/2;g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A+.25*u));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,r+.5*u,A+u*z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+u,A+.25*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+u,A+.75*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+.5*u,A+(1-z)*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A+.75*u));return g};U.prototype.getConstraints=function(g,r,A){g=[];var u=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;u=Math.min(r*-Math.tan(u),.5*A);g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,u));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A-u));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-u));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,-0,u));return g};qa.prototype.getConstraints=function(g,r,A){g=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var u=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",this.position));var z=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1));g.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*(A-u)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A-u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,-A-u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A-u)));r>=2*u&&g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return g};mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,+Math.cos(Sb),Math.sin(Sb));var ac=mxUtils.toRadians(-150);$b=mxUtils.getRotatedPoint($b,Math.cos(ac),Math.sin(ac));mxEdgeStyle.IsometricConnector=function(g,r,A,v,z){var F=g.view;v=null!=v&&0<v.length?v[0]:null;var I=g.absolutePoints,ea=I[0];I=I[I.length-1];null!=v&&(v=F.transformControlPoint(g,v));null==ea&&null!=r&&(ea=new mxPoint(r.getCenterX(),r.getCenterY()));null==I&&null!=A&&(I=new mxPoint(A.getCenterX(),A.getCenterY()));var S=Zb.x,ta=Zb.y,oa=$b.x,Ia=$b.y,mb="horizontal"==mxUtils.getValue(g.style,+"elbow","horizontal");if(null!=I&&null!=ea){g=function(Ea,Ga,Ja){Ea-=$a.x;var Pa=Ga-$a.y;Ga=(Ia*Ea-oa*Pa)/(S*Ia-ta*oa);Ea=(ta*Ea-S*Pa)/(ta*oa-S*Ia);mb?(Ja&&($a=new mxPoint($a.x+S*Ga,$a.y+ta*Ga),z.push($a)),$a=new mxPoint($a.x+oa*Ea,$a.y+Ia*Ea)):(Ja&&($a=new mxPoint($a.x+oa*Ea,$a.y+Ia*Ea),z.push($a)),$a=new mxPoint($a.x+S*Ga,$a.y+ta*Ga));z.push($a)};var $a=ea;null==v&&(v=new mxPoint(ea.x+(I.x-ea.x)/2,ea.y+(I.y-ea.y)/2));g(v.x,v.y,!0);g(I.x,I.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);+var Rb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(g,r){if(r==mxEdgeStyle.IsometricConnector){var A=new mxElbowEdgeHandler(g);A.snapToTerminals=!1;return A}return Rb.apply(this,arguments)};y.prototype.constraints=[];B.prototype.getConstraints=function(g,r,A){g=[];var v=Math.tan(mxUtils.toRadians(30)),z=(.5-v)/2;v=Math.min(r,A/(.5+v));r=(r-v)/2;A=(A-v)/2;g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A+.25*v));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,r+.5*v,A+v*z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+v,A+.25*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+v,A+.75*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+.5*v,A+(1-z)*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A+.75*v));return g};U.prototype.getConstraints=function(g,r,A){g=[];var v=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;v=Math.min(r*+Math.tan(v),.5*A);g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,v));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A-v));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-v));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,+0,v));return g};qa.prototype.getConstraints=function(g,r,A){g=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var v=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",this.position));var z=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1));g.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*(A-v)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A-v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,+A-v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A-v)));r>=2*v&&g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return g};mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0)];mxEllipse.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];Kb.prototype.constraints=mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=-mxRectangleShape.prototype.constraints;t.prototype.constraints=mxRectangleShape.prototype.constraints;mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;Nb.prototype.constraints=mxRectangleShape.prototype.constraints;Ab.prototype.constraints=mxEllipse.prototype.constraints;M.prototype.constraints=mxEllipse.prototype.constraints;B.prototype.constraints=mxEllipse.prototype.constraints;G.prototype.getConstraints=function(g,r,A){g=[];var u=Math.max(0,Math.min(r,Math.min(A,parseFloat(mxUtils.getValue(this.style,-"size",this.size)))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-u),0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-u,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-.5*u,.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*(A+u)));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,-1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));r>=2*u&&g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return g};E.prototype.getConstraints=function(g,r,A){g=[];var u=Math.max(0,Math.min(r,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),0));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,u,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A+u)));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));r>=2*u&&g.push(new mxConnectionConstraint(new mxPoint(.5,-0),!1));return g};p.prototype.getConstraints=function(g,r,A){g=[];var u=Math.max(0,Math.min(r,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-u),0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-u,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-.5*u,.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,u));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,r,.5*(A+u)));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,A-.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A-u)));return g};f.prototype.getConstraints=function(g,r,A){g=[];r=Math.max(0,Math.min(A,+mxRectangleShape.prototype.constraints;t.prototype.constraints=mxRectangleShape.prototype.constraints;mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;Nb.prototype.constraints=mxRectangleShape.prototype.constraints;Ab.prototype.constraints=mxEllipse.prototype.constraints;M.prototype.constraints=mxEllipse.prototype.constraints;C.prototype.constraints=mxEllipse.prototype.constraints;G.prototype.getConstraints=function(g,r,A){g=[];var v=Math.max(0,Math.min(r,Math.min(A,parseFloat(mxUtils.getValue(this.style,+"size",this.size)))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-v),0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-v,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-.5*v,.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*(A+v)));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,+1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));r>=2*v&&g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return g};E.prototype.getConstraints=function(g,r,A){g=[];var v=Math.max(0,Math.min(r,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),0));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,v,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*v,.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A+v)));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));r>=2*v&&g.push(new mxConnectionConstraint(new mxPoint(.5,+0),!1));return g};p.prototype.getConstraints=function(g,r,A){g=[];var v=Math.max(0,Math.min(r,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-v),0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-v,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-.5*v,.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,v));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,r,.5*(A+v)));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,v,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*v,A-.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A-v)));return g};f.prototype.getConstraints=function(g,r,A){g=[];r=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,r));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,r));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1,null,0,-r));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1,null,0,-r));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,r+.5*(.5*A-r)));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,r+.5*(.5*A-r)));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,A-r-.5*(.5*A-r)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-r-.5*(.5*A-r)));g.push(new mxConnectionConstraint(new mxPoint(.145,0),!1,null,0,.29*r));g.push(new mxConnectionConstraint(new mxPoint(.855,0),!1,null,0,.29*r));g.push(new mxConnectionConstraint(new mxPoint(.855,-1),!1,null,0,.29*-r));g.push(new mxConnectionConstraint(new mxPoint(.145,1),!1,null,0,.29*-r));return g};q.prototype.getConstraints=function(g,r,A){g=[];var u=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?(g.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,.5*u,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,z)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),z))):(g.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-.5*u,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-u,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-u,z)),g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,.5*(r-u),z)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.25*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.75*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,+1),!1,null,0,.29*-r));g.push(new mxConnectionConstraint(new mxPoint(.145,1),!1,null,0,.29*-r));return g};q.prototype.getConstraints=function(g,r,A){g=[];var v=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?(g.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,.5*v,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,v,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,v,z)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),z))):(g.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-.5*v,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-v,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-v,z)),g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,.5*(r-v),z)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.25*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.75*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.25*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.75*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A));g.push(new mxConnectionConstraint(new mxPoint(.25,1),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(.75,1),!1));return g};Ka.prototype.constraints=mxRectangleShape.prototype.constraints;bb.prototype.constraints=-mxRectangleShape.prototype.constraints;ub.prototype.constraints=mxEllipse.prototype.constraints;gb.prototype.constraints=mxEllipse.prototype.constraints;jb.prototype.constraints=mxEllipse.prototype.constraints;Xb.prototype.constraints=mxEllipse.prototype.constraints;Ba.prototype.constraints=mxRectangleShape.prototype.constraints;Ob.prototype.constraints=mxRectangleShape.prototype.constraints;Qb.prototype.getConstraints=function(g,r,A){g=[];var u=Math.min(r,A/2),z=Math.min(r-u,Math.max(0,parseFloat(mxUtils.getValue(this.style,-"size",this.size)))*r);g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(z+r-u),0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-u,0));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-u,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(z+r-u),A));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,z,A));return g};Na.prototype.getConstraints=function(g,r,A){r=parseFloat(mxUtils.getValue(g,"jettyWidth",Na.prototype.jettyWidth))/2;g=parseFloat(mxUtils.getValue(g,"jettyHeight",Na.prototype.jettyHeight));var u=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,r),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(1,+mxRectangleShape.prototype.constraints;ub.prototype.constraints=mxEllipse.prototype.constraints;gb.prototype.constraints=mxEllipse.prototype.constraints;jb.prototype.constraints=mxEllipse.prototype.constraints;Xb.prototype.constraints=mxEllipse.prototype.constraints;Ba.prototype.constraints=mxRectangleShape.prototype.constraints;Ob.prototype.constraints=mxRectangleShape.prototype.constraints;Qb.prototype.getConstraints=function(g,r,A){g=[];var v=Math.min(r,A/2),z=Math.min(r-v,Math.max(0,parseFloat(mxUtils.getValue(this.style,+"size",this.size)))*r);g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(z+r-v),0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-v,0));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-v,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(z+r-v),A));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,z,A));return g};Na.prototype.getConstraints=function(g,r,A){r=parseFloat(mxUtils.getValue(g,"jettyWidth",Na.prototype.jettyWidth))/2;g=parseFloat(mxUtils.getValue(g,"jettyHeight",Na.prototype.jettyHeight));var v=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,r),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!1,null,r),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(A-.5*g,1.5*g)),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(A--.5*g,3.5*g))];A>5*g&&u.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,r));A>8*g&&u.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null,r));A>15*g&&u.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,r));return u};Ya.prototype.constraints=mxRectangleShape.prototype.constraints;lb.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),+.5*g,3.5*g))];A>5*g&&v.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,r));A>8*g&&v.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null,r));A>15*g&&v.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,r));return v};Ya.prototype.constraints=mxRectangleShape.prototype.constraints;lb.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];R.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)];La.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,@@ -3379,25 +3380,25 @@ new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(n0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0)];mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.375,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.625,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.375,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.625,1),!0)];mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.4,.1),!1),new mxConnectionConstraint(new mxPoint(.16,.55),!1),new mxConnectionConstraint(new mxPoint(.07,.4),!1),new mxConnectionConstraint(new mxPoint(.31,.8),!1),new mxConnectionConstraint(new mxPoint(.13,.77),!1),new mxConnectionConstraint(new mxPoint(.8,.8),!1),new mxConnectionConstraint(new mxPoint(.55,.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,.25),!1)];V.prototype.constraints=mxRectangleShape.prototype.constraints;K.prototype.constraints=mxRectangleShape.prototype.constraints;Q.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,-0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;db.prototype.getConstraints=function(g,r,A){g=[];var u=Math.max(0,+0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;db.prototype.getConstraints=function(g,r,A){g=[];var v=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,-null,.75*r+.25*u,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),.5*(A+z)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),A));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-u),A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-u),.5*(A+z)));g.push(new mxConnectionConstraint(new mxPoint(0,0),-!1,null,.5*(r-u),z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*r-.25*u,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*z));return g};ab.prototype.getConstraints=function(g,r,A){g=[];var u=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.push(new mxConnectionConstraint(new mxPoint(0,0),-!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,.5*(A+z)));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,u,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,A));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));return g};Qa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,-.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];Va.prototype.getConstraints=function(g,r,A){g=[];var u=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),z=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));u=(A-u)/2;g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,0,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-z),u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-z,0));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-z,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-z),A-u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-u));return g};nb.prototype.getConstraints=function(g,r,A){g=[];var u=A*Math.max(0,Math.min(1,-parseFloat(mxUtils.getValue(this.style,"arrowWidth",Va.prototype.arrowWidth)))),z=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Va.prototype.arrowSize))));u=(A-u)/2;g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*r,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-z,0));g.push(new mxConnectionConstraint(new mxPoint(1,.5),-!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-z,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*r,A-u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,A));return g};Ub.prototype.getConstraints=function(g,r,A){g=[];var u=Math.min(A,r),z=Math.max(0,Math.min(u,u*parseFloat(mxUtils.getValue(this.style,"size",this.size))));u=(A-z)/2;var F=u+z,I=(r-z)/2;z=I+z;g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,I,0));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,A-.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,A));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,z,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,A-.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+z),u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,u));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+z),F));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,I,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*I,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*I,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,u));return g};za.prototype.constraints=null;ya.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,+null,.75*r+.25*v,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),.5*(A+z)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),A));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-v),A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-v),.5*(A+z)));g.push(new mxConnectionConstraint(new mxPoint(0,0),+!1,null,.5*(r-v),z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*r-.25*v,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*z));return g};ab.prototype.getConstraints=function(g,r,A){g=[];var v=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.push(new mxConnectionConstraint(new mxPoint(0,0),+!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,v,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,v,.5*(A+z)));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,v,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*v,A));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));return g};Qa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,+.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];Va.prototype.getConstraints=function(g,r,A){g=[];var v=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),z=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));v=(A-v)/2;g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,0,v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-z),v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-z,0));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-z,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-z),A-v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-v));return g};nb.prototype.getConstraints=function(g,r,A){g=[];var v=A*Math.max(0,Math.min(1,+parseFloat(mxUtils.getValue(this.style,"arrowWidth",Va.prototype.arrowWidth)))),z=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Va.prototype.arrowSize))));v=(A-v)/2;g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*r,v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-z,0));g.push(new mxConnectionConstraint(new mxPoint(1,.5),+!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-z,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*r,A-v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,A));return g};Ub.prototype.getConstraints=function(g,r,A){g=[];var v=Math.min(A,r),z=Math.max(0,Math.min(v,v*parseFloat(mxUtils.getValue(this.style,"size",this.size))));v=(A-z)/2;var F=v+z,I=(r-z)/2;z=I+z;g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,I,0));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,A-.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,A));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,z,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,A-.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+z),v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,v));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+z),F));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,I,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*I,v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,v));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*I,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,v));return g};za.prototype.constraints=null;ya.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];Ra.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];Fa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];Ha.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(b){this.editorUi=b;this.actions={};this.init()}Actions.prototype.init=function(){function b(G){n.escape();G=n.deleteCells(n.getDeletableCells(n.getSelectionCells()),G);null!=G&&n.setSelectionCells(G)}function d(){if(!n.isSelectionEmpty()){n.getModel().beginUpdate();try{for(var G=n.getSelectionCells(),O=0;O<G.length;O++)n.cellLabelChanged(G[O],"")}finally{n.getModel().endUpdate()}}}function m(G,O,U,c,f){f.getModel().beginUpdate();try{var k=f.getCellGeometry(G);null!=k&&U&&c&&(U/=c,k=k.clone(),1<U?k.height=k.width/U:k.width=k.height*U,f.getModel().setGeometry(G,-k));f.setCellStyles(mxConstants.STYLE_CLIP_PATH,O,[G]);f.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[G])}finally{f.getModel().endUpdate()}}var p=this.editorUi,v=p.editor,n=v.graph,y=function(){return Action.prototype.isEnabled.apply(this,arguments)&&n.isEnabled()};this.addAction("new...",function(){n.openLink(p.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";p.openFile()});var C=new Action("smartFit",function(){if(p.chromelessResize)n.isLightboxView()?(1==-n.view.scale?p.lightboxFit():n.zoomTo(1),p.chromelessResize(!1)):p.chromelessResize(!0);else{n.popupMenuHandler.hideMenu();var G=n.view.scale,O=n.container.scrollLeft,U=n.container.scrollTop,c=n.view.translate.x,f=n.view.translate.y;p.actions.get("resetView").funct();1E-5>Math.abs(G-n.view.scale)&&5>Math.abs(O-n.container.scrollLeft)&&5>Math.abs(U-n.container.scrollTop)&&c==n.view.translate.x&&f==n.view.translate.y&&p.actions.get("fitWindow").funct()}},null,null,"Enter");C.getTitle=function(){return mxResources.get("fitWindow")+-" / "+mxResources.get("resetView")};this.put("smartFit",C);this.addAction("keyPressEnter",function(){n.isSelectionEmpty()?p.actions.get("smartFit").funct():n.isEnabled()&&n.startEditingAtCell()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){p.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(G,O){try{var U=mxUtils.parseXml(G);v.graph.setSelectionCells(v.graph.importGraphModel(U.documentElement))}catch(c){mxUtils.alert(mxResources.get("invalidOrMissingFile")++k));f.setCellStyles(mxConstants.STYLE_CLIP_PATH,O,[G]);f.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[G])}finally{f.getModel().endUpdate()}}var p=this.editorUi,u=p.editor,n=u.graph,y=function(){return Action.prototype.isEnabled.apply(this,arguments)&&n.isEnabled()};this.addAction("new...",function(){n.openLink(p.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";p.openFile()});var B=new Action("smartFit",function(){if(p.chromelessResize)n.isLightboxView()?(1==+n.view.scale?p.lightboxFit():n.zoomTo(1),p.chromelessResize(!1)):p.chromelessResize(!0);else{n.popupMenuHandler.hideMenu();var G=n.view.scale,O=n.container.scrollLeft,U=n.container.scrollTop,c=n.view.translate.x,f=n.view.translate.y;p.actions.get("resetView").funct();1E-5>Math.abs(G-n.view.scale)&&5>Math.abs(O-n.container.scrollLeft)&&5>Math.abs(U-n.container.scrollTop)&&c==n.view.translate.x&&f==n.view.translate.y&&p.actions.get("fitWindow").funct()}},null,null,"Enter");B.getTitle=function(){return mxResources.get("fitWindow")++" / "+mxResources.get("resetView")};this.put("smartFit",B);this.addAction("keyPressEnter",function(){n.isSelectionEmpty()?p.actions.get("smartFit").funct():n.isEnabled()&&n.startEditingAtCell()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){p.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(G,O){try{var U=mxUtils.parseXml(G);u.graph.setSelectionCells(u.graph.importGraphModel(U.documentElement))}catch(c){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+c.message)}}));p.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=y;this.addAction("save",function(){p.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=y;this.addAction("saveAs...",function(){p.saveFile(!0)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+S");this.addAction("export...",function(){p.showDialog((new ExportDialog(p)).container,360,396,!0,!0)});this.addAction("editDiagram...",function(){var G=new EditDiagramDialog(p);p.showDialog(G.container,620,420,!0,!1,null,null,null,new mxRectangle(0,0,440,280));G.init()}).isEnabled=y;this.addAction("pageSetup...",function(){p.showDialog((new PageSetupDialog(p)).container,420,null,!0,!0)}).isEnabled=y;this.addAction("print...",function(){p.showPrintDialog()},null,"",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(n,null,10,10)});this.addAction("undo",function(){p.undo()},null,"",Editor.ctrlKey+"+Z");this.addAction("redo",function(){p.redo()},null,"",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+"+Editor.shiftKey+"+Z");this.addAction("cut",function(){var G=null;try{G=p.copyXml(),null!=G&&n.removeCells(G,!1)}catch(O){}try{null==G&&mxClipboard.cut(n)}catch(O){p.handleError(O)}},null,"",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{p.copyXml()}catch(G){}try{mxClipboard.copy(n)}catch(G){p.handleError(G)}},null,"",Editor.ctrlKey+"+C");this.addAction("paste",function(){p.pasteFromClipboard()},!1,"",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(G){p.pasteFromClipboard(n.popupMenuHandler.getTriggerPoint())});@@ -3406,8 +3407,8 @@ O=0;O<G.length;O++)if(n.getModel().isVertex(G[O])){var U=n.getCellGeometry(G[O])"+B");this.addAction("copyAsText",function(){var G=n.getSelectionCell();if(n.isEnabled()&&null!=G)try{n.isHtmlLabel(G)?p.writeHtmlToClipboard(n.getLabel(G),mxUtils.bind(this,function(O){p.handleError(O)})):p.writeTextToClipboard(n.getLabel(G),mxUtils.bind(this,function(O){p.handleError(O)}))}catch(O){p.handleError(O)}});this.addAction("pasteData",function(G,O){function U(k,q){var x=c.getValue(k);q=k.cloneValue(q);q.removeAttribute("placeholders");null==x||isNaN(x.nodeType)||q.setAttribute("placeholders",x.getAttribute("placeholders"));null!=G&&mxEvent.isShiftDown(G)||q.setAttribute("label",n.convertValueToString(k));c.setValue(k,q)}G=null!=O?O:G;var c=n.getModel();if(n.isEnabled()&&!n.isSelectionEmpty()&&null!=p.copiedValue){c.beginUpdate();try{var f=n.getEditableCells(n.getSelectionCells());if(0==f.length)U(c.getRoot(),p.copiedValue);else for(O=0;O<f.length;O++)U(f[O],p.copiedValue)}finally{c.endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+E");this.addAction("delete",function(G,O){G=null!=O?O:G;null!=G&&mxEvent.isShiftDown(G)?d():b(null!=G&&(mxEvent.isControlDown(G)||mxEvent.isMetaDown(G)||mxEvent.isAltDown(G)))},null,null,"Delete");this.addAction("deleteAll",function(){b(!0)});this.addAction("deleteLabels",function(){d()},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){try{n.setSelectionCells(n.duplicateCells()),n.scrollCellToVisible(n.getSelectionCell())}catch(G){p.handleError(G)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action("merge",-function(){var G=p.getSelectionState();if(null!=G.mergeCell){n.getModel().beginUpdate();try{n.setCellStyles("rowspan",G.rowspan,[G.mergeCell]),n.setCellStyles("colspan",G.colspan,[G.mergeCell])}finally{n.getModel().endUpdate()}}}));this.put("unmergeCells",new Action("unmerge",function(){var G=p.getSelectionState();if(0<G.cells.length){n.getModel().beginUpdate();try{n.setCellStyles("rowspan",null,G.cells),n.setCellStyles("colspan",null,G.cells)}finally{n.getModel().endUpdate()}}}));C=new Action("turn",-function(G,O){G=null!=O?O:G;n.turnShapes(n.getResizableCells(n.getSelectionCells()),null!=G?mxEvent.isShiftDown(G):!1)},null,null,mxClient.IS_SF?null:Editor.ctrlKey+"+R");C.getTitle=function(){return mxResources.get("turn")+" / "+mxResources.get("reverse")};this.put("turn",C);C=new Action("rotateEdge",function(G,O){G=null!=O?O:G;n.rotateEdges(n.getSelectionCells(),null!=G?mxEvent.isShiftDown(G):!1)});C.getTitle=function(){return mxResources.get("turn")};this.put("rotateEdge",C);this.put("selectConnections",+function(){var G=p.getSelectionState();if(null!=G.mergeCell){n.getModel().beginUpdate();try{n.setCellStyles("rowspan",G.rowspan,[G.mergeCell]),n.setCellStyles("colspan",G.colspan,[G.mergeCell])}finally{n.getModel().endUpdate()}}}));this.put("unmergeCells",new Action("unmerge",function(){var G=p.getSelectionState();if(0<G.cells.length){n.getModel().beginUpdate();try{n.setCellStyles("rowspan",null,G.cells),n.setCellStyles("colspan",null,G.cells)}finally{n.getModel().endUpdate()}}}));B=new Action("turn",+function(G,O){G=null!=O?O:G;n.turnShapes(n.getResizableCells(n.getSelectionCells()),null!=G?mxEvent.isShiftDown(G):!1)},null,null,mxClient.IS_SF?null:Editor.ctrlKey+"+R");B.getTitle=function(){return mxResources.get("turn")+" / "+mxResources.get("reverse")};this.put("turn",B);B=new Action("rotateEdge",function(G,O){G=null!=O?O:G;n.rotateEdges(n.getSelectionCells(),null!=G?mxEvent.isShiftDown(G):!1)});B.getTitle=function(){return mxResources.get("turn")};this.put("rotateEdge",B);this.put("selectConnections",new Action("selectEdges",function(G){G=n.getSelectionCell();n.isEnabled()&&null!=G&&n.addSelectionCells(n.getEdges(G))}));this.addAction("selectVertices",function(){n.selectVertices(null,!0)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+I");this.addAction("selectEdges",function(){n.selectEdges()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+E");this.addAction("selectAll",function(){n.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){n.clearSelection()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+A");this.addAction("lockUnlock",function(){if(!n.isSelectionEmpty()){n.getModel().beginUpdate();try{var G=n.getSelectionCells(),O=n.getCurrentCellStyle(n.getSelectionCell()),U=1==mxUtils.getValue(O,mxConstants.STYLE_EDITABLE,1)?0:1;n.setCellStyles(mxConstants.STYLE_MOVABLE,U,G);n.setCellStyles(mxConstants.STYLE_RESIZABLE,U,G);n.setCellStyles(mxConstants.STYLE_ROTATABLE,U,G);n.setCellStyles(mxConstants.STYLE_DELETABLE,U,G);n.setCellStyles(mxConstants.STYLE_EDITABLE,U,G);n.setCellStyles("locked",1==U?0:1,G);n.setCellStyles("connectable",U,G)}finally{n.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("explore",function(){var G=n.getSelectionCell();n.model.isEdge(G)&&(G=n.model.getTerminal(G,!0));n.model.isVertex(G)&&Graph.exploreFromCell(p.editor.graph,G)});this.addAction("home",function(){n.home()},null,null,"Shift+Home");this.addAction("exitGroup",function(){n.exitGroup()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+Home");this.addAction("enterGroup",@@ -3429,14 +3430,14 @@ n.stopEditing();null!=G&&"wrap"==G.style[mxConstants.STYLE_WHITE_SPACE]&&(O=nullmxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");p.showDialog(G.container,375,80,!0,!0);G.init()});this.addAction("resetView",function(){n.zoomTo(1);p.resetScrollbars()},null,null,"Enter/Home");this.addAction("zoomIn",function(G){n.isFastZoomEnabled()?n.lazyZoom(!0,!0,p.buttonZoomDelay):n.zoomIn()},null,null,Editor.ctrlKey+" + / Alt+Mousewheel");this.addAction("zoomOut",function(G){n.isFastZoomEnabled()?n.lazyZoom(!1,!0,p.buttonZoomDelay):n.zoomOut()},null,null,Editor.ctrlKey+" - / Alt+Mousewheel");this.addAction("fitWindow",function(){p.fitDiagramOrPages()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+H");this.addAction("fitPage",mxUtils.bind(this,function(){n.pageVisible?n.fitPages(1):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){n.pageVisible?n.fitPages(2):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){n.pageVisible?n.fitPages(1,!0):this.get("pageView").funct()}));this.put("customZoom",new Action("custom...",mxUtils.bind(this,function(){var G=new FilenameDialog(this.editorUi,parseInt(100*n.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(O){O=parseInt(O);!isNaN(O)&&0<O&&n.zoomTo(O/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(G.container,300,80,!0,!0);G.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var G=new FilenameDialog(this.editorUi,-parseInt(100*n.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(O){O=parseInt(O);!isNaN(O)&&0<O&&(O=new ChangePageSetup(p,null,null,null,O/100),O.ignoreColor=!0,O.ignoreImage=!0,n.model.execute(O))}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(G.container,300,80,!0,!0);G.init()}));C=null;C=this.addAction("grid",function(){n.setGridEnabled(!n.isGridEnabled());n.defaultGridEnabled=n.isGridEnabled();p.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+-"+"+Editor.shiftKey+"+G");C.setToggleAction(!0);C.setSelectedCallback(function(){return n.isGridEnabled()});C.setEnabled(!1);C=this.addAction("guides",function(){n.graphHandler.guidesEnabled=!n.graphHandler.guidesEnabled;p.fireEvent(new mxEventObject("guidesEnabledChanged"))});C.setToggleAction(!0);C.setSelectedCallback(function(){return n.graphHandler.guidesEnabled});C.setEnabled(!1);C=this.addAction("animations",function(){Editor.enableAnimations=!Editor.enableAnimations;p.fireEvent(new mxEventObject("enableAnimationsChanged"))});-C.setToggleAction(!0);C.setSelectedCallback(function(){return Editor.enableAnimations});C=this.addAction("tooltips",function(){n.tooltipHandler.setEnabled(!n.tooltipHandler.isEnabled());p.fireEvent(new mxEventObject("tooltipsEnabledChanged"))});C.setToggleAction(!0);C.setSelectedCallback(function(){return n.tooltipHandler.isEnabled()});C=this.addAction("collapseExpand",function(){var G=new ChangePageSetup(p);G.ignoreColor=!0;G.ignoreImage=!0;G.foldingEnabled=!n.foldingEnabled;n.model.execute(G)});-C.setToggleAction(!0);C.setSelectedCallback(function(){return n.foldingEnabled});C.isEnabled=y;C=this.addAction("pageView",mxUtils.bind(this,function(){p.setPageVisible(!n.pageVisible)}));C.setToggleAction(!0);C.setSelectedCallback(function(){return n.pageVisible});C=this.addAction("connectionArrows",function(){n.connectionArrowsEnabled=!n.connectionArrowsEnabled;p.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+A");C.setToggleAction(!0);C.setSelectedCallback(function(){return n.connectionArrowsEnabled});-C=this.addAction("connectionPoints",function(){n.setConnectable(!n.connectionHandler.isEnabled());p.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+O");C.setToggleAction(!0);C.setSelectedCallback(function(){return n.connectionHandler.isEnabled()});C=this.addAction("autosave",function(){p.editor.setAutosave(!p.editor.autosave)});C.setToggleAction(!0);C.setSelectedCallback(function(){return p.editor.autosave});C.isEnabled=y;C.visible=!1;this.addAction("help",-function(){var G="";mxResources.isLanguageSupported(mxClient.language)&&(G="_"+mxClient.language);n.openLink(RESOURCES_PATH+"/help"+G+".html")});var P=!1;C=new Action("about",function(){P||(p.showDialog((new AboutDialog(p)).container,320,280,!0,!0,function(){P=!1}),P=!0)});C.getTitle=function(){return mxResources.get("about")+" Graph Editor..."};this.put("about",C);C=mxUtils.bind(this,function(G,O,U,c){return this.addAction(G,function(){if(null!=U&&n.cellEditor.isContentEditing())U();else{n.stopEditing(!1);+parseInt(100*n.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(O){O=parseInt(O);!isNaN(O)&&0<O&&(O=new ChangePageSetup(p,null,null,null,O/100),O.ignoreColor=!0,O.ignoreImage=!0,n.model.execute(O))}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(G.container,300,80,!0,!0);G.init()}));B=null;B=this.addAction("grid",function(){n.setGridEnabled(!n.isGridEnabled());n.defaultGridEnabled=n.isGridEnabled();p.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey++"+"+Editor.shiftKey+"+G");B.setToggleAction(!0);B.setSelectedCallback(function(){return n.isGridEnabled()});B.setEnabled(!1);B=this.addAction("guides",function(){n.graphHandler.guidesEnabled=!n.graphHandler.guidesEnabled;p.fireEvent(new mxEventObject("guidesEnabledChanged"))});B.setToggleAction(!0);B.setSelectedCallback(function(){return n.graphHandler.guidesEnabled});B.setEnabled(!1);B=this.addAction("animations",function(){Editor.enableAnimations=!Editor.enableAnimations;p.fireEvent(new mxEventObject("enableAnimationsChanged"))});+B.setToggleAction(!0);B.setSelectedCallback(function(){return Editor.enableAnimations});B=this.addAction("tooltips",function(){n.tooltipHandler.setEnabled(!n.tooltipHandler.isEnabled());p.fireEvent(new mxEventObject("tooltipsEnabledChanged"))});B.setToggleAction(!0);B.setSelectedCallback(function(){return n.tooltipHandler.isEnabled()});B=this.addAction("collapseExpand",function(){var G=new ChangePageSetup(p);G.ignoreColor=!0;G.ignoreImage=!0;G.foldingEnabled=!n.foldingEnabled;n.model.execute(G)});+B.setToggleAction(!0);B.setSelectedCallback(function(){return n.foldingEnabled});B.isEnabled=y;B=this.addAction("pageView",mxUtils.bind(this,function(){p.setPageVisible(!n.pageVisible)}));B.setToggleAction(!0);B.setSelectedCallback(function(){return n.pageVisible});B=this.addAction("connectionArrows",function(){n.connectionArrowsEnabled=!n.connectionArrowsEnabled;p.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+A");B.setToggleAction(!0);B.setSelectedCallback(function(){return n.connectionArrowsEnabled});+B=this.addAction("connectionPoints",function(){n.setConnectable(!n.connectionHandler.isEnabled());p.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+O");B.setToggleAction(!0);B.setSelectedCallback(function(){return n.connectionHandler.isEnabled()});B=this.addAction("autosave",function(){p.editor.setAutosave(!p.editor.autosave)});B.setToggleAction(!0);B.setSelectedCallback(function(){return p.editor.autosave});B.isEnabled=y;B.visible=!1;this.addAction("help",+function(){var G="";mxResources.isLanguageSupported(mxClient.language)&&(G="_"+mxClient.language);n.openLink(RESOURCES_PATH+"/help"+G+".html")});var P=!1;B=new Action("about",function(){P||(p.showDialog((new AboutDialog(p)).container,320,280,!0,!0,function(){P=!1}),P=!0)});B.getTitle=function(){return mxResources.get("about")+" Graph Editor..."};this.put("about",B);B=mxUtils.bind(this,function(G,O,U,c){return this.addAction(G,function(){if(null!=U&&n.cellEditor.isContentEditing())U();else{n.stopEditing(!1);n.getModel().beginUpdate();try{var f=n.getEditableCells(n.getSelectionCells());n.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,O,f);(O&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?n.updateLabelElements(f,function(q){q.style.fontWeight=null;"B"==q.nodeName&&n.replaceElement(q)}):(O&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?n.updateLabelElements(f,function(q){q.style.fontStyle=null;"I"==q.nodeName&&n.replaceElement(q)}):(O&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.updateLabelElements(f,-function(q){q.style.textDecoration=null;"U"==q.nodeName&&n.replaceElement(q)});for(var k=0;k<f.length;k++)0==n.model.getChildCount(f[k])&&n.autoSizeCell(f[k],!1)}finally{n.getModel().endUpdate()}}},null,null,c)});C("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");C("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");C("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",+function(q){q.style.textDecoration=null;"U"==q.nodeName&&n.replaceElement(q)});for(var k=0;k<f.length;k++)0==n.model.getChildCount(f[k])&&n.autoSizeCell(f[k],!1)}finally{n.getModel().endUpdate()}}},null,null,c)});B("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");B("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");B("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){p.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000","default",n.shapeForegroundColor,void 0,mxResources.get("fontColor"))});this.addAction("strokeColor...",function(){p.menus.pickColor(mxConstants.STYLE_STROKECOLOR,null,null,"default",n.shapeForegroundColor,void 0,mxResources.get("strokeColor"))});this.addAction("fillColor...",function(){p.menus.pickColor(mxConstants.STYLE_FILLCOLOR,null,null,"default",n.shapeBackgroundColor,void 0,mxResources.get("fillColor"))});this.addAction("gradientColor...",function(){p.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR,null,null,"default",n.shapeForegroundColor,void 0,mxResources.get("gradientColor"))});this.addAction("backgroundColor...",function(){p.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor",null,"default",n.shapeBackgroundColor,void 0,mxResources.get("backgroundColor"))});this.addAction("borderColor...",function(){p.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR,null,null,"default",n.shapeForegroundColor,void 0,mxResources.get("borderColor"))});this.addAction("removeFormat",function(){if(n.isEnabled()&&!n.isSelectionEmpty()&&!n.isEditing()){n.getModel().beginUpdate();try{for(var G=n.getSelectionCells(),O=0;O<G.length;O++)n.removeTextStyleForCell(G[O],!0)}finally{n.getModel().endUpdate()}}});this.addAction("vertical",function(){p.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){p.menus.toggleStyle(mxConstants.STYLE_SHADOW)});@@ -3447,68 +3448,69 @@ null),p.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASU);n.setCellStyles(mxConstants.STYLE_CURVED,null);p.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[U,"0"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}}});this.addAction("curved",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),n.setCellStyles(mxConstants.STYLE_CURVED,"1"),p.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});this.addAction("collapsible",function(){var G=n.view.getState(n.getSelectionCell()),O="1";null!=G&&null!=n.getFoldingImage(G)&&(O="0");n.setCellStyles("collapsible",O);p.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[O],"cells",n.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var G=n.getEditableCells(n.getSelectionCells());if(null!=G&&0<G.length){var O=n.getModel();O=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",O.getStyle(G[0])||"",function(U){null!=U&&n.setCellStyle(mxUtils.trim(U),G)},null,null,400,220);this.editorUi.showDialog(O.container,420,300,!0,!0,null,null,null,new mxRectangle(0,0,300,200),null,"editStyle");O.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){n.isEnabled()&&!n.isSelectionEmpty()&&p.setDefaultStyle(n.getSelectionCell())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+-"+D");this.addAction("clearDefaultStyle",function(){n.isEnabled()&&p.clearDefaultStyle()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+R");this.addAction("addWaypoint",function(){var G=n.getSelectionCell();if(null!=G&&n.getModel().isEdge(G)){var O=v.graph.selectionCellsHandler.getHandler(G);if(O instanceof mxEdgeHandler){var U=0,c=0;G=n.getModel().getParent(G);for(var f=n.getCellGeometry(G);n.getModel().isVertex(G)&&null!=f;)U+=f.x,c+=f.y,G=n.getModel().getParent(G),f=n.getCellGeometry(G);G=n.popupMenuHandler.getTriggerPoint();+"+D");this.addAction("clearDefaultStyle",function(){n.isEnabled()&&p.clearDefaultStyle()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+R");this.addAction("addWaypoint",function(){var G=n.getSelectionCell();if(null!=G&&n.getModel().isEdge(G)){var O=u.graph.selectionCellsHandler.getHandler(G);if(O instanceof mxEdgeHandler){var U=0,c=0;G=n.getModel().getParent(G);for(var f=n.getCellGeometry(G);n.getModel().isVertex(G)&&null!=f;)U+=f.x,c+=f.y,G=n.getModel().getParent(G),f=n.getCellGeometry(G);G=n.popupMenuHandler.getTriggerPoint();U=Math.round(n.snap(G.x-U));c=Math.round(n.snap(G.y-c));O.addPointAt(O.state,U,c)}}});this.addAction("removeWaypoint",function(){var G=p.actions.get("removeWaypoint");null!=G.handler&&G.handler.removePoint(G.handler.state,G.index)});this.addAction("clearAnchors",function(){var G=n.getSelectionCells();if(null!=G){G=n.getEditableCells(n.addAllEdges(G));n.getModel().beginUpdate();try{for(var O=0;O<G.length;O++){var U=G[O];n.getModel().isEdge(U)&&(n.setCellStyles(mxConstants.STYLE_EXIT_X,null,[U]),n.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[U]),n.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[U]),n.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[U]))}}finally{n.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var G=n.getSelectionCells();if(null!=G){G=n.getEditableCells(n.addAllEdges(G));n.getModel().beginUpdate();try{for(var O=0;O<G.length;O++){var U=G[O];if(n.getModel().isEdge(U)){var c=n.getCellGeometry(U);null!=c&&(c=c.clone(),c.points=null,c.x=0,c.y=0,c.offset=null,n.getModel().setGeometry(U,c));n.setCellStyles("innerLoopWaypoints",-null,[U])}}}finally{n.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+R");C=this.addAction("subscript",mxUtils.bind(this,function(){n.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");C=this.addAction("superscript",mxUtils.bind(this,function(){n.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");C=this.addAction("decreaseFontSize",mxUtils.bind(this,function(){if(!n.isSelectionEmpty()){var G=-n.getCurrentCellStyle(n.getSelectionCell());G=mxUtils.getValue(G,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);n.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.max(1,G-1),n.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" + (Numpad)");C=this.addAction("increaseFontSize",mxUtils.bind(this,function(){if(!n.isSelectionEmpty()){var G=n.getCurrentCellStyle(n.getSelectionCell());G=mxUtils.getValue(G,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);n.setCellStyles(mxConstants.STYLE_FONTSIZE,-Math.min(100,G+1),n.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" - (Numpad)");this.addAction("image...",function(){if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())){var G=mxResources.get("image")+" ("+mxResources.get("url")+"):",O=n.getView().getState(n.getSelectionCell()),U="",c=null;null!=O&&(U=O.style[mxConstants.STYLE_IMAGE]||U,c=O.style[mxConstants.STYLE_CLIP_PATH]||c);var f=n.cellEditor.saveSelection();p.showImageDialog(G,U,function(k,q,x,B,E,L){if(n.cellEditor.isContentEditing())n.cellEditor.restoreSelection(f),-n.insertImage(k,q,x);else{var Q=n.getSelectionCells();if(null!=k&&(0<k.length||0<Q.length)){var V=null;n.getModel().beginUpdate();try{if(0==Q.length){Q=[n.insertVertex(n.getDefaultParent(),null,"",0,0,q,x,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var K=n.getCenterInsertPoint(n.getBoundingBoxFromGeometry(Q,!0));Q[0].geometry.x=K.x;Q[0].geometry.y=K.y;null!=B&&m(Q[0],B,E,L,n);V=Q;n.fireEvent(new mxEventObject("cellsInserted","cells",V))}n.setCellStyles(mxConstants.STYLE_IMAGE,-0<k.length?k:null,Q);var fa=n.getCurrentCellStyle(Q[0]);"image"!=fa[mxConstants.STYLE_SHAPE]&&"label"!=fa[mxConstants.STYLE_SHAPE]?n.setCellStyles(mxConstants.STYLE_SHAPE,"image",Q):0==k.length&&n.setCellStyles(mxConstants.STYLE_SHAPE,null,Q);null==B&&n.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,Q);if(null!=q&&null!=x)for(k=0;k<Q.length;k++){var aa=Q[k];if("0"!=n.getCurrentCellStyle(aa).expand){var da=n.getModel().getGeometry(aa);null!=da&&(da=da.clone(),da.width=q,da.height=x,n.getModel().setGeometry(aa,-da))}null!=B&&m(aa,B,E,L,n)}}finally{n.getModel().endUpdate()}null!=V&&(n.setSelectionCells(V),n.scrollCellToVisible(V[0]))}}},n.cellEditor.isContentEditing(),!n.cellEditor.isContentEditing(),!0,c)}}).isEnabled=y;this.addAction("crop...",function(){var G=n.getSelectionCell();if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())&&null!=G){var O=n.getCurrentCellStyle(G),U=O[mxConstants.STYLE_IMAGE],c=O[mxConstants.STYLE_SHAPE];U&&"image"==c&&(O=new CropImageDialog(p,U,O[mxConstants.STYLE_CLIP_PATH],-function(f,k,q){m(G,f,k,q,n)}),p.showDialog(O.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450)))}}).isEnabled=y;C=this.addAction("layers",mxUtils.bind(this,function(){if(null==this.layersWindow){var G=null!=p.installWindowPersistence?mxSettings.getWindowState("layers"):null;this.layersWindow=new LayersWindow(p,null!=G&&null!=G.x?G.x:document.body.offsetWidth-280,null!=G&&null!=G.y?G.y:120,null!=G&&null!=G.w?G.w:212,null!=G&&null!=G.h?G.h:200);this.layersWindow.window.addListener("show",+null,[U])}}}finally{n.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+R");B=this.addAction("subscript",mxUtils.bind(this,function(){n.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");B=this.addAction("superscript",mxUtils.bind(this,function(){n.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");B=this.addAction("decreaseFontSize",mxUtils.bind(this,function(){if(!n.isSelectionEmpty()){var G=+n.getCurrentCellStyle(n.getSelectionCell());G=mxUtils.getValue(G,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);n.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.max(1,G-1),n.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" + (Numpad)");B=this.addAction("increaseFontSize",mxUtils.bind(this,function(){if(!n.isSelectionEmpty()){var G=n.getCurrentCellStyle(n.getSelectionCell());G=mxUtils.getValue(G,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);n.setCellStyles(mxConstants.STYLE_FONTSIZE,+Math.min(100,G+1),n.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" - (Numpad)");this.addAction("image...",function(){if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())){var G=mxResources.get("image")+" ("+mxResources.get("url")+"):",O=n.getView().getState(n.getSelectionCell()),U="",c=null;null!=O&&(U=O.style[mxConstants.STYLE_IMAGE]||U,c=O.style[mxConstants.STYLE_CLIP_PATH]||c);var f=n.cellEditor.saveSelection();p.showImageDialog(G,U,function(k,q,x,C,E,L){if(n.cellEditor.isContentEditing())n.cellEditor.restoreSelection(f),+n.insertImage(k,q,x);else{var Q=n.getSelectionCells();if(null!=k&&(0<k.length||0<Q.length)){var V=null;n.getModel().beginUpdate();try{if(0==Q.length){Q=[n.insertVertex(n.getDefaultParent(),null,"",0,0,q,x,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var K=n.getCenterInsertPoint(n.getBoundingBoxFromGeometry(Q,!0));Q[0].geometry.x=K.x;Q[0].geometry.y=K.y;null!=C&&m(Q[0],C,E,L,n);V=Q;n.fireEvent(new mxEventObject("cellsInserted","cells",V))}n.setCellStyles(mxConstants.STYLE_IMAGE,+0<k.length?k:null,Q);var fa=n.getCurrentCellStyle(Q[0]);"image"!=fa[mxConstants.STYLE_SHAPE]&&"label"!=fa[mxConstants.STYLE_SHAPE]?n.setCellStyles(mxConstants.STYLE_SHAPE,"image",Q):0==k.length&&n.setCellStyles(mxConstants.STYLE_SHAPE,null,Q);null==C&&n.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,Q);if(null!=q&&null!=x)for(k=0;k<Q.length;k++){var aa=Q[k];if("0"!=n.getCurrentCellStyle(aa).expand){var da=n.getModel().getGeometry(aa);null!=da&&(da=da.clone(),da.width=q,da.height=x,n.getModel().setGeometry(aa,+da))}null!=C&&m(aa,C,E,L,n)}}finally{n.getModel().endUpdate()}null!=V&&(n.setSelectionCells(V),n.scrollCellToVisible(V[0]))}}},n.cellEditor.isContentEditing(),!n.cellEditor.isContentEditing(),!0,c)}}).isEnabled=y;this.addAction("crop...",function(){var G=n.getSelectionCell();if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())&&null!=G){var O=n.getCurrentCellStyle(G),U=O[mxConstants.STYLE_IMAGE],c=O[mxConstants.STYLE_SHAPE];U&&"image"==c&&(O=new CropImageDialog(p,U,O[mxConstants.STYLE_CLIP_PATH],+function(f,k,q){m(G,f,k,q,n)}),p.showDialog(O.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450)))}}).isEnabled=y;B=this.addAction("layers",mxUtils.bind(this,function(){if(null==this.layersWindow){var G=null!=p.installWindowPersistence?mxSettings.getWindowState("layers"):null;this.layersWindow=new LayersWindow(p,null!=G&&null!=G.x?G.x:document.body.offsetWidth-280,null!=G&&null!=G.y?G.y:120,null!=G&&null!=G.w?G.w:212,null!=G&&null!=G.h?G.h:200);this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){p.fireEvent(new mxEventObject("layers"))}));this.layersWindow.window.addListener("hide",function(){p.fireEvent(new mxEventObject("layers"))});null!=p.installWindowPersistence&&(p.installWindowPersistence("layers",this.layersWindow),null!=G&&p.restoreWindowState("layers",this.layersWindow));this.layersWindow.window.setVisible(!0);p.fireEvent(new mxEventObject("layers"));this.layersWindow.init()}else this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),-null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+L");C.setToggleAction(!0);C.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));C=this.addAction("format",mxUtils.bind(this,function(){p.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+P");C.setToggleAction(!0);C.setSelectedCallback(mxUtils.bind(this,function(){return p.isFormatPanelVisible()}));C=this.addAction("outline",mxUtils.bind(this,function(){if(null==this.outlineWindow){var G=+null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+L");B.setToggleAction(!0);B.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));B=this.addAction("format",mxUtils.bind(this,function(){p.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+P");B.setToggleAction(!0);B.setSelectedCallback(mxUtils.bind(this,function(){return p.isFormatPanelVisible()}));B=this.addAction("outline",mxUtils.bind(this,function(){if(null==this.outlineWindow){var G=null!=p.installWindowPersistence?mxSettings.getWindowState("outline"):null;this.outlineWindow=new OutlineWindow(p,null!=G&&null!=G.x?G.x:document.body.offsetWidth-260,null!=G&&null!=G.y?G.y:100,null!=G&&null!=G.w?G.w:180,null!=G&&null!=G.h?G.h:180);this.outlineWindow.window.addListener("show",mxUtils.bind(this,function(){p.fireEvent(new mxEventObject("outline"))}));this.outlineWindow.window.addListener("hide",function(){p.fireEvent(new mxEventObject("outline"))});null!=p.installWindowPersistence&&-(p.installWindowPersistence("outline",this.outlineWindow),null!=G&&p.restoreWindowState("outline",this.outlineWindow));this.outlineWindow.window.setVisible(!0);p.fireEvent(new mxEventObject("outline"))}else this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+O");C.setToggleAction(!0);C.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editPolygon...",+(p.installWindowPersistence("outline",this.outlineWindow),null!=G&&p.restoreWindowState("outline",this.outlineWindow));this.outlineWindow.window.setVisible(!0);p.fireEvent(new mxEventObject("outline"))}else this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+O");B.setToggleAction(!0);B.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editPolygon...",function(){var G=n.getSelectionCell();if(n.isEnabled()&&null!=G){var O=n.view.getState(G);if(null!=O&&"mxgraph.basic.polygon"===mxUtils.getValue(O.style,mxConstants.STYLE_SHAPE)){var U=new PolygonDialog(p,G);p.showDialog(U.container,680,540,!0,!0,function(){U.destroy()},null,null,new mxRectangle(0,0,740,600));U.init()}}}).isEnabled=y;this.addAction("editConnectionPoints...",function(){var G=n.getSelectionCell();if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())&&null!=G&&null!=G.geometry){var O=-new ConnectionPointsDialog(p,G);p.showDialog(O.container,400,450,!0,!1,function(){O.destroy()},null,null,new mxRectangle(0,0,450,500),null,"editConnectionPoints");O.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+Q").isEnabled=y};Actions.prototype.addAction=function(b,d,m,p,v,n){var y=b;"..."==y.substring(y.length-3)&&(y=y.substring(0,y.length-3));return this.put(y,new Action(b,d,m,p,v,n))};Actions.prototype.put=function(b,d){return this.actions[b]=d};Actions.prototype.get=function(b){return this.actions[b]};-function Action(b,d,m,p,v,n){mxEventSource.call(this);this.label=b;this.funct=this.createFunction(d);this.enabled=null!=m?m:!0;this.iconCls=p;this.shortcut=v;this.visible=null!=n?n:!0}mxUtils.extend(Action,mxEventSource);Action.prototype.getTitle=function(){var b=this.label;"..."==b.substring(b.length-3)?(b=b.substring(0,b.length-3),b=mxResources.get(b)+"..."):b=mxResources.get(b);return b};Action.prototype.createFunction=function(b){return b};+new ConnectionPointsDialog(p,G);p.showDialog(O.container,400,450,!0,!1,function(){O.destroy()},null,null,new mxRectangle(0,0,450,500),null,"editConnectionPoints");O.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+Q").isEnabled=y};Actions.prototype.addAction=function(b,d,m,p,u,n){var y=b;"..."==y.substring(y.length-3)&&(y=y.substring(0,y.length-3));return this.put(y,new Action(b,d,m,p,u,n))};Actions.prototype.put=function(b,d){return this.actions[b]=d};Actions.prototype.get=function(b){return this.actions[b]};+function Action(b,d,m,p,u,n){mxEventSource.call(this);this.label=b;this.funct=this.createFunction(d);this.enabled=null!=m?m:!0;this.iconCls=p;this.shortcut=u;this.visible=null!=n?n:!0}mxUtils.extend(Action,mxEventSource);Action.prototype.getTitle=function(){var b=this.label;"..."==b.substring(b.length-3)?(b=b.substring(0,b.length-3),b=mxResources.get(b)+"..."):b=mxResources.get(b);return b};Action.prototype.createFunction=function(b){return b};Action.prototype.setEnabled=function(b){this.enabled!=b&&(this.enabled=b,this.fireEvent(new mxEventObject("stateChanged","attribute","enabled")))};Action.prototype.isEnabled=function(){return this.enabled};Action.prototype.setVisible=function(b){this.visible!=b&&(this.visible=b,this.fireEvent(new mxEventObject("stateChanged","attribute","visible")))};Action.prototype.isVisible=function(){return this.visible};Action.prototype.setToggleAction=function(b){this.toggleAction=b};Action.prototype.setSelectedCallback=function(b){this.selectedCallback=b};Action.prototype.isSelected=function(){return this.selectedCallback()};DrawioFile=function(b,d){mxEventSource.call(this);this.ui=b;this.setData(d||"");this.initialData=this.getData();this.created=(new Date).getTime();this.stats={opened:0,merged:0,fileMerged:0,fileReloaded:0,conflicts:0,timeouts:0,saved:0,closed:0,destroyed:0,joined:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0}};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;DrawioFile.RESTRICT_EXPORT=!1;mxUtils.extend(DrawioFile,mxEventSource);-DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.savingSpinnerKey="saving";DrawioFile.prototype.savingStatusKey="saving";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.optimisticSyncDelay=300;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.lastSaved=null;DrawioFile.prototype.lastChanged=null;DrawioFile.prototype.opened=null;DrawioFile.prototype.modified=!1;-DrawioFile.prototype.shadowModified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.ageStart=null;DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};-DrawioFile.prototype.getShadowPages=function(){if(null==this.shadowPages&&(this.shadowPages=this.ui.getPagesForXml(this.initialData,!0),void 0===this.shadowVars)){this.shadowVars=null;try{var b=mxUtils.parseXml(this.initialData).documentElement;null!=b&&"mxfile"==b.nodeName&&(this.shadowVars=b.getAttribute("vars"))}catch(d){}}return this.shadowPages};+DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.savingSpinnerKey="saving";DrawioFile.prototype.savingStatusKey="saving";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.optimisticSyncDelay=300;DrawioFile.prototype.loadFontsTimeout=5E3;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.lastSaved=null;DrawioFile.prototype.lastChanged=null;+DrawioFile.prototype.opened=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.shadowModified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.ageStart=null;+DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};DrawioFile.prototype.getShadowPages=function(){if(null==this.shadowPages&&(this.shadowPages=this.ui.getPagesForXml(this.initialData,!0),void 0===this.shadowVars)){this.shadowVars=null;try{var b=mxUtils.parseXml(this.initialData).documentElement;null!=b&&"mxfile"==b.nodeName&&(this.shadowVars=b.getAttribute("vars"))}catch(d){}}return this.shadowPages};DrawioFile.prototype.setShadowPages=function(b,d){this.shadowPages=b;this.shadowVars=void 0!==d?d:null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null};DrawioFile.prototype.getShadowVars=function(){this.getShadowPages();return void 0!==this.shadowVars?this.shadowVars:null};-DrawioFile.prototype.synchronizeFile=function(b,d,m){EditorUi.debug("DrawioFile.synchronizeFile",[this],"latestFile",[m],"savingFile",this.savingFile);if(this.savingFile)null!=d&&d({message:mxResources.get("busy")});else{var p=!0,v=window.setTimeout(mxUtils.bind(this,function(){p=!1;null!=d&&d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,d)})})}),this.ui.timeout),n=mxUtils.bind(this,function(C){p&&(window.clearTimeout(v),null!=-d&&d(C))}),y=mxUtils.bind(this,function(){return!p});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,function(C){p&&(window.clearTimeout(v),this.sync.cleanup(b,d,C))}),n,y):this.updateFile(mxUtils.bind(this,function(){p&&(window.clearTimeout(v),null!=b&&b())}),n,y,null,null,m)}};-DrawioFile.prototype.updateFile=function(b,d,m,p,v,n){if(null==m||!m())if(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",v,"invalidChecksum",this.invalidChecksum,"latestFile",[n]),this.ui.getCurrentFile()!=this||this.invalidChecksum)null!=d&&d();else{var y=mxUtils.bind(this,function(C){try{null!=m&&m()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[C]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=d&&d():null!=C?this.mergeFile(C,-b,d,p,v):this.reloadFile(b,d))}catch(P){null!=d&&d(P)}});null!=n?y(n):this.getLatestVersion(y,d)}};-DrawioFile.prototype.mergeFile=function(b,d,m,p,v){try{var n=b.getShadowPages();if(null!=n&&0<n.length){var y=this.getShadowPages(),C=[this.ui.diffPages(null!=p?p:y,n)];p=null;try{var P=mxUtils.parseXml(b.initialData).documentElement;null!=P&&"mxfile"==P.nodeName&&(p=P.getAttribute("vars"))}catch(B){}p!=this.getShadowVars()&&(C[0][EditorUi.DIFF_FILE]={vars:p});var G=this.ignorePatches(C);if(G)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),-EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",G),null!=d&&d();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var O=this.isModified()?this.ui.diffPages(y,this.isRealtime()?this.ownPages:this.ui.pages):null,U=this.ui.patchPages(this.ui.clonePages(y),C[0]),c=this.ui.getHashValueForPages(U,{}),f=this.ui.getHashValueForPages(n,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",y,"pages",n,"patched",U,"patches",C,"changes",O,"checksum",-c,"current",f,"valid",c==f,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",v);if(null!=c&&c!=f)this.checksumError(m,C,null,null,"mergeFile",c,f,b.getCurrentRevisionId());else{this.setShadowPages(n,p);if(null!=this.sync){var k=this.sync.patchRealtime(C,DrawioFile.LAST_WRITE_WINS?O:null,null,v);null==k||mxUtils.isEmptyObject(k)||C.push(k)}this.patch(C,DrawioFile.LAST_WRITE_WINS?O:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());-this.descriptorChanged();null!=d&&d()}}catch(B){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=m&&m(B);try{if(!(B instanceof DOMException&&"InvalidCharacterError"==B.name)){var q=this.getCurrentUser(),x=null!=q?q.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),x,B)}}catch(E){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(B){null!=m&&m(B)}};-DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var d=new mxCodec(mxUtils.createXmlDocument()),m=d.document.createElement("mxfile");if(null!=b)for(var p=0;p<b.length;p++){var v=d.encode(new mxGraphModel(b[p].root));"1"!=urlParams.dev&&(v=this.ui.anonymizeNode(v,!0));v.setAttribute("id",b[p].getId());b[p].viewState&&this.ui.editor.graph.saveViewState(b[p].viewState,v,!0);m.appendChild(v)}return mxUtils.getPrettyXml(m)};+DrawioFile.prototype.synchronizeFile=function(b,d,m){EditorUi.debug("DrawioFile.synchronizeFile",[this],"latestFile",[m],"savingFile",this.savingFile);if(this.savingFile)null!=d&&d({message:mxResources.get("busy")});else{var p=!0,u=window.setTimeout(mxUtils.bind(this,function(){p=!1;null!=d&&d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,d)})})}),this.ui.timeout),n=mxUtils.bind(this,function(B){p&&(window.clearTimeout(u),null!=+d&&d(B))}),y=mxUtils.bind(this,function(){return!p});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,function(B){p&&(window.clearTimeout(u),this.sync.cleanup(b,d,B))}),n,y):this.updateFile(mxUtils.bind(this,function(){p&&(window.clearTimeout(u),null!=b&&b())}),n,y,null,null,m)}};+DrawioFile.prototype.updateFile=function(b,d,m,p,u,n){if(null==m||!m())if(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",u,"invalidChecksum",this.invalidChecksum,"latestFile",[n]),this.ui.getCurrentFile()!=this||this.invalidChecksum)null!=d&&d();else{var y=mxUtils.bind(this,function(B){try{null!=m&&m()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[B]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=d&&d():null!=B?this.mergeFile(B,+b,d,p,u):this.reloadFile(b,d))}catch(P){null!=d&&d(P)}});null!=n?y(n):this.getLatestVersion(y,d)}};+DrawioFile.prototype.mergeFile=function(b,d,m,p,u){try{var n=b.getShadowPages();if(null!=n&&0<n.length){var y=this.getShadowPages(),B=[this.ui.diffPages(null!=p?p:y,n)];p=null;try{var P=mxUtils.parseXml(b.initialData).documentElement;null!=P&&"mxfile"==P.nodeName&&(p=P.getAttribute("vars"))}catch(C){}p!=this.getShadowVars()&&(B[0][EditorUi.DIFF_FILE]={vars:p});var G=this.ignorePatches(B);if(G)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),+EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",G),null!=d&&d();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var O=this.isModified()?this.ui.diffPages(y,this.isRealtime()?this.ownPages:this.ui.pages):null,U=this.ui.patchPages(this.ui.clonePages(y),B[0]),c=this.ui.getHashValueForPages(U,{}),f=this.ui.getHashValueForPages(n,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",y,"pages",n,"patched",U,"patches",B,"changes",O,"checksum",+c,"current",f,"valid",c==f,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",u);if(null!=c&&c!=f)this.checksumError(m,B,null,null,"mergeFile",c,f,b.getCurrentRevisionId());else{this.setShadowPages(n,p);if(null!=this.sync){var k=this.sync.patchRealtime(B,DrawioFile.LAST_WRITE_WINS?O:null,null,u);null==k||mxUtils.isEmptyObject(k)||B.push(k)}this.patch(B,DrawioFile.LAST_WRITE_WINS?O:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());+this.descriptorChanged();null!=d&&d()}}catch(C){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=m&&m(C);try{if(!(C instanceof DOMException&&"InvalidCharacterError"==C.name)){var q=this.getCurrentUser(),x=null!=q?q.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),x,C)}}catch(E){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(C){null!=m&&m(C)}};+DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var d=new mxCodec(mxUtils.createXmlDocument()),m=d.document.createElement("mxfile");if(null!=b)for(var p=0;p<b.length;p++){var u=d.encode(new mxGraphModel(b[p].root));"1"!=urlParams.dev&&(u=this.ui.anonymizeNode(u,!0));u.setAttribute("id",b[p].getId());b[p].viewState&&this.ui.editor.graph.saveViewState(b[p].viewState,u,!0);m.appendChild(u)}return mxUtils.getPrettyXml(m)};DrawioFile.prototype.compressReportData=function(b,d,m){d=null!=d?d:1E4;null!=m&&null!=b&&b.length>m?b=b.substring(0,m)+"[...]":null!=b&&b.length>d&&(b=Graph.compress(b)+"\n");return b};-DrawioFile.prototype.checksumError=function(b,d,m,p,v,n,y,C){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var P=this.getCurrentUser(),G=null!=P?P.id:"unknown",O=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",U=JSON.stringify(d).length,c=null;if(null!=d&&1E3>U){b=[];for(m=0;m<d.length;m++)b.push(this.ui.anonymizePatch(d[m]));c=JSON.stringify(b);c=null!=c&&1E3>-c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(f){try{var k=null!=c?"report":"error",q=this.ui.getHashValueForPages(f.getShadowPages()),x="unknown",B="unknown",E="unknown";try{var L=null!=f.initialData&&0<f.initialData.length?mxUtils.parseXml(f.initialData).documentElement:null;null!=L&&(null!=L.getAttribute("version")&&(x=L.getAttribute("version")),null!=L.getAttribute("agent")&&(B=L.getAttribute("agent")),null!=L.getAttribute("type")&&(E=L.getAttribute("type")))}catch(Q){}EditorUi.logError("Checksum "+-k+" in "+v,null,this.getMode()+"."+O,"user_"+G+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+U+"-patches_"+d.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=n?"-expected_"+n:"")+(null!=y?"-current_"+y:"")+(null!=C?"-rev_"+this.ui.hashValue(C):"")+(null!=q?"-latest_"+q:"")+"-latestRev_"+this.ui.hashValue(f.getCurrentRevisionId())+("-latestVersion_"+x)+("-latestAgent_"+B)+("-latestType_"+E));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+O,action:v,label:"user_"++DrawioFile.prototype.checksumError=function(b,d,m,p,u,n,y,B){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var P=this.getCurrentUser(),G=null!=P?P.id:"unknown",O=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",U=JSON.stringify(d).length,c=null;if(null!=d&&1E3>U){b=[];for(m=0;m<d.length;m++)b.push(this.ui.anonymizePatch(d[m]));c=JSON.stringify(b);c=null!=c&&1E3>+c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(f){try{var k=null!=c?"report":"error",q=this.ui.getHashValueForPages(f.getShadowPages()),x="unknown",C="unknown",E="unknown";try{var L=null!=f.initialData&&0<f.initialData.length?mxUtils.parseXml(f.initialData).documentElement:null;null!=L&&(null!=L.getAttribute("version")&&(x=L.getAttribute("version")),null!=L.getAttribute("agent")&&(C=L.getAttribute("agent")),null!=L.getAttribute("type")&&(E=L.getAttribute("type")))}catch(Q){}EditorUi.logError("Checksum "++k+" in "+u,null,this.getMode()+"."+O,"user_"+G+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+U+"-patches_"+d.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=n?"-expected_"+n:"")+(null!=y?"-current_"+y:"")+(null!=B?"-rev_"+this.ui.hashValue(B):"")+(null!=q?"-latest_"+q:"")+"-latestRev_"+this.ui.hashValue(f.getCurrentRevisionId())+("-latestVersion_"+x)+("-latestAgent_"+C)+("-latestType_"+E));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+O,action:u,label:"user_"+G+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+U+"-patches_"+d.length+"-size_"+this.getSize()})}catch(Q){}}),function(){})}catch(f){}};-DrawioFile.prototype.sendErrorReport=function(b,d,m,p){try{var v=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),n=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),y=this.getCurrentUser(),C=null!=y?this.ui.hashValue(y.id):"unknown",P=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",G=this.getTitle(),O=G.lastIndexOf(".");y="xml";0<O&&(y=G.substring(O));var U=null!=m?m.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()+-":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+y+")\nUser="+C+P+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=d?"\n\n"+d:-"")+(null!=m?"\n\nError: "+m.message:"")+"\n\nStack:\n"+U+"\n\nShadow:\n"+v+"\n\nData:\n"+n,p)}catch(c){}};-DrawioFile.prototype.reloadFile=function(b,d){try{this.stats.fileReloaded++;var m=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),p=this.ui.editor.graph,v=p.getSelectionCells(),n=p.getViewState(),y=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(C){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[m],"viewState",[n],"latestFile",C);null!=C?(this.ui.replaceFileData(C.getData(),-[m]),this.ui.restoreViewState(y,n,v),this.setDescriptor(C.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var P=this.ui.getCurrentFile();null!=P&&(P.stats=this.stats,P.patch([m]),P.fileChanged());this.ui.restoreViewState(y,n,v);null!=b&&b()}else null!=d&&d(this.ui.fileLoadedError)}),!0))}),d)}catch(C){null!=d&&d(C)}};+DrawioFile.prototype.sendErrorReport=function(b,d,m,p){try{var u=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),n=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),y=this.getCurrentUser(),B=null!=y?this.ui.hashValue(y.id):"unknown",P=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",G=this.getTitle(),O=G.lastIndexOf(".");y="xml";0<O&&(y=G.substring(O));var U=null!=m?m.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()++":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+y+")\nUser="+B+P+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=d?"\n\n"+d:+"")+(null!=m?"\n\nError: "+m.message:"")+"\n\nStack:\n"+U+"\n\nShadow:\n"+u+"\n\nData:\n"+n,p)}catch(c){}};+DrawioFile.prototype.reloadFile=function(b,d){try{this.stats.fileReloaded++;var m=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),p=this.ui.editor.graph,u=p.getSelectionCells(),n=p.getViewState(),y=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(B){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[m],"viewState",[n],"latestFile",B);null!=B?(this.ui.replaceFileData(B.getData(),+[m]),this.ui.restoreViewState(y,n,u),this.setDescriptor(B.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var P=this.ui.getCurrentFile();null!=P&&(P.stats=this.stats,P.patch([m]),P.fileChanged());this.ui.restoreViewState(y,n,u);null!=b&&b()}else null!=d&&d(this.ui.fileLoadedError)}),!0))}),d)}catch(B){null!=d&&d(B)}};DrawioFile.prototype.copyFile=function(b,d){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};DrawioFile.prototype.ignorePatches=function(b){var d=!0;if(null!=b)for(var m=0;m<b.length&&d;m++)d=d&&mxUtils.isEmptyObject(b[m]);return d};-DrawioFile.prototype.patch=function(b,d,m,p){if(null!=b){var v=this.ui.editor.undoManager,n=v.history.slice(),y=v.indexOfNextAdd,C=this.ui.editor.graph;C.container.style.visibility="hidden";var P=this.changeListenerEnabled;this.changeListenerEnabled=m;var G=C.foldingEnabled,O=C.mathEnabled,U=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var c=C.cellRenderer.redraw;C.cellRenderer.redraw=function(E){E.view.graph.isEditing(E.cell)&&(E.view.graph.scrollCellToVisible(E.cell),-E.view.graph.cellEditor.resize());c.apply(this,arguments)};C.model.beginUpdate();try{if(m){for(var f=this.ui.pages.slice(),k=this.ui.currentPage,q=this.ui.applyPatches(this.ui.pages,b,!0,d,this.isModified()),x=0;x<q.length;x++){var B=mxUtils.indexOf(this.ui.pages,q[x]);0>B?this.ui.insertPage(q[x],Math.min(x,this.ui.pages.length)):this.ui.movePage(B,x)}for(x=0;x<f.length;x++)0>mxUtils.indexOf(q,f[x])&&this.ui.removePage(f[x]);0<=mxUtils.indexOf(this.ui.pages,k)&&this.ui.selectPage(k,!0)}else this.ui.pages=-this.ui.applyPatches(this.ui.pages,b,!0,d,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);C.checkDefaultParent()}finally{C.container.style.visibility="",C.model.endUpdate(),C.cellRenderer.redraw=c,this.changeListenerEnabled=P,m||(v.history=n,v.indexOfNextAdd=y,v.fireEvent(new mxEventObject(mxEvent.CLEAR))),v=U!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):-null),(n=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&O!=C.mathEnabled?(this.ui.editor.updateGraphComponents(),C.refresh()):v?C.refresh():n&&(G!=C.foldingEnabled?C.view.revalidate():C.view.validate(),C.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!p&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",-[this],"patches",b,"resolver",d,"undoable",m)}return b};-DrawioFile.prototype.save=function(b,d,m,p,v,n){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",p,"overwrite",v,"manual",n,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!v&&this.invalidChecksum)if(null!=m)m({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=d&&d();else if(null!=m)m({message:mxResources.get("readOnly")});-else throw Error(mxResources.get("readOnly"));}catch(y){if(null!=m)m(y);else throw y;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var d=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=d&&(d.viewState=this.ui.editor.graph.getViewState(),d.needsUpdate=!0)}d=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return d};+DrawioFile.prototype.patch=function(b,d,m,p){if(null!=b){var u=this.ui.editor.undoManager,n=u.history.slice(),y=u.indexOfNextAdd,B=this.ui.editor.graph;B.container.style.visibility="hidden";var P=this.changeListenerEnabled;this.changeListenerEnabled=m;var G=B.foldingEnabled,O=B.mathEnabled,U=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var c=B.cellRenderer.redraw;B.cellRenderer.redraw=function(E){E.view.graph.isEditing(E.cell)&&(E.view.graph.scrollCellToVisible(E.cell),+E.view.graph.cellEditor.resize());c.apply(this,arguments)};B.model.beginUpdate();try{if(m){for(var f=this.ui.pages.slice(),k=this.ui.currentPage,q=this.ui.applyPatches(this.ui.pages,b,!0,d,this.isModified()),x=0;x<q.length;x++){var C=mxUtils.indexOf(this.ui.pages,q[x]);0>C?this.ui.insertPage(q[x],Math.min(x,this.ui.pages.length)):this.ui.movePage(C,x)}for(x=0;x<f.length;x++)0>mxUtils.indexOf(q,f[x])&&this.ui.removePage(f[x]);0<=mxUtils.indexOf(this.ui.pages,k)&&this.ui.selectPage(k,!0)}else this.ui.pages=+this.ui.applyPatches(this.ui.pages,b,!0,d,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);B.checkDefaultParent()}finally{B.container.style.visibility="",B.model.endUpdate(),B.cellRenderer.redraw=c,this.changeListenerEnabled=P,m||(u.history=n,u.indexOfNextAdd=y,u.fireEvent(new mxEventObject(mxEvent.CLEAR))),u=U!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):+null),(n=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&O!=B.mathEnabled?(this.ui.editor.updateGraphComponents(),B.refresh()):u?B.refresh():n&&(G!=B.foldingEnabled?B.view.revalidate():B.view.validate(),B.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!p&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",+[this],"patches",b,"resolver",d,"undoable",m)}return b};DrawioFile.prototype.loadFonts=function(b){if(this.ui.getCurrentFile()==this&&/(\.svg)$/i.test(this.getTitle())&&this.ui.getSvgFileProperties(this.ui.fileNode).embedFonts){var d=null,m=!1,p=function(){m||(m=!0,window.clearTimeout(d),b())};d=window.setTimeout(p,this.loadFontsTimeout);try{this.ui.editor.loadFonts(mxUtils.bind(this,function(){this.ui.editor.embedExtFonts(p)}))}catch(u){p()}}else b()};+DrawioFile.prototype.save=function(b,d,m,p,u,n){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",p,"overwrite",u,"manual",n,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!u&&this.invalidChecksum)if(null!=m)m({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else{this.clearAutosave();var y=mxUtils.bind(this,function(){try{this.updateFileData(),null!=d&&d()}catch(B){if(null!=+m)m(B);else throw B;}});p?y():this.loadFonts(y)}else if(null!=m)m({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(B){if(null!=m)m(B);else throw B;}};+DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var d=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=d&&(d.viewState=this.ui.editor.graph.getViewState(),d.needsUpdate=!0)}d=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return d};DrawioFile.prototype.updateFileData=function(){null!=this.sync&&this.sync.sendLocalChanges();this.setData(this.createData());null!=this.sync&&this.sync.fileDataUpdated()};DrawioFile.prototype.isCompressedStorage=function(){return Editor.defaultCompressed};DrawioFile.prototype.isCompressed=function(){var b=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("compressed"):null;return null!=b?"false"!=b:this.isCompressedStorage()&&Editor.compressXml};DrawioFile.prototype.setLocked=function(b){this.ui.fileNode.setAttribute("locked",b?"true":"false");this.ui.fireEvent(new mxEventObject("lockedChanged"));this.fileChanged();b&&this.ui.editor.graph.clearSelection()};DrawioFile.prototype.isLocked=function(){var b=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("locked"):null;return null!=b?"true"==b:!1};DrawioFile.prototype.saveAs=function(b,d,m){};DrawioFile.prototype.saveFile=function(b,d,m,p){};DrawioFile.prototype.getFileUrl=function(){return null};DrawioFile.prototype.getFolderUrl=function(b){return null};DrawioFile.prototype.getPublicUrl=function(b){b(null)};DrawioFile.prototype.isRestricted=function(){return DrawioFile.RESTRICT_EXPORT};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.getShadowModified=function(){return this.shadowModified};DrawioFile.prototype.setShadowModified=function(b){this.shadowModified=b};DrawioFile.prototype.setModified=function(b){this.shadowModified=this.modified=b};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return!this.inConflictState&&this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(b,d,m){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.isTrashed=function(){return!1};DrawioFile.prototype.move=function(b,d,m){};-DrawioFile.prototype.share=function(){null!=this.ui.drive?this.ui.confirm(mxResources.get("saveItToGoogleDriveToCollaborate",[this.getTitle()]),mxUtils.bind(this,function(){this.ui.pickFolder(App.MODE_GOOGLE,mxUtils.bind(this,function(b){var d=this.ui.editor.graph,m=d.getSelectionCells(),p=d.getViewState(),v=this.ui.currentPage;this.ui.createFile(this.getTitle(),this.ui.getFileData(null,null,null,null,null,null,null,null,this),null,App.MODE_GOOGLE,null,!0,b,null,null,mxUtils.bind(this,function(){this.ui.restoreViewState(v,+DrawioFile.prototype.share=function(){null!=this.ui.drive?this.ui.confirm(mxResources.get("saveItToGoogleDriveToCollaborate",[this.getTitle()]),mxUtils.bind(this,function(){this.ui.pickFolder(App.MODE_GOOGLE,mxUtils.bind(this,function(b){var d=this.ui.editor.graph,m=d.getSelectionCells(),p=d.getViewState(),u=this.ui.currentPage;this.ui.createFile(this.getTitle(),this.ui.getFileData(null,null,null,null,null,null,null,null,this),null,App.MODE_GOOGLE,null,!0,b,null,null,mxUtils.bind(this,function(){this.ui.restoreViewState(u,p,m);this.ui.actions.get("share").funct()}))}))}),null,mxResources.get("saveToGoogleDrive",null,"Save to Google Drive"),mxResources.get("cancel")):this.ui.alert(mxResources.get("sharingAvailable"),null,380)};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.isChromelessView()||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};DrawioFile.prototype.setData=function(b){this.data=b;EditorUi.debug("DrawioFile.setData",[this],"data",[b])};DrawioFile.prototype.getData=function(){return this.data};DrawioFile.prototype.removeExtFonts=function(b){for(var d=0;null!=b&&d<b.length;d++){var m=b[d];null!=m.id&&0==m.id.indexOf("extFont_")&&m.parentNode.removeChild(m)}};DrawioFile.prototype.open=function(){this.stats.opened++;var b=this.getData();null!=b&&(this.ui.setFileData(b,this),this.isModified()||this.setShadowPages(this.ui.clonePages(this.ui.pages)));this.installListeners();this.isSyncSupported()&&this.startSync();EditorUi.debug("DrawioFile.open",[this])};DrawioFile.prototype.isPolling=function(){return!1};DrawioFile.prototype.getPollingInterval=function(){return 1E4};DrawioFile.prototype.isSyncSupported=function(){return!1};DrawioFile.prototype.isRealtime=function(){return null!=this.ownPages&&null!=this.ui.pages};DrawioFile.prototype.isRealtimeSupported=function(){return!1};DrawioFile.prototype.isRealtimeEnabled=function(){return Editor.enableRealtime&&"0"!=urlParams["fast-sync"]};DrawioFile.prototype.setRealtimeEnabled=function(){};DrawioFile.prototype.isRealtimeOptional=function(){return!1};DrawioFile.prototype.getRealtimeState=function(){return null!=this.sync&&null!=this.sync.p2pCollab?this.sync.p2pCollab.getState():3};DrawioFile.prototype.getRealtimeError=function(){return null!=this.sync&&null!=this.sync.p2pCollab?this.sync.p2pCollab.getLastError():null};DrawioFile.prototype.isOptimisticSync=function(){return!1};DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};DrawioFile.prototype.getRevisions=function(b,d){b(null)};-DrawioFile.prototype.getRecoveryVersion=function(b,d){this.isRevisionHistorySupported()?this.getRevisions(mxUtils.bind(this,function(m){if(null==m||2>m.length)b(null);else{var p=m.length-2,v=Math.max(0,p-5+1),n=mxUtils.bind(this,function(){if(p<v)EditorUi.debug("DrawioFile.getRecoveryVersion",[this],"no valid revision found in",m.length-1-v,"probed"),b(null);else{var y=m[p--];null==y||"function"!==typeof y.getXml?n():y.getXml(mxUtils.bind(this,function(C){if(this.ui.isFileDataLoadable(C)){var P=this.ui.formatRecoveryDate(y.modifiedDate);-b({type:"version",label:null!=P?mxResources.get("recoverVersionFrom",[P]):mxResources.get("recoverPreviousVersion"),description:mxResources.get("recoveryVersionDesc"),data:C,date:y.modifiedDate,lossy:!1})}else n()}),mxUtils.bind(this,function(){n()}))}});n()}}),mxUtils.bind(this,function(){b(null)})):b(null)};DrawioFile.prototype.loadDescriptor=function(b,d){b(null)};DrawioFile.prototype.loadPatchDescriptor=function(b,d){this.loadDescriptor(mxUtils.bind(this,function(m){b(m)}),d)};+DrawioFile.prototype.getRecoveryVersion=function(b,d){this.isRevisionHistorySupported()?this.getRevisions(mxUtils.bind(this,function(m){if(null==m||2>m.length)b(null);else{var p=m.length-2,u=Math.max(0,p-5+1),n=mxUtils.bind(this,function(){if(p<u)EditorUi.debug("DrawioFile.getRecoveryVersion",[this],"no valid revision found in",m.length-1-u,"probed"),b(null);else{var y=m[p--];null==y||"function"!==typeof y.getXml?n():y.getXml(mxUtils.bind(this,function(B){if(this.ui.isFileDataLoadable(B)){var P=this.ui.formatRecoveryDate(y.modifiedDate);+b({type:"version",label:null!=P?mxResources.get("recoverVersionFrom",[P]):mxResources.get("recoverPreviousVersion"),description:mxResources.get("recoveryVersionDesc"),data:B,date:y.modifiedDate,lossy:!1})}else n()}),mxUtils.bind(this,function(){n()}))}});n()}}),mxUtils.bind(this,function(){b(null)})):b(null)};DrawioFile.prototype.loadDescriptor=function(b,d){b(null)};DrawioFile.prototype.loadPatchDescriptor=function(b,d){this.loadDescriptor(mxUtils.bind(this,function(m){b(m)}),d)};DrawioFile.prototype.patchDescriptor=function(b,d){this.setDescriptorEtag(b,this.getDescriptorEtag(d));this.descriptorChanged()};DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC&&"fast"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(null==this.sync&&(this.sync=new DrawioFileSync(this)),this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.ui.fireEvent(new mxEventObject("realtimeStateChanged"))})),this.sync.start())};DrawioFile.prototype.isConflict=function(){return!1};DrawioFile.prototype.getChannelId=function(){return Graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(b){return null};DrawioFile.prototype.getCurrentUser=function(){return null};DrawioFile.prototype.getLatestVersion=function(b,d){b(null)};DrawioFile.prototype.getLatestVersionId=function(b,d){b(-1)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};@@ -3530,36 +3532,36 @@ DrawioFile.prototype.showRefreshDialog=function(b,d,m){null==m&&(m=mxResources.gfunction(){null!=b&&b();this.ui.alert(mxResources.get("copyCreated"))}),d)}),null,mxResources.get("merge"),mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&this.reloadFile(mxUtils.bind(this,function(){this.ui.spinner.stop();null!=b&&b()}),mxUtils.bind(this,function(){this.ui.spinner.stop();null!=d&&d()}))}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),380,130))};DrawioFile.prototype.showCopyDialog=function(b,d,m){this.invalidChecksum=this.inConflictState=!1;this.addUnsavedStatus();this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedOverwriteDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(b,d)}),null,mxResources.get("overwrite"),m,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),380,150)};DrawioFile.prototype.showConflictDialog=function(b,d){this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedSyncDialog"),mxResources.get("overwrite"),b,null,mxResources.get("merge"),d,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog();this.handleFileError(null,!1)}),380,130)};-DrawioFile.prototype.redirectToNewApp=function(b,d){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var m=window.location.protocol+"//"+window.location.host+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#"+this.getHash(),p=mxResources.get("redirectToNewApp");null!=d&&(p+=" ("+d+")");d=mxUtils.bind(this,function(){var v=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==m?window.location.reload():window.location.href=-m});null==b&&this.isModified()?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.redirectDialogShowing=!1}),v,mxResources.get("cancel"),mxResources.get("discardChanges")):v()});null!=b?this.isModified()?this.ui.confirm(p,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()}),d,mxResources.get("cancel"),mxResources.get("discardChanges")):this.ui.confirm(p,d,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()})):this.ui.alert(mxResources.get("redirectToNewApp"),+DrawioFile.prototype.redirectToNewApp=function(b,d){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var m=window.location.protocol+"//"+window.location.host+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#"+this.getHash(),p=mxResources.get("redirectToNewApp");null!=d&&(p+=" ("+d+")");d=mxUtils.bind(this,function(){var u=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==m?window.location.reload():window.location.href=+m});null==b&&this.isModified()?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.redirectDialogShowing=!1}),u,mxResources.get("cancel"),mxResources.get("discardChanges")):u()});null!=b?this.isModified()?this.ui.confirm(p,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()}),d,mxResources.get("cancel"),mxResources.get("discardChanges")):this.ui.confirm(p,d,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()})):this.ui.alert(mxResources.get("redirectToNewApp"),d)}};DrawioFile.prototype.handleFileSuccess=function(b){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(EditorUi.debug("DrawioFile.handleFileSuccess",[this],"saved",b,"modified",this.isModified(),"remoteFileChanged",null==this.sync?"n/a":this.sync.remoteFileChanged),this.isModified()?this.fileChanged():b?(this.isTrashed()?this.ui.updateStatus(mxUtils.bind(this,function(){this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get(this.allChangesSavedKey))+" ("+mxUtils.htmlEntities(mxResources.get("fileMovedToTrash"))+")")})):this.ui.updateStatus(mxUtils.bind(this,function(){this.addAllSavedStatus()})),null!=this.sync&&(this.sync.resetUpdateStatusThread(),this.sync.remoteFileChanged&&(this.sync.remoteFileChanged=!1,this.sync.fileChangedNotify()))):this.ui.clearStatus())};DrawioFile.prototype.handleFileError=function(b,d){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(this.inConflictState?this.handleConflictError(b,d):(this.isModified()&&this.addUnsavedStatus(b),d?this.ui.handleError(b,null!=b?mxResources.get("errorSavingFile"):null):this.isModified()||this.ui.updateStatus(mxUtils.bind(this,function(){var m=this.getErrorMessage(b);null!=m&&60<m.length&&(m=m.substring(0,60)+"...");this.ui.editor.setStatus('<div class="geStatusAlert">'+mxUtils.htmlEntities(mxResources.get("error"))+(null!=m?" ("+mxUtils.htmlEntities(m)+")":"")+"</div>")}))))};-DrawioFile.prototype.handleConflictError=function(b,d){var m=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),p=mxUtils.bind(this,function(y){this.handleFileError(y,!0)}),v=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&(this.ui.clearStatus(),this.save(!0,m,p,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage))}),n=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&-this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&this.save(!0,m,p,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage)}),p)});"none"==DrawioFile.SYNC?this.showCopyDialog(m,p,v):this.invalidChecksum&&d?this.showRefreshDialog(m,p,this.getErrorMessage(b)):d?this.showConflictDialog(v,n):this.addConflictStatus(this.getErrorMessage(b),mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));+DrawioFile.prototype.handleConflictError=function(b,d){var m=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),p=mxUtils.bind(this,function(y){this.handleFileError(y,!0)}),u=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&(this.ui.clearStatus(),this.save(!0,m,p,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage))}),n=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&+this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&this.save(!0,m,p,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage)}),p)});"none"==DrawioFile.SYNC?this.showCopyDialog(m,p,u):this.invalidChecksum&&d?this.showRefreshDialog(m,p,this.getErrorMessage(b)):d?this.showConflictDialog(u,n):this.addConflictStatus(this.getErrorMessage(b),mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));this.synchronizeFile(m,p)}))};DrawioFile.prototype.getErrorMessage=function(b){var d=null!=b?null!=b.error?b.error.message:b.message:null;null==d&&null!=b&&b.code==App.ERROR_TIMEOUT?d=mxResources.get("timeout"):"0"==d&&(d=mxResources.get("noResponse"));return d};DrawioFile.prototype.isOverdue=function(){return null!=this.ageStart&&Date.now()-this.ageStart.getTime()>=this.ui.warnInterval};-DrawioFile.prototype.compressionChanged=function(b){var d=null!=this.ownPages?this.ownPages:this.ui.pages;if(null!=d)for(var m=0;m<d.length;m++){var p=d[m].node;if(null!=p&&(null==this.ui.currentPage||this.ui.currentPage.getId()!=d[m].getId())){var v=p.getElementsByTagName("mxGraphModel");v=0<v.length?v[0]:null;var n=Graph.decompress(mxUtils.getNodeValue(p));b?0==n.length&&null!=v&&(EditorUi.removeChildNodes(p),mxUtils.setTextContent(p,Graph.compressNode(v)),EditorUi.debug("DrawioFile.compressionChanged",-[this],"Page "+m+" compressed")):0<n.length&&null==v&&(EditorUi.removeChildNodes(p),p.appendChild(mxUtils.parseXml(n).documentElement),EditorUi.debug("DrawioFile.compressionChanged",[this],"Page "+m+" decompressed"))}}};DrawioFile.prototype.fileReplaced=function(b){this.inConflictState=this.invalidChecksum=!1;null!=b&&this.patch(b);null!=this.sync&&this.sync.initRealtime();EditorUi.debug("DrawioFile.fileReplaced",[this],"patches",b)};+DrawioFile.prototype.compressionChanged=function(b){var d=null!=this.ownPages?this.ownPages:this.ui.pages;if(null!=d)for(var m=0;m<d.length;m++){var p=d[m].node;if(null!=p&&(null==this.ui.currentPage||this.ui.currentPage.getId()!=d[m].getId())){var u=p.getElementsByTagName("mxGraphModel");u=0<u.length?u[0]:null;var n=Graph.decompress(mxUtils.getNodeValue(p));b?0==n.length&&null!=u&&(EditorUi.removeChildNodes(p),mxUtils.setTextContent(p,Graph.compressNode(u)),EditorUi.debug("DrawioFile.compressionChanged",+[this],"Page "+m+" compressed")):0<n.length&&null==u&&(EditorUi.removeChildNodes(p),p.appendChild(mxUtils.parseXml(n).documentElement),EditorUi.debug("DrawioFile.compressionChanged",[this],"Page "+m+" decompressed"))}}};DrawioFile.prototype.fileReplaced=function(b){this.inConflictState=this.invalidChecksum=!1;null!=b&&this.patch(b);null!=this.sync&&this.sync.initRealtime();EditorUi.debug("DrawioFile.fileReplaced",[this],"patches",b)};DrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=new Date;this.setModified(!0);EditorUi.debug("DrawioFile.fileChanged",[this],"autosaveDelay",this.autosaveDelay,"autosave",this.isAutosave(),"saving",this.savingFile);this.isAutosave()?(null!=this.savingStatusKey&&this.ui.updateStatus(mxUtils.bind(this,function(){this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get(this.savingStatusKey))+"...")})),this.ui.scheduleSanityCheck(),null==this.ageStart&&(this.ageStart=new Date),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(d){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=this.lastChanged)}),mxUtils.bind(this,function(d){this.handleFileError(d)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus());null!=this.sync&&b&&this.sync.localFileChanged()};DrawioFile.prototype.createSecret=function(b){var d=Editor.guid(32);Editor.enableRealtimeCache&&null!=this.sync&&!this.isOptimisticSync()?this.sync.createToken(d,mxUtils.bind(this,function(m){EditorUi.debug("DrawioFile.createSecret",[this],"secret",d,"token",m);b(d,m)}),mxUtils.bind(this,function(){b(d)})):b(d)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};-DrawioFile.prototype.fileSaved=function(b,d,m,p,v,n,y){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;n=null!=n?n:this.ui.getPagesForXml(b,!0);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(n),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=m&&m()):this.sync.fileSaved(n,d,m,p,v,y)}catch(G){this.invalidChecksum=-this.inConflictState=!0;this.descriptorChanged();null!=p&&p(G);try{var C=this.getCurrentUser(),P=null!=C?C.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),P,G)}catch(O){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[d],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(G){this.descriptorChanged(),null!=p&&p(G)}};-DrawioFile.prototype.autosave=function(b,d,m,p){null==this.lastAutosave&&(this.lastAutosave=Date.now());var v=Date.now()-this.lastAutosave<d?b:0;this.clearAutosave();var n=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==n&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",n,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var y=this.isAutosaveRevision();-y&&(this.lastAutosaveRevision=(new Date).getTime());this.save(y,mxUtils.bind(this,function(C){this.autosaveCompleted();null!=m&&m(C)}),mxUtils.bind(this,function(C){null!=p&&p(C)}))}else this.isModified()||this.ui.clearStatus(),null!=m&&m(null)}catch(C){null!=p&&p(C)}}),v);this.autosaveThread=n;EditorUi.debug("DrawioFile.autosave",[this],"thread",n,"delay",b,"maxDelay",d,"actualDelay",v,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};+DrawioFile.prototype.fileSaved=function(b,d,m,p,u,n,y){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;n=null!=n?n:this.ui.getPagesForXml(b,!0);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(n),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=m&&m()):this.sync.fileSaved(n,d,m,p,u,y)}catch(G){this.invalidChecksum=+this.inConflictState=!0;this.descriptorChanged();null!=p&&p(G);try{var B=this.getCurrentUser(),P=null!=B?B.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),P,G)}catch(O){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[d],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(G){this.descriptorChanged(),null!=p&&p(G)}};+DrawioFile.prototype.autosave=function(b,d,m,p){null==this.lastAutosave&&(this.lastAutosave=Date.now());var u=Date.now()-this.lastAutosave<d?b:0;this.clearAutosave();var n=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==n&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",n,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var y=this.isAutosaveRevision();+y&&(this.lastAutosaveRevision=(new Date).getTime());this.save(y,mxUtils.bind(this,function(B){this.autosaveCompleted();null!=m&&m(B)}),mxUtils.bind(this,function(B){null!=p&&p(B)}))}else this.isModified()||this.ui.clearStatus(),null!=m&&m(null)}catch(B){null!=p&&p(B)}}),u);this.autosaveThread=n;EditorUi.debug("DrawioFile.autosave",[this],"thread",n,"delay",b,"maxDelay",d,"actualDelay",u,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var b=(new Date).getTime();return null==this.lastAutosaveRevision||b-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};DrawioFile.prototype.close=function(b){try{this.isAutosave()&&this.isModified()&&(this.updateFileData(),this.save(this.isAutosaveRevision(),null,null,b))}catch(d){}this.stats.closed++;this.destroy()};DrawioFile.prototype.hasSameExtension=function(b,d){if(null!=b&&null!=d){var m=b.lastIndexOf(".");b=0<m?b.substring(m):"";m=d.lastIndexOf(".");return b===(0<m?d.substring(m):"")}return b==d};DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(this.ui.editor.graph.model.removeListener(this.changeListener),this.ui.editor.graph.removeListener(this.changeListener),this.ui.removeListener(this.changeListener),this.changeListener=null)};DrawioFile.prototype.destroy=function(){this.clearAutosave();this.removeListeners();this.stats.destroyed++;null!=this.sync&&(this.sync.destroy(),this.sync=null)};DrawioFile.prototype.commentsSupported=function(){return!1};-DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,d){b([])};DrawioFile.prototype.addComment=function(b,d,m){d(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,d){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,d)};LocalFile=function(b,d,m,p,v,n,y){DrawioFile.call(this,b,d);this.title=m;this.mode=p?null:App.MODE_DEVICE;this.fileHandle=v;this.desc=n;this.editable=y};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};-LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&(null==this.editable||this.editable)};LocalFile.prototype.setEditable=function(b){this.editable=b;this.descriptorChanged()};LocalFile.prototype.save=function(b,d,m,p,v){this.saveAs(this.title,d,m,p,v)};LocalFile.prototype.saveAs=function(b,d,m,p,v){this.saveFile(b,!1,d,m,null,p,v)};+DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,d){b([])};DrawioFile.prototype.addComment=function(b,d,m){d(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,d){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,d)};LocalFile=function(b,d,m,p,u,n,y){DrawioFile.call(this,b,d);this.title=m;this.mode=p?null:App.MODE_DEVICE;this.fileHandle=u;this.desc=n;this.editable=y};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};+LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&(null==this.editable||this.editable)};LocalFile.prototype.setEditable=function(b){this.editable=b;this.descriptorChanged()};LocalFile.prototype.save=function(b,d,m,p,u){this.saveAs(this.title,d,m,p,u)};LocalFile.prototype.saveAs=function(b,d,m,p,u){this.saveFile(b,!1,d,m,null,p,u)};LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b};LocalFile.prototype.getLatestVersion=function(b,d){null==this.fileHandle?null!=d&&d({message:mxResources.get("cannotOpenFile")}):this.ui.loadFileSystemEntry(this.fileHandle,b,d)};-LocalFile.prototype.saveFile=function(b,d,m,p,v,n,y){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;v||this.updateFileData();var C=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var P=this.getData(),G=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=m&&m()}),O=mxUtils.bind(this,function(U){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=-!0;var c=mxUtils.bind(this,function(k){this.savingFile=!1;null!=p&&p({error:k})});this.saveDraft(P);this.fileHandle.createWritable().then(mxUtils.bind(this,function(k){this.fileHandle.getFile().then(mxUtils.bind(this,function(q){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[q],"conflict",this.desc.lastModified!=q.lastModified);y||this.desc.lastModified==q.lastModified?k.write(C?this.ui.base64ToBlob(U,"image/png"):U).then(mxUtils.bind(this,function(){k.close().then(mxUtils.bind(this,-function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(x){try{var B=this.desc;this.savingFile=!1;this.desc=x;this.fileSaved(P,B,G,c);this.removeDraft()}catch(E){c(E)}}),c)}),c)}),c):(this.inConflictState=!0,c())}),mxUtils.bind(this,function(q){this.invalidFileHandle=!0;c(q)}))}),c)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(U,b,C?"image/png":"text/xml",C);else if(U.length<MAX_REQUEST_SIZE){var f=b.lastIndexOf(".");f=0<f?b.substring(f+1):"xml";-(new mxXmlRequest(SAVE_URL,"format="+f+"&xml="+encodeURIComponent(U)+"&filename="+encodeURIComponent(b)+(C?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(U)}));G()}});C?(d=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(U){O(U)}),p,this.ui.getCurrentFile()!=this?P:null,d.scale,d.border)):O(P)};-LocalFile.prototype.rename=function(b,d,m){this.title=b;this.descriptorChanged();null!=d&&d()};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinFormatImage=+LocalFile.prototype.saveFile=function(b,d,m,p,u,n,y){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;if(u||n){u||this.updateFileData();var B=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var P=this.getData(),G=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=m&&m()}),O=mxUtils.bind(this,function(U){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=+!0;var c=mxUtils.bind(this,function(k){this.savingFile=!1;null!=p&&p({error:k})});this.saveDraft(P);this.fileHandle.createWritable().then(mxUtils.bind(this,function(k){this.fileHandle.getFile().then(mxUtils.bind(this,function(q){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[q],"conflict",this.desc.lastModified!=q.lastModified);y||this.desc.lastModified==q.lastModified?k.write(B?this.ui.base64ToBlob(U,"image/png"):U).then(mxUtils.bind(this,function(){k.close().then(mxUtils.bind(this,+function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(x){try{var C=this.desc;this.savingFile=!1;this.desc=x;this.fileSaved(P,C,G,c);this.removeDraft()}catch(E){c(E)}}),c)}),c)}),c):(this.inConflictState=!0,c())}),mxUtils.bind(this,function(q){this.invalidFileHandle=!0;c(q)}))}),c)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(U,b,B?"image/png":"text/xml",B);else if(U.length<MAX_REQUEST_SIZE){var f=b.lastIndexOf(".");f=0<f?b.substring(f+1):"xml";+(new mxXmlRequest(SAVE_URL,"format="+f+"&xml="+encodeURIComponent(U)+"&filename="+encodeURIComponent(b)+(B?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(U)}));G()}});B?(u=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(U){O(U)}),p,this.ui.getCurrentFile()!=this?P:null,u.scale,u.border)):O(P)}else this.loadFonts(mxUtils.bind(this,+function(){this.updateFileData();this.saveFile(b,d,m,p,!0,n,y)}))};LocalFile.prototype.rename=function(b,d,m){this.title=b;this.descriptorChanged();null!=d&&d()};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";Editor.thinGestureImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI4IDQxLjZxLTIuNSAwLTQuMDc1LTEuNjUtMS41NzUtMS42NS0xLjU3NS00LjM1IDAtMi4zNSAxLjEtNC4xIDEuMS0xLjc1IDIuODI1LTIuOTUgMS43MjUtMS4yIDMuNy0xLjgyNVQzMy42NSAyNnEtLjE1LTMuMDUtMS4yNS00LjQyNVQyOS4yNSAyMC4ycS0yLjMgMC00LjE3NSAxLjV0LTQuNDI1IDQuOTVxLTIuNjUgMy40NS00LjYgNS4xLTEuOTUgMS42NS00LjM1IDEuNjUtMi4xIDAtMy42NS0xLjM3NVE2LjUgMzAuNjUgNi41IDI3LjQ1cTAtMiAxLjItNC41MjUgMS4yLTIuNTI1IDMuNS02LjE3NSAxLjMtMS44NSAxLjk3NS0zLjIyNXQuNjc1LTIuMzc1cTAtLjctLjM1LTEuMDUtLjM1LS4zNS0xLjA1LS4zNS0uNzUgMC0xLjYuNDc1UTEwIDEwLjcgOSAxMS45TDcgOS44cTEuMzUtMS41NSAyLjcyNS0yLjI3NVExMS4xIDYuOCAxMi41IDYuOHExLjkgMCAzLjEgMS4yNSAxLjIgMS4yNSAxLjIgMy4yIDAgMS44LS45NzUgMy41NzVRMTQuODUgMTYuNiAxMy4wNSAxOS4zcS0xLjk1IDIuOTUtMi43NzUgNC43dC0uODI1IDMuNjVxMCAxLjYuNzUgMi4yLjc1LjYgMS43NS42IDEuNDUgMCAyLjgyNS0xLjMgMS4zNzUtMS4zIDMuNTc1LTQuMTUgMi45NS0zLjggNS41MjUtNS43NzUgMi41NzUtMS45NzUgNS42NzUtMS45NzUgMy4xNSAwIDUgMi4zMjVUMzYuNiAyNS45aDQuOXYyLjk1aC00LjlxLS40NSA3LjM1LTMuMiAxMC4wNS0yLjc1IDIuNy01LjQgMi43Wm0uMS0yLjk1cTEuODUgMCAzLjY1LTIuMjUgMS44LTIuMjUgMi03LjUtMi44LjE1LTUuNjI1IDIuMDI1VDI1LjMgMzUuOXEwIDEuMy43NSAyLjAyNS43NS43MjUgMi4wNS43MjVaIi8+PC9zdmc+";Editor.thinShapesImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI5Ljc1IDI5Ljc1Wm0tMTMgNS40NXEuNC4wNS43NS4wNUgxOS4wNXY0LjY1cTAgLjI1LjE3NS40MjV0LjQyNS4xNzVIMzkuOXEuMjUgMCAuNDI1LS4xNzV0LjE3NS0uNDI1VjE5LjY1cTAtLjI1LS4xNzUtLjQyNXQtLjQyNS0uMTc1aC00LjY1VjE3LjVxMC0uMzUtLjA1LS43NWg0LjdxMS4xNSAwIDIgLjg3NS44NS44NzUuODUgMi4wMjVWMzkuOXEwIDEuMTUtLjg1IDItLjg1Ljg1LTIgLjg1SDE5LjY1cS0xLjE1IDAtMi4wMjUtLjg1dC0uODc1LTJabTEuNS0zLjk1cS01LjQ1IDAtOS4yMjUtMy44LTMuNzc1LTMuOC0zLjc3NS05LjIgMC01LjQ1IDMuNzc1LTkuMjI1UTEyLjggNS4yNSAxOC4yNSA1LjI1cTUuNCAwIDkuMiAzLjc3NSAzLjggMy43NzUgMy44IDkuMjI1IDAgNS40LTMuOCA5LjItMy44IDMuOC05LjIgMy44Wm0tLjA1LTIuM3E0LjQ1IDAgNy42LTMuMTI1IDMuMTUtMy4xMjUgMy4xNS03LjU3NXQtMy4xMjUtNy42UTIyLjcgNy41IDE4LjI1IDcuNXQtNy42IDMuMTI1UTcuNSAxMy43NSA3LjUgMTguMnQzLjEyNSA3LjZxMy4xMjUgMy4xNSA3LjU3NSAzLjE1Wm0uMDUtMTAuN1oiLz48L3N2Zz4=";@@ -3655,26 +3657,26 @@ Editor.jpgSupported=!1;Editor.webpSupported=!1;(function(){try{var l=document.crH.type="text/css";var J=H.appendChild,R=document,T=R.createTextNode;t=t.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(t=t.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(Y){}J.call(H,T.call(R,t));document.head.appendChild(H)}}))};Editor.replacePlaceholders=function(l,t){var H=[];if(null!=l&&null!=t){for(var J=RegExp("{([^{}\"'=;]+)}","g"),R,T=0;R=J.exec(l);){var Y=R[0];if(2<Y.length){var Z=t(Y.substring(1,Y.length-1)),ia=Y;null!=Z&&(ia=Z);H.push(l.substring(T,R.index)+ia);T=R.index+Y.length}}H.push(l.substring(T))}return H.join("")};Editor.executeSimpleJsonPath=function(l,t){t=t.replace(/^\$\.?/,"").split(".");t=$jscomp.makeIterator(t);for(var H=t.next();!H.done;H=t.next()){var J=H.value;if(!l)return[];if(H=J.match(/([^\[]+)\[(\d+)\]/))if(J=H[1],H=parseInt(H[2]),l=l[J],Array.isArray(l)&&H<l.length)l=l[H];else return[];else l=l[J]}return void 0!==l?[l]:[]};Editor.createRoughCanvas=function(l){var t=rough.canvas({getContext:function(){return l}});t.draw=function(H){var J=H.sets||[];H=H.options||this.getDefaultOptions();for(var R=0;R<J.length;R++){var T=J[R];switch(T.type){case "path":null!=H.stroke&&this._drawToContext(l,T,H);break;case "fillPath":this._drawToContext(l,T,H);break;case "fillSketch":this.fillSketch(l,T,H)}}};t.fillSketch=function(H,J,R){var T=-l.state.strokeColor,Y=l.state.strokeWidth,Z=l.state.strokeAlpha,ia=l.state.dashed,ka=R.fillWeight;0>ka&&(ka=R.strokeWidth/2);l.setStrokeAlpha(l.state.fillAlpha);l.setStrokeColor(R.fill||"");l.setStrokeWidth(ka);l.setDashed(!1);ka=null!=H.root?H.root.lastChild:null;this._drawToContext(H,J,R);null!=H.root&&null!=H.root.lastChild&&H.root.lastChild!=ka&&"path"==H.root.lastChild.nodeName&&H.root.lastChild.setAttribute("data-rough-fill","1");l.setDashed(ia);l.setStrokeWidth(Y);l.setStrokeColor(T);l.setStrokeAlpha(Z)};+l.state.strokeColor,Y=l.state.strokeWidth,Z=l.state.strokeAlpha,ia=l.state.dashed,ja=R.fillWeight;0>ja&&(ja=R.strokeWidth/2);l.setStrokeAlpha(l.state.fillAlpha);l.setStrokeColor(R.fill||"");l.setStrokeWidth(ja);l.setDashed(!1);ja=null!=H.root?H.root.lastChild:null;this._drawToContext(H,J,R);null!=H.root&&null!=H.root.lastChild&&H.root.lastChild!=ja&&"path"==H.root.lastChild.nodeName&&H.root.lastChild.setAttribute("data-rough-fill","1");l.setDashed(ia);l.setStrokeWidth(Y);l.setStrokeColor(T);l.setStrokeAlpha(Z)};t._drawToContext=function(H,J,R){H.begin();for(var T=0;T<J.ops.length;T++){var Y=J.ops[T],Z=Y.data;switch(Y.op){case "move":H.moveTo(Z[0],Z[1]);break;case "bcurveTo":H.curveTo(Z[0],Z[1],Z[2],Z[3],Z[4],Z[5]);break;case "lineTo":H.lineTo(Z[0],Z[1])}}H.end();"fillPath"===J.type&&R.filled?H.fill():H.stroke()};return t};(function(){function l(T,Y,Z){this.canvas=T;this.rc=Y;this.shape=Z;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,l.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,l.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,l.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,l.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,l.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,l.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,l.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,l.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,l.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,l.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,l.prototype.close);this.originalFill=this.canvas.fill;this.canvas.fill=mxUtils.bind(this,l.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,l.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;this.canvas.fillAndStroke=mxUtils.bind(this,l.prototype.fillAndStroke);this.path=[];this.passThrough=!1}l.prototype.moveOp="M";l.prototype.lineOp="L";l.prototype.quadOp="Q";l.prototype.curveOp="C";l.prototype.closeOp="Z";l.prototype.getStyle=function(T,Y){var Z=1;if(null!=this.shape.state){var ia=this.shape.state.cell.id;-if(null!=ia)for(var ka=0;ka<ia.length;ka++)Z=(Z<<5)-Z+ia.charCodeAt(ka)<<0}Z={strokeWidth:this.canvas.state.strokeWidth,seed:Z,preserveVertices:!0};ia=this.rc.getDefaultOptions();Z.stroke=T?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;T=null;(Z.filled=Y)?(Z.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,T=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):Z.fill=+if(null!=ia)for(var ja=0;ja<ia.length;ja++)Z=(Z<<5)-Z+ia.charCodeAt(ja)<<0}Z={strokeWidth:this.canvas.state.strokeWidth,seed:Z,preserveVertices:!0};ia=this.rc.getDefaultOptions();Z.stroke=T?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;T=null;(Z.filled=Y)?(Z.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,T=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):Z.fill="";Z.bowing=mxUtils.getValue(this.shape.style,"bowing",ia.bowing);Z.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",ia.hachureAngle);Z.curveFitting=mxUtils.getValue(this.shape.style,"curveFitting",ia.curveFitting);Z.roughness=mxUtils.getValue(this.shape.style,"jiggle",ia.roughness);Z.simplification=mxUtils.getValue(this.shape.style,"simplification",ia.simplification);Z.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",ia.disableMultiStroke);Z.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",ia.disableMultiStrokeFill);Y=mxUtils.getValue(this.shape.style,"hachureGap",-1);Z.hachureGap="auto"==Y?-1:Y;Z.dashGap=mxUtils.getValue(this.shape.style,"dashGap",Y);Z.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",Y);Z.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",Y);Y=mxUtils.getValue(this.shape.style,"fillWeight",-1);Z.fillWeight="auto"==Y?-1:Y;Y=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==Y&&-(Y="auto");if("auto"==Y){var X=mxUtils.lightDarkColorSupported?Editor.isDarkMode():mxUtils.preferDarkColor;Y=function(ja){mxUtils.isLightDarkColor(ja)&&(ja=mxUtils.parseLightDarkColor(ja),ja=X?ja.dark:ja.light);return mxUtils.hex2rgb(ja)};ka=[Y("#ffffff")];null!=this.shape.state&&ka.push(Y(this.shape.state.view.graph.shapeBackgroundColor));Editor.isDarkMode()&&ka.push(Y(Editor.darkColor));Y=null!=Z.fill&&(null!=T||0<=mxUtils.indexOf(ka,Y(Z.fill)))?"solid":ia.fillStyle}Z.fillStyle=Y;return Z};l.prototype.begin=+(Y="auto");if("auto"==Y){var X=mxUtils.lightDarkColorSupported?Editor.isDarkMode():mxUtils.preferDarkColor;Y=function(ka){mxUtils.isLightDarkColor(ka)&&(ka=mxUtils.parseLightDarkColor(ka),ka=X?ka.dark:ka.light);return mxUtils.hex2rgb(ka)};ja=[Y("#ffffff")];null!=this.shape.state&&ja.push(Y(this.shape.state.view.graph.shapeBackgroundColor));Editor.isDarkMode()&&ja.push(Y(Editor.darkColor));Y=null!=Z.fill&&(null!=T||0<=mxUtils.indexOf(ja,Y(Z.fill)))?"solid":ia.fillStyle}Z.fillStyle=Y;return Z};l.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};l.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};l.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var T=2;T<arguments.length;T+=2)this.lastX=arguments[T-1],this.lastY=arguments[T],this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};l.prototype.lineTo=function(T,Y){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,T,Y),this.lastX=T,this.lastY=Y)};l.prototype.moveTo=function(T,Y){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,T,Y),this.lastX=T,this.lastY=Y,this.firstX=T,this.firstY=Y)};l.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,arguments):this.addOp(this.closeOp)};l.prototype.quadTo=function(T,Y,Z,ia){this.passThrough?this.originalQuadTo.apply(this.canvas,-arguments):(this.addOp(this.quadOp,T,Y,Z,ia),this.lastX=Z,this.lastY=ia)};l.prototype.curveTo=function(T,Y,Z,ia,ka,X){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,T,Y,Z,ia,ka,X),this.lastX=ka,this.lastY=X)};l.prototype.arcTo=function(T,Y,Z,ia,ka,X,ja){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var na=mxUtils.arcToCurves(this.lastX,this.lastY,T,Y,Z,ia,ka,X,ja);if(null!=na)for(var la=0;la<na.length;la+=6)this.curveTo(na[la],-na[la+1],na[la+2],na[la+3],na[la+4],na[la+5]);this.lastX=X;this.lastY=ja}};l.prototype.rect=function(T,Y,Z,ia){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(T,Y,Z,ia,this.getStyle(!0,!0)))};l.prototype.ellipse=function(T,Y,Z,ia){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(T+Z/2,Y+ia/2,Z,ia,this.getStyle(!0,!0)))};l.prototype.roundrect=function(T,-Y,Z,ia,ka,X){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(T+ka,Y),this.lineTo(T+Z-ka,Y),this.quadTo(T+Z,Y,T+Z,Y+X),this.lineTo(T+Z,Y+ia-X),this.quadTo(T+Z,Y+ia,T+Z-ka,Y+ia),this.lineTo(T+ka,Y+ia),this.quadTo(T,Y+ia,T,Y+ia-X),this.lineTo(T,Y+X),this.quadTo(T,Y,T+ka,Y))};l.prototype.drawPath=function(T){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),T)}catch(Z){}this.passThrough=!1}else if(null!=this.nextShape){for(var Y in T)this.nextShape.options[Y]=+arguments):(this.addOp(this.quadOp,T,Y,Z,ia),this.lastX=Z,this.lastY=ia)};l.prototype.curveTo=function(T,Y,Z,ia,ja,X){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,T,Y,Z,ia,ja,X),this.lastX=ja,this.lastY=X)};l.prototype.arcTo=function(T,Y,Z,ia,ja,X,ka){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var na=mxUtils.arcToCurves(this.lastX,this.lastY,T,Y,Z,ia,ja,X,ka);if(null!=na)for(var la=0;la<na.length;la+=6)this.curveTo(na[la],+na[la+1],na[la+2],na[la+3],na[la+4],na[la+5]);this.lastX=X;this.lastY=ka}};l.prototype.rect=function(T,Y,Z,ia){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(T,Y,Z,ia,this.getStyle(!0,!0)))};l.prototype.ellipse=function(T,Y,Z,ia){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(T+Z/2,Y+ia/2,Z,ia,this.getStyle(!0,!0)))};l.prototype.roundrect=function(T,+Y,Z,ia,ja,X){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(T+ja,Y),this.lineTo(T+Z-ja,Y),this.quadTo(T+Z,Y,T+Z,Y+X),this.lineTo(T+Z,Y+ia-X),this.quadTo(T+Z,Y+ia,T+Z-ja,Y+ia),this.lineTo(T+ja,Y+ia),this.quadTo(T,Y+ia,T,Y+ia-X),this.lineTo(T,Y+X),this.quadTo(T,Y,T+ja,Y))};l.prototype.drawPath=function(T){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),T)}catch(Z){}this.passThrough=!1}else if(null!=this.nextShape){for(var Y in T)this.nextShape.options[Y]=T[Y];T.stroke!=mxConstants.NONE&&null!=T.stroke||delete this.nextShape.options.stroke;T.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};l.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};l.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};l.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};l.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo;this.canvas.close=this.originalClose;this.canvas.fill=this.originalFill;this.canvas.stroke=this.originalStroke;this.canvas.fillAndStroke=this.originalFillAndStroke;this.canvas.begin=this.originalBegin;this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(T){return new l(T,Editor.createRoughCanvas(T),this)};var t=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(T){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?t.apply(this,arguments):"comic"==mxUtils.getValue(this.style,-"sketchStyle","rough")?this.createComicCanvas(T):this.createRoughCanvas(T)};var H=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(T,Y,Z,ia,ka){null!=T.handJiggle&&T.handJiggle.passThrough||H.apply(this,arguments)};var J=mxShape.prototype.paint;mxShape.prototype.paint=function(T){var Y=T.addTolerance,Z=!0;null!=this.style&&(Z="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=T.handJiggle&&T.handJiggle.constructor==l&&!this.outline){T.save();-var ia=this.fill,ka=this.stroke;this.stroke=this.fill=null;var X=this.configurePointerEvents,ja=T.setStrokeColor;T.setStrokeColor=function(){};var na=T.setFillColor;T.setFillColor=function(){};Z||null==ia||(this.configurePointerEvents=function(){});T.handJiggle.passThrough=!0;J.apply(this,arguments);T.handJiggle.passThrough=!1;T.setFillColor=na;T.setStrokeColor=ja;this.configurePointerEvents=X;this.stroke=ka;this.fill=ia;T.restore();Z&&null!=ia&&(T.addTolerance=function(){})}J.apply(this,arguments);-T.addTolerance=Y};var R=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(T,Y,Z,ia,ka,X){null!=T.handJiggle&&T.handJiggle.constructor==l?(T.handJiggle.passThrough=!0,R.apply(this,arguments),T.handJiggle.passThrough=!1):R.apply(this,arguments)}})();Editor.fastCompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?l:Graph.arrayBufferToString(pako.deflateRaw(l))};Editor.fastDecompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?+"sketchStyle","rough")?this.createComicCanvas(T):this.createRoughCanvas(T)};var H=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(T,Y,Z,ia,ja){null!=T.handJiggle&&T.handJiggle.passThrough||H.apply(this,arguments)};var J=mxShape.prototype.paint;mxShape.prototype.paint=function(T){var Y=T.addTolerance,Z=!0;null!=this.style&&(Z="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=T.handJiggle&&T.handJiggle.constructor==l&&!this.outline){T.save();+var ia=this.fill,ja=this.stroke;this.stroke=this.fill=null;var X=this.configurePointerEvents,ka=T.setStrokeColor;T.setStrokeColor=function(){};var na=T.setFillColor;T.setFillColor=function(){};Z||null==ia||(this.configurePointerEvents=function(){});T.handJiggle.passThrough=!0;J.apply(this,arguments);T.handJiggle.passThrough=!1;T.setFillColor=na;T.setStrokeColor=ka;this.configurePointerEvents=X;this.stroke=ja;this.fill=ia;T.restore();Z&&null!=ia&&(T.addTolerance=function(){})}J.apply(this,arguments);+T.addTolerance=Y};var R=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(T,Y,Z,ia,ja,X){null!=T.handJiggle&&T.handJiggle.constructor==l?(T.handJiggle.passThrough=!0,R.apply(this,arguments),T.handJiggle.passThrough=!1):R.apply(this,arguments)}})();Editor.fastCompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?l:Graph.arrayBufferToString(pako.deflateRaw(l))};Editor.fastDecompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?l:pako.inflateRaw(Graph.stringToArrayBuffer(atob(l)),{to:"string"})};Editor.extractGraphModel=function(l,t,H){if(null!=l&&"undefined"!==typeof pako){var J=l.ownerDocument.getElementsByTagName("div"),R=[];if(null!=J&&0<J.length)for(var T=0;T<J.length;T++)if("mxgraph"==J[T].getAttribute("class")){R.push(J[T]);break}0<R.length&&(J=R[0].getAttribute("data-mxgraph"),null!=J?(R=JSON.parse(J),null!=R&&null!=R.xml&&(l=mxUtils.parseXml(R.xml),l=l.documentElement)):(R=R[0].getElementsByTagName("div"),0<R.length&&(J=mxUtils.getTextContent(R[0]),J=Graph.decompress(J,null,H),0<J.length&&(l=mxUtils.parseXml(J),l=l.documentElement))))}if(null!=l&&"svg"==l.nodeName)if(J=l.getAttribute("content"),null!=J&&"<"!=J.charAt(0)&&"%"!=J.charAt(0)&&(J=unescape(window.atob?atob(J):Base64.decode(cont,J))),null!=J&&"%"==J.charAt(0)&&(J=decodeURIComponent(J)),null!=J&&0<J.length)l=mxUtils.parseXml(J).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==l||t||(R=null,"diagram"==l.nodeName?R=l:"mxfile"==l.nodeName&&(J=l.getElementsByTagName("diagram"),0<J.length&&(R=J[Math.max(0,Math.min(J.length-1,urlParams.page||0))])),null!=R&&(l=Editor.parseDiagramNode(R,H)));null==l||"mxGraphModel"==l.nodeName||t&&"mxfile"==l.nodeName||(l=null);return l};Editor.parseDiagramNode=function(l,t,H){Editor.validateDiagramNode(l);var J=mxUtils.trim(mxUtils.getTextContent(l)),R=null;0<J.length?(t=Graph.decompress(J,null,t),null!=t&&0<t.length&&(R=mxUtils.parseXml(t).documentElement)):(l=mxUtils.getChildNodes(l),0<l.length&&@@ -3706,11 +3708,11 @@ l.foreignObjectImages);null!=l.embedSvgFonts&&(Editor.embedSvgFonts=l.embedSvgFo(Editor.insertAnimations=l.insertAnimations);null!=l.enableWindowDocking&&(Editor.enableWindowDocking=l.enableWindowDocking);null!=l.compact&&(EditorUi.prototype.defaultCompact=l.compact);null!=l.noAutoFocus&&(EditorUi.prototype.noAutoFocus=l.noAutoFocus);if(null!=l.hideMenuItems)if(Array.isArray(l.hideMenuItems))for(Menus.prototype.hiddenMenuItems={},t=0;t<l.hideMenuItems.length;t++)Menus.prototype.hiddenMenuItems[l.hideMenuItems[t]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");if(null!=l.hideMenus)if(Array.isArray(l.hideMenus)){var J={};for(t=0;t<l.hideMenus.length;t++)J[l.hideMenus[t]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(R){return!J[R]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=l.enableAi&&(Editor.enableAi=l.enableAi);null!=l.enableChatGpt&&(Editor.enableAi=l.enableChatGpt);null!=l.gptApiKey&&(Editor.aiGlobals.gptApiKey=l.gptApiKey);null!=l.geminiApiKey&&(Editor.aiGlobals.geminiApiKey=l.geminiApiKey);null!=l.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=l.claudeApiKey);null!=l.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=l.gptUrl);null!=l.aiActions&&(Editor.aiActions=l.aiActions);null!=l.aiGlobals&&(Editor.aiGlobals=l.aiGlobals);null!=l.aiConfigs&&(Editor.aiConfigs=l.aiConfigs);null!=l.aiModels&&(Editor.aiModels=l.aiModels)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.expandSvgPatterns=-function(l){function t(ia,ka){ia=ia.getAttribute("fill");if(null==ia||0!==ia.indexOf("url("))return null;ia=ia.match(/url\([^#]*#([^)"]+)\)?/);if(null==ia)return null;ia=ia[1];try{var X=ka.querySelector("#"+CSS.escape(ia));return null!=X&&"pattern"===X.nodeName?X:null}catch(ja){return null}}function H(ia,ka,X){var ja,na,la;try{var va=ia.getBBox()}catch(Ka){return}if(0!==va.width&&0!==va.height){var za=parseFloat(ka.getAttribute("width")),sa=parseFloat(ka.getAttribute("height"));if(!(isNaN(za)||isNaN(sa)||-0>=za||0>=sa)){var wa=ka.getAttribute("patternTransform");var Ca=na=ja=0;var Fa=la=1;if(null!=wa){var Ha=wa.match(/translate\(\s*([^,\s]+)[,\s]+([^)]+)\)/);null!=Ha&&(ja=parseFloat(Ha[1]),na=parseFloat(Ha[2]));Ha=wa.match(/rotate\(\s*([^)]+)\)/);null!=Ha&&(Ca=parseFloat(Ha[1])*Math.PI/180);wa=wa.match(/scale\(\s*([^,\s)]+)(?:[,\s]+([^)]+))?\)/);null!=wa&&(la=parseFloat(wa[1]),Fa=null!=wa[2]?parseFloat(wa[2]):la)}var Na=[{x:va.x,y:va.y},{x:va.x+va.width,y:va.y},{x:va.x+va.width,y:va.y+va.height},{x:va.x,-y:va.y+va.height}],La=Infinity;va=Infinity;Ha=wa=-Infinity;for(var Da=0;Da<Na.length;Da++){var Sa=Na[Da].x-ja;var Oa=Na[Da].y-na,Ta=Math.cos(-Ca),Ua=Math.sin(-Ca);var Ba=(Sa*Ta-Oa*Ua)/la;Sa=(Sa*Ua+Oa*Ta)/Fa;La=Math.min(La,Ba);va=Math.min(va,Sa);wa=Math.max(wa,Ba);Ha=Math.max(Ha,Sa)}La=Math.floor(La/za)-1;va=Math.floor(va/sa)-1;wa=Math.ceil(wa/za)+1;Ba=Math.ceil(Ha/sa)+1;if(!(1E4<(wa-La)*(Ba-va))){Da=R+ ++J;Ha=X.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");Ha.setAttribute("id",+function(l){function t(ia,ja){ia=ia.getAttribute("fill");if(null==ia||0!==ia.indexOf("url("))return null;ia=ia.match(/url\([^#]*#([^)"]+)\)?/);if(null==ia)return null;ia=ia[1];try{var X=ja.querySelector("#"+CSS.escape(ia));return null!=X&&"pattern"===X.nodeName?X:null}catch(ka){return null}}function H(ia,ja,X){var ka,na,la;try{var ua=ia.getBBox()}catch(Ka){return}if(0!==ua.width&&0!==ua.height){var za=parseFloat(ja.getAttribute("width")),sa=parseFloat(ja.getAttribute("height"));if(!(isNaN(za)||isNaN(sa)||+0>=za||0>=sa)){var wa=ja.getAttribute("patternTransform");var Ca=na=ka=0;var Fa=la=1;if(null!=wa){var Ha=wa.match(/translate\(\s*([^,\s]+)[,\s]+([^)]+)\)/);null!=Ha&&(ka=parseFloat(Ha[1]),na=parseFloat(Ha[2]));Ha=wa.match(/rotate\(\s*([^)]+)\)/);null!=Ha&&(Ca=parseFloat(Ha[1])*Math.PI/180);wa=wa.match(/scale\(\s*([^,\s)]+)(?:[,\s]+([^)]+))?\)/);null!=wa&&(la=parseFloat(wa[1]),Fa=null!=wa[2]?parseFloat(wa[2]):la)}var Na=[{x:ua.x,y:ua.y},{x:ua.x+ua.width,y:ua.y},{x:ua.x+ua.width,y:ua.y+ua.height},{x:ua.x,+y:ua.y+ua.height}],La=Infinity;ua=Infinity;Ha=wa=-Infinity;for(var Da=0;Da<Na.length;Da++){var Sa=Na[Da].x-ka;var Oa=Na[Da].y-na,Ta=Math.cos(-Ca),Ua=Math.sin(-Ca);var Ba=(Sa*Ta-Oa*Ua)/la;Sa=(Sa*Ua+Oa*Ta)/Fa;La=Math.min(La,Ba);ua=Math.min(ua,Sa);wa=Math.max(wa,Ba);Ha=Math.max(Ha,Sa)}La=Math.floor(La/za)-1;ua=Math.floor(ua/sa)-1;wa=Math.ceil(wa/za)+1;Ba=Math.ceil(Ha/sa)+1;if(!(1E4<(wa-La)*(Ba-ua))){Da=R+ ++J;Ha=X.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");Ha.setAttribute("id",Da);Na=ia.cloneNode(!0);Na.removeAttribute("fill");Na.removeAttribute("fill-opacity");Na.removeAttribute("stroke");Na.removeAttribute("stroke-width");Na.removeAttribute("stroke-opacity");Na.removeAttribute("style");Na.removeAttribute("pointer-events");Na.setAttribute("fill","black");Ha.appendChild(Na);Na=X.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");Na.setAttribute("clip-path","url(#"+Da+")");Da=ia.getAttribute("fill-opacity");null!=Da&&Na.setAttribute("opacity",Da);Da=X.ownerDocument.createElementNS("http://www.w3.org/2000/svg",-"g");Da.setAttribute("transform","translate("+ja+","+na+")"+(0!==Ca?" rotate("+180*Ca/Math.PI+")":"")+" scale("+la+(Fa!==la?","+Fa:"")+")");ka=ka.childNodes;for(ja=La;ja<wa;ja++)for(na=va;na<Ba;na++){Ca=X.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");Ca.setAttribute("transform","translate("+ja*za+","+na*sa+")");for(la=0;la<ka.length;la++)1===ka[la].nodeType&&Ca.appendChild(ka[la].cloneNode(!0));Da.appendChild(Ca)}Na.appendChild(Da);za=X.querySelector("defs");null==za&&(za=X.ownerDocument.createElementNS("http://www.w3.org/2000/svg",+"g");Da.setAttribute("transform","translate("+ka+","+na+")"+(0!==Ca?" rotate("+180*Ca/Math.PI+")":"")+" scale("+la+(Fa!==la?","+Fa:"")+")");ja=ja.childNodes;for(ka=La;ka<wa;ka++)for(na=ua;na<Ba;na++){Ca=X.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");Ca.setAttribute("transform","translate("+ka*za+","+na*sa+")");for(la=0;la<ja.length;la++)1===ja[la].nodeType&&Ca.appendChild(ja[la].cloneNode(!0));Da.appendChild(Ca)}Na.appendChild(Da);za=X.querySelector("defs");null==za&&(za=X.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs"),X.insertBefore(za,X.firstChild));za.appendChild(Ha);ia.parentNode.insertBefore(Na,ia.nextSibling);ia.setAttribute("fill","none");ia.style.fill=""}}}}for(var J=0,R="expand-pattern-clip-"+Editor.guid(8)+"-",T=l.querySelectorAll('[fill^="url("]'),Y=0;Y<T.length;Y++){var Z=t(T[Y],l);null!=Z&&H(T[Y],Z,l)}T=l.querySelectorAll("[style]");for(Y=0;Y<T.length;Y++)Z=T[Y].getAttribute("style"),null!=Z&&-1!==Z.indexOf("url(")&&(Z=t(T[Y],l),null!=Z&&H(T[Y],Z,l))};Editor.configureFontCss=function(l){if(null!=l){Editor.prototype.fontCss=l;var t=document.getElementsByTagName("script")[0];if(null!=t&&null!=t.parentNode){var H=document.createElement("style");H.setAttribute("type","text/css");H.appendChild(document.createTextNode(l));t.parentNode.insertBefore(H,t);l=l.split("url(");for(H=1;H<l.length;H++){var J=l[H].indexOf(")");J=Editor.trimCssUrl(l[H].substring(0,J));var R=document.createElement("link");R.setAttribute("rel","preload");R.setAttribute("href",J);R.setAttribute("as","font");R.setAttribute("crossorigin","");t.parentNode.insertBefore(R,t)}}}};Editor.trimCssUrl=function(l){return l.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=20;Editor.guid=function(l){l=null!=l?l:Editor.GUID_LENGTH;for(var t=[],H=0;H<l;H++)t.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*@@ -3726,247 +3728,248 @@ Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.ma!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(l,t){if("undefined"===typeof window.MathJax){var H=function(){J=null;Editor.mathJaxRendering=!1;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};l=null!=l?l:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var J=null;Editor.mathJaxRendering=!1;Editor.doMathJaxRender=function(Y){null!=MathJax.startup&&null!=MathJax.startup.output&&null!=MathJax.startup.output.options&&null!=MathJax.startup.output.options.linebreaks&&(MathJax.startup.output.options.linebreaks.inline=!1);try{null==J?(MathJax.typesetClear([Y]),MathJax.typeset([Y]),H()):J!=Y&&Editor.mathJaxQueue.push(Y)}catch(Z){MathJax.typesetClear([Y]),null!=Z.retry?(J=Y,Editor.mathJaxRendering=!0,Z.retry.then(function(){MathJax.typesetPromise([Y]).then(H)["catch"](function(ia){console.log("Error in MathJax.typesetPromise: "+ia.toString());H()})})["catch"](function(ia){console.log("Error in MathJax.retry: "+ia.toString());H()})):null!=window.console&&console.log("Error in MathJax.typeset: "+Z.toString())}};window.MathJax=null!=t?t:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe"],paths:{fonts:DRAW_MATH_URL+"/fonts"}},output:{font:"mathjax-tex"},startup:{pageReady:function(){for(var Y=0;Y<Editor.mathJaxQueue.length;Y++)Editor.doMathJaxRender(Editor.mathJaxQueue[Y])}}};-Editor.MathJaxRender=function(Y){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(Y):Editor.mathJaxQueue.push(Y)};Editor.onMathJaxDone=function(){};var R=Editor.prototype.init;Editor.prototype.init=function(){R.apply(this,arguments);var Y=mxUtils.bind(this,function(ka,X){null!=this.graph.container&&this.graph.mathEnabled&&(Editor.mathOutputSize&&(this.graph.container.style.visibility="hidden"),Editor.MathJaxRender(this.graph.container))});this.graph.model.addListener(mxEvent.CHANGE,+Editor.MathJaxRender=function(Y){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(Y):Editor.mathJaxQueue.push(Y)};Editor.onMathJaxDone=function(){};var R=Editor.prototype.init;Editor.prototype.init=function(){R.apply(this,arguments);var Y=mxUtils.bind(this,function(ja,X){null!=this.graph.container&&this.graph.mathEnabled&&(Editor.mathOutputSize&&(this.graph.container.style.visibility="hidden"),Editor.MathJaxRender(this.graph.container))});this.graph.model.addListener(mxEvent.CHANGE,Y);this.graph.addListener(mxEvent.REFRESH,Y);var Z=this.graph,ia=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){null!=ia&&ia.apply(this,arguments);Editor.mathOutputSize&&null!=Z&&Z.mathEnabled&&(Z.refreshMathBounds(),null!=Z.container&&(Z.container.style.visibility=""))}};t=document.getElementsByTagName("script");if(null!=t&&0<t.length){var T=document.createElement("script");T.setAttribute("type","text/javascript");T.setAttribute("src",l);t[0].parentNode.appendChild(T)}}};Editor.containsMath=function(l){return null!=l&&(0<=l.indexOf("$")||0<=l.indexOf("\\(")||0<=l.indexOf("\\[")||0<=l.indexOf("\\begin{"))};(function(){var l=Graph.prototype.getPreferredSizeForCell,t=null;Graph.prototype.getPreferredSizeForCell=function(H,J,R){if(!Editor.mathOutputSize||!this.mathEnabled||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||this.model.isEdge(H))return l.apply(this,arguments);var T=this.view.createState(H);T=null!=T?this.cellRenderer.getLabelValue(T):null;if(null==T||0===T.length||-!Editor.containsMath(T))return l.apply(this,arguments);var Y=mxUtils.getSizeForString;mxUtils.getSizeForString=function(Z,ia,ka,X){null==t&&(t=document.createElement("div"),t.style.cssText="position:absolute;visibility:hidden;left:-10000px;top:-10000px;display:inline-block;",document.body.appendChild(t));t.style.fontSize=ia+"px";t.style.fontFamily=ka;null!=X&&0<X?(t.style.width=X+"px",t.style.whiteSpace="normal"):(t.style.width="",t.style.whiteSpace="nowrap");MathJax.typesetClear([t]);t.innerHTML=-Graph.sanitizeHtml(Z);try{MathJax.typeset([t]);var ja=t.getBoundingClientRect();return new mxRectangle(0,0,ja.width,ja.height)}catch(na){return Y.apply(this,arguments)}};try{return l.apply(this,arguments)}finally{mxUtils.getSizeForString=Y}}})();Graph.prototype.refreshMathBounds=function(){if(Editor.mathOutputSize&&this.mathEnabled){var l=this.view,t=!1;l.states.visit(mxUtils.bind(this,function(J,R){null!=R&&null!=R.text&&(J=this.cellRenderer.getLabelValue(R),"string"===typeof J&&Editor.containsMath(J)&&+!Editor.containsMath(T))return l.apply(this,arguments);var Y=mxUtils.getSizeForString;mxUtils.getSizeForString=function(Z,ia,ja,X){null==t&&(t=document.createElement("div"),t.style.cssText="position:absolute;visibility:hidden;left:-10000px;top:-10000px;display:inline-block;",document.body.appendChild(t));t.style.fontSize=ia+"px";t.style.fontFamily=ja;null!=X&&0<X?(t.style.width=X+"px",t.style.whiteSpace="normal"):(t.style.width="",t.style.whiteSpace="nowrap");MathJax.typesetClear([t]);t.innerHTML=+Graph.sanitizeHtml(Z);try{MathJax.typeset([t]);var ka=t.getBoundingClientRect();return new mxRectangle(0,0,ka.width,ka.height)}catch(na){return Y.apply(this,arguments)}};try{return l.apply(this,arguments)}finally{mxUtils.getSizeForString=Y}}})();Graph.prototype.refreshMathBounds=function(){if(Editor.mathOutputSize&&this.mathEnabled){var l=this.view,t=!1;l.states.visit(mxUtils.bind(this,function(J,R){null!=R&&null!=R.text&&(J=this.cellRenderer.getLabelValue(R),"string"===typeof J&&Editor.containsMath(J)&&(R.text.updateBoundingBox(),t=!0))}));if(t){var H=null!=l.currentRoot?l.currentRoot:this.model.getRoot();H=l.getState(H);null!=H&&(H=l.getBoundingBox(H,!0,!1),l.setGraphBounds(null!=H?H:l.getEmptyBounds()),this.sizeDidChange());this.fireEvent(new mxEventObject("mathRefreshed"))}}};(function(){var l=EditorUi.prototype.initialFitDiagram;EditorUi.prototype.initialFitDiagram=function(t){l.apply(this,arguments);var H=this.editor.graph;if(Editor.mathOutputSize&&null!=H&&H.mathEnabled){var J=arguments,R=this,T=!1,Y=function(){T||(T=!0,H.removeListener(Y),H.zoomTo(1),R.resetScrollbars(),l.apply(R,J))};H.addListener("mathRefreshed",Y);Promise.resolve().then(function(){T||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||null!=Editor.mathJaxQueue&&0<Editor.mathJaxQueue.length||Editor.mathJaxRendering||H.removeListener(Y)})}}})();Editor.prototype.csvToArray=function(l){if(0<l.length){var t="",H=[""],J=0,R=!0,T;l=$jscomp.makeIterator(l);for(T=l.next();!T.done;T=l.next())T=T.value,'"'===T?(R&&T===t&&(H[J]+=T),R=!R):","===T&&R?T=H[++J]="":H[J]+=T,t=T;return H}return[]};Editor.prototype.getProxiedUrl=function(l){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(l)){var t=EditorUi.isVisioFilename(l);t=/\.png$/i.test(l)||/\.pdf$/i.test(l)||t;var H="t="+(new Date).getTime();l=PROXY_URL+"?url="+encodeURIComponent(l)+"&"+H+(t?"&base64=1":"")}return l};Editor.prototype.isCorsEnabledForUrl=function(l){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||l.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(l)||"https://raw.githubusercontent.com/"===l.substring(0,34)||"https://fonts.googleapis.com/"===l.substring(0,29)||"https://fonts.gstatic.com/"===l.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var l=new mxUrlConverter;l.updateBaseUrl();var t=l.convert,H=this;l.convert=function(J){null!=J&&navigator.onLine&&("http://"!=J.substring(0,7)&&"https://"!=J.substring(0,8)||J.substring(0,l.baseUrl.length)==l.baseUrl||H.crossOriginImages&&H.isCorsEnabledForUrl(J)?"chrome-extension://"!=J.substring(0,19)&&(J=t.apply(this,arguments)):J=PROXY_URL+"?url="+encodeURIComponent(J));return J};return l};Editor.createSvgDataUri=function(l){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(l)))};Editor.prototype.convertImageToDataUri=-function(l,t,H,J,R){try{var T=!0,Y=window.setTimeout(mxUtils.bind(this,function(){T=!1;t(l)}),this.timeout),Z=mxUtils.bind(this,function(){null!=J?this.convertImageToDataUri(l,t,H,J,!0):t(l)});if(/(\.svg)$/i.test(l)&&!R)mxUtils.get(l,mxUtils.bind(this,function(ka){window.clearTimeout(Y);T&&(200>ka.getStatus()||299<ka.getStatus()?Z():t(Editor.createSvgDataUri(ka.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(Y);T&&Z()}));else{var ia=new Image;this.crossOriginImages&&(ia.crossOrigin=-"anonymous");ia.onload=function(){window.clearTimeout(Y);if(T)try{J=null!=J&&R?J:1;var ka=document.createElement("canvas");ka.height=ia.height*J;ka.width=ia.width*J;var X=ka.getContext("2d");X.scale(J,J);X.drawImage(ia,0,0);t(ka.toDataURL())}catch(ja){t(l)}};ia.onerror=function(){window.clearTimeout(Y);T&&(null!=H?H():t(l))};ia.src=l}}catch(ka){null!=H?H():t(l)}};Editor.prototype.convertImages=function(l,t,H,J){function R(){0<T.length?T.shift()():t(l)}null==J&&(J=this.createImageUrlConverter());var T=-[],Y=H||{};H=mxUtils.bind(this,function(ja,na){ja=l.getElementsByTagName(ja);for(var la=0;la<ja.length;la++)mxUtils.bind(this,function(va){T.push(mxUtils.bind(this,function(){try{if(null!=va){var za=J.convert(va.getAttribute(na));if(null!=za&&"data:"!=za.substring(0,5)){var sa=Y[za];null==sa?this.convertImageToDataUri(za,function(wa){null!=wa&&(Y[za]=wa,va.setAttribute(na,wa));R()},null,Editor.svgRasterScale):(va.setAttribute(na,sa),R())}else null!=za&&va.setAttribute(na,za),R()}}catch(wa){R()}}))})(ja[la])});-var Z={},ia=function(){var ja=l.getElementsByTagName("defs")[0];null==ja&&(ja=l.ownerDocument,ja=null!=ja.createElementNS?ja.createElementNS(mxConstants.NS_SVG,"defs"):ja.createElement("defs"),l.insertBefore(ja,l.firstChild));return ja},ka=mxUtils.bind(this,function(){for(var ja=l.getElementsByTagName("use"),na=0;na<ja.length;na++)mxUtils.bind(this,function(la){T.push(mxUtils.bind(this,function(){try{var va=la.getAttribute("href");null==va&&(va=la.getAttribute("xlink:href"));if(null!=va&&"#"!=va.charAt(0)&&-"data:"!=va.substring(0,5)){var za=J.convert(va),sa=function(Ca){Ca=Graph.createSvgImageSymbol(ia(),Z,Ca,!0);null!=Ca&&(la.setAttribute("href","#"+Ca),la.setAttribute("xlink:href","#"+Ca));R()},wa=Y[za];null==wa?this.convertImageToDataUri(za,function(Ca){null!=Ca&&Ca!=za&&(Y[za]=Ca);sa(Ca)}):sa(wa)}else R()}catch(Ca){R()}}))})(ja[na])}),X=mxUtils.bind(this,function(){T.push(mxUtils.bind(this,function(){try{for(var ja=l.getElementsByTagName("image"),na=[],la=0;la<ja.length;la++)na.push(ja[la]);var va=-{},za={},sa=[],wa=function(){for(var Ta=l.getElementsByTagName("use"),Ua=0;Ua<Ta.length;Ua++){var Ba=Ta[Ua].getAttribute("href");null==Ba&&(Ba=Ta[Ua].getAttribute("xlink:href"));null!=Ba&&null!=va[Ba]&&(Ta[Ua].setAttribute("href","#"+va[Ba]),Ta[Ua].setAttribute("xlink:href","#"+va[Ba]))}},Ca=function(Ta,Ua){for(var Ba=null!=l.ownerDocument.createElementNS?l.ownerDocument.createElementNS(mxConstants.NS_SVG,"use"):l.ownerDocument.createElement("use"),Ka=Ta.attributes,ab=0;ab<Ka.length;ab++){var Qa=-Ka[ab].name;"href"!=Qa&&"xlink:href"!=Qa&&"preserveAspectRatio"!=Qa&&Ba.setAttribute(Qa,Ka[ab].value)}Ba.setAttribute("href","#"+Ua);Ba.setAttribute("xlink:href","#"+Ua);Ta.parentNode.replaceChild(Ba,Ta)};for(la=0;la<na.length;la++){var Fa=na[la];ja=Fa;var Ha=!0;if("symbol"==Fa.parentNode.nodeName)if(null==Fa.getAttribute("id")&&"mx-image-"==String(Fa.parentNode.getAttribute("id")||"").substring(0,9))ja=Fa.parentNode,Ha=!1;else continue;else"mx-image-"==String(Fa.getAttribute("id")||"").substring(0,-9)&&(Ha=!1);var Na=Fa.getAttribute("xlink:href");if(null!=Na&&"data:"==Na.substring(0,5)){var La=ja.getAttribute("preserveAspectRatio")||"";if("data:image/svg+xml"==Na.substring(0,18)){var Da="mx-symbol-"+mxUtils.hashCode(Na+"|"+("none"!=La)),Sa=l.querySelector('[id="'+Da+'"]');if(null!=Sa&&"symbol"==Sa.nodeName){Ha?Ca(Fa,Da):(va["#"+ja.getAttribute("id")]=Da,ja.parentNode.removeChild(ja));continue}}null==za[Na]&&(za[Na]={},sa.push(Na));null==za[Na][La]&&(za[Na][La]=[]);za[Na][La].push({node:ja,inline:Ha})}}wa();+function(l,t,H,J,R){try{var T=!0,Y=window.setTimeout(mxUtils.bind(this,function(){T=!1;t(l)}),this.timeout),Z=mxUtils.bind(this,function(){null!=J?this.convertImageToDataUri(l,t,H,J,!0):t(l)});if(/(\.svg)$/i.test(l)&&!R)mxUtils.get(l,mxUtils.bind(this,function(ja){window.clearTimeout(Y);T&&(200>ja.getStatus()||299<ja.getStatus()?Z():t(Editor.createSvgDataUri(ja.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(Y);T&&Z()}));else{var ia=new Image;this.crossOriginImages&&(ia.crossOrigin=+"anonymous");ia.onload=function(){window.clearTimeout(Y);if(T)try{J=null!=J&&R?J:1;var ja=document.createElement("canvas");ja.height=ia.height*J;ja.width=ia.width*J;var X=ja.getContext("2d");X.scale(J,J);X.drawImage(ia,0,0);t(ja.toDataURL())}catch(ka){t(l)}};ia.onerror=function(){window.clearTimeout(Y);T&&(null!=H?H():t(l))};ia.src=l}}catch(ja){null!=H?H():t(l)}};Editor.prototype.convertImages=function(l,t,H,J){function R(){0<T.length?T.shift()():t(l)}null==J&&(J=this.createImageUrlConverter());var T=+[],Y=H||{};H=mxUtils.bind(this,function(ka,na){ka=l.getElementsByTagName(ka);for(var la=0;la<ka.length;la++)mxUtils.bind(this,function(ua){T.push(mxUtils.bind(this,function(){try{if(null!=ua){var za=J.convert(ua.getAttribute(na));if(null!=za&&"data:"!=za.substring(0,5)){var sa=Y[za];null==sa?this.convertImageToDataUri(za,function(wa){null!=wa&&(Y[za]=wa,ua.setAttribute(na,wa));R()},null,Editor.svgRasterScale):(ua.setAttribute(na,sa),R())}else null!=za&&ua.setAttribute(na,za),R()}}catch(wa){R()}}))})(ka[la])});+var Z={},ia=function(){var ka=l.getElementsByTagName("defs")[0];null==ka&&(ka=l.ownerDocument,ka=null!=ka.createElementNS?ka.createElementNS(mxConstants.NS_SVG,"defs"):ka.createElement("defs"),l.insertBefore(ka,l.firstChild));return ka},ja=mxUtils.bind(this,function(){for(var ka=l.getElementsByTagName("use"),na=0;na<ka.length;na++)mxUtils.bind(this,function(la){T.push(mxUtils.bind(this,function(){try{var ua=la.getAttribute("href");null==ua&&(ua=la.getAttribute("xlink:href"));if(null!=ua&&"#"!=ua.charAt(0)&&+"data:"!=ua.substring(0,5)){var za=J.convert(ua),sa=function(Ca){Ca=Graph.createSvgImageSymbol(ia(),Z,Ca,!0);null!=Ca&&(la.setAttribute("href","#"+Ca),la.setAttribute("xlink:href","#"+Ca));R()},wa=Y[za];null==wa?this.convertImageToDataUri(za,function(Ca){null!=Ca&&Ca!=za&&(Y[za]=Ca);sa(Ca)}):sa(wa)}else R()}catch(Ca){R()}}))})(ka[na])}),X=mxUtils.bind(this,function(){T.push(mxUtils.bind(this,function(){try{for(var ka=l.getElementsByTagName("image"),na=[],la=0;la<ka.length;la++)na.push(ka[la]);var ua=+{},za={},sa=[],wa=function(){for(var Ta=l.getElementsByTagName("use"),Ua=0;Ua<Ta.length;Ua++){var Ba=Ta[Ua].getAttribute("href");null==Ba&&(Ba=Ta[Ua].getAttribute("xlink:href"));null!=Ba&&null!=ua[Ba]&&(Ta[Ua].setAttribute("href","#"+ua[Ba]),Ta[Ua].setAttribute("xlink:href","#"+ua[Ba]))}},Ca=function(Ta,Ua){for(var Ba=null!=l.ownerDocument.createElementNS?l.ownerDocument.createElementNS(mxConstants.NS_SVG,"use"):l.ownerDocument.createElement("use"),Ka=Ta.attributes,ab=0;ab<Ka.length;ab++){var Qa=+Ka[ab].name;"href"!=Qa&&"xlink:href"!=Qa&&"preserveAspectRatio"!=Qa&&Ba.setAttribute(Qa,Ka[ab].value)}Ba.setAttribute("href","#"+Ua);Ba.setAttribute("xlink:href","#"+Ua);Ta.parentNode.replaceChild(Ba,Ta)};for(la=0;la<na.length;la++){var Fa=na[la];ka=Fa;var Ha=!0;if("symbol"==Fa.parentNode.nodeName)if(null==Fa.getAttribute("id")&&"mx-image-"==String(Fa.parentNode.getAttribute("id")||"").substring(0,9))ka=Fa.parentNode,Ha=!1;else continue;else"mx-image-"==String(Fa.getAttribute("id")||"").substring(0,+9)&&(Ha=!1);var Na=Fa.getAttribute("xlink:href");if(null!=Na&&"data:"==Na.substring(0,5)){var La=ka.getAttribute("preserveAspectRatio")||"";if("data:image/svg+xml"==Na.substring(0,18)){var Da="mx-symbol-"+mxUtils.hashCode(Na+"|"+("none"!=La)),Sa=l.querySelector('[id="'+Da+'"]');if(null!=Sa&&"symbol"==Sa.nodeName){Ha?Ca(Fa,Da):(ua["#"+ka.getAttribute("id")]=Da,ka.parentNode.removeChild(ka));continue}}null==za[Na]&&(za[Na]={},sa.push(Na));null==za[Na][La]&&(za[Na][La]=[]);za[Na][La].push({node:ka,inline:Ha})}}wa();var Oa=function(){for(var Ta=null,Ua=null;0<sa.length&&null==Ta;){Ta=sa.pop();Ua=za[Ta];var Ba=0,Ka=0,ab;for(ab in Ua)Ba++,Ka=Math.max(Ka,Ua[ab].length);2>Ba&&2>Ka&&(Ta=null)}if(null==Ta)R();else{var Qa=new Image;Qa.onload=function(){try{var db=Qa.naturalWidth,Va=Qa.naturalHeight;if(0<db&&0<Va){var nb=l.ownerDocument,bb=0,ya;for(ya in Ua)bb++;var Ra=function(Cb){return null!=nb.createElementNS?nb.createElementNS(mxConstants.NS_SVG,Cb):nb.createElement(Cb)},Ya=function(){var Cb=Ra("image");Cb.setAttribute("width",db);Cb.setAttribute("height",Va);null==Cb.setAttributeNS?Cb.setAttribute("xlink:href",Ta):Cb.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Ta);return Cb},lb=null;if(1<bb){for(lb="mx-data-"+mxUtils.hashCode(Ta);null!=l.querySelector('[id="'+lb+'"]');)lb+="-1";var ub=Ya();ub.setAttribute("id",lb);ia().appendChild(ub)}for(ya in Ua){var gb=Ua[ya];bb=null;for(ub=0;ub<gb.length&&null==bb;ub++)gb[ub].inline||(bb=gb[ub].node.getAttribute("id"));if(null==bb)for(bb="mx-image-"+mxUtils.hashCode(Ta+"|"+ya);null!=-l.querySelector('[id="'+bb+'"]');)bb+="-1";var jb=Ra("symbol");jb.setAttribute("id",bb);jb.setAttribute("viewBox","0 0 "+db+" "+Va);""!=ya&&jb.setAttribute("preserveAspectRatio",ya);if(null!=lb){var yb=Ra("use");yb.setAttribute("href","#"+lb);yb.setAttribute("xlink:href","#"+lb);jb.appendChild(yb)}else jb.appendChild(Ya());ia().appendChild(jb);for(ub=0;ub<gb.length;ub++){var Bb=gb[ub].node;gb[ub].inline?Ca(Bb,bb):(Bb.getAttribute("id")!=bb&&(va["#"+Bb.getAttribute("id")]=bb),Bb.parentNode.removeChild(Bb))}}wa()}}catch(Cb){}Oa()};-Qa.onerror=function(){Oa()};Qa.src=Ta}};Oa()}catch(Ta){R()}}))});H("image","xlink:href");H("img","src");ka();X();R()};Editor.base64Encode=function(l){for(var t="",H=0,J=l.length,R,T,Y;H<J;){R=l.charCodeAt(H++)&255;if(H==J){t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(R>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&3)<<4);t+="==";break}T=l.charCodeAt(H++);if(H==J){t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(R>>+l.querySelector('[id="'+bb+'"]');)bb+="-1";var jb=Ra("symbol");jb.setAttribute("id",bb);jb.setAttribute("viewBox","0 0 "+db+" "+Va);""!=ya&&jb.setAttribute("preserveAspectRatio",ya);if(null!=lb){var yb=Ra("use");yb.setAttribute("href","#"+lb);yb.setAttribute("xlink:href","#"+lb);jb.appendChild(yb)}else jb.appendChild(Ya());ia().appendChild(jb);for(ub=0;ub<gb.length;ub++){var Bb=gb[ub].node;gb[ub].inline?Ca(Bb,bb):(Bb.getAttribute("id")!=bb&&(ua["#"+Bb.getAttribute("id")]=bb),Bb.parentNode.removeChild(Bb))}}wa()}}catch(Cb){}Oa()};+Qa.onerror=function(){Oa()};Qa.src=Ta}};Oa()}catch(Ta){R()}}))});H("image","xlink:href");H("img","src");ja();X();R()};Editor.base64Encode=function(l){for(var t="",H=0,J=l.length,R,T,Y;H<J;){R=l.charCodeAt(H++)&255;if(H==J){t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(R>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&3)<<4);t+="==";break}T=l.charCodeAt(H++);if(H==J){t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(R>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&3)<<4|(T&240)>>4);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((T&15)<<2);t+="=";break}Y=l.charCodeAt(H++);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(R>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&3)<<4|(T&240)>>4);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((T&15)<<2|(Y&192)>>6);-t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Y&63)}return t};Editor.prototype.loadUrl=function(l,t,H,J,R,T,Y,Z){try{var ia=!Y&&(J||/(\.png)($|\?)/i.test(l)||/(\.jpe?g)($|\?)/i.test(l)||/(\.gif)($|\?)/i.test(l)||/(\.pdf)($|\?)/i.test(l));R=null!=R?R:!0;var ka=mxUtils.bind(this,function(){mxUtils.get(l,mxUtils.bind(this,function(X){200<=X.getStatus()&&299>=X.getStatus()?null!=t&&(X=X.getText(),ia&&(T=null!=T?T:"data:image/png;base64,",X=T+Editor.base64Encode(X)),t(X)):-null!=H&&(0==X.getStatus()?H({message:mxResources.get("accessDenied")},X):404==X.getStatus()?H({message:mxResources.get("fileNotFound"),code:X.getStatus()},X):H({message:this.getErrorMessage(X)},X))}),function(X){null!=H&&H({message:mxResources.get("error")+" "+X.getStatus()})},ia,this.timeout,function(){R&&null!=H&&H({code:App.ERROR_TIMEOUT,retry:ka})},Z)});ka()}catch(X){null!=H&&H(X)}};Editor.prototype.getErrorMessage=function(l){var t=mxResources.get("error")+" "+l.getStatus();try{var H=l.getText(),+t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Y&63)}return t};Editor.prototype.loadUrl=function(l,t,H,J,R,T,Y,Z){try{var ia=!Y&&(J||/(\.png)($|\?)/i.test(l)||/(\.jpe?g)($|\?)/i.test(l)||/(\.gif)($|\?)/i.test(l)||/(\.pdf)($|\?)/i.test(l));R=null!=R?R:!0;var ja=mxUtils.bind(this,function(){mxUtils.get(l,mxUtils.bind(this,function(X){200<=X.getStatus()&&299>=X.getStatus()?null!=t&&(X=X.getText(),ia&&(T=null!=T?T:"data:image/png;base64,",X=T+Editor.base64Encode(X)),t(X)):+null!=H&&(0==X.getStatus()?H({message:mxResources.get("accessDenied")},X):404==X.getStatus()?H({message:mxResources.get("fileNotFound"),code:X.getStatus()},X):H({message:this.getErrorMessage(X)},X))}),function(X){null!=H&&H({message:mxResources.get("error")+" "+X.getStatus()})},ia,this.timeout,function(){R&&null!=H&&H({code:App.ERROR_TIMEOUT,retry:ja})},Z)});ja()}catch(X){null!=H&&H(X)}};Editor.prototype.getErrorMessage=function(l){var t=mxResources.get("error")+" "+l.getStatus();try{var H=l.getText(),J=JSON.parse(H);null!=J&&null!=J.error&&null!=J.error.message&&(t=J.error.message+" ("+t+")")}catch(R){}return t};Editor.prototype.absoluteCssFonts=function(l){var t=null;if(null!=l){var H=l.split("url(");if(0<H.length){t=[H[0]];l=window.location.pathname;var J=null!=l?l.lastIndexOf("/"):-1;0<=J&&(l=l.substring(0,J+1));J=document.getElementsByTagName("base");var R=null;null!=J&&0<J.length&&(R=J[0].getAttribute("href"));for(var T=1;T<H.length;T++)if(J=H[T].indexOf(")"),0<J){var Y=Editor.trimCssUrl(H[T].substring(0,J));this.graph.isRelativeUrl(Y)&&(Y=null!=R?R+Y:window.location.protocol+"//"+window.location.hostname+("/"==Y.charAt(0)?"":l)+Y);t.push('url("'+Y+'"'+H[T].substring(J))}else t.push(H[T])}else t=[l]}return null!=t?t.join(""):null};Editor.prototype.mapFontUrl=function(l,t,H){/^https?:\/\//.test(t)&&!this.isCorsEnabledForUrl(t)&&(t=PROXY_URL+"?url="+encodeURIComponent(t));H(l,t)};Editor.prototype.embedCssFonts=function(l,t){var H=l.split("url("),J=0;null==this.cachedFonts&&(this.cachedFonts={});var R=-mxUtils.bind(this,function(){if(0==J){for(var ia=[H[0]],ka=1;ka<H.length;ka++){var X=H[ka].indexOf(")");ia.push('url("');ia.push(this.cachedFonts[Editor.trimCssUrl(H[ka].substring(0,X))]);ia.push('"'+H[ka].substring(X))}t(ia.join(""))}});if(0<H.length){for(l=1;l<H.length;l++){var T=H[l].indexOf(")"),Y=null,Z=H[l].indexOf("format(",T);0<Z&&(Y=Editor.trimCssUrl(H[l].substring(Z+7,H[l].indexOf(")",Z))));mxUtils.bind(this,function(ia){if(null==this.cachedFonts[ia]){this.cachedFonts[ia]=ia;J++;var ka=-"application/x-font-ttf";if("svg"==Y||/(\.svg)($|\?)/i.test(ia))ka="image/svg+xml";else if("otf"==Y||"embedded-opentype"==Y||/(\.otf)($|\?)/i.test(ia))ka="application/x-font-opentype";else if("woff"==Y||/(\.woff)($|\?)/i.test(ia))ka="application/font-woff";else if("woff2"==Y||/(\.woff2)($|\?)/i.test(ia))ka="application/font-woff2";else if("eot"==Y||/(\.eot)($|\?)/i.test(ia))ka="application/vnd.ms-fontobject";else if("sfnt"==Y||/(\.sfnt)($|\?)/i.test(ia))ka="application/font-sfnt";this.mapFontUrl(ka,-ia,mxUtils.bind(this,function(X,ja){this.loadUrl(ja,mxUtils.bind(this,function(na){this.cachedFonts[ia]=na;J--;R()}),mxUtils.bind(this,function(na){J--;R()}),!0,null,"data:"+X+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(H[l].substring(0,T)),Y)}R()}else t(l)};Editor.prototype.loadFonts=function(l){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(t){this.resolvedFontCss=t;null!=l&&l()})):null!=l&&l()};Editor.prototype.createGoogleFontCache=-function(){var l={},t;for(t in Graph.fontMapping)Graph.isCssFontUrl(t)&&(l[t]=Graph.fontMapping[t]);return l};Editor.prototype.embedExtFonts=function(l){var t=this.graph.getCustomFonts();if(0<t.length){var H=[],J=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var R=mxUtils.bind(this,function(){0==J&&this.embedCssFonts(H.join(""),l)}),T=0;T<t.length;T++)mxUtils.bind(this,function(Y,Z){Graph.isCssFontUrl(Z)?null==this.cachedGoogleFonts[Z]?(J++,this.loadUrl(Graph.rewriteGoogleFontUrl(Z),-mxUtils.bind(this,function(ia){this.cachedGoogleFonts[Z]=ia;H.push(ia+"\n");J--;R()}),mxUtils.bind(this,function(ia){J--;H.push("@import url("+Z+");\n");R()}))):H.push(this.cachedGoogleFonts[Z]+"\n"):H.push('@font-face {font-family: "'+Y+'";src: url("'+Z+'")}\n')})(t[T].name,t[T].url);R()}else l()};Editor.prototype.addMathCss=function(l){l=l.getElementsByTagName("defs");if(null!=l&&0<l.length)for(var t=document.getElementsByTagName("style"),H=0;H<t.length;H++){var J=mxUtils.getTextContent(t[H]);0>-J.indexOf("mxPageSelector")&&0<J.indexOf("MathJax")&&l[0].appendChild(t[H].cloneNode(!0))}};Editor.prototype.addFontCss=function(l,t){t=null!=t?t:this.absoluteCssFonts(this.fontCss);if(null!=t){var H=mxUtils.getSvgDefs(l),J=t.split("\n");t=[];for(var R=[],T=0;T<J.length;T++)"@import"==J[T].substring(0,7)?t.push(J[T]):R.push(J[T]);l=l.ownerDocument;l=null!=l.createElementNS?l.createElementNS(mxConstants.NS_SVG,"style"):l.createElement("style");l.setAttribute("type","text/css");0<t.length&&(mxUtils.setTextContent(l,-t.join("\n")),H.appendChild(l));0<R.length&&(l=l.cloneNode(!1),mxUtils.setTextContent(l,R.join("\n")),H.appendChild(l))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(l,t,H){var J=mxClient.IS_FF?8192:16384;return Math.min(H,Math.min(J/l,J/t))};Editor.prototype.exportToCanvas=function(l,t,H,J,R,T,Y,Z,ia,ka,X,ja,na,la,va,za,sa,wa){try{T=null!=T?T:!0;Y=null!=Y?Y:!0;ja=null!=ja?ja:this.graph;na=null!=-na?na:0;var Ca=ia?null:ja.background;Ca==mxConstants.NONE&&(Ca=null);null==Ca&&(Ca=J);null==Ca&&0==ia&&(Ca="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(ja.getSvg(null,null,na,la,null,Y,null,null,null,ka,null,za,sa,wa),mxUtils.bind(this,function(Fa){try{Fa.style.setProperty("-webkit-font-smoothing","antialiased");Fa.style.setProperty("-moz-osx-font-smoothing","grayscale");var Ha=new Image;Ha.onload=mxUtils.bind(this,function(){try{var La=function(){mxClient.IS_SF?window.setTimeout(function(){Ta.drawImage(Ha,-0,0);l(Da,Fa)},0):(Ta.drawImage(Ha,0,0),l(Da,Fa))},Da=document.createElement("canvas"),Sa=parseInt(Fa.getAttribute("width")),Oa=parseInt(Fa.getAttribute("height"));Z=null!=Z?Z:1;null!=t&&(Z=T?Math.min(1,Math.min(3*t/(4*Oa),t/Sa)):t/Sa);Z=this.getMaxCanvasScale(Sa,Oa,Z);Sa=Math.ceil(Z*Sa);Oa=Math.ceil(Z*Oa);Da.setAttribute("width",Sa);Da.setAttribute("height",Oa);var Ta=Da.getContext("2d");if(null!=Ca){var Ua=mxUtils.getLightDarkColor(Ca);Ta.beginPath();Ta.rect(0,0,Sa,Oa);Ta.fillStyle="dark"==za&&-"none"!=ja.getAdaptiveColors()?Ua.dark:Ua.light;Ta.fill()}1!=Z&&Ta.scale(Z,Z);if(va){var Ba=ja.view,Ka=Ba.scale;Ba.scale=1;var ab=btoa(unescape(encodeURIComponent(Ba.createSvgGrid(Ba.gridColor))));Ba.scale=Ka;ab="data:image/svg+xml;base64,"+ab;var Qa=ja.gridSize*Ba.gridSteps*Z,db=ja.getGraphBounds(),Va=Ba.translate.x*Ka,nb=Ba.translate.y*Ka,bb=Va+(db.x-Va)/Ka-na,ya=nb+(db.y-nb)/Ka-na,Ra=new Image;Ra.onload=function(){try{for(var Ya=-Math.round(Qa-mxUtils.mod((Va-bb)*Z,Qa)),lb=-Math.round(Qa-mxUtils.mod((nb--ya)*Z,Qa));Ya<Sa;Ya+=Qa)for(var ub=lb;ub<Oa;ub+=Qa)Ta.drawImage(Ra,Ya/Z,ub/Z);La()}catch(gb){null!=R&&R(gb)}};Ra.onerror=function(Ya){null!=R&&R(Ya)};Ra.src=ab}else La()}catch(Ya){null!=R&&R(Ya)}});Ha.onerror=function(La){null!=R&&R(La)};ka&&this.graph.addSvgShadow(Fa);this.graph.mathEnabled&&this.addMathCss(Fa);var Na=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(Fa,this.resolvedFontCss),Ha.src=Editor.createSvgDataUri(mxUtils.getXml(Fa))}catch(La){null!=R&&R(La)}});-this.embedExtFonts(mxUtils.bind(this,function(La){try{null!=La&&this.addFontCss(Fa,La),this.loadFonts(Na)}catch(Da){null!=R&&R(Da)}}))}catch(La){null!=R&&R(La)}}),H,X)}catch(Fa){null!=R&&R(Fa)}};Editor.crcTable=[];for(var v=0;256>v;v++)for(var n=v,y=0;8>y;y++)n=1==(n&1)?3988292384^n>>>1:n>>>1,Editor.crcTable[v]=n;Editor.updateCRC=function(l,t,H,J){for(var R=0;R<J;R++)l=Editor.crcTable[(l^t.charCodeAt(H+R))&255]^l>>>8;return l};Editor.crc32=function(l){for(var t=-1,H=0;H<l.length;H++)t=t>>>8^Editor.crcTable[(t^-l.charCodeAt(H))&255];return(t^-1)>>>0};Editor.writeGraphModelToPng=function(l,t,H,J,R){function T(X,ja){var na=ia;ia+=ja;return X.substring(na,ia)}function Y(X){X=T(X,4);return X.charCodeAt(3)+(X.charCodeAt(2)<<8)+(X.charCodeAt(1)<<16)+(X.charCodeAt(0)<<24)}function Z(X){return String.fromCharCode(X>>24&255,X>>16&255,X>>8&255,X&255)}l=l.substring(l.indexOf(",")+1);l=window.atob?atob(l):Base64.decode(l,!0);var ia=0;if(T(l,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=R&&-R();else if(T(l,4),"IHDR"!=T(l,4))null!=R&&R();else{T(l,17);R=l.substring(0,ia);do{var ka=Y(l);if("IDAT"==T(l,4)){R=l.substring(0,ia-8);"pHYs"==t&&"dpi"==H?(H=Math.round(J/.0254),H=Z(H)+Z(H)+String.fromCharCode(1)):H=H+String.fromCharCode(0)+("zTXt"==t?String.fromCharCode(0):"")+J;J=4294967295;J=Editor.updateCRC(J,t,0,4);J=Editor.updateCRC(J,H,0,H.length);R+=Z(H.length)+t+H+Z(J^4294967295);R+=l.substring(ia-8,l.length);break}R+=l.substring(ia-8,ia-4+ka);T(l,ka);T(l,4)}while(ka);return"data:image/png;base64,"+-(window.btoa?btoa(R):Base64.encode(R,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var C=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(l,t){C.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var P=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){P.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==-typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(l,t,H){var J=null;if(null!=H)return null;null!=l.editor.graph.getModel().getParent(t)?J=t.getId():null!=l.currentPage&&(J=l.currentPage.getId());return J});if(null!=window.StyleFormatPanel){var G=Format.prototype.init;Format.prototype.init=function(){G.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var O=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||-"1"==urlParams.embed||this.editorUi.editor.chromeless?O.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(l){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var U=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(l){l=U.apply(this,arguments);var t=this.editorUi,H=t.editor.graph;if(H.isEnabled()){var J=t.getCurrentFile();null!=J&&J.isAutosaveOptional()&&l.appendChild(this.createOption(mxResources.get("autosave"),-function(){return t.editor.autosave},function(T){t.editor.setAutosave(T);t.editor.autosave&&J.isModified()&&J.fileChanged()},{install:function(T){this.listener=function(){T(t.editor.autosave)};t.editor.addListener("autosaveChanged",this.listener)},destroy:function(){t.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&H.isEnabled()&&"undefined"!==typeof MathJax){var R=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return H.mathEnabled},function(T){t.actions.get("mathematicalTypesetting").funct()},-{install:function(T){this.listener=function(){T(H.mathEnabled)};t.addListener("mathEnabledChanged",this.listener)},destroy:function(){t.removeListener(this.listener)}});l.appendChild(R);(!t.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&R.appendChild(t.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return l};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},-{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(l,t){return 0<mxUtils.getValue(l.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.ellipse.prototype.customProperties=[{name:"centerRadius",dispName:"Center Radius",type:"float",min:0,defVal:0},{name:"centerColor",dispName:"Center Color",type:"color",defVal:null,-primary:!0,isVisible:function(l,t){return 0<mxUtils.getValue(l.style,"centerRadius",0)}}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",-type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=-[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2,isVisible:function(l){return"0"==mxUtils.getValue(l.style,-"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(l){return"1"==mxUtils.getValue(l.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.25,isVisible:function(l){return"0"==mxUtils.getValue(l.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",-min:0,defVal:25,isVisible:function(l){return"1"==mxUtils.getValue(l.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,min:0,max:1},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=-[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0},{name:"boundedLbl",-dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder3.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlState.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.step.prototype.customProperties=-[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",type:"float",min:0,defVal:20},{name:"fixedSize",dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=-[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.note2.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.card.prototype.customProperties=-[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20},{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",-min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"right",dispName:"Right"}]},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=-[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},{name:"swimlaneBody",dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},{name:"separatorColor",dispName:"Separator Color",-type:"color",defVal:null},{name:"fixedHeader",dispName:"Fixed Header",type:"bool",defVal:!0,getDefaultValue:function(l,t){l=mxCellRenderer.defaultShapes[mxUtils.getValue(l.style,"shape","")];return null!=l&&null!=l.prototype.fixedHeaderDefault?l.prototype.fixedHeaderDefault?"1":"0":"1"}}];mxCellRenderer.defaultShapes.table.prototype.customProperties=[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",-type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);-mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},-{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0},{name:"imageAlign",dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},-{name:"imageVerticalAlign",dispName:"Image Vertical Align",type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",type:"float",min:0,defVal:24},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",-type:"float",min:0,defVal:0},{name:"footerColor",dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(l,t){return 0<mxUtils.getValue(l.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,-defVal:20},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=-[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",-min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.cross.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.corner.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.tee.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,-defVal:20}];mxCellRenderer.defaultShapes.umlLifeline.prototype.customProperties=[{name:"participant",dispName:"Participant",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName:"Actor"},{val:"umlBoundary",dispName:"Boundary"},{val:"umlEntity",dispName:"Entity"},{val:"umlControl",dispName:"Control"}]},{name:"size",dispName:"Height",type:"float",defVal:40,min:0},{name:"lifelineMirror",dispName:"Mirror Head",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=-[{name:"width",dispName:"Title Width",type:"float",defVal:60,min:0},{name:"height",dispName:"Title Height",type:"float",defVal:30,min:0}];StyleFormatPanel.prototype.defaultColorSchemes=[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",-font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},-{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",-gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",-stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;var c=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var l=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&0<l.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));c.apply(this,arguments);null!=l.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),-l.customProperties,l))};var f=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(l){var t=this.editorUi.getSelectionState();1==t.cells.length?this.addActions(l,["copyStyle","pasteStyle"]):1<=t.cells.length&&this.addActions(l,["pasteStyle","pasteData"]);f.apply(this,arguments);return l};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(l,t,H,J){function R(Ua){try{return decodeURIComponent(Ua)}catch(Ba){return Ua}}function T(Ua,-Ba,Ka,ab,Qa){if(null!=Ka.valueChanged)Ka.valueChanged(Ba,Qa,H,na);else{la.getModel().beginUpdate();try{Qa=[];var db=[];if(null!=Ka.index){for(var Va=[],nb=Ka.parentRow.nextSibling;nb&&nb.getAttribute("data-pName")==Ua;)Va.push(nb.getAttribute("data-pValue")),nb=nb.nextSibling;Ka.index<Va.length?null!=ab?Va.splice(ab,1):Va[Ka.index]=Ba:Va.push(Ba);null!=Ka.size&&Va.length>Ka.size&&(Va=Va.slice(0,Ka.size));Ba=Va.join(",");null!=Ka.countProperty&&(la.setCellStyles(Ka.countProperty,Va.length,la.getSelectionCells()),-Qa.push(Ka.countProperty),db.push(Va.length))}la.setCellStyles(Ua,Ba,la.getSelectionCells());Qa.push(Ua);db.push(Ba);if(null!=Ka.dependentProps)for(Ua=0;Ua<Ka.dependentProps.length;Ua++){var bb=Ka.dependentPropsDefVal[Ua],ya=Ka.dependentPropsVals[Ua];if(ya.length>Ba)ya=ya.slice(0,Ba);else for(var Ra=ya.length;Ra<Ba;Ra++)ya.push(bb);ya=ya.join(",");la.setCellStyles(Ka.dependentProps[Ua],ya,la.getSelectionCells());Qa.push(Ka.dependentProps[Ua]);db.push(ya)}if("function"==typeof Ka.onChange)Ka.onChange(la,-Ba);na.editorUi.fireEvent(new mxEventObject("styleChanged","keys",Qa,"values",db,"cells",la.getSelectionCells()))}finally{la.getModel().endUpdate()}}}function Y(Ua,Ba){Ba.style.left="0px";Ba.style.top="0px";Ba.style.position="relative";Ba.style.right="0px";Ba.style.bottom="0px";Ba.style.width="100%";Ba.style.maxWidth="100%";Ba.style.maxHeight="100%";Ba.style.textAlign="left"}function Z(Ua,Ba,Ka){function ab(db){if(null==db||db==mxConstants.NONE)Qa.style.background="url('"+Dialog.prototype.noColorImage+-"')";else if("default"==db)Qa.style.background="";else{var Va=mxUtils.getLightDarkColor(db);mxUtils.isLightDarkColor(db)&&Va.light!=Va.dark?Qa.style.background="linear-gradient(to right bottom, "+Va.cssText+" 50%, "+mxUtils.invertLightDarkColor(Va).cssText+" 50.3%)":Qa.style.background=db}}var Qa=document.createElement("div");Qa.style.width="32px";Qa.style.height="8px";Qa.style.margin="2px";Qa.style.borderStyle="solid";Qa.style.borderWidth="1px";ab(Ba);btn=mxUtils.button("",mxUtils.bind(na,function(db){this.editorUi.pickColor(Ba,-function(Va){T(Ua,Va,Ka);ab(Va)});mxEvent.consume(db)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(Qa);return btn}function ia(Ua,Ba,Ka,ab,Qa,db,Va){null!=Ba&&(Ba=Ba.split(","),va.push({name:Ua,values:Ba,type:Ka,defVal:ab,countProperty:Qa,parentRow:db,isDeletable:!0,flipBkg:Va}));btn=mxUtils.button("+",mxUtils.bind(na,function(nb){for(var bb=db,ya=0;null!=bb.nextSibling;)if(bb.nextSibling.getAttribute("data-pName")==-Ua)bb=bb.nextSibling,ya++;else break;var Ra={type:Ka,parentRow:db,index:ya,isDeletable:!0,defVal:ab,countProperty:Qa};ya=ja(Ua,"",Ra,0==ya%2,Va);T(Ua,ab,Ra);bb.parentNode.insertBefore(ya,bb.nextSibling);mxEvent.consume(nb)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ka(Ua,Ba,Ka,ab,Qa,db,Va){if(0<Qa){var nb=Array(Qa);Ba=null!=Ba?Ba.split(","):[];for(var bb=0;bb<Qa;bb++)nb[bb]=null!=Ba[bb]?Ba[bb]:null!=ab?ab:"";va.push({name:Ua,values:nb,type:Ka,-defVal:ab,parentRow:db,flipBkg:Va,size:Qa})}return document.createElement("div")}function X(Ua,Ba,Ka){var ab=document.createElement("input");ab.type="checkbox";ab.checked="1"==Ba;mxEvent.addListener(ab,"change",function(){T(Ua,ab.checked?"1":"0",Ka,null,ab)});return ab}function ja(Ua,Ba,Ka,ab,Qa){var db=Ka.dispName,Va=Ka.type,nb=document.createElement("tr");nb.className="gePropRow"+(Qa?"Dark":"")+(ab?"Alt":"")+" gePropNonHeaderRow";nb.setAttribute("data-pName",Ua);nb.setAttribute("data-pValue",Ba);-ab=!1;null!=Ka.index&&(nb.setAttribute("data-index",Ka.index),db=(null!=db?db:"")+"["+Ka.index+"]",ab=!0);var bb=document.createElement("td");bb.className="gePropRowCell";db=mxResources.get(db,null,db);mxUtils.write(bb,db);bb.setAttribute("title",db);ab&&(bb.style.textAlign="right");nb.appendChild(bb);bb=document.createElement("td");bb.className="gePropRowCell";bb.setAttribute("title",null!=Ba?R(Ba):mxResources.get("none"));mxEvent.addListener(bb,"click",mxUtils.bind(na,function(lb){!mxUtils.isAncestorNode(nb,-document.activeElement)&&mxUtils.isAncestorNode(nb.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(lb))}));if("color"==Va)bb.appendChild(Z(Ua,Ba,Ka));else if("bool"==Va||"boolean"==Va)bb.appendChild(X(Ua,Ba,Ka));else if("enum"==Va){var ya=Ka.enumList;bb.innerHTML="";var Ra=document.createElement("div");Ra.className="gePropValue";bb.appendChild(Ra);for(Qa=0;Qa<ya.length;Qa++)if(db=ya[Qa],db.val==Ba){mxUtils.write(Ra,-mxResources.get(db.dispName,null,db.dispName));break}mxEvent.addListener(bb,"click",mxUtils.bind(na,function(lb){var ub=mxEvent.getSource(lb);if(!(ub!=bb&&ub!=Ra||mxEvent.isConsumed(lb))){Ra.innerHTML="";var gb=document.createElement("select"),jb=null;Y(bb,gb);gb.style.boxSizing="border-box";gb.style.height="100%";gb.style.padding="0";gb.style.margin="0";gb.style.border="0";for(lb=0;lb<ya.length;lb++){ub=ya[lb];var yb=document.createElement("option");yb.value=mxUtils.htmlEntities(ub.val);mxUtils.write(yb,-mxResources.get(ub.dispName,null,ub.dispName));gb.appendChild(yb);null==ub.val&&(yb.value="null",jb=yb)}gb.value=null==Ba&&null!=jb?"null":Ba;Ra.appendChild(gb);mxEvent.addListener(gb,"change",function(){var Bb=mxUtils.htmlEntities(gb.value);if(gb[gb.selectedIndex]==jb||"null"==Bb.value)Bb=null;T(Ua,Bb,Ka)});gb.focus();mxEvent.addListener(gb,"blur",function(){Ra.innerHTML="";for(var Bb=gb[gb.selectedIndex]==jb||"null"==gb.value?null:gb.value,Cb=0;Cb<ya.length;Cb++){var Kb=ya[Cb];if(Kb.val==Bb){mxUtils.write(Ra,-mxResources.get(Kb.dispName,null,Kb.dispName));break}}})}}))}else if("dynamicArr"==Va)bb.appendChild(ia(Ua,Ba,Ka.subType,Ka.subDefVal,Ka.countProperty,nb,Qa));else if("staticArr"==Va)bb.appendChild(ka(Ua,Ba,Ka.subType,Ka.subDefVal,Ka.size,nb,Qa));else if("readOnly"==Va)Qa=document.createElement("input"),Qa.setAttribute("readonly",""),Qa.value=Ba,Qa.style.borderWidth="0px","id"==Ua||"shape"==Ua?(nb.firstChild.innerHTML="",nb.firstChild.setAttribute("colspan","2"),Qa.style.flexGrow="1",Qa.style.marginLeft=-"4px",Qa.style.textAlign="id"==Ua?"center":"left",Qa.setAttribute("title",Ba),db=document.createElement("div"),mxUtils.write(db,mxResources.get(Ua)+":"),db.style.display="inline-flex",db.style.alignItems="center",db.style.width="100%",db.appendChild(Qa),nb.firstChild.appendChild(db)):(Qa.style.width="96px",bb.appendChild(Qa));else{bb.innerHTML="";var Ya=document.createElement("div");Ya.className="gePropValue";bb.appendChild(Ya);Ya.innerHTML=mxUtils.htmlEntities(R(Ba));mxEvent.addListener(bb,"click",-mxUtils.bind(na,function(lb){function ub(){var yb=jb.value,Bb=Va;yb=0==yb.trim().length&&"string"!=Bb&&"numbers"!=Bb?Ka.allowAuto?"auto":0:yb;Ka.allowAuto&&(null!=yb.trim&&"auto"==yb.trim().toLowerCase()?(yb="auto",Bb="string"):(yb=parseFloat(yb),yb=isNaN(yb)?0:yb));null!=Ka.min&&yb<Ka.min?yb=Ka.min:null!=Ka.max&&yb>Ka.max&&(yb=Ka.max);var Cb=null;try{Cb="numbers"==Bb?yb.match(/\d+/g).map(Number).join(" "):"auto"===yb&&Ka.allowAuto&&"auto"==Ka.defVal?null:encodeURIComponent(("int"==Bb?parseInt(yb):-yb)+"")}catch(Kb){}T(Ua,Cb,Ka,null,jb)}var gb=mxEvent.getSource(lb);if(!(gb!=bb&&gb!=Ya||mxEvent.isConsumed(lb))){Ya.innerHTML="";var jb=document.createElement("input");Y(Ya,jb);jb.value=R(Ba);jb.className="gePropEditor";"int"!=Va&&"float"!=Va||Ka.allowAuto||(jb.type="number",jb.step="int"==Va?"1":"any",null!=Ka.min&&(jb.min=parseFloat(Ka.min)),null!=Ka.max&&(jb.max=parseFloat(Ka.max)));Ya.appendChild(jb);mxEvent.addListener(jb,"keypress",function(yb){13==yb.keyCode&&ub()});jb.focus();mxEvent.addListener(jb,-"blur",function(){ub()})}}))}Ka.isDeletable&&(Qa=mxUtils.button("-",mxUtils.bind(na,function(lb){T(Ua,"",Ka,Ka.index);mxEvent.consume(lb)})),Qa.style.height="16px",Qa.style.width="25px",Qa.style.float="right",Qa.className="geColorBtn",bb.appendChild(Qa));nb.appendChild(bb);return nb}var na=this,la=this.editorUi.editor.graph,va=[],za=document.createElement("table");za.className="geProperties geFullWidthElement";var sa=document.createElement("tr");sa.className="gePropHeader";var wa=document.createElement("th");-wa.className="gePropHeaderCell";wa.style.paddingLeft="16px";wa.style.backgroundRepeat="no-repeat";wa.style.backgroundPosition="-2px 50%";wa.style.backgroundSize="20px";mxUtils.write(wa,mxResources.get("property"));sa.style.cursor="pointer";var Ca=function(){var Ua=za.querySelectorAll(".gePropNonHeaderRow");if(na.editorUi.propertiesCollapsed){wa.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var Ba="none";for(var Ka=l.childNodes.length-1;0<=Ka;Ka--)try{var ab=l.childNodes[Ka],Qa=ab.nodeName.toUpperCase();-"INPUT"!=Qa&&"SELECT"!=Qa||l.removeChild(ab)}catch(db){}}else wa.style.backgroundImage="url('"+Editor.arrowDownImage+"')",Ba="";for(Ka=0;Ka<Ua.length;Ka++)Ua[Ka].style.display=Ba};mxEvent.addListener(sa,"click",function(){na.editorUi.propertiesCollapsed=!na.editorUi.propertiesCollapsed;Ca()});sa.appendChild(wa);var Fa=document.createElement("th");Fa.className="gePropHeaderCell";Fa.style.paddingLeft="4px";mxUtils.write(Fa,mxResources.get("value"));sa.appendChild(Fa);za.appendChild(sa);var Ha=Fa=!1;-sa=null;1==H.vertices.length&&0==H.edges.length?sa=H.vertices[0].id:0==H.vertices.length&&1==H.edges.length&&(sa=H.edges[0].id);null==sa||J||(za.appendChild(ja("id",mxUtils.htmlEntities(sa),{dispName:"id",type:"readOnly"},!0,!1)),null!=H.style&&null!=H.style.shape&&za.appendChild(ja("shape",mxUtils.htmlEntities(H.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var Na in t)if(J=t[Na],("function"!=typeof J.isVisible||J.isVisible(H,this))&&!J.primary){var La=null!=J.getValue?J.getValue(H,-this):null!=H.style[Na]?mxUtils.htmlEntities(H.style[Na]+""):null!=J.getDefaultValue?J.getDefaultValue(H,this):J.defVal;if("separator"==J.type)Ha=!Ha;else{if("staticArr"==J.type)J.size=parseInt(H.style[J.sizeProperty]||t[J.sizeProperty].defVal)||0;else if(null!=J.dependentProps){var Da=J.dependentProps,Sa=[],Oa=[];for(sa=0;sa<Da.length;sa++)if(null!=t[Da[sa]]){var Ta=H.style[Da[sa]];Oa.push(t[Da[sa]].subDefVal);Sa.push(null!=Ta?Ta.split(","):[])}J.dependentPropsDefVal=Oa;J.dependentPropsVals=Sa}za.appendChild(ja(Na,-La,J,Fa,Ha));Fa=!Fa}}for(sa=0;sa<va.length;sa++)for(J=va[sa],t=J.parentRow,Na=0;Na<J.values.length;Na++)Fa=ja(J.name,J.values[Na],{type:J.type,parentRow:J.parentRow,isDeletable:J.isDeletable,index:Na,defVal:J.defVal,countProperty:J.countProperty,size:J.size},0==Na%2,J.flipBkg),t.parentNode.insertBefore(Fa,t.nextSibling),t=Fa;l.appendChild(za);Ca();return l};StyleFormatPanel.prototype.addStyles=function(l){if(null!=this.defaultColorSchemes){var t=this.editorUi,H=t.editor.graph,J=document.createElement("div");-J.style.padding="6px 20px 0 24px";l.appendChild(J);var R=document.createElement("div");R.className="geSwitcher";R.style.padding="4px 18px 6px 0px";for(var T=[],Y=0;Y<this.defaultColorSchemes.length;Y++){var Z=document.createElement("div");Z.className="geSwitcherDot";mxUtils.bind(this,function(na){mxEvent.addListener(Z,"click",mxUtils.bind(this,function(){ia(na)}))})(Y);T.push(Z);R.appendChild(Z)}var ia=mxUtils.bind(this,function(na){null!=T[na]&&(null!=this.format.currentScheme&&null!=T[this.format.currentScheme]&&-(T[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=na,ka(this.defaultColorSchemes[this.format.currentScheme]),T[this.format.currentScheme].style.background="#84d7ff")}),ka=mxUtils.bind(this,function(na){var la=mxUtils.clone(H.defaultVertexStyle);la[mxConstants.STYLE_STROKECOLOR]=null!=la[mxConstants.STYLE_STROKECOLOR]?la[mxConstants.STYLE_STROKECOLOR]:"default";la[mxConstants.STYLE_FILLCOLOR]=null!=la[mxConstants.STYLE_FILLCOLOR]?la[mxConstants.STYLE_FILLCOLOR]:-"default";la[mxConstants.STYLE_FONTCOLOR]=null!=la[mxConstants.STYLE_FONTCOLOR]?la[mxConstants.STYLE_FONTCOLOR]:"default";H.replaceDefaultColors(new mxCell,la);var va=mxUtils.bind(this,function(sa){var wa=mxUtils.button("",mxUtils.bind(this,function(Ha){H.getModel().beginUpdate();try{for(var Na=t.getSelectionState().cells,La=H.getModel(),Da=[],Sa=0<Na.length,Oa=0;Oa<Na.length;Oa++){var Ta=La.isVertex(Na[Oa])&&La.isEdge(La.getParent(Na[Oa])),Ua=H.getCellStyle(Na[Oa]),Ba=null!=Ua&&"image"==Ua.shape,-Ka=H.getCellGeometry(Na[Oa]);Da.push({isLabel:Ba||Ta&&(null==Ka||0>=Ka.width||0>=Ka.height)});Ta||Ba||(Sa=!1)}for(Oa=0;Oa<Na.length;Oa++){var ab=Da[Oa];if(Sa||!ab.isLabel){var Qa=ab.isLabel?mxConstants.STYLE_LABEL_BACKGROUNDCOLOR:mxConstants.STYLE_FILLCOLOR,db=ab.isLabel?mxConstants.STYLE_LABEL_BORDERCOLOR:mxConstants.STYLE_STROKECOLOR,Va=La.getStyle(Na[Oa]);null!=Va&&"string"!==typeof Va&&(Va=String(Va));null!=sa?(mxEvent.isShiftDown(Ha)||(Va=""==sa.fill||null==sa.fill?mxUtils.setStyle(Va,Qa,null):-mxUtils.setStyle(Va,Qa,sa.fill),ab.isLabel||(Va=""==sa.gradient||null==sa.gradient?mxUtils.setStyle(Va,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Va,mxConstants.STYLE_GRADIENTCOLOR,sa.gradient)),mxEvent.isControlDown(Ha)||mxClient.IS_MAC&&mxEvent.isMetaDown(Ha)||!La.isVertex(Na[Oa])||(Va=""==sa.font||null==sa.font?mxUtils.setStyle(Va,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Va,mxConstants.STYLE_FONTCOLOR,sa.font))),mxEvent.isAltDown(Ha)||(Va=""==sa.stroke||null==sa.stroke?mxUtils.setStyle(Va,-db,null):mxUtils.setStyle(Va,db,sa.stroke))):(Va=mxUtils.setStyle(Va,Qa,null),Va=mxUtils.setStyle(Va,db,null),ab.isLabel||(Va=mxUtils.setStyle(Va,mxConstants.STYLE_GRADIENTCOLOR,null)),La.isVertex(Na[Oa])&&(Va=mxUtils.setStyle(Va,mxConstants.STYLE_FONTCOLOR,null)));La.setStyle(Na[Oa],Va)}}}finally{H.getModel().endUpdate()}}));wa.className="geStyleButton";wa.style.width="36px";wa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";wa.style.margin="0px 6px 6px 0px";if(null!=sa){var Ca="1px solid";-null!=sa.border&&(Ca=sa.border);if(null!=sa.gradient)wa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(sa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(sa.gradient).cssText+" 100%)";else if(sa.fill==mxConstants.NONE)wa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==sa.fill||""==sa.fill)wa.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(la,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var Fa=mxUtils.getLightDarkColor(sa.fill);-wa.style.backgroundImage="linear-gradient(to right bottom, "+Fa.cssText+" 50%, "+Fa.light+" 50.3%)"}null==sa.stroke||sa.stroke==mxConstants.NONE?wa.style.border=Ca+" transparent":""==sa.stroke?wa.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(la,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Fa=mxUtils.getLightDarkColor(sa.stroke),wa.style.border=Ca+" "+Fa.cssText,wa.style.borderRightColor=Fa.light,wa.style.borderBottomColor=wa.style.borderRightColor);null!=sa.title&&wa.setAttribute("title",-sa.title)}else Ca=mxUtils.getValue(la,mxConstants.STYLE_FILLCOLOR,"#ffffff"),Fa=mxUtils.getValue(la,mxConstants.STYLE_STROKECOLOR,"#000000"),wa.style.backgroundColor=Ca,wa.style.border="1px solid "+Fa;wa.style.borderRadius="0";J.appendChild(wa);null!=sa&&null!=sa.gradient&&(Ca=wa.cloneNode(!1),Ca.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(sa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(sa.gradient).light+") 100%)",Ca.style.clipPath=-"polygon(0 100%, 100% 0, 100% 100%)",Ca.style.backgroundColor="transparent",J.appendChild(Ca),Ca.style.marginLeft="-42px",mxEvent.addListener(Ca,"click",function(){wa.click()}))});J.innerText="";if(null!=na)for(var za=0;za<na.length;za++)0<za&&0==mxUtils.mod(za,4)&&mxUtils.br(J),va(na[za])});null==this.format.currentScheme?ia(Math.min(T.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):ia(this.format.currentScheme);Y=10>=this.defaultColorSchemes.length?43:23;var X=document.createElement("div");-X.className="geButton";X.style.cssText="position:absolute;left:0px;bottom:"+Y+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(X,"click",mxUtils.bind(this,function(){ia(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var ja=document.createElement("div");ja.className="geButton";ja.style.cssText="position:absolute;left:186px;bottom:"+Y+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&-(l.appendChild(X),l.appendChild(ja));mxEvent.addListener(ja,"click",mxUtils.bind(this,function(){ia(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));ka(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&l.appendChild(R)}return l}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};-Graph.customFontElements={};Graph.isGoogleFontUrl=function(l){return l.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||l.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(l){return Graph.isGoogleFontUrl(l)};Graph.rewriteGoogleFontUrl=function(l){null!=l&&l.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(l=Editor.GOOGLE_FONTS_CSS2+l.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return l};Graph.createFontElement=-function(l,t){var H=Graph.fontMapping[t];null==H&&Graph.isCssFontUrl(t)?(l=document.createElement("link"),l.setAttribute("rel","stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("charset","UTF-8"),l.setAttribute("href",Graph.rewriteGoogleFontUrl(t))):(null==H&&(H='@font-face {\nfont-family: "'+l+'";\nsrc: url("'+t+'");\n}'),l=document.createElement("style"),mxUtils.write(l,H));return l};Graph.addRecentCustomFont=function(l,t){};Graph.addFont=function(l,t,H,J){if(null!=l&&0<l.length&&null!=-t&&0<t.length){J=null!=J?J:Graph.customFontElements;var R=l.toLowerCase();if("helvetica"!=R&&"arial"!=l&&"sans-serif"!=R){var T=J[R];null!=T&&T.url!=t&&(T.elt.parentNode.removeChild(T.elt),T=null);null==T?(T=t,"http:"==t.substring(0,5)&&(T=PROXY_URL+"?url="+encodeURIComponent(t)),T={name:l,url:t,elt:Graph.createFontElement(l,T)},J[R]=T,t=J==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=H&&("link"==T.elt.nodeName.toLowerCase()?(T.elt.onload=H,T.elt.onerror=H):H()),null!=-t&&t.appendChild(T.elt)):null!=H&&H()}else null!=H&&H()}else null!=H&&H();return l};Graph.getFontUrl=function(l,t){l=Graph.customFontElements[l.toLowerCase()];null!=l&&(t=l.url);return t};Graph.processFontAttributes=function(l){l=l.getElementsByTagName("*");for(var t=0;t<l.length;t++){var H=l[t].getAttribute("data-font-src");if(null!=H){var J="FONT"==l[t].nodeName?l[t].getAttribute("face"):l[t].style.fontFamily;null!=J&&Graph.addFont(J,H)}}};Graph.processFontStyle=function(l){if(null!=l){var t=mxUtils.getValue(l,-"fontSource",null);if(null!=t){var H=mxUtils.getValue(l,mxConstants.STYLE_FONTFAMILY,null);if(null!=H)try{Graph.addFont(H,decodeURIComponent(t))}catch(J){}}}return l};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;mxConnectionHandler.prototype.createTarget="1"==urlParams.sketch;Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity=-"0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var k=Graph.prototype.init;Graph.prototype.init=function(){function l(R){t=R}k.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var t=null;mxEvent.addListener(this.container,"mouseenter",l);mxEvent.addListener(this.container,"mousemove",l);mxEvent.addListener(this.container,"mouseleave",function(R){t=null});-this.isMouseInsertPoint=function(){return null!=t};var H=this.getInsertPoint;this.getInsertPoint=function(R){return null==t||R?H.apply(this,arguments):this.getPointForEvent(t)};var J=this.layoutManager.getLayout;this.layoutManager.getLayout=function(R){var T=this.graph.getCellStyle(R);if(null!=T&&"rack"==T.childLayout){var Y=new mxStackLayout(this.graph,!1);Y.gridSize=null!=T.rackUnitSize?parseFloat(T.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;Y.marginLeft=T.marginLeft||-0;Y.marginRight=T.marginRight||0;Y.marginTop=T.marginTop||0;Y.marginBottom=T.marginBottom||0;Y.allowGaps=T.allowGaps||0;Y.horizontal="1"==mxUtils.getValue(T,"horizontalRack","0");Y.resizeParent=!1;Y.fill=!0;return Y}return J.apply(this,arguments)};this.updateGlobalUrlVariables()};var q=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(l,t){return Graph.processFontStyle(q.apply(this,arguments))};var x=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=-function(l,t,H,J,R,T,Y,Z,ia,ka,X,ja){x.apply(this,arguments);Graph.processFontAttributes(ja)};var B=mxText.prototype.redraw;mxText.prototype.redraw=function(){B.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(l,t,H,J){function R(){for(var za=Z.getSelectionCells(),sa=[],wa=0;wa<za.length;wa++)Z.isCellVisible(za[wa])&&sa.push(za[wa]);Z.setSelectionCells(sa)}function T(za){Z.setHiddenTags(za?[]:ia.slice());-R();Z.refresh()}function Y(za,sa){X.innerText="";if(0<za.length){var wa=document.createElement("table");wa.setAttribute("cellpadding","2");wa.style.boxSizing="border-box";wa.style.tableLayout="fixed";wa.style.width="100%";var Ca=document.createElement("tbody");if(null!=za&&0<za.length)for(var Fa=0;Fa<za.length;Fa++)(function(Ha){function Na(){var Ua=Z.getCellsForTags([Ha],null,null,!0);Z.isEnabled()?Z.setSelectionCells(Ua):Z.highlightCells(Ua,null,null,70)}var La=0>mxUtils.indexOf(Z.hiddenTags,Ha),-Da=document.createElement("tr"),Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";var Oa=document.createElement("img");Oa.setAttribute("src",La?Editor.visibleImage:Editor.hiddenImage);Oa.setAttribute("title",mxResources.get(La?"hideIt":"show",[Ha])+"\n"+mxResources.get("shiftClickShowOnly",[Ha]));mxUtils.setOpacity(Oa,La?75:25);Oa.className="geAdaptiveAsset";Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";Oa.style.width="16px";if(t||Editor.isDarkMode())Oa.style.filter=-"invert(100%)";Sa.appendChild(Oa);mxEvent.addListener(Oa,"click",function(Ua){if(mxEvent.isShiftDown(Ua)){for(var Ba=[],Ka=0;Ka<ia.length;Ka++)ia[Ka]!==Ha&&Ba.push(ia[Ka]);var ab=0<Ba.length;for(Ka=0;Ka<Ba.length;Ka++)if(0>mxUtils.indexOf(Z.hiddenTags,Ba[Ka])){ab=!1;break}ab&&0>mxUtils.indexOf(Z.hiddenTags,Ha)?Z.setHiddenTags([]):Z.setHiddenTags(Ba)}else Z.toggleHiddenTag(Ha);R();Z.refresh();mxEvent.consume(Ua)});Da.appendChild(Sa);Sa=document.createElement("td");Sa.style.align="center";Sa.style.width=-"16px";Oa=document.createElement("img");Oa.setAttribute("src",Editor.selectImage);Oa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Oa,La?75:25);Oa.className="geAdaptiveAsset";Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";Oa.style.width="16px";if(t||Editor.isDarkMode())Oa.style.filter="invert(100%)";mxEvent.addListener(Oa,"click",function(Ua){T(!0);Na();mxEvent.consume(Ua)});Sa.appendChild(Oa);Da.appendChild(Sa);Sa=document.createElement("td");Sa.style.overflow="hidden";-Sa.style.whiteSpace="nowrap";Sa.style.textOverflow="ellipsis";Sa.style.verticalAlign="middle";Sa.style.cursor="pointer";Sa.setAttribute("title",Ha);a=document.createElement("a");mxUtils.write(a,Ha);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,La?100:40);Sa.appendChild(a);mxEvent.addListener(Sa,"click",function(Ua){if(mxEvent.isShiftDown(Ua))T(!0),Na();else if(La&&0<Z.hiddenTags.length)T(!0);else{var Ba=ia.slice(),Ka=mxUtils.indexOf(Ba,Ha);Ba.splice(Ka,1);Z.setHiddenTags(Ba);-R();Z.refresh()}mxEvent.consume(Ua)});Da.appendChild(Sa);if(Z.isEnabled()){Sa=document.createElement("td");Sa.style.verticalAlign="middle";Sa.style.textAlign="center";Sa.style.width="18px";if(null==sa){Sa.style.align="center";Sa.style.width="16px";Oa=document.createElement("img");Oa.setAttribute("src",Editor.trashImage);Oa.setAttribute("title",mxResources.get("removeIt",[Ha]));mxUtils.setOpacity(Oa,La?75:25);Oa.className="geAdaptiveAsset";Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";-Oa.style.width="16px";if(t||Editor.isDarkMode())Oa.style.filter="invert(100%)";mxEvent.addListener(Oa,"click",function(Ua){var Ba=mxUtils.indexOf(ia,Ha);0<=Ba&&ia.splice(Ba,1);Z.removeTagsForCells(Z.model.getDescendants(Z.model.getRoot()),[Ha]);Z.refresh();mxEvent.consume(Ua)});Sa.appendChild(Oa)}else{var Ta=document.createElement("input");Ta.setAttribute("type","checkbox");Ta.style.margin="0px";Ta.defaultChecked=null!=sa&&0<=mxUtils.indexOf(sa,Ha);Ta.checked=Ta.defaultChecked;Ta.style.background=-"transparent";Ta.setAttribute("title",mxResources.get(Ta.defaultChecked?"removeIt":"add",[Ha]));mxEvent.addListener(Ta,"change",function(Ua){Ta.checked?Z.addTagsForCells(Z.getSelectionCells(),[Ha]):Z.removeTagsForCells(Z.getSelectionCells(),[Ha]);mxEvent.consume(Ua)});Sa.appendChild(Ta)}Da.appendChild(Sa)}Ca.appendChild(Da)})(za[Fa]);wa.appendChild(Ca);X.appendChild(wa)}}var Z=this,ia=Z.hiddenTags.slice(),ka=document.createElement("div");ka.style.userSelect="none";ka.style.overflow="hidden";ka.style.padding=-"10px";ka.style.height="100%";var X=document.createElement("div");X.style.position="absolute";X.style.boxSizing="border-box";X.style.userSelect="none";X.style.overflow="auto";X.style.padding="3px";X.style.left="0px";X.style.right="0px";X.style.top="0px";X.style.bottom="0px";ka.appendChild(X);Z.addListener(mxEvent.ROOT,function(){ia=Z.hiddenTags.slice()});var ja=mxUtils.bind(this,function(za,sa){if(l()){za=Z.getAllTags();for(sa=0;sa<za.length;sa++)0>mxUtils.indexOf(ia,za[sa])&&ia.push(za[sa]);ia.sort();-Z.isSelectionEmpty()?Y(ia):Y(ia,Z.getCommonTagsForCells(Z.getSelectionCells()))}});Z.selectionModel.addListener(mxEvent.CHANGE,ja);Z.model.addListener(mxEvent.CHANGE,ja);Z.addListener(mxEvent.REFRESH,ja);var na=document.createElement("div");na.className="geToolbarContainer geDialogToolbar";na.style.position="absolute";na.style.display="flex";na.style.bottom="0px";na.style.left="0px";na.style.right="0px";na.style.height="32px";na.style.overflow="hidden";na.style.padding="3px 4px 4px 4px";na.style.borderWidth=-"1px 0px 0px 0px";na.style.borderStyle="solid";na.style.whiteSpace="nowrap";if(Z.isEnabled()){X.style.bottom="32px";var la=document.createElement("a");la.className="geButton";var va=la.cloneNode(!1);va.style.backgroundImage="url("+Editor.visibleImage+")";va.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(va,"click",function(za){Z.setHiddenTags([]);mxEvent.isShiftDown(za)||(ia=Z.hiddenTags.slice());R();Z.refresh();mxEvent.consume(za)});na.appendChild(va);null!=H&&(la=la.cloneNode(!1),-la.style.backgroundImage="url("+Editor.plusImage+")",la.setAttribute("title",mxResources.get("add")),mxEvent.addListener(la,"click",function(za){H(ia,function(sa){ia=sa;ja()});mxEvent.consume(za)}),na.appendChild(la));ka.appendChild(na)}null!=J&&na.appendChild(J);return{div:ka,refresh:ja}};Graph.prototype.getCustomFonts=function(){var l=this.extFonts;l=null!=l?l.slice():[];for(var t in Graph.customFontElements){var H=Graph.customFontElements[t];l.push({name:H.name,url:H.url})}return l};Graph.prototype.getExtFontCss=-function(){for(var l=this.getCustomFonts(),t="",H="",J=0;J<l.length;J++){var R=l[J].name,T=l[J].url;Graph.isCssFontUrl(T)?t+="@import url("+Graph.rewriteGoogleFontUrl(T)+");\n":H+='@font-face {\nfont-family: "'+R+'";\nsrc: url("'+T+'");\n}\n'}return t+H};Graph.prototype.setFont=function(l,t){Graph.addFont(l,t);var H=Editor.guid();document.execCommand("fontname",!1,H);for(var J=this.cellEditor.textarea.getElementsByTagName("font"),R=!1,T=0;T<J.length;T++)J[T].getAttribute("face")==H&&(R=!0,J[T].setAttribute("face",-l),null!=t?J[T].setAttribute("data-font-src",t):J[T].removeAttribute("data-font-src"));R||document.execCommand("fontname",!1,l)};var E=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return E.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var l=JSON.parse(decodeURIComponent(urlParams.vars));-if(null!=l)for(var t in l)this.globalVars[t]=l[t]}catch(H){null!=window.console&&console.log("Error in vars URL parameter: "+H)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var L=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(l){var t=L.apply(this,arguments);null==t&&null!=this.globalVars&&(t=this.globalVars[l]);return t};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var l=-this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(l.ownerDocument)).decode(l)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var Q=Graph.prototype.getSvg;Graph.prototype.getSvg=function(l,t,H,J,R,T,Y,Z,ia,ka,X,ja,na,la,va,za,sa){if(Editor.mathOutputSize&&this.mathEnabled&&null!=this.container&&document.body.contains(this.container)&&"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset){if(0==this.container.getElementsByTagName("mjx-container").length)try{MathJax.typeset([this.container])}catch(Na){}this.refreshMathBounds()}var wa=-Q.apply(this,arguments);if(null!=ja){var Ca=wa.getAttribute("style");null==Ca&&(Ca="");ja="auto"==ja||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":ja;wa.setAttribute("style",Ca+(" color-scheme: "+ja+";"))}var Fa=X?this.getExtFontCss():"";if(0<Fa.length){var Ha=wa.ownerDocument;Ca=null!=Ha.createElementNS?Ha.createElementNS(mxConstants.NS_SVG,"style"):Ha.createElement("style");null!=Ha.setAttributeNS?Ca.setAttributeNS("type","text/css"):Ca.setAttribute("type",-"text/css");Ca.appendChild(Ha.createTextNode(Fa));wa.getElementsByTagName("defs")[0].appendChild(Ca)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(wa);this.mathEnabled&&(document.body.appendChild(wa),Editor.MathJaxRender(wa),wa.parentNode.removeChild(wa),Ca=wa.ownerDocument.getElementById("MJX-SVG-styles"),null!=Ca&&wa.getElementsByTagName("defs")[0].appendChild(Ca.cloneNode(!0)));return wa};var V=mxCellRenderer.prototype.destroy;-mxCellRenderer.prototype.destroy=function(l){V.apply(this,arguments);null!=l.secondLabel&&(l.secondLabel.destroy(),l.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(l){return[l.shape,l.text,l.secondLabel,l.control]};var K=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){K.apply(this,arguments);this.enumerationState=0};var fa=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(l){null!=l.shape&&this.redrawEnumerationState(l);-return fa.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(l){l=decodeURIComponent(mxUtils.getValue(l.style,"enumerateValue",""));""==l&&(l=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(l)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(l){var t="1"==mxUtils.getValue(l.style,"enumerate",0);t&&null==l.secondLabel?(l.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,-mxConstants.ALIGN_BOTTOM),l.secondLabel.size=12,l.secondLabel.state=l,l.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(l,l.secondLabel)):t||null==l.secondLabel||(l.secondLabel.destroy(),l.secondLabel=null);t=l.secondLabel;if(null!=t){var H=l.view.scale,J=this.createEnumerationValue(l);l=this.graph.model.isVertex(l.cell)?new mxRectangle(l.x+l.width-4*H,l.y+4*H,0,0):mxRectangle.fromPoint(l.view.getPoint(l));t.bounds.equals(l)&&t.value==J&&t.scale==H||(t.bounds=-l,t.value=J,t.scale=H,t.redraw())}};var aa=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();aa.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var da=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){da.apply(this,arguments);this.currentStyle="default-style2"};-Graph.prototype.handleCustomLink=function(l,t){"data:action/json,"==l.substring(0,17)&&(l=JSON.parse(l.substring(17)),null!=l.actions&&this.executeCustomActions(Graph.flattenAnimationActions(l.actions),null,t))};Graph.flattenAnimationActions=function(l){if(!Array.isArray(l))return l;for(var t=[],H=0;H<l.length;H++){var J=l[H];if(null!=J&&null!=J.animation&&Array.isArray(J.animation.steps)){J=Graph.flattenAnimationActions(J.animation.steps);for(var R=0;R<J.length;R++)t.push(J[R])}else t.push(J)}return t};-Graph.smoothScrollContainer=function(l,t,H,J,R,T){T=T||600;if(t!==J||H!==R){l.scrollLeft=t;l.scrollTop=H;var Y="undefined"!=typeof performance&&null!=performance.now?performance.now():Date.now(),Z=J-t,ia=R-H,ka=function(X){X=Math.min(1,(X-Y)/T);var ja=1-Math.pow(1-X,3);l.scrollLeft=t+Z*ja;l.scrollTop=H+ia*ja;1>X&&window.requestAnimationFrame(ka)};window.requestAnimationFrame(ka)}};Graph.applyTransformTransition=function(l,t){t=t||600;var H=l.view.getDrawPane(),J=null!=H?H.parentNode:null;if(null!=-J){var R=J.style.transition;J.style.transition="transform "+t+"ms cubic-bezier(0.16, 1, 0.3, 1)";l.armTransformTransition=!0;var T=function(){J.style.transition=R||"";l.armTransformTransition=!1;J.removeEventListener("transitionend",T)};J.addEventListener("transitionend",T);window.setTimeout(T,t+100)}};Graph.prototype.fitBoundsCssTransform=function(l,t){var H=null!=t?t:10;t=this.view.graphBounds;var J=Math.max(t.x,l.x),R=Math.max(t.y,l.y),T=Math.max(1,Math.min(t.x+t.width,l.x+l.width)-J),Y=Math.max(1,-Math.min(t.y+t.height,l.y+l.height)-R),Z=this.container.clientWidth-H,ia=this.container.clientHeight-H;l=Math.floor(20*Math.min(Z/T,ia/Y))/20;this.view.scaleAndTranslate(l,-t.x,-t.y);J=(J-t.x)*l-Math.max((Z-T*l)/2+H/2,0);H=(R-t.y)*l-Math.max((ia-Y*l)/2+H/2,0);T=this.getBorder();R=t.width*l+2*T-this.container.clientWidth;t=t.height*l+2*T-this.container.clientHeight;this.container.scrollLeft=0>R?0:Math.max(0,Math.min(J,R));this.container.scrollTop=0>t?0:Math.max(0,Math.min(H,t))};Graph.prototype.isGraphTornDown=-function(){return!0===this.destroyed||null==this.container};Graph.prototype.smoothFitWindow=function(l,t,H){if(this.isGraphTornDown())null!=H&&H();else{var J=this.container,R=J.scrollLeft,T=J.scrollTop;this.useCssTransforms?(Graph.applyTransformTransition(this,600),this.fitBoundsCssTransform(l,t)):this.fitWindow(l,t);Graph.smoothScrollContainer(J,R,T,J.scrollLeft,J.scrollTop,600);null!=H&&window.setTimeout(H,600)}};Graph.prototype.scrollCellToVisibleCssTransform=function(l,t){var H=this.view.getState(l);-if(null!=H){var J=this.view.graphBounds,R=this.view.scale;this.view.translate.x===-J.x&&this.view.translate.y===-J.y||this.view.scaleAndTranslate(R,-J.x,-J.y);l=this.container.clientWidth;var T=this.container.clientHeight,Y=this.getBorder(),Z=J.width*R+2*Y-l;Y=J.height*R+2*Y-T;if(null!=t){var ia=(H.x-J.x)*R,ka=(H.y-J.y)*R,X=(H.x+H.width-J.x)*R;J=(H.y+H.height-J.y)*R;var ja=this.container.scrollLeft;H=this.container.scrollTop;ia-t<ja?ja=ia-t:X+t>ja+l&&(ja=X+t-l);ka-t<H?H=ka-t:J+t>H+T&&(H=J+t-T)}else ja=-(H.x+H.width/2-J.x)*R-l/2,H=(H.y+H.height/2-J.y)*R-T/2;this.container.scrollLeft=0>Z?0:Math.max(0,Math.min(ja,Z));this.container.scrollTop=0>Y?0:Math.max(0,Math.min(H,Y))}};Graph.prototype.scrollCellToVisibleBorder=function(l,t){null==t?this.scrollCellToVisible(l):(l=this.view.getState(l),null!=l&&this.scrollRectToVisible(new mxRectangle(-this.view.translate.x+l.x-t,-this.view.translate.y+l.y-t,l.width+2*t,l.height+2*t)))};Graph.prototype.smoothScrollCellToVisible=function(l,t,H){if(this.isGraphTornDown())null!=-H&&H();else{var J=this.container,R=J.scrollLeft,T=J.scrollTop;this.useCssTransforms?this.scrollCellToVisibleCssTransform(l,t):this.scrollCellToVisibleBorder(l,t);Graph.smoothScrollContainer(J,R,T,J.scrollLeft,J.scrollTop,600);null!=H&&window.setTimeout(H,600)}};Graph.prototype.toggleCellsTransient=function(l){l=this.getNodesForCells(l);for(var t=0;t<l.length;t++){var H=l[t].style.opacity;H=""===H||null===H||0<parseFloat(H);l[t].style.opacity=H?0:1}};Graph.prototype.setCellStylesTransient=function(l,-t,H){for(var J=0;J<H.length;J++){var R=this.view.getState(H[J]);null!=R&&null!=R.style&&(null==t?delete R.style[l]:R.style[l]=t,null!=R.shape&&(R.shape.apply(R),R.shape.redraw()),null!=R.text&&(R.text.apply(R),R.text.redraw()))}};Graph.prototype.toggleCellStylesTransient=function(l,t,H){null==t&&(t="0");for(var J=0;J<H.length;J++){var R=this.view.getState(H[J]);if(null!=R&&null!=R.style){var T=mxUtils.getValue(R.style,l,t)?"0":"1";R.style[l]=T;null!=R.shape&&(R.shape.apply(R),R.shape.redraw());null!=-R.text&&(R.text.apply(R),R.text.redraw())}}};Graph.prototype.executeCustomActions=function(l,t,H){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var J=!1,R=0,T=0,Y=mxUtils.bind(this,function(){J||(J=!0,this.model.beginUpdate())}),Z=mxUtils.bind(this,-function(){J&&(J=!1,this.model.endUpdate())}),ia=null==H,ka=function(na){return null!=na.transient?na.transient:ia},X=mxUtils.bind(this,function(){0<R&&R--;0==R&&ja()}),ja=mxUtils.bind(this,function(){if(this.isGraphTornDown())this.stoppingCustomActions=this.executingCustomActions=!1,null!=t&&t();else if(T<l.length){do{var na=this.stoppingCustomActions,la=l[T++],va=[];if(null!=la.open)if(Z(),this.isCustomLink(la.open)){if(!this.customLinkClicked(la.open,H))return}else this.openLink(la.open);null==-la.wait||na||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;X()}),R++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=la.wait?parseInt(la.wait):1E3),Z());null!=la.opacity&&null!=la.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(la.opacity,!0)),la.opacity.value);null!=la.fadeIn&&(R++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(la.fadeIn,!0)),0,1,X,-na?0:la.fadeIn.delay));null!=la.fadeOut&&(R++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(la.fadeOut,!0)),1,0,X,na?0:la.fadeOut.delay));if(null!=la.fadeTo&&null!=la.fadeTo.value){R++;var za=this.getNodesForCells(this.getCellsForAction(la.fadeTo,!0)),sa=na?0:null!=la.fadeTo.delay?la.fadeTo.delay:1E3;Graph.setTransitionForNodes(za,"all "+sa+"ms ease-in-out");Graph.setOpacityForNodes(za,la.fadeTo.value);window.setTimeout(function(){Graph.setTransitionForNodes(za,null);X()},sa)}null!=-la.flow&&(sa=this.getCellsForAction(la.flow,!0),Editor.toggleFlowAnimation(this,sa,!1===la.flow.start?"stop":!0===la.flow.start?"start":"toggle"));null!=la.wipeIn&&(va=va.concat(this.createWipeAnimations(this.getCellsForAction(la.wipeIn,!0),!0)));null!=la.wipeOut&&(va=va.concat(this.createWipeAnimations(this.getCellsForAction(la.wipeOut,!0),!1)));null!=la.popIn&&(va=va.concat(this.createPopAnimations(this.getCellsForAction(la.popIn,!0),!0)));null!=la.popOut&&(va=va.concat(this.createPopAnimations(this.getCellsForAction(la.popOut,-!0),!1)));null!=la.toggle&&(ka(la.toggle)?this.toggleCellsTransient(this.getCellsForAction(la.toggle,!0)):(Y(),this.toggleCells(this.getCellsForAction(la.toggle,!0,!0))));null!=la.show&&(sa=this.getCellsForAction(la.show,!0),Graph.setOpacityForNodes(this.getNodesForCells(sa),1),ka(la.show)||(Y(),this.setCellsVisible(this.getCellsForAction(la.show,!0,!0),!0)));null!=la.hide&&(sa=this.getCellsForAction(la.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(sa),0),ka(la.hide)||(Y(),this.setCellsVisible(this.getCellsForAction(la.hide,-!0,!0),!1)));if(null!=la.toggleStyle&&null!=la.toggleStyle.key){sa=this.getCellsForAction(la.toggleStyle,!0);var wa=null!=la.toggleStyle.defaultValue?la.toggleStyle.defaultValue:"0";ka(la.toggleStyle)?this.toggleCellStylesTransient(la.toggleStyle.key,wa,sa):(Y(),this.toggleCellStyles(la.toggleStyle.key,wa,sa))}null!=la.style&&null!=la.style.key&&(sa=this.getCellsForAction(la.style,!0),ka(la.style)?this.setCellStylesTransient(la.style.key,la.style.value,sa):(Y(),this.setCellStyles(la.style.key,la.style.value,-sa)));sa=[];null!=la.select&&this.isEnabled()&&(sa=this.getCellsForAction(la.select),this.setSelectionCells(sa));null!=la.highlight&&(sa=this.getCellsForAction(la.highlight),this.highlightCells(sa,la.highlight.color,la.highlight.duration,la.highlight.opacity));null!=la.scroll&&(sa=this.getCellsForAction(la.scroll));null!=la.viewbox&&(!0!==la.viewbox.smooth||na?this.useCssTransforms?this.fitBoundsCssTransform(la.viewbox,la.viewbox.border):this.fitWindow(la.viewbox,la.viewbox.border):(R++,this.smoothFitWindow(la.viewbox,-la.viewbox.border,X)));0<sa.length&&(wa=null==la.scroll||null==la.scroll.border||""===la.scroll.border||isNaN(parseFloat(la.scroll.border))?null:parseFloat(la.scroll.border),null==la.scroll||!0!==la.scroll.smooth||na?this.useCssTransforms?this.scrollCellToVisibleCssTransform(sa[0],wa):this.scrollCellToVisibleBorder(sa[0],wa):(R++,this.smoothScrollCellToVisible(sa[0],wa,X)));null!=H&&null!=la.explore&&Graph.exploreFromCell(this,H,la.explore);if(null!=la.tags){if(null!=la.tags.toggle)for(wa=la.tags.toggle,-0==wa.length&&(wa=this.getAllTags()),sa=0;sa<wa.length;sa++)this.toggleHiddenTag(wa[sa]);wa=null;null!=la.tags.hidden&&(null==wa&&(wa=[]),wa=wa.concat(la.tags.hidden));if(null!=la.tags.visible){null==wa&&(wa=[]);var Ca=this.getAllTags();for(sa=0;sa<Ca.length;sa++)0>mxUtils.indexOf(la.tags.visible,Ca[sa])&&0>mxUtils.indexOf(wa,Ca[sa])&&wa.push(Ca[sa])}null!=wa&&this.setHiddenTags(wa);this.refresh()}if(0<va.length){R++;sa=null!=la.steps?la.steps:30;wa=la.delay;Ca=["wipeIn","wipeOut","popIn","popOut"];-for(var Fa=null,Ha=0;Ha<Ca.length;Ha++){var Na=la[Ca[Ha]];null!=Na&&null!=Na.delay&&(Fa=null==Fa?Na.delay:Math.max(Fa,Na.delay))}null!=Fa&&(wa=Fa/sa);this.executeAnimations(va,X,na?1:sa,na?0:wa)}}while(T<l.length&&!0===l[T].immediate&&!this.stoppingCustomActions);0==R?ja():Z()}else this.stoppingCustomActions=this.executingCustomActions=!1,Z(),null!=t&&t()});ja()}};Graph.prototype.doUpdateCustomLinksForCell=function(l,t){var H=this.getLinkForCell(t);null!=H&&"data:action/json,"==H.substring(0,17)&&-this.setLinkForCell(t,this.updateCustomLink(l,H));if(this.isHtmlLabel(t)){var J=document.createElement("div");J.innerHTML=Graph.sanitizeHtml(this.getLabel(t));for(var R=J.getElementsByTagName("a"),T=!1,Y=0;Y<R.length;Y++)H=R[Y].getAttribute("href"),null!=H&&"data:action/json,"==H.substring(0,17)&&(R[Y].setAttribute("href",this.updateCustomLink(l,H)),T=!0);T&&this.labelChanged(t,J.innerHTML)}};Graph.prototype.updateCustomLink=function(l,t){if("data:action/json,"==t.substring(0,17))try{var H=JSON.parse(t.substring(17));-null!=H.actions&&(this.updateCustomLinkActions(l,H.actions),t="data:action/json,"+JSON.stringify(H))}catch(J){}return t};Graph.prototype.updateCustomLinkActions=function(l,t){for(var H=0;H<t.length;H++){var J=t[H],R;for(R in J)this.updateCustomLinkAction(l,J[R],"cells"),this.updateCustomLinkAction(l,J[R],"excludeCells"),this.updateCustomLinkAction(l,J[R],"layers")}};Graph.prototype.updateCustomLinkAction=function(l,t,H){if(null!=t&&null!=t[H]){for(var J=[],R=0;R<t[H].length;R++)if("*"==t[H][R])J.push(t[H][R]);-else{var T=l[t[H][R]];null!=T?""!=T&&J.push(T):J.push(t[H][R])}t[H]=J}};Graph.prototype.getCellsForAction=function(l,t,H){var J="or"===l.tagsMatch?"or":"and",R={},T=[],Y=function(Z){for(var ia=0;ia<Z.length;ia++){var ka=Z[ia].id;R[ka]||(R[ka]=!0,T.push(Z[ia]))}};Y(this.getCellsById(l.cells));Y(this.getCellsForTags(l.tags,null,t,!1,J));Y(H?this.getLayerCells(l.layers):this.getCellsForLayers(l.layers));if(null!=l.excludeCells&&0<l.excludeCells.length){t={};J=!1;for(H=0;H<l.excludeCells.length;H++){if("*"===-l.excludeCells[H]){J=!0;break}t[l.excludeCells[H]]=!0}if(J)return[];l=[];for(H=0;H<T.length;H++)t[T[H].id]||l.push(T[H]);return l}return T};Graph.prototype.getCellsById=function(l){var t=[];if(null!=l)for(var H=0;H<l.length;H++)if("*"==l[H]){var J=this.model.getRoot();t=t.concat(this.model.filterDescendants(function(T){return T!=J},J))}else{var R=this.model.getCell(l[H]);null!=R&&t.push(R)}return t};Graph.prototype.getCellsForLayers=function(l){var t=[];if(Array.isArray(l))for(var H=0;H<l.length;H++){var J=-this.model.getCell(l[H]);null!=J&&(t=t.concat(this.model.filterDescendants(function(R){return R!=J},J)))}return t};Graph.prototype.getLayerCells=function(l){var t=[];if(Array.isArray(l))for(var H=0;H<l.length;H++){var J=this.model.getCell(l[H]);null!=J&&t.push(J)}return t};var ba=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(l){return ba.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(l))};Graph.prototype.setHiddenTags=function(l){this.hiddenTags=l;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};-Graph.prototype.toggleHiddenTag=function(l){var t=mxUtils.indexOf(this.hiddenTags,l);0>t?this.hiddenTags.push(l):0<=t&&this.hiddenTags.splice(t,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(l){if(null==l||0==l.length||0==this.hiddenTags.length)return!1;l=l.split(" ");if(l.length>this.hiddenTags.length)return!1;for(var t=0;t<l.length;t++)if(0>mxUtils.indexOf(this.hiddenTags,l[t]))return!1;return!0};Graph.prototype.getCellsForTags=function(l,t,H,-J,R){var T=[];R="or"===R;if(null!=l){t=null!=t?t:this.model.getDescendants(this.model.getRoot());for(var Y=0,Z={},ia=0;ia<l.length;ia++)0<l[ia].length&&(Z[l[ia]]=!0,Y++);for(ia=0;ia<t.length;ia++)if(H&&this.model.getParent(t[ia])==this.model.root||this.model.isVertex(t[ia])||this.model.isEdge(t[ia])){var ka=this.getTagsForCell(t[ia]),X=!1;if(0<ka.length&&(ka=ka.split(" "),R||ka.length>=l.length)){for(var ja=X=0;ja<ka.length&&X<Y;ja++)null!=Z[ka[ja]]&&X++;X=R?0<X:X==Y}X&&(1!=J||this.isCellVisible(t[ia]))&&-T.push(t[ia])}}return T};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(l){for(var t=null,H=[],J=0;J<l.length;J++){var R=this.getTagsForCell(l[J]);H=[];if(0<R.length){R=R.split(" ");for(var T={},Y=0;Y<R.length;Y++)if(null==t||null!=t[R[Y]])T[R[Y]]=!0,H.push(R[Y]);t=T}else return[]}return H};Graph.prototype.getTagsForCells=function(l){for(var t=[],H={},J=0;J<l.length;J++){var R=this.getTagsForCell(l[J]);-if(0<R.length){R=R.split(" ");for(var T=0;T<R.length;T++)null==H[R[T]]&&(H[R[T]]=!0,t.push(R[T]))}}return t};Graph.prototype.getTagsForCell=function(l){return this.getAttributeForCell(l,"tags","")};Graph.prototype.addTagsForCells=function(l,t){if(0<l.length&&0<t.length){this.model.beginUpdate();try{for(var H=0;H<l.length;H++){for(var J=this.getTagsForCell(l[H]),R=J.split(" "),T=!1,Y=0;Y<t.length;Y++){var Z=mxUtils.trim(t[Y]);""!=Z&&0>mxUtils.indexOf(R,Z)&&(J=0<J.length?J+" "+Z:Z,T=!0)}T&&this.setAttributeForCell(l[H],-"tags",J)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(l,t){if(0<l.length&&0<t.length){this.model.beginUpdate();try{for(var H=0;H<l.length;H++){var J=this.getTagsForCell(l[H]);if(0<J.length){for(var R=J.split(" "),T=!1,Y=0;Y<t.length;Y++){var Z=mxUtils.indexOf(R,t[Y]);0<=Z&&(R.splice(Z,1),T=!0)}T&&this.setAttributeForCell(l[H],"tags",R.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(l){this.model.beginUpdate();try{for(var t=0;t<-l.length;t++)this.model.setVisible(l[t],!this.model.isVisible(l[t]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(l,t){this.model.beginUpdate();try{for(var H=0;H<l.length;H++)this.model.setVisible(l[H],t)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(l,t,H,J){for(var R=0;R<l.length;R++)this.highlightCell(l[R],t,H,J)};Graph.prototype.highlightCell=function(l,t,H,J,R){t=null!=t?t:mxConstants.DEFAULT_VALID_COLOR;H=null!=H?H:1E3;l=this.view.getState(l);-var T=null;null!=l&&(R=null!=R?R:4,R=Math.max(R+1,mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,1)+R),T=new mxCellHighlight(this,t,R,!1),null!=J&&(T.opacity=J),T.highlight(l),window.setTimeout(function(){null!=T.shape&&(mxUtils.setPrefixedStyle(T.shape.node.style,"transition","all 1200ms ease-in-out"),T.shape.node.style.opacity=0);window.setTimeout(function(){T.destroy()},1200)},H));return T};Graph.prototype.addSvgShadow=function(l,t,H,J){J=null!=J?J:!0;var R=Math.ceil(this.svgShadowSize*-this.svgShadowBlur);null!=H&&H||(t=null!=t?t:l.getElementsByTagName("g")[0],null!=t&&(this.updateShadowFilter(t,!0),!isNaN(parseInt(l.getAttribute("width")))&&J&&(l.setAttribute("width",parseInt(l.getAttribute("width"))+R),l.setAttribute("height",parseInt(l.getAttribute("height"))+R),t=l.getAttribute("viewBox"),null!=t&&0<t.length&&(t=t.split(" "),3<t.length&&(w=parseFloat(t[2])+R,h=parseFloat(t[3])+R,l.setAttribute("viewBox",t[0]+" "+t[1]+" "+w+" "+h))))));return R};Graph.prototype.updateShadowFilter=-function(l,t){mxClient.IS_SF||(t?(t=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),l.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+t.cssText+")"):l.style.filter="")};Graph.prototype.setShadowVisible=function(l,t){t=null!=t?t:!0;this.shadowVisible=l;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);t&&this.fireEvent(new mxEventObject("shadowVisibleChanged"));-return Math.ceil(this.svgShadowSize*this.svgShadowBlur)};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var l=this.model.getChildCount(this.model.root),t=0;do var H=this.model.getChildAt(this.model.root,t);while(t++<l&&"1"==mxUtils.getValue(this.getCellStyle(H),"locked","0"));null!=H&&this.setDefaultParent(H)}};-mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=-[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",-STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];-mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",-STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];-mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=-[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",-STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=-[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+-"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",-STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];-mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=-function(l){var t=null;null!=l&&0<l.length&&("ER"==l.substring(0,2)?t="mxgraph.er":"sysML"==l.substring(0,5)&&(t="mxgraph.sysml"));return t};var ha=mxMarker.createMarker;mxMarker.createMarker=function(l,t,H,J,R,T,Y,Z,ia,ka){if(null!=H&&null==mxMarker.markers[H]){var X=this.getPackageForType(H);null!=X&&mxStencilRegistry.getStencil(X)}return ha.apply(this,arguments)};var qa=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(l,t,H,J,R,T){"1"==mxUtils.getValue(t.style,"lineShape",null)&&-l.setFillColor(mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return qa.apply(this,arguments)};PrintDialog.prototype.create=function(l,t,H,J){function R(){wa.value=Math.max(1,Math.min(na,Math.max(parseInt(wa.value),parseInt(sa.value))));sa.value=Math.max(1,Math.min(na,Math.min(parseInt(wa.value),parseInt(sa.value))))}function T(gb){l.lastPrintPagesRadioChecked=za.checked;l.lastPrintSelectionOnlyChecked=Ca.checked;l.lastPrintCropRadioChecked=Ha.checked;l.lastPrintFitRadioChecked=-Na.checked;za.checked&&sa.value<wa.value?(l.lastPrintPagesFromInput=sa.value,l.lastPrintPagesToInput=wa.value):(l.lastPrintPagesFromInput=null,l.lastPrintPagesToInput=null);nb.value=Math.max(1,Math.min(1600,parseInt(nb.value)))+"%";l.lastPrintZoom=nb.value;l.lastPrintBorder=Va.value;l.lastPrintGrid=bb.checked;l.lastPrintShadow=ya.checked;l.lastPrintTransparent=Ra.checked;l.lastPrintInclude=Ya.checked;l.lastPrintSheetsAcross=Qa.value;l.lastPrintSheetsDown=db.value;var jb={};jb.border=parseInt(Va.value);-jb.scale=parseInt(nb.value)/100;jb.grid=bb.checked;jb.shadows=ya.checked;jb.transparent=Ra.checked;jb.includeCopy=Ya.checked;jb.sheetsAcross=parseInt(Qa.value);jb.sheetsDown=parseInt(db.value);jb.pagesFrom=parseInt(sa.value);jb.pagesTo=parseInt(wa.value);jb.allPages=la.checked;jb.selection=Ca.checked;jb.pageView=Fa.checked;jb.crop=Ha.checked;jb.fit=Na.checked;return null!=H?H(!gb,jb):l.print(!gb,jb)}function Y(gb){try{l.hideDialog(),null!=H?T(gb):l.spinner.spin(document.body,mxResources.get("updatingPreview"))&&-window.setTimeout(function(){try{T(gb),l.spinner.stop()}catch(jb){l.handleError(jb)}},0)}catch(jb){l.handleError(jb)}}var Z=l.editor.graph,ia=document.createElement("div");ia.style.display="flex";ia.style.flexDirection="column";ia.style.minHeight="0";var ka=document.createElement("div");ka.style.flex="1 1 auto";ka.style.minHeight="0";ka.style.overflowY="auto";ia.appendChild(ka);var X=document.createElement("h3");mxUtils.write(X,t||mxResources.get("print"));ka.appendChild(X);var ja=1,na=1;X=document.createElement("div");-X.className="geDialogSection";X.style.whiteSpace="nowrap";var la=document.createElement("input");la.style.marginRight="8px";la.setAttribute("type","radio");la.setAttribute("name","pages-printdialog");la.setAttribute("id","gePrintDlgAllPages");var va=document.createElement("div");va.className="geDialogCheckRow";va.appendChild(la);t=document.createElement("label");t.setAttribute("for","gePrintDlgAllPages");mxUtils.write(t,mxResources.get("allPages"));va.appendChild(t);X.appendChild(va);var za=document.createElement("input");-za.style.marginRight="8px";za.setAttribute("type","radio");za.setAttribute("name","pages-printdialog");za.setAttribute("id","gePrintDlgPages");va=document.createElement("div");va.className="geDialogCheckRow";va.appendChild(za);t=document.createElement("label");t.setAttribute("for","gePrintDlgPages");mxUtils.write(t,mxResources.get("pages")+":");va.appendChild(t);var sa=document.createElement("input");sa.style.margin="0 4px";sa.setAttribute("value","1");sa.setAttribute("type","number");sa.setAttribute("min",-"1");sa.style.width="40px";va.appendChild(sa);t=document.createElement("span");mxUtils.write(t,mxResources.get("to"));va.appendChild(t);var wa=sa.cloneNode(!0);va.appendChild(wa);mxEvent.addListener(sa,"focus",function(){za.checked=!0});mxEvent.addListener(wa,"focus",function(){za.checked=!0});mxEvent.addListener(sa,"change",R);mxEvent.addListener(wa,"change",R);if(null!=l.pages&&(na=l.pages.length,null!=l.currentPage))for(t=0;t<na;t++)if(l.currentPage==l.pages[t]){ja=t+1;break}null!=l.lastPrintPagesFromInput&&-null!=l.lastPrintPagesToInput?(sa.value=Math.min(na,Math.max(1,l.lastPrintPagesFromInput)),wa.value=Math.min(na,Math.max(1,l.lastPrintPagesToInput))):(sa.value=ja,wa.value=ja);sa.setAttribute("max",na);wa.setAttribute("max",na);t=mxUtils.button(mxResources.get("currentPage"),function(gb){sa.value=ja;wa.value=ja;za.checked=!0});t.className="geBtn";t.setAttribute("title",mxResources.get("currentPage"));t.style.marginLeft="4px";t.style.maxWidth="100px";va.appendChild(t);X.appendChild(va);1<na&&ka.appendChild(X);-va=document.createElement("div");va.className="geDialogCheckRow";var Ca=document.createElement("input");Ca.setAttribute("name","pages-printdialog");Ca.setAttribute("type",1==na?"checkbox":"radio");Ca.setAttribute("id","gePrintDlgSelectionOnly");Ca.style.marginRight="8px";Z.isSelectionEmpty()&&Ca.setAttribute("disabled","disabled");Z.isEnabled()&&(va.appendChild(Ca),t=document.createElement("label"),t.setAttribute("for","gePrintDlgSelectionOnly"),mxUtils.write(t,mxResources.get("selectionOnly")),va.appendChild(t));-Z.isEnabled()&&(1<na?X.appendChild(va):(t=document.createElement("div"),t.className="geDialogSection",t.appendChild(va),ka.appendChild(t)));!l.isPagesEnabled()||l.lastPrintPagesRadioChecked?za.checked=!0:!Z.isSelectionEmpty()&&l.lastPrintSelectionOnlyChecked?Ca.checked=!0:la.checked=!0;Z=l.addAdvancedSection(ka);ka=Z.content;X=document.createElement("div");X.className="geDialogCheckRow";var Fa=document.createElement("input");Fa.style.marginRight="8px";Fa.setAttribute("type","radio");Fa.setAttribute("name",-"printSize");Fa.setAttribute("id","gePrintDlgPageView");X.appendChild(Fa);t=document.createElement("label");t.setAttribute("for","gePrintDlgPageView");mxUtils.write(t,mxResources.get("pageView"));X.appendChild(t);mxEvent.addListener(X,"click",function(){Fa.checked=!0});ka.appendChild(X);X=document.createElement("div");X.className="geDialogCheckRow";var Ha=document.createElement("input");Ha.style.marginRight="8px";Ha.setAttribute("type","radio");Ha.setAttribute("name","printSize");Ha.setAttribute("id",-"gePrintDlgCrop");X.appendChild(Ha);t=document.createElement("label");t.setAttribute("for","gePrintDlgCrop");mxUtils.write(t,mxResources.get("crop"));X.appendChild(t);mxEvent.addListener(X,"click",function(){Ha.checked=!0});ka.appendChild(X);X=document.createElement("div");X.className="geDialogCheckRow";X.style.alignItems="flex-start";var Na=document.createElement("input");Na.style.marginTop="4px";Na.setAttribute("type","radio");Na.setAttribute("name","printSize");X.appendChild(Na);va=document.createElement("table");-va.style.display="inline-block";va.style.borderSpacing="0";var La=document.createElement("tbody"),Da=document.createElement("tr"),Sa=Da.cloneNode(!0),Oa=document.createElement("td"),Ta=Oa.cloneNode(!0),Ua=Oa.cloneNode(!0),Ba=Oa.cloneNode(!0),Ka=Oa.cloneNode(!0),ab=Oa.cloneNode(!0);Oa.style.textAlign="right";Ba.style.textAlign="right";mxUtils.write(Oa,mxResources.get("fitTo"));mxEvent.addListener(X,"click",function(gb){mxEvent.getSource(gb)!=Na&&(Na.checked=!Na.checked)});var Qa=document.createElement("input");-Qa.style.margin="0 2px";Qa.style.boxSizing="border-box";Qa.setAttribute("value",l.lastPrintSheetsAcross||"1");Qa.setAttribute("min","1");Qa.setAttribute("type","number");Qa.style.width="40px";Ta.appendChild(Qa);t=document.createElement("span");mxUtils.write(t,mxResources.get("fitToSheetsAcross"));Ua.appendChild(t);mxUtils.write(Ba,mxResources.get("fitToBy"));var db=Qa.cloneNode(!0);db.setAttribute("value",l.lastPrintSheetsDown||"1");Ka.appendChild(db);mxEvent.addListener(Qa,"click",function(gb){Na.checked=-!0;mxEvent.consume(gb)});mxEvent.addListener(db,"click",function(gb){Na.checked=!0;mxEvent.consume(gb)});l.lastPrintCropRadioChecked?Ha.checked=!0:l.lastPrintFitRadioChecked?Na.checked=!0:Fa.checked=!0;t=document.createElement("span");mxUtils.write(t,mxResources.get("fitToSheetsDown"));ab.appendChild(t);Da.appendChild(Oa);Da.appendChild(Ta);Da.appendChild(Ua);Sa.appendChild(Ba);Sa.appendChild(Ka);Sa.appendChild(ab);La.appendChild(Da);La.appendChild(Sa);va.appendChild(La);X.appendChild(va);ka.appendChild(X);-ka=document.createElement("div");ka.className="geDialogSection";t=document.createElement("div");t.className="geDialogFormRow";X=document.createElement("label");X.className="geDialogFormLabel";X.setAttribute("for","gePrintDlgBorder");mxUtils.write(X,mxResources.get("borderWidth"));t.appendChild(X);var Va=document.createElement("input");Va.setAttribute("type","number");Va.setAttribute("min","0");Va.setAttribute("id","gePrintDlgBorder");Va.style.width="40px";Va.value=null!=l.lastPrintBorder?l.lastPrintBorder:-mxPrintPreview.prototype.pageMargin;t.appendChild(Va);X=document.createElement("label");X.setAttribute("for","gePrintDlgZoom");X.style.marginLeft="12px";X.style.marginRight="4px";mxUtils.write(X,mxResources.get("zoom"));t.appendChild(X);var nb=document.createElement("input");nb.setAttribute("id","gePrintDlgZoom");nb.style.width="60px";nb.value=null!=l.lastPrintZoom?l.lastPrintZoom:"100%";t.appendChild(nb);ka.appendChild(t);X=document.createElement("div");X.className="geDialogCheckRow";var bb=document.createElement("input");-bb.setAttribute("type","checkbox");bb.setAttribute("id","gePrintDlgGrid");bb.style.marginRight="8px";bb.checked=null!=l.lastPrintGrid?l.lastPrintGrid:!1;X.appendChild(bb);t=document.createElement("label");t.setAttribute("for","gePrintDlgGrid");mxUtils.write(t,mxResources.get("grid"));X.appendChild(t);ka.appendChild(X);X=document.createElement("div");X.className="geDialogCheckRow";var ya=document.createElement("input");ya.setAttribute("type","checkbox");ya.setAttribute("id","gePrintDlgShadows");ya.style.marginRight=-"8px";ya.checked=null!=l.lastPrintShadow?l.lastPrintShadow:!1;X.appendChild(ya);t=document.createElement("label");t.setAttribute("for","gePrintDlgShadows");mxUtils.write(t,mxResources.get("shadows"));X.appendChild(t);l.isOffline()&&!mxClient.IS_CHROMEAPP||X.appendChild(l.createHelpIcon("https://www.drawio.com/docs/manual/export/print-diagram/#shadows-in-print-and-pdf-export"));Editor.enableShadowOption||(X.style.display="none");ka.appendChild(X);var Ra=document.createElement("input");Ra.setAttribute("type",-"checkbox");Ra.setAttribute("id","gePrintDlgTransparent");Ra.style.marginRight="8px";Ra.checked=null!=l.lastPrintTransparent?l.lastPrintTransparent:!1;null!=H&&(X=document.createElement("div"),X.className="geDialogCheckRow",X.appendChild(Ra),t=document.createElement("label"),t.setAttribute("for","gePrintDlgTransparent"),mxUtils.write(t,mxResources.get("transparentBackground")),X.appendChild(t),ka.appendChild(X));var Ya=document.createElement("input");Ya.setAttribute("type","checkbox");Ya.setAttribute("id",-"gePrintDlgInclude");Ya.style.marginRight="8px";Ya.checked=null!=l.lastPrintInclude?l.lastPrintInclude:Editor.defaultIncludeDiagram;null==H||mxClient.IS_CHROMEAPP||"draw.io"!=l.getServiceName()||(X=document.createElement("div"),X.className="geDialogCheckRow",X.appendChild(Ya),t=document.createElement("label"),t.setAttribute("for","gePrintDlgInclude"),mxUtils.write(t,mxResources.get("includeCopyOfMyDiagram")),X.appendChild(t),ka.appendChild(X));Z.wrapper.appendChild(ka);t=document.createElement("div");-t.style.flex="0 0 auto";t.style.marginTop="16px";t.style.textAlign="right";t.style.whiteSpace="nowrap";l.isOffline()&&!mxClient.IS_CHROMEAPP||null!=H||t.appendChild(l.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));Z=mxUtils.button(mxResources.get("cancel"),function(){l.hideDialog()});Z.className="geBtn";l.editor.cancelFirst&&t.appendChild(Z);PrintDialog.previewEnabled&&null==H&&(ka=mxUtils.button(mxResources.get("preview"),function(){Y(!1)}),ka.className="geBtn",t.appendChild(ka));-J=null!=J?J:null!=H?"export":PrintDialog.previewEnabled?"print":"ok";J=mxUtils.button(mxResources.get(J),function(){Y(!0)});J.className="geBtn gePrimaryBtn";t.appendChild(J);l.editor.cancelFirst||t.appendChild(Z);ia.appendChild(t);if(l.editor.isChromelessView()){var lb=function(){Editor.isDarkMode()?(ia.classList.add("geDarkMode"),ia.style.colorScheme="dark"):(ia.classList.remove("geDarkMode"),ia.style.colorScheme="light")};l.addListener("darkModeChanged",lb);lb();var ub=function(gb,jb){gb=jb.getProperty("dialog");-ia.parentNode==gb.container&&(l.editor.removeListener(ub),l.removeListener(lb))};l.editor.addListener("hideDialog",ub)}this.container=ia};var ra=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var l=this.image;null!=l&&null!=l.src&&Graph.isPageLink(l.src)&&(l={originalSrc:l.src});-this.page.viewState.backgroundImage=l}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else ra.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),-null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(l=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=l?l:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.parseAnimationScript=function(l){var t=[];if(null==l)return t;var H=function(ia){if(null!=ia)return ia=-parseFloat(ia),!isNaN(ia)&&0<=ia?ia:void 0},J={fade:!0,pop:!0,wipe:!0};l=l.split("\n");for(var R=0;R<l.length;R++){var T=mxUtils.trim(l[R]);if(""!=T&&"#"!=T.charAt(0)){T=T.split(/\s+/);var Y={action:T[0],cell:T[1],arg:T[2]};if("wait"==Y.action){if(Y.delay=parseFloat(Y.cell),isNaN(Y.delay)||0>Y.delay)Y.delay=1E3}else if("setOpacity"==Y.action)Y.opacity=parseFloat(T[2]),isNaN(Y.opacity)&&(Y.opacity=1),Y.opacity=Math.max(0,Math.min(1,Y.opacity)),Y.duration=H(T[3]),Y.arg=void 0;else if("show"==Y.action){if(null!=-Y.arg&&!J[Y.arg]){var Z=H(Y.arg);null!=Z&&(Y.duration=Z,Y.arg=void 0)}null==Y.duration&&(Y.duration=H(T[3]))}else"hide"==Y.action&&(Y.duration=H(T[2]),Y.arg=void 0);t.push(Y)}}return t};Editor.animationFadeDelay=400;Editor.canBatchAnimationSteps=function(l,t){return l.action!=t.action||"wait"==l.action||(l.arg||"")!=(t.arg||"")||(null!=l.opacity?l.opacity:"")!=(null!=t.opacity?t.opacity:"")||(null!=l.duration?l.duration:"")!=(null!=t.duration?t.duration:"")?!1:!0};Editor.convertLegacyAnimationStep=-function(l){if("wait"==l.action)return{wait:l.delay};var t="all"==l.cell?"*":l.cell;if(null==t)return null;var H={cells:[t]};if(null!=l.duration)H.delay=l.duration;else if("show"==l.action&&"fade"==l.arg)H.delay=Editor.animationFadeDelay;else if("hide"==l.action||"setOpacity"==l.action)H.delay=Editor.animationFadeDelay;return"show"==l.action?"fade"==l.arg?{fadeIn:H}:"pop"==l.arg?{popIn:H}:{wipeIn:H}:"hide"==l.action?{fadeOut:H}:"setOpacity"==l.action?(H.value=l.opacity,{fadeTo:H}):"flow"==l.action?-(t={cells:[t]},"start"==l.arg?t.start=!0:"stop"==l.arg&&(t.start=!1),{flow:t}):null};Editor.convertLegacyAnimation=function(l){l=Editor.parseAnimationScript(l);for(var t=[{opacity:{cells:["*"],value:0}}],H=null,J=function(){null!=H&&(t.push(H),H=null)},R=function(Z){null==H&&(H={});for(var ia in Z){var ka=Z[ia],X;if(X=null!=H[ia]&&null!=ka&&Array.isArray(H[ia].cells)&&Array.isArray(ka.cells))X=H[ia],X=X.delay===ka.delay&&X.value===ka.value&&X.start===ka.start;if(X)for(X=0;X<ka.cells.length;X++)H[ia].cells.push(ka.cells[X]);-else null!=H[ia]&&(J(),H={}),H[ia]=ka}},T=0;T<l.length;T++){var Y=Editor.convertLegacyAnimationStep(l[T]);null!=Y&&(null!=Y.wait?(J(),t.push(Y)):R(Y))}J();return{animation:{steps:t}}};Editor.parseAnimationData=function(l){var t=function(J){null==J&&(J={});Array.isArray(J.steps)||(J.steps=[]);J.loop=null==J.loop?!0:!!J.loop;J.enabled=null==J.enabled?!0:!!J.enabled;return J};if(null==l||""===l)return t({steps:[]});if("string"==typeof l){var H=mxUtils.trim(l);return"{"==H.charAt(0)||"["==H.charAt(0)?-Editor.parseAnimationData(JSON.parse(H)):t(Editor.convertLegacyAnimation(l).animation)}return null!=l.animation&&null!=l.animation.steps?t(l.animation):Array.isArray(l.steps)?t(l):t({steps:[]})};Editor.AnimationPlayer=function(l,t){this.graph=l;this.data=Editor.parseAnimationData(t);this.cancelled=this.running=!1;this.snapshot=null};Editor.ANIMATION_ALL="*";Editor.collectAnimatableCells=function(l){var t=[],H;for(H in l.cells){var J=l.cells[H];(l.isVertex(J)||l.isEdge(J))&&t.push(J)}return t};Editor.AnimationPlayer.prototype.collectReferencedCells=-function(){for(var l=this.data.steps||[],t={},H=[],J=0;J<l.length;J++){var R=l[J],T;for(T in R)if("wait"!=T&&"open"!=T){var Y=R[T];if("object"===typeof Y&&null!=Y){Y=this.graph.getCellsForAction(Y,!0);for(var Z=0;Z<Y.length;Z++)t[Y[Z].id]||(t[Y[Z].id]=!0,H.push(Y[Z]))}}}return H};Editor.AnimationPlayer.prototype.snapshotOpacity=function(){var l=this.collectReferencedCells();l=this.graph.getNodesForCells(l);this.snapshot=[];for(var t=0;t<l.length;t++)this.snapshot.push({node:l[t],opacity:l[t].style.opacity})};-Editor.AnimationPlayer.prototype.restoreOpacity=function(){if(null!=this.snapshot){for(var l=0;l<this.snapshot.length;l++)Graph.setTransitionForNodes([this.snapshot[l].node],null),this.snapshot[l].node.style.opacity=this.snapshot[l].opacity;this.snapshot=null}};Editor.AnimationPlayer.prototype.play=function(l){if(!this.running&&null!=this.graph&&!this.graph.isGraphTornDown()){l=l||{};this.running=!0;this.cancelled=!1;this.graph.stoppingCustomActions=!1;this.graph.view.validate();var t=this,H=this.data.steps||-[],J=function(T,Y){if(null==t.graph||t.graph.isGraphTornDown())t.running=!1;else if(t.cancelled||T>=H.length)Y();else{for(var Z=T+1;Z<H.length&&!0===H[Z].immediate&&!t.cancelled;)Z++;if("function"==typeof l.onStep)try{l.onStep(T,Z)}catch(ia){}t.graph.executeCustomActions(Graph.flattenAnimationActions(H.slice(T,Z)),function(){J(Z,Y)},null)}},R=function(){null==t.graph||t.graph.isGraphTornDown()?t.running=!1:t.cancelled?(t.restoreOpacity(),t.running=!1):(t.snapshotOpacity(),J(0,function(){if(t.cancelled)t.restoreOpacity(),-t.running=!1;else{if("function"==typeof l.onStep)try{l.onStep(-1)}catch(T){}l.loop?(t.graph.refresh(),t.restoreOpacity(),window.setTimeout(R,0)):(t.running=!1,t.restoreOpacity(),null!=l.done&&l.done())}}))};l.defer?window.setTimeout(R,0):R()}};Editor.AnimationPlayer.prototype.stop=function(){this.cancelled=!0;null!=this.graph&&(this.graph.stoppingCustomActions=!0);for(var l=[],t=this.collectReferencedCells(),H=0;H<t.length;H++)this.graph.getModel().isEdge(t[H])&&l.push(t[H]);0<l.length&&Editor.toggleFlowAnimation(this.graph,-l,"stop")};Editor.toggleFlowAnimation=function(l,t,H){H=H||"toggle";for(var J=0;J<t.length;J++)if(l.getModel().isEdge(t[J])){var R=l.view.getState(t[J]);if(null!=R&&null!=R.shape){var T=null!=R.shape.getFlowAnimationPath?R.shape.getFlowAnimationPath():null;if(null!=T){var Y="mxEdgeFlow"==T.getAttribute("class"),Z="start"==H||"toggle"==H&&!Y;Y="stop"==H||"toggle"==H&&Y;R="1"==mxUtils.getValue(R.style,mxConstants.STYLE_DASHED,"0");Y?(T.removeAttribute("class"),R||T.removeAttribute("stroke-dasharray")):-Z&&(T.setAttribute("class","mxEdgeFlow"),R||T.setAttribute("stroke-dasharray","8"))}}}};Editor.playAnimationOnGraph=function(l,t){var H=l.getModel().getRoot(),J=null;null!=H.value&&"object"==typeof H.value&&(J=H.value.getAttribute("animation"));if(null==J||""==J)return null;try{var R=Editor.parseAnimationData(J)}catch(Y){return null}if(!R.steps||0==R.steps.length||!1===R.enabled)return null;H={};if(null!=t)for(var T in t)H[T]=t[T];null==H.loop&&(H.loop=R.loop);null==H.defer&&(H.defer=!0);l=new Editor.AnimationPlayer(l,-R);l.play(H);return l};Editor.installAnimationStyles=function(){if(!Editor.animationStylesInstalled){Editor.animationStylesInstalled=!0;try{var l=document.createElement("style");l.type="text/css";l.appendChild(document.createTextNode(".mxEdgeFlow { animation: mxEdgeFlow 0.5s linear infinite; }@keyframes mxEdgeFlow { to { stroke-dashoffset: -16; } }"));document.getElementsByTagName("head")[0].appendChild(l)}catch(t){}}};Editor.installAnimationStyles()})();(function(){EditorUi.VERSION="30.3.13";EditorUi.CSV_ELK_LAYOUTS={verticalflow:{layout:"elkLayered",config:{"elk.direction":"DOWN","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},horizontalflow:{layout:"elkLayered",config:{"elk.direction":"RIGHT","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED",+mxUtils.bind(this,function(){if(0==J){for(var ia=[H[0]],ja=1;ja<H.length;ja++){var X=H[ja].indexOf(")");ia.push('url("');ia.push(this.cachedFonts[Editor.trimCssUrl(H[ja].substring(0,X))]);ia.push('"'+H[ja].substring(X))}t(ia.join(""))}});if(0<H.length){for(l=1;l<H.length;l++){var T=H[l].indexOf(")"),Y=null,Z=H[l].indexOf("format(",T);0<Z&&(Y=Editor.trimCssUrl(H[l].substring(Z+7,H[l].indexOf(")",Z))));mxUtils.bind(this,function(ia){var ja=this.cachedFonts[ia];if(null==ja){var X=[];this.cachedFonts[ia]=+X;J++;ja="application/x-font-ttf";if("svg"==Y||/(\.svg)($|\?)/i.test(ia))ja="image/svg+xml";else if("otf"==Y||"embedded-opentype"==Y||/(\.otf)($|\?)/i.test(ia))ja="application/x-font-opentype";else if("woff"==Y||/(\.woff)($|\?)/i.test(ia))ja="application/font-woff";else if("woff2"==Y||/(\.woff2)($|\?)/i.test(ia))ja="application/font-woff2";else if("eot"==Y||/(\.eot)($|\?)/i.test(ia))ja="application/vnd.ms-fontobject";else if("sfnt"==Y||/(\.sfnt)($|\?)/i.test(ia))ja="application/font-sfnt";var ka=+mxUtils.bind(this,function(na){this.cachedFonts[ia]=na;J--;R();for(na=0;na<X.length;na++)X[na]()});this.mapFontUrl(ja,ia,mxUtils.bind(this,function(na,la){this.loadUrl(la,function(ua){ka(ua)},function(ua){ka(ia)},!0,null,"data:"+na+";charset=utf-8;base64,")}))}else"string"!=typeof ja&&(J++,ja.push(function(){J--;R()}))})(Editor.trimCssUrl(H[l].substring(0,T)),Y)}R()}else t(l)};Editor.prototype.loadFonts=function(l){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,+function(t){this.resolvedFontCss=t;null!=l&&l()})):null!=l&&l()};Editor.prototype.createGoogleFontCache=function(){var l={},t;for(t in Graph.fontMapping)Graph.isCssFontUrl(t)&&(l[t]=Graph.fontMapping[t]);return l};Editor.prototype.embedExtFonts=function(l){var t=this.graph.getCustomFonts();if(0<t.length){var H=[],J=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var R=mxUtils.bind(this,function(){0==J&&this.embedCssFonts(H.join(""),l)}),T=0;T<t.length;T++)mxUtils.bind(this,+function(Y,Z){Graph.isCssFontUrl(Z)?null==this.cachedGoogleFonts[Z]?(J++,this.loadUrl(Graph.rewriteGoogleFontUrl(Z),mxUtils.bind(this,function(ia){this.cachedGoogleFonts[Z]=ia;H.push(ia+"\n");J--;R()}),mxUtils.bind(this,function(ia){J--;H.push("@import url("+Z+");\n");R()}))):H.push(this.cachedGoogleFonts[Z]+"\n"):H.push('@font-face {font-family: "'+Y+'";src: url("'+Z+'")}\n')})(t[T].name,t[T].url);R()}else l()};Editor.prototype.addMathCss=function(l){l=l.getElementsByTagName("defs");if(null!=l&&+0<l.length)for(var t=document.getElementsByTagName("style"),H=0;H<t.length;H++){var J=mxUtils.getTextContent(t[H]);0>J.indexOf("mxPageSelector")&&0<J.indexOf("MathJax")&&l[0].appendChild(t[H].cloneNode(!0))}};Editor.prototype.addFontCss=function(l,t){t=null!=t?t:this.absoluteCssFonts(this.fontCss);if(null!=t){var H=mxUtils.getSvgDefs(l),J=t.split("\n");t=[];for(var R=[],T=0;T<J.length;T++)"@import"==J[T].substring(0,7)?t.push(J[T]):R.push(J[T]);l=l.ownerDocument;l=null!=l.createElementNS?l.createElementNS(mxConstants.NS_SVG,+"style"):l.createElement("style");l.setAttribute("type","text/css");0<t.length&&(mxUtils.setTextContent(l,t.join("\n")),H.appendChild(l));0<R.length&&(l=l.cloneNode(!1),mxUtils.setTextContent(l,R.join("\n")),H.appendChild(l))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(l,t,H){var J=mxClient.IS_FF?8192:16384;return Math.min(H,Math.min(J/l,J/t))};Editor.prototype.exportToCanvas=function(l,t,H,J,R,+T,Y,Z,ia,ja,X,ka,na,la,ua,za,sa,wa){try{T=null!=T?T:!0;Y=null!=Y?Y:!0;ka=null!=ka?ka:this.graph;na=null!=na?na:0;var Ca=ia?null:ka.background;Ca==mxConstants.NONE&&(Ca=null);null==Ca&&(Ca=J);null==Ca&&0==ia&&(Ca="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(ka.getSvg(null,null,na,la,null,Y,null,null,null,ja,null,za,sa,wa),mxUtils.bind(this,function(Fa){try{Fa.style.setProperty("-webkit-font-smoothing","antialiased");Fa.style.setProperty("-moz-osx-font-smoothing","grayscale");var Ha=+new Image;Ha.onload=mxUtils.bind(this,function(){try{var La=function(){mxClient.IS_SF?window.setTimeout(function(){Ta.drawImage(Ha,0,0);l(Da,Fa)},0):(Ta.drawImage(Ha,0,0),l(Da,Fa))},Da=document.createElement("canvas"),Sa=parseInt(Fa.getAttribute("width")),Oa=parseInt(Fa.getAttribute("height"));Z=null!=Z?Z:1;null!=t&&(Z=T?Math.min(1,Math.min(3*t/(4*Oa),t/Sa)):t/Sa);Z=this.getMaxCanvasScale(Sa,Oa,Z);Sa=Math.ceil(Z*Sa);Oa=Math.ceil(Z*Oa);Da.setAttribute("width",Sa);Da.setAttribute("height",Oa);var Ta=+Da.getContext("2d");if(null!=Ca){var Ua=mxUtils.getLightDarkColor(Ca);Ta.beginPath();Ta.rect(0,0,Sa,Oa);Ta.fillStyle="dark"==za&&"none"!=ka.getAdaptiveColors()?Ua.dark:Ua.light;Ta.fill()}1!=Z&&Ta.scale(Z,Z);if(ua){var Ba=ka.view,Ka=Ba.scale;Ba.scale=1;var ab=btoa(unescape(encodeURIComponent(Ba.createSvgGrid(Ba.gridColor))));Ba.scale=Ka;ab="data:image/svg+xml;base64,"+ab;var Qa=ka.gridSize*Ba.gridSteps*Z,db=ka.getGraphBounds(),Va=Ba.translate.x*Ka,nb=Ba.translate.y*Ka,bb=Va+(db.x-Va)/Ka-na,ya=nb+(db.y-+nb)/Ka-na,Ra=new Image;Ra.onload=function(){try{for(var Ya=-Math.round(Qa-mxUtils.mod((Va-bb)*Z,Qa)),lb=-Math.round(Qa-mxUtils.mod((nb-ya)*Z,Qa));Ya<Sa;Ya+=Qa)for(var ub=lb;ub<Oa;ub+=Qa)Ta.drawImage(Ra,Ya/Z,ub/Z);La()}catch(gb){null!=R&&R(gb)}};Ra.onerror=function(Ya){null!=R&&R(Ya)};Ra.src=ab}else La()}catch(Ya){null!=R&&R(Ya)}});Ha.onerror=function(La){null!=R&&R(La)};ja&&this.graph.addSvgShadow(Fa);this.graph.mathEnabled&&this.addMathCss(Fa);var Na=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&+this.addFontCss(Fa,this.resolvedFontCss),Ha.src=Editor.createSvgDataUri(mxUtils.getXml(Fa))}catch(La){null!=R&&R(La)}});this.embedExtFonts(mxUtils.bind(this,function(La){try{null!=La&&this.addFontCss(Fa,La),this.loadFonts(Na)}catch(Da){null!=R&&R(Da)}}))}catch(La){null!=R&&R(La)}}),H,X)}catch(Fa){null!=R&&R(Fa)}};Editor.crcTable=[];for(var u=0;256>u;u++)for(var n=u,y=0;8>y;y++)n=1==(n&1)?3988292384^n>>>1:n>>>1,Editor.crcTable[u]=n;Editor.updateCRC=function(l,t,H,J){for(var R=0;R<J;R++)l=Editor.crcTable[(l^+t.charCodeAt(H+R))&255]^l>>>8;return l};Editor.crc32=function(l){for(var t=-1,H=0;H<l.length;H++)t=t>>>8^Editor.crcTable[(t^l.charCodeAt(H))&255];return(t^-1)>>>0};Editor.writeGraphModelToPng=function(l,t,H,J,R){function T(X,ka){var na=ia;ia+=ka;return X.substring(na,ia)}function Y(X){X=T(X,4);return X.charCodeAt(3)+(X.charCodeAt(2)<<8)+(X.charCodeAt(1)<<16)+(X.charCodeAt(0)<<24)}function Z(X){return String.fromCharCode(X>>24&255,X>>16&255,X>>8&255,X&255)}l=l.substring(l.indexOf(",")+1);l=window.atob?+atob(l):Base64.decode(l,!0);var ia=0;if(T(l,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=R&&R();else if(T(l,4),"IHDR"!=T(l,4))null!=R&&R();else{T(l,17);R=l.substring(0,ia);do{var ja=Y(l);if("IDAT"==T(l,4)){R=l.substring(0,ia-8);"pHYs"==t&&"dpi"==H?(H=Math.round(J/.0254),H=Z(H)+Z(H)+String.fromCharCode(1)):H=H+String.fromCharCode(0)+("zTXt"==t?String.fromCharCode(0):"")+J;J=4294967295;J=Editor.updateCRC(J,t,0,4);J=Editor.updateCRC(J,H,0,H.length);R+=Z(H.length)+t+H+Z(J^+4294967295);R+=l.substring(ia-8,l.length);break}R+=l.substring(ia-8,ia-4+ja);T(l,ja);T(l,4)}while(ja);return"data:image/png;base64,"+(window.btoa?btoa(R):Base64.encode(R,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var B=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(l,t){B.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var P=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=+function(){P.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(l,t,H){var J=null;if(null!=H)return null;null!=l.editor.graph.getModel().getParent(t)?J=t.getId():null!=l.currentPage&&(J=l.currentPage.getId());return J});if(null!=window.StyleFormatPanel){var G=Format.prototype.init;Format.prototype.init=function(){G.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",+this.update)};var O=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?O.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(l){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var U=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(l){l=U.apply(this,arguments);var t=this.editorUi,+H=t.editor.graph;if(H.isEnabled()){var J=t.getCurrentFile();null!=J&&J.isAutosaveOptional()&&l.appendChild(this.createOption(mxResources.get("autosave"),function(){return t.editor.autosave},function(T){t.editor.setAutosave(T);t.editor.autosave&&J.isModified()&&J.fileChanged()},{install:function(T){this.listener=function(){T(t.editor.autosave)};t.editor.addListener("autosaveChanged",this.listener)},destroy:function(){t.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&H.isEnabled()&&+"undefined"!==typeof MathJax){var R=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return H.mathEnabled},function(T){t.actions.get("mathematicalTypesetting").funct()},{install:function(T){this.listener=function(){T(H.mathEnabled)};t.addListener("mathEnabledChanged",this.listener)},destroy:function(){t.removeListener(this.listener)}});l.appendChild(R);(!t.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&R.appendChild(t.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return l};+mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(l,t){return 0<mxUtils.getValue(l.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.ellipse.prototype.customProperties=+[{name:"centerRadius",dispName:"Center Radius",type:"float",min:0,defVal:0},{name:"centerColor",dispName:"Center Color",type:"color",defVal:null,primary:!0,isVisible:function(l,t){return 0<mxUtils.getValue(l.style,"centerRadius",0)}}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=+[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",+dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},+{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2,isVisible:function(l){return"0"==mxUtils.getValue(l.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(l){return"1"==mxUtils.getValue(l.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,+defVal:.25,isVisible:function(l){return"0"==mxUtils.getValue(l.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:25,isVisible:function(l){return"1"==mxUtils.getValue(l.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,+min:0,max:1},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",+dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder3.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlState.prototype.customProperties=+[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.step.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",type:"float",min:0,defVal:20},{name:"fixedSize",dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},+{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.note2.prototype.customProperties=+[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.card.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20},+{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",dispName:"Left"},+{val:"right",dispName:"Right"}]},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},{name:"swimlaneBody",+dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},{name:"separatorColor",dispName:"Separator Color",type:"color",defVal:null},{name:"fixedHeader",dispName:"Fixed Header",type:"bool",defVal:!0,getDefaultValue:function(l,t){l=mxCellRenderer.defaultShapes[mxUtils.getValue(l.style,"shape","")];return null!=l&&null!=l.prototype.fixedHeaderDefault?l.prototype.fixedHeaderDefault?"1":"0":"1"}}];mxCellRenderer.defaultShapes.table.prototype.customProperties=+[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=+mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",+min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0},{name:"imageAlign",+dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},{name:"imageVerticalAlign",dispName:"Image Vertical Align",type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",type:"float",min:0,defVal:24},{name:"arcSize",+dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(l,t){return 0<mxUtils.getValue(l.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=+[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",+min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=+[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.cross.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.corner.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.tee.prototype.customProperties=+[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.umlLifeline.prototype.customProperties=[{name:"participant",dispName:"Participant",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName:"Actor"},{val:"umlBoundary",dispName:"Boundary"},{val:"umlEntity",dispName:"Entity"},{val:"umlControl",dispName:"Control"}]},{name:"size",dispName:"Height",type:"float",defVal:40,+min:0},{name:"lifelineMirror",dispName:"Mirror Head",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:"width",dispName:"Title Width",type:"float",defVal:60,min:0},{name:"height",dispName:"Title Height",type:"float",defVal:30,min:0}];StyleFormatPanel.prototype.defaultColorSchemes=[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",+stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},+{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},+{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",+stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;var c=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var l=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&0<l.cells.length&&+this.container.appendChild(this.addStyles(this.createPanel()));c.apply(this,arguments);null!=l.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),l.customProperties,l))};var f=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(l){var t=this.editorUi.getSelectionState();1==t.cells.length?this.addActions(l,["copyStyle","pasteStyle"]):1<=t.cells.length&&this.addActions(l,["pasteStyle","pasteData"]);f.apply(this,arguments);return l};+EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(l,t,H,J){function R(Ua){try{return decodeURIComponent(Ua)}catch(Ba){return Ua}}function T(Ua,Ba,Ka,ab,Qa){if(null!=Ka.valueChanged)Ka.valueChanged(Ba,Qa,H,na);else{la.getModel().beginUpdate();try{Qa=[];var db=[];if(null!=Ka.index){for(var Va=[],nb=Ka.parentRow.nextSibling;nb&&nb.getAttribute("data-pName")==Ua;)Va.push(nb.getAttribute("data-pValue")),nb=nb.nextSibling;Ka.index<Va.length?null!=ab?Va.splice(ab,+1):Va[Ka.index]=Ba:Va.push(Ba);null!=Ka.size&&Va.length>Ka.size&&(Va=Va.slice(0,Ka.size));Ba=Va.join(",");null!=Ka.countProperty&&(la.setCellStyles(Ka.countProperty,Va.length,la.getSelectionCells()),Qa.push(Ka.countProperty),db.push(Va.length))}la.setCellStyles(Ua,Ba,la.getSelectionCells());Qa.push(Ua);db.push(Ba);if(null!=Ka.dependentProps)for(Ua=0;Ua<Ka.dependentProps.length;Ua++){var bb=Ka.dependentPropsDefVal[Ua],ya=Ka.dependentPropsVals[Ua];if(ya.length>Ba)ya=ya.slice(0,Ba);else for(var Ra=ya.length;Ra<+Ba;Ra++)ya.push(bb);ya=ya.join(",");la.setCellStyles(Ka.dependentProps[Ua],ya,la.getSelectionCells());Qa.push(Ka.dependentProps[Ua]);db.push(ya)}if("function"==typeof Ka.onChange)Ka.onChange(la,Ba);na.editorUi.fireEvent(new mxEventObject("styleChanged","keys",Qa,"values",db,"cells",la.getSelectionCells()))}finally{la.getModel().endUpdate()}}}function Y(Ua,Ba){Ba.style.left="0px";Ba.style.top="0px";Ba.style.position="relative";Ba.style.right="0px";Ba.style.bottom="0px";Ba.style.width="100%";Ba.style.maxWidth=+"100%";Ba.style.maxHeight="100%";Ba.style.textAlign="left"}function Z(Ua,Ba,Ka){function ab(db){if(null==db||db==mxConstants.NONE)Qa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==db)Qa.style.background="";else{var Va=mxUtils.getLightDarkColor(db);mxUtils.isLightDarkColor(db)&&Va.light!=Va.dark?Qa.style.background="linear-gradient(to right bottom, "+Va.cssText+" 50%, "+mxUtils.invertLightDarkColor(Va).cssText+" 50.3%)":Qa.style.background=db}}var Qa=document.createElement("div");+Qa.style.width="32px";Qa.style.height="8px";Qa.style.margin="2px";Qa.style.borderStyle="solid";Qa.style.borderWidth="1px";ab(Ba);btn=mxUtils.button("",mxUtils.bind(na,function(db){this.editorUi.pickColor(Ba,function(Va){T(Ua,Va,Ka);ab(Va)});mxEvent.consume(db)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(Qa);return btn}function ia(Ua,Ba,Ka,ab,Qa,db,Va){null!=Ba&&(Ba=Ba.split(","),ua.push({name:Ua,+values:Ba,type:Ka,defVal:ab,countProperty:Qa,parentRow:db,isDeletable:!0,flipBkg:Va}));btn=mxUtils.button("+",mxUtils.bind(na,function(nb){for(var bb=db,ya=0;null!=bb.nextSibling;)if(bb.nextSibling.getAttribute("data-pName")==Ua)bb=bb.nextSibling,ya++;else break;var Ra={type:Ka,parentRow:db,index:ya,isDeletable:!0,defVal:ab,countProperty:Qa};ya=ka(Ua,"",Ra,0==ya%2,Va);T(Ua,ab,Ra);bb.parentNode.insertBefore(ya,bb.nextSibling);mxEvent.consume(nb)}));btn.style.height="16px";btn.style.width="25px";btn.className=+"geColorBtn";return btn}function ja(Ua,Ba,Ka,ab,Qa,db,Va){if(0<Qa){var nb=Array(Qa);Ba=null!=Ba?Ba.split(","):[];for(var bb=0;bb<Qa;bb++)nb[bb]=null!=Ba[bb]?Ba[bb]:null!=ab?ab:"";ua.push({name:Ua,values:nb,type:Ka,defVal:ab,parentRow:db,flipBkg:Va,size:Qa})}return document.createElement("div")}function X(Ua,Ba,Ka){var ab=document.createElement("input");ab.type="checkbox";ab.checked="1"==Ba;mxEvent.addListener(ab,"change",function(){T(Ua,ab.checked?"1":"0",Ka,null,ab)});return ab}function ka(Ua,Ba,+Ka,ab,Qa){var db=Ka.dispName,Va=Ka.type,nb=document.createElement("tr");nb.className="gePropRow"+(Qa?"Dark":"")+(ab?"Alt":"")+" gePropNonHeaderRow";nb.setAttribute("data-pName",Ua);nb.setAttribute("data-pValue",Ba);ab=!1;null!=Ka.index&&(nb.setAttribute("data-index",Ka.index),db=(null!=db?db:"")+"["+Ka.index+"]",ab=!0);var bb=document.createElement("td");bb.className="gePropRowCell";db=mxResources.get(db,null,db);mxUtils.write(bb,db);bb.setAttribute("title",db);ab&&(bb.style.textAlign="right");nb.appendChild(bb);+bb=document.createElement("td");bb.className="gePropRowCell";bb.setAttribute("title",null!=Ba?R(Ba):mxResources.get("none"));mxEvent.addListener(bb,"click",mxUtils.bind(na,function(lb){!mxUtils.isAncestorNode(nb,document.activeElement)&&mxUtils.isAncestorNode(nb.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(lb))}));if("color"==Va)bb.appendChild(Z(Ua,Ba,Ka));else if("bool"==Va||"boolean"==Va)bb.appendChild(X(Ua,+Ba,Ka));else if("enum"==Va){var ya=Ka.enumList;bb.innerHTML="";var Ra=document.createElement("div");Ra.className="gePropValue";bb.appendChild(Ra);for(Qa=0;Qa<ya.length;Qa++)if(db=ya[Qa],db.val==Ba){mxUtils.write(Ra,mxResources.get(db.dispName,null,db.dispName));break}mxEvent.addListener(bb,"click",mxUtils.bind(na,function(lb){var ub=mxEvent.getSource(lb);if(!(ub!=bb&&ub!=Ra||mxEvent.isConsumed(lb))){Ra.innerHTML="";var gb=document.createElement("select"),jb=null;Y(bb,gb);gb.style.boxSizing="border-box";+gb.style.height="100%";gb.style.padding="0";gb.style.margin="0";gb.style.border="0";for(lb=0;lb<ya.length;lb++){ub=ya[lb];var yb=document.createElement("option");yb.value=mxUtils.htmlEntities(ub.val);mxUtils.write(yb,mxResources.get(ub.dispName,null,ub.dispName));gb.appendChild(yb);null==ub.val&&(yb.value="null",jb=yb)}gb.value=null==Ba&&null!=jb?"null":Ba;Ra.appendChild(gb);mxEvent.addListener(gb,"change",function(){var Bb=mxUtils.htmlEntities(gb.value);if(gb[gb.selectedIndex]==jb||"null"==Bb.value)Bb=+null;T(Ua,Bb,Ka)});gb.focus();mxEvent.addListener(gb,"blur",function(){Ra.innerHTML="";for(var Bb=gb[gb.selectedIndex]==jb||"null"==gb.value?null:gb.value,Cb=0;Cb<ya.length;Cb++){var Kb=ya[Cb];if(Kb.val==Bb){mxUtils.write(Ra,mxResources.get(Kb.dispName,null,Kb.dispName));break}}})}}))}else if("dynamicArr"==Va)bb.appendChild(ia(Ua,Ba,Ka.subType,Ka.subDefVal,Ka.countProperty,nb,Qa));else if("staticArr"==Va)bb.appendChild(ja(Ua,Ba,Ka.subType,Ka.subDefVal,Ka.size,nb,Qa));else if("readOnly"==Va)Qa=document.createElement("input"),+Qa.setAttribute("readonly",""),Qa.value=Ba,Qa.style.borderWidth="0px","id"==Ua||"shape"==Ua?(nb.firstChild.innerHTML="",nb.firstChild.setAttribute("colspan","2"),Qa.style.flexGrow="1",Qa.style.marginLeft="4px",Qa.style.textAlign="id"==Ua?"center":"left",Qa.setAttribute("title",Ba),db=document.createElement("div"),mxUtils.write(db,mxResources.get(Ua)+":"),db.style.display="inline-flex",db.style.alignItems="center",db.style.width="100%",db.appendChild(Qa),nb.firstChild.appendChild(db)):(Qa.style.width=+"96px",bb.appendChild(Qa));else{bb.innerHTML="";var Ya=document.createElement("div");Ya.className="gePropValue";bb.appendChild(Ya);Ya.innerHTML=mxUtils.htmlEntities(R(Ba));mxEvent.addListener(bb,"click",mxUtils.bind(na,function(lb){function ub(){var yb=jb.value,Bb=Va;yb=0==yb.trim().length&&"string"!=Bb&&"numbers"!=Bb?Ka.allowAuto?"auto":0:yb;Ka.allowAuto&&(null!=yb.trim&&"auto"==yb.trim().toLowerCase()?(yb="auto",Bb="string"):(yb=parseFloat(yb),yb=isNaN(yb)?0:yb));null!=Ka.min&&yb<Ka.min?yb=Ka.min:+null!=Ka.max&&yb>Ka.max&&(yb=Ka.max);var Cb=null;try{Cb="numbers"==Bb?yb.match(/\d+/g).map(Number).join(" "):"auto"===yb&&Ka.allowAuto&&"auto"==Ka.defVal?null:encodeURIComponent(("int"==Bb?parseInt(yb):yb)+"")}catch(Kb){}T(Ua,Cb,Ka,null,jb)}var gb=mxEvent.getSource(lb);if(!(gb!=bb&&gb!=Ya||mxEvent.isConsumed(lb))){Ya.innerHTML="";var jb=document.createElement("input");Y(Ya,jb);jb.value=R(Ba);jb.className="gePropEditor";"int"!=Va&&"float"!=Va||Ka.allowAuto||(jb.type="number",jb.step="int"==Va?"1":+"any",null!=Ka.min&&(jb.min=parseFloat(Ka.min)),null!=Ka.max&&(jb.max=parseFloat(Ka.max)));Ya.appendChild(jb);mxEvent.addListener(jb,"keypress",function(yb){13==yb.keyCode&&ub()});jb.focus();mxEvent.addListener(jb,"blur",function(){ub()})}}))}Ka.isDeletable&&(Qa=mxUtils.button("-",mxUtils.bind(na,function(lb){T(Ua,"",Ka,Ka.index);mxEvent.consume(lb)})),Qa.style.height="16px",Qa.style.width="25px",Qa.style.float="right",Qa.className="geColorBtn",bb.appendChild(Qa));nb.appendChild(bb);return nb}var na=+this,la=this.editorUi.editor.graph,ua=[],za=document.createElement("table");za.className="geProperties geFullWidthElement";var sa=document.createElement("tr");sa.className="gePropHeader";var wa=document.createElement("th");wa.className="gePropHeaderCell";wa.style.paddingLeft="16px";wa.style.backgroundRepeat="no-repeat";wa.style.backgroundPosition="-2px 50%";wa.style.backgroundSize="20px";mxUtils.write(wa,mxResources.get("property"));sa.style.cursor="pointer";var Ca=function(){var Ua=za.querySelectorAll(".gePropNonHeaderRow");+if(na.editorUi.propertiesCollapsed){wa.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var Ba="none";for(var Ka=l.childNodes.length-1;0<=Ka;Ka--)try{var ab=l.childNodes[Ka],Qa=ab.nodeName.toUpperCase();"INPUT"!=Qa&&"SELECT"!=Qa||l.removeChild(ab)}catch(db){}}else wa.style.backgroundImage="url('"+Editor.arrowDownImage+"')",Ba="";for(Ka=0;Ka<Ua.length;Ka++)Ua[Ka].style.display=Ba};mxEvent.addListener(sa,"click",function(){na.editorUi.propertiesCollapsed=!na.editorUi.propertiesCollapsed;Ca()});+sa.appendChild(wa);var Fa=document.createElement("th");Fa.className="gePropHeaderCell";Fa.style.paddingLeft="4px";mxUtils.write(Fa,mxResources.get("value"));sa.appendChild(Fa);za.appendChild(sa);var Ha=Fa=!1;sa=null;1==H.vertices.length&&0==H.edges.length?sa=H.vertices[0].id:0==H.vertices.length&&1==H.edges.length&&(sa=H.edges[0].id);null==sa||J||(za.appendChild(ka("id",mxUtils.htmlEntities(sa),{dispName:"id",type:"readOnly"},!0,!1)),null!=H.style&&null!=H.style.shape&&za.appendChild(ka("shape",mxUtils.htmlEntities(H.style.shape),+{dispName:"shape",type:"readOnly"},!0,!1)));for(var Na in t)if(J=t[Na],("function"!=typeof J.isVisible||J.isVisible(H,this))&&!J.primary){var La=null!=J.getValue?J.getValue(H,this):null!=H.style[Na]?mxUtils.htmlEntities(H.style[Na]+""):null!=J.getDefaultValue?J.getDefaultValue(H,this):J.defVal;if("separator"==J.type)Ha=!Ha;else{if("staticArr"==J.type)J.size=parseInt(H.style[J.sizeProperty]||t[J.sizeProperty].defVal)||0;else if(null!=J.dependentProps){var Da=J.dependentProps,Sa=[],Oa=[];for(sa=0;sa<+Da.length;sa++)if(null!=t[Da[sa]]){var Ta=H.style[Da[sa]];Oa.push(t[Da[sa]].subDefVal);Sa.push(null!=Ta?Ta.split(","):[])}J.dependentPropsDefVal=Oa;J.dependentPropsVals=Sa}za.appendChild(ka(Na,La,J,Fa,Ha));Fa=!Fa}}for(sa=0;sa<ua.length;sa++)for(J=ua[sa],t=J.parentRow,Na=0;Na<J.values.length;Na++)Fa=ka(J.name,J.values[Na],{type:J.type,parentRow:J.parentRow,isDeletable:J.isDeletable,index:Na,defVal:J.defVal,countProperty:J.countProperty,size:J.size},0==Na%2,J.flipBkg),t.parentNode.insertBefore(Fa,t.nextSibling),+t=Fa;l.appendChild(za);Ca();return l};StyleFormatPanel.prototype.addStyles=function(l){if(null!=this.defaultColorSchemes){var t=this.editorUi,H=t.editor.graph,J=document.createElement("div");J.style.padding="6px 20px 0 24px";l.appendChild(J);var R=document.createElement("div");R.className="geSwitcher";R.style.padding="4px 18px 6px 0px";for(var T=[],Y=0;Y<this.defaultColorSchemes.length;Y++){var Z=document.createElement("div");Z.className="geSwitcherDot";mxUtils.bind(this,function(na){mxEvent.addListener(Z,+"click",mxUtils.bind(this,function(){ia(na)}))})(Y);T.push(Z);R.appendChild(Z)}var ia=mxUtils.bind(this,function(na){null!=T[na]&&(null!=this.format.currentScheme&&null!=T[this.format.currentScheme]&&(T[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=na,ja(this.defaultColorSchemes[this.format.currentScheme]),T[this.format.currentScheme].style.background="#84d7ff")}),ja=mxUtils.bind(this,function(na){var la=mxUtils.clone(H.defaultVertexStyle);la[mxConstants.STYLE_STROKECOLOR]=+null!=la[mxConstants.STYLE_STROKECOLOR]?la[mxConstants.STYLE_STROKECOLOR]:"default";la[mxConstants.STYLE_FILLCOLOR]=null!=la[mxConstants.STYLE_FILLCOLOR]?la[mxConstants.STYLE_FILLCOLOR]:"default";la[mxConstants.STYLE_FONTCOLOR]=null!=la[mxConstants.STYLE_FONTCOLOR]?la[mxConstants.STYLE_FONTCOLOR]:"default";H.replaceDefaultColors(new mxCell,la);var ua=mxUtils.bind(this,function(sa){var wa=mxUtils.button("",mxUtils.bind(this,function(Ha){H.getModel().beginUpdate();try{for(var Na=t.getSelectionState().cells,+La=H.getModel(),Da=[],Sa=0<Na.length,Oa=0;Oa<Na.length;Oa++){var Ta=La.isVertex(Na[Oa])&&La.isEdge(La.getParent(Na[Oa])),Ua=H.getCellStyle(Na[Oa]),Ba=null!=Ua&&"image"==Ua.shape,Ka=H.getCellGeometry(Na[Oa]);Da.push({isLabel:Ba||Ta&&(null==Ka||0>=Ka.width||0>=Ka.height)});Ta||Ba||(Sa=!1)}for(Oa=0;Oa<Na.length;Oa++){var ab=Da[Oa];if(Sa||!ab.isLabel){var Qa=ab.isLabel?mxConstants.STYLE_LABEL_BACKGROUNDCOLOR:mxConstants.STYLE_FILLCOLOR,db=ab.isLabel?mxConstants.STYLE_LABEL_BORDERCOLOR:mxConstants.STYLE_STROKECOLOR,+Va=La.getStyle(Na[Oa]);null!=Va&&"string"!==typeof Va&&(Va=String(Va));null!=sa?(mxEvent.isShiftDown(Ha)||(Va=""==sa.fill||null==sa.fill?mxUtils.setStyle(Va,Qa,null):mxUtils.setStyle(Va,Qa,sa.fill),ab.isLabel||(Va=""==sa.gradient||null==sa.gradient?mxUtils.setStyle(Va,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Va,mxConstants.STYLE_GRADIENTCOLOR,sa.gradient)),mxEvent.isControlDown(Ha)||mxClient.IS_MAC&&mxEvent.isMetaDown(Ha)||!La.isVertex(Na[Oa])||(Va=""==sa.font||null==sa.font?mxUtils.setStyle(Va,+mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Va,mxConstants.STYLE_FONTCOLOR,sa.font))),mxEvent.isAltDown(Ha)||(Va=""==sa.stroke||null==sa.stroke?mxUtils.setStyle(Va,db,null):mxUtils.setStyle(Va,db,sa.stroke))):(Va=mxUtils.setStyle(Va,Qa,null),Va=mxUtils.setStyle(Va,db,null),ab.isLabel||(Va=mxUtils.setStyle(Va,mxConstants.STYLE_GRADIENTCOLOR,null)),La.isVertex(Na[Oa])&&(Va=mxUtils.setStyle(Va,mxConstants.STYLE_FONTCOLOR,null)));La.setStyle(Na[Oa],Va)}}}finally{H.getModel().endUpdate()}}));wa.className=+"geStyleButton";wa.style.width="36px";wa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";wa.style.margin="0px 6px 6px 0px";if(null!=sa){var Ca="1px solid";null!=sa.border&&(Ca=sa.border);if(null!=sa.gradient)wa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(sa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(sa.gradient).cssText+" 100%)";else if(sa.fill==mxConstants.NONE)wa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==sa.fill||""==sa.fill)wa.style.backgroundColor=+mxUtils.getLightDarkColor(mxUtils.getValue(la,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var Fa=mxUtils.getLightDarkColor(sa.fill);wa.style.backgroundImage="linear-gradient(to right bottom, "+Fa.cssText+" 50%, "+Fa.light+" 50.3%)"}null==sa.stroke||sa.stroke==mxConstants.NONE?wa.style.border=Ca+" transparent":""==sa.stroke?wa.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(la,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Fa=mxUtils.getLightDarkColor(sa.stroke),wa.style.border=+Ca+" "+Fa.cssText,wa.style.borderRightColor=Fa.light,wa.style.borderBottomColor=wa.style.borderRightColor);null!=sa.title&&wa.setAttribute("title",sa.title)}else Ca=mxUtils.getValue(la,mxConstants.STYLE_FILLCOLOR,"#ffffff"),Fa=mxUtils.getValue(la,mxConstants.STYLE_STROKECOLOR,"#000000"),wa.style.backgroundColor=Ca,wa.style.border="1px solid "+Fa;wa.style.borderRadius="0";J.appendChild(wa);null!=sa&&null!=sa.gradient&&(Ca=wa.cloneNode(!1),Ca.style.backgroundImage="linear-gradient(light-dark(transparent, "++mxUtils.getLightDarkColor(sa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(sa.gradient).light+") 100%)",Ca.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",Ca.style.backgroundColor="transparent",J.appendChild(Ca),Ca.style.marginLeft="-42px",mxEvent.addListener(Ca,"click",function(){wa.click()}))});J.innerText="";if(null!=na)for(var za=0;za<na.length;za++)0<za&&0==mxUtils.mod(za,4)&&mxUtils.br(J),ua(na[za])});null==this.format.currentScheme?ia(Math.min(T.length-1,Editor.isDarkMode()?+1:"1"==urlParams.sketch?5:0)):ia(this.format.currentScheme);Y=10>=this.defaultColorSchemes.length?43:23;var X=document.createElement("div");X.className="geButton";X.style.cssText="position:absolute;left:0px;bottom:"+Y+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(X,"click",mxUtils.bind(this,function(){ia(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var ka=document.createElement("div");ka.className="geButton";ka.style.cssText=+"position:absolute;left:186px;bottom:"+Y+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(l.appendChild(X),l.appendChild(ka));mxEvent.addListener(ka,"click",mxUtils.bind(this,function(){ia(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));ja(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&l.appendChild(R)}return l}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('++STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(l){return l.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||l.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(l){return Graph.isGoogleFontUrl(l)};Graph.rewriteGoogleFontUrl=function(l){null!=l&&l.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(l=Editor.GOOGLE_FONTS_CSS2+l.substring(Editor.GOOGLE_FONTS.length)++":wght@400;500");return l};Graph.createFontElement=function(l,t){var H=Graph.fontMapping[t];null==H&&Graph.isCssFontUrl(t)?(l=document.createElement("link"),l.setAttribute("rel","stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("charset","UTF-8"),l.setAttribute("href",Graph.rewriteGoogleFontUrl(t))):(null==H&&(H='@font-face {\nfont-family: "'+l+'";\nsrc: url("'+t+'");\n}'),l=document.createElement("style"),mxUtils.write(l,H));return l};Graph.addRecentCustomFont=function(l,t){};Graph.addFont=+function(l,t,H,J){if(null!=l&&0<l.length&&null!=t&&0<t.length){J=null!=J?J:Graph.customFontElements;var R=l.toLowerCase();if("helvetica"!=R&&"arial"!=l&&"sans-serif"!=R){var T=J[R];null!=T&&T.url!=t&&(T.elt.parentNode.removeChild(T.elt),T=null);null==T?(T=t,"http:"==t.substring(0,5)&&(T=PROXY_URL+"?url="+encodeURIComponent(t)),T={name:l,url:t,elt:Graph.createFontElement(l,T)},J[R]=T,t=J==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=H&&("link"==T.elt.nodeName.toLowerCase()?+(T.elt.onload=H,T.elt.onerror=H):H()),null!=t&&t.appendChild(T.elt)):null!=H&&H()}else null!=H&&H()}else null!=H&&H();return l};Graph.getFontUrl=function(l,t){l=Graph.customFontElements[l.toLowerCase()];null!=l&&(t=l.url);return t};Graph.processFontAttributes=function(l){l=l.getElementsByTagName("*");for(var t=0;t<l.length;t++){var H=l[t].getAttribute("data-font-src");if(null!=H){var J="FONT"==l[t].nodeName?l[t].getAttribute("face"):l[t].style.fontFamily;null!=J&&Graph.addFont(J,H)}}};Graph.processFontStyle=+function(l){if(null!=l){var t=mxUtils.getValue(l,"fontSource",null);if(null!=t){var H=mxUtils.getValue(l,mxConstants.STYLE_FONTFAMILY,null);if(null!=H)try{Graph.addFont(H,decodeURIComponent(t))}catch(J){}}}return l};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;mxConnectionHandler.prototype.createTarget="1"==urlParams.sketch;+Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var k=Graph.prototype.init;Graph.prototype.init=function(){function l(R){t=R}k.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var t=null;mxEvent.addListener(this.container,"mouseenter",l);mxEvent.addListener(this.container,"mousemove",+l);mxEvent.addListener(this.container,"mouseleave",function(R){t=null});this.isMouseInsertPoint=function(){return null!=t};var H=this.getInsertPoint;this.getInsertPoint=function(R){return null==t||R?H.apply(this,arguments):this.getPointForEvent(t)};var J=this.layoutManager.getLayout;this.layoutManager.getLayout=function(R){var T=this.graph.getCellStyle(R);if(null!=T&&"rack"==T.childLayout){var Y=new mxStackLayout(this.graph,!1);Y.gridSize=null!=T.rackUnitSize?parseFloat(T.rackUnitSize):"undefined"!==+typeof mxRackContainer?mxRackContainer.unitSize:20;Y.marginLeft=T.marginLeft||0;Y.marginRight=T.marginRight||0;Y.marginTop=T.marginTop||0;Y.marginBottom=T.marginBottom||0;Y.allowGaps=T.allowGaps||0;Y.horizontal="1"==mxUtils.getValue(T,"horizontalRack","0");Y.resizeParent=!1;Y.fill=!0;return Y}return J.apply(this,arguments)};this.updateGlobalUrlVariables()};var q=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(l,t){return Graph.processFontStyle(q.apply(this,arguments))};+var x=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(l,t,H,J,R,T,Y,Z,ia,ja,X,ka){x.apply(this,arguments);Graph.processFontAttributes(ka)};var C=mxText.prototype.redraw;mxText.prototype.redraw=function(){C.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(l,t,H,J){function R(){for(var za=Z.getSelectionCells(),sa=[],wa=0;wa<za.length;wa++)Z.isCellVisible(za[wa])&&+sa.push(za[wa]);Z.setSelectionCells(sa)}function T(za){Z.setHiddenTags(za?[]:ia.slice());R();Z.refresh()}function Y(za,sa){X.innerText="";if(0<za.length){var wa=document.createElement("table");wa.setAttribute("cellpadding","2");wa.style.boxSizing="border-box";wa.style.tableLayout="fixed";wa.style.width="100%";var Ca=document.createElement("tbody");if(null!=za&&0<za.length)for(var Fa=0;Fa<za.length;Fa++)(function(Ha){function Na(){var Ua=Z.getCellsForTags([Ha],null,null,!0);Z.isEnabled()?Z.setSelectionCells(Ua):+Z.highlightCells(Ua,null,null,70)}var La=0>mxUtils.indexOf(Z.hiddenTags,Ha),Da=document.createElement("tr"),Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";var Oa=document.createElement("img");Oa.setAttribute("src",La?Editor.visibleImage:Editor.hiddenImage);Oa.setAttribute("title",mxResources.get(La?"hideIt":"show",[Ha])+"\n"+mxResources.get("shiftClickShowOnly",[Ha]));mxUtils.setOpacity(Oa,La?75:25);Oa.className="geAdaptiveAsset";Oa.style.verticalAlign="middle";Oa.style.cursor=+"pointer";Oa.style.width="16px";if(t||Editor.isDarkMode())Oa.style.filter="invert(100%)";Sa.appendChild(Oa);mxEvent.addListener(Oa,"click",function(Ua){if(mxEvent.isShiftDown(Ua)){for(var Ba=[],Ka=0;Ka<ia.length;Ka++)ia[Ka]!==Ha&&Ba.push(ia[Ka]);var ab=0<Ba.length;for(Ka=0;Ka<Ba.length;Ka++)if(0>mxUtils.indexOf(Z.hiddenTags,Ba[Ka])){ab=!1;break}ab&&0>mxUtils.indexOf(Z.hiddenTags,Ha)?Z.setHiddenTags([]):Z.setHiddenTags(Ba)}else Z.toggleHiddenTag(Ha);R();Z.refresh();mxEvent.consume(Ua)});Da.appendChild(Sa);+Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";Oa=document.createElement("img");Oa.setAttribute("src",Editor.selectImage);Oa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Oa,La?75:25);Oa.className="geAdaptiveAsset";Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";Oa.style.width="16px";if(t||Editor.isDarkMode())Oa.style.filter="invert(100%)";mxEvent.addListener(Oa,"click",function(Ua){T(!0);Na();mxEvent.consume(Ua)});Sa.appendChild(Oa);Da.appendChild(Sa);+Sa=document.createElement("td");Sa.style.overflow="hidden";Sa.style.whiteSpace="nowrap";Sa.style.textOverflow="ellipsis";Sa.style.verticalAlign="middle";Sa.style.cursor="pointer";Sa.setAttribute("title",Ha);a=document.createElement("a");mxUtils.write(a,Ha);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,La?100:40);Sa.appendChild(a);mxEvent.addListener(Sa,"click",function(Ua){if(mxEvent.isShiftDown(Ua))T(!0),Na();else if(La&&0<Z.hiddenTags.length)T(!0);else{var Ba=+ia.slice(),Ka=mxUtils.indexOf(Ba,Ha);Ba.splice(Ka,1);Z.setHiddenTags(Ba);R();Z.refresh()}mxEvent.consume(Ua)});Da.appendChild(Sa);if(Z.isEnabled()){Sa=document.createElement("td");Sa.style.verticalAlign="middle";Sa.style.textAlign="center";Sa.style.width="18px";if(null==sa){Sa.style.align="center";Sa.style.width="16px";Oa=document.createElement("img");Oa.setAttribute("src",Editor.trashImage);Oa.setAttribute("title",mxResources.get("removeIt",[Ha]));mxUtils.setOpacity(Oa,La?75:25);Oa.className="geAdaptiveAsset";+Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";Oa.style.width="16px";if(t||Editor.isDarkMode())Oa.style.filter="invert(100%)";mxEvent.addListener(Oa,"click",function(Ua){var Ba=mxUtils.indexOf(ia,Ha);0<=Ba&&ia.splice(Ba,1);Z.removeTagsForCells(Z.model.getDescendants(Z.model.getRoot()),[Ha]);Z.refresh();mxEvent.consume(Ua)});Sa.appendChild(Oa)}else{var Ta=document.createElement("input");Ta.setAttribute("type","checkbox");Ta.style.margin="0px";Ta.defaultChecked=null!=sa&&0<=mxUtils.indexOf(sa,+Ha);Ta.checked=Ta.defaultChecked;Ta.style.background="transparent";Ta.setAttribute("title",mxResources.get(Ta.defaultChecked?"removeIt":"add",[Ha]));mxEvent.addListener(Ta,"change",function(Ua){Ta.checked?Z.addTagsForCells(Z.getSelectionCells(),[Ha]):Z.removeTagsForCells(Z.getSelectionCells(),[Ha]);mxEvent.consume(Ua)});Sa.appendChild(Ta)}Da.appendChild(Sa)}Ca.appendChild(Da)})(za[Fa]);wa.appendChild(Ca);X.appendChild(wa)}}var Z=this,ia=Z.hiddenTags.slice(),ja=document.createElement("div");ja.style.userSelect=+"none";ja.style.overflow="hidden";ja.style.padding="10px";ja.style.height="100%";var X=document.createElement("div");X.style.position="absolute";X.style.boxSizing="border-box";X.style.userSelect="none";X.style.overflow="auto";X.style.padding="3px";X.style.left="0px";X.style.right="0px";X.style.top="0px";X.style.bottom="0px";ja.appendChild(X);Z.addListener(mxEvent.ROOT,function(){ia=Z.hiddenTags.slice()});var ka=mxUtils.bind(this,function(za,sa){if(l()){za=Z.getAllTags();for(sa=0;sa<za.length;sa++)0>+mxUtils.indexOf(ia,za[sa])&&ia.push(za[sa]);ia.sort();Z.isSelectionEmpty()?Y(ia):Y(ia,Z.getCommonTagsForCells(Z.getSelectionCells()))}});Z.selectionModel.addListener(mxEvent.CHANGE,ka);Z.model.addListener(mxEvent.CHANGE,ka);Z.addListener(mxEvent.REFRESH,ka);var na=document.createElement("div");na.className="geToolbarContainer geDialogToolbar";na.style.position="absolute";na.style.display="flex";na.style.bottom="0px";na.style.left="0px";na.style.right="0px";na.style.height="32px";na.style.overflow=+"hidden";na.style.padding="3px 4px 4px 4px";na.style.borderWidth="1px 0px 0px 0px";na.style.borderStyle="solid";na.style.whiteSpace="nowrap";if(Z.isEnabled()){X.style.bottom="32px";var la=document.createElement("a");la.className="geButton";var ua=la.cloneNode(!1);ua.style.backgroundImage="url("+Editor.visibleImage+")";ua.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(ua,"click",function(za){Z.setHiddenTags([]);mxEvent.isShiftDown(za)||(ia=Z.hiddenTags.slice());R();Z.refresh();+mxEvent.consume(za)});na.appendChild(ua);null!=H&&(la=la.cloneNode(!1),la.style.backgroundImage="url("+Editor.plusImage+")",la.setAttribute("title",mxResources.get("add")),mxEvent.addListener(la,"click",function(za){H(ia,function(sa){ia=sa;ka()});mxEvent.consume(za)}),na.appendChild(la));ja.appendChild(na)}null!=J&&na.appendChild(J);return{div:ja,refresh:ka}};Graph.prototype.getCustomFonts=function(){var l=this.extFonts;l=null!=l?l.slice():[];for(var t in Graph.customFontElements){var H=Graph.customFontElements[t];+l.push({name:H.name,url:H.url})}return l};Graph.prototype.getExtFontCss=function(){for(var l=this.getCustomFonts(),t="",H="",J=0;J<l.length;J++){var R=l[J].name,T=l[J].url;Graph.isCssFontUrl(T)?t+="@import url("+Graph.rewriteGoogleFontUrl(T)+");\n":H+='@font-face {\nfont-family: "'+R+'";\nsrc: url("'+T+'");\n}\n'}return t+H};Graph.prototype.setFont=function(l,t){Graph.addFont(l,t);var H=Editor.guid();document.execCommand("fontname",!1,H);for(var J=this.cellEditor.textarea.getElementsByTagName("font"),+R=!1,T=0;T<J.length;T++)J[T].getAttribute("face")==H&&(R=!0,J[T].setAttribute("face",l),null!=t?J[T].setAttribute("data-font-src",t):J[T].removeAttribute("data-font-src"));R||document.execCommand("fontname",!1,l)};var E=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return E.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=+null!=this.globalVars?mxUtils.clone(this.globalVars):{};var l=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=l)for(var t in l)this.globalVars[t]=l[t]}catch(H){null!=window.console&&console.log("Error in vars URL parameter: "+H)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var L=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(l){var t=L.apply(this,arguments);null==t&&null!=this.globalVars&&(t=this.globalVars[l]);+return t};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var l=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(l.ownerDocument)).decode(l)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var Q=Graph.prototype.getSvg;Graph.prototype.getSvg=function(l,t,H,J,R,T,Y,Z,ia,ja,X,ka,na,la,ua,za,sa){if(Editor.mathOutputSize&&this.mathEnabled&&null!=this.container&&document.body.contains(this.container)&&"undefined"!==+typeof MathJax&&"function"===typeof MathJax.typeset){if(0==this.container.getElementsByTagName("mjx-container").length)try{MathJax.typeset([this.container])}catch(Na){}this.refreshMathBounds()}var wa=Q.apply(this,arguments);if(null!=ka){var Ca=wa.getAttribute("style");null==Ca&&(Ca="");ka="auto"==ka||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":ka;wa.setAttribute("style",Ca+(" color-scheme: "+ka+";"))}var Fa=X?this.getExtFontCss():"";if(0<Fa.length){var Ha=+wa.ownerDocument;Ca=null!=Ha.createElementNS?Ha.createElementNS(mxConstants.NS_SVG,"style"):Ha.createElement("style");null!=Ha.setAttributeNS?Ca.setAttributeNS("type","text/css"):Ca.setAttribute("type","text/css");Ca.appendChild(Ha.createTextNode(Fa));wa.getElementsByTagName("defs")[0].appendChild(Ca)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(wa);this.mathEnabled&&(document.body.appendChild(wa),Editor.MathJaxRender(wa),wa.parentNode.removeChild(wa),+Ca=wa.ownerDocument.getElementById("MJX-SVG-styles"),null!=Ca&&wa.getElementsByTagName("defs")[0].appendChild(Ca.cloneNode(!0)));return wa};var V=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(l){V.apply(this,arguments);null!=l.secondLabel&&(l.secondLabel.destroy(),l.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(l){return[l.shape,l.text,l.secondLabel,l.control]};var K=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=+function(){K.apply(this,arguments);this.enumerationState=0};var fa=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(l){null!=l.shape&&this.redrawEnumerationState(l);return fa.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(l){l=decodeURIComponent(mxUtils.getValue(l.style,"enumerateValue",""));""==l&&(l=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(l)++"</div>"};mxGraphView.prototype.redrawEnumerationState=function(l){var t="1"==mxUtils.getValue(l.style,"enumerate",0);t&&null==l.secondLabel?(l.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),l.secondLabel.size=12,l.secondLabel.state=l,l.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(l,l.secondLabel)):t||null==l.secondLabel||(l.secondLabel.destroy(),l.secondLabel=null);t=l.secondLabel;if(null!=t){var H=l.view.scale,+J=this.createEnumerationValue(l);l=this.graph.model.isVertex(l.cell)?new mxRectangle(l.x+l.width-4*H,l.y+4*H,0,0):mxRectangle.fromPoint(l.view.getPoint(l));t.bounds.equals(l)&&t.value==J&&t.scale==H||(t.bounds=l,t.value=J,t.scale=H,t.redraw())}};var aa=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();aa.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),+this.view.validateBackgroundImage())};var da=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){da.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(l,t){"data:action/json,"==l.substring(0,17)&&(l=JSON.parse(l.substring(17)),null!=l.actions&&this.executeCustomActions(Graph.flattenAnimationActions(l.actions),null,t))};Graph.flattenAnimationActions=function(l){if(!Array.isArray(l))return l;for(var t=[],H=0;H<l.length;H++){var J=+l[H];if(null!=J&&null!=J.animation&&Array.isArray(J.animation.steps)){J=Graph.flattenAnimationActions(J.animation.steps);for(var R=0;R<J.length;R++)t.push(J[R])}else t.push(J)}return t};Graph.smoothScrollContainer=function(l,t,H,J,R,T){T=T||600;if(t!==J||H!==R){l.scrollLeft=t;l.scrollTop=H;var Y="undefined"!=typeof performance&&null!=performance.now?performance.now():Date.now(),Z=J-t,ia=R-H,ja=function(X){X=Math.min(1,(X-Y)/T);var ka=1-Math.pow(1-X,3);l.scrollLeft=t+Z*ka;l.scrollTop=H+ia*ka;1>X&&+window.requestAnimationFrame(ja)};window.requestAnimationFrame(ja)}};Graph.applyTransformTransition=function(l,t){t=t||600;var H=l.view.getDrawPane(),J=null!=H?H.parentNode:null;if(null!=J){var R=J.style.transition;J.style.transition="transform "+t+"ms cubic-bezier(0.16, 1, 0.3, 1)";l.armTransformTransition=!0;var T=function(){J.style.transition=R||"";l.armTransformTransition=!1;J.removeEventListener("transitionend",T)};J.addEventListener("transitionend",T);window.setTimeout(T,t+100)}};Graph.prototype.fitBoundsCssTransform=+function(l,t){var H=null!=t?t:10;t=this.view.graphBounds;var J=Math.max(t.x,l.x),R=Math.max(t.y,l.y),T=Math.max(1,Math.min(t.x+t.width,l.x+l.width)-J),Y=Math.max(1,Math.min(t.y+t.height,l.y+l.height)-R),Z=this.container.clientWidth-H,ia=this.container.clientHeight-H;l=Math.floor(20*Math.min(Z/T,ia/Y))/20;this.view.scaleAndTranslate(l,-t.x,-t.y);J=(J-t.x)*l-Math.max((Z-T*l)/2+H/2,0);H=(R-t.y)*l-Math.max((ia-Y*l)/2+H/2,0);T=this.getBorder();R=t.width*l+2*T-this.container.clientWidth;t=t.height*l+2*+T-this.container.clientHeight;this.container.scrollLeft=0>R?0:Math.max(0,Math.min(J,R));this.container.scrollTop=0>t?0:Math.max(0,Math.min(H,t))};Graph.prototype.isGraphTornDown=function(){return!0===this.destroyed||null==this.container};Graph.prototype.smoothFitWindow=function(l,t,H){if(this.isGraphTornDown())null!=H&&H();else{var J=this.container,R=J.scrollLeft,T=J.scrollTop;this.useCssTransforms?(Graph.applyTransformTransition(this,600),this.fitBoundsCssTransform(l,t)):this.fitWindow(l,t);Graph.smoothScrollContainer(J,+R,T,J.scrollLeft,J.scrollTop,600);null!=H&&window.setTimeout(H,600)}};Graph.prototype.scrollCellToVisibleCssTransform=function(l,t){var H=this.view.getState(l);if(null!=H){var J=this.view.graphBounds,R=this.view.scale;this.view.translate.x===-J.x&&this.view.translate.y===-J.y||this.view.scaleAndTranslate(R,-J.x,-J.y);l=this.container.clientWidth;var T=this.container.clientHeight,Y=this.getBorder(),Z=J.width*R+2*Y-l;Y=J.height*R+2*Y-T;if(null!=t){var ia=(H.x-J.x)*R,ja=(H.y-J.y)*R,X=(H.x+H.width-J.x)*+R;J=(H.y+H.height-J.y)*R;var ka=this.container.scrollLeft;H=this.container.scrollTop;ia-t<ka?ka=ia-t:X+t>ka+l&&(ka=X+t-l);ja-t<H?H=ja-t:J+t>H+T&&(H=J+t-T)}else ka=(H.x+H.width/2-J.x)*R-l/2,H=(H.y+H.height/2-J.y)*R-T/2;this.container.scrollLeft=0>Z?0:Math.max(0,Math.min(ka,Z));this.container.scrollTop=0>Y?0:Math.max(0,Math.min(H,Y))}};Graph.prototype.scrollCellToVisibleBorder=function(l,t){null==t?this.scrollCellToVisible(l):(l=this.view.getState(l),null!=l&&this.scrollRectToVisible(new mxRectangle(-this.view.translate.x++l.x-t,-this.view.translate.y+l.y-t,l.width+2*t,l.height+2*t)))};Graph.prototype.smoothScrollCellToVisible=function(l,t,H){if(this.isGraphTornDown())null!=H&&H();else{var J=this.container,R=J.scrollLeft,T=J.scrollTop;this.useCssTransforms?this.scrollCellToVisibleCssTransform(l,t):this.scrollCellToVisibleBorder(l,t);Graph.smoothScrollContainer(J,R,T,J.scrollLeft,J.scrollTop,600);null!=H&&window.setTimeout(H,600)}};Graph.prototype.toggleCellsTransient=function(l){l=this.getNodesForCells(l);for(var t=+0;t<l.length;t++){var H=l[t].style.opacity;H=""===H||null===H||0<parseFloat(H);l[t].style.opacity=H?0:1}};Graph.prototype.setCellStylesTransient=function(l,t,H){for(var J=0;J<H.length;J++){var R=this.view.getState(H[J]);null!=R&&null!=R.style&&(null==t?delete R.style[l]:R.style[l]=t,null!=R.shape&&(R.shape.apply(R),R.shape.redraw()),null!=R.text&&(R.text.apply(R),R.text.redraw()))}};Graph.prototype.toggleCellStylesTransient=function(l,t,H){null==t&&(t="0");for(var J=0;J<H.length;J++){var R=this.view.getState(H[J]);+if(null!=R&&null!=R.style){var T=mxUtils.getValue(R.style,l,t)?"0":"1";R.style[l]=T;null!=R.shape&&(R.shape.apply(R),R.shape.redraw());null!=R.text&&(R.text.apply(R),R.text.redraw())}}};Graph.prototype.executeCustomActions=function(l,t,H){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));+else{this.executingCustomActions=!0;var J=!1,R=0,T=0,Y=mxUtils.bind(this,function(){J||(J=!0,this.model.beginUpdate())}),Z=mxUtils.bind(this,function(){J&&(J=!1,this.model.endUpdate())}),ia=null==H,ja=function(na){return null!=na.transient?na.transient:ia},X=mxUtils.bind(this,function(){0<R&&R--;0==R&&ka()}),ka=mxUtils.bind(this,function(){if(this.isGraphTornDown())this.stoppingCustomActions=this.executingCustomActions=!1,null!=t&&t();else if(T<l.length){do{var na=this.stoppingCustomActions,la=l[T++],+ua=[];if(null!=la.open)if(Z(),this.isCustomLink(la.open)){if(!this.customLinkClicked(la.open,H))return}else this.openLink(la.open);null==la.wait||na||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;X()}),R++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=la.wait?parseInt(la.wait):1E3),Z());null!=la.opacity&&null!=la.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(la.opacity,+!0)),la.opacity.value);null!=la.fadeIn&&(R++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(la.fadeIn,!0)),0,1,X,na?0:la.fadeIn.delay));null!=la.fadeOut&&(R++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(la.fadeOut,!0)),1,0,X,na?0:la.fadeOut.delay));if(null!=la.fadeTo&&null!=la.fadeTo.value){R++;var za=this.getNodesForCells(this.getCellsForAction(la.fadeTo,!0)),sa=na?0:null!=la.fadeTo.delay?la.fadeTo.delay:1E3;Graph.setTransitionForNodes(za,"all "+sa+"ms ease-in-out");+Graph.setOpacityForNodes(za,la.fadeTo.value);window.setTimeout(function(){Graph.setTransitionForNodes(za,null);X()},sa)}null!=la.flow&&(sa=this.getCellsForAction(la.flow,!0),Editor.toggleFlowAnimation(this,sa,!1===la.flow.start?"stop":!0===la.flow.start?"start":"toggle"));null!=la.wipeIn&&(ua=ua.concat(this.createWipeAnimations(this.getCellsForAction(la.wipeIn,!0),!0)));null!=la.wipeOut&&(ua=ua.concat(this.createWipeAnimations(this.getCellsForAction(la.wipeOut,!0),!1)));null!=la.popIn&&(ua=ua.concat(this.createPopAnimations(this.getCellsForAction(la.popIn,+!0),!0)));null!=la.popOut&&(ua=ua.concat(this.createPopAnimations(this.getCellsForAction(la.popOut,!0),!1)));null!=la.toggle&&(ja(la.toggle)?this.toggleCellsTransient(this.getCellsForAction(la.toggle,!0)):(Y(),this.toggleCells(this.getCellsForAction(la.toggle,!0,!0))));null!=la.show&&(sa=this.getCellsForAction(la.show,!0),Graph.setOpacityForNodes(this.getNodesForCells(sa),1),ja(la.show)||(Y(),this.setCellsVisible(this.getCellsForAction(la.show,!0,!0),!0)));null!=la.hide&&(sa=this.getCellsForAction(la.hide,+!0),Graph.setOpacityForNodes(this.getNodesForCells(sa),0),ja(la.hide)||(Y(),this.setCellsVisible(this.getCellsForAction(la.hide,!0,!0),!1)));if(null!=la.toggleStyle&&null!=la.toggleStyle.key){sa=this.getCellsForAction(la.toggleStyle,!0);var wa=null!=la.toggleStyle.defaultValue?la.toggleStyle.defaultValue:"0";ja(la.toggleStyle)?this.toggleCellStylesTransient(la.toggleStyle.key,wa,sa):(Y(),this.toggleCellStyles(la.toggleStyle.key,wa,sa))}null!=la.style&&null!=la.style.key&&(sa=this.getCellsForAction(la.style,+!0),ja(la.style)?this.setCellStylesTransient(la.style.key,la.style.value,sa):(Y(),this.setCellStyles(la.style.key,la.style.value,sa)));sa=[];null!=la.select&&this.isEnabled()&&(sa=this.getCellsForAction(la.select),this.setSelectionCells(sa));null!=la.highlight&&(sa=this.getCellsForAction(la.highlight),this.highlightCells(sa,la.highlight.color,la.highlight.duration,la.highlight.opacity));null!=la.scroll&&(sa=this.getCellsForAction(la.scroll));null!=la.viewbox&&(!0!==la.viewbox.smooth||na?this.useCssTransforms?+this.fitBoundsCssTransform(la.viewbox,la.viewbox.border):this.fitWindow(la.viewbox,la.viewbox.border):(R++,this.smoothFitWindow(la.viewbox,la.viewbox.border,X)));0<sa.length&&(wa=null==la.scroll||null==la.scroll.border||""===la.scroll.border||isNaN(parseFloat(la.scroll.border))?null:parseFloat(la.scroll.border),null==la.scroll||!0!==la.scroll.smooth||na?this.useCssTransforms?this.scrollCellToVisibleCssTransform(sa[0],wa):this.scrollCellToVisibleBorder(sa[0],wa):(R++,this.smoothScrollCellToVisible(sa[0],+wa,X)));null!=H&&null!=la.explore&&Graph.exploreFromCell(this,H,la.explore);if(null!=la.tags){if(null!=la.tags.toggle)for(wa=la.tags.toggle,0==wa.length&&(wa=this.getAllTags()),sa=0;sa<wa.length;sa++)this.toggleHiddenTag(wa[sa]);wa=null;null!=la.tags.hidden&&(null==wa&&(wa=[]),wa=wa.concat(la.tags.hidden));if(null!=la.tags.visible){null==wa&&(wa=[]);var Ca=this.getAllTags();for(sa=0;sa<Ca.length;sa++)0>mxUtils.indexOf(la.tags.visible,Ca[sa])&&0>mxUtils.indexOf(wa,Ca[sa])&&wa.push(Ca[sa])}null!=wa&&+this.setHiddenTags(wa);this.refresh()}if(0<ua.length){R++;sa=null!=la.steps?la.steps:30;wa=la.delay;Ca=["wipeIn","wipeOut","popIn","popOut"];for(var Fa=null,Ha=0;Ha<Ca.length;Ha++){var Na=la[Ca[Ha]];null!=Na&&null!=Na.delay&&(Fa=null==Fa?Na.delay:Math.max(Fa,Na.delay))}null!=Fa&&(wa=Fa/sa);this.executeAnimations(ua,X,na?1:sa,na?0:wa)}}while(T<l.length&&!0===l[T].immediate&&!this.stoppingCustomActions);0==R?ka():Z()}else this.stoppingCustomActions=this.executingCustomActions=!1,Z(),null!=t&&t()});+ka()}};Graph.prototype.doUpdateCustomLinksForCell=function(l,t){var H=this.getLinkForCell(t);null!=H&&"data:action/json,"==H.substring(0,17)&&this.setLinkForCell(t,this.updateCustomLink(l,H));if(this.isHtmlLabel(t)){var J=document.createElement("div");J.innerHTML=Graph.sanitizeHtml(this.getLabel(t));for(var R=J.getElementsByTagName("a"),T=!1,Y=0;Y<R.length;Y++)H=R[Y].getAttribute("href"),null!=H&&"data:action/json,"==H.substring(0,17)&&(R[Y].setAttribute("href",this.updateCustomLink(l,H)),T=!0);T&&+this.labelChanged(t,J.innerHTML)}};Graph.prototype.updateCustomLink=function(l,t){if("data:action/json,"==t.substring(0,17))try{var H=JSON.parse(t.substring(17));null!=H.actions&&(this.updateCustomLinkActions(l,H.actions),t="data:action/json,"+JSON.stringify(H))}catch(J){}return t};Graph.prototype.updateCustomLinkActions=function(l,t){for(var H=0;H<t.length;H++){var J=t[H],R;for(R in J)this.updateCustomLinkAction(l,J[R],"cells"),this.updateCustomLinkAction(l,J[R],"excludeCells"),this.updateCustomLinkAction(l,+J[R],"layers")}};Graph.prototype.updateCustomLinkAction=function(l,t,H){if(null!=t&&null!=t[H]){for(var J=[],R=0;R<t[H].length;R++)if("*"==t[H][R])J.push(t[H][R]);else{var T=l[t[H][R]];null!=T?""!=T&&J.push(T):J.push(t[H][R])}t[H]=J}};Graph.prototype.getCellsForAction=function(l,t,H){var J="or"===l.tagsMatch?"or":"and",R={},T=[],Y=function(Z){for(var ia=0;ia<Z.length;ia++){var ja=Z[ia].id;R[ja]||(R[ja]=!0,T.push(Z[ia]))}};Y(this.getCellsById(l.cells));Y(this.getCellsForTags(l.tags,null,t,!1,J));Y(H?+this.getLayerCells(l.layers):this.getCellsForLayers(l.layers));if(null!=l.excludeCells&&0<l.excludeCells.length){t={};J=!1;for(H=0;H<l.excludeCells.length;H++){if("*"===l.excludeCells[H]){J=!0;break}t[l.excludeCells[H]]=!0}if(J)return[];l=[];for(H=0;H<T.length;H++)t[T[H].id]||l.push(T[H]);return l}return T};Graph.prototype.getCellsById=function(l){var t=[];if(null!=l)for(var H=0;H<l.length;H++)if("*"==l[H]){var J=this.model.getRoot();t=t.concat(this.model.filterDescendants(function(T){return T!=J},+J))}else{var R=this.model.getCell(l[H]);null!=R&&t.push(R)}return t};Graph.prototype.getCellsForLayers=function(l){var t=[];if(Array.isArray(l))for(var H=0;H<l.length;H++){var J=this.model.getCell(l[H]);null!=J&&(t=t.concat(this.model.filterDescendants(function(R){return R!=J},J)))}return t};Graph.prototype.getLayerCells=function(l){var t=[];if(Array.isArray(l))for(var H=0;H<l.length;H++){var J=this.model.getCell(l[H]);null!=J&&t.push(J)}return t};var ba=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=+function(l){return ba.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(l))};Graph.prototype.setHiddenTags=function(l){this.hiddenTags=l;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(l){var t=mxUtils.indexOf(this.hiddenTags,l);0>t?this.hiddenTags.push(l):0<=t&&this.hiddenTags.splice(t,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(l){if(null==l||0==l.length||0==this.hiddenTags.length)return!1;+l=l.split(" ");if(l.length>this.hiddenTags.length)return!1;for(var t=0;t<l.length;t++)if(0>mxUtils.indexOf(this.hiddenTags,l[t]))return!1;return!0};Graph.prototype.getCellsForTags=function(l,t,H,J,R){var T=[];R="or"===R;if(null!=l){t=null!=t?t:this.model.getDescendants(this.model.getRoot());for(var Y=0,Z={},ia=0;ia<l.length;ia++)0<l[ia].length&&(Z[l[ia]]=!0,Y++);for(ia=0;ia<t.length;ia++)if(H&&this.model.getParent(t[ia])==this.model.root||this.model.isVertex(t[ia])||this.model.isEdge(t[ia])){var ja=+this.getTagsForCell(t[ia]),X=!1;if(0<ja.length&&(ja=ja.split(" "),R||ja.length>=l.length)){for(var ka=X=0;ka<ja.length&&X<Y;ka++)null!=Z[ja[ka]]&&X++;X=R?0<X:X==Y}X&&(1!=J||this.isCellVisible(t[ia]))&&T.push(t[ia])}}return T};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(l){for(var t=null,H=[],J=0;J<l.length;J++){var R=this.getTagsForCell(l[J]);H=[];if(0<R.length){R=R.split(" ");for(var T=+{},Y=0;Y<R.length;Y++)if(null==t||null!=t[R[Y]])T[R[Y]]=!0,H.push(R[Y]);t=T}else return[]}return H};Graph.prototype.getTagsForCells=function(l){for(var t=[],H={},J=0;J<l.length;J++){var R=this.getTagsForCell(l[J]);if(0<R.length){R=R.split(" ");for(var T=0;T<R.length;T++)null==H[R[T]]&&(H[R[T]]=!0,t.push(R[T]))}}return t};Graph.prototype.getTagsForCell=function(l){return this.getAttributeForCell(l,"tags","")};Graph.prototype.addTagsForCells=function(l,t){if(0<l.length&&0<t.length){this.model.beginUpdate();+try{for(var H=0;H<l.length;H++){for(var J=this.getTagsForCell(l[H]),R=J.split(" "),T=!1,Y=0;Y<t.length;Y++){var Z=mxUtils.trim(t[Y]);""!=Z&&0>mxUtils.indexOf(R,Z)&&(J=0<J.length?J+" "+Z:Z,T=!0)}T&&this.setAttributeForCell(l[H],"tags",J)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(l,t){if(0<l.length&&0<t.length){this.model.beginUpdate();try{for(var H=0;H<l.length;H++){var J=this.getTagsForCell(l[H]);if(0<J.length){for(var R=J.split(" "),T=!1,Y=0;Y<t.length;Y++){var Z=+mxUtils.indexOf(R,t[Y]);0<=Z&&(R.splice(Z,1),T=!0)}T&&this.setAttributeForCell(l[H],"tags",R.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(l){this.model.beginUpdate();try{for(var t=0;t<l.length;t++)this.model.setVisible(l[t],!this.model.isVisible(l[t]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(l,t){this.model.beginUpdate();try{for(var H=0;H<l.length;H++)this.model.setVisible(l[H],t)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=+function(l,t,H,J){for(var R=0;R<l.length;R++)this.highlightCell(l[R],t,H,J)};Graph.prototype.highlightCell=function(l,t,H,J,R){t=null!=t?t:mxConstants.DEFAULT_VALID_COLOR;H=null!=H?H:1E3;l=this.view.getState(l);var T=null;null!=l&&(R=null!=R?R:4,R=Math.max(R+1,mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,1)+R),T=new mxCellHighlight(this,t,R,!1),null!=J&&(T.opacity=J),T.highlight(l),window.setTimeout(function(){null!=T.shape&&(mxUtils.setPrefixedStyle(T.shape.node.style,"transition","all 1200ms ease-in-out"),+T.shape.node.style.opacity=0);window.setTimeout(function(){T.destroy()},1200)},H));return T};Graph.prototype.addSvgShadow=function(l,t,H,J){J=null!=J?J:!0;var R=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=H&&H||(t=null!=t?t:l.getElementsByTagName("g")[0],null!=t&&(this.updateShadowFilter(t,!0),!isNaN(parseInt(l.getAttribute("width")))&&J&&(l.setAttribute("width",parseInt(l.getAttribute("width"))+R),l.setAttribute("height",parseInt(l.getAttribute("height"))+R),t=l.getAttribute("viewBox"),+null!=t&&0<t.length&&(t=t.split(" "),3<t.length&&(w=parseFloat(t[2])+R,h=parseFloat(t[3])+R,l.setAttribute("viewBox",t[0]+" "+t[1]+" "+w+" "+h))))));return R};Graph.prototype.updateShadowFilter=function(l,t){mxClient.IS_SF||(t?(t=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),l.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+t.cssText+")"):l.style.filter="")};Graph.prototype.setShadowVisible=+function(l,t){t=null!=t?t:!0;this.shadowVisible=l;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);t&&this.fireEvent(new mxEventObject("shadowVisibleChanged"));return Math.ceil(this.svgShadowSize*this.svgShadowBlur)};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var l=this.model.getChildCount(this.model.root),+t=0;do var H=this.model.getChildAt(this.model.root,t);while(t++<l&&"1"==mxUtils.getValue(this.getCellStyle(H),"locked","0"));null!=H&&this.setDefaultParent(H)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH++"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH++"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];+mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",+STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",+STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=+[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",+STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",+STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=+[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",+STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=+[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];+mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(l){var t=null;null!=l&&0<l.length&&("ER"==l.substring(0,2)?t="mxgraph.er":"sysML"==l.substring(0,5)&&(t="mxgraph.sysml"));return t};var ha=mxMarker.createMarker;mxMarker.createMarker=function(l,t,H,J,R,T,Y,Z,ia,ja){if(null!=H&&null==mxMarker.markers[H]){var X=this.getPackageForType(H);null!=X&&mxStencilRegistry.getStencil(X)}return ha.apply(this,+arguments)};var qa=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(l,t,H,J,R,T){"1"==mxUtils.getValue(t.style,"lineShape",null)&&l.setFillColor(mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return qa.apply(this,arguments)};PrintDialog.prototype.create=function(l,t,H,J){function R(){wa.value=Math.max(1,Math.min(na,Math.max(parseInt(wa.value),parseInt(sa.value))));sa.value=Math.max(1,Math.min(na,Math.min(parseInt(wa.value),parseInt(sa.value))))}function T(gb){l.lastPrintPagesRadioChecked=+za.checked;l.lastPrintSelectionOnlyChecked=Ca.checked;l.lastPrintCropRadioChecked=Ha.checked;l.lastPrintFitRadioChecked=Na.checked;za.checked&&sa.value<wa.value?(l.lastPrintPagesFromInput=sa.value,l.lastPrintPagesToInput=wa.value):(l.lastPrintPagesFromInput=null,l.lastPrintPagesToInput=null);nb.value=Math.max(1,Math.min(1600,parseInt(nb.value)))+"%";l.lastPrintZoom=nb.value;l.lastPrintBorder=Va.value;l.lastPrintGrid=bb.checked;l.lastPrintShadow=ya.checked;l.lastPrintTransparent=Ra.checked;l.lastPrintInclude=+Ya.checked;l.lastPrintSheetsAcross=Qa.value;l.lastPrintSheetsDown=db.value;var jb={};jb.border=parseInt(Va.value);jb.scale=parseInt(nb.value)/100;jb.grid=bb.checked;jb.shadows=ya.checked;jb.transparent=Ra.checked;jb.includeCopy=Ya.checked;jb.sheetsAcross=parseInt(Qa.value);jb.sheetsDown=parseInt(db.value);jb.pagesFrom=parseInt(sa.value);jb.pagesTo=parseInt(wa.value);jb.allPages=la.checked;jb.selection=Ca.checked;jb.pageView=Fa.checked;jb.crop=Ha.checked;jb.fit=Na.checked;return null!=H?H(!gb,jb):+l.print(!gb,jb)}function Y(gb){try{l.hideDialog(),null!=H?T(gb):l.spinner.spin(document.body,mxResources.get("updatingPreview"))&&window.setTimeout(function(){try{T(gb),l.spinner.stop()}catch(jb){l.handleError(jb)}},0)}catch(jb){l.handleError(jb)}}var Z=l.editor.graph,ia=document.createElement("div");ia.style.display="flex";ia.style.flexDirection="column";ia.style.minHeight="0";var ja=document.createElement("div");ja.style.flex="1 1 auto";ja.style.minHeight="0";ja.style.overflowY="auto";ia.appendChild(ja);+var X=document.createElement("h3");mxUtils.write(X,t||mxResources.get("print"));ja.appendChild(X);var ka=1,na=1;X=document.createElement("div");X.className="geDialogSection";X.style.whiteSpace="nowrap";var la=document.createElement("input");la.style.marginRight="8px";la.setAttribute("type","radio");la.setAttribute("name","pages-printdialog");la.setAttribute("id","gePrintDlgAllPages");var ua=document.createElement("div");ua.className="geDialogCheckRow";ua.appendChild(la);t=document.createElement("label");+t.setAttribute("for","gePrintDlgAllPages");mxUtils.write(t,mxResources.get("allPages"));ua.appendChild(t);X.appendChild(ua);var za=document.createElement("input");za.style.marginRight="8px";za.setAttribute("type","radio");za.setAttribute("name","pages-printdialog");za.setAttribute("id","gePrintDlgPages");ua=document.createElement("div");ua.className="geDialogCheckRow";ua.appendChild(za);t=document.createElement("label");t.setAttribute("for","gePrintDlgPages");mxUtils.write(t,mxResources.get("pages")++":");ua.appendChild(t);var sa=document.createElement("input");sa.style.margin="0 4px";sa.setAttribute("value","1");sa.setAttribute("type","number");sa.setAttribute("min","1");sa.style.width="40px";ua.appendChild(sa);t=document.createElement("span");mxUtils.write(t,mxResources.get("to"));ua.appendChild(t);var wa=sa.cloneNode(!0);ua.appendChild(wa);mxEvent.addListener(sa,"focus",function(){za.checked=!0});mxEvent.addListener(wa,"focus",function(){za.checked=!0});mxEvent.addListener(sa,"change",R);mxEvent.addListener(wa,+"change",R);if(null!=l.pages&&(na=l.pages.length,null!=l.currentPage))for(t=0;t<na;t++)if(l.currentPage==l.pages[t]){ka=t+1;break}null!=l.lastPrintPagesFromInput&&null!=l.lastPrintPagesToInput?(sa.value=Math.min(na,Math.max(1,l.lastPrintPagesFromInput)),wa.value=Math.min(na,Math.max(1,l.lastPrintPagesToInput))):(sa.value=ka,wa.value=ka);sa.setAttribute("max",na);wa.setAttribute("max",na);t=mxUtils.button(mxResources.get("currentPage"),function(gb){sa.value=ka;wa.value=ka;za.checked=!0});t.className=+"geBtn";t.setAttribute("title",mxResources.get("currentPage"));t.style.marginLeft="4px";t.style.maxWidth="100px";ua.appendChild(t);X.appendChild(ua);1<na&&ja.appendChild(X);ua=document.createElement("div");ua.className="geDialogCheckRow";var Ca=document.createElement("input");Ca.setAttribute("name","pages-printdialog");Ca.setAttribute("type",1==na?"checkbox":"radio");Ca.setAttribute("id","gePrintDlgSelectionOnly");Ca.style.marginRight="8px";Z.isSelectionEmpty()&&Ca.setAttribute("disabled","disabled");+Z.isEnabled()&&(ua.appendChild(Ca),t=document.createElement("label"),t.setAttribute("for","gePrintDlgSelectionOnly"),mxUtils.write(t,mxResources.get("selectionOnly")),ua.appendChild(t));Z.isEnabled()&&(1<na?X.appendChild(ua):(t=document.createElement("div"),t.className="geDialogSection",t.appendChild(ua),ja.appendChild(t)));!l.isPagesEnabled()||l.lastPrintPagesRadioChecked?za.checked=!0:!Z.isSelectionEmpty()&&l.lastPrintSelectionOnlyChecked?Ca.checked=!0:la.checked=!0;Z=l.addAdvancedSection(ja);ja=+Z.content;X=document.createElement("div");X.className="geDialogCheckRow";var Fa=document.createElement("input");Fa.style.marginRight="8px";Fa.setAttribute("type","radio");Fa.setAttribute("name","printSize");Fa.setAttribute("id","gePrintDlgPageView");X.appendChild(Fa);t=document.createElement("label");t.setAttribute("for","gePrintDlgPageView");mxUtils.write(t,mxResources.get("pageView"));X.appendChild(t);mxEvent.addListener(X,"click",function(){Fa.checked=!0});ja.appendChild(X);X=document.createElement("div");+X.className="geDialogCheckRow";var Ha=document.createElement("input");Ha.style.marginRight="8px";Ha.setAttribute("type","radio");Ha.setAttribute("name","printSize");Ha.setAttribute("id","gePrintDlgCrop");X.appendChild(Ha);t=document.createElement("label");t.setAttribute("for","gePrintDlgCrop");mxUtils.write(t,mxResources.get("crop"));X.appendChild(t);mxEvent.addListener(X,"click",function(){Ha.checked=!0});ja.appendChild(X);X=document.createElement("div");X.className="geDialogCheckRow";X.style.alignItems=+"flex-start";var Na=document.createElement("input");Na.style.marginTop="4px";Na.setAttribute("type","radio");Na.setAttribute("name","printSize");X.appendChild(Na);ua=document.createElement("table");ua.style.display="inline-block";ua.style.borderSpacing="0";var La=document.createElement("tbody"),Da=document.createElement("tr"),Sa=Da.cloneNode(!0),Oa=document.createElement("td"),Ta=Oa.cloneNode(!0),Ua=Oa.cloneNode(!0),Ba=Oa.cloneNode(!0),Ka=Oa.cloneNode(!0),ab=Oa.cloneNode(!0);Oa.style.textAlign="right";+Ba.style.textAlign="right";mxUtils.write(Oa,mxResources.get("fitTo"));mxEvent.addListener(X,"click",function(gb){mxEvent.getSource(gb)!=Na&&(Na.checked=!Na.checked)});var Qa=document.createElement("input");Qa.style.margin="0 2px";Qa.style.boxSizing="border-box";Qa.setAttribute("value",l.lastPrintSheetsAcross||"1");Qa.setAttribute("min","1");Qa.setAttribute("type","number");Qa.style.width="40px";Ta.appendChild(Qa);t=document.createElement("span");mxUtils.write(t,mxResources.get("fitToSheetsAcross"));+Ua.appendChild(t);mxUtils.write(Ba,mxResources.get("fitToBy"));var db=Qa.cloneNode(!0);db.setAttribute("value",l.lastPrintSheetsDown||"1");Ka.appendChild(db);mxEvent.addListener(Qa,"click",function(gb){Na.checked=!0;mxEvent.consume(gb)});mxEvent.addListener(db,"click",function(gb){Na.checked=!0;mxEvent.consume(gb)});l.lastPrintCropRadioChecked?Ha.checked=!0:l.lastPrintFitRadioChecked?Na.checked=!0:Fa.checked=!0;t=document.createElement("span");mxUtils.write(t,mxResources.get("fitToSheetsDown"));ab.appendChild(t);+Da.appendChild(Oa);Da.appendChild(Ta);Da.appendChild(Ua);Sa.appendChild(Ba);Sa.appendChild(Ka);Sa.appendChild(ab);La.appendChild(Da);La.appendChild(Sa);ua.appendChild(La);X.appendChild(ua);ja.appendChild(X);ja=document.createElement("div");ja.className="geDialogSection";t=document.createElement("div");t.className="geDialogFormRow";X=document.createElement("label");X.className="geDialogFormLabel";X.setAttribute("for","gePrintDlgBorder");mxUtils.write(X,mxResources.get("borderWidth"));t.appendChild(X);+var Va=document.createElement("input");Va.setAttribute("type","number");Va.setAttribute("min","0");Va.setAttribute("id","gePrintDlgBorder");Va.style.width="40px";Va.value=null!=l.lastPrintBorder?l.lastPrintBorder:mxPrintPreview.prototype.pageMargin;t.appendChild(Va);X=document.createElement("label");X.setAttribute("for","gePrintDlgZoom");X.style.marginLeft="12px";X.style.marginRight="4px";mxUtils.write(X,mxResources.get("zoom"));t.appendChild(X);var nb=document.createElement("input");nb.setAttribute("id",+"gePrintDlgZoom");nb.style.width="60px";nb.value=null!=l.lastPrintZoom?l.lastPrintZoom:"100%";t.appendChild(nb);ja.appendChild(t);X=document.createElement("div");X.className="geDialogCheckRow";var bb=document.createElement("input");bb.setAttribute("type","checkbox");bb.setAttribute("id","gePrintDlgGrid");bb.style.marginRight="8px";bb.checked=null!=l.lastPrintGrid?l.lastPrintGrid:!1;X.appendChild(bb);t=document.createElement("label");t.setAttribute("for","gePrintDlgGrid");mxUtils.write(t,mxResources.get("grid"));+X.appendChild(t);ja.appendChild(X);X=document.createElement("div");X.className="geDialogCheckRow";var ya=document.createElement("input");ya.setAttribute("type","checkbox");ya.setAttribute("id","gePrintDlgShadows");ya.style.marginRight="8px";ya.checked=null!=l.lastPrintShadow?l.lastPrintShadow:!1;X.appendChild(ya);t=document.createElement("label");t.setAttribute("for","gePrintDlgShadows");mxUtils.write(t,mxResources.get("shadows"));X.appendChild(t);l.isOffline()&&!mxClient.IS_CHROMEAPP||X.appendChild(l.createHelpIcon("https://www.drawio.com/docs/manual/export/print-diagram/#shadows-in-print-and-pdf-export"));+Editor.enableShadowOption||(X.style.display="none");ja.appendChild(X);var Ra=document.createElement("input");Ra.setAttribute("type","checkbox");Ra.setAttribute("id","gePrintDlgTransparent");Ra.style.marginRight="8px";Ra.checked=null!=l.lastPrintTransparent?l.lastPrintTransparent:!1;null!=H&&(X=document.createElement("div"),X.className="geDialogCheckRow",X.appendChild(Ra),t=document.createElement("label"),t.setAttribute("for","gePrintDlgTransparent"),mxUtils.write(t,mxResources.get("transparentBackground")),+X.appendChild(t),ja.appendChild(X));var Ya=document.createElement("input");Ya.setAttribute("type","checkbox");Ya.setAttribute("id","gePrintDlgInclude");Ya.style.marginRight="8px";Ya.checked=null!=l.lastPrintInclude?l.lastPrintInclude:Editor.defaultIncludeDiagram;null==H||mxClient.IS_CHROMEAPP||"draw.io"!=l.getServiceName()||(X=document.createElement("div"),X.className="geDialogCheckRow",X.appendChild(Ya),t=document.createElement("label"),t.setAttribute("for","gePrintDlgInclude"),mxUtils.write(t,mxResources.get("includeCopyOfMyDiagram")),+X.appendChild(t),ja.appendChild(X));Z.wrapper.appendChild(ja);t=document.createElement("div");t.style.flex="0 0 auto";t.style.marginTop="16px";t.style.textAlign="right";t.style.whiteSpace="nowrap";l.isOffline()&&!mxClient.IS_CHROMEAPP||null!=H||t.appendChild(l.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));Z=mxUtils.button(mxResources.get("cancel"),function(){l.hideDialog()});Z.className="geBtn";l.editor.cancelFirst&&t.appendChild(Z);PrintDialog.previewEnabled&&null==H&&(ja=mxUtils.button(mxResources.get("preview"),+function(){Y(!1)}),ja.className="geBtn",t.appendChild(ja));J=null!=J?J:null!=H?"export":PrintDialog.previewEnabled?"print":"ok";J=mxUtils.button(mxResources.get(J),function(){Y(!0)});J.className="geBtn gePrimaryBtn";t.appendChild(J);l.editor.cancelFirst||t.appendChild(Z);ia.appendChild(t);if(l.editor.isChromelessView()){var lb=function(){Editor.isDarkMode()?(ia.classList.add("geDarkMode"),ia.style.colorScheme="dark"):(ia.classList.remove("geDarkMode"),ia.style.colorScheme="light")};l.addListener("darkModeChanged",+lb);lb();var ub=function(gb,jb){gb=jb.getProperty("dialog");ia.parentNode==gb.container&&(l.editor.removeListener(ub),l.removeListener(lb))};l.editor.addListener("hideDialog",ub)}this.container=ia};var ra=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var l=this.image;null!=+l&&null!=l.src&&Graph.isPageLink(l.src)&&(l={originalSrc:l.src});this.page.viewState.backgroundImage=l}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else ra.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&+(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(l=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=l?l:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.parseAnimationScript=function(l){var t=+[];if(null==l)return t;var H=function(ia){if(null!=ia)return ia=parseFloat(ia),!isNaN(ia)&&0<=ia?ia:void 0},J={fade:!0,pop:!0,wipe:!0};l=l.split("\n");for(var R=0;R<l.length;R++){var T=mxUtils.trim(l[R]);if(""!=T&&"#"!=T.charAt(0)){T=T.split(/\s+/);var Y={action:T[0],cell:T[1],arg:T[2]};if("wait"==Y.action){if(Y.delay=parseFloat(Y.cell),isNaN(Y.delay)||0>Y.delay)Y.delay=1E3}else if("setOpacity"==Y.action)Y.opacity=parseFloat(T[2]),isNaN(Y.opacity)&&(Y.opacity=1),Y.opacity=Math.max(0,Math.min(1,Y.opacity)),+Y.duration=H(T[3]),Y.arg=void 0;else if("show"==Y.action){if(null!=Y.arg&&!J[Y.arg]){var Z=H(Y.arg);null!=Z&&(Y.duration=Z,Y.arg=void 0)}null==Y.duration&&(Y.duration=H(T[3]))}else"hide"==Y.action&&(Y.duration=H(T[2]),Y.arg=void 0);t.push(Y)}}return t};Editor.animationFadeDelay=400;Editor.canBatchAnimationSteps=function(l,t){return l.action!=t.action||"wait"==l.action||(l.arg||"")!=(t.arg||"")||(null!=l.opacity?l.opacity:"")!=(null!=t.opacity?t.opacity:"")||(null!=l.duration?l.duration:"")!=(null!=+t.duration?t.duration:"")?!1:!0};Editor.convertLegacyAnimationStep=function(l){if("wait"==l.action)return{wait:l.delay};var t="all"==l.cell?"*":l.cell;if(null==t)return null;var H={cells:[t]};if(null!=l.duration)H.delay=l.duration;else if("show"==l.action&&"fade"==l.arg)H.delay=Editor.animationFadeDelay;else if("hide"==l.action||"setOpacity"==l.action)H.delay=Editor.animationFadeDelay;return"show"==l.action?"fade"==l.arg?{fadeIn:H}:"pop"==l.arg?{popIn:H}:{wipeIn:H}:"hide"==l.action?{fadeOut:H}:"setOpacity"==+l.action?(H.value=l.opacity,{fadeTo:H}):"flow"==l.action?(t={cells:[t]},"start"==l.arg?t.start=!0:"stop"==l.arg&&(t.start=!1),{flow:t}):null};Editor.convertLegacyAnimation=function(l){l=Editor.parseAnimationScript(l);for(var t=[{opacity:{cells:["*"],value:0}}],H=null,J=function(){null!=H&&(t.push(H),H=null)},R=function(Z){null==H&&(H={});for(var ia in Z){var ja=Z[ia],X;if(X=null!=H[ia]&&null!=ja&&Array.isArray(H[ia].cells)&&Array.isArray(ja.cells))X=H[ia],X=X.delay===ja.delay&&X.value===ja.value&&+X.start===ja.start;if(X)for(X=0;X<ja.cells.length;X++)H[ia].cells.push(ja.cells[X]);else null!=H[ia]&&(J(),H={}),H[ia]=ja}},T=0;T<l.length;T++){var Y=Editor.convertLegacyAnimationStep(l[T]);null!=Y&&(null!=Y.wait?(J(),t.push(Y)):R(Y))}J();return{animation:{steps:t}}};Editor.parseAnimationData=function(l){var t=function(J){null==J&&(J={});Array.isArray(J.steps)||(J.steps=[]);J.loop=null==J.loop?!0:!!J.loop;J.enabled=null==J.enabled?!0:!!J.enabled;return J};if(null==l||""===l)return t({steps:[]});if("string"==+typeof l){var H=mxUtils.trim(l);return"{"==H.charAt(0)||"["==H.charAt(0)?Editor.parseAnimationData(JSON.parse(H)):t(Editor.convertLegacyAnimation(l).animation)}return null!=l.animation&&null!=l.animation.steps?t(l.animation):Array.isArray(l.steps)?t(l):t({steps:[]})};Editor.AnimationPlayer=function(l,t){this.graph=l;this.data=Editor.parseAnimationData(t);this.cancelled=this.running=!1;this.snapshot=null};Editor.ANIMATION_ALL="*";Editor.collectAnimatableCells=function(l){var t=[],H;for(H in l.cells){var J=+l.cells[H];(l.isVertex(J)||l.isEdge(J))&&t.push(J)}return t};Editor.AnimationPlayer.prototype.collectReferencedCells=function(){for(var l=this.data.steps||[],t={},H=[],J=0;J<l.length;J++){var R=l[J],T;for(T in R)if("wait"!=T&&"open"!=T){var Y=R[T];if("object"===typeof Y&&null!=Y){Y=this.graph.getCellsForAction(Y,!0);for(var Z=0;Z<Y.length;Z++)t[Y[Z].id]||(t[Y[Z].id]=!0,H.push(Y[Z]))}}}return H};Editor.AnimationPlayer.prototype.snapshotOpacity=function(){var l=this.collectReferencedCells();l=this.graph.getNodesForCells(l);+this.snapshot=[];for(var t=0;t<l.length;t++)this.snapshot.push({node:l[t],opacity:l[t].style.opacity})};Editor.AnimationPlayer.prototype.restoreOpacity=function(){if(null!=this.snapshot){for(var l=0;l<this.snapshot.length;l++)Graph.setTransitionForNodes([this.snapshot[l].node],null),this.snapshot[l].node.style.opacity=this.snapshot[l].opacity;this.snapshot=null}};Editor.AnimationPlayer.prototype.play=function(l){if(!this.running&&null!=this.graph&&!this.graph.isGraphTornDown()){l=l||{};this.running=+!0;this.cancelled=!1;this.graph.stoppingCustomActions=!1;this.graph.view.validate();var t=this,H=this.data.steps||[],J=function(T,Y){if(null==t.graph||t.graph.isGraphTornDown())t.running=!1;else if(t.cancelled||T>=H.length)Y();else{for(var Z=T+1;Z<H.length&&!0===H[Z].immediate&&!t.cancelled;)Z++;if("function"==typeof l.onStep)try{l.onStep(T,Z)}catch(ia){}t.graph.executeCustomActions(Graph.flattenAnimationActions(H.slice(T,Z)),function(){J(Z,Y)},null)}},R=function(){null==t.graph||t.graph.isGraphTornDown()?+t.running=!1:t.cancelled?(t.restoreOpacity(),t.running=!1):(t.snapshotOpacity(),J(0,function(){if(t.cancelled)t.restoreOpacity(),t.running=!1;else{if("function"==typeof l.onStep)try{l.onStep(-1)}catch(T){}l.loop?(t.graph.refresh(),t.restoreOpacity(),window.setTimeout(R,0)):(t.running=!1,t.restoreOpacity(),null!=l.done&&l.done())}}))};l.defer?window.setTimeout(R,0):R()}};Editor.AnimationPlayer.prototype.stop=function(){this.cancelled=!0;null!=this.graph&&(this.graph.stoppingCustomActions=!0);for(var l=+[],t=this.collectReferencedCells(),H=0;H<t.length;H++)this.graph.getModel().isEdge(t[H])&&l.push(t[H]);0<l.length&&Editor.toggleFlowAnimation(this.graph,l,"stop")};Editor.toggleFlowAnimation=function(l,t,H){H=H||"toggle";for(var J=0;J<t.length;J++)if(l.getModel().isEdge(t[J])){var R=l.view.getState(t[J]);if(null!=R&&null!=R.shape){var T=null!=R.shape.getFlowAnimationPath?R.shape.getFlowAnimationPath():null;if(null!=T){var Y="mxEdgeFlow"==T.getAttribute("class"),Z="start"==H||"toggle"==H&&!Y;Y="stop"==+H||"toggle"==H&&Y;R="1"==mxUtils.getValue(R.style,mxConstants.STYLE_DASHED,"0");Y?(T.removeAttribute("class"),R||T.removeAttribute("stroke-dasharray")):Z&&(T.setAttribute("class","mxEdgeFlow"),R||T.setAttribute("stroke-dasharray","8"))}}}};Editor.playAnimationOnGraph=function(l,t){var H=l.getModel().getRoot(),J=null;null!=H.value&&"object"==typeof H.value&&(J=H.value.getAttribute("animation"));if(null==J||""==J)return null;try{var R=Editor.parseAnimationData(J)}catch(Y){return null}if(!R.steps||0==+R.steps.length||!1===R.enabled)return null;H={};if(null!=t)for(var T in t)H[T]=t[T];null==H.loop&&(H.loop=R.loop);null==H.defer&&(H.defer=!0);l=new Editor.AnimationPlayer(l,R);l.play(H);return l};Editor.installAnimationStyles=function(){if(!Editor.animationStylesInstalled){Editor.animationStylesInstalled=!0;try{var l=document.createElement("style");l.type="text/css";l.appendChild(document.createTextNode(".mxEdgeFlow { animation: mxEdgeFlow 0.5s linear infinite; }@keyframes mxEdgeFlow { to { stroke-dashoffset: -16; } }"));+document.getElementsByTagName("head")[0].appendChild(l)}catch(t){}}};Editor.installAnimationStyles()})();(function(){EditorUi.VERSION="30.3.14";EditorUi.CSV_ELK_LAYOUTS={verticalflow:{layout:"elkLayered",config:{"elk.direction":"DOWN","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},horizontalflow:{layout:"elkLayered",config:{"elk.direction":"RIGHT","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},elkRadial:{layout:"elkRadial",config:{edgeStyle:"elkCompat"}},elkOrganic:{layout:"elkOrganic",config:{edgeStyle:"elkCompat"}},elkStress:{layout:"elkStress",config:{edgeStyle:"elkCompat"}}};EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)||/.*\.cdn\.prod\.atlassian-dev\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&"1"!=urlParams.extAuth&&"showSaveFilePicker"in window&&"showOpenFilePicker"inwindow;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://www.drawio.com/doc/faq/scratchpad";EditorUi.enableHtmlEditOption=!0;EditorUi.isMermaidSupported=function(){return window.isMermaidEnabled&&"undefined"!==typeof mxMermaidToDrawio&&"function"===typeof mxMermaidToDrawio.parseText};EditorUi.isNativePlantUmlSupported=function(){return"undefined"!==typeof mxPlantUmlToDrawio&&"function"===typeof mxPlantUmlToDrawio.parseText};EditorUi.defaultMermaidConfig={};EditorUi.legacyMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},gantt:{useWidth:1E3,useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,-axisFormat:"%Y-%m-%d"}};EditorUi.mermaidImageBorder=10;EditorUi.logError=function(c,f,k,q,x,B,E){if(null!=c){x=null!=x?x:Error(c);x.stack=null!=x.stack?x.stack:"";B=null!=B?B:0>c.indexOf("NetworkError")&&0>c.indexOf("SecurityError")&&0>c.indexOf("NS_ERROR_FAILURE")&&0>c.indexOf("out of memory")?"SEVERE":"CONFIG";try{EditorUi.enableLogging&&"1"!=urlParams.dev&&c!=EditorUi.lastErrorMessage&&0>c.indexOf("extension:")&&0>c.indexOf("ResizeObserver loop completed with undelivered notifications")&&0>x.stack.indexOf("extension:")&&-0>x.stack.indexOf("<anonymous>:")&&0>x.stack.indexOf("/math4/es5/")&&0>x.stack.indexOf("blob:")&&(0>c.indexOf("strict mode")||0>x.stack.indexOf("extensions.min.js"))&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+B+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(k)+(null!=q?":colno:"+encodeURIComponent(q):"")+(""!=-x.stack?"&stack="+encodeURIComponent(x.stack):""))}catch(L){}try{E||null==window.console||console.error(B,c,f,k,q,x)}catch(L){}}};EditorUi.logEvent=function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=f+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(k){}};EditorUi.sendReport=function(c,f){if("1"==urlParams.dev)EditorUi.debug("sendReport",+axisFormat:"%Y-%m-%d"}};EditorUi.mermaidImageBorder=10;EditorUi.logError=function(c,f,k,q,x,C,E){if(null!=c){x=null!=x?x:Error(c);x.stack=null!=x.stack?x.stack:"";C=null!=C?C:0>c.indexOf("NetworkError")&&0>c.indexOf("SecurityError")&&0>c.indexOf("NS_ERROR_FAILURE")&&0>c.indexOf("out of memory")?"SEVERE":"CONFIG";try{EditorUi.enableLogging&&"1"!=urlParams.dev&&c!=EditorUi.lastErrorMessage&&0>c.indexOf("extension:")&&0>c.indexOf("ResizeObserver loop completed with undelivered notifications")&&0>x.stack.indexOf("extension:")&&+0>x.stack.indexOf("<anonymous>:")&&0>x.stack.indexOf("/math4/es5/")&&0>x.stack.indexOf("blob:")&&(0>c.indexOf("strict mode")||0>x.stack.indexOf("extensions.min.js"))&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+C+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(k)+(null!=q?":colno:"+encodeURIComponent(q):"")+(""!=+x.stack?"&stack="+encodeURIComponent(x.stack):""))}catch(L){}try{E||null==window.console||console.error(C,c,f,k,q,x)}catch(L){}}};EditorUi.logEvent=function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=f+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(k){}};EditorUi.sendReport=function(c,f){if("1"==urlParams.dev)EditorUi.debug("sendReport",c);else if(EditorUi.enableLogging)try{f=null!=f?f:5E4,c.length>f&&(c=c.substring(0,f)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(c))}catch(k){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var c=[(new Date).toISOString()],f=0;f<arguments.length;f++)c.push(arguments[f]);mxClient.IS_IOS?(mxLog.show(),mxLog.debug(c.join(" "))):console.log.apply(console,c)}}catch(k){}};EditorUi.removeChildNodes=function(c){for(;null!=c.firstChild;)c.removeChild(c.firstChild)};EditorUi.embedSvgImages=function(c){c=c.getElementsByTagName("image");for(var f=[],k=0;k<c.length;k++)f.push(c[k]);for(k=0;k<f.length;k++)EditorUi.replaceSvgImage(f[k])};EditorUi.replaceSvgImage=function(c){try{var f=null;f=null==c.getAttributeNS?c.getAttribute("xlink:href"):c.getAttributeNS(mxConstants.NS_XLINK,"href");var k=EditorUi.getSvgSubtree(f);if(null!=k&&"svg"==k.nodeName){var q=k.getAttribute("width"),-x=k.getAttribute("height");c.hasAttribute("x")&&k.setAttribute("x",c.getAttribute("x"));c.hasAttribute("y")&&k.setAttribute("y",c.getAttribute("y"));k.setAttribute("width",c.getAttribute("width"));k.setAttribute("height",c.getAttribute("height"));k.style.fontFamily="initial";null!=c.getAttribute("preserveAspectRatio")&&k.setAttribute("preserveAspectRatio",c.getAttribute("preserveAspectRatio"));0<q&&0<x&&null==k.getAttribute("viewBox")&&k.setAttribute("viewBox","0 0 "+q+" "+x);var B=mxUtils.createElementNs(k.ownerDocument,-mxConstants.NS_SVG,"g");B.appendChild(k);c.hasAttribute("id")&&B.setAttribute("id",c.getAttribute("id"));c.hasAttribute("transform")&&B.setAttribute("transform",c.getAttribute("transform"));c.hasAttribute("opacity")&&B.setAttribute("opacity",c.getAttribute("opacity"));c.parentNode.replaceChild(B,c)}}catch(E){}};EditorUi.getSvgSubtree=function(c){var f=Graph.getSvgFromDataUri(c);c=null;if(null!=f){c=Graph.sanitizeNode(mxUtils.parseXml(f).documentElement);f=c.getElementsByTagName("style");if(0<f.length){var k=-"svg-image-"+Editor.guid();c.setAttribute("id",k);for(var q=document.implementation.createHTMLDocument(""),x=document.createElement("style"),B=0;B<f.length;B++){x.textContent=f[B].textContent;q.body.appendChild(x);for(var E="",L=0;L<x.sheet.cssRules.length;L++){var Q=x.sheet.cssRules[L];if(null!=Q.selectorText){for(var V=Q.selectorText.split(","),K=0;K<V.length;K++)V[K]="#"+k+" "+V[K];Q.selectorText=V.join(",")}E+=Q.cssText+"\n"}f[B].textContent=E}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&+x=k.getAttribute("height");c.hasAttribute("x")&&k.setAttribute("x",c.getAttribute("x"));c.hasAttribute("y")&&k.setAttribute("y",c.getAttribute("y"));k.setAttribute("width",c.getAttribute("width"));k.setAttribute("height",c.getAttribute("height"));k.style.fontFamily="initial";null!=c.getAttribute("preserveAspectRatio")&&k.setAttribute("preserveAspectRatio",c.getAttribute("preserveAspectRatio"));0<q&&0<x&&null==k.getAttribute("viewBox")&&k.setAttribute("viewBox","0 0 "+q+" "+x);var C=mxUtils.createElementNs(k.ownerDocument,+mxConstants.NS_SVG,"g");C.appendChild(k);c.hasAttribute("id")&&C.setAttribute("id",c.getAttribute("id"));c.hasAttribute("transform")&&C.setAttribute("transform",c.getAttribute("transform"));c.hasAttribute("opacity")&&C.setAttribute("opacity",c.getAttribute("opacity"));c.parentNode.replaceChild(C,c)}}catch(E){}};EditorUi.getSvgSubtree=function(c){var f=Graph.getSvgFromDataUri(c);c=null;if(null!=f){c=Graph.sanitizeNode(mxUtils.parseXml(f).documentElement);f=c.getElementsByTagName("style");if(0<f.length){var k=+"svg-image-"+Editor.guid();c.setAttribute("id",k);for(var q=document.implementation.createHTMLDocument(""),x=document.createElement("style"),C=0;C<f.length;C++){x.textContent=f[C].textContent;q.body.appendChild(x);for(var E="",L=0;L<x.sheet.cssRules.length;L++){var Q=x.sheet.cssRules[L];if(null!=Q.selectorText){for(var V=Q.selectorText.split(","),K=0;K<V.length;K++)V[K]="#"+k+" "+V[K];Q.selectorText=V.join(",")}E+=Q.cssText+"\n"}f[C].textContent=E}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&c.style.removeProperty("color-scheme");f=c.getElementsByTagName("*");for(k=0;k<f.length;k++)f[k].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.isDiagramDataEmpty=function(c){if(null==c||0==c.length||c==this.emptyDiagramXml)return!0;try{var f=mxUtils.parseXml(c).documentElement;c=function(L){return null==-L||2>=L.getElementsByTagName("mxCell").length};if("mxGraphModel"==f.nodeName)return c(f);if("mxfile"==f.nodeName){var k=f.getElementsByTagName("diagram");if(0==k.length)return!0;for(f=0;f<k.length;f++){var q=k[f].getElementsByTagName("mxGraphModel");if(0<q.length){if(!c(q[0]))return!1}else{var x=mxUtils.getNodeValue(k[f]);if(null!=x&&0<x.length){var B=Graph.decompress(x);if(null!=B&&0<B.length){var E=mxUtils.parseXml(B);if(!c(E.documentElement))return!1}}}}return!0}}catch(L){}return!1};EditorUi.prototype.mode=+L||2>=L.getElementsByTagName("mxCell").length};if("mxGraphModel"==f.nodeName)return c(f);if("mxfile"==f.nodeName){var k=f.getElementsByTagName("diagram");if(0==k.length)return!0;for(f=0;f<k.length;f++){var q=k[f].getElementsByTagName("mxGraphModel");if(0<q.length){if(!c(q[0]))return!1}else{var x=mxUtils.getNodeValue(k[f]);if(null!=x&&0<x.length){var C=Graph.decompress(x);if(null!=C&&0<C.length){var E=mxUtils.parseXml(C);if(!c(E.documentElement))return!1}}}}return!0}}catch(L){}return!1};EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=1200;EditorUi.prototype.maxTextWidth=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=2E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.maxTextBytes=5E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.sidebarEnabled="0"!=urlParams.sidebar;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;EditorUi.prototype.embedMessageSource=null;EditorUi.prototype.defaultCompact=!1;EditorUi.prototype.noAutoFocus=!1;EditorUi.prototype.embedExportBorder=8;EditorUi.prototype.embedExportTheme="auto";EditorUi.prototype.embedExportBackground=null;EditorUi.prototype.shareCursorPosition=!0;EditorUi.prototype.showRemoteCursors=!0;EditorUi.prototype.createButtonContainer=function(){var c=document.createElement("div");c.className="geButtonContainer";return c};EditorUi.prototype.openLink=function(c,f,k){return this.editor.graph.openLink(c,@@ -3974,93 +3977,93 @@ f,k)};EditorUi.prototype.showSplash=function(c){};EditorUi.prototype.getLocalDatEditorUi.prototype.isShareCursorPosition=function(){return this.shareCursorPosition};EditorUi.prototype.setShowRemoteCursors=function(c){this.showRemoteCursors=c;this.fireEvent(new mxEventObject("showRemoteCursorsChanged"))};EditorUi.prototype.isShowRemoteCursors=function(){return this.showRemoteCursors};EditorUi.prototype.setMathEnabled=function(c){var f=this.editor.graph;f.mathEnabled=c;null!=f.view.backgroundImage&&(f.view.backgroundImage.destroy(),f.view.backgroundImage=null);this.editor.updateGraphComponents();f.refresh();f.defaultMathEnabled=c;this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(c){return this.editor.graph.mathEnabled};EditorUi.prototype.setAdaptiveColors=function(c){this.editor.graph.setAdaptiveColors(c);this.editor.graph.view.clear();this.fireEvent(new mxEventObject("adaptiveColorsChanged"))};EditorUi.prototype.isStandaloneApp=function(){return mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(c){return this.isOfflineApp()||!navigator.onLine&&!EditorUi.isElectronApp||!c&&("1"==urlParams.stealth||"1"==urlParams.lockdown)};EditorUi.prototype.isExternalDataComms=function(){return"1"!=urlParams.offline&&!this.isOffline()&&!this.isOfflineApp()};EditorUi.prototype.createSpinner=function(c,f,k){var q=null==c||null==f;k=null!=k?k:24;var x=new Spinner({lines:12,length:k,width:Math.round(k/3),radius:Math.round(k/2),rotate:0,-color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),B=this.timeout,E=x.spin,L=null,Q=null,V=mxUtils.bind(this,function(aa){null!=aa&&aa()}),K=this;x.spin=function(aa,da,ba,ha){ha=null!=ha?ha:B;var qa=!1;if(!this.active){var ra=Date.now();null!=ba&&(L=window.setTimeout(function(){x.stop();L=null;ba({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:Q})},ha));q&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,+color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),C=this.timeout,E=x.spin,L=null,Q=null,V=mxUtils.bind(this,function(aa){null!=aa&&aa()}),K=this;x.spin=function(aa,da,ba,ha){ha=null!=ha?ha:C;var qa=!1;if(!this.active){var ra=Date.now();null!=ba&&(L=window.setTimeout(function(){x.stop();L=null;ba({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:Q})},ha));q&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/2-2);aa==document.body&&"1"==urlParams.embedInline&&(aa=K.diagramContainer,c=aa.scrollLeft+aa.clientWidth/2,f=aa.scrollTop+aa.clientHeight/2);E.call(this,aa);"1"==urlParams.embedInline&&null!=x.el&&(x.el.style.marginTop=aa.scrollTop+"px",x.el.style.marginLeft=aa.scrollLeft+"px");this.active=!0;null!=da&&(qa=document.createElement("div"),qa.className="geSpinnerStatus",qa.setAttribute("title",da),aa==document.body?(qa.style.left=Math.max(0,c)+"px",qa.style.top=Math.max(0,f+66)+"px"):(qa.style.left="50%",qa.style.top="50%",qa.style.marginTop="70px"),"..."!=da.substring(da.length-3,da.length)&&"!"!=da.charAt(da.length-1)&&(da+="..."),qa.innerText=da,aa.appendChild(qa),x.status=qa);this.pause=mxUtils.bind(this,function(){var l=V;this.active&&(ha=Math.max(0,ha-(Date.now()-ra)),l=mxUtils.bind(this,function(t){this.spin(aa,da,ba,ha);if(null!=t)try{t(),Q=mxUtils.bind(this,function(){this.spin(aa,da,ba,ha);try{t()}catch(H){null!=ba&&ba(H)}})}catch(H){null!=ba&&ba(H)}}));this.stop();return l});qa=!0}return qa};var fa=x.stop;x.stop=function(){fa.call(this);this.active&&(this.active=!1,null!=L&&(window.clearTimeout(L),L=null),null!=x.status&&null!=x.status.parentNode&&x.status.parentNode.removeChild(x.status),x.status=null)};x.pause=function(){return V};return x};EditorUi.prototype.isCompatibleString=function(c){try{if(c=mxUtils.trim(c),"<"==c.charAt(0)){var f=mxUtils.parseXml(c),k=this.editor.extractGraphModel(f.documentElement,!0);return null!=k&&0==k.getElementsByTagName("parsererror").length}}catch(q){}return!1};EditorUi.isVisioFilename=function(c){return/(\.v(dx|sdx?))($|\?)/i.test(c)||/(\.vs(x|sx?))($|\?)/i.test(c)};EditorUi.prototype.isVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&4==c.charCodeAt(3)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&6==c.charCodeAt(3))};EditorUi.prototype.isRemoteVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||60==c.charCodeAt(0)&&63==c.charCodeAt(1)&&120==c.charCodeAt(2)&&109==c.charCodeAt(3)&&108==c.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=function(c){var f=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var k=-f.getFunction,q=this.editor.graph,x=this;f.getFunction=function(B){if(q.isSelectionEmpty()&&null!=x.pages&&0<x.pages.length){var E=x.getSelectedPageIndex();if(mxEvent.isShiftDown(B)){if(37==B.keyCode)return function(){0<E&&x.movePage(E,E-1)};if(38==B.keyCode)return function(){0<E&&x.movePage(E,0)};if(39==B.keyCode)return function(){E<x.pages.length-1&&x.movePage(E,E+1)};if(40==B.keyCode)return function(){E<x.pages.length-1&&x.movePage(E,x.pages.length-1)}}else if(mxEvent.isControlDown(B)||mxClient.IS_MAC&&-mxEvent.isMetaDown(B)){if(37==B.keyCode)return function(){0<E&&x.selectNextPage(!1)};if(38==B.keyCode)return function(){0<E&&x.selectPage(x.pages[0])};if(39==B.keyCode)return function(){E<x.pages.length-1&&x.selectNextPage(!0)};if(40==B.keyCode)return function(){E<x.pages.length-1&&x.selectPage(x.pages[x.pages.length-1])}}}return!(65<=B.keyCode&&90>=B.keyCode)||q.isSelectionEmpty()||mxEvent.isAltDown(B)||mxEvent.isShiftDown(B)||mxEvent.isControlDown(B)||mxClient.IS_MAC&&mxEvent.isMetaDown(B)?k.apply(this,-arguments):null}}return f};var d=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var f=d.apply(this,arguments);if(null==f)try{var k=c.indexOf("<mxfile ");if(0<=k){var q=c.lastIndexOf("</mxfile>");q>k&&(f=c.substring(k,q+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var x=mxUtils.parseXml(c),B=this.editor.extractGraphModel(x.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);-f=null!=B?mxUtils.getXml(B):""}}catch(E){}return f};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var f=c.indexOf('<meta charset="utf-8">');0<=f&&(c=c.slice(0,f)+'<meta charset="utf-8"/>'+c.slice(f+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.repairFileData=function(c){c=mxUtils.trim(c||"");if(0==c.length)return null;var f=c.replace(/<\/([A-Za-z_][\w.\-]*)(\s*)(?=<)/g,"</$1>$2"),k=f.lastIndexOf(">");f.lastIndexOf("<")>k&&(f=mxUtils.trim(f.substring(0,+f.getFunction,q=this.editor.graph,x=this;f.getFunction=function(C){if(q.isSelectionEmpty()&&null!=x.pages&&0<x.pages.length){var E=x.getSelectedPageIndex();if(mxEvent.isShiftDown(C)){if(37==C.keyCode)return function(){0<E&&x.movePage(E,E-1)};if(38==C.keyCode)return function(){0<E&&x.movePage(E,0)};if(39==C.keyCode)return function(){E<x.pages.length-1&&x.movePage(E,E+1)};if(40==C.keyCode)return function(){E<x.pages.length-1&&x.movePage(E,x.pages.length-1)}}else if(mxEvent.isControlDown(C)||mxClient.IS_MAC&&+mxEvent.isMetaDown(C)){if(37==C.keyCode)return function(){0<E&&x.selectNextPage(!1)};if(38==C.keyCode)return function(){0<E&&x.selectPage(x.pages[0])};if(39==C.keyCode)return function(){E<x.pages.length-1&&x.selectNextPage(!0)};if(40==C.keyCode)return function(){E<x.pages.length-1&&x.selectPage(x.pages[x.pages.length-1])}}}return!(65<=C.keyCode&&90>=C.keyCode)||q.isSelectionEmpty()||mxEvent.isAltDown(C)||mxEvent.isShiftDown(C)||mxEvent.isControlDown(C)||mxClient.IS_MAC&&mxEvent.isMetaDown(C)?k.apply(this,+arguments):null}}return f};var d=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var f=d.apply(this,arguments);if(null==f)try{var k=c.indexOf("<mxfile ");if(0<=k){var q=c.lastIndexOf("</mxfile>");q>k&&(f=c.substring(k,q+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var x=mxUtils.parseXml(c),C=this.editor.extractGraphModel(x.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);+f=null!=C?mxUtils.getXml(C):""}}catch(E){}return f};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var f=c.indexOf('<meta charset="utf-8">');0<=f&&(c=c.slice(0,f)+'<meta charset="utf-8"/>'+c.slice(f+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.repairFileData=function(c){c=mxUtils.trim(c||"");if(0==c.length)return null;var f=c.replace(/<\/([A-Za-z_][\w.\-]*)(\s*)(?=<)/g,"</$1>$2"),k=f.lastIndexOf(">");f.lastIndexOf("<")>k&&(f=mxUtils.trim(f.substring(0,k+1)));if("</mxfile>"!=f.substring(f.length-9)){k=[];for(var q=/<(\/?)([A-Za-z_][\w.\-]*)[^>]*?(\/?)>/g,x;null!=(x=q.exec(f));)"/"==x[1]?0<k.length&&k[k.length-1]==x[2]&&k.pop():"/"!=x[3]&&k.push(x[2]);for(q=k.length-1;0<=q;q--)f+="</"+k[q]+">"}return f!=c?f:null};EditorUi.prototype.isFileDataLoadable=function(c){try{c=this.validateFileData(c);var f=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;if(null==f||null!=Editor.extractParserError(f))return!1;var k=this.editor.extractGraphModel(f,-!0);return null!=(null!=k?k:f)}catch(q){return!1}};EditorUi.prototype.getRecoveryData=function(c,f,k,q){var x=null;try{var B=this.repairFileData(f);null!=B&&B!=f&&this.isFileDataLoadable(B)&&(x={type:"repair",label:mxResources.get("openRepairedCopy"),description:mxResources.get("recoveryRepairedDesc"),data:B,lossy:!0})}catch(L){}var E=mxUtils.bind(this,function(L){var Q=[];null!=L&&null!=L.data&&Q.push(L);null!=x&&Q.push(x);q(Q)});null!=c&&"function"===typeof c.getRecoveryVersion?c.getRecoveryVersion(mxUtils.bind(this,+!0);return null!=(null!=k?k:f)}catch(q){return!1}};EditorUi.prototype.getRecoveryData=function(c,f,k,q){var x=null;try{var C=this.repairFileData(f);null!=C&&C!=f&&this.isFileDataLoadable(C)&&(x={type:"repair",label:mxResources.get("openRepairedCopy"),description:mxResources.get("recoveryRepairedDesc"),data:C,lossy:!0})}catch(L){}var E=mxUtils.bind(this,function(L){var Q=[];null!=L&&null!=L.data&&Q.push(L);null!=x&&Q.push(x);q(Q)});null!=c&&"function"===typeof c.getRecoveryVersion?c.getRecoveryVersion(mxUtils.bind(this,function(L){E(L)}),mxUtils.bind(this,function(){E(null)})):E(null)};EditorUi.prototype.openRecoveredCopy=function(c,f){c=new LocalFile(this,c.data,mxResources.get("copyOf",[f||this.defaultFilename]),!0);this.fileLoaded(c)&&c.fileChanged()};EditorUi.prototype.showRecoveryDialog=function(c,f){c=new RecoveryDialog(this,c,mxUtils.bind(this,function(k){this.hideDialog();this.openRecoveredCopy(k,f)}),mxUtils.bind(this,function(){this.hideDialog()}));this.showDialog(c.container,380,null,!0,!0)};EditorUi.prototype.formatRecoveryDate=function(c){c=new Date(c);return!isNaN(c.getTime())&&0<=c.getTime()?c.toLocaleString():null};EditorUi.prototype.replaceFileData=function(c,f){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",f);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var k=null!=c?this.editor.extractGraphModel(c,!0):null;null!=k&&(c=k);if(null!=c){k=this.editor.graph;k.model.beginUpdate();try{var q=null!=this.pages?this.pages.slice():null,x=c.getElementsByTagName("diagram");-if(1<x.length||1==x.length&&x[0].hasAttribute("name")){this.fileNode=c;k.defaultExportLinkTarget=c.getAttribute("linkTarget");this.pages=null!=this.pages?this.pages:[];for(var B=x.length-1;0<=B;B--){var E=this.updatePageRoot(new DiagramPage(x[B]));null==E.getName()&&E.setName(mxResources.get("pageWithNumber",[B+1]));k.model.execute(new ChangePage(this,E,0==B?E:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),-this.currentPage.setName(mxResources.get("pageWithNumber",[1])),k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=q)for(B=0;B<q.length;B++)k.model.execute(new ChangePage(this,q[B],null));var L=this.getCurrentFile();null!=L&&L.fileReplaced(f)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=-function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa){f=null!=f?f:this.editor.graph;x=null!=x?x:!1;Q=null!=Q?Q:!0;V=null!=V?V:this.defaultCompact;K=null!=K?K:!Editor.defaultCompressed;var da=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var ba="_blank";else da=ba=q;if(null==c)return"";var ha=c;if("mxfile"!=ha.nodeName.toLowerCase()){if(K){var qa=c.ownerDocument.createElement("diagram");qa.setAttribute("name",mxResources.get("pageWithNumber",[1]));qa.setAttribute("id",Editor.guid());+if(1<x.length||1==x.length&&x[0].hasAttribute("name")){this.fileNode=c;k.defaultExportLinkTarget=c.getAttribute("linkTarget");this.pages=null!=this.pages?this.pages:[];for(var C=x.length-1;0<=C;C--){var E=this.updatePageRoot(new DiagramPage(x[C]));null==E.getName()&&E.setName(mxResources.get("pageWithNumber",[C+1]));k.model.execute(new ChangePage(this,E,0==C?E:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),+this.currentPage.setName(mxResources.get("pageWithNumber",[1])),k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=q)for(C=0;C<q.length;C++)k.model.execute(new ChangePage(this,q[C],null));var L=this.getCurrentFile();null!=L&&L.fileReplaced(f)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=+function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa){f=null!=f?f:this.editor.graph;x=null!=x?x:!1;Q=null!=Q?Q:!0;V=null!=V?V:this.defaultCompact;K=null!=K?K:!Editor.defaultCompressed;var da=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var ba="_blank";else da=ba=q;if(null==c)return"";var ha=c;if("mxfile"!=ha.nodeName.toLowerCase()){if(K){var qa=c.ownerDocument.createElement("diagram");qa.setAttribute("name",mxResources.get("pageWithNumber",[1]));qa.setAttribute("id",Editor.guid());qa.appendChild(c)}else{qa=Graph.zapGremlins(mxUtils.getXml(c));ha=Graph.compress(qa);if(Graph.decompress(ha)!=qa)return qa;qa=c.ownerDocument.createElement("diagram");qa.setAttribute("name",mxResources.get("pageWithNumber",[1]));qa.setAttribute("id",Editor.guid());mxUtils.setTextContent(qa,ha)}ha=c.ownerDocument.createElement("mxfile");ha.appendChild(qa)}V?(ha=ha.cloneNode(!0),ha.removeAttribute("modified"),ha.removeAttribute("host"),ha.removeAttribute("agent"),ha.removeAttribute("etag"),ha.removeAttribute("userAgent"),ha.removeAttribute("version"),ha.removeAttribute("editor"),ha.removeAttribute("type")):(ha.removeAttribute("userAgent"),ha.removeAttribute("modified"),ha.removeAttribute("version"),ha.removeAttribute("editor"),ha.removeAttribute("pages"),ha.removeAttribute("type"),ha.removeAttribute("etag"),mxClient.IS_CHROMEAPP?ha.setAttribute("host","Chrome"):EditorUi.isElectronApp?ha.setAttribute("host","Electron"):ha.setAttribute("host",window.location.hostname),1<ha.getElementsByTagName("diagram").length&&null!=-this.pages&&ha.setAttribute("pages",this.pages.length));null!=fa&&(ha=ha.cloneNode(!0),ha.setAttribute("scale",fa));null!=aa&&(ha=ha.cloneNode(!0),ha.setAttribute("border",aa));c=K?mxUtils.getPrettyXml(ha):mxUtils.getXml(ha);if(!B&&!x&&(E||null!=k&&/(\.html)$/i.test(k.getTitle())))c=this.getHtml2(mxUtils.getXml(ha),f,null!=k?k.getTitle():null,ba,da);else if(B||!x&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(q=null),k=this.getSvgFileProperties(ha),-c=this.getEmbeddedSvg(c,f,q,null,L,Q,da,null,null,k.scale,k.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,f,k,q){c=null!=c?c:!0;f=null!=f?f:!1;k=null!=k?k:!Editor.defaultCompressed;var x=this.editor.getGraphXml(c,q);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(Q){var V=Q.getElementsByTagName("mxGraphModel"),K=0<V.length?V[0]:null;V=Q;null==K&&k?(K=mxUtils.getNodeValue(Q),0<K.length&&(K=Graph.decompress(K),null!=K&&0<K.length&&(V=Q.cloneNode(!1),-V.appendChild(mxUtils.parseXml(K).documentElement)))):null==K||k?V=Q.cloneNode(!0):(V=Q.cloneNode(!1),mxUtils.setTextContent(V,Graph.compressNode(K)));x.appendChild(V)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(x),x=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var B=this.pages[f],E=B.node;if(B!=this.currentPage)if(B.needsUpdate){var L=new mxCodec(mxUtils.createXmlDocument());L=L.encode(new mxGraphModel(B.root));-this.editor.graph.saveViewState(B.viewState,L,null,q);EditorUi.removeChildNodes(E);E.appendChild(L);delete B.needsUpdate}else q&&(this.updatePageRoot(B),null!=B.viewState.backgroundImage&&null!=B.viewState.backgroundImage.originalSrc&&(L=new mxCodec(mxUtils.createXmlDocument()),L=L.encode(new mxGraphModel(B.root)),this.editor.graph.saveViewState(B.viewState,L,null,q,B),E=E.cloneNode(!1),E.appendChild(L)));c(E)}return x};EditorUi.prototype.anonymizeString=function(c,f){for(var k=[],q=0;q<c.length;q++){var x=-c.charAt(q);0<=EditorUi.ignoredAnonymizedChars.indexOf(x)?k.push(x):isNaN(parseInt(x))?x.toLowerCase()!=x?k.push(String.fromCharCode(65+Math.round(25*Math.random()))):x.toUpperCase()!=x?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(x)?k.push(" "):k.push("?"):k.push(f?"0":Math.round(9*Math.random()))}return k.join("")};EditorUi.prototype.anonymizeXml=function(c){function f(E,L,Q){if(E.hasAttribute(L)){var V=E.getAttribute(L);null!=V&&0<V.length&&(Q&&0<=V.indexOf("<")?(B.innerHTML=-Graph.sanitizeHtml(V),k(B),V=B.innerHTML):V=x.anonymizeString(V),E.setAttribute(L,V))}}function k(E){null!=E.nodeValue&&(E.nodeValue=x.anonymizeString(E.nodeValue));if(E.nodeType==mxConstants.NODETYPE_ELEMENT)for(E=E.firstChild;null!=E;)k(E),E=E.nextSibling}function q(E){if(E.nodeType==mxConstants.NODETYPE_ELEMENT){if("mxCell"==E.nodeName)f(E,"value",!0);else if("object"==E.nodeName||"UserObject"==E.nodeName)for(var L=0;L<E.attributes.length;L++){var Q=E.attributes[L];"id"!=Q.name&&"style"!=Q.name&&-"placeholders"!=Q.name&&"vertex"!=Q.name&&"edge"!=Q.name&&"parent"!=Q.name&&"connectable"!=Q.name&&"visible"!=Q.name&&"collapsed"!=Q.name&&"source"!=Q.name&&"target"!=Q.name&&(Q.value=x.anonymizeString(Q.value))}else"diagram"==E.nodeName&&f(E,"name",!1);for(E=E.firstChild;null!=E;)q(E),E=E.nextSibling}}var x=this,B=document.createElement("div");c=mxUtils.parseXml(c);q(c.documentElement);return mxUtils.getPrettyXml(c.documentElement)};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);-if(null!=c[EditorUi.DIFF_INSERT])for(var f=0;f<c[EditorUi.DIFF_INSERT].length;f++)try{var k=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][f].data).documentElement.cloneNode(!1);null!=k.getAttribute("name")&&k.setAttribute("name",this.anonymizeString(k.getAttribute("name")));c[EditorUi.DIFF_INSERT][f].data=mxUtils.getXml(k)}catch(B){c[EditorUi.DIFF_INSERT][f].data=B.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var q in c[EditorUi.DIFF_UPDATE]){var x=c[EditorUi.DIFF_UPDATE][q];null!=x.name&&(x.name=this.anonymizeString(x.name));-null!=x.cells&&(f=mxUtils.bind(this,function(B){var E=x.cells[B];if(null!=E){for(var L in E)null!=E[L].value&&(E[L].value="["+E[L].value.length+"]"),null!=E[L].xmlValue&&(E[L].xmlValue="["+E[L].xmlValue.length+"]"),null!=E[L].style&&(E[L].style="["+E[L].style.length+"]"),mxUtils.isEmptyObject(E[L])&&delete E[L];mxUtils.isEmptyObject(E)&&delete x.cells[B]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(x.cells)&&delete x.cells);mxUtils.isEmptyObject(x)&&delete c[EditorUi.DIFF_UPDATE][q]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&+this.pages&&ha.setAttribute("pages",this.pages.length));null!=fa&&(ha=ha.cloneNode(!0),ha.setAttribute("scale",fa));null!=aa&&(ha=ha.cloneNode(!0),ha.setAttribute("border",aa));c=K?mxUtils.getPrettyXml(ha):mxUtils.getXml(ha);if(!C&&!x&&(E||null!=k&&/(\.html)$/i.test(k.getTitle())))c=this.getHtml2(mxUtils.getXml(ha),f,null!=k?k.getTitle():null,ba,da);else if(C||!x&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(q=null),k=this.getSvgFileProperties(ha),+c=this.getEmbeddedSvg(c,f,q,null,L,Q,da,null,null,k.scale,k.border,null,Editor.svgFileTheme,null,k.embedFonts);return c};EditorUi.prototype.getXmlFileData=function(c,f,k,q){c=null!=c?c:!0;f=null!=f?f:!1;k=null!=k?k:!Editor.defaultCompressed;var x=this.editor.getGraphXml(c,q);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(Q){var V=Q.getElementsByTagName("mxGraphModel"),K=0<V.length?V[0]:null;V=Q;null==K&&k?(K=mxUtils.getNodeValue(Q),0<K.length&&(K=Graph.decompress(K),null!=K&&0<K.length&&+(V=Q.cloneNode(!1),V.appendChild(mxUtils.parseXml(K).documentElement)))):null==K||k?V=Q.cloneNode(!0):(V=Q.cloneNode(!1),mxUtils.setTextContent(V,Graph.compressNode(K)));x.appendChild(V)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(x),x=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var C=this.pages[f],E=C.node;if(C!=this.currentPage)if(C.needsUpdate){var L=new mxCodec(mxUtils.createXmlDocument());L=L.encode(new mxGraphModel(C.root));+this.editor.graph.saveViewState(C.viewState,L,null,q);EditorUi.removeChildNodes(E);E.appendChild(L);delete C.needsUpdate}else q&&(this.updatePageRoot(C),null!=C.viewState.backgroundImage&&null!=C.viewState.backgroundImage.originalSrc&&(L=new mxCodec(mxUtils.createXmlDocument()),L=L.encode(new mxGraphModel(C.root)),this.editor.graph.saveViewState(C.viewState,L,null,q,C),E=E.cloneNode(!1),E.appendChild(L)));c(E)}return x};EditorUi.prototype.anonymizeString=function(c,f){for(var k=[],q=0;q<c.length;q++){var x=+c.charAt(q);0<=EditorUi.ignoredAnonymizedChars.indexOf(x)?k.push(x):isNaN(parseInt(x))?x.toLowerCase()!=x?k.push(String.fromCharCode(65+Math.round(25*Math.random()))):x.toUpperCase()!=x?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(x)?k.push(" "):k.push("?"):k.push(f?"0":Math.round(9*Math.random()))}return k.join("")};EditorUi.prototype.anonymizeXml=function(c){function f(E,L,Q){if(E.hasAttribute(L)){var V=E.getAttribute(L);null!=V&&0<V.length&&(Q&&0<=V.indexOf("<")?(C.innerHTML=+Graph.sanitizeHtml(V),k(C),V=C.innerHTML):V=x.anonymizeString(V),E.setAttribute(L,V))}}function k(E){null!=E.nodeValue&&(E.nodeValue=x.anonymizeString(E.nodeValue));if(E.nodeType==mxConstants.NODETYPE_ELEMENT)for(E=E.firstChild;null!=E;)k(E),E=E.nextSibling}function q(E){if(E.nodeType==mxConstants.NODETYPE_ELEMENT){if("mxCell"==E.nodeName)f(E,"value",!0);else if("object"==E.nodeName||"UserObject"==E.nodeName)for(var L=0;L<E.attributes.length;L++){var Q=E.attributes[L];"id"!=Q.name&&"style"!=Q.name&&+"placeholders"!=Q.name&&"vertex"!=Q.name&&"edge"!=Q.name&&"parent"!=Q.name&&"connectable"!=Q.name&&"visible"!=Q.name&&"collapsed"!=Q.name&&"source"!=Q.name&&"target"!=Q.name&&(Q.value=x.anonymizeString(Q.value))}else"diagram"==E.nodeName&&f(E,"name",!1);for(E=E.firstChild;null!=E;)q(E),E=E.nextSibling}}var x=this,C=document.createElement("div");c=mxUtils.parseXml(c);q(c.documentElement);return mxUtils.getPrettyXml(c.documentElement)};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);+if(null!=c[EditorUi.DIFF_INSERT])for(var f=0;f<c[EditorUi.DIFF_INSERT].length;f++)try{var k=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][f].data).documentElement.cloneNode(!1);null!=k.getAttribute("name")&&k.setAttribute("name",this.anonymizeString(k.getAttribute("name")));c[EditorUi.DIFF_INSERT][f].data=mxUtils.getXml(k)}catch(C){c[EditorUi.DIFF_INSERT][f].data=C.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var q in c[EditorUi.DIFF_UPDATE]){var x=c[EditorUi.DIFF_UPDATE][q];null!=x.name&&(x.name=this.anonymizeString(x.name));+null!=x.cells&&(f=mxUtils.bind(this,function(C){var E=x.cells[C];if(null!=E){for(var L in E)null!=E[L].value&&(E[L].value="["+E[L].value.length+"]"),null!=E[L].xmlValue&&(E[L].xmlValue="["+E[L].xmlValue.length+"]"),null!=E[L].style&&(E[L].style="["+E[L].style.length+"]"),mxUtils.isEmptyObject(E[L])&&delete E[L];mxUtils.isEmptyObject(E)&&delete x.cells[C]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(x.cells)&&delete x.cells);mxUtils.isEmptyObject(x)&&delete c[EditorUi.DIFF_UPDATE][q]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,f){if(null!=c.attributes)for(var k=0;k<c.attributes.length;k++)"as"!=c.attributes[k].name&&c.setAttribute(c.attributes[k].name,this.anonymizeString(c.attributes[k].value,f));if(null!=c.childNodes)for(k=0;k<c.childNodes.length;k++)this.anonymizeAttributes(c.childNodes[k],f)};EditorUi.prototype.anonymizeNode=function(c,f){f=c.getElementsByTagName("mxCell");for(var k=0;k<f.length;k++)null!=f[k].getAttribute("value")&&f[k].setAttribute("value","["+f[k].getAttribute("value").length+"]"),null!=f[k].getAttribute("xmlValue")&&f[k].setAttribute("xmlValue","["+f[k].getAttribute("xmlValue").length+"]"),null!=f[k].getAttribute("style")&&f[k].setAttribute("style","["+f[k].getAttribute("style").length+"]"),null!=f[k].parentNode&&"root"!=f[k].parentNode.nodeName&&null!=f[k].parentNode.parentNode&&(f[k].setAttribute("id",f[k].parentNode.getAttribute("id")),f[k].parentNode.parentNode.replaceChild(f[k],f[k].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var f=this.getCurrentFile();null!=f&&(f.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&f.invalidChecksum?f.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(f.clearAutosave(),this.clearStatus(),c?f.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){this.spinner.stop();f.handleFileError(k,!0)})):-f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){f.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa){x=null!=x?x:!0;B=null!=B?B:!1;V=null!=V?V:!Editor.defaultCompressed;var da=this.editor.graph;if((f||!c&&null!=Q&&/(\.svg)$/i.test(Q.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var ba=da.getGlobalVariable;da=this.createTemporaryGraph(da.getStylesheet());da.setBackgroundImage=+f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){f.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa){x=null!=x?x:!0;C=null!=C?C:!1;V=null!=V?V:!Editor.defaultCompressed;var da=this.editor.graph;if((f||!c&&null!=Q&&/(\.svg)$/i.test(Q.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var ba=da.getGlobalVariable;da=this.createTemporaryGraph(da.getStylesheet());da.setBackgroundImage=this.editor.graph.setBackgroundImage;da.background=this.editor.graph.background;var ha=null!=this.pages?this.pages[0]:null;null==ha||this.currentPage==ha?da.setBackgroundImage(this.editor.graph.backgroundImage):null!=ha.viewState&&null!=ha.viewState&&da.setBackgroundImage(ha.viewState.backgroundImage);da.getGlobalVariable=function(qa){return"page"==qa&&null!=ha?ha.getName():"pagenumber"==qa?1:ba.apply(this,arguments)};document.body.appendChild(da.container);null!=ha&&da.model.setRoot(ha.root)}E=null!=-E?E:this.getXmlFileData(x,B,V,K);Q=null!=Q?Q:this.getCurrentFile();c=this.createFileData(E,da,Q,window.location.href,c,f,k,q,x,L,V,fa,aa);da!=this.editor.graph&&da.container.parentNode.removeChild(da.container);return c};EditorUi.prototype.getHtml=function(c,f,k,q,x,B){B=null!=B?B:!0;var E=null,L=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){E=B?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var Q=f.view.scale;B=Math.floor(E.x/Q-f.view.translate.x);Q=Math.floor(E.y/Q-f.view.translate.y);-E=f.background;null==x&&(f=this.getBasenames().join(";"),0<f.length&&(L=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",B);c.setAttribute("y0",Q)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=q&&c.setAttribute("edit",q));null!=x&&(x=x.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";q=Graph.compress(c);Graph.decompress(q)!=c&&(q=encodeURIComponent(c));+E?E:this.getXmlFileData(x,C,V,K);Q=null!=Q?Q:this.getCurrentFile();c=this.createFileData(E,da,Q,window.location.href,c,f,k,q,x,L,V,fa,aa);da!=this.editor.graph&&da.container.parentNode.removeChild(da.container);return c};EditorUi.prototype.getHtml=function(c,f,k,q,x,C){C=null!=C?C:!0;var E=null,L=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){E=C?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var Q=f.view.scale;C=Math.floor(E.x/Q-f.view.translate.x);Q=Math.floor(E.y/Q-f.view.translate.y);+E=f.background;null==x&&(f=this.getBasenames().join(";"),0<f.length&&(L=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",C);c.setAttribute("y0",Q)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=q&&c.setAttribute("edit",q));null!=x&&(x=x.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";q=Graph.compress(c);Graph.decompress(q)!=c&&(q=encodeURIComponent(c));return(null==x?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=x?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==x?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=x?'<meta http-equiv="refresh" content="0;URL=\''+x+"'\"/>\n":"")+"</head>\n<body"+(null==x&&null!=E&&E!=mxConstants.NONE?' style="background-color:'+E+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+q+"</div>\n</div>\n"+(null==x?'<script type="text/javascript" src="'+L+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+x+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,f,k,q,x){f=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=x&&(x=x.replace(/&/g,"&"));c={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(c),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==x?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=x?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==x?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=x?'<meta http-equiv="refresh" content="0;URL=\''+x+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>\n'+(null==x?'<script type="text/javascript" src="'+f+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+x+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.updateFileVars=function(){var c=null!=this.fileNode?this.fileNode.getAttribute("vars"):null;if(c!==this.fileVarsStr&&(this.fileVarsStr=c,this.fileVars=null,null!=c&&0<c.length))try{this.fileVars=JSON.parse(c)}catch(f){}};EditorUi.prototype.setFileData=function(c,f){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;f=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var k=Editor.extractParserError(f,mxResources.get("invalidOrMissingFile"));if(k)throw EditorUi.debug("EditorUi.setFileData ParserError",-[this],"data",[c],"node",[f],"cause",[k]),Error(mxResources.get("notADiagramFile")+" ("+k+")");c=null!=f?this.editor.extractGraphModel(f,!0):null;null!=c&&(f=c);if(null!=f&&"mxfile"==f.nodeName&&(c=f.getElementsByTagName("diagram"),k={},0<c.length)){var q=this.getHashObject(),x=null;this.fileNode=f;this.editor.graph.defaultExportLinkTarget=f.getAttribute("linkTarget");this.pages=[];for(var B=0;B<c.length;B++){null==c[B].getAttribute("id")&&c[B].setAttribute("id",B);f=new DiagramPage(c[B]);null==f.getName()&&-f.setName(mxResources.get("pageWithNumber",[B+1]));this.pages.push(f);if(null==q.pageId&&null!=urlParams["page-id"]&&f.getId()==urlParams["page-id"]||null!=q.pageId&&f.getId()==q.pageId)x=f;if(null==k[f.getId()])k[f.getId()]=f;else throw Error(f.getId()+": Duplicate page ID");}this.currentPage=null!=x?x:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];f=this.currentPage.node}null==this.fileNode&&null!=f&&(this.fileNode=f.ownerDocument.createElement("mxfile"),this.currentPage=-new DiagramPage(f.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(f);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var E=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(B=0;B<E.length;B++)f[E[B]]=!0;var L=this.editor.graph.getModel(),Q=L.getChildren(L.root);-for(B=0;B<Q.length;B++){var V=Q[B];L.setVisible(V,f[V.id]||!1)}}catch(K){}};EditorUi.prototype.fileStats=function(c,f){try{if(null!=c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var k=f.getElementsByTagName("diagram");f={};f.modified=c.getLastModifiedDate();f.fileMode=c.getMode();f.fileSize=c.getSize();f.fileHash=c.getHash();f.pages=k.length;f.redundantStencils=0;f.redundantImages=0;f.redundantSize=0;f.stencils=0;f.images=0;for(var q=f.cells=0;q<k.length;q++){var x=k[q].getElementsByTagName("mxCell");-f.cells+=x.length;for(var B={},E=0;E<x.length;E++){var L=x[E].getAttribute("style");if(null!=L)for(var Q=L.split(";"),V=0;V<Q.length;V++){var K=Q[V];if(K.startsWith("image=data:")||K.startsWith("shape=stencil("))null==B[K]?B[K]=1:B[K]++}}for(var fa in B){var aa=B[fa];fa.startsWith("shape=stencil(")?f.stencils+=aa:f.images+=aa;1<aa&&(f.redundantSize+=fa.length*(aa-1),fa.startsWith("shape=stencil(")?f.redundantStencils+=aa-1:f.redundantImages+=aa-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()++[this],"data",[c],"node",[f],"cause",[k]),Error(mxResources.get("notADiagramFile")+" ("+k+")");c=null!=f?this.editor.extractGraphModel(f,!0):null;null!=c&&(f=c);if(null!=f&&"mxfile"==f.nodeName&&(c=f.getElementsByTagName("diagram"),k={},0<c.length)){var q=this.getHashObject(),x=null;this.fileNode=f;this.editor.graph.defaultExportLinkTarget=f.getAttribute("linkTarget");this.pages=[];for(var C=0;C<c.length;C++){null==c[C].getAttribute("id")&&c[C].setAttribute("id",C);f=new DiagramPage(c[C]);null==f.getName()&&+f.setName(mxResources.get("pageWithNumber",[C+1]));this.pages.push(f);if(null==q.pageId&&null!=urlParams["page-id"]&&f.getId()==urlParams["page-id"]||null!=q.pageId&&f.getId()==q.pageId)x=f;if(null==k[f.getId()])k[f.getId()]=f;else throw Error(f.getId()+": Duplicate page ID");}this.currentPage=null!=x?x:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];f=this.currentPage.node}null==this.fileNode&&null!=f&&(this.fileNode=f.ownerDocument.createElement("mxfile"),this.currentPage=+new DiagramPage(f.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(f);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var E=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(C=0;C<E.length;C++)f[E[C]]=!0;var L=this.editor.graph.getModel(),Q=L.getChildren(L.root);+for(C=0;C<Q.length;C++){var V=Q[C];L.setVisible(V,f[V.id]||!1)}}catch(K){}};EditorUi.prototype.fileStats=function(c,f){try{if(null!=c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var k=f.getElementsByTagName("diagram");f={};f.modified=c.getLastModifiedDate();f.fileMode=c.getMode();f.fileSize=c.getSize();f.fileHash=c.getHash();f.pages=k.length;f.redundantStencils=0;f.redundantImages=0;f.redundantSize=0;f.stencils=0;f.images=0;for(var q=f.cells=0;q<k.length;q++){var x=k[q].getElementsByTagName("mxCell");+f.cells+=x.length;for(var C={},E=0;E<x.length;E++){var L=x[E].getAttribute("style");if(null!=L)for(var Q=L.split(";"),V=0;V<Q.length;V++){var K=Q[V];if(K.startsWith("image=data:")||K.startsWith("shape=stencil("))null==C[K]?C[K]=1:C[K]++}}for(var fa in C){var aa=C[fa];fa.startsWith("shape=stencil(")?f.stencils+=aa:f.images+=aa;1<aa&&(f.redundantSize+=fa.length*(aa-1),fa.startsWith("shape=stencil(")?f.redundantStencils+=aa-1:f.redundantImages+=aa-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()+"-FILE-STATS-"+c.getHash(),action:"size_"+c.getSize(),label:JSON.stringify(f)})}}catch(da){}};EditorUi.prototype.getBaseFilename=function(c){var f=this.getCurrentFile();f=null!=f&&null!=f.getTitle()?f.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(f)||/(\.html)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.png)$/i.test(f))f=f.substring(0,f.lastIndexOf("."));/(\.drawio)$/i.test(f)&&(f=f.substring(0,f.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&-0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba,ha,qa){try{q=null!=q?q:this.editor.graph.isSelectionEmpty();var ra=this.getBaseFilename(!x),l=ra+("xml"==c||"pdf"==c&&K?".drawio":"")+"."+c;if("xml"==c){var t=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,q,x,null,null,null,f);this.saveData(l,c,t,"text/xml")}else if("html"==c)t=this.getHtml2(this.getFileData(!0),this.editor.graph,-ra),this.saveData(l,c,t,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?l=ra+".png":"jpeg"==c&&(l=ra+".jpg"),"1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){var H=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(l,c,q,"1",E,x,L,Q,V,K,fa,void 0,void 0,!B,aa,da,ba,ha,qa).send(mxUtils.bind(this,function(Z){this.spinner.stop();+0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba,ha,qa){try{q=null!=q?q:this.editor.graph.isSelectionEmpty();var ra=this.getBaseFilename(!x),l=ra+("xml"==c||"pdf"==c&&K?".drawio":"")+"."+c;if("xml"==c){var t=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,q,x,null,null,null,f);this.saveData(l,c,t,"text/xml")}else if("html"==c)t=this.getHtml2(this.getFileData(!0),this.editor.graph,+ra),this.saveData(l,c,t,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?l=ra+".png":"jpeg"==c&&(l=ra+".jpg"),"1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){var H=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(l,c,q,"1",E,x,L,Q,V,K,fa,void 0,void 0,!C,aa,da,ba,ha,qa).send(mxUtils.bind(this,function(Z){this.spinner.stop();if(200<=Z.getStatus()&&299>=Z.getStatus()){var ia=this.createLoadMessage("export");ia.format=c;ia.filename=l;ia.data="data:application/pdf;base64,"+Z.getText();ia.xml=this.getFileData(!0);H.postMessage(JSON.stringify(ia),"*")}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(){this.spinner.stop();this.handleError({message:mxResources.get("errorSavingFile")})}))}else this.saveRequest(l,c,mxUtils.bind(this,function(Z,ia){try{return this.createDownloadRequest(Z,-c,q,ia,E,x,L,Q,V,K,fa,void 0,void 0,!B,aa,da,ba,ha,qa)}catch(ka){this.handleError(ka)}}));else{var J=null,R=mxUtils.bind(this,function(Z){Z.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",Z,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(J)}))});if("svg"==c){var T=this.editor.graph.background;if(E||T==mxConstants.NONE)T=null;var Y=this.editor.graph.getSvg(T,null,null,null,null,q);k&&this.editor.graph.addSvgShadow(Y);-this.editor.convertImages(Y,mxUtils.bind(this,mxUtils.bind(this,function(Z){this.spinner.stop();R(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(Z))})))}else l=ra+".svg",J=this.getFileData(!1,!0,null,mxUtils.bind(this,function(Z){this.spinner.stop();R(Z)}),q)}}catch(Z){this.handleError(Z)}};EditorUi.prototype.createDownloadRequest=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba,ha,qa,ra,l){c=this.downloadRequestBuilder(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba,ha,qa,ra,l);f="";for(var t in c)k=-c[t],null!=k&&(f+=t+"="+encodeURIComponent(k)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba,ha,qa,ra,l){var t=this.editor.graph,H=t.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==B?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var J=null,R=null,T=null;if(!EditorUi.isElectronApp&&(H.width*H.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};V=-V?"1":"0";"pdf"==f&&(null!=K?(J=K.from,R=K.to):0==B&&(T="1"));"xmlpng"==f&&(V="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(B=0;B<this.pages.length;B++)if(this.pages[B]==this.currentPage){J=B;break}B=t.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!x?x||null!=B&&B!=mxConstants.NONE||(B="#ffffff"):B=mxConstants.NONE;x={globalVars:t.getExportVariables()};null!=K&&null!=K.from&&(x.globalVars.pagenumber=K.from+1);Q&&(x.grid={size:t.gridSize,steps:t.view.gridSteps,color:Editor.isDarkMode()&&-"pdf"==f?mxGraphView.prototype.defaultGridColor:t.view.gridColor});Graph.translateDiagram&&(x.diagramLanguage=Graph.diagramLanguage);Q=this.getHiddenTagsMap();null!=Q&&(x.hiddenTags=Q);return{format:f,from:J,to:R,allPages:T,bg:null!=B?B:mxConstants.NONE,base64:q,embedXml:V,xml:k,filename:null!=c?c:"",extras:JSON.stringify(x),scale:E,border:L,pageMargin:ba,w:fa&&isFinite(fa)?fa:null,h:aa&&isFinite(aa)?aa:null,crop:null!=da&&da?"1":"0",fit:null!=ha&&ha?"1":"0",shadows:null!=l&&l?"1":"0",sheetsAcross:qa,-sheetsDown:ra}};EditorUi.prototype.getHiddenTagsMap=function(){var c=this.editor.graph,f={},k=!1;if(null!=this.pages)for(var q=0;q<this.pages.length;q++){var x=this.pages[q],B=x==this.currentPage?c.hiddenTags:null!=x.viewState?x.viewState.hiddenTags:null;null!=B&&0<B.length&&(f[x.getId()]=B,k=!0)}else null!=c.hiddenTags&&0<c.hiddenTags.length&&(f[0]=c.hiddenTags,k=!0);return k?f:null};EditorUi.prototype.setMode=function(c,f){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=window.location.hash;+c,q,ia,E,x,L,Q,V,K,fa,void 0,void 0,!C,aa,da,ba,ha,qa)}catch(ja){this.handleError(ja)}}));else{var J=null,R=mxUtils.bind(this,function(Z){Z.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",Z,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(J)}))});if("svg"==c){var T=this.editor.graph.background;if(E||T==mxConstants.NONE)T=null;var Y=this.editor.graph.getSvg(T,null,null,null,null,q);k&&this.editor.graph.addSvgShadow(Y);+this.editor.convertImages(Y,mxUtils.bind(this,mxUtils.bind(this,function(Z){this.spinner.stop();R(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(Z))})))}else l=ra+".svg",J=this.getFileData(!1,!0,null,mxUtils.bind(this,function(Z){this.spinner.stop();R(Z)}),q)}}catch(Z){this.handleError(Z)}};EditorUi.prototype.createDownloadRequest=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba,ha,qa,ra,l){c=this.downloadRequestBuilder(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba,ha,qa,ra,l);f="";for(var t in c)k=+c[t],null!=k&&(f+=t+"="+encodeURIComponent(k)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba,ha,qa,ra,l){var t=this.editor.graph,H=t.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==C?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var J=null,R=null,T=null;if(!EditorUi.isElectronApp&&(H.width*H.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};V=+V?"1":"0";"pdf"==f&&(null!=K?(J=K.from,R=K.to):0==C&&(T="1"));"xmlpng"==f&&(V="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(C=0;C<this.pages.length;C++)if(this.pages[C]==this.currentPage){J=C;break}C=t.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!x?x||null!=C&&C!=mxConstants.NONE||(C="#ffffff"):C=mxConstants.NONE;x={globalVars:t.getExportVariables()};null!=K&&null!=K.from&&(x.globalVars.pagenumber=K.from+1);Q&&(x.grid={size:t.gridSize,steps:t.view.gridSteps,color:Editor.isDarkMode()&&+"pdf"==f?mxGraphView.prototype.defaultGridColor:t.view.gridColor});Graph.translateDiagram&&(x.diagramLanguage=Graph.diagramLanguage);Q=this.getHiddenTagsMap();null!=Q&&(x.hiddenTags=Q);return{format:f,from:J,to:R,allPages:T,bg:null!=C?C:mxConstants.NONE,base64:q,embedXml:V,xml:k,filename:null!=c?c:"",extras:JSON.stringify(x),scale:E,border:L,pageMargin:ba,w:fa&&isFinite(fa)?fa:null,h:aa&&isFinite(aa)?aa:null,crop:null!=da&&da?"1":"0",fit:null!=ha&&ha?"1":"0",shadows:null!=l&&l?"1":"0",sheetsAcross:qa,+sheetsDown:ra}};EditorUi.prototype.getHiddenTagsMap=function(){var c=this.editor.graph,f={},k=!1;if(null!=this.pages)for(var q=0;q<this.pages.length;q++){var x=this.pages[q],C=x==this.currentPage?c.hiddenTags:null!=x.viewState?x.viewState.hiddenTags:null;null!=C&&0<C.length&&(f[x.getId()]=C,k=!0)}else null!=c.hiddenTags&&0<c.hiddenTags.length&&(f[0]=c.hiddenTags,k=!0);return k?f:null};EditorUi.prototype.setMode=function(c,f){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=window.location.hash;null!=c&&0<c.length&&(c=c.substring(1));if(null!=c&&1<c.length){var f=c.indexOf("#");0<=f&&(c=c.substring(0,f))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,f={};if(null!=c&&0<c.length){var k=c.lastIndexOf("#");if(0<k){c=decodeURIComponent(c.substring(k+1));try{f=JSON.parse(c)}catch(q){}}}return f};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var c=this.getHashObject();c.pageId=this.currentPage.getId();this.setHashObject(c)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(c){if(Editor.enableHashObjects){var f=window.location.hash;if(null==f||""==f)f="#";var k=f.lastIndexOf("#");0<k&&(f=f.substring(0,k));try{null==c||mxUtils.isEmptyObject(c)||(f=f+"#"+encodeURIComponent(JSON.stringify(c)))}catch(q){}0<k&&0<f.lastIndexOf("#")?window.location.hash=f:window.location.replace(f)}};EditorUi.prototype.loadDescriptor=function(c,f,k){var q=window.location.hash,x=mxUtils.bind(this,function(E){var L=null!=c.data?c.data:"";null!=E&&0<E.length&&(0<L.length&&(L+="\n"),L+=E);E=new LocalFile(this,"csv"!=c.format&&0<L.length?L:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);E.getHash=function(){return q};this.fileLoaded(E);"csv"==c.format&&this.importCsv(L,mxUtils.bind(this,function(aa){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var Q=null!=c.interval?parseInt(c.interval):6E4,V=null,K=mxUtils.bind(this,function(){var aa=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(da){aa===this.currentPage&&(200<=da.getStatus()&&300>=da.getStatus()?(this.updateDiagram(da.getText()),fa()):this.handleError({message:mxResources.get("error")+" "+da.getStatus()}))}),mxUtils.bind(this,function(da){this.handleError(da)}))}),fa=mxUtils.bind(this,function(){window.clearTimeout(V);-V=window.setTimeout(K,Q)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){fa();K()}));fa();K()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var B=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(B,mxUtils.bind(this,function(E){x(E)}),mxUtils.bind(this,function(E){null!=k&&k(E)}))}else x("")};EditorUi.prototype.updateDiagram=function(c){function f(t){var H=new mxCellOverlay(t.image||x.warningImage,t.tooltip,t.align,t.valign,t.offset);H.addListener(mxEvent.CLICK,function(J,-R){q.alert(t.tooltip)});return H}var k=null,q=this;if(null!=c&&0<c.length&&(k=mxUtils.parseXml(c),c=null!=k?k.documentElement:null,null!=c&&"updates"==c.nodeName)){var x=this.editor.graph,B=x.getModel();B.beginUpdate();var E=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var L=B.getCell(c.getAttribute("id"));if(null!=L){try{var Q=c.getAttribute("value");if(null!=Q){var V=mxUtils.parseXml(Q).documentElement;if(null!=V)if("1"==V.getAttribute("replace-value"))B.setValue(L,V);else for(var K=+V=window.setTimeout(K,Q)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){fa();K()}));fa();K()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var C=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(C,mxUtils.bind(this,function(E){x(E)}),mxUtils.bind(this,function(E){null!=k&&k(E)}))}else x("")};EditorUi.prototype.updateDiagram=function(c){function f(t){var H=new mxCellOverlay(t.image||x.warningImage,t.tooltip,t.align,t.valign,t.offset);H.addListener(mxEvent.CLICK,function(J,+R){q.alert(t.tooltip)});return H}var k=null,q=this;if(null!=c&&0<c.length&&(k=mxUtils.parseXml(c),c=null!=k?k.documentElement:null,null!=c&&"updates"==c.nodeName)){var x=this.editor.graph,C=x.getModel();C.beginUpdate();var E=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var L=C.getCell(c.getAttribute("id"));if(null!=L){try{var Q=c.getAttribute("value");if(null!=Q){var V=mxUtils.parseXml(Q).documentElement;if(null!=V)if("1"==V.getAttribute("replace-value"))C.setValue(L,V);else for(var K=V.attributes,fa=0;fa<K.length;fa++)x.setAttributeForCell(L,K[fa].nodeName,0<K[fa].nodeValue.length?K[fa].nodeValue:null)}}catch(t){null!=window.console&&console.log("Error in value for "+L.id+": "+t)}try{var aa=c.getAttribute("style");null!=aa&&x.model.setStyle(L,aa)}catch(t){null!=window.console&&console.log("Error in style for "+L.id+": "+t)}try{var da=c.getAttribute("icon");if(null!=da){var ba=0<da.length?JSON.parse(da):null;null!=ba&&ba.append||x.removeCellOverlays(L);null!=ba&&x.addCellOverlay(L,f(ba))}}catch(t){null!=window.console&&console.log("Error in icon for "+L.id+": "+t)}try{var ha=c.getAttribute("geometry");if(null!=ha){ha=JSON.parse(ha);var qa=x.getCellGeometry(L);if(null!=qa){qa=qa.clone();for(key in ha){var ra=parseFloat(ha[key]);"dx"==key?qa.x+=ra:"dy"==key?qa.y+=ra:"dw"==key?qa.width+=ra:"dh"==key?qa.height+=ra:qa[key]=parseFloat(ha[key])}x.model.setGeometry(L,qa)}}}catch(t){null!=window.console&&console.log("Error in icon for "+L.id+": "+t)}}}else if("model"==c.nodeName){for(var l=-c.firstChild;null!=l&&l.nodeType!=mxConstants.NODETYPE_ELEMENT;)l=l.nextSibling;null!=l&&(new mxCodec(c.firstChild)).decode(l,B)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(x.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))x.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(E=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{B.endUpdate()}null!=-E&&this.chromelessResize&&this.chromelessResize(!0,E)}return k};EditorUi.prototype.getCopyFilename=function(c,f){var k=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var q=k.lastIndexOf(".");0<=q&&(c=k.substring(q),k=k.substring(0,q));if(f){f=k;var x=new Date;k=x.getFullYear();q=x.getMonth()+1;var B=x.getDate(),E=x.getHours(),L=x.getMinutes();x=x.getSeconds();k=f+(" "+(k+"-"+q+"-"+B+"-"+E+"-"+L+"-"+x))}return k=mxResources.get("copyOf",[k])+c};EditorUi.prototype.logIfModified=-function(c,f){try{null!=c&&f&&EditorUi.debug("File.closed",[c])}catch(k){}};EditorUi.prototype.fileLoaded=function(c,f,k){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[c],"noDialogs",[f]);var q=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var x=!1;this.hideDialog();null!=q&&(q.removeListener(this.descriptorChangedListener),this.logIfModified(q,!0),q.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var B=mxUtils.bind(this,+c.firstChild;null!=l&&l.nodeType!=mxConstants.NODETYPE_ELEMENT;)l=l.nextSibling;null!=l&&(new mxCodec(c.firstChild)).decode(l,C)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(x.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))x.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(E=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{C.endUpdate()}null!=+E&&this.chromelessResize&&this.chromelessResize(!0,E)}return k};EditorUi.prototype.getCopyFilename=function(c,f){var k=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var q=k.lastIndexOf(".");0<=q&&(c=k.substring(q),k=k.substring(0,q));if(f){f=k;var x=new Date;k=x.getFullYear();q=x.getMonth()+1;var C=x.getDate(),E=x.getHours(),L=x.getMinutes();x=x.getSeconds();k=f+(" "+(k+"-"+q+"-"+C+"-"+E+"-"+L+"-"+x))}return k=mxResources.get("copyOf",[k])+c};EditorUi.prototype.logIfModified=+function(c,f){try{null!=c&&f&&EditorUi.debug("File.closed",[c])}catch(k){}};EditorUi.prototype.fileLoaded=function(c,f,k){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[c],"noDialogs",[f]);var q=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var x=!1;this.hideDialog();null!=q&&(q.removeListener(this.descriptorChangedListener),this.logIfModified(q,!0),q.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var C=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=q&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!f&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fname.innerText="");this.clearStatus();this.updateUi();if(!f)if("0"!=urlParams.splash)this.showSplash();else try{this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}catch(fa){this.handleError(fa)}});if(null!=c)try{this.openingFile=!0;this.setCurrentFile(c);c.addListener("descriptorChanged",this.descriptorChangedListener);c.addListener("contentChanged",this.descriptorChangedListener);c.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(c.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();c.isEditable()?c.isModified()?c.addUnsavedStatus():this.clearStatus():this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus('<div class="geStatusBox" title="'+mxUtils.htmlEntities(mxResources.get("readOnly"))+'">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</div>")}));!this.editor.isChromelessView()||this.editor.editable?(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers(),this.restoreLibraries(),window.self===window.top||this.noAutoFocus||window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=-k&&k();this.editor.fireEvent(new mxEventObject("fileLoaded"));x=!0;if(Editor.embedSvgFonts&&/(\.svg)$/i.test(c.getTitle()))try{this.editor.loadFonts(),this.editor.embedExtFonts(function(){})}catch(fa){}if(!this.isOffline()&&null!=c.getMode()){var E="1"==urlParams.sketch?"sketch":uiTheme;if(null==E)E="default";else if("sketch"==E||"min"==E)E+=Editor.isDarkMode()?"-dark":"-light";EditorUi.logEvent({category:c.getMode().toUpperCase()+"-OPEN-FILE-"+c.getHash(),action:"size_"+c.getSize(),label:"autosave_"+-(this.editor.autosave?"on":"off")+"_theme_"+E})}EditorUi.debug("File.opened",[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(fa){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(fa){}}catch(fa){this.fileLoadedError=fa;k=null;var L=this.defaultFilename;-if(null!=c){try{k=c.getData(),L=c.getTitle()||this.defaultFilename}catch(aa){}try{c.close()}catch(aa){}}var Q=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=q?this.fileLoaded(q)||B():B()});if(f)Q();else{fa.dialogWidth=350;var V=mxUtils.bind(this,function(){this.handleError(fa,mxResources.get("errorLoadingFile"),Q,!0,null,null,!0)});if(null!=fa.fallbackFileData)fa.alternateAction=+k&&k();this.editor.fireEvent(new mxEventObject("fileLoaded"));x=!0;if(/(\.svg)$/i.test(c.getTitle())&&this.getSvgFileProperties(this.fileNode).embedFonts)try{this.editor.loadFonts(),this.editor.embedExtFonts(function(){})}catch(fa){}if(!this.isOffline()&&null!=c.getMode()){var E="1"==urlParams.sketch?"sketch":uiTheme;if(null==E)E="default";else if("sketch"==E||"min"==E)E+=Editor.isDarkMode()?"-dark":"-light";EditorUi.logEvent({category:c.getMode().toUpperCase()+"-OPEN-FILE-"+c.getHash(),action:"size_"++c.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")+"_theme_"+E})}EditorUi.debug("File.opened",[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(fa){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(fa){}}catch(fa){this.fileLoadedError=fa;k=null;+var L=this.defaultFilename;if(null!=c){try{k=c.getData(),L=c.getTitle()||this.defaultFilename}catch(aa){}try{c.close()}catch(aa){}}var Q=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=q?this.fileLoaded(q)||C():C()});if(f)Q();else{fa.dialogWidth=350;var V=mxUtils.bind(this,function(){this.handleError(fa,mxResources.get("errorLoadingFile"),Q,!0,null,null,!0)});if(null!=fa.fallbackFileData)fa.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var aa=new LocalFile(this,fa.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(aa)})},V();else{var K=this.spinner.spin(document.body,mxResources.get("loading"));this.getRecoveryData(c,k,fa,mxUtils.bind(this,function(aa){K&&this.spinner.stop();if(null!=aa&&1==aa.length){var da=aa[0];fa.alternateAction={label:da.label,funct:mxUtils.bind(this,function(){this.hideDialog();da.lossy?this.confirm(mxResources.get("recoveryWarning"),-mxUtils.bind(this,function(){this.openRecoveredCopy(da,L)})):this.openRecoveredCopy(da,L)})}}else null!=aa&&1<aa.length&&(fa.alternateAction={label:mxResources.get("recover"),funct:mxUtils.bind(this,function(){this.hideDialog();this.showRecoveryDialog(aa,L)})});V()}))}}}else B();return x};EditorUi.prototype.getHashValueForPages=function(c,f){var k=0,q=new mxGraphModel,x=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var B=0;B<c.length;B++)if(null!=c[B]){this.updatePageRoot(c[B]);-var E=c[B].node.ownerDocument.createElement("diagram");E.setAttribute("id",c[B].getId());q.root=c[B].root;var L=x.encode(q);this.editor.graph.saveViewState(c[B].viewState,L,!0);L.removeAttribute("pageWidth");L.removeAttribute("pageHeight");E.appendChild(L);null!=f&&(f.eltCount+=E.getElementsByTagName("*").length,f.nodeCount+=E.getElementsByTagName("mxCell").length);k=(k<<5)-k+this.hashValue(E,function(Q,V,K,fa){return!fa||"mxGeometry"!=Q.nodeName&&"mxPoint"!=Q.nodeName||"x"!=V&&"y"!=V&&"width"!=V&&-"height"!=V?fa&&"mxCell"==Q.nodeName&&"previous"==V?null:K:Math.round(K)},f)<<0}return k};EditorUi.prototype.hashValue=function(c,f,k){var q=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(q^=this.hashValue(c.nodeName,f,k));if(null!=c.attributes){null!=k&&(k.attrCount+=c.attributes.length);for(var x=0;x<c.attributes.length;x++){var B=c.attributes[x].name,E=null!=f?f(c,B,c.attributes[x].value,!0):-c.attributes[x].value;null!=E&&(q^=this.hashValue(B,f,k)+this.hashValue(E,f,k))}}if(null!=c.childNodes)for(x=0;x<c.childNodes.length;x++)q=(q<<5)-q+this.hashValue(c.childNodes[x],f,k)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);f=0;null!=k&&(k.byteCount+=c.length);for(x=0;x<c.length;x++)f=(f<<5)-f+c.charCodeAt(x)<<0;q^=f}return q};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,k,q,x,B,E){};EditorUi.prototype.isScratchpadEnabled=+mxUtils.bind(this,function(){this.openRecoveredCopy(da,L)})):this.openRecoveredCopy(da,L)})}}else null!=aa&&1<aa.length&&(fa.alternateAction={label:mxResources.get("recover"),funct:mxUtils.bind(this,function(){this.hideDialog();this.showRecoveryDialog(aa,L)})});V()}))}}}else C();return x};EditorUi.prototype.getHashValueForPages=function(c,f){var k=0,q=new mxGraphModel,x=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var C=0;C<c.length;C++)if(null!=c[C]){this.updatePageRoot(c[C]);+var E=c[C].node.ownerDocument.createElement("diagram");E.setAttribute("id",c[C].getId());q.root=c[C].root;var L=x.encode(q);this.editor.graph.saveViewState(c[C].viewState,L,!0);L.removeAttribute("pageWidth");L.removeAttribute("pageHeight");E.appendChild(L);null!=f&&(f.eltCount+=E.getElementsByTagName("*").length,f.nodeCount+=E.getElementsByTagName("mxCell").length);k=(k<<5)-k+this.hashValue(E,function(Q,V,K,fa){return!fa||"mxGeometry"!=Q.nodeName&&"mxPoint"!=Q.nodeName||"x"!=V&&"y"!=V&&"width"!=V&&+"height"!=V?fa&&"mxCell"==Q.nodeName&&"previous"==V?null:K:Math.round(K)},f)<<0}return k};EditorUi.prototype.hashValue=function(c,f,k){var q=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(q^=this.hashValue(c.nodeName,f,k));if(null!=c.attributes){null!=k&&(k.attrCount+=c.attributes.length);for(var x=0;x<c.attributes.length;x++){var C=c.attributes[x].name,E=null!=f?f(c,C,c.attributes[x].value,!0):+c.attributes[x].value;null!=E&&(q^=this.hashValue(C,f,k)+this.hashValue(E,f,k))}}if(null!=c.childNodes)for(x=0;x<c.childNodes.length;x++)q=(q<<5)-q+this.hashValue(c.childNodes[x],f,k)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);f=0;null!=k&&(k.byteCount+=c.length);for(x=0;x<c.length;x++)f=(f<<5)-f+c.charCodeAt(x)<<0;q^=f}return q};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,k,q,x,C,E){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(c){if(null==c||"<mxfile"==c.substring(0,7))c=this.emptyLibraryXml;this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var f=0;f<c.length;f++)null!=c[f].xml&&"<"!=c[f].xml.charAt(0)&&(c[f].xml=mxUtils.trim(Graph.decompress(c[f].xml)));f=mxUtils.createXmlDocument();var k=f.createElement("mxlibrary");mxUtils.setTextContent(k,JSON.stringify(c,null,2));f.appendChild(k);return mxUtils.getXml(f,"\n")};EditorUi.prototype.closeLibrary=function(c){null!=c&&(this.removeLibrarySidebar(c.getHash()),c.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(c.getHash()),".scratchpad"==c.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(c){var f=this.sidebar.palettes[c];if(null!=f){for(var k=0;k<f.length;k++)this.sidebar.unobserveElements(f[k]),f[k].parentNode.removeChild(f[k]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=function(c,f){var k=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!f){null==c&&(f=this.sidebar.palettes["L.scratchpad"],null==f&&(f=this.sidebar.palettes.search),null!=f&&(c=f[f.length-1].nextSibling));c=null!=c?c:k.firstChild.nextSibling.nextSibling;f=k.lastChild;var q=f.previousSibling;k.insertBefore(f,c);k.insertBefore(q,f)}};EditorUi.prototype.loadLibrary=function(c,f){var k=mxUtils.parseXml(c.getData());if("mxlibrary"==k.documentElement.nodeName){var q=JSON.parse(mxUtils.getTextContent(k.documentElement));this.libraryLoaded(c,q,k.documentElement.getAttribute("title"),f,k.documentElement.getAttribute("tags"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(c){return""};EditorUi.prototype.showSidebar=-function(){null!=this.sidebarWindow?this.sidebarWindow.window.setVisible(!0):this.toggleShapesPanel(!0)};EditorUi.prototype.showSearchWindow=function(c,f){var k=c?"findReplace":"find",q=k+"Window";if(null==this[q]){var x="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,B=mxSettings.getWindowState(k),E=null!=B&&null!=B.w?B.w:c?x?330:300:240;this[q]=new FindWindow(this,null!=B&&null!=B.x?B.x:document.body.offsetWidth-(E+20),null!=B&&null!=B.y?B.y:100,E,null!=-B&&null!=B.h?B.h:c?x?304:288:180,c);this[q].window.addListener("show",function(){this.fireEvent(new mxEventObject(k))});this[q].window.addListener("hide",function(){this.fireEvent(new mxEventObject(k))});this.installWindowPersistence(k,this[q]);null!=B&&null==f&&this.restoreWindowState(k,this[q]);this[q].window.setVisible(!0)}else null==f&&this[q].window.setVisible(!this[q].window.isVisible());null!=f&&(this[q].doSearch(f),this[q].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,-f,k,q,x){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var B=null;if(c.constructor!=StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var E=0;E<this.openLibraries.length;E++)if(this.openLibraries[E].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[E],this.openLibraries);break}B={file:c,images:f,title:k,expand:q};this.openLibraries.push(B)}else this.scratchpad=c;E=this.sidebar.palettes[c.getHash()];+function(){null!=this.sidebarWindow?this.sidebarWindow.window.setVisible(!0):this.toggleShapesPanel(!0)};EditorUi.prototype.showSearchWindow=function(c,f){var k=c?"findReplace":"find",q=k+"Window";if(null==this[q]){var x="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,C=mxSettings.getWindowState(k),E=null!=C&&null!=C.w?C.w:c?x?330:300:240;this[q]=new FindWindow(this,null!=C&&null!=C.x?C.x:document.body.offsetWidth-(E+20),null!=C&&null!=C.y?C.y:100,E,null!=+C&&null!=C.h?C.h:c?x?304:288:180,c);this[q].window.addListener("show",function(){this.fireEvent(new mxEventObject(k))});this[q].window.addListener("hide",function(){this.fireEvent(new mxEventObject(k))});this.installWindowPersistence(k,this[q]);null!=C&&null==f&&this.restoreWindowState(k,this[q]);this[q].window.setVisible(!0)}else null==f&&this[q].window.setVisible(!this[q].window.isVisible());null!=f&&(this[q].doSearch(f),this[q].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,+f,k,q,x){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var C=null;if(c.constructor!=StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var E=0;E<this.openLibraries.length;E++)if(this.openLibraries[E].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[E],this.openLibraries);break}C={file:c,images:f,title:k,expand:q};this.openLibraries.push(C)}else this.scratchpad=c;E=this.sidebar.palettes[c.getHash()];E=null!=E?E[E.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var L=null,Q=mxUtils.bind(this,function(l,t){0==l.length&&c.isEditable()?(null==L&&(L=document.createElement("div"),L.className="geDropTarget",l=mxResources.get("dragElementsHere"),mxUtils.write(L,l),L.setAttribute("title",l)),t.appendChild(L)):this.addLibraryEntries(l,t)});null!=this.sidebar&&null!=f&&(this.sidebar.setCurrentSearchEntryLibrary(c.getHash(),c.getHash()),this.sidebar.addEntries(f,x),this.sidebar.setCurrentSearchEntryLibrary());-null==k&&(k=c.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));var V=this.sidebar.addPalette(c.getHash(),k,null!=q?q:!0,mxUtils.bind(this,function(l){Q(f,l)}),!0);null!=B&&(B.div=V);this.repositionLibrary(E,"L.scratchpad"!=c.getHash());q=V.parentNode.previousSibling;k=q.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=c.title&&q.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+k);var K=document.createElement("div");K.style.backgroundColor="inherit";q.style.position=-"relative";var fa=document.createElement("img");fa.className="geLibraryButton";fa.setAttribute("src",Editor.crossImage);fa.setAttribute("title",mxResources.get("close"));var aa=null;if(".scratchpad"!=c.title||this.closableScratchpad)K.appendChild(fa),mxEvent.addListener(fa,"click",mxUtils.bind(this,function(l){if(!mxEvent.isConsumed(l)){var t=mxUtils.bind(this,function(){null!=B&&mxUtils.remove(B,this.openLibraries);this.closeLibrary(c)});null!=aa?this.confirm(mxResources.get("allChangesLost"),null,+null==k&&(k=c.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));var V=this.sidebar.addPalette(c.getHash(),k,null!=q?q:!0,mxUtils.bind(this,function(l){Q(f,l)}),!0);null!=C&&(C.div=V);this.repositionLibrary(E,"L.scratchpad"!=c.getHash());q=V.parentNode.previousSibling;k=q.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=c.title&&q.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+k);var K=document.createElement("div");K.style.backgroundColor="inherit";q.style.position=+"relative";var fa=document.createElement("img");fa.className="geLibraryButton";fa.setAttribute("src",Editor.crossImage);fa.setAttribute("title",mxResources.get("close"));var aa=null;if(".scratchpad"!=c.title||this.closableScratchpad)K.appendChild(fa),mxEvent.addListener(fa,"click",mxUtils.bind(this,function(l){if(!mxEvent.isConsumed(l)){var t=mxUtils.bind(this,function(){null!=C&&mxUtils.remove(C,this.openLibraries);this.closeLibrary(c)});null!=aa?this.confirm(mxResources.get("allChangesLost"),null,t,mxResources.get("cancel"),mxResources.get("discardChanges")):t();mxEvent.consume(l)}}));if(c.isEditable()){var da=this.editor.graph,ba=null;k=mxUtils.bind(this,function(l){this.showLibraryDialog(c.getTitle(),V,f,c,c.getMode());mxEvent.consume(l)});var ha=mxUtils.bind(this,function(l){c.setModified(!0);c.isAutosave()?(null!=ba&&null!=ba.parentNode&&ba.parentNode.removeChild(ba),ba=fa.cloneNode(!1),ba.setAttribute("src",Editor.spinImage),ba.setAttribute("title",mxResources.get("saving")),ba.style.cursor="default",ba.style.marginRight="2px",ba.style.marginTop="-2px",K.insertBefore(ba,K.firstChild),this.saveLibrary(c.getTitle(),f,c,c.getMode(),!0,!0,function(){null!=ba&&null!=ba.parentNode&&ba.parentNode.removeChild(ba)})):null==aa&&(aa=fa.cloneNode(!1),aa.setAttribute("src",Editor.saveImage),aa.setAttribute("title",mxResources.get("save")),K.insertBefore(aa,K.firstChild),mxEvent.addListener(aa,"click",mxUtils.bind(this,function(t){this.saveLibrary(c.getTitle(),f,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==aa||c.isModified()||(aa.parentNode.removeChild(aa),aa=null)});mxEvent.consume(t)})))}),qa=mxUtils.bind(this,function(l,t,H,J){l=da.cloneCells(mxUtils.sortCells(da.model.getTopmostCells(l)));for(var R=0;R<l.length;R++){var T=da.getCellGeometry(l[R]);null!=T&&T.translate(-t.x,-t.y)}V.appendChild(this.sidebar.createVertexTemplateFromCells(l,t.width,t.height,J||"",!0,null,!1));l=mxUtils.getXml(this.editor.graph.encodeCells(l));Editor.defaultCompressed&&(l=Graph.compress(l));t={xml:l,@@ -4068,110 +4071,110 @@ w:t.width,h:t.height};null!=J&&(t.title=J);f.push(t);ha(H);null!=L&&null!=L.pareH=da.view.getBounds(t);if(null!=H&&0<H.width&&0<H.height){var J=da.view.scale;H.x/=J;H.y/=J;H.width/=J;H.height/=J;H.x-=da.view.translate.x;H.y-=da.view.translate.y;qa(t,H)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(l)});mxEvent.addGestureListeners(V,function(){},mxUtils.bind(this,function(l){da.isMouseDown&&null!=da.panningManager&&null!=da.graphHandler.first&&(da.graphHandler.suspend(),null!=da.graphHandler.hint&&(da.graphHandler.hint.style.visibility="hidden"),V.style.backgroundColor="light-dark(#fefefe, #000000)",V.style.cursor="copy",da.panningManager.stop(),da.autoScroll=!1,mxEvent.consume(l))}),mxUtils.bind(this,function(l){da.isMouseDown&&null!=da.panningManager&&null!=da.graphHandler&&(V.style.backgroundColor="",V.style.cursor="default",this.sidebar.showTooltips=!0,da.panningManager.stop(),da.graphHandler.reset(),da.isMouseDown=!1,da.autoScroll=!0,ra(l),mxEvent.consume(l))}));mxEvent.addListener(V,"mouseleave",mxUtils.bind(this,function(l){da.isMouseDown&&null!=da.graphHandler.first&&(da.graphHandler.resume(),null!=da.graphHandler.hint&&(da.graphHandler.hint.style.visibility="visible"),V.style.backgroundColor="",V.style.cursor="",da.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(V,"dragover",mxUtils.bind(this,function(l){V.style.backgroundColor="light-dark(#fefefe, #000000)";l.dataTransfer.dropEffect="copy";V.style.cursor="copy";this.sidebar.hideTooltip();l.stopPropagation();l.preventDefault()})),mxEvent.addListener(V,"drop",mxUtils.bind(this,-function(l){V.style.cursor="";V.style.backgroundColor="";0<l.dataTransfer.files.length&&this.importFiles(l.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(t,H,J,R,T,Y,Z,ia,ka){if(null!=t&&"image/"==H.substring(0,6))t="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(t),t=[new mxCell("",new mxGeometry(0,0,T,Y),t)],t[0].vertex=!0,qa(t,new mxRectangle(0,0,T,Y),l,mxEvent.isAltDown(l)?null:Z.substring(0,Z.lastIndexOf(".")).replace(/_/g,-" ")),null!=L&&null!=L.parentNode&&0<f.length&&(L.parentNode.removeChild(L),L=null);else{var X=!1,ja=mxUtils.bind(this,function(na,la){null!=na&&"application/pdf"==la&&(la=Editor.extractGraphModelFromPdf(na),null!=la&&0<la.length&&(na=la));if(null!=na)if(na=mxUtils.parseXml(na),"mxlibrary"==na.documentElement.nodeName)try{var va=JSON.parse(mxUtils.getTextContent(na.documentElement));Q(va,V);f=f.concat(va);ha(l);this.spinner.stop();X=!0}catch(Ca){}else if("mxfile"==na.documentElement.nodeName)try{var za=-na.documentElement.getElementsByTagName("diagram");for(va=0;va<za.length;va++){var sa=this.stringToCells(Editor.getDiagramNodeXml(za[va])),wa=this.editor.graph.getBoundingBoxFromGeometry(sa);null!=wa&&qa(sa,new mxRectangle(0,0,wa.width,wa.height),l)}X=!0}catch(Ca){null!=window.console&&console.log("error in drop handler:",Ca)}X||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=L&&null!=L.parentNode&&0<f.length&&(L.parentNode.removeChild(L),L=null)});null!=-ka&&null!=Z&&EditorUi.isVisioFilename(Z)?this.importVisio(ka,function(na){ja(na,"text/xml")},null,Z):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(t,Z)&&null!=ka?this.isExternalDataComms()?this.parseFile(ka,mxUtils.bind(this,function(na){4==na.readyState&&(this.spinner.stop(),200<=na.status&&299>=na.status?ja(na.responseText,"text/xml"):this.handleError({message:mxResources.get(413==na.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),-this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):ja(t,H)}}));l.stopPropagation();l.preventDefault()})),mxEvent.addListener(V,"dragleave",function(l){V.style.cursor="";V.style.backgroundColor="";l.stopPropagation();l.preventDefault()}));fa=fa.cloneNode(!1);fa.setAttribute("src",Editor.editImage);fa.setAttribute("title",mxResources.get("edit"));K.insertBefore(fa,K.firstChild);mxEvent.addListener(fa,"click",k);k=fa.cloneNode(!1);k.setAttribute("src",Editor.plusImage);k.setAttribute("title",+function(l){V.style.cursor="";V.style.backgroundColor="";0<l.dataTransfer.files.length&&this.importFiles(l.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(t,H,J,R,T,Y,Z,ia,ja){if(null!=t&&"image/"==H.substring(0,6))t="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(t),t=[new mxCell("",new mxGeometry(0,0,T,Y),t)],t[0].vertex=!0,qa(t,new mxRectangle(0,0,T,Y),l,mxEvent.isAltDown(l)?null:Z.substring(0,Z.lastIndexOf(".")).replace(/_/g,+" ")),null!=L&&null!=L.parentNode&&0<f.length&&(L.parentNode.removeChild(L),L=null);else{var X=!1,ka=mxUtils.bind(this,function(na,la){null!=na&&"application/pdf"==la&&(la=Editor.extractGraphModelFromPdf(na),null!=la&&0<la.length&&(na=la));if(null!=na)if(na=mxUtils.parseXml(na),"mxlibrary"==na.documentElement.nodeName)try{var ua=JSON.parse(mxUtils.getTextContent(na.documentElement));Q(ua,V);f=f.concat(ua);ha(l);this.spinner.stop();X=!0}catch(Ca){}else if("mxfile"==na.documentElement.nodeName)try{var za=+na.documentElement.getElementsByTagName("diagram");for(ua=0;ua<za.length;ua++){var sa=this.stringToCells(Editor.getDiagramNodeXml(za[ua])),wa=this.editor.graph.getBoundingBoxFromGeometry(sa);null!=wa&&qa(sa,new mxRectangle(0,0,wa.width,wa.height),l)}X=!0}catch(Ca){null!=window.console&&console.log("error in drop handler:",Ca)}X||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=L&&null!=L.parentNode&&0<f.length&&(L.parentNode.removeChild(L),L=null)});null!=+ja&&null!=Z&&EditorUi.isVisioFilename(Z)?this.importVisio(ja,function(na){ka(na,"text/xml")},null,Z):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(t,Z)&&null!=ja?this.isExternalDataComms()?this.parseFile(ja,mxUtils.bind(this,function(na){4==na.readyState&&(this.spinner.stop(),200<=na.status&&299>=na.status?ka(na.responseText,"text/xml"):this.handleError({message:mxResources.get(413==na.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),+this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):ka(t,H)}}));l.stopPropagation();l.preventDefault()})),mxEvent.addListener(V,"dragleave",function(l){V.style.cursor="";V.style.backgroundColor="";l.stopPropagation();l.preventDefault()}));fa=fa.cloneNode(!1);fa.setAttribute("src",Editor.editImage);fa.setAttribute("title",mxResources.get("edit"));K.insertBefore(fa,K.firstChild);mxEvent.addListener(fa,"click",k);k=fa.cloneNode(!1);k.setAttribute("src",Editor.plusImage);k.setAttribute("title",mxResources.get("add"));K.insertBefore(k,K.firstChild);mxEvent.addListener(k,"click",ra);".scratchpad"==c.title&&(this.addSelectionToScratchpad=ra);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(k=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),k.className="geLibraryButton",K.insertBefore(k,K.firstChild))}q.appendChild(K);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,f){for(var k=0;k<c.length;k++)try{var q=-c[k],x=q.data;if(null!=x){x="data:"==x.substring(0,5)?this.convertDataUri(x):x;var B="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==q.aspect&&(B+="aspect=fixed;");B=B+"image="+x+";";null!=q.style&&(B+=q.style);f.appendChild(this.sidebar.createVertexTemplate(B,q.w,q.h,"",q.title||"",!1,null,!0))}else if(null!=q.xml){var E=this.stringToCells("<"==q.xml.charAt(0)?q.xml:Graph.decompress(q.xml)),L=0==E.length?mxResources.get("drawingEmpty"):null!=q.title?q.title:"";-f.appendChild(this.sidebar.createVertexTemplateFromCells(E,q.w,q.h,L,!0,null,!0))}}catch(Q){L=null!=Q.message?mxResources.get("error")+": "+Q.message:String(Q),B=this.sidebar.createVertexTemplateFromCells(null,q.w,q.h,L,!0,null,!0),f.appendChild(B)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||-(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,f,k,q,x,B,E){c=new ImageDialog(this,c,f,k,q,x,B,E);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,k,q,x,B){var E=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=E?JSON.stringify(JSON.parse(E),null,2):"",mxUtils.bind(this,function(L){if(null!=-L)try{if(null!=B&&B(L),L==E)this.hideDialog();else{if(0<L.length){var Q=JSON.parse(L);localStorage.setItem(f,JSON.stringify(Q))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(V){this.handleError(V)}}),null,mxResources.get("close"),null,null,null,!0,null,null,x,k,q);this.showDialog(c.container,660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=k&&2<k.length?500:440,280));c.init()};EditorUi.prototype.showConfigurationEditorDialog=-function(c,f,k,q){function x(Z){da?Q.confirm(mxResources.get("allChangesLost"),null,Z,mxResources.get("cancel"),mxResources.get("discardChanges")):Z()}function B(){ba=!0;Q.hideDialog()}function E(Z,ia){var ka=document.createElement("div");ka.style.padding="4px 16px";ka.style.cursor="pointer";ka.style.fontSize="13px";ka.style.borderBottom=ia?"2px solid #29b6f2":"2px solid transparent";ka.style.fontWeight=ia?"bold":"normal";ka.style.color=ia?"":"#888";ka.style.userSelect="none";mxUtils.write(ka,Z);-return ka}function L(Z){if(Z!==aa){if("json"===Z)null!=fa&&(R.value=JSON.stringify(fa,null,2)),l.style.display="none",J.style.display="",ra.style.borderBottomColor="#29b6f2",ra.style.fontWeight="bold",ra.style.color="",qa.style.borderBottomColor="transparent",qa.style.fontWeight="normal",qa.style.color="#888",R.focus();else{try{var ia=JSON.parse(R.value);fa=ia;H.setConfig(ia)}catch(ka){}l.style.display="";J.style.display="none";qa.style.borderBottomColor="#29b6f2";qa.style.fontWeight="bold";qa.style.color=+c[k],x=q.data;if(null!=x){x="data:"==x.substring(0,5)?this.convertDataUri(x):x;var C="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==q.aspect&&(C+="aspect=fixed;");C=C+"image="+x+";";null!=q.style&&(C+=q.style);f.appendChild(this.sidebar.createVertexTemplate(C,q.w,q.h,"",q.title||"",!1,null,!0))}else if(null!=q.xml){var E=this.stringToCells("<"==q.xml.charAt(0)?q.xml:Graph.decompress(q.xml)),L=0==E.length?mxResources.get("drawingEmpty"):null!=q.title?q.title:"";+f.appendChild(this.sidebar.createVertexTemplateFromCells(E,q.w,q.h,L,!0,null,!0))}}catch(Q){L=null!=Q.message?mxResources.get("error")+": "+Q.message:String(Q),C=this.sidebar.createVertexTemplateFromCells(null,q.w,q.h,L,!0,null,!0),f.appendChild(C)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||+(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,f,k,q,x,C,E){c=new ImageDialog(this,c,f,k,q,x,C,E);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,k,q,x,C){var E=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=E?JSON.stringify(JSON.parse(E),null,2):"",mxUtils.bind(this,function(L){if(null!=+L)try{if(null!=C&&C(L),L==E)this.hideDialog();else{if(0<L.length){var Q=JSON.parse(L);localStorage.setItem(f,JSON.stringify(Q))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(V){this.handleError(V)}}),null,mxResources.get("close"),null,null,null,!0,null,null,x,k,q);this.showDialog(c.container,660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=k&&2<k.length?500:440,280));c.init()};EditorUi.prototype.showConfigurationEditorDialog=+function(c,f,k,q){function x(Z){da?Q.confirm(mxResources.get("allChangesLost"),null,Z,mxResources.get("cancel"),mxResources.get("discardChanges")):Z()}function C(){ba=!0;Q.hideDialog()}function E(Z,ia){var ja=document.createElement("div");ja.style.padding="4px 16px";ja.style.cursor="pointer";ja.style.fontSize="13px";ja.style.borderBottom=ia?"2px solid #29b6f2":"2px solid transparent";ja.style.fontWeight=ia?"bold":"normal";ja.style.color=ia?"":"#888";ja.style.userSelect="none";mxUtils.write(ja,Z);+return ja}function L(Z){if(Z!==aa){if("json"===Z)null!=fa&&(R.value=JSON.stringify(fa,null,2)),l.style.display="none",J.style.display="",ra.style.borderBottomColor="#29b6f2",ra.style.fontWeight="bold",ra.style.color="",qa.style.borderBottomColor="transparent",qa.style.fontWeight="normal",qa.style.color="#888",R.focus();else{try{var ia=JSON.parse(R.value);fa=ia;H.setConfig(ia)}catch(ja){}l.style.display="";J.style.display="none";qa.style.borderBottomColor="#29b6f2";qa.style.fontWeight="bold";qa.style.color="";ra.style.borderBottomColor="transparent";ra.style.fontWeight="normal";ra.style.color="#888"}aa=Z}}var Q=this,V=localStorage.getItem(f),K={};try{null!=V&&(K=JSON.parse(V))}catch(Z){}var fa=K,aa="editor",da=!1,ba=!1;c=document.createElement("div");c.style.position="absolute";c.style.top="20px";c.style.bottom="20px";c.style.left="20px";c.style.right="20px";var ha=document.createElement("div");ha.style.position="absolute";ha.style.left="0";ha.style.right="0";ha.style.top="0";ha.style.height="28px";ha.style.display="flex";ha.style.alignItems="end";ha.style.borderBottom="1px solid #d0d0d0";var qa=E(mxResources.get("editor",null,"Editor"),!0),ra=E(mxResources.get("formatJson",null,"JSON"),!1);ha.appendChild(qa);ha.appendChild(ra);c.appendChild(ha);var l=document.createElement("div");l.style.position="absolute";l.style.left="0";l.style.right="0";l.style.top="30px";l.style.bottom="50px";ha={};try{var t=Q.editor.graph;null!=t.currentVertexStyle&&(ha.currentVertexStyle=t.currentVertexStyle);null!=t.currentEdgeStyle&&(ha.currentEdgeStyle=t.currentEdgeStyle)}catch(Z){}var H=DrawioConfigEditor.install(l,{initialConfig:K,editorContext:ha,darkMode:null!=Editor.isDarkMode&&Editor.isDarkMode(),highContrast:Q.isHighContrast(),onConfigChanged:function(Z){fa=Z;da=!0}}),J=document.createElement("div");J.style.position="absolute";J.style.left="0";J.style.right="0";J.style.top="30px";J.style.bottom="50px";J.style.display="none";var R=document.createElement("textarea");R.setAttribute("wrap","off");R.setAttribute("spellcheck","false");R.setAttribute("autocorrect","off");R.setAttribute("autocomplete","off");R.setAttribute("autocapitalize","off");R.style.resize="none";R.style.outline="none";R.style.boxSizing="border-box";R.style.width="100%";R.style.height="100%";try{R.value=null!=V?JSON.stringify(JSON.parse(V),null,2):""}catch(Z){R.value=V||""}mxEvent.addListener(R,"input",function(){da=!0});J.appendChild(R);c.appendChild(l);c.appendChild(J);mxEvent.addListener(qa,"click",function(){L("editor")});mxEvent.addListener(ra,-"click",function(){L("json")});var T=document.createElement("div");T.style.position="absolute";T.style.left="0";T.style.right="0";T.style.bottom="0";T.style.height="46px";T.style.display="flex";T.style.whiteSpace="nowrap";T.style.alignItems="center";T.style.justifyContent="end";T.style.paddingTop="10px";T.style.paddingBottom="10px";T.style.boxSizing="border-box";null==q||Q.isOffline()||T.appendChild(Q.createHelpIcon(q));if(null!=k)for(q=0;q<k.length;q++)(function(Z,ia,ka){Z=mxUtils.button(Z,function(X){"editor"===-aa&&null!=fa&&(R.value=JSON.stringify(fa,null,2));ia(X,R)});null!=ka&&Z.setAttribute("title",ka);Z.className="geBtn";T.appendChild(Z)})(k[q][0],k[q][1],k[q][2]);q=mxUtils.button(mxResources.get("close"),function(){x(B)});q.setAttribute("title","Escape");q.className="geBtn";var Y=mxUtils.button(mxResources.get("apply"),function(){var Z="editor"===aa?null!=fa&&0<Object.keys(fa).length?JSON.stringify(fa,null,2):"":R.value;try{if(Z==V)da=!1,B();else{if(0<Z.length){var ia=JSON.parse(Z);localStorage.setItem(f,-JSON.stringify(ia))}else localStorage.removeItem(f);da=!1;B();Q.alert(mxResources.get("restartForChangeRequired"))}}catch(ka){Q.handleError(ka)}});Y.className="geBtn gePrimaryBtn";Q.editor.cancelFirst?(T.appendChild(q),T.appendChild(Y)):(T.appendChild(Y),T.appendChild(q));c.appendChild(T);mxEvent.addListener(c,"keydown",function(Z){13===Z.keyCode&&mxEvent.isControlDown(Z)&&Y.click()});Q.showDialog(c,800,600,!0,!1,function(Z,ia){if(!ba&&da)return x(B),!1},null,null,new mxRectangle(0,0,null!=k&&2<k.length?-500:440,400));R.scrollTop=0};EditorUi.prototype.showBackgroundImageDialog=function(c,f,k,q){c=null!=c?c:mxUtils.bind(this,function(x,B,E){B||(x=new ChangePageSetup(this,q?E:null,x),x.ignoreColor=!q,this.editor.graph.model.execute(x))});c=new BackgroundImageDialog(this,c,f,k,q);this.showDialog(c.container,400,null,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,f,k,q,x){c=new LibraryDialog(this,c,f,k,q,x);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(B){B&&null==+"click",function(){L("json")});var T=document.createElement("div");T.style.position="absolute";T.style.left="0";T.style.right="0";T.style.bottom="0";T.style.height="46px";T.style.display="flex";T.style.whiteSpace="nowrap";T.style.alignItems="center";T.style.justifyContent="end";T.style.paddingTop="10px";T.style.paddingBottom="10px";T.style.boxSizing="border-box";null==q||Q.isOffline()||T.appendChild(Q.createHelpIcon(q));if(null!=k)for(q=0;q<k.length;q++)(function(Z,ia,ja){Z=mxUtils.button(Z,function(X){"editor"===+aa&&null!=fa&&(R.value=JSON.stringify(fa,null,2));ia(X,R)});null!=ja&&Z.setAttribute("title",ja);Z.className="geBtn";T.appendChild(Z)})(k[q][0],k[q][1],k[q][2]);q=mxUtils.button(mxResources.get("close"),function(){x(C)});q.setAttribute("title","Escape");q.className="geBtn";var Y=mxUtils.button(mxResources.get("apply"),function(){var Z="editor"===aa?null!=fa&&0<Object.keys(fa).length?JSON.stringify(fa,null,2):"":R.value;try{if(Z==V)da=!1,C();else{if(0<Z.length){var ia=JSON.parse(Z);localStorage.setItem(f,+JSON.stringify(ia))}else localStorage.removeItem(f);da=!1;C();Q.alert(mxResources.get("restartForChangeRequired"))}}catch(ja){Q.handleError(ja)}});Y.className="geBtn gePrimaryBtn";Q.editor.cancelFirst?(T.appendChild(q),T.appendChild(Y)):(T.appendChild(Y),T.appendChild(q));c.appendChild(T);mxEvent.addListener(c,"keydown",function(Z){13===Z.keyCode&&mxEvent.isControlDown(Z)&&Y.click()});Q.showDialog(c,800,600,!0,!1,function(Z,ia){if(!ba&&da)return x(C),!1},null,null,new mxRectangle(0,0,null!=k&&2<k.length?+500:440,400));R.scrollTop=0};EditorUi.prototype.showBackgroundImageDialog=function(c,f,k,q){c=null!=c?c:mxUtils.bind(this,function(x,C,E){C||(x=new ChangePageSetup(this,q?E:null,x),x.ignoreColor=!q,this.editor.graph.model.execute(x))});c=new BackgroundImageDialog(this,c,f,k,q);this.showDialog(c.container,400,null,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,f,k,q,x){c=new LibraryDialog(this,c,f,k,q,x);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(C){C&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}),!1,!1,new mxRectangle(0,0,480,320));c.init()};EditorUi.prototype.getCollapsedSections=function(){return mxSettings.getCollapsedSections()};EditorUi.prototype.getLibraryExpanded=function(c,f){var k=mxSettings.getCollapsedLibraries();return null!=k[c]?!k[c]:f};EditorUi.prototype.setLibraryExpanded=function(c,f){if(null!=c){var k=mxSettings.getCollapsedLibraries();k[c]=!f;mxSettings.setCollapsedLibraries(k);mxSettings.save()}};var m=EditorUi.prototype.createFormat;-EditorUi.prototype.createFormat=function(c){var f=m.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(k){this.editor.graph.isSelectionEmpty()&&f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,k,q,x,B,E){var L=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},Q=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{"1"!=urlParams.test&&!E||null==window.console||+EditorUi.prototype.createFormat=function(c){var f=m.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(k){this.editor.graph.isSelectionEmpty()&&f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,k,q,x,C,E){var L=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},Q=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{"1"!=urlParams.test&&!E||null==window.console||console.error("EditorUi.handleError:",c)}catch(aa){}if(null!=Q||null!=f){E=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var V=mxResources.get("ok"),K=null;f=null!=f?f:mxResources.get("error");if(null!=Q){null!=Q.retry&&(V=mxResources.get("cancel"),K=function(){L();Q.retry()});if(404==Q.code||404==Q.status||403==Q.code){E=403==Q.code?null!=Q.message?mxUtils.htmlEntities(Q.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=x?x:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+-(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var fa=null!=x?null:null!=B?B:window.location.hash;if(null!=fa&&("#G"==fa.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==fa.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==Q.code||404==Q.status)){fa="#U"==fa.substring(0,2)?fa.substring(45,+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var fa=null!=x?null:null!=C?C:window.location.hash;if(null!=fa&&("#G"==fa.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==fa.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==Q.code||404==Q.status)){fa="#U"==fa.substring(0,2)?fa.substring(45,fa.lastIndexOf("%26ex")):fa.substring(2);this.showError(f,E,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+fa);null!=q&&q()}),K,mxResources.get("changeUser"),mxUtils.bind(this,function(){function aa(){qa.innerText="";for(var ra=0;ra<da.length;ra++){var l=document.createElement("option");mxUtils.write(l,da[ra].displayName);l.value=ra;qa.appendChild(l);l=document.createElement("option");l.innerHTML=" ";mxUtils.write(l,"<"+da[ra].email+">");l.setAttribute("disabled","disabled");qa.appendChild(l)}l=document.createElement("option");mxUtils.write(l,mxResources.get("addAccount"));l.value=da.length;qa.appendChild(l)}var da=this.drive.getUsersList(),ba=document.createElement("div"),ha=document.createElement("div");ha.style.marginBottom="6px";mxUtils.write(ha,mxResources.get("changeUser")+": ");ba.appendChild(ha);var qa=document.createElement("select");qa.style.width="100%";aa();mxEvent.addListener(qa,"change",mxUtils.bind(this,function(){var ra=qa.value,l=da.length!=ra;l&&this.drive.setUser(da[ra]);this.drive.authorize(l,mxUtils.bind(this,function(){l||(da=this.drive.getUsersList(),aa())}),mxUtils.bind(this,function(t){this.handleError(t)}),!0)}));ba.appendChild(qa);ba=new CustomDialog(this,ba,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(ba.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=k&&k()}),520,150);return}}null!=Q.message?E=""==Q.message&&null!=Q.name?mxUtils.htmlEntities(Q.name,!1):mxUtils.htmlEntities(Q.message,!1):null!=Q.response&&null!=Q.response.error?E=mxUtils.htmlEntities(Q.response.error,!1):"undefined"!==typeof window.App&&(Q.code==App.ERROR_TIMEOUT?E=mxUtils.htmlEntities(mxResources.get("timeout"),!1):Q.code==App.ERROR_BUSY?E=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof Q&&0<Q.length&&(E=mxUtils.htmlEntities(Q,!1)))}x=c=null;null!=Q&&null!=Q.helpLink?(c=mxResources.get("help"),x=mxUtils.bind(this,function(){return this.editor.graph.openLink(Q.helpLink)})):null!=Q&&null!=Q.ownerEmail?(c=mxResources.get("contactOwner"),E+=mxUtils.htmlEntities(" ("+c+": "+Q.ownerEmail+")",!1),x=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(Q.ownerEmail))})):null!=Q&&null!=Q.alternateAction&&(c=Q.alternateAction.label,x=Q.alternateAction.funct);this.showError(f,E,V,k,K,null,null,c,x,null!=Q?Q.dialogWidth:null,null,null,-q?k:null)}else null!=k&&k()};EditorUi.prototype.alert=function(c,f,k){c=new ErrorDialog(this,null,c,mxResources.get("ok"),f);this.showDialog(c.container,k||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,k,q,x,B){c=null!=c?c:"";var E=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},L=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){E();null!=f&&f()},function(){E();null!=k&&k()},q,x,null,null,null,null,L);this.showDialog(c.container,-340,46+L,!0,B);c.init()};EditorUi.prototype.showBanner=function(c,f,k,q,x,B,E,L,Q){B=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){E=null!=E?E:"translate(-50%,120%)";L=null!=L?L:"translate(-50%,0%)";var V=document.createElement("div");V.className="geBtn gePrimaryBtn geBanner"+(x?" geSmallBanner":"");V.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(V.style,"transform",E);mxUtils.setPrefixedStyle(V.style,-"transition","all 1000ms ease");null!=Q&&mxUtils.setPrefixedStyle(V.style,"transform-origin",Q);Q=Q=document.createElement("img");Q.setAttribute("src",Editor.crossImage);Q.setAttribute("title",mxResources.get(q?"doNotShowAgain":"close"));Q.setAttribute("border","0");x||(B=document.createElement("img"),B.setAttribute("src",IMAGE_PATH+"/logo.png"),B.setAttribute("border","0"),B.setAttribute("align","absmiddle"),B.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",-V.appendChild(B),Q.style.cssText=(x?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",V.appendChild(Q));mxUtils.write(V,f);document.body.appendChild(V);this.bannerShowing=!0;x&&(Q.className="geLibraryButton",V.appendChild(Q));f=document.createElement("div");f.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var K=document.createElement("input");+q?k:null)}else null!=k&&k()};EditorUi.prototype.alert=function(c,f,k){c=new ErrorDialog(this,null,c,mxResources.get("ok"),f);this.showDialog(c.container,k||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,k,q,x,C){c=null!=c?c:"";var E=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},L=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){E();null!=f&&f()},function(){E();null!=k&&k()},q,x,null,null,null,null,L);this.showDialog(c.container,+340,46+L,!0,C);c.init()};EditorUi.prototype.showBanner=function(c,f,k,q,x,C,E,L,Q){C=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){E=null!=E?E:"translate(-50%,120%)";L=null!=L?L:"translate(-50%,0%)";var V=document.createElement("div");V.className="geBtn gePrimaryBtn geBanner"+(x?" geSmallBanner":"");V.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(V.style,"transform",E);mxUtils.setPrefixedStyle(V.style,+"transition","all 1000ms ease");null!=Q&&mxUtils.setPrefixedStyle(V.style,"transform-origin",Q);Q=Q=document.createElement("img");Q.setAttribute("src",Editor.crossImage);Q.setAttribute("title",mxResources.get(q?"doNotShowAgain":"close"));Q.setAttribute("border","0");x||(C=document.createElement("img"),C.setAttribute("src",IMAGE_PATH+"/logo.png"),C.setAttribute("border","0"),C.setAttribute("align","absmiddle"),C.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",+V.appendChild(C),Q.style.cssText=(x?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",V.appendChild(Q));mxUtils.write(V,f);document.body.appendChild(V);this.bannerShowing=!0;x&&(Q.className="geLibraryButton",V.appendChild(Q));f=document.createElement("div");f.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var K=document.createElement("input");K.setAttribute("type","checkbox");K.setAttribute("id","geDoNotShowAgainCheckbox");K.style.marginRight="6px";if(!q){f.appendChild(K);var fa=document.createElement("label");fa.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(fa,mxResources.get("doNotShowAgain"));f.appendChild(fa);V.style.paddingBottom=x?"16px":"30px";V.appendChild(f)}var aa=mxUtils.bind(this,function(){null!=V.parentNode&&(V.parentNode.removeChild(V),this.bannerShowing=!1,K.checked||q)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=Q&&mxEvent.addListener(Q,"click",mxUtils.bind(this,function(ba){mxEvent.consume(ba);aa()}));var da=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(V.style,"transform",E);window.setTimeout(mxUtils.bind(this,function(){aa()}),1E3)});mxEvent.addListener(V,"click",mxUtils.bind(this,function(ba){var ha=mxEvent.getSource(ba);ha!=K&&ha!=fa?(null!=k&&k(),aa(),mxEvent.consume(ba)):da()}));window.setTimeout(mxUtils.bind(this,-function(){mxUtils.setPrefixedStyle(V.style,"transform",L)}),500);window.setTimeout(da,x?5E3:3E4);B=!0}return B};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,f,k,q){c=c.toDataURL("image/"+k);if(null!=c&&6<c.length)null!=f&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(f))),0<q&&(c=Editor.writeGraphModelToPng(c,-"pHYs","dpi",q));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,f,k,q,x){var B="jpeg"==k?"jpg":k;q=this.getBaseFilename(q)+(null!=f?".drawio":"")+"."+B;c=this.createImageDataUri(c,f,k,x);this.saveData(q,B,c.substring(c.lastIndexOf(",")+1),"image/"+k,!0)};EditorUi.prototype.showAnimatedGifExportDialog=function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("formatAnimatedGif",-null,"Animated GIF"));c.appendChild(f);f=document.createElement("div");f.className="geDialogSection";var k=document.createElement("div");k.className="geDialogFormRow";var q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("speed",null,"Speed")+":");k.appendChild(q);var x=document.createElement("select"),B=[{label:mxResources.get("slow",null,"Slow"),value:8},{label:mxResources.get("medium",null,"Medium"),value:15},{label:mxResources.get("fast",null,"Fast"),-value:24}];for(q=0;q<B.length;q++){var E=document.createElement("option");mxUtils.write(E,B[q].label);E.setAttribute("value",B[q].value);x.appendChild(E)}x.value=null!=this.lastExportFps?this.lastExportFps:15;0>x.selectedIndex&&(x.value=15);k.appendChild(x);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("zoom")+":");k.appendChild(q);var L=document.createElement("input");+function(){mxUtils.setPrefixedStyle(V.style,"transform",L)}),500);window.setTimeout(da,x?5E3:3E4);C=!0}return C};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,f,k,q){c=c.toDataURL("image/"+k);if(null!=c&&6<c.length)null!=f&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(f))),0<q&&(c=Editor.writeGraphModelToPng(c,+"pHYs","dpi",q));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,f,k,q,x){var C="jpeg"==k?"jpg":k;q=this.getBaseFilename(q)+(null!=f?".drawio":"")+"."+C;c=this.createImageDataUri(c,f,k,x);this.saveData(q,C,c.substring(c.lastIndexOf(",")+1),"image/"+k,!0)};EditorUi.prototype.showAnimatedGifExportDialog=function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("formatAnimatedGif",+null,"Animated GIF"));c.appendChild(f);f=document.createElement("div");f.className="geDialogSection";var k=document.createElement("div");k.className="geDialogFormRow";var q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("speed",null,"Speed")+":");k.appendChild(q);var x=document.createElement("select"),C=[{label:mxResources.get("slow",null,"Slow"),value:8},{label:mxResources.get("medium",null,"Medium"),value:15},{label:mxResources.get("fast",null,"Fast"),+value:24}];for(q=0;q<C.length;q++){var E=document.createElement("option");mxUtils.write(E,C[q].label);E.setAttribute("value",C[q].value);x.appendChild(E)}x.value=null!=this.lastExportFps?this.lastExportFps:15;0>x.selectedIndex&&(x.value=15);k.appendChild(x);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("zoom")+":");k.appendChild(q);var L=document.createElement("input");L.setAttribute("type","text");L.value=this.lastExportZoom||"100%";k.appendChild(L);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("borderWidth",null,"Border Width")+":");k.appendChild(q);var Q=document.createElement("input");Q.setAttribute("type","text");Q.value=this.lastExportBorder||"0";k.appendChild(Q);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";-q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("loops",null,"Loops")+":");k.appendChild(q);var V=document.createElement("select");B=[{label:mxResources.get("forever",null,"Forever"),value:0},{label:"1",value:1},{label:"3",value:3},{label:"5",value:5}];for(q=0;q<B.length;q++)E=document.createElement("option"),mxUtils.write(E,B[q].label),E.setAttribute("value",B[q].value),V.appendChild(E);V.value=null!=this.lastExportLoops?this.lastExportLoops:0;0>V.selectedIndex&&+q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("loops",null,"Loops")+":");k.appendChild(q);var V=document.createElement("select");C=[{label:mxResources.get("forever",null,"Forever"),value:0},{label:"1",value:1},{label:"3",value:3},{label:"5",value:5}];for(q=0;q<C.length;q++)E=document.createElement("option"),mxUtils.write(E,C[q].label),E.setAttribute("value",C[q].value),V.appendChild(E);V.value=null!=this.lastExportLoops?this.lastExportLoops:0;0>V.selectedIndex&&(V.value=0);k.appendChild(V);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("appearance")+":");k.appendChild(q);var K=document.createElement("select");q=document.createElement("option");q.setAttribute("value","light");mxUtils.write(q,mxResources.get("light"));K.appendChild(q);q=document.createElement("option");q.setAttribute("value","dark");mxUtils.write(q,mxResources.get("dark"));K.appendChild(q);var fa=Editor.isDarkMode()?"dark":"light";K.value=null!=this.lastExportTheme?this.lastExportTheme:fa;0>K.selectedIndex&&(K.value=fa);k.appendChild(K);f.appendChild(k);c.appendChild(f);f=document.createElement("div");f.className="geDialogSection";var aa=this.addCheckbox(f,mxResources.get("transparentBackground",null,"Transparent Background"),null!=this.lastExportTransparent?this.lastExportTransparent:!1,null,null,null,null,null,!0);c.appendChild(f);c=new CustomDialog(this,c,mxUtils.bind(this,function(){var da=parseInt(L.value);if(isNaN(da)||0>=da)da=100;this.lastExportZoom=da+"%";this.lastExportBorder=Q.value;this.lastExportFps=15!=parseInt(x.value)?parseInt(x.value):null;this.lastExportLoops=0!=parseInt(V.value)?parseInt(V.value):null;this.lastExportTransparent=aa.checked?!0:null;this.lastExportTheme=K.value==fa?null:K.value;this.exportAnimatedGif({fps:parseInt(x.value),scale:da/100,border:parseInt(Q.value)||0,repeat:parseInt(V.value),transparent:aa.checked,theme:K.value,background:aa.checked?null:null!=this.editor.graph.background&&this.editor.graph.background!=mxConstants.NONE?this.editor.graph.background:"light-dark(#ffffff,"+Editor.darkColor+")"})}),null,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram");this.showDialog(c.container,360,null,!0,!0,null,null,null,null,!0)};EditorUi.prototype.exportAnimatedGif=function(c){if(this.spinner.spin(document.body,mxResources.get("exporting")))try{(new AnimatedGifExport(this)).doExport(c,mxUtils.bind(this,function(f){this.spinner.stop();if(null!=f){var k=this.getBaseFilename()+".gif";if("function"===typeof navigator.msSaveBlob)navigator.msSaveBlob(f,k);else{var q=document.createElement("a");q.href=URL.createObjectURL(f);q.download=k;document.body.appendChild(q);q.click();setTimeout(function(){document.body.removeChild(q);URL.revokeObjectURL(q.href)},0)}}}),mxUtils.bind(this,function(f){this.spinner.stop();this.handleError(f)}))}catch(f){this.spinner.stop(),this.handleError(f)}};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=-urlParams.save&&"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,f){c=new TextareaDialog(this,c,f,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280),!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,f,k,q,x,B){"text/xml"!=k||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||-/(\.html)$/i.test(f)||(f=f+"."+(null!=B?B:"drawio"));if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,k,q);else{var E=document.createElement("a");B=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof E.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var L=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);B=65==(L?parseInt(L[2],10):!1)?!1:B}if(B||this.isOffline()){E.href=-URL.createObjectURL(q?this.base64ToBlob(c,k):new Blob([c],{type:k}));B?E.download=f:E.setAttribute("target","_blank");document.body.appendChild(E);try{window.setTimeout(function(){URL.revokeObjectURL(E.href)},2E4),E.click(),E.parentNode.removeChild(E)}catch(Q){}}else this.createEchoRequest(c,f,k,q,x).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,k,q,x,B){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=k?"&mime="+k:"")+(null!=x?"&format="+-x:"")+(null!=B?"&base64="+B:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(q?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,k,q,x,B,E,L,Q){B=null!=B?B:!1;E=null!=E?E:"vsdx"!=x&&(!mxClient.IS_IOS||!navigator.standalone);var V=mxUtils.bind(this,function(fa,aa,da,ba){try{if("_blank"==aa)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(c,k,q);else if(null!=k&&"text/html"==k.substring(0,9)&&c.length<EmbedDialog.maxSize){var ha=new EmbedDialog(this,c,null,null,null,null,+urlParams.save&&"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,f){c=new TextareaDialog(this,c,f,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280),!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,f,k,q,x,C){"text/xml"!=k||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||+/(\.html)$/i.test(f)||(f=f+"."+(null!=C?C:"drawio"));if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,k,q);else{var E=document.createElement("a");C=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof E.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var L=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);C=65==(L?parseInt(L[2],10):!1)?!1:C}if(C||this.isOffline()){E.href=+URL.createObjectURL(q?this.base64ToBlob(c,k):new Blob([c],{type:k}));C?E.download=f:E.setAttribute("target","_blank");document.body.appendChild(E);try{window.setTimeout(function(){URL.revokeObjectURL(E.href)},2E4),E.click(),E.parentNode.removeChild(E)}catch(Q){}}else this.createEchoRequest(c,f,k,q,x).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,k,q,x,C){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=k?"&mime="+k:"")+(null!=x?"&format="++x:"")+(null!=C?"&base64="+C:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(q?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,k,q,x,C,E,L,Q){C=null!=C?C:!1;E=null!=E?E:"vsdx"!=x&&(!mxClient.IS_IOS||!navigator.standalone);var V=mxUtils.bind(this,function(fa,aa,da,ba){try{if("_blank"==aa)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(c,k,q);else if(null!=k&&"text/html"==k.substring(0,9)&&c.length<EmbedDialog.maxSize){var ha=new EmbedDialog(this,c,null,null,null,null,null,null,null,!0);this.showDialog(ha.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));ha.init()}else null==window.open(URL.createObjectURL(new Blob([c],{type:"text/plain;charset=utf-8"})))&&mxUtils.popup(c,!0);else if(aa==App.MODE_DEVICE||"download"==aa)this.doSaveLocalFile(c,fa,k,q,null,L);else if(null!=fa&&0<fa.length){var qa=mxUtils.bind(this,function(ra){try{this.exportFile(c,fa,k,q,aa,ra)}catch(l){this.handleError(l)}});null!=ba?qa(ba):this.pickFolder(aa,qa)}}catch(ra){this.handleError(ra)}});-x=[];B||x.push(App.MODE_BROWSER);E||x.push("_blank");var K=new SaveDialog(this,f,mxUtils.bind(this,function(fa,aa,da){V(fa.value,aa,fa,da);this.hideDialog(null,null,K.container)}),x,c,k,q,Q);this.showDialog(K.container,420,null!=k?114:122,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));K.init()};EditorUi.prototype.openInNewWindow=function(c,f,k){null==window.open(URL.createObjectURL(k?this.base64ToBlob(c,f):new Blob([c],{type:f})))&&mxUtils.popup(c,!0)};var p=EditorUi.prototype.addChromelessToolbarItems;+x=[];C||x.push(App.MODE_BROWSER);E||x.push("_blank");var K=new SaveDialog(this,f,mxUtils.bind(this,function(fa,aa,da){V(fa.value,aa,fa,da);this.hideDialog(null,null,K.container)}),x,c,k,q,Q);this.showDialog(K.container,420,null!=k?114:122,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));K.init()};EditorUi.prototype.openInNewWindow=function(c,f,k){null==window.open(URL.createObjectURL(k?this.base64ToBlob(c,f):new Blob([c],{type:f})))&&mxUtils.popup(c,!0)};var p=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.isChromelessImageExportEnabled=function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=function(c){if(null!=urlParams.tags){var f=null;try{var k=urlParams.tags;try{k=decodeURIComponent(k)}catch(L){}f=JSON.parse(k)}catch(L){}if(null!=f){var q=this.editor.graph,x=mxUtils.bind(this,function(){var L=null!=this.currentPage?this.currentPage.getId():-0;L=f[L];q.hiddenTags=null!=L&&0<L.length?L:[];q.refresh()});this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){x();q.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize()}));this.editor.addListener("pageSelected",x)}this.tagsDialog=this.tagsComponent=null;var B=c(mxUtils.bind(this,function(L){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=this.tagsDialog}),!0),this.tagsComponent.div.getElementsByTagName("div")[0].style.position=+0;L=f[L];q.hiddenTags=null!=L&&0<L.length?L:[];q.refresh()});this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){x();q.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize()}));this.editor.addListener("pageSelected",x)}this.tagsDialog=this.tagsComponent=null;var C=c(mxUtils.bind(this,function(L){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=this.tagsDialog}),!0),this.tagsComponent.div.getElementsByTagName("div")[0].style.position="",mxUtils.setPrefixedStyle(this.tagsComponent.div.style,"borderRadius","5px"),this.tagsComponent.div.style.maxHeight="160px",this.tagsComponent.div.style.maxWidth="120px",this.tagsComponent.div.style.padding="4px",this.tagsComponent.div.style.overflow="auto",this.tagsComponent.div.style.height="auto",this.tagsComponent.div.style.position="fixed",this.tagsComponent.div.style.fontFamily=Editor.defaultHtmlFont,this.tagsComponent.div.style.backgroundColor="#000000",this.tagsComponent.div.style.color=-"#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null;else{this.tagsDialog=this.tagsComponent.div;mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var Q=B.getBoundingClientRect();this.tagsDialog.style.left=Q.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+-this.chromelessToolbar.offsetHeight+4+"px";Q=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=Q.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(L)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var L=this.editor.graph.getAllTags();B.style.display=0<L.length?"":"none"}))}p.apply(this,+"#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null;else{this.tagsDialog=this.tagsComponent.div;mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var Q=C.getBoundingClientRect();this.tagsDialog.style.left=Q.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)++this.chromelessToolbar.offsetHeight+4+"px";Q=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=Q.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(L)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var L=this.editor.graph.getAllTags();C.style.display=0<L.length?"":"none"}))}p.apply(this,arguments);this.editor.addListener("tagsDialogShown",mxUtils.bind(this,function(){null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));this.editor.addListener("layersDialogShown",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));this.editor.addListener("pageSelected",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));mxEvent.addListener(this.editor.graph.container,"click",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));if(this.editor.isExportToCanvas()&&this.isChromelessImageExportEnabled()&&"1"!=urlParams.noExport){this.exportDialog=null;var E=c(mxUtils.bind(this,function(L){var Q=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",Q);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)Q.apply(this);else{this.exportDialog=document.createElement("div");var V=E.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily=Editor.defaultHtmlFont;this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,80);this.exportDialog.style.left=V.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";V=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=V.zIndex;var K=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});K.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",Q);this.editor.exportToCanvas(mxUtils.bind(this,function(fa){K.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var aa=this.createImageDataUri(fa,null,"png");fa=document.createElement("img");fa.style.maxWidth="140px";fa.style.maxHeight="140px";fa.style.cursor="pointer";fa.style.backgroundColor="white";fa.setAttribute("title",mxResources.get("openInNewWindow"));fa.setAttribute("border","0");fa.setAttribute("src",aa);this.exportDialog.appendChild(fa);mxEvent.addListener(fa,"click",mxUtils.bind(this,function(){this.openInNewWindow(aa.substring(aa.indexOf(",")+1),"image/png",-!0);Q.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(fa){K.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(fa)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(L)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,k,q,x,B){if("1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){B=-this.embedMessageSource||window.opener||window.parent;var E=this.createLoadMessage("export");E.format=f;E.filename=c;E.data=x?"data:"+q+";base64,"+k:k;E.xml=this.getFileData(!0);B.postMessage(JSON.stringify(E),"*")}else this.isLocalFileSave()?this.saveLocalFile(k,c,q,x,f,B):this.saveRequest(c,f,mxUtils.bind(this,function(L,Q){return this.createEchoRequest(k,L,q,x,f,Q)}),k,x,q)};EditorUi.prototype.saveRequest=function(c,f,k,q,x,B,E){E=null!=E?E:!mxClient.IS_IOS||!navigator.standalone;var L=mxUtils.bind(this,-function(V,K,fa,aa){if("_blank"==K||null!=V&&0<V.length){var da=k("_blank"==K?null:V,K==App.MODE_DEVICE||"download"==K||null==K||"_blank"==K?"0":"1");null!=da&&(K==App.MODE_DEVICE||"download"==K||"_blank"==K?da.simulate(document,"_blank"):(fa=mxUtils.bind(this,function(ba){B=null!=B?B:"pdf"==f?"application/pdf":"image/"+f;if(null!=q)try{this.exportFile(q,V,B,!0,K,ba)}catch(ha){this.handleError(ha)}else this.spinner.spin(document.body,mxResources.get("saving"))&&da.send(mxUtils.bind(this,function(){this.spinner.stop();-if(200<=da.getStatus()&&299>=da.getStatus())try{this.exportFile(da.getText(),V,B,!0,K,ba)}catch(ha){this.handleError(ha)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(ha){this.spinner.stop();this.handleError(ha)}))}),null!=aa?fa(aa):this.pickFolder(K,fa)))}});x=[App.MODE_BROWSER];E||x.push("_blank");var Q=new SaveDialog(this,c,mxUtils.bind(this,function(V,K,fa){L(V.value,K,V,fa);this.hideDialog(null,null,Q.container)}),x,null,"application/pdf");this.showDialog(Q.container,-420,114,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));Q.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,f,k,q,x,B){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,f,k){f(null)};EditorUi.prototype.exportSvg=function(c,f,k,q,x,B,-E,L,Q,V,K,fa,aa,da,ba,ha){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(la){Editor.addRetryToError(la,mxUtils.bind(this,function(){this.exportSvg(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba,ha)}));this.handleError(la)})))try{var qa=this.editor.graph.isSelectionEmpty();k=null!=k?k:qa;var ra=f?null:this.editor.graph.background;ra==mxConstants.NONE&&(ra=null);null==ra&&0==f&&(ra=this.editor.graph.shapeBackgroundColor);var l=this.editor.graph.addForeignObjectWarning;-Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var t=mxUtils.lightDarkColorSupported,H=mxUtils.preferDarkColor;if("light"==K||"dark"==K)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==K;var J=Graph.addFont,R={};Graph.addFont=function(la,va,za,sa){J.call(this,la,va,za,R)};var T=this.editor.graph.createSvgImageExport(x,ba),Y=T.drawCellState;T.drawCellState=function(la,va){null!=la&&Graph.processFontStyle(la.style);Y.apply(this,arguments)};var Z=+!0);Q.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(fa){K.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(fa)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(L)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,k,q,x,C){if("1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){C=+this.embedMessageSource||window.opener||window.parent;var E=this.createLoadMessage("export");E.format=f;E.filename=c;E.data=x?"data:"+q+";base64,"+k:k;E.xml=this.getFileData(!0);C.postMessage(JSON.stringify(E),"*")}else this.isLocalFileSave()?this.saveLocalFile(k,c,q,x,f,C):this.saveRequest(c,f,mxUtils.bind(this,function(L,Q){return this.createEchoRequest(k,L,q,x,f,Q)}),k,x,q)};EditorUi.prototype.saveRequest=function(c,f,k,q,x,C,E){E=null!=E?E:!mxClient.IS_IOS||!navigator.standalone;var L=mxUtils.bind(this,+function(V,K,fa,aa){if("_blank"==K||null!=V&&0<V.length){var da=k("_blank"==K?null:V,K==App.MODE_DEVICE||"download"==K||null==K||"_blank"==K?"0":"1");null!=da&&(K==App.MODE_DEVICE||"download"==K||"_blank"==K?da.simulate(document,"_blank"):(fa=mxUtils.bind(this,function(ba){C=null!=C?C:"pdf"==f?"application/pdf":"image/"+f;if(null!=q)try{this.exportFile(q,V,C,!0,K,ba)}catch(ha){this.handleError(ha)}else this.spinner.spin(document.body,mxResources.get("saving"))&&da.send(mxUtils.bind(this,function(){this.spinner.stop();+if(200<=da.getStatus()&&299>=da.getStatus())try{this.exportFile(da.getText(),V,C,!0,K,ba)}catch(ha){this.handleError(ha)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(ha){this.spinner.stop();this.handleError(ha)}))}),null!=aa?fa(aa):this.pickFolder(K,fa)))}});x=[App.MODE_BROWSER];E||x.push("_blank");var Q=new SaveDialog(this,c,mxUtils.bind(this,function(V,K,fa){L(V.value,K,V,fa);this.hideDialog(null,null,Q.container)}),x,null,"application/pdf");this.showDialog(Q.container,+420,114,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));Q.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,f,k,q,x,C){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,f,k){f(null)};EditorUi.prototype.exportSvg=function(c,f,k,q,x,C,+E,L,Q,V,K,fa,aa,da,ba,ha){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(la){Editor.addRetryToError(la,mxUtils.bind(this,function(){this.exportSvg(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba,ha)}));this.handleError(la)})))try{var qa=this.editor.graph.isSelectionEmpty();k=null!=k?k:qa;var ra=f?null:this.editor.graph.background;ra==mxConstants.NONE&&(ra=null);null==ra&&0==f&&(ra=this.editor.graph.shapeBackgroundColor);var l=this.editor.graph.addForeignObjectWarning;+Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var t=mxUtils.lightDarkColorSupported,H=mxUtils.preferDarkColor;if("light"==K||"dark"==K)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==K;var J=Graph.addFont,R={};Graph.addFont=function(la,ua,za,sa){J.call(this,la,ua,za,R)};var T=this.editor.graph.createSvgImageExport(x,ba),Y=T.drawCellState;T.drawCellState=function(la,ua){null!=la&&Graph.processFontStyle(la.style);Y.apply(this,arguments)};var Z=this.editor.graph.getSvg(ra,c,E,L,null,k,null,T,"blank"==V?"_blank":"self"==V?"_top":null,null,!aa,K,fa,null,null,null,ha);mxUtils.lightDarkColorSupported=t;mxUtils.preferDarkColor=H;this.editor.graph.addForeignObjectWarning=l;q&&this.editor.graph.addSvgShadow(Z);var ia=this.getBaseFilename()+(x?".drawio":"")+".svg";da=null!=da?da:mxUtils.bind(this,function(la){this.isLocalFileSave()||la.length<=MAX_REQUEST_SIZE?this.saveData(ia,"svg",la,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},-mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(la)}))});var ka=mxUtils.bind(this,function(la){this.spinner.stop();x&&la.setAttribute("content",this.getFileData(!0,null,null,null,k,Q,null,null,null,null,null,c,E));da(Graph.xmlDeclaration+"\n"+(x?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(la))});this.editor.graph.mathEnabled&&this.editor.addMathCss(Z);var X=mxUtils.bind(this,function(la){Editor.replaceSvgDataUris&&B&&EditorUi.embedSvgImages(la);Editor.foreignObjectImages&&-aa?this.replaceAlternateContent(la,K,ka):ka(la)}),ja=Graph.customFontElements;Graph.customFontElements=R;var na=mxUtils.bind(this,function(la){Graph.customFontElements=ja;Graph.addFont=J;B&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(la,X,this.thumbImageCache)):X(la)});aa?this.embedFonts(Z,na,!0):(this.editor.addFontCss(Z),na(Z))}catch(la){this.handleError(la)}};EditorUi.prototype.replaceAlternateContent=function(c,f,k){function q(fa,-aa,da,ba,ha){var qa=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");qa.setAttribute("x",aa);qa.setAttribute("y",da+.5);qa.setAttribute("width",ba.width);qa.setAttribute("height",ba.height);null==qa.setAttributeNS?qa.setAttribute("xlink:href",ha):qa.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",ha);fa.replaceChild(qa,fa.lastChild);L()}function x(){if(E<K.length)K[E++](x)}var B="";f=c.getElementsByTagName("style");for(var E=0;E<f.length;E++)B+=f[E].innerHTML;f=c.getElementsByTagName("switch");+mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(la)}))});var ja=mxUtils.bind(this,function(la){this.spinner.stop();x&&la.setAttribute("content",this.getFileData(!0,null,null,null,k,Q,null,null,null,null,null,c,E));da(Graph.xmlDeclaration+"\n"+(x?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(la))});this.editor.graph.mathEnabled&&this.editor.addMathCss(Z);var X=mxUtils.bind(this,function(la){Editor.replaceSvgDataUris&&C&&EditorUi.embedSvgImages(la);Editor.foreignObjectImages&&+aa?this.replaceAlternateContent(la,K,ja):ja(la)}),ka=Graph.customFontElements;Graph.customFontElements=R;var na=mxUtils.bind(this,function(la){Graph.customFontElements=ka;Graph.addFont=J;C&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(la,X,this.thumbImageCache)):X(la)});aa?this.embedFonts(Z,na,!0):(this.editor.addFontCss(Z),na(Z))}catch(la){this.handleError(la)}};EditorUi.prototype.replaceAlternateContent=function(c,f,k){function q(fa,+aa,da,ba,ha){var qa=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");qa.setAttribute("x",aa);qa.setAttribute("y",da+.5);qa.setAttribute("width",ba.width);qa.setAttribute("height",ba.height);null==qa.setAttributeNS?qa.setAttribute("xlink:href",ha):qa.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",ha);fa.replaceChild(qa,fa.lastChild);L()}function x(){if(E<K.length)K[E++](x)}var C="";f=c.getElementsByTagName("style");for(var E=0;E<f.length;E++)C+=f[E].innerHTML;f=c.getElementsByTagName("switch");counter=f.length;var L=mxUtils.bind(this,function(){counter--;0==counter&&k(c)}),Q={},V={},K=[];for(E=0;E<f.length;E++)mxUtils.bind(this,function(fa){var aa=fa.getElementsByTagName("div");if(0<aa.length)try{var da=aa[0].cloneNode(!0),ba=parseInt(da.style.marginLeft),ha=parseInt(da.style.paddingTop),qa=da.getElementsByTagName("div")[1],ra=aa=!1,l=da.style.alignItems,t=da.style.justifyContent;if(null!=da.style.writingMode){var H=da.style.writingMode;ra="vertical-"==H.substring(0,9);aa="-rl"==H.substring(H.length-3)}var J=!ra&&"1px"==da.style.width||ra&&"1px"==da.style.height;if(!ra&&"1px"==da.style.height||ra&&"1px"==da.style.width)da.style.alignItems=ra&&aa?"unsafe flex-end":"unsafe flex-start";J&&(da.style.justifyContent="unsafe flex-start");da.style.paddingTop="";da.style.marginLeft="";var R=da.outerHTML,T=Q[R];null==T&&(da.style.position="absolute",da.style.visibility="hidden",document.body.appendChild(da),H=1,H="1px"==da.style.width?qa.offsetWidth:parseInt(da.style.width),J=1,J="1px"==da.style.height?qa.offsetHeight:parseInt(da.style.height),document.body.removeChild(da),T=new mxRectangle(ba,ha,H,J),Q[R]=T);"1px"==da.style.height&&("unsafe center"==l?ha-=T.height/2:"unsafe flex-end"==l&&(ha-=T.height));if("1px"==da.style.width)if(!ra&&"unsafe center"==t||ra&&"unsafe center"==l)ba-=T.width/2;else if(!ra&&"unsafe flex-end"==t||ra&&(!aa&&"unsafe flex-end"==l||aa&&"unsafe flex-start"==l))ba-=T.width;T=new mxRectangle(ba,ha,T.width,T.height+parseInt(qa.style.fontSize)/4);K.push(mxUtils.bind(this,function(Y){var Z=-V[R];null==Z?Graph.htmlToPng(R,T.width,T.height,mxUtils.bind(this,function(ia){q(fa,ba,ha,T,ia);V[R]=ia;Y()}),B):(q(fa,ba,ha,T,Z),Y())}))}catch(Y){L()}else L()})(f[E]);0==counter&&k(c);E=0;x()};EditorUi.prototype.addRadiobox=function(c,f,k,q,x,B,E){return this.addCheckbox(c,k,q,x,B,E,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,k,q,x,B,E,L,Q){B=null!=B?B:!0;var V=document.createElement("input");V.style.marginRight="8px";V.setAttribute("type",E?"radio":"checkbox");E="geCheckbox-"+Editor.guid();-V.id=E;null!=L&&V.setAttribute("name",L);k&&(V.setAttribute("checked","checked"),V.defaultChecked=!0);q&&V.setAttribute("disabled","disabled");B&&(Q?(x=document.createElement("div"),x.className="geDialogCheckRow",x.appendChild(V),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",E),x.appendChild(k),c.appendChild(x),V.checkRow=x):(V.style.marginTop="16px",c.appendChild(V),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",E),c.appendChild(k),x||mxUtils.br(c)));-return V};EditorUi.prototype.addAdvancedSection=function(c,f){var k=document.createElement("div");k.className="geCollapsibleTitle";mxUtils.write(k,mxResources.get(f||"advanced"));var q=document.createElement("div");q.className="geCollapsibleContent geCollapsed";f=document.createElement("div");f.className="geDialogSection";q.appendChild(f);var x=function(B){if(B!==k.classList.contains("geExpanded")&&(k.classList.toggle("geExpanded"),q.classList.toggle("geCollapsed"),B=k.closest(".geDialog"),null!=-B)){var E=B.firstElementChild;null!=E&&(B.style.height="",B.style.height=E.scrollHeight+48+"px")}};mxEvent.addListener(k,"click",function(){x(!k.classList.contains("geExpanded"))});c.appendChild(k);c.appendChild(q);return{content:f,wrapper:q,expand:function(){x(!0)},collapse:function(){x(!1)},isExpanded:function(){return k.classList.contains("geExpanded")}}};EditorUi.prototype.addEditButton=function(c,f){var k=document.createElement("div");k.className="geDialogCheckRow";var q=document.createElement("span");-q.className="geDialogFormLabel";q.style.display="flex";q.style.alignItems="center";var x=this.addCheckbox(q,mxResources.get("edit")+":",!0,null,!0);x.style.marginTop="0px";k.appendChild(q);q=this.getCurrentFile();var B="";null!=q&&q.getMode()!=App.MODE_DEVICE&&q.getMode()!=App.MODE_BROWSER&&(B=window.location.href);var E=document.createElement("select");E.style.maxWidth="200px";E.className="geBtn";q=document.createElement("option");q.setAttribute("value","blank");mxUtils.write(q,mxResources.get("makeCopy"));-E.appendChild(q);var L=document.createElement("option");L.setAttribute("value","custom");mxUtils.write(L,mxResources.get("custom")+"...");E.appendChild(L);k.appendChild(E);c.appendChild(k);mxEvent.addListener(E,"change",mxUtils.bind(this,function(){if("custom"==E.value){var Q=new FilenameDialog(this,B,mxResources.get("ok"),function(V){null!=V?(B=V,L.setAttribute("title",V),E.setAttribute("title",V)):(E.value="blank",L.removeAttribute("title"),E.removeAttribute("title"))},mxResources.get("url"),null,-null,null,null,function(){E.value="blank"});this.showDialog(Q.container,300,80,!0,!1);Q.init()}else E.removeAttribute("title")}));mxEvent.addListener(x,"change",mxUtils.bind(this,function(){x.checked&&(null==f||f.checked)?E.removeAttribute("disabled"):E.setAttribute("disabled","disabled")}));return{getLink:function(){return x.checked?"blank"===E.value?"_blank":B:null},getEditInput:function(){return x},getEditSelect:function(){return E},getEditRow:function(){return k}}};EditorUi.prototype.addLinkSection=+V[R];null==Z?Graph.htmlToPng(R,T.width,T.height,mxUtils.bind(this,function(ia){q(fa,ba,ha,T,ia);V[R]=ia;Y()}),C):(q(fa,ba,ha,T,Z),Y())}))}catch(Y){L()}else L()})(f[E]);0==counter&&k(c);E=0;x()};EditorUi.prototype.addRadiobox=function(c,f,k,q,x,C,E){return this.addCheckbox(c,k,q,x,C,E,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,k,q,x,C,E,L,Q){C=null!=C?C:!0;var V=document.createElement("input");V.style.marginRight="8px";V.setAttribute("type",E?"radio":"checkbox");E="geCheckbox-"+Editor.guid();+V.id=E;null!=L&&V.setAttribute("name",L);k&&(V.setAttribute("checked","checked"),V.defaultChecked=!0);q&&V.setAttribute("disabled","disabled");C&&(Q?(x=document.createElement("div"),x.className="geDialogCheckRow",x.appendChild(V),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",E),x.appendChild(k),c.appendChild(x),V.checkRow=x):(V.style.marginTop="16px",c.appendChild(V),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",E),c.appendChild(k),x||mxUtils.br(c)));+return V};EditorUi.prototype.addAdvancedSection=function(c,f){var k=document.createElement("div");k.className="geCollapsibleTitle";mxUtils.write(k,mxResources.get(f||"advanced"));var q=document.createElement("div");q.className="geCollapsibleContent geCollapsed";f=document.createElement("div");f.className="geDialogSection";q.appendChild(f);var x=function(C){if(C!==k.classList.contains("geExpanded")&&(k.classList.toggle("geExpanded"),q.classList.toggle("geCollapsed"),C=k.closest(".geDialog"),null!=+C)){var E=C.firstElementChild;null!=E&&(C.style.height="",C.style.height=E.scrollHeight+48+"px")}};mxEvent.addListener(k,"click",function(){x(!k.classList.contains("geExpanded"))});c.appendChild(k);c.appendChild(q);return{content:f,wrapper:q,expand:function(){x(!0)},collapse:function(){x(!1)},isExpanded:function(){return k.classList.contains("geExpanded")}}};EditorUi.prototype.addEditButton=function(c,f){var k=document.createElement("div");k.className="geDialogCheckRow";var q=document.createElement("span");+q.className="geDialogFormLabel";q.style.display="flex";q.style.alignItems="center";var x=this.addCheckbox(q,mxResources.get("edit")+":",!0,null,!0);x.style.marginTop="0px";k.appendChild(q);q=this.getCurrentFile();var C="";null!=q&&q.getMode()!=App.MODE_DEVICE&&q.getMode()!=App.MODE_BROWSER&&(C=window.location.href);var E=document.createElement("select");E.style.maxWidth="200px";E.className="geBtn";q=document.createElement("option");q.setAttribute("value","blank");mxUtils.write(q,mxResources.get("makeCopy"));+E.appendChild(q);var L=document.createElement("option");L.setAttribute("value","custom");mxUtils.write(L,mxResources.get("custom")+"...");E.appendChild(L);k.appendChild(E);c.appendChild(k);mxEvent.addListener(E,"change",mxUtils.bind(this,function(){if("custom"==E.value){var Q=new FilenameDialog(this,C,mxResources.get("ok"),function(V){null!=V?(C=V,L.setAttribute("title",V),E.setAttribute("title",V)):(E.value="blank",L.removeAttribute("title"),E.removeAttribute("title"))},mxResources.get("url"),null,+null,null,null,function(){E.value="blank"});this.showDialog(Q.container,300,80,!0,!1);Q.init()}else E.removeAttribute("title")}));mxEvent.addListener(x,"change",mxUtils.bind(this,function(){x.checked&&(null==f||f.checked)?E.removeAttribute("disabled"):E.setAttribute("disabled","disabled")}));return{getLink:function(){return x.checked?"blank"===E.value?"_blank":C:null},getEditInput:function(){return x},getEditSelect:function(){return E},getEditRow:function(){return k}}};EditorUi.prototype.addLinkSection=function(c,f){function k(){var Q=document.createElement("div");Q.style.width="100%";Q.style.height="100%";Q.style.boxSizing="border-box";null!=E&&E!=mxConstants.NONE?(Q.style.border="1px solid black",Q.style.backgroundColor=E):(Q.style.backgroundPosition="center center",Q.style.backgroundRepeat="no-repeat",Q.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");L.innerText="";L.appendChild(Q)}var q=document.createElement("div");q.className="geDialogFormRow";var x=document.createElement("span");-x.className="geDialogFormLabel";mxUtils.write(x,mxResources.get("links")+":");q.appendChild(x);var B=document.createElement("select");B.style.width="100px";B.style.padding="0px";B.style.marginRight="10px";B.className="geBtn";x=document.createElement("option");x.setAttribute("value","auto");mxUtils.write(x,mxResources.get("automatic"));B.appendChild(x);x=document.createElement("option");x.setAttribute("value","blank");mxUtils.write(x,mxResources.get("openInNewWindow"));B.appendChild(x);x=document.createElement("option");-x.setAttribute("value","self");mxUtils.write(x,mxResources.get("openInThisWindow"));B.appendChild(x);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),B.appendChild(f));q.appendChild(B);f=document.createElement("span");mxUtils.write(f,mxResources.get("borderColor")+":");q.appendChild(f);var E="#0000ff",L=null;L=mxUtils.button("",mxUtils.bind(this,function(Q){this.pickColor(E||"none",function(V){E=-V;k()});mxEvent.consume(Q)}));k();L.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";L.style.marginLeft="4px";L.style.height="22px";L.style.width="22px";L.style.position="relative";L.style.top="1px";L.className="geColorBtn";q.appendChild(L);c.appendChild(q);return{getColor:function(){return E},getTarget:function(){return B.value},focus:function(){B.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,k,q,x,B,E,L){B=null!=B?B:[];k&&(B.push("lightbox=1"),"auto"!=c&&B.push("target="+c),-null!=f&&f!=mxConstants.NONE&&B.push("highlight="+("#"==f.charAt(0)?f.substring(1):f)),null!=q&&0<q.length&&B.push("edit="+encodeURIComponent(q)),x&&B.push("layers=1"),E&&B.push("link-icons=1"),L&&B.push("tooltip-icons=1"),this.editor.graph.foldingEnabled&&B.push("nav=1"));return B};EditorUi.prototype.createLink=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba){var ha=this.getCurrentFile();Q=this.createUrlParameters(c,f,q,x,B,Q,da,ba);c=!0;null!=E?k="#U"+encodeURIComponent(E):L||null==ha||""==ha.getHash()?+x.className="geDialogFormLabel";mxUtils.write(x,mxResources.get("links")+":");q.appendChild(x);var C=document.createElement("select");C.style.width="100px";C.style.padding="0px";C.style.marginRight="10px";C.className="geBtn";x=document.createElement("option");x.setAttribute("value","auto");mxUtils.write(x,mxResources.get("automatic"));C.appendChild(x);x=document.createElement("option");x.setAttribute("value","blank");mxUtils.write(x,mxResources.get("openInNewWindow"));C.appendChild(x);x=document.createElement("option");+x.setAttribute("value","self");mxUtils.write(x,mxResources.get("openInThisWindow"));C.appendChild(x);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),C.appendChild(f));q.appendChild(C);f=document.createElement("span");mxUtils.write(f,mxResources.get("borderColor")+":");q.appendChild(f);var E="#0000ff",L=null;L=mxUtils.button("",mxUtils.bind(this,function(Q){this.pickColor(E||"none",function(V){E=+V;k()});mxEvent.consume(Q)}));k();L.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";L.style.marginLeft="4px";L.style.height="22px";L.style.width="22px";L.style.position="relative";L.style.top="1px";L.className="geColorBtn";q.appendChild(L);c.appendChild(q);return{getColor:function(){return E},getTarget:function(){return C.value},focus:function(){C.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,k,q,x,C,E,L){C=null!=C?C:[];k&&(C.push("lightbox=1"),"auto"!=c&&C.push("target="+c),+null!=f&&f!=mxConstants.NONE&&C.push("highlight="+("#"==f.charAt(0)?f.substring(1):f)),null!=q&&0<q.length&&C.push("edit="+encodeURIComponent(q)),x&&C.push("layers=1"),E&&C.push("link-icons=1"),L&&C.push("tooltip-icons=1"),this.editor.graph.foldingEnabled&&C.push("nav=1"));return C};EditorUi.prototype.createLink=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba){var ha=this.getCurrentFile();Q=this.createUrlParameters(c,f,q,x,C,Q,da,ba);c=!0;null!=E?k="#U"+encodeURIComponent(E):L||null==ha||""==ha.getHash()?k="#R"+encodeURIComponent(k?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(k="#"+ha.getHash(),c=!1);c&&null!=ha&&null!=ha.getTitle()&&ha.getTitle()!=this.defaultFilename&&Q.push("title="+encodeURIComponent(ha.getTitle()));V&&1<k.length&&(Q.push("open="+k.substring(1)),k="");V=1==K?this.currentPage:K;null!=V&&"function"===typeof V.getId&&Q.push("page-id="+V.getId());fa&&Q.push("transparent=1");null!=aa&&Q.push("dark="+aa);return(q&&-(null!=E||null!=ha&&ha.getMode()!=App.MODE_GITHUB&&ha.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<Q.length?"?"+Q.join("&"):"")+k};EditorUi.prototype.createHtml=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba,ha){this.getBasenames();var qa={};ba&&(qa["show-link-icons"]=!0);ha&&(qa["show-tooltip-icons"]=!0);""!=x&&x!=mxConstants.NONE&&(qa.highlight=+(null!=E||null!=ha&&ha.getMode()!=App.MODE_GITHUB&&ha.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<Q.length?"?"+Q.join("&"):"")+k};EditorUi.prototype.createHtml=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba,ha){this.getBasenames();var qa={};ba&&(qa["show-link-icons"]=!0);ha&&(qa["show-tooltip-icons"]=!0);""!=x&&x!=mxConstants.NONE&&(qa.highlight=x);"auto"!==q&&(qa.target=q);V||(qa.lightbox=!1);qa.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==k||(qa.zoom=k/100);k=[];E&&(k.push("pages"),qa.resize=!0,null!=this.pages&&null!=this.currentPage&&(qa.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(k.push("zoom"),qa.resize=!0);L&&k.push("layers");Q&&(k.push("tags"),da&&(f=this.getHiddenTagsMap(),null!=f&&(qa.hiddenTags=f)));null!=aa&&(qa["dark-mode"]=aa);0<k.length&&(V&&k.push("lightbox"),qa.toolbar=k.join(" "));null!=-K&&0<K.length&&(qa.edit=K);null!=c?qa.url=c:qa.xml=this.getFileData(!0,null,null,null,null,!E);B='<div class="mxgraph" style="'+(B?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(qa))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";fa(B,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":+K&&0<K.length&&(qa.edit=K);null!=c?qa.url=c:qa.xml=this.getFileData(!0,null,null,null,null,!E);C='<div class="mxgraph" style="'+(C?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(qa))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";fa(C,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.addPagesRow=function(c){var f=document.createElement("select");f.style.maxWidth="260px";var k=document.createElement("option");mxUtils.write(k,mxResources.get("allPages"));k.setAttribute("value","allPages");f.appendChild(k);k=document.createElement("option");mxUtils.write(k,mxResources.get("currentPage"));k.setAttribute("value","currentPage");f.appendChild(k);k=-null;if(null!=this.pages&&1<this.pages.length){k=document.createElement("div");k.className="geDialogFormRow";var q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("pages")+":");k.appendChild(q);k.appendChild(f);c.appendChild(k)}return{row:k,select:f}};EditorUi.prototype.showHtmlDialog=function(c,f,k,q){var x=document.createElement("div");x.style.whiteSpace="nowrap";var B=document.createElement("h3");mxUtils.write(B,mxResources.get("html"));x.appendChild(B);-var E=document.createElement("select");E.className="geBtn";E.style.margin="0 4px 8px 4px";E.style.width="calc(100% - 8px)";E.style.boxSizing="border-box";B=document.createElement("option");mxUtils.write(B,mxResources.get("includeCopyOfMyDiagram"));B.setAttribute("value","copy");E.appendChild(B);B=document.createElement("option");B.setAttribute("value","url");E.appendChild(B);null!=k?(mxUtils.write(B,mxResources.get("publicDiagramUrl")),B.setAttribute("title",k)):(mxUtils.write(B,mxResources.get("publicDiagramUrl")+-" ("+mxResources.get("diagramIsNotPublic")+")"),B.setAttribute("disabled","disabled"));x.appendChild(E);mxUtils.br(x);var L=this.getCurrentFile();if(null==k&&null!=L&&L.constructor==window.DriveFile){B=document.createElement("div");B.style.marginBottom="8px";var Q=document.createElement("a");Q.style.color="gray";Q.style.cursor="pointer";mxUtils.write(Q,mxResources.get("share"));B.appendChild(Q);mxEvent.addListener(Q,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(L.getId(),-L)}));x.appendChild(B)}B=document.createElement("div");B.className="geDialogSection";var V=this.addLinkSection(B),K=this.addPagesRow(B);Q=document.createElement("div");Q.className="geDialogCheckRow";var fa=document.createElement("input");fa.setAttribute("type","checkbox");fa.setAttribute("checked","checked");fa.defaultChecked=!0;fa.style.marginRight="8px";Q.appendChild(fa);var aa=document.createElement("label");mxUtils.write(aa,mxResources.get("zoom")+":");Q.appendChild(aa);var da=document.createElement("input");-da.setAttribute("type","text");da.style.width="60px";da.style.marginLeft="4px";da.value="100%";Q.appendChild(da);B.appendChild(Q);var ba=this.addCheckbox(B,mxResources.get("fit"),!0,null,null,null,null,null,!0),ha=this.addCheckbox(B,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);x.appendChild(B);B=this.addAdvancedSection(x).content;var qa=document.createElement("select");qa.style.maxWidth="260px";Q=document.createElement("option");Q.setAttribute("value","light");mxUtils.write(Q,mxResources.get("light"));+null;if(null!=this.pages&&1<this.pages.length){k=document.createElement("div");k.className="geDialogFormRow";var q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("pages")+":");k.appendChild(q);k.appendChild(f);c.appendChild(k)}return{row:k,select:f}};EditorUi.prototype.showHtmlDialog=function(c,f,k,q){var x=document.createElement("div");x.style.whiteSpace="nowrap";var C=document.createElement("h3");mxUtils.write(C,mxResources.get("html"));x.appendChild(C);+var E=document.createElement("select");E.className="geBtn";E.style.margin="0 4px 8px 4px";E.style.width="calc(100% - 8px)";E.style.boxSizing="border-box";C=document.createElement("option");mxUtils.write(C,mxResources.get("includeCopyOfMyDiagram"));C.setAttribute("value","copy");E.appendChild(C);C=document.createElement("option");C.setAttribute("value","url");E.appendChild(C);null!=k?(mxUtils.write(C,mxResources.get("publicDiagramUrl")),C.setAttribute("title",k)):(mxUtils.write(C,mxResources.get("publicDiagramUrl")++" ("+mxResources.get("diagramIsNotPublic")+")"),C.setAttribute("disabled","disabled"));x.appendChild(E);mxUtils.br(x);var L=this.getCurrentFile();if(null==k&&null!=L&&L.constructor==window.DriveFile){C=document.createElement("div");C.style.marginBottom="8px";var Q=document.createElement("a");Q.style.color="gray";Q.style.cursor="pointer";mxUtils.write(Q,mxResources.get("share"));C.appendChild(Q);mxEvent.addListener(Q,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(L.getId(),+L)}));x.appendChild(C)}C=document.createElement("div");C.className="geDialogSection";var V=this.addLinkSection(C),K=this.addPagesRow(C);Q=document.createElement("div");Q.className="geDialogCheckRow";var fa=document.createElement("input");fa.setAttribute("type","checkbox");fa.setAttribute("checked","checked");fa.defaultChecked=!0;fa.style.marginRight="8px";Q.appendChild(fa);var aa=document.createElement("label");mxUtils.write(aa,mxResources.get("zoom")+":");Q.appendChild(aa);var da=document.createElement("input");+da.setAttribute("type","text");da.style.width="60px";da.style.marginLeft="4px";da.value="100%";Q.appendChild(da);C.appendChild(Q);var ba=this.addCheckbox(C,mxResources.get("fit"),!0,null,null,null,null,null,!0),ha=this.addCheckbox(C,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);x.appendChild(C);C=this.addAdvancedSection(x).content;var qa=document.createElement("select");qa.style.maxWidth="260px";Q=document.createElement("option");Q.setAttribute("value","light");mxUtils.write(Q,mxResources.get("light"));qa.appendChild(Q);Q=document.createElement("option");Q.setAttribute("value","dark");mxUtils.write(Q,mxResources.get("dark"));qa.appendChild(Q);Q=document.createElement("option");Q.setAttribute("value","auto");mxUtils.write(Q,mxResources.get("automatic"));Q.setAttribute("selected","selected");qa.appendChild(Q);Q=document.createElement("div");Q.className="geDialogFormRow";aa=document.createElement("span");aa.className="geDialogFormLabel";mxUtils.write(aa,mxResources.get("appearance")+":");Q.appendChild(aa);-Q.appendChild(qa);B.appendChild(Q);var ra=null;if(EditorUi.enableHtmlEditOption){ra=this.addEditButton(B,ha);var l=ra.getEditInput();mxEvent.addListener(ha,"change",function(){ha.checked?l.removeAttribute("disabled"):l.setAttribute("disabled","disabled");l.checked&&ha.checked?ra.getEditSelect().removeAttribute("disabled"):ra.getEditSelect().setAttribute("disabled","disabled")})}var t=this.addCheckbox(B,mxResources.get("layers"),!0,null,null,null,null,null,!0),H=this.addCheckbox(B,mxResources.get("tags"),-!0,null,null,null,null,null,!0),J=this.addCheckbox(B,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);J.checkRow.style.paddingLeft="24px";var R=this.addCheckbox(B,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),T=this.addCheckbox(B,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(H,"change",function(){H.checked?J.removeAttribute("disabled"):J.setAttribute("disabled","disabled")});mxEvent.addListener(ha,"change",function(){ha.checked?+Q.appendChild(qa);C.appendChild(Q);var ra=null;if(EditorUi.enableHtmlEditOption){ra=this.addEditButton(C,ha);var l=ra.getEditInput();mxEvent.addListener(ha,"change",function(){ha.checked?l.removeAttribute("disabled"):l.setAttribute("disabled","disabled");l.checked&&ha.checked?ra.getEditSelect().removeAttribute("disabled"):ra.getEditSelect().setAttribute("disabled","disabled")})}var t=this.addCheckbox(C,mxResources.get("layers"),!0,null,null,null,null,null,!0),H=this.addCheckbox(C,mxResources.get("tags"),+!0,null,null,null,null,null,!0),J=this.addCheckbox(C,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);J.checkRow.style.paddingLeft="24px";var R=this.addCheckbox(C,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),T=this.addCheckbox(C,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(H,"change",function(){H.checked?J.removeAttribute("disabled"):J.setAttribute("disabled","disabled")});mxEvent.addListener(ha,"change",function(){ha.checked?(R.removeAttribute("disabled"),T.removeAttribute("disabled")):(R.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled"))});c=new CustomDialog(this,x,mxUtils.bind(this,function(){q("url"==E.value?k:null,fa.checked,da.value,V.getTarget(),V.getColor(),ba.checked,null!=K.row&&"allPages"==K.select.value,t.checked,H.checked,ha.checked,null!=ra?ra.getLink():null,null!=qa?qa.value:null,H.checked&&J.checked,R.checked,T.checked)}),null,c,f);this.showDialog(c.container,360,null,!0,!0);E.focus()};-EditorUi.prototype.showPublishLinkDialog=function(c,f,k,q,x,B,E,L,Q,V,K,fa){var aa=document.createElement("div");aa.style.whiteSpace="nowrap";var da=document.createElement("h3");mxUtils.write(da,c||mxResources.get("publish"));aa.appendChild(da);var ba=document.createElement("select");ba.className="geBtn";ba.style.margin="0 4px 8px 4px";ba.style.width="calc(100% - 8px)";ba.style.boxSizing="border-box";x=null!=x?x:"https://www.drawio.com/docs/manual/export/publish-link/";c=document.createElement("option");+EditorUi.prototype.showPublishLinkDialog=function(c,f,k,q,x,C,E,L,Q,V,K,fa){var aa=document.createElement("div");aa.style.whiteSpace="nowrap";var da=document.createElement("h3");mxUtils.write(da,c||mxResources.get("publish"));aa.appendChild(da);var ba=document.createElement("select");ba.className="geBtn";ba.style.margin="0 4px 8px 4px";ba.style.width="calc(100% - 8px)";ba.style.boxSizing="border-box";x=null!=x?x:"https://www.drawio.com/docs/manual/export/publish-link/";c=document.createElement("option");mxUtils.write(c,mxResources.get("includeCopyOfMyDiagram"));c.setAttribute("value","copy");ba.appendChild(c);c=document.createElement("option");mxUtils.write(c,mxResources.get("authorizationRequired"));c.setAttribute("value","auth");ba.appendChild(c);null==L||""==L.getHash()||L.getMode()==App.MODE_DEVICE||L.getMode()==App.MODE_BROWSER?c.setAttribute("disabled","disabled"):ba.value="auth";L=document.createElement("option");L.setAttribute("value","public");ba.appendChild(L);null!=E?(mxUtils.write(L,mxResources.get("publicDiagramUrl")),L.setAttribute("title",E),ba.value="public"):(mxUtils.write(L,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),L.setAttribute("disabled","disabled"));aa.appendChild(ba);mxUtils.br(aa);E=document.createElement("div");E.className="geDialogSection";var ha=null,qa=null;if(null!=f||null!=k)f=document.createElement("div"),f.className="geDialogInlineFields",L=document.createElement("div"),L.className="geDialogInlineField",c=document.createElement("label"),mxUtils.write(c,mxResources.get("width")+":"),L.appendChild(c),ha=document.createElement("input"),ha.setAttribute("type","text"),ha.value="100%",L.appendChild(ha),f.appendChild(L),L=document.createElement("div"),L.className="geDialogInlineField",c=document.createElement("label"),mxUtils.write(c,mxResources.get("height")+":"),L.appendChild(c),qa=document.createElement("input"),qa.setAttribute("type","text"),qa.value=k+"px",L.appendChild(qa),f.appendChild(L),E.appendChild(f);var ra=this.addLinkSection(E,@@ -4179,225 +4182,225 @@ q),l=V?this.addCheckbox(E,mxResources.get("transparentBackground"),!1,null,null,":");k.appendChild(V);J=document.createElement("select");J.style.maxWidth="260px";for(V=0;V<this.pages.length;V++)fa=document.createElement("option"),mxUtils.write(fa,this.pages[V].getName()),fa.setAttribute("value",V),this.pages[V]==this.currentPage&&fa.setAttribute("selected","selected"),J.appendChild(fa);k.appendChild(J);E.appendChild(k);k=function(){"none"!=t.row.style.display&&"currentPage"==H.value?J.setAttribute("disabled","disabled"):J.removeAttribute("disabled")};mxEvent.addListener(H,"change",k);mxEvent.addListener(ba,"change",k);k()}var R=this.addCheckbox(E,mxResources.get("lightbox"),!0,null,null,!q,null,null,!0);q&&null!=R.checkRow&&(R.checkRow.style.display="none");aa.appendChild(E);q=this.addAdvancedSection(aa).content;var T=document.createElement("select");T.style.maxWidth="260px";k=document.createElement("option");k.setAttribute("value","0");mxUtils.write(k,mxResources.get("light"));T.appendChild(k);k=document.createElement("option");k.setAttribute("value","1");mxUtils.write(k,mxResources.get("dark"));T.appendChild(k);k=document.createElement("option");k.setAttribute("value","auto");mxUtils.write(k,mxResources.get("automatic"));k.setAttribute("selected","selected");T.appendChild(k);K&&(K=document.createElement("div"),K.className="geDialogFormRow",k=document.createElement("span"),k.className="geDialogFormLabel",mxUtils.write(k,mxResources.get("appearance")+":"),K.appendChild(k),K.appendChild(T),q.appendChild(K));var Y=this.addEditButton(q,R),Z=Y.getEditInput(),ia=this.addCheckbox(q,-mxResources.get("layers"),!0,null,null,null,null,null,!0),ka=this.addCheckbox(q,mxResources.get("tags"),!0,null,null,null,null,null,!0),X=this.addCheckbox(q,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);X.checkRow.style.paddingLeft="24px";var ja=this.addCheckbox(q,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),na=this.addCheckbox(q,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(ka,"change",function(){ka.checked?X.removeAttribute("disabled"):-X.setAttribute("disabled","disabled")});mxEvent.addListener(R,"change",function(){R.checked?(ia.removeAttribute("disabled"),Z.removeAttribute("disabled"),ka.removeAttribute("disabled"),ja.removeAttribute("disabled"),na.removeAttribute("disabled"),ka.checked&&X.removeAttribute("disabled")):(ia.setAttribute("disabled","disabled"),Z.setAttribute("disabled","disabled"),ka.setAttribute("disabled","disabled"),X.setAttribute("disabled","disabled"),ja.setAttribute("disabled","disabled"),na.setAttribute("disabled",-"disabled"));Z.checked&&R.checked?Y.getEditSelect().removeAttribute("disabled"):Y.getEditSelect().setAttribute("disabled","disabled")});x=new CustomDialog(this,aa,mxUtils.bind(this,function(){Q(ra.getTarget(),ra.getColor(),null==J||0>=J.selectedIndex||null!=J.getAttribute("disabled")?null:this.pages[J.selectedIndex],R.checked,Y.getLink(),ia.checked,null!=ha?ha.value:null,null!=qa?qa.value:null,ka.checked,ba.value,null!=l?l.checked:!1,T.value,"allPages"==H.value,ka.checked&&X.checked,ja.checked,na.checked)}),-null,mxResources.get("create"),x,B);this.showDialog(x.container,360,null,!0,!0);null!=ha?(ha.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ha.select():document.execCommand("selectAll",!1,null)):ba.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,k,q,x){var B=document.createElement("div");B.style.whiteSpace="nowrap";var E=document.createElement("h3");mxUtils.write(E,mxResources.get("image"));B.appendChild(E);if(x){E=document.createElement("div");E.className="geDialogSection";+mxResources.get("layers"),!0,null,null,null,null,null,!0),ja=this.addCheckbox(q,mxResources.get("tags"),!0,null,null,null,null,null,!0),X=this.addCheckbox(q,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);X.checkRow.style.paddingLeft="24px";var ka=this.addCheckbox(q,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),na=this.addCheckbox(q,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(ja,"change",function(){ja.checked?X.removeAttribute("disabled"):+X.setAttribute("disabled","disabled")});mxEvent.addListener(R,"change",function(){R.checked?(ia.removeAttribute("disabled"),Z.removeAttribute("disabled"),ja.removeAttribute("disabled"),ka.removeAttribute("disabled"),na.removeAttribute("disabled"),ja.checked&&X.removeAttribute("disabled")):(ia.setAttribute("disabled","disabled"),Z.setAttribute("disabled","disabled"),ja.setAttribute("disabled","disabled"),X.setAttribute("disabled","disabled"),ka.setAttribute("disabled","disabled"),na.setAttribute("disabled",+"disabled"));Z.checked&&R.checked?Y.getEditSelect().removeAttribute("disabled"):Y.getEditSelect().setAttribute("disabled","disabled")});x=new CustomDialog(this,aa,mxUtils.bind(this,function(){Q(ra.getTarget(),ra.getColor(),null==J||0>=J.selectedIndex||null!=J.getAttribute("disabled")?null:this.pages[J.selectedIndex],R.checked,Y.getLink(),ia.checked,null!=ha?ha.value:null,null!=qa?qa.value:null,ja.checked,ba.value,null!=l?l.checked:!1,T.value,"allPages"==H.value,ja.checked&&X.checked,ka.checked,na.checked)}),+null,mxResources.get("create"),x,C);this.showDialog(x.container,360,null,!0,!0);null!=ha?(ha.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ha.select():document.execCommand("selectAll",!1,null)):ba.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,k,q,x){var C=document.createElement("div");C.style.whiteSpace="nowrap";var E=document.createElement("h3");mxUtils.write(E,mxResources.get("image"));C.appendChild(E);if(x){E=document.createElement("div");E.className="geDialogSection";var L=document.createElement("div");L.className="geDialogFormRow";var Q=document.createElement("span");Q.className="geDialogFormLabel";mxUtils.write(Q,mxResources.get("zoom")+":");L.appendChild(Q);var V=document.createElement("input");V.setAttribute("type","text");V.value=this.lastExportZoom||"100%";L.appendChild(V);E.appendChild(L);L=document.createElement("div");L.className="geDialogFormRow";Q=document.createElement("span");Q.className="geDialogFormLabel";mxUtils.write(Q,mxResources.get("borderWidth")+-":");L.appendChild(Q);var K=document.createElement("input");K.setAttribute("type","text");K.value=this.lastExportBorder||"0";L.appendChild(K);E.appendChild(L);B.appendChild(E)}E=document.createElement("div");E.className="geDialogSection";var fa=this.addCheckbox(E,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!this.editor.graph.isSelectionEmpty(),this.editor.graph.isSelectionEmpty(),null,null,null,null,!0),aa=q?null:this.addCheckbox(E,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram,-null,null,null,null,null,!0);L=this.editor.graph;var da=L.background==mxConstants.NONE||null==L.background,ba=q?null:this.addCheckbox(E,mxResources.get("transparentBackground"),null!=this.lastExportTransparent?this.lastExportTransparent:da,null,null,null,null,null,!0);B.appendChild(E);c=new CustomDialog(this,B,mxUtils.bind(this,function(){this.lastExportSelectionOnly=fa.checked;x&&(this.lastExportZoom=V.value,this.lastExportBorder=K.value);null!=ba&&(this.lastExportTransparent=ba.checked==da?null:-ba.checked);var ha=parseInt(V.value)/100||1,qa=parseInt(K.value)||0;k(!fa.checked,null!=aa?aa.checked:!1,null!=ba?ba.checked:!1,ha,qa)}),null,c,f);this.showDialog(c.container,340,null,!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,k,q,x,B,E,L,Q){function V(){return Math.max(0,parseFloat(ha.value)||100)/100}function K(){var Ta=V();za.value=Math.floor(na*Ta);sa.value=Math.floor(la*Ta)}E=null!=E?E:Editor.defaultIncludeDiagram;var fa=document.createElement("div");fa.style.whiteSpace="nowrap";+":");L.appendChild(Q);var K=document.createElement("input");K.setAttribute("type","text");K.value=this.lastExportBorder||"0";L.appendChild(K);E.appendChild(L);C.appendChild(E)}E=document.createElement("div");E.className="geDialogSection";var fa=this.addCheckbox(E,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!this.editor.graph.isSelectionEmpty(),this.editor.graph.isSelectionEmpty(),null,null,null,null,!0),aa=q?null:this.addCheckbox(E,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram,+null,null,null,null,null,!0);L=this.editor.graph;var da=L.background==mxConstants.NONE||null==L.background,ba=q?null:this.addCheckbox(E,mxResources.get("transparentBackground"),null!=this.lastExportTransparent?this.lastExportTransparent:da,null,null,null,null,null,!0);C.appendChild(E);c=new CustomDialog(this,C,mxUtils.bind(this,function(){this.lastExportSelectionOnly=fa.checked;x&&(this.lastExportZoom=V.value,this.lastExportBorder=K.value);null!=ba&&(this.lastExportTransparent=ba.checked==da?null:+ba.checked);var ha=parseInt(V.value)/100||1,qa=parseInt(K.value)||0;k(!fa.checked,null!=aa?aa.checked:!1,null!=ba?ba.checked:!1,ha,qa)}),null,c,f);this.showDialog(c.container,340,null,!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,k,q,x,C,E,L,Q){function V(){return Math.max(0,parseFloat(ha.value)||100)/100}function K(){var Ta=V();za.value=Math.floor(na*Ta);sa.value=Math.floor(la*Ta)}E=null!=E?E:Editor.defaultIncludeDiagram;var fa=document.createElement("div");fa.style.whiteSpace="nowrap";var aa=this.editor.graph,da=document.createElement("h3");mxUtils.write(da,c);fa.appendChild(da);c=document.createElement("div");c.className="geDialogSection";da=document.createElement("div");da.className="geDialogFormRow";var ba=document.createElement("span");ba.className="geDialogFormLabel";mxUtils.write(ba,mxResources.get("zoom")+":");da.appendChild(ba);var ha=document.createElement("input");ha.setAttribute("type","text");ha.value=this.lastExportZoom||"100%";da.appendChild(ha);c.appendChild(da);fa.appendChild(c);c=document.createElement("div");c.className="geDialogSection";var qa=this.addCheckbox(c,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!aa.isSelectionEmpty(),aa.isSelectionEmpty(),null,null,null,null,!0),ra=document.createElement("input");ra.setAttribute("disabled","disabled");ra.setAttribute("type","checkbox");var l=document.createElement("select");l.style.marginLeft="8px";var t=["selectionOnly","diagram","page"];da={};for(ba=0;ba<t.length;ba++)if(!aa.isSelectionEmpty()||-"selectionOnly"!=t[ba]){var H=document.createElement("option");mxUtils.write(H,mxResources.get(t[ba]));H.setAttribute("value",t[ba]);l.appendChild(H);da[t[ba]]=H}Q?(ba=document.createElement("div"),ba.className="geDialogFormRow",B=document.createElement("span"),B.className="geDialogFormLabel",mxUtils.write(B,mxResources.get("size")+":"),ba.appendChild(B),l.style.marginLeft="0",ba.appendChild(l),c.appendChild(ba),mxEvent.addListener(l,"change",function(){"selectionOnly"==l.value&&(qa.checked=!0)})):-B&&(B=document.createElement("div"),B.className="geDialogCheckRow",B.appendChild(ra),ba=document.createElement("label"),mxUtils.write(ba,mxResources.get("crop")),B.appendChild(ba),c.appendChild(B),mxEvent.addListener(qa,"change",function(){qa.checked?ra.removeAttribute("disabled"):ra.setAttribute("disabled","disabled")}));aa.isSelectionEmpty()?Q&&null!=qa.checkRow&&null!=qa.checkRow.parentNode&&qa.checkRow.parentNode.removeChild(qa.checkRow):(l.value=this.lastExportSelectionOnly?"selectionOnly":"diagram",+"selectionOnly"!=t[ba]){var H=document.createElement("option");mxUtils.write(H,mxResources.get(t[ba]));H.setAttribute("value",t[ba]);l.appendChild(H);da[t[ba]]=H}Q?(ba=document.createElement("div"),ba.className="geDialogFormRow",C=document.createElement("span"),C.className="geDialogFormLabel",mxUtils.write(C,mxResources.get("size")+":"),ba.appendChild(C),l.style.marginLeft="0",ba.appendChild(l),c.appendChild(ba),mxEvent.addListener(l,"change",function(){"selectionOnly"==l.value&&(qa.checked=!0)})):+C&&(C=document.createElement("div"),C.className="geDialogCheckRow",C.appendChild(ra),ba=document.createElement("label"),mxUtils.write(ba,mxResources.get("crop")),C.appendChild(ba),c.appendChild(C),mxEvent.addListener(qa,"change",function(){qa.checked?ra.removeAttribute("disabled"):ra.setAttribute("disabled","disabled")}));aa.isSelectionEmpty()?Q&&null!=qa.checkRow&&null!=qa.checkRow.parentNode&&qa.checkRow.parentNode.removeChild(qa.checkRow):(l.value=this.lastExportSelectionOnly?"selectionOnly":"diagram",ra.setAttribute("checked","checked"),ra.defaultChecked=!0,mxEvent.addListener(qa,"change",function(){l.value=qa.checked?"selectionOnly":"diagram"}));var J=!aa.isSelectionEmpty()&&this.lastExportSelectionOnly?"selectionOnly":"diagram";Q&&null!=this.lastExportType&&null!=da[this.lastExportType]&&(l.value=this.lastExportType,"selectionOnly"==this.lastExportType&&(qa.checked=!0));var R="jpeg"!=L&&"webp"!=L,T=this.addCheckbox(c,mxResources.get("transparentBackground"),R&&null!=this.lastExportTransparent?-this.lastExportTransparent:!1,null,null,R,null,null,!0);fa.appendChild(c);c=document.createElement("div");c.className="geDialogSection";da=!1;B=null!=this.pages?this.pages.length:1;var Y=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram")+(1<B?":":""),E,null,null,"jpeg"!=L&&"webp"!=L,null,null,!0);"jpeg"!=L&&"webp"!=L&&(da=!0);var Z=document.createElement("select");Z.style.maxWidth="260px";if("png"==L||"svg"==L)E=function(){Y.checked?Z.removeAttribute("disabled"):Z.setAttribute("disabled",-"disabled")},ba=document.createElement("option"),ba.setAttribute("value","allPages"),mxUtils.write(ba,mxResources.get("allPages")),Z.appendChild(ba),ba=document.createElement("option"),ba.setAttribute("value","currentPage"),mxUtils.write(ba,mxResources.get("currentPage")),Z.appendChild(ba),1<B&&(B=document.createElement("div"),B.style.paddingLeft="24px",B.appendChild(Z),c.appendChild(B)),null!=this.lastEmbedInclude&&(Z.value=this.lastEmbedInclude),mxEvent.addListener(Y,"change",E),E();var ia=document.createElement("input");-ia.setAttribute("type","checkbox");ia.id="geCheckbox-"+Editor.guid();var ka=document.createElement("input");ka.setAttribute("type","checkbox");ka.id="geCheckbox-"+Editor.guid();var X=document.createElement("input");X.setAttribute("type","checkbox");X.id="geCheckbox-"+Editor.guid();var ja=document.createElement("select");ja.style.maxWidth="260px";E=document.createElement("option");E.setAttribute("value","auto");mxUtils.write(E,mxResources.get("automatic"));ja.appendChild(E);E=document.createElement("option");-E.setAttribute("value","blank");mxUtils.write(E,mxResources.get("openInNewWindow"));ja.appendChild(E);E=document.createElement("option");E.setAttribute("value","self");mxUtils.write(E,mxResources.get("openInThisWindow"));ja.appendChild(E);"svg"==L&&null!=this.lastExportLinkTarget&&(ja.value=this.lastExportLinkTarget,0>ja.selectedIndex&&(ja.value="auto"));B=document.createElement("div");mxUtils.write(B,mxResources.get("LinksLost"));B.style.margin="7px";B.style.display="none";da&&fa.appendChild(c);-E=this.addAdvancedSection(fa).content;c=aa.getGraphBounds();da=aa.view.scale;var na=Math.max(1,Math.ceil(c.width/da)),la=Math.max(1,Math.ceil(c.height/da)),va=!1;ba=document.createElement("div");ba.className="geDialogInlineFields";c=document.createElement("div");c.className="geDialogInlineField";da=document.createElement("label");mxUtils.write(da,mxResources.get("width")+":");c.appendChild(da);var za=document.createElement("input");za.setAttribute("type","number");za.value=Math.floor(na*V());c.appendChild(za);-ba.appendChild(c);c=document.createElement("div");c.className="geDialogInlineField";da=document.createElement("label");mxUtils.write(da,mxResources.get("height")+":");c.appendChild(da);var sa=document.createElement("input");sa.setAttribute("type","number");sa.value=Math.floor(la*V());c.appendChild(sa);ba.appendChild(c);E.appendChild(ba);mxEvent.addListener(ha,"change",function(){va=!0;ha.value=parseFloat((100*V()).toFixed(2))+"%";K()});mxEvent.addListener(za,"change",function(){var Ta=parseInt(za.value)/+this.lastExportTransparent:!1,null,null,R,null,null,!0);fa.appendChild(c);c=document.createElement("div");c.className="geDialogSection";da=!1;C=null!=this.pages?this.pages.length:1;var Y=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram")+(1<C?":":""),E,null,null,"jpeg"!=L&&"webp"!=L,null,null,!0);"jpeg"!=L&&"webp"!=L&&(da=!0);var Z=document.createElement("select");Z.style.maxWidth="260px";if("png"==L||"svg"==L)E=function(){Y.checked?Z.removeAttribute("disabled"):Z.setAttribute("disabled",+"disabled")},ba=document.createElement("option"),ba.setAttribute("value","allPages"),mxUtils.write(ba,mxResources.get("allPages")),Z.appendChild(ba),ba=document.createElement("option"),ba.setAttribute("value","currentPage"),mxUtils.write(ba,mxResources.get("currentPage")),Z.appendChild(ba),1<C&&(C=document.createElement("div"),C.style.paddingLeft="24px",C.appendChild(Z),c.appendChild(C)),null!=this.lastEmbedInclude&&(Z.value=this.lastEmbedInclude),mxEvent.addListener(Y,"change",E),E();var ia=document.createElement("input");+ia.setAttribute("type","checkbox");ia.id="geCheckbox-"+Editor.guid();var ja=document.createElement("input");ja.setAttribute("type","checkbox");ja.id="geCheckbox-"+Editor.guid();var X=document.createElement("input");X.setAttribute("type","checkbox");X.id="geCheckbox-"+Editor.guid();var ka=document.createElement("select");ka.style.maxWidth="260px";E=document.createElement("option");E.setAttribute("value","auto");mxUtils.write(E,mxResources.get("automatic"));ka.appendChild(E);E=document.createElement("option");+E.setAttribute("value","blank");mxUtils.write(E,mxResources.get("openInNewWindow"));ka.appendChild(E);E=document.createElement("option");E.setAttribute("value","self");mxUtils.write(E,mxResources.get("openInThisWindow"));ka.appendChild(E);"svg"==L&&null!=this.lastExportLinkTarget&&(ka.value=this.lastExportLinkTarget,0>ka.selectedIndex&&(ka.value="auto"));C=document.createElement("div");mxUtils.write(C,mxResources.get("LinksLost"));C.style.margin="7px";C.style.display="none";da&&fa.appendChild(c);+E=this.addAdvancedSection(fa).content;c=aa.getGraphBounds();da=aa.view.scale;var na=Math.max(1,Math.ceil(c.width/da)),la=Math.max(1,Math.ceil(c.height/da)),ua=!1;ba=document.createElement("div");ba.className="geDialogInlineFields";c=document.createElement("div");c.className="geDialogInlineField";da=document.createElement("label");mxUtils.write(da,mxResources.get("width")+":");c.appendChild(da);var za=document.createElement("input");za.setAttribute("type","number");za.value=Math.floor(na*V());c.appendChild(za);+ba.appendChild(c);c=document.createElement("div");c.className="geDialogInlineField";da=document.createElement("label");mxUtils.write(da,mxResources.get("height")+":");c.appendChild(da);var sa=document.createElement("input");sa.setAttribute("type","number");sa.value=Math.floor(la*V());c.appendChild(sa);ba.appendChild(c);E.appendChild(ba);mxEvent.addListener(ha,"change",function(){ua=!0;ha.value=parseFloat((100*V()).toFixed(2))+"%";K()});mxEvent.addListener(za,"change",function(){var Ta=parseInt(za.value)/na;0<Ta&&(ha.value=parseFloat((100*Ta).toFixed(2))+"%",sa.value=Math.floor(la*Ta))});mxEvent.addListener(sa,"change",function(){var Ta=parseInt(sa.value)/la;0<Ta&&(ha.value=parseFloat((100*Ta).toFixed(2))+"%",za.value=Math.floor(na*Ta))});var wa=document.createElement("select"),Ca=document.createElement("input");if("png"==L){c=["100","200","300","400"];for(ba=0;ba<c.length;ba++)da=document.createElement("option"),da.setAttribute("value",c[ba]),mxUtils.write(da,c[ba]+"dpi"),wa.appendChild(da);c=document.createElement("option");c.setAttribute("value","custom");mxUtils.write(c,mxResources.get("custom"));wa.appendChild(c);Ca.setAttribute("type","number");Ca.setAttribute("value","100");Ca.setAttribute("min","50");Ca.setAttribute("step","50");Ca.style.display="none";c=document.createElement("div");c.className="geDialogFormRow";da=document.createElement("span");da.className="geDialogFormLabel";mxUtils.write(da,mxResources.get("dpi")+":");c.appendChild(da);c.appendChild(wa);c.appendChild(Ca);E.appendChild(c);null!=this.lastExportDpi&&-(Ca.value=this.lastExportDpi,wa.value=this.lastExportDpi,0>wa.selectedIndex&&(wa.value="custom",wa.style.display="none",Ca.style.display=""));mxEvent.addListener(wa,"change",function(){"custom"==wa.value?(wa.style.display="none",Ca.style.display="",Ca.focus()):(Ca.value=wa.value,va||(ha.value=wa.value+"%",K()))});mxEvent.addListener(Ca,"change",function(){var Ta=parseInt(Ca.value);isNaN(Ta)||0>=Ta?Ca.style.backgroundColor="red":(Ca.style.backgroundColor="",va||(ha.value=Ta+"%",K()))})}c=document.createElement("div");+(Ca.value=this.lastExportDpi,wa.value=this.lastExportDpi,0>wa.selectedIndex&&(wa.value="custom",wa.style.display="none",Ca.style.display=""));mxEvent.addListener(wa,"change",function(){"custom"==wa.value?(wa.style.display="none",Ca.style.display="",Ca.focus()):(Ca.value=wa.value,ua||(ha.value=wa.value+"%",K()))});mxEvent.addListener(Ca,"change",function(){var Ta=parseInt(Ca.value);isNaN(Ta)||0>=Ta?Ca.style.backgroundColor="red":(Ca.style.backgroundColor="",ua||(ha.value=Ta+"%",K()))})}c=document.createElement("div");c.className="geDialogFormRow";da=document.createElement("span");da.className="geDialogFormLabel";mxUtils.write(da,mxResources.get("borderWidth")+":");c.appendChild(da);var Fa=document.createElement("input");Fa.setAttribute("type","text");Fa.value=this.lastExportBorder||"0";c.appendChild(Fa);E.appendChild(c);var Ha=document.createElement("select");Ha.style.maxWidth="260px";c=document.createElement("option");c.setAttribute("value","light");mxUtils.write(c,mxResources.get("light"));Ha.appendChild(c);c=document.createElement("option");c.setAttribute("value","dark");mxUtils.write(c,mxResources.get("dark"));Ha.appendChild(c);var Na=Editor.isDarkMode()?"dark":"light";"svg"==L&&mxUtils.lightDarkColorSupported&&(c=document.createElement("option"),c.setAttribute("value","auto"),mxUtils.write(c,mxResources.get("automatic")),Ha.appendChild(c),Na="auto");Ha.value=null!=this.lastExportTheme?this.lastExportTheme:Na;0>Ha.selectedIndex&&(Ha.value=Na);c=document.createElement("div");c.className="geDialogFormRow";-da=document.createElement("span");da.className="geDialogFormLabel";mxUtils.write(da,mxResources.get("appearance")+":");c.appendChild(da);c.appendChild(Ha);E.appendChild(c);"svg"==L&&(c=document.createElement("div"),c.className="geDialogFormRow",da=document.createElement("span"),da.className="geDialogFormLabel",mxUtils.write(da,mxResources.get("links")+":"),c.appendChild(da),c.appendChild(ja),E.appendChild(c),E.appendChild(B));var La=1==aa.shadowVisible,Da=this.addCheckbox(E,mxResources.get("shadow"),-null!=this.lastExportShadow?this.lastExportShadow:La,null,null,null,null,null,!0),Sa=null,Oa="svg"!=L&&(this.isOffline()||!Editor.canvasSupported);if("png"==L||"jpeg"==L||"webp"==L||"svg"==L)Sa=this.addCheckbox(E,mxResources.get("grid"),Oa||null==this.lastExportGrid?!1:this.lastExportGrid,Oa,!1,!0,null,null,!0);f&&(ia.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,B=document.createElement("div"),B.className="geDialogCheckRow",B.appendChild(ia),aa=document.createElement("label"),mxUtils.write(aa,-mxResources.get("embedImages")),aa.setAttribute("for",ia.id),B.appendChild(aa),E.appendChild(B),ka.checked=null!=this.lastEmbedFonts?this.lastEmbedFonts:Editor.embedSvgFonts,B=document.createElement("div"),B.className="geDialogCheckRow",B.appendChild(ka),aa=document.createElement("label"),mxUtils.write(aa,mxResources.get("embedFonts")),aa.setAttribute("for",ka.id),B.appendChild(aa),E.appendChild(B),X.checked=null!=this.lastEmbedCellMetadata?this.lastEmbedCellMetadata:!1,B=document.createElement("div"),-B.className="geDialogCheckRow",B.appendChild(X),aa=document.createElement("label"),mxUtils.write(aa,mxResources.get("embedCellMetadata")),aa.setAttribute("for",X.id),B.appendChild(aa),E.appendChild(B));k=new CustomDialog(this,fa,mxUtils.bind(this,function(){this.lastExportSelectionOnly=qa.checked;this.lastExportBorder=Fa.value;this.lastExportZoom=ha.value;R&&(this.lastExportTransparent=0==T.checked?null:T.checked);this.lastExportTheme=Ha.value==Na?null:Ha.value;this.lastExportShadow=Da.checked==La?-null:Da.checked;null==Sa||Oa||(this.lastExportGrid=Sa.checked?!0:null);"svg"==L&&(this.lastExportLinkTarget="auto"==ja.value?null:ja.value);if("png"==L){var Ta=parseInt(Ca.value);this.lastExportDpi=!isNaN(Ta)&&0<Ta&&100!=Ta?Ta:null}Q&&(this.lastExportType=l.value==J?null:l.value);f&&(this.lastEmbedImages=ia.checked,this.lastEmbedFonts=ka.checked,this.lastEmbedCellMetadata=X.checked);if("png"==L||"svg"==L)this.lastEmbedInclude=Z.value;null!=x&&x(ha.value,T.checked,!qa.checked,Da.checked,Y.checked,-ia.checked&&f,Fa.value,ra.checked,("png"==L||"svg"==L)&&"currentPage"==Z.value,ja.value,null!=Sa?Sa.checked:null,null!=Ha?Ha.value:null,l.value,ka.checked,X.checked&&f,"png"==L&&0<parseInt(Ca.value)&&100!=parseInt(Ca.value)?parseInt(Ca.value):null)}),null,k,q);this.showDialog(k.container,360,null,!0,!0,null,null,null,null,!0);ha.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ha.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,-f,k,q,x,B,E){var L=document.createElement("div"),Q=this.editor.graph;if(null!=f){var V=document.createElement("h3");mxUtils.write(V,f);L.appendChild(V)}f=document.createElement("div");f.className="geDialogSection";var K=E?this.addPagesRow(f):null,fa=this.addCheckbox(f,mxResources.get("fit"),!0,null,null,null,null,null,!0),aa=this.addCheckbox(f,mxResources.get("shadow"),Q.shadowVisible&&q,!q,null,null,null,null,!0),da=this.addCheckbox(f,k,!1,null,null,null,null,null,!0),ba=this.addCheckbox(f,mxResources.get("lightbox"),-!0,null,null,null,null,null,!0);L.appendChild(f);k=this.addAdvancedSection(L).content;var ha=null;B&&(ha=document.createElement("select"),ha.style.maxWidth="260px",B=document.createElement("option"),B.setAttribute("value","light"),mxUtils.write(B,mxResources.get("light")),ha.appendChild(B),B=document.createElement("option"),B.setAttribute("value","dark"),mxUtils.write(B,mxResources.get("dark")),ha.appendChild(B),mxUtils.lightDarkColorSupported?(B=document.createElement("option"),B.setAttribute("value",-"auto"),mxUtils.write(B,mxResources.get("automatic")),ha.appendChild(B),ha.value="auto"):ha.value=Editor.isDarkMode()?"dark":"light",B=document.createElement("div"),B.className="geDialogFormRow",q=document.createElement("span"),q.className="geDialogFormLabel",mxUtils.write(q,mxResources.get("appearance")+":"),B.appendChild(q),B.appendChild(ha),k.appendChild(B));var qa=this.addEditButton(k,ba),ra=qa.getEditInput(),l=1<Q.model.getChildCount(Q.model.getRoot()),t=this.addCheckbox(k,mxResources.get("layers"),+da=document.createElement("span");da.className="geDialogFormLabel";mxUtils.write(da,mxResources.get("appearance")+":");c.appendChild(da);c.appendChild(Ha);E.appendChild(c);"svg"==L&&(c=document.createElement("div"),c.className="geDialogFormRow",da=document.createElement("span"),da.className="geDialogFormLabel",mxUtils.write(da,mxResources.get("links")+":"),c.appendChild(da),c.appendChild(ka),E.appendChild(c),E.appendChild(C));var La=1==aa.shadowVisible,Da=this.addCheckbox(E,mxResources.get("shadow"),+null!=this.lastExportShadow?this.lastExportShadow:La,null,null,null,null,null,!0),Sa=null,Oa="svg"!=L&&(this.isOffline()||!Editor.canvasSupported);if("png"==L||"jpeg"==L||"webp"==L||"svg"==L)Sa=this.addCheckbox(E,mxResources.get("grid"),Oa||null==this.lastExportGrid?!1:this.lastExportGrid,Oa,!1,!0,null,null,!0);f&&(ia.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,C=document.createElement("div"),C.className="geDialogCheckRow",C.appendChild(ia),aa=document.createElement("label"),mxUtils.write(aa,+mxResources.get("embedImages")),aa.setAttribute("for",ia.id),C.appendChild(aa),E.appendChild(C),ja.checked=null!=this.lastEmbedFonts?this.lastEmbedFonts:Editor.embedSvgFonts,C=document.createElement("div"),C.className="geDialogCheckRow",C.appendChild(ja),aa=document.createElement("label"),mxUtils.write(aa,mxResources.get("embedFonts")),aa.setAttribute("for",ja.id),C.appendChild(aa),E.appendChild(C),X.checked=null!=this.lastEmbedCellMetadata?this.lastEmbedCellMetadata:!1,C=document.createElement("div"),+C.className="geDialogCheckRow",C.appendChild(X),aa=document.createElement("label"),mxUtils.write(aa,mxResources.get("embedCellMetadata")),aa.setAttribute("for",X.id),C.appendChild(aa),E.appendChild(C));k=new CustomDialog(this,fa,mxUtils.bind(this,function(){this.lastExportSelectionOnly=qa.checked;this.lastExportBorder=Fa.value;this.lastExportZoom=ha.value;R&&(this.lastExportTransparent=0==T.checked?null:T.checked);this.lastExportTheme=Ha.value==Na?null:Ha.value;this.lastExportShadow=Da.checked==La?+null:Da.checked;null==Sa||Oa||(this.lastExportGrid=Sa.checked?!0:null);"svg"==L&&(this.lastExportLinkTarget="auto"==ka.value?null:ka.value);if("png"==L){var Ta=parseInt(Ca.value);this.lastExportDpi=!isNaN(Ta)&&0<Ta&&100!=Ta?Ta:null}Q&&(this.lastExportType=l.value==J?null:l.value);f&&(this.lastEmbedImages=ia.checked,this.lastEmbedFonts=ja.checked,this.lastEmbedCellMetadata=X.checked);if("png"==L||"svg"==L)this.lastEmbedInclude=Z.value;null!=x&&x(ha.value,T.checked,!qa.checked,Da.checked,Y.checked,+ia.checked&&f,Fa.value,ra.checked,("png"==L||"svg"==L)&&"currentPage"==Z.value,ka.value,null!=Sa?Sa.checked:null,null!=Ha?Ha.value:null,l.value,ja.checked,X.checked&&f,"png"==L&&0<parseInt(Ca.value)&&100!=parseInt(Ca.value)?parseInt(Ca.value):null)}),null,k,q);this.showDialog(k.container,360,null,!0,!0,null,null,null,null,!0);ha.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ha.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,+f,k,q,x,C,E){var L=document.createElement("div"),Q=this.editor.graph;if(null!=f){var V=document.createElement("h3");mxUtils.write(V,f);L.appendChild(V)}f=document.createElement("div");f.className="geDialogSection";var K=E?this.addPagesRow(f):null,fa=this.addCheckbox(f,mxResources.get("fit"),!0,null,null,null,null,null,!0),aa=this.addCheckbox(f,mxResources.get("shadow"),Q.shadowVisible&&q,!q,null,null,null,null,!0),da=this.addCheckbox(f,k,!1,null,null,null,null,null,!0),ba=this.addCheckbox(f,mxResources.get("lightbox"),+!0,null,null,null,null,null,!0);L.appendChild(f);k=this.addAdvancedSection(L).content;var ha=null;C&&(ha=document.createElement("select"),ha.style.maxWidth="260px",C=document.createElement("option"),C.setAttribute("value","light"),mxUtils.write(C,mxResources.get("light")),ha.appendChild(C),C=document.createElement("option"),C.setAttribute("value","dark"),mxUtils.write(C,mxResources.get("dark")),ha.appendChild(C),mxUtils.lightDarkColorSupported?(C=document.createElement("option"),C.setAttribute("value",+"auto"),mxUtils.write(C,mxResources.get("automatic")),ha.appendChild(C),ha.value="auto"):ha.value=Editor.isDarkMode()?"dark":"light",C=document.createElement("div"),C.className="geDialogFormRow",q=document.createElement("span"),q.className="geDialogFormLabel",mxUtils.write(q,mxResources.get("appearance")+":"),C.appendChild(q),C.appendChild(ha),k.appendChild(C));var qa=this.addEditButton(k,ba),ra=qa.getEditInput(),l=1<Q.model.getChildCount(Q.model.getRoot()),t=this.addCheckbox(k,mxResources.get("layers"),l,!l,null,null,null,null,!0),H=this.addCheckbox(k,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),J=this.addCheckbox(k,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(ba,"change",function(){ba.checked?(l&&t.removeAttribute("disabled"),null!=K&&K.select.removeAttribute("disabled"),ra.removeAttribute("disabled"),H.removeAttribute("disabled"),J.removeAttribute("disabled")):(null!=K&&K.select.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"),ra.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"));ra.checked&&ba.checked?qa.getEditSelect().removeAttribute("disabled"):qa.getEditSelect().setAttribute("disabled","disabled")});x=new CustomDialog(this,L,mxUtils.bind(this,function(){c(fa.checked,aa.checked,da.checked,ba.checked,qa.getLink(),t.checked,H.checked,J.checked,null!=ha?ha.value:null,null!=K?null!=K.row&&"allPages"==K.select.value:null)}),null,mxResources.get("embed"),-x);this.showDialog(x.container,280,null,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,k,q,x,B,E,L,Q,V){function K(ha){var qa=" ",ra="";q&&(qa=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+-(null!=aa?"&page="+aa:"")+(x?"&edit=_blank":"")+(B?"&layers=1":"")+(E?"&link-icons=1":"")+(L?"&tooltip-icons=1":"")+"');}})(this);\"",ra+="cursor:pointer;");c&&(ra+="max-width:100%;");var l="";k&&(l=' width="'+Math.round(fa.width)+'" height="'+Math.round(fa.height)+'"');Q('<img src="'+ha+'"'+l+(""!=ra?' style="'+ra+'"':"")+qa+"/>")}var fa=this.editor.graph.getGraphBounds(),aa=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ha){var qa=+x);this.showDialog(x.container,280,null,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,k,q,x,C,E,L,Q,V){function K(ha){var qa=" ",ra="";q&&(qa=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"++(null!=aa?"&page="+aa:"")+(x?"&edit=_blank":"")+(C?"&layers=1":"")+(E?"&link-icons=1":"")+(L?"&tooltip-icons=1":"")+"');}})(this);\"",ra+="cursor:pointer;");c&&(ra+="max-width:100%;");var l="";k&&(l=' width="'+Math.round(fa.width)+'" height="'+Math.round(fa.height)+'"');Q('<img src="'+ha+'"'+l+(""!=ra?' style="'+ra+'"':"")+qa+"/>")}var fa=this.editor.graph.getGraphBounds(),aa=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ha){var qa=q?this.getFileData(!0):null;ha=this.createImageDataUri(ha,qa,"png");K(ha)}),null,null,null,mxUtils.bind(this,function(ha){V({message:mxResources.get("unknownError")})}),null,!0,k?2:1,null,f,null,null,Editor.defaultBorder);else if(f=this.getFileData(!0),fa.width*fa.height<=MAX_AREA&&f.length<=MAX_REQUEST_SIZE){var da="";k&&(da="&w="+Math.round(2*fa.width)+"&h="+Math.round(2*fa.height));var ba=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(q?"1":"0")+da+"&xml="+encodeURIComponent(f));-ba.send(mxUtils.bind(this,function(){200<=ba.getStatus()&&299>=ba.getStatus()?K("data:image/png;base64,"+ba.getText()):V({message:mxResources.get("unknownError")})}))}else V({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,f,k,q,x,B,E,L,Q,V,K){Q=null!=Q?Q:"auto";V=null!=V?V:!0;var fa=this.getSelectedPageIndex(),aa=mxUtils.lightDarkColorSupported,da=mxUtils.preferDarkColor;if("light"==Q||"dark"==Q)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor=+ba.send(mxUtils.bind(this,function(){200<=ba.getStatus()&&299>=ba.getStatus()?K("data:image/png;base64,"+ba.getText()):V({message:mxResources.get("unknownError")})}))}else V({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,f,k,q,x,C,E,L,Q,V,K){Q=null!=Q?Q:"auto";V=null!=V?V:!0;var fa=this.getSelectedPageIndex(),aa=mxUtils.lightDarkColorSupported,da=mxUtils.preferDarkColor;if("light"==Q||"dark"==Q)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==Q;var ba=null;try{ba=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k,Q)}finally{mxUtils.lightDarkColorSupported=aa,mxUtils.preferDarkColor=da}Q=ba.getElementsByTagName("a");if(null!=Q)for(aa=0;aa<Q.length;aa++)da=Q[aa].getAttribute("href"),null!=da&&"#"==da.charAt(0)&&"_blank"==Q[aa].getAttribute("target")&&Q[aa].removeAttribute("target");q&&ba.setAttribute("content",this.getFileData(!0,null,null,null,null,!V));f&&this.editor.graph.addSvgShadow(ba);if(k){var ha=-" ",qa="";q&&(ha="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(V&&null!=fa?"&page="+fa:"")+(x?"&edit=_blank":"")+(B?"&layers=1":"")+(E?"&link-icons=1":"")+(L?"&tooltip-icons=1":"")+"');}})(this);\"",+" ",qa="";q&&(ha="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(V&&null!=fa?"&page="+fa:"")+(x?"&edit=_blank":"")+(C?"&layers=1":"")+(E?"&link-icons=1":"")+(L?"&tooltip-icons=1":"")+"');}})(this);\"",qa+="cursor:pointer;");c&&(qa+="max-width:100%;");this.editor.convertImages(ba,mxUtils.bind(this,function(ra){K('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(ra))+'"'+(""!=qa?' style="'+qa+'"':"")+ha+"/>")}))}else qa="",q&&(ba.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(V&&null!=fa?"&page="+fa:"")+(x?"&edit=_blank":"")+(B?"&layers=1":"")+(E?"&link-icons=1":"")+(L?"&tooltip-icons=1":"")+"');}}})(this);"),qa+="cursor:pointer;"),c&&(c=parseInt(ba.getAttribute("width")),f=parseInt(ba.getAttribute("height")),ba.setAttribute("viewBox","-0.5 -0.5 "+c+" "+f),qa+="max-width:100%;max-height:"+f+"px;",ba.removeAttribute("height")),""!=qa&&(c=ba.getAttribute("style"),ba.setAttribute("style",(null!=c&&0<c.length?c+" ":"")+qa)),this.editor.addFontCss(ba),+EditorUi.lightboxHost+"/?client=1"+(V&&null!=fa?"&page="+fa:"")+(x?"&edit=_blank":"")+(C?"&layers=1":"")+(E?"&link-icons=1":"")+(L?"&tooltip-icons=1":"")+"');}}})(this);"),qa+="cursor:pointer;"),c&&(c=parseInt(ba.getAttribute("width")),f=parseInt(ba.getAttribute("height")),ba.setAttribute("viewBox","-0.5 -0.5 "+c+" "+f),qa+="max-width:100%;max-height:"+f+"px;",ba.removeAttribute("height")),""!=qa&&(c=ba.getAttribute("style"),ba.setAttribute("style",(null!=c&&0<c.length?c+" ":"")+qa)),this.editor.addFontCss(ba),this.editor.graph.mathEnabled&&this.editor.addMathCss(ba),K(mxUtils.getXml(ba))};EditorUi.prototype.timeSince=function(c){c=Math.floor((new Date-c)/1E3);var f=Math.floor(c/31536E3);if(1<f)return f+" "+mxResources.get("years");f=Math.floor(c/2592E3);if(1<f)return f+" "+mxResources.get("months");f=Math.floor(c/86400);if(1<f)return f+" "+mxResources.get("days");f=Math.floor(c/3600);if(1<f)return f+" "+mxResources.get("hours");f=Math.floor(c/60);return 1<f?f+" "+mxResources.get("minutes"):1==f?f+" "+-mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,f){if(null!=c){var k=null;if("diagram"==c.nodeName)k=c;else if("mxfile"==c.nodeName){var q=c.getElementsByTagName("diagram");if(0<q.length){k=q[0];var x=f.getGlobalVariable;f.getGlobalVariable=function(B){return"page"==B?k.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==B?1:x.apply(this,arguments)}}}null!=k&&(c=Editor.parseDiagramNode(k))}q=this.editor.graph;try{this.editor.graph=f,this.editor.setGraphXml(c)}catch(B){}finally{this.editor.graph=-q}return c};EditorUi.prototype.getSvgFileProperties=function(c){return this.getPngFileProperties(c)};EditorUi.prototype.getPngFileProperties=function(c){var f=1,k=0;if(null!=c){if(c.hasAttribute("scale")){var q=parseFloat(c.getAttribute("scale"));!isNaN(q)&&0<q&&(f=q)}c.hasAttribute("border")&&(q=parseInt(c.getAttribute("border")),!isNaN(q)&&0<q&&(k=q))}return{scale:f,border:k}};EditorUi.prototype.getEmbeddedPng=function(c,f,k,q,x){try{var B=this.editor.graph,E=null;if(null!=k&&0<k.length)B=this.createTemporaryGraph(B.getStylesheet()),-document.body.appendChild(B.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,!0),B),E=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){B=this.createTemporaryGraph(B.getStylesheet());var L=B.getGlobalVariable;B.setBackgroundImage=this.editor.graph.setBackgroundImage;var Q=this.pages[0];this.currentPage==Q?B.setBackgroundImage(this.editor.graph.backgroundImage):null!=Q.viewState&&null!=Q.viewState&&B.setBackgroundImage(Q.viewState.backgroundImage);-B.getGlobalVariable=function(V){return"page"==V?Q.getName():"pagenumber"==V?1:L.apply(this,arguments)};document.body.appendChild(B.container);B.model.setRoot(Q.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(V){try{null==E&&(E=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var K=V.toDataURL("image/png");K=Editor.writeGraphModelToPng(K,"tEXt","mxfile",encodeURIComponent(E));c(K.substring(K.lastIndexOf(",")+1));B!=this.editor.graph&&B.container.parentNode.removeChild(B.container)}catch(fa){null!=-f&&f(fa)}}),null,null,null,mxUtils.bind(this,function(V){null!=f&&f(V)}),null,null,q,null,B.shadowVisible,null,B,x,null,null,null,"diagram",null)}catch(V){null!=f&&f(V)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba){L=null!=L?L:!0;K=null!=K?K:0;E=null!=Q?Q:f.background;E==mxConstants.NONE&&(E=null);null==E&&"none"==f.getAdaptiveColors()&&(E="#ffffff");Q=this.editor.graph.createSvgImageExport(null!=c,da);var ha=Graph.addFont,qa=null;if(null==x){qa={};Graph.addFont=-function(J,R,T,Y){ha.call(this,J,R,T,qa)};var ra=Q.drawCellState;Q.drawCellState=function(J,R){null!=J&&Graph.processFontStyle(J.style);ra.apply(this,arguments)}}da=null;try{da=f.getSvg(E,V,K,null,null,B,null,Q,null,f.shadowVisible||fa,null,aa,"diagram")}finally{Graph.addFont=ha}(f.shadowVisible||fa)&&f.addSvgShadow(da,null,null,0==K);null!=c&&da.setAttribute("content",c);null!=k&&da.setAttribute("resource",k);var l=mxUtils.bind(this,function(J){J=(q?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+-"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(J);null!=x&&x(J);return J});f.mathEnabled&&this.editor.addMathCss(da);if(null!=x)this.embedFonts(da,mxUtils.bind(this,function(J){L?this.editor.convertImages(J,mxUtils.bind(this,function(R){l(R)})):l(J)}),ba);else{c=Graph.customFontElements;Graph.customFontElements=qa;try{var t=!1;this.embedFonts(da,function(){t=!0},ba);if(!t)try{null==this.editor.resolvedFontCss&&this.editor.addFontCss(da);var H=this.editor.graph.getExtFontCss();0<H.length&&this.editor.addFontCss(da,-H)}catch(J){}}finally{Graph.customFontElements=c}return l(da)}};EditorUi.prototype.embedFonts=function(c,f,k){if(k=null!=k?k:Editor.embedSvgFonts)this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(x){try{null!=x&&this.editor.addFontCss(c,x),f(c)}catch(B){f(c)}}))}catch(x){f(c)}}));else{try{this.editor.addFontCss(c);var q=this.editor.graph.getExtFontCss();-0<q.length&&this.editor.addFontCss(c,q)}catch(x){}f(c)}};EditorUi.prototype.exportImage=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa){Q=null!=Q?Q:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(ba){Editor.addRetryToError(ba,mxUtils.bind(this,function(){this.exportImage(c,f,k,q,x,B,E,L,Q,V,K,fa,aa)}));this.handleError(ba)}))){var da=this.editor.graph.isSelectionEmpty();k=null!=k?k:da;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,-function(ba){this.spinner.stop();try{this.saveCanvas(ba,x?this.getFileData(!0,null,null,null,k,L,null,null,null,null,null,c,B):null,Q,null==this.pages||0==this.pages.length,K)}catch(ha){this.handleError(ha)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(ba){this.spinner.stop();this.handleError(ba)}),null,k,c||1,f,q,null,null,B,E,V,fa,aa)}catch(ba){this.spinner.stop(),this.handleError(ba)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};-EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,k,q,x,B,E){EditorUi.debug("EditorUi.importXml",[this],"xml",[c],"dx",[f],"dy",[k],"crop",[q],"noErrorHandling",[x],"addNewPage",[B],"applyDefaultStyles",[E]);f=null!=f?f:0;k=null!=k?k:0;var L=[];try{if(null!=c&&0<c.length){var Q=null!=this.pages?this.pages.length:0,V=this.isDiagramEmpty(),-K=this.currentPage,fa=this.editor.graph;fa.model.beginUpdate();try{var aa=mxUtils.parseXml(c);c={};var da=this.editor.extractGraphModel(aa.documentElement,null!=this.pages);if(null!=da&&"mxfile"==da.nodeName&&null!=this.pages){var ba=da.getElementsByTagName("diagram");if(0<ba.length){aa=[];var ha=0;if(1==ba.length&&!B){if(null!=this.currentPage&&(c[ba[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var qa=ba[0].getAttribute("name");null!=qa&&""!=qa&&this.editor.graph.model.execute(new RenamePage(this,-this.currentPage,qa))}da=Editor.parseDiagramNode(ba[0]);q=!1;ha=1}for(;ha<ba.length;ha++){var ra=ba[ha].getAttribute("id");ba[ha].removeAttribute("id");var l=this.updatePageRoot(new DiagramPage(ba[ha]));c[ra]=ba[ha].getAttribute("id");var t=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[t+1]));fa.model.execute(new ChangePage(this,l,l,t,0<ha));aa.push(l)}this.updatePageLinks(c,aa)}}if(null!=da&&"mxGraphModel"===da.nodeName){L=fa.importGraphModel(da,f,k,q);if(null!=-L)for(this.addLocalPagesToMapping(c),ha=0;ha<L.length;ha++)this.updatePageLinksForCell(c,L[ha]);var H=fa.parseBackgroundImage(da.getAttribute("backgroundImage"));if(null!=H&&null!=H.originalSrc&&this.updateBackgroundPageLink(c,H)){var J=new ChangePageSetup(this,null,H);J.ignoreColor=!0;fa.model.execute(J)}}E&&fa.pasteCellStyles(fa.includeDescendants(L),fa.defaultVertexStyle,fa.defaultEdgeStyle);!B&&K!=this.currentPage&&null!=this.pages&&1<this.pages.length&&V&&1==Q&&this.removePage(K)}finally{fa.model.endUpdate()}}}catch(R){if(x)throw R;-this.handleError(R)}return L};EditorUi.prototype.updatePageLinks=function(c,f){for(var k=0;k<f.length;k++)this.updatePageLinksForCell(c,f[k].root),f[k]!=this.currentPage&&(f[k].needsUpdate=!0),null!=f[k].viewState&&this.updateBackgroundPageLink(c,f[k].viewState.backgroundImage)&&(f[k]==this.currentPage&&this.editor.graph.setViewState(f[k].viewState,!0),f[k].needsUpdate=!0)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){var k=!1;try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var q=c[f.originalSrc.substring(f.originalSrc.indexOf(",")+-1)];null!=q&&(f.originalSrc="data:page/id,"+q,k=!0)}}catch(x){}return k};EditorUi.prototype.updatePageLinksForCell=function(c,f){var k=document.createElement("div"),q=this.editor.graph,x=q.getLinkForCell(f);null!=x&&q.setLinkForCell(f,this.updatePageLink(c,x));if(q.isHtmlLabel(f)){k.innerHTML=Graph.sanitizeHtml(q.getLabel(f));for(var B=k.getElementsByTagName("a"),E=!1,L=0;L<B.length;L++)x=B[L].getAttribute("href"),null!=x&&(B[L].setAttribute("href",this.updatePageLink(c,x)),E=!0);E&&q.labelChanged(f,-k.innerHTML)}for(L=0;L<q.model.getChildCount(f);L++)this.updatePageLinksForCell(c,q.model.getChildAt(f,L))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var k=c[f.substring(f.indexOf(",")+1)];f=null!=k?"data:page/id,"+k:null}else if("data:action/json,"==f.substring(0,17))try{var q=JSON.parse(f.substring(17));if(null!=q.actions){for(var x=0;x<q.actions.length;x++){var B=q.actions[x];if(null!=B.open&&Graph.isPageLink(B.open)){var E=B.open.substring(B.open.indexOf(",")+1);-k=c[E];null!=k?B.open="data:page/id,"+k:null==this.getPageById(E)&&delete B.open}}f="data:action/json,"+JSON.stringify(q)}}catch(L){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,k,q,x){var B=mxUtils.bind(this,function(E){this.loadingExtensions=!1;null!=k?k(E):this.handleError(E)});this.createTimeout(null,mxUtils.bind(this,function(E){q=null!=q?q:c.name;var L=mxUtils.bind(this,-function(V){E.clear()&&B(V)}),Q=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var V=this.isRemoteVisioFormat(q);try{var K=q.lastIndexOf(".");if(0<=K&&K<q.length)q.substring(K+1).toUpperCase();else{var fa=q.lastIndexOf("/");0<=fa&&fa<q.length&&(q=q.substring(fa+1))}}catch(da){}if(V)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(q)?L({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):L({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):-mxResources.get("serviceUnavailableOrBlocked")});else{V=new FormData;V.append("file1",c,q);var aa=new XMLHttpRequest;aa.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(q)?"?stencil=1":""));aa.responseType="blob";this.addRemoteServiceSecurityCheck(aa);null!=x&&aa.setRequestHeader("x-convert-custom",x);aa.onreadystatechange=mxUtils.bind(this,function(){if(4==aa.readyState&&E.clear())if(200<=aa.status&&299>=aa.status)try{var da=aa.response;if("text/xml"==da.type){var ba=new FileReader;ba.onload=mxUtils.bind(this,-function(ha){try{f(ha.target.result)}catch(qa){L({message:mxResources.get("errorLoadingFile")})}});ba.readAsText(da)}else this.doImportVisio(da,f,L,q)}catch(ha){L(ha)}else try{""==aa.responseType||"text"==aa.responseType?L({message:aa.responseText}):(ba=new FileReader,ba.onload=function(){try{L({message:JSON.parse(ba.result).Message})}catch(ha){null!=ba.result&&0<ba.result.length?L({message:ba.result}):L(ha)}},ba.readAsText(aa.response))}catch(ha){L({})}});aa.send(V)}else if(E.clear())try{this.doImportVisio(c,-f,L,q)}catch(da){L(da)}}else L({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?Q():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",Q,null,null,null,L))}),B)};EditorUi.prototype.importGraphML=function(c,f,k){var q=mxUtils.bind(this,function(x){this.loadingExtensions=!1;null!=k?k(x):this.handleError(x)});this.createTimeout(null,mxUtils.bind(this,function(x){var B=mxUtils.bind(this,function(L){x.clear()&&-q(L)}),E=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(x.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,q)}catch(L){B(L)}else B({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?E():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",E,null,null,null,B))}),q)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=-mxUtils.bind(this,function(k){this.loadingExtensions=!1;this.handleError(k)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(k){var q=mxUtils.bind(this,function(B){k.clear()&&f(B)}),x=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(k.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||q({message:mxResources.get("unknownError")})}catch(B){q(B)}else q({message:mxResources.get("serviceUnavailableOrBlocked")})});-"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(x,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",x,null,null,null,q))}),f):f({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,f,k){var q=mxUtils.bind(this,function(x){this.loadingExtensions=!1;null!=k?k(x):this.handleError(x)});this.createTimeout(null,mxUtils.bind(this,function(x){var B=mxUtils.bind(this,function(L){x.clear()&&-q(L)}),E=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(x.clear())if("undefined"!==typeof window.LucidImporter)try{var L=JSON.parse(c);f(LucidImporter.importState(L));try{if(null!=window.console&&"1"==urlParams.test){var Q=[(new Date).toISOString(),"convertLucidChart",L];null!=L.state&&Q.push(JSON.parse(L.state));if(null!=L.svgThumbs)for(var V=0;V<L.svgThumbs.length;V++)Q.push(Editor.createSvgDataUri(L.svgThumbs[V]));null!=L.thumb&&Q.push(L.thumb);console.log.apply(console,Q)}}catch(K){}}catch(K){null!=-window.console&&console.error(K),B(K)}else B({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(E,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",-E,null,null,null,B)},null,null,null,B)},null,null,null,B)},null,null,null,B)},null,null,null,B):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",E,null,null,null,B))}),q)};EditorUi.prototype.replaceLockedGroupChildren=function(c,f,k,q,x){var B=null!=x&&null!=x.dataAttr?x.dataAttr:"mermaidData",E=null!=x&&null!=x.attrPrefix?x.attrPrefix:"mermaid",L=this.editor.graph;x=mxUtils.parseXml((null!=x&&null!=x.wrapGroup?x.wrapGroup:mxMermaidToDrawio.wrapGroup)(f,k,q));var Q=new mxCodec(x);f=new mxGraphModel;-Q.decode(x.documentElement,f);Q=f.getRoot();var V=null;for(x=0;null!=Q&&x<f.getChildCount(Q)&&null==V;x++)for(var K=f.getChildAt(Q,x),fa=0;fa<f.getChildCount(K);fa++){var aa=f.getChildAt(K,fa),da=aa.value;if(null!=da&&"object"===typeof da&&null!=da.getAttribute&&null!=da.getAttribute(B)){V=aa;break}}if(null!=V){Q=[];for(x=0;x<f.getChildCount(V);x++)Q.push(f.getChildAt(V,x));0==Q.length&&(Q=[V]);V=f.getGeometry(V);K=da=Infinity;aa=L.model.getChildCount(c);for(x=0;x<aa;x++){var ba=L.model.getChildAt(c,-x);L.model.isVertex(ba)&&(ba=ba.getGeometry(),null!=ba&&(da=Math.min(da,ba.x),K=Math.min(K,ba.y)))}var ha=Infinity;ba=Infinity;for(x=0;x<Q.length;x++)f.isVertex(Q[x])&&(aa=Q[x].getGeometry(),null!=aa&&(ha=Math.min(ha,aa.x),ba=Math.min(ba,aa.y)));da=isFinite(da)&&isFinite(ha)?da-ha:0;K=isFinite(K)&&isFinite(ba)?K-ba:0;if(0!=da||0!=K)for(x=0;x<Q.length;x++)if(ba=Q[x],aa=ba.getGeometry(),null!=aa){aa=aa.clone();if(f.isVertex(ba))aa.x+=da,aa.y+=K;else if(f.isEdge(ba)){if(null!=aa.points)for(ha=0;ha<aa.points.length;ha++)null!=-aa.points[ha]&&(aa.points[ha].x+=da,aa.points[ha].y+=K);null!=aa.sourcePoint&&(aa.sourcePoint.x+=da,aa.sourcePoint.y+=K);null!=aa.targetPoint&&(aa.targetPoint.x+=da,aa.targetPoint.y+=K)}f.setGeometry(ba,aa)}f=this.snapshotMermaidIdentity(c,E);Q=L.cloneCells(Q,!0);L.getModel().beginUpdate();try{for(fa=L.model.getChildCount(c)-1;0<=fa;fa--)L.model.remove(L.model.getChildAt(c,fa));for(x=0;x<Q.length;x++)this.applyMermaidUserCustomizations(Q[x],f,E),L.model.add(c,Q[x]);if(null!=V){var qa=L.model.getGeometry(c);-null!=qa&&(qa=qa.clone(),qa.width=V.width,qa.height=V.height,L.model.setGeometry(c,qa))}L.setAttributeForCell(c,B,JSON.stringify({data:k,config:q},null,2))}finally{L.getModel().endUpdate()}}};EditorUi.prototype.snapshotMermaidIdentity=function(c,f){f=null!=f?f:"mermaid";for(var k=this.editor.graph,q={},x=k.model.getChildCount(c),B=0;B<x;B++){var E=k.model.getChildAt(c,B),L=E.value;if(null!=L&&"object"===typeof L&&null!=L.getAttribute){var Q=L.getAttribute(f+"Id");Q&&(q[Q]={currentStyle:E.style||"",-currentLabel:L.getAttribute("label")||"",baseStyle:L.getAttribute(f+"BaseStyle")||"",baseValue:L.getAttribute(f+"BaseValue")||""})}}return q};EditorUi.prototype.applyMermaidUserCustomizations=function(c,f,k){var q=c.value;null!=q&&"object"===typeof q&&null!=q.getAttribute&&(k=q.getAttribute((null!=k?k:"mermaid")+"Id"))&&(f=f[k],null!=f&&(c.style=this.mergeMermaidStyleDelta(f.baseStyle,f.currentStyle,c.style||"",c.isEdge()),f.currentLabel!==f.baseValue&&q.setAttribute("label",f.currentLabel)))};EditorUi.prototype.mergeMermaidStyleDelta=-function(c,f,k,q){function x(K){var fa={},aa=[];if(!K)return{map:fa,keys:aa};K=K.split(";");for(var da=0;da<K.length;da++){var ba=K[da];if(ba){var ha=ba.indexOf("=");if(0<ha){var qa=ba.substring(0,ha);qa in fa||aa.push(qa);fa[qa]=ba.substring(ha+1)}else ba in fa||aa.push(ba),fa[ba]=!0}}return{map:fa,keys:aa}}c=x(c);f=x(f);var B=x(k),E={exitX:1,exitY:1,exitDx:1,exitDy:1,entryX:1,entryY:1,entryDx:1,entryDy:1,edgeStyle:1,noEdgeStyle:1,orthogonal:1},L=q?{startArrow:1,endArrow:1,startFill:1,endFill:1,-startSize:1,endSize:1}:{};q={};k=[];for(var Q=0;Q<B.keys.length;Q++){var V=B.keys[Q];q[V]=B.map[V];k.push(V)}for(Q=0;Q<f.keys.length;Q++)V=f.keys[Q],E[V]||L[V]||f.map[V]===c.map[V]||(V in q||k.push(V),q[V]=f.map[V]);for(Q=0;Q<c.keys.length;Q++)V=c.keys[Q],E[V]||L[V]||V in f.map||delete q[V];c=[];for(Q=0;Q<k.length;Q++)V=k[Q],f=q[V],void 0!==f&&(!0===f?c.push(V):c.push(V+"="+f));return 0<c.length?c.join(";")+";":""};EditorUi.prototype.getSvgForXml=function(c,f,k){var q=null,x=this.createTemporaryGraph(this.editor.graph.getStylesheet());-try{document.body.appendChild(x.container),(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,x.getModel()),q=x.getSvg(null,null,f,null,null,null,null,null,null,null,null,k,null,null,!0,!0)}finally{document.body.removeChild(x.container)}return q};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,k,q){var x=0,B=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(E){var L="";if(null!=this.drive&&null!=this.drive.getUser()){var Q=-this.drive.getUser();null!=Q.email&&0<Q.email.indexOf("@")&&(L=Q.email.substring(Q.email.indexOf("@")+1))}var V={prompt:c,driveDomain:L,options:null!=q?q:{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"url",["https://www.draw.io/generate/v3"]);var K=Date.now();L=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(V),"POST");var fa=mxUtils.bind(this,function(da){E.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"error",-[da],"time",Date.now()-K+" ms"),k(da))}),aa=mxUtils.bind(this,function(da){3>x++?E.clear()&&B():fa(da)});L.send(mxUtils.bind(this,function(da){if(E.isAlive())if(200<=da.getStatus()&&299>=da.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var ha=da.getText();try{ha=JSON.parse(ha),result=ha.result}catch(ra){result=ha}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"response",[ha],"time",Date.now()-K+" ms");ha=Editor.extractGraphModelFromText(result);if(null!=ha&&-""!=ha[1])E.clear()&&f(ha[1]);else if("<"==mxUtils.trim(result).charAt(0))E.clear()&&f(result);else{var qa=this.extractMermaidDeclaration(result)||result;this.parseMermaidDiagram(qa,null,mxUtils.bind(this,function(ra){this.tryAndHandle(mxUtils.bind(this,function(){E.clear()&&f(mxMermaidToDrawio.wrapGroup(ra,qa,null))}),fa)}),fa,aa)}}),fa,!0);else{var ba={message:mxResources.get("error")+" "+da.getStatus()};try{ba=JSON.parse(da.getText()),null!=ba.error&&(ba.message=ba.error)}catch(ha){}fa(ba)}}),-fa)}),k)});B()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("(Begins)");for(var k=mxUtils.trim(1>=f.length?c:f[1]),q=k.split("\n"),x=0;x<q.length&&("mermaid"==q[x]||0==q[x].trim().length||"%%"==q[x].substring(0,2));)x++;k=[];for(var B=x;B<q.length;B++){var E=mxUtils.trim(q[B]);if("%%"!=E.substring(0,2)&&"classDef "!=-E.substring(0,9))k.push(q[B]);else if("mermaid"==E)break}q=k;k=mxUtils.trim(q.join("\n"));B="undefined"!==typeof MermaidParser?MermaidParser.detectType(k):null;EditorUi.debug("EditorUi.extractMermaidDeclaration","value",[c],"text",[k],"typeInfo",[B],"startLine",x,"lines",q,"tokens",f);return null!=B?k:null};EditorUi.prototype.getMermaidDiagramType=function(c){var f=null!=c?c.split("\n"):[],k=0;c=function(){for(;k<f.length&&(0==f[k].trim().length||"%%"==f[k].substring(0,2));)k++};c();if(k<f.length&&-"---"==f[k].trim()){do k++;while(k<f.length&&"---"!=f[k].trim());k++;c()}if(k>=f.length)return"";c=f[k].trim().toLowerCase();var q=c.indexOf(" ");return c.substring(0,0<q?q:c.length)};EditorUi.prototype.isMermaidElkFlowchart=function(c){return null!=c&&(/defaultRenderer["']?\s*:\s*["']?elk/i.test(c)||/(?:^|\n)\s*layout\s*:\s*["']?elk\b/i.test(c))&&/(?:flowchart|graph)\b/i.test(c)};EditorUi.prototype.applyMermaidElkPostPass=function(c,f,k){if("undefined"===typeof ElkLayout||"undefined"===typeof Graph)k(c);-else{f=f.match(/(?:flowchart|graph)\s+(LR|RL|TB|TD|BT)/i);var q={LR:"RIGHT",RL:"LEFT",TB:"DOWN",TD:"DOWN",BT:"UP"};f=f?q[f[1].toUpperCase()]||"DOWN":"DOWN";var x=document.createElement("div");x.style.cssText="position:absolute;left:-99999px;top:-99999px;width:1200px;height:800px;visibility:hidden;";document.body.appendChild(x);var B=null,E=!1,L=function(V){if(!E){E=!0;try{null!=B&&B.destroy()}catch(K){}x.remove();k(V)}};try{B=new Graph(x);B.foldingEnabled=!1;B.setEnabled(!1);B.setHtmlLabels(!0);var Q=-mxUtils.parseXml(c);(new mxCodec(Q)).decode(Q.documentElement,B.getModel());(new ElkLayout(B,"layered",{"elk.direction":f,"elk.layered.cycleBreaking.strategy":"GREEDY"},Object.assign({mermaidPolicy:!0},ElkLayout.CANONICAL_EDGE))).execute(B.getDefaultParent(),function(V){var K=null;if(!V)try{var fa=new mxCodec;K=mxUtils.getXml(fa.encode(B.getModel()))}catch(aa){}L(null!=K?K:c)})}catch(V){if(E)throw V;L(c)}}};EditorUi.prototype.parseMermaidDiagram=function(c,f,k,q,x){var B=mxUtils.bind(this,function(L){null!=-x?x(L):null!=q?q(L):this.handleError(L)});if(EditorUi.isMermaidSupported())try{var E=mxMermaidToDrawio.parseText(c,this.getMermaidConfig(c,f));null!=E?this.isMermaidElkFlowchart(c)?this.applyMermaidElkPostPass(E,c,k):k(E):B(Error("Unsupported diagram type: "+this.getMermaidDiagramType(c)))}catch(L){B(L)}else B(Error("Mermaid parser not available"))};EditorUi.prototype.loadMermaid=function(c,f){var k=mxUtils.bind(this,function(x){this.loadingMermaid=!1;f(x)}),q=mxUtils.bind(this,function(){try{this.loadingMermaid=-!1,c()}catch(x){k(x)}});"undefined"!==typeof mxMermaidToDrawio||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(q,0):(this.loadingMermaid=!0,"undefined"!==typeof urlParams&&"1"==urlParams.dev||window.location.search&&0<=window.location.search.indexOf("dev=1")?mxscript("js/elk/drawio-elk.min.js",function(){mxscript("js/mermaid/drawio-mermaid.min.js",q,null,null,null,k)},null,null,null,k):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,k))};EditorUi.prototype.loadPlantUml=-function(c,f){var k=mxUtils.bind(this,function(B){this.loadingPlantUml=!1;f(B)}),q=mxUtils.bind(this,function(){try{this.loadingPlantUml=!1,c()}catch(B){k(B)}});if("undefined"!==typeof mxPlantUmlToDrawio||this.loadingPlantUml)window.setTimeout(q,0);else{this.loadingPlantUml=!0;var x="undefined"!==typeof urlParams&&"1"==urlParams.dev||window.location.search&&0<=window.location.search.indexOf("dev=1");mxscript((x?"":window.DRAWIO_SERVER_URL)+"js/plantuml/drawio-plantuml.min.js",q,null,null,null,k)}};-EditorUi.prototype.parsePlantUmlDiagram=function(c,f,k,q){var x=mxUtils.bind(this,function(B){null!=q?q(B):this.handleError(B)});this.loadPlantUml(mxUtils.bind(this,function(){if(EditorUi.isNativePlantUmlSupported())try{k(mxPlantUmlToDrawio.parseText(c,f))}catch(B){x(B)}else x(Error("PlantUML parser not available"))}),x)};EditorUi.prototype.parsePlantUmlImage=function(c,f,k){this.parsePlantUmlDiagram(c,null,mxUtils.bind(this,function(q){f(this.createMermaidImageXml(c,null,q,null,null,"plantUmlData"))}),-k)};EditorUi.prototype.getMermaidConfig=function(c,f){f=null!=f?f:mxUtils.clone(EditorUi.defaultMermaidConfig);f.securityLevel="strict";f.startOnLoad=!1;f.maxTextSize=9E5;return f};EditorUi.prototype.getMermaidImageForXml=function(c,f){f=parseFloat(f);f=isNaN(f)?EditorUi.mermaidImageBorder:f;c=this.getSvgForXml(c,f,"auto");var k=parseFloat(c.getAttribute("width")),q=parseFloat(c.getAttribute("height"));if(isNaN(k)||isNaN(q)){try{var x=c.getAttribute("viewBox").split(/\s+/);k=parseFloat(x[2]);q=parseFloat(x[3])}catch(B){}k=-k||100;q=q||100}return{data:this.convertDataUri(Editor.createSvgDataUri(mxUtils.getXml(c))),width:k,height:q,border:f}};EditorUi.prototype.createMermaidImageXml=function(c,f,k,q,x,B){x=this.getMermaidImageForXml(k,x);k=new Graph(document.createElement("div"));x=k.insertVertex(null,null,null,0,0,x.width,x.height,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;editIcon=1;groupPadding="+x.border+";image="+x.data+";");k.setAttributeForCell(x,null!=B?B:"mermaidData",JSON.stringify({data:c,config:f},-null,2));null!=q&&k.setAttributeForCell(x,"templatePrompt",q);c=new mxCodec;return mxUtils.getXml(c.encode(k.getModel()))};EditorUi.prototype.parseMermaidImage=function(c,f,k){this.parseMermaidDiagram(c,mxUtils.clone(EditorUi.legacyMermaidConfig),mxUtils.bind(this,function(q){f(this.createMermaidImageXml(c,null,q))}),k)};EditorUi.prototype.getMermaidImageBorder=function(c,f){c=parseFloat(mxUtils.getValue(this.editor.graph.getCurrentCellStyle(c,!0),"groupPadding",""));return isNaN(c)?f:c};EditorUi.prototype.updateMermaidImage=-function(c,f,k,q,x,B){var E=this.editor.graph;q=this.getMermaidImageForXml(q,x);E.setCellStyles("image",q.data,[c]);E.setCellStyles("editIcon","1",[c]);E.setCellStyles("groupPadding",q.border,[c]);x=E.model.getGeometry(c);null!=x&&(x=x.clone(),x.width=q.width,x.height=q.height,E.cellsResized([c],[x],!1));E.setAttributeForCell(c,null!=B?B:"mermaidData",JSON.stringify({data:f,config:k},null,2))};EditorUi.prototype.refreshMermaidImage=function(c){var f=this.editor.graph,k=f.getAttributeForCell(c,"plantUmlData"),-q=null!=k?"plantUmlData":"mermaidData";k=null!=k?k:f.getAttributeForCell(c,"mermaidData");var x=null;if(null!=k)try{x=JSON.parse(k)}catch(L){}if(null!=x&&null!=x.data&&null==x.format){var B=this.getMermaidImageBorder(c,x.border);k=function(){};var E=mxUtils.bind(this,function(L){if(f.model.contains(c)&&this.getMermaidImageBorder(c,x.border)==B){f.model.beginUpdate();try{this.updateMermaidImage(c,x.data,null,L,B,q)}finally{f.model.endUpdate()}}});"plantUmlData"==q?this.parsePlantUmlDiagram(x.data,-null,E,k):this.parseMermaidDiagram(x.data,mxUtils.clone(EditorUi.legacyMermaidConfig),E,k)}};EditorUi.prototype.replaceMermaidCell=function(c,f){var k=this.editor.graph,q=k.getBoundingBoxFromGeometry([c]),x=null!=q?q.x:0;q=null!=q?q.y:0;for(var B=k.model.getParent(c);null!=B&&k.model.isVertex(B);){var E=k.model.getGeometry(B);null!=E&&(x+=E.x,q+=E.y);B=k.model.getParent(B)}k.getModel().beginUpdate();try{var L=this.importXml(f,x,q,!0,null,null,!0);k.model.remove(c);k.setSelectionCells(L)}finally{k.getModel().endUpdate()}k.scrollCellToVisible(k.getSelectionCell());-return L};EditorUi.prototype.insertAsPreText=function(c,f,k){var q=this.editor.graph,x=null;q.getModel().beginUpdate();try{x=q.insertVertex(null,null,"<pre>"+c+"</pre>",f,k,1,1,"text;html=1;align=left;verticalAlign=top;"),q.updateCellSize(x,!0)}finally{q.getModel().endUpdate()}return x};EditorUi.prototype.insertTextAt=function(c,f,k,q,x,B,E,L){B=null!=B?B:!0;E=null!=E?E:!0;if(null!=c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?this.showError(mxResources.get("error"),-mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(aa){4==aa.readyState&&200<=aa.status&&299>=aa.status&&this.editor.graph.setSelectionCells(this.insertTextAt(aa.responseText,f,k,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(x||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var Q=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var V=Editor.extractGraphModelFromPdf(c);if(null!=V&&0<V.length)return this.importXml(V,-f,k,B,!0,L)}if(Editor.isPngDataUrl(c)&&(V=Editor.extractGraphModelFromPng(c),null!=V&&0<V.length))return this.importXml(V,f,k,B,!0,L);if("data:image/svg+xml;"==c.substring(0,19))try{V=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(V=c.substring(c.indexOf(",")+1),V=window.atob&&!mxClient.IS_SF?atob(V):Base64.decode(V,!0)):V=decodeURIComponent(c.substring(c.indexOf(",")+1));var K=this.importXml(V,f,k,B,!0,L);if(0<K.length)return K}catch(aa){}this.loadImage(c,mxUtils.bind(this,function(aa){if("data:"==-c.substring(0,5))this.resizeImage(aa,Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(ha,qa,ra){Q.setSelectionCell(Q.insertVertex(null,null,"",Q.snap(f),Q.snap(k),qa,ra,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(ha)+";"))}),E,this.maxImageSize);else{var da=Math.min(1,Math.min(this.maxImageSize/aa.width,this.maxImageSize/aa.height)),ba=Math.round(aa.width*da);aa=Math.round(aa.height*-da);Q.setSelectionCell(Q.insertVertex(null,null,"",Q.snap(f),Q.snap(k),ba,aa,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var aa=null;Q.getModel().beginUpdate();try{aa=Q.insertVertex(Q.getDefaultParent(),null,c,Q.snap(f),Q.snap(k),1,1,"text;"+(q?"html=1;":"")),Q.updateCellSize(aa),Q.fireEvent(new mxEventObject("textInserted","cells",[aa]))}finally{Q.getModel().endUpdate()}Q.setSelectionCell(aa)}))}else{c=-Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,f,k,B,null,L);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(aa){this.editor.graph.setSelectionCells(this.importXml(aa,f,k,B,null,L))}),mxUtils.bind(this,function(aa){this.handleError(aa)}));else{Q=this.editor.graph;x=null;Q.getModel().beginUpdate();try{x=Q.insertVertex(Q.getDefaultParent(),null,"",Q.snap(f),Q.snap(k),1,1,"text;whiteSpace=wrap;"+(q?"html=1;":""));-Q.fireEvent(new mxEventObject("textInserted","cells",[x]));q&&(c=Q.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");x.value=c;Q.updateCellSize(x);if(0<this.maxTextWidth&&x.geometry.width>this.maxTextWidth){var fa=Q.getPreferredSizeForCell(x,this.maxTextWidth);x.geometry.width=fa.width;x.geometry.height=fa.height}Graph.isLink(x.value)&&Q.setLinkForCell(x,x.value);x.geometry.width+=Q.gridSize;x.geometry.height+=Q.gridSize}finally{Q.getModel().endUpdate()}return[x]}}return[]};-EditorUi.prototype.formatFileSize=function(c){var f=-1;do c/=1024,f++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[f]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var f=c.indexOf(";");0<f&&(c=c.substring(0,f)+c.substring(c.indexOf(",",f+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,f){return/("contentType":\s*"application\/gliffy\+json")/.test(c)};EditorUi.prototype.isLucidChartData=function(c){return null!=-c&&('{"state":"{\\"Properties\\":'==c.substring(0,26)||'{"Properties":'==c.substring(0,14))};EditorUi.prototype.importLocalFile=function(c,f){if(c&&Graph.fileSupport){if(null==this.importFileInputElt){var k=document.createElement("input");k.setAttribute("type","file");mxEvent.addListener(k,"change",mxUtils.bind(this,function(){null!=k.files&&(this.importFiles(k.files,null,null,this.maxImageSize),k.type="",k.type="file",k.value="")}));k.style.display="none";document.body.appendChild(k);this.importFileInputElt=-k}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(E,L){StorageFile.listFiles(this,"F",E,L)});window.openBrowserFile=mxUtils.bind(this,function(E,L,Q){StorageFile.getFileContent(this,E,L,Q)});window.deleteBrowserFile=mxUtils.bind(this,function(E,L,Q){StorageFile.deleteFile(this,E,L,Q)});if(!f){var q=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=new OpenFile(mxUtils.bind(this,function(E){this.hideDialog(E)}));-window.openFile.setConsumer(mxUtils.bind(this,function(E,L){null!=L&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(L)?(E=new Blob([E],{type:"application/octet-stream"}),this.importVisio(E,mxUtils.bind(this,function(Q){this.importXml(Q,0,0,!0)}),null,L)):this.editor.graph.setSelectionCells(this.importXml(E,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!f){var x=this.dialog,B=x.close;-this.dialog.close=mxUtils.bind(this,function(E){Editor.useLocalStorage=q;B.apply(x,arguments);E&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,f,k){var q=this,x=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(B){if(mxUtils.isEmptyObject(B.files))k();else{var E=0,L,Q=!1;B.forEach(function(V,K){V=K.name.toLowerCase();"diagram/diagram.xml"==V?(Q=!0,K.async("string").then(function(fa){0==-fa.indexOf("<mxfile ")?f(fa):k()})):0==V.indexOf("versions/")&&(V=parseInt(V.substr(9)),V>E&&(E=V,L=K))});0<E?L.async("string").then(function(V){(new XMLHttpRequest).upload&&q.isRemoteFileFormat(V,c.name)?q.isOffline()?q.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):q.parseFileData(V,mxUtils.bind(this,function(K){4==K.readyState&&(200<=K.status&&299>=K.status?f(K.responseText):k())}),c.name):k()}):Q||k()}},function(B){k(B)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||-this.isOffline(!0)?x():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",x,null,null,null,k))};EditorUi.prototype.importFile=function(c,f,k,q,x,B,E,L,Q,V,K,fa){V=null!=V?V:!0;var aa=!1,da=null,ba=mxUtils.bind(this,function(ha){var qa=null;null!=ha&&"<mxlibrary"==ha.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,ha,E)),this.showSidebar()):qa=this.importXml(ha,k,q,V,null,null!=fa?mxEvent.isControlDown(fa):null);null!=L&&L(qa)});"image"==f.substring(0,5)?(Q=-!1,"image/png"==f.substring(0,9)&&(K=K?null:this.extractGraphModelFromPng(c),null!=K&&0<K.length&&(da=this.importXml(K,k,q,V,null,null!=fa?mxEvent.isControlDown(fa):null),Q=!0)),Q||(Q=this.editor.graph,K=c.indexOf(";"),0<K&&(c=c.substring(0,K)+c.substring(c.indexOf(",",K+1))),V&&Q.isGridEnabled()&&(k=Q.snap(k),q=Q.snap(q)),K="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==f.substring(0,9)&&(K+="editableCssRules=.*;"),-da=[Q.insertVertex(null,null,"",k,q,x,B,K+"image="+c+";")])):/(\.*<graphml )/.test(c)?(aa=!0,this.importGraphML(c,ba)):null!=Q&&null!=E&&EditorUi.isVisioFilename(E)?(aa=!0,this.importVisio(Q,ba)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,E)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(aa=!0,f=mxUtils.bind(this,function(ha){4==ha.readyState&&(200<=ha.status&&299>=ha.status?ba(ha.responseText):null!=L&&(L(null),this.showError(mxResources.get("error"),-413==ha.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,f,E):this.parseFile(Q,f,E)):0==c.indexOf("PK")&&null!=Q?(aa=!0,this.importZipFile(Q,ba,mxUtils.bind(this,function(){da=this.insertTextAt(this.validateFileData(c),k,q,!0,null,V);L(da)}))):/(\.v(sd|dx))($|\?)/i.test(E)||/(\.vs(s|x))($|\?)/i.test(E)||(da=this.insertTextAt(this.validateFileData(c),k,q,!0,null,V,null,null!=fa?mxEvent.isControlDown(fa):null));aa||null==L||L(da);return da};-EditorUi.prototype.importFiles=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa){q=null!=q?q:this.maxImageSize;V=null!=V?V:this.maxImageBytes;var da=null!=f&&null!=k,ba=!0;f=null!=f?f:0;k=null!=k?k:0;var ha=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var qa=K||this.resampleThreshold,ra=0;ra<c.length;ra++)if("image/svg"!==c[ra].type.substring(0,9)&&"image/"===c[ra].type.substring(0,6)&&c[ra].size>qa){ha=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[f],"y",[k],"maxSize",[q],"maxBytes",[V],-"resampleThreshold",[this.resampleThreshold],"largeImages",[ha],"crop",[da],"resizeImages",[ba],"ignoreEmbeddedXml",[fa],"evt",[aa]);var l=mxUtils.bind(this,function(){var t=this.editor.graph,H=t.gridSize;x=null!=x?x:mxUtils.bind(this,function(ka,X,ja,na,la,va,za,sa,wa){try{if(null!=ka&&"<mxlibrary"==ka.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,ka,za)),this.showSidebar(),null;this.isCompatibleString(ka)&&1==c.length&&null!=aa&&"drop"==aa.type&&this.isBlankFile()&&-!this.canUndo()&&(da=!1,na=ja=0);return this.importFile(ka,X,ja,na,la,va,za,sa,wa,da,fa,aa)}catch(Ca){return this.handleError(Ca),null}});B=null!=B?B:mxUtils.bind(this,function(ka){t.setSelectionCells(ka)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var J=this.currentPage,R=c.length,T=R,Y=[],Z=mxUtils.bind(this,function(ka,X){Y[ka]=X;if(0==--T){this.spinner.stop();if(null!=L)L(Y);else{var ja=[];t.getModel().beginUpdate();try{for(ka=0;ka<Y.length;ka++){var na=Y[ka]();null!=-na&&(ja=ja.concat(na))}}finally{t.getModel().endUpdate()}}J!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);B(ja)}}),ia=0;ia<R;ia++)mxUtils.bind(this,function(ka){var X=c[ka];if(null!=X){var ja=new FileReader;ja.onload=mxUtils.bind(this,function(na){if(null==E||E(X))try{if("image/"==X.type.substring(0,6))if("image/svg"==X.type.substring(0,9)){var la=Graph.clipSvgDataUri(na.target.result),va=la.indexOf(","),za=decodeURIComponent(escape(atob(la.substring(va+-1)))),sa=mxUtils.parseXml(za),wa=sa.getElementsByTagName("svg");if(0<wa.length){var Ca=wa[0],Fa=fa?null:Ca.getAttribute("content");null!=Fa&&"<"!=Fa.charAt(0)&&"%"!=Fa.charAt(0)&&(Fa=unescape(window.atob?atob(Fa):Base64.decode(Fa,!0)));null!=Fa&&"%"==Fa.charAt(0)&&(Fa=decodeURIComponent(Fa));null==Fa||"<mxfile "!==Fa.substring(0,8)&&"<mxGraphModel>"!==Fa.substring(0,14)&&"<mxGraphModel "!==Fa.substring(0,14)?Z(ka,mxUtils.bind(this,function(){try{if(null!=sa){var La=sa.getElementsByTagName("svg");-if(0<La.length){var Da=La[0],Sa=Da.getAttribute("width"),Oa=Da.getAttribute("height");Sa=null!=Sa&&"%"!=Sa.charAt(Sa.length-1)?parseFloat(Sa):NaN;Oa=null!=Oa&&"%"!=Oa.charAt(Oa.length-1)?parseFloat(Oa):NaN;var Ta=Da.getAttribute("viewBox");if(null==Ta||0==Ta.length)Da.setAttribute("viewBox","0 0 "+Sa+" "+Oa);else if(isNaN(Sa)||isNaN(Oa)){var Ua=Ta.split(" ");3<Ua.length&&(Sa=parseFloat(Ua[2]),Oa=parseFloat(Ua[3]))}la=Editor.createSvgDataUri(mxUtils.getXml(Da));var Ba=Math.min(1,Math.min(q/Math.max(1,-Sa)),q/Math.max(1,Oa)),Ka=x(la,X.type,f+ka*H,k+ka*H,Math.max(1,Math.round(Sa*Ba)),Math.max(1,Math.round(Oa*Ba)),X.name);if(null!=Ka&&(isNaN(Sa)||isNaN(Oa))){var ab=new Image;ab.onload=mxUtils.bind(this,function(){Sa=Math.max(1,ab.width);Oa=Math.max(1,ab.height);Ka[0].geometry.width=Sa;Ka[0].geometry.height=Oa;Da.setAttribute("viewBox","0 0 "+Sa+" "+Oa);la=Editor.createSvgDataUri(mxUtils.getXml(Da));var Qa=la.indexOf(";");0<Qa&&(la=la.substring(0,Qa)+la.substring(la.indexOf(",",Qa+1)));t.setCellStyles("image",-la,[Ka[0]])});ab.src=Editor.createSvgDataUri(mxUtils.getXml(Da))}return Ka}}}catch(Qa){}return null})):Z(ka,mxUtils.bind(this,function(){return x(Fa,"text/xml",f+ka*H,k+ka*H,0,0,X.name)}))}else Z(ka,mxUtils.bind(this,function(){return null}))}else{va=!1;if("image/png"==X.type){var Ha=fa?null:this.extractGraphModelFromPng(na.target.result);if(null!=Ha&&0<Ha.length){var Na=new Image;Na.src=na.target.result;Z(ka,mxUtils.bind(this,function(){return x(Ha,"text/xml",f+ka*H,k+ka*H,Na.width,Na.height,X.name)}));-va=!0}}va||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(na.target.result,mxUtils.bind(this,function(La){this.resizeImage(La,Editor.stripImageMetadata(na.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(Da,Sa,Oa){Z(ka,mxUtils.bind(this,-function(){if(null!=Da&&Da.length<V){var Ta=ba&&this.isResampleImageSize(X.size,K)?Math.min(1,Math.min(q/Sa,q/Oa)):1;return x(Da,X.type,f+ka*H,k+ka*H,Math.round(Sa*Ta),Math.round(Oa*Ta),X.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),ba,q,K,X.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else la=na.target.result,x(la,X.type,f+ka*H,k+ka*H,240,160,X.name,function(La){Z(ka,function(){return La})},X)}catch(La){Z(ka,-mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(La,X)}else Z(ka,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(X.name)?x(null,X.type,f+ka*H,k+ka*H,240,160,X.name,function(na){Z(ka,function(){return na})},X):"image"==X.type.substring(0,5)||"application/pdf"==X.type?ja.readAsDataURL(X):ja.readAsText(X)}})(ia)});if(ha){ha=[];for(ra=0;ra<c.length;ra++)ha.push(c[ra]);c=ha;this.confirmImageResize(function(t){ba=t;l()},Q)}else l()};EditorUi.prototype.isBlankFile=-function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,f){f=null!=f?f:!1;var k=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},q=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,x=function(B,E){if(B||f)mxSettings.setResizeImages(B?E:null),mxSettings.save();k();c(E)};null==q||f?this.showDialog((new ConfirmDialog(this,-mxResources.get("resizeLargeImages"),function(B){x(B,!0)},function(B){x(B,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):x(!1,q)};EditorUi.prototype.parseFile=function(c,f,k){k=null!=k?k:c.name;var q=new FileReader;q.onload=mxUtils.bind(this,function(){this.parseFileData(q.result,-f,k)});q.readAsText(c)};EditorUi.prototype.parseFileData=function(c,f,k){var q=new XMLHttpRequest;q.open("POST",OPEN_URL);q.setRequestHeader("Content-Type","application/x-www-form-urlencoded");q.onreadystatechange=function(){f(q)};q.send("format=xml&filename="+encodeURIComponent(k)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(x){}};EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>-f};EditorUi.prototype.resizeImage=function(c,f,k,q,x,B,E){x=null!=x?x:this.maxImageSize;var L=Math.max(1,c.width),Q=Math.max(1,c.height),V=f;if(q&&this.isResampleImageSize(null!=E?E:f.length,B))try{var K=Math.max(L/x,Q/x);if(1<K){var fa=Math.round(L/K),aa=Math.round(Q/K),da=document.createElement("canvas");da.width=fa;da.height=aa;da.getContext("2d").drawImage(c,0,0,fa,aa);var ba=da.toDataURL();if(ba.length<f.length){var ha=document.createElement("canvas");ha.width=fa;ha.height=aa;var qa=ha.toDataURL();-ba!==qa&&(f=ba,L=fa,Q=aa)}}}catch(ra){}q&&V!=f&&x>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,k,q,x/1.5,B,E):k(f,L,Q)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,f,k){try{var q=new Image;q.onload=function(){q.width=0<q.width?q.width:120;q.height=0<q.height?q.height:120;f(q)};null!=k&&(q.onerror=k);q.src=c}catch(x){if(null!=k)k(x);else throw x;}};EditorUi.prototype.getDefaultSketchMode=-function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var v=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){if(Editor.isSettingsEnabled()){null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles);this.formatWidth=mxSettings.getFormatWidth();var c=mxSettings.getSidebarWidth();null!=c&&(this.hsplitPosition=parseInt(c))}this.formatEnabled||(this.formatWidth=0);this.sidebarEnabled||(this.hsplitPosition=-0);v.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var n=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,f=this.editor.graph;"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.installAutoRouting&&LibavoidRouting.installAutoRouting(this);-this.addListener("styleChanged",mxUtils.bind(this,function(X,ja){ja.getProperty("force")&&"undefined"!==typeof mxSettings&&null!=mxSettings.setCurrentEdgeStyle&&null!=mxSettings.settings&&mxSettings.setCurrentEdgeStyle(mxUtils.clone(this.editor.graph.currentEdgeStyle))}));this.restorePersistedEdgeStyle();if(this.editor.isChromelessView()&&"0"!=urlParams.animate){var k=null,q=function(){var X=f.getModel().getRoot();if(X===k&&null!=c.chromelessAnimationPlayer)return!0;k=X;null!=c.chromelessAnimationPlayer&&-c.chromelessAnimationPlayer.stop();c.chromelessAnimationPlayer=Editor.playAnimationOnGraph(f);return null!=c.chromelessAnimationPlayer};q();this.editor.addListener("fileLoaded",q);f.addListener(mxEvent.ROOT,q)}var x=f.isEnabled;f.isEnabled=function(){return x.apply(this,arguments)&&!c.isLocked()};f.showLinkIcons=Editor.showLinkIcons||"1"==urlParams["link-icons"];f.showTooltipIcons=Editor.showTooltipIcons||"1"==urlParams["tooltip-icons"];var B=this;f.editTooltip=function(X){null!=X&&B.actions.get("editTooltip").funct()};-f.getLinkOverlayTooltip=function(X){if(Graph.isPageLink(X)&&null!=B.pages){var ja=X.substring(X.indexOf(",")+1);ja=B.getPageById(ja);if(null!=ja)return ja.getName()||mxResources.get("pageWithNumber",[mxUtils.indexOf(B.pages,ja)+1])}else if(this.isCustomLink(X))return this.getLinkTitle(X);return X};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(X){var ja=X.getEvent();return null==X.getState()&&!mxEvent.isMouseEvent(ja)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(ja)&&(null==X.getState()||-mxEvent.isControlDown(ja)||mxEvent.isShiftDown(ja))});var E=function(X){X=/(?:^|;)groupPadding=([^;]*)/.exec(null!=X?X:"");return null!=X?X[1]:null};f.model.addListener(mxEvent.BEFORE_UNDO,function(X,ja){X=ja.getProperty("edit");if(null!=X&&null!=X.changes){ja=X.changes.length;for(var na=[],la=0;la<ja;la++){var va=X.changes[la];va instanceof mxStyleChange&&null!=va.cell&&f.model.isVertex(va.cell)&&E(va.style)!=E(va.previous)&&/(?:^|;)shape=image(?:;|$)/.test(null!=va.style?va.style:"")&&(null!=f.getAttributeForCell(va.cell,-"mermaidData")||null!=f.getAttributeForCell(va.cell,"plantUmlData"))&&0>mxUtils.indexOf(na,va.cell)&&na.push(va.cell)}for(la=0;la<na.length;la++)c.refreshMermaidImage(na[la])}});var L=function(X){var ja=!1;c.showDialog(X.container,640,420,!0,!0,function(na,la){if(!ja&&X.shouldConfirmClose())return c.confirm(mxResources.get("allChangesLost"),null,function(){ja=!0;c.hideDialog(!0)},mxResources.get("cancel"),mxResources.get("discardChanges")),!1},null,null,new mxRectangle(0,0,320,280),!0);X.init()};-f.cellEditor.editPlantUmlData=function(X,ja,na){var la=JSON.parse(na);ja=f.getCurrentCellStyle(X);var va=mxUtils.getValue(ja,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,za=null==la.format&&!va;ja="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var sa=document.createElement("select");sa.className="geBtn";na=document.createElement("option");na.setAttribute("value","plantUmlDiagram");mxUtils.write(na,mxResources.get("diagram"));sa.appendChild(na);na=document.createElement("option");-na.setAttribute("value","plantUmlImage");mxUtils.write(na,mxResources.get("image"));sa.appendChild(na);sa.value=va?"plantUmlImage":"plantUmlDiagram";var wa=new SimpleTextareaDialog(c,la.data,function(Ca){if(null!=Ca&&c.spinner.spin(document.body,mxResources.get("inserting"))){var Fa="plantUmlImage"==sa.value,Ha=za?la.config:null;c.parsePlantUmlDiagram(Ca,Ha,function(Na){c.spinner.stop();wa.hide();try{f.getModel().beginUpdate();try{if(va&&Fa)c.updateMermaidImage(X,Ca,null,Na,c.getMermaidImageBorder(X,-la.border),"plantUmlData");else if(za&&!Fa)c.replaceLockedGroupChildren(X,Na,Ca,Ha,{wrapGroup:mxPlantUmlToDrawio.wrapGroup,dataAttr:"plantUmlData",attrPrefix:"plantUml"});else{var La=c.getMermaidImageBorder(X,la.border),Da=c.replaceMermaidCell(X,Fa?c.createMermaidImageXml(Ca,null,Na,null,La,"plantUmlData"):mxPlantUmlToDrawio.wrapGroup(Na,Ca,Ha));Fa||null==La||f.setCellStyles("groupPadding",La,Da)}}finally{f.getModel().endUpdate()}}catch(Sa){c.handleError(Sa)}},function(Na){c.spinner.stop();c.handleError(Na)})}},-null,null,ja?sa:null,!0);L(wa)};f.cellEditor.editMermaidData=function(X,ja,na){var la=JSON.parse(na);ja=f.getCurrentCellStyle(X);var va=mxUtils.getValue(ja,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE;ja="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var za=document.createElement("select");za.className="geBtn";na=document.createElement("option");na.setAttribute("value","mermaid");mxUtils.write(na,mxResources.get("diagram"));za.appendChild(na);na=document.createElement("option");-na.setAttribute("value","mermaidImage");mxUtils.write(na,mxResources.get("image"));za.appendChild(na);za.value=va?"mermaidImage":"mermaid";var sa=new SimpleTextareaDialog(c,la.data,function(wa){if(null!=wa&&c.spinner.spin(document.body,mxResources.get("inserting"))){var Ca="mermaidImage"==za.value,Fa=Ca?EditorUi.legacyMermaidConfig:va?null:la.config;c.parseMermaidDiagram(wa,mxUtils.clone(Fa),function(Ha){c.spinner.stop();sa.hide();try{f.getModel().beginUpdate();try{if(va&&Ca)c.updateMermaidImage(X,-wa,null,Ha,c.getMermaidImageBorder(X,la.border));else if(va||Ca){var Na=c.getMermaidImageBorder(X,la.border),La=c.replaceMermaidCell(X,Ca?c.createMermaidImageXml(wa,null,Ha,null,Na):mxMermaidToDrawio.wrapGroup(Ha,wa,Fa));Ca||null==Na||f.setCellStyles("groupPadding",Na,La)}else c.replaceLockedGroupChildren(X,Ha,wa,Fa)}finally{f.getModel().endUpdate()}}catch(Da){c.handleError(Da)}},function(Ha){c.spinner.stop();c.handleError(Ha)})}},null,null,ja?za:null,!0);L(sa)};var Q=f.cellEditor.startEditing;f.cellEditor.startEditing=-function(X,ja,na){try{var la=this.graph.getLockedGroupAncestor(X);null!=la&&(X=la);var va=this.graph.getAttributeForCell(X,"plantUmlData");if(null!=va)this.editPlantUmlData(X,ja,va);else if(va=this.graph.getAttributeForCell(X,"mermaidData"),null!=va&&EditorUi.isMermaidSupported())this.editMermaidData(X,ja,va);else{var za=f.getCellStyle(X);"1"==mxUtils.getValue(za,"metaEdit","0")?c.showDataDialog(X):Q.call(this,X,ja,na)}}catch(sa){c.handleError(sa)}};f.getLinkTitle=function(X){return c.getLinkTitle(X)};-f.customLinkClicked=function(X,ja){var na=!1;try{var la=this.view.graphBounds,va=null!=la?new mxRectangle(la.x,la.y,la.width,la.height):null;c.handleCustomLink(X,ja);na=!0;var za=this.view.graphBounds;c.chromelessResize&&null!=va&&null!=za&&!va.equals(za)&&(c.chromelessResize(),this.scrollCellToVisible(ja))}catch(sa){c.handleError(sa)}return na};var V=f.parseBackgroundImage;f.parseBackgroundImage=function(X){var ja=V.apply(this,arguments);null!=ja&&null!=ja.src&&Graph.isPageLink(ja.src)&&(ja={originalSrc:ja.src});-return ja};var K=f.setBackgroundImage;f.setBackgroundImage=function(X){null!=X&&null!=X.originalSrc&&(X=c.createImageForPageLink(X.originalSrc,c.currentPage,this));K.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,function(X,ja){X=null!=f.backgroundImage?f.backgroundImage.originalSrc:-null;if(null!=X){var na=X.indexOf(",");if(0<na)for(X=X.substring(na+1),ja=ja.getProperty("patches"),na=0;na<ja.length;na++)if(null!=ja[na][EditorUi.DIFF_UPDATE]&&null!=ja[na][EditorUi.DIFF_UPDATE][X]||null!=ja[na][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(ja[na][EditorUi.DIFF_REMOVE],X)){f.refreshBackgroundImage();break}}}));var fa=f.getBackgroundImageObject;f.getBackgroundImageObject=function(X,ja,na){var la=fa.apply(this,arguments);null!=la&&null!=la.originalSrc&&(la=ja?c.createImageForPageLink(la.originalSrc,-na,null,!0):{src:la.originalSrc});return la};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var aa=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(X){X=null!=X?X:"";"1"==urlParams.dev&&(X+=(0<X.length?"&":"?")+-"dev=1");"1"==urlParams.test&&(X+=(0<X.length?"&":"?")+"test=1");return aa.apply(this,arguments)};var da=f.addClickHandler;f.addClickHandler=function(X,ja,na){var la=ja;ja=function(va,za,sa){if(null==za){var wa=mxEvent.getSource(va);"a"==wa.nodeName.toLowerCase()&&(za=wa.getAttribute("href"))}null!=za&&f.isCustomLink(za)&&(mxEvent.isTouchEvent(va)||!mxEvent.isPopupTrigger(va))&&f.customLinkClicked(za,sa)&&mxEvent.consume(va);null!=la&&la(va,za,sa)};da.call(this,X,ja,na)};n.apply(this,arguments);Graph.browserTranslate&&-f.waitForBrowserTranslate();this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var ba=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(X,ja,na){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(X,["zoomIn","zoomOut","-"],null,na);if(Editor.passiveScroll&&null!=na){var la=mxUtils.convertPoint(f.container,mxEvent.getClientX(na),mxEvent.getClientY(na));f._contextMenuPoint=new mxPoint(f.snap(la.x/f.view.scale-f.view.translate.x),-f.snap(la.y/f.view.scale-f.view.translate.y));f._contextMenuScreenPoint=mxUtils.convertPoint(f.container,mxEvent.getClientX(na),mxEvent.getClientY(na))}f.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",X,null),X.addSeparator());ba.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||this.addMenuItems(X,["-","addToScratchpad"],null,na);f.isSelectionEmpty()&&!this.isShowStyleItems()&&this.addMenuItems(X,["-","exitGroup","home"],null,-na)};var ha=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(X,ja,na){if(c.editor.graph.isSelectionEmpty())ha.apply(this,arguments),c.menus.addMenuItems(X,["copyAsImage","copyAsSvg"],null,na);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(X,ja,na):this.addPopupMenuArrangeItems(X,ja,na),this.addMenuItems(X,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),null,na),Editor.passiveScroll&&(1==f.getSelectionCount()?this.addMenuItems(X,["-","copyStyle","pasteStyle",-"copyTextStyle","pasteTextStyle"],null,na):this.addMenuItems(X,["-","pasteStyle","pasteTextStyle"],null,na)),this.addMenuItems(X,["-"],null,na),this.isShowCellEditItems()||this.addPopupDeleteItem(X,ja,na),this.addMenuItems(X,["lockUnlock","-"],null,na),!this.isShowStyleItems()){if(1==f.getSelectionCount()&&!f.isCellLocked(ja)&&f.isCellEditable(ja)&&(this.addSubmenu("editCell",X,null,mxResources.get("edit")),X.addSeparator(),f.getModel().isEdge(ja))){this.addSubmenu("line",X);var la=f.getModel().getGeometry(ja);-null!=la&&null!=la.points&&0<la.points.length&&this.addMenuItems(X,["clearWaypoints"],null,na)}1==f.getSelectionCount()&&this.addMenuItems(X,["enterGroup"],null,na);la=c.getSelectionState();null!=la.mergeCell?this.addMenuItem(X,"mergeCells"):(1<la.style.colspan||1<la.style.rowspan)&&this.addMenuItem(X,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=function(){return"simple"!=-Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}if(Editor.passiveScroll){var qa=f.getCenterInsertPoint;f.getCenterInsertPoint=function(X){if(null!=this._contextMenuPoint){var ja=this._contextMenuPoint;X=null!=X?X:new mxRectangle;return new mxPoint(f.snap(ja.x-(X.width||0)/2),f.snap(ja.y-(X.height||0)/2))}return qa.apply(this,arguments)};var ra=f.popupMenuHandler.hideMenu;f.popupMenuHandler.hideMenu=function(){ra.apply(this,-arguments);window.setTimeout(function(){f._contextMenuPoint=null;f._contextMenuScreenPoint=null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var l=f.getExportVariables;f.getExportVariables=function(){var X=l.apply(this,arguments),ja=c.getCurrentFile();null!=ja&&(X.filename=ja.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var na in c.fileVars)null==X[na]&&(X[na]=-c.fileVars[na]);X.pagecount=null!=c.pages?c.pages.length:1;X.page=null!=c.currentPage?c.currentPage.getName():"";X.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return X};var t=f.getGlobalVariable;f.getGlobalVariable=function(X){var ja=c.getCurrentFile();if("filename"==X&&null!=ja)return ja.getTitle();if("page"==X&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==X)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+-1:1;if("pagecount"==X)return null!=c.pages?c.pages.length:1;ja=t.apply(this,arguments);null==ja&&(c.updateFileVars(),null!=c.fileVars&&(ja=c.fileVars[X]));return ja};var H=null,J=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var X=this.getCurrentFile(),ja=null!=X&&null!=X.getTitle()?X.getTitle():this.defaultFilename;H!=ja&&X==J&&(f.invalidateDescendantsWithPlaceholders(f.model.getRoot()),f.view.validate());H=ja;J=X}));var R=f.labelLinkClicked;f.labelLinkClicked=function(X,-ja,na){var la=ja.getAttribute("href");if(null==la||!f.isCustomLink(la)||!mxEvent.isTouchEvent(na)&&mxEvent.isPopupTrigger(na))R.apply(this,arguments);else{if(!f.isEnabled()||null!=X&&f.isCellLocked(X.cell))f.customLinkClicked(la),f.getRubberband().reset();mxEvent.consume(na)}};this.editor.getOrCreateFilename=function(){var X=c.defaultFilename,ja=c.getCurrentFile();null!=ja&&(X=null!=ja.getTitle()?ja.getTitle():X);return X};q=this.actions.get("print");q.setEnabled(!mxClient.IS_IOS||!navigator.standalone);-q.visible=q.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),this.keyHandler.bindAction(76,!1,"insertLink"),this.keyHandler.bindAction(82,!1,"insertRhombus"),-this.keyHandler.bindAction(67,!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize",this.installKeyboardShortcuts(),"1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||-f.addListener(mxEvent.ESCAPE,function(X,ja){null!=ja&&f.isEnabled()&&!f.isEditing()&&null!=ja.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(X){var ja=f.cellEditor.text2,na=null;null!=ja&&(mxEvent.addListener(ja,"dragleave",function(la){null!=-na&&(na.parentNode.removeChild(na),na=null);la.stopPropagation();la.preventDefault()}),mxEvent.addListener(ja,"dragover",mxUtils.bind(this,function(la){null==na&&(na=this.highlightElement(ja));la.stopPropagation();la.preventDefault()})),mxEvent.addListener(ja,"drop",mxUtils.bind(this,function(la){null!=na&&(na.parentNode.removeChild(na),na=null);if(0<la.dataTransfer.files.length)this.importFiles(la.dataTransfer.files,0,0,this.maxImageSize,function(za,sa,wa,Ca,Fa,Ha){f.insertImage(za,Fa,Ha)},function(){},-function(za){return"image/"==za.type.substring(0,6)},function(za){for(var sa=0;sa<za.length;sa++)za[sa]()},mxEvent.isControlDown(la));else if(0<=mxUtils.indexOf(la.dataTransfer.types,"text/uri-list")){var va=la.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(va)?this.loadImage(decodeURIComponent(va),mxUtils.bind(this,function(za){var sa=Math.max(1,za.width);za=Math.max(1,za.height);var wa=this.maxImageSize;wa=Math.min(1,Math.min(wa/Math.max(1,sa)),wa/Math.max(1,za));f.insertImage(decodeURIComponent(va),-sa*wa,za*wa)})):document.execCommand("insertHTML",!1,la.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(la.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,la.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(la.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,la.dataTransfer.getData("text/plain"));la.stopPropagation();la.preventDefault()})))}));if(Editor.isSettingsEnabled()){q=this.editor.graph.view;var T=mxSettings.getUnit();q.setUnit(T);-Editor.pageSizeUnit=T;q.addListener("unitChanged",function(X,ja){X=ja.getProperty("unit");mxSettings.setUnit(X);mxSettings.save();Editor.pageSizeUnit=X});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,q.unit);this.refresh()}if("1"==urlParams.styledev){q=document.getElementById("geFooter");null!=q&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type",-"text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),q.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,-function(X,ja){0<this.editor.graph.getSelectionCount()?(X=this.editor.graph.getSelectionCell(),X=this.editor.graph.getModel().getStyle(X),this.styleInput.value=X||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var Y=this.isSelectionAllowed;this.isSelectionAllowed=function(X){return mxEvent.getSource(X)==this.styleInput?!0:Y.apply(this,arguments)}}q=document.getElementById("geInfo");null!=q&&q.parentNode.removeChild(q);if(Graph.fileSupport&&(!this.editor.chromeless||-this.editor.editable)){var Z=null;mxEvent.addListener(f.container,"dragleave",function(X){f.isEnabled()&&(null!=Z&&(Z.parentNode.removeChild(Z),Z=null),X.stopPropagation(),X.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(X){null==Z&&(Z=this.highlightElement(f.container));null!=this.sidebar&&this.sidebar.hideTooltip();X.stopPropagation();X.preventDefault()}));mxEvent.addListener(f.container,"drop",mxUtils.bind(this,function(X){null!=Z&&(Z.parentNode.removeChild(Z),-Z=null);if(f.isEnabled()){var ja=mxUtils.convertPoint(f.container,mxEvent.getClientX(X),mxEvent.getClientY(X)),na=X.dataTransfer.files,la=f.view.translate,va=f.view.scale,za=ja.x/va-la.x,sa=ja.y/va-la.y;if(0<na.length)ja=this.isBlankFile()&&!this.canUndo(),la=1==na.length&&(EditorUi.isVisioFilename(na[0].name)||/(\.drawio)$/i.test(na[0].name)||/(\.xml)$/i.test(na[0].name)),"1"!=urlParams.embed&&ja&&(la||mxEvent.isShiftDown(X))?(ja=this.getCurrentFile(),null!=ja&&ja.isModified()||this.fileLoaded(null,-!0),this.openFiles(na,!0,mxUtils.bind(this,function(){var La=this.getCurrentFile();null!=La&&La.fileChanged()}))):(mxEvent.isAltDown(X)&&(sa=za=null),this.importFiles(na,za,sa,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(X),null,null,mxEvent.isShiftDown(X),X));else{mxEvent.isAltDown(X)&&(sa=za=0);var wa=0<=mxUtils.indexOf(X.dataTransfer.types,"text/uri-list")?X.dataTransfer.getData("text/uri-list"):null;na=this.extractGraphModelFromEvent(X,null!=this.pages);if(null!=na)f.setSelectionCells(this.importXml(na,-za,sa,!0));else if(0<=mxUtils.indexOf(X.dataTransfer.types,"text/html")){var Ca=X.dataTransfer.getData("text/html");na=document.createElement("div");na.innerHTML=Graph.sanitizeHtml(Ca);var Fa=null;ja=na.getElementsByTagName("img");null!=ja&&1==ja.length?(Ca=ja[0].getAttribute("src"),null==Ca&&(Ca=ja[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Ca)||(Fa=!0)):(ja=na.getElementsByTagName("a"),null!=ja&&1==ja.length?Ca=ja[0].getAttribute("href"):(na=na.getElementsByTagName("pre"),-null!=na&&1==na.length&&(Ca=mxUtils.getTextContent(na[0]))));var Ha=!0,Na=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(Ca,za,sa,!0,Fa,null,Ha,mxEvent.isControlDown(X)))});Fa&&null!=Ca&&Ca.length>this.resampleThreshold?this.confirmImageResize(function(La){Ha=La;Na()},mxEvent.isControlDown(X)):Na()}else null!=wa&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(wa)?this.loadImage(decodeURIComponent(wa),mxUtils.bind(this,function(La){var Da=Math.max(1,La.width);La=Math.max(1,La.height);var Sa=-this.maxImageSize;Sa=Math.min(1,Math.min(Sa/Math.max(1,Da)),Sa/Math.max(1,La));f.setSelectionCell(f.insertVertex(null,null,"",za,sa,Da*Sa,La*Sa,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+wa+";"))}),mxUtils.bind(this,function(La){f.setSelectionCells(this.insertTextAt(wa,za,sa,!0))})):0<=mxUtils.indexOf(X.dataTransfer.types,"text/plain")&&f.setSelectionCells(this.insertTextAt(X.dataTransfer.getData("text/plain"),za,sa,-!0))}}X.stopPropagation();X.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&f.view.validateBackground()});-f.addListener("enabledChanged",mxUtils.bind(this,function(){f.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var X=parseInt(this.div.offsetLeft),ja=parseInt(this.div.offsetWidth),na=c.embedViewport.x+c.embedViewport.width,la=parseInt(this.div.offsetTop),va=parseInt(this.div.offsetHeight),za=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,-Math.min(X,na-ja))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(la,za-va))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};var ia=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(X,ja){ia.call(this,X,ja);c.hideCurrentMenu()};var ka=mxWindow.prototype.setSize;mxWindow.prototype.setSize=function(X,ja){ka.call(this,X,ja);c.hideCurrentMenu()};-if(!this.editor.chromeless||this.editor.editable){q=Editor.currentTheme;if("simple"==q||"sketch"==q)this.doSetCurrentTheme(q,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(T=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,T<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==q&&T<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==q&&(this.lastWindowWidth=T)),this.fireEvent(new mxEventObject("themeInitialized"));this.restoreVisibleWindows();-"kennedy"==q&&(T=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,T<Editor.smallScreenWidth&&(this.formatWidth=0),T<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),this.lastWindowWidth=T)}q=!1;if(null!=urlParams.dark)q=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)q="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||q&&"auto"!=mxSettings.settings.darkMode||(q=mxSettings.settings.darkMode);"auto"==q&&this.isAutoDarkModeSupported()&&-(q=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof q?"1"==q:q);if(this.isAutoDarkModeSupported())try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(X){this.isAutoDarkMode()&&this.setDarkMode(X.matches)}))}catch(X){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast?-this.setHighContrast(mxSettings.settings.highContrast):null!=window.matchMedia&&window.matchMedia("(prefers-contrast: more)").matches&&this.setHighContrast(!0);Editor.isSettingsEnabled()&&(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(X,-ja){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var y=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||-document.body.clientWidth,f=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));f=Editor.smallScreenWidth-160;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,!0):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&!this.isShapesPanelVisible()&&-this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}y.apply(this,arguments);null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,k=this.sketchPickerMenuElt,q=this.editor.graph;k.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(V){mxEvent.getSource(V)==this.diagramContainer.parentNode&&(this.embedExitPoint=-new mxPoint(mxEvent.getClientX(V),mxEvent.getClientY(V)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var x=document.createElement("div");x.style.position="absolute";x.style.width="10px";x.style.height="10px";x.style.borderRadius="5px";x.style.border="1px solid gray";x.style.background="#ffffff";x.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(x);this.bottomResizer=x;var B=null,E=null,L=null,Q=null;mxEvent.addGestureListeners(x,mxUtils.bind(this,function(V){Q=-parseInt(this.diagramContainer.style.height);E=mxEvent.getClientY(V);q.popupMenuHandler.hideMenu();mxEvent.consume(V)}));x=x.cloneNode(!1);x.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(x);this.rightResizer=x;mxEvent.addGestureListeners(x,mxUtils.bind(this,function(V){L=parseInt(this.diagramContainer.style.width);B=mxEvent.getClientX(V);q.popupMenuHandler.hideMenu();mxEvent.consume(V)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(V){var K=!1;-null!=B&&(this.diagramContainer.style.width=Math.max(20,L+mxEvent.getClientX(V)-B)+"px",K=!0);null!=E&&(this.diagramContainer.style.height=Math.max(20,Q+mxEvent.getClientY(V)-E)+"px",K=!0);K&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(V){null==B&&null==E||mxEvent.consume(V);E=B=null});document.body.style.backgroundColor=-"transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(V){this.inlineSizeChanged();Editor.passiveScroll?this.hideWindows():this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(V){this.diagramContainer.style.width=-"10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){k.innerHTML=" ";k.focus();try{var B=document.createRange();-B.selectNodeContents(k);var E=window.getSelection();null!=E&&(E.removeAllRanges(),E.addRange(B))}catch(L){}},0)}var f=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck","false");k.style.textRendering="optimizeSpeed";k.style.fontFamily="monospace";k.style.wordBreak="break-all";k.style.background="transparent";k.style.color="transparent";k.style.position="absolute";-k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.display="block";k.style.fontSize="1";k.style.zIndex="-1";k.style.resize="none";k.style.outline="none";k.style.width="1px";k.style.height="1px";mxUtils.setOpacity(k,0);k.contentEditable=!0;k.innerHTML=" ";this.clipboardElt=k;var q=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(B){var E=mxEvent.getSource(B);-null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==E.nodeName||"TEXTAREA"==E.nodeName&&E!==this.typingShim||"true"==E.contentEditable||224!=B.keyCode&&(mxClient.IS_MAC||17!=B.keyCode)&&(!mxClient.IS_MAC||91!=B.keyCode&&93!=B.keyCode)||q||(k.style.left=f.container.scrollLeft+10+"px",k.style.top=f.container.scrollTop+10+"px",B=f.container.scrollLeft,E=f.container.scrollTop,f.container.appendChild(k),q=!0,k.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=-B,f.container.scrollTop=E)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(B){var E=B.keyCode;window.setTimeout(mxUtils.bind(this,function(){!q||224!=E&&17!=E&&91!=E&&93!=E||(q=!1,k.parentNode.removeChild(k),f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(B){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k),c()}catch(E){this.handleError(E)}}));-mxEvent.addListener(k,"cut",mxUtils.bind(this,function(B){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k,!0),c()}catch(E){this.handleError(E)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(B){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(k.innerHTML=" ",k.focus(),null!=B.clipboardData&&(Graph.removePasteFormatting(k.firstChild),this.pasteCells(B,k,!0,!0)),!mxEvent.isConsumed(B)){var E=f.container.scrollLeft,L=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,-function(){try{f.container.scrollLeft=E,f.container.scrollTop=L,Graph.removePasteFormatting(k.firstChild),this.pasteCells(B,k,!1,!0)}catch(Q){this.handleError(Q)}}),0)}}catch(Q){this.handleError(Q)}}),!0);var x=this.isSelectionAllowed;this.isSelectionAllowed=function(B){return mxEvent.getSource(B)==k?!0:x.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=-function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var k="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(k||f)f=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),-this.restoreScrollState(f);return k};EditorUi.prototype.saveScrollState=function(c){var f=this.editor.graph.view.translate,k=this.diagramContainer.scrollLeft,q=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(k-=this.embedViewport.x,q-=this.embedViewport.y):(k+=this.embedViewport.x,q+=this.embedViewport.y));f={x:k,y:q,tx:f.x,ty:f.y};c&&(f.boundingRect=this.diagramContainer.getBoundingClientRect());return f};EditorUi.prototype.restoreScrollState=function(c){var f=-this.editor.graph.view.scale,k=this.editor.graph.view.translate;if(null!=c.boundingRect){var q=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-q.x;c.y-=c.boundingRect.y-q.y}this.diagramContainer.scrollLeft=c.x+(k.x-c.tx)*f;this.diagramContainer.scrollTop=c.y+(k.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&-(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||f||(this.statusContainer.style.display="none")}));var k=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var q=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;f=null!=q&&null!=q.getAttribute("class");if(!f&&null!=q){q=q.getAttribute("title");var x=this.getCurrentFile();-x=null!=x?x.savingStatusKey:DrawioFile.prototype.savingStatusKey;q==mxResources.get(x)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(x))+'..."src="'+Editor.tailSpin+'"></div>',f=!0)}this.statusContainer.style.display="none";q=32>=c.clientWidth;c.style.visibility=q&&""==this.editor.getStatus()?"hidden":"";if(q||f)this.statusContainer.style.display="",f=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=-0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",k);k()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=-function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),f=0;f<-c.length;f++)null!=c[f]&&c[f].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=-null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,f){if(null!=c){var k=null;if("diagram"==c.nodeName)k=c;else if("mxfile"==c.nodeName){var q=c.getElementsByTagName("diagram");if(0<q.length){k=q[0];var x=f.getGlobalVariable;f.getGlobalVariable=function(C){return"page"==C?k.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==C?1:x.apply(this,arguments)}}}null!=k&&(c=Editor.parseDiagramNode(k))}q=this.editor.graph;try{this.editor.graph=f,this.editor.setGraphXml(c)}catch(C){}finally{this.editor.graph=+q}return c};EditorUi.prototype.getSvgFileProperties=function(c){var f=this.getPngFileProperties(c);f.embedFonts=null!=c&&c.hasAttribute("embedFonts")?"false"!=c.getAttribute("embedFonts"):Editor.embedSvgFonts;return f};EditorUi.prototype.getPngFileProperties=function(c){var f=1,k=0;if(null!=c){if(c.hasAttribute("scale")){var q=parseFloat(c.getAttribute("scale"));!isNaN(q)&&0<q&&(f=q)}c.hasAttribute("border")&&(q=parseInt(c.getAttribute("border")),!isNaN(q)&&0<q&&(k=q))}return{scale:f,border:k}};EditorUi.prototype.getEmbeddedPng=+function(c,f,k,q,x){try{var C=this.editor.graph,E=null;if(null!=k&&0<k.length)C=this.createTemporaryGraph(C.getStylesheet()),document.body.appendChild(C.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,!0),C),E=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){C=this.createTemporaryGraph(C.getStylesheet());var L=C.getGlobalVariable;C.setBackgroundImage=this.editor.graph.setBackgroundImage;var Q=this.pages[0];this.currentPage==Q?C.setBackgroundImage(this.editor.graph.backgroundImage):+null!=Q.viewState&&null!=Q.viewState&&C.setBackgroundImage(Q.viewState.backgroundImage);C.getGlobalVariable=function(V){return"page"==V?Q.getName():"pagenumber"==V?1:L.apply(this,arguments)};document.body.appendChild(C.container);C.model.setRoot(Q.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(V){try{null==E&&(E=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var K=V.toDataURL("image/png");K=Editor.writeGraphModelToPng(K,"tEXt","mxfile",encodeURIComponent(E));c(K.substring(K.lastIndexOf(",")++1));C!=this.editor.graph&&C.container.parentNode.removeChild(C.container)}catch(fa){null!=f&&f(fa)}}),null,null,null,mxUtils.bind(this,function(V){null!=f&&f(V)}),null,null,q,null,C.shadowVisible,null,C,x,null,null,null,"diagram",null)}catch(V){null!=f&&f(V)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba){L=null!=L?L:!0;K=null!=K?K:0;E=null!=Q?Q:f.background;E==mxConstants.NONE&&(E=null);null==E&&"none"==f.getAdaptiveColors()&&(E="#ffffff");Q=this.editor.graph.createSvgImageExport(null!=+c,da);var ha=Graph.addFont,qa=null;if(null==x){qa={};Graph.addFont=function(J,R,T,Y){ha.call(this,J,R,T,qa)};var ra=Q.drawCellState;Q.drawCellState=function(J,R){null!=J&&Graph.processFontStyle(J.style);ra.apply(this,arguments)}}da=null;try{da=f.getSvg(E,V,K,null,null,C,null,Q,null,f.shadowVisible||fa,null,aa,"diagram")}finally{Graph.addFont=ha}(f.shadowVisible||fa)&&f.addSvgShadow(da,null,null,0==K);null!=c&&da.setAttribute("content",c);null!=k&&da.setAttribute("resource",k);var l=mxUtils.bind(this,+function(J){J=(q?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(J);null!=x&&x(J);return J});f.mathEnabled&&this.editor.addMathCss(da);if(null!=x)this.embedFonts(da,mxUtils.bind(this,function(J){L?this.editor.convertImages(J,mxUtils.bind(this,function(R){l(R)})):l(J)}),ba);else{c=Graph.customFontElements;Graph.customFontElements=qa;try{var t=!1;this.embedFonts(da,function(){t=!0},ba);if(!t)try{null==this.editor.resolvedFontCss&&this.editor.addFontCss(da);+var H=this.editor.graph.getExtFontCss();0<H.length&&this.editor.addFontCss(da,H)}catch(J){}}finally{Graph.customFontElements=c}return l(da)}};EditorUi.prototype.embedFonts=function(c,f,k){if(k=null!=k?k:Editor.embedSvgFonts)this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(x){try{null!=x&&this.editor.addFontCss(c,x),f(c)}catch(C){f(c)}}))}catch(x){f(c)}}));+else{try{this.editor.addFontCss(c);var q=this.editor.graph.getExtFontCss();0<q.length&&this.editor.addFontCss(c,q)}catch(x){}f(c)}};EditorUi.prototype.exportImage=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa){Q=null!=Q?Q:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(ba){Editor.addRetryToError(ba,mxUtils.bind(this,function(){this.exportImage(c,f,k,q,x,C,E,L,Q,V,K,fa,aa)}));this.handleError(ba)}))){var da=this.editor.graph.isSelectionEmpty();k=null!=k?k:da;+null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(ba){this.spinner.stop();try{this.saveCanvas(ba,x?this.getFileData(!0,null,null,null,k,L,null,null,null,null,null,c,C):null,Q,null==this.pages||0==this.pages.length,K)}catch(ha){this.handleError(ha)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(ba){this.spinner.stop();this.handleError(ba)}),null,k,c||1,f,q,null,null,C,E,V,fa,aa)}catch(ba){this.spinner.stop(),this.handleError(ba)}}};+EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,k,q,x,C,E){EditorUi.debug("EditorUi.importXml",[this],"xml",[c],"dx",[f],"dy",[k],"crop",[q],"noErrorHandling",[x],"addNewPage",[C],"applyDefaultStyles",[E]);f=null!=f?f:0;k=null!=k?k:+0;var L=[];try{if(null!=c&&0<c.length){var Q=null!=this.pages?this.pages.length:0,V=this.isDiagramEmpty(),K=this.currentPage,fa=this.editor.graph;fa.model.beginUpdate();try{var aa=mxUtils.parseXml(c);c={};var da=this.editor.extractGraphModel(aa.documentElement,null!=this.pages);if(null!=da&&"mxfile"==da.nodeName&&null!=this.pages){var ba=da.getElementsByTagName("diagram");if(0<ba.length){aa=[];var ha=0;if(1==ba.length&&!C){if(null!=this.currentPage&&(c[ba[0].getAttribute("id")]=this.currentPage.getId(),+this.isBlankFile())){var qa=ba[0].getAttribute("name");null!=qa&&""!=qa&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,qa))}da=Editor.parseDiagramNode(ba[0]);q=!1;ha=1}for(;ha<ba.length;ha++){var ra=ba[ha].getAttribute("id");ba[ha].removeAttribute("id");var l=this.updatePageRoot(new DiagramPage(ba[ha]));c[ra]=ba[ha].getAttribute("id");var t=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[t+1]));fa.model.execute(new ChangePage(this,l,l,t,0<ha));+aa.push(l)}this.updatePageLinks(c,aa)}}if(null!=da&&"mxGraphModel"===da.nodeName){L=fa.importGraphModel(da,f,k,q);if(null!=L)for(this.addLocalPagesToMapping(c),ha=0;ha<L.length;ha++)this.updatePageLinksForCell(c,L[ha]);var H=fa.parseBackgroundImage(da.getAttribute("backgroundImage"));if(null!=H&&null!=H.originalSrc&&this.updateBackgroundPageLink(c,H)){var J=new ChangePageSetup(this,null,H);J.ignoreColor=!0;fa.model.execute(J)}}E&&fa.pasteCellStyles(fa.includeDescendants(L),fa.defaultVertexStyle,fa.defaultEdgeStyle);+!C&&K!=this.currentPage&&null!=this.pages&&1<this.pages.length&&V&&1==Q&&this.removePage(K)}finally{fa.model.endUpdate()}}}catch(R){if(x)throw R;this.handleError(R)}return L};EditorUi.prototype.updatePageLinks=function(c,f){for(var k=0;k<f.length;k++)this.updatePageLinksForCell(c,f[k].root),f[k]!=this.currentPage&&(f[k].needsUpdate=!0),null!=f[k].viewState&&this.updateBackgroundPageLink(c,f[k].viewState.backgroundImage)&&(f[k]==this.currentPage&&this.editor.graph.setViewState(f[k].viewState,!0),f[k].needsUpdate=+!0)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){var k=!1;try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var q=c[f.originalSrc.substring(f.originalSrc.indexOf(",")+1)];null!=q&&(f.originalSrc="data:page/id,"+q,k=!0)}}catch(x){}return k};EditorUi.prototype.updatePageLinksForCell=function(c,f){var k=document.createElement("div"),q=this.editor.graph,x=q.getLinkForCell(f);null!=x&&q.setLinkForCell(f,this.updatePageLink(c,x));if(q.isHtmlLabel(f)){k.innerHTML=Graph.sanitizeHtml(q.getLabel(f));+for(var C=k.getElementsByTagName("a"),E=!1,L=0;L<C.length;L++)x=C[L].getAttribute("href"),null!=x&&(C[L].setAttribute("href",this.updatePageLink(c,x)),E=!0);E&&q.labelChanged(f,k.innerHTML)}for(L=0;L<q.model.getChildCount(f);L++)this.updatePageLinksForCell(c,q.model.getChildAt(f,L))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var k=c[f.substring(f.indexOf(",")+1)];f=null!=k?"data:page/id,"+k:null}else if("data:action/json,"==f.substring(0,17))try{var q=JSON.parse(f.substring(17));+if(null!=q.actions){for(var x=0;x<q.actions.length;x++){var C=q.actions[x];if(null!=C.open&&Graph.isPageLink(C.open)){var E=C.open.substring(C.open.indexOf(",")+1);k=c[E];null!=k?C.open="data:page/id,"+k:null==this.getPageById(E)&&delete C.open}}f="data:action/json,"+JSON.stringify(q)}}catch(L){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,k,q,x){var C=mxUtils.bind(this,function(E){this.loadingExtensions=+!1;null!=k?k(E):this.handleError(E)});this.createTimeout(null,mxUtils.bind(this,function(E){q=null!=q?q:c.name;var L=mxUtils.bind(this,function(V){E.clear()&&C(V)}),Q=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var V=this.isRemoteVisioFormat(q);try{var K=q.lastIndexOf(".");if(0<=K&&K<q.length)q.substring(K+1).toUpperCase();else{var fa=q.lastIndexOf("/");0<=fa&&fa<q.length&&(q=q.substring(fa+1))}}catch(da){}if(V)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(q)?+L({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):L({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{V=new FormData;V.append("file1",c,q);var aa=new XMLHttpRequest;aa.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(q)?"?stencil=1":""));aa.responseType="blob";this.addRemoteServiceSecurityCheck(aa);null!=x&&aa.setRequestHeader("x-convert-custom",x);aa.onreadystatechange=mxUtils.bind(this,function(){if(4==+aa.readyState&&E.clear())if(200<=aa.status&&299>=aa.status)try{var da=aa.response;if("text/xml"==da.type){var ba=new FileReader;ba.onload=mxUtils.bind(this,function(ha){try{f(ha.target.result)}catch(qa){L({message:mxResources.get("errorLoadingFile")})}});ba.readAsText(da)}else this.doImportVisio(da,f,L,q)}catch(ha){L(ha)}else try{""==aa.responseType||"text"==aa.responseType?L({message:aa.responseText}):(ba=new FileReader,ba.onload=function(){try{L({message:JSON.parse(ba.result).Message})}catch(ha){null!=+ba.result&&0<ba.result.length?L({message:ba.result}):L(ha)}},ba.readAsText(aa.response))}catch(ha){L({})}});aa.send(V)}else if(E.clear())try{this.doImportVisio(c,f,L,q)}catch(da){L(da)}}else L({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?Q():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",Q,null,null,null,L))}),C)};EditorUi.prototype.importGraphML=function(c,f,k){var q=mxUtils.bind(this,+function(x){this.loadingExtensions=!1;null!=k?k(x):this.handleError(x)});this.createTimeout(null,mxUtils.bind(this,function(x){var C=mxUtils.bind(this,function(L){x.clear()&&q(L)}),E=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(x.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,q)}catch(L){C(L)}else C({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?E():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL++"js/extensions.min.js",E,null,null,null,C))}),q)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(k){this.loadingExtensions=!1;this.handleError(k)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(k){var q=mxUtils.bind(this,function(C){k.clear()&&f(C)}),x=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(k.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),+(new VsdxExport(this)).exportCurrentDiagrams(c)||q({message:mxResources.get("unknownError")})}catch(C){q(C)}else q({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(x,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",x,null,null,null,q))}),f):f({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,f,k){var q=+mxUtils.bind(this,function(x){this.loadingExtensions=!1;null!=k?k(x):this.handleError(x)});this.createTimeout(null,mxUtils.bind(this,function(x){var C=mxUtils.bind(this,function(L){x.clear()&&q(L)}),E=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(x.clear())if("undefined"!==typeof window.LucidImporter)try{var L=JSON.parse(c);f(LucidImporter.importState(L));try{if(null!=window.console&&"1"==urlParams.test){var Q=[(new Date).toISOString(),"convertLucidChart",L];null!=L.state&&Q.push(JSON.parse(L.state));+if(null!=L.svgThumbs)for(var V=0;V<L.svgThumbs.length;V++)Q.push(Editor.createSvgDataUri(L.svgThumbs[V]));null!=L.thumb&&Q.push(L.thumb);console.log.apply(console,Q)}}catch(K){}}catch(K){null!=window.console&&console.error(K),C(K)}else C({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(E,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",+function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",E,null,null,null,C)},null,null,null,C)},null,null,null,C)},null,null,null,C)},null,null,null,C):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",E,null,null,null,C))}),q)};EditorUi.prototype.replaceLockedGroupChildren=function(c,f,k,q,x){var C=null!=x&&null!=x.dataAttr?x.dataAttr:"mermaidData",E=null!=x&&null!=x.attrPrefix?+x.attrPrefix:"mermaid",L=this.editor.graph;x=mxUtils.parseXml((null!=x&&null!=x.wrapGroup?x.wrapGroup:mxMermaidToDrawio.wrapGroup)(f,k,q));var Q=new mxCodec(x);f=new mxGraphModel;Q.decode(x.documentElement,f);Q=f.getRoot();var V=null;for(x=0;null!=Q&&x<f.getChildCount(Q)&&null==V;x++)for(var K=f.getChildAt(Q,x),fa=0;fa<f.getChildCount(K);fa++){var aa=f.getChildAt(K,fa),da=aa.value;if(null!=da&&"object"===typeof da&&null!=da.getAttribute&&null!=da.getAttribute(C)){V=aa;break}}if(null!=V){Q=[];for(x=+0;x<f.getChildCount(V);x++)Q.push(f.getChildAt(V,x));0==Q.length&&(Q=[V]);V=f.getGeometry(V);K=da=Infinity;aa=L.model.getChildCount(c);for(x=0;x<aa;x++){var ba=L.model.getChildAt(c,x);L.model.isVertex(ba)&&(ba=ba.getGeometry(),null!=ba&&(da=Math.min(da,ba.x),K=Math.min(K,ba.y)))}var ha=Infinity;ba=Infinity;for(x=0;x<Q.length;x++)f.isVertex(Q[x])&&(aa=Q[x].getGeometry(),null!=aa&&(ha=Math.min(ha,aa.x),ba=Math.min(ba,aa.y)));da=isFinite(da)&&isFinite(ha)?da-ha:0;K=isFinite(K)&&isFinite(ba)?K-ba:0;if(0!=+da||0!=K)for(x=0;x<Q.length;x++)if(ba=Q[x],aa=ba.getGeometry(),null!=aa){aa=aa.clone();if(f.isVertex(ba))aa.x+=da,aa.y+=K;else if(f.isEdge(ba)){if(null!=aa.points)for(ha=0;ha<aa.points.length;ha++)null!=aa.points[ha]&&(aa.points[ha].x+=da,aa.points[ha].y+=K);null!=aa.sourcePoint&&(aa.sourcePoint.x+=da,aa.sourcePoint.y+=K);null!=aa.targetPoint&&(aa.targetPoint.x+=da,aa.targetPoint.y+=K)}f.setGeometry(ba,aa)}f=this.snapshotMermaidIdentity(c,E);Q=L.cloneCells(Q,!0);L.getModel().beginUpdate();try{for(fa=+L.model.getChildCount(c)-1;0<=fa;fa--)L.model.remove(L.model.getChildAt(c,fa));for(x=0;x<Q.length;x++)this.applyMermaidUserCustomizations(Q[x],f,E),L.model.add(c,Q[x]);if(null!=V){var qa=L.model.getGeometry(c);null!=qa&&(qa=qa.clone(),qa.width=V.width,qa.height=V.height,L.model.setGeometry(c,qa))}L.setAttributeForCell(c,C,JSON.stringify({data:k,config:q},null,2))}finally{L.getModel().endUpdate()}}};EditorUi.prototype.snapshotMermaidIdentity=function(c,f){f=null!=f?f:"mermaid";for(var k=this.editor.graph,+q={},x=k.model.getChildCount(c),C=0;C<x;C++){var E=k.model.getChildAt(c,C),L=E.value;if(null!=L&&"object"===typeof L&&null!=L.getAttribute){var Q=L.getAttribute(f+"Id");Q&&(q[Q]={currentStyle:E.style||"",currentLabel:L.getAttribute("label")||"",baseStyle:L.getAttribute(f+"BaseStyle")||"",baseValue:L.getAttribute(f+"BaseValue")||""})}}return q};EditorUi.prototype.applyMermaidUserCustomizations=function(c,f,k){var q=c.value;null!=q&&"object"===typeof q&&null!=q.getAttribute&&(k=q.getAttribute((null!=+k?k:"mermaid")+"Id"))&&(f=f[k],null!=f&&(c.style=this.mergeMermaidStyleDelta(f.baseStyle,f.currentStyle,c.style||"",c.isEdge()),f.currentLabel!==f.baseValue&&q.setAttribute("label",f.currentLabel)))};EditorUi.prototype.mergeMermaidStyleDelta=function(c,f,k,q){function x(K){var fa={},aa=[];if(!K)return{map:fa,keys:aa};K=K.split(";");for(var da=0;da<K.length;da++){var ba=K[da];if(ba){var ha=ba.indexOf("=");if(0<ha){var qa=ba.substring(0,ha);qa in fa||aa.push(qa);fa[qa]=ba.substring(ha+1)}else ba in+fa||aa.push(ba),fa[ba]=!0}}return{map:fa,keys:aa}}c=x(c);f=x(f);var C=x(k),E={exitX:1,exitY:1,exitDx:1,exitDy:1,entryX:1,entryY:1,entryDx:1,entryDy:1,edgeStyle:1,noEdgeStyle:1,orthogonal:1},L=q?{startArrow:1,endArrow:1,startFill:1,endFill:1,startSize:1,endSize:1}:{};q={};k=[];for(var Q=0;Q<C.keys.length;Q++){var V=C.keys[Q];q[V]=C.map[V];k.push(V)}for(Q=0;Q<f.keys.length;Q++)V=f.keys[Q],E[V]||L[V]||f.map[V]===c.map[V]||(V in q||k.push(V),q[V]=f.map[V]);for(Q=0;Q<c.keys.length;Q++)V=c.keys[Q],E[V]||+L[V]||V in f.map||delete q[V];c=[];for(Q=0;Q<k.length;Q++)V=k[Q],f=q[V],void 0!==f&&(!0===f?c.push(V):c.push(V+"="+f));return 0<c.length?c.join(";")+";":""};EditorUi.prototype.getSvgForXml=function(c,f,k){var q=null,x=this.createTemporaryGraph(this.editor.graph.getStylesheet());try{document.body.appendChild(x.container),(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,x.getModel()),q=x.getSvg(null,null,f,null,null,null,null,null,null,null,null,k,null,null,!0,!0)}finally{document.body.removeChild(x.container)}return q};+EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,k,q){var x=0,C=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(E){var L="";if(null!=this.drive&&null!=this.drive.getUser()){var Q=this.drive.getUser();null!=Q.email&&0<Q.email.indexOf("@")&&(L=Q.email.substring(Q.email.indexOf("@")+1))}var V={prompt:c,driveDomain:L,options:null!=q?q:{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"url",["https://www.draw.io/generate/v3"]);+var K=Date.now();L=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(V),"POST");var fa=mxUtils.bind(this,function(da){E.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"error",[da],"time",Date.now()-K+" ms"),k(da))}),aa=mxUtils.bind(this,function(da){3>x++?E.clear()&&C():fa(da)});L.send(mxUtils.bind(this,function(da){if(E.isAlive())if(200<=da.getStatus()&&299>=da.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var ha=da.getText();try{ha=+JSON.parse(ha),result=ha.result}catch(ra){result=ha}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"response",[ha],"time",Date.now()-K+" ms");ha=Editor.extractGraphModelFromText(result);if(null!=ha&&""!=ha[1])E.clear()&&f(ha[1]);else if("<"==mxUtils.trim(result).charAt(0))E.clear()&&f(result);else{var qa=this.extractMermaidDeclaration(result)||result;this.parseMermaidDiagram(qa,null,mxUtils.bind(this,function(ra){this.tryAndHandle(mxUtils.bind(this,function(){E.clear()&&+f(mxMermaidToDrawio.wrapGroup(ra,qa,null))}),fa)}),fa,aa)}}),fa,!0);else{var ba={message:mxResources.get("error")+" "+da.getStatus()};try{ba=JSON.parse(da.getText()),null!=ba.error&&(ba.message=ba.error)}catch(ha){}fa(ba)}}),fa)}),k)});C()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("(Begins)");for(var k=mxUtils.trim(1>=+f.length?c:f[1]),q=k.split("\n"),x=0;x<q.length&&("mermaid"==q[x]||0==q[x].trim().length||"%%"==q[x].substring(0,2));)x++;k=[];for(var C=x;C<q.length;C++){var E=mxUtils.trim(q[C]);if("%%"!=E.substring(0,2)&&"classDef "!=E.substring(0,9))k.push(q[C]);else if("mermaid"==E)break}q=k;k=mxUtils.trim(q.join("\n"));C="undefined"!==typeof MermaidParser?MermaidParser.detectType(k):null;EditorUi.debug("EditorUi.extractMermaidDeclaration","value",[c],"text",[k],"typeInfo",[C],"startLine",x,"lines",q,"tokens",+f);return null!=C?k:null};EditorUi.prototype.getMermaidDiagramType=function(c){var f=null!=c?c.split("\n"):[],k=0;c=function(){for(;k<f.length&&(0==f[k].trim().length||"%%"==f[k].substring(0,2));)k++};c();if(k<f.length&&"---"==f[k].trim()){do k++;while(k<f.length&&"---"!=f[k].trim());k++;c()}if(k>=f.length)return"";c=f[k].trim().toLowerCase();var q=c.indexOf(" ");return c.substring(0,0<q?q:c.length)};EditorUi.prototype.isMermaidElkFlowchart=function(c){return null!=c&&(/defaultRenderer["']?\s*:\s*["']?elk/i.test(c)||+/(?:^|\n)\s*layout\s*:\s*["']?elk\b/i.test(c))&&/(?:flowchart|graph)\b/i.test(c)};EditorUi.prototype.applyMermaidElkPostPass=function(c,f,k){if("undefined"===typeof ElkLayout||"undefined"===typeof Graph)k(c);else{f=f.match(/(?:flowchart|graph)\s+(LR|RL|TB|TD|BT)/i);var q={LR:"RIGHT",RL:"LEFT",TB:"DOWN",TD:"DOWN",BT:"UP"};f=f?q[f[1].toUpperCase()]||"DOWN":"DOWN";var x=document.createElement("div");x.style.cssText="position:absolute;left:-99999px;top:-99999px;width:1200px;height:800px;visibility:hidden;";+document.body.appendChild(x);var C=null,E=!1,L=function(V){if(!E){E=!0;try{null!=C&&C.destroy()}catch(K){}x.remove();k(V)}};try{C=new Graph(x);C.foldingEnabled=!1;C.setEnabled(!1);C.setHtmlLabels(!0);var Q=mxUtils.parseXml(c);(new mxCodec(Q)).decode(Q.documentElement,C.getModel());(new ElkLayout(C,"layered",{"elk.direction":f,"elk.layered.cycleBreaking.strategy":"GREEDY"},Object.assign({mermaidPolicy:!0},ElkLayout.CANONICAL_EDGE))).execute(C.getDefaultParent(),function(V){var K=null;if(!V)try{var fa=+new mxCodec;K=mxUtils.getXml(fa.encode(C.getModel()))}catch(aa){}L(null!=K?K:c)})}catch(V){if(E)throw V;L(c)}}};EditorUi.prototype.parseMermaidDiagram=function(c,f,k,q,x){var C=mxUtils.bind(this,function(L){null!=x?x(L):null!=q?q(L):this.handleError(L)});if(EditorUi.isMermaidSupported())try{var E=mxMermaidToDrawio.parseText(c,this.getMermaidConfig(c,f));null!=E?this.isMermaidElkFlowchart(c)?this.applyMermaidElkPostPass(E,c,k):k(E):C(Error("Unsupported diagram type: "+this.getMermaidDiagramType(c)))}catch(L){C(L)}else C(Error("Mermaid parser not available"))};+EditorUi.prototype.loadMermaid=function(c,f){var k=mxUtils.bind(this,function(x){this.loadingMermaid=!1;f(x)}),q=mxUtils.bind(this,function(){try{this.loadingMermaid=!1,c()}catch(x){k(x)}});"undefined"!==typeof mxMermaidToDrawio||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(q,0):(this.loadingMermaid=!0,"undefined"!==typeof urlParams&&"1"==urlParams.dev||window.location.search&&0<=window.location.search.indexOf("dev=1")?mxscript("js/elk/drawio-elk.min.js",function(){mxscript("js/mermaid/drawio-mermaid.min.js",+q,null,null,null,k)},null,null,null,k):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,k))};EditorUi.prototype.loadPlantUml=function(c,f){var k=mxUtils.bind(this,function(C){this.loadingPlantUml=!1;f(C)}),q=mxUtils.bind(this,function(){try{this.loadingPlantUml=!1,c()}catch(C){k(C)}});if("undefined"!==typeof mxPlantUmlToDrawio||this.loadingPlantUml)window.setTimeout(q,0);else{this.loadingPlantUml=!0;var x="undefined"!==typeof urlParams&&"1"==urlParams.dev||window.location.search&&+0<=window.location.search.indexOf("dev=1");mxscript((x?"":window.DRAWIO_SERVER_URL)+"js/plantuml/drawio-plantuml.min.js",q,null,null,null,k)}};EditorUi.prototype.parsePlantUmlDiagram=function(c,f,k,q){var x=mxUtils.bind(this,function(C){null!=q?q(C):this.handleError(C)});this.loadPlantUml(mxUtils.bind(this,function(){if(EditorUi.isNativePlantUmlSupported())try{k(mxPlantUmlToDrawio.parseText(c,f))}catch(C){x(C)}else x(Error("PlantUML parser not available"))}),x)};EditorUi.prototype.parsePlantUmlImage=+function(c,f,k){this.parsePlantUmlDiagram(c,null,mxUtils.bind(this,function(q){f(this.createMermaidImageXml(c,null,q,null,null,"plantUmlData"))}),k)};EditorUi.prototype.getMermaidConfig=function(c,f){f=null!=f?f:mxUtils.clone(EditorUi.defaultMermaidConfig);f.securityLevel="strict";f.startOnLoad=!1;f.maxTextSize=9E5;return f};EditorUi.prototype.getMermaidImageForXml=function(c,f){f=parseFloat(f);f=isNaN(f)?EditorUi.mermaidImageBorder:f;c=this.getSvgForXml(c,f,"auto");var k=parseFloat(c.getAttribute("width")),+q=parseFloat(c.getAttribute("height"));if(isNaN(k)||isNaN(q)){try{var x=c.getAttribute("viewBox").split(/\s+/);k=parseFloat(x[2]);q=parseFloat(x[3])}catch(C){}k=k||100;q=q||100}return{data:this.convertDataUri(Editor.createSvgDataUri(mxUtils.getXml(c))),width:k,height:q,border:f}};EditorUi.prototype.createMermaidImageXml=function(c,f,k,q,x,C){x=this.getMermaidImageForXml(k,x);k=new Graph(document.createElement("div"));x=k.insertVertex(null,null,null,0,0,x.width,x.height,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;editIcon=1;groupPadding="++x.border+";image="+x.data+";");k.setAttributeForCell(x,null!=C?C:"mermaidData",JSON.stringify({data:c,config:f},null,2));null!=q&&k.setAttributeForCell(x,"templatePrompt",q);c=new mxCodec;return mxUtils.getXml(c.encode(k.getModel()))};EditorUi.prototype.parseMermaidImage=function(c,f,k){this.parseMermaidDiagram(c,mxUtils.clone(EditorUi.legacyMermaidConfig),mxUtils.bind(this,function(q){f(this.createMermaidImageXml(c,null,q))}),k)};EditorUi.prototype.getMermaidImageBorder=function(c,f){c=parseFloat(mxUtils.getValue(this.editor.graph.getCurrentCellStyle(c,+!0),"groupPadding",""));return isNaN(c)?f:c};EditorUi.prototype.updateMermaidImage=function(c,f,k,q,x,C){var E=this.editor.graph;q=this.getMermaidImageForXml(q,x);E.setCellStyles("image",q.data,[c]);E.setCellStyles("editIcon","1",[c]);E.setCellStyles("groupPadding",q.border,[c]);x=E.model.getGeometry(c);null!=x&&(x=x.clone(),x.width=q.width,x.height=q.height,E.cellsResized([c],[x],!1));E.setAttributeForCell(c,null!=C?C:"mermaidData",JSON.stringify({data:f,config:k},null,2))};EditorUi.prototype.refreshMermaidImage=+function(c){var f=this.editor.graph,k=f.getAttributeForCell(c,"plantUmlData"),q=null!=k?"plantUmlData":"mermaidData";k=null!=k?k:f.getAttributeForCell(c,"mermaidData");var x=null;if(null!=k)try{x=JSON.parse(k)}catch(L){}if(null!=x&&null!=x.data&&null==x.format){var C=this.getMermaidImageBorder(c,x.border);k=function(){};var E=mxUtils.bind(this,function(L){if(f.model.contains(c)&&this.getMermaidImageBorder(c,x.border)==C){f.model.beginUpdate();try{this.updateMermaidImage(c,x.data,null,L,C,q)}finally{f.model.endUpdate()}}});+"plantUmlData"==q?this.parsePlantUmlDiagram(x.data,null,E,k):this.parseMermaidDiagram(x.data,mxUtils.clone(EditorUi.legacyMermaidConfig),E,k)}};EditorUi.prototype.replaceMermaidCell=function(c,f){var k=this.editor.graph,q=k.getBoundingBoxFromGeometry([c]),x=null!=q?q.x:0;q=null!=q?q.y:0;for(var C=k.model.getParent(c);null!=C&&k.model.isVertex(C);){var E=k.model.getGeometry(C);null!=E&&(x+=E.x,q+=E.y);C=k.model.getParent(C)}k.getModel().beginUpdate();try{var L=this.importXml(f,x,q,!0,null,null,!0);+k.model.remove(c);k.setSelectionCells(L)}finally{k.getModel().endUpdate()}k.scrollCellToVisible(k.getSelectionCell());return L};EditorUi.prototype.insertAsPreText=function(c,f,k){var q=this.editor.graph,x=null;q.getModel().beginUpdate();try{x=q.insertVertex(null,null,"<pre>"+c+"</pre>",f,k,1,1,"text;html=1;align=left;verticalAlign=top;"),q.updateCellSize(x,!0)}finally{q.getModel().endUpdate()}return x};EditorUi.prototype.insertTextAt=function(c,f,k,q,x,C,E,L){C=null!=C?C:!0;E=null!=E?E:!0;if(null!=+c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(aa){4==aa.readyState&&200<=aa.status&&299>=aa.status&&this.editor.graph.setSelectionCells(this.insertTextAt(aa.responseText,f,k,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(x||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var Q=this.editor.graph;if("data:application/pdf;base64,"==+c.substring(0,28)){var V=Editor.extractGraphModelFromPdf(c);if(null!=V&&0<V.length)return this.importXml(V,f,k,C,!0,L)}if(Editor.isPngDataUrl(c)&&(V=Editor.extractGraphModelFromPng(c),null!=V&&0<V.length))return this.importXml(V,f,k,C,!0,L);if("data:image/svg+xml;"==c.substring(0,19))try{V=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(V=c.substring(c.indexOf(",")+1),V=window.atob&&!mxClient.IS_SF?atob(V):Base64.decode(V,!0)):V=decodeURIComponent(c.substring(c.indexOf(",")+1));var K=this.importXml(V,+f,k,C,!0,L);if(0<K.length)return K}catch(aa){}this.loadImage(c,mxUtils.bind(this,function(aa){if("data:"==c.substring(0,5))this.resizeImage(aa,Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(ha,qa,ra){Q.setSelectionCell(Q.insertVertex(null,null,"",Q.snap(f),Q.snap(k),qa,ra,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(ha)+";"))}),E,this.maxImageSize);else{var da=Math.min(1,+Math.min(this.maxImageSize/aa.width,this.maxImageSize/aa.height)),ba=Math.round(aa.width*da);aa=Math.round(aa.height*da);Q.setSelectionCell(Q.insertVertex(null,null,"",Q.snap(f),Q.snap(k),ba,aa,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var aa=null;Q.getModel().beginUpdate();try{aa=Q.insertVertex(Q.getDefaultParent(),null,c,Q.snap(f),Q.snap(k),1,1,"text;"+(q?"html=1;":"")),Q.updateCellSize(aa),+Q.fireEvent(new mxEventObject("textInserted","cells",[aa]))}finally{Q.getModel().endUpdate()}Q.setSelectionCell(aa)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,f,k,C,null,L);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(aa){this.editor.graph.setSelectionCells(this.importXml(aa,f,k,C,null,L))}),mxUtils.bind(this,function(aa){this.handleError(aa)}));else{Q=this.editor.graph;x=null;Q.getModel().beginUpdate();+try{x=Q.insertVertex(Q.getDefaultParent(),null,"",Q.snap(f),Q.snap(k),1,1,"text;whiteSpace=wrap;"+(q?"html=1;":""));Q.fireEvent(new mxEventObject("textInserted","cells",[x]));q&&(c=Q.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");x.value=c;Q.updateCellSize(x);if(0<this.maxTextWidth&&x.geometry.width>this.maxTextWidth){var fa=Q.getPreferredSizeForCell(x,this.maxTextWidth);x.geometry.width=fa.width;x.geometry.height=fa.height}Graph.isLink(x.value)&&Q.setLinkForCell(x,+x.value);x.geometry.width+=Q.gridSize;x.geometry.height+=Q.gridSize}finally{Q.getModel().endUpdate()}return[x]}}return[]};EditorUi.prototype.formatFileSize=function(c){var f=-1;do c/=1024,f++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[f]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var f=c.indexOf(";");0<f&&(c=c.substring(0,f)+c.substring(c.indexOf(",",f+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,f){return/("contentType":\s*"application\/gliffy\+json")/.test(c)};+EditorUi.prototype.isLucidChartData=function(c){return null!=c&&('{"state":"{\\"Properties\\":'==c.substring(0,26)||'{"Properties":'==c.substring(0,14))};EditorUi.prototype.importLocalFile=function(c,f){if(c&&Graph.fileSupport){if(null==this.importFileInputElt){var k=document.createElement("input");k.setAttribute("type","file");mxEvent.addListener(k,"change",mxUtils.bind(this,function(){null!=k.files&&(this.importFiles(k.files,null,null,this.maxImageSize),k.type="",k.type="file",k.value="")}));k.style.display=+"none";document.body.appendChild(k);this.importFileInputElt=k}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(E,L){StorageFile.listFiles(this,"F",E,L)});window.openBrowserFile=mxUtils.bind(this,function(E,L,Q){StorageFile.getFileContent(this,E,L,Q)});window.deleteBrowserFile=mxUtils.bind(this,function(E,L,Q){StorageFile.deleteFile(this,E,L,Q)});if(!f){var q=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=+new OpenFile(mxUtils.bind(this,function(E){this.hideDialog(E)}));window.openFile.setConsumer(mxUtils.bind(this,function(E,L){null!=L&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(L)?(E=new Blob([E],{type:"application/octet-stream"}),this.importVisio(E,mxUtils.bind(this,function(Q){this.importXml(Q,0,0,!0)}),null,L)):this.editor.graph.setSelectionCells(this.importXml(E,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,+function(){window.openFile=null});if(!f){var x=this.dialog,C=x.close;this.dialog.close=mxUtils.bind(this,function(E){Editor.useLocalStorage=q;C.apply(x,arguments);E&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,f,k){var q=this,x=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(C){if(mxUtils.isEmptyObject(C.files))k();else{var E=0,L,Q=!1;C.forEach(function(V,K){V=+K.name.toLowerCase();"diagram/diagram.xml"==V?(Q=!0,K.async("string").then(function(fa){0==fa.indexOf("<mxfile ")?f(fa):k()})):0==V.indexOf("versions/")&&(V=parseInt(V.substr(9)),V>E&&(E=V,L=K))});0<E?L.async("string").then(function(V){(new XMLHttpRequest).upload&&q.isRemoteFileFormat(V,c.name)?q.isOffline()?q.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):q.parseFileData(V,mxUtils.bind(this,function(K){4==K.readyState&&(200<=K.status&&299>=K.status?f(K.responseText):k())}),+c.name):k()}):Q||k()}},function(C){k(C)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?x():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",x,null,null,null,k))};EditorUi.prototype.importFile=function(c,f,k,q,x,C,E,L,Q,V,K,fa){V=null!=V?V:!0;var aa=!1,da=null,ba=mxUtils.bind(this,function(ha){var qa=null;null!=ha&&"<mxlibrary"==ha.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,ha,E)),this.showSidebar()):qa=this.importXml(ha,+k,q,V,null,null!=fa?mxEvent.isControlDown(fa):null);null!=L&&L(qa)});"image"==f.substring(0,5)?(Q=!1,"image/png"==f.substring(0,9)&&(K=K?null:this.extractGraphModelFromPng(c),null!=K&&0<K.length&&(da=this.importXml(K,k,q,V,null,null!=fa?mxEvent.isControlDown(fa):null),Q=!0)),Q||(Q=this.editor.graph,K=c.indexOf(";"),0<K&&(c=c.substring(0,K)+c.substring(c.indexOf(",",K+1))),V&&Q.isGridEnabled()&&(k=Q.snap(k),q=Q.snap(q)),K="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;",+"image/svg"==f.substring(0,9)&&(K+="editableCssRules=.*;"),da=[Q.insertVertex(null,null,"",k,q,x,C,K+"image="+c+";")])):/(\.*<graphml )/.test(c)?(aa=!0,this.importGraphML(c,ba)):null!=Q&&null!=E&&EditorUi.isVisioFilename(E)?(aa=!0,this.importVisio(Q,ba)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,E)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(aa=!0,f=mxUtils.bind(this,function(ha){4==ha.readyState&&(200<=ha.status&&299>=ha.status?ba(ha.responseText):+null!=L&&(L(null),this.showError(mxResources.get("error"),413==ha.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,f,E):this.parseFile(Q,f,E)):0==c.indexOf("PK")&&null!=Q?(aa=!0,this.importZipFile(Q,ba,mxUtils.bind(this,function(){da=this.insertTextAt(this.validateFileData(c),k,q,!0,null,V);L(da)}))):/(\.v(sd|dx))($|\?)/i.test(E)||/(\.vs(s|x))($|\?)/i.test(E)||(da=this.insertTextAt(this.validateFileData(c),k,q,!0,null,V,null,null!=fa?mxEvent.isControlDown(fa):+null));aa||null==L||L(da);return da};EditorUi.prototype.importFiles=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa){q=null!=q?q:this.maxImageSize;V=null!=V?V:this.maxImageBytes;var da=null!=f&&null!=k,ba=!0;f=null!=f?f:0;k=null!=k?k:0;var ha=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var qa=K||this.resampleThreshold,ra=0;ra<c.length;ra++)if("image/svg"!==c[ra].type.substring(0,9)&&"image/"===c[ra].type.substring(0,6)&&c[ra].size>qa){ha=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[f],+"y",[k],"maxSize",[q],"maxBytes",[V],"resampleThreshold",[this.resampleThreshold],"largeImages",[ha],"crop",[da],"resizeImages",[ba],"ignoreEmbeddedXml",[fa],"evt",[aa]);var l=mxUtils.bind(this,function(){var t=this.editor.graph,H=t.gridSize;x=null!=x?x:mxUtils.bind(this,function(ja,X,ka,na,la,ua,za,sa,wa){try{if(null!=ja&&"<mxlibrary"==ja.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,ja,za)),this.showSidebar(),null;this.isCompatibleString(ja)&&1==c.length&&null!=+aa&&"drop"==aa.type&&this.isBlankFile()&&!this.canUndo()&&(da=!1,na=ka=0);return this.importFile(ja,X,ka,na,la,ua,za,sa,wa,da,fa,aa)}catch(Ca){return this.handleError(Ca),null}});C=null!=C?C:mxUtils.bind(this,function(ja){t.setSelectionCells(ja)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var J=this.currentPage,R=c.length,T=R,Y=[],Z=mxUtils.bind(this,function(ja,X){Y[ja]=X;if(0==--T){this.spinner.stop();if(null!=L)L(Y);else{var ka=[];t.getModel().beginUpdate();try{for(ja=+0;ja<Y.length;ja++){var na=Y[ja]();null!=na&&(ka=ka.concat(na))}}finally{t.getModel().endUpdate()}}J!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);C(ka)}}),ia=0;ia<R;ia++)mxUtils.bind(this,function(ja){var X=c[ja];if(null!=X){var ka=new FileReader;ka.onload=mxUtils.bind(this,function(na){if(null==E||E(X))try{if("image/"==X.type.substring(0,6))if("image/svg"==X.type.substring(0,9)){var la=Graph.clipSvgDataUri(na.target.result),ua=la.indexOf(","),+za=decodeURIComponent(escape(atob(la.substring(ua+1)))),sa=mxUtils.parseXml(za),wa=sa.getElementsByTagName("svg");if(0<wa.length){var Ca=wa[0],Fa=fa?null:Ca.getAttribute("content");null!=Fa&&"<"!=Fa.charAt(0)&&"%"!=Fa.charAt(0)&&(Fa=unescape(window.atob?atob(Fa):Base64.decode(Fa,!0)));null!=Fa&&"%"==Fa.charAt(0)&&(Fa=decodeURIComponent(Fa));null==Fa||"<mxfile "!==Fa.substring(0,8)&&"<mxGraphModel>"!==Fa.substring(0,14)&&"<mxGraphModel "!==Fa.substring(0,14)?Z(ja,mxUtils.bind(this,function(){try{if(null!=+sa){var La=sa.getElementsByTagName("svg");if(0<La.length){var Da=La[0],Sa=Da.getAttribute("width"),Oa=Da.getAttribute("height");Sa=null!=Sa&&"%"!=Sa.charAt(Sa.length-1)?parseFloat(Sa):NaN;Oa=null!=Oa&&"%"!=Oa.charAt(Oa.length-1)?parseFloat(Oa):NaN;var Ta=Da.getAttribute("viewBox");if(null==Ta||0==Ta.length)Da.setAttribute("viewBox","0 0 "+Sa+" "+Oa);else if(isNaN(Sa)||isNaN(Oa)){var Ua=Ta.split(" ");3<Ua.length&&(Sa=parseFloat(Ua[2]),Oa=parseFloat(Ua[3]))}la=Editor.createSvgDataUri(mxUtils.getXml(Da));+var Ba=Math.min(1,Math.min(q/Math.max(1,Sa)),q/Math.max(1,Oa)),Ka=x(la,X.type,f+ja*H,k+ja*H,Math.max(1,Math.round(Sa*Ba)),Math.max(1,Math.round(Oa*Ba)),X.name);if(null!=Ka&&(isNaN(Sa)||isNaN(Oa))){var ab=new Image;ab.onload=mxUtils.bind(this,function(){Sa=Math.max(1,ab.width);Oa=Math.max(1,ab.height);Ka[0].geometry.width=Sa;Ka[0].geometry.height=Oa;Da.setAttribute("viewBox","0 0 "+Sa+" "+Oa);la=Editor.createSvgDataUri(mxUtils.getXml(Da));var Qa=la.indexOf(";");0<Qa&&(la=la.substring(0,Qa)+la.substring(la.indexOf(",",+Qa+1)));t.setCellStyles("image",la,[Ka[0]])});ab.src=Editor.createSvgDataUri(mxUtils.getXml(Da))}return Ka}}}catch(Qa){}return null})):Z(ja,mxUtils.bind(this,function(){return x(Fa,"text/xml",f+ja*H,k+ja*H,0,0,X.name)}))}else Z(ja,mxUtils.bind(this,function(){return null}))}else{ua=!1;if("image/png"==X.type){var Ha=fa?null:this.extractGraphModelFromPng(na.target.result);if(null!=Ha&&0<Ha.length){var Na=new Image;Na.src=na.target.result;Z(ja,mxUtils.bind(this,function(){return x(Ha,"text/xml",f+ja*+H,k+ja*H,Na.width,Na.height,X.name)}));ua=!0}}ua||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(na.target.result,mxUtils.bind(this,function(La){this.resizeImage(La,Editor.stripImageMetadata(na.target.result,Editor.removeImageMetadata),mxUtils.bind(this,+function(Da,Sa,Oa){Z(ja,mxUtils.bind(this,function(){if(null!=Da&&Da.length<V){var Ta=ba&&this.isResampleImageSize(X.size,K)?Math.min(1,Math.min(q/Sa,q/Oa)):1;return x(Da,X.type,f+ja*H,k+ja*H,Math.round(Sa*Ta),Math.round(Oa*Ta),X.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),ba,q,K,X.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else la=na.target.result,x(la,X.type,f+ja*H,k+ja*H,240,160,X.name,function(La){Z(ja,+function(){return La})},X)}catch(La){Z(ja,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(La,X)}else Z(ja,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(X.name)?x(null,X.type,f+ja*H,k+ja*H,240,160,X.name,function(na){Z(ja,function(){return na})},X):"image"==X.type.substring(0,5)||"application/pdf"==X.type?ka.readAsDataURL(X):ka.readAsText(X)}})(ia)});if(ha){ha=[];for(ra=0;ra<c.length;ra++)ha.push(c[ra]);c=ha;this.confirmImageResize(function(t){ba=+t;l()},Q)}else l()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,f){f=null!=f?f:!1;var k=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},q=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,x=function(C,E){if(C||f)mxSettings.setResizeImages(C?E:null),mxSettings.save();+k();c(E)};null==q||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(C){x(C,!0)},function(C){x(C,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):x(!1,q)};EditorUi.prototype.parseFile=function(c,f,k){k=null!=k?k:c.name;var q=+new FileReader;q.onload=mxUtils.bind(this,function(){this.parseFileData(q.result,f,k)});q.readAsText(c)};EditorUi.prototype.parseFileData=function(c,f,k){var q=new XMLHttpRequest;q.open("POST",OPEN_URL);q.setRequestHeader("Content-Type","application/x-www-form-urlencoded");q.onreadystatechange=function(){f(q)};q.send("format=xml&filename="+encodeURIComponent(k)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(x){}};EditorUi.prototype.isResampleImageSize=+function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,k,q,x,C,E){x=null!=x?x:this.maxImageSize;var L=Math.max(1,c.width),Q=Math.max(1,c.height),V=f;if(q&&this.isResampleImageSize(null!=E?E:f.length,C))try{var K=Math.max(L/x,Q/x);if(1<K){var fa=Math.round(L/K),aa=Math.round(Q/K),da=document.createElement("canvas");da.width=fa;da.height=aa;da.getContext("2d").drawImage(c,0,0,fa,aa);var ba=da.toDataURL();if(ba.length<f.length){var ha=document.createElement("canvas");+ha.width=fa;ha.height=aa;var qa=ha.toDataURL();ba!==qa&&(f=ba,L=fa,Q=aa)}}}catch(ra){}q&&V!=f&&x>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,k,q,x/1.5,C,E):k(f,L,Q)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,f,k){try{var q=new Image;q.onload=function(){q.width=0<q.width?q.width:120;q.height=0<q.height?q.height:120;f(q)};null!=k&&(q.onerror=k);q.src=c}catch(x){if(null!=k)k(x);+else throw x;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var u=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){if(Editor.isSettingsEnabled()){null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles);this.formatWidth=mxSettings.getFormatWidth();var c=mxSettings.getSidebarWidth();null!=c&&(this.hsplitPosition=parseInt(c))}this.formatEnabled||+(this.formatWidth=0);this.sidebarEnabled||(this.hsplitPosition=0);u.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var n=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,f=this.editor.graph;"undefined"!==typeof LibavoidRouting&&null!=+LibavoidRouting.installAutoRouting&&LibavoidRouting.installAutoRouting(this);this.addListener("styleChanged",mxUtils.bind(this,function(X,ka){ka.getProperty("force")&&"undefined"!==typeof mxSettings&&null!=mxSettings.setCurrentEdgeStyle&&null!=mxSettings.settings&&mxSettings.setCurrentEdgeStyle(mxUtils.clone(this.editor.graph.currentEdgeStyle))}));this.restorePersistedEdgeStyle();if(this.editor.isChromelessView()&&"0"!=urlParams.animate){var k=null,q=function(){var X=f.getModel().getRoot();if(X===+k&&null!=c.chromelessAnimationPlayer)return!0;k=X;null!=c.chromelessAnimationPlayer&&c.chromelessAnimationPlayer.stop();c.chromelessAnimationPlayer=Editor.playAnimationOnGraph(f);return null!=c.chromelessAnimationPlayer};q();this.editor.addListener("fileLoaded",q);f.addListener(mxEvent.ROOT,q)}var x=f.isEnabled;f.isEnabled=function(){return x.apply(this,arguments)&&!c.isLocked()};f.showLinkIcons=Editor.showLinkIcons||"1"==urlParams["link-icons"];f.showTooltipIcons=Editor.showTooltipIcons||"1"==urlParams["tooltip-icons"];+var C=this;f.editTooltip=function(X){null!=X&&C.actions.get("editTooltip").funct()};f.getLinkOverlayTooltip=function(X){if(Graph.isPageLink(X)&&null!=C.pages){var ka=X.substring(X.indexOf(",")+1);ka=C.getPageById(ka);if(null!=ka)return ka.getName()||mxResources.get("pageWithNumber",[mxUtils.indexOf(C.pages,ka)+1])}else if(this.isCustomLink(X))return this.getLinkTitle(X);return X};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(X){var ka=X.getEvent();return null==X.getState()&&!mxEvent.isMouseEvent(ka)&&+!f.freehand.isDrawing()||mxEvent.isPopupTrigger(ka)&&(null==X.getState()||mxEvent.isControlDown(ka)||mxEvent.isShiftDown(ka))});var E=function(X){X=/(?:^|;)groupPadding=([^;]*)/.exec(null!=X?X:"");return null!=X?X[1]:null};f.model.addListener(mxEvent.BEFORE_UNDO,function(X,ka){X=ka.getProperty("edit");if(null!=X&&null!=X.changes){ka=X.changes.length;for(var na=[],la=0;la<ka;la++){var ua=X.changes[la];ua instanceof mxStyleChange&&null!=ua.cell&&f.model.isVertex(ua.cell)&&E(ua.style)!=E(ua.previous)&&+/(?:^|;)shape=image(?:;|$)/.test(null!=ua.style?ua.style:"")&&(null!=f.getAttributeForCell(ua.cell,"mermaidData")||null!=f.getAttributeForCell(ua.cell,"plantUmlData"))&&0>mxUtils.indexOf(na,ua.cell)&&na.push(ua.cell)}for(la=0;la<na.length;la++)c.refreshMermaidImage(na[la])}});var L=function(X){var ka=!1;c.showDialog(X.container,640,420,!0,!0,function(na,la){if(!ka&&X.shouldConfirmClose())return c.confirm(mxResources.get("allChangesLost"),null,function(){ka=!0;c.hideDialog(!0)},mxResources.get("cancel"),+mxResources.get("discardChanges")),!1},null,null,new mxRectangle(0,0,320,280),!0);X.init()};f.cellEditor.editPlantUmlData=function(X,ka,na){var la=JSON.parse(na);ka=f.getCurrentCellStyle(X);var ua=mxUtils.getValue(ka,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,za=null==la.format&&!ua;ka="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var sa=document.createElement("select");sa.className="geBtn";na=document.createElement("option");na.setAttribute("value","plantUmlDiagram");mxUtils.write(na,+mxResources.get("diagram"));sa.appendChild(na);na=document.createElement("option");na.setAttribute("value","plantUmlImage");mxUtils.write(na,mxResources.get("image"));sa.appendChild(na);sa.value=ua?"plantUmlImage":"plantUmlDiagram";var wa=new SimpleTextareaDialog(c,la.data,function(Ca){if(null!=Ca&&c.spinner.spin(document.body,mxResources.get("inserting"))){var Fa="plantUmlImage"==sa.value,Ha=za?la.config:null;c.parsePlantUmlDiagram(Ca,Ha,function(Na){c.spinner.stop();wa.hide();try{f.getModel().beginUpdate();+try{if(ua&&Fa)c.updateMermaidImage(X,Ca,null,Na,c.getMermaidImageBorder(X,la.border),"plantUmlData");else if(za&&!Fa)c.replaceLockedGroupChildren(X,Na,Ca,Ha,{wrapGroup:mxPlantUmlToDrawio.wrapGroup,dataAttr:"plantUmlData",attrPrefix:"plantUml"});else{var La=c.getMermaidImageBorder(X,la.border),Da=c.replaceMermaidCell(X,Fa?c.createMermaidImageXml(Ca,null,Na,null,La,"plantUmlData"):mxPlantUmlToDrawio.wrapGroup(Na,Ca,Ha));Fa||null==La||f.setCellStyles("groupPadding",La,Da)}}finally{f.getModel().endUpdate()}}catch(Sa){c.handleError(Sa)}},+function(Na){c.spinner.stop();c.handleError(Na)})}},null,null,ka?sa:null,!0);L(wa)};f.cellEditor.editMermaidData=function(X,ka,na){var la=JSON.parse(na);ka=f.getCurrentCellStyle(X);var ua=mxUtils.getValue(ka,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE;ka="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var za=document.createElement("select");za.className="geBtn";na=document.createElement("option");na.setAttribute("value","mermaid");mxUtils.write(na,mxResources.get("diagram"));+za.appendChild(na);na=document.createElement("option");na.setAttribute("value","mermaidImage");mxUtils.write(na,mxResources.get("image"));za.appendChild(na);za.value=ua?"mermaidImage":"mermaid";var sa=new SimpleTextareaDialog(c,la.data,function(wa){if(null!=wa&&c.spinner.spin(document.body,mxResources.get("inserting"))){var Ca="mermaidImage"==za.value,Fa=Ca?EditorUi.legacyMermaidConfig:ua?null:la.config;c.parseMermaidDiagram(wa,mxUtils.clone(Fa),function(Ha){c.spinner.stop();sa.hide();try{f.getModel().beginUpdate();+try{if(ua&&Ca)c.updateMermaidImage(X,wa,null,Ha,c.getMermaidImageBorder(X,la.border));else if(ua||Ca){var Na=c.getMermaidImageBorder(X,la.border),La=c.replaceMermaidCell(X,Ca?c.createMermaidImageXml(wa,null,Ha,null,Na):mxMermaidToDrawio.wrapGroup(Ha,wa,Fa));Ca||null==Na||f.setCellStyles("groupPadding",Na,La)}else c.replaceLockedGroupChildren(X,Ha,wa,Fa)}finally{f.getModel().endUpdate()}}catch(Da){c.handleError(Da)}},function(Ha){c.spinner.stop();c.handleError(Ha)})}},null,null,ka?za:null,!0);L(sa)};+var Q=f.cellEditor.startEditing;f.cellEditor.startEditing=function(X,ka,na){try{var la=this.graph.getLockedGroupAncestor(X);null!=la&&(X=la);var ua=this.graph.getAttributeForCell(X,"plantUmlData");if(null!=ua)this.editPlantUmlData(X,ka,ua);else if(ua=this.graph.getAttributeForCell(X,"mermaidData"),null!=ua&&EditorUi.isMermaidSupported())this.editMermaidData(X,ka,ua);else{var za=f.getCellStyle(X);"1"==mxUtils.getValue(za,"metaEdit","0")?c.showDataDialog(X):Q.call(this,X,ka,na)}}catch(sa){c.handleError(sa)}};+f.getLinkTitle=function(X){return c.getLinkTitle(X)};f.customLinkClicked=function(X,ka){var na=!1;try{var la=this.view.graphBounds,ua=null!=la?new mxRectangle(la.x,la.y,la.width,la.height):null;c.handleCustomLink(X,ka);na=!0;var za=this.view.graphBounds;c.chromelessResize&&null!=ua&&null!=za&&!ua.equals(za)&&(c.chromelessResize(),this.scrollCellToVisible(ka))}catch(sa){c.handleError(sa)}return na};var V=f.parseBackgroundImage;f.parseBackgroundImage=function(X){var ka=V.apply(this,arguments);null!=+ka&&null!=ka.src&&Graph.isPageLink(ka.src)&&(ka={originalSrc:ka.src});return ka};var K=f.setBackgroundImage;f.setBackgroundImage=function(X){null!=X&&null!=X.originalSrc&&(X=c.createImageForPageLink(X.originalSrc,c.currentPage,this));K.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,+function(X,ka){X=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=X){var na=X.indexOf(",");if(0<na)for(X=X.substring(na+1),ka=ka.getProperty("patches"),na=0;na<ka.length;na++)if(null!=ka[na][EditorUi.DIFF_UPDATE]&&null!=ka[na][EditorUi.DIFF_UPDATE][X]||null!=ka[na][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(ka[na][EditorUi.DIFF_REMOVE],X)){f.refreshBackgroundImage();break}}}));var fa=f.getBackgroundImageObject;f.getBackgroundImageObject=function(X,ka,na){var la=fa.apply(this,arguments);+null!=la&&null!=la.originalSrc&&(la=ka?c.createImageForPageLink(la.originalSrc,na,null,!0):{src:la.originalSrc});return la};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var aa=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=+function(X){X=null!=X?X:"";"1"==urlParams.dev&&(X+=(0<X.length?"&":"?")+"dev=1");"1"==urlParams.test&&(X+=(0<X.length?"&":"?")+"test=1");return aa.apply(this,arguments)};var da=f.addClickHandler;f.addClickHandler=function(X,ka,na){var la=ka;ka=function(ua,za,sa){if(null==za){var wa=mxEvent.getSource(ua);"a"==wa.nodeName.toLowerCase()&&(za=wa.getAttribute("href"))}null!=za&&f.isCustomLink(za)&&(mxEvent.isTouchEvent(ua)||!mxEvent.isPopupTrigger(ua))&&f.customLinkClicked(za,sa)&&mxEvent.consume(ua);+null!=la&&la(ua,za,sa)};da.call(this,X,ka,na)};n.apply(this,arguments);Graph.browserTranslate&&f.waitForBrowserTranslate();this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var ba=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(X,ka,na){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(X,["zoomIn","zoomOut","-"],null,na);if(Editor.passiveScroll&&null!=na){var la=mxUtils.convertPoint(f.container,mxEvent.getClientX(na),+mxEvent.getClientY(na));f._contextMenuPoint=new mxPoint(f.snap(la.x/f.view.scale-f.view.translate.x),f.snap(la.y/f.view.scale-f.view.translate.y));f._contextMenuScreenPoint=mxUtils.convertPoint(f.container,mxEvent.getClientX(na),mxEvent.getClientY(na))}f.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",X,null),X.addSeparator());ba.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||this.addMenuItems(X,["-","addToScratchpad"],null,+na);f.isSelectionEmpty()&&!this.isShowStyleItems()&&this.addMenuItems(X,["-","exitGroup","home"],null,na)};var ha=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(X,ka,na){if(c.editor.graph.isSelectionEmpty())ha.apply(this,arguments),c.menus.addMenuItems(X,["copyAsImage","copyAsSvg"],null,na);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(X,ka,na):this.addPopupMenuArrangeItems(X,ka,na),this.addMenuItems(X,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),+null,na),Editor.passiveScroll&&(1==f.getSelectionCount()?this.addMenuItems(X,["-","copyStyle","pasteStyle","copyTextStyle","pasteTextStyle"],null,na):this.addMenuItems(X,["-","pasteStyle","pasteTextStyle"],null,na)),this.addMenuItems(X,["-"],null,na),this.isShowCellEditItems()||this.addPopupDeleteItem(X,ka,na),this.addMenuItems(X,["lockUnlock","-"],null,na),!this.isShowStyleItems()){if(1==f.getSelectionCount()&&!f.isCellLocked(ka)&&f.isCellEditable(ka)&&(this.addSubmenu("editCell",X,null,mxResources.get("edit")),+X.addSeparator(),f.getModel().isEdge(ka))){this.addSubmenu("line",X);var la=f.getModel().getGeometry(ka);null!=la&&null!=la.points&&0<la.points.length&&this.addMenuItems(X,["clearWaypoints"],null,na)}1==f.getSelectionCount()&&this.addMenuItems(X,["enterGroup"],null,na);la=c.getSelectionState();null!=la.mergeCell?this.addMenuItem(X,"mergeCells"):(1<la.style.colspan||1<la.style.rowspan)&&this.addMenuItem(X,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&+"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}if(Editor.passiveScroll){var qa=f.getCenterInsertPoint;f.getCenterInsertPoint=function(X){if(null!=this._contextMenuPoint){var ka=this._contextMenuPoint;X=null!=X?X:new mxRectangle;return new mxPoint(f.snap(ka.x-(X.width||0)/2),f.snap(ka.y-(X.height||+0)/2))}return qa.apply(this,arguments)};var ra=f.popupMenuHandler.hideMenu;f.popupMenuHandler.hideMenu=function(){ra.apply(this,arguments);window.setTimeout(function(){f._contextMenuPoint=null;f._contextMenuScreenPoint=null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var l=f.getExportVariables;f.getExportVariables=function(){var X=l.apply(this,arguments),ka=c.getCurrentFile();+null!=ka&&(X.filename=ka.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var na in c.fileVars)null==X[na]&&(X[na]=c.fileVars[na]);X.pagecount=null!=c.pages?c.pages.length:1;X.page=null!=c.currentPage?c.currentPage.getName():"";X.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return X};var t=f.getGlobalVariable;f.getGlobalVariable=function(X){var ka=c.getCurrentFile();if("filename"==X&&null!=ka)return ka.getTitle();if("page"==X&&null!=c.currentPage)return c.currentPage.getName();+if("pagenumber"==X)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1;if("pagecount"==X)return null!=c.pages?c.pages.length:1;ka=t.apply(this,arguments);null==ka&&(c.updateFileVars(),null!=c.fileVars&&(ka=c.fileVars[X]));return ka};var H=null,J=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var X=this.getCurrentFile(),ka=null!=X&&null!=X.getTitle()?X.getTitle():this.defaultFilename;H!=ka&&X==J&&(f.invalidateDescendantsWithPlaceholders(f.model.getRoot()),+f.view.validate());H=ka;J=X}));var R=f.labelLinkClicked;f.labelLinkClicked=function(X,ka,na){var la=ka.getAttribute("href");if(null==la||!f.isCustomLink(la)||!mxEvent.isTouchEvent(na)&&mxEvent.isPopupTrigger(na))R.apply(this,arguments);else{if(!f.isEnabled()||null!=X&&f.isCellLocked(X.cell))f.customLinkClicked(la),f.getRubberband().reset();mxEvent.consume(na)}};this.editor.getOrCreateFilename=function(){var X=c.defaultFilename,ka=c.getCurrentFile();null!=ka&&(X=null!=ka.getTitle()?ka.getTitle():X);+return X};q=this.actions.get("print");q.setEnabled(!mxClient.IS_IOS||!navigator.standalone);q.visible=q.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),+this.keyHandler.bindAction(76,!1,"insertLink"),this.keyHandler.bindAction(82,!1,"insertRhombus"),this.keyHandler.bindAction(67,!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize",this.installKeyboardShortcuts(),"1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),+Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||f.addListener(mxEvent.ESCAPE,function(X,ka){null!=ka&&f.isEnabled()&&!f.isEditing()&&null!=ka.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(X){var ka=+f.cellEditor.text2,na=null;null!=ka&&(mxEvent.addListener(ka,"dragleave",function(la){null!=na&&(na.parentNode.removeChild(na),na=null);la.stopPropagation();la.preventDefault()}),mxEvent.addListener(ka,"dragover",mxUtils.bind(this,function(la){null==na&&(na=this.highlightElement(ka));la.stopPropagation();la.preventDefault()})),mxEvent.addListener(ka,"drop",mxUtils.bind(this,function(la){null!=na&&(na.parentNode.removeChild(na),na=null);if(0<la.dataTransfer.files.length)this.importFiles(la.dataTransfer.files,+0,0,this.maxImageSize,function(za,sa,wa,Ca,Fa,Ha){f.insertImage(za,Fa,Ha)},function(){},function(za){return"image/"==za.type.substring(0,6)},function(za){for(var sa=0;sa<za.length;sa++)za[sa]()},mxEvent.isControlDown(la));else if(0<=mxUtils.indexOf(la.dataTransfer.types,"text/uri-list")){var ua=la.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ua)?this.loadImage(decodeURIComponent(ua),mxUtils.bind(this,function(za){var sa=Math.max(1,za.width);za=Math.max(1,za.height);+var wa=this.maxImageSize;wa=Math.min(1,Math.min(wa/Math.max(1,sa)),wa/Math.max(1,za));f.insertImage(decodeURIComponent(ua),sa*wa,za*wa)})):document.execCommand("insertHTML",!1,la.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(la.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,la.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(la.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,la.dataTransfer.getData("text/plain"));la.stopPropagation();+la.preventDefault()})))}));if(Editor.isSettingsEnabled()){q=this.editor.graph.view;var T=mxSettings.getUnit();q.setUnit(T);Editor.pageSizeUnit=T;q.addListener("unitChanged",function(X,ka){X=ka.getProperty("unit");mxSettings.setUnit(X);mxSettings.save();Editor.pageSizeUnit=X});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,q.unit);this.refresh()}if("1"==urlParams.styledev){q=+document.getElementById("geFooter");null!=q&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),+this.styleInput.value)})),q.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(X,ka){0<this.editor.graph.getSelectionCount()?(X=this.editor.graph.getSelectionCell(),X=this.editor.graph.getModel().getStyle(X),this.styleInput.value=X||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var Y=this.isSelectionAllowed;this.isSelectionAllowed=function(X){return mxEvent.getSource(X)==this.styleInput?+!0:Y.apply(this,arguments)}}q=document.getElementById("geInfo");null!=q&&q.parentNode.removeChild(q);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var Z=null;mxEvent.addListener(f.container,"dragleave",function(X){f.isEnabled()&&(null!=Z&&(Z.parentNode.removeChild(Z),Z=null),X.stopPropagation(),X.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(X){null==Z&&(Z=this.highlightElement(f.container));null!=this.sidebar&&this.sidebar.hideTooltip();+X.stopPropagation();X.preventDefault()}));mxEvent.addListener(f.container,"drop",mxUtils.bind(this,function(X){null!=Z&&(Z.parentNode.removeChild(Z),Z=null);if(f.isEnabled()){var ka=mxUtils.convertPoint(f.container,mxEvent.getClientX(X),mxEvent.getClientY(X)),na=X.dataTransfer.files,la=f.view.translate,ua=f.view.scale,za=ka.x/ua-la.x,sa=ka.y/ua-la.y;if(0<na.length)ka=this.isBlankFile()&&!this.canUndo(),la=1==na.length&&(EditorUi.isVisioFilename(na[0].name)||/(\.drawio)$/i.test(na[0].name)||/(\.xml)$/i.test(na[0].name)),+"1"!=urlParams.embed&&ka&&(la||mxEvent.isShiftDown(X))?(ka=this.getCurrentFile(),null!=ka&&ka.isModified()||this.fileLoaded(null,!0),this.openFiles(na,!0,mxUtils.bind(this,function(){var La=this.getCurrentFile();null!=La&&La.fileChanged()}))):(mxEvent.isAltDown(X)&&(sa=za=null),this.importFiles(na,za,sa,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(X),null,null,mxEvent.isShiftDown(X),X));else{mxEvent.isAltDown(X)&&(sa=za=0);var wa=0<=mxUtils.indexOf(X.dataTransfer.types,"text/uri-list")?+X.dataTransfer.getData("text/uri-list"):null;na=this.extractGraphModelFromEvent(X,null!=this.pages);if(null!=na)f.setSelectionCells(this.importXml(na,za,sa,!0));else if(0<=mxUtils.indexOf(X.dataTransfer.types,"text/html")){var Ca=X.dataTransfer.getData("text/html");na=document.createElement("div");na.innerHTML=Graph.sanitizeHtml(Ca);var Fa=null;ka=na.getElementsByTagName("img");null!=ka&&1==ka.length?(Ca=ka[0].getAttribute("src"),null==Ca&&(Ca=ka[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Ca)||+(Fa=!0)):(ka=na.getElementsByTagName("a"),null!=ka&&1==ka.length?Ca=ka[0].getAttribute("href"):(na=na.getElementsByTagName("pre"),null!=na&&1==na.length&&(Ca=mxUtils.getTextContent(na[0]))));var Ha=!0,Na=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(Ca,za,sa,!0,Fa,null,Ha,mxEvent.isControlDown(X)))});Fa&&null!=Ca&&Ca.length>this.resampleThreshold?this.confirmImageResize(function(La){Ha=La;Na()},mxEvent.isControlDown(X)):Na()}else null!=wa&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(wa)?+this.loadImage(decodeURIComponent(wa),mxUtils.bind(this,function(La){var Da=Math.max(1,La.width);La=Math.max(1,La.height);var Sa=this.maxImageSize;Sa=Math.min(1,Math.min(Sa/Math.max(1,Da)),Sa/Math.max(1,La));f.setSelectionCell(f.insertVertex(null,null,"",za,sa,Da*Sa,La*Sa,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+wa+";"))}),mxUtils.bind(this,function(La){f.setSelectionCells(this.insertTextAt(wa,za,sa,!0))})):0<=mxUtils.indexOf(X.dataTransfer.types,+"text/plain")&&f.setSelectionCells(this.insertTextAt(X.dataTransfer.getData("text/plain"),za,sa,!0))}}X.stopPropagation();X.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));+this.addListener("darkModeChanged",function(){mxClient.IS_SF&&f.view.validateBackground()});f.addListener("enabledChanged",mxUtils.bind(this,function(){f.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var X=parseInt(this.div.offsetLeft),ka=parseInt(this.div.offsetWidth),na=c.embedViewport.x+c.embedViewport.width,la=parseInt(this.div.offsetTop),ua=parseInt(this.div.offsetHeight),+za=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,Math.min(X,na-ka))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(la,za-ua))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};var ia=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(X,ka){ia.call(this,X,ka);c.hideCurrentMenu()};var ja=mxWindow.prototype.setSize;+mxWindow.prototype.setSize=function(X,ka){ja.call(this,X,ka);c.hideCurrentMenu()};if(!this.editor.chromeless||this.editor.editable){q=Editor.currentTheme;if("simple"==q||"sketch"==q)this.doSetCurrentTheme(q,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(T=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,T<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==q&&T<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==q&&(this.lastWindowWidth=+T)),this.fireEvent(new mxEventObject("themeInitialized"));this.restoreVisibleWindows();"kennedy"==q&&(T=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,T<Editor.smallScreenWidth&&(this.formatWidth=0),T<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),this.lastWindowWidth=T)}q=!1;if(null!=urlParams.dark)q=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)q="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||q&&"auto"!=+mxSettings.settings.darkMode||(q=mxSettings.settings.darkMode);"auto"==q&&this.isAutoDarkModeSupported()&&(q=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof q?"1"==q:q);if(this.isAutoDarkModeSupported())try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(X){this.isAutoDarkMode()&&this.setDarkMode(X.matches)}))}catch(X){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):+Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast?this.setHighContrast(mxSettings.settings.highContrast):null!=window.matchMedia&&window.matchMedia("(prefers-contrast: more)").matches&&this.setHighContrast(!0);Editor.isSettingsEnabled()&&(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));+this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(X,ka){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var y=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||+"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));f=Editor.smallScreenWidth-160;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,+!0):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&!this.isShapesPanelVisible()&&this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}y.apply(this,arguments);null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,k=this.sketchPickerMenuElt,q=this.editor.graph;k.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,+function(V){mxEvent.getSource(V)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(V),mxEvent.getClientY(V)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var x=document.createElement("div");x.style.position="absolute";x.style.width="10px";x.style.height="10px";x.style.borderRadius="5px";x.style.border="1px solid gray";x.style.background="#ffffff";x.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(x);this.bottomResizer=+x;var C=null,E=null,L=null,Q=null;mxEvent.addGestureListeners(x,mxUtils.bind(this,function(V){Q=parseInt(this.diagramContainer.style.height);E=mxEvent.getClientY(V);q.popupMenuHandler.hideMenu();mxEvent.consume(V)}));x=x.cloneNode(!1);x.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(x);this.rightResizer=x;mxEvent.addGestureListeners(x,mxUtils.bind(this,function(V){L=parseInt(this.diagramContainer.style.width);C=mxEvent.getClientX(V);q.popupMenuHandler.hideMenu();mxEvent.consume(V)}));+mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(V){var K=!1;null!=C&&(this.diagramContainer.style.width=Math.max(20,L+mxEvent.getClientX(V)-C)+"px",K=!0);null!=E&&(this.diagramContainer.style.height=Math.max(20,Q+mxEvent.getClientY(V)-E)+"px",K=!0);K&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),+function(V){null==C&&null==E||mxEvent.consume(V);E=C=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(V){this.inlineSizeChanged();Editor.passiveScroll?this.hideWindows():this.fitWindows()}));+this.addListener("editInlineStop",mxUtils.bind(this,function(V){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){k.innerHTML=+" ";k.focus();try{var C=document.createRange();C.selectNodeContents(k);var E=window.getSelection();null!=E&&(E.removeAllRanges(),E.addRange(C))}catch(L){}},0)}var f=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck","false");k.style.textRendering="optimizeSpeed";k.style.fontFamily="monospace";k.style.wordBreak="break-all";k.style.background="transparent";+k.style.color="transparent";k.style.position="absolute";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.display="block";k.style.fontSize="1";k.style.zIndex="-1";k.style.resize="none";k.style.outline="none";k.style.width="1px";k.style.height="1px";mxUtils.setOpacity(k,0);k.contentEditable=!0;k.innerHTML=" ";this.clipboardElt=k;var q=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,+"keydown",mxUtils.bind(this,function(C){var E=mxEvent.getSource(C);null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==E.nodeName||"TEXTAREA"==E.nodeName&&E!==this.typingShim||"true"==E.contentEditable||224!=C.keyCode&&(mxClient.IS_MAC||17!=C.keyCode)&&(!mxClient.IS_MAC||91!=C.keyCode&&93!=C.keyCode)||q||(k.style.left=f.container.scrollLeft+10+"px",k.style.top=f.container.scrollTop+10+"px",C=f.container.scrollLeft,E=f.container.scrollTop,f.container.appendChild(k),+q=!0,k.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=C,f.container.scrollTop=E)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(C){var E=C.keyCode;window.setTimeout(mxUtils.bind(this,function(){!q||224!=E&&17!=E&&91!=E&&93!=E||(q=!1,k.parentNode.removeChild(k),f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(C){if(f.isEnabled())try{mxClipboard.copy(f),+this.copyCells(k),c()}catch(E){this.handleError(E)}}));mxEvent.addListener(k,"cut",mxUtils.bind(this,function(C){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k,!0),c()}catch(E){this.handleError(E)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(C){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(k.innerHTML=" ",k.focus(),null!=C.clipboardData&&(Graph.removePasteFormatting(k.firstChild),this.pasteCells(C,k,!0,!0)),!mxEvent.isConsumed(C)){var E=f.container.scrollLeft,+L=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{f.container.scrollLeft=E,f.container.scrollTop=L,Graph.removePasteFormatting(k.firstChild),this.pasteCells(C,k,!1,!0)}catch(Q){this.handleError(Q)}}),0)}}catch(Q){this.handleError(Q)}}),!0);var x=this.isSelectionAllowed;this.isSelectionAllowed=function(C){return mxEvent.getSource(C)==k?!0:x.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};+EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var k="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(k||f)f=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),+this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(f);return k};EditorUi.prototype.saveScrollState=function(c){var f=this.editor.graph.view.translate,k=this.diagramContainer.scrollLeft,q=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(k-=this.embedViewport.x,q-=this.embedViewport.y):(k+=this.embedViewport.x,q+=this.embedViewport.y));f={x:k,y:q,tx:f.x,ty:f.y};c&&(f.boundingRect=this.diagramContainer.getBoundingClientRect());return f};+EditorUi.prototype.restoreScrollState=function(c){var f=this.editor.graph.view.scale,k=this.editor.graph.view.translate;if(null!=c.boundingRect){var q=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-q.x;c.y-=c.boundingRect.y-q.y}this.diagramContainer.scrollLeft=c.x+(k.x-c.tx)*f;this.diagramContainer.scrollTop=c.y+(k.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,+function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||f||(this.statusContainer.style.display="none")}));var k=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var q=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;f=null!=q&&null!=q.getAttribute("class");+if(!f&&null!=q){q=q.getAttribute("title");var x=this.getCurrentFile();x=null!=x?x.savingStatusKey:DrawioFile.prototype.savingStatusKey;q==mxResources.get(x)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(x))+'..."src="'+Editor.tailSpin+'"></div>',f=!0)}this.statusContainer.style.display="none";q=32>=c.clientWidth;c.style.visibility=q&&""==this.editor.getStatus()?"hidden":"";if(q||f)this.statusContainer.style.display="",f=!0}else"simple"==Editor.currentTheme?+(this.statusContainer.style.display="",this.statusContainer.style.display=0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",k);k()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),+this.createShapesWindow())};EditorUi.prototype.getWindows=function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.fit()};EditorUi.prototype.hideWindows=+function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),+this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null));null!=this.dockManager&&(this.dockManager.destroy(),this.dockManager=null);null!=this._dockResizeListener&&(mxEvent.removeListener(window,"resize",this._dockResizeListener),this._dockResizeListener=null)};EditorUi.prototype.restoreVisibleWindows=function(){if(Editor.isSettingsEnabled()){var c={layers:"layers",outline:"outline",tags:"tags"},f;for(f in c){var k=mxSettings.getWindowState(f);null!=k&&k.visible&&(k=this.actions.get(c[f]),null!=k&&k.funct())}}};EditorUi.prototype.saveWindowState=function(c,f){f=f.window;var k=f.minimized&&null!=f.height?parseInt(f.height):parseInt(f.div.style.height);mxSettings.setWindowState(c,{x:f.getX(),y:f.getY(),w:parseInt(f.div.style.width),h:k,visible:f.isVisible(),minimized:f.minimized||!1,dockState:f.dockState||null,dockAnchorRight:f._dockAnchorRight||null,dockAnchorBottom:f._dockAnchorBottom||null,dockOffsetX:f._dockOffsetX||null,dockOffsetY:f._dockOffsetY||null});mxSettings.save()};EditorUi.prototype.restoreWindowState=function(c,f){c=mxSettings.getWindowState(c);if(null==c)return null;f=f.window;null!=c.w&&null!=c.h&&mxWindow.prototype.setSize.call(f,c.w,c.h);null!=c.x&&null!=c.y&&mxWindow.prototype.setLocation.call(f,c.x,c.y);null!=c.dockState&&null!=this.dockManager&&Editor.enableWindowDocking&&(f._dockAnchorRight=c.dockAnchorRight,f._dockAnchorBottom=c.dockAnchorBottom,f._dockOffsetX=c.dockOffsetX,f._dockOffsetY=c.dockOffsetY,f.dockState=c.dockState,f.div.classList.add("mxWindowDocked"),this.dockManager.windows.push(f),this.dockManager.pinToEdge(f));f.fit();null!=c.visible&&f.setVisible(c.visible);c.minimized&&!f.minimized&&f.toggleMinimized();return c};EditorUi.prototype.installWindowPersistence=function(c,f){var k=this,q=f.window,x=function(){k.saveWindowState(c,f)};q.addListener(mxEvent.MOVE_END,x);q.addListener(mxEvent.RESIZE_END,x);q.addListener(mxEvent.SHOW,x);q.addListener(mxEvent.HIDE,x);q.addListener(mxEvent.DOCK,x);q.addListener(mxEvent.UNDOCK,-x);q.addListener(mxEvent.MAXIMIZE,x);q.addListener(mxEvent.MINIMIZE,x);q.addListener(mxEvent.NORMALIZE,x)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,f,k){var q=this.threshold,x=c<=q;c=c+k.offsetWidth>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-q;var B=f<=q;f=f+k.offsetHeight>=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-q;return x&&-B?"top-left":c&&B?"top-right":x&&f?"bottom-left":c&&f?"bottom-right":x?"left":c?"right":B?"top":f?"bottom":null},dock:function(c,f){var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=parseInt(c.div.style.width),B=parseInt(c.div.style.height),E=c.getX(),L=c.getY();c.dockState=f;c.div.classList.add("mxWindowDocked");var Q=0<=f.indexOf("right"),V=0<=f.indexOf("bottom");0<=f.indexOf("left")?-E=0:0<=f.indexOf("right")&&(E=k-x);0<=f.indexOf("top")?L=0:0<=f.indexOf("bottom")&&(L=q-B);Q||(Q=E+x/2>k/2);V||(V=L+B/2>q/2);c._dockAnchorRight=Q;c._dockAnchorBottom=V;c._dockOffsetX=Q?k-E-x:E;c._dockOffsetY=V?q-L-B:L;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,"side",f))},undock:function(c){var f=c.dockState;if(null!=f){for(var k=0;k<this.windows.length;k++)if(this.windows[k]===c){this.windows.splice(k,1);break}c.div.classList.remove("mxWindowDocked");c.dockState=-null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",f))}},pinToEdge:function(c){var f=c.dockState;if(null!=f){var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=parseInt(c.div.style.width),B=parseInt(c.div.style.height);var E=c._dockAnchorRight?k-x-(c._dockOffsetX||0):c._dockOffsetX||-0;var L=c._dockAnchorBottom?q-B-(c._dockOffsetY||0):c._dockOffsetY||0;0<=f.indexOf("left")?E=0:0<=f.indexOf("right")&&(E=k-x);0<=f.indexOf("top")?L=0:0<=f.indexOf("bottom")&&(L=q-B);E=Math.max(0,Math.min(E,k-x));L=Math.max(0,Math.min(L,q-B));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,E,L);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,f){null==this.previewElement&&(this.previewElement=document.createElement("div"),-this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=this.previewElement,B=f.div.offsetWidth,E=f.div.offsetHeight,L=f.getX();f=f.getY();0<=c.indexOf("left")?L=0:0<=c.indexOf("right")&&(L=k-B);0<=c.indexOf("top")?f=0:0<=c.indexOf("bottom")&&(f=q-E);L=Math.max(0,Math.min(L,k-B));f=Math.max(0,-Math.min(f,q-E));x.style.display="block";x.style.left=L+"px";x.style.top=f+"px";x.style.width=B+"px";x.style.height=E+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var f=0;f<this.windows.length;f++)if(this.windows[f]===c){this.windows.splice(f,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=-null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var C=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,f,k){C.apply(this,arguments);if(EditorUi.windowed&&Editor.enableWindowDocking){var q=c.window;null==this.dockManager&&this.createDockManager();var x=this.dockManager,B=!1,E=null,L=q.setLocation;q.setLocation=function(K,fa){(null==+x);q.addListener(mxEvent.MAXIMIZE,x);q.addListener(mxEvent.MINIMIZE,x);q.addListener(mxEvent.NORMALIZE,x)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,f,k){var q=this.threshold,x=c<=q;c=c+k.offsetWidth>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-q;var C=f<=q;f=f+k.offsetHeight>=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-q;return x&&+C?"top-left":c&&C?"top-right":x&&f?"bottom-left":c&&f?"bottom-right":x?"left":c?"right":C?"top":f?"bottom":null},dock:function(c,f){var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=parseInt(c.div.style.width),C=parseInt(c.div.style.height),E=c.getX(),L=c.getY();c.dockState=f;c.div.classList.add("mxWindowDocked");var Q=0<=f.indexOf("right"),V=0<=f.indexOf("bottom");0<=f.indexOf("left")?+E=0:0<=f.indexOf("right")&&(E=k-x);0<=f.indexOf("top")?L=0:0<=f.indexOf("bottom")&&(L=q-C);Q||(Q=E+x/2>k/2);V||(V=L+C/2>q/2);c._dockAnchorRight=Q;c._dockAnchorBottom=V;c._dockOffsetX=Q?k-E-x:E;c._dockOffsetY=V?q-L-C:L;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,"side",f))},undock:function(c){var f=c.dockState;if(null!=f){for(var k=0;k<this.windows.length;k++)if(this.windows[k]===c){this.windows.splice(k,1);break}c.div.classList.remove("mxWindowDocked");c.dockState=+null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",f))}},pinToEdge:function(c){var f=c.dockState;if(null!=f){var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=parseInt(c.div.style.width),C=parseInt(c.div.style.height);var E=c._dockAnchorRight?k-x-(c._dockOffsetX||0):c._dockOffsetX||+0;var L=c._dockAnchorBottom?q-C-(c._dockOffsetY||0):c._dockOffsetY||0;0<=f.indexOf("left")?E=0:0<=f.indexOf("right")&&(E=k-x);0<=f.indexOf("top")?L=0:0<=f.indexOf("bottom")&&(L=q-C);E=Math.max(0,Math.min(E,k-x));L=Math.max(0,Math.min(L,q-C));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,E,L);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,f){null==this.previewElement&&(this.previewElement=document.createElement("div"),+this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=this.previewElement,C=f.div.offsetWidth,E=f.div.offsetHeight,L=f.getX();f=f.getY();0<=c.indexOf("left")?L=0:0<=c.indexOf("right")&&(L=k-C);0<=c.indexOf("top")?f=0:0<=c.indexOf("bottom")&&(f=q-E);L=Math.max(0,Math.min(L,k-C));f=Math.max(0,+Math.min(f,q-E));x.style.display="block";x.style.left=L+"px";x.style.top=f+"px";x.style.width=C+"px";x.style.height=E+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var f=0;f<this.windows.length;f++)if(this.windows[f]===c){this.windows.splice(f,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=+null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var B=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,f,k){B.apply(this,arguments);if(EditorUi.windowed&&Editor.enableWindowDocking){var q=c.window;null==this.dockManager&&this.createDockManager();var x=this.dockManager,C=!1,E=null,L=q.setLocation;q.setLocation=function(K,fa){(null==this.dockState||this._undocking||this._relayouting)&&L.call(this,K,fa)};var Q=q.setSize;q.setSize=function(K,fa){if(null!=this.dockState){mxWindow.prototype.setSize.call(this,K,fa);K=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;fa=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var aa=parseInt(this.div.style.width),da=parseInt(this.div.style.height),ba=this.getX(),ha=this.getY();this._dockOffsetX=this._dockAnchorRight?K-ba--aa:ba;this._dockOffsetY=this._dockAnchorBottom?fa-ha-da:ha;x.pinToEdge(this)}else Q.call(this,K,fa)};q.addListener(mxEvent.MOVE_START,function(K,fa){B=!0;E=null;null!=q.dockState&&(q._undocking=!0,x.undock(q),q._undocking=!1)});q.addListener(mxEvent.MOVE,function(K,fa){B&&(K=x.getDockZone(q.getX(),q.getY(),q.div),K!=E&&(E=K,null!=K?x.showPreview(K,q):x.hidePreview()))});q.addListener(mxEvent.MOVE_END,function(K,fa){B=!1;x.hidePreview();null!=E&&x.dock(q,E);E=null});q.addListener(mxEvent.DOCK,function(K,+aa:ba;this._dockOffsetY=this._dockAnchorBottom?fa-ha-da:ha;x.pinToEdge(this)}else Q.call(this,K,fa)};q.addListener(mxEvent.MOVE_START,function(K,fa){C=!0;E=null;null!=q.dockState&&(q._undocking=!0,x.undock(q),q._undocking=!1)});q.addListener(mxEvent.MOVE,function(K,fa){C&&(K=x.getDockZone(q.getX(),q.getY(),q.div),K!=E&&(E=K,null!=K?x.showPreview(K,q):x.hidePreview()))});q.addListener(mxEvent.MOVE_END,function(K,fa){C=!1;x.hidePreview();null!=E&&x.dock(q,E);E=null});q.addListener(mxEvent.DOCK,function(K,fa){if(null!=q.resize){K=fa.getProperty("side");var aa=0<=K.indexOf("right"),da=0<=K.indexOf("bottom");if(aa||da){K=q.resize;K.parentNode.removeChild(K);q.resize=null;K=document.createElement("img");K.style.position="absolute";K.style.zIndex="2";K.setAttribute("src",mxWindow.prototype.resizeImage);aa?K.style.left="0px":K.style.right="0px";da?K.style.top="0px":K.style.bottom="0px";K.style.cursor=aa!=da?"nesw-resize":"nwse-resize";var ba=null,ha=null,qa=null,ra=null,l=function(H){if(null!=ba&&null!=ha){var J=mxEvent.getClientX(H)-ba,R=mxEvent.getClientY(H)-ha;q.setSize(aa?qa-J:qa+J,da?ra-R:ra+R);q.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",H));mxEvent.consume(H)}},t=function(H){null!=ba&&null!=ha&&(ha=ba=null,mxEvent.removeGestureListeners(document,null,l,t),q.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",H)),mxEvent.consume(H))};mxEvent.addGestureListeners(K,function(H){q.activate();ba=mxEvent.getClientX(H);ha=mxEvent.getClientY(H);qa=q.div.offsetWidth;ra=q.div.offsetHeight;mxEvent.addGestureListeners(document,null,l,t);q.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",H));mxEvent.consume(H)},l,t);q.div.appendChild(K);q.resize=K;q._dockResize=!0}}});q.addListener(mxEvent.UNDOCK,function(K,fa){q._dockResize&&(null!=q.resize&&(q.resize.parentNode.removeChild(q.resize),q.resize=null),q.setResizable(!0),q._dockResize=!1)});q.addListener(mxEvent.NORMALIZE,function(K,fa){null!=q.dockState&&x.pinToEdge(q)});q.addListener(mxEvent.MAXIMIZE,function(K,fa){null!=q.dockState&&@@ -4407,19 +4410,19 @@ function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUif.isRealtimeSupported()&&1<f.getRealtimeState()&&(c=f.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+": "+(null!=c&&null!=c.message?c.message:mxResources.get("error"))):c=mxResources.get("notConnected"):c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,f,k,q){k=null!=k?k:"geButton";var x=this.menus.get(c);q=this.menubar.addMenu(mxResources.get(c),x.funct,null,q);q.className=k;q.setAttribute("title",mxResources.get(c));this.menus.menuCreated(x,q,k);null!=f&&(q.style.backgroundImage="url("+f+")",q.innerText="");return q};EditorUi.prototype.addButton=function(c,f,k,q){c=this.createToolbarButton(c,f,k);q=null!=q?q:this.container;q.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,f,k){var q=document.createElement("a");q.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(q.style.backgroundImage="url("+c+")");null!=f&&q.setAttribute("title",-f);null!=k&&mxEvent.addListener(q,"click",function(x){"disabled"!=q.getAttribute("disabled")&&k(x);mxEvent.consume(x)});mxEvent.preventDefault(q);return q};EditorUi.prototype.createMenuItem=function(c,f,k){var q=this.actions.get(c),x=null!=q?q.funct:null,B=this.createToolbarButton(f,mxResources.get(c)+(null!=q&&null!=q.shortcut?" ("+q.shortcut+")":""),x);null==q||k||(c=function(){q.isEnabled()?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",-c),q.addListener("stateChanged",c),c());return B};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,f=mxSettings.getWindowState("format"),k=null!=f&&null!=f.x?f.x:Math.max(10,this.diagramContainer.parentNode.clientWidth-256),q=null!=f&&null!=f.y?f.y:60,x=null!=f&&null!=f.w?f.w:240,B=null!=f&&null!=f.h?f.h:"1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,-mxResources.get("format"),k,q,x,B,mxUtils.bind(this,function(Q){Q.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var E=this.formatWindow.window.toggleMinimized,L=x;this.formatWindow.window.toggleMinimized=function(){E.apply(this,arguments);this.minimized?(L=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=+f);null!=k&&mxEvent.addListener(q,"click",function(x){"disabled"!=q.getAttribute("disabled")&&k(x);mxEvent.consume(x)});mxEvent.preventDefault(q);return q};EditorUi.prototype.createMenuItem=function(c,f,k){var q=this.actions.get(c),x=null!=q?q.funct:null,C=this.createToolbarButton(f,mxResources.get(c)+(null!=q&&null!=q.shortcut?" ("+q.shortcut+")":""),x);null==q||k||(c=function(){q.isEnabled()?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",+c),q.addListener("stateChanged",c),c());return C};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,f=mxSettings.getWindowState("format"),k=null!=f&&null!=f.x?f.x:Math.max(10,this.diagramContainer.parentNode.clientWidth-256),q=null!=f&&null!=f.y?f.y:60,x=null!=f&&null!=f.w?f.w:240,C=null!=f&&null!=f.h?f.h:"1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,+mxResources.get("format"),k,q,x,C,mxUtils.bind(this,function(Q){Q.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var E=this.formatWindow.window.toggleMinimized,L=x;this.formatWindow.window.toggleMinimized=function(){E.apply(this,arguments);this.minimized?(L=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+L-140+"px"):(this.div.style.width=L+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-L+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(Q){mxEvent.getSource(Q)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);this.installWindowPersistence("format",this.formatWindow);null!=f?this.restoreWindowState("format",this.formatWindow):"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var Q=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,V=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>Q||690>V)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};-var P=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):P.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,f){if(this.isShapesPanelVisible()!=c){var k=EditorUi.prototype.hsplitPosition;0==k&&(k=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var q=this.hsplitPosition,x=mxUtils.bind(this,function(){this.hsplitPosition=B;this.refresh();-f||(this.diagramContainer.scrollLeft-=q-this.hsplitPosition)}),B=c?k:0,E=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==B?"translateX(0)":"translateX(-100%)");0!=B&&x();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==B?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+E+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,-"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==B&&x();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*E)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var G=EditorUi.prototype.isFormatPanelVisible;+var P=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):P.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,f){if(this.isShapesPanelVisible()!=c){var k=EditorUi.prototype.hsplitPosition;0==k&&(k=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var q=this.hsplitPosition,x=mxUtils.bind(this,function(){this.hsplitPosition=C;this.refresh();+f||(this.diagramContainer.scrollLeft-=q-this.hsplitPosition)}),C=c?k:0,E=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==C?"translateX(0)":"translateX(-100%)");0!=C&&x();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==C?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+E+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,+"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==C&&x();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*E)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var G=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():G.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var f=mxUtils.bind(this,function(E,L){var Q=this.menus.get(E);E=this.createMenuElement(L,mxUtils.bind(this,function(){Q.funct.apply(this,arguments)}));E.setAttribute("title",L);E.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";E.className="geButton";c.parentNode.appendChild(E);return E});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))f=document.createElement("div"),f.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",f.className="geButton",f.style.left="0px",f.style.right="50%",mxUtils.write(f,mxResources.get("newLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("newLibrary").funct),f=f.cloneNode(!1),f.style.left=-"50%",f.style.right="0px",mxUtils.write(f,mxResources.get("openLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("openLibrary").funct);else{var k=f("newLibrary","");k.style.left="0px";k.style.right="50%";var q=document.createElement("span");k.appendChild(q);var x=f("openLibraryFrom","");x.style.borderLeftWidth="1px";x.style.left="50%";x.style.right="0px";var B=document.createElement("span");x.appendChild(B);this.dependsOnLanguage(mxUtils.bind(this,function(){q.innerHTML="";-mxUtils.write(q,mxResources.get("newLibrary"));k.setAttribute("title",mxResources.get("newLibrary"));B.innerHTML="";mxUtils.write(B,mxResources.get("openLibraryFrom"));x.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=mxSettings.getWindowState("shapes"),f=null!=c&&null!=c.w?c.w:Math.min(this.diagramContainer.parentNode.clientWidth-10,230)--6,k=null!=c&&null!=c.h?c.h:("1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650))-6,q="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,x=null!=c&&null!=c.x?c.x:q&&"1"!=urlParams.embedInline?66:10;q=null!=c&&null!=c.y?c.y:q&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-k)/2):56;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),x,q,f,k,mxUtils.bind(this,function(B){this.createShapesPanel(B)}));+"50%",f.style.right="0px",mxUtils.write(f,mxResources.get("openLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("openLibrary").funct);else{var k=f("newLibrary","");k.style.left="0px";k.style.right="50%";var q=document.createElement("span");k.appendChild(q);var x=f("openLibraryFrom","");x.style.borderLeftWidth="1px";x.style.left="50%";x.style.right="0px";var C=document.createElement("span");x.appendChild(C);this.dependsOnLanguage(mxUtils.bind(this,function(){q.innerHTML="";+mxUtils.write(q,mxResources.get("newLibrary"));k.setAttribute("title",mxResources.get("newLibrary"));C.innerHTML="";mxUtils.write(C,mxResources.get("openLibraryFrom"));x.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=mxSettings.getWindowState("shapes"),f=null!=c&&null!=c.w?c.w:Math.min(this.diagramContainer.parentNode.clientWidth-10,230)-+6,k=null!=c&&null!=c.h?c.h:("1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650))-6,q="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,x=null!=c&&null!=c.x?c.x:q&&"1"!=urlParams.embedInline?66:10;q=null!=c&&null!=c.y?c.y:q&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-k)/2):56;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),x,q,f,k,mxUtils.bind(this,function(C){this.createShapesPanel(C)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.installWindowPersistence("shapes",this.sidebarWindow);null!=c?this.restoreWindowState("shapes",this.sidebarWindow):this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var f=c;"auto"==c&&(f=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(f);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,f){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(f))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=@@ -4430,7 +4433,7 @@ null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TAc,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,f){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&f&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,k=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)f.style.left="10px",f.style.top="10px",k.style.left="10px",k.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var q=this.diagramContainer.getAttribute("data-bounds");if(null!=-q){this.diagramContainer.removeAttribute("data-bounds");var x=q.split(" ");q=mxUtils.getDocumentSize();this.diagramContainer.style.top=x[0];this.diagramContainer.style.left=x[1];var B=parseInt(x[2]);x=parseInt(x[3]);B=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,B):B,q.width-80);x=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,x):x,q.height-80);this.diagramContainer.style.width=B+"px";this.diagramContainer.style.height=x+"px";this.diagramContainer.style.bottom=+q){this.diagramContainer.removeAttribute("data-bounds");var x=q.split(" ");q=mxUtils.getDocumentSize();this.diagramContainer.style.top=x[0];this.diagramContainer.style.left=x[1];var C=parseInt(x[2]);x=parseInt(x[3]);C=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,C):C,q.width-80);x=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,x):x,q.height-80);this.diagramContainer.style.width=C+"px";this.diagramContainer.style.height=x+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}f.style.left=this.diagramContainer.offsetLeft+"px";f.style.top=this.diagramContainer.offsetTop-f.offsetHeight-4+"px";k.style.display="";k.style.left=this.diagramContainer.offsetLeft-k.offsetWidth-4+"px";k.style.top=this.diagramContainer.offsetTop+"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=f.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen||Editor.noResizers?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;q="1"==urlParams.embedInline&&Editor.passiveScroll;f.style.visibility=q?"hidden":"";c.style.visibility=q?"hidden":"";k.style.display=q?"none":""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};@@ -4441,72 +4444,72 @@ urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle();this.restorePersistedEdgeStyle()};EditorUi.prototype.restorePersistedEdgeStyle=function(){var c=this.editor.graph,f="undefined"!==typeof mxSettings&&null!=mxSettings.getCurrentEdgeStyle?mxSettings.getCurrentEdgeStyle():null;null!=f&&(c.currentEdgeStyle=mxUtils.clone(f),"orthogonalEdgeStyle"!=c.defaultEdgeStyle.edgeStyle&&delete c.currentEdgeStyle.libavoidRouting,this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[])))};EditorUi.prototype.getLinkTitle=function(c){var f=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var k=c.indexOf(",");0<k&&(f=this.getPageById(c.substring(k+1)),f=null!=f?f.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,5)&&(f=this.getCustomLinkTitle(c));return f};EditorUi.prototype.getCustomLinkTitle=function(c){var f=mxResources.get("action");if("data:action/json,"==c.substring(0,17))try{var k=JSON.parse(c.substring(17));if(null!=k&&"string"==typeof k.title&&""!=k.title.trim())f=k.title.trim();else if(null!=k&&Array.isArray(k.actions)&&0<k.actions.length){var q=Object.keys(k.actions[0])[0]||-"";if("animation"==q&&null!=k.actions[0].animation&&Array.isArray(k.actions[0].animation.steps)){var x=k.actions[0].animation.steps.length;f=mxResources.get("effects",null,"Effects")+" ("+x+")"}else if(""!=q){var B="undefined"!=typeof CustomActionDialog&&null!=CustomActionDialog?CustomActionDialog.SCHEMAS[q]:null;f=mxResources.get(null!=B&&B.labelKey?B.labelKey:q,null,null!=B?B.label:q)}}}catch(E){}return f};EditorUi.prototype.handleCustomLink=function(c,f){if(Graph.isPageLink(c))if(f=c.indexOf(","),+"";if("animation"==q&&null!=k.actions[0].animation&&Array.isArray(k.actions[0].animation.steps)){var x=k.actions[0].animation.steps.length;f=mxResources.get("effects",null,"Effects")+" ("+x+")"}else if(""!=q){var C="undefined"!=typeof CustomActionDialog&&null!=CustomActionDialog?CustomActionDialog.SCHEMAS[q]:null;f=mxResources.get(null!=C&&C.labelKey?C.labelKey:q,null,null!=C?C.label:q)}}}catch(E){}return f};EditorUi.prototype.handleCustomLink=function(c,f){if(Graph.isPageLink(c))if(f=c.indexOf(","),c=this.getPageById(c.substring(f+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||"Page not found");else this.editor.graph.handleCustomLink(c,f)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(f){f.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(f){}this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(f,k){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(f,k){mxSettings.setPageFormat(c.pageFormat);mxSettings.save()}));c.view.defaultDarkGridColor=mxSettings.getGridColor(!0);c.view.defaultGridColor=mxSettings.getGridColor(!1);c.view.gridColor="light-dark("+c.view.defaultGridColor+", "+c.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(f,k){mxSettings.setGridColor(c.view.defaultGridColor,!1);mxSettings.setGridColor(c.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(f,k){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(f,k){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);-mxSettings.save()});this.addListener("sidebarWidthChanged",function(){mxSettings.setSidebarWidth(this.hsplitPosition);mxSettings.save()});this.addListener("collapsedSectionsChanged",function(){null!=this.format&&(mxSettings.setCollapsedSections(this.format.collapsedSections),mxSettings.save())})}};EditorUi.prototype.writeImageToClipboard=function(c,f,k,q,x,B){q=null!=q?q:"image/png";var E=null==f||null==k?'<img src="'+c+'">':'<img src="'+c+'" width="'+f+'" height="'+k+'">',L={"text/html":new Blob([E],-{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(q)&&(L[q]=this.base64ToBlob(c.substring(c.indexOf(",")+1),q));var Q=new ClipboardItem(L);navigator.clipboard.write([Q]).then(x)["catch"](B);EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",[c],"w",f,"h",k,"type",q,"html",[E],"data",[L],"item",[Q])};EditorUi.prototype.writeHtmlToClipboard=function(c,f){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),+mxSettings.save()});this.addListener("sidebarWidthChanged",function(){mxSettings.setSidebarWidth(this.hsplitPosition);mxSettings.save()});this.addListener("collapsedSectionsChanged",function(){null!=this.format&&(mxSettings.setCollapsedSections(this.format.collapsedSections),mxSettings.save())})}};EditorUi.prototype.writeImageToClipboard=function(c,f,k,q,x,C){q=null!=q?q:"image/png";var E=null==f||null==k?'<img src="'+c+'">':'<img src="'+c+'" width="'+f+'" height="'+k+'">',L={"text/html":new Blob([E],+{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(q)&&(L[q]=this.base64ToBlob(c.substring(c.indexOf(",")+1),q));var Q=new ClipboardItem(L);navigator.clipboard.write([Q]).then(x)["catch"](C);EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",[c],"w",f,"h",k,"type",q,"html",[E],"data",[L],"item",[Q])};EditorUi.prototype.writeHtmlToClipboard=function(c,f){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})])["catch"](f)};EditorUi.prototype.writeTextToClipboard=function(c,f,k){navigator.clipboard.writeText(c).then(function(){null!=k&&k()})["catch"](f)};EditorUi.prototype.copySvg=function(c,f,k){try{if(null!=navigator.clipboard&&"function"===typeof window.ClipboardItem){var q=this.editor.graph.getSvg(null,k,null,null,null,null,null,null,null,null,null,Editor.isDarkMode()?"dark":"light",null,0<c.length?c:null);null!=f&&q.setAttribute("content",f);var x=Editor.createSvgDataUri(mxUtils.getXml(q)),-B=parseInt(q.getAttribute("width")),E=parseInt(q.getAttribute("height"));this.writeImageToClipboard(x,B,E,"image/svg+xml",null,mxUtils.bind(this,function(L){this.handleError(L)}))}}catch(L){this.handleError(L)}};EditorUi.prototype.copyImage=function(c,f,k){try{k=null!=k?k:4,null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(q,x){try{this.spinner.stop();var B=this.createImageDataUri(q,-f,"png"),E=Math.round(parseInt(x.getAttribute("width"))/k),L=Math.round(parseInt(x.getAttribute("height"))/k);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[f],"scale",[k]);this.writeImageToClipboard(B,E,L,"image/png",null,mxUtils.bind(this,function(){if(this.isLocalFileSave()){var Q=this.getBaseFilename(!1)+(null!=f?".drawio":"")+".png";this.saveLocalFile(B.substring(B.lastIndexOf(",")+1),Q,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(Q){this.handleError(Q)}}),+C=parseInt(q.getAttribute("width")),E=parseInt(q.getAttribute("height"));this.writeImageToClipboard(x,C,E,"image/svg+xml",null,mxUtils.bind(this,function(L){this.handleError(L)}))}}catch(L){this.handleError(L)}};EditorUi.prototype.copyImage=function(c,f,k){try{k=null!=k?k:4,null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(q,x){try{this.spinner.stop();var C=this.createImageDataUri(q,+f,"png"),E=Math.round(parseInt(x.getAttribute("width"))/k),L=Math.round(parseInt(x.getAttribute("height"))/k);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[f],"scale",[k]);this.writeImageToClipboard(C,E,L,"image/png",null,mxUtils.bind(this,function(){if(this.isLocalFileSave()){var Q=this.getBaseFilename(!1)+(null!=f?".drawio":"")+".png";this.saveLocalFile(C.substring(C.lastIndexOf(",")+1),Q,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(Q){this.handleError(Q)}}),null,null,null,mxUtils.bind(this,function(q){this.spinner.stop();this.handleError(q)}),null,null,k,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,Editor.isDarkMode()?"dark":"light",null,0<c.length?c:null)}catch(q){this.handleError(q)}};EditorUi.prototype.copyCells=function(c,f){var k=this.editor.graph;if(k.isSelectionEmpty())c.innerText="";else{var q=mxUtils.sortCells(k.model.getTopmostCells(k.getSelectionCells())),x=mxUtils.getXml(k.encodeCells(q));mxUtils.setTextContent(c,encodeURIComponent(x));f?(k.removeCells(q,!1),k.lastPasteXml=null):(k.lastPasteXml=x,k.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=null;if(Editor.enableNativeClipboard){var f=this.editor.graph;f.isSelectionEmpty()||(c=mxUtils.sortCells(f.getExportableCells(f.model.getTopmostCells(f.getSelectionCells()))),f=mxUtils.getXml(f.encodeCells(c)),navigator.clipboard.writeText(f))}return c};EditorUi.prototype.pasteXml=-function(c,f,k,q,x,B){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",[f],"compat",[k],"evt",[q],"html",[x],"pt",[B]);x=null!=x?x:!0;var E=this.editor.graph,L=null!=B?B:Editor.pasteAtMousePointer&&E.isMouseInsertPoint()?E.getInsertPoint():null;B=null;E.lastPasteXml==c?null==L&&E.pasteCounter++:(E.lastPasteXml=c,E.pasteCounter=0);var Q=E.pasteCounter*E.gridSize;if(k||this.isCompatibleString(c)){E.model.beginUpdate();try{if(B=this.importXml(c,Q,Q),null!=L){var V=E.getBoundingBoxFromGeometry(B,-!0);if(null!=V){var K=Math.round(E.snap(L.x)),fa=Math.round(E.snap(L.y));E.cellsMoved(B,K-V.x,fa-V.y)}}}finally{E.model.endUpdate()}E.setSelectionCells(B)}else if(f&&1==E.getSelectionCount()){f=E.getStartEditingCell(E.getSelectionCell(),q);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==E.getCurrentCellStyle(f)[mxConstants.STYLE_SHAPE])E.setCellStyles(mxConstants.STYLE_IMAGE,c,[f]);else{E.model.beginUpdate();try{E.labelChanged(f,c),Graph.isLink(c)&&E.setLinkForCell(f,c)}finally{E.model.endUpdate()}}E.setSelectionCell(f)}else L=-null!=L?L:E.getInsertPoint(),E.isMouseInsertPoint()&&(Q=0,E.lastPasteXml==c&&0<E.pasteCounter&&E.pasteCounter--),B=this.insertTextAt(c,L.x+Q,L.y+Q,x),E.setSelectionCells(B);E.isSelectionEmpty()||(E.scrollCellToVisible(E.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(E.view.getState(E.getSelectionCell())));return B};EditorUi.prototype.pasteCells=function(c,f,k,q){if(!mxEvent.isConsumed(c)){var x=c.clipboardData,B=this.editor.graph,E=!1,L=f;if(k&&null!=x&&x.getData){var Q=x.getData("text/plain"),+function(c,f,k,q,x,C){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",[f],"compat",[k],"evt",[q],"html",[x],"pt",[C]);x=null!=x?x:!0;var E=this.editor.graph,L=null!=C?C:Editor.pasteAtMousePointer&&E.isMouseInsertPoint()?E.getInsertPoint():null;C=null;E.lastPasteXml==c?null==L&&E.pasteCounter++:(E.lastPasteXml=c,E.pasteCounter=0);var Q=E.pasteCounter*E.gridSize;if(k||this.isCompatibleString(c)){E.model.beginUpdate();try{if(C=this.importXml(c,Q,Q),null!=L){var V=E.getBoundingBoxFromGeometry(C,+!0);if(null!=V){var K=Math.round(E.snap(L.x)),fa=Math.round(E.snap(L.y));E.cellsMoved(C,K-V.x,fa-V.y)}}}finally{E.model.endUpdate()}E.setSelectionCells(C)}else if(f&&1==E.getSelectionCount()){f=E.getStartEditingCell(E.getSelectionCell(),q);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==E.getCurrentCellStyle(f)[mxConstants.STYLE_SHAPE])E.setCellStyles(mxConstants.STYLE_IMAGE,c,[f]);else{E.model.beginUpdate();try{E.labelChanged(f,c),Graph.isLink(c)&&E.setLinkForCell(f,c)}finally{E.model.endUpdate()}}E.setSelectionCell(f)}else L=+null!=L?L:E.getInsertPoint(),E.isMouseInsertPoint()&&(Q=0,E.lastPasteXml==c&&0<E.pasteCounter&&E.pasteCounter--),C=this.insertTextAt(c,L.x+Q,L.y+Q,x),E.setSelectionCells(C);E.isSelectionEmpty()||(E.scrollCellToVisible(E.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(E.view.getState(E.getSelectionCell())));return C};EditorUi.prototype.pasteCells=function(c,f,k,q){if(!mxEvent.isConsumed(c)){var x=c.clipboardData,C=this.editor.graph,E=!1,L=f;if(k&&null!=x&&x.getData){var Q=x.getData("text/plain"),V=!1;if(null!=Q&&0<Q.length&&"%3CmxGraphModel%3E"==Q.substring(0,18))try{var K=decodeURIComponent(Q);this.isCompatibleString(K)&&(V=!0,Q=K)}catch(ra){}V=V?null:x.getData("text/html");null!=V&&0<V.length?(L=this.parseHtmlData(V),E="text/plain"!=L.getAttribute("data-type")):null!=Q&&0<Q.length&&(L=document.createElement("div"),mxUtils.setTextContent(L,Q))}Q=L.getElementsByTagName("span");if(null!=Q&&0<Q.length&&"application/vnd.lucid.chart.objects"===Q[0].getAttribute("data-lucid-type"))k=Q[0].getAttribute("data-lucid-content"),null!=k&&0<k.length&&(this.convertLucidChart(k,mxUtils.bind(this,function(ra){var l=this.editor.graph;l.lastPasteXml==ra?l.pasteCounter++:(l.lastPasteXml=ra,l.pasteCounter=0);var t=l.pasteCounter*l.gridSize;l.setSelectionCells(this.importXml(ra,t,t));l.scrollCellToVisible(l.getSelectionCell())}),mxUtils.bind(this,function(ra){this.handleError(ra)})),mxEvent.consume(c));else{var fa=!1,aa="";aa=E?null!=L.textContent&&"<mxfile"==L.textContent.substring(0,7)&&"</mxfile>"==L.textContent.substring(L.textContent.length-9)||"<mxGraphModel"==L.textContent.substring(0,13)&&"</mxGraphModel>"==L.textContent.substring(L.textContent.length-15)?L.textContent.replace(/\u00a0/g," "):L.innerHTML:mxUtils.trim(null==L.innerText?mxUtils.getTextContent(L):L.innerText);try{var da=aa.lastIndexOf("%3E");0<=da&&da<aa.length-3&&(aa=aa.substring(0,da+3))}catch(ra){}try{Q=L.getElementsByTagName("span"),(K=null!=Q&&0<Q.length?mxUtils.trim(decodeURIComponent(Q[0].textContent)):decodeURIComponent(aa))&&(this.isCompatibleString(K)||0==K.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(fa=!0,aa=K)}catch(ra){}K=null;try{if(!fa&&""==L.textContent)for(da=0;da<x.items.length;da++){var ba=x.items[da];if("file"===ba.kind){K=ba.getAsFile();break}}}catch(ra){}EditorUi.debug("EditorUi.pasteCells",[this],"evt",[c],"realElt",[f.outerHTML],"elt",[L.outerHTML],"useEvent",k,"pasteAsLabel",q,"xml",[aa],"compat",fa,"asHtml",E,"data",x,"items",[x.items.length],"files",[x.files.length],"types",[JSON.stringify(x.types)],"blob",[K]);try{if(fa||null==-K)if(null!=aa&&0<aa.length){if(0==aa.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var qa=mxUtils.bind(this,function(){try{aa=(new MiroImporter).importMiroJson(JSON.parse(aa)),this.pasteXml(aa,q,fa,c)}catch(ra){console.log("Miro import error:",ra)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",qa):qa()}else this.pasteXml(aa,q,fa,c,E);mxEvent.consume(c)}else k||(B.lastPasteXml=null,B.pasteCounter=0);else{var ha=B.getInsertPoint();this.importFiles([K],-ha.x,ha.y,this.maxImageSize);mxEvent.consume(c)}}catch(ra){this.handleError(ra)}}}f.innerHTML=" "};EditorUi.prototype.pasteFromClipboard=function(c){var f=this.editor.graph;null==c&&Editor.pasteAtMousePointer&&f.isMouseInsertPoint()&&(c=f.getInsertPoint());if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(k,q,x,B,E){if(null!=k){f.getModel().beginUpdate();try{this.pasteXml(k,!0,null,null,null,c)}finally{f.getModel().endUpdate()}}else k=-null!=q?q:null!=x?x:B,null!=k?(c=null!=c?c:f.getInsertPoint(),this.importFiles([k],c.x,c.y,this.maxImageSize)):this.pasteFromLocalClipboard(c)})):this.pasteFromLocalClipboard(c)}catch(k){}};EditorUi.prototype.pasteFromLocalClipboard=function(c){var f=this.editor.graph;f.getModel().beginUpdate();try{f.moveCellsTo(mxClipboard.paste(f),c)}finally{f.getModel().endUpdate()}};EditorUi.prototype.installImagePasteHandler=function(){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,-function(f){for(var k=null!=f.clipboardData?f.clipboardData:f.originalEvent.clipboardData,q=!1,x=null,B=0;B<k.types.length;B++)if("text/"===k.types[B].substring(0,5)){q=!0;break}for(B=0;B<k.items.length;B++){var E=k.items[B];if("file"===E.kind){x=E.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[f],"data",[k],"items",[k.items.length],"files",[k.files.length],"types",[JSON.stringify(k.types)],"containsText",q,"file",[x],"editing",c.isEditing());var L=mxUtils.bind(this,+K)if(null!=aa&&0<aa.length){if(0==aa.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var qa=mxUtils.bind(this,function(){try{aa=(new MiroImporter).importMiroJson(JSON.parse(aa)),this.pasteXml(aa,q,fa,c)}catch(ra){console.log("Miro import error:",ra)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",qa):qa()}else this.pasteXml(aa,q,fa,c,E);mxEvent.consume(c)}else k||(C.lastPasteXml=null,C.pasteCounter=0);else{var ha=C.getInsertPoint();this.importFiles([K],+ha.x,ha.y,this.maxImageSize);mxEvent.consume(c)}}catch(ra){this.handleError(ra)}}}f.innerHTML=" "};EditorUi.prototype.pasteFromClipboard=function(c){var f=this.editor.graph;null==c&&Editor.pasteAtMousePointer&&f.isMouseInsertPoint()&&(c=f.getInsertPoint());if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(k,q,x,C,E){if(null!=k){f.getModel().beginUpdate();try{this.pasteXml(k,!0,null,null,null,c)}finally{f.getModel().endUpdate()}}else k=+null!=q?q:null!=x?x:C,null!=k?(c=null!=c?c:f.getInsertPoint(),this.importFiles([k],c.x,c.y,this.maxImageSize)):this.pasteFromLocalClipboard(c)})):this.pasteFromLocalClipboard(c)}catch(k){}};EditorUi.prototype.pasteFromLocalClipboard=function(c){var f=this.editor.graph;f.getModel().beginUpdate();try{f.moveCellsTo(mxClipboard.paste(f),c)}finally{f.getModel().endUpdate()}};EditorUi.prototype.installImagePasteHandler=function(){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,+function(f){for(var k=null!=f.clipboardData?f.clipboardData:f.originalEvent.clipboardData,q=!1,x=null,C=0;C<k.types.length;C++)if("text/"===k.types[C].substring(0,5)){q=!0;break}for(C=0;C<k.items.length;C++){var E=k.items[C];if("file"===E.kind){x=E.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[f],"data",[k],"items",[k.items.length],"files",[k.files.length],"types",[JSON.stringify(k.types)],"containsText",q,"file",[x],"editing",c.isEditing());var L=mxUtils.bind(this,function(){try{if(!q&&null!=x){if(c.isEditing())this.importFiles([x],0,0,this.maxImageSize,function(V,K,fa,aa,da,ba){c.insertImage(V,da,ba)},function(){},function(V){return"image/"==V.type.substring(0,6)},function(V){for(var K=0;K<V.length;K++)V[K]()});else{var Q=this.editor.graph.getInsertPoint();this.importFiles([x],Q.x,Q.y,this.maxImageSize)}mxEvent.consume(f)}}catch(V){}});if(!mxEvent.isConsumed(f)&&!q)if(Editor.enableNativeClipboard)navigator.clipboard.read().then(mxUtils.bind(this,function(Q){this.readTypeFromClipboardData(Q,"image/svg+xml",mxUtils.bind(this,function(V){if(null!=V){V=new Blob([V],{type:"image/svg+xml"});var K=this.editor.graph.getInsertPoint();this.importFiles([V],K.x,K.y,this.maxImageSize)}else L()}),"image")}))["catch"](L);else L()}),!1)};EditorUi.prototype.readGraphModelFromClipboard=function(c){navigator.clipboard.read().then(mxUtils.bind(this,function(f){try{EditorUi.debug("EditorUi.readGraphModelFromClipboard",[this],"data",f,"types",null!=f&&0<f.length?[JSON.stringify(f[0].types)]:[]),this.readGraphModelFromHtmlClipboardData(f,-mxUtils.bind(this,function(k,q){null!=k?c(k):this.readGraphModelFromImageClipboardData(f,mxUtils.bind(this,function(x,B,E){null!=x?c(x):this.readTypeFromClipboardData(f,"text/plain",mxUtils.bind(this,function(L){c(L,B,E,q,f)}))}))}))}catch(k){c(null)}}))["catch"](function(){c(null)})};EditorUi.prototype.readGraphModelFromHtmlClipboardData=function(c,f){this.readTypeFromClipboardData(c,"text/html",mxUtils.bind(this,function(k){var q=null,x=null;try{var B=this.parseHtmlData(k);if(null!=B){q="text/plain"!=-B.getAttribute("data-type")?B.innerHTML:mxUtils.trim(null==B.innerText?mxUtils.getTextContent(B):B.innerText);try{var E=q.lastIndexOf("%3E");0<=E&&E<q.length-3&&(q=q.substring(0,E+3))}catch(V){}try{null==q&&(k=null,""==B.textContent&&1==B.children.length&&"IMG"==B.firstChild.nodeName&&(k=B.firstChild.getAttribute("src")),null!=k&&0<k.length&&("data:image/png;base64,"==k.substring(0,22)?x=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==k.substring(0,26)&&-(x=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/svg+xml"))))}catch(V){}try{var L=B.getElementsByTagName("span"),Q=null!=L&&0<L.length?mxUtils.trim(decodeURIComponent(L[0].textContent)):decodeURIComponent(q);this.isCompatibleString(Q)&&(q=Q)}catch(V){}}}catch(V){}f(this.isCompatibleString(q)?q:null,x)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,f){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(k,q){var x=null;try{null!=k&&(x=mxUtils.parseXml(k).documentElement.getAttribute("content"))}catch(B){}this.isCompatibleString(x)?-f(x):this.readTypeFromClipboardData(c,"image/png",mxUtils.bind(this,function(B,E){x=Editor.extractGraphModelFromPng("data:image/png;base64,"+B);this.isCompatibleString(x)?f(x):f(null,q,E)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,f,k){var q=!1;if(null!=c&&0<c.length)for(var x=0;x<c.length&&!q;x++)(function(B){0<=mxUtils.indexOf(B.types,f)&&(q=!0,B.getType(f).then(mxUtils.bind(this,function(E){if("image/png"==f)E.arrayBuffer().then(function(L){k(btoa(Graph.arrayBufferToString(L)),+mxUtils.bind(this,function(k,q){null!=k?c(k):this.readGraphModelFromImageClipboardData(f,mxUtils.bind(this,function(x,C,E){null!=x?c(x):this.readTypeFromClipboardData(f,"text/plain",mxUtils.bind(this,function(L){c(L,C,E,q,f)}))}))}))}catch(k){c(null)}}))["catch"](function(){c(null)})};EditorUi.prototype.readGraphModelFromHtmlClipboardData=function(c,f){this.readTypeFromClipboardData(c,"text/html",mxUtils.bind(this,function(k){var q=null,x=null;try{var C=this.parseHtmlData(k);if(null!=C){q="text/plain"!=+C.getAttribute("data-type")?C.innerHTML:mxUtils.trim(null==C.innerText?mxUtils.getTextContent(C):C.innerText);try{var E=q.lastIndexOf("%3E");0<=E&&E<q.length-3&&(q=q.substring(0,E+3))}catch(V){}try{null==q&&(k=null,""==C.textContent&&1==C.children.length&&"IMG"==C.firstChild.nodeName&&(k=C.firstChild.getAttribute("src")),null!=k&&0<k.length&&("data:image/png;base64,"==k.substring(0,22)?x=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==k.substring(0,26)&&+(x=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/svg+xml"))))}catch(V){}try{var L=C.getElementsByTagName("span"),Q=null!=L&&0<L.length?mxUtils.trim(decodeURIComponent(L[0].textContent)):decodeURIComponent(q);this.isCompatibleString(Q)&&(q=Q)}catch(V){}}}catch(V){}f(this.isCompatibleString(q)?q:null,x)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,f){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(k,q){var x=null;try{null!=k&&(x=mxUtils.parseXml(k).documentElement.getAttribute("content"))}catch(C){}this.isCompatibleString(x)?+f(x):this.readTypeFromClipboardData(c,"image/png",mxUtils.bind(this,function(C,E){x=Editor.extractGraphModelFromPng("data:image/png;base64,"+C);this.isCompatibleString(x)?f(x):f(null,q,E)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,f,k){var q=!1;if(null!=c&&0<c.length)for(var x=0;x<c.length&&!q;x++)(function(C){0<=mxUtils.indexOf(C.types,f)&&(q=!0,C.getType(f).then(mxUtils.bind(this,function(E){if("image/png"==f)E.arrayBuffer().then(function(L){k(btoa(Graph.arrayBufferToString(L)),E)})["catch"](function(){k(null)});else E.text().then(mxUtils.bind(this,function(L){EditorUi.debug("EditorUi.readTypeFromClipboardData",[this],"data",[c],"type",[f],"result",[L]);k(L,E)}))["catch"](function(){k(null)})}))["catch"](function(){k(null)}))})(c[x]);q||k()};EditorUi.prototype.parseHtmlData=function(c){var f=null;if(null!=c&&0<c.length){var k="<meta "==c.substring(0,6);f=document.createElement("div");f.innerHTML=(k?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(c);asHtml=!0;k=f.getElementsByTagName("style");if(null!=k)for(;0<k.length;)k[0].parentNode.removeChild(k[0]);if(null!=f.firstChild&&f.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=f.firstChild.nextSibling&&f.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==f.firstChild.nodeName&&"A"==f.firstChild.nextSibling.nodeName&&null==f.firstChild.nextSibling.nextSibling){var q=null==f.firstChild.nextSibling.innerText?mxUtils.getTextContent(f.firstChild.nextSibling):f.firstChild.nextSibling.innerText;q==f.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(f,q),asHtml=!1)}if(""==f.textContent&&(k=f.getElementsByTagName("img"),1==k.length&&(q=k[0].getAttribute("src"),k=null,null!=q))){if(Editor.isPngDataUrl(q)){var x=Editor.extractGraphModelFromPng(q);null!=x&&0<x.length&&(k=x)}else if("data:image/svg+xml;base64,"==q.substring(0,26)){img=this.base64ToBlob(q.substring(q.indexOf(",")+1),"image/svg+xml");q=Graph.getSvgFromDataUri(q);try{x=mxUtils.parseXml(q).documentElement.getAttribute("content"),this.isCompatibleString(x)&&(k=-x)}catch(B){}}null!=k&&(mxUtils.setTextContent(f,k),asHtml=!1)}asHtml?Graph.removePasteFormatting(f):f.setAttribute("data-type","text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[f],"asHtml",asHtml);return f};EditorUi.prototype.showPrintDialog=function(c,f,k){this.showDialog((new PrintDialog(this,c,f,k)).container,360,null,!0,!0)};EditorUi.prototype.print=function(c,f){var k=this.editor,q=k.graph,x=this.getPageIndex(this.currentPage),B=null!=x?x+1:1,E=mxUtils.bind(this,-function(ra,l,t,H){var J=ra.useCssTransforms,R=ra.currentTranslate,T=ra.currentScale,Y=ra.view.translate,Z=ra.view.scale;ra.useCssTransforms&&(ra.useCssTransforms=!1,ra.currentTranslate=new mxPoint(0,0),ra.currentScale=1,ra.view.translate=new mxPoint(0,0),ra.view.scale=1);var ia=ra.getGraphBounds(),ka=0,X=0,ja=mxRectangle.fromRectangle(ra.pageFormat),na=f.fit||f.crop||!ra.pageVisible,la=f.scale;ja.width*=ra.pageScale;ja.height*=ra.pageScale;var va=1;if(f.fit){va=f.sheetsAcross;var za=f.sheetsDown;-isNaN(la)||(ja.width=Math.ceil(ja.width*la),ja.height=Math.ceil(ja.height*la));va=Math.min(ja.height*za/(ia.height/ra.view.scale),ja.width*va/(ia.width/ra.view.scale))}else va=isNaN(la)?1:la;va*=1;!na&&ra.pageVisible?(la=ra.getPageLayout(),ka-=la.x*ja.width,X-=la.y*ja.height):na=!0;f.crop&&(f.selection&&(ia=q.getBoundingBox(q.getSelectionCells())),ja.width=(ia.width+1)*va/ra.view.scale,ja.height=(ia.height+1)*va/ra.view.scale);ja.width*=1;ja.height*=1;H=null!=H?"page/id,"+H:null;if(null==l){l=PrintDialog.createPrintPreview(ra,-va,null,0,ka,X,na);l.title=this.getBaseFilename(!0);l.pageSelector=!1;l.mathEnabled=!1;ka=f.border;isNaN(ka)||(l.pageMargin=ka);var sa=l.writeHead;l.writeHead=function(Fa,Ha){Ha=null!=Ha?Ha:"";f.shadows||(Ha+='g[style*="filter: drop-shadow("] {\n filter: none !important;{\n}\n');mxClient.IS_GC&&(Ha+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");null!=k.fontCss&&(Ha+=k.fontCss);sa.apply(this,arguments);for(var Na=ra.getCustomFonts(),La=0;La<Na.length;La++){var Da=Na[La].name,+x)}catch(C){}}null!=k&&(mxUtils.setTextContent(f,k),asHtml=!1)}asHtml?Graph.removePasteFormatting(f):f.setAttribute("data-type","text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[f],"asHtml",asHtml);return f};EditorUi.prototype.showPrintDialog=function(c,f,k){this.showDialog((new PrintDialog(this,c,f,k)).container,360,null,!0,!0)};EditorUi.prototype.print=function(c,f){var k=this.editor,q=k.graph,x=this.getPageIndex(this.currentPage),C=null!=x?x+1:1,E=mxUtils.bind(this,+function(ra,l,t,H){var J=ra.useCssTransforms,R=ra.currentTranslate,T=ra.currentScale,Y=ra.view.translate,Z=ra.view.scale;ra.useCssTransforms&&(ra.useCssTransforms=!1,ra.currentTranslate=new mxPoint(0,0),ra.currentScale=1,ra.view.translate=new mxPoint(0,0),ra.view.scale=1);var ia=ra.getGraphBounds(),ja=0,X=0,ka=mxRectangle.fromRectangle(ra.pageFormat),na=f.fit||f.crop||!ra.pageVisible,la=f.scale;ka.width*=ra.pageScale;ka.height*=ra.pageScale;var ua=1;if(f.fit){ua=f.sheetsAcross;var za=f.sheetsDown;+isNaN(la)||(ka.width=Math.ceil(ka.width*la),ka.height=Math.ceil(ka.height*la));ua=Math.min(ka.height*za/(ia.height/ra.view.scale),ka.width*ua/(ia.width/ra.view.scale))}else ua=isNaN(la)?1:la;ua*=1;!na&&ra.pageVisible?(la=ra.getPageLayout(),ja-=la.x*ka.width,X-=la.y*ka.height):na=!0;f.crop&&(f.selection&&(ia=q.getBoundingBox(q.getSelectionCells())),ka.width=(ia.width+1)*ua/ra.view.scale,ka.height=(ia.height+1)*ua/ra.view.scale);ka.width*=1;ka.height*=1;H=null!=H?"page/id,"+H:null;if(null==l){l=PrintDialog.createPrintPreview(ra,+ua,null,0,ja,X,na);l.title=this.getBaseFilename(!0);l.pageSelector=!1;l.mathEnabled=!1;ja=f.border;isNaN(ja)||(l.pageMargin=ja);var sa=l.writeHead;l.writeHead=function(Fa,Ha){Ha=null!=Ha?Ha:"";f.shadows||(Ha+='g[style*="filter: drop-shadow("] {\n filter: none !important;{\n}\n');mxClient.IS_GC&&(Ha+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");null!=k.fontCss&&(Ha+=k.fontCss);sa.apply(this,arguments);for(var Na=ra.getCustomFonts(),La=0;La<Na.length;La++){var Da=Na[La].name,Sa=Na[La].url;Graph.isCssFontUrl(Sa)?Fa.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(Sa))+'" charset="UTF-8" type="text/css">'):(Fa.writeln('<style type="text/css">'),Fa.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Da)+'";\nsrc: url("'+mxUtils.htmlEntities(Sa)+'");\n}'),Fa.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var wa=l.drawBackgroundImage;l.drawBackgroundImage=function(Fa){wa.apply(this,arguments);null!=Fa.node&&(EditorUi.embedSvgImages(Fa.node),q.disableSvgLinks(Fa.node,function(Ha){Ha.setAttribute("href","javascript:void(0)")}))}}var Ca=l.addGraphFragment;l.addGraphFragment=function(Fa,Ha,Na,La,Da,Sa){Ca.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:Da.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var Oa=Da.getElementsByTagName("svg"),Ta=0;Ta<Oa.length;Ta++)ra.addSvgShadow(Oa[Ta])};f.grid&&(l.gridSize=ra.gridSize,l.gridSteps=ra.view.gridSteps,l.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:-ra.view.gridColor);l.isCellVisible=f.selection?function(Fa){return ra.isCellSelected(Fa)&&ra.isCellVisible(Fa)}:function(Fa){return ra.isCellVisible(Fa)};l.open(null,null,t,!0,H,ja,f.selection?ra.getSelectionCells():null)}else{ia=ra.background;if(null==ia||""==ia||ia==mxConstants.NONE)ia="#ffffff";l.backgroundColor=ia;l.autoOrigin=na;f.grid&&(l.gridSize=ra.gridSize,l.gridSteps=ra.view.gridSteps,l.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:ra.view.gridColor);l.isCellVisible=-f.selection?function(Fa){return ra.isCellSelected(Fa)&&ra.isCellVisible(Fa)}:function(Fa){return ra.isCellVisible(Fa)};l.appendGraph(ra,va,ka,X,t,!0,H,ja,f.selection?ra.getSelectionCells():null);t=ra.getCustomFonts();if(null!=l.wnd)for(ja=0;ja<t.length;ja++)ka=t[ja].name,X=t[ja].url,Graph.isCssFontUrl(X)?l.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(X)+'" charset="UTF-8" type="text/css">'):(l.wnd.document.writeln('<style type="text/css">'),l.wnd.document.writeln('@font-face {\nfont-family: "'+-mxUtils.htmlEntities(ka)+'";\nsrc: url("'+mxUtils.htmlEntities(X)+'");\n}'),l.wnd.document.writeln("</style>"))}J&&(ra.useCssTransforms=J,ra.currentTranslate=R,ra.currentScale=T,ra.view.translate=Y,ra.view.scale=Z);return l}),L=f.pagesFrom,Q=f.pagesTo,V=!f.allPages;x=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{V&&(V=f.selection||L==B&&Q==B);if(!V&&null!=this.pages&&this.pages.length){V=0;B=this.pages.length-1;f.allPages||(V=parseInt(L)-1,B=parseInt(Q)-1);for(var K=V;K<=B;K++){var fa=+ra.view.gridColor);l.isCellVisible=f.selection?function(Fa){return ra.isCellSelected(Fa)&&ra.isCellVisible(Fa)}:function(Fa){return ra.isCellVisible(Fa)};l.open(null,null,t,!0,H,ka,f.selection?ra.getSelectionCells():null)}else{ia=ra.background;if(null==ia||""==ia||ia==mxConstants.NONE)ia="#ffffff";l.backgroundColor=ia;l.autoOrigin=na;f.grid&&(l.gridSize=ra.gridSize,l.gridSteps=ra.view.gridSteps,l.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:ra.view.gridColor);l.isCellVisible=+f.selection?function(Fa){return ra.isCellSelected(Fa)&&ra.isCellVisible(Fa)}:function(Fa){return ra.isCellVisible(Fa)};l.appendGraph(ra,ua,ja,X,t,!0,H,ka,f.selection?ra.getSelectionCells():null);t=ra.getCustomFonts();if(null!=l.wnd)for(ka=0;ka<t.length;ka++)ja=t[ka].name,X=t[ka].url,Graph.isCssFontUrl(X)?l.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(X)+'" charset="UTF-8" type="text/css">'):(l.wnd.document.writeln('<style type="text/css">'),l.wnd.document.writeln('@font-face {\nfont-family: "'++mxUtils.htmlEntities(ja)+'";\nsrc: url("'+mxUtils.htmlEntities(X)+'");\n}'),l.wnd.document.writeln("</style>"))}J&&(ra.useCssTransforms=J,ra.currentTranslate=R,ra.currentScale=T,ra.view.translate=Y,ra.view.scale=Z);return l}),L=f.pagesFrom,Q=f.pagesTo,V=!f.allPages;x=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{V&&(V=f.selection||L==C&&Q==C);if(!V&&null!=this.pages&&this.pages.length){V=0;C=this.pages.length-1;f.allPages||(V=parseInt(L)-1,C=parseInt(Q)-1);for(var K=V;K<=C;K++){var fa=this.pages[K];L=fa==this.currentPage?q:null;if(null==L){L=this.createTemporaryGraph(q.stylesheet);L.shapeForegroundColor=q.shapeForegroundColor;L.shapeBackgroundColor=q.shapeBackgroundColor;Q=!0;var aa=V=!1,da=null,ba=null;null==fa.viewState&&null==fa.root&&this.updatePageRoot(fa);null!=fa.viewState&&(Q=fa.viewState.pageVisible,V=fa.viewState.mathEnabled,aa=fa.viewState.shadowVisible,da=fa.viewState.background,ba=fa.viewState.backgroundImage,L.pageFormat=fa.viewState.pageFormat,L.gridSize=fa.viewState.gridSize,L.hiddenTags=fa.viewState.hiddenTags||[]);null!=ba&&null!=ba.originalSrc&&(ba=this.createImageForPageLink(ba.originalSrc,fa));L.background=da;L.backgroundImage=null!=ba?new mxImage(ba.src,ba.width,ba.height,ba.x,ba.y):null;L.pageVisible=Q;L.mathEnabled=V;L.shadowVisible=aa;var ha=L.getGraphBounds;L.getGraphBounds=function(){var ra=ha.apply(this,arguments),l=this.backgroundImage;if(null!=l&&null!=l.width&&null!=l.height){var t=this.view.translate,H=this.view.scale;ra=mxRectangle.fromRectangle(ra);-ra.add(new mxRectangle((t.x+l.x)*H,(t.y+l.y)*H,l.width*H,l.height*H))}return ra};var qa=L.getGlobalVariable;L.getGlobalVariable=function(ra){return"page"==ra?fa.getName():"pagenumber"==ra?K+1:"pagecount"==ra?null!=this.pages?this.pages.length:1:qa.apply(this,arguments)};document.body.appendChild(L.container);this.updatePageRoot(fa);L.model.setRoot(fa.root)}x=E(L,x,K!=B,fa.getId());L!=q&&L.container.parentNode.removeChild(L.container)}}else x=E(q);if(null==x||null==x.wnd)this.handleError({message:mxResources.get("errorUpdatingPreview")});+ra.add(new mxRectangle((t.x+l.x)*H,(t.y+l.y)*H,l.width*H,l.height*H))}return ra};var qa=L.getGlobalVariable;L.getGlobalVariable=function(ra){return"page"==ra?fa.getName():"pagenumber"==ra?K+1:"pagecount"==ra?null!=this.pages?this.pages.length:1:qa.apply(this,arguments)};document.body.appendChild(L.container);this.updatePageRoot(fa);L.model.setRoot(fa.root)}x=E(L,x,K!=C,fa.getId());L!=q&&L.container.parentNode.removeChild(L.container)}}else x=E(q);if(null==x||null==x.wnd)this.handleError({message:mxResources.get("errorUpdatingPreview")});else{x.mathEnabled&&(E=x.wnd.document,c||(x.wnd.IMMEDIATE_PRINT=!0),E.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>'));x.closeDocument();if(Editor.expandPatternsForPrint&&null!=x.wnd)for(E=x.wnd.document.getElementsByTagName("svg"),K=0;K<E.length;K++)Editor.expandSvgPatterns(E[K]);Graph.rewritePageLinks(x.wnd.document,!0);x.mathEnabled||c||PrintDialog.printPreview(x)}return x}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var f=null,k=0;k<c.length;k++)mxEvent.addListener(c[k],"dragleave",function(q){null!=f&&(f.parentNode.removeChild(f),f=null);q.stopPropagation();q.preventDefault()}),mxEvent.addListener(c[k],"dragover",mxUtils.bind(this,function(q){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==f&&(f=this.highlightElement());q.stopPropagation();q.preventDefault()})),mxEvent.addListener(c[k],"drop",mxUtils.bind(this,function(q){null!=f&&(f.parentNode.removeChild(f),f=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<-q.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(q.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(q)&&!mxEvent.isShiftDown(q)):this.openFiles(q.dataTransfer.files,!0);else{var x=this.extractGraphModelFromEvent(q);if(null==x){var B=null!=q.dataTransfer?q.dataTransfer:q.clipboardData;null!=B&&(10==document.documentMode||11==document.documentMode?x=B.getData("Text"):(x=null,x=0<=mxUtils.indexOf(B.types,"text/uri-list")?q.dataTransfer.getData("text/uri-list"):-0<=mxUtils.indexOf(B.types,"text/html")?B.getData("text/html"):null,null!=x&&0<x.length?(B=document.createElement("div"),B.innerHTML=Graph.sanitizeHtml(x),B=B.getElementsByTagName("img"),0<B.length&&(x=B[0].getAttribute("src"))):0<=mxUtils.indexOf(B.types,"text/plain")&&(x=B.getData("text/plain"))),null!=x&&(Editor.isPngDataUrl(x)?(x=Editor.extractGraphModelFromPng(x),null!=x&&0<x.length&&this.openLocalFile(x,null,!0)):this.isRemoteFileFormat(x)?this.isOffline()?this.showError(mxResources.get("error"),+q.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(q.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(q)&&!mxEvent.isShiftDown(q)):this.openFiles(q.dataTransfer.files,!0);else{var x=this.extractGraphModelFromEvent(q);if(null==x){var C=null!=q.dataTransfer?q.dataTransfer:q.clipboardData;null!=C&&(10==document.documentMode||11==document.documentMode?x=C.getData("Text"):(x=null,x=0<=mxUtils.indexOf(C.types,"text/uri-list")?q.dataTransfer.getData("text/uri-list"):+0<=mxUtils.indexOf(C.types,"text/html")?C.getData("text/html"):null,null!=x&&0<x.length?(C=document.createElement("div"),C.innerHTML=Graph.sanitizeHtml(x),C=C.getElementsByTagName("img"),0<C.length&&(x=C[0].getAttribute("src"))):0<=mxUtils.indexOf(C.types,"text/plain")&&(x=C.getData("text/plain"))),null!=x&&(Editor.isPngDataUrl(x)?(x=Editor.extractGraphModelFromPng(x),null!=x&&0<x.length&&this.openLocalFile(x,null,!0)):this.isRemoteFileFormat(x)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(x))).send(mxUtils.bind(this,function(E){200<=E.getStatus()&&299>=E.getStatus()?this.openLocalFile(E.getText(),null,!0):this.showError(mxResources.get("error"),413==E.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(x)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(x):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+-"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(x)))))}else this.openLocalFile(x,null,!0)}q.stopPropagation();q.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var f=0,k=0;if(null==c){var q=document.body;var x=document.documentElement;if(null==q&&null==x)return null;var B=((null!=q?q.clientWidth:0)||x.clientWidth)-3;q=Math.max(null!=q?q.clientHeight:0,x.clientHeight)-3}else q=c.getBoundingClientRect(),f=q.top,k=q.left,B=q.width,q=q.height;x=document.createElement("div");-x.style.zIndex=mxPopupMenu.prototype.zIndex+2;x.style.border="3px dotted rgb(254, 137, 12)";x.style.pointerEvents="none";x.style.position="absolute";x.style.top=f+"px";x.style.left=k+"px";x.style.width=Math.max(0,B-3)+"px";x.style.height=Math.max(0,q-3)+"px";if(null!=c&&c.parentNode==this.editor.graph.container)this.editor.graph.container.appendChild(x);else if(null!=document.body)document.body.appendChild(x);else return null;return x};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);-var f=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=f){var k=new mxCodec(f.ownerDocument),q=new mxGraphModel;k.decode(f,q);f=q.getChildAt(q.getRoot(),0);for(k=0;k<q.getChildCount(f);k++)c.push(q.getChildAt(f,k))}return c};EditorUi.prototype.openFileHandle=function(c,f,k,q,x,B,E){if(null!=f&&0<f.length){if(!Editor.useCanvasForExport&&/(\.png)$/i.test(f)||/(\.pdf)$/i.test(f))f=f.substring(0,f.length-4),/(\.drawio)$/i.test(f)||(f+=".drawio");var L=mxUtils.bind(this,function(V){f=0<=+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(x)))))}else this.openLocalFile(x,null,!0)}q.stopPropagation();q.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var f=0,k=0;if(null==c){var q=document.body;var x=document.documentElement;if(null==q&&null==x)return null;var C=((null!=q?q.clientWidth:0)||x.clientWidth)-3;q=Math.max(null!=q?q.clientHeight:0,x.clientHeight)-3}else q=c.getBoundingClientRect(),f=q.top,k=q.left,C=q.width,q=q.height;x=document.createElement("div");+x.style.zIndex=mxPopupMenu.prototype.zIndex+2;x.style.border="3px dotted rgb(254, 137, 12)";x.style.pointerEvents="none";x.style.position="absolute";x.style.top=f+"px";x.style.left=k+"px";x.style.width=Math.max(0,C-3)+"px";x.style.height=Math.max(0,q-3)+"px";if(null!=c&&c.parentNode==this.editor.graph.container)this.editor.graph.container.appendChild(x);else if(null!=document.body)document.body.appendChild(x);else return null;return x};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);+var f=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=f){var k=new mxCodec(f.ownerDocument),q=new mxGraphModel;k.decode(f,q);f=q.getChildAt(q.getRoot(),0);for(k=0;k<q.getChildCount(f);k++)c.push(q.getChildAt(f,k))}return c};EditorUi.prototype.openFileHandle=function(c,f,k,q,x,C,E){if(null!=f&&0<f.length){if(!Editor.useCanvasForExport&&/(\.png)$/i.test(f)||/(\.pdf)$/i.test(f))f=f.substring(0,f.length-4),/(\.drawio)$/i.test(f)||(f+=".drawio");var L=mxUtils.bind(this,function(V){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".drawio":f+".drawio";if("<mxlibrary"==V.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,q);try{this.loadLibrary(new LocalLibrary(this,V,f)),this.showSidebar()}catch(K){this.handleError(K,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(V,f,q,null,null,null,E)});if(EditorUi.isVisioFilename(f))this.importVisio(k,mxUtils.bind(this,function(V){this.spinner.stop();L(V)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(V){this.spinner.stop();L(V)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,f))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(k,mxUtils.bind(this,function(V){4==V.readyState&&(this.spinner.stop(),200<=V.status&&299>=V.status?L(V.responseText):this.handleError({message:mxResources.get(413==V.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(V){this.spinner.stop();this.openLocalFile(V,f,q,null,null,null,E)}),mxUtils.bind(this,function(V){this.spinner.stop();this.handleError(V)}));else if("<mxlibrary"==c.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,q);try{this.loadLibrary(new LocalLibrary(this,c,k.name)),this.showSidebar()}catch(V){this.handleError(V,mxResources.get("errorLoadingFile"))}}else if(0==c.indexOf("PK"))this.importZipFile(k,mxUtils.bind(this,function(V){this.spinner.stop();L(V)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,f,q,null,null,null,E)}));else{if("image/png"==k.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==k.type){var Q=Editor.extractGraphModelFromPdf(c);-null!=Q&&(x=null,q=!0,c=Q)}this.spinner.stop();this.openLocalFile(c,f,q,x,null!=x?k:null,B,E)}}};EditorUi.prototype.openFiles=function(c,f,k){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=0;q<c.length;q++)mxUtils.bind(this,function(x){var B=new FileReader;B.onload=mxUtils.bind(this,function(E){try{this.openFileHandle(E.target.result,x.name,x,f,null,null,k)}catch(L){this.handleError(L)}});B.onerror=mxUtils.bind(this,function(E){this.spinner.stop();this.handleError(E);window.openFile=-null});"image"!==x.type.substring(0,5)&&"application/pdf"!==x.type||"image/svg"===x.type.substring(0,9)?B.readAsText(x):B.readAsDataURL(x)})(c[q])};EditorUi.prototype.openLocalFile=function(c,f,k,q,x,B,E){var L=this.getCurrentFile(),Q=mxUtils.bind(this,function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var K=mxUtils.parseXml(c);null!=K&&(this.editor.setGraphXml(K.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,-f||this.defaultFilename,k,q,x,B));null!=E&&E()});if(null!=c&&0<c.length)if(null==L||!L.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=q||this.isDiagramEmpty()))Q();else if((mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=L&&L.isModified())this.confirm(mxResources.get("allChangesLost"),null,Q,mxResources.get("cancel"),mxResources.get("discardChanges"));else{window.openFile=new OpenFile(function(){window.openFile=null});window.openFile.setData(c,f,k);var V=mxUtils.bind(this,+null!=Q&&(x=null,q=!0,c=Q)}this.spinner.stop();this.openLocalFile(c,f,q,x,null!=x?k:null,C,E)}}};EditorUi.prototype.openFiles=function(c,f,k){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=0;q<c.length;q++)mxUtils.bind(this,function(x){var C=new FileReader;C.onload=mxUtils.bind(this,function(E){try{this.openFileHandle(E.target.result,x.name,x,f,null,null,k)}catch(L){this.handleError(L)}});C.onerror=mxUtils.bind(this,function(E){this.spinner.stop();this.handleError(E);window.openFile=+null});"image"!==x.type.substring(0,5)&&"application/pdf"!==x.type||"image/svg"===x.type.substring(0,9)?C.readAsText(x):C.readAsDataURL(x)})(c[q])};EditorUi.prototype.openLocalFile=function(c,f,k,q,x,C,E){var L=this.getCurrentFile(),Q=mxUtils.bind(this,function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var K=mxUtils.parseXml(c);null!=K&&(this.editor.setGraphXml(K.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,+f||this.defaultFilename,k,q,x,C));null!=E&&E()});if(null!=c&&0<c.length)if(null==L||!L.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=q||this.isDiagramEmpty()))Q();else if((mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=L&&L.isModified())this.confirm(mxResources.get("allChangesLost"),null,Q,mxResources.get("cancel"),mxResources.get("discardChanges"));else{window.openFile=new OpenFile(function(){window.openFile=null});window.openFile.setData(c,f,k);var V=mxUtils.bind(this,function(){null!=L&&L.isModified()?this.confirm(mxResources.get("allChangesLost"),null,Q,mxResources.get("cancel"),mxResources.get("discardChanges")):Q()});"1"==urlParams.openInSameWin||navigator.standalone?V():this.showDialog((new PopupDialog(this,this.getUrl(),null,V)).container,340,140,!0,!0)}else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)this.updatePageRoot(this.pages[f]),this.addBasenamesForCell(this.pages[f].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);f=[];for(var k in c)f.push(k);return f};EditorUi.prototype.addBasenamesForCell=function(c,f){function k(E){if(null!=E){var L=E.lastIndexOf(".");0<L&&(E=E.substring(L+1,E.length));null==f[E]&&(f[E]=!0)}}var q=this.editor.graph,x=q.getCellStyle(c);k(mxStencilRegistry.getBasenameForStencil(x[mxConstants.STYLE_SHAPE]));q.model.isEdge(c)&&(k(mxMarker.getPackageForType(x[mxConstants.STYLE_STARTARROW])),k(mxMarker.getPackageForType(x[mxConstants.STYLE_ENDARROW])));-x=q.model.getChildCount(c);for(var B=0;B<x;B++)this.addBasenamesForCell(q.model.getChildAt(c,B),f)};EditorUi.prototype.setGraphEnabled=function(c){this.diagramContainer.style.visibility=c?"":"hidden";this.formatContainer.style.visibility=this.diagramContainer.style.visibility;this.sidebarContainer.style.display=c?"":"none";this.hsplit.style.display=this.sidebarContainer.style.display;this.editor.graph.setEnabled(c);null!=this.tabContainer&&(this.tabContainer.style.visibility=this.diagramContainer.style.visibility);-c||this.hideWindows();this.editor.graph.sizeDidChange();this.resetScrollbars()};EditorUi.prototype.fitInitialView=function(c){var f=this.editor.graph,k=this.currentPage;k=null!=k?k.getViewBox():null;var q=f.container;if(null!=k&&0<q.clientWidth&&0<q.clientHeight){c=q.clientWidth;var x=q.clientHeight,B=Math.min(c/k.width,x/k.height);f.zoomTo(null!=k.scale?Math.min(k.scale,B):B,null,null,mxUtils.hasScrollbars(q));mxUtils.hasScrollbars(q)&&(B=f.view.translate,f=f.view.scale,q.scrollLeft=(k.x+k.width/-2+B.x)*f-c/2,q.scrollTop=(k.y+k.height/2+B.y)*f-x/2)}else this.initialFitDiagram(c)};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((this.embedMessageSource||window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))){var c=!1;this.installMessageHandler(mxUtils.bind(this,function(f,k,q,x){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;-this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);Editor.fitDiagramOnLoad&&this.fitInitialView();if(x)try{var B=this.editor.graph;B.setGridEnabled(!1);B.pageVisible=!1;var E=B.model.cells,L;for(L in E){var Q=E[L];null!=Q&&null!=Q.style&&(Q.style+=";sketch=1;"+(-1==Q.style.indexOf("fontFamily=")||-1<Q.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":+x=q.model.getChildCount(c);for(var C=0;C<x;C++)this.addBasenamesForCell(q.model.getChildAt(c,C),f)};EditorUi.prototype.setGraphEnabled=function(c){this.diagramContainer.style.visibility=c?"":"hidden";this.formatContainer.style.visibility=this.diagramContainer.style.visibility;this.sidebarContainer.style.display=c?"":"none";this.hsplit.style.display=this.sidebarContainer.style.display;this.editor.graph.setEnabled(c);null!=this.tabContainer&&(this.tabContainer.style.visibility=this.diagramContainer.style.visibility);+c||this.hideWindows();this.editor.graph.sizeDidChange();this.resetScrollbars()};EditorUi.prototype.fitInitialView=function(c){var f=this.editor.graph,k=this.currentPage;k=null!=k?k.getViewBox():null;var q=f.container;if(null!=k&&0<q.clientWidth&&0<q.clientHeight){c=q.clientWidth;var x=q.clientHeight,C=Math.min(c/k.width,x/k.height);f.zoomTo(null!=k.scale?Math.min(k.scale,C):C,null,null,mxUtils.hasScrollbars(q));mxUtils.hasScrollbars(q)&&(C=f.view.translate,f=f.view.scale,q.scrollLeft=(k.x+k.width/+2+C.x)*f-c/2,q.scrollTop=(k.y+k.height/2+C.y)*f-x/2)}else this.initialFitDiagram(c)};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((this.embedMessageSource||window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))){var c=!1;this.installMessageHandler(mxUtils.bind(this,function(f,k,q,x){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;+this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);Editor.fitDiagramOnLoad&&this.fitInitialView();if(x)try{var C=this.editor.graph;C.setGridEnabled(!1);C.pageVisible=!1;var E=C.model.cells,L;for(L in E){var Q=E[L];null!=Q&&null!=Q.style&&(Q.style+=";sketch=1;"+(-1==Q.style.indexOf("fontFamily=")||-1<Q.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(V){console.log(V)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=q?q:!1;this.updateUi();window.self===window.top||this.noAutoFocus||window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(c,f){null!=c?this.spinner.spin(document.body,mxResources.get("loading"))&&c.getPublicUrl(mxUtils.bind(this,function(k){this.spinner.stop();f(k)})):f(null)};EditorUi.prototype.createLoadMessage=function(c){var f=this.editor.graph,k=f.getGraphBounds(),q=f.view.scale,x=f.view.translate;return{event:c,pageVisible:f.pageVisible,translate:x,bounds:k,currentPage:this.getSelectedPageIndex(),scale:q,page:f.view.getBackgroundPageBounds(),modelBounds:{x:k.x/q-x.x,y:k.y/q-x.y,width:k.width/q,height:k.height/q},containerSize:{width:f.container.clientWidth,height:f.container.clientHeight,offsetWidth:f.container.offsetWidth,offsetHeight:f.container.offsetHeight}}};EditorUi.prototype.sendEmbeddedSvgExport=function(c){try{var f=this.editor.graph;f.isEditing()&&f.stopEditing(!f.isInvokesStopCellEditing());var k=this.embedMessageSource||window.opener||window.parent;@@ -4514,15 +4517,15 @@ if(this.editor.modified){var q=f.background;if(null==q||q==mxConstants.NONE)q=th"*");c||(this.diagramContainer.removeAttribute("data-bounds"),Editor.inlineFullscreen=!1,f.model.clear(),this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(x){c||this.handleError(x)}};EditorUi.prototype.whenScriptReady=function(c,f,k){if(c())f();else var q=0,x=window.setInterval(function(){c()?(window.clearInterval(x),f()):100<=++q&&(window.clearInterval(x),null!=k&&k())},100)};EditorUi.prototype.lastLayoutSpec=null;EditorUi.prototype.resolveLayoutList=function(c){if("string"===typeof c){c=mxUtils.trim(c);if("["==c.charAt(0))return JSON.parse(c);if("undefined"===typeof LibavoidRouting||c!==LibavoidRouting.SHORTHAND&&c!==LibavoidRouting.LAYOUT_NAME){if("parallels"===c)return[{layout:"mxParallelEdgeLayout",config:{checkOverlap:!0}}];if("undefined"!==typeof ElkLayout&&null!=ElkLayout.MENU_PRESETS&&null!=ElkLayout.MENU_PRESETS[c]){c=ElkLayout.MENU_PRESETS[c];var f="layered"===c.algorithm?ElkLayout.CANONICAL_EDGE:{corners:(ElkLayout.CANONICAL_EDGE||{}).corners};return[{layout:Graph.elkLayoutNameForAlgorithm(c.algorithm),config:Graph.elkOptionsToConfig(c.options,f)}]}}else return[{layout:LibavoidRouting.LAYOUT_NAME}];return null}return"object"===typeof c?c:null};EditorUi.prototype.getSelectedLayoutContainer=function(){var c=this.editor.graph,f=1==c.getSelectionCount()?c.getSelectionCell():null;return null!=f&&c.model.isVertex(f)&&(c=c.getCellStyle(f).childLayout,null!=c&&"tableLayout"!=c&&"stackLayout"!=c&&-"rack"!=c)?f:null};EditorUi.prototype.setContainerChildLayout=function(c,f){var k=this.editor.graph,q=f,x=null,B=null;if("string"!==typeof f){if(!Array.isArray(f)||0==f.length)throw Error("Invalid layout list: "+JSON.stringify(f));q=[];for(var E=0;E<f.length;E++){var L=f[E];if(null!=L&&("mxRadialTreeLayout"==L.layout||"mxOrgChartLayout"==L.layout||"mxFastOrganicLayout"==L.layout||"mxCircleLayout"==L.layout))throw Error("Not supported as childLayout: "+L.layout);if(null!=L&&null!=Graph.elkLayoutAlgorithms[L.layout]){var Q=-{},V;for(V in L.config)Q[V]=L.config[V];delete Q.rootCellIds;null==Q.resizeNodes&&(Q.resizeNodes=!1);null==Q.resizeLayoutRoot&&(Q.resizeLayoutRoot=!0);"elkLayered"==L.layout&&null==Q.extractIsolated&&(Q.extractIsolated=!1);null!=Q.corners&&(B=Q.corners);if(null!=Q.groupPadding&&(x=String(Q.groupPadding),/[;=]/.test(x)))throw Error("Invalid groupPadding: "+x);L={layout:L.layout,config:Q}}q.push(L)}k.createLayouts(q);q=Graph.encodeChildLayout(q)}if(0<=q.indexOf(";"))throw Error("Invalid childLayout: "+-q);k.model.beginUpdate();try{var K=k.model.getStyle(c);k.setCellStyles("childLayout",q,[c]);null!=x&&k.setCellStyles("groupPadding",x,[c]);null!=B&&"undefined"!==typeof ElkLayout&&"function"===typeof ElkLayout.applyCorners&&ElkLayout.applyCorners(k,c,B);k.model.getStyle(c)==K&&null!=k.layoutManager&&k.layoutManager.executeLayout(c,!1)}finally{k.model.endUpdate()}};EditorUi.prototype.executeLayoutSpec=function(c,f,k){var q=this;this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout&&-null!=ElkLayout.MENU_PRESETS},function(){try{var x=q.resolveLayoutList(c);if(null!=x){q.lastLayoutSpec=x;var B=k?q.getSelectedLayoutContainer():null;null!=B&&Array.isArray(x)&&0<x.length?(q.setContainerChildLayout(B,x),null!=f&&f()):q.executeLayouts(q.editor.graph.createLayouts(x),f)}else q.handleError(Error("Unknown layout: "+c))}catch(E){q.handleError(E)}},function(){q.handleError(Error(mxResources.get("serviceUnavailableOrBlocked")))})};EditorUi.prototype.installPassThroughKeys=function(){null!=-Editor.passThroughKeys&&null==this.passThroughKeysListener&&(this.passThroughKeysListener=mxUtils.bind(this,function(c){for(var f=Editor.passThroughKeys,k=c.ctrlKey||c.metaKey,q=null!=c.key?c.key.toLowerCase():"",x=0;x<f.length;x++){var B=f[x];if(q===String(B.key).toLowerCase()&&k===!!B.ctrl&&c.shiftKey===!!B.shift&&c.altKey===!!B.alt){c.preventDefault();c.stopImmediatePropagation();null!=B.command&&(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"shortcut",-command:B.command}),"*");break}}}),window.addEventListener("keydown",this.passThroughKeysListener,!0))};EditorUi.keyNames={8:"Backspace",9:"Tab",13:"Enter",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",109:"-",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",187:"+",189:"-"};EditorUi.prototype.installKeyboardShortcuts=function(){if(null!=Editor.keyboardShortcuts)for(var c=+"rack"!=c)?f:null};EditorUi.prototype.setContainerChildLayout=function(c,f){var k=this.editor.graph,q=f,x=null,C=null;if("string"!==typeof f){if(!Array.isArray(f)||0==f.length)throw Error("Invalid layout list: "+JSON.stringify(f));q=[];for(var E=0;E<f.length;E++){var L=f[E];if(null!=L&&("mxRadialTreeLayout"==L.layout||"mxOrgChartLayout"==L.layout||"mxFastOrganicLayout"==L.layout||"mxCircleLayout"==L.layout))throw Error("Not supported as childLayout: "+L.layout);if(null!=L&&null!=Graph.elkLayoutAlgorithms[L.layout]){var Q=+{},V;for(V in L.config)Q[V]=L.config[V];delete Q.rootCellIds;null==Q.resizeNodes&&(Q.resizeNodes=!1);null==Q.resizeLayoutRoot&&(Q.resizeLayoutRoot=!0);"elkLayered"==L.layout&&null==Q.extractIsolated&&(Q.extractIsolated=!1);null!=Q.corners&&(C=Q.corners);if(null!=Q.groupPadding&&(x=String(Q.groupPadding),/[;=]/.test(x)))throw Error("Invalid groupPadding: "+x);L={layout:L.layout,config:Q}}q.push(L)}k.createLayouts(q);q=Graph.encodeChildLayout(q)}if(0<=q.indexOf(";"))throw Error("Invalid childLayout: "++q);k.model.beginUpdate();try{var K=k.model.getStyle(c);k.setCellStyles("childLayout",q,[c]);null!=x&&k.setCellStyles("groupPadding",x,[c]);null!=C&&"undefined"!==typeof ElkLayout&&"function"===typeof ElkLayout.applyCorners&&ElkLayout.applyCorners(k,c,C);k.model.getStyle(c)==K&&null!=k.layoutManager&&k.layoutManager.executeLayout(c,!1)}finally{k.model.endUpdate()}};EditorUi.prototype.executeLayoutSpec=function(c,f,k){var q=this;this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout&&+null!=ElkLayout.MENU_PRESETS},function(){try{var x=q.resolveLayoutList(c);if(null!=x){q.lastLayoutSpec=x;var C=k?q.getSelectedLayoutContainer():null;null!=C&&Array.isArray(x)&&0<x.length?(q.setContainerChildLayout(C,x),null!=f&&f()):q.executeLayouts(q.editor.graph.createLayouts(x),f)}else q.handleError(Error("Unknown layout: "+c))}catch(E){q.handleError(E)}},function(){q.handleError(Error(mxResources.get("serviceUnavailableOrBlocked")))})};EditorUi.prototype.installPassThroughKeys=function(){null!=+Editor.passThroughKeys&&null==this.passThroughKeysListener&&(this.passThroughKeysListener=mxUtils.bind(this,function(c){for(var f=Editor.passThroughKeys,k=c.ctrlKey||c.metaKey,q=null!=c.key?c.key.toLowerCase():"",x=0;x<f.length;x++){var C=f[x];if(q===String(C.key).toLowerCase()&&k===!!C.ctrl&&c.shiftKey===!!C.shift&&c.altKey===!!C.alt){c.preventDefault();c.stopImmediatePropagation();null!=C.command&&(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"shortcut",+command:C.command}),"*");break}}}),window.addEventListener("keydown",this.passThroughKeysListener,!0))};EditorUi.keyNames={8:"Backspace",9:"Tab",13:"Enter",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",109:"-",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",187:"+",189:"-"};EditorUi.prototype.installKeyboardShortcuts=function(){if(null!=Editor.keyboardShortcuts)for(var c=0;c<Editor.keyboardShortcuts.length;c++)this.installKeyboardShortcut(Editor.keyboardShortcuts[c])};EditorUi.prototype.installKeyboardShortcut=function(c){var f="string"===typeof c.keyCode&&1==c.keyCode.length,k=f?c.keyCode.toUpperCase().charCodeAt(0):parseInt(c.keyCode);if(isNaN(k))EditorUi.debug("Configuration Error: Invalid keyCode for keyboardShortcuts",c);else{if(c.alt){var q=c.control?c.shift?this.ctrlAltShiftActions:this.ctrlAltActions:c.shift?this.altShiftActions:this.altActions;null!=c.action?q[k]=c.action:delete q[k]}else null!=c.action?(q=mxUtils.bind(this,function(){var x=this.actions.get(c.action);null!=x&&x.isEnabled()&&x.funct.apply(this,arguments)}),c.control?c.shift?this.keyHandler.bindControlShiftKey(k,q):this.keyHandler.bindControlKey(k,q):c.shift?this.keyHandler.bindShiftKey(k,q):this.keyHandler.bindKey(k,q)):delete (c.control?c.shift?this.keyHandler.controlShiftKeys:this.keyHandler.controlKeys:c.shift?this.keyHandler.shiftKeys:this.keyHandler.normalKeys)[k];null!=c.action&&-(q=this.actions.get(c.action),f=f?c.keyCode.toUpperCase():48<=k&&57>=k||65<=k&&90>=k?String.fromCharCode(k):EditorUi.keyNames[k],null!=q&&null!=f&&(q.shortcut=(c.control?Editor.ctrlKey+"+":"")+(c.alt?Editor.altKey+"+":"")+(c.shift?Editor.shiftKey+"+":"")+f))}};EditorUi.prototype.installMessageHandler=function(c){var f=null,k=!1,q=!1,x=null,B=null;this.installPassThroughKeys();var E=mxUtils.bind(this,function(V,K){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,+(q=this.actions.get(c.action),f=f?c.keyCode.toUpperCase():48<=k&&57>=k||65<=k&&90>=k?String.fromCharCode(k):EditorUi.keyNames[k],null!=q&&null!=f&&(q.shortcut=(c.control?Editor.ctrlKey+"+":"")+(c.alt?Editor.altKey+"+":"")+(c.shift?Editor.shiftKey+"+":"")+f))}};EditorUi.prototype.installMessageHandler=function(c){var f=null,k=!1,q=!1,x=null,C=null;this.installPassThroughKeys();var E=mxUtils.bind(this,function(V,K){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,E);mxEvent.addListener(window,"message",mxUtils.bind(this,function(V){if(V.source==(this.embedMessageSource||window.opener||window.parent)){var K=V.data,fa=null,aa=null,da=mxUtils.bind(this,function(ya){if(null!=ya&&"function"===typeof ya.charAt&&"<"!=ya.charAt(0))try{Editor.isPngDataUrl(ya)?ya=Editor.extractGraphModelFromPng(ya):"data:image/svg+xml;base64,"==ya.substring(0,26)?ya=atob(ya.substring(26)):"data:image/svg+xml;utf8,"==ya.substring(0,24)&&(ya=ya.substring(24)),null!=ya&&(""==ya.trim()?ya=null:"%"==ya.charAt(0)?ya=decodeURIComponent(ya):"<"!=ya.charAt(0)&&(ya=Graph.decompress(ya)))}catch(Ra){}return ya});if("json"==urlParams.proto){var ba=!1;try{K=JSON.parse(K),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[V],"data",[K])}catch(ya){K=null}try{var ha=K;if(null==K)return;if("dialog"==K.action){this.showError(null!=K.titleKey?mxResources.get(K.titleKey):K.title,null!=K.messageKey?mxResources.get(K.messageKey):mxUtils.htmlEntities(K.message),null!=K.buttonKey?mxResources.get(K.buttonKey):K.button);null!=K.modified&&(this.editor.modified=K.modified);return}if("layout"==K.action){this.executeLayoutSpec(K.layouts);return}if("prompt"==K.action){this.spinner.stop();var qa=new FilenameDialog(this,K.defaultValue||"",null!=K.okKey?mxResources.get(K.okKey):K.ok,function(ya){null!=ya?L.postMessage(JSON.stringify({event:"prompt",value:ya,message:K}),"*"):L.postMessage(JSON.stringify({event:"prompt-cancel",@@ -4533,13 +4536,13 @@ this.clearStatus())}),null,null,null,null,null,null,null,l?mxUtils.bind(this,funnull,null,ya,function(){ya({},0)})}):null,1==K.withoutType,null,K.templatesOnly);this.showDialog(qa.container,620,460,!0,!1,mxUtils.bind(this,function(ya){null!=this.sidebar&&this.sidebar.hideTooltip();ya&&!K.noExitOnCancel&&this.actions.get("exit").funct()}));qa.init();return}if("textContent"==K.action){var J=this.getDiagramTextContent();L.postMessage(JSON.stringify({event:"textContent",data:J,message:K}),"*");return}if("status"==K.action){this.updateStatus(mxUtils.bind(this,function(){null!=K.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(K.messageKey))):null!=K.message&&this.editor.setStatus(mxUtils.htmlEntities(K.message))}));null!=K.modified&&(this.editor.modified=K.modified);return}if("spinner"==K.action){var R=null!=K.messageKey?mxResources.get(K.messageKey):K.message;null==K.show||K.show?this.spinner.spin(document.body,R):this.spinner.stop();return}if("exit"==K.action){this.actions.get("exit").funct();return}if("viewport"==K.action){if(null!=K.viewport){var T=this.editor.graph,Y=T.view.translate.x,Z=T.view.translate.y;this.embedViewport=K.viewport;T.refresh();this.diagramContainer.scrollTop-=(Z-T.view.translate.y)*T.view.scale;this.diagramContainer.scrollLeft-=(Y-T.view.translate.x)*T.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==K.action){var ia=this.actions.get(K.actionName);null!=ia&&ia.funct();return}if("resetEditor"==K.action){T=this.editor.graph;T.isEditing()&&T.stopEditing(!1);this.hideCurrentMenu();T.popupMenuHandler.hideMenu();-T.clearSelection();return}if("fit"==K.action){T=this.editor.graph;var ka=T.maxFitScale;T.maxFitScale=null!=K.maxScale?K.maxScale:1;T.fit(null!=K.border?K.border:16,null,null,null,null,!0);T.maxFitScale=ka;R=this.createLoadMessage("fit");R.message=K;L.postMessage(JSON.stringify(R),"*");return}if("fullscreenChanged"==K.action){var X=null;try{var ja=this.diagramContainer.getAttribute("data-scrollState");null!=ja&&(this.diagramContainer.removeAttribute("data-scrollState"),X=JSON.parse(ja))}catch(ya){}Editor.inlineFullscreen=+T.clearSelection();return}if("fit"==K.action){T=this.editor.graph;var ja=T.maxFitScale;T.maxFitScale=null!=K.maxScale?K.maxScale:1;T.fit(null!=K.border?K.border:16,null,null,null,null,!0);T.maxFitScale=ja;R=this.createLoadMessage("fit");R.message=K;L.postMessage(JSON.stringify(R),"*");return}if("fullscreenChanged"==K.action){var X=null;try{var ka=this.diagramContainer.getAttribute("data-scrollState");null!=ka&&(this.diagramContainer.removeAttribute("data-scrollState"),X=JSON.parse(ka))}catch(ya){}Editor.inlineFullscreen=K.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=X&&this.restoreScrollState(X);return}if("snapshot"==K.action){this.sendEmbeddedSvgExport(!0);return}if("export"==K.action){if("png"==K.format||"xmlpng"==K.format){if(null==K.spin&&null==K.spinKey||this.spinner.spin(document.body,null!=K.spinKey?mxResources.get(K.spinKey):K.spin)){var na=null!=K.xml?K.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);T=this.editor.graph;var la=mxUtils.bind(this,function(ya,Ra){if(K.withSvg)K.withSvg=-!1,this.getEmbeddedSvg(na,this.editor.graph,null,!0,function(lb){la(ya,lb)},null,null,K.embedImages,this.editor.graph.background,K.scale,K.border,K.shadow,"auto",null,K.embedFonts);else{this.editor.graph.setEnabled(!0);this.spinner.stop();var Ya=this.createLoadMessage("export");Ya.format=K.format;Ya.message=ha;Ya.data=ya;Ya.svg=Ra;Ya.xml=na;L.postMessage(JSON.stringify(Ya),"*")}}),va=mxUtils.bind(this,function(ya){null==ya&&(ya=Editor.blankImage);"xmlpng"==K.format&&(ya=Editor.writeGraphModelToPng(ya,+!1,this.getEmbeddedSvg(na,this.editor.graph,null,!0,function(lb){la(ya,lb)},null,null,K.embedImages,this.editor.graph.background,K.scale,K.border,K.shadow,"auto",null,K.embedFonts);else{this.editor.graph.setEnabled(!0);this.spinner.stop();var Ya=this.createLoadMessage("export");Ya.format=K.format;Ya.message=ha;Ya.data=ya;Ya.svg=Ra;Ya.xml=na;L.postMessage(JSON.stringify(Ya),"*")}}),ua=mxUtils.bind(this,function(ya){null==ya&&(ya=Editor.blankImage);"xmlpng"==K.format&&(ya=Editor.writeGraphModelToPng(ya,"tEXt","mxfile",encodeURIComponent(na)));T!=this.editor.graph&&T.container.parentNode.removeChild(T.container);la(ya)}),za=K.pageId||(null!=this.pages?K.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var sa=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=za){var ya=T.getGlobalVariable;T=this.createTemporaryGraph(T.getStylesheet());for(var Ra,Ya=0;Ya<this.pages.length;Ya++)if(this.pages[Ya].getId()==za){Ra=this.updatePageRoot(this.pages[Ya]);break}null==Ra&&(Ra=this.currentPage);T.getGlobalVariable=function(jb){return"page"==jb?Ra.getName():"pagenumber"==jb?1:ya.apply(this,arguments)};document.body.appendChild(T.container);T.model.setRoot(Ra.root)}if(null!=K.layerIds){var lb=T.model,ub=lb.getChildCells(lb.getRoot()),gb={};for(Ya=0;Ya<K.layerIds.length;Ya++)gb[K.layerIds[Ya]]=!0;for(Ya=0;Ya<ub.length;Ya++)lb.setVisible(ub[Ya],gb[ub[Ya].id]||!1)}Ya=null;K.keepTheme&&(Ya=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,-function(jb){va(jb.toDataURL("image/png"))}),K.width,null,K.background,mxUtils.bind(this,function(){va(null)}),null,null,K.scale,K.transparent,K.shadow,null,T,K.border,null,K.grid,Ya,K.size)});null!=K.xml&&0<K.xml.length&&(k=!0,this.setFileData(na),k=!1);sa()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==K.format?"1":"0")+(null!=za?"&pageId="+za:"")+(null!=K.layerIds&&0<K.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:K.layerIds})):"")+(null!=K.scale?"&scale="+-K.scale:"")+"&base64=1&xml="+encodeURIComponent(na))).send(mxUtils.bind(this,function(ya){200<=ya.getStatus()&&299>=ya.getStatus()?la("data:image/png;base64,"+ya.getText()):va(null)}),mxUtils.bind(this,function(){va(null)}))}}else if(sa=mxUtils.bind(this,function(){var ya=this.createLoadMessage("export");ya.message=K;if("html2"==K.format||"html"==K.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var Ra=this.getXmlFileData();ya.xml=mxUtils.getXml(Ra);ya.data=this.getFileData(null,+function(jb){ua(jb.toDataURL("image/png"))}),K.width,null,K.background,mxUtils.bind(this,function(){ua(null)}),null,null,K.scale,K.transparent,K.shadow,null,T,K.border,null,K.grid,Ya,K.size)});null!=K.xml&&0<K.xml.length&&(k=!0,this.setFileData(na),k=!1);sa()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==K.format?"1":"0")+(null!=za?"&pageId="+za:"")+(null!=K.layerIds&&0<K.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:K.layerIds})):"")+(null!=K.scale?"&scale="++K.scale:"")+"&base64=1&xml="+encodeURIComponent(na))).send(mxUtils.bind(this,function(ya){200<=ya.getStatus()&&299>=ya.getStatus()?la("data:image/png;base64,"+ya.getText()):ua(null)}),mxUtils.bind(this,function(){ua(null)}))}}else if(sa=mxUtils.bind(this,function(){var ya=this.createLoadMessage("export");ya.message=K;if("html2"==K.format||"html"==K.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var Ra=this.getXmlFileData();ya.xml=mxUtils.getXml(Ra);ya.data=this.getFileData(null,null,!0,null,null,null,Ra);ya.format=K.format}else if("html"==K.format)Ra=this.editor.getGraphXml(),ya.data=this.getHtml(Ra,this.editor.graph),ya.xml=mxUtils.getXml(Ra),ya.format=K.format;else{if("xml"==K.format)ya.xml=this.getFileData(!0),ya.format=K.format,L.postMessage(JSON.stringify(ya),"*");else if("json"==K.format)ya.format=K.format,ya.data=this.createJsonForExport(0!=K.allPages,1==K.includeData,1==K.compressed,1==K.selection),L.postMessage(JSON.stringify(ya),"*");else{mxSvgCanvas2D.prototype.foAltText=null;Ra=null!=K.background?K.background:this.editor.graph.background;Ra==mxConstants.NONE&&(Ra=null);ya.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);ya.format="svg";var Ya=mxUtils.bind(this,function(gb){this.editor.graph.setEnabled(!0);this.spinner.stop();ya.data=K.asText?gb:Editor.createSvgDataUri(gb);L.postMessage(JSON.stringify(ya),"*")}),lb="auto";K.keepTheme&&(lb=Editor.isDarkMode()?"dark":"light");null!=K.theme&&(lb=K.theme);if("xmlsvg"==K.format){if(null==K.spin&&null==K.spinKey||this.spinner.spin(document.body,null!=K.spinKey?mxResources.get(K.spinKey):K.spin)){lb=null;if(this.isAutoDarkMode()||Editor.isDarkMode())lb="auto";null!=K.theme&&(lb=K.theme);this.getEmbeddedSvg(ya.xml,this.editor.graph,null,!0,Ya,null,null,K.embedImages,Ra,K.scale,K.border,K.shadow,lb,K.embedCellMetadata,K.embedFonts)}}else if(null==K.spin&&null==K.spinKey||this.spinner.spin(document.body,null!=K.spinKey?mxResources.get(K.spinKey):K.spin)){this.editor.graph.setEnabled(!1);var ub=K.embedCellMetadata?@@ -4554,12 +4557,12 @@ Math.max(this.minInlineWidth,Ba):Ba,ya.width-80);ya=Math.min(null!=this.minInlinYa}Ra.maxFitScale=ya;Ra.container.scrollTop-=La;Ra.container.scrollLeft-=La;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[K]));Ra.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=Ra.container.style.top);var lb=Ra.getGraphBounds();Ra.container.clientWidth>lb.width+2*La&&(Ra.container.scrollLeft=lb.x+(lb.width+La-Ra.container.clientWidth)/2)}),10)})}null!=K.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=K.noExitBtn);null!=K.title&&null!=this.buttonContainer&&this.setEmbedTitle(K.title);try{K.libs&&this.sidebar.showEntries(K.libs)}catch(ya){}if(null!=K.xmlpng)K=this.extractGraphModelFromPng(K.xmlpng);else if(null!=K.descriptor){if(K=K.descriptor,"mermaid"==K.format){if(EditorUi.isMermaidSupported()){var ab=mxUtils.bind(this,function(ya){c(ya,V,null,ba);ya=this.createLoadMessage("load");ya.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);ya.message=ha;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(ya),"*");if(null!=Ca&&null!=Ca.key&&null!=Ca.value){ya=this.editor.graph;var Ra=ya.getModel().getRoot();if(null!=Ra){ya.getModel().beginUpdate();try{ya.setAttributeForCell(Ra,Ca.key,Ca.value)}finally{ya.getModel().endUpdate()}}}}),Qa=mxUtils.bind(this,function(ya){this.handleError(ya)});K.image?this.parseMermaidImage(K.data,ab,Qa):this.parseMermaidDiagram(K.data,null,-mxUtils.bind(this,function(ya){K.wrap&&(ya=mxMermaidToDrawio.wrapGroup(ya,K.data,null,{normalize:!0}));ab(ya)}),Qa)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else K=K.xml}else{if("merge"==K.action){var db=this.getCurrentFile();null!=db&&(ra=da(K.xml),null!=ra&&""!=ra&&db.mergeFile(new LocalFile(this,ra),mxUtils.bind(this,function(){this.embedDiffSync&&(B=this.clonePages(this.pages),x=nb());L.postMessage(JSON.stringify({event:"merge",-message:K}),"*")}),function(ya){L.postMessage(JSON.stringify({event:"merge",message:K,error:ya}),"*")}))}else if("patch"==K.action){if(db=this.getCurrentFile(),null!=db&&null!=K.patch)try{k=!0,db.patch([K.patch]),this.embedDiffSync&&null!=B&&(B=this.applyPatches(B,[K.patch])),x=nb(),k=!1,ja={event:"patch",message:K},X=this.getHashValueForPages(this.pages),ja.checksum=X,null!=K.checksum&&K.checksum!=X&&(ja.checksumMismatch=!0),L.postMessage(JSON.stringify(ja),"*")}catch(ya){k=!1,L.postMessage(JSON.stringify({event:"patch",-message:K,error:ya.message||ya.toString()}),"*")}}else if("getDiff"==K.action){R={event:"getDiff",message:K};if(this.embedDiffSync&&null!=B){var Va=this.clonePages(this.pages);R.patch=this.diffPages(B,Va);R.checksum=this.getHashValueForPages(Va)}else R.xml=nb();L.postMessage(JSON.stringify(R),"*")}else"resetDiff"==K.action?this.embedDiffSync&&(null!=K.xml?(ra=da(K.xml),db=this.getCurrentFile(),null!=ra&&""!=ra&&null!=db&&db.mergeFile(new LocalFile(this,ra),mxUtils.bind(this,function(){B=this.clonePages(this.pages);-x=nb();L.postMessage(JSON.stringify({event:"resetDiff",message:K,checksum:this.getHashValueForPages(this.pages)}),"*")}),function(ya){L.postMessage(JSON.stringify({event:"resetDiff",message:K,error:ya}),"*")})):(B=this.clonePages(this.pages),x=nb(),L.postMessage(JSON.stringify({event:"resetDiff",message:K,checksum:this.getHashValueForPages(this.pages)}),"*"))):"remoteInvokeReady"==K.action?this.handleRemoteInvokeReady(L):"remoteInvoke"==K.action?this.handleRemoteInvoke(K,V.origin):"remoteInvokeResponse"==+mxUtils.bind(this,function(ya){K.wrap&&(ya=mxMermaidToDrawio.wrapGroup(ya,K.data,null,{normalize:!0}));ab(ya)}),Qa)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else K=K.xml}else{if("merge"==K.action){var db=this.getCurrentFile();null!=db&&(ra=da(K.xml),null!=ra&&""!=ra&&db.mergeFile(new LocalFile(this,ra),mxUtils.bind(this,function(){this.embedDiffSync&&(C=this.clonePages(this.pages),x=nb());L.postMessage(JSON.stringify({event:"merge",+message:K}),"*")}),function(ya){L.postMessage(JSON.stringify({event:"merge",message:K,error:ya}),"*")}))}else if("patch"==K.action){if(db=this.getCurrentFile(),null!=db&&null!=K.patch)try{k=!0,db.patch([K.patch]),this.embedDiffSync&&null!=C&&(C=this.applyPatches(C,[K.patch])),x=nb(),k=!1,ka={event:"patch",message:K},X=this.getHashValueForPages(this.pages),ka.checksum=X,null!=K.checksum&&K.checksum!=X&&(ka.checksumMismatch=!0),L.postMessage(JSON.stringify(ka),"*")}catch(ya){k=!1,L.postMessage(JSON.stringify({event:"patch",+message:K,error:ya.message||ya.toString()}),"*")}}else if("getDiff"==K.action){R={event:"getDiff",message:K};if(this.embedDiffSync&&null!=C){var Va=this.clonePages(this.pages);R.patch=this.diffPages(C,Va);R.checksum=this.getHashValueForPages(Va)}else R.xml=nb();L.postMessage(JSON.stringify(R),"*")}else"resetDiff"==K.action?this.embedDiffSync&&(null!=K.xml?(ra=da(K.xml),db=this.getCurrentFile(),null!=ra&&""!=ra&&null!=db&&db.mergeFile(new LocalFile(this,ra),mxUtils.bind(this,function(){C=this.clonePages(this.pages);+x=nb();L.postMessage(JSON.stringify({event:"resetDiff",message:K,checksum:this.getHashValueForPages(this.pages)}),"*")}),function(ya){L.postMessage(JSON.stringify({event:"resetDiff",message:K,error:ya}),"*")})):(C=this.clonePages(this.pages),x=nb(),L.postMessage(JSON.stringify({event:"resetDiff",message:K,checksum:this.getHashValueForPages(this.pages)}),"*"))):"remoteInvokeReady"==K.action?this.handleRemoteInvokeReady(L):"remoteInvoke"==K.action?this.handleRemoteInvoke(K,V.origin):"remoteInvokeResponse"==K.action?this.handleRemoteInvokeResponse(K):L.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(K)}),"*");return}}catch(ya){this.handleError(ya)}}var nb=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),bb=mxUtils.bind(this,function(ya,Ra){k=!0;try{c(ya,Ra,null,ba)}catch(Ya){this.handleError(Ya)}k=!1;this.editor.graph.model.prefix=Editor.guid()+"-";Ra=mxUtils.bind(this,-function(){null!=urlParams.modified&&this.clearStatus();x=nb();this.embedDiffSync&&(B=this.clonePages(this.pages));q&&null==f&&(f=mxUtils.bind(this,function(lb,ub){lb=nb();if(lb!=x&&!k){ub=this.createLoadMessage("autosave");ub.message=ha;if(this.embedDiffSync&&null!=B){var gb=this.clonePages(this.pages),jb=this.diffPages(B,gb);mxUtils.isEmptyObject(jb)?ub.xml=lb:(ub.patch=jb,ub.checksum=this.getHashValueForPages(gb),this.embedDiffSyncPatchOnly||(ub.xml=lb));B=gb}else ub.xml=lb;(this.embedMessageSource||+function(){null!=urlParams.modified&&this.clearStatus();x=nb();this.embedDiffSync&&(C=this.clonePages(this.pages));q&&null==f&&(f=mxUtils.bind(this,function(lb,ub){lb=nb();if(lb!=x&&!k){ub=this.createLoadMessage("autosave");ub.message=ha;if(this.embedDiffSync&&null!=C){var gb=this.clonePages(this.pages),jb=this.diffPages(C,gb);mxUtils.isEmptyObject(jb)?ub.xml=lb:(ub.patch=jb,ub.checksum=this.getHashValueForPages(gb),this.embedDiffSyncPatchOnly||(ub.xml=lb));C=gb}else ub.xml=lb;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(ub),"*")}x=lb}),this.editor.graph.model.addListener(mxEvent.CHANGE,f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",f),this.addListener("backgroundImageChanged",f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",f),this.addListener("guidesEnabledChanged",f),this.addListener("pageViewChanged",f));null!=fa&&fa();if("1"==urlParams.returnbounds||"json"==urlParams.proto){var Ya=this.createLoadMessage("load");Ya.xml=null!=aa?nb():ya;this.embedDiffSync&&null!=this.pages&&(Ya.checksum=this.getHashValueForPages(this.pages));L.postMessage(JSON.stringify(Ya),"*")}});null!=aa?this.executeLayoutSpec(aa,Ra):Ra()});null!=K&&"function"===typeof K.substring&&"data:application/vnd.visio;base64,"==K.substring(0,34)?(da="0M8R4KGxGuE"==K.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(K.substring(K.indexOf(",")+1)),function(ya){bb(ya,V)},mxUtils.bind(this,function(ya){this.handleError(ya)}),da)):null!=K&&"function"===typeof K.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(K,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(K,mxUtils.bind(this,function(ya){4==ya.readyState&&(200<=ya.status&&299>=ya.status&&"<mxGraphModel"==ya.responseText.substring(0,@@ -4570,38 +4573,38 @@ mxUtils.write(x,c);q&&x.classList.add("gePrimaryBtn");mxEvent.addListener(x,"clifunction(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};-EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(k){if(0<k.length)try{var q=JSON.parse(k),x=this.getSelectedLayoutContainer();null!=x&&Array.isArray(q)&&0<q.length?this.setContainerChildLayout(x,q):this.executeLayouts(this.editor.graph.createLayouts(q));this.lastLayoutSpec=this.customLayoutConfig=q;this.hideDialog()}catch(B){this.handleError(B)}}),null,null,-null,null,mxUtils.bind(this,function(k,q){var x=this.createLayoutAddSelect(q);k.appendChild(x);x=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var B=q.value;q.value=JSON.stringify(JSON.parse(B));q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));q.value=B}catch(E){this.handleError(E)}}));x.setAttribute("title","copy");x.className=-"geBtn";k.appendChild(x)}),!0,null,null,EditorUi.APPLY_LAYOUTS_SPEC_URL);this.showDialog(f.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));f.init()}))};EditorUi.APPLY_LAYOUTS_SPEC_URL="https://www.drawio.com/docs/reference/json-layout-specification/";EditorUi.prototype.scopeLayoutsToCells=function(c,f){for(var k={},q=0;q<f.length;q++)null!=f[q]&&(k[f[q].id]=!0);var x=function(B){return null!=B&&!0===k[B.id]};for(q=0;q<c.length;q++)f=c[q],"undefined"!==typeof ElkLayout&&f instanceof-ElkLayout||void 0!==f.cellFilter?f.cellFilter=x:"function"===typeof f.isVertexIgnored&&function(B){var E=B.isVertexIgnored;B.isVertexIgnored=function(L){return E.apply(this,arguments)||!x(L)}}(f)};EditorUi.prototype.createLayoutAddSelect=function(c){var f=this,k=document.createElement("select");k.className="geBtn";k.style.marginRight="8px";k.style.maxWidth="180px";var q=document.createElement("option");q.value="";mxUtils.write(q,mxResources.get("add")+"...");q.disabled=!0;q.selected=!0;k.appendChild(q);+EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(k){if(0<k.length)try{var q=JSON.parse(k),x=this.getSelectedLayoutContainer();null!=x&&Array.isArray(q)&&0<q.length?this.setContainerChildLayout(x,q):this.executeLayouts(this.editor.graph.createLayouts(q));this.lastLayoutSpec=this.customLayoutConfig=q;this.hideDialog()}catch(C){this.handleError(C)}}),null,null,+null,null,mxUtils.bind(this,function(k,q){var x=this.createLayoutAddSelect(q);k.appendChild(x);x=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var C=q.value;q.value=JSON.stringify(JSON.parse(C));q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));q.value=C}catch(E){this.handleError(E)}}));x.setAttribute("title","copy");x.className=+"geBtn";k.appendChild(x)}),!0,null,null,EditorUi.APPLY_LAYOUTS_SPEC_URL);this.showDialog(f.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));f.init()}))};EditorUi.APPLY_LAYOUTS_SPEC_URL="https://www.drawio.com/docs/reference/json-layout-specification/";EditorUi.prototype.scopeLayoutsToCells=function(c,f){for(var k={},q=0;q<f.length;q++)null!=f[q]&&(k[f[q].id]=!0);var x=function(C){return null!=C&&!0===k[C.id]};for(q=0;q<c.length;q++)f=c[q],"undefined"!==typeof ElkLayout&&f instanceof+ElkLayout||void 0!==f.cellFilter?f.cellFilter=x:"function"===typeof f.isVertexIgnored&&function(C){var E=C.isVertexIgnored;C.isVertexIgnored=function(L){return E.apply(this,arguments)||!x(L)}}(f)};EditorUi.prototype.createLayoutAddSelect=function(c){var f=this,k=document.createElement("select");k.className="geBtn";k.style.marginRight="8px";k.style.maxWidth="180px";var q=document.createElement("option");q.value="";mxUtils.write(q,mxResources.get("add")+"...");q.disabled=!0;q.selected=!0;k.appendChild(q);var x=[];"undefined"!==typeof ElkLayout&&(q=function(E,L){var Q=ElkLayout.MENU_PRESETS[E];return{label:E,kind:"elk",algo:Q.algorithm,preset:Q.options,layoutName:L}},x.push(q("verticalFlow","elkLayered")),x.push(q("horizontalFlow","elkLayered")),x.push(q("verticalTree","elkTree")),x.push(q("horizontalTree","elkTree")),x.push(q("radialTree","elkRadial")),x.push(q("organic","elkOrganic")));x.push({label:"orgChart",kind:"orgchart"});x.push({label:"circle",kind:"simple",layoutName:"mxCircleLayout",config:{}});-x.push({label:"parallels",kind:"simple",layoutName:"mxParallelEdgeLayout",config:{spacing:20,checkOverlap:!0}});"undefined"!==typeof LibavoidRouting&&x.push({label:"orthogonalRouting",kind:"simple",layoutName:LibavoidRouting.LAYOUT_NAME,config:{}});for(q=0;q<x.length;q++){var B=document.createElement("option");B.value=String(q);mxUtils.write(B,mxResources.get(x[q].label)+("elk"===x[q].kind||"orgchart"===x[q].kind?"...":""));k.appendChild(B)}mxEvent.addListener(k,"change",mxUtils.bind(this,function(){var E=+x.push({label:"parallels",kind:"simple",layoutName:"mxParallelEdgeLayout",config:{spacing:20,checkOverlap:!0}});"undefined"!==typeof LibavoidRouting&&x.push({label:"orthogonalRouting",kind:"simple",layoutName:LibavoidRouting.LAYOUT_NAME,config:{}});for(q=0;q<x.length;q++){var C=document.createElement("option");C.value=String(q);mxUtils.write(C,mxResources.get(x[q].label)+("elk"===x[q].kind||"orgchart"===x[q].kind?"...":""));k.appendChild(C)}mxEvent.addListener(k,"change",mxUtils.bind(this,function(){var E=parseInt(k.value);k.selectedIndex=0;if(!(isNaN(E)||0>E||E>=x.length)){var L=x[E],Q=c.value;if(0===mxUtils.trim(Q).length)var V=[];else{try{V=JSON.parse(Q)}catch(fa){f.handleError(fa);return}if(!Array.isArray(V)){f.handleError(Error(mxResources.get("error")+": expected JSON array"));return}}var K=mxUtils.bind(this,function(fa){V.push(fa);f.hideDialog();f.showCustomLayoutDialog(JSON.stringify(V,null,2))});E=mxUtils.bind(this,function(){f.hideDialog();f.showCustomLayoutDialog(Q)});"elk"===L.kind?(f.hideDialog(),-ElkLayout.runWithDialog(f,L.algo,L.preset,mxResources.get(L.label),function(fa,aa){fa=Graph.elkOptionsToConfig(fa,aa);K({layout:L.layoutName,config:fa})},E)):"orgchart"===L.kind?(f.hideDialog(),f.showOrgChartConfigDialog(K,E)):K({layout:L.layoutName,config:L.config||{}})}}));return k};EditorUi.prototype.showOrgChartConfigDialog=function(c,f){var k=2,q=20,x=20,B=document.createElement("div"),E=function(da,ba){var ha=document.createElement("div");ha.style.marginTop="6px";ha.style.display="inline-block";-ha.style.width="180px";mxUtils.write(ha,mxResources.get(da)+": ");B.appendChild(ha);B.appendChild(ba)},L=document.createElement("select");L.style.width="160px";L.style.boxSizing="border-box";for(var Q=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],V=0;V<Q.length;V++){var K=document.createElement("option");mxUtils.write(K,+ElkLayout.runWithDialog(f,L.algo,L.preset,mxResources.get(L.label),function(fa,aa){fa=Graph.elkOptionsToConfig(fa,aa);K({layout:L.layoutName,config:fa})},E)):"orgchart"===L.kind?(f.hideDialog(),f.showOrgChartConfigDialog(K,E)):K({layout:L.layoutName,config:L.config||{}})}}));return k};EditorUi.prototype.showOrgChartConfigDialog=function(c,f){var k=2,q=20,x=20,C=document.createElement("div"),E=function(da,ba){var ha=document.createElement("div");ha.style.marginTop="6px";ha.style.display="inline-block";+ha.style.width="180px";mxUtils.write(ha,mxResources.get(da)+": ");C.appendChild(ha);C.appendChild(ba)},L=document.createElement("select");L.style.width="160px";L.style.boxSizing="border-box";for(var Q=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],V=0;V<Q.length;V++){var K=document.createElement("option");mxUtils.write(K,Q[V]);K.value=V;2===V&&K.setAttribute("selected","selected");L.appendChild(K)}mxEvent.addListener(L,"change",function(){k=parseInt(L.value)});E("orgChartType",L);var fa=document.createElement("input");fa.type="number";fa.value=q;fa.style.width="160px";fa.style.boxSizing="border-box";mxEvent.addListener(fa,"change",function(){q=parseInt(fa.value)});E("parentChildSpacing",fa);var aa=document.createElement("input");aa.type="number";aa.value=x;aa.style.width="160px";aa.style.boxSizing="border-box";mxEvent.addListener(aa,-"change",function(){x=parseInt(aa.value)});E("siblingSpacing",aa);f=new CustomDialog(this,B,function(){c({layout:"mxOrgChartLayout",config:{branchOptimizer:k,parentChildSpacing:q,siblingSpacing:x}})},f||null,mxResources.get("apply"),"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");this.showDialog(f.container,355,null,!0,!0)};EditorUi.prototype.loadOrgChartLayouts=function(c,f){this.createTimeout(null,mxUtils.bind(this,function(k){var q=mxUtils.bind(this,function(){this.loadingOrgChart=-!1;k.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),x=mxUtils.bind(this,function(B){this.loadingOrgChart=!1;k.clear()&&this.handleError(B)});if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))q();else if(f||this.spinner.spin(document.body,mxResources.get("loading")))this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",-function(){mxscript("js/orgchart/mxOrgChartLayout.js",q,null,null,null,x)},null,null,null,x)},null,null,null,x)},null,null,null,x):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",q,null,null,null,x)}),onerror)};EditorUi.prototype.importCsv=function(c,f,k,q){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,k)}),q)};EditorUi.prototype.doImportCsv=function(c,f,k){try{var q=c.split("\n"),x=[],B=[],E=[],L={};if(0<q.length){var Q={};k=null!=k?k:this.editor.graph;var V=null,-K=null,fa=null,aa=null,da=null,ba=null,ha=null,qa="whiteSpace=wrap;html=1;",ra=null,l=null,t="",H="auto",J="auto",R=!1,T=null,Y=null,Z=40,ia=40,ka=100,X=0,ja=mxUtils.bind(this,function(){null!=f?f(Ya):(k.setSelectionCells(Ya),k.scrollCellToVisible(k.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),na=k.getFreeInsertPoint(!0),la=na.x,va=na.y;na=va;var za=null,sa="auto";l=null;for(var wa=[],Ca=null,Fa=null,Ha=0;Ha<q.length&&+"change",function(){x=parseInt(aa.value)});E("siblingSpacing",aa);f=new CustomDialog(this,C,function(){c({layout:"mxOrgChartLayout",config:{branchOptimizer:k,parentChildSpacing:q,siblingSpacing:x}})},f||null,mxResources.get("apply"),"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");this.showDialog(f.container,355,null,!0,!0)};EditorUi.prototype.loadOrgChartLayouts=function(c,f){this.createTimeout(null,mxUtils.bind(this,function(k){var q=mxUtils.bind(this,function(){this.loadingOrgChart=+!1;k.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),x=mxUtils.bind(this,function(C){this.loadingOrgChart=!1;k.clear()&&this.handleError(C)});if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))q();else if(f||this.spinner.spin(document.body,mxResources.get("loading")))this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",+function(){mxscript("js/orgchart/mxOrgChartLayout.js",q,null,null,null,x)},null,null,null,x)},null,null,null,x)},null,null,null,x):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",q,null,null,null,x)}),onerror)};EditorUi.prototype.importCsv=function(c,f,k,q){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,k)}),q)};EditorUi.prototype.doImportCsv=function(c,f,k){try{var q=c.split("\n"),x=[],C=[],E=[],L={};if(0<q.length){var Q={};k=null!=k?k:this.editor.graph;var V=null,+K=null,fa=null,aa=null,da=null,ba=null,ha=null,qa="whiteSpace=wrap;html=1;",ra=null,l=null,t="",H="auto",J="auto",R=!1,T=null,Y=null,Z=40,ia=40,ja=100,X=0,ka=mxUtils.bind(this,function(){null!=f?f(Ya):(k.setSelectionCells(Ya),k.scrollCellToVisible(k.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),na=k.getFreeInsertPoint(!0),la=na.x,ua=na.y;na=ua;var za=null,sa="auto";l=null;for(var wa=[],Ca=null,Fa=null,Ha=0;Ha<q.length&&"#"==q[Ha].charAt(0);){c=q[Ha].replace(/\r$/,"");for(Ha++;Ha<q.length&&"\\"==c.charAt(c.length-1)&&"#"==q[Ha].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(q[Ha].substring(1)),Ha++;if("#"!=c.charAt(1)){var Na=c.indexOf(":");if(0<Na){var La=mxUtils.trim(c.substring(1,Na)),Da=mxUtils.trim(c.substring(Na+1));"label"==La?za=Graph.sanitizeHtml(Da):"labelname"==La&&0<Da.length&&"-"!=Da?da=Da:"labels"==La&&0<Da.length&&"-"!=Da?ha=JSON.parse(Da):"style"==La?K=Da:"parentstyle"==La?qa=Da:"unknownStyle"==La&&"-"!=Da?ba=Da:"stylename"==La&&0<Da.length&&"-"!=Da?aa=Da:"styles"==La&&0<Da.length&&"-"!=Da?fa=JSON.parse(Da):"vars"==La&&0<Da.length&&"-"!=Da?V=JSON.parse(Da):"identity"==La&&0<Da.length&&"-"!=Da?ra=Da:"parent"==La&&0<Da.length&&"-"!=Da?l=Da:"namespace"==La&&0<Da.length&&"-"!=Da?t=Da:"width"==La?H=Da:"height"==La?J=Da:"collapsed"==La&&"-"!=Da?R="true"==Da:"left"==La&&0<Da.length?T=Da:"top"==La&&0<Da.length?Y=Da:"ignore"==La?Fa=Da.split(","):"connect"==La?wa.push(JSON.parse(Da)):"link"==La?Ca=-Da:"padding"==La?X=parseFloat(Da):"edgespacing"==La?Z=parseFloat(Da):"nodespacing"==La?ia=parseFloat(Da):"levelspacing"==La?ka=parseFloat(Da):"layout"==La&&(sa=Da)}}}if(null==q[Ha])throw Error(mxResources.get("invalidOrMissingFile"));var Sa=this.editor.csvToArray(q[Ha].replace(/\r$/,""));Na=c=null;La=[];for(Da=0;Da<Sa.length;Da++)ra==Sa[Da]&&(c=Da),l==Sa[Da]&&(Na=Da),La.push(mxUtils.trim(Sa[Da]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==za&&(za="%"+La[0]+"%");if(null!=+Da:"padding"==La?X=parseFloat(Da):"edgespacing"==La?Z=parseFloat(Da):"nodespacing"==La?ia=parseFloat(Da):"levelspacing"==La?ja=parseFloat(Da):"layout"==La&&(sa=Da)}}}if(null==q[Ha])throw Error(mxResources.get("invalidOrMissingFile"));var Sa=this.editor.csvToArray(q[Ha].replace(/\r$/,""));Na=c=null;La=[];for(Da=0;Da<Sa.length;Da++)ra==Sa[Da]&&(c=Da),l==Sa[Da]&&(Na=Da),La.push(mxUtils.trim(Sa[Da]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==za&&(za="%"+La[0]+"%");if(null!=wa)for(var Oa=0;Oa<wa.length;Oa++)null==Q[wa[Oa].to]&&(Q[wa[Oa].to]={});ra=[];for(Da=Ha+1;Da<q.length;Da++){var Ta=this.editor.csvToArray(q[Da].replace(/\r$/,""));if(null==Ta){var Ua=40<q[Da].length?q[Da].substring(0,40)+"...":q[Da];throw Error(Ua+" ("+Da+"):\n"+mxResources.get("containsValidationErrors"));}0<Ta.length&&ra.push(Ta)}k.model.beginUpdate();try{for(Da=0;Da<ra.length;Da++){Ta=ra[Da];var Ba=null,Ka=null!=c?t+Ta[c]:null;q=!1;null!=Ka&&(Ba=k.model.getCell(Ka),q=null==Ba||0<=mxUtils.indexOf(x,Ba));var ab=new mxCell(za,new mxGeometry(la,na,0,0),K||"whiteSpace=wrap;html=1;");ab.collapsed=R;ab.vertex=!0;ab.id=Ka;null==Ba||q||k.model.setCollapsed(Ba,R);for(var Qa=0;Qa<Ta.length;Qa++)k.setAttributeForCell(ab,La[Qa],Ta[Qa]),null==Ba||q||k.setAttributeForCell(Ba,La[Qa],Ta[Qa]);if(null!=da&&null!=ha){var db=ha[ab.getAttribute(da)];null!=db&&(k.labelChanged(ab,db),null==Ba||q||k.cellLabelChanged(Ba,db))}if(null!=aa&&null!=fa){var Va=fa[ab.getAttribute(aa)];null!=Va&&(ab.style=Va)}k.setAttributeForCell(ab,"placeholders","1");ab.style=k.replacePlaceholders(ab,ab.style,V);null==Ba||q?k.fireEvent(new mxEventObject("cellsInserted","cells",[ab])):(k.model.setStyle(Ba,ab.style),0>mxUtils.indexOf(E,Ba)&&E.push(Ba),k.fireEvent(new mxEventObject("cellsInserted","cells",[Ba])));q=null!=Ba;Ba=ab;if(!q)for(Oa=0;Oa<wa.length;Oa++)Q[wa[Oa].to][Ba.getAttribute(wa[Oa].to)]=Ba;null!=Ca&&"link"!=Ca&&(k.setLinkForCell(Ba,Ba.getAttribute(Ca)),k.setAttributeForCell(Ba,Ca,null));var nb=k.getPreferredSizeForCell(Ba);l=null!=-Na?k.model.getCell(t+Ta[Na]):null;if(Ba.vertex){Ua=null!=l?0:la;Ha=null!=l?0:va;null!=T&&null!=Ba.getAttribute(T)&&(Ba.geometry.x=Ua+parseFloat(Ba.getAttribute(T)));null!=Y&&null!=Ba.getAttribute(Y)&&(Ba.geometry.y=Ha+parseFloat(Ba.getAttribute(Y)));var bb="@"==H.charAt(0)?Ba.getAttribute(H.substring(1)):null;Ba.geometry.width=null!=bb&&"auto"!=bb?parseFloat(Ba.getAttribute(H.substring(1))):"auto"==H||"auto"==bb?nb.width+X:parseFloat(H);var ya="@"==J.charAt(0)?Ba.getAttribute(J.substring(1)):null;-Ba.geometry.height=null!=ya&&"auto"!=ya&&"width"!=J?parseFloat(ya):"auto"==J||"auto"==ya?nb.height+X:"width"==J?Ba.geometry.width:parseFloat(J);na+=Ba.geometry.height+ia}q?(null==L[Ka]&&(L[Ka]=[]),L[Ka].push(Ba)):(x.push(Ba),null!=l?(l.style=k.replacePlaceholders(l,qa,V),k.addCell(Ba,l),B.push(l)):E.push(k.addCell(Ba)))}for(Da=0;Da<B.length;Da++)bb="@"==H.charAt(0)?B[Da].getAttribute(H.substring(1)):null,ya="@"==J.charAt(0)?B[Da].getAttribute(J.substring(1)):null,"auto"!=H&&"auto"!=bb||"auto"!=J&&-"auto"!=ya||k.updateGroupBounds([B[Da]],X,!0);var Ra=E.slice(),Ya=E.slice();for(Oa=0;Oa<wa.length;Oa++){var lb=wa[Oa];for(Da=0;Da<x.length;Da++){Ba=x[Da];var ub=mxUtils.bind(this,function(Ab,D,M){var N=D.getAttribute(M.from);if(null!=N&&""!=N){N=N.split(",");for(var W=0;W<N.length;W++){var ca=Q[M.to][N[W]];if(null==ca&&null!=ba){ca=new mxCell(N[W],new mxGeometry(la,va,0,0),ba);ca.style=k.replacePlaceholders(D,ca.style,V);var ma=k.getPreferredSizeForCell(ca);ca.geometry.width=ma.width+X;ca.geometry.height=+Na?k.model.getCell(t+Ta[Na]):null;if(Ba.vertex){Ua=null!=l?0:la;Ha=null!=l?0:ua;null!=T&&null!=Ba.getAttribute(T)&&(Ba.geometry.x=Ua+parseFloat(Ba.getAttribute(T)));null!=Y&&null!=Ba.getAttribute(Y)&&(Ba.geometry.y=Ha+parseFloat(Ba.getAttribute(Y)));var bb="@"==H.charAt(0)?Ba.getAttribute(H.substring(1)):null;Ba.geometry.width=null!=bb&&"auto"!=bb?parseFloat(Ba.getAttribute(H.substring(1))):"auto"==H||"auto"==bb?nb.width+X:parseFloat(H);var ya="@"==J.charAt(0)?Ba.getAttribute(J.substring(1)):null;+Ba.geometry.height=null!=ya&&"auto"!=ya&&"width"!=J?parseFloat(ya):"auto"==J||"auto"==ya?nb.height+X:"width"==J?Ba.geometry.width:parseFloat(J);na+=Ba.geometry.height+ia}q?(null==L[Ka]&&(L[Ka]=[]),L[Ka].push(Ba)):(x.push(Ba),null!=l?(l.style=k.replacePlaceholders(l,qa,V),k.addCell(Ba,l),C.push(l)):E.push(k.addCell(Ba)))}for(Da=0;Da<C.length;Da++)bb="@"==H.charAt(0)?C[Da].getAttribute(H.substring(1)):null,ya="@"==J.charAt(0)?C[Da].getAttribute(J.substring(1)):null,"auto"!=H&&"auto"!=bb||"auto"!=J&&+"auto"!=ya||k.updateGroupBounds([C[Da]],X,!0);var Ra=E.slice(),Ya=E.slice();for(Oa=0;Oa<wa.length;Oa++){var lb=wa[Oa];for(Da=0;Da<x.length;Da++){Ba=x[Da];var ub=mxUtils.bind(this,function(Ab,D,M){var N=D.getAttribute(M.from);if(null!=N&&""!=N){N=N.split(",");for(var W=0;W<N.length;W++){var ca=Q[M.to][N[W]];if(null==ca&&null!=ba){ca=new mxCell(N[W],new mxGeometry(la,ua,0,0),ba);ca.style=k.replacePlaceholders(D,ca.style,V);var ma=k.getPreferredSizeForCell(ca);ca.geometry.width=ma.width+X;ca.geometry.height=ma.height+X;Q[M.to][N[W]]=ca;ca.vertex=!0;ca.id=N[W];E.push(k.addCell(ca))}if(null!=ca){ma=M.label;null!=M.fromlabel&&(ma=(D.getAttribute(M.fromlabel)||"")+(ma||""));null!=M.sourcelabel&&(ma=k.replacePlaceholders(D,M.sourcelabel,V)+(ma||""));null!=M.tolabel&&(ma=(ma||"")+(ca.getAttribute(M.tolabel)||""));null!=M.targetlabel&&(ma=(ma||"")+k.replacePlaceholders(ca,M.targetlabel,V));var pa="target"==M.placeholders==!M.invert?ca:Ab;pa=null!=M.style?k.replacePlaceholders(pa,M.style,V):k.createCurrentEdgeStyle();-ma=k.insertEdge(null,null,ma||"",M.invert?ca:Ab,M.invert?Ab:ca,pa);if(null!=M.labels)for(pa=0;pa<M.labels.length;pa++){var ua=M.labels[pa],Aa=new mxCell(ua.label||pa,new mxGeometry(null!=ua.x?ua.x:0,null!=ua.y?ua.y:0,0,0),"resizable=0;html=1;");Aa.vertex=!0;Aa.connectable=!1;Aa.geometry.relative=!0;null!=ua.placeholders&&(Aa.value=k.replacePlaceholders("target"==ua.placeholders==!M.invert?ca:Ab,Aa.value,V));if(null!=ua.dx||null!=ua.dy)Aa.geometry.offset=new mxPoint(null!=ua.dx?ua.dx:0,null!=ua.dy?-ua.dy:0);ma.insert(Aa)}if(null!=M.data)for(var xa in M.data)k.setAttributeForCell(ma,xa,M.data[xa]);Ya.push(ma);mxUtils.remove(M.invert?Ab:ca,Ra)}}}});ub(Ba,Ba,lb);if(null!=L[Ba.id])for(Qa=0;Qa<L[Ba.id].length;Qa++)ub(Ba,L[Ba.id][Qa],lb)}}if(null!=Fa)for(Da=0;Da<x.length;Da++)for(Ba=x[Da],Qa=0;Qa<Fa.length;Qa++)k.setAttributeForCell(Ba,mxUtils.trim(Fa[Qa]),null);if(0<E.length){var gb=new mxParallelEdgeLayout(k);gb.spacing=Z;gb.checkOverlap=!0;var jb=function(){0<gb.spacing&&gb.execute(k.getDefaultParent());+ma=k.insertEdge(null,null,ma||"",M.invert?ca:Ab,M.invert?Ab:ca,pa);if(null!=M.labels)for(pa=0;pa<M.labels.length;pa++){var va=M.labels[pa],Aa=new mxCell(va.label||pa,new mxGeometry(null!=va.x?va.x:0,null!=va.y?va.y:0,0,0),"resizable=0;html=1;");Aa.vertex=!0;Aa.connectable=!1;Aa.geometry.relative=!0;null!=va.placeholders&&(Aa.value=k.replacePlaceholders("target"==va.placeholders==!M.invert?ca:Ab,Aa.value,V));if(null!=va.dx||null!=va.dy)Aa.geometry.offset=new mxPoint(null!=va.dx?va.dx:0,null!=va.dy?+va.dy:0);ma.insert(Aa)}if(null!=M.data)for(var xa in M.data)k.setAttributeForCell(ma,xa,M.data[xa]);Ya.push(ma);mxUtils.remove(M.invert?Ab:ca,Ra)}}}});ub(Ba,Ba,lb);if(null!=L[Ba.id])for(Qa=0;Qa<L[Ba.id].length;Qa++)ub(Ba,L[Ba.id][Qa],lb)}}if(null!=Fa)for(Da=0;Da<x.length;Da++)for(Ba=x[Da],Qa=0;Qa<Fa.length;Qa++)k.setAttributeForCell(Ba,mxUtils.trim(Fa[Qa]),null);if(0<E.length){var gb=new mxParallelEdgeLayout(k);gb.spacing=Z;gb.checkOverlap=!0;var jb=function(){0<gb.spacing&&gb.execute(k.getDefaultParent());var Ab=0,D=0;0<E.length&&(D=k.getCellGeometry(E[0]),Ab=Math.round(k.snap(D.x))-D.x,D=Math.round(k.snap(D.y))-D.y);for(var M=0;M<E.length;M++){var N=k.getCellGeometry(E[M]);N.x=Math.round(N.x+Ab);N.y=Math.round(N.y+D);"auto"==H&&(N.width=Math.round(k.snap(N.width)));"auto"==J&&(N.height=Math.round(k.snap(N.height)))}};"auto"==sa&&1==Ra.length&&(sa=Ya.length==2*E.length-1?"verticaltree":"verticalflow");var yb="organic"==sa||null!=EditorUi.CSV_ELK_LAYOUTS[sa]?null:this.resolveLayoutList(sa);if(null!=-yb){var Bb=ja;k.view.validate();var Cb=k.createLayouts(yb);this.scopeLayoutsToCells(Cb,Ya);this.executeLayouts(Cb,function(){jb();Bb()});ja=null}else if("circle"==sa){var Kb=new mxCircleLayout(k);Kb.disableEdgeStyle=!1;Kb.resetEdges=!1;var Xb=Kb.isVertexIgnored;Kb.isVertexIgnored=function(Ab){return Xb.apply(this,arguments)||0>mxUtils.indexOf(E,Ab)};this.executeLayout(function(){Kb.execute(k.getDefaultParent());jb()},!0,ja);ja=null}else if("verticaltree"==sa||"horizontaltree"==sa){k.view.validate();-var Ob=new mxCompactTreeLayout(k,"horizontaltree"==sa);Ob.levelDistance=ia;Ob.edgeRouting=!1;Ob.resetEdges=!1;Ob.sortEdges=!0;var Ub=Ob.isVertexIgnored;Ob.isVertexIgnored=function(Ab){return Ub.apply(this,arguments)||0>mxUtils.indexOf(E,Ab)};this.executeLayout(function(){Ob.execute(k.getDefaultParent(),0<Ra.length?Ra[0]:null)},!0,ja);ja=null}else if("orgchart"==sa){k.view.validate();var Qb=new mxOrgChartLayout(k,2,ka,ia),xb=Qb.isVertexIgnored;Qb.isVertexIgnored=function(Ab){return xb.apply(this,arguments)||-0>mxUtils.indexOf(E,Ab)};this.executeLayout(function(){Qb.execute(k.getDefaultParent());jb()},!0,ja);ja=null}else if("organic"==sa||"auto"==sa&&Ya.length>E.length){k.view.validate();var Mb=new mxFastOrganicLayout(k);Mb.forceConstant=3*ia;Mb.disableEdgeStyle=!1;Mb.resetEdges=!1;var Pb=Mb.isVertexIgnored;Mb.isVertexIgnored=function(Ab){return Pb.apply(this,arguments)||0>mxUtils.indexOf(E,Ab)};this.executeLayout(function(){Mb.execute(k.getDefaultParent());jb()},!0,ja);ja=null}else if(null!=EditorUi.CSV_ELK_LAYOUTS[sa]){k.view.validate();-Bb=ja;var Tb=EditorUi.CSV_ELK_LAYOUTS[sa],Vb=mxUtils.clone(Tb.config);Vb["elk.spacing.nodeNode"]=ia;Vb["elk.layered.spacing.nodeNodeBetweenLayers"]=ka;Vb["elk.spacing.edgeEdge"]=Z;Vb["elk.layered.spacing.edgeEdgeBetweenLayers"]=Z;var Gb=k.createLayouts([{layout:Tb.layout,config:Vb}]);this.scopeLayoutsToCells(Gb,Ya);k.model.beginUpdate();var Nb=!1,Wb=function(){Nb||(Nb=!0,k.model.endUpdate())},Yb=this;try{Gb[0].prepare(k.getDefaultParent(),function(Ab,D){null!=Ab?(Wb(),Yb.handleError(Ab)):Yb.executeLayout(function(){D();-var M=k.getBoundingBoxFromGeometry(Ya);null!=M&&k.moveCells(Ya,la-M.x,va-M.y)},!0,function(){Wb();Bb()})})}catch(Ab){throw Wb(),Ab;}ja=null}}this.hideDialog()}finally{k.model.endUpdate()}null!=ja&&ja()}}catch(Ab){this.handleError(Ab)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var k="?",q;for(q in urlParams)0>mxUtils.indexOf(c,q)&&null!=urlParams[q]&&(f+=k+q+"="+urlParams[q],k="&")}else f=window.location.search;+yb){var Bb=ka;k.view.validate();var Cb=k.createLayouts(yb);this.scopeLayoutsToCells(Cb,Ya);this.executeLayouts(Cb,function(){jb();Bb()});ka=null}else if("circle"==sa){var Kb=new mxCircleLayout(k);Kb.disableEdgeStyle=!1;Kb.resetEdges=!1;var Xb=Kb.isVertexIgnored;Kb.isVertexIgnored=function(Ab){return Xb.apply(this,arguments)||0>mxUtils.indexOf(E,Ab)};this.executeLayout(function(){Kb.execute(k.getDefaultParent());jb()},!0,ka);ka=null}else if("verticaltree"==sa||"horizontaltree"==sa){k.view.validate();+var Ob=new mxCompactTreeLayout(k,"horizontaltree"==sa);Ob.levelDistance=ia;Ob.edgeRouting=!1;Ob.resetEdges=!1;Ob.sortEdges=!0;var Ub=Ob.isVertexIgnored;Ob.isVertexIgnored=function(Ab){return Ub.apply(this,arguments)||0>mxUtils.indexOf(E,Ab)};this.executeLayout(function(){Ob.execute(k.getDefaultParent(),0<Ra.length?Ra[0]:null)},!0,ka);ka=null}else if("orgchart"==sa){k.view.validate();var Qb=new mxOrgChartLayout(k,2,ja,ia),xb=Qb.isVertexIgnored;Qb.isVertexIgnored=function(Ab){return xb.apply(this,arguments)||+0>mxUtils.indexOf(E,Ab)};this.executeLayout(function(){Qb.execute(k.getDefaultParent());jb()},!0,ka);ka=null}else if("organic"==sa||"auto"==sa&&Ya.length>E.length){k.view.validate();var Mb=new mxFastOrganicLayout(k);Mb.forceConstant=3*ia;Mb.disableEdgeStyle=!1;Mb.resetEdges=!1;var Pb=Mb.isVertexIgnored;Mb.isVertexIgnored=function(Ab){return Pb.apply(this,arguments)||0>mxUtils.indexOf(E,Ab)};this.executeLayout(function(){Mb.execute(k.getDefaultParent());jb()},!0,ka);ka=null}else if(null!=EditorUi.CSV_ELK_LAYOUTS[sa]){k.view.validate();+Bb=ka;var Tb=EditorUi.CSV_ELK_LAYOUTS[sa],Vb=mxUtils.clone(Tb.config);Vb["elk.spacing.nodeNode"]=ia;Vb["elk.layered.spacing.nodeNodeBetweenLayers"]=ja;Vb["elk.spacing.edgeEdge"]=Z;Vb["elk.layered.spacing.edgeEdgeBetweenLayers"]=Z;var Gb=k.createLayouts([{layout:Tb.layout,config:Vb}]);this.scopeLayoutsToCells(Gb,Ya);k.model.beginUpdate();var Nb=!1,Wb=function(){Nb||(Nb=!0,k.model.endUpdate())},Yb=this;try{Gb[0].prepare(k.getDefaultParent(),function(Ab,D){null!=Ab?(Wb(),Yb.handleError(Ab)):Yb.executeLayout(function(){D();+var M=k.getBoundingBoxFromGeometry(Ya);null!=M&&k.moveCells(Ya,la-M.x,ua-M.y)},!0,function(){Wb();Bb()})})}catch(Ab){throw Wb(),Ab;}ka=null}}this.hideDialog()}finally{k.model.endUpdate()}null!=ka&&ka()}}catch(Ab){this.handleError(Ab)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var k="?",q;for(q in urlParams)0>mxUtils.indexOf(c,q)&&null!=urlParams[q]&&(f+=k+q+"="+urlParams[q],k="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var k="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),q;for(q in urlParams)0>mxUtils.indexOf(k,q)&&(c=0==f?c+"?":c+"&",null!=urlParams[q]&&(c+=q+"="+urlParams[q],f++))}return c};EditorUi.prototype.showLinkDialog=function(c,f,k,q,x){c=new LinkDialog(this,c,f,k,!0,q,x);this.showDialog(c.container,440,null,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||f++;null!=this.m365&&f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;c&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),f=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var k=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!k);this.actions.get("print").setEnabled(!k);this.menus.get("exportAs").setEnabled(!k);this.menus.get("embed").setEnabled(!k);k="1"!=urlParams.embed||this.editor.graph.isEnabled();@@ -4613,93 +4616,93 @@ x="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=f&&f.isEditable();t!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&q&&0<k.cells.length);this.actions.get("copyTextStyle").setEnabled(q&&!c.isSelectionEmpty());this.actions.get("pasteTextStyle").setEnabled(null!=this.copiedTextStyle&&q&&0<k.cells.length);this.actions.get("editGeometry").setEnabled(0<k.vertices.length&&!k.transparentBounds);this.actions.get("addToScratchpad").setEnabled(0<k.cells.length);this.actions.get("createShape").setEnabled(q);this.actions.get("createRevision").setEnabled(q);this.actions.get("moveToFolder").setEnabled(null!=f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(q&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=f&&!f.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.actions.get("properties").setEnabled(null!=f);this.menus.get("publish").setEnabled(null!=f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("none"!=this.diagramContainer.style.display);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):-"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(q&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var U=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);U.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,k,q,x,B,E,L){var Q=c.editor.graph;-if("xml"==k)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==k)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(Q.getSvg(q,x,B)),"image/svg+xml");else{var V=c.getFileData(!0,null,null,null,null,!0),K=Q.getGraphBounds(),fa=Math.floor(K.width*x/Q.view.scale),aa=Math.floor(K.height*x/Q.view.scale);if(V.length<=MAX_REQUEST_SIZE&&fa*aa<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.editor.isExportToCanvas()){var da={globalVars:Q.getExportVariables()};-L&&(da.grid={size:Q.gridSize,steps:Q.view.gridSteps,color:Q.view.gridColor});c.saveRequest(f,k,function(ba,ha){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(ha||"0")+(null!=ba?"&filename="+encodeURIComponent(ba):"")+"&extras="+encodeURIComponent(JSON.stringify(da))+(0<E?"&dpi="+E:"")+"&bg="+(null!=q?q:"none")+"&w="+fa+"&h="+aa+"&border="+B+"&xml="+encodeURIComponent(V))})}else"png"==k?c.exportImage(x,null==q||"none"==q,!0,!1,!1,B,!0,!1,null,L,E):c.exportImage(x,!1,!0,!1,!1,B,!0,!1,"jpeg",+"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(q&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var U=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);U.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,k,q,x,C,E,L){var Q=c.editor.graph;+if("xml"==k)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==k)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(Q.getSvg(q,x,C)),"image/svg+xml");else{var V=c.getFileData(!0,null,null,null,null,!0),K=Q.getGraphBounds(),fa=Math.floor(K.width*x/Q.view.scale),aa=Math.floor(K.height*x/Q.view.scale);if(V.length<=MAX_REQUEST_SIZE&&fa*aa<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.editor.isExportToCanvas()){var da={globalVars:Q.getExportVariables()};+L&&(da.grid={size:Q.gridSize,steps:Q.view.gridSteps,color:Q.view.gridColor});c.saveRequest(f,k,function(ba,ha){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(ha||"0")+(null!=ba?"&filename="+encodeURIComponent(ba):"")+"&extras="+encodeURIComponent(JSON.stringify(da))+(0<E?"&dpi="+E:"")+"&bg="+(null!=q?q:"none")+"&w="+fa+"&h="+aa+"&border="+C+"&xml="+encodeURIComponent(V))})}else"png"==k?c.exportImage(x,null==q||"none"==q,!0,!1,!1,C,!0,!1,null,L,E):c.exportImage(x,!1,!0,!1,!1,C,!0,!1,"jpeg",L);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var k=0;k<this.pages.length;k++){var q=c;this.currentPage!=this.pages[k]&&(q=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[k]),q.model.setRoot(this.pages[k].root));f+=this.pages[k].getName()+" "+q.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.writeJsonLabel=function(c,f,k){if(null!=f&&""!=f){if(this.editor.graph.isHtmlLabel(c)&&(c=document.createElement("div"),c.innerHTML=Graph.sanitizeHtml(f),0<c.getElementsByTagName("*").length)){k.label=mxUtils.trim(mxUtils.extractTextWithWhitespace([c]));k.html=f;return}k.label=f}};EditorUi.prototype.getJsonForExportCell=function(c,f){var k={id:c.getId()};k.type=f?"layer":c.edge?"edge":c.vertex?"node":"group";f||(f=c.getParent(),null!=f&&(k.parent=f.getId()));c.edge&&(null!=-c.source&&(k.source=c.source.getId()),null!=c.target&&(k.target=c.target.getId()));f=c.value;if(null!=f&&mxUtils.isNode(f)){this.writeJsonLabel(c,f.getAttribute("label"),k);c=f.attributes;f={};for(var q=0,x=0;x<c.length;x++){var B=c[x].nodeName;"label"!=B&&"placeholders"!=B&&"id"!=B&&(f[B]=c[x].nodeValue,q++)}0<q&&(k.metadata=f)}else"string"===typeof f&&this.writeJsonLabel(c,f,k);return k};EditorUi.prototype.getJsonForPage=function(c,f){var k=this.editor.graph.getModel();var q=null==c||c==this.currentPage?-k.getRoot():this.updatePageRoot(c).root;var x=[],B=mxUtils.bind(this,function(K,fa){x.push(this.getJsonForExportCell(K,fa));fa=K.getChildCount();for(var aa=0;aa<fa;aa++)B(K.getChildAt(aa),!1)});if(null!=f){q={};for(var E=0;E<f.length;E++)q[f[E].getId()]=!0;for(E=0;E<f.length;E++){for(var L=f[E],Q=L.getParent(),V=!1;null!=Q;){if(q[Q.getId()]){V=!0;break}Q=Q.getParent()}V||B(L,k.isLayer(L))}}else for(f=q.getChildCount(),E=0;E<f;E++)B(q.getChildAt(E),!0);E={};null!=c&&(E.id=c.getId(),E.name=c.getName());+c.source&&(k.source=c.source.getId()),null!=c.target&&(k.target=c.target.getId()));f=c.value;if(null!=f&&mxUtils.isNode(f)){this.writeJsonLabel(c,f.getAttribute("label"),k);c=f.attributes;f={};for(var q=0,x=0;x<c.length;x++){var C=c[x].nodeName;"label"!=C&&"placeholders"!=C&&"id"!=C&&(f[C]=c[x].nodeValue,q++)}0<q&&(k.metadata=f)}else"string"===typeof f&&this.writeJsonLabel(c,f,k);return k};EditorUi.prototype.getJsonForPage=function(c,f){var k=this.editor.graph.getModel();var q=null==c||c==this.currentPage?+k.getRoot():this.updatePageRoot(c).root;var x=[],C=mxUtils.bind(this,function(K,fa){x.push(this.getJsonForExportCell(K,fa));fa=K.getChildCount();for(var aa=0;aa<fa;aa++)C(K.getChildAt(aa),!1)});if(null!=f){q={};for(var E=0;E<f.length;E++)q[f[E].getId()]=!0;for(E=0;E<f.length;E++){for(var L=f[E],Q=L.getParent(),V=!1;null!=Q;){if(q[Q.getId()]){V=!0;break}Q=Q.getParent()}V||C(L,k.isLayer(L))}}else for(f=q.getChildCount(),E=0;E<f;E++)C(q.getChildAt(E),!0);E={};null!=c&&(E.id=c.getId(),E.name=c.getName());E.cells=x;return E};EditorUi.prototype.createJsonForExport=function(c,f,k,q){var x={version:EditorUi.VERSION};f&&(x.data=mxUtils.getXml(this.getXmlFileData(!q,!c,!k)));f=[];if(q)f.push(this.getJsonForPage(this.currentPage,this.editor.graph.getSelectionCells()));else if(c&&null!=this.pages)for(c=0;c<this.pages.length;c++)f.push(this.getJsonForPage(this.pages[c]));else f.push(this.getJsonForPage(this.currentPage));x.pages=f;return x};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},-k=document.createElement("div");k.style.whiteSpace="nowrap";var q=document.createElement("h3");mxUtils.write(q,mxUtils.htmlEntities(c));k.appendChild(q);var x=document.createElement("div");x.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";x.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var B={};try{var E=mxSettings.getCustomLibraries();for(c=0;c<E.length;c++){var L=E[c];if("R"==L.substring(0,1)){var Q=JSON.parse(decodeURIComponent(L.substring(1)));-B[Q[0]]={id:Q[0],title:Q[1],downloadUrl:Q[2]}}}}catch(V){}this.remoteInvoke("getCustomLibraries",null,null,function(V){x.innerText="";if(0==V.length)x.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var K=0;K<V.length;K++){var fa=V[K];B[fa.id]&&(f[fa.id]=fa);var aa=this.addCheckbox(x,fa.title,B[fa.id]);(function(da,ba){mxEvent.addListener(ba,"change",function(){this.checked?f[da.id]=da:delete f[da.id]})})(fa,-aa)}},mxUtils.bind(this,function(V){x.innerText="";var K=document.createElement("div");K.style.padding="8px";K.style.textAlign="center";mxUtils.write(K,mxResources.get("error")+": ");mxUtils.write(K,null!=V&&null!=V.message?V.message:mxResources.get("unknownError"));x.appendChild(K)}));k.appendChild(x);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var V=0,K;for(K in f)null==B[K]&&(V++,mxUtils.bind(this,function(fa){this.remoteInvoke("getFileContent",-[fa.downloadUrl],null,mxUtils.bind(this,function(aa){V--;0==V&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,aa,fa)),this.showSidebar()}catch(da){this.handleError(da,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){V--;0==V&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[K]));for(K in B)f[K]||this.closeLibrary(new RemoteLibrary(this,null,B[K]));0==V&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");+k=document.createElement("div");k.style.whiteSpace="nowrap";var q=document.createElement("h3");mxUtils.write(q,mxUtils.htmlEntities(c));k.appendChild(q);var x=document.createElement("div");x.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";x.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var C={};try{var E=mxSettings.getCustomLibraries();for(c=0;c<E.length;c++){var L=E[c];if("R"==L.substring(0,1)){var Q=JSON.parse(decodeURIComponent(L.substring(1)));+C[Q[0]]={id:Q[0],title:Q[1],downloadUrl:Q[2]}}}}catch(V){}this.remoteInvoke("getCustomLibraries",null,null,function(V){x.innerText="";if(0==V.length)x.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var K=0;K<V.length;K++){var fa=V[K];C[fa.id]&&(f[fa.id]=fa);var aa=this.addCheckbox(x,fa.title,C[fa.id]);(function(da,ba){mxEvent.addListener(ba,"change",function(){this.checked?f[da.id]=da:delete f[da.id]})})(fa,+aa)}},mxUtils.bind(this,function(V){x.innerText="";var K=document.createElement("div");K.style.padding="8px";K.style.textAlign="center";mxUtils.write(K,mxResources.get("error")+": ");mxUtils.write(K,null!=V&&null!=V.message?V.message:mxResources.get("unknownError"));x.appendChild(K)}));k.appendChild(x);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var V=0,K;for(K in f)null==C[K]&&(V++,mxUtils.bind(this,function(fa){this.remoteInvoke("getFileContent",+[fa.downloadUrl],null,mxUtils.bind(this,function(aa){V--;0==V&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,aa,fa)),this.showSidebar()}catch(da){this.handleError(da,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){V--;0==V&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[K]));for(K in C)f[K]||this.closeLibrary(new RemoteLibrary(this,null,C[K]));0==V&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(k.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=-c;for(var f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,k=this.remoteInvokeCallbacks[f.callbackId];if(null==k)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?k.error&&k.error(c.error.errResp):k.callback&&k.callback.apply(this,c.resp);this.remoteInvokeCallbacks[f.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,f,k,q,x){var B=-!0,E=window.setTimeout(mxUtils.bind(this,function(){B=!1;x({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),L=mxUtils.bind(this,function(){window.clearTimeout(E);B&&q.apply(this,arguments)}),Q=mxUtils.bind(this,function(){window.clearTimeout(E);B&&x.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:L,error:Q});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:k});null!=this.remoteWin?-this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,f){var k=mxUtils.bind(this,function(V,K){var fa={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=K?fa.error={errResp:K}:null!=V&&(fa.resp=V);this.remoteWin.postMessage(JSON.stringify(fa),"*")});try{var q=c.funtionName,x=this.remoteInvokableFns[q];if(null!=x&&"function"===typeof this[q]){if(x.allowedDomains){for(var B=!1,E=0;E<x.allowedDomains.length;E++)if(f=="https://"+x.allowedDomains[E]){B=-!0;break}if(!B){k(null,"Invalid Call: "+q+" is not allowed.");return}}var L=c.functionArgs;Array.isArray(L)||(L=[]);if(x.isAsync)L.push(function(){k(Array.prototype.slice.apply(arguments))}),L.push(function(V){k(null,V||"Unkown Error")}),this[q].apply(this,L);else{var Q=this[q].apply(this,L);k([Q])}}else k(null,"Invalid Call: "+q+" is not found.")}catch(V){k(null,"Invalid Call: An error occurred, "+V.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var k=window.indexedDB||-window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var q=k.open("database",2);q.onupgradeneeded=function(x){try{var B=q.result;1>x.oldVersion&&B.createObjectStore("objects",{keyPath:"key"});2>x.oldVersion&&(B.createObjectStore("files",{keyPath:"title"}),B.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(E){null!=f&&f(E)}};q.onsuccess=mxUtils.bind(this,function(x){try{var B=q.result;this.database=B;EditorUi.migrateStorageFiles&&(StorageFile.migrate(B),+c;for(var f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,k=this.remoteInvokeCallbacks[f.callbackId];if(null==k)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?k.error&&k.error(c.error.errResp):k.callback&&k.callback.apply(this,c.resp);this.remoteInvokeCallbacks[f.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,f,k,q,x){var C=+!0,E=window.setTimeout(mxUtils.bind(this,function(){C=!1;x({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),L=mxUtils.bind(this,function(){window.clearTimeout(E);C&&q.apply(this,arguments)}),Q=mxUtils.bind(this,function(){window.clearTimeout(E);C&&x.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:L,error:Q});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:k});null!=this.remoteWin?+this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,f){var k=mxUtils.bind(this,function(V,K){var fa={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=K?fa.error={errResp:K}:null!=V&&(fa.resp=V);this.remoteWin.postMessage(JSON.stringify(fa),"*")});try{var q=c.funtionName,x=this.remoteInvokableFns[q];if(null!=x&&"function"===typeof this[q]){if(x.allowedDomains){for(var C=!1,E=0;E<x.allowedDomains.length;E++)if(f=="https://"+x.allowedDomains[E]){C=+!0;break}if(!C){k(null,"Invalid Call: "+q+" is not allowed.");return}}var L=c.functionArgs;Array.isArray(L)||(L=[]);if(x.isAsync)L.push(function(){k(Array.prototype.slice.apply(arguments))}),L.push(function(V){k(null,V||"Unkown Error")}),this[q].apply(this,L);else{var Q=this[q].apply(this,L);k([Q])}}else k(null,"Invalid Call: "+q+" is not found.")}catch(V){k(null,"Invalid Call: An error occurred, "+V.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var k=window.indexedDB||+window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var q=k.open("database",2);q.onupgradeneeded=function(x){try{var C=q.result;1>x.oldVersion&&C.createObjectStore("objects",{keyPath:"key"});2>x.oldVersion&&(C.createObjectStore("files",{keyPath:"title"}),C.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(E){null!=f&&f(E)}};q.onsuccess=mxUtils.bind(this,function(x){try{var C=q.result;this.database=C;EditorUi.migrateStorageFiles&&(StorageFile.migrate(C),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(E){if((!E||"1"==urlParams.forceMigration)&&"1"==urlParams.forceMigration){var L=document.createElement("iframe");L.style.display="none";L.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(L);var Q=!0,V=!1,K,fa=0,aa=mxUtils.bind(this,function(){V=!0;this.setDatabaseItem(".drawioMigrated3",!0);L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),da=mxUtils.bind(this,function(){fa++;ba()}),ba=mxUtils.bind(this,function(){try{if(fa>=K.length)aa();else{var qa=K[fa];StorageFile.getFileContent(this,qa,mxUtils.bind(this,function(ra){null==ra||".scratchpad"==qa&&ra==this.emptyLibraryXml?L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[qa]}),"*"):da()}),da)}}catch(ra){console.log(ra)}}),ha=mxUtils.bind(this,function(qa){try{this.setDatabaseItem(null,[{title:qa.title,size:qa.data.length,lastModified:Date.now(),type:qa.isLib?"L":"F"},{title:qa.title,data:qa.data}],da,da,["filesInfo","files"])}catch(ra){console.log(ra)}});E=mxUtils.bind(this,function(qa){try{if(qa.source==L.contentWindow){var ra={};try{ra=JSON.parse(qa.data)}catch(l){}"init"==ra.event?(L.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),-"*"),L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=ra.event||V||(Q?null!=ra.resp&&0<ra.resp.length&&null!=ra.resp[0]?(K=ra.resp[0],Q=!1,ba()):aa():null!=ra.resp&&0<ra.resp.length&&null!=ra.resp[0]?ha(ra.resp[0]):da())}}catch(l){console.log(l)}});window.addEventListener("message",E)}})));c(B);B.onversionchange=function(){B.close()}}catch(E){null!=f?f(E):null!=window.console&&console.warn(E)}});q.onerror=f;q.onblocked=-function(){}}catch(x){null!=f?f(x):null!=window.console&&console.error(x)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,f,k,q,x){this.openDatabase(mxUtils.bind(this,function(B){try{x=x||"objects";Array.isArray(x)||(x=[x],c=[c],f=[f]);var E=B.transaction(x,"readwrite");E.oncomplete=k;E.onerror=q;for(B=0;B<x.length;B++)E.objectStore(x[B]).put(null!=c&&null!=c[B]?{key:c[B],data:f[B]}:f[B])}catch(L){null!=q&&q(L)}}),q)};EditorUi.prototype.removeDatabaseItem=-function(c,f,k,q){this.openDatabase(mxUtils.bind(this,function(x){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c]);var B=x.transaction(q,"readwrite");B.oncomplete=f;B.onerror=k;for(x=0;x<q.length;x++)B.objectStore(q[x]).delete(c[x])}catch(E){null!=k&&k(E)}}),k)};EditorUi.prototype.getDatabaseItem=function(c,f,k,q){this.openDatabase(mxUtils.bind(this,function(x){try{q=q||"objects";var B=x.transaction([q],"readonly").objectStore(q).get(c);B.onsuccess=function(){f(B.result)};B.onerror=k}catch(E){null!=-k&&k(E)}}),k)};EditorUi.prototype.getDatabaseItems=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(q){try{k=k||"objects";var x=q.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),B=[];x.onsuccess=function(E){null==E.target.result?c(B):(B.push(E.target.result.value),E.target.result.continue())};x.onerror=f}catch(E){null!=f&&f(E)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(q){try{k=k||"objects";-var x=q.transaction([k],"readonly").objectStore(k).getAllKeys();x.onsuccess=function(){c(x.result)};x.onerror=f}catch(B){null!=f&&f(B)}}),f)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};+"*"),L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=ra.event||V||(Q?null!=ra.resp&&0<ra.resp.length&&null!=ra.resp[0]?(K=ra.resp[0],Q=!1,ba()):aa():null!=ra.resp&&0<ra.resp.length&&null!=ra.resp[0]?ha(ra.resp[0]):da())}}catch(l){console.log(l)}});window.addEventListener("message",E)}})));c(C);C.onversionchange=function(){C.close()}}catch(E){null!=f?f(E):null!=window.console&&console.warn(E)}});q.onerror=f;q.onblocked=+function(){}}catch(x){null!=f?f(x):null!=window.console&&console.error(x)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,f,k,q,x){this.openDatabase(mxUtils.bind(this,function(C){try{x=x||"objects";Array.isArray(x)||(x=[x],c=[c],f=[f]);var E=C.transaction(x,"readwrite");E.oncomplete=k;E.onerror=q;for(C=0;C<x.length;C++)E.objectStore(x[C]).put(null!=c&&null!=c[C]?{key:c[C],data:f[C]}:f[C])}catch(L){null!=q&&q(L)}}),q)};EditorUi.prototype.removeDatabaseItem=+function(c,f,k,q){this.openDatabase(mxUtils.bind(this,function(x){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c]);var C=x.transaction(q,"readwrite");C.oncomplete=f;C.onerror=k;for(x=0;x<q.length;x++)C.objectStore(q[x]).delete(c[x])}catch(E){null!=k&&k(E)}}),k)};EditorUi.prototype.getDatabaseItem=function(c,f,k,q){this.openDatabase(mxUtils.bind(this,function(x){try{q=q||"objects";var C=x.transaction([q],"readonly").objectStore(q).get(c);C.onsuccess=function(){f(C.result)};C.onerror=k}catch(E){null!=+k&&k(E)}}),k)};EditorUi.prototype.getDatabaseItems=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(q){try{k=k||"objects";var x=q.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),C=[];x.onsuccess=function(E){null==E.target.result?c(C):(C.push(E.target.result.value),E.target.result.continue())};x.onerror=f}catch(E){null!=f&&f(E)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(q){try{k=k||"objects";+var x=q.transaction([k],"readonly").objectStore(k).getAllKeys();x.onsuccess=function(){c(x.result)};x.onerror=f}catch(C){null!=f&&f(C)}}),f)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(c,f){var k=this.getCurrentFile();null!=k?k.getComments(c,f):c([])};EditorUi.prototype.addComment=function(c,f,k){var q=this.getCurrentFile();null!=q?q.addComment(c,f,k):f(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.newComment=function(c,f){var k=this.getCurrentFile();return null!=k?k.newComment(c,f):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,f){var k=this.getCurrentFile();null!=k&&k.getRevisions?k.getRevisions(c,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==-DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,k,q,x,B,E,L){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,k,q,x,B,E,L)};EditorUi.prototype.loadFonts=+DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,k,q,x,C,E,L){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,k,q,x,C,E,L)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};-EditorUi.prototype.exportToCanvas=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba,ha){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba,ha)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,k,q){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,+EditorUi.prototype.exportToCanvas=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba,ha){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba,ha)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,k,q){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,k,q)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,f)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,f,k,q){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,k,q)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,k,q,x){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,f,k,q,x)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],f=0;f<localStorage.length;f++){var k=localStorage.key(f),q=localStorage.getItem(k);if(0<k.length&&(".scratchpad"==k||"."!=k.charAt(0))&&0<q.length){var x="<mxfile "===q.substring(0,8)||"<?xml"===q.substring(0,5)||"\x3c!--[if IE]>"===q.substring(0,12);q="<mxlibrary>"===q.substring(0,11);(x||q)&&c.push(k)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var f=localStorage.getItem(c);return{title:c,data:f,isLib:"<mxlibrary>"===f.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();-var CommentsWindow=function(b,d,m,p,v,n){function y(){for(var ba=E.getElementsByTagName("div"),ha=0,qa=0;qa<ba.length;qa++)"none"!=ba[qa].style.display&&ba[qa].parentNode==E&&ha++;L.style.display=0==ha?"block":"none"}function C(ba,ha,qa,ra){function l(){ha.removeChild(J);ha.removeChild(R);H.style.display="block";t.style.display="block"}q={div:ha,comment:ba,saveCallback:qa,deleteOnCancel:ra};var t=ha.querySelector(".geCommentTxt"),H=ha.querySelector(".geCommentActionsList"),J=document.createElement("textarea");+var CommentsWindow=function(b,d,m,p,u,n){function y(){for(var ba=E.getElementsByTagName("div"),ha=0,qa=0;qa<ba.length;qa++)"none"!=ba[qa].style.display&&ba[qa].parentNode==E&&ha++;L.style.display=0==ha?"block":"none"}function B(ba,ha,qa,ra){function l(){ha.removeChild(J);ha.removeChild(R);H.style.display="block";t.style.display="block"}q={div:ha,comment:ba,saveCallback:qa,deleteOnCancel:ra};var t=ha.querySelector(".geCommentTxt"),H=ha.querySelector(".geCommentActionsList"),J=document.createElement("textarea");J.className="geCommentEditTxtArea";J.style.minHeight=t.offsetHeight+"px";J.value=ba.content;ha.insertBefore(J,t);var R=document.createElement("div");R.className="geCommentEditBtns";var T=mxUtils.button(mxResources.get("cancel"),function(){ra?(ha.parentNode.removeChild(ha),y()):l();q=null});T.className="geCommentEditBtn";R.appendChild(T);var Y=mxUtils.button(mxResources.get("save"),function(){t.innerText="";ba.content=J.value;mxUtils.write(t,ba.content);l();qa(ba);q=null});mxEvent.addListener(J,"keydown",mxUtils.bind(this,function(Z){mxEvent.isConsumed(Z)||((mxEvent.isControlDown(Z)||mxClient.IS_MAC&&mxEvent.isMetaDown(Z))&&13==Z.keyCode?(Y.click(),mxEvent.consume(Z)):27==Z.keyCode&&(T.click(),mxEvent.consume(Z)))}));Y.focus();Y.className="geCommentEditBtn gePrimaryBtn";R.appendChild(Y);ha.insertBefore(R,t);H.style.display="none";t.style.display="none";J.focus()}function P(ba,ha){ha.innerText="";ba=new Date(ba.modifiedDate);var qa=b.timeSince(ba);null==qa&&(qa=mxResources.get("lessThanAMinute"));-mxUtils.write(ha,mxResources.get("timeAgo",[qa],"{1} ago"));ha.setAttribute("title",ba.toLocaleDateString()+" "+ba.toLocaleTimeString())}function G(ba){var ha=document.createElement("img");ha.className="geCommentBusyImg";ha.src=IMAGE_PATH+"/spin.gif";ba.appendChild(ha);ba.busyImg=ha}function O(ba){ba.style.border="1px solid red";ba.busyImg.parentNode==ba&&ba.removeChild(ba.busyImg)}function U(ba){ba.style.border="";ba.busyImg.parentNode==ba&&ba.removeChild(ba.busyImg)}function c(ba,ha,qa,ra,l){function t(ka,-X,ja){var na=document.createElement("li");na.className="geCommentAction";var la=document.createElement("a");la.className="geCommentActionLnk";mxUtils.write(la,ka);na.appendChild(la);mxEvent.addListener(la,"click",function(va){X(va,ba);va.preventDefault();mxEvent.consume(va)});ia.appendChild(na);ja&&(na.style.display="none")}function H(){function ka(na){X.push(ja);if(null!=na.replies)for(var la=0;la<na.replies.length;la++)ja=ja.nextSibling,ka(na.replies[la])}var X=[],ja=R;ka(ba);return{pdiv:ja,replies:X}}-function J(ka,X,ja,na,la){function va(){G(Ca);ba.addReply(wa,function(Fa){wa.id=Fa;ba.replies.push(wa);U(Ca);ja&&ja()},function(Fa){za();O(Ca);b.handleError(Fa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},na,la)}function za(){C(wa,Ca,function(Fa){va()},!0)}var sa=H().pdiv,wa=b.newComment(ka,b.getCurrentUser());wa.pCommentId=ba.id;null==ba.replies&&(ba.replies=[]);var Ca=c(wa,ba.replies,sa,ra+1);X?za():va()}if(l||!ba.isResolved){L.style.display="none";var R=document.createElement("div");+mxUtils.write(ha,mxResources.get("timeAgo",[qa],"{1} ago"));ha.setAttribute("title",ba.toLocaleDateString()+" "+ba.toLocaleTimeString())}function G(ba){var ha=document.createElement("img");ha.className="geCommentBusyImg";ha.src=IMAGE_PATH+"/spin.gif";ba.appendChild(ha);ba.busyImg=ha}function O(ba){ba.style.border="1px solid red";ba.busyImg.parentNode==ba&&ba.removeChild(ba.busyImg)}function U(ba){ba.style.border="";ba.busyImg.parentNode==ba&&ba.removeChild(ba.busyImg)}function c(ba,ha,qa,ra,l){function t(ja,+X,ka){var na=document.createElement("li");na.className="geCommentAction";var la=document.createElement("a");la.className="geCommentActionLnk";mxUtils.write(la,ja);na.appendChild(la);mxEvent.addListener(la,"click",function(ua){X(ua,ba);ua.preventDefault();mxEvent.consume(ua)});ia.appendChild(na);ka&&(na.style.display="none")}function H(){function ja(na){X.push(ka);if(null!=na.replies)for(var la=0;la<na.replies.length;la++)ka=ka.nextSibling,ja(na.replies[la])}var X=[],ka=R;ja(ba);return{pdiv:ka,replies:X}}+function J(ja,X,ka,na,la){function ua(){G(Ca);ba.addReply(wa,function(Fa){wa.id=Fa;ba.replies.push(wa);U(Ca);ka&&ka()},function(Fa){za();O(Ca);b.handleError(Fa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},na,la)}function za(){B(wa,Ca,function(Fa){ua()},!0)}var sa=H().pdiv,wa=b.newComment(ja,b.getCurrentUser());wa.pCommentId=ba.id;null==ba.replies&&(ba.replies=[]);var Ca=c(wa,ba.replies,sa,ra+1);X?za():ua()}if(l||!ba.isResolved){L.style.display="none";var R=document.createElement("div");R.className="geCommentContainer";R.setAttribute("data-commentId",ba.id);R.style.marginLeft=20*ra+5+"px";ba.isResolved&&(x.style.opacity="0.7");var T=document.createElement("div");T.className="geCommentHeader";var Y=document.createElement("img");Y.className="geCommentUserImg";Y.src=null!=ba.user&&null!=ba.user.pictureUrl?ba.user.pictureUrl:Editor.userImage;T.appendChild(Y);Y=document.createElement("div");Y.className="geCommentHeaderTxt";T.appendChild(Y);var Z=document.createElement("div");Z.className="geCommentUsername";mxUtils.write(Z,null!=ba.user?ba.user.displayName:mxResources.get("unknownUser"));Y.appendChild(Z);Z=document.createElement("div");Z.className="geCommentDate";Z.setAttribute("data-commentId",ba.id);P(ba,Z);Y.appendChild(Z);R.appendChild(T);T=document.createElement("div");T.className="geCommentTxt";mxUtils.write(T,ba.content||"");R.appendChild(T);ba.isLocked&&(R.style.opacity="0.5");T=document.createElement("div");T.className="geCommentActions";var ia=document.createElement("ul");-ia.className="geCommentActionsList";T.appendChild(ia);f||ba.isLocked||0!=ra&&!k||t(mxResources.get("reply"),function(){J("",!0)},ba.isResolved);Y=b.getCurrentUser();null==Y||null==ba.user||Y.id!=ba.user.id||f||ba.isLocked||(t(mxResources.get("edit"),function(){function ka(){C(ba,R,function(){G(R);ba.editComment(ba.content,function(){U(R)},function(X){O(R);ka();b.handleError(X,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}ka()},ba.isResolved),t(mxResources.get("delete"),-function(){b.confirm(mxResources.get("areYouSure"),function(){G(R);ba.deleteComment(function(ka){if(!0===ka){ka=R.querySelector(".geCommentTxt");ka.innerText="";mxUtils.write(ka,mxResources.get("msgDeleted"));var X=R.querySelectorAll(".geCommentAction");for(ka=0;ka<X.length;ka++)X[ka].parentNode.removeChild(X[ka]);U(R);R.style.opacity="0.5"}else{X=H(ba).replies;for(ka=0;ka<X.length;ka++)E.removeChild(X[ka]);for(ka=0;ka<ha.length;ka++)if(ha[ka]==ba){ha.splice(ka,1);break}L.style.display=0==E.getElementsByTagName("div").length?-"block":"none"}},function(ka){O(R);b.handleError(ka,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},ba.isResolved));f||ba.isLocked||0!=ra||t(ba.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(ka){function X(){var ja=ka.target;ja.innerText="";ba.isResolved=!ba.isResolved;mxUtils.write(ja,ba.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var na=ba.isResolved?"none":"",la=H(ba).replies,va="light-dark("+(ba.isResolved?"ghostWhite":-"white")+", transparent)",za=0;za<la.length;za++){la[za].style.backgroundColor=va;for(var sa=la[za].querySelectorAll(".geCommentAction"),wa=0;wa<sa.length;wa++)sa[wa]!=ja.parentNode&&(sa[wa].style.display=na);fa||(la[za].style.display="none")}y()}ba.isResolved?J(mxResources.get("reOpened")+": ",!0,X,!1,!0):J(mxResources.get("markedAsResolved"),!1,X,!0)});R.appendChild(T);null!=qa?E.insertBefore(R,qa.nextSibling):E.appendChild(R);for(qa=0;null!=ba.replies&&qa<ba.replies.length;qa++)T=ba.replies[qa],-T.isResolved=ba.isResolved,c(T,ba.replies,null,ra+1,l);null!=q&&(q.comment.id==ba.id?(l=ba.content,ba.content=q.comment.content,C(ba,R,q.saveCallback,q.deleteOnCancel),ba.content=l):null==q.comment.id&&q.comment.pCommentId==ba.id&&(E.appendChild(q.div),C(q.comment,q.div,q.saveCallback,q.deleteOnCancel)));return R}}var f=!b.canComment(),k=b.canReplyToReplies(),q=null,x=document.createElement("div");x.className="geCommentsWin";var B=EditorUi.compactUi?"26px":"30px",E=document.createElement("div");E.className=-"geCommentsList";E.style.bottom=parseInt(B)+7+"px";x.appendChild(E);var L=document.createElement("span");L.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(L,mxResources.get("noCommentsFound"));var Q=document.createElement("div");Q.className="geToolbarContainer geCommentsToolbar";Q.style.height=B;Q.style.padding="3px 4px 4px 4px";B=document.createElement("a");B.className="geButton";if(!f){var V=B.cloneNode();V.style.backgroundImage="url("+Editor.plusImage+")";V.setAttribute("title",-mxResources.get("create")+"...");mxEvent.addListener(V,"click",function(ba){function ha(){C(qa,ra,function(l){G(ra);b.addComment(l,function(t){l.id=t;aa.push(l);U(ra)},function(t){O(ra);ha();b.handleError(t,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var qa=b.newComment("",b.getCurrentUser()),ra=c(qa,aa,null,0);ha();ba.preventDefault();mxEvent.consume(ba)});Q.appendChild(V)}var K=B.cloneNode();K.style.backgroundImage="url("+Editor.checkImage+")";K.setAttribute("title",-mxResources.get("showResolved"));var fa=!1;mxEvent.addListener(K,"click",function(ba){(fa=!fa)?K.classList.add("geActiveItem"):K.classList.remove("geActiveItem");da();ba.preventDefault();mxEvent.consume(ba)});Q.appendChild(K);b.commentsRefreshNeeded()&&(V=B.cloneNode(),V.style.backgroundImage="url("+Editor.refreshImage+")",V.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(V,"click",function(ba){da();ba.preventDefault();mxEvent.consume(ba)}),Q.appendChild(V));b.commentsSaveNeeded()&&-(B=B.cloneNode(),B.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',B.setAttribute("title",mxResources.get("save")),B.className="geButton geAdaptiveAsset",mxEvent.addListener(B,"click",function(ba){n();ba.preventDefault();mxEvent.consume(ba)}),Q.appendChild(B));x.appendChild(Q);var aa=[],da=mxUtils.bind(this,function(){this.hasError=!1;if(null!=q)try{q.div=q.div.cloneNode(!0);var ba=q.div.querySelector(".geCommentEditTxtArea"),ha=q.div.querySelector(".geCommentEditBtns");+ia.className="geCommentActionsList";T.appendChild(ia);f||ba.isLocked||0!=ra&&!k||t(mxResources.get("reply"),function(){J("",!0)},ba.isResolved);Y=b.getCurrentUser();null==Y||null==ba.user||Y.id!=ba.user.id||f||ba.isLocked||(t(mxResources.get("edit"),function(){function ja(){B(ba,R,function(){G(R);ba.editComment(ba.content,function(){U(R)},function(X){O(R);ja();b.handleError(X,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}ja()},ba.isResolved),t(mxResources.get("delete"),+function(){b.confirm(mxResources.get("areYouSure"),function(){G(R);ba.deleteComment(function(ja){if(!0===ja){ja=R.querySelector(".geCommentTxt");ja.innerText="";mxUtils.write(ja,mxResources.get("msgDeleted"));var X=R.querySelectorAll(".geCommentAction");for(ja=0;ja<X.length;ja++)X[ja].parentNode.removeChild(X[ja]);U(R);R.style.opacity="0.5"}else{X=H(ba).replies;for(ja=0;ja<X.length;ja++)E.removeChild(X[ja]);for(ja=0;ja<ha.length;ja++)if(ha[ja]==ba){ha.splice(ja,1);break}L.style.display=0==E.getElementsByTagName("div").length?+"block":"none"}},function(ja){O(R);b.handleError(ja,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},ba.isResolved));f||ba.isLocked||0!=ra||t(ba.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(ja){function X(){var ka=ja.target;ka.innerText="";ba.isResolved=!ba.isResolved;mxUtils.write(ka,ba.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var na=ba.isResolved?"none":"",la=H(ba).replies,ua="light-dark("+(ba.isResolved?"ghostWhite":+"white")+", transparent)",za=0;za<la.length;za++){la[za].style.backgroundColor=ua;for(var sa=la[za].querySelectorAll(".geCommentAction"),wa=0;wa<sa.length;wa++)sa[wa]!=ka.parentNode&&(sa[wa].style.display=na);fa||(la[za].style.display="none")}y()}ba.isResolved?J(mxResources.get("reOpened")+": ",!0,X,!1,!0):J(mxResources.get("markedAsResolved"),!1,X,!0)});R.appendChild(T);null!=qa?E.insertBefore(R,qa.nextSibling):E.appendChild(R);for(qa=0;null!=ba.replies&&qa<ba.replies.length;qa++)T=ba.replies[qa],+T.isResolved=ba.isResolved,c(T,ba.replies,null,ra+1,l);null!=q&&(q.comment.id==ba.id?(l=ba.content,ba.content=q.comment.content,B(ba,R,q.saveCallback,q.deleteOnCancel),ba.content=l):null==q.comment.id&&q.comment.pCommentId==ba.id&&(E.appendChild(q.div),B(q.comment,q.div,q.saveCallback,q.deleteOnCancel)));return R}}var f=!b.canComment(),k=b.canReplyToReplies(),q=null,x=document.createElement("div");x.className="geCommentsWin";var C=EditorUi.compactUi?"26px":"30px",E=document.createElement("div");E.className=+"geCommentsList";E.style.bottom=parseInt(C)+7+"px";x.appendChild(E);var L=document.createElement("span");L.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(L,mxResources.get("noCommentsFound"));var Q=document.createElement("div");Q.className="geToolbarContainer geCommentsToolbar";Q.style.height=C;Q.style.padding="3px 4px 4px 4px";C=document.createElement("a");C.className="geButton";if(!f){var V=C.cloneNode();V.style.backgroundImage="url("+Editor.plusImage+")";V.setAttribute("title",+mxResources.get("create")+"...");mxEvent.addListener(V,"click",function(ba){function ha(){B(qa,ra,function(l){G(ra);b.addComment(l,function(t){l.id=t;aa.push(l);U(ra)},function(t){O(ra);ha();b.handleError(t,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var qa=b.newComment("",b.getCurrentUser()),ra=c(qa,aa,null,0);ha();ba.preventDefault();mxEvent.consume(ba)});Q.appendChild(V)}var K=C.cloneNode();K.style.backgroundImage="url("+Editor.checkImage+")";K.setAttribute("title",+mxResources.get("showResolved"));var fa=!1;mxEvent.addListener(K,"click",function(ba){(fa=!fa)?K.classList.add("geActiveItem"):K.classList.remove("geActiveItem");da();ba.preventDefault();mxEvent.consume(ba)});Q.appendChild(K);b.commentsRefreshNeeded()&&(V=C.cloneNode(),V.style.backgroundImage="url("+Editor.refreshImage+")",V.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(V,"click",function(ba){da();ba.preventDefault();mxEvent.consume(ba)}),Q.appendChild(V));b.commentsSaveNeeded()&&+(C=C.cloneNode(),C.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',C.setAttribute("title",mxResources.get("save")),C.className="geButton geAdaptiveAsset",mxEvent.addListener(C,"click",function(ba){n();ba.preventDefault();mxEvent.consume(ba)}),Q.appendChild(C));x.appendChild(Q);var aa=[],da=mxUtils.bind(this,function(){this.hasError=!1;if(null!=q)try{q.div=q.div.cloneNode(!0);var ba=q.div.querySelector(".geCommentEditTxtArea"),ha=q.div.querySelector(".geCommentEditBtns");q.comment.content=ba.value;ba.parentNode.removeChild(ba);ha.parentNode.removeChild(ha)}catch(qa){b.handleError(qa)}E.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";k=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(qa){function ra(l){if(null!=l){l.sort(function(H,J){return new Date(H.modifiedDate)-new Date(J.modifiedDate)});for(var t=0;t<l.length;t++)ra(l[t].replies)}}-qa.sort(function(l,t){return new Date(l.modifiedDate)-new Date(t.modifiedDate)});E.innerText="";E.appendChild(L);L.style.display="block";aa=qa;for(qa=0;qa<aa.length;qa++)ra(aa[qa].replies),c(aa[qa],aa,null,0,fa);null!=q&&null==q.comment.id&&null==q.comment.pCommentId&&(E.appendChild(q.div),C(q.comment,q.div,q.saveCallback,q.deleteOnCancel))},mxUtils.bind(this,function(qa){E.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(qa&&qa.message?": "+qa.message:""));this.hasError=!0})):E.innerHTML=+qa.sort(function(l,t){return new Date(l.modifiedDate)-new Date(t.modifiedDate)});E.innerText="";E.appendChild(L);L.style.display="block";aa=qa;for(qa=0;qa<aa.length;qa++)ra(aa[qa].replies),c(aa[qa],aa,null,0,fa);null!=q&&null==q.comment.id&&null==q.comment.pCommentId&&(E.appendChild(q.div),B(q.comment,q.div,q.saveCallback,q.deleteOnCancel))},mxUtils.bind(this,function(qa){E.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(qa&&qa.message?": "+qa.message:""));this.hasError=!0})):E.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});da();this.refreshComments=da;Q=mxUtils.bind(this,function(){function ba(t){var H=qa[t.id];if(null!=H)for(P(t,H),H=0;null!=t.replies&&H<t.replies.length;H++)ba(t.replies[H])}if(this.window.isVisible()){for(var ha=E.querySelectorAll(".geCommentDate"),qa={},ra=0;ra<ha.length;ra++){var l=ha[ra];qa[l.getAttribute("data-commentId")]=l}for(ra=0;ra<aa.length;ra++)ba(aa[ra])}});setInterval(Q,6E4);this.refreshCommentsTime=Q;this.window=new mxWindow(mxResources.get("comments"),-x,d,m,p,v,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,d,m,p,v,n,y,C,P,G,O){var U=document.createElement("div");U.style.textAlign="center";O=null!=O?O:44;var c=document.createElement("div");c.style.padding=+x,d,m,p,u,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,d,m,p,u,n,y,B,P,G,O){var U=document.createElement("div");U.style.textAlign="center";O=null!=O?O:44;var c=document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=O+"px";c.style.lineHeight="1.2em";mxUtils.write(c,d);U.appendChild(c);null!=G&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",d=document.createElement("img"),d.setAttribute("src",G),c.appendChild(d),U.appendChild(c));G=document.createElement("div");G.style.textAlign="center";G.style.whiteSpace="nowrap";var f=document.createElement("input");f.setAttribute("type","checkbox");n=mxUtils.button(n||mxResources.get("cancel"),function(){b.hideDialog();-null!=p&&p(f.checked)});n.className="geBtn";null!=C&&(n.innerHTML=C+"<br>"+n.innerHTML,n.style.display="inline-block",n.style.paddingBottom="8px",n.style.paddingTop="8px",n.style.height="auto",n.style.width="40%");b.editor.cancelFirst&&G.appendChild(n);var k=mxUtils.button(v||mxResources.get("ok"),function(){b.hideDialog();null!=m&&m(f.checked)});G.appendChild(k);null!=y?(k.innerHTML=y+"<br>"+k.innerHTML+"<br>",k.style.display="inline-block",k.style.paddingBottom="8px",k.style.paddingTop="8px",k.style.height=-"auto",k.className="geBtn",k.style.width="40%"):k.className="geBtn gePrimaryBtn";b.editor.cancelFirst||G.appendChild(n);U.appendChild(G);P?(G.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom="0px",c.appendChild(f),v=document.createElement("span"),mxUtils.write(v," "+mxResources.get("rememberThisSetting")),c.appendChild(v),U.appendChild(c),mxEvent.addListener(v,"click",function(q){f.checked=!f.checked;mxEvent.consume(q)})):G.style.marginTop="12px";+null!=p&&p(f.checked)});n.className="geBtn";null!=B&&(n.innerHTML=B+"<br>"+n.innerHTML,n.style.display="inline-block",n.style.paddingBottom="8px",n.style.paddingTop="8px",n.style.height="auto",n.style.width="40%");b.editor.cancelFirst&&G.appendChild(n);var k=mxUtils.button(u||mxResources.get("ok"),function(){b.hideDialog();null!=m&&m(f.checked)});G.appendChild(k);null!=y?(k.innerHTML=y+"<br>"+k.innerHTML+"<br>",k.style.display="inline-block",k.style.paddingBottom="8px",k.style.paddingTop="8px",k.style.height=+"auto",k.className="geBtn",k.style.width="40%"):k.className="geBtn gePrimaryBtn";b.editor.cancelFirst||G.appendChild(n);U.appendChild(G);P?(G.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom="0px",c.appendChild(f),u=document.createElement("span"),mxUtils.write(u," "+mxResources.get("rememberThisSetting")),c.appendChild(u),U.appendChild(c),mxEvent.addListener(u,"click",function(q){f.checked=!f.checked;mxEvent.consume(q)})):G.style.marginTop="12px";this.init=function(){k.focus()};this.container=U},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};HeadlessEditorUi.prototype.addTrees=function(){};HeadlessEditorUi.prototype.onBeforeUnload=function(){};HeadlessEditorUi.prototype.updateActionStates=function(){};function DiagramPage(b,d){this.node=b;null!=d?this.node.setAttribute("id",d):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.diagramModified=!1;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};-DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("name"):this.node.setAttribute("name",b)};DiagramPage.prototype.getViewBox=function(){var b=this.node.getAttribute("viewBox");if(null!=b){var d=b.split(" ");b=parseFloat(d[0]);var m=parseFloat(d[1]),p=parseFloat(d[2]),v=parseFloat(d[3]);d=4<d.length?parseFloat(d[4]):null;if(isFinite(b)&&isFinite(m)&&isFinite(p)&&isFinite(v)&&0<p&&0<v)return{x:b,y:m,width:p,height:v,scale:null!=d&&isFinite(d)&&0<d?d:null}}return null};+DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("name"):this.node.setAttribute("name",b)};DiagramPage.prototype.getViewBox=function(){var b=this.node.getAttribute("viewBox");if(null!=b){var d=b.split(" ");b=parseFloat(d[0]);var m=parseFloat(d[1]),p=parseFloat(d[2]),u=parseFloat(d[3]);d=4<d.length?parseFloat(d[4]):null;if(isFinite(b)&&isFinite(m)&&isFinite(p)&&isFinite(u)&&0<p&&0<u)return{x:b,y:m,width:p,height:u,scale:null!=d&&isFinite(d)&&0<d?d:null}}return null};DiagramPage.prototype.setViewBox=function(b){if(null==b)this.node.removeAttribute("viewBox");else{var d=b.x+" "+b.y+" "+b.width+" "+b.height;null!=b.scale&&(d+=" "+b.scale);this.node.setAttribute("viewBox",d)}};DiagramPage.prototype.setDiagramModified=function(b){this.diagramModified=b};DiagramPage.prototype.isDiagramModified=function(){return this.diagramModified};function RenamePage(b,d,m){this.ui=b;this.page=d;this.previous=this.name=m}RenamePage.prototype.execute=function(){var b=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function ChangePageView(b,d,m){this.ui=b;this.page=d;this.previous=this.viewBox=m}ChangePageView.prototype.execute=function(){var b=this.page.getViewBox();this.page.setViewBox(this.previous);this.viewBox=this.previous;this.previous=b;this.ui.editor.fireEvent(new mxEventObject("pageViewChanged"))};function MovePage(b,d,m){this.ui=b;this.oldIndex=d;this.newIndex=m}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var b=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};function SelectPage(b,d,m){this.ui=b;this.previousPage=this.page=d;null!=d&&(this.ui.updatePageRoot(d),null!=m&&(d.viewState=m))}SelectPage.prototype.execute=function(){var b=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=b){b=this.ui.currentPage;var d=this.ui.editor,m=d.graph;b.isDiagramModified()&&(b.setDiagramModified(!1),EditorUi.removeChildNodes(b.node),b.node.appendChild(d.getGraphXml(!0)));b.viewState=m.getViewState();b.root=m.model.root;null!=b.model&&b.model.rootChanged(b.root);m.view.clear(b.root,!0);m.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=b;b=this.ui.currentPage;-m.model.prefix=Editor.guid()+"-";m.model.rootChanged(b.root);m.setViewState(b.viewState);m.gridEnabled=m.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);d.graph.fireEvent(new mxEventObject(mxEvent.ROOT));d.fireEvent(new mxEventObject("pageSelected","change",this))}};function ChangePage(b,d,m,p,v){SelectPage.call(this,b,m);this.relatedPage=d;this.index=p;this.previousIndex=null;this.noSelect=v}mxUtils.extend(ChangePage,SelectPage);+m.model.prefix=Editor.guid()+"-";m.model.rootChanged(b.root);m.setViewState(b.viewState);m.gridEnabled=m.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);d.graph.fireEvent(new mxEventObject(mxEvent.ROOT));d.fireEvent(new mxEventObject("pageSelected","change",this))}};function ChangePage(b,d,m,p,u){SelectPage.call(this,b,m);this.relatedPage=d;this.index=p;this.previousIndex=null;this.noSelect=u}mxUtils.extend(ChangePage,SelectPage);ChangePage.prototype.execute=function(){this.ui.editor.fireEvent(new mxEventObject("beforePageChange","change",this));this.previousIndex=this.index;if(null==this.index){var b=mxUtils.indexOf(this.ui.pages,this.relatedPage);this.ui.pages.splice(b,1);this.index=b}else this.ui.pages.splice(this.index,0,this.relatedPage),this.index=null;this.noSelect||SelectPage.prototype.execute.apply(this,arguments)};function ReplaceDiagram(b,d){this.ui=b;this.data=d}ReplaceDiagram.prototype.execute=function(){var b=this.ui.editor.graph,d=this.ui.editor.getGraphXml();this.ui.editor.readGraphState(this.data);this.ui.editor.updateGraphComponents();var m=new mxCodec(this.data.ownerDocument),p=new mxGraphModel;m.decode(this.data,p);this.data=d;this.ui.currentPage&&(this.ui.currentPage.viewState=b.getViewState(),this.ui.currentPage.root=p.root,null!=this.ui.currentPage.model&&this.ui.currentPage.model.rootChanged(this.ui.currentPage.model.root));b.view.clear(b.model.root,!0);b.model.rootChanged(p.root);b.fireEvent(new mxEventObject(mxEvent.ROOT))};EditorUi.prototype.tabContainerVisible=!0;EditorUi.prototype.setTabContainerVisible=function(b,d){Editor.isSettingsEnabled()&&d&&(mxSettings.settings.pages=b,mxSettings.save());this.tabContainerVisible=b;this.updateTabContainer()};EditorUi.prototype.isTabContainerVisible=function(){return this.tabContainerVisible};EditorUi.prototype.getSelectedPageIndex=function(){return this.getPageIndex(this.currentPage)};EditorUi.prototype.getPageIndex=function(b){var d=null;if(null!=this.pages&&null!=b)for(var m=0;m<this.pages.length;m++)if(this.pages[m]==b){d=m;break}return d};EditorUi.prototype.getPageById=function(b,d){d=null!=d?d:this.pages;if(null!=d)for(var m=0;m<d.length;m++)if(d[m].getId()==b)return d[m];return null};-EditorUi.prototype.createImageForPageLink=function(b,d,m,p){var v=b.indexOf(","),n=null;0<v&&(v=this.getPageById(b.substring(v+1)),null!=v&&v!=d&&(n=this.getImageForPage(v,d,m,p),n.originalSrc=b));null==n&&(n={originalSrc:b});return n};+EditorUi.prototype.createImageForPageLink=function(b,d,m,p){var u=b.indexOf(","),n=null;0<u&&(u=this.getPageById(b.substring(u+1)),null!=u&&u!=d&&(n=this.getImageForPage(u,d,m,p),n.originalSrc=b));null==n&&(n={originalSrc:b});return n};EditorUi.prototype.pageSelected=function(){var b=this.editor.graph,d=this.currentPage;null!=d&&(b.tooltipHandler.hide(),null==d.viewState||null==d.viewState.scrollTop||null==d.viewState.scrollLeft?(b.selectUnlockedLayer(),this.resetScrollbars(),b.isLightboxView()?this.lightboxFit():Editor.fitDiagramOnPage&&this.fitInitialView(),null!=this.chromelessResize&&(b.container.scrollleft=0,b.container.scrollTop=0,this.chromelessResize())):b.setScrollbarPositions(d.viewState,b.view.translate.x,b.view.translate.y),this.updateTabContainer())};-EditorUi.prototype.getImageForPage=function(b,d,m,p){m=null!=m?m:this.editor.graph;var v=m.getGlobalVariable;m=this.createTemporaryGraph(m.getStylesheet());var n=this.getPageIndex(null!=d?d:this.currentPage);m.getGlobalVariable=function(C){return"pagenumber"==C?n+1:"page"==C&&null!=d?d.getName():v.apply(this,arguments)};document.body.appendChild(m.container);this.updatePageRoot(b);m.setAdaptiveColors(b.viewState.adaptiveColors);m.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText=+EditorUi.prototype.getImageForPage=function(b,d,m,p){m=null!=m?m:this.editor.graph;var u=m.getGlobalVariable;m=this.createTemporaryGraph(m.getStylesheet());var n=this.getPageIndex(null!=d?d:this.currentPage);m.getGlobalVariable=function(B){return"pagenumber"==B?n+1:"page"==B&&null!=d?d.getName():u.apply(this,arguments)};document.body.appendChild(m.container);this.updatePageRoot(b);m.setAdaptiveColors(b.viewState.adaptiveColors);m.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText="";p=m.getSvg(null,null,null,null,null,null,null,null,null,null,p,null,null,null,!0,!0);var y=m.getGraphBounds();document.body.removeChild(m.container);Graph.foreignObjectWarningText=b;return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(p)),y.width,y.height,y.x,y.y)};EditorUi.prototype.initPages=function(){if(!this.editor.graph.standalone){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.isPagesEnabled()&&(this.keyHandler.bindAction(33,!0,"previousPage",!0),this.keyHandler.bindAction(34,!0,"nextPage",!0));var b=this.editor.graph,d=b.view.validateBackground;b.view.validateBackground=mxUtils.bind(this,function(){d.apply(b.view,-arguments);null!=b.view.backgroundImage&&EditorUi.embedSvgImages(b.view.backgroundImage.node)});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(y,C){y=C.getProperty("edit").changes;for(C=0;C<y.length;C++)if(y[C]instanceof RenamePage||y[C]instanceof ChangePage||y[C]instanceof mxRootChange){this.updateTabContainer();break}null==this.currentPage||1==y.length&&y[0]instanceof SelectPage||this.currentPage.setDiagramModified(!0)}));var m=b.sizeDidChange,p=null,v=this;b.sizeDidChange=-function(){var y=m.apply(this,arguments);null!=v.currentPage&&p!=v.currentPage&&(p=v.currentPage,v.pageSelected());return y};b.addListener(mxEvent.ROOT,mxUtils.bind(this,function(){b.checkDefaultParent()}));var n=mxUtils.bind(this,function(){this.updateDocumentTitle();this.updateTabContainer()});this.addListener("currentThemeChanged",n);this.editor.addListener("pagesPatched",n);this.editor.addListener("pageRenamed",n);this.editor.addListener("pageMoved",n);this.editor.addListener("fileLoaded",n);-this.editor.addListener("pageSelected",mxUtils.bind(this,function(y,C){this.updateTabContainer();this.updateHashObject();this.updateDocumentTitle()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(y,C){this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}));this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTabContainer()}))}};+arguments);null!=b.view.backgroundImage&&EditorUi.embedSvgImages(b.view.backgroundImage.node)});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(y,B){y=B.getProperty("edit").changes;for(B=0;B<y.length;B++)if(y[B]instanceof RenamePage||y[B]instanceof ChangePage||y[B]instanceof mxRootChange){this.updateTabContainer();break}null==this.currentPage||1==y.length&&y[0]instanceof SelectPage||this.currentPage.setDiagramModified(!0)}));var m=b.sizeDidChange,p=null,u=this;b.sizeDidChange=+function(){var y=m.apply(this,arguments);null!=u.currentPage&&p!=u.currentPage&&(p=u.currentPage,u.pageSelected());return y};b.addListener(mxEvent.ROOT,mxUtils.bind(this,function(){b.checkDefaultParent()}));var n=mxUtils.bind(this,function(){this.updateDocumentTitle();this.updateTabContainer()});this.addListener("currentThemeChanged",n);this.editor.addListener("pagesPatched",n);this.editor.addListener("pageRenamed",n);this.editor.addListener("pageMoved",n);this.editor.addListener("fileLoaded",n);+this.editor.addListener("pageSelected",mxUtils.bind(this,function(y,B){this.updateTabContainer();this.updateHashObject();this.updateDocumentTitle()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(y,B){this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}));this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTabContainer()}))}};EditorUi.prototype.scrollToPage=function(b,d){var m=null!=b?this.getPageIndex(b):this.getSelectedPageIndex(),p=null!=b?b:this.currentPage;null!=m&&null!=this.tabScroller&&this.tabScroller.children.length>m&&null!=this.tabScroller.children[m]&&(p!=this.lastScrollPage||d)&&(this.tabScroller.children[m].scrollIntoView({block:"nearest",inline:null!=b?"nearest":"center"}),this.tabScroller.children[m].className="geTab gePageTab geActivePage",this.lastScrollPage=p,this.btKnownTabScroll=this.tabScroller.scrollLeft)};EditorUi.prototype.restoreViewState=function(b,d,m){b=null!=b?this.getPageById(b.getId()):null;var p=this.editor.graph;null!=b&&null!=this.currentPage&&null!=this.pages&&(b!=this.currentPage?this.selectPage(b,!0,d):(p.setViewState(d),this.editor.updateGraphComponents(),p.view.revalidate(),p.sizeDidChange()),p.container.scrollLeft=p.view.translate.x*p.view.scale+d.scrollLeft,p.container.scrollTop=p.view.translate.y*p.view.scale+d.scrollTop,p.restoreSelection(m))};-Graph.prototype.createViewState=function(b){var d=b.getAttribute("page"),m=parseFloat(b.getAttribute("pageScale")),p=parseFloat(b.getAttribute("pageWidth")),v=parseFloat(b.getAttribute("pageHeight")),n=b.getAttribute("background"),y=this.parseBackgroundImage(b.getAttribute("backgroundImage")),C=b.getAttribute("extFonts");if(C)try{C=C.split("|").map(function(P){P=P.split("^");return{name:P[0],url:P[1]}})}catch(P){console.log("ExtFonts format error: "+P.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),+Graph.prototype.createViewState=function(b){var d=b.getAttribute("page"),m=parseFloat(b.getAttribute("pageScale")),p=parseFloat(b.getAttribute("pageWidth")),u=parseFloat(b.getAttribute("pageHeight")),n=b.getAttribute("background"),y=this.parseBackgroundImage(b.getAttribute("backgroundImage")),B=b.getAttribute("extFonts");if(B)try{B=B.split("|").map(function(P){P=P.split("^");return{name:P[0],url:P[1]}})}catch(P){console.log("ExtFonts format error: "+P.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:function(){var P=b.getAttribute("fold");return null==P||null!=Editor.config&&null!=Editor.config.defaultFoldingEnabled?Graph.prototype.defaultFoldingEnabled:"0"!=P}(),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=d?"0"!=d:this.defaultPageVisible,background:null!=n&&0<n.length?n:null,backgroundImage:y,pageScale:isNaN(m)?mxGraph.prototype.pageScale:-m,pageFormat:isNaN(p)||isNaN(v)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat():new mxRectangle(0,0,p,v),tooltips:"0"!=b.getAttribute("tooltips"),connect:function(){var P=b.getAttribute("connect");return null==P||null!=Editor.config&&null!=Editor.config.defaultConnectable?Graph.prototype.defaultConnectable:"0"!=P}(),arrows:function(){var P=b.getAttribute("arrows");return null==P||null!=Editor.config&&null!=Editor.config.defaultConnectionArrowsEnabled?-Graph.prototype.defaultConnectionArrowsEnabled:"0"!=P}(),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:C||[]}};-Graph.prototype.saveViewState=function(b,d,m,p,v){m||(d.setAttribute("grid",(null==b?this.defaultGridEnabled:b.gridEnabled)?"1":"0"),d.setAttribute("page",(null==b?this.defaultPageVisible:b.pageVisible)?"1":"0"),d.setAttribute("gridSize",null!=b?b.gridSize:mxGraph.prototype.gridSize),d.setAttribute("guides",null==b||b.guidesEnabled?"1":"0"),d.setAttribute("tooltips",null==b||b.tooltips?"1":"0"),d.setAttribute("connect",null==b||b.connect?"1":"0"),d.setAttribute("arrows",null==b||b.arrows?"1":"0"),+m,pageFormat:isNaN(p)||isNaN(u)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat():new mxRectangle(0,0,p,u),tooltips:"0"!=b.getAttribute("tooltips"),connect:function(){var P=b.getAttribute("connect");return null==P||null!=Editor.config&&null!=Editor.config.defaultConnectable?Graph.prototype.defaultConnectable:"0"!=P}(),arrows:function(){var P=b.getAttribute("arrows");return null==P||null!=Editor.config&&null!=Editor.config.defaultConnectionArrowsEnabled?+Graph.prototype.defaultConnectionArrowsEnabled:"0"!=P}(),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:B||[]}};+Graph.prototype.saveViewState=function(b,d,m,p,u){m||(d.setAttribute("grid",(null==b?this.defaultGridEnabled:b.gridEnabled)?"1":"0"),d.setAttribute("page",(null==b?this.defaultPageVisible:b.pageVisible)?"1":"0"),d.setAttribute("gridSize",null!=b?b.gridSize:mxGraph.prototype.gridSize),d.setAttribute("guides",null==b||b.guidesEnabled?"1":"0"),d.setAttribute("tooltips",null==b||b.tooltips?"1":"0"),d.setAttribute("connect",null==b||b.connect?"1":"0"),d.setAttribute("arrows",null==b||b.arrows?"1":"0"),d.setAttribute("fold",null==b||b.foldingEnabled?"1":"0"));d.setAttribute("pageScale",null!=b&&null!=b.pageScale?b.pageScale:mxGraph.prototype.pageScale);m=null!=b?b.pageFormat:"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat();null!=m&&(d.setAttribute("pageWidth",m.width),d.setAttribute("pageHeight",m.height));null!=b&&(null!=b.background&&d.setAttribute("background",b.background),p=this.getBackgroundImageObject(b.backgroundImage,-p,v),null!=p&&d.setAttribute("backgroundImage",JSON.stringify(p)));d.setAttribute("math",(null==b?this.defaultMathEnabled:b.mathEnabled)?"1":"0");d.setAttribute("shadow",null!=b&&b.shadowVisible?"1":"0");null==b||null==b.adaptiveColors?d.removeAttribute("adaptiveColors"):d.setAttribute("adaptiveColors",b.adaptiveColors);null!=b&&null!=b.extFonts&&0<b.extFonts.length&&d.setAttribute("extFonts",b.extFonts.map(function(n){return n.name+"^"+n.url}).join("|"))};+p,u),null!=p&&d.setAttribute("backgroundImage",JSON.stringify(p)));d.setAttribute("math",(null==b?this.defaultMathEnabled:b.mathEnabled)?"1":"0");d.setAttribute("shadow",null!=b&&b.shadowVisible?"1":"0");null==b||null==b.adaptiveColors?d.removeAttribute("adaptiveColors"):d.setAttribute("adaptiveColors",b.adaptiveColors);null!=b&&null!=b.extFonts&&0<b.extFonts.length&&d.setAttribute("extFonts",b.extFonts.map(function(n){return n.name+"^"+n.url}).join("|"))};Graph.prototype.getViewState=function(){return{defaultParent:this.defaultParent,currentRoot:this.view.currentRoot,gridEnabled:this.gridEnabled,gridSize:this.gridSize,guidesEnabled:this.graphHandler.guidesEnabled,foldingEnabled:this.foldingEnabled,shadowVisible:this.shadowVisible,scrollbars:this.scrollbars,pageVisible:this.pageVisible,background:this.background,backgroundImage:this.backgroundImage,pageScale:this.pageScale,pageFormat:this.pageFormat,tooltips:this.tooltipHandler.isEnabled(),connect:this.connectionHandler.isEnabled(),arrows:this.connectionArrowsEnabled,scale:this.view.scale,scrollLeft:this.container.scrollLeft-this.view.translate.x*this.view.scale,scrollTop:this.container.scrollTop-this.view.translate.y*this.view.scale,translate:this.view.translate.clone(),lastPasteXml:this.lastPasteXml,pasteCounter:this.pasteCounter,mathEnabled:this.mathEnabled,adaptiveColors:this.adaptiveColors,hiddenTags:this.hiddenTags,extFonts:this.extFonts}};Graph.prototype.setViewState=function(b,d){if(null!=b){this.lastPasteXml=b.lastPasteXml;this.pasteCounter=b.pasteCounter||0;this.mathEnabled=b.mathEnabled;this.adaptiveColors=b.adaptiveColors;this.gridEnabled=null!=urlParams.grid?"0"!=urlParams.grid:b.gridEnabled;this.gridSize=b.gridSize;this.graphHandler.guidesEnabled=b.guidesEnabled;this.foldingEnabled=b.foldingEnabled;this.setShadowVisible(b.shadowVisible,!1);this.scrollbars=b.scrollbars;this.pageVisible=!this.isViewer()&&(null!=urlParams.pv?"0"!=@@ -4708,33 +4711,33 @@ p.parentNode.removeChild(p)}for(d=0;d<this.extFonts.length;d++)this.addExtFont(tthis.defaultGridEnabled,this.gridSize=mxGraph.prototype.gridSize,this.pageScale=mxGraph.prototype.pageScale,this.pageFormat="undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat(),this.pageVisible=this.defaultPageVisible,this.backgroundImage=this.background=null,this.scrollbars=this.defaultScrollbars,this.graphHandler.guidesEnabled=!0,this.foldingEnabled=this.defaultFoldingEnabled,this.setShadowVisible(!1,!1),this.defaultParent=null,this.setTooltips(!0),this.setConnectable(this.defaultConnectable),this.lastPasteXml=null,this.pasteCounter=0,this.mathEnabled=this.defaultMathEnabled,this.adaptiveColors=null,this.connectionArrowsEnabled=this.defaultConnectionArrowsEnabled,this.hiddenTags=[],this.extFonts=[];this.setAdaptiveColors(this.adaptiveColors);this.preferPageSize=this.pageBreaksVisible=this.pageVisible;this.fireEvent(new mxEventObject("viewStateChanged","state",b))};Graph.prototype.setScrollbarPositions=function(b,d,m){null!=b&&null!=b.scrollLeft&&null!=b.scrollTop&&(this.container.scrollLeft=d*this.view.scale+b.scrollLeft,this.container.scrollTop=m*this.view.scale+b.scrollTop)};-Graph.prototype.addExtFont=function(b,d,m){if(b&&d){var p="extFont_"+b;if(null==document.getElementById(p))if(0==d.indexOf(Editor.GOOGLE_FONTS))mxClient.link("stylesheet",d,null,p);else{document.getElementsByTagName("head");var v=document.createElement("style");v.appendChild(document.createTextNode('@font-face {\n\tfont-family: "'+b+'";\n\tsrc: url("'+d+'");\n}'));v.setAttribute("id",p);document.getElementsByTagName("head")[0].appendChild(v)}if(!m){null==this.extFonts&&(this.extFonts=[]);m=this.extFonts;-p=!0;for(v=0;v<m.length;v++)if(m[v].name==b){p=!1;break}p&&this.extFonts.push({name:b,url:d})}}};+Graph.prototype.addExtFont=function(b,d,m){if(b&&d){var p="extFont_"+b;if(null==document.getElementById(p))if(0==d.indexOf(Editor.GOOGLE_FONTS))mxClient.link("stylesheet",d,null,p);else{document.getElementsByTagName("head");var u=document.createElement("style");u.appendChild(document.createTextNode('@font-face {\n\tfont-family: "'+b+'";\n\tsrc: url("'+d+'");\n}'));u.setAttribute("id",p);document.getElementsByTagName("head")[0].appendChild(u)}if(!m){null==this.extFonts&&(this.extFonts=[]);m=this.extFonts;+p=!0;for(u=0;u<m.length;u++)if(m[u].name==b){p=!1;break}p&&this.extFonts.push({name:b,url:d})}}};EditorUi.prototype.updatePageRoot=function(b,d){if(null==b.root){d=this.editor.extractGraphModel(b.node,null,d);var m=Editor.extractParserError(d);if(m)throw Error(m);null!=d?(b.graphModelNode=d,b.viewState=this.editor.graph.createViewState(d),m=new mxCodec(d.ownerDocument),b.root=m.decode(d).root):(b.root=this.editor.graph.model.createRoot(),b.root.setId("0"),b.root.children[0].setId("1"),b.needsUpdate=!0)}else if(null==b.viewState){if(null==b.graphModelNode){d=this.editor.extractGraphModel(b.node);if(m=Editor.extractParserError(d))throw Error(m);null!=d&&(b.graphModelNode=d)}null!=b.graphModelNode&&(b.viewState=this.editor.graph.createViewState(b.graphModelNode))}if(null==b.root.children||0==b.root.children.length)d=new mxCell,d.setId("1"),b.root.insert(d),b.needsUpdate=!0;return b};EditorUi.prototype.getDiagramSnapshot=function(){return{node:this.editor.getGraphXml(),page:this.currentPage}};-EditorUi.prototype.updateDiagramData=function(b,d){if(null==this.getPageIndex(b.page))this.insertPage(null,null,d);else{var m=new mxCodec(b.node.ownerDocument),p=new mxGraphModel;m.decode(b.node,p);m=new mxCodec(d.ownerDocument);var v=new mxGraphModel;m.decode(d,v);this.selectPage(b.page);d=this.diffCells(p.root,v.root);this.patchPage(b.page,d,null,!0)}};EditorUi.prototype.replaceDiagramData=function(b){this.editor.graph.model.execute(new ReplaceDiagram(this,mxUtils.parseXml(b).documentElement))};-EditorUi.prototype.selectPage=function(b,d,m){try{if(b!=this.currentPage){var p=this.editor.graph;p.isEditing()&&p.stopEditing(!1);d=null!=d?d:!1;p.isMouseDown=!1;p.reset();var v=p.model.createUndoableEdit();v.ignoreEdit=!0;var n=new SelectPage(this,b,m);n.execute();v.add(n);v.notify();d||p.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",v))}}catch(y){this.handleError(y)}};+EditorUi.prototype.updateDiagramData=function(b,d){if(null==this.getPageIndex(b.page))this.insertPage(null,null,d);else{var m=new mxCodec(b.node.ownerDocument),p=new mxGraphModel;m.decode(b.node,p);m=new mxCodec(d.ownerDocument);var u=new mxGraphModel;m.decode(d,u);this.selectPage(b.page);d=this.diffCells(p.root,u.root);this.patchPage(b.page,d,null,!0)}};EditorUi.prototype.replaceDiagramData=function(b){this.editor.graph.model.execute(new ReplaceDiagram(this,mxUtils.parseXml(b).documentElement))};+EditorUi.prototype.selectPage=function(b,d,m){try{if(b!=this.currentPage){var p=this.editor.graph;p.isEditing()&&p.stopEditing(!1);d=null!=d?d:!1;p.isMouseDown=!1;p.reset();var u=p.model.createUndoableEdit();u.ignoreEdit=!0;var n=new SelectPage(this,b,m);n.execute();u.add(n);u.notify();d||p.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",u))}}catch(y){this.handleError(y)}};EditorUi.prototype.selectNextPage=function(b){var d=this.currentPage;null!=d&&null!=this.pages&&(d=mxUtils.indexOf(this.pages,d),b?this.selectPage(this.pages[mxUtils.mod(d+1,this.pages.length)]):b||this.selectPage(this.pages[mxUtils.mod(d-1,this.pages.length)]))};EditorUi.prototype.insertPage=function(b,d,m){this.editor.graph.isEnabled()&&(this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1),b=null!=b?b:this.createPage(null,this.createPageId(),m),d=null!=d?d:this.pages.length,d=new ChangePage(this,b,b,d),this.editor.graph.model.execute(d));return b};EditorUi.prototype.createPageId=function(){do var b=Editor.guid();while(null!=this.getPageById(b));return b};EditorUi.prototype.createPage=function(b,d,m){d=new DiagramPage((null!=this.fileNode?this.fileNode.ownerDocument:document).createElement("diagram"),d);d.setName(null!=b?b:this.createPageName());this.initDiagramNode(d,m);return d};EditorUi.prototype.createPageName=function(){for(var b={},d=0;d<this.pages.length;d++){var m=this.pages[d].getName();null!=m&&0<m.length&&(b[m]=m)}d=this.pages.length;do m=mxResources.get("pageWithNumber",[++d]);while(null!=b[m]);return m};-EditorUi.prototype.removePage=function(b){try{var d=this.editor.graph,m=mxUtils.indexOf(this.pages,b);if(d.isEnabled()&&0<=m){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);d.model.beginUpdate();try{var p=this.currentPage;p==b&&1<this.pages.length?(m==this.pages.length-1?m--:m++,p=this.pages[m]):1>=this.pages.length&&(p=this.insertPage(),d.model.execute(new RenamePage(this,p,mxResources.get("pageWithNumber",[1]))));d.model.execute(new ChangePage(this,b,p))}finally{d.model.endUpdate()}}}catch(v){this.handleError(v)}return b};-EditorUi.prototype.duplicatePage=function(b,d){var m=null;try{var p=this.editor.graph;if(p.isEnabled()){p.isEditing()&&p.stopEditing();var v=b.node.cloneNode(!1);v.removeAttribute("id");var n={},y=p.createCellLookup([p.model.root]);m=new DiagramPage(v);m.root=p.cloneCell(p.model.root,null,n);var C=new mxGraphModel;C.prefix=Editor.guid()+"-";C.setRoot(m.root);p.updateCustomLinks(p.createCellMapping(n,y),[m.root]);m.viewState=b==this.currentPage?p.getViewState():b.viewState;this.initDiagramNode(m);+EditorUi.prototype.removePage=function(b){try{var d=this.editor.graph,m=mxUtils.indexOf(this.pages,b);if(d.isEnabled()&&0<=m){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);d.model.beginUpdate();try{var p=this.currentPage;p==b&&1<this.pages.length?(m==this.pages.length-1?m--:m++,p=this.pages[m]):1>=this.pages.length&&(p=this.insertPage(),d.model.execute(new RenamePage(this,p,mxResources.get("pageWithNumber",[1]))));d.model.execute(new ChangePage(this,b,p))}finally{d.model.endUpdate()}}}catch(u){this.handleError(u)}return b};+EditorUi.prototype.duplicatePage=function(b,d){var m=null;try{var p=this.editor.graph;if(p.isEnabled()){p.isEditing()&&p.stopEditing();var u=b.node.cloneNode(!1);u.removeAttribute("id");var n={},y=p.createCellLookup([p.model.root]);m=new DiagramPage(u);m.root=p.cloneCell(p.model.root,null,n);var B=new mxGraphModel;B.prefix=Editor.guid()+"-";B.setRoot(m.root);p.updateCustomLinks(p.createCellMapping(n,y),[m.root]);m.viewState=b==this.currentPage?p.getViewState():b.viewState;this.initDiagramNode(m);m.viewState.scale=1;delete m.viewState.scrollLeft;delete m.viewState.scrollTop;delete m.viewState.currentRoot;delete m.viewState.defaultParent;m.setName(d);m=this.insertPage(m,mxUtils.indexOf(this.pages,b)+1)}}catch(P){this.handleError(P)}return m};EditorUi.prototype.initDiagramNode=function(b,d){null==d&&(d=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,d);EditorUi.removeChildNodes(b.node);b.node.appendChild(d)};-EditorUi.prototype.clonePages=function(b){for(var d=[],m=[],p=0;p<b.length;p++)try{m.push(this.clonePage(b[p]))}catch(v){d.push(mxResources.get("pageWithNumber",[p+1])+": "+v.toString())}if(0<d.length){b=Error(d.join("\n"));try{0<m.length&&(b.fallbackFileData=this.getXmlForPages(m))}catch(v){}throw b;}return m};+EditorUi.prototype.clonePages=function(b){for(var d=[],m=[],p=0;p<b.length;p++)try{m.push(this.clonePage(b[p]))}catch(u){d.push(mxResources.get("pageWithNumber",[p+1])+": "+u.toString())}if(0<d.length){b=Error(d.join("\n"));try{0<m.length&&(b.fallbackFileData=this.getXmlForPages(m))}catch(u){}throw b;}return m};EditorUi.prototype.clonePage=function(b){this.updatePageRoot(b);var d=new DiagramPage(b.node.cloneNode(!0)),m=b==this.currentPage?this.editor.graph.getViewState():b.viewState;d.viewState=mxUtils.clone(m,EditorUi.transientViewStateProperties);d.root=this.editor.graph.model.cloneCell(b.root,null,!0);d.diagramModified=b.diagramModified;return d};EditorUi.prototype.renamePage=function(b){if(this.editor.graph.isEnabled()){var d=new FilenameDialog(this,b.getName(),mxResources.get("rename"),mxUtils.bind(this,function(m){null!=m&&0<m.length&&this.editor.graph.model.execute(new RenamePage(this,b,m))}),mxResources.get("rename"));this.showDialog(d.container,300,80,!0,!0);d.init()}return b};EditorUi.prototype.movePage=function(b,d){this.editor.graph.model.execute(new MovePage(this,b,d))};-EditorUi.prototype.sortPages=function(){var b=this.pages.slice().sort(function(v,n){return(v.getName()||"").localeCompare(n.getName()||"",void 0,{numeric:!0,sensitivity:"base"})}),d=this.editor.graph.model;d.beginUpdate();try{for(var m=0;m<b.length;m++){var p=mxUtils.indexOf(this.pages,b[m]);p!=m&&this.movePage(p,m)}}finally{d.endUpdate()}this.scrollToPage(this.currentPage,!0)};+EditorUi.prototype.sortPages=function(){var b=this.pages.slice().sort(function(u,n){return(u.getName()||"").localeCompare(n.getName()||"",void 0,{numeric:!0,sensitivity:"base"})}),d=this.editor.graph.model;d.beginUpdate();try{for(var m=0;m<b.length;m++){var p=mxUtils.indexOf(this.pages,b[m]);p!=m&&this.movePage(p,m)}}finally{d.endUpdate()}this.scrollToPage(this.currentPage,!0)};EditorUi.prototype.createTabContainer=function(){var b=document.createElement("div");b.className="geTabContainer geTabItem";return b};-EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&!this.isTabContainerVisible())this.tabContainer.style.display="none";else if(null!=this.tabContainer&&null!=this.pages){this.tabContainer.style.display="";var b=this.editor.graph,d=document.createElement("div");d.className="geTabScroller";for(var m=null,p=null,v=null,n=this,y=null!=this.tabScroller?this.tabScroller.scrollLeft:0,C=!1,P=0;P<this.pages.length;P++){var G=this.pages[P];if(null!=G){var O=G.getId(),U=G.getName()||-mxResources.get("untitled"),c=O+":"+U;c=null!=this.btPageTabCache?this.btPageTabCache[c]:null;null!=c?c.setAttribute("title",U+(null!=O?" ("+O+")":"")+" ["+(P+1)+"]"):(c=this.createTabForPage(G,P+1),C=!0);c.setAttribute("draggable","true");c.setAttribute("data-index",P);c.className="geTab gePageTab";null==c.btDndInstalled&&(c.btDndInstalled=!0,mxEvent.addListener(c,"dragstart",mxUtils.bind(this,function(q){b.isEnabled()?(mxClient.IS_FF&&q.dataTransfer.setData("Text","<diagram/>"),m=parseInt(q.currentTarget.getAttribute("data-index"),+EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&!this.isTabContainerVisible())this.tabContainer.style.display="none";else if(null!=this.tabContainer&&null!=this.pages){this.tabContainer.style.display="";var b=this.editor.graph,d=document.createElement("div");d.className="geTabScroller";for(var m=null,p=null,u=null,n=this,y=null!=this.tabScroller?this.tabScroller.scrollLeft:0,B=!1,P=0;P<this.pages.length;P++){var G=this.pages[P];if(null!=G){var O=G.getId(),U=G.getName()||+mxResources.get("untitled"),c=O+":"+U;c=null!=this.btPageTabCache?this.btPageTabCache[c]:null;null!=c?c.setAttribute("title",U+(null!=O?" ("+O+")":"")+" ["+(P+1)+"]"):(c=this.createTabForPage(G,P+1),B=!0);c.setAttribute("draggable","true");c.setAttribute("data-index",P);c.className="geTab gePageTab";null==c.btDndInstalled&&(c.btDndInstalled=!0,mxEvent.addListener(c,"dragstart",mxUtils.bind(this,function(q){b.isEnabled()?(mxClient.IS_FF&&q.dataTransfer.setData("Text","<diagram/>"),m=parseInt(q.currentTarget.getAttribute("data-index"),10),p=q.currentTarget,window.requestAnimationFrame(function(){null!=p&&p.classList.add("gePageTabDragPlaceholder")}),n._pageTabDragOverHandler=function(x){x.dataTransfer.dropEffect="move";x.preventDefault();x.target.classList&&x.target.classList.contains("gePageTab")||x.stopPropagation()},n._pageTabDropHandler=function(x){x.preventDefault();x.stopPropagation()},document.addEventListener("dragover",n._pageTabDragOverHandler,!0),document.addEventListener("drop",n._pageTabDropHandler,!0)):mxEvent.consume(q)})),-mxEvent.addListener(c,"dragend",mxUtils.bind(this,function(q){if(null!=p){p.classList.remove("gePageTabDragPlaceholder");for(var x=p.parentNode.querySelectorAll(".gePageTab"),B=0,E=0;E<x.length;E++)if(x[E]==p){B=E;break}null!=m&&B!=m&&this.movePage(m,B)}null!=n._pageTabDragOverHandler&&(document.removeEventListener("dragover",n._pageTabDragOverHandler,!0),document.removeEventListener("drop",n._pageTabDropHandler,!0),n._pageTabDragOverHandler=null,n._pageTabDropHandler=null);p=m=null;q.stopPropagation();-q.preventDefault()})),mxEvent.addListener(c,"dragover",function(q){if(null!=m&&null!=p){q.dataTransfer.dropEffect="move";var x=q.currentTarget;if(x!=p){var B=x.getBoundingClientRect(),E=p.parentNode;q.clientX<B.left+B.width/2?E.insertBefore(p,x):x.nextSibling!=p&&E.insertBefore(p,x.nextSibling)}}q.stopPropagation();q.preventDefault()}),mxEvent.addListener(c,"drop",function(q){q.stopPropagation();q.preventDefault()}));G==this.currentPage&&(v=c);d.appendChild(c)}}this.tabContainer.innerText="";this.isPageInsertTabVisible()&&+mxEvent.addListener(c,"dragend",mxUtils.bind(this,function(q){if(null!=p){p.classList.remove("gePageTabDragPlaceholder");for(var x=p.parentNode.querySelectorAll(".gePageTab"),C=0,E=0;E<x.length;E++)if(x[E]==p){C=E;break}null!=m&&C!=m&&this.movePage(m,C)}null!=n._pageTabDragOverHandler&&(document.removeEventListener("dragover",n._pageTabDragOverHandler,!0),document.removeEventListener("drop",n._pageTabDropHandler,!0),n._pageTabDragOverHandler=null,n._pageTabDropHandler=null);p=m=null;q.stopPropagation();+q.preventDefault()})),mxEvent.addListener(c,"dragover",function(q){if(null!=m&&null!=p){q.dataTransfer.dropEffect="move";var x=q.currentTarget;if(x!=p){var C=x.getBoundingClientRect(),E=p.parentNode;q.clientX<C.left+C.width/2?E.insertBefore(p,x):x.nextSibling!=p&&E.insertBefore(p,x.nextSibling)}}q.stopPropagation();q.preventDefault()}),mxEvent.addListener(c,"drop",function(q){q.stopPropagation();q.preventDefault()}));G==this.currentPage&&(u=c);d.appendChild(c)}}this.tabContainer.innerText="";this.isPageInsertTabVisible()&&this.tabContainer.appendChild(this.createPageInsertTab());"simple"!=Editor.currentTheme&&(this.pageMenuTab=this.createPageMenuTab(),this.tabContainer.appendChild(this.pageMenuTab));this.tabContainer.appendChild(d);this.leftScrollTab=this.createLeftScrollTab();this.tabContainer.appendChild(this.leftScrollTab);this.rightScrollTab=this.createRightScrollTab();this.tabContainer.appendChild(this.rightScrollTab);if(Graph.browserTranslate&&Graph.isBrowserTranslated())for(this.btPageTabCache={},P=0;P<d.children.length;P++)G=null!=this.pages&&P<this.pages.length?this.pages[P]:null,null!=G&&(G=G.getId()+":"+(G.getName()||mxResources.get("untitled")),this.btPageTabCache[G]=d.children[P]);this.tabScroller=d;mxEvent.addListener(this.tabScroller,"scroll",mxUtils.bind(this,function(q){this.checkTabScrollerOverflow()}));if(Graph.browserTranslate&&Graph.isBrowserTranslated()){if(null==this.btCanary){n=this;this.btCanary=document.createElement("p");this.btCanary.setAttribute("aria-hidden","true");this.btCanary.style.cssText="position:absolute;left:-10000px;top:0;width:1px;height:1px;overflow:hidden;pointer-events:none;";this.btCanaryOriginal="Click here to insert a new page into the document";this.btCanary.textContent=this.btCanaryOriginal;document.body.appendChild(this.btCanary);this.btCanarySavedScroll=null;var f=function(){null!=n.btCanarySavedScroll&&null!=n.tabScroller&&(n.btCanarySavedScroll=null,n.scrollToPage(null,!0))};this.btCanaryObserver=new MutationObserver(function(){null!=n.btCanarySavedScroll&&n.btCanary.textContent!=n.btCanaryOriginal&&setTimeout(f,100)});this.btCanaryObserver.observe(this.btCanary,-{characterData:!0,childList:!0,subtree:!0})}null==this.btCanarySavedScroll&&C&&0<this.btKnownTabScroll&&(this.btCanarySavedScroll=this.btKnownTabScroll,this.btCanary.textContent=this.btCanaryOriginal,document.body.appendChild(this.btCanary))}var k=document.createElement("a");k.href="https://github.com/jgraph/drawio";k.target="_blank";k.style.cssText="margin-left:auto;display:flex;align-items:center;padding:0 8px;opacity:0.5;flex-shrink:0";d=document.createElement("img");d.src=IMAGE_PATH+(Editor.isDarkMode()?-"/github-logo-white.svg":"/github-logo.svg");d.style.cssText="width:18px;height:18px";d.setAttribute("title","jgraph/drawio");k.appendChild(d);mxEvent.addListener(k,"mouseenter",function(){k.style.opacity="1"});mxEvent.addListener(k,"mouseleave",function(){k.style.opacity="0.5"});this.tabContainer.appendChild(k);null!=v&&v.classList.add("geActivePage");this.tabScroller.scrollLeft=y;this.scrollToPage();this.btKnownTabScroll=this.tabScroller.scrollLeft;this.checkTabScrollerOverflow();null!=v&&v.scrollIntoView({behavior:"smooth",+{characterData:!0,childList:!0,subtree:!0})}null==this.btCanarySavedScroll&&B&&0<this.btKnownTabScroll&&(this.btCanarySavedScroll=this.btKnownTabScroll,this.btCanary.textContent=this.btCanaryOriginal,document.body.appendChild(this.btCanary))}var k=document.createElement("a");k.href="https://github.com/jgraph/drawio";k.target="_blank";k.style.cssText="margin-left:auto;display:flex;align-items:center;padding:0 8px;opacity:0.5;flex-shrink:0";d=document.createElement("img");d.src=IMAGE_PATH+(Editor.isDarkMode()?+"/github-logo-white.svg":"/github-logo.svg");d.style.cssText="width:18px;height:18px";d.setAttribute("title","jgraph/drawio");k.appendChild(d);mxEvent.addListener(k,"mouseenter",function(){k.style.opacity="1"});mxEvent.addListener(k,"mouseleave",function(){k.style.opacity="0.5"});this.tabContainer.appendChild(k);null!=u&&u.classList.add("geActivePage");this.tabScroller.scrollLeft=y;this.scrollToPage();this.btKnownTabScroll=this.tabScroller.scrollLeft;this.checkTabScrollerOverflow();null!=u&&u.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}};EditorUi.prototype.checkTabScrollerOverflow=function(){null!=this.tabScroller&&null!=this.tabContainer&&2<this.tabContainer.children.length&&(this.tabScroller.scrollWidth>this.tabScroller.offsetWidth?(this.leftScrollTab.style.display="",this.rightScrollTab.style.display="",0==this.tabScroller.scrollLeft?this.leftScrollTab.classList.add("mxDisabled"):this.leftScrollTab.classList.remove("mxDisabled"),Math.ceil(this.tabScroller.scrollLeft)+this.tabScroller.offsetWidth>=this.tabScroller.scrollWidth?this.rightScrollTab.classList.add("mxDisabled"):this.rightScrollTab.classList.remove("mxDisabled")):(this.leftScrollTab.style.display="none",this.rightScrollTab.style.display="none"))};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};@@ -4742,61 +4745,61 @@ EditorUi.prototype.createTab=function(){var b=document.createElement("div");b.clEditorUi.prototype.createControlTab=function(b,d,m){var p=this.createTab();p.className="geTab geControlTab";null!=b&&p.setAttribute("title",b);b=document.createElement("div");b.className="geButton";b.style.backgroundImage="url("+d+")";p.appendChild(b);mxEvent.addListener(p,"click",m);return p};EditorUi.prototype.createPageInsertTab=function(){return this.createControlTab(mxResources.get("insertPage"),Editor.plusImage,mxUtils.bind(this,function(b){this.actions.get("insertPage").funct();mxEvent.consume(b)}))};EditorUi.prototype.createLeftScrollTab=function(){return this.createControlTab(null,Editor.chevronLeftImage,mxUtils.bind(this,function(b){var d=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:-d,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft-=d;mxEvent.consume(b)}))};EditorUi.prototype.createRightScrollTab=function(){return this.createControlTab(null,Editor.chevronRightImage,mxUtils.bind(this,function(b){var d=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:d,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft+=d;mxEvent.consume(b)}))};-EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var d=new mxPopupMenu(mxUtils.bind(this,function(v,n){this.menus.get("pages").funct(v,n)}));d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);d.destroy()});var m=mxEvent.getClientX(b),p=mxEvent.getClientY(b);d.popup(m,-p,null,b);this.setCurrentMenu(d);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,d){var m=this.createTab(),p=b.getName()||mxResources.get("untitled"),v=b.getId();m.setAttribute("title",p+(null!=v?" ("+v+")":"")+" ["+d+"]");d=document.createElement("span");d.style.maxWidth="160px";d.style.textOverflow="ellipsis";d.style.overflow="hidden";mxUtils.write(d,p);m.appendChild(d);this.addTabListeners(b,m);return m};-EditorUi.prototype.addTabListeners=function(b,d){mxEvent.disableContextMenu(d);var m=this.editor.graph;mxEvent.addListener(d,"dblclick",mxUtils.bind(this,function(P){this.renamePage(b);mxEvent.consume(P)}));var p=document.createElement("div");p.style.backgroundImage="url("+Editor.thinExpandImage+")";p.className="geButton";d.appendChild(p);var v=!1,n=!1,y=mxUtils.bind(this,function(P){v=null!=this.currentMenu;n=b==this.currentPage;this.scrollToPage(b);m.isMouseDown||n||this.selectPage(b)}),C=mxUtils.bind(this,-function(P){if(!m.isMouseDown&&(n&&(mxEvent.isTouchEvent(P)||mxEvent.getSource(P)==p)||mxEvent.isPopupTrigger(P))&&(m.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(P)||!v)){var G=new mxPopupMenu(this.createPageMenu(b));G.smartSeparators=!0;G.showDisabled=!0;G.autoExpand=!0;G.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(G,arguments);this.resetCurrentMenu();G.destroy()});var O=mxEvent.getClientX(P),U=mxEvent.getClientY(P);G.popup(O,U,null,P);-this.setCurrentMenu(G,d)}mxEvent.consume(P)});mxEvent.addGestureListeners(p,y,null,C);mxEvent.addGestureListeners(d,y,null,C)};+EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var d=new mxPopupMenu(mxUtils.bind(this,function(u,n){this.menus.get("pages").funct(u,n)}));d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);d.destroy()});var m=mxEvent.getClientX(b),p=mxEvent.getClientY(b);d.popup(m,+p,null,b);this.setCurrentMenu(d);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,d){var m=this.createTab(),p=b.getName()||mxResources.get("untitled"),u=b.getId();m.setAttribute("title",p+(null!=u?" ("+u+")":"")+" ["+d+"]");d=document.createElement("span");d.style.maxWidth="160px";d.style.textOverflow="ellipsis";d.style.overflow="hidden";mxUtils.write(d,p);m.appendChild(d);this.addTabListeners(b,m);return m};+EditorUi.prototype.addTabListeners=function(b,d){mxEvent.disableContextMenu(d);var m=this.editor.graph;mxEvent.addListener(d,"dblclick",mxUtils.bind(this,function(P){this.renamePage(b);mxEvent.consume(P)}));var p=document.createElement("div");p.style.backgroundImage="url("+Editor.thinExpandImage+")";p.className="geButton";d.appendChild(p);var u=!1,n=!1,y=mxUtils.bind(this,function(P){u=null!=this.currentMenu;n=b==this.currentPage;this.scrollToPage(b);m.isMouseDown||n||this.selectPage(b)}),B=mxUtils.bind(this,+function(P){if(!m.isMouseDown&&(n&&(mxEvent.isTouchEvent(P)||mxEvent.getSource(P)==p)||mxEvent.isPopupTrigger(P))&&(m.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(P)||!u)){var G=new mxPopupMenu(this.createPageMenu(b));G.smartSeparators=!0;G.showDisabled=!0;G.autoExpand=!0;G.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(G,arguments);this.resetCurrentMenu();G.destroy()});var O=mxEvent.getClientX(P),U=mxEvent.getClientY(P);G.popup(O,U,null,P);+this.setCurrentMenu(G,d)}mxEvent.consume(P)});mxEvent.addGestureListeners(p,y,null,B);mxEvent.addGestureListeners(d,y,null,B)};EditorUi.prototype.createPageMenu=function(b,d){return mxUtils.bind(this,function(m,p){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||navigator.standalone||m.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,!0,!0))}),p));this.editor.graph.isEnabled()&&(this.menus.addMenuItems(m,["duplicatePage","-"],p),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",-m,p,mxResources.get("move")),this.menus.addMenuItems(m,["removePage","renamePage"],p))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(p,v,n,y,C){v=null!=v?v:!1;null==n&&(n=this.getFoldableCells(this.getSelectionCells(),p));this.stopEditing();this.model.beginUpdate();try{for(var P=n.slice(),G=0;G<n.length;G++)"1"==mxUtils.getValue(this.getCurrentCellStyle(n[G]),"treeFolding","0")&&this.foldTreeCell(p,n[G]);n=P;n=b.apply(this,arguments)}finally{this.model.endUpdate()}return n};Graph.prototype.foldTreeCell=function(p,v){this.model.beginUpdate();try{var n=-[];this.traverse(v,!0,mxUtils.bind(this,function(C,P){var G=null!=P&&this.isTreeEdge(P);G&&n.push(P);C==v||null!=P&&!G||n.push(C);return(null==P||G)&&(C==v||!this.model.isCollapsed(C))}));this.model.setCollapsed(v,p);for(var y=0;y<n.length;y++)this.model.setVisible(n[y],!p)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(p){return!this.isEdgeIgnored(p)};Graph.prototype.getTreeEdges=function(p,v,n,y,C,P){return this.model.filterCells(this.getEdges(p,v,n,y,C,P),mxUtils.bind(this,-function(G){return this.isTreeEdge(G)}))};Graph.prototype.getIncomingTreeEdges=function(p,v){return this.getTreeEdges(p,v,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(p,v){return this.getTreeEdges(p,v,!1,!0,!1)};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function p(t){return L.isVertex(t)&&n(t)}function v(t){var H=!1;null!=t&&(H="1"==-E.getCurrentCellStyle(t).treeMoving);return H}function n(t){var H=!1;null!=t&&(t=L.getParent(t),H=E.view.getState(t),H="tree"==(null!=H?H.style:E.getCellStyle(t)).containerType);return H}function y(t){for(;null!=t&&!n(t);)t=L.getParent(t);return null!=t?L.getParent(t):null}function C(t){var H=!1;null!=t&&(t=L.getParent(t),H=E.view.getState(t),E.view.getState(t),H=null!=(null!=H?H.style:E.getCellStyle(t)).childLayout);return H}function P(t,H){function J(ja,na){null!=ja&&(T.cut.get(ja)||(T.cut.put(ja,-!0),T.cells.push(ja)),na&&!Y.get(ja)&&(Y.put(ja,!0),Z.push(ja)))}function R(ja){if(!T.deleted.get(ja)){T.deleted.put(ja,!0);T.cells.push(ja);ja=E.getAllEdges([ja]);for(var na=0;na<ja.length;na++)J(ja[na],!0)}}for(var T={cells:[],deleted:new mxDictionary,cut:new mxDictionary,cascaded:[]},Y=new mxDictionary,Z=[],ia=0;ia<t.length;ia++){var ka=t[ia];L.isEdge(ka)?J(ka,!1):L.isVertex(ka)&&null!=y(ka)?R(ka):null!=ka&&T.cells.push(ka)}for(;0<Z.length;)if(t=L.getTerminal(Z.shift(),!1),null!=t&&!T.deleted.get(t)&&-L.isVertex(t)&&(ia=y(t),null!=ia&&(null==H||!H.get(ia)))){ia=E.getIncomingTreeEdges(t);ka=!0;for(var X=0;X<ia.length;X++)if(!T.cut.get(ia[X])){ka=!1;break}ka&&(T.cascaded.push(t),R(t))}return T}function G(t){t=E.view.getState(t);if(null!=t){var H=E.getIncomingTreeEdges(t.cell);if(0<H.length&&(H=E.view.getState(H[0]),null!=H&&(H=H.absolutePoints,null!=H&&0<H.length&&(H=H[H.length-1],null!=H)))){if(H.y==t.y&&Math.abs(H.x-t.getCenterX())<t.width/2)return mxConstants.DIRECTION_SOUTH;if(H.y==t.y+t.height&&+m,p,mxResources.get("move")),this.menus.addMenuItems(m,["removePage","renamePage"],p))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(p,u,n,y,B){u=null!=u?u:!1;null==n&&(n=this.getFoldableCells(this.getSelectionCells(),p));this.stopEditing();this.model.beginUpdate();try{for(var P=n.slice(),G=0;G<n.length;G++)"1"==mxUtils.getValue(this.getCurrentCellStyle(n[G]),"treeFolding","0")&&this.foldTreeCell(p,n[G]);n=P;n=b.apply(this,arguments)}finally{this.model.endUpdate()}return n};Graph.prototype.foldTreeCell=function(p,u){this.model.beginUpdate();try{var n=+[];this.traverse(u,!0,mxUtils.bind(this,function(B,P){var G=null!=P&&this.isTreeEdge(P);G&&n.push(P);B==u||null!=P&&!G||n.push(B);return(null==P||G)&&(B==u||!this.model.isCollapsed(B))}));this.model.setCollapsed(u,p);for(var y=0;y<n.length;y++)this.model.setVisible(n[y],!p)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(p){return!this.isEdgeIgnored(p)};Graph.prototype.getTreeEdges=function(p,u,n,y,B,P){return this.model.filterCells(this.getEdges(p,u,n,y,B,P),mxUtils.bind(this,+function(G){return this.isTreeEdge(G)}))};Graph.prototype.getIncomingTreeEdges=function(p,u){return this.getTreeEdges(p,u,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(p,u){return this.getTreeEdges(p,u,!1,!0,!1)};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function p(t){return L.isVertex(t)&&n(t)}function u(t){var H=!1;null!=t&&(H="1"==+E.getCurrentCellStyle(t).treeMoving);return H}function n(t){var H=!1;null!=t&&(t=L.getParent(t),H=E.view.getState(t),H="tree"==(null!=H?H.style:E.getCellStyle(t)).containerType);return H}function y(t){for(;null!=t&&!n(t);)t=L.getParent(t);return null!=t?L.getParent(t):null}function B(t){var H=!1;null!=t&&(t=L.getParent(t),H=E.view.getState(t),E.view.getState(t),H=null!=(null!=H?H.style:E.getCellStyle(t)).childLayout);return H}function P(t,H){function J(ka,na){null!=ka&&(T.cut.get(ka)||(T.cut.put(ka,+!0),T.cells.push(ka)),na&&!Y.get(ka)&&(Y.put(ka,!0),Z.push(ka)))}function R(ka){if(!T.deleted.get(ka)){T.deleted.put(ka,!0);T.cells.push(ka);ka=E.getAllEdges([ka]);for(var na=0;na<ka.length;na++)J(ka[na],!0)}}for(var T={cells:[],deleted:new mxDictionary,cut:new mxDictionary,cascaded:[]},Y=new mxDictionary,Z=[],ia=0;ia<t.length;ia++){var ja=t[ia];L.isEdge(ja)?J(ja,!1):L.isVertex(ja)&&null!=y(ja)?R(ja):null!=ja&&T.cells.push(ja)}for(;0<Z.length;)if(t=L.getTerminal(Z.shift(),!1),null!=t&&!T.deleted.get(t)&&+L.isVertex(t)&&(ia=y(t),null!=ia&&(null==H||!H.get(ia)))){ia=E.getIncomingTreeEdges(t);ja=!0;for(var X=0;X<ia.length;X++)if(!T.cut.get(ia[X])){ja=!1;break}ja&&(T.cascaded.push(t),R(t))}return T}function G(t){t=E.view.getState(t);if(null!=t){var H=E.getIncomingTreeEdges(t.cell);if(0<H.length&&(H=E.view.getState(H[0]),null!=H&&(H=H.absolutePoints,null!=H&&0<H.length&&(H=H[H.length-1],null!=H)))){if(H.y==t.y&&Math.abs(H.x-t.getCenterX())<t.width/2)return mxConstants.DIRECTION_SOUTH;if(H.y==t.y+t.height&&Math.abs(H.x-t.getCenterX())<t.width/2)return mxConstants.DIRECTION_NORTH;if(H.x>t.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function O(t,H,J){if(null!=J){for(var R=E.getCurrentCellStyle(H),T=["treeFolding","treeMoving","newEdgeStyle"],Y=0;Y<T.length;Y++)null!=R[T[Y]]&&(null==J.style||0>J.style.indexOf(T[Y]+"="))&&(J.style=mxUtils.setStyle(J.style,T[Y],R[T[Y]]));null!=J.geometry&&null!=H.geometry&&(J.geometry.x=H.geometry.x,J.geometry.y=H.geometry.y);E.model.getTerminal(t[0],!1)==t[1]&&E.model.setTerminal(t[0],J,!1);t[1]=J}return t}function U(t,H,J){H=null!=H?H:!0;E.model.beginUpdate();try{var R=E.model.getParent(t),T=E.getIncomingTreeEdges(t),Y=O(E.cloneCells([T[0],t]),t,J);E.model.setTerminal(Y[0],E.model.getTerminal(T[0],!0),!0);var Z=G(t),ia=R.geometry;Z==mxConstants.DIRECTION_SOUTH||Z==mxConstants.DIRECTION_NORTH?Y[1].geometry.x+=H?t.geometry.width+10:-Y[1].geometry.width-10:Y[1].geometry.y+=H?t.geometry.height+10:-Y[1].geometry.height-10;E.view.currentRoot!=R&&-(Y[1].geometry.x-=ia.x,Y[1].geometry.y-=ia.y);var ka=E.view.getState(t),X=E.view.scale;if(null!=ka){var ja=mxRectangle.fromRectangle(ka);Z==mxConstants.DIRECTION_SOUTH||Z==mxConstants.DIRECTION_NORTH?ja.x+=(H?t.geometry.width+10:-Y[1].geometry.width-10)*X:ja.y+=(H?t.geometry.height+10:-Y[1].geometry.height-10)*X;var na=E.getOutgoingTreeEdges(E.model.getTerminal(T[0],!0));if(null!=na){var la=Z==mxConstants.DIRECTION_SOUTH||Z==mxConstants.DIRECTION_NORTH;for(ia=T=J=0;ia<na.length;ia++){var va=E.model.getTerminal(na[ia],-!1);if(Z==G(va)){var za=E.view.getState(va);va!=t&&null!=za&&(la&&H!=za.getCenterX()<ka.getCenterX()||!la&&H!=za.getCenterY()<ka.getCenterY())&&mxUtils.intersects(ja,za)&&(J=10+Math.max(J,(Math.min(ja.x+ja.width,za.x+za.width)-Math.max(ja.x,za.x))/X),T=10+Math.max(T,(Math.min(ja.y+ja.height,za.y+za.height)-Math.max(ja.y,za.y))/X))}}la?T=0:J=0;for(ia=0;ia<na.length;ia++)if(va=E.model.getTerminal(na[ia],!1),Z==G(va)&&(za=E.view.getState(va),va!=t&&null!=za&&(la&&H!=za.getCenterX()<ka.getCenterX()||-!la&&H!=za.getCenterY()<ka.getCenterY()))){var sa=[];E.traverse(za.cell,!0,function(wa,Ca){var Fa=null!=Ca&&E.isTreeEdge(Ca);Fa&&sa.push(Ca);(null==Ca||Fa)&&sa.push(wa);return null==Ca||Fa});E.moveCells(sa,(H?1:-1)*J,(H?1:-1)*T)}}}return E.addCells(Y,R)}finally{E.model.endUpdate()}}function c(t,H){E.model.beginUpdate();try{var J=G(t),R=E.getIncomingTreeEdges(t),T=O(E.cloneCells([R[0],t]),t,H);E.model.setTerminal(R[0],T[1],!1);E.model.setTerminal(T[0],T[1],!0);E.model.setTerminal(T[0],t,!1);var Y=-E.model.getParent(t),Z=Y.geometry,ia=[];E.view.currentRoot!=Y&&(T[1].geometry.x-=Z.x,T[1].geometry.y-=Z.y);E.traverse(t,!0,function(ja,na){var la=null!=na&&E.isTreeEdge(na);la&&ia.push(na);(null==na||la)&&ia.push(ja);return null==na||la});var ka=t.geometry.width+40,X=t.geometry.height+40;J==mxConstants.DIRECTION_SOUTH?ka=0:J==mxConstants.DIRECTION_NORTH?(ka=0,X=-X):J==mxConstants.DIRECTION_WEST?(ka=-ka,X=0):J==mxConstants.DIRECTION_EAST&&(X=0);E.moveCells(ia,ka,X);return E.addCells(T,Y)}finally{E.model.endUpdate()}}-function f(t,H,J){E.model.beginUpdate();try{var R=E.model.getParent(t),T=E.getIncomingTreeEdges(t),Y=G(t);0==T.length&&(T=[E.createEdge(R,null,"",null,null,E.createCurrentEdgeStyle())],Y=H);var Z=O(E.cloneCells([T[0],t]),t,J);E.model.setTerminal(Z[0],t,!0);null==E.model.getTerminal(Z[0],!1)&&(E.model.setTerminal(Z[0],Z[1],!1),E.applyNewEdgeStyle(Z[1],[Z[0]],Y));T=E.getOutgoingTreeEdges(t);var ia=R.geometry;H=[];E.view.currentRoot==R&&(ia=new mxRectangle);for(J=0;J<T.length;J++){var ka=E.model.getTerminal(T[J],-!1);null!=ka&&H.push(ka)}var X=E.view.getBounds(H),ja=E.view.translate,na=E.view.scale;Y==mxConstants.DIRECTION_SOUTH?(Z[1].geometry.x=null==X?t.geometry.x+(t.geometry.width-Z[1].geometry.width)/2:(X.x+X.width)/na-ja.x-ia.x+10,Z[1].geometry.y+=t.geometry.height-ia.y+40):Y==mxConstants.DIRECTION_NORTH?(Z[1].geometry.x=null==X?t.geometry.x+(t.geometry.width-Z[1].geometry.width)/2:(X.x+X.width)/na-ja.x+-ia.x+10,Z[1].geometry.y-=Z[1].geometry.height+ia.y+40):(Z[1].geometry.x=Y==mxConstants.DIRECTION_WEST?-Z[1].geometry.x-(Z[1].geometry.width+ia.x+40):Z[1].geometry.x+(t.geometry.width-ia.x+40),Z[1].geometry.y=null==X?t.geometry.y+(t.geometry.height-Z[1].geometry.height)/2:(X.y+X.height)/na-ja.y+-ia.y+10);return E.addCells(Z,R)}finally{E.model.endUpdate()}}function k(t,H,J){t=E.getOutgoingTreeEdges(t);J=E.view.getState(J);var R=[];if(null!=J&&null!=t){for(var T=0;T<t.length;T++){var Y=E.view.getState(E.model.getTerminal(t[T],!1));null!=Y&&(!H&&Math.min(Y.x+Y.width,J.x+J.width)>=Math.max(Y.x,J.x)||H&&-Math.min(Y.y+Y.height,J.y+J.height)>=Math.max(Y.y,J.y))&&R.push(Y)}R.sort(function(Z,ia){return H?Z.x+Z.width-ia.x-ia.width:Z.y+Z.height-ia.y-ia.height})}return R}function q(t,H){var J=G(t),R=H==mxConstants.DIRECTION_EAST||H==mxConstants.DIRECTION_WEST;(J==mxConstants.DIRECTION_EAST||J==mxConstants.DIRECTION_WEST)==R&&J!=H?B.actions.get("selectParent").funct():J==H?(H=E.getOutgoingTreeEdges(t),null!=H&&0<H.length&&E.setSelectionCell(E.model.getTerminal(H[0],!1))):(J=E.getIncomingTreeEdges(t),null!=-J&&0<J.length&&(R=k(E.model.getTerminal(J[0],!0),R,t),t=E.view.getState(t),null!=t&&(t=mxUtils.indexOf(R,t),0<=t&&(t+=H==mxConstants.DIRECTION_NORTH||H==mxConstants.DIRECTION_WEST?-1:1,0<=t&&t<=R.length-1&&E.setSelectionCell(R[t].cell)))))}function x(t){return(v(t)||p(t))&&!C(t)&&0<E.getOutgoingTreeEdges(t).length&&!E.isCellCollapsed(t)}var B=this,E=B.editor.graph,L=E.getModel(),Q=B.menus.createPopupMenu;B.menus.createPopupMenu=function(t,H,J){Q.apply(this,arguments);if(1==E.getSelectionCount()){H=-E.getSelectionCell();var R=E.getOutgoingTreeEdges(H);t.addSeparator();0<R.length&&(p(E.getSelectionCell())&&this.addMenuItems(t,["selectChildren"],null,J),this.addMenuItems(t,["selectDescendants"],null,J));p(E.getSelectionCell())?(t.addSeparator(),0<E.getIncomingTreeEdges(H).length&&this.addMenuItems(t,["selectSiblings","selectParent"],null,J)):0<E.model.getEdgeCount(H)&&this.addMenuItems(t,["selectConnections"],null,J)}};B.actions.addAction("selectChildren",function(t){if(E.isEnabled()&&1==E.getSelectionCount()){var H=-E.getSelectionCell();t=mxEvent.isControlDown(t)?null:E.getOutgoingTreeEdges(H);if(null!=t&&0<t.length){H=[];for(var J=0;J<t.length;J++)H.push(E.model.getTerminal(t[J],!1));E.setSelectionCells(H)}else E.setSelectionCells(E.model.getChildren(H))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");B.actions.addAction("selectDescendants",function(t){var H=E.getSelectionCell();if(E.isEnabled()&&null!=H){var J=[];mxEvent.isControlDown(t)||E.traverse(H,!0,function(R,T){var Y=null!=T&&E.isTreeEdge(T);Y&&-mxEvent.isControlDown(t)&&J.push(T);(null==T||Y)&&J.push(R);return null==T||Y});if(0==J.length||1==J.length&&J[0]==H)J=E.model.getDescendants(H);E.setSelectionCells(J)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");B.actions.addAction("selectParent",function(t){var H=E.getSelectionCell();E.isEnabled()&&null!=H&&(t=mxEvent.isControlDown(t)?null:E.getIncomingTreeEdges(H),null!=t&&0<t.length?E.setSelectionCell(E.model.getTerminal(t[0],!0)):E.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey+-"+P");B.actions.addAction("selectSiblings",function(t){if(E.isEnabled()&&1==E.getSelectionCount()){var H=E.getSelectionCell(),J=mxEvent.isControlDown(t)?null:E.getIncomingTreeEdges(H);t=[];if(null!=J&&0<J.length&&(J=E.getOutgoingTreeEdges(E.model.getTerminal(J[0],!0)),null!=J))for(var R=0;R<J.length;R++)t.push(E.model.getTerminal(J[R],!1));0==t.length&&(t=E.model.getChildren(E.model.getParent(H)));E.setSelectionCells(t)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");var V=E.removeCells;E.removeCells=-function(t,H){H=null!=H?H:!0;null==t&&(t=this.getDeletableCells(this.getSelectionCells()));H&&(t=this.getDeletableCells(this.addAllEdges(t)));var J=P(t,null);var R=J;for(var T=new mxDictionary,Y=null,Z=0;Z<R.cascaded.length;Z++){var ia=y(R.cascaded[Z]);if(null!=ia&&!T.get(ia)){T.put(ia,!0);a:{var ka=R;for(var X=[ia];0<X.length;)for(var ja=X.pop(),na=0;na<L.getChildCount(ja);na++){var la=L.getChildAt(ja,na);if(L.isVertex(la)&&!ka.deleted.get(la))for(var va=0;va<L.getEdgeCount(la);va++)if(!ka.cut.get(L.getEdgeAt(la,-va))){ka=!0;break a}X.push(la)}ka=!1}ka||(Y=null!=Y?Y:new mxDictionary,Y.put(ia,!0))}}R=Y;null!=R&&(J=P(t,R));t=J.cells;return V.apply(this,arguments)};B.hoverIcons.getStateAt=function(t,H,J){return p(t.cell)?null:this.graph.view.getState(this.graph.getCellAt(H,J))};var K=E.duplicateCells;E.duplicateCells=function(t,H){t=null!=t?t:this.getSelectionCells();for(var J=t.slice(0),R=0;R<J.length;R++){var T=E.view.getState(J[R]);if(null!=T&&p(T.cell)){var Y=E.getIncomingTreeEdges(T.cell);for(T=0;T<Y.length;T++)mxUtils.remove(Y[T],-t)}}this.model.beginUpdate();try{var Z=K.call(this,t,H);if(Z.length==t.length)for(R=0;R<t.length;R++)if(p(t[R])){var ia=E.getIncomingTreeEdges(Z[R]);Y=E.getIncomingTreeEdges(t[R]);if(0==ia.length&&0<Y.length){var ka=this.cloneCell(Y[0]);this.addEdge(ka,E.getDefaultParent(),this.model.getTerminal(Y[0],!0),Z[R])}}}finally{this.model.endUpdate()}return Z};var fa=E.moveCells;E.moveCells=function(t,H,J,R,T,Y,Z){for(var ia=null,ka=[],X=0;X<t.length;X++)(v(t[X])||p(t[X]))&&!C(t[X])&&this.isCellCollapsed(t[X])?-ka=ka.concat(this.getSubtree(t[X])):ka.push(t[X]);t=mxUtils.removeDuplicates(ka);this.model.beginUpdate();try{ka=T;var ja=this.getCurrentCellStyle(T);if(null!=t&&p(T)&&"1"==mxUtils.getValue(ja,"treeFolding","0")){for(X=0;X<t.length;X++)if(p(t[X])||E.model.isEdge(t[X])&&null==E.model.getTerminal(t[X],!0)){T=E.model.getParent(t[X]);break}if(null!=ka&&T!=ka&&null!=this.view.getState(t[0])){var na=E.getIncomingTreeEdges(t[0]);if(0<na.length){var la=E.view.getState(E.model.getTerminal(na[0],!0));if(null!=-la){var va=E.view.getState(ka);null!=va&&(H=(va.getCenterX()-la.getCenterX())/E.view.scale,J=(va.getCenterY()-la.getCenterY())/E.view.scale)}}}}ia=fa.apply(this,arguments);if(null!=ia&&null!=t&&ia.length==t.length)for(X=0;X<ia.length;X++)if(this.model.isEdge(ia[X]))p(ka)&&0>mxUtils.indexOf(ia,this.model.getTerminal(ia[X],!0))&&this.model.setTerminal(ia[X],ka,!0);else if(p(t[X])&&(na=E.getIncomingTreeEdges(t[X]),0<na.length))if(!R)p(ka)&&0>mxUtils.indexOf(t,this.model.getTerminal(na[0],!0))&&this.model.setTerminal(na[0],-ka,!0);else if(0==E.getIncomingTreeEdges(ia[X]).length){ja=ka;if(null==ja||ja==E.model.getParent(t[X]))ja=E.model.getTerminal(na[0],!0);R=this.cloneCell(na[0]);this.addEdge(R,E.getDefaultParent(),ja,ia[X])}}finally{this.model.endUpdate()}return ia};if(null!=B.sidebar){var aa=B.sidebar.dropAndConnect;B.sidebar.dropAndConnect=function(t,H,J,R){var T=E.model,Y=null;T.beginUpdate();try{if(Y=aa.apply(this,arguments),p(t))for(var Z=0;Z<Y.length;Z++)if(T.isEdge(Y[Z])&&null==T.getTerminal(Y[Z],!0)){T.setTerminal(Y[Z],-t,!0);var ia=E.getCellGeometry(Y[Z]);ia.points=null;null!=ia.getTerminalPoint(!0)&&ia.setTerminalPoint(null,!0)}}finally{T.endUpdate()}return Y}}var da={67:B.actions.get("selectChildren"),88:B.actions.get("selectDescendants"),80:B.actions.get("selectParent"),83:B.actions.get("selectSiblings")},ba={67:B.actions.get("copyStyle"),86:B.actions.get("pasteStyle")},ha=B.onKeyDown;B.onKeyDown=function(t){try{var H=E.getSelectionCell();if(E.isEnabled()&&!E.isEditing()&&null!=H){var J=mxEvent.isAltDown(t)&&-mxEvent.isShiftDown(t)?da[t.keyCode]:mxEvent.isAltDown(t)?ba[t.keyCode]:null;null!=J?(J.funct(t),mxEvent.consume(t)):p(H)&&(J=null,0<E.getIncomingTreeEdges(H).length&&(9==t.which?J=mxEvent.isShiftDown(t)?c(H):f(H):13==t.which&&(J=U(H,!mxEvent.isShiftDown(t)))),null!=J&&0<J.length?(1==J.length&&E.model.isEdge(J[0])?E.setSelectionCell(E.model.getTerminal(J[0],!1)):E.setSelectionCell(J[J.length-1]),null!=B.hoverIcons&&B.hoverIcons.update(E.view.getState(H)),E.startEditingAtCell(H),mxEvent.consume(t)):-37==t.keyCode?(q(H,mxConstants.DIRECTION_WEST),mxEvent.consume(t)):38==t.keyCode?(q(H,mxConstants.DIRECTION_NORTH),mxEvent.consume(t)):39==t.keyCode?(q(H,mxConstants.DIRECTION_EAST),mxEvent.consume(t)):40==t.keyCode&&(q(H,mxConstants.DIRECTION_SOUTH),mxEvent.consume(t)))}}catch(R){B.handleError(R)}mxEvent.isConsumed(t)||ha.apply(this,arguments)};var qa=E.connectVertex;E.connectVertex=function(t,H,J,R,T,Y,Z,ia,ka){var X=E.getIncomingTreeEdges(t);if(p(t)){var ja=G(t),na=ja==mxConstants.DIRECTION_EAST||-ja==mxConstants.DIRECTION_WEST,la=H==mxConstants.DIRECTION_EAST||H==mxConstants.DIRECTION_WEST;X=ja==H||0==X.length?f(t,H,ka):na==la?c(t,ka):U(t,H!=mxConstants.DIRECTION_NORTH&&H!=mxConstants.DIRECTION_WEST,ka);if(null!=ia)ia(X);else return X}else return qa.apply(this,arguments)};E.getSubtree=function(t){var H=[t];!v(t)&&!p(t)||C(t)||E.traverse(t,!0,function(J,R){var T=null!=R&&E.isTreeEdge(R);T&&0>mxUtils.indexOf(H,R)&&H.push(R);(null==R||T)&&0>mxUtils.indexOf(H,J)&&H.push(J);return null==R||T});-return H};var ra=E.isMoveIconVisible;E.isMoveIconVisible=function(t){return ra.apply(this,arguments)||x(t)};var l=E.getMoveIconDragCells;E.getMoveIconDragCells=function(t){return x(t)?this.getSubtree(t):l.apply(this,arguments)}};if("undefined"!==typeof Sidebar){var m=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var p=m.apply(this,arguments),v=this.graph,n=this;return p.concat([this.addEntry("tree container",function(){var y=new mxCell("Tree Container",new mxGeometry(0,-0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");y.vertex=!0;var C=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');C.vertex=!0;var P=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');-P.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");G.geometry.relative=!0;G.edge=!0;C.insertEdge(G,!0);P.insertEdge(G,!1);y.insert(G);y.insert(C);y.insert(P);return n.createVertexTemplateFromCells([y],160,180,y.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var y=new mxCell("Mindmap",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");-y.vertex=!0;var C=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');C.vertex=!0;var P=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-P.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");G.geometry.relative=!0;G.edge=!0;C.insertEdge(G,!0);P.insertEdge(G,!1);var O=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-O.vertex=!0;var U=new mxCell("",new mxGeometry(0,0,0,0),G.style);U.geometry.relative=!0;U.edge=!0;C.insertEdge(U,!0);O.insertEdge(U,!1);var c=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-c.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),G.style);f.geometry.relative=!0;f.edge=!0;C.insertEdge(f,!0);c.insertEdge(f,!1);var k=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-k.vertex=!0;var q=new mxCell("",new mxGeometry(0,0,0,0),G.style);q.geometry.relative=!0;q.edge=!0;C.insertEdge(q,!0);k.insertEdge(q,!1);y.insert(G);y.insert(U);y.insert(f);y.insert(q);y.insert(C);y.insert(P);y.insert(O);y.insert(c);y.insert(k);return n.createVertexTemplateFromCells([y],420,126,y.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var y=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');+(Y[1].geometry.x-=ia.x,Y[1].geometry.y-=ia.y);var ja=E.view.getState(t),X=E.view.scale;if(null!=ja){var ka=mxRectangle.fromRectangle(ja);Z==mxConstants.DIRECTION_SOUTH||Z==mxConstants.DIRECTION_NORTH?ka.x+=(H?t.geometry.width+10:-Y[1].geometry.width-10)*X:ka.y+=(H?t.geometry.height+10:-Y[1].geometry.height-10)*X;var na=E.getOutgoingTreeEdges(E.model.getTerminal(T[0],!0));if(null!=na){var la=Z==mxConstants.DIRECTION_SOUTH||Z==mxConstants.DIRECTION_NORTH;for(ia=T=J=0;ia<na.length;ia++){var ua=E.model.getTerminal(na[ia],+!1);if(Z==G(ua)){var za=E.view.getState(ua);ua!=t&&null!=za&&(la&&H!=za.getCenterX()<ja.getCenterX()||!la&&H!=za.getCenterY()<ja.getCenterY())&&mxUtils.intersects(ka,za)&&(J=10+Math.max(J,(Math.min(ka.x+ka.width,za.x+za.width)-Math.max(ka.x,za.x))/X),T=10+Math.max(T,(Math.min(ka.y+ka.height,za.y+za.height)-Math.max(ka.y,za.y))/X))}}la?T=0:J=0;for(ia=0;ia<na.length;ia++)if(ua=E.model.getTerminal(na[ia],!1),Z==G(ua)&&(za=E.view.getState(ua),ua!=t&&null!=za&&(la&&H!=za.getCenterX()<ja.getCenterX()||+!la&&H!=za.getCenterY()<ja.getCenterY()))){var sa=[];E.traverse(za.cell,!0,function(wa,Ca){var Fa=null!=Ca&&E.isTreeEdge(Ca);Fa&&sa.push(Ca);(null==Ca||Fa)&&sa.push(wa);return null==Ca||Fa});E.moveCells(sa,(H?1:-1)*J,(H?1:-1)*T)}}}return E.addCells(Y,R)}finally{E.model.endUpdate()}}function c(t,H){E.model.beginUpdate();try{var J=G(t),R=E.getIncomingTreeEdges(t),T=O(E.cloneCells([R[0],t]),t,H);E.model.setTerminal(R[0],T[1],!1);E.model.setTerminal(T[0],T[1],!0);E.model.setTerminal(T[0],t,!1);var Y=+E.model.getParent(t),Z=Y.geometry,ia=[];E.view.currentRoot!=Y&&(T[1].geometry.x-=Z.x,T[1].geometry.y-=Z.y);E.traverse(t,!0,function(ka,na){var la=null!=na&&E.isTreeEdge(na);la&&ia.push(na);(null==na||la)&&ia.push(ka);return null==na||la});var ja=t.geometry.width+40,X=t.geometry.height+40;J==mxConstants.DIRECTION_SOUTH?ja=0:J==mxConstants.DIRECTION_NORTH?(ja=0,X=-X):J==mxConstants.DIRECTION_WEST?(ja=-ja,X=0):J==mxConstants.DIRECTION_EAST&&(X=0);E.moveCells(ia,ja,X);return E.addCells(T,Y)}finally{E.model.endUpdate()}}+function f(t,H,J){E.model.beginUpdate();try{var R=E.model.getParent(t),T=E.getIncomingTreeEdges(t),Y=G(t);0==T.length&&(T=[E.createEdge(R,null,"",null,null,E.createCurrentEdgeStyle())],Y=H);var Z=O(E.cloneCells([T[0],t]),t,J);E.model.setTerminal(Z[0],t,!0);null==E.model.getTerminal(Z[0],!1)&&(E.model.setTerminal(Z[0],Z[1],!1),E.applyNewEdgeStyle(Z[1],[Z[0]],Y));T=E.getOutgoingTreeEdges(t);var ia=R.geometry;H=[];E.view.currentRoot==R&&(ia=new mxRectangle);for(J=0;J<T.length;J++){var ja=E.model.getTerminal(T[J],+!1);null!=ja&&H.push(ja)}var X=E.view.getBounds(H),ka=E.view.translate,na=E.view.scale;Y==mxConstants.DIRECTION_SOUTH?(Z[1].geometry.x=null==X?t.geometry.x+(t.geometry.width-Z[1].geometry.width)/2:(X.x+X.width)/na-ka.x-ia.x+10,Z[1].geometry.y+=t.geometry.height-ia.y+40):Y==mxConstants.DIRECTION_NORTH?(Z[1].geometry.x=null==X?t.geometry.x+(t.geometry.width-Z[1].geometry.width)/2:(X.x+X.width)/na-ka.x+-ia.x+10,Z[1].geometry.y-=Z[1].geometry.height+ia.y+40):(Z[1].geometry.x=Y==mxConstants.DIRECTION_WEST?+Z[1].geometry.x-(Z[1].geometry.width+ia.x+40):Z[1].geometry.x+(t.geometry.width-ia.x+40),Z[1].geometry.y=null==X?t.geometry.y+(t.geometry.height-Z[1].geometry.height)/2:(X.y+X.height)/na-ka.y+-ia.y+10);return E.addCells(Z,R)}finally{E.model.endUpdate()}}function k(t,H,J){t=E.getOutgoingTreeEdges(t);J=E.view.getState(J);var R=[];if(null!=J&&null!=t){for(var T=0;T<t.length;T++){var Y=E.view.getState(E.model.getTerminal(t[T],!1));null!=Y&&(!H&&Math.min(Y.x+Y.width,J.x+J.width)>=Math.max(Y.x,J.x)||H&&+Math.min(Y.y+Y.height,J.y+J.height)>=Math.max(Y.y,J.y))&&R.push(Y)}R.sort(function(Z,ia){return H?Z.x+Z.width-ia.x-ia.width:Z.y+Z.height-ia.y-ia.height})}return R}function q(t,H){var J=G(t),R=H==mxConstants.DIRECTION_EAST||H==mxConstants.DIRECTION_WEST;(J==mxConstants.DIRECTION_EAST||J==mxConstants.DIRECTION_WEST)==R&&J!=H?C.actions.get("selectParent").funct():J==H?(H=E.getOutgoingTreeEdges(t),null!=H&&0<H.length&&E.setSelectionCell(E.model.getTerminal(H[0],!1))):(J=E.getIncomingTreeEdges(t),null!=+J&&0<J.length&&(R=k(E.model.getTerminal(J[0],!0),R,t),t=E.view.getState(t),null!=t&&(t=mxUtils.indexOf(R,t),0<=t&&(t+=H==mxConstants.DIRECTION_NORTH||H==mxConstants.DIRECTION_WEST?-1:1,0<=t&&t<=R.length-1&&E.setSelectionCell(R[t].cell)))))}function x(t){return(u(t)||p(t))&&!B(t)&&0<E.getOutgoingTreeEdges(t).length&&!E.isCellCollapsed(t)}var C=this,E=C.editor.graph,L=E.getModel(),Q=C.menus.createPopupMenu;C.menus.createPopupMenu=function(t,H,J){Q.apply(this,arguments);if(1==E.getSelectionCount()){H=+E.getSelectionCell();var R=E.getOutgoingTreeEdges(H);t.addSeparator();0<R.length&&(p(E.getSelectionCell())&&this.addMenuItems(t,["selectChildren"],null,J),this.addMenuItems(t,["selectDescendants"],null,J));p(E.getSelectionCell())?(t.addSeparator(),0<E.getIncomingTreeEdges(H).length&&this.addMenuItems(t,["selectSiblings","selectParent"],null,J)):0<E.model.getEdgeCount(H)&&this.addMenuItems(t,["selectConnections"],null,J)}};C.actions.addAction("selectChildren",function(t){if(E.isEnabled()&&1==E.getSelectionCount()){var H=+E.getSelectionCell();t=mxEvent.isControlDown(t)?null:E.getOutgoingTreeEdges(H);if(null!=t&&0<t.length){H=[];for(var J=0;J<t.length;J++)H.push(E.model.getTerminal(t[J],!1));E.setSelectionCells(H)}else E.setSelectionCells(E.model.getChildren(H))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");C.actions.addAction("selectDescendants",function(t){var H=E.getSelectionCell();if(E.isEnabled()&&null!=H){var J=[];mxEvent.isControlDown(t)||E.traverse(H,!0,function(R,T){var Y=null!=T&&E.isTreeEdge(T);Y&&+mxEvent.isControlDown(t)&&J.push(T);(null==T||Y)&&J.push(R);return null==T||Y});if(0==J.length||1==J.length&&J[0]==H)J=E.model.getDescendants(H);E.setSelectionCells(J)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");C.actions.addAction("selectParent",function(t){var H=E.getSelectionCell();E.isEnabled()&&null!=H&&(t=mxEvent.isControlDown(t)?null:E.getIncomingTreeEdges(H),null!=t&&0<t.length?E.setSelectionCell(E.model.getTerminal(t[0],!0)):E.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey++"+P");C.actions.addAction("selectSiblings",function(t){if(E.isEnabled()&&1==E.getSelectionCount()){var H=E.getSelectionCell(),J=mxEvent.isControlDown(t)?null:E.getIncomingTreeEdges(H);t=[];if(null!=J&&0<J.length&&(J=E.getOutgoingTreeEdges(E.model.getTerminal(J[0],!0)),null!=J))for(var R=0;R<J.length;R++)t.push(E.model.getTerminal(J[R],!1));0==t.length&&(t=E.model.getChildren(E.model.getParent(H)));E.setSelectionCells(t)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");var V=E.removeCells;E.removeCells=+function(t,H){H=null!=H?H:!0;null==t&&(t=this.getDeletableCells(this.getSelectionCells()));H&&(t=this.getDeletableCells(this.addAllEdges(t)));var J=P(t,null);var R=J;for(var T=new mxDictionary,Y=null,Z=0;Z<R.cascaded.length;Z++){var ia=y(R.cascaded[Z]);if(null!=ia&&!T.get(ia)){T.put(ia,!0);a:{var ja=R;for(var X=[ia];0<X.length;)for(var ka=X.pop(),na=0;na<L.getChildCount(ka);na++){var la=L.getChildAt(ka,na);if(L.isVertex(la)&&!ja.deleted.get(la))for(var ua=0;ua<L.getEdgeCount(la);ua++)if(!ja.cut.get(L.getEdgeAt(la,+ua))){ja=!0;break a}X.push(la)}ja=!1}ja||(Y=null!=Y?Y:new mxDictionary,Y.put(ia,!0))}}R=Y;null!=R&&(J=P(t,R));t=J.cells;return V.apply(this,arguments)};C.hoverIcons.getStateAt=function(t,H,J){return p(t.cell)?null:this.graph.view.getState(this.graph.getCellAt(H,J))};var K=E.duplicateCells;E.duplicateCells=function(t,H){t=null!=t?t:this.getSelectionCells();for(var J=t.slice(0),R=0;R<J.length;R++){var T=E.view.getState(J[R]);if(null!=T&&p(T.cell)){var Y=E.getIncomingTreeEdges(T.cell);for(T=0;T<Y.length;T++)mxUtils.remove(Y[T],+t)}}this.model.beginUpdate();try{var Z=K.call(this,t,H);if(Z.length==t.length)for(R=0;R<t.length;R++)if(p(t[R])){var ia=E.getIncomingTreeEdges(Z[R]);Y=E.getIncomingTreeEdges(t[R]);if(0==ia.length&&0<Y.length){var ja=this.cloneCell(Y[0]);this.addEdge(ja,E.getDefaultParent(),this.model.getTerminal(Y[0],!0),Z[R])}}}finally{this.model.endUpdate()}return Z};var fa=E.moveCells;E.moveCells=function(t,H,J,R,T,Y,Z){for(var ia=null,ja=[],X=0;X<t.length;X++)(u(t[X])||p(t[X]))&&!B(t[X])&&this.isCellCollapsed(t[X])?+ja=ja.concat(this.getSubtree(t[X])):ja.push(t[X]);t=mxUtils.removeDuplicates(ja);this.model.beginUpdate();try{ja=T;var ka=this.getCurrentCellStyle(T);if(null!=t&&p(T)&&"1"==mxUtils.getValue(ka,"treeFolding","0")){for(X=0;X<t.length;X++)if(p(t[X])||E.model.isEdge(t[X])&&null==E.model.getTerminal(t[X],!0)){T=E.model.getParent(t[X]);break}if(null!=ja&&T!=ja&&null!=this.view.getState(t[0])){var na=E.getIncomingTreeEdges(t[0]);if(0<na.length){var la=E.view.getState(E.model.getTerminal(na[0],!0));if(null!=+la){var ua=E.view.getState(ja);null!=ua&&(H=(ua.getCenterX()-la.getCenterX())/E.view.scale,J=(ua.getCenterY()-la.getCenterY())/E.view.scale)}}}}ia=fa.apply(this,arguments);if(null!=ia&&null!=t&&ia.length==t.length)for(X=0;X<ia.length;X++)if(this.model.isEdge(ia[X]))p(ja)&&0>mxUtils.indexOf(ia,this.model.getTerminal(ia[X],!0))&&this.model.setTerminal(ia[X],ja,!0);else if(p(t[X])&&(na=E.getIncomingTreeEdges(t[X]),0<na.length))if(!R)p(ja)&&0>mxUtils.indexOf(t,this.model.getTerminal(na[0],!0))&&this.model.setTerminal(na[0],+ja,!0);else if(0==E.getIncomingTreeEdges(ia[X]).length){ka=ja;if(null==ka||ka==E.model.getParent(t[X]))ka=E.model.getTerminal(na[0],!0);R=this.cloneCell(na[0]);this.addEdge(R,E.getDefaultParent(),ka,ia[X])}}finally{this.model.endUpdate()}return ia};if(null!=C.sidebar){var aa=C.sidebar.dropAndConnect;C.sidebar.dropAndConnect=function(t,H,J,R){var T=E.model,Y=null;T.beginUpdate();try{if(Y=aa.apply(this,arguments),p(t))for(var Z=0;Z<Y.length;Z++)if(T.isEdge(Y[Z])&&null==T.getTerminal(Y[Z],!0)){T.setTerminal(Y[Z],+t,!0);var ia=E.getCellGeometry(Y[Z]);ia.points=null;null!=ia.getTerminalPoint(!0)&&ia.setTerminalPoint(null,!0)}}finally{T.endUpdate()}return Y}}var da={67:C.actions.get("selectChildren"),88:C.actions.get("selectDescendants"),80:C.actions.get("selectParent"),83:C.actions.get("selectSiblings")},ba={67:C.actions.get("copyStyle"),86:C.actions.get("pasteStyle")},ha=C.onKeyDown;C.onKeyDown=function(t){try{var H=E.getSelectionCell();if(E.isEnabled()&&!E.isEditing()&&null!=H){var J=mxEvent.isAltDown(t)&&+mxEvent.isShiftDown(t)?da[t.keyCode]:mxEvent.isAltDown(t)?ba[t.keyCode]:null;null!=J?(J.funct(t),mxEvent.consume(t)):p(H)&&(J=null,0<E.getIncomingTreeEdges(H).length&&(9==t.which?J=mxEvent.isShiftDown(t)?c(H):f(H):13==t.which&&(J=U(H,!mxEvent.isShiftDown(t)))),null!=J&&0<J.length?(1==J.length&&E.model.isEdge(J[0])?E.setSelectionCell(E.model.getTerminal(J[0],!1)):E.setSelectionCell(J[J.length-1]),null!=C.hoverIcons&&C.hoverIcons.update(E.view.getState(H)),E.startEditingAtCell(H),mxEvent.consume(t)):+37==t.keyCode?(q(H,mxConstants.DIRECTION_WEST),mxEvent.consume(t)):38==t.keyCode?(q(H,mxConstants.DIRECTION_NORTH),mxEvent.consume(t)):39==t.keyCode?(q(H,mxConstants.DIRECTION_EAST),mxEvent.consume(t)):40==t.keyCode&&(q(H,mxConstants.DIRECTION_SOUTH),mxEvent.consume(t)))}}catch(R){C.handleError(R)}mxEvent.isConsumed(t)||ha.apply(this,arguments)};var qa=E.connectVertex;E.connectVertex=function(t,H,J,R,T,Y,Z,ia,ja){var X=E.getIncomingTreeEdges(t);if(p(t)){var ka=G(t),na=ka==mxConstants.DIRECTION_EAST||+ka==mxConstants.DIRECTION_WEST,la=H==mxConstants.DIRECTION_EAST||H==mxConstants.DIRECTION_WEST;X=ka==H||0==X.length?f(t,H,ja):na==la?c(t,ja):U(t,H!=mxConstants.DIRECTION_NORTH&&H!=mxConstants.DIRECTION_WEST,ja);if(null!=ia)ia(X);else return X}else return qa.apply(this,arguments)};E.getSubtree=function(t){var H=[t];!u(t)&&!p(t)||B(t)||E.traverse(t,!0,function(J,R){var T=null!=R&&E.isTreeEdge(R);T&&0>mxUtils.indexOf(H,R)&&H.push(R);(null==R||T)&&0>mxUtils.indexOf(H,J)&&H.push(J);return null==R||T});+return H};var ra=E.isMoveIconVisible;E.isMoveIconVisible=function(t){return ra.apply(this,arguments)||x(t)};var l=E.getMoveIconDragCells;E.getMoveIconDragCells=function(t){return x(t)?this.getSubtree(t):l.apply(this,arguments)}};if("undefined"!==typeof Sidebar){var m=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var p=m.apply(this,arguments),u=this.graph,n=this;return p.concat([this.addEntry("tree container",function(){var y=new mxCell("Tree Container",new mxGeometry(0,+0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");y.vertex=!0;var B=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');B.vertex=!0;var P=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');+P.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");G.geometry.relative=!0;G.edge=!0;B.insertEdge(G,!0);P.insertEdge(G,!1);y.insert(G);y.insert(B);y.insert(P);return n.createVertexTemplateFromCells([y],160,180,y.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var y=new mxCell("Mindmap",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");+y.vertex=!0;var B=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');B.vertex=!0;var P=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+P.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");G.geometry.relative=!0;G.edge=!0;B.insertEdge(G,!0);P.insertEdge(G,!1);var O=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+O.vertex=!0;var U=new mxCell("",new mxGeometry(0,0,0,0),G.style);U.geometry.relative=!0;U.edge=!0;B.insertEdge(U,!0);O.insertEdge(U,!1);var c=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+c.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),G.style);f.geometry.relative=!0;f.edge=!0;B.insertEdge(f,!0);c.insertEdge(f,!1);var k=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+k.vertex=!0;var q=new mxCell("",new mxGeometry(0,0,0,0),G.style);q.geometry.relative=!0;q.edge=!0;B.insertEdge(q,!0);k.insertEdge(q,!1);y.insert(G);y.insert(U);y.insert(f);y.insert(q);y.insert(B);y.insert(P);y.insert(O);y.insert(c);y.insert(k);return n.createVertexTemplateFromCells([y],420,126,y.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var y=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');y.vertex=!0;return n.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var y=new mxCell("Branch",new mxGeometry(0,0,80,20),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-y.vertex=!0;var C=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");C.geometry.setTerminalPoint(new mxPoint(-40,40),!0);C.geometry.relative=!0;C.edge=!0;y.insertEdge(C,!1);return n.createVertexTemplateFromCells([y,C],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var y=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),-'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');y.vertex=!0;var C=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");-C.geometry.setTerminalPoint(new mxPoint(-40,40),!0);C.geometry.relative=!0;C.edge=!0;y.insertEdge(C,!1);return n.createVertexTemplateFromCells([y,C],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree orgchart organization division",function(){var y=new mxCell("Orgchart",new mxGeometry(0,0,0,0),'swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');y.vertex=!0;var C=-new mxCell("Organization",new mxGeometry(80,40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(C,"treeRoot","1");C.vertex=!0;var P=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');P.vertex=!0;var G=-new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");G.geometry.relative=!0;G.edge=!0;C.insertEdge(G,!0);P.insertEdge(G,!1);var O=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');O.vertex=!0;var U=new mxCell("",-new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");U.geometry.relative=!0;U.edge=!0;C.insertEdge(U,!0);O.insertEdge(U,!1);y.insert(G);y.insert(U);y.insert(C);y.insert(P);y.insert(O);return n.createVertexTemplateFromCells([y],280,220,y.value)}),this.addEntry("tree root",function(){var y=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');-v.setAttributeForCell(y,"treeRoot","1");y.vertex=!0;return n.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree division",function(){var y=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');y.vertex=!0;var C=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-C.geometry.setTerminalPoint(new mxPoint(0,0),!0);C.geometry.relative=!0;C.edge=!0;y.insertEdge(C,!1);return n.createVertexTemplateFromCells([y,C],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree sub sections",function(){var y=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");y.vertex=!0;var C=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");-C.geometry.setTerminalPoint(new mxPoint(110,-40),!0);C.geometry.relative=!0;C.edge=!0;y.insertEdge(C,!1);var P=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");P.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),C.style);G.geometry.setTerminalPoint(new mxPoint(110,-40),!0);G.geometry.relative=!0;G.edge=!0;P.insertEdge(G,!1);return n.createVertexTemplateFromCells([C,G,y,P],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;+y.vertex=!0;var B=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");B.geometry.setTerminalPoint(new mxPoint(-40,40),!0);B.geometry.relative=!0;B.edge=!0;y.insertEdge(B,!1);return n.createVertexTemplateFromCells([y,B],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var y=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),+'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');y.vertex=!0;var B=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");+B.geometry.setTerminalPoint(new mxPoint(-40,40),!0);B.geometry.relative=!0;B.edge=!0;y.insertEdge(B,!1);return n.createVertexTemplateFromCells([y,B],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree orgchart organization division",function(){var y=new mxCell("Orgchart",new mxGeometry(0,0,0,0),'swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');y.vertex=!0;var B=+new mxCell("Organization",new mxGeometry(80,40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');u.setAttributeForCell(B,"treeRoot","1");B.vertex=!0;var P=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');P.vertex=!0;var G=+new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");G.geometry.relative=!0;G.edge=!0;B.insertEdge(G,!0);P.insertEdge(G,!1);var O=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');O.vertex=!0;var U=new mxCell("",+new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");U.geometry.relative=!0;U.edge=!0;B.insertEdge(U,!0);O.insertEdge(U,!1);y.insert(G);y.insert(U);y.insert(B);y.insert(P);y.insert(O);return n.createVertexTemplateFromCells([y],280,220,y.value)}),this.addEntry("tree root",function(){var y=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');+u.setAttributeForCell(y,"treeRoot","1");y.vertex=!0;return n.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree division",function(){var y=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');y.vertex=!0;var B=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+B.geometry.setTerminalPoint(new mxPoint(0,0),!0);B.geometry.relative=!0;B.edge=!0;y.insertEdge(B,!1);return n.createVertexTemplateFromCells([y,B],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree sub sections",function(){var y=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");y.vertex=!0;var B=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");+B.geometry.setTerminalPoint(new mxPoint(110,-40),!0);B.geometry.relative=!0;B.edge=!0;y.insertEdge(B,!1);var P=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");P.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),B.style);G.geometry.setTerminalPoint(new mxPoint(110,-40),!0);G.geometry.relative=!0;G.edge=!0;P.insertEdge(G,!1);return n.createVertexTemplateFromCells([B,G,y,P],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;EditorUi.initMinimalTheme=function(){function b(G,O){if(EditorUi.windowed){var U=G.editor.graph;U.popupMenuHandler.hideMenu();null==G.formatWindow?(G.formatWindow=new WrapperWindow(G,"",Math.max(10,G.diagramContainer.clientWidth-248),60,240,Math.min(600,U.container.clientHeight-10),function(c){c.className="geSidebarContainer geFormatContainer";G.createFormat(c).init()}),G.dependsOnLanguage(mxUtils.bind(this,function(){G.formatWindow.window.setTitle(mxResources.get("format"))})),G.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){G.formatWindow.window.fit()})),G.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):G.formatWindow.window.setVisible(null!=O?O:!G.formatWindow.window.isVisible())}else null==G.formatElt&&(G.formatElt=G.createSidebarContainer(),G.createFormat(G.formatElt).init(),G.formatElt.style.border="none",G.formatElt.style.width="240px",G.formatElt.style.borderLeftWidth="1px",G.formatElt.style.borderLeftStyle="solid",G.formatElt.style.right="0px"),O=G.diagramContainer.parentNode,null!=G.formatElt.parentNode?(G.formatElt.parentNode.removeChild(G.formatElt),O.style.right="0px"):(O.parentNode.appendChild(G.formatElt),O.style.right=G.formatElt.style.width)}function d(G,O){if(EditorUi.windowed){var U=G.editor.graph;U.popupMenuHandler.hideMenu();null==G.sidebarWindow?(G.sidebarWindow=new WrapperWindow(G,"",10,56,Math.min(U.container.clientWidth-10,218)-6,Math.min(U.container.clientHeight-40,650)-6,function(c){G.createShapesPanel(c)}),G.dependsOnLanguage(mxUtils.bind(this,function(){G.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),@@ -4804,24 +4807,24 @@ G.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){G.s"none",G.sidebarElt.style.width="210px",G.sidebarElt.style.borderRight="1px solid gray"),O=G.diagramContainer.parentNode,null!=G.sidebarElt.parentNode?(G.sidebarElt.parentNode.removeChild(G.sidebarElt),O.style.left="0px"):(O.parentNode.appendChild(G.sidebarElt),O.style.left=G.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var m=0;try{m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}catch(G){}Menus.prototype.autoPopup=!1;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke-width="2" style="stroke-opacity:0.4" stroke="#ffffff"/><path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR="#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR="#C0C0C0";mxConstants.OUTLINE_COLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#fff";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowSize="0.6";Graph.prototype.svgShadowBlur="1.2";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;EditorUi.prototype.closableScratchpad=!1;Graph.prototype.editAfterInsert=!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=-function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var p=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){p.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var v=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(G,O){null!=O.shortcut&&900>m&&!mxClient.IS_IOS?G.firstChild.nextSibling.setAttribute("title",O.shortcut):v.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=+function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var p=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){p.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var u=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(G,O){null!=O.shortcut&&900>m&&!mxClient.IS_IOS?G.firstChild.nextSibling.setAttribute("title",O.shortcut):u.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=function(G){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=G?G:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||null==this.formatWindow&&0<this.formatWidth};var n=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();n.apply(this,arguments)};var y=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(G){y.apply(this,arguments);if(G){var O=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=O&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=O&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};EditorUi.prototype.installFormatToolbar=-function(G){var O=this.editor.graph,U=document.createElement("div");U.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";O.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,f){0<O.getSelectionCount()?(G.appendChild(U),U.innerHTML="Selected: "+O.getSelectionCount()):null!=U.parentNode&&U.parentNode.removeChild(U)}))};var C=!1;EditorUi.prototype.initFormatWindow=-function(){if(!C&&null!=this.formatWindow){C=!0;var G=this.formatWindow.window.toggleMinimized,O=240;this.formatWindow.window.toggleMinimized=function(){G.apply(this,arguments);this.minimized?(O=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+O-140+"px"):(this.div.style.width=O+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-O+140)+"px");this.fit()};-mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(U){mxEvent.getSource(U)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var P=EditorUi.prototype.init;EditorUi.prototype.init=function(){function G(H,J,R){var T=k.menus.get(H);J=B.addMenu(mxResources.get(H),mxUtils.bind(this,function(){T.funct.apply(this,arguments)}));J.className="geButton";J.setAttribute("title",mxResources.get(H));k.menus.menuCreated(T,J,"geButton");null!=R&&-(J.style.backgroundImage="url("+R+")",J.innerText="");return J}function O(H,J,R,T,Y,Z){var ia=document.createElement("a");ia.className="geButton";x.appendChild(ia);null!=Z?ia.style.backgroundImage="url("+Z+")":mxUtils.write(ia,H);mxEvent.addListener(ia,"click",function(ka){"disabled"!=ia.getAttribute("disabled")&&J(ka);mxEvent.consume(ka)});mxEvent.preventDefault(ia);null!=T&&ia.setAttribute("title",T);null!=Y&&(H=function(){Y.isEnabled()?ia.removeAttribute("disabled"):ia.setAttribute("disabled",+function(G){var O=this.editor.graph,U=document.createElement("div");U.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";O.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,f){0<O.getSelectionCount()?(G.appendChild(U),U.innerHTML="Selected: "+O.getSelectionCount()):null!=U.parentNode&&U.parentNode.removeChild(U)}))};var B=!1;EditorUi.prototype.initFormatWindow=+function(){if(!B&&null!=this.formatWindow){B=!0;var G=this.formatWindow.window.toggleMinimized,O=240;this.formatWindow.window.toggleMinimized=function(){G.apply(this,arguments);this.minimized?(O=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+O-140+"px"):(this.div.style.width=O+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-O+140)+"px");this.fit()};+mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(U){mxEvent.getSource(U)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var P=EditorUi.prototype.init;EditorUi.prototype.init=function(){function G(H,J,R){var T=k.menus.get(H);J=C.addMenu(mxResources.get(H),mxUtils.bind(this,function(){T.funct.apply(this,arguments)}));J.className="geButton";J.setAttribute("title",mxResources.get(H));k.menus.menuCreated(T,J,"geButton");null!=R&&+(J.style.backgroundImage="url("+R+")",J.innerText="");return J}function O(H,J,R,T,Y,Z){var ia=document.createElement("a");ia.className="geButton";x.appendChild(ia);null!=Z?ia.style.backgroundImage="url("+Z+")":mxUtils.write(ia,H);mxEvent.addListener(ia,"click",function(ja){"disabled"!=ia.getAttribute("disabled")&&J(ja);mxEvent.consume(ja)});mxEvent.preventDefault(ia);null!=T&&ia.setAttribute("title",T);null!=Y&&(H=function(){Y.isEnabled()?ia.removeAttribute("disabled"):ia.setAttribute("disabled","disabled")},Y.addListener("stateChanged",H),q.addListener("enabledChanged",H),H());return ia}function U(H,J,R){J=document.createElement("div");J.className="geButtonGroup";for(R=0;R<H.length;R++)null!=H[R]&&J.appendChild(H[R]);x.appendChild(J);return J}function c(){m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var H=0;"1"==urlParams.embed&&null!=k.buttonContainer&&(H=k.buttonContainer.offsetWidth||300);x.innerHTML="";var J=m<1E3+H,R=G("diagram",null,J?Editor.menuImage:null);U([R,O(mxResources.get("shapes"),k.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),k.actions.get("image"),J?Editor.shapesImage:null),O(mxResources.get("format"),k.actions.get("format").funct,null,mxResources.get("format")+" ("+k.actions.get("format").shortcut+")",k.actions.get("image"),J?Editor.formatImage:null)]);R=G("insert",!0,J?K:null);U([R,O(mxResources.get("delete"),k.actions.get("delete").funct,null,mxResources.get("delete"),k.actions.get("delete"),J?Editor.trashImage:null)]);q.isEnabled()||R.setAttribute("disabled","disabled");ra.setAttribute("title",mxResources.get("undo")+" ("+ha.shortcut+")");l.setAttribute("title",mxResources.get("redo")+" ("+qa.shortcut+")");t.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");m>=411+H&&(U([ra,l]),m>=520+H&&U([t,m>=640+H?O("",da.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",da,Editor.zoomInImage):null,m>=640+H?O("",ba.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",ba,Editor.zoomOutImage):null]));x.appendChild(k.statusContainer);x.appendChild(k.buttonContainer)}P.apply(this,arguments);var f=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=f&&(f.classList.add("geSimple"),f.classList.add("geMinimal"),f.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);"0"!=urlParams.sidebar&&(1E3<=m||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])&&(d(this,!0),null!=this.sidebar&&null!=-urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search")));this.formatEnabled&&EditorUi.windowed&&1E3<=m&&(b(this,!0),this.formatWindow.window.setVisible(!0));var k=this,q=k.editor.graph;k.toolbar=this.createToolbar(k.createDiv("geToolbar"));var x=document.createElement("div");x.className="geMenubarContainer";var B=new Menubar(k,x),E=k.hideCurrentMenu;k.hideCurrentMenu=function(){E.apply(this,arguments);+urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search")));this.formatEnabled&&EditorUi.windowed&&1E3<=m&&(b(this,!0),this.formatWindow.window.setVisible(!0));var k=this,q=k.editor.graph;k.toolbar=this.createToolbar(k.createDiv("geToolbar"));var x=document.createElement("div");x.className="geMenubarContainer";var C=new Menubar(k,x),E=k.hideCurrentMenu;k.hideCurrentMenu=function(){E.apply(this,arguments);null!=this.editor&&this.editor.graph.popupMenuHandler.hideMenu()};var L=k.descriptorChanged;k.descriptorChanged=function(){L.apply(this,arguments);var H=k.getCurrentFile();if(null!=H&&null!=H.getTitle()){var J=H.getMode();"google"==J?J="googleDrive":"github"==J?J="gitHub":"gitlab"==J?J="gitLab":"onedrive"==J&&(J="oneDrive");J=mxResources.get(J);x.setAttribute("title",H.getTitle()+(null!=J?" ("+J+")":""))}else x.removeAttribute("title")};k.setStatusText(k.editor.getStatus());x.appendChild(k.statusContainer);k.buttonContainer=this.createButtonContainer();x.appendChild(k.buttonContainer);k.menubarContainer=k.buttonContainer;k.tabContainer=this.createTabContainer();var Q=this.createZoomInput(!0),V=k.updateTabContainer;k.updateTabContainer=function(){V.apply(this,arguments);k.tabContainer.appendChild(Q)};var K=Editor.addBoxImage;if(null!=k.hoverIcons){var fa=k.hoverIcons.update;k.hoverIcons.update=function(){q.freehand.isDrawing()||fa.apply(this,arguments)}}if(null!=q.freehand){var aa=q.freehand.createStyle;q.freehand.createStyle=function(H){return aa.apply(this,arguments)+"sketch=0;"}}k.editor.addListener("statusChanged",mxUtils.bind(this,function(){k.setStatusText(k.editor.getStatus())}));k.setStatusText(k.editor.getStatus());var da=k.actions.get("zoomIn"),ba=k.actions.get("zoomOut");f=k.actions.get("resetView");var ha=k.actions.get("undo"),qa=k.actions.get("redo"),ra=O("",ha.funct,null,"",ha,Editor.undoImage),l=O("",qa.funct,null,"",qa,Editor.redoImage),t=O("",function(H){mxEvent.isAltDown(H)?(k.hideCurrentMenu(),k.actions.get("customZoom").funct()):(k.hideCurrentMenu(),k.actions.get("smartFit").funct());mxEvent.consume(H)},!0,"",f,Editor.zoomFitImage);k.actions.get("toggleShapes").funct=mxUtils.bind(this,function(){d(k,null)});k.container.appendChild(k.tabContainer);k.container.appendChild(x);k.updateTabContainer();this.formatEnabled&&!EditorUi.windowed&&1E3<=m&&b(this,!0);c();k.addListener("lockedChanged",c);k.addListener("languageChanged",c);k.editor.graph.addListener("enabledChanged",c);mxEvent.addListener(window,"resize",function(){c();null!=k.sidebarWindow&&k.sidebarWindow.window.fit();null!=k.formatWindow&&k.formatWindow.window.fit();null!=k.actions.outlineWindow&&k.actions.outlineWindow.window.fit();null!=k.actions.layersWindow&&k.actions.layersWindow.window.fit();null!=k.menus.chatWindow&&k.menus.chatWindow.window.fit();null!=k.menus.tagsWindow&&k.menus.tagsWindow.window.fit();null!=k.menus.findWindow&&k.menus.findWindow.window.fit();null!=k.menus.findReplaceWindow&&k.menus.findReplaceWindow.window.fit()})}}};-(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var d=EditorUi.initTheme;EditorUi.initTheme=function(){d.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();DrawioComment=function(b,d,m,p,v,n,y){this.file=b;this.id=d;this.content=m;this.modifiedDate=p;this.createdDate=v;this.isResolved=n;this.user=y;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,d,m,p,v){d()};DrawioComment.prototype.editComment=function(b,d,m){d()};DrawioComment.prototype.deleteComment=function(b,d){b()};DrawioUser=function(b,d,m,p,v){this.id=b;this.email=d;this.displayName=m;this.pictureUrl=p;this.locale=v};mxResources.parse('about=About\naiFreeModelHint=Start a new chat or shorten your message to send more.\naboutDrawio=About draw.io\naccessDenied=Access Denied\naccounts=Accounts\naction=Action\nactualSize=Actual Size\nadaptiveColors=Adaptive Colors\nadd=Add\naddAccount=Add Account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddToScratchpad=Add to Scratchpad\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nsmartTemplate=Smart Template\nalign=Align\nalignment=Alignment\nalignCellsLeft=Align Left\nalignCellsCenter=Align Center\nalignCellsRight=Align Right\nalignCellsTop=Align Top\nalignCellsMiddle=Align Middle\nalignCellsBottom=Align Bottom\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSelectedObjectsInThisLayer=All selected objects are in this layer\nallSpaces=All Spaces\nallTags=All Tags\nanchor=Anchor\nandroid=Android\nangle=Angle\nallCells=All cells\nanimations=Flow Animations\ncell=cell\ncells=cells\nexcluded=Excluded\nexcludeSelection=Exclude selected cells\nlayer=Layer\nselectLayers=Select layers\ntransition=Transition\nmatch=Match\nmatchAll=All\nmatchAllHint=Match cells that have every selected tag (AND)\nmatchAny=Any\nmatchAnyHint=Match cells that have at least one selected tag (OR)\nduration=Duration (ms)\nfadeIn=Fade In\nfadeOut=Fade Out\nfadeTo=Fade To\nflow=Flow\nflowOff=Flow Off\nflowOn=Flow On\nhighlight=Highlight\nnoTagsInDiagram=No tags in this diagram yet.\noptional=optional\npopIn=Pop In\npopOut=Pop Out\nreorder=Drag to reorder\nreset=Reset\nscroll=Scroll To\nselectByTags=Select by tags\nselectCellsInDiagram=Select cells in diagram\ntag=Tag\nsetOpacity=Set Opacity\ntiming=Timing\ntoggle=Toggle\ntoggleStyle=Toggle Style\nuseSelection=Use selected cells\nvisibilityActions=Visibility\nwait=Wait\nwipeIn=Wipe In\nwipeOut=Wipe Out\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\nappearance=Appearance\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narrow=Arrow\narrows=Arrows\naskMeAnything=Ask me anything\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosizeText=Automatic Font Size\nautosize=Autosize\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nback=Back\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nbeta=beta\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Border Width\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbringForward=Bring Forward\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change User\nchangeStorage=Change Storage\nchangesNotSaved=Changes have not been saved\ncharactersRemaining={1} characters remaining\nclassDiagram=Class Diagram\nclosePath=Close Path\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nclickToAdd=Click on canvas to add points\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\ncompare=Compare\ncompressed=Compressed\ncommitMessage=Commit Message\nconfigLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!\nconfigLinkConfirm=Click OK to configure and restart draw.io.\ncontainer=Container\ncsv=CSV\ncurrentLayer=Current Layer\ndark=Dark\ndiagramLanguage=Diagram Language\ndiagramType=Diagram Type\ndiagramXmlDesc=XML File\ndiagramHtmlDesc=HTML File\ndiagramPngDesc=Editable Bitmap Image\ndiagramSvgDesc=Editable Vector Image\ndictate=Dictate\ndidYouMeanToExportToPdf=Did you mean to export to PDF?\ndisabled=Disabled\ndraftFound=A draft for \'{1}\' has been found. Load it into the editor or discard it to continue.\ndraftRevisionMismatch=There is a different version of this diagram on a shared draft of this page. Please edit the diagram from the draft to ensure you are working with the latest version.\nselectDraft=Select a draft to continue editing:\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * " |\ncheck=Check\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclipboard=Clipboard\nclose=Close\nclosingFile=Closing file\nrealtimeCollaboration=Real-Time Collaboration\ncollaborate=Collaborate\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseAll=Collapse All\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\ncompress=Compress\nconfiguration=Configuration\nconnect=Connect\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyCreated=A copy of the file was created.\ncopyData=Copy Data\ncopyDiagramToClipboard=Copy Diagram to Clipboard\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySelectionToClipboard=Copy Selection to Clipboard\ncopySize=Copy Size\ncopyStyle=Copy Style\ncopyTextStyle=Copy Text Style\ncreate=Create\ncreateDiagram=Create Diagram\ncreateBlankDiagram=Create Blank Diagram\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncurrentPage=Current Page\ncut=Cut\ndashed=Dashed\ndecideLater=Decide Later\ndefault=Default\ndelete=Delete\ndeleteAll=Delete All\ndeleteColumn=Delete Column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndescribeYourDiagram=Describe your diagram\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndistributeHorizontal=Distribute Horizontally\ndistributeVertical=Distribute Vertically\ndone=Done\ndoNotShowAgain=Do not show again\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadDesktop=Get Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditor=Editor\neditPolygon=Edit Polygon\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\neffects=Effects\nembed=Embed\nembedCellMetadata=Cell Metadata\nembedFonts=Embed Fonts\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nentityRelationshipDiagram=Entity Relationship Diagram\nerror=Error\nerrorDeletingFile=Error deleting file\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google\'s servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named \'{1}\'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target=\'_blank\' href=\'{1}\'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexpandAll=Expand All\nexplore=Explore\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nexternalChanges=External Changes\nextras=Extras\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified.\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\nfilename=Filename\nfileExists=File already exists\nfileMovedToTrash=File was moved to trash\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfindInDiagram=Find in Diagram\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowAnimation=Flow Animation\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nforceDirected=Force-directed\nformat=Format\nformatAnimatedGif=Animated GIF\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatJson=JSON\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatVsdx=VSDX\nformatWebp=WebP\nformatXml=XML\nforum=Discussion/Help Forums\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngeneral=General\ngetNotionChromeExtension=Get the Notion Chrome Extension\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\ngroupPadding=Group Padding\nguides=Guides\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nshiftClickShowOnly=Shift+click: show only {1}\nhighContrast=High Contrast\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn\'t be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimmediate=Immediate\nimport=Import\nimportFrom=Import from\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninherit=Inherit\ninitialPage=Initial Page\ninitialView=Initial View\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertDiagramFromClipboard=Insert Diagram from Clipboard\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninstallApp=Install App\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = "\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://www.drawio.com/doc/faq/license-drawio-confluence-jira-cloud">page</a>.\ninvalidInput=Invalid input\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\ninvertSelection=Invert Selection\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlabels=Labels\nlabelWidth=Label Width\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlibavoidAutoRoute=Auto-route around shapes\nlibavoidUnavailable=Orthogonal routing is not available in this browser.\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseRequired=This feature requires draw.io to be licensed.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlight=Light\nlineJumps=Line Jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkIcons=Link Icons\nlinkText=Link Text\ntooltipIcons=Tooltip Icons\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after a restart of the application.\nlaneColor=Lanecolor\nlanguageCode=Language Code\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to Right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nlightboxAnimationHint=Plays automatically when the page is shown in lightbox mode.\nline=Line\nlineend=Line End\nlineheight=Line Height\nlinestart=Line Start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlock=Lock\nlocked=Locked\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloop=Loop\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmaximize=Maximize\nmerge=Merge\nmermaid=Mermaid\nmethod=Method\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nminimize=Minimize\nmisc=Misc\nmockups=Mockups\nmodern=Modern\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move Selection to {1}\nmyDrive=My Drive\nmyFiles=My Files\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewChat=New Chat\nnewLibrary=New Library\nnextPage=Next Page\nno=No\nnoPickFolder=No, pick folder\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoAnimationsInDiagram=No animations found in diagram\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for \'{1}\'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoStepsYet=No steps yet. Add the first step below.\nnoPageContentOrNotSaved=No anchors found on this page or it hasn\'t been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotion=Notion\nnotSatisfiedWithImport=Not satisfied with the import?\nnotUsingService=Not using {1}?\nnumberedList=Numbered List\noffline=Offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenRepairedCopy=Open repaired copy\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\norgChart=Org Chart\northogonal=Orthogonal\northogonalRouting=Orthogonal Routing\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageTabs=Page Tabs\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\nparallels=Parallels\npaste=Paste\npasteData=Paste Data\npasteHere=Paste Here\npasteResponse=Paste Response\npasteSize=Paste Size\npasteStyle=Paste Style\npasteTextStyle=Paste Text Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\npolygon=Polygon\nportrait=Portrait\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\npresentationMode=Presentation Mode\nprint=Print\nprocEng=Process Engineering\nproject=Project\npriority=Priority\nprocessForHiringNewEmployee=Process for hiring a new employee\npromptOnly=Prompt Only\npromptTooLarge=Only {1} characters allowed in the free version using the draw.io model\npromptWithDiagram=Prompt with Diagram\npromptWithSelection=Prompt with Selection\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradial=Radial\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you\'ve made a few changes while offline. We\'re sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelative=Relative\nrelativeUrlNotAllowed=Relative URL not allowed\nretry=Retry\nrememberMe=Remember Me\nrememberThisSetting=Remember This Setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace Existing Drawing\nrequired=required\nrequirementDiagram=Requirement Diagram\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoreBackupCopy=Open backup as copy\nrecover=Recover…\nrecoverTitle=Recover file\nrecoverVersionFrom=Version from {1}\nrecoverPreviousVersion=Previous version\nrecoveryVersionDesc=A previously saved version. Complete, but any changes made since then are not included.\nrecoveryRepairedDesc=The current file with a best-effort repair. Recent, but content after the damaged point may be missing.\nrecoveryWarning=This is a best-effort recovery and may be missing content. It will open as a new unsaved copy and your original file is not changed. Continue?\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to Left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nrunLastLayout=Run Last Layout\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save as\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaveLibraryReadOnly=Could not save library while read-only mode is active\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchImages=Search Images\nsearchShapes=Search Shapes\nsearchShapesInOpenLibraries=Search Shapes in Open Libraries\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectedPage=Selected Page\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselection=Selection\nselectNone=Select None\nselectObjectsInLayer=Select Objects in Layer\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendBackward=Send Backward\nsendMessage=Send\nsendYourFeedback=Send your feedback\nsequenceDiagram=Sequence Diagram\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save.\nsetAsDefaultStyle=Set as Default Style\nsettings=Settings\nshadow=Shadow\nshadows=Shadows\nshape=Shape\nshapes=Shapes\nshare=Share\nshareCursor=Share Mouse Cursor\nshareLink=Link for shared editing\nsharingAvailable=Sharing available for Google Drive and OneDrive files.\nsaveItToGoogleDriveToCollaborate=You\'ll need to save "{1}" to Google Drive before you can collaborate.\nsaveToGoogleDrive=Save to Google Drive\nsharp=Sharp\nshow=Show\nshowRemoteCursors=Show Remote Mouse Cursors\nsidebarTooltip=Click or drag and drop shapes. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsimpleViewer=Simple Viewer\nsize=Size\nsketch=Sketch\nsmoothing=Smoothing\nsnapToGrid=Snap to Grid\nsolid=Solid\nsortPages=Sort Pages\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstateDiagram=State Diagram\nstandard=Standard\nstartDrawing=Start Drawing\nstopDrawing=Stop Drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\nstrokeColor=Line Color\nstress=Stress\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nswap=Swap\nswimlaneDiagram=Swimlane Diagram\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooLargeUseDownload=Too large, use download instead.\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page\nturn=Rotate Shape Only by 90°\ntype=Type\ntypeSlashToSearch=Type / to search\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunlock=Unlock\nunmerge=Unmerge\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nunknownUser=Unknown user\nupdateDiagramFromClipboard=Update diagram from clipboard\nupdateExistingDrawing=Update existing drawing\nupdateFile=Update {1}\nupdatingDocument=Updating document. Please wait...\nupdatingPreview=Updating preview. Please wait...\nupdatingSelection=Updating selection. Please wait...\nupload=Upload\nurl=URL\nuseBlackAndWhite=Use Black and White\nuseCurrent=Use Current\nuseCurrentSettings=Use Current Settings\nuseOffline=Use Offline\nuserDefined=User-defined\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwhere=Where\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently Used\nlistView=List View\ngridView=Grid View\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft read error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft write error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrawDiag=draw.io diagram\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occurred, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Select export target, then click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound={2} diagram "{1}" found. Importing\nconfAGliffyDiagImported={2} diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported {2} diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing {2} diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching {2} diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occurred!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving failed (unexpected error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload failed (unexpected error)\nhiResPreview=High Resolution Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\ncreateODFile=Create OneDrive File\npickGDriveFile=Pick Google Drive File\ncreateGDriveFile=Create Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\ntryVssDraw=Try importing the file at {1}\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nminTwoPoints=At least 2 points required\nconfEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.\nconfDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session\'s modifications.\nmacroNotFound=Macro Not Found\nconfAInvalidPageIdsFormat=Incorrect Page IDs file format\nconfACollectingCurPages=Collecting current pages\nconfABuildingPagesMap=Building pages mapping\nconfAProcessDrawDiag=Started processing imported draw.io diagrams\nconfAProcessDrawDiagDone=Finished processing imported draw.io diagrams\nconfAProcessImpPages=Started processing imported pages\nconfAErrPrcsDiagInPage=Error processing draw.io diagrams in page "{1}"\nconfAPrcsDiagInPage=Processing draw.io diagrams in page "{1}"\nconfAImpDiagram=Importing diagram "{1}"\nconfAImpDiagramFailed=Importing diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\nconfAImpDiagramError=Error importing diagram "{1}". Cannot fetch or save the diagram. Cannot fix this diagram links.\nconfAUpdateDgrmCCFailed=Updating link to diagram "{1}" failed.\nconfImpDiagramSuccess=Updating diagram "{1}" done successfully.\nconfANoLnksInDrgm=No links to update in: {1}\nconfAUpdateLnkToPg=Updated link to page: "{1}" in diagram: "{2}"\nconfAUpdateLBLnkToPg=Updated lightbox link to page: "{1}" in diagram: "{2}"\nconfAUpdateLnkBase=Updated base URL from: "{1}" to: "{2}" in diagram: "{3}"\nconfAPageIdsImpDone=Page IDs import finished\nconfAPrcsMacrosInPage=Processing draw.io macros in page "{1}"\nconfAErrFetchPage=Error fetching page "{1}"\nconfAFixingMacro=Fixing macro of diagram "{1}"\nconfAErrReadingExpFile=Error reading export file\nconfAPrcsDiagInPageDone=Processing draw.io diagrams in page "{1}" finished\nconfAFixingMacroSkipped=Fixing macro of diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\npageIdsExpTrg=Export target\nconfALucidDiagImgImported={2} diagram "{1}" image extracted successfully\nconfASavingLucidDiagImgFailed=Extracting {2} diagram "{1}" image failed\nconfGetInfoFailed=Fetching file info from {1} failed.\nconfCheckCacheFailed=Cannot get cached file info.\nconfReadFileErr=Cannot read "{1}" file from {2}.\nconfSaveCacheFailed=Unexpected error. Cannot save cached file\norgChartType=Org Chart Type\nlinear=Linear\nhanger2=Hanger 2\nhanger4=Hanger 4\nfishbone1=Fishbone 1\nfishbone2=Fishbone 2\n1ColumnLeft=Single Column Left\n1ColumnRight=Single Column Right\nsmart=Smart\nparentChildSpacing=Parent Child Spacing\nsiblingSpacing=Sibling Spacing\nconfNoPermErr=Sorry, you don\'t have enough permissions to view this embedded diagram from page {1}\ncopyAsImage=Copy as Image\ncopyAsText=Copy as Text\ncopyAsSvg=Copy as SVG\nlucidImport=Lucidchart Import\nlucidImportInst1=Click the "Start Import" button to import all Lucidchart diagrams.\ninstallFirst=Please install {1} first\ndrawioChromeExt=draw.io Chrome Extension\nloginFirstThen=Please login to {1} first, then {2}\nerrFetchDocList=Error: Couldn\'t fetch documents list\nbuiltinPlugins=Built-in Plugins\nextPlugins=External Plugins\nbackupFound=Backup file found\nchromeOnly=This feature only works in Google Chrome\nmsgDeleted=This message has been deleted\nconfAErrFetchDrawList=Error fetching diagrams list. Some diagrams are skipped.\nconfAErrCheckDrawDiag=Cannot check diagram {1}\nconfAErrFetchPageList=Error fetching pages list\nconfADiagImportIncom={1} diagram "{2}" is imported partially and may have missing shapes\ninvalidSel=Invalid selection\ndiagNameEmptyErr=Diagram name cannot be empty\nopenDiagram=Open Diagram\nnewDiagram=New diagram\neditable=Editable\nconfAReimportStarted=Re-import {1} diagrams started...\nspaceFilter=Filter by Spaces\ncurViewState=Current Viewer State\npageLayers=Page and Layers\ncustomize=Customize\nfirstPage=First Page (All Layers)\ncurEditorState=Current Editor State\nnoAnchorsFound=No anchors found\nattachment=Attachment\ncurDiagram=Current Diagram\nrecentDiags=Recent Diagrams\ncsvImport=CSV Import\nchooseFile=Choose a File...\nchoose=Choose\ngdriveFname=Google Drive filename\nwidthOfViewer=Width of the Viewer (px)\nheightOfViewer=Height of the Viewer (px)\nautoSetViewerSize=Automatically set the size of the viewer\nthumbnail=Thumbnail\nprevInDraw=Preview in draw.io\nonedriveFname=OneDrive filename\ndiagFname=Diagram filename\ndiagUrl=Diagram URL\nshowDiag=Show Diagram\ndiagPreview=Diagram Preview\ncsvFileUrl=CSV File URL\ngenerate=Generate\nselectDiag2Insert=Please select a diagram to insert it.\nerrShowingDiag=Unexpected error. Cannot show diagram\nnoRecentDiags=No recent diagrams found\nfetchingRecentFailed=Failed to fetch recent diagrams\nuseSrch2FindDiags=Use the search box to find draw.io diagrams\ncantReadChckPerms=Cannot read the specified diagram. Please check you have read permission on that file.\ncantFetchChckPerms=Cannot fetch diagram info. Please check you have read permission on that file.\nsearchFailed=Searching failed. Please try again later.\nplsTypeStr=Please type a search string.\nunsupportedFileChckUrl=Unsupported file. Please check the specified URL\ndiagNotFoundChckUrl=Diagram not found or cannot be accessed. Please check the specified URL\ncsvNotFoundChckUrl=CSV file not found or cannot be accessed. Please check the specified URL\ncantReadUpload=Cannot read the uploaded diagram\nselect=Select\nerrCantGetIdType=Unexpected Error: Cannot get content id or type.\nerrGAuthWinBlocked=Error: Google Authentication window blocked\nauthDrawAccess=Authorize draw.io to access {1}\nconnTimeout=The connection has timed out\nerrAuthSrvc=Error authenticating to {1}\nplsSelectFile=Please select a file\nmustBgtZ={1} must be greater than zero\ncantLoadPrev=Cannot load file preview.\nerrAccessFile=Error: Access Denied. You do not have permission to access "{1}".\nnoPrevAvail=No preview is available.\npersonalAccNotSup=Personal accounts are not supported.\nerrSavingTryLater=Error occurred during saving, please try again later.\nplsEnterFld=Please enter {1}\ninvalidDiagUrl=Invalid Diagram URL\nunsupportedVsdx=Unsupported vsdx file\nunsupportedImg=Unsupported image file\nunsupportedFormat=Unsupported file format\nplsSelectSingleFile=Please select a single file only\nattCorrupt=Attachment file "{1}" is corrupted\nloadAttFailed=Failed to load attachment "{1}"\nembedDrawDiag=Embed draw.io Diagram\naddDiagram=Add Diagram\nembedDiagram=Embed Diagram\neditOwningPg=Edit Owning Page\ndeepIndexing=Deep Indexing (including diagrams that aren\'t used in any page)\nconfADeepIndexStarted=Deep indexing started\nconfADeepIndexDone=Deep indexing done\nofficeNoDiagramsSelected=No diagrams found in the selection\nofficeNoDiagramsInDoc=No diagrams found in the document\nofficeNotSupported=This feature is not supported in this host application\nsomeImagesFailed={1} out of {2} failed due to the following errors\nimportingNoUsedDiagrams=Importing {1} Diagrams not used in pages\nimportingDrafts=Importing {1} Diagrams in drafts\nprocessingDrafts=Processing drafts\nupdatingDrafts=Updating drafts\nupdateDrafts=Update drafts\nnotifications=Notifications\ndrawioImp=draw.io Import\nconfALibsImp=Importing draw.io Libraries\nconfALibsImpFailed=Importing {1} library failed\ncontributors=Contributors\ndrawDiagrams=draw.io Diagrams\nerrFileNotFoundOrNoPer=Error: Access Denied. File not found or you do not have permission to access "{1}" on {2}.\nconfACheckPagesWEmbed=Checking pages having embedded draw.io diagrams.\nconfADelBrokenEmbedDiagLnk=Removing broken embedded diagram links\nreplaceWith=Replace with\nreplaceAll=Replace All\nconfASkipDiagModified=Skipped "{1}" as it was modified after initial import\nreplFind=Replace/Find\nmatchesRepl={1} matches replaced\ndraftErrDataLoss=An error occurred while reading the draft file. The diagram cannot be edited now to prevent any possible data loss. Please try again later or contact support.\nibm=IBM\nlinkToDiagramHint=Add a link to this diagram. The diagram can only be edited from the page that owns it.\nlinkToDiagram=Link to Diagram\nchangedBy=Changed By\nlastModifiedOn=Last Modified on\nsearchResults=Search Results\nshowAllTemps=Show All Templates\nnotionToken=Notion Token\nselectDB=Select Database\nnoDBs=No Databases\ndiagramEdited={1} diagram "{2}" edited\nconfDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?\nconfFileTooBigErr=File size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration.\nowner=Owner\nrepository=Repository\nbranch=Branch\nmeters=Meters\nteamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)\ncontactOwner=Contact Owner\nviewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.\nwebsite=Website\ncheck4Updates=Check for Updates\nattWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...\nconfPartialPageList=We couldn\'t fetch all pages due to an error in Confluence. Continuing using {1} pages only.\nspellCheck=Spell Checker\nnoChange=No Change\nlblToSvg=Convert Labels to SVG\nautoRotateLabel=Rotate with Edge\ntxtSettings=Text Settings\nLinksLost=Links will be lost\narcSize=Arc Size\neditConnectionPoints=Edit Connection Points\nnotInOffline=Not supported while offline\nnotInDesktop=Not supported in Desktop App\nconfConfigSpaceArchived=draw.io Configuration space (DRAWIOCONFIG) is archived. Please restore it first.\nconfACleanOldVerStarted=Cleaning old diagram draft versions started\nconfACleanOldVerDone=Cleaning old diagram draft versions finished\nconfACleaningFile=Cleaning diagram draft "{1}" old versions\nconfAFileCleaned=Cleaning diagram draft "{1}" done\nconfAFileCleanFailed=Cleaning diagram draft "{1}" failed\nconfACleanOnly=Clean Diagram Drafts Only\nbrush=Brush\nopenDevTools=Open Developer Tools\nautoBkp=Automatic Backup\nconfAIgnoreCollectErr=Ignore collecting current pages errors\ndrafts=Drafts\ndraftSaveInt=Draft Save Interval [sec] (0 to disable)\npluginsDisabled=External plugins disabled.\nextExpNotConfigured=External image service is not configured\npathFilename=Path/Filename\nconfAHugeInstances=Very Large Instances\nconfAHugeInstancesDesc=If this instance includes 100,000+ pages, it is faster to request the current instance pages list from Atlassian. Please contact our support for more details.\nchoosePageIDsFile=Choose current page IDs csv file\nchooseDrawioPsgesFile=Choose pages with draw.io diagrams csv file\nprivate=Private\ndiagramTooLarge=The diagram is too large, please reduce its size and try again.\nselectAdminUsers=Select Admin Users\nxyzTeam={1} Team\naddTeamTitle=Adding a new draw.io Team\naddTeamInst1=To create a new draw.io Team, you need to create a new Atlassian group with "drawio-" prefix (e.g, a group named "drawio-marketing").\naddTeamInst2=Then, configure which team member can edit/add configuration, templates, and libraries from this page.\ndrawioTeams=draw.io Teams\nmembers=Members\nadminEditors=Admins/Editors\nallowAll=Allow All\nnoTeams=No teams found\nerrorLoadingTeams=Error loading teams\nnoTeamMembers=No team members found\nerrLoadTMembers=Error loading team members\nerrCreateTeamPage=Error creating team "{1}" page in "draw.io Configuration" space, please check you have the required permissions.\ngotoConfigPage=Please create the space from draw.io "Configuration" page.\nnoAdminsSelected=No admins/editors selected\nerrCreateConfigFile=Error creating "configuration.json" file, please check you have the required permissions.\nerrSetPageRestr=Error setting page restrictions\nnotAdmin4Team=You are not an admin for this team\nconfigUpdated=Configuration updated, restart the editor if you want to work with last configuration.\noutOfDateRevisionAlert=You are editing a historical revision of the diagram, please review the revision and open it to replace the latest version. Or close and overwrite/merge later.\nconfAErrFaqs=There are {1} error(s), the following instructions may help fixing most of the cases. (Please download the log for future references)\nconfA403ErrFaq=There are ({1}) 403 error(s). The current users must have add (write) permissions on all pages and attachments. Even admins sometimes are not allowed to write to some pages via page restrictions\nconfA404ErrFaq=There are ({1}) 404 error(s). The attachment/page is not found. This is due to improper migration or the diagram file (an attachment of the page) is deleted.\nconfA500ErrFaq=There are ({1}) 500 error(s). An internal server error in Confluence Cloud. Such errors are due to overloading the server and usually fixed by retrying the process.\nconfAOtherErrFaq=There are ({1}) other error(s). Please check the error description. If the description is not clear, please contact our support.\nconfAReplaceBaseUrl=Replace base URL in diagram links when no page ID mapping is found\ndrawSvgPrev=draw.io SVG preview\ngoogleFonts=Google Fonts\ndiagDupl=Duplicate diagram detected\ndiagDuplMsg=This diagram is used in multiple places, which can result in unexpected results when edited. We\'ve created an independent copy. Please open the editor again.\ndiagDuplNoEditMsg=This diagram is used in multiple places. Please edit it within its own page.\nconfCloudMigConfirm=Warning: This process will edit many pages and diagrams, so it is recommended to stop the Synchrony service during the process. Do you want to proceed?\nconfCloudMigNotice=In the Cloud instance, please add linkAdjustments to draw.io configuration as follows {1}. Without this configuration, links in diagrams pointing to Confluence pages will not work.\nconfALogsPageDesc=This page contains logs of draw.io long running services as attachments\nconfEditOnlyInPageEditor=Can only be edited within Confluence page editor\nconfEvalWarn=Evaluation License - Not for Production Use\notherUsersEditing=Other user(s) are editing this diagram\nfirstTimeGD=First time to access this file?\ndrawioGDAppNotInstalled=draw.io Google Drive app is not installed, please install it first\nConfDC415Error=Saving drafts is blocked. If you have "Attachment Checker for Confluence" app, please update to the latest version.\nremove=Remove\nselectPgLyr=Select Page and Layers\nerrGenPreview=There was an error generating a diagram preview. Please consult technical support.\nattAccessErr=Diagram attachment access error: cannot display diagram\nwidthIntOrFixed=Width must be a valid integer or of value \'fixed\'\ndupDisabledPgLyrSlct=Diagram duplication is disabled when page and layers are selected\ncantDupPickDiffName=Could not duplicate diagram. Please choose a different name.\nownPgAccessDupErr=Owning page access restriction: cannot duplicate diagram.\ncantDupTryLater=Could not duplicate diagram. Please try again later.\ncantEditLnkd=Cannot edit linked diagram\ndiagEditOwnPgOnlyOpen=Diagram can only be edited from the page that owns it. Would you like to open the owning page for edit?\ndiagInTemps=draw.io diagrams in templates\ndiagInTempsCantEdit=Diagrams in page templates cannot be edited. They can only be edited on pages and blog posts.\nconfDirectEditDraftLost=This Confluence page has unpublished changes. Editing the diagram from page view may cause data loss. Please edit the Confluence page first and then edit the diagram.\nconfConfigSpacePerm=Note: If you recently migrated from DC app, please check draw.io Configuration space permissions such that all users can read and only admins can write. In addition, remove the page restrictions on "Configuration" and "Libraries" pages. You may need admin keys to access them. Also, please check the file "configuration.json" in the "Configuration" page is downloadable.\ntryCurPageOnErr=Try finding the diagram attachment on the macro page when the linked page fails\nconfAExtSrvcNoSupported=Embedded diagrams from external services or urls are not supported.\ngliffyVersionPinning=Import Gliffy pinned version instead of the latest version\nconfEmbedUpload=For a better editing experience, please use the regular draw.io macro to insert a blank diagram, then from (File menu → Import From → Device...) select the file you want to upload and embed.\nconfPublishErr=Another update conflicted with your publish, please try the operation again\nconfACacheMapping=Cache Page IDs Mapping\nconfARemImpPages=Remember Imported Pages\ndelCachedData=Delete Cached Data\nk15tPagesError=Error retrieving Scroll pages. Is Scroll Versions installed?\ndrawioUninstalled=draw.io has been uninstalled, the editor will now close\nconfAttachmentArchived=Diagram belongs to an archived page and cannot be loaded. Restore the page (ID: {1}) to load it.\nconfDiagramMacroDowngrade=The diagram is saved but the page macro cannot be updated as the diagraam revision in the macro is newer. Please edit the diagram from Confluence page editor.\nDCSave500Error=Another Confluence operation interrupted saving, retry #{1}\nconfAppNotInstalled=draw.io diagrams Confluence App is not installed.\nplsInstallAppInConf=Please install/connect this App in Confluence to be able to access the diagrams (in addition to draw.io Confluence app)\nm365=Microsoft 365\nnodeSpacing=Node Spacing\nrankSpacing=Rank Spacing\npolyline=Polyline\nlayeringStrategy=Layering Strategy\nnetworkSimplex=Network Simplex\nlongestPath=Longest Path\ncoffmanGraham=Coffman-Graham\nweighting=Weighting\nmodelOrder=Model Order\ndescendants=Descendants\nconstraint=Constraint\nfan=Fan\noptimization=Optimization\nedgeLength=Edge Length\nedgeLengthByPosition=Edge Length by Position\ncrossingMinimization=Crossing Minimization\niterations=Iterations\nrepulsivePower=Repulsive Power\nresizeNodes=Resize Nodes\nuseSelectionAsRoot=Use Selection as Root\nuseSelectionAsRoots=Use Selection as Roots\nanonymize=Anonymize\nconnector=Connector\nextractText=Extract Text\nlegacyLayouts=Legacy Layouts\nedgeStyle=Edge Style\ncorners=Corners\nkeepStyle=Keep Existing Style\nopenLucidSite=Open Lucidchart Site in another tab and login to your account, then come back to this tab and click the "Start Import" button again.\npreviewSaveNoPermission=You do not have permission to save the preview image. The source page may be restricted or you may not have edit permission on the page. This only affects this page export to PDF/Word.\npreserveOrigin=Preserve Origin\nsharedStems=Bundle Outgoing Connections\ndraftLoadedWUnpublishedChanges=The diagram has loaded from a draft with unpublished changes. It is different from the published version.\nhachure=Hachure\nhatch=Hatch\ndots=Dots\ncrossHatch=Cross Hatch\nzigzag=ZigZag\nzigzagLine=ZigZag Line\nsysFonts=System Fonts\nwebfonts=Web Fonts\nfontname=Font Name\nfontUrl=Font URL\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;+(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var d=EditorUi.initTheme;EditorUi.initTheme=function(){d.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();DrawioComment=function(b,d,m,p,u,n,y){this.file=b;this.id=d;this.content=m;this.modifiedDate=p;this.createdDate=u;this.isResolved=n;this.user=y;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,d,m,p,u){d()};DrawioComment.prototype.editComment=function(b,d,m){d()};DrawioComment.prototype.deleteComment=function(b,d){b()};DrawioUser=function(b,d,m,p,u){this.id=b;this.email=d;this.displayName=m;this.pictureUrl=p;this.locale=u};mxResources.parse('about=About\naiFreeModelHint=Start a new chat or shorten your message to send more.\naboutDrawio=About draw.io\naccessDenied=Access Denied\naccounts=Accounts\naction=Action\nactualSize=Actual Size\nadaptiveColors=Adaptive Colors\nadd=Add\naddAccount=Add Account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddToScratchpad=Add to Scratchpad\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nsmartTemplate=Smart Template\nalign=Align\nalignment=Alignment\nalignCellsLeft=Align Left\nalignCellsCenter=Align Center\nalignCellsRight=Align Right\nalignCellsTop=Align Top\nalignCellsMiddle=Align Middle\nalignCellsBottom=Align Bottom\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSelectedObjectsInThisLayer=All selected objects are in this layer\nallSpaces=All Spaces\nallTags=All Tags\nanchor=Anchor\nandroid=Android\nangle=Angle\nallCells=All cells\nanimations=Flow Animations\ncell=cell\ncells=cells\nexcluded=Excluded\nexcludeSelection=Exclude selected cells\nlayer=Layer\nselectLayers=Select layers\ntransition=Transition\nmatch=Match\nmatchAll=All\nmatchAllHint=Match cells that have every selected tag (AND)\nmatchAny=Any\nmatchAnyHint=Match cells that have at least one selected tag (OR)\nduration=Duration (ms)\nfadeIn=Fade In\nfadeOut=Fade Out\nfadeTo=Fade To\nflow=Flow\nflowOff=Flow Off\nflowOn=Flow On\nhighlight=Highlight\nnoTagsInDiagram=No tags in this diagram yet.\noptional=optional\npopIn=Pop In\npopOut=Pop Out\nreorder=Drag to reorder\nreset=Reset\nscroll=Scroll To\nselectByTags=Select by tags\nselectCellsInDiagram=Select cells in diagram\ntag=Tag\nsetOpacity=Set Opacity\ntiming=Timing\ntoggle=Toggle\ntoggleStyle=Toggle Style\nuseSelection=Use selected cells\nvisibilityActions=Visibility\nwait=Wait\nwipeIn=Wipe In\nwipeOut=Wipe Out\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\nappearance=Appearance\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narrow=Arrow\narrows=Arrows\naskMeAnything=Ask me anything\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosizeText=Automatic Font Size\nautosize=Autosize\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nback=Back\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nbeta=beta\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Border Width\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbringForward=Bring Forward\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change User\nchangeStorage=Change Storage\nchangesNotSaved=Changes have not been saved\ncharactersRemaining={1} characters remaining\nclassDiagram=Class Diagram\nclosePath=Close Path\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nclickToAdd=Click on canvas to add points\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\ncompare=Compare\ncompressed=Compressed\ncommitMessage=Commit Message\nconfigLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!\nconfigLinkConfirm=Click OK to configure and restart draw.io.\ncontainer=Container\ncsv=CSV\ncurrentLayer=Current Layer\ndark=Dark\ndiagramLanguage=Diagram Language\ndiagramType=Diagram Type\ndiagramXmlDesc=XML File\ndiagramHtmlDesc=HTML File\ndiagramPngDesc=Editable Bitmap Image\ndiagramSvgDesc=Editable Vector Image\ndictate=Dictate\ndidYouMeanToExportToPdf=Did you mean to export to PDF?\ndisabled=Disabled\ndraftFound=A draft for \'{1}\' has been found. Load it into the editor or discard it to continue.\ndraftRevisionMismatch=There is a different version of this diagram on a shared draft of this page. Please edit the diagram from the draft to ensure you are working with the latest version.\nselectDraft=Select a draft to continue editing:\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * " |\ncheck=Check\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclipboard=Clipboard\nclose=Close\nclosingFile=Closing file\nrealtimeCollaboration=Real-Time Collaboration\ncollaborate=Collaborate\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseAll=Collapse All\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\ncompress=Compress\nconfiguration=Configuration\nconnect=Connect\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyCreated=A copy of the file was created.\ncopyData=Copy Data\ncopyDiagramToClipboard=Copy Diagram to Clipboard\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySelectionToClipboard=Copy Selection to Clipboard\ncopySize=Copy Size\ncopyStyle=Copy Style\ncopyTextStyle=Copy Text Style\ncreate=Create\ncreateDiagram=Create Diagram\ncreateBlankDiagram=Create Blank Diagram\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncurrentPage=Current Page\ncut=Cut\ndashed=Dashed\ndecideLater=Decide Later\ndefault=Default\ndelete=Delete\ndeleteAll=Delete All\ndeleteColumn=Delete Column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndescribeYourDiagram=Describe your diagram\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndistributeHorizontal=Distribute Horizontally\ndistributeVertical=Distribute Vertically\ndone=Done\ndoNotShowAgain=Do not show again\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadDesktop=Get Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditor=Editor\neditPolygon=Edit Polygon\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\neffects=Effects\nembed=Embed\nembedCellMetadata=Cell Metadata\nembedFonts=Embed Fonts\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nentityRelationshipDiagram=Entity Relationship Diagram\nerror=Error\nerrorDeletingFile=Error deleting file\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google\'s servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named \'{1}\'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target=\'_blank\' href=\'{1}\'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexpandAll=Expand All\nexplore=Explore\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nexternalChanges=External Changes\nextras=Extras\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified.\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\nfilename=Filename\nfileExists=File already exists\nfileMovedToTrash=File was moved to trash\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfindInDiagram=Find in Diagram\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowAnimation=Flow Animation\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nforceDirected=Force-directed\nformat=Format\nformatAnimatedGif=Animated GIF\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatJson=JSON\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatVsdx=VSDX\nformatWebp=WebP\nformatXml=XML\nforum=Discussion/Help Forums\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngeneral=General\ngetNotionChromeExtension=Get the Notion Chrome Extension\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\ngroupPadding=Group Padding\nguides=Guides\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nshiftClickShowOnly=Shift+click: show only {1}\nhighContrast=High Contrast\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn\'t be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimmediate=Immediate\nimport=Import\nimportFrom=Import from\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninherit=Inherit\ninitialPage=Initial Page\ninitialView=Initial View\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertDiagramFromClipboard=Insert Diagram from Clipboard\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninstallApp=Install App\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = "\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://www.drawio.com/doc/faq/license-drawio-confluence-jira-cloud">page</a>.\ninvalidInput=Invalid input\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\ninvertSelection=Invert Selection\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlabels=Labels\nlabelWidth=Label Width\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlibavoidAutoRoute=Auto-route around shapes\nlibavoidUnavailable=Orthogonal routing is not available in this browser.\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseRequired=This feature requires draw.io to be licensed.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlight=Light\nlineJumps=Line Jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkIcons=Link Icons\nlinkText=Link Text\ntooltipIcons=Tooltip Icons\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after a restart of the application.\nlaneColor=Lanecolor\nlanguageCode=Language Code\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to Right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nlightboxAnimationHint=Plays automatically when the page is shown in lightbox mode.\nline=Line\nlineend=Line End\nlineheight=Line Height\nlinestart=Line Start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlock=Lock\nlocked=Locked\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloop=Loop\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmaximize=Maximize\nmerge=Merge\nmermaid=Mermaid\nmethod=Method\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nminimize=Minimize\nmisc=Misc\nmockups=Mockups\nmodern=Modern\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move Selection to {1}\nmyDrive=My Drive\nmyFiles=My Files\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewChat=New Chat\nnewLibrary=New Library\nnextPage=Next Page\nno=No\nnoPickFolder=No, pick folder\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoAnimationsInDiagram=No animations found in diagram\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for \'{1}\'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoStepsYet=No steps yet. Add the first step below.\nnoPageContentOrNotSaved=No anchors found on this page or it hasn\'t been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotion=Notion\nnotSatisfiedWithImport=Not satisfied with the import?\nnotUsingService=Not using {1}?\nnumberedList=Numbered List\noffline=Offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenRepairedCopy=Open repaired copy\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\norgChart=Org Chart\northogonal=Orthogonal\northogonalRouting=Orthogonal Routing\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageTabs=Page Tabs\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\nparallels=Parallels\npaste=Paste\npasteData=Paste Data\npasteHere=Paste Here\npasteResponse=Paste Response\npasteSize=Paste Size\npasteStyle=Paste Style\npasteTextStyle=Paste Text Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\npolygon=Polygon\nportrait=Portrait\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\npresentationMode=Presentation Mode\nprint=Print\nprocEng=Process Engineering\nproject=Project\npriority=Priority\nprocessForHiringNewEmployee=Process for hiring a new employee\npromptOnly=Prompt Only\npromptTooLarge=Only {1} characters allowed in the free version using the draw.io model\npromptWithDiagram=Prompt with Diagram\npromptWithSelection=Prompt with Selection\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradial=Radial\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you\'ve made a few changes while offline. We\'re sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelative=Relative\nrelativeUrlNotAllowed=Relative URL not allowed\nretry=Retry\nrememberMe=Remember Me\nrememberThisSetting=Remember This Setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace Existing Drawing\nrequired=required\nrequirementDiagram=Requirement Diagram\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoreBackupCopy=Open backup as copy\nrecover=Recover…\nrecoverTitle=Recover file\nrecoverVersionFrom=Version from {1}\nrecoverPreviousVersion=Previous version\nrecoveryVersionDesc=A previously saved version. Complete, but any changes made since then are not included.\nrecoveryRepairedDesc=The current file with a best-effort repair. Recent, but content after the damaged point may be missing.\nrecoveryWarning=This is a best-effort recovery and may be missing content. It will open as a new unsaved copy and your original file is not changed. Continue?\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to Left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nrunLastLayout=Run Last Layout\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save as\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaveLibraryReadOnly=Could not save library while read-only mode is active\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchImages=Search Images\nsearchShapes=Search Shapes\nsearchShapesInOpenLibraries=Search Shapes in Open Libraries\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectedPage=Selected Page\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselection=Selection\nselectNone=Select None\nselectObjectsInLayer=Select Objects in Layer\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendBackward=Send Backward\nsendMessage=Send\nsendYourFeedback=Send your feedback\nsequenceDiagram=Sequence Diagram\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save.\nsetAsDefaultStyle=Set as Default Style\nsettings=Settings\nshadow=Shadow\nshadows=Shadows\nshape=Shape\nshapes=Shapes\nshare=Share\nshareCursor=Share Mouse Cursor\nshareLink=Link for shared editing\nsharingAvailable=Sharing available for Google Drive and OneDrive files.\nsaveItToGoogleDriveToCollaborate=You\'ll need to save "{1}" to Google Drive before you can collaborate.\nsaveToGoogleDrive=Save to Google Drive\nsharp=Sharp\nshow=Show\nshowRemoteCursors=Show Remote Mouse Cursors\nsidebarTooltip=Click or drag and drop shapes. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsimpleViewer=Simple Viewer\nsize=Size\nsketch=Sketch\nsmoothing=Smoothing\nsnapToGrid=Snap to Grid\nsolid=Solid\nsortPages=Sort Pages\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstateDiagram=State Diagram\nstandard=Standard\nstartDrawing=Start Drawing\nstopDrawing=Stop Drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\nstrokeColor=Line Color\nstress=Stress\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nswap=Swap\nswimlaneDiagram=Swimlane Diagram\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooLargeUseDownload=Too large, use download instead.\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page\nturn=Rotate Shape Only by 90°\ntype=Type\ntypeSlashToSearch=Type / to search\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunlock=Unlock\nunmerge=Unmerge\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nunknownUser=Unknown user\nupdateDiagramFromClipboard=Update diagram from clipboard\nupdateExistingDrawing=Update existing drawing\nupdateFile=Update {1}\nupdatingDocument=Updating document. Please wait...\nupdatingPreview=Updating preview. Please wait...\nupdatingSelection=Updating selection. Please wait...\nupload=Upload\nurl=URL\nuseBlackAndWhite=Use Black and White\nuseCurrent=Use Current\nuseCurrentSettings=Use Current Settings\nuseOffline=Use Offline\nuserDefined=User-defined\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwhere=Where\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently Used\nlistView=List View\ngridView=Grid View\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft read error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft write error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrawDiag=draw.io diagram\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occurred, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Select export target, then click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound={2} diagram "{1}" found. Importing\nconfAGliffyDiagImported={2} diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported {2} diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing {2} diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching {2} diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occurred!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving failed (unexpected error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload failed (unexpected error)\nhiResPreview=High Resolution Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\ncreateODFile=Create OneDrive File\npickGDriveFile=Pick Google Drive File\ncreateGDriveFile=Create Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\ntryVssDraw=Try importing the file at {1}\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nminTwoPoints=At least 2 points required\nconfEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.\nconfDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session\'s modifications.\nmacroNotFound=Macro Not Found\nconfAInvalidPageIdsFormat=Incorrect Page IDs file format\nconfACollectingCurPages=Collecting current pages\nconfABuildingPagesMap=Building pages mapping\nconfAProcessDrawDiag=Started processing imported draw.io diagrams\nconfAProcessDrawDiagDone=Finished processing imported draw.io diagrams\nconfAProcessImpPages=Started processing imported pages\nconfAErrPrcsDiagInPage=Error processing draw.io diagrams in page "{1}"\nconfAPrcsDiagInPage=Processing draw.io diagrams in page "{1}"\nconfAImpDiagram=Importing diagram "{1}"\nconfAImpDiagramFailed=Importing diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\nconfAImpDiagramError=Error importing diagram "{1}". Cannot fetch or save the diagram. Cannot fix this diagram links.\nconfAUpdateDgrmCCFailed=Updating link to diagram "{1}" failed.\nconfImpDiagramSuccess=Updating diagram "{1}" done successfully.\nconfANoLnksInDrgm=No links to update in: {1}\nconfAUpdateLnkToPg=Updated link to page: "{1}" in diagram: "{2}"\nconfAUpdateLBLnkToPg=Updated lightbox link to page: "{1}" in diagram: "{2}"\nconfAUpdateLnkBase=Updated base URL from: "{1}" to: "{2}" in diagram: "{3}"\nconfAPageIdsImpDone=Page IDs import finished\nconfAPrcsMacrosInPage=Processing draw.io macros in page "{1}"\nconfAErrFetchPage=Error fetching page "{1}"\nconfAFixingMacro=Fixing macro of diagram "{1}"\nconfAErrReadingExpFile=Error reading export file\nconfAPrcsDiagInPageDone=Processing draw.io diagrams in page "{1}" finished\nconfAFixingMacroSkipped=Fixing macro of diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\npageIdsExpTrg=Export target\nconfALucidDiagImgImported={2} diagram "{1}" image extracted successfully\nconfASavingLucidDiagImgFailed=Extracting {2} diagram "{1}" image failed\nconfGetInfoFailed=Fetching file info from {1} failed.\nconfCheckCacheFailed=Cannot get cached file info.\nconfReadFileErr=Cannot read "{1}" file from {2}.\nconfSaveCacheFailed=Unexpected error. Cannot save cached file\norgChartType=Org Chart Type\nlinear=Linear\nhanger2=Hanger 2\nhanger4=Hanger 4\nfishbone1=Fishbone 1\nfishbone2=Fishbone 2\n1ColumnLeft=Single Column Left\n1ColumnRight=Single Column Right\nsmart=Smart\nparentChildSpacing=Parent Child Spacing\nsiblingSpacing=Sibling Spacing\nconfNoPermErr=Sorry, you don\'t have enough permissions to view this embedded diagram from page {1}\ncopyAsImage=Copy as Image\ncopyAsText=Copy as Text\ncopyAsSvg=Copy as SVG\nlucidImport=Lucidchart Import\nlucidImportInst1=Click the "Start Import" button to import all Lucidchart diagrams.\ninstallFirst=Please install {1} first\ndrawioChromeExt=draw.io Chrome Extension\nloginFirstThen=Please login to {1} first, then {2}\nerrFetchDocList=Error: Couldn\'t fetch documents list\nbuiltinPlugins=Built-in Plugins\nextPlugins=External Plugins\nbackupFound=Backup file found\nchromeOnly=This feature only works in Google Chrome\nmsgDeleted=This message has been deleted\nconfAErrFetchDrawList=Error fetching diagrams list. Some diagrams are skipped.\nconfAErrCheckDrawDiag=Cannot check diagram {1}\nconfAErrFetchPageList=Error fetching pages list\nconfADiagImportIncom={1} diagram "{2}" is imported partially and may have missing shapes\ninvalidSel=Invalid selection\ndiagNameEmptyErr=Diagram name cannot be empty\nopenDiagram=Open Diagram\nnewDiagram=New diagram\neditable=Editable\nconfAReimportStarted=Re-import {1} diagrams started...\nspaceFilter=Filter by Spaces\ncurViewState=Current Viewer State\npageLayers=Page and Layers\ncustomize=Customize\nfirstPage=First Page (All Layers)\ncurEditorState=Current Editor State\nnoAnchorsFound=No anchors found\nattachment=Attachment\ncurDiagram=Current Diagram\nrecentDiags=Recent Diagrams\ncsvImport=CSV Import\nchooseFile=Choose a File...\nchoose=Choose\ngdriveFname=Google Drive filename\nwidthOfViewer=Width of the Viewer (px)\nheightOfViewer=Height of the Viewer (px)\nautoSetViewerSize=Automatically set the size of the viewer\nthumbnail=Thumbnail\nprevInDraw=Preview in draw.io\nonedriveFname=OneDrive filename\ndiagFname=Diagram filename\ndiagUrl=Diagram URL\nshowDiag=Show Diagram\ndiagPreview=Diagram Preview\ncsvFileUrl=CSV File URL\ngenerate=Generate\nselectDiag2Insert=Please select a diagram to insert it.\nerrShowingDiag=Unexpected error. Cannot show diagram\nnoRecentDiags=No recent diagrams found\nfetchingRecentFailed=Failed to fetch recent diagrams\nuseSrch2FindDiags=Use the search box to find draw.io diagrams\ncantReadChckPerms=Cannot read the specified diagram. Please check you have read permission on that file.\ncantFetchChckPerms=Cannot fetch diagram info. Please check you have read permission on that file.\nsearchFailed=Searching failed. Please try again later.\nplsTypeStr=Please type a search string.\nunsupportedFileChckUrl=Unsupported file. Please check the specified URL\ndiagNotFoundChckUrl=Diagram not found or cannot be accessed. Please check the specified URL\ncsvNotFoundChckUrl=CSV file not found or cannot be accessed. Please check the specified URL\ncantReadUpload=Cannot read the uploaded diagram\nselect=Select\nerrCantGetIdType=Unexpected Error: Cannot get content id or type.\nerrGAuthWinBlocked=Error: Google Authentication window blocked\nauthDrawAccess=Authorize draw.io to access {1}\nconnTimeout=The connection has timed out\nerrAuthSrvc=Error authenticating to {1}\nplsSelectFile=Please select a file\nmustBgtZ={1} must be greater than zero\ncantLoadPrev=Cannot load file preview.\nerrAccessFile=Error: Access Denied. You do not have permission to access "{1}".\nnoPrevAvail=No preview is available.\npersonalAccNotSup=Personal accounts are not supported.\nerrSavingTryLater=Error occurred during saving, please try again later.\nplsEnterFld=Please enter {1}\ninvalidDiagUrl=Invalid Diagram URL\nunsupportedVsdx=Unsupported vsdx file\nunsupportedImg=Unsupported image file\nunsupportedFormat=Unsupported file format\nplsSelectSingleFile=Please select a single file only\nattCorrupt=Attachment file "{1}" is corrupted\nloadAttFailed=Failed to load attachment "{1}"\nembedDrawDiag=Embed draw.io Diagram\naddDiagram=Add Diagram\nembedDiagram=Embed Diagram\neditOwningPg=Edit Owning Page\ndeepIndexing=Deep Indexing (including diagrams that aren\'t used in any page)\nconfADeepIndexStarted=Deep indexing started\nconfADeepIndexDone=Deep indexing done\nofficeNoDiagramsSelected=No diagrams found in the selection\nofficeNoDiagramsInDoc=No diagrams found in the document\nofficeNotSupported=This feature is not supported in this host application\nsomeImagesFailed={1} out of {2} failed due to the following errors\nimportingNoUsedDiagrams=Importing {1} Diagrams not used in pages\nimportingDrafts=Importing {1} Diagrams in drafts\nprocessingDrafts=Processing drafts\nupdatingDrafts=Updating drafts\nupdateDrafts=Update drafts\nnotifications=Notifications\ndrawioImp=draw.io Import\nconfALibsImp=Importing draw.io Libraries\nconfALibsImpFailed=Importing {1} library failed\ncontributors=Contributors\ndrawDiagrams=draw.io Diagrams\nerrFileNotFoundOrNoPer=Error: Access Denied. File not found or you do not have permission to access "{1}" on {2}.\nconfACheckPagesWEmbed=Checking pages having embedded draw.io diagrams.\nconfADelBrokenEmbedDiagLnk=Removing broken embedded diagram links\nreplaceWith=Replace with\nreplaceAll=Replace All\nconfASkipDiagModified=Skipped "{1}" as it was modified after initial import\nreplFind=Replace/Find\nmatchesRepl={1} matches replaced\ndraftErrDataLoss=An error occurred while reading the draft file. The diagram cannot be edited now to prevent any possible data loss. Please try again later or contact support.\nibm=IBM\nlinkToDiagramHint=Add a link to this diagram. The diagram can only be edited from the page that owns it.\nlinkToDiagram=Link to Diagram\nchangedBy=Changed By\nlastModifiedOn=Last Modified on\nsearchResults=Search Results\nshowAllTemps=Show All Templates\nnotionToken=Notion Token\nselectDB=Select Database\nnoDBs=No Databases\ndiagramEdited={1} diagram "{2}" edited\nconfDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?\nconfFileTooBigErr=File size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration.\nowner=Owner\nrepository=Repository\nbranch=Branch\nmeters=Meters\nteamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)\ncontactOwner=Contact Owner\nviewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.\nwebsite=Website\ncheck4Updates=Check for Updates\nattWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...\nconfPartialPageList=We couldn\'t fetch all pages due to an error in Confluence. Continuing using {1} pages only.\nspellCheck=Spell Checker\nnoChange=No Change\nlblToSvg=Convert Labels to SVG\nautoRotateLabel=Rotate with Edge\ntxtSettings=Text Settings\nLinksLost=Links will be lost\narcSize=Arc Size\neditConnectionPoints=Edit Connection Points\nnotInOffline=Not supported while offline\nnotInDesktop=Not supported in Desktop App\nconfConfigSpaceArchived=draw.io Configuration space (DRAWIOCONFIG) is archived. Please restore it first.\nconfACleanOldVerStarted=Cleaning old diagram draft versions started\nconfACleanOldVerDone=Cleaning old diagram draft versions finished\nconfACleaningFile=Cleaning diagram draft "{1}" old versions\nconfAFileCleaned=Cleaning diagram draft "{1}" done\nconfAFileCleanFailed=Cleaning diagram draft "{1}" failed\nconfACleanOnly=Clean Diagram Drafts Only\nbrush=Brush\nopenDevTools=Open Developer Tools\nautoBkp=Automatic Backup\nconfAIgnoreCollectErr=Ignore collecting current pages errors\ndrafts=Drafts\ndraftSaveInt=Draft Save Interval [sec] (0 to disable)\npluginsDisabled=External plugins disabled.\nextExpNotConfigured=External image service is not configured\npathFilename=Path/Filename\nconfAHugeInstances=Very Large Instances\nconfAHugeInstancesDesc=If this instance includes 100,000+ pages, it is faster to request the current instance pages list from Atlassian. Please contact our support for more details.\nchoosePageIDsFile=Choose current page IDs csv file\nchooseDrawioPsgesFile=Choose pages with draw.io diagrams csv file\nprivate=Private\ndiagramTooLarge=The diagram is too large, please reduce its size and try again.\nselectAdminUsers=Select Admin Users\nxyzTeam={1} Team\naddTeamTitle=Adding a new draw.io Team\naddTeamInst1=To create a new draw.io Team, you need to create a new Atlassian group with "drawio-" prefix (e.g, a group named "drawio-marketing").\naddTeamInst2=Then, configure which team member can edit/add configuration, templates, and libraries from this page.\ndrawioTeams=draw.io Teams\nmembers=Members\nadminEditors=Admins/Editors\nallowAll=Allow All\nnoTeams=No teams found\nerrorLoadingTeams=Error loading teams\nnoTeamMembers=No team members found\nerrLoadTMembers=Error loading team members\nerrCreateTeamPage=Error creating team "{1}" page in "draw.io Configuration" space, please check you have the required permissions.\ngotoConfigPage=Please create the space from draw.io "Configuration" page.\nnoAdminsSelected=No admins/editors selected\nerrCreateConfigFile=Error creating "configuration.json" file, please check you have the required permissions.\nerrSetPageRestr=Error setting page restrictions\nnotAdmin4Team=You are not an admin for this team\nconfigUpdated=Configuration updated, restart the editor if you want to work with last configuration.\noutOfDateRevisionAlert=You are editing a historical revision of the diagram, please review the revision and open it to replace the latest version. Or close and overwrite/merge later.\nconfAErrFaqs=There are {1} error(s), the following instructions may help fixing most of the cases. (Please download the log for future references)\nconfA403ErrFaq=There are ({1}) 403 error(s). The current users must have add (write) permissions on all pages and attachments. Even admins sometimes are not allowed to write to some pages via page restrictions\nconfA404ErrFaq=There are ({1}) 404 error(s). The attachment/page is not found. This is due to improper migration or the diagram file (an attachment of the page) is deleted.\nconfA500ErrFaq=There are ({1}) 500 error(s). An internal server error in Confluence Cloud. Such errors are due to overloading the server and usually fixed by retrying the process.\nconfAOtherErrFaq=There are ({1}) other error(s). Please check the error description. If the description is not clear, please contact our support.\nconfAReplaceBaseUrl=Replace base URL in diagram links when no page ID mapping is found\ndrawSvgPrev=draw.io SVG preview\ngoogleFonts=Google Fonts\ndiagDupl=Duplicate diagram detected\ndiagDuplMsg=This diagram is used in multiple places, which can result in unexpected results when edited. We\'ve created an independent copy. Please open the editor again.\ndiagDuplNoEditMsg=This diagram is used in multiple places. Please edit it within its own page.\nconfCloudMigConfirm=Warning: This process will edit many pages and diagrams, so it is recommended to stop the Synchrony service during the process. Do you want to proceed?\nconfCloudMigNotice=In the Cloud instance, please add linkAdjustments to draw.io configuration as follows {1}. Without this configuration, links in diagrams pointing to Confluence pages will not work.\nconfALogsPageDesc=This page contains logs of draw.io long running services as attachments\nconfEditOnlyInPageEditor=Can only be edited within Confluence page editor\nconfEvalWarn=Evaluation License - Not for Production Use\notherUsersEditing=Other user(s) are editing this diagram\nfirstTimeGD=First time to access this file?\ndrawioGDAppNotInstalled=draw.io Google Drive app is not installed, please install it first\nConfDC415Error=Saving drafts is blocked. If you have "Attachment Checker for Confluence" app, please update to the latest version.\nremove=Remove\nselectPgLyr=Select Page and Layers\nerrGenPreview=There was an error generating a diagram preview. Please consult technical support.\nattAccessErr=Diagram attachment access error: cannot display diagram\nwidthIntOrFixed=Width must be a valid integer or of value \'fixed\'\ndupDisabledPgLyrSlct=Diagram duplication is disabled when page and layers are selected\ncantDupPickDiffName=Could not duplicate diagram. Please choose a different name.\nownPgAccessDupErr=Owning page access restriction: cannot duplicate diagram.\ncantDupTryLater=Could not duplicate diagram. Please try again later.\ncantEditLnkd=Cannot edit linked diagram\ndiagEditOwnPgOnlyOpen=Diagram can only be edited from the page that owns it. Would you like to open the owning page for edit?\ndiagInTemps=draw.io diagrams in templates\ndiagInTempsCantEdit=Diagrams in page templates cannot be edited. They can only be edited on pages and blog posts.\nconfDirectEditDraftLost=This Confluence page has unpublished changes. Editing the diagram from page view may cause data loss. Please edit the Confluence page first and then edit the diagram.\nconfConfigSpacePerm=Note: If you recently migrated from DC app, please check draw.io Configuration space permissions such that all users can read and only admins can write. In addition, remove the page restrictions on "Configuration" and "Libraries" pages. You may need admin keys to access them. Also, please check the file "configuration.json" in the "Configuration" page is downloadable.\ntryCurPageOnErr=Try finding the diagram attachment on the macro page when the linked page fails\nconfAExtSrvcNoSupported=Embedded diagrams from external services or urls are not supported.\ngliffyVersionPinning=Import Gliffy pinned version instead of the latest version\nconfEmbedUpload=For a better editing experience, please use the regular draw.io macro to insert a blank diagram, then from (File menu → Import From → Device...) select the file you want to upload and embed.\nconfPublishErr=Another update conflicted with your publish, please try the operation again\nconfACacheMapping=Cache Page IDs Mapping\nconfARemImpPages=Remember Imported Pages\ndelCachedData=Delete Cached Data\nk15tPagesError=Error retrieving Scroll pages. Is Scroll Versions installed?\ndrawioUninstalled=draw.io has been uninstalled, the editor will now close\nconfAttachmentArchived=Diagram belongs to an archived page and cannot be loaded. Restore the page (ID: {1}) to load it.\nconfDiagramMacroDowngrade=The diagram is saved but the page macro cannot be updated as the diagraam revision in the macro is newer. Please edit the diagram from Confluence page editor.\nDCSave500Error=Another Confluence operation interrupted saving, retry #{1}\nconfAppNotInstalled=draw.io diagrams Confluence App is not installed.\nplsInstallAppInConf=Please install/connect this App in Confluence to be able to access the diagrams (in addition to draw.io Confluence app)\nm365=Microsoft 365\nnodeSpacing=Node Spacing\nrankSpacing=Rank Spacing\npolyline=Polyline\nlayeringStrategy=Layering Strategy\nnetworkSimplex=Network Simplex\nlongestPath=Longest Path\ncoffmanGraham=Coffman-Graham\nweighting=Weighting\nmodelOrder=Model Order\ndescendants=Descendants\nconstraint=Constraint\nfan=Fan\noptimization=Optimization\nedgeLength=Edge Length\nedgeLengthByPosition=Edge Length by Position\ncrossingMinimization=Crossing Minimization\niterations=Iterations\nrepulsivePower=Repulsive Power\nresizeNodes=Resize Nodes\nuseSelectionAsRoot=Use Selection as Root\nuseSelectionAsRoots=Use Selection as Roots\nanonymize=Anonymize\nconnector=Connector\nextractText=Extract Text\nlegacyLayouts=Legacy Layouts\nedgeStyle=Edge Style\ncorners=Corners\nkeepStyle=Keep Existing Style\nopenLucidSite=Open Lucidchart Site in another tab and login to your account, then come back to this tab and click the "Start Import" button again.\npreviewSaveNoPermission=You do not have permission to save the preview image. The source page may be restricted or you may not have edit permission on the page. This only affects this page export to PDF/Word.\npreserveOrigin=Preserve Origin\nsharedStems=Bundle Outgoing Connections\ndraftLoadedWUnpublishedChanges=The diagram has loaded from a draft with unpublished changes. It is different from the published version.\nhachure=Hachure\nhatch=Hatch\ndots=Dots\ncrossHatch=Cross Hatch\nzigzag=ZigZag\nzigzagLine=ZigZag Line\nsysFonts=System Fonts\nwebfonts=Web Fonts\nfontname=Font Name\nfontUrl=Font URL\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;Graph.prototype.defaultThemes.darkTheme=Graph.prototype.defaultThemes["default-style2"];Editor.currentTheme="";window.uiTheme="";GraphViewer=function(b,d,m){this.init(b,d,m)};mxUtils.extend(GraphViewer,mxEventSource);GraphViewer.prototype.editBlankUrl="1"==urlParams.dev?"https://test.draw.io/":"https://app.diagrams.net/";GraphViewer.prototype.imageBaseUrl=window.DRAWIO_BASE_URL+"/";GraphViewer.prototype.toolbarHeight="BackCompat"==document.compatMode?24:26;GraphViewer.prototype.lightboxChrome=!0;GraphViewer.prototype.lightboxZIndex=999;GraphViewer.prototype.toolbarZIndex=999;GraphViewer.prototype.autoFit=!1;GraphViewer.prototype.autoCrop=!1;GraphViewer.prototype.autoOrigin=!0;GraphViewer.prototype.center=!1;GraphViewer.prototype.forceCenter=!1;GraphViewer.prototype.allowZoomIn=!1;GraphViewer.prototype.allowZoomOut=!0;GraphViewer.prototype.showTitleAsTooltip=!1;GraphViewer.prototype.checkVisibleState=!0;GraphViewer.prototype.minHeight=28;GraphViewer.prototype.minWidth=100;GraphViewer.prototype.responsive=!1;GraphViewer.prototype.darkMode=null;GraphViewer.prototype.showLinkIcons=!1;GraphViewer.prototype.showTooltipIcons=!1;@@ -4829,20 +4832,20 @@ GraphViewer.prototype.init=function(b,d,m){GraphViewer.initCss();this.graphConfinull!=this.graphConfig["allow-zoom-in"]?this.graphConfig["allow-zoom-in"]:this.allowZoomIn;this.forceCenter=null!=this.graphConfig.forceCenter?this.graphConfig.forceCenter:this.forceCenter;this.hCenterOnly=null!=this.graphConfig.hCenterOnly?this.graphConfig.hCenterOnly:this.hCenterOnly;this.center=null!=this.graphConfig.center?this.graphConfig.center:this.center||this.forceCenter;this.checkVisibleState=null!=this.graphConfig["check-visible-state"]?this.graphConfig["check-visible-state"]:this.checkVisibleState;this.darkMode=null!=this.graphConfig["dark-mode"]?this.graphConfig["dark-mode"]:this.darkMode;this.showLinkIcons=null!=this.graphConfig["show-link-icons"]?this.graphConfig["show-link-icons"]:this.showLinkIcons;this.showTooltipIcons=null!=this.graphConfig["show-tooltip-icons"]?this.graphConfig["show-tooltip-icons"]:this.showTooltipIcons;this.toolbarItems=null!=this.graphConfig.toolbar?this.graphConfig.toolbar.split(" "):[];this.zoomEnabled=0<=mxUtils.indexOf(this.toolbarItems,"zoom");this.layersEnabled=0<=mxUtils.indexOf(this.toolbarItems,"layers");this.tagsEnabled=0<=mxUtils.indexOf(this.toolbarItems,"tags");this.lightboxEnabled=0<=mxUtils.indexOf(this.toolbarItems,"lightbox");this.lightboxClickEnabled=0!=this.graphConfig.lightbox;this.initialOverflow=document.body.style.overflow;this.initialWidth=null!=b?b.style.width:null;this.widthIsEmpty=null!=this.initialWidth?""==this.initialWidth:!0;this.currentPage=parseInt(this.graphConfig.page)||0;this.responsive=(null!=this.graphConfig.responsive?this.graphConfig.responsive:-this.responsive)&&!this.zoomEnabled&&!mxClient.NO_FO&&!mxClient.IS_SF;this.pageId=this.graphConfig.pageId;this.browserTranslate=mxClient.IS_GC&&(null!=this.graphConfig["browser-translate"]?this.graphConfig["browser-translate"]:!0);this.editor=null;var p=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=d&&(this.xmlDocument=d.ownerDocument,this.xmlNode=d,this.xml=mxUtils.getXml(d),null!=b)){var v=mxUtils.bind(this,function(){this.graph=new Graph(b);-this.browserTranslate&&this.graph.waitForBrowserTranslate();this.graph.enableFlowAnimation=!0;this.installDarkModeListener();if(this.responsive&&this.graph.dialect==mxConstants.DIALECT_SVG){var C=this.graph.view.getDrawPane().ownerSVGElement,P=0;null!=this.graphConfig.border?P=this.graphConfig.border:""==b.style.padding&&(P=8);0<P&&(b.style.padding=P+"px",b.style.boxSizing="border-box");C.style.forcedColorAdjust="none";C.style.boxSizing="border-box";C.style.overflow="visible";this.graph.fit=function(){};-var G=parseFloat(this.graphConfig["responsive-max-scale"]),O=parseFloat(b.style.maxWidth);this.graph.sizeDidChange=function(){var K=this.view.graphBounds,fa=this.view.translate;C.setAttribute("viewBox",K.x+fa.x-this.panDx+" "+(K.y+fa.y-this.panDy)+" "+(K.width+1)+" "+(K.height+1));this.container.style.backgroundColor=C.style.backgroundColor;isNaN(G)||(fa=Math.round((K.width+1)*G+2*P),fa=isNaN(O)?fa:Math.min(fa,O),this.container.style.maxWidth=fa+"px");this.fireEvent(new mxEventObject(mxEvent.SIZE,+this.responsive)&&!this.zoomEnabled&&!mxClient.NO_FO&&!mxClient.IS_SF;this.pageId=this.graphConfig.pageId;this.browserTranslate=mxClient.IS_GC&&(null!=this.graphConfig["browser-translate"]?this.graphConfig["browser-translate"]:!0);this.editor=null;var p=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=d&&(this.xmlDocument=d.ownerDocument,this.xmlNode=d,this.xml=mxUtils.getXml(d),null!=b)){var u=mxUtils.bind(this,function(){this.graph=new Graph(b);+this.browserTranslate&&this.graph.waitForBrowserTranslate();this.graph.enableFlowAnimation=!0;this.installDarkModeListener();if(this.responsive&&this.graph.dialect==mxConstants.DIALECT_SVG){var B=this.graph.view.getDrawPane().ownerSVGElement,P=0;null!=this.graphConfig.border?P=this.graphConfig.border:""==b.style.padding&&(P=8);0<P&&(b.style.padding=P+"px",b.style.boxSizing="border-box");B.style.forcedColorAdjust="none";B.style.boxSizing="border-box";B.style.overflow="visible";this.graph.fit=function(){};+var G=parseFloat(this.graphConfig["responsive-max-scale"]),O=parseFloat(b.style.maxWidth);this.graph.sizeDidChange=function(){var K=this.view.graphBounds,fa=this.view.translate;B.setAttribute("viewBox",K.x+fa.x-this.panDx+" "+(K.y+fa.y-this.panDy)+" "+(K.width+1)+" "+(K.height+1));this.container.style.backgroundColor=B.style.backgroundColor;isNaN(G)||(fa=Math.round((K.width+1)*G+2*P),fa=isNaN(O)?fa:Math.min(fa,O),this.container.style.maxWidth=fa+"px");this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",K))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(K){return!0});this.lightboxClickEnabled&&(b.style.cursor="pointer");this.editor=new Editor(!0,null,null,this.graph);this.editor.editBlankUrl=this.editBlankUrl;this.graph.lightbox=!0;this.graph.centerZoom=!1;this.graph.autoExtend=!1;this.graph.autoScroll=!1;this.graph.showLinkIcons=this.showLinkIcons;this.graph.showTooltipIcons=this.showTooltipIcons;this.graph.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");var U=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=U&&U!=d)try{this.xml=mxUtils.getXml(U),this.xmlNode=U,this.xmlDocument=U.ownerDocument}catch(K){}this.graph.getImageFromBundles=function(K){return p.getImageUrl(K)};this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==this.xmlNode.nodeName){var c=this.xmlNode.getElementsByTagName("diagram");if(0<c.length){if(null!=this.pageId)for(U=0;U<c.length;U++)if(this.pageId==c[U].getAttribute("id")){this.currentPage=U;break}var f=this.graph.getGlobalVariable,k=null;try{var q=p.xmlNode.getAttribute("vars");null!=q&&0<q.length&&(k=JSON.parse(q))}catch(K){}this.graph.getGlobalVariable=function(K){var fa=c[p.currentPage];if("page"==K)return fa.getAttribute("name")||mxResources.get("pageWithNumber",[p.currentPage+1],"Page-"+(p.currentPage+1));if("pagenumber"==K)return p.currentPage+1;if("pagecount"==K)return c.length;fa=f.apply(this,arguments);null==fa&&null!=k&&(fa=k[K]);return fa}}}this.diagrams=[];var x=null;this.selectPage=function(K){if(!this.handlingResize){if(this.tagsEnabled&&null!=this.graphConfig.hiddenTags&&null!=this.diagrams[this.currentPage]){var fa=this.diagrams[this.currentPage].getAttribute("id");this.graphConfig.hiddenTags[fa]=0<this.graph.hiddenTags.length?this.graph.hiddenTags.slice():null}this.currentPage=mxUtils.mod(K,this.diagrams.length);this.tagsEnabled&&null!=this.graphConfig.hiddenTags&&null!=this.diagrams[this.currentPage]&&(K=this.diagrams[this.currentPage].getAttribute("id"),K=this.graphConfig.hiddenTags[K],-this.graph.hiddenTags=null!=K&&0<K.length?K:[]);this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage]))}};this.selectPageById=function(K){K=this.getIndexById(K);var fa=0<=K;fa&&this.selectPage(K);return fa};q=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=x&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),x=this.xmlNode)});var B=this.graph.setBackgroundImage;this.graph.setBackgroundImage=function(K){if(null!=-K&&Graph.isPageLink(K.src)){var fa=K.src,aa=fa.indexOf(",");0<aa&&(aa=p.getIndexById(fa.substring(aa+1)),0<=aa&&(K=p.getImageForGraphModel(Editor.parseDiagramNode(p.diagrams[aa])),K.originalSrc=fa))}B.apply(this,arguments)};var E=this.graph.getGraphBounds;this.graph.getGraphBounds=function(K){var fa=E.apply(this,arguments);K=this.backgroundImage;if(null!=K){var aa=this.view.translate,da=this.view.scale;fa=mxRectangle.fromRectangle(fa);fa.add(new mxRectangle((aa.x+K.x)*da,(aa.y+K.y)*da,K.width*da,+this.graph.hiddenTags=null!=K&&0<K.length?K:[]);this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage]))}};this.selectPageById=function(K){K=this.getIndexById(K);var fa=0<=K;fa&&this.selectPage(K);return fa};q=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=x&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),x=this.xmlNode)});var C=this.graph.setBackgroundImage;this.graph.setBackgroundImage=function(K){if(null!=+K&&Graph.isPageLink(K.src)){var fa=K.src,aa=fa.indexOf(",");0<aa&&(aa=p.getIndexById(fa.substring(aa+1)),0<=aa&&(K=p.getImageForGraphModel(Editor.parseDiagramNode(p.diagrams[aa])),K.originalSrc=fa))}C.apply(this,arguments)};var E=this.graph.getGraphBounds;this.graph.getGraphBounds=function(K){var fa=E.apply(this,arguments);K=this.backgroundImage;if(null!=K){var aa=this.view.translate,da=this.view.scale;fa=mxRectangle.fromRectangle(fa);fa.add(new mxRectangle((aa.x+K.x)*da,(aa.y+K.y)*da,K.width*da,K.height*da))}return fa};this.addListener("xmlNodeChanged",q);q();urlParams.page=p.currentPage;q=null;this.graph.getModel().beginUpdate();try{urlParams.nav=0!=this.graphConfig.nav?"1":"0";this.editor.setGraphXml(this.xmlNode);this.graph.view.scale=this.graphConfig.zoom||1;q=this.setLayersVisible();if(this.tagsEnabled&&null!=this.graphConfig.hiddenTags&&null!=this.diagrams&&null!=this.diagrams[this.currentPage]){var L=this.diagrams[this.currentPage].getAttribute("id"),Q=this.graphConfig.hiddenTags[L];null!=Q&&0<Q.length&&(this.graph.hiddenTags=Q)}this.fireEvent(new mxEventObject("graphInitialized"));this.responsive||(this.graph.border=null!=this.graphConfig.border?this.graphConfig.border:8);this.installBackgroundColorHandler();GraphViewer.viewerInitialized(this)}finally{this.graph.getModel().endUpdate()}this.responsive||(this.graph.panningHandler.isForcePanningEvent=function(K){return!mxEvent.isPopupTrigger(K.getEvent())&&"auto"==this.graph.container.style.overflow},this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.panningHandler.ignoreCell=!0,this.graph.panningHandler.usePopupTrigger=!1,this.graph.panningHandler.pinchEnabled=!1);this.graph.setPanning(!1);null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&b.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title);this.responsive||this.addSizeHandler();!this.showLayers(this.graph)||this.forceCenter||this.layersEnabled&&!this.autoCrop||this.crop();this.addClickHandler(this.graph);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=q&&this.setLayersVisible(q);this.graph.customLinkClicked=function(K,fa){try{if(Graph.isPageLink(K)){var aa=K.indexOf(",");p.selectPageById(K.substring(aa+1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var da=this.getGraphBounds();this.handleCustomLink(K,fa);da.equals(this.getGraphBounds())||p.crop()}}catch(ba){alert(ba.message)}return!0};var V=this.graph.foldTreeCell;this.graph.foldTreeCell=-mxUtils.bind(this,function(){this.treeCellFolded=!0;return V.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});m=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==b.offsetWidth&&null==this.getAncestorDetails(b)&&"undefined"!==typeof m){var n=this.getObservableParent(b),y=new m(mxUtils.bind(this,function(C){0<b.offsetWidth&&(y.disconnect(),v())}));y.observe(n,{attributes:!0})}else v()}};+mxUtils.bind(this,function(){this.treeCellFolded=!0;return V.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});m=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==b.offsetWidth&&null==this.getAncestorDetails(b)&&"undefined"!==typeof m){var n=this.getObservableParent(b),y=new m(mxUtils.bind(this,function(B){0<b.offsetWidth&&(y.disconnect(),u())}));y.observe(n,{attributes:!0})}else u()}};GraphViewer.prototype.installBackgroundColorHandler=function(){var b=this.graph;if(null!=b){null!=GraphViewer.shapeBackgroundColor&&(b.shapeBackgroundColor=GraphViewer.shapeBackgroundColor);b.defaultPageBackgroundColor="transparent";b.diagramBackgroundColor="transparent";b.transparentBackground=!1;var d=b.background,m=mxUtils.bind(this,function(p){"none"==b.getAdaptiveColors()&&null==d&&(this.isDarkMode()?b.background="#ffffff":b.background=null,p&&b.view.validateBackground())});this.addListener("graphChanged",function(){d=b.background;m(!0)});this.addListener("darkModeChanged",function(){m(!0)});m(!1)}};GraphViewer.prototype.installDarkModeListener=function(){null!=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(){this.darkModeChanged();this.fireEvent(new mxEventObject("darkModeChanged"))}));this.darkModeChanged()};GraphViewer.prototype.darkModeChanged=function(){if(null!=this.graph){var b=this.graph.container,d=this.isDarkMode();d?b.classList.add("geDarkMode"):b.classList.remove("geDarkMode");b.style.colorScheme=d?"dark":"light"}};GraphViewer.prototype.getAncestorDetails=function(b){for(;null!=b;){if("DETAILS"==b.nodeName)return b;b=b.parentNode}return null};@@ -4850,64 +4853,64 @@ GraphViewer.prototype.getObservableParent=function(b){for(b=b.parentNode;b!=docuGraphViewer.prototype.getImageForGraphModel=function(b){var d=Graph.createOffscreenGraph(this.graph.getStylesheet());d.getGlobalVariable=this.graph.getGlobalVariable;document.body.appendChild(d.container);b=(new mxCodec(b.ownerDocument)).decode(b).root;d.model.setRoot(b);b=d.getSvg();var m=d.getGraphBounds();document.body.removeChild(d.container);return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(b)),m.width,m.height,m.x,m.y)};GraphViewer.prototype.getIndexById=function(b){if(null!=this.diagrams)for(var d=0;d<this.diagrams.length;d++)if(this.diagrams[d].getAttribute("id")==b)return d;return-1};GraphViewer.prototype.setXmlNode=function(b){b=this.editor.extractGraphModel(b,!0);this.xmlDocument=b.ownerDocument;this.xml=mxUtils.getXml(b);this.xmlNode=b;this.updateGraphXml(b);this.fireEvent(new mxEventObject("xmlNodeChanged"))};GraphViewer.prototype.setFileNode=function(b){null==this.xmlNode&&(this.xmlDocument=b.ownerDocument,this.xml=mxUtils.getXml(b),this.xmlNode=b);this.setGraphXml(b)};GraphViewer.prototype.updateGraphXml=function(b){this.setGraphXml(b);this.fireEvent(new mxEventObject("graphChanged"))};-GraphViewer.prototype.setLayersVisible=function(b){var d=!0;if(!this.autoOrigin){var m=[],p=this.graph.getModel();p.beginUpdate();try{for(var v=0;v<p.getChildCount(p.root);v++){var n=p.getChildAt(p.root,v);d=d&&p.isVisible(n);m.push(p.isVisible(n));p.setVisible(n,null!=b?b[v]:!0)}}finally{p.endUpdate()}}return d?null:m};+GraphViewer.prototype.setLayersVisible=function(b){var d=!0;if(!this.autoOrigin){var m=[],p=this.graph.getModel();p.beginUpdate();try{for(var u=0;u<p.getChildCount(p.root);u++){var n=p.getChildAt(p.root,u);d=d&&p.isVisible(n);m.push(p.isVisible(n));p.setVisible(n,null!=b?b[u]:!0)}}finally{p.endUpdate()}}return d?null:m};GraphViewer.prototype.setGraphXml=function(b){if(null!=this.graph){this.graph.view.translate=new mxPoint;this.graph.view.scale=1;var d=null;this.graph.getModel().beginUpdate();try{this.graph.getModel().clear(),this.editor.setGraphXml(b),d=this.setLayersVisible(!0)}finally{this.graph.getModel().endUpdate()}this.responsive||(this.widthIsEmpty?(this.graph.container.style.width="",this.graph.container.style.height=""):this.graph.container.style.width=this.initialWidth,this.positionGraph());this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};d&&this.setLayersVisible(d)}};GraphViewer.prototype.isDarkMode=function(){return"dark"==this.darkMode||"auto"==this.darkMode&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches};-GraphViewer.prototype.addSizeHandler=function(){var b=this.graph.container,d=this.graph.getGraphBounds(),m=!1;b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var p=mxUtils.bind(this,function(){if(!m){m=!0;var C=this.graph.getGraphBounds();b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?C.width+2*this.graph.border>b.offsetWidth-2?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){C=b.getBoundingClientRect();var P=mxUtils.getScrollOrigin(document.body);-P="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-P.x,top:-P.y};C={left:C.left-P.left,top:C.top-P.top,bottom:C.bottom-P.top,right:C.right-P.left};this.toolbar.style.left=C.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=C.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px",this.toolbar.style.top=C.top+1+"px"):this.toolbar.style.top=C.top+"px"}else null!=-this.toolbar&&(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px");this.treeCellFolded&&(this.treeCellFolded=!1,this.positionGraph(this.graph.view.translate),this.graph.initialViewState.translate=this.graph.view.translate.clone());m=!1}}),v=null;this.handlingResize=!1;this.fitGraph=mxUtils.bind(this,function(C){var P=b.offsetWidth;P==v||this.handlingResize||(this.handlingResize=!0,"auto"==b.style.overflow&&(b.style.overflow="hidden"),this.graph.maxFitScale=null!=C?C:this.graphConfig.zoom||-(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,null,!0),(this.center||0==this.graphConfig.resize&&""!=b.style.height)&&this.graph.center(!0,this.hCenterOnly?!1:!0),this.graph.maxFitScale=null,(0!=this.graphConfig.resize||""==b.style.height||this.hCenterOnly)&&this.updateContainerHeight(b,Math.max(this.minHeight,this.graph.getGraphBounds().height+2*this.graph.border+1)),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},v=P,window.setTimeout(mxUtils.bind(this,+GraphViewer.prototype.addSizeHandler=function(){var b=this.graph.container,d=this.graph.getGraphBounds(),m=!1;b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var p=mxUtils.bind(this,function(){if(!m){m=!0;var B=this.graph.getGraphBounds();b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?B.width+2*this.graph.border>b.offsetWidth-2?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){B=b.getBoundingClientRect();var P=mxUtils.getScrollOrigin(document.body);+P="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-P.x,top:-P.y};B={left:B.left-P.left,top:B.top-P.top,bottom:B.bottom-P.top,right:B.right-P.left};this.toolbar.style.left=B.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=B.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px",this.toolbar.style.top=B.top+1+"px"):this.toolbar.style.top=B.top+"px"}else null!=+this.toolbar&&(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px");this.treeCellFolded&&(this.treeCellFolded=!1,this.positionGraph(this.graph.view.translate),this.graph.initialViewState.translate=this.graph.view.translate.clone());m=!1}}),u=null;this.handlingResize=!1;this.fitGraph=mxUtils.bind(this,function(B){var P=b.offsetWidth;P==u||this.handlingResize||(this.handlingResize=!0,"auto"==b.style.overflow&&(b.style.overflow="hidden"),this.graph.maxFitScale=null!=B?B:this.graphConfig.zoom||+(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,null,!0),(this.center||0==this.graphConfig.resize&&""!=b.style.height)&&this.graph.center(!0,this.hCenterOnly?!1:!0),this.graph.maxFitScale=null,(0!=this.graphConfig.resize||""==b.style.height||this.hCenterOnly)&&this.updateContainerHeight(b,Math.max(this.minHeight,this.graph.getGraphBounds().height+2*this.graph.border+1)),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},u=P,window.setTimeout(mxUtils.bind(this,function(){this.handlingResize=!1}),0))});GraphViewer.useResizeSensor&&(9>=document.documentMode?(mxEvent.addListener(window,"resize",p),this.graph.addListener("size",p)):new ResizeSensor(this.graph.container,p));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,this.minWidth,this.minHeight),this.graph.resizeContainer=!0;else if(!this.widthIsEmpty||""!=b.style.height&&this.autoFit||this.updateContainerWidth(b,-d.width+2*this.graph.border),0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,d.height+2*this.graph.border+1)),!this.zoomEnabled&&this.autoFit){var n=v=null;p=mxUtils.bind(this,function(){window.clearTimeout(n);this.handlingResize||(n=window.setTimeout(mxUtils.bind(this,this.fitGraph),100))});GraphViewer.useResizeSensor&&(9>=document.documentMode?mxEvent.addListener(window,"resize",p):new ResizeSensor(this.graph.container,p))}else 9>=document.documentMode||-this.graph.addListener("size",p);var y=mxUtils.bind(this,function(C){var P=b.style.minWidth;this.widthIsEmpty&&(b.style.minWidth="100%");var G=null!=this.graphConfig["max-height"]?this.graphConfig["max-height"]:""!=b.style.height&&this.autoFit?b.offsetHeight:void 0;0<b.offsetWidth&&null==C&&this.allowZoomOut&&(this.allowZoomIn||d.width+2*this.graph.border>b.offsetWidth||d.height+2*this.graph.border>G)?(C=null,null!=G&&d.height+2*this.graph.border>G-2&&(C=(G-2*this.graph.border-2)/d.height),this.fitGraph(C)):-this.widthIsEmpty||null!=C||0!=this.graphConfig.resize||""==b.style.height?(C=null!=C?C:new mxPoint,this.graph.view.setTranslate(Math.floor(this.graph.border-d.x/this.graph.view.scale)+C.x,Math.floor(this.graph.border-d.y/this.graph.view.scale)+C.y),v=b.offsetWidth):this.graph.center((!this.widthIsEmpty||d.width<this.minWidth)&&1!=this.graphConfig.resize);b.style.minWidth=P});8==document.documentMode?window.setTimeout(y,0):y();this.positionGraph=function(C){d=this.graph.getGraphBounds();v=null;y(C)}};+d.width+2*this.graph.border),0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,d.height+2*this.graph.border+1)),!this.zoomEnabled&&this.autoFit){var n=u=null;p=mxUtils.bind(this,function(){window.clearTimeout(n);this.handlingResize||(n=window.setTimeout(mxUtils.bind(this,this.fitGraph),100))});GraphViewer.useResizeSensor&&(9>=document.documentMode?mxEvent.addListener(window,"resize",p):new ResizeSensor(this.graph.container,p))}else 9>=document.documentMode||+this.graph.addListener("size",p);var y=mxUtils.bind(this,function(B){var P=b.style.minWidth;this.widthIsEmpty&&(b.style.minWidth="100%");var G=null!=this.graphConfig["max-height"]?this.graphConfig["max-height"]:""!=b.style.height&&this.autoFit?b.offsetHeight:void 0;0<b.offsetWidth&&null==B&&this.allowZoomOut&&(this.allowZoomIn||d.width+2*this.graph.border>b.offsetWidth||d.height+2*this.graph.border>G)?(B=null,null!=G&&d.height+2*this.graph.border>G-2&&(B=(G-2*this.graph.border-2)/d.height),this.fitGraph(B)):+this.widthIsEmpty||null!=B||0!=this.graphConfig.resize||""==b.style.height?(B=null!=B?B:new mxPoint,this.graph.view.setTranslate(Math.floor(this.graph.border-d.x/this.graph.view.scale)+B.x,Math.floor(this.graph.border-d.y/this.graph.view.scale)+B.y),u=b.offsetWidth):this.graph.center((!this.widthIsEmpty||d.width<this.minWidth)&&1!=this.graphConfig.resize);b.style.minWidth=P});8==document.documentMode?window.setTimeout(y,0):y();this.positionGraph=function(B){d=this.graph.getGraphBounds();u=null;y(B)}};GraphViewer.prototype.crop=function(){var b=this.graph,d=b.getGraphBounds(),m=b.border,p=b.view.scale;b.view.setTranslate(null!=d.x?Math.floor(b.view.translate.x-d.x/p+m):m,null!=d.y?Math.floor(b.view.translate.y-d.y/p+m):m)};GraphViewer.prototype.updateContainerWidth=function(b,d){b.style.width=d+"px"};GraphViewer.prototype.updateContainerHeight=function(b,d){if(this.forceCenter||this.zoomEnabled||!this.autoFit||"BackCompat"==document.compatMode||8==document.documentMode)b.style.height=d+"px"};-GraphViewer.prototype.showLayers=function(b,d){var m=this.graphConfig.layers;m=null!=m&&0<m.length?m.split(" "):[];var p=this.graphConfig.layerIds,v=null!=p&&0<p.length,n=!1;if(0<m.length||v||null!=d){d=null!=d?d.getModel():null;b=b.getModel();b.beginUpdate();try{var y=b.getChildCount(b.root);if(null==d){d=!1;n={};if(v)for(var C=0;C<p.length;C++){var P=b.getCell(p[C]);null!=P&&(d=!0,n[P.id]=!0)}else for(C=0;C<m.length;C++)P=b.getChildAt(b.root,parseInt(m[C])),null!=P&&(d=!0,n[P.id]=!0);for(C=0;d&&-C<y;C++)P=b.getChildAt(b.root,C),b.setVisible(P,n[P.id]||!1)}else for(C=0;C<y;C++)b.setVisible(b.getChildAt(b.root,C),d.isVisible(d.getChildAt(d.root,C)))}finally{b.endUpdate()}n=!0}return n};+GraphViewer.prototype.showLayers=function(b,d){var m=this.graphConfig.layers;m=null!=m&&0<m.length?m.split(" "):[];var p=this.graphConfig.layerIds,u=null!=p&&0<p.length,n=!1;if(0<m.length||u||null!=d){d=null!=d?d.getModel():null;b=b.getModel();b.beginUpdate();try{var y=b.getChildCount(b.root);if(null==d){d=!1;n={};if(u)for(var B=0;B<p.length;B++){var P=b.getCell(p[B]);null!=P&&(d=!0,n[P.id]=!0)}else for(B=0;B<m.length;B++)P=b.getChildAt(b.root,parseInt(m[B])),null!=P&&(d=!0,n[P.id]=!0);for(B=0;d&&+B<y;B++)P=b.getChildAt(b.root,B),b.setVisible(P,n[P.id]||!1)}else for(B=0;B<y;B++)b.setVisible(b.getChildAt(b.root,B),d.isVisible(d.getChildAt(d.root,B)))}finally{b.endUpdate()}n=!0}return n};GraphViewer.prototype.addToolbar=function(){var b=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?b.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(b.style.marginTop=this.toolbarHeight+"px");var d=b.ownerDocument.createElement("div");d.style.display="flex";d.style.alignItems="center";d.style.position="absolute";d.style.overflow="hidden";d.style.boxSizing="border-box";d.style.whiteSpace="nowrap";d.style.textAlign="left";d.style.zIndex=this.toolbarZIndex;d.style.backgroundColor="light-dark(#eeeeee, "+GraphViewer.darkBackgroundColor+")";d.style.height=this.toolbarHeight+"px";var m=mxUtils.bind(this,function(){this.isDarkMode()?(d.classList.add("geDarkMode"),d.style.colorScheme="dark"):(d.classList.remove("geDarkMode"),d.style.colorScheme="light")});this.addListener("darkModeChanged",m);this.toolbar=d;m();if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(d.style,"transition","opacity 100ms ease-in-out");-mxUtils.setOpacity(d,30);var p=null,v=null,n=mxUtils.bind(this,function(aa){null!=p&&(window.clearTimeout(p),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);p=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(d,0);p=null;v=window.setTimeout(mxUtils.bind(this,function(){d.style.display="none";v=null}),100)}),aa||200)}),y=mxUtils.bind(this,function(aa){null!=p&&(window.clearTimeout(p),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);d.style.display=+mxUtils.setOpacity(d,30);var p=null,u=null,n=mxUtils.bind(this,function(aa){null!=p&&(window.clearTimeout(p),fadeThead=null);null!=u&&(window.clearTimeout(u),fadeThead2=null);p=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(d,0);p=null;u=window.setTimeout(mxUtils.bind(this,function(){d.style.display="none";u=null}),100)}),aa||200)}),y=mxUtils.bind(this,function(aa){null!=p&&(window.clearTimeout(p),fadeThead=null);null!=u&&(window.clearTimeout(u),fadeThead2=null);d.style.display="flex";mxUtils.setOpacity(d,aa||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(aa){mxEvent.isTouchEvent(aa)||(y(30),n())}));mxEvent.addListener(d,mxClient.IS_POINTER?"pointermove":"mousemove",function(aa){mxEvent.consume(aa)});mxEvent.addListener(d,"mouseenter",mxUtils.bind(this,function(aa){y(100)}));mxEvent.addListener(d,"mousemove",mxUtils.bind(this,function(aa){y(100);mxEvent.consume(aa)}));mxEvent.addListener(d,"mouseleave",-mxUtils.bind(this,function(aa){mxEvent.isTouchEvent(aa)||y(30)}));var C=this.graph,P=C.getTolerance();C.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(aa,da){this.startX=da.getGraphX();this.startY=da.getGraphY();this.scrollLeft=C.container.scrollLeft;this.scrollTop=C.container.scrollTop},mouseMove:function(aa,da){},mouseUp:function(aa,da){mxEvent.isTouchEvent(da.getEvent())&&Math.abs(this.scrollLeft-C.container.scrollLeft)<P&&Math.abs(this.scrollTop-C.container.scrollTop)<-P&&Math.abs(this.startX-da.getGraphX())<P&&Math.abs(this.startY-da.getGraphY())<P&&(0<parseFloat(d.style.opacity||0)?n():y(30))}})}m=this.toolbarItems;for(var G=0,O=mxUtils.bind(this,function(aa,da,ba,ha){aa=this.createToolbarButton(aa,da,ba,ha);d.appendChild(aa);G++;return aa}),U=this.graph.getModel(),c=null,f=null,k=null,q=null,x=0;x<m.length;x++){var B=m[x];if("pages"==B){q=b.ownerDocument.createElement("div");q.style.display="inline-flex";q.style.position="relative";q.style.alignItems="center";+mxUtils.bind(this,function(aa){mxEvent.isTouchEvent(aa)||y(30)}));var B=this.graph,P=B.getTolerance();B.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(aa,da){this.startX=da.getGraphX();this.startY=da.getGraphY();this.scrollLeft=B.container.scrollLeft;this.scrollTop=B.container.scrollTop},mouseMove:function(aa,da){},mouseUp:function(aa,da){mxEvent.isTouchEvent(da.getEvent())&&Math.abs(this.scrollLeft-B.container.scrollLeft)<P&&Math.abs(this.scrollTop-B.container.scrollTop)<+P&&Math.abs(this.startX-da.getGraphX())<P&&Math.abs(this.startY-da.getGraphY())<P&&(0<parseFloat(d.style.opacity||0)?n():y(30))}})}m=this.toolbarItems;for(var G=0,O=mxUtils.bind(this,function(aa,da,ba,ha){aa=this.createToolbarButton(aa,da,ba,ha);d.appendChild(aa);G++;return aa}),U=this.graph.getModel(),c=null,f=null,k=null,q=null,x=0;x<m.length;x++){var C=m[x];if("pages"==C){q=b.ownerDocument.createElement("div");q.style.display="inline-flex";q.style.position="relative";q.style.alignItems="center";q.style.padding="4px";q.style.fontFamily=GraphViewer.cssFontFamily;q.style.fontSize="12px";q.style.cursor="default";q.style.color="light-dark(#000000, #ffffff)";mxUtils.setOpacity(q,70);var E=O(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.chevronLeftImage,mxResources.get("previousPage")||"Previous Page");E.style.borderRightStyle="none";E.style.paddingLeft="0px";E.style.paddingRight="0px";d.appendChild(q);var L=O(mxUtils.bind(this,function(){this.selectPage(this.currentPage+-1)}),Editor.chevronRightImage,mxResources.get("nextPage")||"Next Page");L.style.paddingLeft="0px";L.style.paddingRight="0px";B=mxUtils.bind(this,function(){q.innerText="";mxUtils.write(q,this.currentPage+1+" / "+this.diagrams.length);q.style.display=1<this.diagrams.length?"inline-flex":"none";E.style.display=q.style.display;L.style.display=q.style.display});this.addListener("graphChanged",B);B()}else if("zoom"==B)this.zoomEnabled&&(O(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,-mxResources.get("zoomOut")||"Zoom Out"),O(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),O(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==B){if(this.layersEnabled){var Q=O(mxUtils.bind(this,function(aa){if(null!=c)c.parentNode.removeChild(c),+1)}),Editor.chevronRightImage,mxResources.get("nextPage")||"Next Page");L.style.paddingLeft="0px";L.style.paddingRight="0px";C=mxUtils.bind(this,function(){q.innerText="";mxUtils.write(q,this.currentPage+1+" / "+this.diagrams.length);q.style.display=1<this.diagrams.length?"inline-flex":"none";E.style.display=q.style.display;L.style.display=q.style.display});this.addListener("graphChanged",C);C()}else if("zoom"==C)this.zoomEnabled&&(O(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,+mxResources.get("zoomOut")||"Zoom Out"),O(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),O(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==C){if(this.layersEnabled){var Q=O(mxUtils.bind(this,function(aa){if(null!=c)c.parentNode.removeChild(c),c=null;else{c=this.graph.createLayersDialog(mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ba=this.graph.getGraphBounds(),ha=this.graph.view;0>ba.x||0>ba.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:ha.translate.clone(),scale:ha.scale}):null!=this.graph.originalViewState&&0<ba.x/ha.scale+this.graph.originalViewState.translate.x-ha.translate.x&&0<ba.y/ha.scale+this.graph.originalViewState.translate.y-ha.translate.y&&(ha.setTranslate(this.graph.originalViewState.translate.x,this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:ha.translate.clone(),scale:ha.scale})}}));mxEvent.addListener(c,"mouseleave",function(){c.parentNode.removeChild(c);c=null});aa=Q.getBoundingClientRect();c.style.width="140px";c.style.padding="2px 0px 2px 0px";c.style.border="1px solid #d0d0d0";c.style.backgroundColor="#eee";c.style.fontFamily=GraphViewer.cssFontFamily;c.style.fontSize="11px";c.style.overflowY="auto";c.style.maxHeight=this.graph.container.clientHeight-this.toolbarHeight-10+"px";c.style.zIndex=this.toolbarZIndex+1;c.style.color="#000";mxUtils.setOpacity(c,85);var da=mxUtils.getDocumentScrollOrigin(document);c.style.left=da.x+aa.left-1+"px";c.style.top=da.y+aa.bottom-2+"px";this.isDarkMode()&&(c.style.filter="invert(93%) hue-rotate(180deg)");document.body.appendChild(c)}}),Editor.layersImage,mxResources.get("layers")||"Layers");U.addListener(mxEvent.CHANGE,-function(){Q.style.display=1<U.getChildCount(U.root)?"inline-flex":"none"});Q.style.display=1<U.getChildCount(U.root)?"inline-flex":"none"}}else if("tags"==B){if(this.tagsEnabled){var V=O(mxUtils.bind(this,function(aa){null==f&&(f=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),this.graph.addListener(mxEvent.REFRESH,mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ba=this.graph.getGraphBounds(),ha=this.graph.view;0>ba.x||0>ba.y?(this.crop(),+function(){Q.style.display=1<U.getChildCount(U.root)?"inline-flex":"none"});Q.style.display=1<U.getChildCount(U.root)?"inline-flex":"none"}}else if("tags"==C){if(this.tagsEnabled){var V=O(mxUtils.bind(this,function(aa){null==f&&(f=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),this.graph.addListener(mxEvent.REFRESH,mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ba=this.graph.getGraphBounds(),ha=this.graph.view;0>ba.x||0>ba.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:ha.translate.clone(),scale:ha.scale}):null!=this.graph.originalViewState&&0<ba.x/ha.scale+this.graph.originalViewState.translate.x-ha.translate.x&&0<ba.y/ha.scale+this.graph.originalViewState.translate.y-ha.translate.y&&(ha.setTranslate(this.graph.originalViewState.translate.x,this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:ha.translate.clone(),scale:ha.scale})}})),f.div.getElementsByTagName("div")[0].style.position="",f.div.style.maxHeight="160px",f.div.style.maxWidth="120px",f.div.style.padding="2px",f.div.style.overflow="auto",f.div.style.height="auto",f.div.style.position="fixed",f.div.style.fontFamily=GraphViewer.cssFontFamily,f.div.style.fontSize="11px",f.div.style.backgroundColor="#eee",f.div.style.color="#000",f.div.style.border="1px solid #d0d0d0",f.div.style.zIndex=this.toolbarZIndex+1,this.isDarkMode()&&(f.div.style.filter="invert(93%) hue-rotate(180deg)"),mxUtils.setOpacity(f.div,85));if(null!=k)k.parentNode.removeChild(k),k=null;else{k=f.div;k.style.position="absolute";mxEvent.addListener(k,"mouseleave",function(){null!=k&&(k.parentNode.removeChild(k),k=null)});aa=V.getBoundingClientRect();var da=mxUtils.getDocumentScrollOrigin(document);k.style.left=da.x+aa.left-1+"px";k.style.top=da.y+aa.bottom-2+"px";document.body.appendChild(k);f.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");U.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){V.style.display=-0<this.graph.getAllTags().length?"inline-flex":"none";null!=k&&0==this.graph.getAllTags().length&&(k.parentNode.removeChild(k),k=null)}));V.style.display=0<this.graph.getAllTags().length?"inline-flex":"none"}}else"lightbox"==B?this.lightboxEnabled&&O(mxUtils.bind(this,function(){try{this.showLightbox()}catch(aa){alert(aa.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(B=this.graphConfig["toolbar-buttons"][B],null!=B&&(B.elem=-O(null==B.enabled||B.enabled?B.handler:function(){},B.image,B.title,B.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*G);null!=this.graphConfig.title&&(m=b.ownerDocument.createElement("div"),m.style.display="inline-flex",m.style.position="relative",m.style.alignItems="center",m.style.padding="6px",m.style.fontFamily=GraphViewer.cssFontFamily,m.style.fontSize="12px",m.style.cursor="default",m.style.color="light-dark(#000000, #ffffff)",m.setAttribute("title",+0<this.graph.getAllTags().length?"inline-flex":"none";null!=k&&0==this.graph.getAllTags().length&&(k.parentNode.removeChild(k),k=null)}));V.style.display=0<this.graph.getAllTags().length?"inline-flex":"none"}}else"lightbox"==C?this.lightboxEnabled&&O(mxUtils.bind(this,function(){try{this.showLightbox()}catch(aa){alert(aa.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(C=this.graphConfig["toolbar-buttons"][C],null!=C&&(C.elem=+O(null==C.enabled||C.enabled?C.handler:function(){},C.image,C.title,C.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*G);null!=this.graphConfig.title&&(m=b.ownerDocument.createElement("div"),m.style.display="inline-flex",m.style.position="relative",m.style.alignItems="center",m.style.padding="6px",m.style.fontFamily=GraphViewer.cssFontFamily,m.style.fontSize="12px",m.style.cursor="default",m.style.color="light-dark(#000000, #ffffff)",m.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title),mxUtils.write(m,this.graphConfig.title),mxUtils.setOpacity(m,70),d.appendChild(m),this.filename=m);this.minToolbarWidth=34*G;var K=b.style.border,fa=mxUtils.bind(this,function(){d.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";d.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var aa=b.getBoundingClientRect(),da=mxUtils.getScrollOrigin(document.body);da="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-da.x,top:-da.y};aa={left:aa.left-da.left,top:aa.top-da.top,bottom:aa.bottom-da.top,right:aa.right-da.left};d.style.left=aa.left+"px";"bottom"==this.graphConfig["toolbar-position"]?d.style.top=aa.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(d.style.marginTop=-this.toolbarHeight+"px",d.style.top=aa.top+1+"px"):d.style.top=aa.top+"px";"1px solid transparent"==K&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(d);var ba=mxUtils.bind(this,function(){null!=d.parentNode&&d.parentNode.removeChild(d);null!=k&&(k.parentNode.removeChild(k),k=null);null!=c&&(c.parentNode.removeChild(c),c=null);b.style.border=K});mxEvent.addListener(document,"mousemove",function(ha){for(ha=mxEvent.getSource(ha);null!=ha;){if(ha==b||ha==d||ha==c||ha==k)return;ha=ha.parentNode}ba()});mxEvent.addListener(document.body,"mouseleave",function(ha){ba()})}else d.style.top=-this.toolbarHeight+"px",b.appendChild(d)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",fa):fa();this.responsive&&"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){null!=d.parentNode&&fa()})).observe(b)};-GraphViewer.prototype.createToolbarButton=function(b,d,m,p){var v=document.createElement("div");v.style.borderRight="1px solid #d0d0d0";v.style.display="inline-flex";v.style.alignItems="center";v.style.padding="6px";mxEvent.addListener(v,"click",b);null!=m&&v.setAttribute("title",m);b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",d);b.style.width="18px";b.className="geAdaptiveAsset";null==p||p?(mxEvent.addListener(v,"mouseenter",function(){v.style.backgroundColor=-"light-dark(#dddddd,#333333)"}),mxEvent.addListener(v,"mouseleave",function(){v.style.backgroundColor="transparent"}),mxUtils.setOpacity(b,60),v.style.cursor="pointer"):mxUtils.setOpacity(v,30);v.appendChild(b);return v};+GraphViewer.prototype.createToolbarButton=function(b,d,m,p){var u=document.createElement("div");u.style.borderRight="1px solid #d0d0d0";u.style.display="inline-flex";u.style.alignItems="center";u.style.padding="6px";mxEvent.addListener(u,"click",b);null!=m&&u.setAttribute("title",m);b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",d);b.style.width="18px";b.className="geAdaptiveAsset";null==p||p?(mxEvent.addListener(u,"mouseenter",function(){u.style.backgroundColor=+"light-dark(#dddddd,#333333)"}),mxEvent.addListener(u,"mouseleave",function(){u.style.backgroundColor="transparent"}),mxUtils.setOpacity(b,60),u.style.cursor="pointer"):mxUtils.setOpacity(u,30);u.appendChild(b);return u};GraphViewer.prototype.disableButton=function(b,d){var m=this.graphConfig["toolbar-buttons"]?this.graphConfig["toolbar-buttons"][b]:null;null!=m&&(mxUtils.setOpacity(m.elem,30),mxEvent.removeListener(m.elem,"click",m.handler),mxEvent.addListener(m.elem,"mouseenter",function(){m.elem.style.backgroundColor="#eee"}),d&&m.elem.setAttribute("title",d))};-GraphViewer.prototype.addClickHandler=function(b,d){b.linkPolicy=this.graphConfig.target||b.linkPolicy;b.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(m,p,v){if(null==p)for(var n=mxEvent.getSource(m);n!=b.container&&null!=n&&null==p;)"a"==n.nodeName.toLowerCase()&&(p=n.getAttribute("href")),n=n.parentNode;null!=d?null==p||b.isCustomLink(p)?mxEvent.consume(m):b.isExternalProtocol(p)||b.isBlankLink(p)||window.setTimeout(function(){d.destroy()},0):null!=p&&null==d&&b.isCustomLink(p)&&-(mxEvent.isTouchEvent(m)||!mxEvent.isPopupTrigger(m))&&b.customLinkClicked(p,v)&&(mxUtils.clearSelection(),mxEvent.consume(m))}),mxUtils.bind(this,function(m){if(null==d&&this.lightboxClickEnabled&&(!mxEvent.isTouchEvent(m)||0==this.toolbarItems.length))try{this.showLightbox()}catch(p){alert(p.message)}}))};+GraphViewer.prototype.addClickHandler=function(b,d){b.linkPolicy=this.graphConfig.target||b.linkPolicy;b.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(m,p,u){if(null==p)for(var n=mxEvent.getSource(m);n!=b.container&&null!=n&&null==p;)"a"==n.nodeName.toLowerCase()&&(p=n.getAttribute("href")),n=n.parentNode;null!=d?null==p||b.isCustomLink(p)?mxEvent.consume(m):b.isExternalProtocol(p)||b.isBlankLink(p)||window.setTimeout(function(){d.destroy()},0):null!=p&&null==d&&b.isCustomLink(p)&&+(mxEvent.isTouchEvent(m)||!mxEvent.isPopupTrigger(m))&&b.customLinkClicked(p,u)&&(mxUtils.clearSelection(),mxEvent.consume(m))}),mxUtils.bind(this,function(m){if(null==d&&this.lightboxClickEnabled&&(!mxEvent.isTouchEvent(m)||0==this.toolbarItems.length))try{this.showLightbox()}catch(p){alert(p.message)}}))};GraphViewer.prototype.showLightbox=function(b,d,m){if("open"==this.graphConfig.lightbox||window.self!==window.top)if(null==this.lightboxWindow||this.lightboxWindow.closed){b=null!=b?b:null!=this.graphConfig.editable?this.graphConfig.editable:!0;m={client:1,target:null!=m?m:"blank"};b&&(m.edit=this.graphConfig.edit||"_blank");if(null!=d?d:1)m.close=1;this.layersEnabled&&(m.layers=1);this.tagsEnabled&&null!=this.diagrams&&null!=this.diagrams[this.currentPage]&&(b=this.diagrams[this.currentPage].getAttribute("id"),null==this.graphConfig.hiddenTags&&(this.graphConfig.hiddenTags={}),this.graphConfig.hiddenTags[b]=0<this.graph.hiddenTags.length?this.graph.hiddenTags.slice():null,m.tags=this.graphConfig.hiddenTags);this.browserTranslate&&(m["browser-translate"]=1);null!=this.graphConfig&&0!=this.graphConfig.nav&&(m.nav=1);null!=this.graphConfig&&null!=this.graphConfig.highlight&&(m.highlight=this.graphConfig.highlight.substring(1));null!=this.currentPage&&0<this.currentPage&&(m.page=this.currentPage);"undefined"!==typeof window.postMessage&&(null==document.documentMode||10<=document.documentMode)?null==this.lightboxWindow&&mxEvent.addListener(window,"message",mxUtils.bind(this,function(p){"ready"==p.data&&p.source==this.lightboxWindow&&this.lightboxWindow.postMessage(this.xml,"*")})):m.data=encodeURIComponent(this.xml);"1"==urlParams.dev&&(m.dev="1");this.lightboxWindow=window.open(("1"!=urlParams.dev?EditorUi.lightboxHost:"https://test.draw.io")+"/#P"+encodeURIComponent(JSON.stringify(m)))}else this.lightboxWindow.focus();else this.showLocalLightbox()};GraphViewer.prototype.showLocalLightbox=function(b){var d=this.browserTranslate&&null!=this.graph?this.graph.getBrowserTranslationCache():null,m=document.createElement("div");m.style.position="fixed";m.style.top="0";m.style.left="0";m.style.bottom="0";m.style.right="0";m.style.zIndex=this.lightboxZIndex;m.style.backgroundColor="#000000";mxUtils.setOpacity(m,70);document.body.appendChild(m);var p=document.createElement("img");p.setAttribute("border","0");p.setAttribute("src",Editor.closeBlackImage);-p.style.position="fixed";p.style.top="32px";p.style.right="32px";p.style.cursor="pointer";p.className="geAdaptiveAsset";var v=mxUtils.bind(this,function(){C.setDarkMode(this.isDarkMode())});mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.removeListener("darkModeChanged",v);C.destroy()}));urlParams.pages="1";urlParams.page=this.currentPage;urlParams["page-id"]=this.graphConfig.pageId;urlParams["layer-ids"]=null!=this.graphConfig.layerIds&&0<this.graphConfig.layerIds.length?this.graphConfig.layerIds.join(" "):+p.style.position="fixed";p.style.top="32px";p.style.right="32px";p.style.cursor="pointer";p.className="geAdaptiveAsset";var u=mxUtils.bind(this,function(){B.setDarkMode(this.isDarkMode())});mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.removeListener("darkModeChanged",u);B.destroy()}));urlParams.pages="1";urlParams.page=this.currentPage;urlParams["page-id"]=this.graphConfig.pageId;urlParams["layer-ids"]=null!=this.graphConfig.layerIds&&0<this.graphConfig.layerIds.length?this.graphConfig.layerIds.join(" "):null;urlParams.nav=0!=this.graphConfig.nav?"1":"0";urlParams.layers=this.layersEnabled?"1":"0";urlParams.dark=this.isDarkMode()?"1":"0";if(this.tagsEnabled&&null!=this.diagrams&&null!=this.diagrams[this.currentPage]){var n=this.diagrams[this.currentPage].getAttribute("id");null==this.graphConfig.hiddenTags&&(this.graphConfig.hiddenTags={});this.graphConfig.hiddenTags[n]=0<this.graph.hiddenTags.length?this.graph.hiddenTags.slice():null;urlParams.tags=JSON.stringify(this.graphConfig.hiddenTags)}if(null!=b)try{var y=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));y.noCloseBtn=!0;urlParams["toolbar-config"]=encodeURIComponent(JSON.stringify(y))}catch(q){}if(null==document.documentMode||10<=document.documentMode)Editor.prototype.editButtonLink=this.graphConfig.edit,Editor.prototype.editButtonFunc=this.graphConfig.editFunc;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};-var C=new EditorUi(new Editor(!0),document.createElement("div"),!0);this.addListener("darkModeChanged",v);C.editor.editBlankUrl=this.editBlankUrl;C.refresh=function(){};var P=mxUtils.bind(this,function(q){27==q.keyCode&&C.destroy()}),G=this.initialOverflow,O=C.destroy;C.destroy=function(){null==b&&(mxEvent.removeListener(document.documentElement,"keydown",P),document.body.removeChild(m),document.body.removeChild(p),document.body.style.overflow=G,GraphViewer.resizeSensorEnabled=!0,O.apply(this,arguments))};-var U=C.editor.graph;this.browserTranslate&&U.waitForBrowserTranslate();var c=U.container;c.style.overflow="hidden";c.style.inset="0";this.lightboxChrome&&null==b?(c.style.border="1px solid #c0c0c0",c.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",P)):(m.style.display="none",p.style.display="none");var f=this;U.getImageFromBundles=function(q){return f.getImageUrl(q)};var k=C.createTemporaryGraph;C.createTemporaryGraph=function(){var q=k.apply(this,arguments);q.getImageFromBundles=-function(x){return f.getImageUrl(x)};return q};this.graphConfig.move&&(U.isMoveCellsEvent=function(q){return!0});mxUtils.setPrefixedStyle(c.style,"border-radius","4px");c.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(U,C);window.setTimeout(mxUtils.bind(this,function(){try{mxEvent.addListener(m,"click",function(){C.destroy()});c.style.outline="none";c.style.zIndex=this.lightboxZIndex;p.style.zIndex=this.lightboxZIndex;null!=b?(b.innerHTML=-"",b.appendChild(c)):(document.body.appendChild(c),document.body.appendChild(p));C.setFileData(this.xml);if(this.tagsEnabled&&null!=this.graphConfig.hiddenTags&&null!=C.currentPage){var q=C.currentPage.getId(),x=this.graphConfig.hiddenTags[q];U.hiddenTags=null!=x&&0<x.length?x:[];U.refresh()}mxUtils.setPrefixedStyle(c.style,"transform","rotateY(0deg)");C.chromelessToolbar.style.bottom="60px";C.chromelessToolbar.style.zIndex=this.lightboxZIndex;(b||document.body).appendChild(C.chromelessToolbar);C.getEditBlankXml=-mxUtils.bind(this,function(){return this.xml});this.showLayers(U,this.graph);C.lightboxFit();C.chromelessResize();null!=d&&U.applyBrowserTranslationCache(d)}catch(B){C.handleError(B,null,function(){C.destroy()})}}),0);return C};Dialog.prototype.getDocumentSize=function(){return new mxRectangle(0,0,Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0))};+var B=new EditorUi(new Editor(!0),document.createElement("div"),!0);this.addListener("darkModeChanged",u);B.editor.editBlankUrl=this.editBlankUrl;B.refresh=function(){};var P=mxUtils.bind(this,function(q){27==q.keyCode&&B.destroy()}),G=this.initialOverflow,O=B.destroy;B.destroy=function(){null==b&&(mxEvent.removeListener(document.documentElement,"keydown",P),document.body.removeChild(m),document.body.removeChild(p),document.body.style.overflow=G,GraphViewer.resizeSensorEnabled=!0,O.apply(this,arguments))};+var U=B.editor.graph;this.browserTranslate&&U.waitForBrowserTranslate();var c=U.container;c.style.overflow="hidden";c.style.inset="0";this.lightboxChrome&&null==b?(c.style.border="1px solid #c0c0c0",c.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",P)):(m.style.display="none",p.style.display="none");var f=this;U.getImageFromBundles=function(q){return f.getImageUrl(q)};var k=B.createTemporaryGraph;B.createTemporaryGraph=function(){var q=k.apply(this,arguments);q.getImageFromBundles=+function(x){return f.getImageUrl(x)};return q};this.graphConfig.move&&(U.isMoveCellsEvent=function(q){return!0});mxUtils.setPrefixedStyle(c.style,"border-radius","4px");c.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(U,B);window.setTimeout(mxUtils.bind(this,function(){try{mxEvent.addListener(m,"click",function(){B.destroy()});c.style.outline="none";c.style.zIndex=this.lightboxZIndex;p.style.zIndex=this.lightboxZIndex;null!=b?(b.innerHTML=+"",b.appendChild(c)):(document.body.appendChild(c),document.body.appendChild(p));B.setFileData(this.xml);if(this.tagsEnabled&&null!=this.graphConfig.hiddenTags&&null!=B.currentPage){var q=B.currentPage.getId(),x=this.graphConfig.hiddenTags[q];U.hiddenTags=null!=x&&0<x.length?x:[];U.refresh()}mxUtils.setPrefixedStyle(c.style,"transform","rotateY(0deg)");B.chromelessToolbar.style.bottom="60px";B.chromelessToolbar.style.zIndex=this.lightboxZIndex;(b||document.body).appendChild(B.chromelessToolbar);B.getEditBlankXml=+mxUtils.bind(this,function(){return this.xml});this.showLayers(U,this.graph);B.lightboxFit();B.chromelessResize();null!=d&&U.applyBrowserTranslationCache(d)}catch(C){B.handleError(C,null,function(){B.destroy()})}}),0);return B};Dialog.prototype.getDocumentSize=function(){return new mxRectangle(0,0,Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0))};GraphViewer.prototype.updateTitle=function(b,d){b=b||"";this.showTitleAsTooltip&&null!=this.graph&&null!=this.graph.container&&this.graph.container.setAttribute("title",d||b);null!=this.filename&&(this.filename.innerText="",mxUtils.write(this.filename,b),this.filename.setAttribute("title",d||b))};GraphViewer.processElements=function(b){mxUtils.forEach(GraphViewer.getElementsByClassName(b||"mxgraph"),function(d){try{d.innerText="",GraphViewer.createViewerForElement(d)}catch(m){d.innerText=m.message,null!=window.console&&console.error(m)}})};-GraphViewer.getElementsByClassName=function(b){if(document.getElementsByClassName){var d=document.getElementsByClassName(b);b=[];for(var m=0;m<d.length;m++)b.push(d[m]);return b}var p=document.getElementsByTagName("*");d=[];for(m=0;m<p.length;m++){var v=p[m].className;null!=v&&0<v.length&&(v=v.split(" "),0<=mxUtils.indexOf(v,b)&&d.push(p[m]))}return d};-GraphViewer.createViewerForElement=function(b,d){var m=b.getAttribute("data-mxgraph");if(null!=m){var p=JSON.parse(m),v=function(n){n=mxUtils.parseXml(n);n=new GraphViewer(b,n.documentElement,p);null!=d&&d(n)};null!=p.url?GraphViewer.getUrl(p.url,function(n){v(n)}):v(p.xml)}};+GraphViewer.getElementsByClassName=function(b){if(document.getElementsByClassName){var d=document.getElementsByClassName(b);b=[];for(var m=0;m<d.length;m++)b.push(d[m]);return b}var p=document.getElementsByTagName("*");d=[];for(m=0;m<p.length;m++){var u=p[m].className;null!=u&&0<u.length&&(u=u.split(" "),0<=mxUtils.indexOf(u,b)&&d.push(p[m]))}return d};+GraphViewer.createViewerForElement=function(b,d){var m=b.getAttribute("data-mxgraph");if(null!=m){var p=JSON.parse(m),u=function(n){n=mxUtils.parseXml(n);n=new GraphViewer(b,n.documentElement,p);null!=d&&d(n)};null!=p.url?GraphViewer.getUrl(p.url,function(n){u(n)}):u(p.xml)}};GraphViewer.blockedAncestorFrames=function(){try{if(window.location.ancestorOrigins&&window.location.hostname&&window.location.ancestorOrigins.length&&0<window.location.ancestorOrigins.length){var b=window.location.hostname;b&&1<b.length&&"/"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1));for(var d="",m=0;m<window.location.ancestorOrigins.length;m++)if(d+=" -> "+window.location.ancestorOrigins[m],d.endsWith("dan6v7pm1f1a1.cloudfront.net")||d.endsWith("confluence-cloud-excalidraw-ll3likebca-uc.a.run.app"))return!0;(b.endsWith("ac.draw.io")||b.endsWith("aj.draw.io"))&&1==window.location.ancestorOrigins.length&&window.location.ancestorOrigins[0]&&window.location.ancestorOrigins[0].endsWith(".atlassian.net")}}catch(p){}return!1};GraphViewer.darkBackgroundColor=Editor.darkColor;GraphViewer.cssFontFamily=Editor.defaultHtmlFont;GraphViewer.shapeBackgroundColor=null;GraphViewer.viewerInitialized=function(b){};GraphViewer.initCss=function(){try{null==GraphViewer.styleElement&&(GraphViewer.styleElement=document.createElement("style"),GraphViewer.styleElement.setAttribute("type","text/css"),GraphViewer.styleElement.innerHTML=GraphViewer.getCss(),GraphViewer.blockedAncestorFrames()||document.getElementsByTagName("head")[0].appendChild(GraphViewer.styleElement))}catch(b){}};@@ -4917,11 +4920,11 @@ GraphViewer.getCss=function(){return[".geDarkMode img {\n filter: invert(1);\"\t z-index: "+(GraphViewer.prototype.lightboxZIndex+2)+";","}\n.geBackground {"," background-color: light-dark(#ffffff, "+GraphViewer.darkBackgroundColor+");","\t position: fixed;\n left: 0px;\n top: 0px;\n right: 0px;\n bottom: 0px;\n opacity: 0.9;","\t z-index: "+(GraphViewer.prototype.lightboxZIndex+1)+";","}\n.geDialogTitle {\n box-sizing: border-box;\n white-space: nowrap;"," background: light-dark(#f1f3f4, "+GraphViewer.darkBackgroundColor+");"," border-bottom: 1px solid rgb(192, 192, 192);\n font-size: 15px;\n font-weight: bold;\n text-align: center;\n color: rgb(35, 86, 149);\n}\n.geDialogFooter {"," background: light-dark(#f1f3f4, "+GraphViewer.darkBackgroundColor+");"," white-space: nowrap;\n text-align: right;\n box-sizing: border-box;\n border-top: 1px solid #e5e5e5;\n color: darkGray;\n}\n.geHelpIcon {\n width: 16px;\n margin: 0 4px;\n vertical-align: text-bottom;\n}\n.geBtn, .mxWindow .geBtn {\n background-color: light-dark(#eeeeee, #1b1d1e);\n border: 1px solid light-dark(#d8d8d8, #333333);\n color: light-dark(#3f3f3f, #c0c0c0);\n font-size: 13px;\n font-weight: 500;\n border-radius: 4px;\n height: 30px;\n margin: 0 0 0 8px;\n min-width: 72px;\n outline: 0;\n padding: 0 8px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n.geBtn:hover:not(.gePrimaryBtn), .geBtn:focus {\n border: 1px solid light-dark(#c6c6c6, #333333);\n background: light-dark(#dadada, #333333);\n}\n.geBtn:disabled {\n opacity: .5;\n}\n.gePrimaryBtn {\n background: linear-gradient(light-dark(#4d90fe, #003555) 0px, light-dark(#4787ed, #003555) 100%);\n border: 1px solid light-dark(#3079ed, transparent);\n color: light-dark(#ffffff, #c0c0c0);\n}\n.gePrimaryBtn:hover:not([disabled]) {\n background: linear-gradient(light-dark(#4d90fe, #004a77) 0px, light-dark(#357ae8, #004a77) 100%);\n border: 1px solid light-dark(#2f5bb7, transparent);\n}\n.geBtn:disabled {\n opacity: .5;\n}"].join("\n")};GraphViewer.cachedUrls={};GraphViewer.getUrl=function(b,d,m){if(null!=GraphViewer.cachedUrls[b])d(GraphViewer.cachedUrls[b]);else{var p=null!=navigator.userAgent&&0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;p.open("GET",b);p.onload=function(){d(null!=p.getText?p.getText():p.responseText)};p.onerror=m;p.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeObserver=!0;GraphViewer.useResizeSensor=!0;-(function(){var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(m){return window.setTimeout(m,20)},d=function(m,p){function v(){this.q=[];this.add=function(q){this.q.push(q)};var f,k;this.call=function(){f=0;for(k=this.q.length;f<k;f++)this.q[f].call()}}function n(f,k){return f.currentStyle?f.currentStyle[k]:window.getComputedStyle?window.getComputedStyle(f,null).getPropertyValue(k):f.style[k]}function y(f,k){if(!f.resizedAttached)f.resizedAttached=-new v,f.resizedAttached.add(k);else if(f.resizedAttached){f.resizedAttached.add(k);return}f.resizeSensor=document.createElement("div");f.resizeSensor.className="resize-sensor";f.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";f.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>';-f.appendChild(f.resizeSensor);"static"==n(f,"position")&&(f.style.position="relative");var q=f.resizeSensor.childNodes[0],x=q.childNodes[0],B=f.resizeSensor.childNodes[1],E=function(){x.style.width="100000px";x.style.height="100000px";q.scrollLeft=1E5;q.scrollTop=1E5;B.scrollLeft=1E5;B.scrollTop=1E5};E();var L=!1,Q=function(){f.resizedAttached&&(L&&(f.resizedAttached.call(),L=!1),b(Q))};b(Q);var V,K,fa,aa;k=function(){if((fa=f.offsetWidth)!=V||(aa=f.offsetHeight)!=K)L=!0,V=fa,K=aa;E()};var da=function(ba,-ha,qa){ba.attachEvent?ba.attachEvent("on"+ha,qa):ba.addEventListener(ha,qa)};da(q,"scroll",k);da(B,"scroll",k)}var C=function(){GraphViewer.resizeSensorEnabled&&p()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var P=null,G=!1;(new ResizeObserver(function(){G||(null!=P&&window.clearTimeout(P),P=window.setTimeout(function(){G=!0;C();P=null;G=!1},200))})).observe(m)}else{var O=Object.prototype.toString.call(m),U="[object Array]"===O||"[object NodeList]"===O||"[object HTMLCollection]"===-O||"undefined"!==typeof jQuery&&m instanceof jQuery||"undefined"!==typeof Elements&&m instanceof Elements;if(U){O=0;for(var c=m.length;O<c;O++)y(m[O],C)}else y(m,C);this.detach=function(){if(U)for(var f=0,k=m.length;f<k;f++)d.detach(m[f]);else d.detach(m)}}};d.detach=function(m){m.resizeSensor&&(m.removeChild(m.resizeSensor),delete m.resizeSensor,delete m.resizedAttached)};window.ResizeSensor=d})();+(function(){var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(m){return window.setTimeout(m,20)},d=function(m,p){function u(){this.q=[];this.add=function(q){this.q.push(q)};var f,k;this.call=function(){f=0;for(k=this.q.length;f<k;f++)this.q[f].call()}}function n(f,k){return f.currentStyle?f.currentStyle[k]:window.getComputedStyle?window.getComputedStyle(f,null).getPropertyValue(k):f.style[k]}function y(f,k){if(!f.resizedAttached)f.resizedAttached=+new u,f.resizedAttached.add(k);else if(f.resizedAttached){f.resizedAttached.add(k);return}f.resizeSensor=document.createElement("div");f.resizeSensor.className="resize-sensor";f.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";f.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>';+f.appendChild(f.resizeSensor);"static"==n(f,"position")&&(f.style.position="relative");var q=f.resizeSensor.childNodes[0],x=q.childNodes[0],C=f.resizeSensor.childNodes[1],E=function(){x.style.width="100000px";x.style.height="100000px";q.scrollLeft=1E5;q.scrollTop=1E5;C.scrollLeft=1E5;C.scrollTop=1E5};E();var L=!1,Q=function(){f.resizedAttached&&(L&&(f.resizedAttached.call(),L=!1),b(Q))};b(Q);var V,K,fa,aa;k=function(){if((fa=f.offsetWidth)!=V||(aa=f.offsetHeight)!=K)L=!0,V=fa,K=aa;E()};var da=function(ba,+ha,qa){ba.attachEvent?ba.attachEvent("on"+ha,qa):ba.addEventListener(ha,qa)};da(q,"scroll",k);da(C,"scroll",k)}var B=function(){GraphViewer.resizeSensorEnabled&&p()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var P=null,G=!1;(new ResizeObserver(function(){G||(null!=P&&window.clearTimeout(P),P=window.setTimeout(function(){G=!0;B();P=null;G=!1},200))})).observe(m)}else{var O=Object.prototype.toString.call(m),U="[object Array]"===O||"[object NodeList]"===O||"[object HTMLCollection]"===+O||"undefined"!==typeof jQuery&&m instanceof jQuery||"undefined"!==typeof Elements&&m instanceof Elements;if(U){O=0;for(var c=m.length;O<c;O++)y(m[O],B)}else y(m,B);this.detach=function(){if(U)for(var f=0,k=m.length;f<k;f++)d.detach(m[f]);else d.detach(m)}}};d.detach=function(m){m.resizeSensor&&(m.removeChild(m.resizeSensor),delete m.resizeSensor,delete m.resizedAttached)};window.ResizeSensor=d})();function mxBpmnShape(a,d,e,b){mxShape.call(this);this.bounds=a;this.fill=d;this.stroke=e;this.strokewidth=null!=b?b:1}mxUtils.extend(mxBpmnShape,mxShape);mxBpmnShape.prototype.customProperties=[{name:"symbol",dispName:"Event",type:"enum",defVal:"general",enumList:[{val:"general",dispName:"General"},{val:"message",dispName:"Message"},{val:"timer",dispName:"Timer"},{val:"escalation",dispName:"Escalation"},{val:"conditional",dispName:"Conditional"},{val:"link",dispName:"Link"},{val:"error",dispName:"Error"},{val:"cancel",dispName:"Cancel"},{val:"compensation",dispName:"Compensation"},{val:"signal",dispName:"Signal"},{val:"multiple",dispName:"Multiple"},{val:"parallelMultiple",dispName:"Parallel Multiple"},{val:"terminate",dispName:"Terminate"},{val:"exclusiveGw",dispName:"Exclusive Gw"},{val:"parallelGw",dispName:"Parallel Gw"},{val:"complexGw",dispName:"Complex Gw"}]},{name:"outline",dispName:"Event Type",type:"enum",defVal:"standard",enumList:[{val:"standard",dispName:"Standard"},{val:"eventInt",dispName:"Interrupting"},{val:"eventNonint",dispName:"Non-Interrupting"},{val:"catching",dispName:"Catching"},{val:"boundInt",dispName:"Bound Interrupting"},diff --git a/src/main/webapp/js/viewer.min.js b/src/main/webapp/js/viewer.min.jsindex 783ba208a..d09a2d053 100644--- a/src/main/webapp/js/viewer.min.js+++ b/src/main/webapp/js/viewer.min.js@@ -31,7 +31,7 @@ b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io")))})();"1"==urlPa"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ADD_ATTR:["target","content","pointer-events","requiredFeatures"]};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";-window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"30.3.13",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"30.3.14",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&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."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),IS_MT:0<=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."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!==document.createElementNS("http://www.w3.org/2000/svg","foreignObject").toString()||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),@@ -375,9 +375,9 @@ mxSvgCanvas2D.prototype.getAlternateTextLines=function(a,b,c,d,e,f){var g=this.sa[m].split(/\s+/),p="",q=0;q<n.length;q++)if(0<n[q].length){var r=0<p.length?p+" "+n[q]:n[q];for(0<p.length&&l.measureText(r).width>k?(b.push(p),p=n[q]):p=r;1<p.length&&l.measureText(p).width>k&&/[\u2E80-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF]/.test(p);){for(r=p.length-1;1<r&&l.measureText(p.substring(0,r)).width>k;)r--;b.push(p.substring(0,r));p=p.substring(r)}}b.push(p)}a=b}(f||"fill"==e)&&0<c&&(c=Math.max(1,Math.floor(c/Math.round(mxConstants.LINE_HEIGHT*g.fontSize))),a.length>c&&(a=a.slice(0,c),a[a.length-1]+="..."));if(f&&!d&&null!=l)for(m=0;m<a.length;m++)if(l.measureText(a[m]).width>k){for(r=a[m].length-1;1<r&&l.measureText(a[m].substring(0,r)+"...").width>k;)r--;a[m]=mxUtils.trim(a[m].substring(0,r))+"..."}return a};mxSvgCanvas2D.prototype.createAlternateContent=function(a,b,c,d,e,f,g,k,l,m,n,p,q){m=this.getAlternateText(a,b,c,d,e,f,g,k,l,m,n,p,q);a=this.state;if(null!=m&&0<a.fontSize){f=k==mxConstants.ALIGN_TOP?1:k==mxConstants.ALIGN_BOTTOM?0:.3;g=g==mxConstants.ALIGN_RIGHT?"end":g==mxConstants.ALIGN_LEFT?"start":"middle";d=this.getAlternateTextLines(m,d,e,l,n,p);e=Math.round(mxConstants.LINE_HEIGHT*a.fontSize);b=Math.round(b+a.dx);c=c+a.dy+f*a.fontSize-(k==mxConstants.ALIGN_TOP?0:k==mxConstants.ALIGN_BOTTOM?-(d.length-1)*e:(d.length-1)*e/2);k=this.createElement("text");k.setAttribute("x",b);k.setAttribute("y",Math.round(c));k.setAttribute("fill",a.fontColor||"black");k.setAttribute("font-family",mxUtils.parseCssFontFamily(a.fontFamily));k.setAttribute("font-size",Math.round(a.fontSize)+"px");"start"!=g&&k.setAttribute("text-anchor",g);(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&k.setAttribute("font-weight","bold");(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&k.setAttribute("font-style",-"italic");l=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&l.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&l.push("line-through");0<l.length&&(k.setAttribute("text-decoration",l.join(" ")),(a.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(k.style.textDecorationStyle="dotted"));if(1<d.length)for(a=0;a<d.length;a++)l=this.createElement("tspan"),l.setAttribute("x",b),l.setAttribute("y",Math.round(c+-a*e)),mxUtils.write(l,d[a]),k.appendChild(l);else mxUtils.write(k,d[0]);return k}return null};+(d.length-1)*e:(d.length-1)*e/2);l=this.getLightDarkColor(a.fontColor||"black");k=this.createElement("text");k.setAttribute("x",b);k.setAttribute("y",Math.round(c));"transparent"==l.light?k.setAttribute("fill","none"):(k.setAttribute("fill",l.light),k.style.fill=l.cssText);k.setAttribute("font-family",mxUtils.parseCssFontFamily(a.fontFamily));k.setAttribute("font-size",Math.round(a.fontSize)+"px");"start"!=g&&k.setAttribute("text-anchor",g);(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&+k.setAttribute("font-weight","bold");(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&k.setAttribute("font-style","italic");g=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&g.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&g.push("line-through");0<g.length&&(k.setAttribute("text-decoration",g.join(" ")),(a.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(k.style.textDecorationStyle=+"dotted"));if(1<d.length)for(a=0;a<d.length;a++)g=this.createElement("tspan"),g.setAttribute("x",b),g.setAttribute("y",Math.round(c+a*e)),mxUtils.write(g,d[a]),k.appendChild(g);else mxUtils.write(k,d[0]);return k}return null};mxSvgCanvas2D.prototype.createGradientId=function(a,b,c,d,e){a=a.toLowerCase()+"-"+c;b=b.toLowerCase()+"-"+d;c=null;null==e||e==mxConstants.DIRECTION_SOUTH?c="s":e==mxConstants.DIRECTION_EAST?c="e":e==mxConstants.DIRECTION_RADIAL?c="r":(d=a,a=b,b=d,e==mxConstants.DIRECTION_NORTH?c="s":e==mxConstants.DIRECTION_WEST&&(c="e"));return((""!=this.idPrefix?this.idPrefix:"mx")+"-gradient-"+a+"-"+b+"-"+c).replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};mxSvgCanvas2D.prototype.getSvgGradient=function(a,b,c,d,e){a=this.getLightDarkColor(a);b=this.getLightDarkColor(b);var f=this.createGradientId(a.cssText,b.cssText,c,d,e),g=this.gradients[f];if(null==g){var k=this.root.ownerSVGElement,l=0,m=f+"-"+l;if(null!=k)for(g=k.ownerDocument.getElementById(m);null!=g&&g.ownerSVGElement!=k;)m=f+"-"+l++,g=k.ownerDocument.getElementById(m);else m="id"+ ++this.refCount;null==g&&(g=this.createSvgGradient(a,b,c,d,e),g.setAttribute("id",m),null!=this.defs?this.defs.appendChild(g):k.appendChild(g));this.gradients[f]=g}return g.getAttribute("id")};@@ -400,8 +400,8 @@ mxSvgCanvas2D.prototype.addNode=function(a,b){var c=this.addTitle(this.node),d=tc.setAttribute("transform",d.transform);this.pointerEvents?c.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none");0<this.strokeTolerance&&(!a||null==d.fillColor||!mxShape.forceFilledPointerEvents&&!this.pointerEvents&&null==this.originalRoot)&&this.addTolerance(c);("rect"!=c.nodeName&&"path"!=c.nodeName&&"ellipse"!=c.nodeName||"none"!=c.getAttribute("fill")&&"transparent"!=c.getAttribute("fill")||"none"!=c.getAttribute("stroke")||"none"!=c.getAttribute("pointer-events"))&&this.root.appendChild(c);this.node=null}};mxSvgCanvas2D.prototype.getShadowFilter=function(){var a=this.state,b=a.shadowStyle;if(1!=a.scale){var c=b.split("(");if(0<c.length){var d=c[1].split(" ");3<d.length&&(b=function(e){return Math.round(parseFloat(d[e])*a.scale*100)/100+"px"},b=c[0]+"("+b(0)+" "+b(1)+" "+b(2)+" "+d.slice(3).join(" ")+(2<c.length?"("+c.slice(2).join("("):""))}}return b};mxSvgCanvas2D.prototype.addTolerance=function(a){this.root.appendChild(this.createTolerance(a))};mxSvgCanvas2D.prototype.updateFill=function(){var a=this.state;(1>a.alpha||1>a.fillAlpha)&&this.node.setAttribute("fill-opacity",a.alpha*a.fillAlpha);var b=!1;if(null!=a.fillColor)if(null!=a.gradientColor&&a.gradientColor!=mxConstants.NONE){b=!0;var c=this.getSvgGradient(String(a.fillColor),String(a.gradientColor),a.gradientFillAlpha,a.gradientAlpha,a.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c="url("+d+"#"+c+-")"}else c="url(#"+c+")";d=c}else c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText;var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill",-"url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};+")"}else c="url(#"+c+")";d=c}else String(a.fillColor).toLowerCase()==mxConstants.NONE?c=d="none":(c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText);var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,+"\\$1"),this.node.setAttribute("fill","url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};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 a=this.state,b=this.getLightDarkColor(String(a.strokeColor).toLowerCase());this.node.setAttribute("stroke",b.light);this.node.style.stroke=b.cssText;(1>a.alpha||1>a.strokeAlpha)&&this.node.setAttribute("stroke-opacity",a.alpha*a.strokeAlpha);b=this.getCurrentStrokeWidth();1!=b&&this.node.setAttribute("stroke-width",b);"path"==this.node.nodeName&&this.updateStrokeAttributes();a.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((a.fixDash?1:a.strokeWidth)*a.scale))};mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var a=this.state;null!=a.lineJoin&&"miter"!=a.lineJoin&&this.node.setAttribute("stroke-linejoin",a.lineJoin);if(null!=a.lineCap){var b=a.lineCap;"flat"==b&&(b="butt");"butt"!=b&&this.node.setAttribute("stroke-linecap",b)}null==a.miterLimit||this.styleEnabled&&10==a.miterLimit||this.node.setAttribute("stroke-miterlimit",a.miterLimit)};mxSvgCanvas2D.prototype.createDashPattern=function(a){var b=[];if("string"===typeof this.state.dashPattern){var c=this.state.dashPattern.split(" ");if(0<c.length)for(var d=0;d<c.length;d++)b[d]=Math.round(Number(c[d])*a*100)/100}return b.join(" ")};@@ -1941,7 +1941,7 @@ var mxStylesheetCodec=mxCodecRegistry.register(function(){var a=new mxObjectCodefunction(b,c){b=typeof c;"function"==b?c=mxStyleRegistry.getName(c):"object"==b&&(c=null);return c};a.decode=function(b,c,d){d=d||new this.template.constructor;var e=c.getAttribute("id");null!=e&&(b.objects[e]=d);for(c=c.firstChild;null!=c;){if(!this.processInclude(b,c,d)&&"add"==c.nodeName&&(e=c.getAttribute("as"),null!=e)){var f=c.getAttribute("extend"),g=null!=f?mxUtils.clone(d.styles[f]):null;null==g&&(null!=f&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+f+" not found to extend"),g={});for(f=c.firstChild;null!=f;){if(f.nodeType==mxConstants.NODETYPE_ELEMENT){var k=f.getAttribute("as");if("add"==f.nodeName){var l=mxUtils.getTextContent(f);null!=l&&0<l.length&&mxStylesheetCodec.allowEval?l=mxUtils.eval(l):(l=f.getAttribute("value"),mxUtils.isNumeric(l)&&(l=parseFloat(l)));null!=l&&(g[k]=l)}else"remove"==f.nodeName&&delete g[k]}f=f.nextSibling}d.putCellStyle(e,g)}c=c.nextSibling}return d};return a}());mxStylesheetCodec.allowEval=!1;var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(b){return b.raw=b};$jscomp.createTemplateTagFirstArgWithRaw=function(b,d){b.raw=d;return b};$jscomp.arrayIteratorImpl=function(b){var d=0;return function(){return d<b.length?{done:!1,value:b[d++]}:{done:!0}}};$jscomp.arrayIterator=function(b){return{next:$jscomp.arrayIteratorImpl(b)}};$jscomp.makeIterator=function(b){var d="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];return d?d.call(b):$jscomp.arrayIterator(b)};-Editor=function(b,d,m,p,v){mxEventSource.call(this);this.chromeless=null!=b?b:this.chromeless;this.initStencilRegistry();this.graph=p||this.createGraph(d,m);this.editable=null!=v?v:!b;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(n,y){this.status=n;this.statusFunction=y;this.fireEvent(new mxEventObject("statusChanged"))};+Editor=function(b,d,m,p,u){mxEventSource.call(this);this.chromeless=null!=b?b:this.chromeless;this.initStencilRegistry();this.graph=p||this.createGraph(d,m);this.editable=null!=u?u:!b;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(n,y){this.status=n;this.statusFunction=y;this.fireEvent(new mxEventObject("statusChanged"))};this.getStatus=function(){return this.status};this.graphChangeListener=function(n,y){n=null!=y?y.getProperty("edit"):null;null!=n&&n.ignoreEdit||this.setModified(!0)};this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)}));this.graph.resetViewOnRootChange=!1;this.init()};mxConstants.POINTS=1;mxConstants.MILLIMETERS=2;mxConstants.INCHES=3;mxConstants.METERS=4;mxConstants.PIXELS_PER_MM=3.937;mxConstants.PIXELS_PER_INCH=100;Editor.pageCounter=0;(function(){try{for(var b=window;null!=b.opener&&"undefined"!==typeof b.opener.Editor&&!isNaN(b.opener.Editor.pageCounter)&&b.opener!=b;)b=b.opener;null!=b&&(b.Editor.pageCounter++,Editor.pageCounter=b.Editor.pageCounter)}catch(d){}})();Editor.defaultHtmlFont='-apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, ui-sans-serif, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"';Editor.useLocalStorage="undefined"!=typeof Storage&&mxClient.IS_IOS;Editor.smallScreenWidth=1024;Editor.helpImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDc4LTI0MHEyMSAwIDM1LjUtMTQuNVQ1MjgtMjkwcTAtMjEtMTQuNS0zNS41VDQ3OC0zNDBxLTIxIDAtMzUuNSAxNC41VDQyOC0yOTBxMCAyMSAxNC41IDM1LjVUNDc4LTI0MFptLTM2LTE1NGg3NHEwLTMzIDcuNS01MnQ0Mi41LTUycTI2LTI2IDQxLTQ5LjV0MTUtNTYuNXEwLTU2LTQxLTg2dC05Ny0zMHEtNTcgMC05Mi41IDMwVDM0Mi02MThsNjYgMjZxNS0xOCAyMi41LTM5dDUzLjUtMjFxMzIgMCA0OCAxNy41dDE2IDM4LjVxMCAyMC0xMiAzNy41VDUwNi01MjZxLTQ0IDM5LTU0IDU5dC0xMCA3M1ptMzggMzE0cS04MyAwLTE1Ni0zMS41VDE5Ny0xOTdxLTU0LTU0LTg1LjUtMTI3VDgwLTQ4MHEwLTgzIDMxLjUtMTU2VDE5Ny03NjNxNTQtNTQgMTI3LTg1LjVUNDgwLTg4MHE4MyAwIDE1NiAzMS41VDc2My03NjNxNTQgNTQgODUuNSAxMjdUODgwLTQ4MHEwIDgzLTMxLjUgMTU2VDc2My0xOTdxLTU0IDU0LTEyNyA4NS41VDQ4MC04MFptMC04MHExMzQgMCAyMjctOTN0OTMtMjI3cTAtMTM0LTkzLTIyN3QtMjI3LTkzcS0xMzQgMC0yMjcgOTN0LTkzIDIyN3EwIDEzNCA5MyAyMjd0MjI3IDkzWm0wLTMyMFoiLz48L3N2Zz4=";@@ -2021,26 +2021,26 @@ Editor.fillStyles=[{val:"auto",dispName:"Auto",res:"automatic"},{val:"hatch",disEditor.hintOffset=20;Editor.shapePickerHoverDelay=300;Editor.fitWindowBorders=null;Editor.suppressNewWindows=null!=window.urlParams&&"1"==urlParams.suppressNewWindows;Editor.popupsAllowed=(null!=window.urlParams?"1"!=urlParams.noDevice:!0)&&!Editor.suppressNewWindows;Editor.simpleLabels=!1;Editor.optimizeHtmlLabels=!1;Editor.enableNativeClipboard=window==window.top&&null!=navigator.clipboard&&null!=navigator.clipboard.read;Editor.sketchMode=!1;Editor.darkMode=!1;Editor.currentTheme=uiTheme;Editor.darkColor="#121212";Editor.darkColorVar="--ge-dark-color";Editor.fontSizeUnit="px";Editor.transitionDelay=.1;Editor.pageSizeUnit=mxConstants.INCHES;Editor.removeImageMetadata=!0;Editor.showConnectHandle=!1;Editor.enableInlineToolbar=!0;Editor.enableAutoRotateLabels=!0;Editor.isDarkMode=function(){return Editor.darkMode};Editor.isPngDataUrl=function(b){return null!=b&&"data:image/png;"==b.substring(0,15)};Editor.isJpgDataUrl=function(b){return null!=b&&("data:image/jpg;"==b.substring(0,15)||"data:image/jpeg;"==b.substring(0,16))};Editor.isPngData=function(b){return 8<b.length&&137==b.charCodeAt(0)&&80==b.charCodeAt(1)&&78==b.charCodeAt(2)&&71==b.charCodeAt(3)&&13==b.charCodeAt(4)&&10==b.charCodeAt(5)&&26==b.charCodeAt(6)&&10==b.charCodeAt(7)};Editor.isJpgData=function(b){return 2<b.length&&255==b.charCodeAt(0)&&216==b.charCodeAt(1)};-Editor.stripImageMetadata=function(b,d){if(null!=b&&d&&(Editor.isJpgDataUrl(b)||Editor.isPngDataUrl(b))){d=b.indexOf(",")+1;var m=b.substring(d),p=window.atob&&!mxClient.IS_SF?atob(m):Base64.decode(m,!0),v=new ArrayBuffer(p.length),n=new Uint8Array(v);for(m=0;m<p.length;m++)n[m]=p.charCodeAt(m);n=null;try{Editor.isJpgData(p)?n=Editor.stripJpgMetadata(v):Editor.isPngData(p)&&(n=Editor.stripPngMetadata(v))}catch(y){}if(null!=n){p="";for(m=0;m<n.length;m++)p+=String.fromCharCode(n[m]);b=b.substring(0,+Editor.stripImageMetadata=function(b,d){if(null!=b&&d&&(Editor.isJpgDataUrl(b)||Editor.isPngDataUrl(b))){d=b.indexOf(",")+1;var m=b.substring(d),p=window.atob&&!mxClient.IS_SF?atob(m):Base64.decode(m,!0),u=new ArrayBuffer(p.length),n=new Uint8Array(u);for(m=0;m<p.length;m++)n[m]=p.charCodeAt(m);n=null;try{Editor.isJpgData(p)?n=Editor.stripJpgMetadata(u):Editor.isPngData(p)&&(n=Editor.stripPngMetadata(u))}catch(y){}if(null!=n){p="";for(m=0;m<n.length;m++)p+=String.fromCharCode(n[m]);b=b.substring(0,d)+btoa(p)}}return b};-Editor.stripJpgMetadata=function(b){var d=new DataView(b),m=[];m.push(new Uint8Array(b,0,2));for(var p=2;p<b.byteLength-1;){var v=d.getUint16(p);if(65498===v){m.push(new Uint8Array(b,p));break}if(65488<=v&&65497>=v)m.push(new Uint8Array(b,p,2)),p+=2;else{var n=d.getUint16(p+2),y=65506===v;65505===v||y||m.push(new Uint8Array(b,p,2+n));p+=2+n}}b=m.reduce(function(C,P){return C+P.length},0);b=new Uint8Array(b);d=0;m=$jscomp.makeIterator(m);for(p=m.next();!p.done;p=m.next())p=p.value,b.set(p,d),d+=p.length;+Editor.stripJpgMetadata=function(b){var d=new DataView(b),m=[];m.push(new Uint8Array(b,0,2));for(var p=2;p<b.byteLength-1;){var u=d.getUint16(p);if(65498===u){m.push(new Uint8Array(b,p));break}if(65488<=u&&65497>=u)m.push(new Uint8Array(b,p,2)),p+=2;else{var n=d.getUint16(p+2),y=65506===u;65505===u||y||m.push(new Uint8Array(b,p,2+n));p+=2+n}}b=m.reduce(function(B,P){return B+P.length},0);b=new Uint8Array(b);d=0;m=$jscomp.makeIterator(m);for(p=m.next();!p.done;p=m.next())p=p.value,b.set(p,d),d+=p.length;return b};-Editor.stripPngMetadata=function(b){var d=new DataView(b),m=new Set("eXIf tEXt iTXt zTXt iCCP tIME".split(" ")),p=[];p.push(new Uint8Array(b,0,8));for(var v=8;v<b.byteLength;){var n=d.getUint32(v),y=String.fromCharCode(d.getUint8(v+4),d.getUint8(v+5),d.getUint8(v+6),d.getUint8(v+7));n=8+n+4;m.has(y)||p.push(new Uint8Array(b,v,n));v+=n;if("IEND"===y)break}b=p.reduce(function(C,P){return C+P.length},0);b=new Uint8Array(b);d=0;p=$jscomp.makeIterator(p);for(m=p.next();!m.done;m=p.next())m=m.value,b.set(m,+Editor.stripPngMetadata=function(b){var d=new DataView(b),m=new Set("eXIf tEXt iTXt zTXt iCCP tIME".split(" ")),p=[];p.push(new Uint8Array(b,0,8));for(var u=8;u<b.byteLength;){var n=d.getUint32(u),y=String.fromCharCode(d.getUint8(u+4),d.getUint8(u+5),d.getUint8(u+6),d.getUint8(u+7));n=8+n+4;m.has(y)||p.push(new Uint8Array(b,u,n));u+=n;if("IEND"===y)break}b=p.reduce(function(B,P){return B+P.length},0);b=new Uint8Array(b);d=0;p=$jscomp.makeIterator(p);for(m=p.next();!m.done;m=p.next())m=m.value,b.set(m,d),d+=m.length;return b};Editor.convertHtmlToText=function(b){if(null!=b){var d=document.createElement("div");d.innerHTML=Graph.sanitizeHtml(b);return mxUtils.extractTextWithWhitespace(d.childNodes)}return null};-Editor.extractGraphModelFromText=function(b){function d(n){var y=n.indexOf("```");0<=y&&(n=n.substring(n,0,y+6));return n}function m(n){var y=n.lastIndexOf("```");0<=y&&(n=n.substring(y+3));return n}var p=b.indexOf("<mxGraphModel "),v=b.indexOf("</mxGraphModel>");0>p&&(p=b.indexOf("<mxGraphModel>"));return 0<=p&&v>p?[mxUtils.trim(d(b.substring(0,p))),b.substring(p,v+15),mxUtils.trim(m(b.substring(v+15)))]:[b,"",""]};-Editor.extractGraphModelFromPng=function(b){var d=null;try{var m=b.substring(b.indexOf(",")+1),p=window.atob&&!mxClient.IS_SF?atob(m):Base64.decode(m,!0);EditorUi.parsePng(p,mxUtils.bind(this,function(v,n,y){v=p.substring(v+8,v+8+y);if("zTXt"==n){y=v.indexOf(String.fromCharCode(0));var C=v.substring(0,y);if("mxGraphModel"==C||"mxfile"==C){v=Graph.stringToArrayBuffer(v.substring(y+2));y=null;try{y=pako.inflate(v,{to:"string"})}catch(P){y=pako.inflateRaw(v,{to:"string"})}y=null!=y?y.replace(/\+/g," "):-null;null!=y&&0<y.length&&(d=y)}}else"tEXt"==n&&(v=v.split(String.fromCharCode(0)),1<v.length&&("mxGraphModel"==v[0]||"mxfile"==v[0])&&(d=v[1]));if(null!=d||"IDAT"==n)return!0}))}catch(v){}null!=d&&"%"==d.charAt(0)&&(d=decodeURIComponent(d));null!=d&&"%"==d.charAt(0)&&(d=decodeURIComponent(d));return d};+Editor.extractGraphModelFromText=function(b){function d(n){var y=n.indexOf("```");0<=y&&(n=n.substring(n,0,y+6));return n}function m(n){var y=n.lastIndexOf("```");0<=y&&(n=n.substring(y+3));return n}var p=b.indexOf("<mxGraphModel "),u=b.indexOf("</mxGraphModel>");0>p&&(p=b.indexOf("<mxGraphModel>"));return 0<=p&&u>p?[mxUtils.trim(d(b.substring(0,p))),b.substring(p,u+15),mxUtils.trim(m(b.substring(u+15)))]:[b,"",""]};+Editor.extractGraphModelFromPng=function(b){var d=null;try{var m=b.substring(b.indexOf(",")+1),p=window.atob&&!mxClient.IS_SF?atob(m):Base64.decode(m,!0);EditorUi.parsePng(p,mxUtils.bind(this,function(u,n,y){u=p.substring(u+8,u+8+y);if("zTXt"==n){y=u.indexOf(String.fromCharCode(0));var B=u.substring(0,y);if("mxGraphModel"==B||"mxfile"==B){u=Graph.stringToArrayBuffer(u.substring(y+2));y=null;try{y=pako.inflate(u,{to:"string"})}catch(P){y=pako.inflateRaw(u,{to:"string"})}y=null!=y?y.replace(/\+/g," "):+null;null!=y&&0<y.length&&(d=y)}}else"tEXt"==n&&(u=u.split(String.fromCharCode(0)),1<u.length&&("mxGraphModel"==u[0]||"mxfile"==u[0])&&(d=u[1]));if(null!=d||"IDAT"==n)return!0}))}catch(u){}null!=d&&"%"==d.charAt(0)&&(d=decodeURIComponent(d));null!=d&&"%"==d.charAt(0)&&(d=decodeURIComponent(d));return d};Editor.getLabelForStylename=function(b){var d=b.match(/^([A-Za-z]*)(\d*)$/);null!=d&&1<d.length&&(b=mxUtils.trim(d[1].replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,function(m){return m.toUpperCase()}).replace(/Color[s]?/g,"")),b=mxUtils.trim(b+(0<d[2].length?" ("+d[2]+")":"")));return b};-Editor.soundex=function(b){if(null==b||0==b.length)return"";var d=[],m=1;d[0]=b[0].toUpperCase();for(var p=1,v=b.length;p<v;p++){var n=b[p].toUpperCase().charCodeAt(0)-65;if(0<=n&&25>=n&&"0"!="01230120022455012603010202"[n]&&("01230120022455012603010202"[n]!=d[m-1]&&(d[m]="01230120022455012603010202"[n],m++),3<m))break}if(3>=m)for(;3>=m;)d[m]="0",m++;return d.join("")};+Editor.soundex=function(b){if(null==b||0==b.length)return"";var d=[],m=1;d[0]=b[0].toUpperCase();for(var p=1,u=b.length;p<u;p++){var n=b[p].toUpperCase().charCodeAt(0)-65;if(0<=n&&25>=n&&"0"!="01230120022455012603010202"[n]&&("01230120022455012603010202"[n]!=d[m-1]&&(d[m]="01230120022455012603010202"[n],m++),3<m))break}if(3>=m)for(;3>=m;)d[m]="0",m++;return d.join("")};Editor.selectFilename=function(b){var d=b.value.lastIndexOf(".");if(0<d){var m=b.value.substring(d+1);"drawio"!=m&&0<=mxUtils.indexOf(["png","svg","html","xml","pdf"],m)&&(m=b.value.lastIndexOf(".drawio.",d),0<m&&(d=m))}d=0<d?d:b.value.length;Editor.selectSubstring(b,0,d)};Editor.selectSubstring=function(b,d,m){b.focus();"undefined"!=typeof b.selectionStart?(b.selectionStart=d,b.selectionEnd=m):document.selection&&document.selection.createRange&&(b.select(),b=document.selection.createRange(),b.collapse(!0),b.moveEnd("character",m),b.moveStart("character",d),b.select())};Editor.toUnit=function(b,d){return d==mxConstants.INCHES?Math.round(1E3*b/mxConstants.PIXELS_PER_INCH)/1E3:d==mxConstants.MILLIMETERS?Math.round(1E3*b/mxConstants.PIXELS_PER_MM)/1E3:d==mxConstants.METERS?Math.round(1E5*b/(1E3*mxConstants.PIXELS_PER_MM))/1E5:Math.round(10*b)/10};Editor.fromUnit=function(b,d){d==mxConstants.INCHES?b*=mxConstants.PIXELS_PER_INCH:d==mxConstants.MILLIMETERS?b*=mxConstants.PIXELS_PER_MM:d==mxConstants.METERS&&(b=b*mxConstants.PIXELS_PER_MM*1E3);return Math.round(10*b)/10};Editor.getCursorMoveStep=function(b){return b==mxConstants.MILLIMETERS?.1*mxConstants.PIXELS_PER_MM:b==mxConstants.INCHES?.01*mxConstants.PIXELS_PER_INCH:b==mxConstants.METERS?.1*mxConstants.PIXELS_PER_MM:1};mxUtils.extend(Editor,mxEventSource);Editor.prototype.originalNoForeignObject=mxClient.NO_FO;Editor.prototype.transparentImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhMAAwAIAAAP///wAAACH5BAEAAAAALAAAAAAwADAAAAIxhI+py+0Po5y02ouz3rz7D4biSJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8egpAAA7":IMAGE_PATH+"/transparent.gif";Editor.prototype.extendCanvas=!0;Editor.prototype.chromeless=!1;Editor.prototype.cancelFirst=!0;Editor.prototype.enabled=!0;Editor.prototype.filename=null;Editor.prototype.modified=!1;Editor.prototype.autosave=!0;Editor.prototype.appName=document.title;Editor.prototype.editBlankUrl=window.location.origin+window.location.pathname;Editor.prototype.defaultGraphOverflow="hidden";Editor.prototype.init=function(){};Editor.prototype.isChromelessView=function(){return this.chromeless};Editor.prototype.setAutosave=function(b){this.autosave=b;this.fireEvent(new mxEventObject("autosaveChanged"))};Editor.prototype.getEditBlankUrl=function(b){return this.editBlankUrl+b};-Editor.prototype.editAsNew=function(b,d,m,p){d=null!=d?"?title="+encodeURIComponent(d):"";m?d+=(0<d.length?"&":"?")+"lightbox=1":null!=urlParams.ui&&(d+=(0<d.length?"&":"?")+"ui="+urlParams.ui);null!=p&&(d+=(0<d.length?"&":"?")+"page-id="+p);if(navigator.standalone||"undefined"===typeof window.postMessage)this.graph.openLink(this.getEditBlankUrl(d)+"#R"+encodeURIComponent(b));else{var v=null,n=mxUtils.bind(this,function(C){"ready"==C.data&&C.source==v&&(mxEvent.removeListener(window,"message",n),-v.postMessage(b,"*"))});m=d.substring(1).split("&");p={client:1};for(d=0;d<m.length;d++){var y=m[d].split("=");p[y[0]]=y[1]||""}mxEvent.addListener(window,"message",n);v=this.graph.openLink(this.getEditBlankUrl("")+"#P"+encodeURIComponent(JSON.stringify(p)),null,!0)}};-Editor.prototype.createGraph=function(b,d){b=new Graph(null,d,null,null,b);b.transparentBackground=!1;var m=b.isCssTransformsSupported,p=this;b.isCssTransformsSupported=function(){return m.apply(this,arguments)&&(!p.chromeless||!mxClient.IS_SF)};this.chromeless||(b.isBlankLink=function(v){return!this.isExternalProtocol(v)});return b};+Editor.prototype.editAsNew=function(b,d,m,p){d=null!=d?"?title="+encodeURIComponent(d):"";m?d+=(0<d.length?"&":"?")+"lightbox=1":null!=urlParams.ui&&(d+=(0<d.length?"&":"?")+"ui="+urlParams.ui);null!=p&&(d+=(0<d.length?"&":"?")+"page-id="+p);if(navigator.standalone||"undefined"===typeof window.postMessage)this.graph.openLink(this.getEditBlankUrl(d)+"#R"+encodeURIComponent(b));else{var u=null,n=mxUtils.bind(this,function(B){"ready"==B.data&&B.source==u&&(mxEvent.removeListener(window,"message",n),+u.postMessage(b,"*"))});m=d.substring(1).split("&");p={client:1};for(d=0;d<m.length;d++){var y=m[d].split("=");p[y[0]]=y[1]||""}mxEvent.addListener(window,"message",n);u=this.graph.openLink(this.getEditBlankUrl("")+"#P"+encodeURIComponent(JSON.stringify(p)),null,!0)}};+Editor.prototype.createGraph=function(b,d){b=new Graph(null,d,null,null,b);b.transparentBackground=!1;var m=b.isCssTransformsSupported,p=this;b.isCssTransformsSupported=function(){return m.apply(this,arguments)&&(!p.chromeless||!mxClient.IS_SF)};this.chromeless||(b.isBlankLink=function(u){return!this.isExternalProtocol(u)});return b};Editor.prototype.resetGraph=function(){this.graph.gridEnabled=this.graph.defaultGridEnabled&&(!this.isChromelessView()||"1"==urlParams.grid);this.graph.graphHandler.guidesEnabled=!0;this.graph.setTooltips(null==window.urlParams||"0"!=urlParams.tooltips);this.graph.setConnectable(this.graph.defaultConnectable);this.graph.connectionArrowsEnabled=this.graph.defaultConnectionArrowsEnabled;this.graph.foldingEnabled=this.graph.defaultFoldingEnabled;this.graph.scrollbars=this.graph.defaultScrollbars;this.graph.pageVisible=this.graph.defaultPageVisible;this.graph.pageBreaksVisible=this.graph.pageVisible;this.graph.preferPageSize=this.graph.pageBreaksVisible;this.graph.background=null;this.graph.pageScale=mxGraph.prototype.pageScale;this.graph.pageFormat=mxGraph.prototype.pageFormat;this.graph.currentScale=1;this.graph.currentTranslate.x=0;this.graph.currentTranslate.y=0;this.updateGraphComponents();this.graph.view.setScale(1)};Editor.prototype.readGraphState=function(b){this.savedGraphState={};if(Editor.preserveViewState){var d=b.getAttribute("dx"),m=b.getAttribute("dy");null!=d&&(this.savedGraphState.dx=d);null!=m&&(this.savedGraphState.dy=m)}d=b.getAttribute("grid");if(null==d||""==d)d=this.graph.defaultGridEnabled?"1":"0";null!=urlParams.grid&&(this.savedGraphState.grid=d);this.graph.gridEnabled=(null!=urlParams.grid?"0"!=urlParams.grid:"0"!=d)&&(!this.isChromelessView()||"1"==urlParams.grid);this.graph.gridSize=parseFloat(b.getAttribute("gridSize"))||@@ -2054,186 +2054,186 @@ Editor.prototype.getGraphXml=function(b){if(null!=b?b:1){var d=new mxCodec(mxUtithis.graph.view.translate.x)/100),b.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100);b.setAttribute("grid",null!=d.grid?d.grid:this.graph.isGridEnabled()?"1":"0");b.setAttribute("gridSize",this.graph.gridSize);b.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0");b.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0");b.setAttribute("connect",null!=d.connect?d.connect:this.graph.connectionHandler.isEnabled()?"1":"0");b.setAttribute("arrows",null!=d.arrows?d.arrows:this.graph.connectionArrowsEnabled?"1":"0");b.setAttribute("fold",null!=d.fold?d.fold:this.graph.foldingEnabled?"1":"0");b.setAttribute("page",null!=d.page?d.page:this.graph.pageVisible?"1":"0");b.setAttribute("pageScale",this.graph.pageScale);b.setAttribute("pageWidth",this.graph.pageFormat.width);b.setAttribute("pageHeight",this.graph.pageFormat.height);null!=this.graph.background&&b.setAttribute("background",this.graph.background);return b};Editor.prototype.updateGraphComponents=function(){var b=this.graph;null!=b.container&&(b.view.validateBackground(),b.container.style.overflow=b.scrollbars?"auto":this.defaultGraphOverflow,this.fireEvent(new mxEventObject("updateGraphComponents")))};Editor.prototype.setModified=function(b){this.modified=b};Editor.prototype.setFilename=function(b){this.filename=b};-Editor.prototype.createUndoManager=function(){var b=this.graph,d=new mxUndoManager;this.undoListener=function(p,v){d.undoableEditHappened(v.getProperty("edit"))};var m=mxUtils.bind(this,function(p,v){this.undoListener.apply(this,arguments)});b.getModel().addListener(mxEvent.UNDO,m);b.getView().addListener(mxEvent.UNDO,m);m=function(p,v){p=v.getProperty("edit").changes;p=b.getSelectionCellsForChanges(p);v=!1;if(0<p.length){for(var n=[],y=0;y<p.length;y++)null!=b.view.getState(p[y])&&(n.push(p[y]),-v||(b.scrollCellToVisible(p[y]),v=!0));b.setSelectionCells(n)}};d.addListener(mxEvent.UNDO,m);d.addListener(mxEvent.REDO,m);return d};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(b){this.consumer=this.producer=null;this.done=b;this.args=null};OpenFile.prototype.setConsumer=function(b){this.consumer=b;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};+Editor.prototype.createUndoManager=function(){var b=this.graph,d=new mxUndoManager;this.undoListener=function(p,u){d.undoableEditHappened(u.getProperty("edit"))};var m=mxUtils.bind(this,function(p,u){this.undoListener.apply(this,arguments)});b.getModel().addListener(mxEvent.UNDO,m);b.getView().addListener(mxEvent.UNDO,m);m=function(p,u){p=u.getProperty("edit").changes;p=b.getSelectionCellsForChanges(p);u=!1;if(0<p.length){for(var n=[],y=0;y<p.length;y++)null!=b.view.getState(p[y])&&(n.push(p[y]),+u||(b.scrollCellToVisible(p[y]),u=!0));b.setSelectionCells(n)}};d.addListener(mxEvent.UNDO,m);d.addListener(mxEvent.REDO,m);return d};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(b){this.consumer=this.producer=null;this.done=b;this.args=null};OpenFile.prototype.setConsumer=function(b){this.consumer=b;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};OpenFile.prototype.error=function(b){this.cancel(!0);mxUtils.alert(b)};OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))};OpenFile.prototype.cancel=function(b){null!=this.done&&this.done(null!=b?b:!0)};-function Dialog(b,d,m,p,v,n,y,C,P,G,O){this.editorUi=b;null==this.bg&&(this.bg=b.createDiv("geBackground"));v&&null!=document.body&&document.body.appendChild(this.bg);v=b.createDiv(P?"geTransDialog":"geDialog");v.style.width=m+48+"px";null!=p&&(v.style.height=p+48+"px");"1"!=urlParams.embedInline||Editor.inlineFullscreen||null==b.embedViewport||(v.style.left=b.embedViewport.x+b.embedViewport.width/2+"px",v.style.top=b.embedViewport.y+b.embedViewport.height/2+"px");v.appendChild(d);null!=document.body&&-document.body.appendChild(v);null==p&&(v.style.height=d.scrollHeight+48+"px");if(n&&(d=document.createElement("div"),d.className="geButton",d.setAttribute("title",mxResources.get("close")),d.style.backgroundImage="url("+Editor.crossImage+")",d.style.position="absolute",d.style.top="0px",d.style.right="0px",mxEvent.addListener(d,"click",mxUtils.bind(this,function(){b.hideDialog(!0)})),v.appendChild(d),!O)){var U=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(c){U=!0}),null,mxUtils.bind(this,-function(c){U&&(b.hideDialog(!0),U=!1)}))}this.onDialogClose=y;this.container=v;null!=G&&this.addResizeHandler(G);b.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.prototype.noColorImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC";+function Dialog(b,d,m,p,u,n,y,B,P,G,O){this.editorUi=b;null==this.bg&&(this.bg=b.createDiv("geBackground"));u&&null!=document.body&&document.body.appendChild(this.bg);u=b.createDiv(P?"geTransDialog":"geDialog");u.style.width=m+48+"px";null!=p&&(u.style.height=p+48+"px");"1"!=urlParams.embedInline||Editor.inlineFullscreen||null==b.embedViewport||(u.style.left=b.embedViewport.x+b.embedViewport.width/2+"px",u.style.top=b.embedViewport.y+b.embedViewport.height/2+"px");u.appendChild(d);null!=document.body&&+document.body.appendChild(u);null==p&&(u.style.height=d.scrollHeight+48+"px");if(n&&(d=document.createElement("div"),d.className="geButton",d.setAttribute("title",mxResources.get("close")),d.style.backgroundImage="url("+Editor.crossImage+")",d.style.position="absolute",d.style.top="0px",d.style.right="0px",mxEvent.addListener(d,"click",mxUtils.bind(this,function(){b.hideDialog(!0)})),u.appendChild(d),!O)){var U=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(c){U=!0}),null,mxUtils.bind(this,+function(c){U&&(b.hideDialog(!0),U=!1)}))}this.onDialogClose=y;this.container=u;null!=G&&this.addResizeHandler(G);b.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.prototype.noColorImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC";Dialog.prototype.closeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==";Dialog.prototype.clearImage="data:image/gif;base64,R0lGODlhDQAKAIABAMDAwP///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUIzOEM1NzI4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUIzOEM1NzM4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QjM4QzU3MDg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QjM4QzU3MTg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAANAAoAAAIXTGCJebD9jEOTqRlttXdrB32PJ2ncyRQAOw==";Dialog.prototype.getDocumentSize=function(){return mxUtils.getDocumentSize()};Dialog.prototype.getPosition=function(b,d){return new mxPoint(b,d)};-Dialog.prototype.addResizeHandler=function(b){var d=document.createElement("img");d.setAttribute("src",mxWindow.prototype.resizeImage);d.style.cursor="nwse-resize";d.style.position="absolute";d.style.bottom="0px";d.style.right="0px";d.style.zIndex="2";var m=this,p=function(v,n){var y=null,C=null,P=null,G=null,O=function(c){if(null!=y){var f=mxEvent.getClientX(c)-y,k=mxEvent.getClientY(c)-C,q=P,x=G;0<=n.indexOf("r")&&(q+=2*f);0<=n.indexOf("l")&&(q-=2*f);0<=n.indexOf("b")&&(x+=2*k);0<=n.indexOf("t")&&-(x-=2*k);m.container.style.width=Math.max(b.width,q)+"px";m.container.style.height=Math.max(b.height,x)+"px";mxEvent.consume(c)}},U=function(c){if(null!=y&&(C=y=null,mxEvent.removeGestureListeners(document,null,O,U),mxEvent.consume(c),"function"===typeof m.onResize))m.onResize(parseInt(m.container.style.width),parseInt(m.container.style.height))};mxEvent.addGestureListeners(v,function(c){y=mxEvent.getClientX(c);C=mxEvent.getClientY(c);P=parseInt(m.container.style.width);G=parseInt(m.container.style.height);+Dialog.prototype.addResizeHandler=function(b){var d=document.createElement("img");d.setAttribute("src",mxWindow.prototype.resizeImage);d.style.cursor="nwse-resize";d.style.position="absolute";d.style.bottom="0px";d.style.right="0px";d.style.zIndex="2";var m=this,p=function(u,n){var y=null,B=null,P=null,G=null,O=function(c){if(null!=y){var f=mxEvent.getClientX(c)-y,k=mxEvent.getClientY(c)-B,q=P,x=G;0<=n.indexOf("r")&&(q+=2*f);0<=n.indexOf("l")&&(q-=2*f);0<=n.indexOf("b")&&(x+=2*k);0<=n.indexOf("t")&&+(x-=2*k);m.container.style.width=Math.max(b.width,q)+"px";m.container.style.height=Math.max(b.height,x)+"px";mxEvent.consume(c)}},U=function(c){if(null!=y&&(B=y=null,mxEvent.removeGestureListeners(document,null,O,U),mxEvent.consume(c),"function"===typeof m.onResize))m.onResize(parseInt(m.container.style.width),parseInt(m.container.style.height))};mxEvent.addGestureListeners(u,function(c){y=mxEvent.getClientX(c);B=mxEvent.getClientY(c);P=parseInt(m.container.style.width);G=parseInt(m.container.style.height);mxEvent.addGestureListeners(document,null,O,U);mxEvent.consume(c)},O,U)};p(d,"br");this.container.appendChild(d);installDialogEdgeResizeHandles(this.container,p)};function installDialogEdgeResizeHandles(b,d){var m=[];[{styles:"top:0;left:0;width:8px;height:8px;",cursor:"nw-resize",edges:"tl"},{styles:"top:0;left:8px;right:8px;height:4px;",cursor:"n-resize",edges:"t"},{styles:"top:0;right:0;width:8px;height:8px;",cursor:"ne-resize",edges:"tr"},{styles:"top:8px;right:0;bottom:14px;width:4px;",cursor:"e-resize",edges:"r"},{styles:"bottom:0;left:0;width:8px;height:8px;",cursor:"sw-resize",edges:"bl"},{styles:"bottom:0;left:8px;right:14px;height:4px;",cursor:"s-resize",-edges:"b"},{styles:"top:8px;left:0;bottom:8px;width:4px;",cursor:"w-resize",edges:"l"}].forEach(function(p){var v=document.createElement("div");v.style.cssText="position:absolute;z-index:2;"+p.styles+"cursor:"+p.cursor;d(v,p.edges);b.appendChild(v);m.push(v)});return m}+edges:"b"},{styles:"top:8px;left:0;bottom:8px;width:4px;",cursor:"w-resize",edges:"l"}].forEach(function(p){var u=document.createElement("div");u.style.cssText="position:absolute;z-index:2;"+p.styles+"cursor:"+p.cursor;d(u,p.edges);b.appendChild(u);m.push(u)});return m}(function(){var b=mxWindow.prototype.setResizable;mxWindow.prototype.setResizable=function(d){b.apply(this,arguments);d?null==this._edgeResizeHandles?this._edgeResizeHandles=installMxWindowEdgeResizeHandles(this):this._edgeResizeHandles.forEach(function(m){m.style.display=""}):null!=this._edgeResizeHandles&&this._edgeResizeHandles.forEach(function(m){m.style.display="none"})}})();-function installMxWindowEdgeResizeHandles(b){var d=b.minimumSize||new mxRectangle(0,0,50,40);return installDialogEdgeResizeHandles(b.div,function(m,p){var v=null,n=null,y,C,P,G,O=function(c){if(null!=v){var f=mxEvent.getClientX(c)-v,k=mxEvent.getClientY(c)-n,q=y,x=C,B=P,E=G;0<=p.indexOf("t")&&(x=C+k,E=G-k);0<=p.indexOf("b")&&(E=G+k);0<=p.indexOf("l")&&(q=y+f,B=P-f);0<=p.indexOf("r")&&(B=P+f);B<d.width&&(0<=p.indexOf("l")&&(q=y+P-d.width),B=d.width);E<d.height&&(0<=p.indexOf("t")&&(x=C+G-d.height),-E=d.height);q===y&&x===C||b.setLocation(q,x);b.setSize(B,E);b.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",c));mxEvent.consume(c)}},U=function(c){null!=v&&(n=v=null,mxEvent.removeGestureListeners(document,null,O,U),b.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",c)),mxEvent.consume(c))};mxEvent.addGestureListeners(m,function(c){b.activate();null!=b.dockState&&(b.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",c)),b.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",c)));v=-mxEvent.getClientX(c);n=mxEvent.getClientY(c);y=b.getX();C=b.getY();P=parseInt(b.div.style.width)||b.div.offsetWidth;G=parseInt(b.div.style.height)||b.div.offsetHeight;mxEvent.addGestureListeners(document,null,O,U);b.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",c));mxEvent.consume(c)},O,U)})}+function installMxWindowEdgeResizeHandles(b){var d=b.minimumSize||new mxRectangle(0,0,50,40);return installDialogEdgeResizeHandles(b.div,function(m,p){var u=null,n=null,y,B,P,G,O=function(c){if(null!=u){var f=mxEvent.getClientX(c)-u,k=mxEvent.getClientY(c)-n,q=y,x=B,C=P,E=G;0<=p.indexOf("t")&&(x=B+k,E=G-k);0<=p.indexOf("b")&&(E=G+k);0<=p.indexOf("l")&&(q=y+f,C=P-f);0<=p.indexOf("r")&&(C=P+f);C<d.width&&(0<=p.indexOf("l")&&(q=y+P-d.width),C=d.width);E<d.height&&(0<=p.indexOf("t")&&(x=B+G-d.height),+E=d.height);q===y&&x===B||b.setLocation(q,x);b.setSize(C,E);b.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",c));mxEvent.consume(c)}},U=function(c){null!=u&&(n=u=null,mxEvent.removeGestureListeners(document,null,O,U),b.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",c)),mxEvent.consume(c))};mxEvent.addGestureListeners(m,function(c){b.activate();null!=b.dockState&&(b.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",c)),b.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",c)));u=+mxEvent.getClientX(c);n=mxEvent.getClientY(c);y=b.getX();B=b.getY();P=parseInt(b.div.style.width)||b.div.offsetWidth;G=parseInt(b.div.style.height)||b.div.offsetHeight;mxEvent.addGestureListeners(document,null,O,U);b.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",c));mxEvent.consume(c)},O,U)})}Dialog.prototype.close=function(b,d){if(null!=this.onDialogClose){if(0==this.onDialogClose(b,d))return!1;this.onDialogClose=null}null!=this.dialogImg&&null!=this.dialogImg.parentNode&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null);null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);null!=this.editorUi.embedViewport?this.editorUi.removeListener(this.resizeListener):mxEvent.removeListener(window,"resize",this.resizeListener);null!=this.container.parentNode&&this.container.parentNode.removeChild(this.container)};-var ErrorDialog=function(b,d,m,p,v,n,y,C,P,G,O){P=null!=P?P:!0;var U=document.createElement("div");U.style.textAlign="center";U.style.flexDirection="column";U.style.maxHeight="100%";U.style.display="flex";if(null!=d){var c=document.createElement("div");c.style.padding="0px";c.style.margin="0px";c.style.fontSize="14px";c.style.fontWeight="600";c.style.paddingBottom="12px";c.style.marginBottom="10px";c.style.borderBottom="1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1))";c.style.whiteSpace=+var ErrorDialog=function(b,d,m,p,u,n,y,B,P,G,O){P=null!=P?P:!0;var U=document.createElement("div");U.style.textAlign="center";U.style.flexDirection="column";U.style.maxHeight="100%";U.style.display="flex";if(null!=d){var c=document.createElement("div");c.style.padding="0px";c.style.margin="0px";c.style.fontSize="14px";c.style.fontWeight="600";c.style.paddingBottom="12px";c.style.marginBottom="10px";c.style.borderBottom="1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1))";c.style.whiteSpace="nowrap";c.style.textOverflow="ellipsis";c.style.overflow="hidden";c.style.flexShrink="0";mxUtils.write(c,d);c.setAttribute("title",d);U.appendChild(c)}d=document.createElement("div");d.style.lineHeight="1.2em";d.style.padding="6px";d.style.flexGrow="1";d.style.overflowY="auto";"string"===typeof m&&(m=m.replace(/\n/g,"<br/>"));d.innerHTML=Graph.sanitizeHtml(m);U.appendChild(d);m=document.createElement("div");m.style.marginTop="12px";m.style.textAlign="center";null!=n&&(d=mxUtils.button(mxResources.get("tryAgain"),-function(){b.hideDialog();n()}),d.className="geBtn",m.appendChild(d),m.style.textAlign="center");null!=G&&(G=mxUtils.button(G,function(){null!=O&&O()}),G.className="geBtn",m.appendChild(G));var f=mxUtils.button(p,function(){P&&b.hideDialog();null!=v&&v()});f.className="geBtn";m.appendChild(f);null!=y&&(p=mxUtils.button(y,function(){P&&b.hideDialog();null!=C&&C()}),p.className="geBtn gePrimaryBtn",m.appendChild(p));this.init=function(){f.focus()};U.appendChild(m);this.container=U},PrintDialog=function(b,+function(){b.hideDialog();n()}),d.className="geBtn",m.appendChild(d),m.style.textAlign="center");null!=G&&(G=mxUtils.button(G,function(){null!=O&&O()}),G.className="geBtn",m.appendChild(G));var f=mxUtils.button(p,function(){P&&b.hideDialog();null!=u&&u()});f.className="geBtn";m.appendChild(f);null!=y&&(p=mxUtils.button(y,function(){P&&b.hideDialog();null!=B&&B()}),p.className="geBtn gePrimaryBtn",m.appendChild(p));this.init=function(){f.focus()};U.appendChild(m);this.container=U},PrintDialog=function(b,d,m,p){this.create(b,d,m,p)};-PrintDialog.prototype.create=function(b){function d(f){var k=y.checked||G.checked,q=parseInt(U.value)/100;isNaN(q)&&(q=1,U.value="100%");mxClient.IS_SF&&(q*=.75);var x=m.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,B=1/m.pageScale;if(k){var E=y.checked?1:parseInt(O.value);isNaN(E)||(B=mxUtils.getScaleForPageCount(E,m,x))}var L=E=0;x=mxRectangle.fromRectangle(x);x.width*=q;x.height*=q;B*=q;!k&&m.pageVisible?(q=m.getPageLayout(),E-=q.x*x.width,L-=q.y*x.height):k=!0;k=PrintDialog.createPrintPreview(m,-B,x,0,E,L,k);k.open();f&&PrintDialog.printPreview(k)}var m=b.editor.graph,p=document.createElement("table");p.style.width="100%";p.style.height="100%";var v=document.createElement("tbody");var n=document.createElement("tr");var y=document.createElement("input");y.setAttribute("type","checkbox");var C=document.createElement("td");C.setAttribute("colspan","2");C.style.fontSize="10pt";C.appendChild(y);var P=document.createElement("span");mxUtils.write(P," "+mxResources.get("fitPage"));C.appendChild(P);-mxEvent.addListener(P,"click",function(f){y.checked=!y.checked;G.checked=!y.checked;mxEvent.consume(f)});mxEvent.addListener(y,"change",function(){G.checked=!y.checked});n.appendChild(C);v.appendChild(n);n=n.cloneNode(!1);var G=document.createElement("input");G.setAttribute("type","checkbox");C=document.createElement("td");C.style.fontSize="10pt";C.appendChild(G);P=document.createElement("span");mxUtils.write(P," "+mxResources.get("posterPrint")+":");C.appendChild(P);mxEvent.addListener(P,"click",-function(f){G.checked=!G.checked;y.checked=!G.checked;mxEvent.consume(f)});n.appendChild(C);var O=document.createElement("input");O.setAttribute("value","1");O.setAttribute("type","number");O.setAttribute("min","1");O.setAttribute("size","4");O.setAttribute("disabled","disabled");O.style.width="50px";C=document.createElement("td");C.style.fontSize="10pt";C.appendChild(O);mxUtils.write(C," "+mxResources.get("pages")+" (max)");n.appendChild(C);v.appendChild(n);mxEvent.addListener(G,"change",function(){G.checked?-O.removeAttribute("disabled"):O.setAttribute("disabled","disabled");y.checked=!G.checked});n=n.cloneNode(!1);C=document.createElement("td");mxUtils.write(C,mxResources.get("pageScale")+":");n.appendChild(C);C=document.createElement("td");var U=document.createElement("input");U.setAttribute("value","100 %");U.setAttribute("size","5");U.style.width="50px";C.appendChild(U);n.appendChild(C);v.appendChild(n);n=document.createElement("tr");C=document.createElement("td");C.colSpan=2;C.style.paddingTop="30px";-C.setAttribute("align","right");P=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});P.className="geBtn";b.editor.cancelFirst&&C.appendChild(P);if(PrintDialog.previewEnabled){var c=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();d(!1)});c.className="geBtn";C.appendChild(c)}c=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();d(!0)});c.className="geBtn gePrimaryBtn";C.appendChild(c);b.editor.cancelFirst||C.appendChild(P);-n.appendChild(C);v.appendChild(n);p.appendChild(v);n=document.createElement("div");n.style.paddingBottom="20px";n.appendChild(p);this.container=n};PrintDialog.printPreview=function(b){try{null!=b.wnd&&window.setTimeout(function(){b.wnd.focus();b.wnd.print();b.wnd.close()},500)}catch(d){}};-PrintDialog.createPrintPreview=function(b,d,m,p,v,n,y){d=new mxPrintPreview(b,d,m,p,v,n);d.title=mxResources.get("preview");d.addPageCss=!mxClient.IS_SF;d.printBackgroundImage=!0;d.autoOrigin=y;y=b.background;if(null==y||""==y||y==mxConstants.NONE)y="#ffffff";d.backgroundColor=y;var C=d.isTextLabel;d.isTextLabel=function(G){return"geHint"==!G.className&&C.apply(this,arguments)};var P=d.getLinkForCellState;d.getLinkForCellState=function(G){return b.getAbsoluteUrl(P.apply(this,arguments))};return d};+PrintDialog.prototype.create=function(b){function d(f){var k=y.checked||G.checked,q=parseInt(U.value)/100;isNaN(q)&&(q=1,U.value="100%");mxClient.IS_SF&&(q*=.75);var x=m.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,C=1/m.pageScale;if(k){var E=y.checked?1:parseInt(O.value);isNaN(E)||(C=mxUtils.getScaleForPageCount(E,m,x))}var L=E=0;x=mxRectangle.fromRectangle(x);x.width*=q;x.height*=q;C*=q;!k&&m.pageVisible?(q=m.getPageLayout(),E-=q.x*x.width,L-=q.y*x.height):k=!0;k=PrintDialog.createPrintPreview(m,+C,x,0,E,L,k);k.open();f&&PrintDialog.printPreview(k)}var m=b.editor.graph,p=document.createElement("table");p.style.width="100%";p.style.height="100%";var u=document.createElement("tbody");var n=document.createElement("tr");var y=document.createElement("input");y.setAttribute("type","checkbox");var B=document.createElement("td");B.setAttribute("colspan","2");B.style.fontSize="10pt";B.appendChild(y);var P=document.createElement("span");mxUtils.write(P," "+mxResources.get("fitPage"));B.appendChild(P);+mxEvent.addListener(P,"click",function(f){y.checked=!y.checked;G.checked=!y.checked;mxEvent.consume(f)});mxEvent.addListener(y,"change",function(){G.checked=!y.checked});n.appendChild(B);u.appendChild(n);n=n.cloneNode(!1);var G=document.createElement("input");G.setAttribute("type","checkbox");B=document.createElement("td");B.style.fontSize="10pt";B.appendChild(G);P=document.createElement("span");mxUtils.write(P," "+mxResources.get("posterPrint")+":");B.appendChild(P);mxEvent.addListener(P,"click",+function(f){G.checked=!G.checked;y.checked=!G.checked;mxEvent.consume(f)});n.appendChild(B);var O=document.createElement("input");O.setAttribute("value","1");O.setAttribute("type","number");O.setAttribute("min","1");O.setAttribute("size","4");O.setAttribute("disabled","disabled");O.style.width="50px";B=document.createElement("td");B.style.fontSize="10pt";B.appendChild(O);mxUtils.write(B," "+mxResources.get("pages")+" (max)");n.appendChild(B);u.appendChild(n);mxEvent.addListener(G,"change",function(){G.checked?+O.removeAttribute("disabled"):O.setAttribute("disabled","disabled");y.checked=!G.checked});n=n.cloneNode(!1);B=document.createElement("td");mxUtils.write(B,mxResources.get("pageScale")+":");n.appendChild(B);B=document.createElement("td");var U=document.createElement("input");U.setAttribute("value","100 %");U.setAttribute("size","5");U.style.width="50px";B.appendChild(U);n.appendChild(B);u.appendChild(n);n=document.createElement("tr");B=document.createElement("td");B.colSpan=2;B.style.paddingTop="30px";+B.setAttribute("align","right");P=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});P.className="geBtn";b.editor.cancelFirst&&B.appendChild(P);if(PrintDialog.previewEnabled){var c=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();d(!1)});c.className="geBtn";B.appendChild(c)}c=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();d(!0)});c.className="geBtn gePrimaryBtn";B.appendChild(c);b.editor.cancelFirst||B.appendChild(P);+n.appendChild(B);u.appendChild(n);p.appendChild(u);n=document.createElement("div");n.style.paddingBottom="20px";n.appendChild(p);this.container=n};PrintDialog.printPreview=function(b){try{null!=b.wnd&&window.setTimeout(function(){b.wnd.focus();b.wnd.print();b.wnd.close()},500)}catch(d){}};+PrintDialog.createPrintPreview=function(b,d,m,p,u,n,y){d=new mxPrintPreview(b,d,m,p,u,n);d.title=mxResources.get("preview");d.addPageCss=!mxClient.IS_SF;d.printBackgroundImage=!0;d.autoOrigin=y;y=b.background;if(null==y||""==y||y==mxConstants.NONE)y="#ffffff";d.backgroundColor=y;var B=d.isTextLabel;d.isTextLabel=function(G){return"geHint"==!G.className&&B.apply(this,arguments)};var P=d.getLinkForCellState;d.getLinkForCellState=function(G){return b.getAbsoluteUrl(P.apply(this,arguments))};return d};PrintDialog.previewEnabled=!0;-var PageSetupDialog=function(b){var d=b.editor.graph,m=document.createElement("div"),p=function(E){E.style.minWidth="140px";return E},v=function(E){E.style.marginLeft="8px";return E},n=document.createElement("h3");mxUtils.write(n,mxResources.get("pageSetup"));m.appendChild(n);n=document.createElement("div");n.className="geDialogSection";var y=document.createElement("div");y.className="geDialogFormRow geDialogFormRowTop";var C=document.createElement("span");C.className="geDialogFormLabel";mxUtils.write(C,-mxResources.get("paperSize")+":");y.appendChild(p(C));C=document.createElement("div");C.style.flex="1";C.style.minWidth="0";var P=PageSetupDialog.addPageFormatPanel(C,"pagesetupdialog",d.pageFormat);y.appendChild(v(C));n.appendChild(y);m.appendChild(n);n=document.createElement("div");n.className="geDialogSection";y=document.createElement("div");y.className="geDialogFormRow";C=document.createElement("span");C.className="geDialogFormLabel";mxUtils.write(C,mxResources.get("gridSize")+":");y.appendChild(p(C));-var G=document.createElement("input");G.setAttribute("type","number");G.setAttribute("min","0");G.setAttribute("step","any");G.style.width="60px";G.style.flex="0 0 auto";G.value=d.getGridSize();y.appendChild(v(G));mxEvent.addListener(G,"change",function(){var E=parseFloat(G.value);G.value=Math.max(1,isNaN(E)?d.getGridSize():E)});n.appendChild(y);m.appendChild(n);n=document.createElement("div");n.className="geDialogSection";y=document.createElement("div");y.className="geDialogFormRow";C=document.createElement("span");-C.className="geDialogFormLabel";mxUtils.write(C,mxResources.get("background")+":");y.appendChild(p(C));var O=d.backgroundImage,U=d.background;C=document.createElement("button");C.className="geBtn";C.style.margin="0px";mxUtils.write(C,mxResources.get("change")+"...");mxEvent.addListener(C,"click",function(E){b.showBackgroundImageDialog(function(L,Q,V){Q||(null!=L&&null!=L.src&&Graph.isPageLink(L.src)&&(L={originalSrc:L.src}),O=L);U=V},O,U,!0);mxEvent.consume(E)});y.appendChild(v(C));n.appendChild(y);-m.appendChild(n);n=b.addAdvancedSection(m);y=document.createElement("div");y.className="geDialogFormRow";C=document.createElement("span");C.className="geDialogFormLabel";mxUtils.write(C,mxResources.get("adaptiveColors")+":");y.appendChild(p(C));var c=document.createElement("select");v(c);C=function(E,L){var Q=document.createElement("option");Q.setAttribute("value",E);mxUtils.write(Q,L);c.appendChild(Q)};C("default",mxResources.get("default")+" ("+mxResources.get(Graph.getDefaultAdaptiveColorsKey())+-")");C("auto",mxResources.get("automatic"));C("simple",mxResources.get("simple"));C("none",mxResources.get("none"));c.value=null==d.adaptiveColors?"default":d.adaptiveColors;y.appendChild(c);null==b.menus||null==b.menus.createHelpLink||b.isOffline()&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp||(C=b.menus.createHelpLink("https://www.drawio.com/docs/manual/editor/appearance/adaptive-colours/"),C.style.marginLeft="8px",y.appendChild(C));n.content.appendChild(y);if(null!=b.currentPage){var f=b.currentPage.getViewBox();-var k=!1;y=document.createElement("div");y.className="geDialogSection";C=document.createElement("div");C.className="geDialogFormRow";var q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("initialView",null,"Initial view")+":");C.appendChild(p(q));p=document.createElement("div");p.style.flex="1";p.style.minWidth="0";p.style.display="flex";p.style.alignItems="center";var x=document.createElement("span");x.style.flex="1 1 auto";x.style.minWidth="0";x.style.overflow=-"hidden";x.style.textOverflow="ellipsis";x.style.whiteSpace="nowrap";x.style.lineHeight="normal";var B=function(){if(null!=f){var E=f.x+", "+f.y;null!=f.scale&&(E+=" · "+Math.round(100*f.scale)+"%")}else E=mxResources.get("default");x.textContent=E};B();p.appendChild(x);C.appendChild(v(p));y.appendChild(C);p=document.createElement("div");p.className="geDialogFormRow";p.style.justifyContent="flex-end";p.style.flexWrap="wrap";p.style.gap="8px";C=mxUtils.button(mxResources.get("useCurrent"),function(){f=-d.getCurrentViewBox();k=!0;B()});C.className="geBtn";C.style.margin="0px";C.style.flexShrink="0";p.appendChild(C);C=mxUtils.button(mxResources.get("reset"),function(){f=null;k=!0;B()});C.className="geBtn";C.style.margin="0px";C.style.flexShrink="0";p.appendChild(C);y.appendChild(p);n.wrapper.appendChild(y)}"undefined"!==typeof AnimationDialog&&(p=document.createElement("div"),p.className="geDialogSection",y=document.createElement("div"),y.className="geDialogFormRow geDialogFormRowTop",C=document.createElement("span"),-C.className="geDialogFormLabel",C.style.minWidth="0",mxUtils.write(C,mxResources.get("animation",null,"Animation")+":"),y.appendChild(C),C=document.createElement("div"),C.style.flex="1",C.style.minWidth="0",C.style.display="flex",C.style.alignItems="center",C.style.gap="8px",q=document.createElement("span"),q.className="geDialogHint",q.style.flex="1 1 auto",q.style.minWidth="0",mxUtils.write(q,mxResources.get("lightboxAnimationHint",null,"Plays automatically when the page is shown in lightbox mode.")),-C.appendChild(q),q=mxUtils.button(mxResources.get("edit",null,"Edit"),function(){b.hideDialog();var E=b.menus;null!=E&&null!=E.animationWindow?(E.animationWindow.window.setVisible(!0),E.animationWindow.window.activate()):null!=b.actions.get("animation")&&b.actions.get("animation").funct()}),q.className="geBtn",q.style.minWidth="90px",C.appendChild(q),y.appendChild(v(C)),p.appendChild(y),n.wrapper.appendChild(p));v=m.querySelectorAll(".geBtn");for(p=0;p<v.length;p++)n=mxUtils.trim(v[p].textContent),-null==v[p].getAttribute("title")&&""!=n&&v[p].setAttribute("title",n);this.container=(new CustomDialog(b,m,function(){var E=parseFloat(G.value);isNaN(E)||d.gridSize===E||d.setGridSize(E);E=new ChangePageSetup(b,U,O,P.get());E.ignoreColor=d.background==U;E.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=O?O.src:null);var L=c.value,Q=L!=(null==d.adaptiveColors?"default":d.adaptiveColors);Q&&(E.adaptiveColors=L);d.pageFormat.width==E.previousFormat.width&&d.pageFormat.height==+var PageSetupDialog=function(b){var d=b.editor.graph,m=document.createElement("div"),p=function(E){E.style.minWidth="140px";return E},u=function(E){E.style.marginLeft="8px";return E},n=document.createElement("h3");mxUtils.write(n,mxResources.get("pageSetup"));m.appendChild(n);n=document.createElement("div");n.className="geDialogSection";var y=document.createElement("div");y.className="geDialogFormRow geDialogFormRowTop";var B=document.createElement("span");B.className="geDialogFormLabel";mxUtils.write(B,+mxResources.get("paperSize")+":");y.appendChild(p(B));B=document.createElement("div");B.style.flex="1";B.style.minWidth="0";var P=PageSetupDialog.addPageFormatPanel(B,"pagesetupdialog",d.pageFormat);y.appendChild(u(B));n.appendChild(y);m.appendChild(n);n=document.createElement("div");n.className="geDialogSection";y=document.createElement("div");y.className="geDialogFormRow";B=document.createElement("span");B.className="geDialogFormLabel";mxUtils.write(B,mxResources.get("gridSize")+":");y.appendChild(p(B));+var G=document.createElement("input");G.setAttribute("type","number");G.setAttribute("min","0");G.setAttribute("step","any");G.style.width="60px";G.style.flex="0 0 auto";G.value=d.getGridSize();y.appendChild(u(G));mxEvent.addListener(G,"change",function(){var E=parseFloat(G.value);G.value=Math.max(1,isNaN(E)?d.getGridSize():E)});n.appendChild(y);m.appendChild(n);n=document.createElement("div");n.className="geDialogSection";y=document.createElement("div");y.className="geDialogFormRow";B=document.createElement("span");+B.className="geDialogFormLabel";mxUtils.write(B,mxResources.get("background")+":");y.appendChild(p(B));var O=d.backgroundImage,U=d.background;B=document.createElement("button");B.className="geBtn";B.style.margin="0px";mxUtils.write(B,mxResources.get("change")+"...");mxEvent.addListener(B,"click",function(E){b.showBackgroundImageDialog(function(L,Q,V){Q||(null!=L&&null!=L.src&&Graph.isPageLink(L.src)&&(L={originalSrc:L.src}),O=L);U=V},O,U,!0);mxEvent.consume(E)});y.appendChild(u(B));n.appendChild(y);+m.appendChild(n);n=b.addAdvancedSection(m);y=document.createElement("div");y.className="geDialogFormRow";B=document.createElement("span");B.className="geDialogFormLabel";mxUtils.write(B,mxResources.get("adaptiveColors")+":");y.appendChild(p(B));var c=document.createElement("select");u(c);B=function(E,L){var Q=document.createElement("option");Q.setAttribute("value",E);mxUtils.write(Q,L);c.appendChild(Q)};B("default",mxResources.get("default")+" ("+mxResources.get(Graph.getDefaultAdaptiveColorsKey())++")");B("auto",mxResources.get("automatic"));B("simple",mxResources.get("simple"));B("none",mxResources.get("none"));c.value=null==d.adaptiveColors?"default":d.adaptiveColors;y.appendChild(c);null==b.menus||null==b.menus.createHelpLink||b.isOffline()&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp||(B=b.menus.createHelpLink("https://www.drawio.com/docs/manual/editor/appearance/adaptive-colours/"),B.style.marginLeft="8px",y.appendChild(B));n.content.appendChild(y);if(null!=b.currentPage){var f=b.currentPage.getViewBox();+var k=!1;y=document.createElement("div");y.className="geDialogSection";B=document.createElement("div");B.className="geDialogFormRow";var q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("initialView",null,"Initial view")+":");B.appendChild(p(q));p=document.createElement("div");p.style.flex="1";p.style.minWidth="0";p.style.display="flex";p.style.alignItems="center";var x=document.createElement("span");x.style.flex="1 1 auto";x.style.minWidth="0";x.style.overflow=+"hidden";x.style.textOverflow="ellipsis";x.style.whiteSpace="nowrap";x.style.lineHeight="normal";var C=function(){if(null!=f){var E=f.x+", "+f.y;null!=f.scale&&(E+=" · "+Math.round(100*f.scale)+"%")}else E=mxResources.get("default");x.textContent=E};C();p.appendChild(x);B.appendChild(u(p));y.appendChild(B);p=document.createElement("div");p.className="geDialogFormRow";p.style.justifyContent="flex-end";p.style.flexWrap="wrap";p.style.gap="8px";B=mxUtils.button(mxResources.get("useCurrent"),function(){f=+d.getCurrentViewBox();k=!0;C()});B.className="geBtn";B.style.margin="0px";B.style.flexShrink="0";p.appendChild(B);B=mxUtils.button(mxResources.get("reset"),function(){f=null;k=!0;C()});B.className="geBtn";B.style.margin="0px";B.style.flexShrink="0";p.appendChild(B);y.appendChild(p);n.wrapper.appendChild(y)}"undefined"!==typeof AnimationDialog&&(p=document.createElement("div"),p.className="geDialogSection",y=document.createElement("div"),y.className="geDialogFormRow geDialogFormRowTop",B=document.createElement("span"),+B.className="geDialogFormLabel",B.style.minWidth="0",mxUtils.write(B,mxResources.get("animation",null,"Animation")+":"),y.appendChild(B),B=document.createElement("div"),B.style.flex="1",B.style.minWidth="0",B.style.display="flex",B.style.alignItems="center",B.style.gap="8px",q=document.createElement("span"),q.className="geDialogHint",q.style.flex="1 1 auto",q.style.minWidth="0",mxUtils.write(q,mxResources.get("lightboxAnimationHint",null,"Plays automatically when the page is shown in lightbox mode.")),+B.appendChild(q),q=mxUtils.button(mxResources.get("edit",null,"Edit"),function(){b.hideDialog();var E=b.menus;null!=E&&null!=E.animationWindow?(E.animationWindow.window.setVisible(!0),E.animationWindow.window.activate()):null!=b.actions.get("animation")&&b.actions.get("animation").funct()}),q.className="geBtn",q.style.minWidth="90px",B.appendChild(q),y.appendChild(u(B)),p.appendChild(y),n.wrapper.appendChild(p));u=m.querySelectorAll(".geBtn");for(p=0;p<u.length;p++)n=mxUtils.trim(u[p].textContent),+null==u[p].getAttribute("title")&&""!=n&&u[p].setAttribute("title",n);this.container=(new CustomDialog(b,m,function(){var E=parseFloat(G.value);isNaN(E)||d.gridSize===E||d.setGridSize(E);E=new ChangePageSetup(b,U,O,P.get());E.ignoreColor=d.background==U;E.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=O?O.src:null);var L=c.value,Q=L!=(null==d.adaptiveColors?"default":d.adaptiveColors);Q&&(E.adaptiveColors=L);d.pageFormat.width==E.previousFormat.width&&d.pageFormat.height==E.previousFormat.height&&E.ignoreColor&&E.ignoreImage&&!Q||d.model.execute(E);k&&null!=b.currentPage&&d.model.execute(new ChangePageView(b,b.currentPage,f))},null,mxResources.get("apply"))).container};-PageSetupDialog.addPageFormatPanel=function(b,d,m,p){d="format-"+d;var v=document.createElement("input");v.setAttribute("name",d);v.setAttribute("type","radio");v.setAttribute("value","portrait");var n=document.createElement("input");n.setAttribute("name",d);n.setAttribute("type","radio");n.setAttribute("value","landscape");var y=document.createElement("select");y.style.position="relative";y.style.marginBottom="4px";y.style.borderRadius="4px";y.style.borderWidth="1px";y.style.borderStyle="solid";-y.style.boxSizing="border-box";y.style.padding="2px";y.style.width="210px";var C=document.createElement("div");C.style.alignItems="center";C.style.whiteSpace="nowrap";C.style.marginLeft="4px";C.style.width="210px";C.style.height="24px";v.style.margin="0 6px 0 0";C.appendChild(v);d=document.createElement("span");d.style.maxWidth="100px";mxUtils.write(d,mxResources.get("portrait"));C.appendChild(d);n.style.margin="0 6px 0 10px";C.appendChild(n);var P=document.createElement("span");P.style.width="100px";-mxUtils.write(P,mxResources.get("landscape"));C.appendChild(P);var G=document.createElement("div");G.style.whiteSpace="nowrap";G.style.fontSize="12px";G.style.width="210px";G.style.height="24px";var O=document.createElement("input");O.setAttribute("size","6");O.setAttribute("title",mxResources.get("width"));O.style.textAlign="right";G.appendChild(O);mxUtils.write(G," x ");var U=document.createElement("input");U.setAttribute("size","6");U.setAttribute("title",mxResources.get("height"));U.style.textAlign=+PageSetupDialog.addPageFormatPanel=function(b,d,m,p){d="format-"+d;var u=document.createElement("input");u.setAttribute("name",d);u.setAttribute("type","radio");u.setAttribute("value","portrait");var n=document.createElement("input");n.setAttribute("name",d);n.setAttribute("type","radio");n.setAttribute("value","landscape");var y=document.createElement("select");y.style.position="relative";y.style.marginBottom="4px";y.style.borderRadius="4px";y.style.borderWidth="1px";y.style.borderStyle="solid";+y.style.boxSizing="border-box";y.style.padding="2px";y.style.width="210px";var B=document.createElement("div");B.style.alignItems="center";B.style.whiteSpace="nowrap";B.style.marginLeft="4px";B.style.width="210px";B.style.height="24px";u.style.margin="0 6px 0 0";B.appendChild(u);d=document.createElement("span");d.style.maxWidth="100px";mxUtils.write(d,mxResources.get("portrait"));B.appendChild(d);n.style.margin="0 6px 0 10px";B.appendChild(n);var P=document.createElement("span");P.style.width="100px";+mxUtils.write(P,mxResources.get("landscape"));B.appendChild(P);var G=document.createElement("div");G.style.whiteSpace="nowrap";G.style.fontSize="12px";G.style.width="210px";G.style.height="24px";var O=document.createElement("input");O.setAttribute("size","6");O.setAttribute("title",mxResources.get("width"));O.style.textAlign="right";G.appendChild(O);mxUtils.write(G," x ");var U=document.createElement("input");U.setAttribute("size","6");U.setAttribute("title",mxResources.get("height"));U.style.textAlign="right";G.appendChild(U);var c=document.createElement("select");c.style.marginLeft="4px";c.style.boxSizing="border-box";for(var f=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS},{label:mxResources.get("meters"),unit:mxConstants.METERS}],k=0;k<f.length;k++){var q=document.createElement("option");q.setAttribute("value",f[k].unit);mxUtils.write(q,f[k].label);c.appendChild(q)}c.value=-Editor.pageSizeUnit;G.appendChild(c);C.style.display="none";G.style.display="none";var x={},B=PageSetupDialog.getFormats();for(k=0;k<B.length;k++)f=B[k],x[f.key]=f,q=document.createElement("option"),q.setAttribute("value",f.key),mxUtils.write(q,f.title),y.appendChild(q);var E=function(){y.value="custom";for(var Q=0;Q<B.length;Q++){var V=B[Q];null!=V.format&&("a4"==V.key?826==m.width?(m=mxRectangle.fromRectangle(m),m.width=827):826==m.height&&(m=mxRectangle.fromRectangle(m),m.height=827):"a5"==V.key&&-(584==m.width?(m=mxRectangle.fromRectangle(m),m.width=583):584==m.height&&(m=mxRectangle.fromRectangle(m),m.height=583)),m.width==V.format.width&&m.height==V.format.height?(y.value=V.key,v.setAttribute("checked","checked"),v.defaultChecked=!0,v.checked=!0,n.removeAttribute("checked"),n.defaultChecked=!1,n.checked=!1,detected=!0):m.width==V.format.height&&m.height==V.format.width&&(y.value=V.key,v.removeAttribute("checked"),v.defaultChecked=!1,v.checked=!1,n.setAttribute("checked","checked"),n.defaultChecked=-!0,detected=n.checked=!0))}"custom"==y.value?(O.value=Editor.toUnit(m.width,c.value),U.value=Editor.toUnit(m.height,c.value),v.setAttribute("checked","checked"),y.value="custom",C.style.display="none",G.style.display=""):(C.style.display="flex",G.style.display="none")};E();b.appendChild(y);mxUtils.br(b);b.appendChild(C);b.appendChild(G);var L=function(Q,V){Q=x[y.value];null!=Q.format?(O.value=Editor.toUnit(n.checked?Q.format.height:Q.format.width,c.value),U.value=Editor.toUnit(n.checked?Q.format.width:-Q.format.height,c.value),G.style.display="none",C.style.display="flex"):(C.style.display="none",G.style.display="");var K=parseFloat(O.value);if(isNaN(K)||0>=K)O.value=Editor.toUnit(m.width,c.value);K=parseFloat(U.value);if(isNaN(K)||0>=K)U.value=Editor.toUnit(m.height,c.value);Q=null!=Q.format?new mxRectangle(0,0,n.checked?Q.format.height:Q.format.width,n.checked?Q.format.width:Q.format.height):new mxRectangle(0,0,Editor.fromUnit(parseFloat(O.value),c.value),Editor.fromUnit(parseFloat(U.value),c.value));-V||Q.width==m.width&&Q.height==m.height||(m=Q,null!=p&&p(m))};mxEvent.addListener(d,"click",function(Q){v.checked=!0;L(Q);mxEvent.consume(Q)});mxEvent.addListener(P,"click",function(Q){n.checked=!0;L(Q);mxEvent.consume(Q)});mxEvent.addListener(O,"blur",L);mxEvent.addListener(O,"click",L);mxEvent.addListener(U,"blur",L);mxEvent.addListener(U,"click",L);mxEvent.addListener(n,"change",L);mxEvent.addListener(v,"change",L);mxEvent.addListener(y,"change",function(Q){L(Q,"custom"==y.value);mxEvent.consume(Q)});+Editor.pageSizeUnit;G.appendChild(c);B.style.display="none";G.style.display="none";var x={},C=PageSetupDialog.getFormats();for(k=0;k<C.length;k++)f=C[k],x[f.key]=f,q=document.createElement("option"),q.setAttribute("value",f.key),mxUtils.write(q,f.title),y.appendChild(q);var E=function(){y.value="custom";for(var Q=0;Q<C.length;Q++){var V=C[Q];null!=V.format&&("a4"==V.key?826==m.width?(m=mxRectangle.fromRectangle(m),m.width=827):826==m.height&&(m=mxRectangle.fromRectangle(m),m.height=827):"a5"==V.key&&+(584==m.width?(m=mxRectangle.fromRectangle(m),m.width=583):584==m.height&&(m=mxRectangle.fromRectangle(m),m.height=583)),m.width==V.format.width&&m.height==V.format.height?(y.value=V.key,u.setAttribute("checked","checked"),u.defaultChecked=!0,u.checked=!0,n.removeAttribute("checked"),n.defaultChecked=!1,n.checked=!1,detected=!0):m.width==V.format.height&&m.height==V.format.width&&(y.value=V.key,u.removeAttribute("checked"),u.defaultChecked=!1,u.checked=!1,n.setAttribute("checked","checked"),n.defaultChecked=+!0,detected=n.checked=!0))}"custom"==y.value?(O.value=Editor.toUnit(m.width,c.value),U.value=Editor.toUnit(m.height,c.value),u.setAttribute("checked","checked"),y.value="custom",B.style.display="none",G.style.display=""):(B.style.display="flex",G.style.display="none")};E();b.appendChild(y);mxUtils.br(b);b.appendChild(B);b.appendChild(G);var L=function(Q,V){Q=x[y.value];null!=Q.format?(O.value=Editor.toUnit(n.checked?Q.format.height:Q.format.width,c.value),U.value=Editor.toUnit(n.checked?Q.format.width:+Q.format.height,c.value),G.style.display="none",B.style.display="flex"):(B.style.display="none",G.style.display="");var K=parseFloat(O.value);if(isNaN(K)||0>=K)O.value=Editor.toUnit(m.width,c.value);K=parseFloat(U.value);if(isNaN(K)||0>=K)U.value=Editor.toUnit(m.height,c.value);Q=null!=Q.format?new mxRectangle(0,0,n.checked?Q.format.height:Q.format.width,n.checked?Q.format.width:Q.format.height):new mxRectangle(0,0,Editor.fromUnit(parseFloat(O.value),c.value),Editor.fromUnit(parseFloat(U.value),c.value));+V||Q.width==m.width&&Q.height==m.height||(m=Q,null!=p&&p(m))};mxEvent.addListener(d,"click",function(Q){u.checked=!0;L(Q);mxEvent.consume(Q)});mxEvent.addListener(P,"click",function(Q){n.checked=!0;L(Q);mxEvent.consume(Q)});mxEvent.addListener(O,"blur",L);mxEvent.addListener(O,"click",L);mxEvent.addListener(U,"blur",L);mxEvent.addListener(U,"click",L);mxEvent.addListener(n,"change",L);mxEvent.addListener(u,"change",L);mxEvent.addListener(y,"change",function(Q){L(Q,"custom"==y.value);mxEvent.consume(Q)});mxEvent.addListener(c,"change",function(Q){O.value=Editor.toUnit(Editor.fromUnit(O.value,Editor.pageSizeUnit),c.value);U.value=Editor.toUnit(Editor.fromUnit(U.value,Editor.pageSizeUnit),c.value);Editor.pageSizeUnit=c.value;L(Q,!0);mxEvent.consume(Q)});L(null,!0);return{set:function(Q){m=Q;E(null,null,!0)},get:function(){return m},widthInput:O,heightInput:U}};PageSetupDialog.getFormats=function(){return[{key:"letter",title:'US-Letter (8,5" x 11")',format:mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},{key:"legal",title:'US-Legal (8,5" x 14")',format:new mxRectangle(0,0,850,1400)},{key:"tabloid",title:'US-Tabloid (11" x 17")',format:new mxRectangle(0,0,1100,1700)},{key:"executive",title:'US-Executive (7" x 10")',format:new mxRectangle(0,0,700,1E3)},{key:"a0",title:"A0 (841 mm x 1189 mm)",format:new mxRectangle(0,0,3300,4681)},{key:"a1",title:"A1 (594 mm x 841 mm)",format:new mxRectangle(0,0,2339,3300)},{key:"a2",title:"A2 (420 mm x 594 mm)",format:new mxRectangle(0,0,1654,2336)},{key:"a3",title:"A3 (297 mm x 420 mm)",format:new mxRectangle(0,0,1169,1654)},{key:"a4",title:"A4 (210 mm x 297 mm)",format:mxConstants.PAGE_FORMAT_A4_PORTRAIT},{key:"a5",title:"A5 (148 mm x 210 mm)",format:new mxRectangle(0,0,583,827)},{key:"a6",title:"A6 (105 mm x 148 mm)",format:new mxRectangle(0,0,413,583)},{key:"a7",title:"A7 (74 mm x 105 mm)",format:new mxRectangle(0,0,291,413)},{key:"b4",title:"B4 (250 mm x 353 mm)",format:new mxRectangle(0,0,980,1390)},{key:"b5",title:"B5 (176 mm x 250 mm)",format:new mxRectangle(0,0,690,980)},{key:"16-9",title:"16:9 (1600 x 900)",format:new mxRectangle(0,0,900,1600)},{key:"16-10",title:"16:10 (1920 x 1200)",format:new mxRectangle(0,0,1200,1920)},{key:"4-3",title:"4:3 (1600 x 1200)",format:new mxRectangle(0,0,1200,1600)},{key:"custom",title:mxResources.get("custom"),format:null}]};-var FilenameDialog=function(b,d,m,p,v,n,y,C,P,G,O){P=null!=P?P:!0;var U=document.createElement("div"),c=document.createElement("div");c.style.width="100%";c.style.display="grid";c.style.gap="5px 8px";c.style.gridAutoColumns="auto 1fr";c.style.boxSizing="border-box";c.style.padding="3px";var f=document.createElement("div");f.style.display="inline-flex";f.style.alignItems="center";f.style.justifyContent="flex-end";f.style.minWidth="0";var k=document.createElement("div");k.style.display="inline-block";-k.style.textOverflow="ellipsis";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.fontSize="10pt";k.style.padding="2px 0";k.setAttribute("title",v||mxResources.get("filename"));mxUtils.write(k,(v||mxResources.get("filename"))+":");f.appendChild(k);c.appendChild(f);var q=document.createElement("input");q.setAttribute("value",d||"");q.style.flexGrow="1";var x=mxUtils.button(m,function(){if(null==n||n(q.value))P&&b.hideDialog(),p(q.value)});x.className="geBtn gePrimaryBtn";this.init=function(){if(null!=-v||null==y)if(null!=O?Editor.selectFilename(q):(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var B=c.parentNode;if(null!=B){var E=null;mxEvent.addListener(B,"dragleave",function(L){null!=E&&(E.style.backgroundColor="",E=null);L.stopPropagation();L.preventDefault()});mxEvent.addListener(B,"dragover",mxUtils.bind(this,function(L){null==E&&(E=q,E.style.backgroundColor="#ebf2f9");L.stopPropagation();L.preventDefault()}));-mxEvent.addListener(B,"drop",mxUtils.bind(this,function(L){null!=E&&(E.style.backgroundColor="",E=null);0<=mxUtils.indexOf(L.dataTransfer.types,"text/uri-list")&&(q.value=decodeURIComponent(L.dataTransfer.getData("text/uri-list")),x.click());L.stopPropagation();L.preventDefault()}))}}};f=document.createElement("div");f.style.display="inline-flex";f.style.alignItems="center";f.style.gap="4px";f.style.whiteSpace="nowrap";f.appendChild(q);c.appendChild(f);null==v&&null!=y||null==O||null==b.editor.diagramFileTypes||+var FilenameDialog=function(b,d,m,p,u,n,y,B,P,G,O){P=null!=P?P:!0;var U=document.createElement("div"),c=document.createElement("div");c.style.width="100%";c.style.display="grid";c.style.gap="5px 8px";c.style.gridAutoColumns="auto 1fr";c.style.boxSizing="border-box";c.style.padding="3px";var f=document.createElement("div");f.style.display="inline-flex";f.style.alignItems="center";f.style.justifyContent="flex-end";f.style.minWidth="0";var k=document.createElement("div");k.style.display="inline-block";+k.style.textOverflow="ellipsis";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.fontSize="10pt";k.style.padding="2px 0";k.setAttribute("title",u||mxResources.get("filename"));mxUtils.write(k,(u||mxResources.get("filename"))+":");f.appendChild(k);c.appendChild(f);var q=document.createElement("input");q.setAttribute("value",d||"");q.style.flexGrow="1";var x=mxUtils.button(m,function(){if(null==n||n(q.value))P&&b.hideDialog(),p(q.value)});x.className="geBtn gePrimaryBtn";this.init=function(){if(null!=+u||null==y)if(null!=O?Editor.selectFilename(q):(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var C=c.parentNode;if(null!=C){var E=null;mxEvent.addListener(C,"dragleave",function(L){null!=E&&(E.style.backgroundColor="",E=null);L.stopPropagation();L.preventDefault()});mxEvent.addListener(C,"dragover",mxUtils.bind(this,function(L){null==E&&(E=q,E.style.backgroundColor="#ebf2f9");L.stopPropagation();L.preventDefault()}));+mxEvent.addListener(C,"drop",mxUtils.bind(this,function(L){null!=E&&(E.style.backgroundColor="",E=null);0<=mxUtils.indexOf(L.dataTransfer.types,"text/uri-list")&&(q.value=decodeURIComponent(L.dataTransfer.getData("text/uri-list")),x.click());L.stopPropagation();L.preventDefault()}))}}};f=document.createElement("div");f.style.display="inline-flex";f.style.alignItems="center";f.style.gap="4px";f.style.whiteSpace="nowrap";f.appendChild(q);c.appendChild(f);null==u&&null!=y||null==O||null==b.editor.diagramFileTypes||(f=document.createElement("div"),f.style.display="inline-flex",f.style.alignItems="center",f.style.textOverflow="ellipsis",f.style.justifyContent="flex-end",f.style.fontSize="10pt",mxUtils.write(f,mxResources.get("type")+":"),c.appendChild(f),f=document.createElement("div"),f.style.display="inline-flex",f.style.alignItems="center",f.style.whiteSpace="nowrap",c.appendChild(f),d=FilenameDialog.createFileTypes(b,q,b.editor.diagramFileTypes),d.style.width="100%",f.appendChild(d));null!=y&&c.appendChild(y);-row=document.createElement("div");row.style.gridColumn="1 / span 2";row.style.paddingTop=null!=O?"6px":"14px";row.style.whiteSpace="nowrap";row.style.display="inline-flex";row.style.alignItems="center";row.style.justifyContent="flex-end";row.setAttribute("align","right");f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=G&&G()});f.className="geBtn";null==C||b.isOffline()||row.appendChild(b.createHelpIcon(C));b.editor.cancelFirst&&row.appendChild(f);mxEvent.addListener(q,"keypress",-function(B){13==B.keyCode&&x.click()});row.appendChild(x);b.editor.cancelFirst||row.appendChild(f);c.appendChild(row);U.appendChild(c);this.container=U};FilenameDialog.filenameHelpLink=null;-FilenameDialog.createFileTypes=function(b,d,m){var p=document.createElement("select");for(b=0;b<m.length;b++){var v=document.createElement("option");v.setAttribute("value",b);mxUtils.write(v,mxResources.get(m[b].description)+" (."+m[b].extension+")");p.appendChild(v)}mxEvent.addListener(p,"change",function(n){n=m[p.value].extension;var y=d.value.lastIndexOf(".drawio.");y=0<y?y:d.value.lastIndexOf(".");"drawio"!=n&&(n="drawio."+n);d.value=0<y?d.value.substring(0,y+1)+n:d.value+"."+n;"createEvent"in-document?(n=document.createEvent("HTMLEvents"),n.initEvent("change",!1,!0),d.dispatchEvent(n)):d.fireEvent("onchange")});b=function(n){n=d.value.toLowerCase();for(var y=0,C=0;C<m.length;C++){var P=m[C].extension,G=null;"drawio"!=P&&(G=P,P=".drawio."+P);if(n.substring(n.length-P.length-1)=="."+P||null!=G&&n.substring(n.length-G.length-1)=="."+G){y=C;break}}p.value=y};mxEvent.addListener(d,"change",b);mxEvent.addListener(d,"keyup",b);b();if(null!=Editor.defaultFileType&&"0"==p.value)for(b=0;b<m.length;b++)if(m[b].extension==-Editor.defaultFileType){p.value=b;b=m[b].extension;v=d.value.lastIndexOf(".drawio.");v=0<v?v:d.value.lastIndexOf(".");"drawio"!=b&&(b="drawio."+b);d.value=0<v?d.value.substring(0,v+1)+b:d.value+"."+b;break}return p};-var WrapperWindow=function(b,d,m,p,v,n,y,C){C=null!=C?C:document.createElement("div");this.window=new mxWindow(d,C,m,p,v,n,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);b.installResizeHandler(this,!0);y(C)};-(function(){mxGraphView.prototype.validateBackgroundPage=function(){var y=this.graph;if(null!=y.container&&!y.transparentBackground){if(y.pageVisible){var C=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var P=y.container.firstChild;null!=P&&P.nodeType!=mxConstants.NODETYPE_ELEMENT;)P=P.nextSibling;null!=P&&(this.backgroundPageShape=this.createBackgroundPageShape(C),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,+row=document.createElement("div");row.style.gridColumn="1 / span 2";row.style.paddingTop=null!=O?"6px":"14px";row.style.whiteSpace="nowrap";row.style.display="inline-flex";row.style.alignItems="center";row.style.justifyContent="flex-end";row.setAttribute("align","right");f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=G&&G()});f.className="geBtn";null==B||b.isOffline()||row.appendChild(b.createHelpIcon(B));b.editor.cancelFirst&&row.appendChild(f);mxEvent.addListener(q,"keypress",+function(C){13==C.keyCode&&x.click()});row.appendChild(x);b.editor.cancelFirst||row.appendChild(f);c.appendChild(row);U.appendChild(c);this.container=U};FilenameDialog.filenameHelpLink=null;+FilenameDialog.createFileTypes=function(b,d,m){var p=document.createElement("select");for(b=0;b<m.length;b++){var u=document.createElement("option");u.setAttribute("value",b);mxUtils.write(u,mxResources.get(m[b].description)+" (."+m[b].extension+")");p.appendChild(u)}mxEvent.addListener(p,"change",function(n){n=m[p.value].extension;var y=d.value.lastIndexOf(".drawio.");y=0<y?y:d.value.lastIndexOf(".");"drawio"!=n&&(n="drawio."+n);d.value=0<y?d.value.substring(0,y+1)+n:d.value+"."+n;"createEvent"in+document?(n=document.createEvent("HTMLEvents"),n.initEvent("change",!1,!0),d.dispatchEvent(n)):d.fireEvent("onchange")});b=function(n){n=d.value.toLowerCase();for(var y=0,B=0;B<m.length;B++){var P=m[B].extension,G=null;"drawio"!=P&&(G=P,P=".drawio."+P);if(n.substring(n.length-P.length-1)=="."+P||null!=G&&n.substring(n.length-G.length-1)=="."+G){y=B;break}}p.value=y};mxEvent.addListener(d,"change",b);mxEvent.addListener(d,"keyup",b);b();if(null!=Editor.defaultFileType&&"0"==p.value)for(b=0;b<m.length;b++)if(m[b].extension==+Editor.defaultFileType){p.value=b;b=m[b].extension;u=d.value.lastIndexOf(".drawio.");u=0<u?u:d.value.lastIndexOf(".");"drawio"!=b&&(b="drawio."+b);d.value=0<u?d.value.substring(0,u+1)+b:d.value+"."+b;break}return p};+var WrapperWindow=function(b,d,m,p,u,n,y,B){B=null!=B?B:document.createElement("div");this.window=new mxWindow(d,B,m,p,u,n,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);b.installResizeHandler(this,!0);y(B)};+(function(){mxGraphView.prototype.validateBackgroundPage=function(){var y=this.graph;if(null!=y.container&&!y.transparentBackground){if(y.pageVisible){var B=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var P=y.container.firstChild;null!=P&&P.nodeType!=mxConstants.NODETYPE_ELEMENT;)P=P.nextSibling;null!=P&&(this.backgroundPageShape=this.createBackgroundPageShape(B),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(y.container),P.style.position="absolute",y.container.insertBefore(this.backgroundPageShape.node,P),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(G){y.dblClick(G)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(G){y.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(G))}),mxUtils.bind(this,function(G){null!=-y.tooltipHandler&&y.tooltipHandler.isHideOnHover()&&y.tooltipHandler.hide();y.isMouseDown&&!mxEvent.isConsumed(G)&&y.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(G))}),mxUtils.bind(this,function(G){y.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(G))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=C,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}};-mxGraphView.prototype.validateBackgroundStyles=function(y,C,P){var G=this.graph;y=null!=y?y:1;var O=mxUtils.getLightDarkColor(null==G.background||G.background==mxConstants.NONE?G.defaultPageBackgroundColor:G.background).cssText,U=mxUtils.getLightDarkColor(G.defaultPageBorderColor).cssText,c=null!=O&&this.gridColor!=O.toLowerCase()?this.gridColor:"#ffffff",f="none",k="";"simple"==G.getAdaptiveColors()&&G.background!=mxConstants.NONE&&null!=G.background&&(O=G.background);if(G.isGridEnabled()||G.gridVisible){k=-10;mxClient.IS_SVG?(f=unescape(encodeURIComponent(this.createSvgGrid(c,y))),f=window.btoa?btoa(f):Base64.encode(f,!0),f="url(data:image/svg+xml;base64,"+f+")",k=G.gridSize*this.scale*this.gridSteps*y):f="url("+this.gridImage+")";var q=c=0;C=null!=C?C-this.translate.x*this.scale:0;P=null!=P?P-this.translate.y*this.scale:0;var x=G.gridSize*this.scale*this.gridSteps,B=C%x;x=P%x;null!=G.view.backgroundPageShape&&(q=this.getBackgroundPageBounds(),c=1+q.x,q=1+q.y);k=-Math.round(k-mxUtils.mod(this.translate.x*-this.scale-c+C,k)+B*y)+"px "+-Math.round(k-mxUtils.mod(this.translate.y*this.scale-q+P,k)+x*y)+"px"}y=G.view.canvas;null!=y.ownerSVGElement&&(y=y.ownerSVGElement);c=!Editor.isDarkMode()&&G.enableDiagramBackground;null!=G.view.backgroundPageShape?(G.view.backgroundPageShape.node.style.backgroundPosition=k,G.view.backgroundPageShape.node.style.backgroundImage=f,G.view.backgroundPageShape.node.style.backgroundColor=O,G.view.backgroundPageShape.node.style.borderColor=U,G.view.backgroundPageShape.node.style.colorScheme=+y.tooltipHandler&&y.tooltipHandler.isHideOnHover()&&y.tooltipHandler.hide();y.isMouseDown&&!mxEvent.isConsumed(G)&&y.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(G))}),mxUtils.bind(this,function(G){y.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(G))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=B,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}};+mxGraphView.prototype.validateBackgroundStyles=function(y,B,P){var G=this.graph;y=null!=y?y:1;var O=mxUtils.getLightDarkColor(null==G.background||G.background==mxConstants.NONE?G.defaultPageBackgroundColor:G.background).cssText,U=mxUtils.getLightDarkColor(G.defaultPageBorderColor).cssText,c=null!=O&&this.gridColor!=O.toLowerCase()?this.gridColor:"#ffffff",f="none",k="";"simple"==G.getAdaptiveColors()&&G.background!=mxConstants.NONE&&null!=G.background&&(O=G.background);if(G.isGridEnabled()||G.gridVisible){k=+10;mxClient.IS_SVG?(f=unescape(encodeURIComponent(this.createSvgGrid(c,y))),f=window.btoa?btoa(f):Base64.encode(f,!0),f="url(data:image/svg+xml;base64,"+f+")",k=G.gridSize*this.scale*this.gridSteps*y):f="url("+this.gridImage+")";var q=c=0;B=null!=B?B-this.translate.x*this.scale:0;P=null!=P?P-this.translate.y*this.scale:0;var x=G.gridSize*this.scale*this.gridSteps,C=B%x;x=P%x;null!=G.view.backgroundPageShape&&(q=this.getBackgroundPageBounds(),c=1+q.x,q=1+q.y);k=-Math.round(k-mxUtils.mod(this.translate.x*+this.scale-c+B,k)+C*y)+"px "+-Math.round(k-mxUtils.mod(this.translate.y*this.scale-q+P,k)+x*y)+"px"}y=G.view.canvas;null!=y.ownerSVGElement&&(y=y.ownerSVGElement);c=!Editor.isDarkMode()&&G.enableDiagramBackground;null!=G.view.backgroundPageShape?(G.view.backgroundPageShape.node.style.backgroundPosition=k,G.view.backgroundPageShape.node.style.backgroundImage=f,G.view.backgroundPageShape.node.style.backgroundColor=O,G.view.backgroundPageShape.node.style.borderColor=U,G.view.backgroundPageShape.node.style.colorScheme="none"==G.getAdaptiveColors()?"light":"",y.style.backgroundImage="none",y.style.backgroundColor="",G.container.style.backgroundColor=c?G.diagramBackgroundColor:""):(y.style.backgroundPosition=k,y.style.backgroundImage=f,"1"==urlParams.transparent?G.container.style.background="transparent":!c||null!=G.background&&G.background!=mxConstants.NONE?y.style.backgroundColor=O:(y.style.backgroundColor=G.diagramBackgroundColor,G.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(y,-C){for(var P=this.graph.gridSize*this.scale*(null!=C?C:1);P<this.minGridSize;)P*=2;C=this.gridSteps*P;for(var G=[],O=1;O<this.gridSteps;O++){var U=O*P;G.push("M 0 "+U+" L "+C+" "+U+" M "+U+" 0 L "+U+" "+C)}P="M "+C+" 0 L 0 0 0 "+C+" M "+C+" 0 L "+C+" "+C+" L 0 "+C;y=mxUtils.getLightDarkColor(y);O="color-scheme: light dark;";mxClient.IS_SF&&(O="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+O+'" width="'+C+'" height="'+C+'" xmlns="'+-mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+C+'" height="'+C+'" patternUnits="userSpaceOnUse"><path d="'+G.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(y.cssText)+';" stroke="'+y.light+'" opacity="0.2" stroke-width="1"/><path d="'+P+'" fill="none" style="stroke:'+mxUtils.htmlEntities(y.cssText)+';" stroke="'+y.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=-function(y,C){b.apply(this,arguments);if(null!=this.shiftPreview1){var P=this.view.canvas;null!=P.ownerSVGElement&&(P=P.ownerSVGElement);var G=this.gridSize*this.view.scale*this.view.gridSteps;G=-Math.round(G-mxUtils.mod(this.view.translate.x*this.view.scale+y,G))+"px "+-Math.round(G-mxUtils.mod(this.view.translate.y*this.view.scale+C,G))+"px";P.style.backgroundPosition=G}};mxGraph.prototype.updatePageBreaks=function(y,C,P){var G=this.view.scale,O=this.view.translate,U=this.pageFormat,c=G*this.pageScale,-f=this.view.getBackgroundPageBounds();C=f.width;P=f.height;var k=new mxRectangle(G*O.x,G*O.y,U.width*c,U.height*c),q=(y=y&&Math.min(k.width,k.height)>this.minPageBreakDist)?Math.min(this.maxPageBreaks,Math.ceil(P/k.height)-1):0,x=y?Math.min(this.maxPageBreaks,Math.ceil(C/k.width)-1):0,B=f.x+C,E=f.y+P;null==this.horizontalPageBreaks&&0<q&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<x&&(this.verticalPageBreaks=[]);y=mxUtils.bind(this,function(L){if(null!=L){for(var Q=L==this.horizontalPageBreaks?-q:x,V=0;V<=Q;V++){var K=L==this.horizontalPageBreaks?[new mxPoint(Math.round(f.x),Math.round(f.y+(V+1)*k.height)),new mxPoint(Math.round(B),Math.round(f.y+(V+1)*k.height))]:[new mxPoint(Math.round(f.x+(V+1)*k.width),Math.round(f.y)),new mxPoint(Math.round(f.x+(V+1)*k.width),Math.round(E))];null!=L[V]&&null!=L[V].node?(L[V].points=K,L[V].redraw()):(null!=L[V]&&L[V].destroy(),K=new mxPolyline(K,this.pageBreakColor),K.dialect=this.dialect,K.isDashed=this.pageBreakDashed,K.pointerEvents=!1,K.init(this.view.backgroundPane),-K.redraw(),L[V]=K)}for(V=Q;V<L.length;V++)null!=L[V]&&L[V].destroy();L.splice(Q,L.length-Q)}});y(this.horizontalPageBreaks);y(this.verticalPageBreaks)};var d=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(y,C,P){for(var G=0;G<C.length;G++){if(this.graph.isTableCell(C[G])||this.graph.isTableRow(C[G]))return!1;if(this.graph.getModel().isVertex(C[G])){var O=this.graph.getCellGeometry(C[G]);if(null!=O&&O.relative)return!1}}return d.apply(this,-arguments)};var m=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var y=m.apply(this,arguments);y.intersects=mxUtils.bind(this,function(C,P){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(y,arguments)});return y};mxGraphView.prototype.createBackgroundPageShape=function(y){return new mxRectangleShape(y,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var y=this.getGraphBounds(),-C=0<y.width?y.x/this.scale-this.translate.x:0,P=0<y.height?y.y/this.scale-this.translate.y:0,G=this.graph.pageFormat,O=this.graph.pageScale,U=G.width*O;G=G.height*O;O=Math.floor(Math.min(0,C)/U);var c=Math.floor(Math.min(0,P)/G);return new mxRectangle(this.scale*(this.translate.x+O*U),this.scale*(this.translate.y+c*G),this.scale*(Math.ceil(Math.max(1,C+y.width/this.scale)/U)-O)*U,this.scale*(Math.ceil(Math.max(1,P+y.height/this.scale)/G)-c)*G)};var p=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=-function(y,C){p.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=y+"px",this.view.backgroundPageShape.node.style.marginTop=C+"px")};var v=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(y,C,P,G,O,U){var c=v.apply(this,arguments);null==U||U||mxEvent.addListener(c,"mousedown",function(f){mxEvent.consume(f)});return c};-var n=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(y,C,P){var G=this.graph.model.getParent(y);if(C){var O=this.graph.model.isEdge(y)?null:this.graph.getCellGeometry(y);O=!this.graph.model.isEdge(G)&&!this.graph.isSiblingSelected(y)&&(null!=O&&O.relative||!this.graph.isContainer(G)||this.graph.isPart(y))}else if(O=n.apply(this,arguments),this.graph.isTableCell(y)||this.graph.isTableRow(y))O=G,this.graph.isTable(O)||(O=this.graph.model.getParent(O)),-O=!this.graph.selectionCellsHandler.isHandled(O)||this.graph.isCellSelected(O)&&this.graph.isToggleEvent(P.getEvent())||this.graph.isCellSelected(y)&&!this.graph.isToggleEvent(P.getEvent())||this.graph.isTableCell(y)&&this.graph.isCellSelected(G);return O};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(y){y=y.getCell();for(var C=this.graph.getModel(),P=C.getParent(y),G=this.graph.view.getState(P),O=this.graph.isCellSelected(y);null!=G&&(C.isVertex(P)||C.isEdge(P));){var U=this.graph.isCellSelected(P);-O=O||U;if(U||!O&&(this.graph.isTableCell(y)||this.graph.isTableRow(y)))y=P;P=C.getParent(P)}return y}})();EditorUi=function(b,d,m){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=d||document.body;var p=this,v=this.editor.graph;v.lightbox=m;var n=v.getGraphBounds;v.getGraphBounds=function(){var J=n.apply(this,arguments),R=this.backgroundImage;if(null!=R&&null!=R.width&&null!=R.height){var T=this.view.translate,Y=this.view.scale;J=mxRectangle.fromRectangle(J);J.add(new mxRectangle((T.x+R.x)*Y,(T.y+R.y)*Y,R.width*Y,R.height*Y))}return J};v.useCssTransforms&&(this.lazyZoomDelay=-0);this.selectionStateListener=mxUtils.bind(this,function(J,R){this.clearSelectionState()});v.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionStateListener);v.getModel().addListener(mxEvent.CHANGE,this.selectionStateListener);v.addListener(mxEvent.EDITING_STARTED,this.selectionStateListener);v.addListener(mxEvent.EDITING_STOPPED,this.selectionStateListener);v.getView().addListener("unitChanged",this.selectionStateListener);if(this.editor.chromeless&&!this.editor.editable){v.isEnabled=-function(){return!1};v.panningHandler.isForcePanningEvent=function(J){for(var R=J.getSource();null!=R&&R!=v.container;){if("foreignObject"===R.nodeName||"text"===R.nodeName)return!1;R=R.parentNode}return!mxEvent.isPopupTrigger(J.getEvent())};var y=v.panningHandler.start;v.panningHandler.start=function(){y.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!v.standalone){var C=!1,P=!1;this.setDefaultStyle=function(J){try{var R=v.getModel(),-T=R.isVertex(J)&&R.isEdge(R.getParent(J));R.isEdge(J)||T?(P=!1,R.isEdge(J)&&(v.pasteEdgeStyle=!1)):(C=!1,v.pasteStylesToText=!1);var Y=v.getCellStyle(J,!1),Z=[],ia=[],ka;for(ka in Y)Z.push(Y[ka]),ia.push(ka);R.isEdge(J)?v.currentEdgeStyle={}:T||(v.currentVertexStyle={});this.fireEvent(new mxEventObject("styleChanged","keys",ia,"values",Z,"cells",[J],"force",!0,"edgeLabel",T));if(R.isEdge(J)||T)P=!0,R.isEdge(J)&&(v.pasteEdgeStyle=!0);else{C=!0;var X=R.getStyle(J);v.pasteStylesToText="string"===typeof X&&-0<=mxUtils.indexOf(X.split(";"),"text")}}catch(ja){this.handleError(ja)}};this.clearDefaultStyle=function(){v.currentEdgeStyle=mxUtils.clone(v.defaultEdgeStyle);v.currentVertexStyle=mxUtils.clone(v.defaultVertexStyle);v.pasteEdgeStyle=!1;C=P=v.pasteStylesToText=!1;this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};v.addListener("cellsInserted",function(J,R){v.pasteCellStyles(v.includeDescendants(R.getProperty("cells")))});v.addListener("textInserted",function(J,R){v.pasteCellStyles(R.getProperty("cells"))});-this.createDivs();this.createUi();this.refresh();var G=mxUtils.bind(this,function(J){null==J&&(J=window.event);return v.isEditing()||null!=J&&this.isSelectionAllowed(J)});document.addEventListener("selectstart",function(J){var R=mxEvent.getSource(J);R!=document.body&&R!=document.documentElement||J.preventDefault()},!0);this.container!=document.body||this.editor.chromeless&&!this.editor.editable||(this.menubarContainer.onselectstart=G,this.menubarContainer.onmousedown=G,this.toolbarContainer.onselectstart=+B){for(var P=this.graph.gridSize*this.scale*(null!=B?B:1);P<this.minGridSize;)P*=2;B=this.gridSteps*P;for(var G=[],O=1;O<this.gridSteps;O++){var U=O*P;G.push("M 0 "+U+" L "+B+" "+U+" M "+U+" 0 L "+U+" "+B)}P="M "+B+" 0 L 0 0 0 "+B+" M "+B+" 0 L "+B+" "+B+" L 0 "+B;y=mxUtils.getLightDarkColor(y);O="color-scheme: light dark;";mxClient.IS_SF&&(O="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+O+'" width="'+B+'" height="'+B+'" xmlns="'++mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+B+'" height="'+B+'" patternUnits="userSpaceOnUse"><path d="'+G.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(y.cssText)+';" stroke="'+y.light+'" opacity="0.2" stroke-width="1"/><path d="'+P+'" fill="none" style="stroke:'+mxUtils.htmlEntities(y.cssText)+';" stroke="'+y.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=+function(y,B){b.apply(this,arguments);if(null!=this.shiftPreview1){var P=this.view.canvas;null!=P.ownerSVGElement&&(P=P.ownerSVGElement);var G=this.gridSize*this.view.scale*this.view.gridSteps;G=-Math.round(G-mxUtils.mod(this.view.translate.x*this.view.scale+y,G))+"px "+-Math.round(G-mxUtils.mod(this.view.translate.y*this.view.scale+B,G))+"px";P.style.backgroundPosition=G}};mxGraph.prototype.updatePageBreaks=function(y,B,P){var G=this.view.scale,O=this.view.translate,U=this.pageFormat,c=G*this.pageScale,+f=this.view.getBackgroundPageBounds();B=f.width;P=f.height;var k=new mxRectangle(G*O.x,G*O.y,U.width*c,U.height*c),q=(y=y&&Math.min(k.width,k.height)>this.minPageBreakDist)?Math.min(this.maxPageBreaks,Math.ceil(P/k.height)-1):0,x=y?Math.min(this.maxPageBreaks,Math.ceil(B/k.width)-1):0,C=f.x+B,E=f.y+P;null==this.horizontalPageBreaks&&0<q&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<x&&(this.verticalPageBreaks=[]);y=mxUtils.bind(this,function(L){if(null!=L){for(var Q=L==this.horizontalPageBreaks?+q:x,V=0;V<=Q;V++){var K=L==this.horizontalPageBreaks?[new mxPoint(Math.round(f.x),Math.round(f.y+(V+1)*k.height)),new mxPoint(Math.round(C),Math.round(f.y+(V+1)*k.height))]:[new mxPoint(Math.round(f.x+(V+1)*k.width),Math.round(f.y)),new mxPoint(Math.round(f.x+(V+1)*k.width),Math.round(E))];null!=L[V]&&null!=L[V].node?(L[V].points=K,L[V].redraw()):(null!=L[V]&&L[V].destroy(),K=new mxPolyline(K,this.pageBreakColor),K.dialect=this.dialect,K.isDashed=this.pageBreakDashed,K.pointerEvents=!1,K.init(this.view.backgroundPane),+K.redraw(),L[V]=K)}for(V=Q;V<L.length;V++)null!=L[V]&&L[V].destroy();L.splice(Q,L.length-Q)}});y(this.horizontalPageBreaks);y(this.verticalPageBreaks)};var d=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(y,B,P){for(var G=0;G<B.length;G++){if(this.graph.isTableCell(B[G])||this.graph.isTableRow(B[G]))return!1;if(this.graph.getModel().isVertex(B[G])){var O=this.graph.getCellGeometry(B[G]);if(null!=O&&O.relative)return!1}}return d.apply(this,+arguments)};var m=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var y=m.apply(this,arguments);y.intersects=mxUtils.bind(this,function(B,P){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(y,arguments)});return y};mxGraphView.prototype.createBackgroundPageShape=function(y){return new mxRectangleShape(y,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var y=this.getGraphBounds(),+B=0<y.width?y.x/this.scale-this.translate.x:0,P=0<y.height?y.y/this.scale-this.translate.y:0,G=this.graph.pageFormat,O=this.graph.pageScale,U=G.width*O;G=G.height*O;O=Math.floor(Math.min(0,B)/U);var c=Math.floor(Math.min(0,P)/G);return new mxRectangle(this.scale*(this.translate.x+O*U),this.scale*(this.translate.y+c*G),this.scale*(Math.ceil(Math.max(1,B+y.width/this.scale)/U)-O)*U,this.scale*(Math.ceil(Math.max(1,P+y.height/this.scale)/G)-c)*G)};var p=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=+function(y,B){p.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=y+"px",this.view.backgroundPageShape.node.style.marginTop=B+"px")};var u=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(y,B,P,G,O,U){var c=u.apply(this,arguments);null==U||U||mxEvent.addListener(c,"mousedown",function(f){mxEvent.consume(f)});return c};+var n=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(y,B,P){var G=this.graph.model.getParent(y);if(B){var O=this.graph.model.isEdge(y)?null:this.graph.getCellGeometry(y);O=!this.graph.model.isEdge(G)&&!this.graph.isSiblingSelected(y)&&(null!=O&&O.relative||!this.graph.isContainer(G)||this.graph.isPart(y))}else if(O=n.apply(this,arguments),this.graph.isTableCell(y)||this.graph.isTableRow(y))O=G,this.graph.isTable(O)||(O=this.graph.model.getParent(O)),+O=!this.graph.selectionCellsHandler.isHandled(O)||this.graph.isCellSelected(O)&&this.graph.isToggleEvent(P.getEvent())||this.graph.isCellSelected(y)&&!this.graph.isToggleEvent(P.getEvent())||this.graph.isTableCell(y)&&this.graph.isCellSelected(G);return O};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(y){y=y.getCell();for(var B=this.graph.getModel(),P=B.getParent(y),G=this.graph.view.getState(P),O=this.graph.isCellSelected(y);null!=G&&(B.isVertex(P)||B.isEdge(P));){var U=this.graph.isCellSelected(P);+O=O||U;if(U||!O&&(this.graph.isTableCell(y)||this.graph.isTableRow(y)))y=P;P=B.getParent(P)}return y}})();EditorUi=function(b,d,m){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=d||document.body;var p=this,u=this.editor.graph;u.lightbox=m;var n=u.getGraphBounds;u.getGraphBounds=function(){var J=n.apply(this,arguments),R=this.backgroundImage;if(null!=R&&null!=R.width&&null!=R.height){var T=this.view.translate,Y=this.view.scale;J=mxRectangle.fromRectangle(J);J.add(new mxRectangle((T.x+R.x)*Y,(T.y+R.y)*Y,R.width*Y,R.height*Y))}return J};u.useCssTransforms&&(this.lazyZoomDelay=+0);this.selectionStateListener=mxUtils.bind(this,function(J,R){this.clearSelectionState()});u.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionStateListener);u.getModel().addListener(mxEvent.CHANGE,this.selectionStateListener);u.addListener(mxEvent.EDITING_STARTED,this.selectionStateListener);u.addListener(mxEvent.EDITING_STOPPED,this.selectionStateListener);u.getView().addListener("unitChanged",this.selectionStateListener);if(this.editor.chromeless&&!this.editor.editable){u.isEnabled=+function(){return!1};u.panningHandler.isForcePanningEvent=function(J){for(var R=J.getSource();null!=R&&R!=u.container;){if("foreignObject"===R.nodeName||"text"===R.nodeName)return!1;R=R.parentNode}return!mxEvent.isPopupTrigger(J.getEvent())};var y=u.panningHandler.start;u.panningHandler.start=function(){y.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!u.standalone){var B=!1,P=!1;this.setDefaultStyle=function(J){try{var R=u.getModel(),+T=R.isVertex(J)&&R.isEdge(R.getParent(J));R.isEdge(J)||T?(P=!1,R.isEdge(J)&&(u.pasteEdgeStyle=!1)):(B=!1,u.pasteStylesToText=!1);var Y=u.getCellStyle(J,!1),Z=[],ia=[],ja;for(ja in Y)Z.push(Y[ja]),ia.push(ja);R.isEdge(J)?u.currentEdgeStyle={}:T||(u.currentVertexStyle={});this.fireEvent(new mxEventObject("styleChanged","keys",ia,"values",Z,"cells",[J],"force",!0,"edgeLabel",T));if(R.isEdge(J)||T)P=!0,R.isEdge(J)&&(u.pasteEdgeStyle=!0);else{B=!0;var X=R.getStyle(J);u.pasteStylesToText="string"===typeof X&&+0<=mxUtils.indexOf(X.split(";"),"text")}}catch(ka){this.handleError(ka)}};this.clearDefaultStyle=function(){u.currentEdgeStyle=mxUtils.clone(u.defaultEdgeStyle);u.currentVertexStyle=mxUtils.clone(u.defaultVertexStyle);u.pasteEdgeStyle=!1;B=P=u.pasteStylesToText=!1;this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};u.addListener("cellsInserted",function(J,R){u.pasteCellStyles(u.includeDescendants(R.getProperty("cells")))});u.addListener("textInserted",function(J,R){u.pasteCellStyles(R.getProperty("cells"))});+this.createDivs();this.createUi();this.refresh();var G=mxUtils.bind(this,function(J){null==J&&(J=window.event);return u.isEditing()||null!=J&&this.isSelectionAllowed(J)});document.addEventListener("selectstart",function(J){var R=mxEvent.getSource(J);R!=document.body&&R!=document.documentElement||J.preventDefault()},!0);this.container!=document.body||this.editor.chromeless&&!this.editor.editable||(this.menubarContainer.onselectstart=G,this.menubarContainer.onmousedown=G,this.toolbarContainer.onselectstart=G,this.toolbarContainer.onmousedown=G,this.diagramContainer.onselectstart=G,this.diagramContainer.onmousedown=G,this.sidebarContainer.onselectstart=G,this.sidebarContainer.onmousedown=G,this.formatContainer.onselectstart=G,this.formatContainer.onmousedown=G,null!=this.tabContainer&&(this.tabContainer.onselectstart=G),mxClient.IS_IOS&&(d=function(){var J=null;if(/iP(hone|od|ad)/.test(navigator.platform)){var R=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);try{J=[parseInt(R[1],10),parseInt(R[2],10),parseInt(R[3]||0,10)]}catch(T){}}return J}(),null!=d&&16<=d[0]&&(mxUtils.setPrefixedStyle(this.menubarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.diagramContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.sidebarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.formatContainer.style,"userSelect","none"),null!=this.tabContainer&&mxUtils.setPrefixedStyle(this.tabContainer.style,"userSelect","none"))));!this.editor.chromeless||this.editor.editable?-this.diagramContainer.oncontextmenu=function(J){if(null!=J){var R=mxEvent.getSource(J);if("A"==R.nodeName)for(;null!=R;){if("geHint"==R.className)return!0;R=R.parentNode}}return G(J)}:v.panningHandler.usePopupTrigger=!1;v.init(this.diagramContainer);mxClient.IS_SVG&&null!=v.view.getDrawPane()&&(d=v.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.position="absolute"));this.hoverIcons=this.createHoverIcons();this.inlineToolbar=Editor.enableInlineToolbar?this.createInlineToolbar():null;this.editor.graph.addListener("zoomPreview",-mxUtils.bind(this,function(J,R){null!=this.hoverIcons&&this.hoverIcons.reset();null!=this.inlineToolbar&&this.inlineToolbar.hide()}));this.editor.graph.addListener("zoomPreviewComplete",mxUtils.bind(this,function(J,R){null!=this.inlineToolbar&&this.inlineToolbar.updateSelection()}));if(null!=v.graphHandler){var O=v.graphHandler.start;v.graphHandler.start=function(J){null!=p.hoverIcons&&p.hoverIcons.reset();null!=p.inlineToolbar&&null!=J&&p.inlineToolbar.hide();O.apply(this,arguments)};var U=v.graphHandler.mouseUp;-v.graphHandler.mouseUp=function(){U.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()}}var c=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(){null!=p.inlineToolbar&&p.inlineToolbar.hide();c.apply(this,arguments)};var f=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(){f.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()};var k=mxEdgeHandler.prototype.start;mxEdgeHandler.prototype.start=+this.diagramContainer.oncontextmenu=function(J){if(null!=J){var R=mxEvent.getSource(J);if("A"==R.nodeName)for(;null!=R;){if("geHint"==R.className)return!0;R=R.parentNode}}return G(J)}:u.panningHandler.usePopupTrigger=!1;u.init(this.diagramContainer);mxClient.IS_SVG&&null!=u.view.getDrawPane()&&(d=u.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.position="absolute"));this.hoverIcons=this.createHoverIcons();this.inlineToolbar=Editor.enableInlineToolbar?this.createInlineToolbar():null;this.editor.graph.addListener("zoomPreview",+mxUtils.bind(this,function(J,R){null!=this.hoverIcons&&this.hoverIcons.reset();null!=this.inlineToolbar&&this.inlineToolbar.hide()}));this.editor.graph.addListener("zoomPreviewComplete",mxUtils.bind(this,function(J,R){null!=this.inlineToolbar&&this.inlineToolbar.updateSelection()}));if(null!=u.graphHandler){var O=u.graphHandler.start;u.graphHandler.start=function(J){null!=p.hoverIcons&&p.hoverIcons.reset();null!=p.inlineToolbar&&null!=J&&p.inlineToolbar.hide();O.apply(this,arguments)};var U=u.graphHandler.mouseUp;+u.graphHandler.mouseUp=function(){U.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()}}var c=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(){null!=p.inlineToolbar&&p.inlineToolbar.hide();c.apply(this,arguments)};var f=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(){f.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()};var k=mxEdgeHandler.prototype.start;mxEdgeHandler.prototype.start=function(){null!=p.inlineToolbar&&p.inlineToolbar.hide();k.apply(this,arguments)};var q=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(){q.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()};mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(J){var R=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(J)-R.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(J)-R.y-this.diagramContainer.clientHeight?-this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var x=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(J,R){return p.isSpaceDown()||x.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(J){if(Editor.passiveScroll){var R=mxEvent.getSource(J);if(null==v.container||R!=v.container&&!v.container.contains(R)&&!v.isEditing())return}16==J.which?this.shiftDown=!0:32!=J.which||v.isEditing()?mxEvent.isConsumed(J)||-27!=J.keyCode||this.hideDialog(null,!0):(R=mxEvent.getSource(J),"INPUT"==R.nodeName||"TEXTAREA"==R.nodeName||"SELECT"==R.nodeName||R.isContentEditable||(this.spaceDown=!0,this.hoverIcons.reset(),null!=v.container&&(v.container.style.cursor="move"),mxEvent.consume(J)))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(J){null!=v.container&&(v.container.style.cursor="");this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);-var B=v.panningHandler.isForcePanningEvent;v.panningHandler.isForcePanningEvent=function(J){return null!=v.freehand&&v.freehand.isActive()?!1:B.apply(this,arguments)||p.isSpaceDown()||mxEvent.isMouseEvent(J.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(J.getEvent()))&&(!mxEvent.isControlDown(J.getEvent())&&mxEvent.isRightMouseButton(J.getEvent())||mxEvent.isMiddleMouseButton(J.getEvent()))};var E=v.cellEditor.isStopEditingEvent;v.cellEditor.isStopEditingEvent=function(J){return E.apply(this,-arguments)||13==J.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(J)||mxClient.IS_MAC&&mxEvent.isMetaDown(J)||mxClient.IS_SF&&mxEvent.isShiftDown(J))};var L=v.isZoomWheelEvent;v.isZoomWheelEvent=function(){return p.isSpaceDown()||L.apply(this,arguments)};var Q=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,R=this.toolbar.container.firstChild;null!=R;){var T=R.getAttribute("data-min-width");null!=T&&parseInt(T)>-J?R.style.display="none":R.style.display="";R=R.nextSibling}}),V=!1,K=null,fa=null,aa=null,da=mxUtils.bind(this,function(){if(null!=this.toolbar&&V!=v.cellEditor.isContentEditing()){for(var J=this.toolbar.container.firstChild,R=[];null!=J;){var T=J.nextSibling;J.parentNode.removeChild(J);R.push(J);J=T}J=this.toolbar.fontMenu;T=this.toolbar.sizeMenu;if(null==aa)this.toolbar.createTextToolbar();else{for(var Y=0;Y<aa.length;Y++)this.toolbar.container.appendChild(aa[Y]);this.toolbar.fontMenu=K;this.toolbar.sizeMenu=-fa}V=v.cellEditor.isContentEditing();K=J;fa=T;aa=R;Q()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);this.descriptorChanged();this.updateStatusAgain();da()}));this.addListener("currentThemeChanged",Q);mxEvent.addListener(window,"resize",Q);Q();v.isTouchPopupMenuEnabled=function(){return null==p.dialog};var ba=v.cellEditor.startEditing;v.cellEditor.startEditing=function(){ba.apply(this,arguments);da();if(v.cellEditor.isContentEditing()){var J=!1,R=function(){J||-(J=!0,window.setTimeout(function(){var T=v.getSelectedEditingElement();null!=T&&(T=mxUtils.getCurrentStyle(T),null!=T&&null!=p.toolbar&&(p.toolbar.setFontName(mxUtils.getCssFontFamily(T.fontFamily)),p.toolbar.setFontSize(parseInt(T.fontSize))));J=!1},0))};mxEvent.addListener(v.cellEditor.textarea,"input",R);mxEvent.addListener(v.cellEditor.textarea,"touchend",R);mxEvent.addListener(v.cellEditor.textarea,"mouseup",R);mxEvent.addListener(v.cellEditor.textarea,"keyup",R);R()}};var ha=v.cellEditor.stopEditing;-v.cellEditor.stopEditing=function(J,R){try{ha.apply(this,arguments),da()}catch(T){p.handleError(T)}};v.container.setAttribute("tabindex","0");v.container.style.cursor="default";if(window.self===window.top&&null!=v.container.parentNode)try{v.container.focus()}catch(J){}var qa=v.fireMouseEvent;v.fireMouseEvent=function(J,R,T){try{J==mxEvent.MOUSE_DOWN&&this.container.focus(),qa.apply(this,arguments)}catch(Y){p.handleError(Y)}};var ra=v.foldCells;v.foldCells=function(J,R,T,Y,Z){try{ra.apply(this,arguments)}catch(ia){p.handleError(ia)}};-v.popupMenuHandler.autoExpand=!0;null!=this.menus&&(v.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(J,R,T){this.menus.createPopupMenu(J,R,T)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(J){v.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};v.connectionHandler.addListener(mxEvent.CONNECT,function(J,R){var T=[R.getProperty("cell")];R.getProperty("terminalInserted")&&(T.push(R.getProperty("terminal")),-window.setTimeout(function(){null!=p.hoverIcons&&p.hoverIcons.update(v.view.getState(T[T.length-1]))},0));v.pasteCellStyles(T)});var l=null,t=null;b=mxUtils.bind(this,function(){if(null!=this.toolbar){var J=this.getSelectionState();if(v.isEnabled()&&0<J.edges.length){if(null!=this.toolbar.edgeStyleMenu){var R=this.getImageForEdgeStyle(J.style);1==J.edges.length&&"arrow"==J.style[mxConstants.STYLE_SHAPE]&&(R=Format.straightImage.src);this.toolbar.edgeStyleMenu.style.backgroundImage="url("+R+")"}null!=-this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+this.getImageForEdgeShape(J.style)+")")}else null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+l+")"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+t+")")}});v.selectionModel.addListener(mxEvent.CHANGE,b);v.getModel().addListener(mxEvent.CHANGE,b);this.addListener("styleChanged",mxUtils.bind(this,function(J,R){J=R.getProperty("force");-(this.updateDefaultStyle||J)&&v.copyCellStyles(R.getProperty("cells"),R.getProperty("keys"),R.getProperty("values"),v.currentVertexStyle,v.currentEdgeStyle,C,P,R.getProperty("edgeLabel"));null!=this.toolbar&&(this.toolbar.setFontName(v.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(v.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),R=this.getSelectionState(),null!=this.toolbar.edgeStyleMenu&&(l=this.getImageForEdgeStyle(v.currentEdgeStyle),0==R.edges.length&&-(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+l+")")),null!=this.toolbar.edgeShapeMenu&&(t=this.getImageForEdgeShape(v.currentEdgeStyle),0==R.edges.length&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+t+")")))}));null!=this.toolbar&&(b=mxUtils.bind(this,function(){var J=v.currentVertexStyle.fontFamily||"Helvetica",R=String(v.currentVertexStyle.fontSize||"12"),T=v.getView().getState(v.getSelectionCell());null!=T&&(J=T.style[mxConstants.STYLE_FONTFAMILY]||J,R=T.style[mxConstants.STYLE_FONTSIZE]||-R,10<J.length&&(J=J.substring(0,8)+"..."));this.toolbar.setFontName(J);this.toolbar.setFontSize(R)}),v.getSelectionModel().addListener(mxEvent.CHANGE,b),v.getModel().addListener(mxEvent.CHANGE,b));v.addListener(mxEvent.CELLS_ADDED,function(J,R){J=R.getProperty("cells");R=R.getProperty("parent");null!=R&&v.getModel().isLayer(R)&&!v.isCellVisible(R)&&null!=J&&0<J.length&&v.getModel().setVisible(R,!0)});Graph.selectParentLayer&&v.selectionModel.addListener(mxEvent.CHANGE,function(){if(v.isEnabled()&&-!v.isSelectionEmpty()){var J=v.getLayerForCells(v.getSelectionCells());null!=J&&v.setDefaultParent(J)}});this.gestureHandler=mxUtils.bind(this,function(J){this.isHideCurrentMenuEvent(J)&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document,this.gestureHandler);var H=null;this.resizeHandler=mxUtils.bind(this,function(){null!=H&&window.clearTimeout(H);H=window.setTimeout(mxUtils.bind(this,function(){H=null;this.windowResized()}),100)});mxEvent.addListener(window,"resize",this.resizeHandler);+this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var x=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(J,R){return p.isSpaceDown()||x.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(J){if(Editor.passiveScroll){var R=mxEvent.getSource(J);if(null==u.container||R!=u.container&&!u.container.contains(R)&&!u.isEditing())return}16==J.which?this.shiftDown=!0:32!=J.which||u.isEditing()?mxEvent.isConsumed(J)||+27!=J.keyCode||this.hideDialog(null,!0):(R=mxEvent.getSource(J),"INPUT"==R.nodeName||"TEXTAREA"==R.nodeName||"SELECT"==R.nodeName||R.isContentEditable||(this.spaceDown=!0,this.hoverIcons.reset(),null!=u.container&&(u.container.style.cursor="move"),mxEvent.consume(J)))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(J){null!=u.container&&(u.container.style.cursor="");this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);+var C=u.panningHandler.isForcePanningEvent;u.panningHandler.isForcePanningEvent=function(J){return null!=u.freehand&&u.freehand.isActive()?!1:C.apply(this,arguments)||p.isSpaceDown()||mxEvent.isMouseEvent(J.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(J.getEvent()))&&(!mxEvent.isControlDown(J.getEvent())&&mxEvent.isRightMouseButton(J.getEvent())||mxEvent.isMiddleMouseButton(J.getEvent()))};var E=u.cellEditor.isStopEditingEvent;u.cellEditor.isStopEditingEvent=function(J){return E.apply(this,+arguments)||13==J.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(J)||mxClient.IS_MAC&&mxEvent.isMetaDown(J)||mxClient.IS_SF&&mxEvent.isShiftDown(J))};var L=u.isZoomWheelEvent;u.isZoomWheelEvent=function(){return p.isSpaceDown()||L.apply(this,arguments)};var Q=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,R=this.toolbar.container.firstChild;null!=R;){var T=R.getAttribute("data-min-width");null!=T&&parseInt(T)>+J?R.style.display="none":R.style.display="";R=R.nextSibling}}),V=!1,K=null,fa=null,aa=null,da=mxUtils.bind(this,function(){if(null!=this.toolbar&&V!=u.cellEditor.isContentEditing()){for(var J=this.toolbar.container.firstChild,R=[];null!=J;){var T=J.nextSibling;J.parentNode.removeChild(J);R.push(J);J=T}J=this.toolbar.fontMenu;T=this.toolbar.sizeMenu;if(null==aa)this.toolbar.createTextToolbar();else{for(var Y=0;Y<aa.length;Y++)this.toolbar.container.appendChild(aa[Y]);this.toolbar.fontMenu=K;this.toolbar.sizeMenu=+fa}V=u.cellEditor.isContentEditing();K=J;fa=T;aa=R;Q()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);this.descriptorChanged();this.updateStatusAgain();da()}));this.addListener("currentThemeChanged",Q);mxEvent.addListener(window,"resize",Q);Q();u.isTouchPopupMenuEnabled=function(){return null==p.dialog};var ba=u.cellEditor.startEditing;u.cellEditor.startEditing=function(){ba.apply(this,arguments);da();if(u.cellEditor.isContentEditing()){var J=!1,R=function(){J||+(J=!0,window.setTimeout(function(){var T=u.getSelectedEditingElement();null!=T&&(T=mxUtils.getCurrentStyle(T),null!=T&&null!=p.toolbar&&(p.toolbar.setFontName(mxUtils.getCssFontFamily(T.fontFamily)),p.toolbar.setFontSize(parseInt(T.fontSize))));J=!1},0))};mxEvent.addListener(u.cellEditor.textarea,"input",R);mxEvent.addListener(u.cellEditor.textarea,"touchend",R);mxEvent.addListener(u.cellEditor.textarea,"mouseup",R);mxEvent.addListener(u.cellEditor.textarea,"keyup",R);R()}};var ha=u.cellEditor.stopEditing;+u.cellEditor.stopEditing=function(J,R){try{ha.apply(this,arguments),da()}catch(T){p.handleError(T)}};u.container.setAttribute("tabindex","0");u.container.style.cursor="default";if(window.self===window.top&&null!=u.container.parentNode)try{u.container.focus()}catch(J){}var qa=u.fireMouseEvent;u.fireMouseEvent=function(J,R,T){try{J==mxEvent.MOUSE_DOWN&&this.container.focus(),qa.apply(this,arguments)}catch(Y){p.handleError(Y)}};var ra=u.foldCells;u.foldCells=function(J,R,T,Y,Z){try{ra.apply(this,arguments)}catch(ia){p.handleError(ia)}};+u.popupMenuHandler.autoExpand=!0;null!=this.menus&&(u.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(J,R,T){this.menus.createPopupMenu(J,R,T)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(J){u.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};u.connectionHandler.addListener(mxEvent.CONNECT,function(J,R){var T=[R.getProperty("cell")];R.getProperty("terminalInserted")&&(T.push(R.getProperty("terminal")),+window.setTimeout(function(){null!=p.hoverIcons&&p.hoverIcons.update(u.view.getState(T[T.length-1]))},0));u.pasteCellStyles(T)});var l=null,t=null;b=mxUtils.bind(this,function(){if(null!=this.toolbar){var J=this.getSelectionState();if(u.isEnabled()&&0<J.edges.length){if(null!=this.toolbar.edgeStyleMenu){var R=this.getImageForEdgeStyle(J.style);1==J.edges.length&&"arrow"==J.style[mxConstants.STYLE_SHAPE]&&(R=Format.straightImage.src);this.toolbar.edgeStyleMenu.style.backgroundImage="url("+R+")"}null!=+this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+this.getImageForEdgeShape(J.style)+")")}else null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+l+")"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+t+")")}});u.selectionModel.addListener(mxEvent.CHANGE,b);u.getModel().addListener(mxEvent.CHANGE,b);this.addListener("styleChanged",mxUtils.bind(this,function(J,R){J=R.getProperty("force");+(this.updateDefaultStyle||J)&&u.copyCellStyles(R.getProperty("cells"),R.getProperty("keys"),R.getProperty("values"),u.currentVertexStyle,u.currentEdgeStyle,B,P,R.getProperty("edgeLabel"));null!=this.toolbar&&(this.toolbar.setFontName(u.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(u.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),R=this.getSelectionState(),null!=this.toolbar.edgeStyleMenu&&(l=this.getImageForEdgeStyle(u.currentEdgeStyle),0==R.edges.length&&+(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+l+")")),null!=this.toolbar.edgeShapeMenu&&(t=this.getImageForEdgeShape(u.currentEdgeStyle),0==R.edges.length&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+t+")")))}));null!=this.toolbar&&(b=mxUtils.bind(this,function(){var J=u.currentVertexStyle.fontFamily||"Helvetica",R=String(u.currentVertexStyle.fontSize||"12"),T=u.getView().getState(u.getSelectionCell());null!=T&&(J=T.style[mxConstants.STYLE_FONTFAMILY]||J,R=T.style[mxConstants.STYLE_FONTSIZE]||+R,10<J.length&&(J=J.substring(0,8)+"..."));this.toolbar.setFontName(J);this.toolbar.setFontSize(R)}),u.getSelectionModel().addListener(mxEvent.CHANGE,b),u.getModel().addListener(mxEvent.CHANGE,b));u.addListener(mxEvent.CELLS_ADDED,function(J,R){J=R.getProperty("cells");R=R.getProperty("parent");null!=R&&u.getModel().isLayer(R)&&!u.isCellVisible(R)&&null!=J&&0<J.length&&u.getModel().setVisible(R,!0)});Graph.selectParentLayer&&u.selectionModel.addListener(mxEvent.CHANGE,function(){if(u.isEnabled()&&+!u.isSelectionEmpty()){var J=u.getLayerForCells(u.getSelectionCells());null!=J&&u.setDefaultParent(J)}});this.gestureHandler=mxUtils.bind(this,function(J){this.isHideCurrentMenuEvent(J)&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document,this.gestureHandler);var H=null;this.resizeHandler=mxUtils.bind(this,function(){null!=H&&window.clearTimeout(H);H=window.setTimeout(mxUtils.bind(this,function(){H=null;this.windowResized()}),100)});mxEvent.addListener(window,"resize",this.resizeHandler);this.orientationChangeHandler=mxUtils.bind(this,function(){this.refresh()});mxEvent.addListener(window,"orientationchange",this.orientationChangeHandler);mxClient.IS_IOS&&!window.navigator.standalone&&"undefined"!==typeof Menus&&(this.scrollHandler=mxUtils.bind(this,function(){window.scrollTo(0,0)}),mxEvent.addListener(window,"scroll",this.scrollHandler));this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()}));this.addListener("gridEnabledChanged",mxUtils.bind(this,-function(){v.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){v.view.validateBackground()}));v.addListener("gridSizeChanged",mxUtils.bind(this,function(){v.isGridEnabled()&&v.view.validateBackground()}));this.editor.resetGraph()}this.init();v.standalone||this.open()};EditorUi.compactUi=!0;-EditorUi.parsePng=function(b,d,m){function p(C,P){var G=n;n+=P;return C.substring(G,n)}function v(C){C=p(C,4);return C.charCodeAt(3)+(C.charCodeAt(2)<<8)+(C.charCodeAt(1)<<16)+(C.charCodeAt(0)<<24)}var n=0;if(p(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=m&&m();else if(p(b,4),"IHDR"!=p(b,4))null!=m&&m();else{p(b,17);do{m=v(b);var y=p(b,4);if(null!=d&&d(n-8,y,m))break;value=p(b,m);p(b,4);if("IEND"==y)break}while(m)}};mxUtils.extend(EditorUi,mxEventSource);+function(){u.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){u.view.validateBackground()}));u.addListener("gridSizeChanged",mxUtils.bind(this,function(){u.isGridEnabled()&&u.view.validateBackground()}));this.editor.resetGraph()}this.init();u.standalone||this.open()};EditorUi.compactUi=!0;+EditorUi.parsePng=function(b,d,m){function p(B,P){var G=n;n+=P;return B.substring(G,n)}function u(B){B=p(B,4);return B.charCodeAt(3)+(B.charCodeAt(2)<<8)+(B.charCodeAt(1)<<16)+(B.charCodeAt(0)<<24)}var n=0;if(p(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=m&&m();else if(p(b,4),"IHDR"!=p(b,4))null!=m&&m();else{p(b,17);do{m=u(b);var y=p(b,4);if(null!=d&&d(n-8,y,m))break;value=p(b,m);p(b,4);if("IEND"==y)break}while(m)}};mxUtils.extend(EditorUi,mxEventSource);EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.defaultSidebarWidth=Math.min(screen.width/2,"large"!=urlParams["sidebar-entries"]?232:242);EditorUi.prototype.hsplitPosition=screen.width<=Editor.smallScreenWidth?0:EditorUi.prototype.defaultSidebarWidth;EditorUi.prototype.allowAnimation=!0;EditorUi.prototype.lightboxMaxFitScale=2;EditorUi.prototype.lightboxVerticalDivider=4;EditorUi.prototype.hsplitClickEnabled=!1;EditorUi.prototype.updateDefaultStyle=!1;EditorUi.prototype.spaceDown=!1;EditorUi.prototype.shiftDown=!1;EditorUi.prototype.init=function(){var b=this.editor.graph;if(!b.standalone){"0"!=urlParams["shape-picker"]&&this.installShapePicker();mxEvent.addListener(b.container,"scroll",mxUtils.bind(this,function(){b.tooltipHandler.hide();null!=b.connectionHandler&&null!=b.connectionHandler.constraintHandler&&b.connectionHandler.constraintHandler.reset()}));b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){b.tooltipHandler.hide();var p=b.getRubberband();null!=p&&p.cancel()}));mxEvent.addListener(b.container,"keydown",mxUtils.bind(this,function(p){this.onKeyDown(p);this.onKeyPress(p)}));this.installTypingShim();this.addUndoListener();this.addBeforeUnloadListener();b.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));b.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));var d=b.setDefaultParent,m=this;this.editor.graph.setDefaultParent=function(){d.apply(this,arguments);m.updateActionStates()};b.showLinkDialog=mxUtils.bind(m,m.showLinkDialog);b.editLink=m.actions.get("editLink").funct;this.updateActionStates();this.editor.chromeless&&!this.editor.editable||this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()}};EditorUi.prototype.clearSelectionState=function(){this.selectionState=null};EditorUi.prototype.getSelectionState=function(){null==this.selectionState&&(this.selectionState=this.createSelectionState());return this.selectionState};-EditorUi.prototype.createSelectionState=function(){for(var b=this.editor.graph,d=b.getSelectionCells(),m=this.initSelectionState(),p=!0,v=0;v<d.length;v++){var n=b.getCurrentCellStyle(d[v]);"0"!=mxUtils.getValue(n,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(m,d[v],d,p),p=!1)}this.updateSelectionStateForTableCells(m);if(Editor.enableCustomProperties){m.customProperties={};b=m.vertices;d=m.edges;for(v=0;v<b.length;v++)this.findCommonProperties(b[v],m.customProperties,0==v,m);-for(v=0;v<d.length;v++)this.findCommonProperties(d[v],m.customProperties,0==b.length&&0==v,m)}return m};-EditorUi.prototype.findCommonProperties=function(b,d,m,p){p=mxUtils.bind(this,function(U){if(null!=U)if(m)for(var c=0;c<U.length;c++)d[U[c].name]=U[c];else for(var f in d)if(null!=f){var k=!1;for(c=0;c<U.length;c++)if(U[c].name==f&&U[c].type==d[f].type){k=!0;break}k||delete d[f]}});var v=this.editor.graph,n=v.view.getState(b);if(null!=n&&null!=n.shape){if(!n.shape.commonCustomPropAdded){n.shape.commonCustomPropAdded=!0;n.shape.customProperties=n.shape.customProperties||[];if(null!=n.shape&&null!=-n.shape.stencil&&null!=n.shape.stencil.desc){var y=n.shape.stencil,C=[],P=mxUtils.bind(this,function(U){U=y.desc.getElementsByTagName(U);for(var c=[],f=0;f<U.length;f++){var k=U[f].getAttribute("color");if(!mxUtils.isValidColor(k)&&!C[k]&&"fill"!=k&&"stroke"!=k&&"font"!=k){C[k]=!0;var q=U[f].getAttribute("name");q=null!=q?q:Editor.getLabelForStylename(k);var x=U[f].getAttribute("default"),B=y.getDefaultColorValue(U[f],v),E=x;x==mxConstants.NONE&&(x="default");c.push({name:k,type:"color",primary:"false"!=-U[f].getAttribute("primary"),defVal:x,defaultColor:B,undefinedColor:E,dispName:q})}}return c});Array.prototype.push.apply(n.shape.customProperties,P("fillcolor"));Array.prototype.push.apply(n.shape.customProperties,P("strokecolor"));Array.prototype.push.apply(n.shape.customProperties,P("fontcolor"));P=y.desc.getElementsByTagName("labelBounds");for(var G=0;G<P.length;G++){var O=P[G].getAttribute("if");null==O||C[O]||(C[O]=!0,n.shape.customProperties.push({name:O,dispName:"boundedLbl"==O?"Bounded Label":+EditorUi.prototype.createSelectionState=function(){for(var b=this.editor.graph,d=b.getSelectionCells(),m=this.initSelectionState(),p=!0,u=0;u<d.length;u++){var n=b.getCurrentCellStyle(d[u]);"0"!=mxUtils.getValue(n,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(m,d[u],d,p),p=!1)}this.updateSelectionStateForTableCells(m);if(Editor.enableCustomProperties){m.customProperties={};b=m.vertices;d=m.edges;for(u=0;u<b.length;u++)this.findCommonProperties(b[u],m.customProperties,0==u,m);+for(u=0;u<d.length;u++)this.findCommonProperties(d[u],m.customProperties,0==b.length&&0==u,m)}return m};+EditorUi.prototype.findCommonProperties=function(b,d,m,p){p=mxUtils.bind(this,function(U){if(null!=U)if(m)for(var c=0;c<U.length;c++)d[U[c].name]=U[c];else for(var f in d)if(null!=f){var k=!1;for(c=0;c<U.length;c++)if(U[c].name==f&&U[c].type==d[f].type){k=!0;break}k||delete d[f]}});var u=this.editor.graph,n=u.view.getState(b);if(null!=n&&null!=n.shape){if(!n.shape.commonCustomPropAdded){n.shape.commonCustomPropAdded=!0;n.shape.customProperties=n.shape.customProperties||[];if(null!=n.shape&&null!=+n.shape.stencil&&null!=n.shape.stencil.desc){var y=n.shape.stencil,B=[],P=mxUtils.bind(this,function(U){U=y.desc.getElementsByTagName(U);for(var c=[],f=0;f<U.length;f++){var k=U[f].getAttribute("color");if(!mxUtils.isValidColor(k)&&!B[k]&&"fill"!=k&&"stroke"!=k&&"font"!=k){B[k]=!0;var q=U[f].getAttribute("name");q=null!=q?q:Editor.getLabelForStylename(k);var x=U[f].getAttribute("default"),C=y.getDefaultColorValue(U[f],u),E=x;x==mxConstants.NONE&&(x="default");c.push({name:k,type:"color",primary:"false"!=+U[f].getAttribute("primary"),defVal:x,defaultColor:C,undefinedColor:E,dispName:q})}}return c});Array.prototype.push.apply(n.shape.customProperties,P("fillcolor"));Array.prototype.push.apply(n.shape.customProperties,P("strokecolor"));Array.prototype.push.apply(n.shape.customProperties,P("fontcolor"));P=y.desc.getElementsByTagName("labelBounds");for(var G=0;G<P.length;G++){var O=P[G].getAttribute("if");null==O||B[O]||(B[O]=!0,n.shape.customProperties.push({name:O,dispName:"boundedLbl"==O?"Bounded Label":Editor.getLabelForStylename(O),type:"bool",defVal:!1}))}}n.cell.vertex?Array.prototype.push.apply(n.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(n.shape.customProperties,Editor.commonEdgeProperties)}p(n.shape.customProperties)}b=b.getAttribute("customProperties");if(null!=b)try{p(JSON.parse(b))}catch(U){}};EditorUi.prototype.initSelectionState=function(){return{vertices:[],edges:[],cells:[],x:null,y:null,width:null,height:null,style:{},containsImage:!1,containsLabel:!1,fill:!0,glass:!0,html:!0,rounded:!0,autoSize:!1,image:!1,shadow:!0,lineJumps:!0,resizable:!0,table:!1,cell:!1,row:!1,movable:!0,rotatable:!0,stroke:!0,swimlane:!1,transparentBounds:!1,unlocked:this.editor.graph.isEnabled(),connections:!1,connectedEdges:!1}};-EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){var d=mxUtils.sortCells(b.cells),m=this.editor.graph.model,p=m.getParent(d[0]),v=m.getParent(p);if(null!=p&&null!=v){for(var n=p.getIndex(d[0]),y=v.getIndex(p),C=null,P=1,G=1,O=0,U=y<v.getChildCount()-1?m.getChildAt(m.getChildAt(v,y+1),n):null;O<d.length-1;){var c=d[++O];null==U||U!=c||null!=C&&P!=C||(C=P,P=0,G++,p=m.getParent(U),U=y+G<v.getChildCount()?m.getChildAt(m.getChildAt(v,y+G),n):null);var f=this.editor.graph.view.getState(c);+EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){var d=mxUtils.sortCells(b.cells),m=this.editor.graph.model,p=m.getParent(d[0]),u=m.getParent(p);if(null!=p&&null!=u){for(var n=p.getIndex(d[0]),y=u.getIndex(p),B=null,P=1,G=1,O=0,U=y<u.getChildCount()-1?m.getChildAt(m.getChildAt(u,y+1),n):null;O<d.length-1;){var c=d[++O];null==U||U!=c||null!=B&&P!=B||(B=P,P=0,G++,p=m.getParent(U),U=y+G<u.getChildCount()?m.getChildAt(m.getChildAt(u,y+G),n):null);var f=this.editor.graph.view.getState(c);if(c==m.getChildAt(p,n+P)&&null!=f&&1==mxUtils.getValue(f.style,"colspan",1)&&1==mxUtils.getValue(f.style,"rowspan",1))P++;else break}O==G*P-1&&(b.mergeCell=d[0],b.colspan=P,b.rowspan=G)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor&&null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)};-EditorUi.prototype.createTimeout=function(b,d,m){var p=!0,v=null,n=mxUtils.bind(this,function(C){v.clear()&&(p=!1,C=null!=C?C:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(b,d,m)})},null!=m?m(C):this.handleError(C))}),y=window.setTimeout(n,null!=b?b:this.timeout);v={clear:function(){window.clearTimeout(y);return p},isAlive:function(){return p}};null!=d&&this.tryAndHandle(mxUtils.bind(this,function(){d(v)}),n);return v};+EditorUi.prototype.createTimeout=function(b,d,m){var p=!0,u=null,n=mxUtils.bind(this,function(B){u.clear()&&(p=!1,B=null!=B?B:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(b,d,m)})},null!=m?m(B):this.handleError(B))}),y=window.setTimeout(n,null!=b?b:this.timeout);u={clear:function(){window.clearTimeout(y);return p},isAlive:function(){return p}};null!=d&&this.tryAndHandle(mxUtils.bind(this,function(){d(u)}),n);return u};EditorUi.prototype.tryAndHandle=function(b,d){try{b()}catch(m){null!=d?d(m):this.handleError(m)}};-EditorUi.prototype.removeUserDefinedDarkColors=function(b,d,m){var p=this.editor.graph;b=null!=b?b:p.getSelectionCells();var v=Graph.colorStyles,n=document.createElement("div");p.model.beginUpdate();try{for(var y=0;y<b.length;y++)if(p.model.isEdge(b[y])||p.model.isVertex(b[y])){var C=p.getCellStyle(b[y],!1);if(null!=C)for(var P=0;P<v.length;P++)try{var G=C[v[P]];if(mxUtils.isLightDarkColor(G)){var O=mxUtils.getLightDarkColor(G);p.setCellStyles(v[P],O.light,[b[y]])}}catch(c){}d&&p.isHtmlLabel(b[y])&&-"0"!=mxUtils.getValue(C,"html","0")&&(n.innerHTML=Graph.sanitizeHtml(p.getLabel(b[y])),Graph.addLightDarkColors(n,null,null,function(c,f,k){return mxUtils.isLightDarkColor(k)?(k=mxUtils.getLightDarkColor(k),c.style.setProperty(f,k.light),!0):!1})&&p.cellLabelChanged(b[y],n.innerHTML))}if(m&&mxUtils.isLightDarkColor(p.background)){O=mxUtils.getLightDarkColor(p.background);var U=new ChangePageSetup(this,O.light);U.ignoreImage=!0;p.model.execute(U)}}finally{p.model.endUpdate()}return b};+EditorUi.prototype.removeUserDefinedDarkColors=function(b,d,m){var p=this.editor.graph;b=null!=b?b:p.getSelectionCells();var u=Graph.colorStyles,n=document.createElement("div");p.model.beginUpdate();try{for(var y=0;y<b.length;y++)if(p.model.isEdge(b[y])||p.model.isVertex(b[y])){var B=p.getCellStyle(b[y],!1);if(null!=B)for(var P=0;P<u.length;P++)try{var G=B[u[P]];if(mxUtils.isLightDarkColor(G)){var O=mxUtils.getLightDarkColor(G);p.setCellStyles(u[P],O.light,[b[y]])}}catch(c){}d&&p.isHtmlLabel(b[y])&&+"0"!=mxUtils.getValue(B,"html","0")&&(n.innerHTML=Graph.sanitizeHtml(p.getLabel(b[y])),Graph.addLightDarkColors(n,null,null,function(c,f,k){return mxUtils.isLightDarkColor(k)?(k=mxUtils.getLightDarkColor(k),c.style.setProperty(f,k.light),!0):!1})&&p.cellLabelChanged(b[y],n.innerHTML))}if(m&&mxUtils.isLightDarkColor(p.background)){O=mxUtils.getLightDarkColor(p.background);var U=new ChangePageSetup(this,O.light);U.ignoreImage=!0;p.model.execute(U)}}finally{p.model.endUpdate()}return b};EditorUi.prototype.updateSelectionStateForCell=function(b,d,m,p){m=this.editor.graph;b.cells.push(d);if(m.getModel().isVertex(d)){b.connections=0<m.model.getEdgeCount(d);b.unlocked=b.unlocked&&!m.isCellLocked(d);b.resizable=b.resizable&&m.isCellResizable(d);b.rotatable=b.rotatable&&m.isCellRotatable(d);b.movable=b.movable&&m.isCellMovable(d)&&!m.isTableRow(d)&&!m.isTableCell(d);b.swimlane=b.swimlane||m.isSwimlane(d);b.transparentBounds=b.transparentBounds||m.isTransparentBounds(d);b.table=b.table||-m.isTable(d);b.cell=b.cell||m.isTableCell(d);b.row=b.row||m.isTableRow(d);b.vertices.push(d);var v=m.getCellGeometry(d);if(null!=v&&(0<v.width?null==b.width?b.width=v.width:b.width!=v.width&&(b.width=""):b.containsLabel=!0,0<v.height?null==b.height?b.height=v.height:b.height!=v.height&&(b.height=""):b.containsLabel=!0,!v.relative||null!=v.offset)){var n=v.relative?v.offset.x:v.x;v=v.relative?v.offset.y:v.y;null==b.x?b.x=n:b.x!=n&&(b.x="");null==b.y?b.y=v:b.y!=v&&(b.y="")}}else m.getModel().isEdge(d)&&+m.isTable(d);b.cell=b.cell||m.isTableCell(d);b.row=b.row||m.isTableRow(d);b.vertices.push(d);var u=m.getCellGeometry(d);if(null!=u&&(0<u.width?null==b.width?b.width=u.width:b.width!=u.width&&(b.width=""):b.containsLabel=!0,0<u.height?null==b.height?b.height=u.height:b.height!=u.height&&(b.height=""):b.containsLabel=!0,!u.relative||null!=u.offset)){var n=u.relative?u.offset.x:u.x;u=u.relative?u.offset.y:u.y;null==b.x?b.x=n:b.x!=n&&(b.x="");null==b.y?b.y=u:b.y!=u&&(b.y="")}}else m.getModel().isEdge(d)&&(b.edges.push(d),b.connections=!0,b.resizable=!1,b.rotatable=!1,b.movable=!1,b.connectedEdges=b.connectedEdges||null!=m.model.getTerminal(d,!0)||null!=m.model.getTerminal(d,!1));n=m.view.getState(d);null!=n&&(b.html=b.html&&m.isHtmlLabel(d),b.autoSize=b.autoSize||m.isAutoSizeState(n),b.glass=b.glass&&m.isGlassState(n),b.rounded=b.rounded&&m.isRoundedState(n),b.lineJumps=b.lineJumps&&m.isLineJumpState(n),b.image=b.image||m.isImageState(n),b.shadow=b.shadow&&m.isShadowState(n),b.fill=b.fill&&m.isFillState(n),b.gradient=b.fill&&m.isGradientState(n),b.stroke=b.stroke&&m.isStrokeState(n),d=mxUtils.getValue(n.style,mxConstants.STYLE_SHAPE,null),b.containsImage=b.containsImage||"image"==d,m.mergeStyle(n.style,b.style,p))};EditorUi.prototype.installShapePicker=function(){var b=this.editor.graph,d=this;b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(G,O){"mouseDown"==O.getProperty("eventName")&&d.hideShapePicker()}));var m=mxUtils.bind(this,function(){d.hideShapePicker(!0)});b.addListener("wheel",m);b.addListener(mxEvent.ESCAPE,m);b.view.addListener(mxEvent.SCALE,m);b.view.addListener(mxEvent.SCALE_AND_TRANSLATE,m);b.getSelectionModel().addListener(mxEvent.CHANGE,m);var p=b.popupMenuHandler.isMenuShowing;-b.popupMenuHandler.isMenuShowing=function(){return p.apply(this,arguments)||null!=d.shapePicker||null!=d.currentMenu};var v=b.dblClick;b.dblClick=function(G,O){if(this.isEnabled()){var U=null==O||null==d.sidebar||mxEvent.isShiftDown(G)||b.isCellLocked(O)||null!=b.getLockedGroupAncestor(b.model.getParent(O))?null:d.getDoubleClickTerminalForEvent(G,O);if(null!=O||null==d.sidebar||mxEvent.isShiftDown(G)||b.isCellLocked(b.getDefaultParent()))null!=U?(mxEvent.consume(G),window.setTimeout(mxUtils.bind(this,-function(){d.showShapePickerForEdgeTerminal(O,U.source,U.point)}),30)):v.apply(this,arguments);else{var c=mxUtils.convertPoint(this.container,mxEvent.getClientX(G),mxEvent.getClientY(G));mxEvent.consume(G);window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(c.x,c.y)}),30)}}};b.addListener("doubleClickEdgeTerminal",mxUtils.bind(this,function(G,O){var U=O.getProperty("cell"),c=O.getProperty("point");if(null!=U&&null!=c&&!b.isCellLocked(U)&&null==b.getLockedGroupAncestor(b.model.getParent(U))){var f=+b.popupMenuHandler.isMenuShowing=function(){return p.apply(this,arguments)||null!=d.shapePicker||null!=d.currentMenu};var u=b.dblClick;b.dblClick=function(G,O){if(this.isEnabled()){var U=null==O||null==d.sidebar||mxEvent.isShiftDown(G)||b.isCellLocked(O)||null!=b.getLockedGroupAncestor(b.model.getParent(O))?null:d.getDoubleClickTerminalForEvent(G,O);if(null!=O||null==d.sidebar||mxEvent.isShiftDown(G)||b.isCellLocked(b.getDefaultParent()))null!=U?(mxEvent.consume(G),window.setTimeout(mxUtils.bind(this,+function(){d.showShapePickerForEdgeTerminal(O,U.source,U.point)}),30)):u.apply(this,arguments);else{var c=mxUtils.convertPoint(this.container,mxEvent.getClientX(G),mxEvent.getClientY(G));mxEvent.consume(G);window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(c.x,c.y)}),30)}}};b.addListener("doubleClickEdgeTerminal",mxUtils.bind(this,function(G,O){var U=O.getProperty("cell"),c=O.getProperty("point");if(null!=U&&null!=c&&!b.isCellLocked(U)&&null==b.getLockedGroupAncestor(b.model.getParent(U))){var f=O.getProperty("source");window.setTimeout(mxUtils.bind(this,function(){d.showShapePickerForEdgeTerminal(U,f,c)}),30)}}));if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",mxUtils.bind(this,function(){null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null,d.hideShapePicker(!0))}));var n=this.hoverIcons.drag;this.hoverIcons.drag=function(){d.hideShapePicker();n.apply(this,arguments)};var y=this.hoverIcons.execute;this.hoverIcons.execute=function(G,O,U){var c=U.getEvent();this.graph.isCloneEvent(c)||mxEvent.isShiftDown(c)?y.apply(this,arguments):this.graph.connectVertex(G.cell,O,this.graph.defaultEdgeLength,c,null,null,mxUtils.bind(this,function(f,k,q){var x=b.getCompositeParent(G.cell);f=b.getCellGeometry(x);for(U.consume();null!=x&&b.model.isVertex(x)&&null!=f&&f.relative;)cell=x,x=b.model.getParent(cell),f=b.getCellGeometry(x);window.setTimeout(mxUtils.bind(this,function(){this.shapePickerHoverDiv=d.showShapePicker(U.getGraphX(),U.getGraphY(),x,mxUtils.bind(this,-function(B){q(B);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(B))}),O)}),30)}),mxUtils.bind(this,function(f){this.graph.selectCellsForConnectVertex(f,c,this)}))};var C=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(G,O){null!=C&&window.clearTimeout(C);C=window.setTimeout(mxUtils.bind(this,function(){var U=O.getProperty("arrow"),c=O.getProperty("direction"),f=O.getProperty("event");U=U.getBoundingClientRect();var k=mxUtils.getOffset(b.container),q=b.container.scrollLeft+-U.x-k.x;k=b.container.scrollTop+U.y-k.y;var x=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),B=d.showShapePicker(q,k,x,mxUtils.bind(this,function(E){null!=E&&b.connectVertex(x,c,b.defaultEdgeLength,f,!0,!1,null,function(L){b.selectCellsForConnectVertex(L);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(E))},E)}),c,!0);null!=B&&(this.centerShapePicker(B,U,q,k,c),this.hoverIcons.shapePickerHoverDiv=B,mxUtils.setOpacity(B,30),mxEvent.addListener(B,-"mouseenter",function(){mxUtils.setOpacity(B,100)}),mxEvent.addListener(B,"mouseleave",function(){d.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(G,O){null!=C&&window.clearTimeout(C)}))}var P=!1;b.addMouseListener({mouseDown:mxUtils.bind(this,function(G,O){P=!1}),mouseMove:mxUtils.bind(this,function(G,O){null!=b.connectHandleClickState&&null!=b.connectionHandler&&null!=b.connectionHandler.shape&&(P=!0)}),mouseUp:mxUtils.bind(this,-function(G,O){G=b.connectHandleClickState;b.connectHandleClickState=null;if(null!=G&&!P){var U=O.getEvent();if(!b.isCloneEvent(U)&&!mxEvent.isShiftDown(U)){for(var c=mxConstants.DIRECTION_EAST,f=b.getCompositeParent(G.cell),k=b.getCellGeometry(f);null!=f&&b.model.isVertex(f)&&null!=k&&k.relative;)f=b.model.getParent(f),k=b.getCellGeometry(f);b.connectVertex(G.cell,c,b.defaultEdgeLength,U,null,!0,mxUtils.bind(this,function(q,x,B){O.consume();window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(O.getGraphX(),-O.getGraphY(),f,mxUtils.bind(this,function(E){B(E);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(E))}),c)}),30)}),mxUtils.bind(this,function(q){b.selectCellsForConnectVertex(q,U)}))}}P=!1})})};-EditorUi.prototype.getDoubleClickTerminalForEvent=function(b,d){var m=this.editor.graph;if(null!=b&&null!=d&&m.model.isEdge(d)){var p=m.view.getState(d);if(null!=p&&null!=p.absolutePoints&&2<=p.absolutePoints.length){b=mxUtils.convertPoint(m.container,mxEvent.getClientX(b),mxEvent.getClientY(b));for(var v=m.tolerance+mxConstants.HANDLE_SIZE,n=0;2>n;n++){var y=0==n;if(null==m.model.getTerminal(d,y)){var C=p.absolutePoints[y?0:p.absolutePoints.length-1];if(null!=C&&Math.abs(C.x-b.x)<=v&&Math.abs(C.y--b.y)<=v)return{point:C.clone(),source:y}}}}}return null};-EditorUi.prototype.showShapePickerForEdgeTerminal=function(b,d,m){var p=this,v=this.editor.graph;this.showShapePicker(m.x,m.y,null,mxUtils.bind(this,function(n){if(null!=n){var y=n.geometry;null!=y&&(y.x=v.snap(Math.round(m.x/v.view.scale)-v.view.translate.x-y.width/2),y.y=v.snap(Math.round(m.y/v.view.scale)-v.view.translate.y-y.height/2));v.model.beginUpdate();try{v.addCell(n);v.model.isVertex(n)&&v.isAutoSizeCell(n)&&v.updateCellSize(n);v.model.setTerminal(b,n,d);var C=v.getCellGeometry(b);null!=-C&&null!=C.getTerminalPoint(d)&&(C=C.clone(),C.setTerminalPoint(null,d),v.model.setGeometry(b,C))}finally{v.model.endUpdate()}v.setSelectionCell(n);v.scrollCellToVisible(n);v.startEditing(n);null!=p.hoverIcons&&p.hoverIcons.update(v.view.getState(n))}}),null,!1,null,!1,!1,this.getCellsForShapePicker(null,!1,!1),{cell:b,source:d})};-EditorUi.prototype.centerShapePicker=function(b,d,m,p,v){if(v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST)b.style.width="40px";var n=b.getBoundingClientRect();v==mxConstants.DIRECTION_NORTH?(m-=n.width/2-10,p-=n.height+6):v==mxConstants.DIRECTION_SOUTH?(m-=n.width/2-10,p+=d.height+6):v==mxConstants.DIRECTION_WEST?(m-=n.width+6,p-=n.height/2-10):v==mxConstants.DIRECTION_EAST&&(m+=d.width+6,p-=n.height/2-10);b.style.left=m+"px";b.style.top=p+"px"};-EditorUi.prototype.showShapePicker=function(b,d,m,p,v,n,y,C,P,G,O){var U=null;this.editor.graph.freehand.isDrawing()||(C=C||null==m,G=null!=G?G:this.getCellsForShapePicker(m,n,C),U=this.createShapePicker(b,d,m,p,v,mxUtils.bind(this,function(){this.hideShapePicker()}),G,n,y,C,P,O),null!=U&&(null==this.hoverIcons||n||this.hoverIcons.reset(),b=this.editor.graph,b.popupMenuHandler.hideMenu(),b.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=p,this.shapePicker=+function(C){q(C);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(C))}),O)}),30)}),mxUtils.bind(this,function(f){this.graph.selectCellsForConnectVertex(f,c,this)}))};var B=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(G,O){null!=B&&window.clearTimeout(B);B=window.setTimeout(mxUtils.bind(this,function(){var U=O.getProperty("arrow"),c=O.getProperty("direction"),f=O.getProperty("event");U=U.getBoundingClientRect();var k=mxUtils.getOffset(b.container),q=b.container.scrollLeft++U.x-k.x;k=b.container.scrollTop+U.y-k.y;var x=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),C=d.showShapePicker(q,k,x,mxUtils.bind(this,function(E){null!=E&&b.connectVertex(x,c,b.defaultEdgeLength,f,!0,!1,null,function(L){b.selectCellsForConnectVertex(L);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(E))},E)}),c,!0);null!=C&&(this.centerShapePicker(C,U,q,k,c),this.hoverIcons.shapePickerHoverDiv=C,mxUtils.setOpacity(C,30),mxEvent.addListener(C,+"mouseenter",function(){mxUtils.setOpacity(C,100)}),mxEvent.addListener(C,"mouseleave",function(){d.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(G,O){null!=B&&window.clearTimeout(B)}))}var P=!1;b.addMouseListener({mouseDown:mxUtils.bind(this,function(G,O){P=!1}),mouseMove:mxUtils.bind(this,function(G,O){null!=b.connectHandleClickState&&null!=b.connectionHandler&&null!=b.connectionHandler.shape&&(P=!0)}),mouseUp:mxUtils.bind(this,+function(G,O){G=b.connectHandleClickState;b.connectHandleClickState=null;if(null!=G&&!P){var U=O.getEvent();if(!b.isCloneEvent(U)&&!mxEvent.isShiftDown(U)){for(var c=mxConstants.DIRECTION_EAST,f=b.getCompositeParent(G.cell),k=b.getCellGeometry(f);null!=f&&b.model.isVertex(f)&&null!=k&&k.relative;)f=b.model.getParent(f),k=b.getCellGeometry(f);b.connectVertex(G.cell,c,b.defaultEdgeLength,U,null,!0,mxUtils.bind(this,function(q,x,C){O.consume();window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(O.getGraphX(),+O.getGraphY(),f,mxUtils.bind(this,function(E){C(E);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(E))}),c)}),30)}),mxUtils.bind(this,function(q){b.selectCellsForConnectVertex(q,U)}))}}P=!1})})};+EditorUi.prototype.getDoubleClickTerminalForEvent=function(b,d){var m=this.editor.graph;if(null!=b&&null!=d&&m.model.isEdge(d)){var p=m.view.getState(d);if(null!=p&&null!=p.absolutePoints&&2<=p.absolutePoints.length){b=mxUtils.convertPoint(m.container,mxEvent.getClientX(b),mxEvent.getClientY(b));for(var u=m.tolerance+mxConstants.HANDLE_SIZE,n=0;2>n;n++){var y=0==n;if(null==m.model.getTerminal(d,y)){var B=p.absolutePoints[y?0:p.absolutePoints.length-1];if(null!=B&&Math.abs(B.x-b.x)<=u&&Math.abs(B.y-+b.y)<=u)return{point:B.clone(),source:y}}}}}return null};+EditorUi.prototype.showShapePickerForEdgeTerminal=function(b,d,m){var p=this,u=this.editor.graph;this.showShapePicker(m.x,m.y,null,mxUtils.bind(this,function(n){if(null!=n){var y=n.geometry;null!=y&&(y.x=u.snap(Math.round(m.x/u.view.scale)-u.view.translate.x-y.width/2),y.y=u.snap(Math.round(m.y/u.view.scale)-u.view.translate.y-y.height/2));u.model.beginUpdate();try{u.addCell(n);u.model.isVertex(n)&&u.isAutoSizeCell(n)&&u.updateCellSize(n);u.model.setTerminal(b,n,d);var B=u.getCellGeometry(b);null!=+B&&null!=B.getTerminalPoint(d)&&(B=B.clone(),B.setTerminalPoint(null,d),u.model.setGeometry(b,B))}finally{u.model.endUpdate()}u.setSelectionCell(n);u.scrollCellToVisible(n);u.startEditing(n);null!=p.hoverIcons&&p.hoverIcons.update(u.view.getState(n))}}),null,!1,null,!1,!1,this.getCellsForShapePicker(null,!1,!1),{cell:b,source:d})};+EditorUi.prototype.centerShapePicker=function(b,d,m,p,u){if(u==mxConstants.DIRECTION_EAST||u==mxConstants.DIRECTION_WEST)b.style.width="40px";var n=b.getBoundingClientRect();u==mxConstants.DIRECTION_NORTH?(m-=n.width/2-10,p-=n.height+6):u==mxConstants.DIRECTION_SOUTH?(m-=n.width/2-10,p+=d.height+6):u==mxConstants.DIRECTION_WEST?(m-=n.width+6,p-=n.height/2-10):u==mxConstants.DIRECTION_EAST&&(m+=d.width+6,p-=n.height/2-10);b.style.left=m+"px";b.style.top=p+"px"};+EditorUi.prototype.showShapePicker=function(b,d,m,p,u,n,y,B,P,G,O){var U=null;this.editor.graph.freehand.isDrawing()||(B=B||null==m,G=null!=G?G:this.getCellsForShapePicker(m,n,B),U=this.createShapePicker(b,d,m,p,u,mxUtils.bind(this,function(){this.hideShapePicker()}),G,n,y,B,P,O),null!=U&&(null==this.hoverIcons||n||this.hoverIcons.reset(),b=this.editor.graph,b.popupMenuHandler.hideMenu(),b.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=p,this.shapePicker=U));return U};-EditorUi.prototype.createShapePicker=function(b,d,m,p,v,n,y,C,P,G,O,U){O=null!=O?O:!0;var c=this.editor.graph,f=null;P=null!=P?P:function(x){x=x[0];var B=0,E=0,L=x.geometry;null!=L&&(c.model.isEdge(x)&&(x=L.getTerminalPoint(!1),L=new mxRectangle(0,0,x.x,x.y)),B=L.width/2,E=L.height/2);return new mxPoint(c.snap(Math.round(b/c.view.scale)-c.view.translate.x-B),c.snap(Math.round(d/c.view.scale)-c.view.translate.y-E))};if(null!=y&&0<y.length){var k=this;c=this.editor.graph;f=document.createElement("div");v=-c.view.getState(m);var q=null==m||null!=v&&c.isTransparentState(v)?null:c.copyStyle(m);f.className="geShapePicker";f.setAttribute("title",mxResources.get("sidebarTooltip"));f.style.left=Math.round(b)+"px";f.style.top=Math.round(d)+"px";mxClient.IS_POINTER&&(f.style.touchAction="none");C||mxUtils.setPrefixedStyle(f.style,"transform","translate(-22px,-22px)");c.container.appendChild(f);v=mxUtils.bind(this,function(x){var B=document.createElement("a");f.appendChild(B);var E=x.shapePickerKeepStyle;delete x.shapePickerKeepStyle;+EditorUi.prototype.createShapePicker=function(b,d,m,p,u,n,y,B,P,G,O,U){O=null!=O?O:!0;var c=this.editor.graph,f=null;P=null!=P?P:function(x){x=x[0];var C=0,E=0,L=x.geometry;null!=L&&(c.model.isEdge(x)&&(x=L.getTerminalPoint(!1),L=new mxRectangle(0,0,x.x,x.y)),C=L.width/2,E=L.height/2);return new mxPoint(c.snap(Math.round(b/c.view.scale)-c.view.translate.x-C),c.snap(Math.round(d/c.view.scale)-c.view.translate.y-E))};if(null!=y&&0<y.length){var k=this;c=this.editor.graph;f=document.createElement("div");u=+c.view.getState(m);var q=null==m||null!=u&&c.isTransparentState(u)?null:c.copyStyle(m);f.className="geShapePicker";f.setAttribute("title",mxResources.get("sidebarTooltip"));f.style.left=Math.round(b)+"px";f.style.top=Math.round(d)+"px";mxClient.IS_POINTER&&(f.style.touchAction="none");B||mxUtils.setPrefixedStyle(f.style,"transform","translate(-22px,-22px)");c.container.appendChild(f);u=mxUtils.bind(this,function(x){var C=document.createElement("a");f.appendChild(C);var E=x.shapePickerKeepStyle;delete x.shapePickerKeepStyle;E||(null!=q&&"1"!=urlParams.sketch?this.sidebar.graph.pasteStyle(q,[x]):this.sidebar.graph.pasteCellStyles([x],c.currentVertexStyle,c.currentEdgeStyle,null,null,c.pasteStylesToText));E=x.geometry;c.model.isEdge(x)&&(E=E.getTerminalPoint(!1),E=new mxRectangle(0,0,E.x,E.y));null!=E&&(E=this.sidebar.createVertexTemplateFromCells([x],E.width,E.height,"",!0,!1,null,!0,mxUtils.bind(this,function(L){if(!mxEvent.isAltDown(L)||1!=c.getSelectionCount()){if(!mxEvent.isShiftDown(L)||null==m&&c.isSelectionEmpty()){var Q=c.cloneCell(x);if(null!=p)p(Q);else{var V=P([Q]);c.model.isEdge(Q)?Q.geometry.translate(V.x,V.y):(Q.geometry.x=V.x,Q.geometry.y=V.y);c.model.beginUpdate();try{c.addCell(Q),c.model.isVertex(Q)&&c.isAutoSizeCell(Q)&&c.updateCellSize(Q)}finally{c.model.endUpdate()}c.setSelectionCell(Q);c.scrollCellToVisible(Q);O&&c.startEditing(Q);null!=k.hoverIcons&&k.hoverIcons.update(c.view.getState(Q))}}else Q=c.getEditableCells(null!=m?[m]:c.getSelectionCells()),c.updateShapes(x,Q);null!=n&&n(L);mxEvent.consume(L)}}),-25,25,null,null,m,U),E.style.display="flex",E.style.alignItems="center",E.style.justifyContent="center",B.appendChild(E))});for(G=0;G<(C?Math.min(y.length,4):y.length);G++)v(y[G]);y=f.offsetTop+f.clientHeight-(c.container.scrollTop+c.container.offsetHeight);0<y&&(f.style.top=Math.max(c.container.scrollTop+22,d-y)+"px");y=f.offsetLeft+f.clientWidth-(c.container.scrollLeft+c.container.offsetWidth);0<y&&(f.style.left=Math.max(c.container.scrollLeft+22,b-y)+"px")}return f};+25,25,null,null,m,U),E.style.display="flex",E.style.alignItems="center",E.style.justifyContent="center",C.appendChild(E))});for(G=0;G<(B?Math.min(y.length,4):y.length);G++)u(y[G]);y=f.offsetTop+f.clientHeight-(c.container.scrollTop+c.container.offsetHeight);0<y&&(f.style.top=Math.max(c.container.scrollTop+22,d-y)+"px");y=f.offsetLeft+f.clientWidth-(c.container.scrollLeft+c.container.offsetWidth);0<y&&(f.style.left=Math.max(c.container.scrollLeft+22,b-y)+"px")}return f};EditorUi.prototype.defaultShapePickerEntries=null;-EditorUi.prototype.getCellsForShapePicker=function(b,d,m){var p=this.editor.graph,v=mxUtils.bind(this,function(U,c,f,k){return p.createVertex(null,null,k||"",0,0,c||120,f||60,U,!1)});d=mxUtils.bind(this,function(U,c,f){U=new mxCell(f||"",new mxGeometry(0,0,p.defaultEdgeLength+20,0),U);U.geometry.setTerminalPoint(new mxPoint(0,0),!0);U.geometry.setTerminalPoint(new mxPoint(U.geometry.width,null!=c?c:0),!1);U.geometry.points=null!=c?[new mxPoint(U.geometry.width/2,c)]:[];U.geometry.relative=!0;U.edge=-!0;return U});if(null!=b)try{b=p.cloneCell(b),p.model.isVertex(b)&&null!=b.geometry&&(b.geometry.x=0,b.geometry.y=0)}catch(U){b=null}if(null!=this.defaultShapePickerEntries){for(var n=[],y=[],C=function(U){if(null!=U&&"object"===typeof U){var c=mxUtils.createXmlDocument().createElement("UserObject"),f;for(f in U)U.hasOwnProperty(f)&&c.setAttribute(f,U[f]);null==c.getAttribute("label")&&c.setAttribute("label","");return c}return U},P=0;P<this.defaultShapePickerEntries.length;P++){var G=this.defaultShapePickerEntries[P];-if(null!=G&&null!=G.style){var O=C(G.value);G.edge?y.push(d(G.style,G.y,O)):(O=v(G.style,G.width,G.height,O),G.keepStyle&&(O.shapePickerKeepStyle=!0),n.push(O))}}null!=b&&(n[0]=b);b=n;m&&(b=b.concat(y));return b}null==b&&(b=v(p.appendFontSize(Editor.defaultTextStyle,p.vertexFontSize),60,30,"Text"));b=[b,v("whiteSpace=wrap;html=1;"),v("ellipse;whiteSpace=wrap;html=1;",80,80),v("rhombus;whiteSpace=wrap;html=1;",80,80),v("rounded=1;whiteSpace=wrap;html=1;"),v("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;"),-v("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,60),v("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80),v("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80),v("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),v("triangle;whiteSpace=wrap;html=1;",60,80),v("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),v("shape=tape;whiteSpace=wrap;html=1;",120,100),v("ellipse;shape=cloud;whiteSpace=wrap;html=1;",-120,80),v("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",80,60),v("shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",20,20)];m&&(b=b.concat([d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;"),+EditorUi.prototype.getCellsForShapePicker=function(b,d,m){var p=this.editor.graph,u=mxUtils.bind(this,function(U,c,f,k){return p.createVertex(null,null,k||"",0,0,c||120,f||60,U,!1)});d=mxUtils.bind(this,function(U,c,f){U=new mxCell(f||"",new mxGeometry(0,0,p.defaultEdgeLength+20,0),U);U.geometry.setTerminalPoint(new mxPoint(0,0),!0);U.geometry.setTerminalPoint(new mxPoint(U.geometry.width,null!=c?c:0),!1);U.geometry.points=null!=c?[new mxPoint(U.geometry.width/2,c)]:[];U.geometry.relative=!0;U.edge=+!0;return U});if(null!=b)try{b=p.cloneCell(b),p.model.isVertex(b)&&null!=b.geometry&&(b.geometry.x=0,b.geometry.y=0)}catch(U){b=null}if(null!=this.defaultShapePickerEntries){for(var n=[],y=[],B=function(U){if(null!=U&&"object"===typeof U){var c=mxUtils.createXmlDocument().createElement("UserObject"),f;for(f in U)U.hasOwnProperty(f)&&c.setAttribute(f,U[f]);null==c.getAttribute("label")&&c.setAttribute("label","");return c}return U},P=0;P<this.defaultShapePickerEntries.length;P++){var G=this.defaultShapePickerEntries[P];+if(null!=G&&null!=G.style){var O=B(G.value);G.edge?y.push(d(G.style,G.y,O)):(O=u(G.style,G.width,G.height,O),G.keepStyle&&(O.shapePickerKeepStyle=!0),n.push(O))}}null!=b&&(n[0]=b);b=n;m&&(b=b.concat(y));return b}null==b&&(b=u(p.appendFontSize(Editor.defaultTextStyle,p.vertexFontSize),60,30,"Text"));b=[b,u("whiteSpace=wrap;html=1;"),u("ellipse;whiteSpace=wrap;html=1;",80,80),u("rhombus;whiteSpace=wrap;html=1;",80,80),u("rounded=1;whiteSpace=wrap;html=1;"),u("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;"),+u("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,60),u("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80),u("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80),u("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),u("triangle;whiteSpace=wrap;html=1;",60,80),u("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),u("shape=tape;whiteSpace=wrap;html=1;",120,100),u("ellipse;shape=cloud;whiteSpace=wrap;html=1;",+120,80),u("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",80,60),u("shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",20,20)];m&&(b=b.concat([d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),d("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;"),d("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;",this.editor.graph.defaultEdgeLength/2)]));return b};EditorUi.prototype.isShapePickerVisible=function(b){return null!=this.shapePicker};EditorUi.prototype.hideShapePicker=function(b){null!=this.shapePicker&&(this.shapePicker.parentNode.removeChild(this.shapePicker),this.shapePicker=null,null!=this.hoverIcons&&null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null),b||null==this.shapePickerCallback||this.shapePickerCallback(),this.shapePickerCallback=null)};EditorUi.prototype.isSpaceDown=function(){return this.spaceDown};EditorUi.prototype.isShiftDown=function(){return this.shiftDown};-EditorUi.prototype.onKeyDown=function(b){var d=this.editor.graph;if(9==b.which&&d.isEnabled()&&!mxEvent.isControlDown(b)){if(d.isEditing())if(mxEvent.isAltDown(b))d.stopEditing(!1);else try{var m=d.cellEditor.isContentEditing()&&d.cellEditor.isTextSelected();if(window.getSelection&&d.cellEditor.isContentEditing()&&!m){var p=window.getSelection(),v=0<p.rangeCount?p.getRangeAt(0).commonAncestorContainer:null;m=null!=v&&("LI"==v.nodeName||null!=v.parentNode&&"LI"==v.parentNode.nodeName)}m?document.execCommand(mxEvent.isShiftDown(b)?+EditorUi.prototype.onKeyDown=function(b){var d=this.editor.graph;if(9==b.which&&d.isEnabled()&&!mxEvent.isControlDown(b)){if(d.isEditing())if(mxEvent.isAltDown(b))d.stopEditing(!1);else try{var m=d.cellEditor.isContentEditing()&&d.cellEditor.isTextSelected();if(window.getSelection&&d.cellEditor.isContentEditing()&&!m){var p=window.getSelection(),u=0<p.rangeCount?p.getRangeAt(0).commonAncestorContainer:null;m=null!=u&&("LI"==u.nodeName||null!=u.parentNode&&"LI"==u.parentNode.nodeName)}m?document.execCommand(mxEvent.isShiftDown(b)?"outdent":"indent",!1,null):mxEvent.isShiftDown(b)?d.stopEditing(!1):d.cellEditor.insertTab(d.cellEditor.isContentEditing()?null:4)}catch(n){}else mxEvent.isAltDown(b)?d.selectParentCell():d.selectCell(!mxEvent.isShiftDown(b));mxEvent.consume(b)}};EditorUi.prototype.onKeyPress=function(b){var d=this.editor.graph;null!=this.typingShim&&mxEvent.getSource(b)===this.typingShim||!this.isImmediateEditingEvent(b)||d.isEditing()||d.isSelectionEmpty()||mxEvent.isAltDown(b)||mxEvent.isControlDown(b)||mxEvent.isMetaDown(b)||(null==b.key||1!==b.key.length)&&229!==b.keyCode||null!=this.keyHandler&&null!=this.keyHandler.getFunction(b)||(d.escape(),d.cellEditor.editByTyping=!0,d.startEditing())};EditorUi.prototype.installTypingShim=function(){var b=this.editor.graph,d=document.createElement("textarea");d.setAttribute("autocomplete","off");d.setAttribute("autocorrect","off");d.setAttribute("autocapitalize","off");d.setAttribute("spellcheck","false");(mxClient.IS_ANDROID||mxClient.IS_IOS||"ontouchstart"in document.documentElement&&1<navigator.maxTouchPoints)&&d.setAttribute("inputmode","none");d.tabIndex=-1;d.className="mxTypingShim";d.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;";this.typingShim=d;var m=!1,p=mxUtils.bind(this,function(){if(!m&&0<d.value.length){var n=d.value;d.value="";this.hideTypingShim();b.escape();b.cellEditor.editByTyping=!0;b.startEditing(null,n)}});mxEvent.addListener(d,"compositionstart",function(){m=!0});mxEvent.addListener(d,"compositionend",function(){m=!1;p()});mxEvent.addListener(d,"input",function(){p()});mxEvent.addListener(d,"keydown",mxUtils.bind(this,function(n){229!==n.keyCode&&(mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||(null==n.key||1!==n.key.length||mxEvent.isAltDown(n)?n.preventDefault():null!=this.keyHandler&&null!=this.keyHandler.getFunction(n)&&n.preventDefault()))}));b.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateTypingShim();window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));b.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(){this.hideTypingShim()}));b.addListener(mxEvent.EDITING_STOPPED,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,-function(){this.updateTypingShim()}),0)}));if(null==b.container.tabIndex||0>b.container.tabIndex)b.container.tabIndex=-1;mxEvent.addListener(b.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var v=b.cellEditor.focusContainer;b.cellEditor.focusContainer=mxUtils.bind(this,function(){b.isSelectionEmpty()||b.isEditing()?v.apply(b.cellEditor):this.updateTypingShim()})};+function(){this.updateTypingShim()}),0)}));if(null==b.container.tabIndex||0>b.container.tabIndex)b.container.tabIndex=-1;mxEvent.addListener(b.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var u=b.cellEditor.focusContainer;b.cellEditor.focusContainer=mxUtils.bind(this,function(){b.isSelectionEmpty()||b.isEditing()?u.apply(b.cellEditor):this.updateTypingShim()})};EditorUi.prototype.updateTypingShim=function(){var b=this.editor.graph;b.isEditing()||b.isSelectionEmpty()||!b.isEnabled()||b.isCellLocked(b.getSelectionCell())?this.hideTypingShim():this.showTypingShim()};EditorUi.prototype.showTypingShim=function(){var b=this.editor.graph,d=this.typingShim;if(null!=d&&!b.isEditing()){var m=b.getSelectionCell();m=b.getView().getState(m);if(null!=m){var p=document.activeElement;if(null==p||p===document.body||p===b.container||b.container.contains(p))if(d.style.left=Math.round(m.x)+"px",d.style.top=Math.round(m.y)+"px",d.parentNode!==b.container&&b.container.appendChild(d),d.value="",null!=this.clipboardElt&&null!=this.clipboardElt.parentNode){d=b.container.scrollLeft;-m=b.container.scrollTop;this.clipboardElt.focus({preventScroll:!0});try{var v=document.createRange();v.selectNodeContents(this.clipboardElt);var n=window.getSelection();null!=n&&(n.removeAllRanges(),n.addRange(v))}catch(y){}b.container.scrollLeft=d;b.container.scrollTop=m}else null!=p&&"true"===p.contentEditable||d.focus({preventScroll:!0})}}};EditorUi.prototype.hideTypingShim=function(){var b=this.typingShim;null!=b&&null!=b.parentNode&&b.parentNode.removeChild(b)};-EditorUi.prototype.isImmediateEditingEvent=function(b){return!0};EditorUi.prototype.updateCssForMarker=function(b,d,m,p,v){m=this.getImageForMarker(p,v,m);b.innerHTML="";null==m?b.innerHTML=mxUtils.htmlEntities(mxResources.get("none")):(p=document.createElement("img"),p.setAttribute("src",m),"end"==d&&mxUtils.setPrefixedStyle(p.style,"transform","scaleX(-1)"),b.appendChild(p))};+m=b.container.scrollTop;this.clipboardElt.focus({preventScroll:!0});try{var u=document.createRange();u.selectNodeContents(this.clipboardElt);var n=window.getSelection();null!=n&&(n.removeAllRanges(),n.addRange(u))}catch(y){}b.container.scrollLeft=d;b.container.scrollTop=m}else null!=p&&"true"===p.contentEditable||d.focus({preventScroll:!0})}}};EditorUi.prototype.hideTypingShim=function(){var b=this.typingShim;null!=b&&null!=b.parentNode&&b.parentNode.removeChild(b)};+EditorUi.prototype.isImmediateEditingEvent=function(b){return!0};EditorUi.prototype.updateCssForMarker=function(b,d,m,p,u){m=this.getImageForMarker(p,u,m);b.innerHTML="";null==m?b.innerHTML=mxUtils.htmlEntities(mxResources.get("none")):(p=document.createElement("img"),p.setAttribute("src",m),"end"==d&&mxUtils.setPrefixedStyle(p.style,"transform","scaleX(-1)"),b.appendChild(p))};EditorUi.prototype.getImageForMarker=function(b,d,m){return"flexArrow"==m?null!=b&&b!=mxConstants.NONE?Format.blockMarkerImage.src:null:b==mxConstants.ARROW_CLASSIC?"1"!=d?Format.classicMarkerImage.src:Format.classicFilledMarkerImage.src:b==mxConstants.ARROW_CLASSIC_THIN?"1"!=d?Format.classicThinMarkerImage.src:Format.openThinFilledMarkerImage.src:b==mxConstants.ARROW_OPEN?Format.openFilledMarkerImage.src:b==mxConstants.ARROW_OPEN_THIN?Format.openThinFilledMarkerImage.src:b==mxConstants.ARROW_BLOCK?"1"!=d?Format.blockMarkerImage.src:Format.blockFilledMarkerImage.src:b==mxConstants.ARROW_BLOCK_THIN?"1"!=d?Format.blockThinMarkerImage.src:Format.blockThinFilledMarkerImage.src:b==mxConstants.ARROW_OVAL?"1"!=d?Format.ovalMarkerImage.src:Format.ovalFilledMarkerImage.src:b==mxConstants.ARROW_DIAMOND?"1"!=d?Format.diamondMarkerImage.src:Format.diamondFilledMarkerImage.src:b==mxConstants.ARROW_DIAMOND_THIN?"1"!=d?Format.diamondThinMarkerImage.src:Format.diamondThinFilledMarkerImage.src:"doubleBlock"==b?"1"!=d?Format.doubleBlockMarkerImage.src:Format.doubleBlockFilledMarkerImage.src:"box"==b?Format.boxMarkerImage.src:"halfCircle"==b?Format.halfCircleMarkerImage.src:"openAsync"==b?Format.openAsyncFilledMarkerImage.src:"async"==b?"1"!=d?Format.asyncMarkerImage.src:Format.asyncFilledMarkerImage.src:"dash"==b?Format.dashMarkerImage.src:"baseDash"==b?Format.baseDashMarkerImage.src:"cross"==b?Format.crossMarkerImage.src:"circle"==b?Format.circleMarkerImage.src:"circlePlus"==b?Format.circlePlusMarkerImage.src:@@ -2242,49 +2242,49 @@ EditorUi.prototype.getImageForEdgeShape=function(b){var d=Format.connectionImageEditorUi.prototype.getImageForEdgeStyle=function(b){if("1"==mxUtils.getValue(b,"libavoidRouting",null))return Format.libavoidImage.src;var d=Format.orthogonalImage.src,m=mxUtils.getValue(b,mxConstants.STYLE_EDGE,null);"1"==mxUtils.getValue(b,mxConstants.STYLE_NOEDGESTYLE,null)&&(m=null);"orthogonalEdgeStyle"==m&&"1"==mxUtils.getValue(b,mxConstants.STYLE_CURVED,null)?d=Format.curvedImage.src:"straight"==m||"none"==m||null==m?d=Format.straightImage.src:"entityRelationEdgeStyle"==m?d=Format.entityImage.src:"elbowEdgeStyle"==m?d="vertical"==mxUtils.getValue(b,mxConstants.STYLE_ELBOW,null)?Format.verticalElbowImage.src:Format.horizontalElbowImage.src:"isometricEdgeStyle"==m&&(d="vertical"==mxUtils.getValue(b,mxConstants.STYLE_ELBOW,null)?Format.verticalIsometricImage.src:Format.horizontalIsometricImage.src);return d};EditorUi.prototype.createMenus=function(){return null};EditorUi.prototype.updatePasteActionStates=function(){var b=this.editor.graph,d=this.actions.get("paste"),m=this.actions.get("pasteHere");d.setEnabled(this.editor.graph.cellEditor.isContentEditing()||(null!=navigator.clipboard||!mxClipboard.isEmpty())&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()));m.setEnabled(d.isEnabled())};-EditorUi.prototype.initClipboard=function(){var b=this,d=mxClipboard.cut;mxClipboard.cut=function(n){n.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):d.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(n){var y=null;if(n.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{y=y||n.getSelectionCells();y=n.getExportableCells(n.model.getTopmostCells(y));for(var C={},P=n.createCellLookup(y),G=n.cloneCells(y,null,C),O=new mxGraphModel,U=O.getChildAt(O.getRoot(),-0),c=0;c<G.length;c++){O.add(U,G[c]);var f=n.view.getState(y[c]);if(null!=f){var k=n.getCellGeometry(G[c]);null!=k&&k.relative&&!O.isEdge(y[c])&&null==P[mxObjectIdentity.get(O.getParent(y[c]))]&&(k.offset=null,k.relative=!1,k.x=f.x/f.view.scale-f.view.translate.x,k.y=f.y/f.view.scale-f.view.translate.y)}}n.updateCustomLinks(n.createCellMapping(C,P),G);mxClipboard.insertCount=1;mxClipboard.setCells(G)}b.updatePasteActionStates();return y};var m=mxClipboard.paste;mxClipboard.paste=function(n){var y=-null;n.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):y=m.apply(this,arguments);b.updatePasteActionStates();return y};var p=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){p.apply(this,arguments);b.updatePasteActionStates()};var v=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(n,y){v.apply(this,arguments);b.updatePasteActionStates()};this.updatePasteActionStates()};+EditorUi.prototype.initClipboard=function(){var b=this,d=mxClipboard.cut;mxClipboard.cut=function(n){n.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):d.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(n){var y=null;if(n.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{y=y||n.getSelectionCells();y=n.getExportableCells(n.model.getTopmostCells(y));for(var B={},P=n.createCellLookup(y),G=n.cloneCells(y,null,B),O=new mxGraphModel,U=O.getChildAt(O.getRoot(),+0),c=0;c<G.length;c++){O.add(U,G[c]);var f=n.view.getState(y[c]);if(null!=f){var k=n.getCellGeometry(G[c]);null!=k&&k.relative&&!O.isEdge(y[c])&&null==P[mxObjectIdentity.get(O.getParent(y[c]))]&&(k.offset=null,k.relative=!1,k.x=f.x/f.view.scale-f.view.translate.x,k.y=f.y/f.view.scale-f.view.translate.y)}}n.updateCustomLinks(n.createCellMapping(B,P),G);mxClipboard.insertCount=1;mxClipboard.setCells(G)}b.updatePasteActionStates();return y};var m=mxClipboard.paste;mxClipboard.paste=function(n){var y=+null;n.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):y=m.apply(this,arguments);b.updatePasteActionStates();return y};var p=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){p.apply(this,arguments);b.updatePasteActionStates()};var u=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(n,y){u.apply(this,arguments);b.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20;EditorUi.prototype.wheelZoomDelay=500;EditorUi.prototype.buttonZoomDelay=600;EditorUi.prototype.initCanvas=function(){var b=this.editor.graph;b.timerAutoScroll=!0;b.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((b.container.offsetWidth-34)/b.view.scale)),Math.max(0,Math.round((b.container.offsetHeight-34)/b.view.scale)))};b.view.getBackgroundPageBounds=function(){var Y=this.graph.getPageLayout(),Z=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+Y.x*Z.width),this.scale*(this.translate.y+Y.y*Z.height),this.scale*Y.width*Z.width,-this.scale*Y.height*Z.height)};b.getPreferredPageSize=function(Y,Z,ia){Y=this.getPageLayout();Z=this.getPageSize();return new mxRectangle(0,0,Y.width*Z.width,Y.height*Z.height)};var d=null,m=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(Y,Z,ia,ka){if(null!=b.container&&!b.isViewer()){ia=null!=ia?ia:0;ka=null!=ka?ka:0;var X=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),ja=mxUtils.hasScrollbars(b.container),na=b.view.translate,la=b.view.scale,-va=mxRectangle.fromRectangle(X);va.x=va.x/la-na.x;va.y=va.y/la-na.y;va.width/=la;va.height/=la;na=b.container.scrollTop;var za=b.container.scrollLeft,sa=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)sa+=3;var wa=b.container.offsetWidth-sa;sa=b.container.offsetHeight-sa;Y=Y?Math.max(.3,Math.min(Z||1,wa/va.width)):la;Z=(wa-Y*va.width)/2/Y;var Ca=0==this.lightboxVerticalDivider?0:(sa-Y*va.height)/this.lightboxVerticalDivider/Y;ja&&(Z=Math.max(Z,0),Ca=Math.max(Ca,-0));if(ja||X.width<wa||X.height<sa)b.view.scaleAndTranslate(Y,Math.floor(Z-va.x),Math.floor(Ca-va.y)),b.container.scrollTop=na*Y/la,b.container.scrollLeft=za*Y/la;else if(0!=ia||0!=ka)X=b.view.translate,b.view.setTranslate(Math.floor(X.x+ia/la),Math.floor(X.y+ka/la))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var p=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",p);this.destroyFunctions.push(function(){mxEvent.removeListener(window,-"resize",p)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(Y){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(Y){b.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var v=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position=+this.scale*Y.height*Z.height)};b.getPreferredPageSize=function(Y,Z,ia){Y=this.getPageLayout();Z=this.getPageSize();return new mxRectangle(0,0,Y.width*Z.width,Y.height*Z.height)};var d=null,m=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(Y,Z,ia,ja){if(null!=b.container&&!b.isViewer()){ia=null!=ia?ia:0;ja=null!=ja?ja:0;var X=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),ka=mxUtils.hasScrollbars(b.container),na=b.view.translate,la=b.view.scale,+ua=mxRectangle.fromRectangle(X);ua.x=ua.x/la-na.x;ua.y=ua.y/la-na.y;ua.width/=la;ua.height/=la;na=b.container.scrollTop;var za=b.container.scrollLeft,sa=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)sa+=3;var wa=b.container.offsetWidth-sa;sa=b.container.offsetHeight-sa;Y=Y?Math.max(.3,Math.min(Z||1,wa/ua.width)):la;Z=(wa-Y*ua.width)/2/Y;var Ca=0==this.lightboxVerticalDivider?0:(sa-Y*ua.height)/this.lightboxVerticalDivider/Y;ka&&(Z=Math.max(Z,0),Ca=Math.max(Ca,+0));if(ka||X.width<wa||X.height<sa)b.view.scaleAndTranslate(Y,Math.floor(Z-ua.x),Math.floor(Ca-ua.y)),b.container.scrollTop=na*Y/la,b.container.scrollLeft=za*Y/la;else if(0!=ia||0!=ja)X=b.view.translate,b.view.setTranslate(Math.floor(X.x+ia/la),Math.floor(X.y+ja/la))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var p=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",p);this.destroyFunctions.push(function(){mxEvent.removeListener(window,+"resize",p)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(Y){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(Y){b.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var u=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left=b.isViewer()?"0":"50%";this.chromelessToolbar.style.backgroundColor="#000000";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var n=-mxUtils.bind(this,function(){var Y=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=Y?parseInt(Y["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",n);n();var y=0;n=mxUtils.bind(this,function(Y,Z,ia){y++;var ka=document.createElement("span");ka.style.paddingLeft="8px";ka.style.paddingRight="8px";ka.style.cursor="pointer";mxEvent.addListener(ka,-"click",Y);null!=ia&&ka.setAttribute("title",ia);Y=document.createElement("img");Y.setAttribute("border","0");Y.setAttribute("src",Z);Y.style.width="36px";Y.style.filter="invert(100%)";ka.appendChild(Y);this.chromelessToolbar.appendChild(ka);return ka});if(null!=v.backBtn){var C=Graph.sanitizeLink(v.backBtn.url);null!=C&&n(mxUtils.bind(this,function(Y){window.location.href=C;mxEvent.consume(Y)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var P=n(mxUtils.bind(this,+mxUtils.bind(this,function(){var Y=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=Y?parseInt(Y["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",n);n();var y=0;n=mxUtils.bind(this,function(Y,Z,ia){y++;var ja=document.createElement("span");ja.style.paddingLeft="8px";ja.style.paddingRight="8px";ja.style.cursor="pointer";mxEvent.addListener(ja,+"click",Y);null!=ia&&ja.setAttribute("title",ia);Y=document.createElement("img");Y.setAttribute("border","0");Y.setAttribute("src",Z);Y.style.width="36px";Y.style.filter="invert(100%)";ja.appendChild(Y);this.chromelessToolbar.appendChild(ja);return ja});if(null!=u.backBtn){var B=Graph.sanitizeLink(u.backBtn.url);null!=B&&n(mxUtils.bind(this,function(Y){window.location.href=B;mxEvent.consume(Y)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var P=n(mxUtils.bind(this,function(Y){this.actions.get("previousPage").funct();mxEvent.consume(Y)}),Editor.chevronLeftImage,mxResources.get("previousPage")),G=document.createElement("div");G.style.fontFamily=Editor.defaultHtmlFont;G.style.display="inline-block";G.style.verticalAlign="top";G.style.fontWeight="bold";G.style.marginTop="8px";G.style.fontSize="14px";G.style.cursor="default";G.style.color="#ffffff";this.chromelessToolbar.appendChild(G);var O=n(mxUtils.bind(this,function(Y){this.actions.get("nextPage").funct();mxEvent.consume(Y)}),Editor.chevronRightImage,mxResources.get("nextPage")),U=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){G.innerText="";var Y=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(G,Y+1+" / "+this.pages.length);G.setAttribute("title",mxResources.get("currentPage")+": "+this.currentPage.getName());P.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(Y-1,this.pages.length)].getName());O.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(Y+1,this.pages.length)].getName())}});P.style.paddingLeft="0px";P.style.paddingRight="4px";O.style.paddingLeft="4px";O.style.paddingRight="0px";var c=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(O.style.display="",P.style.display="",G.style.display="inline-block"):(O.style.display="none",P.style.display="none",G.style.display="none");U()});if(null!=this.menus){var f=this.menus.get("pages");null!=f&&mxEvent.addListener(G,"click",mxUtils.bind(this,function(Y){var Z=new mxPopupMenu(f.funct);Z.smartSeparators=!0;Z.showDisabled=!0;Z.autoExpand=!0;Z.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(Z,arguments);Z.destroy()});var ia=mxUtils.getOffset(G);Z.popup(ia.x,ia.y+G.offsetHeight,null,Y);mxEvent.addListener(Z.div,"mouseleave",mxUtils.bind(this,function(){Z.hideMenu()}))}))}this.editor.addListener("resetGraphView",c);this.editor.addListener("pageSelected",U)}n(mxUtils.bind(this,function(Y){this.actions.get("zoomOut").funct();mxEvent.consume(Y)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");n(mxUtils.bind(this,function(Y){this.actions.get("zoomIn").funct();mxEvent.consume(Y)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");n(mxUtils.bind(this,function(Y){this.actions.get("smartFit").funct();mxEvent.consume(Y)}),Editor.zoomFitImage,mxResources.get("fit"));var k=null,q=null,x=mxUtils.bind(this,function(Y){null!=k&&(window.clearTimeout(k),k=null);null!=q&&(window.clearTimeout(q),-q=null);k=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);k=null;q=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";q=null}),600)}),Y||200)}),B=mxUtils.bind(this,function(Y){null!=k&&(window.clearTimeout(k),k=null);null!=q&&(window.clearTimeout(q),q=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,Y||30)});if("1"==urlParams.layers){this.layersDialog=null;var E=n(mxUtils.bind(this,+q=null);k=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);k=null;q=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";q=null}),600)}),Y||200)}),C=mxUtils.bind(this,function(Y){null!=k&&(window.clearTimeout(k),k=null);null!=q&&(window.clearTimeout(q),q=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,Y||30)});if("1"==urlParams.layers){this.layersDialog=null;var E=n(mxUtils.bind(this,function(Y){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=b.createLayersDialog(mxUtils.bind(this,function(){this.chromelessResize&&this.chromelessResize()}),!0);mxEvent.addListener(this.layersDialog,"mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog);this.layersDialog=null}));var Z=E.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius","5px");this.layersDialog.style.position="fixed";this.layersDialog.style.fontFamily=Editor.defaultHtmlFont;this.layersDialog.style.width="160px";this.layersDialog.style.padding="4px 2px 4px 2px";this.layersDialog.style.left=Z.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";this.layersDialog.style.backgroundColor="#000000";this.layersDialog.style.color="#ffffff";mxUtils.setOpacity(this.layersDialog,80);Z=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=Z.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(Y)}),Editor.layersImage,mxResources.get("layers")),L=b.getModel();L.addListener(mxEvent.CHANGE,function(){E.style.display=1<L.getChildCount(L.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(n);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||n(mxUtils.bind(this,function(Y){if(null!=this.editor.editButtonFunc)this.editor.editButtonFunc();else if("_blank"==this.editor.editButtonLink){var Z=null!=this.currentPage?this.currentPage.getId():null;this.editor.editAsNew(this.getEditBlankXml(),null,null,Z)}else b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(Y)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(c=0;c<this.lightboxToolbarActions.length;c++){var Q=this.lightboxToolbarActions[c];Q.elem=n(Q.fn,Q.icon,Q.tooltip)}if(null!=-v.refreshBtn){var V=null==v.refreshBtn.url?null:Graph.sanitizeLink(v.refreshBtn.url);n(mxUtils.bind(this,function(Y){null!=V?window.location.href=V:window.location.reload();mxEvent.consume(Y)}),Editor.refreshImage,mxResources.get("refresh",null,"Refresh"))}null!=v.fullscreenBtn&&window.self!==window.top&&n(mxUtils.bind(this,function(Y){v.fullscreenBtn.url?b.openLink(v.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(Y)}),Editor.fullscreenImage,mxResources.get("openInNewWindow",-null,"Open in New Window"));!v.noCloseBtn&&(v.closeBtn&&window.self===window.top||b.lightbox&&("1"==urlParams.close||this.container!=document.body))&&n(mxUtils.bind(this,function(Y){"1"==urlParams.close||v.closeBtn?window.close():(this.destroy(),mxEvent.consume(Y))}),Editor.closeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";b.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");b.container.appendChild(this.chromelessToolbar);-mxEvent.addListener(b.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(Y){mxEvent.isTouchEvent(Y)||(mxEvent.isShiftDown(Y)||B(30),x())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(Y){mxEvent.consume(Y)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(Y){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(Y)?x():B(100)}));mxEvent.addListener(this.chromelessToolbar,-"mousemove",mxUtils.bind(this,function(Y){mxEvent.isShiftDown(Y)?x():B(100);mxEvent.consume(Y)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(Y){mxEvent.isTouchEvent(Y)||B(30)}));var K=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(Y,Z){this.startX=Z.getGraphX();this.startY=Z.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(Y,Z){},mouseUp:function(Y,-Z){mxEvent.isTouchEvent(Z.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<K&&Math.abs(this.scrollTop-b.container.scrollTop)<K&&Math.abs(this.startX-Z.getGraphX())<K&&Math.abs(this.startY-Z.getGraphY())<K&&(0<parseFloat(m.chromelessToolbar.style.opacity||0)?x():B(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var fa=b.view.validate,aa=new mxPoint,da=!1,ba=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=+u.refreshBtn){var V=null==u.refreshBtn.url?null:Graph.sanitizeLink(u.refreshBtn.url);n(mxUtils.bind(this,function(Y){null!=V?window.location.href=V:window.location.reload();mxEvent.consume(Y)}),Editor.refreshImage,mxResources.get("refresh",null,"Refresh"))}null!=u.fullscreenBtn&&window.self!==window.top&&n(mxUtils.bind(this,function(Y){u.fullscreenBtn.url?b.openLink(u.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(Y)}),Editor.fullscreenImage,mxResources.get("openInNewWindow",+null,"Open in New Window"));!u.noCloseBtn&&(u.closeBtn&&window.self===window.top||b.lightbox&&("1"==urlParams.close||this.container!=document.body))&&n(mxUtils.bind(this,function(Y){"1"==urlParams.close||u.closeBtn?window.close():(this.destroy(),mxEvent.consume(Y))}),Editor.closeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";b.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");b.container.appendChild(this.chromelessToolbar);+mxEvent.addListener(b.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(Y){mxEvent.isTouchEvent(Y)||(mxEvent.isShiftDown(Y)||C(30),x())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(Y){mxEvent.consume(Y)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(Y){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(Y)?x():C(100)}));mxEvent.addListener(this.chromelessToolbar,+"mousemove",mxUtils.bind(this,function(Y){mxEvent.isShiftDown(Y)?x():C(100);mxEvent.consume(Y)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(Y){mxEvent.isTouchEvent(Y)||C(30)}));var K=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(Y,Z){this.startX=Z.getGraphX();this.startY=Z.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(Y,Z){},mouseUp:function(Y,+Z){mxEvent.isTouchEvent(Z.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<K&&Math.abs(this.scrollTop-b.container.scrollTop)<K&&Math.abs(this.startX-Z.getGraphX())<K&&Math.abs(this.startY-Z.getGraphY())<K&&(0<parseFloat(m.chromelessToolbar.style.opacity||0)?x():C(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var fa=b.view.validate,aa=new mxPoint,da=!1,ba=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=m.currentPage&&ba!=m.currentPage){ba=m.currentPage;da=!0;var Y=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,!0);null==Y&&(Y=new mxRectangle(b.view.translate.x*b.view.scale,b.view.translate.y*b.view.scale));Y=b.getPageLayout(Y,aa,1);var Z=b.getDefaultTranslate(Y);this.x0=Y.x;this.y0=Y.y;if(Z.x!=this.translate.x||Z.y!=this.translate.y)this.invalidate(),this.translate.x=Z.x,this.translate.y=Z.y}Z=b.getPagePadding();var ia=b.getPageSize();Y=Z.x-(this.x0||0)*ia.width;Z=Z.y-(this.y0||0)*ia.height;-if(this.translate.x!=Y||this.translate.y!=Z)this.invalidate(),this.translate.x=Y,this.translate.y=Z}fa.apply(this,arguments)};if(!b.isViewer()){var ha=b.sizeDidChange;b.sizeDidChange=function(){var Y=da;da=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var Z=this.getPageLayout(),ia=this.getDefaultTranslate(Z),ka=this.view.translate.x,X=this.view.translate.y;if(ia.x!=ka||ia.y!=X){this.view.x0=Z.x;this.view.y0=Z.y;this.autoTranslate=-!0;this.view.setTranslate(ia.x,ia.y);this.autoTranslate=!1;Y||(this.container.scrollLeft+=Math.round((ia.x-ka)*this.view.scale),this.container.scrollTop+=Math.round((ia.y-X)*this.view.scale));return}}ha.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var qa=b.view.getBackgroundPane(),ra=b.view.getDrawPane();b.cumulativeZoomFactor=1;var l=null,t=null,H=null,J=null,R=null,T=function(Y){null!=l&&window.clearTimeout(l);0<=Y&&window.setTimeout(function(){if(!b.isMouseDown||+if(this.translate.x!=Y||this.translate.y!=Z)this.invalidate(),this.translate.x=Y,this.translate.y=Z}fa.apply(this,arguments)};if(!b.isViewer()){var ha=b.sizeDidChange;b.sizeDidChange=function(){var Y=da;da=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var Z=this.getPageLayout(),ia=this.getDefaultTranslate(Z),ja=this.view.translate.x,X=this.view.translate.y;if(ia.x!=ja||ia.y!=X){this.view.x0=Z.x;this.view.y0=Z.y;this.autoTranslate=+!0;this.view.setTranslate(ia.x,ia.y);this.autoTranslate=!1;Y||(this.container.scrollLeft+=Math.round((ia.x-ja)*this.view.scale),this.container.scrollTop+=Math.round((ia.y-X)*this.view.scale));return}}ha.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var qa=b.view.getBackgroundPane(),ra=b.view.getDrawPane();b.cumulativeZoomFactor=1;var l=null,t=null,H=null,J=null,R=null,T=function(Y){null!=l&&window.clearTimeout(l);0<=Y&&window.setTimeout(function(){if(!b.isMouseDown||J)l=window.setTimeout(mxUtils.bind(this,function(){if(b.isFastZoomEnabled()){null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node&&(mxUtils.setPrefixedStyle(b.view.backgroundPageShape.node.style,"transform-origin",null),mxUtils.setPrefixedStyle(b.view.backgroundPageShape.node.style,"transform",null));ra.style.transformOrigin="";qa.style.transformOrigin="";mxClient.IS_SF?(ra.style.transform="scale(1)",qa.style.transform="scale(1)",window.setTimeout(function(){ra.style.transform=-"";qa.style.transform=""},0)):(ra.style.transform="",qa.style.transform="");b.view.getDecoratorPane().style.opacity="";b.view.getOverlayPane().style.opacity="";for(var Z=b.container.querySelectorAll(".geHint"),ia=0;ia<Z.length;ia++)Z[ia].style.opacity=""}Z=new mxPoint(b.container.scrollLeft,b.container.scrollTop);var ka=mxUtils.getOffset(b.container),X=b.view.scale;ia=b.view.translate.x;var ja=b.view.translate.y,na=0,la=0;null!=t&&(na=b.container.offsetWidth/2-t.x+ka.x,la=b.container.offsetHeight/-2-t.y+ka.y);var va=null==d&&mxUtils.hasScrollbars(b.container);b.zoom(b.cumulativeZoomFactor,va?!1:null,b.isFastZoomEnabled()?20:null,va);var za=b.view.scale;za!=X&&(va?(X=za/X,na=null!=t?t.x-ka.x:b.container.clientWidth/2,ka=null!=t?t.y-ka.y:b.container.clientHeight/2,null!=H&&(na-=Z.x-H.x,ka-=Z.y-H.y),b.container.scrollLeft=Math.round(Z.x*X+na*(X-1)+(b.view.translate.x-ia)*za),b.container.scrollTop=Math.round(Z.y*X+ka*(X-1)+(b.view.translate.y-ja)*za)):(null!=H&&(na+=Z.x-H.x,la+=Z.y-H.y),null!=-d&&m.chromelessResize(!1,null,na*(b.cumulativeZoomFactor-1),la*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||0==na&&0==la||(b.container.scrollLeft-=na*(b.cumulativeZoomFactor-1),b.container.scrollTop-=la*(b.cumulativeZoomFactor-1))));null!=R&&ra.setAttribute("filter",R);b.fireEvent(new mxEventObject("zoomPreviewComplete"));b.cumulativeZoomFactor=1;R=J=t=H=l=null}),null!=Y?Y:b.isFastZoomEnabled()?m.wheelZoomDelay:m.lazyZoomDelay)},0)};b.lazyZoom=function(Y,Z,ia,ka){ka=null!=ka?ka:-this.zoomFactor;(Z=Z||!b.scrollbars)&&(t=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+b.container.clientHeight/2));Y?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=ka,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:-(this.cumulativeZoomFactor/=ka,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale);this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,160))/this.view.scale;if(b.isFastZoomEnabled()){null==R&&""!=ra.getAttribute("filter")&&(R=ra.getAttribute("filter"),ra.removeAttribute("filter"));H=new mxPoint(b.container.scrollLeft,b.container.scrollTop);Y=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/-100*20)/(20*this.view.scale);ka=Z||null==t?b.container.scrollLeft+b.container.clientWidth/2:t.x+b.container.scrollLeft-b.container.offsetLeft;var X=Z||null==t?b.container.scrollTop+b.container.clientHeight/2:t.y+b.container.scrollTop-b.container.offsetTop;ra.style.transformOrigin=ka+"px "+X+"px";ra.style.transform="scale("+Y+")";qa.style.transformOrigin=ka+"px "+X+"px";qa.style.transform="scale("+Y+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ka=b.view.backgroundPageShape.node,-mxUtils.setPrefixedStyle(ka.style,"transform-origin",(Z||null==t?b.container.clientWidth/2+b.container.scrollLeft-ka.offsetLeft+"px":t.x+b.container.scrollLeft-ka.offsetLeft-b.container.offsetLeft+"px")+" "+(Z||null==t?b.container.clientHeight/2+b.container.scrollTop-ka.offsetTop+"px":t.y+b.container.scrollTop-ka.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(ka.style,"transform","scale("+Y+")")):b.view.validateBackgroundStyles(Y,ka,X);b.view.getDecoratorPane().style.opacity="0";-b.view.getOverlayPane().style.opacity="0";Z=b.container.querySelectorAll(".geHint");for(ka=0;ka<Z.length;ka++)Z[ka].style.opacity="0";b.fireEvent(new mxEventObject("zoomPreview","factor",Y))}T(b.isFastZoomEnabled()?ia:0)};mxEvent.addGestureListeners(b.container,function(Y){null!=l&&window.clearTimeout(l)},null,function(Y){1!=b.cumulativeZoomFactor&&T(0)});mxEvent.addListener(b.container,"scroll",function(Y){null==l||b.isMouseDown||1==b.cumulativeZoomFactor||T(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,-function(Y,Z,ia,ka,X){b.fireEvent(new mxEventObject("wheel"));if(null==b.freehand||!b.freehand.isDrawing())if(Editor.passiveScroll&&!ia&&b.isScrollWheelEvent(Y))null!=window.parent&&window.parent!=window&&window.parent.postMessage(JSON.stringify({event:"scrollWheel",deltaX:null!=Y.deltaX?Y.deltaX:0,deltaY:null!=Y.deltaY?Y.deltaY:Z?-60:60}),"*");else if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!ia&&b.isScrollWheelEvent(Y))ka=b.view.getTranslate(),X=40/b.view.scale,mxEvent.isShiftDown(Y)?-b.view.setTranslate(ka.x+(Z?-X:X),ka.y):b.view.setTranslate(ka.x,ka.y+(Z?X:-X));else if(ia||b.isZoomWheelEvent(Y))for(var ja=mxEvent.getSource(Y);null!=ja;){if(ja==b.container){b.tooltipHandler.hideTooltip();ka=null!=ka&&null!=X?new mxPoint(ka,X):new mxPoint(mxEvent.getClientX(Y),mxEvent.getClientY(Y));X=null!=t?new mxPoint(t.x,t.y):null;ja=b.cumulativeZoomFactor;t=ka;J=ia;ia=b.zoomFactor;var na=null;Y.ctrlKey&&null!=Y.deltaY&&40>Math.abs(Y.deltaY)&&Math.round(Y.deltaY)!=Y.deltaY?ia=1+Math.abs(Y.deltaY)/-20*(ia-1):null!=Y.movementY&&"pointermove"==Y.type&&(ia=1+Math.max(1,Math.abs(Y.movementY))/20*(ia-1),na=-1);b.lazyZoom(Z,null,na,ia);null!=X&&1!=ja&&b.isFastZoomEnabled()&&b.scrollbars&&(Z=b.cumulativeZoomFactor,ia=Z/ja,na=1-Z,.001<Math.abs(na)&&(t=new mxPoint((ka.x*(1-ia)+ia*X.x*(1-ja))/na,(ka.y*(1-ia)+ia*X.y*(1-ja))/na),ka=t.x+b.container.scrollLeft-b.container.offsetLeft,X=t.y+b.container.scrollTop-b.container.offsetTop,ra.style.transformOrigin=ka+"px "+X+"px",qa.style.transformOrigin=ka+"px "+-X+"px",null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(Z=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(Z.style,"transform-origin",t.x+b.container.scrollLeft-Z.offsetLeft-b.container.offsetLeft+"px "+(t.y+b.container.scrollTop-Z.offsetTop-b.container.offsetTop)+"px")):b.view.validateBackgroundStyles(Math.round(Math.round(b.view.scale*Z*100)/100*20)/(20*b.view.scale),ka,X)));mxEvent.consume(Y);return!1}ja=ja.parentNode}}),b.container);b.panningHandler.zoomGraph=function(Y){b.cumulativeZoomFactor=+"";qa.style.transform=""},0)):(ra.style.transform="",qa.style.transform="");b.view.getDecoratorPane().style.opacity="";b.view.getOverlayPane().style.opacity="";for(var Z=b.container.querySelectorAll(".geHint"),ia=0;ia<Z.length;ia++)Z[ia].style.opacity=""}Z=new mxPoint(b.container.scrollLeft,b.container.scrollTop);var ja=mxUtils.getOffset(b.container),X=b.view.scale;ia=b.view.translate.x;var ka=b.view.translate.y,na=0,la=0;null!=t&&(na=b.container.offsetWidth/2-t.x+ja.x,la=b.container.offsetHeight/+2-t.y+ja.y);var ua=null==d&&mxUtils.hasScrollbars(b.container);b.zoom(b.cumulativeZoomFactor,ua?!1:null,b.isFastZoomEnabled()?20:null,ua);var za=b.view.scale;za!=X&&(ua?(X=za/X,na=null!=t?t.x-ja.x:b.container.clientWidth/2,ja=null!=t?t.y-ja.y:b.container.clientHeight/2,null!=H&&(na-=Z.x-H.x,ja-=Z.y-H.y),b.container.scrollLeft=Math.round(Z.x*X+na*(X-1)+(b.view.translate.x-ia)*za),b.container.scrollTop=Math.round(Z.y*X+ja*(X-1)+(b.view.translate.y-ka)*za)):(null!=H&&(na+=Z.x-H.x,la+=Z.y-H.y),null!=+d&&m.chromelessResize(!1,null,na*(b.cumulativeZoomFactor-1),la*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||0==na&&0==la||(b.container.scrollLeft-=na*(b.cumulativeZoomFactor-1),b.container.scrollTop-=la*(b.cumulativeZoomFactor-1))));null!=R&&ra.setAttribute("filter",R);b.fireEvent(new mxEventObject("zoomPreviewComplete"));b.cumulativeZoomFactor=1;R=J=t=H=l=null}),null!=Y?Y:b.isFastZoomEnabled()?m.wheelZoomDelay:m.lazyZoomDelay)},0)};b.lazyZoom=function(Y,Z,ia,ja){ja=null!=ja?ja:+this.zoomFactor;(Z=Z||!b.scrollbars)&&(t=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+b.container.clientHeight/2));Y?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=ja,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:+(this.cumulativeZoomFactor/=ja,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale);this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,160))/this.view.scale;if(b.isFastZoomEnabled()){null==R&&""!=ra.getAttribute("filter")&&(R=ra.getAttribute("filter"),ra.removeAttribute("filter"));H=new mxPoint(b.container.scrollLeft,b.container.scrollTop);Y=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/+100*20)/(20*this.view.scale);ja=Z||null==t?b.container.scrollLeft+b.container.clientWidth/2:t.x+b.container.scrollLeft-b.container.offsetLeft;var X=Z||null==t?b.container.scrollTop+b.container.clientHeight/2:t.y+b.container.scrollTop-b.container.offsetTop;ra.style.transformOrigin=ja+"px "+X+"px";ra.style.transform="scale("+Y+")";qa.style.transformOrigin=ja+"px "+X+"px";qa.style.transform="scale("+Y+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ja=b.view.backgroundPageShape.node,+mxUtils.setPrefixedStyle(ja.style,"transform-origin",(Z||null==t?b.container.clientWidth/2+b.container.scrollLeft-ja.offsetLeft+"px":t.x+b.container.scrollLeft-ja.offsetLeft-b.container.offsetLeft+"px")+" "+(Z||null==t?b.container.clientHeight/2+b.container.scrollTop-ja.offsetTop+"px":t.y+b.container.scrollTop-ja.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(ja.style,"transform","scale("+Y+")")):b.view.validateBackgroundStyles(Y,ja,X);b.view.getDecoratorPane().style.opacity="0";+b.view.getOverlayPane().style.opacity="0";Z=b.container.querySelectorAll(".geHint");for(ja=0;ja<Z.length;ja++)Z[ja].style.opacity="0";b.fireEvent(new mxEventObject("zoomPreview","factor",Y))}T(b.isFastZoomEnabled()?ia:0)};mxEvent.addGestureListeners(b.container,function(Y){null!=l&&window.clearTimeout(l)},null,function(Y){1!=b.cumulativeZoomFactor&&T(0)});mxEvent.addListener(b.container,"scroll",function(Y){null==l||b.isMouseDown||1==b.cumulativeZoomFactor||T(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,+function(Y,Z,ia,ja,X){b.fireEvent(new mxEventObject("wheel"));if(null==b.freehand||!b.freehand.isDrawing())if(Editor.passiveScroll&&!ia&&b.isScrollWheelEvent(Y))null!=window.parent&&window.parent!=window&&window.parent.postMessage(JSON.stringify({event:"scrollWheel",deltaX:null!=Y.deltaX?Y.deltaX:0,deltaY:null!=Y.deltaY?Y.deltaY:Z?-60:60}),"*");else if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!ia&&b.isScrollWheelEvent(Y))ja=b.view.getTranslate(),X=40/b.view.scale,mxEvent.isShiftDown(Y)?+b.view.setTranslate(ja.x+(Z?-X:X),ja.y):b.view.setTranslate(ja.x,ja.y+(Z?X:-X));else if(ia||b.isZoomWheelEvent(Y))for(var ka=mxEvent.getSource(Y);null!=ka;){if(ka==b.container){b.tooltipHandler.hideTooltip();ja=null!=ja&&null!=X?new mxPoint(ja,X):new mxPoint(mxEvent.getClientX(Y),mxEvent.getClientY(Y));X=null!=t?new mxPoint(t.x,t.y):null;ka=b.cumulativeZoomFactor;t=ja;J=ia;ia=b.zoomFactor;var na=null;Y.ctrlKey&&null!=Y.deltaY&&40>Math.abs(Y.deltaY)&&Math.round(Y.deltaY)!=Y.deltaY?ia=1+Math.abs(Y.deltaY)/+20*(ia-1):null!=Y.movementY&&"pointermove"==Y.type&&(ia=1+Math.max(1,Math.abs(Y.movementY))/20*(ia-1),na=-1);b.lazyZoom(Z,null,na,ia);null!=X&&1!=ka&&b.isFastZoomEnabled()&&b.scrollbars&&(Z=b.cumulativeZoomFactor,ia=Z/ka,na=1-Z,.001<Math.abs(na)&&(t=new mxPoint((ja.x*(1-ia)+ia*X.x*(1-ka))/na,(ja.y*(1-ia)+ia*X.y*(1-ka))/na),ja=t.x+b.container.scrollLeft-b.container.offsetLeft,X=t.y+b.container.scrollTop-b.container.offsetTop,ra.style.transformOrigin=ja+"px "+X+"px",qa.style.transformOrigin=ja+"px "++X+"px",null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(Z=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(Z.style,"transform-origin",t.x+b.container.scrollLeft-Z.offsetLeft-b.container.offsetLeft+"px "+(t.y+b.container.scrollTop-Z.offsetTop-b.container.offsetTop)+"px")):b.view.validateBackgroundStyles(Math.round(Math.round(b.view.scale*Z*100)/100*20)/(20*b.view.scale),ja,X)));mxEvent.consume(Y);return!1}ka=ka.parentNode}}),b.container);b.panningHandler.zoomGraph=function(Y){b.cumulativeZoomFactor=Y.scale;b.lazyZoom(0<Y.scale,!0);mxEvent.consume(Y)}};EditorUi.prototype.addChromelessToolbarItems=function(b){"1"!=urlParams.noPrint&&b(mxUtils.bind(this,function(d){this.actions.get("print").funct();mxEvent.consume(d)}),Editor.printImage,mxResources.get("print"))};EditorUi.prototype.isPagesEnabled=function(){return this.editor.editable||"1"!=urlParams["hide-pages"]};EditorUi.prototype.createTemporaryGraph=function(b){return Graph.createOffscreenGraph(b)};EditorUi.prototype.addChromelessClickHandler=function(){var b=urlParams.highlight;null!=b&&0<b.length&&(b="#"+b);this.editor.graph.addClickHandler(b)};EditorUi.prototype.toggleFormatPanel=function(b){b=null!=b?b:0==this.formatWidth;if(null!=this.format){var d=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.formatContainer.style,"transition","width "+d+"s ease-in-out");window.setTimeout(mxUtils.bind(this,function(){this.formatWidth=b?240:0;this.hsplitPosition=Math.min(this.container.clientWidth-this.hsplit.clientWidth-this.formatWidth,this.hsplitPosition);this.refresh();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.formatContainer.style,@@ -2292,7 +2292,7 @@ EditorUi.prototype.toggleFormatPanel=function(b){b=null!=b?b:0==this.formatWidthEditorUi.prototype.isDiagramEmpty=function(){var b=this.editor.graph.getModel();return 1==b.getChildCount(b.root)&&0==b.getChildCount(b.getChildAt(b.root,0))};EditorUi.prototype.isSelectionAllowed=function(b){return"SELECT"==mxEvent.getSource(b).nodeName||"INPUT"==mxEvent.getSource(b).nodeName};EditorUi.prototype.addBeforeUnloadListener=function(){window.onbeforeunload=mxUtils.bind(this,function(){if(!this.editor.isChromelessView())return this.onBeforeUnload()})};EditorUi.prototype.onBeforeUnload=function(){if(this.editor.modified)return mxResources.get("allChangesLost")};EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(b,d){try{var m=mxUtils.parseXml(b);this.editor.setGraphXml(m.documentElement);this.editor.setModified(!1);this.editor.undoManager.clear();null!=d&&(this.editor.setFilename(d),this.updateDocumentTitle())}catch(p){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+p.message)}}))}catch(b){}this.editor.graph.view.validate();this.editor.graph.sizeDidChange();-this.editor.fireEvent(new mxEventObject("resetGraphView"))};EditorUi.prototype.showPrintDialog=function(b,d){this.showDialog((new PrintDialog(this,b,d)).container,300,180,!0,!0)};EditorUi.prototype.showPopupMenu=function(b,d,m,p){this.editor.graph.popupMenuHandler.hideMenu();var v=new mxPopupMenu(b);v.smartSeparators=!0;v.showDisabled=!0;v.autoExpand=!0;v.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(v,arguments);v.destroy()});v.popup(d,m,null,p);this.setCurrentMenu(v)};+this.editor.fireEvent(new mxEventObject("resetGraphView"))};EditorUi.prototype.showPrintDialog=function(b,d){this.showDialog((new PrintDialog(this,b,d)).container,300,180,!0,!0)};EditorUi.prototype.showPopupMenu=function(b,d,m,p){this.editor.graph.popupMenuHandler.hideMenu();var u=new mxPopupMenu(b);u.smartSeparators=!0;u.showDisabled=!0;u.autoExpand=!0;u.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(u,arguments);u.destroy()});u.popup(d,m,null,p);this.setCurrentMenu(u)};EditorUi.prototype.isHideCurrentMenuEvent=function(b){b=mxEvent.getSource(b);if(null!=this.currentMenu){if(b==this.currentMenu.div)return!1;for(var d=this.currentMenu.activeRow;null!=d;){if(b==d.div)return!1;d=d.activeRow}return!0}return!1};EditorUi.prototype.setCurrentMenu=function(b,d){this.currentMenuElt=d;this.currentMenu=b;this.hideShapePicker()};EditorUi.prototype.resetCurrentMenu=function(){this.currentMenu=this.currentMenuElt=null};EditorUi.prototype.hideCurrentMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.resetCurrentMenu())};EditorUi.prototype.updateDocumentTitle=function(){var b=this.editor.getOrCreateFilename();null!=this.editor.appName&&(b+=" - "+this.editor.appName);document.title=b};EditorUi.prototype.createHoverIcons=function(){return new HoverIcons(this.editor.graph)};EditorUi.prototype.createInlineToolbar=function(){return null};EditorUi.prototype.redo=function(){try{this.editor.graph.isEditing()?document.execCommand("redo",!1,null):this.editor.undoManager.redo()}catch(b){}};EditorUi.prototype.undo=function(){try{var b=this.editor.graph;if(b.isEditing()){var d=b.cellEditor.textarea.innerHTML;document.execCommand("undo",!1,null);d==b.cellEditor.textarea.innerHTML&&(b.stopEditing(!0),this.editor.undoManager.undo())}else this.editor.undoManager.undo()}catch(m){}};@@ -2300,26 +2300,26 @@ EditorUi.prototype.canRedo=function(){return this.editor.graph.isEditing()||thisEditorUi.prototype.getEditBlankXml=function(){return mxUtils.getXml(this.editor.getGraphXml())};EditorUi.prototype.getUrl=function(b){b=null!=b?b:window.location.pathname;var d=0<b.indexOf("?")?1:0,m;for(m in urlParams)b=0==d?b+"?":b+"&",b+=m+"="+urlParams[m],d++;return b};EditorUi.prototype.setScrollbars=function(b){var d=this.editor.graph,m=d.container.style.overflow;d.scrollbars=b;this.editor.updateGraphComponents();m!=d.container.style.overflow&&(d.container.scrollTop=0,d.container.scrollLeft=0,d.view.scaleAndTranslate(1,0,0),this.resetScrollbars());this.fireEvent(new mxEventObject("scrollbarsChanged"))};EditorUi.prototype.initialFitDiagram=function(b){var d=null!=urlParams.border?parseInt(urlParams.border):10;d=new mxRectangle(d,d,d,d);this.fitDiagramOrPages(null!=b?b:1,d,!0)};EditorUi.prototype.fitDiagramOrPages=function(b,d,m){var p=this.editor.graph;p.pageVisible&&p.isSelectionEmpty()&&!m?p.fitPages(b):this.fitDiagramToWindow(b,d,m)};-EditorUi.prototype.fitDiagramToWindow=function(b,d,m){var p=this.editor.graph,v=p.isSelectionEmpty()?mxRectangle.fromRectangle(p.getGraphBounds()):p.getBoundingBox(p.getSelectionCells());if(null!=v){var n=p.view.translate,y=p.view.scale;v.x=v.x/y-n.x;v.y=v.y/y-n.y;v.width/=y;v.height/=y;null!=p.backgroundImage&&v.add(new mxRectangle(0,0,p.backgroundImage.width,p.backgroundImage.height));0==v.width||0==v.height?(p.zoomTo(1),this.resetScrollbars()):(d=null!=d?d:Editor.fitWindowBorders,null!=d&&(v.x-=-d.x,v.y-=d.y,v.width+=d.width+d.x,v.height+=d.height+d.y),p.fitWindow(v,null,b,m,m))}};EditorUi.prototype.hasScrollbars=function(){return this.editor.graph.scrollbars};+EditorUi.prototype.fitDiagramToWindow=function(b,d,m){var p=this.editor.graph,u=p.isSelectionEmpty()?mxRectangle.fromRectangle(p.getGraphBounds()):p.getBoundingBox(p.getSelectionCells());if(null!=u){var n=p.view.translate,y=p.view.scale;u.x=u.x/y-n.x;u.y=u.y/y-n.y;u.width/=y;u.height/=y;null!=p.backgroundImage&&u.add(new mxRectangle(0,0,p.backgroundImage.width,p.backgroundImage.height));0==u.width||0==u.height?(p.zoomTo(1),this.resetScrollbars()):(d=null!=d?d:Editor.fitWindowBorders,null!=d&&(u.x-=+d.x,u.y-=d.y,u.width+=d.width+d.x,u.height+=d.height+d.y),p.fitWindow(u,null,b,m,m))}};EditorUi.prototype.hasScrollbars=function(){return this.editor.graph.scrollbars};EditorUi.prototype.resetScrollbars=function(){var b=this.editor.graph,d=b.container;if(!this.editor.extendCanvas)d.scrollTop=0,d.scrollLeft=0,mxUtils.hasScrollbars(d)||b.view.setTranslate(0,0);else if(!this.editor.isChromelessView())if(mxUtils.hasScrollbars(d))if(b.pageVisible){var m=b.getPagePadding();d.scrollTop=Math.floor(m.y);d.scrollLeft=Math.floor(Math.min(m.x,(d.scrollWidth-d.clientWidth)/2));m=b.getGraphBounds();0<m.width&&0<m.height&&(m.x>d.scrollLeft+.9*d.clientWidth&&(d.scrollLeft=Math.min(m.x+m.width-d.clientWidth,m.x-10)),m.y>d.scrollTop+.9*d.clientHeight&&(d.scrollTop=Math.min(m.y+m.height-d.clientHeight,m.y-10)))}else if(m=b.getGraphBounds(),0==m.width&&0==m.height)d.scrollLeft=(d.scrollWidth-d.clientWidth)/2,d.scrollTop=(d.scrollHeight-d.clientHeight)/2;else{var p=Math.max(m.height,b.scrollTileSize.height*b.view.scale);d.scrollLeft=Math.floor(Math.max(0,m.x-Math.max(0,(d.clientWidth-Math.max(m.width,b.scrollTileSize.width*b.view.scale))/2)));d.scrollTop=Math.floor(Math.max(0,m.y-Math.max(20,-(d.clientHeight-p)/4)))}else{m=mxRectangle.fromRectangle(b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds());p=b.view.translate;var v=b.view.scale;m.x=m.x/v-p.x;m.y=m.y/v-p.y;m.width/=v;m.height/=v;p=b.pageVisible?0:Math.max(0,(d.clientHeight-m.height)/4);"1"==urlParams.embedInline?b.view.setTranslate(Math.floor(-m.x+2),Math.floor(p-m.y+1)):b.view.setTranslate(Math.floor(Math.max(0,(d.clientWidth-m.width)/2)-m.x+2),Math.floor(p-m.y+1))}};-EditorUi.prototype.setPageVisible=function(b){var d=this.editor.graph,m=mxUtils.hasScrollbars(d.container),p=0,v=0;m&&(p=d.view.translate.x*d.view.scale-d.container.scrollLeft,v=d.view.translate.y*d.view.scale-d.container.scrollTop);d.pageVisible=b;d.pageBreaksVisible=b;d.preferPageSize=b;d.view.validateBackground();if(m){var n=d.getSelectionCells();d.clearSelection();d.setSelectionCells(n)}d.sizeDidChange();m&&(d.container.scrollLeft=d.view.translate.x*d.view.scale-p,d.container.scrollTop=d.view.translate.y*-d.view.scale-v);d.defaultPageVisible=b;this.fireEvent(new mxEventObject("pageViewChanged"))};-EditorUi.prototype.installResizeHandler=function(b,d,m){d&&(b.window.setSize=function(v,n){if(!this.minimized){var y=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,C=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,P=this.getX(),G=this.getY(),O=P+v>y?Math.max(0,y-v):P,U=G+n>C?Math.max(0,C-n):G;O==P&&U==G||mxWindow.prototype.setLocation.call(this,O,U);v=Math.min(v,y);n=Math.min(n,C)}mxWindow.prototype.setSize.apply(this,arguments)});-b.window.setLocation=function(v,n){if(null!=this.div){var y=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,C=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,P=parseInt(this.div.style.width),G=parseInt(this.div.style.height);v=Math.max(0,Math.min(v,Math.max(0,y-P)));n=Math.max(0,Math.min(n,Math.max(0,C-G)));this.getX()==v&&this.getY()==n||mxWindow.prototype.setLocation.apply(this,arguments);d&&!this.minimized&&(y=Math.min(P,-y),C=Math.min(G,C),y==P&&C==G||this.setSize(y,C))}};var p=mxUtils.bind(this,function(){var v=b.window.getX(),n=b.window.getY();b.window.setLocation(v,n)});mxEvent.addListener(window,"resize",p);b.destroy=function(){mxEvent.removeListener(window,"resize",p);b.window.destroy();null!=m&&m()}};function ChangeGridColor(b,d){this.ui=b;this.color=d}ChangeGridColor.prototype.execute=function(){var b=this.ui.editor.graph.view.gridColor;this.ui.setGridColor(this.color);this.color=b};-function ChangePageSetup(b,d,m,p,v){this.ui=b;this.previousColor=this.color=d;this.previousImage=this.image=m;this.previousFormat=this.format=p;this.previousPageScale=this.pageScale=v;this.ignoreImage=this.ignoreColor=!1}+(d.clientHeight-p)/4)))}else{m=mxRectangle.fromRectangle(b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds());p=b.view.translate;var u=b.view.scale;m.x=m.x/u-p.x;m.y=m.y/u-p.y;m.width/=u;m.height/=u;p=b.pageVisible?0:Math.max(0,(d.clientHeight-m.height)/4);"1"==urlParams.embedInline?b.view.setTranslate(Math.floor(-m.x+2),Math.floor(p-m.y+1)):b.view.setTranslate(Math.floor(Math.max(0,(d.clientWidth-m.width)/2)-m.x+2),Math.floor(p-m.y+1))}};+EditorUi.prototype.setPageVisible=function(b){var d=this.editor.graph,m=mxUtils.hasScrollbars(d.container),p=0,u=0;m&&(p=d.view.translate.x*d.view.scale-d.container.scrollLeft,u=d.view.translate.y*d.view.scale-d.container.scrollTop);d.pageVisible=b;d.pageBreaksVisible=b;d.preferPageSize=b;d.view.validateBackground();if(m){var n=d.getSelectionCells();d.clearSelection();d.setSelectionCells(n)}d.sizeDidChange();m&&(d.container.scrollLeft=d.view.translate.x*d.view.scale-p,d.container.scrollTop=d.view.translate.y*+d.view.scale-u);d.defaultPageVisible=b;this.fireEvent(new mxEventObject("pageViewChanged"))};+EditorUi.prototype.installResizeHandler=function(b,d,m){d&&(b.window.setSize=function(u,n){if(!this.minimized){var y=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,B=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,P=this.getX(),G=this.getY(),O=P+u>y?Math.max(0,y-u):P,U=G+n>B?Math.max(0,B-n):G;O==P&&U==G||mxWindow.prototype.setLocation.call(this,O,U);u=Math.min(u,y);n=Math.min(n,B)}mxWindow.prototype.setSize.apply(this,arguments)});+b.window.setLocation=function(u,n){if(null!=this.div){var y=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,B=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,P=parseInt(this.div.style.width),G=parseInt(this.div.style.height);u=Math.max(0,Math.min(u,Math.max(0,y-P)));n=Math.max(0,Math.min(n,Math.max(0,B-G)));this.getX()==u&&this.getY()==n||mxWindow.prototype.setLocation.apply(this,arguments);d&&!this.minimized&&(y=Math.min(P,+y),B=Math.min(G,B),y==P&&B==G||this.setSize(y,B))}};var p=mxUtils.bind(this,function(){var u=b.window.getX(),n=b.window.getY();b.window.setLocation(u,n)});mxEvent.addListener(window,"resize",p);b.destroy=function(){mxEvent.removeListener(window,"resize",p);b.window.destroy();null!=m&&m()}};function ChangeGridColor(b,d){this.ui=b;this.color=d}ChangeGridColor.prototype.execute=function(){var b=this.ui.editor.graph.view.gridColor;this.ui.setGridColor(this.color);this.color=b};+function ChangePageSetup(b,d,m,p,u){this.ui=b;this.previousColor=this.color=d;this.previousImage=this.image=m;this.previousFormat=this.format=p;this.previousPageScale=this.pageScale=u;this.ignoreImage=this.ignoreColor=!1}ChangePageSetup.prototype.execute=function(){var b=this.ui.editor.graph;if(!this.ignoreColor){this.color=this.previousColor;var d=b.background;this.ui.setBackgroundColor(this.previousColor);this.previousColor=d}if(!this.ignoreImage){this.image=this.previousImage;d=b.backgroundImage;var m=this.previousImage;null!=m&&Graph.isPageLink(m.src)&&(m=this.ui.createImageForPageLink(m.src,this.ui.currentPage));this.ui.setBackgroundImage(m);this.previousImage=d}null!=this.previousFormat&&(this.format=this.previousFormat,d=b.pageFormat,this.previousFormat.width!=d.width||this.previousFormat.height!=d.height)&&(this.ui.setPageFormat(this.previousFormat),this.previousFormat=d);null!=this.foldingEnabled&&this.foldingEnabled!=this.ui.editor.graph.foldingEnabled&&(this.ui.setFoldingEnabled(this.foldingEnabled),this.foldingEnabled=!this.foldingEnabled);null!=this.previousPageScale&&(b=this.ui.editor.graph.pageScale,this.previousPageScale!=b&&(this.ui.setPageScale(this.previousPageScale),this.previousPageScale=b))};EditorUi.prototype.setBackgroundColor=function(b){this.editor.graph.background=b;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("backgroundColorChanged"))};EditorUi.prototype.setFoldingEnabled=function(b){this.editor.graph.foldingEnabled=b;this.editor.graph.view.revalidate();this.fireEvent(new mxEventObject("foldingEnabledChanged"))};EditorUi.prototype.setPageFormat=function(b,d){d=null!=d?d:"1"==urlParams.sketch;this.editor.graph.pageFormat=b;d||(this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct());this.fireEvent(new mxEventObject("pageFormatChanged"))};EditorUi.prototype.setPageScale=function(b){this.editor.graph.pageScale=b;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageScaleChanged"))};EditorUi.prototype.setGridColor=function(b,d){d=null!=d?d:Editor.isDarkMode();var m=this.editor.graph;d?m.view.defaultDarkGridColor=b:m.view.defaultGridColor=b;m.view.gridColor="light-dark("+m.view.defaultGridColor+", "+m.view.defaultDarkGridColor+")";m.view.validateBackground();this.fireEvent(new mxEventObject("gridColorChanged"))};-EditorUi.prototype.addUndoListener=function(){var b=this.editor.undoManager,d=mxUtils.bind(this,function(){this.updateActionStates()});b.addListener(mxEvent.ADD,d);b.addListener(mxEvent.UNDO,d);b.addListener(mxEvent.REDO,d);b.addListener(mxEvent.CLEAR,d);var m=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){m.apply(this,arguments);d()};var p=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(v,n){p.apply(this,arguments);+EditorUi.prototype.addUndoListener=function(){var b=this.editor.undoManager,d=mxUtils.bind(this,function(){this.updateActionStates()});b.addListener(mxEvent.ADD,d);b.addListener(mxEvent.UNDO,d);b.addListener(mxEvent.REDO,d);b.addListener(mxEvent.CLEAR,d);var m=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){m.apply(this,arguments);d()};var p=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(u,n){p.apply(this,arguments);d()};d()};-EditorUi.prototype.updateActionStates=function(){for(var b=this.editor.graph,d=this.getSelectionState(),m=b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()),p=!this.editor.chromeless||this.editor.editable,v="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack solid dashed pasteSize dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded strokeColor sharp snapToGrid".split(" "),n=0;n<v.length;n++)this.actions.get(v[n]).setEnabled(0<+EditorUi.prototype.updateActionStates=function(){for(var b=this.editor.graph,d=this.getSelectionState(),m=b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()),p=!this.editor.chromeless||this.editor.editable,u="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack solid dashed pasteSize dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded strokeColor sharp snapToGrid".split(" "),n=0;n<u.length;n++)this.actions.get(u[n]).setEnabled(0<d.cells.length);this.actions.get("grid").setEnabled(p);this.actions.get("undo").setEnabled(this.canUndo()&&p);this.actions.get("redo").setEnabled(this.canRedo()&&p);this.actions.get("swap").setEnabled(2==d.cells.length&&2==d.vertices.length);this.actions.get("pasteSize").setEnabled(null!=this.copiedSize&&0<d.vertices.length);this.actions.get("pasteData").setEnabled(null!=this.copiedValue&&0<d.cells.length);this.actions.get("setAsDefaultStyle").setEnabled(1==b.getSelectionCount());this.actions.get("lockUnlock").setEnabled(!b.isSelectionEmpty());this.actions.get("bringForward").setEnabled(1==d.cells.length);this.actions.get("sendBackward").setEnabled(1==d.cells.length);n="alignCellsLeft alignCellsCenter alignCellsRight alignCellsTop alignCellsMiddle alignCellsBottom distributeHorizontal distributeVertical".split(" ");for(p=0;p<n.length;p++)this.actions.get(n[p]).setEnabled(d.unlocked&&1<d.vertices.length);this.actions.get("rotation").setEnabled(1==d.vertices.length);this.actions.get("wordWrap").setEnabled(1==d.vertices.length);this.actions.get("autosize").setEnabled(0<d.vertices.length);this.actions.get("copySize").setEnabled(1==d.vertices.length);this.actions.get("clearWaypoints").setEnabled(d.connections);this.actions.get("clearAnchors").setEnabled(d.connections);this.actions.get("curved").setEnabled(0<d.edges.length);this.actions.get("turn").setEnabled(0<d.cells.length);this.actions.get("group").setEnabled(1<d.cells.length||1==d.vertices.length&&0==b.model.getChildCount(d.cells[0])&&!b.isContainer(d.vertices[0]));this.actions.get("ungroup").setEnabled(!d.row&&@@ -2333,102 +2333,102 @@ EditorUi.prototype.createSidebarContainer=function(){var b=document.createElemenEditorUi.prototype.createUi=function(){this.statusContainer=this.createStatusContainer();this.menubar=this.editor.chromeless?null:this.menus.createMenubar(this.createDiv("geMenubar"));null!=this.menubar&&this.menubarContainer.appendChild(this.menubar.container);null!=this.menubar&&(this.editor.addListener("statusChanged",mxUtils.bind(this,function(){this.setStatusText(this.editor.getStatus())})),this.setStatusText(this.editor.getStatus()),this.menubar.container.appendChild(this.statusContainer),this.container.appendChild(this.menubarContainer));this.sidebar=this.editor.chromeless?null:this.createSidebar(this.sidebarContainer);null!=this.sidebar&&this.container.appendChild(this.sidebarContainer);this.format=this.editor.chromeless?null:this.createFormat(this.formatContainer);null!=this.format&&this.container.appendChild(this.formatContainer);this.container.appendChild(this.diagramContainer);null!=this.container&&null!=this.tabContainer&&this.container.appendChild(this.tabContainer);this.toolbar=this.editor.chromeless?null:this.createToolbar(this.createDiv("geToolbar"));null!=this.toolbar&&(this.toolbarContainer.appendChild(this.toolbar.container),this.container.appendChild(this.toolbarContainer));null!=this.sidebar&&(this.container.appendChild(this.hsplit),this.addSplitHandler(this.hsplit,!0,0,mxUtils.bind(this,function(b){this.hsplitPosition=b;this.refresh();this.fireEvent(new mxEventObject("sidebarWidthChanged"))})))};-EditorUi.prototype.createStatusContainer=function(){var b=document.createElement("a");b.className="geStatus";mxEvent.addListener(b,"click",mxUtils.bind(this,function(d){var m=mxEvent.getSource(d);if(m!=b)for(;m.parentNode!=b;)m=m.parentNode;if("A"!=m.nodeName){var p=m.getAttribute("data-action");if("statusFunction"==p&&null!=this.editor.statusFunction)this.editor.statusFunction();else if(null!=p)m=this.actions.get(p),null!=m&&m.funct();else{p=m.getAttribute("data-title");var v=m.getAttribute("data-message");-null!=p&&null!=v?this.showError(p,v):(m=m.getAttribute("data-link"),null!=m&&this.editor.graph.openLink(m))}mxEvent.consume(d)}}));return b};+EditorUi.prototype.createStatusContainer=function(){var b=document.createElement("a");b.className="geStatus";mxEvent.addListener(b,"click",mxUtils.bind(this,function(d){var m=mxEvent.getSource(d);if(m!=b)for(;m.parentNode!=b;)m=m.parentNode;if("A"!=m.nodeName){var p=m.getAttribute("data-action");if("statusFunction"==p&&null!=this.editor.statusFunction)this.editor.statusFunction();else if(null!=p)m=this.actions.get(p),null!=m&&m.funct();else{p=m.getAttribute("data-title");var u=m.getAttribute("data-message");+null!=p&&null!=u?this.showError(p,u):(m=m.getAttribute("data-link"),null!=m&&this.editor.graph.openLink(m))}mxEvent.consume(d)}}));return b};EditorUi.prototype.setStatusText=function(b){this.statusContainer.innerHTML=Graph.sanitizeHtml(b);0==this.statusContainer.getElementsByTagName("div").length&&null!=b&&0<b.length&&(this.statusContainer.innerText="",b=this.createStatusDiv(b),this.statusContainer.appendChild(b));b=this.statusContainer.querySelectorAll('[data-effect="fade"]');if(null!=b)for(var d=0;d<b.length;d++)(function(m){mxUtils.setOpacity(m,0);mxUtils.setPrefixedStyle(m.style,"transform","scaleX(0)");mxUtils.setPrefixedStyle(m.style,"transition","all 0.2s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(m,100);mxUtils.setPrefixedStyle(m.style,"transform","scaleX(1)");mxUtils.setPrefixedStyle(m.style,"transition","all 1s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(m.style,"transform","scaleX(0)");mxUtils.setOpacity(m,0);window.setTimeout(mxUtils.bind(this,function(){null!=m.parentNode&&m.parentNode.removeChild(m)}),1E3)}),Editor.updateStatusInterval/2)}),0)})(b[d])};EditorUi.prototype.clearStatus=function(){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus("")}))};EditorUi.prototype.updateStatus=function(b){null!=b&&b();this.lastStatusUpdate=b};EditorUi.prototype.updateStatusAgain=function(){null!=this.lastStatusUpdate&&this.lastStatusUpdate()};EditorUi.prototype.createStatusDiv=function(b){var d=document.createElement("div");d.className="geStatusDiv";d.setAttribute("title",b);d.innerText=b;return d};EditorUi.prototype.createToolbar=function(b){return new Toolbar(this,b)};EditorUi.prototype.createSidebar=function(b){return new Sidebar(this,b)};EditorUi.prototype.createFormat=function(b){return new Format(this,b)};EditorUi.prototype.getCollapsedSections=function(){return{}};EditorUi.prototype.createDiv=function(b){var d=document.createElement("div");d.className=b;return d};-EditorUi.prototype.addSplitHandler=function(b,d,m,p){function v(U){if(null!=y){var c=new mxPoint(mxEvent.getClientX(U),mxEvent.getClientY(U));p(Math.max(0,C+(d?c.x-y.x:y.y-c.y)-m));mxEvent.consume(U);C!=O()&&(P=!0,G=null)}}function n(U){v(U);y=C=null}var y=null,C=null,P=!0,G=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var O=mxUtils.bind(this,function(){var U=parseInt(d?b.offsetLeft:b.offsetTop);d||(U+=m);return U});mxEvent.addGestureListeners(b,function(U){y=new mxPoint(mxEvent.getClientX(U),-mxEvent.getClientY(U));C=O();P=!1;mxEvent.consume(U)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(U){if(!P&&this.hsplitClickEnabled){var c=null!=G?G-m:0;G=O();p(c);mxEvent.consume(U)}}));mxEvent.addGestureListeners(document,null,v,n);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,v,n)})};-EditorUi.prototype.prompt=function(b,d,m,p){b=new FilenameDialog(this,d,mxResources.get("apply"),function(v){m(p?v:parseFloat(v))},b);this.showDialog(b.container,300,80,!0,!0);b.init()};-EditorUi.prototype.handleError=function(b,d,m,p,v){b=null!=b&&null!=b.error?b.error:b;if(null!=b||null!=d){v=mxUtils.htmlEntities(mxResources.get("unknownError"));var n=mxResources.get("ok");d=null!=d?d:mxResources.get("error");null!=b&&null!=b.message&&(v=mxUtils.htmlEntities(b.message));this.showError(d,v,n,m,null,null,null,null,null,null,null,null,p?m:null)}else null!=m&&m()};-EditorUi.prototype.showError=function(b,d,m,p,v,n,y,C,P,G,O,U,c){b=new ErrorDialog(this,b,d,m||mxResources.get("ok"),p,v,n,y,U,C,P);this.showDialog(b.container,G||340,O,!0,!1,c);null==O&&null!=this.dialog&&null!=this.dialog.container&&(this.dialog.container.style.height=this.dialog.container.offsetHeight+16+"px");b.init()};-EditorUi.prototype.showDialog=function(b,d,m,p,v,n,y,C,P,G,O){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,d,m,p,v,n,y,C,P,G);this.dialogs.push(this.dialog);null!=O&&null!=P&&"undefined"!==typeof mxSettings&&null!=mxSettings.getWindowState&&(b=mxSettings.getWindowState(O),null!=b&&null!=b.w&&null!=b.h&&(this.dialog.container.style.width=Math.max(P.width,b.w)+"px",this.dialog.container.style.height=+EditorUi.prototype.addSplitHandler=function(b,d,m,p){function u(U){if(null!=y){var c=new mxPoint(mxEvent.getClientX(U),mxEvent.getClientY(U));p(Math.max(0,B+(d?c.x-y.x:y.y-c.y)-m));mxEvent.consume(U);B!=O()&&(P=!0,G=null)}}function n(U){u(U);y=B=null}var y=null,B=null,P=!0,G=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var O=mxUtils.bind(this,function(){var U=parseInt(d?b.offsetLeft:b.offsetTop);d||(U+=m);return U});mxEvent.addGestureListeners(b,function(U){y=new mxPoint(mxEvent.getClientX(U),+mxEvent.getClientY(U));B=O();P=!1;mxEvent.consume(U)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(U){if(!P&&this.hsplitClickEnabled){var c=null!=G?G-m:0;G=O();p(c);mxEvent.consume(U)}}));mxEvent.addGestureListeners(document,null,u,n);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,u,n)})};+EditorUi.prototype.prompt=function(b,d,m,p){b=new FilenameDialog(this,d,mxResources.get("apply"),function(u){m(p?u:parseFloat(u))},b);this.showDialog(b.container,300,80,!0,!0);b.init()};+EditorUi.prototype.handleError=function(b,d,m,p,u){b=null!=b&&null!=b.error?b.error:b;if(null!=b||null!=d){u=mxUtils.htmlEntities(mxResources.get("unknownError"));var n=mxResources.get("ok");d=null!=d?d:mxResources.get("error");null!=b&&null!=b.message&&(u=mxUtils.htmlEntities(b.message));this.showError(d,u,n,m,null,null,null,null,null,null,null,null,p?m:null)}else null!=m&&m()};+EditorUi.prototype.showError=function(b,d,m,p,u,n,y,B,P,G,O,U,c){b=new ErrorDialog(this,b,d,m||mxResources.get("ok"),p,u,n,y,U,B,P);this.showDialog(b.container,G||340,O,!0,!1,c);null==O&&null!=this.dialog&&null!=this.dialog.container&&(this.dialog.container.style.height=this.dialog.container.offsetHeight+16+"px");b.init()};+EditorUi.prototype.showDialog=function(b,d,m,p,u,n,y,B,P,G,O){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,d,m,p,u,n,y,B,P,G);this.dialogs.push(this.dialog);null!=O&&null!=P&&"undefined"!==typeof mxSettings&&null!=mxSettings.getWindowState&&(b=mxSettings.getWindowState(O),null!=b&&null!=b.w&&null!=b.h&&(this.dialog.container.style.width=Math.max(P.width,b.w)+"px",this.dialog.container.style.height=Math.max(P.height,b.h)+"px"),this.dialog.onResize=function(U,c){mxSettings.setWindowState(O,{w:U,h:c});mxSettings.save()})};-EditorUi.prototype.hideDialog=function(b,d,m){var p=null;if(null!=this.dialogs&&0<this.dialogs.length)for(var v=this.dialogs.length-1;0<=v;v--)if(!this.dialogs[v].closing){p=this.dialogs[v];break}null==p||null!=m&&m!=this.dialog.container.firstChild||(p.closing=!0,0==p.close(b,d)?delete p.closing:(delete p.closing,b=mxUtils.lastIndexOf(this.dialogs,p),0<=b&&this.dialogs.splice(b,1),this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,this.editor.fireEvent(new mxEventObject("hideDialog",+EditorUi.prototype.hideDialog=function(b,d,m){var p=null;if(null!=this.dialogs&&0<this.dialogs.length)for(var u=this.dialogs.length-1;0<=u;u--)if(!this.dialogs[u].closing){p=this.dialogs[u];break}null==p||null!=m&&m!=this.dialog.container.firstChild||(p.closing=!0,0==p.close(b,d)?delete p.closing:(delete p.closing,b=mxUtils.lastIndexOf(this.dialogs,p),0<=b&&this.dialogs.splice(b,1),this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,this.editor.fireEvent(new mxEventObject("hideDialog","dialog",p)),null==this.dialog&&null!=this.editor.graph.container&&"hidden"!=this.editor.graph.container.style.visibility&&window.setTimeout(mxUtils.bind(this,function(){null==this.editor||null!=this.dialogs&&0!=this.dialogs.length||(this.editor.graph.isEditing()&&null!=this.editor.graph.cellEditor.textarea?this.editor.graph.cellEditor.textarea.focus():(mxUtils.clearSelection(),this.editor.graph.container.focus()))}),0)))};-EditorUi.prototype.ctrlEnter=function(){var b=this.editor.graph;if(b.isEnabled())try{for(var d=b.getSelectionCells(),m=new mxDictionary,p=[],v=0;v<d.length;v++){var n=b.isTableCell(d[v])?b.model.getParent(d[v]):d[v];null==n||m.get(n)||(m.put(n,!0),p.push(n))}b.setSelectionCells(b.duplicateCells(p,!1))}catch(y){this.handleError(y)}};-EditorUi.prototype.pickColor=function(b,d,m,p,v,n,y,C){if(null!=this.dialog&&null!=this.dialog.bg&&null!=this.dialog.bg.parentNode)this.pickColorModal(b,d,m,p,v,n,null,C);else{var P=this.editor.graph,G=P.cellEditor.saveSelection(),O=this;if(null==this.colorWindow){var U=null!=this.installWindowPersistence?mxSettings.getWindowState("colorPicker"):null;this.colorWindow=new ColorWindow(this,null!=U&&null!=U.x?U.x:document.body.offsetWidth-280,null!=U&&null!=U.y?U.y:100,null!=U&&null!=U.w?U.w:260);null!=-this.installWindowPersistence&&(this.installWindowPersistence("colorPicker",this.colorWindow),null!=U&&this.restoreWindowState("colorPicker",this.colorWindow))}this.colorWindow.update(b,function(c){P.cellEditor.restoreSelection(G);null!=O.colorWindow&&(O.colorWindow.applying=!0);d(c);null!=O.colorWindow&&(O.colorWindow.applying=!1)},n||mxResources.get("fillColor"),m,p,v,y,C)}};-EditorUi.prototype.pickColorModal=function(b,d,m,p,v,n,y,C){var P=this.editor.graph,G=P.cellEditor.saveSelection(),O=new ColorDialog(this,b,function(c){P.cellEditor.restoreSelection(G);null!=d&&d(c)},function(){P.cellEditor.restoreSelection(G);null!=y&&y()},m,p,v,null,C);null!=n&&(b=document.createElement("div"),b.style.cssText="width:100%;text-align:center;font-weight:bold;margin-bottom:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis",mxUtils.write(b,n),O.container.insertBefore(b,+EditorUi.prototype.ctrlEnter=function(){var b=this.editor.graph;if(b.isEnabled())try{for(var d=b.getSelectionCells(),m=new mxDictionary,p=[],u=0;u<d.length;u++){var n=b.isTableCell(d[u])?b.model.getParent(d[u]):d[u];null==n||m.get(n)||(m.put(n,!0),p.push(n))}b.setSelectionCells(b.duplicateCells(p,!1))}catch(y){this.handleError(y)}};+EditorUi.prototype.pickColor=function(b,d,m,p,u,n,y,B){if(null!=this.dialog&&null!=this.dialog.bg&&null!=this.dialog.bg.parentNode)this.pickColorModal(b,d,m,p,u,n,null,B);else{var P=this.editor.graph,G=P.cellEditor.saveSelection(),O=this;if(null==this.colorWindow){var U=null!=this.installWindowPersistence?mxSettings.getWindowState("colorPicker"):null;this.colorWindow=new ColorWindow(this,null!=U&&null!=U.x?U.x:document.body.offsetWidth-280,null!=U&&null!=U.y?U.y:100,null!=U&&null!=U.w?U.w:260);null!=+this.installWindowPersistence&&(this.installWindowPersistence("colorPicker",this.colorWindow),null!=U&&this.restoreWindowState("colorPicker",this.colorWindow))}this.colorWindow.update(b,function(c){P.cellEditor.restoreSelection(G);null!=O.colorWindow&&(O.colorWindow.applying=!0);d(c);null!=O.colorWindow&&(O.colorWindow.applying=!1)},n||mxResources.get("fillColor"),m,p,u,y,B)}};+EditorUi.prototype.pickColorModal=function(b,d,m,p,u,n,y,B){var P=this.editor.graph,G=P.cellEditor.saveSelection(),O=new ColorDialog(this,b,function(c){P.cellEditor.restoreSelection(G);null!=d&&d(c)},function(){P.cellEditor.restoreSelection(G);null!=y&&y()},m,p,u,null,B);null!=n&&(b=document.createElement("div"),b.style.cssText="width:100%;text-align:center;font-weight:bold;margin-bottom:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis",mxUtils.write(b,n),O.container.insertBefore(b,O.container.firstChild));this.showDialog(O.container,250,null,!0,!1);var U=this.dialog.container;O.resizeFn=function(){U.style.height=O.container.scrollHeight+48+"px"};O.init()};EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(b){this.hideDialog(b)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})};-EditorUi.prototype.base64ToBlob=function(b,d){d=d||"";b=atob(b);for(var m=b.length,p=Math.ceil(m/1024),v=Array(p),n=0;n<p;++n){for(var y=1024*n,C=Math.min(y+1024,m),P=Array(C-y),G=0;y<C;++G,++y)P[G]=b[y].charCodeAt(0);v[n]=new Uint8Array(P)}return new Blob(v,{type:d})};-EditorUi.prototype.extractGraphModelFromHtml=function(b){var d=null;try{var m=b.indexOf("<mxGraphModel ");if(0<=m){var p=b.lastIndexOf("</mxGraphModel>");p>m&&(d=b.substring(m,p+21).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}}catch(v){}return d};+EditorUi.prototype.base64ToBlob=function(b,d){d=d||"";b=atob(b);for(var m=b.length,p=Math.ceil(m/1024),u=Array(p),n=0;n<p;++n){for(var y=1024*n,B=Math.min(y+1024,m),P=Array(B-y),G=0;y<B;++G,++y)P[G]=b[y].charCodeAt(0);u[n]=new Uint8Array(P)}return new Blob(u,{type:d})};+EditorUi.prototype.extractGraphModelFromHtml=function(b){var d=null;try{var m=b.indexOf("<mxGraphModel ");if(0<=m){var p=b.lastIndexOf("</mxGraphModel>");p>m&&(d=b.substring(m,p+21).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}}catch(u){}return d};EditorUi.prototype.extractGraphModelFromEvent=function(b){var d=null,m=null;null!=b&&(b=null!=b.dataTransfer?b.dataTransfer:b.clipboardData,null!=b&&(m=0<=mxUtils.indexOf(b.types,"text/html")?b.getData("text/html"):null,0<=mxUtils.indexOf(b.types,"text/plain")&&(null==m||0==m.length)&&(m=b.getData("text/plain")),null!=m&&(m=Graph.zapGremlins(mxUtils.trim(m)),b=this.extractGraphModelFromHtml(m),null!=b&&(m=b))));null!=m&&this.isCompatibleString(m)&&(d=m);return d};EditorUi.prototype.isCompatibleString=function(b){return!1};EditorUi.prototype.saveFile=function(b){b||null==this.editor.filename?(b=new FilenameDialog(this,this.editor.getOrCreateFilename(),mxResources.get("save"),mxUtils.bind(this,function(d){this.save(d)}),null,mxUtils.bind(this,function(d){if(null!=d&&0<d.length)return!0;mxUtils.confirm(mxResources.get("invalidName"));return!1})),this.showDialog(b.container,340,96,!0,!0),b.init()):this.save(this.editor.getOrCreateFilename())};EditorUi.prototype.save=function(b){if(null!=b){this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var d=mxUtils.getXml(this.editor.getGraphXml());try{if(Editor.useLocalStorage){if(null!=localStorage.getItem(b)&&!mxUtils.confirm(mxResources.get("replaceIt",[b])))return;localStorage.setItem(b,d);this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saved"))+" "+new Date)}))}else if(d.length<MAX_REQUEST_SIZE)(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&xml="+encodeURIComponent(d))).simulate(document,"_blank");else{mxUtils.alert(mxResources.get("drawingTooLarge"));mxUtils.popup(d);return}this.editor.setModified(!1);this.editor.setFilename(b);this.updateDocumentTitle()}catch(m){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("errorSavingFile")))}))}}};-EditorUi.prototype.executeLayouts=function(b,d){for(var m=!1,p=0;p<b.length;p++)if("function"===typeof b[p].prepare){m=!0;break}if(m){var v=this,n=this.editor.graph.getDefaultParent(),y=0,C=function(){if(y>=b.length)null!=d&&d();else{var P=b[y++];"function"===typeof P.prepare?P.prepare(n,function(G,O){null!=G?v.handleError(G):v.executeLayout(O,!0,C)}):v.executeLayout(function(){P.execute(n)},!0,C)}};C()}else this.executeLayout(mxUtils.bind(this,function(){var P=new mxCompositeLayout(this.editor.graph,-b),G=this.editor.graph.getSelectionCells();P.execute(this.editor.graph.getDefaultParent(),0==G.length?null:G)}),!0,d)};EditorUi.prototype.executeLayout=function(b,d,m){var p=this.editor.graph;p.getModel().beginUpdate();try{b()}catch(v){throw v;}finally{this.allowAnimation&&d&&p.isEnabled()?(b=new mxMorphing(p),b.addListener(mxEvent.DONE,mxUtils.bind(this,function(){p.getModel().endUpdate();null!=m&&m()})),b.startAnimation()):(p.getModel().endUpdate(),null!=m&&m())}};-EditorUi.prototype.showImageDialog=function(b,d,m,p){p=this.editor.graph.cellEditor;var v=p.saveSelection(),n=mxUtils.prompt(b,d);p.restoreSelection(v);if(null!=n&&0<n.length){var y=new Image;y.onload=function(){m(n,y.width,y.height)};y.onerror=function(){m(null);mxUtils.alert(mxResources.get("fileNotFound"))};y.src=n}else m(null)};EditorUi.prototype.showLinkDialog=function(b,d,m){b=new LinkDialog(this,b,d,m);this.showDialog(b.container,420,null,!0,!0);b.init()};+EditorUi.prototype.executeLayouts=function(b,d){for(var m=!1,p=0;p<b.length;p++)if("function"===typeof b[p].prepare){m=!0;break}if(m){var u=this,n=this.editor.graph.getDefaultParent(),y=0,B=function(){if(y>=b.length)null!=d&&d();else{var P=b[y++];"function"===typeof P.prepare?P.prepare(n,function(G,O){null!=G?u.handleError(G):u.executeLayout(O,!0,B)}):u.executeLayout(function(){P.execute(n)},!0,B)}};B()}else this.executeLayout(mxUtils.bind(this,function(){var P=new mxCompositeLayout(this.editor.graph,+b),G=this.editor.graph.getSelectionCells();P.execute(this.editor.graph.getDefaultParent(),0==G.length?null:G)}),!0,d)};EditorUi.prototype.executeLayout=function(b,d,m){var p=this.editor.graph;p.getModel().beginUpdate();try{b()}catch(u){throw u;}finally{this.allowAnimation&&d&&p.isEnabled()?(b=new mxMorphing(p),b.addListener(mxEvent.DONE,mxUtils.bind(this,function(){p.getModel().endUpdate();null!=m&&m()})),b.startAnimation()):(p.getModel().endUpdate(),null!=m&&m())}};+EditorUi.prototype.showImageDialog=function(b,d,m,p){p=this.editor.graph.cellEditor;var u=p.saveSelection(),n=mxUtils.prompt(b,d);p.restoreSelection(u);if(null!=n&&0<n.length){var y=new Image;y.onload=function(){m(n,y.width,y.height)};y.onerror=function(){m(null);mxUtils.alert(mxResources.get("fileNotFound"))};y.src=n}else m(null)};EditorUi.prototype.showLinkDialog=function(b,d,m){b=new LinkDialog(this,b,d,m);this.showDialog(b.container,420,null,!0,!0);b.init()};EditorUi.prototype.showDataDialog=function(b){null!=b&&"undefined"!==typeof window.EditDataDialog&&(b=new EditDataDialog(this,b),this.showDialog(b.container,480,420,!0,!1,null,!1,null,new mxRectangle(0,0,440,340),null,"editData"),b.init())};EditorUi.prototype.showBackgroundImageDialog=function(b,d){b=null!=b?b:mxUtils.bind(this,function(p){p=new ChangePageSetup(this,null,p);p.ignoreColor=!0;this.editor.graph.model.execute(p)});var m=mxUtils.prompt(mxResources.get("backgroundImage"),null!=d?d.src:"");null!=m&&0<m.length?(d=new Image,d.onload=function(){b(new mxImage(m,d.width,d.height),!1)},d.onerror=function(){b(null,!0);mxUtils.alert(mxResources.get("fileNotFound"))},d.src=m):b(null)};EditorUi.prototype.setBackgroundImage=function(b){this.editor.graph.setBackgroundImage(b);this.editor.graph.view.validateBackgroundImage();this.fireEvent(new mxEventObject("backgroundImageChanged"))};EditorUi.prototype.confirm=function(b,d,m){mxUtils.confirm(b)?null!=d&&d():null!=m&&m()};EditorUi.prototype.createOutline=function(b){var d=new mxOutline(this.editor.graph);mxEvent.addListener(window,"resize",function(){d.update(!1)});return d};EditorUi.prototype.altShiftActions={65:"connectionArrows",82:"clearWaypoints",76:"editLink",79:"connectionPoints",81:"editConnectionPoints",84:"editTooltip",86:"pasteSize",70:"copySize",66:"copyData",69:"pasteData"};EditorUi.prototype.ctrlAltShiftActions={70:"bringForward",66:"sendBackward",88:"copyAsSvg"};EditorUi.prototype.ctrlAltActions={88:"copyAsImage"};EditorUi.prototype.altActions={};-EditorUi.prototype.createKeyHandler=function(b){function d(){null!=C&&(window.clearTimeout(C),C=null);var f=v.graphHandler;if(null!=f&&null!=f.first){var k=v.getView().scale,q=f.roundLength(f.currentDx/k);k=f.roundLength(f.currentDy/k);f.moveCells(f.cells,q,k);f.reset()}}function m(f,k,q){if(!v.isSelectionEmpty()&&v.isEnabled()){k=null!=k?k:Editor.getCursorMoveStep(v.view.unit);var x=v.getCompositeParents(v.getSelectionCells()),B=0<x.length?x[0]:null;if(null!=B){if(q){v.getModel().beginUpdate();try{for(B=-0;B<x.length;B++)if(v.getModel().isVertex(x[B])&&v.isCellResizable(x[B])){var E=v.getCellGeometry(x[B]);null!=E&&(E=E.clone(),37==f?E.width=Math.max(0,E.width-k):38==f?E.height=Math.max(0,E.height-k):39==f?E.width+=k:40==f&&(E.height+=k),v.getModel().setGeometry(x[B],E))}}finally{v.getModel().endUpdate()}}else{q=v.model.getParent(B);E=v.getView().scale;var L=null;1==v.getSelectionCount()&&v.model.isVertex(B)&&null!=v.layoutManager&&!v.isCellLocked(B)&&(L=v.layoutManager.getLayout(q));null!=L&&L.constructor==-mxStackLayout?(k=q.getIndex(B),37==f||38==f?v.model.add(q,B,Math.max(0,k-1)):(39==f||40==f)&&v.model.add(q,B,Math.min(v.model.getChildCount(q),k+1))):(q=v.graphHandler,null!=q&&(null==q.first&&q.start(B,0,0,v.getMovableCells(x)),null!=q.first&&(L=B=0,37==f?B=-k:38==f?L=-k:39==f?B=k:40==f&&(L=k),q.currentDx+=B*E,q.currentDy+=L*E,q.checkPreview(),q.updatePreview()),null!=C&&window.clearTimeout(C),C=window.setTimeout(d,400)))}B=v.graphHandler;f=v.container;k=null;null!=B&&null!=B.first?null!=B.bounds&&-(k=mxRectangle.fromRectangle(B.bounds),k.x+=B.currentDx,k.y+=B.currentDy):k=v.view.getBounds(x);null!=k&&null!=f&&(k.x<f.scrollLeft||k.y<f.scrollTop||k.x+k.width>f.scrollLeft+f.clientWidth||k.y+k.height>f.scrollTop+f.clientHeight)&&(B=v.view.translate,x=new mxPoint(B.x,B.y),v.scrollRectToVisible(new mxRectangle(k.getCenterX()-B.x-f.clientWidth/2,k.getCenterY()-B.y-f.clientHeight/2,f.clientWidth,f.clientHeight))&&(f=new mxPoint(B.x,B.y),v.view.translate.x=x.x,v.view.translate.y=x.y,v.view.setTranslate(f.x,-f.y)))}}}var p=this,v=this.editor.graph,n=new mxKeyHandler(v),y=n.isEventIgnored;n.isEventIgnored=function(f){return 188==f.keyCode&&this.isControlDown(f)&&!this.graph.cellEditor.isContentEditing()?!0:!(mxEvent.isShiftDown(f)&&9==f.keyCode)&&(!this.isControlDown(f)||mxEvent.isShiftDown(f)||90!=f.keyCode&&89!=f.keyCode&&188!=f.keyCode&&190!=f.keyCode&&85!=f.keyCode&&83!=f.keyCode)&&(66!=f.keyCode&&73!=f.keyCode||!this.isControlDown(f)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&-(109!=f.keyCode&&107!=f.keyCode||!this.isControlDown(f)&&!mxEvent.isShiftDown(f)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&y.apply(this,arguments)};n.isEnabledForEvent=function(f){return!mxEvent.isConsumed(f)&&this.isGraphEvent(f)&&this.isEnabled()&&(null==p.dialogs||0==p.dialogs.length)};n.isControlDown=function(f){return mxEvent.isControlDown(f)||mxClient.IS_MAC&&f.metaKey};var C=null,P=v.fireMouseEvent;v.fireMouseEvent=function(f,k,q){f==mxEvent.MOUSE_DOWN&&-d();P.apply(this,arguments)};var G={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},O=n.getFunction;mxKeyHandler.prototype.getFunction=function(f){if(v.isEnabled()){var k=null;mxEvent.isShiftDown(f)&&this.isControlDown(f)&&mxEvent.isAltDown(f)?k=p.actions.get(p.ctrlAltShiftActions[f.keyCode]):mxEvent.isShiftDown(f)&&mxEvent.isAltDown(f)?k=p.actions.get(p.altShiftActions[f.keyCode]):this.isControlDown(f)&&mxEvent.isAltDown(f)?-k=p.actions.get(p.ctrlAltActions[f.keyCode]):mxEvent.isAltDown(f)&&(k=p.actions.get(p.altActions[f.keyCode]));if(null!=k)return k.funct;if("/"==f.key&&!this.isControlDown(f)&&!mxEvent.isAltDown(f))return function(){var q=document.getElementById("geOmniSearch");null!=q&&30<q.clientWidth&&q.focus()};if(null!=G[f.keyCode]&&!v.isSelectionEmpty())if(!this.isControlDown(f)&&mxEvent.isShiftDown(f)&&mxEvent.isAltDown(f)){if(v.model.isVertex(v.getSelectionCell()))return function(){var q=v.connectVertex(v.getSelectionCell(),-G[f.keyCode],v.defaultEdgeLength,f,!0);null!=q&&0<q.length&&(1==q.length&&v.model.isEdge(q[0])?v.setSelectionCell(v.model.getTerminal(q[0],!1)):v.setSelectionCell(q[q.length-1]),v.scrollCellToVisible(v.getSelectionCell()),null!=p.hoverIcons&&p.hoverIcons.update(v.view.getState(v.getSelectionCell())))}}else return this.isControlDown(f)?function(){m(f.keyCode,mxEvent.isShiftDown(f)?v.gridSize:null,!0)}:function(){m(f.keyCode,mxEvent.isShiftDown(f)?v.gridSize:null)}}return O.apply(this,arguments)};n.bindAction=-mxUtils.bind(this,function(f,k,q,x){var B=this.actions.get(q);null!=B&&(q=function(){B.isEnabled()&&B.funct.apply(this,arguments)},k?x?n.bindControlShiftKey(f,q):n.bindControlKey(f,q):x?n.bindShiftKey(f,q):n.bindKey(f,q))});var U=this,c=n.escape;n.escape=function(f){c.apply(this,arguments)};n.enter=function(){};n.bindControlShiftKey(36,function(){v.exitGroup()});n.bindControlShiftKey(35,function(){v.enterGroup()});n.bindShiftKey(36,function(){v.home()});n.bindKey(35,function(){v.refresh()});n.bindAction(80,-!0,"print");n.bindAction(107,!0,"zoomIn");n.bindAction(109,!0,"zoomOut");n.bindAction(61,!0,"zoomIn");n.bindAction(187,!0,"zoomIn");n.bindAction(222,!0,"zoomIn");n.bindAction(173,!0,"zoomOut");n.bindAction(189,!0,"zoomOut");if(!this.editor.chromeless||this.editor.editable)n.bindAction(79,!0,"outline",!0),n.bindControlKey(36,function(){v.isEnabled()&&v.foldCells(!0)}),n.bindControlKey(35,function(){v.isEnabled()&&v.foldCells(!1)}),n.bindControlKey(13,function(){U.ctrlEnter()}),n.bindAction(8,!1,"delete"),+EditorUi.prototype.createKeyHandler=function(b){function d(){null!=B&&(window.clearTimeout(B),B=null);var f=u.graphHandler;if(null!=f&&null!=f.first){var k=u.getView().scale,q=f.roundLength(f.currentDx/k);k=f.roundLength(f.currentDy/k);f.moveCells(f.cells,q,k);f.reset()}}function m(f,k,q){if(!u.isSelectionEmpty()&&u.isEnabled()){k=null!=k?k:Editor.getCursorMoveStep(u.view.unit);var x=u.getCompositeParents(u.getSelectionCells()),C=0<x.length?x[0]:null;if(null!=C){if(q){u.getModel().beginUpdate();try{for(C=+0;C<x.length;C++)if(u.getModel().isVertex(x[C])&&u.isCellResizable(x[C])){var E=u.getCellGeometry(x[C]);null!=E&&(E=E.clone(),37==f?E.width=Math.max(0,E.width-k):38==f?E.height=Math.max(0,E.height-k):39==f?E.width+=k:40==f&&(E.height+=k),u.getModel().setGeometry(x[C],E))}}finally{u.getModel().endUpdate()}}else{q=u.model.getParent(C);E=u.getView().scale;var L=null;1==u.getSelectionCount()&&u.model.isVertex(C)&&null!=u.layoutManager&&!u.isCellLocked(C)&&(L=u.layoutManager.getLayout(q));null!=L&&L.constructor==+mxStackLayout?(k=q.getIndex(C),37==f||38==f?u.model.add(q,C,Math.max(0,k-1)):(39==f||40==f)&&u.model.add(q,C,Math.min(u.model.getChildCount(q),k+1))):(q=u.graphHandler,null!=q&&(null==q.first&&q.start(C,0,0,u.getMovableCells(x)),null!=q.first&&(L=C=0,37==f?C=-k:38==f?L=-k:39==f?C=k:40==f&&(L=k),q.currentDx+=C*E,q.currentDy+=L*E,q.checkPreview(),q.updatePreview()),null!=B&&window.clearTimeout(B),B=window.setTimeout(d,400)))}C=u.graphHandler;f=u.container;k=null;null!=C&&null!=C.first?null!=C.bounds&&+(k=mxRectangle.fromRectangle(C.bounds),k.x+=C.currentDx,k.y+=C.currentDy):k=u.view.getBounds(x);null!=k&&null!=f&&(k.x<f.scrollLeft||k.y<f.scrollTop||k.x+k.width>f.scrollLeft+f.clientWidth||k.y+k.height>f.scrollTop+f.clientHeight)&&(C=u.view.translate,x=new mxPoint(C.x,C.y),u.scrollRectToVisible(new mxRectangle(k.getCenterX()-C.x-f.clientWidth/2,k.getCenterY()-C.y-f.clientHeight/2,f.clientWidth,f.clientHeight))&&(f=new mxPoint(C.x,C.y),u.view.translate.x=x.x,u.view.translate.y=x.y,u.view.setTranslate(f.x,+f.y)))}}}var p=this,u=this.editor.graph,n=new mxKeyHandler(u),y=n.isEventIgnored;n.isEventIgnored=function(f){return 188==f.keyCode&&this.isControlDown(f)&&!this.graph.cellEditor.isContentEditing()?!0:!(mxEvent.isShiftDown(f)&&9==f.keyCode)&&(!this.isControlDown(f)||mxEvent.isShiftDown(f)||90!=f.keyCode&&89!=f.keyCode&&188!=f.keyCode&&190!=f.keyCode&&85!=f.keyCode&&83!=f.keyCode)&&(66!=f.keyCode&&73!=f.keyCode||!this.isControlDown(f)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&+(109!=f.keyCode&&107!=f.keyCode||!this.isControlDown(f)&&!mxEvent.isShiftDown(f)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&y.apply(this,arguments)};n.isEnabledForEvent=function(f){return!mxEvent.isConsumed(f)&&this.isGraphEvent(f)&&this.isEnabled()&&(null==p.dialogs||0==p.dialogs.length)};n.isControlDown=function(f){return mxEvent.isControlDown(f)||mxClient.IS_MAC&&f.metaKey};var B=null,P=u.fireMouseEvent;u.fireMouseEvent=function(f,k,q){f==mxEvent.MOUSE_DOWN&&+d();P.apply(this,arguments)};var G={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},O=n.getFunction;mxKeyHandler.prototype.getFunction=function(f){if(u.isEnabled()){var k=null;mxEvent.isShiftDown(f)&&this.isControlDown(f)&&mxEvent.isAltDown(f)?k=p.actions.get(p.ctrlAltShiftActions[f.keyCode]):mxEvent.isShiftDown(f)&&mxEvent.isAltDown(f)?k=p.actions.get(p.altShiftActions[f.keyCode]):this.isControlDown(f)&&mxEvent.isAltDown(f)?+k=p.actions.get(p.ctrlAltActions[f.keyCode]):mxEvent.isAltDown(f)&&(k=p.actions.get(p.altActions[f.keyCode]));if(null!=k)return k.funct;if("/"==f.key&&!this.isControlDown(f)&&!mxEvent.isAltDown(f))return function(){var q=document.getElementById("geOmniSearch");null!=q&&30<q.clientWidth&&q.focus()};if(null!=G[f.keyCode]&&!u.isSelectionEmpty())if(!this.isControlDown(f)&&mxEvent.isShiftDown(f)&&mxEvent.isAltDown(f)){if(u.model.isVertex(u.getSelectionCell()))return function(){var q=u.connectVertex(u.getSelectionCell(),+G[f.keyCode],u.defaultEdgeLength,f,!0);null!=q&&0<q.length&&(1==q.length&&u.model.isEdge(q[0])?u.setSelectionCell(u.model.getTerminal(q[0],!1)):u.setSelectionCell(q[q.length-1]),u.scrollCellToVisible(u.getSelectionCell()),null!=p.hoverIcons&&p.hoverIcons.update(u.view.getState(u.getSelectionCell())))}}else return this.isControlDown(f)?function(){m(f.keyCode,mxEvent.isShiftDown(f)?u.gridSize:null,!0)}:function(){m(f.keyCode,mxEvent.isShiftDown(f)?u.gridSize:null)}}return O.apply(this,arguments)};n.bindAction=+mxUtils.bind(this,function(f,k,q,x){var C=this.actions.get(q);null!=C&&(q=function(){C.isEnabled()&&C.funct.apply(this,arguments)},k?x?n.bindControlShiftKey(f,q):n.bindControlKey(f,q):x?n.bindShiftKey(f,q):n.bindKey(f,q))});var U=this,c=n.escape;n.escape=function(f){c.apply(this,arguments)};n.enter=function(){};n.bindControlShiftKey(36,function(){u.exitGroup()});n.bindControlShiftKey(35,function(){u.enterGroup()});n.bindShiftKey(36,function(){u.home()});n.bindKey(35,function(){u.refresh()});n.bindAction(80,+!0,"print");n.bindAction(107,!0,"zoomIn");n.bindAction(109,!0,"zoomOut");n.bindAction(61,!0,"zoomIn");n.bindAction(187,!0,"zoomIn");n.bindAction(222,!0,"zoomIn");n.bindAction(173,!0,"zoomOut");n.bindAction(189,!0,"zoomOut");if(!this.editor.chromeless||this.editor.editable)n.bindAction(79,!0,"outline",!0),n.bindControlKey(36,function(){u.isEnabled()&&u.foldCells(!0)}),n.bindControlKey(35,function(){u.isEnabled()&&u.foldCells(!1)}),n.bindControlKey(13,function(){U.ctrlEnter()}),n.bindAction(8,!1,"delete"),n.bindAction(8,!0,"deleteAll"),n.bindAction(8,!1,"deleteLabels",!0),n.bindAction(46,!1,"delete"),n.bindAction(46,!0,"deleteAll"),n.bindAction(46,!1,"deleteLabels",!0),n.bindAction(36,!1,"resetView"),n.bindAction(72,!0,"fitWindow",!0),n.bindAction(74,!0,"fitPage"),n.bindAction(74,!0,"fitTwoPages",!0),n.bindAction(48,!0,"customZoom"),n.bindAction(82,!0,"turn"),n.bindAction(82,!0,"clearDefaultStyle",!0),n.bindAction(83,!0,"save"),n.bindAction(83,!0,"saveAs",!0),n.bindAction(65,!0,"selectAll"),n.bindAction(65,!0,"selectNone",!0),"1"!=urlParams.dev&&n.bindAction(73,!0,"selectVertices",!0),n.bindAction(69,!0,"selectEdges",!0),n.bindAction(69,!0,"editStyle"),n.bindAction(66,!0,"bold"),n.bindAction(66,!0,"toBack",!0),n.bindAction(70,!0,"toFront",!0),n.bindAction(68,!0,"duplicate"),n.bindAction(68,!0,"setAsDefaultStyle",!0),n.bindAction(90,!0,"undo"),n.bindAction(90,!0,"redo",!0),n.bindAction(89,!0,"redo"),n.bindAction(89,!0,"autosize",!0),n.bindAction(88,!0,"cut"),n.bindAction(67,!0,"copy"),n.bindAction(86,!0,"paste"),n.bindAction(71,!0,"group"),n.bindAction(77,!0,"editData"),n.bindAction(71,!0,"grid",!0),n.bindAction(73,!0,"italic"),n.bindAction(76,!0,"lockUnlock"),n.bindAction(76,!0,"layers",!0),n.bindAction(80,!0,"format",!0),n.bindAction(85,!0,"underline"),n.bindAction(85,!0,"ungroup",!0),n.bindAction(109,!0,"decreaseFontSize",!0),n.bindAction(107,!0,"increaseFontSize",!0),n.bindAction(219,!0,"decreaseFontSize",!0),n.bindAction(221,!0,"increaseFontSize",!0),n.bindAction(190,!0,"superscript"),n.bindAction(188,-!0,"subscript"),n.bindAction(13,!1,"keyPressEnter"),n.bindKey(113,function(){v.isEnabled()&&v.startEditingAtCell()});return n};EditorUi.prototype.createMenuElement=function(b,d,m){var p=document.createElement("a");this.addMenuHandler(p,d,m);mxUtils.write(p,b);p.className="geItem";return p};-EditorUi.prototype.addMenuHandler=function(b,d,m,p){if(null!=d){var v=null,n=!0,y=mxUtils.bind(this,function(C){null!=m&&m(C);if(!mxEvent.isConsumed(C)&&n&&(null==b.enabled||b.enabled)){this.editor.graph.popupMenuHandler.hideMenu();var P=new mxPopupMenu(d);P.smartSeparators=!0;P.showDisabled=!0;P.autoExpand=!0;P.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(P,arguments);this.resetCurrentMenu();v=null;P.destroy()});this.menus.autoPopup||null==this.currentMenu||this.hideCurrentMenu();-var G=mxUtils.getOffset(b);P.popup(G.x,G.y+b.offsetHeight,null,C);this.setCurrentMenu(P,b);v=P}p||mxEvent.consume(C)});mxEvent.addListener(b,"mousemove",mxUtils.bind(this,function(C){if(this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=b&&null!=this.currentMenuElt){var P=this.currentMenuElt;this.hideCurrentMenu();P.parentNode==b.parentNode&&"INPUT"!=b.nodeName&&y(C)}}));mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(C){!this.menus.autoPopup&&-null!=this.currentMenu&&this.currentMenuElt!=b&&mxEvent.isMouseEvent(C)&&this.hideCurrentMenu();n=null==this.currentMenu;"INPUT"!=mxEvent.getSource(C).nodeName?C.preventDefault():C.stopPropagation()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(C){y(C);n=!0}));p&&(mxEvent.addListener(b,"focus",mxUtils.bind(this,function(C){y(C);n=!0})),mxEvent.addListener(b,"blur",mxUtils.bind(this,function(C){this.currentMenu==v&&this.hideCurrentMenu()})),mxEvent.addListener(b,"keyup",mxUtils.bind(this,-function(C){38!=C.keyCode&&40!=C.keyCode&&(this.hideCurrentMenu(),13!=C.keyCode&&27!=C.keyCode&&(y(C),n=!0))})))}};-EditorUi.prototype.addShapePicker=function(b,d){var m=this.editor.graph;mxEvent.addListener(b,"click",mxUtils.bind(this,function(p){if(this.isShapePickerVisible())this.hideShapePicker();else{var v=mxUtils.getOffset(b);Editor.inlineFullscreen||null==this.embedViewport?d?(v.x-=this.diagramContainer.offsetLeft+30,v.y=b.offsetHeight-2):(v.x+=16+b.offsetHeight+this.sketchPickerMenuElt.offsetWidth/2,v.y+=20):(v.x=0,v.y=b.offsetTop);this.showShapePicker(Math.max(this.diagramContainer.scrollLeft+Math.max(24,-v.x)),this.diagramContainer.scrollTop+v.y,null,null,null,null,mxUtils.bind(this,function(n){return m.getCenterInsertPoint(m.getBoundingBoxFromGeometry(n,!0))}),d,!1)}mxEvent.consume(p)}))};+!0,"subscript"),n.bindAction(13,!1,"keyPressEnter"),n.bindKey(113,function(){u.isEnabled()&&u.startEditingAtCell()});return n};EditorUi.prototype.createMenuElement=function(b,d,m){var p=document.createElement("a");this.addMenuHandler(p,d,m);mxUtils.write(p,b);p.className="geItem";return p};+EditorUi.prototype.addMenuHandler=function(b,d,m,p){if(null!=d){var u=null,n=!0,y=mxUtils.bind(this,function(B){null!=m&&m(B);if(!mxEvent.isConsumed(B)&&n&&(null==b.enabled||b.enabled)){this.editor.graph.popupMenuHandler.hideMenu();var P=new mxPopupMenu(d);P.smartSeparators=!0;P.showDisabled=!0;P.autoExpand=!0;P.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(P,arguments);this.resetCurrentMenu();u=null;P.destroy()});this.menus.autoPopup||null==this.currentMenu||this.hideCurrentMenu();+var G=mxUtils.getOffset(b);P.popup(G.x,G.y+b.offsetHeight,null,B);this.setCurrentMenu(P,b);u=P}p||mxEvent.consume(B)});mxEvent.addListener(b,"mousemove",mxUtils.bind(this,function(B){if(this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=b&&null!=this.currentMenuElt){var P=this.currentMenuElt;this.hideCurrentMenu();P.parentNode==b.parentNode&&"INPUT"!=b.nodeName&&y(B)}}));mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(B){!this.menus.autoPopup&&+null!=this.currentMenu&&this.currentMenuElt!=b&&mxEvent.isMouseEvent(B)&&this.hideCurrentMenu();n=null==this.currentMenu;"INPUT"!=mxEvent.getSource(B).nodeName?B.preventDefault():B.stopPropagation()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(B){y(B);n=!0}));p&&(mxEvent.addListener(b,"focus",mxUtils.bind(this,function(B){y(B);n=!0})),mxEvent.addListener(b,"blur",mxUtils.bind(this,function(B){this.currentMenu==u&&this.hideCurrentMenu()})),mxEvent.addListener(b,"keyup",mxUtils.bind(this,+function(B){38!=B.keyCode&&40!=B.keyCode&&(this.hideCurrentMenu(),13!=B.keyCode&&27!=B.keyCode&&(y(B),n=!0))})))}};+EditorUi.prototype.addShapePicker=function(b,d){var m=this.editor.graph;mxEvent.addListener(b,"click",mxUtils.bind(this,function(p){if(this.isShapePickerVisible())this.hideShapePicker();else{var u=mxUtils.getOffset(b);Editor.inlineFullscreen||null==this.embedViewport?d?(u.x-=this.diagramContainer.offsetLeft+30,u.y=b.offsetHeight-2):(u.x+=16+b.offsetHeight+this.sketchPickerMenuElt.offsetWidth/2,u.y+=20):(u.x=0,u.y=b.offsetTop);this.showShapePicker(Math.max(this.diagramContainer.scrollLeft+Math.max(24,+u.x)),this.diagramContainer.scrollTop+u.y,null,null,null,null,mxUtils.bind(this,function(n){return m.getCenterInsertPoint(m.getBoundingBoxFromGeometry(n,!0))}),d,!1)}mxEvent.consume(p)}))};EditorUi.prototype.createZoomInput=function(b){var d=document.createElement("input");d.className="geButton geZoomInput";d.style.backgroundImage="url("+Editor.thinExpandImage+")";d.setAttribute("type","text");d.setAttribute("value","100%");var m=this.menus.get("viewZoom");this.dependsOnLanguage(mxUtils.bind(this,function(){d.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)")}));(b||mxClient.IS_TOUCH)&&d.setAttribute("readonly","true");var p=!1;mxEvent.addGestureListeners(d,mxUtils.bind(this,-function(v){p=!1;mxClient.IS_TOUCH||mxEvent.getSource(v)!=d||document.activeElement==d||(d.focus(),mxClient.IS_GC||mxClient.IS_FF?d.select():document.execCommand("selectAll",!1,null),p=!0)}),mxUtils.bind(this,function(v){mxEvent.getSource(v)==d&&p&&mxEvent.consume(v)}),mxUtils.bind(this,function(v){p&&(mxEvent.consume(v),p=!1)}));this.addMenuHandler(d,m.funct);mxUtils.bind(this,function(v){mxEvent.addListener(v,"click",mxUtils.bind(this,function(y){mxEvent.isAltDown(y)?(this.hideCurrentMenu(),this.actions.get("customZoom").funct(),-mxEvent.consume(y)):mxEvent.isShiftDown(y)&&(this.hideCurrentMenu(),this.actions.get("smartFit").funct(),mxEvent.consume(y))}));var n=mxUtils.bind(this,function(y,C,P){d.value=Math.round(100*this.editor.graph.view.scale*(null!=P?P:1))+"%";document.activeElement==d&&this.editor.graph.container.focus()});mxEvent.addListener(d,"keydown",mxUtils.bind(this,function(y){if(27==y.keyCode||13==y.keyCode||9==y.keyCode)27==y.keyCode||isNaN(parseInt(d.value))?n():this.editor.graph.zoomTo(parseInt(d.value)/100),-this.hideCurrentMenu(),mxEvent.consume(y)}));this.editor.graph.view.addListener(mxEvent.EVENT_SCALE,n);this.editor.addListener("resetGraphView",n);this.editor.addListener("pageSelected",n);mxEvent.addListener(d,"blur",n);this.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(y,C){n(y,C,C.getProperty("factor"))}))})(d);return d};+function(u){p=!1;mxClient.IS_TOUCH||mxEvent.getSource(u)!=d||document.activeElement==d||(d.focus(),mxClient.IS_GC||mxClient.IS_FF?d.select():document.execCommand("selectAll",!1,null),p=!0)}),mxUtils.bind(this,function(u){mxEvent.getSource(u)==d&&p&&mxEvent.consume(u)}),mxUtils.bind(this,function(u){p&&(mxEvent.consume(u),p=!1)}));this.addMenuHandler(d,m.funct);mxUtils.bind(this,function(u){mxEvent.addListener(u,"click",mxUtils.bind(this,function(y){mxEvent.isAltDown(y)?(this.hideCurrentMenu(),this.actions.get("customZoom").funct(),+mxEvent.consume(y)):mxEvent.isShiftDown(y)&&(this.hideCurrentMenu(),this.actions.get("smartFit").funct(),mxEvent.consume(y))}));var n=mxUtils.bind(this,function(y,B,P){d.value=Math.round(100*this.editor.graph.view.scale*(null!=P?P:1))+"%";document.activeElement==d&&this.editor.graph.container.focus()});mxEvent.addListener(d,"keydown",mxUtils.bind(this,function(y){if(27==y.keyCode||13==y.keyCode||9==y.keyCode)27==y.keyCode||isNaN(parseInt(d.value))?n():this.editor.graph.zoomTo(parseInt(d.value)/100),+this.hideCurrentMenu(),mxEvent.consume(y)}));this.editor.graph.view.addListener(mxEvent.EVENT_SCALE,n);this.editor.addListener("resetGraphView",n);this.editor.addListener("pageSelected",n);mxEvent.addListener(d,"blur",n);this.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(y,B){n(y,B,B.getProperty("factor"))}))})(d);return d};EditorUi.prototype.createHelpIcon=function(b,d){d=document.createElement("img");d.setAttribute("src",Editor.helpImage);d.setAttribute("title",mxResources.get("help")+" ("+b+")");d.className="geHelpIcon";mxEvent.addGestureListeners(d,mxUtils.bind(this,function(m){this.hideCurrentMenu();this.openLink(b);mxEvent.consume(m)}));return d};EditorUi.prototype.destroy=function(){var b=this.editor.graph;null!=b&&null!=this.selectionStateListener&&(b.getSelectionModel().removeListener(this.selectionStateListener),b.getModel().removeListener(this.selectionStateListener),b.getView().removeListener(this.selectionStateListener),b.removeListener(this.selectionStateListener),this.selectionStateListener=null);null!=this.inlineToolbar&&(this.inlineToolbar.destroy(),this.inlineToolbar=null);null!=this.sidebar&&(this.sidebar.destroy(),this.sidebar=null);null!=this.editor&&(this.editor.destroy(),this.editor=null);null!=this.menubar&&(this.menubar.destroy(),this.menubar=null);null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null);null!=this.keyHandler&&(this.keyHandler.destroy(),this.keyHandler=null);null!=this.keydownHandler&&(mxEvent.removeListener(document,"keydown",this.keydownHandler),this.keydownHandler=null);null!=this.keyupHandler&&(mxEvent.removeListener(document,"keyup",this.keyupHandler),this.keyupHandler=null);null!=this.resizeHandler&&(mxEvent.removeListener(window,"resize",this.resizeHandler),this.resizeHandler=null);null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gestureHandler),this.gestureHandler=null);null!=this.orientationChangeHandler&&(mxEvent.removeListener(window,"orientationchange",this.orientationChangeHandler),this.orientationChangeHandler=null);null!=this.scrollHandler&&(mxEvent.removeListener(window,"scroll",this.scrollHandler),this.scrollHandler=null);if(null!=this.destroyFunctions){for(b=-0;b<this.destroyFunctions.length;b++)this.destroyFunctions[b]();this.destroyFunctions=null}var d=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.hsplit,this.chromelessToolbar,this.layersDialog];for(b=0;b<d.length;b++)null!=d[b]&&null!=d[b].parentNode&&d[b].parentNode.removeChild(d[b])};(function(){var b=[["nbsp","160"],["shy","173"]],d=mxUtils.parseXml;mxUtils.parseXml=function(p){for(var v=0;v<b.length;v++)p=p.replace(new RegExp("&"+b[v][0]+";","g"),"&#"+b[v][1]+";");return d(p)};var m=mxUtils.getSizeForString;mxUtils.getSizeForString=function(p,v,n,y){return m(Graph.sanitizeHtml(p),v,n,y)}})();+0;b<this.destroyFunctions.length;b++)this.destroyFunctions[b]();this.destroyFunctions=null}var d=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.hsplit,this.chromelessToolbar,this.layersDialog];for(b=0;b<d.length;b++)null!=d[b]&&null!=d[b].parentNode&&d[b].parentNode.removeChild(d[b])};(function(){var b=[["nbsp","160"],["shy","173"]],d=mxUtils.parseXml;mxUtils.parseXml=function(p){for(var u=0;u<b.length;u++)p=p.replace(new RegExp("&"+b[u][0]+";","g"),"&#"+b[u][1]+";");return d(p)};var m=mxUtils.getSizeForString;mxUtils.getSizeForString=function(p,u,n,y){return m(Graph.sanitizeHtml(p),u,n,y)}})();Date.prototype.toISOString||function(){function b(d){d=String(d);1===d.length&&(d="0"+d);return d}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+b(this.getUTCMonth()+1)+"-"+b(this.getUTCDate())+"T"+b(this.getUTCHours())+":"+b(this.getUTCMinutes())+":"+b(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1E3).toFixed(3)).slice(2,5)+"Z"}}();Date.now||(Date.now=function(){return(new Date).getTime()});-Uint8Array.from||(Uint8Array.from=function(){var b=Object.prototype.toString,d=function(p){return"function"===typeof p||"[object Function]"===b.call(p)},m=Math.pow(2,53)-1;return function(p){var v=Object(p);if(null==p)throw new TypeError("Array.from requires an array-like object - not null or undefined");var n=1<arguments.length?arguments[1]:void 0,y;if("undefined"!==typeof n){if(!d(n))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(y=-arguments[2])}var C=Number(v.length);C=isNaN(C)?0:0!==C&&isFinite(C)?(0<C?1:-1)*Math.floor(Math.abs(C)):C;C=Math.min(Math.max(C,0),m);for(var P=d(this)?Object(new this(C)):Array(C),G=0,O;G<C;)O=v[G],P[G]=n?"undefined"===typeof y?n(O,G):n.call(y,O,G):O,G+=1;P.length=C;return P}}());mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxCodec.allowlist="mxStylesheet Array mxGraphModel mxCell mxGeometry mxRectangle mxPoint mxChildChange mxRootChange mxTerminalChange mxValueChange mxStyleChange mxGeometryChange mxCollapseChange mxVisibleChange mxCellAttributeChange".split(" ");+Uint8Array.from||(Uint8Array.from=function(){var b=Object.prototype.toString,d=function(p){return"function"===typeof p||"[object Function]"===b.call(p)},m=Math.pow(2,53)-1;return function(p){var u=Object(p);if(null==p)throw new TypeError("Array.from requires an array-like object - not null or undefined");var n=1<arguments.length?arguments[1]:void 0,y;if("undefined"!==typeof n){if(!d(n))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(y=+arguments[2])}var B=Number(u.length);B=isNaN(B)?0:0!==B&&isFinite(B)?(0<B?1:-1)*Math.floor(Math.abs(B)):B;B=Math.min(Math.max(B,0),m);for(var P=d(this)?Object(new this(B)):Array(B),G=0,O;G<B;)O=u[G],P[G]=n?"undefined"===typeof y?n(O,G):n.call(y,O,G):O,G+=1;P.length=B;return P}}());mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxCodec.allowlist="mxStylesheet Array mxGraphModel mxCell mxGeometry mxRectangle mxPoint mxChildChange mxRootChange mxTerminalChange mxValueChange mxStyleChange mxGeometryChange mxCollapseChange mxVisibleChange mxCellAttributeChange".split(" ");mxGraph.prototype.pageBreakColor="#c0c0c0";mxGraph.prototype.pageScale=1;(function(){try{if(null!=navigator&&null!=navigator.language){var b=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===b||"en-ca"===b||"es-mx"===b?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(d){}})();mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;mxGraphView.prototype.gridImage="data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.defaultGridColor="#e6e6e6";mxGraphView.prototype.defaultDarkGridColor="#424242";mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultGridColor;mxGraphView.prototype.unit=mxConstants.POINTS;mxGraphView.prototype.setUnit=function(b){this.unit!=b&&(this.unit=b,this.graph.refresh(),this.fireEvent(new mxEventObject("unitChanged","unit",b)))};mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]";mxShape.prototype.getConstraints=function(b,d,m){return null};mxImageShape.prototype.getImageDataUri=function(b){var d=String(this.image);if("data:image/svg+xml;base64,"==d.substring(0,26)&&null!=this.style){if("1"==mxUtils.getValue(this.style,"clipSvg","0")){if(null==this.clippedSvg||this.clippedImage!=d)this.clippedSvg=Graph.clipSvgDataUri(d),this.clippedImage=d;d=this.clippedSvg}if(null==b||null==b.createImageSymbol){if(b=Graph.getCssVariables(this.style),null!=b){if(null==this.themedSvg||this.themedImage!=d||this.themedVars!=b)this.themedSvg=Graph.setSvgDataUriCssVars(d,b),this.themedImage=d,this.themedVars=b;d=this.themedSvg}}else if(b=mxUtils.getValue(this.style,"editableCssRules",null),null!=b){if(void 0===this.canonicalSvg||this.canonicalImage!=d||this.canonicalRules!=b)this.canonicalSvg=Graph.canonicalizeSvgCssRules(d,b),this.canonicalImage=d,this.canonicalRules=b;null!=this.canonicalSvg&&(d=this.canonicalSvg.uri)}}return d};mxImageShape.prototype.getImageCssVars=function(b){var d=String(this.image),m=null;null!=this.style&&("data:"!=d.substring(0,5)?Graph.isSameOrigin(d)&&(m=Graph.getCssVariables(this.style)):null!=b&&null!=b.createImageSymbol&&"data:image/svg+xml;base64,"==d.substring(0,26)&&(b=[],null!=this.canonicalSvg&&this.canonicalRules==mxUtils.getValue(this.style,"editableCssRules",null)&&b.push(this.canonicalSvg.vars),null!=mxUtils.getValue(this.style,"cssVars",null)&&(d=Graph.getCssVariables(this.style),null!=-d?b.push(d):0==b.length&&(m="")),0<b.length&&(m=b.join("; "))));return m};(function(){var b=mxStencil.prototype.parseColor;mxStencil.prototype.parseColor=function(d,m,p,v,n){return"default"==v&&null!=n?"fillcolor"==p.nodeName?n.shapeBackgroundColor:n.shapeForegroundColor:b.apply(this,arguments)}})();(function(){var b=mxResources.get;mxResources.get=function(d,m,p){null==p&&(p=d);return b.apply(this,[d,m,p])}})();-(function(){var b=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(d,m,p,v,n,y,C,P){var G=b.apply(this,arguments);if(null!=m){var O=G.getElementsByTagName("img");0<O.length&&(O[0].className="geButton")}return G}})();-Graph=function(b,d,m,p,v,n){mxGraph.call(this,b,d,m,p);this.themes=v||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=n?n:!1;b=this.baseUrl;d=b.indexOf("//");this.domainPathUrl=this.domainUrl="";0<d&&(d=b.indexOf("/",d+2),0<d&&(this.domainUrl=b.substring(0,d)),d=b.lastIndexOf("/"),0<d&&(this.domainPathUrl=b.substring(0,d+1)));this.isHtmlLabel=function(l){l=this.getCurrentCellStyle(l);-return null!=l?"1"==l.html||"wrap"==l[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var y=null,C=null,P=null,G=null,O=!1,U=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(l,t){if("mouseDown"==t.getProperty("eventName")&&this.isEnabled()){l=t.getProperty("event");var H=l.getState();t=this.view.scale;if(!mxEvent.isAltDown(l.getEvent())&&null!=H&&(U=this.isCellSelected(H.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(l.getEvent()))){var J=this.selectionCellsHandler.getHandler(H.cell);+d?b.push(d):0==b.length&&(m="")),0<b.length&&(m=b.join("; "))));return m};(function(){var b=mxStencil.prototype.parseColor;mxStencil.prototype.parseColor=function(d,m,p,u,n){return"default"==u&&null!=n?"fillcolor"==p.nodeName?n.shapeBackgroundColor:n.shapeForegroundColor:b.apply(this,arguments)}})();(function(){var b=mxResources.get;mxResources.get=function(d,m,p){null==p&&(p=d);return b.apply(this,[d,m,p])}})();+(function(){var b=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(d,m,p,u,n,y,B,P){var G=b.apply(this,arguments);if(null!=m){var O=G.getElementsByTagName("img");0<O.length&&(O[0].className="geButton")}return G}})();+Graph=function(b,d,m,p,u,n){mxGraph.call(this,b,d,m,p);this.themes=u||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=n?n:!1;b=this.baseUrl;d=b.indexOf("//");this.domainPathUrl=this.domainUrl="";0<d&&(d=b.indexOf("/",d+2),0<d&&(this.domainUrl=b.substring(0,d)),d=b.lastIndexOf("/"),0<d&&(this.domainPathUrl=b.substring(0,d+1)));this.isHtmlLabel=function(l){l=this.getCurrentCellStyle(l);+return null!=l?"1"==l.html||"wrap"==l[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var y=null,B=null,P=null,G=null,O=!1,U=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(l,t){if("mouseDown"==t.getProperty("eventName")&&this.isEnabled()){l=t.getProperty("event");var H=l.getState();t=this.view.scale;if(!mxEvent.isAltDown(l.getEvent())&&null!=H&&(U=this.isCellSelected(H.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(l.getEvent()))){var J=this.selectionCellsHandler.getHandler(H.cell);if(null==J||null==J.getHandleForEvent(l)){var R=new mxRectangle(l.getGraphX()-1,l.getGraphY()-1),T=mxEvent.isTouchEvent(l.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;J=T+2;R.grow(T);if(this.isTableCell(H.cell)&&this.isCellMovable(H.cell)&&!this.isCellSelected(H.cell)&&!(mxUtils.contains(H,l.getGraphX()-J,l.getGraphY()-J)&&mxUtils.contains(H,l.getGraphX()-J,l.getGraphY()+J)&&mxUtils.contains(H,l.getGraphX()+J,l.getGraphY()+J)&&mxUtils.contains(H,l.getGraphX()+J,l.getGraphY()-J))){var Y=this.model.getParent(H.cell);J=this.model.getParent(Y);if(!this.isCellSelected(J)){T*=t;var Z=2*T;if(this.model.getChildAt(J,0)!=Y&&mxUtils.intersects(R,new mxRectangle(H.x,H.y-T,H.width,Z))||this.model.getChildAt(Y,0)!=H.cell&&mxUtils.intersects(R,new mxRectangle(H.x-T,H.y,Z,H.height))||mxUtils.intersects(R,new mxRectangle(H.x,H.y+H.height-T,H.width,Z))||mxUtils.intersects(R,new mxRectangle(H.x+H.width-T,H.y,Z,H.height)))Y=this.selectionCellsHandler.isHandled(J),this.selectCellForEvent(J,l.getEvent()),J=this.selectionCellsHandler.getHandler(J),null!=J&&(T=J.getHandleForEvent(l),null!=T&&(J.start(l.getGraphX(),l.getGraphY(),T),J.blockDelayedSelection=!Y,l.consume()))}}for(;!l.isConsumed()&&null!=H&&(this.isTableCell(H.cell)||this.isTableRow(H.cell)||this.isTable(H.cell));)this.isSwimlane(H.cell)&&this.isCellMovable(H.cell)&&(J=this.getActualStartSize(H.cell),(0<J.x||0<J.width)&&mxUtils.intersects(R,new mxRectangle(H.x+(J.x-J.width-1)*t+(0==J.x?H.width:0),H.y,1,H.height))||(0<J.y||0<J.height)&&mxUtils.intersects(R,new mxRectangle(H.x,H.y+(J.y-J.height-1)*t+(0==J.y?H.height:0),H.width,1)))&&(this.selectCellForEvent(H.cell,l.getEvent()),J=this.selectionCellsHandler.getHandler(H.cell),null!=J&&null!=J.customHandles&&(T=mxEvent.CUSTOM_HANDLE-J.customHandles.length+1,J.start(l.getGraphX(),l.getGraphY(),T),l.consume())),H=this.view.getState(this.model.getParent(H.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,mxUtils.bind(this,function(l,t){if("mouseDown"==t.getProperty("eventName")&&-this.isEnabled()){l=t.getProperty("event");var H=l.getState();mxEvent.isAltDown(l.getEvent())||mxEvent.isControlDown(t)||mxEvent.isShiftDown(t)||U||null==H||!this.model.isEdge(H.cell)||(y=new mxPoint(l.getGraphX(),l.getGraphY()),O=this.isCellSelected(H.cell),P=H,C=l,null!=H.text&&null!=H.text.boundingBox&&mxUtils.contains(H.text.boundingBox,l.getGraphX(),l.getGraphY())?G=mxEvent.LABEL_HANDLE:(t=this.selectionCellsHandler.getHandler(H.cell),null!=t&&null!=t.bends&&0<t.bends.length&&(G=t.getHandleForEvent(l))))}}));-this.addMouseListener({mouseDown:function(l,t){},mouseMove:mxUtils.bind(this,function(l,t){l=this.selectionCellsHandler.handlers.map;for(var H in l)if(null!=l[H].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(t.getEvent())){var J=this.tolerance;if(null!=y&&null!=P&&null!=C){if(H=P,null!=G||Math.abs(y.x-t.getGraphX())>J||Math.abs(y.y-t.getGraphY())>J){var R=null;mxEvent.isShiftDown(t.getEvent())||(R=this.selectionCellsHandler.getHandler(H.cell));if(null!=R&&null!=-R.bends&&0<R.bends.length){R.redrawHandles();var T=null!=G?G:R.getHandleForEvent(C),Y=this.view.getEdgeStyle(H),Z=Y==mxEdgeStyle.EntityRelation;J=H.absolutePoints;O||(T=G);T!=mxEvent.LABEL_HANDLE&&null!=J&&(T=G,null==T&&(l=new mxRectangle(y.x,y.y),l.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(l,J[0].x,J[0].y)?T=0:mxUtils.contains(l,J[J.length-1].x,J[J.length-1].y)?T=R.bends.length-1:null!=J&&(null==Y&&null==T||Y==mxEdgeStyle.SegmentConnector||Y==mxEdgeStyle.OrthConnector)&&+this.isEnabled()){l=t.getProperty("event");var H=l.getState();mxEvent.isAltDown(l.getEvent())||mxEvent.isControlDown(t)||mxEvent.isShiftDown(t)||U||null==H||!this.model.isEdge(H.cell)||(y=new mxPoint(l.getGraphX(),l.getGraphY()),O=this.isCellSelected(H.cell),P=H,B=l,null!=H.text&&null!=H.text.boundingBox&&mxUtils.contains(H.text.boundingBox,l.getGraphX(),l.getGraphY())?G=mxEvent.LABEL_HANDLE:(t=this.selectionCellsHandler.getHandler(H.cell),null!=t&&null!=t.bends&&0<t.bends.length&&(G=t.getHandleForEvent(l))))}}));+this.addMouseListener({mouseDown:function(l,t){},mouseMove:mxUtils.bind(this,function(l,t){l=this.selectionCellsHandler.handlers.map;for(var H in l)if(null!=l[H].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(t.getEvent())){var J=this.tolerance;if(null!=y&&null!=P&&null!=B){if(H=P,null!=G||Math.abs(y.x-t.getGraphX())>J||Math.abs(y.y-t.getGraphY())>J){var R=null;mxEvent.isShiftDown(t.getEvent())||(R=this.selectionCellsHandler.getHandler(H.cell));if(null!=R&&null!=+R.bends&&0<R.bends.length){R.redrawHandles();var T=null!=G?G:R.getHandleForEvent(B),Y=this.view.getEdgeStyle(H),Z=Y==mxEdgeStyle.EntityRelation;J=H.absolutePoints;O||(T=G);T!=mxEvent.LABEL_HANDLE&&null!=J&&(T=G,null==T&&(l=new mxRectangle(y.x,y.y),l.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(l,J[0].x,J[0].y)?T=0:mxUtils.contains(l,J[J.length-1].x,J[J.length-1].y)?T=R.bends.length-1:null!=J&&(null==Y&&null==T||Y==mxEdgeStyle.SegmentConnector||Y==mxEdgeStyle.OrthConnector)&&(null!=Y&&(2==J.length||3==J.length&&(0==Math.round(J[0].x-J[1].x)&&0==Math.round(J[1].x-J[2].x)||0==Math.round(J[0].y-J[1].y)&&0==Math.round(J[1].y-J[2].y)))?T=2:(T=mxUtils.findNearestSegment(H,y.x,y.y),T=null==Y?mxEvent.VIRTUAL_HANDLE-T:T+1))),null==T&&(T=mxEvent.VIRTUAL_HANDLE));l=T==mxEvent.LABEL_HANDLE||0==T||T==R.bends.length-1;if(!Z&&(null!=H.visibleSourceState||null!=H.visibleTargetState)||l)R.start(t.getGraphX(),t.getGraphX(),T),t.consume(),this.graphHandler.reset()}null!=R&&(this.selectionCellsHandler.isHandlerActive(R)?-this.isCellSelected(H.cell)||(this.selectionCellsHandler.handlers.put(H.cell,R),this.selectCellForEvent(H.cell,t.getEvent())):this.isCellSelected(H.cell)||R.destroy());O=!1;y=C=P=G=null}}else if(H=t.getState(),null!=H&&this.isCellEditable(H.cell)){l=this.model.getParent(H.cell);R=null;if(this.model.isEdge(H.cell)&&!this.isCellSelected(H.cell)&&!mxEvent.isAltDown(t.getEvent())&&!mxEvent.isShiftDown(t.getEvent())&&!this.isAncestorSelected(H.cell)&&(this.isSwimlane(l)||this.model.isLayer(l)||this.getCurrentRoot()==+this.isCellSelected(H.cell)||(this.selectionCellsHandler.handlers.put(H.cell,R),this.selectCellForEvent(H.cell,t.getEvent())):this.isCellSelected(H.cell)||R.destroy());O=!1;y=B=P=G=null}}else if(H=t.getState(),null!=H&&this.isCellEditable(H.cell)){l=this.model.getParent(H.cell);R=null;if(this.model.isEdge(H.cell)&&!this.isCellSelected(H.cell)&&!mxEvent.isAltDown(t.getEvent())&&!mxEvent.isShiftDown(t.getEvent())&&!this.isAncestorSelected(H.cell)&&(this.isSwimlane(l)||this.model.isLayer(l)||this.getCurrentRoot()==l)){if(l=new mxRectangle(t.getGraphX(),t.getGraphY()),l.grow(mxEdgeHandler.prototype.handleImage.width/2),J=H.absolutePoints,null!=J)null!=H.text&&null!=H.text.boundingBox&&mxUtils.contains(H.text.boundingBox,t.getGraphX(),t.getGraphY())?R="move":mxUtils.contains(l,J[0].x,J[0].y)||mxUtils.contains(l,J[J.length-1].x,J[J.length-1].y)?R="pointer":(Y=this.view.getEdgeStyle(H),Y==mxEdgeStyle.EntityRelation||null==H.visibleSourceState&&null==H.visibleTargetState||(R="crosshair",Y!=mxEdgeStyle.SegmentConnector&&Y!=mxEdgeStyle.OrthConnector))||(t=mxUtils.findNearestSegment(H,t.getGraphX(),t.getGraphY()),t<J.length-1&&0<=t&&(R=0==Math.round(J[t].x-J[t+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(t.getEvent())){J=mxShape.prototype.svgStrokeTolerance/2;l=new mxRectangle(t.getGraphX(),t.getGraphY());l.grow(J);if(this.isTableCell(H.cell)&&this.isCellMovable(H.cell)&&(t=this.model.getParent(H.cell),J=this.model.getParent(t),!this.isCellSelected(J)))if(mxUtils.intersects(l,new mxRectangle(H.x,H.y-2,H.width,4))&&this.model.getChildAt(J,0)!=t||mxUtils.intersects(l,new mxRectangle(H.x,H.y+H.height-2,H.width,4)))R="row-resize";else if(mxUtils.intersects(l,new mxRectangle(H.x-2,H.y,4,H.height))&&this.model.getChildAt(t,0)!=H.cell||mxUtils.intersects(l,new mxRectangle(H.x+H.width-2,H.y,4,H.height)))R="col-resize";for(t=H;null==R&&null!=t&&(this.isTableCell(t.cell)||this.isTableRow(t.cell)||this.isTable(t.cell));)this.isSwimlane(t.cell)&&this.isCellMovable(t.cell)&&(J=this.getActualStartSize(t.cell),-T=this.view.scale,(0<J.x||0<J.width)&&mxUtils.intersects(l,new mxRectangle(t.x+(J.x-J.width-1)*T+(0==J.x?t.width*T:0),t.y,1,t.height))?R="col-resize":(0<J.y||0<J.height)&&mxUtils.intersects(l,new mxRectangle(t.x,t.y+(J.y-J.height-1)*T+(0==J.y?t.height:0),t.width,1))&&(R="row-resize")),t=this.view.getState(this.model.getParent(t.cell))}null!=R&&H.setCursor(R)}}}),mouseUp:mxUtils.bind(this,function(l,t){G=y=C=P=null})})}this.cellRenderer.minSvgStrokeWidth=.1;var c=document.createElement("div");this.cellRenderer.getLabelValue=+T=this.view.scale,(0<J.x||0<J.width)&&mxUtils.intersects(l,new mxRectangle(t.x+(J.x-J.width-1)*T+(0==J.x?t.width*T:0),t.y,1,t.height))?R="col-resize":(0<J.y||0<J.height)&&mxUtils.intersects(l,new mxRectangle(t.x,t.y+(J.y-J.height-1)*T+(0==J.y?t.height:0),t.width,1))&&(R="row-resize")),t=this.view.getState(this.model.getParent(t.cell))}null!=R&&H.setCursor(R)}}}),mouseUp:mxUtils.bind(this,function(l,t){G=y=B=P=null})})}this.cellRenderer.minSvgStrokeWidth=.1;var c=document.createElement("div");this.cellRenderer.getLabelValue=function(l){var t=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);l.view.graph.isHtmlLabel(l.cell)&&("0"==mxUtils.getValue(l.style,"html","0")?t=mxUtils.htmlEntities(t,!1):(l.lastLabelValue!=t&&(l.lastLabelValue=t,l.lastSanitizedLabelValue=Graph.sanitizeHtml(t),c.innerHTML=l.lastSanitizedLabelValue,Graph.addLightDarkColors(c,null,"simple"==l.view.graph.getAdaptiveColors())&&(l.lastSanitizedLabelValue=c.innerHTML)),t=l.lastSanitizedLabelValue));return t};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(l,t){return!1};this.alternateEdgeStyle="vertical";null==p&&this.loadStylesheet();var f=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var l=f.apply(this,arguments);if(this.graph.pageVisible){var t=[],H=this.graph.pageFormat,J=this.graph.pageScale,R=H.width*J;H=H.height*J;J=this.graph.view.translate;for(var T=this.graph.view.scale,Y=this.graph.getPageLayout(),Z=0;Z<Y.width;Z++)t.push(new mxRectangle(((Y.x+Z)*R+J.x)*T,(Y.y*H+J.y)*T,R*T,H*T));for(Z=1;Z<Y.height;Z++)t.push(new mxRectangle((Y.x*R+J.x)*T,((Y.y+Z)*H+J.y)*T,R*T,H*T));l=t.concat(l)}return l};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(l,t){return null==l.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(l){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var k=this.graphHandler.getCells;this.graphHandler.getCells=function(l){for(var t=k.apply(this,arguments),H=new mxDictionary,J=[],R=0;R<t.length;R++){var T=this.graph.isTableCell(l)&&this.graph.isTableCell(t[R])&&this.graph.isCellSelected(t[R])?this.graph.model.getParent(t[R]):this.graph.isTableRow(l)&&this.graph.isTableRow(t[R])&&this.graph.isCellSelected(t[R])?t[R]:this.graph.getCompositeParent(t[R]);null==T||H.get(T)||(H.put(T,!0),J.push(T))}return J};var q=this.graphHandler.start;this.graphHandler.start=function(l,t,H,J){var R=!1;this.graph.isTableCell(l)&&(this.graph.isCellSelected(l)?R=!0:l=this.graph.model.getParent(l));R||this.graph.isTableRow(l)&&this.graph.isCellSelected(l)||(l=this.graph.getCompositeParent(l));q.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(l,t){t=this.graph.getCompositeParent(t);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(l,t,H,J,R,T){var Y=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=J&&this.graph.applyNewEdgeStyle(J,[Y]);return Y};var x=new mxRubberband(this);this.getRubberband=function(){return x};-var B=(new Date).getTime(),E=0,L=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var l=this.currentState;L.apply(this,arguments);l!=this.currentState?(B=(new Date).getTime(),E=0):E=(new Date).getTime()-B};var Q=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(l){return mxEvent.isShiftDown(l.getEvent())&&mxEvent.isAltDown(l.getEvent())?!1:null!=this.currentState&&l.getState()==this.currentState&&2E3<E||(null==this.currentState||+var C=(new Date).getTime(),E=0,L=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var l=this.currentState;L.apply(this,arguments);l!=this.currentState?(C=(new Date).getTime(),E=0):E=(new Date).getTime()-C};var Q=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(l){return mxEvent.isShiftDown(l.getEvent())&&mxEvent.isAltDown(l.getEvent())?!1:null!=this.currentState&&l.getState()==this.currentState&&2E3<E||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&Q.apply(this,arguments)};var V=this.isToggleEvent;this.isToggleEvent=function(l){return V.apply(this,arguments)||mxEvent.isShiftDown(l)};var K=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(K=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=K)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(l){return mxEvent.isMouseEvent(l.getEvent())};var fa=this.click;this.click=function(l){var t=null==l.state&&null!=l.sourceState&&this.isCellLocked(this.getLayerForCell(l.sourceState.cell));if(this.isEnabled()&&!t||l.isConsumed())return fa.apply(this,arguments);var H=t?l.sourceState.cell:l.getCell();if(null!=H){var J=this.getClickableLinkForCell(H);null!=J?this.isCustomLink(J)?this.customLinkClicked(J,H):this.openLink(J):t&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=function(l){return l.sourceState};var aa=this.tooltipHandler.show;this.tooltipHandler.show=function(){aa.apply(this,arguments);if(null!=this.div)for(var l=this.div.getElementsByTagName("a"),t=0;t<l.length;t++)null!=l[t].getAttribute("href")&&null==l[t].getAttribute("target")&&l[t].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(l){return l.sourceState};this.getCursorForMouseEvent=function(l){var t=null==@@ -2448,175 +2448,175 @@ Graph.cellStyles=mxUtils.addItems(mxUtils.addItems(mxUtils.addItems("rounded shaGraph.edgeStyles),Graph.cellStyleGroups);Graph.layoutNames="mxHierarchicalLayout mxCircleLayout mxCompactTreeLayout mxEdgeLabelLayout mxFastOrganicLayout mxParallelEdgeLayout mxPartitionLayout mxRadialTreeLayout mxStackLayout elkLayered elkTree elkRadial elkOrganic elkStress elkDisco elkBox".split(" ");Graph.elkLayoutAlgorithms={elkLayered:"layered",elkTree:"mrtree",elkRadial:"radial",elkOrganic:"force",elkStress:"stress",elkDisco:"disco",elkBox:"box"};Graph.elkLayoutNameForAlgorithm=function(b){for(var d in Graph.elkLayoutAlgorithms)if(Graph.elkLayoutAlgorithms[d]===b)return d;return null};Graph.backupStyleAttribute="data-mx-given-colors";Graph.newColorPlaceholder="rgba(0, 0, 0, 0)";Graph.newBackgroundPlaceholder="rgb(0, 0, 0)";Graph.defaultAdaptiveColors="0"==urlParams.contrast?"simple":"auto";Graph.getDefaultAdaptiveColorsKey=function(){return"auto"==Graph.defaultAdaptiveColors?"automatic":Graph.defaultAdaptiveColors};Graph.createOffscreenGraph=function(b){var d=new Graph(document.createElement("div"));d.stylesheet.styles=mxUtils.clone(b.styles);d.resetViewOnRootChange=!1;d.setConnectable(!1);d.gridEnabled=!1;d.autoScroll=!1;d.setTooltips(!1);d.setEnabled(!1);d.container.style.visibility="hidden";d.container.style.position="absolute";d.container.style.overflow="hidden";d.container.style.height="1px";d.container.style.width="1px";return d};-Graph.createSvgImage=function(b,d,m,p,v){m=unescape(encodeURIComponent(Graph.svgDoctype+'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+b+'px" height="'+d+'px" '+(null!=p&&null!=v?'viewBox="0 0 '+p+" "+v+'" ':"")+'version="1.1" style="color-scheme: light dark;">'+m+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(m):Base64.encode(m,!0)),b,d)};+Graph.createSvgImage=function(b,d,m,p,u){m=unescape(encodeURIComponent(Graph.svgDoctype+'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+b+'px" height="'+d+'px" '+(null!=p&&null!=u?'viewBox="0 0 '+p+" "+u+'" ':"")+'version="1.1" style="color-scheme: light dark;">'+m+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(m):Base64.encode(m,!0)),b,d)};Graph.getSvgFromDataUri=function(b){return null!=b&&"data:image/svg"==b.substring(0,14)?Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+decodeURIComponent(escape(atob(b.substring(b.indexOf(",")+1)))):null};Graph.svgBackgroundVar="--ge-adaptive-bg";-Graph.createSvgNode=function(b,d,m,p,v){var n=mxUtils.createXmlDocument(),y=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=v&&y.setAttribute("style","background: "+v.light+"; background-color: "+v.cssText+";");null==n.createElementNS?(y.setAttribute("xmlns",mxConstants.NS_SVG),y.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):y.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);y.setAttribute("version","1.1");y.setAttribute("width",+Graph.createSvgNode=function(b,d,m,p,u){var n=mxUtils.createXmlDocument(),y=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=u&&y.setAttribute("style","background: "+u.light+"; background-color: "+u.cssText+";");null==n.createElementNS?(y.setAttribute("xmlns",mxConstants.NS_SVG),y.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):y.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);y.setAttribute("version","1.1");y.setAttribute("width",m+"px");y.setAttribute("height",p+"px");y.setAttribute("viewBox",b+" "+d+" "+m+" "+p);n.appendChild(y);return y};-Graph.addAdaptiveColors=function(b,d){if(mxUtils.lightDarkColorSupported&&(d=mxUtils.getLightDarkColor(d),!(0>d.cssText.indexOf("var(")))){for(var m="var("+Graph.svgBackgroundVar+", "+d.light+")",p=b.getElementsByTagName("*"),v=[b],n=!1,y=0;y<p.length;y++)v.push(p[y]);for(y=0;y<v.length;y++)p=v[y].getAttribute("style"),null!=p&&0<=p.indexOf(d.cssText)&&(v[y].setAttribute("style",p.split(d.cssText).join(m)),n=!0);if(n){m=b.ownerDocument;v=b.getAttribute("id");if(null==v||""==v)v="ge-svg-"+Editor.guid(),-b.setAttribute("id",v);n=null!=m.createElementNS?m.createElementNS(mxConstants.NS_SVG,"style"):m.createElement("style");n.setAttribute("type","text/css");n.appendChild(m.createTextNode("@supports (color: light-dark(#000, #fff)) { #"+v+" { "+Graph.svgBackgroundVar+": "+d.cssText+"; } }"));b.insertBefore(n,b.firstChild)}}};-Graph.htmlToPng=function(b,d,m,p,v,n){v=null!=v?v:"";n=null!=n?n:Editor.htmlRasterScale;var y=document.createElement("canvas");y.width=d*n;y.height=m*n;var C=document.createElement("img");C.onload=mxUtils.bind(this,function(){try{var G=y.getContext("2d");G.scale(n,n);G.drawImage(C,0,0);p(y.toDataURL())}catch(O){p(null)}});var P=mxUtils.createXmlDocument();P=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"svg"):P.createElement("svg");b=(new mxSvgCanvas2D(P)).convertHtml(b);C.onerror=-function(G){p(null)};C.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+d+'" height="'+m+'">'+(""!=v?'<defs xmlns="http://www.w3.org/2000/svg"><style type="text/css">'+v+"</style></defs>":"")+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+b+"</div></foreignObject></svg>")};-Graph.addLightDarkColors=function(b,d,m,p){function v(c,f,k){return null!=p?p(c,f,k):mxUtils.isValidColor(k)?(null==y&&null!=d&&(y={}),null!=y&&(y[f]=c.style.getPropertyValue(f)),k=mxUtils.getLightDarkColor(k,null,null,m),c.style.setProperty(f,k.cssText),!0):!1}for(var n=b.getElementsByTagName("*"),y=null,C=!1,P=0;P<n.length;P++)if(n[P]!=b&&null!=n[P].style){y=null;for(var G=0;G<n[P].style.length;G++){var O=n[P].style.item(G),U=n[P].style.getPropertyValue(O);C=v(n[P],O,U)||C}"FONT"==n[P].nodeName&&-""==n[P].style.getPropertyValue("color")&&(U=n[P].getAttribute("color"),C=v(n[P],"color",U)||C);null!=d&&null!=y&&n[P].setAttribute(d,JSON.stringify(y))}return C};Graph.removeLightDarkColors=function(b,d){b=b.getElementsByTagName("*");for(var m=!1,p=0;p<b.length;p++)try{var v=b[p].getAttribute(d);if(null!=v){b[p].removeAttribute(d);var n=JSON.parse(v),y;for(y in n){var C=n[y];""==C?(b[p].style[y]=null,""==b[p].getAttribute("style")&&b[p].removeAttribute("style")):b[p].style[y]=C;m=!0}}}catch(P){}return m};-Graph.getGivenColor=function(b,d){var m=null;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){try{var p=b.getAttribute(Graph.backupStyleAttribute);if(null!=p){var v=JSON.parse(p);null!=v&&null!=v[d]&&("color"==d&&"FONT"==b.nodeName&&""==v[d]&&null!=b.getAttribute("color")?m=b.getAttribute("color"):""!=v[d]&&(m=v[d]))}}catch(n){}null==m&&""!=b.style[d]&&(m=b.style[d])}return m};-Graph.setTextColor=function(b,d,m){for(var p=m?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,v=m?"color":"background-color",n=b.getElementsByTagName("*"),y=[],C=0;C<n.length;C++)y.push({node:n[C],value:n[C].style[v]});C=document.queryCommandState("styleWithCSS");m&&!C&&document.execCommand("styleWithCSS",!1,!0);document.execCommand(m?"forecolor":"backcolor",!1,p);m&&!C&&document.execCommand("styleWithCSS",!1,!1);b=b.getElementsByTagName("*");for(C=0;C<b.length;C++){if(C<y.length&&y[C].node==-b[C]&&y[C].value!=b[C].style[v]&&""==b[C].style[v])try{if(n=b[C].getAttribute(Graph.backupStyleAttribute),null!=n){var P=JSON.parse(n);P[v]="";b[C].setAttribute(Graph.backupStyleAttribute,JSON.stringify(P))}}catch(G){}if(m&&b[C].getAttribute("color")==p||b[C].style[v]==p){m&&b[C].getAttribute("color")==p&&b[C].removeAttribute("color");b[C].style[v]=d!=mxConstants.NONE?mxUtils.getLightDarkColor(d).cssText:null;try{n=b[C].getAttribute(Graph.backupStyleAttribute),P=null!=n?JSON.parse(n):{},P[v]=d!=mxConstants.NONE?-d:"",b[C].setAttribute(Graph.backupStyleAttribute,JSON.stringify(P))}catch(G){}if(m&&mxClient.IS_FF){d=b[C];m=d.firstChild;if(null!=m&&"A"==m.nodeName&&null==m.nextSibling&&null!=m.firstChild){d.parentNode.insertBefore(m,d);for(p=m.firstChild;null!=p;)v=p.nextSibling,d.appendChild(p),p=v;m.appendChild(d)}break}}}};Graph.zapGremlins=function(b){return mxUtils.zapGremlins(b)};Graph.stringToBytes=function(b){for(var d=Array(b.length),m=0;m<b.length;m++)d[m]=b.charCodeAt(m);return d};+Graph.addAdaptiveColors=function(b,d){if(mxUtils.lightDarkColorSupported&&(d=mxUtils.getLightDarkColor(d),!(0>d.cssText.indexOf("var(")))){for(var m="var("+Graph.svgBackgroundVar+", "+d.light+")",p=b.getElementsByTagName("*"),u=[b],n=!1,y=0;y<p.length;y++)u.push(p[y]);for(y=0;y<u.length;y++)p=u[y].getAttribute("style"),null!=p&&0<=p.indexOf(d.cssText)&&(u[y].setAttribute("style",p.split(d.cssText).join(m)),n=!0);if(n){m=b.ownerDocument;u=b.getAttribute("id");if(null==u||""==u)u="ge-svg-"+Editor.guid(),+b.setAttribute("id",u);n=null!=m.createElementNS?m.createElementNS(mxConstants.NS_SVG,"style"):m.createElement("style");n.setAttribute("type","text/css");n.appendChild(m.createTextNode("@supports (color: light-dark(#000, #fff)) { #"+u+" { "+Graph.svgBackgroundVar+": "+d.cssText+"; } }"));b.insertBefore(n,b.firstChild)}}};+Graph.htmlToPng=function(b,d,m,p,u,n){u=null!=u?u:"";n=null!=n?n:Editor.htmlRasterScale;var y=document.createElement("canvas");y.width=d*n;y.height=m*n;var B=document.createElement("img");B.onload=mxUtils.bind(this,function(){try{var G=y.getContext("2d");G.scale(n,n);G.drawImage(B,0,0);p(y.toDataURL())}catch(O){p(null)}});var P=mxUtils.createXmlDocument();P=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"svg"):P.createElement("svg");b=(new mxSvgCanvas2D(P)).convertHtml(b);B.onerror=+function(G){p(null)};B.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+d+'" height="'+m+'">'+(""!=u?'<defs xmlns="http://www.w3.org/2000/svg"><style type="text/css">'+u+"</style></defs>":"")+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+b+"</div></foreignObject></svg>")};+Graph.addLightDarkColors=function(b,d,m,p){function u(c,f,k){return null!=p?p(c,f,k):mxUtils.isValidColor(k)?(null==y&&null!=d&&(y={}),null!=y&&(y[f]=c.style.getPropertyValue(f)),k=mxUtils.getLightDarkColor(k,null,null,m),c.style.setProperty(f,k.cssText),!0):!1}for(var n=b.getElementsByTagName("*"),y=null,B=!1,P=0;P<n.length;P++)if(n[P]!=b&&null!=n[P].style){y=null;for(var G=0;G<n[P].style.length;G++){var O=n[P].style.item(G),U=n[P].style.getPropertyValue(O);B=u(n[P],O,U)||B}"FONT"==n[P].nodeName&&+""==n[P].style.getPropertyValue("color")&&(U=n[P].getAttribute("color"),B=u(n[P],"color",U)||B);null!=d&&null!=y&&n[P].setAttribute(d,JSON.stringify(y))}return B};Graph.removeLightDarkColors=function(b,d){b=b.getElementsByTagName("*");for(var m=!1,p=0;p<b.length;p++)try{var u=b[p].getAttribute(d);if(null!=u){b[p].removeAttribute(d);var n=JSON.parse(u),y;for(y in n){var B=n[y];""==B?(b[p].style[y]=null,""==b[p].getAttribute("style")&&b[p].removeAttribute("style")):b[p].style[y]=B;m=!0}}}catch(P){}return m};+Graph.getGivenColor=function(b,d){var m=null;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){try{var p=b.getAttribute(Graph.backupStyleAttribute);if(null!=p){var u=JSON.parse(p);null!=u&&null!=u[d]&&("color"==d&&"FONT"==b.nodeName&&""==u[d]&&null!=b.getAttribute("color")?m=b.getAttribute("color"):""!=u[d]&&(m=u[d]))}}catch(n){}null==m&&""!=b.style[d]&&(m=b.style[d])}return m};+Graph.setTextColor=function(b,d,m){for(var p=m?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,u=m?"color":"background-color",n=b.getElementsByTagName("*"),y=[],B=0;B<n.length;B++)y.push({node:n[B],value:n[B].style[u]});B=document.queryCommandState("styleWithCSS");m&&!B&&document.execCommand("styleWithCSS",!1,!0);document.execCommand(m?"forecolor":"backcolor",!1,p);m&&!B&&document.execCommand("styleWithCSS",!1,!1);b=b.getElementsByTagName("*");for(B=0;B<b.length;B++){if(B<y.length&&y[B].node==+b[B]&&y[B].value!=b[B].style[u]&&""==b[B].style[u])try{if(n=b[B].getAttribute(Graph.backupStyleAttribute),null!=n){var P=JSON.parse(n);P[u]="";b[B].setAttribute(Graph.backupStyleAttribute,JSON.stringify(P))}}catch(G){}if(m&&b[B].getAttribute("color")==p||b[B].style[u]==p){m&&b[B].getAttribute("color")==p&&b[B].removeAttribute("color");b[B].style[u]=d!=mxConstants.NONE?mxUtils.getLightDarkColor(d).cssText:null;try{n=b[B].getAttribute(Graph.backupStyleAttribute),P=null!=n?JSON.parse(n):{},P[u]=d!=mxConstants.NONE?+d:"",b[B].setAttribute(Graph.backupStyleAttribute,JSON.stringify(P))}catch(G){}if(m&&mxClient.IS_FF){d=b[B];m=d.firstChild;if(null!=m&&"A"==m.nodeName&&null==m.nextSibling&&null!=m.firstChild){d.parentNode.insertBefore(m,d);for(p=m.firstChild;null!=p;)u=p.nextSibling,d.appendChild(p),p=u;m.appendChild(d)}break}}}};Graph.zapGremlins=function(b){return mxUtils.zapGremlins(b)};Graph.stringToBytes=function(b){for(var d=Array(b.length),m=0;m<b.length;m++)d[m]=b.charCodeAt(m);return d};Graph.bytesToString=function(b){for(var d=Array(b.length),m=0;m<b.length;m++)d[m]=String.fromCharCode(b[m]);return d.join("")};Graph.base64EncodeUnicode=function(b){return btoa(encodeURIComponent(b).replace(/%([0-9A-F]{2})/g,function(d,m){return String.fromCharCode(parseInt(m,16))}))};Graph.base64DecodeUnicode=function(b){return decodeURIComponent(Array.prototype.map.call(atob(b),function(d){return"%"+("00"+d.charCodeAt(0).toString(16)).slice(-2)}).join(""))};Graph.compressNode=function(b,d){b=mxUtils.getXml(b);return Graph.compress(d?b:Graph.zapGremlins(b))};Graph.arrayBufferToString=function(b){var d="";b=new Uint8Array(b);for(var m=b.byteLength,p=0;p<m;p++)d+=String.fromCharCode(b[p]);return d};Graph.stringToArrayBuffer=function(b){return Uint8Array.from(b,function(d){return d.charCodeAt(0)})};-Graph.arrayBufferIndexOfString=function(b,d,m){var p=d.charCodeAt(0),v=1,n=-1;for(m=m||0;m<b.byteLength;m++)if(b[m]==p){n=m;break}for(m=n+1;-1<n&&m<b.byteLength&&m<n+d.length-1;m++){if(b[m]!=d.charCodeAt(v))return Graph.arrayBufferIndexOfString(b,d,n+1);v++}return v==d.length-1?n:-1};Graph.compress=function(b,d){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=d?pako.deflate(encodeURIComponent(b)):pako.deflateRaw(encodeURIComponent(b));return btoa(Graph.arrayBufferToString(new Uint8Array(b)))};+Graph.arrayBufferIndexOfString=function(b,d,m){var p=d.charCodeAt(0),u=1,n=-1;for(m=m||0;m<b.byteLength;m++)if(b[m]==p){n=m;break}for(m=n+1;-1<n&&m<b.byteLength&&m<n+d.length-1;m++){if(b[m]!=d.charCodeAt(u))return Graph.arrayBufferIndexOfString(b,d,n+1);u++}return u==d.length-1?n:-1};Graph.compress=function(b,d){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=d?pako.deflate(encodeURIComponent(b)):pako.deflateRaw(encodeURIComponent(b));return btoa(Graph.arrayBufferToString(new Uint8Array(b)))};Graph.decompress=function(b,d,m){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=Graph.stringToArrayBuffer(atob(b));d=decodeURIComponent(d?pako.inflate(b,{to:"string"}):pako.inflateRaw(b,{to:"string"}));return m?d:Graph.zapGremlins(d)};-Graph.fadeNodes=function(b,d,m,p,v){v=null!=v?v:1E3;Graph.setTransitionForNodes(b,null);Graph.setOpacityForNodes(b,d);window.setTimeout(function(){Graph.setTransitionForNodes(b,"all "+v+"ms ease-in-out");Graph.setOpacityForNodes(b,m);window.setTimeout(function(){Graph.setTransitionForNodes(b,null);null!=p&&p()},v)},0)};-Graph.exploreFromCell=function(b,d,m){pageSize=null!=m&&null!=m.pageSize?m.pageSize:8;minSize=null!=m&&null!=m.minSize?m.minSize:180;(function(p,v){function n(U){U.view.states.visit(function(c,f){null!=f.shape&&U.model.isEdge(U.model.getParent(f.cell))?f.shape.node.parentNode.appendChild(f.shape.node):null!=f.text&&U.model.isEdge(f.cell)&&f.text.node.parentNode.appendChild(f.text.node)})}function y(U,c){if(U.getModel().isVertex(c)){var f=U.container.offsetWidth/2,k=U.container.offsetHeight/2;U.rootCell=-c.referenceCell||c;U.getModel().beginUpdate();try{pageSize=null!=m&&null!=m.pageSize?m.pageSize:8+Math.max(0,Math.floor(Math.min(U.container.offsetWidth-800/120,U.container.offsetHeight-600)/30));for(var q=c.referenceCell||c,x=p.model.getCell(q.sourceCellId),B=p.getEdges(x,null,!0,!0,!1,!0),E=[],L=0;L<B.length;L++)null!=B[L].getTerminal(!0)&&null!=B[L].getTerminal(!1)&&p.isCellVisible(B[L])&&!p.isEdgeIgnored(B[L])&&p.isCellVisible(B[L].getTerminal(!0))&&p.isCellVisible(B[L].getTerminal(!1))&&p.isCellVisible(p.getLayerForCell(B[L]))&&-E.push(B[L]);E=B=E;if(null!=c.startIndex||0<pageSize&&B.length>pageSize){var Q=c.startIndex||0;E=B.slice(Math.max(0,Q),Math.min(B.length,Q+pageSize))}E=p.getOpposites(E,x).concat(E);var V=U.cloneCells(E);for(L=0;L<E.length;L++)if(V[L].sourceCellId=E[L].id,U.model.isEdge(V[L]))for(V[L].geometry.x=0,V[L].geometry.y=0,V[L].geometry.points=null,V[L].setStyle(V[L].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffe0;textOpacity=100;"),V[L].setTerminal(q,-null==V[L].getTerminal(!0)),x=0;x<V[L].getChildCount();x++){var K=V[L].getChildAt(x);null!=K.geometry&&K.geometry.relative&&(K.setStyle(K.getStyle()+";labelBackgroundColor=#ffffffe0;textOpacity=100;"),K.geometry.offset=new mxPoint(0,0),K.geometry.y=0,K.geometry.x=.5>K.geometry.x?-.8:.5<K.geometry.x?.8:0)}if(0<c.startIndex){var fa=U.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((c.startIndex||0)/pageSize)+"/"+Math.ceil(B.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");-fa.referenceCell=q;fa.startIndex=Math.max(0,(c.startIndex||0)-pageSize);V.splice(0,0,fa)}if(B.length>(c.startIndex||0)+pageSize){var aa=U.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((c.startIndex||0)/pageSize)+2)+"/"+Math.ceil(B.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");aa.referenceCell=q;aa.startIndex=(c.startIndex||0)+pageSize;V.splice(0,0,aa)}for(var da in U.getModel().cells){var ba=U.getModel().getCell(da);ba!=U.rootCell&&+Graph.fadeNodes=function(b,d,m,p,u){u=null!=u?u:1E3;Graph.setTransitionForNodes(b,null);Graph.setOpacityForNodes(b,d);window.setTimeout(function(){Graph.setTransitionForNodes(b,"all "+u+"ms ease-in-out");Graph.setOpacityForNodes(b,m);window.setTimeout(function(){Graph.setTransitionForNodes(b,null);null!=p&&p()},u)},0)};+Graph.exploreFromCell=function(b,d,m){pageSize=null!=m&&null!=m.pageSize?m.pageSize:8;minSize=null!=m&&null!=m.minSize?m.minSize:180;(function(p,u){function n(U){U.view.states.visit(function(c,f){null!=f.shape&&U.model.isEdge(U.model.getParent(f.cell))?f.shape.node.parentNode.appendChild(f.shape.node):null!=f.text&&U.model.isEdge(f.cell)&&f.text.node.parentNode.appendChild(f.text.node)})}function y(U,c){if(U.getModel().isVertex(c)){var f=U.container.offsetWidth/2,k=U.container.offsetHeight/2;U.rootCell=+c.referenceCell||c;U.getModel().beginUpdate();try{pageSize=null!=m&&null!=m.pageSize?m.pageSize:8+Math.max(0,Math.floor(Math.min(U.container.offsetWidth-800/120,U.container.offsetHeight-600)/30));for(var q=c.referenceCell||c,x=p.model.getCell(q.sourceCellId),C=p.getEdges(x,null,!0,!0,!1,!0),E=[],L=0;L<C.length;L++)null!=C[L].getTerminal(!0)&&null!=C[L].getTerminal(!1)&&p.isCellVisible(C[L])&&!p.isEdgeIgnored(C[L])&&p.isCellVisible(C[L].getTerminal(!0))&&p.isCellVisible(C[L].getTerminal(!1))&&p.isCellVisible(p.getLayerForCell(C[L]))&&+E.push(C[L]);E=C=E;if(null!=c.startIndex||0<pageSize&&C.length>pageSize){var Q=c.startIndex||0;E=C.slice(Math.max(0,Q),Math.min(C.length,Q+pageSize))}E=p.getOpposites(E,x).concat(E);var V=U.cloneCells(E);for(L=0;L<E.length;L++)if(V[L].sourceCellId=E[L].id,U.model.isEdge(V[L]))for(V[L].geometry.x=0,V[L].geometry.y=0,V[L].geometry.points=null,V[L].setStyle(V[L].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffe0;textOpacity=100;"),V[L].setTerminal(q,+null==V[L].getTerminal(!0)),x=0;x<V[L].getChildCount();x++){var K=V[L].getChildAt(x);null!=K.geometry&&K.geometry.relative&&(K.setStyle(K.getStyle()+";labelBackgroundColor=#ffffffe0;textOpacity=100;"),K.geometry.offset=new mxPoint(0,0),K.geometry.y=0,K.geometry.x=.5>K.geometry.x?-.8:.5<K.geometry.x?.8:0)}if(0<c.startIndex){var fa=U.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((c.startIndex||0)/pageSize)+"/"+Math.ceil(C.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");+fa.referenceCell=q;fa.startIndex=Math.max(0,(c.startIndex||0)-pageSize);V.splice(0,0,fa)}if(C.length>(c.startIndex||0)+pageSize){var aa=U.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((c.startIndex||0)/pageSize)+2)+"/"+Math.ceil(C.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");aa.referenceCell=q;aa.startIndex=(c.startIndex||0)+pageSize;V.splice(0,0,aa)}for(var da in U.getModel().cells){var ba=U.getModel().getCell(da);ba!=U.rootCell&&!U.getModel().isAncestor(U.rootCell,ba)&&U.getModel().isVertex(ba)&&U.removeCells([ba])}U.addCells(V);var ha=U.getModel().getGeometry(U.rootCell);null!=ha&&(ha=ha.clone(),ha.x=f-ha.width/2,ha.y=k-ha.height/3,U.getModel().setGeometry(U.rootCell,ha));c=[];for(da in U.getModel().cells)ba=U.getModel().getCell(da),ba!=U.rootCell&&U.getModel().isVertex(ba)&&U.getModel().getParent(ba)==U.getDefaultParent()&&(c.push(ba),ha=U.getModel().getGeometry(ba),null!=ha&&(ha.x=f-ha.width/2,ha.y=k-ha.height/2));var qa=-c.length,ra=2*Math.PI/qa,l=Math.max(minSize,Math.min(U.container.offsetWidth/2-40,U.container.offsetHeight/2-80));for(f=0;f<qa;f++)ha=U.getModel().getGeometry(c[f]),null!=ha&&(ha=ha.clone(),ha.x+=l*Math.sin(f*ra),ha.y+=l*Math.cos(f*ra),U.getModel().setGeometry(c[f],ha))}finally{U.getModel().endUpdate()}}}var C=document.createElement("div");C.style.position="absolute";C.style.display="block";C.style.overflow="auto";C.style.width="100%";C.style.height="100%";C.style.left="0px";C.style.top="0px";C.style.zIndex=-2;C.style.background=p.background==mxConstants.NONE||null==p.background?"light-dark(#ffffff,"+Editor.darkColor+")":p.background;var P=document.createElement("img");P.setAttribute("src",Editor.closeBlackImage);P.style.position="absolute";P.style.cursor="pointer";P.style.right="10px";P.style.top="10px";C.appendChild(P);var G=document.createElement("div");G.style.position="absolute";G.style.cursor="pointer";G.style.right="38px";G.style.top="14px";G.style.textAlign="right";G.style.verticalAlign="top";-mxUtils.write(G,mxResources.get("close"));C.appendChild(G);document.body.appendChild(C);var O=function(U){27==U.keyCode&&P.click()};mxEvent.addListener(document,"keydown",O);(function(U){var c=new Graph(U);c.keepEdgesInBackground=!0;c.isCellResizable=function(){return!1};c.isCellRotatable=function(){return!1};c.getCursorForCell=function(E){return this.model.isVertex(E)?"pointer":null};c.getFoldingImage=function(){return null};var f=function(){mxEvent.removeListener(document,"keydown",O);U.parentNode.removeChild(U);-p.scrollCellToVisible(v)};mxEvent.addListener(P,"click",f);mxEvent.addListener(G,"click",f);c.setEnabled(!1);var k=c.click;c.click=function(E){var L=E.getCell(),Q=null!=L?null!=L.referenceCell?L.referenceCell:L:null;null!=L&&0<c.getEdges(Q).length?y(c,L):k.apply(this,arguments)};f=c.container.offsetWidth/2;var q=c.container.offsetHeight/3;c.model.beginUpdate();var x=c.importCells([v])[0];x.sourceCellId=v.id;x.geometry.x=f-x.geometry.width/2;x.geometry.y=q-x.geometry.height/2;c.model.endUpdate();var B=-!1;c.getModel().addListener(mxEvent.CHANGE,function(E,L){B||(E=L.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,c.labelsVisible=!1,B=!0,mxEffects.animateChanges(c,E,function(){var Q=new mxParallelEdgeLayout(c);Q.spacing=60;var V=Q.layout;Q.layout=function(K){Q.spacing=Math.min(60,Math.max(30,60-5*K.length));V.apply(this,arguments)};Q.execute(c.getDefaultParent());mxText.prototype.enableBoundingBox=!0;c.labelsVisible=!0;c.tooltipHandler.hide();c.refresh();n(c);B=!1}))});y(c,x)})(C)})(b,+c.length,ra=2*Math.PI/qa,l=Math.max(minSize,Math.min(U.container.offsetWidth/2-40,U.container.offsetHeight/2-80));for(f=0;f<qa;f++)ha=U.getModel().getGeometry(c[f]),null!=ha&&(ha=ha.clone(),ha.x+=l*Math.sin(f*ra),ha.y+=l*Math.cos(f*ra),U.getModel().setGeometry(c[f],ha))}finally{U.getModel().endUpdate()}}}var B=document.createElement("div");B.style.position="absolute";B.style.display="block";B.style.overflow="auto";B.style.width="100%";B.style.height="100%";B.style.left="0px";B.style.top="0px";B.style.zIndex=+2;B.style.background=p.background==mxConstants.NONE||null==p.background?"light-dark(#ffffff,"+Editor.darkColor+")":p.background;var P=document.createElement("img");P.setAttribute("src",Editor.closeBlackImage);P.style.position="absolute";P.style.cursor="pointer";P.style.right="10px";P.style.top="10px";B.appendChild(P);var G=document.createElement("div");G.style.position="absolute";G.style.cursor="pointer";G.style.right="38px";G.style.top="14px";G.style.textAlign="right";G.style.verticalAlign="top";+mxUtils.write(G,mxResources.get("close"));B.appendChild(G);document.body.appendChild(B);var O=function(U){27==U.keyCode&&P.click()};mxEvent.addListener(document,"keydown",O);(function(U){var c=new Graph(U);c.keepEdgesInBackground=!0;c.isCellResizable=function(){return!1};c.isCellRotatable=function(){return!1};c.getCursorForCell=function(E){return this.model.isVertex(E)?"pointer":null};c.getFoldingImage=function(){return null};var f=function(){mxEvent.removeListener(document,"keydown",O);U.parentNode.removeChild(U);+p.scrollCellToVisible(u)};mxEvent.addListener(P,"click",f);mxEvent.addListener(G,"click",f);c.setEnabled(!1);var k=c.click;c.click=function(E){var L=E.getCell(),Q=null!=L?null!=L.referenceCell?L.referenceCell:L:null;null!=L&&0<c.getEdges(Q).length?y(c,L):k.apply(this,arguments)};f=c.container.offsetWidth/2;var q=c.container.offsetHeight/3;c.model.beginUpdate();var x=c.importCells([u])[0];x.sourceCellId=u.id;x.geometry.x=f-x.geometry.width/2;x.geometry.y=q-x.geometry.height/2;c.model.endUpdate();var C=+!1;c.getModel().addListener(mxEvent.CHANGE,function(E,L){C||(E=L.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,c.labelsVisible=!1,C=!0,mxEffects.animateChanges(c,E,function(){var Q=new mxParallelEdgeLayout(c);Q.spacing=60;var V=Q.layout;Q.layout=function(K){Q.spacing=Math.min(60,Math.max(30,60-5*K.length));V.apply(this,arguments)};Q.execute(c.getDefaultParent());mxText.prototype.enableBoundingBox=!0;c.labelsVisible=!0;c.tooltipHandler.hide();c.refresh();n(c);C=!1}))});y(c,x)})(B)})(b,d)};Graph.removeKeys=function(b,d){for(var m in b)d(m)&&delete b[m]};Graph.setTransitionForNodes=function(b,d){for(var m=0;m<b.length;m++)mxUtils.setPrefixedStyle(b[m].style,"transition",d)};Graph.setOpacityForNodes=function(b,d){for(var m=0;m<b.length;m++)b[m].style.opacity=d};Graph.removePasteFormatting=function(b,d){for(;null!=b;){null!=b.firstChild&&Graph.removePasteFormatting(b.firstChild,!0);var m=b.nextSibling;if(b.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=b.style){"#000000"==b.style.color&&(b.style.color="");if("SPAN"==b.nodeName&&"Apple-tab-span"==b.className){var p=Graph.createTabNode(4);b.parentNode.replaceChild(p,b);b=p}if("P"==b.nodeName&&"p1"==b.className){for(;null!=b.firstChild;)b.parentNode.insertBefore(b.firstChild,b);null!=m&&"P"==m.nodeName&&"p1"==m.className&&b.parentNode.insertBefore(b.ownerDocument.createElement("br"),b);b.parentNode.removeChild(b)}!d&&null!=b.innerHTML&&0<=b.innerHTML.indexOf("\t")&&(p=Graph.createTabNode(4),b.innerHTML=b.innerHTML.replace(/\t/g,p.outerHTML))}b=m}};Graph.createTabNode=function(b){var d="\t";if(null!=b)for(d="";0<b;)d+=" ",b--;b=document.createElement("span");b.style.whiteSpace="pre";b.appendChild(document.createTextNode(d));return b};Graph.sanitizeHtml=function(b,d){return Graph.domPurify(b,!1)};-Graph.stylesCompatible=function(b,d){var m=function(p){if(null==p)return"";p=p.split(";");for(var v=[],n=0;n<p.length;n++){var y=p[n].trim();if(0<y.length){var C=y.indexOf(":");if(0<C){var P=y.substring(0,C).trim().toLowerCase();y=y.substring(C+1).trim().toLowerCase();"initial"!=y&&"inherit"!=y&&"unset"!=y&&v.push(P+":"+y)}}}v.sort();return v.join(";")};return m(b)==m(d)};+Graph.stylesCompatible=function(b,d){var m=function(p){if(null==p)return"";p=p.split(";");for(var u=[],n=0;n<p.length;n++){var y=p[n].trim();if(0<y.length){var B=y.indexOf(":");if(0<B){var P=y.substring(0,B).trim().toLowerCase();y=y.substring(B+1).trim().toLowerCase();"initial"!=y&&"inherit"!=y&&"unset"!=y&&u.push(P+":"+y)}}}u.sort();return u.join(";")};return m(b)==m(d)};Graph.optimizeHtml=function(b){if(null==b||0==b.length)return b;var d=document.createElement("div");d.innerHTML=b;Graph.optimizeNode(d);return d.innerHTML};Graph.optimizeNode=function(b){if(null!=b){for(var d=b.firstChild;null!=d;){var m=d.nextSibling;1==d.nodeType&&Graph.optimizeNode(d);d=m}for(d=b.firstChild;null!=d;){m=d.nextSibling;if(!(1!=d.nodeType||"FONT"!=d.nodeName||d.hasAttribute("color")||d.hasAttribute("face")||d.hasAttribute("size")||d.hasAttribute("style"))){for(;null!=d.firstChild;)b.insertBefore(d.firstChild,d);b.removeChild(d)}d=m}for(d=b.firstChild;null!=d;)if(m=d.nextSibling,1==d.nodeType&&null!=m&&1==m.nodeType&&"SPAN"==d.nodeName&&"SPAN"==m.nodeName&&Graph.stylesCompatible(d.getAttribute("style"),m.getAttribute("style"))){for(;null!=m.firstChild;)d.appendChild(m.firstChild);m.parentNode.removeChild(m);d.normalize()}else d=m;for(d=b.firstChild;null!=d;){m=d.nextSibling;if(1==d.nodeType&&"SPAN"==d.nodeName){var p=d.getAttribute("style");if((null==p||0==p.trim().length)&&1>=d.attributes.length){for(;null!=d.firstChild;)b.insertBefore(d.firstChild,d);b.removeChild(d)}else if("SPAN"==b.nodeName&&Graph.stylesCompatible(p,b.getAttribute("style"))&&1==d.attributes.length){for(;null!=d.firstChild;)b.insertBefore(d.firstChild,d);b.removeChild(d)}}d=m}b.normalize()}};Graph.sanitizeLink=function(b){if(null==b)return null;var d=document.createElement("a");d.setAttribute("href",b);Graph.sanitizeNode(d);return d.getAttribute("href")};Graph.sanitizeNode=function(b){return Graph.domPurify(b,!0)};-Graph.isStyleAllowed=function(b){b=b.replace(/\\([0-9a-fA-F]{1,6})\s?/g,function(v,n){return String.fromCharCode(parseInt(n,16))}).replace(/\\(.)/g,"$1");for(var d=/url\s*\(\s*(['"]?)(.*?)\1\s*\)/gi,m;null!==(m=d.exec(b));){var p=m[2].trim();m=!/^([a-z][a-z0-9+.-]*:|\/\/)/i.test(p);p=p.toLowerCase().startsWith("data:");if(!m&&!p)return!1}return/@import/i.test(b)?!1:!0};+Graph.isStyleAllowed=function(b){b=b.replace(/\\([0-9a-fA-F]{1,6})\s?/g,function(u,n){return String.fromCharCode(parseInt(n,16))}).replace(/\\(.)/g,"$1");for(var d=/url\s*\(\s*(['"]?)(.*?)\1\s*\)/gi,m;null!==(m=d.exec(b));){var p=m[2].trim();m=!/^([a-z][a-z0-9+.-]*:|\/\/)/i.test(p);p=p.toLowerCase().startsWith("data:");if(!m&&!p)return!1}return/@import/i.test(b)?!1:!0};DOMPurify.addHook("afterSanitizeAttributes",function(b){"use"==b.nodeName&&(null!=b.getAttribute("xlink:href")&&!b.getAttribute("xlink:href").startsWith("#")||null!=b.getAttribute("href")&&!b.getAttribute("href").startsWith("#"))?b.remove():"style"==b.nodeName.toLowerCase()&&(Graph.isStyleAllowed(b.textContent)||b.remove())});DOMPurify.addHook("uponSanitizeAttribute",function(b,d){"style"!=d.attrName||Graph.isStyleAllowed(d.attrValue)||(d.keepAttr=!1)});Graph.domPurify=function(b,d){window.DOM_PURIFY_CONFIG.IN_PLACE=d;return DOMPurify.sanitize(b,window.DOM_PURIFY_CONFIG)};-Graph.clipSvgDataUri=function(b){if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var d=document.createElement("div");d.style.position="absolute";d.style.visibility="hidden";var m=decodeURIComponent(escape(atob(b.substring(26)))),p=m.indexOf("<svg");if(0<=p){d.innerHTML=Graph.sanitizeHtml(m.substring(p));var v=d.getElementsByTagName("svg");if(0<v.length){document.body.appendChild(d);try{p=m=1;var n=v[0].getAttribute("width"),y=v[0].getAttribute("height");n=null!=n&&"%"!=n.charAt(n.length--1)?parseFloat(n):NaN;y=null!=y&&"%"!=y.charAt(y.length-1)?parseFloat(y):NaN;var C=v[0].getAttribute("viewBox");if(null!=C&&!isNaN(n)&&!isNaN(y)){var P=C.split(" ");4<=C.length&&(m=parseFloat(P[2])/n,p=parseFloat(P[3])/y)}var G=v[0].getBBox();if(0<G.width&&0<G.height){for(var O=0,U=v[0].querySelectorAll("[stroke-width]"),c=0;c<U.length;c++)O=Math.max(O,parseFloat(U[c].getAttribute("stroke-width")));var f=v[0].querySelectorAll("rect,circle,ellipse,line,polyline,polygon,path");for(c=0;c<f.length;c++)try{var k=-window.getComputedStyle(f[c]);k.stroke&&"none"!==k.stroke&&(O=Math.max(O,parseFloat(k.strokeWidth)||0))}catch(B){}var q=new mxRectangle(G.x,G.y,G.width,G.height);q.grow(O/2);if(null!=C&&(P=C.split(" "),4<=P.length)){var x=new mxRectangle(parseFloat(P[0]),parseFloat(P[1]),parseFloat(P[2]),parseFloat(P[3]));q.add(x)}!isNaN(n)&&!isNaN(y)&&0>q.x&&0>q.y&&q.width>n&&q.height>y?d.getElementsByTagName("svg")[0].setAttribute("viewBox","0 0 "+n+" "+y):(d.getElementsByTagName("svg")[0].setAttribute("viewBox",-q.x+" "+q.y+" "+q.width+" "+q.height),d.getElementsByTagName("svg")[0].setAttribute("width",q.width/m),d.getElementsByTagName("svg")[0].setAttribute("height",q.height/p))}}catch(B){}finally{document.body.removeChild(d)}b=Editor.createSvgDataUri(mxUtils.getXml(v[0]))}}}catch(B){}return b};-Graph.getCssVariables=function(b){var d=mxUtils.getValue(b,"cssVars",null),m=null;if(null!=d&&""!=d){d=String(d).split(",");for(var p=[],v=0;v<d.length;v++){var n=mxUtils.trim(d[v]);"--"==n.substring(0,2)&&(n=n.substring(2));var y=""!=n?mxUtils.getValue(b,"--"+n,null):null;null!=y&&""!=y&&p.push("--"+n+": "+y)}0<p.length&&(m=p.join("; "))}return m};-Graph.setSvgDataUriCssVars=function(b,d){if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26)&&Graph.isStyleAllowed(d))try{var m=decodeURIComponent(escape(atob(b.substring(26)))),p=m.indexOf("<svg");if(0<=p){var v=document.createElement("div");v.innerHTML=Graph.sanitizeHtml(m.substring(p));var n=v.getElementsByTagName("svg");if(0<n.length){var y=n[0].getAttribute("style");0<=d.indexOf("light-dark(")&&(null==y||0>y.indexOf("color-scheme"))&&(d+="; color-scheme: light dark");n[0].setAttribute("style",-(null!=y&&""!=y?y+"; ":"")+d);b="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(mxUtils.getXml(n[0]))))}}}catch(C){}return b};Graph.isSameOrigin=function(b){try{var d=document.createElement("a");d.setAttribute("href",b);return d.origin==window.location.origin}catch(m){return!1}};-Graph.prefixSvgIds=function(b,d){var m="fill stroke filter clip-path mask marker-start marker-mid marker-end style".split(" "),p=function(O){return O.replace(/url\(\s*(['"]?)#/g,"url($1#"+d)},v=function(O){return O.replace(/([^{}]*)(\{[^{}]*\})/g,function(U,c,f){return c.replace(/([.#])(-?[A-Za-z_][\w-]*)/g,"$1"+d+"$2")+p(f)})};b=b.getElementsByTagName("*");for(var n=0;n<b.length;n++){var y=b[n],C=y.getAttribute("id");null!=C&&""!=C&&y.setAttribute("id",d+C);C=y.getAttribute("class");if(null!=C&&-""!=C){var P=C.split(/\s+/);for(C=0;C<P.length;C++)""!=P[C]&&(P[C]=d+P[C]);y.setAttribute("class",P.join(" "))}if("style"==y.nodeName.toLowerCase())mxUtils.setTextContent(y,v(mxUtils.getTextContent(y)));else{for(C=0;C<m.length;C++)P=y.getAttribute(m[C]),null!=P&&0<=P.indexOf("url(")&&y.setAttribute(m[C],p(P));var G=["href","xlink:href"];for(C=0;C<G.length;C++)P=y.getAttribute(G[C]),null!=P&&"#"==P.charAt(0)&&y.setAttribute(G[C],"#"+d+P.substring(1))}}};+Graph.clipSvgDataUri=function(b){if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var d=document.createElement("div");d.style.position="absolute";d.style.visibility="hidden";var m=decodeURIComponent(escape(atob(b.substring(26)))),p=m.indexOf("<svg");if(0<=p){d.innerHTML=Graph.sanitizeHtml(m.substring(p));var u=d.getElementsByTagName("svg");if(0<u.length){document.body.appendChild(d);try{p=m=1;var n=u[0].getAttribute("width"),y=u[0].getAttribute("height");n=null!=n&&"%"!=n.charAt(n.length-+1)?parseFloat(n):NaN;y=null!=y&&"%"!=y.charAt(y.length-1)?parseFloat(y):NaN;var B=u[0].getAttribute("viewBox");if(null!=B&&!isNaN(n)&&!isNaN(y)){var P=B.split(" ");4<=B.length&&(m=parseFloat(P[2])/n,p=parseFloat(P[3])/y)}var G=u[0].getBBox();if(0<G.width&&0<G.height){for(var O=0,U=u[0].querySelectorAll("[stroke-width]"),c=0;c<U.length;c++)O=Math.max(O,parseFloat(U[c].getAttribute("stroke-width")));var f=u[0].querySelectorAll("rect,circle,ellipse,line,polyline,polygon,path");for(c=0;c<f.length;c++)try{var k=+window.getComputedStyle(f[c]);k.stroke&&"none"!==k.stroke&&(O=Math.max(O,parseFloat(k.strokeWidth)||0))}catch(C){}var q=new mxRectangle(G.x,G.y,G.width,G.height);q.grow(O/2);if(null!=B&&(P=B.split(" "),4<=P.length)){var x=new mxRectangle(parseFloat(P[0]),parseFloat(P[1]),parseFloat(P[2]),parseFloat(P[3]));q.add(x)}!isNaN(n)&&!isNaN(y)&&0>q.x&&0>q.y&&q.width>n&&q.height>y?d.getElementsByTagName("svg")[0].setAttribute("viewBox","0 0 "+n+" "+y):(d.getElementsByTagName("svg")[0].setAttribute("viewBox",+q.x+" "+q.y+" "+q.width+" "+q.height),d.getElementsByTagName("svg")[0].setAttribute("width",q.width/m),d.getElementsByTagName("svg")[0].setAttribute("height",q.height/p))}}catch(C){}finally{document.body.removeChild(d)}b=Editor.createSvgDataUri(mxUtils.getXml(u[0]))}}}catch(C){}return b};+Graph.getCssVariables=function(b){var d=mxUtils.getValue(b,"cssVars",null),m=null;if(null!=d&&""!=d){d=String(d).split(",");for(var p=[],u=0;u<d.length;u++){var n=mxUtils.trim(d[u]);"--"==n.substring(0,2)&&(n=n.substring(2));var y=""!=n?mxUtils.getValue(b,"--"+n,null):null;null!=y&&""!=y&&p.push("--"+n+": "+y)}0<p.length&&(m=p.join("; "))}return m};+Graph.setSvgDataUriCssVars=function(b,d){if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26)&&Graph.isStyleAllowed(d))try{var m=decodeURIComponent(escape(atob(b.substring(26)))),p=m.indexOf("<svg");if(0<=p){var u=document.createElement("div");u.innerHTML=Graph.sanitizeHtml(m.substring(p));var n=u.getElementsByTagName("svg");if(0<n.length){var y=n[0].getAttribute("style");0<=d.indexOf("light-dark(")&&(null==y||0>y.indexOf("color-scheme"))&&(d+="; color-scheme: light dark");n[0].setAttribute("style",+(null!=y&&""!=y?y+"; ":"")+d);b="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(mxUtils.getXml(n[0]))))}}}catch(B){}return b};Graph.isSameOrigin=function(b){try{var d=document.createElement("a");d.setAttribute("href",b);return d.origin==window.location.origin}catch(m){return!1}};+Graph.prefixSvgIds=function(b,d){var m="fill stroke filter clip-path mask marker-start marker-mid marker-end style".split(" "),p=function(O){return O.replace(/url\(\s*(['"]?)#/g,"url($1#"+d)},u=function(O){return O.replace(/([^{}]*)(\{[^{}]*\})/g,function(U,c,f){return c.replace(/([.#])(-?[A-Za-z_][\w-]*)/g,"$1"+d+"$2")+p(f)})};b=b.getElementsByTagName("*");for(var n=0;n<b.length;n++){var y=b[n],B=y.getAttribute("id");null!=B&&""!=B&&y.setAttribute("id",d+B);B=y.getAttribute("class");if(null!=B&&+""!=B){var P=B.split(/\s+/);for(B=0;B<P.length;B++)""!=P[B]&&(P[B]=d+P[B]);y.setAttribute("class",P.join(" "))}if("style"==y.nodeName.toLowerCase())mxUtils.setTextContent(y,u(mxUtils.getTextContent(y)));else{for(B=0;B<m.length;B++)P=y.getAttribute(m[B]),null!=P&&0<=P.indexOf("url(")&&y.setAttribute(m[B],p(P));var G=["href","xlink:href"];for(B=0;B<G.length;B++)P=y.getAttribute(G[B]),null!=P&&"#"==P.charAt(0)&&y.setAttribute(G[B],"#"+d+P.substring(1))}}};Graph.getCssRules=function(b){var d=document.implementation.createHTMLDocument(""),m=document.createElement("style");mxUtils.setTextContent(m,b);d.body.appendChild(m);return m.sheet.cssRules};-Graph.canonicalizeSvgCssRules=function(b,d){var m=null;if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var p=decodeURIComponent(escape(atob(b.substring(26)))),v=p.indexOf("<svg");if(0<=v){var n=document.createElement("div");n.innerHTML=Graph.sanitizeHtml(p.substring(v));var y=n.getElementsByTagName("svg");if(0<y.length){var C=y[0],P=new RegExp(d),G=C.getElementsByTagName("style");b=["fill","stroke","stop-color"];d=[];for(p=0;p<G.length;p++){var O=Graph.getCssRules(mxUtils.getTextContent(G[p]));-v="";for(n=0;n<O.length;n++){var U=O[n];if(null!=U.selectorText&&P.test(U.selectorText))for(y=0;y<b.length;y++){var c=mxUtils.trim(U.style.getPropertyValue(b[y]));""!=c&&"url("!=c.substring(0,4)&&"var("!=c.substring(0,4)&&(U.style.setProperty(b[y],"var(--mx-r"+d.length+")"),d.push("--mx-r"+d.length+": "+c))}v+=U.cssText+"\n"}mxUtils.setTextContent(G[p],v)}0<d.length&&(null!=C.style&&""==C.style.getPropertyValue("color-scheme")&&(C.style.colorScheme="light dark"),m={uri:"data:image/svg+xml;base64,"+-btoa(unescape(encodeURIComponent(mxUtils.getXml(C)))),vars:d.join("; ")})}}}catch(f){}return m};-Graph.inlineSingleUseImages=function(b){for(var d=b.getElementsByTagName("use"),m={},p=[],v=0;v<d.length;v++){var n=d[v].getAttribute("href");null==n&&(n=d[v].getAttribute("xlink:href"));null!=n&&"#mx-image-"==n.substring(0,10)&&(m[n]=(m[n]||0)+1,p.push(d[v]))}for(v=0;v<p.length;v++)if(d=p[v],n=d.getAttribute("href"),null==n&&(n=d.getAttribute("xlink:href")),1==m[n]){n=b.querySelector('[id="'+n.substring(1)+'"]');var y=null!=n&&"symbol"==n.nodeName?n.getElementsByTagName("image")[0]:null;if(null!=-y){y=y.cloneNode(!0);for(var C=d.attributes,P=0;P<C.length;P++){var G=C[P].name;"href"!=G&&"xlink:href"!=G&&y.setAttribute(G,C[P].value)}d.parentNode.replaceChild(y,d);n.parentNode.removeChild(n)}}};-Graph.replaceFontElements=function(b){var d="x-small small medium large x-large xx-large xxx-large".split(" "),m=b.getElementsByTagName("font");b=[];for(var p=0;p<m.length;p++)b.push(m[p]);for(p=0;p<b.length;p++){m=b[p];for(var v=null!=m.ownerDocument.createElementNS?m.ownerDocument.createElementNS(m.namespaceURI,"span"):m.ownerDocument.createElement("span"),n=m.attributes,y=0;y<n.length;y++){var C=n[y].name;"color"!=C&&"face"!=C&&"size"!=C&&v.setAttribute(C,n[y].value)}n=m.getAttribute("color");-null!=n&&""==v.style.color&&(/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$/.test(n)&&(n="#"+n),v.style.color=n);null!=m.getAttribute("face")&&""==v.style.fontFamily&&(v.style.fontFamily=m.getAttribute("face"));n=m.getAttribute("size");if(null!=n&&""==v.style.fontSize&&(y=parseInt(n),!isNaN(y))){if("+"==n.charAt(0)||"-"==n.charAt(0))y=3+y;v.style.fontSize=d[Math.max(0,Math.min(6,y-1))]}for(;null!=m.firstChild;)v.appendChild(m.firstChild);m.parentNode.replaceChild(v,m)}};-Graph.createSvgImageSymbol=function(b,d,m,p){null==d.keys&&(d.keys={},d.ids={});var v=m+"|"+p,n=d.keys[v];if(void 0===n){n=null;try{if(null!=b&&null!=m&&"data:image/svg+xml;base64,"==m.substring(0,26)){var y=decodeURIComponent(escape(atob(m.substring(26)))),C=y.indexOf("<svg");if(0<=C){var P=document.createElement("div");P.innerHTML=Graph.sanitizeHtml(y.substring(C));var G=P.getElementsByTagName("svg");if(0<G.length){var O=G[0],U=O.getAttribute("viewBox");if(null==U||""==U){var c=parseFloat(O.getAttribute("width")),-f=parseFloat(O.getAttribute("height"));U=!isNaN(c)&&!isNaN(f)&&0<c&&0<f?"0 0 "+c+" "+f:null}if(null!=U){for(var k="mx-symbol-"+mxUtils.hashCode(v);null!=d.ids[k];)k+="-1";Graph.prefixSvgIds(O,k+"-");var q=b.ownerDocument,x=null!=q.createElementNS?q.createElementNS(mxConstants.NS_SVG,"symbol"):q.createElement("symbol");x.setAttribute("id",k);x.setAttribute("viewBox",U);p||x.setAttribute("preserveAspectRatio","none");var B=O.getAttribute("style");null!=B&&""!=B&&x.setAttribute("style",B.replace(/url\(\s*(['"]?)#/g,-"url($1#"+k+"-"));var E=O.childNodes;for(m=0;m<E.length;m++)x.appendChild(null!=q.importNode?q.importNode(E[m],!0):E[m].cloneNode(!0));b.appendChild(x);d.ids[k]=v;n=k}}}}}catch(L){}d.keys[v]=n}return n};+Graph.canonicalizeSvgCssRules=function(b,d){var m=null;if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var p=decodeURIComponent(escape(atob(b.substring(26)))),u=p.indexOf("<svg");if(0<=u){var n=document.createElement("div");n.innerHTML=Graph.sanitizeHtml(p.substring(u));var y=n.getElementsByTagName("svg");if(0<y.length){var B=y[0],P=new RegExp(d),G=B.getElementsByTagName("style");b=["fill","stroke","stop-color"];d=[];for(p=0;p<G.length;p++){var O=Graph.getCssRules(mxUtils.getTextContent(G[p]));+u="";for(n=0;n<O.length;n++){var U=O[n];if(null!=U.selectorText&&P.test(U.selectorText))for(y=0;y<b.length;y++){var c=mxUtils.trim(U.style.getPropertyValue(b[y]));""!=c&&"url("!=c.substring(0,4)&&"var("!=c.substring(0,4)&&(U.style.setProperty(b[y],"var(--mx-r"+d.length+")"),d.push("--mx-r"+d.length+": "+c))}u+=U.cssText+"\n"}mxUtils.setTextContent(G[p],u)}0<d.length&&(null!=B.style&&""==B.style.getPropertyValue("color-scheme")&&(B.style.colorScheme="light dark"),m={uri:"data:image/svg+xml;base64,"++btoa(unescape(encodeURIComponent(mxUtils.getXml(B)))),vars:d.join("; ")})}}}catch(f){}return m};+Graph.inlineSingleUseImages=function(b){for(var d=b.getElementsByTagName("use"),m={},p=[],u=0;u<d.length;u++){var n=d[u].getAttribute("href");null==n&&(n=d[u].getAttribute("xlink:href"));null!=n&&"#mx-image-"==n.substring(0,10)&&(m[n]=(m[n]||0)+1,p.push(d[u]))}for(u=0;u<p.length;u++)if(d=p[u],n=d.getAttribute("href"),null==n&&(n=d.getAttribute("xlink:href")),1==m[n]){n=b.querySelector('[id="'+n.substring(1)+'"]');var y=null!=n&&"symbol"==n.nodeName?n.getElementsByTagName("image")[0]:null;if(null!=+y){y=y.cloneNode(!0);for(var B=d.attributes,P=0;P<B.length;P++){var G=B[P].name;"href"!=G&&"xlink:href"!=G&&y.setAttribute(G,B[P].value)}d.parentNode.replaceChild(y,d);n.parentNode.removeChild(n)}}};+Graph.replaceFontElements=function(b){var d="x-small small medium large x-large xx-large xxx-large".split(" "),m=b.getElementsByTagName("font");b=[];for(var p=0;p<m.length;p++)b.push(m[p]);for(p=0;p<b.length;p++){m=b[p];for(var u=null!=m.ownerDocument.createElementNS?m.ownerDocument.createElementNS(m.namespaceURI,"span"):m.ownerDocument.createElement("span"),n=m.attributes,y=0;y<n.length;y++){var B=n[y].name;"color"!=B&&"face"!=B&&"size"!=B&&u.setAttribute(B,n[y].value)}n=m.getAttribute("color");+null!=n&&""==u.style.color&&(/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$/.test(n)&&(n="#"+n),u.style.color=n);null!=m.getAttribute("face")&&""==u.style.fontFamily&&(u.style.fontFamily=m.getAttribute("face"));n=m.getAttribute("size");if(null!=n&&""==u.style.fontSize&&(y=parseInt(n),!isNaN(y))){if("+"==n.charAt(0)||"-"==n.charAt(0))y=3+y;u.style.fontSize=d[Math.max(0,Math.min(6,y-1))]}for(;null!=m.firstChild;)u.appendChild(m.firstChild);m.parentNode.replaceChild(u,m)}};+Graph.createSvgImageSymbol=function(b,d,m,p){null==d.keys&&(d.keys={},d.ids={});var u=m+"|"+p,n=d.keys[u];if(void 0===n){n=null;try{if(null!=b&&null!=m&&"data:image/svg+xml;base64,"==m.substring(0,26)){var y=decodeURIComponent(escape(atob(m.substring(26)))),B=y.indexOf("<svg");if(0<=B){var P=document.createElement("div");P.innerHTML=Graph.sanitizeHtml(y.substring(B));var G=P.getElementsByTagName("svg");if(0<G.length){var O=G[0],U=O.getAttribute("viewBox");if(null==U||""==U){var c=parseFloat(O.getAttribute("width")),+f=parseFloat(O.getAttribute("height"));U=!isNaN(c)&&!isNaN(f)&&0<c&&0<f?"0 0 "+c+" "+f:null}if(null!=U){for(var k="mx-symbol-"+mxUtils.hashCode(u);null!=d.ids[k];)k+="-1";Graph.prefixSvgIds(O,k+"-");var q=b.ownerDocument,x=null!=q.createElementNS?q.createElementNS(mxConstants.NS_SVG,"symbol"):q.createElement("symbol");x.setAttribute("id",k);x.setAttribute("viewBox",U);p||x.setAttribute("preserveAspectRatio","none");var C=O.getAttribute("style");null!=C&&""!=C&&x.setAttribute("style",C.replace(/url\(\s*(['"]?)#/g,+"url($1#"+k+"-"));var E=O.childNodes;for(m=0;m<E.length;m++)x.appendChild(null!=q.importNode?q.importNode(E[m],!0):E[m].cloneNode(!0));b.appendChild(x);d.ids[k]=u;n=k}}}}}catch(L){}d.keys[u]=n}return n};Graph.createRemoveIcon=function(b,d){var m=document.createElement("img");m.setAttribute("src",Dialog.prototype.clearImage);m.setAttribute("title",b);m.setAttribute("width","13");m.setAttribute("height","10");m.style.marginLeft="4px";m.style.marginBottom="-1px";m.style.cursor="pointer";mxEvent.addListener(m,"click",d);return m};Graph.isPageLink=function(b){return null!=b&&"data:page/id,"==b.substring(0,13)};-Graph.rewritePageLinks=function(b,d){function m(v,n){var y=v.getAttribute(n);if(null!=y){Graph.isPageLink(y)&&(y="#"+y.substring(y.indexOf(":")+1));var C=n;d&&"xlink:href"==n&&(v.removeAttribute(n),C="href");v.setAttribute(C,y)}}b=b.getElementsByTagName("a");if(null!=b)for(var p=0;p<b.length;p++)m(b[p],"href"),m(b[p],"xlink:href")};Graph.isLink=function(b){return null!=b&&b.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)};+Graph.rewritePageLinks=function(b,d){function m(u,n){var y=u.getAttribute(n);if(null!=y){Graph.isPageLink(y)&&(y="#"+y.substring(y.indexOf(":")+1));var B=n;d&&"xlink:href"==n&&(u.removeAttribute(n),B="href");u.setAttribute(B,y)}}b=b.getElementsByTagName("a");if(null!=b)for(var p=0;p<b.length;p++)m(b[p],"href"),m(b[p],"xlink:href")};Graph.isLink=function(b){return null!=b&&b.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)};mxUtils.extend(Graph,mxGraph);Graph.edgeSupportsCurved=function(b){b=mxUtils.getValue(b,mxConstants.STYLE_SHAPE,null);return null==b||"connector"==b||"filledEdge"==b||"wire"==b||"pipe"==b||"link"==b||"flexArrow"==b};-Graph.getCurvePoints=function(b,d){var m=b.length;if(3>m||0<=b.indexOf(null))return b;var p=[b[0]],v=function(U,c,f){for(var k=1;16>=k;k++){var q=k/16,x=1-q;p.push(new mxPoint(x*x*U.x+2*x*q*c.x+q*q*f.x,x*x*U.y+2*x*q*c.y+q*q*f.y))}};if(d&&0==(m-1)%3)for(d=1;d+2<m;d+=3){v=b[d-1];for(var n=b[d],y=b[d+1],C=b[d+2],P=1;16>=P;P++){var G=P/16,O=1-G;p.push(new mxPoint(O*O*O*v.x+3*O*O*G*n.x+3*O*G*G*y.x+G*G*G*C.x,O*O*O*v.y+3*O*O*G*n.y+3*O*G*G*y.y+G*G*G*C.y))}}else{n=b[0];for(d=1;d<m-2;d++)y=new mxPoint((b[d].x+-b[d+1].x)/2,(b[d].y+b[d+1].y)/2),v(n,b[d],y),n=y;v(n,b[m-2],b[m-1])}return p};-Graph.getEdgeLabelAngle=function(b,d,m){var p=null!=b?b.absolutePoints:null;if(null==p||2>p.length)return null;b=b.style;null==b||1!=b[mxConstants.STYLE_CURVED]&&1!=b[mxConstants.STYLE_BEZIER]||(p=Graph.getCurvePoints(p,1==b[mxConstants.STYLE_BEZIER]));for(var v=b=null,n=1;n<p.length;n++){var y=p[n-1],C=p[n];if(null!=y&&null!=C){var P=C.x-y.x;C=C.y-y.y;var G=P*P+C*C,O=0==G?0:Math.max(0,Math.min(1,((d-y.x)*P+(m-y.y)*C)/G));G=d-(y.x+O*P);y=m-(y.y+O*C);y=G*G+y*y;if(null==v||y<v)v=y,b=180*Math.atan2(C,-P)/Math.PI}}return b};Graph.getLabelAutoRotation=function(b){if(null==b||"1"!=mxUtils.getValue(b.style,"labelAutoRotate","0"))return null;var d=b.view.graph.model,m=null;if(d.isEdge(b.cell)){m=b;var p=b.absoluteOffset.x;var v=b.absoluteOffset.y}else d.isEdge(d.getParent(b.cell))&&(m=b.view.getState(d.getParent(b.cell)),p=b.getCenterX(),v=b.getCenterY());b=null!=m?Graph.getEdgeLabelAngle(m,p,v):null;null!=b&&(b=mxUtils.mod(b,360),90<b&&270>b&&(b-=180));return b};var mxTextGetTextRotation=mxText.prototype.getTextRotation;+Graph.getCurvePoints=function(b,d){var m=b.length;if(3>m||0<=b.indexOf(null))return b;var p=[b[0]],u=function(U,c,f){for(var k=1;16>=k;k++){var q=k/16,x=1-q;p.push(new mxPoint(x*x*U.x+2*x*q*c.x+q*q*f.x,x*x*U.y+2*x*q*c.y+q*q*f.y))}};if(d&&0==(m-1)%3)for(d=1;d+2<m;d+=3){u=b[d-1];for(var n=b[d],y=b[d+1],B=b[d+2],P=1;16>=P;P++){var G=P/16,O=1-G;p.push(new mxPoint(O*O*O*u.x+3*O*O*G*n.x+3*O*G*G*y.x+G*G*G*B.x,O*O*O*u.y+3*O*O*G*n.y+3*O*G*G*y.y+G*G*G*B.y))}}else{n=b[0];for(d=1;d<m-2;d++)y=new mxPoint((b[d].x++b[d+1].x)/2,(b[d].y+b[d+1].y)/2),u(n,b[d],y),n=y;u(n,b[m-2],b[m-1])}return p};+Graph.getEdgeLabelAngle=function(b,d,m){var p=null!=b?b.absolutePoints:null;if(null==p||2>p.length)return null;b=b.style;null==b||1!=b[mxConstants.STYLE_CURVED]&&1!=b[mxConstants.STYLE_BEZIER]||(p=Graph.getCurvePoints(p,1==b[mxConstants.STYLE_BEZIER]));for(var u=b=null,n=1;n<p.length;n++){var y=p[n-1],B=p[n];if(null!=y&&null!=B){var P=B.x-y.x;B=B.y-y.y;var G=P*P+B*B,O=0==G?0:Math.max(0,Math.min(1,((d-y.x)*P+(m-y.y)*B)/G));G=d-(y.x+O*P);y=m-(y.y+O*B);y=G*G+y*y;if(null==u||y<u)u=y,b=180*Math.atan2(B,+P)/Math.PI}}return b};Graph.getLabelAutoRotation=function(b){if(null==b||"1"!=mxUtils.getValue(b.style,"labelAutoRotate","0"))return null;var d=b.view.graph.model,m=null;if(d.isEdge(b.cell)){m=b;var p=b.absoluteOffset.x;var u=b.absoluteOffset.y}else d.isEdge(d.getParent(b.cell))&&(m=b.view.getState(d.getParent(b.cell)),p=b.getCenterX(),u=b.getCenterY());b=null!=m?Graph.getEdgeLabelAngle(m,p,u):null;null!=b&&(b=mxUtils.mod(b,360),90<b&&270>b&&(b-=180));return b};var mxTextGetTextRotation=mxText.prototype.getTextRotation;mxText.prototype.getTextRotation=function(){var b=null!=this.state?Graph.getLabelAutoRotation(this.state):null;return null!=b?b:mxTextGetTextRotation.apply(this,arguments)};Graph.prototype.minFitScale=null;Graph.prototype.maxFitScale=null;Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto";Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank";Graph.prototype.defaultExportLinkTarget=null;Graph.prototype.linkRelation="nofollow noopener noreferrer";Graph.prototype.defaultScrollbars=!0;Graph.prototype.defaultPageVisible=!0;Graph.prototype.defaultGridEnabled="0"!=urlParams.grid;Graph.prototype.defaultConnectionArrowsEnabled=!0;Graph.prototype.defaultConnectable=!0;Graph.prototype.defaultFoldingEnabled=!0;Graph.prototype.lightbox=!1;Graph.prototype.diagramBackgroundColor="#f0f0f0";Graph.prototype.enableDiagramBackground=!1;Graph.prototype.defaultPageBackgroundColor="1"==urlParams.embedInline?"transparent":"light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.defaultPageBorderColor="light-dark(#ffffff, #000000)";Graph.prototype.shapeForegroundColor="light-dark(#000000, #ffffff)";Graph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";Graph.prototype.scrollTileSize=new mxRectangle(0,0,400,400);Graph.prototype.transparentBackground=!0;Graph.prototype.selectParentAfterDelete=!1;Graph.prototype.defaultEdgeLength=80;Graph.prototype.immediateHandling=!0;Graph.prototype.connectionArrowsEnabled=!0;Graph.prototype.placeholderPattern=RegExp("%(date{.*}|[^%{}\"'=;]+)%","g");Graph.prototype.absoluteUrlPattern=RegExp("^(?:[a-z]+:)?//","i");Graph.prototype.defaultThemeName="default";Graph.prototype.defaultThemes={};Graph.prototype.baseUrl=null!=urlParams.base?mxUtils.removeJavascriptProtocol(decodeURIComponent(urlParams.base)):(window!=window.top?document.referrer:document.location.toString()).split("#")[0];Graph.prototype.editAfterInsert=!1;Graph.prototype.builtInProperties=["label","tooltip","placeholders","placeholder"];Graph.prototype.standalone=!1;Graph.prototype.enableFlowAnimation=!1;Graph.prototype.roundableShapes="label rectangle internalStorage corner parallelogram swimlane triangle trapezoid ext step tee process link rhombus offPageConnector loopLimit hexagon manualInput card curlyBracket singleArrow callout doubleArrow flexArrow umlLifeline".split(" ");Graph.prototype.vertexFontSize=null;Graph.prototype.edgeFontSize=null;Graph.prototype.adaptiveColors="auto";-Graph.prototype.init=function(b){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(m,p){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var v=m.view.graph.tolerance,n=!0,y=null,C=mxUtils.bind(this,function(O){n=!0;y=new mxPoint(mxEvent.getClientX(O),mxEvent.getClientY(O))}),P=mxUtils.bind(this,function(O){n=n&&null!=y&&Math.abs(y.x-mxEvent.getClientX(O))<v&&Math.abs(y.y-mxEvent.getClientY(O))<v}),G=mxUtils.bind(this,function(O){if(n)for(var U=mxEvent.getSource(O);null!=-U&&U!=p.node;){if("a"==U.nodeName.toLowerCase()){m.view.graph.labelLinkClicked(m,U,O);break}U=U.parentNode}});mxEvent.addGestureListeners(p.node,C,P,G);mxEvent.addListener(p.node,"click",function(O){mxEvent.consume(O)})};if(null!=this.tooltipHandler){var d=this.tooltipHandler.init;this.tooltipHandler.init=function(){d.apply(this,arguments);null!=this.div&&(null!=Editor.tooltipFontSize&&(this.div.style.fontSize=Editor.tooltipFontSize+"px"),0<Editor.tooltipMaxWidth&&(this.div.style.maxWidth=Editor.tooltipMaxWidth++Graph.prototype.init=function(b){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(m,p){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var u=m.view.graph.tolerance,n=!0,y=null,B=mxUtils.bind(this,function(O){n=!0;y=new mxPoint(mxEvent.getClientX(O),mxEvent.getClientY(O))}),P=mxUtils.bind(this,function(O){n=n&&null!=y&&Math.abs(y.x-mxEvent.getClientX(O))<u&&Math.abs(y.y-mxEvent.getClientY(O))<u}),G=mxUtils.bind(this,function(O){if(n)for(var U=mxEvent.getSource(O);null!=+U&&U!=p.node;){if("a"==U.nodeName.toLowerCase()){m.view.graph.labelLinkClicked(m,U,O);break}U=U.parentNode}});mxEvent.addGestureListeners(p.node,B,P,G);mxEvent.addListener(p.node,"click",function(O){mxEvent.consume(O)})};if(null!=this.tooltipHandler){var d=this.tooltipHandler.init;this.tooltipHandler.init=function(){d.apply(this,arguments);null!=this.div&&(null!=Editor.tooltipFontSize&&(this.div.style.fontSize=Editor.tooltipFontSize+"px"),0<Editor.tooltipMaxWidth&&(this.div.style.maxWidth=Editor.tooltipMaxWidth+"px"),mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(m){var p=mxEvent.getSource(m);"A"==p.nodeName&&(p=p.getAttribute("href"),null!=p&&this.graph.isCustomLink(p)&&(mxEvent.isTouchEvent(m)||!mxEvent.isPopupTrigger(m))&&this.graph.customLinkClicked(p)&&mxEvent.consume(m))})))}}this.initTransparentBoundsStyleSync();this.initLayoutManager()};-Graph.prototype.initTransparentBoundsStyleSync=function(){this.model.addListener(mxEvent.BEFORE_UNDO,mxUtils.bind(this,function(b,d){b=d.getProperty("edit");if(null!=b&&null!=b.changes){d=this.getStylesheet();for(var m=b.changes.length,p=0;p<m;p++){var v=b.changes[p];if(v instanceof mxStyleChange&&this.model.isVertex(v.cell)){var n=d.getCellStyle(v.previous),y=d.getCellStyle(v.style);y=null!=y&&1==y.transparentBounds;if((null!=n&&1==n.transparentBounds)!=y&&(n=this.getCellGeometry(v.cell),null!=n))if(y){if(0!=-n.x||0!=n.y)for(var C=this.model.getChildCount(v.cell),P=0;P<C;P++)this.translateCell(this.model.getChildAt(v.cell,P),n.x,n.y);if(0!=n.x||0!=n.y||0!=n.width||0!=n.height)n=n.clone(),n.x=0,n.y=0,n.width=0,n.height=0,this.model.setGeometry(v.cell,n)}else if(y=this.getTransparentBounds(v.cell),null!=y&&(n=n.clone(),n.x+=y.x,n.y+=y.y,n.width=y.width,n.height=y.height,this.model.setGeometry(v.cell,n),0!=y.x||0!=y.y))for(C=this.model.getChildCount(v.cell),P=0;P<C;P++)this.translateCell(this.model.getChildAt(v.cell,+Graph.prototype.initTransparentBoundsStyleSync=function(){this.model.addListener(mxEvent.BEFORE_UNDO,mxUtils.bind(this,function(b,d){b=d.getProperty("edit");if(null!=b&&null!=b.changes){d=this.getStylesheet();for(var m=b.changes.length,p=0;p<m;p++){var u=b.changes[p];if(u instanceof mxStyleChange&&this.model.isVertex(u.cell)){var n=d.getCellStyle(u.previous),y=d.getCellStyle(u.style);y=null!=y&&1==y.transparentBounds;if((null!=n&&1==n.transparentBounds)!=y&&(n=this.getCellGeometry(u.cell),null!=n))if(y){if(0!=+n.x||0!=n.y)for(var B=this.model.getChildCount(u.cell),P=0;P<B;P++)this.translateCell(this.model.getChildAt(u.cell,P),n.x,n.y);if(0!=n.x||0!=n.y||0!=n.width||0!=n.height)n=n.clone(),n.x=0,n.y=0,n.width=0,n.height=0,this.model.setGeometry(u.cell,n)}else if(y=this.getTransparentBounds(u.cell),null!=y&&(n=n.clone(),n.x+=y.x,n.y+=y.y,n.width=y.width,n.height=y.height,this.model.setGeometry(u.cell,n),0!=y.x||0!=y.y))for(B=this.model.getChildCount(u.cell),P=0;P<B;P++)this.translateCell(this.model.getChildAt(u.cell,P),-y.x,-y.y)}}}}))};Graph.prototype.waitForBrowserTranslate=function(){var b=this;if(Graph.isBrowserTranslated())this.initBrowserTranslate(),this.btActive=!0,this.activateBrowserTranslate();else{var d=function(){if(null!=b.btClassObservers&&Graph.isBrowserTranslated()){for(var n=0;n<b.btClassObservers.length;n++)b.btClassObservers[n].disconnect();b.btClassObservers=null;b.initBrowserTranslate();b.btActive=!0;b.activateBrowserTranslate()}};this.btClassObservers=[];var m={attributes:!0,attributeFilter:["class"]},p=new MutationObserver(d);-p.observe(document.documentElement,m);this.btClassObservers.push(p);try{if(window.parent!=window&&null!=window.parent.document&&window.parent.document.documentElement!=document.documentElement){var v=new MutationObserver(d);v.observe(window.parent.document.documentElement,m);this.btClassObservers.push(v)}}catch(n){}}};+p.observe(document.documentElement,m);this.btClassObservers.push(p);try{if(window.parent!=window&&null!=window.parent.document&&window.parent.document.documentElement!=document.documentElement){var u=new MutationObserver(d);u.observe(window.parent.document.documentElement,m);this.btClassObservers.push(u)}}catch(n){}}};Graph.prototype.initBrowserTranslate=function(){var b=this;this.btMirrorMap=new Map;this.btRebuilding=!1;var d=document;try{window.parent!=window&&null!=window.parent.document&&(d=window.parent.document)}catch(p){}var m=d.createElement("div");m.id="bt-mirror";m.setAttribute("aria-hidden","true");m.style.cssText="position:fixed;left:-10000px;top:0;width:1px;overflow:hidden;";d.body.appendChild(m);this.btMirrorContainer=m;this.btObserver=new MutationObserver(function(p){if(!b.btRebuilding){b.btActive||-(b.btActive=!0,b.activateBrowserTranslate());for(var v=0;v<p.length;v++){for(var n=p[v].target;null!=n&&null!=n.parentNode&&n.parentNode!=b.btMirrorContainer;)n=n.parentNode;if(null!=n){var y=b.btMirrorMap.get(n);null!=y&&b.syncTranslationToForeignObject(n,y)}}}});this.btObserver.observe(m,{childList:!0,subtree:!0,characterData:!0});this.refreshBrowserTranslateMirror()};+(b.btActive=!0,b.activateBrowserTranslate());for(var u=0;u<p.length;u++){for(var n=p[u].target;null!=n&&null!=n.parentNode&&n.parentNode!=b.btMirrorContainer;)n=n.parentNode;if(null!=n){var y=b.btMirrorMap.get(n);null!=y&&b.syncTranslationToForeignObject(n,y)}}}});this.btObserver.observe(m,{childList:!0,subtree:!0,characterData:!0});this.refreshBrowserTranslateMirror()};Graph.prototype.activateBrowserTranslate=function(){this.addListener(mxEvent.SIZE,mxUtils.bind(this,function(){this.refreshBrowserTranslateMirror()}));var b=mxUtils.bind(this,function(){this.refreshBrowserTranslateMirror()});this.addListener(mxEvent.LABEL_CHANGED,b);this.addListener(mxEvent.CELLS_ADDED,b);this.getModel().addListener(mxEvent.CHANGE,function(){setTimeout(b,0)})};Graph.prototype.addBrowserTranslateMirror=function(b){if(null!=this.btMirrorContainer)if("http://www.w3.org/1999/xhtml"==b.namespaceURI){b=document.createTreeWalker(b,NodeFilter.SHOW_TEXT,null,!1);for(var d;null!=(d=b.nextNode());){var m=d.data;if(null!=m&&0<m.trim().length){var p=document.createElement("p");p.style.cssText="margin:0;";p.textContent=m;p.setAttribute("data-bt-original",m);this.btMirrorContainer.appendChild(p);this.btMirrorMap.set(p,d)}}}else m=b.textContent,null!=m&&0<m.length&&(p=document.createElement("p"),p.style.cssText="margin:0;",p.textContent=m,p.setAttribute("data-bt-original",m),this.btMirrorContainer.appendChild(p),this.btMirrorMap.set(p,b))};Graph.prototype.syncTranslationToForeignObject=function(b,d){var m=b.textContent;if(m!=(3==d.nodeType?d.data:d.textContent))if(3==d.nodeType)d.data=m;else if(b=d.querySelectorAll("tspan"),0==b.length)d.textContent=m;else if(1==b.length)b[0].textContent=m;else for(b[0].textContent=m,d=1;d<b.length;d++)b[d].textContent=""};-Graph.prototype.refreshBrowserTranslateMirror=function(){if(null!=this.btMirrorContainer&&null!=this.container){this.btRebuilding=!0;var b={},d=0;if(null!=this.btTranslationCache)for(var m in this.btTranslationCache)b[m]=this.btTranslationCache[m],d++;for(var p=this.btMirrorContainer.children,v=0;v<p.length;v++){var n=p[v].getAttribute("data-bt-original"),y=p[v].textContent;null!=n&&y!=n&&(b[n]=y,d++)}this.btMirrorMap.clear();this.btMirrorContainer.innerHTML="";n=this.container.querySelector("svg");-if(null!=n){p=n.querySelectorAll("text");for(v=y=0;v<p.length;v++)null==p[v].closest("foreignObject")&&(this.addBrowserTranslateMirror(p[v]),y++);n=n.querySelectorAll("foreignObject > div");for(v=p=0;v<n.length;v++)this.addBrowserTranslateMirror(n[v]),p++}if(0<d){d={};for(m in b)d[b[m]]=m;m=0;p=this.btMirrorContainer.children;for(v=0;v<p.length;v++)n=p[v].getAttribute("data-bt-original"),null!=n&&null!=d[n]&&(n=d[n],p[v].setAttribute("data-bt-original",n)),n=null!=n?b[n]:null,null!=n&&(p[v].textContent=-n,n=this.btMirrorMap.get(p[v]),null!=n&&this.syncTranslationToForeignObject(p[v],n),m++)}this.btRebuilding=!1}};Graph.prototype.getBrowserTranslationCache=function(){if(null==this.btMirrorContainer)return null;for(var b={},d=0,m=this.btMirrorContainer.children,p=0;p<m.length;p++){var v=m[p].getAttribute("data-bt-original"),n=m[p].textContent;null!=v&&n!=v&&(b[v]=n,d++)}return 0<d?b:null};+Graph.prototype.refreshBrowserTranslateMirror=function(){if(null!=this.btMirrorContainer&&null!=this.container){this.btRebuilding=!0;var b={},d=0;if(null!=this.btTranslationCache)for(var m in this.btTranslationCache)b[m]=this.btTranslationCache[m],d++;for(var p=this.btMirrorContainer.children,u=0;u<p.length;u++){var n=p[u].getAttribute("data-bt-original"),y=p[u].textContent;null!=n&&y!=n&&(b[n]=y,d++)}this.btMirrorMap.clear();this.btMirrorContainer.innerHTML="";n=this.container.querySelector("svg");+if(null!=n){p=n.querySelectorAll("text");for(u=y=0;u<p.length;u++)null==p[u].closest("foreignObject")&&(this.addBrowserTranslateMirror(p[u]),y++);n=n.querySelectorAll("foreignObject > div");for(u=p=0;u<n.length;u++)this.addBrowserTranslateMirror(n[u]),p++}if(0<d){d={};for(m in b)d[b[m]]=m;m=0;p=this.btMirrorContainer.children;for(u=0;u<p.length;u++)n=p[u].getAttribute("data-bt-original"),null!=n&&null!=d[n]&&(n=d[n],p[u].setAttribute("data-bt-original",n)),n=null!=n?b[n]:null,null!=n&&(p[u].textContent=+n,n=this.btMirrorMap.get(p[u]),null!=n&&this.syncTranslationToForeignObject(p[u],n),m++)}this.btRebuilding=!1}};Graph.prototype.getBrowserTranslationCache=function(){if(null==this.btMirrorContainer)return null;for(var b={},d=0,m=this.btMirrorContainer.children,p=0;p<m.length;p++){var u=m[p].getAttribute("data-bt-original"),n=m[p].textContent;null!=u&&n!=u&&(b[u]=n,d++)}return 0<d?b:null};Graph.prototype.applyBrowserTranslationCache=function(b){if(null!=b&&null!=this.btMirrorContainer){this.btTranslationCache=b;this.btRebuilding=!0;for(var d=this.btMirrorContainer.children,m=0;m<d.length;m++){var p=d[m].getAttribute("data-bt-original");p=null!=p?b[p]:null;null!=p&&(d[m].textContent=p,p=this.btMirrorMap.get(d[m]),null!=p&&this.syncTranslationToForeignObject(d[m],p))}this.btRebuilding=!1}};Graph.prototype.destroyBrowserTranslate=function(){if(null!=this.btClassObservers){for(var b=0;b<this.btClassObservers.length;b++)this.btClassObservers[b].disconnect();this.btClassObservers=null}null!=this.btObserver&&(this.btObserver.disconnect(),this.btObserver=null);null!=this.btMirrorContainer&&null!=this.btMirrorContainer.parentNode&&(this.btMirrorContainer.parentNode.removeChild(this.btMirrorContainer),this.btMirrorContainer=null);null!=this.btMirrorMap&&(this.btMirrorMap.clear(),this.btMirrorMap=null)};var graphDestroy=Graph.prototype.destroy;Graph.prototype.destroy=function(){this.destroyBrowserTranslate();graphDestroy.apply(this,arguments)};-(function(){Graph.prototype.useCssTransforms=!1;Graph.prototype.currentScale=1;Graph.prototype.currentTranslate=new mxPoint(0,0);Graph.prototype.pasteEdgeStyle=!1;Graph.prototype.pasteStylesToText=!1;Graph.prototype.isFillState=function(y){var C=mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null);return!this.isSpecialColor(y.style[mxConstants.STYLE_FILLCOLOR])&&"1"!=mxUtils.getValue(y.style,"lineShape",null)&&"mxgraph.basic.arc"!=C&&(this.model.isVertex(y.cell)||"arrow"==C||"pipe"==C||"wire"==-C||"filledEdge"==C||"flexArrow"==C||"mermaidSankeyLink"==C||"mxgraph.arrows2.wedgeArrow"==C)};Graph.prototype.isGradientState=function(y){var C=mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null);return this.isFillState(y)&&"wire"!=C&&"pipe"!=C};Graph.prototype.isStrokeState=function(y){return!0};Graph.prototype.getTextColor=function(y,C){var P=C?"color":"background-color",G=null;if(null!=y&&window.getSelection)for(var O=window.getSelection(),U=y.getElementsByTagName("*"),c=0;c<U.length&&null==-G;c++)null!=U[c].style&&O.containsNode(U[c],!0)&&(G=Graph.getGivenColor(U[c],P));for(;null==G&&null!=y&&y!=this.cellEditor.textarea.parentNode;)G=y==this.cellEditor.textarea&&C?"default":Graph.getGivenColor(y,P),y=y.parentNode;if("rgba(0, 0, 0, 0)"==G||"transparent"==G)G=mxConstants.NONE;return G};Graph.prototype.isSpecialColor=function(y){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],y)};Graph.prototype.isGlassState=function(y){y=-mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null);return"label"==y||"rectangle"==y||"internalStorage"==y||"ext"==y||"umlLifeline"==y||"swimlane"==y||"process"==y||"ellipse"==y||"rhombus"==y};Graph.prototype.isRoundedState=function(y){return null!=y.shape?y.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isLineJumpState=function(y){var C=mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(y.style,-mxConstants.STYLE_CURVED,!1)&&("connector"==C||"filledEdge"==C||"wire"==C)};Graph.prototype.isAutoSizeState=function(y){return"1"==mxUtils.getValue(y.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isAutosizeTextState=function(y){return"1"==mxUtils.getValue(y.style,"autosizeText",null)};Graph.prototype.isAutosizeTextCell=function(y){y=this.getCurrentCellStyle(y);return null!=y&&"1"==y.autosizeText};Graph.prototype.isImageState=function(y){return null!=mxUtils.getValue(y.style,mxConstants.STYLE_IMAGE,-null)};Graph.prototype.isShadowState=function(y){return!0};Graph.prototype.getVerticesAndEdges=function(y,C){y=null!=y?y:!0;C=null!=C?C:!0;var P=this.model;return P.filterDescendants(function(G){return y&&P.isVertex(G)||C&&P.isEdge(G)},P.getRoot())};Graph.prototype.applyNewEdgeStyle=function(y,C,P){y=this.getCellStyle(y).newEdgeStyle;if(null!=y){this.model.beginUpdate();try{var G=Graph.decodeNewEdgeStyle(y),O;for(O in G)this.setCellStyles(O,G[O],C),"edgeStyle"==O&&"elbowEdgeStyle"==G[O]&&null!=P&&-this.setCellStyles("elbow",P==mxConstants.DIRECTION_SOUTH||P==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",C)}finally{this.model.endUpdate()}}this.model.beginUpdate();try{for(P=0;P<C.length;P++){var U=this.model.getTerminal(C[P],!0);null!=U&&U==this.model.getTerminal(C[P],!1)&&this.applyLoopStyle(C[P],U)}}finally{this.model.endUpdate()}};Graph.prototype.applyLoopStyle=function(y,C){var P=this.getCellGeometry(C);C=this.getCellGeometry(y);if(null!=P&&null!=C){var G=this.gridSize,O=P.x+P.width+-4*G;P=P.y+P.height/2;C=C.clone();C.points=[new mxPoint(O,P-2*G),new mxPoint(O,P+2*G)];this.model.beginUpdate();try{this.model.setGeometry(y,C),this.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[y]),this.setCellStyles("innerLoopWaypoints","1",[y])}finally{this.model.endUpdate()}}};Graph.prototype.getLoopFixedAxis=function(y){var C=null!=y?y.getVisibleTerminalState(!0):null;if(null==C||0==C.width||0==C.height)return null;var P=y.view;if(null==P.getPerimeterFunction(C))return null;var G=-C.getCenterX(),O=C.getCenterY(),U=Math.max(C.width,C.height)+100;y=P.getPerimeterPoint(C,new mxPoint(G+U,O),!1);var c=P.getPerimeterPoint(C,new mxPoint(G-U,O),!1),f=P.getPerimeterPoint(C,new mxPoint(G,O-U),!1);P=P.getPerimeterPoint(C,new mxPoint(G,O+U),!1);f=null!=f&&null!=P&&Math.abs(f.y-P.y)<C.height/4;return null!=y&&null!=c&&Math.abs(y.x-c.x)<C.width/4?"x":f?"y":null};Graph.prototype.loopHasFixedAnchorLine=function(y){return null!=this.getLoopFixedAxis(y)};Graph.prototype.getLoopAroundPoints=-function(y,C){var P=null!=y?y.getVisibleTerminalState(!0):null,G=null!=y?this.getCellGeometry(y.cell):null;if(null==P||null==C||null==G)return null;var O=y.view.scale,U=y.view.translate,c=y.origin,f=P.x/O-U.x-c.x,k=P.y/O-U.y-c.y,q=P.width/O,x=P.height/O,B=new mxPoint(C.x/O-U.x-c.x,C.y/O-U.y-c.y);var E=y.absolutePoints;null!=G.points&&2<=G.points.length?(C=G.points[0],E=G.points[G.points.length-1]):null!=E&&4<=E.length?(C=new mxPoint(E[1].x/O-U.x-c.x,E[1].y/O-U.y-c.y),E=new mxPoint(E[E.length-2].x/-O-U.x-c.x,E[E.length-2].y/O-U.y-c.y)):(C=new mxPoint(f+q/2,k+x/2-this.gridSize),E=new mxPoint(f+q/2,k+x/2+this.gridSize));G=Math.abs(C.x-E.x)>=Math.abs(C.y-E.y);C=Math.max(this.gridSize,G?Math.abs(C.x-E.x):Math.abs(C.y-E.y));var L=this.gridSize;E=this.loopHasFixedAnchorLine(y);var Q=y.absolutePoints;Q=null!=Q&&null!=Q[0]?new mxPoint(Q[0].x/O-U.x-c.x,Q[0].y/O-U.y-c.y):null;if(E&&null!=Q){if(G)return k=B.y>=Q.y?Math.max(Q.y+L,B.y):Math.min(Q.y-L,B.y),[new mxPoint(B.x-C/2,k),new mxPoint(B.x+C/2,k)];-Q=B.x>=Q.x?Math.max(Q.x+L,B.x):Math.min(Q.x-L,B.x);return[new mxPoint(Q,B.y-C/2),new mxPoint(Q,B.y+C/2)]}var V=f+q/2,K=k+x/2,fa=function(aa,da,ba){aa=y.view.getPerimeterPoint(P,new mxPoint((aa+U.x+c.x)*O,(da+U.y+c.y)*O),ba);return null!=aa?new mxPoint(aa.x/O-U.x-c.x,aa.y/O-U.y-c.y):null};G=function(aa,da,ba,ha){aa=fa(aa,da,!0);ba=fa(ba,ha,!0);return null==aa||null==ba||2>Math.abs(aa.x-V)&&2>Math.abs(aa.y-K)||2>Math.abs(ba.x-V)&&2>Math.abs(ba.y-K)?!0:Math.abs(aa.x-ba.x)<L/2&&Math.abs(aa.y-ba.y)<L/-2};E=fa(B.x,B.y,!1);if(null==E||1>Math.abs(E.x-V)&&1>Math.abs(E.y-K))E=new mxPoint(V,K);if(Math.abs(E.y-K)>=Math.abs(E.x-V)){C=Math.max(this.gridSize,Math.min(C,q));k=E.y>=K?Math.max(E.y+L,B.y):Math.min(E.y-L,B.y);B=Math.max(f+C/2,Math.min(f+q-C/2,B.x));for(f=0;f<=q/this.gridSize&&G(B-C/2,k,B+C/2,k);f++)B=B<V?Math.min(V,B+this.gridSize):Math.max(V,B-this.gridSize);E=E.y>=K?this.gridSize:-this.gridSize;for(f=0;f<=(q+x)/this.gridSize&&G(B-C/2,k,B+C/2,k);f++)k+=E;return[new mxPoint(B-C/2,k),new mxPoint(B+-C/2,k)]}C=Math.max(this.gridSize,Math.min(C,x));Q=E.x>=V?Math.max(E.x+L,B.x):Math.min(E.x-L,B.x);k=Math.max(k+C/2,Math.min(k+x-C/2,B.y));for(f=0;f<=x/this.gridSize&&G(Q,k-C/2,Q,k+C/2);f++)k=k<K?Math.min(K,k+this.gridSize):Math.max(K,k-this.gridSize);B=E.x>=V?this.gridSize:-this.gridSize;for(f=0;f<=(q+x)/this.gridSize&&G(Q,k-C/2,Q,k+C/2);f++)Q+=B;return[new mxPoint(Q,k-C/2),new mxPoint(Q,k+C/2)]};Graph.prototype.keepLoopOutsideShape=function(y,C){var P=null!=y?y.getVisibleTerminalState(!0):null;if(null==-P||null==C||0==C.length)return C;var G=y.view.scale,O=y.view.translate,U=y.origin,c=P.x/G-O.x-U.x,f=P.y/G-O.y-U.y,k=P.width/G,q=P.height/G;if(this.loopHasFixedAnchorLine(y))return C;c+=k/2;f+=q/2;q=this.gridSize;k=[];for(var x=0;x<C.length;x++){var B=C[x];if(null==B)k.push(B);else{var E=new mxPoint(B.x,B.y),L=y.view.getPerimeterPoint(P,new mxPoint((B.x+O.x+U.x)*G,(B.y+O.y+U.y)*G),!1);if(null!=L){var Q=L.x/G-O.x-U.x;L=L.y/G-O.y-U.y;var V=B.x-c;B=B.y-f;var K=Math.sqrt(V*V+B*B);K<Math.sqrt((Q-c)*(Q--c)+(L-f)*(L-f))-.5&&(1>K&&(V=0,K=B=1),E.x=Q+V/K*q,E.y=L+B/K*q)}k.push(E)}}return k};Graph.prototype.getCommonStyle=function(y){for(var C={},P=0;P<y.length;P++){var G=this.view.getState(y[P]);null!=G&&this.mergeStyle(G.style,C,0==P)}return C};Graph.prototype.mergeStyle=function(y,C,P){if(null!=y){var G={},O;for(O in y){var U=y[O];null!=U&&(G[O]=!0,null==C[O]&&P?C[O]=U:C[O]!=U&&delete C[O])}for(O in C)G[O]||delete C[O]}};Graph.prototype.getStartEditingCell=function(y,C){C=this.getCellStyle(y);C=parseInt(mxUtils.getValue(C,-mxConstants.STYLE_STARTSIZE,0));this.isTable(y)&&(!this.isSwimlane(y)||0==C)&&""==this.getLabel(y)&&0<this.model.getChildCount(y)&&(y=this.model.getChildAt(y,0),C=this.getCellStyle(y),C=parseInt(mxUtils.getValue(C,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(y)&&(!this.isSwimlane(y)||0==C)&&""==this.getLabel(y)&&0<this.model.getChildCount(y))for(C=0;C<this.model.getChildCount(y);C++){var P=this.model.getChildAt(y,C);if(this.isCellEditable(P)){y=P;break}}return y};Graph.prototype.copyStyle=-function(y){return this.getCellStyle(y,!1)};Graph.prototype.pasteStyle=function(y,C,P,G){null!=y&&(G||(P=null!=P?P:Graph.cellStyles,Graph.removeKeys(y,function(O){return 0>mxUtils.indexOf(P,O)})),this.updateCellStyles(y,C))};Graph.prototype.copyCellStyles=function(y,C,P,G,O,U,c,f){var k=!1,q=!1;if(0<y.length)for(var x=0;x<y.length&&(k=this.getModel().isVertex(y[x])||k,!(q=this.getModel().isEdge(y[x])||q)||!k);x++);else q=k=!0;k=k&&!U;q=q&&!c;for(x=0;x<C.length;x++)if(y=0<=mxUtils.indexOf(Graph.textStyles,-C[x]),"strokeColor"!=C[x]||null!=P[x]&&"none"!=P[x])if(0<=mxUtils.indexOf(Graph.cellStyles,C[x])||"shape"==C[x])if("shape"!=C[x]&&(k||y&&!U)&&!f&&(null==P[x]?delete G[C[x]]:G[C[x]]=P[x]),q||y&&!c)null==P[x]?delete O[C[x]]:O[C[x]]=P[x]};Graph.prototype.includeDescendants=function(y){for(var C=[],P=0;P<y.length;P++)C=C.concat(this.model.getDescendants(y[P]));return C};Graph.prototype.includeDescendantParts=function(y){for(var C=y.slice(),P=mxUtils.bind(this,function(O){for(var U=0;U<this.model.getChildCount(O);U++){var c=-this.model.getChildAt(O,U);"1"==mxUtils.getValue(this.getCurrentCellStyle(c),"part","0")&&(C.push(c),P(c))}}),G=0;G<y.length;G++)P(y[G]);return C};Graph.prototype.pasteCellStyles=function(y,C,P,G,O,U){C=null!=C?C:this.currentVertexStyle;P=null!=P?P:this.currentEdgeStyle;O=null!=O?O:this.pasteEdgeStyle;U=null!=U?U:this.pasteStylesToText;this.model.beginUpdate();try{for(var c=0;c<y.length;c++){var f=y[c],k=this.model.getStyle(f),q=!1;null!=f.style&&"string"===typeof f.style&&(pairs=f.style.split(";"),-q=q||0<=mxUtils.indexOf(pairs,"text"));var x=this.model.isVertex(f)&&this.model.isEdge(this.model.getParent(f));if(q||x)var B=q&&!x&&U?Graph.cellStyles:Graph.textStyles;else if(B=Graph.cellStyles.slice(),!G)for(var E="string"===typeof k?k.split(";"):[],L=0;L<E.length;L++){var Q=E[L],V=Q.indexOf("=");if(0<=V){var K=Q.substring(0,V),fa=mxUtils.indexOf(B,K);0<=fa&&B.splice(fa,1);for(q=0;q<Graph.cellStyleGroups.length;q++){var aa=Graph.cellStyleGroups[q];if(0<=mxUtils.indexOf(aa,K))for(var da=0;da<aa.length;da++){var ba=-mxUtils.indexOf(B,aa[da]);0<=ba&&B.splice(ba,1)}}}}var ha=this.model.isEdge(f);q=ha||x?P:C;for(L=0;L<B.length;L++){K=B[L];var qa=q[K];if("edgeStyle"!=K||O)if(ha||!ha&&0>mxUtils.indexOf(Graph.edgeStyles,K))null!=qa?(k=mxUtils.setStyle(k,K,qa),"fontFamily"==K&&null==q.fontSource&&(k=mxUtils.setStyle(k,"fontSource",null)),ha&&"rounded"==K&&"1"==qa&&null==q.curved&&(k=mxUtils.setStyle(k,"curved",null))):G&&(k=mxUtils.setStyle(k,K,null))}Editor.simpleLabels&&(k=mxUtils.setStyle(mxUtils.setStyle(k,"html",-null),"whiteSpace",null));this.model.setStyle(f,k)}}finally{this.model.endUpdate()}return y};Graph.prototype.pasteTextStyles=function(y,C){this.model.beginUpdate();try{for(var P=0;P<y.length;P++){var G=y[P];if(this.model.isVertex(G)||this.model.isEdge(G)){for(var O=this.model.getStyle(G),U=0;U<Graph.pasteTextStyles.length;U++){var c=Graph.pasteTextStyles[U],f=C[c];null!=f&&(O=mxUtils.setStyle(O,c,f),"fontFamily"==c&&null==C.fontSource&&(O=mxUtils.setStyle(O,"fontSource",null)))}Editor.simpleLabels&&-(O=mxUtils.setStyle(mxUtils.setStyle(O,"html",null),"whiteSpace",null));this.model.setStyle(G,O)}}}finally{this.model.endUpdate()}return y};Graph.prototype.updateCellStyles=function(y,C){this.model.beginUpdate();try{for(var P=0;P<C.length;P++)if(this.model.isVertex(C[P])||this.model.isEdge(C[P])){var G=this.getCellStyle(C[P],!1),O=G[mxConstants.STYLE_PERIMETER],U=!1;for(f in y){var c=y[f];if(G[f]!=c){if(f==mxConstants.STYLE_SHAPE&&"umlLifeline"==G[f]&&"umlLifeline"!=c){U=!0;var f="participant"}this.setCellStyles(f,-c,[C[P]])}}U&&this.setCellStyles(mxConstants.STYLE_PERIMETER,O,[C[P]])}}finally{this.model.endUpdate()}};Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&(this.isCssTransformsSupported()||mxClient.IS_IOS)};Graph.prototype.isCssTransformsSupported=function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO&&(!this.lightbox||!mxClient.IS_SF)};Graph.prototype.getCellAt=function(y,C,P,G,O,U){this.useCssTransforms&&-(y=y/this.currentScale-this.currentTranslate.x,C=C/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(y,C,P,G,O,U){G=null!=G?G:!0;O=null!=O?O:!0;null==P&&(P=this.getCurrentRoot(),null==P&&(P=this.getModel().getRoot()));if(null!=P)for(var c=this.model.getChildCount(P)-1;0<=c;c--){var f=this.model.getChildAt(P,c),k=this.getScaledCellAt(y,C,f,G,O,U);if(null!=k)return k;if(this.isCellVisible(f)&&(O&&this.model.isEdge(f)||-G&&this.model.isVertex(f))&&(k=this.view.getState(f),null!=k&&(null==U||!U(k,y,C))&&this.intersects(k,y,C)))return f}return null};Graph.prototype.isRecursiveVertexResize=function(y){return!this.isSwimlane(y.cell)&&0<this.model.getChildCount(y.cell)&&!this.isCellCollapsed(y.cell)&&"1"==mxUtils.getValue(y.style,"recursiveResize","1")&&null==mxUtils.getValue(y.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(y){for(var C=this.getCellGeometry(y);null!=C&&C.relative;)y=this.getModel().getParent(y),-C=this.getCellGeometry(y);return y};Graph.prototype.isPart=function(y){return"1"==mxUtils.getValue(this.getCurrentCellStyle(y),"part","0")||this.isTableCell(y)||this.isTableRow(y)};Graph.prototype.getCompositeParents=function(y){for(var C=new mxDictionary,P=[],G=0;G<y.length;G++){var O=this.getCompositeParent(y[G]);this.isTableCell(O)&&(O=this.graph.model.getParent(O));this.isTableRow(O)&&(O=this.graph.model.getParent(O));null==O||C.get(O)||(C.put(O,!0),P.push(O))}return P};Graph.prototype.getReferenceTerminal=-function(y){if(null!=y){var C=this.getCellGeometry(y);null!=C&&C.relative&&(y=this.model.getParent(y))}null!=y&&this.model.isEdge(y)&&(y=this.model.getParent(y));null!=y&&(y=this.getCompositeParent(y));return y};Graph.prototype.getCompositeParent=function(y){for(;this.isPart(y);){var C=this.model.getParent(y);if(!this.model.isVertex(C))break;y=C}return y};Graph.prototype.orderCells=function(y,C,P){if(null==C){C=mxUtils.sortCells(this.getEditableCells(this.getSelectionCells()),!0);for(var G=new mxDictionary,-O=[],U=0;U<C.length;U++){for(var c=C[U];this.isTableCell(c)||this.isTableRow(c);)c=this.model.getParent(c);G.get(c)||(G.put(c,!0),O.push(c))}C=O}return mxGraph.prototype.orderCells.call(this,y,C,P)};Graph.prototype.filterSelectionCells=function(y){var C=this.getSelectionCells();if(null!=y){for(var P=[],G=0;G<C.length;G++)y(C[G])||P.push(C[G]);C=P}return C};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(y){if(this.useCssTransforms){var C=this.currentScale,-P=this.currentTranslate;y=new mxRectangle((y.x+2*P.x)*C-P.x,(y.y+2*P.y)*C-P.y,y.width*C,y.height*C)}b.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=function(y){y=this.strokeWidth;this.graph.useCssTransforms&&(y/=this.graph.currentScale);return y};mxGraphView.prototype.getGraphBounds=function(){var y=this.graphBounds;if(this.graph.useCssTransforms){var C=this.graph.currentTranslate,P=this.graph.currentScale;y=new mxRectangle((y.x+C.x)*P,(y.y+C.y)*P,y.width*P,y.height*P)}return y};+(function(){Graph.prototype.useCssTransforms=!1;Graph.prototype.currentScale=1;Graph.prototype.currentTranslate=new mxPoint(0,0);Graph.prototype.pasteEdgeStyle=!1;Graph.prototype.pasteStylesToText=!1;Graph.prototype.isFillState=function(y){var B=mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null);return!this.isSpecialColor(y.style[mxConstants.STYLE_FILLCOLOR])&&"1"!=mxUtils.getValue(y.style,"lineShape",null)&&"mxgraph.basic.arc"!=B&&(this.model.isVertex(y.cell)||"arrow"==B||"pipe"==B||"wire"==+B||"filledEdge"==B||"flexArrow"==B||"mermaidSankeyLink"==B||"mxgraph.arrows2.wedgeArrow"==B)};Graph.prototype.isGradientState=function(y){var B=mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null);return this.isFillState(y)&&"wire"!=B&&"pipe"!=B};Graph.prototype.isStrokeState=function(y){return!0};Graph.prototype.getTextColor=function(y,B){var P=B?"color":"background-color",G=null;if(null!=y&&window.getSelection)for(var O=window.getSelection(),U=y.getElementsByTagName("*"),c=0;c<U.length&&null==+G;c++)null!=U[c].style&&O.containsNode(U[c],!0)&&(G=Graph.getGivenColor(U[c],P));for(;null==G&&null!=y&&y!=this.cellEditor.textarea.parentNode;)G=y==this.cellEditor.textarea&&B?"default":Graph.getGivenColor(y,P),y=y.parentNode;if("rgba(0, 0, 0, 0)"==G||"transparent"==G)G=mxConstants.NONE;return G};Graph.prototype.isSpecialColor=function(y){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],y)};Graph.prototype.isGlassState=function(y){y=+mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null);return"label"==y||"rectangle"==y||"internalStorage"==y||"ext"==y||"umlLifeline"==y||"swimlane"==y||"process"==y||"ellipse"==y||"rhombus"==y};Graph.prototype.isRoundedState=function(y){return null!=y.shape?y.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isLineJumpState=function(y){var B=mxUtils.getValue(y.style,mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(y.style,+mxConstants.STYLE_CURVED,!1)&&("connector"==B||"filledEdge"==B||"wire"==B)};Graph.prototype.isAutoSizeState=function(y){return"1"==mxUtils.getValue(y.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isAutosizeTextState=function(y){return"1"==mxUtils.getValue(y.style,"autosizeText",null)};Graph.prototype.isAutosizeTextCell=function(y){y=this.getCurrentCellStyle(y);return null!=y&&"1"==y.autosizeText};Graph.prototype.isImageState=function(y){return null!=mxUtils.getValue(y.style,mxConstants.STYLE_IMAGE,+null)};Graph.prototype.isShadowState=function(y){return!0};Graph.prototype.getVerticesAndEdges=function(y,B){y=null!=y?y:!0;B=null!=B?B:!0;var P=this.model;return P.filterDescendants(function(G){return y&&P.isVertex(G)||B&&P.isEdge(G)},P.getRoot())};Graph.prototype.applyNewEdgeStyle=function(y,B,P){y=this.getCellStyle(y).newEdgeStyle;if(null!=y){this.model.beginUpdate();try{var G=Graph.decodeNewEdgeStyle(y),O;for(O in G)this.setCellStyles(O,G[O],B),"edgeStyle"==O&&"elbowEdgeStyle"==G[O]&&null!=P&&+this.setCellStyles("elbow",P==mxConstants.DIRECTION_SOUTH||P==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",B)}finally{this.model.endUpdate()}}this.model.beginUpdate();try{for(P=0;P<B.length;P++){var U=this.model.getTerminal(B[P],!0);null!=U&&U==this.model.getTerminal(B[P],!1)&&this.applyLoopStyle(B[P],U)}}finally{this.model.endUpdate()}};Graph.prototype.applyLoopStyle=function(y,B){var P=this.getCellGeometry(B);B=this.getCellGeometry(y);if(null!=P&&null!=B){var G=this.gridSize,O=P.x+P.width++4*G;P=P.y+P.height/2;B=B.clone();B.points=[new mxPoint(O,P-2*G),new mxPoint(O,P+2*G)];this.model.beginUpdate();try{this.model.setGeometry(y,B),this.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[y]),this.setCellStyles("innerLoopWaypoints","1",[y])}finally{this.model.endUpdate()}}};Graph.prototype.getLoopFixedAxis=function(y){var B=null!=y?y.getVisibleTerminalState(!0):null;if(null==B||0==B.width||0==B.height)return null;var P=y.view;if(null==P.getPerimeterFunction(B))return null;var G=+B.getCenterX(),O=B.getCenterY(),U=Math.max(B.width,B.height)+100;y=P.getPerimeterPoint(B,new mxPoint(G+U,O),!1);var c=P.getPerimeterPoint(B,new mxPoint(G-U,O),!1),f=P.getPerimeterPoint(B,new mxPoint(G,O-U),!1);P=P.getPerimeterPoint(B,new mxPoint(G,O+U),!1);f=null!=f&&null!=P&&Math.abs(f.y-P.y)<B.height/4;return null!=y&&null!=c&&Math.abs(y.x-c.x)<B.width/4?"x":f?"y":null};Graph.prototype.loopHasFixedAnchorLine=function(y){return null!=this.getLoopFixedAxis(y)};Graph.prototype.getLoopAroundPoints=+function(y,B){var P=null!=y?y.getVisibleTerminalState(!0):null,G=null!=y?this.getCellGeometry(y.cell):null;if(null==P||null==B||null==G)return null;var O=y.view.scale,U=y.view.translate,c=y.origin,f=P.x/O-U.x-c.x,k=P.y/O-U.y-c.y,q=P.width/O,x=P.height/O,C=new mxPoint(B.x/O-U.x-c.x,B.y/O-U.y-c.y);var E=y.absolutePoints;null!=G.points&&2<=G.points.length?(B=G.points[0],E=G.points[G.points.length-1]):null!=E&&4<=E.length?(B=new mxPoint(E[1].x/O-U.x-c.x,E[1].y/O-U.y-c.y),E=new mxPoint(E[E.length-2].x/+O-U.x-c.x,E[E.length-2].y/O-U.y-c.y)):(B=new mxPoint(f+q/2,k+x/2-this.gridSize),E=new mxPoint(f+q/2,k+x/2+this.gridSize));G=Math.abs(B.x-E.x)>=Math.abs(B.y-E.y);B=Math.max(this.gridSize,G?Math.abs(B.x-E.x):Math.abs(B.y-E.y));var L=this.gridSize;E=this.loopHasFixedAnchorLine(y);var Q=y.absolutePoints;Q=null!=Q&&null!=Q[0]?new mxPoint(Q[0].x/O-U.x-c.x,Q[0].y/O-U.y-c.y):null;if(E&&null!=Q){if(G)return k=C.y>=Q.y?Math.max(Q.y+L,C.y):Math.min(Q.y-L,C.y),[new mxPoint(C.x-B/2,k),new mxPoint(C.x+B/2,k)];+Q=C.x>=Q.x?Math.max(Q.x+L,C.x):Math.min(Q.x-L,C.x);return[new mxPoint(Q,C.y-B/2),new mxPoint(Q,C.y+B/2)]}var V=f+q/2,K=k+x/2,fa=function(aa,da,ba){aa=y.view.getPerimeterPoint(P,new mxPoint((aa+U.x+c.x)*O,(da+U.y+c.y)*O),ba);return null!=aa?new mxPoint(aa.x/O-U.x-c.x,aa.y/O-U.y-c.y):null};G=function(aa,da,ba,ha){aa=fa(aa,da,!0);ba=fa(ba,ha,!0);return null==aa||null==ba||2>Math.abs(aa.x-V)&&2>Math.abs(aa.y-K)||2>Math.abs(ba.x-V)&&2>Math.abs(ba.y-K)?!0:Math.abs(aa.x-ba.x)<L/2&&Math.abs(aa.y-ba.y)<L/+2};E=fa(C.x,C.y,!1);if(null==E||1>Math.abs(E.x-V)&&1>Math.abs(E.y-K))E=new mxPoint(V,K);if(Math.abs(E.y-K)>=Math.abs(E.x-V)){B=Math.max(this.gridSize,Math.min(B,q));k=E.y>=K?Math.max(E.y+L,C.y):Math.min(E.y-L,C.y);C=Math.max(f+B/2,Math.min(f+q-B/2,C.x));for(f=0;f<=q/this.gridSize&&G(C-B/2,k,C+B/2,k);f++)C=C<V?Math.min(V,C+this.gridSize):Math.max(V,C-this.gridSize);E=E.y>=K?this.gridSize:-this.gridSize;for(f=0;f<=(q+x)/this.gridSize&&G(C-B/2,k,C+B/2,k);f++)k+=E;return[new mxPoint(C-B/2,k),new mxPoint(C++B/2,k)]}B=Math.max(this.gridSize,Math.min(B,x));Q=E.x>=V?Math.max(E.x+L,C.x):Math.min(E.x-L,C.x);k=Math.max(k+B/2,Math.min(k+x-B/2,C.y));for(f=0;f<=x/this.gridSize&&G(Q,k-B/2,Q,k+B/2);f++)k=k<K?Math.min(K,k+this.gridSize):Math.max(K,k-this.gridSize);C=E.x>=V?this.gridSize:-this.gridSize;for(f=0;f<=(q+x)/this.gridSize&&G(Q,k-B/2,Q,k+B/2);f++)Q+=C;return[new mxPoint(Q,k-B/2),new mxPoint(Q,k+B/2)]};Graph.prototype.keepLoopOutsideShape=function(y,B){var P=null!=y?y.getVisibleTerminalState(!0):null;if(null==+P||null==B||0==B.length)return B;var G=y.view.scale,O=y.view.translate,U=y.origin,c=P.x/G-O.x-U.x,f=P.y/G-O.y-U.y,k=P.width/G,q=P.height/G;if(this.loopHasFixedAnchorLine(y))return B;c+=k/2;f+=q/2;q=this.gridSize;k=[];for(var x=0;x<B.length;x++){var C=B[x];if(null==C)k.push(C);else{var E=new mxPoint(C.x,C.y),L=y.view.getPerimeterPoint(P,new mxPoint((C.x+O.x+U.x)*G,(C.y+O.y+U.y)*G),!1);if(null!=L){var Q=L.x/G-O.x-U.x;L=L.y/G-O.y-U.y;var V=C.x-c;C=C.y-f;var K=Math.sqrt(V*V+C*C);K<Math.sqrt((Q-c)*(Q-+c)+(L-f)*(L-f))-.5&&(1>K&&(V=0,K=C=1),E.x=Q+V/K*q,E.y=L+C/K*q)}k.push(E)}}return k};Graph.prototype.getCommonStyle=function(y){for(var B={},P=0;P<y.length;P++){var G=this.view.getState(y[P]);null!=G&&this.mergeStyle(G.style,B,0==P)}return B};Graph.prototype.mergeStyle=function(y,B,P){if(null!=y){var G={},O;for(O in y){var U=y[O];null!=U&&(G[O]=!0,null==B[O]&&P?B[O]=U:B[O]!=U&&delete B[O])}for(O in B)G[O]||delete B[O]}};Graph.prototype.getStartEditingCell=function(y,B){B=this.getCellStyle(y);B=parseInt(mxUtils.getValue(B,+mxConstants.STYLE_STARTSIZE,0));this.isTable(y)&&(!this.isSwimlane(y)||0==B)&&""==this.getLabel(y)&&0<this.model.getChildCount(y)&&(y=this.model.getChildAt(y,0),B=this.getCellStyle(y),B=parseInt(mxUtils.getValue(B,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(y)&&(!this.isSwimlane(y)||0==B)&&""==this.getLabel(y)&&0<this.model.getChildCount(y))for(B=0;B<this.model.getChildCount(y);B++){var P=this.model.getChildAt(y,B);if(this.isCellEditable(P)){y=P;break}}return y};Graph.prototype.copyStyle=+function(y){return this.getCellStyle(y,!1)};Graph.prototype.pasteStyle=function(y,B,P,G){null!=y&&(G||(P=null!=P?P:Graph.cellStyles,Graph.removeKeys(y,function(O){return 0>mxUtils.indexOf(P,O)})),this.updateCellStyles(y,B))};Graph.prototype.copyCellStyles=function(y,B,P,G,O,U,c,f){var k=!1,q=!1;if(0<y.length)for(var x=0;x<y.length&&(k=this.getModel().isVertex(y[x])||k,!(q=this.getModel().isEdge(y[x])||q)||!k);x++);else q=k=!0;k=k&&!U;q=q&&!c;for(x=0;x<B.length;x++)if(y=0<=mxUtils.indexOf(Graph.textStyles,+B[x]),"strokeColor"!=B[x]||null!=P[x]&&"none"!=P[x])if(0<=mxUtils.indexOf(Graph.cellStyles,B[x])||"shape"==B[x])if("shape"!=B[x]&&(k||y&&!U)&&!f&&(null==P[x]?delete G[B[x]]:G[B[x]]=P[x]),q||y&&!c)null==P[x]?delete O[B[x]]:O[B[x]]=P[x]};Graph.prototype.includeDescendants=function(y){for(var B=[],P=0;P<y.length;P++)B=B.concat(this.model.getDescendants(y[P]));return B};Graph.prototype.includeDescendantParts=function(y){for(var B=y.slice(),P=mxUtils.bind(this,function(O){for(var U=0;U<this.model.getChildCount(O);U++){var c=+this.model.getChildAt(O,U);"1"==mxUtils.getValue(this.getCurrentCellStyle(c),"part","0")&&(B.push(c),P(c))}}),G=0;G<y.length;G++)P(y[G]);return B};Graph.prototype.pasteCellStyles=function(y,B,P,G,O,U){B=null!=B?B:this.currentVertexStyle;P=null!=P?P:this.currentEdgeStyle;O=null!=O?O:this.pasteEdgeStyle;U=null!=U?U:this.pasteStylesToText;this.model.beginUpdate();try{for(var c=0;c<y.length;c++){var f=y[c],k=this.model.getStyle(f),q=!1;null!=f.style&&"string"===typeof f.style&&(pairs=f.style.split(";"),+q=q||0<=mxUtils.indexOf(pairs,"text"));var x=this.model.isVertex(f)&&this.model.isEdge(this.model.getParent(f));if(q||x)var C=q&&!x&&U?Graph.cellStyles:Graph.textStyles;else if(C=Graph.cellStyles.slice(),!G)for(var E="string"===typeof k?k.split(";"):[],L=0;L<E.length;L++){var Q=E[L],V=Q.indexOf("=");if(0<=V){var K=Q.substring(0,V),fa=mxUtils.indexOf(C,K);0<=fa&&C.splice(fa,1);for(q=0;q<Graph.cellStyleGroups.length;q++){var aa=Graph.cellStyleGroups[q];if(0<=mxUtils.indexOf(aa,K))for(var da=0;da<aa.length;da++){var ba=+mxUtils.indexOf(C,aa[da]);0<=ba&&C.splice(ba,1)}}}}var ha=this.model.isEdge(f);q=ha||x?P:B;for(L=0;L<C.length;L++){K=C[L];var qa=q[K];if("edgeStyle"!=K||O)if(ha||!ha&&0>mxUtils.indexOf(Graph.edgeStyles,K))null!=qa?(k=mxUtils.setStyle(k,K,qa),"fontFamily"==K&&null==q.fontSource&&(k=mxUtils.setStyle(k,"fontSource",null)),ha&&"rounded"==K&&"1"==qa&&null==q.curved&&(k=mxUtils.setStyle(k,"curved",null))):G&&(k=mxUtils.setStyle(k,K,null))}Editor.simpleLabels&&(k=mxUtils.setStyle(mxUtils.setStyle(k,"html",+null),"whiteSpace",null));this.model.setStyle(f,k)}}finally{this.model.endUpdate()}return y};Graph.prototype.pasteTextStyles=function(y,B){this.model.beginUpdate();try{for(var P=0;P<y.length;P++){var G=y[P];if(this.model.isVertex(G)||this.model.isEdge(G)){for(var O=this.model.getStyle(G),U=0;U<Graph.pasteTextStyles.length;U++){var c=Graph.pasteTextStyles[U],f=B[c];null!=f&&(O=mxUtils.setStyle(O,c,f),"fontFamily"==c&&null==B.fontSource&&(O=mxUtils.setStyle(O,"fontSource",null)))}Editor.simpleLabels&&+(O=mxUtils.setStyle(mxUtils.setStyle(O,"html",null),"whiteSpace",null));this.model.setStyle(G,O)}}}finally{this.model.endUpdate()}return y};Graph.prototype.updateCellStyles=function(y,B){this.model.beginUpdate();try{for(var P=0;P<B.length;P++)if(this.model.isVertex(B[P])||this.model.isEdge(B[P])){var G=this.getCellStyle(B[P],!1),O=G[mxConstants.STYLE_PERIMETER],U=!1;for(f in y){var c=y[f];if(G[f]!=c){if(f==mxConstants.STYLE_SHAPE&&"umlLifeline"==G[f]&&"umlLifeline"!=c){U=!0;var f="participant"}this.setCellStyles(f,+c,[B[P]])}}U&&this.setCellStyles(mxConstants.STYLE_PERIMETER,O,[B[P]])}}finally{this.model.endUpdate()}};Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&(this.isCssTransformsSupported()||mxClient.IS_IOS)};Graph.prototype.isCssTransformsSupported=function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO&&(!this.lightbox||!mxClient.IS_SF)};Graph.prototype.getCellAt=function(y,B,P,G,O,U){this.useCssTransforms&&+(y=y/this.currentScale-this.currentTranslate.x,B=B/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(y,B,P,G,O,U){G=null!=G?G:!0;O=null!=O?O:!0;null==P&&(P=this.getCurrentRoot(),null==P&&(P=this.getModel().getRoot()));if(null!=P)for(var c=this.model.getChildCount(P)-1;0<=c;c--){var f=this.model.getChildAt(P,c),k=this.getScaledCellAt(y,B,f,G,O,U);if(null!=k)return k;if(this.isCellVisible(f)&&(O&&this.model.isEdge(f)||+G&&this.model.isVertex(f))&&(k=this.view.getState(f),null!=k&&(null==U||!U(k,y,B))&&this.intersects(k,y,B)))return f}return null};Graph.prototype.isRecursiveVertexResize=function(y){return!this.isSwimlane(y.cell)&&0<this.model.getChildCount(y.cell)&&!this.isCellCollapsed(y.cell)&&"1"==mxUtils.getValue(y.style,"recursiveResize","1")&&null==mxUtils.getValue(y.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(y){for(var B=this.getCellGeometry(y);null!=B&&B.relative;)y=this.getModel().getParent(y),+B=this.getCellGeometry(y);return y};Graph.prototype.isPart=function(y){return"1"==mxUtils.getValue(this.getCurrentCellStyle(y),"part","0")||this.isTableCell(y)||this.isTableRow(y)};Graph.prototype.getCompositeParents=function(y){for(var B=new mxDictionary,P=[],G=0;G<y.length;G++){var O=this.getCompositeParent(y[G]);this.isTableCell(O)&&(O=this.graph.model.getParent(O));this.isTableRow(O)&&(O=this.graph.model.getParent(O));null==O||B.get(O)||(B.put(O,!0),P.push(O))}return P};Graph.prototype.getReferenceTerminal=+function(y){if(null!=y){var B=this.getCellGeometry(y);null!=B&&B.relative&&(y=this.model.getParent(y))}null!=y&&this.model.isEdge(y)&&(y=this.model.getParent(y));null!=y&&(y=this.getCompositeParent(y));return y};Graph.prototype.getCompositeParent=function(y){for(;this.isPart(y);){var B=this.model.getParent(y);if(!this.model.isVertex(B))break;y=B}return y};Graph.prototype.orderCells=function(y,B,P){if(null==B){B=mxUtils.sortCells(this.getEditableCells(this.getSelectionCells()),!0);for(var G=new mxDictionary,+O=[],U=0;U<B.length;U++){for(var c=B[U];this.isTableCell(c)||this.isTableRow(c);)c=this.model.getParent(c);G.get(c)||(G.put(c,!0),O.push(c))}B=O}return mxGraph.prototype.orderCells.call(this,y,B,P)};Graph.prototype.filterSelectionCells=function(y){var B=this.getSelectionCells();if(null!=y){for(var P=[],G=0;G<B.length;G++)y(B[G])||P.push(B[G]);B=P}return B};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(y){if(this.useCssTransforms){var B=this.currentScale,+P=this.currentTranslate;y=new mxRectangle((y.x+2*P.x)*B-P.x,(y.y+2*P.y)*B-P.y,y.width*B,y.height*B)}b.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=function(y){y=this.strokeWidth;this.graph.useCssTransforms&&(y/=this.graph.currentScale);return y};mxGraphView.prototype.getGraphBounds=function(){var y=this.graphBounds;if(this.graph.useCssTransforms){var B=this.graph.currentTranslate,P=this.graph.currentScale;y=new mxRectangle((y.x+B.x)*P,(y.y+B.y)*P,y.width*P,y.height*P)}return y};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var d=mxGraphView.prototype.validate;mxGraphView.prototype.validate=function(y){this.graph.useCssTransforms&&(this.graph.currentScale=this.scale,this.graph.currentTranslate.x=this.translate.x,this.graph.currentTranslate.y=this.translate.y,this.scale=1,this.translate.x=0,this.translate.y=0);d.apply(this,arguments);this.graph.useCssTransforms&&(this.graph.updateCssTransform(),-this.scale=this.graph.currentScale,this.translate.x=this.graph.currentTranslate.x,this.translate.y=this.graph.currentTranslate.y)};var m=mxGraph.prototype.getCellsForGroup;Graph.prototype.getCellsForGroup=function(y){y=m.apply(this,arguments);for(var C=[],P=0;P<y.length;P++)this.isTableRow(y[P])||this.isTableCell(y[P])||C.push(y[P]);return C};var p=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(y){y=p.apply(this,arguments);for(var C=[],P=0;P<y.length;P++)this.isTable(y[P])||-this.isTableRow(y[P])||this.isTableCell(y[P])||C.push(y[P]);return C};Graph.prototype.updateCssTransform=function(){var y=this.view.getDrawPane();if(null!=y)if(y=y.parentNode,this.useCssTransforms){var C=y.getAttribute("transform");y.setAttribute("transformOrigin","0 0");var P=Math.round(100*this.currentScale)/100,G=Math.round(100*this.currentTranslate.x)/100,O=Math.round(100*this.currentTranslate.y)/100;this.armTransformTransition?this.armTransformTransition=!1:""!=y.style.transition&&(y.style.transition=-"");y.setAttribute("transform","scale("+P+","+P+")translate("+G+","+O+")");C!=y.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",y.getAttribute("transform"))}else y.removeAttribute("transformOrigin"),y.removeAttribute("transform")};var v=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var y=this.graph.useCssTransforms,C=this.scale,P=this.translate;y&&(this.scale=this.graph.currentScale,this.translate=-this.graph.currentTranslate);v.apply(this,arguments);y&&(this.scale=C,this.translate=P)};var n=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(y,C,P){var G=this.useCssTransforms,O=this.view.scale,U=this.view.translate;G&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=!1);n.apply(this,arguments);G&&(this.view.scale=O,this.view.translate=U,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};+this.scale=this.graph.currentScale,this.translate.x=this.graph.currentTranslate.x,this.translate.y=this.graph.currentTranslate.y)};var m=mxGraph.prototype.getCellsForGroup;Graph.prototype.getCellsForGroup=function(y){y=m.apply(this,arguments);for(var B=[],P=0;P<y.length;P++)this.isTableRow(y[P])||this.isTableCell(y[P])||B.push(y[P]);return B};var p=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(y){y=p.apply(this,arguments);for(var B=[],P=0;P<y.length;P++)this.isTable(y[P])||+this.isTableRow(y[P])||this.isTableCell(y[P])||B.push(y[P]);return B};Graph.prototype.updateCssTransform=function(){var y=this.view.getDrawPane();if(null!=y)if(y=y.parentNode,this.useCssTransforms){var B=y.getAttribute("transform");y.setAttribute("transformOrigin","0 0");var P=Math.round(100*this.currentScale)/100,G=Math.round(100*this.currentTranslate.x)/100,O=Math.round(100*this.currentTranslate.y)/100;this.armTransformTransition?this.armTransformTransition=!1:""!=y.style.transition&&(y.style.transition=+"");y.setAttribute("transform","scale("+P+","+P+")translate("+G+","+O+")");B!=y.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",y.getAttribute("transform"))}else y.removeAttribute("transformOrigin"),y.removeAttribute("transform")};var u=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var y=this.graph.useCssTransforms,B=this.scale,P=this.translate;y&&(this.scale=this.graph.currentScale,this.translate=+this.graph.currentTranslate);u.apply(this,arguments);y&&(this.scale=B,this.translate=P)};var n=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(y,B,P){var G=this.useCssTransforms,O=this.view.scale,U=this.view.translate;G&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=!1);n.apply(this,arguments);G&&(this.view.scale=O,this.view.translate=U,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};Graph.prototype.labelLinkClicked=function(b,d,m){var p=d.getAttribute("href");p!=Graph.sanitizeLink(p)&&Graph.sanitizeNode(d);if(null!=p&&!this.isCustomLink(p)&&(mxEvent.isLeftMouseButton(m)&&!mxEvent.isPopupTrigger(m)||mxEvent.isTouchEvent(m))){if(!this.isEnabled()||this.isCellLocked(b.cell))b=this.isBlankLink(p)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(p),b);mxEvent.consume(m)}};-Graph.prototype.openLink=function(b,d,m){var p=window;try{if(b=Graph.sanitizeLink(b),null!=b)if("_self"==d&&window!=window.top)window.location.href=b;else if(b.substring(0,this.baseUrl.length)!=this.baseUrl||"#"!=b.charAt(this.baseUrl.length)||"_top"!=d||window!=window.top||navigator.standalone)Editor.suppressNewWindows||(p=window.open(b,null!=d?d:"_blank",m?null:"noopener,noreferrer"),null==p||m||(p.opener=null));else{var v=b.split("#")[1];window.location.hash=="#"+v&&(window.location.hash="");window.location.hash=-v}}catch(n){}return p};Graph.prototype.getLinkTitle=function(b){return b.substring(b.lastIndexOf("/")+1)};Graph.prototype.isCustomLink=function(b){return"data:"==b.substring(0,5)};Graph.prototype.customLinkClicked=function(b,d){return!1};Graph.prototype.isExternalProtocol=function(b){return"mailto:"===b.substring(0,7)};+Graph.prototype.openLink=function(b,d,m){var p=window;try{if(b=Graph.sanitizeLink(b),null!=b)if("_self"==d&&window!=window.top)window.location.href=b;else if(b.substring(0,this.baseUrl.length)!=this.baseUrl||"#"!=b.charAt(this.baseUrl.length)||"_top"!=d||window!=window.top||navigator.standalone)Editor.suppressNewWindows||(p=window.open(b,null!=d?d:"_blank",m?null:"noopener,noreferrer"),null==p||m||(p.opener=null));else{var u=b.split("#")[1];window.location.hash=="#"+u&&(window.location.hash="");window.location.hash=+u}}catch(n){}return p};Graph.prototype.getLinkTitle=function(b){return b.substring(b.lastIndexOf("/")+1)};Graph.prototype.isCustomLink=function(b){return"data:"==b.substring(0,5)};Graph.prototype.customLinkClicked=function(b,d){return!1};Graph.prototype.isExternalProtocol=function(b){return"mailto:"===b.substring(0,7)};Graph.prototype.isBlankLink=function(b){return!this.isExternalProtocol(b)&&("blank"===this.linkPolicy||"self"!==this.linkPolicy&&!this.isRelativeUrl(b)&&b.substring(0,this.domainUrl.length)!==this.domainUrl)};Graph.prototype.isRelativeUrl=function(b){return null!=b&&!this.absoluteUrlPattern.test(b)&&"data:"!==b.substring(0,5)&&!this.isExternalProtocol(b)};Graph.prototype.getAbsoluteUrl=function(b){null!=b&&this.isRelativeUrl(b)&&(b="#"==b.charAt(0)?this.baseUrl+b:"/"==b.charAt(0)?this.domainUrl+b:this.domainPathUrl+b);return b};Graph.prototype.initLayoutManager=function(){this.layoutManager=new mxLayoutManager(this);this.layoutManager.hasLayout=function(b){return null!=this.graph.getCellStyle(b).childLayout};this.layoutManager.getLayout=function(b,d){var m=this.graph.model.getParent(b);if(!this.graph.isCellCollapsed(b)&&(d!=mxEvent.BEGIN_UPDATE||this.hasLayout(m,d))){d=this.graph.getCellStyle(b);var p=this.graph.isTransparentBounds(b);if("stackLayout"==d.childLayout)return b=new mxStackLayout(this.graph,!0),b.resizeParentMax=!p&&"1"==mxUtils.getValue(d,"resizeParentMax","1"),b.horizontal="1"==mxUtils.getValue(d,"horizontalStack","1"),b.resizeParent=!p&&"1"==mxUtils.getValue(d,"resizeParent","1"),b.resizeLast=!p&&"1"==mxUtils.getValue(d,"resizeLast","0"),b.spacing=d.stackSpacing||b.spacing,b.border=d.stackBorder||b.border,b.marginLeft=d.marginLeft||0,b.marginRight=d.marginRight||0,b.marginTop=d.marginTop||0,b.marginBottom=d.marginBottom||0,b.allowGaps=d.allowGaps||0,b.fill=!p,b.allowGaps&&(b.gridSize=parseFloat(mxUtils.getValue(d,"stackUnitSize",20))),b;if("treeLayout"==d.childLayout)return b=new mxCompactTreeLayout(this.graph),b.horizontal="1"==mxUtils.getValue(d,"horizontalTree","1"),b.resizeParent=!p&&"1"==mxUtils.getValue(d,"resizeParent","1"),b.sortEdges="1"==mxUtils.getValue(d,"sortEdges","0"),b.groupPadding=mxUtils.getValue(d,"parentPadding",20),b.levelDistance=mxUtils.getValue(d,"treeLevelDistance",30),b.maintainParentLocation=!0,b.edgeRouting=!1,b.resetEdges=!1,b;if("flowLayout"==d.childLayout)return b=new mxHierarchicalLayout(this.graph,mxUtils.getValue(d,"flowOrientation",mxConstants.DIRECTION_EAST)),b.resizeParent=!p&&"1"==mxUtils.getValue(d,"resizeParent","1"),b.parentBorder=mxUtils.getValue(d,"parentPadding",20),b.maintainParentLocation=!0,b.intraCellSpacing=mxUtils.getValue(d,"intraCellSpacing",mxHierarchicalLayout.prototype.intraCellSpacing),b.interRankCellSpacing=mxUtils.getValue(d,"interRankCellSpacing",mxHierarchicalLayout.prototype.interRankCellSpacing),b.interHierarchySpacing=mxUtils.getValue(d,"interHierarchySpacing",-mxHierarchicalLayout.prototype.interHierarchySpacing),b.parallelEdgeSpacing=mxUtils.getValue(d,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),b;if("circleLayout"==d.childLayout){b=new mxCircleLayout(this.graph);b.resizeParent=!p&&"1"==mxUtils.getValue(d,"resizeParent","1");var v=parseFloat(mxUtils.getValue(d,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));v=isNaN(v)?mxConstants.DEFAULT_STARTSIZE:v;d="0"==mxUtils.getValue(d,mxConstants.STYLE_HORIZONTAL,"1");b.moveCircle=-!0;b.x0=d?v+20:20;b.y0=d?20:v+20;var n=this.graph,y=b.execute;b.execute=function(C){var P=n.getModel(),G=function(){for(var q=null,x=P.getChildCount(C),B=0;B<x;B++){var E=P.getChildAt(C,B);E=P.isVertex(E)?P.getGeometry(E):null;null==E||E.relative||(q=null==q?new mxPoint(E.x,E.y):new mxPoint(Math.min(q.x,E.x),Math.min(q.y,E.y)))}return q},O=p?G():null;y.apply(this,arguments);if(null!=O){var U=G();if(null!=U&&(O.x!=U.x||O.y!=U.y)){var c=P.getChildCount(C);for(G=0;G<c;G++){var f=P.getChildAt(C,G),k=-P.isVertex(f)?P.getGeometry(f):null;null==k||k.relative||n.translateCell(f,O.x-U.x,O.y-U.y)}}}O=P.getGeometry(C);if(this.resizeParent&&null!=O){c=U=0;f=P.getChildCount(C);for(G=0;G<f;G++)k=P.getGeometry(P.getChildAt(C,G)),null==k||k.relative||(U=Math.max(U,k.x+k.width),c=Math.max(c,k.y+k.height));0<U&&0<c&&(O.width!=U+20||O.height!=c+20)&&(O=O.clone(),O.width=U+20,O.height=c+20,P.setGeometry(C,O))}};return b}if("organicLayout"==d.childLayout)return new mxFastOrganicLayout(this.graph);if("tableLayout"==-d.childLayout)return new TableLayout(this.graph);if(null!=d.childLayout)try{if(v=Graph.decodeChildLayout(d.childLayout),null!=v)return new mxCompositeLayout(this.graph,this.graph.createLayouts(v,{enforceCorners:!1}))}catch(C){null!=window.console&&console.error(C)}}return null};this.layoutManager.executeLayout=function(b,d){this.graph.model.contains(b)&&(d=this.getLayout(b,d?mxEvent.BEGIN_UPDATE:mxEvent.END_UPDATE),null!=d&&(this.graph.isAsyncLayout(d)?this.graph.canExecuteLayoutSync(d)?this.graph.executeLayoutSync(d,+mxHierarchicalLayout.prototype.interHierarchySpacing),b.parallelEdgeSpacing=mxUtils.getValue(d,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),b;if("circleLayout"==d.childLayout){b=new mxCircleLayout(this.graph);b.resizeParent=!p&&"1"==mxUtils.getValue(d,"resizeParent","1");var u=parseFloat(mxUtils.getValue(d,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));u=isNaN(u)?mxConstants.DEFAULT_STARTSIZE:u;d="0"==mxUtils.getValue(d,mxConstants.STYLE_HORIZONTAL,"1");b.moveCircle=+!0;b.x0=d?u+20:20;b.y0=d?20:u+20;var n=this.graph,y=b.execute;b.execute=function(B){var P=n.getModel(),G=function(){for(var q=null,x=P.getChildCount(B),C=0;C<x;C++){var E=P.getChildAt(B,C);E=P.isVertex(E)?P.getGeometry(E):null;null==E||E.relative||(q=null==q?new mxPoint(E.x,E.y):new mxPoint(Math.min(q.x,E.x),Math.min(q.y,E.y)))}return q},O=p?G():null;y.apply(this,arguments);if(null!=O){var U=G();if(null!=U&&(O.x!=U.x||O.y!=U.y)){var c=P.getChildCount(B);for(G=0;G<c;G++){var f=P.getChildAt(B,G),k=+P.isVertex(f)?P.getGeometry(f):null;null==k||k.relative||n.translateCell(f,O.x-U.x,O.y-U.y)}}}O=P.getGeometry(B);if(this.resizeParent&&null!=O){c=U=0;f=P.getChildCount(B);for(G=0;G<f;G++)k=P.getGeometry(P.getChildAt(B,G)),null==k||k.relative||(U=Math.max(U,k.x+k.width),c=Math.max(c,k.y+k.height));0<U&&0<c&&(O.width!=U+20||O.height!=c+20)&&(O=O.clone(),O.width=U+20,O.height=c+20,P.setGeometry(B,O))}};return b}if("organicLayout"==d.childLayout)return new mxFastOrganicLayout(this.graph);if("tableLayout"==+d.childLayout)return new TableLayout(this.graph);if(null!=d.childLayout)try{if(u=Graph.decodeChildLayout(d.childLayout),null!=u)return new mxCompositeLayout(this.graph,this.graph.createLayouts(u,{enforceCorners:!1}))}catch(B){null!=window.console&&console.error(B)}}return null};this.layoutManager.executeLayout=function(b,d){this.graph.model.contains(b)&&(d=this.getLayout(b,d?mxEvent.BEGIN_UPDATE:mxEvent.END_UPDATE),null!=d&&(this.graph.isAsyncLayout(d)?this.graph.canExecuteLayoutSync(d)?this.graph.executeLayoutSync(d,b):this.graph.scheduleAsyncLayout(b):d.execute(b)))}};Graph.prototype.canExecuteLayoutSync=function(b){b=b.constructor===mxCompositeLayout&&null!=b.layouts?b.layouts:[b];for(var d=0;d<b.length;d++)if("function"===typeof b[d].prepare&&("function"!==typeof b[d].executeSync||"function"===typeof b[d].canExecuteSync&&!b[d].canExecuteSync()))return!1;return!0};Graph.prototype.executeLayoutSync=function(b,d){b=b.constructor===mxCompositeLayout&&null!=b.layouts?b.layouts:[b];for(var m=0;m<b.length;m++)try{"function"===typeof b[m].prepare&&"function"===typeof b[m].executeSync?b[m].executeSync(d):b[m].execute(d)}catch(p){null!=window.console&&console.error(p)}};Graph.prototype.isAsyncLayout=function(b){if(null==b)return!1;if("function"===typeof b.prepare)return!0;if(b.constructor===mxCompositeLayout&&null!=b.layouts)for(var d=0;d<b.layouts.length;d++)if("function"===typeof b.layouts[d].prepare)return!0;return!1};Graph.prototype.scheduleAsyncLayout=function(b){null==b||this.destroyed||null!=this.asyncLayoutsApplying&&this.asyncLayoutsApplying[b.id]||(null!=this.asyncLayoutsRunning&&null!=this.asyncLayoutsRunning[b.id]?this.asyncLayoutsRunning[b.id]="dirty":(this.pendingAsyncLayouts=this.pendingAsyncLayouts||[],0>mxUtils.indexOf(this.pendingAsyncLayouts,b)&&this.pendingAsyncLayouts.push(b),this.asyncLayoutsScheduled||(this.asyncLayoutsScheduled=!0,window.setTimeout(mxUtils.bind(this,function(){this.asyncLayoutsScheduled=-!1;var d=this.pendingAsyncLayouts;this.pendingAsyncLayouts=[];var m=function(n){for(var y=0;null!=n;)y++,n=n.parent;return y};d.sort(function(n,y){return m(y)-m(n)});var p=0,v=mxUtils.bind(this,function(){p<d.length&&this.runAsyncLayout(d[p++],v)});v()}),0))))};-Graph.prototype.runAsyncLayout=function(b,d){var m=this.getModel();d=null!=d?d:function(){};if(this.destroyed||null==this.layoutManager||!m.contains(b)||this.isCellCollapsed(b))d();else{var p=this.layoutManager.getLayout(b,mxEvent.END_UPDATE);if(null!=p&&this.isAsyncLayout(p)){var v=p.constructor===mxCompositeLayout&&null!=p.layouts?p.layouts:[p];this.asyncLayoutsRunning=this.asyncLayoutsRunning||{};this.asyncLayoutsRunning[b.id]="running";this.asyncLayoutsApplying=this.asyncLayoutsApplying||{};var n=-this,y=0,C=function(O){n.asyncLayoutsApplying[b.id]=!0;m.beginUpdate();try{O()}finally{m.endUpdate(),delete n.asyncLayoutsApplying[b.id]}},P=function(){var O="dirty"==n.asyncLayoutsRunning[b.id];delete n.asyncLayoutsRunning[b.id];O&&n.scheduleAsyncLayout(b);d()},G=function(){if(y>=v.length||n.destroyed||!m.contains(b))P();else{var O=v[y++];try{"function"===typeof O.prepare?O.prepare(b,function(U,c){if(null==U&&null!=c&&!n.destroyed&&m.contains(b))try{C(c)}catch(f){null!=window.console&&console.error(f)}else null!=-U&&null!=window.console&&console.error(U);G()}):(C(function(){O.execute(b)}),G())}catch(U){null!=window.console&&console.error(U),G()}}};G()}else d()}};Graph.encodeChildLayout=function(b){return encodeURIComponent(JSON.stringify(b))};Graph.decodeChildLayout=function(b){return null!=b&&(b=String(b),"%"==b.charAt(0)&&(b=decodeURIComponent(b)),"["==b.charAt(0))?JSON.parse(b):null};+!1;var d=this.pendingAsyncLayouts;this.pendingAsyncLayouts=[];var m=function(n){for(var y=0;null!=n;)y++,n=n.parent;return y};d.sort(function(n,y){return m(y)-m(n)});var p=0,u=mxUtils.bind(this,function(){p<d.length&&this.runAsyncLayout(d[p++],u)});u()}),0))))};+Graph.prototype.runAsyncLayout=function(b,d){var m=this.getModel();d=null!=d?d:function(){};if(this.destroyed||null==this.layoutManager||!m.contains(b)||this.isCellCollapsed(b))d();else{var p=this.layoutManager.getLayout(b,mxEvent.END_UPDATE);if(null!=p&&this.isAsyncLayout(p)){var u=p.constructor===mxCompositeLayout&&null!=p.layouts?p.layouts:[p];this.asyncLayoutsRunning=this.asyncLayoutsRunning||{};this.asyncLayoutsRunning[b.id]="running";this.asyncLayoutsApplying=this.asyncLayoutsApplying||{};var n=+this,y=0,B=function(O){n.asyncLayoutsApplying[b.id]=!0;m.beginUpdate();try{O()}finally{m.endUpdate(),delete n.asyncLayoutsApplying[b.id]}},P=function(){var O="dirty"==n.asyncLayoutsRunning[b.id];delete n.asyncLayoutsRunning[b.id];O&&n.scheduleAsyncLayout(b);d()},G=function(){if(y>=u.length||n.destroyed||!m.contains(b))P();else{var O=u[y++];try{"function"===typeof O.prepare?O.prepare(b,function(U,c){if(null==U&&null!=c&&!n.destroyed&&m.contains(b))try{B(c)}catch(f){null!=window.console&&console.error(f)}else null!=+U&&null!=window.console&&console.error(U);G()}):(B(function(){O.execute(b)}),G())}catch(U){null!=window.console&&console.error(U),G()}}};G()}else d()}};Graph.encodeChildLayout=function(b){return encodeURIComponent(JSON.stringify(b))};Graph.decodeChildLayout=function(b){return null!=b&&(b=String(b),"%"==b.charAt(0)&&(b=decodeURIComponent(b)),"["==b.charAt(0))?JSON.parse(b):null};Graph.decodeNewEdgeStyle=function(b){return null!=b?(b=String(b),"%"==b.charAt(0)&&(b=decodeURIComponent(b)),JSON.parse(b)):null};-Graph.prototype.createLayouts=function(b,d){for(var m=[],p=0;p<b.length;p++){var v=b[p].layout,n=b[p].config;if(null!=Graph.elkLayoutAlgorithms[v]){if("undefined"===typeof ElkLayout)throw Error(mxResources.get("invalidCallFnNotFound",[v]));n=Graph.elkConfigToOptions(n);if(null!=d)for(var y in d)n.options[y]=d[y];m.push(new ElkLayout(this,Graph.elkLayoutAlgorithms[v],n.layoutOptions,n.options))}else if("undefined"!==typeof LibavoidRouting&&v===LibavoidRouting.LAYOUT_NAME)m.push(LibavoidRouting.createLayout(this,-n));else if(0<=mxUtils.indexOf(Graph.layoutNames,v)){var C="mxOrgChartLayout"==v&&null!=n?new window[v](this,n.branchOptimizer):new window[v](this);if(null!=n)for(y in n)"function"===typeof C[y]||"mxOrgChartLayout"==v&&"branchOptimizer"==y||(C[y]=n[y]);m.push(C)}else throw Error(mxResources.get("invalidCallFnNotFound",[v]));}return m};+Graph.prototype.createLayouts=function(b,d){for(var m=[],p=0;p<b.length;p++){var u=b[p].layout,n=b[p].config;if(null!=Graph.elkLayoutAlgorithms[u]){if("undefined"===typeof ElkLayout)throw Error(mxResources.get("invalidCallFnNotFound",[u]));n=Graph.elkConfigToOptions(n);if(null!=d)for(var y in d)n.options[y]=d[y];m.push(new ElkLayout(this,Graph.elkLayoutAlgorithms[u],n.layoutOptions,n.options))}else if("undefined"!==typeof LibavoidRouting&&u===LibavoidRouting.LAYOUT_NAME)m.push(LibavoidRouting.createLayout(this,+n));else if(0<=mxUtils.indexOf(Graph.layoutNames,u)){var B="mxOrgChartLayout"==u&&null!=n?new window[u](this,n.branchOptimizer):new window[u](this);if(null!=n)for(y in n)"function"===typeof B[y]||"mxOrgChartLayout"==u&&"branchOptimizer"==y||(B[y]=n[y]);m.push(B)}else throw Error(mxResources.get("invalidCallFnNotFound",[u]));}return m};Graph.elkConfigToOptions=function(b){var d={},m={};if(null!=b)for(var p in b)0===p.indexOf("elk.")?d[p]=b[p]:"edgeStyle"===p?m.edgeStyleMode=b[p]:"corners"===p?m.corners=b[p]:"resizeNodes"===p?(m.applierOptions=m.applierOptions||{},m.applierOptions.resizeParent=!!b[p]):"preserveOrigin"===p||"useViewStateSizing"===p||"respectFixedPosition"===p||"mermaidPolicy"===p||"includeEdgeLabels"===p||"includeVertexLabels"===p||"portSpread"===p||"resizeLayoutRoot"===p||"extractIsolated"===p||"sharedStems"===p||"groupPadding"===p?m[p]=b[p]:"rootCellIds"===p&&(m.rootCellIds=b[p]);return{layoutOptions:d,options:m}};Graph.elkOptionsToConfig=function(b,d){var m={};if(null!=b)for(var p in b)m[p]=b[p];null!=d&&(null!=d.edgeStyleMode&&"auto"!==d.edgeStyleMode&&(m.edgeStyle=d.edgeStyleMode),null!=d.corners&&"keep"!==d.corners&&(m.corners=d.corners),null!=d.applierOptions&&null!=d.applierOptions.resizeParent&&(m.resizeNodes=!0===d.applierOptions.resizeParent),!1===d.preserveOrigin&&(m.preserveOrigin=!1),!1===d.sharedStems&&(m.sharedStems=!1),null!=d.groupPadding&&(m.groupPadding=d.groupPadding),null!=d.rootCellIds&&-0<d.rootCellIds.length&&(m.rootCellIds=d.rootCellIds.slice()));return m};Graph.prototype.getDataForCells=function(b,d){for(var m=[],p=0;p<b.length;p++){var v={};v.id=b[p].id;var n=null!=b[p].value?b[p].value.attributes:null;this.isReplacePlaceholders(b[p])&&d&&(v.value=this.getLabel(b[p]));if(null!=n)for(var y=0;y<n.length;y++)v[n[y].nodeName]=n[y].nodeValue;else v.label=this.convertValueToString(b[p]);m.push(v)}return m};-Graph.prototype.getNodesForCells=function(b){for(var d=[],m=0;m<b.length;m++){var p=this.view.getState(b[m]);if(null!=p){for(var v=this.cellRenderer.getShapesForState(p),n=0;n<v.length;n++)null!=v[n]&&null!=v[n].node&&d.push(v[n].node);null!=p.control&&null!=p.control.node&&d.push(p.control.node)}}return d};-Graph.prototype.createWipeAnimations=function(b,d){for(var m=[],p=0;p<b.length;p++){var v=this.view.getState(b[p]);null!=v&&null!=v.shape&&(this.model.isEdge(v.cell)&&null!=v.absolutePoints&&1<v.absolutePoints.length?m.push(this.createEdgeWipeAnimation(v,d)):this.model.isVertex(v.cell)&&null!=v.shape.bounds&&m.push(this.createVertexWipeAnimation(v,d)))}return m};-Graph.prototype.createEdgeWipeAnimation=function(b,d){var m=b.absolutePoints.slice(),p=b.segments,v=b.length,n=m.length;return{execute:mxUtils.bind(this,function(y,C){if(null!=b.shape){var P=[m[0]];C=y/C;d||(C=1-C);for(var G=v*C,O=1;O<n;O++)if(G<=p[O-1]){P.push(new mxPoint(m[O-1].x+(m[O].x-m[O-1].x)*G/p[O-1],m[O-1].y+(m[O].y-m[O-1].y)*G/p[O-1]));break}else G-=p[O-1],P.push(m[O]);b.shape.points=P;b.shape.redraw();0==y&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=-b.text.node&&(b.text.node.style.opacity=C)}}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.points=m,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),d?1:0))})}};-Graph.prototype.createVertexWipeAnimation=function(b,d){var m=new mxRectangle.fromRectangle(b.shape.bounds);return{execute:mxUtils.bind(this,function(p,v){null!=b.shape&&(v=p/v,d||(v=1-v),b.shape.bounds=new mxRectangle(m.x,m.y,m.width*v,m.height),b.shape.redraw(),0==p&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=v))}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.bounds=m,b.shape.redraw(),null!=b.text&&null!=b.text.node&&+0<d.rootCellIds.length&&(m.rootCellIds=d.rootCellIds.slice()));return m};Graph.prototype.getDataForCells=function(b,d){for(var m=[],p=0;p<b.length;p++){var u={};u.id=b[p].id;var n=null!=b[p].value?b[p].value.attributes:null;this.isReplacePlaceholders(b[p])&&d&&(u.value=this.getLabel(b[p]));if(null!=n)for(var y=0;y<n.length;y++)u[n[y].nodeName]=n[y].nodeValue;else u.label=this.convertValueToString(b[p]);m.push(u)}return m};+Graph.prototype.getNodesForCells=function(b){for(var d=[],m=0;m<b.length;m++){var p=this.view.getState(b[m]);if(null!=p){for(var u=this.cellRenderer.getShapesForState(p),n=0;n<u.length;n++)null!=u[n]&&null!=u[n].node&&d.push(u[n].node);null!=p.control&&null!=p.control.node&&d.push(p.control.node)}}return d};+Graph.prototype.createWipeAnimations=function(b,d){for(var m=[],p=0;p<b.length;p++){var u=this.view.getState(b[p]);null!=u&&null!=u.shape&&(this.model.isEdge(u.cell)&&null!=u.absolutePoints&&1<u.absolutePoints.length?m.push(this.createEdgeWipeAnimation(u,d)):this.model.isVertex(u.cell)&&null!=u.shape.bounds&&m.push(this.createVertexWipeAnimation(u,d)))}return m};+Graph.prototype.createEdgeWipeAnimation=function(b,d){var m=b.absolutePoints.slice(),p=b.segments,u=b.length,n=m.length;return{execute:mxUtils.bind(this,function(y,B){if(null!=b.shape){var P=[m[0]];B=y/B;d||(B=1-B);for(var G=u*B,O=1;O<n;O++)if(G<=p[O-1]){P.push(new mxPoint(m[O-1].x+(m[O].x-m[O-1].x)*G/p[O-1],m[O-1].y+(m[O].y-m[O-1].y)*G/p[O-1]));break}else G-=p[O-1],P.push(m[O]);b.shape.points=P;b.shape.redraw();0==y&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=+b.text.node&&(b.text.node.style.opacity=B)}}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.points=m,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),d?1:0))})}};+Graph.prototype.createVertexWipeAnimation=function(b,d){var m=new mxRectangle.fromRectangle(b.shape.bounds);return{execute:mxUtils.bind(this,function(p,u){null!=b.shape&&(u=p/u,d||(u=1-u),b.shape.bounds=new mxRectangle(m.x,m.y,m.width*u,m.height),b.shape.redraw(),0==p&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=u))}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.bounds=m,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),d?1:0))})}};-Graph.prototype.createVertexPopAnimation=function(b,d){var m=new mxRectangle.fromRectangle(b.shape.bounds),p=m.getCenterX(),v=m.getCenterY();return{execute:mxUtils.bind(this,function(n,y){if(null!=b.shape){y=n/y;d||(y=1-y);var C=1-Math.exp(-5*y)*Math.cos(5*Math.PI*y);b.shape.bounds=new mxRectangle(p-m.width*C/2,v-m.height*C/2,m.width*C,m.height*C);b.shape.redraw();0==n&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=Math.min(1,+Graph.prototype.createVertexPopAnimation=function(b,d){var m=new mxRectangle.fromRectangle(b.shape.bounds),p=m.getCenterX(),u=m.getCenterY();return{execute:mxUtils.bind(this,function(n,y){if(null!=b.shape){y=n/y;d||(y=1-y);var B=1-Math.exp(-5*y)*Math.cos(5*Math.PI*y);b.shape.bounds=new mxRectangle(p-m.width*B/2,u-m.height*B/2,m.width*B,m.height*B);b.shape.redraw();0==n&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=Math.min(1,3*y))}}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.bounds=m,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),d?1:0))})}};-Graph.prototype.createPopAnimations=function(b,d){for(var m=[],p=0;p<b.length;p++){var v=this.view.getState(b[p]);null!=v&&null!=v.shape&&(this.model.isEdge(v.cell)&&null!=v.absolutePoints&&1<v.absolutePoints.length?m.push(this.createEdgeWipeAnimation(v,d)):this.model.isVertex(v.cell)&&null!=v.shape.bounds&&m.push(this.createVertexPopAnimation(v,d)))}return m};-Graph.prototype.executeAnimations=function(b,d,m,p){m=null!=m?m:30;p=null!=p?p:30;var v=null,n=0,y=mxUtils.bind(this,function(){if(n==m||this.stoppingCustomActions){window.clearInterval(v);for(var C=0;C<b.length;C++)b[C].stop();null!=d&&d()}else for(C=0;C<b.length;C++)b[C].execute(n,m);n++});v=window.setInterval(y,p);y()};-Graph.prototype.executeAnimationsStepped=function(b,d,m,p){d=null!=d?d:30;var v=0,n=mxUtils.bind(this,function(){if(v<=d){for(var y=0;y<b.length;y++)b[y].execute(v,d);m(v,d,function(){v++;n()})}else{for(y=0;y<b.length;y++)b[y].stop();null!=p&&p()}});n()};Graph.prototype.getPageSize=function(){return this.pageVisible&&null!=this.pageFormat?new mxRectangle(0,0,this.pageFormat.width*this.pageScale,this.pageFormat.height*this.pageScale):this.scrollTileSize};-Graph.prototype.getPageLayout=function(b,d,m){b=null!=b?b:this.getGraphBounds();d=null!=d?d:this.view.translate;m=null!=m?m:this.view.scale;var p=this.getPageSize();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var v=Math.floor(Math.ceil(b.x/m-d.x)/p.width),n=Math.floor(Math.ceil(b.y/m-d.y)/p.height);return new mxRectangle(v,n,Math.ceil((Math.floor((b.x+b.width)/m)-d.x)/p.width)-v,Math.ceil((Math.floor((b.y+b.height)/m)-d.y)/p.height)-n)};+Graph.prototype.createPopAnimations=function(b,d){for(var m=[],p=0;p<b.length;p++){var u=this.view.getState(b[p]);null!=u&&null!=u.shape&&(this.model.isEdge(u.cell)&&null!=u.absolutePoints&&1<u.absolutePoints.length?m.push(this.createEdgeWipeAnimation(u,d)):this.model.isVertex(u.cell)&&null!=u.shape.bounds&&m.push(this.createVertexPopAnimation(u,d)))}return m};+Graph.prototype.executeAnimations=function(b,d,m,p){m=null!=m?m:30;p=null!=p?p:30;var u=null,n=0,y=mxUtils.bind(this,function(){if(n==m||this.stoppingCustomActions){window.clearInterval(u);for(var B=0;B<b.length;B++)b[B].stop();null!=d&&d()}else for(B=0;B<b.length;B++)b[B].execute(n,m);n++});u=window.setInterval(y,p);y()};+Graph.prototype.executeAnimationsStepped=function(b,d,m,p){d=null!=d?d:30;var u=0,n=mxUtils.bind(this,function(){if(u<=d){for(var y=0;y<b.length;y++)b[y].execute(u,d);m(u,d,function(){u++;n()})}else{for(y=0;y<b.length;y++)b[y].stop();null!=p&&p()}});n()};Graph.prototype.getPageSize=function(){return this.pageVisible&&null!=this.pageFormat?new mxRectangle(0,0,this.pageFormat.width*this.pageScale,this.pageFormat.height*this.pageScale):this.scrollTileSize};+Graph.prototype.getPageLayout=function(b,d,m){b=null!=b?b:this.getGraphBounds();d=null!=d?d:this.view.translate;m=null!=m?m:this.view.scale;var p=this.getPageSize();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var u=Math.floor(Math.ceil(b.x/m-d.x)/p.width),n=Math.floor(Math.ceil(b.y/m-d.y)/p.height);return new mxRectangle(u,n,Math.ceil((Math.floor((b.x+b.width)/m)-d.x)/p.width)-u,Math.ceil((Math.floor((b.y+b.height)/m)-d.y)/p.height)-n)};Graph.prototype.getDefaultTranslate=function(b){var d=this.getPagePadding(),m=this.getPageSize();return new mxPoint(d.x-b.x*m.width,d.y-b.y*m.height)};Graph.prototype.updateMinimumSize=function(){var b=this.getPageLayout(),d=this.getPagePadding(),m=this.getPageSize(),p=Math.ceil(2*d.x+b.width*m.width);b=Math.ceil(2*d.y+b.height*m.height);if(null==this.minimumGraphSize||this.minimumGraphSize.width!=p||this.minimumGraphSize.height!=b)this.minimumGraphSize=new mxRectangle(0,0,p,b)};Graph.prototype.sanitizeHtml=function(b,d){return Graph.sanitizeHtml(b,d)};Graph.prototype.updatePlaceholders=function(){var b=!1,d;for(d in this.model.cells){var m=this.model.cells[d];this.isReplacePlaceholders(m)&&(this.view.invalidate(m,!1,!1),b=!0)}b&&this.view.validate()};Graph.prototype.isReplacePlaceholders=function(b){return null!=b.value&&"object"==typeof b.value&&"1"==b.value.getAttribute("placeholders")};Graph.prototype.isZoomWheelEvent=function(b){return Graph.zoomWheel&&!mxEvent.isShiftDown(b)&&!mxEvent.isMetaDown(b)&&!mxEvent.isAltDown(b)&&(!mxEvent.isControlDown(b)||mxClient.IS_MAC)||!Graph.zoomWheel&&(mxEvent.isAltDown(b)||mxEvent.isControlDown(b))};Graph.prototype.isScrollWheelEvent=function(b){return!this.isZoomWheelEvent(b)};Graph.prototype.isTransparentClickEvent=function(b){return mxEvent.isAltDown(b)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(b)};@@ -2625,38 +2625,38 @@ Graph.prototype.isSplitTarget=function(b,d,m){return!this.model.isEdge(d[0])&&!mGraph.prototype.isLabelMovable=function(b){var d=this.getCurrentCellStyle(b);return!this.isCellLocked(b)&&(this.model.isEdge(b)&&this.edgeLabelsMovable||this.model.isVertex(b)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(d,"labelMovable","0")))};Graph.prototype.setGridSize=function(b){this.gridSize=b;this.fireEvent(new mxEventObject("gridSizeChanged"))};Graph.prototype.setDefaultParent=function(b){this.defaultParent=b;this.fireEvent(new mxEventObject("defaultParentChanged"))};Graph.prototype.getClickableLinkForCell=function(b){do{var d=this.getLinkForCell(b);if(null!=d)return d;b=this.model.getParent(b)}while(null!=b);return null};Graph.prototype.getGlobalVariable=function(b){var d=null;"date"==b?d=(new Date).toLocaleDateString():"time"==b?d=(new Date).toLocaleTimeString():"timestamp"==b?d=(new Date).toLocaleString():"date{"==b.substring(0,5)&&(b=b.substring(5,b.length-1),d=this.formatDate(new Date,b));return d};Graph.prototype.formatDate=function(b,d,m){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",-shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var p=this.dateFormatCache,v=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g,y=function(B,E){B=String(B);for(E=E||2;B.length<E;)B="0"+B;return B};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(b)||-/\d/.test(b)||(d=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");d=String(p.masks[d]||d||p.masks["default"]);"UTC:"==d.slice(0,4)&&(d=d.slice(4),m=!0);var C=m?"getUTC":"get",P=b[C+"Date"](),G=b[C+"Day"](),O=b[C+"Month"](),U=b[C+"FullYear"](),c=b[C+"Hours"](),f=b[C+"Minutes"](),k=b[C+"Seconds"]();C=b[C+"Milliseconds"]();var q=m?0:b.getTimezoneOffset(),x={d:P,dd:y(P),ddd:p.i18n.dayNames[G],dddd:p.i18n.dayNames[G+7],m:O+1,mm:y(O+1),mmm:p.i18n.monthNames[O],mmmm:p.i18n.monthNames[O+-12],yy:String(U).slice(2),yyyy:U,h:c%12||12,hh:y(c%12||12),H:c,HH:y(c),M:f,MM:y(f),s:k,ss:y(k),l:y(C,3),L:y(99<C?Math.round(C/10):C),t:12>c?"a":"p",tt:12>c?"am":"pm",T:12>c?"A":"P",TT:12>c?"AM":"PM",Z:m?"UTC":(String(b).match(v)||[""]).pop().replace(n,""),o:(0<q?"-":"+")+y(100*Math.floor(Math.abs(q)/60)+Math.abs(q)%60,4),S:["th","st","nd","rd"][3<P%10?0:(10!=P%100-P%10)*P%10]};return d.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(B){return B in x?x[B]:B.slice(1,-B.length-1)})};Graph.prototype.getLayerForCell=function(b){for(;null!=b&&!this.model.isLayer(b);)b=this.model.getParent(b);return b};Graph.prototype.getLayerForCells=function(b){var d=null;if(0<b.length){d=this.getLayerForCell(b[0]);for(var m=1;m<b.length;m++)if(!this.model.isAncestor(d,b[m])){d=null;break}}return d};-Graph.prototype.createLayersDialog=function(b,d){var m=document.createElement("div");m.style.position="absolute";for(var p=this.getModel(),v=p.getChildCount(p.root),n=0;n<v;n++)mxUtils.bind(this,function(y){function C(){p.isVisible(y)?(O.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(G,75)):(O.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(G,25))}var P=this.convertValueToString(y)||mxResources.get("background")||"Background",G=document.createElement("div");G.style.overflow=+shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var p=this.dateFormatCache,u=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g,y=function(C,E){C=String(C);for(E=E||2;C.length<E;)C="0"+C;return C};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(b)||+/\d/.test(b)||(d=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");d=String(p.masks[d]||d||p.masks["default"]);"UTC:"==d.slice(0,4)&&(d=d.slice(4),m=!0);var B=m?"getUTC":"get",P=b[B+"Date"](),G=b[B+"Day"](),O=b[B+"Month"](),U=b[B+"FullYear"](),c=b[B+"Hours"](),f=b[B+"Minutes"](),k=b[B+"Seconds"]();B=b[B+"Milliseconds"]();var q=m?0:b.getTimezoneOffset(),x={d:P,dd:y(P),ddd:p.i18n.dayNames[G],dddd:p.i18n.dayNames[G+7],m:O+1,mm:y(O+1),mmm:p.i18n.monthNames[O],mmmm:p.i18n.monthNames[O++12],yy:String(U).slice(2),yyyy:U,h:c%12||12,hh:y(c%12||12),H:c,HH:y(c),M:f,MM:y(f),s:k,ss:y(k),l:y(B,3),L:y(99<B?Math.round(B/10):B),t:12>c?"a":"p",tt:12>c?"am":"pm",T:12>c?"A":"P",TT:12>c?"AM":"PM",Z:m?"UTC":(String(b).match(u)||[""]).pop().replace(n,""),o:(0<q?"-":"+")+y(100*Math.floor(Math.abs(q)/60)+Math.abs(q)%60,4),S:["th","st","nd","rd"][3<P%10?0:(10!=P%100-P%10)*P%10]};return d.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(C){return C in x?x[C]:C.slice(1,+C.length-1)})};Graph.prototype.getLayerForCell=function(b){for(;null!=b&&!this.model.isLayer(b);)b=this.model.getParent(b);return b};Graph.prototype.getLayerForCells=function(b){var d=null;if(0<b.length){d=this.getLayerForCell(b[0]);for(var m=1;m<b.length;m++)if(!this.model.isAncestor(d,b[m])){d=null;break}}return d};+Graph.prototype.createLayersDialog=function(b,d){var m=document.createElement("div");m.style.position="absolute";for(var p=this.getModel(),u=p.getChildCount(p.root),n=0;n<u;n++)mxUtils.bind(this,function(y){function B(){p.isVisible(y)?(O.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(G,75)):(O.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(G,25))}var P=this.convertValueToString(y)||mxResources.get("background")||"Background",G=document.createElement("div");G.style.overflow="hidden";G.style.textOverflow="ellipsis";G.style.padding="2px";G.style.whiteSpace="nowrap";G.style.cursor="pointer";G.setAttribute("title",mxResources.get(p.isVisible(y)?"hideIt":"show",[P]));var O=document.createElement("img");O.setAttribute("draggable","false");O.setAttribute("align","absmiddle");O.setAttribute("border","0");O.style.position="relative";O.style.width="16px";O.style.padding="0px 6px 0 4px";d&&(O.style.filter="invert(100%)",O.style.top="-2px");G.appendChild(O);mxUtils.write(G,P);m.appendChild(G);-mxEvent.addListener(G,"click",function(){p.setVisible(y,!p.isVisible(y));C();null!=b&&b(y)});C()})(p.getChildAt(p.root,n));return m};-Graph.prototype.replacePlaceholders=function(b,d,m,p){p=[];if(null!=d){for(var v,n=0;v=this.placeholderPattern.exec(d);){var y=v[0];if(2<y.length&&"%label%"!=y&&"%tooltip%"!=y){var C=null;if(v.index>n&&"%"==d.charAt(v.index-1))C=y.substring(1);else{var P=y.substring(1,y.length-1),G={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==P)C=b.id;else if("width"===P.substring(0,5)&&this.model.isVertex(b)){var O=this.getCellGeometry(b);null!=O&&(C=O.width,-5<P.length&&(C=Editor.toUnit(C,G[P.substring(6)])))}else if("height"==P.substring(0,6)&&this.model.isVertex(b))O=this.getCellGeometry(b),null!=O&&(C=O.height,6<P.length&&(C=Editor.toUnit(C,G[P.substring(7)])));else if("length"==P.substring(0,6)){for(O=b;null!=O&&!this.model.isEdge(O);)O=this.model.getParent(O);O=this.view.getState(O);null!=O&&(C=Math.round(O.length/this.view.scale),6<P.length&&(C=Editor.toUnit(C,G[P.substring(7)])))}else if(0>P.indexOf("{"))for(G=b;null==C&&null!=G;)null!=G.value&&-"object"==typeof G.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(C=G.getAttribute(P+"_"+Graph.diagramLanguage)),null==C&&(C=G.hasAttribute(P)?null!=G.getAttribute(P)?G.getAttribute(P):"":null)),G=this.model.getParent(G);null==C&&("pagecount"==P.substring(0,9)&&9<P.length||"pagenumber"==P.substring(0,10)&&10<P.length?(G=P.match(/(pagecount|pagenumber)[\s]*([+-])[\s]*(\d+)/),null!=G&&(C=this.getGlobalVariable(G[1]),3<G.length&&(O=parseInt(G[3]),C+="+"==G[2]?O:-O))):C=this.getGlobalVariable(P));-null==C&&null!=m&&(C=m[P])}p.push(d.substring(n,v.index)+(null!=C?C:y));n=v.index+y.length}}p.push(d.substring(n))}return p.join("")};Graph.prototype.restoreSelection=function(b){if(null!=b&&0<b.length){for(var d=[],m=0;m<b.length;m++){var p=this.model.getCell(b[m].id);null!=p&&d.push(p)}this.setSelectionCells(d)}else this.clearSelection()};Graph.prototype.isLockedGroup=function(b){return null!=b&&"1"==mxUtils.getValue(this.getCurrentCellStyle(b),"lockedGroup","0")};+mxEvent.addListener(G,"click",function(){p.setVisible(y,!p.isVisible(y));B();null!=b&&b(y)});B()})(p.getChildAt(p.root,n));return m};+Graph.prototype.replacePlaceholders=function(b,d,m,p){p=[];if(null!=d){for(var u,n=0;u=this.placeholderPattern.exec(d);){var y=u[0];if(2<y.length&&"%label%"!=y&&"%tooltip%"!=y){var B=null;if(u.index>n&&"%"==d.charAt(u.index-1))B=y.substring(1);else{var P=y.substring(1,y.length-1),G={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==P)B=b.id;else if("width"===P.substring(0,5)&&this.model.isVertex(b)){var O=this.getCellGeometry(b);null!=O&&(B=O.width,+5<P.length&&(B=Editor.toUnit(B,G[P.substring(6)])))}else if("height"==P.substring(0,6)&&this.model.isVertex(b))O=this.getCellGeometry(b),null!=O&&(B=O.height,6<P.length&&(B=Editor.toUnit(B,G[P.substring(7)])));else if("length"==P.substring(0,6)){for(O=b;null!=O&&!this.model.isEdge(O);)O=this.model.getParent(O);O=this.view.getState(O);null!=O&&(B=Math.round(O.length/this.view.scale),6<P.length&&(B=Editor.toUnit(B,G[P.substring(7)])))}else if(0>P.indexOf("{"))for(G=b;null==B&&null!=G;)null!=G.value&&+"object"==typeof G.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(B=G.getAttribute(P+"_"+Graph.diagramLanguage)),null==B&&(B=G.hasAttribute(P)?null!=G.getAttribute(P)?G.getAttribute(P):"":null)),G=this.model.getParent(G);null==B&&("pagecount"==P.substring(0,9)&&9<P.length||"pagenumber"==P.substring(0,10)&&10<P.length?(G=P.match(/(pagecount|pagenumber)[\s]*([+-])[\s]*(\d+)/),null!=G&&(B=this.getGlobalVariable(G[1]),3<G.length&&(O=parseInt(G[3]),B+="+"==G[2]?O:-O))):B=this.getGlobalVariable(P));+null==B&&null!=m&&(B=m[P])}p.push(d.substring(n,u.index)+(null!=B?B:y));n=u.index+y.length}}p.push(d.substring(n))}return p.join("")};Graph.prototype.restoreSelection=function(b){if(null!=b&&0<b.length){for(var d=[],m=0;m<b.length;m++){var p=this.model.getCell(b[m].id);null!=p&&d.push(p)}this.setSelectionCells(d)}else this.clearSelection()};Graph.prototype.isLockedGroup=function(b){return null!=b&&"1"==mxUtils.getValue(this.getCurrentCellStyle(b),"lockedGroup","0")};Graph.prototype.hasLockedGroupStyle=function(b){return null!=b&&null!=this.getCurrentCellStyle(b).lockedGroup};Graph.prototype.isLockedGroupIconVisible=function(b){if(null==b)return!1;var d=this.getCurrentCellStyle(b).lockedGroupIcon;return"0"==d?!1:"1"==d?!0:this.hasLockedGroupStyle(b)};Graph.prototype.isEditIconVisible=function(b){return null!=b&&"1"==mxUtils.getValue(this.getCurrentCellStyle(b),"editIcon","0")};Graph.prototype.getLockedGroupAncestor=function(b){for(;null!=b;){if(this.isLockedGroup(b))return b;b=this.model.getParent(b)}return null};Graph.prototype.getLockedGroupStyleAncestor=function(b){for(;null!=b;){if(this.hasLockedGroupStyle(b))return b;b=this.model.getParent(b)}return null};Graph.prototype.selectCellForEvent=function(b,d){var m=this.getLockedGroupAncestor(this.model.getParent(b));null!=m&&(b=m);null==b||this.isToggleEvent(d)||1!=this.getSelectionCount()||(m=this.getSelectionCell(),null==m||m!=b&&!this.model.isAncestor(b,m)||(m=this.model.getParent(b),null!=m&&this.isTransparentBounds(m)&&(b=m)));mxEvent.isShiftDown(d)&&!this.isSelectionEmpty()&&this.selectTableRange(this.getSelectionCell(),b)||mxGraph.prototype.selectCellForEvent.apply(this,[b,d])};-Graph.prototype.selectTableRange=function(b,d){var m=!1;if(this.isTableCell(b)&&this.isTableCell(d)){var p=this.model.getParent(b),v=this.model.getParent(p),n=this.model.getParent(d);if(v==this.model.getParent(n)){b=p.getIndex(b);p=v.getIndex(p);var y=n.getIndex(d),C=v.getIndex(n);n=Math.max(p,C);d=Math.min(b,y);b=Math.max(b,y);y=[];for(p=Math.min(p,C);p<=n;p++){C=this.model.getChildAt(v,p);for(var P=d;P<=b;P++)y.push(this.model.getChildAt(C,P))}0<y.length&&(1<y.length||1<this.getSelectionCount()||+Graph.prototype.selectTableRange=function(b,d){var m=!1;if(this.isTableCell(b)&&this.isTableCell(d)){var p=this.model.getParent(b),u=this.model.getParent(p),n=this.model.getParent(d);if(u==this.model.getParent(n)){b=p.getIndex(b);p=u.getIndex(p);var y=n.getIndex(d),B=u.getIndex(n);n=Math.max(p,B);d=Math.min(b,y);b=Math.max(b,y);y=[];for(p=Math.min(p,B);p<=n;p++){B=this.model.getChildAt(u,p);for(var P=d;P<=b;P++)y.push(this.model.getChildAt(B,P))}0<y.length&&(1<y.length||1<this.getSelectionCount()||!this.isCellSelected(y[0]))&&(this.setSelectionCells(y),m=!0)}}return m};-Graph.prototype.snapCellsToGrid=function(b,d){this.getModel().beginUpdate();try{for(var m=0;m<b.length;m++){var p=b[m],v=this.getCellGeometry(p);if(null!=v){v=v.clone();if(this.getModel().isVertex(p))v.x=Math.round(v.x/d)*d,v.y=Math.round(v.y/d)*d,v.width=Math.round(v.width/d)*d,v.height=Math.round(v.height/d)*d;else if(this.getModel().isEdge(p)&&null!=v.points)for(var n=0;n<v.points.length;n++)v.points[n].x=Math.round(v.points[n].x/d)*d,v.points[n].y=Math.round(v.points[n].y/d)*d;this.getModel().setGeometry(p,-v)}}}finally{this.getModel().endUpdate()}};Graph.prototype.removeChildCells=function(b){this.model.beginUpdate();try{for(var d=this.model.getChildCount(b);0<=d;d--)this.model.remove(this.model.getChildAt(b,d))}finally{this.model.endUpdate()}};-Graph.prototype.updateShapes=function(b,d,m){this.model.beginUpdate();try{var p=this.model.getStyle(b),v=m?this.stylesheet.getCellStyle(p,{},!1):null;null!=v&&null==v[mxConstants.STYLE_SHAPE]&&(this.model.isVertex(b)?v[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultVertexStyle()[mxConstants.STYLE_SHAPE]:this.model.isEdge(b)&&(v[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultEdgeStyle()[mxConstants.STYLE_SHAPE]));for(var n=0;n<d.length;n++){if(this.model.isVertex(b)&&this.model.isVertex(d[n])||-this.model.isEdge(b)&&this.model.isEdge(d[n]))if(m){var y=this.model.getStyle(d[n]);if("string"===typeof y){var C=y.split(";");0<C.length&&0>C[0].indexOf("=")&&(C=C.slice(1));this.model.setStyle(d[n],C.join(";"))}this.setCellStyles(mxConstants.STYLE_PERIMETER,null,[d[n]]);this.setCellStyles("points",null,[d[n]]);this.pasteStyle(v,[d[n]],null,!0)}else v=this.copyStyle(d[n]),this.model.setStyle(d[n],p),this.pasteStyle(v,[d[n]]);"1"==mxUtils.getValue(this.getCellStyle(d[n],!1),"composite","0")&&this.removeChildCells(d[n])}}finally{this.model.endUpdate()}};-Graph.prototype.updateEdgeLabelShape=function(b,d,m){m=null!=m?m:3;var p=this.copyStyle(d),v=d;this.model.beginUpdate();try{if(this.model.isEdge(d)){var n=this.model.getValue(d),y=n;null!=n&&"object"==typeof n?(y=this.convertValueToString(d),n=n.cloneNode(!0),Graph.translateDiagram&&null!=Graph.diagramLanguage&&n.hasAttribute("label_"+Graph.diagramLanguage)?n.setAttribute("label_"+Graph.diagramLanguage,""):n.setAttribute("label","")):n="";var C=this.getCellGeometry(d);v=new mxCell(y,new mxGeometry(0,-0,0,0),"");v.geometry.relative=!0;v.vertex=!0;null!=C&&(v.geometry.x=C.x,v.geometry.y=C.y,null!=C.offset&&(v.geometry.offset=C.offset.clone()));v=this.addCell(v,d);this.model.setValue(d,n)}this.updateShapes(b,[v],!0);this.pasteStyle(p,[v],"fontFamily fontSource fontSize fontColor fontStyle textOpacity horizontal textDirection".split(" "));this.setCellStyles("resizable",null,[v]);var P=this.getCellGeometry(v),G=this.getPreferredSizeForCell(v,null,!1);if(null!=P&&null!=G){var O=G.width+2*m,U=G.height+-2*m;P=P.clone();var c=null!=P.offset?P.offset:new mxPoint(0,0);P.offset=new mxPoint(Math.round(c.x+(P.width-O)/2),Math.round(c.y+(P.height-U)/2));P.width=O;P.height=U;this.model.setGeometry(v,P)}}finally{this.model.endUpdate()}return v};Graph.prototype.selectCellsForConnectVertex=function(b,d,m){2==b.length&&this.model.isVertex(b[1])?(this.setSelectionCell(b[1]),this.scrollCellToVisible(b[1]),null!=m&&(mxEvent.isTouchEvent(d)?m.update(m.getState(this.view.getState(b[1]))):m.reset())):this.setSelectionCells(b)};+Graph.prototype.snapCellsToGrid=function(b,d){this.getModel().beginUpdate();try{for(var m=0;m<b.length;m++){var p=b[m],u=this.getCellGeometry(p);if(null!=u){u=u.clone();if(this.getModel().isVertex(p))u.x=Math.round(u.x/d)*d,u.y=Math.round(u.y/d)*d,u.width=Math.round(u.width/d)*d,u.height=Math.round(u.height/d)*d;else if(this.getModel().isEdge(p)&&null!=u.points)for(var n=0;n<u.points.length;n++)u.points[n].x=Math.round(u.points[n].x/d)*d,u.points[n].y=Math.round(u.points[n].y/d)*d;this.getModel().setGeometry(p,+u)}}}finally{this.getModel().endUpdate()}};Graph.prototype.removeChildCells=function(b){this.model.beginUpdate();try{for(var d=this.model.getChildCount(b);0<=d;d--)this.model.remove(this.model.getChildAt(b,d))}finally{this.model.endUpdate()}};+Graph.prototype.updateShapes=function(b,d,m){this.model.beginUpdate();try{var p=this.model.getStyle(b),u=m?this.stylesheet.getCellStyle(p,{},!1):null;null!=u&&null==u[mxConstants.STYLE_SHAPE]&&(this.model.isVertex(b)?u[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultVertexStyle()[mxConstants.STYLE_SHAPE]:this.model.isEdge(b)&&(u[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultEdgeStyle()[mxConstants.STYLE_SHAPE]));for(var n=0;n<d.length;n++){if(this.model.isVertex(b)&&this.model.isVertex(d[n])||+this.model.isEdge(b)&&this.model.isEdge(d[n]))if(m){var y=this.model.getStyle(d[n]);if("string"===typeof y){var B=y.split(";");0<B.length&&0>B[0].indexOf("=")&&(B=B.slice(1));this.model.setStyle(d[n],B.join(";"))}this.setCellStyles(mxConstants.STYLE_PERIMETER,null,[d[n]]);this.setCellStyles("points",null,[d[n]]);this.pasteStyle(u,[d[n]],null,!0)}else u=this.copyStyle(d[n]),this.model.setStyle(d[n],p),this.pasteStyle(u,[d[n]]);"1"==mxUtils.getValue(this.getCellStyle(d[n],!1),"composite","0")&&this.removeChildCells(d[n])}}finally{this.model.endUpdate()}};+Graph.prototype.updateEdgeLabelShape=function(b,d,m){m=null!=m?m:3;var p=this.copyStyle(d),u=d;this.model.beginUpdate();try{if(this.model.isEdge(d)){var n=this.model.getValue(d),y=n;null!=n&&"object"==typeof n?(y=this.convertValueToString(d),n=n.cloneNode(!0),Graph.translateDiagram&&null!=Graph.diagramLanguage&&n.hasAttribute("label_"+Graph.diagramLanguage)?n.setAttribute("label_"+Graph.diagramLanguage,""):n.setAttribute("label","")):n="";var B=this.getCellGeometry(d);u=new mxCell(y,new mxGeometry(0,+0,0,0),"");u.geometry.relative=!0;u.vertex=!0;null!=B&&(u.geometry.x=B.x,u.geometry.y=B.y,null!=B.offset&&(u.geometry.offset=B.offset.clone()));u=this.addCell(u,d);this.model.setValue(d,n)}this.updateShapes(b,[u],!0);this.pasteStyle(p,[u],"fontFamily fontSource fontSize fontColor fontStyle textOpacity horizontal textDirection".split(" "));this.setCellStyles("resizable",null,[u]);var P=this.getCellGeometry(u),G=this.getPreferredSizeForCell(u,null,!1);if(null!=P&&null!=G){var O=G.width+2*m,U=G.height++2*m;P=P.clone();var c=null!=P.offset?P.offset:new mxPoint(0,0);P.offset=new mxPoint(Math.round(c.x+(P.width-O)/2),Math.round(c.y+(P.height-U)/2));P.width=O;P.height=U;this.model.setGeometry(u,P)}}finally{this.model.endUpdate()}return u};Graph.prototype.selectCellsForConnectVertex=function(b,d,m){2==b.length&&this.model.isVertex(b[1])?(this.setSelectionCell(b[1]),this.scrollCellToVisible(b[1]),null!=m&&(mxEvent.isTouchEvent(d)?m.update(m.getState(this.view.getState(b[1]))):m.reset())):this.setSelectionCells(b)};Graph.prototype.isCloneConnectSource=function(b){var d=null;null!=this.layoutManager&&(d=this.layoutManager.getLayout(this.model.getParent(b)));return this.isTableRow(b)||this.isTableCell(b)||null!=d&&d.constructor==mxStackLayout};Graph.prototype.insertEdgeBeforeCell=function(b,d){for(var m=d;null!=m.parent&&null!=m.geometry&&m.geometry.relative&&m.parent!=b.parent;)m=this.model.getParent(m);null!=m&&null!=m.parent&&m.parent==b.parent&&(d=m.parent.getIndex(m),this.model.add(m.parent,b,d))};-Graph.prototype.connectVertex=function(b,d,m,p,v,n,y,C,P){n=n?n:!1;if(b.geometry.relative&&this.model.isEdge(b.parent))return[];for(;b.geometry.relative&&this.model.isVertex(b.parent);)b=b.parent;var G=this.isCloneConnectSource(b),O=G?b:this.getCompositeParent(b),U=b.geometry.relative&&null!=b.parent.geometry?new mxPoint(b.parent.geometry.width*b.geometry.x,b.parent.geometry.height*b.geometry.y):new mxPoint(O.geometry.x,O.geometry.y);d==mxConstants.DIRECTION_NORTH?(U.x+=O.geometry.width/2,U.y-=m):+Graph.prototype.connectVertex=function(b,d,m,p,u,n,y,B,P){n=n?n:!1;if(b.geometry.relative&&this.model.isEdge(b.parent))return[];for(;b.geometry.relative&&this.model.isVertex(b.parent);)b=b.parent;var G=this.isCloneConnectSource(b),O=G?b:this.getCompositeParent(b),U=b.geometry.relative&&null!=b.parent.geometry?new mxPoint(b.parent.geometry.width*b.geometry.x,b.parent.geometry.height*b.geometry.y):new mxPoint(O.geometry.x,O.geometry.y);d==mxConstants.DIRECTION_NORTH?(U.x+=O.geometry.width/2,U.y-=m):d==mxConstants.DIRECTION_SOUTH?(U.x+=O.geometry.width/2,U.y+=O.geometry.height+m):(U.x=d==mxConstants.DIRECTION_WEST?U.x-m:U.x+(O.geometry.width+m),U.y+=O.geometry.height/2);var c=this.view.getState(this.model.getParent(b));m=this.view.scale;var f=this.view.translate;O=f.x*m;f=f.y*m;null!=c&&this.model.isVertex(c.cell)&&(O=c.x,f=c.y);this.model.isVertex(b.parent)&&b.geometry.relative&&(U.x+=b.parent.geometry.x,U.y+=b.parent.geometry.y);n=n?null:(new mxRectangle(O+U.x*m,f+U.y*m)).grow(40*m);n=null!=-n?this.getCells(0,0,0,0,null,null,n,null,!0):null;c=this.view.getState(b);var k=null,q=null;if(null!=n){n=n.reverse();for(var x=0;x<n.length;x++)if(!this.isCellLocked(n[x])&&!this.model.isEdge(n[x])&&n[x]!=b)if(!this.model.isAncestor(b,n[x])&&this.isContainer(n[x])&&(null==k||n[x]==this.model.getParent(b)))k=n[x];else if(null==q&&this.isCellConnectable(n[x])&&!this.model.isAncestor(n[x],b)&&!this.isSwimlane(n[x])){var B=this.view.getState(n[x]);null==c||null==B||mxUtils.intersects(c,B)||(q=n[x])}}var E=-!mxEvent.isShiftDown(p)||mxEvent.isControlDown(p)||v;E&&("1"!=urlParams.sketch||v)&&(d==mxConstants.DIRECTION_NORTH?U.y-=b.geometry.height/2:d==mxConstants.DIRECTION_SOUTH?U.y+=b.geometry.height/2:U.x=d==mxConstants.DIRECTION_WEST?U.x-b.geometry.width/2:U.x+b.geometry.width/2);var L=[],Q=q;q=k;v=mxUtils.bind(this,function(V){if(null==y||null!=V||null==q&&G){this.model.beginUpdate();try{if(null==Q&&E){var K=this.getAbsoluteParent(null!=V?V:b);K=G?b:this.getCompositeParent(K);Q=null!=V?V:this.duplicateCells([K],+n?this.getCells(0,0,0,0,null,null,n,null,!0):null;c=this.view.getState(b);var k=null,q=null;if(null!=n){n=n.reverse();for(var x=0;x<n.length;x++)if(!this.isCellLocked(n[x])&&!this.model.isEdge(n[x])&&n[x]!=b)if(!this.model.isAncestor(b,n[x])&&this.isContainer(n[x])&&(null==k||n[x]==this.model.getParent(b)))k=n[x];else if(null==q&&this.isCellConnectable(n[x])&&!this.model.isAncestor(n[x],b)&&!this.isSwimlane(n[x])){var C=this.view.getState(n[x]);null==c||null==C||mxUtils.intersects(c,C)||(q=n[x])}}var E=+!mxEvent.isShiftDown(p)||mxEvent.isControlDown(p)||u;E&&("1"!=urlParams.sketch||u)&&(d==mxConstants.DIRECTION_NORTH?U.y-=b.geometry.height/2:d==mxConstants.DIRECTION_SOUTH?U.y+=b.geometry.height/2:U.x=d==mxConstants.DIRECTION_WEST?U.x-b.geometry.width/2:U.x+b.geometry.width/2);var L=[],Q=q;q=k;u=mxUtils.bind(this,function(V){if(null==y||null!=V||null==q&&G){this.model.beginUpdate();try{if(null==Q&&E){var K=this.getAbsoluteParent(null!=V?V:b);K=G?b:this.getCompositeParent(K);Q=null!=V?V:this.duplicateCells([K],!1)[0];null!=V&&this.addCells([Q],this.model.getParent(b),null,null,null,!0);var fa=this.getCellGeometry(Q);null!=fa&&(null!=V&&"1"==urlParams.sketch&&(d==mxConstants.DIRECTION_NORTH?U.y-=fa.height/2:d==mxConstants.DIRECTION_SOUTH?U.y+=fa.height/2:U.x=d==mxConstants.DIRECTION_WEST?U.x-fa.width/2:U.x+fa.width/2),fa.x=U.x-fa.width/2,fa.y=U.y-fa.height/2);null!=k?(this.addCells([Q],k,null,null,null,!0),q=null):E&&!G&&this.addCells([Q],this.getDefaultParent(),null,null,null,!0)}var aa=mxEvent.isControlDown(p)&&mxEvent.isShiftDown(p)&&E||null==q&&G?null:this.insertEdge(this.model.getParent(b),null,"",b,Q,this.createCurrentEdgeStyle());null!=aa&&(L.push(aa),this.applyNewEdgeStyle(b,[aa],d),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(aa,b));if(null==q&&null!=Q&&null!=b.parent&&G&&d==mxConstants.DIRECTION_WEST){var da=b.parent.getIndex(b);this.model.add(b.parent,Q,da)}null==q&&null!=Q&&L.push(Q);null==Q&&null!=aa&&aa.geometry.setTerminalPoint(U,!1);null!=aa&&this.fireEvent(new mxEventObject("cellsInserted",-"cells",[aa]))}finally{this.model.endUpdate()}}if(null!=C)C(L);else return L});if(null==y&&null==P||null!=Q||!E||null==q&&G)return v(Q);if(null!=P)return v(P);y(O+U.x*m,f+U.y*m,v)};-Graph.prototype.getIndexableText=function(b){b=null!=b?b:this.model.getDescendants(this.model.root);for(var d=document.createElement("div"),m=[],p,v=0;v<b.length;v++)if(p=b[v],this.model.isVertex(p)||this.model.isEdge(p))this.isHtmlLabel(p)?(d.innerHTML=Graph.sanitizeHtml(this.getLabel(p)),p=mxUtils.extractTextWithWhitespace([d])):p=this.getLabel(p),p=mxUtils.trim(p.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<p.length&&m.push(p);return m.join(" ")};+"cells",[aa]))}finally{this.model.endUpdate()}}if(null!=B)B(L);else return L});if(null==y&&null==P||null!=Q||!E||null==q&&G)return u(Q);if(null!=P)return u(P);y(O+U.x*m,f+U.y*m,u)};+Graph.prototype.getIndexableText=function(b){b=null!=b?b:this.model.getDescendants(this.model.root);for(var d=document.createElement("div"),m=[],p,u=0;u<b.length;u++)if(p=b[u],this.model.isVertex(p)||this.model.isEdge(p))this.isHtmlLabel(p)?(d.innerHTML=Graph.sanitizeHtml(this.getLabel(p)),p=mxUtils.extractTextWithWhitespace([d])):p=this.getLabel(p),p=mxUtils.trim(p.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<p.length&&m.push(p);return m.join(" ")};Graph.prototype.convertValueToString=function(b){var d=this.model.getValue(b);if(null!=d&&"object"==typeof d){var m=null;if(this.isReplacePlaceholders(b)&&null!=b.getAttribute("placeholder")){d=b.getAttribute("placeholder");for(var p=b;null==m&&null!=p;)null!=p.value&&"object"==typeof p.value&&(m=p.hasAttribute(d)?null!=p.getAttribute(d)?p.getAttribute(d):"":null),p=this.model.getParent(p)}else m=null,Graph.translateDiagram&&null!=Graph.diagramLanguage&&(m=d.getAttribute("label_"+Graph.diagramLanguage)),null==m&&(m=d.getAttribute("label")||"");return m||""}return mxGraph.prototype.convertValueToString.apply(this,arguments)};Graph.prototype.getLinksForState=function(b){return null!=b&&null!=b.text&&null!=b.text.node?b.text.node.getElementsByTagName("a"):null};Graph.prototype.getLinkForCell=function(b,d){return null!=b.value&&"object"==typeof b.value?(b=b.value.getAttribute("link"),d||(b=mxUtils.removeJavascriptProtocol(b)),b):null};Graph.prototype.getLinkTargetForCell=function(b){return null!=b.value&&"object"==typeof b.value?b.value.getAttribute("linkTarget"):null};Graph.prototype.postProcessCellStyle=function(b,d){return this.updateHorizontalStyle(b,this.replaceDefaultColors(b,mxGraph.prototype.postProcessCellStyle.apply(this,arguments)))};@@ -2666,40 +2666,40 @@ mxConstants.STYLE_IMAGE_BACKGROUND,b);this.replaceDefaultColor(d,mxConstants.STYGraph.prototype.getDefaultColor=function(b,d,m){d="default"+d.charAt(0).toUpperCase()+d.substring(1);"invert"==b[d]&&(b=mxUtils.getLightDarkColor(m),m="light-dark("+b.dark+", "+b.light+")");return m};Graph.prototype.setAdaptiveColors=function(b){this.adaptiveColors="default"==b?null:b;"1"==urlParams.embedInline?null!=this.container&&(this.container.style.colorScheme="none"==this.getAdaptiveColors()?"light":""):(b=this.view.getDrawPane().ownerSVGElement,null!=b&&(b.style.colorScheme="none"==this.getAdaptiveColors()?"light":""))};Graph.prototype.getAdaptiveColors=function(){return null!=this.adaptiveColors?this.adaptiveColors:Graph.defaultAdaptiveColors};Graph.prototype.updateAlternateBounds=function(b,d,m){if(null!=b&&null!=d&&null!=this.layoutManager&&null!=d.alternateBounds){var p=this.layoutManager.getLayout(this.model.getParent(b));null!=p&&p.constructor==mxStackLayout&&(p.horizontal?d.alternateBounds.height=0:d.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};-Graph.prototype.moveCellsTo=function(b,d){if(null!=b&&null!=d){for(var m=!0,p=0;p<b.length&&m;p++)m=m&&this.model.isEdge(b[p]);p=null;if(1==b.length&&m){var v=this.getCellGeometry(b[0]);null!=v&&(p=v.getTerminalPoint(!0))}p=null!=p?p:this.getBoundingBoxFromGeometry(b,m);null!=p&&(m=Math.round(this.snap(d.x)),d=Math.round(this.snap(d.y)),this.cellsMoved(b,m-p.x,d-p.y))}};Graph.prototype.isMoveCellsEvent=function(b,d){return mxEvent.isShiftDown(b)||"1"==mxUtils.getValue(d.style,"moveCells","0")};-Graph.prototype.foldCells=function(b,d,m,p,v){d=null!=d?d:!1;null==m&&(m=this.getFoldableCells(this.getSelectionCells(),b));if(null!=m){this.model.beginUpdate();try{mxGraph.prototype.foldCells.apply(this,arguments);for(var n=0;n<m.length;n++){var y=this.view.getState(m[n]),C=this.getCellGeometry(m[n]);if(null!=y&&null!=C&&("1"!=mxUtils.getValue(y.style,"expandToFront","0")||this.isCellCollapsed(m[n])||this.orderCells(!1,[m[n]]),null!=this.layoutManager)){var P=0,G=0;if(C.alternateBounds)P=C.width--C.alternateBounds.width,G=C.height-C.alternateBounds.height;else{var O=this.useCssTransforms?1:this.view.scale;P=Math.round(C.width-y.width/O);G=Math.round(C.height-y.height/O)}if(0!=G||0!=P){var U=this.model.getParent(m[n]),c=this.layoutManager.getLayout(U);null==c?null!=v&&this.isMoveCellsEvent(v,y)&&this.moveSiblings(y,U,P,G):null!=v&&mxEvent.isAltDown(v)||c.constructor!=mxStackLayout||c.resizeLast||this.resizeParentStacks(U,c,P,G)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(m)}};-Graph.prototype.moveSiblings=function(b,d,m,p){this.model.beginUpdate();try{var v=this.getCellsBeyond(b.x,b.y,d,!0,!0);for(d=0;d<v.length;d++)if(v[d]!=b.cell){var n=this.view.getState(v[d]),y=this.getCellGeometry(v[d]);null!=n&&null!=y&&(y=y.clone(),y.translate(Math.round(m*Math.max(0,Math.min(1,(n.x-b.x)/b.width))),Math.round(p*Math.max(0,Math.min(1,(n.y-b.y)/b.height)))),this.model.setGeometry(v[d],y))}}finally{this.model.endUpdate()}};-Graph.prototype.resizeParentStacks=function(b,d,m,p){if(null!=this.layoutManager&&null!=d&&d.constructor==mxStackLayout&&!d.resizeLast){this.model.beginUpdate();try{for(var v=d.horizontal;null!=b&&null!=d&&d.constructor==mxStackLayout&&d.horizontal==v&&!d.resizeLast;){var n=this.getCellGeometry(b),y=this.view.getState(b);null!=y&&null!=n&&(n=n.clone(),d.horizontal?n.width+=m+Math.min(0,y.width/this.view.scale-n.width):n.height+=p+Math.min(0,y.height/this.view.scale-n.height),this.model.setGeometry(b,+Graph.prototype.moveCellsTo=function(b,d){if(null!=b&&null!=d){for(var m=!0,p=0;p<b.length&&m;p++)m=m&&this.model.isEdge(b[p]);p=null;if(1==b.length&&m){var u=this.getCellGeometry(b[0]);null!=u&&(p=u.getTerminalPoint(!0))}p=null!=p?p:this.getBoundingBoxFromGeometry(b,m);null!=p&&(m=Math.round(this.snap(d.x)),d=Math.round(this.snap(d.y)),this.cellsMoved(b,m-p.x,d-p.y))}};Graph.prototype.isMoveCellsEvent=function(b,d){return mxEvent.isShiftDown(b)||"1"==mxUtils.getValue(d.style,"moveCells","0")};+Graph.prototype.foldCells=function(b,d,m,p,u){d=null!=d?d:!1;null==m&&(m=this.getFoldableCells(this.getSelectionCells(),b));if(null!=m){this.model.beginUpdate();try{mxGraph.prototype.foldCells.apply(this,arguments);for(var n=0;n<m.length;n++){var y=this.view.getState(m[n]),B=this.getCellGeometry(m[n]);if(null!=y&&null!=B&&("1"!=mxUtils.getValue(y.style,"expandToFront","0")||this.isCellCollapsed(m[n])||this.orderCells(!1,[m[n]]),null!=this.layoutManager)){var P=0,G=0;if(B.alternateBounds)P=B.width-+B.alternateBounds.width,G=B.height-B.alternateBounds.height;else{var O=this.useCssTransforms?1:this.view.scale;P=Math.round(B.width-y.width/O);G=Math.round(B.height-y.height/O)}if(0!=G||0!=P){var U=this.model.getParent(m[n]),c=this.layoutManager.getLayout(U);null==c?null!=u&&this.isMoveCellsEvent(u,y)&&this.moveSiblings(y,U,P,G):null!=u&&mxEvent.isAltDown(u)||c.constructor!=mxStackLayout||c.resizeLast||this.resizeParentStacks(U,c,P,G)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(m)}};+Graph.prototype.moveSiblings=function(b,d,m,p){this.model.beginUpdate();try{var u=this.getCellsBeyond(b.x,b.y,d,!0,!0);for(d=0;d<u.length;d++)if(u[d]!=b.cell){var n=this.view.getState(u[d]),y=this.getCellGeometry(u[d]);null!=n&&null!=y&&(y=y.clone(),y.translate(Math.round(m*Math.max(0,Math.min(1,(n.x-b.x)/b.width))),Math.round(p*Math.max(0,Math.min(1,(n.y-b.y)/b.height)))),this.model.setGeometry(u[d],y))}}finally{this.model.endUpdate()}};+Graph.prototype.resizeParentStacks=function(b,d,m,p){if(null!=this.layoutManager&&null!=d&&d.constructor==mxStackLayout&&!d.resizeLast){this.model.beginUpdate();try{for(var u=d.horizontal;null!=b&&null!=d&&d.constructor==mxStackLayout&&d.horizontal==u&&!d.resizeLast;){var n=this.getCellGeometry(b),y=this.view.getState(b);null!=y&&null!=n&&(n=n.clone(),d.horizontal?n.width+=m+Math.min(0,y.width/this.view.scale-n.width):n.height+=p+Math.min(0,y.height/this.view.scale-n.height),this.model.setGeometry(b,n));b=this.model.getParent(b);d=this.layoutManager.getLayout(b)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(b){var d=this.getCurrentCellStyle(b);return this.isSwimlane(b)?"0"!=d.container:"1"==d.container};Graph.prototype.borderBandSize=8;-Graph.prototype.getBorderContainer=function(b,d,m){var p=this.borderBandSize,v=null;if(0<p&&null!=b&&this.model.isVertex(b)){var n=this.getCellGeometry(b);if(null==n||Math.min(n.width,n.height)>3*p)for(b=this.model.getParent(b);null==v&&this.model.isVertex(b);){n=this.view.getState(b);if(null!=n){var y=new mxPoint(d,m),C=mxUtils.getValue(n.style,mxConstants.STYLE_ROTATION,0);0!=C&&(C=mxUtils.toRadians(-C),y=mxUtils.getRotatedPoint(y,Math.cos(C),Math.sin(C),new mxPoint(n.getCenterX(),n.getCenterY())));-if(y.x>=n.x+p&&y.x<=n.x+n.width-p&&y.y>=n.y+p&&y.y<=n.y+n.height-p)break;y.x>=n.x-p&&y.x<=n.x+n.width+p&&y.y>=n.y-p&&y.y<=n.y+n.height+p&&this.isContainer(b)&&!this.isTable(b)&&!this.isTableRow(b)&&!this.isTableCell(b)&&!this.isCellLocked(b)&&this.isCellConnectable(b)&&(v=b)}b=this.model.getParent(b)}}return v};Graph.prototype.isTransparentBounds=function(b){return"1"==this.getCurrentCellStyle(b).transparentBounds};+Graph.prototype.getBorderContainer=function(b,d,m){var p=this.borderBandSize,u=null;if(0<p&&null!=b&&this.model.isVertex(b)){var n=this.getCellGeometry(b);if(null==n||Math.min(n.width,n.height)>3*p)for(b=this.model.getParent(b);null==u&&this.model.isVertex(b);){n=this.view.getState(b);if(null!=n){var y=new mxPoint(d,m),B=mxUtils.getValue(n.style,mxConstants.STYLE_ROTATION,0);0!=B&&(B=mxUtils.toRadians(-B),y=mxUtils.getRotatedPoint(y,Math.cos(B),Math.sin(B),new mxPoint(n.getCenterX(),n.getCenterY())));+if(y.x>=n.x+p&&y.x<=n.x+n.width-p&&y.y>=n.y+p&&y.y<=n.y+n.height-p)break;y.x>=n.x-p&&y.x<=n.x+n.width+p&&y.y>=n.y-p&&y.y<=n.y+n.height+p&&this.isContainer(b)&&!this.isTable(b)&&!this.isTableRow(b)&&!this.isTableCell(b)&&!this.isCellLocked(b)&&this.isCellConnectable(b)&&(u=b)}b=this.model.getParent(b)}}return u};Graph.prototype.isTransparentBounds=function(b){return"1"==this.getCurrentCellStyle(b).transparentBounds};Graph.prototype.isMoveIconVisible=function(b){var d=this.getCurrentCellStyle(b).moveIcon;return null!=d?"1"==d:this.isTransparentBounds(b)};Graph.prototype.getMoveIconDragCells=function(b){return null};-Graph.prototype.getNestedCornerIconOffset=function(b,d,m,p){for(var v=this.model,n=this.view,y=this.getSelectionCells(),C=new mxDictionary,P=0,G=0;G<y.length;G++){var O=y[G];if(O!=b){for(var U=[O],c=v.getParent(O);null!=c&&c!=b;)U.push(c),c=v.getParent(c);if(c==b)for(c=0;c<U.length;c++){var f=U[c];if(null==C.get(f)&&(C.put(f,!0),(f==O||this.isTransparentBounds(f))&&p(f)&&(f=n.getState(f),null!=f))){f=[[f.x,f.y],[f.x+f.width,f.y],[f.x,f.y+f.height],[f.x+f.width,f.y+f.height]];for(var k=0;k<f.length;k++)if(16>-Math.abs(f[k][0]-d)&&16>Math.abs(f[k][1]-m)){P++;break}}}}}return 16*P};Graph.prototype.getNestedTransparentBoundsCount=function(b){if(!this.isTransparentBounds(b))return 0;var d=this.model,m=this,p=0,v=function(n){for(var y=d.getChildCount(n),C=0;C<y;C++){var P=d.getChildAt(n,C);m.isTransparentBounds(P)&&p++;v(P)}};v(b);return p};Graph.prototype.isConnectIconVisible=function(b){b=this.getCurrentCellStyle(b).connectIcon;return null!=b?"1"==b:Editor.showConnectHandle};+Graph.prototype.getNestedCornerIconOffset=function(b,d,m,p){for(var u=this.model,n=this.view,y=this.getSelectionCells(),B=new mxDictionary,P=0,G=0;G<y.length;G++){var O=y[G];if(O!=b){for(var U=[O],c=u.getParent(O);null!=c&&c!=b;)U.push(c),c=u.getParent(c);if(c==b)for(c=0;c<U.length;c++){var f=U[c];if(null==B.get(f)&&(B.put(f,!0),(f==O||this.isTransparentBounds(f))&&p(f)&&(f=n.getState(f),null!=f))){f=[[f.x,f.y],[f.x+f.width,f.y],[f.x,f.y+f.height],[f.x+f.width,f.y+f.height]];for(var k=0;k<f.length;k++)if(16>+Math.abs(f[k][0]-d)&&16>Math.abs(f[k][1]-m)){P++;break}}}}}return 16*P};Graph.prototype.getNestedTransparentBoundsCount=function(b){if(!this.isTransparentBounds(b))return 0;var d=this.model,m=this,p=0,u=function(n){for(var y=d.getChildCount(n),B=0;B<y;B++){var P=d.getChildAt(n,B);m.isTransparentBounds(P)&&p++;u(P)}};u(b);return p};Graph.prototype.isConnectIconVisible=function(b){b=this.getCurrentCellStyle(b).connectIcon;return null!=b?"1"==b:Editor.showConnectHandle};Graph.prototype.isSelectParentFirst=function(b){return"1"==this.getCurrentCellStyle(b).selectParentFirst};Graph.prototype.parsePadding=function(b){b=null!=b?String(b):"";try{b=decodeURIComponent(b)}catch(d){}b=b.trim().split(/\s+/).map(function(d){d=parseFloat(d);return isNaN(d)?0:d});return 1===b.length?{n:b[0],e:b[0],s:b[0],w:b[0]}:2===b.length?{n:b[0],e:b[1],s:b[0],w:b[1]}:3===b.length?{n:b[0],e:b[1],s:b[2],w:b[1]}:{n:b[0],e:b[1],s:b[2],w:b[3]}};Graph.prototype.getTransparentBoundsPadding=function(b){b=this.getCurrentCellStyle(b);return this.parsePadding(mxUtils.getValue(b,mxConstants.STYLE_GROUP_PADDING,0))};Graph.prototype.invalidateTransparentBoundsAncestors=function(b,d){for(b=d&&null!=b?b:null!=b?this.model.getParent(b):null;null!=b;)this.isTransparentBounds(b)&&this.view.invalidate(b,!1,!0),b=this.model.getParent(b)};var graphProcessChange=Graph.prototype.processChange;Graph.prototype.processChange=function(b){graphProcessChange.apply(this,arguments);b instanceof mxChildChange?(this.invalidateTransparentBoundsAncestors(b.child),this.invalidateTransparentBoundsAncestors(b.previous,!0)):(b instanceof mxGeometryChange||b instanceof mxTerminalChange)&&this.invalidateTransparentBoundsAncestors(b.cell)};-Graph.prototype.getTransparentChildBounds=function(b){for(var d=null,m=this.model.getChildCount(b),p=0;p<m;p++){var v=this.model.getChildAt(b,p),n=null;if(this.model.isVertex(v)){var y=this.getCellGeometry(v);if(null!=y&&!y.relative)if(this.isTransparentBounds(v)){var C=this.getTransparentBounds(v);null!=C&&(n=new mxRectangle(y.x+C.x,y.y+C.y,C.width,C.height))}else n=new mxRectangle(y.x,y.y,y.width,y.height)}else if(this.model.isEdge(v)&&(y=this.getCellGeometry(v),null!=y))for(C=[],null==this.model.getTerminal(v,-!0)&&null!=y.getTerminalPoint(!0)&&C.push(y.getTerminalPoint(!0)),null==this.model.getTerminal(v,!1)&&null!=y.getTerminalPoint(!1)&&C.push(y.getTerminalPoint(!1)),null!=y.points&&(C=C.concat(y.points)),y=0;y<C.length;y++)null!=C[y]&&(null==n?n=new mxRectangle(C[y].x,C[y].y,0,0):n.add(new mxRectangle(C[y].x,C[y].y,0,0)));null!=n&&(null==d?d=mxRectangle.fromRectangle(n):d.add(n))}return d};+Graph.prototype.getTransparentChildBounds=function(b){for(var d=null,m=this.model.getChildCount(b),p=0;p<m;p++){var u=this.model.getChildAt(b,p),n=null;if(this.model.isVertex(u)){var y=this.getCellGeometry(u);if(null!=y&&!y.relative)if(this.isTransparentBounds(u)){var B=this.getTransparentBounds(u);null!=B&&(n=new mxRectangle(y.x+B.x,y.y+B.y,B.width,B.height))}else n=new mxRectangle(y.x,y.y,y.width,y.height)}else if(this.model.isEdge(u)&&(y=this.getCellGeometry(u),null!=y))for(B=[],null==this.model.getTerminal(u,+!0)&&null!=y.getTerminalPoint(!0)&&B.push(y.getTerminalPoint(!0)),null==this.model.getTerminal(u,!1)&&null!=y.getTerminalPoint(!1)&&B.push(y.getTerminalPoint(!1)),null!=y.points&&(B=B.concat(y.points)),y=0;y<B.length;y++)null!=B[y]&&(null==n?n=new mxRectangle(B[y].x,B[y].y,0,0):n.add(new mxRectangle(B[y].x,B[y].y,0,0)));null!=n&&(null==d?d=mxRectangle.fromRectangle(n):d.add(n))}return d};Graph.prototype.getTransparentBounds=function(b){var d=this.getTransparentChildBounds(b);if(null==d)return null;var m=this.getTransparentBoundsPadding(b),p=this.isSwimlane(b)?this.getActualStartSize(b):new mxRectangle;b=this.getActualFooterSize(b);return new mxRectangle(d.x-m.w-p.x-b.x,d.y-m.n-p.y-b.y,d.width+m.w+m.e+p.x+p.width+b.x+b.width,d.height+m.n+m.s+p.y+p.height+b.y+b.height)};-Graph.prototype.getBoundsForGroup=function(b,d,m){var p=null;if(null!=d)for(var v=0;v<d.length;v++){var n=null;if(this.model.isEdge(d[v]))n=this.getBoundingBoxFromGeometry([d[v]],!0);else if(this.model.isVertex(d[v])){var y=this.getCellGeometry(d[v]);if(null==y||y.relative)continue;if(this.isTransparentBounds(d[v])){var C=this.getTransparentBounds(d[v]);null!=C&&(n=new mxRectangle(y.x+C.x,y.y+C.y,C.width,C.height))}else n=new mxRectangle(y.x,y.y,y.width,y.height)}null!=n&&(null==p?p=n:p.add(n))}null!=-p&&(this.isSwimlane(b)&&(b=this.getStartSize(b),p.x-=b.width,p.y-=b.height,p.width+=b.width,p.height+=b.height),null!=m&&(p.x-=m,p.y-=m,p.width+=2*m,p.height+=2*m));return p};Graph.prototype.updateGroupBounds=function(b,d,m,p,v,n,y){if(null!=b){for(var C=[],P=0;P<b.length;P++)this.isTransparentBounds(b[P])||C.push(b[P]);if(C.length<b.length)return mxGraph.prototype.updateGroupBounds.call(this,C,d,m,p,v,n,y),b}return mxGraph.prototype.updateGroupBounds.apply(this,arguments)};-Graph.prototype.getBoundingBoxFromGeometry=function(b,d,m,p){var v=null,n=null;if(null!=b){n=[];for(var y=0;y<b.length;y++){var C=this.model.isVertex(b[y])?this.getCellGeometry(b[y]):null;if(null!=C&&!C.relative&&this.isTransparentBounds(b[y])){var P=this.getTransparentBounds(b[y]);null!=P&&(C=new mxRectangle(C.x+P.x,C.y+P.y,P.width,P.height),null==v?v=C:v.add(C))}else n.push(b[y])}}b=mxGraph.prototype.getBoundingBoxFromGeometry.call(this,n,d,null!=m?m:b,p);null!=b&&(null==v?v=b:v.add(b));return v};+Graph.prototype.getBoundsForGroup=function(b,d,m){var p=null;if(null!=d)for(var u=0;u<d.length;u++){var n=null;if(this.model.isEdge(d[u]))n=this.getBoundingBoxFromGeometry([d[u]],!0);else if(this.model.isVertex(d[u])){var y=this.getCellGeometry(d[u]);if(null==y||y.relative)continue;if(this.isTransparentBounds(d[u])){var B=this.getTransparentBounds(d[u]);null!=B&&(n=new mxRectangle(y.x+B.x,y.y+B.y,B.width,B.height))}else n=new mxRectangle(y.x,y.y,y.width,y.height)}null!=n&&(null==p?p=n:p.add(n))}null!=+p&&(this.isSwimlane(b)&&(b=this.getStartSize(b),p.x-=b.width,p.y-=b.height,p.width+=b.width,p.height+=b.height),null!=m&&(p.x-=m,p.y-=m,p.width+=2*m,p.height+=2*m));return p};Graph.prototype.updateGroupBounds=function(b,d,m,p,u,n,y){if(null!=b){for(var B=[],P=0;P<b.length;P++)this.isTransparentBounds(b[P])||B.push(b[P]);if(B.length<b.length)return mxGraph.prototype.updateGroupBounds.call(this,B,d,m,p,u,n,y),b}return mxGraph.prototype.updateGroupBounds.apply(this,arguments)};+Graph.prototype.getBoundingBoxFromGeometry=function(b,d,m,p){var u=null,n=null;if(null!=b){n=[];for(var y=0;y<b.length;y++){var B=this.model.isVertex(b[y])?this.getCellGeometry(b[y]):null;if(null!=B&&!B.relative&&this.isTransparentBounds(b[y])){var P=this.getTransparentBounds(b[y]);null!=P&&(B=new mxRectangle(B.x+P.x,B.y+P.y,P.width,P.height),null==u?u=B:u.add(B))}else n.push(b[y])}}b=mxGraph.prototype.getBoundingBoxFromGeometry.call(this,n,d,null!=m?m:b,p);null!=b&&(null==u?u=b:u.add(b));return u};Graph.prototype.isCellConnectable=function(b){var d=this.getCurrentCellStyle(b);return!this.isCellLocked(this.getLayerForCell(b))&&(null!=d.connectable?"0"!=d.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments))};Graph.prototype.isLabelMovable=function(b){var d=this.getCurrentCellStyle(b);return null!=d.movableLabel?"0"!=d.movableLabel:mxGraph.prototype.isLabelMovable.apply(this,arguments)};Graph.prototype.selectAll=function(b){b=b||this.getDefaultParent();this.isCellLocked(b)||mxGraph.prototype.selectAll.apply(this,arguments)};Graph.prototype.selectCells=function(b,d,m){m=m||this.getDefaultParent();this.isCellLocked(m)||mxGraph.prototype.selectCells.apply(this,arguments)};Graph.prototype.getSwimlaneAt=function(b,d,m){var p=mxGraph.prototype.getSwimlaneAt.apply(this,arguments);this.isCellLocked(p)&&(p=null);return p};Graph.prototype.isCellFoldable=function(b){var d=this.getCurrentCellStyle(b);return this.foldingEnabled&&!this.isTransparentBounds(b)&&"0"!=mxUtils.getValue(d,mxConstants.STYLE_RESIZABLE,"1")&&("1"==d.treeFolding||!this.isCellLocked(b)&&(this.isContainer(b)&&"0"!=d.collapsible||!this.isContainer(b)&&"1"==d.collapsible))};Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0);this.escape();this.isSelectionEmpty()||this.clearSelection()};Graph.prototype.zoom=function(b,d){b=Math.max(.01,Math.min(this.view.scale*b,160))/this.view.scale;mxGraph.prototype.zoom.apply(this,arguments)};Graph.prototype.zoomIn=function(){.15>this.view.scale?this.zoom((this.view.scale+.01)/this.view.scale):this.zoom(Math.round(this.view.scale*this.zoomFactor*20)/20/this.view.scale)};Graph.prototype.zoomOut=function(){.15>=this.view.scale?this.zoom((this.view.scale-.01)/this.view.scale):this.zoom(Math.round(1/this.zoomFactor*this.view.scale*20)/20/this.view.scale)};-Graph.prototype.fitPages=function(b,d){var m=1;null==b&&(m=this.getPageLayout(),b=m.width,m=m.height);var p=this.pageScale,v=this.pageFormat,n=this.container.clientHeight-10;b=(this.container.clientWidth-10)/(b*v.width)/p;this.zoomTo(Math.floor(20*(d?b:Math.min(b,n/(m*v.height)/p)))/20);mxUtils.hasScrollbars(this.container)&&(b=this.getPagePadding(),this.container.scrollLeft=Math.min(b.x*this.view.scale,(this.container.scrollWidth-this.container.clientWidth)/2),d||(this.container.scrollTop=Math.min(b.y*+Graph.prototype.fitPages=function(b,d){var m=1;null==b&&(m=this.getPageLayout(),b=m.width,m=m.height);var p=this.pageScale,u=this.pageFormat,n=this.container.clientHeight-10;b=(this.container.clientWidth-10)/(b*u.width)/p;this.zoomTo(Math.floor(20*(d?b:Math.min(b,n/(m*u.height)/p)))/20);mxUtils.hasScrollbars(this.container)&&(b=this.getPagePadding(),this.container.scrollLeft=Math.min(b.x*this.view.scale,(this.container.scrollWidth-this.container.clientWidth)/2),d||(this.container.scrollTop=Math.min(b.y*this.view.scale,(this.container.scrollHeight-this.container.clientHeight)/2)))};-Graph.prototype.fitWindow=function(b,d,m,p,v){d=null!=d?d:10;var n=this.container.clientWidth-d,y=this.container.clientHeight-d,C=Math.floor(20*Math.min(n/b.width,y/b.height))/20;null!=m&&(C=Math.min(C,m));if(!p||C<m)this.zoomTo(C,null,null,mxUtils.hasScrollbars(this.container)),mxUtils.hasScrollbars(this.container)&&(m=this.view.translate,this.container.scrollLeft=(b.x+m.x)*this.view.scale-Math.max((n-b.width*this.view.scale)/2+d/2,0),this.container.scrollTop=(b.y+m.y)*this.view.scale-Math.max((y--b.height*this.view.scale)/2+d/2,0),v&&this.pageVisible&&(b=this.view.getBackgroundPageBounds(),d=this.container.clientWidth,v=this.container.clientHeight,b.width<=d&&(this.container.scrollLeft=b.x+b.width/2-d/2),b.height<=v&&(this.container.scrollTop=b.y+b.height/2-v/2)))};+Graph.prototype.fitWindow=function(b,d,m,p,u){d=null!=d?d:10;var n=this.container.clientWidth-d,y=this.container.clientHeight-d,B=Math.floor(20*Math.min(n/b.width,y/b.height))/20;null!=m&&(B=Math.min(B,m));if(!p||B<m)this.zoomTo(B,null,null,mxUtils.hasScrollbars(this.container)),mxUtils.hasScrollbars(this.container)&&(m=this.view.translate,this.container.scrollLeft=(b.x+m.x)*this.view.scale-Math.max((n-b.width*this.view.scale)/2+d/2,0),this.container.scrollTop=(b.y+m.y)*this.view.scale-Math.max((y-+b.height*this.view.scale)/2+d/2,0),u&&this.pageVisible&&(b=this.view.getBackgroundPageBounds(),d=this.container.clientWidth,u=this.container.clientHeight,b.width<=d&&(this.container.scrollLeft=b.x+b.width/2-d/2),b.height<=u&&(this.container.scrollTop=b.y+b.height/2-u/2)))};Graph.prototype.getCurrentViewBox=function(){var b=this.view,d=this.container,m=b.scale;b=b.translate;return{x:Math.round(d.scrollLeft/m-b.x),y:Math.round(d.scrollTop/m-b.y),width:Math.round(d.clientWidth/m),height:Math.round(d.clientHeight/m),scale:Math.round(1E4*m)/1E4}};Graph.prototype.convertValueToTooltip=function(b){var d=null;mxUtils.isNode(b.value)&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(d=b.value.getAttribute("tooltip_"+Graph.diagramLanguage)),null==d&&(d=b.value.getAttribute("tooltip")),null!=d&&(null!=d&&this.isReplacePlaceholders(b)&&(d=this.replacePlaceholders(b,d)),d=Graph.sanitizeHtml(d)));return d};-Graph.prototype.getTooltipForCell=function(b){if(null!=window.urlParams&&"0"==urlParams.tooltips)return null;var d=this.getLockedGroupAncestor(b);null!=d&&(b=d);d="";if(mxUtils.isNode(b.value)&&(d=this.convertValueToTooltip(b),null==d)){var m=this.builtInProperties;b=b.value.attributes;var p=[];d="";this.isEnabled()&&(m.push("linkTarget"),m.push("link"));for(var v=0;v<b.length;v++)(Graph.translateDiagram&&"label"==b[v].nodeName||0>mxUtils.indexOf(m,b[v].nodeName))&&0<b[v].nodeValue.length&&p.push({name:b[v].nodeName,-value:b[v].nodeValue});p.sort(function(n,y){return n.name<y.name?-1:n.name>y.name?1:0});for(v=0;v<p.length;v++)"link"==p[v].name&&this.isCustomLink(p[v].value)||(d+=("link"!=p[v].name?"<b>"+mxUtils.htmlEntities(p[v].name)+":</b> ":"")+mxUtils.htmlEntities(p[v].value)+"\n");0<d.length&&(d=d.substring(0,d.length-1),mxClient.IS_SVG&&(d='<div style="max-width:360px;text-overflow:ellipsis;overflow:hidden;">'+d+"</div>"))}return d};-Graph.prototype.addFlowAnimationToNode=function(b,d,m,p){if(null!=b&&null!=p){var v=b.getAttribute("stroke-dasharray");if(""==v||null==v){var n=String(mxUtils.getValue(d,mxConstants.STYLE_DASH_PATTERN,"8")).split(" ");v=1==mxUtils.getValue(d,mxConstants.STYLE_FIX_DASH,!1)||null==d.dashPattern?1:mxUtils.getNumber(d,mxConstants.STYLE_STROKEWIDTH,1);if(0<n.length)for(var y=0;y<n.length;y++)n[y]=Math.round(Number(n[y])*m*v*100)/100;b.setAttribute("stroke-dasharray",n.join(" "))}else n=v.split(" ");if(0<-n.length){for(y=v=0;y<n.length;y++){var C=parseFloat(n[y]);isNaN(C)||(v+=parseFloat(n[y]))}0!=n.length%2&&(v*=2);m=Math.round(v/m/16*parseInt(mxUtils.getValue(d,"flowAnimationDuration",500)));n=mxUtils.getValue(d,"flowAnimationTimingFunction","linear");d=mxUtils.getValue(d,"flowAnimationDirection","normal");b.style.animation=p+" "+m+"ms "+mxUtils.htmlEntities(n)+" infinite "+mxUtils.htmlEntities(d);b.style.strokeDashoffset=v}}};+Graph.prototype.getTooltipForCell=function(b){if(null!=window.urlParams&&"0"==urlParams.tooltips)return null;var d=this.getLockedGroupAncestor(b);null!=d&&(b=d);d="";if(mxUtils.isNode(b.value)&&(d=this.convertValueToTooltip(b),null==d)){var m=this.builtInProperties;b=b.value.attributes;var p=[];d="";this.isEnabled()&&(m.push("linkTarget"),m.push("link"));for(var u=0;u<b.length;u++)(Graph.translateDiagram&&"label"==b[u].nodeName||0>mxUtils.indexOf(m,b[u].nodeName))&&0<b[u].nodeValue.length&&p.push({name:b[u].nodeName,+value:b[u].nodeValue});p.sort(function(n,y){return n.name<y.name?-1:n.name>y.name?1:0});for(u=0;u<p.length;u++)"link"==p[u].name&&this.isCustomLink(p[u].value)||(d+=("link"!=p[u].name?"<b>"+mxUtils.htmlEntities(p[u].name)+":</b> ":"")+mxUtils.htmlEntities(p[u].value)+"\n");0<d.length&&(d=d.substring(0,d.length-1),mxClient.IS_SVG&&(d='<div style="max-width:360px;text-overflow:ellipsis;overflow:hidden;">'+d+"</div>"))}return d};+Graph.prototype.addFlowAnimationToNode=function(b,d,m,p){if(null!=b&&null!=p){var u=b.getAttribute("stroke-dasharray");if(""==u||null==u){var n=String(mxUtils.getValue(d,mxConstants.STYLE_DASH_PATTERN,"8")).split(" ");u=1==mxUtils.getValue(d,mxConstants.STYLE_FIX_DASH,!1)||null==d.dashPattern?1:mxUtils.getNumber(d,mxConstants.STYLE_STROKEWIDTH,1);if(0<n.length)for(var y=0;y<n.length;y++)n[y]=Math.round(Number(n[y])*m*u*100)/100;b.setAttribute("stroke-dasharray",n.join(" "))}else n=u.split(" ");if(0<+n.length){for(y=u=0;y<n.length;y++){var B=parseFloat(n[y]);isNaN(B)||(u+=parseFloat(n[y]))}0!=n.length%2&&(u*=2);m=Math.round(u/m/16*parseInt(mxUtils.getValue(d,"flowAnimationDuration",500)));n=mxUtils.getValue(d,"flowAnimationTimingFunction","linear");d=mxUtils.getValue(d,"flowAnimationDirection","normal");b.style.animation=p+" "+m+"ms "+mxUtils.htmlEntities(n)+" infinite "+mxUtils.htmlEntities(d);b.style.strokeDashoffset=u}}};Graph.prototype.addFlowAnimationStyle=function(){var b=document.getElementsByTagName("head")[0];if(null!=b&&null==this.flowAnimationId){this.flowAnimationId="ge-flow-animation-"+Editor.guid();var d=document.createElement("style");d.innerHTML=this.createFlowAnimationCss(this.flowAnimationId);b.appendChild(d)}return this.flowAnimationId};Graph.prototype.createFlowAnimationCss=function(b){return"@keyframes "+b+" {\n to {\n stroke-dashoffset: 0;\n }\n}"};Graph.prototype.stringToBytes=function(b){return Graph.stringToBytes(b)};Graph.prototype.bytesToString=function(b){return Graph.bytesToString(b)};Graph.prototype.compressNode=function(b){return Graph.compressNode(b)};Graph.prototype.compress=function(b,d){return Graph.compress(b,d)};Graph.prototype.decompress=function(b,d){return Graph.decompress(b,d)};Graph.prototype.zapGremlins=function(b){return Graph.zapGremlins(b)};HoverIcons=function(b){mxEventSource.call(this);this.graph=b;this.init()};mxUtils.extend(HoverIcons,mxEventSource);HoverIcons.prototype.arrowSpacing=2;HoverIcons.prototype.updateDelay=500;HoverIcons.prototype.activationDelay=140;HoverIcons.prototype.currentState=null;HoverIcons.prototype.activeArrow=null;HoverIcons.prototype.inactiveOpacity=15;HoverIcons.prototype.cssCursor="copy";HoverIcons.prototype.checkCollisions=!0;HoverIcons.prototype.arrowFill="#29b6f2";HoverIcons.prototype.triangleUp=Graph.createSvgImage(18,28,'<path d="m 6 26 L 12 26 L 12 12 L 18 12 L 9 1 L 1 12 L 6 12 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');@@ -2714,21 +2714,21 @@ mxEvent.getSource(m)==this.graph.container&&this.setDisplay("none")}));this.grapp){d=!1;m=p.getEvent();this.isResetEvent(m)?this.reset():this.isActive()||(p=this.getState(p.getState(),p.getGraphX(),p.getGraphY()),null==p&&mxEvent.isTouchEvent(m)||this.update(p));this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(m,p){m=p.getEvent();this.isResetEvent(m)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(m)||this.update(this.getState(p.getState(),p.getGraphX(),p.getGraphY()),p.getGraphX(),p.getGraphY());null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&&(d=!0)}),mouseUp:mxUtils.bind(this,function(m,p){m=p.getEvent();mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(m),mxEvent.getClientY(m));this.isResetEvent(m)?this.reset():this.isActive()&&!d&&null!=this.mouseDownPoint?this.click(this.currentState,this.getDirection(),p):this.isActive()?1==this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(p.getGraphX(),p.getGraphY())),p.getGraphX(),p.getGraphY())):mxEvent.isTouchEvent(m)||null!=this.bbox&&mxUtils.contains(this.bbox,p.getGraphX(),p.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(m)||this.reset();d=!1;this.resetActiveArrow()})})};HoverIcons.prototype.isResetEvent=function(b,d){return mxEvent.isAltDown(b)||null==this.activeArrow&&mxEvent.isShiftDown(b)||mxEvent.isPopupTrigger(b)&&!this.graph.isCloneEvent(b)};-HoverIcons.prototype.createArrow=function(b,d,m){var p=null;p=mxUtils.createImage(b.src);p.style.width=b.width+"px";p.style.height=b.height+"px";p.style.padding=this.tolerance+"px";null!=d&&p.setAttribute("title",d);p.style.position="absolute";p.style.cursor=this.cssCursor;mxEvent.addGestureListeners(p,mxUtils.bind(this,function(v){null==this.currentState||this.isResetEvent(v)||(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(v),mxEvent.getClientY(v)),this.drag(v,-this.mouseDownPoint.x,this.mouseDownPoint.y),this.activeArrow=p,this.setDisplay("none"),mxEvent.consume(v))}));mxEvent.redirectMouseEvents(p,this.graph,this.currentState);mxEvent.addListener(p,"mouseenter",mxUtils.bind(this,function(v){mxEvent.isMouseEvent(v)&&(null!=this.activeArrow&&this.activeArrow!=p&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(p,100),this.activeArrow=p,this.fireEvent(new mxEventObject("focus",-"arrow",p,"direction",m,"event",v)))}));mxEvent.addListener(p,"mouseleave",mxUtils.bind(this,function(v){mxEvent.isMouseEvent(v)&&this.fireEvent(new mxEventObject("blur","arrow",p,"direction",m,"event",v));this.graph.isMouseDown||this.resetActiveArrow()}));return p};HoverIcons.prototype.resetActiveArrow=function(){null!=this.activeArrow&&(mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.activeArrow=null)};+HoverIcons.prototype.createArrow=function(b,d,m){var p=null;p=mxUtils.createImage(b.src);p.style.width=b.width+"px";p.style.height=b.height+"px";p.style.padding=this.tolerance+"px";null!=d&&p.setAttribute("title",d);p.style.position="absolute";p.style.cursor=this.cssCursor;mxEvent.addGestureListeners(p,mxUtils.bind(this,function(u){null==this.currentState||this.isResetEvent(u)||(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(u),mxEvent.getClientY(u)),this.drag(u,+this.mouseDownPoint.x,this.mouseDownPoint.y),this.activeArrow=p,this.setDisplay("none"),mxEvent.consume(u))}));mxEvent.redirectMouseEvents(p,this.graph,this.currentState);mxEvent.addListener(p,"mouseenter",mxUtils.bind(this,function(u){mxEvent.isMouseEvent(u)&&(null!=this.activeArrow&&this.activeArrow!=p&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(p,100),this.activeArrow=p,this.fireEvent(new mxEventObject("focus",+"arrow",p,"direction",m,"event",u)))}));mxEvent.addListener(p,"mouseleave",mxUtils.bind(this,function(u){mxEvent.isMouseEvent(u)&&this.fireEvent(new mxEventObject("blur","arrow",p,"direction",m,"event",u));this.graph.isMouseDown||this.resetActiveArrow()}));return p};HoverIcons.prototype.resetActiveArrow=function(){null!=this.activeArrow&&(mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.activeArrow=null)};HoverIcons.prototype.getDirection=function(){var b=mxConstants.DIRECTION_EAST;this.activeArrow==this.arrowUp?b=mxConstants.DIRECTION_NORTH:this.activeArrow==this.arrowDown?b=mxConstants.DIRECTION_SOUTH:this.activeArrow==this.arrowLeft&&(b=mxConstants.DIRECTION_WEST);return b};HoverIcons.prototype.visitNodes=function(b){for(var d=0;d<this.elts.length;d++)null!=this.elts[d]&&b(this.elts[d])};HoverIcons.prototype.removeNodes=function(){this.visitNodes(function(b){null!=b.parentNode&&b.parentNode.removeChild(b)})};HoverIcons.prototype.setDisplay=function(b){this.visitNodes(function(d){d.style.display=b})};HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState};HoverIcons.prototype.drag=function(b,d,m){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,d,m),this.graph.isMouseTrigger=mxEvent.isMouseEvent(b),this.graph.isMouseDown=!0,d=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),null!=d&&d.setHandlesVisible(!1),d=this.graph.connectionHandler.edgeState,null!=b&&mxEvent.isShiftDown(b)&&mxEvent.isControlDown(b)&&null!=d&&"orthogonalEdgeStyle"===mxUtils.getValue(d.style,mxConstants.STYLE_EDGE,null)&&(b=this.getDirection(),d.cell.style=mxUtils.setStyle(d.cell.style,"sourcePortConstraint",b),d.style.sourcePortConstraint=b))};HoverIcons.prototype.getStateAt=function(b,d,m){return this.graph.view.getState(this.graph.getCellAt(d,m))};-HoverIcons.prototype.click=function(b,d,m){var p=m.getEvent(),v=m.getGraphX(),n=m.getGraphY();v=this.getStateAt(b,v,n);null==v||!this.graph.model.isEdge(v.cell)||this.graph.isCloneEvent(p)||v.getVisibleTerminalState(!0)!=b&&v.getVisibleTerminalState(!1)!=b?null!=b&&this.execute(b,d,m):(this.graph.setSelectionCell(v.cell),this.reset());m.consume()};+HoverIcons.prototype.click=function(b,d,m){var p=m.getEvent(),u=m.getGraphX(),n=m.getGraphY();u=this.getStateAt(b,u,n);null==u||!this.graph.model.isEdge(u.cell)||this.graph.isCloneEvent(p)||u.getVisibleTerminalState(!0)!=b&&u.getVisibleTerminalState(!1)!=b?null!=b&&this.execute(b,d,m):(this.graph.setSelectionCell(u.cell),this.reset());m.consume()};HoverIcons.prototype.execute=function(b,d,m){m=m.getEvent();this.graph.selectCellsForConnectVertex(this.graph.connectVertex(b.cell,d,this.graph.defaultEdgeLength,m,this.graph.isCloneEvent(m),this.graph.isCloneEvent(m)),m,this)};HoverIcons.prototype.reset=function(b){null!=b&&!b||null==this.updateThread||window.clearTimeout(this.updateThread);this.activeArrow=this.currentState=this.mouseDownPoint=null;this.removeNodes();this.bbox=null;this.fireEvent(new mxEventObject("reset"))};HoverIcons.prototype.repaint=function(){this.bbox=null;if(null!=this.currentState){this.currentState=this.getState(this.currentState);if(null!=this.currentState&&this.graph.model.isVertex(this.currentState.cell)&&this.graph.isCellConnectable(this.currentState.cell)){var b=mxRectangle.fromRectangle(this.currentState);null!=this.currentState.shape&&null!=this.currentState.shape.boundingBox&&(b=mxRectangle.fromRectangle(this.currentState.shape.boundingBox));b.grow(this.graph.tolerance);b.grow(this.arrowSpacing);var d=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);this.graph.isTableRow(this.currentState.cell)&&(d=this.graph.selectionCellsHandler.getHandler(this.graph.model.getParent(this.currentState.cell)));var m=null;null!=d&&(b.x-=d.horizontalOffset/2,b.y-=d.verticalOffset/2,b.width+=d.horizontalOffset,b.height+=d.verticalOffset,null!=d.rotationShape&&null!=d.rotationShape.node&&"hidden"!=d.rotationShape.node.style.visibility&&"none"!=d.rotationShape.node.style.display&&null!=d.rotationShape.boundingBox&&-(m=d.rotationShape.boundingBox));d=mxUtils.bind(this,function(C,P,G){if(null!=m){var O=new mxRectangle(P,G,C.clientWidth,C.clientHeight);mxUtils.intersects(O,m)&&(C==this.arrowUp?G-=O.y+O.height-m.y:C==this.arrowRight?P+=m.x+m.width-O.x:C==this.arrowDown?G+=m.y+m.height-O.y:C==this.arrowLeft&&(P-=O.x+O.width-m.x))}C.style.left=P+"px";C.style.top=G+"px";mxUtils.setOpacity(C,this.inactiveOpacity)});d(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-+(m=d.rotationShape.boundingBox));d=mxUtils.bind(this,function(B,P,G){if(null!=m){var O=new mxRectangle(P,G,B.clientWidth,B.clientHeight);mxUtils.intersects(O,m)&&(B==this.arrowUp?G-=O.y+O.height-m.y:B==this.arrowRight?P+=m.x+m.width-O.x:B==this.arrowDown?G+=m.y+m.height-O.y:B==this.arrowLeft&&(P-=O.x+O.width-m.x))}B.style.left=P+"px";B.style.top=G+"px";mxUtils.setOpacity(B,this.inactiveOpacity)});d(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-this.triangleUp.height-this.tolerance));d(this.arrowRight,Math.round(b.x+b.width-this.tolerance),Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance));d(this.arrowDown,parseInt(this.arrowUp.style.left),Math.round(b.y+b.height-this.tolerance));d(this.arrowLeft,Math.round(b.x-this.triangleLeft.width-this.tolerance),parseInt(this.arrowRight.style.top));if(this.checkCollisions){d=this.graph.getCellAt(b.x+b.width+this.triangleRight.width/2,this.currentState.getCenterY());-var p=this.graph.getCellAt(b.x-this.triangleLeft.width/2,this.currentState.getCenterY()),v=this.graph.getCellAt(this.currentState.getCenterX(),b.y-this.triangleUp.height/2);b=this.graph.getCellAt(this.currentState.getCenterX(),b.y+b.height+this.triangleDown.height/2);null!=d&&d==p&&p==v&&v==b&&(b=v=p=d=null);var n=this.graph.getCellGeometry(this.currentState.cell),y=mxUtils.bind(this,function(C,P){var G=this.graph.model.isVertex(C)&&this.graph.getCellGeometry(C);null==C||this.graph.model.isAncestor(C,-this.currentState.cell)||this.graph.isSwimlane(C)||!(null==G||null==n||G.height<3*n.height&&G.width<3*n.width)?P.style.visibility="visible":P.style.visibility="hidden"});y(d,this.arrowRight);y(p,this.arrowLeft);y(v,this.arrowUp);y(b,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),+var p=this.graph.getCellAt(b.x-this.triangleLeft.width/2,this.currentState.getCenterY()),u=this.graph.getCellAt(this.currentState.getCenterX(),b.y-this.triangleUp.height/2);b=this.graph.getCellAt(this.currentState.getCenterX(),b.y+b.height+this.triangleDown.height/2);null!=d&&d==p&&p==u&&u==b&&(b=u=p=d=null);var n=this.graph.getCellGeometry(this.currentState.cell),y=mxUtils.bind(this,function(B,P){var G=this.graph.model.isVertex(B)&&this.graph.getCellGeometry(B);null==B||this.graph.model.isAncestor(B,+this.currentState.cell)||this.graph.isSwimlane(B)||!(null==G||null==n||G.height<3*n.height&&G.width<3*n.width)?P.style.visibility="visible":P.style.visibility="hidden"});y(d,this.arrowRight);y(p,this.arrowLeft);y(u,this.arrowUp);y(b,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}};HoverIcons.prototype.computeBoundingBox=function(){var b=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(d){null!=d.parentNode&&(d=new mxRectangle(d.offsetLeft,d.offsetTop,d.offsetWidth,d.offsetHeight),null==b?b=d:b.add(d))});return b};HoverIcons.prototype.getState=function(b,d,m){if(null!=b)if(b=b.cell,this.graph.getModel().contains(b)){if(this.graph.getModel().isVertex(b)&&!this.graph.isCellConnectable(b)){var p=this.graph.getModel().getParent(b);this.graph.getModel().isVertex(p)&&this.graph.isCellConnectable(p)&&(b=p)}null==d||null==m||null!=this.currentState&&this.currentState.cell==b||(d=this.graph.getBorderContainer(b,d,m),null!=d&&(b=d));if(this.graph.isCellLocked(b)||this.graph.model.isEdge(b))b=null;b=this.graph.view.getState(b);@@ -2737,131 +2737,131 @@ HoverIcons.prototype.update=function(b,d,m){if(!this.graph.connectionArrowsEnablwindow.setTimeout(mxUtils.bind(this,function(){this.isActive()||this.graph.isMouseDown||this.graph.panningHandler.isActive()||(this.prev=b,this.update(b,d,m))}),this.updateDelay+10))):null!=this.startTime&&(p=(new Date).getTime()-this.startTime);this.setDisplay("");null!=this.currentState&&this.currentState!=b&&p<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,d,m)?this.reset(!1):(null!=this.currentState||p>this.activationDelay)&&this.currentState!=b&&(p>this.updateDelay&&null!=b||null==this.bbox||null==d||null==m||!mxUtils.contains(this.bbox,d,m))&&(null!=b&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(b),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=b&&this.graph.connectionHandler.constraintHandler.reset()):this.reset())}};HoverIcons.prototype.setCurrentState=function(b){"eastwest"!=b.style.portConstraint&&(null!=this.arrowUp&&this.graph.container.appendChild(this.arrowUp),null!=this.arrowDown&&this.graph.container.appendChild(this.arrowDown));null!=this.arrowRight&&this.graph.container.appendChild(this.arrowRight);null!=this.arrowLeft&&this.graph.container.appendChild(this.arrowLeft);this.currentState=b};-Graph.prototype.removeTextStyleForCell=function(b,d){var m=this.getCurrentCellStyle(b),p=!1;this.getModel().beginUpdate();try{if("1"==mxUtils.getValue(m,"html","0")){var v=this.convertValueToString(b);"0"!=mxUtils.getValue(m,"nl2Br","1")&&(v=v.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));v=Editor.convertHtmlToText(v);this.cellLabelChanged(b,v);p=!0}d&&(this.setCellStyles("fontSource",null,[b]),this.setCellStyles(mxConstants.STYLE_FONTFAMILY,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSIZE,-null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSTYLE,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BORDERCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null,[b]))}finally{this.getModel().endUpdate()}return p};Graph.prototype.createParent=function(b,d,m,p,v){b=this.cloneCell(b);for(var n=0;n<m;n++){var y=this.cloneCell(d),C=this.getCellGeometry(y);null!=C&&(C.x+=n*p,C.y+=n*v);b.insert(y)}return b};-Graph.prototype.createTable=function(b,d,m,p,v,n,y,C,P){m=null!=m?m:60;p=null!=p?p:40;n=null!=n?n:30;C=null!=C?C:"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fixedHeader=1;";P=null!=P?P:"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;";-return this.createParent(this.createVertex(null,null,null!=v?v:"",0,0,d*m,b*p+(null!=v?n:0),null!=y?y:"shape=table;startSize="+(null!=v?n:"0")+";container=1;collapsible=0;childLayout=tableLayout;fixedHeader=1;"),this.createParent(this.createVertex(null,null,"",0,0,d*m,p,C),this.createVertex(null,null,"",0,0,m,p,P),d,m,0),b,0,p)};-Graph.prototype.setTableValues=function(b,d,m){for(var p=this.model.getChildCells(b,!0),v=0;v<p.length;v++)if(null!=m&&(p[v].value=m[v]),null!=d)for(var n=this.model.getChildCells(p[v],!0),y=0;y<n.length;y++)null!=d[v][y]&&(n[y].value=d[v][y]);return b};-Graph.prototype.createCrossFunctionalSwimlane=function(b,d,m,p,v,n,y,C,P){m=null!=m?m:120;p=null!=p?p:120;y=null!=y?y:"shape=tableRow;horizontal=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;strokeColor=inherit;bottom=0;right=0;dropTarget=0;fontStyle=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;startSize=40;fixedHeader=1;collapsible=0;recursiveResize=0;expand=0;";C=null!=C?C:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;strokeColor=inherit;connectable=0;fillColor=none;startSize=40;collapsible=0;recursiveResize=0;expand=0;";-P=null!=P?P:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;strokeColor=inherit;fillColor=none;startSize=0;collapsible=0;recursiveResize=0;expand=0;";v=this.createVertex(null,null,null!=v?v:"",0,0,d*m,b*p,null!=n?n:"shape=table;childLayout=tableLayout;fixedHeader=1;"+(null==v?"startSize=0;fillColor=none;":"startSize=40;")+"collapsible=0;recursiveResize=0;expand=0;");n=mxUtils.getValue(this.getCellStyle(v),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);v.geometry.width+=-n;v.geometry.height+=n;y=this.createVertex(null,null,"",0,n,d*m+n,p,y);v.insert(this.createParent(y,this.createVertex(null,null,"",n,0,m,p,C),d,m,0));return 1<b?(y.geometry.y=p+n,this.createParent(v,this.createParent(y,this.createVertex(null,null,"",n,0,m,p,P),d,m,0),b-1,0,p)):v};-Graph.prototype.visitTableCells=function(b,d){var m=null,p=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var v=0;v<p.length;v++){for(var n=this.getActualStartSize(p[v],!0),y=this.model.getChildCells(p[v],!0),C=this.getCellStyle(p[v],!0),P=null,G=[],O=0;O<y.length;O++){var U=this.getCellGeometry(y[O]);if(null==U)G.push(null);else{var c={cell:y[O],rospan:1,colspan:1,row:v,col:O,geo:U};U=null!=U.alternateBounds?U.alternateBounds:U;c.point=new mxPoint(U.width+(null!=P?P.point.x:b.x+-n.x),U.height+(null!=m&&null!=m[0]?m[0].point.y:b.y+n.y));c.actual=c;null!=m&&null!=m[O]&&1<m[O].rowspan?(c.rowspan=m[O].rowspan-1,c.colspan=m[O].colspan,c.actual=m[O].actual):null!=P&&1<P.colspan?(c.rowspan=P.rowspan,c.colspan=P.colspan-1,c.actual=P.actual):(P=this.getCurrentCellStyle(y[O],!0),null!=P&&(c.rowspan=parseInt(P.rowspan||1),c.colspan=parseInt(P.colspan||1)));P=1==mxUtils.getValue(C,mxConstants.STYLE_SWIMLANE_HEAD,1)&&mxUtils.getValue(C,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=-mxConstants.NONE;d(c,y.length,p.length,b.x+(P?n.x:0),b.y+(P?n.y:0));G.push(c);P=c}}m=G}};Graph.prototype.getTableLines=function(b,d,m){var p=[],v=[];(d||m)&&this.visitTableCells(b,mxUtils.bind(this,function(n,y,C,P,G){d&&n.row<C-1&&(null==p[n.row]&&(p[n.row]=[new mxPoint(P,n.point.y)]),1<n.rowspan&&p[n.row].push(null),p[n.row].push(n.point));m&&n.col<y-1&&(null==v[n.col]&&(v[n.col]=[new mxPoint(n.point.x,G)]),1<n.colspan&&v[n.col].push(null),v[n.col].push(n.point))}));return p.concat(v)};-Graph.prototype.paintTableCellLines=function(b,d,m,p,v,n,y,C){if(null!=y&&y!=mxConstants.NONE){var P=this.model,G=!1,O=!1;if(this.isTableRow(d)){var U=P.getChildCells(P.getParent(d),!0);var c=mxUtils.indexOf(U,d);d=(P="0"!=mxUtils.getValue(this.getCurrentCellStyle(P.getParent(d)),"rowLines","1"))&&0<c;U=P&&c<U.length-1}else if(this.isTableCell(d)){G=P.getParent(d);c=P.getParent(G);U=P.getChildCells(c,!0);O=P.getChildCells(G,!0);c=this.getCurrentCellStyle(c);P="0"!=mxUtils.getValue(c,"rowLines","1");-c="0"!=mxUtils.getValue(c,"columnLines","1");G=mxUtils.indexOf(U,G);var f=mxUtils.indexOf(O,d);d=P&&0<G;U=P&&G<U.length-1;G=c&&0<f;O=c&&f<O.length-1}else return;if(d||U||G||O)b.setStrokeColor(y),b.setStrokeWidth(C),b.setDashed(!1),b.setShadow(!1),d&&(b.begin(),b.moveTo(m,p),b.lineTo(m+v,p),b.stroke()),U&&(b.begin(),b.moveTo(m,p+n),b.lineTo(m+v,p+n),b.stroke()),G&&(b.begin(),b.moveTo(m,p),b.lineTo(m,p+n),b.stroke()),O&&(b.begin(),b.moveTo(m+v,p),b.lineTo(m+v,p+n),b.stroke())}};+Graph.prototype.removeTextStyleForCell=function(b,d){var m=this.getCurrentCellStyle(b),p=!1;this.getModel().beginUpdate();try{if("1"==mxUtils.getValue(m,"html","0")){var u=this.convertValueToString(b);"0"!=mxUtils.getValue(m,"nl2Br","1")&&(u=u.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));u=Editor.convertHtmlToText(u);this.cellLabelChanged(b,u);p=!0}d&&(this.setCellStyles("fontSource",null,[b]),this.setCellStyles(mxConstants.STYLE_FONTFAMILY,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSIZE,+null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSTYLE,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BORDERCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null,[b]))}finally{this.getModel().endUpdate()}return p};Graph.prototype.createParent=function(b,d,m,p,u){b=this.cloneCell(b);for(var n=0;n<m;n++){var y=this.cloneCell(d),B=this.getCellGeometry(y);null!=B&&(B.x+=n*p,B.y+=n*u);b.insert(y)}return b};+Graph.prototype.createTable=function(b,d,m,p,u,n,y,B,P){m=null!=m?m:60;p=null!=p?p:40;n=null!=n?n:30;B=null!=B?B:"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fixedHeader=1;";P=null!=P?P:"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;";+return this.createParent(this.createVertex(null,null,null!=u?u:"",0,0,d*m,b*p+(null!=u?n:0),null!=y?y:"shape=table;startSize="+(null!=u?n:"0")+";container=1;collapsible=0;childLayout=tableLayout;fixedHeader=1;"),this.createParent(this.createVertex(null,null,"",0,0,d*m,p,B),this.createVertex(null,null,"",0,0,m,p,P),d,m,0),b,0,p)};+Graph.prototype.setTableValues=function(b,d,m){for(var p=this.model.getChildCells(b,!0),u=0;u<p.length;u++)if(null!=m&&(p[u].value=m[u]),null!=d)for(var n=this.model.getChildCells(p[u],!0),y=0;y<n.length;y++)null!=d[u][y]&&(n[y].value=d[u][y]);return b};+Graph.prototype.createCrossFunctionalSwimlane=function(b,d,m,p,u,n,y,B,P){m=null!=m?m:120;p=null!=p?p:120;y=null!=y?y:"shape=tableRow;horizontal=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;strokeColor=inherit;bottom=0;right=0;dropTarget=0;fontStyle=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;startSize=40;fixedHeader=1;collapsible=0;recursiveResize=0;expand=0;";B=null!=B?B:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;strokeColor=inherit;connectable=0;fillColor=none;startSize=40;collapsible=0;recursiveResize=0;expand=0;";+P=null!=P?P:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;strokeColor=inherit;fillColor=none;startSize=0;collapsible=0;recursiveResize=0;expand=0;";u=this.createVertex(null,null,null!=u?u:"",0,0,d*m,b*p,null!=n?n:"shape=table;childLayout=tableLayout;fixedHeader=1;"+(null==u?"startSize=0;fillColor=none;":"startSize=40;")+"collapsible=0;recursiveResize=0;expand=0;");n=mxUtils.getValue(this.getCellStyle(u),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);u.geometry.width+=+n;u.geometry.height+=n;y=this.createVertex(null,null,"",0,n,d*m+n,p,y);u.insert(this.createParent(y,this.createVertex(null,null,"",n,0,m,p,B),d,m,0));return 1<b?(y.geometry.y=p+n,this.createParent(u,this.createParent(y,this.createVertex(null,null,"",n,0,m,p,P),d,m,0),b-1,0,p)):u};+Graph.prototype.visitTableCells=function(b,d){var m=null,p=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var u=0;u<p.length;u++){for(var n=this.getActualStartSize(p[u],!0),y=this.model.getChildCells(p[u],!0),B=this.getCellStyle(p[u],!0),P=null,G=[],O=0;O<y.length;O++){var U=this.getCellGeometry(y[O]);if(null==U)G.push(null);else{var c={cell:y[O],rospan:1,colspan:1,row:u,col:O,geo:U};U=null!=U.alternateBounds?U.alternateBounds:U;c.point=new mxPoint(U.width+(null!=P?P.point.x:b.x++n.x),U.height+(null!=m&&null!=m[0]?m[0].point.y:b.y+n.y));c.actual=c;null!=m&&null!=m[O]&&1<m[O].rowspan?(c.rowspan=m[O].rowspan-1,c.colspan=m[O].colspan,c.actual=m[O].actual):null!=P&&1<P.colspan?(c.rowspan=P.rowspan,c.colspan=P.colspan-1,c.actual=P.actual):(P=this.getCurrentCellStyle(y[O],!0),null!=P&&(c.rowspan=parseInt(P.rowspan||1),c.colspan=parseInt(P.colspan||1)));P=1==mxUtils.getValue(B,mxConstants.STYLE_SWIMLANE_HEAD,1)&&mxUtils.getValue(B,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=+mxConstants.NONE;d(c,y.length,p.length,b.x+(P?n.x:0),b.y+(P?n.y:0));G.push(c);P=c}}m=G}};Graph.prototype.getTableLines=function(b,d,m){var p=[],u=[];(d||m)&&this.visitTableCells(b,mxUtils.bind(this,function(n,y,B,P,G){d&&n.row<B-1&&(null==p[n.row]&&(p[n.row]=[new mxPoint(P,n.point.y)]),1<n.rowspan&&p[n.row].push(null),p[n.row].push(n.point));m&&n.col<y-1&&(null==u[n.col]&&(u[n.col]=[new mxPoint(n.point.x,G)]),1<n.colspan&&u[n.col].push(null),u[n.col].push(n.point))}));return p.concat(u)};+Graph.prototype.paintTableCellLines=function(b,d,m,p,u,n,y,B){if(null!=y&&y!=mxConstants.NONE){var P=this.model,G=!1,O=!1;if(this.isTableRow(d)){var U=P.getChildCells(P.getParent(d),!0);var c=mxUtils.indexOf(U,d);d=(P="0"!=mxUtils.getValue(this.getCurrentCellStyle(P.getParent(d)),"rowLines","1"))&&0<c;U=P&&c<U.length-1}else if(this.isTableCell(d)){G=P.getParent(d);c=P.getParent(G);U=P.getChildCells(c,!0);O=P.getChildCells(G,!0);c=this.getCurrentCellStyle(c);P="0"!=mxUtils.getValue(c,"rowLines","1");+c="0"!=mxUtils.getValue(c,"columnLines","1");G=mxUtils.indexOf(U,G);var f=mxUtils.indexOf(O,d);d=P&&0<G;U=P&&G<U.length-1;G=c&&0<f;O=c&&f<O.length-1}else return;if(d||U||G||O)b.setStrokeColor(y),b.setStrokeWidth(B),b.setDashed(!1),b.setShadow(!1),d&&(b.begin(),b.moveTo(m,p),b.lineTo(m+u,p),b.stroke()),U&&(b.begin(),b.moveTo(m,p+n),b.lineTo(m+u,p+n),b.stroke()),G&&(b.begin(),b.moveTo(m,p),b.lineTo(m,p+n),b.stroke()),O&&(b.begin(),b.moveTo(m+u,p),b.lineTo(m+u,p+n),b.stroke())}};Graph.prototype.isTableCell=function(b){return this.model.isVertex(b)&&this.isTableRow(this.model.getParent(b))};Graph.prototype.isTableRow=function(b){return this.model.isVertex(b)&&this.isTable(this.model.getParent(b))};Graph.prototype.isTable=function(b){b=this.getCellStyle(b);return null!=b&&"tableLayout"==b.childLayout};Graph.prototype.isStack=function(b){b=this.getCellStyle(b);return null!=b&&"stackLayout"==b.childLayout};Graph.prototype.isStackChild=function(b){return this.model.isVertex(b)&&this.isStack(this.model.getParent(b))};-Graph.prototype.setTableRowHeight=function(b,d,m){m=null!=m?m:!0;var p=this.getModel();p.beginUpdate();try{var v=this.getCellGeometry(b);if(null!=v){v=v.clone();v.height+=d;p.setGeometry(b,v);var n=p.getParent(b),y=p.getChildCells(n,!0);if(!m){var C=mxUtils.indexOf(y,b);if(C<y.length-1){var P=y[C+1],G=this.getCellGeometry(P);null!=G&&(G=G.clone(),G.y+=d,G.height-=d,p.setGeometry(P,G))}}var O=this.getCellGeometry(n);null!=O&&(m||(m=b==y[y.length-1]),m&&(O=O.clone(),O.height+=d,p.setGeometry(n,O)))}}finally{p.endUpdate()}};-Graph.prototype.setTableColumnWidth=function(b,d,m){m=null!=m?m:!1;var p=this.getModel(),v=p.getParent(b),n=p.getParent(v),y=p.getChildCells(v,!0);b=mxUtils.indexOf(y,b);var C=b==y.length-1;p.beginUpdate();try{for(var P=p.getChildCells(n,!0),G=0;G<P.length;G++){v=P[G];y=p.getChildCells(v,!0);var O=y[b],U=this.getCellGeometry(O);null!=U&&(U=U.clone(),U.width+=d,null!=U.alternateBounds&&(U.alternateBounds.width+=d),p.setGeometry(O,U));b<y.length-1&&(O=y[b+1],U=this.getCellGeometry(O),null!=U&&(U=U.clone(),-U.x+=d,m||(U.width-=d,null!=U.alternateBounds&&(U.alternateBounds.width-=d)),p.setGeometry(O,U)))}if(C||m){var c=this.getCellGeometry(n);null!=c&&(c=c.clone(),c.width+=d,p.setGeometry(n,c))}null!=this.layoutManager&&this.layoutManager.executeLayout(n)}finally{p.endUpdate()}};-Graph.prototype.resizeAllTableRows=function(b,d){var m=this.getModel(),p=m.getChildCells(b,!0);if(0!=p.length){m.beginUpdate();try{for(var v=0;v<p.length;v++){var n=this.getCellGeometry(p[v]);null!=n&&(n=n.clone(),n.y+=d*v,n.height=Math.max(Graph.minTableRowHeight,n.height+d),m.setGeometry(p[v],n))}var y=this.getCellGeometry(b);null!=y&&(y=y.clone(),y.height+=d*p.length,m.setGeometry(b,y));null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{m.endUpdate()}}};-Graph.prototype.resizeAllTableColumns=function(b,d){var m=this.getModel(),p=m.getChildCells(b,!0);if(0!=p.length){m.beginUpdate();try{for(var v=0;v<p.length;v++)for(var n=m.getChildCells(p[v],!0),y=0;y<n.length;y++){var C=this.getCellGeometry(n[y]);null!=C&&(C=C.clone(),C.x+=d*y,C.width=Math.max(Graph.minTableColumnWidth,C.width+d),null!=C.alternateBounds&&(C.alternateBounds.width=Math.max(Graph.minTableColumnWidth,C.alternateBounds.width+d)),m.setGeometry(n[y],C))}var P=this.getCellGeometry(b);if(null!=+Graph.prototype.setTableRowHeight=function(b,d,m){m=null!=m?m:!0;var p=this.getModel();p.beginUpdate();try{var u=this.getCellGeometry(b);if(null!=u){u=u.clone();u.height+=d;p.setGeometry(b,u);var n=p.getParent(b),y=p.getChildCells(n,!0);if(!m){var B=mxUtils.indexOf(y,b);if(B<y.length-1){var P=y[B+1],G=this.getCellGeometry(P);null!=G&&(G=G.clone(),G.y+=d,G.height-=d,p.setGeometry(P,G))}}var O=this.getCellGeometry(n);null!=O&&(m||(m=b==y[y.length-1]),m&&(O=O.clone(),O.height+=d,p.setGeometry(n,O)))}}finally{p.endUpdate()}};+Graph.prototype.setTableColumnWidth=function(b,d,m){m=null!=m?m:!1;var p=this.getModel(),u=p.getParent(b),n=p.getParent(u),y=p.getChildCells(u,!0);b=mxUtils.indexOf(y,b);var B=b==y.length-1;p.beginUpdate();try{for(var P=p.getChildCells(n,!0),G=0;G<P.length;G++){u=P[G];y=p.getChildCells(u,!0);var O=y[b],U=this.getCellGeometry(O);null!=U&&(U=U.clone(),U.width+=d,null!=U.alternateBounds&&(U.alternateBounds.width+=d),p.setGeometry(O,U));b<y.length-1&&(O=y[b+1],U=this.getCellGeometry(O),null!=U&&(U=U.clone(),+U.x+=d,m||(U.width-=d,null!=U.alternateBounds&&(U.alternateBounds.width-=d)),p.setGeometry(O,U)))}if(B||m){var c=this.getCellGeometry(n);null!=c&&(c=c.clone(),c.width+=d,p.setGeometry(n,c))}null!=this.layoutManager&&this.layoutManager.executeLayout(n)}finally{p.endUpdate()}};+Graph.prototype.resizeAllTableRows=function(b,d){var m=this.getModel(),p=m.getChildCells(b,!0);if(0!=p.length){m.beginUpdate();try{for(var u=0;u<p.length;u++){var n=this.getCellGeometry(p[u]);null!=n&&(n=n.clone(),n.y+=d*u,n.height=Math.max(Graph.minTableRowHeight,n.height+d),m.setGeometry(p[u],n))}var y=this.getCellGeometry(b);null!=y&&(y=y.clone(),y.height+=d*p.length,m.setGeometry(b,y));null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{m.endUpdate()}}};+Graph.prototype.resizeAllTableColumns=function(b,d){var m=this.getModel(),p=m.getChildCells(b,!0);if(0!=p.length){m.beginUpdate();try{for(var u=0;u<p.length;u++)for(var n=m.getChildCells(p[u],!0),y=0;y<n.length;y++){var B=this.getCellGeometry(n[y]);null!=B&&(B=B.clone(),B.x+=d*y,B.width=Math.max(Graph.minTableColumnWidth,B.width+d),null!=B.alternateBounds&&(B.alternateBounds.width=Math.max(Graph.minTableColumnWidth,B.alternateBounds.width+d)),m.setGeometry(n[y],B))}var P=this.getCellGeometry(b);if(null!=P){var G=m.getChildCells(p[0],!0).length;P=P.clone();P.width+=d*G;m.setGeometry(b,P)}null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{m.endUpdate()}}};-Graph.prototype.distributeRows=function(b){var d=this.getModel(),m=d.getChildCells(b,!0);if(!(2>m.length)){d.beginUpdate();try{for(var p=0,v=0;v<m.length;v++){var n=this.getCellGeometry(m[v]);null!=n&&(p+=n.height)}var y=p/m.length;for(v=p=0;v<m.length;v++)n=this.getCellGeometry(m[v]),null!=n&&(n=n.clone(),0==v&&(p=n.y),n.y=p,n.height=y,d.setGeometry(m[v],n),p+=y);null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{d.endUpdate()}}};-Graph.prototype.distributeColumns=function(b){var d=this.getModel(),m=d.getChildCells(b,!0);if(0!=m.length){var p=d.getChildCells(m[0],!0);if(!(2>p.length)){d.beginUpdate();try{for(var v=0,n=0;n<p.length;n++){var y=this.getCellGeometry(p[n]);null!=y&&(v+=(null!=y.alternateBounds?y.alternateBounds:y).width)}var C=v/p.length;for(n=0;n<m.length;n++){var P=d.getChildCells(m[n],!0);for(v=p=0;v<P.length;v++)y=this.getCellGeometry(P[v]),null!=y&&(y=y.clone(),0==v&&(p=y.x),y.x=p,y.width=C,null!=y.alternateBounds&&-(y.alternateBounds.width=C),d.setGeometry(P[v],y),p+=C)}null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{d.endUpdate()}}}};function TableLayout(b){mxGraphLayout.call(this,b)}TableLayout.prototype=new mxStackLayout;TableLayout.prototype.constructor=TableLayout;TableLayout.prototype.isHorizontal=function(){return!1};TableLayout.prototype.isVertexIgnored=function(b){return!this.graph.getModel().isVertex(b)||!this.graph.isCellVisible(b)};-TableLayout.prototype.getSize=function(b,d){for(var m=0,p=0;p<b.length;p++)if(!this.isVertexIgnored(b[p])){var v=this.graph.getCellGeometry(b[p]);null!=v&&(m+=d?v.width:v.height)}return m};-TableLayout.prototype.getRowLayout=function(b,d){var m=this.graph.model.getChildCells(b,!0),p=this.graph.getActualStartSize(b,!0);b=this.getSize(m,!0);d=d-p.x-p.width;var v=[];p=p.x;for(var n=0;n<m.length;n++){var y=this.graph.getCellGeometry(m[n]);null!=y&&(p+=(null!=y.alternateBounds?y.alternateBounds.width:y.width)*d/b,v.push(Math.round(p)))}return v};-TableLayout.prototype.layoutRow=function(b,d,m,p){var v=this.graph.getModel(),n=v.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var y=b.x,C=0;null!=d&&(d=d.slice(),d.splice(0,0,b.x));for(var P=0;P<n.length;P++){var G=this.graph.getCellGeometry(n[P]);null!=G&&(G=G.clone(),G.y=b.y,G.height=m-b.y-b.height,null!=d?(G.x=d[P],G.width=d[P+1]-G.x,P==n.length-1&&P<d.length-2&&(G.width=p-G.x-b.x-b.width)):(G.x=y,y+=G.width,P==n.length-1?G.width=p-b.x-b.width-C:C+=G.width),G.alternateBounds=new mxRectangle(0,-0,G.width,G.height),v.setGeometry(n[P],G))}return C};-TableLayout.prototype.execute=function(b){var d=null!=b?this.graph.getCellGeometry(b):null;if(null!=d){var m=this.graph.getActualStartSize(b,!0),p=this.graph.getCellStyle(b),v="1"==mxUtils.getValue(p,"resizeLastRow","0"),n="1"==mxUtils.getValue(p,"resizeLast","0");p="1"==mxUtils.getValue(p,"fixedRows","0");var y=this.graph.getModel(),C=0;y.beginUpdate();try{for(var P=d.height-m.y-m.height,G=d.width-m.x-m.width,O=y.getChildCells(b,!0),U=0;U<O.length;U++)y.setVisible(O[U],!0);var c=this.getSize(O,!1);-if(0<P&&0<G&&0<O.length&&0<c){if(v){var f=this.graph.getCellGeometry(O[O.length-1]);null!=f&&(f=f.clone(),f.height=P-c+f.height,y.setGeometry(O[O.length-1],f))}var k=n?null:this.getRowLayout(O[0],G),q=[],x=m.y;for(U=0;U<O.length;U++)f=this.graph.getCellGeometry(O[U]),null!=f&&(f=f.clone(),f.x=m.x,f.width=G,f.y=Math.round(x),x=v||p?x+f.height:x+f.height/c*P,f.height=Math.round(x)-f.y,y.setGeometry(O[U],f),C=Math.max(C,this.layoutRow(O[U],k,f.height,G,q)));p&&P<c&&(d=d.clone(),d.height=x+m.height,y.setGeometry(b,-d));n&&G<C+Graph.minTableColumnWidth&&(d=d.clone(),d.width=C+m.width+m.x+Graph.minTableColumnWidth,y.setGeometry(b,d));this.graph.visitTableCells(b,mxUtils.bind(this,function(B){y.setVisible(B.cell,B.actual.cell==B.cell);if(B.actual.cell!=B.cell){if(B.actual.row==B.row){var E=null!=B.geo.alternateBounds?B.geo.alternateBounds:B.geo;B.actual.geo.width+=E.width}B.actual.col==B.col&&(E=null!=B.geo.alternateBounds?B.geo.alternateBounds:B.geo,B.actual.geo.height+=E.height)}}))}else for(U=0;U<O.length;U++)y.setVisible(O[U],+Graph.prototype.distributeRows=function(b){var d=this.getModel(),m=d.getChildCells(b,!0);if(!(2>m.length)){d.beginUpdate();try{for(var p=0,u=0;u<m.length;u++){var n=this.getCellGeometry(m[u]);null!=n&&(p+=n.height)}var y=p/m.length;for(u=p=0;u<m.length;u++)n=this.getCellGeometry(m[u]),null!=n&&(n=n.clone(),0==u&&(p=n.y),n.y=p,n.height=y,d.setGeometry(m[u],n),p+=y);null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{d.endUpdate()}}};+Graph.prototype.distributeColumns=function(b){var d=this.getModel(),m=d.getChildCells(b,!0);if(0!=m.length){var p=d.getChildCells(m[0],!0);if(!(2>p.length)){d.beginUpdate();try{for(var u=0,n=0;n<p.length;n++){var y=this.getCellGeometry(p[n]);null!=y&&(u+=(null!=y.alternateBounds?y.alternateBounds:y).width)}var B=u/p.length;for(n=0;n<m.length;n++){var P=d.getChildCells(m[n],!0);for(u=p=0;u<P.length;u++)y=this.getCellGeometry(P[u]),null!=y&&(y=y.clone(),0==u&&(p=y.x),y.x=p,y.width=B,null!=y.alternateBounds&&+(y.alternateBounds.width=B),d.setGeometry(P[u],y),p+=B)}null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{d.endUpdate()}}}};function TableLayout(b){mxGraphLayout.call(this,b)}TableLayout.prototype=new mxStackLayout;TableLayout.prototype.constructor=TableLayout;TableLayout.prototype.isHorizontal=function(){return!1};TableLayout.prototype.isVertexIgnored=function(b){return!this.graph.getModel().isVertex(b)||!this.graph.isCellVisible(b)};+TableLayout.prototype.getSize=function(b,d){for(var m=0,p=0;p<b.length;p++)if(!this.isVertexIgnored(b[p])){var u=this.graph.getCellGeometry(b[p]);null!=u&&(m+=d?u.width:u.height)}return m};+TableLayout.prototype.getRowLayout=function(b,d){var m=this.graph.model.getChildCells(b,!0),p=this.graph.getActualStartSize(b,!0);b=this.getSize(m,!0);d=d-p.x-p.width;var u=[];p=p.x;for(var n=0;n<m.length;n++){var y=this.graph.getCellGeometry(m[n]);null!=y&&(p+=(null!=y.alternateBounds?y.alternateBounds.width:y.width)*d/b,u.push(Math.round(p)))}return u};+TableLayout.prototype.layoutRow=function(b,d,m,p){var u=this.graph.getModel(),n=u.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var y=b.x,B=0;null!=d&&(d=d.slice(),d.splice(0,0,b.x));for(var P=0;P<n.length;P++){var G=this.graph.getCellGeometry(n[P]);null!=G&&(G=G.clone(),G.y=b.y,G.height=m-b.y-b.height,null!=d?(G.x=d[P],G.width=d[P+1]-G.x,P==n.length-1&&P<d.length-2&&(G.width=p-G.x-b.x-b.width)):(G.x=y,y+=G.width,P==n.length-1?G.width=p-b.x-b.width-B:B+=G.width),G.alternateBounds=new mxRectangle(0,+0,G.width,G.height),u.setGeometry(n[P],G))}return B};+TableLayout.prototype.execute=function(b){var d=null!=b?this.graph.getCellGeometry(b):null;if(null!=d){var m=this.graph.getActualStartSize(b,!0),p=this.graph.getCellStyle(b),u="1"==mxUtils.getValue(p,"resizeLastRow","0"),n="1"==mxUtils.getValue(p,"resizeLast","0");p="1"==mxUtils.getValue(p,"fixedRows","0");var y=this.graph.getModel(),B=0;y.beginUpdate();try{for(var P=d.height-m.y-m.height,G=d.width-m.x-m.width,O=y.getChildCells(b,!0),U=0;U<O.length;U++)y.setVisible(O[U],!0);var c=this.getSize(O,!1);+if(0<P&&0<G&&0<O.length&&0<c){if(u){var f=this.graph.getCellGeometry(O[O.length-1]);null!=f&&(f=f.clone(),f.height=P-c+f.height,y.setGeometry(O[O.length-1],f))}var k=n?null:this.getRowLayout(O[0],G),q=[],x=m.y;for(U=0;U<O.length;U++)f=this.graph.getCellGeometry(O[U]),null!=f&&(f=f.clone(),f.x=m.x,f.width=G,f.y=Math.round(x),x=u||p?x+f.height:x+f.height/c*P,f.height=Math.round(x)-f.y,y.setGeometry(O[U],f),B=Math.max(B,this.layoutRow(O[U],k,f.height,G,q)));p&&P<c&&(d=d.clone(),d.height=x+m.height,y.setGeometry(b,+d));n&&G<B+Graph.minTableColumnWidth&&(d=d.clone(),d.width=B+m.width+m.x+Graph.minTableColumnWidth,y.setGeometry(b,d));this.graph.visitTableCells(b,mxUtils.bind(this,function(C){y.setVisible(C.cell,C.actual.cell==C.cell);if(C.actual.cell!=C.cell){if(C.actual.row==C.row){var E=null!=C.geo.alternateBounds?C.geo.alternateBounds:C.geo;C.actual.geo.width+=E.width}C.actual.col==C.col&&(E=null!=C.geo.alternateBounds?C.geo.alternateBounds:C.geo,C.actual.geo.height+=E.height)}}))}else for(U=0;U<O.length;U++)y.setVisible(O[U],!1)}finally{y.endUpdate()}}};(function(){var b=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){b.apply(this,arguments);this.validEdges=[]};var d=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(c,f){f=null!=f?f:!0;var k=this.getState(c);null!=k&&f&&this.graph.model.isEdge(k.cell)&&null!=k.style&&1!=k.style[mxConstants.STYLE_CURVED]&&!k.invalid&&this.updateLineJumps(k)&&this.graph.cellRenderer.redraw(k,!1,this.isRendering());if(null!=k&&k.invalid){if(this.graph.showLinkIcons){k=this.graph.getLinkForCell(c);var q=null!=k&&0<k.length,x=!1;if(null!=c.overlays)for(k=0;k<c.overlays.length;k++)if(c.overlays[k].isLinkOverlay){x=!0;break}if(q&&!x)k=this.graph.createLinkOverlay(c),null!=k&&(null==c.overlays&&(c.overlays=[]),c.overlays.push(k));else if(!q&&x){for(k=c.overlays.length-1;0<=k;k--)c.overlays[k].isLinkOverlay&&c.overlays.splice(k,1);0==c.overlays.length&&(c.overlays=null)}}else if(null!=c.overlays){for(k=c.overlays.length-1;0<=k;k--)c.overlays[k].isLinkOverlay&&c.overlays.splice(k,1);0==c.overlays.length&&(c.overlays=null)}if(this.graph.showTooltipIcons){k=this.graph.convertValueToTooltip(c);q=null!=k&&0<k.length;x=!1;if(null!=c.overlays)for(k=0;k<c.overlays.length;k++)if(c.overlays[k].isTooltipOverlay){x=!0;break}if(q&&!x)k=this.graph.createTooltipOverlay(c),null!=k&&(null==c.overlays&&(c.overlays=[]),c.overlays.push(k));else if(!q&&x){for(k=c.overlays.length-1;0<=k;k--)c.overlays[k].isTooltipOverlay&&c.overlays.splice(k,1);0==c.overlays.length&&(c.overlays=null)}}else if(null!=c.overlays){for(k=c.overlays.length-1;0<=k;k--)c.overlays[k].isTooltipOverlay&&c.overlays.splice(k,1);0==c.overlays.length&&(c.overlays=null)}}k=d.apply(this,arguments);null!=k&&f&&this.graph.model.isEdge(k.cell)&&null!=k.style&&1!=k.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(k);return k};mxShape.prototype.isFlowAnimationEnabled=function(){return null!=this.state&&this.state.view.graph.enableFlowAnimation&&this.state.view.graph.model.isEdge(this.state.cell)&&"1"==mxUtils.getValue(this.state.style,-"flowAnimation","0")};mxShape.prototype.getFlowAnimationPath=function(c){var f=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=f)for(var k=null,q=!1,x=0;x<f.length;x++){var B=f[x];if("hidden"==B.getAttribute("visibility"))q||(k=B.getAttribute("d"));else if("none"==B.getAttribute("stroke"))q||k!=B.getAttribute("d")||(k=null);else if(null==B.getAttribute("data-rough-fill")&&(null==k||k==B.getAttribute("d"))){if(null==c||0==--c)return B;k=B.getAttribute("d");q=!0}}return null};mxShape.prototype.addFlowAnimationToShape=+"flowAnimation","0")};mxShape.prototype.getFlowAnimationPath=function(c){var f=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=f)for(var k=null,q=!1,x=0;x<f.length;x++){var C=f[x];if("hidden"==C.getAttribute("visibility"))q||(k=C.getAttribute("d"));else if("none"==C.getAttribute("stroke"))q||k!=C.getAttribute("d")||(k=null);else if(null==C.getAttribute("data-rough-fill")&&(null==k||k==C.getAttribute("d"))){if(null==c||0==--c)return C;k=C.getAttribute("d");q=!0}}return null};mxShape.prototype.addFlowAnimationToShape=function(){null!=this.state&&this.state.view.graph.addFlowAnimationToNode(this.getFlowAnimationPath(),this.state.style,this.state.view.scale,this.state.view.graph.addFlowAnimationStyle())};var m=mxShape.prototype.paint;mxShape.prototype.paint=function(c){m.apply(this,arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var p=mxShape.prototype.createSvgCanvas;mxShape.prototype.createSvgCanvas=function(c){c=p.apply(this,arguments);null!=this.state&&(c.adaptiveColors=this.state.view.graph.getAdaptiveColors());-return c};var v=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(c,f){return v.apply(this,arguments)||null!=c.routedPoints&&null!=f.routedPoints&&!mxUtils.equalPoints(f.routedPoints,c.routedPoints)};var n=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(c){n.apply(this,arguments);if(this.graph.model.isVertex(c.cell)&&this.graph.isTransparentBounds(c.cell)){var f=this.graph.getTransparentBounds(c.cell);null!=f?(c.x=this.scale*+return c};var u=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(c,f){return u.apply(this,arguments)||null!=c.routedPoints&&null!=f.routedPoints&&!mxUtils.equalPoints(f.routedPoints,c.routedPoints)};var n=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(c){n.apply(this,arguments);if(this.graph.model.isVertex(c.cell)&&this.graph.isTransparentBounds(c.cell)){var f=this.graph.getTransparentBounds(c.cell);null!=f?(c.x=this.scale*(this.translate.x+c.origin.x+f.x),c.y=this.scale*(this.translate.y+c.origin.y+f.y),c.width=this.scale*f.width,c.height=this.scale*f.height,c.unscaledWidth=f.width,c.unscaledHeight=f.height):(c.width=0,c.height=0,c.unscaledWidth=0,c.unscaledHeight=0)}this.graph.model.isEdge(c.cell)&&1!=c.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(c)};var y=mxMorphing.prototype.getDelta;mxMorphing.prototype.getDelta=function(c){return null!=c&&null!=c.cell&&null!=this.graph.isTransparentBounds&&this.graph.isTransparentBounds(c.cell)?-new mxPoint(0,0):y.apply(this,arguments)};mxGraphView.prototype.updateLineJumps=function(c){var f=c.absolutePoints;if(Graph.lineJumpsEnabled){var k=null!=c.routedPoints,q=null;if(null!=f&&null!=this.validEdges&&"none"!==mxUtils.getValue(c.style,"jumpStyle","none")){var x=function(l,t,H){var J=new mxPoint(t,H);J.type=l;q.push(J);J=null!=c.routedPoints?c.routedPoints[q.length-1]:null;return null==J||J.type!=l||J.x!=t||J.y!=H},B=.5*this.scale;k=!1;q=[];for(var E=0;E<f.length-1;E++){for(var L=f[E+1],+new mxPoint(0,0):y.apply(this,arguments)};mxGraphView.prototype.updateLineJumps=function(c){var f=c.absolutePoints;if(Graph.lineJumpsEnabled){var k=null!=c.routedPoints,q=null;if(null!=f&&null!=this.validEdges&&"none"!==mxUtils.getValue(c.style,"jumpStyle","none")){var x=function(l,t,H){var J=new mxPoint(t,H);J.type=l;q.push(J);J=null!=c.routedPoints?c.routedPoints[q.length-1]:null;return null==J||J.type!=l||J.x!=t||J.y!=H},C=.5*this.scale;k=!1;q=[];for(var E=0;E<f.length-1;E++){for(var L=f[E+1],Q=f[E],V=[],K=f[E+2];E<f.length-2&&mxUtils.ptSegDistSq(Q.x,Q.y,K.x,K.y,L.x,L.y)<1*this.scale*this.scale;)L=K,E++,K=f[E+2];k=x(0,Q.x,Q.y)||k;for(var fa=0;fa<this.validEdges.length;fa++){var aa=this.validEdges[fa],da=aa.absolutePoints;if(null!=da&&mxUtils.intersects(c,aa)&&"1"!=aa.style.noJump){var ba=null;for(aa=0;aa<da.length-1;aa++){var ha=da[aa+1],qa=da[aa];for(K=da[aa+2];aa<da.length-2&&mxUtils.ptSegDistSq(qa.x,qa.y,K.x,K.y,ha.x,ha.y)<1*this.scale*this.scale;)ha=K,aa++,K=da[aa+2];var ra=mxUtils.intersection(Q.x,-Q.y,L.x,L.y,qa.x,qa.y,ha.x,ha.y);if(null!=ra&&(Math.abs(ra.x-Q.x)>B||Math.abs(ra.y-Q.y)>B)&&(Math.abs(ra.x-L.x)>B||Math.abs(ra.y-L.y)>B)&&(null==ba||mxUtils.ptLineDist(Q.x,Q.y,L.x,L.y,ba.x,ba.y)>B||mxUtils.ptLineDist(Q.x,Q.y,L.x,L.y,qa.x,qa.y)>B)&&(null==K||mxUtils.ptLineDist(Q.x,Q.y,L.x,L.y,K.x,K.y)>B||mxUtils.ptLineDist(Q.x,Q.y,L.x,L.y,ha.x,ha.y)>B)){K=ra.x-Q.x;ba=ra.y-Q.y;ra={distSq:K*K+ba*ba,x:ra.x,y:ra.y};K=V.length;for(ba=0;ba<V.length;ba++)if(V[ba].distSq>ra.distSq){K=ba;break}(0==K||Math.abs(V[K--1].x-ra.x)>B||Math.abs(V[K-1].y-ra.y)>B)&&(K==V.length||Math.abs(V[K].x-ra.x)>B||Math.abs(V[K].y-ra.y)>B)&&V.splice(K,0,ra)}ba=qa}}}for(aa=0;aa<V.length;aa++)k=x(1,V[aa].x,V[aa].y)||k}ra=f[f.length-1];k=x(0,ra.x,ra.y)||k}c.routedPoints=q;return k}return!1};var C=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(c,f,k){this.routedPoints=null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)C.apply(this,-arguments);else{var q=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,x=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,B=mxUtils.getValue(this.style,"jumpStyle","none"),E=!0,L=null,Q=null,V=[],K=null;c.begin();for(var fa=0;fa<this.state.routedPoints.length;fa++){var aa=this.state.routedPoints[fa],da=new mxPoint(aa.x/this.scale,aa.y/this.scale);0==fa?da=f[0]:fa==this.state.routedPoints.length-1&&(da=f[f.length-1]);var ba=-!1;if(null!=L&&1==aa.type){var ha=this.state.routedPoints[fa+1];aa=ha.x/this.scale-da.x;ha=ha.y/this.scale-da.y;aa=aa*aa+ha*ha;null==K&&(K=new mxPoint(da.x-L.x,da.y-L.y),Q=Math.sqrt(K.x*K.x+K.y*K.y),0<Q?(K.x=K.x*x/Q,K.y=K.y*x/Q):K=null);aa>x*x&&0<Q&&(aa=L.x-da.x,ha=L.y-da.y,aa=aa*aa+ha*ha,aa>x*x&&(ba=new mxPoint(da.x-K.x,da.y-K.y),aa=new mxPoint(da.x+K.x,da.y+K.y),V.push(ba),this.addPoints(c,V,k,q,!1,null,E),V=0>Math.round(K.x)||0==Math.round(K.x)&&0>=Math.round(K.y)?1:-1,E=!1,"sharp"==B?(c.lineTo(ba.x--K.y*V,ba.y+K.x*V),c.lineTo(aa.x-K.y*V,aa.y+K.x*V),c.lineTo(aa.x,aa.y)):"line"==B?(c.moveTo(ba.x+K.y*V,ba.y-K.x*V),c.lineTo(ba.x-K.y*V,ba.y+K.x*V),c.moveTo(aa.x-K.y*V,aa.y+K.x*V),c.lineTo(aa.x+K.y*V,aa.y-K.x*V),c.moveTo(aa.x,aa.y)):"arc"==B?(V*=1.3,c.curveTo(ba.x-K.y*V,ba.y+K.x*V,aa.x-K.y*V,aa.y+K.x*V,aa.x,aa.y)):(c.moveTo(aa.x,aa.y),E=!0),V=[aa],ba=!0))}else K=null;ba||(V.push(da),L=da)}this.addPoints(c,V,k,q,!1,null,E);c.stroke()}};var P=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=-function(c,f,k,q){return null!=f&&"centerPerimeter"==f.style[mxConstants.STYLE_PERIMETER]?new mxPoint(f.getCenterX(),f.getCenterY()):P.apply(this,arguments)};var G=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(c,f,k,q){if(null==f||null==c||"1"!=f.style.snapToPoint&&"1"!=c.style.snapToPoint)G.apply(this,arguments);else{f=this.getTerminalPort(c,f,q);var x=this.getNextPoint(c,k,q),B=this.graph.isOrthogonal(c),E=mxUtils.toRadians(Number(f.style[mxConstants.STYLE_ROTATION]||-"0")),L=new mxPoint(f.getCenterX(),f.getCenterY());if(0!=E){var Q=Math.cos(-E),V=Math.sin(-E);x=mxUtils.getRotatedPoint(x,Q,V,L)}Q=parseFloat(c.style[mxConstants.STYLE_PERIMETER_SPACING]||0);Q+=parseFloat(c.style[q?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);x=this.getPerimeterPoint(f,x,0==E&&B,Q);0!=E&&(Q=Math.cos(E),V=Math.sin(E),x=mxUtils.getRotatedPoint(x,Q,V,L));c.setAbsoluteTerminalPoint(this.snapToAnchorPoint(c,f,k,q,x),q)}};mxGraphView.prototype.snapToAnchorPoint=-function(c,f,k,q,x){if(null!=f&&null!=c){c=this.graph.getAllConnectionConstraints(f);q=k=null;if(null!=c)for(var B=0;B<c.length;B++){var E=this.graph.getConnectionPoint(f,c[B]);if(null!=E){var L=(E.x-x.x)*(E.x-x.x)+(E.y-x.y)*(E.y-x.y);if(null==q||L<q)k=E,q=L}}null!=k&&(x=k)}return x};var O=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(c,f,k){var q=O.apply(this,arguments);"1"==c.getAttribute("placeholders")&&null!=k.state&&(q=k.state.view.graph.replacePlaceholders(k.state.cell,+Q.y,L.x,L.y,qa.x,qa.y,ha.x,ha.y);if(null!=ra&&(Math.abs(ra.x-Q.x)>C||Math.abs(ra.y-Q.y)>C)&&(Math.abs(ra.x-L.x)>C||Math.abs(ra.y-L.y)>C)&&(null==ba||mxUtils.ptLineDist(Q.x,Q.y,L.x,L.y,ba.x,ba.y)>C||mxUtils.ptLineDist(Q.x,Q.y,L.x,L.y,qa.x,qa.y)>C)&&(null==K||mxUtils.ptLineDist(Q.x,Q.y,L.x,L.y,K.x,K.y)>C||mxUtils.ptLineDist(Q.x,Q.y,L.x,L.y,ha.x,ha.y)>C)){K=ra.x-Q.x;ba=ra.y-Q.y;ra={distSq:K*K+ba*ba,x:ra.x,y:ra.y};K=V.length;for(ba=0;ba<V.length;ba++)if(V[ba].distSq>ra.distSq){K=ba;break}(0==K||Math.abs(V[K-+1].x-ra.x)>C||Math.abs(V[K-1].y-ra.y)>C)&&(K==V.length||Math.abs(V[K].x-ra.x)>C||Math.abs(V[K].y-ra.y)>C)&&V.splice(K,0,ra)}ba=qa}}}for(aa=0;aa<V.length;aa++)k=x(1,V[aa].x,V[aa].y)||k}ra=f[f.length-1];k=x(0,ra.x,ra.y)||k}c.routedPoints=q;return k}return!1};var B=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(c,f,k){this.routedPoints=null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)B.apply(this,+arguments);else{var q=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,x=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,C=mxUtils.getValue(this.style,"jumpStyle","none"),E=!0,L=null,Q=null,V=[],K=null;c.begin();for(var fa=0;fa<this.state.routedPoints.length;fa++){var aa=this.state.routedPoints[fa],da=new mxPoint(aa.x/this.scale,aa.y/this.scale);0==fa?da=f[0]:fa==this.state.routedPoints.length-1&&(da=f[f.length-1]);var ba=+!1;if(null!=L&&1==aa.type){var ha=this.state.routedPoints[fa+1];aa=ha.x/this.scale-da.x;ha=ha.y/this.scale-da.y;aa=aa*aa+ha*ha;null==K&&(K=new mxPoint(da.x-L.x,da.y-L.y),Q=Math.sqrt(K.x*K.x+K.y*K.y),0<Q?(K.x=K.x*x/Q,K.y=K.y*x/Q):K=null);aa>x*x&&0<Q&&(aa=L.x-da.x,ha=L.y-da.y,aa=aa*aa+ha*ha,aa>x*x&&(ba=new mxPoint(da.x-K.x,da.y-K.y),aa=new mxPoint(da.x+K.x,da.y+K.y),V.push(ba),this.addPoints(c,V,k,q,!1,null,E),V=0>Math.round(K.x)||0==Math.round(K.x)&&0>=Math.round(K.y)?1:-1,E=!1,"sharp"==C?(c.lineTo(ba.x-+K.y*V,ba.y+K.x*V),c.lineTo(aa.x-K.y*V,aa.y+K.x*V),c.lineTo(aa.x,aa.y)):"line"==C?(c.moveTo(ba.x+K.y*V,ba.y-K.x*V),c.lineTo(ba.x-K.y*V,ba.y+K.x*V),c.moveTo(aa.x-K.y*V,aa.y+K.x*V),c.lineTo(aa.x+K.y*V,aa.y-K.x*V),c.moveTo(aa.x,aa.y)):"arc"==C?(V*=1.3,c.curveTo(ba.x-K.y*V,ba.y+K.x*V,aa.x-K.y*V,aa.y+K.x*V,aa.x,aa.y)):(c.moveTo(aa.x,aa.y),E=!0),V=[aa],ba=!0))}else K=null;ba||(V.push(da),L=da)}this.addPoints(c,V,k,q,!1,null,E);c.stroke()}};var P=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=+function(c,f,k,q){return null!=f&&"centerPerimeter"==f.style[mxConstants.STYLE_PERIMETER]?new mxPoint(f.getCenterX(),f.getCenterY()):P.apply(this,arguments)};var G=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(c,f,k,q){if(null==f||null==c||"1"!=f.style.snapToPoint&&"1"!=c.style.snapToPoint)G.apply(this,arguments);else{f=this.getTerminalPort(c,f,q);var x=this.getNextPoint(c,k,q),C=this.graph.isOrthogonal(c),E=mxUtils.toRadians(Number(f.style[mxConstants.STYLE_ROTATION]||+"0")),L=new mxPoint(f.getCenterX(),f.getCenterY());if(0!=E){var Q=Math.cos(-E),V=Math.sin(-E);x=mxUtils.getRotatedPoint(x,Q,V,L)}Q=parseFloat(c.style[mxConstants.STYLE_PERIMETER_SPACING]||0);Q+=parseFloat(c.style[q?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);x=this.getPerimeterPoint(f,x,0==E&&C,Q);0!=E&&(Q=Math.cos(E),V=Math.sin(E),x=mxUtils.getRotatedPoint(x,Q,V,L));c.setAbsoluteTerminalPoint(this.snapToAnchorPoint(c,f,k,q,x),q)}};mxGraphView.prototype.snapToAnchorPoint=+function(c,f,k,q,x){if(null!=f&&null!=c){c=this.graph.getAllConnectionConstraints(f);q=k=null;if(null!=c)for(var C=0;C<c.length;C++){var E=this.graph.getConnectionPoint(f,c[C]);if(null!=E){var L=(E.x-x.x)*(E.x-x.x)+(E.y-x.y)*(E.y-x.y);if(null==q||L<q)k=E,q=L}}null!=k&&(x=k)}return x};var O=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(c,f,k){var q=O.apply(this,arguments);"1"==c.getAttribute("placeholders")&&null!=k.state&&(q=k.state.view.graph.replacePlaceholders(k.state.cell,q));return q};var U=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(c){if(null!=c.style&&"undefined"!==typeof pako){var f=mxUtils.getValue(c.style,mxConstants.STYLE_SHAPE,null);if(null!=f&&"string"===typeof f&&"stencil("==f.substring(0,8))try{var k=f.substring(8,f.length-1),q=mxUtils.parseXml(Graph.decompress(k));return new mxShape(new mxStencil(q.documentElement))}catch(x){null!=window.console&&console.log("Error in shape: "+x)}}return U.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];mxStencilRegistry.filesLoaded={};mxStencilRegistry.isFileLoaded=function(b){return!mxClient.IS_FF&&mxStencilRegistry.filesLoaded[b]};mxStencilRegistry.setFileLoaded=function(b){mxStencilRegistry.filesLoaded[b]=!0};-mxStencilRegistry.getStencil=function(b){var d=mxStencilRegistry.stencils[b];if(null==d&&null==mxCellRenderer.defaultShapes[b]&&mxStencilRegistry.dynamicLoading){var m=mxStencilRegistry.getBasenameForStencil(b);if(null!=m){d=mxStencilRegistry.libraries[m];if(null!=d){if(null==mxStencilRegistry.packages[m]){for(var p=0;p<d.length;p++){var v=d[p];if(!mxStencilRegistry.isFileLoaded(v))if(mxStencilRegistry.setFileLoaded(v),".xml"==v.toLowerCase().substring(v.length-4,v.length))mxStencilRegistry.loadStencilSet(v,-null);else if(".js"==v.toLowerCase().substring(v.length-3,v.length))try{if(mxStencilRegistry.allowEval){var n=mxUtils.load(v);null!=n&&200<=n.getStatus()&&299>=n.getStatus()&&eval.call(window,n.getText())}}catch(y){null!=window.console&&console.log("error in getStencil:",b,m,d,v,y)}}mxStencilRegistry.packages[m]=1}}else m=m.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+m+".xml",null);d=mxStencilRegistry.stencils[b]}}return d};+mxStencilRegistry.getStencil=function(b){var d=mxStencilRegistry.stencils[b];if(null==d&&null==mxCellRenderer.defaultShapes[b]&&mxStencilRegistry.dynamicLoading){var m=mxStencilRegistry.getBasenameForStencil(b);if(null!=m){d=mxStencilRegistry.libraries[m];if(null!=d){if(null==mxStencilRegistry.packages[m]){for(var p=0;p<d.length;p++){var u=d[p];if(!mxStencilRegistry.isFileLoaded(u))if(mxStencilRegistry.setFileLoaded(u),".xml"==u.toLowerCase().substring(u.length-4,u.length))mxStencilRegistry.loadStencilSet(u,+null);else if(".js"==u.toLowerCase().substring(u.length-3,u.length))try{if(mxStencilRegistry.allowEval){var n=mxUtils.load(u);null!=n&&200<=n.getStatus()&&299>=n.getStatus()&&eval.call(window,n.getText())}}catch(y){null!=window.console&&console.log("error in getStencil:",b,m,d,u,y)}}mxStencilRegistry.packages[m]=1}}else m=m.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+m+".xml",null);d=mxStencilRegistry.stencils[b]}}return d};mxStencilRegistry.getBasenameForStencil=function(b){var d=null;if(null!=b&&"string"===typeof b&&(b=b.split("."),0<b.length&&"mxgraph"==b[0])){d=b[1];for(var m=2;m<b.length-1;m++)d+="/"+b[m]}return d};-mxStencilRegistry.loadStencilSet=function(b,d,m,p){var v=mxStencilRegistry.packages[b];if(null!=m&&m||null==v){var n=!1;if(null==v)try{if(p){mxStencilRegistry.loadStencil(b,mxUtils.bind(this,function(y){null!=y&&null!=y.documentElement&&(mxStencilRegistry.packages[b]=y,n=!0,mxStencilRegistry.parseStencilSet(y.documentElement,d,n))}));return}v=mxStencilRegistry.loadStencil(b);mxStencilRegistry.packages[b]=v;n=!0}catch(y){null!=window.console&&console.log("error in loadStencilSet:",b,y)}null!=v&&null!=-v.documentElement&&mxStencilRegistry.parseStencilSet(v.documentElement,d,n)}};mxStencilRegistry.loadStencil=function(b,d){if(null!=d)mxUtils.get(b,mxUtils.bind(this,function(m){d(200<=m.getStatus()&&299>=m.getStatus()?m.getXml():null)}),mxUtils.bind(this,function(m){d(null)}));else return mxUtils.load(b).getXml()};mxStencilRegistry.parseStencilSets=function(b){for(var d=0;d<b.length;d++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(b[d]).documentElement)};-mxStencilRegistry.parseStencilSet=function(b,d,m){if("stencils"==b.nodeName)for(var p=b.firstChild;null!=p;)"shapes"==p.nodeName&&mxStencilRegistry.parseStencilSet(p,d,m),p=p.nextSibling;else{m=null!=m?m:!0;p=b.firstChild;var v="";b=b.getAttribute("name");for(null!=b&&(v=b+".");null!=p;){if(p.nodeType==mxConstants.NODETYPE_ELEMENT&&(b=p.getAttribute("name"),null!=b)){v=v.toLowerCase();var n=b.replace(/ /g,"_");m&&mxStencilRegistry.addStencil(v+n.toLowerCase(),new mxStencil(p));if(null!=d){var y=p.getAttribute("w"),-C=p.getAttribute("h");y=null==y?80:parseInt(y,10);C=null==C?80:parseInt(C,10);d(v,n,b,y,C)}}p=p.nextSibling}}};+mxStencilRegistry.loadStencilSet=function(b,d,m,p){var u=mxStencilRegistry.packages[b];if(null!=m&&m||null==u){var n=!1;if(null==u)try{if(p){mxStencilRegistry.loadStencil(b,mxUtils.bind(this,function(y){null!=y&&null!=y.documentElement&&(mxStencilRegistry.packages[b]=y,n=!0,mxStencilRegistry.parseStencilSet(y.documentElement,d,n))}));return}u=mxStencilRegistry.loadStencil(b);mxStencilRegistry.packages[b]=u;n=!0}catch(y){null!=window.console&&console.log("error in loadStencilSet:",b,y)}null!=u&&null!=+u.documentElement&&mxStencilRegistry.parseStencilSet(u.documentElement,d,n)}};mxStencilRegistry.loadStencil=function(b,d){if(null!=d)mxUtils.get(b,mxUtils.bind(this,function(m){d(200<=m.getStatus()&&299>=m.getStatus()?m.getXml():null)}),mxUtils.bind(this,function(m){d(null)}));else return mxUtils.load(b).getXml()};mxStencilRegistry.parseStencilSets=function(b){for(var d=0;d<b.length;d++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(b[d]).documentElement)};+mxStencilRegistry.parseStencilSet=function(b,d,m){if("stencils"==b.nodeName)for(var p=b.firstChild;null!=p;)"shapes"==p.nodeName&&mxStencilRegistry.parseStencilSet(p,d,m),p=p.nextSibling;else{m=null!=m?m:!0;p=b.firstChild;var u="";b=b.getAttribute("name");for(null!=b&&(u=b+".");null!=p;){if(p.nodeType==mxConstants.NODETYPE_ELEMENT&&(b=p.getAttribute("name"),null!=b)){u=u.toLowerCase();var n=b.replace(/ /g,"_");m&&mxStencilRegistry.addStencil(u+n.toLowerCase(),new mxStencil(p));if(null!=d){var y=p.getAttribute("w"),+B=p.getAttribute("h");y=null==y?80:parseInt(y,10);B=null==B?80:parseInt(B,10);d(u,n,b,y,B)}}p=p.nextSibling}}};"undefined"!==typeof mxVertexHandler&&function(){function b(){var D=document.createElement("div");D.className="geHint";D.style.whiteSpace="nowrap";D.style.position="absolute";return D}function d(D,M){switch(M){case mxConstants.POINTS:return D;case mxConstants.MILLIMETERS:return Math.round(1E3*D/mxConstants.PIXELS_PER_MM)/1E3;case mxConstants.METERS:return(D/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(D/mxConstants.PIXELS_PER_INCH).toFixed(3)}}mxConstants.HANDLE_FILLCOLOR="#29b6f2";mxConstants.HANDLE_STROKECOLOR="#0088cf";mxConstants.VERTEX_SELECTION_COLOR="#00a8ff";mxConstants.OUTLINE_COLOR="#00a8ff";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.EDGE_SELECTION_COLOR="#00a8ff";mxConstants.DEFAULT_VALID_COLOR="#00a8ff";mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff";mxConstants.GUIDE_COLOR="#0088cf";mxConstants.HIGHLIGHT_STROKEWIDTH=5;mxConstants.HIGHLIGHT_OPACITY=50;mxConstants.HIGHLIGHT_SIZE=5;mxWindow.prototype.closeImage=Graph.createSvgImage(18,10,'<path d="M 5 1 L 13 9 M 13 1 L 5 9" stroke="#707070" stroke-width="2"/>').src;mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'<path d="M 3 7 L 7 3 L 11 7" stroke="#707070" stroke-width="2" fill="none"/>').src;mxWindow.prototype.normalizeImage=Graph.createSvgImage(14,10,'<path d="M 3 3 L 7 7 L 11 3" stroke="#707070" stroke-width="2" fill="none"/>').src;mxWindow.prototype.resizeImage=Graph.createSvgImage(10,10,'<path d="Z" stroke="#C0C0C0" stroke-width="1" fill="none"/>').src;mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxGraphHandler.prototype.removeEmptyParents=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(D){return!mxEvent.isAltDown(D)||mxEvent.isShiftDown(D)};var m=mxGraphLayout.prototype.isVertexIgnored;mxGraphLayout.prototype.isVertexIgnored=function(D){return m.apply(this,arguments)||this.graph.isTableRow(D)||this.graph.isTableCell(D)};-var p=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored=function(D){return p.apply(this,arguments)||this.graph.isEdgeIgnored(D)};var v=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(D){return this.graph.isCloneEvent(D)!=v.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var D=new mxEllipse(null,this.highlightColor,this.highlightColor,0);D.opacity=mxConstants.HIGHLIGHT_OPACITY;return D};+var p=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored=function(D){return p.apply(this,arguments)||this.graph.isEdgeIgnored(D)};var u=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(D){return this.graph.isCloneEvent(D)!=u.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var D=new mxEllipse(null,this.highlightColor,this.highlightColor,0);D.opacity=mxConstants.HIGHLIGHT_OPACITY;return D};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor="crosshair";mxConnectionHandler.prototype.createEdgeState=function(D){D=this.graph.createCurrentEdgeStyle();D=this.graph.createEdge(null,null,null,null,null,D);D=new mxCellState(this.graph.view,D,this.graph.getCellStyle(D));for(var M in this.graph.currentEdgeStyle)D.style[M]=this.graph.currentEdgeStyle[M];if(null!=this.previous){var N=this.previous.style.newEdgeStyle;if(null!=N)try{var W=Graph.decodeNewEdgeStyle(N);for(M in W)D.style[M]=W[M]}catch(ca){}}D.style=this.graph.postProcessCellStyle(D.cell,D.style);return D};var n=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var D=n.apply(this,arguments);D.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return D};mxConnectionHandler.prototype.updatePreview=function(D){};var y=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var D=y.apply(this,arguments),M=D.getCell;D.getCell=mxUtils.bind(this,function(N){var W=M.apply(this,arguments);this.error=null;return W});return D};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){for(var D="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";",M="shape curved rounded comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification comicStyle jumpStyle jumpSize libavoidRouting".split(" "),N=0;N<M.length;N++)null!=this.currentEdgeStyle[M[N]]&&(D+=M[N]+"="+this.currentEdgeStyle[M[N]]+";");null!=this.currentEdgeStyle.orthogonalLoop?D+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(D+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?D+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(D+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(D+="elbow="+this.currentEdgeStyle.elbow+";");return D=null!=this.currentEdgeStyle.html?D+("html="+this.currentEdgeStyle.html+";"):D+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var D=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=D&&(new mxCodec(D.ownerDocument)).decode(D,this.getStylesheet())};Graph.prototype.createCellLookup=function(D,M){M=null!=M?M:{};for(var N=0;N<D.length;N++){var W=D[N];M[mxObjectIdentity.get(W)]=W.getId();for(var ca=this.model.getChildCount(W),ma=0;ma<ca;ma++)this.createCellLookup([this.model.getChildAt(W,ma)],M)}return M};Graph.prototype.createCellMapping=function(D,M,N){N=null!=N?N:{};for(var W in D){var ca=M[W];null==N[ca]&&(N[ca]=D[W].getId()||"")}return N};Graph.prototype.importGraphModel=function(D,-M,N,W){M=null!=M?M:0;N=null!=N?N:0;var ca=new mxCodec(D.ownerDocument),ma=new mxGraphModel;ca.decode(D,ma);D=[];ca={};var pa={},ua=ma.getChildren(this.cloneCell(ma.root,this.isCloneInvalidEdges(),ca));if(null!=ua){var Aa=this.createCellLookup([ma.root]);ua=ua.slice();this.model.beginUpdate();try{if(1!=ua.length||this.isCellLocked(this.getDefaultParent()))for(ma=0;ma<ua.length;ma++)xa=this.model.getChildren(this.moveCells([ua[ma]],M,N,!1,this.model.getRoot())[0]),null!=xa&&(D=D.concat(xa));else{var xa=-ma.getChildren(ua[0]);null!=xa&&(D=this.moveCells(xa,M,N,!1,this.getDefaultParent()),pa[ma.getChildAt(ma.root,0).getId()]=this.getDefaultParent().getId())}if(null!=D&&(this.createCellMapping(ca,Aa,pa),this.updateCustomLinks(pa,D),W)){this.isGridEnabled()&&(M=this.snap(M),N=this.snap(N));var Ma=this.getBoundingBoxFromGeometry(D,!0);null!=Ma&&this.moveCells(D,M-Ma.x,N-Ma.y)}}finally{this.model.endUpdate()}}return D};Graph.prototype.encodeCells=function(D){for(var M={},N=this.cloneCells(D,null,M),W=-new mxDictionary,ca=0;ca<D.length;ca++)W.put(D[ca],!0);var ma=new mxCodec,pa=new mxGraphModel,ua=pa.getChildAt(pa.getRoot(),0);for(ca=0;ca<N.length;ca++){pa.add(ua,N[ca]);var Aa=this.view.getState(D[ca]);if(null!=Aa){var xa=this.getCellGeometry(N[ca]);null!=xa&&xa.relative&&!this.model.isEdge(D[ca])&&null==W.get(this.model.getParent(D[ca]))&&(xa.offset=null,xa.relative=!1,xa.x=Aa.x/Aa.view.scale-Aa.view.translate.x,xa.y=Aa.y/Aa.view.scale-Aa.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(M,-this.createCellLookup(D)),N);return ma.encode(pa)};Graph.prototype.isSwimlane=function(D,M){var N=null;null==D||this.model.isEdge(D)||this.model.getParent(D)==this.model.getRoot()||(N=this.getCurrentCellStyle(D,M)[mxConstants.STYLE_SHAPE]);return N==mxConstants.SHAPE_SWIMLANE||"table"==N||"tableRow"==N};var C=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(D){return null!=D&&C.apply(this,arguments)?this.isTableCell(D)||this.isTableRow(D)?this.isCellEditable(this.model.getParent(D)):+M,N,W){M=null!=M?M:0;N=null!=N?N:0;var ca=new mxCodec(D.ownerDocument),ma=new mxGraphModel;ca.decode(D,ma);D=[];ca={};var pa={},va=ma.getChildren(this.cloneCell(ma.root,this.isCloneInvalidEdges(),ca));if(null!=va){var Aa=this.createCellLookup([ma.root]);va=va.slice();this.model.beginUpdate();try{if(1!=va.length||this.isCellLocked(this.getDefaultParent()))for(ma=0;ma<va.length;ma++)xa=this.model.getChildren(this.moveCells([va[ma]],M,N,!1,this.model.getRoot())[0]),null!=xa&&(D=D.concat(xa));else{var xa=+ma.getChildren(va[0]);null!=xa&&(D=this.moveCells(xa,M,N,!1,this.getDefaultParent()),pa[ma.getChildAt(ma.root,0).getId()]=this.getDefaultParent().getId())}if(null!=D&&(this.createCellMapping(ca,Aa,pa),this.updateCustomLinks(pa,D),W)){this.isGridEnabled()&&(M=this.snap(M),N=this.snap(N));var Ma=this.getBoundingBoxFromGeometry(D,!0);null!=Ma&&this.moveCells(D,M-Ma.x,N-Ma.y)}}finally{this.model.endUpdate()}}return D};Graph.prototype.encodeCells=function(D){for(var M={},N=this.cloneCells(D,null,M),W=+new mxDictionary,ca=0;ca<D.length;ca++)W.put(D[ca],!0);var ma=new mxCodec,pa=new mxGraphModel,va=pa.getChildAt(pa.getRoot(),0);for(ca=0;ca<N.length;ca++){pa.add(va,N[ca]);var Aa=this.view.getState(D[ca]);if(null!=Aa){var xa=this.getCellGeometry(N[ca]);null!=xa&&xa.relative&&!this.model.isEdge(D[ca])&&null==W.get(this.model.getParent(D[ca]))&&(xa.offset=null,xa.relative=!1,xa.x=Aa.x/Aa.view.scale-Aa.view.translate.x,xa.y=Aa.y/Aa.view.scale-Aa.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(M,+this.createCellLookup(D)),N);return ma.encode(pa)};Graph.prototype.isSwimlane=function(D,M){var N=null;null==D||this.model.isEdge(D)||this.model.getParent(D)==this.model.getRoot()||(N=this.getCurrentCellStyle(D,M)[mxConstants.STYLE_SHAPE]);return N==mxConstants.SHAPE_SWIMLANE||"table"==N||"tableRow"==N};var B=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(D){return null!=D&&B.apply(this,arguments)?this.isTableCell(D)||this.isTableRow(D)?this.isCellEditable(this.model.getParent(D)):!0:!1};var P=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=function(D){return null!=D&&P.apply(this,arguments)?this.isTableCell(D)||this.isTableRow(D)?this.isCellMovable(this.model.getParent(D)):!0:!1};var G=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(D){var M=this.model.getParent(D);if(null!=M){var N=this.getCurrentCellStyle(M);if(null!=N.expand)return"0"!=N.expand}return G.apply(this,arguments)&&(null==M||!this.isTable(M))};var O=Graph.prototype.isContractParent;-Graph.prototype.isContractParent=function(D){var M=this.model.getParent(D);if(null!=M){var N=this.getCurrentCellStyle(M);if(null!=N.contract)return"0"!=N.contract}return O.apply(this,arguments)&&(null==M||!this.isTable(M))};var U=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(D,M,N,W,ca,ma,pa,ua){null==ua&&(ua=this.model.getParent(D),this.isTable(ua)||this.isTableRow(ua))&&(ua=this.getCellAt(ma,pa,null,!0,!1));N=null;this.model.beginUpdate();try{var Aa=this.getCellGeometry(D);if(null!=-Aa&&null!=Aa.points&&0<Aa.points.length&&1==M.length&&this.model.isVertex(M[0])){var xa=this.getCellGeometry(M[0]);if(null!=xa&&!xa.relative){var Ma=new mxRectangle(xa.x+W,xa.y+ca,xa.width,xa.height),Wa=Aa.points;xa=[];for(var Za=0;Za<Wa.length;Za++)Ma.intersectsPoint(Wa[Za].x,Wa[Za].y)||xa.push(Wa[Za]);xa.length<Wa.length&&(Aa=Aa.clone(),Aa.points=xa,this.model.setGeometry(D,Aa))}}N=U.apply(this,[D,M,N,W,ca,ma,pa,ua]);this.model.setValue(N,"");var pb=this.getChildCells(N,!0);for(Za=0;Za<pb.length;Za++)Aa=+Graph.prototype.isContractParent=function(D){var M=this.model.getParent(D);if(null!=M){var N=this.getCurrentCellStyle(M);if(null!=N.contract)return"0"!=N.contract}return O.apply(this,arguments)&&(null==M||!this.isTable(M))};var U=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(D,M,N,W,ca,ma,pa,va){null==va&&(va=this.model.getParent(D),this.isTable(va)||this.isTableRow(va))&&(va=this.getCellAt(ma,pa,null,!0,!1));N=null;this.model.beginUpdate();try{var Aa=this.getCellGeometry(D);if(null!=+Aa&&null!=Aa.points&&0<Aa.points.length&&1==M.length&&this.model.isVertex(M[0])){var xa=this.getCellGeometry(M[0]);if(null!=xa&&!xa.relative){var Ma=new mxRectangle(xa.x+W,xa.y+ca,xa.width,xa.height),Wa=Aa.points;xa=[];for(var Za=0;Za<Wa.length;Za++)Ma.intersectsPoint(Wa[Za].x,Wa[Za].y)||xa.push(Wa[Za]);xa.length<Wa.length&&(Aa=Aa.clone(),Aa.points=xa,this.model.setGeometry(D,Aa))}}N=U.apply(this,[D,M,N,W,ca,ma,pa,va]);this.model.setValue(N,"");var pb=this.getChildCells(N,!0);for(Za=0;Za<pb.length;Za++)Aa=this.getCellGeometry(pb[Za]),null!=Aa&&Aa.relative&&0<Aa.x&&this.model.remove(pb[Za]);var rb=this.getChildCells(D,!0);for(Za=0;Za<rb.length;Za++)Aa=this.getCellGeometry(rb[Za]),null!=Aa&&Aa.relative&&0>=Aa.x&&this.model.remove(rb[Za]);var tb=this.model.getTerminal(N,!1);if(null!=tb){var ob=this.getCurrentCellStyle(tb);null!=ob&&"1"==ob.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[D]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[D]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,-null,[N]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[N]))}}finally{this.model.endUpdate()}return N};var c=Graph.prototype.selectCell;Graph.prototype.selectCell=function(D,M,N){if(M||N)c.apply(this,arguments);else{var W=this.getSelectionCell(),ca=null,ma=[],pa=mxUtils.bind(this,function(ua){if(null!=this.view.getState(ua)&&(this.model.isVertex(ua)||this.model.isEdge(ua)))if(ma.push(ua),ua==W)ca=ma.length-1;else if(D&&null==W&&0<ma.length||null!=ca&&D&&ma.length>ca||!D&&0<ca)return;for(var Aa=-0;Aa<this.model.getChildCount(ua);Aa++)pa(this.model.getChildAt(ua,Aa))});pa(this.model.root);0<ma.length&&(ca=null!=ca?mxUtils.mod(ca+(D?1:-1),ma.length):0,this.setSelectionCell(ma[ca]))}};Graph.prototype.swapShapes=function(D,M){if(this.model.isVertex(D)&&this.model.isVertex(M)&&2==this.getMovableCells([D,M]).length){var N=this.getCellGeometry(D),W=this.getCellGeometry(M);if(null!=N&&null!=W){var ca=N.clone(),ma=W.clone();this.model.beginUpdate();try{ca.x=W.getCenterX()-N.width/2,ca.y=W.getCenterY()--N.height/2,ma.x=N.getCenterX()-W.width/2,ma.y=N.getCenterY()-W.height/2,this.model.setGeometry(D,ca),this.model.setGeometry(M,ma)}finally{this.model.endUpdate()}}}};var f=Graph.prototype.moveCells;Graph.prototype.moveCells=function(D,M,N,W,ca,ma,pa){pa=null!=pa?pa:{};if(this.isTable(ca)){for(var ua=[],Aa=0;Aa<D.length;Aa++)this.isTable(D[Aa])?ua=ua.concat(this.model.getChildCells(D[Aa],!0).reverse()):ua.push(D[Aa]);D=ua}this.model.beginUpdate();try{ua=[];for(Aa=0;Aa<D.length;Aa++)if(null!=ca&&this.isTableRow(D[Aa])){var xa=-this.model.getParent(D[Aa]),Ma=this.getCellGeometry(D[Aa]);this.isTable(xa)&&ua.push(xa);if(null!=xa&&null!=Ma&&this.isTable(xa)&&this.isTable(ca)&&(W||xa!=ca)){if(!W){var Wa=this.getCellGeometry(xa);null!=Wa&&(Wa=Wa.clone(),Wa.height-=Ma.height,this.model.setGeometry(xa,Wa))}Wa=this.getCellGeometry(ca);null!=Wa&&(Wa=Wa.clone(),Wa.height+=Ma.height,this.model.setGeometry(ca,Wa));var Za=this.model.getChildCells(ca,!0);if(0<Za.length){D[Aa]=W?this.cloneCell(D[Aa]):D[Aa];var pb=this.model.getChildCells(D[Aa],+null,[N]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[N]))}}finally{this.model.endUpdate()}return N};var c=Graph.prototype.selectCell;Graph.prototype.selectCell=function(D,M,N){if(M||N)c.apply(this,arguments);else{var W=this.getSelectionCell(),ca=null,ma=[],pa=mxUtils.bind(this,function(va){if(null!=this.view.getState(va)&&(this.model.isVertex(va)||this.model.isEdge(va)))if(ma.push(va),va==W)ca=ma.length-1;else if(D&&null==W&&0<ma.length||null!=ca&&D&&ma.length>ca||!D&&0<ca)return;for(var Aa=+0;Aa<this.model.getChildCount(va);Aa++)pa(this.model.getChildAt(va,Aa))});pa(this.model.root);0<ma.length&&(ca=null!=ca?mxUtils.mod(ca+(D?1:-1),ma.length):0,this.setSelectionCell(ma[ca]))}};Graph.prototype.swapShapes=function(D,M){if(this.model.isVertex(D)&&this.model.isVertex(M)&&2==this.getMovableCells([D,M]).length){var N=this.getCellGeometry(D),W=this.getCellGeometry(M);if(null!=N&&null!=W){var ca=N.clone(),ma=W.clone();this.model.beginUpdate();try{ca.x=W.getCenterX()-N.width/2,ca.y=W.getCenterY()-+N.height/2,ma.x=N.getCenterX()-W.width/2,ma.y=N.getCenterY()-W.height/2,this.model.setGeometry(D,ca),this.model.setGeometry(M,ma)}finally{this.model.endUpdate()}}}};var f=Graph.prototype.moveCells;Graph.prototype.moveCells=function(D,M,N,W,ca,ma,pa){pa=null!=pa?pa:{};if(this.isTable(ca)){for(var va=[],Aa=0;Aa<D.length;Aa++)this.isTable(D[Aa])?va=va.concat(this.model.getChildCells(D[Aa],!0).reverse()):va.push(D[Aa]);D=va}this.model.beginUpdate();try{va=[];for(Aa=0;Aa<D.length;Aa++)if(null!=ca&&this.isTableRow(D[Aa])){var xa=+this.model.getParent(D[Aa]),Ma=this.getCellGeometry(D[Aa]);this.isTable(xa)&&va.push(xa);if(null!=xa&&null!=Ma&&this.isTable(xa)&&this.isTable(ca)&&(W||xa!=ca)){if(!W){var Wa=this.getCellGeometry(xa);null!=Wa&&(Wa=Wa.clone(),Wa.height-=Ma.height,this.model.setGeometry(xa,Wa))}Wa=this.getCellGeometry(ca);null!=Wa&&(Wa=Wa.clone(),Wa.height+=Ma.height,this.model.setGeometry(ca,Wa));var Za=this.model.getChildCells(ca,!0);if(0<Za.length){D[Aa]=W?this.cloneCell(D[Aa]):D[Aa];var pb=this.model.getChildCells(D[Aa],!0),rb=this.model.getChildCells(Za[0],!0),tb=rb.length-pb.length;if(0<tb)for(var ob=0;ob<tb;ob++){var cb=this.cloneCell(pb[pb.length-1]);null!=cb&&(cb.value="",this.model.add(D[Aa],cb))}else if(0>tb)for(ob=0;ob>tb;ob--)this.model.remove(pb[pb.length+ob-1]);pb=this.model.getChildCells(D[Aa],!0);for(ob=0;ob<rb.length;ob++){var fb=this.getCellGeometry(rb[ob]),Xa=this.getCellGeometry(pb[ob]);null!=fb&&null!=Xa&&(Xa=Xa.clone(),Xa.width=fb.width,this.model.setGeometry(pb[ob],Xa))}}}}var wb=f.apply(this,-arguments);for(Aa=0;Aa<ua.length;Aa++)!W&&this.model.contains(ua[Aa])&&0==this.model.getChildCount(ua[Aa])&&this.model.remove(ua[Aa]);W&&this.updateCustomLinks(this.createCellMapping(pa,this.createCellLookup(D)),wb)}finally{this.model.endUpdate()}return wb};var k=Graph.prototype.removeCells;Graph.prototype.removeCells=function(D,M){var N=[];this.model.beginUpdate();try{for(var W=0;W<D.length;W++)if(this.isTableCell(D[W])){var ca=this.model.getParent(D[W]),ma=this.model.getParent(ca);1==this.model.getChildCount(ca)&&-1==this.model.getChildCount(ma)?0>mxUtils.indexOf(D,ma)&&0>mxUtils.indexOf(N,ma)&&N.push(ma):this.labelChanged(D[W],"")}else{if(this.isTableRow(D[W])&&(ma=this.model.getParent(D[W]),0>mxUtils.indexOf(D,ma)&&0>mxUtils.indexOf(N,ma))){for(var pa=this.model.getChildCells(ma,!0),ua=0,Aa=0;Aa<pa.length;Aa++)0<=mxUtils.indexOf(D,pa[Aa])&&ua++;ua==pa.length&&N.push(ma)}N.push(D[W])}N=k.apply(this,[N,M])}finally{this.model.endUpdate()}return N};Graph.prototype.updateCustomLinks=function(D,M,N){N=null!=N?+arguments);for(Aa=0;Aa<va.length;Aa++)!W&&this.model.contains(va[Aa])&&0==this.model.getChildCount(va[Aa])&&this.model.remove(va[Aa]);W&&this.updateCustomLinks(this.createCellMapping(pa,this.createCellLookup(D)),wb)}finally{this.model.endUpdate()}return wb};var k=Graph.prototype.removeCells;Graph.prototype.removeCells=function(D,M){var N=[];this.model.beginUpdate();try{for(var W=0;W<D.length;W++)if(this.isTableCell(D[W])){var ca=this.model.getParent(D[W]),ma=this.model.getParent(ca);1==this.model.getChildCount(ca)&&+1==this.model.getChildCount(ma)?0>mxUtils.indexOf(D,ma)&&0>mxUtils.indexOf(N,ma)&&N.push(ma):this.labelChanged(D[W],"")}else{if(this.isTableRow(D[W])&&(ma=this.model.getParent(D[W]),0>mxUtils.indexOf(D,ma)&&0>mxUtils.indexOf(N,ma))){for(var pa=this.model.getChildCells(ma,!0),va=0,Aa=0;Aa<pa.length;Aa++)0<=mxUtils.indexOf(D,pa[Aa])&&va++;va==pa.length&&N.push(ma)}N.push(D[W])}N=k.apply(this,[N,M])}finally{this.model.endUpdate()}return N};Graph.prototype.updateCustomLinks=function(D,M,N){N=null!=N?N:new Graph;for(var W=0;W<M.length;W++)null!=M[W]&&N.updateCustomLinksForCell(D,M[W],N)};Graph.prototype.updateCustomLinksForCell=function(D,M){this.doUpdateCustomLinksForCell(D,M);for(var N=this.model.getChildCount(M),W=0;W<N;W++)this.updateCustomLinksForCell(D,this.model.getChildAt(M,W))};Graph.prototype.doUpdateCustomLinksForCell=function(D,M){};Graph.prototype.getAllConnectionConstraints=function(D,M){if(null!=D){M=mxUtils.getValue(D.style,"points",null);if(null!=M){D=[];try{var N=JSON.parse(M);for(M=0;M<N.length;M++){var W=N[M];D.push(new mxConnectionConstraint(new mxPoint(W[0],W[1]),2<W.length?"0"!=W[2]:!0,null,3<W.length?W[3]:0,4<W.length?W[4]:0))}}catch(ma){}return D}if(null!=D.shape&&null!=D.shape.bounds){W=D.shape.direction;M=D.shape.bounds;var ca=D.shape.scale;N=M.width/ca;M=M.height/ca;if(W==mxConstants.DIRECTION_NORTH||W==mxConstants.DIRECTION_SOUTH)W=N,N=M,M=W;M=D.shape.getConstraints(D.style,N,M);if(null!=M)return M;if(null!=D.shape.stencil&&null!=D.shape.stencil.constraints)return D.shape.stencil.constraints;if(null!=D.shape.constraints)return D.shape.constraints}}return null};Graph.prototype.flipEdge=function(D){if(null!=D){var M=this.getCurrentCellStyle(D);M=mxUtils.getValue(M,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,M,[D])}};var q=Graph.prototype.resetEdge;Graph.prototype.resetEdge=function(D){null!=D&&this.setCellStyles("innerLoopWaypoints",null,[D]);return q.apply(this,-arguments)};var x=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(D,M){if(null!=D){var N=D.getVisibleTerminalState(!0),W=D.getVisibleTerminalState(!1);if(null!=N&&N==W){N=this.createEdgeSegmentHandler(D);var ca=N.changePoints,ma=N.getPreviewPoints,pa=N.updatePreviewState,ua=N.clonePreviewState;N.getPreviewPoints=function(xa){if(!this.isSource&&!this.isTarget){var Ma=this.getCurrentPoints();return null!=Ma&&4==Ma.length&&1<this.index&&this.index<Ma.length-1&&(Ma=this.graph.getLoopAroundPoints(this.state,-xa),null!=Ma)?this.graph.keepLoopOutsideShape(this.state,Ma):this.graph.keepLoopOutsideShape(this.state,ma.apply(this,arguments))}return ma.apply(this,arguments)};N.clonePreviewState=function(xa,Ma){var Wa=ua.apply(this,arguments);this.isSource||this.isTarget||null==Wa||null==Wa.style||(Wa.style[mxConstants.STYLE_EDGE]="orthogonalEdgeStyle",Wa.style.innerLoopWaypoints="1");return Wa};N.changePoints=function(xa,Ma,Wa){Ma=this.graph.keepLoopOutsideShape(this.state,Ma);var Za=this.graph.getModel();Za.beginUpdate();+arguments)};var x=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(D,M){if(null!=D){var N=D.getVisibleTerminalState(!0),W=D.getVisibleTerminalState(!1);if(null!=N&&N==W){N=this.createEdgeSegmentHandler(D);var ca=N.changePoints,ma=N.getPreviewPoints,pa=N.updatePreviewState,va=N.clonePreviewState;N.getPreviewPoints=function(xa){if(!this.isSource&&!this.isTarget){var Ma=this.getCurrentPoints();return null!=Ma&&4==Ma.length&&1<this.index&&this.index<Ma.length-1&&(Ma=this.graph.getLoopAroundPoints(this.state,+xa),null!=Ma)?this.graph.keepLoopOutsideShape(this.state,Ma):this.graph.keepLoopOutsideShape(this.state,ma.apply(this,arguments))}return ma.apply(this,arguments)};N.clonePreviewState=function(xa,Ma){var Wa=va.apply(this,arguments);this.isSource||this.isTarget||null==Wa||null==Wa.style||(Wa.style[mxConstants.STYLE_EDGE]="orthogonalEdgeStyle",Wa.style.innerLoopWaypoints="1");return Wa};N.changePoints=function(xa,Ma,Wa){Ma=this.graph.keepLoopOutsideShape(this.state,Ma);var Za=this.graph.getModel();Za.beginUpdate();try{xa=ca.call(this,xa,Ma,Wa),null!=xa&&null!=Ma&&2<=Ma.length&&(this.graph.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[xa]),this.graph.setCellStyles("innerLoopWaypoints","1",[xa]))}finally{Za.endUpdate()}return xa};var Aa=N.start;N.start=function(xa,Ma,Wa){this.validLoopPoints=null;Aa.apply(this,arguments)};N.rerouteLoopPreview=function(xa){var Ma=this.state.getVisibleTerminalState(!0),Wa=this.state.getVisibleTerminalState(!1);xa.view.updateFixedTerminalPoints(xa,Ma,Wa);xa.view.updatePoints(xa,this.points,Ma,Wa);xa.view.updateFloatingTerminalPoints(xa,Ma,Wa)};N.getCommittedLoopPoints=function(){var xa=this.graph.getCellGeometry(this.state.cell);if(null!=xa&&null!=xa.points&&2<=xa.points.length)return xa.points.map(function(tb){return new mxPoint(tb.x,tb.y)});xa=this.state.absolutePoints;if(null!=xa&&4<=xa.length){for(var Ma=this.state.view.scale,Wa=this.state.view.translate,Za=this.state.origin,pb=[],rb=1;rb<xa.length-1;rb++)null!=xa[rb]&&pb.push(new mxPoint(xa[rb].x/Ma-Wa.x-Za.x,xa[rb].y/Ma-Wa.y-Za.y));if(2<=pb.length)return pb}return null};N.isLoopSpike=function(xa){xa=xa.absolutePoints;if(null==xa||2>xa.length||null==xa[0]||null==xa[xa.length-1])return!0;var Ma=this.graph.gridSize*this.state.view.scale/2;return Math.abs(xa[0].x-xa[xa.length-1].x)<Ma&&Math.abs(xa[0].y-xa[xa.length-1].y)<Ma};N.updatePreviewState=function(xa,Ma,Wa,Za,pb){this.isSource||this.isTarget||null!=this.validLoopPoints||(this.validLoopPoints=this.getCommittedLoopPoints());pa.apply(this,arguments);if(!this.isSource&&!this.isTarget){if(null!=this.points&&2==this.points.length&&0==Math.round(this.points[0].x-this.points[1].x)&&0==Math.round(this.points[0].y-this.points[1].y)){var rb=this.graph.getLoopAroundPoints(this.state,Ma);null!=rb&&(this.points=this.graph.keepLoopOutsideShape(this.state,rb),this.rerouteLoopPreview(xa))}this.isLoopSpike(xa)?null!=this.validLoopPoints&&(this.points=this.validLoopPoints.map(function(tb){return new mxPoint(tb.x,tb.y)}),this.rerouteLoopPreview(xa)):null!=this.points&&2<=this.points.length&&(this.validLoopPoints=this.points.map(function(tb){return new mxPoint(tb.x,tb.y)}))}};return N}}return x.apply(this,arguments)};Graph.prototype.isValidRoot=function(D){for(var M=this.model.getChildCount(D),N=0,W=0;W<M;W++){var ca=this.model.getChildAt(D,W);this.model.isVertex(ca)&&(ca=this.getCellGeometry(ca),null==ca||ca.relative||N++)}return 0<N||this.isContainer(D)};Graph.prototype.isValidDropTarget=function(D,M,N){for(var W=this.getCurrentCellStyle(D),ca=!0,ma=!0,pa=0;pa<M.length&&ma;pa++)ca=ca&&this.isTable(M[pa]),ma=ma&&this.isTableRow(M[pa]);return!this.isCellLocked(D)&&null==this.getLockedGroupAncestor(D)&&(this.isTargetShape(D,M,N)||("1"!=mxUtils.getValue(W,"part","0")||this.isContainer(D))&&"0"!=mxUtils.getValue(W,"dropTarget","1")&&(mxGraph.prototype.isValidDropTarget.apply(this,arguments)||this.isContainer(D))&&!this.isTableRow(D)&&(!this.isTable(D)||ma||ca))};Graph.prototype.createGroupCell=function(){var D=mxGraph.prototype.createGroupCell.apply(this,arguments);D.setStyle("group");-return D};var B=Graph.prototype.translateCell;Graph.prototype.translateCell=function(D,M,N){if(this.isTransparentBounds(D))for(var W=this.model.getChildCount(D),ca=0;ca<W;ca++)this.translateCell(this.model.getChildAt(D,ca),M,N);else B.apply(this,arguments)};var E=Graph.prototype.groupCells;Graph.prototype.groupCells=function(D,M,N){if(null!=D&&this.isTransparentBounds(D)){null==N&&(N=mxUtils.sortCells(this.getSelectionCells(),!0));N=this.getCellsForGroup(N);if(0<N.length){var W=this.model.getParent(D);+return D};var C=Graph.prototype.translateCell;Graph.prototype.translateCell=function(D,M,N){if(this.isTransparentBounds(D))for(var W=this.model.getChildCount(D),ca=0;ca<W;ca++)this.translateCell(this.model.getChildAt(D,ca),M,N);else C.apply(this,arguments)};var E=Graph.prototype.groupCells;Graph.prototype.groupCells=function(D,M,N){if(null!=D&&this.isTransparentBounds(D)){null==N&&(N=mxUtils.sortCells(this.getSelectionCells(),!0));N=this.getCellsForGroup(N);if(0<N.length){var W=this.model.getParent(D);null==W&&(W=this.model.getParent(N[0]));this.model.beginUpdate();try{this.model.setGeometry(D,new mxGeometry(0,0,0,0));var ca=this.model.getChildCount(W);this.cellsAdded([D],W,ca,null,null,!1,!1,!1);ca=this.model.getChildCount(D);this.cellsAdded(N,D,ca,null,null,!1,!1,!1);this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",D,"border",M,"cells",N))}finally{this.model.endUpdate()}}return D}return E.apply(this,arguments)};Graph.prototype.isExtendParentsOnAdd=function(D){var M=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(M&&null!=D&&null!=this.layoutManager){var N=this.model.getParent(D);null!=N&&(N=this.layoutManager.getLayout(N),null!=N&&N.constructor==mxStackLayout&&(M=!1))}return M};Graph.prototype.getPreferredSizeForCell=function(D,M,N){N=null!=N?N:this.gridEnabled;var W=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=W&&(W.width+=10,W.height+=4,N&&(W.width=this.snap(W.width),W.height=this.snap(W.height)));return W};Graph.prototype.getAutosizeTextAvailableSpace=function(D,M,N,W){var ca=0,ma=0;(null!=W&&null!=this.getImage(W)||null!=D[mxConstants.STYLE_IMAGE])&&D[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&(D[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(ca+=parseFloat(mxUtils.getValue(D,mxConstants.STYLE_IMAGE_WIDTH,mxLabel.prototype.imageSize))),D[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(ma+=parseFloat(mxUtils.getValue(D,mxConstants.STYLE_IMAGE_HEIGHT,mxLabel.prototype.imageSize))));ca+=2*parseFloat(mxUtils.getValue(D,mxConstants.STYLE_SPACING,2));ca+=parseFloat(mxUtils.getValue(D,mxConstants.STYLE_SPACING_LEFT,2));ca+=parseFloat(mxUtils.getValue(D,mxConstants.STYLE_SPACING_RIGHT,2));ma+=2*parseFloat(mxUtils.getValue(D,mxConstants.STYLE_SPACING,2));ma+=parseFloat(mxUtils.getValue(D,mxConstants.STYLE_SPACING_TOP,2));ma+=parseFloat(mxUtils.getValue(D,mxConstants.STYLE_SPACING_BOTTOM,2));null!=W&&(W=this.getFoldingImage(W),null!=W&&(ca+=W.width+8));D=mxUtils.getValue(D,mxConstants.STYLE_HORIZONTAL,!0);ca=(D?M:N)-ca;M=(D?N:M)-ma;return 0>=-ca||0>=M?null:{availW:ca,availH:M}};Graph.prototype.computeAutosizeTextFontSize=function(D,M,N,W,ca,ma){var pa=1,ua=84,Aa=ma?M:null,xa=null;if(ma){for(var Ma=D.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Wa=[],Za=0;Za<Ma.length;Za++)0<Ma[Za].length&&Wa.push(mxUtils.htmlEntities(Ma[Za],!1));0<Wa.length&&(xa=Wa.join("<br>"))}for(;pa<ua;)Ma=Math.ceil((pa+ua)/2),Wa=mxUtils.getSizeForString(D,Ma,W,Aa,ca),(Wa=ma?Wa.height<=N:Wa.width<=M&&Wa.height<=N)&&ma&&null!=xa&&mxUtils.getSizeForString(xa,-Ma,W,null,ca).width>M&&(Wa=!1),Wa?pa=Ma:ua=Ma-1;return Math.max(6,pa)};Graph.prototype.updateAutosizeTextFontSize=function(D,M){var N=this.view.getState(D);null==N&&(N=this.view.createState(D));M=M||N.style;var W=this.getCellGeometry(D);if(null!=W&&!this.model.isEdge(D)){var ca=this.cellRenderer.getLabelValue(N);null!=ca&&0!=ca.length&&(N=this.getAutosizeTextAvailableSpace(M,W.width,W.height,N),null!=N&&(this.isHtmlLabel(D)||(ca=mxUtils.htmlEntities(ca,!1)),ca=ca.replace(/\n/g,"<br>"),M=this.computeAutosizeTextFontSize(ca,+ca||0>=M?null:{availW:ca,availH:M}};Graph.prototype.computeAutosizeTextFontSize=function(D,M,N,W,ca,ma){var pa=1,va=84,Aa=ma?M:null,xa=null;if(ma){for(var Ma=D.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Wa=[],Za=0;Za<Ma.length;Za++)0<Ma[Za].length&&Wa.push(mxUtils.htmlEntities(Ma[Za],!1));0<Wa.length&&(xa=Wa.join("<br>"))}for(;pa<va;)Ma=Math.ceil((pa+va)/2),Wa=mxUtils.getSizeForString(D,Ma,W,Aa,ca),(Wa=ma?Wa.height<=N:Wa.width<=M&&Wa.height<=N)&&ma&&null!=xa&&mxUtils.getSizeForString(xa,+Ma,W,null,ca).width>M&&(Wa=!1),Wa?pa=Ma:va=Ma-1;return Math.max(6,pa)};Graph.prototype.updateAutosizeTextFontSize=function(D,M){var N=this.view.getState(D);null==N&&(N=this.view.createState(D));M=M||N.style;var W=this.getCellGeometry(D);if(null!=W&&!this.model.isEdge(D)){var ca=this.cellRenderer.getLabelValue(N);null!=ca&&0!=ca.length&&(N=this.getAutosizeTextAvailableSpace(M,W.width,W.height,N),null!=N&&(this.isHtmlLabel(D)||(ca=mxUtils.htmlEntities(ca,!1)),ca=ca.replace(/\n/g,"<br>"),M=this.computeAutosizeTextFontSize(ca,N.availW,N.availH,M[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,M[mxConstants.STYLE_FONTSTYLE],"wrap"==M[mxConstants.STYLE_WHITE_SPACE]),this.setCellStyles(mxConstants.STYLE_FONTSIZE,M,[D])))}};Graph.prototype.cellsResized=function(D,M,N){var W=mxGraph.prototype.cellsResized.apply(this,arguments);if(null!=D)for(var ca=0;ca<D.length;ca++)this.model.isVertex(D[ca])&&this.isAutosizeTextCell(D[ca])&&this.updateAutosizeTextFontSize(D[ca]);return W};Graph.prototype.isRotatableGroup=function(D){var M=this.getModel();return M.isVertex(D)&&0<M.getChildCount(D)&&!this.isTable(D)&&!this.isTableRow(D)&&!this.isTableCell(D)&&!this.isSwimlane(D)};Graph.prototype.setCellRotation=function(D,M){var N=parseFloat(M);!isNaN(N)&&this.isRotatableGroup(D)?this.rotateCell(D,N-(parseFloat(this.getCurrentCellStyle(D)[mxConstants.STYLE_ROTATION])||0)):this.setCellStyles(mxConstants.STYLE_ROTATION,M,[D])};Graph.prototype.rotateCell=function(D,M,N){if(0!=M){var W=this.getModel();if(W.isVertex(D)||W.isEdge(D)){W.beginUpdate();-try{if(!W.isEdge(D)){var ca=(this.getCurrentCellStyle(D)[mxConstants.STYLE_ROTATION]||0)+M;this.setCellStyles(mxConstants.STYLE_ROTATION,ca,[D])}var ma=this.getCellGeometry(D);if(null!=ma){var pa=this.getCellGeometry(N);null==pa||W.isEdge(N)||(ma=ma.clone(),ma.rotate(M,new mxPoint(pa.width/2,pa.height/2)),W.setGeometry(D,ma));if(W.isVertex(D)&&!ma.relative||W.isEdge(D)){var ua=W.getChildCount(D);for(N=0;N<ua;N++)this.rotateCell(W.getChildAt(D,N),M,D)}}}finally{W.endUpdate()}}}};Graph.prototype.isRotatedGroupResize=+try{if(!W.isEdge(D)){var ca=(this.getCurrentCellStyle(D)[mxConstants.STYLE_ROTATION]||0)+M;this.setCellStyles(mxConstants.STYLE_ROTATION,ca,[D])}var ma=this.getCellGeometry(D);if(null!=ma){var pa=this.getCellGeometry(N);null==pa||W.isEdge(N)||(ma=ma.clone(),ma.rotate(M,new mxPoint(pa.width/2,pa.height/2)),W.setGeometry(D,ma));if(W.isVertex(D)&&!ma.relative||W.isEdge(D)){var va=W.getChildCount(D);for(N=0;N<va;N++)this.rotateCell(W.getChildAt(D,N),M,D)}}}finally{W.endUpdate()}}}};Graph.prototype.isRotatedGroupResize=function(D){return this.isRotatableGroup(D)&&0!=mxUtils.mod(parseFloat(this.getCurrentCellStyle(D)[mxConstants.STYLE_ROTATION])||0,360)};var L=Graph.prototype.resizeChildCells;Graph.prototype.resizeChildCells=function(D,M){if(this.isRotatedGroupResize(D)){var N=parseFloat(this.getCurrentCellStyle(D)[mxConstants.STYLE_ROTATION])||0;this.resizeRotatedGroupChildren(D,this.model.getGeometry(D),M,N,N)}else L.apply(this,arguments)};Graph.prototype.resizeRotatedGroupChildren=function(D,M,N,W,ca){var ma=-this.getModel(),pa=0!=M.width?N.width/M.width:1,ua=0!=M.height?N.height/M.height:1,Aa=mxUtils.toRadians(W),xa=Math.cos(-Aa),Ma=Math.sin(-Aa);Aa=mxUtils.toRadians(ca);var Wa=Math.cos(Aa),Za=Math.sin(Aa),pb=M.width/2,rb=M.height/2,tb=N.width/2,ob=N.height/2,cb=function(Db,Lb){var Hb=xa*(Db-pb)-Ma*(Lb-rb);Db=Ma*(Db-pb)+xa*(Lb-rb);Hb*=pa;Db*=ua;return new mxPoint(tb+Wa*Hb-Za*Db,ob+Za*Hb+Wa*Db)};M=function(Db){if(null!=Db)for(var Lb=0;Lb<Db.length;Lb++)if(null!=Db[Lb]){var Hb=cb(Db[Lb].x,Db[Lb].y);Db[Lb].x=-Hb.x;Db[Lb].y=Hb.y}};N=ma.getChildCount(D);for(Aa=0;Aa<N;Aa++){var fb=ma.getChildAt(D,Aa),Xa=this.getCellGeometry(fb);if(null!=Xa)if(ma.isEdge(fb))Xa=Xa.clone(),M([Xa.sourcePoint,Xa.targetPoint]),M(Xa.points),ma.setGeometry(fb,Xa);else if(ma.isVertex(fb)&&!Xa.relative){var wb=this.getCurrentCellStyle(fb),sb=parseFloat(wb[mxConstants.STYLE_ROTATION])||0,qb=mxUtils.toRadians(sb-W),zb=pa*Math.cos(qb),Fb=ua*Math.sin(qb),Jb=Math.sqrt(zb*zb+Fb*Fb);qb=Math.sqrt(pa*pa*Math.sin(qb)*Math.sin(qb)+ua*ua*Math.cos(qb)*+this.getModel(),pa=0!=M.width?N.width/M.width:1,va=0!=M.height?N.height/M.height:1,Aa=mxUtils.toRadians(W),xa=Math.cos(-Aa),Ma=Math.sin(-Aa);Aa=mxUtils.toRadians(ca);var Wa=Math.cos(Aa),Za=Math.sin(Aa),pb=M.width/2,rb=M.height/2,tb=N.width/2,ob=N.height/2,cb=function(Db,Lb){var Hb=xa*(Db-pb)-Ma*(Lb-rb);Db=Ma*(Db-pb)+xa*(Lb-rb);Hb*=pa;Db*=va;return new mxPoint(tb+Wa*Hb-Za*Db,ob+Za*Hb+Wa*Db)};M=function(Db){if(null!=Db)for(var Lb=0;Lb<Db.length;Lb++)if(null!=Db[Lb]){var Hb=cb(Db[Lb].x,Db[Lb].y);Db[Lb].x=+Hb.x;Db[Lb].y=Hb.y}};N=ma.getChildCount(D);for(Aa=0;Aa<N;Aa++){var fb=ma.getChildAt(D,Aa),Xa=this.getCellGeometry(fb);if(null!=Xa)if(ma.isEdge(fb))Xa=Xa.clone(),M([Xa.sourcePoint,Xa.targetPoint]),M(Xa.points),ma.setGeometry(fb,Xa);else if(ma.isVertex(fb)&&!Xa.relative){var wb=this.getCurrentCellStyle(fb),sb=parseFloat(wb[mxConstants.STYLE_ROTATION])||0,qb=mxUtils.toRadians(sb-W),zb=pa*Math.cos(qb),Fb=va*Math.sin(qb),Jb=Math.sqrt(zb*zb+Fb*Fb);qb=Math.sqrt(pa*pa*Math.sin(qb)*Math.sin(qb)+va*va*Math.cos(qb)*Math.cos(qb));"fixed"==wb[mxConstants.STYLE_ASPECT]&&(Jb=qb=Math.min(Jb,qb));var vb=cb(Xa.getCenterX(),Xa.getCenterY()),Eb=Xa;Xa=Xa.clone();var Ib=sb;this.isCellResizable(fb)&&("0"!=wb[mxConstants.STYLE_RESIZE_WIDTH]&&(Xa.width=Eb.width*Jb),"0"!=wb[mxConstants.STYLE_RESIZE_HEIGHT]&&(Xa.height=Eb.height*qb),Ib=Math.round(100*(ca+mxUtils.toDegree(Math.atan2(Fb,zb))))/100);this.isCellMovable(fb)&&(Xa.x=vb.x-Xa.width/2,Xa.y=vb.y-Xa.height/2);ma.setGeometry(fb,Xa);.01<Math.abs(mxUtils.mod(Ib,360)-mxUtils.mod(sb,-360))?this.setCellStyles(mxConstants.STYLE_ROTATION,mxUtils.mod(Ib,360),[fb]):Ib=sb;this.resizeRotatedGroupChildren(fb,Eb,Xa,sb,Ib)}else this.scaleCell(fb,pa,ua,!0)}};Graph.prototype.turnShapes=function(D,M){var N=this.getModel(),W=[];N.beginUpdate();try{for(var ca=0;ca<D.length;ca++){var ma=D[ca];if(N.isEdge(ma)){var pa=N.getTerminal(ma,!0),ua=N.getTerminal(ma,!1);if(null!=pa&&pa==ua){var Aa=this.view.getState(ma),xa=N.getGeometry(ma);if(null!=Aa&&null!=xa&&null!=Aa.absolutePoints&&4<=Aa.absolutePoints.length&&+360))?this.setCellStyles(mxConstants.STYLE_ROTATION,mxUtils.mod(Ib,360),[fb]):Ib=sb;this.resizeRotatedGroupChildren(fb,Eb,Xa,sb,Ib)}else this.scaleCell(fb,pa,va,!0)}};Graph.prototype.turnShapes=function(D,M){var N=this.getModel(),W=[];N.beginUpdate();try{for(var ca=0;ca<D.length;ca++){var ma=D[ca];if(N.isEdge(ma)){var pa=N.getTerminal(ma,!0),va=N.getTerminal(ma,!1);if(null!=pa&&pa==va){var Aa=this.view.getState(ma),xa=N.getGeometry(ma);if(null!=Aa&&null!=xa&&null!=Aa.absolutePoints&&4<=Aa.absolutePoints.length&&(null==xa.points||2>xa.points.length)&&null==Aa.style[mxConstants.STYLE_EXIT_X]&&null==Aa.style[mxConstants.STYLE_ENTRY_X]){for(var Ma=this.view.scale,Wa=this.view.translate,Za=Aa.origin,pb=Aa.absolutePoints,rb=[],tb=1;tb<pb.length-1;tb++)null!=pb[tb]&&rb.push(new mxPoint(pb[tb].x/Ma-Wa.x-Za.x,pb[tb].y/Ma-Wa.y-Za.y));2<=rb.length&&(xa=xa.clone(),xa.points=rb,N.setGeometry(ma,xa),this.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[ma]),this.setCellStyles("innerLoopWaypoints","1",[ma]))}}N.setTerminal(ma,-ua,!0);N.setTerminal(ma,pa,!1);var ob=N.getGeometry(ma);if(null!=ob){ob=ob.clone();null!=ob.points&&ob.points.reverse();var cb=ob.getTerminalPoint(!0),fb=ob.getTerminalPoint(!1);ob.setTerminalPoint(cb,!1);ob.setTerminalPoint(fb,!0);N.setGeometry(ma,ob);var Xa=this.view.getState(ma),wb=this.view.getState(pa),sb=this.view.getState(ua);if(null!=Xa){var qb=null!=wb?this.getConnectionConstraint(Xa,wb,!0):null,zb=null!=sb?this.getConnectionConstraint(Xa,sb,!1):null;this.setConnectionConstraint(ma,pa,!0,-zb);this.setConnectionConstraint(ma,ua,!1,qb);var Fb=mxUtils.getValue(Xa.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Xa.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[ma]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,Fb,[ma])}W.push(ma)}}else if(N.isVertex(ma))if(this.isRotatableGroup(ma))this.rotateCell(ma,M?-90:90),W.push(ma);else if(ob=this.getCellGeometry(ma),null!=ob){if(!(this.isTable(ma)||+va,!0);N.setTerminal(ma,pa,!1);var ob=N.getGeometry(ma);if(null!=ob){ob=ob.clone();null!=ob.points&&ob.points.reverse();var cb=ob.getTerminalPoint(!0),fb=ob.getTerminalPoint(!1);ob.setTerminalPoint(cb,!1);ob.setTerminalPoint(fb,!0);N.setGeometry(ma,ob);var Xa=this.view.getState(ma),wb=this.view.getState(pa),sb=this.view.getState(va);if(null!=Xa){var qb=null!=wb?this.getConnectionConstraint(Xa,wb,!0):null,zb=null!=sb?this.getConnectionConstraint(Xa,sb,!1):null;this.setConnectionConstraint(ma,pa,!0,+zb);this.setConnectionConstraint(ma,va,!1,qb);var Fb=mxUtils.getValue(Xa.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Xa.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[ma]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,Fb,[ma])}W.push(ma)}}else if(N.isVertex(ma))if(this.isRotatableGroup(ma))this.rotateCell(ma,M?-90:90),W.push(ma);else if(ob=this.getCellGeometry(ma),null!=ob){if(!(this.isTable(ma)||this.isTableRow(ma)||this.isTableCell(ma)||this.isSwimlane(ma))){ob=ob.clone();ob.x+=ob.width/2-ob.height/2;ob.y+=ob.height/2-ob.width/2;var Jb=ob.width;ob.width=ob.height;ob.height=Jb;N.setGeometry(ma,ob)}var vb=this.view.getState(ma);if(null!=vb){var Eb=[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],Ib=mxUtils.getValue(vb.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);this.setCellStyles(mxConstants.STYLE_DIRECTION,Eb[mxUtils.mod(mxUtils.indexOf(Eb,-Ib)+(M?-1:1),Eb.length)],[ma])}W.push(ma)}}}finally{N.endUpdate()}return W};Graph.prototype.rotateEdges=function(D,M){var N=this.getModel(),W=[];N.beginUpdate();try{for(var ca=0;ca<D.length;ca++){var ma=D[ca];if(N.isEdge(ma)&&!this.isCellLocked(ma)&&null==N.getTerminal(ma,!0)&&null==N.getTerminal(ma,!1)){var pa=N.getGeometry(ma);if(null!=pa&&null!=pa.getTerminalPoint(!0)&&null!=pa.getTerminalPoint(!1)){pa=pa.clone();var ua=[pa.getTerminalPoint(!0),pa.getTerminalPoint(!1)];null!=pa.points&&(ua=ua.concat(pa.points));-for(var Aa=ua[0].x,xa=ua[0].y,Ma=ua[0].x,Wa=ua[0].y,Za=1;Za<ua.length;Za++)Aa=Math.min(Aa,ua[Za].x),xa=Math.min(xa,ua[Za].y),Ma=Math.max(Ma,ua[Za].x),Wa=Math.max(Wa,ua[Za].y);var pb=(Aa+Ma)/2,rb=(xa+Wa)/2;for(Za=0;Za<ua.length;Za++){var tb=ua[Za].x-pb,ob=ua[Za].y-rb;ua[Za].x=M?pb+ob:pb-ob;ua[Za].y=M?rb-tb:rb+tb}N.setGeometry(ma,pa);W.push(ma)}}}}finally{N.endUpdate()}return W};Graph.prototype.stencilHasPlaceholders=function(D){if(null!=D&&null!=D.fgNode)for(D=D.fgNode.firstChild;null!=D;){if("text"==+Ib)+(M?-1:1),Eb.length)],[ma])}W.push(ma)}}}finally{N.endUpdate()}return W};Graph.prototype.rotateEdges=function(D,M){var N=this.getModel(),W=[];N.beginUpdate();try{for(var ca=0;ca<D.length;ca++){var ma=D[ca];if(N.isEdge(ma)&&!this.isCellLocked(ma)&&null==N.getTerminal(ma,!0)&&null==N.getTerminal(ma,!1)){var pa=N.getGeometry(ma);if(null!=pa&&null!=pa.getTerminalPoint(!0)&&null!=pa.getTerminalPoint(!1)){pa=pa.clone();var va=[pa.getTerminalPoint(!0),pa.getTerminalPoint(!1)];null!=pa.points&&(va=va.concat(pa.points));+for(var Aa=va[0].x,xa=va[0].y,Ma=va[0].x,Wa=va[0].y,Za=1;Za<va.length;Za++)Aa=Math.min(Aa,va[Za].x),xa=Math.min(xa,va[Za].y),Ma=Math.max(Ma,va[Za].x),Wa=Math.max(Wa,va[Za].y);var pb=(Aa+Ma)/2,rb=(xa+Wa)/2;for(Za=0;Za<va.length;Za++){var tb=va[Za].x-pb,ob=va[Za].y-rb;va[Za].x=M?pb+ob:pb-ob;va[Za].y=M?rb-tb:rb+tb}N.setGeometry(ma,pa);W.push(ma)}}}}finally{N.endUpdate()}return W};Graph.prototype.stencilHasPlaceholders=function(D){if(null!=D&&null!=D.fgNode)for(D=D.fgNode.firstChild;null!=D;){if("text"==D.nodeName&&"1"==D.getAttribute("placeholders"))return!0;D=D.nextSibling}return!1};var Q=Graph.prototype.processChange;Graph.prototype.processChange=function(D){if(D instanceof mxGeometryChange&&(this.isTableCell(D.cell)||this.isTableRow(D.cell))&&(null==D.previous&&null!=D.geometry||null!=D.previous&&(null==D.previous.equals||!D.previous.equals(D.geometry)))){var M=D.cell;this.isTableCell(M)&&(M=this.model.getParent(M));this.isTableRow(M)&&(M=this.model.getParent(M));var N=this.view.getState(M);null!=N&&null!=N.shape&&(this.view.invalidate(M),N.shape.bounds=null)}Q.apply(this,arguments);D instanceof mxValueChange&&null!=D.cell&&null!=D.cell.value&&"object"==typeof D.cell.value&&this.invalidateDescendantsWithPlaceholders(D.cell)};Graph.prototype.invalidateDescendantsWithPlaceholders=function(D){D=this.model.getDescendants(D);if(0<D.length)for(var M=0;M<D.length;M++){var N=this.view.getState(D[M]);null!=N&&null!=N.shape&&null!=N.shape.stencil&&this.stencilHasPlaceholders(N.shape.stencil)?this.removeStateForCell(D[M]):this.isReplacePlaceholders(D[M])&&this.view.invalidate(D[M],!1,!1)}};Graph.prototype.replaceElement=function(D,M){M=D.ownerDocument.createElement(null!=M?M:"span");for(var N=Array.prototype.slice.call(D.attributes);attr=N.pop();)M.setAttribute(attr.nodeName,attr.nodeValue);M.innerHTML=D.innerHTML;D.parentNode.replaceChild(M,D)};Graph.prototype.processElements=function(D,M){if(null!=D){D=D.getElementsByTagName("*");for(var N=0;N<D.length;N++)null!=D[N]&&M(D[N])}};Graph.prototype.updateLabelElements=-function(D,M,N){D=null!=D?D:this.getSelectionCells();for(var W=document.createElement("div"),ca=0;ca<D.length;ca++){var ma=this.getCurrentCellStyle(D[ca]);if(null!=ma&&"1"==ma.html&&(ma=this.convertValueToString(D[ca]),null!=ma&&0<ma.length)){W.innerHTML=Graph.sanitizeHtml(ma);for(var pa=W.getElementsByTagName(null!=N?N:"*"),ua=0;ua<pa.length;ua++)M(pa[ua]);W.innerHTML!=ma&&this.cellLabelChanged(D[ca],W.innerHTML)}}};Graph.prototype.cellLabelChanged=function(D,M,N){M=Graph.zapGremlins(M);this.model.beginUpdate();+function(D,M,N){D=null!=D?D:this.getSelectionCells();for(var W=document.createElement("div"),ca=0;ca<D.length;ca++){var ma=this.getCurrentCellStyle(D[ca]);if(null!=ma&&"1"==ma.html&&(ma=this.convertValueToString(D[ca]),null!=ma&&0<ma.length)){W.innerHTML=Graph.sanitizeHtml(ma);for(var pa=W.getElementsByTagName(null!=N?N:"*"),va=0;va<pa.length;va++)M(pa[va]);W.innerHTML!=ma&&this.cellLabelChanged(D[ca],W.innerHTML)}}};Graph.prototype.cellLabelChanged=function(D,M,N){M=Graph.zapGremlins(M);this.model.beginUpdate();try{if(null!=D.value&&"object"==typeof D.value){if(this.isReplacePlaceholders(D)&&null!=D.getAttribute("placeholder"))for(var W=D.getAttribute("placeholder"),ca=D;null!=ca;){if(ca==this.model.getRoot()||null!=ca.value&&"object"==typeof ca.value&&ca.hasAttribute(W)){this.setAttributeForCell(ca,W,M);break}ca=this.model.getParent(ca)}var ma=D.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&ma.hasAttribute("label_"+Graph.diagramLanguage)?ma.setAttribute("label_"+Graph.diagramLanguage,M):ma.setAttribute("label",M);M=ma}mxGraph.prototype.cellLabelChanged.apply(this,arguments);this.isAutosizeTextCell(D)&&this.updateAutosizeTextFontSize(D)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(D){if(null!=D){for(var M=new mxDictionary,N=0;N<D.length;N++)M.put(D[N],!0);var W=[];for(N=0;N<D.length;N++){var ca=this.model.getParent(D[N]);null==ca||M.get(ca)||(M.put(ca,!0),W.push(ca))}for(N=0;N<W.length;N++)if(ca=this.view.getState(W[N]),null!=ca&&(this.model.isEdge(ca.cell)||-this.model.isVertex(ca.cell))&&this.isCellDeletable(ca.cell)&&(this.isTransparentState(ca)||this.isTransparentBounds(ca.cell))){for(var ma=!0,pa=0;pa<this.model.getChildCount(ca.cell)&&ma;pa++)M.get(this.model.getChildAt(ca.cell,pa))||(ma=!1);ma&&D.push(ca.cell)}M=new mxDictionary;for(N=0;N<D.length;N++)M.put(D[N],!0);for(N=0;N<W.length;N++)for(ca=W[N];!M.get(ca)&&this.isTransparentBounds(ca);){ma=null;var ua=!1,Aa=this.model.getChildCount(ca);for(pa=0;pa<Aa;pa++){var xa=this.model.getChildAt(ca,-pa);if(!M.get(xa)){if(null!=ma){ua=!0;break}ma=xa}}if(ua||null==ma||!this.isTransparentBounds(ma)||!this.isCellDeletable(ma))break;pa=this.model.getChildren(ma);null!=pa&&0<pa.length&&this.cellsAdded(pa.slice(),ca,this.model.getChildCount(ca),null,null,!0);M.put(ma,!0);D.push(ma)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(D){for(var M=[],N=0;N<D.length;N++)this.isCellDeletable(D[N])&&this.isTransparentState(this.view.getState(D[N]))&&M.push(D[N]);+this.model.isVertex(ca.cell))&&this.isCellDeletable(ca.cell)&&(this.isTransparentState(ca)||this.isTransparentBounds(ca.cell))){for(var ma=!0,pa=0;pa<this.model.getChildCount(ca.cell)&&ma;pa++)M.get(this.model.getChildAt(ca.cell,pa))||(ma=!1);ma&&D.push(ca.cell)}M=new mxDictionary;for(N=0;N<D.length;N++)M.put(D[N],!0);for(N=0;N<W.length;N++)for(ca=W[N];!M.get(ca)&&this.isTransparentBounds(ca);){ma=null;var va=!1,Aa=this.model.getChildCount(ca);for(pa=0;pa<Aa;pa++){var xa=this.model.getChildAt(ca,+pa);if(!M.get(xa)){if(null!=ma){va=!0;break}ma=xa}}if(va||null==ma||!this.isTransparentBounds(ma)||!this.isCellDeletable(ma))break;pa=this.model.getChildren(ma);null!=pa&&0<pa.length&&this.cellsAdded(pa.slice(),ca,this.model.getChildCount(ca),null,null,!0);M.put(ma,!0);D.push(ma)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(D){for(var M=[],N=0;N<D.length;N++)this.isCellDeletable(D[N])&&this.isTransparentState(this.view.getState(D[N]))&&M.push(D[N]);D=M;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(D,M){this.setAttributeForCell(D,"link",M)};Graph.prototype.createLinkOverlay=function(D){var M=this.getLinkForCell(D);if(null!=M&&0<M.length){var N=this.getLinkOverlayTooltip(M);N=new mxCellOverlay(new mxImage(Editor.lightDarkLinkImage,16,16),N,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,new mxPoint(8,-8));N.isLinkOverlay=!0;var W=this;N.addListener(mxEvent.CLICK,mxUtils.bind(this,function(ca,ma){W.isEnabled()?W.setSelectionCell(ma.getProperty("cell")):this.isCustomLink(M)?this.customLinkClicked(M,D):(ca=this.getLinkTargetForCell(D),this.openLink(this.getAbsoluteUrl(M),ca))}));return N}return null};Graph.prototype.getLinkOverlayTooltip=function(D){return D};Graph.prototype.createTooltipOverlay=function(D){D=this.convertValueToTooltip(D);if(null!=D&&0<D.length){D=new mxCellOverlay(new mxImage(Editor.lightDarkTooltipImage,16,16),D,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,new mxPoint(-8,-8));D.isTooltipOverlay=!0;var M=this;D.addListener(mxEvent.CLICK,function(N,W){N=W.getProperty("cell");M.isEnabled()&&M.isCellEditable(N)?(M.setSelectionCell(N),M.editTooltip(N)):(W=W.getProperty("event"),N=M.getTooltipForCell(N),null!=N&&0<N.length&&M.tooltipHandler.show(N,W.clientX,W.clientY))});return D}return null};Graph.prototype.editTooltip=function(D){};Graph.prototype.setTooltipForCell=function(D,M){var N="tooltip";Graph.translateDiagram&&null!=Graph.diagramLanguage&&mxUtils.isNode(D.value)&&@@ -2875,38 +2875,38 @@ return new mxPoint(D,M)};Graph.prototype.getCenterInsertPoint=function(D){D=nullD.width/2)),this.snap(Math.round(this.container.clientHeight/2/this.view.scale-this.view.translate.y-D.height/2)))};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.appendFontSize=function(D,M){D=null!=D?D:"";null!=M&&(0<D.length&&";"!=D.charAt(D.length-1)&&(D+=";"),D+="fontSize="+M+";");return D};Graph.prototype.addText=function(D,M,N){var W=new mxCell;W.value="Text";W.geometry=new mxGeometry(0,0,0,0);W.vertex=!0;if(null!=N&&this.model.isEdge(N.cell)){W.style="edgeLabel;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.edgeFontSize);W.geometry.relative=!0;W.connectable=!1;var ca=this.view.getRelativePoint(N,D,M);W.geometry.x=Math.round(1E4*ca.x)/1E4;W.geometry.y=Math.round(ca.y);W.geometry.offset=new mxPoint(0,0);ca=this.view.getPoint(N,W.geometry);var ma=this.view.scale;W.geometry.offset=new mxPoint(Math.round((D-ca.x)/ma),Math.round((M-ca.y)/ma))}else ca=this.view.translate,W.style="text;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.vertexFontSize),W.geometry.width=40,W.geometry.height=20,W.geometry.x=Math.round(D/this.view.scale)-ca.x-(null!=N?N.origin.x:0),W.geometry.y=Math.round(M/this.view.scale)-ca.y-(null!=N?N.origin.y:0),W.style+="autosize=1;";this.getModel().beginUpdate();try{this.addCells([W],null!=N?N.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[W])),this.autoSizeCell(W)}finally{this.getModel().endUpdate()}return W};Graph.prototype.addClickHandler=function(D,M,N){var W=mxUtils.bind(this,-function(){var Aa=this.container.getElementsByTagName("a");if(null!=Aa)for(var xa=0;xa<Aa.length;xa++){var Ma=this.getAbsoluteUrl(Aa[xa].getAttribute("href"));null!=Ma&&(Aa[xa].setAttribute("rel",this.linkRelation),Aa[xa].setAttribute("href",Ma),null!=M&&mxEvent.addGestureListeners(Aa[xa],null,null,M))}});this.model.addListener(mxEvent.CHANGE,W);W();var ca=this.container.style.cursor,ma=this.getTolerance(),pa=this,ua={currentState:null,currentLink:null,currentTarget:null,highlight:null!=D&&""!=D&&+function(){var Aa=this.container.getElementsByTagName("a");if(null!=Aa)for(var xa=0;xa<Aa.length;xa++){var Ma=this.getAbsoluteUrl(Aa[xa].getAttribute("href"));null!=Ma&&(Aa[xa].setAttribute("rel",this.linkRelation),Aa[xa].setAttribute("href",Ma),null!=M&&mxEvent.addGestureListeners(Aa[xa],null,null,M))}});this.model.addListener(mxEvent.CHANGE,W);W();var ca=this.container.style.cursor,ma=this.getTolerance(),pa=this,va={currentState:null,currentLink:null,currentTarget:null,highlight:null!=D&&""!=D&&D!=mxConstants.NONE?new mxCellHighlight(pa,D,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(Aa){var xa=Aa.sourceState;if(null==xa||null==pa.getLinkForCell(xa.cell))Aa=pa.getCellAt(Aa.getGraphX(),Aa.getGraphY(),null,null,null,function(Ma,Wa,Za){return null==pa.getLinkForCell(Ma.cell)}),xa=null==xa||pa.model.isAncestor(Aa,xa.cell)?pa.view.getState(Aa):null;xa!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=xa,null!=this.currentState&&this.activate(this.currentState))},mouseDown:function(Aa,xa){this.startX=xa.getGraphX();this.startY=xa.getGraphY();this.scrollLeft=pa.container.scrollLeft;this.scrollTop=pa.container.scrollTop;null==this.currentLink&&"auto"==pa.container.style.overflow&&(pa.container.style.cursor="move");this.updateCurrentState(xa)},mouseMove:function(Aa,xa){if(pa.isMouseDown)null!=this.currentLink&&(Aa=Math.abs(this.startX-xa.getGraphX()),xa=Math.abs(this.startY-xa.getGraphY()),(Aa>ma||xa>ma)&&this.clear());else{for(Aa=xa.getSource();null!=Aa&&"a"!=Aa.nodeName.toLowerCase();)Aa=Aa.parentNode;null!=Aa?this.clear():(null!=pa.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&pa.tooltipHandler.reset(xa,!0,this.currentState),(null==this.currentState||xa.getState()!=this.currentState&&null!=xa.sourceState||!pa.intersects(this.currentState,xa.getGraphX(),xa.getGraphY()))&&this.updateCurrentState(xa))}},mouseUp:function(Aa,xa){var Ma=xa.getSource();for(Aa=xa.getEvent();null!=Ma&&"a"!=Ma.nodeName.toLowerCase();)Ma=Ma.parentNode;null==Ma&&Math.abs(this.scrollLeft-pa.container.scrollLeft)<ma&&Math.abs(this.scrollTop-pa.container.scrollTop)<ma&&(null==xa.sourceState||!xa.isSource(xa.sourceState.control))&&((mxEvent.isLeftMouseButton(Aa)||mxEvent.isMiddleMouseButton(Aa))&&!mxEvent.isPopupTrigger(Aa)||mxEvent.isTouchEvent(Aa))&&(null!=this.currentLink?(Ma=pa.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&Ma||null==M||M(Aa,this.currentLink,null!=this.currentState?this.currentState.cell:null),mxEvent.isConsumed(Aa)||(Aa=null!=this.currentTarget?this.currentTarget:mxEvent.isMiddleMouseButton(Aa)?"_blank":Ma?pa.linkTarget:"_top",pa.openLink(this.currentLink,Aa),xa.consume())):null!=N&&!xa.isConsumed()&&Math.abs(this.scrollLeft-pa.container.scrollLeft)<ma&&Math.abs(this.scrollTop-pa.container.scrollTop)<ma&&Math.abs(this.startX-xa.getGraphX())<ma&&Math.abs(this.startY-xa.getGraphY())<ma&&N(xa.getEvent()));this.clear()},activate:function(Aa){this.currentLink=pa.getAbsoluteUrl(pa.getLinkForCell(Aa.cell));null!=this.currentLink&&-(this.currentTarget=pa.getLinkTargetForCell(Aa.cell),pa.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(Aa))},clear:function(){null!=pa.container&&(pa.container.style.cursor=ca);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=pa.tooltipHandler&&pa.tooltipHandler.hide()}};pa.click=function(Aa){};pa.addMouseListener(ua);mxEvent.addListener(document,"mouseleave",function(Aa){ua.clear()})};Graph.prototype.duplicateCells=-function(D,M){D=null!=D?D:this.getSelectionCells();M=null!=M?M:!0;for(var N=0;N<D.length;N++)this.isTableCell(D[N])&&(D[N]=this.model.getParent(D[N]));D=this.model.getTopmostCells(D);var W=this.getModel(),ca=this.gridSize,ma=[];W.beginUpdate();try{var pa={},ua=this.createCellLookup(D),Aa=this.cloneCells(D,!1,pa,!0);for(N=0;N<D.length;N++){var xa=W.getParent(D[N]);if(null!=xa){var Ma=this.moveCells([Aa[N]],ca,ca,!1)[0];ma.push(Ma);if(M)W.add(xa,Aa[N]);else{var Wa=xa.getIndex(D[N]);W.add(xa,Aa[N],Wa+-1)}if(this.isTable(xa)){var Za=this.getCellGeometry(Aa[N]),pb=this.getCellGeometry(xa);null!=Za&&null!=pb&&(pb=pb.clone(),pb.height+=Za.height,W.setGeometry(xa,pb))}}else ma.push(Aa[N])}this.updateCustomLinks(this.createCellMapping(pa,ua),Aa,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",Aa))}finally{W.endUpdate()}return ma};Graph.prototype.insertImage=function(D,M,N){if(null!=D&&null!=this.cellEditor.textarea){for(var W=this.cellEditor.textarea.getElementsByTagName("img"),ca=+(this.currentTarget=pa.getLinkTargetForCell(Aa.cell),pa.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(Aa))},clear:function(){null!=pa.container&&(pa.container.style.cursor=ca);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=pa.tooltipHandler&&pa.tooltipHandler.hide()}};pa.click=function(Aa){};pa.addMouseListener(va);mxEvent.addListener(document,"mouseleave",function(Aa){va.clear()})};Graph.prototype.duplicateCells=+function(D,M){D=null!=D?D:this.getSelectionCells();M=null!=M?M:!0;for(var N=0;N<D.length;N++)this.isTableCell(D[N])&&(D[N]=this.model.getParent(D[N]));D=this.model.getTopmostCells(D);var W=this.getModel(),ca=this.gridSize,ma=[];W.beginUpdate();try{var pa={},va=this.createCellLookup(D),Aa=this.cloneCells(D,!1,pa,!0);for(N=0;N<D.length;N++){var xa=W.getParent(D[N]);if(null!=xa){var Ma=this.moveCells([Aa[N]],ca,ca,!1)[0];ma.push(Ma);if(M)W.add(xa,Aa[N]);else{var Wa=xa.getIndex(D[N]);W.add(xa,Aa[N],Wa++1)}if(this.isTable(xa)){var Za=this.getCellGeometry(Aa[N]),pb=this.getCellGeometry(xa);null!=Za&&null!=pb&&(pb=pb.clone(),pb.height+=Za.height,W.setGeometry(xa,pb))}}else ma.push(Aa[N])}this.updateCustomLinks(this.createCellMapping(pa,va),Aa,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",Aa))}finally{W.endUpdate()}return ma};Graph.prototype.insertImage=function(D,M,N){if(null!=D&&null!=this.cellEditor.textarea){for(var W=this.cellEditor.textarea.getElementsByTagName("img"),ca=[],ma=0;ma<W.length;ma++)ca.push(W[ma]);document.execCommand("insertimage",!1,D);D=this.cellEditor.textarea.getElementsByTagName("img");if(D.length==ca.length+1)for(ma=D.length-1;0<=ma;ma--)if(0==ma||D[ma]!=ca[ma-1]){D[ma].setAttribute("width",M);D[ma].setAttribute("height",N);break}}};Graph.prototype.insertLink=function(D){if(null!=this.cellEditor.textarea)if(0==D.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var M=this.cellEditor.textarea.getElementsByTagName("a"),N=[],W=0;W<M.length;W++)N.push(M[W]);document.execCommand("createlink",!1,mxUtils.trim(D));M=this.cellEditor.textarea.getElementsByTagName("a");if(M.length==N.length+1)for(W=M.length-1;0<=W;W--)if(M[W]!=N[W-1]){for(M=M[W].getElementsByTagName("a");0<M.length;){for(N=M[0].parentNode;null!=M[0].firstChild;)N.insertBefore(M[0].firstChild,M[0]);N.removeChild(M[0])}break}}else document.execCommand("createlink",!1,mxUtils.trim(D))};var K=Graph.prototype.getResizableCells;Graph.prototype.getResizableCells=function(D){var M=K.apply(this,arguments);if(null!=D)for(var N=0;N<D.length;N++)(this.isTransparentBounds(D[N])||this.getCurrentCellStyle(D[N])[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE)&&0>mxUtils.indexOf(M,D[N])&&M.push(D[N]);return M};Graph.prototype.isCellResizable=function(D){if(this.isTransparentBounds(D))return!1;var M=mxGraph.prototype.isCellResizable.apply(this,arguments),N=this.getCurrentCellStyle(D);return!this.isTableCell(D)&&!this.isTableRow(D)&&(M||"0"!=mxUtils.getValue(N,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==N[mxConstants.STYLE_WHITE_SPACE])};Graph.prototype.alignCells=function(D,M,N){null==M&&(M=this.getMovableCells(this.getSelectionCells()));var W=!1;if(null!=M)for(var ca=0;ca<M.length;ca++)if(this.isTransparentBounds(M[ca])){W=!0;break}if(!W)return mxGraph.prototype.alignCells.apply(this,arguments);var ma=this;W=function(Ma){if(ma.model.isEdge(Ma))return null;var Wa=ma.getCellGeometry(Ma);if(null==Wa||Wa.relative)return null;var Za=ma.getOriginForCell(Ma);return ma.isTransparentBounds(Ma)?(Ma=ma.getTransparentBounds(Ma),null==Ma?null:new mxRectangle(Za.x+Wa.x+Ma.x,Za.y+Wa.y+Ma.y,Ma.width,Ma.height)):new mxRectangle(Za.x+Wa.x,Za.y+Wa.y,Wa.width,Wa.height)};if(null!=M&&1<M.length){if(null==N)for(ca=0;ca<M.length;ca++){var pa=W(M[ca]);if(null!=pa)if(null==N)if(D==mxConstants.ALIGN_CENTER){N=pa.x+pa.width/2;break}else if(D==mxConstants.ALIGN_RIGHT)N=pa.x+pa.width;else if(D==mxConstants.ALIGN_TOP)N=pa.y;else if(D==mxConstants.ALIGN_MIDDLE){N=pa.y+pa.height/2;break}else N=D==mxConstants.ALIGN_BOTTOM?-pa.y+pa.height:pa.x;else N=D==mxConstants.ALIGN_RIGHT?Math.max(N,pa.x+pa.width):D==mxConstants.ALIGN_TOP?Math.min(N,pa.y):D==mxConstants.ALIGN_BOTTOM?Math.max(N,pa.y+pa.height):Math.min(N,pa.x)}if(null!=N){M=mxUtils.sortCells(M);this.model.beginUpdate();try{for(ca=0;ca<M.length;ca++)if(pa=W(M[ca]),null!=pa){var ua=0,Aa=0;D==mxConstants.ALIGN_CENTER?ua=N-(pa.x+pa.width/2):D==mxConstants.ALIGN_RIGHT?ua=N-(pa.x+pa.width):D==mxConstants.ALIGN_TOP?Aa=N-pa.y:D==mxConstants.ALIGN_MIDDLE?Aa=N-(pa.y+pa.height/-2):D==mxConstants.ALIGN_BOTTOM?Aa=N-(pa.y+pa.height):ua=N-pa.x;if(0!=ua||0!=Aa)if(this.isTransparentBounds(M[ca]))this.translateCell(M[ca],ua,Aa);else{var xa=this.getCellGeometry(M[ca]).clone();xa.x+=ua;xa.y+=Aa;this.resizeCell(M[ca],xa)}}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",D,"cells",M))}finally{this.model.endUpdate()}}}return M};Graph.prototype.distributeCells=function(D,M,N){null==M&&(M=this.getSelectionCells());if(null!=M&&1<M.length){for(var W=[],ca=null,ma=null,pa=0,-ua=0;ua<M.length;ua++)if(this.getModel().isVertex(M[ua])){var Aa=this.view.getState(M[ua]);if(null!=Aa){var xa=D?Aa.getCenterX():Aa.getCenterY();ca=null!=ca?Math.max(ca,xa):xa;ma=null!=ma?Math.min(ma,xa):xa;N&&(pa+=D?Aa.width:Aa.height);W.push(Aa)}}if(2<W.length){W.sort(function(tb,ob){return D?tb.x-ob.x:tb.y-ob.y});N&&(pa-=D?W[0].width/2+W[W.length-1].width/2:W[0].height/2+W[W.length-1].height/2);Aa=this.view.translate;xa=this.view.scale;ma=ma/xa-(D?Aa.x:Aa.y);ca=ca/xa-(D?Aa.x:Aa.y);this.getModel().beginUpdate();-try{var Ma=(ca-ma-pa)/(W.length-1),Wa=ma+(N?D?W[0].width/2:W[0].height/2:0);for(ua=1;ua<W.length-1;ua++){var Za=this.view.getState(this.model.getParent(W[ua].cell)),pb=this.getCellGeometry(W[ua].cell);Wa+=Ma;if(null!=pb&&null!=Za)if(this.isTransparentBounds(W[ua].cell)){var rb=D?N?W[ua].x/xa-Aa.x:W[ua].getCenterX()/xa-Aa.x:N?W[ua].y/xa-Aa.y:W[ua].getCenterY()/xa-Aa.y;D?this.translateCell(W[ua].cell,Wa-rb,0):this.translateCell(W[ua].cell,0,Wa-rb)}else pb=pb.clone(),D?pb.x=Math.round(Wa-(N?0:pb.width/-2))-Za.origin.x:pb.y=Math.round(Wa-(N?0:pb.height/2))-Za.origin.y,this.getModel().setGeometry(W[ua].cell,pb);N&&(Wa+=D?W[ua].width:W[ua].height)}}finally{this.getModel().endUpdate()}}}return M};Graph.prototype.isCloneEvent=function(D){return mxClient.IS_MAC&&mxEvent.isMetaDown(D)||mxEvent.isControlDown(D)};Graph.prototype.createSvgImageExport=function(D,M){D=new mxImageExport;D.addCellData=function(W,ca,ma){ca.setAttribute("data-cell-id",W.id);if(ma)if(mxUtils.isNode(W.value))for(ma=0;ma<W.value.attributes.length;ma++){var pa=-W.value.attributes[ma];ca.setAttribute("data-cell-"+pa.name,pa.value)}else if("object"===typeof W.value)for(pa in W.value)ca.setAttribute("data-cell-"+pa,W.value[pa]);else null!=W.value&&ca.setAttribute("data-cell-value",W.value);if(M&&mxUtils.isNode(W.value))for(ma=0;ma<W.value.attributes.length;ma++)pa=W.value.attributes[ma],ca.setAttribute("data-meta-"+pa.name,pa.value);return ca};var N=D.visitStatesRecursive;D.visitStatesRecursive=function(W,ca,ma){if(null!=W){var pa=ca.root,ua=ca.root.ownerDocument;-ca.root=this.addCellData(W.cell,null!=ua.createElementNS?ua.createElementNS(mxConstants.NS_SVG,"g"):ua.createElement("g"),Editor.addSvgMetadata);pa.appendChild(ca.root);N.apply(this,arguments);ca.root=pa}};D.getLinkForCellState=mxUtils.bind(this,function(W,ca){return this.getLinkForCell(W.cell)});D.getTitleForCellState=mxUtils.bind(this,function(W,ca){return Editor.convertHtmlToText(this.convertValueToTooltip(W.cell))});return D};Graph.prototype.parseBackgroundImage=function(D){var M=null;null!=D&&-0<D.length&&(D=JSON.parse(D),M=new mxImage(D.src,D.width,D.height));return M};Graph.prototype.getBackgroundImageObject=function(D){return D};Graph.prototype.getSvg=function(D,M,N,W,ca,ma,pa,ua,Aa,xa,Ma,Wa,Za,pb,rb,tb,ob){var cb=null;if(null!=pb){cb=new mxDictionary;for(var fb=0;fb<pb.length;fb++)cb.put(pb[fb],!0)}ca=this.useCssTransforms;var Xa=this.enableFlowAnimation;this.enableFlowAnimation=!1;ca&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{M=null!=M?M:1;N=null!=+pa.y+pa.height:pa.x;else N=D==mxConstants.ALIGN_RIGHT?Math.max(N,pa.x+pa.width):D==mxConstants.ALIGN_TOP?Math.min(N,pa.y):D==mxConstants.ALIGN_BOTTOM?Math.max(N,pa.y+pa.height):Math.min(N,pa.x)}if(null!=N){M=mxUtils.sortCells(M);this.model.beginUpdate();try{for(ca=0;ca<M.length;ca++)if(pa=W(M[ca]),null!=pa){var va=0,Aa=0;D==mxConstants.ALIGN_CENTER?va=N-(pa.x+pa.width/2):D==mxConstants.ALIGN_RIGHT?va=N-(pa.x+pa.width):D==mxConstants.ALIGN_TOP?Aa=N-pa.y:D==mxConstants.ALIGN_MIDDLE?Aa=N-(pa.y+pa.height/+2):D==mxConstants.ALIGN_BOTTOM?Aa=N-(pa.y+pa.height):va=N-pa.x;if(0!=va||0!=Aa)if(this.isTransparentBounds(M[ca]))this.translateCell(M[ca],va,Aa);else{var xa=this.getCellGeometry(M[ca]).clone();xa.x+=va;xa.y+=Aa;this.resizeCell(M[ca],xa)}}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",D,"cells",M))}finally{this.model.endUpdate()}}}return M};Graph.prototype.distributeCells=function(D,M,N){null==M&&(M=this.getSelectionCells());if(null!=M&&1<M.length){for(var W=[],ca=null,ma=null,pa=0,+va=0;va<M.length;va++)if(this.getModel().isVertex(M[va])){var Aa=this.view.getState(M[va]);if(null!=Aa){var xa=D?Aa.getCenterX():Aa.getCenterY();ca=null!=ca?Math.max(ca,xa):xa;ma=null!=ma?Math.min(ma,xa):xa;N&&(pa+=D?Aa.width:Aa.height);W.push(Aa)}}if(2<W.length){W.sort(function(tb,ob){return D?tb.x-ob.x:tb.y-ob.y});N&&(pa-=D?W[0].width/2+W[W.length-1].width/2:W[0].height/2+W[W.length-1].height/2);Aa=this.view.translate;xa=this.view.scale;ma=ma/xa-(D?Aa.x:Aa.y);ca=ca/xa-(D?Aa.x:Aa.y);this.getModel().beginUpdate();+try{var Ma=(ca-ma-pa)/(W.length-1),Wa=ma+(N?D?W[0].width/2:W[0].height/2:0);for(va=1;va<W.length-1;va++){var Za=this.view.getState(this.model.getParent(W[va].cell)),pb=this.getCellGeometry(W[va].cell);Wa+=Ma;if(null!=pb&&null!=Za)if(this.isTransparentBounds(W[va].cell)){var rb=D?N?W[va].x/xa-Aa.x:W[va].getCenterX()/xa-Aa.x:N?W[va].y/xa-Aa.y:W[va].getCenterY()/xa-Aa.y;D?this.translateCell(W[va].cell,Wa-rb,0):this.translateCell(W[va].cell,0,Wa-rb)}else pb=pb.clone(),D?pb.x=Math.round(Wa-(N?0:pb.width/+2))-Za.origin.x:pb.y=Math.round(Wa-(N?0:pb.height/2))-Za.origin.y,this.getModel().setGeometry(W[va].cell,pb);N&&(Wa+=D?W[va].width:W[va].height)}}finally{this.getModel().endUpdate()}}}return M};Graph.prototype.isCloneEvent=function(D){return mxClient.IS_MAC&&mxEvent.isMetaDown(D)||mxEvent.isControlDown(D)};Graph.prototype.createSvgImageExport=function(D,M){D=new mxImageExport;D.addCellData=function(W,ca,ma){ca.setAttribute("data-cell-id",W.id);if(ma)if(mxUtils.isNode(W.value))for(ma=0;ma<W.value.attributes.length;ma++){var pa=+W.value.attributes[ma];ca.setAttribute("data-cell-"+pa.name,pa.value)}else if("object"===typeof W.value)for(pa in W.value)ca.setAttribute("data-cell-"+pa,W.value[pa]);else null!=W.value&&ca.setAttribute("data-cell-value",W.value);if(M&&mxUtils.isNode(W.value))for(ma=0;ma<W.value.attributes.length;ma++)pa=W.value.attributes[ma],ca.setAttribute("data-meta-"+pa.name,pa.value);return ca};var N=D.visitStatesRecursive;D.visitStatesRecursive=function(W,ca,ma){if(null!=W){var pa=ca.root,va=ca.root.ownerDocument;+ca.root=this.addCellData(W.cell,null!=va.createElementNS?va.createElementNS(mxConstants.NS_SVG,"g"):va.createElement("g"),Editor.addSvgMetadata);pa.appendChild(ca.root);N.apply(this,arguments);ca.root=pa}};D.getLinkForCellState=mxUtils.bind(this,function(W,ca){return this.getLinkForCell(W.cell)});D.getTitleForCellState=mxUtils.bind(this,function(W,ca){return Editor.convertHtmlToText(this.convertValueToTooltip(W.cell))});return D};Graph.prototype.parseBackgroundImage=function(D){var M=null;null!=D&&+0<D.length&&(D=JSON.parse(D),M=new mxImage(D.src,D.width,D.height));return M};Graph.prototype.getBackgroundImageObject=function(D){return D};Graph.prototype.getSvg=function(D,M,N,W,ca,ma,pa,va,Aa,xa,Ma,Wa,Za,pb,rb,tb,ob){var cb=null;if(null!=pb){cb=new mxDictionary;for(var fb=0;fb<pb.length;fb++)cb.put(pb[fb],!0)}ca=this.useCssTransforms;var Xa=this.enableFlowAnimation;this.enableFlowAnimation=!1;ca&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{M=null!=M?M:1;N=null!=N?N:0;ma=null!=ma?ma:!0;pa=null!=pa?pa:!0;xa=null!=xa?xa:!1;Aa=null!=Aa?Aa:this.defaultExportLinkTarget;var wb="page"==Za?this.view.getBackgroundPageBounds():ma&&null==cb||W||"diagram"==Za?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),sb=this.backgroundImage,qb=this.view.translate,zb=this.view.scale;"diagram"==Za&&null!=sb&&null!=sb.width&&null!=sb.height&&(wb=mxRectangle.fromRectangle(wb),wb.add(new mxRectangle((qb.x+sb.x)*zb,(qb.y+sb.y)*zb,sb.width*zb,sb.height*zb)));if(null==wb)throw Error(mxResources.get("drawingEmpty"));W=M/zb;var Fb=Math.max(1,Math.ceil(wb.width*W)+2*N)+(xa&&0==N?5:0),Jb=Math.max(1,Math.ceil(wb.height*W)+2*N)+(xa&&0==N?5:0),vb=mxUtils.getLightDarkColor(D),Eb=Graph.createSvgNode(0,0,Fb,Jb,vb),Ib=Eb.ownerDocument;if(null!=D){var Db=mxUtils.createElementNs(Ib,mxConstants.NS_SVG,"rect");Db.setAttribute("fill",vb.light);Db.style.fill=vb.cssText;Db.setAttribute("width","100%");Db.setAttribute("height","100%");Db.setAttribute("x","0");Db.setAttribute("y","0");Eb.appendChild(Db)}var Lb=mxUtils.createElementNs(Ib,mxConstants.NS_SVG,"g");Eb.appendChild(Lb);var Hb=this.createSvgCanvas(Lb),bc=Math.floor(N/M-wb.x/zb),Zb=Math.floor(N/M-wb.y/zb);Hb.translate(bc,Zb);Hb.idPrefix="drawio-svg-"+Editor.guid();if(ob){var $b=this.gridSize*M,Sb=this.view.gridSteps*$b;D=[];for(fb=1;fb<this.view.gridSteps;fb++)N=fb*$b,D.push("M 0 "+N+" L "+Sb+" "+N+" M "+N+" 0 L "+N+" "+Sb);var ac=mxUtils.getLightDarkColor(this.view.gridColor),Rb=mxUtils.createElementNs(Ib,mxConstants.NS_SVG,"pattern");Rb.setAttribute("id",Hb.idPrefix+"-grid");Rb.setAttribute("patternUnits","userSpaceOnUse");Rb.setAttribute("width",Sb);Rb.setAttribute("height",Sb);Rb.setAttribute("x",mxUtils.mod((qb.x+bc)*M,Sb));Rb.setAttribute("y",mxUtils.mod((qb.y+Zb)*M,Sb));if(0<D.length){var g=mxUtils.createElementNs(Ib,mxConstants.NS_SVG,"path");g.setAttribute("d",D.join(" "));g.setAttribute("fill","none");g.setAttribute("stroke",ac.light);g.style.stroke=ac.cssText;g.setAttribute("opacity","0.2");g.setAttribute("stroke-width",-M);Rb.appendChild(g)}var r=mxUtils.createElementNs(Ib,mxConstants.NS_SVG,"path");r.setAttribute("d","M "+Sb+" 0 L 0 0 0 "+Sb);r.setAttribute("fill","none");r.setAttribute("stroke",ac.light);r.style.stroke=ac.cssText;r.setAttribute("stroke-width",M);Rb.appendChild(r);Hb.defs.appendChild(Rb);var A=mxUtils.createElementNs(Ib,mxConstants.NS_SVG,"rect");A.setAttribute("width","100%");A.setAttribute("height","100%");A.setAttribute("fill","url(#"+Rb.getAttribute("id")+")");Eb.insertBefore(A,Lb)}var u=document.createElement("div"),-z=Hb.getAlternateText;Hb.getAlternateText=function(Ia,mb,$a,Ea,Ga,Ja,Pa,eb,hb,ib,kb,dc,ec){if(null!=Ja&&0<this.state.fontSize)try{return mxUtils.isNode(Ja)?Ja=Ja.innerText:(u.innerHTML=Ja,Ja=mxUtils.extractTextWithWhitespace(u.childNodes)),Ja}catch(cc){return z.apply(this,arguments)}else return z.apply(this,arguments)};if(null!=sb&&null!=sb.width&&null!=sb.height){fb=zb/M;var F=new mxRectangle((sb.x+qb.x)*fb,(sb.y+qb.y)*fb,sb.width*fb,sb.height*fb);mxUtils.intersects(wb,F)&&Hb.image(sb.x+qb.x,sb.y+-qb.y,sb.width,sb.height,sb.src,!0)}Hb.scale(W);Hb.textEnabled=pa;ua=null!=ua?ua:this.createSvgImageExport();var I=ua.getLinkForCellState;ua.getLinkForCellState=function(Ia,mb){var $a=Ia.view.graph.getAbsoluteUrl(I.apply(this,arguments));return null==$a||Ia.view.graph.isCustomLink($a)?null:$a};ua.getLinkTargetForCellState=function(Ia,mb){return Ia.view.graph.getLinkTargetForCell(Ia.cell)};var ea=ua.drawCellState,S=null,ta=mxUtils.bind(this,function(){if(null==S){S="ge-flow-animation-"+Editor.guid();-var Ia=null!=Ib.createElementNS?Ib.createElementNS(mxConstants.NS_SVG,"style"):Ib.createElement("style");Ia.innerHTML=this.createFlowAnimationCss(S);Ib.getElementsByTagName("defs")[0].appendChild(Ia)}return S});ua.drawCellState=function(Ia,mb){for(var $a=Ia.view.graph,Ea=null!=cb?cb.get(Ia.cell):$a.isCellSelected(Ia.cell),Ga=$a.model.getParent(Ia.cell);!(ma&&null==cb||Ea)&&null!=Ga;)Ea=null!=cb?cb.get(Ga):$a.isCellSelected(Ga),Ga=$a.model.getParent(Ga);if(null!=Ia.shape)try{var Ja=Ia.shape.isFlowAnimationEnabled,+M);Rb.appendChild(g)}var r=mxUtils.createElementNs(Ib,mxConstants.NS_SVG,"path");r.setAttribute("d","M "+Sb+" 0 L 0 0 0 "+Sb);r.setAttribute("fill","none");r.setAttribute("stroke",ac.light);r.style.stroke=ac.cssText;r.setAttribute("stroke-width",M);Rb.appendChild(r);Hb.defs.appendChild(Rb);var A=mxUtils.createElementNs(Ib,mxConstants.NS_SVG,"rect");A.setAttribute("width","100%");A.setAttribute("height","100%");A.setAttribute("fill","url(#"+Rb.getAttribute("id")+")");Eb.insertBefore(A,Lb)}var v=document.createElement("div"),+z=Hb.getAlternateText;Hb.getAlternateText=function(Ia,mb,$a,Ea,Ga,Ja,Pa,eb,hb,ib,kb,dc,ec){if(null!=Ja&&0<this.state.fontSize)try{return mxUtils.isNode(Ja)?Ja=Ja.innerText:(v.innerHTML=Ja,Ja=mxUtils.extractTextWithWhitespace(v.childNodes)),Ja}catch(cc){return z.apply(this,arguments)}else return z.apply(this,arguments)};if(null!=sb&&null!=sb.width&&null!=sb.height){fb=zb/M;var F=new mxRectangle((sb.x+qb.x)*fb,(sb.y+qb.y)*fb,sb.width*fb,sb.height*fb);mxUtils.intersects(wb,F)&&Hb.image(sb.x+qb.x,sb.y++qb.y,sb.width,sb.height,sb.src,!0)}Hb.scale(W);Hb.textEnabled=pa;va=null!=va?va:this.createSvgImageExport();var I=va.getLinkForCellState;va.getLinkForCellState=function(Ia,mb){var $a=Ia.view.graph.getAbsoluteUrl(I.apply(this,arguments));return null==$a||Ia.view.graph.isCustomLink($a)?null:$a};va.getLinkTargetForCellState=function(Ia,mb){return Ia.view.graph.getLinkTargetForCell(Ia.cell)};var ea=va.drawCellState,S=null,ta=mxUtils.bind(this,function(){if(null==S){S="ge-flow-animation-"+Editor.guid();+var Ia=null!=Ib.createElementNS?Ib.createElementNS(mxConstants.NS_SVG,"style"):Ib.createElement("style");Ia.innerHTML=this.createFlowAnimationCss(S);Ib.getElementsByTagName("defs")[0].appendChild(Ia)}return S});va.drawCellState=function(Ia,mb){for(var $a=Ia.view.graph,Ea=null!=cb?cb.get(Ia.cell):$a.isCellSelected(Ia.cell),Ga=$a.model.getParent(Ia.cell);!(ma&&null==cb||Ea)&&null!=Ga;)Ea=null!=cb?cb.get(Ga):$a.isCellSelected(Ga),Ga=$a.model.getParent(Ga);if(null!=Ia.shape)try{var Ja=Ia.shape.isFlowAnimationEnabled,Pa=Ia.shape.addFlowAnimationToShape;Ia.shape.isFlowAnimationEnabled=function(){return Xa&&$a.model.isEdge(Ia.cell)&&"1"==mxUtils.getValue(Ia.style,"flowAnimation","0")};Ia.shape.addFlowAnimationToShape=function(){$a.addFlowAnimationToNode(this.getFlowAnimationPath(),Ia.style,M,ta())};if(ma&&null==cb||Ea)$a.view.redrawEnumerationState(Ia),ea.apply(this,arguments),this.doDrawShape(Ia.secondLabel,mb)}finally{Ia.shape.isFlowAnimationEnabled=Ja,Ia.shape.addFlowAnimationToShape=Pa}};var oa=null!=this.view.currentRoot?-this.view.currentRoot:this.model.root;ua.drawState(this.getView().getState(oa),Hb);this.addForeignObjectWarning(Hb,Eb);Graph.inlineSingleUseImages(Eb);Graph.replaceFontElements(Eb);Graph.addAdaptiveColors(Eb,this.shapeBackgroundColor);tb?this.disableSvgLinks(Eb):this.updateSvgLinks(Eb,Aa,!0);return Eb}finally{this.enableFlowAnimation=Xa,ca&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(D,M){if("0"!=urlParams["svg-warning"]&&+this.view.currentRoot:this.model.root;va.drawState(this.getView().getState(oa),Hb);this.addForeignObjectWarning(Hb,Eb);Graph.inlineSingleUseImages(Eb);Graph.replaceFontElements(Eb);Graph.addAdaptiveColors(Eb,this.shapeBackgroundColor);tb?this.disableSvgLinks(Eb):this.updateSvgLinks(Eb,Aa,!0);return Eb}finally{this.enableFlowAnimation=Xa,ca&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(D,M){if("0"!=urlParams["svg-warning"]&&0<M.getElementsByTagName("foreignObject").length){var N=D.createElement("switch"),W=D.createElement("g");W.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var ca=D.createElement("a");ca.setAttribute("transform","translate(0,-5)");null==ca.setAttributeNS||M.ownerDocument!=document&&null==document.documentMode?(ca.setAttribute("xlink:href",Graph.foreignObjectWarningLink),ca.setAttribute("target","_blank")):(ca.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Graph.foreignObjectWarningLink),ca.setAttributeNS(mxConstants.NS_XLINK,"target","_blank"));D=D.createElement("text");D.setAttribute("text-anchor","middle");D.setAttribute("font-size","10px");D.setAttribute("x","50%");D.setAttribute("y","100%");mxUtils.write(D,Graph.foreignObjectWarningText);N.appendChild(W);ca.appendChild(D);N.appendChild(ca);M.appendChild(N)}};Graph.prototype.disableSvgLinks=function(D,M){D=D.getElementsByTagName("a");for(var N=0;N<D.length;N++){var W=D[N].getAttribute("href");null==W&&(W=D[N].getAttribute("xlink:href"));null!=W&&(D[N].style.pointerEvents="none",D[N].setAttribute("href",""));M&&M(D[N])}};Graph.prototype.updateSvgLinks=function(D,M,N){D=D.getElementsByTagName("a");for(var W=0;W<D.length;W++)if(null==D[W].getAttribute("target")){var ca=D[W].getAttribute("href");null==ca&&(ca=D[W].getAttribute("xlink:href"));null!=ca&&(null!=M&&/^https?:\/\//.test(ca)?D[W].setAttribute("target",M):N&&this.isCustomLink(ca)&&D[W].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(D){D=@@ -2915,45 +2915,45 @@ new mxSvgCanvas2D(D);D.minStrokeWidth=this.cellRenderer.minSvgStrokeWidth;D.adapD=D.parentNode}return D};Graph.prototype.selectNode=function(D){var M=null;if(window.getSelection){if(M=window.getSelection(),M.getRangeAt&&M.rangeCount){var N=document.createRange();N.selectNode(D);M.removeAllRanges();M.addRange(N)}}else(M=document.selection)&&"Control"!=M.type&&(D=M.createRange(),D.collapse(!0),N=M.createRange(),N.setEndPoint("StartToStart",D),N.select())};Graph.prototype.flipEdgePoints=function(D,M,N){var W=this.getCellGeometry(D);if(null!=W){W=W.clone();if(null!=W.points)for(var ca=0;ca<W.points.length;ca++)M?W.points[ca].x=N+(N-W.points[ca].x):W.points[ca].y=N+(N-W.points[ca].y);ca=function(ma){null!=ma&&(M?ma.x=N+(N-ma.x):ma.y=N+(N-ma.y))};ca(W.getTerminalPoint(!0));ca(W.getTerminalPoint(!1));this.model.setGeometry(D,W)}};Graph.prototype.flipChildren=function(D,M,N){this.model.beginUpdate();try{for(var W=this.model.getChildCount(D),ca=0;ca<W;ca++){var ma=this.model.getChildAt(D,ca);if(this.model.isEdge(ma))this.flipEdgePoints(ma,M,N);else{var pa=this.getCellGeometry(ma);null!=pa&&(pa=pa.clone(),M?pa.x=N+(N-pa.x-pa.width):pa.y=N+(N-pa.y-pa.height),this.model.setGeometry(ma,pa))}}}finally{this.model.endUpdate()}};Graph.prototype.getConnectionPoint=function(D,M,N){return null!=D&&1==mxUtils.getValue(D.style,"legacyAnchorPoints",1)?this.getLegacyConnectionPoint(D,M,N):mxGraph.prototype.getConnectionPoint.apply(this,arguments)};Graph.prototype.getLegacyConnectionPoint=function(D,M,N){N=null!=N?N:!0;var W=null;if(null!=D&&null!=M.point){var ca=this.view.getPerimeterBounds(D),-ma=new mxPoint(ca.getCenterX(),ca.getCenterY()),pa=D.style[mxConstants.STYLE_DIRECTION],ua=0;null!=pa&&1==mxUtils.getValue(D.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(pa==mxConstants.DIRECTION_NORTH?ua+=270:pa==mxConstants.DIRECTION_WEST?ua+=180:pa==mxConstants.DIRECTION_SOUTH&&(ua+=90),pa!=mxConstants.DIRECTION_NORTH&&pa!=mxConstants.DIRECTION_SOUTH||ca.rotate90());W=this.view.scale;W=new mxPoint(ca.x+M.point.x*ca.width+M.dx*W,ca.y+M.point.y*ca.height+M.dy*W);var Aa=D.style[mxConstants.STYLE_ROTATION]||-0;if(M.perimeter)0!=ua&&(pa=ca=0,90==ua?pa=1:180==ua?ca=-1:270==ua&&(pa=-1),W=mxUtils.getRotatedPoint(W,ca,pa,ma)),W=this.view.getPerimeterPoint(D,W,!1);else if(Aa+=ua,this.getModel().isVertex(D.cell)){ua=1==D.style[mxConstants.STYLE_FLIPH];M=1==D.style[mxConstants.STYLE_FLIPV];null!=D.shape&&null!=D.shape.stencil&&(ua=1==mxUtils.getValue(D.style,"stencilFlipH",0)||ua,M=1==mxUtils.getValue(D.style,"stencilFlipV",0)||M);if(pa==mxConstants.DIRECTION_NORTH||pa==mxConstants.DIRECTION_SOUTH)D=ua,ua=M,-M=D;ua&&(W.x=2*ca.getCenterX()-W.x);M&&(W.y=2*ca.getCenterY()-W.y)}0!=Aa&&null!=W&&(D=mxUtils.toRadians(Aa),ca=Math.cos(D),pa=Math.sin(D),W=mxUtils.getRotatedPoint(W,ca,pa,ma))}N&&null!=W&&(W.x=Math.round(W.x),W.y=Math.round(W.y));return W};Graph.prototype.flipCells=function(D,M){this.model.beginUpdate();try{D=this.model.getTopmostCells(D);for(var N=[],W=0;W<D.length;W++)if(this.model.isEdge(D[W])){var ca=this.view.getState(D[W]);null!=ca&&this.flipEdgePoints(D[W],M,(M?ca.getCenterX():ca.getCenterY())/+ma=new mxPoint(ca.getCenterX(),ca.getCenterY()),pa=D.style[mxConstants.STYLE_DIRECTION],va=0;null!=pa&&1==mxUtils.getValue(D.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(pa==mxConstants.DIRECTION_NORTH?va+=270:pa==mxConstants.DIRECTION_WEST?va+=180:pa==mxConstants.DIRECTION_SOUTH&&(va+=90),pa!=mxConstants.DIRECTION_NORTH&&pa!=mxConstants.DIRECTION_SOUTH||ca.rotate90());W=this.view.scale;W=new mxPoint(ca.x+M.point.x*ca.width+M.dx*W,ca.y+M.point.y*ca.height+M.dy*W);var Aa=D.style[mxConstants.STYLE_ROTATION]||+0;if(M.perimeter)0!=va&&(pa=ca=0,90==va?pa=1:180==va?ca=-1:270==va&&(pa=-1),W=mxUtils.getRotatedPoint(W,ca,pa,ma)),W=this.view.getPerimeterPoint(D,W,!1);else if(Aa+=va,this.getModel().isVertex(D.cell)){va=1==D.style[mxConstants.STYLE_FLIPH];M=1==D.style[mxConstants.STYLE_FLIPV];null!=D.shape&&null!=D.shape.stencil&&(va=1==mxUtils.getValue(D.style,"stencilFlipH",0)||va,M=1==mxUtils.getValue(D.style,"stencilFlipV",0)||M);if(pa==mxConstants.DIRECTION_NORTH||pa==mxConstants.DIRECTION_SOUTH)D=va,va=M,+M=D;va&&(W.x=2*ca.getCenterX()-W.x);M&&(W.y=2*ca.getCenterY()-W.y)}0!=Aa&&null!=W&&(D=mxUtils.toRadians(Aa),ca=Math.cos(D),pa=Math.sin(D),W=mxUtils.getRotatedPoint(W,ca,pa,ma))}N&&null!=W&&(W.x=Math.round(W.x),W.y=Math.round(W.y));return W};Graph.prototype.flipCells=function(D,M){this.model.beginUpdate();try{D=this.model.getTopmostCells(D);for(var N=[],W=0;W<D.length;W++)if(this.model.isEdge(D[W])){var ca=this.view.getState(D[W]);null!=ca&&this.flipEdgePoints(D[W],M,(M?ca.getCenterX():ca.getCenterY())/this.view.scale-(M?ca.origin.x:ca.origin.y)-(M?this.view.translate.x:this.view.translate.y))}else{var ma=this.getCellGeometry(D[W]);null!=ma&&this.flipChildren(D[W],M,M?ma.getCenterX()-ma.x:ma.getCenterY()-ma.y);N.push(D[W])}this.toggleCellStyles(M?mxConstants.STYLE_FLIPH:mxConstants.STYLE_FLIPV,!1,N);this.setCellStyles("legacyAnchorPoints","0",N)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(D,M){var N=null;if(null!=D&&0<D.length){this.model.beginUpdate();try{for(var W=0;W<-D.length;W++){var ca=this.model.getParent(D[W]);if(this.isTable(ca)){var ma=this.getCellGeometry(D[W]),pa=this.getCellGeometry(ca);null!=ma&&null!=pa&&(pa=pa.clone(),pa.height-=ma.height,this.model.setGeometry(ca,pa))}}var ua=this.selectParentAfterDelete?this.model.getParents(D):null;this.removeCells(D,M)}finally{this.model.endUpdate()}if(null!=ua)for(N=[],W=0;W<ua.length;W++)this.model.contains(ua[W])&&(this.model.isVertex(ua[W])||this.model.isEdge(ua[W]))&&N.push(ua[W])}return N};Graph.prototype.insertTableColumn=-function(D,M){var N=this.getModel();N.beginUpdate();try{var W=D,ca=0;if(this.isTableCell(D)){var ma=N.getParent(D);W=N.getParent(ma);ca=mxUtils.indexOf(N.getChildCells(ma,!0),D)}else this.isTableRow(D)?W=N.getParent(D):D=N.getChildCells(W,!0)[0],M||(ca=N.getChildCells(D,!0).length-1);var pa=N.getChildCells(W,!0),ua=Graph.minTableColumnWidth;for(D=0;D<pa.length;D++){var Aa=N.getChildCells(pa[D],!0)[ca],xa=N.cloneCell(Aa,!1);null==xa&&(xa=this.createVertex());var Ma=this.getCellGeometry(xa);xa.value=-null;xa.style=mxUtils.setStyle(mxUtils.setStyle(xa.style,"rowspan",null),"colspan",null);if(null!=Ma){null!=Ma.alternateBounds&&(Ma.width=Ma.alternateBounds.width,Ma.height=Ma.alternateBounds.height,Ma.alternateBounds=null);ua=Ma.width;var Wa=this.getCellGeometry(pa[D]);null!=Wa&&(Ma.height=Wa.height)}N.add(pa[D],xa,ca+(M?0:1))}var Za=this.getCellGeometry(W);null!=Za&&(Za=Za.clone(),Za.width+=ua,N.setGeometry(W,Za))}finally{N.endUpdate()}};Graph.prototype.deleteLane=function(D){var M=this.getModel();+D.length;W++){var ca=this.model.getParent(D[W]);if(this.isTable(ca)){var ma=this.getCellGeometry(D[W]),pa=this.getCellGeometry(ca);null!=ma&&null!=pa&&(pa=pa.clone(),pa.height-=ma.height,this.model.setGeometry(ca,pa))}}var va=this.selectParentAfterDelete?this.model.getParents(D):null;this.removeCells(D,M)}finally{this.model.endUpdate()}if(null!=va)for(N=[],W=0;W<va.length;W++)this.model.contains(va[W])&&(this.model.isVertex(va[W])||this.model.isEdge(va[W]))&&N.push(va[W])}return N};Graph.prototype.insertTableColumn=+function(D,M){var N=this.getModel();N.beginUpdate();try{var W=D,ca=0;if(this.isTableCell(D)){var ma=N.getParent(D);W=N.getParent(ma);ca=mxUtils.indexOf(N.getChildCells(ma,!0),D)}else this.isTableRow(D)?W=N.getParent(D):D=N.getChildCells(W,!0)[0],M||(ca=N.getChildCells(D,!0).length-1);var pa=N.getChildCells(W,!0),va=Graph.minTableColumnWidth;for(D=0;D<pa.length;D++){var Aa=N.getChildCells(pa[D],!0)[ca],xa=N.cloneCell(Aa,!1);null==xa&&(xa=this.createVertex());var Ma=this.getCellGeometry(xa);xa.value=+null;xa.style=mxUtils.setStyle(mxUtils.setStyle(xa.style,"rowspan",null),"colspan",null);if(null!=Ma){null!=Ma.alternateBounds&&(Ma.width=Ma.alternateBounds.width,Ma.height=Ma.alternateBounds.height,Ma.alternateBounds=null);va=Ma.width;var Wa=this.getCellGeometry(pa[D]);null!=Wa&&(Ma.height=Wa.height)}N.add(pa[D],xa,ca+(M?0:1))}var Za=this.getCellGeometry(W);null!=Za&&(Za=Za.clone(),Za.width+=va,N.setGeometry(W,Za))}finally{N.endUpdate()}};Graph.prototype.deleteLane=function(D){var M=this.getModel();M.beginUpdate();try{var N=null;N="stackLayout"==this.getCurrentCellStyle(D).childLayout?D:M.getParent(D);var W=M.getChildCells(N,!0);0==W.length?M.remove(N):(N==D&&(D=W[W.length-1]),M.remove(D))}finally{M.endUpdate()}};Graph.prototype.insertLane=function(D,M){var N=this.getModel();N.beginUpdate();try{var W=null;if("stackLayout"==this.getCurrentCellStyle(D).childLayout){W=D;var ca=N.getChildCells(W,!0);D=ca[M?0:ca.length-1]}else W=N.getParent(D);var ma=W.getIndex(D);D=N.cloneCell(D,!1);D.value=null;-N.add(W,D,ma+(M?0:1))}finally{N.endUpdate()}};Graph.prototype.insertTableRow=function(D,M){var N=this.getModel();N.beginUpdate();try{var W=D,ca=D;if(this.isTableCell(D))ca=N.getParent(D),W=N.getParent(ca);else if(this.isTableRow(D))W=N.getParent(D);else{var ma=N.getChildCells(W,!0);ca=ma[M?0:ma.length-1]}if(null!=ca){var pa=N.getChildCells(ca,!0),ua=W.getIndex(ca);ca=N.cloneCell(ca,!1);ca.value=null;var Aa=this.getCellGeometry(ca);if(null!=Aa){for(ma=0;ma<pa.length;ma++){D=N.cloneCell(pa[ma],!1);-D.value=null;D.style=mxUtils.setStyle(mxUtils.setStyle(D.style,"rowspan",null),"colspan",null);var xa=this.getCellGeometry(D);null!=xa&&(null!=xa.alternateBounds&&(xa.width=xa.alternateBounds.width,xa.height=xa.alternateBounds.height,xa.alternateBounds=null),xa.height=Aa.height);ca.insert(D)}N.add(W,ca,ua+(M?0:1));var Ma=this.getCellGeometry(W);null!=Ma&&(Ma=Ma.clone(),Ma.height+=Aa.height,N.setGeometry(W,Ma))}}else if(Ma=this.getCellGeometry(W),null!=Ma){var Wa=Ma.width;ca=this.createVertex(null,+N.add(W,D,ma+(M?0:1))}finally{N.endUpdate()}};Graph.prototype.insertTableRow=function(D,M){var N=this.getModel();N.beginUpdate();try{var W=D,ca=D;if(this.isTableCell(D))ca=N.getParent(D),W=N.getParent(ca);else if(this.isTableRow(D))W=N.getParent(D);else{var ma=N.getChildCells(W,!0);ca=ma[M?0:ma.length-1]}if(null!=ca){var pa=N.getChildCells(ca,!0),va=W.getIndex(ca);ca=N.cloneCell(ca,!1);ca.value=null;var Aa=this.getCellGeometry(ca);if(null!=Aa){for(ma=0;ma<pa.length;ma++){D=N.cloneCell(pa[ma],!1);+D.value=null;D.style=mxUtils.setStyle(mxUtils.setStyle(D.style,"rowspan",null),"colspan",null);var xa=this.getCellGeometry(D);null!=xa&&(null!=xa.alternateBounds&&(xa.width=xa.alternateBounds.width,xa.height=xa.alternateBounds.height,xa.alternateBounds=null),xa.height=Aa.height);ca.insert(D)}N.add(W,ca,va+(M?0:1));var Ma=this.getCellGeometry(W);null!=Ma&&(Ma=Ma.clone(),Ma.height+=Aa.height,N.setGeometry(W,Ma))}}else if(Ma=this.getCellGeometry(W),null!=Ma){var Wa=Ma.width;ca=this.createVertex(null,null,"",0,0,Wa,40,"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fixedHeader=1;");ca.insert(this.createVertex(null,null,"",0,0,Wa,40,"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;"));N.add(W,ca);Ma=Ma.clone();Ma.height+=40;N.setGeometry(W,-Ma)}}finally{N.endUpdate()}};Graph.prototype.deleteTableColumn=function(D){var M=this.getModel();M.beginUpdate();try{var N=D,W=D;this.isTableCell(D)&&(W=M.getParent(D));this.isTableRow(W)&&(N=M.getParent(W));var ca=M.getChildCells(N,!0);if(0==ca.length)M.remove(N);else{this.isTableRow(W)||(W=ca[0]);var ma=M.getChildCells(W,!0);if(1>=ma.length)M.remove(N);else{var pa=ma.length-1;this.isTableCell(D)&&(pa=mxUtils.indexOf(ma,D));for(W=D=0;W<ca.length;W++){var ua=M.getChildCells(ca[W],!0)[pa];M.remove(ua);-var Aa=this.getCellGeometry(ua);null!=Aa&&(D=Math.max(D,Aa.width))}var xa=this.getCellGeometry(N);null!=xa&&(xa=xa.clone(),xa.width-=D,M.setGeometry(N,xa))}}}finally{M.endUpdate()}};Graph.prototype.deleteTableRow=function(D){var M=this.getModel();M.beginUpdate();try{var N=D,W=D;this.isTableCell(D)&&(D=W=M.getParent(D));this.isTableRow(D)&&(N=M.getParent(W));var ca=M.getChildCells(N,!0);if(1>=ca.length)M.remove(N);else{this.isTableRow(W)||(W=ca[ca.length-1]);M.remove(W);D=0;var ma=this.getCellGeometry(W);+Ma)}}finally{N.endUpdate()}};Graph.prototype.deleteTableColumn=function(D){var M=this.getModel();M.beginUpdate();try{var N=D,W=D;this.isTableCell(D)&&(W=M.getParent(D));this.isTableRow(W)&&(N=M.getParent(W));var ca=M.getChildCells(N,!0);if(0==ca.length)M.remove(N);else{this.isTableRow(W)||(W=ca[0]);var ma=M.getChildCells(W,!0);if(1>=ma.length)M.remove(N);else{var pa=ma.length-1;this.isTableCell(D)&&(pa=mxUtils.indexOf(ma,D));for(W=D=0;W<ca.length;W++){var va=M.getChildCells(ca[W],!0)[pa];M.remove(va);+var Aa=this.getCellGeometry(va);null!=Aa&&(D=Math.max(D,Aa.width))}var xa=this.getCellGeometry(N);null!=xa&&(xa=xa.clone(),xa.width-=D,M.setGeometry(N,xa))}}}finally{M.endUpdate()}};Graph.prototype.deleteTableRow=function(D){var M=this.getModel();M.beginUpdate();try{var N=D,W=D;this.isTableCell(D)&&(D=W=M.getParent(D));this.isTableRow(D)&&(N=M.getParent(W));var ca=M.getChildCells(N,!0);if(1>=ca.length)M.remove(N);else{this.isTableRow(W)||(W=ca[ca.length-1]);M.remove(W);D=0;var ma=this.getCellGeometry(W);null!=ma&&(D=ma.height);var pa=this.getCellGeometry(N);null!=pa&&(pa=pa.clone(),pa.height-=D,M.setGeometry(N,pa))}}finally{M.endUpdate()}};Graph.prototype.insertRow=function(D,M){for(var N=D.tBodies[0],W=N.rows[0].cells,ca=D=0;ca<W.length;ca++){var ma=W[ca].getAttribute("colspan");D+=null!=ma?parseInt(ma):1}M=N.insertRow(M);for(ca=0;ca<D;ca++)mxUtils.br(M.insertCell(-1));return M.cells[0]};Graph.prototype.deleteRow=function(D,M){D.tBodies[0].deleteRow(M)};Graph.prototype.insertColumn=function(D,M){var N=D.tHead;if(null!=N)for(var W=0;W<N.rows.length;W++){var ca=document.createElement("th");N.rows[W].appendChild(ca);mxUtils.br(ca)}D=D.tBodies[0];for(N=0;N<D.rows.length;N++)W=D.rows[N].insertCell(M),mxUtils.br(W);return D.rows[0].cells[0<=M?M:D.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(D,M){if(0<=M){D=D.tBodies[0].rows;for(var N=0;N<D.length;N++)D[N].cells.length>M&&D[N].deleteCell(M)}};Graph.prototype.pasteHtmlAtCaret=function(D){if(window.getSelection){var M=window.getSelection();if(M.getRangeAt&&M.rangeCount){M=M.getRangeAt(0);M.deleteContents();var N=document.createElement("div");N.innerHTML=D;D=document.createDocumentFragment();for(var W;W=N.firstChild;)lastNode=D.appendChild(W);M.insertNode(D)}}else(M=document.selection)&&"Control"!=M.type&&M.createRange().pasteHTML(D)};Graph.prototype.createLinkForHint=function(D,M,N){function W(ma,pa){ma.length>pa&&(ma=ma.substring(0,Math.round(pa/2))+"..."+ma.substring(ma.length-Math.round(pa/4)));return ma}D=null!=D?D:"javascript:void(0);";if(null==M||0==M.length)M=this.isCustomLink(D)?this.getLinkTitle(D):D;var ca=document.createElement("a");ca.setAttribute("rel",this.linkRelation);ca.setAttribute("href",this.getAbsoluteUrl(D));ca.setAttribute("title",W(this.isCustomLink(D)?this.getLinkTitle(D):D,80));null!=this.linkTarget&&ca.setAttribute("target",this.linkTarget);mxUtils.write(ca,W(M,40));this.isCustomLink(D)&&mxEvent.addListener(ca,"click",mxUtils.bind(this,function(ma){this.customLinkClicked(D,N);mxEvent.consume(ma)}));return ca};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(ma,pa){this.popupMenuHandler.hideMenu()});var D=this.updateMouseEvent;this.updateMouseEvent=function(ma){ma=D.apply(this,arguments);if(mxEvent.isTouchEvent(ma.getEvent())&&null==ma.getState()){var pa=this.getCellAt(ma.graphX,ma.graphY);null!=pa&&this.isSwimlane(pa)&&this.hitsSwimlaneContent(pa,ma.graphX,ma.graphY)||-(ma.state=this.view.getState(pa),null!=ma.state&&null!=ma.state.shape&&(this.container.style.cursor=ma.state.shape.node.style.cursor))}null==ma.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return ma};var M=!1,N=!1,W=!1,ca=this.fireMouseEvent;this.fireMouseEvent=function(ma,pa,ua){ma==mxEvent.MOUSE_DOWN&&(pa=this.updateMouseEvent(pa),M=this.isCellSelected(pa.getCell()),N=this.isSelectionEmpty(),W=this.popupMenuHandler.isMenuShowing());ca.apply(this,arguments)};this.popupMenuHandler.mouseUp=-mxUtils.bind(this,function(ma,pa){if(null!=this.freehand&&!this.freehand.isDrawing()){var ua=mxEvent.isMouseEvent(pa.getEvent());this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==pa.getState()||!pa.isSource(pa.getState().control))&&(this.popupMenuHandler.popupTrigger||!W&&!ua&&(N&&null==pa.getCell()&&this.isSelectionEmpty()||M&&this.isCellSelected(pa.getCell())));ua=!M||ua?null:mxUtils.bind(this,function(Aa){window.setTimeout(mxUtils.bind(this,function(){if(!this.isEditing()&&-this.isTouchPopupMenuEnabled()){var xa=mxUtils.getScrollOrigin();this.popupMenuHandler.popup(pa.getX()+xa.x+1,pa.getY()+xa.y+1,Aa,pa.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[ma,pa,ua])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0};mxCellEditor.prototype.isContentEditing=function(){var D=this.graph.view.getState(this.editingCell);return null!=D&&1==D.style.html};mxCellEditor.prototype.isTableSelected=function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),+(ma.state=this.view.getState(pa),null!=ma.state&&null!=ma.state.shape&&(this.container.style.cursor=ma.state.shape.node.style.cursor))}null==ma.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return ma};var M=!1,N=!1,W=!1,ca=this.fireMouseEvent;this.fireMouseEvent=function(ma,pa,va){ma==mxEvent.MOUSE_DOWN&&(pa=this.updateMouseEvent(pa),M=this.isCellSelected(pa.getCell()),N=this.isSelectionEmpty(),W=this.popupMenuHandler.isMenuShowing());ca.apply(this,arguments)};this.popupMenuHandler.mouseUp=+mxUtils.bind(this,function(ma,pa){if(null!=this.freehand&&!this.freehand.isDrawing()){var va=mxEvent.isMouseEvent(pa.getEvent());this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==pa.getState()||!pa.isSource(pa.getState().control))&&(this.popupMenuHandler.popupTrigger||!W&&!va&&(N&&null==pa.getCell()&&this.isSelectionEmpty()||M&&this.isCellSelected(pa.getCell())));va=!M||va?null:mxUtils.bind(this,function(Aa){window.setTimeout(mxUtils.bind(this,function(){if(!this.isEditing()&&+this.isTouchPopupMenuEnabled()){var xa=mxUtils.getScrollOrigin();this.popupMenuHandler.popup(pa.getX()+xa.x+1,pa.getY()+xa.y+1,Aa,pa.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[ma,pa,va])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0};mxCellEditor.prototype.isContentEditing=function(){var D=this.graph.view.getState(this.editingCell);return null!=D&&1==D.style.html};mxCellEditor.prototype.isTableSelected=function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};mxCellEditor.prototype.isTextSelected=function(){var D="";window.getSelection?D=window.getSelection():document.getSelection?D=document.getSelection():document.selection&&(D=document.selection.createRange().text);return""!=D};mxCellEditor.prototype.insertTab=function(D){var M=this.textarea.ownerDocument.defaultView.getSelection(),N=M.getRangeAt(0);D=Graph.createTabNode(D);N.insertNode(D);N.setStartAfter(D);N.setEndAfter(D);M.removeAllRanges();M.addRange(N)};mxCellEditor.prototype.alignText=function(D,M){var N=this.graph.getView().getState(this.editingCell);if(null!=N){N=mxUtils.getValue(N.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);var W=null!=N&&"vertical-"==N.substring(0,9),ca=null!=M&&mxEvent.isShiftDown(M);if(ca||null!=window.getSelection&&null!=window.getSelection().containsNode){var ma=!0;this.graph.processElements(this.textarea,function(pa){ca||W||window.getSelection().containsNode(pa,!0)?(pa.removeAttribute("align"),pa.style.textAlign=null):ma=!1});(ma||W)&&this.graph.cellEditor.setAlign(D)}W||document.execCommand("justify"+D.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var D=window.getSelection();if(D.getRangeAt&&D.rangeCount){for(var M=[],N=0,W=D.rangeCount;N<W;++N)M.push(D.getRangeAt(N));return M}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(D){try{if(D)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var M=0,N=D.length;M<N;++M)sel.addRange(D[M])}else document.selection&&D.select&&D.select()}catch(W){}};var fa=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(D){null!=D.text&&(D.text.replaceLinefeeds="0"!=mxUtils.getValue(D.style,"nl2Br","1"));fa.apply(this,arguments)};var aa=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(D,M){this.isKeepFocusEvent(D)||!mxEvent.isAltDown(D.getEvent())?aa.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(D){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var da=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(D,M){D=this.graph.getStartEditingCell(D,M);da.apply(this,arguments);var N=this.graph.view.getState(D);this.textarea.className=null!=N&&1==N.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";Graph.browserTranslate&&(this.textarea.classList.add("notranslate"),this.textarea.setAttribute("translate","no"));this.textarea.style.colorScheme="none"==this.graph.getAdaptiveColors()?"light":"";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(D);null!=this.editingCell&&null!=this.textarea&&null!=this.textarea.parentNode&&null!=N&&this.graph.isAutosizeTextState(N)&&this.resize()};mxCellEditor.prototype.toggleViewMode=function(){var D=this.graph.view.getState(this.editingCell);-if(null!=D){var M=null!=D&&"0"!=mxUtils.getValue(D.style,"nl2Br","1"),N=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);ua=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<ua.length&&"\n"==ua.charAt(ua.length-1)&&(ua=ua.substring(0,ua.length-1));ua=Graph.sanitizeHtml(M?ua.replace(/\n/g,"<br/>"):ua,!0);this.textarea.className="mxCellEditor geContentEditable";Aa=mxUtils.getValue(D.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);+if(null!=D){var M=null!=D&&"0"!=mxUtils.getValue(D.style,"nl2Br","1"),N=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);va=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<va.length&&"\n"==va.charAt(va.length-1)&&(va=va.substring(0,va.length-1));va=Graph.sanitizeHtml(M?va.replace(/\n/g,"<br/>"):va,!0);this.textarea.className="mxCellEditor geContentEditable";Aa=mxUtils.getValue(D.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);M=mxUtils.getValue(D.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var W=mxUtils.getValue(D.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),ca=(mxUtils.getValue(D.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,ma=(mxUtils.getValue(D.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,pa=[];(mxUtils.getValue(D.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&pa.push("underline");(mxUtils.getValue(D.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&pa.push("line-through");0<pa.length&&(mxUtils.getValue(D.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&pa.push("dotted");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(Aa*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(Aa)+-"px";this.textarea.style.textDecoration=pa.join(" ");this.textarea.style.fontWeight=ca?"bold":"normal";this.textarea.style.fontStyle=ma?"italic":"";this.textarea.style.fontFamily=M;this.textarea.style.textAlign=W;this.textarea.style.padding="0px";this.textarea.innerHTML!=ua&&(this.textarea.innerHTML=ua,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,-"simple"==this.graph.getAdaptiveColors());this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerText="");Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var ua=mxUtils.htmlEntities(this.textarea.innerHTML);8!=document.documentMode&&(ua=mxUtils.replaceTrailingNewlines(ua,"<div><br></div>"));ua=Graph.sanitizeHtml(M?ua.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):ua,!0);this.textarea.className=+"px";this.textarea.style.textDecoration=pa.join(" ");this.textarea.style.fontWeight=ca?"bold":"normal";this.textarea.style.fontStyle=ma?"italic":"";this.textarea.style.fontFamily=M;this.textarea.style.textAlign=W;this.textarea.style.padding="0px";this.textarea.innerHTML!=va&&(this.textarea.innerHTML=va,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,+"simple"==this.graph.getAdaptiveColors());this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerText="");Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var va=mxUtils.htmlEntities(this.textarea.innerHTML);8!=document.documentMode&&(va=mxUtils.replaceTrailingNewlines(va,"<div><br></div>"));va=Graph.sanitizeHtml(M?va.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):va,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var Aa=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(Aa*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(Aa)+"px";this.textarea.style.textDecoration="";this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.width="";this.textarea.style.padding=-"2px";this.textarea.innerHTML!=ua&&(this.textarea.innerHTML=ua);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=N;this.resize()}};var ba=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(D,M){if(null!=this.textarea)if(D=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=D){var N=D.view.scale;this.bounds=mxRectangle.fromRectangle(D);if(0==this.bounds.width&&+"2px";this.textarea.innerHTML!=va&&(this.textarea.innerHTML=va);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=N;this.resize()}};var ba=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(D,M){if(null!=this.textarea)if(D=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=D){var N=D.view.scale;this.bounds=mxRectangle.fromRectangle(D);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*N;this.bounds.height=60*N;var W=null!=D.text?D.text.margin:null;null==W&&(W=mxUtils.getAlignmentAsPoint(mxUtils.getValue(D.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(D.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=W.x*this.bounds.width;this.bounds.y+=W.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/N)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/N)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/N)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*N);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/N)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*N);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px";mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+N+","+N+")")}else if(null!=D&&this.graph.isAutosizeTextState(D)){N=D.view.scale;W=D.style;var ca=this.graph.getCellGeometry(this.editingCell);if(null!=ca){this.bounds=mxRectangle.fromRectangle(D);this.textarea.style.left=Math.round(D.x)+"px";this.textarea.style.top=Math.round(D.y)+"px";var ma=this.rotateText&&null!=this.textShape?this.textShape.getTextRotation():0;mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform",(0!=ma?"rotate("+ma+"deg) ":"")+"scale("+N+","+N+")");this.textarea.style.borderWidth="0";this.textarea.style.width=Math.round(ca.width+mxSvgCanvas2D.prototype.foreignObjectPadding)+"px";this.textarea.style.height=Math.round(ca.height)+"px";this.textarea.style.overflow="hidden";this.textarea.style.boxSizing="border-box";"wrap"==W[mxConstants.STYLE_WHITE_SPACE]&&-(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal");var pa=parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING,2));N=pa+parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING_TOP,0));ma=pa+parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING_BOTTOM,0));var ua=pa+parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING_LEFT,0));pa+=parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING_RIGHT,0));this.textarea.style.paddingLeft=Math.round(ua)+"px";this.textarea.style.paddingRight=+(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal");var pa=parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING,2));N=pa+parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING_TOP,0));ma=pa+parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING_BOTTOM,0));var va=pa+parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING_LEFT,0));pa+=parseInt(mxUtils.getValue(W,mxConstants.STYLE_SPACING_RIGHT,0));this.textarea.style.paddingLeft=Math.round(va)+"px";this.textarea.style.paddingRight=Math.round(pa)+"px";this.textarea.style.paddingTop=Math.round(N)+"px";this.textarea.style.paddingBottom=Math.round(ma)+"px";this.textarea.style.display="table-cell";this.textarea.style.flexDirection="";this.textarea.style.justifyContent="";N=mxUtils.getValue(W,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);this.textarea.style.verticalAlign=N==mxConstants.ALIGN_MIDDLE?"middle":N==mxConstants.ALIGN_BOTTOM?"bottom":"top";N=this.textarea.innerText;null!=N&&0<N.length&&(ca=this.graph.getAutosizeTextAvailableSpace(W,ca.width,ca.height,D),null!=ca&&(N=mxUtils.htmlEntities(N,!1).replace(/\n/g,"<br>"),W=this.graph.computeAutosizeTextFontSize(N,ca.availW,ca.availH,W[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,W[mxConstants.STYLE_FONTSTYLE],"wrap"==W[mxConstants.STYLE_WHITE_SPACE]),this.textarea.style.fontSize=W+"px",this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?W*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT))}}else this.textarea.style.width="",this.textarea.style.height="",this.textarea.style.overflow="",this.textarea.style.boxSizing="",this.textarea.style.borderWidth="",this.textarea.style.paddingTop="",this.textarea.style.paddingBottom="",this.textarea.style.paddingLeft="",this.textarea.style.paddingRight="",this.textarea.style.display="",this.textarea.style.flexDirection="",this.textarea.style.justifyContent="",this.textarea.style.verticalAlign="",ba.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=@@ -2963,60 +2963,61 @@ Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};mxCellEditvar qa=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(D,M){this.graph.getModel().beginUpdate();try{qa.apply(this,arguments),""==M&&this.graph.isCellDeletable(D.cell)&&0==this.graph.model.getChildCount(D.cell)&&this.graph.isTransparentState(D)&&this.graph.removeCells([D.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(D){D=mxUtils.getValue(D.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);D==mxConstants.NONE&&(D=null);return D};mxCellEditor.prototype.getBorderColor=function(D){D=mxUtils.getValue(D.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);D==mxConstants.NONE&&(D=null);return D};mxCellEditor.prototype.getMinimumSize=function(D){var M=this.graph.getView().scale;return new mxRectangle(0,0,null==D.text?30:D.text.size*M+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(D,M){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(M.getEvent)};var ra=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(D){var M=ra.apply(this,arguments);if(null!=M){var N=this.graph.getLockedGroupAncestor(this.graph.model.getParent(M));null!=N&&(M=N)}return M};var l=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(D,M,N){var W=this.graph.model.getParent(D);if(null!=W){if(this.graph.isSelectParentFirst(W))return!this.graph.isCellSelected(W)&&-!this.graph.isSiblingSelected(D);if(this.graph.isTransparentBounds(W))return!1}return l.apply(this,arguments)};var t=mxConstraintHandler.prototype.getCellForEvent;mxConstraintHandler.prototype.getCellForEvent=function(D,M){var N=t.apply(this,arguments);if(null!=N&&(null==this.currentFocus||this.currentFocus.cell!=N)){var W=this.graph.getBorderContainer(N,null!=M?M.x:D.getGraphX(),null!=M?M.y:D.getGraphY());null!=W&&(N=W)}return N};var H=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=-function(){for(var D=H.apply(this,arguments),M=this.graph,N=new mxDictionary,W=[],ca=0;ca<D.length;ca++)null==N.get(D[ca])&&(N.put(D[ca],!0),W.push(D[ca]));for(ca=0;ca<D.length;ca++)for(var ma=M.model.getParent(D[ca]);null!=ma&&M.isTransparentBounds(ma);)null==N.get(ma)&&(N.put(ma,!0),W.push(ma)),ma=M.model.getParent(ma);return W};mxGraphView.prototype.formatUnitText=function(D){return D?d(D,this.unit):D};mxGraphHandler.prototype.updateHint=function(D){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==-this.hint&&(this.hint=b(),this.graph.container.appendChild(this.hint));var M=this.graph.view.translate,N=this.graph.view.scale;D=this.roundLength((this.bounds.x+this.currentDx)/N-M.x);M=this.roundLength((this.bounds.y+this.currentDy)/N-M.y);N=this.graph.view.unit;this.hint.innerHTML=d(D,N)+", "+d(M,N);this.hint.style.left=this.pBounds.x+this.currentDx+Math.round((this.pBounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.pBounds.y+this.currentDy+this.pBounds.height+Editor.hintOffset+-"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(null!=this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint),this.hint=null)};var J=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(D,M){J.apply(this,arguments);var N=this.graph.getCellStyle(D);if(null==N.childLayout){var W=this.graph.model.getParent(D),ca=null!=W?this.graph.getCellGeometry(W):null;if(null!=ca&&(N=this.graph.getCellStyle(W),"stackLayout"==N.childLayout)){var ma=parseFloat(mxUtils.getValue(N,-"stackBorder",mxStackLayout.prototype.border));N="1"==mxUtils.getValue(N,"horizontalStack","1");var pa=this.graph.getActualStartSize(W);ca=ca.clone();N?ca.height=M.height+pa.y+pa.height+2*ma:ca.width=M.width+pa.x+pa.width+2*ma;this.graph.model.setGeometry(W,ca)}}};var R=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function D(ua){N.get(ua)||(N.put(ua,!0),ca.push(ua))}for(var M=R.apply(this,arguments),N=new mxDictionary,-W=this.graph.model,ca=[],ma=0;ma<M.length;ma++){var pa=M[ma];this.graph.isTableCell(pa)?D(W.getParent(W.getParent(pa))):this.graph.isTableRow(pa)&&D(W.getParent(pa));D(pa)}return ca};var T=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(D){return T.apply(this,arguments)&&!mxEvent.isControlDown(D.getEvent())&&!mxEvent.isShiftDown(D.getEvent())};var Y=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return Y.apply(this,-arguments)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};var Z=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(D){var M=Z.apply(this,arguments);M.stroke="#C0C0C0";M.strokewidth=1;var N=this.graph.model.getParent(this.state.cell);null!=N&&this.graph.isTransparentBounds(N)&&(M.isDashed=!0);return M};var ia=mxVertexHandler.prototype.isSelectionDashed;-mxVertexHandler.prototype.isSelectionDashed=function(){return this.graph.isTransparentBounds(this.state.cell)?!0:ia.apply(this,arguments)};var ka=mxVertexHandler.prototype.getSelectionColor;mxVertexHandler.prototype.getSelectionColor=function(){return this.graph.isTransparentBounds(this.state.cell)&&!this.graph.isCellSelected(this.state.cell)?"#C0C0C0":ka.apply(this,arguments)};var X=mxVertexHandler.prototype.updateParentHighlight;mxVertexHandler.prototype.updateParentHighlight=function(){X.apply(this,-arguments);null!=this.selectionBorder&&this.graph.isTransparentBounds(this.state.cell)&&(this.selectionBorder.stroke=this.getSelectionColor(),this.selectionBorder.redraw())};var ja=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(D){var M=ja.apply(this,arguments);M.stroke="#C0C0C0";M.strokewidth=1;return M};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var D=this.getHandlePadding();-return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+D.x/2,this.bounds.y+this.rotationHandleVSpacing-D.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(D,M){return this.graph.isRecursiveVertexResize(D)&&!mxEvent.isAltDown(M.getEvent())};var na=mxVertexHandler.prototype.resizeCell;mxVertexHandler.prototype.resizeCell=function(D,M,N,W,ca,ma,pa){pa&&this.graph.isRotatedGroupResize(D)&&(this.childOffsetY=this.childOffsetX=0);na.apply(this,arguments)};mxVertexHandler.prototype.isCenteredEvent=-function(D,M){return mxEvent.isControlDown(M.getEvent())||mxEvent.isMetaDown(M.getEvent())};var la=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return la.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTransparentBounds(this.state.cell)&&"1"!=mxUtils.getValue(this.state.style,"labelAutoRotate","0")};mxVertexHandler.prototype.isConnectHandleVisible=-function(){return this.graph.isConnectIconVisible(this.state.cell)&&this.graph.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing=-12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var D=this.getHandlePadding(),M=this.graph,N=M.getNestedCornerIconOffset(this.state.cell,this.bounds.x+this.bounds.width,this.bounds.y+-this.bounds.height,function(W){return M.isConnectIconVisible(W)&&M.isEnabled()&&M.isCellConnectable(W)&&!M.isTableCell(W)&&!M.isTableRow(W)&&!M.isTable(W)});return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing+D.x/2+N,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+D.y/2+N)};mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):-this.bounds};var va=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){var D=this.graph.model.getParent(this.state.cell);return null!=D&&this.graph.isTransparentBounds(D)?!1:va.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var za=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(D){return D.tableHandle||D.lockHandle||D.editIconHandle||-D.moveGroupHandle||za.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=function(){var D=0;this.graph.isTransparentBounds(this.state.cell)?D=-this.graph.getNestedTransparentBoundsCount(this.state.cell):this.graph.isTableRow(this.state.cell)?D=1:this.graph.isTableCell(this.state.cell)&&(D=2);return D};var sa=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=-function(){return sa.apply(this,arguments).grow(-this.getSelectionBorderInset())};var wa=null,Ca=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==wa&&(wa=mxCellRenderer.defaultShapes.tableLine);var D=Ca.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var M=function(cb,fb,Xa){for(var wb=[],sb=0;sb<cb.length;sb++){var qb=cb[sb];wb.push(null==qb?null:new mxPoint((Aa+qb.x+fb)*ma,(xa+qb.y+-Xa)*ma))}return wb},N=this,W=this.graph,ca=W.model,ma=W.view.scale,pa=this.state,ua=this.selectionBorder,Aa=this.state.origin.x+W.view.translate.x,xa=this.state.origin.y+W.view.translate.y;null==D&&(D=[]);var Ma=W.view.getCellStates(ca.getChildCells(this.state.cell,!0));if(0<Ma.length){var Wa=ca.getChildCells(Ma[0].cell,!0),Za=W.getTableLines(this.state.cell,!1,!0),pb=W.getTableLines(this.state.cell,!0,!1);for(ca=0;ca<Ma.length;ca++)mxUtils.bind(this,function(cb){var fb=Ma[cb],Xa=null;if(W.isCellMovable(fb.cell)){Xa=-cb<Ma.length-1?Ma[cb+1]:null;Xa=null!=Xa?W.getCellGeometry(Xa.cell):null;var wb=null!=Xa&&null!=Xa.alternateBounds?Xa.alternateBounds:Xa;Xa=null!=pb[cb]?new wa(pb[cb],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Xa.isDashed=ua.isDashed;Xa.svgStrokeTolerance++;Xa=new mxHandle(fb,"row-resize",null,Xa);Xa.tableHandle=!0;var sb=0;Xa.shape.node.parentNode.insertBefore(Xa.shape.node,Xa.shape.node.parentNode.firstChild);Xa.redraw=function(){if(null!=this.shape){this.shape.stroke=-0==sb?mxConstants.NONE:ua.stroke;if(this.shape.constructor==wa)this.shape.line=M(pb[cb],0,sb),this.shape.updateBoundsFromLine();else{var qb=W.getActualStartSize(pa.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+sb*ma;this.shape.bounds.x=pa.x+(cb==Ma.length-1?0:qb.x*ma);this.shape.bounds.width=pa.width-(cb==Ma.length-1?0:qb.width+qb.x+ma)}this.shape.redraw()}};Xa.setPosition=function(qb,zb,Fb){sb=Math.max(Graph.minTableRowHeight-qb.height,zb.y-qb.y-qb.height);-null!=wb&&mxEvent.isShiftDown(Fb.getEvent())&&(sb=Math.min(sb,wb.height-Graph.minTableRowHeight))};Xa.execute=function(qb){if(0!=sb){var zb=mxEvent.isShiftDown(qb.getEvent());(qb=mxEvent.isControlDown(qb.getEvent())||mxEvent.isMetaDown(qb.getEvent()))&&zb?W.distributeRows(pa.cell):qb?W.resizeAllTableRows(pa.cell,sb):W.setTableRowHeight(this.state.cell,sb,!zb)}else N.blockDelayedSelection||(zb=W.getCellAt(qb.getGraphX(),qb.getGraphY())||pa.cell,W.graphHandler.selectCellForEvent(zb,qb));sb=0};Xa.reset=-function(){sb=0}}D.push(Xa)})(ca);for(ca=0;ca<Wa.length;ca++)mxUtils.bind(this,function(cb){var fb=W.view.getState(Wa[cb]),Xa=W.getCellGeometry(Wa[cb]),wb=null!=Xa.alternateBounds?Xa.alternateBounds:Xa;null==fb&&(fb=new mxCellState(W.view,Wa[cb],W.getCellStyle(Wa[cb])),fb.x=pa.x+Xa.x*ma,fb.y=pa.y+Xa.y*ma,fb.width=wb.width*ma,fb.height=wb.height*ma,fb.updateCachedBounds());Xa=cb<Wa.length-1?Wa[cb+1]:null;Xa=null!=Xa?W.getCellGeometry(Xa):null;var sb=null!=Xa&&null!=Xa.alternateBounds?Xa.alternateBounds:-Xa;Xa=null!=Za[cb]?new wa(Za[cb],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Xa.isDashed=ua.isDashed;Xa.svgStrokeTolerance++;fb=new mxHandle(fb,"col-resize",null,Xa);fb.tableHandle=!0;var qb=0;fb.shape.node.parentNode.insertBefore(fb.shape.node,fb.shape.node.parentNode.firstChild);fb.redraw=function(){if(null!=this.shape){this.shape.stroke=0==qb?mxConstants.NONE:ua.stroke;if(this.shape.constructor==wa)this.shape.line=M(Za[cb],qb,0),this.shape.updateBoundsFromLine();else{var zb=-W.getActualStartSize(pa.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(wb.width+qb)*ma;this.shape.bounds.y=pa.y+(cb==Wa.length-1?0:zb.y*ma);this.shape.bounds.height=pa.height-(cb==Wa.length-1?0:(zb.height+zb.y)*ma)}this.shape.redraw()}};fb.setPosition=function(zb,Fb,Jb){qb=Math.max(Graph.minTableColumnWidth-wb.width,Fb.x-zb.x-wb.width);null!=sb&&mxEvent.isShiftDown(Jb.getEvent())&&(qb=Math.min(qb,sb.width-Graph.minTableColumnWidth))};fb.execute=function(zb){if(0!=qb){var Fb=-mxEvent.isShiftDown(zb.getEvent());(zb=mxEvent.isControlDown(zb.getEvent())||mxEvent.isMetaDown(zb.getEvent()))&&Fb?W.distributeColumns(pa.cell):zb?W.resizeAllTableColumns(pa.cell,qb):W.setTableColumnWidth(this.state.cell,qb,!Fb)}else N.blockDelayedSelection||(Fb=W.getCellAt(zb.getGraphX(),zb.getGraphY())||pa.cell,W.graphHandler.selectCellForEvent(Fb,zb));qb=0};fb.positionChanged=function(){};fb.reset=function(){qb=0};D.push(fb)})(ca)}}if(this.graph.isLockedGroupIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){null==-D&&(D=[]);N=this;W=this.graph;var rb=this.state.cell,tb=16,ob=this.graph.isLockedGroup(rb);ca=new mxImageShape(new mxRectangle(0,0,tb,tb),(ob?HoverIcons.prototype.lockHandle:HoverIcons.prototype.unlockHandle).src);ca.preserveImageAspect=!1;ca=new mxHandle(this.state,"pointer",null,ca);ca.lockHandle=!0;ca.setPosition=function(){};ca.positionChanged=function(){};ca.reset=function(){};ca.redraw=function(){if(null!=this.shape){var cb=N.getHandlePadding(),fb=W.getNestedCornerIconOffset(rb,N.bounds.x,N.bounds.y,-function(sb){return W.isLockedGroupIconVisible(sb)&&W.isCellMovable(sb)});cb=new mxPoint(N.bounds.x-12-cb.x/2-fb,N.bounds.y-12-cb.y/2-fb);W.isMoveIconVisible(rb)&&W.isCellMovable(rb)&&(cb.y+=24);fb=Number(null!=N.currentAlpha?N.currentAlpha:N.state.style[mxConstants.STYLE_ROTATION]||"0");var Xa=mxUtils.toRadians(fb);if(0!=Xa){var wb=new mxPoint(N.state.getCenterX(),N.state.getCenterY());cb=mxUtils.getRotatedPoint(cb,Math.cos(Xa),Math.sin(Xa),wb)}this.shape.bounds.width=tb;this.shape.bounds.height=-tb;this.shape.bounds.x=cb.x-tb/2;this.shape.bounds.y=cb.y-tb/2;this.shape.rotation=fb;this.shape.redraw()}};ca.execute=function(cb){W.getModel().beginUpdate();try{W.setCellStyles("lockedGroup",ob?"0":"1",[rb])}finally{W.getModel().endUpdate()}if(!ob){cb=W.getSelectionCells();for(var fb=[],Xa=0;Xa<cb.length;Xa++)cb[Xa]!=rb&&W.model.isAncestor(rb,cb[Xa])||fb.push(cb[Xa]);fb.length!=cb.length&&W.setSelectionCells(0<fb.length?fb:[rb])}};D.push(ca)}this.graph.isEditIconVisible(this.state.cell)&&(null==-D&&(D=[]),N=this,W=this.graph,rb=this.state.cell,tb=16,ca=new mxImageShape(new mxRectangle(0,0,tb,tb),HoverIcons.prototype.editHandle.src),ca.preserveImageAspect=!1,ca=new mxHandle(this.state,"pointer",null,ca),ca.editIconHandle=!0,ca.setPosition=function(){},ca.positionChanged=function(){},ca.reset=function(){},ca.redraw=function(){if(null!=this.shape){var cb=N.getHandlePadding(),fb=W.getNestedCornerIconOffset(rb,N.bounds.x,N.bounds.y,function(sb){return W.isEditIconVisible(sb)});cb=new mxPoint(N.bounds.x--12-cb.x/2-fb,N.bounds.y-12-cb.y/2-fb);W.isCellMovable(rb)&&(W.isLockedGroupIconVisible(rb)||W.isMoveIconVisible(rb))&&(cb.x+=24);fb=Number(null!=N.currentAlpha?N.currentAlpha:N.state.style[mxConstants.STYLE_ROTATION]||"0");var Xa=mxUtils.toRadians(fb);if(0!=Xa){var wb=new mxPoint(N.state.getCenterX(),N.state.getCenterY());cb=mxUtils.getRotatedPoint(cb,Math.cos(Xa),Math.sin(Xa),wb)}this.shape.bounds.width=tb;this.shape.bounds.height=tb;this.shape.bounds.x=cb.x-tb/2;this.shape.bounds.y=cb.y-tb/2;this.shape.rotation=-fb;this.shape.redraw()}},ca.execute=function(cb){W.startEditingAtCell(rb)},D.push(ca));this.graph.isMoveIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&(null==D&&(D=[]),N=this,W=this.graph,rb=this.state.cell,tb=16,ca=new mxImageShape(new mxRectangle(0,0,tb,tb),HoverIcons.prototype.moveHandle.src),ca.preserveImageAspect=!1,ca=new mxHandle(this.state,"move",null,ca),ca.moveGroupHandle=!0,ca.setPosition=function(){},ca.positionChanged=function(){},ca.execute=function(){},ca.reset=-function(){},ca.redraw=function(){if(null!=this.shape){var cb=N.getHandlePadding(),fb=W.getNestedCornerIconOffset(rb,N.bounds.x,N.bounds.y,function(wb){return W.isMoveIconVisible(wb)&&W.isCellMovable(wb)}),Xa=N.bounds.x-12-cb.x/2-fb;cb=N.bounds.y-12-cb.y/2-fb;this.shape.bounds.width=tb;this.shape.bounds.height=tb;this.shape.bounds.x=Xa-tb/2;this.shape.bounds.y=cb-tb/2;this.shape.redraw()}},D.push(ca));return null!=D?D.reverse():null};var Fa=mxVertexHandler.prototype.setHandlesVisible,Ha=mxVertexHandler.prototype.start;-mxVertexHandler.prototype.start=function(D,M,N){Ha.apply(this,arguments);var W=this.graph;if(null!=this.parentState&&W.isTransparentBounds(this.parentState.cell)){var ca=W.view.scale,ma=W.view.translate,pa=this.parentState;this.parentState=pa.clone();this.parentState.x=ca*(ma.x+pa.origin.x);this.parentState.y=ca*(ma.y+pa.origin.y)}for(ca=W.model.getParent(this.state.cell);null!=ca;)W.isTransparentBounds(ca)&&(ma=W.selectionCellsHandler.getHandler(ca),null!=ma&&null!=ma.selectionBorder&&(ma.selectionBorder.node.style.visibility=-"hidden")),ca=W.model.getParent(ca);if(!this.livePreviewActive&&null==this.ghostPreview&&null!=this.index&&this.index!=mxEvent.LABEL_HANDLE&&null!=this.sizers){for(W=0;W<this.sizers.length;W++)null!=this.sizers[W]&&W!=this.index&&(this.sizers[W].node.style.display="none");null!=this.rotationShape&&this.index!=mxEvent.ROTATION_HANDLE&&(this.rotationShape.node.style.visibility="hidden");this.resizeHandlesHidden=!0}};var Na=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){if(this.resizeHandlesHidden){if(null!=-this.sizers)for(var D=0;D<this.sizers.length;D++)null!=this.sizers[D]&&(this.sizers[D].node.style.display="");null!=this.rotationShape&&(this.rotationShape.node.style.visibility="");this.resizeHandlesHidden=null}D=this.graph;for(var M=null!=this.state?D.model.getParent(this.state.cell):null;null!=M;){if(D.isTransparentBounds(M)){var N=D.selectionCellsHandler.getHandler(M);null!=N&&null!=N.selectionBorder&&(N.selectionBorder.node.style.visibility="")}M=D.model.getParent(M)}Na.apply(this,arguments)};-mxVertexHandler.prototype.setHandlesVisible=function(D){Fa.apply(this,arguments);if(null!=this.moveHandles)for(var M=0;M<this.moveHandles.length;M++)null!=this.moveHandles[M]&&(this.moveHandles[M].node.style.visibility=D?"":"hidden");if(null!=this.cornerHandles)for(M=0;M<this.cornerHandles.length;M++)this.cornerHandles[M].node.style.visibility=D?"":"hidden";this.graph.isTransparentBounds(this.state.cell)&&null!=this.selectionBorder&&(this.selectionBorder.node.style.visibility=D?"":"hidden")};mxVertexHandler.prototype.isMoveHandlesVisible=-function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};mxVertexHandler.prototype.refreshMoveHandles=function(){var D=this.isMoveHandlesVisible();D&&null==this.moveHandles?this.moveHandles=this.createMoveHandles():D||null==this.moveHandles||this.destroyMoveHandles();if(D&&null==this.moveHandles){for(D=0;D<this.moveHandles.length;D++)null!=this.moveHandles[D]&&this.moveHandles[D].parentNode.removeChild(this.moveHandles[D]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=-function(){for(var D=this.graph,M=D.model,N=[],W=0;W<M.getChildCount(this.state.cell);W++)mxUtils.bind(this,function(ca){if(null!=ca&&M.isVertex(ca.cell)&&D.isCellMovable(ca.cell)){var ma=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);ma=new mxImageShape(ma,this.rowHandleImage.src);ma.rowState=ca;ma.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;ma.init(this.graph.getView().getOverlayPane());ma.node.style.cursor=-"move";mxEvent.addGestureListeners(ma.node,mxUtils.bind(this,function(pa){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(pa)&&this.graph.isCellSelected(ca.cell)||this.graph.selectCellForEvent(ca.cell,pa);mxEvent.isPopupTrigger(pa)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(pa),mxEvent.getClientY(pa),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(pa),this.graph.isMouseDown=-!0);mxEvent.consume(pa)}),null,mxUtils.bind(this,function(pa){mxEvent.isPopupTrigger(pa)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(pa),mxEvent.getClientY(pa),ca.cell,pa),mxEvent.consume(pa))}));N.push(ma)}else N.push(null)})(this.graph.view.getState(M.getChildAt(this.state.cell,W)));return N};mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var D=0;D<this.moveHandles.length;D++)null!=this.moveHandles[D]&&this.moveHandles[D].destroy();this.moveHandles=-null}};mxVertexHandler.prototype.destroyCornerHandles=function(){if(null!=this.cornerHandles){for(var D=0;D<this.cornerHandles.length;D++)null!=this.cornerHandles[D]&&null!=this.cornerHandles[D].node&&null!=this.cornerHandles[D].node.parentNode&&this.cornerHandles[D].node.parentNode.removeChild(this.cornerHandles[D].node);this.cornerHandles=null}};var La=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){La.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();-if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell))this.refreshMoveHandles();else if(this.graph.isCellMovable(this.state.cell)&&(this.graph.isTransparentBounds(this.state.cell)||1==this.graph.getSelectionCount()&&(this.graph.isTableCell(this.state.cell)||this.graph.isTableRow(this.state.cell)))){this.cornerHandles=[];for(var D=0;4>D;D++){var M=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);M.dialect=mxConstants.DIALECT_SVG;M.init(this.graph.view.getOverlayPane());-this.cornerHandles.push(M)}}this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();D=this.graph.getLinkForCell(this.state.cell);M=this.graph.getLinksForState(this.state);this.updateLinkHint(D,M)};var Da=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var D=new mxPoint(0,0),M=this.tolerance,N=this.state.style.shape;null==mxCellRenderer.defaultShapes[N]&&mxStencilRegistry.getStencil(N);N=this.graph.isTable(this.state.cell)||-this.graph.cellEditor.getEditingCell()==this.state.cell;if(!N&&null!=this.customHandles)for(var W=0;W<this.customHandles.length;W++)if(null!=this.customHandles[W]&&!this.customHandles[W].lockHandle&&!this.customHandles[W].editIconHandle&&!this.customHandles[W].moveGroupHandle&&null!=this.customHandles[W].shape&&null!=this.customHandles[W].shape.bounds){var ca=this.customHandles[W].shape.bounds,ma=ca.getCenterX(),pa=ca.getCenterY();if(Math.abs(this.state.x-ma)<ca.width/2||Math.abs(this.state.y-pa)<-ca.height/2||Math.abs(this.state.x+this.state.width-ma)<ca.width/2||Math.abs(this.state.y+this.state.height-pa)<ca.height/2){N=!0;break}}N&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(M/=2,this.graph.isTable(this.state.cell)&&(M+=7),D.x=this.sizers[0].bounds.width+M,D.y=this.sizers[0].bounds.height+M):D=Da.apply(this,arguments);return D};mxVertexHandler.prototype.updateHint=function(D){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));-if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"°";else{D=this.state.view.scale;var M=this.state.view.unit;this.hint.innerHTML=d(this.roundLength(this.bounds.width/D),M)+" x "+d(this.roundLength(this.bounds.height/D),M)}D=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==D&&(D=this.bounds);this.hint.style.left=D.x+Math.round((D.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=-D.y+D.height+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")}};mxVertexHandler.prototype.removeHint=function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};var Sa=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=function(){Sa.apply(this,arguments);var D=this.graph.getLinkForCell(this.state.cell),M=this.graph.getLinksForState(this.state);this.updateLinkHint(D,M)};var Oa=mxEdgeHandler.prototype.mouseMove;-mxEdgeHandler.prototype.mouseMove=function(D,M){Oa.apply(this,arguments);null!=this.linkHint&&"none"!=this.linkHint.style.display&&null!=this.graph.graphHandler&&null!=this.graph.graphHandler.first&&(this.linkHint.style.display="none")};var Ta=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(D,M){Ta.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=-function(D,M,N){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));var W=this.graph.view.translate,ca=this.graph.view.scale,ma=this.roundLength(M.x/ca-W.x);W=this.roundLength(M.y/ca-W.y);var pa=this.graph.view.unit;this.hint.innerHTML=d(ma,pa)+", "+d(W,pa);this.hint.style.visibility="visible";null!=N&&(N.view.updateEdgeBounds(N),this.hint.innerHTML+=" ("+(pa==mxConstants.POINTS?Math.round(N.length/ca):d(N.length/ca,pa))+")");if(this.isSource||this.isTarget)null!=-this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(N=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*N.x)+"%, "+Math.round(100*N.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(D.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(D.getGraphY(),M.y)+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display=-"none")};Graph.createFoldingImage=function(D,M){return M?Graph.createSvgImage(D,D,'<defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 4.5 2 L 4.5 7 M 2 4.5 L 7 4.5 z" stroke="#000"/>',9,9):Graph.createSvgImage(D,D,'<defs><linearGradient id="grad1" x1="50%" y1="0%" x2="50%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 2 4.5 L 7 4.5 z" stroke="#000"/>',-9,9)};Graph.updateFoldingImages=function(D){Graph.prototype.expandedImage=Graph.createFoldingImage(D,!1);Graph.prototype.collapsedImage=Graph.createFoldingImage(D,!0)};Graph.updateFoldingImages(9);Graph.foldingImages={};Graph.prototype.getFoldingImage=function(D){var M=mxGraph.prototype.getFoldingImage.apply(this,arguments);if(null!=M){var N=parseInt(mxUtils.getValue(D.style,"foldingIconSize",0));if(0<N){var W=N+"-"+this.isCellCollapsed(D.cell);M=Graph.foldingImages[W];null==M&&(M=Graph.createFoldingImage(N,-this.isCellCollapsed(D.cell)),Graph.foldingImages[W]=M)}}return M};mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;HoverIcons.prototype.mainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,-'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.endFixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.terminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="'+-HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.endTerminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.rotationHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" fill="'+HoverIcons.prototype.arrowFill+'" d="M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"/>',+!this.graph.isSiblingSelected(D);if(this.graph.isTransparentBounds(W))return!1}return l.apply(this,arguments)};var t=mxConstraintHandler.prototype.getCellForEvent;mxConstraintHandler.prototype.getCellForEvent=function(D,M){var N=t.apply(this,arguments),W=null!=M?M.x:D.getGraphX(),ca=null!=M?M.y:D.getGraphY();if(null!=N&&this.graph.model.isEdge(N)){var ma=this.graph.model;N=this.graph.getCellAt(W,ca,null,!0,!1,function(va){return ma.isEdge(ma.getParent(va.cell))});if(null!=N&&!this.graph.isCellConnectable(N)){var pa=+ma.getParent(N);ma.isVertex(pa)&&this.graph.isCellConnectable(pa)&&(N=pa)}N=this.graph.isCellLocked(N)?null:N}null==N||null!=this.currentFocus&&this.currentFocus.cell==N||(W=this.graph.getBorderContainer(N,W,ca),null!=W&&(N=W));return N};var H=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){for(var D=H.apply(this,arguments),M=this.graph,N=new mxDictionary,W=[],ca=0;ca<D.length;ca++)null==N.get(D[ca])&&(N.put(D[ca],!0),+W.push(D[ca]));for(ca=0;ca<D.length;ca++)for(var ma=M.model.getParent(D[ca]);null!=ma&&M.isTransparentBounds(ma);)null==N.get(ma)&&(N.put(ma,!0),W.push(ma)),ma=M.model.getParent(ma);return W};mxGraphView.prototype.formatUnitText=function(D){return D?d(D,this.unit):D};mxGraphHandler.prototype.updateHint=function(D){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==this.hint&&(this.hint=b(),this.graph.container.appendChild(this.hint));var M=this.graph.view.translate,N=this.graph.view.scale;+D=this.roundLength((this.bounds.x+this.currentDx)/N-M.x);M=this.roundLength((this.bounds.y+this.currentDy)/N-M.y);N=this.graph.view.unit;this.hint.innerHTML=d(D,N)+", "+d(M,N);this.hint.style.left=this.pBounds.x+this.currentDx+Math.round((this.pBounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.pBounds.y+this.currentDy+this.pBounds.height+Editor.hintOffset+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(null!=this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint),+this.hint=null)};var J=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(D,M){J.apply(this,arguments);var N=this.graph.getCellStyle(D);if(null==N.childLayout){var W=this.graph.model.getParent(D),ca=null!=W?this.graph.getCellGeometry(W):null;if(null!=ca&&(N=this.graph.getCellStyle(W),"stackLayout"==N.childLayout)){var ma=parseFloat(mxUtils.getValue(N,"stackBorder",mxStackLayout.prototype.border));N="1"==mxUtils.getValue(N,"horizontalStack","1");var pa=this.graph.getActualStartSize(W);+ca=ca.clone();N?ca.height=M.height+pa.y+pa.height+2*ma:ca.width=M.width+pa.x+pa.width+2*ma;this.graph.model.setGeometry(W,ca)}}};var R=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function D(va){N.get(va)||(N.put(va,!0),ca.push(va))}for(var M=R.apply(this,arguments),N=new mxDictionary,W=this.graph.model,ca=[],ma=0;ma<M.length;ma++){var pa=M[ma];this.graph.isTableCell(pa)?D(W.getParent(W.getParent(pa))):this.graph.isTableRow(pa)&&+D(W.getParent(pa));D(pa)}return ca};var T=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(D){return T.apply(this,arguments)&&!mxEvent.isControlDown(D.getEvent())&&!mxEvent.isShiftDown(D.getEvent())};var Y=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return Y.apply(this,arguments)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};+var Z=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(D){var M=Z.apply(this,arguments);M.stroke="#C0C0C0";M.strokewidth=1;var N=this.graph.model.getParent(this.state.cell);null!=N&&this.graph.isTransparentBounds(N)&&(M.isDashed=!0);return M};var ia=mxVertexHandler.prototype.isSelectionDashed;mxVertexHandler.prototype.isSelectionDashed=function(){return this.graph.isTransparentBounds(this.state.cell)?!0:ia.apply(this,arguments)};var ja=+mxVertexHandler.prototype.getSelectionColor;mxVertexHandler.prototype.getSelectionColor=function(){return this.graph.isTransparentBounds(this.state.cell)&&!this.graph.isCellSelected(this.state.cell)?"#C0C0C0":ja.apply(this,arguments)};var X=mxVertexHandler.prototype.updateParentHighlight;mxVertexHandler.prototype.updateParentHighlight=function(){X.apply(this,arguments);null!=this.selectionBorder&&this.graph.isTransparentBounds(this.state.cell)&&(this.selectionBorder.stroke=this.getSelectionColor(),+this.selectionBorder.redraw())};var ka=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(D){var M=ka.apply(this,arguments);M.stroke="#C0C0C0";M.strokewidth=1;return M};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var D=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+D.x/2,this.bounds.y+this.rotationHandleVSpacing-+D.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(D,M){return this.graph.isRecursiveVertexResize(D)&&!mxEvent.isAltDown(M.getEvent())};var na=mxVertexHandler.prototype.resizeCell;mxVertexHandler.prototype.resizeCell=function(D,M,N,W,ca,ma,pa){pa&&this.graph.isRotatedGroupResize(D)&&(this.childOffsetY=this.childOffsetX=0);na.apply(this,arguments)};mxVertexHandler.prototype.isCenteredEvent=function(D,M){return mxEvent.isControlDown(M.getEvent())||mxEvent.isMetaDown(M.getEvent())};var la=+mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return la.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTransparentBounds(this.state.cell)&&"1"!=mxUtils.getValue(this.state.style,"labelAutoRotate","0")};mxVertexHandler.prototype.isConnectHandleVisible=function(){return this.graph.isConnectIconVisible(this.state.cell)&&this.graph.isEnabled()&&+this.graph.isCellConnectable(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing=-12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var D=this.getHandlePadding(),M=this.graph,N=M.getNestedCornerIconOffset(this.state.cell,this.bounds.x+this.bounds.width,this.bounds.y+this.bounds.height,function(W){return M.isConnectIconVisible(W)&&M.isEnabled()&&M.isCellConnectable(W)&&+!M.isTableCell(W)&&!M.isTableRow(W)&&!M.isTable(W)});return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing+D.x/2+N,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+D.y/2+N)};mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):this.bounds};var ua=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=+function(){var D=this.graph.model.getParent(this.state.cell);return null!=D&&this.graph.isTransparentBounds(D)?!1:ua.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var za=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(D){return D.tableHandle||D.lockHandle||D.editIconHandle||D.moveGroupHandle||za.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};+mxVertexHandler.prototype.getSelectionBorderInset=function(){var D=0;this.graph.isTransparentBounds(this.state.cell)?D=-this.graph.getNestedTransparentBoundsCount(this.state.cell):this.graph.isTableRow(this.state.cell)?D=1:this.graph.isTableCell(this.state.cell)&&(D=2);return D};var sa=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return sa.apply(this,arguments).grow(-this.getSelectionBorderInset())};var wa=null,Ca=mxVertexHandler.prototype.createCustomHandles;+mxVertexHandler.prototype.createCustomHandles=function(){null==wa&&(wa=mxCellRenderer.defaultShapes.tableLine);var D=Ca.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var M=function(cb,fb,Xa){for(var wb=[],sb=0;sb<cb.length;sb++){var qb=cb[sb];wb.push(null==qb?null:new mxPoint((Aa+qb.x+fb)*ma,(xa+qb.y+Xa)*ma))}return wb},N=this,W=this.graph,ca=W.model,ma=W.view.scale,pa=this.state,va=this.selectionBorder,Aa=this.state.origin.x+W.view.translate.x,+xa=this.state.origin.y+W.view.translate.y;null==D&&(D=[]);var Ma=W.view.getCellStates(ca.getChildCells(this.state.cell,!0));if(0<Ma.length){var Wa=ca.getChildCells(Ma[0].cell,!0),Za=W.getTableLines(this.state.cell,!1,!0),pb=W.getTableLines(this.state.cell,!0,!1);for(ca=0;ca<Ma.length;ca++)mxUtils.bind(this,function(cb){var fb=Ma[cb],Xa=null;if(W.isCellMovable(fb.cell)){Xa=cb<Ma.length-1?Ma[cb+1]:null;Xa=null!=Xa?W.getCellGeometry(Xa.cell):null;var wb=null!=Xa&&null!=Xa.alternateBounds?Xa.alternateBounds:+Xa;Xa=null!=pb[cb]?new wa(pb[cb],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Xa.isDashed=va.isDashed;Xa.svgStrokeTolerance++;Xa=new mxHandle(fb,"row-resize",null,Xa);Xa.tableHandle=!0;var sb=0;Xa.shape.node.parentNode.insertBefore(Xa.shape.node,Xa.shape.node.parentNode.firstChild);Xa.redraw=function(){if(null!=this.shape){this.shape.stroke=0==sb?mxConstants.NONE:va.stroke;if(this.shape.constructor==wa)this.shape.line=M(pb[cb],0,sb),this.shape.updateBoundsFromLine();else{var qb=+W.getActualStartSize(pa.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+sb*ma;this.shape.bounds.x=pa.x+(cb==Ma.length-1?0:qb.x*ma);this.shape.bounds.width=pa.width-(cb==Ma.length-1?0:qb.width+qb.x+ma)}this.shape.redraw()}};Xa.setPosition=function(qb,zb,Fb){sb=Math.max(Graph.minTableRowHeight-qb.height,zb.y-qb.y-qb.height);null!=wb&&mxEvent.isShiftDown(Fb.getEvent())&&(sb=Math.min(sb,wb.height-Graph.minTableRowHeight))};Xa.execute=function(qb){if(0!=sb){var zb=+mxEvent.isShiftDown(qb.getEvent());(qb=mxEvent.isControlDown(qb.getEvent())||mxEvent.isMetaDown(qb.getEvent()))&&zb?W.distributeRows(pa.cell):qb?W.resizeAllTableRows(pa.cell,sb):W.setTableRowHeight(this.state.cell,sb,!zb)}else N.blockDelayedSelection||(zb=W.getCellAt(qb.getGraphX(),qb.getGraphY())||pa.cell,W.graphHandler.selectCellForEvent(zb,qb));sb=0};Xa.reset=function(){sb=0}}D.push(Xa)})(ca);for(ca=0;ca<Wa.length;ca++)mxUtils.bind(this,function(cb){var fb=W.view.getState(Wa[cb]),Xa=W.getCellGeometry(Wa[cb]),+wb=null!=Xa.alternateBounds?Xa.alternateBounds:Xa;null==fb&&(fb=new mxCellState(W.view,Wa[cb],W.getCellStyle(Wa[cb])),fb.x=pa.x+Xa.x*ma,fb.y=pa.y+Xa.y*ma,fb.width=wb.width*ma,fb.height=wb.height*ma,fb.updateCachedBounds());Xa=cb<Wa.length-1?Wa[cb+1]:null;Xa=null!=Xa?W.getCellGeometry(Xa):null;var sb=null!=Xa&&null!=Xa.alternateBounds?Xa.alternateBounds:Xa;Xa=null!=Za[cb]?new wa(Za[cb],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Xa.isDashed=va.isDashed;Xa.svgStrokeTolerance++;+fb=new mxHandle(fb,"col-resize",null,Xa);fb.tableHandle=!0;var qb=0;fb.shape.node.parentNode.insertBefore(fb.shape.node,fb.shape.node.parentNode.firstChild);fb.redraw=function(){if(null!=this.shape){this.shape.stroke=0==qb?mxConstants.NONE:va.stroke;if(this.shape.constructor==wa)this.shape.line=M(Za[cb],qb,0),this.shape.updateBoundsFromLine();else{var zb=W.getActualStartSize(pa.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(wb.width+qb)*ma;this.shape.bounds.y=pa.y+(cb==Wa.length-+1?0:zb.y*ma);this.shape.bounds.height=pa.height-(cb==Wa.length-1?0:(zb.height+zb.y)*ma)}this.shape.redraw()}};fb.setPosition=function(zb,Fb,Jb){qb=Math.max(Graph.minTableColumnWidth-wb.width,Fb.x-zb.x-wb.width);null!=sb&&mxEvent.isShiftDown(Jb.getEvent())&&(qb=Math.min(qb,sb.width-Graph.minTableColumnWidth))};fb.execute=function(zb){if(0!=qb){var Fb=mxEvent.isShiftDown(zb.getEvent());(zb=mxEvent.isControlDown(zb.getEvent())||mxEvent.isMetaDown(zb.getEvent()))&&Fb?W.distributeColumns(pa.cell):zb?W.resizeAllTableColumns(pa.cell,+qb):W.setTableColumnWidth(this.state.cell,qb,!Fb)}else N.blockDelayedSelection||(Fb=W.getCellAt(zb.getGraphX(),zb.getGraphY())||pa.cell,W.graphHandler.selectCellForEvent(Fb,zb));qb=0};fb.positionChanged=function(){};fb.reset=function(){qb=0};D.push(fb)})(ca)}}if(this.graph.isLockedGroupIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){null==D&&(D=[]);N=this;W=this.graph;var rb=this.state.cell,tb=16,ob=this.graph.isLockedGroup(rb);ca=new mxImageShape(new mxRectangle(0,0,tb,tb),+(ob?HoverIcons.prototype.lockHandle:HoverIcons.prototype.unlockHandle).src);ca.preserveImageAspect=!1;ca=new mxHandle(this.state,"pointer",null,ca);ca.lockHandle=!0;ca.setPosition=function(){};ca.positionChanged=function(){};ca.reset=function(){};ca.redraw=function(){if(null!=this.shape){var cb=N.getHandlePadding(),fb=W.getNestedCornerIconOffset(rb,N.bounds.x,N.bounds.y,function(sb){return W.isLockedGroupIconVisible(sb)&&W.isCellMovable(sb)});cb=new mxPoint(N.bounds.x-12-cb.x/2-fb,N.bounds.y-12-cb.y/+2-fb);W.isMoveIconVisible(rb)&&W.isCellMovable(rb)&&(cb.y+=24);fb=Number(null!=N.currentAlpha?N.currentAlpha:N.state.style[mxConstants.STYLE_ROTATION]||"0");var Xa=mxUtils.toRadians(fb);if(0!=Xa){var wb=new mxPoint(N.state.getCenterX(),N.state.getCenterY());cb=mxUtils.getRotatedPoint(cb,Math.cos(Xa),Math.sin(Xa),wb)}this.shape.bounds.width=tb;this.shape.bounds.height=tb;this.shape.bounds.x=cb.x-tb/2;this.shape.bounds.y=cb.y-tb/2;this.shape.rotation=fb;this.shape.redraw()}};ca.execute=function(cb){W.getModel().beginUpdate();+try{W.setCellStyles("lockedGroup",ob?"0":"1",[rb])}finally{W.getModel().endUpdate()}if(!ob){cb=W.getSelectionCells();for(var fb=[],Xa=0;Xa<cb.length;Xa++)cb[Xa]!=rb&&W.model.isAncestor(rb,cb[Xa])||fb.push(cb[Xa]);fb.length!=cb.length&&W.setSelectionCells(0<fb.length?fb:[rb])}};D.push(ca)}this.graph.isEditIconVisible(this.state.cell)&&(null==D&&(D=[]),N=this,W=this.graph,rb=this.state.cell,tb=16,ca=new mxImageShape(new mxRectangle(0,0,tb,tb),HoverIcons.prototype.editHandle.src),ca.preserveImageAspect=+!1,ca=new mxHandle(this.state,"pointer",null,ca),ca.editIconHandle=!0,ca.setPosition=function(){},ca.positionChanged=function(){},ca.reset=function(){},ca.redraw=function(){if(null!=this.shape){var cb=N.getHandlePadding(),fb=W.getNestedCornerIconOffset(rb,N.bounds.x,N.bounds.y,function(sb){return W.isEditIconVisible(sb)});cb=new mxPoint(N.bounds.x-12-cb.x/2-fb,N.bounds.y-12-cb.y/2-fb);W.isCellMovable(rb)&&(W.isLockedGroupIconVisible(rb)||W.isMoveIconVisible(rb))&&(cb.x+=24);fb=Number(null!=N.currentAlpha?+N.currentAlpha:N.state.style[mxConstants.STYLE_ROTATION]||"0");var Xa=mxUtils.toRadians(fb);if(0!=Xa){var wb=new mxPoint(N.state.getCenterX(),N.state.getCenterY());cb=mxUtils.getRotatedPoint(cb,Math.cos(Xa),Math.sin(Xa),wb)}this.shape.bounds.width=tb;this.shape.bounds.height=tb;this.shape.bounds.x=cb.x-tb/2;this.shape.bounds.y=cb.y-tb/2;this.shape.rotation=fb;this.shape.redraw()}},ca.execute=function(cb){W.startEditingAtCell(rb)},D.push(ca));this.graph.isMoveIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&+(null==D&&(D=[]),N=this,W=this.graph,rb=this.state.cell,tb=16,ca=new mxImageShape(new mxRectangle(0,0,tb,tb),HoverIcons.prototype.moveHandle.src),ca.preserveImageAspect=!1,ca=new mxHandle(this.state,"move",null,ca),ca.moveGroupHandle=!0,ca.setPosition=function(){},ca.positionChanged=function(){},ca.execute=function(){},ca.reset=function(){},ca.redraw=function(){if(null!=this.shape){var cb=N.getHandlePadding(),fb=W.getNestedCornerIconOffset(rb,N.bounds.x,N.bounds.y,function(wb){return W.isMoveIconVisible(wb)&&+W.isCellMovable(wb)}),Xa=N.bounds.x-12-cb.x/2-fb;cb=N.bounds.y-12-cb.y/2-fb;this.shape.bounds.width=tb;this.shape.bounds.height=tb;this.shape.bounds.x=Xa-tb/2;this.shape.bounds.y=cb-tb/2;this.shape.redraw()}},D.push(ca));return null!=D?D.reverse():null};var Fa=mxVertexHandler.prototype.setHandlesVisible,Ha=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(D,M,N){Ha.apply(this,arguments);var W=this.graph;if(null!=this.parentState&&W.isTransparentBounds(this.parentState.cell)){var ca=+W.view.scale,ma=W.view.translate,pa=this.parentState;this.parentState=pa.clone();this.parentState.x=ca*(ma.x+pa.origin.x);this.parentState.y=ca*(ma.y+pa.origin.y)}for(ca=W.model.getParent(this.state.cell);null!=ca;)W.isTransparentBounds(ca)&&(ma=W.selectionCellsHandler.getHandler(ca),null!=ma&&null!=ma.selectionBorder&&(ma.selectionBorder.node.style.visibility="hidden")),ca=W.model.getParent(ca);if(!this.livePreviewActive&&null==this.ghostPreview&&null!=this.index&&this.index!=mxEvent.LABEL_HANDLE&&+null!=this.sizers){for(W=0;W<this.sizers.length;W++)null!=this.sizers[W]&&W!=this.index&&(this.sizers[W].node.style.display="none");null!=this.rotationShape&&this.index!=mxEvent.ROTATION_HANDLE&&(this.rotationShape.node.style.visibility="hidden");this.resizeHandlesHidden=!0}};var Na=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){if(this.resizeHandlesHidden){if(null!=this.sizers)for(var D=0;D<this.sizers.length;D++)null!=this.sizers[D]&&(this.sizers[D].node.style.display=+"");null!=this.rotationShape&&(this.rotationShape.node.style.visibility="");this.resizeHandlesHidden=null}D=this.graph;for(var M=null!=this.state?D.model.getParent(this.state.cell):null;null!=M;){if(D.isTransparentBounds(M)){var N=D.selectionCellsHandler.getHandler(M);null!=N&&null!=N.selectionBorder&&(N.selectionBorder.node.style.visibility="")}M=D.model.getParent(M)}Na.apply(this,arguments)};mxVertexHandler.prototype.setHandlesVisible=function(D){Fa.apply(this,arguments);if(null!=this.moveHandles)for(var M=+0;M<this.moveHandles.length;M++)null!=this.moveHandles[M]&&(this.moveHandles[M].node.style.visibility=D?"":"hidden");if(null!=this.cornerHandles)for(M=0;M<this.cornerHandles.length;M++)this.cornerHandles[M].node.style.visibility=D?"":"hidden";this.graph.isTransparentBounds(this.state.cell)&&null!=this.selectionBorder&&(this.selectionBorder.node.style.visibility=D?"":"hidden")};mxVertexHandler.prototype.isMoveHandlesVisible=function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};+mxVertexHandler.prototype.refreshMoveHandles=function(){var D=this.isMoveHandlesVisible();D&&null==this.moveHandles?this.moveHandles=this.createMoveHandles():D||null==this.moveHandles||this.destroyMoveHandles();if(D&&null==this.moveHandles){for(D=0;D<this.moveHandles.length;D++)null!=this.moveHandles[D]&&this.moveHandles[D].parentNode.removeChild(this.moveHandles[D]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=function(){for(var D=this.graph,M=D.model,N=[],W=0;W<M.getChildCount(this.state.cell);W++)mxUtils.bind(this,+function(ca){if(null!=ca&&M.isVertex(ca.cell)&&D.isCellMovable(ca.cell)){var ma=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);ma=new mxImageShape(ma,this.rowHandleImage.src);ma.rowState=ca;ma.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;ma.init(this.graph.getView().getOverlayPane());ma.node.style.cursor="move";mxEvent.addGestureListeners(ma.node,mxUtils.bind(this,function(pa){this.graph.popupMenuHandler.hideMenu();+this.graph.stopEditing(!1);!this.graph.isToggleEvent(pa)&&this.graph.isCellSelected(ca.cell)||this.graph.selectCellForEvent(ca.cell,pa);mxEvent.isPopupTrigger(pa)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(pa),mxEvent.getClientY(pa),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(pa),this.graph.isMouseDown=!0);mxEvent.consume(pa)}),null,mxUtils.bind(this,function(pa){mxEvent.isPopupTrigger(pa)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(pa),+mxEvent.getClientY(pa),ca.cell,pa),mxEvent.consume(pa))}));N.push(ma)}else N.push(null)})(this.graph.view.getState(M.getChildAt(this.state.cell,W)));return N};mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var D=0;D<this.moveHandles.length;D++)null!=this.moveHandles[D]&&this.moveHandles[D].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=function(){if(null!=this.cornerHandles){for(var D=0;D<this.cornerHandles.length;D++)null!=+this.cornerHandles[D]&&null!=this.cornerHandles[D].node&&null!=this.cornerHandles[D].node.parentNode&&this.cornerHandles[D].node.parentNode.removeChild(this.cornerHandles[D].node);this.cornerHandles=null}};var La=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){La.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell))this.refreshMoveHandles();else if(this.graph.isCellMovable(this.state.cell)&&+(this.graph.isTransparentBounds(this.state.cell)||1==this.graph.getSelectionCount()&&(this.graph.isTableCell(this.state.cell)||this.graph.isTableRow(this.state.cell)))){this.cornerHandles=[];for(var D=0;4>D;D++){var M=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);M.dialect=mxConstants.DIALECT_SVG;M.init(this.graph.view.getOverlayPane());this.cornerHandles.push(M)}}this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();+D=this.graph.getLinkForCell(this.state.cell);M=this.graph.getLinksForState(this.state);this.updateLinkHint(D,M)};var Da=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var D=new mxPoint(0,0),M=this.tolerance,N=this.state.style.shape;null==mxCellRenderer.defaultShapes[N]&&mxStencilRegistry.getStencil(N);N=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;if(!N&&null!=this.customHandles)for(var W=0;W<this.customHandles.length;W++)if(null!=+this.customHandles[W]&&!this.customHandles[W].lockHandle&&!this.customHandles[W].editIconHandle&&!this.customHandles[W].moveGroupHandle&&null!=this.customHandles[W].shape&&null!=this.customHandles[W].shape.bounds){var ca=this.customHandles[W].shape.bounds,ma=ca.getCenterX(),pa=ca.getCenterY();if(Math.abs(this.state.x-ma)<ca.width/2||Math.abs(this.state.y-pa)<ca.height/2||Math.abs(this.state.x+this.state.width-ma)<ca.width/2||Math.abs(this.state.y+this.state.height-pa)<ca.height/2){N=!0;break}}N&&+null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(M/=2,this.graph.isTable(this.state.cell)&&(M+=7),D.x=this.sizers[0].bounds.width+M,D.y=this.sizers[0].bounds.height+M):D=Da.apply(this,arguments);return D};mxVertexHandler.prototype.updateHint=function(D){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"°";else{D=this.state.view.scale;+var M=this.state.view.unit;this.hint.innerHTML=d(this.roundLength(this.bounds.width/D),M)+" x "+d(this.roundLength(this.bounds.height/D),M)}D=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==D&&(D=this.bounds);this.hint.style.left=D.x+Math.round((D.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=D.y+D.height+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")}};mxVertexHandler.prototype.removeHint=+function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};var Sa=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=function(){Sa.apply(this,arguments);var D=this.graph.getLinkForCell(this.state.cell),M=this.graph.getLinksForState(this.state);this.updateLinkHint(D,M)};var Oa=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(D,M){Oa.apply(this,arguments);null!=this.linkHint&&"none"!=this.linkHint.style.display&&+null!=this.graph.graphHandler&&null!=this.graph.graphHandler.first&&(this.linkHint.style.display="none")};var Ta=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(D,M){Ta.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(D,M,N){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));var W=this.graph.view.translate,+ca=this.graph.view.scale,ma=this.roundLength(M.x/ca-W.x);W=this.roundLength(M.y/ca-W.y);var pa=this.graph.view.unit;this.hint.innerHTML=d(ma,pa)+", "+d(W,pa);this.hint.style.visibility="visible";null!=N&&(N.view.updateEdgeBounds(N),this.hint.innerHTML+=" ("+(pa==mxConstants.POINTS?Math.round(N.length/ca):d(N.length/ca,pa))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(N=this.constraintHandler.currentConstraint.point,+this.hint.innerHTML="["+Math.round(100*N.x)+"%, "+Math.round(100*N.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(D.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(D.getGraphY(),M.y)+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")};Graph.createFoldingImage=function(D,M){return M?Graph.createSvgImage(D,D,'<defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 4.5 2 L 4.5 7 M 2 4.5 L 7 4.5 z" stroke="#000"/>',+9,9):Graph.createSvgImage(D,D,'<defs><linearGradient id="grad1" x1="50%" y1="0%" x2="50%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 2 4.5 L 7 4.5 z" stroke="#000"/>',9,9)};Graph.updateFoldingImages=function(D){Graph.prototype.expandedImage=Graph.createFoldingImage(D,!1);Graph.prototype.collapsedImage=Graph.createFoldingImage(D,+!0)};Graph.updateFoldingImages(9);Graph.foldingImages={};Graph.prototype.getFoldingImage=function(D){var M=mxGraph.prototype.getFoldingImage.apply(this,arguments);if(null!=M){var N=parseInt(mxUtils.getValue(D.style,"foldingIconSize",0));if(0<N){var W=N+"-"+this.isCellCollapsed(D.cell);M=Graph.foldingImages[W];null==M&&(M=Graph.createFoldingImage(N,this.isCellCollapsed(D.cell)),Graph.foldingImages[W]=M)}}return M};mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;HoverIcons.prototype.mainHandle=+Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');+HoverIcons.prototype.endFixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.terminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.endTerminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="'++HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.rotationHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" fill="'+HoverIcons.prototype.arrowFill+'" d="M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"/>',24,24);HoverIcons.prototype.connectHandle=Graph.createSvgImage(16,16,'<circle cx="12" cy="12" r="10" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><path transform="translate(5,5) scale(0.583)" d="M6 18v-3h7.6L4 5.4 5.4 4 15 13.6V6h3v12z" fill="#fff"/>',24,24);HoverIcons.prototype.lockHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/>',24,24);HoverIcons.prototype.unlockHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M18 8h-1V6c0-2.76-2.24-5-5-5-2.28 0-4.27 .54-4.84 2.75-.14.54.18 1.08.72 1.22.53.14 1.08-.18 1.22-.72C9.44 3.93 10.63 3 12 3c1.65 0 3 1.35 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/>',24,24);HoverIcons.prototype.editHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/>',24,24);HoverIcons.prototype.moveHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M12 2 L9 5 L11 5 L11 11 L5 11 L5 9 L2 12 L5 15 L5 13 L11 13 L11 19 L9 19 L12 22 L15 19 L13 19 L13 13 L19 13 L19 15 L22 12 L19 9 L19 11 L13 11 L13 5 L15 5 Z"/>',@@ -3034,7 +3035,7 @@ arguments);"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.endMovePrmxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxConstraintHandler.prototype.getTolerance=function(D){return mxEvent.isMouseEvent(D.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(D){var M=D.getEvent();return null==D.getState()&&!mxEvent.isMouseEvent(M)||mxEvent.isPopupTrigger(M)&&(null==D.getState()||mxEvent.isControlDown(M)||mxEvent.isShiftDown(M))}}else mxPanningHandler.prototype.isPanningTrigger=function(D){var M=D.getEvent();return mxEvent.isLeftMouseButton(M)&&(this.useLeftButtonForPanning&&null==D.getState()||mxEvent.isControlDown(M)&&!mxEvent.isShiftDown(M))||this.usePopupTrigger&&mxEvent.isPopupTrigger(M)};mxRubberband.prototype.isSpaceEvent=function(D){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&(mxEvent.isControlDown(D.getEvent())||mxEvent.isMetaDown(D.getEvent()))&&mxEvent.isShiftDown(D.getEvent())&&mxEvent.isAltDown(D.getEvent())};mxRubberband.prototype.cancelled=!1;mxRubberband.prototype.cancel=function(){this.isActive()&&(this.cancelled=!0,this.reset())};mxRubberband.prototype.mouseUp=function(D,M){if(this.cancelled)this.cancelled=!1,M.consume();else{var N=null!=this.div&&"none"!=this.div.style.display,W=null,ca=null,ma=D=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(W=this.first.x,ca=this.first.y,D=(this.currentX-W)/this.graph.view.scale,ma=(this.currentY-ca)/this.graph.view.scale,mxEvent.isAltDown(M.getEvent())||(D=this.graph.snap(D),-ma=this.graph.snap(ma),this.graph.isGridEnabled()||(Math.abs(D)<this.graph.tolerance&&(D=0),Math.abs(ma)<this.graph.tolerance&&(ma=0))));this.reset();if(N){if(this.isSpaceEvent(M)){this.graph.model.beginUpdate();try{var pa=this.graph.getCellsBeyond(W,ca,this.graph.getDefaultParent(),!0,!0);for(N=0;N<pa.length;N++)if(this.graph.isCellMovable(pa[N])){var ua=this.graph.view.getState(pa[N]),Aa=this.graph.getCellGeometry(pa[N]);null!=ua&&null!=Aa&&(Aa=Aa.clone(),Aa.translate(D,ma),this.graph.model.setGeometry(pa[N],+ma=this.graph.snap(ma),this.graph.isGridEnabled()||(Math.abs(D)<this.graph.tolerance&&(D=0),Math.abs(ma)<this.graph.tolerance&&(ma=0))));this.reset();if(N){if(this.isSpaceEvent(M)){this.graph.model.beginUpdate();try{var pa=this.graph.getCellsBeyond(W,ca,this.graph.getDefaultParent(),!0,!0);for(N=0;N<pa.length;N++)if(this.graph.isCellMovable(pa[N])){var va=this.graph.view.getState(pa[N]),Aa=this.graph.getCellGeometry(pa[N]);null!=va&&null!=Aa&&(Aa=Aa.clone(),Aa.translate(D,ma),this.graph.model.setGeometry(pa[N],Aa))}}finally{this.graph.model.endUpdate()}}else pa=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(pa,M.getEvent());M.consume()}}};mxRubberband.prototype.mouseMove=function(D,M){if(!M.isConsumed()&&null!=this.first){var N=mxUtils.getScrollOrigin(this.graph.container);D=mxUtils.getOffset(this.graph.container);N.x-=D.x;N.y-=D.y;D=M.getX()+N.x;N=M.getY()+N.y;var W=this.first.x-D,ca=this.first.y-N,ma=this.graph.tolerance;if(null!=this.div||Math.abs(W)>ma||Math.abs(ca)>ma)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(D,N),this.isSpaceEvent(M)?(D=this.x+this.width,N=this.y+this.height,W=this.graph.view.scale,mxEvent.isAltDown(M.getEvent())||(this.width=this.graph.snap(this.width/W)*W,this.height=this.graph.snap(this.height/W)*W,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=D-this.width),this.y<this.first.y&&(this.y=N-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+@@ -3058,9 +3059,9 @@ mxVertexHandler.prototype.mouseUp=function(D,M){Mb.apply(this,arguments);null!=tnull};mxVertexHandler.prototype.updateLinkHint=function(D,M){try{if(null==D&&(null==M||0==M.length))null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=D||null!=M&&0<M.length){var N=document.createElement("img");N.className="geAdaptiveAsset";N.setAttribute("src",Editor.editImage);N.setAttribute("title",mxResources.get("editLink"));N.setAttribute("width","14");N.setAttribute("height","14");N.style.paddingLeft="8px";N.style.marginLeft="auto";N.style.marginBottom="-1px";N.style.cursor="pointer";var W=N.cloneNode(!0);W.setAttribute("src",Editor.trashImage);W.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));W.style.paddingLeft="4px";W.style.marginLeft="0";null==this.linkHint&&(this.linkHint=b(),mxUtils.setPrefixedStyle(this.linkHint.style,"transform","translate(-50%,0)"),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint),mxEvent.addListener(this.linkHint,"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()})));this.linkHint.innerText="";if(null!=D){var ca=document.createElement("div");ca.style.display="flex";ca.style.alignItems="center";ca.appendChild(this.graph.createLinkForHint(D,null,this.state.cell));this.linkHint.appendChild(ca);if(this.graph.isEnabled()&&"function"===typeof this.graph.editLink&&!this.graph.isCellLocked(this.state.cell)){var ma=N.cloneNode(!0);ca.appendChild(ma);mxEvent.addListener(ma,"click",mxUtils.bind(this,-function(ua){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(ua)}));var pa=W.cloneNode(!0);ca.appendChild(pa);mxEvent.addListener(pa,"click",mxUtils.bind(this,function(ua){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(ua)}))}}if(null!=M)for(ca=0;ca<M.length;ca++)mxUtils.bind(this,function(ua,Aa){var xa=document.createElement("div");xa.style.display="flex";xa.style.alignItems="center";xa.style.marginTop=null!=D||0<Aa?"6px":"0px";xa.appendChild(this.graph.createLinkForHint(ua.getAttribute("href"),-mxUtils.getTextContent(ua),this.state.cell));var Ma=N.cloneNode(!0);xa.appendChild(Ma);var Wa=mxUtils.bind(this,function(Za){var pb=document.createElement("div");pb.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var rb=pb.getElementsByTagName("a")[Aa];if(null!=rb){if(null==Za||""==Za){for(Za=rb.cloneNode(!0).firstChild;null!=Za;)rb.parentNode.insertBefore(Za.cloneNode(!0),rb),Za=Za.nextSibling;rb.parentNode.removeChild(rb)}else rb.setAttribute("href",Za);this.graph.labelChanged(this.state.cell,-pb.innerHTML)}});mxEvent.addListener(Ma,"click",mxUtils.bind(this,function(Za){this.graph.showLinkDialog(ua.getAttribute("href")||"",mxResources.get("ok"),Wa);mxEvent.consume(Za)}));Ma=W.cloneNode(!0);xa.appendChild(Ma);mxEvent.addListener(Ma,"click",mxUtils.bind(this,function(Za){Wa();mxEvent.consume(Za)}));this.linkHint.appendChild(xa)})(M[ca],ca)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(ua){}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var Pb=+function(va){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(va)}));var pa=W.cloneNode(!0);ca.appendChild(pa);mxEvent.addListener(pa,"click",mxUtils.bind(this,function(va){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(va)}))}}if(null!=M)for(ca=0;ca<M.length;ca++)mxUtils.bind(this,function(va,Aa){var xa=document.createElement("div");xa.style.display="flex";xa.style.alignItems="center";xa.style.marginTop=null!=D||0<Aa?"6px":"0px";xa.appendChild(this.graph.createLinkForHint(va.getAttribute("href"),+mxUtils.getTextContent(va),this.state.cell));var Ma=N.cloneNode(!0);xa.appendChild(Ma);var Wa=mxUtils.bind(this,function(Za){var pb=document.createElement("div");pb.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var rb=pb.getElementsByTagName("a")[Aa];if(null!=rb){if(null==Za||""==Za){for(Za=rb.cloneNode(!0).firstChild;null!=Za;)rb.parentNode.insertBefore(Za.cloneNode(!0),rb),Za=Za.nextSibling;rb.parentNode.removeChild(rb)}else rb.setAttribute("href",Za);this.graph.labelChanged(this.state.cell,+pb.innerHTML)}});mxEvent.addListener(Ma,"click",mxUtils.bind(this,function(Za){this.graph.showLinkDialog(va.getAttribute("href")||"",mxResources.get("ok"),Wa);mxEvent.consume(Za)}));Ma=W.cloneNode(!0);xa.appendChild(Ma);mxEvent.addListener(Ma,"click",mxUtils.bind(this,function(Za){Wa();mxEvent.consume(Za)}));this.linkHint.appendChild(xa)})(M[ca],ca)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(va){}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var Pb=mxEdgeHandler.prototype.createConstraintHandler;mxEdgeHandler.prototype.createConstraintHandler=function(){var D=Pb.apply(this,arguments);D.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});return D};var Tb=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){Tb.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var Vb=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){if(null!=this.moveHandles)for(var D=0;D<this.moveHandles.length;D++)null!=this.moveHandles[D]&&(this.moveHandles[D].bounds.x=Math.round(this.moveHandles[D].rowState.x+this.moveHandles[D].rowState.width-this.moveHandles[D].bounds.width/2),this.moveHandles[D].bounds.y=Math.round(this.moveHandles[D].rowState.y+(this.moveHandles[D].rowState.height-this.moveHandles[D].bounds.height)/2),this.moveHandles[D].redraw());if(null!=this.cornerHandles){D=this.getSelectionBorderInset();var M=this.cornerHandles,N=M[0].bounds.height/2;M[0].bounds.x=this.state.x-M[0].bounds.width/2+D;M[0].bounds.y=this.state.y-N+D;M[0].redraw();M[1].bounds.x=M[0].bounds.x+this.state.width-2*D;M[1].bounds.y=M[0].bounds.y;M[1].redraw();M[2].bounds.x=M[0].bounds.x;M[2].bounds.y=this.state.y+this.state.height-2*D;M[2].redraw();M[3].bounds.x=M[1].bounds.x;M[3].bounds.y=M[2].bounds.y;M[3].redraw();M=1==this.graph.getSelectionCount()&&(!this.graph.isTransparentBounds(this.state.cell)||this.graph.isCellSelected(this.state.cell));@@ -3072,302 +3073,302 @@ this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,M=null!=this.stateGraph.getLabelAutoRotation(this.state);this.selectionBorder.rotation=null!=D?D:Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")}Gb.apply(this,arguments)};var Nb=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){Nb.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();null!=this.linkHint&&(null!=this.linkHint.parentNode&&this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getSelectionModel().removeListener(this.changeHandler),this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var Wb=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(Wb.apply(this),null!=this.state&&null!=this.linkHint)){var D=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(D=new mxRectangle(D.x,D.y,D.width,D.height),D.add(this.state.text.bounds));this.linkHint.style.left=D.x+D.width/2+"px";this.linkHint.style.top=Math.round(D.y+D.height+Editor.hintOffset)+"px";this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":""}};var Yb=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=function(){Yb.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Ab=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Ab.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),-this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(g,r,A){mxShape.call(this);this.line=g;this.stroke=r;this.strokewidth=null!=A?A:1;this.updateBoundsFromLine()}function d(){mxSwimlane.call(this)}function m(){mxSwimlane.call(this)}function p(){mxCylinder.call(this)}function v(){mxConnector.call(this)}function n(){mxCylinder.call(this)}function y(){mxActor.call(this)}function C(){mxCylinder.call(this)}function P(){mxCylinder.call(this)}function G(){mxCylinder.call(this)}function O(){mxCylinder.call(this)}function U(){mxShape.call(this)}-function c(){mxShape.call(this)}function f(g,r,A,u){mxShape.call(this);this.bounds=g;this.fill=r;this.stroke=A;this.strokewidth=null!=u?u:1}function k(){mxActor.call(this)}function q(){mxCylinder.call(this)}function x(){mxCylinder.call(this)}function B(){mxShape.call(this)}function E(){mxActor.call(this)}function L(){mxActor.call(this)}function Q(){mxActor.call(this)}function V(){mxActor.call(this)}function K(){mxActor.call(this)}function fa(){mxActor.call(this)}function aa(){mxActor.call(this)}function da(g,+this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(g,r,A){mxShape.call(this);this.line=g;this.stroke=r;this.strokewidth=null!=A?A:1;this.updateBoundsFromLine()}function d(){mxSwimlane.call(this)}function m(){mxSwimlane.call(this)}function p(){mxCylinder.call(this)}function u(){mxConnector.call(this)}function n(){mxCylinder.call(this)}function y(){mxActor.call(this)}function B(){mxCylinder.call(this)}function P(){mxCylinder.call(this)}function G(){mxCylinder.call(this)}function O(){mxCylinder.call(this)}function U(){mxShape.call(this)}+function c(){mxShape.call(this)}function f(g,r,A,v){mxShape.call(this);this.bounds=g;this.fill=r;this.stroke=A;this.strokewidth=null!=v?v:1}function k(){mxActor.call(this)}function q(){mxCylinder.call(this)}function x(){mxCylinder.call(this)}function C(){mxShape.call(this)}function E(){mxActor.call(this)}function L(){mxActor.call(this)}function Q(){mxActor.call(this)}function V(){mxActor.call(this)}function K(){mxActor.call(this)}function fa(){mxActor.call(this)}function aa(){mxActor.call(this)}function da(g,r){this.canvas=g;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=r;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,da.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,da.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,da.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,da.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,da.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,da.prototype.arcTo)}function ba(){mxRectangleShape.call(this)}function ha(){mxRectangleShape.call(this)}function qa(){mxActor.call(this)}function ra(){mxActor.call(this)}function l(){mxActor.call(this)}function t(){mxRectangleShape.call(this)}function H(){mxRectangleShape.call(this)}function J(){mxCylinder.call(this)}function R(){mxShape.call(this)}-function T(){mxShape.call(this)}function Y(){mxEllipse.call(this)}function Z(){mxShape.call(this)}function ia(){mxShape.call(this)}function ka(g,r){function A(){mxShape.call(this)}mxUtils.extend(A,mxShape);A.prototype.iconSize=r;A.prototype.paintBackground=function(u,z,F,I,ea){ea=Math.min(this.iconSize,I,ea);z+=(I-ea)/2;g.prototype.hasOwnProperty("paintVertexShape")?g.prototype.paintVertexShape.call(this,u,z,F,ea,ea):(g.prototype.paintBackground.call(this,u,z,F,ea,ea),"function"===typeof g.prototype.paintForeground&&-g.prototype.paintForeground.call(this,u,z,F,ea,ea))};return A}function X(){mxShape.call(this)}function ja(){mxShape.call(this)}function na(){mxShape.call(this)}function la(){mxShape.call(this)}function va(){mxShape.call(this)}function za(){mxRectangleShape.call(this)}function sa(){mxShape.call(this)}function wa(){mxShape.call(this)}function Ca(){mxShape.call(this)}function Fa(){mxShape.call(this)}function Ha(){mxShape.call(this)}function Na(){mxCylinder.call(this)}function La(){mxCylinder.call(this)}+function T(){mxShape.call(this)}function Y(){mxEllipse.call(this)}function Z(){mxShape.call(this)}function ia(){mxShape.call(this)}function ja(g,r){function A(){mxShape.call(this)}mxUtils.extend(A,mxShape);A.prototype.iconSize=r;A.prototype.paintBackground=function(v,z,F,I,ea){ea=Math.min(this.iconSize,I,ea);z+=(I-ea)/2;g.prototype.hasOwnProperty("paintVertexShape")?g.prototype.paintVertexShape.call(this,v,z,F,ea,ea):(g.prototype.paintBackground.call(this,v,z,F,ea,ea),"function"===typeof g.prototype.paintForeground&&+g.prototype.paintForeground.call(this,v,z,F,ea,ea))};return A}function X(){mxShape.call(this)}function ka(){mxShape.call(this)}function na(){mxShape.call(this)}function la(){mxShape.call(this)}function ua(){mxShape.call(this)}function za(){mxRectangleShape.call(this)}function sa(){mxShape.call(this)}function wa(){mxShape.call(this)}function Ca(){mxShape.call(this)}function Fa(){mxShape.call(this)}function Ha(){mxShape.call(this)}function Na(){mxCylinder.call(this)}function La(){mxCylinder.call(this)}function Da(){mxRectangleShape.call(this)}function Sa(){mxDoubleEllipse.call(this)}function Oa(){mxDoubleEllipse.call(this)}function Ta(){mxArrowConnector.call(this);this.spacing=0}function Ua(){mxArrowConnector.call(this);this.spacing=0}function Ba(){mxActor.call(this)}function Ka(){mxRectangleShape.call(this)}function ab(){mxActor.call(this)}function Qa(){mxActor.call(this)}function db(){mxActor.call(this)}function Va(){mxActor.call(this)}function nb(){mxActor.call(this)}function bb(){mxActor.call(this)}function ya(){mxActor.call(this)}function Ra(){mxActor.call(this)}function Ya(){mxActor.call(this)}function lb(){mxActor.call(this)}function ub(){mxEllipse.call(this)}function gb(){mxEllipse.call(this)}function jb(){mxEllipse.call(this)}function yb(){mxRhombus.call(this)}function Bb(){mxEllipse.call(this)}function Cb(){mxEllipse.call(this)}function Kb(){mxEllipse.call(this)}function Xb(){mxEllipse.call(this)}function Ob(){mxActor.call(this)}function Ub(){mxActor.call(this)}function Qb(){mxActor.call(this)}-function xb(g,r,A,u){mxShape.call(this);this.bounds=g;this.fill=r;this.stroke=A;this.strokewidth=null!=u?u:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=!0;this.indent=2;this.rectOutline="single"}function Mb(){mxConnector.call(this)}function Pb(){mxConnector.call(this)}function Tb(){mxActor.call(this)}function Vb(g,r,A,u,z,F,I,ea,S,ta){I+=S;var oa=u.clone();u.x-=z*(2*I+S);u.y-=F*(2*I+S);z*=I+S;F*=I+S;return function(){g.ellipse(oa.x-z-I,oa.y-F-I,2*I,2*I);ta?g.fillAndStroke():g.stroke()}}+function xb(g,r,A,v){mxShape.call(this);this.bounds=g;this.fill=r;this.stroke=A;this.strokewidth=null!=v?v:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=!0;this.indent=2;this.rectOutline="single"}function Mb(){mxConnector.call(this)}function Pb(){mxConnector.call(this)}function Tb(){mxActor.call(this)}function Vb(g,r,A,v,z,F,I,ea,S,ta){I+=S;var oa=v.clone();v.x-=z*(2*I+S);v.y-=F*(2*I+S);z*=I+S;F*=I+S;return function(){g.ellipse(oa.x-z-I,oa.y-F-I,2*I,2*I);ta?g.fillAndStroke():g.stroke()}}function Gb(){mxRectangleShape.call(this)}function Nb(){mxActor.call(this)}function Wb(){mxShape.call(this)}function Yb(){mxShape.call(this)}function Ab(){mxActor.call(this)}function D(){mxActor.call(this)}function M(){mxActor.call(this)}function N(){mxActor.call(this)}function W(){mxConnector.call(this)}var ca=mxShape.prototype.getLabelMargins;mxShape.prototype.getLabelMargins=function(g){if(null!=this.stencil&&null!=this.stencil.desc&&null!=this.style){if(null==this.stencil.labelBounds){for(var r=-this.stencil.desc.getElementsByTagName("labelBounds"),A=[],u=0;u<r.length;u++)A.push({condition:r[u].getAttribute("if"),x:Number(r[u].getAttribute("x")||0),y:Number(r[u].getAttribute("y")||0),w:Number(r[u].getAttribute("w")||this.stencil.w0),h:Number(r[u].getAttribute("h")||this.stencil.h0)});this.stencil.labelBounds=A}for(u=0;u<this.stencil.labelBounds.length;u++)if(r=this.stencil.labelBounds[u],null==r.condition||"1"==mxUtils.getValue(this.style,r.condition,"0")){u=this.stencil.computeAspect(this.style,-g.x,g.y,g.width,g.height);A=u.x-g.x+r.x*u.width;var z=u.y-g.y+r.y*u.height;return new mxRectangle(A,z,g.width-A-r.w*u.width,g.height-z-r.h*u.height)}}return ca.apply(this,arguments)};mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var g=null;if(null!=this.line)for(var r=0;r<this.line.length;r++){var A=this.line[r];null!=A&&(A=new mxRectangle(A.x,A.y,this.strokewidth,this.strokewidth),null==g?g=A:g.add(A))}this.bounds=null!=g?g:new mxRectangle};b.prototype.paintVertexShape=function(g,-r,A,u,z){this.paintTableLine(g,this.line,0,0)};b.prototype.paintTableLine=function(g,r,A,u){if(null!=r){var z=null;g.begin();for(var F=0;F<r.length;F++){var I=r[F];null!=I&&(null==z?g.moveTo(I.x+A,I.y+u):null!=z&&g.lineTo(I.x+A,I.y+u));z=I}g.end();g.stroke()}};b.prototype.intersectsRectangle=function(g){var r=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var A=null,u=0;u<this.line.length&&!r;u++){var z=this.line[u];null!=z&&null!=A&&(r=mxUtils.rectangleIntersectsSegment(g,-A,z));A=z}return r};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(d,mxSwimlane);d.prototype.fixedHeaderDefault=!1;d.prototype.paintVertexShape=function(g,r,A,u,z){var F=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):!1,I=this.isHorizontal(),ea=this.getTitleSize(),S=mxUtils.getValue(this.style,mxConstants.STYLE_FIXED_HEADER,this.fixedHeaderDefault);0==ea&&this.isRounded&&!this.outline?(S=mxShape.prototype.getArcSize.call(this,u,z),g.begin(),g.roundrect(r,A,u,z,-S,S),g.fillAndStroke()):0==ea&&!S||this.outline?Kb.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),g.translate(-r,-A));F||this.outline||!(I&&ea<z||!I&&ea<u)||this.paintForeground(g,r,A,u,z)};d.prototype.paintForeground=function(g,r,A,u,z){if(null!=this.state){var F=this.flipH,I=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var ea=F;F=I;I=ea}g.rotate(-this.getShapeRotation(),F,I,-r+u/2,A+z/2);s=this.scale;r=this.bounds.x/s;A=this.bounds.y/s;u=this.bounds.width/s;z=this.bounds.height/s;this.paintTableForeground(g,r,A,u,z)}};d.prototype.paintTableForeground=function(g,r,A,u,z){u=this.state.view.graph.getTableLines(this.state.cell,"0"!=mxUtils.getValue(this.state.style,"rowLines","1"),"0"!=mxUtils.getValue(this.state.style,"columnLines","1"));for(z=0;z<u.length;z++)b.prototype.paintTableLine(g,u[z],r,A)};d.prototype.configurePointerEvents=function(g){0==this.getTitleSize()?g.pointerEvents=-!1:mxSwimlane.prototype.configurePointerEvents.apply(this,arguments)};mxCellRenderer.registerShape("table",d);mxUtils.extend(m,d);m.prototype.paintForeground=function(){};mxCellRenderer.registerShape("tableRow",m);var ma=mxSwimlane.prototype.paintVertexShape;mxSwimlane.prototype.paintVertexShape=function(g,r,A,u,z){ma.apply(this,arguments);if(null!=this.state&&!this.outline){var F=this.state.view.graph;if((null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.laneFill&&this.laneFill!=mxConstants.NONE)&&-null!=F.paintTableCellLines){var I=this.state.cell;if(null!=F.isTableRow&&F.isTableRow(I)){var ea=this.getTitleSize();this.isHorizontal()?F.paintTableCellLines(g,I,0,0,u,Math.min(ea,z),this.stroke,this.strokewidth):F.paintTableCellLines(g,I,0,0,Math.min(ea,u),z,this.stroke,this.strokewidth)}else F.paintTableCellLines(g,I,0,0,u,z,this.stroke,this.strokewidth)}}};mxUtils.extend(p,mxCylinder);p.prototype.size=20;p.prototype.darkOpacity=0;p.prototype.darkOpacity2=0;p.prototype.paintVertexShape=function(g,-r,A,u,z){var F=Math.max(0,Math.min(u,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),I=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),ea=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));g.translate(r,A);g.begin();g.moveTo(0,0);g.lineTo(u-F,0);g.lineTo(u,F);g.lineTo(u,z);g.lineTo(F,z);g.lineTo(0,z-F);g.lineTo(0,0);g.close();g.end();g.fillAndStroke();this.outline||(g.setShadow(!1),-0!=I&&(g.setFillAlpha(Math.abs(I)),g.setFillColor(0>I?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(u-F,0),g.lineTo(u,F),g.lineTo(F,F),g.close(),g.fill()),0!=ea&&(g.setFillAlpha(Math.abs(ea)),g.setFillColor(0>ea?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(F,F),g.lineTo(F,z),g.lineTo(0,z-F),g.close(),g.fill()),g.begin(),g.moveTo(F,z),g.lineTo(F,F),g.lineTo(0,0),g.moveTo(F,F),g.lineTo(u,F),g.end(),g.stroke())};p.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,-"boundedLbl",!1)?(g=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(g,g,0,0)):null};mxCellRenderer.registerShape("cube",p);var pa=Math.tan(mxUtils.toRadians(30)),ua=(.5-pa)/2;mxCellRenderer.registerShape("isoRectangle",y);mxUtils.extend(v,mxConnector);v.prototype.paintEdgeShape=function(g,r){var A=this.createMarker(g,r,!0),u=this.createMarker(g,r,!1);g.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&g.setDashed(this.isDashed,-null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);g.setShadow(!1);g.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);g.setStrokeColor(this.stroke);g.setFillColor(this.stroke);g.setDashed(!1);null!=A&&A();null!=u&&u()};mxCellRenderer.registerShape("wire",v);mxUtils.extend(n,mxCylinder);n.prototype.size=6;n.prototype.paintVertexShape=function(g,r,A,u,z){g.setFillColor(this.stroke);var F=Math.max(0,parseFloat(mxUtils.getValue(this.style,-"size",this.size))-2)+2*this.strokewidth;g.ellipse(r+.5*(u-F),A+.5*(z-F),F,F);g.fill();g.setFillColor(mxConstants.NONE);g.rect(r,A,u,z);g.fill()};mxCellRenderer.registerShape("waypoint",n);mxUtils.extend(y,mxActor);y.prototype.size=20;y.prototype.redrawPath=function(g,r,A,u,z){r=Math.min(u,z/pa);g.translate((u-r)/2,(z-r)/2+r/4);g.moveTo(0,.25*r);g.lineTo(.5*r,r*ua);g.lineTo(r,.25*r);g.lineTo(.5*r,(.5-ua)*r);g.lineTo(0,.25*r);g.close();g.end()};mxCellRenderer.registerShape("isoRectangle",y);mxUtils.extend(C,-mxCylinder);C.prototype.size=20;C.prototype.redrawPath=function(g,r,A,u,z,F){r=Math.min(u,z/(.5+pa));F?(g.moveTo(0,.25*r),g.lineTo(.5*r,(.5-ua)*r),g.lineTo(r,.25*r),g.moveTo(.5*r,(.5-ua)*r),g.lineTo(.5*r,(1-ua)*r)):(g.translate((u-r)/2,(z-r)/2),g.moveTo(0,.25*r),g.lineTo(.5*r,r*ua),g.lineTo(r,.25*r),g.lineTo(r,.75*r),g.lineTo(.5*r,(1-ua)*r),g.lineTo(0,.75*r),g.close());g.end()};mxCellRenderer.registerShape("isoCube",C);mxUtils.extend(P,mxCylinder);P.prototype.redrawPath=function(g,r,A,u,z,F){r=Math.min(z/-2,Math.round(z/8)+this.strokewidth-1);if(F&&null!=this.fill||!F&&null==this.fill)g.moveTo(0,r),g.curveTo(0,2*r,u,2*r,u,r),F||(g.stroke(),g.begin()),g.translate(0,r/2),g.moveTo(0,r),g.curveTo(0,2*r,u,2*r,u,r),F||(g.stroke(),g.begin()),g.translate(0,r/2),g.moveTo(0,r),g.curveTo(0,2*r,u,2*r,u,r),F||(g.stroke(),g.begin()),g.translate(0,-r);F||(g.moveTo(0,r),g.curveTo(0,-r/3,u,-r/3,u,r),g.lineTo(u,z-r),g.curveTo(u,z+r/3,0,z+r/3,0,z-r),g.close())};P.prototype.getLabelMargins=function(g){return new mxRectangle(0,-2.5*Math.min(g.height/2,Math.round(g.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",P);mxUtils.extend(G,mxCylinder);G.prototype.size=30;G.prototype.darkOpacity=0;G.prototype.paintVertexShape=function(g,r,A,u,z){var F=Math.max(0,Math.min(u,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),I=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));g.translate(r,A);g.begin();g.moveTo(0,0);g.lineTo(u-F,0);g.lineTo(u,-F);g.lineTo(u,z);g.lineTo(0,z);g.lineTo(0,0);g.close();g.end();g.fillAndStroke();this.outline||(g.setShadow(!1),0!=I&&(g.setFillAlpha(Math.abs(I)),g.setFillColor(0>I?"#FFFFFF":"#000000"),g.begin(),g.moveTo(u-F,0),g.lineTo(u-F,F),g.lineTo(u,F),g.close(),g.fill()),g.begin(),g.moveTo(u-F,0),g.lineTo(u-F,F),g.lineTo(u,F),g.end(),g.stroke())};mxCellRenderer.registerShape("note",G);mxUtils.extend(O,G);mxCellRenderer.registerShape("note2",O);O.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,-"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(g.height*this.scale,r*this.scale),0,0)}return null};mxUtils.extend(U,mxShape);U.prototype.isoAngle=15;U.prototype.paintVertexShape=function(g,r,A,u,z){var F=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;F=Math.min(u*Math.tan(F),.5*z);g.translate(r,A);g.begin();g.moveTo(.5*u,0);g.lineTo(u,F);g.lineTo(u,z-F);g.lineTo(.5*u,z);g.lineTo(0,z-F);g.lineTo(0,-F);g.close();g.fillAndStroke();g.setShadow(!1);g.begin();g.moveTo(0,F);g.lineTo(.5*u,2*F);g.lineTo(u,F);g.moveTo(.5*u,2*F);g.lineTo(.5*u,z);g.stroke()};mxCellRenderer.registerShape("isoCube2",U);mxUtils.extend(c,mxShape);c.prototype.size=15;c.prototype.paintVertexShape=function(g,r,A,u,z){var F=Math.max(0,Math.min(.5*z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.translate(r,A);0==F?(g.rect(0,0,u,z),g.fillAndStroke()):(g.begin(),g.moveTo(0,F),g.arcTo(.5*u,F,0,0,1,.5*u,0),g.arcTo(.5*-u,F,0,0,1,u,F),g.lineTo(u,z-F),g.arcTo(.5*u,F,0,0,1,.5*u,z),g.arcTo(.5*u,F,0,0,1,0,z-F),g.close(),g.fillAndStroke(),g.setShadow(!1),g.begin(),g.moveTo(u,F),g.arcTo(.5*u,F,0,0,1,.5*u,2*F),g.arcTo(.5*u,F,0,0,1,0,F),g.stroke())};mxCellRenderer.registerShape("cylinder2",c);mxUtils.extend(f,mxCylinder);f.prototype.size=15;f.prototype.paintVertexShape=function(g,r,A,u,z){var F=Math.max(0,Math.min(.5*z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),I=mxUtils.getValue(this.style,"lid",!0);g.translate(r,-A);0==F?(g.rect(0,0,u,z),g.fillAndStroke()):(g.begin(),I?(g.moveTo(0,F),g.arcTo(.5*u,F,0,0,1,.5*u,0),g.arcTo(.5*u,F,0,0,1,u,F)):(g.moveTo(0,0),g.arcTo(.5*u,F,0,0,0,.5*u,F),g.arcTo(.5*u,F,0,0,0,u,0)),g.lineTo(u,z-F),g.arcTo(.5*u,F,0,0,1,.5*u,z),g.arcTo(.5*u,F,0,0,1,0,z-F),g.close(),g.fillAndStroke(),g.setShadow(!1),I&&(g.begin(),g.moveTo(u,F),g.arcTo(.5*u,F,0,0,1,.5*u,2*F),g.arcTo(.5*u,F,0,0,1,0,F),g.stroke()))};mxCellRenderer.registerShape("cylinder3",f);mxUtils.extend(k,mxActor);k.prototype.redrawPath=-function(g,r,A,u,z){g.moveTo(0,0);g.quadTo(u/2,.5*z,u,0);g.quadTo(.5*u,z/2,u,z);g.quadTo(u/2,.5*z,0,z);g.quadTo(.5*u,z/2,0,0);g.end()};mxCellRenderer.registerShape("switch",k);mxUtils.extend(q,mxCylinder);q.prototype.tabWidth=60;q.prototype.tabHeight=20;q.prototype.tabPosition="right";q.prototype.arcSize=.1;q.prototype.isRoundable=function(){return!0};q.prototype.paintVertexShape=function(g,r,A,u,z){g.translate(r,A);r=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));-A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var F=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),I=mxUtils.getValue(this.style,"rounded",!1),ea=mxUtils.getValue(this.style,"absoluteArcSize",!1),S=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));ea||(S*=Math.min(u,z));S=Math.min(S,.5*u,.5*(z-A));r=Math.max(r,S);r=Math.min(u-S,r);I||(S=0);g.begin();"left"==F?(g.moveTo(Math.max(S,0),A),g.lineTo(Math.max(S,0),0),g.lineTo(r,-0),g.lineTo(r,A)):(g.moveTo(u-r,A),g.lineTo(u-r,0),g.lineTo(u-Math.max(S,0),0),g.lineTo(u-Math.max(S,0),A));I?(g.moveTo(0,S+A),g.arcTo(S,S,0,0,1,S,A),g.lineTo(u-S,A),g.arcTo(S,S,0,0,1,u,S+A),g.lineTo(u,z-S),g.arcTo(S,S,0,0,1,u-S,z),g.lineTo(S,z),g.arcTo(S,S,0,0,1,0,z-S)):(g.moveTo(0,A),g.lineTo(u,A),g.lineTo(u,z),g.lineTo(0,z));g.close();g.fillAndStroke();g.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(g.begin(),g.moveTo(u-30,A+20),g.lineTo(u-20,A+10),g.lineTo(u-10,-A+20),g.close(),g.stroke())};mxCellRenderer.registerShape("folder",q);q.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var A=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var u=mxUtils.getValue(this.style,"rounded",!1),z=mxUtils.getValue(this.style,"absoluteArcSize",!1),F=parseFloat(mxUtils.getValue(this.style,-"arcSize",this.arcSize));z||(F*=Math.min(g.width,g.height));F=Math.min(F,.5*g.width,.5*(g.height-r));u||(F=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(F,0,Math.min(g.width,g.width-A),Math.min(g.height,g.height-r)):new mxRectangle(Math.min(g.width,g.width-A),0,F,Math.min(g.height,g.height-r))}return new mxRectangle(0,Math.min(g.height,r),0,0)}return null};mxUtils.extend(x,mxCylinder);x.prototype.arcSize=.1;x.prototype.paintVertexShape=function(g,r,A,-u,z){g.translate(r,A);var F=mxUtils.getValue(this.style,"rounded",!1),I=mxUtils.getValue(this.style,"absoluteArcSize",!1);r=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));A=mxUtils.getValue(this.style,"umlStateConnection",null);I||(r*=Math.min(u,z));r=Math.min(r,.5*u,.5*z);F||(r=0);F=0;null!=A&&(F=10);g.begin();g.moveTo(F,r);g.arcTo(r,r,0,0,1,F+r,0);g.lineTo(u-r,0);g.arcTo(r,r,0,0,1,u,r);g.lineTo(u,z-r);g.arcTo(r,r,0,0,1,u-r,z);g.lineTo(F+r,z);g.arcTo(r,r,0,0,1,F,z-r);g.close();g.fillAndStroke();-g.setShadow(!1);"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(g.roundrect(u-40,z-20,10,10,3,3),g.stroke(),g.roundrect(u-20,z-20,10,10,3,3),g.stroke(),g.begin(),g.moveTo(u-30,z-15),g.lineTo(u-20,z-15),g.stroke());"connPointRefEntry"==A?(g.ellipse(0,.5*z-10,20,20),g.fillAndStroke()):"connPointRefExit"==A&&(g.ellipse(0,.5*z-10,20,20),g.fillAndStroke(),g.begin(),g.moveTo(5,.5*z-5),g.lineTo(15,.5*z+5),g.moveTo(15,.5*z-5),g.lineTo(5,.5*z+5),g.stroke())};x.prototype.getLabelMargins=-function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};mxCellRenderer.registerShape("umlState",x);mxUtils.extend(B,mxShape);B.prototype.featureColor="#666666";B.prototype.paintVertexShape=function(g,r,A,u,z){var F=mxUtils.getValue(this.style,"smileyType","happy"),I=mxUtils.getValue(this.style,"smileyFeatureColor",B.prototype.featureColor);g.translate(r,A);r=Math.min(u,z)/2;g.ellipse(u/-2-r,z/2-r,2*r,2*r);g.fillAndStroke();r=Math.min(u,z)/30;u/=2;z/=2;g.setFillColor(I);g.setStrokeColor(I);g.setStrokeWidth(2*r);I=1.5*r;A=5*r;var ea=5*r;g.ellipse(u-A-I,z-ea-I,2*I,2*I);g.fillAndStroke();g.ellipse(u+A-I,z-ea-I,2*I,2*I);g.fillAndStroke();g.setStrokeWidth(1*r);g.setFillColor("#000000");"happy"==F?(F=u,I=z+2*r,g.begin(),g.moveTo(F+7.5*r,I),g.arcTo(7.5*r,7.5*r,0,1,1,F-7.5*r,I),g.lineTo(F-6.818*r,I),g.arcTo(6.818*r,6.818*r,0,1,0,F+6.818*r,I),g.close(),g.fillAndStroke()):"sad"==F?(F=u,I=z+-7*r,g.begin(),g.moveTo(F-7.5*r,I),g.arcTo(7.5*r,7.5*r,0,1,1,F+7.5*r,I),g.lineTo(F+6.818*r,I),g.arcTo(6.818*r,6.818*r,0,1,0,F-6.818*r,I),g.close(),g.fillAndStroke()):(g.begin(),g.moveTo(u-5*r,z+7*r),g.lineTo(u+5*r,z+7*r),g.stroke())};mxCellRenderer.registerShape("smileyFace",B);mxUtils.extend(E,mxActor);E.prototype.size=30;E.prototype.isRoundable=function(){return!0};E.prototype.redrawPath=function(g,r,A,u,z){r=Math.max(0,Math.min(u,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));-A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,0),new mxPoint(u,0),new mxPoint(u,z),new mxPoint(0,z),new mxPoint(0,r)],this.isRounded,A,!0);g.end()};mxCellRenderer.registerShape("card",E);mxUtils.extend(L,mxActor);L.prototype.size=.4;L.prototype.redrawPath=function(g,r,A,u,z){r=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.moveTo(0,r/2);g.quadTo(u/4,1.4*r,u/2,r/2);g.quadTo(3*u/4,r*(1-1.4),-u,r/2);g.lineTo(u,z-r/2);g.quadTo(3*u/4,z-1.4*r,u/2,z-r/2);g.quadTo(u/4,z-r*(1-1.4),0,z-r/2);g.lineTo(0,r/2);g.close();g.end()};L.prototype.getLabelBounds=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",this.size),A=g.width,u=g.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return r*=u,new mxRectangle(g.x,g.y+r,A,u-2*r);r*=A;return new mxRectangle(g.x+r,g.y,A-2*r,u)}return g};-mxCellRenderer.registerShape("tape",L);mxUtils.extend(Q,mxActor);Q.prototype.size=.3;Q.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*g.height):null};Q.prototype.redrawPath=function(g,r,A,u,z){r=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.moveTo(0,0);g.lineTo(u,0);g.lineTo(u,z-r/2);g.quadTo(3*u/4,z-1.4*r,u/2,z-r/2);g.quadTo(u/4,z-r*(1--1.4),0,z-r/2);g.lineTo(0,r/2);g.close();g.end()};mxCellRenderer.registerShape("document",Q);var Aa=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(g,r,A,u){var z=mxUtils.getValue(this.style,"size");return null!=z?u*Math.max(0,Math.min(1,z)):Aa.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,+this.stencil.desc.getElementsByTagName("labelBounds"),A=[],v=0;v<r.length;v++)A.push({condition:r[v].getAttribute("if"),x:Number(r[v].getAttribute("x")||0),y:Number(r[v].getAttribute("y")||0),w:Number(r[v].getAttribute("w")||this.stencil.w0),h:Number(r[v].getAttribute("h")||this.stencil.h0)});this.stencil.labelBounds=A}for(v=0;v<this.stencil.labelBounds.length;v++)if(r=this.stencil.labelBounds[v],null==r.condition||"1"==mxUtils.getValue(this.style,r.condition,"0")){v=this.stencil.computeAspect(this.style,+g.x,g.y,g.width,g.height);A=v.x-g.x+r.x*v.width;var z=v.y-g.y+r.y*v.height;return new mxRectangle(A,z,g.width-A-r.w*v.width,g.height-z-r.h*v.height)}}return ca.apply(this,arguments)};mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var g=null;if(null!=this.line)for(var r=0;r<this.line.length;r++){var A=this.line[r];null!=A&&(A=new mxRectangle(A.x,A.y,this.strokewidth,this.strokewidth),null==g?g=A:g.add(A))}this.bounds=null!=g?g:new mxRectangle};b.prototype.paintVertexShape=function(g,+r,A,v,z){this.paintTableLine(g,this.line,0,0)};b.prototype.paintTableLine=function(g,r,A,v){if(null!=r){var z=null;g.begin();for(var F=0;F<r.length;F++){var I=r[F];null!=I&&(null==z?g.moveTo(I.x+A,I.y+v):null!=z&&g.lineTo(I.x+A,I.y+v));z=I}g.end();g.stroke()}};b.prototype.intersectsRectangle=function(g){var r=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var A=null,v=0;v<this.line.length&&!r;v++){var z=this.line[v];null!=z&&null!=A&&(r=mxUtils.rectangleIntersectsSegment(g,+A,z));A=z}return r};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(d,mxSwimlane);d.prototype.fixedHeaderDefault=!1;d.prototype.paintVertexShape=function(g,r,A,v,z){var F=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):!1,I=this.isHorizontal(),ea=this.getTitleSize(),S=mxUtils.getValue(this.style,mxConstants.STYLE_FIXED_HEADER,this.fixedHeaderDefault);0==ea&&this.isRounded&&!this.outline?(S=mxShape.prototype.getArcSize.call(this,v,z),g.begin(),g.roundrect(r,A,v,z,+S,S),g.fillAndStroke()):0==ea&&!S||this.outline?Kb.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),g.translate(-r,-A));F||this.outline||!(I&&ea<z||!I&&ea<v)||this.paintForeground(g,r,A,v,z)};d.prototype.paintForeground=function(g,r,A,v,z){if(null!=this.state){var F=this.flipH,I=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var ea=F;F=I;I=ea}g.rotate(-this.getShapeRotation(),F,I,+r+v/2,A+z/2);s=this.scale;r=this.bounds.x/s;A=this.bounds.y/s;v=this.bounds.width/s;z=this.bounds.height/s;this.paintTableForeground(g,r,A,v,z)}};d.prototype.paintTableForeground=function(g,r,A,v,z){v=this.state.view.graph.getTableLines(this.state.cell,"0"!=mxUtils.getValue(this.state.style,"rowLines","1"),"0"!=mxUtils.getValue(this.state.style,"columnLines","1"));for(z=0;z<v.length;z++)b.prototype.paintTableLine(g,v[z],r,A)};d.prototype.configurePointerEvents=function(g){0==this.getTitleSize()?g.pointerEvents=+!1:mxSwimlane.prototype.configurePointerEvents.apply(this,arguments)};mxCellRenderer.registerShape("table",d);mxUtils.extend(m,d);m.prototype.paintForeground=function(){};mxCellRenderer.registerShape("tableRow",m);var ma=mxSwimlane.prototype.paintVertexShape;mxSwimlane.prototype.paintVertexShape=function(g,r,A,v,z){ma.apply(this,arguments);if(null!=this.state&&!this.outline){var F=this.state.view.graph;if((null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.laneFill&&this.laneFill!=mxConstants.NONE)&&+null!=F.paintTableCellLines){var I=this.state.cell;if(null!=F.isTableRow&&F.isTableRow(I)){var ea=this.getTitleSize();this.isHorizontal()?F.paintTableCellLines(g,I,0,0,v,Math.min(ea,z),this.stroke,this.strokewidth):F.paintTableCellLines(g,I,0,0,Math.min(ea,v),z,this.stroke,this.strokewidth)}else F.paintTableCellLines(g,I,0,0,v,z,this.stroke,this.strokewidth)}}};mxUtils.extend(p,mxCylinder);p.prototype.size=20;p.prototype.darkOpacity=0;p.prototype.darkOpacity2=0;p.prototype.paintVertexShape=function(g,+r,A,v,z){var F=Math.max(0,Math.min(v,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),I=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),ea=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));g.translate(r,A);g.begin();g.moveTo(0,0);g.lineTo(v-F,0);g.lineTo(v,F);g.lineTo(v,z);g.lineTo(F,z);g.lineTo(0,z-F);g.lineTo(0,0);g.close();g.end();g.fillAndStroke();this.outline||(g.setShadow(!1),+0!=I&&(g.setFillAlpha(Math.abs(I)),g.setFillColor(0>I?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(v-F,0),g.lineTo(v,F),g.lineTo(F,F),g.close(),g.fill()),0!=ea&&(g.setFillAlpha(Math.abs(ea)),g.setFillColor(0>ea?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(F,F),g.lineTo(F,z),g.lineTo(0,z-F),g.close(),g.fill()),g.begin(),g.moveTo(F,z),g.lineTo(F,F),g.lineTo(0,0),g.moveTo(F,F),g.lineTo(v,F),g.end(),g.stroke())};p.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,+"boundedLbl",!1)?(g=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(g,g,0,0)):null};mxCellRenderer.registerShape("cube",p);var pa=Math.tan(mxUtils.toRadians(30)),va=(.5-pa)/2;mxCellRenderer.registerShape("isoRectangle",y);mxUtils.extend(u,mxConnector);u.prototype.paintEdgeShape=function(g,r){var A=this.createMarker(g,r,!0),v=this.createMarker(g,r,!1);g.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&g.setDashed(this.isDashed,+null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);g.setShadow(!1);g.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);g.setStrokeColor(this.stroke);g.setFillColor(this.stroke);g.setDashed(!1);null!=A&&A();null!=v&&v()};mxCellRenderer.registerShape("wire",u);mxUtils.extend(n,mxCylinder);n.prototype.size=6;n.prototype.paintVertexShape=function(g,r,A,v,z){g.setFillColor(this.stroke);var F=Math.max(0,parseFloat(mxUtils.getValue(this.style,+"size",this.size))-2)+2*this.strokewidth;g.ellipse(r+.5*(v-F),A+.5*(z-F),F,F);g.fill();g.setFillColor(mxConstants.NONE);g.rect(r,A,v,z);g.fill()};mxCellRenderer.registerShape("waypoint",n);mxUtils.extend(y,mxActor);y.prototype.size=20;y.prototype.redrawPath=function(g,r,A,v,z){r=Math.min(v,z/pa);g.translate((v-r)/2,(z-r)/2+r/4);g.moveTo(0,.25*r);g.lineTo(.5*r,r*va);g.lineTo(r,.25*r);g.lineTo(.5*r,(.5-va)*r);g.lineTo(0,.25*r);g.close();g.end()};mxCellRenderer.registerShape("isoRectangle",y);mxUtils.extend(B,+mxCylinder);B.prototype.size=20;B.prototype.redrawPath=function(g,r,A,v,z,F){r=Math.min(v,z/(.5+pa));F?(g.moveTo(0,.25*r),g.lineTo(.5*r,(.5-va)*r),g.lineTo(r,.25*r),g.moveTo(.5*r,(.5-va)*r),g.lineTo(.5*r,(1-va)*r)):(g.translate((v-r)/2,(z-r)/2),g.moveTo(0,.25*r),g.lineTo(.5*r,r*va),g.lineTo(r,.25*r),g.lineTo(r,.75*r),g.lineTo(.5*r,(1-va)*r),g.lineTo(0,.75*r),g.close());g.end()};mxCellRenderer.registerShape("isoCube",B);mxUtils.extend(P,mxCylinder);P.prototype.redrawPath=function(g,r,A,v,z,F){r=Math.min(z/+2,Math.round(z/8)+this.strokewidth-1);if(F&&null!=this.fill||!F&&null==this.fill)g.moveTo(0,r),g.curveTo(0,2*r,v,2*r,v,r),F||(g.stroke(),g.begin()),g.translate(0,r/2),g.moveTo(0,r),g.curveTo(0,2*r,v,2*r,v,r),F||(g.stroke(),g.begin()),g.translate(0,r/2),g.moveTo(0,r),g.curveTo(0,2*r,v,2*r,v,r),F||(g.stroke(),g.begin()),g.translate(0,-r);F||(g.moveTo(0,r),g.curveTo(0,-r/3,v,-r/3,v,r),g.lineTo(v,z-r),g.curveTo(v,z+r/3,0,z+r/3,0,z-r),g.close())};P.prototype.getLabelMargins=function(g){return new mxRectangle(0,+2.5*Math.min(g.height/2,Math.round(g.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",P);mxUtils.extend(G,mxCylinder);G.prototype.size=30;G.prototype.darkOpacity=0;G.prototype.paintVertexShape=function(g,r,A,v,z){var F=Math.max(0,Math.min(v,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),I=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));g.translate(r,A);g.begin();g.moveTo(0,0);g.lineTo(v-F,0);g.lineTo(v,+F);g.lineTo(v,z);g.lineTo(0,z);g.lineTo(0,0);g.close();g.end();g.fillAndStroke();this.outline||(g.setShadow(!1),0!=I&&(g.setFillAlpha(Math.abs(I)),g.setFillColor(0>I?"#FFFFFF":"#000000"),g.begin(),g.moveTo(v-F,0),g.lineTo(v-F,F),g.lineTo(v,F),g.close(),g.fill()),g.begin(),g.moveTo(v-F,0),g.lineTo(v-F,F),g.lineTo(v,F),g.end(),g.stroke())};mxCellRenderer.registerShape("note",G);mxUtils.extend(O,G);mxCellRenderer.registerShape("note2",O);O.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,+"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(g.height*this.scale,r*this.scale),0,0)}return null};mxUtils.extend(U,mxShape);U.prototype.isoAngle=15;U.prototype.paintVertexShape=function(g,r,A,v,z){var F=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;F=Math.min(v*Math.tan(F),.5*z);g.translate(r,A);g.begin();g.moveTo(.5*v,0);g.lineTo(v,F);g.lineTo(v,z-F);g.lineTo(.5*v,z);g.lineTo(0,z-F);g.lineTo(0,+F);g.close();g.fillAndStroke();g.setShadow(!1);g.begin();g.moveTo(0,F);g.lineTo(.5*v,2*F);g.lineTo(v,F);g.moveTo(.5*v,2*F);g.lineTo(.5*v,z);g.stroke()};mxCellRenderer.registerShape("isoCube2",U);mxUtils.extend(c,mxShape);c.prototype.size=15;c.prototype.paintVertexShape=function(g,r,A,v,z){var F=Math.max(0,Math.min(.5*z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.translate(r,A);0==F?(g.rect(0,0,v,z),g.fillAndStroke()):(g.begin(),g.moveTo(0,F),g.arcTo(.5*v,F,0,0,1,.5*v,0),g.arcTo(.5*+v,F,0,0,1,v,F),g.lineTo(v,z-F),g.arcTo(.5*v,F,0,0,1,.5*v,z),g.arcTo(.5*v,F,0,0,1,0,z-F),g.close(),g.fillAndStroke(),g.setShadow(!1),g.begin(),g.moveTo(v,F),g.arcTo(.5*v,F,0,0,1,.5*v,2*F),g.arcTo(.5*v,F,0,0,1,0,F),g.stroke())};mxCellRenderer.registerShape("cylinder2",c);mxUtils.extend(f,mxCylinder);f.prototype.size=15;f.prototype.paintVertexShape=function(g,r,A,v,z){var F=Math.max(0,Math.min(.5*z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),I=mxUtils.getValue(this.style,"lid",!0);g.translate(r,+A);0==F?(g.rect(0,0,v,z),g.fillAndStroke()):(g.begin(),I?(g.moveTo(0,F),g.arcTo(.5*v,F,0,0,1,.5*v,0),g.arcTo(.5*v,F,0,0,1,v,F)):(g.moveTo(0,0),g.arcTo(.5*v,F,0,0,0,.5*v,F),g.arcTo(.5*v,F,0,0,0,v,0)),g.lineTo(v,z-F),g.arcTo(.5*v,F,0,0,1,.5*v,z),g.arcTo(.5*v,F,0,0,1,0,z-F),g.close(),g.fillAndStroke(),g.setShadow(!1),I&&(g.begin(),g.moveTo(v,F),g.arcTo(.5*v,F,0,0,1,.5*v,2*F),g.arcTo(.5*v,F,0,0,1,0,F),g.stroke()))};mxCellRenderer.registerShape("cylinder3",f);mxUtils.extend(k,mxActor);k.prototype.redrawPath=+function(g,r,A,v,z){g.moveTo(0,0);g.quadTo(v/2,.5*z,v,0);g.quadTo(.5*v,z/2,v,z);g.quadTo(v/2,.5*z,0,z);g.quadTo(.5*v,z/2,0,0);g.end()};mxCellRenderer.registerShape("switch",k);mxUtils.extend(q,mxCylinder);q.prototype.tabWidth=60;q.prototype.tabHeight=20;q.prototype.tabPosition="right";q.prototype.arcSize=.1;q.prototype.isRoundable=function(){return!0};q.prototype.paintVertexShape=function(g,r,A,v,z){g.translate(r,A);r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));+A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var F=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),I=mxUtils.getValue(this.style,"rounded",!1),ea=mxUtils.getValue(this.style,"absoluteArcSize",!1),S=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));ea||(S*=Math.min(v,z));S=Math.min(S,.5*v,.5*(z-A));r=Math.max(r,S);r=Math.min(v-S,r);I||(S=0);g.begin();"left"==F?(g.moveTo(Math.max(S,0),A),g.lineTo(Math.max(S,0),0),g.lineTo(r,+0),g.lineTo(r,A)):(g.moveTo(v-r,A),g.lineTo(v-r,0),g.lineTo(v-Math.max(S,0),0),g.lineTo(v-Math.max(S,0),A));I?(g.moveTo(0,S+A),g.arcTo(S,S,0,0,1,S,A),g.lineTo(v-S,A),g.arcTo(S,S,0,0,1,v,S+A),g.lineTo(v,z-S),g.arcTo(S,S,0,0,1,v-S,z),g.lineTo(S,z),g.arcTo(S,S,0,0,1,0,z-S)):(g.moveTo(0,A),g.lineTo(v,A),g.lineTo(v,z),g.lineTo(0,z));g.close();g.fillAndStroke();g.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(g.begin(),g.moveTo(v-30,A+20),g.lineTo(v-20,A+10),g.lineTo(v-10,+A+20),g.close(),g.stroke())};mxCellRenderer.registerShape("folder",q);q.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var A=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var v=mxUtils.getValue(this.style,"rounded",!1),z=mxUtils.getValue(this.style,"absoluteArcSize",!1),F=parseFloat(mxUtils.getValue(this.style,+"arcSize",this.arcSize));z||(F*=Math.min(g.width,g.height));F=Math.min(F,.5*g.width,.5*(g.height-r));v||(F=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(F,0,Math.min(g.width,g.width-A),Math.min(g.height,g.height-r)):new mxRectangle(Math.min(g.width,g.width-A),0,F,Math.min(g.height,g.height-r))}return new mxRectangle(0,Math.min(g.height,r),0,0)}return null};mxUtils.extend(x,mxCylinder);x.prototype.arcSize=.1;x.prototype.paintVertexShape=function(g,r,A,+v,z){g.translate(r,A);var F=mxUtils.getValue(this.style,"rounded",!1),I=mxUtils.getValue(this.style,"absoluteArcSize",!1);r=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));A=mxUtils.getValue(this.style,"umlStateConnection",null);I||(r*=Math.min(v,z));r=Math.min(r,.5*v,.5*z);F||(r=0);F=0;null!=A&&(F=10);g.begin();g.moveTo(F,r);g.arcTo(r,r,0,0,1,F+r,0);g.lineTo(v-r,0);g.arcTo(r,r,0,0,1,v,r);g.lineTo(v,z-r);g.arcTo(r,r,0,0,1,v-r,z);g.lineTo(F+r,z);g.arcTo(r,r,0,0,1,F,z-r);g.close();g.fillAndStroke();+g.setShadow(!1);"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(g.roundrect(v-40,z-20,10,10,3,3),g.stroke(),g.roundrect(v-20,z-20,10,10,3,3),g.stroke(),g.begin(),g.moveTo(v-30,z-15),g.lineTo(v-20,z-15),g.stroke());"connPointRefEntry"==A?(g.ellipse(0,.5*z-10,20,20),g.fillAndStroke()):"connPointRefExit"==A&&(g.ellipse(0,.5*z-10,20,20),g.fillAndStroke(),g.begin(),g.moveTo(5,.5*z-5),g.lineTo(15,.5*z+5),g.moveTo(15,.5*z-5),g.lineTo(5,.5*z+5),g.stroke())};x.prototype.getLabelMargins=+function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};mxCellRenderer.registerShape("umlState",x);mxUtils.extend(C,mxShape);C.prototype.featureColor="#666666";C.prototype.paintVertexShape=function(g,r,A,v,z){var F=mxUtils.getValue(this.style,"smileyType","happy"),I=mxUtils.getValue(this.style,"smileyFeatureColor",C.prototype.featureColor);g.translate(r,A);r=Math.min(v,z)/2;g.ellipse(v/+2-r,z/2-r,2*r,2*r);g.fillAndStroke();r=Math.min(v,z)/30;v/=2;z/=2;g.setFillColor(I);g.setStrokeColor(I);g.setStrokeWidth(2*r);I=1.5*r;A=5*r;var ea=5*r;g.ellipse(v-A-I,z-ea-I,2*I,2*I);g.fillAndStroke();g.ellipse(v+A-I,z-ea-I,2*I,2*I);g.fillAndStroke();g.setStrokeWidth(1*r);g.setFillColor("#000000");"happy"==F?(F=v,I=z+2*r,g.begin(),g.moveTo(F+7.5*r,I),g.arcTo(7.5*r,7.5*r,0,1,1,F-7.5*r,I),g.lineTo(F-6.818*r,I),g.arcTo(6.818*r,6.818*r,0,1,0,F+6.818*r,I),g.close(),g.fillAndStroke()):"sad"==F?(F=v,I=z++7*r,g.begin(),g.moveTo(F-7.5*r,I),g.arcTo(7.5*r,7.5*r,0,1,1,F+7.5*r,I),g.lineTo(F+6.818*r,I),g.arcTo(6.818*r,6.818*r,0,1,0,F-6.818*r,I),g.close(),g.fillAndStroke()):(g.begin(),g.moveTo(v-5*r,z+7*r),g.lineTo(v+5*r,z+7*r),g.stroke())};mxCellRenderer.registerShape("smileyFace",C);mxUtils.extend(E,mxActor);E.prototype.size=30;E.prototype.isRoundable=function(){return!0};E.prototype.redrawPath=function(g,r,A,v,z){r=Math.max(0,Math.min(v,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));+A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,0),new mxPoint(v,0),new mxPoint(v,z),new mxPoint(0,z),new mxPoint(0,r)],this.isRounded,A,!0);g.end()};mxCellRenderer.registerShape("card",E);mxUtils.extend(L,mxActor);L.prototype.size=.4;L.prototype.redrawPath=function(g,r,A,v,z){r=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.moveTo(0,r/2);g.quadTo(v/4,1.4*r,v/2,r/2);g.quadTo(3*v/4,r*(1-1.4),+v,r/2);g.lineTo(v,z-r/2);g.quadTo(3*v/4,z-1.4*r,v/2,z-r/2);g.quadTo(v/4,z-r*(1-1.4),0,z-r/2);g.lineTo(0,r/2);g.close();g.end()};L.prototype.getLabelBounds=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",this.size),A=g.width,v=g.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return r*=v,new mxRectangle(g.x,g.y+r,A,v-2*r);r*=A;return new mxRectangle(g.x+r,g.y,A-2*r,v)}return g};+mxCellRenderer.registerShape("tape",L);mxUtils.extend(Q,mxActor);Q.prototype.size=.3;Q.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*g.height):null};Q.prototype.redrawPath=function(g,r,A,v,z){r=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.moveTo(0,0);g.lineTo(v,0);g.lineTo(v,z-r/2);g.quadTo(3*v/4,z-1.4*r,v/2,z-r/2);g.quadTo(v/4,z-r*(1-+1.4),0,z-r/2);g.lineTo(0,r/2);g.close();g.end()};mxCellRenderer.registerShape("document",Q);var Aa=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(g,r,A,v){var z=mxUtils.getValue(this.style,"size");return null!=z?v*Math.max(0,Math.min(1,z)):Aa.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,g.height*r),0,0)}return null};f.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",15);mxUtils.getValue(this.style,"lid",!0)||(r/=2);return new mxRectangle(0,Math.min(g.height*this.scale,2*r*this.scale),0,Math.max(0,.3*r*this.scale))}return null};q.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,-"labelInHeader",!1)){var A=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var u=mxUtils.getValue(this.style,"rounded",!1),z=mxUtils.getValue(this.style,"absoluteArcSize",!1),F=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));z||(F*=Math.min(g.width,g.height));F=Math.min(F,.5*g.width,.5*(g.height-r));u||(F=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(F,0,Math.min(g.width,g.width-+"labelInHeader",!1)){var A=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var v=mxUtils.getValue(this.style,"rounded",!1),z=mxUtils.getValue(this.style,"absoluteArcSize",!1),F=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));z||(F*=Math.min(g.width,g.height));F=Math.min(F,.5*g.width,.5*(g.height-r));v||(F=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(F,0,Math.min(g.width,g.width-A),Math.min(g.height,g.height-r)):new mxRectangle(Math.min(g.width,g.width-A),0,F,Math.min(g.height,g.height-r))}return new mxRectangle(0,Math.min(g.height,r),0,0)}return null};x.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};O.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",-15);return new mxRectangle(0,Math.min(g.height*this.scale,r*this.scale),0,Math.max(0,r*this.scale))}return null};mxUtils.extend(V,mxActor);V.prototype.size=.2;V.prototype.fixedSize=20;V.prototype.isRoundable=function(){return!0};V.prototype.redrawPath=function(g,r,A,u,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,-mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,z),new mxPoint(r,0),new mxPoint(u,0),new mxPoint(u-r,z)],this.isRounded,A,!0);g.end()};mxCellRenderer.registerShape("parallelogram",V);mxUtils.extend(K,mxActor);K.prototype.size=.2;K.prototype.fixedSize=20;K.prototype.isRoundable=function(){return!0};K.prototype.redrawPath=function(g,r,A,u,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",-this.fixedSize)))):u*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,z),new mxPoint(r,0),new mxPoint(u-r,0),new mxPoint(u,z)],this.isRounded,A,!0)};mxCellRenderer.registerShape("trapezoid",K);mxUtils.extend(fa,mxActor);fa.prototype.size=.5;fa.prototype.redrawPath=function(g,r,A,u,z){g.setFillColor(null);r=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,-"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(u,0),new mxPoint(r,0),new mxPoint(r,z/2),new mxPoint(0,z/2),new mxPoint(r,z/2),new mxPoint(r,z),new mxPoint(u,z)],this.isRounded,A,!1);g.end()};mxCellRenderer.registerShape("curlyBracket",fa);mxUtils.extend(aa,mxActor);aa.prototype.redrawPath=function(g,r,A,u,z){g.setStrokeWidth(1);g.setFillColor(this.stroke);r=u/5;g.rect(0,0,r,z);g.fillAndStroke();g.rect(2*r,0,r,-z);g.fillAndStroke();g.rect(4*r,0,r,z);g.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",aa);da.prototype.moveTo=function(g,r){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r;this.firstX=g;this.firstY=r};da.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};da.prototype.quadTo=function(g,r,A,u){this.originalQuadTo.apply(this.canvas,-arguments);this.lastX=A;this.lastY=u};da.prototype.curveTo=function(g,r,A,u,z,F){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=z;this.lastY=F};da.prototype.arcTo=function(g,r,A,u,z,F,I){this.originalArcTo.apply(this.canvas,arguments);this.lastX=F;this.lastY=I};da.prototype.lineTo=function(g,r){if(null!=this.lastX&&null!=this.lastY){var A=function(oa){return"number"===typeof oa?oa?0>oa?-1:1:oa===oa?0:NaN:NaN},u=Math.abs(g-this.lastX),z=Math.abs(r-this.lastY),F=Math.sqrt(u*u+z*z);if(2>-F){this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r;return}var I=Math.round(F/10),ea=this.defaultVariation;5>I&&(I=5,ea/=3);var S=A(g-this.lastX)*u/I;A=A(r-this.lastY)*z/I;u/=F;z/=F;for(F=0;F<I;F++){var ta=(Math.random()-.5)*ea;this.originalLineTo.call(this.canvas,S*F+this.lastX-ta*z,A*F+this.lastY-ta*u)}this.originalLineTo.call(this.canvas,g,r)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r};da.prototype.destroy=function(){this.canvas.lineTo=+15);return new mxRectangle(0,Math.min(g.height*this.scale,r*this.scale),0,Math.max(0,r*this.scale))}return null};mxUtils.extend(V,mxActor);V.prototype.size=.2;V.prototype.fixedSize=20;V.prototype.isRoundable=function(){return!0};V.prototype.redrawPath=function(g,r,A,v,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,+mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,z),new mxPoint(r,0),new mxPoint(v,0),new mxPoint(v-r,z)],this.isRounded,A,!0);g.end()};mxCellRenderer.registerShape("parallelogram",V);mxUtils.extend(K,mxActor);K.prototype.size=.2;K.prototype.fixedSize=20;K.prototype.isRoundable=function(){return!0};K.prototype.redrawPath=function(g,r,A,v,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*v,parseFloat(mxUtils.getValue(this.style,"size",+this.fixedSize)))):v*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,z),new mxPoint(r,0),new mxPoint(v-r,0),new mxPoint(v,z)],this.isRounded,A,!0)};mxCellRenderer.registerShape("trapezoid",K);mxUtils.extend(fa,mxActor);fa.prototype.size=.5;fa.prototype.redrawPath=function(g,r,A,v,z){g.setFillColor(null);r=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,+"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(v,0),new mxPoint(r,0),new mxPoint(r,z/2),new mxPoint(0,z/2),new mxPoint(r,z/2),new mxPoint(r,z),new mxPoint(v,z)],this.isRounded,A,!1);g.end()};mxCellRenderer.registerShape("curlyBracket",fa);mxUtils.extend(aa,mxActor);aa.prototype.redrawPath=function(g,r,A,v,z){g.setStrokeWidth(1);g.setFillColor(this.stroke);r=v/5;g.rect(0,0,r,z);g.fillAndStroke();g.rect(2*r,0,r,+z);g.fillAndStroke();g.rect(4*r,0,r,z);g.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",aa);da.prototype.moveTo=function(g,r){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r;this.firstX=g;this.firstY=r};da.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};da.prototype.quadTo=function(g,r,A,v){this.originalQuadTo.apply(this.canvas,+arguments);this.lastX=A;this.lastY=v};da.prototype.curveTo=function(g,r,A,v,z,F){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=z;this.lastY=F};da.prototype.arcTo=function(g,r,A,v,z,F,I){this.originalArcTo.apply(this.canvas,arguments);this.lastX=F;this.lastY=I};da.prototype.lineTo=function(g,r){if(null!=this.lastX&&null!=this.lastY){var A=function(oa){return"number"===typeof oa?oa?0>oa?-1:1:oa===oa?0:NaN:NaN},v=Math.abs(g-this.lastX),z=Math.abs(r-this.lastY),F=Math.sqrt(v*v+z*z);if(2>+F){this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r;return}var I=Math.round(F/10),ea=this.defaultVariation;5>I&&(I=5,ea/=3);var S=A(g-this.lastX)*v/I;A=A(r-this.lastY)*z/I;v/=F;z/=F;for(F=0;F<I;F++){var ta=(Math.random()-.5)*ea;this.originalLineTo.call(this.canvas,S*F+this.lastX-ta*z,A*F+this.lastY-ta*v)}this.originalLineTo.call(this.canvas,g,r)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r};da.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var xa=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(g){xa.apply(this,arguments);null==g.handJiggle&&(g.handJiggle=this.createHandJiggle(g))};var Ma=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(g){Ma.apply(this,arguments);null!=g.handJiggle&&(g.handJiggle.destroy(),delete g.handJiggle)};mxShape.prototype.createComicCanvas=function(g){return new da(g,mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(g){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(g)};var Wa=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.outline&&(null==this.style||"0"==mxUtils.getValue(this.style,-"comic","0")&&"0"==mxUtils.getValue(this.style,"sketch","1"==urlParams.rough?"1":"0"))&&Wa.apply(this,arguments)};var Za=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(g,r,A,u,z){if(null==g.handJiggle||g.handJiggle.constructor!=da)Za.apply(this,arguments);else{var F=!0;null!=this.style&&(F="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(F||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)F||-null!=this.fill&&this.fill!=mxConstants.NONE||(g.pointerEvents=!1),g.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?F=Math.min(u/2,Math.min(z/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,F=Math.min(u*F,z*F)),g.moveTo(r+F,A),g.lineTo(r+u-F,A),g.quadTo(r+u,A,r+u,A+F),g.lineTo(r+u,A+z-F),g.quadTo(r+u,A+z,r+u-F,-A+z),g.lineTo(r+F,A+z),g.quadTo(r,A+z,r,A+z-F),g.lineTo(r,A+F),g.quadTo(r,A,r+F,A)):(g.moveTo(r,A),g.lineTo(r+u,A),g.lineTo(r+u,A+z),g.lineTo(r,A+z),g.lineTo(r,A)),g.close(),g.end(),g.fillAndStroke()}};mxUtils.extend(ba,mxRectangleShape);ba.prototype.size=.1;ba.prototype.fixedSize=!1;ba.prototype.isHtmlAllowed=function(){return!1};ba.prototype.getLabelBounds=function(g){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||-this.direction==mxConstants.DIRECTION_WEST)){var r=g.width,A=g.height;g=new mxRectangle(g.x,g.y,r,A);var u=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),z=parseFloat(mxUtils.getValue(this.style,"size",this.size));u?z=Math.max(0,Math.min(r,z*this.scale)):(z=r*Math.max(0,Math.min(1,z)),this.isRounded&&(u=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,z=Math.max(z,Math.min(r*u,A*u))));g.x+=Math.round(z);g.width-=Math.round(2*z);return g}return g};-ba.prototype.paintForeground=function(g,r,A,u,z){var F=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),I=parseFloat(mxUtils.getValue(this.style,"size",this.size));I=F?Math.max(0,Math.min(u,I)):u*Math.max(0,Math.min(1,I));this.isRounded&&(F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,I=Math.max(I,Math.min(u*F,z*F)));I=Math.round(I);g.begin();g.moveTo(r+I,A);g.lineTo(r+I,A+z);g.moveTo(r+u-I,A);g.lineTo(r+u-I,A+z);g.end();g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,-arguments)};mxCellRenderer.registerShape("process",ba);mxCellRenderer.registerShape("process2",ba);mxUtils.extend(ha,mxRectangleShape);ha.prototype.paintBackground=function(g,r,A,u,z){g.setFillColor(mxConstants.NONE);g.rect(r,A,u,z);g.fill()};ha.prototype.paintForeground=function(g,r,A,u,z){};mxCellRenderer.registerShape("transparent",ha);mxUtils.extend(qa,mxHexagon);qa.prototype.size=30;qa.prototype.position=.5;qa.prototype.position2=.5;qa.prototype.base=20;qa.prototype.getLabelMargins=function(){return new mxRectangle(0,-0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};qa.prototype.isRoundable=function(){return!0};qa.prototype.redrawPath=function(g,r,A,u,z){r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var F=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),I=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",-this.position2)))),ea=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(g,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,z-A),new mxPoint(Math.min(u,F+ea),z-A),new mxPoint(I,z),new mxPoint(Math.max(0,F),z-A),new mxPoint(0,z-A)],this.isRounded,r,!0,[4])};mxCellRenderer.registerShape("callout",qa);mxUtils.extend(ra,mxActor);ra.prototype.size=.2;ra.prototype.fixedSize=20;ra.prototype.isRoundable=function(){return!0};ra.prototype.redrawPath=function(g,-r,A,u,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(u-r,0),new mxPoint(u,z/2),new mxPoint(u-r,z),new mxPoint(0,z),new mxPoint(r,z/2)],this.isRounded,A,!0);g.end()};mxCellRenderer.registerShape("step",-ra);mxUtils.extend(l,mxHexagon);l.prototype.size=.25;l.prototype.fixedSize=20;l.prototype.isRoundable=function(){return!0};l.prototype.redrawPath=function(g,r,A,u,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,-0),new mxPoint(u-r,0),new mxPoint(u,.5*z),new mxPoint(u-r,z),new mxPoint(r,z),new mxPoint(0,.5*z)],this.isRounded,A,!0)};mxCellRenderer.registerShape("hexagon",l);mxUtils.extend(t,mxRectangleShape);t.prototype.isHtmlAllowed=function(){return!1};t.prototype.paintForeground=function(g,r,A,u,z){var F=Math.min(u/5,z/5)+1;g.begin();g.moveTo(r+u/2,A+F);g.lineTo(r+u/2,A+z-F);g.moveTo(r+F,A+z/2);g.lineTo(r+u-F,A+z/2);g.end();g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",-t);var pb=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(g){if(1==this.style["double"]){var r=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(g.x+r,g.y+r,g.width-2*r,g.height-2*r)}return g};mxRhombus.prototype.paintVertexShape=function(g,r,A,u,z){pb.apply(this,arguments);var F=r,I=A,ea=u,S=z;if(!this.outline&&1==this.style["double"]){var ta=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||-0);r+=ta;A+=ta;u-=2*ta;z-=2*ta;0<u&&0<z&&(g.setShadow(!1),pb.apply(this,[g,r,A,u,z]))}this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(g,F,I,ea,S,0)};mxShape.prototype.paintGlassEffect=function(g,r,A,u,z,F){var I=Math.ceil(this.strokewidth/2);g.setGradient("#ffffff","#ffffff",r,A,u,.6*z,"south",.9,.1);g.begin();this.paintGlassEffectPath(g,r,A,u,z,I,F);g.close();g.fill()};mxShape.prototype.paintGlassEffectPath=function(g,r,A,u,z,F,I){I+=2*F;this.isRounded?-(g.moveTo(r-F+I,A-F),g.quadTo(r-F,A-F,r-F,A-F+I),g.lineTo(r-F,A+.4*z),g.quadTo(r+.5*u,A+.7*z,r+u+F,A+.4*z),g.lineTo(r+u+F,A-F+I),g.quadTo(r+u+F,A-F,r+u+F-I,A-F)):(g.moveTo(r-F,A-F),g.lineTo(r-F,A+.4*z),g.quadTo(r+.5*u,A+.7*z,r+u+F,A+.4*z),g.lineTo(r+u+F,A-F))};mxEllipse.prototype.paintGlassEffectPath=function(g,r,A,u,z,F,I){I=u/2+F;F=z/2+F;r+=u/2;A+=z/2;g.moveTo(r-I,A);g.curveTo(r-I,A-.5522847498*F,r-.5522847498*I,A-F,r,A-F);g.curveTo(r+.5522847498*I,A-F,r+I,A-.5522847498*F,r+I,A);g.quadTo(r,A+.2*-z,r-I,A)};mxRhombus.prototype.paintGlassEffectPath=function(g,r,A,u,z,F,I){F=u/2;I=z/2;var ea=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,A+I),new mxPoint(r+F,A),new mxPoint(r+u,A+I)],this.isRounded,ea,!1);g.quadTo(r+F,A+.7*z,r,A+I)};var rb=mxEllipse.prototype.paintVertexShape;mxEllipse.prototype.paintVertexShape=function(g,r,A,u,z){rb.apply(this,arguments);this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&-this.paintGlassEffect(g,r,A,u,z,0)};mxUtils.extend(H,mxRectangleShape);H.prototype.isHtmlAllowed=function(){return!1};H.prototype.getLabelBounds=function(g){if(1==this.style["double"]){var r=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(g.x+r,g.y+r,g.width-2*r,g.height-2*r)}return g};H.prototype.paintForeground=function(g,r,A,u,z){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var F=Math.max(2,this.strokewidth+-1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);r+=F;A+=F;u-=2*F;z-=2*F;0<u&&0<z&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}g.setDashed(!1);F=0;do{var I=mxCellRenderer.defaultShapes[this.style["symbol"+F]];if(null!=I){var ea=this.style["symbol"+F+"Align"],S=this.style["symbol"+F+"VerticalAlign"],ta=this.style["symbol"+F+"Width"],oa=this.style["symbol"+F+"Height"],Ia=this.style["symbol"+F+"Spacing"]||0,mb=this.style["symbol"+F+"VSpacing"]||Ia,$a=this.style["symbol"+F+-"ArcSpacing"];null!=$a&&($a*=this.getArcSize(u+this.strokewidth,z+this.strokewidth),Ia+=$a,mb+=$a);$a=r;var Ea=A;$a=ea==mxConstants.ALIGN_CENTER?$a+(u-ta)/2:ea==mxConstants.ALIGN_RIGHT?$a+(u-ta-Ia):$a+Ia;Ea=S==mxConstants.ALIGN_MIDDLE?Ea+(z-oa)/2:S==mxConstants.ALIGN_BOTTOM?Ea+(z-oa-mb):Ea+mb;g.save();ea=new I;ea.style=this.style;I.prototype.paintVertexShape.call(ea,g,$a,Ea,ta,oa);g.restore()}F++}while(null!=I)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",-H);mxUtils.extend(J,mxCylinder);J.prototype.redrawPath=function(g,r,A,u,z,F){F?(g.moveTo(0,0),g.lineTo(u/2,z/2),g.lineTo(u,0),g.end()):(g.moveTo(0,0),g.lineTo(u,0),g.lineTo(u,z),g.lineTo(0,z),g.close())};mxCellRenderer.registerShape("message",J);mxUtils.extend(R,mxShape);R.prototype.paintBackground=function(g,r,A,u,z){g.translate(r,A);g.ellipse(u/4,0,u/2,z/4);g.fillAndStroke();g.begin();g.moveTo(u/2,z/4);g.lineTo(u/2,2*z/3);g.moveTo(u/2,z/3);g.lineTo(0,z/3);g.moveTo(u/2,z/3);g.lineTo(u,z/3);g.moveTo(u/-2,2*z/3);g.lineTo(0,z);g.moveTo(u/2,2*z/3);g.lineTo(u,z);g.end();g.stroke()};mxCellRenderer.registerShape("umlActor",R);mxUtils.extend(T,mxShape);T.prototype.getLabelMargins=function(g){return new mxRectangle(g.width/6,0,0,0)};T.prototype.paintBackground=function(g,r,A,u,z){g.translate(r,A);g.begin();g.moveTo(0,z/4);g.lineTo(0,3*z/4);g.end();g.stroke();g.begin();g.moveTo(0,z/2);g.lineTo(u/6,z/2);g.end();g.stroke();g.ellipse(u/6,0,5*u/6,z);g.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",-T);mxUtils.extend(Y,mxEllipse);Y.prototype.paintVertexShape=function(g,r,A,u,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.begin();g.moveTo(r+u/8,A+z);g.lineTo(r+7*u/8,A+z);g.end();g.stroke()};mxCellRenderer.registerShape("umlEntity",Y);mxUtils.extend(Z,mxShape);Z.prototype.paintVertexShape=function(g,r,A,u,z){g.translate(r,A);g.begin();g.moveTo(u,0);g.lineTo(0,z);g.moveTo(0,0);g.lineTo(u,z);g.end();g.stroke()};mxCellRenderer.registerShape("umlDestroy",Z);mxUtils.extend(ia,mxShape);-ia.prototype.getLabelBounds=function(g){return new mxRectangle(g.x,g.y+g.height/8,g.width,7*g.height/8)};ia.prototype.paintBackground=function(g,r,A,u,z){g.translate(r,A);g.begin();g.moveTo(3*u/8,z/8*1.1);g.lineTo(5*u/8,0);g.end();g.stroke();g.ellipse(0,z/8,u,7*z/8);g.fillAndStroke()};ia.prototype.paintForeground=function(g,r,A,u,z){g.begin();g.moveTo(3*u/8,z/8*1.1);g.lineTo(5*u/8,z/4);g.end();g.stroke()};mxCellRenderer.registerShape("umlControl",ia);mxUtils.extend(X,mxShape);X.prototype.iconSize=-44;X.prototype.paintBackground=function(g,r,A,u,z){z=Math.min(this.iconSize,u,z);var F=.9*z,I=.45*z;r=r+u/2-z/2;u=A+z/2;var ea=r+.175*F;F=ea-F;g.begin();g.moveTo(F,u-I/2);g.lineTo(F,u+I/2);g.end();g.stroke();g.begin();g.moveTo(F,u);g.lineTo(ea,u);g.end();g.stroke();g.ellipse(r,A,z,z);g.fillAndStroke()};mxCellRenderer.registerShape("seqBoundary",X);mxCellRenderer.registerShape("seqControl",ka(ia,44));mxCellRenderer.registerShape("seqEntity",ka(Y,44));mxUtils.extend(ja,mxShape);ja.prototype.paintBackground=-function(g,r,A,u,z){var F=z/2,I=F/(2.5+z/50);g.save();g.translate(r,A);g.begin();g.moveTo(I,0);g.lineTo(u-I,0);g.arcTo(I,F,0,0,1,u-I,z);g.lineTo(I,z);g.arcTo(I,F,0,0,1,I,0);g.close();g.fillAndStroke();g.restore()};ja.prototype.paintForeground=function(g,r,A,u,z){var F=z/2,I=F/(2.5+z/50);g.save();g.translate(r,A);g.begin();g.moveTo(u-I,0);g.arcTo(I,F,0,0,0,u-I,z);g.stroke();g.restore()};mxCellRenderer.registerShape("seqQueue",ja);mxUtils.extend(na,mxShape);na.prototype.paintBackground=function(g,r,-A,u,z){g.rect(r+6,A-6,u,z);g.fillAndStroke();g.rect(r,A,u,z);g.fillAndStroke()};mxCellRenderer.registerShape("seqCollections",na);mxUtils.extend(la,mxShape);la.prototype.paintBackground=function(g,r,A,u,z){z=u/3;var F=u/3,I=z/2,ea=I/(2.5+z/50);g.translate(r+(u-z)/2,A);g.begin();g.moveTo(0,ea);g.arcTo(I,ea,0,0,0,z,ea);g.arcTo(I,ea,0,0,0,0,ea);g.lineTo(0,F-ea);g.arcTo(I,ea,0,0,0,z,F-ea);g.lineTo(z,ea);g.fillAndStroke()};mxCellRenderer.registerShape("seqDatabase",la);mxUtils.extend(va,mxShape);va.prototype.paintBackground=-function(g,r,A,u,z){r+=u/2;A+=15;u=A+15;z=u+20;var F=u+10,I=z+15;g.ellipse(r-15,A-15,30,30);g.fillAndStroke();g.begin();g.moveTo(r,u);g.lineTo(r,z);g.moveTo(r-18,F);g.lineTo(r+18,F);g.moveTo(r,z);g.lineTo(r-16,I);g.moveTo(r,z);g.lineTo(r+16,I);g.stroke()};mxCellRenderer.registerShape("seqActorStick",va);mxUtils.extend(za,mxRectangleShape);za.prototype.size=40;za.prototype.isHtmlAllowed=function(){return!1};za.prototype.isMirrored=function(){return"1"==mxUtils.getValue(this.style,"lifelineMirror",-"0")};za.prototype.getHeadSize=function(g){return Math.max(0,Math.min(this.isMirrored()?g/2:g,parseFloat(mxUtils.getValue(this.style,"size",this.size))))};za.prototype.getLabelBounds=function(g){var r=Math.max(0,Math.min(this.isMirrored()?g.height/2:g.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(g.x,g.y,g.width,r)};za.prototype.paintBackground=function(g,r,A,u,z){var F=this.getHeadSize(z),I=this.isMirrored(),ea=mxUtils.getValue(this.style,"participant");-null==ea||null==this.state?(mxRectangleShape.prototype.paintBackground.call(this,g,r,A,u,F),I&&mxRectangleShape.prototype.paintBackground.call(this,g,r,A+z-F,u,F)):(ea=this.state.view.graph.cellRenderer.getShape(ea),null!=ea&&ea!=za&&(ea=new ea,ea.apply(this.state),g.save(),ea.paintVertexShape(g,r,A,u,F),g.restore(),I&&(g.save(),ea.paintVertexShape(g,r,A+z-F,u,F),g.restore())));z=I?z-F:z;F<z&&(g.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),g.begin(),g.moveTo(r+u/2,A+F),g.lineTo(r+-u/2,A+z),g.end(),g.stroke())};za.prototype.paintForeground=function(g,r,A,u,z){var F=mxUtils.getValue(this.style,"participant"),I=this.getHeadSize(z),ea=this.isMirrored();null==F&&(mxRectangleShape.prototype.paintForeground.call(this,g,r,A,u,Math.min(z,I)),ea&&mxRectangleShape.prototype.paintForeground.call(this,g,r,A+z-I,u,I));ea&&this.paintMirrorLabel(g,r,A+z-I,u,I)};za.prototype.paintMirrorLabel=function(g,r,A,u,z){var F=null!=this.state?this.state.view.graph.getLabel(this.state.cell):null;this.mirrorLabelValue=+"comic","0")&&"0"==mxUtils.getValue(this.style,"sketch","1"==urlParams.rough?"1":"0"))&&Wa.apply(this,arguments)};var Za=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(g,r,A,v,z){if(null==g.handJiggle||g.handJiggle.constructor!=da)Za.apply(this,arguments);else{var F=!0;null!=this.style&&(F="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(F||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)F||+null!=this.fill&&this.fill!=mxConstants.NONE||(g.pointerEvents=!1),g.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?F=Math.min(v/2,Math.min(z/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,F=Math.min(v*F,z*F)),g.moveTo(r+F,A),g.lineTo(r+v-F,A),g.quadTo(r+v,A,r+v,A+F),g.lineTo(r+v,A+z-F),g.quadTo(r+v,A+z,r+v-F,+A+z),g.lineTo(r+F,A+z),g.quadTo(r,A+z,r,A+z-F),g.lineTo(r,A+F),g.quadTo(r,A,r+F,A)):(g.moveTo(r,A),g.lineTo(r+v,A),g.lineTo(r+v,A+z),g.lineTo(r,A+z),g.lineTo(r,A)),g.close(),g.end(),g.fillAndStroke()}};mxUtils.extend(ba,mxRectangleShape);ba.prototype.size=.1;ba.prototype.fixedSize=!1;ba.prototype.isHtmlAllowed=function(){return!1};ba.prototype.getLabelBounds=function(g){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||+this.direction==mxConstants.DIRECTION_WEST)){var r=g.width,A=g.height;g=new mxRectangle(g.x,g.y,r,A);var v=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),z=parseFloat(mxUtils.getValue(this.style,"size",this.size));v?z=Math.max(0,Math.min(r,z*this.scale)):(z=r*Math.max(0,Math.min(1,z)),this.isRounded&&(v=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,z=Math.max(z,Math.min(r*v,A*v))));g.x+=Math.round(z);g.width-=Math.round(2*z);return g}return g};+ba.prototype.paintForeground=function(g,r,A,v,z){var F=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),I=parseFloat(mxUtils.getValue(this.style,"size",this.size));I=F?Math.max(0,Math.min(v,I)):v*Math.max(0,Math.min(1,I));this.isRounded&&(F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,I=Math.max(I,Math.min(v*F,z*F)));I=Math.round(I);g.begin();g.moveTo(r+I,A);g.lineTo(r+I,A+z);g.moveTo(r+v-I,A);g.lineTo(r+v-I,A+z);g.end();g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,+arguments)};mxCellRenderer.registerShape("process",ba);mxCellRenderer.registerShape("process2",ba);mxUtils.extend(ha,mxRectangleShape);ha.prototype.paintBackground=function(g,r,A,v,z){g.setFillColor(mxConstants.NONE);g.rect(r,A,v,z);g.fill()};ha.prototype.paintForeground=function(g,r,A,v,z){};mxCellRenderer.registerShape("transparent",ha);mxUtils.extend(qa,mxHexagon);qa.prototype.size=30;qa.prototype.position=.5;qa.prototype.position2=.5;qa.prototype.base=20;qa.prototype.getLabelMargins=function(){return new mxRectangle(0,+0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};qa.prototype.isRoundable=function(){return!0};qa.prototype.redrawPath=function(g,r,A,v,z){r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var F=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),I=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",+this.position2)))),ea=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,z-A),new mxPoint(Math.min(v,F+ea),z-A),new mxPoint(I,z),new mxPoint(Math.max(0,F),z-A),new mxPoint(0,z-A)],this.isRounded,r,!0,[4])};mxCellRenderer.registerShape("callout",qa);mxUtils.extend(ra,mxActor);ra.prototype.size=.2;ra.prototype.fixedSize=20;ra.prototype.isRoundable=function(){return!0};ra.prototype.redrawPath=function(g,+r,A,v,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(v-r,0),new mxPoint(v,z/2),new mxPoint(v-r,z),new mxPoint(0,z),new mxPoint(r,z/2)],this.isRounded,A,!0);g.end()};mxCellRenderer.registerShape("step",+ra);mxUtils.extend(l,mxHexagon);l.prototype.size=.25;l.prototype.fixedSize=20;l.prototype.isRoundable=function(){return!0};l.prototype.redrawPath=function(g,r,A,v,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*v,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,+0),new mxPoint(v-r,0),new mxPoint(v,.5*z),new mxPoint(v-r,z),new mxPoint(r,z),new mxPoint(0,.5*z)],this.isRounded,A,!0)};mxCellRenderer.registerShape("hexagon",l);mxUtils.extend(t,mxRectangleShape);t.prototype.isHtmlAllowed=function(){return!1};t.prototype.paintForeground=function(g,r,A,v,z){var F=Math.min(v/5,z/5)+1;g.begin();g.moveTo(r+v/2,A+F);g.lineTo(r+v/2,A+z-F);g.moveTo(r+F,A+z/2);g.lineTo(r+v-F,A+z/2);g.end();g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",+t);var pb=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(g){if(1==this.style["double"]){var r=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(g.x+r,g.y+r,g.width-2*r,g.height-2*r)}return g};mxRhombus.prototype.paintVertexShape=function(g,r,A,v,z){pb.apply(this,arguments);var F=r,I=A,ea=v,S=z;if(!this.outline&&1==this.style["double"]){var ta=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||+0);r+=ta;A+=ta;v-=2*ta;z-=2*ta;0<v&&0<z&&(g.setShadow(!1),pb.apply(this,[g,r,A,v,z]))}this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(g,F,I,ea,S,0)};mxShape.prototype.paintGlassEffect=function(g,r,A,v,z,F){var I=Math.ceil(this.strokewidth/2);g.setGradient("#ffffff","#ffffff",r,A,v,.6*z,"south",.9,.1);g.begin();this.paintGlassEffectPath(g,r,A,v,z,I,F);g.close();g.fill()};mxShape.prototype.paintGlassEffectPath=function(g,r,A,v,z,F,I){I+=2*F;this.isRounded?+(g.moveTo(r-F+I,A-F),g.quadTo(r-F,A-F,r-F,A-F+I),g.lineTo(r-F,A+.4*z),g.quadTo(r+.5*v,A+.7*z,r+v+F,A+.4*z),g.lineTo(r+v+F,A-F+I),g.quadTo(r+v+F,A-F,r+v+F-I,A-F)):(g.moveTo(r-F,A-F),g.lineTo(r-F,A+.4*z),g.quadTo(r+.5*v,A+.7*z,r+v+F,A+.4*z),g.lineTo(r+v+F,A-F))};mxEllipse.prototype.paintGlassEffectPath=function(g,r,A,v,z,F,I){I=v/2+F;F=z/2+F;r+=v/2;A+=z/2;g.moveTo(r-I,A);g.curveTo(r-I,A-.5522847498*F,r-.5522847498*I,A-F,r,A-F);g.curveTo(r+.5522847498*I,A-F,r+I,A-.5522847498*F,r+I,A);g.quadTo(r,A+.2*+z,r-I,A)};mxRhombus.prototype.paintGlassEffectPath=function(g,r,A,v,z,F,I){F=v/2;I=z/2;var ea=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,A+I),new mxPoint(r+F,A),new mxPoint(r+v,A+I)],this.isRounded,ea,!1);g.quadTo(r+F,A+.7*z,r,A+I)};var rb=mxEllipse.prototype.paintVertexShape;mxEllipse.prototype.paintVertexShape=function(g,r,A,v,z){rb.apply(this,arguments);this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&+this.paintGlassEffect(g,r,A,v,z,0)};mxUtils.extend(H,mxRectangleShape);H.prototype.isHtmlAllowed=function(){return!1};H.prototype.getLabelBounds=function(g){if(1==this.style["double"]){var r=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(g.x+r,g.y+r,g.width-2*r,g.height-2*r)}return g};H.prototype.paintForeground=function(g,r,A,v,z){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var F=Math.max(2,this.strokewidth++1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);r+=F;A+=F;v-=2*F;z-=2*F;0<v&&0<z&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}g.setDashed(!1);F=0;do{var I=mxCellRenderer.defaultShapes[this.style["symbol"+F]];if(null!=I){var ea=this.style["symbol"+F+"Align"],S=this.style["symbol"+F+"VerticalAlign"],ta=this.style["symbol"+F+"Width"],oa=this.style["symbol"+F+"Height"],Ia=this.style["symbol"+F+"Spacing"]||0,mb=this.style["symbol"+F+"VSpacing"]||Ia,$a=this.style["symbol"+F++"ArcSpacing"];null!=$a&&($a*=this.getArcSize(v+this.strokewidth,z+this.strokewidth),Ia+=$a,mb+=$a);$a=r;var Ea=A;$a=ea==mxConstants.ALIGN_CENTER?$a+(v-ta)/2:ea==mxConstants.ALIGN_RIGHT?$a+(v-ta-Ia):$a+Ia;Ea=S==mxConstants.ALIGN_MIDDLE?Ea+(z-oa)/2:S==mxConstants.ALIGN_BOTTOM?Ea+(z-oa-mb):Ea+mb;g.save();ea=new I;ea.style=this.style;I.prototype.paintVertexShape.call(ea,g,$a,Ea,ta,oa);g.restore()}F++}while(null!=I)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",+H);mxUtils.extend(J,mxCylinder);J.prototype.redrawPath=function(g,r,A,v,z,F){F?(g.moveTo(0,0),g.lineTo(v/2,z/2),g.lineTo(v,0),g.end()):(g.moveTo(0,0),g.lineTo(v,0),g.lineTo(v,z),g.lineTo(0,z),g.close())};mxCellRenderer.registerShape("message",J);mxUtils.extend(R,mxShape);R.prototype.paintBackground=function(g,r,A,v,z){g.translate(r,A);g.ellipse(v/4,0,v/2,z/4);g.fillAndStroke();g.begin();g.moveTo(v/2,z/4);g.lineTo(v/2,2*z/3);g.moveTo(v/2,z/3);g.lineTo(0,z/3);g.moveTo(v/2,z/3);g.lineTo(v,z/3);g.moveTo(v/+2,2*z/3);g.lineTo(0,z);g.moveTo(v/2,2*z/3);g.lineTo(v,z);g.end();g.stroke()};mxCellRenderer.registerShape("umlActor",R);mxUtils.extend(T,mxShape);T.prototype.getLabelMargins=function(g){return new mxRectangle(g.width/6,0,0,0)};T.prototype.paintBackground=function(g,r,A,v,z){g.translate(r,A);g.begin();g.moveTo(0,z/4);g.lineTo(0,3*z/4);g.end();g.stroke();g.begin();g.moveTo(0,z/2);g.lineTo(v/6,z/2);g.end();g.stroke();g.ellipse(v/6,0,5*v/6,z);g.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",+T);mxUtils.extend(Y,mxEllipse);Y.prototype.paintVertexShape=function(g,r,A,v,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.begin();g.moveTo(r+v/8,A+z);g.lineTo(r+7*v/8,A+z);g.end();g.stroke()};mxCellRenderer.registerShape("umlEntity",Y);mxUtils.extend(Z,mxShape);Z.prototype.paintVertexShape=function(g,r,A,v,z){g.translate(r,A);g.begin();g.moveTo(v,0);g.lineTo(0,z);g.moveTo(0,0);g.lineTo(v,z);g.end();g.stroke()};mxCellRenderer.registerShape("umlDestroy",Z);mxUtils.extend(ia,mxShape);+ia.prototype.getLabelBounds=function(g){return new mxRectangle(g.x,g.y+g.height/8,g.width,7*g.height/8)};ia.prototype.paintBackground=function(g,r,A,v,z){g.translate(r,A);g.begin();g.moveTo(3*v/8,z/8*1.1);g.lineTo(5*v/8,0);g.end();g.stroke();g.ellipse(0,z/8,v,7*z/8);g.fillAndStroke()};ia.prototype.paintForeground=function(g,r,A,v,z){g.begin();g.moveTo(3*v/8,z/8*1.1);g.lineTo(5*v/8,z/4);g.end();g.stroke()};mxCellRenderer.registerShape("umlControl",ia);mxUtils.extend(X,mxShape);X.prototype.iconSize=+44;X.prototype.paintBackground=function(g,r,A,v,z){z=Math.min(this.iconSize,v,z);var F=.9*z,I=.45*z;r=r+v/2-z/2;v=A+z/2;var ea=r+.175*F;F=ea-F;g.begin();g.moveTo(F,v-I/2);g.lineTo(F,v+I/2);g.end();g.stroke();g.begin();g.moveTo(F,v);g.lineTo(ea,v);g.end();g.stroke();g.ellipse(r,A,z,z);g.fillAndStroke()};mxCellRenderer.registerShape("seqBoundary",X);mxCellRenderer.registerShape("seqControl",ja(ia,44));mxCellRenderer.registerShape("seqEntity",ja(Y,44));mxUtils.extend(ka,mxShape);ka.prototype.paintBackground=+function(g,r,A,v,z){var F=z/2,I=F/(2.5+z/50);g.save();g.translate(r,A);g.begin();g.moveTo(I,0);g.lineTo(v-I,0);g.arcTo(I,F,0,0,1,v-I,z);g.lineTo(I,z);g.arcTo(I,F,0,0,1,I,0);g.close();g.fillAndStroke();g.restore()};ka.prototype.paintForeground=function(g,r,A,v,z){var F=z/2,I=F/(2.5+z/50);g.save();g.translate(r,A);g.begin();g.moveTo(v-I,0);g.arcTo(I,F,0,0,0,v-I,z);g.stroke();g.restore()};mxCellRenderer.registerShape("seqQueue",ka);mxUtils.extend(na,mxShape);na.prototype.paintBackground=function(g,r,+A,v,z){g.rect(r+6,A-6,v,z);g.fillAndStroke();g.rect(r,A,v,z);g.fillAndStroke()};mxCellRenderer.registerShape("seqCollections",na);mxUtils.extend(la,mxShape);la.prototype.paintBackground=function(g,r,A,v,z){z=v/3;var F=v/3,I=z/2,ea=I/(2.5+z/50);g.translate(r+(v-z)/2,A);g.begin();g.moveTo(0,ea);g.arcTo(I,ea,0,0,0,z,ea);g.arcTo(I,ea,0,0,0,0,ea);g.lineTo(0,F-ea);g.arcTo(I,ea,0,0,0,z,F-ea);g.lineTo(z,ea);g.fillAndStroke()};mxCellRenderer.registerShape("seqDatabase",la);mxUtils.extend(ua,mxShape);ua.prototype.paintBackground=+function(g,r,A,v,z){r+=v/2;A+=15;v=A+15;z=v+20;var F=v+10,I=z+15;g.ellipse(r-15,A-15,30,30);g.fillAndStroke();g.begin();g.moveTo(r,v);g.lineTo(r,z);g.moveTo(r-18,F);g.lineTo(r+18,F);g.moveTo(r,z);g.lineTo(r-16,I);g.moveTo(r,z);g.lineTo(r+16,I);g.stroke()};mxCellRenderer.registerShape("seqActorStick",ua);mxUtils.extend(za,mxRectangleShape);za.prototype.size=40;za.prototype.isHtmlAllowed=function(){return!1};za.prototype.isMirrored=function(){return"1"==mxUtils.getValue(this.style,"lifelineMirror",+"0")};za.prototype.getHeadSize=function(g){return Math.max(0,Math.min(this.isMirrored()?g/2:g,parseFloat(mxUtils.getValue(this.style,"size",this.size))))};za.prototype.getLabelBounds=function(g){var r=Math.max(0,Math.min(this.isMirrored()?g.height/2:g.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(g.x,g.y,g.width,r)};za.prototype.paintBackground=function(g,r,A,v,z){var F=this.getHeadSize(z),I=this.isMirrored(),ea=mxUtils.getValue(this.style,"participant");+null==ea||null==this.state?(mxRectangleShape.prototype.paintBackground.call(this,g,r,A,v,F),I&&mxRectangleShape.prototype.paintBackground.call(this,g,r,A+z-F,v,F)):(ea=this.state.view.graph.cellRenderer.getShape(ea),null!=ea&&ea!=za&&(ea=new ea,ea.apply(this.state),g.save(),ea.paintVertexShape(g,r,A,v,F),g.restore(),I&&(g.save(),ea.paintVertexShape(g,r,A+z-F,v,F),g.restore())));z=I?z-F:z;F<z&&(g.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),g.begin(),g.moveTo(r+v/2,A+F),g.lineTo(r++v/2,A+z),g.end(),g.stroke())};za.prototype.paintForeground=function(g,r,A,v,z){var F=mxUtils.getValue(this.style,"participant"),I=this.getHeadSize(z),ea=this.isMirrored();null==F&&(mxRectangleShape.prototype.paintForeground.call(this,g,r,A,v,Math.min(z,I)),ea&&mxRectangleShape.prototype.paintForeground.call(this,g,r,A+z-I,v,I));ea&&this.paintMirrorLabel(g,r,A+z-I,v,I)};za.prototype.paintMirrorLabel=function(g,r,A,v,z){var F=null!=this.state?this.state.view.graph.getLabel(this.state.cell):null;this.mirrorLabelValue=F;if(null!=F&&""!=F){g.setFontColor(mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"black"));g.setFontBackgroundColor(mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null));g.setFontBorderColor(mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null));g.setFontFamily(mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY));g.setFontSize(parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)));g.setFontStyle(parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,0)));var I=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),ea=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),S=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,2)),ta=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,0))+S,oa=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,0))+S,Ia=parseFloat(mxUtils.getValue(this.style,-mxConstants.STYLE_SPACING_LEFT,0))+S;S=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,0))+S;r=I==mxConstants.ALIGN_LEFT?r+Ia:I==mxConstants.ALIGN_RIGHT?r+u-S:r+u/2;A=ea==mxConstants.ALIGN_TOP?A+ta+1:ea==mxConstants.ALIGN_BOTTOM?A+z-oa-1:A+z/2;z="wrap"==mxUtils.getValue(this.style,mxConstants.STYLE_WHITE_SPACE,null);ta="1"==mxUtils.getValue(this.style,"html","0")?"html":"";g.text(r,A,z?u-Ia-S:0,0,F,I,ea,z,ta,null,!1,0,null)}};mxCellRenderer.registerShape("umlLifeline",za);var tb=+mxConstants.STYLE_SPACING_LEFT,0))+S;S=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,0))+S;r=I==mxConstants.ALIGN_LEFT?r+Ia:I==mxConstants.ALIGN_RIGHT?r+v-S:r+v/2;A=ea==mxConstants.ALIGN_TOP?A+ta+1:ea==mxConstants.ALIGN_BOTTOM?A+z-oa-1:A+z/2;z="wrap"==mxUtils.getValue(this.style,mxConstants.STYLE_WHITE_SPACE,null);ta="1"==mxUtils.getValue(this.style,"html","0")?"html":"";g.text(r,A,z?v-Ia-S:0,0,F,I,ea,z,ta,null,!1,0,null)}};mxCellRenderer.registerShape("umlLifeline",za);var tb=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(g,r){return tb.apply(this,arguments)||void 0!==r.mirrorLabelValue&&r.mirrorLabelValue!=g.view.graph.getLabel(g.cell)};mxUtils.extend(sa,mxShape);sa.prototype.width=60;sa.prototype.height=30;sa.prototype.corner=10;sa.prototype.configurePointerEvents=function(g){var r=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=r&&r!=mxConstants.NONE&&0!=this.opacity&&-0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(g.pointerEvents=!1)};sa.prototype.getLabelMargins=function(g){return new mxRectangle(0,0,g.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),g.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};sa.prototype.paintBackground=function(g,r,A,u,z){var F=this.corner,I=Math.min(u,Math.max(F,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),ea=-Math.min(z,Math.max(1.5*F,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),S=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);S!=mxConstants.NONE&&(g.setFillColor(S),g.rect(r,A,u,z),g.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(g,r,A,u,z),g.setGradient(this.fill,this.gradient,r,A,u,z,this.gradientDirection)):g.setFillColor(this.fill);g.pointerEvents=!0;g.begin();g.moveTo(r,-A);g.lineTo(r+I,A);g.lineTo(r+I,A+Math.max(0,ea-1.5*F));g.lineTo(r+Math.max(0,I-F),A+ea);g.lineTo(r,A+ea);g.close();g.fillAndStroke();this.configurePointerEvents(g);g.begin();g.moveTo(r+I,A);g.lineTo(r+u,A);g.lineTo(r+u,A+z);g.lineTo(r,A+z);g.lineTo(r,A+ea);g.stroke()};mxCellRenderer.registerShape("umlFrame",sa);mxPerimeter.CenterPerimeter=function(g,r,A,u){return new mxPoint(g.getCenterX(),g.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=-function(g,r,A,u){u=za.prototype.size;var z=g.y+g.height;null!=r&&(u=mxUtils.getValue(r.style,"size",u)*r.view.scale,"1"==mxUtils.getValue(r.style,"lifelineMirror","0")&&(z-=u));r=parseFloat(r.style[mxConstants.STYLE_STROKEWIDTH]||1)*r.view.scale/2-1;A.x<g.getCenterX()&&(r=-1*(r+1));return new mxPoint(g.getCenterX()+r,Math.min(z,Math.max(g.y+u,A.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(g,r,A,u){u=!0;return mxPerimeter.RectanglePerimeter.apply(this,-arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(g,r,A,u){u=parseFloat(r.style[mxConstants.STYLE_STROKEWIDTH]||1)*r.view.scale/2-1;null!=r.style.backboneSize&&(u+=parseFloat(r.style.backboneSize)*r.view.scale/2-1);if("south"==r.style[mxConstants.STYLE_DIRECTION]||"north"==r.style[mxConstants.STYLE_DIRECTION])return A.x<g.getCenterX()&&(u=-1*(u+1)),new mxPoint(g.getCenterX()+u,Math.min(g.y+g.height,Math.max(g.y,A.y)));-A.y<g.getCenterY()&&(u=-1*(u+1));return new mxPoint(Math.min(g.x+g.width,Math.max(g.x,A.x)),g.getCenterY()+u)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(g,r,A,u){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(g,new mxRectangle(0,0,0,Math.max(0,Math.min(g.height,parseFloat(mxUtils.getValue(r.style,"size",qa.prototype.size))*r.view.scale))),r.style),r,A,u)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);-mxPerimeter.ParallelogramPerimeter=function(g,r,A,u){var z="0"!=mxUtils.getValue(r.style,"fixedSize","0"),F=z?V.prototype.fixedSize:V.prototype.size;null!=r&&(F=mxUtils.getValue(r.style,"size",F));z&&(F*=r.view.scale);var I=g.x,ea=g.y,S=g.width,ta=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH?(z=z?Math.max(0,Math.min(ta,F)):ta*Math.max(0,Math.min(1,F)),ea=-[new mxPoint(I,ea),new mxPoint(I+S,ea+z),new mxPoint(I+S,ea+ta),new mxPoint(I,ea+ta-z),new mxPoint(I,ea)]):(z=z?Math.max(0,Math.min(.5*S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I+z,ea),new mxPoint(I+S,ea),new mxPoint(I+S-z,ea+ta),new mxPoint(I,ea+ta),new mxPoint(I+z,ea)]);ta=g.getCenterX();g=g.getCenterY();g=new mxPoint(ta,g);u&&(A.x<I||A.x>I+S?g.y=A.y:g.x=A.x);return mxUtils.getPerimeterPoint(ea,g,A)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=-function(g,r,A,u){var z="0"!=mxUtils.getValue(r.style,"fixedSize","0"),F=z?K.prototype.fixedSize:K.prototype.size;null!=r&&(F=mxUtils.getValue(r.style,"size",F));z&&(F*=r.view.scale);var I=g.x,ea=g.y,S=g.width,ta=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_EAST?(z=z?Math.max(0,Math.min(.5*S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I+z,ea),new mxPoint(I+S-z,ea),new mxPoint(I+S,ea+ta),+0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(g.pointerEvents=!1)};sa.prototype.getLabelMargins=function(g){return new mxRectangle(0,0,g.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),g.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};sa.prototype.paintBackground=function(g,r,A,v,z){var F=this.corner,I=Math.min(v,Math.max(F,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),ea=+Math.min(z,Math.max(1.5*F,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),S=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);S!=mxConstants.NONE&&(g.setFillColor(S),g.rect(r,A,v,z),g.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(g,r,A,v,z),g.setGradient(this.fill,this.gradient,r,A,v,z,this.gradientDirection)):g.setFillColor(this.fill);g.pointerEvents=!0;g.begin();g.moveTo(r,+A);g.lineTo(r+I,A);g.lineTo(r+I,A+Math.max(0,ea-1.5*F));g.lineTo(r+Math.max(0,I-F),A+ea);g.lineTo(r,A+ea);g.close();g.fillAndStroke();this.configurePointerEvents(g);g.begin();g.moveTo(r+I,A);g.lineTo(r+v,A);g.lineTo(r+v,A+z);g.lineTo(r,A+z);g.lineTo(r,A+ea);g.stroke()};mxCellRenderer.registerShape("umlFrame",sa);mxPerimeter.CenterPerimeter=function(g,r,A,v){return new mxPoint(g.getCenterX(),g.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=+function(g,r,A,v){v=za.prototype.size;var z=g.y+g.height;null!=r&&(v=mxUtils.getValue(r.style,"size",v)*r.view.scale,"1"==mxUtils.getValue(r.style,"lifelineMirror","0")&&(z-=v));r=parseFloat(r.style[mxConstants.STYLE_STROKEWIDTH]||1)*r.view.scale/2-1;A.x<g.getCenterX()&&(r=-1*(r+1));return new mxPoint(g.getCenterX()+r,Math.min(z,Math.max(g.y+v,A.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(g,r,A,v){v=!0;return mxPerimeter.RectanglePerimeter.apply(this,+arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(g,r,A,v){v=parseFloat(r.style[mxConstants.STYLE_STROKEWIDTH]||1)*r.view.scale/2-1;null!=r.style.backboneSize&&(v+=parseFloat(r.style.backboneSize)*r.view.scale/2-1);if("south"==r.style[mxConstants.STYLE_DIRECTION]||"north"==r.style[mxConstants.STYLE_DIRECTION])return A.x<g.getCenterX()&&(v=-1*(v+1)),new mxPoint(g.getCenterX()+v,Math.min(g.y+g.height,Math.max(g.y,A.y)));+A.y<g.getCenterY()&&(v=-1*(v+1));return new mxPoint(Math.min(g.x+g.width,Math.max(g.x,A.x)),g.getCenterY()+v)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(g,r,A,v){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(g,new mxRectangle(0,0,0,Math.max(0,Math.min(g.height,parseFloat(mxUtils.getValue(r.style,"size",qa.prototype.size))*r.view.scale))),r.style),r,A,v)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);+mxPerimeter.ParallelogramPerimeter=function(g,r,A,v){var z="0"!=mxUtils.getValue(r.style,"fixedSize","0"),F=z?V.prototype.fixedSize:V.prototype.size;null!=r&&(F=mxUtils.getValue(r.style,"size",F));z&&(F*=r.view.scale);var I=g.x,ea=g.y,S=g.width,ta=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH?(z=z?Math.max(0,Math.min(ta,F)):ta*Math.max(0,Math.min(1,F)),ea=+[new mxPoint(I,ea),new mxPoint(I+S,ea+z),new mxPoint(I+S,ea+ta),new mxPoint(I,ea+ta-z),new mxPoint(I,ea)]):(z=z?Math.max(0,Math.min(.5*S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I+z,ea),new mxPoint(I+S,ea),new mxPoint(I+S-z,ea+ta),new mxPoint(I,ea+ta),new mxPoint(I+z,ea)]);ta=g.getCenterX();g=g.getCenterY();g=new mxPoint(ta,g);v&&(A.x<I||A.x>I+S?g.y=A.y:g.x=A.x);return mxUtils.getPerimeterPoint(ea,g,A)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=+function(g,r,A,v){var z="0"!=mxUtils.getValue(r.style,"fixedSize","0"),F=z?K.prototype.fixedSize:K.prototype.size;null!=r&&(F=mxUtils.getValue(r.style,"size",F));z&&(F*=r.view.scale);var I=g.x,ea=g.y,S=g.width,ta=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_EAST?(z=z?Math.max(0,Math.min(.5*S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I+z,ea),new mxPoint(I+S-z,ea),new mxPoint(I+S,ea+ta),new mxPoint(I,ea+ta),new mxPoint(I+z,ea)]):r==mxConstants.DIRECTION_WEST?(z=z?Math.max(0,Math.min(S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I,ea),new mxPoint(I+S,ea),new mxPoint(I+S-z,ea+ta),new mxPoint(I+z,ea+ta),new mxPoint(I,ea)]):r==mxConstants.DIRECTION_NORTH?(z=z?Math.max(0,Math.min(ta,F)):ta*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I,ea+z),new mxPoint(I+S,ea),new mxPoint(I+S,ea+ta),new mxPoint(I,ea+ta-z),new mxPoint(I,ea+z)]):(z=z?Math.max(0,Math.min(ta,F)):ta*Math.max(0,Math.min(1,-F)),ea=[new mxPoint(I,ea),new mxPoint(I+S,ea+z),new mxPoint(I+S,ea+ta-z),new mxPoint(I,ea+ta),new mxPoint(I,ea)]);ta=g.getCenterX();g=g.getCenterY();g=new mxPoint(ta,g);u&&(A.x<I||A.x>I+S?g.y=A.y:g.x=A.x);return mxUtils.getPerimeterPoint(ea,g,A)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(g,r,A,u){var z="0"!=mxUtils.getValue(r.style,"fixedSize","0"),F=z?ra.prototype.fixedSize:ra.prototype.size;null!=r&&(F=mxUtils.getValue(r.style,+F)),ea=[new mxPoint(I,ea),new mxPoint(I+S,ea+z),new mxPoint(I+S,ea+ta-z),new mxPoint(I,ea+ta),new mxPoint(I,ea)]);ta=g.getCenterX();g=g.getCenterY();g=new mxPoint(ta,g);v&&(A.x<I||A.x>I+S?g.y=A.y:g.x=A.x);return mxUtils.getPerimeterPoint(ea,g,A)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(g,r,A,v){var z="0"!=mxUtils.getValue(r.style,"fixedSize","0"),F=z?ra.prototype.fixedSize:ra.prototype.size;null!=r&&(F=mxUtils.getValue(r.style,"size",F));z&&(F*=r.view.scale);var I=g.x,ea=g.y,S=g.width,ta=g.height,oa=g.getCenterX();g=g.getCenterY();r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_EAST?(z=z?Math.max(0,Math.min(S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I,ea),new mxPoint(I+S-z,ea),new mxPoint(I+S,g),new mxPoint(I+S-z,ea+ta),new mxPoint(I,ea+ta),new mxPoint(I+z,g),new mxPoint(I,ea)]):r==mxConstants.DIRECTION_WEST?(z=z?Math.max(0,Math.min(S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I+z,ea),new mxPoint(I+S,ea),new mxPoint(I+S-z,g),new mxPoint(I+S,ea+ta),new mxPoint(I+z,ea+ta),new mxPoint(I,g),new mxPoint(I+z,ea)]):r==mxConstants.DIRECTION_NORTH?(z=z?Math.max(0,Math.min(ta,F)):ta*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I,ea+z),new mxPoint(oa,ea),new mxPoint(I+S,ea+z),new mxPoint(I+S,ea+ta),new mxPoint(oa,ea+ta-z),new mxPoint(I,ea+ta),new mxPoint(I,ea+z)]):(z=z?Math.max(0,Math.min(ta,F)):ta*Math.max(0,Math.min(1,F)),-ea=[new mxPoint(I,ea),new mxPoint(oa,ea+z),new mxPoint(I+S,ea),new mxPoint(I+S,ea+ta-z),new mxPoint(oa,ea+ta),new mxPoint(I,ea+ta-z),new mxPoint(I,ea)]);oa=new mxPoint(oa,g);u&&(A.x<I||A.x>I+S?oa.y=A.y:oa.x=A.x);return mxUtils.getPerimeterPoint(ea,oa,A)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(g,r,A,u){var z="0"!=mxUtils.getValue(r.style,"fixedSize","0"),F=z?l.prototype.fixedSize:l.prototype.size;null!=r&&(F=mxUtils.getValue(r.style,+ea=[new mxPoint(I,ea),new mxPoint(oa,ea+z),new mxPoint(I+S,ea),new mxPoint(I+S,ea+ta-z),new mxPoint(oa,ea+ta),new mxPoint(I,ea+ta-z),new mxPoint(I,ea)]);oa=new mxPoint(oa,g);v&&(A.x<I||A.x>I+S?oa.y=A.y:oa.x=A.x);return mxUtils.getPerimeterPoint(ea,oa,A)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(g,r,A,v){var z="0"!=mxUtils.getValue(r.style,"fixedSize","0"),F=z?l.prototype.fixedSize:l.prototype.size;null!=r&&(F=mxUtils.getValue(r.style,"size",F));z&&(F*=r.view.scale);var I=g.x,ea=g.y,S=g.width,ta=g.height,oa=g.getCenterX();g=g.getCenterY();r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH?(z=z?Math.max(0,Math.min(ta,F)):ta*Math.max(0,Math.min(1,F)),ea=[new mxPoint(oa,ea),new mxPoint(I+S,ea+z),new mxPoint(I+S,ea+ta-z),new mxPoint(oa,ea+ta),new mxPoint(I,ea+ta-z),new mxPoint(I,ea+z),new mxPoint(oa,ea)]):-(z=z?Math.max(0,Math.min(S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I+z,ea),new mxPoint(I+S-z,ea),new mxPoint(I+S,g),new mxPoint(I+S-z,ea+ta),new mxPoint(I+z,ea+ta),new mxPoint(I,g),new mxPoint(I+z,ea)]);oa=new mxPoint(oa,g);u&&(A.x<I||A.x>I+S?oa.y=A.y:oa.x=A.x);return mxUtils.getPerimeterPoint(ea,oa,A)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(wa,mxShape);wa.prototype.size=10;wa.prototype.paintBackground=function(g,r,A,u,z){var F=parseFloat(mxUtils.getValue(this.style,-"size",this.size));g.translate(r,A);g.ellipse((u-F)/2,0,F,F);g.fillAndStroke();g.begin();g.moveTo(u/2,F);g.lineTo(u/2,z);g.end();g.stroke()};mxCellRenderer.registerShape("lollipop",wa);mxUtils.extend(Ca,mxShape);Ca.prototype.size=10;Ca.prototype.inset=2;Ca.prototype.paintBackground=function(g,r,A,u,z){var F=parseFloat(mxUtils.getValue(this.style,"size",this.size)),I=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;g.translate(r,A);g.begin();g.moveTo(u/2,F+I);g.lineTo(u/-2,z);g.end();g.stroke();g.begin();g.moveTo((u-F)/2-I,F/2);g.quadTo((u-F)/2-I,F+I,u/2,F+I);g.quadTo((u+F)/2+I,F+I,(u+F)/2+I,F/2);g.end();g.stroke()};mxCellRenderer.registerShape("requires",Ca);mxUtils.extend(Fa,mxShape);Fa.prototype.paintBackground=function(g,r,A,u,z){g.translate(r,A);g.begin();g.moveTo(0,0);g.quadTo(u,0,u,z/2);g.quadTo(u,z,0,z);g.end();g.stroke()};mxCellRenderer.registerShape("requiredInterface",Fa);mxUtils.extend(Ha,mxShape);Ha.prototype.inset=2;Ha.prototype.paintBackground=function(g,-r,A,u,z){var F=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;g.translate(r,A);g.ellipse(0,F,u-2*F,z-2*F);g.fillAndStroke();g.begin();g.moveTo(u/2,0);g.quadTo(u,0,u,z/2);g.quadTo(u,z,u/2,z);g.end();g.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",Ha);mxUtils.extend(Na,mxCylinder);Na.prototype.jettyWidth=20;Na.prototype.jettyHeight=10;Na.prototype.redrawPath=function(g,r,A,u,z,F){var I=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));-r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));A=I/2;I=A+I/2;var ea=Math.min(r,z-r),S=Math.min(ea+2*r,z-r);F?(g.moveTo(A,ea),g.lineTo(I,ea),g.lineTo(I,ea+r),g.lineTo(A,ea+r),g.moveTo(A,S),g.lineTo(I,S),g.lineTo(I,S+r),g.lineTo(A,S+r)):(g.moveTo(A,0),g.lineTo(u,0),g.lineTo(u,z),g.lineTo(A,z),g.lineTo(A,S+r),g.lineTo(0,S+r),g.lineTo(0,S),g.lineTo(A,S),g.lineTo(A,ea+r),g.lineTo(0,ea+r),g.lineTo(0,ea),g.lineTo(A,ea),g.close());g.end()};mxCellRenderer.registerShape("module",-Na);mxUtils.extend(La,mxCylinder);La.prototype.jettyWidth=32;La.prototype.jettyHeight=12;La.prototype.redrawPath=function(g,r,A,u,z,F){var I=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));A=I/2;I=A+I/2;var ea=.3*z-r/2,S=.7*z-r/2;F?(g.moveTo(A,ea),g.lineTo(I,ea),g.lineTo(I,ea+r),g.lineTo(A,ea+r),g.moveTo(A,S),g.lineTo(I,S),g.lineTo(I,S+r),g.lineTo(A,S+r)):(g.moveTo(A,0),g.lineTo(u,0),g.lineTo(u,z),g.lineTo(A,-z),g.lineTo(A,S+r),g.lineTo(0,S+r),g.lineTo(0,S),g.lineTo(A,S),g.lineTo(A,ea+r),g.lineTo(0,ea+r),g.lineTo(0,ea),g.lineTo(A,ea),g.close());g.end()};mxCellRenderer.registerShape("component",La);mxUtils.extend(Da,mxRectangleShape);Da.prototype.paintForeground=function(g,r,A,u,z){var F=u/2,I=z/2,ea=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;g.begin();this.addPoints(g,[new mxPoint(r+F,A),new mxPoint(r+u,A+I),new mxPoint(r+F,A+z),new mxPoint(r,A+I)],this.isRounded,-ea,!0);g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",Da);mxUtils.extend(Sa,mxDoubleEllipse);Sa.prototype.outerStroke=!0;Sa.prototype.paintVertexShape=function(g,r,A,u,z){var F=Math.min(4,Math.min(u/5,z/5));0<u&&0<z&&(g.ellipse(r+F,A+F,u-2*F,z-2*F),g.fillAndStroke());g.setShadow(!1);this.outerStroke&&(g.ellipse(r,A,u,z),g.stroke())};mxCellRenderer.registerShape("endState",Sa);mxUtils.extend(Oa,Sa);Oa.prototype.outerStroke=+(z=z?Math.max(0,Math.min(S,F)):S*Math.max(0,Math.min(1,F)),ea=[new mxPoint(I+z,ea),new mxPoint(I+S-z,ea),new mxPoint(I+S,g),new mxPoint(I+S-z,ea+ta),new mxPoint(I+z,ea+ta),new mxPoint(I,g),new mxPoint(I+z,ea)]);oa=new mxPoint(oa,g);v&&(A.x<I||A.x>I+S?oa.y=A.y:oa.x=A.x);return mxUtils.getPerimeterPoint(ea,oa,A)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(wa,mxShape);wa.prototype.size=10;wa.prototype.paintBackground=function(g,r,A,v,z){var F=parseFloat(mxUtils.getValue(this.style,+"size",this.size));g.translate(r,A);g.ellipse((v-F)/2,0,F,F);g.fillAndStroke();g.begin();g.moveTo(v/2,F);g.lineTo(v/2,z);g.end();g.stroke()};mxCellRenderer.registerShape("lollipop",wa);mxUtils.extend(Ca,mxShape);Ca.prototype.size=10;Ca.prototype.inset=2;Ca.prototype.paintBackground=function(g,r,A,v,z){var F=parseFloat(mxUtils.getValue(this.style,"size",this.size)),I=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;g.translate(r,A);g.begin();g.moveTo(v/2,F+I);g.lineTo(v/+2,z);g.end();g.stroke();g.begin();g.moveTo((v-F)/2-I,F/2);g.quadTo((v-F)/2-I,F+I,v/2,F+I);g.quadTo((v+F)/2+I,F+I,(v+F)/2+I,F/2);g.end();g.stroke()};mxCellRenderer.registerShape("requires",Ca);mxUtils.extend(Fa,mxShape);Fa.prototype.paintBackground=function(g,r,A,v,z){g.translate(r,A);g.begin();g.moveTo(0,0);g.quadTo(v,0,v,z/2);g.quadTo(v,z,0,z);g.end();g.stroke()};mxCellRenderer.registerShape("requiredInterface",Fa);mxUtils.extend(Ha,mxShape);Ha.prototype.inset=2;Ha.prototype.paintBackground=function(g,+r,A,v,z){var F=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;g.translate(r,A);g.ellipse(0,F,v-2*F,z-2*F);g.fillAndStroke();g.begin();g.moveTo(v/2,0);g.quadTo(v,0,v,z/2);g.quadTo(v,z,v/2,z);g.end();g.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",Ha);mxUtils.extend(Na,mxCylinder);Na.prototype.jettyWidth=20;Na.prototype.jettyHeight=10;Na.prototype.redrawPath=function(g,r,A,v,z,F){var I=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));+r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));A=I/2;I=A+I/2;var ea=Math.min(r,z-r),S=Math.min(ea+2*r,z-r);F?(g.moveTo(A,ea),g.lineTo(I,ea),g.lineTo(I,ea+r),g.lineTo(A,ea+r),g.moveTo(A,S),g.lineTo(I,S),g.lineTo(I,S+r),g.lineTo(A,S+r)):(g.moveTo(A,0),g.lineTo(v,0),g.lineTo(v,z),g.lineTo(A,z),g.lineTo(A,S+r),g.lineTo(0,S+r),g.lineTo(0,S),g.lineTo(A,S),g.lineTo(A,ea+r),g.lineTo(0,ea+r),g.lineTo(0,ea),g.lineTo(A,ea),g.close());g.end()};mxCellRenderer.registerShape("module",+Na);mxUtils.extend(La,mxCylinder);La.prototype.jettyWidth=32;La.prototype.jettyHeight=12;La.prototype.redrawPath=function(g,r,A,v,z,F){var I=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));A=I/2;I=A+I/2;var ea=.3*z-r/2,S=.7*z-r/2;F?(g.moveTo(A,ea),g.lineTo(I,ea),g.lineTo(I,ea+r),g.lineTo(A,ea+r),g.moveTo(A,S),g.lineTo(I,S),g.lineTo(I,S+r),g.lineTo(A,S+r)):(g.moveTo(A,0),g.lineTo(v,0),g.lineTo(v,z),g.lineTo(A,+z),g.lineTo(A,S+r),g.lineTo(0,S+r),g.lineTo(0,S),g.lineTo(A,S),g.lineTo(A,ea+r),g.lineTo(0,ea+r),g.lineTo(0,ea),g.lineTo(A,ea),g.close());g.end()};mxCellRenderer.registerShape("component",La);mxUtils.extend(Da,mxRectangleShape);Da.prototype.paintForeground=function(g,r,A,v,z){var F=v/2,I=z/2,ea=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;g.begin();this.addPoints(g,[new mxPoint(r+F,A),new mxPoint(r+v,A+I),new mxPoint(r+F,A+z),new mxPoint(r,A+I)],this.isRounded,+ea,!0);g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",Da);mxUtils.extend(Sa,mxDoubleEllipse);Sa.prototype.outerStroke=!0;Sa.prototype.paintVertexShape=function(g,r,A,v,z){var F=Math.min(4,Math.min(v/5,z/5));0<v&&0<z&&(g.ellipse(r+F,A+F,v-2*F,z-2*F),g.fillAndStroke());g.setShadow(!1);this.outerStroke&&(g.ellipse(r,A,v,z),g.stroke())};mxCellRenderer.registerShape("endState",Sa);mxUtils.extend(Oa,Sa);Oa.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",Oa);mxUtils.extend(Ta,mxArrowConnector);Ta.prototype.defaultWidth=4;Ta.prototype.isOpenEnded=function(){return!0};Ta.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};Ta.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",Ta);mxUtils.extend(Ua,mxArrowConnector);Ua.prototype.defaultWidth=10;Ua.prototype.defaultArrowWidth=20;Ua.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};Ua.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Ua.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",Ua);mxUtils.extend(Ba,mxActor);Ba.prototype.size=30;Ba.prototype.isRoundable=function(){return!0};-Ba.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)?(g=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(0,g,0,0)):null};Ba.prototype.redrawPath=function(g,r,A,u,z){r=Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,z),new mxPoint(0,r),new mxPoint(u,0),new mxPoint(u,z)],this.isRounded,A,-!0);g.end()};mxCellRenderer.registerShape("manualInput",Ba);mxUtils.extend(Ka,mxRectangleShape);Ka.prototype.dx=20;Ka.prototype.dy=20;Ka.prototype.isHtmlAllowed=function(){return!1};Ka.prototype.paintForeground=function(g,r,A,u,z){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var F=0;if(this.isRounded){var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;F=Math.max(F,Math.min(u*I,z*I))}I=Math.max(F,Math.min(u,parseFloat(mxUtils.getValue(this.style,-"dx",this.dx))));F=Math.max(F,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.begin();g.moveTo(r,A+F);g.lineTo(r+u,A+F);g.end();g.stroke();g.begin();g.moveTo(r+I,A);g.lineTo(r+I,A+z);g.end();g.stroke()};mxCellRenderer.registerShape("internalStorage",Ka);mxUtils.extend(ab,mxActor);ab.prototype.dx=20;ab.prototype.dy=20;ab.prototype.isRoundable=function(){return!0};ab.prototype.redrawPath=function(g,r,A,u,z){r=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));-A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,A),new mxPoint(r,A),new mxPoint(r,z),new mxPoint(0,z)],this.isRounded,F,!0);g.end()};mxCellRenderer.registerShape("corner",ab);mxUtils.extend(Qa,mxActor);Qa.prototype.redrawPath=function(g,r,A,u,z){g.moveTo(0,-0);g.lineTo(0,z);g.end();g.moveTo(u,0);g.lineTo(u,z);g.end();g.moveTo(0,z/2);g.lineTo(u,z/2);g.end()};mxCellRenderer.registerShape("crossbar",Qa);mxUtils.extend(db,mxActor);db.prototype.dx=20;db.prototype.dy=20;db.prototype.isRoundable=function(){return!0};db.prototype.redrawPath=function(g,r,A,u,z){r=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",-this.size));var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,A),new mxPoint((u+r)/2,A),new mxPoint((u+r)/2,z),new mxPoint((u-r)/2,z),new mxPoint((u-r)/2,A),new mxPoint(0,A)],this.isRounded,F,!0);g.end()};mxCellRenderer.registerShape("tee",db);mxUtils.extend(Va,mxActor);Va.prototype.arrowWidth=.3;Va.prototype.arrowSize=.2;Va.prototype.isRoundable=function(){return!0};Va.prototype.redrawPath=function(g,-r,A,u,z){var F=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));r=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));A=(z-F)/2;F=A+F;var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,A),new mxPoint(u-r,A),new mxPoint(u-r,0),new mxPoint(u,z/2),new mxPoint(u-r,z),new mxPoint(u-r,F),new mxPoint(0,F)],this.isRounded,I,!0);g.end()};mxCellRenderer.registerShape("singleArrow",-Va);mxUtils.extend(nb,mxActor);nb.prototype.isRoundable=function(){return!0};nb.prototype.redrawPath=function(g,r,A,u,z){var F=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Va.prototype.arrowWidth))));r=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Va.prototype.arrowSize))));A=(z-F)/2;F=A+F;var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,z/2),new mxPoint(r,0),new mxPoint(r,-A),new mxPoint(u-r,A),new mxPoint(u-r,0),new mxPoint(u,z/2),new mxPoint(u-r,z),new mxPoint(u-r,F),new mxPoint(r,F),new mxPoint(r,z)],this.isRounded,I,!0);g.end()};mxCellRenderer.registerShape("doubleArrow",nb);mxUtils.extend(bb,mxActor);bb.prototype.size=.1;bb.prototype.fixedSize=20;bb.prototype.redrawPath=function(g,r,A,u,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,-"size",this.size))));g.moveTo(r,0);g.lineTo(u,0);g.quadTo(u-2*r,z/2,u,z);g.lineTo(r,z);g.quadTo(r-2*r,z/2,r,0);g.close();g.end()};mxCellRenderer.registerShape("dataStorage",bb);mxUtils.extend(ya,mxActor);ya.prototype.redrawPath=function(g,r,A,u,z){g.moveTo(0,0);g.quadTo(u,0,u,z/2);g.quadTo(u,z,0,z);g.close();g.end()};mxCellRenderer.registerShape("or",ya);mxUtils.extend(Ra,mxActor);Ra.prototype.redrawPath=function(g,r,A,u,z){g.moveTo(0,0);g.quadTo(u,0,u,z/2);g.quadTo(u,z,0,z);g.quadTo(u/2,z/2,0,0);-g.close();g.end()};mxCellRenderer.registerShape("xor",Ra);mxUtils.extend(Ya,mxActor);Ya.prototype.size=20;Ya.prototype.isRoundable=function(){return!0};Ya.prototype.redrawPath=function(g,r,A,u,z){r=Math.min(u/2,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,0),new mxPoint(u-r,0),new mxPoint(u,.8*r),new mxPoint(u,z),new mxPoint(0,z),new mxPoint(0,.8*r)],this.isRounded,-A,!0);g.end()};mxCellRenderer.registerShape("loopLimit",Ya);mxUtils.extend(lb,mxActor);lb.prototype.size=.375;lb.prototype.isRoundable=function(){return!0};lb.prototype.redrawPath=function(g,r,A,u,z){r=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,z-r),new mxPoint(u/2,z),new mxPoint(0,z-r)],this.isRounded,A,!0);-g.end()};mxCellRenderer.registerShape("offPageConnector",lb);mxUtils.extend(ub,mxEllipse);ub.prototype.paintVertexShape=function(g,r,A,u,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.begin();g.moveTo(r+u/2,A+z);g.lineTo(r+u,A+z);g.end();g.stroke()};mxCellRenderer.registerShape("tapeData",ub);mxUtils.extend(gb,mxEllipse);gb.prototype.paintVertexShape=function(g,r,A,u,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r,A+z/2);g.lineTo(r+-u,A+z/2);g.end();g.stroke();g.begin();g.moveTo(r+u/2,A);g.lineTo(r+u/2,A+z);g.end();g.stroke()};mxCellRenderer.registerShape("orEllipse",gb);mxUtils.extend(jb,mxEllipse);jb.prototype.paintVertexShape=function(g,r,A,u,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r+.145*u,A+.145*z);g.lineTo(r+.855*u,A+.855*z);g.end();g.stroke();g.begin();g.moveTo(r+.855*u,A+.145*z);g.lineTo(r+.145*u,A+.855*z);g.end();g.stroke()};mxCellRenderer.registerShape("sumEllipse",-jb);mxUtils.extend(yb,mxRhombus);yb.prototype.paintVertexShape=function(g,r,A,u,z){mxRhombus.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r,A+z/2);g.lineTo(r+u,A+z/2);g.end();g.stroke()};mxCellRenderer.registerShape("sortShape",yb);mxUtils.extend(Bb,mxEllipse);Bb.prototype.paintVertexShape=function(g,r,A,u,z){g.begin();g.moveTo(r,A);g.lineTo(r+u,A);g.lineTo(r+u/2,A+z/2);g.close();g.fillAndStroke();g.begin();g.moveTo(r,A+z);g.lineTo(r+u,A+z);g.lineTo(r+u/2,A+-z/2);g.close();g.fillAndStroke()};mxCellRenderer.registerShape("collate",Bb);mxUtils.extend(Cb,mxEllipse);Cb.prototype.paintVertexShape=function(g,r,A,u,z){var F=g.state.strokeWidth/2,I=10+2*F,ea=A+z-I/2;g.begin();g.moveTo(r,A);g.lineTo(r,A+z);g.moveTo(r+F,ea);g.lineTo(r+F+I,ea-I/2);g.moveTo(r+F,ea);g.lineTo(r+F+I,ea+I/2);g.moveTo(r+F,ea);g.lineTo(r+u-F,ea);g.moveTo(r+u,A);g.lineTo(r+u,A+z);g.moveTo(r+u-F,ea);g.lineTo(r+u-I-F,ea-I/2);g.moveTo(r+u-F,ea);g.lineTo(r+u-I-F,ea+I/2);g.end();g.stroke()};-mxCellRenderer.registerShape("dimension",Cb);mxUtils.extend(Kb,mxEllipse);Kb.prototype.drawHidden=!0;Kb.prototype.paintVertexShape=function(g,r,A,u,z){this.outline||g.setStrokeColor(null);if(null!=this.style){var F=g.pointerEvents,I=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||I||(g.pointerEvents=!1);var ea="1"==mxUtils.getValue(this.style,"top","1"),S="1"==mxUtils.getValue(this.style,"left","1"),ta="1"==mxUtils.getValue(this.style,-"right","1"),oa="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||I||this.outline||ea||ta||oa||S?(g.rect(r,A,u,z),g.fill(),g.pointerEvents=F,g.setStrokeColor(this.stroke),g.setLineCap("square"),g.begin(),g.moveTo(r,A),this.outline||ea?g.lineTo(r+u,A):g.moveTo(r+u,A),this.outline||ta?g.lineTo(r+u,A+z):g.moveTo(r+u,A+z),this.outline||oa?g.lineTo(r,A+z):g.moveTo(r,A+z),(this.outline||S)&&g.lineTo(r,A),g.end(),g.stroke(),g.setLineCap("flat")):g.setStrokeColor(this.stroke)}null==this.state||-this.outline||null==this.fill||this.fill==mxConstants.NONE||(F=this.state.view.graph,null!=F.paintTableCellLines&&F.paintTableCellLines(g,this.state.cell,r,A,u,z,this.stroke,this.strokewidth))};mxCellRenderer.registerShape("partialRectangle",Kb);mxUtils.extend(Xb,mxEllipse);Xb.prototype.paintVertexShape=function(g,r,A,u,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();"vertical"==mxUtils.getValue(this.style,"line")?(g.moveTo(r+u/2,A),g.lineTo(r+u/2,A+z)):(g.moveTo(r,-A+z/2),g.lineTo(r+u,A+z/2));g.end();g.stroke()};mxCellRenderer.registerShape("lineEllipse",Xb);mxUtils.extend(Ob,mxActor);Ob.prototype.redrawPath=function(g,r,A,u,z){r=Math.min(u,z/2);g.moveTo(0,0);g.lineTo(u-r,0);g.quadTo(u,0,u,z/2);g.quadTo(u,z,u-r,z);g.lineTo(0,z);g.close();g.end()};mxCellRenderer.registerShape("delay",Ob);mxUtils.extend(Ub,mxActor);Ub.prototype.size=.2;Ub.prototype.redrawPath=function(g,r,A,u,z){r=Math.min(z,u);var F=Math.max(0,Math.min(r,r*parseFloat(mxUtils.getValue(this.style,-"size",this.size))));r=(z-F)/2;A=r+F;var I=(u-F)/2;F=I+F;g.moveTo(0,r);g.lineTo(I,r);g.lineTo(I,0);g.lineTo(F,0);g.lineTo(F,r);g.lineTo(u,r);g.lineTo(u,A);g.lineTo(F,A);g.lineTo(F,z);g.lineTo(I,z);g.lineTo(I,A);g.lineTo(0,A);g.close();g.end()};mxCellRenderer.registerShape("cross",Ub);mxUtils.extend(Qb,mxActor);Qb.prototype.size=.25;Qb.prototype.redrawPath=function(g,r,A,u,z){r=Math.min(u,z/2);A=Math.min(u-r,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*u);g.moveTo(0,z/2);g.lineTo(A,-0);g.lineTo(u-r,0);g.quadTo(u,0,u,z/2);g.quadTo(u,z,u-r,z);g.lineTo(A,z);g.close();g.end()};mxCellRenderer.registerShape("display",Qb);mxUtils.extend(xb,mxActor);xb.prototype.cst={RECT2:"mxgraph.basic.rect"};xb.prototype.customProperties=[{name:"rectStyle",dispName:"Style",type:"enum",defVal:"square",enumList:[{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"size",dispName:"Corner Size",+Ba.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)?(g=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(0,g,0,0)):null};Ba.prototype.redrawPath=function(g,r,A,v,z){r=Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,z),new mxPoint(0,r),new mxPoint(v,0),new mxPoint(v,z)],this.isRounded,A,+!0);g.end()};mxCellRenderer.registerShape("manualInput",Ba);mxUtils.extend(Ka,mxRectangleShape);Ka.prototype.dx=20;Ka.prototype.dy=20;Ka.prototype.isHtmlAllowed=function(){return!1};Ka.prototype.paintForeground=function(g,r,A,v,z){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var F=0;if(this.isRounded){var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;F=Math.max(F,Math.min(v*I,z*I))}I=Math.max(F,Math.min(v,parseFloat(mxUtils.getValue(this.style,+"dx",this.dx))));F=Math.max(F,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.begin();g.moveTo(r,A+F);g.lineTo(r+v,A+F);g.end();g.stroke();g.begin();g.moveTo(r+I,A);g.lineTo(r+I,A+z);g.end();g.stroke()};mxCellRenderer.registerShape("internalStorage",Ka);mxUtils.extend(ab,mxActor);ab.prototype.dx=20;ab.prototype.dy=20;ab.prototype.isRoundable=function(){return!0};ab.prototype.redrawPath=function(g,r,A,v,z){r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));+A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,A),new mxPoint(r,A),new mxPoint(r,z),new mxPoint(0,z)],this.isRounded,F,!0);g.end()};mxCellRenderer.registerShape("corner",ab);mxUtils.extend(Qa,mxActor);Qa.prototype.redrawPath=function(g,r,A,v,z){g.moveTo(0,+0);g.lineTo(0,z);g.end();g.moveTo(v,0);g.lineTo(v,z);g.end();g.moveTo(0,z/2);g.lineTo(v,z/2);g.end()};mxCellRenderer.registerShape("crossbar",Qa);mxUtils.extend(db,mxActor);db.prototype.dx=20;db.prototype.dy=20;db.prototype.isRoundable=function(){return!0};db.prototype.redrawPath=function(g,r,A,v,z){r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",+this.size));var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,A),new mxPoint((v+r)/2,A),new mxPoint((v+r)/2,z),new mxPoint((v-r)/2,z),new mxPoint((v-r)/2,A),new mxPoint(0,A)],this.isRounded,F,!0);g.end()};mxCellRenderer.registerShape("tee",db);mxUtils.extend(Va,mxActor);Va.prototype.arrowWidth=.3;Va.prototype.arrowSize=.2;Va.prototype.isRoundable=function(){return!0};Va.prototype.redrawPath=function(g,+r,A,v,z){var F=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));r=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));A=(z-F)/2;F=A+F;var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,A),new mxPoint(v-r,A),new mxPoint(v-r,0),new mxPoint(v,z/2),new mxPoint(v-r,z),new mxPoint(v-r,F),new mxPoint(0,F)],this.isRounded,I,!0);g.end()};mxCellRenderer.registerShape("singleArrow",+Va);mxUtils.extend(nb,mxActor);nb.prototype.isRoundable=function(){return!0};nb.prototype.redrawPath=function(g,r,A,v,z){var F=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Va.prototype.arrowWidth))));r=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Va.prototype.arrowSize))));A=(z-F)/2;F=A+F;var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,z/2),new mxPoint(r,0),new mxPoint(r,+A),new mxPoint(v-r,A),new mxPoint(v-r,0),new mxPoint(v,z/2),new mxPoint(v-r,z),new mxPoint(v-r,F),new mxPoint(r,F),new mxPoint(r,z)],this.isRounded,I,!0);g.end()};mxCellRenderer.registerShape("doubleArrow",nb);mxUtils.extend(bb,mxActor);bb.prototype.size=.1;bb.prototype.fixedSize=20;bb.prototype.redrawPath=function(g,r,A,v,z){r="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,+"size",this.size))));g.moveTo(r,0);g.lineTo(v,0);g.quadTo(v-2*r,z/2,v,z);g.lineTo(r,z);g.quadTo(r-2*r,z/2,r,0);g.close();g.end()};mxCellRenderer.registerShape("dataStorage",bb);mxUtils.extend(ya,mxActor);ya.prototype.redrawPath=function(g,r,A,v,z){g.moveTo(0,0);g.quadTo(v,0,v,z/2);g.quadTo(v,z,0,z);g.close();g.end()};mxCellRenderer.registerShape("or",ya);mxUtils.extend(Ra,mxActor);Ra.prototype.redrawPath=function(g,r,A,v,z){g.moveTo(0,0);g.quadTo(v,0,v,z/2);g.quadTo(v,z,0,z);g.quadTo(v/2,z/2,0,0);+g.close();g.end()};mxCellRenderer.registerShape("xor",Ra);mxUtils.extend(Ya,mxActor);Ya.prototype.size=20;Ya.prototype.isRoundable=function(){return!0};Ya.prototype.redrawPath=function(g,r,A,v,z){r=Math.min(v/2,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,0),new mxPoint(v-r,0),new mxPoint(v,.8*r),new mxPoint(v,z),new mxPoint(0,z),new mxPoint(0,.8*r)],this.isRounded,+A,!0);g.end()};mxCellRenderer.registerShape("loopLimit",Ya);mxUtils.extend(lb,mxActor);lb.prototype.size=.375;lb.prototype.isRoundable=function(){return!0};lb.prototype.redrawPath=function(g,r,A,v,z){r=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(v,0),new mxPoint(v,z-r),new mxPoint(v/2,z),new mxPoint(0,z-r)],this.isRounded,A,!0);+g.end()};mxCellRenderer.registerShape("offPageConnector",lb);mxUtils.extend(ub,mxEllipse);ub.prototype.paintVertexShape=function(g,r,A,v,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.begin();g.moveTo(r+v/2,A+z);g.lineTo(r+v,A+z);g.end();g.stroke()};mxCellRenderer.registerShape("tapeData",ub);mxUtils.extend(gb,mxEllipse);gb.prototype.paintVertexShape=function(g,r,A,v,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r,A+z/2);g.lineTo(r++v,A+z/2);g.end();g.stroke();g.begin();g.moveTo(r+v/2,A);g.lineTo(r+v/2,A+z);g.end();g.stroke()};mxCellRenderer.registerShape("orEllipse",gb);mxUtils.extend(jb,mxEllipse);jb.prototype.paintVertexShape=function(g,r,A,v,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r+.145*v,A+.145*z);g.lineTo(r+.855*v,A+.855*z);g.end();g.stroke();g.begin();g.moveTo(r+.855*v,A+.145*z);g.lineTo(r+.145*v,A+.855*z);g.end();g.stroke()};mxCellRenderer.registerShape("sumEllipse",+jb);mxUtils.extend(yb,mxRhombus);yb.prototype.paintVertexShape=function(g,r,A,v,z){mxRhombus.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r,A+z/2);g.lineTo(r+v,A+z/2);g.end();g.stroke()};mxCellRenderer.registerShape("sortShape",yb);mxUtils.extend(Bb,mxEllipse);Bb.prototype.paintVertexShape=function(g,r,A,v,z){g.begin();g.moveTo(r,A);g.lineTo(r+v,A);g.lineTo(r+v/2,A+z/2);g.close();g.fillAndStroke();g.begin();g.moveTo(r,A+z);g.lineTo(r+v,A+z);g.lineTo(r+v/2,A++z/2);g.close();g.fillAndStroke()};mxCellRenderer.registerShape("collate",Bb);mxUtils.extend(Cb,mxEllipse);Cb.prototype.paintVertexShape=function(g,r,A,v,z){var F=g.state.strokeWidth/2,I=10+2*F,ea=A+z-I/2;g.begin();g.moveTo(r,A);g.lineTo(r,A+z);g.moveTo(r+F,ea);g.lineTo(r+F+I,ea-I/2);g.moveTo(r+F,ea);g.lineTo(r+F+I,ea+I/2);g.moveTo(r+F,ea);g.lineTo(r+v-F,ea);g.moveTo(r+v,A);g.lineTo(r+v,A+z);g.moveTo(r+v-F,ea);g.lineTo(r+v-I-F,ea-I/2);g.moveTo(r+v-F,ea);g.lineTo(r+v-I-F,ea+I/2);g.end();g.stroke()};+mxCellRenderer.registerShape("dimension",Cb);mxUtils.extend(Kb,mxEllipse);Kb.prototype.drawHidden=!0;Kb.prototype.paintVertexShape=function(g,r,A,v,z){this.outline||g.setStrokeColor(null);if(null!=this.style){var F=g.pointerEvents,I=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||I||(g.pointerEvents=!1);var ea="1"==mxUtils.getValue(this.style,"top","1"),S="1"==mxUtils.getValue(this.style,"left","1"),ta="1"==mxUtils.getValue(this.style,+"right","1"),oa="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||I||this.outline||ea||ta||oa||S?(g.rect(r,A,v,z),g.fill(),g.pointerEvents=F,g.setStrokeColor(this.stroke),g.setLineCap("square"),g.begin(),g.moveTo(r,A),this.outline||ea?g.lineTo(r+v,A):g.moveTo(r+v,A),this.outline||ta?g.lineTo(r+v,A+z):g.moveTo(r+v,A+z),this.outline||oa?g.lineTo(r,A+z):g.moveTo(r,A+z),(this.outline||S)&&g.lineTo(r,A),g.end(),g.stroke(),g.setLineCap("flat")):g.setStrokeColor(this.stroke)}null==this.state||+this.outline||null==this.fill||this.fill==mxConstants.NONE||(F=this.state.view.graph,null!=F.paintTableCellLines&&F.paintTableCellLines(g,this.state.cell,r,A,v,z,this.stroke,this.strokewidth))};mxCellRenderer.registerShape("partialRectangle",Kb);mxUtils.extend(Xb,mxEllipse);Xb.prototype.paintVertexShape=function(g,r,A,v,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();"vertical"==mxUtils.getValue(this.style,"line")?(g.moveTo(r+v/2,A),g.lineTo(r+v/2,A+z)):(g.moveTo(r,+A+z/2),g.lineTo(r+v,A+z/2));g.end();g.stroke()};mxCellRenderer.registerShape("lineEllipse",Xb);mxUtils.extend(Ob,mxActor);Ob.prototype.redrawPath=function(g,r,A,v,z){r=Math.min(v,z/2);g.moveTo(0,0);g.lineTo(v-r,0);g.quadTo(v,0,v,z/2);g.quadTo(v,z,v-r,z);g.lineTo(0,z);g.close();g.end()};mxCellRenderer.registerShape("delay",Ob);mxUtils.extend(Ub,mxActor);Ub.prototype.size=.2;Ub.prototype.redrawPath=function(g,r,A,v,z){r=Math.min(z,v);var F=Math.max(0,Math.min(r,r*parseFloat(mxUtils.getValue(this.style,+"size",this.size))));r=(z-F)/2;A=r+F;var I=(v-F)/2;F=I+F;g.moveTo(0,r);g.lineTo(I,r);g.lineTo(I,0);g.lineTo(F,0);g.lineTo(F,r);g.lineTo(v,r);g.lineTo(v,A);g.lineTo(F,A);g.lineTo(F,z);g.lineTo(I,z);g.lineTo(I,A);g.lineTo(0,A);g.close();g.end()};mxCellRenderer.registerShape("cross",Ub);mxUtils.extend(Qb,mxActor);Qb.prototype.size=.25;Qb.prototype.redrawPath=function(g,r,A,v,z){r=Math.min(v,z/2);A=Math.min(v-r,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*v);g.moveTo(0,z/2);g.lineTo(A,+0);g.lineTo(v-r,0);g.quadTo(v,0,v,z/2);g.quadTo(v,z,v-r,z);g.lineTo(A,z);g.close();g.end()};mxCellRenderer.registerShape("display",Qb);mxUtils.extend(xb,mxActor);xb.prototype.cst={RECT2:"mxgraph.basic.rect"};xb.prototype.customProperties=[{name:"rectStyle",dispName:"Style",type:"enum",defVal:"square",enumList:[{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"size",dispName:"Corner Size",type:"float",defVal:10},{name:"absoluteCornerSize",dispName:"Abs. Corner Size",type:"bool",defVal:!0},{name:"indent",dispName:"Indent",type:"float",defVal:2},{name:"rectOutline",dispName:"Outline",type:"enum",defVal:"single",enumList:[{val:"single",dispName:"Single"},{val:"double",dispName:"Double"},{val:"frame",dispName:"Frame"}]},{name:"fillColor2",dispName:"Inside Fill Color",type:"color",defVal:"none"},{name:"gradientColor2",dispName:"Inside Gradient Color",type:"color",defVal:"none"},{name:"gradientDirection2",dispName:"Inside Gradient Direction",type:"enum",defVal:"south",enumList:[{val:"south",dispName:"South"},{val:"west",dispName:"West"},{val:"north",dispName:"North"},{val:"east",dispName:"East"}]},{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"right",dispName:"Right",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left ",type:"bool",defVal:!0},{name:"topLeftStyle",dispName:"Top Left Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"topRightStyle",dispName:"Top Right Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomRightStyle",dispName:"Bottom Right Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomLeftStyle",dispName:"Bottom Left Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",-dispName:"Fold"}]}];xb.prototype.paintVertexShape=function(g,r,A,u,z){g.translate(r,A);this.strictDrawShape(g,0,0,u,z)};xb.prototype.strictDrawShape=function(g,r,A,u,z,F){var I=F&&F.rectStyle?F.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),ea=F&&F.absoluteCornerSize?F.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",this.absoluteCornerSize),S=F&&F.size?F.size:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),ta=F&&F.rectOutline?-F.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),oa=F&&F.indent?F.indent:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Ia=F&&F.dashed?F.dashed:mxUtils.getValue(this.style,"dashed",!1),mb=F&&F.dashPattern?F.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),$a=F&&F.relIndent?F.relIndent:Math.max(0,Math.min(50,oa)),Ea=F&&F.top?F.top:mxUtils.getValue(this.style,"top",!0),Ga=F&&F.right?F.right:mxUtils.getValue(this.style,"right",+dispName:"Fold"}]}];xb.prototype.paintVertexShape=function(g,r,A,v,z){g.translate(r,A);this.strictDrawShape(g,0,0,v,z)};xb.prototype.strictDrawShape=function(g,r,A,v,z,F){var I=F&&F.rectStyle?F.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),ea=F&&F.absoluteCornerSize?F.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",this.absoluteCornerSize),S=F&&F.size?F.size:Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),ta=F&&F.rectOutline?+F.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),oa=F&&F.indent?F.indent:Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Ia=F&&F.dashed?F.dashed:mxUtils.getValue(this.style,"dashed",!1),mb=F&&F.dashPattern?F.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),$a=F&&F.relIndent?F.relIndent:Math.max(0,Math.min(50,oa)),Ea=F&&F.top?F.top:mxUtils.getValue(this.style,"top",!0),Ga=F&&F.right?F.right:mxUtils.getValue(this.style,"right",!0),Ja=F&&F.bottom?F.bottom:mxUtils.getValue(this.style,"bottom",!0),Pa=F&&F.left?F.left:mxUtils.getValue(this.style,"left",!0),eb=F&&F.topLeftStyle?F.topLeftStyle:mxUtils.getValue(this.style,"topLeftStyle","default"),hb=F&&F.topRightStyle?F.topRightStyle:mxUtils.getValue(this.style,"topRightStyle","default"),ib=F&&F.bottomRightStyle?F.bottomRightStyle:mxUtils.getValue(this.style,"bottomRightStyle","default"),kb=F&&F.bottomLeftStyle?F.bottomLeftStyle:mxUtils.getValue(this.style,"bottomLeftStyle","default"),dc=F&&F.fillColor?F.fillColor:mxUtils.getValue(this.style,"fillColor","#ffffff");F&&F.strokeColor||mxUtils.getValue(this.style,"strokeColor","#000000");var ec=F&&F.strokeWidth?F.strokeWidth:mxUtils.getValue(this.style,"strokeWidth","1"),cc=F&&F.fillColor2?F.fillColor2:mxUtils.getValue(this.style,"fillColor2","none"),fc=F&&F.gradientColor2?F.gradientColor2:mxUtils.getValue(this.style,"gradientColor2","none"),gc=F&&F.gradientDirection2?F.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2",-"south"),hc=F&&F.opacity?F.opacity:mxUtils.getValue(this.style,"opacity","100"),ic=Math.max(0,Math.min(50,S));F=xb.prototype;g.setDashed(Ia);mb&&""!=mb&&g.setDashPattern(mb);g.setStrokeWidth(ec);S=Math.min(.5*z,.5*u,S);ea||(S=ic*Math.min(u,z)/100);S=Math.min(S,.5*Math.min(u,z));ea||(oa=Math.min($a*Math.min(u,z)/100));oa=Math.min(oa,.5*Math.min(u,z)-S);(Ea||Ga||Ja||Pa)&&"frame"!=ta&&(g.begin(),Ea?F.moveNW(g,r,A,u,z,I,eb,S,Pa):g.moveTo(0,0),Ea&&F.paintNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,-hb,S,Ga),Ga&&F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),Ja&&F.paintSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),Pa&&F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),g.close(),g.fill(),g.setShadow(!1),g.setFillColor(cc),Ia=ea=hc,"none"==cc&&(ea=0),"none"==fc&&(Ia=0),g.setGradient(cc,fc,0,0,u,z,gc,ea,Ia),g.begin(),Ea?F.moveNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa):g.moveTo(oa,0),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),Pa&&Ja&&F.paintSWInner(g,r,A,u,z,-I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),Ja&&Ga&&F.paintSEInner(g,r,A,u,z,I,ib,S,oa),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),Ga&&Ea&&F.paintNEInner(g,r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),Ea&&Pa&&F.paintNWInner(g,r,A,u,z,I,eb,S,oa),g.fill(),"none"==dc&&(g.begin(),F.paintFolds(g,r,A,u,z,I,eb,hb,ib,kb,S,Ea,Ga,Ja,Pa),g.stroke()));Ea||Ga||Ja||!Pa?Ea||Ga||!Ja||Pa?!Ea&&!Ga&&Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,-z,I,kb,S,Pa),F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),"double"==ta&&(F.moveNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,u,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja)),g.stroke()):(g.begin(),F.moveSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.lineNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,-r,A,u,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),g.close(),g.fillAndStroke()):Ea||!Ga||Ja||Pa?!Ea&&Ga&&!Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSW(g,r,A,u,z,I,eb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),"double"==ta&&(F.moveNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa)),g.stroke(),g.begin(),F.moveNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),"double"==ta&&(F.moveSEInner(g,r,A,u,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga)),-g.stroke()):(g.begin(),F.moveSW(g,r,A,u,z,I,eb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.lineNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),g.close(),g.fillAndStroke(),g.begin(),F.moveNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.lineSEInner(g,r,A,u,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),g.close(),g.fillAndStroke()):!Ea&&Ga&&Ja&&!Pa?"frame"!=ta?(g.begin(),F.moveNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.paintSE(g,-r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),"double"==ta&&(F.moveSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,u,z,I,ib,S,oa),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga)),g.stroke()):(g.begin(),F.moveNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.paintSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.lineSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,u,z,I,ib,-S,oa),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),g.close(),g.fillAndStroke()):!Ea&&Ga&&Ja&&Pa?"frame"!=ta?(g.begin(),F.moveNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.paintSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),"double"==ta&&(F.moveNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,u,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,-r,A,u,z,I,ib,S,oa),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga)),g.stroke()):(g.begin(),F.moveNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.paintSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.lineNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,u,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,u,z,I,ib,S,oa),F.paintRightInner(g,-r,A,u,z,I,hb,S,oa,Ea,Ga),g.close(),g.fillAndStroke()):!Ea||Ga||Ja||Pa?Ea&&!Ga&&!Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.paintNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),"double"==ta&&(F.moveNEInner(g,r,A,u,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,u,z,I,eb,S,oa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa)),g.stroke()):(g.begin(),F.moveSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.paintNW(g,-r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.lineNEInner(g,r,A,u,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,u,z,I,eb,S,oa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),g.close(),g.fillAndStroke()):Ea&&!Ga&&Ja&&!Pa?"frame"!=ta?(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),"double"==ta&&(F.moveNEInner(g,r,A,u,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea)),g.stroke(),g.begin(),F.moveSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,-r,A,u,z,I,kb,S,Pa),"double"==ta&&(F.moveSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja)),g.stroke()):(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.lineNEInner(g,r,A,u,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),g.close(),g.fillAndStroke(),g.begin(),F.moveSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.lineSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),g.close(),g.fillAndStroke()):-Ea&&!Ga&&Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.paintNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),"double"==ta&&(F.moveNEInner(g,r,A,u,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,u,z,I,eb,S,oa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,u,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja)),g.stroke()):-(g.begin(),F.moveSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.paintNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.lineNEInner(g,r,A,u,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,u,z,I,eb,S,oa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,u,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),g.close(),g.fillAndStroke()):Ea&&Ga&&!Ja&&!Pa?"frame"!=-ta?(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),"double"==ta&&(F.moveSEInner(g,r,A,u,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea)),g.stroke()):(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.lineSEInner(g,r,A,u,z,I,ib,S,oa,-Ja),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),g.close(),g.fillAndStroke()):Ea&&Ga&&!Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.paintNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),"double"==ta&&(F.moveSEInner(g,r,A,u,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,-r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,u,z,I,eb,S,oa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa)),g.stroke()):(g.begin(),F.moveSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.paintNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.lineSEInner(g,r,A,u,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,-I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,u,z,I,eb,S,oa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),g.close(),g.fillAndStroke()):Ea&&Ga&&Ja&&!Pa?"frame"!=ta?(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.paintSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),"double"==ta&&(F.moveSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,u,z,I,ib,S,oa),F.paintRightInner(g,-r,A,u,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea)),g.stroke()):(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.paintSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.lineSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,u,z,I,ib,S,oa),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,-r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),g.close(),g.fillAndStroke()):Ea&&Ga&&Ja&&Pa&&("frame"!=ta?(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.paintSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),g.close(),"double"==ta&&(F.moveSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintSWInner(g,r,-A,u,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,u,z,I,ib,S,oa),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,u,z,I,eb,S,oa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),g.close()),g.stroke()):(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.paintNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.paintSE(g,-r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.paintSW(g,r,A,u,z,I,kb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),g.close(),F.moveSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintSWInner(g,r,A,u,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,u,z,I,ib,S,oa),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,u,z,I,hb,S,oa),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,u,z,I,eb,S,oa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa),g.close(),-g.fillAndStroke())):"frame"!=ta?(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),"double"==ta&&(F.moveNEInner(g,r,A,u,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea)),g.stroke()):(g.begin(),F.moveNW(g,r,A,u,z,I,eb,S,Pa),F.paintTop(g,r,A,u,z,I,hb,S,Ga),F.lineNEInner(g,r,A,u,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,u,z,I,eb,S,oa,Pa,Ea),g.close(),g.fillAndStroke()):"frame"!=ta?(g.begin(),F.moveNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),"double"==ta&&(F.moveSEInner(g,-r,A,u,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga)),g.stroke()):(g.begin(),F.moveNE(g,r,A,u,z,I,hb,S,Ea),F.paintRight(g,r,A,u,z,I,ib,S,Ja),F.lineSEInner(g,r,A,u,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,u,z,I,hb,S,oa,Ea,Ga),g.close(),g.fillAndStroke()):"frame"!=ta?(g.begin(),F.moveSE(g,r,A,u,z,I,ib,S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),"double"==ta&&(F.moveSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja)),g.stroke()):(g.begin(),F.moveSE(g,r,A,u,z,I,ib,-S,Ga),F.paintBottom(g,r,A,u,z,I,kb,S,Pa),F.lineSWInner(g,r,A,u,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,u,z,I,ib,S,oa,Ga,Ja),g.close(),g.fillAndStroke()):"frame"!=ta?(g.begin(),F.moveSW(g,r,A,u,z,I,eb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),"double"==ta&&(F.moveNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,u,z,I,kb,S,oa,Ja,Pa)),g.stroke()):(g.begin(),F.moveSW(g,r,A,u,z,I,eb,S,Ja),F.paintLeft(g,r,A,u,z,I,eb,S,Ea),F.lineNWInner(g,r,A,u,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,u,z,I,kb,S,-oa,Ja,Pa),g.close(),g.fillAndStroke());g.begin();F.paintFolds(g,r,A,u,z,I,eb,hb,ib,kb,S,Ea,Ga,Ja,Pa);g.stroke()};xb.prototype.moveNW=function(g,r,A,u,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.moveTo(0,0):g.moveTo(0,ea)};xb.prototype.moveNE=function(g,r,A,u,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.moveTo(u,0):g.moveTo(u-ea,0)};xb.prototype.moveSE=function(g,r,A,u,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.moveTo(u,z):g.moveTo(u,z-ea)};xb.prototype.moveSW=-function(g,r,A,u,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.moveTo(0,z):g.moveTo(ea,z)};xb.prototype.paintNW=function(g,r,A,u,z,F,I,ea,S){if(S)if("rounded"==I||"default"==I&&"rounded"==F||"invRound"==I||"default"==I&&"invRound"==F){r=0;if("rounded"==I||"default"==I&&"rounded"==F)r=1;g.arcTo(ea,ea,0,0,r,ea,0)}else("snip"==I||"default"==I&&"snip"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(ea,0);else g.lineTo(0,0)};xb.prototype.paintTop=function(g,r,A,u,z,F,I,ea,S){"square"==I||-"default"==I&&"square"==F||!S?g.lineTo(u,0):g.lineTo(u-ea,0)};xb.prototype.paintNE=function(g,r,A,u,z,F,I,ea,S){if(S)if("rounded"==I||"default"==I&&"rounded"==F||"invRound"==I||"default"==I&&"invRound"==F){r=0;if("rounded"==I||"default"==I&&"rounded"==F)r=1;g.arcTo(ea,ea,0,0,r,u,ea)}else("snip"==I||"default"==I&&"snip"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(u,ea);else g.lineTo(u,0)};xb.prototype.paintRight=function(g,r,A,u,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.lineTo(u,-z):g.lineTo(u,z-ea)};xb.prototype.paintLeft=function(g,r,A,u,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.lineTo(0,0):g.lineTo(0,ea)};xb.prototype.paintSE=function(g,r,A,u,z,F,I,ea,S){if(S)if("rounded"==I||"default"==I&&"rounded"==F||"invRound"==I||"default"==I&&"invRound"==F){r=0;if("rounded"==I||"default"==I&&"rounded"==F)r=1;g.arcTo(ea,ea,0,0,r,u-ea,z)}else("snip"==I||"default"==I&&"snip"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(u-ea,z);else g.lineTo(u,z)};xb.prototype.paintBottom=-function(g,r,A,u,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.lineTo(0,z):g.lineTo(ea,z)};xb.prototype.paintSW=function(g,r,A,u,z,F,I,ea,S){if(S)if("rounded"==I||"default"==I&&"rounded"==F||"invRound"==I||"default"==I&&"invRound"==F){r=0;if("rounded"==I||"default"==I&&"rounded"==F)r=1;g.arcTo(ea,ea,0,0,r,0,z-ea)}else("snip"==I||"default"==I&&"snip"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(0,z-ea);else g.lineTo(0,z)};xb.prototype.paintNWInner=function(g,r,A,u,z,F,I,ea,S){if("rounded"==-I||"default"==I&&"rounded"==F)g.arcTo(ea-.5*S,ea-.5*S,0,0,0,S,.5*S+ea);else if("invRound"==I||"default"==I&&"invRound"==F)g.arcTo(ea+S,ea+S,0,0,1,S,S+ea);else if("snip"==I||"default"==I&&"snip"==F)g.lineTo(S,.5*S+ea);else if("fold"==I||"default"==I&&"fold"==F)g.lineTo(S+ea,S+ea),g.lineTo(S,S+ea)};xb.prototype.paintTopInner=function(g,r,A,u,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(0,S):ta&&!oa?g.lineTo(S,0):ta?"square"==I||"default"==I&&"square"==F?g.lineTo(S,S):"rounded"==I||"default"==I&&"rounded"==-F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(ea+.5*S,S):g.lineTo(ea+S,S):g.lineTo(0,S):g.lineTo(0,0)};xb.prototype.paintNEInner=function(g,r,A,u,z,F,I,ea,S){if("rounded"==I||"default"==I&&"rounded"==F)g.arcTo(ea-.5*S,ea-.5*S,0,0,0,u-ea-.5*S,S);else if("invRound"==I||"default"==I&&"invRound"==F)g.arcTo(ea+S,ea+S,0,0,1,u-ea-S,S);else if("snip"==I||"default"==I&&"snip"==F)g.lineTo(u-ea-.5*S,S);else if("fold"==I||"default"==I&&"fold"==F)g.lineTo(u-ea-S,ea+S),g.lineTo(u-ea-S,S)};xb.prototype.paintRightInner=-function(g,r,A,u,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(u-S,0):ta&&!oa?g.lineTo(u,S):ta?"square"==I||"default"==I&&"square"==F?g.lineTo(u-S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(u-S,ea+.5*S):g.lineTo(u-S,ea+S):g.lineTo(u-S,0):g.lineTo(u,0)};xb.prototype.paintLeftInner=function(g,r,A,u,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(S,z):ta&&!oa?g.lineTo(0,z-S):ta?"square"==I||"default"==I&&"square"==F?g.lineTo(S,z-S):"rounded"==I||"default"==I&&"rounded"==-F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(S,z-ea-.5*S):g.lineTo(S,z-ea-S):g.lineTo(S,z):g.lineTo(0,z)};xb.prototype.paintSEInner=function(g,r,A,u,z,F,I,ea,S){if("rounded"==I||"default"==I&&"rounded"==F)g.arcTo(ea-.5*S,ea-.5*S,0,0,0,u-S,z-ea-.5*S);else if("invRound"==I||"default"==I&&"invRound"==F)g.arcTo(ea+S,ea+S,0,0,1,u-S,z-ea-S);else if("snip"==I||"default"==I&&"snip"==F)g.lineTo(u-S,z-ea-.5*S);else if("fold"==I||"default"==I&&"fold"==F)g.lineTo(u-ea-S,z-ea-S),g.lineTo(u-S,z-ea-S)};xb.prototype.paintBottomInner=-function(g,r,A,u,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(u,z-S):ta&&!oa?g.lineTo(u-S,z):"square"==I||"default"==I&&"square"==F||!ta?g.lineTo(u-S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(u-ea-.5*S,z-S):g.lineTo(u-ea-S,z-S):g.lineTo(u,z)};xb.prototype.paintSWInner=function(g,r,A,u,z,F,I,ea,S,ta){if(!ta)g.lineTo(S,z);else if("square"==I||"default"==I&&"square"==F)g.lineTo(S,z-S);else if("rounded"==I||"default"==I&&"rounded"==F)g.arcTo(ea-.5*S,ea-.5*-S,0,0,0,ea+.5*S,z-S);else if("invRound"==I||"default"==I&&"invRound"==F)g.arcTo(ea+S,ea+S,0,0,1,ea+S,z-S);else if("snip"==I||"default"==I&&"snip"==F)g.lineTo(ea+.5*S,z-S);else if("fold"==I||"default"==I&&"fold"==F)g.lineTo(S+ea,z-ea-S),g.lineTo(S+ea,z-S)};xb.prototype.moveSWInner=function(g,r,A,u,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==F?g.moveTo(S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.moveTo(S,z-ea-.5*S):("invRound"==I||"default"==I&&"invRound"==-F||"fold"==I||"default"==I&&"fold"==F)&&g.moveTo(S,z-ea-S):g.moveTo(0,z-S)};xb.prototype.lineSWInner=function(g,r,A,u,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==F?g.lineTo(S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(S,z-ea-.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(S,z-ea-S):g.lineTo(0,z-S)};xb.prototype.moveSEInner=function(g,r,A,u,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==-F?g.moveTo(u-S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.moveTo(u-S,z-ea-.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.moveTo(u-S,z-ea-S):g.moveTo(u-S,z)};xb.prototype.lineSEInner=function(g,r,A,u,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==F?g.lineTo(u-S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(u-S,z-ea-.5*S):("invRound"==I||"default"==I&&"invRound"==-F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(u-S,z-ea-S):g.lineTo(u-S,z)};xb.prototype.moveNEInner=function(g,r,A,u,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==F||ta?g.moveTo(u-S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.moveTo(u-S,ea+.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.moveTo(u-S,ea+S):g.moveTo(u,S)};xb.prototype.lineNEInner=function(g,r,A,u,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==-F||ta?g.lineTo(u-S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(u-S,ea+.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(u-S,ea+S):g.lineTo(u,S)};xb.prototype.moveNWInner=function(g,r,A,u,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.moveTo(S,0):ta&&!oa?g.moveTo(0,S):"square"==I||"default"==I&&"square"==F?g.moveTo(S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.moveTo(S,ea+.5*S):("invRound"==-I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.moveTo(S,ea+S):g.moveTo(0,0)};xb.prototype.lineNWInner=function(g,r,A,u,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(S,0):ta&&!oa?g.lineTo(0,S):"square"==I||"default"==I&&"square"==F?g.lineTo(S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(S,ea+.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(S,ea+S):g.lineTo(0,0)};xb.prototype.paintFolds=function(g,-r,A,u,z,F,I,ea,S,ta,oa,Ia,mb,$a,Ea){if("fold"==F||"fold"==I||"fold"==ea||"fold"==S||"fold"==ta)("fold"==I||"default"==I&&"fold"==F)&&Ia&&Ea&&(g.moveTo(0,oa),g.lineTo(oa,oa),g.lineTo(oa,0)),("fold"==ea||"default"==ea&&"fold"==F)&&Ia&&mb&&(g.moveTo(u-oa,0),g.lineTo(u-oa,oa),g.lineTo(u,oa)),("fold"==S||"default"==S&&"fold"==F)&&$a&&mb&&(g.moveTo(u-oa,z),g.lineTo(u-oa,z-oa),g.lineTo(u,z-oa)),("fold"==ta||"default"==ta&&"fold"==F)&&$a&&Ea&&(g.moveTo(0,z-oa),g.lineTo(oa,z-oa),g.lineTo(oa,z))};mxCellRenderer.registerShape(xb.prototype.cst.RECT2,-xb);xb.prototype.constraints=null;mxUtils.extend(Mb,mxConnector);Mb.prototype.origPaintEdgeShape=Mb.prototype.paintEdgeShape;Mb.prototype.paintEdgeShape=function(g,r){for(var A=[],u=0;u<r.length;u++)A.push(mxUtils.clone(r[u]));u=g.state.dashed;var z=g.state.fixDash;Mb.prototype.origPaintEdgeShape.apply(this,[g,A]);3<=g.state.strokeWidth&&(A=mxUtils.getValue(this.style,"fillColor",null),null!=A&&(g.setStrokeColor(A),g.setStrokeWidth(g.state.strokeWidth-2),g.setDashed(u,z),Mb.prototype.origPaintEdgeShape.apply(this,-[g,r])))};mxCellRenderer.registerShape("filledEdge",Mb);mxUtils.extend(Pb,mxConnector);Pb.prototype.defaultWidth=4;Pb.prototype.getEdgeWidth=function(){return Math.max(0,mxUtils.getNumber(this.style,"width",this.defaultWidth))};Pb.prototype.getFlowAnimationPath=function(){return mxShape.prototype.getFlowAnimationPath.call(this,2)||mxShape.prototype.getFlowAnimationPath.call(this)};Pb.prototype.origPaintEdgeShape=Pb.prototype.paintEdgeShape;Pb.prototype.paintEdgeShape=function(g,r){for(var A=[],u=-0;u<r.length;u++)A.push(mxUtils.clone(r[u]));u=g.state.dashed;var z=g.state.fixDash,F=this.getEdgeWidth();g.setStrokeWidth(F+2*this.strokewidth);g.setDashed(!1);Pb.prototype.origPaintEdgeShape.apply(this,[g,A]);A=mxUtils.getValue(this.style,"fillColor",null);null!=A&&(g.setStrokeWidth(F),g.setStrokeColor(A),g.setDashed(u,z),Pb.prototype.origPaintEdgeShape.apply(this,[g,r]))};mxCellRenderer.registerShape("pipe",Pb);mxUtils.extend(Tb,mxRectangleShape);Tb.prototype.size=10;Tb.prototype.isRoundable=function(){return!0};-Tb.prototype.paintVertexShape=function(g,r,A,u,z){g.translate(r,A);r=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,null);null!=r&&r!=mxConstants.NONE&&(g.setStrokeColor("none"),g.begin(),g.rect(0,0,u,z),g.fillAndStroke(),g.setStrokeColor(this.stroke));var F=Math.max(5,parseFloat(mxUtils.getValue(this.style,"size",this.size)));r=z/2;A=this.strokewidth;A=this.isRounded?A/2:A;z-=A;F=Math.max(1,Math.round(u/F)-1);var I=u/(F+1),ea=I/2;g.begin();g.moveTo(0,r);if(this.isRounded){g.curveTo(.4*ea,-r-.4*(r-A),.6*ea,A,ea,A);for(var S=0;S<F;S++){var ta=ea+S*I,oa=ta+I,Ia=0==S%2?z:A;g.curveTo(ta+.4*I,0==S%2?A:z,oa-.4*I,Ia,oa,Ia)}z=0==F%2?A:z;g.curveTo(ea+F*I+.4*ea,z,u-.4*ea,r-(z==A?1:-1)*(r-A)*.4,u,r)}else{g.lineTo(ea,A);for(S=0;S<F;S++)oa=ea+(S+1)*I,Ia=0==S%2?z:A,g.lineTo(oa,Ia);g.lineTo(u,r)}g.stroke()};mxCellRenderer.registerShape("zigzag",Tb);"undefined"!==typeof StyleFormatPanel&&function(){var g=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var r=-this.editorUi.getSelectionState(),A=g.apply(this,arguments);"umlFrame"==r.style.shape&&A.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return A}}();mxMarker.addMarker("dash",function(g,r,A,u,z,F,I,ea,S,ta){var oa=z*(I+S+1),Ia=F*(I+S+1);return function(){g.begin();g.moveTo(u.x-oa/2-Ia/2,u.y-Ia/2+oa/2);g.lineTo(u.x+Ia/2-3*oa/2,u.y-3*Ia/2-oa/2);g.stroke()}});mxMarker.addMarker("box",function(g,r,A,u,z,F,I,ea,S,ta){var oa=z*(I+S+1),Ia=F*(I+S+1),mb=u.x+oa/2,-$a=u.y+Ia/2;u.x-=oa;u.y-=Ia;return function(){g.begin();g.moveTo(mb-oa/2-Ia/2,$a-Ia/2+oa/2);g.lineTo(mb-oa/2+Ia/2,$a-Ia/2-oa/2);g.lineTo(mb+Ia/2-3*oa/2,$a-3*Ia/2-oa/2);g.lineTo(mb-Ia/2-3*oa/2,$a-3*Ia/2+oa/2);g.close();ta?g.fillAndStroke():g.stroke()}});mxMarker.addMarker("cross",function(g,r,A,u,z,F,I,ea,S,ta){var oa=z*(I+S+1),Ia=F*(I+S+1);return function(){g.begin();g.moveTo(u.x-oa/2-Ia/2,u.y-Ia/2+oa/2);g.lineTo(u.x+Ia/2-3*oa/2,u.y-3*Ia/2-oa/2);g.moveTo(u.x-oa/2+Ia/2,u.y-Ia/2-oa/2);g.lineTo(u.x--Ia/2-3*oa/2,u.y-3*Ia/2+oa/2);g.stroke()}});mxMarker.addMarker("circle",Vb);mxMarker.addMarker("circlePlus",function(g,r,A,u,z,F,I,ea,S,ta){var oa=u.clone(),Ia=Vb.apply(this,arguments),mb=z*(I+2*S),$a=F*(I+2*S);return function(){Ia.apply(this,arguments);g.begin();g.moveTo(oa.x-z*S,oa.y-F*S);g.lineTo(oa.x-2*mb+z*S,oa.y-2*$a+F*S);g.moveTo(oa.x-mb-$a+F*S,oa.y-$a+mb-z*S);g.lineTo(oa.x+$a-mb-F*S,oa.y-$a-mb+z*S);g.stroke()}});mxMarker.addMarker("halfCircle",function(g,r,A,u,z,F,I,ea,S,ta){var oa=z*(I+S+-1),Ia=F*(I+S+1),mb=u.clone();u.x-=oa;u.y-=Ia;return function(){g.begin();g.moveTo(mb.x-Ia,mb.y+oa);g.quadTo(u.x-Ia,u.y+oa,u.x,u.y);g.quadTo(u.x+Ia,u.y-oa,mb.x+Ia,mb.y-oa);g.stroke()}});mxMarker.addMarker("async",function(g,r,A,u,z,F,I,ea,S,ta){r=z*S*1.118;A=F*S*1.118;z*=I+S;F*=I+S;var oa=u.clone();oa.x-=r;oa.y-=A;u.x+=-z-r;u.y+=-F-A;return function(){g.begin();g.moveTo(oa.x,oa.y);ea?g.lineTo(oa.x-z-F/2,oa.y-F+z/2):g.lineTo(oa.x+F/2-z,oa.y-F-z/2);g.lineTo(oa.x-z,oa.y-F);g.close();ta?g.fillAndStroke():-g.stroke()}});mxMarker.addMarker("openAsync",function(g){g=null!=g?g:2;return function(r,A,u,z,F,I,ea,S,ta,oa){F*=ea+ta;I*=ea+ta;var Ia=z.clone();return function(){r.begin();r.moveTo(Ia.x,Ia.y);S?r.lineTo(Ia.x-F-I/g,Ia.y-I+F/g):r.lineTo(Ia.x+I/g-F,Ia.y-I-F/g);r.stroke()}}}(2));mxUtils.extend(Gb,mxRectangleShape);Gb.prototype.arcStartY=25;Gb.prototype.arcMidY=-25;Gb.prototype.arcEndY=25;Gb.prototype.paintForeground=function(g,r,A,u,z){mxRectangleShape.prototype.paintForeground.apply(this,arguments);+"south"),hc=F&&F.opacity?F.opacity:mxUtils.getValue(this.style,"opacity","100"),ic=Math.max(0,Math.min(50,S));F=xb.prototype;g.setDashed(Ia);mb&&""!=mb&&g.setDashPattern(mb);g.setStrokeWidth(ec);S=Math.min(.5*z,.5*v,S);ea||(S=ic*Math.min(v,z)/100);S=Math.min(S,.5*Math.min(v,z));ea||(oa=Math.min($a*Math.min(v,z)/100));oa=Math.min(oa,.5*Math.min(v,z)-S);(Ea||Ga||Ja||Pa)&&"frame"!=ta&&(g.begin(),Ea?F.moveNW(g,r,A,v,z,I,eb,S,Pa):g.moveTo(0,0),Ea&&F.paintNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,+hb,S,Ga),Ga&&F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),Ja&&F.paintSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),Pa&&F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),g.close(),g.fill(),g.setShadow(!1),g.setFillColor(cc),Ia=ea=hc,"none"==cc&&(ea=0),"none"==fc&&(Ia=0),g.setGradient(cc,fc,0,0,v,z,gc,ea,Ia),g.begin(),Ea?F.moveNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa):g.moveTo(oa,0),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),Pa&&Ja&&F.paintSWInner(g,r,A,v,z,+I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),Ja&&Ga&&F.paintSEInner(g,r,A,v,z,I,ib,S,oa),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),Ga&&Ea&&F.paintNEInner(g,r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),Ea&&Pa&&F.paintNWInner(g,r,A,v,z,I,eb,S,oa),g.fill(),"none"==dc&&(g.begin(),F.paintFolds(g,r,A,v,z,I,eb,hb,ib,kb,S,Ea,Ga,Ja,Pa),g.stroke()));Ea||Ga||Ja||!Pa?Ea||Ga||!Ja||Pa?!Ea&&!Ga&&Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,+z,I,kb,S,Pa),F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),"double"==ta&&(F.moveNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,v,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja)),g.stroke()):(g.begin(),F.moveSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.lineNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,+r,A,v,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),g.close(),g.fillAndStroke()):Ea||!Ga||Ja||Pa?!Ea&&Ga&&!Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSW(g,r,A,v,z,I,eb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),"double"==ta&&(F.moveNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa)),g.stroke(),g.begin(),F.moveNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),"double"==ta&&(F.moveSEInner(g,r,A,v,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga)),+g.stroke()):(g.begin(),F.moveSW(g,r,A,v,z,I,eb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.lineNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),g.close(),g.fillAndStroke(),g.begin(),F.moveNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.lineSEInner(g,r,A,v,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),g.close(),g.fillAndStroke()):!Ea&&Ga&&Ja&&!Pa?"frame"!=ta?(g.begin(),F.moveNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.paintSE(g,+r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),"double"==ta&&(F.moveSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,v,z,I,ib,S,oa),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga)),g.stroke()):(g.begin(),F.moveNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.paintSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.lineSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,v,z,I,ib,+S,oa),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),g.close(),g.fillAndStroke()):!Ea&&Ga&&Ja&&Pa?"frame"!=ta?(g.begin(),F.moveNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.paintSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),"double"==ta&&(F.moveNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,v,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,+r,A,v,z,I,ib,S,oa),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga)),g.stroke()):(g.begin(),F.moveNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.paintSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.lineNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,v,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,v,z,I,ib,S,oa),F.paintRightInner(g,+r,A,v,z,I,hb,S,oa,Ea,Ga),g.close(),g.fillAndStroke()):!Ea||Ga||Ja||Pa?Ea&&!Ga&&!Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.paintNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),"double"==ta&&(F.moveNEInner(g,r,A,v,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,v,z,I,eb,S,oa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa)),g.stroke()):(g.begin(),F.moveSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.paintNW(g,+r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.lineNEInner(g,r,A,v,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,v,z,I,eb,S,oa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),g.close(),g.fillAndStroke()):Ea&&!Ga&&Ja&&!Pa?"frame"!=ta?(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),"double"==ta&&(F.moveNEInner(g,r,A,v,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea)),g.stroke(),g.begin(),F.moveSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,+r,A,v,z,I,kb,S,Pa),"double"==ta&&(F.moveSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja)),g.stroke()):(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.lineNEInner(g,r,A,v,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),g.close(),g.fillAndStroke(),g.begin(),F.moveSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.lineSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),g.close(),g.fillAndStroke()):+Ea&&!Ga&&Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.paintNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),"double"==ta&&(F.moveNEInner(g,r,A,v,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,v,z,I,eb,S,oa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,v,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja)),g.stroke()):+(g.begin(),F.moveSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.paintNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.lineNEInner(g,r,A,v,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,v,z,I,eb,S,oa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),F.paintSWInner(g,r,A,v,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),g.close(),g.fillAndStroke()):Ea&&Ga&&!Ja&&!Pa?"frame"!=+ta?(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),"double"==ta&&(F.moveSEInner(g,r,A,v,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea)),g.stroke()):(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.lineSEInner(g,r,A,v,z,I,ib,S,oa,+Ja),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),g.close(),g.fillAndStroke()):Ea&&Ga&&!Ja&&Pa?"frame"!=ta?(g.begin(),F.moveSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.paintNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),"double"==ta&&(F.moveSEInner(g,r,A,v,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,+r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,v,z,I,eb,S,oa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa)),g.stroke()):(g.begin(),F.moveSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.paintNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.lineSEInner(g,r,A,v,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,+I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,v,z,I,eb,S,oa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),g.close(),g.fillAndStroke()):Ea&&Ga&&Ja&&!Pa?"frame"!=ta?(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.paintSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),"double"==ta&&(F.moveSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,v,z,I,ib,S,oa),F.paintRightInner(g,+r,A,v,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea)),g.stroke()):(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.paintSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.lineSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,v,z,I,ib,S,oa),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,+r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),g.close(),g.fillAndStroke()):Ea&&Ga&&Ja&&Pa&&("frame"!=ta?(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.paintSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),g.close(),"double"==ta&&(F.moveSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintSWInner(g,r,+A,v,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,v,z,I,ib,S,oa),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,v,z,I,eb,S,oa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),g.close()),g.stroke()):(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.paintNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.paintSE(g,+r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.paintSW(g,r,A,v,z,I,kb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),g.close(),F.moveSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintSWInner(g,r,A,v,z,I,kb,S,oa,Ja),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),F.paintSEInner(g,r,A,v,z,I,ib,S,oa),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),F.paintNEInner(g,r,A,v,z,I,hb,S,oa),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),F.paintNWInner(g,r,A,v,z,I,eb,S,oa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa),g.close(),+g.fillAndStroke())):"frame"!=ta?(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),"double"==ta&&(F.moveNEInner(g,r,A,v,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea)),g.stroke()):(g.begin(),F.moveNW(g,r,A,v,z,I,eb,S,Pa),F.paintTop(g,r,A,v,z,I,hb,S,Ga),F.lineNEInner(g,r,A,v,z,I,hb,S,oa,Ga),F.paintTopInner(g,r,A,v,z,I,eb,S,oa,Pa,Ea),g.close(),g.fillAndStroke()):"frame"!=ta?(g.begin(),F.moveNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),"double"==ta&&(F.moveSEInner(g,+r,A,v,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga)),g.stroke()):(g.begin(),F.moveNE(g,r,A,v,z,I,hb,S,Ea),F.paintRight(g,r,A,v,z,I,ib,S,Ja),F.lineSEInner(g,r,A,v,z,I,ib,S,oa,Ja),F.paintRightInner(g,r,A,v,z,I,hb,S,oa,Ea,Ga),g.close(),g.fillAndStroke()):"frame"!=ta?(g.begin(),F.moveSE(g,r,A,v,z,I,ib,S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),"double"==ta&&(F.moveSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja)),g.stroke()):(g.begin(),F.moveSE(g,r,A,v,z,I,ib,+S,Ga),F.paintBottom(g,r,A,v,z,I,kb,S,Pa),F.lineSWInner(g,r,A,v,z,I,kb,S,oa,Pa),F.paintBottomInner(g,r,A,v,z,I,ib,S,oa,Ga,Ja),g.close(),g.fillAndStroke()):"frame"!=ta?(g.begin(),F.moveSW(g,r,A,v,z,I,eb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),"double"==ta&&(F.moveNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,v,z,I,kb,S,oa,Ja,Pa)),g.stroke()):(g.begin(),F.moveSW(g,r,A,v,z,I,eb,S,Ja),F.paintLeft(g,r,A,v,z,I,eb,S,Ea),F.lineNWInner(g,r,A,v,z,I,eb,S,oa,Ea,Pa),F.paintLeftInner(g,r,A,v,z,I,kb,S,+oa,Ja,Pa),g.close(),g.fillAndStroke());g.begin();F.paintFolds(g,r,A,v,z,I,eb,hb,ib,kb,S,Ea,Ga,Ja,Pa);g.stroke()};xb.prototype.moveNW=function(g,r,A,v,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.moveTo(0,0):g.moveTo(0,ea)};xb.prototype.moveNE=function(g,r,A,v,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.moveTo(v,0):g.moveTo(v-ea,0)};xb.prototype.moveSE=function(g,r,A,v,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.moveTo(v,z):g.moveTo(v,z-ea)};xb.prototype.moveSW=+function(g,r,A,v,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.moveTo(0,z):g.moveTo(ea,z)};xb.prototype.paintNW=function(g,r,A,v,z,F,I,ea,S){if(S)if("rounded"==I||"default"==I&&"rounded"==F||"invRound"==I||"default"==I&&"invRound"==F){r=0;if("rounded"==I||"default"==I&&"rounded"==F)r=1;g.arcTo(ea,ea,0,0,r,ea,0)}else("snip"==I||"default"==I&&"snip"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(ea,0);else g.lineTo(0,0)};xb.prototype.paintTop=function(g,r,A,v,z,F,I,ea,S){"square"==I||+"default"==I&&"square"==F||!S?g.lineTo(v,0):g.lineTo(v-ea,0)};xb.prototype.paintNE=function(g,r,A,v,z,F,I,ea,S){if(S)if("rounded"==I||"default"==I&&"rounded"==F||"invRound"==I||"default"==I&&"invRound"==F){r=0;if("rounded"==I||"default"==I&&"rounded"==F)r=1;g.arcTo(ea,ea,0,0,r,v,ea)}else("snip"==I||"default"==I&&"snip"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(v,ea);else g.lineTo(v,0)};xb.prototype.paintRight=function(g,r,A,v,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.lineTo(v,+z):g.lineTo(v,z-ea)};xb.prototype.paintLeft=function(g,r,A,v,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.lineTo(0,0):g.lineTo(0,ea)};xb.prototype.paintSE=function(g,r,A,v,z,F,I,ea,S){if(S)if("rounded"==I||"default"==I&&"rounded"==F||"invRound"==I||"default"==I&&"invRound"==F){r=0;if("rounded"==I||"default"==I&&"rounded"==F)r=1;g.arcTo(ea,ea,0,0,r,v-ea,z)}else("snip"==I||"default"==I&&"snip"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(v-ea,z);else g.lineTo(v,z)};xb.prototype.paintBottom=+function(g,r,A,v,z,F,I,ea,S){"square"==I||"default"==I&&"square"==F||!S?g.lineTo(0,z):g.lineTo(ea,z)};xb.prototype.paintSW=function(g,r,A,v,z,F,I,ea,S){if(S)if("rounded"==I||"default"==I&&"rounded"==F||"invRound"==I||"default"==I&&"invRound"==F){r=0;if("rounded"==I||"default"==I&&"rounded"==F)r=1;g.arcTo(ea,ea,0,0,r,0,z-ea)}else("snip"==I||"default"==I&&"snip"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(0,z-ea);else g.lineTo(0,z)};xb.prototype.paintNWInner=function(g,r,A,v,z,F,I,ea,S){if("rounded"==+I||"default"==I&&"rounded"==F)g.arcTo(ea-.5*S,ea-.5*S,0,0,0,S,.5*S+ea);else if("invRound"==I||"default"==I&&"invRound"==F)g.arcTo(ea+S,ea+S,0,0,1,S,S+ea);else if("snip"==I||"default"==I&&"snip"==F)g.lineTo(S,.5*S+ea);else if("fold"==I||"default"==I&&"fold"==F)g.lineTo(S+ea,S+ea),g.lineTo(S,S+ea)};xb.prototype.paintTopInner=function(g,r,A,v,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(0,S):ta&&!oa?g.lineTo(S,0):ta?"square"==I||"default"==I&&"square"==F?g.lineTo(S,S):"rounded"==I||"default"==I&&"rounded"==+F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(ea+.5*S,S):g.lineTo(ea+S,S):g.lineTo(0,S):g.lineTo(0,0)};xb.prototype.paintNEInner=function(g,r,A,v,z,F,I,ea,S){if("rounded"==I||"default"==I&&"rounded"==F)g.arcTo(ea-.5*S,ea-.5*S,0,0,0,v-ea-.5*S,S);else if("invRound"==I||"default"==I&&"invRound"==F)g.arcTo(ea+S,ea+S,0,0,1,v-ea-S,S);else if("snip"==I||"default"==I&&"snip"==F)g.lineTo(v-ea-.5*S,S);else if("fold"==I||"default"==I&&"fold"==F)g.lineTo(v-ea-S,ea+S),g.lineTo(v-ea-S,S)};xb.prototype.paintRightInner=+function(g,r,A,v,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(v-S,0):ta&&!oa?g.lineTo(v,S):ta?"square"==I||"default"==I&&"square"==F?g.lineTo(v-S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(v-S,ea+.5*S):g.lineTo(v-S,ea+S):g.lineTo(v-S,0):g.lineTo(v,0)};xb.prototype.paintLeftInner=function(g,r,A,v,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(S,z):ta&&!oa?g.lineTo(0,z-S):ta?"square"==I||"default"==I&&"square"==F?g.lineTo(S,z-S):"rounded"==I||"default"==I&&"rounded"==+F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(S,z-ea-.5*S):g.lineTo(S,z-ea-S):g.lineTo(S,z):g.lineTo(0,z)};xb.prototype.paintSEInner=function(g,r,A,v,z,F,I,ea,S){if("rounded"==I||"default"==I&&"rounded"==F)g.arcTo(ea-.5*S,ea-.5*S,0,0,0,v-S,z-ea-.5*S);else if("invRound"==I||"default"==I&&"invRound"==F)g.arcTo(ea+S,ea+S,0,0,1,v-S,z-ea-S);else if("snip"==I||"default"==I&&"snip"==F)g.lineTo(v-S,z-ea-.5*S);else if("fold"==I||"default"==I&&"fold"==F)g.lineTo(v-ea-S,z-ea-S),g.lineTo(v-S,z-ea-S)};xb.prototype.paintBottomInner=+function(g,r,A,v,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(v,z-S):ta&&!oa?g.lineTo(v-S,z):"square"==I||"default"==I&&"square"==F||!ta?g.lineTo(v-S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(v-ea-.5*S,z-S):g.lineTo(v-ea-S,z-S):g.lineTo(v,z)};xb.prototype.paintSWInner=function(g,r,A,v,z,F,I,ea,S,ta){if(!ta)g.lineTo(S,z);else if("square"==I||"default"==I&&"square"==F)g.lineTo(S,z-S);else if("rounded"==I||"default"==I&&"rounded"==F)g.arcTo(ea-.5*S,ea-.5*+S,0,0,0,ea+.5*S,z-S);else if("invRound"==I||"default"==I&&"invRound"==F)g.arcTo(ea+S,ea+S,0,0,1,ea+S,z-S);else if("snip"==I||"default"==I&&"snip"==F)g.lineTo(ea+.5*S,z-S);else if("fold"==I||"default"==I&&"fold"==F)g.lineTo(S+ea,z-ea-S),g.lineTo(S+ea,z-S)};xb.prototype.moveSWInner=function(g,r,A,v,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==F?g.moveTo(S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.moveTo(S,z-ea-.5*S):("invRound"==I||"default"==I&&"invRound"==+F||"fold"==I||"default"==I&&"fold"==F)&&g.moveTo(S,z-ea-S):g.moveTo(0,z-S)};xb.prototype.lineSWInner=function(g,r,A,v,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==F?g.lineTo(S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(S,z-ea-.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(S,z-ea-S):g.lineTo(0,z-S)};xb.prototype.moveSEInner=function(g,r,A,v,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==+F?g.moveTo(v-S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.moveTo(v-S,z-ea-.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.moveTo(v-S,z-ea-S):g.moveTo(v-S,z)};xb.prototype.lineSEInner=function(g,r,A,v,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==F?g.lineTo(v-S,z-S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(v-S,z-ea-.5*S):("invRound"==I||"default"==I&&"invRound"==+F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(v-S,z-ea-S):g.lineTo(v-S,z)};xb.prototype.moveNEInner=function(g,r,A,v,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==F||ta?g.moveTo(v-S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.moveTo(v-S,ea+.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.moveTo(v-S,ea+S):g.moveTo(v,S)};xb.prototype.lineNEInner=function(g,r,A,v,z,F,I,ea,S,ta){ta?"square"==I||"default"==I&&"square"==+F||ta?g.lineTo(v-S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(v-S,ea+.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(v-S,ea+S):g.lineTo(v,S)};xb.prototype.moveNWInner=function(g,r,A,v,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.moveTo(S,0):ta&&!oa?g.moveTo(0,S):"square"==I||"default"==I&&"square"==F?g.moveTo(S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.moveTo(S,ea+.5*S):("invRound"==+I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.moveTo(S,ea+S):g.moveTo(0,0)};xb.prototype.lineNWInner=function(g,r,A,v,z,F,I,ea,S,ta,oa){ta||oa?!ta&&oa?g.lineTo(S,0):ta&&!oa?g.lineTo(0,S):"square"==I||"default"==I&&"square"==F?g.lineTo(S,S):"rounded"==I||"default"==I&&"rounded"==F||"snip"==I||"default"==I&&"snip"==F?g.lineTo(S,ea+.5*S):("invRound"==I||"default"==I&&"invRound"==F||"fold"==I||"default"==I&&"fold"==F)&&g.lineTo(S,ea+S):g.lineTo(0,0)};xb.prototype.paintFolds=function(g,+r,A,v,z,F,I,ea,S,ta,oa,Ia,mb,$a,Ea){if("fold"==F||"fold"==I||"fold"==ea||"fold"==S||"fold"==ta)("fold"==I||"default"==I&&"fold"==F)&&Ia&&Ea&&(g.moveTo(0,oa),g.lineTo(oa,oa),g.lineTo(oa,0)),("fold"==ea||"default"==ea&&"fold"==F)&&Ia&&mb&&(g.moveTo(v-oa,0),g.lineTo(v-oa,oa),g.lineTo(v,oa)),("fold"==S||"default"==S&&"fold"==F)&&$a&&mb&&(g.moveTo(v-oa,z),g.lineTo(v-oa,z-oa),g.lineTo(v,z-oa)),("fold"==ta||"default"==ta&&"fold"==F)&&$a&&Ea&&(g.moveTo(0,z-oa),g.lineTo(oa,z-oa),g.lineTo(oa,z))};mxCellRenderer.registerShape(xb.prototype.cst.RECT2,+xb);xb.prototype.constraints=null;mxUtils.extend(Mb,mxConnector);Mb.prototype.origPaintEdgeShape=Mb.prototype.paintEdgeShape;Mb.prototype.paintEdgeShape=function(g,r){for(var A=[],v=0;v<r.length;v++)A.push(mxUtils.clone(r[v]));v=g.state.dashed;var z=g.state.fixDash;Mb.prototype.origPaintEdgeShape.apply(this,[g,A]);3<=g.state.strokeWidth&&(A=mxUtils.getValue(this.style,"fillColor",null),null!=A&&(g.setStrokeColor(A),g.setStrokeWidth(g.state.strokeWidth-2),g.setDashed(v,z),Mb.prototype.origPaintEdgeShape.apply(this,+[g,r])))};mxCellRenderer.registerShape("filledEdge",Mb);mxUtils.extend(Pb,mxConnector);Pb.prototype.defaultWidth=4;Pb.prototype.getEdgeWidth=function(){return Math.max(0,mxUtils.getNumber(this.style,"width",this.defaultWidth))};Pb.prototype.getFlowAnimationPath=function(){return mxShape.prototype.getFlowAnimationPath.call(this,2)||mxShape.prototype.getFlowAnimationPath.call(this)};Pb.prototype.origPaintEdgeShape=Pb.prototype.paintEdgeShape;Pb.prototype.paintEdgeShape=function(g,r){for(var A=[],v=+0;v<r.length;v++)A.push(mxUtils.clone(r[v]));v=g.state.dashed;var z=g.state.fixDash,F=this.getEdgeWidth();g.setStrokeWidth(F+2*this.strokewidth);g.setDashed(!1);Pb.prototype.origPaintEdgeShape.apply(this,[g,A]);A=mxUtils.getValue(this.style,"fillColor",null);null!=A&&(g.setStrokeWidth(F),g.setStrokeColor(A),g.setDashed(v,z),Pb.prototype.origPaintEdgeShape.apply(this,[g,r]))};mxCellRenderer.registerShape("pipe",Pb);mxUtils.extend(Tb,mxRectangleShape);Tb.prototype.size=10;Tb.prototype.isRoundable=function(){return!0};+Tb.prototype.paintVertexShape=function(g,r,A,v,z){g.translate(r,A);r=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,null);null!=r&&r!=mxConstants.NONE&&(g.setStrokeColor("none"),g.begin(),g.rect(0,0,v,z),g.fillAndStroke(),g.setStrokeColor(this.stroke));var F=Math.max(5,parseFloat(mxUtils.getValue(this.style,"size",this.size)));r=z/2;A=this.strokewidth;A=this.isRounded?A/2:A;z-=A;F=Math.max(1,Math.round(v/F)-1);var I=v/(F+1),ea=I/2;g.begin();g.moveTo(0,r);if(this.isRounded){g.curveTo(.4*ea,+r-.4*(r-A),.6*ea,A,ea,A);for(var S=0;S<F;S++){var ta=ea+S*I,oa=ta+I,Ia=0==S%2?z:A;g.curveTo(ta+.4*I,0==S%2?A:z,oa-.4*I,Ia,oa,Ia)}z=0==F%2?A:z;g.curveTo(ea+F*I+.4*ea,z,v-.4*ea,r-(z==A?1:-1)*(r-A)*.4,v,r)}else{g.lineTo(ea,A);for(S=0;S<F;S++)oa=ea+(S+1)*I,Ia=0==S%2?z:A,g.lineTo(oa,Ia);g.lineTo(v,r)}g.stroke()};mxCellRenderer.registerShape("zigzag",Tb);"undefined"!==typeof StyleFormatPanel&&function(){var g=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var r=+this.editorUi.getSelectionState(),A=g.apply(this,arguments);"umlFrame"==r.style.shape&&A.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return A}}();mxMarker.addMarker("dash",function(g,r,A,v,z,F,I,ea,S,ta){var oa=z*(I+S+1),Ia=F*(I+S+1);return function(){g.begin();g.moveTo(v.x-oa/2-Ia/2,v.y-Ia/2+oa/2);g.lineTo(v.x+Ia/2-3*oa/2,v.y-3*Ia/2-oa/2);g.stroke()}});mxMarker.addMarker("box",function(g,r,A,v,z,F,I,ea,S,ta){var oa=z*(I+S+1),Ia=F*(I+S+1),mb=v.x+oa/2,+$a=v.y+Ia/2;v.x-=oa;v.y-=Ia;return function(){g.begin();g.moveTo(mb-oa/2-Ia/2,$a-Ia/2+oa/2);g.lineTo(mb-oa/2+Ia/2,$a-Ia/2-oa/2);g.lineTo(mb+Ia/2-3*oa/2,$a-3*Ia/2-oa/2);g.lineTo(mb-Ia/2-3*oa/2,$a-3*Ia/2+oa/2);g.close();ta?g.fillAndStroke():g.stroke()}});mxMarker.addMarker("cross",function(g,r,A,v,z,F,I,ea,S,ta){var oa=z*(I+S+1),Ia=F*(I+S+1);return function(){g.begin();g.moveTo(v.x-oa/2-Ia/2,v.y-Ia/2+oa/2);g.lineTo(v.x+Ia/2-3*oa/2,v.y-3*Ia/2-oa/2);g.moveTo(v.x-oa/2+Ia/2,v.y-Ia/2-oa/2);g.lineTo(v.x-+Ia/2-3*oa/2,v.y-3*Ia/2+oa/2);g.stroke()}});mxMarker.addMarker("circle",Vb);mxMarker.addMarker("circlePlus",function(g,r,A,v,z,F,I,ea,S,ta){var oa=v.clone(),Ia=Vb.apply(this,arguments),mb=z*(I+2*S),$a=F*(I+2*S);return function(){Ia.apply(this,arguments);g.begin();g.moveTo(oa.x-z*S,oa.y-F*S);g.lineTo(oa.x-2*mb+z*S,oa.y-2*$a+F*S);g.moveTo(oa.x-mb-$a+F*S,oa.y-$a+mb-z*S);g.lineTo(oa.x+$a-mb-F*S,oa.y-$a-mb+z*S);g.stroke()}});mxMarker.addMarker("halfCircle",function(g,r,A,v,z,F,I,ea,S,ta){var oa=z*(I+S++1),Ia=F*(I+S+1),mb=v.clone();v.x-=oa;v.y-=Ia;return function(){g.begin();g.moveTo(mb.x-Ia,mb.y+oa);g.quadTo(v.x-Ia,v.y+oa,v.x,v.y);g.quadTo(v.x+Ia,v.y-oa,mb.x+Ia,mb.y-oa);g.stroke()}});mxMarker.addMarker("async",function(g,r,A,v,z,F,I,ea,S,ta){r=z*S*1.118;A=F*S*1.118;z*=I+S;F*=I+S;var oa=v.clone();oa.x-=r;oa.y-=A;v.x+=-z-r;v.y+=-F-A;return function(){g.begin();g.moveTo(oa.x,oa.y);ea?g.lineTo(oa.x-z-F/2,oa.y-F+z/2):g.lineTo(oa.x+F/2-z,oa.y-F-z/2);g.lineTo(oa.x-z,oa.y-F);g.close();ta?g.fillAndStroke():+g.stroke()}});mxMarker.addMarker("openAsync",function(g){g=null!=g?g:2;return function(r,A,v,z,F,I,ea,S,ta,oa){F*=ea+ta;I*=ea+ta;var Ia=z.clone();return function(){r.begin();r.moveTo(Ia.x,Ia.y);S?r.lineTo(Ia.x-F-I/g,Ia.y-I+F/g):r.lineTo(Ia.x+I/g-F,Ia.y-I-F/g);r.stroke()}}}(2));mxUtils.extend(Gb,mxRectangleShape);Gb.prototype.arcStartY=25;Gb.prototype.arcMidY=-25;Gb.prototype.arcEndY=25;Gb.prototype.paintForeground=function(g,r,A,v,z){mxRectangleShape.prototype.paintForeground.apply(this,arguments);if(null!=this.state){var F=this.state.view.graph;if(null==F.cellEditor||F.cellEditor.editingCell!=this.state.cell)if(F=F.convertValueToString(this.state.cell),null!=F&&0!=F.length){var I=parseFloat(mxUtils.getValue(this.style,"arcStartY",this.arcStartY)),ea=parseFloat(mxUtils.getValue(this.style,"arcMidY",this.arcMidY)),S=parseFloat(mxUtils.getValue(this.style,"arcEndY",this.arcEndY)),ta=mxUtils.getValue(this.style,"curveType","round");if(null!=g.root&&"function"===typeof g.getBaseUrl){null!=this._curvedTextGroup&&null!=this._curvedTextGroup.parentNode&&this._curvedTextGroup.parentNode.removeChild(this._curvedTextGroup);this._curvedTextGroup=null;g.translate(r,A);var oa=g.state,Ia=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)),mb=Ia/2,$a=(I+S)/2,Ea=Math.max(Math.abs(Gb.prototype.arcMidY),Math.min($a,z-$a));ea=Math.max(-Ea,Math.min(Ea,ea));var Ga=$a+ea;ea=Math.min(I,S,Ga);Ea=Math.max(I,S,Ga);$a=Ea-ea;var Ja=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,-mxConstants.ALIGN_MIDDLE);this._curveYOffset=$a=Ja==mxConstants.ALIGN_TOP?mb-ea:Ja==mxConstants.ALIGN_BOTTOM?z-mb-Ea:(z-$a)/2-ea;Ja=u-mb;ea=(mb+oa.dx)*oa.scale;I=(I+$a+oa.dy)*oa.scale;Ea=((mb+Ja)/2+oa.dx)*oa.scale;Ga=(Ga+$a+oa.dy)*oa.scale;mb=(Ja+oa.dx)*oa.scale;S=(S+$a+oa.dy)*oa.scale;"round"==ta?(Ja=Math.sqrt((mb-ea)*(mb-ea)+(S-I)*(S-I)),ta=(ea+mb)/2,$a=(I+S)/2,ta=Math.sqrt((Ea-ta)*(Ea-ta)+(Ga-$a)*(Ga-$a)),.5>ta?(ta="M "+g.format(ea)+" "+g.format(I)+" L "+g.format(mb)+" "+g.format(S),ea=Ja):(Ja/=+mxConstants.ALIGN_MIDDLE);this._curveYOffset=$a=Ja==mxConstants.ALIGN_TOP?mb-ea:Ja==mxConstants.ALIGN_BOTTOM?z-mb-Ea:(z-$a)/2-ea;Ja=v-mb;ea=(mb+oa.dx)*oa.scale;I=(I+$a+oa.dy)*oa.scale;Ea=((mb+Ja)/2+oa.dx)*oa.scale;Ga=(Ga+$a+oa.dy)*oa.scale;mb=(Ja+oa.dx)*oa.scale;S=(S+$a+oa.dy)*oa.scale;"round"==ta?(Ja=Math.sqrt((mb-ea)*(mb-ea)+(S-I)*(S-I)),ta=(ea+mb)/2,$a=(I+S)/2,ta=Math.sqrt((Ea-ta)*(Ea-ta)+(Ga-$a)*(Ga-$a)),.5>ta?(ta="M "+g.format(ea)+" "+g.format(I)+" L "+g.format(mb)+" "+g.format(S),ea=Ja):(Ja/=2,$a=Ja*Ja/(2*ta)+ta/2,Ga=0<(mb-ea)*(Ga-I)-(S-I)*(Ea-ea)?0:1,Ea=ta>Ja?1:0,ta="M "+g.format(ea)+" "+g.format(I)+" A "+g.format($a)+" "+g.format($a)+" 0 "+Ea+" "+Ga+" "+g.format(mb)+" "+g.format(S),ea=2*Math.asin(Math.min(1,Ja/$a)),Ea&&(ea=2*Math.PI-ea),ea*=$a)):(ta="M "+g.format(ea)+" "+g.format(I)+" Q "+g.format(Ea)+" "+g.format(Ga)+" "+g.format(mb)+" "+g.format(S),$a=Ea-ea,Ja=Ga-I,Ea=mb-Ea,Ga=S-Ga,ea=mb-ea,I=S-I,ea=(Math.sqrt($a*$a+Ja*Ja)+Math.sqrt(Ea*Ea+Ga*Ga)+Math.sqrt(ea*ea+I*I))/2);S=(g.idPrefix||"")+"ctp-"+mxObjectIdentity.get(this);Ea=(I=!mxClient.IS_CHROMEAPP&&g.root.ownerDocument==document)?g.getBaseUrl().replace(/([\(\)])/g,"\\$1"):"";mb=g.createElement("g");Ga=oa.transform||"";0<Ga.length&&mb.setAttribute("transform",Ga);1>oa.alpha&&mb.setAttribute("opacity",oa.alpha);Ga=g.createElement("defs");$a=g.createElement("path");$a.setAttribute("id",S);$a.setAttribute("d",ta);Ga.appendChild($a);mb.appendChild(Ga);ta=g.createElement("text");$a=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);Ja=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"#000000");Ga=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,0);ta.setAttribute("font-size",Ia*oa.scale+"px");ta.setAttribute("font-family",mxUtils.parseCssFontFamily($a));ta.setAttribute("fill",Ja);(Ga&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&ta.setAttribute("font-weight","bold");(Ga&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&ta.setAttribute("font-style","italic");oa=[];(Ga&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&oa.push("underline");(Ga&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&oa.push("line-through");0<oa.length&&(ta.setAttribute("text-decoration",oa.join(" ")),(Ga&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(ta.style.textDecorationStyle="dotted"));Ia=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER);Ga="middle";oa="50%";Ia==mxConstants.ALIGN_LEFT?(Ga="start",oa="0%"):Ia==mxConstants.ALIGN_RIGHT&&(Ga=-"end",oa="100%");ta.setAttribute("text-anchor",Ga);ta.setAttribute("dominant-baseline","central");Ia=g.createElement("textPath");Ia.setAttribute("startOffset",oa);oa=(I?Ea:"")+"#"+S;Ia.setAttribute("href",oa);I&&Ia.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",oa);Ia.setAttribute("textLength",ea);Ia.setAttribute("lengthAdjust","spacing");mxUtils.write(Ia,F);ta.appendChild(Ia);mb.appendChild(ta);g.root.appendChild(mb);this._curvedTextGroup=mb}else g.text(r+u/2,A+z/2,0,0,F,mxConstants.ALIGN_CENTER,+"end",oa="100%");ta.setAttribute("text-anchor",Ga);ta.setAttribute("dominant-baseline","central");Ia=g.createElement("textPath");Ia.setAttribute("startOffset",oa);oa=(I?Ea:"")+"#"+S;Ia.setAttribute("href",oa);I&&Ia.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",oa);Ia.setAttribute("textLength",ea);Ia.setAttribute("lengthAdjust","spacing");mxUtils.write(Ia,F);ta.appendChild(Ia);mb.appendChild(ta);g.root.appendChild(mb);this._curvedTextGroup=mb}else g.text(r+v/2,A+z/2,0,0,F,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,!1,"",null,!1,0)}}};Gb.prototype.destroy=function(){null!=this._curvedTextGroup&&null!=this._curvedTextGroup.parentNode&&this._curvedTextGroup.parentNode.removeChild(this._curvedTextGroup);this._curvedTextGroup=null;mxRectangleShape.prototype.destroy.apply(this,arguments)};mxCellRenderer.registerShape("curvedText",Gb);mxUtils.extend(Nb,mxActor);Nb.prototype.tabSize=8;Nb.prototype.tabInset=4;Nb.prototype.holeSize=1;Nb.prototype.isRoundable=function(){return!1};Nb.prototype.redrawPath=-function(g,r,A,u,z){r=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize))));var F=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"tabInset",this.tabInset))));A=(z-F)/2;F=A+F;g.moveTo(0,A);g.lineTo(0,F);g.lineTo(r,z);g.lineTo(u,z);g.lineTo(u,0);g.lineTo(r,0);g.close();g.end()};Nb.prototype.paintVertexShape=function(g,r,A,u,z){mxActor.prototype.paintVertexShape.apply(this,arguments);var F=Math.max(0,parseFloat(mxUtils.getValue(this.style,"holeSize",this.holeSize)));+function(g,r,A,v,z){r=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize))));var F=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"tabInset",this.tabInset))));A=(z-F)/2;F=A+F;g.moveTo(0,A);g.lineTo(0,F);g.lineTo(r,z);g.lineTo(v,z);g.lineTo(v,0);g.lineTo(r,0);g.close();g.end()};Nb.prototype.paintVertexShape=function(g,r,A,v,z){mxActor.prototype.paintVertexShape.apply(this,arguments);var F=Math.max(0,parseFloat(mxUtils.getValue(this.style,"holeSize",this.holeSize)));if(!(0>=F)){var I=parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize)),ea=mxUtils.getValue(this.style,"holeColor",mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"#333333"));g.setFillColor(ea);g.setStrokeColor(ea);g.begin();g.ellipse(I/2-F,z/2-F,2*F,2*F);g.fillAndStroke()}};Nb.prototype.getLabelBounds=function(g){var r=parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize))*this.scale;return new mxRectangle(g.x+r,g.y,g.width-r,g.height)};mxCellRenderer.registerShape("gitTag",-Nb);mxUtils.extend(Wb,mxShape);Wb.prototype.paintVertexShape=function(g,r,A,u,z){var F=mxUtils.getValue(this.style,"innerColor","#ECECFF");g.translate(r,A);g.ellipse(0,0,u,z);g.fillAndStroke();r=.6*Math.min(u,z);u=(u-r)/2;z=(z-r)/2;g.setFillColor(F);g.setStrokeColor(F);g.ellipse(u,z,r,r);g.fillAndStroke()};mxCellRenderer.registerShape("gitMergeCommit",Wb);mxUtils.extend(Yb,mxShape);Yb.prototype.paintVertexShape=function(g,r,A,u,z){var F=mxUtils.getValue(this.style,"featureColor","#fff");g.translate(r,-A);r=u/2;A=z/2;var I=Math.min(u,z)/20;g.ellipse(0,0,u,z);g.fillAndStroke();g.setFillColor(F);g.setStrokeColor(F);g.setStrokeWidth(0);u=2.75*I;g.ellipse(r-3*I-u,A+2*I-u,2*u,2*u);g.fillAndStroke();g.ellipse(r+3*I-u,A+2*I-u,2*u,2*u);g.fillAndStroke();g.setStrokeWidth(1*I);g.begin();g.moveTo(r+3*I,A+1*I);g.lineTo(r,A-5*I);g.stroke();g.begin();g.moveTo(r-3*I,A+1*I);g.lineTo(r,A-5*I);g.stroke()};mxCellRenderer.registerShape("gitCherryPick",Yb);mxUtils.extend(Ab,mxActor);Ab.prototype.isRoundable=function(){return!1};-Ab.prototype.redrawPath=function(g,r,A,u,z){r=.8*u;z*=.8;A=.15*r;u=.8*A;var F=.1*r,I=.1*z;g.moveTo(F,I);F+=.25*r;I+=.1*-z;g.arcTo(A,A,0,0,0,F,I);F+=.25*r;I+=0;g.arcTo(A,A,0,0,0,F,I);F+=.25*r;I+=0;g.arcTo(A,A,0,0,0,F,I);F+=.25*r;I+=.1*z;g.arcTo(A,A,0,0,0,F,I);F+=.15*r;I+=.33*z;g.arcTo(A,A,0,0,0,F,I);F+=0;I+=.34*z;g.arcTo(u,u,0,0,0,F,I);F+=.15*-r;I+=.33*z;g.arcTo(A,A,0,0,0,F,I);F+=.25*-r;I+=.15*z;g.arcTo(A,A,0,0,0,F,I);F+=.25*-r;I+=0;g.arcTo(A,A,0,0,0,F,I);F+=.25*-r;I+=0;g.arcTo(A,A,0,0,0,F,I);F+=.25*--r;I+=.15*-z;g.arcTo(A,A,0,0,0,F,I);F+=.1*-r;I+=.33*-z;g.arcTo(A,A,0,0,0,F,I);F+=0;I+=.34*-z;g.arcTo(u,u,0,0,0,F,I);g.arcTo(A,A,0,0,0,F+.1*r,I+.33*-z);g.close();g.end()};Ab.prototype.getLabelBounds=function(g){var r=.1*g.width,A=.1*g.height;return new mxRectangle(g.x+r,g.y+A,g.width-2*r,g.height-2*A)};mxCellRenderer.registerShape("mindmapBang",Ab);mxUtils.extend(D,mxActor);D.prototype.isRoundable=function(){return!1};D.prototype.redrawPath=function(g,r,A,u,z){g.moveTo(0,0);g.lineTo(0,z);g.quadTo(2*-u,z/2,0,0);g.close();g.end()};mxCellRenderer.registerShape("ishikawaHead",D);mxUtils.extend(M,mxActor);M.prototype.isRoundable=function(){return!1};M.prototype.redrawPath=function(g,r,A,u,z){r=z/4;g.moveTo(0,0);g.lineTo(r,z/2);g.lineTo(0,z);g.lineTo(u,z);g.lineTo(u,0);g.close();g.end()};M.prototype.getLabelBounds=function(g){var r=g.height/4;return new mxRectangle(g.x+r,g.y,g.width-r,g.height)};mxCellRenderer.registerShape("mermaidOdd",M);mxUtils.extend(N,mxActor);N.prototype.isRoundable=function(){return!1};-N.prototype.paintVertexShape=function(g,r,A,u,z){g.setLineJoin&&g.setLineJoin("round");mxActor.prototype.paintVertexShape.apply(this,arguments)};N.prototype.redrawPath=function(g,r,A,u,z){var F={};mxUtils.getValue(this.style,"dirs","right").split(/[,| ]+/).forEach(function(I){I=I.trim().toLowerCase();"x"===I?(F.right=!0,F.left=!0):"y"===I?(F.up=!0,F.down=!0):I&&(F[I]=!0)});A=parseFloat(mxUtils.getValue(this.style,"nodePadding","8"));r=z/2;A/=2;u=F.right&&F.left&&F.up&&F.down?[[0,0],[r,0],[u/2,2*A],-[u-r,0],[u,0],[u,-z/3],[u+2*A,-z/2],[u,-2*z/3],[u,-z],[u-r,-z],[u/2,-z-2*A],[r,-z],[0,-z],[0,-2*z/3],[-2*A,-z/2],[0,-z/3]]:F.right&&F.left&&F.up?[[r,0],[u-r,0],[u,-z/2],[u-r,-z],[r,-z],[0,-z/2]]:F.right&&F.left&&F.down?[[0,0],[r,-z],[u-r,-z],[u,0]]:F.right&&F.up&&F.down?[[0,0],[u,-r],[u,-z+r],[0,-z]]:F.left&&F.up&&F.down?[[u,0],[0,-r],[0,-z+r],[u,-z]]:F.right&&F.left?[[r,0],[r,-A],[u-r,-A],[u-r,0],[u,-z/2],[u-r,-z],[u-r,-z+A],[r,-z+A],[r,-z],[0,-z/2]]:F.up&&F.down?[[u/2,0],[0,-A],[r,-A],[r,-z+A],-[0,-z+A],[u/2,-z],[u,-z+A],[u-r,-z+A],[u-r,-A],[u,-A]]:F.right&&F.up?[[0,0],[u,-r],[0,-z]]:F.right&&F.down?[[0,0],[u,0],[0,-z]]:F.left&&F.up?[[u,0],[0,-r],[u,-z]]:F.left&&F.down?[[u,0],[0,0],[u,-z]]:F.right?[[r,-A],[u-r,-A],[u-r,0],[u,-z/2],[u-r,-z],[u-r,-z+A],[r,-z+A]]:F.left?[[r,0],[r,-A],[u-r,-A],[u-r,-z+A],[r,-z+A],[r,-z],[0,-z/2]]:F.up?[[r,-A],[r,-z+A],[0,-z+A],[u/2,-z],[u,-z+A],[u-r,-z+A],[u-r,-A]]:F.down?[[u/2,0],[0,-A],[r,-A],[r,-z+A],[u-r,-z+A],[u-r,-A],[u,-A]]:[[0,0],[u,0],[u,-z],[0,-z]];-g.moveTo(u[0][0],z+u[0][1]);for(r=1;r<u.length;r++)g.lineTo(u[r][0],z+u[r][1]);g.close();g.end()};mxCellRenderer.registerShape("mermaidBlockArrow",N);mxUtils.extend(W,mxConnector);W.prototype.defaultWidth=10;W.prototype.getEdgeWidth=function(){return Math.max(1,mxUtils.getNumber(this.style,"width",this.defaultWidth))};W.prototype.getSvgScreenOffset=function(){return 0};W.prototype.augmentBoundingBox=function(g){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var r=(this.getEdgeWidth()/-2+this.strokewidth)*this.scale;g.y-=r;g.height+=2*r};W.prototype.paintEdgeShape=function(g,r){var A=r[0],u=r[r.length-1];if(null!=A&&null!=u){r=A.x;A=A.y;var z=u.x;u=u.y;for(var F=(r+z)/2,I=this.getEdgeWidth()/2,ea=[],S=[],ta=0;32>=ta;ta++){var oa=ta/32,Ia=1-oa,mb=Ia*Ia*Ia*r+3*Ia*Ia*oa*F+3*Ia*oa*oa*F+oa*oa*oa*z,$a=Ia*Ia*Ia*A+3*Ia*Ia*oa*A+3*Ia*oa*oa*u+oa*oa*oa*u,Ea=3*Ia*Ia*(F-r)+3*oa*oa*(z-F);Ia=6*Ia*oa*(u-A);oa=Math.sqrt(Ea*Ea+Ia*Ia);0==oa&&(Ea=1,Ia=0,oa=1);Ia=-Ia/oa*I;Ea=Ea/oa*I;ea.push(new mxPoint(mb++Nb);mxUtils.extend(Wb,mxShape);Wb.prototype.paintVertexShape=function(g,r,A,v,z){var F=mxUtils.getValue(this.style,"innerColor","#ECECFF");g.translate(r,A);g.ellipse(0,0,v,z);g.fillAndStroke();r=.6*Math.min(v,z);v=(v-r)/2;z=(z-r)/2;g.setFillColor(F);g.setStrokeColor(F);g.ellipse(v,z,r,r);g.fillAndStroke()};mxCellRenderer.registerShape("gitMergeCommit",Wb);mxUtils.extend(Yb,mxShape);Yb.prototype.paintVertexShape=function(g,r,A,v,z){var F=mxUtils.getValue(this.style,"featureColor","#fff");g.translate(r,+A);r=v/2;A=z/2;var I=Math.min(v,z)/20;g.ellipse(0,0,v,z);g.fillAndStroke();g.setFillColor(F);g.setStrokeColor(F);g.setStrokeWidth(0);v=2.75*I;g.ellipse(r-3*I-v,A+2*I-v,2*v,2*v);g.fillAndStroke();g.ellipse(r+3*I-v,A+2*I-v,2*v,2*v);g.fillAndStroke();g.setStrokeWidth(1*I);g.begin();g.moveTo(r+3*I,A+1*I);g.lineTo(r,A-5*I);g.stroke();g.begin();g.moveTo(r-3*I,A+1*I);g.lineTo(r,A-5*I);g.stroke()};mxCellRenderer.registerShape("gitCherryPick",Yb);mxUtils.extend(Ab,mxActor);Ab.prototype.isRoundable=function(){return!1};+Ab.prototype.redrawPath=function(g,r,A,v,z){r=.8*v;z*=.8;A=.15*r;v=.8*A;var F=.1*r,I=.1*z;g.moveTo(F,I);F+=.25*r;I+=.1*-z;g.arcTo(A,A,0,0,0,F,I);F+=.25*r;I+=0;g.arcTo(A,A,0,0,0,F,I);F+=.25*r;I+=0;g.arcTo(A,A,0,0,0,F,I);F+=.25*r;I+=.1*z;g.arcTo(A,A,0,0,0,F,I);F+=.15*r;I+=.33*z;g.arcTo(A,A,0,0,0,F,I);F+=0;I+=.34*z;g.arcTo(v,v,0,0,0,F,I);F+=.15*-r;I+=.33*z;g.arcTo(A,A,0,0,0,F,I);F+=.25*-r;I+=.15*z;g.arcTo(A,A,0,0,0,F,I);F+=.25*-r;I+=0;g.arcTo(A,A,0,0,0,F,I);F+=.25*-r;I+=0;g.arcTo(A,A,0,0,0,F,I);F+=.25*+-r;I+=.15*-z;g.arcTo(A,A,0,0,0,F,I);F+=.1*-r;I+=.33*-z;g.arcTo(A,A,0,0,0,F,I);F+=0;I+=.34*-z;g.arcTo(v,v,0,0,0,F,I);g.arcTo(A,A,0,0,0,F+.1*r,I+.33*-z);g.close();g.end()};Ab.prototype.getLabelBounds=function(g){var r=.1*g.width,A=.1*g.height;return new mxRectangle(g.x+r,g.y+A,g.width-2*r,g.height-2*A)};mxCellRenderer.registerShape("mindmapBang",Ab);mxUtils.extend(D,mxActor);D.prototype.isRoundable=function(){return!1};D.prototype.redrawPath=function(g,r,A,v,z){g.moveTo(0,0);g.lineTo(0,z);g.quadTo(2*+v,z/2,0,0);g.close();g.end()};mxCellRenderer.registerShape("ishikawaHead",D);mxUtils.extend(M,mxActor);M.prototype.isRoundable=function(){return!1};M.prototype.redrawPath=function(g,r,A,v,z){r=z/4;g.moveTo(0,0);g.lineTo(r,z/2);g.lineTo(0,z);g.lineTo(v,z);g.lineTo(v,0);g.close();g.end()};M.prototype.getLabelBounds=function(g){var r=g.height/4;return new mxRectangle(g.x+r,g.y,g.width-r,g.height)};mxCellRenderer.registerShape("mermaidOdd",M);mxUtils.extend(N,mxActor);N.prototype.isRoundable=function(){return!1};+N.prototype.paintVertexShape=function(g,r,A,v,z){g.setLineJoin&&g.setLineJoin("round");mxActor.prototype.paintVertexShape.apply(this,arguments)};N.prototype.redrawPath=function(g,r,A,v,z){var F={};mxUtils.getValue(this.style,"dirs","right").split(/[,| ]+/).forEach(function(I){I=I.trim().toLowerCase();"x"===I?(F.right=!0,F.left=!0):"y"===I?(F.up=!0,F.down=!0):I&&(F[I]=!0)});A=parseFloat(mxUtils.getValue(this.style,"nodePadding","8"));r=z/2;A/=2;v=F.right&&F.left&&F.up&&F.down?[[0,0],[r,0],[v/2,2*A],+[v-r,0],[v,0],[v,-z/3],[v+2*A,-z/2],[v,-2*z/3],[v,-z],[v-r,-z],[v/2,-z-2*A],[r,-z],[0,-z],[0,-2*z/3],[-2*A,-z/2],[0,-z/3]]:F.right&&F.left&&F.up?[[r,0],[v-r,0],[v,-z/2],[v-r,-z],[r,-z],[0,-z/2]]:F.right&&F.left&&F.down?[[0,0],[r,-z],[v-r,-z],[v,0]]:F.right&&F.up&&F.down?[[0,0],[v,-r],[v,-z+r],[0,-z]]:F.left&&F.up&&F.down?[[v,0],[0,-r],[0,-z+r],[v,-z]]:F.right&&F.left?[[r,0],[r,-A],[v-r,-A],[v-r,0],[v,-z/2],[v-r,-z],[v-r,-z+A],[r,-z+A],[r,-z],[0,-z/2]]:F.up&&F.down?[[v/2,0],[0,-A],[r,-A],[r,-z+A],+[0,-z+A],[v/2,-z],[v,-z+A],[v-r,-z+A],[v-r,-A],[v,-A]]:F.right&&F.up?[[0,0],[v,-r],[0,-z]]:F.right&&F.down?[[0,0],[v,0],[0,-z]]:F.left&&F.up?[[v,0],[0,-r],[v,-z]]:F.left&&F.down?[[v,0],[0,0],[v,-z]]:F.right?[[r,-A],[v-r,-A],[v-r,0],[v,-z/2],[v-r,-z],[v-r,-z+A],[r,-z+A]]:F.left?[[r,0],[r,-A],[v-r,-A],[v-r,-z+A],[r,-z+A],[r,-z],[0,-z/2]]:F.up?[[r,-A],[r,-z+A],[0,-z+A],[v/2,-z],[v,-z+A],[v-r,-z+A],[v-r,-A]]:F.down?[[v/2,0],[0,-A],[r,-A],[r,-z+A],[v-r,-z+A],[v-r,-A],[v,-A]]:[[0,0],[v,0],[v,-z],[0,-z]];+g.moveTo(v[0][0],z+v[0][1]);for(r=1;r<v.length;r++)g.lineTo(v[r][0],z+v[r][1]);g.close();g.end()};mxCellRenderer.registerShape("mermaidBlockArrow",N);mxUtils.extend(W,mxConnector);W.prototype.defaultWidth=10;W.prototype.getEdgeWidth=function(){return Math.max(1,mxUtils.getNumber(this.style,"width",this.defaultWidth))};W.prototype.getSvgScreenOffset=function(){return 0};W.prototype.augmentBoundingBox=function(g){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var r=(this.getEdgeWidth()/+2+this.strokewidth)*this.scale;g.y-=r;g.height+=2*r};W.prototype.paintEdgeShape=function(g,r){var A=r[0],v=r[r.length-1];if(null!=A&&null!=v){r=A.x;A=A.y;var z=v.x;v=v.y;for(var F=(r+z)/2,I=this.getEdgeWidth()/2,ea=[],S=[],ta=0;32>=ta;ta++){var oa=ta/32,Ia=1-oa,mb=Ia*Ia*Ia*r+3*Ia*Ia*oa*F+3*Ia*oa*oa*F+oa*oa*oa*z,$a=Ia*Ia*Ia*A+3*Ia*Ia*oa*A+3*Ia*oa*oa*v+oa*oa*oa*v,Ea=3*Ia*Ia*(F-r)+3*oa*oa*(z-F);Ia=6*Ia*oa*(v-A);oa=Math.sqrt(Ea*Ea+Ia*Ia);0==oa&&(Ea=1,Ia=0,oa=1);Ia=-Ia/oa*I;Ea=Ea/oa*I;ea.push(new mxPoint(mb+Ia,$a+Ea));S.push(new mxPoint(mb-Ia,$a-Ea))}g.begin();g.moveTo(ea[0].x,ea[0].y);for(ta=1;32>=ta;ta++)g.lineTo(ea[ta].x,ea[ta].y);for(ta=32;0<=ta;ta--)g.lineTo(S[ta].x,S[ta].y);g.close();r=g.node;g.fillAndStroke();null!=r&&null!=r.setAttribute&&null!=r.parentNode&&(g=r.getAttribute("style"),r.setAttribute("style",(null!=g&&""!=g?g+";":"")+"mix-blend-mode:multiply"))}};mxCellRenderer.registerShape("mermaidSankeyLink",W);if("undefined"!==typeof mxVertexHandler){var ob=function(g,r,A){return cb(g,["width"],-r,function(u,z,F,I,ea){ea=g.shape.getEdgeWidth()*g.view.scale+A;return new mxPoint(I.x+z*u/4+F*ea/2,I.y+F*u/4-z*ea/2)},function(u,z,F,I,ea,S){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));g.style.width=Math.round(Math.round(2*u)/g.view.scale-A)})},cb=function(g,r,A,u,z){return vb(g,r,function(F){var I=g.absolutePoints;if(null!=I&&0<I.length){var ea=I.length-1;F=g.view.translate;var S=g.view.scale,ta=A?I[0]:I[ea];I=A?I[1]:I[ea-1];ea=I.x-ta.x;var oa=I.y-ta.y,Ia=Math.sqrt(ea*ea+oa*oa);-ta=u.call(this,Ia,ea/Ia,oa/Ia,ta,I);return new mxPoint(ta.x/S-F.x,ta.y/S-F.y)}return null},function(F,I,ea){var S=g.absolutePoints,ta=S.length-1;F=g.view.translate;var oa=g.view.scale,Ia=A?S[0]:S[ta];S=A?S[1]:S[ta-1];ta=S.x-Ia.x;var mb=S.y-Ia.y,$a=Math.sqrt(ta*ta+mb*mb);I.x=(I.x+F.x)*oa;I.y=(I.y+F.y)*oa;z.call(this,$a,ta/$a,mb/$a,Ia,S,I,ea)})},fb=function(g,r){return function(A){return[cb(A,["startWidth"],!0,function(u,z,F,I,ea){ea=mxUtils.getNumber(A.style,"startWidth",g)*A.view.scale+r;return new mxPoint(I.x+-z*u/4+F*ea/2,I.y+F*u/4-z*ea/2)},function(u,z,F,I,ea,S){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));A.style.startWidth=Math.round(2*u)/A.view.scale-r})]}},Xa=function(g){return function(r){return[vb(r,["arrowWidth","arrowSize"],function(A){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Va.prototype.arrowWidth))),z=Math.max(0,Math.min(g,mxUtils.getValue(this.state.style,"arrowSize",Va.prototype.arrowSize)));return new mxPoint(A.x+(1-z)*A.width,A.y+(1-u)*A.height/-2)},function(A,u){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(A.y+A.height/2-u.y)/A.height*2));this.state.style.arrowSize=Math.max(0,Math.min(g,(A.x+A.width-u.x)/A.width))})]}},wb=function(g){return function(r){return[vb(r,["size"],function(A){var u=Math.max(0,Math.min(.5*A.height,parseFloat(mxUtils.getValue(this.state.style,"size",g))));return new mxPoint(A.x,A.y+u)},function(A,u){this.state.style.size=Math.max(0,u.y-A.y)},!0)]}},sb=function(g,r,A){return function(u){var z=[vb(u,["size"],-function(F){var I=Math.max(0,Math.min(F.width,Math.min(F.height,parseFloat(mxUtils.getValue(this.state.style,"size",r)))))*g;return new mxPoint(F.x+I,F.y+I)},function(F,I){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(F.width,I.x-F.x),Math.min(F.height,I.y-F.y)))/g)},!1)];A&&mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&z.push(Jb(u));return z}},qb=function(g,r,A,u,z){A=null!=A?A:.5;return function(F){var I=[vb(F,["size"],function(ea){var S=null!=z?"0"!=mxUtils.getValue(this.state.style,-"fixedSize","0"):null,ta=parseFloat(mxUtils.getValue(this.state.style,"size",S?z:g));return new mxPoint(ea.x+Math.max(0,Math.min(.5*ea.width,ta*(S?1:ea.width))),ea.getCenterY())},function(ea,S,ta){ea=null!=z&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?S.x-ea.x:Math.max(0,Math.min(A,(S.x-ea.x)/ea.width));this.state.style.size=ea},!1,u)];r&&mxUtils.getValue(F.style,mxConstants.STYLE_ROUNDED,!1)&&I.push(Jb(F));return I}},zb=function(g,r,A){g=null!=g?g:.5;return function(u){var z=[vb(u,["size"],-function(F){var I=null!=A?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,ea=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",I?A:r)));return new mxPoint(F.x+Math.min(.75*F.width*g,ea*(I?.75:.75*F.width)),F.y+F.height/4)},function(F,I){F=null!=A&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?I.x-F.x:Math.max(0,Math.min(g,(I.x-F.x)/F.width*.75));this.state.style.size=F},!1,!0)];mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&z.push(Jb(u));return z}},Fb=-function(){return function(g){var r=[];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r}},Jb=function(g,r){return vb(g,[mxConstants.STYLE_ARCSIZE],function(A){var u=null!=r?r:A.height/8;if("1"==mxUtils.getValue(g.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var z=mxUtils.getValue(g.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(A.x+A.width-Math.min(A.width/2,z),A.y+u)}z=Math.max(0,parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_ARCSIZE,-100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(A.x+A.width-Math.min(Math.max(A.width/2,A.height/2),Math.min(A.width,A.height)*z),A.y+u)},function(A,u,z){"1"==mxUtils.getValue(g.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(A.width,2*(A.x+A.width-u.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(A.width-u.x+A.x)/Math.min(A.width,A.height))))})},vb=function(g,r,A,u,-z,F,I){var ea=new mxHandle(g,null,mxVertexHandler.prototype.secondaryHandleImage);ea.execute=function(ta){for(var oa=0;oa<r.length;oa++)this.copyStyle(r[oa]);I&&I(ta)};ea.getPosition=A;ea.setPosition=u;ea.ignoreGrid=null!=z?z:!0;if(F){var S=ea.positionChanged;ea.positionChanged=function(){S.apply(this,arguments);g.view.invalidate(this.state.cell);g.view.validate()}}return ea},Eb={link:function(g){return[ob(g,!0,10),ob(g,!1,10)]},pipe:function(g){return[ob(g,!0,10),ob(g,!1,10)]},flexArrow:function(g){var r=-g.view.graph.gridSize/g.view.scale,A=[];mxUtils.getValue(g.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(A.push(cb(g,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(u,z,F,I,ea){u=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;ea=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+z*(ea+g.shape.strokewidth*g.view.scale)+F*u/2,I.y+F*(ea+g.shape.strokewidth*g.view.scale)--z*u/2)},function(u,z,F,I,ea,S,ta){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));z=mxUtils.ptLineDist(I.x,I.y,I.x+F,I.y-z,S.x,S.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((z-g.shape.strokewidth)/3/g.view.scale);g.style.width=Math.round(2*u/g.view.scale);if(mxEvent.isShiftDown(ta.getEvent())||mxEvent.isControlDown(ta.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE];mxEvent.isAltDown(ta.getEvent())||Math.abs(parseFloat(g.style[mxConstants.STYLE_STARTSIZE])--parseFloat(g.style[mxConstants.STYLE_ENDSIZE]))<r/6&&(g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE])})),A.push(cb(g,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(u,z,F,I,ea){u=(g.shape.getStartArrowWidth()-g.shape.strokewidth)*g.view.scale;ea=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+z*(ea+g.shape.strokewidth*g.view.scale)+F*u/2,I.y+F*(ea+g.shape.strokewidth*-g.view.scale)-z*u/2)},function(u,z,F,I,ea,S,ta){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));z=mxUtils.ptLineDist(I.x,I.y,I.x+F,I.y-z,S.x,S.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((z-g.shape.strokewidth)/3/g.view.scale);g.style.startWidth=Math.round(Math.max(0,Math.round(2*u)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(ta.getEvent())||mxEvent.isControlDown(ta.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE],g.style.endWidth=+r,function(v,z,F,I,ea){ea=g.shape.getEdgeWidth()*g.view.scale+A;return new mxPoint(I.x+z*v/4+F*ea/2,I.y+F*v/4-z*ea/2)},function(v,z,F,I,ea,S){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));g.style.width=Math.round(Math.round(2*v)/g.view.scale-A)})},cb=function(g,r,A,v,z){return vb(g,r,function(F){var I=g.absolutePoints;if(null!=I&&0<I.length){var ea=I.length-1;F=g.view.translate;var S=g.view.scale,ta=A?I[0]:I[ea];I=A?I[1]:I[ea-1];ea=I.x-ta.x;var oa=I.y-ta.y,Ia=Math.sqrt(ea*ea+oa*oa);+ta=v.call(this,Ia,ea/Ia,oa/Ia,ta,I);return new mxPoint(ta.x/S-F.x,ta.y/S-F.y)}return null},function(F,I,ea){var S=g.absolutePoints,ta=S.length-1;F=g.view.translate;var oa=g.view.scale,Ia=A?S[0]:S[ta];S=A?S[1]:S[ta-1];ta=S.x-Ia.x;var mb=S.y-Ia.y,$a=Math.sqrt(ta*ta+mb*mb);I.x=(I.x+F.x)*oa;I.y=(I.y+F.y)*oa;z.call(this,$a,ta/$a,mb/$a,Ia,S,I,ea)})},fb=function(g,r){return function(A){return[cb(A,["startWidth"],!0,function(v,z,F,I,ea){ea=mxUtils.getNumber(A.style,"startWidth",g)*A.view.scale+r;return new mxPoint(I.x++z*v/4+F*ea/2,I.y+F*v/4-z*ea/2)},function(v,z,F,I,ea,S){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));A.style.startWidth=Math.round(2*v)/A.view.scale-r})]}},Xa=function(g){return function(r){return[vb(r,["arrowWidth","arrowSize"],function(A){var v=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Va.prototype.arrowWidth))),z=Math.max(0,Math.min(g,mxUtils.getValue(this.state.style,"arrowSize",Va.prototype.arrowSize)));return new mxPoint(A.x+(1-z)*A.width,A.y+(1-v)*A.height/+2)},function(A,v){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(A.y+A.height/2-v.y)/A.height*2));this.state.style.arrowSize=Math.max(0,Math.min(g,(A.x+A.width-v.x)/A.width))})]}},wb=function(g){return function(r){return[vb(r,["size"],function(A){var v=Math.max(0,Math.min(.5*A.height,parseFloat(mxUtils.getValue(this.state.style,"size",g))));return new mxPoint(A.x,A.y+v)},function(A,v){this.state.style.size=Math.max(0,v.y-A.y)},!0)]}},sb=function(g,r,A){return function(v){var z=[vb(v,["size"],+function(F){var I=Math.max(0,Math.min(F.width,Math.min(F.height,parseFloat(mxUtils.getValue(this.state.style,"size",r)))))*g;return new mxPoint(F.x+I,F.y+I)},function(F,I){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(F.width,I.x-F.x),Math.min(F.height,I.y-F.y)))/g)},!1)];A&&mxUtils.getValue(v.style,mxConstants.STYLE_ROUNDED,!1)&&z.push(Jb(v));return z}},qb=function(g,r,A,v,z){A=null!=A?A:.5;return function(F){var I=[vb(F,["size"],function(ea){var S=null!=z?"0"!=mxUtils.getValue(this.state.style,+"fixedSize","0"):null,ta=parseFloat(mxUtils.getValue(this.state.style,"size",S?z:g));return new mxPoint(ea.x+Math.max(0,Math.min(.5*ea.width,ta*(S?1:ea.width))),ea.getCenterY())},function(ea,S,ta){ea=null!=z&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?S.x-ea.x:Math.max(0,Math.min(A,(S.x-ea.x)/ea.width));this.state.style.size=ea},!1,v)];r&&mxUtils.getValue(F.style,mxConstants.STYLE_ROUNDED,!1)&&I.push(Jb(F));return I}},zb=function(g,r,A){g=null!=g?g:.5;return function(v){var z=[vb(v,["size"],+function(F){var I=null!=A?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,ea=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",I?A:r)));return new mxPoint(F.x+Math.min(.75*F.width*g,ea*(I?.75:.75*F.width)),F.y+F.height/4)},function(F,I){F=null!=A&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?I.x-F.x:Math.max(0,Math.min(g,(I.x-F.x)/F.width*.75));this.state.style.size=F},!1,!0)];mxUtils.getValue(v.style,mxConstants.STYLE_ROUNDED,!1)&&z.push(Jb(v));return z}},Fb=+function(){return function(g){var r=[];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r}},Jb=function(g,r){return vb(g,[mxConstants.STYLE_ARCSIZE],function(A){var v=null!=r?r:A.height/8;if("1"==mxUtils.getValue(g.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var z=mxUtils.getValue(g.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(A.x+A.width-Math.min(A.width/2,z),A.y+v)}z=Math.max(0,parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_ARCSIZE,+100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(A.x+A.width-Math.min(Math.max(A.width/2,A.height/2),Math.min(A.width,A.height)*z),A.y+v)},function(A,v,z){"1"==mxUtils.getValue(g.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(A.width,2*(A.x+A.width-v.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(A.width-v.x+A.x)/Math.min(A.width,A.height))))})},vb=function(g,r,A,v,+z,F,I){var ea=new mxHandle(g,null,mxVertexHandler.prototype.secondaryHandleImage);ea.execute=function(ta){for(var oa=0;oa<r.length;oa++)this.copyStyle(r[oa]);I&&I(ta)};ea.getPosition=A;ea.setPosition=v;ea.ignoreGrid=null!=z?z:!0;if(F){var S=ea.positionChanged;ea.positionChanged=function(){S.apply(this,arguments);g.view.invalidate(this.state.cell);g.view.validate()}}return ea},Eb={link:function(g){return[ob(g,!0,10),ob(g,!1,10)]},pipe:function(g){return[ob(g,!0,10),ob(g,!1,10)]},flexArrow:function(g){var r=+g.view.graph.gridSize/g.view.scale,A=[];mxUtils.getValue(g.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(A.push(cb(g,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(v,z,F,I,ea){v=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;ea=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+z*(ea+g.shape.strokewidth*g.view.scale)+F*v/2,I.y+F*(ea+g.shape.strokewidth*g.view.scale)-+z*v/2)},function(v,z,F,I,ea,S,ta){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));z=mxUtils.ptLineDist(I.x,I.y,I.x+F,I.y-z,S.x,S.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((z-g.shape.strokewidth)/3/g.view.scale);g.style.width=Math.round(2*v/g.view.scale);if(mxEvent.isShiftDown(ta.getEvent())||mxEvent.isControlDown(ta.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE];mxEvent.isAltDown(ta.getEvent())||Math.abs(parseFloat(g.style[mxConstants.STYLE_STARTSIZE])-+parseFloat(g.style[mxConstants.STYLE_ENDSIZE]))<r/6&&(g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE])})),A.push(cb(g,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(v,z,F,I,ea){v=(g.shape.getStartArrowWidth()-g.shape.strokewidth)*g.view.scale;ea=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+z*(ea+g.shape.strokewidth*g.view.scale)+F*v/2,I.y+F*(ea+g.shape.strokewidth*+g.view.scale)-z*v/2)},function(v,z,F,I,ea,S,ta){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));z=mxUtils.ptLineDist(I.x,I.y,I.x+F,I.y-z,S.x,S.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((z-g.shape.strokewidth)/3/g.view.scale);g.style.startWidth=Math.round(Math.max(0,Math.round(2*v)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(ta.getEvent())||mxEvent.isControlDown(ta.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE],g.style.endWidth=g.style.startWidth;mxEvent.isAltDown(ta.getEvent())||(Math.abs(parseFloat(g.style[mxConstants.STYLE_STARTSIZE])-parseFloat(g.style[mxConstants.STYLE_ENDSIZE]))<r/6&&(g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(g.style.startWidth)-parseFloat(g.style.endWidth))<r&&(g.style.startWidth=g.style.endWidth))})));mxUtils.getValue(g.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(A.push(cb(g,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],-!1,function(u,z,F,I,ea){u=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;ea=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+z*(ea+g.shape.strokewidth*g.view.scale)-F*u/2,I.y+F*(ea+g.shape.strokewidth*g.view.scale)+z*u/2)},function(u,z,F,I,ea,S,ta){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));z=mxUtils.ptLineDist(I.x,I.y,I.x+F,I.y-z,S.x,S.y);g.style[mxConstants.STYLE_ENDSIZE]=Math.round((z-g.shape.strokewidth)/-3/g.view.scale);g.style.width=Math.round(2*u/g.view.scale);if(mxEvent.isShiftDown(ta.getEvent())||mxEvent.isControlDown(ta.getEvent()))g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(ta.getEvent())||Math.abs(parseFloat(g.style[mxConstants.STYLE_ENDSIZE])-parseFloat(g.style[mxConstants.STYLE_STARTSIZE]))<r/6&&(g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE])})),A.push(cb(g,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],-!1,function(u,z,F,I,ea){u=(g.shape.getEndArrowWidth()-g.shape.strokewidth)*g.view.scale;ea=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+z*(ea+g.shape.strokewidth*g.view.scale)-F*u/2,I.y+F*(ea+g.shape.strokewidth*g.view.scale)+z*u/2)},function(u,z,F,I,ea,S,ta){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));z=mxUtils.ptLineDist(I.x,I.y,I.x+F,I.y-z,S.x,S.y);g.style[mxConstants.STYLE_ENDSIZE]=Math.round((z-g.shape.strokewidth)/-3/g.view.scale);g.style.endWidth=Math.round(Math.max(0,Math.round(2*u)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(ta.getEvent())||mxEvent.isControlDown(ta.getEvent()))g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE],g.style.startWidth=g.style.endWidth;mxEvent.isAltDown(ta.getEvent())||(Math.abs(parseFloat(g.style[mxConstants.STYLE_ENDSIZE])-parseFloat(g.style[mxConstants.STYLE_STARTSIZE]))<r/6&&(g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE]),-Math.abs(parseFloat(g.style.endWidth)-parseFloat(g.style.startWidth))<r&&(g.style.endWidth=g.style.startWidth))})));return A},swimlane:function(g){var r=[];if(mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED)){var A=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));r.push(Jb(g,A/2))}r.push(vb(g,[mxConstants.STYLE_STARTSIZE],function(u){var z=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(g.style,-mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(u.getCenterX(),u.y+Math.max(0,Math.min(u.height,z))):new mxPoint(u.x+Math.max(0,Math.min(u.width,z)),u.getCenterY())},function(u,z){g.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(u.height,z.y-u.y))):Math.round(Math.max(0,Math.min(u.width,z.x-u.x)))},!1,null,function(u){var z=g.view.graph;if(!mxEvent.isShiftDown(u.getEvent())&&!mxEvent.isControlDown(u.getEvent())&&(z.isTableRow(g.cell)||-z.isTableCell(g.cell))){u=z.getSwimlaneDirection(g.style);var F=z.model.getParent(g.cell);F=z.model.getChildCells(F,!0);for(var I=[],ea=0;ea<F.length;ea++)F[ea]!=g.cell&&z.isSwimlane(F[ea])&&z.getSwimlaneDirection(z.getCurrentCellStyle(F[ea]))==u&&I.push(F[ea]);z.setCellStyles(mxConstants.STYLE_STARTSIZE,g.style[mxConstants.STYLE_STARTSIZE],I)}}));return r},label:Fb(),ext:Fb(),rectangle:Fb(),triangle:Fb(),rhombus:Fb(),umlLifeline:function(g){return[vb(g,["size"],function(r){var A=Math.max(0,Math.min(r.height,-parseFloat(mxUtils.getValue(this.state.style,"size",za.prototype.size))));return new mxPoint(r.getCenterX(),r.y+A)},function(r,A){this.state.style.size=Math.round(Math.max(0,Math.min(r.height,A.y-r.y)))},!1)]},umlFrame:function(g){return[vb(g,["width","height"],function(r){var A=Math.max(sa.prototype.corner,Math.min(r.width,mxUtils.getValue(this.state.style,"width",sa.prototype.width))),u=Math.max(1.5*sa.prototype.corner,Math.min(r.height,mxUtils.getValue(this.state.style,"height",sa.prototype.height)));-return new mxPoint(r.x+A,r.y+u)},function(r,A){this.state.style.width=Math.round(Math.max(sa.prototype.corner,Math.min(r.width,A.x-r.x)));this.state.style.height=Math.round(Math.max(1.5*sa.prototype.corner,Math.min(r.height,A.y-r.y)))},!1)]},process:function(g){var r=[vb(g,["size"],function(A){var u="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),z=parseFloat(mxUtils.getValue(this.state.style,"size",ba.prototype.size));return u?new mxPoint(A.x+z,A.y+A.height/4):new mxPoint(A.x+A.width*z,A.y+-A.height/4)},function(A,u){A="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(.5*A.width,u.x-A.x)):Math.max(0,Math.min(.5,(u.x-A.x)/A.width));this.state.style.size=A},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r},cross:function(g){return[vb(g,["size"],function(r){var A=Math.min(r.width,r.height);A=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",Ub.prototype.size)))*A/2;return new mxPoint(r.getCenterX()-A,r.getCenterY()--A)},function(r,A){var u=Math.min(r.width,r.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,r.getCenterY()-A.y)/u*2,Math.max(0,r.getCenterX()-A.x)/u*2)))})]},note:function(g){return[vb(g,["size"],function(r){var A=Math.max(0,Math.min(r.width,Math.min(r.height,parseFloat(mxUtils.getValue(this.state.style,"size",G.prototype.size)))));return new mxPoint(r.x+r.width-A,r.y+A)},function(r,A){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(r.width,r.x+r.width-A.x),Math.min(r.height,-A.y-r.y))))})]},note2:function(g){return[vb(g,["size"],function(r){var A=Math.max(0,Math.min(r.width,Math.min(r.height,parseFloat(mxUtils.getValue(this.state.style,"size",O.prototype.size)))));return new mxPoint(r.x+r.width-A,r.y+A)},function(r,A){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(r.width,r.x+r.width-A.x),Math.min(r.height,A.y-r.y))))})]},manualInput:function(g){var r=[vb(g,["size"],function(A){var u=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"size",-Ba.prototype.size)));return new mxPoint(A.x+A.width/4,A.y+3*u/4)},function(A,u){this.state.style.size=Math.round(Math.max(0,Math.min(A.height,4*(u.y-A.y)/3)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r},dataStorage:function(g){return[vb(g,["size"],function(r){var A="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),u=parseFloat(mxUtils.getValue(this.state.style,"size",A?bb.prototype.fixedSize:bb.prototype.size));return new mxPoint(r.x+r.width-u*(A?1:-r.width),r.getCenterY())},function(r,A){r="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(r.width,r.x+r.width-A.x)):Math.max(0,Math.min(1,(r.x+r.width-A.x)/r.width));this.state.style.size=r},!1)]},callout:function(g){var r=[vb(g,["size","position"],function(A){var u=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"size",qa.prototype.size))),z=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",qa.prototype.position)));mxUtils.getValue(this.state.style,-"base",qa.prototype.base);return new mxPoint(A.x+z*A.width,A.y+A.height-u)},function(A,u){mxUtils.getValue(this.state.style,"base",qa.prototype.base);this.state.style.size=Math.round(Math.max(0,Math.min(A.height,A.y+A.height-u.y)));this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(u.x-A.x)/A.width)))/100},!1),vb(g,["position2"],function(A){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",qa.prototype.position2)));return new mxPoint(A.x+u*A.width,A.y+A.height)},-function(A,u){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,(u.x-A.x)/A.width)))/100},!1),vb(g,["base"],function(A){var u=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"size",qa.prototype.size))),z=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",qa.prototype.position))),F=Math.max(0,Math.min(A.width,mxUtils.getValue(this.state.style,"base",qa.prototype.base)));return new mxPoint(A.x+Math.min(A.width,z*A.width+F),A.y+A.height-u)},function(A,u){var z=-Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",qa.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(A.width,u.x-A.x-z*A.width)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r},internalStorage:function(g){var r=[vb(g,["dx","dy"],function(A){var u=Math.max(0,Math.min(A.width,mxUtils.getValue(this.state.style,"dx",Ka.prototype.dx))),z=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"dy",Ka.prototype.dy)));-return new mxPoint(A.x+u,A.y+z)},function(A,u){this.state.style.dx=Math.round(Math.max(0,Math.min(A.width,u.x-A.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(A.height,u.y-A.y)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r},module:function(g){return[vb(g,["jettyWidth","jettyHeight"],function(r){var A=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"jettyWidth",Na.prototype.jettyWidth))),u=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,-"jettyHeight",Na.prototype.jettyHeight)));return new mxPoint(r.x+A/2,r.y+2*u)},function(r,A){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(r.width,A.x-r.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(r.height,A.y-r.y))/2)})]},corner:function(g){return[vb(g,["dx","dy"],function(r){var A=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",ab.prototype.dx))),u=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",ab.prototype.dy)));return new mxPoint(r.x+-A,r.y+u)},function(r,A){this.state.style.dx=Math.round(Math.max(0,Math.min(r.width,A.x-r.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(r.height,A.y-r.y)))},!1)]},tee:function(g){return[vb(g,["dx","dy"],function(r){var A=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",db.prototype.dx))),u=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",db.prototype.dy)));return new mxPoint(r.x+(r.width+A)/2,r.y+u)},function(r,A){this.state.style.dx=Math.round(Math.max(0,-2*Math.min(r.width/2,A.x-r.x-r.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(r.height,A.y-r.y)))},!1)]},singleArrow:Xa(1),doubleArrow:Xa(.5),"mxgraph.arrows2.wedgeArrow":fb(20,20),"mxgraph.arrows2.wedgeArrowDashed":fb(20,20),"mxgraph.arrows2.wedgeArrowDashed2":fb(20,20),folder:function(g){return[vb(g,["tabWidth","tabHeight"],function(r){var A=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"tabWidth",q.prototype.tabWidth))),u=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,-"tabHeight",q.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(A=r.width-A);return new mxPoint(r.x+A,r.y+u)},function(r,A){var u=Math.max(0,Math.min(r.width,A.x-r.x));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(u=r.width-u);this.state.style.tabWidth=Math.round(u);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(r.height,A.y-r.y)))},!1)]},document:function(g){return[vb(g,+!1,function(v,z,F,I,ea){v=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;ea=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+z*(ea+g.shape.strokewidth*g.view.scale)-F*v/2,I.y+F*(ea+g.shape.strokewidth*g.view.scale)+z*v/2)},function(v,z,F,I,ea,S,ta){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));z=mxUtils.ptLineDist(I.x,I.y,I.x+F,I.y-z,S.x,S.y);g.style[mxConstants.STYLE_ENDSIZE]=Math.round((z-g.shape.strokewidth)/+3/g.view.scale);g.style.width=Math.round(2*v/g.view.scale);if(mxEvent.isShiftDown(ta.getEvent())||mxEvent.isControlDown(ta.getEvent()))g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(ta.getEvent())||Math.abs(parseFloat(g.style[mxConstants.STYLE_ENDSIZE])-parseFloat(g.style[mxConstants.STYLE_STARTSIZE]))<r/6&&(g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE])})),A.push(cb(g,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],+!1,function(v,z,F,I,ea){v=(g.shape.getEndArrowWidth()-g.shape.strokewidth)*g.view.scale;ea=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+z*(ea+g.shape.strokewidth*g.view.scale)-F*v/2,I.y+F*(ea+g.shape.strokewidth*g.view.scale)+z*v/2)},function(v,z,F,I,ea,S,ta){v=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,ea.x,ea.y,S.x,S.y));z=mxUtils.ptLineDist(I.x,I.y,I.x+F,I.y-z,S.x,S.y);g.style[mxConstants.STYLE_ENDSIZE]=Math.round((z-g.shape.strokewidth)/+3/g.view.scale);g.style.endWidth=Math.round(Math.max(0,Math.round(2*v)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(ta.getEvent())||mxEvent.isControlDown(ta.getEvent()))g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE],g.style.startWidth=g.style.endWidth;mxEvent.isAltDown(ta.getEvent())||(Math.abs(parseFloat(g.style[mxConstants.STYLE_ENDSIZE])-parseFloat(g.style[mxConstants.STYLE_STARTSIZE]))<r/6&&(g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE]),+Math.abs(parseFloat(g.style.endWidth)-parseFloat(g.style.startWidth))<r&&(g.style.endWidth=g.style.startWidth))})));return A},swimlane:function(g){var r=[];if(mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED)){var A=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));r.push(Jb(g,A/2))}r.push(vb(g,[mxConstants.STYLE_STARTSIZE],function(v){var z=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(g.style,+mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(v.getCenterX(),v.y+Math.max(0,Math.min(v.height,z))):new mxPoint(v.x+Math.max(0,Math.min(v.width,z)),v.getCenterY())},function(v,z){g.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(v.height,z.y-v.y))):Math.round(Math.max(0,Math.min(v.width,z.x-v.x)))},!1,null,function(v){var z=g.view.graph;if(!mxEvent.isShiftDown(v.getEvent())&&!mxEvent.isControlDown(v.getEvent())&&(z.isTableRow(g.cell)||+z.isTableCell(g.cell))){v=z.getSwimlaneDirection(g.style);var F=z.model.getParent(g.cell);F=z.model.getChildCells(F,!0);for(var I=[],ea=0;ea<F.length;ea++)F[ea]!=g.cell&&z.isSwimlane(F[ea])&&z.getSwimlaneDirection(z.getCurrentCellStyle(F[ea]))==v&&I.push(F[ea]);z.setCellStyles(mxConstants.STYLE_STARTSIZE,g.style[mxConstants.STYLE_STARTSIZE],I)}}));return r},label:Fb(),ext:Fb(),rectangle:Fb(),triangle:Fb(),rhombus:Fb(),umlLifeline:function(g){return[vb(g,["size"],function(r){var A=Math.max(0,Math.min(r.height,+parseFloat(mxUtils.getValue(this.state.style,"size",za.prototype.size))));return new mxPoint(r.getCenterX(),r.y+A)},function(r,A){this.state.style.size=Math.round(Math.max(0,Math.min(r.height,A.y-r.y)))},!1)]},umlFrame:function(g){return[vb(g,["width","height"],function(r){var A=Math.max(sa.prototype.corner,Math.min(r.width,mxUtils.getValue(this.state.style,"width",sa.prototype.width))),v=Math.max(1.5*sa.prototype.corner,Math.min(r.height,mxUtils.getValue(this.state.style,"height",sa.prototype.height)));+return new mxPoint(r.x+A,r.y+v)},function(r,A){this.state.style.width=Math.round(Math.max(sa.prototype.corner,Math.min(r.width,A.x-r.x)));this.state.style.height=Math.round(Math.max(1.5*sa.prototype.corner,Math.min(r.height,A.y-r.y)))},!1)]},process:function(g){var r=[vb(g,["size"],function(A){var v="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),z=parseFloat(mxUtils.getValue(this.state.style,"size",ba.prototype.size));return v?new mxPoint(A.x+z,A.y+A.height/4):new mxPoint(A.x+A.width*z,A.y++A.height/4)},function(A,v){A="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(.5*A.width,v.x-A.x)):Math.max(0,Math.min(.5,(v.x-A.x)/A.width));this.state.style.size=A},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r},cross:function(g){return[vb(g,["size"],function(r){var A=Math.min(r.width,r.height);A=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",Ub.prototype.size)))*A/2;return new mxPoint(r.getCenterX()-A,r.getCenterY()-+A)},function(r,A){var v=Math.min(r.width,r.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,r.getCenterY()-A.y)/v*2,Math.max(0,r.getCenterX()-A.x)/v*2)))})]},note:function(g){return[vb(g,["size"],function(r){var A=Math.max(0,Math.min(r.width,Math.min(r.height,parseFloat(mxUtils.getValue(this.state.style,"size",G.prototype.size)))));return new mxPoint(r.x+r.width-A,r.y+A)},function(r,A){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(r.width,r.x+r.width-A.x),Math.min(r.height,+A.y-r.y))))})]},note2:function(g){return[vb(g,["size"],function(r){var A=Math.max(0,Math.min(r.width,Math.min(r.height,parseFloat(mxUtils.getValue(this.state.style,"size",O.prototype.size)))));return new mxPoint(r.x+r.width-A,r.y+A)},function(r,A){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(r.width,r.x+r.width-A.x),Math.min(r.height,A.y-r.y))))})]},manualInput:function(g){var r=[vb(g,["size"],function(A){var v=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"size",+Ba.prototype.size)));return new mxPoint(A.x+A.width/4,A.y+3*v/4)},function(A,v){this.state.style.size=Math.round(Math.max(0,Math.min(A.height,4*(v.y-A.y)/3)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r},dataStorage:function(g){return[vb(g,["size"],function(r){var A="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),v=parseFloat(mxUtils.getValue(this.state.style,"size",A?bb.prototype.fixedSize:bb.prototype.size));return new mxPoint(r.x+r.width-v*(A?1:+r.width),r.getCenterY())},function(r,A){r="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(r.width,r.x+r.width-A.x)):Math.max(0,Math.min(1,(r.x+r.width-A.x)/r.width));this.state.style.size=r},!1)]},callout:function(g){var r=[vb(g,["size","position"],function(A){var v=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"size",qa.prototype.size))),z=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",qa.prototype.position)));mxUtils.getValue(this.state.style,+"base",qa.prototype.base);return new mxPoint(A.x+z*A.width,A.y+A.height-v)},function(A,v){mxUtils.getValue(this.state.style,"base",qa.prototype.base);this.state.style.size=Math.round(Math.max(0,Math.min(A.height,A.y+A.height-v.y)));this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(v.x-A.x)/A.width)))/100},!1),vb(g,["position2"],function(A){var v=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",qa.prototype.position2)));return new mxPoint(A.x+v*A.width,A.y+A.height)},+function(A,v){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,(v.x-A.x)/A.width)))/100},!1),vb(g,["base"],function(A){var v=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"size",qa.prototype.size))),z=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",qa.prototype.position))),F=Math.max(0,Math.min(A.width,mxUtils.getValue(this.state.style,"base",qa.prototype.base)));return new mxPoint(A.x+Math.min(A.width,z*A.width+F),A.y+A.height-v)},function(A,v){var z=+Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",qa.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(A.width,v.x-A.x-z*A.width)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r},internalStorage:function(g){var r=[vb(g,["dx","dy"],function(A){var v=Math.max(0,Math.min(A.width,mxUtils.getValue(this.state.style,"dx",Ka.prototype.dx))),z=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"dy",Ka.prototype.dy)));+return new mxPoint(A.x+v,A.y+z)},function(A,v){this.state.style.dx=Math.round(Math.max(0,Math.min(A.width,v.x-A.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(A.height,v.y-A.y)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(Jb(g));return r},module:function(g){return[vb(g,["jettyWidth","jettyHeight"],function(r){var A=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"jettyWidth",Na.prototype.jettyWidth))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,+"jettyHeight",Na.prototype.jettyHeight)));return new mxPoint(r.x+A/2,r.y+2*v)},function(r,A){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(r.width,A.x-r.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(r.height,A.y-r.y))/2)})]},corner:function(g){return[vb(g,["dx","dy"],function(r){var A=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",ab.prototype.dx))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",ab.prototype.dy)));return new mxPoint(r.x++A,r.y+v)},function(r,A){this.state.style.dx=Math.round(Math.max(0,Math.min(r.width,A.x-r.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(r.height,A.y-r.y)))},!1)]},tee:function(g){return[vb(g,["dx","dy"],function(r){var A=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",db.prototype.dx))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",db.prototype.dy)));return new mxPoint(r.x+(r.width+A)/2,r.y+v)},function(r,A){this.state.style.dx=Math.round(Math.max(0,+2*Math.min(r.width/2,A.x-r.x-r.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(r.height,A.y-r.y)))},!1)]},singleArrow:Xa(1),doubleArrow:Xa(.5),"mxgraph.arrows2.wedgeArrow":fb(20,20),"mxgraph.arrows2.wedgeArrowDashed":fb(20,20),"mxgraph.arrows2.wedgeArrowDashed2":fb(20,20),folder:function(g){return[vb(g,["tabWidth","tabHeight"],function(r){var A=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"tabWidth",q.prototype.tabWidth))),v=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,+"tabHeight",q.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(A=r.width-A);return new mxPoint(r.x+A,r.y+v)},function(r,A){var v=Math.max(0,Math.min(r.width,A.x-r.x));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(v=r.width-v);this.state.style.tabWidth=Math.round(v);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(r.height,A.y-r.y)))},!1)]},document:function(g){return[vb(g,["size"],function(r){var A=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",Q.prototype.size))));return new mxPoint(r.x+3*r.width/4,r.y+(1-A)*r.height)},function(r,A){this.state.style.size=Math.max(0,Math.min(1,(r.y+r.height-A.y)/r.height))},!1)]},tape:function(g){return[vb(g,["size"],function(r){var A=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",L.prototype.size))));return new mxPoint(r.getCenterX(),r.y+A*r.height/2)},function(r,A){this.state.style.size=Math.max(0,Math.min(1,(A.y-r.y)/r.height*2))},!1)]},isoCube2:function(g){return[vb(g,["isoAngle"],function(r){var A=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",U.isoAngle))))*Math.PI/200;return new mxPoint(r.x,r.y+Math.min(r.width*Math.tan(A),.5*r.height))},function(r,A){this.state.style.isoAngle=Math.max(0,50*(A.y-r.y)/r.height)},!0)]},cylinder2:wb(c.prototype.size),cylinder3:wb(f.prototype.size),offPageConnector:function(g){return[vb(g,["size"],function(r){var A=-Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",lb.prototype.size))));return new mxPoint(r.getCenterX(),r.y+(1-A)*r.height)},function(r,A){this.state.style.size=Math.max(0,Math.min(1,(r.y+r.height-A.y)/r.height))},!1)]},"mxgraph.basic.rect":function(g){var r=[Graph.createHandle(g,["size"],function(A){var u=Math.max(0,Math.min(A.width/2,A.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(A.x+u,A.y+u)},function(A,u){this.state.style.size=-Math.round(100*Math.max(0,Math.min(A.height/2,A.width/2,u.x-A.x)))/100})];g=Graph.createHandle(g,["indent"],function(A){var u=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(A.x+.75*A.width,A.y+u*A.height/200)},function(A,u){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(u.y-A.y)/A.height)))/100});r.push(g);return r},curvedText:function(g){var r=function(A){return(null!=A.shape?A.shape._curveYOffset:0)||0};return[vb(g,-["arcStartY"],function(A){var u=parseFloat(mxUtils.getValue(this.state.style,"arcStartY",Gb.prototype.arcStartY)),z=r(this.state);return new mxPoint(A.x+10,A.y+Math.max(0,Math.min(A.height,u+z)))},function(A,u){var z=r(this.state);this.state.style.arcStartY=Math.round(Math.max(0,Math.min(A.height,u.y-A.y))-z)},!1),vb(g,["arcMidY"],function(A){var u=parseFloat(mxUtils.getValue(this.state.style,"arcStartY",Gb.prototype.arcStartY)),z=parseFloat(mxUtils.getValue(this.state.style,"arcEndY",Gb.prototype.arcEndY)),-F=parseFloat(mxUtils.getValue(this.state.style,"arcMidY",Gb.prototype.arcMidY));u=(u+z)/2;z=r(this.state);return new mxPoint(A.x+A.width/2+10,A.y+Math.max(0,Math.min(A.height,u+F+z)))},function(A,u){var z=parseFloat(mxUtils.getValue(this.state.style,"arcStartY",Gb.prototype.arcStartY)),F=parseFloat(mxUtils.getValue(this.state.style,"arcEndY",Gb.prototype.arcEndY));z=(z+F)/2;F=r(this.state);var I=Math.max(Math.abs(Gb.prototype.arcMidY),Math.min(z,A.height-z));this.state.style.arcMidY=Math.round(Math.max(-I,-Math.min(I,u.y-A.y-F-z)))},!1),vb(g,["arcEndY"],function(A){var u=parseFloat(mxUtils.getValue(this.state.style,"arcEndY",Gb.prototype.arcEndY)),z=r(this.state);return new mxPoint(A.x+A.width-10,A.y+Math.max(0,Math.min(A.height,u+z)))},function(A,u){var z=r(this.state);this.state.style.arcEndY=Math.round(Math.max(0,Math.min(A.height,u.y-A.y))-z)},!1)]},step:qb(ra.prototype.size,!0,null,!0,ra.prototype.fixedSize),hexagon:qb(l.prototype.size,!0,.5,!0,l.prototype.fixedSize),curlyBracket:qb(fa.prototype.size,+Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",lb.prototype.size))));return new mxPoint(r.getCenterX(),r.y+(1-A)*r.height)},function(r,A){this.state.style.size=Math.max(0,Math.min(1,(r.y+r.height-A.y)/r.height))},!1)]},"mxgraph.basic.rect":function(g){var r=[Graph.createHandle(g,["size"],function(A){var v=Math.max(0,Math.min(A.width/2,A.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(A.x+v,A.y+v)},function(A,v){this.state.style.size=+Math.round(100*Math.max(0,Math.min(A.height/2,A.width/2,v.x-A.x)))/100})];g=Graph.createHandle(g,["indent"],function(A){var v=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(A.x+.75*A.width,A.y+v*A.height/200)},function(A,v){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(v.y-A.y)/A.height)))/100});r.push(g);return r},curvedText:function(g){var r=function(A){return(null!=A.shape?A.shape._curveYOffset:0)||0};return[vb(g,+["arcStartY"],function(A){var v=parseFloat(mxUtils.getValue(this.state.style,"arcStartY",Gb.prototype.arcStartY)),z=r(this.state);return new mxPoint(A.x+10,A.y+Math.max(0,Math.min(A.height,v+z)))},function(A,v){var z=r(this.state);this.state.style.arcStartY=Math.round(Math.max(0,Math.min(A.height,v.y-A.y))-z)},!1),vb(g,["arcMidY"],function(A){var v=parseFloat(mxUtils.getValue(this.state.style,"arcStartY",Gb.prototype.arcStartY)),z=parseFloat(mxUtils.getValue(this.state.style,"arcEndY",Gb.prototype.arcEndY)),+F=parseFloat(mxUtils.getValue(this.state.style,"arcMidY",Gb.prototype.arcMidY));v=(v+z)/2;z=r(this.state);return new mxPoint(A.x+A.width/2+10,A.y+Math.max(0,Math.min(A.height,v+F+z)))},function(A,v){var z=parseFloat(mxUtils.getValue(this.state.style,"arcStartY",Gb.prototype.arcStartY)),F=parseFloat(mxUtils.getValue(this.state.style,"arcEndY",Gb.prototype.arcEndY));z=(z+F)/2;F=r(this.state);var I=Math.max(Math.abs(Gb.prototype.arcMidY),Math.min(z,A.height-z));this.state.style.arcMidY=Math.round(Math.max(-I,+Math.min(I,v.y-A.y-F-z)))},!1),vb(g,["arcEndY"],function(A){var v=parseFloat(mxUtils.getValue(this.state.style,"arcEndY",Gb.prototype.arcEndY)),z=r(this.state);return new mxPoint(A.x+A.width-10,A.y+Math.max(0,Math.min(A.height,v+z)))},function(A,v){var z=r(this.state);this.state.style.arcEndY=Math.round(Math.max(0,Math.min(A.height,v.y-A.y))-z)},!1)]},step:qb(ra.prototype.size,!0,null,!0,ra.prototype.fixedSize),hexagon:qb(l.prototype.size,!0,.5,!0,l.prototype.fixedSize),curlyBracket:qb(fa.prototype.size,!1),display:qb(Qb.prototype.size,!1),cube:sb(1,p.prototype.size,!1),card:sb(.5,E.prototype.size,!0),loopLimit:sb(.5,Ya.prototype.size,!0),trapezoid:zb(.5,K.prototype.size,K.prototype.fixedSize),parallelogram:zb(1,V.prototype.size,V.prototype.fixedSize),zigzag:function(g){return[vb(g,["size"],function(r){var A=Math.max(5,parseFloat(mxUtils.getValue(this.state.style,"size",Tb.prototype.size)));return new mxPoint(r.x+3*A,r.y)},function(r,A){this.state.style.size=Math.max(5,Math.round((A.x-r.x)/3))},!1)]}};Graph.createHandle=vb;Graph.handleFactory=Eb;var Ib=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){var g=Ib.apply(this,arguments);if(this.graph.isCellRotatable(this.state.cell)){var r=this.state.style.shape;null==mxCellRenderer.defaultShapes[r]&&null==mxStencilRegistry.getStencil(r)?r=mxConstants.SHAPE_RECTANGLE:this.state.view.graph.isSwimlane(this.state.cell)&&(r=mxConstants.SHAPE_SWIMLANE);r=Eb[r];null==r&&null!=this.state.shape&&this.state.shape.isRoundable()&&(r=Eb[mxConstants.SHAPE_RECTANGLE]);null!=r&&(r=r(this.state),null!=r&&(g=null==g?r:g.concat(r)))}return g};mxEdgeHandler.prototype.createCustomHandles=function(){var g=this.state.style.shape;null==mxCellRenderer.defaultShapes[g]&&null==mxStencilRegistry.getStencil(g)&&(g=mxConstants.SHAPE_CONNECTOR);g=Eb[g];return null!=g?g(this.state):null}}else Graph.createHandle=function(){},Graph.handleFactory={};var Db=Graph.prototype.getPreferredSizeForCell;Graph.prototype.getPreferredSizeForCell=function(g,-r,A){var u=this.getCellStyle(g);if(null!=u&&"curvedText"==u[mxConstants.STYLE_SHAPE]){var z=this.convertValueToString(g);if(null!=z&&0<z.length){var F=parseFloat(mxUtils.getValue(u,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)),I=mxUtils.getValue(u,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);u=mxUtils.getValue(u,mxConstants.STYLE_FONTSTYLE,0);z=.85*mxUtils.getSizeForString(z,F,I,null,u).width;I=this.model.getGeometry(g);I=null!=I?I.height:60;(A=null!=A?A:this.gridEnabled)&&+r,A){var v=this.getCellStyle(g);if(null!=v&&"curvedText"==v[mxConstants.STYLE_SHAPE]){var z=this.convertValueToString(g);if(null!=z&&0<z.length){var F=parseFloat(mxUtils.getValue(v,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)),I=mxUtils.getValue(v,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);v=mxUtils.getValue(v,mxConstants.STYLE_FONTSTYLE,0);z=.85*mxUtils.getSizeForString(z,F,I,null,v).width;I=this.model.getGeometry(g);I=null!=I?I.height:60;(A=null!=A?A:this.gridEnabled)&&(z=this.snap(z+this.gridSize/2));return new mxRectangle(0,0,Math.max(z,2*F)+10,I)}return null}return Db.apply(this,arguments)};var Lb=mxCellRenderer.prototype.checkPlaceholderStyles;mxCellRenderer.prototype.checkPlaceholderStyles=function(g){return null!=g.style&&"curvedText"==g.style[mxConstants.STYLE_SHAPE]?!0:Lb.apply(this,arguments)};if("undefined"!==typeof mxCellEditor){var Hb=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(g,r){Hb.apply(this,arguments);var A=this.graph.view.getState(g);null!=A&&null!=A.style&&"curvedText"==A.style[mxConstants.STYLE_SHAPE]&&null!=A.shape&&A.shape.redraw()};var bc=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(g){var r=this.editingCell;bc.apply(this,arguments);null!=r&&(r=this.graph.view.getState(r),null!=r&&null!=r.style&&"curvedText"==r.style[mxConstants.STYLE_SHAPE]&&null!=r.shape&&r.shape.redraw())}}var Zb=new mxPoint(1,0),$b=new mxPoint(1,0),Sb=mxUtils.toRadians(-30);Zb=mxUtils.getRotatedPoint(Zb,-Math.cos(Sb),Math.sin(Sb));var ac=mxUtils.toRadians(-150);$b=mxUtils.getRotatedPoint($b,Math.cos(ac),Math.sin(ac));mxEdgeStyle.IsometricConnector=function(g,r,A,u,z){var F=g.view;u=null!=u&&0<u.length?u[0]:null;var I=g.absolutePoints,ea=I[0];I=I[I.length-1];null!=u&&(u=F.transformControlPoint(g,u));null==ea&&null!=r&&(ea=new mxPoint(r.getCenterX(),r.getCenterY()));null==I&&null!=A&&(I=new mxPoint(A.getCenterX(),A.getCenterY()));var S=Zb.x,ta=Zb.y,oa=$b.x,Ia=$b.y,mb="horizontal"==mxUtils.getValue(g.style,-"elbow","horizontal");if(null!=I&&null!=ea){g=function(Ea,Ga,Ja){Ea-=$a.x;var Pa=Ga-$a.y;Ga=(Ia*Ea-oa*Pa)/(S*Ia-ta*oa);Ea=(ta*Ea-S*Pa)/(ta*oa-S*Ia);mb?(Ja&&($a=new mxPoint($a.x+S*Ga,$a.y+ta*Ga),z.push($a)),$a=new mxPoint($a.x+oa*Ea,$a.y+Ia*Ea)):(Ja&&($a=new mxPoint($a.x+oa*Ea,$a.y+Ia*Ea),z.push($a)),$a=new mxPoint($a.x+S*Ga,$a.y+ta*Ga));z.push($a)};var $a=ea;null==u&&(u=new mxPoint(ea.x+(I.x-ea.x)/2,ea.y+(I.y-ea.y)/2));g(u.x,u.y,!0);g(I.x,I.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);-var Rb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(g,r){if(r==mxEdgeStyle.IsometricConnector){var A=new mxElbowEdgeHandler(g);A.snapToTerminals=!1;return A}return Rb.apply(this,arguments)};y.prototype.constraints=[];C.prototype.getConstraints=function(g,r,A){g=[];var u=Math.tan(mxUtils.toRadians(30)),z=(.5-u)/2;u=Math.min(r,A/(.5+u));r=(r-u)/2;A=(A-u)/2;g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A+.25*u));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,r+.5*u,A+u*z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+u,A+.25*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+u,A+.75*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+.5*u,A+(1-z)*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A+.75*u));return g};U.prototype.getConstraints=function(g,r,A){g=[];var u=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;u=Math.min(r*-Math.tan(u),.5*A);g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,u));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A-u));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-u));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,-0,u));return g};qa.prototype.getConstraints=function(g,r,A){g=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var u=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",this.position));var z=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1));g.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*(A-u)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A-u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,-A-u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A-u)));r>=2*u&&g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return g};mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,+Math.cos(Sb),Math.sin(Sb));var ac=mxUtils.toRadians(-150);$b=mxUtils.getRotatedPoint($b,Math.cos(ac),Math.sin(ac));mxEdgeStyle.IsometricConnector=function(g,r,A,v,z){var F=g.view;v=null!=v&&0<v.length?v[0]:null;var I=g.absolutePoints,ea=I[0];I=I[I.length-1];null!=v&&(v=F.transformControlPoint(g,v));null==ea&&null!=r&&(ea=new mxPoint(r.getCenterX(),r.getCenterY()));null==I&&null!=A&&(I=new mxPoint(A.getCenterX(),A.getCenterY()));var S=Zb.x,ta=Zb.y,oa=$b.x,Ia=$b.y,mb="horizontal"==mxUtils.getValue(g.style,+"elbow","horizontal");if(null!=I&&null!=ea){g=function(Ea,Ga,Ja){Ea-=$a.x;var Pa=Ga-$a.y;Ga=(Ia*Ea-oa*Pa)/(S*Ia-ta*oa);Ea=(ta*Ea-S*Pa)/(ta*oa-S*Ia);mb?(Ja&&($a=new mxPoint($a.x+S*Ga,$a.y+ta*Ga),z.push($a)),$a=new mxPoint($a.x+oa*Ea,$a.y+Ia*Ea)):(Ja&&($a=new mxPoint($a.x+oa*Ea,$a.y+Ia*Ea),z.push($a)),$a=new mxPoint($a.x+S*Ga,$a.y+ta*Ga));z.push($a)};var $a=ea;null==v&&(v=new mxPoint(ea.x+(I.x-ea.x)/2,ea.y+(I.y-ea.y)/2));g(v.x,v.y,!0);g(I.x,I.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);+var Rb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(g,r){if(r==mxEdgeStyle.IsometricConnector){var A=new mxElbowEdgeHandler(g);A.snapToTerminals=!1;return A}return Rb.apply(this,arguments)};y.prototype.constraints=[];B.prototype.getConstraints=function(g,r,A){g=[];var v=Math.tan(mxUtils.toRadians(30)),z=(.5-v)/2;v=Math.min(r,A/(.5+v));r=(r-v)/2;A=(A-v)/2;g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A+.25*v));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,r+.5*v,A+v*z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+v,A+.25*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+v,A+.75*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+.5*v,A+(1-z)*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A+.75*v));return g};U.prototype.getConstraints=function(g,r,A){g=[];var v=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;v=Math.min(r*+Math.tan(v),.5*A);g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,v));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A-v));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-v));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,+0,v));return g};qa.prototype.getConstraints=function(g,r,A){g=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var v=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",this.position));var z=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1));g.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*(A-v)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A-v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,+A-v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A-v)));r>=2*v&&g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return g};mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0)];mxEllipse.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];Kb.prototype.constraints=mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=-mxRectangleShape.prototype.constraints;t.prototype.constraints=mxRectangleShape.prototype.constraints;mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;Nb.prototype.constraints=mxRectangleShape.prototype.constraints;Ab.prototype.constraints=mxEllipse.prototype.constraints;M.prototype.constraints=mxEllipse.prototype.constraints;B.prototype.constraints=mxEllipse.prototype.constraints;G.prototype.getConstraints=function(g,r,A){g=[];var u=Math.max(0,Math.min(r,Math.min(A,parseFloat(mxUtils.getValue(this.style,-"size",this.size)))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-u),0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-u,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-.5*u,.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*(A+u)));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,-1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));r>=2*u&&g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return g};E.prototype.getConstraints=function(g,r,A){g=[];var u=Math.max(0,Math.min(r,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),0));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,u,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A+u)));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));r>=2*u&&g.push(new mxConnectionConstraint(new mxPoint(.5,-0),!1));return g};p.prototype.getConstraints=function(g,r,A){g=[];var u=Math.max(0,Math.min(r,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-u),0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-u,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-.5*u,.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,u));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,r,.5*(A+u)));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,A-.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A-u)));return g};f.prototype.getConstraints=function(g,r,A){g=[];r=Math.max(0,Math.min(A,+mxRectangleShape.prototype.constraints;t.prototype.constraints=mxRectangleShape.prototype.constraints;mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;Nb.prototype.constraints=mxRectangleShape.prototype.constraints;Ab.prototype.constraints=mxEllipse.prototype.constraints;M.prototype.constraints=mxEllipse.prototype.constraints;C.prototype.constraints=mxEllipse.prototype.constraints;G.prototype.getConstraints=function(g,r,A){g=[];var v=Math.max(0,Math.min(r,Math.min(A,parseFloat(mxUtils.getValue(this.style,+"size",this.size)))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-v),0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-v,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-.5*v,.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*(A+v)));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,+1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));r>=2*v&&g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return g};E.prototype.getConstraints=function(g,r,A){g=[];var v=Math.max(0,Math.min(r,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),0));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,v,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*v,.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A+v)));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));r>=2*v&&g.push(new mxConnectionConstraint(new mxPoint(.5,+0),!1));return g};p.prototype.getConstraints=function(g,r,A){g=[];var v=Math.max(0,Math.min(r,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-v),0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-v,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-.5*v,.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,v));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,r,.5*(A+v)));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,v,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*v,A-.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A-v)));return g};f.prototype.getConstraints=function(g,r,A){g=[];r=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,r));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,r));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1,null,0,-r));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1,null,0,-r));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,r+.5*(.5*A-r)));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,r+.5*(.5*A-r)));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,A-r-.5*(.5*A-r)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-r-.5*(.5*A-r)));g.push(new mxConnectionConstraint(new mxPoint(.145,0),!1,null,0,.29*r));g.push(new mxConnectionConstraint(new mxPoint(.855,0),!1,null,0,.29*r));g.push(new mxConnectionConstraint(new mxPoint(.855,-1),!1,null,0,.29*-r));g.push(new mxConnectionConstraint(new mxPoint(.145,1),!1,null,0,.29*-r));return g};q.prototype.getConstraints=function(g,r,A){g=[];var u=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?(g.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,.5*u,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,z)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),z))):(g.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-.5*u,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-u,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-u,z)),g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,.5*(r-u),z)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.25*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.75*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,+1),!1,null,0,.29*-r));g.push(new mxConnectionConstraint(new mxPoint(.145,1),!1,null,0,.29*-r));return g};q.prototype.getConstraints=function(g,r,A){g=[];var v=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?(g.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,.5*v,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,v,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,v,z)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),z))):(g.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-.5*v,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-v,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-v,z)),g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,.5*(r-v),z)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.25*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.75*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.25*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.75*(A-z)+z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A));g.push(new mxConnectionConstraint(new mxPoint(.25,1),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(.75,1),!1));return g};Ka.prototype.constraints=mxRectangleShape.prototype.constraints;bb.prototype.constraints=-mxRectangleShape.prototype.constraints;ub.prototype.constraints=mxEllipse.prototype.constraints;gb.prototype.constraints=mxEllipse.prototype.constraints;jb.prototype.constraints=mxEllipse.prototype.constraints;Xb.prototype.constraints=mxEllipse.prototype.constraints;Ba.prototype.constraints=mxRectangleShape.prototype.constraints;Ob.prototype.constraints=mxRectangleShape.prototype.constraints;Qb.prototype.getConstraints=function(g,r,A){g=[];var u=Math.min(r,A/2),z=Math.min(r-u,Math.max(0,parseFloat(mxUtils.getValue(this.style,-"size",this.size)))*r);g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(z+r-u),0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-u,0));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-u,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(z+r-u),A));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,z,A));return g};Na.prototype.getConstraints=function(g,r,A){r=parseFloat(mxUtils.getValue(g,"jettyWidth",Na.prototype.jettyWidth))/2;g=parseFloat(mxUtils.getValue(g,"jettyHeight",Na.prototype.jettyHeight));var u=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,r),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(1,+mxRectangleShape.prototype.constraints;ub.prototype.constraints=mxEllipse.prototype.constraints;gb.prototype.constraints=mxEllipse.prototype.constraints;jb.prototype.constraints=mxEllipse.prototype.constraints;Xb.prototype.constraints=mxEllipse.prototype.constraints;Ba.prototype.constraints=mxRectangleShape.prototype.constraints;Ob.prototype.constraints=mxRectangleShape.prototype.constraints;Qb.prototype.getConstraints=function(g,r,A){g=[];var v=Math.min(r,A/2),z=Math.min(r-v,Math.max(0,parseFloat(mxUtils.getValue(this.style,+"size",this.size)))*r);g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(z+r-v),0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-v,0));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-v,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(z+r-v),A));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,z,A));return g};Na.prototype.getConstraints=function(g,r,A){r=parseFloat(mxUtils.getValue(g,"jettyWidth",Na.prototype.jettyWidth))/2;g=parseFloat(mxUtils.getValue(g,"jettyHeight",Na.prototype.jettyHeight));var v=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,r),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!1,null,r),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(A-.5*g,1.5*g)),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(A--.5*g,3.5*g))];A>5*g&&u.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,r));A>8*g&&u.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null,r));A>15*g&&u.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,r));return u};Ya.prototype.constraints=mxRectangleShape.prototype.constraints;lb.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),+.5*g,3.5*g))];A>5*g&&v.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,r));A>8*g&&v.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null,r));A>15*g&&v.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,r));return v};Ya.prototype.constraints=mxRectangleShape.prototype.constraints;lb.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];R.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)];La.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,@@ -3379,25 +3380,25 @@ new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(n0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0)];mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.375,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.625,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.375,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.625,1),!0)];mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.4,.1),!1),new mxConnectionConstraint(new mxPoint(.16,.55),!1),new mxConnectionConstraint(new mxPoint(.07,.4),!1),new mxConnectionConstraint(new mxPoint(.31,.8),!1),new mxConnectionConstraint(new mxPoint(.13,.77),!1),new mxConnectionConstraint(new mxPoint(.8,.8),!1),new mxConnectionConstraint(new mxPoint(.55,.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,.25),!1)];V.prototype.constraints=mxRectangleShape.prototype.constraints;K.prototype.constraints=mxRectangleShape.prototype.constraints;Q.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,-0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;db.prototype.getConstraints=function(g,r,A){g=[];var u=Math.max(0,+0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;db.prototype.getConstraints=function(g,r,A){g=[];var v=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,-null,.75*r+.25*u,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),.5*(A+z)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),A));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-u),A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-u),.5*(A+z)));g.push(new mxConnectionConstraint(new mxPoint(0,0),-!1,null,.5*(r-u),z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*r-.25*u,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*z));return g};ab.prototype.getConstraints=function(g,r,A){g=[];var u=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.push(new mxConnectionConstraint(new mxPoint(0,0),-!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,.5*(A+z)));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,u,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,A));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));return g};Qa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,-.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];Va.prototype.getConstraints=function(g,r,A){g=[];var u=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),z=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));u=(A-u)/2;g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,0,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-z),u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-z,0));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-z,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-z),A-u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-u));return g};nb.prototype.getConstraints=function(g,r,A){g=[];var u=A*Math.max(0,Math.min(1,-parseFloat(mxUtils.getValue(this.style,"arrowWidth",Va.prototype.arrowWidth)))),z=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Va.prototype.arrowSize))));u=(A-u)/2;g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*r,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-z,0));g.push(new mxConnectionConstraint(new mxPoint(1,.5),-!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-z,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*r,A-u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,A));return g};Ub.prototype.getConstraints=function(g,r,A){g=[];var u=Math.min(A,r),z=Math.max(0,Math.min(u,u*parseFloat(mxUtils.getValue(this.style,"size",this.size))));u=(A-z)/2;var F=u+z,I=(r-z)/2;z=I+z;g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,I,0));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,A-.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,A));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,z,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,A-.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+z),u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,u));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+z),F));g.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,I,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*I,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*I,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,u));return g};za.prototype.constraints=null;ya.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,+null,.75*r+.25*v,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),.5*(A+z)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),A));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-v),A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-v),.5*(A+z)));g.push(new mxConnectionConstraint(new mxPoint(0,0),+!1,null,.5*(r-v),z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*r-.25*v,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*z));return g};ab.prototype.getConstraints=function(g,r,A){g=[];var v=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.push(new mxConnectionConstraint(new mxPoint(0,0),+!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+v),z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,v,z));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,v,.5*(A+z)));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,v,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*v,A));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));return g};Qa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,+.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];Va.prototype.getConstraints=function(g,r,A){g=[];var v=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),z=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));v=(A-v)/2;g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,0,v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-z),v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-z,0));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-z,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-z),A-v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-v));return g};nb.prototype.getConstraints=function(g,r,A){g=[];var v=A*Math.max(0,Math.min(1,+parseFloat(mxUtils.getValue(this.style,"arrowWidth",Va.prototype.arrowWidth)))),z=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Va.prototype.arrowSize))));v=(A-v)/2;g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*r,v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-z,0));g.push(new mxConnectionConstraint(new mxPoint(1,.5),+!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-z,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*r,A-v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,A));return g};Ub.prototype.getConstraints=function(g,r,A){g=[];var v=Math.min(A,r),z=Math.max(0,Math.min(v,v*parseFloat(mxUtils.getValue(this.style,"size",this.size))));v=(A-z)/2;var F=v+z,I=(r-z)/2;z=I+z;g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,I,0));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,A-.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,A));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,z,A));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,A-.5*v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+z),v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,v));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+z),F));g.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,I,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*I,v));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,v));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*I,F));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,v));return g};za.prototype.constraints=null;ya.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];Ra.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];Fa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];Ha.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(b){this.editorUi=b;this.actions={};this.init()}Actions.prototype.init=function(){function b(G){n.escape();G=n.deleteCells(n.getDeletableCells(n.getSelectionCells()),G);null!=G&&n.setSelectionCells(G)}function d(){if(!n.isSelectionEmpty()){n.getModel().beginUpdate();try{for(var G=n.getSelectionCells(),O=0;O<G.length;O++)n.cellLabelChanged(G[O],"")}finally{n.getModel().endUpdate()}}}function m(G,O,U,c,f){f.getModel().beginUpdate();try{var k=f.getCellGeometry(G);null!=k&&U&&c&&(U/=c,k=k.clone(),1<U?k.height=k.width/U:k.width=k.height*U,f.getModel().setGeometry(G,-k));f.setCellStyles(mxConstants.STYLE_CLIP_PATH,O,[G]);f.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[G])}finally{f.getModel().endUpdate()}}var p=this.editorUi,v=p.editor,n=v.graph,y=function(){return Action.prototype.isEnabled.apply(this,arguments)&&n.isEnabled()};this.addAction("new...",function(){n.openLink(p.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";p.openFile()});var C=new Action("smartFit",function(){if(p.chromelessResize)n.isLightboxView()?(1==-n.view.scale?p.lightboxFit():n.zoomTo(1),p.chromelessResize(!1)):p.chromelessResize(!0);else{n.popupMenuHandler.hideMenu();var G=n.view.scale,O=n.container.scrollLeft,U=n.container.scrollTop,c=n.view.translate.x,f=n.view.translate.y;p.actions.get("resetView").funct();1E-5>Math.abs(G-n.view.scale)&&5>Math.abs(O-n.container.scrollLeft)&&5>Math.abs(U-n.container.scrollTop)&&c==n.view.translate.x&&f==n.view.translate.y&&p.actions.get("fitWindow").funct()}},null,null,"Enter");C.getTitle=function(){return mxResources.get("fitWindow")+-" / "+mxResources.get("resetView")};this.put("smartFit",C);this.addAction("keyPressEnter",function(){n.isSelectionEmpty()?p.actions.get("smartFit").funct():n.isEnabled()&&n.startEditingAtCell()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){p.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(G,O){try{var U=mxUtils.parseXml(G);v.graph.setSelectionCells(v.graph.importGraphModel(U.documentElement))}catch(c){mxUtils.alert(mxResources.get("invalidOrMissingFile")++k));f.setCellStyles(mxConstants.STYLE_CLIP_PATH,O,[G]);f.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[G])}finally{f.getModel().endUpdate()}}var p=this.editorUi,u=p.editor,n=u.graph,y=function(){return Action.prototype.isEnabled.apply(this,arguments)&&n.isEnabled()};this.addAction("new...",function(){n.openLink(p.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";p.openFile()});var B=new Action("smartFit",function(){if(p.chromelessResize)n.isLightboxView()?(1==+n.view.scale?p.lightboxFit():n.zoomTo(1),p.chromelessResize(!1)):p.chromelessResize(!0);else{n.popupMenuHandler.hideMenu();var G=n.view.scale,O=n.container.scrollLeft,U=n.container.scrollTop,c=n.view.translate.x,f=n.view.translate.y;p.actions.get("resetView").funct();1E-5>Math.abs(G-n.view.scale)&&5>Math.abs(O-n.container.scrollLeft)&&5>Math.abs(U-n.container.scrollTop)&&c==n.view.translate.x&&f==n.view.translate.y&&p.actions.get("fitWindow").funct()}},null,null,"Enter");B.getTitle=function(){return mxResources.get("fitWindow")++" / "+mxResources.get("resetView")};this.put("smartFit",B);this.addAction("keyPressEnter",function(){n.isSelectionEmpty()?p.actions.get("smartFit").funct():n.isEnabled()&&n.startEditingAtCell()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){p.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(G,O){try{var U=mxUtils.parseXml(G);u.graph.setSelectionCells(u.graph.importGraphModel(U.documentElement))}catch(c){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+c.message)}}));p.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=y;this.addAction("save",function(){p.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=y;this.addAction("saveAs...",function(){p.saveFile(!0)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+S");this.addAction("export...",function(){p.showDialog((new ExportDialog(p)).container,360,396,!0,!0)});this.addAction("editDiagram...",function(){var G=new EditDiagramDialog(p);p.showDialog(G.container,620,420,!0,!1,null,null,null,new mxRectangle(0,0,440,280));G.init()}).isEnabled=y;this.addAction("pageSetup...",function(){p.showDialog((new PageSetupDialog(p)).container,420,null,!0,!0)}).isEnabled=y;this.addAction("print...",function(){p.showPrintDialog()},null,"",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(n,null,10,10)});this.addAction("undo",function(){p.undo()},null,"",Editor.ctrlKey+"+Z");this.addAction("redo",function(){p.redo()},null,"",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+"+Editor.shiftKey+"+Z");this.addAction("cut",function(){var G=null;try{G=p.copyXml(),null!=G&&n.removeCells(G,!1)}catch(O){}try{null==G&&mxClipboard.cut(n)}catch(O){p.handleError(O)}},null,"",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{p.copyXml()}catch(G){}try{mxClipboard.copy(n)}catch(G){p.handleError(G)}},null,"",Editor.ctrlKey+"+C");this.addAction("paste",function(){p.pasteFromClipboard()},!1,"",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(G){p.pasteFromClipboard(n.popupMenuHandler.getTriggerPoint())});@@ -3406,8 +3407,8 @@ O=0;O<G.length;O++)if(n.getModel().isVertex(G[O])){var U=n.getCellGeometry(G[O])"+B");this.addAction("copyAsText",function(){var G=n.getSelectionCell();if(n.isEnabled()&&null!=G)try{n.isHtmlLabel(G)?p.writeHtmlToClipboard(n.getLabel(G),mxUtils.bind(this,function(O){p.handleError(O)})):p.writeTextToClipboard(n.getLabel(G),mxUtils.bind(this,function(O){p.handleError(O)}))}catch(O){p.handleError(O)}});this.addAction("pasteData",function(G,O){function U(k,q){var x=c.getValue(k);q=k.cloneValue(q);q.removeAttribute("placeholders");null==x||isNaN(x.nodeType)||q.setAttribute("placeholders",x.getAttribute("placeholders"));null!=G&&mxEvent.isShiftDown(G)||q.setAttribute("label",n.convertValueToString(k));c.setValue(k,q)}G=null!=O?O:G;var c=n.getModel();if(n.isEnabled()&&!n.isSelectionEmpty()&&null!=p.copiedValue){c.beginUpdate();try{var f=n.getEditableCells(n.getSelectionCells());if(0==f.length)U(c.getRoot(),p.copiedValue);else for(O=0;O<f.length;O++)U(f[O],p.copiedValue)}finally{c.endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+E");this.addAction("delete",function(G,O){G=null!=O?O:G;null!=G&&mxEvent.isShiftDown(G)?d():b(null!=G&&(mxEvent.isControlDown(G)||mxEvent.isMetaDown(G)||mxEvent.isAltDown(G)))},null,null,"Delete");this.addAction("deleteAll",function(){b(!0)});this.addAction("deleteLabels",function(){d()},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){try{n.setSelectionCells(n.duplicateCells()),n.scrollCellToVisible(n.getSelectionCell())}catch(G){p.handleError(G)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action("merge",-function(){var G=p.getSelectionState();if(null!=G.mergeCell){n.getModel().beginUpdate();try{n.setCellStyles("rowspan",G.rowspan,[G.mergeCell]),n.setCellStyles("colspan",G.colspan,[G.mergeCell])}finally{n.getModel().endUpdate()}}}));this.put("unmergeCells",new Action("unmerge",function(){var G=p.getSelectionState();if(0<G.cells.length){n.getModel().beginUpdate();try{n.setCellStyles("rowspan",null,G.cells),n.setCellStyles("colspan",null,G.cells)}finally{n.getModel().endUpdate()}}}));C=new Action("turn",-function(G,O){G=null!=O?O:G;n.turnShapes(n.getResizableCells(n.getSelectionCells()),null!=G?mxEvent.isShiftDown(G):!1)},null,null,mxClient.IS_SF?null:Editor.ctrlKey+"+R");C.getTitle=function(){return mxResources.get("turn")+" / "+mxResources.get("reverse")};this.put("turn",C);C=new Action("rotateEdge",function(G,O){G=null!=O?O:G;n.rotateEdges(n.getSelectionCells(),null!=G?mxEvent.isShiftDown(G):!1)});C.getTitle=function(){return mxResources.get("turn")};this.put("rotateEdge",C);this.put("selectConnections",+function(){var G=p.getSelectionState();if(null!=G.mergeCell){n.getModel().beginUpdate();try{n.setCellStyles("rowspan",G.rowspan,[G.mergeCell]),n.setCellStyles("colspan",G.colspan,[G.mergeCell])}finally{n.getModel().endUpdate()}}}));this.put("unmergeCells",new Action("unmerge",function(){var G=p.getSelectionState();if(0<G.cells.length){n.getModel().beginUpdate();try{n.setCellStyles("rowspan",null,G.cells),n.setCellStyles("colspan",null,G.cells)}finally{n.getModel().endUpdate()}}}));B=new Action("turn",+function(G,O){G=null!=O?O:G;n.turnShapes(n.getResizableCells(n.getSelectionCells()),null!=G?mxEvent.isShiftDown(G):!1)},null,null,mxClient.IS_SF?null:Editor.ctrlKey+"+R");B.getTitle=function(){return mxResources.get("turn")+" / "+mxResources.get("reverse")};this.put("turn",B);B=new Action("rotateEdge",function(G,O){G=null!=O?O:G;n.rotateEdges(n.getSelectionCells(),null!=G?mxEvent.isShiftDown(G):!1)});B.getTitle=function(){return mxResources.get("turn")};this.put("rotateEdge",B);this.put("selectConnections",new Action("selectEdges",function(G){G=n.getSelectionCell();n.isEnabled()&&null!=G&&n.addSelectionCells(n.getEdges(G))}));this.addAction("selectVertices",function(){n.selectVertices(null,!0)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+I");this.addAction("selectEdges",function(){n.selectEdges()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+E");this.addAction("selectAll",function(){n.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){n.clearSelection()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+A");this.addAction("lockUnlock",function(){if(!n.isSelectionEmpty()){n.getModel().beginUpdate();try{var G=n.getSelectionCells(),O=n.getCurrentCellStyle(n.getSelectionCell()),U=1==mxUtils.getValue(O,mxConstants.STYLE_EDITABLE,1)?0:1;n.setCellStyles(mxConstants.STYLE_MOVABLE,U,G);n.setCellStyles(mxConstants.STYLE_RESIZABLE,U,G);n.setCellStyles(mxConstants.STYLE_ROTATABLE,U,G);n.setCellStyles(mxConstants.STYLE_DELETABLE,U,G);n.setCellStyles(mxConstants.STYLE_EDITABLE,U,G);n.setCellStyles("locked",1==U?0:1,G);n.setCellStyles("connectable",U,G)}finally{n.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("explore",function(){var G=n.getSelectionCell();n.model.isEdge(G)&&(G=n.model.getTerminal(G,!0));n.model.isVertex(G)&&Graph.exploreFromCell(p.editor.graph,G)});this.addAction("home",function(){n.home()},null,null,"Shift+Home");this.addAction("exitGroup",function(){n.exitGroup()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+Home");this.addAction("enterGroup",@@ -3429,14 +3430,14 @@ n.stopEditing();null!=G&&"wrap"==G.style[mxConstants.STYLE_WHITE_SPACE]&&(O=nullmxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");p.showDialog(G.container,375,80,!0,!0);G.init()});this.addAction("resetView",function(){n.zoomTo(1);p.resetScrollbars()},null,null,"Enter/Home");this.addAction("zoomIn",function(G){n.isFastZoomEnabled()?n.lazyZoom(!0,!0,p.buttonZoomDelay):n.zoomIn()},null,null,Editor.ctrlKey+" + / Alt+Mousewheel");this.addAction("zoomOut",function(G){n.isFastZoomEnabled()?n.lazyZoom(!1,!0,p.buttonZoomDelay):n.zoomOut()},null,null,Editor.ctrlKey+" - / Alt+Mousewheel");this.addAction("fitWindow",function(){p.fitDiagramOrPages()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+H");this.addAction("fitPage",mxUtils.bind(this,function(){n.pageVisible?n.fitPages(1):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){n.pageVisible?n.fitPages(2):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){n.pageVisible?n.fitPages(1,!0):this.get("pageView").funct()}));this.put("customZoom",new Action("custom...",mxUtils.bind(this,function(){var G=new FilenameDialog(this.editorUi,parseInt(100*n.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(O){O=parseInt(O);!isNaN(O)&&0<O&&n.zoomTo(O/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(G.container,300,80,!0,!0);G.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var G=new FilenameDialog(this.editorUi,-parseInt(100*n.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(O){O=parseInt(O);!isNaN(O)&&0<O&&(O=new ChangePageSetup(p,null,null,null,O/100),O.ignoreColor=!0,O.ignoreImage=!0,n.model.execute(O))}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(G.container,300,80,!0,!0);G.init()}));C=null;C=this.addAction("grid",function(){n.setGridEnabled(!n.isGridEnabled());n.defaultGridEnabled=n.isGridEnabled();p.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+-"+"+Editor.shiftKey+"+G");C.setToggleAction(!0);C.setSelectedCallback(function(){return n.isGridEnabled()});C.setEnabled(!1);C=this.addAction("guides",function(){n.graphHandler.guidesEnabled=!n.graphHandler.guidesEnabled;p.fireEvent(new mxEventObject("guidesEnabledChanged"))});C.setToggleAction(!0);C.setSelectedCallback(function(){return n.graphHandler.guidesEnabled});C.setEnabled(!1);C=this.addAction("animations",function(){Editor.enableAnimations=!Editor.enableAnimations;p.fireEvent(new mxEventObject("enableAnimationsChanged"))});-C.setToggleAction(!0);C.setSelectedCallback(function(){return Editor.enableAnimations});C=this.addAction("tooltips",function(){n.tooltipHandler.setEnabled(!n.tooltipHandler.isEnabled());p.fireEvent(new mxEventObject("tooltipsEnabledChanged"))});C.setToggleAction(!0);C.setSelectedCallback(function(){return n.tooltipHandler.isEnabled()});C=this.addAction("collapseExpand",function(){var G=new ChangePageSetup(p);G.ignoreColor=!0;G.ignoreImage=!0;G.foldingEnabled=!n.foldingEnabled;n.model.execute(G)});-C.setToggleAction(!0);C.setSelectedCallback(function(){return n.foldingEnabled});C.isEnabled=y;C=this.addAction("pageView",mxUtils.bind(this,function(){p.setPageVisible(!n.pageVisible)}));C.setToggleAction(!0);C.setSelectedCallback(function(){return n.pageVisible});C=this.addAction("connectionArrows",function(){n.connectionArrowsEnabled=!n.connectionArrowsEnabled;p.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+A");C.setToggleAction(!0);C.setSelectedCallback(function(){return n.connectionArrowsEnabled});-C=this.addAction("connectionPoints",function(){n.setConnectable(!n.connectionHandler.isEnabled());p.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+O");C.setToggleAction(!0);C.setSelectedCallback(function(){return n.connectionHandler.isEnabled()});C=this.addAction("autosave",function(){p.editor.setAutosave(!p.editor.autosave)});C.setToggleAction(!0);C.setSelectedCallback(function(){return p.editor.autosave});C.isEnabled=y;C.visible=!1;this.addAction("help",-function(){var G="";mxResources.isLanguageSupported(mxClient.language)&&(G="_"+mxClient.language);n.openLink(RESOURCES_PATH+"/help"+G+".html")});var P=!1;C=new Action("about",function(){P||(p.showDialog((new AboutDialog(p)).container,320,280,!0,!0,function(){P=!1}),P=!0)});C.getTitle=function(){return mxResources.get("about")+" Graph Editor..."};this.put("about",C);C=mxUtils.bind(this,function(G,O,U,c){return this.addAction(G,function(){if(null!=U&&n.cellEditor.isContentEditing())U();else{n.stopEditing(!1);+parseInt(100*n.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(O){O=parseInt(O);!isNaN(O)&&0<O&&(O=new ChangePageSetup(p,null,null,null,O/100),O.ignoreColor=!0,O.ignoreImage=!0,n.model.execute(O))}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(G.container,300,80,!0,!0);G.init()}));B=null;B=this.addAction("grid",function(){n.setGridEnabled(!n.isGridEnabled());n.defaultGridEnabled=n.isGridEnabled();p.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey++"+"+Editor.shiftKey+"+G");B.setToggleAction(!0);B.setSelectedCallback(function(){return n.isGridEnabled()});B.setEnabled(!1);B=this.addAction("guides",function(){n.graphHandler.guidesEnabled=!n.graphHandler.guidesEnabled;p.fireEvent(new mxEventObject("guidesEnabledChanged"))});B.setToggleAction(!0);B.setSelectedCallback(function(){return n.graphHandler.guidesEnabled});B.setEnabled(!1);B=this.addAction("animations",function(){Editor.enableAnimations=!Editor.enableAnimations;p.fireEvent(new mxEventObject("enableAnimationsChanged"))});+B.setToggleAction(!0);B.setSelectedCallback(function(){return Editor.enableAnimations});B=this.addAction("tooltips",function(){n.tooltipHandler.setEnabled(!n.tooltipHandler.isEnabled());p.fireEvent(new mxEventObject("tooltipsEnabledChanged"))});B.setToggleAction(!0);B.setSelectedCallback(function(){return n.tooltipHandler.isEnabled()});B=this.addAction("collapseExpand",function(){var G=new ChangePageSetup(p);G.ignoreColor=!0;G.ignoreImage=!0;G.foldingEnabled=!n.foldingEnabled;n.model.execute(G)});+B.setToggleAction(!0);B.setSelectedCallback(function(){return n.foldingEnabled});B.isEnabled=y;B=this.addAction("pageView",mxUtils.bind(this,function(){p.setPageVisible(!n.pageVisible)}));B.setToggleAction(!0);B.setSelectedCallback(function(){return n.pageVisible});B=this.addAction("connectionArrows",function(){n.connectionArrowsEnabled=!n.connectionArrowsEnabled;p.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+A");B.setToggleAction(!0);B.setSelectedCallback(function(){return n.connectionArrowsEnabled});+B=this.addAction("connectionPoints",function(){n.setConnectable(!n.connectionHandler.isEnabled());p.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+O");B.setToggleAction(!0);B.setSelectedCallback(function(){return n.connectionHandler.isEnabled()});B=this.addAction("autosave",function(){p.editor.setAutosave(!p.editor.autosave)});B.setToggleAction(!0);B.setSelectedCallback(function(){return p.editor.autosave});B.isEnabled=y;B.visible=!1;this.addAction("help",+function(){var G="";mxResources.isLanguageSupported(mxClient.language)&&(G="_"+mxClient.language);n.openLink(RESOURCES_PATH+"/help"+G+".html")});var P=!1;B=new Action("about",function(){P||(p.showDialog((new AboutDialog(p)).container,320,280,!0,!0,function(){P=!1}),P=!0)});B.getTitle=function(){return mxResources.get("about")+" Graph Editor..."};this.put("about",B);B=mxUtils.bind(this,function(G,O,U,c){return this.addAction(G,function(){if(null!=U&&n.cellEditor.isContentEditing())U();else{n.stopEditing(!1);n.getModel().beginUpdate();try{var f=n.getEditableCells(n.getSelectionCells());n.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,O,f);(O&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?n.updateLabelElements(f,function(q){q.style.fontWeight=null;"B"==q.nodeName&&n.replaceElement(q)}):(O&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?n.updateLabelElements(f,function(q){q.style.fontStyle=null;"I"==q.nodeName&&n.replaceElement(q)}):(O&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.updateLabelElements(f,-function(q){q.style.textDecoration=null;"U"==q.nodeName&&n.replaceElement(q)});for(var k=0;k<f.length;k++)0==n.model.getChildCount(f[k])&&n.autoSizeCell(f[k],!1)}finally{n.getModel().endUpdate()}}},null,null,c)});C("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");C("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");C("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",+function(q){q.style.textDecoration=null;"U"==q.nodeName&&n.replaceElement(q)});for(var k=0;k<f.length;k++)0==n.model.getChildCount(f[k])&&n.autoSizeCell(f[k],!1)}finally{n.getModel().endUpdate()}}},null,null,c)});B("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");B("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");B("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){p.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000","default",n.shapeForegroundColor,void 0,mxResources.get("fontColor"))});this.addAction("strokeColor...",function(){p.menus.pickColor(mxConstants.STYLE_STROKECOLOR,null,null,"default",n.shapeForegroundColor,void 0,mxResources.get("strokeColor"))});this.addAction("fillColor...",function(){p.menus.pickColor(mxConstants.STYLE_FILLCOLOR,null,null,"default",n.shapeBackgroundColor,void 0,mxResources.get("fillColor"))});this.addAction("gradientColor...",function(){p.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR,null,null,"default",n.shapeForegroundColor,void 0,mxResources.get("gradientColor"))});this.addAction("backgroundColor...",function(){p.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor",null,"default",n.shapeBackgroundColor,void 0,mxResources.get("backgroundColor"))});this.addAction("borderColor...",function(){p.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR,null,null,"default",n.shapeForegroundColor,void 0,mxResources.get("borderColor"))});this.addAction("removeFormat",function(){if(n.isEnabled()&&!n.isSelectionEmpty()&&!n.isEditing()){n.getModel().beginUpdate();try{for(var G=n.getSelectionCells(),O=0;O<G.length;O++)n.removeTextStyleForCell(G[O],!0)}finally{n.getModel().endUpdate()}}});this.addAction("vertical",function(){p.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){p.menus.toggleStyle(mxConstants.STYLE_SHADOW)});@@ -3447,68 +3448,69 @@ null),p.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASU);n.setCellStyles(mxConstants.STYLE_CURVED,null);p.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[U,"0"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}}});this.addAction("curved",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),n.setCellStyles(mxConstants.STYLE_CURVED,"1"),p.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});this.addAction("collapsible",function(){var G=n.view.getState(n.getSelectionCell()),O="1";null!=G&&null!=n.getFoldingImage(G)&&(O="0");n.setCellStyles("collapsible",O);p.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[O],"cells",n.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var G=n.getEditableCells(n.getSelectionCells());if(null!=G&&0<G.length){var O=n.getModel();O=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",O.getStyle(G[0])||"",function(U){null!=U&&n.setCellStyle(mxUtils.trim(U),G)},null,null,400,220);this.editorUi.showDialog(O.container,420,300,!0,!0,null,null,null,new mxRectangle(0,0,300,200),null,"editStyle");O.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){n.isEnabled()&&!n.isSelectionEmpty()&&p.setDefaultStyle(n.getSelectionCell())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+-"+D");this.addAction("clearDefaultStyle",function(){n.isEnabled()&&p.clearDefaultStyle()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+R");this.addAction("addWaypoint",function(){var G=n.getSelectionCell();if(null!=G&&n.getModel().isEdge(G)){var O=v.graph.selectionCellsHandler.getHandler(G);if(O instanceof mxEdgeHandler){var U=0,c=0;G=n.getModel().getParent(G);for(var f=n.getCellGeometry(G);n.getModel().isVertex(G)&&null!=f;)U+=f.x,c+=f.y,G=n.getModel().getParent(G),f=n.getCellGeometry(G);G=n.popupMenuHandler.getTriggerPoint();+"+D");this.addAction("clearDefaultStyle",function(){n.isEnabled()&&p.clearDefaultStyle()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+R");this.addAction("addWaypoint",function(){var G=n.getSelectionCell();if(null!=G&&n.getModel().isEdge(G)){var O=u.graph.selectionCellsHandler.getHandler(G);if(O instanceof mxEdgeHandler){var U=0,c=0;G=n.getModel().getParent(G);for(var f=n.getCellGeometry(G);n.getModel().isVertex(G)&&null!=f;)U+=f.x,c+=f.y,G=n.getModel().getParent(G),f=n.getCellGeometry(G);G=n.popupMenuHandler.getTriggerPoint();U=Math.round(n.snap(G.x-U));c=Math.round(n.snap(G.y-c));O.addPointAt(O.state,U,c)}}});this.addAction("removeWaypoint",function(){var G=p.actions.get("removeWaypoint");null!=G.handler&&G.handler.removePoint(G.handler.state,G.index)});this.addAction("clearAnchors",function(){var G=n.getSelectionCells();if(null!=G){G=n.getEditableCells(n.addAllEdges(G));n.getModel().beginUpdate();try{for(var O=0;O<G.length;O++){var U=G[O];n.getModel().isEdge(U)&&(n.setCellStyles(mxConstants.STYLE_EXIT_X,null,[U]),n.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[U]),n.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[U]),n.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[U]))}}finally{n.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var G=n.getSelectionCells();if(null!=G){G=n.getEditableCells(n.addAllEdges(G));n.getModel().beginUpdate();try{for(var O=0;O<G.length;O++){var U=G[O];if(n.getModel().isEdge(U)){var c=n.getCellGeometry(U);null!=c&&(c=c.clone(),c.points=null,c.x=0,c.y=0,c.offset=null,n.getModel().setGeometry(U,c));n.setCellStyles("innerLoopWaypoints",-null,[U])}}}finally{n.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+R");C=this.addAction("subscript",mxUtils.bind(this,function(){n.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");C=this.addAction("superscript",mxUtils.bind(this,function(){n.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");C=this.addAction("decreaseFontSize",mxUtils.bind(this,function(){if(!n.isSelectionEmpty()){var G=-n.getCurrentCellStyle(n.getSelectionCell());G=mxUtils.getValue(G,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);n.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.max(1,G-1),n.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" + (Numpad)");C=this.addAction("increaseFontSize",mxUtils.bind(this,function(){if(!n.isSelectionEmpty()){var G=n.getCurrentCellStyle(n.getSelectionCell());G=mxUtils.getValue(G,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);n.setCellStyles(mxConstants.STYLE_FONTSIZE,-Math.min(100,G+1),n.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" - (Numpad)");this.addAction("image...",function(){if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())){var G=mxResources.get("image")+" ("+mxResources.get("url")+"):",O=n.getView().getState(n.getSelectionCell()),U="",c=null;null!=O&&(U=O.style[mxConstants.STYLE_IMAGE]||U,c=O.style[mxConstants.STYLE_CLIP_PATH]||c);var f=n.cellEditor.saveSelection();p.showImageDialog(G,U,function(k,q,x,B,E,L){if(n.cellEditor.isContentEditing())n.cellEditor.restoreSelection(f),-n.insertImage(k,q,x);else{var Q=n.getSelectionCells();if(null!=k&&(0<k.length||0<Q.length)){var V=null;n.getModel().beginUpdate();try{if(0==Q.length){Q=[n.insertVertex(n.getDefaultParent(),null,"",0,0,q,x,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var K=n.getCenterInsertPoint(n.getBoundingBoxFromGeometry(Q,!0));Q[0].geometry.x=K.x;Q[0].geometry.y=K.y;null!=B&&m(Q[0],B,E,L,n);V=Q;n.fireEvent(new mxEventObject("cellsInserted","cells",V))}n.setCellStyles(mxConstants.STYLE_IMAGE,-0<k.length?k:null,Q);var fa=n.getCurrentCellStyle(Q[0]);"image"!=fa[mxConstants.STYLE_SHAPE]&&"label"!=fa[mxConstants.STYLE_SHAPE]?n.setCellStyles(mxConstants.STYLE_SHAPE,"image",Q):0==k.length&&n.setCellStyles(mxConstants.STYLE_SHAPE,null,Q);null==B&&n.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,Q);if(null!=q&&null!=x)for(k=0;k<Q.length;k++){var aa=Q[k];if("0"!=n.getCurrentCellStyle(aa).expand){var da=n.getModel().getGeometry(aa);null!=da&&(da=da.clone(),da.width=q,da.height=x,n.getModel().setGeometry(aa,-da))}null!=B&&m(aa,B,E,L,n)}}finally{n.getModel().endUpdate()}null!=V&&(n.setSelectionCells(V),n.scrollCellToVisible(V[0]))}}},n.cellEditor.isContentEditing(),!n.cellEditor.isContentEditing(),!0,c)}}).isEnabled=y;this.addAction("crop...",function(){var G=n.getSelectionCell();if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())&&null!=G){var O=n.getCurrentCellStyle(G),U=O[mxConstants.STYLE_IMAGE],c=O[mxConstants.STYLE_SHAPE];U&&"image"==c&&(O=new CropImageDialog(p,U,O[mxConstants.STYLE_CLIP_PATH],-function(f,k,q){m(G,f,k,q,n)}),p.showDialog(O.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450)))}}).isEnabled=y;C=this.addAction("layers",mxUtils.bind(this,function(){if(null==this.layersWindow){var G=null!=p.installWindowPersistence?mxSettings.getWindowState("layers"):null;this.layersWindow=new LayersWindow(p,null!=G&&null!=G.x?G.x:document.body.offsetWidth-280,null!=G&&null!=G.y?G.y:120,null!=G&&null!=G.w?G.w:212,null!=G&&null!=G.h?G.h:200);this.layersWindow.window.addListener("show",+null,[U])}}}finally{n.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+R");B=this.addAction("subscript",mxUtils.bind(this,function(){n.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");B=this.addAction("superscript",mxUtils.bind(this,function(){n.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");B=this.addAction("decreaseFontSize",mxUtils.bind(this,function(){if(!n.isSelectionEmpty()){var G=+n.getCurrentCellStyle(n.getSelectionCell());G=mxUtils.getValue(G,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);n.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.max(1,G-1),n.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" + (Numpad)");B=this.addAction("increaseFontSize",mxUtils.bind(this,function(){if(!n.isSelectionEmpty()){var G=n.getCurrentCellStyle(n.getSelectionCell());G=mxUtils.getValue(G,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);n.setCellStyles(mxConstants.STYLE_FONTSIZE,+Math.min(100,G+1),n.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" - (Numpad)");this.addAction("image...",function(){if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())){var G=mxResources.get("image")+" ("+mxResources.get("url")+"):",O=n.getView().getState(n.getSelectionCell()),U="",c=null;null!=O&&(U=O.style[mxConstants.STYLE_IMAGE]||U,c=O.style[mxConstants.STYLE_CLIP_PATH]||c);var f=n.cellEditor.saveSelection();p.showImageDialog(G,U,function(k,q,x,C,E,L){if(n.cellEditor.isContentEditing())n.cellEditor.restoreSelection(f),+n.insertImage(k,q,x);else{var Q=n.getSelectionCells();if(null!=k&&(0<k.length||0<Q.length)){var V=null;n.getModel().beginUpdate();try{if(0==Q.length){Q=[n.insertVertex(n.getDefaultParent(),null,"",0,0,q,x,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var K=n.getCenterInsertPoint(n.getBoundingBoxFromGeometry(Q,!0));Q[0].geometry.x=K.x;Q[0].geometry.y=K.y;null!=C&&m(Q[0],C,E,L,n);V=Q;n.fireEvent(new mxEventObject("cellsInserted","cells",V))}n.setCellStyles(mxConstants.STYLE_IMAGE,+0<k.length?k:null,Q);var fa=n.getCurrentCellStyle(Q[0]);"image"!=fa[mxConstants.STYLE_SHAPE]&&"label"!=fa[mxConstants.STYLE_SHAPE]?n.setCellStyles(mxConstants.STYLE_SHAPE,"image",Q):0==k.length&&n.setCellStyles(mxConstants.STYLE_SHAPE,null,Q);null==C&&n.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,Q);if(null!=q&&null!=x)for(k=0;k<Q.length;k++){var aa=Q[k];if("0"!=n.getCurrentCellStyle(aa).expand){var da=n.getModel().getGeometry(aa);null!=da&&(da=da.clone(),da.width=q,da.height=x,n.getModel().setGeometry(aa,+da))}null!=C&&m(aa,C,E,L,n)}}finally{n.getModel().endUpdate()}null!=V&&(n.setSelectionCells(V),n.scrollCellToVisible(V[0]))}}},n.cellEditor.isContentEditing(),!n.cellEditor.isContentEditing(),!0,c)}}).isEnabled=y;this.addAction("crop...",function(){var G=n.getSelectionCell();if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())&&null!=G){var O=n.getCurrentCellStyle(G),U=O[mxConstants.STYLE_IMAGE],c=O[mxConstants.STYLE_SHAPE];U&&"image"==c&&(O=new CropImageDialog(p,U,O[mxConstants.STYLE_CLIP_PATH],+function(f,k,q){m(G,f,k,q,n)}),p.showDialog(O.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450)))}}).isEnabled=y;B=this.addAction("layers",mxUtils.bind(this,function(){if(null==this.layersWindow){var G=null!=p.installWindowPersistence?mxSettings.getWindowState("layers"):null;this.layersWindow=new LayersWindow(p,null!=G&&null!=G.x?G.x:document.body.offsetWidth-280,null!=G&&null!=G.y?G.y:120,null!=G&&null!=G.w?G.w:212,null!=G&&null!=G.h?G.h:200);this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){p.fireEvent(new mxEventObject("layers"))}));this.layersWindow.window.addListener("hide",function(){p.fireEvent(new mxEventObject("layers"))});null!=p.installWindowPersistence&&(p.installWindowPersistence("layers",this.layersWindow),null!=G&&p.restoreWindowState("layers",this.layersWindow));this.layersWindow.window.setVisible(!0);p.fireEvent(new mxEventObject("layers"));this.layersWindow.init()}else this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),-null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+L");C.setToggleAction(!0);C.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));C=this.addAction("format",mxUtils.bind(this,function(){p.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+P");C.setToggleAction(!0);C.setSelectedCallback(mxUtils.bind(this,function(){return p.isFormatPanelVisible()}));C=this.addAction("outline",mxUtils.bind(this,function(){if(null==this.outlineWindow){var G=+null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+L");B.setToggleAction(!0);B.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));B=this.addAction("format",mxUtils.bind(this,function(){p.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+P");B.setToggleAction(!0);B.setSelectedCallback(mxUtils.bind(this,function(){return p.isFormatPanelVisible()}));B=this.addAction("outline",mxUtils.bind(this,function(){if(null==this.outlineWindow){var G=null!=p.installWindowPersistence?mxSettings.getWindowState("outline"):null;this.outlineWindow=new OutlineWindow(p,null!=G&&null!=G.x?G.x:document.body.offsetWidth-260,null!=G&&null!=G.y?G.y:100,null!=G&&null!=G.w?G.w:180,null!=G&&null!=G.h?G.h:180);this.outlineWindow.window.addListener("show",mxUtils.bind(this,function(){p.fireEvent(new mxEventObject("outline"))}));this.outlineWindow.window.addListener("hide",function(){p.fireEvent(new mxEventObject("outline"))});null!=p.installWindowPersistence&&-(p.installWindowPersistence("outline",this.outlineWindow),null!=G&&p.restoreWindowState("outline",this.outlineWindow));this.outlineWindow.window.setVisible(!0);p.fireEvent(new mxEventObject("outline"))}else this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+O");C.setToggleAction(!0);C.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editPolygon...",+(p.installWindowPersistence("outline",this.outlineWindow),null!=G&&p.restoreWindowState("outline",this.outlineWindow));this.outlineWindow.window.setVisible(!0);p.fireEvent(new mxEventObject("outline"))}else this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+O");B.setToggleAction(!0);B.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editPolygon...",function(){var G=n.getSelectionCell();if(n.isEnabled()&&null!=G){var O=n.view.getState(G);if(null!=O&&"mxgraph.basic.polygon"===mxUtils.getValue(O.style,mxConstants.STYLE_SHAPE)){var U=new PolygonDialog(p,G);p.showDialog(U.container,680,540,!0,!0,function(){U.destroy()},null,null,new mxRectangle(0,0,740,600));U.init()}}}).isEnabled=y;this.addAction("editConnectionPoints...",function(){var G=n.getSelectionCell();if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())&&null!=G&&null!=G.geometry){var O=-new ConnectionPointsDialog(p,G);p.showDialog(O.container,400,450,!0,!1,function(){O.destroy()},null,null,new mxRectangle(0,0,450,500),null,"editConnectionPoints");O.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+Q").isEnabled=y};Actions.prototype.addAction=function(b,d,m,p,v,n){var y=b;"..."==y.substring(y.length-3)&&(y=y.substring(0,y.length-3));return this.put(y,new Action(b,d,m,p,v,n))};Actions.prototype.put=function(b,d){return this.actions[b]=d};Actions.prototype.get=function(b){return this.actions[b]};-function Action(b,d,m,p,v,n){mxEventSource.call(this);this.label=b;this.funct=this.createFunction(d);this.enabled=null!=m?m:!0;this.iconCls=p;this.shortcut=v;this.visible=null!=n?n:!0}mxUtils.extend(Action,mxEventSource);Action.prototype.getTitle=function(){var b=this.label;"..."==b.substring(b.length-3)?(b=b.substring(0,b.length-3),b=mxResources.get(b)+"..."):b=mxResources.get(b);return b};Action.prototype.createFunction=function(b){return b};+new ConnectionPointsDialog(p,G);p.showDialog(O.container,400,450,!0,!1,function(){O.destroy()},null,null,new mxRectangle(0,0,450,500),null,"editConnectionPoints");O.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+Q").isEnabled=y};Actions.prototype.addAction=function(b,d,m,p,u,n){var y=b;"..."==y.substring(y.length-3)&&(y=y.substring(0,y.length-3));return this.put(y,new Action(b,d,m,p,u,n))};Actions.prototype.put=function(b,d){return this.actions[b]=d};Actions.prototype.get=function(b){return this.actions[b]};+function Action(b,d,m,p,u,n){mxEventSource.call(this);this.label=b;this.funct=this.createFunction(d);this.enabled=null!=m?m:!0;this.iconCls=p;this.shortcut=u;this.visible=null!=n?n:!0}mxUtils.extend(Action,mxEventSource);Action.prototype.getTitle=function(){var b=this.label;"..."==b.substring(b.length-3)?(b=b.substring(0,b.length-3),b=mxResources.get(b)+"..."):b=mxResources.get(b);return b};Action.prototype.createFunction=function(b){return b};Action.prototype.setEnabled=function(b){this.enabled!=b&&(this.enabled=b,this.fireEvent(new mxEventObject("stateChanged","attribute","enabled")))};Action.prototype.isEnabled=function(){return this.enabled};Action.prototype.setVisible=function(b){this.visible!=b&&(this.visible=b,this.fireEvent(new mxEventObject("stateChanged","attribute","visible")))};Action.prototype.isVisible=function(){return this.visible};Action.prototype.setToggleAction=function(b){this.toggleAction=b};Action.prototype.setSelectedCallback=function(b){this.selectedCallback=b};Action.prototype.isSelected=function(){return this.selectedCallback()};DrawioFile=function(b,d){mxEventSource.call(this);this.ui=b;this.setData(d||"");this.initialData=this.getData();this.created=(new Date).getTime();this.stats={opened:0,merged:0,fileMerged:0,fileReloaded:0,conflicts:0,timeouts:0,saved:0,closed:0,destroyed:0,joined:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0}};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;DrawioFile.RESTRICT_EXPORT=!1;mxUtils.extend(DrawioFile,mxEventSource);-DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.savingSpinnerKey="saving";DrawioFile.prototype.savingStatusKey="saving";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.optimisticSyncDelay=300;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.lastSaved=null;DrawioFile.prototype.lastChanged=null;DrawioFile.prototype.opened=null;DrawioFile.prototype.modified=!1;-DrawioFile.prototype.shadowModified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.ageStart=null;DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};-DrawioFile.prototype.getShadowPages=function(){if(null==this.shadowPages&&(this.shadowPages=this.ui.getPagesForXml(this.initialData,!0),void 0===this.shadowVars)){this.shadowVars=null;try{var b=mxUtils.parseXml(this.initialData).documentElement;null!=b&&"mxfile"==b.nodeName&&(this.shadowVars=b.getAttribute("vars"))}catch(d){}}return this.shadowPages};+DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.savingSpinnerKey="saving";DrawioFile.prototype.savingStatusKey="saving";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.optimisticSyncDelay=300;DrawioFile.prototype.loadFontsTimeout=5E3;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.lastSaved=null;DrawioFile.prototype.lastChanged=null;+DrawioFile.prototype.opened=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.shadowModified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.ageStart=null;+DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};DrawioFile.prototype.getShadowPages=function(){if(null==this.shadowPages&&(this.shadowPages=this.ui.getPagesForXml(this.initialData,!0),void 0===this.shadowVars)){this.shadowVars=null;try{var b=mxUtils.parseXml(this.initialData).documentElement;null!=b&&"mxfile"==b.nodeName&&(this.shadowVars=b.getAttribute("vars"))}catch(d){}}return this.shadowPages};DrawioFile.prototype.setShadowPages=function(b,d){this.shadowPages=b;this.shadowVars=void 0!==d?d:null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null};DrawioFile.prototype.getShadowVars=function(){this.getShadowPages();return void 0!==this.shadowVars?this.shadowVars:null};-DrawioFile.prototype.synchronizeFile=function(b,d,m){EditorUi.debug("DrawioFile.synchronizeFile",[this],"latestFile",[m],"savingFile",this.savingFile);if(this.savingFile)null!=d&&d({message:mxResources.get("busy")});else{var p=!0,v=window.setTimeout(mxUtils.bind(this,function(){p=!1;null!=d&&d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,d)})})}),this.ui.timeout),n=mxUtils.bind(this,function(C){p&&(window.clearTimeout(v),null!=-d&&d(C))}),y=mxUtils.bind(this,function(){return!p});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,function(C){p&&(window.clearTimeout(v),this.sync.cleanup(b,d,C))}),n,y):this.updateFile(mxUtils.bind(this,function(){p&&(window.clearTimeout(v),null!=b&&b())}),n,y,null,null,m)}};-DrawioFile.prototype.updateFile=function(b,d,m,p,v,n){if(null==m||!m())if(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",v,"invalidChecksum",this.invalidChecksum,"latestFile",[n]),this.ui.getCurrentFile()!=this||this.invalidChecksum)null!=d&&d();else{var y=mxUtils.bind(this,function(C){try{null!=m&&m()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[C]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=d&&d():null!=C?this.mergeFile(C,-b,d,p,v):this.reloadFile(b,d))}catch(P){null!=d&&d(P)}});null!=n?y(n):this.getLatestVersion(y,d)}};-DrawioFile.prototype.mergeFile=function(b,d,m,p,v){try{var n=b.getShadowPages();if(null!=n&&0<n.length){var y=this.getShadowPages(),C=[this.ui.diffPages(null!=p?p:y,n)];p=null;try{var P=mxUtils.parseXml(b.initialData).documentElement;null!=P&&"mxfile"==P.nodeName&&(p=P.getAttribute("vars"))}catch(B){}p!=this.getShadowVars()&&(C[0][EditorUi.DIFF_FILE]={vars:p});var G=this.ignorePatches(C);if(G)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),-EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",G),null!=d&&d();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var O=this.isModified()?this.ui.diffPages(y,this.isRealtime()?this.ownPages:this.ui.pages):null,U=this.ui.patchPages(this.ui.clonePages(y),C[0]),c=this.ui.getHashValueForPages(U,{}),f=this.ui.getHashValueForPages(n,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",y,"pages",n,"patched",U,"patches",C,"changes",O,"checksum",-c,"current",f,"valid",c==f,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",v);if(null!=c&&c!=f)this.checksumError(m,C,null,null,"mergeFile",c,f,b.getCurrentRevisionId());else{this.setShadowPages(n,p);if(null!=this.sync){var k=this.sync.patchRealtime(C,DrawioFile.LAST_WRITE_WINS?O:null,null,v);null==k||mxUtils.isEmptyObject(k)||C.push(k)}this.patch(C,DrawioFile.LAST_WRITE_WINS?O:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());-this.descriptorChanged();null!=d&&d()}}catch(B){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=m&&m(B);try{if(!(B instanceof DOMException&&"InvalidCharacterError"==B.name)){var q=this.getCurrentUser(),x=null!=q?q.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),x,B)}}catch(E){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(B){null!=m&&m(B)}};-DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var d=new mxCodec(mxUtils.createXmlDocument()),m=d.document.createElement("mxfile");if(null!=b)for(var p=0;p<b.length;p++){var v=d.encode(new mxGraphModel(b[p].root));"1"!=urlParams.dev&&(v=this.ui.anonymizeNode(v,!0));v.setAttribute("id",b[p].getId());b[p].viewState&&this.ui.editor.graph.saveViewState(b[p].viewState,v,!0);m.appendChild(v)}return mxUtils.getPrettyXml(m)};+DrawioFile.prototype.synchronizeFile=function(b,d,m){EditorUi.debug("DrawioFile.synchronizeFile",[this],"latestFile",[m],"savingFile",this.savingFile);if(this.savingFile)null!=d&&d({message:mxResources.get("busy")});else{var p=!0,u=window.setTimeout(mxUtils.bind(this,function(){p=!1;null!=d&&d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,d)})})}),this.ui.timeout),n=mxUtils.bind(this,function(B){p&&(window.clearTimeout(u),null!=+d&&d(B))}),y=mxUtils.bind(this,function(){return!p});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,function(B){p&&(window.clearTimeout(u),this.sync.cleanup(b,d,B))}),n,y):this.updateFile(mxUtils.bind(this,function(){p&&(window.clearTimeout(u),null!=b&&b())}),n,y,null,null,m)}};+DrawioFile.prototype.updateFile=function(b,d,m,p,u,n){if(null==m||!m())if(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",u,"invalidChecksum",this.invalidChecksum,"latestFile",[n]),this.ui.getCurrentFile()!=this||this.invalidChecksum)null!=d&&d();else{var y=mxUtils.bind(this,function(B){try{null!=m&&m()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[B]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=d&&d():null!=B?this.mergeFile(B,+b,d,p,u):this.reloadFile(b,d))}catch(P){null!=d&&d(P)}});null!=n?y(n):this.getLatestVersion(y,d)}};+DrawioFile.prototype.mergeFile=function(b,d,m,p,u){try{var n=b.getShadowPages();if(null!=n&&0<n.length){var y=this.getShadowPages(),B=[this.ui.diffPages(null!=p?p:y,n)];p=null;try{var P=mxUtils.parseXml(b.initialData).documentElement;null!=P&&"mxfile"==P.nodeName&&(p=P.getAttribute("vars"))}catch(C){}p!=this.getShadowVars()&&(B[0][EditorUi.DIFF_FILE]={vars:p});var G=this.ignorePatches(B);if(G)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),+EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",G),null!=d&&d();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var O=this.isModified()?this.ui.diffPages(y,this.isRealtime()?this.ownPages:this.ui.pages):null,U=this.ui.patchPages(this.ui.clonePages(y),B[0]),c=this.ui.getHashValueForPages(U,{}),f=this.ui.getHashValueForPages(n,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",y,"pages",n,"patched",U,"patches",B,"changes",O,"checksum",+c,"current",f,"valid",c==f,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",u);if(null!=c&&c!=f)this.checksumError(m,B,null,null,"mergeFile",c,f,b.getCurrentRevisionId());else{this.setShadowPages(n,p);if(null!=this.sync){var k=this.sync.patchRealtime(B,DrawioFile.LAST_WRITE_WINS?O:null,null,u);null==k||mxUtils.isEmptyObject(k)||B.push(k)}this.patch(B,DrawioFile.LAST_WRITE_WINS?O:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());+this.descriptorChanged();null!=d&&d()}}catch(C){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=m&&m(C);try{if(!(C instanceof DOMException&&"InvalidCharacterError"==C.name)){var q=this.getCurrentUser(),x=null!=q?q.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),x,C)}}catch(E){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(C){null!=m&&m(C)}};+DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var d=new mxCodec(mxUtils.createXmlDocument()),m=d.document.createElement("mxfile");if(null!=b)for(var p=0;p<b.length;p++){var u=d.encode(new mxGraphModel(b[p].root));"1"!=urlParams.dev&&(u=this.ui.anonymizeNode(u,!0));u.setAttribute("id",b[p].getId());b[p].viewState&&this.ui.editor.graph.saveViewState(b[p].viewState,u,!0);m.appendChild(u)}return mxUtils.getPrettyXml(m)};DrawioFile.prototype.compressReportData=function(b,d,m){d=null!=d?d:1E4;null!=m&&null!=b&&b.length>m?b=b.substring(0,m)+"[...]":null!=b&&b.length>d&&(b=Graph.compress(b)+"\n");return b};-DrawioFile.prototype.checksumError=function(b,d,m,p,v,n,y,C){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var P=this.getCurrentUser(),G=null!=P?P.id:"unknown",O=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",U=JSON.stringify(d).length,c=null;if(null!=d&&1E3>U){b=[];for(m=0;m<d.length;m++)b.push(this.ui.anonymizePatch(d[m]));c=JSON.stringify(b);c=null!=c&&1E3>-c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(f){try{var k=null!=c?"report":"error",q=this.ui.getHashValueForPages(f.getShadowPages()),x="unknown",B="unknown",E="unknown";try{var L=null!=f.initialData&&0<f.initialData.length?mxUtils.parseXml(f.initialData).documentElement:null;null!=L&&(null!=L.getAttribute("version")&&(x=L.getAttribute("version")),null!=L.getAttribute("agent")&&(B=L.getAttribute("agent")),null!=L.getAttribute("type")&&(E=L.getAttribute("type")))}catch(Q){}EditorUi.logError("Checksum "+-k+" in "+v,null,this.getMode()+"."+O,"user_"+G+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+U+"-patches_"+d.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=n?"-expected_"+n:"")+(null!=y?"-current_"+y:"")+(null!=C?"-rev_"+this.ui.hashValue(C):"")+(null!=q?"-latest_"+q:"")+"-latestRev_"+this.ui.hashValue(f.getCurrentRevisionId())+("-latestVersion_"+x)+("-latestAgent_"+B)+("-latestType_"+E));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+O,action:v,label:"user_"++DrawioFile.prototype.checksumError=function(b,d,m,p,u,n,y,B){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var P=this.getCurrentUser(),G=null!=P?P.id:"unknown",O=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",U=JSON.stringify(d).length,c=null;if(null!=d&&1E3>U){b=[];for(m=0;m<d.length;m++)b.push(this.ui.anonymizePatch(d[m]));c=JSON.stringify(b);c=null!=c&&1E3>+c.length?Graph.compress(c):null}this.getLatestVersion(mxUtils.bind(this,function(f){try{var k=null!=c?"report":"error",q=this.ui.getHashValueForPages(f.getShadowPages()),x="unknown",C="unknown",E="unknown";try{var L=null!=f.initialData&&0<f.initialData.length?mxUtils.parseXml(f.initialData).documentElement:null;null!=L&&(null!=L.getAttribute("version")&&(x=L.getAttribute("version")),null!=L.getAttribute("agent")&&(C=L.getAttribute("agent")),null!=L.getAttribute("type")&&(E=L.getAttribute("type")))}catch(Q){}EditorUi.logError("Checksum "++k+" in "+u,null,this.getMode()+"."+O,"user_"+G+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+U+"-patches_"+d.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=n?"-expected_"+n:"")+(null!=y?"-current_"+y:"")+(null!=B?"-rev_"+this.ui.hashValue(B):"")+(null!=q?"-latest_"+q:"")+"-latestRev_"+this.ui.hashValue(f.getCurrentRevisionId())+("-latestVersion_"+x)+("-latestAgent_"+C)+("-latestType_"+E));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+O,action:u,label:"user_"+G+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+U+"-patches_"+d.length+"-size_"+this.getSize()})}catch(Q){}}),function(){})}catch(f){}};-DrawioFile.prototype.sendErrorReport=function(b,d,m,p){try{var v=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),n=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),y=this.getCurrentUser(),C=null!=y?this.ui.hashValue(y.id):"unknown",P=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",G=this.getTitle(),O=G.lastIndexOf(".");y="xml";0<O&&(y=G.substring(O));var U=null!=m?m.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()+-":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+y+")\nUser="+C+P+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=d?"\n\n"+d:-"")+(null!=m?"\n\nError: "+m.message:"")+"\n\nStack:\n"+U+"\n\nShadow:\n"+v+"\n\nData:\n"+n,p)}catch(c){}};-DrawioFile.prototype.reloadFile=function(b,d){try{this.stats.fileReloaded++;var m=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),p=this.ui.editor.graph,v=p.getSelectionCells(),n=p.getViewState(),y=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(C){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[m],"viewState",[n],"latestFile",C);null!=C?(this.ui.replaceFileData(C.getData(),-[m]),this.ui.restoreViewState(y,n,v),this.setDescriptor(C.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var P=this.ui.getCurrentFile();null!=P&&(P.stats=this.stats,P.patch([m]),P.fileChanged());this.ui.restoreViewState(y,n,v);null!=b&&b()}else null!=d&&d(this.ui.fileLoadedError)}),!0))}),d)}catch(C){null!=d&&d(C)}};+DrawioFile.prototype.sendErrorReport=function(b,d,m,p){try{var u=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),n=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),y=this.getCurrentUser(),B=null!=y?this.ui.hashValue(y.id):"unknown",P=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",G=this.getTitle(),O=G.lastIndexOf(".");y="xml";0<O&&(y=G.substring(O));var U=null!=m?m.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()++":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+y+")\nUser="+B+P+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=d?"\n\n"+d:+"")+(null!=m?"\n\nError: "+m.message:"")+"\n\nStack:\n"+U+"\n\nShadow:\n"+u+"\n\nData:\n"+n,p)}catch(c){}};+DrawioFile.prototype.reloadFile=function(b,d){try{this.stats.fileReloaded++;var m=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),p=this.ui.editor.graph,u=p.getSelectionCells(),n=p.getViewState(),y=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(B){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[m],"viewState",[n],"latestFile",B);null!=B?(this.ui.replaceFileData(B.getData(),+[m]),this.ui.restoreViewState(y,n,u),this.setDescriptor(B.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var P=this.ui.getCurrentFile();null!=P&&(P.stats=this.stats,P.patch([m]),P.fileChanged());this.ui.restoreViewState(y,n,u);null!=b&&b()}else null!=d&&d(this.ui.fileLoadedError)}),!0))}),d)}catch(B){null!=d&&d(B)}};DrawioFile.prototype.copyFile=function(b,d){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};DrawioFile.prototype.ignorePatches=function(b){var d=!0;if(null!=b)for(var m=0;m<b.length&&d;m++)d=d&&mxUtils.isEmptyObject(b[m]);return d};-DrawioFile.prototype.patch=function(b,d,m,p){if(null!=b){var v=this.ui.editor.undoManager,n=v.history.slice(),y=v.indexOfNextAdd,C=this.ui.editor.graph;C.container.style.visibility="hidden";var P=this.changeListenerEnabled;this.changeListenerEnabled=m;var G=C.foldingEnabled,O=C.mathEnabled,U=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var c=C.cellRenderer.redraw;C.cellRenderer.redraw=function(E){E.view.graph.isEditing(E.cell)&&(E.view.graph.scrollCellToVisible(E.cell),-E.view.graph.cellEditor.resize());c.apply(this,arguments)};C.model.beginUpdate();try{if(m){for(var f=this.ui.pages.slice(),k=this.ui.currentPage,q=this.ui.applyPatches(this.ui.pages,b,!0,d,this.isModified()),x=0;x<q.length;x++){var B=mxUtils.indexOf(this.ui.pages,q[x]);0>B?this.ui.insertPage(q[x],Math.min(x,this.ui.pages.length)):this.ui.movePage(B,x)}for(x=0;x<f.length;x++)0>mxUtils.indexOf(q,f[x])&&this.ui.removePage(f[x]);0<=mxUtils.indexOf(this.ui.pages,k)&&this.ui.selectPage(k,!0)}else this.ui.pages=-this.ui.applyPatches(this.ui.pages,b,!0,d,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);C.checkDefaultParent()}finally{C.container.style.visibility="",C.model.endUpdate(),C.cellRenderer.redraw=c,this.changeListenerEnabled=P,m||(v.history=n,v.indexOfNextAdd=y,v.fireEvent(new mxEventObject(mxEvent.CLEAR))),v=U!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):-null),(n=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&O!=C.mathEnabled?(this.ui.editor.updateGraphComponents(),C.refresh()):v?C.refresh():n&&(G!=C.foldingEnabled?C.view.revalidate():C.view.validate(),C.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!p&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",-[this],"patches",b,"resolver",d,"undoable",m)}return b};-DrawioFile.prototype.save=function(b,d,m,p,v,n){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",p,"overwrite",v,"manual",n,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!v&&this.invalidChecksum)if(null!=m)m({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=d&&d();else if(null!=m)m({message:mxResources.get("readOnly")});-else throw Error(mxResources.get("readOnly"));}catch(y){if(null!=m)m(y);else throw y;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var d=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=d&&(d.viewState=this.ui.editor.graph.getViewState(),d.needsUpdate=!0)}d=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return d};+DrawioFile.prototype.patch=function(b,d,m,p){if(null!=b){var u=this.ui.editor.undoManager,n=u.history.slice(),y=u.indexOfNextAdd,B=this.ui.editor.graph;B.container.style.visibility="hidden";var P=this.changeListenerEnabled;this.changeListenerEnabled=m;var G=B.foldingEnabled,O=B.mathEnabled,U=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b);var c=B.cellRenderer.redraw;B.cellRenderer.redraw=function(E){E.view.graph.isEditing(E.cell)&&(E.view.graph.scrollCellToVisible(E.cell),+E.view.graph.cellEditor.resize());c.apply(this,arguments)};B.model.beginUpdate();try{if(m){for(var f=this.ui.pages.slice(),k=this.ui.currentPage,q=this.ui.applyPatches(this.ui.pages,b,!0,d,this.isModified()),x=0;x<q.length;x++){var C=mxUtils.indexOf(this.ui.pages,q[x]);0>C?this.ui.insertPage(q[x],Math.min(x,this.ui.pages.length)):this.ui.movePage(C,x)}for(x=0;x<f.length;x++)0>mxUtils.indexOf(q,f[x])&&this.ui.removePage(f[x]);0<=mxUtils.indexOf(this.ui.pages,k)&&this.ui.selectPage(k,!0)}else this.ui.pages=+this.ui.applyPatches(this.ui.pages,b,!0,d,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);B.checkDefaultParent()}finally{B.container.style.visibility="",B.model.endUpdate(),B.cellRenderer.redraw=c,this.changeListenerEnabled=P,m||(u.history=n,u.indexOfNextAdd=y,u.fireEvent(new mxEventObject(mxEvent.CLEAR))),u=U!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):+null),(n=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&O!=B.mathEnabled?(this.ui.editor.updateGraphComponents(),B.refresh()):u?B.refresh():n&&(G!=B.foldingEnabled?B.view.revalidate():B.view.validate(),B.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!p&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages),this.sync.snapshotVars=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",+[this],"patches",b,"resolver",d,"undoable",m)}return b};DrawioFile.prototype.loadFonts=function(b){if(this.ui.getCurrentFile()==this&&/(\.svg)$/i.test(this.getTitle())&&this.ui.getSvgFileProperties(this.ui.fileNode).embedFonts){var d=null,m=!1,p=function(){m||(m=!0,window.clearTimeout(d),b())};d=window.setTimeout(p,this.loadFontsTimeout);try{this.ui.editor.loadFonts(mxUtils.bind(this,function(){this.ui.editor.embedExtFonts(p)}))}catch(u){p()}}else b()};+DrawioFile.prototype.save=function(b,d,m,p,u,n){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",p,"overwrite",u,"manual",n,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!u&&this.invalidChecksum)if(null!=m)m({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else{this.clearAutosave();var y=mxUtils.bind(this,function(){try{this.updateFileData(),null!=d&&d()}catch(B){if(null!=+m)m(B);else throw B;}});p?y():this.loadFonts(y)}else if(null!=m)m({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(B){if(null!=m)m(B);else throw B;}};+DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var d=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=d&&(d.viewState=this.ui.editor.graph.getViewState(),d.needsUpdate=!0)}d=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return d};DrawioFile.prototype.updateFileData=function(){null!=this.sync&&this.sync.sendLocalChanges();this.setData(this.createData());null!=this.sync&&this.sync.fileDataUpdated()};DrawioFile.prototype.isCompressedStorage=function(){return Editor.defaultCompressed};DrawioFile.prototype.isCompressed=function(){var b=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("compressed"):null;return null!=b?"false"!=b:this.isCompressedStorage()&&Editor.compressXml};DrawioFile.prototype.setLocked=function(b){this.ui.fileNode.setAttribute("locked",b?"true":"false");this.ui.fireEvent(new mxEventObject("lockedChanged"));this.fileChanged();b&&this.ui.editor.graph.clearSelection()};DrawioFile.prototype.isLocked=function(){var b=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("locked"):null;return null!=b?"true"==b:!1};DrawioFile.prototype.saveAs=function(b,d,m){};DrawioFile.prototype.saveFile=function(b,d,m,p){};DrawioFile.prototype.getFileUrl=function(){return null};DrawioFile.prototype.getFolderUrl=function(b){return null};DrawioFile.prototype.getPublicUrl=function(b){b(null)};DrawioFile.prototype.isRestricted=function(){return DrawioFile.RESTRICT_EXPORT};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.getShadowModified=function(){return this.shadowModified};DrawioFile.prototype.setShadowModified=function(b){this.shadowModified=b};DrawioFile.prototype.setModified=function(b){this.shadowModified=this.modified=b};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return!this.inConflictState&&this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(b,d,m){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.isTrashed=function(){return!1};DrawioFile.prototype.move=function(b,d,m){};-DrawioFile.prototype.share=function(){null!=this.ui.drive?this.ui.confirm(mxResources.get("saveItToGoogleDriveToCollaborate",[this.getTitle()]),mxUtils.bind(this,function(){this.ui.pickFolder(App.MODE_GOOGLE,mxUtils.bind(this,function(b){var d=this.ui.editor.graph,m=d.getSelectionCells(),p=d.getViewState(),v=this.ui.currentPage;this.ui.createFile(this.getTitle(),this.ui.getFileData(null,null,null,null,null,null,null,null,this),null,App.MODE_GOOGLE,null,!0,b,null,null,mxUtils.bind(this,function(){this.ui.restoreViewState(v,+DrawioFile.prototype.share=function(){null!=this.ui.drive?this.ui.confirm(mxResources.get("saveItToGoogleDriveToCollaborate",[this.getTitle()]),mxUtils.bind(this,function(){this.ui.pickFolder(App.MODE_GOOGLE,mxUtils.bind(this,function(b){var d=this.ui.editor.graph,m=d.getSelectionCells(),p=d.getViewState(),u=this.ui.currentPage;this.ui.createFile(this.getTitle(),this.ui.getFileData(null,null,null,null,null,null,null,null,this),null,App.MODE_GOOGLE,null,!0,b,null,null,mxUtils.bind(this,function(){this.ui.restoreViewState(u,p,m);this.ui.actions.get("share").funct()}))}))}),null,mxResources.get("saveToGoogleDrive",null,"Save to Google Drive"),mxResources.get("cancel")):this.ui.alert(mxResources.get("sharingAvailable"),null,380)};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.isChromelessView()||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};DrawioFile.prototype.setData=function(b){this.data=b;EditorUi.debug("DrawioFile.setData",[this],"data",[b])};DrawioFile.prototype.getData=function(){return this.data};DrawioFile.prototype.removeExtFonts=function(b){for(var d=0;null!=b&&d<b.length;d++){var m=b[d];null!=m.id&&0==m.id.indexOf("extFont_")&&m.parentNode.removeChild(m)}};DrawioFile.prototype.open=function(){this.stats.opened++;var b=this.getData();null!=b&&(this.ui.setFileData(b,this),this.isModified()||this.setShadowPages(this.ui.clonePages(this.ui.pages)));this.installListeners();this.isSyncSupported()&&this.startSync();EditorUi.debug("DrawioFile.open",[this])};DrawioFile.prototype.isPolling=function(){return!1};DrawioFile.prototype.getPollingInterval=function(){return 1E4};DrawioFile.prototype.isSyncSupported=function(){return!1};DrawioFile.prototype.isRealtime=function(){return null!=this.ownPages&&null!=this.ui.pages};DrawioFile.prototype.isRealtimeSupported=function(){return!1};DrawioFile.prototype.isRealtimeEnabled=function(){return Editor.enableRealtime&&"0"!=urlParams["fast-sync"]};DrawioFile.prototype.setRealtimeEnabled=function(){};DrawioFile.prototype.isRealtimeOptional=function(){return!1};DrawioFile.prototype.getRealtimeState=function(){return null!=this.sync&&null!=this.sync.p2pCollab?this.sync.p2pCollab.getState():3};DrawioFile.prototype.getRealtimeError=function(){return null!=this.sync&&null!=this.sync.p2pCollab?this.sync.p2pCollab.getLastError():null};DrawioFile.prototype.isOptimisticSync=function(){return!1};DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};DrawioFile.prototype.getRevisions=function(b,d){b(null)};-DrawioFile.prototype.getRecoveryVersion=function(b,d){this.isRevisionHistorySupported()?this.getRevisions(mxUtils.bind(this,function(m){if(null==m||2>m.length)b(null);else{var p=m.length-2,v=Math.max(0,p-5+1),n=mxUtils.bind(this,function(){if(p<v)EditorUi.debug("DrawioFile.getRecoveryVersion",[this],"no valid revision found in",m.length-1-v,"probed"),b(null);else{var y=m[p--];null==y||"function"!==typeof y.getXml?n():y.getXml(mxUtils.bind(this,function(C){if(this.ui.isFileDataLoadable(C)){var P=this.ui.formatRecoveryDate(y.modifiedDate);-b({type:"version",label:null!=P?mxResources.get("recoverVersionFrom",[P]):mxResources.get("recoverPreviousVersion"),description:mxResources.get("recoveryVersionDesc"),data:C,date:y.modifiedDate,lossy:!1})}else n()}),mxUtils.bind(this,function(){n()}))}});n()}}),mxUtils.bind(this,function(){b(null)})):b(null)};DrawioFile.prototype.loadDescriptor=function(b,d){b(null)};DrawioFile.prototype.loadPatchDescriptor=function(b,d){this.loadDescriptor(mxUtils.bind(this,function(m){b(m)}),d)};+DrawioFile.prototype.getRecoveryVersion=function(b,d){this.isRevisionHistorySupported()?this.getRevisions(mxUtils.bind(this,function(m){if(null==m||2>m.length)b(null);else{var p=m.length-2,u=Math.max(0,p-5+1),n=mxUtils.bind(this,function(){if(p<u)EditorUi.debug("DrawioFile.getRecoveryVersion",[this],"no valid revision found in",m.length-1-u,"probed"),b(null);else{var y=m[p--];null==y||"function"!==typeof y.getXml?n():y.getXml(mxUtils.bind(this,function(B){if(this.ui.isFileDataLoadable(B)){var P=this.ui.formatRecoveryDate(y.modifiedDate);+b({type:"version",label:null!=P?mxResources.get("recoverVersionFrom",[P]):mxResources.get("recoverPreviousVersion"),description:mxResources.get("recoveryVersionDesc"),data:B,date:y.modifiedDate,lossy:!1})}else n()}),mxUtils.bind(this,function(){n()}))}});n()}}),mxUtils.bind(this,function(){b(null)})):b(null)};DrawioFile.prototype.loadDescriptor=function(b,d){b(null)};DrawioFile.prototype.loadPatchDescriptor=function(b,d){this.loadDescriptor(mxUtils.bind(this,function(m){b(m)}),d)};DrawioFile.prototype.patchDescriptor=function(b,d){this.setDescriptorEtag(b,this.getDescriptorEtag(d));this.descriptorChanged()};DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC&&"fast"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(null==this.sync&&(this.sync=new DrawioFileSync(this)),this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.ui.fireEvent(new mxEventObject("realtimeStateChanged"))})),this.sync.start())};DrawioFile.prototype.isConflict=function(){return!1};DrawioFile.prototype.getChannelId=function(){return Graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(b){return null};DrawioFile.prototype.getCurrentUser=function(){return null};DrawioFile.prototype.getLatestVersion=function(b,d){b(null)};DrawioFile.prototype.getLatestVersionId=function(b,d){b(-1)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};@@ -3530,36 +3532,36 @@ DrawioFile.prototype.showRefreshDialog=function(b,d,m){null==m&&(m=mxResources.gfunction(){null!=b&&b();this.ui.alert(mxResources.get("copyCreated"))}),d)}),null,mxResources.get("merge"),mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&this.reloadFile(mxUtils.bind(this,function(){this.ui.spinner.stop();null!=b&&b()}),mxUtils.bind(this,function(){this.ui.spinner.stop();null!=d&&d()}))}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),380,130))};DrawioFile.prototype.showCopyDialog=function(b,d,m){this.invalidChecksum=this.inConflictState=!1;this.addUnsavedStatus();this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedOverwriteDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(b,d)}),null,mxResources.get("overwrite"),m,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),380,150)};DrawioFile.prototype.showConflictDialog=function(b,d){this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedSyncDialog"),mxResources.get("overwrite"),b,null,mxResources.get("merge"),d,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog();this.handleFileError(null,!1)}),380,130)};-DrawioFile.prototype.redirectToNewApp=function(b,d){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var m=window.location.protocol+"//"+window.location.host+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#"+this.getHash(),p=mxResources.get("redirectToNewApp");null!=d&&(p+=" ("+d+")");d=mxUtils.bind(this,function(){var v=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==m?window.location.reload():window.location.href=-m});null==b&&this.isModified()?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.redirectDialogShowing=!1}),v,mxResources.get("cancel"),mxResources.get("discardChanges")):v()});null!=b?this.isModified()?this.ui.confirm(p,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()}),d,mxResources.get("cancel"),mxResources.get("discardChanges")):this.ui.confirm(p,d,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()})):this.ui.alert(mxResources.get("redirectToNewApp"),+DrawioFile.prototype.redirectToNewApp=function(b,d){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var m=window.location.protocol+"//"+window.location.host+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#"+this.getHash(),p=mxResources.get("redirectToNewApp");null!=d&&(p+=" ("+d+")");d=mxUtils.bind(this,function(){var u=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==m?window.location.reload():window.location.href=+m});null==b&&this.isModified()?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.redirectDialogShowing=!1}),u,mxResources.get("cancel"),mxResources.get("discardChanges")):u()});null!=b?this.isModified()?this.ui.confirm(p,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()}),d,mxResources.get("cancel"),mxResources.get("discardChanges")):this.ui.confirm(p,d,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()})):this.ui.alert(mxResources.get("redirectToNewApp"),d)}};DrawioFile.prototype.handleFileSuccess=function(b){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(EditorUi.debug("DrawioFile.handleFileSuccess",[this],"saved",b,"modified",this.isModified(),"remoteFileChanged",null==this.sync?"n/a":this.sync.remoteFileChanged),this.isModified()?this.fileChanged():b?(this.isTrashed()?this.ui.updateStatus(mxUtils.bind(this,function(){this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get(this.allChangesSavedKey))+" ("+mxUtils.htmlEntities(mxResources.get("fileMovedToTrash"))+")")})):this.ui.updateStatus(mxUtils.bind(this,function(){this.addAllSavedStatus()})),null!=this.sync&&(this.sync.resetUpdateStatusThread(),this.sync.remoteFileChanged&&(this.sync.remoteFileChanged=!1,this.sync.fileChangedNotify()))):this.ui.clearStatus())};DrawioFile.prototype.handleFileError=function(b,d){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(this.inConflictState?this.handleConflictError(b,d):(this.isModified()&&this.addUnsavedStatus(b),d?this.ui.handleError(b,null!=b?mxResources.get("errorSavingFile"):null):this.isModified()||this.ui.updateStatus(mxUtils.bind(this,function(){var m=this.getErrorMessage(b);null!=m&&60<m.length&&(m=m.substring(0,60)+"...");this.ui.editor.setStatus('<div class="geStatusAlert">'+mxUtils.htmlEntities(mxResources.get("error"))+(null!=m?" ("+mxUtils.htmlEntities(m)+")":"")+"</div>")}))))};-DrawioFile.prototype.handleConflictError=function(b,d){var m=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),p=mxUtils.bind(this,function(y){this.handleFileError(y,!0)}),v=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&(this.ui.clearStatus(),this.save(!0,m,p,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage))}),n=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&-this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&this.save(!0,m,p,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage)}),p)});"none"==DrawioFile.SYNC?this.showCopyDialog(m,p,v):this.invalidChecksum&&d?this.showRefreshDialog(m,p,this.getErrorMessage(b)):d?this.showConflictDialog(v,n):this.addConflictStatus(this.getErrorMessage(b),mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));+DrawioFile.prototype.handleConflictError=function(b,d){var m=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),p=mxUtils.bind(this,function(y){this.handleFileError(y,!0)}),u=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&(this.ui.clearStatus(),this.save(!0,m,p,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage))}),n=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&+this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&this.save(!0,m,p,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage)}),p)});"none"==DrawioFile.SYNC?this.showCopyDialog(m,p,u):this.invalidChecksum&&d?this.showRefreshDialog(m,p,this.getErrorMessage(b)):d?this.showConflictDialog(u,n):this.addConflictStatus(this.getErrorMessage(b),mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));this.synchronizeFile(m,p)}))};DrawioFile.prototype.getErrorMessage=function(b){var d=null!=b?null!=b.error?b.error.message:b.message:null;null==d&&null!=b&&b.code==App.ERROR_TIMEOUT?d=mxResources.get("timeout"):"0"==d&&(d=mxResources.get("noResponse"));return d};DrawioFile.prototype.isOverdue=function(){return null!=this.ageStart&&Date.now()-this.ageStart.getTime()>=this.ui.warnInterval};-DrawioFile.prototype.compressionChanged=function(b){var d=null!=this.ownPages?this.ownPages:this.ui.pages;if(null!=d)for(var m=0;m<d.length;m++){var p=d[m].node;if(null!=p&&(null==this.ui.currentPage||this.ui.currentPage.getId()!=d[m].getId())){var v=p.getElementsByTagName("mxGraphModel");v=0<v.length?v[0]:null;var n=Graph.decompress(mxUtils.getNodeValue(p));b?0==n.length&&null!=v&&(EditorUi.removeChildNodes(p),mxUtils.setTextContent(p,Graph.compressNode(v)),EditorUi.debug("DrawioFile.compressionChanged",-[this],"Page "+m+" compressed")):0<n.length&&null==v&&(EditorUi.removeChildNodes(p),p.appendChild(mxUtils.parseXml(n).documentElement),EditorUi.debug("DrawioFile.compressionChanged",[this],"Page "+m+" decompressed"))}}};DrawioFile.prototype.fileReplaced=function(b){this.inConflictState=this.invalidChecksum=!1;null!=b&&this.patch(b);null!=this.sync&&this.sync.initRealtime();EditorUi.debug("DrawioFile.fileReplaced",[this],"patches",b)};+DrawioFile.prototype.compressionChanged=function(b){var d=null!=this.ownPages?this.ownPages:this.ui.pages;if(null!=d)for(var m=0;m<d.length;m++){var p=d[m].node;if(null!=p&&(null==this.ui.currentPage||this.ui.currentPage.getId()!=d[m].getId())){var u=p.getElementsByTagName("mxGraphModel");u=0<u.length?u[0]:null;var n=Graph.decompress(mxUtils.getNodeValue(p));b?0==n.length&&null!=u&&(EditorUi.removeChildNodes(p),mxUtils.setTextContent(p,Graph.compressNode(u)),EditorUi.debug("DrawioFile.compressionChanged",+[this],"Page "+m+" compressed")):0<n.length&&null==u&&(EditorUi.removeChildNodes(p),p.appendChild(mxUtils.parseXml(n).documentElement),EditorUi.debug("DrawioFile.compressionChanged",[this],"Page "+m+" decompressed"))}}};DrawioFile.prototype.fileReplaced=function(b){this.inConflictState=this.invalidChecksum=!1;null!=b&&this.patch(b);null!=this.sync&&this.sync.initRealtime();EditorUi.debug("DrawioFile.fileReplaced",[this],"patches",b)};DrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=new Date;this.setModified(!0);EditorUi.debug("DrawioFile.fileChanged",[this],"autosaveDelay",this.autosaveDelay,"autosave",this.isAutosave(),"saving",this.savingFile);this.isAutosave()?(null!=this.savingStatusKey&&this.ui.updateStatus(mxUtils.bind(this,function(){this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get(this.savingStatusKey))+"...")})),this.ui.scheduleSanityCheck(),null==this.ageStart&&(this.ageStart=new Date),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(d){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=this.lastChanged)}),mxUtils.bind(this,function(d){this.handleFileError(d)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus());null!=this.sync&&b&&this.sync.localFileChanged()};DrawioFile.prototype.createSecret=function(b){var d=Editor.guid(32);Editor.enableRealtimeCache&&null!=this.sync&&!this.isOptimisticSync()?this.sync.createToken(d,mxUtils.bind(this,function(m){EditorUi.debug("DrawioFile.createSecret",[this],"secret",d,"token",m);b(d,m)}),mxUtils.bind(this,function(){b(d)})):b(d)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};-DrawioFile.prototype.fileSaved=function(b,d,m,p,v,n,y){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;n=null!=n?n:this.ui.getPagesForXml(b,!0);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(n),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=m&&m()):this.sync.fileSaved(n,d,m,p,v,y)}catch(G){this.invalidChecksum=-this.inConflictState=!0;this.descriptorChanged();null!=p&&p(G);try{var C=this.getCurrentUser(),P=null!=C?C.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),P,G)}catch(O){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[d],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(G){this.descriptorChanged(),null!=p&&p(G)}};-DrawioFile.prototype.autosave=function(b,d,m,p){null==this.lastAutosave&&(this.lastAutosave=Date.now());var v=Date.now()-this.lastAutosave<d?b:0;this.clearAutosave();var n=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==n&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",n,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var y=this.isAutosaveRevision();-y&&(this.lastAutosaveRevision=(new Date).getTime());this.save(y,mxUtils.bind(this,function(C){this.autosaveCompleted();null!=m&&m(C)}),mxUtils.bind(this,function(C){null!=p&&p(C)}))}else this.isModified()||this.ui.clearStatus(),null!=m&&m(null)}catch(C){null!=p&&p(C)}}),v);this.autosaveThread=n;EditorUi.debug("DrawioFile.autosave",[this],"thread",n,"delay",b,"maxDelay",d,"actualDelay",v,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};+DrawioFile.prototype.fileSaved=function(b,d,m,p,u,n,y){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;n=null!=n?n:this.ui.getPagesForXml(b,!0);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(n),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=m&&m()):this.sync.fileSaved(n,d,m,p,u,y)}catch(G){this.invalidChecksum=+this.inConflictState=!0;this.descriptorChanged();null!=p&&p(G);try{var B=this.getCurrentUser(),P=null!=B?B.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),P,G)}catch(O){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[d],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(G){this.descriptorChanged(),null!=p&&p(G)}};+DrawioFile.prototype.autosave=function(b,d,m,p){null==this.lastAutosave&&(this.lastAutosave=Date.now());var u=Date.now()-this.lastAutosave<d?b:0;this.clearAutosave();var n=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==n&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",n,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var y=this.isAutosaveRevision();+y&&(this.lastAutosaveRevision=(new Date).getTime());this.save(y,mxUtils.bind(this,function(B){this.autosaveCompleted();null!=m&&m(B)}),mxUtils.bind(this,function(B){null!=p&&p(B)}))}else this.isModified()||this.ui.clearStatus(),null!=m&&m(null)}catch(B){null!=p&&p(B)}}),u);this.autosaveThread=n;EditorUi.debug("DrawioFile.autosave",[this],"thread",n,"delay",b,"maxDelay",d,"actualDelay",u,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var b=(new Date).getTime();return null==this.lastAutosaveRevision||b-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};DrawioFile.prototype.close=function(b){try{this.isAutosave()&&this.isModified()&&(this.updateFileData(),this.save(this.isAutosaveRevision(),null,null,b))}catch(d){}this.stats.closed++;this.destroy()};DrawioFile.prototype.hasSameExtension=function(b,d){if(null!=b&&null!=d){var m=b.lastIndexOf(".");b=0<m?b.substring(m):"";m=d.lastIndexOf(".");return b===(0<m?d.substring(m):"")}return b==d};DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(this.ui.editor.graph.model.removeListener(this.changeListener),this.ui.editor.graph.removeListener(this.changeListener),this.ui.removeListener(this.changeListener),this.changeListener=null)};DrawioFile.prototype.destroy=function(){this.clearAutosave();this.removeListeners();this.stats.destroyed++;null!=this.sync&&(this.sync.destroy(),this.sync=null)};DrawioFile.prototype.commentsSupported=function(){return!1};-DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,d){b([])};DrawioFile.prototype.addComment=function(b,d,m){d(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,d){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,d)};LocalFile=function(b,d,m,p,v,n,y){DrawioFile.call(this,b,d);this.title=m;this.mode=p?null:App.MODE_DEVICE;this.fileHandle=v;this.desc=n;this.editable=y};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};-LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&(null==this.editable||this.editable)};LocalFile.prototype.setEditable=function(b){this.editable=b;this.descriptorChanged()};LocalFile.prototype.save=function(b,d,m,p,v){this.saveAs(this.title,d,m,p,v)};LocalFile.prototype.saveAs=function(b,d,m,p,v){this.saveFile(b,!1,d,m,null,p,v)};+DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,d){b([])};DrawioFile.prototype.addComment=function(b,d,m){d(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,d){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,d)};LocalFile=function(b,d,m,p,u,n,y){DrawioFile.call(this,b,d);this.title=m;this.mode=p?null:App.MODE_DEVICE;this.fileHandle=u;this.desc=n;this.editable=y};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};+LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&(null==this.editable||this.editable)};LocalFile.prototype.setEditable=function(b){this.editable=b;this.descriptorChanged()};LocalFile.prototype.save=function(b,d,m,p,u){this.saveAs(this.title,d,m,p,u)};LocalFile.prototype.saveAs=function(b,d,m,p,u){this.saveFile(b,!1,d,m,null,p,u)};LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b};LocalFile.prototype.getLatestVersion=function(b,d){null==this.fileHandle?null!=d&&d({message:mxResources.get("cannotOpenFile")}):this.ui.loadFileSystemEntry(this.fileHandle,b,d)};-LocalFile.prototype.saveFile=function(b,d,m,p,v,n,y){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;v||this.updateFileData();var C=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var P=this.getData(),G=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=m&&m()}),O=mxUtils.bind(this,function(U){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=-!0;var c=mxUtils.bind(this,function(k){this.savingFile=!1;null!=p&&p({error:k})});this.saveDraft(P);this.fileHandle.createWritable().then(mxUtils.bind(this,function(k){this.fileHandle.getFile().then(mxUtils.bind(this,function(q){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[q],"conflict",this.desc.lastModified!=q.lastModified);y||this.desc.lastModified==q.lastModified?k.write(C?this.ui.base64ToBlob(U,"image/png"):U).then(mxUtils.bind(this,function(){k.close().then(mxUtils.bind(this,-function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(x){try{var B=this.desc;this.savingFile=!1;this.desc=x;this.fileSaved(P,B,G,c);this.removeDraft()}catch(E){c(E)}}),c)}),c)}),c):(this.inConflictState=!0,c())}),mxUtils.bind(this,function(q){this.invalidFileHandle=!0;c(q)}))}),c)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(U,b,C?"image/png":"text/xml",C);else if(U.length<MAX_REQUEST_SIZE){var f=b.lastIndexOf(".");f=0<f?b.substring(f+1):"xml";-(new mxXmlRequest(SAVE_URL,"format="+f+"&xml="+encodeURIComponent(U)+"&filename="+encodeURIComponent(b)+(C?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(U)}));G()}});C?(d=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(U){O(U)}),p,this.ui.getCurrentFile()!=this?P:null,d.scale,d.border)):O(P)};-LocalFile.prototype.rename=function(b,d,m){this.title=b;this.descriptorChanged();null!=d&&d()};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinFormatImage=+LocalFile.prototype.saveFile=function(b,d,m,p,u,n,y){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;if(u||n){u||this.updateFileData();var B=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var P=this.getData(),G=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=m&&m()}),O=mxUtils.bind(this,function(U){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=+!0;var c=mxUtils.bind(this,function(k){this.savingFile=!1;null!=p&&p({error:k})});this.saveDraft(P);this.fileHandle.createWritable().then(mxUtils.bind(this,function(k){this.fileHandle.getFile().then(mxUtils.bind(this,function(q){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[q],"conflict",this.desc.lastModified!=q.lastModified);y||this.desc.lastModified==q.lastModified?k.write(B?this.ui.base64ToBlob(U,"image/png"):U).then(mxUtils.bind(this,function(){k.close().then(mxUtils.bind(this,+function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(x){try{var C=this.desc;this.savingFile=!1;this.desc=x;this.fileSaved(P,C,G,c);this.removeDraft()}catch(E){c(E)}}),c)}),c)}),c):(this.inConflictState=!0,c())}),mxUtils.bind(this,function(q){this.invalidFileHandle=!0;c(q)}))}),c)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(U,b,B?"image/png":"text/xml",B);else if(U.length<MAX_REQUEST_SIZE){var f=b.lastIndexOf(".");f=0<f?b.substring(f+1):"xml";+(new mxXmlRequest(SAVE_URL,"format="+f+"&xml="+encodeURIComponent(U)+"&filename="+encodeURIComponent(b)+(B?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(U)}));G()}});B?(u=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(U){O(U)}),p,this.ui.getCurrentFile()!=this?P:null,u.scale,u.border)):O(P)}else this.loadFonts(mxUtils.bind(this,+function(){this.updateFileData();this.saveFile(b,d,m,p,!0,n,y)}))};LocalFile.prototype.rename=function(b,d,m){this.title=b;this.descriptorChanged();null!=d&&d()};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";Editor.thinGestureImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI4IDQxLjZxLTIuNSAwLTQuMDc1LTEuNjUtMS41NzUtMS42NS0xLjU3NS00LjM1IDAtMi4zNSAxLjEtNC4xIDEuMS0xLjc1IDIuODI1LTIuOTUgMS43MjUtMS4yIDMuNy0xLjgyNVQzMy42NSAyNnEtLjE1LTMuMDUtMS4yNS00LjQyNVQyOS4yNSAyMC4ycS0yLjMgMC00LjE3NSAxLjV0LTQuNDI1IDQuOTVxLTIuNjUgMy40NS00LjYgNS4xLTEuOTUgMS42NS00LjM1IDEuNjUtMi4xIDAtMy42NS0xLjM3NVE2LjUgMzAuNjUgNi41IDI3LjQ1cTAtMiAxLjItNC41MjUgMS4yLTIuNTI1IDMuNS02LjE3NSAxLjMtMS44NSAxLjk3NS0zLjIyNXQuNjc1LTIuMzc1cTAtLjctLjM1LTEuMDUtLjM1LS4zNS0xLjA1LS4zNS0uNzUgMC0xLjYuNDc1UTEwIDEwLjcgOSAxMS45TDcgOS44cTEuMzUtMS41NSAyLjcyNS0yLjI3NVExMS4xIDYuOCAxMi41IDYuOHExLjkgMCAzLjEgMS4yNSAxLjIgMS4yNSAxLjIgMy4yIDAgMS44LS45NzUgMy41NzVRMTQuODUgMTYuNiAxMy4wNSAxOS4zcS0xLjk1IDIuOTUtMi43NzUgNC43dC0uODI1IDMuNjVxMCAxLjYuNzUgMi4yLjc1LjYgMS43NS42IDEuNDUgMCAyLjgyNS0xLjMgMS4zNzUtMS4zIDMuNTc1LTQuMTUgMi45NS0zLjggNS41MjUtNS43NzUgMi41NzUtMS45NzUgNS42NzUtMS45NzUgMy4xNSAwIDUgMi4zMjVUMzYuNiAyNS45aDQuOXYyLjk1aC00LjlxLS40NSA3LjM1LTMuMiAxMC4wNS0yLjc1IDIuNy01LjQgMi43Wm0uMS0yLjk1cTEuODUgMCAzLjY1LTIuMjUgMS44LTIuMjUgMi03LjUtMi44LjE1LTUuNjI1IDIuMDI1VDI1LjMgMzUuOXEwIDEuMy43NSAyLjAyNS43NS43MjUgMi4wNS43MjVaIi8+PC9zdmc+";Editor.thinShapesImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI5Ljc1IDI5Ljc1Wm0tMTMgNS40NXEuNC4wNS43NS4wNUgxOS4wNXY0LjY1cTAgLjI1LjE3NS40MjV0LjQyNS4xNzVIMzkuOXEuMjUgMCAuNDI1LS4xNzV0LjE3NS0uNDI1VjE5LjY1cTAtLjI1LS4xNzUtLjQyNXQtLjQyNS0uMTc1aC00LjY1VjE3LjVxMC0uMzUtLjA1LS43NWg0LjdxMS4xNSAwIDIgLjg3NS44NS44NzUuODUgMi4wMjVWMzkuOXEwIDEuMTUtLjg1IDItLjg1Ljg1LTIgLjg1SDE5LjY1cS0xLjE1IDAtMi4wMjUtLjg1dC0uODc1LTJabTEuNS0zLjk1cS01LjQ1IDAtOS4yMjUtMy44LTMuNzc1LTMuOC0zLjc3NS05LjIgMC01LjQ1IDMuNzc1LTkuMjI1UTEyLjggNS4yNSAxOC4yNSA1LjI1cTUuNCAwIDkuMiAzLjc3NSAzLjggMy43NzUgMy44IDkuMjI1IDAgNS40LTMuOCA5LjItMy44IDMuOC05LjIgMy44Wm0tLjA1LTIuM3E0LjQ1IDAgNy42LTMuMTI1IDMuMTUtMy4xMjUgMy4xNS03LjU3NXQtMy4xMjUtNy42UTIyLjcgNy41IDE4LjI1IDcuNXQtNy42IDMuMTI1UTcuNSAxMy43NSA3LjUgMTguMnQzLjEyNSA3LjZxMy4xMjUgMy4xNSA3LjU3NSAzLjE1Wm0uMDUtMTAuN1oiLz48L3N2Zz4=";@@ -3655,26 +3657,26 @@ Editor.jpgSupported=!1;Editor.webpSupported=!1;(function(){try{var l=document.crH.type="text/css";var J=H.appendChild,R=document,T=R.createTextNode;t=t.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(t=t.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(Y){}J.call(H,T.call(R,t));document.head.appendChild(H)}}))};Editor.replacePlaceholders=function(l,t){var H=[];if(null!=l&&null!=t){for(var J=RegExp("{([^{}\"'=;]+)}","g"),R,T=0;R=J.exec(l);){var Y=R[0];if(2<Y.length){var Z=t(Y.substring(1,Y.length-1)),ia=Y;null!=Z&&(ia=Z);H.push(l.substring(T,R.index)+ia);T=R.index+Y.length}}H.push(l.substring(T))}return H.join("")};Editor.executeSimpleJsonPath=function(l,t){t=t.replace(/^\$\.?/,"").split(".");t=$jscomp.makeIterator(t);for(var H=t.next();!H.done;H=t.next()){var J=H.value;if(!l)return[];if(H=J.match(/([^\[]+)\[(\d+)\]/))if(J=H[1],H=parseInt(H[2]),l=l[J],Array.isArray(l)&&H<l.length)l=l[H];else return[];else l=l[J]}return void 0!==l?[l]:[]};Editor.createRoughCanvas=function(l){var t=rough.canvas({getContext:function(){return l}});t.draw=function(H){var J=H.sets||[];H=H.options||this.getDefaultOptions();for(var R=0;R<J.length;R++){var T=J[R];switch(T.type){case "path":null!=H.stroke&&this._drawToContext(l,T,H);break;case "fillPath":this._drawToContext(l,T,H);break;case "fillSketch":this.fillSketch(l,T,H)}}};t.fillSketch=function(H,J,R){var T=-l.state.strokeColor,Y=l.state.strokeWidth,Z=l.state.strokeAlpha,ia=l.state.dashed,ka=R.fillWeight;0>ka&&(ka=R.strokeWidth/2);l.setStrokeAlpha(l.state.fillAlpha);l.setStrokeColor(R.fill||"");l.setStrokeWidth(ka);l.setDashed(!1);ka=null!=H.root?H.root.lastChild:null;this._drawToContext(H,J,R);null!=H.root&&null!=H.root.lastChild&&H.root.lastChild!=ka&&"path"==H.root.lastChild.nodeName&&H.root.lastChild.setAttribute("data-rough-fill","1");l.setDashed(ia);l.setStrokeWidth(Y);l.setStrokeColor(T);l.setStrokeAlpha(Z)};+l.state.strokeColor,Y=l.state.strokeWidth,Z=l.state.strokeAlpha,ia=l.state.dashed,ja=R.fillWeight;0>ja&&(ja=R.strokeWidth/2);l.setStrokeAlpha(l.state.fillAlpha);l.setStrokeColor(R.fill||"");l.setStrokeWidth(ja);l.setDashed(!1);ja=null!=H.root?H.root.lastChild:null;this._drawToContext(H,J,R);null!=H.root&&null!=H.root.lastChild&&H.root.lastChild!=ja&&"path"==H.root.lastChild.nodeName&&H.root.lastChild.setAttribute("data-rough-fill","1");l.setDashed(ia);l.setStrokeWidth(Y);l.setStrokeColor(T);l.setStrokeAlpha(Z)};t._drawToContext=function(H,J,R){H.begin();for(var T=0;T<J.ops.length;T++){var Y=J.ops[T],Z=Y.data;switch(Y.op){case "move":H.moveTo(Z[0],Z[1]);break;case "bcurveTo":H.curveTo(Z[0],Z[1],Z[2],Z[3],Z[4],Z[5]);break;case "lineTo":H.lineTo(Z[0],Z[1])}}H.end();"fillPath"===J.type&&R.filled?H.fill():H.stroke()};return t};(function(){function l(T,Y,Z){this.canvas=T;this.rc=Y;this.shape=Z;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,l.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,l.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,l.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,l.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,l.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,l.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,l.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,l.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,l.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,l.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,l.prototype.close);this.originalFill=this.canvas.fill;this.canvas.fill=mxUtils.bind(this,l.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,l.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;this.canvas.fillAndStroke=mxUtils.bind(this,l.prototype.fillAndStroke);this.path=[];this.passThrough=!1}l.prototype.moveOp="M";l.prototype.lineOp="L";l.prototype.quadOp="Q";l.prototype.curveOp="C";l.prototype.closeOp="Z";l.prototype.getStyle=function(T,Y){var Z=1;if(null!=this.shape.state){var ia=this.shape.state.cell.id;-if(null!=ia)for(var ka=0;ka<ia.length;ka++)Z=(Z<<5)-Z+ia.charCodeAt(ka)<<0}Z={strokeWidth:this.canvas.state.strokeWidth,seed:Z,preserveVertices:!0};ia=this.rc.getDefaultOptions();Z.stroke=T?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;T=null;(Z.filled=Y)?(Z.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,T=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):Z.fill=+if(null!=ia)for(var ja=0;ja<ia.length;ja++)Z=(Z<<5)-Z+ia.charCodeAt(ja)<<0}Z={strokeWidth:this.canvas.state.strokeWidth,seed:Z,preserveVertices:!0};ia=this.rc.getDefaultOptions();Z.stroke=T?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;T=null;(Z.filled=Y)?(Z.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,T=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):Z.fill="";Z.bowing=mxUtils.getValue(this.shape.style,"bowing",ia.bowing);Z.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",ia.hachureAngle);Z.curveFitting=mxUtils.getValue(this.shape.style,"curveFitting",ia.curveFitting);Z.roughness=mxUtils.getValue(this.shape.style,"jiggle",ia.roughness);Z.simplification=mxUtils.getValue(this.shape.style,"simplification",ia.simplification);Z.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",ia.disableMultiStroke);Z.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",ia.disableMultiStrokeFill);Y=mxUtils.getValue(this.shape.style,"hachureGap",-1);Z.hachureGap="auto"==Y?-1:Y;Z.dashGap=mxUtils.getValue(this.shape.style,"dashGap",Y);Z.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",Y);Z.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",Y);Y=mxUtils.getValue(this.shape.style,"fillWeight",-1);Z.fillWeight="auto"==Y?-1:Y;Y=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==Y&&-(Y="auto");if("auto"==Y){var X=mxUtils.lightDarkColorSupported?Editor.isDarkMode():mxUtils.preferDarkColor;Y=function(ja){mxUtils.isLightDarkColor(ja)&&(ja=mxUtils.parseLightDarkColor(ja),ja=X?ja.dark:ja.light);return mxUtils.hex2rgb(ja)};ka=[Y("#ffffff")];null!=this.shape.state&&ka.push(Y(this.shape.state.view.graph.shapeBackgroundColor));Editor.isDarkMode()&&ka.push(Y(Editor.darkColor));Y=null!=Z.fill&&(null!=T||0<=mxUtils.indexOf(ka,Y(Z.fill)))?"solid":ia.fillStyle}Z.fillStyle=Y;return Z};l.prototype.begin=+(Y="auto");if("auto"==Y){var X=mxUtils.lightDarkColorSupported?Editor.isDarkMode():mxUtils.preferDarkColor;Y=function(ka){mxUtils.isLightDarkColor(ka)&&(ka=mxUtils.parseLightDarkColor(ka),ka=X?ka.dark:ka.light);return mxUtils.hex2rgb(ka)};ja=[Y("#ffffff")];null!=this.shape.state&&ja.push(Y(this.shape.state.view.graph.shapeBackgroundColor));Editor.isDarkMode()&&ja.push(Y(Editor.darkColor));Y=null!=Z.fill&&(null!=T||0<=mxUtils.indexOf(ja,Y(Z.fill)))?"solid":ia.fillStyle}Z.fillStyle=Y;return Z};l.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};l.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};l.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var T=2;T<arguments.length;T+=2)this.lastX=arguments[T-1],this.lastY=arguments[T],this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};l.prototype.lineTo=function(T,Y){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,T,Y),this.lastX=T,this.lastY=Y)};l.prototype.moveTo=function(T,Y){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,T,Y),this.lastX=T,this.lastY=Y,this.firstX=T,this.firstY=Y)};l.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,arguments):this.addOp(this.closeOp)};l.prototype.quadTo=function(T,Y,Z,ia){this.passThrough?this.originalQuadTo.apply(this.canvas,-arguments):(this.addOp(this.quadOp,T,Y,Z,ia),this.lastX=Z,this.lastY=ia)};l.prototype.curveTo=function(T,Y,Z,ia,ka,X){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,T,Y,Z,ia,ka,X),this.lastX=ka,this.lastY=X)};l.prototype.arcTo=function(T,Y,Z,ia,ka,X,ja){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var na=mxUtils.arcToCurves(this.lastX,this.lastY,T,Y,Z,ia,ka,X,ja);if(null!=na)for(var la=0;la<na.length;la+=6)this.curveTo(na[la],-na[la+1],na[la+2],na[la+3],na[la+4],na[la+5]);this.lastX=X;this.lastY=ja}};l.prototype.rect=function(T,Y,Z,ia){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(T,Y,Z,ia,this.getStyle(!0,!0)))};l.prototype.ellipse=function(T,Y,Z,ia){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(T+Z/2,Y+ia/2,Z,ia,this.getStyle(!0,!0)))};l.prototype.roundrect=function(T,-Y,Z,ia,ka,X){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(T+ka,Y),this.lineTo(T+Z-ka,Y),this.quadTo(T+Z,Y,T+Z,Y+X),this.lineTo(T+Z,Y+ia-X),this.quadTo(T+Z,Y+ia,T+Z-ka,Y+ia),this.lineTo(T+ka,Y+ia),this.quadTo(T,Y+ia,T,Y+ia-X),this.lineTo(T,Y+X),this.quadTo(T,Y,T+ka,Y))};l.prototype.drawPath=function(T){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),T)}catch(Z){}this.passThrough=!1}else if(null!=this.nextShape){for(var Y in T)this.nextShape.options[Y]=+arguments):(this.addOp(this.quadOp,T,Y,Z,ia),this.lastX=Z,this.lastY=ia)};l.prototype.curveTo=function(T,Y,Z,ia,ja,X){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,T,Y,Z,ia,ja,X),this.lastX=ja,this.lastY=X)};l.prototype.arcTo=function(T,Y,Z,ia,ja,X,ka){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var na=mxUtils.arcToCurves(this.lastX,this.lastY,T,Y,Z,ia,ja,X,ka);if(null!=na)for(var la=0;la<na.length;la+=6)this.curveTo(na[la],+na[la+1],na[la+2],na[la+3],na[la+4],na[la+5]);this.lastX=X;this.lastY=ka}};l.prototype.rect=function(T,Y,Z,ia){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(T,Y,Z,ia,this.getStyle(!0,!0)))};l.prototype.ellipse=function(T,Y,Z,ia){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(T+Z/2,Y+ia/2,Z,ia,this.getStyle(!0,!0)))};l.prototype.roundrect=function(T,+Y,Z,ia,ja,X){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(T+ja,Y),this.lineTo(T+Z-ja,Y),this.quadTo(T+Z,Y,T+Z,Y+X),this.lineTo(T+Z,Y+ia-X),this.quadTo(T+Z,Y+ia,T+Z-ja,Y+ia),this.lineTo(T+ja,Y+ia),this.quadTo(T,Y+ia,T,Y+ia-X),this.lineTo(T,Y+X),this.quadTo(T,Y,T+ja,Y))};l.prototype.drawPath=function(T){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),T)}catch(Z){}this.passThrough=!1}else if(null!=this.nextShape){for(var Y in T)this.nextShape.options[Y]=T[Y];T.stroke!=mxConstants.NONE&&null!=T.stroke||delete this.nextShape.options.stroke;T.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};l.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};l.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};l.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};l.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo;this.canvas.close=this.originalClose;this.canvas.fill=this.originalFill;this.canvas.stroke=this.originalStroke;this.canvas.fillAndStroke=this.originalFillAndStroke;this.canvas.begin=this.originalBegin;this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(T){return new l(T,Editor.createRoughCanvas(T),this)};var t=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(T){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?t.apply(this,arguments):"comic"==mxUtils.getValue(this.style,-"sketchStyle","rough")?this.createComicCanvas(T):this.createRoughCanvas(T)};var H=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(T,Y,Z,ia,ka){null!=T.handJiggle&&T.handJiggle.passThrough||H.apply(this,arguments)};var J=mxShape.prototype.paint;mxShape.prototype.paint=function(T){var Y=T.addTolerance,Z=!0;null!=this.style&&(Z="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=T.handJiggle&&T.handJiggle.constructor==l&&!this.outline){T.save();-var ia=this.fill,ka=this.stroke;this.stroke=this.fill=null;var X=this.configurePointerEvents,ja=T.setStrokeColor;T.setStrokeColor=function(){};var na=T.setFillColor;T.setFillColor=function(){};Z||null==ia||(this.configurePointerEvents=function(){});T.handJiggle.passThrough=!0;J.apply(this,arguments);T.handJiggle.passThrough=!1;T.setFillColor=na;T.setStrokeColor=ja;this.configurePointerEvents=X;this.stroke=ka;this.fill=ia;T.restore();Z&&null!=ia&&(T.addTolerance=function(){})}J.apply(this,arguments);-T.addTolerance=Y};var R=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(T,Y,Z,ia,ka,X){null!=T.handJiggle&&T.handJiggle.constructor==l?(T.handJiggle.passThrough=!0,R.apply(this,arguments),T.handJiggle.passThrough=!1):R.apply(this,arguments)}})();Editor.fastCompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?l:Graph.arrayBufferToString(pako.deflateRaw(l))};Editor.fastDecompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?+"sketchStyle","rough")?this.createComicCanvas(T):this.createRoughCanvas(T)};var H=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(T,Y,Z,ia,ja){null!=T.handJiggle&&T.handJiggle.passThrough||H.apply(this,arguments)};var J=mxShape.prototype.paint;mxShape.prototype.paint=function(T){var Y=T.addTolerance,Z=!0;null!=this.style&&(Z="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=T.handJiggle&&T.handJiggle.constructor==l&&!this.outline){T.save();+var ia=this.fill,ja=this.stroke;this.stroke=this.fill=null;var X=this.configurePointerEvents,ka=T.setStrokeColor;T.setStrokeColor=function(){};var na=T.setFillColor;T.setFillColor=function(){};Z||null==ia||(this.configurePointerEvents=function(){});T.handJiggle.passThrough=!0;J.apply(this,arguments);T.handJiggle.passThrough=!1;T.setFillColor=na;T.setStrokeColor=ka;this.configurePointerEvents=X;this.stroke=ja;this.fill=ia;T.restore();Z&&null!=ia&&(T.addTolerance=function(){})}J.apply(this,arguments);+T.addTolerance=Y};var R=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(T,Y,Z,ia,ja,X){null!=T.handJiggle&&T.handJiggle.constructor==l?(T.handJiggle.passThrough=!0,R.apply(this,arguments),T.handJiggle.passThrough=!1):R.apply(this,arguments)}})();Editor.fastCompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?l:Graph.arrayBufferToString(pako.deflateRaw(l))};Editor.fastDecompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?l:pako.inflateRaw(Graph.stringToArrayBuffer(atob(l)),{to:"string"})};Editor.extractGraphModel=function(l,t,H){if(null!=l&&"undefined"!==typeof pako){var J=l.ownerDocument.getElementsByTagName("div"),R=[];if(null!=J&&0<J.length)for(var T=0;T<J.length;T++)if("mxgraph"==J[T].getAttribute("class")){R.push(J[T]);break}0<R.length&&(J=R[0].getAttribute("data-mxgraph"),null!=J?(R=JSON.parse(J),null!=R&&null!=R.xml&&(l=mxUtils.parseXml(R.xml),l=l.documentElement)):(R=R[0].getElementsByTagName("div"),0<R.length&&(J=mxUtils.getTextContent(R[0]),J=Graph.decompress(J,null,H),0<J.length&&(l=mxUtils.parseXml(J),l=l.documentElement))))}if(null!=l&&"svg"==l.nodeName)if(J=l.getAttribute("content"),null!=J&&"<"!=J.charAt(0)&&"%"!=J.charAt(0)&&(J=unescape(window.atob?atob(J):Base64.decode(cont,J))),null!=J&&"%"==J.charAt(0)&&(J=decodeURIComponent(J)),null!=J&&0<J.length)l=mxUtils.parseXml(J).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==l||t||(R=null,"diagram"==l.nodeName?R=l:"mxfile"==l.nodeName&&(J=l.getElementsByTagName("diagram"),0<J.length&&(R=J[Math.max(0,Math.min(J.length-1,urlParams.page||0))])),null!=R&&(l=Editor.parseDiagramNode(R,H)));null==l||"mxGraphModel"==l.nodeName||t&&"mxfile"==l.nodeName||(l=null);return l};Editor.parseDiagramNode=function(l,t,H){Editor.validateDiagramNode(l);var J=mxUtils.trim(mxUtils.getTextContent(l)),R=null;0<J.length?(t=Graph.decompress(J,null,t),null!=t&&0<t.length&&(R=mxUtils.parseXml(t).documentElement)):(l=mxUtils.getChildNodes(l),0<l.length&&@@ -3706,11 +3708,11 @@ l.foreignObjectImages);null!=l.embedSvgFonts&&(Editor.embedSvgFonts=l.embedSvgFo(Editor.insertAnimations=l.insertAnimations);null!=l.enableWindowDocking&&(Editor.enableWindowDocking=l.enableWindowDocking);null!=l.compact&&(EditorUi.prototype.defaultCompact=l.compact);null!=l.noAutoFocus&&(EditorUi.prototype.noAutoFocus=l.noAutoFocus);if(null!=l.hideMenuItems)if(Array.isArray(l.hideMenuItems))for(Menus.prototype.hiddenMenuItems={},t=0;t<l.hideMenuItems.length;t++)Menus.prototype.hiddenMenuItems[l.hideMenuItems[t]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems");if(null!=l.hideMenus)if(Array.isArray(l.hideMenus)){var J={};for(t=0;t<l.hideMenus.length;t++)J[l.hideMenus[t]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(R){return!J[R]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=l.enableAi&&(Editor.enableAi=l.enableAi);null!=l.enableChatGpt&&(Editor.enableAi=l.enableChatGpt);null!=l.gptApiKey&&(Editor.aiGlobals.gptApiKey=l.gptApiKey);null!=l.geminiApiKey&&(Editor.aiGlobals.geminiApiKey=l.geminiApiKey);null!=l.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=l.claudeApiKey);null!=l.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=l.gptUrl);null!=l.aiActions&&(Editor.aiActions=l.aiActions);null!=l.aiGlobals&&(Editor.aiGlobals=l.aiGlobals);null!=l.aiConfigs&&(Editor.aiConfigs=l.aiConfigs);null!=l.aiModels&&(Editor.aiModels=l.aiModels)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.expandSvgPatterns=-function(l){function t(ia,ka){ia=ia.getAttribute("fill");if(null==ia||0!==ia.indexOf("url("))return null;ia=ia.match(/url\([^#]*#([^)"]+)\)?/);if(null==ia)return null;ia=ia[1];try{var X=ka.querySelector("#"+CSS.escape(ia));return null!=X&&"pattern"===X.nodeName?X:null}catch(ja){return null}}function H(ia,ka,X){var ja,na,la;try{var va=ia.getBBox()}catch(Ka){return}if(0!==va.width&&0!==va.height){var za=parseFloat(ka.getAttribute("width")),sa=parseFloat(ka.getAttribute("height"));if(!(isNaN(za)||isNaN(sa)||-0>=za||0>=sa)){var wa=ka.getAttribute("patternTransform");var Ca=na=ja=0;var Fa=la=1;if(null!=wa){var Ha=wa.match(/translate\(\s*([^,\s]+)[,\s]+([^)]+)\)/);null!=Ha&&(ja=parseFloat(Ha[1]),na=parseFloat(Ha[2]));Ha=wa.match(/rotate\(\s*([^)]+)\)/);null!=Ha&&(Ca=parseFloat(Ha[1])*Math.PI/180);wa=wa.match(/scale\(\s*([^,\s)]+)(?:[,\s]+([^)]+))?\)/);null!=wa&&(la=parseFloat(wa[1]),Fa=null!=wa[2]?parseFloat(wa[2]):la)}var Na=[{x:va.x,y:va.y},{x:va.x+va.width,y:va.y},{x:va.x+va.width,y:va.y+va.height},{x:va.x,-y:va.y+va.height}],La=Infinity;va=Infinity;Ha=wa=-Infinity;for(var Da=0;Da<Na.length;Da++){var Sa=Na[Da].x-ja;var Oa=Na[Da].y-na,Ta=Math.cos(-Ca),Ua=Math.sin(-Ca);var Ba=(Sa*Ta-Oa*Ua)/la;Sa=(Sa*Ua+Oa*Ta)/Fa;La=Math.min(La,Ba);va=Math.min(va,Sa);wa=Math.max(wa,Ba);Ha=Math.max(Ha,Sa)}La=Math.floor(La/za)-1;va=Math.floor(va/sa)-1;wa=Math.ceil(wa/za)+1;Ba=Math.ceil(Ha/sa)+1;if(!(1E4<(wa-La)*(Ba-va))){Da=R+ ++J;Ha=X.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");Ha.setAttribute("id",+function(l){function t(ia,ja){ia=ia.getAttribute("fill");if(null==ia||0!==ia.indexOf("url("))return null;ia=ia.match(/url\([^#]*#([^)"]+)\)?/);if(null==ia)return null;ia=ia[1];try{var X=ja.querySelector("#"+CSS.escape(ia));return null!=X&&"pattern"===X.nodeName?X:null}catch(ka){return null}}function H(ia,ja,X){var ka,na,la;try{var ua=ia.getBBox()}catch(Ka){return}if(0!==ua.width&&0!==ua.height){var za=parseFloat(ja.getAttribute("width")),sa=parseFloat(ja.getAttribute("height"));if(!(isNaN(za)||isNaN(sa)||+0>=za||0>=sa)){var wa=ja.getAttribute("patternTransform");var Ca=na=ka=0;var Fa=la=1;if(null!=wa){var Ha=wa.match(/translate\(\s*([^,\s]+)[,\s]+([^)]+)\)/);null!=Ha&&(ka=parseFloat(Ha[1]),na=parseFloat(Ha[2]));Ha=wa.match(/rotate\(\s*([^)]+)\)/);null!=Ha&&(Ca=parseFloat(Ha[1])*Math.PI/180);wa=wa.match(/scale\(\s*([^,\s)]+)(?:[,\s]+([^)]+))?\)/);null!=wa&&(la=parseFloat(wa[1]),Fa=null!=wa[2]?parseFloat(wa[2]):la)}var Na=[{x:ua.x,y:ua.y},{x:ua.x+ua.width,y:ua.y},{x:ua.x+ua.width,y:ua.y+ua.height},{x:ua.x,+y:ua.y+ua.height}],La=Infinity;ua=Infinity;Ha=wa=-Infinity;for(var Da=0;Da<Na.length;Da++){var Sa=Na[Da].x-ka;var Oa=Na[Da].y-na,Ta=Math.cos(-Ca),Ua=Math.sin(-Ca);var Ba=(Sa*Ta-Oa*Ua)/la;Sa=(Sa*Ua+Oa*Ta)/Fa;La=Math.min(La,Ba);ua=Math.min(ua,Sa);wa=Math.max(wa,Ba);Ha=Math.max(Ha,Sa)}La=Math.floor(La/za)-1;ua=Math.floor(ua/sa)-1;wa=Math.ceil(wa/za)+1;Ba=Math.ceil(Ha/sa)+1;if(!(1E4<(wa-La)*(Ba-ua))){Da=R+ ++J;Ha=X.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");Ha.setAttribute("id",Da);Na=ia.cloneNode(!0);Na.removeAttribute("fill");Na.removeAttribute("fill-opacity");Na.removeAttribute("stroke");Na.removeAttribute("stroke-width");Na.removeAttribute("stroke-opacity");Na.removeAttribute("style");Na.removeAttribute("pointer-events");Na.setAttribute("fill","black");Ha.appendChild(Na);Na=X.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");Na.setAttribute("clip-path","url(#"+Da+")");Da=ia.getAttribute("fill-opacity");null!=Da&&Na.setAttribute("opacity",Da);Da=X.ownerDocument.createElementNS("http://www.w3.org/2000/svg",-"g");Da.setAttribute("transform","translate("+ja+","+na+")"+(0!==Ca?" rotate("+180*Ca/Math.PI+")":"")+" scale("+la+(Fa!==la?","+Fa:"")+")");ka=ka.childNodes;for(ja=La;ja<wa;ja++)for(na=va;na<Ba;na++){Ca=X.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");Ca.setAttribute("transform","translate("+ja*za+","+na*sa+")");for(la=0;la<ka.length;la++)1===ka[la].nodeType&&Ca.appendChild(ka[la].cloneNode(!0));Da.appendChild(Ca)}Na.appendChild(Da);za=X.querySelector("defs");null==za&&(za=X.ownerDocument.createElementNS("http://www.w3.org/2000/svg",+"g");Da.setAttribute("transform","translate("+ka+","+na+")"+(0!==Ca?" rotate("+180*Ca/Math.PI+")":"")+" scale("+la+(Fa!==la?","+Fa:"")+")");ja=ja.childNodes;for(ka=La;ka<wa;ka++)for(na=ua;na<Ba;na++){Ca=X.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");Ca.setAttribute("transform","translate("+ka*za+","+na*sa+")");for(la=0;la<ja.length;la++)1===ja[la].nodeType&&Ca.appendChild(ja[la].cloneNode(!0));Da.appendChild(Ca)}Na.appendChild(Da);za=X.querySelector("defs");null==za&&(za=X.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs"),X.insertBefore(za,X.firstChild));za.appendChild(Ha);ia.parentNode.insertBefore(Na,ia.nextSibling);ia.setAttribute("fill","none");ia.style.fill=""}}}}for(var J=0,R="expand-pattern-clip-"+Editor.guid(8)+"-",T=l.querySelectorAll('[fill^="url("]'),Y=0;Y<T.length;Y++){var Z=t(T[Y],l);null!=Z&&H(T[Y],Z,l)}T=l.querySelectorAll("[style]");for(Y=0;Y<T.length;Y++)Z=T[Y].getAttribute("style"),null!=Z&&-1!==Z.indexOf("url(")&&(Z=t(T[Y],l),null!=Z&&H(T[Y],Z,l))};Editor.configureFontCss=function(l){if(null!=l){Editor.prototype.fontCss=l;var t=document.getElementsByTagName("script")[0];if(null!=t&&null!=t.parentNode){var H=document.createElement("style");H.setAttribute("type","text/css");H.appendChild(document.createTextNode(l));t.parentNode.insertBefore(H,t);l=l.split("url(");for(H=1;H<l.length;H++){var J=l[H].indexOf(")");J=Editor.trimCssUrl(l[H].substring(0,J));var R=document.createElement("link");R.setAttribute("rel","preload");R.setAttribute("href",J);R.setAttribute("as","font");R.setAttribute("crossorigin","");t.parentNode.insertBefore(R,t)}}}};Editor.trimCssUrl=function(l){return l.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=20;Editor.guid=function(l){l=null!=l?l:Editor.GUID_LENGTH;for(var t=[],H=0;H<l;H++)t.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*@@ -3726,247 +3728,248 @@ Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.ma!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(l,t){if("undefined"===typeof window.MathJax){var H=function(){J=null;Editor.mathJaxRendering=!1;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};l=null!=l?l:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var J=null;Editor.mathJaxRendering=!1;Editor.doMathJaxRender=function(Y){null!=MathJax.startup&&null!=MathJax.startup.output&&null!=MathJax.startup.output.options&&null!=MathJax.startup.output.options.linebreaks&&(MathJax.startup.output.options.linebreaks.inline=!1);try{null==J?(MathJax.typesetClear([Y]),MathJax.typeset([Y]),H()):J!=Y&&Editor.mathJaxQueue.push(Y)}catch(Z){MathJax.typesetClear([Y]),null!=Z.retry?(J=Y,Editor.mathJaxRendering=!0,Z.retry.then(function(){MathJax.typesetPromise([Y]).then(H)["catch"](function(ia){console.log("Error in MathJax.typesetPromise: "+ia.toString());H()})})["catch"](function(ia){console.log("Error in MathJax.retry: "+ia.toString());H()})):null!=window.console&&console.log("Error in MathJax.typeset: "+Z.toString())}};window.MathJax=null!=t?t:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe"],paths:{fonts:DRAW_MATH_URL+"/fonts"}},output:{font:"mathjax-tex"},startup:{pageReady:function(){for(var Y=0;Y<Editor.mathJaxQueue.length;Y++)Editor.doMathJaxRender(Editor.mathJaxQueue[Y])}}};-Editor.MathJaxRender=function(Y){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(Y):Editor.mathJaxQueue.push(Y)};Editor.onMathJaxDone=function(){};var R=Editor.prototype.init;Editor.prototype.init=function(){R.apply(this,arguments);var Y=mxUtils.bind(this,function(ka,X){null!=this.graph.container&&this.graph.mathEnabled&&(Editor.mathOutputSize&&(this.graph.container.style.visibility="hidden"),Editor.MathJaxRender(this.graph.container))});this.graph.model.addListener(mxEvent.CHANGE,+Editor.MathJaxRender=function(Y){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(Y):Editor.mathJaxQueue.push(Y)};Editor.onMathJaxDone=function(){};var R=Editor.prototype.init;Editor.prototype.init=function(){R.apply(this,arguments);var Y=mxUtils.bind(this,function(ja,X){null!=this.graph.container&&this.graph.mathEnabled&&(Editor.mathOutputSize&&(this.graph.container.style.visibility="hidden"),Editor.MathJaxRender(this.graph.container))});this.graph.model.addListener(mxEvent.CHANGE,Y);this.graph.addListener(mxEvent.REFRESH,Y);var Z=this.graph,ia=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){null!=ia&&ia.apply(this,arguments);Editor.mathOutputSize&&null!=Z&&Z.mathEnabled&&(Z.refreshMathBounds(),null!=Z.container&&(Z.container.style.visibility=""))}};t=document.getElementsByTagName("script");if(null!=t&&0<t.length){var T=document.createElement("script");T.setAttribute("type","text/javascript");T.setAttribute("src",l);t[0].parentNode.appendChild(T)}}};Editor.containsMath=function(l){return null!=l&&(0<=l.indexOf("$")||0<=l.indexOf("\\(")||0<=l.indexOf("\\[")||0<=l.indexOf("\\begin{"))};(function(){var l=Graph.prototype.getPreferredSizeForCell,t=null;Graph.prototype.getPreferredSizeForCell=function(H,J,R){if(!Editor.mathOutputSize||!this.mathEnabled||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||this.model.isEdge(H))return l.apply(this,arguments);var T=this.view.createState(H);T=null!=T?this.cellRenderer.getLabelValue(T):null;if(null==T||0===T.length||-!Editor.containsMath(T))return l.apply(this,arguments);var Y=mxUtils.getSizeForString;mxUtils.getSizeForString=function(Z,ia,ka,X){null==t&&(t=document.createElement("div"),t.style.cssText="position:absolute;visibility:hidden;left:-10000px;top:-10000px;display:inline-block;",document.body.appendChild(t));t.style.fontSize=ia+"px";t.style.fontFamily=ka;null!=X&&0<X?(t.style.width=X+"px",t.style.whiteSpace="normal"):(t.style.width="",t.style.whiteSpace="nowrap");MathJax.typesetClear([t]);t.innerHTML=-Graph.sanitizeHtml(Z);try{MathJax.typeset([t]);var ja=t.getBoundingClientRect();return new mxRectangle(0,0,ja.width,ja.height)}catch(na){return Y.apply(this,arguments)}};try{return l.apply(this,arguments)}finally{mxUtils.getSizeForString=Y}}})();Graph.prototype.refreshMathBounds=function(){if(Editor.mathOutputSize&&this.mathEnabled){var l=this.view,t=!1;l.states.visit(mxUtils.bind(this,function(J,R){null!=R&&null!=R.text&&(J=this.cellRenderer.getLabelValue(R),"string"===typeof J&&Editor.containsMath(J)&&+!Editor.containsMath(T))return l.apply(this,arguments);var Y=mxUtils.getSizeForString;mxUtils.getSizeForString=function(Z,ia,ja,X){null==t&&(t=document.createElement("div"),t.style.cssText="position:absolute;visibility:hidden;left:-10000px;top:-10000px;display:inline-block;",document.body.appendChild(t));t.style.fontSize=ia+"px";t.style.fontFamily=ja;null!=X&&0<X?(t.style.width=X+"px",t.style.whiteSpace="normal"):(t.style.width="",t.style.whiteSpace="nowrap");MathJax.typesetClear([t]);t.innerHTML=+Graph.sanitizeHtml(Z);try{MathJax.typeset([t]);var ka=t.getBoundingClientRect();return new mxRectangle(0,0,ka.width,ka.height)}catch(na){return Y.apply(this,arguments)}};try{return l.apply(this,arguments)}finally{mxUtils.getSizeForString=Y}}})();Graph.prototype.refreshMathBounds=function(){if(Editor.mathOutputSize&&this.mathEnabled){var l=this.view,t=!1;l.states.visit(mxUtils.bind(this,function(J,R){null!=R&&null!=R.text&&(J=this.cellRenderer.getLabelValue(R),"string"===typeof J&&Editor.containsMath(J)&&(R.text.updateBoundingBox(),t=!0))}));if(t){var H=null!=l.currentRoot?l.currentRoot:this.model.getRoot();H=l.getState(H);null!=H&&(H=l.getBoundingBox(H,!0,!1),l.setGraphBounds(null!=H?H:l.getEmptyBounds()),this.sizeDidChange());this.fireEvent(new mxEventObject("mathRefreshed"))}}};(function(){var l=EditorUi.prototype.initialFitDiagram;EditorUi.prototype.initialFitDiagram=function(t){l.apply(this,arguments);var H=this.editor.graph;if(Editor.mathOutputSize&&null!=H&&H.mathEnabled){var J=arguments,R=this,T=!1,Y=function(){T||(T=!0,H.removeListener(Y),H.zoomTo(1),R.resetScrollbars(),l.apply(R,J))};H.addListener("mathRefreshed",Y);Promise.resolve().then(function(){T||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||null!=Editor.mathJaxQueue&&0<Editor.mathJaxQueue.length||Editor.mathJaxRendering||H.removeListener(Y)})}}})();Editor.prototype.csvToArray=function(l){if(0<l.length){var t="",H=[""],J=0,R=!0,T;l=$jscomp.makeIterator(l);for(T=l.next();!T.done;T=l.next())T=T.value,'"'===T?(R&&T===t&&(H[J]+=T),R=!R):","===T&&R?T=H[++J]="":H[J]+=T,t=T;return H}return[]};Editor.prototype.getProxiedUrl=function(l){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(l)){var t=EditorUi.isVisioFilename(l);t=/\.png$/i.test(l)||/\.pdf$/i.test(l)||t;var H="t="+(new Date).getTime();l=PROXY_URL+"?url="+encodeURIComponent(l)+"&"+H+(t?"&base64=1":"")}return l};Editor.prototype.isCorsEnabledForUrl=function(l){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||l.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(l)||"https://raw.githubusercontent.com/"===l.substring(0,34)||"https://fonts.googleapis.com/"===l.substring(0,29)||"https://fonts.gstatic.com/"===l.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var l=new mxUrlConverter;l.updateBaseUrl();var t=l.convert,H=this;l.convert=function(J){null!=J&&navigator.onLine&&("http://"!=J.substring(0,7)&&"https://"!=J.substring(0,8)||J.substring(0,l.baseUrl.length)==l.baseUrl||H.crossOriginImages&&H.isCorsEnabledForUrl(J)?"chrome-extension://"!=J.substring(0,19)&&(J=t.apply(this,arguments)):J=PROXY_URL+"?url="+encodeURIComponent(J));return J};return l};Editor.createSvgDataUri=function(l){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(l)))};Editor.prototype.convertImageToDataUri=-function(l,t,H,J,R){try{var T=!0,Y=window.setTimeout(mxUtils.bind(this,function(){T=!1;t(l)}),this.timeout),Z=mxUtils.bind(this,function(){null!=J?this.convertImageToDataUri(l,t,H,J,!0):t(l)});if(/(\.svg)$/i.test(l)&&!R)mxUtils.get(l,mxUtils.bind(this,function(ka){window.clearTimeout(Y);T&&(200>ka.getStatus()||299<ka.getStatus()?Z():t(Editor.createSvgDataUri(ka.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(Y);T&&Z()}));else{var ia=new Image;this.crossOriginImages&&(ia.crossOrigin=-"anonymous");ia.onload=function(){window.clearTimeout(Y);if(T)try{J=null!=J&&R?J:1;var ka=document.createElement("canvas");ka.height=ia.height*J;ka.width=ia.width*J;var X=ka.getContext("2d");X.scale(J,J);X.drawImage(ia,0,0);t(ka.toDataURL())}catch(ja){t(l)}};ia.onerror=function(){window.clearTimeout(Y);T&&(null!=H?H():t(l))};ia.src=l}}catch(ka){null!=H?H():t(l)}};Editor.prototype.convertImages=function(l,t,H,J){function R(){0<T.length?T.shift()():t(l)}null==J&&(J=this.createImageUrlConverter());var T=-[],Y=H||{};H=mxUtils.bind(this,function(ja,na){ja=l.getElementsByTagName(ja);for(var la=0;la<ja.length;la++)mxUtils.bind(this,function(va){T.push(mxUtils.bind(this,function(){try{if(null!=va){var za=J.convert(va.getAttribute(na));if(null!=za&&"data:"!=za.substring(0,5)){var sa=Y[za];null==sa?this.convertImageToDataUri(za,function(wa){null!=wa&&(Y[za]=wa,va.setAttribute(na,wa));R()},null,Editor.svgRasterScale):(va.setAttribute(na,sa),R())}else null!=za&&va.setAttribute(na,za),R()}}catch(wa){R()}}))})(ja[la])});-var Z={},ia=function(){var ja=l.getElementsByTagName("defs")[0];null==ja&&(ja=l.ownerDocument,ja=null!=ja.createElementNS?ja.createElementNS(mxConstants.NS_SVG,"defs"):ja.createElement("defs"),l.insertBefore(ja,l.firstChild));return ja},ka=mxUtils.bind(this,function(){for(var ja=l.getElementsByTagName("use"),na=0;na<ja.length;na++)mxUtils.bind(this,function(la){T.push(mxUtils.bind(this,function(){try{var va=la.getAttribute("href");null==va&&(va=la.getAttribute("xlink:href"));if(null!=va&&"#"!=va.charAt(0)&&-"data:"!=va.substring(0,5)){var za=J.convert(va),sa=function(Ca){Ca=Graph.createSvgImageSymbol(ia(),Z,Ca,!0);null!=Ca&&(la.setAttribute("href","#"+Ca),la.setAttribute("xlink:href","#"+Ca));R()},wa=Y[za];null==wa?this.convertImageToDataUri(za,function(Ca){null!=Ca&&Ca!=za&&(Y[za]=Ca);sa(Ca)}):sa(wa)}else R()}catch(Ca){R()}}))})(ja[na])}),X=mxUtils.bind(this,function(){T.push(mxUtils.bind(this,function(){try{for(var ja=l.getElementsByTagName("image"),na=[],la=0;la<ja.length;la++)na.push(ja[la]);var va=-{},za={},sa=[],wa=function(){for(var Ta=l.getElementsByTagName("use"),Ua=0;Ua<Ta.length;Ua++){var Ba=Ta[Ua].getAttribute("href");null==Ba&&(Ba=Ta[Ua].getAttribute("xlink:href"));null!=Ba&&null!=va[Ba]&&(Ta[Ua].setAttribute("href","#"+va[Ba]),Ta[Ua].setAttribute("xlink:href","#"+va[Ba]))}},Ca=function(Ta,Ua){for(var Ba=null!=l.ownerDocument.createElementNS?l.ownerDocument.createElementNS(mxConstants.NS_SVG,"use"):l.ownerDocument.createElement("use"),Ka=Ta.attributes,ab=0;ab<Ka.length;ab++){var Qa=-Ka[ab].name;"href"!=Qa&&"xlink:href"!=Qa&&"preserveAspectRatio"!=Qa&&Ba.setAttribute(Qa,Ka[ab].value)}Ba.setAttribute("href","#"+Ua);Ba.setAttribute("xlink:href","#"+Ua);Ta.parentNode.replaceChild(Ba,Ta)};for(la=0;la<na.length;la++){var Fa=na[la];ja=Fa;var Ha=!0;if("symbol"==Fa.parentNode.nodeName)if(null==Fa.getAttribute("id")&&"mx-image-"==String(Fa.parentNode.getAttribute("id")||"").substring(0,9))ja=Fa.parentNode,Ha=!1;else continue;else"mx-image-"==String(Fa.getAttribute("id")||"").substring(0,-9)&&(Ha=!1);var Na=Fa.getAttribute("xlink:href");if(null!=Na&&"data:"==Na.substring(0,5)){var La=ja.getAttribute("preserveAspectRatio")||"";if("data:image/svg+xml"==Na.substring(0,18)){var Da="mx-symbol-"+mxUtils.hashCode(Na+"|"+("none"!=La)),Sa=l.querySelector('[id="'+Da+'"]');if(null!=Sa&&"symbol"==Sa.nodeName){Ha?Ca(Fa,Da):(va["#"+ja.getAttribute("id")]=Da,ja.parentNode.removeChild(ja));continue}}null==za[Na]&&(za[Na]={},sa.push(Na));null==za[Na][La]&&(za[Na][La]=[]);za[Na][La].push({node:ja,inline:Ha})}}wa();+function(l,t,H,J,R){try{var T=!0,Y=window.setTimeout(mxUtils.bind(this,function(){T=!1;t(l)}),this.timeout),Z=mxUtils.bind(this,function(){null!=J?this.convertImageToDataUri(l,t,H,J,!0):t(l)});if(/(\.svg)$/i.test(l)&&!R)mxUtils.get(l,mxUtils.bind(this,function(ja){window.clearTimeout(Y);T&&(200>ja.getStatus()||299<ja.getStatus()?Z():t(Editor.createSvgDataUri(ja.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(Y);T&&Z()}));else{var ia=new Image;this.crossOriginImages&&(ia.crossOrigin=+"anonymous");ia.onload=function(){window.clearTimeout(Y);if(T)try{J=null!=J&&R?J:1;var ja=document.createElement("canvas");ja.height=ia.height*J;ja.width=ia.width*J;var X=ja.getContext("2d");X.scale(J,J);X.drawImage(ia,0,0);t(ja.toDataURL())}catch(ka){t(l)}};ia.onerror=function(){window.clearTimeout(Y);T&&(null!=H?H():t(l))};ia.src=l}}catch(ja){null!=H?H():t(l)}};Editor.prototype.convertImages=function(l,t,H,J){function R(){0<T.length?T.shift()():t(l)}null==J&&(J=this.createImageUrlConverter());var T=+[],Y=H||{};H=mxUtils.bind(this,function(ka,na){ka=l.getElementsByTagName(ka);for(var la=0;la<ka.length;la++)mxUtils.bind(this,function(ua){T.push(mxUtils.bind(this,function(){try{if(null!=ua){var za=J.convert(ua.getAttribute(na));if(null!=za&&"data:"!=za.substring(0,5)){var sa=Y[za];null==sa?this.convertImageToDataUri(za,function(wa){null!=wa&&(Y[za]=wa,ua.setAttribute(na,wa));R()},null,Editor.svgRasterScale):(ua.setAttribute(na,sa),R())}else null!=za&&ua.setAttribute(na,za),R()}}catch(wa){R()}}))})(ka[la])});+var Z={},ia=function(){var ka=l.getElementsByTagName("defs")[0];null==ka&&(ka=l.ownerDocument,ka=null!=ka.createElementNS?ka.createElementNS(mxConstants.NS_SVG,"defs"):ka.createElement("defs"),l.insertBefore(ka,l.firstChild));return ka},ja=mxUtils.bind(this,function(){for(var ka=l.getElementsByTagName("use"),na=0;na<ka.length;na++)mxUtils.bind(this,function(la){T.push(mxUtils.bind(this,function(){try{var ua=la.getAttribute("href");null==ua&&(ua=la.getAttribute("xlink:href"));if(null!=ua&&"#"!=ua.charAt(0)&&+"data:"!=ua.substring(0,5)){var za=J.convert(ua),sa=function(Ca){Ca=Graph.createSvgImageSymbol(ia(),Z,Ca,!0);null!=Ca&&(la.setAttribute("href","#"+Ca),la.setAttribute("xlink:href","#"+Ca));R()},wa=Y[za];null==wa?this.convertImageToDataUri(za,function(Ca){null!=Ca&&Ca!=za&&(Y[za]=Ca);sa(Ca)}):sa(wa)}else R()}catch(Ca){R()}}))})(ka[na])}),X=mxUtils.bind(this,function(){T.push(mxUtils.bind(this,function(){try{for(var ka=l.getElementsByTagName("image"),na=[],la=0;la<ka.length;la++)na.push(ka[la]);var ua=+{},za={},sa=[],wa=function(){for(var Ta=l.getElementsByTagName("use"),Ua=0;Ua<Ta.length;Ua++){var Ba=Ta[Ua].getAttribute("href");null==Ba&&(Ba=Ta[Ua].getAttribute("xlink:href"));null!=Ba&&null!=ua[Ba]&&(Ta[Ua].setAttribute("href","#"+ua[Ba]),Ta[Ua].setAttribute("xlink:href","#"+ua[Ba]))}},Ca=function(Ta,Ua){for(var Ba=null!=l.ownerDocument.createElementNS?l.ownerDocument.createElementNS(mxConstants.NS_SVG,"use"):l.ownerDocument.createElement("use"),Ka=Ta.attributes,ab=0;ab<Ka.length;ab++){var Qa=+Ka[ab].name;"href"!=Qa&&"xlink:href"!=Qa&&"preserveAspectRatio"!=Qa&&Ba.setAttribute(Qa,Ka[ab].value)}Ba.setAttribute("href","#"+Ua);Ba.setAttribute("xlink:href","#"+Ua);Ta.parentNode.replaceChild(Ba,Ta)};for(la=0;la<na.length;la++){var Fa=na[la];ka=Fa;var Ha=!0;if("symbol"==Fa.parentNode.nodeName)if(null==Fa.getAttribute("id")&&"mx-image-"==String(Fa.parentNode.getAttribute("id")||"").substring(0,9))ka=Fa.parentNode,Ha=!1;else continue;else"mx-image-"==String(Fa.getAttribute("id")||"").substring(0,+9)&&(Ha=!1);var Na=Fa.getAttribute("xlink:href");if(null!=Na&&"data:"==Na.substring(0,5)){var La=ka.getAttribute("preserveAspectRatio")||"";if("data:image/svg+xml"==Na.substring(0,18)){var Da="mx-symbol-"+mxUtils.hashCode(Na+"|"+("none"!=La)),Sa=l.querySelector('[id="'+Da+'"]');if(null!=Sa&&"symbol"==Sa.nodeName){Ha?Ca(Fa,Da):(ua["#"+ka.getAttribute("id")]=Da,ka.parentNode.removeChild(ka));continue}}null==za[Na]&&(za[Na]={},sa.push(Na));null==za[Na][La]&&(za[Na][La]=[]);za[Na][La].push({node:ka,inline:Ha})}}wa();var Oa=function(){for(var Ta=null,Ua=null;0<sa.length&&null==Ta;){Ta=sa.pop();Ua=za[Ta];var Ba=0,Ka=0,ab;for(ab in Ua)Ba++,Ka=Math.max(Ka,Ua[ab].length);2>Ba&&2>Ka&&(Ta=null)}if(null==Ta)R();else{var Qa=new Image;Qa.onload=function(){try{var db=Qa.naturalWidth,Va=Qa.naturalHeight;if(0<db&&0<Va){var nb=l.ownerDocument,bb=0,ya;for(ya in Ua)bb++;var Ra=function(Cb){return null!=nb.createElementNS?nb.createElementNS(mxConstants.NS_SVG,Cb):nb.createElement(Cb)},Ya=function(){var Cb=Ra("image");Cb.setAttribute("width",db);Cb.setAttribute("height",Va);null==Cb.setAttributeNS?Cb.setAttribute("xlink:href",Ta):Cb.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Ta);return Cb},lb=null;if(1<bb){for(lb="mx-data-"+mxUtils.hashCode(Ta);null!=l.querySelector('[id="'+lb+'"]');)lb+="-1";var ub=Ya();ub.setAttribute("id",lb);ia().appendChild(ub)}for(ya in Ua){var gb=Ua[ya];bb=null;for(ub=0;ub<gb.length&&null==bb;ub++)gb[ub].inline||(bb=gb[ub].node.getAttribute("id"));if(null==bb)for(bb="mx-image-"+mxUtils.hashCode(Ta+"|"+ya);null!=-l.querySelector('[id="'+bb+'"]');)bb+="-1";var jb=Ra("symbol");jb.setAttribute("id",bb);jb.setAttribute("viewBox","0 0 "+db+" "+Va);""!=ya&&jb.setAttribute("preserveAspectRatio",ya);if(null!=lb){var yb=Ra("use");yb.setAttribute("href","#"+lb);yb.setAttribute("xlink:href","#"+lb);jb.appendChild(yb)}else jb.appendChild(Ya());ia().appendChild(jb);for(ub=0;ub<gb.length;ub++){var Bb=gb[ub].node;gb[ub].inline?Ca(Bb,bb):(Bb.getAttribute("id")!=bb&&(va["#"+Bb.getAttribute("id")]=bb),Bb.parentNode.removeChild(Bb))}}wa()}}catch(Cb){}Oa()};-Qa.onerror=function(){Oa()};Qa.src=Ta}};Oa()}catch(Ta){R()}}))});H("image","xlink:href");H("img","src");ka();X();R()};Editor.base64Encode=function(l){for(var t="",H=0,J=l.length,R,T,Y;H<J;){R=l.charCodeAt(H++)&255;if(H==J){t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(R>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&3)<<4);t+="==";break}T=l.charCodeAt(H++);if(H==J){t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(R>>+l.querySelector('[id="'+bb+'"]');)bb+="-1";var jb=Ra("symbol");jb.setAttribute("id",bb);jb.setAttribute("viewBox","0 0 "+db+" "+Va);""!=ya&&jb.setAttribute("preserveAspectRatio",ya);if(null!=lb){var yb=Ra("use");yb.setAttribute("href","#"+lb);yb.setAttribute("xlink:href","#"+lb);jb.appendChild(yb)}else jb.appendChild(Ya());ia().appendChild(jb);for(ub=0;ub<gb.length;ub++){var Bb=gb[ub].node;gb[ub].inline?Ca(Bb,bb):(Bb.getAttribute("id")!=bb&&(ua["#"+Bb.getAttribute("id")]=bb),Bb.parentNode.removeChild(Bb))}}wa()}}catch(Cb){}Oa()};+Qa.onerror=function(){Oa()};Qa.src=Ta}};Oa()}catch(Ta){R()}}))});H("image","xlink:href");H("img","src");ja();X();R()};Editor.base64Encode=function(l){for(var t="",H=0,J=l.length,R,T,Y;H<J;){R=l.charCodeAt(H++)&255;if(H==J){t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(R>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&3)<<4);t+="==";break}T=l.charCodeAt(H++);if(H==J){t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(R>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&3)<<4|(T&240)>>4);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((T&15)<<2);t+="=";break}Y=l.charCodeAt(H++);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(R>>2);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&3)<<4|(T&240)>>4);t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((T&15)<<2|(Y&192)>>6);-t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Y&63)}return t};Editor.prototype.loadUrl=function(l,t,H,J,R,T,Y,Z){try{var ia=!Y&&(J||/(\.png)($|\?)/i.test(l)||/(\.jpe?g)($|\?)/i.test(l)||/(\.gif)($|\?)/i.test(l)||/(\.pdf)($|\?)/i.test(l));R=null!=R?R:!0;var ka=mxUtils.bind(this,function(){mxUtils.get(l,mxUtils.bind(this,function(X){200<=X.getStatus()&&299>=X.getStatus()?null!=t&&(X=X.getText(),ia&&(T=null!=T?T:"data:image/png;base64,",X=T+Editor.base64Encode(X)),t(X)):-null!=H&&(0==X.getStatus()?H({message:mxResources.get("accessDenied")},X):404==X.getStatus()?H({message:mxResources.get("fileNotFound"),code:X.getStatus()},X):H({message:this.getErrorMessage(X)},X))}),function(X){null!=H&&H({message:mxResources.get("error")+" "+X.getStatus()})},ia,this.timeout,function(){R&&null!=H&&H({code:App.ERROR_TIMEOUT,retry:ka})},Z)});ka()}catch(X){null!=H&&H(X)}};Editor.prototype.getErrorMessage=function(l){var t=mxResources.get("error")+" "+l.getStatus();try{var H=l.getText(),+t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Y&63)}return t};Editor.prototype.loadUrl=function(l,t,H,J,R,T,Y,Z){try{var ia=!Y&&(J||/(\.png)($|\?)/i.test(l)||/(\.jpe?g)($|\?)/i.test(l)||/(\.gif)($|\?)/i.test(l)||/(\.pdf)($|\?)/i.test(l));R=null!=R?R:!0;var ja=mxUtils.bind(this,function(){mxUtils.get(l,mxUtils.bind(this,function(X){200<=X.getStatus()&&299>=X.getStatus()?null!=t&&(X=X.getText(),ia&&(T=null!=T?T:"data:image/png;base64,",X=T+Editor.base64Encode(X)),t(X)):+null!=H&&(0==X.getStatus()?H({message:mxResources.get("accessDenied")},X):404==X.getStatus()?H({message:mxResources.get("fileNotFound"),code:X.getStatus()},X):H({message:this.getErrorMessage(X)},X))}),function(X){null!=H&&H({message:mxResources.get("error")+" "+X.getStatus()})},ia,this.timeout,function(){R&&null!=H&&H({code:App.ERROR_TIMEOUT,retry:ja})},Z)});ja()}catch(X){null!=H&&H(X)}};Editor.prototype.getErrorMessage=function(l){var t=mxResources.get("error")+" "+l.getStatus();try{var H=l.getText(),J=JSON.parse(H);null!=J&&null!=J.error&&null!=J.error.message&&(t=J.error.message+" ("+t+")")}catch(R){}return t};Editor.prototype.absoluteCssFonts=function(l){var t=null;if(null!=l){var H=l.split("url(");if(0<H.length){t=[H[0]];l=window.location.pathname;var J=null!=l?l.lastIndexOf("/"):-1;0<=J&&(l=l.substring(0,J+1));J=document.getElementsByTagName("base");var R=null;null!=J&&0<J.length&&(R=J[0].getAttribute("href"));for(var T=1;T<H.length;T++)if(J=H[T].indexOf(")"),0<J){var Y=Editor.trimCssUrl(H[T].substring(0,J));this.graph.isRelativeUrl(Y)&&(Y=null!=R?R+Y:window.location.protocol+"//"+window.location.hostname+("/"==Y.charAt(0)?"":l)+Y);t.push('url("'+Y+'"'+H[T].substring(J))}else t.push(H[T])}else t=[l]}return null!=t?t.join(""):null};Editor.prototype.mapFontUrl=function(l,t,H){/^https?:\/\//.test(t)&&!this.isCorsEnabledForUrl(t)&&(t=PROXY_URL+"?url="+encodeURIComponent(t));H(l,t)};Editor.prototype.embedCssFonts=function(l,t){var H=l.split("url("),J=0;null==this.cachedFonts&&(this.cachedFonts={});var R=-mxUtils.bind(this,function(){if(0==J){for(var ia=[H[0]],ka=1;ka<H.length;ka++){var X=H[ka].indexOf(")");ia.push('url("');ia.push(this.cachedFonts[Editor.trimCssUrl(H[ka].substring(0,X))]);ia.push('"'+H[ka].substring(X))}t(ia.join(""))}});if(0<H.length){for(l=1;l<H.length;l++){var T=H[l].indexOf(")"),Y=null,Z=H[l].indexOf("format(",T);0<Z&&(Y=Editor.trimCssUrl(H[l].substring(Z+7,H[l].indexOf(")",Z))));mxUtils.bind(this,function(ia){if(null==this.cachedFonts[ia]){this.cachedFonts[ia]=ia;J++;var ka=-"application/x-font-ttf";if("svg"==Y||/(\.svg)($|\?)/i.test(ia))ka="image/svg+xml";else if("otf"==Y||"embedded-opentype"==Y||/(\.otf)($|\?)/i.test(ia))ka="application/x-font-opentype";else if("woff"==Y||/(\.woff)($|\?)/i.test(ia))ka="application/font-woff";else if("woff2"==Y||/(\.woff2)($|\?)/i.test(ia))ka="application/font-woff2";else if("eot"==Y||/(\.eot)($|\?)/i.test(ia))ka="application/vnd.ms-fontobject";else if("sfnt"==Y||/(\.sfnt)($|\?)/i.test(ia))ka="application/font-sfnt";this.mapFontUrl(ka,-ia,mxUtils.bind(this,function(X,ja){this.loadUrl(ja,mxUtils.bind(this,function(na){this.cachedFonts[ia]=na;J--;R()}),mxUtils.bind(this,function(na){J--;R()}),!0,null,"data:"+X+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(H[l].substring(0,T)),Y)}R()}else t(l)};Editor.prototype.loadFonts=function(l){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(t){this.resolvedFontCss=t;null!=l&&l()})):null!=l&&l()};Editor.prototype.createGoogleFontCache=-function(){var l={},t;for(t in Graph.fontMapping)Graph.isCssFontUrl(t)&&(l[t]=Graph.fontMapping[t]);return l};Editor.prototype.embedExtFonts=function(l){var t=this.graph.getCustomFonts();if(0<t.length){var H=[],J=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var R=mxUtils.bind(this,function(){0==J&&this.embedCssFonts(H.join(""),l)}),T=0;T<t.length;T++)mxUtils.bind(this,function(Y,Z){Graph.isCssFontUrl(Z)?null==this.cachedGoogleFonts[Z]?(J++,this.loadUrl(Graph.rewriteGoogleFontUrl(Z),-mxUtils.bind(this,function(ia){this.cachedGoogleFonts[Z]=ia;H.push(ia+"\n");J--;R()}),mxUtils.bind(this,function(ia){J--;H.push("@import url("+Z+");\n");R()}))):H.push(this.cachedGoogleFonts[Z]+"\n"):H.push('@font-face {font-family: "'+Y+'";src: url("'+Z+'")}\n')})(t[T].name,t[T].url);R()}else l()};Editor.prototype.addMathCss=function(l){l=l.getElementsByTagName("defs");if(null!=l&&0<l.length)for(var t=document.getElementsByTagName("style"),H=0;H<t.length;H++){var J=mxUtils.getTextContent(t[H]);0>-J.indexOf("mxPageSelector")&&0<J.indexOf("MathJax")&&l[0].appendChild(t[H].cloneNode(!0))}};Editor.prototype.addFontCss=function(l,t){t=null!=t?t:this.absoluteCssFonts(this.fontCss);if(null!=t){var H=mxUtils.getSvgDefs(l),J=t.split("\n");t=[];for(var R=[],T=0;T<J.length;T++)"@import"==J[T].substring(0,7)?t.push(J[T]):R.push(J[T]);l=l.ownerDocument;l=null!=l.createElementNS?l.createElementNS(mxConstants.NS_SVG,"style"):l.createElement("style");l.setAttribute("type","text/css");0<t.length&&(mxUtils.setTextContent(l,-t.join("\n")),H.appendChild(l));0<R.length&&(l=l.cloneNode(!1),mxUtils.setTextContent(l,R.join("\n")),H.appendChild(l))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(l,t,H){var J=mxClient.IS_FF?8192:16384;return Math.min(H,Math.min(J/l,J/t))};Editor.prototype.exportToCanvas=function(l,t,H,J,R,T,Y,Z,ia,ka,X,ja,na,la,va,za,sa,wa){try{T=null!=T?T:!0;Y=null!=Y?Y:!0;ja=null!=ja?ja:this.graph;na=null!=-na?na:0;var Ca=ia?null:ja.background;Ca==mxConstants.NONE&&(Ca=null);null==Ca&&(Ca=J);null==Ca&&0==ia&&(Ca="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(ja.getSvg(null,null,na,la,null,Y,null,null,null,ka,null,za,sa,wa),mxUtils.bind(this,function(Fa){try{Fa.style.setProperty("-webkit-font-smoothing","antialiased");Fa.style.setProperty("-moz-osx-font-smoothing","grayscale");var Ha=new Image;Ha.onload=mxUtils.bind(this,function(){try{var La=function(){mxClient.IS_SF?window.setTimeout(function(){Ta.drawImage(Ha,-0,0);l(Da,Fa)},0):(Ta.drawImage(Ha,0,0),l(Da,Fa))},Da=document.createElement("canvas"),Sa=parseInt(Fa.getAttribute("width")),Oa=parseInt(Fa.getAttribute("height"));Z=null!=Z?Z:1;null!=t&&(Z=T?Math.min(1,Math.min(3*t/(4*Oa),t/Sa)):t/Sa);Z=this.getMaxCanvasScale(Sa,Oa,Z);Sa=Math.ceil(Z*Sa);Oa=Math.ceil(Z*Oa);Da.setAttribute("width",Sa);Da.setAttribute("height",Oa);var Ta=Da.getContext("2d");if(null!=Ca){var Ua=mxUtils.getLightDarkColor(Ca);Ta.beginPath();Ta.rect(0,0,Sa,Oa);Ta.fillStyle="dark"==za&&-"none"!=ja.getAdaptiveColors()?Ua.dark:Ua.light;Ta.fill()}1!=Z&&Ta.scale(Z,Z);if(va){var Ba=ja.view,Ka=Ba.scale;Ba.scale=1;var ab=btoa(unescape(encodeURIComponent(Ba.createSvgGrid(Ba.gridColor))));Ba.scale=Ka;ab="data:image/svg+xml;base64,"+ab;var Qa=ja.gridSize*Ba.gridSteps*Z,db=ja.getGraphBounds(),Va=Ba.translate.x*Ka,nb=Ba.translate.y*Ka,bb=Va+(db.x-Va)/Ka-na,ya=nb+(db.y-nb)/Ka-na,Ra=new Image;Ra.onload=function(){try{for(var Ya=-Math.round(Qa-mxUtils.mod((Va-bb)*Z,Qa)),lb=-Math.round(Qa-mxUtils.mod((nb--ya)*Z,Qa));Ya<Sa;Ya+=Qa)for(var ub=lb;ub<Oa;ub+=Qa)Ta.drawImage(Ra,Ya/Z,ub/Z);La()}catch(gb){null!=R&&R(gb)}};Ra.onerror=function(Ya){null!=R&&R(Ya)};Ra.src=ab}else La()}catch(Ya){null!=R&&R(Ya)}});Ha.onerror=function(La){null!=R&&R(La)};ka&&this.graph.addSvgShadow(Fa);this.graph.mathEnabled&&this.addMathCss(Fa);var Na=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(Fa,this.resolvedFontCss),Ha.src=Editor.createSvgDataUri(mxUtils.getXml(Fa))}catch(La){null!=R&&R(La)}});-this.embedExtFonts(mxUtils.bind(this,function(La){try{null!=La&&this.addFontCss(Fa,La),this.loadFonts(Na)}catch(Da){null!=R&&R(Da)}}))}catch(La){null!=R&&R(La)}}),H,X)}catch(Fa){null!=R&&R(Fa)}};Editor.crcTable=[];for(var v=0;256>v;v++)for(var n=v,y=0;8>y;y++)n=1==(n&1)?3988292384^n>>>1:n>>>1,Editor.crcTable[v]=n;Editor.updateCRC=function(l,t,H,J){for(var R=0;R<J;R++)l=Editor.crcTable[(l^t.charCodeAt(H+R))&255]^l>>>8;return l};Editor.crc32=function(l){for(var t=-1,H=0;H<l.length;H++)t=t>>>8^Editor.crcTable[(t^-l.charCodeAt(H))&255];return(t^-1)>>>0};Editor.writeGraphModelToPng=function(l,t,H,J,R){function T(X,ja){var na=ia;ia+=ja;return X.substring(na,ia)}function Y(X){X=T(X,4);return X.charCodeAt(3)+(X.charCodeAt(2)<<8)+(X.charCodeAt(1)<<16)+(X.charCodeAt(0)<<24)}function Z(X){return String.fromCharCode(X>>24&255,X>>16&255,X>>8&255,X&255)}l=l.substring(l.indexOf(",")+1);l=window.atob?atob(l):Base64.decode(l,!0);var ia=0;if(T(l,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=R&&-R();else if(T(l,4),"IHDR"!=T(l,4))null!=R&&R();else{T(l,17);R=l.substring(0,ia);do{var ka=Y(l);if("IDAT"==T(l,4)){R=l.substring(0,ia-8);"pHYs"==t&&"dpi"==H?(H=Math.round(J/.0254),H=Z(H)+Z(H)+String.fromCharCode(1)):H=H+String.fromCharCode(0)+("zTXt"==t?String.fromCharCode(0):"")+J;J=4294967295;J=Editor.updateCRC(J,t,0,4);J=Editor.updateCRC(J,H,0,H.length);R+=Z(H.length)+t+H+Z(J^4294967295);R+=l.substring(ia-8,l.length);break}R+=l.substring(ia-8,ia-4+ka);T(l,ka);T(l,4)}while(ka);return"data:image/png;base64,"+-(window.btoa?btoa(R):Base64.encode(R,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var C=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(l,t){C.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var P=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){P.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==-typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(l,t,H){var J=null;if(null!=H)return null;null!=l.editor.graph.getModel().getParent(t)?J=t.getId():null!=l.currentPage&&(J=l.currentPage.getId());return J});if(null!=window.StyleFormatPanel){var G=Format.prototype.init;Format.prototype.init=function(){G.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var O=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||-"1"==urlParams.embed||this.editorUi.editor.chromeless?O.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(l){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var U=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(l){l=U.apply(this,arguments);var t=this.editorUi,H=t.editor.graph;if(H.isEnabled()){var J=t.getCurrentFile();null!=J&&J.isAutosaveOptional()&&l.appendChild(this.createOption(mxResources.get("autosave"),-function(){return t.editor.autosave},function(T){t.editor.setAutosave(T);t.editor.autosave&&J.isModified()&&J.fileChanged()},{install:function(T){this.listener=function(){T(t.editor.autosave)};t.editor.addListener("autosaveChanged",this.listener)},destroy:function(){t.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&H.isEnabled()&&"undefined"!==typeof MathJax){var R=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return H.mathEnabled},function(T){t.actions.get("mathematicalTypesetting").funct()},-{install:function(T){this.listener=function(){T(H.mathEnabled)};t.addListener("mathEnabledChanged",this.listener)},destroy:function(){t.removeListener(this.listener)}});l.appendChild(R);(!t.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&R.appendChild(t.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return l};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},-{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(l,t){return 0<mxUtils.getValue(l.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.ellipse.prototype.customProperties=[{name:"centerRadius",dispName:"Center Radius",type:"float",min:0,defVal:0},{name:"centerColor",dispName:"Center Color",type:"color",defVal:null,-primary:!0,isVisible:function(l,t){return 0<mxUtils.getValue(l.style,"centerRadius",0)}}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",-type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=-[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2,isVisible:function(l){return"0"==mxUtils.getValue(l.style,-"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(l){return"1"==mxUtils.getValue(l.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.25,isVisible:function(l){return"0"==mxUtils.getValue(l.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",-min:0,defVal:25,isVisible:function(l){return"1"==mxUtils.getValue(l.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,min:0,max:1},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=-[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0},{name:"boundedLbl",-dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder3.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlState.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.step.prototype.customProperties=-[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",type:"float",min:0,defVal:20},{name:"fixedSize",dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=-[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.note2.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.card.prototype.customProperties=-[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20},{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",-min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"right",dispName:"Right"}]},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=-[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},{name:"swimlaneBody",dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},{name:"separatorColor",dispName:"Separator Color",-type:"color",defVal:null},{name:"fixedHeader",dispName:"Fixed Header",type:"bool",defVal:!0,getDefaultValue:function(l,t){l=mxCellRenderer.defaultShapes[mxUtils.getValue(l.style,"shape","")];return null!=l&&null!=l.prototype.fixedHeaderDefault?l.prototype.fixedHeaderDefault?"1":"0":"1"}}];mxCellRenderer.defaultShapes.table.prototype.customProperties=[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",-type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);-mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},-{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0},{name:"imageAlign",dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},-{name:"imageVerticalAlign",dispName:"Image Vertical Align",type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",type:"float",min:0,defVal:24},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",-type:"float",min:0,defVal:0},{name:"footerColor",dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(l,t){return 0<mxUtils.getValue(l.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,-defVal:20},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=-[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",-min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.cross.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.corner.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.tee.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,-defVal:20}];mxCellRenderer.defaultShapes.umlLifeline.prototype.customProperties=[{name:"participant",dispName:"Participant",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName:"Actor"},{val:"umlBoundary",dispName:"Boundary"},{val:"umlEntity",dispName:"Entity"},{val:"umlControl",dispName:"Control"}]},{name:"size",dispName:"Height",type:"float",defVal:40,min:0},{name:"lifelineMirror",dispName:"Mirror Head",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=-[{name:"width",dispName:"Title Width",type:"float",defVal:60,min:0},{name:"height",dispName:"Title Height",type:"float",defVal:30,min:0}];StyleFormatPanel.prototype.defaultColorSchemes=[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",-font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},-{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",-gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",-stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;var c=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var l=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&0<l.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));c.apply(this,arguments);null!=l.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),-l.customProperties,l))};var f=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(l){var t=this.editorUi.getSelectionState();1==t.cells.length?this.addActions(l,["copyStyle","pasteStyle"]):1<=t.cells.length&&this.addActions(l,["pasteStyle","pasteData"]);f.apply(this,arguments);return l};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(l,t,H,J){function R(Ua){try{return decodeURIComponent(Ua)}catch(Ba){return Ua}}function T(Ua,-Ba,Ka,ab,Qa){if(null!=Ka.valueChanged)Ka.valueChanged(Ba,Qa,H,na);else{la.getModel().beginUpdate();try{Qa=[];var db=[];if(null!=Ka.index){for(var Va=[],nb=Ka.parentRow.nextSibling;nb&&nb.getAttribute("data-pName")==Ua;)Va.push(nb.getAttribute("data-pValue")),nb=nb.nextSibling;Ka.index<Va.length?null!=ab?Va.splice(ab,1):Va[Ka.index]=Ba:Va.push(Ba);null!=Ka.size&&Va.length>Ka.size&&(Va=Va.slice(0,Ka.size));Ba=Va.join(",");null!=Ka.countProperty&&(la.setCellStyles(Ka.countProperty,Va.length,la.getSelectionCells()),-Qa.push(Ka.countProperty),db.push(Va.length))}la.setCellStyles(Ua,Ba,la.getSelectionCells());Qa.push(Ua);db.push(Ba);if(null!=Ka.dependentProps)for(Ua=0;Ua<Ka.dependentProps.length;Ua++){var bb=Ka.dependentPropsDefVal[Ua],ya=Ka.dependentPropsVals[Ua];if(ya.length>Ba)ya=ya.slice(0,Ba);else for(var Ra=ya.length;Ra<Ba;Ra++)ya.push(bb);ya=ya.join(",");la.setCellStyles(Ka.dependentProps[Ua],ya,la.getSelectionCells());Qa.push(Ka.dependentProps[Ua]);db.push(ya)}if("function"==typeof Ka.onChange)Ka.onChange(la,-Ba);na.editorUi.fireEvent(new mxEventObject("styleChanged","keys",Qa,"values",db,"cells",la.getSelectionCells()))}finally{la.getModel().endUpdate()}}}function Y(Ua,Ba){Ba.style.left="0px";Ba.style.top="0px";Ba.style.position="relative";Ba.style.right="0px";Ba.style.bottom="0px";Ba.style.width="100%";Ba.style.maxWidth="100%";Ba.style.maxHeight="100%";Ba.style.textAlign="left"}function Z(Ua,Ba,Ka){function ab(db){if(null==db||db==mxConstants.NONE)Qa.style.background="url('"+Dialog.prototype.noColorImage+-"')";else if("default"==db)Qa.style.background="";else{var Va=mxUtils.getLightDarkColor(db);mxUtils.isLightDarkColor(db)&&Va.light!=Va.dark?Qa.style.background="linear-gradient(to right bottom, "+Va.cssText+" 50%, "+mxUtils.invertLightDarkColor(Va).cssText+" 50.3%)":Qa.style.background=db}}var Qa=document.createElement("div");Qa.style.width="32px";Qa.style.height="8px";Qa.style.margin="2px";Qa.style.borderStyle="solid";Qa.style.borderWidth="1px";ab(Ba);btn=mxUtils.button("",mxUtils.bind(na,function(db){this.editorUi.pickColor(Ba,-function(Va){T(Ua,Va,Ka);ab(Va)});mxEvent.consume(db)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(Qa);return btn}function ia(Ua,Ba,Ka,ab,Qa,db,Va){null!=Ba&&(Ba=Ba.split(","),va.push({name:Ua,values:Ba,type:Ka,defVal:ab,countProperty:Qa,parentRow:db,isDeletable:!0,flipBkg:Va}));btn=mxUtils.button("+",mxUtils.bind(na,function(nb){for(var bb=db,ya=0;null!=bb.nextSibling;)if(bb.nextSibling.getAttribute("data-pName")==-Ua)bb=bb.nextSibling,ya++;else break;var Ra={type:Ka,parentRow:db,index:ya,isDeletable:!0,defVal:ab,countProperty:Qa};ya=ja(Ua,"",Ra,0==ya%2,Va);T(Ua,ab,Ra);bb.parentNode.insertBefore(ya,bb.nextSibling);mxEvent.consume(nb)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ka(Ua,Ba,Ka,ab,Qa,db,Va){if(0<Qa){var nb=Array(Qa);Ba=null!=Ba?Ba.split(","):[];for(var bb=0;bb<Qa;bb++)nb[bb]=null!=Ba[bb]?Ba[bb]:null!=ab?ab:"";va.push({name:Ua,values:nb,type:Ka,-defVal:ab,parentRow:db,flipBkg:Va,size:Qa})}return document.createElement("div")}function X(Ua,Ba,Ka){var ab=document.createElement("input");ab.type="checkbox";ab.checked="1"==Ba;mxEvent.addListener(ab,"change",function(){T(Ua,ab.checked?"1":"0",Ka,null,ab)});return ab}function ja(Ua,Ba,Ka,ab,Qa){var db=Ka.dispName,Va=Ka.type,nb=document.createElement("tr");nb.className="gePropRow"+(Qa?"Dark":"")+(ab?"Alt":"")+" gePropNonHeaderRow";nb.setAttribute("data-pName",Ua);nb.setAttribute("data-pValue",Ba);-ab=!1;null!=Ka.index&&(nb.setAttribute("data-index",Ka.index),db=(null!=db?db:"")+"["+Ka.index+"]",ab=!0);var bb=document.createElement("td");bb.className="gePropRowCell";db=mxResources.get(db,null,db);mxUtils.write(bb,db);bb.setAttribute("title",db);ab&&(bb.style.textAlign="right");nb.appendChild(bb);bb=document.createElement("td");bb.className="gePropRowCell";bb.setAttribute("title",null!=Ba?R(Ba):mxResources.get("none"));mxEvent.addListener(bb,"click",mxUtils.bind(na,function(lb){!mxUtils.isAncestorNode(nb,-document.activeElement)&&mxUtils.isAncestorNode(nb.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(lb))}));if("color"==Va)bb.appendChild(Z(Ua,Ba,Ka));else if("bool"==Va||"boolean"==Va)bb.appendChild(X(Ua,Ba,Ka));else if("enum"==Va){var ya=Ka.enumList;bb.innerHTML="";var Ra=document.createElement("div");Ra.className="gePropValue";bb.appendChild(Ra);for(Qa=0;Qa<ya.length;Qa++)if(db=ya[Qa],db.val==Ba){mxUtils.write(Ra,-mxResources.get(db.dispName,null,db.dispName));break}mxEvent.addListener(bb,"click",mxUtils.bind(na,function(lb){var ub=mxEvent.getSource(lb);if(!(ub!=bb&&ub!=Ra||mxEvent.isConsumed(lb))){Ra.innerHTML="";var gb=document.createElement("select"),jb=null;Y(bb,gb);gb.style.boxSizing="border-box";gb.style.height="100%";gb.style.padding="0";gb.style.margin="0";gb.style.border="0";for(lb=0;lb<ya.length;lb++){ub=ya[lb];var yb=document.createElement("option");yb.value=mxUtils.htmlEntities(ub.val);mxUtils.write(yb,-mxResources.get(ub.dispName,null,ub.dispName));gb.appendChild(yb);null==ub.val&&(yb.value="null",jb=yb)}gb.value=null==Ba&&null!=jb?"null":Ba;Ra.appendChild(gb);mxEvent.addListener(gb,"change",function(){var Bb=mxUtils.htmlEntities(gb.value);if(gb[gb.selectedIndex]==jb||"null"==Bb.value)Bb=null;T(Ua,Bb,Ka)});gb.focus();mxEvent.addListener(gb,"blur",function(){Ra.innerHTML="";for(var Bb=gb[gb.selectedIndex]==jb||"null"==gb.value?null:gb.value,Cb=0;Cb<ya.length;Cb++){var Kb=ya[Cb];if(Kb.val==Bb){mxUtils.write(Ra,-mxResources.get(Kb.dispName,null,Kb.dispName));break}}})}}))}else if("dynamicArr"==Va)bb.appendChild(ia(Ua,Ba,Ka.subType,Ka.subDefVal,Ka.countProperty,nb,Qa));else if("staticArr"==Va)bb.appendChild(ka(Ua,Ba,Ka.subType,Ka.subDefVal,Ka.size,nb,Qa));else if("readOnly"==Va)Qa=document.createElement("input"),Qa.setAttribute("readonly",""),Qa.value=Ba,Qa.style.borderWidth="0px","id"==Ua||"shape"==Ua?(nb.firstChild.innerHTML="",nb.firstChild.setAttribute("colspan","2"),Qa.style.flexGrow="1",Qa.style.marginLeft=-"4px",Qa.style.textAlign="id"==Ua?"center":"left",Qa.setAttribute("title",Ba),db=document.createElement("div"),mxUtils.write(db,mxResources.get(Ua)+":"),db.style.display="inline-flex",db.style.alignItems="center",db.style.width="100%",db.appendChild(Qa),nb.firstChild.appendChild(db)):(Qa.style.width="96px",bb.appendChild(Qa));else{bb.innerHTML="";var Ya=document.createElement("div");Ya.className="gePropValue";bb.appendChild(Ya);Ya.innerHTML=mxUtils.htmlEntities(R(Ba));mxEvent.addListener(bb,"click",-mxUtils.bind(na,function(lb){function ub(){var yb=jb.value,Bb=Va;yb=0==yb.trim().length&&"string"!=Bb&&"numbers"!=Bb?Ka.allowAuto?"auto":0:yb;Ka.allowAuto&&(null!=yb.trim&&"auto"==yb.trim().toLowerCase()?(yb="auto",Bb="string"):(yb=parseFloat(yb),yb=isNaN(yb)?0:yb));null!=Ka.min&&yb<Ka.min?yb=Ka.min:null!=Ka.max&&yb>Ka.max&&(yb=Ka.max);var Cb=null;try{Cb="numbers"==Bb?yb.match(/\d+/g).map(Number).join(" "):"auto"===yb&&Ka.allowAuto&&"auto"==Ka.defVal?null:encodeURIComponent(("int"==Bb?parseInt(yb):-yb)+"")}catch(Kb){}T(Ua,Cb,Ka,null,jb)}var gb=mxEvent.getSource(lb);if(!(gb!=bb&&gb!=Ya||mxEvent.isConsumed(lb))){Ya.innerHTML="";var jb=document.createElement("input");Y(Ya,jb);jb.value=R(Ba);jb.className="gePropEditor";"int"!=Va&&"float"!=Va||Ka.allowAuto||(jb.type="number",jb.step="int"==Va?"1":"any",null!=Ka.min&&(jb.min=parseFloat(Ka.min)),null!=Ka.max&&(jb.max=parseFloat(Ka.max)));Ya.appendChild(jb);mxEvent.addListener(jb,"keypress",function(yb){13==yb.keyCode&&ub()});jb.focus();mxEvent.addListener(jb,-"blur",function(){ub()})}}))}Ka.isDeletable&&(Qa=mxUtils.button("-",mxUtils.bind(na,function(lb){T(Ua,"",Ka,Ka.index);mxEvent.consume(lb)})),Qa.style.height="16px",Qa.style.width="25px",Qa.style.float="right",Qa.className="geColorBtn",bb.appendChild(Qa));nb.appendChild(bb);return nb}var na=this,la=this.editorUi.editor.graph,va=[],za=document.createElement("table");za.className="geProperties geFullWidthElement";var sa=document.createElement("tr");sa.className="gePropHeader";var wa=document.createElement("th");-wa.className="gePropHeaderCell";wa.style.paddingLeft="16px";wa.style.backgroundRepeat="no-repeat";wa.style.backgroundPosition="-2px 50%";wa.style.backgroundSize="20px";mxUtils.write(wa,mxResources.get("property"));sa.style.cursor="pointer";var Ca=function(){var Ua=za.querySelectorAll(".gePropNonHeaderRow");if(na.editorUi.propertiesCollapsed){wa.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var Ba="none";for(var Ka=l.childNodes.length-1;0<=Ka;Ka--)try{var ab=l.childNodes[Ka],Qa=ab.nodeName.toUpperCase();-"INPUT"!=Qa&&"SELECT"!=Qa||l.removeChild(ab)}catch(db){}}else wa.style.backgroundImage="url('"+Editor.arrowDownImage+"')",Ba="";for(Ka=0;Ka<Ua.length;Ka++)Ua[Ka].style.display=Ba};mxEvent.addListener(sa,"click",function(){na.editorUi.propertiesCollapsed=!na.editorUi.propertiesCollapsed;Ca()});sa.appendChild(wa);var Fa=document.createElement("th");Fa.className="gePropHeaderCell";Fa.style.paddingLeft="4px";mxUtils.write(Fa,mxResources.get("value"));sa.appendChild(Fa);za.appendChild(sa);var Ha=Fa=!1;-sa=null;1==H.vertices.length&&0==H.edges.length?sa=H.vertices[0].id:0==H.vertices.length&&1==H.edges.length&&(sa=H.edges[0].id);null==sa||J||(za.appendChild(ja("id",mxUtils.htmlEntities(sa),{dispName:"id",type:"readOnly"},!0,!1)),null!=H.style&&null!=H.style.shape&&za.appendChild(ja("shape",mxUtils.htmlEntities(H.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var Na in t)if(J=t[Na],("function"!=typeof J.isVisible||J.isVisible(H,this))&&!J.primary){var La=null!=J.getValue?J.getValue(H,-this):null!=H.style[Na]?mxUtils.htmlEntities(H.style[Na]+""):null!=J.getDefaultValue?J.getDefaultValue(H,this):J.defVal;if("separator"==J.type)Ha=!Ha;else{if("staticArr"==J.type)J.size=parseInt(H.style[J.sizeProperty]||t[J.sizeProperty].defVal)||0;else if(null!=J.dependentProps){var Da=J.dependentProps,Sa=[],Oa=[];for(sa=0;sa<Da.length;sa++)if(null!=t[Da[sa]]){var Ta=H.style[Da[sa]];Oa.push(t[Da[sa]].subDefVal);Sa.push(null!=Ta?Ta.split(","):[])}J.dependentPropsDefVal=Oa;J.dependentPropsVals=Sa}za.appendChild(ja(Na,-La,J,Fa,Ha));Fa=!Fa}}for(sa=0;sa<va.length;sa++)for(J=va[sa],t=J.parentRow,Na=0;Na<J.values.length;Na++)Fa=ja(J.name,J.values[Na],{type:J.type,parentRow:J.parentRow,isDeletable:J.isDeletable,index:Na,defVal:J.defVal,countProperty:J.countProperty,size:J.size},0==Na%2,J.flipBkg),t.parentNode.insertBefore(Fa,t.nextSibling),t=Fa;l.appendChild(za);Ca();return l};StyleFormatPanel.prototype.addStyles=function(l){if(null!=this.defaultColorSchemes){var t=this.editorUi,H=t.editor.graph,J=document.createElement("div");-J.style.padding="6px 20px 0 24px";l.appendChild(J);var R=document.createElement("div");R.className="geSwitcher";R.style.padding="4px 18px 6px 0px";for(var T=[],Y=0;Y<this.defaultColorSchemes.length;Y++){var Z=document.createElement("div");Z.className="geSwitcherDot";mxUtils.bind(this,function(na){mxEvent.addListener(Z,"click",mxUtils.bind(this,function(){ia(na)}))})(Y);T.push(Z);R.appendChild(Z)}var ia=mxUtils.bind(this,function(na){null!=T[na]&&(null!=this.format.currentScheme&&null!=T[this.format.currentScheme]&&-(T[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=na,ka(this.defaultColorSchemes[this.format.currentScheme]),T[this.format.currentScheme].style.background="#84d7ff")}),ka=mxUtils.bind(this,function(na){var la=mxUtils.clone(H.defaultVertexStyle);la[mxConstants.STYLE_STROKECOLOR]=null!=la[mxConstants.STYLE_STROKECOLOR]?la[mxConstants.STYLE_STROKECOLOR]:"default";la[mxConstants.STYLE_FILLCOLOR]=null!=la[mxConstants.STYLE_FILLCOLOR]?la[mxConstants.STYLE_FILLCOLOR]:-"default";la[mxConstants.STYLE_FONTCOLOR]=null!=la[mxConstants.STYLE_FONTCOLOR]?la[mxConstants.STYLE_FONTCOLOR]:"default";H.replaceDefaultColors(new mxCell,la);var va=mxUtils.bind(this,function(sa){var wa=mxUtils.button("",mxUtils.bind(this,function(Ha){H.getModel().beginUpdate();try{for(var Na=t.getSelectionState().cells,La=H.getModel(),Da=[],Sa=0<Na.length,Oa=0;Oa<Na.length;Oa++){var Ta=La.isVertex(Na[Oa])&&La.isEdge(La.getParent(Na[Oa])),Ua=H.getCellStyle(Na[Oa]),Ba=null!=Ua&&"image"==Ua.shape,-Ka=H.getCellGeometry(Na[Oa]);Da.push({isLabel:Ba||Ta&&(null==Ka||0>=Ka.width||0>=Ka.height)});Ta||Ba||(Sa=!1)}for(Oa=0;Oa<Na.length;Oa++){var ab=Da[Oa];if(Sa||!ab.isLabel){var Qa=ab.isLabel?mxConstants.STYLE_LABEL_BACKGROUNDCOLOR:mxConstants.STYLE_FILLCOLOR,db=ab.isLabel?mxConstants.STYLE_LABEL_BORDERCOLOR:mxConstants.STYLE_STROKECOLOR,Va=La.getStyle(Na[Oa]);null!=Va&&"string"!==typeof Va&&(Va=String(Va));null!=sa?(mxEvent.isShiftDown(Ha)||(Va=""==sa.fill||null==sa.fill?mxUtils.setStyle(Va,Qa,null):-mxUtils.setStyle(Va,Qa,sa.fill),ab.isLabel||(Va=""==sa.gradient||null==sa.gradient?mxUtils.setStyle(Va,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Va,mxConstants.STYLE_GRADIENTCOLOR,sa.gradient)),mxEvent.isControlDown(Ha)||mxClient.IS_MAC&&mxEvent.isMetaDown(Ha)||!La.isVertex(Na[Oa])||(Va=""==sa.font||null==sa.font?mxUtils.setStyle(Va,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Va,mxConstants.STYLE_FONTCOLOR,sa.font))),mxEvent.isAltDown(Ha)||(Va=""==sa.stroke||null==sa.stroke?mxUtils.setStyle(Va,-db,null):mxUtils.setStyle(Va,db,sa.stroke))):(Va=mxUtils.setStyle(Va,Qa,null),Va=mxUtils.setStyle(Va,db,null),ab.isLabel||(Va=mxUtils.setStyle(Va,mxConstants.STYLE_GRADIENTCOLOR,null)),La.isVertex(Na[Oa])&&(Va=mxUtils.setStyle(Va,mxConstants.STYLE_FONTCOLOR,null)));La.setStyle(Na[Oa],Va)}}}finally{H.getModel().endUpdate()}}));wa.className="geStyleButton";wa.style.width="36px";wa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";wa.style.margin="0px 6px 6px 0px";if(null!=sa){var Ca="1px solid";-null!=sa.border&&(Ca=sa.border);if(null!=sa.gradient)wa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(sa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(sa.gradient).cssText+" 100%)";else if(sa.fill==mxConstants.NONE)wa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==sa.fill||""==sa.fill)wa.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(la,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var Fa=mxUtils.getLightDarkColor(sa.fill);-wa.style.backgroundImage="linear-gradient(to right bottom, "+Fa.cssText+" 50%, "+Fa.light+" 50.3%)"}null==sa.stroke||sa.stroke==mxConstants.NONE?wa.style.border=Ca+" transparent":""==sa.stroke?wa.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(la,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Fa=mxUtils.getLightDarkColor(sa.stroke),wa.style.border=Ca+" "+Fa.cssText,wa.style.borderRightColor=Fa.light,wa.style.borderBottomColor=wa.style.borderRightColor);null!=sa.title&&wa.setAttribute("title",-sa.title)}else Ca=mxUtils.getValue(la,mxConstants.STYLE_FILLCOLOR,"#ffffff"),Fa=mxUtils.getValue(la,mxConstants.STYLE_STROKECOLOR,"#000000"),wa.style.backgroundColor=Ca,wa.style.border="1px solid "+Fa;wa.style.borderRadius="0";J.appendChild(wa);null!=sa&&null!=sa.gradient&&(Ca=wa.cloneNode(!1),Ca.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(sa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(sa.gradient).light+") 100%)",Ca.style.clipPath=-"polygon(0 100%, 100% 0, 100% 100%)",Ca.style.backgroundColor="transparent",J.appendChild(Ca),Ca.style.marginLeft="-42px",mxEvent.addListener(Ca,"click",function(){wa.click()}))});J.innerText="";if(null!=na)for(var za=0;za<na.length;za++)0<za&&0==mxUtils.mod(za,4)&&mxUtils.br(J),va(na[za])});null==this.format.currentScheme?ia(Math.min(T.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):ia(this.format.currentScheme);Y=10>=this.defaultColorSchemes.length?43:23;var X=document.createElement("div");-X.className="geButton";X.style.cssText="position:absolute;left:0px;bottom:"+Y+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(X,"click",mxUtils.bind(this,function(){ia(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var ja=document.createElement("div");ja.className="geButton";ja.style.cssText="position:absolute;left:186px;bottom:"+Y+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&-(l.appendChild(X),l.appendChild(ja));mxEvent.addListener(ja,"click",mxUtils.bind(this,function(){ia(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));ka(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&l.appendChild(R)}return l}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};-Graph.customFontElements={};Graph.isGoogleFontUrl=function(l){return l.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||l.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(l){return Graph.isGoogleFontUrl(l)};Graph.rewriteGoogleFontUrl=function(l){null!=l&&l.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(l=Editor.GOOGLE_FONTS_CSS2+l.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return l};Graph.createFontElement=-function(l,t){var H=Graph.fontMapping[t];null==H&&Graph.isCssFontUrl(t)?(l=document.createElement("link"),l.setAttribute("rel","stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("charset","UTF-8"),l.setAttribute("href",Graph.rewriteGoogleFontUrl(t))):(null==H&&(H='@font-face {\nfont-family: "'+l+'";\nsrc: url("'+t+'");\n}'),l=document.createElement("style"),mxUtils.write(l,H));return l};Graph.addRecentCustomFont=function(l,t){};Graph.addFont=function(l,t,H,J){if(null!=l&&0<l.length&&null!=-t&&0<t.length){J=null!=J?J:Graph.customFontElements;var R=l.toLowerCase();if("helvetica"!=R&&"arial"!=l&&"sans-serif"!=R){var T=J[R];null!=T&&T.url!=t&&(T.elt.parentNode.removeChild(T.elt),T=null);null==T?(T=t,"http:"==t.substring(0,5)&&(T=PROXY_URL+"?url="+encodeURIComponent(t)),T={name:l,url:t,elt:Graph.createFontElement(l,T)},J[R]=T,t=J==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=H&&("link"==T.elt.nodeName.toLowerCase()?(T.elt.onload=H,T.elt.onerror=H):H()),null!=-t&&t.appendChild(T.elt)):null!=H&&H()}else null!=H&&H()}else null!=H&&H();return l};Graph.getFontUrl=function(l,t){l=Graph.customFontElements[l.toLowerCase()];null!=l&&(t=l.url);return t};Graph.processFontAttributes=function(l){l=l.getElementsByTagName("*");for(var t=0;t<l.length;t++){var H=l[t].getAttribute("data-font-src");if(null!=H){var J="FONT"==l[t].nodeName?l[t].getAttribute("face"):l[t].style.fontFamily;null!=J&&Graph.addFont(J,H)}}};Graph.processFontStyle=function(l){if(null!=l){var t=mxUtils.getValue(l,-"fontSource",null);if(null!=t){var H=mxUtils.getValue(l,mxConstants.STYLE_FONTFAMILY,null);if(null!=H)try{Graph.addFont(H,decodeURIComponent(t))}catch(J){}}}return l};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;mxConnectionHandler.prototype.createTarget="1"==urlParams.sketch;Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity=-"0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var k=Graph.prototype.init;Graph.prototype.init=function(){function l(R){t=R}k.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var t=null;mxEvent.addListener(this.container,"mouseenter",l);mxEvent.addListener(this.container,"mousemove",l);mxEvent.addListener(this.container,"mouseleave",function(R){t=null});-this.isMouseInsertPoint=function(){return null!=t};var H=this.getInsertPoint;this.getInsertPoint=function(R){return null==t||R?H.apply(this,arguments):this.getPointForEvent(t)};var J=this.layoutManager.getLayout;this.layoutManager.getLayout=function(R){var T=this.graph.getCellStyle(R);if(null!=T&&"rack"==T.childLayout){var Y=new mxStackLayout(this.graph,!1);Y.gridSize=null!=T.rackUnitSize?parseFloat(T.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;Y.marginLeft=T.marginLeft||-0;Y.marginRight=T.marginRight||0;Y.marginTop=T.marginTop||0;Y.marginBottom=T.marginBottom||0;Y.allowGaps=T.allowGaps||0;Y.horizontal="1"==mxUtils.getValue(T,"horizontalRack","0");Y.resizeParent=!1;Y.fill=!0;return Y}return J.apply(this,arguments)};this.updateGlobalUrlVariables()};var q=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(l,t){return Graph.processFontStyle(q.apply(this,arguments))};var x=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=-function(l,t,H,J,R,T,Y,Z,ia,ka,X,ja){x.apply(this,arguments);Graph.processFontAttributes(ja)};var B=mxText.prototype.redraw;mxText.prototype.redraw=function(){B.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(l,t,H,J){function R(){for(var za=Z.getSelectionCells(),sa=[],wa=0;wa<za.length;wa++)Z.isCellVisible(za[wa])&&sa.push(za[wa]);Z.setSelectionCells(sa)}function T(za){Z.setHiddenTags(za?[]:ia.slice());-R();Z.refresh()}function Y(za,sa){X.innerText="";if(0<za.length){var wa=document.createElement("table");wa.setAttribute("cellpadding","2");wa.style.boxSizing="border-box";wa.style.tableLayout="fixed";wa.style.width="100%";var Ca=document.createElement("tbody");if(null!=za&&0<za.length)for(var Fa=0;Fa<za.length;Fa++)(function(Ha){function Na(){var Ua=Z.getCellsForTags([Ha],null,null,!0);Z.isEnabled()?Z.setSelectionCells(Ua):Z.highlightCells(Ua,null,null,70)}var La=0>mxUtils.indexOf(Z.hiddenTags,Ha),-Da=document.createElement("tr"),Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";var Oa=document.createElement("img");Oa.setAttribute("src",La?Editor.visibleImage:Editor.hiddenImage);Oa.setAttribute("title",mxResources.get(La?"hideIt":"show",[Ha])+"\n"+mxResources.get("shiftClickShowOnly",[Ha]));mxUtils.setOpacity(Oa,La?75:25);Oa.className="geAdaptiveAsset";Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";Oa.style.width="16px";if(t||Editor.isDarkMode())Oa.style.filter=-"invert(100%)";Sa.appendChild(Oa);mxEvent.addListener(Oa,"click",function(Ua){if(mxEvent.isShiftDown(Ua)){for(var Ba=[],Ka=0;Ka<ia.length;Ka++)ia[Ka]!==Ha&&Ba.push(ia[Ka]);var ab=0<Ba.length;for(Ka=0;Ka<Ba.length;Ka++)if(0>mxUtils.indexOf(Z.hiddenTags,Ba[Ka])){ab=!1;break}ab&&0>mxUtils.indexOf(Z.hiddenTags,Ha)?Z.setHiddenTags([]):Z.setHiddenTags(Ba)}else Z.toggleHiddenTag(Ha);R();Z.refresh();mxEvent.consume(Ua)});Da.appendChild(Sa);Sa=document.createElement("td");Sa.style.align="center";Sa.style.width=-"16px";Oa=document.createElement("img");Oa.setAttribute("src",Editor.selectImage);Oa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Oa,La?75:25);Oa.className="geAdaptiveAsset";Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";Oa.style.width="16px";if(t||Editor.isDarkMode())Oa.style.filter="invert(100%)";mxEvent.addListener(Oa,"click",function(Ua){T(!0);Na();mxEvent.consume(Ua)});Sa.appendChild(Oa);Da.appendChild(Sa);Sa=document.createElement("td");Sa.style.overflow="hidden";-Sa.style.whiteSpace="nowrap";Sa.style.textOverflow="ellipsis";Sa.style.verticalAlign="middle";Sa.style.cursor="pointer";Sa.setAttribute("title",Ha);a=document.createElement("a");mxUtils.write(a,Ha);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,La?100:40);Sa.appendChild(a);mxEvent.addListener(Sa,"click",function(Ua){if(mxEvent.isShiftDown(Ua))T(!0),Na();else if(La&&0<Z.hiddenTags.length)T(!0);else{var Ba=ia.slice(),Ka=mxUtils.indexOf(Ba,Ha);Ba.splice(Ka,1);Z.setHiddenTags(Ba);-R();Z.refresh()}mxEvent.consume(Ua)});Da.appendChild(Sa);if(Z.isEnabled()){Sa=document.createElement("td");Sa.style.verticalAlign="middle";Sa.style.textAlign="center";Sa.style.width="18px";if(null==sa){Sa.style.align="center";Sa.style.width="16px";Oa=document.createElement("img");Oa.setAttribute("src",Editor.trashImage);Oa.setAttribute("title",mxResources.get("removeIt",[Ha]));mxUtils.setOpacity(Oa,La?75:25);Oa.className="geAdaptiveAsset";Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";-Oa.style.width="16px";if(t||Editor.isDarkMode())Oa.style.filter="invert(100%)";mxEvent.addListener(Oa,"click",function(Ua){var Ba=mxUtils.indexOf(ia,Ha);0<=Ba&&ia.splice(Ba,1);Z.removeTagsForCells(Z.model.getDescendants(Z.model.getRoot()),[Ha]);Z.refresh();mxEvent.consume(Ua)});Sa.appendChild(Oa)}else{var Ta=document.createElement("input");Ta.setAttribute("type","checkbox");Ta.style.margin="0px";Ta.defaultChecked=null!=sa&&0<=mxUtils.indexOf(sa,Ha);Ta.checked=Ta.defaultChecked;Ta.style.background=-"transparent";Ta.setAttribute("title",mxResources.get(Ta.defaultChecked?"removeIt":"add",[Ha]));mxEvent.addListener(Ta,"change",function(Ua){Ta.checked?Z.addTagsForCells(Z.getSelectionCells(),[Ha]):Z.removeTagsForCells(Z.getSelectionCells(),[Ha]);mxEvent.consume(Ua)});Sa.appendChild(Ta)}Da.appendChild(Sa)}Ca.appendChild(Da)})(za[Fa]);wa.appendChild(Ca);X.appendChild(wa)}}var Z=this,ia=Z.hiddenTags.slice(),ka=document.createElement("div");ka.style.userSelect="none";ka.style.overflow="hidden";ka.style.padding=-"10px";ka.style.height="100%";var X=document.createElement("div");X.style.position="absolute";X.style.boxSizing="border-box";X.style.userSelect="none";X.style.overflow="auto";X.style.padding="3px";X.style.left="0px";X.style.right="0px";X.style.top="0px";X.style.bottom="0px";ka.appendChild(X);Z.addListener(mxEvent.ROOT,function(){ia=Z.hiddenTags.slice()});var ja=mxUtils.bind(this,function(za,sa){if(l()){za=Z.getAllTags();for(sa=0;sa<za.length;sa++)0>mxUtils.indexOf(ia,za[sa])&&ia.push(za[sa]);ia.sort();-Z.isSelectionEmpty()?Y(ia):Y(ia,Z.getCommonTagsForCells(Z.getSelectionCells()))}});Z.selectionModel.addListener(mxEvent.CHANGE,ja);Z.model.addListener(mxEvent.CHANGE,ja);Z.addListener(mxEvent.REFRESH,ja);var na=document.createElement("div");na.className="geToolbarContainer geDialogToolbar";na.style.position="absolute";na.style.display="flex";na.style.bottom="0px";na.style.left="0px";na.style.right="0px";na.style.height="32px";na.style.overflow="hidden";na.style.padding="3px 4px 4px 4px";na.style.borderWidth=-"1px 0px 0px 0px";na.style.borderStyle="solid";na.style.whiteSpace="nowrap";if(Z.isEnabled()){X.style.bottom="32px";var la=document.createElement("a");la.className="geButton";var va=la.cloneNode(!1);va.style.backgroundImage="url("+Editor.visibleImage+")";va.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(va,"click",function(za){Z.setHiddenTags([]);mxEvent.isShiftDown(za)||(ia=Z.hiddenTags.slice());R();Z.refresh();mxEvent.consume(za)});na.appendChild(va);null!=H&&(la=la.cloneNode(!1),-la.style.backgroundImage="url("+Editor.plusImage+")",la.setAttribute("title",mxResources.get("add")),mxEvent.addListener(la,"click",function(za){H(ia,function(sa){ia=sa;ja()});mxEvent.consume(za)}),na.appendChild(la));ka.appendChild(na)}null!=J&&na.appendChild(J);return{div:ka,refresh:ja}};Graph.prototype.getCustomFonts=function(){var l=this.extFonts;l=null!=l?l.slice():[];for(var t in Graph.customFontElements){var H=Graph.customFontElements[t];l.push({name:H.name,url:H.url})}return l};Graph.prototype.getExtFontCss=-function(){for(var l=this.getCustomFonts(),t="",H="",J=0;J<l.length;J++){var R=l[J].name,T=l[J].url;Graph.isCssFontUrl(T)?t+="@import url("+Graph.rewriteGoogleFontUrl(T)+");\n":H+='@font-face {\nfont-family: "'+R+'";\nsrc: url("'+T+'");\n}\n'}return t+H};Graph.prototype.setFont=function(l,t){Graph.addFont(l,t);var H=Editor.guid();document.execCommand("fontname",!1,H);for(var J=this.cellEditor.textarea.getElementsByTagName("font"),R=!1,T=0;T<J.length;T++)J[T].getAttribute("face")==H&&(R=!0,J[T].setAttribute("face",-l),null!=t?J[T].setAttribute("data-font-src",t):J[T].removeAttribute("data-font-src"));R||document.execCommand("fontname",!1,l)};var E=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return E.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var l=JSON.parse(decodeURIComponent(urlParams.vars));-if(null!=l)for(var t in l)this.globalVars[t]=l[t]}catch(H){null!=window.console&&console.log("Error in vars URL parameter: "+H)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var L=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(l){var t=L.apply(this,arguments);null==t&&null!=this.globalVars&&(t=this.globalVars[l]);return t};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var l=-this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(l.ownerDocument)).decode(l)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var Q=Graph.prototype.getSvg;Graph.prototype.getSvg=function(l,t,H,J,R,T,Y,Z,ia,ka,X,ja,na,la,va,za,sa){if(Editor.mathOutputSize&&this.mathEnabled&&null!=this.container&&document.body.contains(this.container)&&"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset){if(0==this.container.getElementsByTagName("mjx-container").length)try{MathJax.typeset([this.container])}catch(Na){}this.refreshMathBounds()}var wa=-Q.apply(this,arguments);if(null!=ja){var Ca=wa.getAttribute("style");null==Ca&&(Ca="");ja="auto"==ja||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":ja;wa.setAttribute("style",Ca+(" color-scheme: "+ja+";"))}var Fa=X?this.getExtFontCss():"";if(0<Fa.length){var Ha=wa.ownerDocument;Ca=null!=Ha.createElementNS?Ha.createElementNS(mxConstants.NS_SVG,"style"):Ha.createElement("style");null!=Ha.setAttributeNS?Ca.setAttributeNS("type","text/css"):Ca.setAttribute("type",-"text/css");Ca.appendChild(Ha.createTextNode(Fa));wa.getElementsByTagName("defs")[0].appendChild(Ca)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(wa);this.mathEnabled&&(document.body.appendChild(wa),Editor.MathJaxRender(wa),wa.parentNode.removeChild(wa),Ca=wa.ownerDocument.getElementById("MJX-SVG-styles"),null!=Ca&&wa.getElementsByTagName("defs")[0].appendChild(Ca.cloneNode(!0)));return wa};var V=mxCellRenderer.prototype.destroy;-mxCellRenderer.prototype.destroy=function(l){V.apply(this,arguments);null!=l.secondLabel&&(l.secondLabel.destroy(),l.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(l){return[l.shape,l.text,l.secondLabel,l.control]};var K=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){K.apply(this,arguments);this.enumerationState=0};var fa=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(l){null!=l.shape&&this.redrawEnumerationState(l);-return fa.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(l){l=decodeURIComponent(mxUtils.getValue(l.style,"enumerateValue",""));""==l&&(l=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(l)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(l){var t="1"==mxUtils.getValue(l.style,"enumerate",0);t&&null==l.secondLabel?(l.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,-mxConstants.ALIGN_BOTTOM),l.secondLabel.size=12,l.secondLabel.state=l,l.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(l,l.secondLabel)):t||null==l.secondLabel||(l.secondLabel.destroy(),l.secondLabel=null);t=l.secondLabel;if(null!=t){var H=l.view.scale,J=this.createEnumerationValue(l);l=this.graph.model.isVertex(l.cell)?new mxRectangle(l.x+l.width-4*H,l.y+4*H,0,0):mxRectangle.fromPoint(l.view.getPoint(l));t.bounds.equals(l)&&t.value==J&&t.scale==H||(t.bounds=-l,t.value=J,t.scale=H,t.redraw())}};var aa=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();aa.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var da=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){da.apply(this,arguments);this.currentStyle="default-style2"};-Graph.prototype.handleCustomLink=function(l,t){"data:action/json,"==l.substring(0,17)&&(l=JSON.parse(l.substring(17)),null!=l.actions&&this.executeCustomActions(Graph.flattenAnimationActions(l.actions),null,t))};Graph.flattenAnimationActions=function(l){if(!Array.isArray(l))return l;for(var t=[],H=0;H<l.length;H++){var J=l[H];if(null!=J&&null!=J.animation&&Array.isArray(J.animation.steps)){J=Graph.flattenAnimationActions(J.animation.steps);for(var R=0;R<J.length;R++)t.push(J[R])}else t.push(J)}return t};-Graph.smoothScrollContainer=function(l,t,H,J,R,T){T=T||600;if(t!==J||H!==R){l.scrollLeft=t;l.scrollTop=H;var Y="undefined"!=typeof performance&&null!=performance.now?performance.now():Date.now(),Z=J-t,ia=R-H,ka=function(X){X=Math.min(1,(X-Y)/T);var ja=1-Math.pow(1-X,3);l.scrollLeft=t+Z*ja;l.scrollTop=H+ia*ja;1>X&&window.requestAnimationFrame(ka)};window.requestAnimationFrame(ka)}};Graph.applyTransformTransition=function(l,t){t=t||600;var H=l.view.getDrawPane(),J=null!=H?H.parentNode:null;if(null!=-J){var R=J.style.transition;J.style.transition="transform "+t+"ms cubic-bezier(0.16, 1, 0.3, 1)";l.armTransformTransition=!0;var T=function(){J.style.transition=R||"";l.armTransformTransition=!1;J.removeEventListener("transitionend",T)};J.addEventListener("transitionend",T);window.setTimeout(T,t+100)}};Graph.prototype.fitBoundsCssTransform=function(l,t){var H=null!=t?t:10;t=this.view.graphBounds;var J=Math.max(t.x,l.x),R=Math.max(t.y,l.y),T=Math.max(1,Math.min(t.x+t.width,l.x+l.width)-J),Y=Math.max(1,-Math.min(t.y+t.height,l.y+l.height)-R),Z=this.container.clientWidth-H,ia=this.container.clientHeight-H;l=Math.floor(20*Math.min(Z/T,ia/Y))/20;this.view.scaleAndTranslate(l,-t.x,-t.y);J=(J-t.x)*l-Math.max((Z-T*l)/2+H/2,0);H=(R-t.y)*l-Math.max((ia-Y*l)/2+H/2,0);T=this.getBorder();R=t.width*l+2*T-this.container.clientWidth;t=t.height*l+2*T-this.container.clientHeight;this.container.scrollLeft=0>R?0:Math.max(0,Math.min(J,R));this.container.scrollTop=0>t?0:Math.max(0,Math.min(H,t))};Graph.prototype.isGraphTornDown=-function(){return!0===this.destroyed||null==this.container};Graph.prototype.smoothFitWindow=function(l,t,H){if(this.isGraphTornDown())null!=H&&H();else{var J=this.container,R=J.scrollLeft,T=J.scrollTop;this.useCssTransforms?(Graph.applyTransformTransition(this,600),this.fitBoundsCssTransform(l,t)):this.fitWindow(l,t);Graph.smoothScrollContainer(J,R,T,J.scrollLeft,J.scrollTop,600);null!=H&&window.setTimeout(H,600)}};Graph.prototype.scrollCellToVisibleCssTransform=function(l,t){var H=this.view.getState(l);-if(null!=H){var J=this.view.graphBounds,R=this.view.scale;this.view.translate.x===-J.x&&this.view.translate.y===-J.y||this.view.scaleAndTranslate(R,-J.x,-J.y);l=this.container.clientWidth;var T=this.container.clientHeight,Y=this.getBorder(),Z=J.width*R+2*Y-l;Y=J.height*R+2*Y-T;if(null!=t){var ia=(H.x-J.x)*R,ka=(H.y-J.y)*R,X=(H.x+H.width-J.x)*R;J=(H.y+H.height-J.y)*R;var ja=this.container.scrollLeft;H=this.container.scrollTop;ia-t<ja?ja=ia-t:X+t>ja+l&&(ja=X+t-l);ka-t<H?H=ka-t:J+t>H+T&&(H=J+t-T)}else ja=-(H.x+H.width/2-J.x)*R-l/2,H=(H.y+H.height/2-J.y)*R-T/2;this.container.scrollLeft=0>Z?0:Math.max(0,Math.min(ja,Z));this.container.scrollTop=0>Y?0:Math.max(0,Math.min(H,Y))}};Graph.prototype.scrollCellToVisibleBorder=function(l,t){null==t?this.scrollCellToVisible(l):(l=this.view.getState(l),null!=l&&this.scrollRectToVisible(new mxRectangle(-this.view.translate.x+l.x-t,-this.view.translate.y+l.y-t,l.width+2*t,l.height+2*t)))};Graph.prototype.smoothScrollCellToVisible=function(l,t,H){if(this.isGraphTornDown())null!=-H&&H();else{var J=this.container,R=J.scrollLeft,T=J.scrollTop;this.useCssTransforms?this.scrollCellToVisibleCssTransform(l,t):this.scrollCellToVisibleBorder(l,t);Graph.smoothScrollContainer(J,R,T,J.scrollLeft,J.scrollTop,600);null!=H&&window.setTimeout(H,600)}};Graph.prototype.toggleCellsTransient=function(l){l=this.getNodesForCells(l);for(var t=0;t<l.length;t++){var H=l[t].style.opacity;H=""===H||null===H||0<parseFloat(H);l[t].style.opacity=H?0:1}};Graph.prototype.setCellStylesTransient=function(l,-t,H){for(var J=0;J<H.length;J++){var R=this.view.getState(H[J]);null!=R&&null!=R.style&&(null==t?delete R.style[l]:R.style[l]=t,null!=R.shape&&(R.shape.apply(R),R.shape.redraw()),null!=R.text&&(R.text.apply(R),R.text.redraw()))}};Graph.prototype.toggleCellStylesTransient=function(l,t,H){null==t&&(t="0");for(var J=0;J<H.length;J++){var R=this.view.getState(H[J]);if(null!=R&&null!=R.style){var T=mxUtils.getValue(R.style,l,t)?"0":"1";R.style[l]=T;null!=R.shape&&(R.shape.apply(R),R.shape.redraw());null!=-R.text&&(R.text.apply(R),R.text.redraw())}}};Graph.prototype.executeCustomActions=function(l,t,H){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var J=!1,R=0,T=0,Y=mxUtils.bind(this,function(){J||(J=!0,this.model.beginUpdate())}),Z=mxUtils.bind(this,-function(){J&&(J=!1,this.model.endUpdate())}),ia=null==H,ka=function(na){return null!=na.transient?na.transient:ia},X=mxUtils.bind(this,function(){0<R&&R--;0==R&&ja()}),ja=mxUtils.bind(this,function(){if(this.isGraphTornDown())this.stoppingCustomActions=this.executingCustomActions=!1,null!=t&&t();else if(T<l.length){do{var na=this.stoppingCustomActions,la=l[T++],va=[];if(null!=la.open)if(Z(),this.isCustomLink(la.open)){if(!this.customLinkClicked(la.open,H))return}else this.openLink(la.open);null==-la.wait||na||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;X()}),R++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=la.wait?parseInt(la.wait):1E3),Z());null!=la.opacity&&null!=la.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(la.opacity,!0)),la.opacity.value);null!=la.fadeIn&&(R++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(la.fadeIn,!0)),0,1,X,-na?0:la.fadeIn.delay));null!=la.fadeOut&&(R++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(la.fadeOut,!0)),1,0,X,na?0:la.fadeOut.delay));if(null!=la.fadeTo&&null!=la.fadeTo.value){R++;var za=this.getNodesForCells(this.getCellsForAction(la.fadeTo,!0)),sa=na?0:null!=la.fadeTo.delay?la.fadeTo.delay:1E3;Graph.setTransitionForNodes(za,"all "+sa+"ms ease-in-out");Graph.setOpacityForNodes(za,la.fadeTo.value);window.setTimeout(function(){Graph.setTransitionForNodes(za,null);X()},sa)}null!=-la.flow&&(sa=this.getCellsForAction(la.flow,!0),Editor.toggleFlowAnimation(this,sa,!1===la.flow.start?"stop":!0===la.flow.start?"start":"toggle"));null!=la.wipeIn&&(va=va.concat(this.createWipeAnimations(this.getCellsForAction(la.wipeIn,!0),!0)));null!=la.wipeOut&&(va=va.concat(this.createWipeAnimations(this.getCellsForAction(la.wipeOut,!0),!1)));null!=la.popIn&&(va=va.concat(this.createPopAnimations(this.getCellsForAction(la.popIn,!0),!0)));null!=la.popOut&&(va=va.concat(this.createPopAnimations(this.getCellsForAction(la.popOut,-!0),!1)));null!=la.toggle&&(ka(la.toggle)?this.toggleCellsTransient(this.getCellsForAction(la.toggle,!0)):(Y(),this.toggleCells(this.getCellsForAction(la.toggle,!0,!0))));null!=la.show&&(sa=this.getCellsForAction(la.show,!0),Graph.setOpacityForNodes(this.getNodesForCells(sa),1),ka(la.show)||(Y(),this.setCellsVisible(this.getCellsForAction(la.show,!0,!0),!0)));null!=la.hide&&(sa=this.getCellsForAction(la.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(sa),0),ka(la.hide)||(Y(),this.setCellsVisible(this.getCellsForAction(la.hide,-!0,!0),!1)));if(null!=la.toggleStyle&&null!=la.toggleStyle.key){sa=this.getCellsForAction(la.toggleStyle,!0);var wa=null!=la.toggleStyle.defaultValue?la.toggleStyle.defaultValue:"0";ka(la.toggleStyle)?this.toggleCellStylesTransient(la.toggleStyle.key,wa,sa):(Y(),this.toggleCellStyles(la.toggleStyle.key,wa,sa))}null!=la.style&&null!=la.style.key&&(sa=this.getCellsForAction(la.style,!0),ka(la.style)?this.setCellStylesTransient(la.style.key,la.style.value,sa):(Y(),this.setCellStyles(la.style.key,la.style.value,-sa)));sa=[];null!=la.select&&this.isEnabled()&&(sa=this.getCellsForAction(la.select),this.setSelectionCells(sa));null!=la.highlight&&(sa=this.getCellsForAction(la.highlight),this.highlightCells(sa,la.highlight.color,la.highlight.duration,la.highlight.opacity));null!=la.scroll&&(sa=this.getCellsForAction(la.scroll));null!=la.viewbox&&(!0!==la.viewbox.smooth||na?this.useCssTransforms?this.fitBoundsCssTransform(la.viewbox,la.viewbox.border):this.fitWindow(la.viewbox,la.viewbox.border):(R++,this.smoothFitWindow(la.viewbox,-la.viewbox.border,X)));0<sa.length&&(wa=null==la.scroll||null==la.scroll.border||""===la.scroll.border||isNaN(parseFloat(la.scroll.border))?null:parseFloat(la.scroll.border),null==la.scroll||!0!==la.scroll.smooth||na?this.useCssTransforms?this.scrollCellToVisibleCssTransform(sa[0],wa):this.scrollCellToVisibleBorder(sa[0],wa):(R++,this.smoothScrollCellToVisible(sa[0],wa,X)));null!=H&&null!=la.explore&&Graph.exploreFromCell(this,H,la.explore);if(null!=la.tags){if(null!=la.tags.toggle)for(wa=la.tags.toggle,-0==wa.length&&(wa=this.getAllTags()),sa=0;sa<wa.length;sa++)this.toggleHiddenTag(wa[sa]);wa=null;null!=la.tags.hidden&&(null==wa&&(wa=[]),wa=wa.concat(la.tags.hidden));if(null!=la.tags.visible){null==wa&&(wa=[]);var Ca=this.getAllTags();for(sa=0;sa<Ca.length;sa++)0>mxUtils.indexOf(la.tags.visible,Ca[sa])&&0>mxUtils.indexOf(wa,Ca[sa])&&wa.push(Ca[sa])}null!=wa&&this.setHiddenTags(wa);this.refresh()}if(0<va.length){R++;sa=null!=la.steps?la.steps:30;wa=la.delay;Ca=["wipeIn","wipeOut","popIn","popOut"];-for(var Fa=null,Ha=0;Ha<Ca.length;Ha++){var Na=la[Ca[Ha]];null!=Na&&null!=Na.delay&&(Fa=null==Fa?Na.delay:Math.max(Fa,Na.delay))}null!=Fa&&(wa=Fa/sa);this.executeAnimations(va,X,na?1:sa,na?0:wa)}}while(T<l.length&&!0===l[T].immediate&&!this.stoppingCustomActions);0==R?ja():Z()}else this.stoppingCustomActions=this.executingCustomActions=!1,Z(),null!=t&&t()});ja()}};Graph.prototype.doUpdateCustomLinksForCell=function(l,t){var H=this.getLinkForCell(t);null!=H&&"data:action/json,"==H.substring(0,17)&&-this.setLinkForCell(t,this.updateCustomLink(l,H));if(this.isHtmlLabel(t)){var J=document.createElement("div");J.innerHTML=Graph.sanitizeHtml(this.getLabel(t));for(var R=J.getElementsByTagName("a"),T=!1,Y=0;Y<R.length;Y++)H=R[Y].getAttribute("href"),null!=H&&"data:action/json,"==H.substring(0,17)&&(R[Y].setAttribute("href",this.updateCustomLink(l,H)),T=!0);T&&this.labelChanged(t,J.innerHTML)}};Graph.prototype.updateCustomLink=function(l,t){if("data:action/json,"==t.substring(0,17))try{var H=JSON.parse(t.substring(17));-null!=H.actions&&(this.updateCustomLinkActions(l,H.actions),t="data:action/json,"+JSON.stringify(H))}catch(J){}return t};Graph.prototype.updateCustomLinkActions=function(l,t){for(var H=0;H<t.length;H++){var J=t[H],R;for(R in J)this.updateCustomLinkAction(l,J[R],"cells"),this.updateCustomLinkAction(l,J[R],"excludeCells"),this.updateCustomLinkAction(l,J[R],"layers")}};Graph.prototype.updateCustomLinkAction=function(l,t,H){if(null!=t&&null!=t[H]){for(var J=[],R=0;R<t[H].length;R++)if("*"==t[H][R])J.push(t[H][R]);-else{var T=l[t[H][R]];null!=T?""!=T&&J.push(T):J.push(t[H][R])}t[H]=J}};Graph.prototype.getCellsForAction=function(l,t,H){var J="or"===l.tagsMatch?"or":"and",R={},T=[],Y=function(Z){for(var ia=0;ia<Z.length;ia++){var ka=Z[ia].id;R[ka]||(R[ka]=!0,T.push(Z[ia]))}};Y(this.getCellsById(l.cells));Y(this.getCellsForTags(l.tags,null,t,!1,J));Y(H?this.getLayerCells(l.layers):this.getCellsForLayers(l.layers));if(null!=l.excludeCells&&0<l.excludeCells.length){t={};J=!1;for(H=0;H<l.excludeCells.length;H++){if("*"===-l.excludeCells[H]){J=!0;break}t[l.excludeCells[H]]=!0}if(J)return[];l=[];for(H=0;H<T.length;H++)t[T[H].id]||l.push(T[H]);return l}return T};Graph.prototype.getCellsById=function(l){var t=[];if(null!=l)for(var H=0;H<l.length;H++)if("*"==l[H]){var J=this.model.getRoot();t=t.concat(this.model.filterDescendants(function(T){return T!=J},J))}else{var R=this.model.getCell(l[H]);null!=R&&t.push(R)}return t};Graph.prototype.getCellsForLayers=function(l){var t=[];if(Array.isArray(l))for(var H=0;H<l.length;H++){var J=-this.model.getCell(l[H]);null!=J&&(t=t.concat(this.model.filterDescendants(function(R){return R!=J},J)))}return t};Graph.prototype.getLayerCells=function(l){var t=[];if(Array.isArray(l))for(var H=0;H<l.length;H++){var J=this.model.getCell(l[H]);null!=J&&t.push(J)}return t};var ba=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(l){return ba.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(l))};Graph.prototype.setHiddenTags=function(l){this.hiddenTags=l;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};-Graph.prototype.toggleHiddenTag=function(l){var t=mxUtils.indexOf(this.hiddenTags,l);0>t?this.hiddenTags.push(l):0<=t&&this.hiddenTags.splice(t,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(l){if(null==l||0==l.length||0==this.hiddenTags.length)return!1;l=l.split(" ");if(l.length>this.hiddenTags.length)return!1;for(var t=0;t<l.length;t++)if(0>mxUtils.indexOf(this.hiddenTags,l[t]))return!1;return!0};Graph.prototype.getCellsForTags=function(l,t,H,-J,R){var T=[];R="or"===R;if(null!=l){t=null!=t?t:this.model.getDescendants(this.model.getRoot());for(var Y=0,Z={},ia=0;ia<l.length;ia++)0<l[ia].length&&(Z[l[ia]]=!0,Y++);for(ia=0;ia<t.length;ia++)if(H&&this.model.getParent(t[ia])==this.model.root||this.model.isVertex(t[ia])||this.model.isEdge(t[ia])){var ka=this.getTagsForCell(t[ia]),X=!1;if(0<ka.length&&(ka=ka.split(" "),R||ka.length>=l.length)){for(var ja=X=0;ja<ka.length&&X<Y;ja++)null!=Z[ka[ja]]&&X++;X=R?0<X:X==Y}X&&(1!=J||this.isCellVisible(t[ia]))&&-T.push(t[ia])}}return T};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(l){for(var t=null,H=[],J=0;J<l.length;J++){var R=this.getTagsForCell(l[J]);H=[];if(0<R.length){R=R.split(" ");for(var T={},Y=0;Y<R.length;Y++)if(null==t||null!=t[R[Y]])T[R[Y]]=!0,H.push(R[Y]);t=T}else return[]}return H};Graph.prototype.getTagsForCells=function(l){for(var t=[],H={},J=0;J<l.length;J++){var R=this.getTagsForCell(l[J]);-if(0<R.length){R=R.split(" ");for(var T=0;T<R.length;T++)null==H[R[T]]&&(H[R[T]]=!0,t.push(R[T]))}}return t};Graph.prototype.getTagsForCell=function(l){return this.getAttributeForCell(l,"tags","")};Graph.prototype.addTagsForCells=function(l,t){if(0<l.length&&0<t.length){this.model.beginUpdate();try{for(var H=0;H<l.length;H++){for(var J=this.getTagsForCell(l[H]),R=J.split(" "),T=!1,Y=0;Y<t.length;Y++){var Z=mxUtils.trim(t[Y]);""!=Z&&0>mxUtils.indexOf(R,Z)&&(J=0<J.length?J+" "+Z:Z,T=!0)}T&&this.setAttributeForCell(l[H],-"tags",J)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(l,t){if(0<l.length&&0<t.length){this.model.beginUpdate();try{for(var H=0;H<l.length;H++){var J=this.getTagsForCell(l[H]);if(0<J.length){for(var R=J.split(" "),T=!1,Y=0;Y<t.length;Y++){var Z=mxUtils.indexOf(R,t[Y]);0<=Z&&(R.splice(Z,1),T=!0)}T&&this.setAttributeForCell(l[H],"tags",R.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(l){this.model.beginUpdate();try{for(var t=0;t<-l.length;t++)this.model.setVisible(l[t],!this.model.isVisible(l[t]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(l,t){this.model.beginUpdate();try{for(var H=0;H<l.length;H++)this.model.setVisible(l[H],t)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(l,t,H,J){for(var R=0;R<l.length;R++)this.highlightCell(l[R],t,H,J)};Graph.prototype.highlightCell=function(l,t,H,J,R){t=null!=t?t:mxConstants.DEFAULT_VALID_COLOR;H=null!=H?H:1E3;l=this.view.getState(l);-var T=null;null!=l&&(R=null!=R?R:4,R=Math.max(R+1,mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,1)+R),T=new mxCellHighlight(this,t,R,!1),null!=J&&(T.opacity=J),T.highlight(l),window.setTimeout(function(){null!=T.shape&&(mxUtils.setPrefixedStyle(T.shape.node.style,"transition","all 1200ms ease-in-out"),T.shape.node.style.opacity=0);window.setTimeout(function(){T.destroy()},1200)},H));return T};Graph.prototype.addSvgShadow=function(l,t,H,J){J=null!=J?J:!0;var R=Math.ceil(this.svgShadowSize*-this.svgShadowBlur);null!=H&&H||(t=null!=t?t:l.getElementsByTagName("g")[0],null!=t&&(this.updateShadowFilter(t,!0),!isNaN(parseInt(l.getAttribute("width")))&&J&&(l.setAttribute("width",parseInt(l.getAttribute("width"))+R),l.setAttribute("height",parseInt(l.getAttribute("height"))+R),t=l.getAttribute("viewBox"),null!=t&&0<t.length&&(t=t.split(" "),3<t.length&&(w=parseFloat(t[2])+R,h=parseFloat(t[3])+R,l.setAttribute("viewBox",t[0]+" "+t[1]+" "+w+" "+h))))));return R};Graph.prototype.updateShadowFilter=-function(l,t){mxClient.IS_SF||(t?(t=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),l.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+t.cssText+")"):l.style.filter="")};Graph.prototype.setShadowVisible=function(l,t){t=null!=t?t:!0;this.shadowVisible=l;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);t&&this.fireEvent(new mxEventObject("shadowVisibleChanged"));-return Math.ceil(this.svgShadowSize*this.svgShadowBlur)};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var l=this.model.getChildCount(this.model.root),t=0;do var H=this.model.getChildAt(this.model.root,t);while(t++<l&&"1"==mxUtils.getValue(this.getCellStyle(H),"locked","0"));null!=H&&this.setDefaultParent(H)}};-mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=-[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",-STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];-mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",-STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];-mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=-[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",-STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=-[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+-"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",-STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];-mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=-function(l){var t=null;null!=l&&0<l.length&&("ER"==l.substring(0,2)?t="mxgraph.er":"sysML"==l.substring(0,5)&&(t="mxgraph.sysml"));return t};var ha=mxMarker.createMarker;mxMarker.createMarker=function(l,t,H,J,R,T,Y,Z,ia,ka){if(null!=H&&null==mxMarker.markers[H]){var X=this.getPackageForType(H);null!=X&&mxStencilRegistry.getStencil(X)}return ha.apply(this,arguments)};var qa=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(l,t,H,J,R,T){"1"==mxUtils.getValue(t.style,"lineShape",null)&&-l.setFillColor(mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return qa.apply(this,arguments)};PrintDialog.prototype.create=function(l,t,H,J){function R(){wa.value=Math.max(1,Math.min(na,Math.max(parseInt(wa.value),parseInt(sa.value))));sa.value=Math.max(1,Math.min(na,Math.min(parseInt(wa.value),parseInt(sa.value))))}function T(gb){l.lastPrintPagesRadioChecked=za.checked;l.lastPrintSelectionOnlyChecked=Ca.checked;l.lastPrintCropRadioChecked=Ha.checked;l.lastPrintFitRadioChecked=-Na.checked;za.checked&&sa.value<wa.value?(l.lastPrintPagesFromInput=sa.value,l.lastPrintPagesToInput=wa.value):(l.lastPrintPagesFromInput=null,l.lastPrintPagesToInput=null);nb.value=Math.max(1,Math.min(1600,parseInt(nb.value)))+"%";l.lastPrintZoom=nb.value;l.lastPrintBorder=Va.value;l.lastPrintGrid=bb.checked;l.lastPrintShadow=ya.checked;l.lastPrintTransparent=Ra.checked;l.lastPrintInclude=Ya.checked;l.lastPrintSheetsAcross=Qa.value;l.lastPrintSheetsDown=db.value;var jb={};jb.border=parseInt(Va.value);-jb.scale=parseInt(nb.value)/100;jb.grid=bb.checked;jb.shadows=ya.checked;jb.transparent=Ra.checked;jb.includeCopy=Ya.checked;jb.sheetsAcross=parseInt(Qa.value);jb.sheetsDown=parseInt(db.value);jb.pagesFrom=parseInt(sa.value);jb.pagesTo=parseInt(wa.value);jb.allPages=la.checked;jb.selection=Ca.checked;jb.pageView=Fa.checked;jb.crop=Ha.checked;jb.fit=Na.checked;return null!=H?H(!gb,jb):l.print(!gb,jb)}function Y(gb){try{l.hideDialog(),null!=H?T(gb):l.spinner.spin(document.body,mxResources.get("updatingPreview"))&&-window.setTimeout(function(){try{T(gb),l.spinner.stop()}catch(jb){l.handleError(jb)}},0)}catch(jb){l.handleError(jb)}}var Z=l.editor.graph,ia=document.createElement("div");ia.style.display="flex";ia.style.flexDirection="column";ia.style.minHeight="0";var ka=document.createElement("div");ka.style.flex="1 1 auto";ka.style.minHeight="0";ka.style.overflowY="auto";ia.appendChild(ka);var X=document.createElement("h3");mxUtils.write(X,t||mxResources.get("print"));ka.appendChild(X);var ja=1,na=1;X=document.createElement("div");-X.className="geDialogSection";X.style.whiteSpace="nowrap";var la=document.createElement("input");la.style.marginRight="8px";la.setAttribute("type","radio");la.setAttribute("name","pages-printdialog");la.setAttribute("id","gePrintDlgAllPages");var va=document.createElement("div");va.className="geDialogCheckRow";va.appendChild(la);t=document.createElement("label");t.setAttribute("for","gePrintDlgAllPages");mxUtils.write(t,mxResources.get("allPages"));va.appendChild(t);X.appendChild(va);var za=document.createElement("input");-za.style.marginRight="8px";za.setAttribute("type","radio");za.setAttribute("name","pages-printdialog");za.setAttribute("id","gePrintDlgPages");va=document.createElement("div");va.className="geDialogCheckRow";va.appendChild(za);t=document.createElement("label");t.setAttribute("for","gePrintDlgPages");mxUtils.write(t,mxResources.get("pages")+":");va.appendChild(t);var sa=document.createElement("input");sa.style.margin="0 4px";sa.setAttribute("value","1");sa.setAttribute("type","number");sa.setAttribute("min",-"1");sa.style.width="40px";va.appendChild(sa);t=document.createElement("span");mxUtils.write(t,mxResources.get("to"));va.appendChild(t);var wa=sa.cloneNode(!0);va.appendChild(wa);mxEvent.addListener(sa,"focus",function(){za.checked=!0});mxEvent.addListener(wa,"focus",function(){za.checked=!0});mxEvent.addListener(sa,"change",R);mxEvent.addListener(wa,"change",R);if(null!=l.pages&&(na=l.pages.length,null!=l.currentPage))for(t=0;t<na;t++)if(l.currentPage==l.pages[t]){ja=t+1;break}null!=l.lastPrintPagesFromInput&&-null!=l.lastPrintPagesToInput?(sa.value=Math.min(na,Math.max(1,l.lastPrintPagesFromInput)),wa.value=Math.min(na,Math.max(1,l.lastPrintPagesToInput))):(sa.value=ja,wa.value=ja);sa.setAttribute("max",na);wa.setAttribute("max",na);t=mxUtils.button(mxResources.get("currentPage"),function(gb){sa.value=ja;wa.value=ja;za.checked=!0});t.className="geBtn";t.setAttribute("title",mxResources.get("currentPage"));t.style.marginLeft="4px";t.style.maxWidth="100px";va.appendChild(t);X.appendChild(va);1<na&&ka.appendChild(X);-va=document.createElement("div");va.className="geDialogCheckRow";var Ca=document.createElement("input");Ca.setAttribute("name","pages-printdialog");Ca.setAttribute("type",1==na?"checkbox":"radio");Ca.setAttribute("id","gePrintDlgSelectionOnly");Ca.style.marginRight="8px";Z.isSelectionEmpty()&&Ca.setAttribute("disabled","disabled");Z.isEnabled()&&(va.appendChild(Ca),t=document.createElement("label"),t.setAttribute("for","gePrintDlgSelectionOnly"),mxUtils.write(t,mxResources.get("selectionOnly")),va.appendChild(t));-Z.isEnabled()&&(1<na?X.appendChild(va):(t=document.createElement("div"),t.className="geDialogSection",t.appendChild(va),ka.appendChild(t)));!l.isPagesEnabled()||l.lastPrintPagesRadioChecked?za.checked=!0:!Z.isSelectionEmpty()&&l.lastPrintSelectionOnlyChecked?Ca.checked=!0:la.checked=!0;Z=l.addAdvancedSection(ka);ka=Z.content;X=document.createElement("div");X.className="geDialogCheckRow";var Fa=document.createElement("input");Fa.style.marginRight="8px";Fa.setAttribute("type","radio");Fa.setAttribute("name",-"printSize");Fa.setAttribute("id","gePrintDlgPageView");X.appendChild(Fa);t=document.createElement("label");t.setAttribute("for","gePrintDlgPageView");mxUtils.write(t,mxResources.get("pageView"));X.appendChild(t);mxEvent.addListener(X,"click",function(){Fa.checked=!0});ka.appendChild(X);X=document.createElement("div");X.className="geDialogCheckRow";var Ha=document.createElement("input");Ha.style.marginRight="8px";Ha.setAttribute("type","radio");Ha.setAttribute("name","printSize");Ha.setAttribute("id",-"gePrintDlgCrop");X.appendChild(Ha);t=document.createElement("label");t.setAttribute("for","gePrintDlgCrop");mxUtils.write(t,mxResources.get("crop"));X.appendChild(t);mxEvent.addListener(X,"click",function(){Ha.checked=!0});ka.appendChild(X);X=document.createElement("div");X.className="geDialogCheckRow";X.style.alignItems="flex-start";var Na=document.createElement("input");Na.style.marginTop="4px";Na.setAttribute("type","radio");Na.setAttribute("name","printSize");X.appendChild(Na);va=document.createElement("table");-va.style.display="inline-block";va.style.borderSpacing="0";var La=document.createElement("tbody"),Da=document.createElement("tr"),Sa=Da.cloneNode(!0),Oa=document.createElement("td"),Ta=Oa.cloneNode(!0),Ua=Oa.cloneNode(!0),Ba=Oa.cloneNode(!0),Ka=Oa.cloneNode(!0),ab=Oa.cloneNode(!0);Oa.style.textAlign="right";Ba.style.textAlign="right";mxUtils.write(Oa,mxResources.get("fitTo"));mxEvent.addListener(X,"click",function(gb){mxEvent.getSource(gb)!=Na&&(Na.checked=!Na.checked)});var Qa=document.createElement("input");-Qa.style.margin="0 2px";Qa.style.boxSizing="border-box";Qa.setAttribute("value",l.lastPrintSheetsAcross||"1");Qa.setAttribute("min","1");Qa.setAttribute("type","number");Qa.style.width="40px";Ta.appendChild(Qa);t=document.createElement("span");mxUtils.write(t,mxResources.get("fitToSheetsAcross"));Ua.appendChild(t);mxUtils.write(Ba,mxResources.get("fitToBy"));var db=Qa.cloneNode(!0);db.setAttribute("value",l.lastPrintSheetsDown||"1");Ka.appendChild(db);mxEvent.addListener(Qa,"click",function(gb){Na.checked=-!0;mxEvent.consume(gb)});mxEvent.addListener(db,"click",function(gb){Na.checked=!0;mxEvent.consume(gb)});l.lastPrintCropRadioChecked?Ha.checked=!0:l.lastPrintFitRadioChecked?Na.checked=!0:Fa.checked=!0;t=document.createElement("span");mxUtils.write(t,mxResources.get("fitToSheetsDown"));ab.appendChild(t);Da.appendChild(Oa);Da.appendChild(Ta);Da.appendChild(Ua);Sa.appendChild(Ba);Sa.appendChild(Ka);Sa.appendChild(ab);La.appendChild(Da);La.appendChild(Sa);va.appendChild(La);X.appendChild(va);ka.appendChild(X);-ka=document.createElement("div");ka.className="geDialogSection";t=document.createElement("div");t.className="geDialogFormRow";X=document.createElement("label");X.className="geDialogFormLabel";X.setAttribute("for","gePrintDlgBorder");mxUtils.write(X,mxResources.get("borderWidth"));t.appendChild(X);var Va=document.createElement("input");Va.setAttribute("type","number");Va.setAttribute("min","0");Va.setAttribute("id","gePrintDlgBorder");Va.style.width="40px";Va.value=null!=l.lastPrintBorder?l.lastPrintBorder:-mxPrintPreview.prototype.pageMargin;t.appendChild(Va);X=document.createElement("label");X.setAttribute("for","gePrintDlgZoom");X.style.marginLeft="12px";X.style.marginRight="4px";mxUtils.write(X,mxResources.get("zoom"));t.appendChild(X);var nb=document.createElement("input");nb.setAttribute("id","gePrintDlgZoom");nb.style.width="60px";nb.value=null!=l.lastPrintZoom?l.lastPrintZoom:"100%";t.appendChild(nb);ka.appendChild(t);X=document.createElement("div");X.className="geDialogCheckRow";var bb=document.createElement("input");-bb.setAttribute("type","checkbox");bb.setAttribute("id","gePrintDlgGrid");bb.style.marginRight="8px";bb.checked=null!=l.lastPrintGrid?l.lastPrintGrid:!1;X.appendChild(bb);t=document.createElement("label");t.setAttribute("for","gePrintDlgGrid");mxUtils.write(t,mxResources.get("grid"));X.appendChild(t);ka.appendChild(X);X=document.createElement("div");X.className="geDialogCheckRow";var ya=document.createElement("input");ya.setAttribute("type","checkbox");ya.setAttribute("id","gePrintDlgShadows");ya.style.marginRight=-"8px";ya.checked=null!=l.lastPrintShadow?l.lastPrintShadow:!1;X.appendChild(ya);t=document.createElement("label");t.setAttribute("for","gePrintDlgShadows");mxUtils.write(t,mxResources.get("shadows"));X.appendChild(t);l.isOffline()&&!mxClient.IS_CHROMEAPP||X.appendChild(l.createHelpIcon("https://www.drawio.com/docs/manual/export/print-diagram/#shadows-in-print-and-pdf-export"));Editor.enableShadowOption||(X.style.display="none");ka.appendChild(X);var Ra=document.createElement("input");Ra.setAttribute("type",-"checkbox");Ra.setAttribute("id","gePrintDlgTransparent");Ra.style.marginRight="8px";Ra.checked=null!=l.lastPrintTransparent?l.lastPrintTransparent:!1;null!=H&&(X=document.createElement("div"),X.className="geDialogCheckRow",X.appendChild(Ra),t=document.createElement("label"),t.setAttribute("for","gePrintDlgTransparent"),mxUtils.write(t,mxResources.get("transparentBackground")),X.appendChild(t),ka.appendChild(X));var Ya=document.createElement("input");Ya.setAttribute("type","checkbox");Ya.setAttribute("id",-"gePrintDlgInclude");Ya.style.marginRight="8px";Ya.checked=null!=l.lastPrintInclude?l.lastPrintInclude:Editor.defaultIncludeDiagram;null==H||mxClient.IS_CHROMEAPP||"draw.io"!=l.getServiceName()||(X=document.createElement("div"),X.className="geDialogCheckRow",X.appendChild(Ya),t=document.createElement("label"),t.setAttribute("for","gePrintDlgInclude"),mxUtils.write(t,mxResources.get("includeCopyOfMyDiagram")),X.appendChild(t),ka.appendChild(X));Z.wrapper.appendChild(ka);t=document.createElement("div");-t.style.flex="0 0 auto";t.style.marginTop="16px";t.style.textAlign="right";t.style.whiteSpace="nowrap";l.isOffline()&&!mxClient.IS_CHROMEAPP||null!=H||t.appendChild(l.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));Z=mxUtils.button(mxResources.get("cancel"),function(){l.hideDialog()});Z.className="geBtn";l.editor.cancelFirst&&t.appendChild(Z);PrintDialog.previewEnabled&&null==H&&(ka=mxUtils.button(mxResources.get("preview"),function(){Y(!1)}),ka.className="geBtn",t.appendChild(ka));-J=null!=J?J:null!=H?"export":PrintDialog.previewEnabled?"print":"ok";J=mxUtils.button(mxResources.get(J),function(){Y(!0)});J.className="geBtn gePrimaryBtn";t.appendChild(J);l.editor.cancelFirst||t.appendChild(Z);ia.appendChild(t);if(l.editor.isChromelessView()){var lb=function(){Editor.isDarkMode()?(ia.classList.add("geDarkMode"),ia.style.colorScheme="dark"):(ia.classList.remove("geDarkMode"),ia.style.colorScheme="light")};l.addListener("darkModeChanged",lb);lb();var ub=function(gb,jb){gb=jb.getProperty("dialog");-ia.parentNode==gb.container&&(l.editor.removeListener(ub),l.removeListener(lb))};l.editor.addListener("hideDialog",ub)}this.container=ia};var ra=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var l=this.image;null!=l&&null!=l.src&&Graph.isPageLink(l.src)&&(l={originalSrc:l.src});-this.page.viewState.backgroundImage=l}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else ra.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),-null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(l=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=l?l:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.parseAnimationScript=function(l){var t=[];if(null==l)return t;var H=function(ia){if(null!=ia)return ia=-parseFloat(ia),!isNaN(ia)&&0<=ia?ia:void 0},J={fade:!0,pop:!0,wipe:!0};l=l.split("\n");for(var R=0;R<l.length;R++){var T=mxUtils.trim(l[R]);if(""!=T&&"#"!=T.charAt(0)){T=T.split(/\s+/);var Y={action:T[0],cell:T[1],arg:T[2]};if("wait"==Y.action){if(Y.delay=parseFloat(Y.cell),isNaN(Y.delay)||0>Y.delay)Y.delay=1E3}else if("setOpacity"==Y.action)Y.opacity=parseFloat(T[2]),isNaN(Y.opacity)&&(Y.opacity=1),Y.opacity=Math.max(0,Math.min(1,Y.opacity)),Y.duration=H(T[3]),Y.arg=void 0;else if("show"==Y.action){if(null!=-Y.arg&&!J[Y.arg]){var Z=H(Y.arg);null!=Z&&(Y.duration=Z,Y.arg=void 0)}null==Y.duration&&(Y.duration=H(T[3]))}else"hide"==Y.action&&(Y.duration=H(T[2]),Y.arg=void 0);t.push(Y)}}return t};Editor.animationFadeDelay=400;Editor.canBatchAnimationSteps=function(l,t){return l.action!=t.action||"wait"==l.action||(l.arg||"")!=(t.arg||"")||(null!=l.opacity?l.opacity:"")!=(null!=t.opacity?t.opacity:"")||(null!=l.duration?l.duration:"")!=(null!=t.duration?t.duration:"")?!1:!0};Editor.convertLegacyAnimationStep=-function(l){if("wait"==l.action)return{wait:l.delay};var t="all"==l.cell?"*":l.cell;if(null==t)return null;var H={cells:[t]};if(null!=l.duration)H.delay=l.duration;else if("show"==l.action&&"fade"==l.arg)H.delay=Editor.animationFadeDelay;else if("hide"==l.action||"setOpacity"==l.action)H.delay=Editor.animationFadeDelay;return"show"==l.action?"fade"==l.arg?{fadeIn:H}:"pop"==l.arg?{popIn:H}:{wipeIn:H}:"hide"==l.action?{fadeOut:H}:"setOpacity"==l.action?(H.value=l.opacity,{fadeTo:H}):"flow"==l.action?-(t={cells:[t]},"start"==l.arg?t.start=!0:"stop"==l.arg&&(t.start=!1),{flow:t}):null};Editor.convertLegacyAnimation=function(l){l=Editor.parseAnimationScript(l);for(var t=[{opacity:{cells:["*"],value:0}}],H=null,J=function(){null!=H&&(t.push(H),H=null)},R=function(Z){null==H&&(H={});for(var ia in Z){var ka=Z[ia],X;if(X=null!=H[ia]&&null!=ka&&Array.isArray(H[ia].cells)&&Array.isArray(ka.cells))X=H[ia],X=X.delay===ka.delay&&X.value===ka.value&&X.start===ka.start;if(X)for(X=0;X<ka.cells.length;X++)H[ia].cells.push(ka.cells[X]);-else null!=H[ia]&&(J(),H={}),H[ia]=ka}},T=0;T<l.length;T++){var Y=Editor.convertLegacyAnimationStep(l[T]);null!=Y&&(null!=Y.wait?(J(),t.push(Y)):R(Y))}J();return{animation:{steps:t}}};Editor.parseAnimationData=function(l){var t=function(J){null==J&&(J={});Array.isArray(J.steps)||(J.steps=[]);J.loop=null==J.loop?!0:!!J.loop;J.enabled=null==J.enabled?!0:!!J.enabled;return J};if(null==l||""===l)return t({steps:[]});if("string"==typeof l){var H=mxUtils.trim(l);return"{"==H.charAt(0)||"["==H.charAt(0)?-Editor.parseAnimationData(JSON.parse(H)):t(Editor.convertLegacyAnimation(l).animation)}return null!=l.animation&&null!=l.animation.steps?t(l.animation):Array.isArray(l.steps)?t(l):t({steps:[]})};Editor.AnimationPlayer=function(l,t){this.graph=l;this.data=Editor.parseAnimationData(t);this.cancelled=this.running=!1;this.snapshot=null};Editor.ANIMATION_ALL="*";Editor.collectAnimatableCells=function(l){var t=[],H;for(H in l.cells){var J=l.cells[H];(l.isVertex(J)||l.isEdge(J))&&t.push(J)}return t};Editor.AnimationPlayer.prototype.collectReferencedCells=-function(){for(var l=this.data.steps||[],t={},H=[],J=0;J<l.length;J++){var R=l[J],T;for(T in R)if("wait"!=T&&"open"!=T){var Y=R[T];if("object"===typeof Y&&null!=Y){Y=this.graph.getCellsForAction(Y,!0);for(var Z=0;Z<Y.length;Z++)t[Y[Z].id]||(t[Y[Z].id]=!0,H.push(Y[Z]))}}}return H};Editor.AnimationPlayer.prototype.snapshotOpacity=function(){var l=this.collectReferencedCells();l=this.graph.getNodesForCells(l);this.snapshot=[];for(var t=0;t<l.length;t++)this.snapshot.push({node:l[t],opacity:l[t].style.opacity})};-Editor.AnimationPlayer.prototype.restoreOpacity=function(){if(null!=this.snapshot){for(var l=0;l<this.snapshot.length;l++)Graph.setTransitionForNodes([this.snapshot[l].node],null),this.snapshot[l].node.style.opacity=this.snapshot[l].opacity;this.snapshot=null}};Editor.AnimationPlayer.prototype.play=function(l){if(!this.running&&null!=this.graph&&!this.graph.isGraphTornDown()){l=l||{};this.running=!0;this.cancelled=!1;this.graph.stoppingCustomActions=!1;this.graph.view.validate();var t=this,H=this.data.steps||-[],J=function(T,Y){if(null==t.graph||t.graph.isGraphTornDown())t.running=!1;else if(t.cancelled||T>=H.length)Y();else{for(var Z=T+1;Z<H.length&&!0===H[Z].immediate&&!t.cancelled;)Z++;if("function"==typeof l.onStep)try{l.onStep(T,Z)}catch(ia){}t.graph.executeCustomActions(Graph.flattenAnimationActions(H.slice(T,Z)),function(){J(Z,Y)},null)}},R=function(){null==t.graph||t.graph.isGraphTornDown()?t.running=!1:t.cancelled?(t.restoreOpacity(),t.running=!1):(t.snapshotOpacity(),J(0,function(){if(t.cancelled)t.restoreOpacity(),-t.running=!1;else{if("function"==typeof l.onStep)try{l.onStep(-1)}catch(T){}l.loop?(t.graph.refresh(),t.restoreOpacity(),window.setTimeout(R,0)):(t.running=!1,t.restoreOpacity(),null!=l.done&&l.done())}}))};l.defer?window.setTimeout(R,0):R()}};Editor.AnimationPlayer.prototype.stop=function(){this.cancelled=!0;null!=this.graph&&(this.graph.stoppingCustomActions=!0);for(var l=[],t=this.collectReferencedCells(),H=0;H<t.length;H++)this.graph.getModel().isEdge(t[H])&&l.push(t[H]);0<l.length&&Editor.toggleFlowAnimation(this.graph,-l,"stop")};Editor.toggleFlowAnimation=function(l,t,H){H=H||"toggle";for(var J=0;J<t.length;J++)if(l.getModel().isEdge(t[J])){var R=l.view.getState(t[J]);if(null!=R&&null!=R.shape){var T=null!=R.shape.getFlowAnimationPath?R.shape.getFlowAnimationPath():null;if(null!=T){var Y="mxEdgeFlow"==T.getAttribute("class"),Z="start"==H||"toggle"==H&&!Y;Y="stop"==H||"toggle"==H&&Y;R="1"==mxUtils.getValue(R.style,mxConstants.STYLE_DASHED,"0");Y?(T.removeAttribute("class"),R||T.removeAttribute("stroke-dasharray")):-Z&&(T.setAttribute("class","mxEdgeFlow"),R||T.setAttribute("stroke-dasharray","8"))}}}};Editor.playAnimationOnGraph=function(l,t){var H=l.getModel().getRoot(),J=null;null!=H.value&&"object"==typeof H.value&&(J=H.value.getAttribute("animation"));if(null==J||""==J)return null;try{var R=Editor.parseAnimationData(J)}catch(Y){return null}if(!R.steps||0==R.steps.length||!1===R.enabled)return null;H={};if(null!=t)for(var T in t)H[T]=t[T];null==H.loop&&(H.loop=R.loop);null==H.defer&&(H.defer=!0);l=new Editor.AnimationPlayer(l,-R);l.play(H);return l};Editor.installAnimationStyles=function(){if(!Editor.animationStylesInstalled){Editor.animationStylesInstalled=!0;try{var l=document.createElement("style");l.type="text/css";l.appendChild(document.createTextNode(".mxEdgeFlow { animation: mxEdgeFlow 0.5s linear infinite; }@keyframes mxEdgeFlow { to { stroke-dashoffset: -16; } }"));document.getElementsByTagName("head")[0].appendChild(l)}catch(t){}}};Editor.installAnimationStyles()})();(function(){EditorUi.VERSION="30.3.13";EditorUi.CSV_ELK_LAYOUTS={verticalflow:{layout:"elkLayered",config:{"elk.direction":"DOWN","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},horizontalflow:{layout:"elkLayered",config:{"elk.direction":"RIGHT","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED",+mxUtils.bind(this,function(){if(0==J){for(var ia=[H[0]],ja=1;ja<H.length;ja++){var X=H[ja].indexOf(")");ia.push('url("');ia.push(this.cachedFonts[Editor.trimCssUrl(H[ja].substring(0,X))]);ia.push('"'+H[ja].substring(X))}t(ia.join(""))}});if(0<H.length){for(l=1;l<H.length;l++){var T=H[l].indexOf(")"),Y=null,Z=H[l].indexOf("format(",T);0<Z&&(Y=Editor.trimCssUrl(H[l].substring(Z+7,H[l].indexOf(")",Z))));mxUtils.bind(this,function(ia){var ja=this.cachedFonts[ia];if(null==ja){var X=[];this.cachedFonts[ia]=+X;J++;ja="application/x-font-ttf";if("svg"==Y||/(\.svg)($|\?)/i.test(ia))ja="image/svg+xml";else if("otf"==Y||"embedded-opentype"==Y||/(\.otf)($|\?)/i.test(ia))ja="application/x-font-opentype";else if("woff"==Y||/(\.woff)($|\?)/i.test(ia))ja="application/font-woff";else if("woff2"==Y||/(\.woff2)($|\?)/i.test(ia))ja="application/font-woff2";else if("eot"==Y||/(\.eot)($|\?)/i.test(ia))ja="application/vnd.ms-fontobject";else if("sfnt"==Y||/(\.sfnt)($|\?)/i.test(ia))ja="application/font-sfnt";var ka=+mxUtils.bind(this,function(na){this.cachedFonts[ia]=na;J--;R();for(na=0;na<X.length;na++)X[na]()});this.mapFontUrl(ja,ia,mxUtils.bind(this,function(na,la){this.loadUrl(la,function(ua){ka(ua)},function(ua){ka(ia)},!0,null,"data:"+na+";charset=utf-8;base64,")}))}else"string"!=typeof ja&&(J++,ja.push(function(){J--;R()}))})(Editor.trimCssUrl(H[l].substring(0,T)),Y)}R()}else t(l)};Editor.prototype.loadFonts=function(l){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,+function(t){this.resolvedFontCss=t;null!=l&&l()})):null!=l&&l()};Editor.prototype.createGoogleFontCache=function(){var l={},t;for(t in Graph.fontMapping)Graph.isCssFontUrl(t)&&(l[t]=Graph.fontMapping[t]);return l};Editor.prototype.embedExtFonts=function(l){var t=this.graph.getCustomFonts();if(0<t.length){var H=[],J=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var R=mxUtils.bind(this,function(){0==J&&this.embedCssFonts(H.join(""),l)}),T=0;T<t.length;T++)mxUtils.bind(this,+function(Y,Z){Graph.isCssFontUrl(Z)?null==this.cachedGoogleFonts[Z]?(J++,this.loadUrl(Graph.rewriteGoogleFontUrl(Z),mxUtils.bind(this,function(ia){this.cachedGoogleFonts[Z]=ia;H.push(ia+"\n");J--;R()}),mxUtils.bind(this,function(ia){J--;H.push("@import url("+Z+");\n");R()}))):H.push(this.cachedGoogleFonts[Z]+"\n"):H.push('@font-face {font-family: "'+Y+'";src: url("'+Z+'")}\n')})(t[T].name,t[T].url);R()}else l()};Editor.prototype.addMathCss=function(l){l=l.getElementsByTagName("defs");if(null!=l&&+0<l.length)for(var t=document.getElementsByTagName("style"),H=0;H<t.length;H++){var J=mxUtils.getTextContent(t[H]);0>J.indexOf("mxPageSelector")&&0<J.indexOf("MathJax")&&l[0].appendChild(t[H].cloneNode(!0))}};Editor.prototype.addFontCss=function(l,t){t=null!=t?t:this.absoluteCssFonts(this.fontCss);if(null!=t){var H=mxUtils.getSvgDefs(l),J=t.split("\n");t=[];for(var R=[],T=0;T<J.length;T++)"@import"==J[T].substring(0,7)?t.push(J[T]):R.push(J[T]);l=l.ownerDocument;l=null!=l.createElementNS?l.createElementNS(mxConstants.NS_SVG,+"style"):l.createElement("style");l.setAttribute("type","text/css");0<t.length&&(mxUtils.setTextContent(l,t.join("\n")),H.appendChild(l));0<R.length&&(l=l.cloneNode(!1),mxUtils.setTextContent(l,R.join("\n")),H.appendChild(l))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(l,t,H){var J=mxClient.IS_FF?8192:16384;return Math.min(H,Math.min(J/l,J/t))};Editor.prototype.exportToCanvas=function(l,t,H,J,R,+T,Y,Z,ia,ja,X,ka,na,la,ua,za,sa,wa){try{T=null!=T?T:!0;Y=null!=Y?Y:!0;ka=null!=ka?ka:this.graph;na=null!=na?na:0;var Ca=ia?null:ka.background;Ca==mxConstants.NONE&&(Ca=null);null==Ca&&(Ca=J);null==Ca&&0==ia&&(Ca="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(ka.getSvg(null,null,na,la,null,Y,null,null,null,ja,null,za,sa,wa),mxUtils.bind(this,function(Fa){try{Fa.style.setProperty("-webkit-font-smoothing","antialiased");Fa.style.setProperty("-moz-osx-font-smoothing","grayscale");var Ha=+new Image;Ha.onload=mxUtils.bind(this,function(){try{var La=function(){mxClient.IS_SF?window.setTimeout(function(){Ta.drawImage(Ha,0,0);l(Da,Fa)},0):(Ta.drawImage(Ha,0,0),l(Da,Fa))},Da=document.createElement("canvas"),Sa=parseInt(Fa.getAttribute("width")),Oa=parseInt(Fa.getAttribute("height"));Z=null!=Z?Z:1;null!=t&&(Z=T?Math.min(1,Math.min(3*t/(4*Oa),t/Sa)):t/Sa);Z=this.getMaxCanvasScale(Sa,Oa,Z);Sa=Math.ceil(Z*Sa);Oa=Math.ceil(Z*Oa);Da.setAttribute("width",Sa);Da.setAttribute("height",Oa);var Ta=+Da.getContext("2d");if(null!=Ca){var Ua=mxUtils.getLightDarkColor(Ca);Ta.beginPath();Ta.rect(0,0,Sa,Oa);Ta.fillStyle="dark"==za&&"none"!=ka.getAdaptiveColors()?Ua.dark:Ua.light;Ta.fill()}1!=Z&&Ta.scale(Z,Z);if(ua){var Ba=ka.view,Ka=Ba.scale;Ba.scale=1;var ab=btoa(unescape(encodeURIComponent(Ba.createSvgGrid(Ba.gridColor))));Ba.scale=Ka;ab="data:image/svg+xml;base64,"+ab;var Qa=ka.gridSize*Ba.gridSteps*Z,db=ka.getGraphBounds(),Va=Ba.translate.x*Ka,nb=Ba.translate.y*Ka,bb=Va+(db.x-Va)/Ka-na,ya=nb+(db.y-+nb)/Ka-na,Ra=new Image;Ra.onload=function(){try{for(var Ya=-Math.round(Qa-mxUtils.mod((Va-bb)*Z,Qa)),lb=-Math.round(Qa-mxUtils.mod((nb-ya)*Z,Qa));Ya<Sa;Ya+=Qa)for(var ub=lb;ub<Oa;ub+=Qa)Ta.drawImage(Ra,Ya/Z,ub/Z);La()}catch(gb){null!=R&&R(gb)}};Ra.onerror=function(Ya){null!=R&&R(Ya)};Ra.src=ab}else La()}catch(Ya){null!=R&&R(Ya)}});Ha.onerror=function(La){null!=R&&R(La)};ja&&this.graph.addSvgShadow(Fa);this.graph.mathEnabled&&this.addMathCss(Fa);var Na=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&+this.addFontCss(Fa,this.resolvedFontCss),Ha.src=Editor.createSvgDataUri(mxUtils.getXml(Fa))}catch(La){null!=R&&R(La)}});this.embedExtFonts(mxUtils.bind(this,function(La){try{null!=La&&this.addFontCss(Fa,La),this.loadFonts(Na)}catch(Da){null!=R&&R(Da)}}))}catch(La){null!=R&&R(La)}}),H,X)}catch(Fa){null!=R&&R(Fa)}};Editor.crcTable=[];for(var u=0;256>u;u++)for(var n=u,y=0;8>y;y++)n=1==(n&1)?3988292384^n>>>1:n>>>1,Editor.crcTable[u]=n;Editor.updateCRC=function(l,t,H,J){for(var R=0;R<J;R++)l=Editor.crcTable[(l^+t.charCodeAt(H+R))&255]^l>>>8;return l};Editor.crc32=function(l){for(var t=-1,H=0;H<l.length;H++)t=t>>>8^Editor.crcTable[(t^l.charCodeAt(H))&255];return(t^-1)>>>0};Editor.writeGraphModelToPng=function(l,t,H,J,R){function T(X,ka){var na=ia;ia+=ka;return X.substring(na,ia)}function Y(X){X=T(X,4);return X.charCodeAt(3)+(X.charCodeAt(2)<<8)+(X.charCodeAt(1)<<16)+(X.charCodeAt(0)<<24)}function Z(X){return String.fromCharCode(X>>24&255,X>>16&255,X>>8&255,X&255)}l=l.substring(l.indexOf(",")+1);l=window.atob?+atob(l):Base64.decode(l,!0);var ia=0;if(T(l,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=R&&R();else if(T(l,4),"IHDR"!=T(l,4))null!=R&&R();else{T(l,17);R=l.substring(0,ia);do{var ja=Y(l);if("IDAT"==T(l,4)){R=l.substring(0,ia-8);"pHYs"==t&&"dpi"==H?(H=Math.round(J/.0254),H=Z(H)+Z(H)+String.fromCharCode(1)):H=H+String.fromCharCode(0)+("zTXt"==t?String.fromCharCode(0):"")+J;J=4294967295;J=Editor.updateCRC(J,t,0,4);J=Editor.updateCRC(J,H,0,H.length);R+=Z(H.length)+t+H+Z(J^+4294967295);R+=l.substring(ia-8,l.length);break}R+=l.substring(ia-8,ia-4+ja);T(l,ja);T(l,4)}while(ja);return"data:image/png;base64,"+(window.btoa?btoa(R):Base64.encode(R,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var B=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(l,t){B.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var P=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=+function(){P.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(l,t,H){var J=null;if(null!=H)return null;null!=l.editor.graph.getModel().getParent(t)?J=t.getId():null!=l.currentPage&&(J=l.currentPage.getId());return J});if(null!=window.StyleFormatPanel){var G=Format.prototype.init;Format.prototype.init=function(){G.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",+this.update)};var O=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?O.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(l){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var U=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(l){l=U.apply(this,arguments);var t=this.editorUi,+H=t.editor.graph;if(H.isEnabled()){var J=t.getCurrentFile();null!=J&&J.isAutosaveOptional()&&l.appendChild(this.createOption(mxResources.get("autosave"),function(){return t.editor.autosave},function(T){t.editor.setAutosave(T);t.editor.autosave&&J.isModified()&&J.fileChanged()},{install:function(T){this.listener=function(){T(t.editor.autosave)};t.editor.addListener("autosaveChanged",this.listener)},destroy:function(){t.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&H.isEnabled()&&+"undefined"!==typeof MathJax){var R=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return H.mathEnabled},function(T){t.actions.get("mathematicalTypesetting").funct()},{install:function(T){this.listener=function(){T(H.mathEnabled)};t.addListener("mathEnabledChanged",this.listener)},destroy:function(){t.removeListener(this.listener)}});l.appendChild(R);(!t.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&R.appendChild(t.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return l};+mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(l,t){return 0<mxUtils.getValue(l.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.ellipse.prototype.customProperties=+[{name:"centerRadius",dispName:"Center Radius",type:"float",min:0,defVal:0},{name:"centerColor",dispName:"Center Color",type:"color",defVal:null,primary:!0,isVisible:function(l,t){return 0<mxUtils.getValue(l.style,"centerRadius",0)}}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.zigzag.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:5,defVal:20}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=+[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",+dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},+{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2,isVisible:function(l){return"0"==mxUtils.getValue(l.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(l){return"1"==mxUtils.getValue(l.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,+defVal:.25,isVisible:function(l){return"0"==mxUtils.getValue(l.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:25,isVisible:function(l){return"1"==mxUtils.getValue(l.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,+min:0,max:1},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",+dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder3.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlState.prototype.customProperties=+[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.step.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",type:"float",min:0,defVal:20},{name:"fixedSize",dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},+{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.note2.prototype.customProperties=+[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.card.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20},+{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",dispName:"Left"},+{val:"right",dispName:"Right"}]},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},{name:"swimlaneBody",+dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},{name:"separatorColor",dispName:"Separator Color",type:"color",defVal:null},{name:"fixedHeader",dispName:"Fixed Header",type:"bool",defVal:!0,getDefaultValue:function(l,t){l=mxCellRenderer.defaultShapes[mxUtils.getValue(l.style,"shape","")];return null!=l&&null!=l.prototype.fixedHeaderDefault?l.prototype.fixedHeaderDefault?"1":"0":"1"}}];mxCellRenderer.defaultShapes.table.prototype.customProperties=+[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=+mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",+min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0},{name:"imageAlign",+dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},{name:"imageVerticalAlign",dispName:"Image Vertical Align",type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",type:"float",min:0,defVal:24},{name:"arcSize",+dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(l,t){return 0<mxUtils.getValue(l.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=+[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",+min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=+[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.cross.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.corner.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.tee.prototype.customProperties=+[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.umlLifeline.prototype.customProperties=[{name:"participant",dispName:"Participant",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName:"Actor"},{val:"umlBoundary",dispName:"Boundary"},{val:"umlEntity",dispName:"Entity"},{val:"umlControl",dispName:"Control"}]},{name:"size",dispName:"Height",type:"float",defVal:40,+min:0},{name:"lifelineMirror",dispName:"Mirror Head",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:"width",dispName:"Title Width",type:"float",defVal:60,min:0},{name:"height",dispName:"Title Height",type:"float",defVal:30,min:0}];StyleFormatPanel.prototype.defaultColorSchemes=[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",+stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},+{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},+{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",+stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;var c=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var l=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&0<l.cells.length&&+this.container.appendChild(this.addStyles(this.createPanel()));c.apply(this,arguments);null!=l.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),l.customProperties,l))};var f=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(l){var t=this.editorUi.getSelectionState();1==t.cells.length?this.addActions(l,["copyStyle","pasteStyle"]):1<=t.cells.length&&this.addActions(l,["pasteStyle","pasteData"]);f.apply(this,arguments);return l};+EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(l,t,H,J){function R(Ua){try{return decodeURIComponent(Ua)}catch(Ba){return Ua}}function T(Ua,Ba,Ka,ab,Qa){if(null!=Ka.valueChanged)Ka.valueChanged(Ba,Qa,H,na);else{la.getModel().beginUpdate();try{Qa=[];var db=[];if(null!=Ka.index){for(var Va=[],nb=Ka.parentRow.nextSibling;nb&&nb.getAttribute("data-pName")==Ua;)Va.push(nb.getAttribute("data-pValue")),nb=nb.nextSibling;Ka.index<Va.length?null!=ab?Va.splice(ab,+1):Va[Ka.index]=Ba:Va.push(Ba);null!=Ka.size&&Va.length>Ka.size&&(Va=Va.slice(0,Ka.size));Ba=Va.join(",");null!=Ka.countProperty&&(la.setCellStyles(Ka.countProperty,Va.length,la.getSelectionCells()),Qa.push(Ka.countProperty),db.push(Va.length))}la.setCellStyles(Ua,Ba,la.getSelectionCells());Qa.push(Ua);db.push(Ba);if(null!=Ka.dependentProps)for(Ua=0;Ua<Ka.dependentProps.length;Ua++){var bb=Ka.dependentPropsDefVal[Ua],ya=Ka.dependentPropsVals[Ua];if(ya.length>Ba)ya=ya.slice(0,Ba);else for(var Ra=ya.length;Ra<+Ba;Ra++)ya.push(bb);ya=ya.join(",");la.setCellStyles(Ka.dependentProps[Ua],ya,la.getSelectionCells());Qa.push(Ka.dependentProps[Ua]);db.push(ya)}if("function"==typeof Ka.onChange)Ka.onChange(la,Ba);na.editorUi.fireEvent(new mxEventObject("styleChanged","keys",Qa,"values",db,"cells",la.getSelectionCells()))}finally{la.getModel().endUpdate()}}}function Y(Ua,Ba){Ba.style.left="0px";Ba.style.top="0px";Ba.style.position="relative";Ba.style.right="0px";Ba.style.bottom="0px";Ba.style.width="100%";Ba.style.maxWidth=+"100%";Ba.style.maxHeight="100%";Ba.style.textAlign="left"}function Z(Ua,Ba,Ka){function ab(db){if(null==db||db==mxConstants.NONE)Qa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==db)Qa.style.background="";else{var Va=mxUtils.getLightDarkColor(db);mxUtils.isLightDarkColor(db)&&Va.light!=Va.dark?Qa.style.background="linear-gradient(to right bottom, "+Va.cssText+" 50%, "+mxUtils.invertLightDarkColor(Va).cssText+" 50.3%)":Qa.style.background=db}}var Qa=document.createElement("div");+Qa.style.width="32px";Qa.style.height="8px";Qa.style.margin="2px";Qa.style.borderStyle="solid";Qa.style.borderWidth="1px";ab(Ba);btn=mxUtils.button("",mxUtils.bind(na,function(db){this.editorUi.pickColor(Ba,function(Va){T(Ua,Va,Ka);ab(Va)});mxEvent.consume(db)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(Qa);return btn}function ia(Ua,Ba,Ka,ab,Qa,db,Va){null!=Ba&&(Ba=Ba.split(","),ua.push({name:Ua,+values:Ba,type:Ka,defVal:ab,countProperty:Qa,parentRow:db,isDeletable:!0,flipBkg:Va}));btn=mxUtils.button("+",mxUtils.bind(na,function(nb){for(var bb=db,ya=0;null!=bb.nextSibling;)if(bb.nextSibling.getAttribute("data-pName")==Ua)bb=bb.nextSibling,ya++;else break;var Ra={type:Ka,parentRow:db,index:ya,isDeletable:!0,defVal:ab,countProperty:Qa};ya=ka(Ua,"",Ra,0==ya%2,Va);T(Ua,ab,Ra);bb.parentNode.insertBefore(ya,bb.nextSibling);mxEvent.consume(nb)}));btn.style.height="16px";btn.style.width="25px";btn.className=+"geColorBtn";return btn}function ja(Ua,Ba,Ka,ab,Qa,db,Va){if(0<Qa){var nb=Array(Qa);Ba=null!=Ba?Ba.split(","):[];for(var bb=0;bb<Qa;bb++)nb[bb]=null!=Ba[bb]?Ba[bb]:null!=ab?ab:"";ua.push({name:Ua,values:nb,type:Ka,defVal:ab,parentRow:db,flipBkg:Va,size:Qa})}return document.createElement("div")}function X(Ua,Ba,Ka){var ab=document.createElement("input");ab.type="checkbox";ab.checked="1"==Ba;mxEvent.addListener(ab,"change",function(){T(Ua,ab.checked?"1":"0",Ka,null,ab)});return ab}function ka(Ua,Ba,+Ka,ab,Qa){var db=Ka.dispName,Va=Ka.type,nb=document.createElement("tr");nb.className="gePropRow"+(Qa?"Dark":"")+(ab?"Alt":"")+" gePropNonHeaderRow";nb.setAttribute("data-pName",Ua);nb.setAttribute("data-pValue",Ba);ab=!1;null!=Ka.index&&(nb.setAttribute("data-index",Ka.index),db=(null!=db?db:"")+"["+Ka.index+"]",ab=!0);var bb=document.createElement("td");bb.className="gePropRowCell";db=mxResources.get(db,null,db);mxUtils.write(bb,db);bb.setAttribute("title",db);ab&&(bb.style.textAlign="right");nb.appendChild(bb);+bb=document.createElement("td");bb.className="gePropRowCell";bb.setAttribute("title",null!=Ba?R(Ba):mxResources.get("none"));mxEvent.addListener(bb,"click",mxUtils.bind(na,function(lb){!mxUtils.isAncestorNode(nb,document.activeElement)&&mxUtils.isAncestorNode(nb.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(lb))}));if("color"==Va)bb.appendChild(Z(Ua,Ba,Ka));else if("bool"==Va||"boolean"==Va)bb.appendChild(X(Ua,+Ba,Ka));else if("enum"==Va){var ya=Ka.enumList;bb.innerHTML="";var Ra=document.createElement("div");Ra.className="gePropValue";bb.appendChild(Ra);for(Qa=0;Qa<ya.length;Qa++)if(db=ya[Qa],db.val==Ba){mxUtils.write(Ra,mxResources.get(db.dispName,null,db.dispName));break}mxEvent.addListener(bb,"click",mxUtils.bind(na,function(lb){var ub=mxEvent.getSource(lb);if(!(ub!=bb&&ub!=Ra||mxEvent.isConsumed(lb))){Ra.innerHTML="";var gb=document.createElement("select"),jb=null;Y(bb,gb);gb.style.boxSizing="border-box";+gb.style.height="100%";gb.style.padding="0";gb.style.margin="0";gb.style.border="0";for(lb=0;lb<ya.length;lb++){ub=ya[lb];var yb=document.createElement("option");yb.value=mxUtils.htmlEntities(ub.val);mxUtils.write(yb,mxResources.get(ub.dispName,null,ub.dispName));gb.appendChild(yb);null==ub.val&&(yb.value="null",jb=yb)}gb.value=null==Ba&&null!=jb?"null":Ba;Ra.appendChild(gb);mxEvent.addListener(gb,"change",function(){var Bb=mxUtils.htmlEntities(gb.value);if(gb[gb.selectedIndex]==jb||"null"==Bb.value)Bb=+null;T(Ua,Bb,Ka)});gb.focus();mxEvent.addListener(gb,"blur",function(){Ra.innerHTML="";for(var Bb=gb[gb.selectedIndex]==jb||"null"==gb.value?null:gb.value,Cb=0;Cb<ya.length;Cb++){var Kb=ya[Cb];if(Kb.val==Bb){mxUtils.write(Ra,mxResources.get(Kb.dispName,null,Kb.dispName));break}}})}}))}else if("dynamicArr"==Va)bb.appendChild(ia(Ua,Ba,Ka.subType,Ka.subDefVal,Ka.countProperty,nb,Qa));else if("staticArr"==Va)bb.appendChild(ja(Ua,Ba,Ka.subType,Ka.subDefVal,Ka.size,nb,Qa));else if("readOnly"==Va)Qa=document.createElement("input"),+Qa.setAttribute("readonly",""),Qa.value=Ba,Qa.style.borderWidth="0px","id"==Ua||"shape"==Ua?(nb.firstChild.innerHTML="",nb.firstChild.setAttribute("colspan","2"),Qa.style.flexGrow="1",Qa.style.marginLeft="4px",Qa.style.textAlign="id"==Ua?"center":"left",Qa.setAttribute("title",Ba),db=document.createElement("div"),mxUtils.write(db,mxResources.get(Ua)+":"),db.style.display="inline-flex",db.style.alignItems="center",db.style.width="100%",db.appendChild(Qa),nb.firstChild.appendChild(db)):(Qa.style.width=+"96px",bb.appendChild(Qa));else{bb.innerHTML="";var Ya=document.createElement("div");Ya.className="gePropValue";bb.appendChild(Ya);Ya.innerHTML=mxUtils.htmlEntities(R(Ba));mxEvent.addListener(bb,"click",mxUtils.bind(na,function(lb){function ub(){var yb=jb.value,Bb=Va;yb=0==yb.trim().length&&"string"!=Bb&&"numbers"!=Bb?Ka.allowAuto?"auto":0:yb;Ka.allowAuto&&(null!=yb.trim&&"auto"==yb.trim().toLowerCase()?(yb="auto",Bb="string"):(yb=parseFloat(yb),yb=isNaN(yb)?0:yb));null!=Ka.min&&yb<Ka.min?yb=Ka.min:+null!=Ka.max&&yb>Ka.max&&(yb=Ka.max);var Cb=null;try{Cb="numbers"==Bb?yb.match(/\d+/g).map(Number).join(" "):"auto"===yb&&Ka.allowAuto&&"auto"==Ka.defVal?null:encodeURIComponent(("int"==Bb?parseInt(yb):yb)+"")}catch(Kb){}T(Ua,Cb,Ka,null,jb)}var gb=mxEvent.getSource(lb);if(!(gb!=bb&&gb!=Ya||mxEvent.isConsumed(lb))){Ya.innerHTML="";var jb=document.createElement("input");Y(Ya,jb);jb.value=R(Ba);jb.className="gePropEditor";"int"!=Va&&"float"!=Va||Ka.allowAuto||(jb.type="number",jb.step="int"==Va?"1":+"any",null!=Ka.min&&(jb.min=parseFloat(Ka.min)),null!=Ka.max&&(jb.max=parseFloat(Ka.max)));Ya.appendChild(jb);mxEvent.addListener(jb,"keypress",function(yb){13==yb.keyCode&&ub()});jb.focus();mxEvent.addListener(jb,"blur",function(){ub()})}}))}Ka.isDeletable&&(Qa=mxUtils.button("-",mxUtils.bind(na,function(lb){T(Ua,"",Ka,Ka.index);mxEvent.consume(lb)})),Qa.style.height="16px",Qa.style.width="25px",Qa.style.float="right",Qa.className="geColorBtn",bb.appendChild(Qa));nb.appendChild(bb);return nb}var na=+this,la=this.editorUi.editor.graph,ua=[],za=document.createElement("table");za.className="geProperties geFullWidthElement";var sa=document.createElement("tr");sa.className="gePropHeader";var wa=document.createElement("th");wa.className="gePropHeaderCell";wa.style.paddingLeft="16px";wa.style.backgroundRepeat="no-repeat";wa.style.backgroundPosition="-2px 50%";wa.style.backgroundSize="20px";mxUtils.write(wa,mxResources.get("property"));sa.style.cursor="pointer";var Ca=function(){var Ua=za.querySelectorAll(".gePropNonHeaderRow");+if(na.editorUi.propertiesCollapsed){wa.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var Ba="none";for(var Ka=l.childNodes.length-1;0<=Ka;Ka--)try{var ab=l.childNodes[Ka],Qa=ab.nodeName.toUpperCase();"INPUT"!=Qa&&"SELECT"!=Qa||l.removeChild(ab)}catch(db){}}else wa.style.backgroundImage="url('"+Editor.arrowDownImage+"')",Ba="";for(Ka=0;Ka<Ua.length;Ka++)Ua[Ka].style.display=Ba};mxEvent.addListener(sa,"click",function(){na.editorUi.propertiesCollapsed=!na.editorUi.propertiesCollapsed;Ca()});+sa.appendChild(wa);var Fa=document.createElement("th");Fa.className="gePropHeaderCell";Fa.style.paddingLeft="4px";mxUtils.write(Fa,mxResources.get("value"));sa.appendChild(Fa);za.appendChild(sa);var Ha=Fa=!1;sa=null;1==H.vertices.length&&0==H.edges.length?sa=H.vertices[0].id:0==H.vertices.length&&1==H.edges.length&&(sa=H.edges[0].id);null==sa||J||(za.appendChild(ka("id",mxUtils.htmlEntities(sa),{dispName:"id",type:"readOnly"},!0,!1)),null!=H.style&&null!=H.style.shape&&za.appendChild(ka("shape",mxUtils.htmlEntities(H.style.shape),+{dispName:"shape",type:"readOnly"},!0,!1)));for(var Na in t)if(J=t[Na],("function"!=typeof J.isVisible||J.isVisible(H,this))&&!J.primary){var La=null!=J.getValue?J.getValue(H,this):null!=H.style[Na]?mxUtils.htmlEntities(H.style[Na]+""):null!=J.getDefaultValue?J.getDefaultValue(H,this):J.defVal;if("separator"==J.type)Ha=!Ha;else{if("staticArr"==J.type)J.size=parseInt(H.style[J.sizeProperty]||t[J.sizeProperty].defVal)||0;else if(null!=J.dependentProps){var Da=J.dependentProps,Sa=[],Oa=[];for(sa=0;sa<+Da.length;sa++)if(null!=t[Da[sa]]){var Ta=H.style[Da[sa]];Oa.push(t[Da[sa]].subDefVal);Sa.push(null!=Ta?Ta.split(","):[])}J.dependentPropsDefVal=Oa;J.dependentPropsVals=Sa}za.appendChild(ka(Na,La,J,Fa,Ha));Fa=!Fa}}for(sa=0;sa<ua.length;sa++)for(J=ua[sa],t=J.parentRow,Na=0;Na<J.values.length;Na++)Fa=ka(J.name,J.values[Na],{type:J.type,parentRow:J.parentRow,isDeletable:J.isDeletable,index:Na,defVal:J.defVal,countProperty:J.countProperty,size:J.size},0==Na%2,J.flipBkg),t.parentNode.insertBefore(Fa,t.nextSibling),+t=Fa;l.appendChild(za);Ca();return l};StyleFormatPanel.prototype.addStyles=function(l){if(null!=this.defaultColorSchemes){var t=this.editorUi,H=t.editor.graph,J=document.createElement("div");J.style.padding="6px 20px 0 24px";l.appendChild(J);var R=document.createElement("div");R.className="geSwitcher";R.style.padding="4px 18px 6px 0px";for(var T=[],Y=0;Y<this.defaultColorSchemes.length;Y++){var Z=document.createElement("div");Z.className="geSwitcherDot";mxUtils.bind(this,function(na){mxEvent.addListener(Z,+"click",mxUtils.bind(this,function(){ia(na)}))})(Y);T.push(Z);R.appendChild(Z)}var ia=mxUtils.bind(this,function(na){null!=T[na]&&(null!=this.format.currentScheme&&null!=T[this.format.currentScheme]&&(T[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=na,ja(this.defaultColorSchemes[this.format.currentScheme]),T[this.format.currentScheme].style.background="#84d7ff")}),ja=mxUtils.bind(this,function(na){var la=mxUtils.clone(H.defaultVertexStyle);la[mxConstants.STYLE_STROKECOLOR]=+null!=la[mxConstants.STYLE_STROKECOLOR]?la[mxConstants.STYLE_STROKECOLOR]:"default";la[mxConstants.STYLE_FILLCOLOR]=null!=la[mxConstants.STYLE_FILLCOLOR]?la[mxConstants.STYLE_FILLCOLOR]:"default";la[mxConstants.STYLE_FONTCOLOR]=null!=la[mxConstants.STYLE_FONTCOLOR]?la[mxConstants.STYLE_FONTCOLOR]:"default";H.replaceDefaultColors(new mxCell,la);var ua=mxUtils.bind(this,function(sa){var wa=mxUtils.button("",mxUtils.bind(this,function(Ha){H.getModel().beginUpdate();try{for(var Na=t.getSelectionState().cells,+La=H.getModel(),Da=[],Sa=0<Na.length,Oa=0;Oa<Na.length;Oa++){var Ta=La.isVertex(Na[Oa])&&La.isEdge(La.getParent(Na[Oa])),Ua=H.getCellStyle(Na[Oa]),Ba=null!=Ua&&"image"==Ua.shape,Ka=H.getCellGeometry(Na[Oa]);Da.push({isLabel:Ba||Ta&&(null==Ka||0>=Ka.width||0>=Ka.height)});Ta||Ba||(Sa=!1)}for(Oa=0;Oa<Na.length;Oa++){var ab=Da[Oa];if(Sa||!ab.isLabel){var Qa=ab.isLabel?mxConstants.STYLE_LABEL_BACKGROUNDCOLOR:mxConstants.STYLE_FILLCOLOR,db=ab.isLabel?mxConstants.STYLE_LABEL_BORDERCOLOR:mxConstants.STYLE_STROKECOLOR,+Va=La.getStyle(Na[Oa]);null!=Va&&"string"!==typeof Va&&(Va=String(Va));null!=sa?(mxEvent.isShiftDown(Ha)||(Va=""==sa.fill||null==sa.fill?mxUtils.setStyle(Va,Qa,null):mxUtils.setStyle(Va,Qa,sa.fill),ab.isLabel||(Va=""==sa.gradient||null==sa.gradient?mxUtils.setStyle(Va,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Va,mxConstants.STYLE_GRADIENTCOLOR,sa.gradient)),mxEvent.isControlDown(Ha)||mxClient.IS_MAC&&mxEvent.isMetaDown(Ha)||!La.isVertex(Na[Oa])||(Va=""==sa.font||null==sa.font?mxUtils.setStyle(Va,+mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Va,mxConstants.STYLE_FONTCOLOR,sa.font))),mxEvent.isAltDown(Ha)||(Va=""==sa.stroke||null==sa.stroke?mxUtils.setStyle(Va,db,null):mxUtils.setStyle(Va,db,sa.stroke))):(Va=mxUtils.setStyle(Va,Qa,null),Va=mxUtils.setStyle(Va,db,null),ab.isLabel||(Va=mxUtils.setStyle(Va,mxConstants.STYLE_GRADIENTCOLOR,null)),La.isVertex(Na[Oa])&&(Va=mxUtils.setStyle(Va,mxConstants.STYLE_FONTCOLOR,null)));La.setStyle(Na[Oa],Va)}}}finally{H.getModel().endUpdate()}}));wa.className=+"geStyleButton";wa.style.width="36px";wa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";wa.style.margin="0px 6px 6px 0px";if(null!=sa){var Ca="1px solid";null!=sa.border&&(Ca=sa.border);if(null!=sa.gradient)wa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(sa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(sa.gradient).cssText+" 100%)";else if(sa.fill==mxConstants.NONE)wa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==sa.fill||""==sa.fill)wa.style.backgroundColor=+mxUtils.getLightDarkColor(mxUtils.getValue(la,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var Fa=mxUtils.getLightDarkColor(sa.fill);wa.style.backgroundImage="linear-gradient(to right bottom, "+Fa.cssText+" 50%, "+Fa.light+" 50.3%)"}null==sa.stroke||sa.stroke==mxConstants.NONE?wa.style.border=Ca+" transparent":""==sa.stroke?wa.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(la,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Fa=mxUtils.getLightDarkColor(sa.stroke),wa.style.border=+Ca+" "+Fa.cssText,wa.style.borderRightColor=Fa.light,wa.style.borderBottomColor=wa.style.borderRightColor);null!=sa.title&&wa.setAttribute("title",sa.title)}else Ca=mxUtils.getValue(la,mxConstants.STYLE_FILLCOLOR,"#ffffff"),Fa=mxUtils.getValue(la,mxConstants.STYLE_STROKECOLOR,"#000000"),wa.style.backgroundColor=Ca,wa.style.border="1px solid "+Fa;wa.style.borderRadius="0";J.appendChild(wa);null!=sa&&null!=sa.gradient&&(Ca=wa.cloneNode(!1),Ca.style.backgroundImage="linear-gradient(light-dark(transparent, "++mxUtils.getLightDarkColor(sa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(sa.gradient).light+") 100%)",Ca.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",Ca.style.backgroundColor="transparent",J.appendChild(Ca),Ca.style.marginLeft="-42px",mxEvent.addListener(Ca,"click",function(){wa.click()}))});J.innerText="";if(null!=na)for(var za=0;za<na.length;za++)0<za&&0==mxUtils.mod(za,4)&&mxUtils.br(J),ua(na[za])});null==this.format.currentScheme?ia(Math.min(T.length-1,Editor.isDarkMode()?+1:"1"==urlParams.sketch?5:0)):ia(this.format.currentScheme);Y=10>=this.defaultColorSchemes.length?43:23;var X=document.createElement("div");X.className="geButton";X.style.cssText="position:absolute;left:0px;bottom:"+Y+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(X,"click",mxUtils.bind(this,function(){ia(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var ka=document.createElement("div");ka.className="geButton";ka.style.cssText=+"position:absolute;left:186px;bottom:"+Y+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(l.appendChild(X),l.appendChild(ka));mxEvent.addListener(ka,"click",mxUtils.bind(this,function(){ia(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));ja(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&l.appendChild(R)}return l}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('++STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(l){return l.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||l.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(l){return Graph.isGoogleFontUrl(l)};Graph.rewriteGoogleFontUrl=function(l){null!=l&&l.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(l=Editor.GOOGLE_FONTS_CSS2+l.substring(Editor.GOOGLE_FONTS.length)++":wght@400;500");return l};Graph.createFontElement=function(l,t){var H=Graph.fontMapping[t];null==H&&Graph.isCssFontUrl(t)?(l=document.createElement("link"),l.setAttribute("rel","stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("charset","UTF-8"),l.setAttribute("href",Graph.rewriteGoogleFontUrl(t))):(null==H&&(H='@font-face {\nfont-family: "'+l+'";\nsrc: url("'+t+'");\n}'),l=document.createElement("style"),mxUtils.write(l,H));return l};Graph.addRecentCustomFont=function(l,t){};Graph.addFont=+function(l,t,H,J){if(null!=l&&0<l.length&&null!=t&&0<t.length){J=null!=J?J:Graph.customFontElements;var R=l.toLowerCase();if("helvetica"!=R&&"arial"!=l&&"sans-serif"!=R){var T=J[R];null!=T&&T.url!=t&&(T.elt.parentNode.removeChild(T.elt),T=null);null==T?(T=t,"http:"==t.substring(0,5)&&(T=PROXY_URL+"?url="+encodeURIComponent(t)),T={name:l,url:t,elt:Graph.createFontElement(l,T)},J[R]=T,t=J==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=H&&("link"==T.elt.nodeName.toLowerCase()?+(T.elt.onload=H,T.elt.onerror=H):H()),null!=t&&t.appendChild(T.elt)):null!=H&&H()}else null!=H&&H()}else null!=H&&H();return l};Graph.getFontUrl=function(l,t){l=Graph.customFontElements[l.toLowerCase()];null!=l&&(t=l.url);return t};Graph.processFontAttributes=function(l){l=l.getElementsByTagName("*");for(var t=0;t<l.length;t++){var H=l[t].getAttribute("data-font-src");if(null!=H){var J="FONT"==l[t].nodeName?l[t].getAttribute("face"):l[t].style.fontFamily;null!=J&&Graph.addFont(J,H)}}};Graph.processFontStyle=+function(l){if(null!=l){var t=mxUtils.getValue(l,"fontSource",null);if(null!=t){var H=mxUtils.getValue(l,mxConstants.STYLE_FONTFAMILY,null);if(null!=H)try{Graph.addFont(H,decodeURIComponent(t))}catch(J){}}}return l};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;mxConnectionHandler.prototype.createTarget="1"==urlParams.sketch;+Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var k=Graph.prototype.init;Graph.prototype.init=function(){function l(R){t=R}k.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var t=null;mxEvent.addListener(this.container,"mouseenter",l);mxEvent.addListener(this.container,"mousemove",+l);mxEvent.addListener(this.container,"mouseleave",function(R){t=null});this.isMouseInsertPoint=function(){return null!=t};var H=this.getInsertPoint;this.getInsertPoint=function(R){return null==t||R?H.apply(this,arguments):this.getPointForEvent(t)};var J=this.layoutManager.getLayout;this.layoutManager.getLayout=function(R){var T=this.graph.getCellStyle(R);if(null!=T&&"rack"==T.childLayout){var Y=new mxStackLayout(this.graph,!1);Y.gridSize=null!=T.rackUnitSize?parseFloat(T.rackUnitSize):"undefined"!==+typeof mxRackContainer?mxRackContainer.unitSize:20;Y.marginLeft=T.marginLeft||0;Y.marginRight=T.marginRight||0;Y.marginTop=T.marginTop||0;Y.marginBottom=T.marginBottom||0;Y.allowGaps=T.allowGaps||0;Y.horizontal="1"==mxUtils.getValue(T,"horizontalRack","0");Y.resizeParent=!1;Y.fill=!0;return Y}return J.apply(this,arguments)};this.updateGlobalUrlVariables()};var q=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(l,t){return Graph.processFontStyle(q.apply(this,arguments))};+var x=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(l,t,H,J,R,T,Y,Z,ia,ja,X,ka){x.apply(this,arguments);Graph.processFontAttributes(ka)};var C=mxText.prototype.redraw;mxText.prototype.redraw=function(){C.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(l,t,H,J){function R(){for(var za=Z.getSelectionCells(),sa=[],wa=0;wa<za.length;wa++)Z.isCellVisible(za[wa])&&+sa.push(za[wa]);Z.setSelectionCells(sa)}function T(za){Z.setHiddenTags(za?[]:ia.slice());R();Z.refresh()}function Y(za,sa){X.innerText="";if(0<za.length){var wa=document.createElement("table");wa.setAttribute("cellpadding","2");wa.style.boxSizing="border-box";wa.style.tableLayout="fixed";wa.style.width="100%";var Ca=document.createElement("tbody");if(null!=za&&0<za.length)for(var Fa=0;Fa<za.length;Fa++)(function(Ha){function Na(){var Ua=Z.getCellsForTags([Ha],null,null,!0);Z.isEnabled()?Z.setSelectionCells(Ua):+Z.highlightCells(Ua,null,null,70)}var La=0>mxUtils.indexOf(Z.hiddenTags,Ha),Da=document.createElement("tr"),Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";var Oa=document.createElement("img");Oa.setAttribute("src",La?Editor.visibleImage:Editor.hiddenImage);Oa.setAttribute("title",mxResources.get(La?"hideIt":"show",[Ha])+"\n"+mxResources.get("shiftClickShowOnly",[Ha]));mxUtils.setOpacity(Oa,La?75:25);Oa.className="geAdaptiveAsset";Oa.style.verticalAlign="middle";Oa.style.cursor=+"pointer";Oa.style.width="16px";if(t||Editor.isDarkMode())Oa.style.filter="invert(100%)";Sa.appendChild(Oa);mxEvent.addListener(Oa,"click",function(Ua){if(mxEvent.isShiftDown(Ua)){for(var Ba=[],Ka=0;Ka<ia.length;Ka++)ia[Ka]!==Ha&&Ba.push(ia[Ka]);var ab=0<Ba.length;for(Ka=0;Ka<Ba.length;Ka++)if(0>mxUtils.indexOf(Z.hiddenTags,Ba[Ka])){ab=!1;break}ab&&0>mxUtils.indexOf(Z.hiddenTags,Ha)?Z.setHiddenTags([]):Z.setHiddenTags(Ba)}else Z.toggleHiddenTag(Ha);R();Z.refresh();mxEvent.consume(Ua)});Da.appendChild(Sa);+Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";Oa=document.createElement("img");Oa.setAttribute("src",Editor.selectImage);Oa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Oa,La?75:25);Oa.className="geAdaptiveAsset";Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";Oa.style.width="16px";if(t||Editor.isDarkMode())Oa.style.filter="invert(100%)";mxEvent.addListener(Oa,"click",function(Ua){T(!0);Na();mxEvent.consume(Ua)});Sa.appendChild(Oa);Da.appendChild(Sa);+Sa=document.createElement("td");Sa.style.overflow="hidden";Sa.style.whiteSpace="nowrap";Sa.style.textOverflow="ellipsis";Sa.style.verticalAlign="middle";Sa.style.cursor="pointer";Sa.setAttribute("title",Ha);a=document.createElement("a");mxUtils.write(a,Ha);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,La?100:40);Sa.appendChild(a);mxEvent.addListener(Sa,"click",function(Ua){if(mxEvent.isShiftDown(Ua))T(!0),Na();else if(La&&0<Z.hiddenTags.length)T(!0);else{var Ba=+ia.slice(),Ka=mxUtils.indexOf(Ba,Ha);Ba.splice(Ka,1);Z.setHiddenTags(Ba);R();Z.refresh()}mxEvent.consume(Ua)});Da.appendChild(Sa);if(Z.isEnabled()){Sa=document.createElement("td");Sa.style.verticalAlign="middle";Sa.style.textAlign="center";Sa.style.width="18px";if(null==sa){Sa.style.align="center";Sa.style.width="16px";Oa=document.createElement("img");Oa.setAttribute("src",Editor.trashImage);Oa.setAttribute("title",mxResources.get("removeIt",[Ha]));mxUtils.setOpacity(Oa,La?75:25);Oa.className="geAdaptiveAsset";+Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";Oa.style.width="16px";if(t||Editor.isDarkMode())Oa.style.filter="invert(100%)";mxEvent.addListener(Oa,"click",function(Ua){var Ba=mxUtils.indexOf(ia,Ha);0<=Ba&&ia.splice(Ba,1);Z.removeTagsForCells(Z.model.getDescendants(Z.model.getRoot()),[Ha]);Z.refresh();mxEvent.consume(Ua)});Sa.appendChild(Oa)}else{var Ta=document.createElement("input");Ta.setAttribute("type","checkbox");Ta.style.margin="0px";Ta.defaultChecked=null!=sa&&0<=mxUtils.indexOf(sa,+Ha);Ta.checked=Ta.defaultChecked;Ta.style.background="transparent";Ta.setAttribute("title",mxResources.get(Ta.defaultChecked?"removeIt":"add",[Ha]));mxEvent.addListener(Ta,"change",function(Ua){Ta.checked?Z.addTagsForCells(Z.getSelectionCells(),[Ha]):Z.removeTagsForCells(Z.getSelectionCells(),[Ha]);mxEvent.consume(Ua)});Sa.appendChild(Ta)}Da.appendChild(Sa)}Ca.appendChild(Da)})(za[Fa]);wa.appendChild(Ca);X.appendChild(wa)}}var Z=this,ia=Z.hiddenTags.slice(),ja=document.createElement("div");ja.style.userSelect=+"none";ja.style.overflow="hidden";ja.style.padding="10px";ja.style.height="100%";var X=document.createElement("div");X.style.position="absolute";X.style.boxSizing="border-box";X.style.userSelect="none";X.style.overflow="auto";X.style.padding="3px";X.style.left="0px";X.style.right="0px";X.style.top="0px";X.style.bottom="0px";ja.appendChild(X);Z.addListener(mxEvent.ROOT,function(){ia=Z.hiddenTags.slice()});var ka=mxUtils.bind(this,function(za,sa){if(l()){za=Z.getAllTags();for(sa=0;sa<za.length;sa++)0>+mxUtils.indexOf(ia,za[sa])&&ia.push(za[sa]);ia.sort();Z.isSelectionEmpty()?Y(ia):Y(ia,Z.getCommonTagsForCells(Z.getSelectionCells()))}});Z.selectionModel.addListener(mxEvent.CHANGE,ka);Z.model.addListener(mxEvent.CHANGE,ka);Z.addListener(mxEvent.REFRESH,ka);var na=document.createElement("div");na.className="geToolbarContainer geDialogToolbar";na.style.position="absolute";na.style.display="flex";na.style.bottom="0px";na.style.left="0px";na.style.right="0px";na.style.height="32px";na.style.overflow=+"hidden";na.style.padding="3px 4px 4px 4px";na.style.borderWidth="1px 0px 0px 0px";na.style.borderStyle="solid";na.style.whiteSpace="nowrap";if(Z.isEnabled()){X.style.bottom="32px";var la=document.createElement("a");la.className="geButton";var ua=la.cloneNode(!1);ua.style.backgroundImage="url("+Editor.visibleImage+")";ua.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(ua,"click",function(za){Z.setHiddenTags([]);mxEvent.isShiftDown(za)||(ia=Z.hiddenTags.slice());R();Z.refresh();+mxEvent.consume(za)});na.appendChild(ua);null!=H&&(la=la.cloneNode(!1),la.style.backgroundImage="url("+Editor.plusImage+")",la.setAttribute("title",mxResources.get("add")),mxEvent.addListener(la,"click",function(za){H(ia,function(sa){ia=sa;ka()});mxEvent.consume(za)}),na.appendChild(la));ja.appendChild(na)}null!=J&&na.appendChild(J);return{div:ja,refresh:ka}};Graph.prototype.getCustomFonts=function(){var l=this.extFonts;l=null!=l?l.slice():[];for(var t in Graph.customFontElements){var H=Graph.customFontElements[t];+l.push({name:H.name,url:H.url})}return l};Graph.prototype.getExtFontCss=function(){for(var l=this.getCustomFonts(),t="",H="",J=0;J<l.length;J++){var R=l[J].name,T=l[J].url;Graph.isCssFontUrl(T)?t+="@import url("+Graph.rewriteGoogleFontUrl(T)+");\n":H+='@font-face {\nfont-family: "'+R+'";\nsrc: url("'+T+'");\n}\n'}return t+H};Graph.prototype.setFont=function(l,t){Graph.addFont(l,t);var H=Editor.guid();document.execCommand("fontname",!1,H);for(var J=this.cellEditor.textarea.getElementsByTagName("font"),+R=!1,T=0;T<J.length;T++)J[T].getAttribute("face")==H&&(R=!0,J[T].setAttribute("face",l),null!=t?J[T].setAttribute("data-font-src",t):J[T].removeAttribute("data-font-src"));R||document.execCommand("fontname",!1,l)};var E=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return E.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=+null!=this.globalVars?mxUtils.clone(this.globalVars):{};var l=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=l)for(var t in l)this.globalVars[t]=l[t]}catch(H){null!=window.console&&console.log("Error in vars URL parameter: "+H)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var L=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(l){var t=L.apply(this,arguments);null==t&&null!=this.globalVars&&(t=this.globalVars[l]);+return t};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var l=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(l.ownerDocument)).decode(l)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var Q=Graph.prototype.getSvg;Graph.prototype.getSvg=function(l,t,H,J,R,T,Y,Z,ia,ja,X,ka,na,la,ua,za,sa){if(Editor.mathOutputSize&&this.mathEnabled&&null!=this.container&&document.body.contains(this.container)&&"undefined"!==+typeof MathJax&&"function"===typeof MathJax.typeset){if(0==this.container.getElementsByTagName("mjx-container").length)try{MathJax.typeset([this.container])}catch(Na){}this.refreshMathBounds()}var wa=Q.apply(this,arguments);if(null!=ka){var Ca=wa.getAttribute("style");null==Ca&&(Ca="");ka="auto"==ka||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":ka;wa.setAttribute("style",Ca+(" color-scheme: "+ka+";"))}var Fa=X?this.getExtFontCss():"";if(0<Fa.length){var Ha=+wa.ownerDocument;Ca=null!=Ha.createElementNS?Ha.createElementNS(mxConstants.NS_SVG,"style"):Ha.createElement("style");null!=Ha.setAttributeNS?Ca.setAttributeNS("type","text/css"):Ca.setAttribute("type","text/css");Ca.appendChild(Ha.createTextNode(Fa));wa.getElementsByTagName("defs")[0].appendChild(Ca)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(wa);this.mathEnabled&&(document.body.appendChild(wa),Editor.MathJaxRender(wa),wa.parentNode.removeChild(wa),+Ca=wa.ownerDocument.getElementById("MJX-SVG-styles"),null!=Ca&&wa.getElementsByTagName("defs")[0].appendChild(Ca.cloneNode(!0)));return wa};var V=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(l){V.apply(this,arguments);null!=l.secondLabel&&(l.secondLabel.destroy(),l.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(l){return[l.shape,l.text,l.secondLabel,l.control]};var K=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=+function(){K.apply(this,arguments);this.enumerationState=0};var fa=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(l){null!=l.shape&&this.redrawEnumerationState(l);return fa.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(l){l=decodeURIComponent(mxUtils.getValue(l.style,"enumerateValue",""));""==l&&(l=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(l)++"</div>"};mxGraphView.prototype.redrawEnumerationState=function(l){var t="1"==mxUtils.getValue(l.style,"enumerate",0);t&&null==l.secondLabel?(l.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),l.secondLabel.size=12,l.secondLabel.state=l,l.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(l,l.secondLabel)):t||null==l.secondLabel||(l.secondLabel.destroy(),l.secondLabel=null);t=l.secondLabel;if(null!=t){var H=l.view.scale,+J=this.createEnumerationValue(l);l=this.graph.model.isVertex(l.cell)?new mxRectangle(l.x+l.width-4*H,l.y+4*H,0,0):mxRectangle.fromPoint(l.view.getPoint(l));t.bounds.equals(l)&&t.value==J&&t.scale==H||(t.bounds=l,t.value=J,t.scale=H,t.redraw())}};var aa=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();aa.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),+this.view.validateBackgroundImage())};var da=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){da.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(l,t){"data:action/json,"==l.substring(0,17)&&(l=JSON.parse(l.substring(17)),null!=l.actions&&this.executeCustomActions(Graph.flattenAnimationActions(l.actions),null,t))};Graph.flattenAnimationActions=function(l){if(!Array.isArray(l))return l;for(var t=[],H=0;H<l.length;H++){var J=+l[H];if(null!=J&&null!=J.animation&&Array.isArray(J.animation.steps)){J=Graph.flattenAnimationActions(J.animation.steps);for(var R=0;R<J.length;R++)t.push(J[R])}else t.push(J)}return t};Graph.smoothScrollContainer=function(l,t,H,J,R,T){T=T||600;if(t!==J||H!==R){l.scrollLeft=t;l.scrollTop=H;var Y="undefined"!=typeof performance&&null!=performance.now?performance.now():Date.now(),Z=J-t,ia=R-H,ja=function(X){X=Math.min(1,(X-Y)/T);var ka=1-Math.pow(1-X,3);l.scrollLeft=t+Z*ka;l.scrollTop=H+ia*ka;1>X&&+window.requestAnimationFrame(ja)};window.requestAnimationFrame(ja)}};Graph.applyTransformTransition=function(l,t){t=t||600;var H=l.view.getDrawPane(),J=null!=H?H.parentNode:null;if(null!=J){var R=J.style.transition;J.style.transition="transform "+t+"ms cubic-bezier(0.16, 1, 0.3, 1)";l.armTransformTransition=!0;var T=function(){J.style.transition=R||"";l.armTransformTransition=!1;J.removeEventListener("transitionend",T)};J.addEventListener("transitionend",T);window.setTimeout(T,t+100)}};Graph.prototype.fitBoundsCssTransform=+function(l,t){var H=null!=t?t:10;t=this.view.graphBounds;var J=Math.max(t.x,l.x),R=Math.max(t.y,l.y),T=Math.max(1,Math.min(t.x+t.width,l.x+l.width)-J),Y=Math.max(1,Math.min(t.y+t.height,l.y+l.height)-R),Z=this.container.clientWidth-H,ia=this.container.clientHeight-H;l=Math.floor(20*Math.min(Z/T,ia/Y))/20;this.view.scaleAndTranslate(l,-t.x,-t.y);J=(J-t.x)*l-Math.max((Z-T*l)/2+H/2,0);H=(R-t.y)*l-Math.max((ia-Y*l)/2+H/2,0);T=this.getBorder();R=t.width*l+2*T-this.container.clientWidth;t=t.height*l+2*+T-this.container.clientHeight;this.container.scrollLeft=0>R?0:Math.max(0,Math.min(J,R));this.container.scrollTop=0>t?0:Math.max(0,Math.min(H,t))};Graph.prototype.isGraphTornDown=function(){return!0===this.destroyed||null==this.container};Graph.prototype.smoothFitWindow=function(l,t,H){if(this.isGraphTornDown())null!=H&&H();else{var J=this.container,R=J.scrollLeft,T=J.scrollTop;this.useCssTransforms?(Graph.applyTransformTransition(this,600),this.fitBoundsCssTransform(l,t)):this.fitWindow(l,t);Graph.smoothScrollContainer(J,+R,T,J.scrollLeft,J.scrollTop,600);null!=H&&window.setTimeout(H,600)}};Graph.prototype.scrollCellToVisibleCssTransform=function(l,t){var H=this.view.getState(l);if(null!=H){var J=this.view.graphBounds,R=this.view.scale;this.view.translate.x===-J.x&&this.view.translate.y===-J.y||this.view.scaleAndTranslate(R,-J.x,-J.y);l=this.container.clientWidth;var T=this.container.clientHeight,Y=this.getBorder(),Z=J.width*R+2*Y-l;Y=J.height*R+2*Y-T;if(null!=t){var ia=(H.x-J.x)*R,ja=(H.y-J.y)*R,X=(H.x+H.width-J.x)*+R;J=(H.y+H.height-J.y)*R;var ka=this.container.scrollLeft;H=this.container.scrollTop;ia-t<ka?ka=ia-t:X+t>ka+l&&(ka=X+t-l);ja-t<H?H=ja-t:J+t>H+T&&(H=J+t-T)}else ka=(H.x+H.width/2-J.x)*R-l/2,H=(H.y+H.height/2-J.y)*R-T/2;this.container.scrollLeft=0>Z?0:Math.max(0,Math.min(ka,Z));this.container.scrollTop=0>Y?0:Math.max(0,Math.min(H,Y))}};Graph.prototype.scrollCellToVisibleBorder=function(l,t){null==t?this.scrollCellToVisible(l):(l=this.view.getState(l),null!=l&&this.scrollRectToVisible(new mxRectangle(-this.view.translate.x++l.x-t,-this.view.translate.y+l.y-t,l.width+2*t,l.height+2*t)))};Graph.prototype.smoothScrollCellToVisible=function(l,t,H){if(this.isGraphTornDown())null!=H&&H();else{var J=this.container,R=J.scrollLeft,T=J.scrollTop;this.useCssTransforms?this.scrollCellToVisibleCssTransform(l,t):this.scrollCellToVisibleBorder(l,t);Graph.smoothScrollContainer(J,R,T,J.scrollLeft,J.scrollTop,600);null!=H&&window.setTimeout(H,600)}};Graph.prototype.toggleCellsTransient=function(l){l=this.getNodesForCells(l);for(var t=+0;t<l.length;t++){var H=l[t].style.opacity;H=""===H||null===H||0<parseFloat(H);l[t].style.opacity=H?0:1}};Graph.prototype.setCellStylesTransient=function(l,t,H){for(var J=0;J<H.length;J++){var R=this.view.getState(H[J]);null!=R&&null!=R.style&&(null==t?delete R.style[l]:R.style[l]=t,null!=R.shape&&(R.shape.apply(R),R.shape.redraw()),null!=R.text&&(R.text.apply(R),R.text.redraw()))}};Graph.prototype.toggleCellStylesTransient=function(l,t,H){null==t&&(t="0");for(var J=0;J<H.length;J++){var R=this.view.getState(H[J]);+if(null!=R&&null!=R.style){var T=mxUtils.getValue(R.style,l,t)?"0":"1";R.style[l]=T;null!=R.shape&&(R.shape.apply(R),R.shape.redraw());null!=R.text&&(R.text.apply(R),R.text.redraw())}}};Graph.prototype.executeCustomActions=function(l,t,H){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));+else{this.executingCustomActions=!0;var J=!1,R=0,T=0,Y=mxUtils.bind(this,function(){J||(J=!0,this.model.beginUpdate())}),Z=mxUtils.bind(this,function(){J&&(J=!1,this.model.endUpdate())}),ia=null==H,ja=function(na){return null!=na.transient?na.transient:ia},X=mxUtils.bind(this,function(){0<R&&R--;0==R&&ka()}),ka=mxUtils.bind(this,function(){if(this.isGraphTornDown())this.stoppingCustomActions=this.executingCustomActions=!1,null!=t&&t();else if(T<l.length){do{var na=this.stoppingCustomActions,la=l[T++],+ua=[];if(null!=la.open)if(Z(),this.isCustomLink(la.open)){if(!this.customLinkClicked(la.open,H))return}else this.openLink(la.open);null==la.wait||na||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;X()}),R++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=la.wait?parseInt(la.wait):1E3),Z());null!=la.opacity&&null!=la.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(la.opacity,+!0)),la.opacity.value);null!=la.fadeIn&&(R++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(la.fadeIn,!0)),0,1,X,na?0:la.fadeIn.delay));null!=la.fadeOut&&(R++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(la.fadeOut,!0)),1,0,X,na?0:la.fadeOut.delay));if(null!=la.fadeTo&&null!=la.fadeTo.value){R++;var za=this.getNodesForCells(this.getCellsForAction(la.fadeTo,!0)),sa=na?0:null!=la.fadeTo.delay?la.fadeTo.delay:1E3;Graph.setTransitionForNodes(za,"all "+sa+"ms ease-in-out");+Graph.setOpacityForNodes(za,la.fadeTo.value);window.setTimeout(function(){Graph.setTransitionForNodes(za,null);X()},sa)}null!=la.flow&&(sa=this.getCellsForAction(la.flow,!0),Editor.toggleFlowAnimation(this,sa,!1===la.flow.start?"stop":!0===la.flow.start?"start":"toggle"));null!=la.wipeIn&&(ua=ua.concat(this.createWipeAnimations(this.getCellsForAction(la.wipeIn,!0),!0)));null!=la.wipeOut&&(ua=ua.concat(this.createWipeAnimations(this.getCellsForAction(la.wipeOut,!0),!1)));null!=la.popIn&&(ua=ua.concat(this.createPopAnimations(this.getCellsForAction(la.popIn,+!0),!0)));null!=la.popOut&&(ua=ua.concat(this.createPopAnimations(this.getCellsForAction(la.popOut,!0),!1)));null!=la.toggle&&(ja(la.toggle)?this.toggleCellsTransient(this.getCellsForAction(la.toggle,!0)):(Y(),this.toggleCells(this.getCellsForAction(la.toggle,!0,!0))));null!=la.show&&(sa=this.getCellsForAction(la.show,!0),Graph.setOpacityForNodes(this.getNodesForCells(sa),1),ja(la.show)||(Y(),this.setCellsVisible(this.getCellsForAction(la.show,!0,!0),!0)));null!=la.hide&&(sa=this.getCellsForAction(la.hide,+!0),Graph.setOpacityForNodes(this.getNodesForCells(sa),0),ja(la.hide)||(Y(),this.setCellsVisible(this.getCellsForAction(la.hide,!0,!0),!1)));if(null!=la.toggleStyle&&null!=la.toggleStyle.key){sa=this.getCellsForAction(la.toggleStyle,!0);var wa=null!=la.toggleStyle.defaultValue?la.toggleStyle.defaultValue:"0";ja(la.toggleStyle)?this.toggleCellStylesTransient(la.toggleStyle.key,wa,sa):(Y(),this.toggleCellStyles(la.toggleStyle.key,wa,sa))}null!=la.style&&null!=la.style.key&&(sa=this.getCellsForAction(la.style,+!0),ja(la.style)?this.setCellStylesTransient(la.style.key,la.style.value,sa):(Y(),this.setCellStyles(la.style.key,la.style.value,sa)));sa=[];null!=la.select&&this.isEnabled()&&(sa=this.getCellsForAction(la.select),this.setSelectionCells(sa));null!=la.highlight&&(sa=this.getCellsForAction(la.highlight),this.highlightCells(sa,la.highlight.color,la.highlight.duration,la.highlight.opacity));null!=la.scroll&&(sa=this.getCellsForAction(la.scroll));null!=la.viewbox&&(!0!==la.viewbox.smooth||na?this.useCssTransforms?+this.fitBoundsCssTransform(la.viewbox,la.viewbox.border):this.fitWindow(la.viewbox,la.viewbox.border):(R++,this.smoothFitWindow(la.viewbox,la.viewbox.border,X)));0<sa.length&&(wa=null==la.scroll||null==la.scroll.border||""===la.scroll.border||isNaN(parseFloat(la.scroll.border))?null:parseFloat(la.scroll.border),null==la.scroll||!0!==la.scroll.smooth||na?this.useCssTransforms?this.scrollCellToVisibleCssTransform(sa[0],wa):this.scrollCellToVisibleBorder(sa[0],wa):(R++,this.smoothScrollCellToVisible(sa[0],+wa,X)));null!=H&&null!=la.explore&&Graph.exploreFromCell(this,H,la.explore);if(null!=la.tags){if(null!=la.tags.toggle)for(wa=la.tags.toggle,0==wa.length&&(wa=this.getAllTags()),sa=0;sa<wa.length;sa++)this.toggleHiddenTag(wa[sa]);wa=null;null!=la.tags.hidden&&(null==wa&&(wa=[]),wa=wa.concat(la.tags.hidden));if(null!=la.tags.visible){null==wa&&(wa=[]);var Ca=this.getAllTags();for(sa=0;sa<Ca.length;sa++)0>mxUtils.indexOf(la.tags.visible,Ca[sa])&&0>mxUtils.indexOf(wa,Ca[sa])&&wa.push(Ca[sa])}null!=wa&&+this.setHiddenTags(wa);this.refresh()}if(0<ua.length){R++;sa=null!=la.steps?la.steps:30;wa=la.delay;Ca=["wipeIn","wipeOut","popIn","popOut"];for(var Fa=null,Ha=0;Ha<Ca.length;Ha++){var Na=la[Ca[Ha]];null!=Na&&null!=Na.delay&&(Fa=null==Fa?Na.delay:Math.max(Fa,Na.delay))}null!=Fa&&(wa=Fa/sa);this.executeAnimations(ua,X,na?1:sa,na?0:wa)}}while(T<l.length&&!0===l[T].immediate&&!this.stoppingCustomActions);0==R?ka():Z()}else this.stoppingCustomActions=this.executingCustomActions=!1,Z(),null!=t&&t()});+ka()}};Graph.prototype.doUpdateCustomLinksForCell=function(l,t){var H=this.getLinkForCell(t);null!=H&&"data:action/json,"==H.substring(0,17)&&this.setLinkForCell(t,this.updateCustomLink(l,H));if(this.isHtmlLabel(t)){var J=document.createElement("div");J.innerHTML=Graph.sanitizeHtml(this.getLabel(t));for(var R=J.getElementsByTagName("a"),T=!1,Y=0;Y<R.length;Y++)H=R[Y].getAttribute("href"),null!=H&&"data:action/json,"==H.substring(0,17)&&(R[Y].setAttribute("href",this.updateCustomLink(l,H)),T=!0);T&&+this.labelChanged(t,J.innerHTML)}};Graph.prototype.updateCustomLink=function(l,t){if("data:action/json,"==t.substring(0,17))try{var H=JSON.parse(t.substring(17));null!=H.actions&&(this.updateCustomLinkActions(l,H.actions),t="data:action/json,"+JSON.stringify(H))}catch(J){}return t};Graph.prototype.updateCustomLinkActions=function(l,t){for(var H=0;H<t.length;H++){var J=t[H],R;for(R in J)this.updateCustomLinkAction(l,J[R],"cells"),this.updateCustomLinkAction(l,J[R],"excludeCells"),this.updateCustomLinkAction(l,+J[R],"layers")}};Graph.prototype.updateCustomLinkAction=function(l,t,H){if(null!=t&&null!=t[H]){for(var J=[],R=0;R<t[H].length;R++)if("*"==t[H][R])J.push(t[H][R]);else{var T=l[t[H][R]];null!=T?""!=T&&J.push(T):J.push(t[H][R])}t[H]=J}};Graph.prototype.getCellsForAction=function(l,t,H){var J="or"===l.tagsMatch?"or":"and",R={},T=[],Y=function(Z){for(var ia=0;ia<Z.length;ia++){var ja=Z[ia].id;R[ja]||(R[ja]=!0,T.push(Z[ia]))}};Y(this.getCellsById(l.cells));Y(this.getCellsForTags(l.tags,null,t,!1,J));Y(H?+this.getLayerCells(l.layers):this.getCellsForLayers(l.layers));if(null!=l.excludeCells&&0<l.excludeCells.length){t={};J=!1;for(H=0;H<l.excludeCells.length;H++){if("*"===l.excludeCells[H]){J=!0;break}t[l.excludeCells[H]]=!0}if(J)return[];l=[];for(H=0;H<T.length;H++)t[T[H].id]||l.push(T[H]);return l}return T};Graph.prototype.getCellsById=function(l){var t=[];if(null!=l)for(var H=0;H<l.length;H++)if("*"==l[H]){var J=this.model.getRoot();t=t.concat(this.model.filterDescendants(function(T){return T!=J},+J))}else{var R=this.model.getCell(l[H]);null!=R&&t.push(R)}return t};Graph.prototype.getCellsForLayers=function(l){var t=[];if(Array.isArray(l))for(var H=0;H<l.length;H++){var J=this.model.getCell(l[H]);null!=J&&(t=t.concat(this.model.filterDescendants(function(R){return R!=J},J)))}return t};Graph.prototype.getLayerCells=function(l){var t=[];if(Array.isArray(l))for(var H=0;H<l.length;H++){var J=this.model.getCell(l[H]);null!=J&&t.push(J)}return t};var ba=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=+function(l){return ba.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(l))};Graph.prototype.setHiddenTags=function(l){this.hiddenTags=l;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(l){var t=mxUtils.indexOf(this.hiddenTags,l);0>t?this.hiddenTags.push(l):0<=t&&this.hiddenTags.splice(t,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(l){if(null==l||0==l.length||0==this.hiddenTags.length)return!1;+l=l.split(" ");if(l.length>this.hiddenTags.length)return!1;for(var t=0;t<l.length;t++)if(0>mxUtils.indexOf(this.hiddenTags,l[t]))return!1;return!0};Graph.prototype.getCellsForTags=function(l,t,H,J,R){var T=[];R="or"===R;if(null!=l){t=null!=t?t:this.model.getDescendants(this.model.getRoot());for(var Y=0,Z={},ia=0;ia<l.length;ia++)0<l[ia].length&&(Z[l[ia]]=!0,Y++);for(ia=0;ia<t.length;ia++)if(H&&this.model.getParent(t[ia])==this.model.root||this.model.isVertex(t[ia])||this.model.isEdge(t[ia])){var ja=+this.getTagsForCell(t[ia]),X=!1;if(0<ja.length&&(ja=ja.split(" "),R||ja.length>=l.length)){for(var ka=X=0;ka<ja.length&&X<Y;ka++)null!=Z[ja[ka]]&&X++;X=R?0<X:X==Y}X&&(1!=J||this.isCellVisible(t[ia]))&&T.push(t[ia])}}return T};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(l){for(var t=null,H=[],J=0;J<l.length;J++){var R=this.getTagsForCell(l[J]);H=[];if(0<R.length){R=R.split(" ");for(var T=+{},Y=0;Y<R.length;Y++)if(null==t||null!=t[R[Y]])T[R[Y]]=!0,H.push(R[Y]);t=T}else return[]}return H};Graph.prototype.getTagsForCells=function(l){for(var t=[],H={},J=0;J<l.length;J++){var R=this.getTagsForCell(l[J]);if(0<R.length){R=R.split(" ");for(var T=0;T<R.length;T++)null==H[R[T]]&&(H[R[T]]=!0,t.push(R[T]))}}return t};Graph.prototype.getTagsForCell=function(l){return this.getAttributeForCell(l,"tags","")};Graph.prototype.addTagsForCells=function(l,t){if(0<l.length&&0<t.length){this.model.beginUpdate();+try{for(var H=0;H<l.length;H++){for(var J=this.getTagsForCell(l[H]),R=J.split(" "),T=!1,Y=0;Y<t.length;Y++){var Z=mxUtils.trim(t[Y]);""!=Z&&0>mxUtils.indexOf(R,Z)&&(J=0<J.length?J+" "+Z:Z,T=!0)}T&&this.setAttributeForCell(l[H],"tags",J)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(l,t){if(0<l.length&&0<t.length){this.model.beginUpdate();try{for(var H=0;H<l.length;H++){var J=this.getTagsForCell(l[H]);if(0<J.length){for(var R=J.split(" "),T=!1,Y=0;Y<t.length;Y++){var Z=+mxUtils.indexOf(R,t[Y]);0<=Z&&(R.splice(Z,1),T=!0)}T&&this.setAttributeForCell(l[H],"tags",R.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(l){this.model.beginUpdate();try{for(var t=0;t<l.length;t++)this.model.setVisible(l[t],!this.model.isVisible(l[t]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(l,t){this.model.beginUpdate();try{for(var H=0;H<l.length;H++)this.model.setVisible(l[H],t)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=+function(l,t,H,J){for(var R=0;R<l.length;R++)this.highlightCell(l[R],t,H,J)};Graph.prototype.highlightCell=function(l,t,H,J,R){t=null!=t?t:mxConstants.DEFAULT_VALID_COLOR;H=null!=H?H:1E3;l=this.view.getState(l);var T=null;null!=l&&(R=null!=R?R:4,R=Math.max(R+1,mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,1)+R),T=new mxCellHighlight(this,t,R,!1),null!=J&&(T.opacity=J),T.highlight(l),window.setTimeout(function(){null!=T.shape&&(mxUtils.setPrefixedStyle(T.shape.node.style,"transition","all 1200ms ease-in-out"),+T.shape.node.style.opacity=0);window.setTimeout(function(){T.destroy()},1200)},H));return T};Graph.prototype.addSvgShadow=function(l,t,H,J){J=null!=J?J:!0;var R=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=H&&H||(t=null!=t?t:l.getElementsByTagName("g")[0],null!=t&&(this.updateShadowFilter(t,!0),!isNaN(parseInt(l.getAttribute("width")))&&J&&(l.setAttribute("width",parseInt(l.getAttribute("width"))+R),l.setAttribute("height",parseInt(l.getAttribute("height"))+R),t=l.getAttribute("viewBox"),+null!=t&&0<t.length&&(t=t.split(" "),3<t.length&&(w=parseFloat(t[2])+R,h=parseFloat(t[3])+R,l.setAttribute("viewBox",t[0]+" "+t[1]+" "+w+" "+h))))));return R};Graph.prototype.updateShadowFilter=function(l,t){mxClient.IS_SF||(t?(t=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),l.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+t.cssText+")"):l.style.filter="")};Graph.prototype.setShadowVisible=+function(l,t){t=null!=t?t:!0;this.shadowVisible=l;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);t&&this.fireEvent(new mxEventObject("shadowVisibleChanged"));return Math.ceil(this.svgShadowSize*this.svgShadowBlur)};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var l=this.model.getChildCount(this.model.root),+t=0;do var H=this.model.getChildAt(this.model.root,t);while(t++<l&&"1"==mxUtils.getValue(this.getCellStyle(H),"locked","0"));null!=H&&this.setDefaultParent(H)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH++"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH++"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];+mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",+STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",+STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=+[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",+STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",+STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=+[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",+STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=+[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];+mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(l){var t=null;null!=l&&0<l.length&&("ER"==l.substring(0,2)?t="mxgraph.er":"sysML"==l.substring(0,5)&&(t="mxgraph.sysml"));return t};var ha=mxMarker.createMarker;mxMarker.createMarker=function(l,t,H,J,R,T,Y,Z,ia,ja){if(null!=H&&null==mxMarker.markers[H]){var X=this.getPackageForType(H);null!=X&&mxStencilRegistry.getStencil(X)}return ha.apply(this,+arguments)};var qa=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(l,t,H,J,R,T){"1"==mxUtils.getValue(t.style,"lineShape",null)&&l.setFillColor(mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return qa.apply(this,arguments)};PrintDialog.prototype.create=function(l,t,H,J){function R(){wa.value=Math.max(1,Math.min(na,Math.max(parseInt(wa.value),parseInt(sa.value))));sa.value=Math.max(1,Math.min(na,Math.min(parseInt(wa.value),parseInt(sa.value))))}function T(gb){l.lastPrintPagesRadioChecked=+za.checked;l.lastPrintSelectionOnlyChecked=Ca.checked;l.lastPrintCropRadioChecked=Ha.checked;l.lastPrintFitRadioChecked=Na.checked;za.checked&&sa.value<wa.value?(l.lastPrintPagesFromInput=sa.value,l.lastPrintPagesToInput=wa.value):(l.lastPrintPagesFromInput=null,l.lastPrintPagesToInput=null);nb.value=Math.max(1,Math.min(1600,parseInt(nb.value)))+"%";l.lastPrintZoom=nb.value;l.lastPrintBorder=Va.value;l.lastPrintGrid=bb.checked;l.lastPrintShadow=ya.checked;l.lastPrintTransparent=Ra.checked;l.lastPrintInclude=+Ya.checked;l.lastPrintSheetsAcross=Qa.value;l.lastPrintSheetsDown=db.value;var jb={};jb.border=parseInt(Va.value);jb.scale=parseInt(nb.value)/100;jb.grid=bb.checked;jb.shadows=ya.checked;jb.transparent=Ra.checked;jb.includeCopy=Ya.checked;jb.sheetsAcross=parseInt(Qa.value);jb.sheetsDown=parseInt(db.value);jb.pagesFrom=parseInt(sa.value);jb.pagesTo=parseInt(wa.value);jb.allPages=la.checked;jb.selection=Ca.checked;jb.pageView=Fa.checked;jb.crop=Ha.checked;jb.fit=Na.checked;return null!=H?H(!gb,jb):+l.print(!gb,jb)}function Y(gb){try{l.hideDialog(),null!=H?T(gb):l.spinner.spin(document.body,mxResources.get("updatingPreview"))&&window.setTimeout(function(){try{T(gb),l.spinner.stop()}catch(jb){l.handleError(jb)}},0)}catch(jb){l.handleError(jb)}}var Z=l.editor.graph,ia=document.createElement("div");ia.style.display="flex";ia.style.flexDirection="column";ia.style.minHeight="0";var ja=document.createElement("div");ja.style.flex="1 1 auto";ja.style.minHeight="0";ja.style.overflowY="auto";ia.appendChild(ja);+var X=document.createElement("h3");mxUtils.write(X,t||mxResources.get("print"));ja.appendChild(X);var ka=1,na=1;X=document.createElement("div");X.className="geDialogSection";X.style.whiteSpace="nowrap";var la=document.createElement("input");la.style.marginRight="8px";la.setAttribute("type","radio");la.setAttribute("name","pages-printdialog");la.setAttribute("id","gePrintDlgAllPages");var ua=document.createElement("div");ua.className="geDialogCheckRow";ua.appendChild(la);t=document.createElement("label");+t.setAttribute("for","gePrintDlgAllPages");mxUtils.write(t,mxResources.get("allPages"));ua.appendChild(t);X.appendChild(ua);var za=document.createElement("input");za.style.marginRight="8px";za.setAttribute("type","radio");za.setAttribute("name","pages-printdialog");za.setAttribute("id","gePrintDlgPages");ua=document.createElement("div");ua.className="geDialogCheckRow";ua.appendChild(za);t=document.createElement("label");t.setAttribute("for","gePrintDlgPages");mxUtils.write(t,mxResources.get("pages")++":");ua.appendChild(t);var sa=document.createElement("input");sa.style.margin="0 4px";sa.setAttribute("value","1");sa.setAttribute("type","number");sa.setAttribute("min","1");sa.style.width="40px";ua.appendChild(sa);t=document.createElement("span");mxUtils.write(t,mxResources.get("to"));ua.appendChild(t);var wa=sa.cloneNode(!0);ua.appendChild(wa);mxEvent.addListener(sa,"focus",function(){za.checked=!0});mxEvent.addListener(wa,"focus",function(){za.checked=!0});mxEvent.addListener(sa,"change",R);mxEvent.addListener(wa,+"change",R);if(null!=l.pages&&(na=l.pages.length,null!=l.currentPage))for(t=0;t<na;t++)if(l.currentPage==l.pages[t]){ka=t+1;break}null!=l.lastPrintPagesFromInput&&null!=l.lastPrintPagesToInput?(sa.value=Math.min(na,Math.max(1,l.lastPrintPagesFromInput)),wa.value=Math.min(na,Math.max(1,l.lastPrintPagesToInput))):(sa.value=ka,wa.value=ka);sa.setAttribute("max",na);wa.setAttribute("max",na);t=mxUtils.button(mxResources.get("currentPage"),function(gb){sa.value=ka;wa.value=ka;za.checked=!0});t.className=+"geBtn";t.setAttribute("title",mxResources.get("currentPage"));t.style.marginLeft="4px";t.style.maxWidth="100px";ua.appendChild(t);X.appendChild(ua);1<na&&ja.appendChild(X);ua=document.createElement("div");ua.className="geDialogCheckRow";var Ca=document.createElement("input");Ca.setAttribute("name","pages-printdialog");Ca.setAttribute("type",1==na?"checkbox":"radio");Ca.setAttribute("id","gePrintDlgSelectionOnly");Ca.style.marginRight="8px";Z.isSelectionEmpty()&&Ca.setAttribute("disabled","disabled");+Z.isEnabled()&&(ua.appendChild(Ca),t=document.createElement("label"),t.setAttribute("for","gePrintDlgSelectionOnly"),mxUtils.write(t,mxResources.get("selectionOnly")),ua.appendChild(t));Z.isEnabled()&&(1<na?X.appendChild(ua):(t=document.createElement("div"),t.className="geDialogSection",t.appendChild(ua),ja.appendChild(t)));!l.isPagesEnabled()||l.lastPrintPagesRadioChecked?za.checked=!0:!Z.isSelectionEmpty()&&l.lastPrintSelectionOnlyChecked?Ca.checked=!0:la.checked=!0;Z=l.addAdvancedSection(ja);ja=+Z.content;X=document.createElement("div");X.className="geDialogCheckRow";var Fa=document.createElement("input");Fa.style.marginRight="8px";Fa.setAttribute("type","radio");Fa.setAttribute("name","printSize");Fa.setAttribute("id","gePrintDlgPageView");X.appendChild(Fa);t=document.createElement("label");t.setAttribute("for","gePrintDlgPageView");mxUtils.write(t,mxResources.get("pageView"));X.appendChild(t);mxEvent.addListener(X,"click",function(){Fa.checked=!0});ja.appendChild(X);X=document.createElement("div");+X.className="geDialogCheckRow";var Ha=document.createElement("input");Ha.style.marginRight="8px";Ha.setAttribute("type","radio");Ha.setAttribute("name","printSize");Ha.setAttribute("id","gePrintDlgCrop");X.appendChild(Ha);t=document.createElement("label");t.setAttribute("for","gePrintDlgCrop");mxUtils.write(t,mxResources.get("crop"));X.appendChild(t);mxEvent.addListener(X,"click",function(){Ha.checked=!0});ja.appendChild(X);X=document.createElement("div");X.className="geDialogCheckRow";X.style.alignItems=+"flex-start";var Na=document.createElement("input");Na.style.marginTop="4px";Na.setAttribute("type","radio");Na.setAttribute("name","printSize");X.appendChild(Na);ua=document.createElement("table");ua.style.display="inline-block";ua.style.borderSpacing="0";var La=document.createElement("tbody"),Da=document.createElement("tr"),Sa=Da.cloneNode(!0),Oa=document.createElement("td"),Ta=Oa.cloneNode(!0),Ua=Oa.cloneNode(!0),Ba=Oa.cloneNode(!0),Ka=Oa.cloneNode(!0),ab=Oa.cloneNode(!0);Oa.style.textAlign="right";+Ba.style.textAlign="right";mxUtils.write(Oa,mxResources.get("fitTo"));mxEvent.addListener(X,"click",function(gb){mxEvent.getSource(gb)!=Na&&(Na.checked=!Na.checked)});var Qa=document.createElement("input");Qa.style.margin="0 2px";Qa.style.boxSizing="border-box";Qa.setAttribute("value",l.lastPrintSheetsAcross||"1");Qa.setAttribute("min","1");Qa.setAttribute("type","number");Qa.style.width="40px";Ta.appendChild(Qa);t=document.createElement("span");mxUtils.write(t,mxResources.get("fitToSheetsAcross"));+Ua.appendChild(t);mxUtils.write(Ba,mxResources.get("fitToBy"));var db=Qa.cloneNode(!0);db.setAttribute("value",l.lastPrintSheetsDown||"1");Ka.appendChild(db);mxEvent.addListener(Qa,"click",function(gb){Na.checked=!0;mxEvent.consume(gb)});mxEvent.addListener(db,"click",function(gb){Na.checked=!0;mxEvent.consume(gb)});l.lastPrintCropRadioChecked?Ha.checked=!0:l.lastPrintFitRadioChecked?Na.checked=!0:Fa.checked=!0;t=document.createElement("span");mxUtils.write(t,mxResources.get("fitToSheetsDown"));ab.appendChild(t);+Da.appendChild(Oa);Da.appendChild(Ta);Da.appendChild(Ua);Sa.appendChild(Ba);Sa.appendChild(Ka);Sa.appendChild(ab);La.appendChild(Da);La.appendChild(Sa);ua.appendChild(La);X.appendChild(ua);ja.appendChild(X);ja=document.createElement("div");ja.className="geDialogSection";t=document.createElement("div");t.className="geDialogFormRow";X=document.createElement("label");X.className="geDialogFormLabel";X.setAttribute("for","gePrintDlgBorder");mxUtils.write(X,mxResources.get("borderWidth"));t.appendChild(X);+var Va=document.createElement("input");Va.setAttribute("type","number");Va.setAttribute("min","0");Va.setAttribute("id","gePrintDlgBorder");Va.style.width="40px";Va.value=null!=l.lastPrintBorder?l.lastPrintBorder:mxPrintPreview.prototype.pageMargin;t.appendChild(Va);X=document.createElement("label");X.setAttribute("for","gePrintDlgZoom");X.style.marginLeft="12px";X.style.marginRight="4px";mxUtils.write(X,mxResources.get("zoom"));t.appendChild(X);var nb=document.createElement("input");nb.setAttribute("id",+"gePrintDlgZoom");nb.style.width="60px";nb.value=null!=l.lastPrintZoom?l.lastPrintZoom:"100%";t.appendChild(nb);ja.appendChild(t);X=document.createElement("div");X.className="geDialogCheckRow";var bb=document.createElement("input");bb.setAttribute("type","checkbox");bb.setAttribute("id","gePrintDlgGrid");bb.style.marginRight="8px";bb.checked=null!=l.lastPrintGrid?l.lastPrintGrid:!1;X.appendChild(bb);t=document.createElement("label");t.setAttribute("for","gePrintDlgGrid");mxUtils.write(t,mxResources.get("grid"));+X.appendChild(t);ja.appendChild(X);X=document.createElement("div");X.className="geDialogCheckRow";var ya=document.createElement("input");ya.setAttribute("type","checkbox");ya.setAttribute("id","gePrintDlgShadows");ya.style.marginRight="8px";ya.checked=null!=l.lastPrintShadow?l.lastPrintShadow:!1;X.appendChild(ya);t=document.createElement("label");t.setAttribute("for","gePrintDlgShadows");mxUtils.write(t,mxResources.get("shadows"));X.appendChild(t);l.isOffline()&&!mxClient.IS_CHROMEAPP||X.appendChild(l.createHelpIcon("https://www.drawio.com/docs/manual/export/print-diagram/#shadows-in-print-and-pdf-export"));+Editor.enableShadowOption||(X.style.display="none");ja.appendChild(X);var Ra=document.createElement("input");Ra.setAttribute("type","checkbox");Ra.setAttribute("id","gePrintDlgTransparent");Ra.style.marginRight="8px";Ra.checked=null!=l.lastPrintTransparent?l.lastPrintTransparent:!1;null!=H&&(X=document.createElement("div"),X.className="geDialogCheckRow",X.appendChild(Ra),t=document.createElement("label"),t.setAttribute("for","gePrintDlgTransparent"),mxUtils.write(t,mxResources.get("transparentBackground")),+X.appendChild(t),ja.appendChild(X));var Ya=document.createElement("input");Ya.setAttribute("type","checkbox");Ya.setAttribute("id","gePrintDlgInclude");Ya.style.marginRight="8px";Ya.checked=null!=l.lastPrintInclude?l.lastPrintInclude:Editor.defaultIncludeDiagram;null==H||mxClient.IS_CHROMEAPP||"draw.io"!=l.getServiceName()||(X=document.createElement("div"),X.className="geDialogCheckRow",X.appendChild(Ya),t=document.createElement("label"),t.setAttribute("for","gePrintDlgInclude"),mxUtils.write(t,mxResources.get("includeCopyOfMyDiagram")),+X.appendChild(t),ja.appendChild(X));Z.wrapper.appendChild(ja);t=document.createElement("div");t.style.flex="0 0 auto";t.style.marginTop="16px";t.style.textAlign="right";t.style.whiteSpace="nowrap";l.isOffline()&&!mxClient.IS_CHROMEAPP||null!=H||t.appendChild(l.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));Z=mxUtils.button(mxResources.get("cancel"),function(){l.hideDialog()});Z.className="geBtn";l.editor.cancelFirst&&t.appendChild(Z);PrintDialog.previewEnabled&&null==H&&(ja=mxUtils.button(mxResources.get("preview"),+function(){Y(!1)}),ja.className="geBtn",t.appendChild(ja));J=null!=J?J:null!=H?"export":PrintDialog.previewEnabled?"print":"ok";J=mxUtils.button(mxResources.get(J),function(){Y(!0)});J.className="geBtn gePrimaryBtn";t.appendChild(J);l.editor.cancelFirst||t.appendChild(Z);ia.appendChild(t);if(l.editor.isChromelessView()){var lb=function(){Editor.isDarkMode()?(ia.classList.add("geDarkMode"),ia.style.colorScheme="dark"):(ia.classList.remove("geDarkMode"),ia.style.colorScheme="light")};l.addListener("darkModeChanged",+lb);lb();var ub=function(gb,jb){gb=jb.getProperty("dialog");ia.parentNode==gb.container&&(l.editor.removeListener(ub),l.removeListener(lb))};l.editor.addListener("hideDialog",ub)}this.container=ia};var ra=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var l=this.image;null!=+l&&null!=l.src&&Graph.isPageLink(l.src)&&(l={originalSrc:l.src});this.page.viewState.backgroundImage=l}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else ra.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&+(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(l=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=l?l:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.parseAnimationScript=function(l){var t=+[];if(null==l)return t;var H=function(ia){if(null!=ia)return ia=parseFloat(ia),!isNaN(ia)&&0<=ia?ia:void 0},J={fade:!0,pop:!0,wipe:!0};l=l.split("\n");for(var R=0;R<l.length;R++){var T=mxUtils.trim(l[R]);if(""!=T&&"#"!=T.charAt(0)){T=T.split(/\s+/);var Y={action:T[0],cell:T[1],arg:T[2]};if("wait"==Y.action){if(Y.delay=parseFloat(Y.cell),isNaN(Y.delay)||0>Y.delay)Y.delay=1E3}else if("setOpacity"==Y.action)Y.opacity=parseFloat(T[2]),isNaN(Y.opacity)&&(Y.opacity=1),Y.opacity=Math.max(0,Math.min(1,Y.opacity)),+Y.duration=H(T[3]),Y.arg=void 0;else if("show"==Y.action){if(null!=Y.arg&&!J[Y.arg]){var Z=H(Y.arg);null!=Z&&(Y.duration=Z,Y.arg=void 0)}null==Y.duration&&(Y.duration=H(T[3]))}else"hide"==Y.action&&(Y.duration=H(T[2]),Y.arg=void 0);t.push(Y)}}return t};Editor.animationFadeDelay=400;Editor.canBatchAnimationSteps=function(l,t){return l.action!=t.action||"wait"==l.action||(l.arg||"")!=(t.arg||"")||(null!=l.opacity?l.opacity:"")!=(null!=t.opacity?t.opacity:"")||(null!=l.duration?l.duration:"")!=(null!=+t.duration?t.duration:"")?!1:!0};Editor.convertLegacyAnimationStep=function(l){if("wait"==l.action)return{wait:l.delay};var t="all"==l.cell?"*":l.cell;if(null==t)return null;var H={cells:[t]};if(null!=l.duration)H.delay=l.duration;else if("show"==l.action&&"fade"==l.arg)H.delay=Editor.animationFadeDelay;else if("hide"==l.action||"setOpacity"==l.action)H.delay=Editor.animationFadeDelay;return"show"==l.action?"fade"==l.arg?{fadeIn:H}:"pop"==l.arg?{popIn:H}:{wipeIn:H}:"hide"==l.action?{fadeOut:H}:"setOpacity"==+l.action?(H.value=l.opacity,{fadeTo:H}):"flow"==l.action?(t={cells:[t]},"start"==l.arg?t.start=!0:"stop"==l.arg&&(t.start=!1),{flow:t}):null};Editor.convertLegacyAnimation=function(l){l=Editor.parseAnimationScript(l);for(var t=[{opacity:{cells:["*"],value:0}}],H=null,J=function(){null!=H&&(t.push(H),H=null)},R=function(Z){null==H&&(H={});for(var ia in Z){var ja=Z[ia],X;if(X=null!=H[ia]&&null!=ja&&Array.isArray(H[ia].cells)&&Array.isArray(ja.cells))X=H[ia],X=X.delay===ja.delay&&X.value===ja.value&&+X.start===ja.start;if(X)for(X=0;X<ja.cells.length;X++)H[ia].cells.push(ja.cells[X]);else null!=H[ia]&&(J(),H={}),H[ia]=ja}},T=0;T<l.length;T++){var Y=Editor.convertLegacyAnimationStep(l[T]);null!=Y&&(null!=Y.wait?(J(),t.push(Y)):R(Y))}J();return{animation:{steps:t}}};Editor.parseAnimationData=function(l){var t=function(J){null==J&&(J={});Array.isArray(J.steps)||(J.steps=[]);J.loop=null==J.loop?!0:!!J.loop;J.enabled=null==J.enabled?!0:!!J.enabled;return J};if(null==l||""===l)return t({steps:[]});if("string"==+typeof l){var H=mxUtils.trim(l);return"{"==H.charAt(0)||"["==H.charAt(0)?Editor.parseAnimationData(JSON.parse(H)):t(Editor.convertLegacyAnimation(l).animation)}return null!=l.animation&&null!=l.animation.steps?t(l.animation):Array.isArray(l.steps)?t(l):t({steps:[]})};Editor.AnimationPlayer=function(l,t){this.graph=l;this.data=Editor.parseAnimationData(t);this.cancelled=this.running=!1;this.snapshot=null};Editor.ANIMATION_ALL="*";Editor.collectAnimatableCells=function(l){var t=[],H;for(H in l.cells){var J=+l.cells[H];(l.isVertex(J)||l.isEdge(J))&&t.push(J)}return t};Editor.AnimationPlayer.prototype.collectReferencedCells=function(){for(var l=this.data.steps||[],t={},H=[],J=0;J<l.length;J++){var R=l[J],T;for(T in R)if("wait"!=T&&"open"!=T){var Y=R[T];if("object"===typeof Y&&null!=Y){Y=this.graph.getCellsForAction(Y,!0);for(var Z=0;Z<Y.length;Z++)t[Y[Z].id]||(t[Y[Z].id]=!0,H.push(Y[Z]))}}}return H};Editor.AnimationPlayer.prototype.snapshotOpacity=function(){var l=this.collectReferencedCells();l=this.graph.getNodesForCells(l);+this.snapshot=[];for(var t=0;t<l.length;t++)this.snapshot.push({node:l[t],opacity:l[t].style.opacity})};Editor.AnimationPlayer.prototype.restoreOpacity=function(){if(null!=this.snapshot){for(var l=0;l<this.snapshot.length;l++)Graph.setTransitionForNodes([this.snapshot[l].node],null),this.snapshot[l].node.style.opacity=this.snapshot[l].opacity;this.snapshot=null}};Editor.AnimationPlayer.prototype.play=function(l){if(!this.running&&null!=this.graph&&!this.graph.isGraphTornDown()){l=l||{};this.running=+!0;this.cancelled=!1;this.graph.stoppingCustomActions=!1;this.graph.view.validate();var t=this,H=this.data.steps||[],J=function(T,Y){if(null==t.graph||t.graph.isGraphTornDown())t.running=!1;else if(t.cancelled||T>=H.length)Y();else{for(var Z=T+1;Z<H.length&&!0===H[Z].immediate&&!t.cancelled;)Z++;if("function"==typeof l.onStep)try{l.onStep(T,Z)}catch(ia){}t.graph.executeCustomActions(Graph.flattenAnimationActions(H.slice(T,Z)),function(){J(Z,Y)},null)}},R=function(){null==t.graph||t.graph.isGraphTornDown()?+t.running=!1:t.cancelled?(t.restoreOpacity(),t.running=!1):(t.snapshotOpacity(),J(0,function(){if(t.cancelled)t.restoreOpacity(),t.running=!1;else{if("function"==typeof l.onStep)try{l.onStep(-1)}catch(T){}l.loop?(t.graph.refresh(),t.restoreOpacity(),window.setTimeout(R,0)):(t.running=!1,t.restoreOpacity(),null!=l.done&&l.done())}}))};l.defer?window.setTimeout(R,0):R()}};Editor.AnimationPlayer.prototype.stop=function(){this.cancelled=!0;null!=this.graph&&(this.graph.stoppingCustomActions=!0);for(var l=+[],t=this.collectReferencedCells(),H=0;H<t.length;H++)this.graph.getModel().isEdge(t[H])&&l.push(t[H]);0<l.length&&Editor.toggleFlowAnimation(this.graph,l,"stop")};Editor.toggleFlowAnimation=function(l,t,H){H=H||"toggle";for(var J=0;J<t.length;J++)if(l.getModel().isEdge(t[J])){var R=l.view.getState(t[J]);if(null!=R&&null!=R.shape){var T=null!=R.shape.getFlowAnimationPath?R.shape.getFlowAnimationPath():null;if(null!=T){var Y="mxEdgeFlow"==T.getAttribute("class"),Z="start"==H||"toggle"==H&&!Y;Y="stop"==+H||"toggle"==H&&Y;R="1"==mxUtils.getValue(R.style,mxConstants.STYLE_DASHED,"0");Y?(T.removeAttribute("class"),R||T.removeAttribute("stroke-dasharray")):Z&&(T.setAttribute("class","mxEdgeFlow"),R||T.setAttribute("stroke-dasharray","8"))}}}};Editor.playAnimationOnGraph=function(l,t){var H=l.getModel().getRoot(),J=null;null!=H.value&&"object"==typeof H.value&&(J=H.value.getAttribute("animation"));if(null==J||""==J)return null;try{var R=Editor.parseAnimationData(J)}catch(Y){return null}if(!R.steps||0==+R.steps.length||!1===R.enabled)return null;H={};if(null!=t)for(var T in t)H[T]=t[T];null==H.loop&&(H.loop=R.loop);null==H.defer&&(H.defer=!0);l=new Editor.AnimationPlayer(l,R);l.play(H);return l};Editor.installAnimationStyles=function(){if(!Editor.animationStylesInstalled){Editor.animationStylesInstalled=!0;try{var l=document.createElement("style");l.type="text/css";l.appendChild(document.createTextNode(".mxEdgeFlow { animation: mxEdgeFlow 0.5s linear infinite; }@keyframes mxEdgeFlow { to { stroke-dashoffset: -16; } }"));+document.getElementsByTagName("head")[0].appendChild(l)}catch(t){}}};Editor.installAnimationStyles()})();(function(){EditorUi.VERSION="30.3.14";EditorUi.CSV_ELK_LAYOUTS={verticalflow:{layout:"elkLayered",config:{"elk.direction":"DOWN","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},horizontalflow:{layout:"elkLayered",config:{"elk.direction":"RIGHT","elk.layered.layering.strategy":"LONGEST_PATH","elk.layered.nodePlacement.bk.fixedAlignment":"BALANCED","elk.edgeRouting":"POLYLINE",edgeStyle:"elkCompat",includeEdgeLabels:!1,includeVertexLabels:!1,portSpread:!0,resizeNodes:!1}},elkRadial:{layout:"elkRadial",config:{edgeStyle:"elkCompat"}},elkOrganic:{layout:"elkOrganic",config:{edgeStyle:"elkCompat"}},elkStress:{layout:"elkStress",config:{edgeStyle:"elkCompat"}}};EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)||/.*\.cdn\.prod\.atlassian-dev\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&"1"!=urlParams.extAuth&&"showSaveFilePicker"in window&&"showOpenFilePicker"inwindow;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://www.drawio.com/doc/faq/scratchpad";EditorUi.enableHtmlEditOption=!0;EditorUi.isMermaidSupported=function(){return window.isMermaidEnabled&&"undefined"!==typeof mxMermaidToDrawio&&"function"===typeof mxMermaidToDrawio.parseText};EditorUi.isNativePlantUmlSupported=function(){return"undefined"!==typeof mxPlantUmlToDrawio&&"function"===typeof mxPlantUmlToDrawio.parseText};EditorUi.defaultMermaidConfig={};EditorUi.legacyMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},gantt:{useWidth:1E3,useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,-axisFormat:"%Y-%m-%d"}};EditorUi.mermaidImageBorder=10;EditorUi.logError=function(c,f,k,q,x,B,E){if(null!=c){x=null!=x?x:Error(c);x.stack=null!=x.stack?x.stack:"";B=null!=B?B:0>c.indexOf("NetworkError")&&0>c.indexOf("SecurityError")&&0>c.indexOf("NS_ERROR_FAILURE")&&0>c.indexOf("out of memory")?"SEVERE":"CONFIG";try{EditorUi.enableLogging&&"1"!=urlParams.dev&&c!=EditorUi.lastErrorMessage&&0>c.indexOf("extension:")&&0>c.indexOf("ResizeObserver loop completed with undelivered notifications")&&0>x.stack.indexOf("extension:")&&-0>x.stack.indexOf("<anonymous>:")&&0>x.stack.indexOf("/math4/es5/")&&0>x.stack.indexOf("blob:")&&(0>c.indexOf("strict mode")||0>x.stack.indexOf("extensions.min.js"))&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+B+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(k)+(null!=q?":colno:"+encodeURIComponent(q):"")+(""!=-x.stack?"&stack="+encodeURIComponent(x.stack):""))}catch(L){}try{E||null==window.console||console.error(B,c,f,k,q,x)}catch(L){}}};EditorUi.logEvent=function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=f+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(k){}};EditorUi.sendReport=function(c,f){if("1"==urlParams.dev)EditorUi.debug("sendReport",+axisFormat:"%Y-%m-%d"}};EditorUi.mermaidImageBorder=10;EditorUi.logError=function(c,f,k,q,x,C,E){if(null!=c){x=null!=x?x:Error(c);x.stack=null!=x.stack?x.stack:"";C=null!=C?C:0>c.indexOf("NetworkError")&&0>c.indexOf("SecurityError")&&0>c.indexOf("NS_ERROR_FAILURE")&&0>c.indexOf("out of memory")?"SEVERE":"CONFIG";try{EditorUi.enableLogging&&"1"!=urlParams.dev&&c!=EditorUi.lastErrorMessage&&0>c.indexOf("extension:")&&0>c.indexOf("ResizeObserver loop completed with undelivered notifications")&&0>x.stack.indexOf("extension:")&&+0>x.stack.indexOf("<anonymous>:")&&0>x.stack.indexOf("/math4/es5/")&&0>x.stack.indexOf("blob:")&&(0>c.indexOf("strict mode")||0>x.stack.indexOf("extensions.min.js"))&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+C+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(k)+(null!=q?":colno:"+encodeURIComponent(q):"")+(""!=+x.stack?"&stack="+encodeURIComponent(x.stack):""))}catch(L){}try{E||null==window.console||console.error(C,c,f,k,q,x)}catch(L){}}};EditorUi.logEvent=function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=f+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(k){}};EditorUi.sendReport=function(c,f){if("1"==urlParams.dev)EditorUi.debug("sendReport",c);else if(EditorUi.enableLogging)try{f=null!=f?f:5E4,c.length>f&&(c=c.substring(0,f)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(c))}catch(k){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var c=[(new Date).toISOString()],f=0;f<arguments.length;f++)c.push(arguments[f]);mxClient.IS_IOS?(mxLog.show(),mxLog.debug(c.join(" "))):console.log.apply(console,c)}}catch(k){}};EditorUi.removeChildNodes=function(c){for(;null!=c.firstChild;)c.removeChild(c.firstChild)};EditorUi.embedSvgImages=function(c){c=c.getElementsByTagName("image");for(var f=[],k=0;k<c.length;k++)f.push(c[k]);for(k=0;k<f.length;k++)EditorUi.replaceSvgImage(f[k])};EditorUi.replaceSvgImage=function(c){try{var f=null;f=null==c.getAttributeNS?c.getAttribute("xlink:href"):c.getAttributeNS(mxConstants.NS_XLINK,"href");var k=EditorUi.getSvgSubtree(f);if(null!=k&&"svg"==k.nodeName){var q=k.getAttribute("width"),-x=k.getAttribute("height");c.hasAttribute("x")&&k.setAttribute("x",c.getAttribute("x"));c.hasAttribute("y")&&k.setAttribute("y",c.getAttribute("y"));k.setAttribute("width",c.getAttribute("width"));k.setAttribute("height",c.getAttribute("height"));k.style.fontFamily="initial";null!=c.getAttribute("preserveAspectRatio")&&k.setAttribute("preserveAspectRatio",c.getAttribute("preserveAspectRatio"));0<q&&0<x&&null==k.getAttribute("viewBox")&&k.setAttribute("viewBox","0 0 "+q+" "+x);var B=mxUtils.createElementNs(k.ownerDocument,-mxConstants.NS_SVG,"g");B.appendChild(k);c.hasAttribute("id")&&B.setAttribute("id",c.getAttribute("id"));c.hasAttribute("transform")&&B.setAttribute("transform",c.getAttribute("transform"));c.hasAttribute("opacity")&&B.setAttribute("opacity",c.getAttribute("opacity"));c.parentNode.replaceChild(B,c)}}catch(E){}};EditorUi.getSvgSubtree=function(c){var f=Graph.getSvgFromDataUri(c);c=null;if(null!=f){c=Graph.sanitizeNode(mxUtils.parseXml(f).documentElement);f=c.getElementsByTagName("style");if(0<f.length){var k=-"svg-image-"+Editor.guid();c.setAttribute("id",k);for(var q=document.implementation.createHTMLDocument(""),x=document.createElement("style"),B=0;B<f.length;B++){x.textContent=f[B].textContent;q.body.appendChild(x);for(var E="",L=0;L<x.sheet.cssRules.length;L++){var Q=x.sheet.cssRules[L];if(null!=Q.selectorText){for(var V=Q.selectorText.split(","),K=0;K<V.length;K++)V[K]="#"+k+" "+V[K];Q.selectorText=V.join(",")}E+=Q.cssText+"\n"}f[B].textContent=E}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&+x=k.getAttribute("height");c.hasAttribute("x")&&k.setAttribute("x",c.getAttribute("x"));c.hasAttribute("y")&&k.setAttribute("y",c.getAttribute("y"));k.setAttribute("width",c.getAttribute("width"));k.setAttribute("height",c.getAttribute("height"));k.style.fontFamily="initial";null!=c.getAttribute("preserveAspectRatio")&&k.setAttribute("preserveAspectRatio",c.getAttribute("preserveAspectRatio"));0<q&&0<x&&null==k.getAttribute("viewBox")&&k.setAttribute("viewBox","0 0 "+q+" "+x);var C=mxUtils.createElementNs(k.ownerDocument,+mxConstants.NS_SVG,"g");C.appendChild(k);c.hasAttribute("id")&&C.setAttribute("id",c.getAttribute("id"));c.hasAttribute("transform")&&C.setAttribute("transform",c.getAttribute("transform"));c.hasAttribute("opacity")&&C.setAttribute("opacity",c.getAttribute("opacity"));c.parentNode.replaceChild(C,c)}}catch(E){}};EditorUi.getSvgSubtree=function(c){var f=Graph.getSvgFromDataUri(c);c=null;if(null!=f){c=Graph.sanitizeNode(mxUtils.parseXml(f).documentElement);f=c.getElementsByTagName("style");if(0<f.length){var k=+"svg-image-"+Editor.guid();c.setAttribute("id",k);for(var q=document.implementation.createHTMLDocument(""),x=document.createElement("style"),C=0;C<f.length;C++){x.textContent=f[C].textContent;q.body.appendChild(x);for(var E="",L=0;L<x.sheet.cssRules.length;L++){var Q=x.sheet.cssRules[L];if(null!=Q.selectorText){for(var V=Q.selectorText.split(","),K=0;K<V.length;K++)V[K]="#"+k+" "+V[K];Q.selectorText=V.join(",")}E+=Q.cssText+"\n"}f[C].textContent=E}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&c.style.removeProperty("color-scheme");f=c.getElementsByTagName("*");for(k=0;k<f.length;k++)f[k].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.isDiagramDataEmpty=function(c){if(null==c||0==c.length||c==this.emptyDiagramXml)return!0;try{var f=mxUtils.parseXml(c).documentElement;c=function(L){return null==-L||2>=L.getElementsByTagName("mxCell").length};if("mxGraphModel"==f.nodeName)return c(f);if("mxfile"==f.nodeName){var k=f.getElementsByTagName("diagram");if(0==k.length)return!0;for(f=0;f<k.length;f++){var q=k[f].getElementsByTagName("mxGraphModel");if(0<q.length){if(!c(q[0]))return!1}else{var x=mxUtils.getNodeValue(k[f]);if(null!=x&&0<x.length){var B=Graph.decompress(x);if(null!=B&&0<B.length){var E=mxUtils.parseXml(B);if(!c(E.documentElement))return!1}}}}return!0}}catch(L){}return!1};EditorUi.prototype.mode=+L||2>=L.getElementsByTagName("mxCell").length};if("mxGraphModel"==f.nodeName)return c(f);if("mxfile"==f.nodeName){var k=f.getElementsByTagName("diagram");if(0==k.length)return!0;for(f=0;f<k.length;f++){var q=k[f].getElementsByTagName("mxGraphModel");if(0<q.length){if(!c(q[0]))return!1}else{var x=mxUtils.getNodeValue(k[f]);if(null!=x&&0<x.length){var C=Graph.decompress(x);if(null!=C&&0<C.length){var E=mxUtils.parseXml(C);if(!c(E.documentElement))return!1}}}}return!0}}catch(L){}return!1};EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=1200;EditorUi.prototype.maxTextWidth=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=2E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.maxTextBytes=5E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.sidebarEnabled="0"!=urlParams.sidebar;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;EditorUi.prototype.embedMessageSource=null;EditorUi.prototype.defaultCompact=!1;EditorUi.prototype.noAutoFocus=!1;EditorUi.prototype.embedExportBorder=8;EditorUi.prototype.embedExportTheme="auto";EditorUi.prototype.embedExportBackground=null;EditorUi.prototype.shareCursorPosition=!0;EditorUi.prototype.showRemoteCursors=!0;EditorUi.prototype.createButtonContainer=function(){var c=document.createElement("div");c.className="geButtonContainer";return c};EditorUi.prototype.openLink=function(c,f,k){return this.editor.graph.openLink(c,@@ -3974,93 +3977,93 @@ f,k)};EditorUi.prototype.showSplash=function(c){};EditorUi.prototype.getLocalDatEditorUi.prototype.isShareCursorPosition=function(){return this.shareCursorPosition};EditorUi.prototype.setShowRemoteCursors=function(c){this.showRemoteCursors=c;this.fireEvent(new mxEventObject("showRemoteCursorsChanged"))};EditorUi.prototype.isShowRemoteCursors=function(){return this.showRemoteCursors};EditorUi.prototype.setMathEnabled=function(c){var f=this.editor.graph;f.mathEnabled=c;null!=f.view.backgroundImage&&(f.view.backgroundImage.destroy(),f.view.backgroundImage=null);this.editor.updateGraphComponents();f.refresh();f.defaultMathEnabled=c;this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(c){return this.editor.graph.mathEnabled};EditorUi.prototype.setAdaptiveColors=function(c){this.editor.graph.setAdaptiveColors(c);this.editor.graph.view.clear();this.fireEvent(new mxEventObject("adaptiveColorsChanged"))};EditorUi.prototype.isStandaloneApp=function(){return mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(c){return this.isOfflineApp()||!navigator.onLine&&!EditorUi.isElectronApp||!c&&("1"==urlParams.stealth||"1"==urlParams.lockdown)};EditorUi.prototype.isExternalDataComms=function(){return"1"!=urlParams.offline&&!this.isOffline()&&!this.isOfflineApp()};EditorUi.prototype.createSpinner=function(c,f,k){var q=null==c||null==f;k=null!=k?k:24;var x=new Spinner({lines:12,length:k,width:Math.round(k/3),radius:Math.round(k/2),rotate:0,-color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),B=this.timeout,E=x.spin,L=null,Q=null,V=mxUtils.bind(this,function(aa){null!=aa&&aa()}),K=this;x.spin=function(aa,da,ba,ha){ha=null!=ha?ha:B;var qa=!1;if(!this.active){var ra=Date.now();null!=ba&&(L=window.setTimeout(function(){x.stop();L=null;ba({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:Q})},ha));q&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,+color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),C=this.timeout,E=x.spin,L=null,Q=null,V=mxUtils.bind(this,function(aa){null!=aa&&aa()}),K=this;x.spin=function(aa,da,ba,ha){ha=null!=ha?ha:C;var qa=!1;if(!this.active){var ra=Date.now();null!=ba&&(L=window.setTimeout(function(){x.stop();L=null;ba({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:Q})},ha));q&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/2-2);aa==document.body&&"1"==urlParams.embedInline&&(aa=K.diagramContainer,c=aa.scrollLeft+aa.clientWidth/2,f=aa.scrollTop+aa.clientHeight/2);E.call(this,aa);"1"==urlParams.embedInline&&null!=x.el&&(x.el.style.marginTop=aa.scrollTop+"px",x.el.style.marginLeft=aa.scrollLeft+"px");this.active=!0;null!=da&&(qa=document.createElement("div"),qa.className="geSpinnerStatus",qa.setAttribute("title",da),aa==document.body?(qa.style.left=Math.max(0,c)+"px",qa.style.top=Math.max(0,f+66)+"px"):(qa.style.left="50%",qa.style.top="50%",qa.style.marginTop="70px"),"..."!=da.substring(da.length-3,da.length)&&"!"!=da.charAt(da.length-1)&&(da+="..."),qa.innerText=da,aa.appendChild(qa),x.status=qa);this.pause=mxUtils.bind(this,function(){var l=V;this.active&&(ha=Math.max(0,ha-(Date.now()-ra)),l=mxUtils.bind(this,function(t){this.spin(aa,da,ba,ha);if(null!=t)try{t(),Q=mxUtils.bind(this,function(){this.spin(aa,da,ba,ha);try{t()}catch(H){null!=ba&&ba(H)}})}catch(H){null!=ba&&ba(H)}}));this.stop();return l});qa=!0}return qa};var fa=x.stop;x.stop=function(){fa.call(this);this.active&&(this.active=!1,null!=L&&(window.clearTimeout(L),L=null),null!=x.status&&null!=x.status.parentNode&&x.status.parentNode.removeChild(x.status),x.status=null)};x.pause=function(){return V};return x};EditorUi.prototype.isCompatibleString=function(c){try{if(c=mxUtils.trim(c),"<"==c.charAt(0)){var f=mxUtils.parseXml(c),k=this.editor.extractGraphModel(f.documentElement,!0);return null!=k&&0==k.getElementsByTagName("parsererror").length}}catch(q){}return!1};EditorUi.isVisioFilename=function(c){return/(\.v(dx|sdx?))($|\?)/i.test(c)||/(\.vs(x|sx?))($|\?)/i.test(c)};EditorUi.prototype.isVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&4==c.charCodeAt(3)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&6==c.charCodeAt(3))};EditorUi.prototype.isRemoteVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||60==c.charCodeAt(0)&&63==c.charCodeAt(1)&&120==c.charCodeAt(2)&&109==c.charCodeAt(3)&&108==c.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=function(c){var f=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var k=-f.getFunction,q=this.editor.graph,x=this;f.getFunction=function(B){if(q.isSelectionEmpty()&&null!=x.pages&&0<x.pages.length){var E=x.getSelectedPageIndex();if(mxEvent.isShiftDown(B)){if(37==B.keyCode)return function(){0<E&&x.movePage(E,E-1)};if(38==B.keyCode)return function(){0<E&&x.movePage(E,0)};if(39==B.keyCode)return function(){E<x.pages.length-1&&x.movePage(E,E+1)};if(40==B.keyCode)return function(){E<x.pages.length-1&&x.movePage(E,x.pages.length-1)}}else if(mxEvent.isControlDown(B)||mxClient.IS_MAC&&-mxEvent.isMetaDown(B)){if(37==B.keyCode)return function(){0<E&&x.selectNextPage(!1)};if(38==B.keyCode)return function(){0<E&&x.selectPage(x.pages[0])};if(39==B.keyCode)return function(){E<x.pages.length-1&&x.selectNextPage(!0)};if(40==B.keyCode)return function(){E<x.pages.length-1&&x.selectPage(x.pages[x.pages.length-1])}}}return!(65<=B.keyCode&&90>=B.keyCode)||q.isSelectionEmpty()||mxEvent.isAltDown(B)||mxEvent.isShiftDown(B)||mxEvent.isControlDown(B)||mxClient.IS_MAC&&mxEvent.isMetaDown(B)?k.apply(this,-arguments):null}}return f};var d=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var f=d.apply(this,arguments);if(null==f)try{var k=c.indexOf("<mxfile ");if(0<=k){var q=c.lastIndexOf("</mxfile>");q>k&&(f=c.substring(k,q+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var x=mxUtils.parseXml(c),B=this.editor.extractGraphModel(x.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);-f=null!=B?mxUtils.getXml(B):""}}catch(E){}return f};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var f=c.indexOf('<meta charset="utf-8">');0<=f&&(c=c.slice(0,f)+'<meta charset="utf-8"/>'+c.slice(f+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.repairFileData=function(c){c=mxUtils.trim(c||"");if(0==c.length)return null;var f=c.replace(/<\/([A-Za-z_][\w.\-]*)(\s*)(?=<)/g,"</$1>$2"),k=f.lastIndexOf(">");f.lastIndexOf("<")>k&&(f=mxUtils.trim(f.substring(0,+f.getFunction,q=this.editor.graph,x=this;f.getFunction=function(C){if(q.isSelectionEmpty()&&null!=x.pages&&0<x.pages.length){var E=x.getSelectedPageIndex();if(mxEvent.isShiftDown(C)){if(37==C.keyCode)return function(){0<E&&x.movePage(E,E-1)};if(38==C.keyCode)return function(){0<E&&x.movePage(E,0)};if(39==C.keyCode)return function(){E<x.pages.length-1&&x.movePage(E,E+1)};if(40==C.keyCode)return function(){E<x.pages.length-1&&x.movePage(E,x.pages.length-1)}}else if(mxEvent.isControlDown(C)||mxClient.IS_MAC&&+mxEvent.isMetaDown(C)){if(37==C.keyCode)return function(){0<E&&x.selectNextPage(!1)};if(38==C.keyCode)return function(){0<E&&x.selectPage(x.pages[0])};if(39==C.keyCode)return function(){E<x.pages.length-1&&x.selectNextPage(!0)};if(40==C.keyCode)return function(){E<x.pages.length-1&&x.selectPage(x.pages[x.pages.length-1])}}}return!(65<=C.keyCode&&90>=C.keyCode)||q.isSelectionEmpty()||mxEvent.isAltDown(C)||mxEvent.isShiftDown(C)||mxEvent.isControlDown(C)||mxClient.IS_MAC&&mxEvent.isMetaDown(C)?k.apply(this,+arguments):null}}return f};var d=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var f=d.apply(this,arguments);if(null==f)try{var k=c.indexOf("<mxfile ");if(0<=k){var q=c.lastIndexOf("</mxfile>");q>k&&(f=c.substring(k,q+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var x=mxUtils.parseXml(c),C=this.editor.extractGraphModel(x.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);+f=null!=C?mxUtils.getXml(C):""}}catch(E){}return f};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var f=c.indexOf('<meta charset="utf-8">');0<=f&&(c=c.slice(0,f)+'<meta charset="utf-8"/>'+c.slice(f+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.repairFileData=function(c){c=mxUtils.trim(c||"");if(0==c.length)return null;var f=c.replace(/<\/([A-Za-z_][\w.\-]*)(\s*)(?=<)/g,"</$1>$2"),k=f.lastIndexOf(">");f.lastIndexOf("<")>k&&(f=mxUtils.trim(f.substring(0,k+1)));if("</mxfile>"!=f.substring(f.length-9)){k=[];for(var q=/<(\/?)([A-Za-z_][\w.\-]*)[^>]*?(\/?)>/g,x;null!=(x=q.exec(f));)"/"==x[1]?0<k.length&&k[k.length-1]==x[2]&&k.pop():"/"!=x[3]&&k.push(x[2]);for(q=k.length-1;0<=q;q--)f+="</"+k[q]+">"}return f!=c?f:null};EditorUi.prototype.isFileDataLoadable=function(c){try{c=this.validateFileData(c);var f=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;if(null==f||null!=Editor.extractParserError(f))return!1;var k=this.editor.extractGraphModel(f,-!0);return null!=(null!=k?k:f)}catch(q){return!1}};EditorUi.prototype.getRecoveryData=function(c,f,k,q){var x=null;try{var B=this.repairFileData(f);null!=B&&B!=f&&this.isFileDataLoadable(B)&&(x={type:"repair",label:mxResources.get("openRepairedCopy"),description:mxResources.get("recoveryRepairedDesc"),data:B,lossy:!0})}catch(L){}var E=mxUtils.bind(this,function(L){var Q=[];null!=L&&null!=L.data&&Q.push(L);null!=x&&Q.push(x);q(Q)});null!=c&&"function"===typeof c.getRecoveryVersion?c.getRecoveryVersion(mxUtils.bind(this,+!0);return null!=(null!=k?k:f)}catch(q){return!1}};EditorUi.prototype.getRecoveryData=function(c,f,k,q){var x=null;try{var C=this.repairFileData(f);null!=C&&C!=f&&this.isFileDataLoadable(C)&&(x={type:"repair",label:mxResources.get("openRepairedCopy"),description:mxResources.get("recoveryRepairedDesc"),data:C,lossy:!0})}catch(L){}var E=mxUtils.bind(this,function(L){var Q=[];null!=L&&null!=L.data&&Q.push(L);null!=x&&Q.push(x);q(Q)});null!=c&&"function"===typeof c.getRecoveryVersion?c.getRecoveryVersion(mxUtils.bind(this,function(L){E(L)}),mxUtils.bind(this,function(){E(null)})):E(null)};EditorUi.prototype.openRecoveredCopy=function(c,f){c=new LocalFile(this,c.data,mxResources.get("copyOf",[f||this.defaultFilename]),!0);this.fileLoaded(c)&&c.fileChanged()};EditorUi.prototype.showRecoveryDialog=function(c,f){c=new RecoveryDialog(this,c,mxUtils.bind(this,function(k){this.hideDialog();this.openRecoveredCopy(k,f)}),mxUtils.bind(this,function(){this.hideDialog()}));this.showDialog(c.container,380,null,!0,!0)};EditorUi.prototype.formatRecoveryDate=function(c){c=new Date(c);return!isNaN(c.getTime())&&0<=c.getTime()?c.toLocaleString():null};EditorUi.prototype.replaceFileData=function(c,f){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",f);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var k=null!=c?this.editor.extractGraphModel(c,!0):null;null!=k&&(c=k);if(null!=c){k=this.editor.graph;k.model.beginUpdate();try{var q=null!=this.pages?this.pages.slice():null,x=c.getElementsByTagName("diagram");-if(1<x.length||1==x.length&&x[0].hasAttribute("name")){this.fileNode=c;k.defaultExportLinkTarget=c.getAttribute("linkTarget");this.pages=null!=this.pages?this.pages:[];for(var B=x.length-1;0<=B;B--){var E=this.updatePageRoot(new DiagramPage(x[B]));null==E.getName()&&E.setName(mxResources.get("pageWithNumber",[B+1]));k.model.execute(new ChangePage(this,E,0==B?E:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),-this.currentPage.setName(mxResources.get("pageWithNumber",[1])),k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=q)for(B=0;B<q.length;B++)k.model.execute(new ChangePage(this,q[B],null));var L=this.getCurrentFile();null!=L&&L.fileReplaced(f)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=-function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa){f=null!=f?f:this.editor.graph;x=null!=x?x:!1;Q=null!=Q?Q:!0;V=null!=V?V:this.defaultCompact;K=null!=K?K:!Editor.defaultCompressed;var da=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var ba="_blank";else da=ba=q;if(null==c)return"";var ha=c;if("mxfile"!=ha.nodeName.toLowerCase()){if(K){var qa=c.ownerDocument.createElement("diagram");qa.setAttribute("name",mxResources.get("pageWithNumber",[1]));qa.setAttribute("id",Editor.guid());+if(1<x.length||1==x.length&&x[0].hasAttribute("name")){this.fileNode=c;k.defaultExportLinkTarget=c.getAttribute("linkTarget");this.pages=null!=this.pages?this.pages:[];for(var C=x.length-1;0<=C;C--){var E=this.updatePageRoot(new DiagramPage(x[C]));null==E.getName()&&E.setName(mxResources.get("pageWithNumber",[C+1]));k.model.execute(new ChangePage(this,E,0==C?E:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),+this.currentPage.setName(mxResources.get("pageWithNumber",[1])),k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=q)for(C=0;C<q.length;C++)k.model.execute(new ChangePage(this,q[C],null));var L=this.getCurrentFile();null!=L&&L.fileReplaced(f)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=+function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa){f=null!=f?f:this.editor.graph;x=null!=x?x:!1;Q=null!=Q?Q:!0;V=null!=V?V:this.defaultCompact;K=null!=K?K:!Editor.defaultCompressed;var da=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var ba="_blank";else da=ba=q;if(null==c)return"";var ha=c;if("mxfile"!=ha.nodeName.toLowerCase()){if(K){var qa=c.ownerDocument.createElement("diagram");qa.setAttribute("name",mxResources.get("pageWithNumber",[1]));qa.setAttribute("id",Editor.guid());qa.appendChild(c)}else{qa=Graph.zapGremlins(mxUtils.getXml(c));ha=Graph.compress(qa);if(Graph.decompress(ha)!=qa)return qa;qa=c.ownerDocument.createElement("diagram");qa.setAttribute("name",mxResources.get("pageWithNumber",[1]));qa.setAttribute("id",Editor.guid());mxUtils.setTextContent(qa,ha)}ha=c.ownerDocument.createElement("mxfile");ha.appendChild(qa)}V?(ha=ha.cloneNode(!0),ha.removeAttribute("modified"),ha.removeAttribute("host"),ha.removeAttribute("agent"),ha.removeAttribute("etag"),ha.removeAttribute("userAgent"),ha.removeAttribute("version"),ha.removeAttribute("editor"),ha.removeAttribute("type")):(ha.removeAttribute("userAgent"),ha.removeAttribute("modified"),ha.removeAttribute("version"),ha.removeAttribute("editor"),ha.removeAttribute("pages"),ha.removeAttribute("type"),ha.removeAttribute("etag"),mxClient.IS_CHROMEAPP?ha.setAttribute("host","Chrome"):EditorUi.isElectronApp?ha.setAttribute("host","Electron"):ha.setAttribute("host",window.location.hostname),1<ha.getElementsByTagName("diagram").length&&null!=-this.pages&&ha.setAttribute("pages",this.pages.length));null!=fa&&(ha=ha.cloneNode(!0),ha.setAttribute("scale",fa));null!=aa&&(ha=ha.cloneNode(!0),ha.setAttribute("border",aa));c=K?mxUtils.getPrettyXml(ha):mxUtils.getXml(ha);if(!B&&!x&&(E||null!=k&&/(\.html)$/i.test(k.getTitle())))c=this.getHtml2(mxUtils.getXml(ha),f,null!=k?k.getTitle():null,ba,da);else if(B||!x&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(q=null),k=this.getSvgFileProperties(ha),-c=this.getEmbeddedSvg(c,f,q,null,L,Q,da,null,null,k.scale,k.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,f,k,q){c=null!=c?c:!0;f=null!=f?f:!1;k=null!=k?k:!Editor.defaultCompressed;var x=this.editor.getGraphXml(c,q);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(Q){var V=Q.getElementsByTagName("mxGraphModel"),K=0<V.length?V[0]:null;V=Q;null==K&&k?(K=mxUtils.getNodeValue(Q),0<K.length&&(K=Graph.decompress(K),null!=K&&0<K.length&&(V=Q.cloneNode(!1),-V.appendChild(mxUtils.parseXml(K).documentElement)))):null==K||k?V=Q.cloneNode(!0):(V=Q.cloneNode(!1),mxUtils.setTextContent(V,Graph.compressNode(K)));x.appendChild(V)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(x),x=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var B=this.pages[f],E=B.node;if(B!=this.currentPage)if(B.needsUpdate){var L=new mxCodec(mxUtils.createXmlDocument());L=L.encode(new mxGraphModel(B.root));-this.editor.graph.saveViewState(B.viewState,L,null,q);EditorUi.removeChildNodes(E);E.appendChild(L);delete B.needsUpdate}else q&&(this.updatePageRoot(B),null!=B.viewState.backgroundImage&&null!=B.viewState.backgroundImage.originalSrc&&(L=new mxCodec(mxUtils.createXmlDocument()),L=L.encode(new mxGraphModel(B.root)),this.editor.graph.saveViewState(B.viewState,L,null,q,B),E=E.cloneNode(!1),E.appendChild(L)));c(E)}return x};EditorUi.prototype.anonymizeString=function(c,f){for(var k=[],q=0;q<c.length;q++){var x=-c.charAt(q);0<=EditorUi.ignoredAnonymizedChars.indexOf(x)?k.push(x):isNaN(parseInt(x))?x.toLowerCase()!=x?k.push(String.fromCharCode(65+Math.round(25*Math.random()))):x.toUpperCase()!=x?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(x)?k.push(" "):k.push("?"):k.push(f?"0":Math.round(9*Math.random()))}return k.join("")};EditorUi.prototype.anonymizeXml=function(c){function f(E,L,Q){if(E.hasAttribute(L)){var V=E.getAttribute(L);null!=V&&0<V.length&&(Q&&0<=V.indexOf("<")?(B.innerHTML=-Graph.sanitizeHtml(V),k(B),V=B.innerHTML):V=x.anonymizeString(V),E.setAttribute(L,V))}}function k(E){null!=E.nodeValue&&(E.nodeValue=x.anonymizeString(E.nodeValue));if(E.nodeType==mxConstants.NODETYPE_ELEMENT)for(E=E.firstChild;null!=E;)k(E),E=E.nextSibling}function q(E){if(E.nodeType==mxConstants.NODETYPE_ELEMENT){if("mxCell"==E.nodeName)f(E,"value",!0);else if("object"==E.nodeName||"UserObject"==E.nodeName)for(var L=0;L<E.attributes.length;L++){var Q=E.attributes[L];"id"!=Q.name&&"style"!=Q.name&&-"placeholders"!=Q.name&&"vertex"!=Q.name&&"edge"!=Q.name&&"parent"!=Q.name&&"connectable"!=Q.name&&"visible"!=Q.name&&"collapsed"!=Q.name&&"source"!=Q.name&&"target"!=Q.name&&(Q.value=x.anonymizeString(Q.value))}else"diagram"==E.nodeName&&f(E,"name",!1);for(E=E.firstChild;null!=E;)q(E),E=E.nextSibling}}var x=this,B=document.createElement("div");c=mxUtils.parseXml(c);q(c.documentElement);return mxUtils.getPrettyXml(c.documentElement)};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);-if(null!=c[EditorUi.DIFF_INSERT])for(var f=0;f<c[EditorUi.DIFF_INSERT].length;f++)try{var k=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][f].data).documentElement.cloneNode(!1);null!=k.getAttribute("name")&&k.setAttribute("name",this.anonymizeString(k.getAttribute("name")));c[EditorUi.DIFF_INSERT][f].data=mxUtils.getXml(k)}catch(B){c[EditorUi.DIFF_INSERT][f].data=B.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var q in c[EditorUi.DIFF_UPDATE]){var x=c[EditorUi.DIFF_UPDATE][q];null!=x.name&&(x.name=this.anonymizeString(x.name));-null!=x.cells&&(f=mxUtils.bind(this,function(B){var E=x.cells[B];if(null!=E){for(var L in E)null!=E[L].value&&(E[L].value="["+E[L].value.length+"]"),null!=E[L].xmlValue&&(E[L].xmlValue="["+E[L].xmlValue.length+"]"),null!=E[L].style&&(E[L].style="["+E[L].style.length+"]"),mxUtils.isEmptyObject(E[L])&&delete E[L];mxUtils.isEmptyObject(E)&&delete x.cells[B]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(x.cells)&&delete x.cells);mxUtils.isEmptyObject(x)&&delete c[EditorUi.DIFF_UPDATE][q]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&+this.pages&&ha.setAttribute("pages",this.pages.length));null!=fa&&(ha=ha.cloneNode(!0),ha.setAttribute("scale",fa));null!=aa&&(ha=ha.cloneNode(!0),ha.setAttribute("border",aa));c=K?mxUtils.getPrettyXml(ha):mxUtils.getXml(ha);if(!C&&!x&&(E||null!=k&&/(\.html)$/i.test(k.getTitle())))c=this.getHtml2(mxUtils.getXml(ha),f,null!=k?k.getTitle():null,ba,da);else if(C||!x&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(q=null),k=this.getSvgFileProperties(ha),+c=this.getEmbeddedSvg(c,f,q,null,L,Q,da,null,null,k.scale,k.border,null,Editor.svgFileTheme,null,k.embedFonts);return c};EditorUi.prototype.getXmlFileData=function(c,f,k,q){c=null!=c?c:!0;f=null!=f?f:!1;k=null!=k?k:!Editor.defaultCompressed;var x=this.editor.getGraphXml(c,q);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(Q){var V=Q.getElementsByTagName("mxGraphModel"),K=0<V.length?V[0]:null;V=Q;null==K&&k?(K=mxUtils.getNodeValue(Q),0<K.length&&(K=Graph.decompress(K),null!=K&&0<K.length&&+(V=Q.cloneNode(!1),V.appendChild(mxUtils.parseXml(K).documentElement)))):null==K||k?V=Q.cloneNode(!0):(V=Q.cloneNode(!1),mxUtils.setTextContent(V,Graph.compressNode(K)));x.appendChild(V)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(x),x=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var C=this.pages[f],E=C.node;if(C!=this.currentPage)if(C.needsUpdate){var L=new mxCodec(mxUtils.createXmlDocument());L=L.encode(new mxGraphModel(C.root));+this.editor.graph.saveViewState(C.viewState,L,null,q);EditorUi.removeChildNodes(E);E.appendChild(L);delete C.needsUpdate}else q&&(this.updatePageRoot(C),null!=C.viewState.backgroundImage&&null!=C.viewState.backgroundImage.originalSrc&&(L=new mxCodec(mxUtils.createXmlDocument()),L=L.encode(new mxGraphModel(C.root)),this.editor.graph.saveViewState(C.viewState,L,null,q,C),E=E.cloneNode(!1),E.appendChild(L)));c(E)}return x};EditorUi.prototype.anonymizeString=function(c,f){for(var k=[],q=0;q<c.length;q++){var x=+c.charAt(q);0<=EditorUi.ignoredAnonymizedChars.indexOf(x)?k.push(x):isNaN(parseInt(x))?x.toLowerCase()!=x?k.push(String.fromCharCode(65+Math.round(25*Math.random()))):x.toUpperCase()!=x?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(x)?k.push(" "):k.push("?"):k.push(f?"0":Math.round(9*Math.random()))}return k.join("")};EditorUi.prototype.anonymizeXml=function(c){function f(E,L,Q){if(E.hasAttribute(L)){var V=E.getAttribute(L);null!=V&&0<V.length&&(Q&&0<=V.indexOf("<")?(C.innerHTML=+Graph.sanitizeHtml(V),k(C),V=C.innerHTML):V=x.anonymizeString(V),E.setAttribute(L,V))}}function k(E){null!=E.nodeValue&&(E.nodeValue=x.anonymizeString(E.nodeValue));if(E.nodeType==mxConstants.NODETYPE_ELEMENT)for(E=E.firstChild;null!=E;)k(E),E=E.nextSibling}function q(E){if(E.nodeType==mxConstants.NODETYPE_ELEMENT){if("mxCell"==E.nodeName)f(E,"value",!0);else if("object"==E.nodeName||"UserObject"==E.nodeName)for(var L=0;L<E.attributes.length;L++){var Q=E.attributes[L];"id"!=Q.name&&"style"!=Q.name&&+"placeholders"!=Q.name&&"vertex"!=Q.name&&"edge"!=Q.name&&"parent"!=Q.name&&"connectable"!=Q.name&&"visible"!=Q.name&&"collapsed"!=Q.name&&"source"!=Q.name&&"target"!=Q.name&&(Q.value=x.anonymizeString(Q.value))}else"diagram"==E.nodeName&&f(E,"name",!1);for(E=E.firstChild;null!=E;)q(E),E=E.nextSibling}}var x=this,C=document.createElement("div");c=mxUtils.parseXml(c);q(c.documentElement);return mxUtils.getPrettyXml(c.documentElement)};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);+if(null!=c[EditorUi.DIFF_INSERT])for(var f=0;f<c[EditorUi.DIFF_INSERT].length;f++)try{var k=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][f].data).documentElement.cloneNode(!1);null!=k.getAttribute("name")&&k.setAttribute("name",this.anonymizeString(k.getAttribute("name")));c[EditorUi.DIFF_INSERT][f].data=mxUtils.getXml(k)}catch(C){c[EditorUi.DIFF_INSERT][f].data=C.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var q in c[EditorUi.DIFF_UPDATE]){var x=c[EditorUi.DIFF_UPDATE][q];null!=x.name&&(x.name=this.anonymizeString(x.name));+null!=x.cells&&(f=mxUtils.bind(this,function(C){var E=x.cells[C];if(null!=E){for(var L in E)null!=E[L].value&&(E[L].value="["+E[L].value.length+"]"),null!=E[L].xmlValue&&(E[L].xmlValue="["+E[L].xmlValue.length+"]"),null!=E[L].style&&(E[L].style="["+E[L].style.length+"]"),mxUtils.isEmptyObject(E[L])&&delete E[L];mxUtils.isEmptyObject(E)&&delete x.cells[C]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(x.cells)&&delete x.cells);mxUtils.isEmptyObject(x)&&delete c[EditorUi.DIFF_UPDATE][q]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,f){if(null!=c.attributes)for(var k=0;k<c.attributes.length;k++)"as"!=c.attributes[k].name&&c.setAttribute(c.attributes[k].name,this.anonymizeString(c.attributes[k].value,f));if(null!=c.childNodes)for(k=0;k<c.childNodes.length;k++)this.anonymizeAttributes(c.childNodes[k],f)};EditorUi.prototype.anonymizeNode=function(c,f){f=c.getElementsByTagName("mxCell");for(var k=0;k<f.length;k++)null!=f[k].getAttribute("value")&&f[k].setAttribute("value","["+f[k].getAttribute("value").length+"]"),null!=f[k].getAttribute("xmlValue")&&f[k].setAttribute("xmlValue","["+f[k].getAttribute("xmlValue").length+"]"),null!=f[k].getAttribute("style")&&f[k].setAttribute("style","["+f[k].getAttribute("style").length+"]"),null!=f[k].parentNode&&"root"!=f[k].parentNode.nodeName&&null!=f[k].parentNode.parentNode&&(f[k].setAttribute("id",f[k].parentNode.getAttribute("id")),f[k].parentNode.parentNode.replaceChild(f[k],f[k].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var f=this.getCurrentFile();null!=f&&(f.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&f.invalidChecksum?f.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(f.clearAutosave(),this.clearStatus(),c?f.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){this.spinner.stop();f.handleFileError(k,!0)})):-f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){f.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa){x=null!=x?x:!0;B=null!=B?B:!1;V=null!=V?V:!Editor.defaultCompressed;var da=this.editor.graph;if((f||!c&&null!=Q&&/(\.svg)$/i.test(Q.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var ba=da.getGlobalVariable;da=this.createTemporaryGraph(da.getStylesheet());da.setBackgroundImage=+f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){f.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa){x=null!=x?x:!0;C=null!=C?C:!1;V=null!=V?V:!Editor.defaultCompressed;var da=this.editor.graph;if((f||!c&&null!=Q&&/(\.svg)$/i.test(Q.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var ba=da.getGlobalVariable;da=this.createTemporaryGraph(da.getStylesheet());da.setBackgroundImage=this.editor.graph.setBackgroundImage;da.background=this.editor.graph.background;var ha=null!=this.pages?this.pages[0]:null;null==ha||this.currentPage==ha?da.setBackgroundImage(this.editor.graph.backgroundImage):null!=ha.viewState&&null!=ha.viewState&&da.setBackgroundImage(ha.viewState.backgroundImage);da.getGlobalVariable=function(qa){return"page"==qa&&null!=ha?ha.getName():"pagenumber"==qa?1:ba.apply(this,arguments)};document.body.appendChild(da.container);null!=ha&&da.model.setRoot(ha.root)}E=null!=-E?E:this.getXmlFileData(x,B,V,K);Q=null!=Q?Q:this.getCurrentFile();c=this.createFileData(E,da,Q,window.location.href,c,f,k,q,x,L,V,fa,aa);da!=this.editor.graph&&da.container.parentNode.removeChild(da.container);return c};EditorUi.prototype.getHtml=function(c,f,k,q,x,B){B=null!=B?B:!0;var E=null,L=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){E=B?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var Q=f.view.scale;B=Math.floor(E.x/Q-f.view.translate.x);Q=Math.floor(E.y/Q-f.view.translate.y);-E=f.background;null==x&&(f=this.getBasenames().join(";"),0<f.length&&(L=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",B);c.setAttribute("y0",Q)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=q&&c.setAttribute("edit",q));null!=x&&(x=x.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";q=Graph.compress(c);Graph.decompress(q)!=c&&(q=encodeURIComponent(c));+E?E:this.getXmlFileData(x,C,V,K);Q=null!=Q?Q:this.getCurrentFile();c=this.createFileData(E,da,Q,window.location.href,c,f,k,q,x,L,V,fa,aa);da!=this.editor.graph&&da.container.parentNode.removeChild(da.container);return c};EditorUi.prototype.getHtml=function(c,f,k,q,x,C){C=null!=C?C:!0;var E=null,L=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=f){E=C?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var Q=f.view.scale;C=Math.floor(E.x/Q-f.view.translate.x);Q=Math.floor(E.y/Q-f.view.translate.y);+E=f.background;null==x&&(f=this.getBasenames().join(";"),0<f.length&&(L=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",C);c.setAttribute("y0",Q)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=q&&c.setAttribute("edit",q));null!=x&&(x=x.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";q=Graph.compress(c);Graph.decompress(q)!=c&&(q=encodeURIComponent(c));return(null==x?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=x?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==x?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=x?'<meta http-equiv="refresh" content="0;URL=\''+x+"'\"/>\n":"")+"</head>\n<body"+(null==x&&null!=E&&E!=mxConstants.NONE?' style="background-color:'+E+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+q+"</div>\n</div>\n"+(null==x?'<script type="text/javascript" src="'+L+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+x+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,f,k,q,x){f=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=x&&(x=x.replace(/&/g,"&"));c={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(c),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==x?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=x?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==x?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=x?'<meta http-equiv="refresh" content="0;URL=\''+x+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>\n'+(null==x?'<script type="text/javascript" src="'+f+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+x+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.updateFileVars=function(){var c=null!=this.fileNode?this.fileNode.getAttribute("vars"):null;if(c!==this.fileVarsStr&&(this.fileVarsStr=c,this.fileVars=null,null!=c&&0<c.length))try{this.fileVars=JSON.parse(c)}catch(f){}};EditorUi.prototype.setFileData=function(c,f){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;f=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var k=Editor.extractParserError(f,mxResources.get("invalidOrMissingFile"));if(k)throw EditorUi.debug("EditorUi.setFileData ParserError",-[this],"data",[c],"node",[f],"cause",[k]),Error(mxResources.get("notADiagramFile")+" ("+k+")");c=null!=f?this.editor.extractGraphModel(f,!0):null;null!=c&&(f=c);if(null!=f&&"mxfile"==f.nodeName&&(c=f.getElementsByTagName("diagram"),k={},0<c.length)){var q=this.getHashObject(),x=null;this.fileNode=f;this.editor.graph.defaultExportLinkTarget=f.getAttribute("linkTarget");this.pages=[];for(var B=0;B<c.length;B++){null==c[B].getAttribute("id")&&c[B].setAttribute("id",B);f=new DiagramPage(c[B]);null==f.getName()&&-f.setName(mxResources.get("pageWithNumber",[B+1]));this.pages.push(f);if(null==q.pageId&&null!=urlParams["page-id"]&&f.getId()==urlParams["page-id"]||null!=q.pageId&&f.getId()==q.pageId)x=f;if(null==k[f.getId()])k[f.getId()]=f;else throw Error(f.getId()+": Duplicate page ID");}this.currentPage=null!=x?x:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];f=this.currentPage.node}null==this.fileNode&&null!=f&&(this.fileNode=f.ownerDocument.createElement("mxfile"),this.currentPage=-new DiagramPage(f.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(f);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var E=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(B=0;B<E.length;B++)f[E[B]]=!0;var L=this.editor.graph.getModel(),Q=L.getChildren(L.root);-for(B=0;B<Q.length;B++){var V=Q[B];L.setVisible(V,f[V.id]||!1)}}catch(K){}};EditorUi.prototype.fileStats=function(c,f){try{if(null!=c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var k=f.getElementsByTagName("diagram");f={};f.modified=c.getLastModifiedDate();f.fileMode=c.getMode();f.fileSize=c.getSize();f.fileHash=c.getHash();f.pages=k.length;f.redundantStencils=0;f.redundantImages=0;f.redundantSize=0;f.stencils=0;f.images=0;for(var q=f.cells=0;q<k.length;q++){var x=k[q].getElementsByTagName("mxCell");-f.cells+=x.length;for(var B={},E=0;E<x.length;E++){var L=x[E].getAttribute("style");if(null!=L)for(var Q=L.split(";"),V=0;V<Q.length;V++){var K=Q[V];if(K.startsWith("image=data:")||K.startsWith("shape=stencil("))null==B[K]?B[K]=1:B[K]++}}for(var fa in B){var aa=B[fa];fa.startsWith("shape=stencil(")?f.stencils+=aa:f.images+=aa;1<aa&&(f.redundantSize+=fa.length*(aa-1),fa.startsWith("shape=stencil(")?f.redundantStencils+=aa-1:f.redundantImages+=aa-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()++[this],"data",[c],"node",[f],"cause",[k]),Error(mxResources.get("notADiagramFile")+" ("+k+")");c=null!=f?this.editor.extractGraphModel(f,!0):null;null!=c&&(f=c);if(null!=f&&"mxfile"==f.nodeName&&(c=f.getElementsByTagName("diagram"),k={},0<c.length)){var q=this.getHashObject(),x=null;this.fileNode=f;this.editor.graph.defaultExportLinkTarget=f.getAttribute("linkTarget");this.pages=[];for(var C=0;C<c.length;C++){null==c[C].getAttribute("id")&&c[C].setAttribute("id",C);f=new DiagramPage(c[C]);null==f.getName()&&+f.setName(mxResources.get("pageWithNumber",[C+1]));this.pages.push(f);if(null==q.pageId&&null!=urlParams["page-id"]&&f.getId()==urlParams["page-id"]||null!=q.pageId&&f.getId()==q.pageId)x=f;if(null==k[f.getId()])k[f.getId()]=f;else throw Error(f.getId()+": Duplicate page ID");}this.currentPage=null!=x?x:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];f=this.currentPage.node}null==this.fileNode&&null!=f&&(this.fileNode=f.ownerDocument.createElement("mxfile"),this.currentPage=+new DiagramPage(f.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(f);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var E=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(C=0;C<E.length;C++)f[E[C]]=!0;var L=this.editor.graph.getModel(),Q=L.getChildren(L.root);+for(C=0;C<Q.length;C++){var V=Q[C];L.setVisible(V,f[V.id]||!1)}}catch(K){}};EditorUi.prototype.fileStats=function(c,f){try{if(null!=c&&5E5<c.getSize()&&""!==c.getHash()&&"draw.io"==this.getServiceName()){var k=f.getElementsByTagName("diagram");f={};f.modified=c.getLastModifiedDate();f.fileMode=c.getMode();f.fileSize=c.getSize();f.fileHash=c.getHash();f.pages=k.length;f.redundantStencils=0;f.redundantImages=0;f.redundantSize=0;f.stencils=0;f.images=0;for(var q=f.cells=0;q<k.length;q++){var x=k[q].getElementsByTagName("mxCell");+f.cells+=x.length;for(var C={},E=0;E<x.length;E++){var L=x[E].getAttribute("style");if(null!=L)for(var Q=L.split(";"),V=0;V<Q.length;V++){var K=Q[V];if(K.startsWith("image=data:")||K.startsWith("shape=stencil("))null==C[K]?C[K]=1:C[K]++}}for(var fa in C){var aa=C[fa];fa.startsWith("shape=stencil(")?f.stencils+=aa:f.images+=aa;1<aa&&(f.redundantSize+=fa.length*(aa-1),fa.startsWith("shape=stencil(")?f.redundantStencils+=aa-1:f.redundantImages+=aa-1)}}EditorUi.logEvent({category:c.getMode().toUpperCase()+"-FILE-STATS-"+c.getHash(),action:"size_"+c.getSize(),label:JSON.stringify(f)})}}catch(da){}};EditorUi.prototype.getBaseFilename=function(c){var f=this.getCurrentFile();f=null!=f&&null!=f.getTitle()?f.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(f)||/(\.html)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.png)$/i.test(f))f=f.substring(0,f.lastIndexOf("."));/(\.drawio)$/i.test(f)&&(f=f.substring(0,f.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&-0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba,ha,qa){try{q=null!=q?q:this.editor.graph.isSelectionEmpty();var ra=this.getBaseFilename(!x),l=ra+("xml"==c||"pdf"==c&&K?".drawio":"")+"."+c;if("xml"==c){var t=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,q,x,null,null,null,f);this.saveData(l,c,t,"text/xml")}else if("html"==c)t=this.getHtml2(this.getFileData(!0),this.editor.graph,-ra),this.saveData(l,c,t,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?l=ra+".png":"jpeg"==c&&(l=ra+".jpg"),"1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){var H=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(l,c,q,"1",E,x,L,Q,V,K,fa,void 0,void 0,!B,aa,da,ba,ha,qa).send(mxUtils.bind(this,function(Z){this.spinner.stop();+0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba,ha,qa){try{q=null!=q?q:this.editor.graph.isSelectionEmpty();var ra=this.getBaseFilename(!x),l=ra+("xml"==c||"pdf"==c&&K?".drawio":"")+"."+c;if("xml"==c){var t=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,q,x,null,null,null,f);this.saveData(l,c,t,"text/xml")}else if("html"==c)t=this.getHtml2(this.getFileData(!0),this.editor.graph,+ra),this.saveData(l,c,t,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))if("xmlpng"==c?l=ra+".png":"jpeg"==c&&(l=ra+".jpg"),"1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){var H=this.embedMessageSource||window.opener||window.parent;this.spinner.spin(document.body,mxResources.get("exporting"))&&this.createDownloadRequest(l,c,q,"1",E,x,L,Q,V,K,fa,void 0,void 0,!C,aa,da,ba,ha,qa).send(mxUtils.bind(this,function(Z){this.spinner.stop();if(200<=Z.getStatus()&&299>=Z.getStatus()){var ia=this.createLoadMessage("export");ia.format=c;ia.filename=l;ia.data="data:application/pdf;base64,"+Z.getText();ia.xml=this.getFileData(!0);H.postMessage(JSON.stringify(ia),"*")}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(){this.spinner.stop();this.handleError({message:mxResources.get("errorSavingFile")})}))}else this.saveRequest(l,c,mxUtils.bind(this,function(Z,ia){try{return this.createDownloadRequest(Z,-c,q,ia,E,x,L,Q,V,K,fa,void 0,void 0,!B,aa,da,ba,ha,qa)}catch(ka){this.handleError(ka)}}));else{var J=null,R=mxUtils.bind(this,function(Z){Z.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",Z,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(J)}))});if("svg"==c){var T=this.editor.graph.background;if(E||T==mxConstants.NONE)T=null;var Y=this.editor.graph.getSvg(T,null,null,null,null,q);k&&this.editor.graph.addSvgShadow(Y);-this.editor.convertImages(Y,mxUtils.bind(this,mxUtils.bind(this,function(Z){this.spinner.stop();R(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(Z))})))}else l=ra+".svg",J=this.getFileData(!1,!0,null,mxUtils.bind(this,function(Z){this.spinner.stop();R(Z)}),q)}}catch(Z){this.handleError(Z)}};EditorUi.prototype.createDownloadRequest=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba,ha,qa,ra,l){c=this.downloadRequestBuilder(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba,ha,qa,ra,l);f="";for(var t in c)k=-c[t],null!=k&&(f+=t+"="+encodeURIComponent(k)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba,ha,qa,ra,l){var t=this.editor.graph,H=t.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==B?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var J=null,R=null,T=null;if(!EditorUi.isElectronApp&&(H.width*H.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};V=-V?"1":"0";"pdf"==f&&(null!=K?(J=K.from,R=K.to):0==B&&(T="1"));"xmlpng"==f&&(V="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(B=0;B<this.pages.length;B++)if(this.pages[B]==this.currentPage){J=B;break}B=t.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!x?x||null!=B&&B!=mxConstants.NONE||(B="#ffffff"):B=mxConstants.NONE;x={globalVars:t.getExportVariables()};null!=K&&null!=K.from&&(x.globalVars.pagenumber=K.from+1);Q&&(x.grid={size:t.gridSize,steps:t.view.gridSteps,color:Editor.isDarkMode()&&-"pdf"==f?mxGraphView.prototype.defaultGridColor:t.view.gridColor});Graph.translateDiagram&&(x.diagramLanguage=Graph.diagramLanguage);Q=this.getHiddenTagsMap();null!=Q&&(x.hiddenTags=Q);return{format:f,from:J,to:R,allPages:T,bg:null!=B?B:mxConstants.NONE,base64:q,embedXml:V,xml:k,filename:null!=c?c:"",extras:JSON.stringify(x),scale:E,border:L,pageMargin:ba,w:fa&&isFinite(fa)?fa:null,h:aa&&isFinite(aa)?aa:null,crop:null!=da&&da?"1":"0",fit:null!=ha&&ha?"1":"0",shadows:null!=l&&l?"1":"0",sheetsAcross:qa,-sheetsDown:ra}};EditorUi.prototype.getHiddenTagsMap=function(){var c=this.editor.graph,f={},k=!1;if(null!=this.pages)for(var q=0;q<this.pages.length;q++){var x=this.pages[q],B=x==this.currentPage?c.hiddenTags:null!=x.viewState?x.viewState.hiddenTags:null;null!=B&&0<B.length&&(f[x.getId()]=B,k=!0)}else null!=c.hiddenTags&&0<c.hiddenTags.length&&(f[0]=c.hiddenTags,k=!0);return k?f:null};EditorUi.prototype.setMode=function(c,f){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=window.location.hash;+c,q,ia,E,x,L,Q,V,K,fa,void 0,void 0,!C,aa,da,ba,ha,qa)}catch(ja){this.handleError(ja)}}));else{var J=null,R=mxUtils.bind(this,function(Z){Z.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",Z,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(J)}))});if("svg"==c){var T=this.editor.graph.background;if(E||T==mxConstants.NONE)T=null;var Y=this.editor.graph.getSvg(T,null,null,null,null,q);k&&this.editor.graph.addSvgShadow(Y);+this.editor.convertImages(Y,mxUtils.bind(this,mxUtils.bind(this,function(Z){this.spinner.stop();R(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(Z))})))}else l=ra+".svg",J=this.getFileData(!1,!0,null,mxUtils.bind(this,function(Z){this.spinner.stop();R(Z)}),q)}}catch(Z){this.handleError(Z)}};EditorUi.prototype.createDownloadRequest=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba,ha,qa,ra,l){c=this.downloadRequestBuilder(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba,ha,qa,ra,l);f="";for(var t in c)k=+c[t],null!=k&&(f+=t+"="+encodeURIComponent(k)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba,ha,qa,ra,l){var t=this.editor.graph,H=t.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==C?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var J=null,R=null,T=null;if(!EditorUi.isElectronApp&&(H.width*H.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};V=+V?"1":"0";"pdf"==f&&(null!=K?(J=K.from,R=K.to):0==C&&(T="1"));"xmlpng"==f&&(V="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(C=0;C<this.pages.length;C++)if(this.pages[C]==this.currentPage){J=C;break}C=t.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!x?x||null!=C&&C!=mxConstants.NONE||(C="#ffffff"):C=mxConstants.NONE;x={globalVars:t.getExportVariables()};null!=K&&null!=K.from&&(x.globalVars.pagenumber=K.from+1);Q&&(x.grid={size:t.gridSize,steps:t.view.gridSteps,color:Editor.isDarkMode()&&+"pdf"==f?mxGraphView.prototype.defaultGridColor:t.view.gridColor});Graph.translateDiagram&&(x.diagramLanguage=Graph.diagramLanguage);Q=this.getHiddenTagsMap();null!=Q&&(x.hiddenTags=Q);return{format:f,from:J,to:R,allPages:T,bg:null!=C?C:mxConstants.NONE,base64:q,embedXml:V,xml:k,filename:null!=c?c:"",extras:JSON.stringify(x),scale:E,border:L,pageMargin:ba,w:fa&&isFinite(fa)?fa:null,h:aa&&isFinite(aa)?aa:null,crop:null!=da&&da?"1":"0",fit:null!=ha&&ha?"1":"0",shadows:null!=l&&l?"1":"0",sheetsAcross:qa,+sheetsDown:ra}};EditorUi.prototype.getHiddenTagsMap=function(){var c=this.editor.graph,f={},k=!1;if(null!=this.pages)for(var q=0;q<this.pages.length;q++){var x=this.pages[q],C=x==this.currentPage?c.hiddenTags:null!=x.viewState?x.viewState.hiddenTags:null;null!=C&&0<C.length&&(f[x.getId()]=C,k=!0)}else null!=c.hiddenTags&&0<c.hiddenTags.length&&(f[0]=c.hiddenTags,k=!0);return k?f:null};EditorUi.prototype.setMode=function(c,f){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=window.location.hash;null!=c&&0<c.length&&(c=c.substring(1));if(null!=c&&1<c.length){var f=c.indexOf("#");0<=f&&(c=c.substring(0,f))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,f={};if(null!=c&&0<c.length){var k=c.lastIndexOf("#");if(0<k){c=decodeURIComponent(c.substring(k+1));try{f=JSON.parse(c)}catch(q){}}}return f};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var c=this.getHashObject();c.pageId=this.currentPage.getId();this.setHashObject(c)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(c){if(Editor.enableHashObjects){var f=window.location.hash;if(null==f||""==f)f="#";var k=f.lastIndexOf("#");0<k&&(f=f.substring(0,k));try{null==c||mxUtils.isEmptyObject(c)||(f=f+"#"+encodeURIComponent(JSON.stringify(c)))}catch(q){}0<k&&0<f.lastIndexOf("#")?window.location.hash=f:window.location.replace(f)}};EditorUi.prototype.loadDescriptor=function(c,f,k){var q=window.location.hash,x=mxUtils.bind(this,function(E){var L=null!=c.data?c.data:"";null!=E&&0<E.length&&(0<L.length&&(L+="\n"),L+=E);E=new LocalFile(this,"csv"!=c.format&&0<L.length?L:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);E.getHash=function(){return q};this.fileLoaded(E);"csv"==c.format&&this.importCsv(L,mxUtils.bind(this,function(aa){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var Q=null!=c.interval?parseInt(c.interval):6E4,V=null,K=mxUtils.bind(this,function(){var aa=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(da){aa===this.currentPage&&(200<=da.getStatus()&&300>=da.getStatus()?(this.updateDiagram(da.getText()),fa()):this.handleError({message:mxResources.get("error")+" "+da.getStatus()}))}),mxUtils.bind(this,function(da){this.handleError(da)}))}),fa=mxUtils.bind(this,function(){window.clearTimeout(V);-V=window.setTimeout(K,Q)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){fa();K()}));fa();K()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var B=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(B,mxUtils.bind(this,function(E){x(E)}),mxUtils.bind(this,function(E){null!=k&&k(E)}))}else x("")};EditorUi.prototype.updateDiagram=function(c){function f(t){var H=new mxCellOverlay(t.image||x.warningImage,t.tooltip,t.align,t.valign,t.offset);H.addListener(mxEvent.CLICK,function(J,-R){q.alert(t.tooltip)});return H}var k=null,q=this;if(null!=c&&0<c.length&&(k=mxUtils.parseXml(c),c=null!=k?k.documentElement:null,null!=c&&"updates"==c.nodeName)){var x=this.editor.graph,B=x.getModel();B.beginUpdate();var E=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var L=B.getCell(c.getAttribute("id"));if(null!=L){try{var Q=c.getAttribute("value");if(null!=Q){var V=mxUtils.parseXml(Q).documentElement;if(null!=V)if("1"==V.getAttribute("replace-value"))B.setValue(L,V);else for(var K=+V=window.setTimeout(K,Q)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){fa();K()}));fa();K()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var C=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(C,mxUtils.bind(this,function(E){x(E)}),mxUtils.bind(this,function(E){null!=k&&k(E)}))}else x("")};EditorUi.prototype.updateDiagram=function(c){function f(t){var H=new mxCellOverlay(t.image||x.warningImage,t.tooltip,t.align,t.valign,t.offset);H.addListener(mxEvent.CLICK,function(J,+R){q.alert(t.tooltip)});return H}var k=null,q=this;if(null!=c&&0<c.length&&(k=mxUtils.parseXml(c),c=null!=k?k.documentElement:null,null!=c&&"updates"==c.nodeName)){var x=this.editor.graph,C=x.getModel();C.beginUpdate();var E=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var L=C.getCell(c.getAttribute("id"));if(null!=L){try{var Q=c.getAttribute("value");if(null!=Q){var V=mxUtils.parseXml(Q).documentElement;if(null!=V)if("1"==V.getAttribute("replace-value"))C.setValue(L,V);else for(var K=V.attributes,fa=0;fa<K.length;fa++)x.setAttributeForCell(L,K[fa].nodeName,0<K[fa].nodeValue.length?K[fa].nodeValue:null)}}catch(t){null!=window.console&&console.log("Error in value for "+L.id+": "+t)}try{var aa=c.getAttribute("style");null!=aa&&x.model.setStyle(L,aa)}catch(t){null!=window.console&&console.log("Error in style for "+L.id+": "+t)}try{var da=c.getAttribute("icon");if(null!=da){var ba=0<da.length?JSON.parse(da):null;null!=ba&&ba.append||x.removeCellOverlays(L);null!=ba&&x.addCellOverlay(L,f(ba))}}catch(t){null!=window.console&&console.log("Error in icon for "+L.id+": "+t)}try{var ha=c.getAttribute("geometry");if(null!=ha){ha=JSON.parse(ha);var qa=x.getCellGeometry(L);if(null!=qa){qa=qa.clone();for(key in ha){var ra=parseFloat(ha[key]);"dx"==key?qa.x+=ra:"dy"==key?qa.y+=ra:"dw"==key?qa.width+=ra:"dh"==key?qa.height+=ra:qa[key]=parseFloat(ha[key])}x.model.setGeometry(L,qa)}}}catch(t){null!=window.console&&console.log("Error in icon for "+L.id+": "+t)}}}else if("model"==c.nodeName){for(var l=-c.firstChild;null!=l&&l.nodeType!=mxConstants.NODETYPE_ELEMENT;)l=l.nextSibling;null!=l&&(new mxCodec(c.firstChild)).decode(l,B)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(x.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))x.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(E=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{B.endUpdate()}null!=-E&&this.chromelessResize&&this.chromelessResize(!0,E)}return k};EditorUi.prototype.getCopyFilename=function(c,f){var k=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var q=k.lastIndexOf(".");0<=q&&(c=k.substring(q),k=k.substring(0,q));if(f){f=k;var x=new Date;k=x.getFullYear();q=x.getMonth()+1;var B=x.getDate(),E=x.getHours(),L=x.getMinutes();x=x.getSeconds();k=f+(" "+(k+"-"+q+"-"+B+"-"+E+"-"+L+"-"+x))}return k=mxResources.get("copyOf",[k])+c};EditorUi.prototype.logIfModified=-function(c,f){try{null!=c&&f&&EditorUi.debug("File.closed",[c])}catch(k){}};EditorUi.prototype.fileLoaded=function(c,f,k){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[c],"noDialogs",[f]);var q=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var x=!1;this.hideDialog();null!=q&&(q.removeListener(this.descriptorChangedListener),this.logIfModified(q,!0),q.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var B=mxUtils.bind(this,+c.firstChild;null!=l&&l.nodeType!=mxConstants.NODETYPE_ELEMENT;)l=l.nextSibling;null!=l&&(new mxCodec(c.firstChild)).decode(l,C)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(x.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))x.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(E=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{C.endUpdate()}null!=+E&&this.chromelessResize&&this.chromelessResize(!0,E)}return k};EditorUi.prototype.getCopyFilename=function(c,f){var k=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var q=k.lastIndexOf(".");0<=q&&(c=k.substring(q),k=k.substring(0,q));if(f){f=k;var x=new Date;k=x.getFullYear();q=x.getMonth()+1;var C=x.getDate(),E=x.getHours(),L=x.getMinutes();x=x.getSeconds();k=f+(" "+(k+"-"+q+"-"+C+"-"+E+"-"+L+"-"+x))}return k=mxResources.get("copyOf",[k])+c};EditorUi.prototype.logIfModified=+function(c,f){try{null!=c&&f&&EditorUi.debug("File.closed",[c])}catch(k){}};EditorUi.prototype.fileLoaded=function(c,f,k){EditorUi.debug("EditorUi.fileLoaded",[this],"file",[c],"noDialogs",[f]);var q=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var x=!1;this.hideDialog();null!=q&&(q.removeListener(this.descriptorChangedListener),this.logIfModified(q,!0),q.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var C=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=q&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!f&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fname.innerText="");this.clearStatus();this.updateUi();if(!f)if("0"!=urlParams.splash)this.showSplash();else try{this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}catch(fa){this.handleError(fa)}});if(null!=c)try{this.openingFile=!0;this.setCurrentFile(c);c.addListener("descriptorChanged",this.descriptorChangedListener);c.addListener("contentChanged",this.descriptorChangedListener);c.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(c.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();c.isEditable()?c.isModified()?c.addUnsavedStatus():this.clearStatus():this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus('<div class="geStatusBox" title="'+mxUtils.htmlEntities(mxResources.get("readOnly"))+'">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</div>")}));!this.editor.isChromelessView()||this.editor.editable?(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers(),this.restoreLibraries(),window.self===window.top||this.noAutoFocus||window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=-k&&k();this.editor.fireEvent(new mxEventObject("fileLoaded"));x=!0;if(Editor.embedSvgFonts&&/(\.svg)$/i.test(c.getTitle()))try{this.editor.loadFonts(),this.editor.embedExtFonts(function(){})}catch(fa){}if(!this.isOffline()&&null!=c.getMode()){var E="1"==urlParams.sketch?"sketch":uiTheme;if(null==E)E="default";else if("sketch"==E||"min"==E)E+=Editor.isDarkMode()?"-dark":"-light";EditorUi.logEvent({category:c.getMode().toUpperCase()+"-OPEN-FILE-"+c.getHash(),action:"size_"+c.getSize(),label:"autosave_"+-(this.editor.autosave?"on":"off")+"_theme_"+E})}EditorUi.debug("File.opened",[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(fa){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(fa){}}catch(fa){this.fileLoadedError=fa;k=null;var L=this.defaultFilename;-if(null!=c){try{k=c.getData(),L=c.getTitle()||this.defaultFilename}catch(aa){}try{c.close()}catch(aa){}}var Q=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=q?this.fileLoaded(q)||B():B()});if(f)Q();else{fa.dialogWidth=350;var V=mxUtils.bind(this,function(){this.handleError(fa,mxResources.get("errorLoadingFile"),Q,!0,null,null,!0)});if(null!=fa.fallbackFileData)fa.alternateAction=+k&&k();this.editor.fireEvent(new mxEventObject("fileLoaded"));x=!0;if(/(\.svg)$/i.test(c.getTitle())&&this.getSvgFileProperties(this.fileNode).embedFonts)try{this.editor.loadFonts(),this.editor.embedExtFonts(function(){})}catch(fa){}if(!this.isOffline()&&null!=c.getMode()){var E="1"==urlParams.sketch?"sketch":uiTheme;if(null==E)E="default";else if("sketch"==E||"min"==E)E+=Editor.isDarkMode()?"-dark":"-light";EditorUi.logEvent({category:c.getMode().toUpperCase()+"-OPEN-FILE-"+c.getHash(),action:"size_"++c.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")+"_theme_"+E})}EditorUi.debug("File.opened",[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(fa){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(fa){}}catch(fa){this.fileLoadedError=fa;k=null;+var L=this.defaultFilename;if(null!=c){try{k=c.getData(),L=c.getTitle()||this.defaultFilename}catch(aa){}try{c.close()}catch(aa){}}var Q=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=q?this.fileLoaded(q)||C():C()});if(f)Q();else{fa.dialogWidth=350;var V=mxUtils.bind(this,function(){this.handleError(fa,mxResources.get("errorLoadingFile"),Q,!0,null,null,!0)});if(null!=fa.fallbackFileData)fa.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var aa=new LocalFile(this,fa.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(aa)})},V();else{var K=this.spinner.spin(document.body,mxResources.get("loading"));this.getRecoveryData(c,k,fa,mxUtils.bind(this,function(aa){K&&this.spinner.stop();if(null!=aa&&1==aa.length){var da=aa[0];fa.alternateAction={label:da.label,funct:mxUtils.bind(this,function(){this.hideDialog();da.lossy?this.confirm(mxResources.get("recoveryWarning"),-mxUtils.bind(this,function(){this.openRecoveredCopy(da,L)})):this.openRecoveredCopy(da,L)})}}else null!=aa&&1<aa.length&&(fa.alternateAction={label:mxResources.get("recover"),funct:mxUtils.bind(this,function(){this.hideDialog();this.showRecoveryDialog(aa,L)})});V()}))}}}else B();return x};EditorUi.prototype.getHashValueForPages=function(c,f){var k=0,q=new mxGraphModel,x=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var B=0;B<c.length;B++)if(null!=c[B]){this.updatePageRoot(c[B]);-var E=c[B].node.ownerDocument.createElement("diagram");E.setAttribute("id",c[B].getId());q.root=c[B].root;var L=x.encode(q);this.editor.graph.saveViewState(c[B].viewState,L,!0);L.removeAttribute("pageWidth");L.removeAttribute("pageHeight");E.appendChild(L);null!=f&&(f.eltCount+=E.getElementsByTagName("*").length,f.nodeCount+=E.getElementsByTagName("mxCell").length);k=(k<<5)-k+this.hashValue(E,function(Q,V,K,fa){return!fa||"mxGeometry"!=Q.nodeName&&"mxPoint"!=Q.nodeName||"x"!=V&&"y"!=V&&"width"!=V&&-"height"!=V?fa&&"mxCell"==Q.nodeName&&"previous"==V?null:K:Math.round(K)},f)<<0}return k};EditorUi.prototype.hashValue=function(c,f,k){var q=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(q^=this.hashValue(c.nodeName,f,k));if(null!=c.attributes){null!=k&&(k.attrCount+=c.attributes.length);for(var x=0;x<c.attributes.length;x++){var B=c.attributes[x].name,E=null!=f?f(c,B,c.attributes[x].value,!0):-c.attributes[x].value;null!=E&&(q^=this.hashValue(B,f,k)+this.hashValue(E,f,k))}}if(null!=c.childNodes)for(x=0;x<c.childNodes.length;x++)q=(q<<5)-q+this.hashValue(c.childNodes[x],f,k)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);f=0;null!=k&&(k.byteCount+=c.length);for(x=0;x<c.length;x++)f=(f<<5)-f+c.charCodeAt(x)<<0;q^=f}return q};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,k,q,x,B,E){};EditorUi.prototype.isScratchpadEnabled=+mxUtils.bind(this,function(){this.openRecoveredCopy(da,L)})):this.openRecoveredCopy(da,L)})}}else null!=aa&&1<aa.length&&(fa.alternateAction={label:mxResources.get("recover"),funct:mxUtils.bind(this,function(){this.hideDialog();this.showRecoveryDialog(aa,L)})});V()}))}}}else C();return x};EditorUi.prototype.getHashValueForPages=function(c,f){var k=0,q=new mxGraphModel,x=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var C=0;C<c.length;C++)if(null!=c[C]){this.updatePageRoot(c[C]);+var E=c[C].node.ownerDocument.createElement("diagram");E.setAttribute("id",c[C].getId());q.root=c[C].root;var L=x.encode(q);this.editor.graph.saveViewState(c[C].viewState,L,!0);L.removeAttribute("pageWidth");L.removeAttribute("pageHeight");E.appendChild(L);null!=f&&(f.eltCount+=E.getElementsByTagName("*").length,f.nodeCount+=E.getElementsByTagName("mxCell").length);k=(k<<5)-k+this.hashValue(E,function(Q,V,K,fa){return!fa||"mxGeometry"!=Q.nodeName&&"mxPoint"!=Q.nodeName||"x"!=V&&"y"!=V&&"width"!=V&&+"height"!=V?fa&&"mxCell"==Q.nodeName&&"previous"==V?null:K:Math.round(K)},f)<<0}return k};EditorUi.prototype.hashValue=function(c,f,k){var q=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(q^=this.hashValue(c.nodeName,f,k));if(null!=c.attributes){null!=k&&(k.attrCount+=c.attributes.length);for(var x=0;x<c.attributes.length;x++){var C=c.attributes[x].name,E=null!=f?f(c,C,c.attributes[x].value,!0):+c.attributes[x].value;null!=E&&(q^=this.hashValue(C,f,k)+this.hashValue(E,f,k))}}if(null!=c.childNodes)for(x=0;x<c.childNodes.length;x++)q=(q<<5)-q+this.hashValue(c.childNodes[x],f,k)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);f=0;null!=k&&(k.byteCount+=c.length);for(x=0;x<c.length;x++)f=(f<<5)-f+c.charCodeAt(x)<<0;q^=f}return q};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,k,q,x,C,E){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(c){if(null==c||"<mxfile"==c.substring(0,7))c=this.emptyLibraryXml;this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var f=0;f<c.length;f++)null!=c[f].xml&&"<"!=c[f].xml.charAt(0)&&(c[f].xml=mxUtils.trim(Graph.decompress(c[f].xml)));f=mxUtils.createXmlDocument();var k=f.createElement("mxlibrary");mxUtils.setTextContent(k,JSON.stringify(c,null,2));f.appendChild(k);return mxUtils.getXml(f,"\n")};EditorUi.prototype.closeLibrary=function(c){null!=c&&(this.removeLibrarySidebar(c.getHash()),c.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(c.getHash()),".scratchpad"==c.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(c){var f=this.sidebar.palettes[c];if(null!=f){for(var k=0;k<f.length;k++)this.sidebar.unobserveElements(f[k]),f[k].parentNode.removeChild(f[k]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=function(c,f){var k=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!f){null==c&&(f=this.sidebar.palettes["L.scratchpad"],null==f&&(f=this.sidebar.palettes.search),null!=f&&(c=f[f.length-1].nextSibling));c=null!=c?c:k.firstChild.nextSibling.nextSibling;f=k.lastChild;var q=f.previousSibling;k.insertBefore(f,c);k.insertBefore(q,f)}};EditorUi.prototype.loadLibrary=function(c,f){var k=mxUtils.parseXml(c.getData());if("mxlibrary"==k.documentElement.nodeName){var q=JSON.parse(mxUtils.getTextContent(k.documentElement));this.libraryLoaded(c,q,k.documentElement.getAttribute("title"),f,k.documentElement.getAttribute("tags"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(c){return""};EditorUi.prototype.showSidebar=-function(){null!=this.sidebarWindow?this.sidebarWindow.window.setVisible(!0):this.toggleShapesPanel(!0)};EditorUi.prototype.showSearchWindow=function(c,f){var k=c?"findReplace":"find",q=k+"Window";if(null==this[q]){var x="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,B=mxSettings.getWindowState(k),E=null!=B&&null!=B.w?B.w:c?x?330:300:240;this[q]=new FindWindow(this,null!=B&&null!=B.x?B.x:document.body.offsetWidth-(E+20),null!=B&&null!=B.y?B.y:100,E,null!=-B&&null!=B.h?B.h:c?x?304:288:180,c);this[q].window.addListener("show",function(){this.fireEvent(new mxEventObject(k))});this[q].window.addListener("hide",function(){this.fireEvent(new mxEventObject(k))});this.installWindowPersistence(k,this[q]);null!=B&&null==f&&this.restoreWindowState(k,this[q]);this[q].window.setVisible(!0)}else null==f&&this[q].window.setVisible(!this[q].window.isVisible());null!=f&&(this[q].doSearch(f),this[q].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,-f,k,q,x){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var B=null;if(c.constructor!=StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var E=0;E<this.openLibraries.length;E++)if(this.openLibraries[E].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[E],this.openLibraries);break}B={file:c,images:f,title:k,expand:q};this.openLibraries.push(B)}else this.scratchpad=c;E=this.sidebar.palettes[c.getHash()];+function(){null!=this.sidebarWindow?this.sidebarWindow.window.setVisible(!0):this.toggleShapesPanel(!0)};EditorUi.prototype.showSearchWindow=function(c,f){var k=c?"findReplace":"find",q=k+"Window";if(null==this[q]){var x="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,C=mxSettings.getWindowState(k),E=null!=C&&null!=C.w?C.w:c?x?330:300:240;this[q]=new FindWindow(this,null!=C&&null!=C.x?C.x:document.body.offsetWidth-(E+20),null!=C&&null!=C.y?C.y:100,E,null!=+C&&null!=C.h?C.h:c?x?304:288:180,c);this[q].window.addListener("show",function(){this.fireEvent(new mxEventObject(k))});this[q].window.addListener("hide",function(){this.fireEvent(new mxEventObject(k))});this.installWindowPersistence(k,this[q]);null!=C&&null==f&&this.restoreWindowState(k,this[q]);this[q].window.setVisible(!0)}else null==f&&this[q].window.setVisible(!this[q].window.isVisible());null!=f&&(this[q].doSearch(f),this[q].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,+f,k,q,x){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var C=null;if(c.constructor!=StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var E=0;E<this.openLibraries.length;E++)if(this.openLibraries[E].file.getHash()==c.getHash()){mxUtils.remove(this.openLibraries[E],this.openLibraries);break}C={file:c,images:f,title:k,expand:q};this.openLibraries.push(C)}else this.scratchpad=c;E=this.sidebar.palettes[c.getHash()];E=null!=E?E[E.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var L=null,Q=mxUtils.bind(this,function(l,t){0==l.length&&c.isEditable()?(null==L&&(L=document.createElement("div"),L.className="geDropTarget",l=mxResources.get("dragElementsHere"),mxUtils.write(L,l),L.setAttribute("title",l)),t.appendChild(L)):this.addLibraryEntries(l,t)});null!=this.sidebar&&null!=f&&(this.sidebar.setCurrentSearchEntryLibrary(c.getHash(),c.getHash()),this.sidebar.addEntries(f,x),this.sidebar.setCurrentSearchEntryLibrary());-null==k&&(k=c.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));var V=this.sidebar.addPalette(c.getHash(),k,null!=q?q:!0,mxUtils.bind(this,function(l){Q(f,l)}),!0);null!=B&&(B.div=V);this.repositionLibrary(E,"L.scratchpad"!=c.getHash());q=V.parentNode.previousSibling;k=q.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=c.title&&q.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+k);var K=document.createElement("div");K.style.backgroundColor="inherit";q.style.position=-"relative";var fa=document.createElement("img");fa.className="geLibraryButton";fa.setAttribute("src",Editor.crossImage);fa.setAttribute("title",mxResources.get("close"));var aa=null;if(".scratchpad"!=c.title||this.closableScratchpad)K.appendChild(fa),mxEvent.addListener(fa,"click",mxUtils.bind(this,function(l){if(!mxEvent.isConsumed(l)){var t=mxUtils.bind(this,function(){null!=B&&mxUtils.remove(B,this.openLibraries);this.closeLibrary(c)});null!=aa?this.confirm(mxResources.get("allChangesLost"),null,+null==k&&(k=c.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));var V=this.sidebar.addPalette(c.getHash(),k,null!=q?q:!0,mxUtils.bind(this,function(l){Q(f,l)}),!0);null!=C&&(C.div=V);this.repositionLibrary(E,"L.scratchpad"!=c.getHash());q=V.parentNode.previousSibling;k=q.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=c.title&&q.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+k);var K=document.createElement("div");K.style.backgroundColor="inherit";q.style.position=+"relative";var fa=document.createElement("img");fa.className="geLibraryButton";fa.setAttribute("src",Editor.crossImage);fa.setAttribute("title",mxResources.get("close"));var aa=null;if(".scratchpad"!=c.title||this.closableScratchpad)K.appendChild(fa),mxEvent.addListener(fa,"click",mxUtils.bind(this,function(l){if(!mxEvent.isConsumed(l)){var t=mxUtils.bind(this,function(){null!=C&&mxUtils.remove(C,this.openLibraries);this.closeLibrary(c)});null!=aa?this.confirm(mxResources.get("allChangesLost"),null,t,mxResources.get("cancel"),mxResources.get("discardChanges")):t();mxEvent.consume(l)}}));if(c.isEditable()){var da=this.editor.graph,ba=null;k=mxUtils.bind(this,function(l){this.showLibraryDialog(c.getTitle(),V,f,c,c.getMode());mxEvent.consume(l)});var ha=mxUtils.bind(this,function(l){c.setModified(!0);c.isAutosave()?(null!=ba&&null!=ba.parentNode&&ba.parentNode.removeChild(ba),ba=fa.cloneNode(!1),ba.setAttribute("src",Editor.spinImage),ba.setAttribute("title",mxResources.get("saving")),ba.style.cursor="default",ba.style.marginRight="2px",ba.style.marginTop="-2px",K.insertBefore(ba,K.firstChild),this.saveLibrary(c.getTitle(),f,c,c.getMode(),!0,!0,function(){null!=ba&&null!=ba.parentNode&&ba.parentNode.removeChild(ba)})):null==aa&&(aa=fa.cloneNode(!1),aa.setAttribute("src",Editor.saveImage),aa.setAttribute("title",mxResources.get("save")),K.insertBefore(aa,K.firstChild),mxEvent.addListener(aa,"click",mxUtils.bind(this,function(t){this.saveLibrary(c.getTitle(),f,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==aa||c.isModified()||(aa.parentNode.removeChild(aa),aa=null)});mxEvent.consume(t)})))}),qa=mxUtils.bind(this,function(l,t,H,J){l=da.cloneCells(mxUtils.sortCells(da.model.getTopmostCells(l)));for(var R=0;R<l.length;R++){var T=da.getCellGeometry(l[R]);null!=T&&T.translate(-t.x,-t.y)}V.appendChild(this.sidebar.createVertexTemplateFromCells(l,t.width,t.height,J||"",!0,null,!1));l=mxUtils.getXml(this.editor.graph.encodeCells(l));Editor.defaultCompressed&&(l=Graph.compress(l));t={xml:l,@@ -4068,110 +4071,110 @@ w:t.width,h:t.height};null!=J&&(t.title=J);f.push(t);ha(H);null!=L&&null!=L.pareH=da.view.getBounds(t);if(null!=H&&0<H.width&&0<H.height){var J=da.view.scale;H.x/=J;H.y/=J;H.width/=J;H.height/=J;H.x-=da.view.translate.x;H.y-=da.view.translate.y;qa(t,H)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(l)});mxEvent.addGestureListeners(V,function(){},mxUtils.bind(this,function(l){da.isMouseDown&&null!=da.panningManager&&null!=da.graphHandler.first&&(da.graphHandler.suspend(),null!=da.graphHandler.hint&&(da.graphHandler.hint.style.visibility="hidden"),V.style.backgroundColor="light-dark(#fefefe, #000000)",V.style.cursor="copy",da.panningManager.stop(),da.autoScroll=!1,mxEvent.consume(l))}),mxUtils.bind(this,function(l){da.isMouseDown&&null!=da.panningManager&&null!=da.graphHandler&&(V.style.backgroundColor="",V.style.cursor="default",this.sidebar.showTooltips=!0,da.panningManager.stop(),da.graphHandler.reset(),da.isMouseDown=!1,da.autoScroll=!0,ra(l),mxEvent.consume(l))}));mxEvent.addListener(V,"mouseleave",mxUtils.bind(this,function(l){da.isMouseDown&&null!=da.graphHandler.first&&(da.graphHandler.resume(),null!=da.graphHandler.hint&&(da.graphHandler.hint.style.visibility="visible"),V.style.backgroundColor="",V.style.cursor="",da.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(V,"dragover",mxUtils.bind(this,function(l){V.style.backgroundColor="light-dark(#fefefe, #000000)";l.dataTransfer.dropEffect="copy";V.style.cursor="copy";this.sidebar.hideTooltip();l.stopPropagation();l.preventDefault()})),mxEvent.addListener(V,"drop",mxUtils.bind(this,-function(l){V.style.cursor="";V.style.backgroundColor="";0<l.dataTransfer.files.length&&this.importFiles(l.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(t,H,J,R,T,Y,Z,ia,ka){if(null!=t&&"image/"==H.substring(0,6))t="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(t),t=[new mxCell("",new mxGeometry(0,0,T,Y),t)],t[0].vertex=!0,qa(t,new mxRectangle(0,0,T,Y),l,mxEvent.isAltDown(l)?null:Z.substring(0,Z.lastIndexOf(".")).replace(/_/g,-" ")),null!=L&&null!=L.parentNode&&0<f.length&&(L.parentNode.removeChild(L),L=null);else{var X=!1,ja=mxUtils.bind(this,function(na,la){null!=na&&"application/pdf"==la&&(la=Editor.extractGraphModelFromPdf(na),null!=la&&0<la.length&&(na=la));if(null!=na)if(na=mxUtils.parseXml(na),"mxlibrary"==na.documentElement.nodeName)try{var va=JSON.parse(mxUtils.getTextContent(na.documentElement));Q(va,V);f=f.concat(va);ha(l);this.spinner.stop();X=!0}catch(Ca){}else if("mxfile"==na.documentElement.nodeName)try{var za=-na.documentElement.getElementsByTagName("diagram");for(va=0;va<za.length;va++){var sa=this.stringToCells(Editor.getDiagramNodeXml(za[va])),wa=this.editor.graph.getBoundingBoxFromGeometry(sa);null!=wa&&qa(sa,new mxRectangle(0,0,wa.width,wa.height),l)}X=!0}catch(Ca){null!=window.console&&console.log("error in drop handler:",Ca)}X||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=L&&null!=L.parentNode&&0<f.length&&(L.parentNode.removeChild(L),L=null)});null!=-ka&&null!=Z&&EditorUi.isVisioFilename(Z)?this.importVisio(ka,function(na){ja(na,"text/xml")},null,Z):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(t,Z)&&null!=ka?this.isExternalDataComms()?this.parseFile(ka,mxUtils.bind(this,function(na){4==na.readyState&&(this.spinner.stop(),200<=na.status&&299>=na.status?ja(na.responseText,"text/xml"):this.handleError({message:mxResources.get(413==na.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),-this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):ja(t,H)}}));l.stopPropagation();l.preventDefault()})),mxEvent.addListener(V,"dragleave",function(l){V.style.cursor="";V.style.backgroundColor="";l.stopPropagation();l.preventDefault()}));fa=fa.cloneNode(!1);fa.setAttribute("src",Editor.editImage);fa.setAttribute("title",mxResources.get("edit"));K.insertBefore(fa,K.firstChild);mxEvent.addListener(fa,"click",k);k=fa.cloneNode(!1);k.setAttribute("src",Editor.plusImage);k.setAttribute("title",+function(l){V.style.cursor="";V.style.backgroundColor="";0<l.dataTransfer.files.length&&this.importFiles(l.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(t,H,J,R,T,Y,Z,ia,ja){if(null!=t&&"image/"==H.substring(0,6))t="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(t),t=[new mxCell("",new mxGeometry(0,0,T,Y),t)],t[0].vertex=!0,qa(t,new mxRectangle(0,0,T,Y),l,mxEvent.isAltDown(l)?null:Z.substring(0,Z.lastIndexOf(".")).replace(/_/g,+" ")),null!=L&&null!=L.parentNode&&0<f.length&&(L.parentNode.removeChild(L),L=null);else{var X=!1,ka=mxUtils.bind(this,function(na,la){null!=na&&"application/pdf"==la&&(la=Editor.extractGraphModelFromPdf(na),null!=la&&0<la.length&&(na=la));if(null!=na)if(na=mxUtils.parseXml(na),"mxlibrary"==na.documentElement.nodeName)try{var ua=JSON.parse(mxUtils.getTextContent(na.documentElement));Q(ua,V);f=f.concat(ua);ha(l);this.spinner.stop();X=!0}catch(Ca){}else if("mxfile"==na.documentElement.nodeName)try{var za=+na.documentElement.getElementsByTagName("diagram");for(ua=0;ua<za.length;ua++){var sa=this.stringToCells(Editor.getDiagramNodeXml(za[ua])),wa=this.editor.graph.getBoundingBoxFromGeometry(sa);null!=wa&&qa(sa,new mxRectangle(0,0,wa.width,wa.height),l)}X=!0}catch(Ca){null!=window.console&&console.log("error in drop handler:",Ca)}X||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=L&&null!=L.parentNode&&0<f.length&&(L.parentNode.removeChild(L),L=null)});null!=+ja&&null!=Z&&EditorUi.isVisioFilename(Z)?this.importVisio(ja,function(na){ka(na,"text/xml")},null,Z):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(t,Z)&&null!=ja?this.isExternalDataComms()?this.parseFile(ja,mxUtils.bind(this,function(na){4==na.readyState&&(this.spinner.stop(),200<=na.status&&299>=na.status?ka(na.responseText,"text/xml"):this.handleError({message:mxResources.get(413==na.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),+this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):ka(t,H)}}));l.stopPropagation();l.preventDefault()})),mxEvent.addListener(V,"dragleave",function(l){V.style.cursor="";V.style.backgroundColor="";l.stopPropagation();l.preventDefault()}));fa=fa.cloneNode(!1);fa.setAttribute("src",Editor.editImage);fa.setAttribute("title",mxResources.get("edit"));K.insertBefore(fa,K.firstChild);mxEvent.addListener(fa,"click",k);k=fa.cloneNode(!1);k.setAttribute("src",Editor.plusImage);k.setAttribute("title",mxResources.get("add"));K.insertBefore(k,K.firstChild);mxEvent.addListener(k,"click",ra);".scratchpad"==c.title&&(this.addSelectionToScratchpad=ra);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(k=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),k.className="geLibraryButton",K.insertBefore(k,K.firstChild))}q.appendChild(K);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,f){for(var k=0;k<c.length;k++)try{var q=-c[k],x=q.data;if(null!=x){x="data:"==x.substring(0,5)?this.convertDataUri(x):x;var B="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==q.aspect&&(B+="aspect=fixed;");B=B+"image="+x+";";null!=q.style&&(B+=q.style);f.appendChild(this.sidebar.createVertexTemplate(B,q.w,q.h,"",q.title||"",!1,null,!0))}else if(null!=q.xml){var E=this.stringToCells("<"==q.xml.charAt(0)?q.xml:Graph.decompress(q.xml)),L=0==E.length?mxResources.get("drawingEmpty"):null!=q.title?q.title:"";-f.appendChild(this.sidebar.createVertexTemplateFromCells(E,q.w,q.h,L,!0,null,!0))}}catch(Q){L=null!=Q.message?mxResources.get("error")+": "+Q.message:String(Q),B=this.sidebar.createVertexTemplateFromCells(null,q.w,q.h,L,!0,null,!0),f.appendChild(B)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||-(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,f,k,q,x,B,E){c=new ImageDialog(this,c,f,k,q,x,B,E);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,k,q,x,B){var E=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=E?JSON.stringify(JSON.parse(E),null,2):"",mxUtils.bind(this,function(L){if(null!=-L)try{if(null!=B&&B(L),L==E)this.hideDialog();else{if(0<L.length){var Q=JSON.parse(L);localStorage.setItem(f,JSON.stringify(Q))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(V){this.handleError(V)}}),null,mxResources.get("close"),null,null,null,!0,null,null,x,k,q);this.showDialog(c.container,660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=k&&2<k.length?500:440,280));c.init()};EditorUi.prototype.showConfigurationEditorDialog=-function(c,f,k,q){function x(Z){da?Q.confirm(mxResources.get("allChangesLost"),null,Z,mxResources.get("cancel"),mxResources.get("discardChanges")):Z()}function B(){ba=!0;Q.hideDialog()}function E(Z,ia){var ka=document.createElement("div");ka.style.padding="4px 16px";ka.style.cursor="pointer";ka.style.fontSize="13px";ka.style.borderBottom=ia?"2px solid #29b6f2":"2px solid transparent";ka.style.fontWeight=ia?"bold":"normal";ka.style.color=ia?"":"#888";ka.style.userSelect="none";mxUtils.write(ka,Z);-return ka}function L(Z){if(Z!==aa){if("json"===Z)null!=fa&&(R.value=JSON.stringify(fa,null,2)),l.style.display="none",J.style.display="",ra.style.borderBottomColor="#29b6f2",ra.style.fontWeight="bold",ra.style.color="",qa.style.borderBottomColor="transparent",qa.style.fontWeight="normal",qa.style.color="#888",R.focus();else{try{var ia=JSON.parse(R.value);fa=ia;H.setConfig(ia)}catch(ka){}l.style.display="";J.style.display="none";qa.style.borderBottomColor="#29b6f2";qa.style.fontWeight="bold";qa.style.color=+c[k],x=q.data;if(null!=x){x="data:"==x.substring(0,5)?this.convertDataUri(x):x;var C="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==q.aspect&&(C+="aspect=fixed;");C=C+"image="+x+";";null!=q.style&&(C+=q.style);f.appendChild(this.sidebar.createVertexTemplate(C,q.w,q.h,"",q.title||"",!1,null,!0))}else if(null!=q.xml){var E=this.stringToCells("<"==q.xml.charAt(0)?q.xml:Graph.decompress(q.xml)),L=0==E.length?mxResources.get("drawingEmpty"):null!=q.title?q.title:"";+f.appendChild(this.sidebar.createVertexTemplateFromCells(E,q.w,q.h,L,!0,null,!0))}}catch(Q){L=null!=Q.message?mxResources.get("error")+": "+Q.message:String(Q),C=this.sidebar.createVertexTemplateFromCells(null,q.w,q.h,L,!0,null,!0),f.appendChild(C)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||+(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,f,k,q,x,C,E){c=new ImageDialog(this,c,f,k,q,x,C,E);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,k,q,x,C){var E=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=E?JSON.stringify(JSON.parse(E),null,2):"",mxUtils.bind(this,function(L){if(null!=+L)try{if(null!=C&&C(L),L==E)this.hideDialog();else{if(0<L.length){var Q=JSON.parse(L);localStorage.setItem(f,JSON.stringify(Q))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(V){this.handleError(V)}}),null,mxResources.get("close"),null,null,null,!0,null,null,x,k,q);this.showDialog(c.container,660,480,!0,!1,null,null,null,new mxRectangle(0,0,null!=k&&2<k.length?500:440,280));c.init()};EditorUi.prototype.showConfigurationEditorDialog=+function(c,f,k,q){function x(Z){da?Q.confirm(mxResources.get("allChangesLost"),null,Z,mxResources.get("cancel"),mxResources.get("discardChanges")):Z()}function C(){ba=!0;Q.hideDialog()}function E(Z,ia){var ja=document.createElement("div");ja.style.padding="4px 16px";ja.style.cursor="pointer";ja.style.fontSize="13px";ja.style.borderBottom=ia?"2px solid #29b6f2":"2px solid transparent";ja.style.fontWeight=ia?"bold":"normal";ja.style.color=ia?"":"#888";ja.style.userSelect="none";mxUtils.write(ja,Z);+return ja}function L(Z){if(Z!==aa){if("json"===Z)null!=fa&&(R.value=JSON.stringify(fa,null,2)),l.style.display="none",J.style.display="",ra.style.borderBottomColor="#29b6f2",ra.style.fontWeight="bold",ra.style.color="",qa.style.borderBottomColor="transparent",qa.style.fontWeight="normal",qa.style.color="#888",R.focus();else{try{var ia=JSON.parse(R.value);fa=ia;H.setConfig(ia)}catch(ja){}l.style.display="";J.style.display="none";qa.style.borderBottomColor="#29b6f2";qa.style.fontWeight="bold";qa.style.color="";ra.style.borderBottomColor="transparent";ra.style.fontWeight="normal";ra.style.color="#888"}aa=Z}}var Q=this,V=localStorage.getItem(f),K={};try{null!=V&&(K=JSON.parse(V))}catch(Z){}var fa=K,aa="editor",da=!1,ba=!1;c=document.createElement("div");c.style.position="absolute";c.style.top="20px";c.style.bottom="20px";c.style.left="20px";c.style.right="20px";var ha=document.createElement("div");ha.style.position="absolute";ha.style.left="0";ha.style.right="0";ha.style.top="0";ha.style.height="28px";ha.style.display="flex";ha.style.alignItems="end";ha.style.borderBottom="1px solid #d0d0d0";var qa=E(mxResources.get("editor",null,"Editor"),!0),ra=E(mxResources.get("formatJson",null,"JSON"),!1);ha.appendChild(qa);ha.appendChild(ra);c.appendChild(ha);var l=document.createElement("div");l.style.position="absolute";l.style.left="0";l.style.right="0";l.style.top="30px";l.style.bottom="50px";ha={};try{var t=Q.editor.graph;null!=t.currentVertexStyle&&(ha.currentVertexStyle=t.currentVertexStyle);null!=t.currentEdgeStyle&&(ha.currentEdgeStyle=t.currentEdgeStyle)}catch(Z){}var H=DrawioConfigEditor.install(l,{initialConfig:K,editorContext:ha,darkMode:null!=Editor.isDarkMode&&Editor.isDarkMode(),highContrast:Q.isHighContrast(),onConfigChanged:function(Z){fa=Z;da=!0}}),J=document.createElement("div");J.style.position="absolute";J.style.left="0";J.style.right="0";J.style.top="30px";J.style.bottom="50px";J.style.display="none";var R=document.createElement("textarea");R.setAttribute("wrap","off");R.setAttribute("spellcheck","false");R.setAttribute("autocorrect","off");R.setAttribute("autocomplete","off");R.setAttribute("autocapitalize","off");R.style.resize="none";R.style.outline="none";R.style.boxSizing="border-box";R.style.width="100%";R.style.height="100%";try{R.value=null!=V?JSON.stringify(JSON.parse(V),null,2):""}catch(Z){R.value=V||""}mxEvent.addListener(R,"input",function(){da=!0});J.appendChild(R);c.appendChild(l);c.appendChild(J);mxEvent.addListener(qa,"click",function(){L("editor")});mxEvent.addListener(ra,-"click",function(){L("json")});var T=document.createElement("div");T.style.position="absolute";T.style.left="0";T.style.right="0";T.style.bottom="0";T.style.height="46px";T.style.display="flex";T.style.whiteSpace="nowrap";T.style.alignItems="center";T.style.justifyContent="end";T.style.paddingTop="10px";T.style.paddingBottom="10px";T.style.boxSizing="border-box";null==q||Q.isOffline()||T.appendChild(Q.createHelpIcon(q));if(null!=k)for(q=0;q<k.length;q++)(function(Z,ia,ka){Z=mxUtils.button(Z,function(X){"editor"===-aa&&null!=fa&&(R.value=JSON.stringify(fa,null,2));ia(X,R)});null!=ka&&Z.setAttribute("title",ka);Z.className="geBtn";T.appendChild(Z)})(k[q][0],k[q][1],k[q][2]);q=mxUtils.button(mxResources.get("close"),function(){x(B)});q.setAttribute("title","Escape");q.className="geBtn";var Y=mxUtils.button(mxResources.get("apply"),function(){var Z="editor"===aa?null!=fa&&0<Object.keys(fa).length?JSON.stringify(fa,null,2):"":R.value;try{if(Z==V)da=!1,B();else{if(0<Z.length){var ia=JSON.parse(Z);localStorage.setItem(f,-JSON.stringify(ia))}else localStorage.removeItem(f);da=!1;B();Q.alert(mxResources.get("restartForChangeRequired"))}}catch(ka){Q.handleError(ka)}});Y.className="geBtn gePrimaryBtn";Q.editor.cancelFirst?(T.appendChild(q),T.appendChild(Y)):(T.appendChild(Y),T.appendChild(q));c.appendChild(T);mxEvent.addListener(c,"keydown",function(Z){13===Z.keyCode&&mxEvent.isControlDown(Z)&&Y.click()});Q.showDialog(c,800,600,!0,!1,function(Z,ia){if(!ba&&da)return x(B),!1},null,null,new mxRectangle(0,0,null!=k&&2<k.length?-500:440,400));R.scrollTop=0};EditorUi.prototype.showBackgroundImageDialog=function(c,f,k,q){c=null!=c?c:mxUtils.bind(this,function(x,B,E){B||(x=new ChangePageSetup(this,q?E:null,x),x.ignoreColor=!q,this.editor.graph.model.execute(x))});c=new BackgroundImageDialog(this,c,f,k,q);this.showDialog(c.container,400,null,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,f,k,q,x){c=new LibraryDialog(this,c,f,k,q,x);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(B){B&&null==+"click",function(){L("json")});var T=document.createElement("div");T.style.position="absolute";T.style.left="0";T.style.right="0";T.style.bottom="0";T.style.height="46px";T.style.display="flex";T.style.whiteSpace="nowrap";T.style.alignItems="center";T.style.justifyContent="end";T.style.paddingTop="10px";T.style.paddingBottom="10px";T.style.boxSizing="border-box";null==q||Q.isOffline()||T.appendChild(Q.createHelpIcon(q));if(null!=k)for(q=0;q<k.length;q++)(function(Z,ia,ja){Z=mxUtils.button(Z,function(X){"editor"===+aa&&null!=fa&&(R.value=JSON.stringify(fa,null,2));ia(X,R)});null!=ja&&Z.setAttribute("title",ja);Z.className="geBtn";T.appendChild(Z)})(k[q][0],k[q][1],k[q][2]);q=mxUtils.button(mxResources.get("close"),function(){x(C)});q.setAttribute("title","Escape");q.className="geBtn";var Y=mxUtils.button(mxResources.get("apply"),function(){var Z="editor"===aa?null!=fa&&0<Object.keys(fa).length?JSON.stringify(fa,null,2):"":R.value;try{if(Z==V)da=!1,C();else{if(0<Z.length){var ia=JSON.parse(Z);localStorage.setItem(f,+JSON.stringify(ia))}else localStorage.removeItem(f);da=!1;C();Q.alert(mxResources.get("restartForChangeRequired"))}}catch(ja){Q.handleError(ja)}});Y.className="geBtn gePrimaryBtn";Q.editor.cancelFirst?(T.appendChild(q),T.appendChild(Y)):(T.appendChild(Y),T.appendChild(q));c.appendChild(T);mxEvent.addListener(c,"keydown",function(Z){13===Z.keyCode&&mxEvent.isControlDown(Z)&&Y.click()});Q.showDialog(c,800,600,!0,!1,function(Z,ia){if(!ba&&da)return x(C),!1},null,null,new mxRectangle(0,0,null!=k&&2<k.length?+500:440,400));R.scrollTop=0};EditorUi.prototype.showBackgroundImageDialog=function(c,f,k,q){c=null!=c?c:mxUtils.bind(this,function(x,C,E){C||(x=new ChangePageSetup(this,q?E:null,x),x.ignoreColor=!q,this.editor.graph.model.execute(x))});c=new BackgroundImageDialog(this,c,f,k,q);this.showDialog(c.container,400,null,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,f,k,q,x){c=new LibraryDialog(this,c,f,k,q,x);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(C){C&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}),!1,!1,new mxRectangle(0,0,480,320));c.init()};EditorUi.prototype.getCollapsedSections=function(){return mxSettings.getCollapsedSections()};EditorUi.prototype.getLibraryExpanded=function(c,f){var k=mxSettings.getCollapsedLibraries();return null!=k[c]?!k[c]:f};EditorUi.prototype.setLibraryExpanded=function(c,f){if(null!=c){var k=mxSettings.getCollapsedLibraries();k[c]=!f;mxSettings.setCollapsedLibraries(k);mxSettings.save()}};var m=EditorUi.prototype.createFormat;-EditorUi.prototype.createFormat=function(c){var f=m.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(k){this.editor.graph.isSelectionEmpty()&&f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,k,q,x,B,E){var L=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},Q=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{"1"!=urlParams.test&&!E||null==window.console||+EditorUi.prototype.createFormat=function(c){var f=m.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(k){this.editor.graph.isSelectionEmpty()&&f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,k,q,x,C,E){var L=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},Q=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{"1"!=urlParams.test&&!E||null==window.console||console.error("EditorUi.handleError:",c)}catch(aa){}if(null!=Q||null!=f){E=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var V=mxResources.get("ok"),K=null;f=null!=f?f:mxResources.get("error");if(null!=Q){null!=Q.retry&&(V=mxResources.get("cancel"),K=function(){L();Q.retry()});if(404==Q.code||404==Q.status||403==Q.code){E=403==Q.code?null!=Q.message?mxUtils.htmlEntities(Q.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=x?x:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+-(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var fa=null!=x?null:null!=B?B:window.location.hash;if(null!=fa&&("#G"==fa.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==fa.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==Q.code||404==Q.status)){fa="#U"==fa.substring(0,2)?fa.substring(45,+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var fa=null!=x?null:null!=C?C:window.location.hash;if(null!=fa&&("#G"==fa.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==fa.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==Q.code||404==Q.status)){fa="#U"==fa.substring(0,2)?fa.substring(45,fa.lastIndexOf("%26ex")):fa.substring(2);this.showError(f,E,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+fa);null!=q&&q()}),K,mxResources.get("changeUser"),mxUtils.bind(this,function(){function aa(){qa.innerText="";for(var ra=0;ra<da.length;ra++){var l=document.createElement("option");mxUtils.write(l,da[ra].displayName);l.value=ra;qa.appendChild(l);l=document.createElement("option");l.innerHTML=" ";mxUtils.write(l,"<"+da[ra].email+">");l.setAttribute("disabled","disabled");qa.appendChild(l)}l=document.createElement("option");mxUtils.write(l,mxResources.get("addAccount"));l.value=da.length;qa.appendChild(l)}var da=this.drive.getUsersList(),ba=document.createElement("div"),ha=document.createElement("div");ha.style.marginBottom="6px";mxUtils.write(ha,mxResources.get("changeUser")+": ");ba.appendChild(ha);var qa=document.createElement("select");qa.style.width="100%";aa();mxEvent.addListener(qa,"change",mxUtils.bind(this,function(){var ra=qa.value,l=da.length!=ra;l&&this.drive.setUser(da[ra]);this.drive.authorize(l,mxUtils.bind(this,function(){l||(da=this.drive.getUsersList(),aa())}),mxUtils.bind(this,function(t){this.handleError(t)}),!0)}));ba.appendChild(qa);ba=new CustomDialog(this,ba,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(ba.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=k&&k()}),520,150);return}}null!=Q.message?E=""==Q.message&&null!=Q.name?mxUtils.htmlEntities(Q.name,!1):mxUtils.htmlEntities(Q.message,!1):null!=Q.response&&null!=Q.response.error?E=mxUtils.htmlEntities(Q.response.error,!1):"undefined"!==typeof window.App&&(Q.code==App.ERROR_TIMEOUT?E=mxUtils.htmlEntities(mxResources.get("timeout"),!1):Q.code==App.ERROR_BUSY?E=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof Q&&0<Q.length&&(E=mxUtils.htmlEntities(Q,!1)))}x=c=null;null!=Q&&null!=Q.helpLink?(c=mxResources.get("help"),x=mxUtils.bind(this,function(){return this.editor.graph.openLink(Q.helpLink)})):null!=Q&&null!=Q.ownerEmail?(c=mxResources.get("contactOwner"),E+=mxUtils.htmlEntities(" ("+c+": "+Q.ownerEmail+")",!1),x=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(Q.ownerEmail))})):null!=Q&&null!=Q.alternateAction&&(c=Q.alternateAction.label,x=Q.alternateAction.funct);this.showError(f,E,V,k,K,null,null,c,x,null!=Q?Q.dialogWidth:null,null,null,-q?k:null)}else null!=k&&k()};EditorUi.prototype.alert=function(c,f,k){c=new ErrorDialog(this,null,c,mxResources.get("ok"),f);this.showDialog(c.container,k||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,k,q,x,B){c=null!=c?c:"";var E=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},L=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){E();null!=f&&f()},function(){E();null!=k&&k()},q,x,null,null,null,null,L);this.showDialog(c.container,-340,46+L,!0,B);c.init()};EditorUi.prototype.showBanner=function(c,f,k,q,x,B,E,L,Q){B=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){E=null!=E?E:"translate(-50%,120%)";L=null!=L?L:"translate(-50%,0%)";var V=document.createElement("div");V.className="geBtn gePrimaryBtn geBanner"+(x?" geSmallBanner":"");V.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(V.style,"transform",E);mxUtils.setPrefixedStyle(V.style,-"transition","all 1000ms ease");null!=Q&&mxUtils.setPrefixedStyle(V.style,"transform-origin",Q);Q=Q=document.createElement("img");Q.setAttribute("src",Editor.crossImage);Q.setAttribute("title",mxResources.get(q?"doNotShowAgain":"close"));Q.setAttribute("border","0");x||(B=document.createElement("img"),B.setAttribute("src",IMAGE_PATH+"/logo.png"),B.setAttribute("border","0"),B.setAttribute("align","absmiddle"),B.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",-V.appendChild(B),Q.style.cssText=(x?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",V.appendChild(Q));mxUtils.write(V,f);document.body.appendChild(V);this.bannerShowing=!0;x&&(Q.className="geLibraryButton",V.appendChild(Q));f=document.createElement("div");f.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var K=document.createElement("input");+q?k:null)}else null!=k&&k()};EditorUi.prototype.alert=function(c,f,k){c=new ErrorDialog(this,null,c,mxResources.get("ok"),f);this.showDialog(c.container,k||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,k,q,x,C){c=null!=c?c:"";var E=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},L=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){E();null!=f&&f()},function(){E();null!=k&&k()},q,x,null,null,null,null,L);this.showDialog(c.container,+340,46+L,!0,C);c.init()};EditorUi.prototype.showBanner=function(c,f,k,q,x,C,E,L,Q){C=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){E=null!=E?E:"translate(-50%,120%)";L=null!=L?L:"translate(-50%,0%)";var V=document.createElement("div");V.className="geBtn gePrimaryBtn geBanner"+(x?" geSmallBanner":"");V.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(V.style,"transform",E);mxUtils.setPrefixedStyle(V.style,+"transition","all 1000ms ease");null!=Q&&mxUtils.setPrefixedStyle(V.style,"transform-origin",Q);Q=Q=document.createElement("img");Q.setAttribute("src",Editor.crossImage);Q.setAttribute("title",mxResources.get(q?"doNotShowAgain":"close"));Q.setAttribute("border","0");x||(C=document.createElement("img"),C.setAttribute("src",IMAGE_PATH+"/logo.png"),C.setAttribute("border","0"),C.setAttribute("align","absmiddle"),C.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",+V.appendChild(C),Q.style.cssText=(x?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",V.appendChild(Q));mxUtils.write(V,f);document.body.appendChild(V);this.bannerShowing=!0;x&&(Q.className="geLibraryButton",V.appendChild(Q));f=document.createElement("div");f.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var K=document.createElement("input");K.setAttribute("type","checkbox");K.setAttribute("id","geDoNotShowAgainCheckbox");K.style.marginRight="6px";if(!q){f.appendChild(K);var fa=document.createElement("label");fa.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(fa,mxResources.get("doNotShowAgain"));f.appendChild(fa);V.style.paddingBottom=x?"16px":"30px";V.appendChild(f)}var aa=mxUtils.bind(this,function(){null!=V.parentNode&&(V.parentNode.removeChild(V),this.bannerShowing=!1,K.checked||q)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=Q&&mxEvent.addListener(Q,"click",mxUtils.bind(this,function(ba){mxEvent.consume(ba);aa()}));var da=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(V.style,"transform",E);window.setTimeout(mxUtils.bind(this,function(){aa()}),1E3)});mxEvent.addListener(V,"click",mxUtils.bind(this,function(ba){var ha=mxEvent.getSource(ba);ha!=K&&ha!=fa?(null!=k&&k(),aa(),mxEvent.consume(ba)):da()}));window.setTimeout(mxUtils.bind(this,-function(){mxUtils.setPrefixedStyle(V.style,"transform",L)}),500);window.setTimeout(da,x?5E3:3E4);B=!0}return B};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,f,k,q){c=c.toDataURL("image/"+k);if(null!=c&&6<c.length)null!=f&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(f))),0<q&&(c=Editor.writeGraphModelToPng(c,-"pHYs","dpi",q));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,f,k,q,x){var B="jpeg"==k?"jpg":k;q=this.getBaseFilename(q)+(null!=f?".drawio":"")+"."+B;c=this.createImageDataUri(c,f,k,x);this.saveData(q,B,c.substring(c.lastIndexOf(",")+1),"image/"+k,!0)};EditorUi.prototype.showAnimatedGifExportDialog=function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("formatAnimatedGif",-null,"Animated GIF"));c.appendChild(f);f=document.createElement("div");f.className="geDialogSection";var k=document.createElement("div");k.className="geDialogFormRow";var q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("speed",null,"Speed")+":");k.appendChild(q);var x=document.createElement("select"),B=[{label:mxResources.get("slow",null,"Slow"),value:8},{label:mxResources.get("medium",null,"Medium"),value:15},{label:mxResources.get("fast",null,"Fast"),-value:24}];for(q=0;q<B.length;q++){var E=document.createElement("option");mxUtils.write(E,B[q].label);E.setAttribute("value",B[q].value);x.appendChild(E)}x.value=null!=this.lastExportFps?this.lastExportFps:15;0>x.selectedIndex&&(x.value=15);k.appendChild(x);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("zoom")+":");k.appendChild(q);var L=document.createElement("input");+function(){mxUtils.setPrefixedStyle(V.style,"transform",L)}),500);window.setTimeout(da,x?5E3:3E4);C=!0}return C};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,f,k,q){c=c.toDataURL("image/"+k);if(null!=c&&6<c.length)null!=f&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(f))),0<q&&(c=Editor.writeGraphModelToPng(c,+"pHYs","dpi",q));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,f,k,q,x){var C="jpeg"==k?"jpg":k;q=this.getBaseFilename(q)+(null!=f?".drawio":"")+"."+C;c=this.createImageDataUri(c,f,k,x);this.saveData(q,C,c.substring(c.lastIndexOf(",")+1),"image/"+k,!0)};EditorUi.prototype.showAnimatedGifExportDialog=function(){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("formatAnimatedGif",+null,"Animated GIF"));c.appendChild(f);f=document.createElement("div");f.className="geDialogSection";var k=document.createElement("div");k.className="geDialogFormRow";var q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("speed",null,"Speed")+":");k.appendChild(q);var x=document.createElement("select"),C=[{label:mxResources.get("slow",null,"Slow"),value:8},{label:mxResources.get("medium",null,"Medium"),value:15},{label:mxResources.get("fast",null,"Fast"),+value:24}];for(q=0;q<C.length;q++){var E=document.createElement("option");mxUtils.write(E,C[q].label);E.setAttribute("value",C[q].value);x.appendChild(E)}x.value=null!=this.lastExportFps?this.lastExportFps:15;0>x.selectedIndex&&(x.value=15);k.appendChild(x);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("zoom")+":");k.appendChild(q);var L=document.createElement("input");L.setAttribute("type","text");L.value=this.lastExportZoom||"100%";k.appendChild(L);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("borderWidth",null,"Border Width")+":");k.appendChild(q);var Q=document.createElement("input");Q.setAttribute("type","text");Q.value=this.lastExportBorder||"0";k.appendChild(Q);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";-q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("loops",null,"Loops")+":");k.appendChild(q);var V=document.createElement("select");B=[{label:mxResources.get("forever",null,"Forever"),value:0},{label:"1",value:1},{label:"3",value:3},{label:"5",value:5}];for(q=0;q<B.length;q++)E=document.createElement("option"),mxUtils.write(E,B[q].label),E.setAttribute("value",B[q].value),V.appendChild(E);V.value=null!=this.lastExportLoops?this.lastExportLoops:0;0>V.selectedIndex&&+q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("loops",null,"Loops")+":");k.appendChild(q);var V=document.createElement("select");C=[{label:mxResources.get("forever",null,"Forever"),value:0},{label:"1",value:1},{label:"3",value:3},{label:"5",value:5}];for(q=0;q<C.length;q++)E=document.createElement("option"),mxUtils.write(E,C[q].label),E.setAttribute("value",C[q].value),V.appendChild(E);V.value=null!=this.lastExportLoops?this.lastExportLoops:0;0>V.selectedIndex&&(V.value=0);k.appendChild(V);f.appendChild(k);k=document.createElement("div");k.className="geDialogFormRow";q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("appearance")+":");k.appendChild(q);var K=document.createElement("select");q=document.createElement("option");q.setAttribute("value","light");mxUtils.write(q,mxResources.get("light"));K.appendChild(q);q=document.createElement("option");q.setAttribute("value","dark");mxUtils.write(q,mxResources.get("dark"));K.appendChild(q);var fa=Editor.isDarkMode()?"dark":"light";K.value=null!=this.lastExportTheme?this.lastExportTheme:fa;0>K.selectedIndex&&(K.value=fa);k.appendChild(K);f.appendChild(k);c.appendChild(f);f=document.createElement("div");f.className="geDialogSection";var aa=this.addCheckbox(f,mxResources.get("transparentBackground",null,"Transparent Background"),null!=this.lastExportTransparent?this.lastExportTransparent:!1,null,null,null,null,null,!0);c.appendChild(f);c=new CustomDialog(this,c,mxUtils.bind(this,function(){var da=parseInt(L.value);if(isNaN(da)||0>=da)da=100;this.lastExportZoom=da+"%";this.lastExportBorder=Q.value;this.lastExportFps=15!=parseInt(x.value)?parseInt(x.value):null;this.lastExportLoops=0!=parseInt(V.value)?parseInt(V.value):null;this.lastExportTransparent=aa.checked?!0:null;this.lastExportTheme=K.value==fa?null:K.value;this.exportAnimatedGif({fps:parseInt(x.value),scale:da/100,border:parseInt(Q.value)||0,repeat:parseInt(V.value),transparent:aa.checked,theme:K.value,background:aa.checked?null:null!=this.editor.graph.background&&this.editor.graph.background!=mxConstants.NONE?this.editor.graph.background:"light-dark(#ffffff,"+Editor.darkColor+")"})}),null,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram");this.showDialog(c.container,360,null,!0,!0,null,null,null,null,!0)};EditorUi.prototype.exportAnimatedGif=function(c){if(this.spinner.spin(document.body,mxResources.get("exporting")))try{(new AnimatedGifExport(this)).doExport(c,mxUtils.bind(this,function(f){this.spinner.stop();if(null!=f){var k=this.getBaseFilename()+".gif";if("function"===typeof navigator.msSaveBlob)navigator.msSaveBlob(f,k);else{var q=document.createElement("a");q.href=URL.createObjectURL(f);q.download=k;document.body.appendChild(q);q.click();setTimeout(function(){document.body.removeChild(q);URL.revokeObjectURL(q.href)},0)}}}),mxUtils.bind(this,function(f){this.spinner.stop();this.handleError(f)}))}catch(f){this.spinner.stop(),this.handleError(f)}};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=-urlParams.save&&"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,f){c=new TextareaDialog(this,c,f,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280),!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,f,k,q,x,B){"text/xml"!=k||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||-/(\.html)$/i.test(f)||(f=f+"."+(null!=B?B:"drawio"));if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,k,q);else{var E=document.createElement("a");B=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof E.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var L=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);B=65==(L?parseInt(L[2],10):!1)?!1:B}if(B||this.isOffline()){E.href=-URL.createObjectURL(q?this.base64ToBlob(c,k):new Blob([c],{type:k}));B?E.download=f:E.setAttribute("target","_blank");document.body.appendChild(E);try{window.setTimeout(function(){URL.revokeObjectURL(E.href)},2E4),E.click(),E.parentNode.removeChild(E)}catch(Q){}}else this.createEchoRequest(c,f,k,q,x).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,k,q,x,B){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=k?"&mime="+k:"")+(null!=x?"&format="+-x:"")+(null!=B?"&base64="+B:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(q?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,k,q,x,B,E,L,Q){B=null!=B?B:!1;E=null!=E?E:"vsdx"!=x&&(!mxClient.IS_IOS||!navigator.standalone);var V=mxUtils.bind(this,function(fa,aa,da,ba){try{if("_blank"==aa)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(c,k,q);else if(null!=k&&"text/html"==k.substring(0,9)&&c.length<EmbedDialog.maxSize){var ha=new EmbedDialog(this,c,null,null,null,null,+urlParams.save&&"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,f){c=new TextareaDialog(this,c,f,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280),!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,f,k,q,x,C){"text/xml"!=k||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||+/(\.html)$/i.test(f)||(f=f+"."+(null!=C?C:"drawio"));if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,k,q);else{var E=document.createElement("a");C=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof E.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var L=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);C=65==(L?parseInt(L[2],10):!1)?!1:C}if(C||this.isOffline()){E.href=+URL.createObjectURL(q?this.base64ToBlob(c,k):new Blob([c],{type:k}));C?E.download=f:E.setAttribute("target","_blank");document.body.appendChild(E);try{window.setTimeout(function(){URL.revokeObjectURL(E.href)},2E4),E.click(),E.parentNode.removeChild(E)}catch(Q){}}else this.createEchoRequest(c,f,k,q,x).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,k,q,x,C){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=k?"&mime="+k:"")+(null!=x?"&format="++x:"")+(null!=C?"&base64="+C:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(q?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,f,k,q,x,C,E,L,Q){C=null!=C?C:!1;E=null!=E?E:"vsdx"!=x&&(!mxClient.IS_IOS||!navigator.standalone);var V=mxUtils.bind(this,function(fa,aa,da,ba){try{if("_blank"==aa)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(c,k,q);else if(null!=k&&"text/html"==k.substring(0,9)&&c.length<EmbedDialog.maxSize){var ha=new EmbedDialog(this,c,null,null,null,null,null,null,null,!0);this.showDialog(ha.container,450,270,!0,!0,null,!1,null,new mxRectangle(0,0,400,250));ha.init()}else null==window.open(URL.createObjectURL(new Blob([c],{type:"text/plain;charset=utf-8"})))&&mxUtils.popup(c,!0);else if(aa==App.MODE_DEVICE||"download"==aa)this.doSaveLocalFile(c,fa,k,q,null,L);else if(null!=fa&&0<fa.length){var qa=mxUtils.bind(this,function(ra){try{this.exportFile(c,fa,k,q,aa,ra)}catch(l){this.handleError(l)}});null!=ba?qa(ba):this.pickFolder(aa,qa)}}catch(ra){this.handleError(ra)}});-x=[];B||x.push(App.MODE_BROWSER);E||x.push("_blank");var K=new SaveDialog(this,f,mxUtils.bind(this,function(fa,aa,da){V(fa.value,aa,fa,da);this.hideDialog(null,null,K.container)}),x,c,k,q,Q);this.showDialog(K.container,420,null!=k?114:122,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));K.init()};EditorUi.prototype.openInNewWindow=function(c,f,k){null==window.open(URL.createObjectURL(k?this.base64ToBlob(c,f):new Blob([c],{type:f})))&&mxUtils.popup(c,!0)};var p=EditorUi.prototype.addChromelessToolbarItems;+x=[];C||x.push(App.MODE_BROWSER);E||x.push("_blank");var K=new SaveDialog(this,f,mxUtils.bind(this,function(fa,aa,da){V(fa.value,aa,fa,da);this.hideDialog(null,null,K.container)}),x,c,k,q,Q);this.showDialog(K.container,420,null!=k?114:122,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));K.init()};EditorUi.prototype.openInNewWindow=function(c,f,k){null==window.open(URL.createObjectURL(k?this.base64ToBlob(c,f):new Blob([c],{type:f})))&&mxUtils.popup(c,!0)};var p=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.isChromelessImageExportEnabled=function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=function(c){if(null!=urlParams.tags){var f=null;try{var k=urlParams.tags;try{k=decodeURIComponent(k)}catch(L){}f=JSON.parse(k)}catch(L){}if(null!=f){var q=this.editor.graph,x=mxUtils.bind(this,function(){var L=null!=this.currentPage?this.currentPage.getId():-0;L=f[L];q.hiddenTags=null!=L&&0<L.length?L:[];q.refresh()});this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){x();q.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize()}));this.editor.addListener("pageSelected",x)}this.tagsDialog=this.tagsComponent=null;var B=c(mxUtils.bind(this,function(L){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=this.tagsDialog}),!0),this.tagsComponent.div.getElementsByTagName("div")[0].style.position=+0;L=f[L];q.hiddenTags=null!=L&&0<L.length?L:[];q.refresh()});this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){x();q.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize()}));this.editor.addListener("pageSelected",x)}this.tagsDialog=this.tagsComponent=null;var C=c(mxUtils.bind(this,function(L){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=this.tagsDialog}),!0),this.tagsComponent.div.getElementsByTagName("div")[0].style.position="",mxUtils.setPrefixedStyle(this.tagsComponent.div.style,"borderRadius","5px"),this.tagsComponent.div.style.maxHeight="160px",this.tagsComponent.div.style.maxWidth="120px",this.tagsComponent.div.style.padding="4px",this.tagsComponent.div.style.overflow="auto",this.tagsComponent.div.style.height="auto",this.tagsComponent.div.style.position="fixed",this.tagsComponent.div.style.fontFamily=Editor.defaultHtmlFont,this.tagsComponent.div.style.backgroundColor="#000000",this.tagsComponent.div.style.color=-"#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null;else{this.tagsDialog=this.tagsComponent.div;mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var Q=B.getBoundingClientRect();this.tagsDialog.style.left=Q.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+-this.chromelessToolbar.offsetHeight+4+"px";Q=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=Q.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(L)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var L=this.editor.graph.getAllTags();B.style.display=0<L.length?"":"none"}))}p.apply(this,+"#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null;else{this.tagsDialog=this.tagsComponent.div;mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var Q=C.getBoundingClientRect();this.tagsDialog.style.left=Q.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)++this.chromelessToolbar.offsetHeight+4+"px";Q=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=Q.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(L)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var L=this.editor.graph.getAllTags();C.style.display=0<L.length?"":"none"}))}p.apply(this,arguments);this.editor.addListener("tagsDialogShown",mxUtils.bind(this,function(){null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));this.editor.addListener("layersDialogShown",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));this.editor.addListener("pageSelected",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));mxEvent.addListener(this.editor.graph.container,"click",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));if(this.editor.isExportToCanvas()&&this.isChromelessImageExportEnabled()&&"1"!=urlParams.noExport){this.exportDialog=null;var E=c(mxUtils.bind(this,function(L){var Q=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",Q);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)Q.apply(this);else{this.exportDialog=document.createElement("div");var V=E.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily=Editor.defaultHtmlFont;this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,80);this.exportDialog.style.left=V.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";V=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=V.zIndex;var K=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});K.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",Q);this.editor.exportToCanvas(mxUtils.bind(this,function(fa){K.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var aa=this.createImageDataUri(fa,null,"png");fa=document.createElement("img");fa.style.maxWidth="140px";fa.style.maxHeight="140px";fa.style.cursor="pointer";fa.style.backgroundColor="white";fa.setAttribute("title",mxResources.get("openInNewWindow"));fa.setAttribute("border","0");fa.setAttribute("src",aa);this.exportDialog.appendChild(fa);mxEvent.addListener(fa,"click",mxUtils.bind(this,function(){this.openInNewWindow(aa.substring(aa.indexOf(",")+1),"image/png",-!0);Q.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(fa){K.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(fa)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(L)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,k,q,x,B){if("1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){B=-this.embedMessageSource||window.opener||window.parent;var E=this.createLoadMessage("export");E.format=f;E.filename=c;E.data=x?"data:"+q+";base64,"+k:k;E.xml=this.getFileData(!0);B.postMessage(JSON.stringify(E),"*")}else this.isLocalFileSave()?this.saveLocalFile(k,c,q,x,f,B):this.saveRequest(c,f,mxUtils.bind(this,function(L,Q){return this.createEchoRequest(k,L,q,x,f,Q)}),k,x,q)};EditorUi.prototype.saveRequest=function(c,f,k,q,x,B,E){E=null!=E?E:!mxClient.IS_IOS||!navigator.standalone;var L=mxUtils.bind(this,-function(V,K,fa,aa){if("_blank"==K||null!=V&&0<V.length){var da=k("_blank"==K?null:V,K==App.MODE_DEVICE||"download"==K||null==K||"_blank"==K?"0":"1");null!=da&&(K==App.MODE_DEVICE||"download"==K||"_blank"==K?da.simulate(document,"_blank"):(fa=mxUtils.bind(this,function(ba){B=null!=B?B:"pdf"==f?"application/pdf":"image/"+f;if(null!=q)try{this.exportFile(q,V,B,!0,K,ba)}catch(ha){this.handleError(ha)}else this.spinner.spin(document.body,mxResources.get("saving"))&&da.send(mxUtils.bind(this,function(){this.spinner.stop();-if(200<=da.getStatus()&&299>=da.getStatus())try{this.exportFile(da.getText(),V,B,!0,K,ba)}catch(ha){this.handleError(ha)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(ha){this.spinner.stop();this.handleError(ha)}))}),null!=aa?fa(aa):this.pickFolder(K,fa)))}});x=[App.MODE_BROWSER];E||x.push("_blank");var Q=new SaveDialog(this,c,mxUtils.bind(this,function(V,K,fa){L(V.value,K,V,fa);this.hideDialog(null,null,Q.container)}),x,null,"application/pdf");this.showDialog(Q.container,-420,114,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));Q.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,f,k,q,x,B){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,f,k){f(null)};EditorUi.prototype.exportSvg=function(c,f,k,q,x,B,-E,L,Q,V,K,fa,aa,da,ba,ha){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(la){Editor.addRetryToError(la,mxUtils.bind(this,function(){this.exportSvg(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba,ha)}));this.handleError(la)})))try{var qa=this.editor.graph.isSelectionEmpty();k=null!=k?k:qa;var ra=f?null:this.editor.graph.background;ra==mxConstants.NONE&&(ra=null);null==ra&&0==f&&(ra=this.editor.graph.shapeBackgroundColor);var l=this.editor.graph.addForeignObjectWarning;-Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var t=mxUtils.lightDarkColorSupported,H=mxUtils.preferDarkColor;if("light"==K||"dark"==K)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==K;var J=Graph.addFont,R={};Graph.addFont=function(la,va,za,sa){J.call(this,la,va,za,R)};var T=this.editor.graph.createSvgImageExport(x,ba),Y=T.drawCellState;T.drawCellState=function(la,va){null!=la&&Graph.processFontStyle(la.style);Y.apply(this,arguments)};var Z=+!0);Q.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(fa){K.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(fa)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(L)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,k,q,x,C){if("1"==urlParams.embed&&"json"==urlParams.proto&&this.embedExportProtocol){C=+this.embedMessageSource||window.opener||window.parent;var E=this.createLoadMessage("export");E.format=f;E.filename=c;E.data=x?"data:"+q+";base64,"+k:k;E.xml=this.getFileData(!0);C.postMessage(JSON.stringify(E),"*")}else this.isLocalFileSave()?this.saveLocalFile(k,c,q,x,f,C):this.saveRequest(c,f,mxUtils.bind(this,function(L,Q){return this.createEchoRequest(k,L,q,x,f,Q)}),k,x,q)};EditorUi.prototype.saveRequest=function(c,f,k,q,x,C,E){E=null!=E?E:!mxClient.IS_IOS||!navigator.standalone;var L=mxUtils.bind(this,+function(V,K,fa,aa){if("_blank"==K||null!=V&&0<V.length){var da=k("_blank"==K?null:V,K==App.MODE_DEVICE||"download"==K||null==K||"_blank"==K?"0":"1");null!=da&&(K==App.MODE_DEVICE||"download"==K||"_blank"==K?da.simulate(document,"_blank"):(fa=mxUtils.bind(this,function(ba){C=null!=C?C:"pdf"==f?"application/pdf":"image/"+f;if(null!=q)try{this.exportFile(q,V,C,!0,K,ba)}catch(ha){this.handleError(ha)}else this.spinner.spin(document.body,mxResources.get("saving"))&&da.send(mxUtils.bind(this,function(){this.spinner.stop();+if(200<=da.getStatus()&&299>=da.getStatus())try{this.exportFile(da.getText(),V,C,!0,K,ba)}catch(ha){this.handleError(ha)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(ha){this.spinner.stop();this.handleError(ha)}))}),null!=aa?fa(aa):this.pickFolder(K,fa)))}});x=[App.MODE_BROWSER];E||x.push("_blank");var Q=new SaveDialog(this,c,mxUtils.bind(this,function(V,K,fa){L(V.value,K,V,fa);this.hideDialog(null,null,Q.container)}),x,null,"application/pdf");this.showDialog(Q.container,+420,114,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));Q.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,f,k,q,x,C){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,f,k){f(null)};EditorUi.prototype.exportSvg=function(c,f,k,q,x,C,+E,L,Q,V,K,fa,aa,da,ba,ha){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(la){Editor.addRetryToError(la,mxUtils.bind(this,function(){this.exportSvg(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba,ha)}));this.handleError(la)})))try{var qa=this.editor.graph.isSelectionEmpty();k=null!=k?k:qa;var ra=f?null:this.editor.graph.background;ra==mxConstants.NONE&&(ra=null);null==ra&&0==f&&(ra=this.editor.graph.shapeBackgroundColor);var l=this.editor.graph.addForeignObjectWarning;+Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var t=mxUtils.lightDarkColorSupported,H=mxUtils.preferDarkColor;if("light"==K||"dark"==K)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==K;var J=Graph.addFont,R={};Graph.addFont=function(la,ua,za,sa){J.call(this,la,ua,za,R)};var T=this.editor.graph.createSvgImageExport(x,ba),Y=T.drawCellState;T.drawCellState=function(la,ua){null!=la&&Graph.processFontStyle(la.style);Y.apply(this,arguments)};var Z=this.editor.graph.getSvg(ra,c,E,L,null,k,null,T,"blank"==V?"_blank":"self"==V?"_top":null,null,!aa,K,fa,null,null,null,ha);mxUtils.lightDarkColorSupported=t;mxUtils.preferDarkColor=H;this.editor.graph.addForeignObjectWarning=l;q&&this.editor.graph.addSvgShadow(Z);var ia=this.getBaseFilename()+(x?".drawio":"")+".svg";da=null!=da?da:mxUtils.bind(this,function(la){this.isLocalFileSave()||la.length<=MAX_REQUEST_SIZE?this.saveData(ia,"svg",la,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},-mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(la)}))});var ka=mxUtils.bind(this,function(la){this.spinner.stop();x&&la.setAttribute("content",this.getFileData(!0,null,null,null,k,Q,null,null,null,null,null,c,E));da(Graph.xmlDeclaration+"\n"+(x?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(la))});this.editor.graph.mathEnabled&&this.editor.addMathCss(Z);var X=mxUtils.bind(this,function(la){Editor.replaceSvgDataUris&&B&&EditorUi.embedSvgImages(la);Editor.foreignObjectImages&&-aa?this.replaceAlternateContent(la,K,ka):ka(la)}),ja=Graph.customFontElements;Graph.customFontElements=R;var na=mxUtils.bind(this,function(la){Graph.customFontElements=ja;Graph.addFont=J;B&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(la,X,this.thumbImageCache)):X(la)});aa?this.embedFonts(Z,na,!0):(this.editor.addFontCss(Z),na(Z))}catch(la){this.handleError(la)}};EditorUi.prototype.replaceAlternateContent=function(c,f,k){function q(fa,-aa,da,ba,ha){var qa=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");qa.setAttribute("x",aa);qa.setAttribute("y",da+.5);qa.setAttribute("width",ba.width);qa.setAttribute("height",ba.height);null==qa.setAttributeNS?qa.setAttribute("xlink:href",ha):qa.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",ha);fa.replaceChild(qa,fa.lastChild);L()}function x(){if(E<K.length)K[E++](x)}var B="";f=c.getElementsByTagName("style");for(var E=0;E<f.length;E++)B+=f[E].innerHTML;f=c.getElementsByTagName("switch");+mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(la)}))});var ja=mxUtils.bind(this,function(la){this.spinner.stop();x&&la.setAttribute("content",this.getFileData(!0,null,null,null,k,Q,null,null,null,null,null,c,E));da(Graph.xmlDeclaration+"\n"+(x?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(la))});this.editor.graph.mathEnabled&&this.editor.addMathCss(Z);var X=mxUtils.bind(this,function(la){Editor.replaceSvgDataUris&&C&&EditorUi.embedSvgImages(la);Editor.foreignObjectImages&&+aa?this.replaceAlternateContent(la,K,ja):ja(la)}),ka=Graph.customFontElements;Graph.customFontElements=R;var na=mxUtils.bind(this,function(la){Graph.customFontElements=ka;Graph.addFont=J;C&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(la,X,this.thumbImageCache)):X(la)});aa?this.embedFonts(Z,na,!0):(this.editor.addFontCss(Z),na(Z))}catch(la){this.handleError(la)}};EditorUi.prototype.replaceAlternateContent=function(c,f,k){function q(fa,+aa,da,ba,ha){var qa=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");qa.setAttribute("x",aa);qa.setAttribute("y",da+.5);qa.setAttribute("width",ba.width);qa.setAttribute("height",ba.height);null==qa.setAttributeNS?qa.setAttribute("xlink:href",ha):qa.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",ha);fa.replaceChild(qa,fa.lastChild);L()}function x(){if(E<K.length)K[E++](x)}var C="";f=c.getElementsByTagName("style");for(var E=0;E<f.length;E++)C+=f[E].innerHTML;f=c.getElementsByTagName("switch");counter=f.length;var L=mxUtils.bind(this,function(){counter--;0==counter&&k(c)}),Q={},V={},K=[];for(E=0;E<f.length;E++)mxUtils.bind(this,function(fa){var aa=fa.getElementsByTagName("div");if(0<aa.length)try{var da=aa[0].cloneNode(!0),ba=parseInt(da.style.marginLeft),ha=parseInt(da.style.paddingTop),qa=da.getElementsByTagName("div")[1],ra=aa=!1,l=da.style.alignItems,t=da.style.justifyContent;if(null!=da.style.writingMode){var H=da.style.writingMode;ra="vertical-"==H.substring(0,9);aa="-rl"==H.substring(H.length-3)}var J=!ra&&"1px"==da.style.width||ra&&"1px"==da.style.height;if(!ra&&"1px"==da.style.height||ra&&"1px"==da.style.width)da.style.alignItems=ra&&aa?"unsafe flex-end":"unsafe flex-start";J&&(da.style.justifyContent="unsafe flex-start");da.style.paddingTop="";da.style.marginLeft="";var R=da.outerHTML,T=Q[R];null==T&&(da.style.position="absolute",da.style.visibility="hidden",document.body.appendChild(da),H=1,H="1px"==da.style.width?qa.offsetWidth:parseInt(da.style.width),J=1,J="1px"==da.style.height?qa.offsetHeight:parseInt(da.style.height),document.body.removeChild(da),T=new mxRectangle(ba,ha,H,J),Q[R]=T);"1px"==da.style.height&&("unsafe center"==l?ha-=T.height/2:"unsafe flex-end"==l&&(ha-=T.height));if("1px"==da.style.width)if(!ra&&"unsafe center"==t||ra&&"unsafe center"==l)ba-=T.width/2;else if(!ra&&"unsafe flex-end"==t||ra&&(!aa&&"unsafe flex-end"==l||aa&&"unsafe flex-start"==l))ba-=T.width;T=new mxRectangle(ba,ha,T.width,T.height+parseInt(qa.style.fontSize)/4);K.push(mxUtils.bind(this,function(Y){var Z=-V[R];null==Z?Graph.htmlToPng(R,T.width,T.height,mxUtils.bind(this,function(ia){q(fa,ba,ha,T,ia);V[R]=ia;Y()}),B):(q(fa,ba,ha,T,Z),Y())}))}catch(Y){L()}else L()})(f[E]);0==counter&&k(c);E=0;x()};EditorUi.prototype.addRadiobox=function(c,f,k,q,x,B,E){return this.addCheckbox(c,k,q,x,B,E,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,k,q,x,B,E,L,Q){B=null!=B?B:!0;var V=document.createElement("input");V.style.marginRight="8px";V.setAttribute("type",E?"radio":"checkbox");E="geCheckbox-"+Editor.guid();-V.id=E;null!=L&&V.setAttribute("name",L);k&&(V.setAttribute("checked","checked"),V.defaultChecked=!0);q&&V.setAttribute("disabled","disabled");B&&(Q?(x=document.createElement("div"),x.className="geDialogCheckRow",x.appendChild(V),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",E),x.appendChild(k),c.appendChild(x),V.checkRow=x):(V.style.marginTop="16px",c.appendChild(V),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",E),c.appendChild(k),x||mxUtils.br(c)));-return V};EditorUi.prototype.addAdvancedSection=function(c,f){var k=document.createElement("div");k.className="geCollapsibleTitle";mxUtils.write(k,mxResources.get(f||"advanced"));var q=document.createElement("div");q.className="geCollapsibleContent geCollapsed";f=document.createElement("div");f.className="geDialogSection";q.appendChild(f);var x=function(B){if(B!==k.classList.contains("geExpanded")&&(k.classList.toggle("geExpanded"),q.classList.toggle("geCollapsed"),B=k.closest(".geDialog"),null!=-B)){var E=B.firstElementChild;null!=E&&(B.style.height="",B.style.height=E.scrollHeight+48+"px")}};mxEvent.addListener(k,"click",function(){x(!k.classList.contains("geExpanded"))});c.appendChild(k);c.appendChild(q);return{content:f,wrapper:q,expand:function(){x(!0)},collapse:function(){x(!1)},isExpanded:function(){return k.classList.contains("geExpanded")}}};EditorUi.prototype.addEditButton=function(c,f){var k=document.createElement("div");k.className="geDialogCheckRow";var q=document.createElement("span");-q.className="geDialogFormLabel";q.style.display="flex";q.style.alignItems="center";var x=this.addCheckbox(q,mxResources.get("edit")+":",!0,null,!0);x.style.marginTop="0px";k.appendChild(q);q=this.getCurrentFile();var B="";null!=q&&q.getMode()!=App.MODE_DEVICE&&q.getMode()!=App.MODE_BROWSER&&(B=window.location.href);var E=document.createElement("select");E.style.maxWidth="200px";E.className="geBtn";q=document.createElement("option");q.setAttribute("value","blank");mxUtils.write(q,mxResources.get("makeCopy"));-E.appendChild(q);var L=document.createElement("option");L.setAttribute("value","custom");mxUtils.write(L,mxResources.get("custom")+"...");E.appendChild(L);k.appendChild(E);c.appendChild(k);mxEvent.addListener(E,"change",mxUtils.bind(this,function(){if("custom"==E.value){var Q=new FilenameDialog(this,B,mxResources.get("ok"),function(V){null!=V?(B=V,L.setAttribute("title",V),E.setAttribute("title",V)):(E.value="blank",L.removeAttribute("title"),E.removeAttribute("title"))},mxResources.get("url"),null,-null,null,null,function(){E.value="blank"});this.showDialog(Q.container,300,80,!0,!1);Q.init()}else E.removeAttribute("title")}));mxEvent.addListener(x,"change",mxUtils.bind(this,function(){x.checked&&(null==f||f.checked)?E.removeAttribute("disabled"):E.setAttribute("disabled","disabled")}));return{getLink:function(){return x.checked?"blank"===E.value?"_blank":B:null},getEditInput:function(){return x},getEditSelect:function(){return E},getEditRow:function(){return k}}};EditorUi.prototype.addLinkSection=+V[R];null==Z?Graph.htmlToPng(R,T.width,T.height,mxUtils.bind(this,function(ia){q(fa,ba,ha,T,ia);V[R]=ia;Y()}),C):(q(fa,ba,ha,T,Z),Y())}))}catch(Y){L()}else L()})(f[E]);0==counter&&k(c);E=0;x()};EditorUi.prototype.addRadiobox=function(c,f,k,q,x,C,E){return this.addCheckbox(c,k,q,x,C,E,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,k,q,x,C,E,L,Q){C=null!=C?C:!0;var V=document.createElement("input");V.style.marginRight="8px";V.setAttribute("type",E?"radio":"checkbox");E="geCheckbox-"+Editor.guid();+V.id=E;null!=L&&V.setAttribute("name",L);k&&(V.setAttribute("checked","checked"),V.defaultChecked=!0);q&&V.setAttribute("disabled","disabled");C&&(Q?(x=document.createElement("div"),x.className="geDialogCheckRow",x.appendChild(V),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",E),x.appendChild(k),c.appendChild(x),V.checkRow=x):(V.style.marginTop="16px",c.appendChild(V),k=document.createElement("label"),mxUtils.write(k,f),k.setAttribute("for",E),c.appendChild(k),x||mxUtils.br(c)));+return V};EditorUi.prototype.addAdvancedSection=function(c,f){var k=document.createElement("div");k.className="geCollapsibleTitle";mxUtils.write(k,mxResources.get(f||"advanced"));var q=document.createElement("div");q.className="geCollapsibleContent geCollapsed";f=document.createElement("div");f.className="geDialogSection";q.appendChild(f);var x=function(C){if(C!==k.classList.contains("geExpanded")&&(k.classList.toggle("geExpanded"),q.classList.toggle("geCollapsed"),C=k.closest(".geDialog"),null!=+C)){var E=C.firstElementChild;null!=E&&(C.style.height="",C.style.height=E.scrollHeight+48+"px")}};mxEvent.addListener(k,"click",function(){x(!k.classList.contains("geExpanded"))});c.appendChild(k);c.appendChild(q);return{content:f,wrapper:q,expand:function(){x(!0)},collapse:function(){x(!1)},isExpanded:function(){return k.classList.contains("geExpanded")}}};EditorUi.prototype.addEditButton=function(c,f){var k=document.createElement("div");k.className="geDialogCheckRow";var q=document.createElement("span");+q.className="geDialogFormLabel";q.style.display="flex";q.style.alignItems="center";var x=this.addCheckbox(q,mxResources.get("edit")+":",!0,null,!0);x.style.marginTop="0px";k.appendChild(q);q=this.getCurrentFile();var C="";null!=q&&q.getMode()!=App.MODE_DEVICE&&q.getMode()!=App.MODE_BROWSER&&(C=window.location.href);var E=document.createElement("select");E.style.maxWidth="200px";E.className="geBtn";q=document.createElement("option");q.setAttribute("value","blank");mxUtils.write(q,mxResources.get("makeCopy"));+E.appendChild(q);var L=document.createElement("option");L.setAttribute("value","custom");mxUtils.write(L,mxResources.get("custom")+"...");E.appendChild(L);k.appendChild(E);c.appendChild(k);mxEvent.addListener(E,"change",mxUtils.bind(this,function(){if("custom"==E.value){var Q=new FilenameDialog(this,C,mxResources.get("ok"),function(V){null!=V?(C=V,L.setAttribute("title",V),E.setAttribute("title",V)):(E.value="blank",L.removeAttribute("title"),E.removeAttribute("title"))},mxResources.get("url"),null,+null,null,null,function(){E.value="blank"});this.showDialog(Q.container,300,80,!0,!1);Q.init()}else E.removeAttribute("title")}));mxEvent.addListener(x,"change",mxUtils.bind(this,function(){x.checked&&(null==f||f.checked)?E.removeAttribute("disabled"):E.setAttribute("disabled","disabled")}));return{getLink:function(){return x.checked?"blank"===E.value?"_blank":C:null},getEditInput:function(){return x},getEditSelect:function(){return E},getEditRow:function(){return k}}};EditorUi.prototype.addLinkSection=function(c,f){function k(){var Q=document.createElement("div");Q.style.width="100%";Q.style.height="100%";Q.style.boxSizing="border-box";null!=E&&E!=mxConstants.NONE?(Q.style.border="1px solid black",Q.style.backgroundColor=E):(Q.style.backgroundPosition="center center",Q.style.backgroundRepeat="no-repeat",Q.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");L.innerText="";L.appendChild(Q)}var q=document.createElement("div");q.className="geDialogFormRow";var x=document.createElement("span");-x.className="geDialogFormLabel";mxUtils.write(x,mxResources.get("links")+":");q.appendChild(x);var B=document.createElement("select");B.style.width="100px";B.style.padding="0px";B.style.marginRight="10px";B.className="geBtn";x=document.createElement("option");x.setAttribute("value","auto");mxUtils.write(x,mxResources.get("automatic"));B.appendChild(x);x=document.createElement("option");x.setAttribute("value","blank");mxUtils.write(x,mxResources.get("openInNewWindow"));B.appendChild(x);x=document.createElement("option");-x.setAttribute("value","self");mxUtils.write(x,mxResources.get("openInThisWindow"));B.appendChild(x);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),B.appendChild(f));q.appendChild(B);f=document.createElement("span");mxUtils.write(f,mxResources.get("borderColor")+":");q.appendChild(f);var E="#0000ff",L=null;L=mxUtils.button("",mxUtils.bind(this,function(Q){this.pickColor(E||"none",function(V){E=-V;k()});mxEvent.consume(Q)}));k();L.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";L.style.marginLeft="4px";L.style.height="22px";L.style.width="22px";L.style.position="relative";L.style.top="1px";L.className="geColorBtn";q.appendChild(L);c.appendChild(q);return{getColor:function(){return E},getTarget:function(){return B.value},focus:function(){B.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,k,q,x,B,E,L){B=null!=B?B:[];k&&(B.push("lightbox=1"),"auto"!=c&&B.push("target="+c),-null!=f&&f!=mxConstants.NONE&&B.push("highlight="+("#"==f.charAt(0)?f.substring(1):f)),null!=q&&0<q.length&&B.push("edit="+encodeURIComponent(q)),x&&B.push("layers=1"),E&&B.push("link-icons=1"),L&&B.push("tooltip-icons=1"),this.editor.graph.foldingEnabled&&B.push("nav=1"));return B};EditorUi.prototype.createLink=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba){var ha=this.getCurrentFile();Q=this.createUrlParameters(c,f,q,x,B,Q,da,ba);c=!0;null!=E?k="#U"+encodeURIComponent(E):L||null==ha||""==ha.getHash()?+x.className="geDialogFormLabel";mxUtils.write(x,mxResources.get("links")+":");q.appendChild(x);var C=document.createElement("select");C.style.width="100px";C.style.padding="0px";C.style.marginRight="10px";C.className="geBtn";x=document.createElement("option");x.setAttribute("value","auto");mxUtils.write(x,mxResources.get("automatic"));C.appendChild(x);x=document.createElement("option");x.setAttribute("value","blank");mxUtils.write(x,mxResources.get("openInNewWindow"));C.appendChild(x);x=document.createElement("option");+x.setAttribute("value","self");mxUtils.write(x,mxResources.get("openInThisWindow"));C.appendChild(x);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),C.appendChild(f));q.appendChild(C);f=document.createElement("span");mxUtils.write(f,mxResources.get("borderColor")+":");q.appendChild(f);var E="#0000ff",L=null;L=mxUtils.button("",mxUtils.bind(this,function(Q){this.pickColor(E||"none",function(V){E=+V;k()});mxEvent.consume(Q)}));k();L.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";L.style.marginLeft="4px";L.style.height="22px";L.style.width="22px";L.style.position="relative";L.style.top="1px";L.className="geColorBtn";q.appendChild(L);c.appendChild(q);return{getColor:function(){return E},getTarget:function(){return C.value},focus:function(){C.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,k,q,x,C,E,L){C=null!=C?C:[];k&&(C.push("lightbox=1"),"auto"!=c&&C.push("target="+c),+null!=f&&f!=mxConstants.NONE&&C.push("highlight="+("#"==f.charAt(0)?f.substring(1):f)),null!=q&&0<q.length&&C.push("edit="+encodeURIComponent(q)),x&&C.push("layers=1"),E&&C.push("link-icons=1"),L&&C.push("tooltip-icons=1"),this.editor.graph.foldingEnabled&&C.push("nav=1"));return C};EditorUi.prototype.createLink=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba){var ha=this.getCurrentFile();Q=this.createUrlParameters(c,f,q,x,C,Q,da,ba);c=!0;null!=E?k="#U"+encodeURIComponent(E):L||null==ha||""==ha.getHash()?k="#R"+encodeURIComponent(k?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(k="#"+ha.getHash(),c=!1);c&&null!=ha&&null!=ha.getTitle()&&ha.getTitle()!=this.defaultFilename&&Q.push("title="+encodeURIComponent(ha.getTitle()));V&&1<k.length&&(Q.push("open="+k.substring(1)),k="");V=1==K?this.currentPage:K;null!=V&&"function"===typeof V.getId&&Q.push("page-id="+V.getId());fa&&Q.push("transparent=1");null!=aa&&Q.push("dark="+aa);return(q&&-(null!=E||null!=ha&&ha.getMode()!=App.MODE_GITHUB&&ha.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<Q.length?"?"+Q.join("&"):"")+k};EditorUi.prototype.createHtml=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba,ha){this.getBasenames();var qa={};ba&&(qa["show-link-icons"]=!0);ha&&(qa["show-tooltip-icons"]=!0);""!=x&&x!=mxConstants.NONE&&(qa.highlight=+(null!=E||null!=ha&&ha.getMode()!=App.MODE_GITHUB&&ha.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<Q.length?"?"+Q.join("&"):"")+k};EditorUi.prototype.createHtml=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba,ha){this.getBasenames();var qa={};ba&&(qa["show-link-icons"]=!0);ha&&(qa["show-tooltip-icons"]=!0);""!=x&&x!=mxConstants.NONE&&(qa.highlight=x);"auto"!==q&&(qa.target=q);V||(qa.lightbox=!1);qa.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==k||(qa.zoom=k/100);k=[];E&&(k.push("pages"),qa.resize=!0,null!=this.pages&&null!=this.currentPage&&(qa.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(k.push("zoom"),qa.resize=!0);L&&k.push("layers");Q&&(k.push("tags"),da&&(f=this.getHiddenTagsMap(),null!=f&&(qa.hiddenTags=f)));null!=aa&&(qa["dark-mode"]=aa);0<k.length&&(V&&k.push("lightbox"),qa.toolbar=k.join(" "));null!=-K&&0<K.length&&(qa.edit=K);null!=c?qa.url=c:qa.xml=this.getFileData(!0,null,null,null,null,!E);B='<div class="mxgraph" style="'+(B?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(qa))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";fa(B,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":+K&&0<K.length&&(qa.edit=K);null!=c?qa.url=c:qa.xml=this.getFileData(!0,null,null,null,null,!E);C='<div class="mxgraph" style="'+(C?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(qa))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";fa(C,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.addPagesRow=function(c){var f=document.createElement("select");f.style.maxWidth="260px";var k=document.createElement("option");mxUtils.write(k,mxResources.get("allPages"));k.setAttribute("value","allPages");f.appendChild(k);k=document.createElement("option");mxUtils.write(k,mxResources.get("currentPage"));k.setAttribute("value","currentPage");f.appendChild(k);k=-null;if(null!=this.pages&&1<this.pages.length){k=document.createElement("div");k.className="geDialogFormRow";var q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("pages")+":");k.appendChild(q);k.appendChild(f);c.appendChild(k)}return{row:k,select:f}};EditorUi.prototype.showHtmlDialog=function(c,f,k,q){var x=document.createElement("div");x.style.whiteSpace="nowrap";var B=document.createElement("h3");mxUtils.write(B,mxResources.get("html"));x.appendChild(B);-var E=document.createElement("select");E.className="geBtn";E.style.margin="0 4px 8px 4px";E.style.width="calc(100% - 8px)";E.style.boxSizing="border-box";B=document.createElement("option");mxUtils.write(B,mxResources.get("includeCopyOfMyDiagram"));B.setAttribute("value","copy");E.appendChild(B);B=document.createElement("option");B.setAttribute("value","url");E.appendChild(B);null!=k?(mxUtils.write(B,mxResources.get("publicDiagramUrl")),B.setAttribute("title",k)):(mxUtils.write(B,mxResources.get("publicDiagramUrl")+-" ("+mxResources.get("diagramIsNotPublic")+")"),B.setAttribute("disabled","disabled"));x.appendChild(E);mxUtils.br(x);var L=this.getCurrentFile();if(null==k&&null!=L&&L.constructor==window.DriveFile){B=document.createElement("div");B.style.marginBottom="8px";var Q=document.createElement("a");Q.style.color="gray";Q.style.cursor="pointer";mxUtils.write(Q,mxResources.get("share"));B.appendChild(Q);mxEvent.addListener(Q,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(L.getId(),-L)}));x.appendChild(B)}B=document.createElement("div");B.className="geDialogSection";var V=this.addLinkSection(B),K=this.addPagesRow(B);Q=document.createElement("div");Q.className="geDialogCheckRow";var fa=document.createElement("input");fa.setAttribute("type","checkbox");fa.setAttribute("checked","checked");fa.defaultChecked=!0;fa.style.marginRight="8px";Q.appendChild(fa);var aa=document.createElement("label");mxUtils.write(aa,mxResources.get("zoom")+":");Q.appendChild(aa);var da=document.createElement("input");-da.setAttribute("type","text");da.style.width="60px";da.style.marginLeft="4px";da.value="100%";Q.appendChild(da);B.appendChild(Q);var ba=this.addCheckbox(B,mxResources.get("fit"),!0,null,null,null,null,null,!0),ha=this.addCheckbox(B,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);x.appendChild(B);B=this.addAdvancedSection(x).content;var qa=document.createElement("select");qa.style.maxWidth="260px";Q=document.createElement("option");Q.setAttribute("value","light");mxUtils.write(Q,mxResources.get("light"));+null;if(null!=this.pages&&1<this.pages.length){k=document.createElement("div");k.className="geDialogFormRow";var q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("pages")+":");k.appendChild(q);k.appendChild(f);c.appendChild(k)}return{row:k,select:f}};EditorUi.prototype.showHtmlDialog=function(c,f,k,q){var x=document.createElement("div");x.style.whiteSpace="nowrap";var C=document.createElement("h3");mxUtils.write(C,mxResources.get("html"));x.appendChild(C);+var E=document.createElement("select");E.className="geBtn";E.style.margin="0 4px 8px 4px";E.style.width="calc(100% - 8px)";E.style.boxSizing="border-box";C=document.createElement("option");mxUtils.write(C,mxResources.get("includeCopyOfMyDiagram"));C.setAttribute("value","copy");E.appendChild(C);C=document.createElement("option");C.setAttribute("value","url");E.appendChild(C);null!=k?(mxUtils.write(C,mxResources.get("publicDiagramUrl")),C.setAttribute("title",k)):(mxUtils.write(C,mxResources.get("publicDiagramUrl")++" ("+mxResources.get("diagramIsNotPublic")+")"),C.setAttribute("disabled","disabled"));x.appendChild(E);mxUtils.br(x);var L=this.getCurrentFile();if(null==k&&null!=L&&L.constructor==window.DriveFile){C=document.createElement("div");C.style.marginBottom="8px";var Q=document.createElement("a");Q.style.color="gray";Q.style.cursor="pointer";mxUtils.write(Q,mxResources.get("share"));C.appendChild(Q);mxEvent.addListener(Q,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(L.getId(),+L)}));x.appendChild(C)}C=document.createElement("div");C.className="geDialogSection";var V=this.addLinkSection(C),K=this.addPagesRow(C);Q=document.createElement("div");Q.className="geDialogCheckRow";var fa=document.createElement("input");fa.setAttribute("type","checkbox");fa.setAttribute("checked","checked");fa.defaultChecked=!0;fa.style.marginRight="8px";Q.appendChild(fa);var aa=document.createElement("label");mxUtils.write(aa,mxResources.get("zoom")+":");Q.appendChild(aa);var da=document.createElement("input");+da.setAttribute("type","text");da.style.width="60px";da.style.marginLeft="4px";da.value="100%";Q.appendChild(da);C.appendChild(Q);var ba=this.addCheckbox(C,mxResources.get("fit"),!0,null,null,null,null,null,!0),ha=this.addCheckbox(C,mxResources.get("lightbox"),!0,null,null,null,null,null,!0);x.appendChild(C);C=this.addAdvancedSection(x).content;var qa=document.createElement("select");qa.style.maxWidth="260px";Q=document.createElement("option");Q.setAttribute("value","light");mxUtils.write(Q,mxResources.get("light"));qa.appendChild(Q);Q=document.createElement("option");Q.setAttribute("value","dark");mxUtils.write(Q,mxResources.get("dark"));qa.appendChild(Q);Q=document.createElement("option");Q.setAttribute("value","auto");mxUtils.write(Q,mxResources.get("automatic"));Q.setAttribute("selected","selected");qa.appendChild(Q);Q=document.createElement("div");Q.className="geDialogFormRow";aa=document.createElement("span");aa.className="geDialogFormLabel";mxUtils.write(aa,mxResources.get("appearance")+":");Q.appendChild(aa);-Q.appendChild(qa);B.appendChild(Q);var ra=null;if(EditorUi.enableHtmlEditOption){ra=this.addEditButton(B,ha);var l=ra.getEditInput();mxEvent.addListener(ha,"change",function(){ha.checked?l.removeAttribute("disabled"):l.setAttribute("disabled","disabled");l.checked&&ha.checked?ra.getEditSelect().removeAttribute("disabled"):ra.getEditSelect().setAttribute("disabled","disabled")})}var t=this.addCheckbox(B,mxResources.get("layers"),!0,null,null,null,null,null,!0),H=this.addCheckbox(B,mxResources.get("tags"),-!0,null,null,null,null,null,!0),J=this.addCheckbox(B,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);J.checkRow.style.paddingLeft="24px";var R=this.addCheckbox(B,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),T=this.addCheckbox(B,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(H,"change",function(){H.checked?J.removeAttribute("disabled"):J.setAttribute("disabled","disabled")});mxEvent.addListener(ha,"change",function(){ha.checked?+Q.appendChild(qa);C.appendChild(Q);var ra=null;if(EditorUi.enableHtmlEditOption){ra=this.addEditButton(C,ha);var l=ra.getEditInput();mxEvent.addListener(ha,"change",function(){ha.checked?l.removeAttribute("disabled"):l.setAttribute("disabled","disabled");l.checked&&ha.checked?ra.getEditSelect().removeAttribute("disabled"):ra.getEditSelect().setAttribute("disabled","disabled")})}var t=this.addCheckbox(C,mxResources.get("layers"),!0,null,null,null,null,null,!0),H=this.addCheckbox(C,mxResources.get("tags"),+!0,null,null,null,null,null,!0),J=this.addCheckbox(C,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);J.checkRow.style.paddingLeft="24px";var R=this.addCheckbox(C,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),T=this.addCheckbox(C,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(H,"change",function(){H.checked?J.removeAttribute("disabled"):J.setAttribute("disabled","disabled")});mxEvent.addListener(ha,"change",function(){ha.checked?(R.removeAttribute("disabled"),T.removeAttribute("disabled")):(R.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled"))});c=new CustomDialog(this,x,mxUtils.bind(this,function(){q("url"==E.value?k:null,fa.checked,da.value,V.getTarget(),V.getColor(),ba.checked,null!=K.row&&"allPages"==K.select.value,t.checked,H.checked,ha.checked,null!=ra?ra.getLink():null,null!=qa?qa.value:null,H.checked&&J.checked,R.checked,T.checked)}),null,c,f);this.showDialog(c.container,360,null,!0,!0);E.focus()};-EditorUi.prototype.showPublishLinkDialog=function(c,f,k,q,x,B,E,L,Q,V,K,fa){var aa=document.createElement("div");aa.style.whiteSpace="nowrap";var da=document.createElement("h3");mxUtils.write(da,c||mxResources.get("publish"));aa.appendChild(da);var ba=document.createElement("select");ba.className="geBtn";ba.style.margin="0 4px 8px 4px";ba.style.width="calc(100% - 8px)";ba.style.boxSizing="border-box";x=null!=x?x:"https://www.drawio.com/docs/manual/export/publish-link/";c=document.createElement("option");+EditorUi.prototype.showPublishLinkDialog=function(c,f,k,q,x,C,E,L,Q,V,K,fa){var aa=document.createElement("div");aa.style.whiteSpace="nowrap";var da=document.createElement("h3");mxUtils.write(da,c||mxResources.get("publish"));aa.appendChild(da);var ba=document.createElement("select");ba.className="geBtn";ba.style.margin="0 4px 8px 4px";ba.style.width="calc(100% - 8px)";ba.style.boxSizing="border-box";x=null!=x?x:"https://www.drawio.com/docs/manual/export/publish-link/";c=document.createElement("option");mxUtils.write(c,mxResources.get("includeCopyOfMyDiagram"));c.setAttribute("value","copy");ba.appendChild(c);c=document.createElement("option");mxUtils.write(c,mxResources.get("authorizationRequired"));c.setAttribute("value","auth");ba.appendChild(c);null==L||""==L.getHash()||L.getMode()==App.MODE_DEVICE||L.getMode()==App.MODE_BROWSER?c.setAttribute("disabled","disabled"):ba.value="auth";L=document.createElement("option");L.setAttribute("value","public");ba.appendChild(L);null!=E?(mxUtils.write(L,mxResources.get("publicDiagramUrl")),L.setAttribute("title",E),ba.value="public"):(mxUtils.write(L,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),L.setAttribute("disabled","disabled"));aa.appendChild(ba);mxUtils.br(aa);E=document.createElement("div");E.className="geDialogSection";var ha=null,qa=null;if(null!=f||null!=k)f=document.createElement("div"),f.className="geDialogInlineFields",L=document.createElement("div"),L.className="geDialogInlineField",c=document.createElement("label"),mxUtils.write(c,mxResources.get("width")+":"),L.appendChild(c),ha=document.createElement("input"),ha.setAttribute("type","text"),ha.value="100%",L.appendChild(ha),f.appendChild(L),L=document.createElement("div"),L.className="geDialogInlineField",c=document.createElement("label"),mxUtils.write(c,mxResources.get("height")+":"),L.appendChild(c),qa=document.createElement("input"),qa.setAttribute("type","text"),qa.value=k+"px",L.appendChild(qa),f.appendChild(L),E.appendChild(f);var ra=this.addLinkSection(E,@@ -4179,225 +4182,225 @@ q),l=V?this.addCheckbox(E,mxResources.get("transparentBackground"),!1,null,null,":");k.appendChild(V);J=document.createElement("select");J.style.maxWidth="260px";for(V=0;V<this.pages.length;V++)fa=document.createElement("option"),mxUtils.write(fa,this.pages[V].getName()),fa.setAttribute("value",V),this.pages[V]==this.currentPage&&fa.setAttribute("selected","selected"),J.appendChild(fa);k.appendChild(J);E.appendChild(k);k=function(){"none"!=t.row.style.display&&"currentPage"==H.value?J.setAttribute("disabled","disabled"):J.removeAttribute("disabled")};mxEvent.addListener(H,"change",k);mxEvent.addListener(ba,"change",k);k()}var R=this.addCheckbox(E,mxResources.get("lightbox"),!0,null,null,!q,null,null,!0);q&&null!=R.checkRow&&(R.checkRow.style.display="none");aa.appendChild(E);q=this.addAdvancedSection(aa).content;var T=document.createElement("select");T.style.maxWidth="260px";k=document.createElement("option");k.setAttribute("value","0");mxUtils.write(k,mxResources.get("light"));T.appendChild(k);k=document.createElement("option");k.setAttribute("value","1");mxUtils.write(k,mxResources.get("dark"));T.appendChild(k);k=document.createElement("option");k.setAttribute("value","auto");mxUtils.write(k,mxResources.get("automatic"));k.setAttribute("selected","selected");T.appendChild(k);K&&(K=document.createElement("div"),K.className="geDialogFormRow",k=document.createElement("span"),k.className="geDialogFormLabel",mxUtils.write(k,mxResources.get("appearance")+":"),K.appendChild(k),K.appendChild(T),q.appendChild(K));var Y=this.addEditButton(q,R),Z=Y.getEditInput(),ia=this.addCheckbox(q,-mxResources.get("layers"),!0,null,null,null,null,null,!0),ka=this.addCheckbox(q,mxResources.get("tags"),!0,null,null,null,null,null,!0),X=this.addCheckbox(q,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);X.checkRow.style.paddingLeft="24px";var ja=this.addCheckbox(q,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),na=this.addCheckbox(q,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(ka,"change",function(){ka.checked?X.removeAttribute("disabled"):-X.setAttribute("disabled","disabled")});mxEvent.addListener(R,"change",function(){R.checked?(ia.removeAttribute("disabled"),Z.removeAttribute("disabled"),ka.removeAttribute("disabled"),ja.removeAttribute("disabled"),na.removeAttribute("disabled"),ka.checked&&X.removeAttribute("disabled")):(ia.setAttribute("disabled","disabled"),Z.setAttribute("disabled","disabled"),ka.setAttribute("disabled","disabled"),X.setAttribute("disabled","disabled"),ja.setAttribute("disabled","disabled"),na.setAttribute("disabled",-"disabled"));Z.checked&&R.checked?Y.getEditSelect().removeAttribute("disabled"):Y.getEditSelect().setAttribute("disabled","disabled")});x=new CustomDialog(this,aa,mxUtils.bind(this,function(){Q(ra.getTarget(),ra.getColor(),null==J||0>=J.selectedIndex||null!=J.getAttribute("disabled")?null:this.pages[J.selectedIndex],R.checked,Y.getLink(),ia.checked,null!=ha?ha.value:null,null!=qa?qa.value:null,ka.checked,ba.value,null!=l?l.checked:!1,T.value,"allPages"==H.value,ka.checked&&X.checked,ja.checked,na.checked)}),-null,mxResources.get("create"),x,B);this.showDialog(x.container,360,null,!0,!0);null!=ha?(ha.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ha.select():document.execCommand("selectAll",!1,null)):ba.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,k,q,x){var B=document.createElement("div");B.style.whiteSpace="nowrap";var E=document.createElement("h3");mxUtils.write(E,mxResources.get("image"));B.appendChild(E);if(x){E=document.createElement("div");E.className="geDialogSection";+mxResources.get("layers"),!0,null,null,null,null,null,!0),ja=this.addCheckbox(q,mxResources.get("tags"),!0,null,null,null,null,null,!0),X=this.addCheckbox(q,mxResources.get("useCurrentSettings"),!0,null,null,null,null,null,!0);X.checkRow.style.paddingLeft="24px";var ka=this.addCheckbox(q,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),na=this.addCheckbox(q,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(ja,"change",function(){ja.checked?X.removeAttribute("disabled"):+X.setAttribute("disabled","disabled")});mxEvent.addListener(R,"change",function(){R.checked?(ia.removeAttribute("disabled"),Z.removeAttribute("disabled"),ja.removeAttribute("disabled"),ka.removeAttribute("disabled"),na.removeAttribute("disabled"),ja.checked&&X.removeAttribute("disabled")):(ia.setAttribute("disabled","disabled"),Z.setAttribute("disabled","disabled"),ja.setAttribute("disabled","disabled"),X.setAttribute("disabled","disabled"),ka.setAttribute("disabled","disabled"),na.setAttribute("disabled",+"disabled"));Z.checked&&R.checked?Y.getEditSelect().removeAttribute("disabled"):Y.getEditSelect().setAttribute("disabled","disabled")});x=new CustomDialog(this,aa,mxUtils.bind(this,function(){Q(ra.getTarget(),ra.getColor(),null==J||0>=J.selectedIndex||null!=J.getAttribute("disabled")?null:this.pages[J.selectedIndex],R.checked,Y.getLink(),ia.checked,null!=ha?ha.value:null,null!=qa?qa.value:null,ja.checked,ba.value,null!=l?l.checked:!1,T.value,"allPages"==H.value,ja.checked&&X.checked,ka.checked,na.checked)}),+null,mxResources.get("create"),x,C);this.showDialog(x.container,360,null,!0,!0);null!=ha?(ha.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ha.select():document.execCommand("selectAll",!1,null)):ba.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,k,q,x){var C=document.createElement("div");C.style.whiteSpace="nowrap";var E=document.createElement("h3");mxUtils.write(E,mxResources.get("image"));C.appendChild(E);if(x){E=document.createElement("div");E.className="geDialogSection";var L=document.createElement("div");L.className="geDialogFormRow";var Q=document.createElement("span");Q.className="geDialogFormLabel";mxUtils.write(Q,mxResources.get("zoom")+":");L.appendChild(Q);var V=document.createElement("input");V.setAttribute("type","text");V.value=this.lastExportZoom||"100%";L.appendChild(V);E.appendChild(L);L=document.createElement("div");L.className="geDialogFormRow";Q=document.createElement("span");Q.className="geDialogFormLabel";mxUtils.write(Q,mxResources.get("borderWidth")+-":");L.appendChild(Q);var K=document.createElement("input");K.setAttribute("type","text");K.value=this.lastExportBorder||"0";L.appendChild(K);E.appendChild(L);B.appendChild(E)}E=document.createElement("div");E.className="geDialogSection";var fa=this.addCheckbox(E,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!this.editor.graph.isSelectionEmpty(),this.editor.graph.isSelectionEmpty(),null,null,null,null,!0),aa=q?null:this.addCheckbox(E,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram,-null,null,null,null,null,!0);L=this.editor.graph;var da=L.background==mxConstants.NONE||null==L.background,ba=q?null:this.addCheckbox(E,mxResources.get("transparentBackground"),null!=this.lastExportTransparent?this.lastExportTransparent:da,null,null,null,null,null,!0);B.appendChild(E);c=new CustomDialog(this,B,mxUtils.bind(this,function(){this.lastExportSelectionOnly=fa.checked;x&&(this.lastExportZoom=V.value,this.lastExportBorder=K.value);null!=ba&&(this.lastExportTransparent=ba.checked==da?null:-ba.checked);var ha=parseInt(V.value)/100||1,qa=parseInt(K.value)||0;k(!fa.checked,null!=aa?aa.checked:!1,null!=ba?ba.checked:!1,ha,qa)}),null,c,f);this.showDialog(c.container,340,null,!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,k,q,x,B,E,L,Q){function V(){return Math.max(0,parseFloat(ha.value)||100)/100}function K(){var Ta=V();za.value=Math.floor(na*Ta);sa.value=Math.floor(la*Ta)}E=null!=E?E:Editor.defaultIncludeDiagram;var fa=document.createElement("div");fa.style.whiteSpace="nowrap";+":");L.appendChild(Q);var K=document.createElement("input");K.setAttribute("type","text");K.value=this.lastExportBorder||"0";L.appendChild(K);E.appendChild(L);C.appendChild(E)}E=document.createElement("div");E.className="geDialogSection";var fa=this.addCheckbox(E,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!this.editor.graph.isSelectionEmpty(),this.editor.graph.isSelectionEmpty(),null,null,null,null,!0),aa=q?null:this.addCheckbox(E,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram,+null,null,null,null,null,!0);L=this.editor.graph;var da=L.background==mxConstants.NONE||null==L.background,ba=q?null:this.addCheckbox(E,mxResources.get("transparentBackground"),null!=this.lastExportTransparent?this.lastExportTransparent:da,null,null,null,null,null,!0);C.appendChild(E);c=new CustomDialog(this,C,mxUtils.bind(this,function(){this.lastExportSelectionOnly=fa.checked;x&&(this.lastExportZoom=V.value,this.lastExportBorder=K.value);null!=ba&&(this.lastExportTransparent=ba.checked==da?null:+ba.checked);var ha=parseInt(V.value)/100||1,qa=parseInt(K.value)||0;k(!fa.checked,null!=aa?aa.checked:!1,null!=ba?ba.checked:!1,ha,qa)}),null,c,f);this.showDialog(c.container,340,null,!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,k,q,x,C,E,L,Q){function V(){return Math.max(0,parseFloat(ha.value)||100)/100}function K(){var Ta=V();za.value=Math.floor(na*Ta);sa.value=Math.floor(la*Ta)}E=null!=E?E:Editor.defaultIncludeDiagram;var fa=document.createElement("div");fa.style.whiteSpace="nowrap";var aa=this.editor.graph,da=document.createElement("h3");mxUtils.write(da,c);fa.appendChild(da);c=document.createElement("div");c.className="geDialogSection";da=document.createElement("div");da.className="geDialogFormRow";var ba=document.createElement("span");ba.className="geDialogFormLabel";mxUtils.write(ba,mxResources.get("zoom")+":");da.appendChild(ba);var ha=document.createElement("input");ha.setAttribute("type","text");ha.value=this.lastExportZoom||"100%";da.appendChild(ha);c.appendChild(da);fa.appendChild(c);c=document.createElement("div");c.className="geDialogSection";var qa=this.addCheckbox(c,mxResources.get("selectionOnly"),this.lastExportSelectionOnly&&!aa.isSelectionEmpty(),aa.isSelectionEmpty(),null,null,null,null,!0),ra=document.createElement("input");ra.setAttribute("disabled","disabled");ra.setAttribute("type","checkbox");var l=document.createElement("select");l.style.marginLeft="8px";var t=["selectionOnly","diagram","page"];da={};for(ba=0;ba<t.length;ba++)if(!aa.isSelectionEmpty()||-"selectionOnly"!=t[ba]){var H=document.createElement("option");mxUtils.write(H,mxResources.get(t[ba]));H.setAttribute("value",t[ba]);l.appendChild(H);da[t[ba]]=H}Q?(ba=document.createElement("div"),ba.className="geDialogFormRow",B=document.createElement("span"),B.className="geDialogFormLabel",mxUtils.write(B,mxResources.get("size")+":"),ba.appendChild(B),l.style.marginLeft="0",ba.appendChild(l),c.appendChild(ba),mxEvent.addListener(l,"change",function(){"selectionOnly"==l.value&&(qa.checked=!0)})):-B&&(B=document.createElement("div"),B.className="geDialogCheckRow",B.appendChild(ra),ba=document.createElement("label"),mxUtils.write(ba,mxResources.get("crop")),B.appendChild(ba),c.appendChild(B),mxEvent.addListener(qa,"change",function(){qa.checked?ra.removeAttribute("disabled"):ra.setAttribute("disabled","disabled")}));aa.isSelectionEmpty()?Q&&null!=qa.checkRow&&null!=qa.checkRow.parentNode&&qa.checkRow.parentNode.removeChild(qa.checkRow):(l.value=this.lastExportSelectionOnly?"selectionOnly":"diagram",+"selectionOnly"!=t[ba]){var H=document.createElement("option");mxUtils.write(H,mxResources.get(t[ba]));H.setAttribute("value",t[ba]);l.appendChild(H);da[t[ba]]=H}Q?(ba=document.createElement("div"),ba.className="geDialogFormRow",C=document.createElement("span"),C.className="geDialogFormLabel",mxUtils.write(C,mxResources.get("size")+":"),ba.appendChild(C),l.style.marginLeft="0",ba.appendChild(l),c.appendChild(ba),mxEvent.addListener(l,"change",function(){"selectionOnly"==l.value&&(qa.checked=!0)})):+C&&(C=document.createElement("div"),C.className="geDialogCheckRow",C.appendChild(ra),ba=document.createElement("label"),mxUtils.write(ba,mxResources.get("crop")),C.appendChild(ba),c.appendChild(C),mxEvent.addListener(qa,"change",function(){qa.checked?ra.removeAttribute("disabled"):ra.setAttribute("disabled","disabled")}));aa.isSelectionEmpty()?Q&&null!=qa.checkRow&&null!=qa.checkRow.parentNode&&qa.checkRow.parentNode.removeChild(qa.checkRow):(l.value=this.lastExportSelectionOnly?"selectionOnly":"diagram",ra.setAttribute("checked","checked"),ra.defaultChecked=!0,mxEvent.addListener(qa,"change",function(){l.value=qa.checked?"selectionOnly":"diagram"}));var J=!aa.isSelectionEmpty()&&this.lastExportSelectionOnly?"selectionOnly":"diagram";Q&&null!=this.lastExportType&&null!=da[this.lastExportType]&&(l.value=this.lastExportType,"selectionOnly"==this.lastExportType&&(qa.checked=!0));var R="jpeg"!=L&&"webp"!=L,T=this.addCheckbox(c,mxResources.get("transparentBackground"),R&&null!=this.lastExportTransparent?-this.lastExportTransparent:!1,null,null,R,null,null,!0);fa.appendChild(c);c=document.createElement("div");c.className="geDialogSection";da=!1;B=null!=this.pages?this.pages.length:1;var Y=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram")+(1<B?":":""),E,null,null,"jpeg"!=L&&"webp"!=L,null,null,!0);"jpeg"!=L&&"webp"!=L&&(da=!0);var Z=document.createElement("select");Z.style.maxWidth="260px";if("png"==L||"svg"==L)E=function(){Y.checked?Z.removeAttribute("disabled"):Z.setAttribute("disabled",-"disabled")},ba=document.createElement("option"),ba.setAttribute("value","allPages"),mxUtils.write(ba,mxResources.get("allPages")),Z.appendChild(ba),ba=document.createElement("option"),ba.setAttribute("value","currentPage"),mxUtils.write(ba,mxResources.get("currentPage")),Z.appendChild(ba),1<B&&(B=document.createElement("div"),B.style.paddingLeft="24px",B.appendChild(Z),c.appendChild(B)),null!=this.lastEmbedInclude&&(Z.value=this.lastEmbedInclude),mxEvent.addListener(Y,"change",E),E();var ia=document.createElement("input");-ia.setAttribute("type","checkbox");ia.id="geCheckbox-"+Editor.guid();var ka=document.createElement("input");ka.setAttribute("type","checkbox");ka.id="geCheckbox-"+Editor.guid();var X=document.createElement("input");X.setAttribute("type","checkbox");X.id="geCheckbox-"+Editor.guid();var ja=document.createElement("select");ja.style.maxWidth="260px";E=document.createElement("option");E.setAttribute("value","auto");mxUtils.write(E,mxResources.get("automatic"));ja.appendChild(E);E=document.createElement("option");-E.setAttribute("value","blank");mxUtils.write(E,mxResources.get("openInNewWindow"));ja.appendChild(E);E=document.createElement("option");E.setAttribute("value","self");mxUtils.write(E,mxResources.get("openInThisWindow"));ja.appendChild(E);"svg"==L&&null!=this.lastExportLinkTarget&&(ja.value=this.lastExportLinkTarget,0>ja.selectedIndex&&(ja.value="auto"));B=document.createElement("div");mxUtils.write(B,mxResources.get("LinksLost"));B.style.margin="7px";B.style.display="none";da&&fa.appendChild(c);-E=this.addAdvancedSection(fa).content;c=aa.getGraphBounds();da=aa.view.scale;var na=Math.max(1,Math.ceil(c.width/da)),la=Math.max(1,Math.ceil(c.height/da)),va=!1;ba=document.createElement("div");ba.className="geDialogInlineFields";c=document.createElement("div");c.className="geDialogInlineField";da=document.createElement("label");mxUtils.write(da,mxResources.get("width")+":");c.appendChild(da);var za=document.createElement("input");za.setAttribute("type","number");za.value=Math.floor(na*V());c.appendChild(za);-ba.appendChild(c);c=document.createElement("div");c.className="geDialogInlineField";da=document.createElement("label");mxUtils.write(da,mxResources.get("height")+":");c.appendChild(da);var sa=document.createElement("input");sa.setAttribute("type","number");sa.value=Math.floor(la*V());c.appendChild(sa);ba.appendChild(c);E.appendChild(ba);mxEvent.addListener(ha,"change",function(){va=!0;ha.value=parseFloat((100*V()).toFixed(2))+"%";K()});mxEvent.addListener(za,"change",function(){var Ta=parseInt(za.value)/+this.lastExportTransparent:!1,null,null,R,null,null,!0);fa.appendChild(c);c=document.createElement("div");c.className="geDialogSection";da=!1;C=null!=this.pages?this.pages.length:1;var Y=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram")+(1<C?":":""),E,null,null,"jpeg"!=L&&"webp"!=L,null,null,!0);"jpeg"!=L&&"webp"!=L&&(da=!0);var Z=document.createElement("select");Z.style.maxWidth="260px";if("png"==L||"svg"==L)E=function(){Y.checked?Z.removeAttribute("disabled"):Z.setAttribute("disabled",+"disabled")},ba=document.createElement("option"),ba.setAttribute("value","allPages"),mxUtils.write(ba,mxResources.get("allPages")),Z.appendChild(ba),ba=document.createElement("option"),ba.setAttribute("value","currentPage"),mxUtils.write(ba,mxResources.get("currentPage")),Z.appendChild(ba),1<C&&(C=document.createElement("div"),C.style.paddingLeft="24px",C.appendChild(Z),c.appendChild(C)),null!=this.lastEmbedInclude&&(Z.value=this.lastEmbedInclude),mxEvent.addListener(Y,"change",E),E();var ia=document.createElement("input");+ia.setAttribute("type","checkbox");ia.id="geCheckbox-"+Editor.guid();var ja=document.createElement("input");ja.setAttribute("type","checkbox");ja.id="geCheckbox-"+Editor.guid();var X=document.createElement("input");X.setAttribute("type","checkbox");X.id="geCheckbox-"+Editor.guid();var ka=document.createElement("select");ka.style.maxWidth="260px";E=document.createElement("option");E.setAttribute("value","auto");mxUtils.write(E,mxResources.get("automatic"));ka.appendChild(E);E=document.createElement("option");+E.setAttribute("value","blank");mxUtils.write(E,mxResources.get("openInNewWindow"));ka.appendChild(E);E=document.createElement("option");E.setAttribute("value","self");mxUtils.write(E,mxResources.get("openInThisWindow"));ka.appendChild(E);"svg"==L&&null!=this.lastExportLinkTarget&&(ka.value=this.lastExportLinkTarget,0>ka.selectedIndex&&(ka.value="auto"));C=document.createElement("div");mxUtils.write(C,mxResources.get("LinksLost"));C.style.margin="7px";C.style.display="none";da&&fa.appendChild(c);+E=this.addAdvancedSection(fa).content;c=aa.getGraphBounds();da=aa.view.scale;var na=Math.max(1,Math.ceil(c.width/da)),la=Math.max(1,Math.ceil(c.height/da)),ua=!1;ba=document.createElement("div");ba.className="geDialogInlineFields";c=document.createElement("div");c.className="geDialogInlineField";da=document.createElement("label");mxUtils.write(da,mxResources.get("width")+":");c.appendChild(da);var za=document.createElement("input");za.setAttribute("type","number");za.value=Math.floor(na*V());c.appendChild(za);+ba.appendChild(c);c=document.createElement("div");c.className="geDialogInlineField";da=document.createElement("label");mxUtils.write(da,mxResources.get("height")+":");c.appendChild(da);var sa=document.createElement("input");sa.setAttribute("type","number");sa.value=Math.floor(la*V());c.appendChild(sa);ba.appendChild(c);E.appendChild(ba);mxEvent.addListener(ha,"change",function(){ua=!0;ha.value=parseFloat((100*V()).toFixed(2))+"%";K()});mxEvent.addListener(za,"change",function(){var Ta=parseInt(za.value)/na;0<Ta&&(ha.value=parseFloat((100*Ta).toFixed(2))+"%",sa.value=Math.floor(la*Ta))});mxEvent.addListener(sa,"change",function(){var Ta=parseInt(sa.value)/la;0<Ta&&(ha.value=parseFloat((100*Ta).toFixed(2))+"%",za.value=Math.floor(na*Ta))});var wa=document.createElement("select"),Ca=document.createElement("input");if("png"==L){c=["100","200","300","400"];for(ba=0;ba<c.length;ba++)da=document.createElement("option"),da.setAttribute("value",c[ba]),mxUtils.write(da,c[ba]+"dpi"),wa.appendChild(da);c=document.createElement("option");c.setAttribute("value","custom");mxUtils.write(c,mxResources.get("custom"));wa.appendChild(c);Ca.setAttribute("type","number");Ca.setAttribute("value","100");Ca.setAttribute("min","50");Ca.setAttribute("step","50");Ca.style.display="none";c=document.createElement("div");c.className="geDialogFormRow";da=document.createElement("span");da.className="geDialogFormLabel";mxUtils.write(da,mxResources.get("dpi")+":");c.appendChild(da);c.appendChild(wa);c.appendChild(Ca);E.appendChild(c);null!=this.lastExportDpi&&-(Ca.value=this.lastExportDpi,wa.value=this.lastExportDpi,0>wa.selectedIndex&&(wa.value="custom",wa.style.display="none",Ca.style.display=""));mxEvent.addListener(wa,"change",function(){"custom"==wa.value?(wa.style.display="none",Ca.style.display="",Ca.focus()):(Ca.value=wa.value,va||(ha.value=wa.value+"%",K()))});mxEvent.addListener(Ca,"change",function(){var Ta=parseInt(Ca.value);isNaN(Ta)||0>=Ta?Ca.style.backgroundColor="red":(Ca.style.backgroundColor="",va||(ha.value=Ta+"%",K()))})}c=document.createElement("div");+(Ca.value=this.lastExportDpi,wa.value=this.lastExportDpi,0>wa.selectedIndex&&(wa.value="custom",wa.style.display="none",Ca.style.display=""));mxEvent.addListener(wa,"change",function(){"custom"==wa.value?(wa.style.display="none",Ca.style.display="",Ca.focus()):(Ca.value=wa.value,ua||(ha.value=wa.value+"%",K()))});mxEvent.addListener(Ca,"change",function(){var Ta=parseInt(Ca.value);isNaN(Ta)||0>=Ta?Ca.style.backgroundColor="red":(Ca.style.backgroundColor="",ua||(ha.value=Ta+"%",K()))})}c=document.createElement("div");c.className="geDialogFormRow";da=document.createElement("span");da.className="geDialogFormLabel";mxUtils.write(da,mxResources.get("borderWidth")+":");c.appendChild(da);var Fa=document.createElement("input");Fa.setAttribute("type","text");Fa.value=this.lastExportBorder||"0";c.appendChild(Fa);E.appendChild(c);var Ha=document.createElement("select");Ha.style.maxWidth="260px";c=document.createElement("option");c.setAttribute("value","light");mxUtils.write(c,mxResources.get("light"));Ha.appendChild(c);c=document.createElement("option");c.setAttribute("value","dark");mxUtils.write(c,mxResources.get("dark"));Ha.appendChild(c);var Na=Editor.isDarkMode()?"dark":"light";"svg"==L&&mxUtils.lightDarkColorSupported&&(c=document.createElement("option"),c.setAttribute("value","auto"),mxUtils.write(c,mxResources.get("automatic")),Ha.appendChild(c),Na="auto");Ha.value=null!=this.lastExportTheme?this.lastExportTheme:Na;0>Ha.selectedIndex&&(Ha.value=Na);c=document.createElement("div");c.className="geDialogFormRow";-da=document.createElement("span");da.className="geDialogFormLabel";mxUtils.write(da,mxResources.get("appearance")+":");c.appendChild(da);c.appendChild(Ha);E.appendChild(c);"svg"==L&&(c=document.createElement("div"),c.className="geDialogFormRow",da=document.createElement("span"),da.className="geDialogFormLabel",mxUtils.write(da,mxResources.get("links")+":"),c.appendChild(da),c.appendChild(ja),E.appendChild(c),E.appendChild(B));var La=1==aa.shadowVisible,Da=this.addCheckbox(E,mxResources.get("shadow"),-null!=this.lastExportShadow?this.lastExportShadow:La,null,null,null,null,null,!0),Sa=null,Oa="svg"!=L&&(this.isOffline()||!Editor.canvasSupported);if("png"==L||"jpeg"==L||"webp"==L||"svg"==L)Sa=this.addCheckbox(E,mxResources.get("grid"),Oa||null==this.lastExportGrid?!1:this.lastExportGrid,Oa,!1,!0,null,null,!0);f&&(ia.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,B=document.createElement("div"),B.className="geDialogCheckRow",B.appendChild(ia),aa=document.createElement("label"),mxUtils.write(aa,-mxResources.get("embedImages")),aa.setAttribute("for",ia.id),B.appendChild(aa),E.appendChild(B),ka.checked=null!=this.lastEmbedFonts?this.lastEmbedFonts:Editor.embedSvgFonts,B=document.createElement("div"),B.className="geDialogCheckRow",B.appendChild(ka),aa=document.createElement("label"),mxUtils.write(aa,mxResources.get("embedFonts")),aa.setAttribute("for",ka.id),B.appendChild(aa),E.appendChild(B),X.checked=null!=this.lastEmbedCellMetadata?this.lastEmbedCellMetadata:!1,B=document.createElement("div"),-B.className="geDialogCheckRow",B.appendChild(X),aa=document.createElement("label"),mxUtils.write(aa,mxResources.get("embedCellMetadata")),aa.setAttribute("for",X.id),B.appendChild(aa),E.appendChild(B));k=new CustomDialog(this,fa,mxUtils.bind(this,function(){this.lastExportSelectionOnly=qa.checked;this.lastExportBorder=Fa.value;this.lastExportZoom=ha.value;R&&(this.lastExportTransparent=0==T.checked?null:T.checked);this.lastExportTheme=Ha.value==Na?null:Ha.value;this.lastExportShadow=Da.checked==La?-null:Da.checked;null==Sa||Oa||(this.lastExportGrid=Sa.checked?!0:null);"svg"==L&&(this.lastExportLinkTarget="auto"==ja.value?null:ja.value);if("png"==L){var Ta=parseInt(Ca.value);this.lastExportDpi=!isNaN(Ta)&&0<Ta&&100!=Ta?Ta:null}Q&&(this.lastExportType=l.value==J?null:l.value);f&&(this.lastEmbedImages=ia.checked,this.lastEmbedFonts=ka.checked,this.lastEmbedCellMetadata=X.checked);if("png"==L||"svg"==L)this.lastEmbedInclude=Z.value;null!=x&&x(ha.value,T.checked,!qa.checked,Da.checked,Y.checked,-ia.checked&&f,Fa.value,ra.checked,("png"==L||"svg"==L)&&"currentPage"==Z.value,ja.value,null!=Sa?Sa.checked:null,null!=Ha?Ha.value:null,l.value,ka.checked,X.checked&&f,"png"==L&&0<parseInt(Ca.value)&&100!=parseInt(Ca.value)?parseInt(Ca.value):null)}),null,k,q);this.showDialog(k.container,360,null,!0,!0,null,null,null,null,!0);ha.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ha.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,-f,k,q,x,B,E){var L=document.createElement("div"),Q=this.editor.graph;if(null!=f){var V=document.createElement("h3");mxUtils.write(V,f);L.appendChild(V)}f=document.createElement("div");f.className="geDialogSection";var K=E?this.addPagesRow(f):null,fa=this.addCheckbox(f,mxResources.get("fit"),!0,null,null,null,null,null,!0),aa=this.addCheckbox(f,mxResources.get("shadow"),Q.shadowVisible&&q,!q,null,null,null,null,!0),da=this.addCheckbox(f,k,!1,null,null,null,null,null,!0),ba=this.addCheckbox(f,mxResources.get("lightbox"),-!0,null,null,null,null,null,!0);L.appendChild(f);k=this.addAdvancedSection(L).content;var ha=null;B&&(ha=document.createElement("select"),ha.style.maxWidth="260px",B=document.createElement("option"),B.setAttribute("value","light"),mxUtils.write(B,mxResources.get("light")),ha.appendChild(B),B=document.createElement("option"),B.setAttribute("value","dark"),mxUtils.write(B,mxResources.get("dark")),ha.appendChild(B),mxUtils.lightDarkColorSupported?(B=document.createElement("option"),B.setAttribute("value",-"auto"),mxUtils.write(B,mxResources.get("automatic")),ha.appendChild(B),ha.value="auto"):ha.value=Editor.isDarkMode()?"dark":"light",B=document.createElement("div"),B.className="geDialogFormRow",q=document.createElement("span"),q.className="geDialogFormLabel",mxUtils.write(q,mxResources.get("appearance")+":"),B.appendChild(q),B.appendChild(ha),k.appendChild(B));var qa=this.addEditButton(k,ba),ra=qa.getEditInput(),l=1<Q.model.getChildCount(Q.model.getRoot()),t=this.addCheckbox(k,mxResources.get("layers"),+da=document.createElement("span");da.className="geDialogFormLabel";mxUtils.write(da,mxResources.get("appearance")+":");c.appendChild(da);c.appendChild(Ha);E.appendChild(c);"svg"==L&&(c=document.createElement("div"),c.className="geDialogFormRow",da=document.createElement("span"),da.className="geDialogFormLabel",mxUtils.write(da,mxResources.get("links")+":"),c.appendChild(da),c.appendChild(ka),E.appendChild(c),E.appendChild(C));var La=1==aa.shadowVisible,Da=this.addCheckbox(E,mxResources.get("shadow"),+null!=this.lastExportShadow?this.lastExportShadow:La,null,null,null,null,null,!0),Sa=null,Oa="svg"!=L&&(this.isOffline()||!Editor.canvasSupported);if("png"==L||"jpeg"==L||"webp"==L||"svg"==L)Sa=this.addCheckbox(E,mxResources.get("grid"),Oa||null==this.lastExportGrid?!1:this.lastExportGrid,Oa,!1,!0,null,null,!0);f&&(ia.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,C=document.createElement("div"),C.className="geDialogCheckRow",C.appendChild(ia),aa=document.createElement("label"),mxUtils.write(aa,+mxResources.get("embedImages")),aa.setAttribute("for",ia.id),C.appendChild(aa),E.appendChild(C),ja.checked=null!=this.lastEmbedFonts?this.lastEmbedFonts:Editor.embedSvgFonts,C=document.createElement("div"),C.className="geDialogCheckRow",C.appendChild(ja),aa=document.createElement("label"),mxUtils.write(aa,mxResources.get("embedFonts")),aa.setAttribute("for",ja.id),C.appendChild(aa),E.appendChild(C),X.checked=null!=this.lastEmbedCellMetadata?this.lastEmbedCellMetadata:!1,C=document.createElement("div"),+C.className="geDialogCheckRow",C.appendChild(X),aa=document.createElement("label"),mxUtils.write(aa,mxResources.get("embedCellMetadata")),aa.setAttribute("for",X.id),C.appendChild(aa),E.appendChild(C));k=new CustomDialog(this,fa,mxUtils.bind(this,function(){this.lastExportSelectionOnly=qa.checked;this.lastExportBorder=Fa.value;this.lastExportZoom=ha.value;R&&(this.lastExportTransparent=0==T.checked?null:T.checked);this.lastExportTheme=Ha.value==Na?null:Ha.value;this.lastExportShadow=Da.checked==La?+null:Da.checked;null==Sa||Oa||(this.lastExportGrid=Sa.checked?!0:null);"svg"==L&&(this.lastExportLinkTarget="auto"==ka.value?null:ka.value);if("png"==L){var Ta=parseInt(Ca.value);this.lastExportDpi=!isNaN(Ta)&&0<Ta&&100!=Ta?Ta:null}Q&&(this.lastExportType=l.value==J?null:l.value);f&&(this.lastEmbedImages=ia.checked,this.lastEmbedFonts=ja.checked,this.lastEmbedCellMetadata=X.checked);if("png"==L||"svg"==L)this.lastEmbedInclude=Z.value;null!=x&&x(ha.value,T.checked,!qa.checked,Da.checked,Y.checked,+ia.checked&&f,Fa.value,ra.checked,("png"==L||"svg"==L)&&"currentPage"==Z.value,ka.value,null!=Sa?Sa.checked:null,null!=Ha?Ha.value:null,l.value,ja.checked,X.checked&&f,"png"==L&&0<parseInt(Ca.value)&&100!=parseInt(Ca.value)?parseInt(Ca.value):null)}),null,k,q);this.showDialog(k.container,360,null,!0,!0,null,null,null,null,!0);ha.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ha.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,+f,k,q,x,C,E){var L=document.createElement("div"),Q=this.editor.graph;if(null!=f){var V=document.createElement("h3");mxUtils.write(V,f);L.appendChild(V)}f=document.createElement("div");f.className="geDialogSection";var K=E?this.addPagesRow(f):null,fa=this.addCheckbox(f,mxResources.get("fit"),!0,null,null,null,null,null,!0),aa=this.addCheckbox(f,mxResources.get("shadow"),Q.shadowVisible&&q,!q,null,null,null,null,!0),da=this.addCheckbox(f,k,!1,null,null,null,null,null,!0),ba=this.addCheckbox(f,mxResources.get("lightbox"),+!0,null,null,null,null,null,!0);L.appendChild(f);k=this.addAdvancedSection(L).content;var ha=null;C&&(ha=document.createElement("select"),ha.style.maxWidth="260px",C=document.createElement("option"),C.setAttribute("value","light"),mxUtils.write(C,mxResources.get("light")),ha.appendChild(C),C=document.createElement("option"),C.setAttribute("value","dark"),mxUtils.write(C,mxResources.get("dark")),ha.appendChild(C),mxUtils.lightDarkColorSupported?(C=document.createElement("option"),C.setAttribute("value",+"auto"),mxUtils.write(C,mxResources.get("automatic")),ha.appendChild(C),ha.value="auto"):ha.value=Editor.isDarkMode()?"dark":"light",C=document.createElement("div"),C.className="geDialogFormRow",q=document.createElement("span"),q.className="geDialogFormLabel",mxUtils.write(q,mxResources.get("appearance")+":"),C.appendChild(q),C.appendChild(ha),k.appendChild(C));var qa=this.addEditButton(k,ba),ra=qa.getEditInput(),l=1<Q.model.getChildCount(Q.model.getRoot()),t=this.addCheckbox(k,mxResources.get("layers"),l,!l,null,null,null,null,!0),H=this.addCheckbox(k,mxResources.get("linkIcons"),!1,null,null,null,null,null,!0),J=this.addCheckbox(k,mxResources.get("tooltipIcons"),!1,null,null,null,null,null,!0);mxEvent.addListener(ba,"change",function(){ba.checked?(l&&t.removeAttribute("disabled"),null!=K&&K.select.removeAttribute("disabled"),ra.removeAttribute("disabled"),H.removeAttribute("disabled"),J.removeAttribute("disabled")):(null!=K&&K.select.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"),ra.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"));ra.checked&&ba.checked?qa.getEditSelect().removeAttribute("disabled"):qa.getEditSelect().setAttribute("disabled","disabled")});x=new CustomDialog(this,L,mxUtils.bind(this,function(){c(fa.checked,aa.checked,da.checked,ba.checked,qa.getLink(),t.checked,H.checked,J.checked,null!=ha?ha.value:null,null!=K?null!=K.row&&"allPages"==K.select.value:null)}),null,mxResources.get("embed"),-x);this.showDialog(x.container,280,null,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,k,q,x,B,E,L,Q,V){function K(ha){var qa=" ",ra="";q&&(qa=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+-(null!=aa?"&page="+aa:"")+(x?"&edit=_blank":"")+(B?"&layers=1":"")+(E?"&link-icons=1":"")+(L?"&tooltip-icons=1":"")+"');}})(this);\"",ra+="cursor:pointer;");c&&(ra+="max-width:100%;");var l="";k&&(l=' width="'+Math.round(fa.width)+'" height="'+Math.round(fa.height)+'"');Q('<img src="'+ha+'"'+l+(""!=ra?' style="'+ra+'"':"")+qa+"/>")}var fa=this.editor.graph.getGraphBounds(),aa=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ha){var qa=+x);this.showDialog(x.container,280,null,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,k,q,x,C,E,L,Q,V){function K(ha){var qa=" ",ra="";q&&(qa=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"++(null!=aa?"&page="+aa:"")+(x?"&edit=_blank":"")+(C?"&layers=1":"")+(E?"&link-icons=1":"")+(L?"&tooltip-icons=1":"")+"');}})(this);\"",ra+="cursor:pointer;");c&&(ra+="max-width:100%;");var l="";k&&(l=' width="'+Math.round(fa.width)+'" height="'+Math.round(fa.height)+'"');Q('<img src="'+ha+'"'+l+(""!=ra?' style="'+ra+'"':"")+qa+"/>")}var fa=this.editor.graph.getGraphBounds(),aa=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ha){var qa=q?this.getFileData(!0):null;ha=this.createImageDataUri(ha,qa,"png");K(ha)}),null,null,null,mxUtils.bind(this,function(ha){V({message:mxResources.get("unknownError")})}),null,!0,k?2:1,null,f,null,null,Editor.defaultBorder);else if(f=this.getFileData(!0),fa.width*fa.height<=MAX_AREA&&f.length<=MAX_REQUEST_SIZE){var da="";k&&(da="&w="+Math.round(2*fa.width)+"&h="+Math.round(2*fa.height));var ba=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(q?"1":"0")+da+"&xml="+encodeURIComponent(f));-ba.send(mxUtils.bind(this,function(){200<=ba.getStatus()&&299>=ba.getStatus()?K("data:image/png;base64,"+ba.getText()):V({message:mxResources.get("unknownError")})}))}else V({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,f,k,q,x,B,E,L,Q,V,K){Q=null!=Q?Q:"auto";V=null!=V?V:!0;var fa=this.getSelectedPageIndex(),aa=mxUtils.lightDarkColorSupported,da=mxUtils.preferDarkColor;if("light"==Q||"dark"==Q)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor=+ba.send(mxUtils.bind(this,function(){200<=ba.getStatus()&&299>=ba.getStatus()?K("data:image/png;base64,"+ba.getText()):V({message:mxResources.get("unknownError")})}))}else V({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,f,k,q,x,C,E,L,Q,V,K){Q=null!=Q?Q:"auto";V=null!=V?V:!0;var fa=this.getSelectedPageIndex(),aa=mxUtils.lightDarkColorSupported,da=mxUtils.preferDarkColor;if("light"==Q||"dark"==Q)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==Q;var ba=null;try{ba=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k,Q)}finally{mxUtils.lightDarkColorSupported=aa,mxUtils.preferDarkColor=da}Q=ba.getElementsByTagName("a");if(null!=Q)for(aa=0;aa<Q.length;aa++)da=Q[aa].getAttribute("href"),null!=da&&"#"==da.charAt(0)&&"_blank"==Q[aa].getAttribute("target")&&Q[aa].removeAttribute("target");q&&ba.setAttribute("content",this.getFileData(!0,null,null,null,null,!V));f&&this.editor.graph.addSvgShadow(ba);if(k){var ha=-" ",qa="";q&&(ha="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(V&&null!=fa?"&page="+fa:"")+(x?"&edit=_blank":"")+(B?"&layers=1":"")+(E?"&link-icons=1":"")+(L?"&tooltip-icons=1":"")+"');}})(this);\"",+" ",qa="";q&&(ha="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(V&&null!=fa?"&page="+fa:"")+(x?"&edit=_blank":"")+(C?"&layers=1":"")+(E?"&link-icons=1":"")+(L?"&tooltip-icons=1":"")+"');}})(this);\"",qa+="cursor:pointer;");c&&(qa+="max-width:100%;");this.editor.convertImages(ba,mxUtils.bind(this,function(ra){K('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(ra))+'"'+(""!=qa?' style="'+qa+'"':"")+ha+"/>")}))}else qa="",q&&(ba.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(V&&null!=fa?"&page="+fa:"")+(x?"&edit=_blank":"")+(B?"&layers=1":"")+(E?"&link-icons=1":"")+(L?"&tooltip-icons=1":"")+"');}}})(this);"),qa+="cursor:pointer;"),c&&(c=parseInt(ba.getAttribute("width")),f=parseInt(ba.getAttribute("height")),ba.setAttribute("viewBox","-0.5 -0.5 "+c+" "+f),qa+="max-width:100%;max-height:"+f+"px;",ba.removeAttribute("height")),""!=qa&&(c=ba.getAttribute("style"),ba.setAttribute("style",(null!=c&&0<c.length?c+" ":"")+qa)),this.editor.addFontCss(ba),+EditorUi.lightboxHost+"/?client=1"+(V&&null!=fa?"&page="+fa:"")+(x?"&edit=_blank":"")+(C?"&layers=1":"")+(E?"&link-icons=1":"")+(L?"&tooltip-icons=1":"")+"');}}})(this);"),qa+="cursor:pointer;"),c&&(c=parseInt(ba.getAttribute("width")),f=parseInt(ba.getAttribute("height")),ba.setAttribute("viewBox","-0.5 -0.5 "+c+" "+f),qa+="max-width:100%;max-height:"+f+"px;",ba.removeAttribute("height")),""!=qa&&(c=ba.getAttribute("style"),ba.setAttribute("style",(null!=c&&0<c.length?c+" ":"")+qa)),this.editor.addFontCss(ba),this.editor.graph.mathEnabled&&this.editor.addMathCss(ba),K(mxUtils.getXml(ba))};EditorUi.prototype.timeSince=function(c){c=Math.floor((new Date-c)/1E3);var f=Math.floor(c/31536E3);if(1<f)return f+" "+mxResources.get("years");f=Math.floor(c/2592E3);if(1<f)return f+" "+mxResources.get("months");f=Math.floor(c/86400);if(1<f)return f+" "+mxResources.get("days");f=Math.floor(c/3600);if(1<f)return f+" "+mxResources.get("hours");f=Math.floor(c/60);return 1<f?f+" "+mxResources.get("minutes"):1==f?f+" "+-mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,f){if(null!=c){var k=null;if("diagram"==c.nodeName)k=c;else if("mxfile"==c.nodeName){var q=c.getElementsByTagName("diagram");if(0<q.length){k=q[0];var x=f.getGlobalVariable;f.getGlobalVariable=function(B){return"page"==B?k.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==B?1:x.apply(this,arguments)}}}null!=k&&(c=Editor.parseDiagramNode(k))}q=this.editor.graph;try{this.editor.graph=f,this.editor.setGraphXml(c)}catch(B){}finally{this.editor.graph=-q}return c};EditorUi.prototype.getSvgFileProperties=function(c){return this.getPngFileProperties(c)};EditorUi.prototype.getPngFileProperties=function(c){var f=1,k=0;if(null!=c){if(c.hasAttribute("scale")){var q=parseFloat(c.getAttribute("scale"));!isNaN(q)&&0<q&&(f=q)}c.hasAttribute("border")&&(q=parseInt(c.getAttribute("border")),!isNaN(q)&&0<q&&(k=q))}return{scale:f,border:k}};EditorUi.prototype.getEmbeddedPng=function(c,f,k,q,x){try{var B=this.editor.graph,E=null;if(null!=k&&0<k.length)B=this.createTemporaryGraph(B.getStylesheet()),-document.body.appendChild(B.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,!0),B),E=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){B=this.createTemporaryGraph(B.getStylesheet());var L=B.getGlobalVariable;B.setBackgroundImage=this.editor.graph.setBackgroundImage;var Q=this.pages[0];this.currentPage==Q?B.setBackgroundImage(this.editor.graph.backgroundImage):null!=Q.viewState&&null!=Q.viewState&&B.setBackgroundImage(Q.viewState.backgroundImage);-B.getGlobalVariable=function(V){return"page"==V?Q.getName():"pagenumber"==V?1:L.apply(this,arguments)};document.body.appendChild(B.container);B.model.setRoot(Q.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(V){try{null==E&&(E=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var K=V.toDataURL("image/png");K=Editor.writeGraphModelToPng(K,"tEXt","mxfile",encodeURIComponent(E));c(K.substring(K.lastIndexOf(",")+1));B!=this.editor.graph&&B.container.parentNode.removeChild(B.container)}catch(fa){null!=-f&&f(fa)}}),null,null,null,mxUtils.bind(this,function(V){null!=f&&f(V)}),null,null,q,null,B.shadowVisible,null,B,x,null,null,null,"diagram",null)}catch(V){null!=f&&f(V)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba){L=null!=L?L:!0;K=null!=K?K:0;E=null!=Q?Q:f.background;E==mxConstants.NONE&&(E=null);null==E&&"none"==f.getAdaptiveColors()&&(E="#ffffff");Q=this.editor.graph.createSvgImageExport(null!=c,da);var ha=Graph.addFont,qa=null;if(null==x){qa={};Graph.addFont=-function(J,R,T,Y){ha.call(this,J,R,T,qa)};var ra=Q.drawCellState;Q.drawCellState=function(J,R){null!=J&&Graph.processFontStyle(J.style);ra.apply(this,arguments)}}da=null;try{da=f.getSvg(E,V,K,null,null,B,null,Q,null,f.shadowVisible||fa,null,aa,"diagram")}finally{Graph.addFont=ha}(f.shadowVisible||fa)&&f.addSvgShadow(da,null,null,0==K);null!=c&&da.setAttribute("content",c);null!=k&&da.setAttribute("resource",k);var l=mxUtils.bind(this,function(J){J=(q?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+-"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(J);null!=x&&x(J);return J});f.mathEnabled&&this.editor.addMathCss(da);if(null!=x)this.embedFonts(da,mxUtils.bind(this,function(J){L?this.editor.convertImages(J,mxUtils.bind(this,function(R){l(R)})):l(J)}),ba);else{c=Graph.customFontElements;Graph.customFontElements=qa;try{var t=!1;this.embedFonts(da,function(){t=!0},ba);if(!t)try{null==this.editor.resolvedFontCss&&this.editor.addFontCss(da);var H=this.editor.graph.getExtFontCss();0<H.length&&this.editor.addFontCss(da,-H)}catch(J){}}finally{Graph.customFontElements=c}return l(da)}};EditorUi.prototype.embedFonts=function(c,f,k){if(k=null!=k?k:Editor.embedSvgFonts)this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(x){try{null!=x&&this.editor.addFontCss(c,x),f(c)}catch(B){f(c)}}))}catch(x){f(c)}}));else{try{this.editor.addFontCss(c);var q=this.editor.graph.getExtFontCss();-0<q.length&&this.editor.addFontCss(c,q)}catch(x){}f(c)}};EditorUi.prototype.exportImage=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa){Q=null!=Q?Q:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(ba){Editor.addRetryToError(ba,mxUtils.bind(this,function(){this.exportImage(c,f,k,q,x,B,E,L,Q,V,K,fa,aa)}));this.handleError(ba)}))){var da=this.editor.graph.isSelectionEmpty();k=null!=k?k:da;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,-function(ba){this.spinner.stop();try{this.saveCanvas(ba,x?this.getFileData(!0,null,null,null,k,L,null,null,null,null,null,c,B):null,Q,null==this.pages||0==this.pages.length,K)}catch(ha){this.handleError(ha)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(ba){this.spinner.stop();this.handleError(ba)}),null,k,c||1,f,q,null,null,B,E,V,fa,aa)}catch(ba){this.spinner.stop(),this.handleError(ba)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};-EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,k,q,x,B,E){EditorUi.debug("EditorUi.importXml",[this],"xml",[c],"dx",[f],"dy",[k],"crop",[q],"noErrorHandling",[x],"addNewPage",[B],"applyDefaultStyles",[E]);f=null!=f?f:0;k=null!=k?k:0;var L=[];try{if(null!=c&&0<c.length){var Q=null!=this.pages?this.pages.length:0,V=this.isDiagramEmpty(),-K=this.currentPage,fa=this.editor.graph;fa.model.beginUpdate();try{var aa=mxUtils.parseXml(c);c={};var da=this.editor.extractGraphModel(aa.documentElement,null!=this.pages);if(null!=da&&"mxfile"==da.nodeName&&null!=this.pages){var ba=da.getElementsByTagName("diagram");if(0<ba.length){aa=[];var ha=0;if(1==ba.length&&!B){if(null!=this.currentPage&&(c[ba[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var qa=ba[0].getAttribute("name");null!=qa&&""!=qa&&this.editor.graph.model.execute(new RenamePage(this,-this.currentPage,qa))}da=Editor.parseDiagramNode(ba[0]);q=!1;ha=1}for(;ha<ba.length;ha++){var ra=ba[ha].getAttribute("id");ba[ha].removeAttribute("id");var l=this.updatePageRoot(new DiagramPage(ba[ha]));c[ra]=ba[ha].getAttribute("id");var t=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[t+1]));fa.model.execute(new ChangePage(this,l,l,t,0<ha));aa.push(l)}this.updatePageLinks(c,aa)}}if(null!=da&&"mxGraphModel"===da.nodeName){L=fa.importGraphModel(da,f,k,q);if(null!=-L)for(this.addLocalPagesToMapping(c),ha=0;ha<L.length;ha++)this.updatePageLinksForCell(c,L[ha]);var H=fa.parseBackgroundImage(da.getAttribute("backgroundImage"));if(null!=H&&null!=H.originalSrc&&this.updateBackgroundPageLink(c,H)){var J=new ChangePageSetup(this,null,H);J.ignoreColor=!0;fa.model.execute(J)}}E&&fa.pasteCellStyles(fa.includeDescendants(L),fa.defaultVertexStyle,fa.defaultEdgeStyle);!B&&K!=this.currentPage&&null!=this.pages&&1<this.pages.length&&V&&1==Q&&this.removePage(K)}finally{fa.model.endUpdate()}}}catch(R){if(x)throw R;-this.handleError(R)}return L};EditorUi.prototype.updatePageLinks=function(c,f){for(var k=0;k<f.length;k++)this.updatePageLinksForCell(c,f[k].root),f[k]!=this.currentPage&&(f[k].needsUpdate=!0),null!=f[k].viewState&&this.updateBackgroundPageLink(c,f[k].viewState.backgroundImage)&&(f[k]==this.currentPage&&this.editor.graph.setViewState(f[k].viewState,!0),f[k].needsUpdate=!0)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){var k=!1;try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var q=c[f.originalSrc.substring(f.originalSrc.indexOf(",")+-1)];null!=q&&(f.originalSrc="data:page/id,"+q,k=!0)}}catch(x){}return k};EditorUi.prototype.updatePageLinksForCell=function(c,f){var k=document.createElement("div"),q=this.editor.graph,x=q.getLinkForCell(f);null!=x&&q.setLinkForCell(f,this.updatePageLink(c,x));if(q.isHtmlLabel(f)){k.innerHTML=Graph.sanitizeHtml(q.getLabel(f));for(var B=k.getElementsByTagName("a"),E=!1,L=0;L<B.length;L++)x=B[L].getAttribute("href"),null!=x&&(B[L].setAttribute("href",this.updatePageLink(c,x)),E=!0);E&&q.labelChanged(f,-k.innerHTML)}for(L=0;L<q.model.getChildCount(f);L++)this.updatePageLinksForCell(c,q.model.getChildAt(f,L))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var k=c[f.substring(f.indexOf(",")+1)];f=null!=k?"data:page/id,"+k:null}else if("data:action/json,"==f.substring(0,17))try{var q=JSON.parse(f.substring(17));if(null!=q.actions){for(var x=0;x<q.actions.length;x++){var B=q.actions[x];if(null!=B.open&&Graph.isPageLink(B.open)){var E=B.open.substring(B.open.indexOf(",")+1);-k=c[E];null!=k?B.open="data:page/id,"+k:null==this.getPageById(E)&&delete B.open}}f="data:action/json,"+JSON.stringify(q)}}catch(L){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,k,q,x){var B=mxUtils.bind(this,function(E){this.loadingExtensions=!1;null!=k?k(E):this.handleError(E)});this.createTimeout(null,mxUtils.bind(this,function(E){q=null!=q?q:c.name;var L=mxUtils.bind(this,-function(V){E.clear()&&B(V)}),Q=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var V=this.isRemoteVisioFormat(q);try{var K=q.lastIndexOf(".");if(0<=K&&K<q.length)q.substring(K+1).toUpperCase();else{var fa=q.lastIndexOf("/");0<=fa&&fa<q.length&&(q=q.substring(fa+1))}}catch(da){}if(V)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(q)?L({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):L({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):-mxResources.get("serviceUnavailableOrBlocked")});else{V=new FormData;V.append("file1",c,q);var aa=new XMLHttpRequest;aa.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(q)?"?stencil=1":""));aa.responseType="blob";this.addRemoteServiceSecurityCheck(aa);null!=x&&aa.setRequestHeader("x-convert-custom",x);aa.onreadystatechange=mxUtils.bind(this,function(){if(4==aa.readyState&&E.clear())if(200<=aa.status&&299>=aa.status)try{var da=aa.response;if("text/xml"==da.type){var ba=new FileReader;ba.onload=mxUtils.bind(this,-function(ha){try{f(ha.target.result)}catch(qa){L({message:mxResources.get("errorLoadingFile")})}});ba.readAsText(da)}else this.doImportVisio(da,f,L,q)}catch(ha){L(ha)}else try{""==aa.responseType||"text"==aa.responseType?L({message:aa.responseText}):(ba=new FileReader,ba.onload=function(){try{L({message:JSON.parse(ba.result).Message})}catch(ha){null!=ba.result&&0<ba.result.length?L({message:ba.result}):L(ha)}},ba.readAsText(aa.response))}catch(ha){L({})}});aa.send(V)}else if(E.clear())try{this.doImportVisio(c,-f,L,q)}catch(da){L(da)}}else L({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?Q():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",Q,null,null,null,L))}),B)};EditorUi.prototype.importGraphML=function(c,f,k){var q=mxUtils.bind(this,function(x){this.loadingExtensions=!1;null!=k?k(x):this.handleError(x)});this.createTimeout(null,mxUtils.bind(this,function(x){var B=mxUtils.bind(this,function(L){x.clear()&&-q(L)}),E=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(x.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,q)}catch(L){B(L)}else B({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?E():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",E,null,null,null,B))}),q)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=-mxUtils.bind(this,function(k){this.loadingExtensions=!1;this.handleError(k)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(k){var q=mxUtils.bind(this,function(B){k.clear()&&f(B)}),x=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(k.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||q({message:mxResources.get("unknownError")})}catch(B){q(B)}else q({message:mxResources.get("serviceUnavailableOrBlocked")})});-"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(x,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",x,null,null,null,q))}),f):f({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,f,k){var q=mxUtils.bind(this,function(x){this.loadingExtensions=!1;null!=k?k(x):this.handleError(x)});this.createTimeout(null,mxUtils.bind(this,function(x){var B=mxUtils.bind(this,function(L){x.clear()&&-q(L)}),E=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(x.clear())if("undefined"!==typeof window.LucidImporter)try{var L=JSON.parse(c);f(LucidImporter.importState(L));try{if(null!=window.console&&"1"==urlParams.test){var Q=[(new Date).toISOString(),"convertLucidChart",L];null!=L.state&&Q.push(JSON.parse(L.state));if(null!=L.svgThumbs)for(var V=0;V<L.svgThumbs.length;V++)Q.push(Editor.createSvgDataUri(L.svgThumbs[V]));null!=L.thumb&&Q.push(L.thumb);console.log.apply(console,Q)}}catch(K){}}catch(K){null!=-window.console&&console.error(K),B(K)}else B({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(E,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",-E,null,null,null,B)},null,null,null,B)},null,null,null,B)},null,null,null,B)},null,null,null,B):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",E,null,null,null,B))}),q)};EditorUi.prototype.replaceLockedGroupChildren=function(c,f,k,q,x){var B=null!=x&&null!=x.dataAttr?x.dataAttr:"mermaidData",E=null!=x&&null!=x.attrPrefix?x.attrPrefix:"mermaid",L=this.editor.graph;x=mxUtils.parseXml((null!=x&&null!=x.wrapGroup?x.wrapGroup:mxMermaidToDrawio.wrapGroup)(f,k,q));var Q=new mxCodec(x);f=new mxGraphModel;-Q.decode(x.documentElement,f);Q=f.getRoot();var V=null;for(x=0;null!=Q&&x<f.getChildCount(Q)&&null==V;x++)for(var K=f.getChildAt(Q,x),fa=0;fa<f.getChildCount(K);fa++){var aa=f.getChildAt(K,fa),da=aa.value;if(null!=da&&"object"===typeof da&&null!=da.getAttribute&&null!=da.getAttribute(B)){V=aa;break}}if(null!=V){Q=[];for(x=0;x<f.getChildCount(V);x++)Q.push(f.getChildAt(V,x));0==Q.length&&(Q=[V]);V=f.getGeometry(V);K=da=Infinity;aa=L.model.getChildCount(c);for(x=0;x<aa;x++){var ba=L.model.getChildAt(c,-x);L.model.isVertex(ba)&&(ba=ba.getGeometry(),null!=ba&&(da=Math.min(da,ba.x),K=Math.min(K,ba.y)))}var ha=Infinity;ba=Infinity;for(x=0;x<Q.length;x++)f.isVertex(Q[x])&&(aa=Q[x].getGeometry(),null!=aa&&(ha=Math.min(ha,aa.x),ba=Math.min(ba,aa.y)));da=isFinite(da)&&isFinite(ha)?da-ha:0;K=isFinite(K)&&isFinite(ba)?K-ba:0;if(0!=da||0!=K)for(x=0;x<Q.length;x++)if(ba=Q[x],aa=ba.getGeometry(),null!=aa){aa=aa.clone();if(f.isVertex(ba))aa.x+=da,aa.y+=K;else if(f.isEdge(ba)){if(null!=aa.points)for(ha=0;ha<aa.points.length;ha++)null!=-aa.points[ha]&&(aa.points[ha].x+=da,aa.points[ha].y+=K);null!=aa.sourcePoint&&(aa.sourcePoint.x+=da,aa.sourcePoint.y+=K);null!=aa.targetPoint&&(aa.targetPoint.x+=da,aa.targetPoint.y+=K)}f.setGeometry(ba,aa)}f=this.snapshotMermaidIdentity(c,E);Q=L.cloneCells(Q,!0);L.getModel().beginUpdate();try{for(fa=L.model.getChildCount(c)-1;0<=fa;fa--)L.model.remove(L.model.getChildAt(c,fa));for(x=0;x<Q.length;x++)this.applyMermaidUserCustomizations(Q[x],f,E),L.model.add(c,Q[x]);if(null!=V){var qa=L.model.getGeometry(c);-null!=qa&&(qa=qa.clone(),qa.width=V.width,qa.height=V.height,L.model.setGeometry(c,qa))}L.setAttributeForCell(c,B,JSON.stringify({data:k,config:q},null,2))}finally{L.getModel().endUpdate()}}};EditorUi.prototype.snapshotMermaidIdentity=function(c,f){f=null!=f?f:"mermaid";for(var k=this.editor.graph,q={},x=k.model.getChildCount(c),B=0;B<x;B++){var E=k.model.getChildAt(c,B),L=E.value;if(null!=L&&"object"===typeof L&&null!=L.getAttribute){var Q=L.getAttribute(f+"Id");Q&&(q[Q]={currentStyle:E.style||"",-currentLabel:L.getAttribute("label")||"",baseStyle:L.getAttribute(f+"BaseStyle")||"",baseValue:L.getAttribute(f+"BaseValue")||""})}}return q};EditorUi.prototype.applyMermaidUserCustomizations=function(c,f,k){var q=c.value;null!=q&&"object"===typeof q&&null!=q.getAttribute&&(k=q.getAttribute((null!=k?k:"mermaid")+"Id"))&&(f=f[k],null!=f&&(c.style=this.mergeMermaidStyleDelta(f.baseStyle,f.currentStyle,c.style||"",c.isEdge()),f.currentLabel!==f.baseValue&&q.setAttribute("label",f.currentLabel)))};EditorUi.prototype.mergeMermaidStyleDelta=-function(c,f,k,q){function x(K){var fa={},aa=[];if(!K)return{map:fa,keys:aa};K=K.split(";");for(var da=0;da<K.length;da++){var ba=K[da];if(ba){var ha=ba.indexOf("=");if(0<ha){var qa=ba.substring(0,ha);qa in fa||aa.push(qa);fa[qa]=ba.substring(ha+1)}else ba in fa||aa.push(ba),fa[ba]=!0}}return{map:fa,keys:aa}}c=x(c);f=x(f);var B=x(k),E={exitX:1,exitY:1,exitDx:1,exitDy:1,entryX:1,entryY:1,entryDx:1,entryDy:1,edgeStyle:1,noEdgeStyle:1,orthogonal:1},L=q?{startArrow:1,endArrow:1,startFill:1,endFill:1,-startSize:1,endSize:1}:{};q={};k=[];for(var Q=0;Q<B.keys.length;Q++){var V=B.keys[Q];q[V]=B.map[V];k.push(V)}for(Q=0;Q<f.keys.length;Q++)V=f.keys[Q],E[V]||L[V]||f.map[V]===c.map[V]||(V in q||k.push(V),q[V]=f.map[V]);for(Q=0;Q<c.keys.length;Q++)V=c.keys[Q],E[V]||L[V]||V in f.map||delete q[V];c=[];for(Q=0;Q<k.length;Q++)V=k[Q],f=q[V],void 0!==f&&(!0===f?c.push(V):c.push(V+"="+f));return 0<c.length?c.join(";")+";":""};EditorUi.prototype.getSvgForXml=function(c,f,k){var q=null,x=this.createTemporaryGraph(this.editor.graph.getStylesheet());-try{document.body.appendChild(x.container),(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,x.getModel()),q=x.getSvg(null,null,f,null,null,null,null,null,null,null,null,k,null,null,!0,!0)}finally{document.body.removeChild(x.container)}return q};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,k,q){var x=0,B=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(E){var L="";if(null!=this.drive&&null!=this.drive.getUser()){var Q=-this.drive.getUser();null!=Q.email&&0<Q.email.indexOf("@")&&(L=Q.email.substring(Q.email.indexOf("@")+1))}var V={prompt:c,driveDomain:L,options:null!=q?q:{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"url",["https://www.draw.io/generate/v3"]);var K=Date.now();L=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(V),"POST");var fa=mxUtils.bind(this,function(da){E.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"error",-[da],"time",Date.now()-K+" ms"),k(da))}),aa=mxUtils.bind(this,function(da){3>x++?E.clear()&&B():fa(da)});L.send(mxUtils.bind(this,function(da){if(E.isAlive())if(200<=da.getStatus()&&299>=da.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var ha=da.getText();try{ha=JSON.parse(ha),result=ha.result}catch(ra){result=ha}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"response",[ha],"time",Date.now()-K+" ms");ha=Editor.extractGraphModelFromText(result);if(null!=ha&&-""!=ha[1])E.clear()&&f(ha[1]);else if("<"==mxUtils.trim(result).charAt(0))E.clear()&&f(result);else{var qa=this.extractMermaidDeclaration(result)||result;this.parseMermaidDiagram(qa,null,mxUtils.bind(this,function(ra){this.tryAndHandle(mxUtils.bind(this,function(){E.clear()&&f(mxMermaidToDrawio.wrapGroup(ra,qa,null))}),fa)}),fa,aa)}}),fa,!0);else{var ba={message:mxResources.get("error")+" "+da.getStatus()};try{ba=JSON.parse(da.getText()),null!=ba.error&&(ba.message=ba.error)}catch(ha){}fa(ba)}}),-fa)}),k)});B()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("(Begins)");for(var k=mxUtils.trim(1>=f.length?c:f[1]),q=k.split("\n"),x=0;x<q.length&&("mermaid"==q[x]||0==q[x].trim().length||"%%"==q[x].substring(0,2));)x++;k=[];for(var B=x;B<q.length;B++){var E=mxUtils.trim(q[B]);if("%%"!=E.substring(0,2)&&"classDef "!=-E.substring(0,9))k.push(q[B]);else if("mermaid"==E)break}q=k;k=mxUtils.trim(q.join("\n"));B="undefined"!==typeof MermaidParser?MermaidParser.detectType(k):null;EditorUi.debug("EditorUi.extractMermaidDeclaration","value",[c],"text",[k],"typeInfo",[B],"startLine",x,"lines",q,"tokens",f);return null!=B?k:null};EditorUi.prototype.getMermaidDiagramType=function(c){var f=null!=c?c.split("\n"):[],k=0;c=function(){for(;k<f.length&&(0==f[k].trim().length||"%%"==f[k].substring(0,2));)k++};c();if(k<f.length&&-"---"==f[k].trim()){do k++;while(k<f.length&&"---"!=f[k].trim());k++;c()}if(k>=f.length)return"";c=f[k].trim().toLowerCase();var q=c.indexOf(" ");return c.substring(0,0<q?q:c.length)};EditorUi.prototype.isMermaidElkFlowchart=function(c){return null!=c&&(/defaultRenderer["']?\s*:\s*["']?elk/i.test(c)||/(?:^|\n)\s*layout\s*:\s*["']?elk\b/i.test(c))&&/(?:flowchart|graph)\b/i.test(c)};EditorUi.prototype.applyMermaidElkPostPass=function(c,f,k){if("undefined"===typeof ElkLayout||"undefined"===typeof Graph)k(c);-else{f=f.match(/(?:flowchart|graph)\s+(LR|RL|TB|TD|BT)/i);var q={LR:"RIGHT",RL:"LEFT",TB:"DOWN",TD:"DOWN",BT:"UP"};f=f?q[f[1].toUpperCase()]||"DOWN":"DOWN";var x=document.createElement("div");x.style.cssText="position:absolute;left:-99999px;top:-99999px;width:1200px;height:800px;visibility:hidden;";document.body.appendChild(x);var B=null,E=!1,L=function(V){if(!E){E=!0;try{null!=B&&B.destroy()}catch(K){}x.remove();k(V)}};try{B=new Graph(x);B.foldingEnabled=!1;B.setEnabled(!1);B.setHtmlLabels(!0);var Q=-mxUtils.parseXml(c);(new mxCodec(Q)).decode(Q.documentElement,B.getModel());(new ElkLayout(B,"layered",{"elk.direction":f,"elk.layered.cycleBreaking.strategy":"GREEDY"},Object.assign({mermaidPolicy:!0},ElkLayout.CANONICAL_EDGE))).execute(B.getDefaultParent(),function(V){var K=null;if(!V)try{var fa=new mxCodec;K=mxUtils.getXml(fa.encode(B.getModel()))}catch(aa){}L(null!=K?K:c)})}catch(V){if(E)throw V;L(c)}}};EditorUi.prototype.parseMermaidDiagram=function(c,f,k,q,x){var B=mxUtils.bind(this,function(L){null!=-x?x(L):null!=q?q(L):this.handleError(L)});if(EditorUi.isMermaidSupported())try{var E=mxMermaidToDrawio.parseText(c,this.getMermaidConfig(c,f));null!=E?this.isMermaidElkFlowchart(c)?this.applyMermaidElkPostPass(E,c,k):k(E):B(Error("Unsupported diagram type: "+this.getMermaidDiagramType(c)))}catch(L){B(L)}else B(Error("Mermaid parser not available"))};EditorUi.prototype.loadMermaid=function(c,f){var k=mxUtils.bind(this,function(x){this.loadingMermaid=!1;f(x)}),q=mxUtils.bind(this,function(){try{this.loadingMermaid=-!1,c()}catch(x){k(x)}});"undefined"!==typeof mxMermaidToDrawio||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(q,0):(this.loadingMermaid=!0,"undefined"!==typeof urlParams&&"1"==urlParams.dev||window.location.search&&0<=window.location.search.indexOf("dev=1")?mxscript("js/elk/drawio-elk.min.js",function(){mxscript("js/mermaid/drawio-mermaid.min.js",q,null,null,null,k)},null,null,null,k):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,k))};EditorUi.prototype.loadPlantUml=-function(c,f){var k=mxUtils.bind(this,function(B){this.loadingPlantUml=!1;f(B)}),q=mxUtils.bind(this,function(){try{this.loadingPlantUml=!1,c()}catch(B){k(B)}});if("undefined"!==typeof mxPlantUmlToDrawio||this.loadingPlantUml)window.setTimeout(q,0);else{this.loadingPlantUml=!0;var x="undefined"!==typeof urlParams&&"1"==urlParams.dev||window.location.search&&0<=window.location.search.indexOf("dev=1");mxscript((x?"":window.DRAWIO_SERVER_URL)+"js/plantuml/drawio-plantuml.min.js",q,null,null,null,k)}};-EditorUi.prototype.parsePlantUmlDiagram=function(c,f,k,q){var x=mxUtils.bind(this,function(B){null!=q?q(B):this.handleError(B)});this.loadPlantUml(mxUtils.bind(this,function(){if(EditorUi.isNativePlantUmlSupported())try{k(mxPlantUmlToDrawio.parseText(c,f))}catch(B){x(B)}else x(Error("PlantUML parser not available"))}),x)};EditorUi.prototype.parsePlantUmlImage=function(c,f,k){this.parsePlantUmlDiagram(c,null,mxUtils.bind(this,function(q){f(this.createMermaidImageXml(c,null,q,null,null,"plantUmlData"))}),-k)};EditorUi.prototype.getMermaidConfig=function(c,f){f=null!=f?f:mxUtils.clone(EditorUi.defaultMermaidConfig);f.securityLevel="strict";f.startOnLoad=!1;f.maxTextSize=9E5;return f};EditorUi.prototype.getMermaidImageForXml=function(c,f){f=parseFloat(f);f=isNaN(f)?EditorUi.mermaidImageBorder:f;c=this.getSvgForXml(c,f,"auto");var k=parseFloat(c.getAttribute("width")),q=parseFloat(c.getAttribute("height"));if(isNaN(k)||isNaN(q)){try{var x=c.getAttribute("viewBox").split(/\s+/);k=parseFloat(x[2]);q=parseFloat(x[3])}catch(B){}k=-k||100;q=q||100}return{data:this.convertDataUri(Editor.createSvgDataUri(mxUtils.getXml(c))),width:k,height:q,border:f}};EditorUi.prototype.createMermaidImageXml=function(c,f,k,q,x,B){x=this.getMermaidImageForXml(k,x);k=new Graph(document.createElement("div"));x=k.insertVertex(null,null,null,0,0,x.width,x.height,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;editIcon=1;groupPadding="+x.border+";image="+x.data+";");k.setAttributeForCell(x,null!=B?B:"mermaidData",JSON.stringify({data:c,config:f},-null,2));null!=q&&k.setAttributeForCell(x,"templatePrompt",q);c=new mxCodec;return mxUtils.getXml(c.encode(k.getModel()))};EditorUi.prototype.parseMermaidImage=function(c,f,k){this.parseMermaidDiagram(c,mxUtils.clone(EditorUi.legacyMermaidConfig),mxUtils.bind(this,function(q){f(this.createMermaidImageXml(c,null,q))}),k)};EditorUi.prototype.getMermaidImageBorder=function(c,f){c=parseFloat(mxUtils.getValue(this.editor.graph.getCurrentCellStyle(c,!0),"groupPadding",""));return isNaN(c)?f:c};EditorUi.prototype.updateMermaidImage=-function(c,f,k,q,x,B){var E=this.editor.graph;q=this.getMermaidImageForXml(q,x);E.setCellStyles("image",q.data,[c]);E.setCellStyles("editIcon","1",[c]);E.setCellStyles("groupPadding",q.border,[c]);x=E.model.getGeometry(c);null!=x&&(x=x.clone(),x.width=q.width,x.height=q.height,E.cellsResized([c],[x],!1));E.setAttributeForCell(c,null!=B?B:"mermaidData",JSON.stringify({data:f,config:k},null,2))};EditorUi.prototype.refreshMermaidImage=function(c){var f=this.editor.graph,k=f.getAttributeForCell(c,"plantUmlData"),-q=null!=k?"plantUmlData":"mermaidData";k=null!=k?k:f.getAttributeForCell(c,"mermaidData");var x=null;if(null!=k)try{x=JSON.parse(k)}catch(L){}if(null!=x&&null!=x.data&&null==x.format){var B=this.getMermaidImageBorder(c,x.border);k=function(){};var E=mxUtils.bind(this,function(L){if(f.model.contains(c)&&this.getMermaidImageBorder(c,x.border)==B){f.model.beginUpdate();try{this.updateMermaidImage(c,x.data,null,L,B,q)}finally{f.model.endUpdate()}}});"plantUmlData"==q?this.parsePlantUmlDiagram(x.data,-null,E,k):this.parseMermaidDiagram(x.data,mxUtils.clone(EditorUi.legacyMermaidConfig),E,k)}};EditorUi.prototype.replaceMermaidCell=function(c,f){var k=this.editor.graph,q=k.getBoundingBoxFromGeometry([c]),x=null!=q?q.x:0;q=null!=q?q.y:0;for(var B=k.model.getParent(c);null!=B&&k.model.isVertex(B);){var E=k.model.getGeometry(B);null!=E&&(x+=E.x,q+=E.y);B=k.model.getParent(B)}k.getModel().beginUpdate();try{var L=this.importXml(f,x,q,!0,null,null,!0);k.model.remove(c);k.setSelectionCells(L)}finally{k.getModel().endUpdate()}k.scrollCellToVisible(k.getSelectionCell());-return L};EditorUi.prototype.insertAsPreText=function(c,f,k){var q=this.editor.graph,x=null;q.getModel().beginUpdate();try{x=q.insertVertex(null,null,"<pre>"+c+"</pre>",f,k,1,1,"text;html=1;align=left;verticalAlign=top;"),q.updateCellSize(x,!0)}finally{q.getModel().endUpdate()}return x};EditorUi.prototype.insertTextAt=function(c,f,k,q,x,B,E,L){B=null!=B?B:!0;E=null!=E?E:!0;if(null!=c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?this.showError(mxResources.get("error"),-mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(aa){4==aa.readyState&&200<=aa.status&&299>=aa.status&&this.editor.graph.setSelectionCells(this.insertTextAt(aa.responseText,f,k,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(x||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var Q=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var V=Editor.extractGraphModelFromPdf(c);if(null!=V&&0<V.length)return this.importXml(V,-f,k,B,!0,L)}if(Editor.isPngDataUrl(c)&&(V=Editor.extractGraphModelFromPng(c),null!=V&&0<V.length))return this.importXml(V,f,k,B,!0,L);if("data:image/svg+xml;"==c.substring(0,19))try{V=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(V=c.substring(c.indexOf(",")+1),V=window.atob&&!mxClient.IS_SF?atob(V):Base64.decode(V,!0)):V=decodeURIComponent(c.substring(c.indexOf(",")+1));var K=this.importXml(V,f,k,B,!0,L);if(0<K.length)return K}catch(aa){}this.loadImage(c,mxUtils.bind(this,function(aa){if("data:"==-c.substring(0,5))this.resizeImage(aa,Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(ha,qa,ra){Q.setSelectionCell(Q.insertVertex(null,null,"",Q.snap(f),Q.snap(k),qa,ra,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(ha)+";"))}),E,this.maxImageSize);else{var da=Math.min(1,Math.min(this.maxImageSize/aa.width,this.maxImageSize/aa.height)),ba=Math.round(aa.width*da);aa=Math.round(aa.height*-da);Q.setSelectionCell(Q.insertVertex(null,null,"",Q.snap(f),Q.snap(k),ba,aa,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var aa=null;Q.getModel().beginUpdate();try{aa=Q.insertVertex(Q.getDefaultParent(),null,c,Q.snap(f),Q.snap(k),1,1,"text;"+(q?"html=1;":"")),Q.updateCellSize(aa),Q.fireEvent(new mxEventObject("textInserted","cells",[aa]))}finally{Q.getModel().endUpdate()}Q.setSelectionCell(aa)}))}else{c=-Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,f,k,B,null,L);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(aa){this.editor.graph.setSelectionCells(this.importXml(aa,f,k,B,null,L))}),mxUtils.bind(this,function(aa){this.handleError(aa)}));else{Q=this.editor.graph;x=null;Q.getModel().beginUpdate();try{x=Q.insertVertex(Q.getDefaultParent(),null,"",Q.snap(f),Q.snap(k),1,1,"text;whiteSpace=wrap;"+(q?"html=1;":""));-Q.fireEvent(new mxEventObject("textInserted","cells",[x]));q&&(c=Q.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");x.value=c;Q.updateCellSize(x);if(0<this.maxTextWidth&&x.geometry.width>this.maxTextWidth){var fa=Q.getPreferredSizeForCell(x,this.maxTextWidth);x.geometry.width=fa.width;x.geometry.height=fa.height}Graph.isLink(x.value)&&Q.setLinkForCell(x,x.value);x.geometry.width+=Q.gridSize;x.geometry.height+=Q.gridSize}finally{Q.getModel().endUpdate()}return[x]}}return[]};-EditorUi.prototype.formatFileSize=function(c){var f=-1;do c/=1024,f++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[f]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var f=c.indexOf(";");0<f&&(c=c.substring(0,f)+c.substring(c.indexOf(",",f+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,f){return/("contentType":\s*"application\/gliffy\+json")/.test(c)};EditorUi.prototype.isLucidChartData=function(c){return null!=-c&&('{"state":"{\\"Properties\\":'==c.substring(0,26)||'{"Properties":'==c.substring(0,14))};EditorUi.prototype.importLocalFile=function(c,f){if(c&&Graph.fileSupport){if(null==this.importFileInputElt){var k=document.createElement("input");k.setAttribute("type","file");mxEvent.addListener(k,"change",mxUtils.bind(this,function(){null!=k.files&&(this.importFiles(k.files,null,null,this.maxImageSize),k.type="",k.type="file",k.value="")}));k.style.display="none";document.body.appendChild(k);this.importFileInputElt=-k}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(E,L){StorageFile.listFiles(this,"F",E,L)});window.openBrowserFile=mxUtils.bind(this,function(E,L,Q){StorageFile.getFileContent(this,E,L,Q)});window.deleteBrowserFile=mxUtils.bind(this,function(E,L,Q){StorageFile.deleteFile(this,E,L,Q)});if(!f){var q=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=new OpenFile(mxUtils.bind(this,function(E){this.hideDialog(E)}));-window.openFile.setConsumer(mxUtils.bind(this,function(E,L){null!=L&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(L)?(E=new Blob([E],{type:"application/octet-stream"}),this.importVisio(E,mxUtils.bind(this,function(Q){this.importXml(Q,0,0,!0)}),null,L)):this.editor.graph.setSelectionCells(this.importXml(E,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!f){var x=this.dialog,B=x.close;-this.dialog.close=mxUtils.bind(this,function(E){Editor.useLocalStorage=q;B.apply(x,arguments);E&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,f,k){var q=this,x=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(B){if(mxUtils.isEmptyObject(B.files))k();else{var E=0,L,Q=!1;B.forEach(function(V,K){V=K.name.toLowerCase();"diagram/diagram.xml"==V?(Q=!0,K.async("string").then(function(fa){0==-fa.indexOf("<mxfile ")?f(fa):k()})):0==V.indexOf("versions/")&&(V=parseInt(V.substr(9)),V>E&&(E=V,L=K))});0<E?L.async("string").then(function(V){(new XMLHttpRequest).upload&&q.isRemoteFileFormat(V,c.name)?q.isOffline()?q.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):q.parseFileData(V,mxUtils.bind(this,function(K){4==K.readyState&&(200<=K.status&&299>=K.status?f(K.responseText):k())}),c.name):k()}):Q||k()}},function(B){k(B)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||-this.isOffline(!0)?x():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",x,null,null,null,k))};EditorUi.prototype.importFile=function(c,f,k,q,x,B,E,L,Q,V,K,fa){V=null!=V?V:!0;var aa=!1,da=null,ba=mxUtils.bind(this,function(ha){var qa=null;null!=ha&&"<mxlibrary"==ha.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,ha,E)),this.showSidebar()):qa=this.importXml(ha,k,q,V,null,null!=fa?mxEvent.isControlDown(fa):null);null!=L&&L(qa)});"image"==f.substring(0,5)?(Q=-!1,"image/png"==f.substring(0,9)&&(K=K?null:this.extractGraphModelFromPng(c),null!=K&&0<K.length&&(da=this.importXml(K,k,q,V,null,null!=fa?mxEvent.isControlDown(fa):null),Q=!0)),Q||(Q=this.editor.graph,K=c.indexOf(";"),0<K&&(c=c.substring(0,K)+c.substring(c.indexOf(",",K+1))),V&&Q.isGridEnabled()&&(k=Q.snap(k),q=Q.snap(q)),K="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==f.substring(0,9)&&(K+="editableCssRules=.*;"),-da=[Q.insertVertex(null,null,"",k,q,x,B,K+"image="+c+";")])):/(\.*<graphml )/.test(c)?(aa=!0,this.importGraphML(c,ba)):null!=Q&&null!=E&&EditorUi.isVisioFilename(E)?(aa=!0,this.importVisio(Q,ba)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,E)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(aa=!0,f=mxUtils.bind(this,function(ha){4==ha.readyState&&(200<=ha.status&&299>=ha.status?ba(ha.responseText):null!=L&&(L(null),this.showError(mxResources.get("error"),-413==ha.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,f,E):this.parseFile(Q,f,E)):0==c.indexOf("PK")&&null!=Q?(aa=!0,this.importZipFile(Q,ba,mxUtils.bind(this,function(){da=this.insertTextAt(this.validateFileData(c),k,q,!0,null,V);L(da)}))):/(\.v(sd|dx))($|\?)/i.test(E)||/(\.vs(s|x))($|\?)/i.test(E)||(da=this.insertTextAt(this.validateFileData(c),k,q,!0,null,V,null,null!=fa?mxEvent.isControlDown(fa):null));aa||null==L||L(da);return da};-EditorUi.prototype.importFiles=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa){q=null!=q?q:this.maxImageSize;V=null!=V?V:this.maxImageBytes;var da=null!=f&&null!=k,ba=!0;f=null!=f?f:0;k=null!=k?k:0;var ha=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var qa=K||this.resampleThreshold,ra=0;ra<c.length;ra++)if("image/svg"!==c[ra].type.substring(0,9)&&"image/"===c[ra].type.substring(0,6)&&c[ra].size>qa){ha=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[f],"y",[k],"maxSize",[q],"maxBytes",[V],-"resampleThreshold",[this.resampleThreshold],"largeImages",[ha],"crop",[da],"resizeImages",[ba],"ignoreEmbeddedXml",[fa],"evt",[aa]);var l=mxUtils.bind(this,function(){var t=this.editor.graph,H=t.gridSize;x=null!=x?x:mxUtils.bind(this,function(ka,X,ja,na,la,va,za,sa,wa){try{if(null!=ka&&"<mxlibrary"==ka.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,ka,za)),this.showSidebar(),null;this.isCompatibleString(ka)&&1==c.length&&null!=aa&&"drop"==aa.type&&this.isBlankFile()&&-!this.canUndo()&&(da=!1,na=ja=0);return this.importFile(ka,X,ja,na,la,va,za,sa,wa,da,fa,aa)}catch(Ca){return this.handleError(Ca),null}});B=null!=B?B:mxUtils.bind(this,function(ka){t.setSelectionCells(ka)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var J=this.currentPage,R=c.length,T=R,Y=[],Z=mxUtils.bind(this,function(ka,X){Y[ka]=X;if(0==--T){this.spinner.stop();if(null!=L)L(Y);else{var ja=[];t.getModel().beginUpdate();try{for(ka=0;ka<Y.length;ka++){var na=Y[ka]();null!=-na&&(ja=ja.concat(na))}}finally{t.getModel().endUpdate()}}J!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);B(ja)}}),ia=0;ia<R;ia++)mxUtils.bind(this,function(ka){var X=c[ka];if(null!=X){var ja=new FileReader;ja.onload=mxUtils.bind(this,function(na){if(null==E||E(X))try{if("image/"==X.type.substring(0,6))if("image/svg"==X.type.substring(0,9)){var la=Graph.clipSvgDataUri(na.target.result),va=la.indexOf(","),za=decodeURIComponent(escape(atob(la.substring(va+-1)))),sa=mxUtils.parseXml(za),wa=sa.getElementsByTagName("svg");if(0<wa.length){var Ca=wa[0],Fa=fa?null:Ca.getAttribute("content");null!=Fa&&"<"!=Fa.charAt(0)&&"%"!=Fa.charAt(0)&&(Fa=unescape(window.atob?atob(Fa):Base64.decode(Fa,!0)));null!=Fa&&"%"==Fa.charAt(0)&&(Fa=decodeURIComponent(Fa));null==Fa||"<mxfile "!==Fa.substring(0,8)&&"<mxGraphModel>"!==Fa.substring(0,14)&&"<mxGraphModel "!==Fa.substring(0,14)?Z(ka,mxUtils.bind(this,function(){try{if(null!=sa){var La=sa.getElementsByTagName("svg");-if(0<La.length){var Da=La[0],Sa=Da.getAttribute("width"),Oa=Da.getAttribute("height");Sa=null!=Sa&&"%"!=Sa.charAt(Sa.length-1)?parseFloat(Sa):NaN;Oa=null!=Oa&&"%"!=Oa.charAt(Oa.length-1)?parseFloat(Oa):NaN;var Ta=Da.getAttribute("viewBox");if(null==Ta||0==Ta.length)Da.setAttribute("viewBox","0 0 "+Sa+" "+Oa);else if(isNaN(Sa)||isNaN(Oa)){var Ua=Ta.split(" ");3<Ua.length&&(Sa=parseFloat(Ua[2]),Oa=parseFloat(Ua[3]))}la=Editor.createSvgDataUri(mxUtils.getXml(Da));var Ba=Math.min(1,Math.min(q/Math.max(1,-Sa)),q/Math.max(1,Oa)),Ka=x(la,X.type,f+ka*H,k+ka*H,Math.max(1,Math.round(Sa*Ba)),Math.max(1,Math.round(Oa*Ba)),X.name);if(null!=Ka&&(isNaN(Sa)||isNaN(Oa))){var ab=new Image;ab.onload=mxUtils.bind(this,function(){Sa=Math.max(1,ab.width);Oa=Math.max(1,ab.height);Ka[0].geometry.width=Sa;Ka[0].geometry.height=Oa;Da.setAttribute("viewBox","0 0 "+Sa+" "+Oa);la=Editor.createSvgDataUri(mxUtils.getXml(Da));var Qa=la.indexOf(";");0<Qa&&(la=la.substring(0,Qa)+la.substring(la.indexOf(",",Qa+1)));t.setCellStyles("image",-la,[Ka[0]])});ab.src=Editor.createSvgDataUri(mxUtils.getXml(Da))}return Ka}}}catch(Qa){}return null})):Z(ka,mxUtils.bind(this,function(){return x(Fa,"text/xml",f+ka*H,k+ka*H,0,0,X.name)}))}else Z(ka,mxUtils.bind(this,function(){return null}))}else{va=!1;if("image/png"==X.type){var Ha=fa?null:this.extractGraphModelFromPng(na.target.result);if(null!=Ha&&0<Ha.length){var Na=new Image;Na.src=na.target.result;Z(ka,mxUtils.bind(this,function(){return x(Ha,"text/xml",f+ka*H,k+ka*H,Na.width,Na.height,X.name)}));-va=!0}}va||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(na.target.result,mxUtils.bind(this,function(La){this.resizeImage(La,Editor.stripImageMetadata(na.target.result,Editor.removeImageMetadata),mxUtils.bind(this,function(Da,Sa,Oa){Z(ka,mxUtils.bind(this,-function(){if(null!=Da&&Da.length<V){var Ta=ba&&this.isResampleImageSize(X.size,K)?Math.min(1,Math.min(q/Sa,q/Oa)):1;return x(Da,X.type,f+ka*H,k+ka*H,Math.round(Sa*Ta),Math.round(Oa*Ta),X.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),ba,q,K,X.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else la=na.target.result,x(la,X.type,f+ka*H,k+ka*H,240,160,X.name,function(La){Z(ka,function(){return La})},X)}catch(La){Z(ka,-mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(La,X)}else Z(ka,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(X.name)?x(null,X.type,f+ka*H,k+ka*H,240,160,X.name,function(na){Z(ka,function(){return na})},X):"image"==X.type.substring(0,5)||"application/pdf"==X.type?ja.readAsDataURL(X):ja.readAsText(X)}})(ia)});if(ha){ha=[];for(ra=0;ra<c.length;ra++)ha.push(c[ra]);c=ha;this.confirmImageResize(function(t){ba=t;l()},Q)}else l()};EditorUi.prototype.isBlankFile=-function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,f){f=null!=f?f:!1;var k=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},q=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,x=function(B,E){if(B||f)mxSettings.setResizeImages(B?E:null),mxSettings.save();k();c(E)};null==q||f?this.showDialog((new ConfirmDialog(this,-mxResources.get("resizeLargeImages"),function(B){x(B,!0)},function(B){x(B,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):x(!1,q)};EditorUi.prototype.parseFile=function(c,f,k){k=null!=k?k:c.name;var q=new FileReader;q.onload=mxUtils.bind(this,function(){this.parseFileData(q.result,-f,k)});q.readAsText(c)};EditorUi.prototype.parseFileData=function(c,f,k){var q=new XMLHttpRequest;q.open("POST",OPEN_URL);q.setRequestHeader("Content-Type","application/x-www-form-urlencoded");q.onreadystatechange=function(){f(q)};q.send("format=xml&filename="+encodeURIComponent(k)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(x){}};EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>-f};EditorUi.prototype.resizeImage=function(c,f,k,q,x,B,E){x=null!=x?x:this.maxImageSize;var L=Math.max(1,c.width),Q=Math.max(1,c.height),V=f;if(q&&this.isResampleImageSize(null!=E?E:f.length,B))try{var K=Math.max(L/x,Q/x);if(1<K){var fa=Math.round(L/K),aa=Math.round(Q/K),da=document.createElement("canvas");da.width=fa;da.height=aa;da.getContext("2d").drawImage(c,0,0,fa,aa);var ba=da.toDataURL();if(ba.length<f.length){var ha=document.createElement("canvas");ha.width=fa;ha.height=aa;var qa=ha.toDataURL();-ba!==qa&&(f=ba,L=fa,Q=aa)}}}catch(ra){}q&&V!=f&&x>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,k,q,x/1.5,B,E):k(f,L,Q)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,f,k){try{var q=new Image;q.onload=function(){q.width=0<q.width?q.width:120;q.height=0<q.height?q.height:120;f(q)};null!=k&&(q.onerror=k);q.src=c}catch(x){if(null!=k)k(x);else throw x;}};EditorUi.prototype.getDefaultSketchMode=-function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var v=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){if(Editor.isSettingsEnabled()){null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles);this.formatWidth=mxSettings.getFormatWidth();var c=mxSettings.getSidebarWidth();null!=c&&(this.hsplitPosition=parseInt(c))}this.formatEnabled||(this.formatWidth=0);this.sidebarEnabled||(this.hsplitPosition=-0);v.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var n=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,f=this.editor.graph;"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.installAutoRouting&&LibavoidRouting.installAutoRouting(this);-this.addListener("styleChanged",mxUtils.bind(this,function(X,ja){ja.getProperty("force")&&"undefined"!==typeof mxSettings&&null!=mxSettings.setCurrentEdgeStyle&&null!=mxSettings.settings&&mxSettings.setCurrentEdgeStyle(mxUtils.clone(this.editor.graph.currentEdgeStyle))}));this.restorePersistedEdgeStyle();if(this.editor.isChromelessView()&&"0"!=urlParams.animate){var k=null,q=function(){var X=f.getModel().getRoot();if(X===k&&null!=c.chromelessAnimationPlayer)return!0;k=X;null!=c.chromelessAnimationPlayer&&-c.chromelessAnimationPlayer.stop();c.chromelessAnimationPlayer=Editor.playAnimationOnGraph(f);return null!=c.chromelessAnimationPlayer};q();this.editor.addListener("fileLoaded",q);f.addListener(mxEvent.ROOT,q)}var x=f.isEnabled;f.isEnabled=function(){return x.apply(this,arguments)&&!c.isLocked()};f.showLinkIcons=Editor.showLinkIcons||"1"==urlParams["link-icons"];f.showTooltipIcons=Editor.showTooltipIcons||"1"==urlParams["tooltip-icons"];var B=this;f.editTooltip=function(X){null!=X&&B.actions.get("editTooltip").funct()};-f.getLinkOverlayTooltip=function(X){if(Graph.isPageLink(X)&&null!=B.pages){var ja=X.substring(X.indexOf(",")+1);ja=B.getPageById(ja);if(null!=ja)return ja.getName()||mxResources.get("pageWithNumber",[mxUtils.indexOf(B.pages,ja)+1])}else if(this.isCustomLink(X))return this.getLinkTitle(X);return X};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(X){var ja=X.getEvent();return null==X.getState()&&!mxEvent.isMouseEvent(ja)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(ja)&&(null==X.getState()||-mxEvent.isControlDown(ja)||mxEvent.isShiftDown(ja))});var E=function(X){X=/(?:^|;)groupPadding=([^;]*)/.exec(null!=X?X:"");return null!=X?X[1]:null};f.model.addListener(mxEvent.BEFORE_UNDO,function(X,ja){X=ja.getProperty("edit");if(null!=X&&null!=X.changes){ja=X.changes.length;for(var na=[],la=0;la<ja;la++){var va=X.changes[la];va instanceof mxStyleChange&&null!=va.cell&&f.model.isVertex(va.cell)&&E(va.style)!=E(va.previous)&&/(?:^|;)shape=image(?:;|$)/.test(null!=va.style?va.style:"")&&(null!=f.getAttributeForCell(va.cell,-"mermaidData")||null!=f.getAttributeForCell(va.cell,"plantUmlData"))&&0>mxUtils.indexOf(na,va.cell)&&na.push(va.cell)}for(la=0;la<na.length;la++)c.refreshMermaidImage(na[la])}});var L=function(X){var ja=!1;c.showDialog(X.container,640,420,!0,!0,function(na,la){if(!ja&&X.shouldConfirmClose())return c.confirm(mxResources.get("allChangesLost"),null,function(){ja=!0;c.hideDialog(!0)},mxResources.get("cancel"),mxResources.get("discardChanges")),!1},null,null,new mxRectangle(0,0,320,280),!0);X.init()};-f.cellEditor.editPlantUmlData=function(X,ja,na){var la=JSON.parse(na);ja=f.getCurrentCellStyle(X);var va=mxUtils.getValue(ja,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,za=null==la.format&&!va;ja="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var sa=document.createElement("select");sa.className="geBtn";na=document.createElement("option");na.setAttribute("value","plantUmlDiagram");mxUtils.write(na,mxResources.get("diagram"));sa.appendChild(na);na=document.createElement("option");-na.setAttribute("value","plantUmlImage");mxUtils.write(na,mxResources.get("image"));sa.appendChild(na);sa.value=va?"plantUmlImage":"plantUmlDiagram";var wa=new SimpleTextareaDialog(c,la.data,function(Ca){if(null!=Ca&&c.spinner.spin(document.body,mxResources.get("inserting"))){var Fa="plantUmlImage"==sa.value,Ha=za?la.config:null;c.parsePlantUmlDiagram(Ca,Ha,function(Na){c.spinner.stop();wa.hide();try{f.getModel().beginUpdate();try{if(va&&Fa)c.updateMermaidImage(X,Ca,null,Na,c.getMermaidImageBorder(X,-la.border),"plantUmlData");else if(za&&!Fa)c.replaceLockedGroupChildren(X,Na,Ca,Ha,{wrapGroup:mxPlantUmlToDrawio.wrapGroup,dataAttr:"plantUmlData",attrPrefix:"plantUml"});else{var La=c.getMermaidImageBorder(X,la.border),Da=c.replaceMermaidCell(X,Fa?c.createMermaidImageXml(Ca,null,Na,null,La,"plantUmlData"):mxPlantUmlToDrawio.wrapGroup(Na,Ca,Ha));Fa||null==La||f.setCellStyles("groupPadding",La,Da)}}finally{f.getModel().endUpdate()}}catch(Sa){c.handleError(Sa)}},function(Na){c.spinner.stop();c.handleError(Na)})}},-null,null,ja?sa:null,!0);L(wa)};f.cellEditor.editMermaidData=function(X,ja,na){var la=JSON.parse(na);ja=f.getCurrentCellStyle(X);var va=mxUtils.getValue(ja,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE;ja="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var za=document.createElement("select");za.className="geBtn";na=document.createElement("option");na.setAttribute("value","mermaid");mxUtils.write(na,mxResources.get("diagram"));za.appendChild(na);na=document.createElement("option");-na.setAttribute("value","mermaidImage");mxUtils.write(na,mxResources.get("image"));za.appendChild(na);za.value=va?"mermaidImage":"mermaid";var sa=new SimpleTextareaDialog(c,la.data,function(wa){if(null!=wa&&c.spinner.spin(document.body,mxResources.get("inserting"))){var Ca="mermaidImage"==za.value,Fa=Ca?EditorUi.legacyMermaidConfig:va?null:la.config;c.parseMermaidDiagram(wa,mxUtils.clone(Fa),function(Ha){c.spinner.stop();sa.hide();try{f.getModel().beginUpdate();try{if(va&&Ca)c.updateMermaidImage(X,-wa,null,Ha,c.getMermaidImageBorder(X,la.border));else if(va||Ca){var Na=c.getMermaidImageBorder(X,la.border),La=c.replaceMermaidCell(X,Ca?c.createMermaidImageXml(wa,null,Ha,null,Na):mxMermaidToDrawio.wrapGroup(Ha,wa,Fa));Ca||null==Na||f.setCellStyles("groupPadding",Na,La)}else c.replaceLockedGroupChildren(X,Ha,wa,Fa)}finally{f.getModel().endUpdate()}}catch(Da){c.handleError(Da)}},function(Ha){c.spinner.stop();c.handleError(Ha)})}},null,null,ja?za:null,!0);L(sa)};var Q=f.cellEditor.startEditing;f.cellEditor.startEditing=-function(X,ja,na){try{var la=this.graph.getLockedGroupAncestor(X);null!=la&&(X=la);var va=this.graph.getAttributeForCell(X,"plantUmlData");if(null!=va)this.editPlantUmlData(X,ja,va);else if(va=this.graph.getAttributeForCell(X,"mermaidData"),null!=va&&EditorUi.isMermaidSupported())this.editMermaidData(X,ja,va);else{var za=f.getCellStyle(X);"1"==mxUtils.getValue(za,"metaEdit","0")?c.showDataDialog(X):Q.call(this,X,ja,na)}}catch(sa){c.handleError(sa)}};f.getLinkTitle=function(X){return c.getLinkTitle(X)};-f.customLinkClicked=function(X,ja){var na=!1;try{var la=this.view.graphBounds,va=null!=la?new mxRectangle(la.x,la.y,la.width,la.height):null;c.handleCustomLink(X,ja);na=!0;var za=this.view.graphBounds;c.chromelessResize&&null!=va&&null!=za&&!va.equals(za)&&(c.chromelessResize(),this.scrollCellToVisible(ja))}catch(sa){c.handleError(sa)}return na};var V=f.parseBackgroundImage;f.parseBackgroundImage=function(X){var ja=V.apply(this,arguments);null!=ja&&null!=ja.src&&Graph.isPageLink(ja.src)&&(ja={originalSrc:ja.src});-return ja};var K=f.setBackgroundImage;f.setBackgroundImage=function(X){null!=X&&null!=X.originalSrc&&(X=c.createImageForPageLink(X.originalSrc,c.currentPage,this));K.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,function(X,ja){X=null!=f.backgroundImage?f.backgroundImage.originalSrc:-null;if(null!=X){var na=X.indexOf(",");if(0<na)for(X=X.substring(na+1),ja=ja.getProperty("patches"),na=0;na<ja.length;na++)if(null!=ja[na][EditorUi.DIFF_UPDATE]&&null!=ja[na][EditorUi.DIFF_UPDATE][X]||null!=ja[na][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(ja[na][EditorUi.DIFF_REMOVE],X)){f.refreshBackgroundImage();break}}}));var fa=f.getBackgroundImageObject;f.getBackgroundImageObject=function(X,ja,na){var la=fa.apply(this,arguments);null!=la&&null!=la.originalSrc&&(la=ja?c.createImageForPageLink(la.originalSrc,-na,null,!0):{src:la.originalSrc});return la};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var aa=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(X){X=null!=X?X:"";"1"==urlParams.dev&&(X+=(0<X.length?"&":"?")+-"dev=1");"1"==urlParams.test&&(X+=(0<X.length?"&":"?")+"test=1");return aa.apply(this,arguments)};var da=f.addClickHandler;f.addClickHandler=function(X,ja,na){var la=ja;ja=function(va,za,sa){if(null==za){var wa=mxEvent.getSource(va);"a"==wa.nodeName.toLowerCase()&&(za=wa.getAttribute("href"))}null!=za&&f.isCustomLink(za)&&(mxEvent.isTouchEvent(va)||!mxEvent.isPopupTrigger(va))&&f.customLinkClicked(za,sa)&&mxEvent.consume(va);null!=la&&la(va,za,sa)};da.call(this,X,ja,na)};n.apply(this,arguments);Graph.browserTranslate&&-f.waitForBrowserTranslate();this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var ba=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(X,ja,na){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(X,["zoomIn","zoomOut","-"],null,na);if(Editor.passiveScroll&&null!=na){var la=mxUtils.convertPoint(f.container,mxEvent.getClientX(na),mxEvent.getClientY(na));f._contextMenuPoint=new mxPoint(f.snap(la.x/f.view.scale-f.view.translate.x),-f.snap(la.y/f.view.scale-f.view.translate.y));f._contextMenuScreenPoint=mxUtils.convertPoint(f.container,mxEvent.getClientX(na),mxEvent.getClientY(na))}f.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",X,null),X.addSeparator());ba.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||this.addMenuItems(X,["-","addToScratchpad"],null,na);f.isSelectionEmpty()&&!this.isShowStyleItems()&&this.addMenuItems(X,["-","exitGroup","home"],null,-na)};var ha=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(X,ja,na){if(c.editor.graph.isSelectionEmpty())ha.apply(this,arguments),c.menus.addMenuItems(X,["copyAsImage","copyAsSvg"],null,na);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(X,ja,na):this.addPopupMenuArrangeItems(X,ja,na),this.addMenuItems(X,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),null,na),Editor.passiveScroll&&(1==f.getSelectionCount()?this.addMenuItems(X,["-","copyStyle","pasteStyle",-"copyTextStyle","pasteTextStyle"],null,na):this.addMenuItems(X,["-","pasteStyle","pasteTextStyle"],null,na)),this.addMenuItems(X,["-"],null,na),this.isShowCellEditItems()||this.addPopupDeleteItem(X,ja,na),this.addMenuItems(X,["lockUnlock","-"],null,na),!this.isShowStyleItems()){if(1==f.getSelectionCount()&&!f.isCellLocked(ja)&&f.isCellEditable(ja)&&(this.addSubmenu("editCell",X,null,mxResources.get("edit")),X.addSeparator(),f.getModel().isEdge(ja))){this.addSubmenu("line",X);var la=f.getModel().getGeometry(ja);-null!=la&&null!=la.points&&0<la.points.length&&this.addMenuItems(X,["clearWaypoints"],null,na)}1==f.getSelectionCount()&&this.addMenuItems(X,["enterGroup"],null,na);la=c.getSelectionState();null!=la.mergeCell?this.addMenuItem(X,"mergeCells"):(1<la.style.colspan||1<la.style.rowspan)&&this.addMenuItem(X,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=function(){return"simple"!=-Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}if(Editor.passiveScroll){var qa=f.getCenterInsertPoint;f.getCenterInsertPoint=function(X){if(null!=this._contextMenuPoint){var ja=this._contextMenuPoint;X=null!=X?X:new mxRectangle;return new mxPoint(f.snap(ja.x-(X.width||0)/2),f.snap(ja.y-(X.height||0)/2))}return qa.apply(this,arguments)};var ra=f.popupMenuHandler.hideMenu;f.popupMenuHandler.hideMenu=function(){ra.apply(this,-arguments);window.setTimeout(function(){f._contextMenuPoint=null;f._contextMenuScreenPoint=null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var l=f.getExportVariables;f.getExportVariables=function(){var X=l.apply(this,arguments),ja=c.getCurrentFile();null!=ja&&(X.filename=ja.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var na in c.fileVars)null==X[na]&&(X[na]=-c.fileVars[na]);X.pagecount=null!=c.pages?c.pages.length:1;X.page=null!=c.currentPage?c.currentPage.getName():"";X.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return X};var t=f.getGlobalVariable;f.getGlobalVariable=function(X){var ja=c.getCurrentFile();if("filename"==X&&null!=ja)return ja.getTitle();if("page"==X&&null!=c.currentPage)return c.currentPage.getName();if("pagenumber"==X)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+-1:1;if("pagecount"==X)return null!=c.pages?c.pages.length:1;ja=t.apply(this,arguments);null==ja&&(c.updateFileVars(),null!=c.fileVars&&(ja=c.fileVars[X]));return ja};var H=null,J=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var X=this.getCurrentFile(),ja=null!=X&&null!=X.getTitle()?X.getTitle():this.defaultFilename;H!=ja&&X==J&&(f.invalidateDescendantsWithPlaceholders(f.model.getRoot()),f.view.validate());H=ja;J=X}));var R=f.labelLinkClicked;f.labelLinkClicked=function(X,-ja,na){var la=ja.getAttribute("href");if(null==la||!f.isCustomLink(la)||!mxEvent.isTouchEvent(na)&&mxEvent.isPopupTrigger(na))R.apply(this,arguments);else{if(!f.isEnabled()||null!=X&&f.isCellLocked(X.cell))f.customLinkClicked(la),f.getRubberband().reset();mxEvent.consume(na)}};this.editor.getOrCreateFilename=function(){var X=c.defaultFilename,ja=c.getCurrentFile();null!=ja&&(X=null!=ja.getTitle()?ja.getTitle():X);return X};q=this.actions.get("print");q.setEnabled(!mxClient.IS_IOS||!navigator.standalone);-q.visible=q.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),this.keyHandler.bindAction(76,!1,"insertLink"),this.keyHandler.bindAction(82,!1,"insertRhombus"),-this.keyHandler.bindAction(67,!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize",this.installKeyboardShortcuts(),"1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||-f.addListener(mxEvent.ESCAPE,function(X,ja){null!=ja&&f.isEnabled()&&!f.isEditing()&&null!=ja.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(X){var ja=f.cellEditor.text2,na=null;null!=ja&&(mxEvent.addListener(ja,"dragleave",function(la){null!=-na&&(na.parentNode.removeChild(na),na=null);la.stopPropagation();la.preventDefault()}),mxEvent.addListener(ja,"dragover",mxUtils.bind(this,function(la){null==na&&(na=this.highlightElement(ja));la.stopPropagation();la.preventDefault()})),mxEvent.addListener(ja,"drop",mxUtils.bind(this,function(la){null!=na&&(na.parentNode.removeChild(na),na=null);if(0<la.dataTransfer.files.length)this.importFiles(la.dataTransfer.files,0,0,this.maxImageSize,function(za,sa,wa,Ca,Fa,Ha){f.insertImage(za,Fa,Ha)},function(){},-function(za){return"image/"==za.type.substring(0,6)},function(za){for(var sa=0;sa<za.length;sa++)za[sa]()},mxEvent.isControlDown(la));else if(0<=mxUtils.indexOf(la.dataTransfer.types,"text/uri-list")){var va=la.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(va)?this.loadImage(decodeURIComponent(va),mxUtils.bind(this,function(za){var sa=Math.max(1,za.width);za=Math.max(1,za.height);var wa=this.maxImageSize;wa=Math.min(1,Math.min(wa/Math.max(1,sa)),wa/Math.max(1,za));f.insertImage(decodeURIComponent(va),-sa*wa,za*wa)})):document.execCommand("insertHTML",!1,la.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(la.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,la.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(la.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,la.dataTransfer.getData("text/plain"));la.stopPropagation();la.preventDefault()})))}));if(Editor.isSettingsEnabled()){q=this.editor.graph.view;var T=mxSettings.getUnit();q.setUnit(T);-Editor.pageSizeUnit=T;q.addListener("unitChanged",function(X,ja){X=ja.getProperty("unit");mxSettings.setUnit(X);mxSettings.save();Editor.pageSizeUnit=X});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,q.unit);this.refresh()}if("1"==urlParams.styledev){q=document.getElementById("geFooter");null!=q&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type",-"text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),q.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,-function(X,ja){0<this.editor.graph.getSelectionCount()?(X=this.editor.graph.getSelectionCell(),X=this.editor.graph.getModel().getStyle(X),this.styleInput.value=X||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var Y=this.isSelectionAllowed;this.isSelectionAllowed=function(X){return mxEvent.getSource(X)==this.styleInput?!0:Y.apply(this,arguments)}}q=document.getElementById("geInfo");null!=q&&q.parentNode.removeChild(q);if(Graph.fileSupport&&(!this.editor.chromeless||-this.editor.editable)){var Z=null;mxEvent.addListener(f.container,"dragleave",function(X){f.isEnabled()&&(null!=Z&&(Z.parentNode.removeChild(Z),Z=null),X.stopPropagation(),X.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(X){null==Z&&(Z=this.highlightElement(f.container));null!=this.sidebar&&this.sidebar.hideTooltip();X.stopPropagation();X.preventDefault()}));mxEvent.addListener(f.container,"drop",mxUtils.bind(this,function(X){null!=Z&&(Z.parentNode.removeChild(Z),-Z=null);if(f.isEnabled()){var ja=mxUtils.convertPoint(f.container,mxEvent.getClientX(X),mxEvent.getClientY(X)),na=X.dataTransfer.files,la=f.view.translate,va=f.view.scale,za=ja.x/va-la.x,sa=ja.y/va-la.y;if(0<na.length)ja=this.isBlankFile()&&!this.canUndo(),la=1==na.length&&(EditorUi.isVisioFilename(na[0].name)||/(\.drawio)$/i.test(na[0].name)||/(\.xml)$/i.test(na[0].name)),"1"!=urlParams.embed&&ja&&(la||mxEvent.isShiftDown(X))?(ja=this.getCurrentFile(),null!=ja&&ja.isModified()||this.fileLoaded(null,-!0),this.openFiles(na,!0,mxUtils.bind(this,function(){var La=this.getCurrentFile();null!=La&&La.fileChanged()}))):(mxEvent.isAltDown(X)&&(sa=za=null),this.importFiles(na,za,sa,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(X),null,null,mxEvent.isShiftDown(X),X));else{mxEvent.isAltDown(X)&&(sa=za=0);var wa=0<=mxUtils.indexOf(X.dataTransfer.types,"text/uri-list")?X.dataTransfer.getData("text/uri-list"):null;na=this.extractGraphModelFromEvent(X,null!=this.pages);if(null!=na)f.setSelectionCells(this.importXml(na,-za,sa,!0));else if(0<=mxUtils.indexOf(X.dataTransfer.types,"text/html")){var Ca=X.dataTransfer.getData("text/html");na=document.createElement("div");na.innerHTML=Graph.sanitizeHtml(Ca);var Fa=null;ja=na.getElementsByTagName("img");null!=ja&&1==ja.length?(Ca=ja[0].getAttribute("src"),null==Ca&&(Ca=ja[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Ca)||(Fa=!0)):(ja=na.getElementsByTagName("a"),null!=ja&&1==ja.length?Ca=ja[0].getAttribute("href"):(na=na.getElementsByTagName("pre"),-null!=na&&1==na.length&&(Ca=mxUtils.getTextContent(na[0]))));var Ha=!0,Na=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(Ca,za,sa,!0,Fa,null,Ha,mxEvent.isControlDown(X)))});Fa&&null!=Ca&&Ca.length>this.resampleThreshold?this.confirmImageResize(function(La){Ha=La;Na()},mxEvent.isControlDown(X)):Na()}else null!=wa&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(wa)?this.loadImage(decodeURIComponent(wa),mxUtils.bind(this,function(La){var Da=Math.max(1,La.width);La=Math.max(1,La.height);var Sa=-this.maxImageSize;Sa=Math.min(1,Math.min(Sa/Math.max(1,Da)),Sa/Math.max(1,La));f.setSelectionCell(f.insertVertex(null,null,"",za,sa,Da*Sa,La*Sa,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+wa+";"))}),mxUtils.bind(this,function(La){f.setSelectionCells(this.insertTextAt(wa,za,sa,!0))})):0<=mxUtils.indexOf(X.dataTransfer.types,"text/plain")&&f.setSelectionCells(this.insertTextAt(X.dataTransfer.getData("text/plain"),za,sa,-!0))}}X.stopPropagation();X.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&f.view.validateBackground()});-f.addListener("enabledChanged",mxUtils.bind(this,function(){f.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var X=parseInt(this.div.offsetLeft),ja=parseInt(this.div.offsetWidth),na=c.embedViewport.x+c.embedViewport.width,la=parseInt(this.div.offsetTop),va=parseInt(this.div.offsetHeight),za=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,-Math.min(X,na-ja))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(la,za-va))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};var ia=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(X,ja){ia.call(this,X,ja);c.hideCurrentMenu()};var ka=mxWindow.prototype.setSize;mxWindow.prototype.setSize=function(X,ja){ka.call(this,X,ja);c.hideCurrentMenu()};-if(!this.editor.chromeless||this.editor.editable){q=Editor.currentTheme;if("simple"==q||"sketch"==q)this.doSetCurrentTheme(q,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(T=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,T<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==q&&T<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==q&&(this.lastWindowWidth=T)),this.fireEvent(new mxEventObject("themeInitialized"));this.restoreVisibleWindows();-"kennedy"==q&&(T=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,T<Editor.smallScreenWidth&&(this.formatWidth=0),T<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),this.lastWindowWidth=T)}q=!1;if(null!=urlParams.dark)q=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)q="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||q&&"auto"!=mxSettings.settings.darkMode||(q=mxSettings.settings.darkMode);"auto"==q&&this.isAutoDarkModeSupported()&&-(q=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof q?"1"==q:q);if(this.isAutoDarkModeSupported())try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(X){this.isAutoDarkMode()&&this.setDarkMode(X.matches)}))}catch(X){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast?-this.setHighContrast(mxSettings.settings.highContrast):null!=window.matchMedia&&window.matchMedia("(prefers-contrast: more)").matches&&this.setHighContrast(!0);Editor.isSettingsEnabled()&&(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(X,-ja){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var y=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||-document.body.clientWidth,f=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));f=Editor.smallScreenWidth-160;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,!0):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&!this.isShapesPanelVisible()&&-this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}y.apply(this,arguments);null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,k=this.sketchPickerMenuElt,q=this.editor.graph;k.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(V){mxEvent.getSource(V)==this.diagramContainer.parentNode&&(this.embedExitPoint=-new mxPoint(mxEvent.getClientX(V),mxEvent.getClientY(V)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var x=document.createElement("div");x.style.position="absolute";x.style.width="10px";x.style.height="10px";x.style.borderRadius="5px";x.style.border="1px solid gray";x.style.background="#ffffff";x.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(x);this.bottomResizer=x;var B=null,E=null,L=null,Q=null;mxEvent.addGestureListeners(x,mxUtils.bind(this,function(V){Q=-parseInt(this.diagramContainer.style.height);E=mxEvent.getClientY(V);q.popupMenuHandler.hideMenu();mxEvent.consume(V)}));x=x.cloneNode(!1);x.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(x);this.rightResizer=x;mxEvent.addGestureListeners(x,mxUtils.bind(this,function(V){L=parseInt(this.diagramContainer.style.width);B=mxEvent.getClientX(V);q.popupMenuHandler.hideMenu();mxEvent.consume(V)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(V){var K=!1;-null!=B&&(this.diagramContainer.style.width=Math.max(20,L+mxEvent.getClientX(V)-B)+"px",K=!0);null!=E&&(this.diagramContainer.style.height=Math.max(20,Q+mxEvent.getClientY(V)-E)+"px",K=!0);K&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(V){null==B&&null==E||mxEvent.consume(V);E=B=null});document.body.style.backgroundColor=-"transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(V){this.inlineSizeChanged();Editor.passiveScroll?this.hideWindows():this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(V){this.diagramContainer.style.width=-"10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){k.innerHTML=" ";k.focus();try{var B=document.createRange();-B.selectNodeContents(k);var E=window.getSelection();null!=E&&(E.removeAllRanges(),E.addRange(B))}catch(L){}},0)}var f=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck","false");k.style.textRendering="optimizeSpeed";k.style.fontFamily="monospace";k.style.wordBreak="break-all";k.style.background="transparent";k.style.color="transparent";k.style.position="absolute";-k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.display="block";k.style.fontSize="1";k.style.zIndex="-1";k.style.resize="none";k.style.outline="none";k.style.width="1px";k.style.height="1px";mxUtils.setOpacity(k,0);k.contentEditable=!0;k.innerHTML=" ";this.clipboardElt=k;var q=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(B){var E=mxEvent.getSource(B);-null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==E.nodeName||"TEXTAREA"==E.nodeName&&E!==this.typingShim||"true"==E.contentEditable||224!=B.keyCode&&(mxClient.IS_MAC||17!=B.keyCode)&&(!mxClient.IS_MAC||91!=B.keyCode&&93!=B.keyCode)||q||(k.style.left=f.container.scrollLeft+10+"px",k.style.top=f.container.scrollTop+10+"px",B=f.container.scrollLeft,E=f.container.scrollTop,f.container.appendChild(k),q=!0,k.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=-B,f.container.scrollTop=E)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(B){var E=B.keyCode;window.setTimeout(mxUtils.bind(this,function(){!q||224!=E&&17!=E&&91!=E&&93!=E||(q=!1,k.parentNode.removeChild(k),f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(B){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k),c()}catch(E){this.handleError(E)}}));-mxEvent.addListener(k,"cut",mxUtils.bind(this,function(B){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k,!0),c()}catch(E){this.handleError(E)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(B){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(k.innerHTML=" ",k.focus(),null!=B.clipboardData&&(Graph.removePasteFormatting(k.firstChild),this.pasteCells(B,k,!0,!0)),!mxEvent.isConsumed(B)){var E=f.container.scrollLeft,L=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,-function(){try{f.container.scrollLeft=E,f.container.scrollTop=L,Graph.removePasteFormatting(k.firstChild),this.pasteCells(B,k,!1,!0)}catch(Q){this.handleError(Q)}}),0)}}catch(Q){this.handleError(Q)}}),!0);var x=this.isSelectionAllowed;this.isSelectionAllowed=function(B){return mxEvent.getSource(B)==k?!0:x.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=-function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var k="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(k||f)f=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),-this.restoreScrollState(f);return k};EditorUi.prototype.saveScrollState=function(c){var f=this.editor.graph.view.translate,k=this.diagramContainer.scrollLeft,q=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(k-=this.embedViewport.x,q-=this.embedViewport.y):(k+=this.embedViewport.x,q+=this.embedViewport.y));f={x:k,y:q,tx:f.x,ty:f.y};c&&(f.boundingRect=this.diagramContainer.getBoundingClientRect());return f};EditorUi.prototype.restoreScrollState=function(c){var f=-this.editor.graph.view.scale,k=this.editor.graph.view.translate;if(null!=c.boundingRect){var q=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-q.x;c.y-=c.boundingRect.y-q.y}this.diagramContainer.scrollLeft=c.x+(k.x-c.tx)*f;this.diagramContainer.scrollTop=c.y+(k.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&-(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||f||(this.statusContainer.style.display="none")}));var k=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var q=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;f=null!=q&&null!=q.getAttribute("class");if(!f&&null!=q){q=q.getAttribute("title");var x=this.getCurrentFile();-x=null!=x?x.savingStatusKey:DrawioFile.prototype.savingStatusKey;q==mxResources.get(x)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(x))+'..."src="'+Editor.tailSpin+'"></div>',f=!0)}this.statusContainer.style.display="none";q=32>=c.clientWidth;c.style.visibility=q&&""==this.editor.getStatus()?"hidden":"";if(q||f)this.statusContainer.style.display="",f=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=-0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",k);k()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=-function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),f=0;f<-c.length;f++)null!=c[f]&&c[f].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=-null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,f){if(null!=c){var k=null;if("diagram"==c.nodeName)k=c;else if("mxfile"==c.nodeName){var q=c.getElementsByTagName("diagram");if(0<q.length){k=q[0];var x=f.getGlobalVariable;f.getGlobalVariable=function(C){return"page"==C?k.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==C?1:x.apply(this,arguments)}}}null!=k&&(c=Editor.parseDiagramNode(k))}q=this.editor.graph;try{this.editor.graph=f,this.editor.setGraphXml(c)}catch(C){}finally{this.editor.graph=+q}return c};EditorUi.prototype.getSvgFileProperties=function(c){var f=this.getPngFileProperties(c);f.embedFonts=null!=c&&c.hasAttribute("embedFonts")?"false"!=c.getAttribute("embedFonts"):Editor.embedSvgFonts;return f};EditorUi.prototype.getPngFileProperties=function(c){var f=1,k=0;if(null!=c){if(c.hasAttribute("scale")){var q=parseFloat(c.getAttribute("scale"));!isNaN(q)&&0<q&&(f=q)}c.hasAttribute("border")&&(q=parseInt(c.getAttribute("border")),!isNaN(q)&&0<q&&(k=q))}return{scale:f,border:k}};EditorUi.prototype.getEmbeddedPng=+function(c,f,k,q,x){try{var C=this.editor.graph,E=null;if(null!=k&&0<k.length)C=this.createTemporaryGraph(C.getStylesheet()),document.body.appendChild(C.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,!0),C),E=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){C=this.createTemporaryGraph(C.getStylesheet());var L=C.getGlobalVariable;C.setBackgroundImage=this.editor.graph.setBackgroundImage;var Q=this.pages[0];this.currentPage==Q?C.setBackgroundImage(this.editor.graph.backgroundImage):+null!=Q.viewState&&null!=Q.viewState&&C.setBackgroundImage(Q.viewState.backgroundImage);C.getGlobalVariable=function(V){return"page"==V?Q.getName():"pagenumber"==V?1:L.apply(this,arguments)};document.body.appendChild(C.container);C.model.setRoot(Q.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(V){try{null==E&&(E=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var K=V.toDataURL("image/png");K=Editor.writeGraphModelToPng(K,"tEXt","mxfile",encodeURIComponent(E));c(K.substring(K.lastIndexOf(",")++1));C!=this.editor.graph&&C.container.parentNode.removeChild(C.container)}catch(fa){null!=f&&f(fa)}}),null,null,null,mxUtils.bind(this,function(V){null!=f&&f(V)}),null,null,q,null,C.shadowVisible,null,C,x,null,null,null,"diagram",null)}catch(V){null!=f&&f(V)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba){L=null!=L?L:!0;K=null!=K?K:0;E=null!=Q?Q:f.background;E==mxConstants.NONE&&(E=null);null==E&&"none"==f.getAdaptiveColors()&&(E="#ffffff");Q=this.editor.graph.createSvgImageExport(null!=+c,da);var ha=Graph.addFont,qa=null;if(null==x){qa={};Graph.addFont=function(J,R,T,Y){ha.call(this,J,R,T,qa)};var ra=Q.drawCellState;Q.drawCellState=function(J,R){null!=J&&Graph.processFontStyle(J.style);ra.apply(this,arguments)}}da=null;try{da=f.getSvg(E,V,K,null,null,C,null,Q,null,f.shadowVisible||fa,null,aa,"diagram")}finally{Graph.addFont=ha}(f.shadowVisible||fa)&&f.addSvgShadow(da,null,null,0==K);null!=c&&da.setAttribute("content",c);null!=k&&da.setAttribute("resource",k);var l=mxUtils.bind(this,+function(J){J=(q?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(J);null!=x&&x(J);return J});f.mathEnabled&&this.editor.addMathCss(da);if(null!=x)this.embedFonts(da,mxUtils.bind(this,function(J){L?this.editor.convertImages(J,mxUtils.bind(this,function(R){l(R)})):l(J)}),ba);else{c=Graph.customFontElements;Graph.customFontElements=qa;try{var t=!1;this.embedFonts(da,function(){t=!0},ba);if(!t)try{null==this.editor.resolvedFontCss&&this.editor.addFontCss(da);+var H=this.editor.graph.getExtFontCss();0<H.length&&this.editor.addFontCss(da,H)}catch(J){}}finally{Graph.customFontElements=c}return l(da)}};EditorUi.prototype.embedFonts=function(c,f,k){if(k=null!=k?k:Editor.embedSvgFonts)this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(x){try{null!=x&&this.editor.addFontCss(c,x),f(c)}catch(C){f(c)}}))}catch(x){f(c)}}));+else{try{this.editor.addFontCss(c);var q=this.editor.graph.getExtFontCss();0<q.length&&this.editor.addFontCss(c,q)}catch(x){}f(c)}};EditorUi.prototype.exportImage=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa){Q=null!=Q?Q:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(ba){Editor.addRetryToError(ba,mxUtils.bind(this,function(){this.exportImage(c,f,k,q,x,C,E,L,Q,V,K,fa,aa)}));this.handleError(ba)}))){var da=this.editor.graph.isSelectionEmpty();k=null!=k?k:da;+null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(ba){this.spinner.stop();try{this.saveCanvas(ba,x?this.getFileData(!0,null,null,null,k,L,null,null,null,null,null,c,C):null,Q,null==this.pages||0==this.pages.length,K)}catch(ha){this.handleError(ha)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(ba){this.spinner.stop();this.handleError(ba)}),null,k,c||1,f,q,null,null,C,E,V,fa,aa)}catch(ba){this.spinner.stop(),this.handleError(ba)}}};+EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,k,q,x,C,E){EditorUi.debug("EditorUi.importXml",[this],"xml",[c],"dx",[f],"dy",[k],"crop",[q],"noErrorHandling",[x],"addNewPage",[C],"applyDefaultStyles",[E]);f=null!=f?f:0;k=null!=k?k:+0;var L=[];try{if(null!=c&&0<c.length){var Q=null!=this.pages?this.pages.length:0,V=this.isDiagramEmpty(),K=this.currentPage,fa=this.editor.graph;fa.model.beginUpdate();try{var aa=mxUtils.parseXml(c);c={};var da=this.editor.extractGraphModel(aa.documentElement,null!=this.pages);if(null!=da&&"mxfile"==da.nodeName&&null!=this.pages){var ba=da.getElementsByTagName("diagram");if(0<ba.length){aa=[];var ha=0;if(1==ba.length&&!C){if(null!=this.currentPage&&(c[ba[0].getAttribute("id")]=this.currentPage.getId(),+this.isBlankFile())){var qa=ba[0].getAttribute("name");null!=qa&&""!=qa&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,qa))}da=Editor.parseDiagramNode(ba[0]);q=!1;ha=1}for(;ha<ba.length;ha++){var ra=ba[ha].getAttribute("id");ba[ha].removeAttribute("id");var l=this.updatePageRoot(new DiagramPage(ba[ha]));c[ra]=ba[ha].getAttribute("id");var t=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[t+1]));fa.model.execute(new ChangePage(this,l,l,t,0<ha));+aa.push(l)}this.updatePageLinks(c,aa)}}if(null!=da&&"mxGraphModel"===da.nodeName){L=fa.importGraphModel(da,f,k,q);if(null!=L)for(this.addLocalPagesToMapping(c),ha=0;ha<L.length;ha++)this.updatePageLinksForCell(c,L[ha]);var H=fa.parseBackgroundImage(da.getAttribute("backgroundImage"));if(null!=H&&null!=H.originalSrc&&this.updateBackgroundPageLink(c,H)){var J=new ChangePageSetup(this,null,H);J.ignoreColor=!0;fa.model.execute(J)}}E&&fa.pasteCellStyles(fa.includeDescendants(L),fa.defaultVertexStyle,fa.defaultEdgeStyle);+!C&&K!=this.currentPage&&null!=this.pages&&1<this.pages.length&&V&&1==Q&&this.removePage(K)}finally{fa.model.endUpdate()}}}catch(R){if(x)throw R;this.handleError(R)}return L};EditorUi.prototype.updatePageLinks=function(c,f){for(var k=0;k<f.length;k++)this.updatePageLinksForCell(c,f[k].root),f[k]!=this.currentPage&&(f[k].needsUpdate=!0),null!=f[k].viewState&&this.updateBackgroundPageLink(c,f[k].viewState.backgroundImage)&&(f[k]==this.currentPage&&this.editor.graph.setViewState(f[k].viewState,!0),f[k].needsUpdate=+!0)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){var k=!1;try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var q=c[f.originalSrc.substring(f.originalSrc.indexOf(",")+1)];null!=q&&(f.originalSrc="data:page/id,"+q,k=!0)}}catch(x){}return k};EditorUi.prototype.updatePageLinksForCell=function(c,f){var k=document.createElement("div"),q=this.editor.graph,x=q.getLinkForCell(f);null!=x&&q.setLinkForCell(f,this.updatePageLink(c,x));if(q.isHtmlLabel(f)){k.innerHTML=Graph.sanitizeHtml(q.getLabel(f));+for(var C=k.getElementsByTagName("a"),E=!1,L=0;L<C.length;L++)x=C[L].getAttribute("href"),null!=x&&(C[L].setAttribute("href",this.updatePageLink(c,x)),E=!0);E&&q.labelChanged(f,k.innerHTML)}for(L=0;L<q.model.getChildCount(f);L++)this.updatePageLinksForCell(c,q.model.getChildAt(f,L))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var k=c[f.substring(f.indexOf(",")+1)];f=null!=k?"data:page/id,"+k:null}else if("data:action/json,"==f.substring(0,17))try{var q=JSON.parse(f.substring(17));+if(null!=q.actions){for(var x=0;x<q.actions.length;x++){var C=q.actions[x];if(null!=C.open&&Graph.isPageLink(C.open)){var E=C.open.substring(C.open.indexOf(",")+1);k=c[E];null!=k?C.open="data:page/id,"+k:null==this.getPageById(E)&&delete C.open}}f="data:action/json,"+JSON.stringify(q)}}catch(L){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,k,q,x){var C=mxUtils.bind(this,function(E){this.loadingExtensions=+!1;null!=k?k(E):this.handleError(E)});this.createTimeout(null,mxUtils.bind(this,function(E){q=null!=q?q:c.name;var L=mxUtils.bind(this,function(V){E.clear()&&C(V)}),Q=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var V=this.isRemoteVisioFormat(q);try{var K=q.lastIndexOf(".");if(0<=K&&K<q.length)q.substring(K+1).toUpperCase();else{var fa=q.lastIndexOf("/");0<=fa&&fa<q.length&&(q=q.substring(fa+1))}}catch(da){}if(V)if(null==VSS_CONVERT_URL||this.isOffline())/(\.vss|\.vsx)$/i.test(q)?+L({message:mxResources.get("tryVssDraw",["https://vss.draw.io"])}):L({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{V=new FormData;V.append("file1",c,q);var aa=new XMLHttpRequest;aa.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(q)?"?stencil=1":""));aa.responseType="blob";this.addRemoteServiceSecurityCheck(aa);null!=x&&aa.setRequestHeader("x-convert-custom",x);aa.onreadystatechange=mxUtils.bind(this,function(){if(4==+aa.readyState&&E.clear())if(200<=aa.status&&299>=aa.status)try{var da=aa.response;if("text/xml"==da.type){var ba=new FileReader;ba.onload=mxUtils.bind(this,function(ha){try{f(ha.target.result)}catch(qa){L({message:mxResources.get("errorLoadingFile")})}});ba.readAsText(da)}else this.doImportVisio(da,f,L,q)}catch(ha){L(ha)}else try{""==aa.responseType||"text"==aa.responseType?L({message:aa.responseText}):(ba=new FileReader,ba.onload=function(){try{L({message:JSON.parse(ba.result).Message})}catch(ha){null!=+ba.result&&0<ba.result.length?L({message:ba.result}):L(ha)}},ba.readAsText(aa.response))}catch(ha){L({})}});aa.send(V)}else if(E.clear())try{this.doImportVisio(c,f,L,q)}catch(da){L(da)}}else L({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?Q():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",Q,null,null,null,L))}),C)};EditorUi.prototype.importGraphML=function(c,f,k){var q=mxUtils.bind(this,+function(x){this.loadingExtensions=!1;null!=k?k(x):this.handleError(x)});this.createTimeout(null,mxUtils.bind(this,function(x){var C=mxUtils.bind(this,function(L){x.clear()&&q(L)}),E=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(x.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,q)}catch(L){C(L)}else C({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?E():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL++"js/extensions.min.js",E,null,null,null,C))}),q)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(k){this.loadingExtensions=!1;this.handleError(k)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(k){var q=mxUtils.bind(this,function(C){k.clear()&&f(C)}),x=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(k.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),+(new VsdxExport(this)).exportCurrentDiagrams(c)||q({message:mxResources.get("unknownError")})}catch(C){q(C)}else q({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(x,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",x,null,null,null,q))}),f):f({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,f,k){var q=+mxUtils.bind(this,function(x){this.loadingExtensions=!1;null!=k?k(x):this.handleError(x)});this.createTimeout(null,mxUtils.bind(this,function(x){var C=mxUtils.bind(this,function(L){x.clear()&&q(L)}),E=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(x.clear())if("undefined"!==typeof window.LucidImporter)try{var L=JSON.parse(c);f(LucidImporter.importState(L));try{if(null!=window.console&&"1"==urlParams.test){var Q=[(new Date).toISOString(),"convertLucidChart",L];null!=L.state&&Q.push(JSON.parse(L.state));+if(null!=L.svgThumbs)for(var V=0;V<L.svgThumbs.length;V++)Q.push(Editor.createSvgDataUri(L.svgThumbs[V]));null!=L.thumb&&Q.push(L.thumb);console.log.apply(console,Q)}}catch(K){}}catch(K){null!=window.console&&console.error(K),C(K)}else C({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(E,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",+function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",E,null,null,null,C)},null,null,null,C)},null,null,null,C)},null,null,null,C)},null,null,null,C):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",E,null,null,null,C))}),q)};EditorUi.prototype.replaceLockedGroupChildren=function(c,f,k,q,x){var C=null!=x&&null!=x.dataAttr?x.dataAttr:"mermaidData",E=null!=x&&null!=x.attrPrefix?+x.attrPrefix:"mermaid",L=this.editor.graph;x=mxUtils.parseXml((null!=x&&null!=x.wrapGroup?x.wrapGroup:mxMermaidToDrawio.wrapGroup)(f,k,q));var Q=new mxCodec(x);f=new mxGraphModel;Q.decode(x.documentElement,f);Q=f.getRoot();var V=null;for(x=0;null!=Q&&x<f.getChildCount(Q)&&null==V;x++)for(var K=f.getChildAt(Q,x),fa=0;fa<f.getChildCount(K);fa++){var aa=f.getChildAt(K,fa),da=aa.value;if(null!=da&&"object"===typeof da&&null!=da.getAttribute&&null!=da.getAttribute(C)){V=aa;break}}if(null!=V){Q=[];for(x=+0;x<f.getChildCount(V);x++)Q.push(f.getChildAt(V,x));0==Q.length&&(Q=[V]);V=f.getGeometry(V);K=da=Infinity;aa=L.model.getChildCount(c);for(x=0;x<aa;x++){var ba=L.model.getChildAt(c,x);L.model.isVertex(ba)&&(ba=ba.getGeometry(),null!=ba&&(da=Math.min(da,ba.x),K=Math.min(K,ba.y)))}var ha=Infinity;ba=Infinity;for(x=0;x<Q.length;x++)f.isVertex(Q[x])&&(aa=Q[x].getGeometry(),null!=aa&&(ha=Math.min(ha,aa.x),ba=Math.min(ba,aa.y)));da=isFinite(da)&&isFinite(ha)?da-ha:0;K=isFinite(K)&&isFinite(ba)?K-ba:0;if(0!=+da||0!=K)for(x=0;x<Q.length;x++)if(ba=Q[x],aa=ba.getGeometry(),null!=aa){aa=aa.clone();if(f.isVertex(ba))aa.x+=da,aa.y+=K;else if(f.isEdge(ba)){if(null!=aa.points)for(ha=0;ha<aa.points.length;ha++)null!=aa.points[ha]&&(aa.points[ha].x+=da,aa.points[ha].y+=K);null!=aa.sourcePoint&&(aa.sourcePoint.x+=da,aa.sourcePoint.y+=K);null!=aa.targetPoint&&(aa.targetPoint.x+=da,aa.targetPoint.y+=K)}f.setGeometry(ba,aa)}f=this.snapshotMermaidIdentity(c,E);Q=L.cloneCells(Q,!0);L.getModel().beginUpdate();try{for(fa=+L.model.getChildCount(c)-1;0<=fa;fa--)L.model.remove(L.model.getChildAt(c,fa));for(x=0;x<Q.length;x++)this.applyMermaidUserCustomizations(Q[x],f,E),L.model.add(c,Q[x]);if(null!=V){var qa=L.model.getGeometry(c);null!=qa&&(qa=qa.clone(),qa.width=V.width,qa.height=V.height,L.model.setGeometry(c,qa))}L.setAttributeForCell(c,C,JSON.stringify({data:k,config:q},null,2))}finally{L.getModel().endUpdate()}}};EditorUi.prototype.snapshotMermaidIdentity=function(c,f){f=null!=f?f:"mermaid";for(var k=this.editor.graph,+q={},x=k.model.getChildCount(c),C=0;C<x;C++){var E=k.model.getChildAt(c,C),L=E.value;if(null!=L&&"object"===typeof L&&null!=L.getAttribute){var Q=L.getAttribute(f+"Id");Q&&(q[Q]={currentStyle:E.style||"",currentLabel:L.getAttribute("label")||"",baseStyle:L.getAttribute(f+"BaseStyle")||"",baseValue:L.getAttribute(f+"BaseValue")||""})}}return q};EditorUi.prototype.applyMermaidUserCustomizations=function(c,f,k){var q=c.value;null!=q&&"object"===typeof q&&null!=q.getAttribute&&(k=q.getAttribute((null!=+k?k:"mermaid")+"Id"))&&(f=f[k],null!=f&&(c.style=this.mergeMermaidStyleDelta(f.baseStyle,f.currentStyle,c.style||"",c.isEdge()),f.currentLabel!==f.baseValue&&q.setAttribute("label",f.currentLabel)))};EditorUi.prototype.mergeMermaidStyleDelta=function(c,f,k,q){function x(K){var fa={},aa=[];if(!K)return{map:fa,keys:aa};K=K.split(";");for(var da=0;da<K.length;da++){var ba=K[da];if(ba){var ha=ba.indexOf("=");if(0<ha){var qa=ba.substring(0,ha);qa in fa||aa.push(qa);fa[qa]=ba.substring(ha+1)}else ba in+fa||aa.push(ba),fa[ba]=!0}}return{map:fa,keys:aa}}c=x(c);f=x(f);var C=x(k),E={exitX:1,exitY:1,exitDx:1,exitDy:1,entryX:1,entryY:1,entryDx:1,entryDy:1,edgeStyle:1,noEdgeStyle:1,orthogonal:1},L=q?{startArrow:1,endArrow:1,startFill:1,endFill:1,startSize:1,endSize:1}:{};q={};k=[];for(var Q=0;Q<C.keys.length;Q++){var V=C.keys[Q];q[V]=C.map[V];k.push(V)}for(Q=0;Q<f.keys.length;Q++)V=f.keys[Q],E[V]||L[V]||f.map[V]===c.map[V]||(V in q||k.push(V),q[V]=f.map[V]);for(Q=0;Q<c.keys.length;Q++)V=c.keys[Q],E[V]||+L[V]||V in f.map||delete q[V];c=[];for(Q=0;Q<k.length;Q++)V=k[Q],f=q[V],void 0!==f&&(!0===f?c.push(V):c.push(V+"="+f));return 0<c.length?c.join(";")+";":""};EditorUi.prototype.getSvgForXml=function(c,f,k){var q=null,x=this.createTemporaryGraph(this.editor.graph.getStylesheet());try{document.body.appendChild(x.container),(new mxCodec(mxUtils.parseXml(c))).decode(mxUtils.parseXml(c).documentElement,x.getModel()),q=x.getSvg(null,null,f,null,null,null,null,null,null,null,null,k,null,null,!0,!0)}finally{document.body.removeChild(x.container)}return q};+EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,k,q){var x=0,C=mxUtils.bind(this,function(){this.createTimeout(this.editor.generateTimeout,mxUtils.bind(this,function(E){var L="";if(null!=this.drive&&null!=this.drive.getUser()){var Q=this.drive.getUser();null!=Q.email&&0<Q.email.indexOf("@")&&(L=Q.email.substring(Q.email.indexOf("@")+1))}var V={prompt:c,driveDomain:L,options:null!=q?q:{}};EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"url",["https://www.draw.io/generate/v3"]);+var K=Date.now();L=new mxXmlRequest("https://www.draw.io/generate/v3",JSON.stringify(V),"POST");var fa=mxUtils.bind(this,function(da){E.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"error",[da],"time",Date.now()-K+" ms"),k(da))}),aa=mxUtils.bind(this,function(da){3>x++?E.clear()&&C():fa(da)});L.send(mxUtils.bind(this,function(da){if(E.isAlive())if(200<=da.getStatus()&&299>=da.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var ha=da.getText();try{ha=+JSON.parse(ha),result=ha.result}catch(ra){result=ha}EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"data",[V],"response",[ha],"time",Date.now()-K+" ms");ha=Editor.extractGraphModelFromText(result);if(null!=ha&&""!=ha[1])E.clear()&&f(ha[1]);else if("<"==mxUtils.trim(result).charAt(0))E.clear()&&f(result);else{var qa=this.extractMermaidDeclaration(result)||result;this.parseMermaidDiagram(qa,null,mxUtils.bind(this,function(ra){this.tryAndHandle(mxUtils.bind(this,function(){E.clear()&&+f(mxMermaidToDrawio.wrapGroup(ra,qa,null))}),fa)}),fa,aa)}}),fa,!0);else{var ba={message:mxResources.get("error")+" "+da.getStatus()};try{ba=JSON.parse(da.getText()),null!=ba.error&&(ba.message=ba.error)}catch(ha){}fa(ba)}}),fa)}),k)});C()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("(Begins)");for(var k=mxUtils.trim(1>=+f.length?c:f[1]),q=k.split("\n"),x=0;x<q.length&&("mermaid"==q[x]||0==q[x].trim().length||"%%"==q[x].substring(0,2));)x++;k=[];for(var C=x;C<q.length;C++){var E=mxUtils.trim(q[C]);if("%%"!=E.substring(0,2)&&"classDef "!=E.substring(0,9))k.push(q[C]);else if("mermaid"==E)break}q=k;k=mxUtils.trim(q.join("\n"));C="undefined"!==typeof MermaidParser?MermaidParser.detectType(k):null;EditorUi.debug("EditorUi.extractMermaidDeclaration","value",[c],"text",[k],"typeInfo",[C],"startLine",x,"lines",q,"tokens",+f);return null!=C?k:null};EditorUi.prototype.getMermaidDiagramType=function(c){var f=null!=c?c.split("\n"):[],k=0;c=function(){for(;k<f.length&&(0==f[k].trim().length||"%%"==f[k].substring(0,2));)k++};c();if(k<f.length&&"---"==f[k].trim()){do k++;while(k<f.length&&"---"!=f[k].trim());k++;c()}if(k>=f.length)return"";c=f[k].trim().toLowerCase();var q=c.indexOf(" ");return c.substring(0,0<q?q:c.length)};EditorUi.prototype.isMermaidElkFlowchart=function(c){return null!=c&&(/defaultRenderer["']?\s*:\s*["']?elk/i.test(c)||+/(?:^|\n)\s*layout\s*:\s*["']?elk\b/i.test(c))&&/(?:flowchart|graph)\b/i.test(c)};EditorUi.prototype.applyMermaidElkPostPass=function(c,f,k){if("undefined"===typeof ElkLayout||"undefined"===typeof Graph)k(c);else{f=f.match(/(?:flowchart|graph)\s+(LR|RL|TB|TD|BT)/i);var q={LR:"RIGHT",RL:"LEFT",TB:"DOWN",TD:"DOWN",BT:"UP"};f=f?q[f[1].toUpperCase()]||"DOWN":"DOWN";var x=document.createElement("div");x.style.cssText="position:absolute;left:-99999px;top:-99999px;width:1200px;height:800px;visibility:hidden;";+document.body.appendChild(x);var C=null,E=!1,L=function(V){if(!E){E=!0;try{null!=C&&C.destroy()}catch(K){}x.remove();k(V)}};try{C=new Graph(x);C.foldingEnabled=!1;C.setEnabled(!1);C.setHtmlLabels(!0);var Q=mxUtils.parseXml(c);(new mxCodec(Q)).decode(Q.documentElement,C.getModel());(new ElkLayout(C,"layered",{"elk.direction":f,"elk.layered.cycleBreaking.strategy":"GREEDY"},Object.assign({mermaidPolicy:!0},ElkLayout.CANONICAL_EDGE))).execute(C.getDefaultParent(),function(V){var K=null;if(!V)try{var fa=+new mxCodec;K=mxUtils.getXml(fa.encode(C.getModel()))}catch(aa){}L(null!=K?K:c)})}catch(V){if(E)throw V;L(c)}}};EditorUi.prototype.parseMermaidDiagram=function(c,f,k,q,x){var C=mxUtils.bind(this,function(L){null!=x?x(L):null!=q?q(L):this.handleError(L)});if(EditorUi.isMermaidSupported())try{var E=mxMermaidToDrawio.parseText(c,this.getMermaidConfig(c,f));null!=E?this.isMermaidElkFlowchart(c)?this.applyMermaidElkPostPass(E,c,k):k(E):C(Error("Unsupported diagram type: "+this.getMermaidDiagramType(c)))}catch(L){C(L)}else C(Error("Mermaid parser not available"))};+EditorUi.prototype.loadMermaid=function(c,f){var k=mxUtils.bind(this,function(x){this.loadingMermaid=!1;f(x)}),q=mxUtils.bind(this,function(){try{this.loadingMermaid=!1,c()}catch(x){k(x)}});"undefined"!==typeof mxMermaidToDrawio||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(q,0):(this.loadingMermaid=!0,"undefined"!==typeof urlParams&&"1"==urlParams.dev||window.location.search&&0<=window.location.search.indexOf("dev=1")?mxscript("js/elk/drawio-elk.min.js",function(){mxscript("js/mermaid/drawio-mermaid.min.js",+q,null,null,null,k)},null,null,null,k):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,k))};EditorUi.prototype.loadPlantUml=function(c,f){var k=mxUtils.bind(this,function(C){this.loadingPlantUml=!1;f(C)}),q=mxUtils.bind(this,function(){try{this.loadingPlantUml=!1,c()}catch(C){k(C)}});if("undefined"!==typeof mxPlantUmlToDrawio||this.loadingPlantUml)window.setTimeout(q,0);else{this.loadingPlantUml=!0;var x="undefined"!==typeof urlParams&&"1"==urlParams.dev||window.location.search&&+0<=window.location.search.indexOf("dev=1");mxscript((x?"":window.DRAWIO_SERVER_URL)+"js/plantuml/drawio-plantuml.min.js",q,null,null,null,k)}};EditorUi.prototype.parsePlantUmlDiagram=function(c,f,k,q){var x=mxUtils.bind(this,function(C){null!=q?q(C):this.handleError(C)});this.loadPlantUml(mxUtils.bind(this,function(){if(EditorUi.isNativePlantUmlSupported())try{k(mxPlantUmlToDrawio.parseText(c,f))}catch(C){x(C)}else x(Error("PlantUML parser not available"))}),x)};EditorUi.prototype.parsePlantUmlImage=+function(c,f,k){this.parsePlantUmlDiagram(c,null,mxUtils.bind(this,function(q){f(this.createMermaidImageXml(c,null,q,null,null,"plantUmlData"))}),k)};EditorUi.prototype.getMermaidConfig=function(c,f){f=null!=f?f:mxUtils.clone(EditorUi.defaultMermaidConfig);f.securityLevel="strict";f.startOnLoad=!1;f.maxTextSize=9E5;return f};EditorUi.prototype.getMermaidImageForXml=function(c,f){f=parseFloat(f);f=isNaN(f)?EditorUi.mermaidImageBorder:f;c=this.getSvgForXml(c,f,"auto");var k=parseFloat(c.getAttribute("width")),+q=parseFloat(c.getAttribute("height"));if(isNaN(k)||isNaN(q)){try{var x=c.getAttribute("viewBox").split(/\s+/);k=parseFloat(x[2]);q=parseFloat(x[3])}catch(C){}k=k||100;q=q||100}return{data:this.convertDataUri(Editor.createSvgDataUri(mxUtils.getXml(c))),width:k,height:q,border:f}};EditorUi.prototype.createMermaidImageXml=function(c,f,k,q,x,C){x=this.getMermaidImageForXml(k,x);k=new Graph(document.createElement("div"));x=k.insertVertex(null,null,null,0,0,x.width,x.height,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;editIcon=1;groupPadding="++x.border+";image="+x.data+";");k.setAttributeForCell(x,null!=C?C:"mermaidData",JSON.stringify({data:c,config:f},null,2));null!=q&&k.setAttributeForCell(x,"templatePrompt",q);c=new mxCodec;return mxUtils.getXml(c.encode(k.getModel()))};EditorUi.prototype.parseMermaidImage=function(c,f,k){this.parseMermaidDiagram(c,mxUtils.clone(EditorUi.legacyMermaidConfig),mxUtils.bind(this,function(q){f(this.createMermaidImageXml(c,null,q))}),k)};EditorUi.prototype.getMermaidImageBorder=function(c,f){c=parseFloat(mxUtils.getValue(this.editor.graph.getCurrentCellStyle(c,+!0),"groupPadding",""));return isNaN(c)?f:c};EditorUi.prototype.updateMermaidImage=function(c,f,k,q,x,C){var E=this.editor.graph;q=this.getMermaidImageForXml(q,x);E.setCellStyles("image",q.data,[c]);E.setCellStyles("editIcon","1",[c]);E.setCellStyles("groupPadding",q.border,[c]);x=E.model.getGeometry(c);null!=x&&(x=x.clone(),x.width=q.width,x.height=q.height,E.cellsResized([c],[x],!1));E.setAttributeForCell(c,null!=C?C:"mermaidData",JSON.stringify({data:f,config:k},null,2))};EditorUi.prototype.refreshMermaidImage=+function(c){var f=this.editor.graph,k=f.getAttributeForCell(c,"plantUmlData"),q=null!=k?"plantUmlData":"mermaidData";k=null!=k?k:f.getAttributeForCell(c,"mermaidData");var x=null;if(null!=k)try{x=JSON.parse(k)}catch(L){}if(null!=x&&null!=x.data&&null==x.format){var C=this.getMermaidImageBorder(c,x.border);k=function(){};var E=mxUtils.bind(this,function(L){if(f.model.contains(c)&&this.getMermaidImageBorder(c,x.border)==C){f.model.beginUpdate();try{this.updateMermaidImage(c,x.data,null,L,C,q)}finally{f.model.endUpdate()}}});+"plantUmlData"==q?this.parsePlantUmlDiagram(x.data,null,E,k):this.parseMermaidDiagram(x.data,mxUtils.clone(EditorUi.legacyMermaidConfig),E,k)}};EditorUi.prototype.replaceMermaidCell=function(c,f){var k=this.editor.graph,q=k.getBoundingBoxFromGeometry([c]),x=null!=q?q.x:0;q=null!=q?q.y:0;for(var C=k.model.getParent(c);null!=C&&k.model.isVertex(C);){var E=k.model.getGeometry(C);null!=E&&(x+=E.x,q+=E.y);C=k.model.getParent(C)}k.getModel().beginUpdate();try{var L=this.importXml(f,x,q,!0,null,null,!0);+k.model.remove(c);k.setSelectionCells(L)}finally{k.getModel().endUpdate()}k.scrollCellToVisible(k.getSelectionCell());return L};EditorUi.prototype.insertAsPreText=function(c,f,k){var q=this.editor.graph,x=null;q.getModel().beginUpdate();try{x=q.insertVertex(null,null,"<pre>"+c+"</pre>",f,k,1,1,"text;html=1;align=left;verticalAlign=top;"),q.updateCellSize(x,!0)}finally{q.getModel().endUpdate()}return x};EditorUi.prototype.insertTextAt=function(c,f,k,q,x,C,E,L){C=null!=C?C:!0;E=null!=E?E:!0;if(null!=+c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(aa){4==aa.readyState&&200<=aa.status&&299>=aa.status&&this.editor.graph.setSelectionCells(this.insertTextAt(aa.responseText,f,k,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(x||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var Q=this.editor.graph;if("data:application/pdf;base64,"==+c.substring(0,28)){var V=Editor.extractGraphModelFromPdf(c);if(null!=V&&0<V.length)return this.importXml(V,f,k,C,!0,L)}if(Editor.isPngDataUrl(c)&&(V=Editor.extractGraphModelFromPng(c),null!=V&&0<V.length))return this.importXml(V,f,k,C,!0,L);if("data:image/svg+xml;"==c.substring(0,19))try{V=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(V=c.substring(c.indexOf(",")+1),V=window.atob&&!mxClient.IS_SF?atob(V):Base64.decode(V,!0)):V=decodeURIComponent(c.substring(c.indexOf(",")+1));var K=this.importXml(V,+f,k,C,!0,L);if(0<K.length)return K}catch(aa){}this.loadImage(c,mxUtils.bind(this,function(aa){if("data:"==c.substring(0,5))this.resizeImage(aa,Editor.stripImageMetadata(c,Editor.removeImageMetadata),mxUtils.bind(this,function(ha,qa,ra){Q.setSelectionCell(Q.insertVertex(null,null,"",Q.snap(f),Q.snap(k),qa,ra,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(ha)+";"))}),E,this.maxImageSize);else{var da=Math.min(1,+Math.min(this.maxImageSize/aa.width,this.maxImageSize/aa.height)),ba=Math.round(aa.width*da);aa=Math.round(aa.height*da);Q.setSelectionCell(Q.insertVertex(null,null,"",Q.snap(f),Q.snap(k),ba,aa,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var aa=null;Q.getModel().beginUpdate();try{aa=Q.insertVertex(Q.getDefaultParent(),null,c,Q.snap(f),Q.snap(k),1,1,"text;"+(q?"html=1;":"")),Q.updateCellSize(aa),+Q.fireEvent(new mxEventObject("textInserted","cells",[aa]))}finally{Q.getModel().endUpdate()}Q.setSelectionCell(aa)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,f,k,C,null,L);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(aa){this.editor.graph.setSelectionCells(this.importXml(aa,f,k,C,null,L))}),mxUtils.bind(this,function(aa){this.handleError(aa)}));else{Q=this.editor.graph;x=null;Q.getModel().beginUpdate();+try{x=Q.insertVertex(Q.getDefaultParent(),null,"",Q.snap(f),Q.snap(k),1,1,"text;whiteSpace=wrap;"+(q?"html=1;":""));Q.fireEvent(new mxEventObject("textInserted","cells",[x]));q&&(c=Q.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");x.value=c;Q.updateCellSize(x);if(0<this.maxTextWidth&&x.geometry.width>this.maxTextWidth){var fa=Q.getPreferredSizeForCell(x,this.maxTextWidth);x.geometry.width=fa.width;x.geometry.height=fa.height}Graph.isLink(x.value)&&Q.setLinkForCell(x,+x.value);x.geometry.width+=Q.gridSize;x.geometry.height+=Q.gridSize}finally{Q.getModel().endUpdate()}return[x]}}return[]};EditorUi.prototype.formatFileSize=function(c){var f=-1;do c/=1024,f++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[f]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var f=c.indexOf(";");0<f&&(c=c.substring(0,f)+c.substring(c.indexOf(",",f+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,f){return/("contentType":\s*"application\/gliffy\+json")/.test(c)};+EditorUi.prototype.isLucidChartData=function(c){return null!=c&&('{"state":"{\\"Properties\\":'==c.substring(0,26)||'{"Properties":'==c.substring(0,14))};EditorUi.prototype.importLocalFile=function(c,f){if(c&&Graph.fileSupport){if(null==this.importFileInputElt){var k=document.createElement("input");k.setAttribute("type","file");mxEvent.addListener(k,"change",mxUtils.bind(this,function(){null!=k.files&&(this.importFiles(k.files,null,null,this.maxImageSize),k.type="",k.type="file",k.value="")}));k.style.display=+"none";document.body.appendChild(k);this.importFileInputElt=k}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(E,L){StorageFile.listFiles(this,"F",E,L)});window.openBrowserFile=mxUtils.bind(this,function(E,L,Q){StorageFile.getFileContent(this,E,L,Q)});window.deleteBrowserFile=mxUtils.bind(this,function(E,L,Q){StorageFile.deleteFile(this,E,L,Q)});if(!f){var q=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=+new OpenFile(mxUtils.bind(this,function(E){this.hideDialog(E)}));window.openFile.setConsumer(mxUtils.bind(this,function(E,L){null!=L&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(L)?(E=new Blob([E],{type:"application/octet-stream"}),this.importVisio(E,mxUtils.bind(this,function(Q){this.importXml(Q,0,0,!0)}),null,L)):this.editor.graph.setSelectionCells(this.importXml(E,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,+function(){window.openFile=null});if(!f){var x=this.dialog,C=x.close;this.dialog.close=mxUtils.bind(this,function(E){Editor.useLocalStorage=q;C.apply(x,arguments);E&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,f,k){var q=this,x=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(C){if(mxUtils.isEmptyObject(C.files))k();else{var E=0,L,Q=!1;C.forEach(function(V,K){V=+K.name.toLowerCase();"diagram/diagram.xml"==V?(Q=!0,K.async("string").then(function(fa){0==fa.indexOf("<mxfile ")?f(fa):k()})):0==V.indexOf("versions/")&&(V=parseInt(V.substr(9)),V>E&&(E=V,L=K))});0<E?L.async("string").then(function(V){(new XMLHttpRequest).upload&&q.isRemoteFileFormat(V,c.name)?q.isOffline()?q.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):q.parseFileData(V,mxUtils.bind(this,function(K){4==K.readyState&&(200<=K.status&&299>=K.status?f(K.responseText):k())}),+c.name):k()}):Q||k()}},function(C){k(C)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?x():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",x,null,null,null,k))};EditorUi.prototype.importFile=function(c,f,k,q,x,C,E,L,Q,V,K,fa){V=null!=V?V:!0;var aa=!1,da=null,ba=mxUtils.bind(this,function(ha){var qa=null;null!=ha&&"<mxlibrary"==ha.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,ha,E)),this.showSidebar()):qa=this.importXml(ha,+k,q,V,null,null!=fa?mxEvent.isControlDown(fa):null);null!=L&&L(qa)});"image"==f.substring(0,5)?(Q=!1,"image/png"==f.substring(0,9)&&(K=K?null:this.extractGraphModelFromPng(c),null!=K&&0<K.length&&(da=this.importXml(K,k,q,V,null,null!=fa?mxEvent.isControlDown(fa):null),Q=!0)),Q||(Q=this.editor.graph,K=c.indexOf(";"),0<K&&(c=c.substring(0,K)+c.substring(c.indexOf(",",K+1))),V&&Q.isGridEnabled()&&(k=Q.snap(k),q=Q.snap(q)),K="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;",+"image/svg"==f.substring(0,9)&&(K+="editableCssRules=.*;"),da=[Q.insertVertex(null,null,"",k,q,x,C,K+"image="+c+";")])):/(\.*<graphml )/.test(c)?(aa=!0,this.importGraphML(c,ba)):null!=Q&&null!=E&&EditorUi.isVisioFilename(E)?(aa=!0,this.importVisio(Q,ba)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,E)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(aa=!0,f=mxUtils.bind(this,function(ha){4==ha.readyState&&(200<=ha.status&&299>=ha.status?ba(ha.responseText):+null!=L&&(L(null),this.showError(mxResources.get("error"),413==ha.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,f,E):this.parseFile(Q,f,E)):0==c.indexOf("PK")&&null!=Q?(aa=!0,this.importZipFile(Q,ba,mxUtils.bind(this,function(){da=this.insertTextAt(this.validateFileData(c),k,q,!0,null,V);L(da)}))):/(\.v(sd|dx))($|\?)/i.test(E)||/(\.vs(s|x))($|\?)/i.test(E)||(da=this.insertTextAt(this.validateFileData(c),k,q,!0,null,V,null,null!=fa?mxEvent.isControlDown(fa):+null));aa||null==L||L(da);return da};EditorUi.prototype.importFiles=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa){q=null!=q?q:this.maxImageSize;V=null!=V?V:this.maxImageBytes;var da=null!=f&&null!=k,ba=!0;f=null!=f?f:0;k=null!=k?k:0;var ha=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var qa=K||this.resampleThreshold,ra=0;ra<c.length;ra++)if("image/svg"!==c[ra].type.substring(0,9)&&"image/"===c[ra].type.substring(0,6)&&c[ra].size>qa){ha=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[f],+"y",[k],"maxSize",[q],"maxBytes",[V],"resampleThreshold",[this.resampleThreshold],"largeImages",[ha],"crop",[da],"resizeImages",[ba],"ignoreEmbeddedXml",[fa],"evt",[aa]);var l=mxUtils.bind(this,function(){var t=this.editor.graph,H=t.gridSize;x=null!=x?x:mxUtils.bind(this,function(ja,X,ka,na,la,ua,za,sa,wa){try{if(null!=ja&&"<mxlibrary"==ja.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,ja,za)),this.showSidebar(),null;this.isCompatibleString(ja)&&1==c.length&&null!=+aa&&"drop"==aa.type&&this.isBlankFile()&&!this.canUndo()&&(da=!1,na=ka=0);return this.importFile(ja,X,ka,na,la,ua,za,sa,wa,da,fa,aa)}catch(Ca){return this.handleError(Ca),null}});C=null!=C?C:mxUtils.bind(this,function(ja){t.setSelectionCells(ja)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var J=this.currentPage,R=c.length,T=R,Y=[],Z=mxUtils.bind(this,function(ja,X){Y[ja]=X;if(0==--T){this.spinner.stop();if(null!=L)L(Y);else{var ka=[];t.getModel().beginUpdate();try{for(ja=+0;ja<Y.length;ja++){var na=Y[ja]();null!=na&&(ka=ka.concat(na))}}finally{t.getModel().endUpdate()}}J!=this.currentPage&&window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0);C(ka)}}),ia=0;ia<R;ia++)mxUtils.bind(this,function(ja){var X=c[ja];if(null!=X){var ka=new FileReader;ka.onload=mxUtils.bind(this,function(na){if(null==E||E(X))try{if("image/"==X.type.substring(0,6))if("image/svg"==X.type.substring(0,9)){var la=Graph.clipSvgDataUri(na.target.result),ua=la.indexOf(","),+za=decodeURIComponent(escape(atob(la.substring(ua+1)))),sa=mxUtils.parseXml(za),wa=sa.getElementsByTagName("svg");if(0<wa.length){var Ca=wa[0],Fa=fa?null:Ca.getAttribute("content");null!=Fa&&"<"!=Fa.charAt(0)&&"%"!=Fa.charAt(0)&&(Fa=unescape(window.atob?atob(Fa):Base64.decode(Fa,!0)));null!=Fa&&"%"==Fa.charAt(0)&&(Fa=decodeURIComponent(Fa));null==Fa||"<mxfile "!==Fa.substring(0,8)&&"<mxGraphModel>"!==Fa.substring(0,14)&&"<mxGraphModel "!==Fa.substring(0,14)?Z(ja,mxUtils.bind(this,function(){try{if(null!=+sa){var La=sa.getElementsByTagName("svg");if(0<La.length){var Da=La[0],Sa=Da.getAttribute("width"),Oa=Da.getAttribute("height");Sa=null!=Sa&&"%"!=Sa.charAt(Sa.length-1)?parseFloat(Sa):NaN;Oa=null!=Oa&&"%"!=Oa.charAt(Oa.length-1)?parseFloat(Oa):NaN;var Ta=Da.getAttribute("viewBox");if(null==Ta||0==Ta.length)Da.setAttribute("viewBox","0 0 "+Sa+" "+Oa);else if(isNaN(Sa)||isNaN(Oa)){var Ua=Ta.split(" ");3<Ua.length&&(Sa=parseFloat(Ua[2]),Oa=parseFloat(Ua[3]))}la=Editor.createSvgDataUri(mxUtils.getXml(Da));+var Ba=Math.min(1,Math.min(q/Math.max(1,Sa)),q/Math.max(1,Oa)),Ka=x(la,X.type,f+ja*H,k+ja*H,Math.max(1,Math.round(Sa*Ba)),Math.max(1,Math.round(Oa*Ba)),X.name);if(null!=Ka&&(isNaN(Sa)||isNaN(Oa))){var ab=new Image;ab.onload=mxUtils.bind(this,function(){Sa=Math.max(1,ab.width);Oa=Math.max(1,ab.height);Ka[0].geometry.width=Sa;Ka[0].geometry.height=Oa;Da.setAttribute("viewBox","0 0 "+Sa+" "+Oa);la=Editor.createSvgDataUri(mxUtils.getXml(Da));var Qa=la.indexOf(";");0<Qa&&(la=la.substring(0,Qa)+la.substring(la.indexOf(",",+Qa+1)));t.setCellStyles("image",la,[Ka[0]])});ab.src=Editor.createSvgDataUri(mxUtils.getXml(Da))}return Ka}}}catch(Qa){}return null})):Z(ja,mxUtils.bind(this,function(){return x(Fa,"text/xml",f+ja*H,k+ja*H,0,0,X.name)}))}else Z(ja,mxUtils.bind(this,function(){return null}))}else{ua=!1;if("image/png"==X.type){var Ha=fa?null:this.extractGraphModelFromPng(na.target.result);if(null!=Ha&&0<Ha.length){var Na=new Image;Na.src=na.target.result;Z(ja,mxUtils.bind(this,function(){return x(Ha,"text/xml",f+ja*+H,k+ja*H,Na.width,Na.height,X.name)}));ua=!0}}ua||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(na.target.result,mxUtils.bind(this,function(La){this.resizeImage(La,Editor.stripImageMetadata(na.target.result,Editor.removeImageMetadata),mxUtils.bind(this,+function(Da,Sa,Oa){Z(ja,mxUtils.bind(this,function(){if(null!=Da&&Da.length<V){var Ta=ba&&this.isResampleImageSize(X.size,K)?Math.min(1,Math.min(q/Sa,q/Oa)):1;return x(Da,X.type,f+ja*H,k+ja*H,Math.round(Sa*Ta),Math.round(Oa*Ta),X.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),ba,q,K,X.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else la=na.target.result,x(la,X.type,f+ja*H,k+ja*H,240,160,X.name,function(La){Z(ja,+function(){return La})},X)}catch(La){Z(ja,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(La,X)}else Z(ja,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(X.name)?x(null,X.type,f+ja*H,k+ja*H,240,160,X.name,function(na){Z(ja,function(){return na})},X):"image"==X.type.substring(0,5)||"application/pdf"==X.type?ka.readAsDataURL(X):ka.readAsText(X)}})(ia)});if(ha){ha=[];for(ra=0;ra<c.length;ra++)ha.push(c[ra]);c=ha;this.confirmImageResize(function(t){ba=+t;l()},Q)}else l()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,f){f=null!=f?f:!1;var k=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},q=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,x=function(C,E){if(C||f)mxSettings.setResizeImages(C?E:null),mxSettings.save();+k();c(E)};null==q||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(C){x(C,!0)},function(C){x(C,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):x(!1,q)};EditorUi.prototype.parseFile=function(c,f,k){k=null!=k?k:c.name;var q=+new FileReader;q.onload=mxUtils.bind(this,function(){this.parseFileData(q.result,f,k)});q.readAsText(c)};EditorUi.prototype.parseFileData=function(c,f,k){var q=new XMLHttpRequest;q.open("POST",OPEN_URL);q.setRequestHeader("Content-Type","application/x-www-form-urlencoded");q.onreadystatechange=function(){f(q)};q.send("format=xml&filename="+encodeURIComponent(k)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(x){}};EditorUi.prototype.isResampleImageSize=+function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,k,q,x,C,E){x=null!=x?x:this.maxImageSize;var L=Math.max(1,c.width),Q=Math.max(1,c.height),V=f;if(q&&this.isResampleImageSize(null!=E?E:f.length,C))try{var K=Math.max(L/x,Q/x);if(1<K){var fa=Math.round(L/K),aa=Math.round(Q/K),da=document.createElement("canvas");da.width=fa;da.height=aa;da.getContext("2d").drawImage(c,0,0,fa,aa);var ba=da.toDataURL();if(ba.length<f.length){var ha=document.createElement("canvas");+ha.width=fa;ha.height=aa;var qa=ha.toDataURL();ba!==qa&&(f=ba,L=fa,Q=aa)}}}catch(ra){}q&&V!=f&&x>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,k,q,x/1.5,C,E):k(f,L,Q)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,f,k){try{var q=new Image;q.onload=function(){q.width=0<q.width?q.width:120;q.height=0<q.height?q.height:120;f(q)};null!=k&&(q.onerror=k);q.src=c}catch(x){if(null!=k)k(x);+else throw x;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var u=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){if(Editor.isSettingsEnabled()){null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles);this.formatWidth=mxSettings.getFormatWidth();var c=mxSettings.getSidebarWidth();null!=c&&(this.hsplitPosition=parseInt(c))}this.formatEnabled||+(this.formatWidth=0);this.sidebarEnabled||(this.hsplitPosition=0);u.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var n=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,f=this.editor.graph;"undefined"!==typeof LibavoidRouting&&null!=+LibavoidRouting.installAutoRouting&&LibavoidRouting.installAutoRouting(this);this.addListener("styleChanged",mxUtils.bind(this,function(X,ka){ka.getProperty("force")&&"undefined"!==typeof mxSettings&&null!=mxSettings.setCurrentEdgeStyle&&null!=mxSettings.settings&&mxSettings.setCurrentEdgeStyle(mxUtils.clone(this.editor.graph.currentEdgeStyle))}));this.restorePersistedEdgeStyle();if(this.editor.isChromelessView()&&"0"!=urlParams.animate){var k=null,q=function(){var X=f.getModel().getRoot();if(X===+k&&null!=c.chromelessAnimationPlayer)return!0;k=X;null!=c.chromelessAnimationPlayer&&c.chromelessAnimationPlayer.stop();c.chromelessAnimationPlayer=Editor.playAnimationOnGraph(f);return null!=c.chromelessAnimationPlayer};q();this.editor.addListener("fileLoaded",q);f.addListener(mxEvent.ROOT,q)}var x=f.isEnabled;f.isEnabled=function(){return x.apply(this,arguments)&&!c.isLocked()};f.showLinkIcons=Editor.showLinkIcons||"1"==urlParams["link-icons"];f.showTooltipIcons=Editor.showTooltipIcons||"1"==urlParams["tooltip-icons"];+var C=this;f.editTooltip=function(X){null!=X&&C.actions.get("editTooltip").funct()};f.getLinkOverlayTooltip=function(X){if(Graph.isPageLink(X)&&null!=C.pages){var ka=X.substring(X.indexOf(",")+1);ka=C.getPageById(ka);if(null!=ka)return ka.getName()||mxResources.get("pageWithNumber",[mxUtils.indexOf(C.pages,ka)+1])}else if(this.isCustomLink(X))return this.getLinkTitle(X);return X};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(X){var ka=X.getEvent();return null==X.getState()&&!mxEvent.isMouseEvent(ka)&&+!f.freehand.isDrawing()||mxEvent.isPopupTrigger(ka)&&(null==X.getState()||mxEvent.isControlDown(ka)||mxEvent.isShiftDown(ka))});var E=function(X){X=/(?:^|;)groupPadding=([^;]*)/.exec(null!=X?X:"");return null!=X?X[1]:null};f.model.addListener(mxEvent.BEFORE_UNDO,function(X,ka){X=ka.getProperty("edit");if(null!=X&&null!=X.changes){ka=X.changes.length;for(var na=[],la=0;la<ka;la++){var ua=X.changes[la];ua instanceof mxStyleChange&&null!=ua.cell&&f.model.isVertex(ua.cell)&&E(ua.style)!=E(ua.previous)&&+/(?:^|;)shape=image(?:;|$)/.test(null!=ua.style?ua.style:"")&&(null!=f.getAttributeForCell(ua.cell,"mermaidData")||null!=f.getAttributeForCell(ua.cell,"plantUmlData"))&&0>mxUtils.indexOf(na,ua.cell)&&na.push(ua.cell)}for(la=0;la<na.length;la++)c.refreshMermaidImage(na[la])}});var L=function(X){var ka=!1;c.showDialog(X.container,640,420,!0,!0,function(na,la){if(!ka&&X.shouldConfirmClose())return c.confirm(mxResources.get("allChangesLost"),null,function(){ka=!0;c.hideDialog(!0)},mxResources.get("cancel"),+mxResources.get("discardChanges")),!1},null,null,new mxRectangle(0,0,320,280),!0);X.init()};f.cellEditor.editPlantUmlData=function(X,ka,na){var la=JSON.parse(na);ka=f.getCurrentCellStyle(X);var ua=mxUtils.getValue(ka,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE,za=null==la.format&&!ua;ka="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var sa=document.createElement("select");sa.className="geBtn";na=document.createElement("option");na.setAttribute("value","plantUmlDiagram");mxUtils.write(na,+mxResources.get("diagram"));sa.appendChild(na);na=document.createElement("option");na.setAttribute("value","plantUmlImage");mxUtils.write(na,mxResources.get("image"));sa.appendChild(na);sa.value=ua?"plantUmlImage":"plantUmlDiagram";var wa=new SimpleTextareaDialog(c,la.data,function(Ca){if(null!=Ca&&c.spinner.spin(document.body,mxResources.get("inserting"))){var Fa="plantUmlImage"==sa.value,Ha=za?la.config:null;c.parsePlantUmlDiagram(Ca,Ha,function(Na){c.spinner.stop();wa.hide();try{f.getModel().beginUpdate();+try{if(ua&&Fa)c.updateMermaidImage(X,Ca,null,Na,c.getMermaidImageBorder(X,la.border),"plantUmlData");else if(za&&!Fa)c.replaceLockedGroupChildren(X,Na,Ca,Ha,{wrapGroup:mxPlantUmlToDrawio.wrapGroup,dataAttr:"plantUmlData",attrPrefix:"plantUml"});else{var La=c.getMermaidImageBorder(X,la.border),Da=c.replaceMermaidCell(X,Fa?c.createMermaidImageXml(Ca,null,Na,null,La,"plantUmlData"):mxPlantUmlToDrawio.wrapGroup(Na,Ca,Ha));Fa||null==La||f.setCellStyles("groupPadding",La,Da)}}finally{f.getModel().endUpdate()}}catch(Sa){c.handleError(Sa)}},+function(Na){c.spinner.stop();c.handleError(Na)})}},null,null,ka?sa:null,!0);L(wa)};f.cellEditor.editMermaidData=function(X,ka,na){var la=JSON.parse(na);ka=f.getCurrentCellStyle(X);var ua=mxUtils.getValue(ka,mxConstants.STYLE_SHAPE,"")==mxConstants.SHAPE_IMAGE;ka="draw.io"==c.getServiceName()||"atlassian"==c.getServiceName();var za=document.createElement("select");za.className="geBtn";na=document.createElement("option");na.setAttribute("value","mermaid");mxUtils.write(na,mxResources.get("diagram"));+za.appendChild(na);na=document.createElement("option");na.setAttribute("value","mermaidImage");mxUtils.write(na,mxResources.get("image"));za.appendChild(na);za.value=ua?"mermaidImage":"mermaid";var sa=new SimpleTextareaDialog(c,la.data,function(wa){if(null!=wa&&c.spinner.spin(document.body,mxResources.get("inserting"))){var Ca="mermaidImage"==za.value,Fa=Ca?EditorUi.legacyMermaidConfig:ua?null:la.config;c.parseMermaidDiagram(wa,mxUtils.clone(Fa),function(Ha){c.spinner.stop();sa.hide();try{f.getModel().beginUpdate();+try{if(ua&&Ca)c.updateMermaidImage(X,wa,null,Ha,c.getMermaidImageBorder(X,la.border));else if(ua||Ca){var Na=c.getMermaidImageBorder(X,la.border),La=c.replaceMermaidCell(X,Ca?c.createMermaidImageXml(wa,null,Ha,null,Na):mxMermaidToDrawio.wrapGroup(Ha,wa,Fa));Ca||null==Na||f.setCellStyles("groupPadding",Na,La)}else c.replaceLockedGroupChildren(X,Ha,wa,Fa)}finally{f.getModel().endUpdate()}}catch(Da){c.handleError(Da)}},function(Ha){c.spinner.stop();c.handleError(Ha)})}},null,null,ka?za:null,!0);L(sa)};+var Q=f.cellEditor.startEditing;f.cellEditor.startEditing=function(X,ka,na){try{var la=this.graph.getLockedGroupAncestor(X);null!=la&&(X=la);var ua=this.graph.getAttributeForCell(X,"plantUmlData");if(null!=ua)this.editPlantUmlData(X,ka,ua);else if(ua=this.graph.getAttributeForCell(X,"mermaidData"),null!=ua&&EditorUi.isMermaidSupported())this.editMermaidData(X,ka,ua);else{var za=f.getCellStyle(X);"1"==mxUtils.getValue(za,"metaEdit","0")?c.showDataDialog(X):Q.call(this,X,ka,na)}}catch(sa){c.handleError(sa)}};+f.getLinkTitle=function(X){return c.getLinkTitle(X)};f.customLinkClicked=function(X,ka){var na=!1;try{var la=this.view.graphBounds,ua=null!=la?new mxRectangle(la.x,la.y,la.width,la.height):null;c.handleCustomLink(X,ka);na=!0;var za=this.view.graphBounds;c.chromelessResize&&null!=ua&&null!=za&&!ua.equals(za)&&(c.chromelessResize(),this.scrollCellToVisible(ka))}catch(sa){c.handleError(sa)}return na};var V=f.parseBackgroundImage;f.parseBackgroundImage=function(X){var ka=V.apply(this,arguments);null!=+ka&&null!=ka.src&&Graph.isPageLink(ka.src)&&(ka={originalSrc:ka.src});return ka};var K=f.setBackgroundImage;f.setBackgroundImage=function(X){null!=X&&null!=X.originalSrc&&(X=c.createImageForPageLink(X.originalSrc,c.currentPage,this));K.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,+function(X,ka){X=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=X){var na=X.indexOf(",");if(0<na)for(X=X.substring(na+1),ka=ka.getProperty("patches"),na=0;na<ka.length;na++)if(null!=ka[na][EditorUi.DIFF_UPDATE]&&null!=ka[na][EditorUi.DIFF_UPDATE][X]||null!=ka[na][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(ka[na][EditorUi.DIFF_REMOVE],X)){f.refreshBackgroundImage();break}}}));var fa=f.getBackgroundImageObject;f.getBackgroundImageObject=function(X,ka,na){var la=fa.apply(this,arguments);+null!=la&&null!=la.originalSrc&&(la=ka?c.createImageForPageLink(la.originalSrc,na,null,!0):{src:la.originalSrc});return la};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var aa=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=+function(X){X=null!=X?X:"";"1"==urlParams.dev&&(X+=(0<X.length?"&":"?")+"dev=1");"1"==urlParams.test&&(X+=(0<X.length?"&":"?")+"test=1");return aa.apply(this,arguments)};var da=f.addClickHandler;f.addClickHandler=function(X,ka,na){var la=ka;ka=function(ua,za,sa){if(null==za){var wa=mxEvent.getSource(ua);"a"==wa.nodeName.toLowerCase()&&(za=wa.getAttribute("href"))}null!=za&&f.isCustomLink(za)&&(mxEvent.isTouchEvent(ua)||!mxEvent.isPopupTrigger(ua))&&f.customLinkClicked(za,sa)&&mxEvent.consume(ua);+null!=la&&la(ua,za,sa)};da.call(this,X,ka,na)};n.apply(this,arguments);Graph.browserTranslate&&f.waitForBrowserTranslate();this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var ba=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(X,ka,na){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(X,["zoomIn","zoomOut","-"],null,na);if(Editor.passiveScroll&&null!=na){var la=mxUtils.convertPoint(f.container,mxEvent.getClientX(na),+mxEvent.getClientY(na));f._contextMenuPoint=new mxPoint(f.snap(la.x/f.view.scale-f.view.translate.x),f.snap(la.y/f.view.scale-f.view.translate.y));f._contextMenuScreenPoint=mxUtils.convertPoint(f.container,mxEvent.getClientX(na),mxEvent.getClientY(na))}f.isSelectionEmpty()&&Editor.passiveScroll&&(this.addSubmenu("insert",X,null),X.addSeparator());ba.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||Editor.passiveScroll||this.addMenuItems(X,["-","addToScratchpad"],null,+na);f.isSelectionEmpty()&&!this.isShowStyleItems()&&this.addMenuItems(X,["-","exitGroup","home"],null,na)};var ha=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(X,ka,na){if(c.editor.graph.isSelectionEmpty())ha.apply(this,arguments),c.menus.addMenuItems(X,["copyAsImage","copyAsSvg"],null,na);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(X,ka,na):this.addPopupMenuArrangeItems(X,ka,na),this.addMenuItems(X,"- cut copy copyAsImage copyAsSvg duplicate".split(" "),+null,na),Editor.passiveScroll&&(1==f.getSelectionCount()?this.addMenuItems(X,["-","copyStyle","pasteStyle","copyTextStyle","pasteTextStyle"],null,na):this.addMenuItems(X,["-","pasteStyle","pasteTextStyle"],null,na)),this.addMenuItems(X,["-"],null,na),this.isShowCellEditItems()||this.addPopupDeleteItem(X,ka,na),this.addMenuItems(X,["lockUnlock","-"],null,na),!this.isShowStyleItems()){if(1==f.getSelectionCount()&&!f.isCellLocked(ka)&&f.isCellEditable(ka)&&(this.addSubmenu("editCell",X,null,mxResources.get("edit")),+X.addSeparator(),f.getModel().isEdge(ka))){this.addSubmenu("line",X);var la=f.getModel().getGeometry(ka);null!=la&&null!=la.points&&0<la.points.length&&this.addMenuItems(X,["clearWaypoints"],null,na)}1==f.getSelectionCount()&&this.addMenuItems(X,["enterGroup"],null,na);la=c.getSelectionState();null!=la.mergeCell?this.addMenuItem(X,"mergeCells"):(1<la.style.colspan||1<la.style.rowspan)&&this.addMenuItem(X,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&+"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}if(Editor.passiveScroll){var qa=f.getCenterInsertPoint;f.getCenterInsertPoint=function(X){if(null!=this._contextMenuPoint){var ka=this._contextMenuPoint;X=null!=X?X:new mxRectangle;return new mxPoint(f.snap(ka.x-(X.width||0)/2),f.snap(ka.y-(X.height||+0)/2))}return qa.apply(this,arguments)};var ra=f.popupMenuHandler.hideMenu;f.popupMenuHandler.hideMenu=function(){ra.apply(this,arguments);window.setTimeout(function(){f._contextMenuPoint=null;f._contextMenuScreenPoint=null},0)}}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var l=f.getExportVariables;f.getExportVariables=function(){var X=l.apply(this,arguments),ka=c.getCurrentFile();+null!=ka&&(X.filename=ka.getTitle());c.updateFileVars();if(null!=c.fileVars)for(var na in c.fileVars)null==X[na]&&(X[na]=c.fileVars[na]);X.pagecount=null!=c.pages?c.pages.length:1;X.page=null!=c.currentPage?c.currentPage.getName():"";X.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return X};var t=f.getGlobalVariable;f.getGlobalVariable=function(X){var ka=c.getCurrentFile();if("filename"==X&&null!=ka)return ka.getTitle();if("page"==X&&null!=c.currentPage)return c.currentPage.getName();+if("pagenumber"==X)return null!=c.currentPage&&null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1;if("pagecount"==X)return null!=c.pages?c.pages.length:1;ka=t.apply(this,arguments);null==ka&&(c.updateFileVars(),null!=c.fileVars&&(ka=c.fileVars[X]));return ka};var H=null,J=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var X=this.getCurrentFile(),ka=null!=X&&null!=X.getTitle()?X.getTitle():this.defaultFilename;H!=ka&&X==J&&(f.invalidateDescendantsWithPlaceholders(f.model.getRoot()),+f.view.validate());H=ka;J=X}));var R=f.labelLinkClicked;f.labelLinkClicked=function(X,ka,na){var la=ka.getAttribute("href");if(null==la||!f.isCustomLink(la)||!mxEvent.isTouchEvent(na)&&mxEvent.isPopupTrigger(na))R.apply(this,arguments);else{if(!f.isEnabled()||null!=X&&f.isCellLocked(X.cell))f.customLinkClicked(la),f.getRubberband().reset();mxEvent.consume(na)}};this.editor.getOrCreateFilename=function(){var X=c.defaultFilename,ka=c.getCurrentFile();null!=ka&&(X=null!=ka.getTitle()?ka.getTitle():X);+return X};q=this.actions.get("print");q.setEnabled(!mxClient.IS_IOS||!navigator.standalone);q.visible=q.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),+this.keyHandler.bindAction(76,!1,"insertLink"),this.keyHandler.bindAction(82,!1,"insertRhombus"),this.keyHandler.bindAction(67,!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize",this.installKeyboardShortcuts(),"1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),+Editor.passiveScroll&&document.body.classList.add("geInlineNoUi"),Editor.passiveScroll||f.addListener(mxEvent.ESCAPE,function(X,ka){null!=ka&&f.isEnabled()&&!f.isEditing()&&null!=ka.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),this.useInternalClipboard||this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(X){var ka=+f.cellEditor.text2,na=null;null!=ka&&(mxEvent.addListener(ka,"dragleave",function(la){null!=na&&(na.parentNode.removeChild(na),na=null);la.stopPropagation();la.preventDefault()}),mxEvent.addListener(ka,"dragover",mxUtils.bind(this,function(la){null==na&&(na=this.highlightElement(ka));la.stopPropagation();la.preventDefault()})),mxEvent.addListener(ka,"drop",mxUtils.bind(this,function(la){null!=na&&(na.parentNode.removeChild(na),na=null);if(0<la.dataTransfer.files.length)this.importFiles(la.dataTransfer.files,+0,0,this.maxImageSize,function(za,sa,wa,Ca,Fa,Ha){f.insertImage(za,Fa,Ha)},function(){},function(za){return"image/"==za.type.substring(0,6)},function(za){for(var sa=0;sa<za.length;sa++)za[sa]()},mxEvent.isControlDown(la));else if(0<=mxUtils.indexOf(la.dataTransfer.types,"text/uri-list")){var ua=la.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(ua)?this.loadImage(decodeURIComponent(ua),mxUtils.bind(this,function(za){var sa=Math.max(1,za.width);za=Math.max(1,za.height);+var wa=this.maxImageSize;wa=Math.min(1,Math.min(wa/Math.max(1,sa)),wa/Math.max(1,za));f.insertImage(decodeURIComponent(ua),sa*wa,za*wa)})):document.execCommand("insertHTML",!1,la.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(la.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,la.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(la.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,la.dataTransfer.getData("text/plain"));la.stopPropagation();+la.preventDefault()})))}));if(Editor.isSettingsEnabled()){q=this.editor.graph.view;var T=mxSettings.getUnit();q.setUnit(T);Editor.pageSizeUnit=T;q.addListener("unitChanged",function(X,ka){X=ka.getProperty("unit");mxSettings.setUnit(X);mxSettings.save();Editor.pageSizeUnit=X});this.ruler=!Editor.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,q.unit);this.refresh()}if("1"==urlParams.styledev){q=+document.getElementById("geFooter");null!=q&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),+this.styleInput.value)})),q.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(X,ka){0<this.editor.graph.getSelectionCount()?(X=this.editor.graph.getSelectionCell(),X=this.editor.graph.getModel().getStyle(X),this.styleInput.value=X||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var Y=this.isSelectionAllowed;this.isSelectionAllowed=function(X){return mxEvent.getSource(X)==this.styleInput?+!0:Y.apply(this,arguments)}}q=document.getElementById("geInfo");null!=q&&q.parentNode.removeChild(q);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var Z=null;mxEvent.addListener(f.container,"dragleave",function(X){f.isEnabled()&&(null!=Z&&(Z.parentNode.removeChild(Z),Z=null),X.stopPropagation(),X.preventDefault())});mxEvent.addListener(f.container,"dragover",mxUtils.bind(this,function(X){null==Z&&(Z=this.highlightElement(f.container));null!=this.sidebar&&this.sidebar.hideTooltip();+X.stopPropagation();X.preventDefault()}));mxEvent.addListener(f.container,"drop",mxUtils.bind(this,function(X){null!=Z&&(Z.parentNode.removeChild(Z),Z=null);if(f.isEnabled()){var ka=mxUtils.convertPoint(f.container,mxEvent.getClientX(X),mxEvent.getClientY(X)),na=X.dataTransfer.files,la=f.view.translate,ua=f.view.scale,za=ka.x/ua-la.x,sa=ka.y/ua-la.y;if(0<na.length)ka=this.isBlankFile()&&!this.canUndo(),la=1==na.length&&(EditorUi.isVisioFilename(na[0].name)||/(\.drawio)$/i.test(na[0].name)||/(\.xml)$/i.test(na[0].name)),+"1"!=urlParams.embed&&ka&&(la||mxEvent.isShiftDown(X))?(ka=this.getCurrentFile(),null!=ka&&ka.isModified()||this.fileLoaded(null,!0),this.openFiles(na,!0,mxUtils.bind(this,function(){var La=this.getCurrentFile();null!=La&&La.fileChanged()}))):(mxEvent.isAltDown(X)&&(sa=za=null),this.importFiles(na,za,sa,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(X),null,null,mxEvent.isShiftDown(X),X));else{mxEvent.isAltDown(X)&&(sa=za=0);var wa=0<=mxUtils.indexOf(X.dataTransfer.types,"text/uri-list")?+X.dataTransfer.getData("text/uri-list"):null;na=this.extractGraphModelFromEvent(X,null!=this.pages);if(null!=na)f.setSelectionCells(this.importXml(na,za,sa,!0));else if(0<=mxUtils.indexOf(X.dataTransfer.types,"text/html")){var Ca=X.dataTransfer.getData("text/html");na=document.createElement("div");na.innerHTML=Graph.sanitizeHtml(Ca);var Fa=null;ka=na.getElementsByTagName("img");null!=ka&&1==ka.length?(Ca=ka[0].getAttribute("src"),null==Ca&&(Ca=ka[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(Ca)||+(Fa=!0)):(ka=na.getElementsByTagName("a"),null!=ka&&1==ka.length?Ca=ka[0].getAttribute("href"):(na=na.getElementsByTagName("pre"),null!=na&&1==na.length&&(Ca=mxUtils.getTextContent(na[0]))));var Ha=!0,Na=mxUtils.bind(this,function(){f.setSelectionCells(this.insertTextAt(Ca,za,sa,!0,Fa,null,Ha,mxEvent.isControlDown(X)))});Fa&&null!=Ca&&Ca.length>this.resampleThreshold?this.confirmImageResize(function(La){Ha=La;Na()},mxEvent.isControlDown(X)):Na()}else null!=wa&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(wa)?+this.loadImage(decodeURIComponent(wa),mxUtils.bind(this,function(La){var Da=Math.max(1,La.width);La=Math.max(1,La.height);var Sa=this.maxImageSize;Sa=Math.min(1,Math.min(Sa/Math.max(1,Da)),Sa/Math.max(1,La));f.setSelectionCell(f.insertVertex(null,null,"",za,sa,Da*Sa,La*Sa,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+wa+";"))}),mxUtils.bind(this,function(La){f.setSelectionCells(this.insertTextAt(wa,za,sa,!0))})):0<=mxUtils.indexOf(X.dataTransfer.types,+"text/plain")&&f.setSelectionCells(this.insertTextAt(X.dataTransfer.getData("text/plain"),za,sa,!0))}}X.stopPropagation();X.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer(!0)}));+this.addListener("darkModeChanged",function(){mxClient.IS_SF&&f.view.validateBackground()});f.addListener("enabledChanged",mxUtils.bind(this,function(){f.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var X=parseInt(this.div.offsetLeft),ka=parseInt(this.div.offsetWidth),na=c.embedViewport.x+c.embedViewport.width,la=parseInt(this.div.offsetTop),ua=parseInt(this.div.offsetHeight),+za=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,Math.min(X,na-ka))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(la,za-ua))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};var ia=mxWindow.prototype.setLocation;mxWindow.prototype.setLocation=function(X,ka){ia.call(this,X,ka);c.hideCurrentMenu()};var ja=mxWindow.prototype.setSize;+mxWindow.prototype.setSize=function(X,ka){ja.call(this,X,ka);c.hideCurrentMenu()};if(!this.editor.chromeless||this.editor.editable){q=Editor.currentTheme;if("simple"==q||"sketch"==q)this.doSetCurrentTheme(q,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(T=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,T<Editor.smallScreenWidth&&(this.formatWidth=0),"simple"==q&&T<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),"simple"==q&&(this.lastWindowWidth=+T)),this.fireEvent(new mxEventObject("themeInitialized"));this.restoreVisibleWindows();"kennedy"==q&&(T=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,T<Editor.smallScreenWidth&&(this.formatWidth=0),T<Editor.smallScreenWidth-240&&(this.hsplitPosition=0),this.lastWindowWidth=T)}q=!1;if(null!=urlParams.dark)q=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)q="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||q&&"auto"!=+mxSettings.settings.darkMode||(q=mxSettings.settings.darkMode);"auto"==q&&this.isAutoDarkModeSupported()&&(q=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof q?"1"==q:q);if(this.isAutoDarkModeSupported())try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(X){this.isAutoDarkMode()&&this.setDarkMode(X.matches)}))}catch(X){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):+Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast?this.setHighContrast(mxSettings.settings.highContrast):null!=window.matchMedia&&window.matchMedia("(prefers-contrast: more)").matches&&this.setHighContrast(!0);Editor.isSettingsEnabled()&&(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));+this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(X,ka){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var y=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme||+"kennedy"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));f=Editor.smallScreenWidth-160;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isShapesPanelVisible()&&this.toggleShapesPanel(!1,+!0):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&!this.isShapesPanelVisible()&&this.sidebarEnabled&&this.toggleShapesPanel(!0,!0);this.lastWindowWidth=c}y.apply(this,arguments);null!=this.updateFullscreenState&&this.updateFullscreenState()};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,k=this.sketchPickerMenuElt,q=this.editor.graph;k.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,+function(V){mxEvent.getSource(V)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(V),mxEvent.getClientY(V)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var x=document.createElement("div");x.style.position="absolute";x.style.width="10px";x.style.height="10px";x.style.borderRadius="5px";x.style.border="1px solid gray";x.style.background="#ffffff";x.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(x);this.bottomResizer=+x;var C=null,E=null,L=null,Q=null;mxEvent.addGestureListeners(x,mxUtils.bind(this,function(V){Q=parseInt(this.diagramContainer.style.height);E=mxEvent.getClientY(V);q.popupMenuHandler.hideMenu();mxEvent.consume(V)}));x=x.cloneNode(!1);x.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(x);this.rightResizer=x;mxEvent.addGestureListeners(x,mxUtils.bind(this,function(V){L=parseInt(this.diagramContainer.style.width);C=mxEvent.getClientX(V);q.popupMenuHandler.hideMenu();mxEvent.consume(V)}));+mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(V){var K=!1;null!=C&&(this.diagramContainer.style.width=Math.max(20,L+mxEvent.getClientX(V)-C)+"px",K=!0);null!=E&&(this.diagramContainer.style.height=Math.max(20,Q+mxEvent.getClientY(V)-E)+"px",K=!0);K&&((this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),+function(V){null==C&&null==E||mxEvent.consume(V);E=C=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(V){this.inlineSizeChanged();Editor.passiveScroll?this.hideWindows():this.fitWindows()}));+this.addListener("editInlineStop",mxUtils.bind(this,function(V){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";f.style.visibility="hidden";c.style.visibility="hidden";k.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){k.innerHTML=+" ";k.focus();try{var C=document.createRange();C.selectNodeContents(k);var E=window.getSelection();null!=E&&(E.removeAllRanges(),E.addRange(C))}catch(L){}},0)}var f=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck","false");k.style.textRendering="optimizeSpeed";k.style.fontFamily="monospace";k.style.wordBreak="break-all";k.style.background="transparent";+k.style.color="transparent";k.style.position="absolute";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.display="block";k.style.fontSize="1";k.style.zIndex="-1";k.style.resize="none";k.style.outline="none";k.style.width="1px";k.style.height="1px";mxUtils.setOpacity(k,0);k.contentEditable=!0;k.innerHTML=" ";this.clipboardElt=k;var q=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,+"keydown",mxUtils.bind(this,function(C){var E=mxEvent.getSource(C);null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==E.nodeName||"TEXTAREA"==E.nodeName&&E!==this.typingShim||"true"==E.contentEditable||224!=C.keyCode&&(mxClient.IS_MAC||17!=C.keyCode)&&(!mxClient.IS_MAC||91!=C.keyCode&&93!=C.keyCode)||q||(k.style.left=f.container.scrollLeft+10+"px",k.style.top=f.container.scrollTop+10+"px",C=f.container.scrollLeft,E=f.container.scrollTop,f.container.appendChild(k),+q=!0,k.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=C,f.container.scrollTop=E)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(C){var E=C.keyCode;window.setTimeout(mxUtils.bind(this,function(){!q||224!=E&&17!=E&&91!=E&&93!=E||(q=!1,k.parentNode.removeChild(k),f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(C){if(f.isEnabled())try{mxClipboard.copy(f),+this.copyCells(k),c()}catch(E){this.handleError(E)}}));mxEvent.addListener(k,"cut",mxUtils.bind(this,function(C){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(k,!0),c()}catch(E){this.handleError(E)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(C){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(k.innerHTML=" ",k.focus(),null!=C.clipboardData&&(Graph.removePasteFormatting(k.firstChild),this.pasteCells(C,k,!0,!0)),!mxEvent.isConsumed(C)){var E=f.container.scrollLeft,+L=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{f.container.scrollLeft=E,f.container.scrollTop=L,Graph.removePasteFormatting(k.firstChild),this.pasteCells(C,k,!1,!0)}catch(Q){this.handleError(Q)}}),0)}}catch(Q){this.handleError(Q)}}),!0);var x=this.isSelectionAllowed;this.isSelectionAllowed=function(C){return mxEvent.getSource(C)==k?!0:x.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};+EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var k="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(k||f)f=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),+this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(f);return k};EditorUi.prototype.saveScrollState=function(c){var f=this.editor.graph.view.translate,k=this.diagramContainer.scrollLeft,q=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(k-=this.embedViewport.x,q-=this.embedViewport.y):(k+=this.embedViewport.x,q+=this.embedViewport.y));f={x:k,y:q,tx:f.x,ty:f.y};c&&(f.boundingRect=this.diagramContainer.getBoundingClientRect());return f};+EditorUi.prototype.restoreScrollState=function(c){var f=this.editor.graph.view.scale,k=this.editor.graph.view.translate;if(null!=c.boundingRect){var q=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-q.x;c.y-=c.boundingRect.y-q.y}this.diagramContainer.scrollLeft=c.x+(k.x-c.tx)*f;this.diagramContainer.scrollTop=c.y+(k.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,+function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||f||(this.statusContainer.style.display="none")}));var k=mxUtils.bind(this,function(){if("sketch"==Editor.currentTheme){var q=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;f=null!=q&&null!=q.getAttribute("class");+if(!f&&null!=q){q=q.getAttribute("title");var x=this.getCurrentFile();x=null!=x?x.savingStatusKey:DrawioFile.prototype.savingStatusKey;q==mxResources.get(x)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(x))+'..."src="'+Editor.tailSpin+'"></div>',f=!0)}this.statusContainer.style.display="none";q=32>=c.clientWidth;c.style.visibility=q&&""==this.editor.getStatus()?"hidden":"";if(q||f)this.statusContainer.style.display="",f=!0}else"simple"==Editor.currentTheme?+(this.statusContainer.style.display="",this.statusContainer.style.display=0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",k);k()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),+this.createShapesWindow())};EditorUi.prototype.getWindows=function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.fit()};EditorUi.prototype.hideWindows=+function(){for(var c=this.getWindows(),f=0;f<c.length;f++)null!=c[f]&&c[f].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.chatWindow&&(this.chatWindow.destroy(),this.chatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),+this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null));null!=this.dockManager&&(this.dockManager.destroy(),this.dockManager=null);null!=this._dockResizeListener&&(mxEvent.removeListener(window,"resize",this._dockResizeListener),this._dockResizeListener=null)};EditorUi.prototype.restoreVisibleWindows=function(){if(Editor.isSettingsEnabled()){var c={layers:"layers",outline:"outline",tags:"tags"},f;for(f in c){var k=mxSettings.getWindowState(f);null!=k&&k.visible&&(k=this.actions.get(c[f]),null!=k&&k.funct())}}};EditorUi.prototype.saveWindowState=function(c,f){f=f.window;var k=f.minimized&&null!=f.height?parseInt(f.height):parseInt(f.div.style.height);mxSettings.setWindowState(c,{x:f.getX(),y:f.getY(),w:parseInt(f.div.style.width),h:k,visible:f.isVisible(),minimized:f.minimized||!1,dockState:f.dockState||null,dockAnchorRight:f._dockAnchorRight||null,dockAnchorBottom:f._dockAnchorBottom||null,dockOffsetX:f._dockOffsetX||null,dockOffsetY:f._dockOffsetY||null});mxSettings.save()};EditorUi.prototype.restoreWindowState=function(c,f){c=mxSettings.getWindowState(c);if(null==c)return null;f=f.window;null!=c.w&&null!=c.h&&mxWindow.prototype.setSize.call(f,c.w,c.h);null!=c.x&&null!=c.y&&mxWindow.prototype.setLocation.call(f,c.x,c.y);null!=c.dockState&&null!=this.dockManager&&Editor.enableWindowDocking&&(f._dockAnchorRight=c.dockAnchorRight,f._dockAnchorBottom=c.dockAnchorBottom,f._dockOffsetX=c.dockOffsetX,f._dockOffsetY=c.dockOffsetY,f.dockState=c.dockState,f.div.classList.add("mxWindowDocked"),this.dockManager.windows.push(f),this.dockManager.pinToEdge(f));f.fit();null!=c.visible&&f.setVisible(c.visible);c.minimized&&!f.minimized&&f.toggleMinimized();return c};EditorUi.prototype.installWindowPersistence=function(c,f){var k=this,q=f.window,x=function(){k.saveWindowState(c,f)};q.addListener(mxEvent.MOVE_END,x);q.addListener(mxEvent.RESIZE_END,x);q.addListener(mxEvent.SHOW,x);q.addListener(mxEvent.HIDE,x);q.addListener(mxEvent.DOCK,x);q.addListener(mxEvent.UNDOCK,-x);q.addListener(mxEvent.MAXIMIZE,x);q.addListener(mxEvent.MINIMIZE,x);q.addListener(mxEvent.NORMALIZE,x)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,f,k){var q=this.threshold,x=c<=q;c=c+k.offsetWidth>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-q;var B=f<=q;f=f+k.offsetHeight>=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-q;return x&&-B?"top-left":c&&B?"top-right":x&&f?"bottom-left":c&&f?"bottom-right":x?"left":c?"right":B?"top":f?"bottom":null},dock:function(c,f){var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=parseInt(c.div.style.width),B=parseInt(c.div.style.height),E=c.getX(),L=c.getY();c.dockState=f;c.div.classList.add("mxWindowDocked");var Q=0<=f.indexOf("right"),V=0<=f.indexOf("bottom");0<=f.indexOf("left")?-E=0:0<=f.indexOf("right")&&(E=k-x);0<=f.indexOf("top")?L=0:0<=f.indexOf("bottom")&&(L=q-B);Q||(Q=E+x/2>k/2);V||(V=L+B/2>q/2);c._dockAnchorRight=Q;c._dockAnchorBottom=V;c._dockOffsetX=Q?k-E-x:E;c._dockOffsetY=V?q-L-B:L;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,"side",f))},undock:function(c){var f=c.dockState;if(null!=f){for(var k=0;k<this.windows.length;k++)if(this.windows[k]===c){this.windows.splice(k,1);break}c.div.classList.remove("mxWindowDocked");c.dockState=-null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",f))}},pinToEdge:function(c){var f=c.dockState;if(null!=f){var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=parseInt(c.div.style.width),B=parseInt(c.div.style.height);var E=c._dockAnchorRight?k-x-(c._dockOffsetX||0):c._dockOffsetX||-0;var L=c._dockAnchorBottom?q-B-(c._dockOffsetY||0):c._dockOffsetY||0;0<=f.indexOf("left")?E=0:0<=f.indexOf("right")&&(E=k-x);0<=f.indexOf("top")?L=0:0<=f.indexOf("bottom")&&(L=q-B);E=Math.max(0,Math.min(E,k-x));L=Math.max(0,Math.min(L,q-B));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,E,L);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,f){null==this.previewElement&&(this.previewElement=document.createElement("div"),-this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=this.previewElement,B=f.div.offsetWidth,E=f.div.offsetHeight,L=f.getX();f=f.getY();0<=c.indexOf("left")?L=0:0<=c.indexOf("right")&&(L=k-B);0<=c.indexOf("top")?f=0:0<=c.indexOf("bottom")&&(f=q-E);L=Math.max(0,Math.min(L,k-B));f=Math.max(0,-Math.min(f,q-E));x.style.display="block";x.style.left=L+"px";x.style.top=f+"px";x.style.width=B+"px";x.style.height=E+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var f=0;f<this.windows.length;f++)if(this.windows[f]===c){this.windows.splice(f,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=-null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var C=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,f,k){C.apply(this,arguments);if(EditorUi.windowed&&Editor.enableWindowDocking){var q=c.window;null==this.dockManager&&this.createDockManager();var x=this.dockManager,B=!1,E=null,L=q.setLocation;q.setLocation=function(K,fa){(null==+x);q.addListener(mxEvent.MAXIMIZE,x);q.addListener(mxEvent.MINIMIZE,x);q.addListener(mxEvent.NORMALIZE,x)};EditorUi.prototype.createDockManager=function(){this.dockManager={windows:[],threshold:16,previewElement:null,getDockZone:function(c,f,k){var q=this.threshold,x=c<=q;c=c+k.offsetWidth>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-q;var C=f<=q;f=f+k.offsetHeight>=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-q;return x&&+C?"top-left":c&&C?"top-right":x&&f?"bottom-left":c&&f?"bottom-right":x?"left":c?"right":C?"top":f?"bottom":null},dock:function(c,f){var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=parseInt(c.div.style.width),C=parseInt(c.div.style.height),E=c.getX(),L=c.getY();c.dockState=f;c.div.classList.add("mxWindowDocked");var Q=0<=f.indexOf("right"),V=0<=f.indexOf("bottom");0<=f.indexOf("left")?+E=0:0<=f.indexOf("right")&&(E=k-x);0<=f.indexOf("top")?L=0:0<=f.indexOf("bottom")&&(L=q-C);Q||(Q=E+x/2>k/2);V||(V=L+C/2>q/2);c._dockAnchorRight=Q;c._dockAnchorBottom=V;c._dockOffsetX=Q?k-E-x:E;c._dockOffsetY=V?q-L-C:L;this.windows.push(c);this.pinToEdge(c);c.fireEvent(new mxEventObject(mxEvent.DOCK,"side",f))},undock:function(c){var f=c.dockState;if(null!=f){for(var k=0;k<this.windows.length;k++)if(this.windows[k]===c){this.windows.splice(k,1);break}c.div.classList.remove("mxWindowDocked");c.dockState=+null;c._dockAnchorRight=null;c._dockAnchorBottom=null;c._dockOffsetX=null;c._dockOffsetY=null;c.fireEvent(new mxEventObject(mxEvent.UNDOCK,"side",f))}},pinToEdge:function(c){var f=c.dockState;if(null!=f){var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=parseInt(c.div.style.width),C=parseInt(c.div.style.height);var E=c._dockAnchorRight?k-x-(c._dockOffsetX||0):c._dockOffsetX||+0;var L=c._dockAnchorBottom?q-C-(c._dockOffsetY||0):c._dockOffsetY||0;0<=f.indexOf("left")?E=0:0<=f.indexOf("right")&&(E=k-x);0<=f.indexOf("top")?L=0:0<=f.indexOf("bottom")&&(L=q-C);E=Math.max(0,Math.min(E,k-x));L=Math.max(0,Math.min(L,q-C));c._relayouting=!0;mxWindow.prototype.setLocation.call(c,E,L);c._relayouting=!1}},layoutAll:function(){for(var c=0;c<this.windows.length;c++)this.pinToEdge(this.windows[c])},showPreview:function(c,f){null==this.previewElement&&(this.previewElement=document.createElement("div"),+this.previewElement.className="geDockPreview",document.body.appendChild(this.previewElement));var k=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,q=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=this.previewElement,C=f.div.offsetWidth,E=f.div.offsetHeight,L=f.getX();f=f.getY();0<=c.indexOf("left")?L=0:0<=c.indexOf("right")&&(L=k-C);0<=c.indexOf("top")?f=0:0<=c.indexOf("bottom")&&(f=q-E);L=Math.max(0,Math.min(L,k-C));f=Math.max(0,+Math.min(f,q-E));x.style.display="block";x.style.left=L+"px";x.style.top=f+"px";x.style.width=C+"px";x.style.height=E+"px"},hidePreview:function(){null!=this.previewElement&&(this.previewElement.style.display="none")},removeWindow:function(c){for(var f=0;f<this.windows.length;f++)if(this.windows[f]===c){this.windows.splice(f,1);break}},destroy:function(){null!=this.previewElement&&null!=this.previewElement.parentNode&&(this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=+null)}};this._dockResizeListener=mxUtils.bind(this,function(){null!=this.dockManager&&this.dockManager.layoutAll()});mxEvent.addListener(window,"resize",this._dockResizeListener)};var B=EditorUi.prototype.installResizeHandler;EditorUi.prototype.installResizeHandler=function(c,f,k){B.apply(this,arguments);if(EditorUi.windowed&&Editor.enableWindowDocking){var q=c.window;null==this.dockManager&&this.createDockManager();var x=this.dockManager,C=!1,E=null,L=q.setLocation;q.setLocation=function(K,fa){(null==this.dockState||this._undocking||this._relayouting)&&L.call(this,K,fa)};var Q=q.setSize;q.setSize=function(K,fa){if(null!=this.dockState){mxWindow.prototype.setSize.call(this,K,fa);K=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;fa=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var aa=parseInt(this.div.style.width),da=parseInt(this.div.style.height),ba=this.getX(),ha=this.getY();this._dockOffsetX=this._dockAnchorRight?K-ba--aa:ba;this._dockOffsetY=this._dockAnchorBottom?fa-ha-da:ha;x.pinToEdge(this)}else Q.call(this,K,fa)};q.addListener(mxEvent.MOVE_START,function(K,fa){B=!0;E=null;null!=q.dockState&&(q._undocking=!0,x.undock(q),q._undocking=!1)});q.addListener(mxEvent.MOVE,function(K,fa){B&&(K=x.getDockZone(q.getX(),q.getY(),q.div),K!=E&&(E=K,null!=K?x.showPreview(K,q):x.hidePreview()))});q.addListener(mxEvent.MOVE_END,function(K,fa){B=!1;x.hidePreview();null!=E&&x.dock(q,E);E=null});q.addListener(mxEvent.DOCK,function(K,+aa:ba;this._dockOffsetY=this._dockAnchorBottom?fa-ha-da:ha;x.pinToEdge(this)}else Q.call(this,K,fa)};q.addListener(mxEvent.MOVE_START,function(K,fa){C=!0;E=null;null!=q.dockState&&(q._undocking=!0,x.undock(q),q._undocking=!1)});q.addListener(mxEvent.MOVE,function(K,fa){C&&(K=x.getDockZone(q.getX(),q.getY(),q.div),K!=E&&(E=K,null!=K?x.showPreview(K,q):x.hidePreview()))});q.addListener(mxEvent.MOVE_END,function(K,fa){C=!1;x.hidePreview();null!=E&&x.dock(q,E);E=null});q.addListener(mxEvent.DOCK,function(K,fa){if(null!=q.resize){K=fa.getProperty("side");var aa=0<=K.indexOf("right"),da=0<=K.indexOf("bottom");if(aa||da){K=q.resize;K.parentNode.removeChild(K);q.resize=null;K=document.createElement("img");K.style.position="absolute";K.style.zIndex="2";K.setAttribute("src",mxWindow.prototype.resizeImage);aa?K.style.left="0px":K.style.right="0px";da?K.style.top="0px":K.style.bottom="0px";K.style.cursor=aa!=da?"nesw-resize":"nwse-resize";var ba=null,ha=null,qa=null,ra=null,l=function(H){if(null!=ba&&null!=ha){var J=mxEvent.getClientX(H)-ba,R=mxEvent.getClientY(H)-ha;q.setSize(aa?qa-J:qa+J,da?ra-R:ra+R);q.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",H));mxEvent.consume(H)}},t=function(H){null!=ba&&null!=ha&&(ha=ba=null,mxEvent.removeGestureListeners(document,null,l,t),q.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",H)),mxEvent.consume(H))};mxEvent.addGestureListeners(K,function(H){q.activate();ba=mxEvent.getClientX(H);ha=mxEvent.getClientY(H);qa=q.div.offsetWidth;ra=q.div.offsetHeight;mxEvent.addGestureListeners(document,null,l,t);q.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",H));mxEvent.consume(H)},l,t);q.div.appendChild(K);q.resize=K;q._dockResize=!0}}});q.addListener(mxEvent.UNDOCK,function(K,fa){q._dockResize&&(null!=q.resize&&(q.resize.parentNode.removeChild(q.resize),q.resize=null),q.setResizable(!0),q._dockResize=!1)});q.addListener(mxEvent.NORMALIZE,function(K,fa){null!=q.dockState&&x.pinToEdge(q)});q.addListener(mxEvent.MAXIMIZE,function(K,fa){null!=q.dockState&&@@ -4407,19 +4410,19 @@ function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUif.isRealtimeSupported()&&1<f.getRealtimeState()&&(c=f.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+": "+(null!=c&&null!=c.message?c.message:mxResources.get("error"))):c=mxResources.get("notConnected"):c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,f,k,q){k=null!=k?k:"geButton";var x=this.menus.get(c);q=this.menubar.addMenu(mxResources.get(c),x.funct,null,q);q.className=k;q.setAttribute("title",mxResources.get(c));this.menus.menuCreated(x,q,k);null!=f&&(q.style.backgroundImage="url("+f+")",q.innerText="");return q};EditorUi.prototype.addButton=function(c,f,k,q){c=this.createToolbarButton(c,f,k);q=null!=q?q:this.container;q.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,f,k){var q=document.createElement("a");q.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(q.style.backgroundImage="url("+c+")");null!=f&&q.setAttribute("title",-f);null!=k&&mxEvent.addListener(q,"click",function(x){"disabled"!=q.getAttribute("disabled")&&k(x);mxEvent.consume(x)});mxEvent.preventDefault(q);return q};EditorUi.prototype.createMenuItem=function(c,f,k){var q=this.actions.get(c),x=null!=q?q.funct:null,B=this.createToolbarButton(f,mxResources.get(c)+(null!=q&&null!=q.shortcut?" ("+q.shortcut+")":""),x);null==q||k||(c=function(){q.isEnabled()?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",-c),q.addListener("stateChanged",c),c());return B};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,f=mxSettings.getWindowState("format"),k=null!=f&&null!=f.x?f.x:Math.max(10,this.diagramContainer.parentNode.clientWidth-256),q=null!=f&&null!=f.y?f.y:60,x=null!=f&&null!=f.w?f.w:240,B=null!=f&&null!=f.h?f.h:"1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,-mxResources.get("format"),k,q,x,B,mxUtils.bind(this,function(Q){Q.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var E=this.formatWindow.window.toggleMinimized,L=x;this.formatWindow.window.toggleMinimized=function(){E.apply(this,arguments);this.minimized?(L=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=+f);null!=k&&mxEvent.addListener(q,"click",function(x){"disabled"!=q.getAttribute("disabled")&&k(x);mxEvent.consume(x)});mxEvent.preventDefault(q);return q};EditorUi.prototype.createMenuItem=function(c,f,k){var q=this.actions.get(c),x=null!=q?q.funct:null,C=this.createToolbarButton(f,mxResources.get(c)+(null!=q&&null!=q.shortcut?" ("+q.shortcut+")":""),x);null==q||k||(c=function(){q.isEnabled()?C.removeAttribute("disabled"):C.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",+c),q.addListener("stateChanged",c),c());return C};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,f=mxSettings.getWindowState("format"),k=null!=f&&null!=f.x?f.x:Math.max(10,this.diagramContainer.parentNode.clientWidth-256),q=null!=f&&null!=f.y?f.y:60,x=null!=f&&null!=f.w?f.w:240,C=null!=f&&null!=f.h?f.h:"1"==urlParams.embedInline?600:"1"==urlParams.sketch?600:Math.min(600,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,+mxResources.get("format"),k,q,x,C,mxUtils.bind(this,function(Q){Q.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){null!=this.format&&this.format.refresh();this.formatWindow.window.fit()}));var E=this.formatWindow.window.toggleMinimized,L=x;this.formatWindow.window.toggleMinimized=function(){E.apply(this,arguments);this.minimized?(L=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+L-140+"px"):(this.div.style.width=L+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-L+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(Q){mxEvent.getSource(Q)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);this.installWindowPersistence("format",this.formatWindow);null!=f?this.restoreWindowState("format",this.formatWindow):"sketch"==Editor.currentTheme&&this.formatEnabled?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var Q=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,V=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>Q||690>V)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};-var P=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):P.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,f){if(this.isShapesPanelVisible()!=c){var k=EditorUi.prototype.hsplitPosition;0==k&&(k=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var q=this.hsplitPosition,x=mxUtils.bind(this,function(){this.hsplitPosition=B;this.refresh();-f||(this.diagramContainer.scrollLeft-=q-this.hsplitPosition)}),B=c?k:0,E=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==B?"translateX(0)":"translateX(-100%)");0!=B&&x();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==B?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+E+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,-"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==B&&x();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*E)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var G=EditorUi.prototype.isFormatPanelVisible;+var P=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):P.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c,f){if(this.isShapesPanelVisible()!=c){var k=EditorUi.prototype.hsplitPosition;0==k&&(k=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var q=this.hsplitPosition,x=mxUtils.bind(this,function(){this.hsplitPosition=C;this.refresh();+f||(this.diagramContainer.scrollLeft-=q-this.hsplitPosition)}),C=c?k:0,E=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==C?"translateX(0)":"translateX(-100%)");0!=C&&x();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==C?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+E+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,+"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==C&&x();this.fireEvent(new mxEventObject("shapesPanelChanged"))}),1E3*E)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var G=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():G.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var f=mxUtils.bind(this,function(E,L){var Q=this.menus.get(E);E=this.createMenuElement(L,mxUtils.bind(this,function(){Q.funct.apply(this,arguments)}));E.setAttribute("title",L);E.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";E.className="geButton";c.parentNode.appendChild(E);return E});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))f=document.createElement("div"),f.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",f.className="geButton",f.style.left="0px",f.style.right="50%",mxUtils.write(f,mxResources.get("newLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("newLibrary").funct),f=f.cloneNode(!1),f.style.left=-"50%",f.style.right="0px",mxUtils.write(f,mxResources.get("openLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("openLibrary").funct);else{var k=f("newLibrary","");k.style.left="0px";k.style.right="50%";var q=document.createElement("span");k.appendChild(q);var x=f("openLibraryFrom","");x.style.borderLeftWidth="1px";x.style.left="50%";x.style.right="0px";var B=document.createElement("span");x.appendChild(B);this.dependsOnLanguage(mxUtils.bind(this,function(){q.innerHTML="";-mxUtils.write(q,mxResources.get("newLibrary"));k.setAttribute("title",mxResources.get("newLibrary"));B.innerHTML="";mxUtils.write(B,mxResources.get("openLibraryFrom"));x.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=mxSettings.getWindowState("shapes"),f=null!=c&&null!=c.w?c.w:Math.min(this.diagramContainer.parentNode.clientWidth-10,230)--6,k=null!=c&&null!=c.h?c.h:("1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650))-6,q="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,x=null!=c&&null!=c.x?c.x:q&&"1"!=urlParams.embedInline?66:10;q=null!=c&&null!=c.y?c.y:q&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-k)/2):56;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),x,q,f,k,mxUtils.bind(this,function(B){this.createShapesPanel(B)}));+"50%",f.style.right="0px",mxUtils.write(f,mxResources.get("openLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("openLibrary").funct);else{var k=f("newLibrary","");k.style.left="0px";k.style.right="50%";var q=document.createElement("span");k.appendChild(q);var x=f("openLibraryFrom","");x.style.borderLeftWidth="1px";x.style.left="50%";x.style.right="0px";var C=document.createElement("span");x.appendChild(C);this.dependsOnLanguage(mxUtils.bind(this,function(){q.innerHTML="";+mxUtils.write(q,mxResources.get("newLibrary"));k.setAttribute("title",mxResources.get("newLibrary"));C.innerHTML="";mxUtils.write(C,mxResources.get("openLibraryFrom"));x.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=mxSettings.getWindowState("shapes"),f=null!=c&&null!=c.w?c.w:Math.min(this.diagramContainer.parentNode.clientWidth-10,230)-+6,k=null!=c&&null!=c.h?c.h:("1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650))-6,q="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,x=null!=c&&null!=c.x?c.x:q&&"1"!=urlParams.embedInline?66:10;q=null!=c&&null!=c.y?c.y:q&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-k)/2):56;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),x,q,f,k,mxUtils.bind(this,function(C){this.createShapesPanel(C)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.installWindowPersistence("shapes",this.sidebarWindow);null!=c?this.restoreWindowState("shapes",this.sidebarWindow):this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var f=c;"auto"==c&&(f=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(f);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,f){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(f))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=@@ -4430,7 +4433,7 @@ null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TAc,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,f){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&f&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,k=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)f.style.left="10px",f.style.top="10px",k.style.left="10px",k.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var q=this.diagramContainer.getAttribute("data-bounds");if(null!=-q){this.diagramContainer.removeAttribute("data-bounds");var x=q.split(" ");q=mxUtils.getDocumentSize();this.diagramContainer.style.top=x[0];this.diagramContainer.style.left=x[1];var B=parseInt(x[2]);x=parseInt(x[3]);B=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,B):B,q.width-80);x=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,x):x,q.height-80);this.diagramContainer.style.width=B+"px";this.diagramContainer.style.height=x+"px";this.diagramContainer.style.bottom=+q){this.diagramContainer.removeAttribute("data-bounds");var x=q.split(" ");q=mxUtils.getDocumentSize();this.diagramContainer.style.top=x[0];this.diagramContainer.style.left=x[1];var C=parseInt(x[2]);x=parseInt(x[3]);C=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,C):C,q.width-80);x=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,x):x,q.height-80);this.diagramContainer.style.width=C+"px";this.diagramContainer.style.height=x+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}f.style.left=this.diagramContainer.offsetLeft+"px";f.style.top=this.diagramContainer.offsetTop-f.offsetHeight-4+"px";k.style.display="";k.style.left=this.diagramContainer.offsetLeft-k.offsetWidth-4+"px";k.style.top=this.diagramContainer.offsetTop+"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=f.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen||Editor.noResizers?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;q="1"==urlParams.embedInline&&Editor.passiveScroll;f.style.visibility=q?"hidden":"";c.style.visibility=q?"hidden":"";k.style.display=q?"none":""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};@@ -4441,72 +4444,72 @@ urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle();this.restorePersistedEdgeStyle()};EditorUi.prototype.restorePersistedEdgeStyle=function(){var c=this.editor.graph,f="undefined"!==typeof mxSettings&&null!=mxSettings.getCurrentEdgeStyle?mxSettings.getCurrentEdgeStyle():null;null!=f&&(c.currentEdgeStyle=mxUtils.clone(f),"orthogonalEdgeStyle"!=c.defaultEdgeStyle.edgeStyle&&delete c.currentEdgeStyle.libavoidRouting,this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[])))};EditorUi.prototype.getLinkTitle=function(c){var f=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var k=c.indexOf(",");0<k&&(f=this.getPageById(c.substring(k+1)),f=null!=f?f.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,5)&&(f=this.getCustomLinkTitle(c));return f};EditorUi.prototype.getCustomLinkTitle=function(c){var f=mxResources.get("action");if("data:action/json,"==c.substring(0,17))try{var k=JSON.parse(c.substring(17));if(null!=k&&"string"==typeof k.title&&""!=k.title.trim())f=k.title.trim();else if(null!=k&&Array.isArray(k.actions)&&0<k.actions.length){var q=Object.keys(k.actions[0])[0]||-"";if("animation"==q&&null!=k.actions[0].animation&&Array.isArray(k.actions[0].animation.steps)){var x=k.actions[0].animation.steps.length;f=mxResources.get("effects",null,"Effects")+" ("+x+")"}else if(""!=q){var B="undefined"!=typeof CustomActionDialog&&null!=CustomActionDialog?CustomActionDialog.SCHEMAS[q]:null;f=mxResources.get(null!=B&&B.labelKey?B.labelKey:q,null,null!=B?B.label:q)}}}catch(E){}return f};EditorUi.prototype.handleCustomLink=function(c,f){if(Graph.isPageLink(c))if(f=c.indexOf(","),+"";if("animation"==q&&null!=k.actions[0].animation&&Array.isArray(k.actions[0].animation.steps)){var x=k.actions[0].animation.steps.length;f=mxResources.get("effects",null,"Effects")+" ("+x+")"}else if(""!=q){var C="undefined"!=typeof CustomActionDialog&&null!=CustomActionDialog?CustomActionDialog.SCHEMAS[q]:null;f=mxResources.get(null!=C&&C.labelKey?C.labelKey:q,null,null!=C?C.label:q)}}}catch(E){}return f};EditorUi.prototype.handleCustomLink=function(c,f){if(Graph.isPageLink(c))if(f=c.indexOf(","),c=this.getPageById(c.substring(f+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||"Page not found");else this.editor.graph.handleCustomLink(c,f)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(f){f.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(f){}this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(f,k){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(f,k){mxSettings.setPageFormat(c.pageFormat);mxSettings.save()}));c.view.defaultDarkGridColor=mxSettings.getGridColor(!0);c.view.defaultGridColor=mxSettings.getGridColor(!1);c.view.gridColor="light-dark("+c.view.defaultGridColor+", "+c.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(f,k){mxSettings.setGridColor(c.view.defaultGridColor,!1);mxSettings.setGridColor(c.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(f,k){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(f,k){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);-mxSettings.save()});this.addListener("sidebarWidthChanged",function(){mxSettings.setSidebarWidth(this.hsplitPosition);mxSettings.save()});this.addListener("collapsedSectionsChanged",function(){null!=this.format&&(mxSettings.setCollapsedSections(this.format.collapsedSections),mxSettings.save())})}};EditorUi.prototype.writeImageToClipboard=function(c,f,k,q,x,B){q=null!=q?q:"image/png";var E=null==f||null==k?'<img src="'+c+'">':'<img src="'+c+'" width="'+f+'" height="'+k+'">',L={"text/html":new Blob([E],-{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(q)&&(L[q]=this.base64ToBlob(c.substring(c.indexOf(",")+1),q));var Q=new ClipboardItem(L);navigator.clipboard.write([Q]).then(x)["catch"](B);EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",[c],"w",f,"h",k,"type",q,"html",[E],"data",[L],"item",[Q])};EditorUi.prototype.writeHtmlToClipboard=function(c,f){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),+mxSettings.save()});this.addListener("sidebarWidthChanged",function(){mxSettings.setSidebarWidth(this.hsplitPosition);mxSettings.save()});this.addListener("collapsedSectionsChanged",function(){null!=this.format&&(mxSettings.setCollapsedSections(this.format.collapsedSections),mxSettings.save())})}};EditorUi.prototype.writeImageToClipboard=function(c,f,k,q,x,C){q=null!=q?q:"image/png";var E=null==f||null==k?'<img src="'+c+'">':'<img src="'+c+'" width="'+f+'" height="'+k+'">',L={"text/html":new Blob([E],+{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(q)&&(L[q]=this.base64ToBlob(c.substring(c.indexOf(",")+1),q));var Q=new ClipboardItem(L);navigator.clipboard.write([Q]).then(x)["catch"](C);EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",[c],"w",f,"h",k,"type",q,"html",[E],"data",[L],"item",[Q])};EditorUi.prototype.writeHtmlToClipboard=function(c,f){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})])["catch"](f)};EditorUi.prototype.writeTextToClipboard=function(c,f,k){navigator.clipboard.writeText(c).then(function(){null!=k&&k()})["catch"](f)};EditorUi.prototype.copySvg=function(c,f,k){try{if(null!=navigator.clipboard&&"function"===typeof window.ClipboardItem){var q=this.editor.graph.getSvg(null,k,null,null,null,null,null,null,null,null,null,Editor.isDarkMode()?"dark":"light",null,0<c.length?c:null);null!=f&&q.setAttribute("content",f);var x=Editor.createSvgDataUri(mxUtils.getXml(q)),-B=parseInt(q.getAttribute("width")),E=parseInt(q.getAttribute("height"));this.writeImageToClipboard(x,B,E,"image/svg+xml",null,mxUtils.bind(this,function(L){this.handleError(L)}))}}catch(L){this.handleError(L)}};EditorUi.prototype.copyImage=function(c,f,k){try{k=null!=k?k:4,null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(q,x){try{this.spinner.stop();var B=this.createImageDataUri(q,-f,"png"),E=Math.round(parseInt(x.getAttribute("width"))/k),L=Math.round(parseInt(x.getAttribute("height"))/k);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[f],"scale",[k]);this.writeImageToClipboard(B,E,L,"image/png",null,mxUtils.bind(this,function(){if(this.isLocalFileSave()){var Q=this.getBaseFilename(!1)+(null!=f?".drawio":"")+".png";this.saveLocalFile(B.substring(B.lastIndexOf(",")+1),Q,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(Q){this.handleError(Q)}}),+C=parseInt(q.getAttribute("width")),E=parseInt(q.getAttribute("height"));this.writeImageToClipboard(x,C,E,"image/svg+xml",null,mxUtils.bind(this,function(L){this.handleError(L)}))}}catch(L){this.handleError(L)}};EditorUi.prototype.copyImage=function(c,f,k){try{k=null!=k?k:4,null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(q,x){try{this.spinner.stop();var C=this.createImageDataUri(q,+f,"png"),E=Math.round(parseInt(x.getAttribute("width"))/k),L=Math.round(parseInt(x.getAttribute("height"))/k);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[f],"scale",[k]);this.writeImageToClipboard(C,E,L,"image/png",null,mxUtils.bind(this,function(){if(this.isLocalFileSave()){var Q=this.getBaseFilename(!1)+(null!=f?".drawio":"")+".png";this.saveLocalFile(C.substring(C.lastIndexOf(",")+1),Q,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(Q){this.handleError(Q)}}),null,null,null,mxUtils.bind(this,function(q){this.spinner.stop();this.handleError(q)}),null,null,k,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,Editor.isDarkMode()?"dark":"light",null,0<c.length?c:null)}catch(q){this.handleError(q)}};EditorUi.prototype.copyCells=function(c,f){var k=this.editor.graph;if(k.isSelectionEmpty())c.innerText="";else{var q=mxUtils.sortCells(k.model.getTopmostCells(k.getSelectionCells())),x=mxUtils.getXml(k.encodeCells(q));mxUtils.setTextContent(c,encodeURIComponent(x));f?(k.removeCells(q,!1),k.lastPasteXml=null):(k.lastPasteXml=x,k.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=null;if(Editor.enableNativeClipboard){var f=this.editor.graph;f.isSelectionEmpty()||(c=mxUtils.sortCells(f.getExportableCells(f.model.getTopmostCells(f.getSelectionCells()))),f=mxUtils.getXml(f.encodeCells(c)),navigator.clipboard.writeText(f))}return c};EditorUi.prototype.pasteXml=-function(c,f,k,q,x,B){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",[f],"compat",[k],"evt",[q],"html",[x],"pt",[B]);x=null!=x?x:!0;var E=this.editor.graph,L=null!=B?B:Editor.pasteAtMousePointer&&E.isMouseInsertPoint()?E.getInsertPoint():null;B=null;E.lastPasteXml==c?null==L&&E.pasteCounter++:(E.lastPasteXml=c,E.pasteCounter=0);var Q=E.pasteCounter*E.gridSize;if(k||this.isCompatibleString(c)){E.model.beginUpdate();try{if(B=this.importXml(c,Q,Q),null!=L){var V=E.getBoundingBoxFromGeometry(B,-!0);if(null!=V){var K=Math.round(E.snap(L.x)),fa=Math.round(E.snap(L.y));E.cellsMoved(B,K-V.x,fa-V.y)}}}finally{E.model.endUpdate()}E.setSelectionCells(B)}else if(f&&1==E.getSelectionCount()){f=E.getStartEditingCell(E.getSelectionCell(),q);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==E.getCurrentCellStyle(f)[mxConstants.STYLE_SHAPE])E.setCellStyles(mxConstants.STYLE_IMAGE,c,[f]);else{E.model.beginUpdate();try{E.labelChanged(f,c),Graph.isLink(c)&&E.setLinkForCell(f,c)}finally{E.model.endUpdate()}}E.setSelectionCell(f)}else L=-null!=L?L:E.getInsertPoint(),E.isMouseInsertPoint()&&(Q=0,E.lastPasteXml==c&&0<E.pasteCounter&&E.pasteCounter--),B=this.insertTextAt(c,L.x+Q,L.y+Q,x),E.setSelectionCells(B);E.isSelectionEmpty()||(E.scrollCellToVisible(E.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(E.view.getState(E.getSelectionCell())));return B};EditorUi.prototype.pasteCells=function(c,f,k,q){if(!mxEvent.isConsumed(c)){var x=c.clipboardData,B=this.editor.graph,E=!1,L=f;if(k&&null!=x&&x.getData){var Q=x.getData("text/plain"),+function(c,f,k,q,x,C){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",[f],"compat",[k],"evt",[q],"html",[x],"pt",[C]);x=null!=x?x:!0;var E=this.editor.graph,L=null!=C?C:Editor.pasteAtMousePointer&&E.isMouseInsertPoint()?E.getInsertPoint():null;C=null;E.lastPasteXml==c?null==L&&E.pasteCounter++:(E.lastPasteXml=c,E.pasteCounter=0);var Q=E.pasteCounter*E.gridSize;if(k||this.isCompatibleString(c)){E.model.beginUpdate();try{if(C=this.importXml(c,Q,Q),null!=L){var V=E.getBoundingBoxFromGeometry(C,+!0);if(null!=V){var K=Math.round(E.snap(L.x)),fa=Math.round(E.snap(L.y));E.cellsMoved(C,K-V.x,fa-V.y)}}}finally{E.model.endUpdate()}E.setSelectionCells(C)}else if(f&&1==E.getSelectionCount()){f=E.getStartEditingCell(E.getSelectionCell(),q);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==E.getCurrentCellStyle(f)[mxConstants.STYLE_SHAPE])E.setCellStyles(mxConstants.STYLE_IMAGE,c,[f]);else{E.model.beginUpdate();try{E.labelChanged(f,c),Graph.isLink(c)&&E.setLinkForCell(f,c)}finally{E.model.endUpdate()}}E.setSelectionCell(f)}else L=+null!=L?L:E.getInsertPoint(),E.isMouseInsertPoint()&&(Q=0,E.lastPasteXml==c&&0<E.pasteCounter&&E.pasteCounter--),C=this.insertTextAt(c,L.x+Q,L.y+Q,x),E.setSelectionCells(C);E.isSelectionEmpty()||(E.scrollCellToVisible(E.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(E.view.getState(E.getSelectionCell())));return C};EditorUi.prototype.pasteCells=function(c,f,k,q){if(!mxEvent.isConsumed(c)){var x=c.clipboardData,C=this.editor.graph,E=!1,L=f;if(k&&null!=x&&x.getData){var Q=x.getData("text/plain"),V=!1;if(null!=Q&&0<Q.length&&"%3CmxGraphModel%3E"==Q.substring(0,18))try{var K=decodeURIComponent(Q);this.isCompatibleString(K)&&(V=!0,Q=K)}catch(ra){}V=V?null:x.getData("text/html");null!=V&&0<V.length?(L=this.parseHtmlData(V),E="text/plain"!=L.getAttribute("data-type")):null!=Q&&0<Q.length&&(L=document.createElement("div"),mxUtils.setTextContent(L,Q))}Q=L.getElementsByTagName("span");if(null!=Q&&0<Q.length&&"application/vnd.lucid.chart.objects"===Q[0].getAttribute("data-lucid-type"))k=Q[0].getAttribute("data-lucid-content"),null!=k&&0<k.length&&(this.convertLucidChart(k,mxUtils.bind(this,function(ra){var l=this.editor.graph;l.lastPasteXml==ra?l.pasteCounter++:(l.lastPasteXml=ra,l.pasteCounter=0);var t=l.pasteCounter*l.gridSize;l.setSelectionCells(this.importXml(ra,t,t));l.scrollCellToVisible(l.getSelectionCell())}),mxUtils.bind(this,function(ra){this.handleError(ra)})),mxEvent.consume(c));else{var fa=!1,aa="";aa=E?null!=L.textContent&&"<mxfile"==L.textContent.substring(0,7)&&"</mxfile>"==L.textContent.substring(L.textContent.length-9)||"<mxGraphModel"==L.textContent.substring(0,13)&&"</mxGraphModel>"==L.textContent.substring(L.textContent.length-15)?L.textContent.replace(/\u00a0/g," "):L.innerHTML:mxUtils.trim(null==L.innerText?mxUtils.getTextContent(L):L.innerText);try{var da=aa.lastIndexOf("%3E");0<=da&&da<aa.length-3&&(aa=aa.substring(0,da+3))}catch(ra){}try{Q=L.getElementsByTagName("span"),(K=null!=Q&&0<Q.length?mxUtils.trim(decodeURIComponent(Q[0].textContent)):decodeURIComponent(aa))&&(this.isCompatibleString(K)||0==K.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(fa=!0,aa=K)}catch(ra){}K=null;try{if(!fa&&""==L.textContent)for(da=0;da<x.items.length;da++){var ba=x.items[da];if("file"===ba.kind){K=ba.getAsFile();break}}}catch(ra){}EditorUi.debug("EditorUi.pasteCells",[this],"evt",[c],"realElt",[f.outerHTML],"elt",[L.outerHTML],"useEvent",k,"pasteAsLabel",q,"xml",[aa],"compat",fa,"asHtml",E,"data",x,"items",[x.items.length],"files",[x.files.length],"types",[JSON.stringify(x.types)],"blob",[K]);try{if(fa||null==-K)if(null!=aa&&0<aa.length){if(0==aa.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var qa=mxUtils.bind(this,function(){try{aa=(new MiroImporter).importMiroJson(JSON.parse(aa)),this.pasteXml(aa,q,fa,c)}catch(ra){console.log("Miro import error:",ra)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",qa):qa()}else this.pasteXml(aa,q,fa,c,E);mxEvent.consume(c)}else k||(B.lastPasteXml=null,B.pasteCounter=0);else{var ha=B.getInsertPoint();this.importFiles([K],-ha.x,ha.y,this.maxImageSize);mxEvent.consume(c)}}catch(ra){this.handleError(ra)}}}f.innerHTML=" "};EditorUi.prototype.pasteFromClipboard=function(c){var f=this.editor.graph;null==c&&Editor.pasteAtMousePointer&&f.isMouseInsertPoint()&&(c=f.getInsertPoint());if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(k,q,x,B,E){if(null!=k){f.getModel().beginUpdate();try{this.pasteXml(k,!0,null,null,null,c)}finally{f.getModel().endUpdate()}}else k=-null!=q?q:null!=x?x:B,null!=k?(c=null!=c?c:f.getInsertPoint(),this.importFiles([k],c.x,c.y,this.maxImageSize)):this.pasteFromLocalClipboard(c)})):this.pasteFromLocalClipboard(c)}catch(k){}};EditorUi.prototype.pasteFromLocalClipboard=function(c){var f=this.editor.graph;f.getModel().beginUpdate();try{f.moveCellsTo(mxClipboard.paste(f),c)}finally{f.getModel().endUpdate()}};EditorUi.prototype.installImagePasteHandler=function(){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,-function(f){for(var k=null!=f.clipboardData?f.clipboardData:f.originalEvent.clipboardData,q=!1,x=null,B=0;B<k.types.length;B++)if("text/"===k.types[B].substring(0,5)){q=!0;break}for(B=0;B<k.items.length;B++){var E=k.items[B];if("file"===E.kind){x=E.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[f],"data",[k],"items",[k.items.length],"files",[k.files.length],"types",[JSON.stringify(k.types)],"containsText",q,"file",[x],"editing",c.isEditing());var L=mxUtils.bind(this,+K)if(null!=aa&&0<aa.length){if(0==aa.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var qa=mxUtils.bind(this,function(){try{aa=(new MiroImporter).importMiroJson(JSON.parse(aa)),this.pasteXml(aa,q,fa,c)}catch(ra){console.log("Miro import error:",ra)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",qa):qa()}else this.pasteXml(aa,q,fa,c,E);mxEvent.consume(c)}else k||(C.lastPasteXml=null,C.pasteCounter=0);else{var ha=C.getInsertPoint();this.importFiles([K],+ha.x,ha.y,this.maxImageSize);mxEvent.consume(c)}}catch(ra){this.handleError(ra)}}}f.innerHTML=" "};EditorUi.prototype.pasteFromClipboard=function(c){var f=this.editor.graph;null==c&&Editor.pasteAtMousePointer&&f.isMouseInsertPoint()&&(c=f.getInsertPoint());if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(k,q,x,C,E){if(null!=k){f.getModel().beginUpdate();try{this.pasteXml(k,!0,null,null,null,c)}finally{f.getModel().endUpdate()}}else k=+null!=q?q:null!=x?x:C,null!=k?(c=null!=c?c:f.getInsertPoint(),this.importFiles([k],c.x,c.y,this.maxImageSize)):this.pasteFromLocalClipboard(c)})):this.pasteFromLocalClipboard(c)}catch(k){}};EditorUi.prototype.pasteFromLocalClipboard=function(c){var f=this.editor.graph;f.getModel().beginUpdate();try{f.moveCellsTo(mxClipboard.paste(f),c)}finally{f.getModel().endUpdate()}};EditorUi.prototype.installImagePasteHandler=function(){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,+function(f){for(var k=null!=f.clipboardData?f.clipboardData:f.originalEvent.clipboardData,q=!1,x=null,C=0;C<k.types.length;C++)if("text/"===k.types[C].substring(0,5)){q=!0;break}for(C=0;C<k.items.length;C++){var E=k.items[C];if("file"===E.kind){x=E.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[f],"data",[k],"items",[k.items.length],"files",[k.files.length],"types",[JSON.stringify(k.types)],"containsText",q,"file",[x],"editing",c.isEditing());var L=mxUtils.bind(this,function(){try{if(!q&&null!=x){if(c.isEditing())this.importFiles([x],0,0,this.maxImageSize,function(V,K,fa,aa,da,ba){c.insertImage(V,da,ba)},function(){},function(V){return"image/"==V.type.substring(0,6)},function(V){for(var K=0;K<V.length;K++)V[K]()});else{var Q=this.editor.graph.getInsertPoint();this.importFiles([x],Q.x,Q.y,this.maxImageSize)}mxEvent.consume(f)}}catch(V){}});if(!mxEvent.isConsumed(f)&&!q)if(Editor.enableNativeClipboard)navigator.clipboard.read().then(mxUtils.bind(this,function(Q){this.readTypeFromClipboardData(Q,"image/svg+xml",mxUtils.bind(this,function(V){if(null!=V){V=new Blob([V],{type:"image/svg+xml"});var K=this.editor.graph.getInsertPoint();this.importFiles([V],K.x,K.y,this.maxImageSize)}else L()}),"image")}))["catch"](L);else L()}),!1)};EditorUi.prototype.readGraphModelFromClipboard=function(c){navigator.clipboard.read().then(mxUtils.bind(this,function(f){try{EditorUi.debug("EditorUi.readGraphModelFromClipboard",[this],"data",f,"types",null!=f&&0<f.length?[JSON.stringify(f[0].types)]:[]),this.readGraphModelFromHtmlClipboardData(f,-mxUtils.bind(this,function(k,q){null!=k?c(k):this.readGraphModelFromImageClipboardData(f,mxUtils.bind(this,function(x,B,E){null!=x?c(x):this.readTypeFromClipboardData(f,"text/plain",mxUtils.bind(this,function(L){c(L,B,E,q,f)}))}))}))}catch(k){c(null)}}))["catch"](function(){c(null)})};EditorUi.prototype.readGraphModelFromHtmlClipboardData=function(c,f){this.readTypeFromClipboardData(c,"text/html",mxUtils.bind(this,function(k){var q=null,x=null;try{var B=this.parseHtmlData(k);if(null!=B){q="text/plain"!=-B.getAttribute("data-type")?B.innerHTML:mxUtils.trim(null==B.innerText?mxUtils.getTextContent(B):B.innerText);try{var E=q.lastIndexOf("%3E");0<=E&&E<q.length-3&&(q=q.substring(0,E+3))}catch(V){}try{null==q&&(k=null,""==B.textContent&&1==B.children.length&&"IMG"==B.firstChild.nodeName&&(k=B.firstChild.getAttribute("src")),null!=k&&0<k.length&&("data:image/png;base64,"==k.substring(0,22)?x=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==k.substring(0,26)&&-(x=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/svg+xml"))))}catch(V){}try{var L=B.getElementsByTagName("span"),Q=null!=L&&0<L.length?mxUtils.trim(decodeURIComponent(L[0].textContent)):decodeURIComponent(q);this.isCompatibleString(Q)&&(q=Q)}catch(V){}}}catch(V){}f(this.isCompatibleString(q)?q:null,x)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,f){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(k,q){var x=null;try{null!=k&&(x=mxUtils.parseXml(k).documentElement.getAttribute("content"))}catch(B){}this.isCompatibleString(x)?-f(x):this.readTypeFromClipboardData(c,"image/png",mxUtils.bind(this,function(B,E){x=Editor.extractGraphModelFromPng("data:image/png;base64,"+B);this.isCompatibleString(x)?f(x):f(null,q,E)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,f,k){var q=!1;if(null!=c&&0<c.length)for(var x=0;x<c.length&&!q;x++)(function(B){0<=mxUtils.indexOf(B.types,f)&&(q=!0,B.getType(f).then(mxUtils.bind(this,function(E){if("image/png"==f)E.arrayBuffer().then(function(L){k(btoa(Graph.arrayBufferToString(L)),+mxUtils.bind(this,function(k,q){null!=k?c(k):this.readGraphModelFromImageClipboardData(f,mxUtils.bind(this,function(x,C,E){null!=x?c(x):this.readTypeFromClipboardData(f,"text/plain",mxUtils.bind(this,function(L){c(L,C,E,q,f)}))}))}))}catch(k){c(null)}}))["catch"](function(){c(null)})};EditorUi.prototype.readGraphModelFromHtmlClipboardData=function(c,f){this.readTypeFromClipboardData(c,"text/html",mxUtils.bind(this,function(k){var q=null,x=null;try{var C=this.parseHtmlData(k);if(null!=C){q="text/plain"!=+C.getAttribute("data-type")?C.innerHTML:mxUtils.trim(null==C.innerText?mxUtils.getTextContent(C):C.innerText);try{var E=q.lastIndexOf("%3E");0<=E&&E<q.length-3&&(q=q.substring(0,E+3))}catch(V){}try{null==q&&(k=null,""==C.textContent&&1==C.children.length&&"IMG"==C.firstChild.nodeName&&(k=C.firstChild.getAttribute("src")),null!=k&&0<k.length&&("data:image/png;base64,"==k.substring(0,22)?x=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==k.substring(0,26)&&+(x=this.base64ToBlob(k.substring(k.indexOf(",")+1),"image/svg+xml"))))}catch(V){}try{var L=C.getElementsByTagName("span"),Q=null!=L&&0<L.length?mxUtils.trim(decodeURIComponent(L[0].textContent)):decodeURIComponent(q);this.isCompatibleString(Q)&&(q=Q)}catch(V){}}}catch(V){}f(this.isCompatibleString(q)?q:null,x)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,f){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(k,q){var x=null;try{null!=k&&(x=mxUtils.parseXml(k).documentElement.getAttribute("content"))}catch(C){}this.isCompatibleString(x)?+f(x):this.readTypeFromClipboardData(c,"image/png",mxUtils.bind(this,function(C,E){x=Editor.extractGraphModelFromPng("data:image/png;base64,"+C);this.isCompatibleString(x)?f(x):f(null,q,E)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,f,k){var q=!1;if(null!=c&&0<c.length)for(var x=0;x<c.length&&!q;x++)(function(C){0<=mxUtils.indexOf(C.types,f)&&(q=!0,C.getType(f).then(mxUtils.bind(this,function(E){if("image/png"==f)E.arrayBuffer().then(function(L){k(btoa(Graph.arrayBufferToString(L)),E)})["catch"](function(){k(null)});else E.text().then(mxUtils.bind(this,function(L){EditorUi.debug("EditorUi.readTypeFromClipboardData",[this],"data",[c],"type",[f],"result",[L]);k(L,E)}))["catch"](function(){k(null)})}))["catch"](function(){k(null)}))})(c[x]);q||k()};EditorUi.prototype.parseHtmlData=function(c){var f=null;if(null!=c&&0<c.length){var k="<meta "==c.substring(0,6);f=document.createElement("div");f.innerHTML=(k?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(c);asHtml=!0;k=f.getElementsByTagName("style");if(null!=k)for(;0<k.length;)k[0].parentNode.removeChild(k[0]);if(null!=f.firstChild&&f.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=f.firstChild.nextSibling&&f.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==f.firstChild.nodeName&&"A"==f.firstChild.nextSibling.nodeName&&null==f.firstChild.nextSibling.nextSibling){var q=null==f.firstChild.nextSibling.innerText?mxUtils.getTextContent(f.firstChild.nextSibling):f.firstChild.nextSibling.innerText;q==f.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(f,q),asHtml=!1)}if(""==f.textContent&&(k=f.getElementsByTagName("img"),1==k.length&&(q=k[0].getAttribute("src"),k=null,null!=q))){if(Editor.isPngDataUrl(q)){var x=Editor.extractGraphModelFromPng(q);null!=x&&0<x.length&&(k=x)}else if("data:image/svg+xml;base64,"==q.substring(0,26)){img=this.base64ToBlob(q.substring(q.indexOf(",")+1),"image/svg+xml");q=Graph.getSvgFromDataUri(q);try{x=mxUtils.parseXml(q).documentElement.getAttribute("content"),this.isCompatibleString(x)&&(k=-x)}catch(B){}}null!=k&&(mxUtils.setTextContent(f,k),asHtml=!1)}asHtml?Graph.removePasteFormatting(f):f.setAttribute("data-type","text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[f],"asHtml",asHtml);return f};EditorUi.prototype.showPrintDialog=function(c,f,k){this.showDialog((new PrintDialog(this,c,f,k)).container,360,null,!0,!0)};EditorUi.prototype.print=function(c,f){var k=this.editor,q=k.graph,x=this.getPageIndex(this.currentPage),B=null!=x?x+1:1,E=mxUtils.bind(this,-function(ra,l,t,H){var J=ra.useCssTransforms,R=ra.currentTranslate,T=ra.currentScale,Y=ra.view.translate,Z=ra.view.scale;ra.useCssTransforms&&(ra.useCssTransforms=!1,ra.currentTranslate=new mxPoint(0,0),ra.currentScale=1,ra.view.translate=new mxPoint(0,0),ra.view.scale=1);var ia=ra.getGraphBounds(),ka=0,X=0,ja=mxRectangle.fromRectangle(ra.pageFormat),na=f.fit||f.crop||!ra.pageVisible,la=f.scale;ja.width*=ra.pageScale;ja.height*=ra.pageScale;var va=1;if(f.fit){va=f.sheetsAcross;var za=f.sheetsDown;-isNaN(la)||(ja.width=Math.ceil(ja.width*la),ja.height=Math.ceil(ja.height*la));va=Math.min(ja.height*za/(ia.height/ra.view.scale),ja.width*va/(ia.width/ra.view.scale))}else va=isNaN(la)?1:la;va*=1;!na&&ra.pageVisible?(la=ra.getPageLayout(),ka-=la.x*ja.width,X-=la.y*ja.height):na=!0;f.crop&&(f.selection&&(ia=q.getBoundingBox(q.getSelectionCells())),ja.width=(ia.width+1)*va/ra.view.scale,ja.height=(ia.height+1)*va/ra.view.scale);ja.width*=1;ja.height*=1;H=null!=H?"page/id,"+H:null;if(null==l){l=PrintDialog.createPrintPreview(ra,-va,null,0,ka,X,na);l.title=this.getBaseFilename(!0);l.pageSelector=!1;l.mathEnabled=!1;ka=f.border;isNaN(ka)||(l.pageMargin=ka);var sa=l.writeHead;l.writeHead=function(Fa,Ha){Ha=null!=Ha?Ha:"";f.shadows||(Ha+='g[style*="filter: drop-shadow("] {\n filter: none !important;{\n}\n');mxClient.IS_GC&&(Ha+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");null!=k.fontCss&&(Ha+=k.fontCss);sa.apply(this,arguments);for(var Na=ra.getCustomFonts(),La=0;La<Na.length;La++){var Da=Na[La].name,+x)}catch(C){}}null!=k&&(mxUtils.setTextContent(f,k),asHtml=!1)}asHtml?Graph.removePasteFormatting(f):f.setAttribute("data-type","text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[f],"asHtml",asHtml);return f};EditorUi.prototype.showPrintDialog=function(c,f,k){this.showDialog((new PrintDialog(this,c,f,k)).container,360,null,!0,!0)};EditorUi.prototype.print=function(c,f){var k=this.editor,q=k.graph,x=this.getPageIndex(this.currentPage),C=null!=x?x+1:1,E=mxUtils.bind(this,+function(ra,l,t,H){var J=ra.useCssTransforms,R=ra.currentTranslate,T=ra.currentScale,Y=ra.view.translate,Z=ra.view.scale;ra.useCssTransforms&&(ra.useCssTransforms=!1,ra.currentTranslate=new mxPoint(0,0),ra.currentScale=1,ra.view.translate=new mxPoint(0,0),ra.view.scale=1);var ia=ra.getGraphBounds(),ja=0,X=0,ka=mxRectangle.fromRectangle(ra.pageFormat),na=f.fit||f.crop||!ra.pageVisible,la=f.scale;ka.width*=ra.pageScale;ka.height*=ra.pageScale;var ua=1;if(f.fit){ua=f.sheetsAcross;var za=f.sheetsDown;+isNaN(la)||(ka.width=Math.ceil(ka.width*la),ka.height=Math.ceil(ka.height*la));ua=Math.min(ka.height*za/(ia.height/ra.view.scale),ka.width*ua/(ia.width/ra.view.scale))}else ua=isNaN(la)?1:la;ua*=1;!na&&ra.pageVisible?(la=ra.getPageLayout(),ja-=la.x*ka.width,X-=la.y*ka.height):na=!0;f.crop&&(f.selection&&(ia=q.getBoundingBox(q.getSelectionCells())),ka.width=(ia.width+1)*ua/ra.view.scale,ka.height=(ia.height+1)*ua/ra.view.scale);ka.width*=1;ka.height*=1;H=null!=H?"page/id,"+H:null;if(null==l){l=PrintDialog.createPrintPreview(ra,+ua,null,0,ja,X,na);l.title=this.getBaseFilename(!0);l.pageSelector=!1;l.mathEnabled=!1;ja=f.border;isNaN(ja)||(l.pageMargin=ja);var sa=l.writeHead;l.writeHead=function(Fa,Ha){Ha=null!=Ha?Ha:"";f.shadows||(Ha+='g[style*="filter: drop-shadow("] {\n filter: none !important;{\n}\n');mxClient.IS_GC&&(Ha+="@media print {\n .MathJax svg { shape-rendering: crispEdges; }\n}\n");null!=k.fontCss&&(Ha+=k.fontCss);sa.apply(this,arguments);for(var Na=ra.getCustomFonts(),La=0;La<Na.length;La++){var Da=Na[La].name,Sa=Na[La].url;Graph.isCssFontUrl(Sa)?Fa.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(Sa))+'" charset="UTF-8" type="text/css">'):(Fa.writeln('<style type="text/css">'),Fa.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(Da)+'";\nsrc: url("'+mxUtils.htmlEntities(Sa)+'");\n}'),Fa.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var wa=l.drawBackgroundImage;l.drawBackgroundImage=function(Fa){wa.apply(this,arguments);null!=Fa.node&&(EditorUi.embedSvgImages(Fa.node),q.disableSvgLinks(Fa.node,function(Ha){Ha.setAttribute("href","javascript:void(0)")}))}}var Ca=l.addGraphFragment;l.addGraphFragment=function(Fa,Ha,Na,La,Da,Sa){Ca.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:Da.classList.add("geDisableMathJax");if(this.graph.shadowVisible)for(var Oa=Da.getElementsByTagName("svg"),Ta=0;Ta<Oa.length;Ta++)ra.addSvgShadow(Oa[Ta])};f.grid&&(l.gridSize=ra.gridSize,l.gridSteps=ra.view.gridSteps,l.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:-ra.view.gridColor);l.isCellVisible=f.selection?function(Fa){return ra.isCellSelected(Fa)&&ra.isCellVisible(Fa)}:function(Fa){return ra.isCellVisible(Fa)};l.open(null,null,t,!0,H,ja,f.selection?ra.getSelectionCells():null)}else{ia=ra.background;if(null==ia||""==ia||ia==mxConstants.NONE)ia="#ffffff";l.backgroundColor=ia;l.autoOrigin=na;f.grid&&(l.gridSize=ra.gridSize,l.gridSteps=ra.view.gridSteps,l.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:ra.view.gridColor);l.isCellVisible=-f.selection?function(Fa){return ra.isCellSelected(Fa)&&ra.isCellVisible(Fa)}:function(Fa){return ra.isCellVisible(Fa)};l.appendGraph(ra,va,ka,X,t,!0,H,ja,f.selection?ra.getSelectionCells():null);t=ra.getCustomFonts();if(null!=l.wnd)for(ja=0;ja<t.length;ja++)ka=t[ja].name,X=t[ja].url,Graph.isCssFontUrl(X)?l.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(X)+'" charset="UTF-8" type="text/css">'):(l.wnd.document.writeln('<style type="text/css">'),l.wnd.document.writeln('@font-face {\nfont-family: "'+-mxUtils.htmlEntities(ka)+'";\nsrc: url("'+mxUtils.htmlEntities(X)+'");\n}'),l.wnd.document.writeln("</style>"))}J&&(ra.useCssTransforms=J,ra.currentTranslate=R,ra.currentScale=T,ra.view.translate=Y,ra.view.scale=Z);return l}),L=f.pagesFrom,Q=f.pagesTo,V=!f.allPages;x=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{V&&(V=f.selection||L==B&&Q==B);if(!V&&null!=this.pages&&this.pages.length){V=0;B=this.pages.length-1;f.allPages||(V=parseInt(L)-1,B=parseInt(Q)-1);for(var K=V;K<=B;K++){var fa=+ra.view.gridColor);l.isCellVisible=f.selection?function(Fa){return ra.isCellSelected(Fa)&&ra.isCellVisible(Fa)}:function(Fa){return ra.isCellVisible(Fa)};l.open(null,null,t,!0,H,ka,f.selection?ra.getSelectionCells():null)}else{ia=ra.background;if(null==ia||""==ia||ia==mxConstants.NONE)ia="#ffffff";l.backgroundColor=ia;l.autoOrigin=na;f.grid&&(l.gridSize=ra.gridSize,l.gridSteps=ra.view.gridSteps,l.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:ra.view.gridColor);l.isCellVisible=+f.selection?function(Fa){return ra.isCellSelected(Fa)&&ra.isCellVisible(Fa)}:function(Fa){return ra.isCellVisible(Fa)};l.appendGraph(ra,ua,ja,X,t,!0,H,ka,f.selection?ra.getSelectionCells():null);t=ra.getCustomFonts();if(null!=l.wnd)for(ka=0;ka<t.length;ka++)ja=t[ka].name,X=t[ka].url,Graph.isCssFontUrl(X)?l.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(X)+'" charset="UTF-8" type="text/css">'):(l.wnd.document.writeln('<style type="text/css">'),l.wnd.document.writeln('@font-face {\nfont-family: "'++mxUtils.htmlEntities(ja)+'";\nsrc: url("'+mxUtils.htmlEntities(X)+'");\n}'),l.wnd.document.writeln("</style>"))}J&&(ra.useCssTransforms=J,ra.currentTranslate=R,ra.currentScale=T,ra.view.translate=Y,ra.view.scale=Z);return l}),L=f.pagesFrom,Q=f.pagesTo,V=!f.allPages;x=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{V&&(V=f.selection||L==C&&Q==C);if(!V&&null!=this.pages&&this.pages.length){V=0;C=this.pages.length-1;f.allPages||(V=parseInt(L)-1,C=parseInt(Q)-1);for(var K=V;K<=C;K++){var fa=this.pages[K];L=fa==this.currentPage?q:null;if(null==L){L=this.createTemporaryGraph(q.stylesheet);L.shapeForegroundColor=q.shapeForegroundColor;L.shapeBackgroundColor=q.shapeBackgroundColor;Q=!0;var aa=V=!1,da=null,ba=null;null==fa.viewState&&null==fa.root&&this.updatePageRoot(fa);null!=fa.viewState&&(Q=fa.viewState.pageVisible,V=fa.viewState.mathEnabled,aa=fa.viewState.shadowVisible,da=fa.viewState.background,ba=fa.viewState.backgroundImage,L.pageFormat=fa.viewState.pageFormat,L.gridSize=fa.viewState.gridSize,L.hiddenTags=fa.viewState.hiddenTags||[]);null!=ba&&null!=ba.originalSrc&&(ba=this.createImageForPageLink(ba.originalSrc,fa));L.background=da;L.backgroundImage=null!=ba?new mxImage(ba.src,ba.width,ba.height,ba.x,ba.y):null;L.pageVisible=Q;L.mathEnabled=V;L.shadowVisible=aa;var ha=L.getGraphBounds;L.getGraphBounds=function(){var ra=ha.apply(this,arguments),l=this.backgroundImage;if(null!=l&&null!=l.width&&null!=l.height){var t=this.view.translate,H=this.view.scale;ra=mxRectangle.fromRectangle(ra);-ra.add(new mxRectangle((t.x+l.x)*H,(t.y+l.y)*H,l.width*H,l.height*H))}return ra};var qa=L.getGlobalVariable;L.getGlobalVariable=function(ra){return"page"==ra?fa.getName():"pagenumber"==ra?K+1:"pagecount"==ra?null!=this.pages?this.pages.length:1:qa.apply(this,arguments)};document.body.appendChild(L.container);this.updatePageRoot(fa);L.model.setRoot(fa.root)}x=E(L,x,K!=B,fa.getId());L!=q&&L.container.parentNode.removeChild(L.container)}}else x=E(q);if(null==x||null==x.wnd)this.handleError({message:mxResources.get("errorUpdatingPreview")});+ra.add(new mxRectangle((t.x+l.x)*H,(t.y+l.y)*H,l.width*H,l.height*H))}return ra};var qa=L.getGlobalVariable;L.getGlobalVariable=function(ra){return"page"==ra?fa.getName():"pagenumber"==ra?K+1:"pagecount"==ra?null!=this.pages?this.pages.length:1:qa.apply(this,arguments)};document.body.appendChild(L.container);this.updatePageRoot(fa);L.model.setRoot(fa.root)}x=E(L,x,K!=C,fa.getId());L!=q&&L.container.parentNode.removeChild(L.container)}}else x=E(q);if(null==x||null==x.wnd)this.handleError({message:mxResources.get("errorUpdatingPreview")});else{x.mathEnabled&&(E=x.wnd.document,c||(x.wnd.IMMEDIATE_PRINT=!0),E.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>'));x.closeDocument();if(Editor.expandPatternsForPrint&&null!=x.wnd)for(E=x.wnd.document.getElementsByTagName("svg"),K=0;K<E.length;K++)Editor.expandSvgPatterns(E[K]);Graph.rewritePageLinks(x.wnd.document,!0);x.mathEnabled||c||PrintDialog.printPreview(x)}return x}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var f=null,k=0;k<c.length;k++)mxEvent.addListener(c[k],"dragleave",function(q){null!=f&&(f.parentNode.removeChild(f),f=null);q.stopPropagation();q.preventDefault()}),mxEvent.addListener(c[k],"dragover",mxUtils.bind(this,function(q){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==f&&(f=this.highlightElement());q.stopPropagation();q.preventDefault()})),mxEvent.addListener(c[k],"drop",mxUtils.bind(this,function(q){null!=f&&(f.parentNode.removeChild(f),f=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<-q.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(q.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(q)&&!mxEvent.isShiftDown(q)):this.openFiles(q.dataTransfer.files,!0);else{var x=this.extractGraphModelFromEvent(q);if(null==x){var B=null!=q.dataTransfer?q.dataTransfer:q.clipboardData;null!=B&&(10==document.documentMode||11==document.documentMode?x=B.getData("Text"):(x=null,x=0<=mxUtils.indexOf(B.types,"text/uri-list")?q.dataTransfer.getData("text/uri-list"):-0<=mxUtils.indexOf(B.types,"text/html")?B.getData("text/html"):null,null!=x&&0<x.length?(B=document.createElement("div"),B.innerHTML=Graph.sanitizeHtml(x),B=B.getElementsByTagName("img"),0<B.length&&(x=B[0].getAttribute("src"))):0<=mxUtils.indexOf(B.types,"text/plain")&&(x=B.getData("text/plain"))),null!=x&&(Editor.isPngDataUrl(x)?(x=Editor.extractGraphModelFromPng(x),null!=x&&0<x.length&&this.openLocalFile(x,null,!0)):this.isRemoteFileFormat(x)?this.isOffline()?this.showError(mxResources.get("error"),+q.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(q.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(q)&&!mxEvent.isShiftDown(q)):this.openFiles(q.dataTransfer.files,!0);else{var x=this.extractGraphModelFromEvent(q);if(null==x){var C=null!=q.dataTransfer?q.dataTransfer:q.clipboardData;null!=C&&(10==document.documentMode||11==document.documentMode?x=C.getData("Text"):(x=null,x=0<=mxUtils.indexOf(C.types,"text/uri-list")?q.dataTransfer.getData("text/uri-list"):+0<=mxUtils.indexOf(C.types,"text/html")?C.getData("text/html"):null,null!=x&&0<x.length?(C=document.createElement("div"),C.innerHTML=Graph.sanitizeHtml(x),C=C.getElementsByTagName("img"),0<C.length&&(x=C[0].getAttribute("src"))):0<=mxUtils.indexOf(C.types,"text/plain")&&(x=C.getData("text/plain"))),null!=x&&(Editor.isPngDataUrl(x)?(x=Editor.extractGraphModelFromPng(x),null!=x&&0<x.length&&this.openLocalFile(x,null,!0)):this.isRemoteFileFormat(x)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(x))).send(mxUtils.bind(this,function(E){200<=E.getStatus()&&299>=E.getStatus()?this.openLocalFile(E.getText(),null,!0):this.showError(mxResources.get("error"),413==E.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(x)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(x):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+-"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(x)))))}else this.openLocalFile(x,null,!0)}q.stopPropagation();q.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var f=0,k=0;if(null==c){var q=document.body;var x=document.documentElement;if(null==q&&null==x)return null;var B=((null!=q?q.clientWidth:0)||x.clientWidth)-3;q=Math.max(null!=q?q.clientHeight:0,x.clientHeight)-3}else q=c.getBoundingClientRect(),f=q.top,k=q.left,B=q.width,q=q.height;x=document.createElement("div");-x.style.zIndex=mxPopupMenu.prototype.zIndex+2;x.style.border="3px dotted rgb(254, 137, 12)";x.style.pointerEvents="none";x.style.position="absolute";x.style.top=f+"px";x.style.left=k+"px";x.style.width=Math.max(0,B-3)+"px";x.style.height=Math.max(0,q-3)+"px";if(null!=c&&c.parentNode==this.editor.graph.container)this.editor.graph.container.appendChild(x);else if(null!=document.body)document.body.appendChild(x);else return null;return x};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);-var f=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=f){var k=new mxCodec(f.ownerDocument),q=new mxGraphModel;k.decode(f,q);f=q.getChildAt(q.getRoot(),0);for(k=0;k<q.getChildCount(f);k++)c.push(q.getChildAt(f,k))}return c};EditorUi.prototype.openFileHandle=function(c,f,k,q,x,B,E){if(null!=f&&0<f.length){if(!Editor.useCanvasForExport&&/(\.png)$/i.test(f)||/(\.pdf)$/i.test(f))f=f.substring(0,f.length-4),/(\.drawio)$/i.test(f)||(f+=".drawio");var L=mxUtils.bind(this,function(V){f=0<=+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(x)))))}else this.openLocalFile(x,null,!0)}q.stopPropagation();q.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var f=0,k=0;if(null==c){var q=document.body;var x=document.documentElement;if(null==q&&null==x)return null;var C=((null!=q?q.clientWidth:0)||x.clientWidth)-3;q=Math.max(null!=q?q.clientHeight:0,x.clientHeight)-3}else q=c.getBoundingClientRect(),f=q.top,k=q.left,C=q.width,q=q.height;x=document.createElement("div");+x.style.zIndex=mxPopupMenu.prototype.zIndex+2;x.style.border="3px dotted rgb(254, 137, 12)";x.style.pointerEvents="none";x.style.position="absolute";x.style.top=f+"px";x.style.left=k+"px";x.style.width=Math.max(0,C-3)+"px";x.style.height=Math.max(0,q-3)+"px";if(null!=c&&c.parentNode==this.editor.graph.container)this.editor.graph.container.appendChild(x);else if(null!=document.body)document.body.appendChild(x);else return null;return x};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);+var f=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=f){var k=new mxCodec(f.ownerDocument),q=new mxGraphModel;k.decode(f,q);f=q.getChildAt(q.getRoot(),0);for(k=0;k<q.getChildCount(f);k++)c.push(q.getChildAt(f,k))}return c};EditorUi.prototype.openFileHandle=function(c,f,k,q,x,C,E){if(null!=f&&0<f.length){if(!Editor.useCanvasForExport&&/(\.png)$/i.test(f)||/(\.pdf)$/i.test(f))f=f.substring(0,f.length-4),/(\.drawio)$/i.test(f)||(f+=".drawio");var L=mxUtils.bind(this,function(V){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".drawio":f+".drawio";if("<mxlibrary"==V.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,q);try{this.loadLibrary(new LocalLibrary(this,V,f)),this.showSidebar()}catch(K){this.handleError(K,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(V,f,q,null,null,null,E)});if(EditorUi.isVisioFilename(f))this.importVisio(k,mxUtils.bind(this,function(V){this.spinner.stop();L(V)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(V){this.spinner.stop();L(V)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,f))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(k,mxUtils.bind(this,function(V){4==V.readyState&&(this.spinner.stop(),200<=V.status&&299>=V.status?L(V.responseText):this.handleError({message:mxResources.get(413==V.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(V){this.spinner.stop();this.openLocalFile(V,f,q,null,null,null,E)}),mxUtils.bind(this,function(V){this.spinner.stop();this.handleError(V)}));else if("<mxlibrary"==c.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,q);try{this.loadLibrary(new LocalLibrary(this,c,k.name)),this.showSidebar()}catch(V){this.handleError(V,mxResources.get("errorLoadingFile"))}}else if(0==c.indexOf("PK"))this.importZipFile(k,mxUtils.bind(this,function(V){this.spinner.stop();L(V)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,f,q,null,null,null,E)}));else{if("image/png"==k.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==k.type){var Q=Editor.extractGraphModelFromPdf(c);-null!=Q&&(x=null,q=!0,c=Q)}this.spinner.stop();this.openLocalFile(c,f,q,x,null!=x?k:null,B,E)}}};EditorUi.prototype.openFiles=function(c,f,k){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=0;q<c.length;q++)mxUtils.bind(this,function(x){var B=new FileReader;B.onload=mxUtils.bind(this,function(E){try{this.openFileHandle(E.target.result,x.name,x,f,null,null,k)}catch(L){this.handleError(L)}});B.onerror=mxUtils.bind(this,function(E){this.spinner.stop();this.handleError(E);window.openFile=-null});"image"!==x.type.substring(0,5)&&"application/pdf"!==x.type||"image/svg"===x.type.substring(0,9)?B.readAsText(x):B.readAsDataURL(x)})(c[q])};EditorUi.prototype.openLocalFile=function(c,f,k,q,x,B,E){var L=this.getCurrentFile(),Q=mxUtils.bind(this,function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var K=mxUtils.parseXml(c);null!=K&&(this.editor.setGraphXml(K.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,-f||this.defaultFilename,k,q,x,B));null!=E&&E()});if(null!=c&&0<c.length)if(null==L||!L.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=q||this.isDiagramEmpty()))Q();else if((mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=L&&L.isModified())this.confirm(mxResources.get("allChangesLost"),null,Q,mxResources.get("cancel"),mxResources.get("discardChanges"));else{window.openFile=new OpenFile(function(){window.openFile=null});window.openFile.setData(c,f,k);var V=mxUtils.bind(this,+null!=Q&&(x=null,q=!0,c=Q)}this.spinner.stop();this.openLocalFile(c,f,q,x,null!=x?k:null,C,E)}}};EditorUi.prototype.openFiles=function(c,f,k){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=0;q<c.length;q++)mxUtils.bind(this,function(x){var C=new FileReader;C.onload=mxUtils.bind(this,function(E){try{this.openFileHandle(E.target.result,x.name,x,f,null,null,k)}catch(L){this.handleError(L)}});C.onerror=mxUtils.bind(this,function(E){this.spinner.stop();this.handleError(E);window.openFile=+null});"image"!==x.type.substring(0,5)&&"application/pdf"!==x.type||"image/svg"===x.type.substring(0,9)?C.readAsText(x):C.readAsDataURL(x)})(c[q])};EditorUi.prototype.openLocalFile=function(c,f,k,q,x,C,E){var L=this.getCurrentFile(),Q=mxUtils.bind(this,function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var K=mxUtils.parseXml(c);null!=K&&(this.editor.setGraphXml(K.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,+f||this.defaultFilename,k,q,x,C));null!=E&&E()});if(null!=c&&0<c.length)if(null==L||!L.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=q||this.isDiagramEmpty()))Q();else if((mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=L&&L.isModified())this.confirm(mxResources.get("allChangesLost"),null,Q,mxResources.get("cancel"),mxResources.get("discardChanges"));else{window.openFile=new OpenFile(function(){window.openFile=null});window.openFile.setData(c,f,k);var V=mxUtils.bind(this,function(){null!=L&&L.isModified()?this.confirm(mxResources.get("allChangesLost"),null,Q,mxResources.get("cancel"),mxResources.get("discardChanges")):Q()});"1"==urlParams.openInSameWin||navigator.standalone?V():this.showDialog((new PopupDialog(this,this.getUrl(),null,V)).container,340,140,!0,!0)}else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)this.updatePageRoot(this.pages[f]),this.addBasenamesForCell(this.pages[f].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);f=[];for(var k in c)f.push(k);return f};EditorUi.prototype.addBasenamesForCell=function(c,f){function k(E){if(null!=E){var L=E.lastIndexOf(".");0<L&&(E=E.substring(L+1,E.length));null==f[E]&&(f[E]=!0)}}var q=this.editor.graph,x=q.getCellStyle(c);k(mxStencilRegistry.getBasenameForStencil(x[mxConstants.STYLE_SHAPE]));q.model.isEdge(c)&&(k(mxMarker.getPackageForType(x[mxConstants.STYLE_STARTARROW])),k(mxMarker.getPackageForType(x[mxConstants.STYLE_ENDARROW])));-x=q.model.getChildCount(c);for(var B=0;B<x;B++)this.addBasenamesForCell(q.model.getChildAt(c,B),f)};EditorUi.prototype.setGraphEnabled=function(c){this.diagramContainer.style.visibility=c?"":"hidden";this.formatContainer.style.visibility=this.diagramContainer.style.visibility;this.sidebarContainer.style.display=c?"":"none";this.hsplit.style.display=this.sidebarContainer.style.display;this.editor.graph.setEnabled(c);null!=this.tabContainer&&(this.tabContainer.style.visibility=this.diagramContainer.style.visibility);-c||this.hideWindows();this.editor.graph.sizeDidChange();this.resetScrollbars()};EditorUi.prototype.fitInitialView=function(c){var f=this.editor.graph,k=this.currentPage;k=null!=k?k.getViewBox():null;var q=f.container;if(null!=k&&0<q.clientWidth&&0<q.clientHeight){c=q.clientWidth;var x=q.clientHeight,B=Math.min(c/k.width,x/k.height);f.zoomTo(null!=k.scale?Math.min(k.scale,B):B,null,null,mxUtils.hasScrollbars(q));mxUtils.hasScrollbars(q)&&(B=f.view.translate,f=f.view.scale,q.scrollLeft=(k.x+k.width/-2+B.x)*f-c/2,q.scrollTop=(k.y+k.height/2+B.y)*f-x/2)}else this.initialFitDiagram(c)};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((this.embedMessageSource||window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))){var c=!1;this.installMessageHandler(mxUtils.bind(this,function(f,k,q,x){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;-this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);Editor.fitDiagramOnLoad&&this.fitInitialView();if(x)try{var B=this.editor.graph;B.setGridEnabled(!1);B.pageVisible=!1;var E=B.model.cells,L;for(L in E){var Q=E[L];null!=Q&&null!=Q.style&&(Q.style+=";sketch=1;"+(-1==Q.style.indexOf("fontFamily=")||-1<Q.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":+x=q.model.getChildCount(c);for(var C=0;C<x;C++)this.addBasenamesForCell(q.model.getChildAt(c,C),f)};EditorUi.prototype.setGraphEnabled=function(c){this.diagramContainer.style.visibility=c?"":"hidden";this.formatContainer.style.visibility=this.diagramContainer.style.visibility;this.sidebarContainer.style.display=c?"":"none";this.hsplit.style.display=this.sidebarContainer.style.display;this.editor.graph.setEnabled(c);null!=this.tabContainer&&(this.tabContainer.style.visibility=this.diagramContainer.style.visibility);+c||this.hideWindows();this.editor.graph.sizeDidChange();this.resetScrollbars()};EditorUi.prototype.fitInitialView=function(c){var f=this.editor.graph,k=this.currentPage;k=null!=k?k.getViewBox():null;var q=f.container;if(null!=k&&0<q.clientWidth&&0<q.clientHeight){c=q.clientWidth;var x=q.clientHeight,C=Math.min(c/k.width,x/k.height);f.zoomTo(null!=k.scale?Math.min(k.scale,C):C,null,null,mxUtils.hasScrollbars(q));mxUtils.hasScrollbars(q)&&(C=f.view.translate,f=f.view.scale,q.scrollLeft=(k.x+k.width/+2+C.x)*f-c/2,q.scrollTop=(k.y+k.height/2+C.y)*f-x/2)}else this.initialFitDiagram(c)};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((this.embedMessageSource||window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))){var c=!1;this.installMessageHandler(mxUtils.bind(this,function(f,k,q,x){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;+this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);Editor.fitDiagramOnLoad&&this.fitInitialView();if(x)try{var C=this.editor.graph;C.setGridEnabled(!1);C.pageVisible=!1;var E=C.model.cells,L;for(L in E){var Q=E[L];null!=Q&&null!=Q.style&&(Q.style+=";sketch=1;"+(-1==Q.style.indexOf("fontFamily=")||-1<Q.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(V){console.log(V)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=q?q:!1;this.updateUi();window.self===window.top||this.noAutoFocus||window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(c,f){null!=c?this.spinner.spin(document.body,mxResources.get("loading"))&&c.getPublicUrl(mxUtils.bind(this,function(k){this.spinner.stop();f(k)})):f(null)};EditorUi.prototype.createLoadMessage=function(c){var f=this.editor.graph,k=f.getGraphBounds(),q=f.view.scale,x=f.view.translate;return{event:c,pageVisible:f.pageVisible,translate:x,bounds:k,currentPage:this.getSelectedPageIndex(),scale:q,page:f.view.getBackgroundPageBounds(),modelBounds:{x:k.x/q-x.x,y:k.y/q-x.y,width:k.width/q,height:k.height/q},containerSize:{width:f.container.clientWidth,height:f.container.clientHeight,offsetWidth:f.container.offsetWidth,offsetHeight:f.container.offsetHeight}}};EditorUi.prototype.sendEmbeddedSvgExport=function(c){try{var f=this.editor.graph;f.isEditing()&&f.stopEditing(!f.isInvokesStopCellEditing());var k=this.embedMessageSource||window.opener||window.parent;@@ -4514,15 +4517,15 @@ if(this.editor.modified){var q=f.background;if(null==q||q==mxConstants.NONE)q=th"*");c||(this.diagramContainer.removeAttribute("data-bounds"),Editor.inlineFullscreen=!1,f.model.clear(),this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(x){c||this.handleError(x)}};EditorUi.prototype.whenScriptReady=function(c,f,k){if(c())f();else var q=0,x=window.setInterval(function(){c()?(window.clearInterval(x),f()):100<=++q&&(window.clearInterval(x),null!=k&&k())},100)};EditorUi.prototype.lastLayoutSpec=null;EditorUi.prototype.resolveLayoutList=function(c){if("string"===typeof c){c=mxUtils.trim(c);if("["==c.charAt(0))return JSON.parse(c);if("undefined"===typeof LibavoidRouting||c!==LibavoidRouting.SHORTHAND&&c!==LibavoidRouting.LAYOUT_NAME){if("parallels"===c)return[{layout:"mxParallelEdgeLayout",config:{checkOverlap:!0}}];if("undefined"!==typeof ElkLayout&&null!=ElkLayout.MENU_PRESETS&&null!=ElkLayout.MENU_PRESETS[c]){c=ElkLayout.MENU_PRESETS[c];var f="layered"===c.algorithm?ElkLayout.CANONICAL_EDGE:{corners:(ElkLayout.CANONICAL_EDGE||{}).corners};return[{layout:Graph.elkLayoutNameForAlgorithm(c.algorithm),config:Graph.elkOptionsToConfig(c.options,f)}]}}else return[{layout:LibavoidRouting.LAYOUT_NAME}];return null}return"object"===typeof c?c:null};EditorUi.prototype.getSelectedLayoutContainer=function(){var c=this.editor.graph,f=1==c.getSelectionCount()?c.getSelectionCell():null;return null!=f&&c.model.isVertex(f)&&(c=c.getCellStyle(f).childLayout,null!=c&&"tableLayout"!=c&&"stackLayout"!=c&&-"rack"!=c)?f:null};EditorUi.prototype.setContainerChildLayout=function(c,f){var k=this.editor.graph,q=f,x=null,B=null;if("string"!==typeof f){if(!Array.isArray(f)||0==f.length)throw Error("Invalid layout list: "+JSON.stringify(f));q=[];for(var E=0;E<f.length;E++){var L=f[E];if(null!=L&&("mxRadialTreeLayout"==L.layout||"mxOrgChartLayout"==L.layout||"mxFastOrganicLayout"==L.layout||"mxCircleLayout"==L.layout))throw Error("Not supported as childLayout: "+L.layout);if(null!=L&&null!=Graph.elkLayoutAlgorithms[L.layout]){var Q=-{},V;for(V in L.config)Q[V]=L.config[V];delete Q.rootCellIds;null==Q.resizeNodes&&(Q.resizeNodes=!1);null==Q.resizeLayoutRoot&&(Q.resizeLayoutRoot=!0);"elkLayered"==L.layout&&null==Q.extractIsolated&&(Q.extractIsolated=!1);null!=Q.corners&&(B=Q.corners);if(null!=Q.groupPadding&&(x=String(Q.groupPadding),/[;=]/.test(x)))throw Error("Invalid groupPadding: "+x);L={layout:L.layout,config:Q}}q.push(L)}k.createLayouts(q);q=Graph.encodeChildLayout(q)}if(0<=q.indexOf(";"))throw Error("Invalid childLayout: "+-q);k.model.beginUpdate();try{var K=k.model.getStyle(c);k.setCellStyles("childLayout",q,[c]);null!=x&&k.setCellStyles("groupPadding",x,[c]);null!=B&&"undefined"!==typeof ElkLayout&&"function"===typeof ElkLayout.applyCorners&&ElkLayout.applyCorners(k,c,B);k.model.getStyle(c)==K&&null!=k.layoutManager&&k.layoutManager.executeLayout(c,!1)}finally{k.model.endUpdate()}};EditorUi.prototype.executeLayoutSpec=function(c,f,k){var q=this;this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout&&-null!=ElkLayout.MENU_PRESETS},function(){try{var x=q.resolveLayoutList(c);if(null!=x){q.lastLayoutSpec=x;var B=k?q.getSelectedLayoutContainer():null;null!=B&&Array.isArray(x)&&0<x.length?(q.setContainerChildLayout(B,x),null!=f&&f()):q.executeLayouts(q.editor.graph.createLayouts(x),f)}else q.handleError(Error("Unknown layout: "+c))}catch(E){q.handleError(E)}},function(){q.handleError(Error(mxResources.get("serviceUnavailableOrBlocked")))})};EditorUi.prototype.installPassThroughKeys=function(){null!=-Editor.passThroughKeys&&null==this.passThroughKeysListener&&(this.passThroughKeysListener=mxUtils.bind(this,function(c){for(var f=Editor.passThroughKeys,k=c.ctrlKey||c.metaKey,q=null!=c.key?c.key.toLowerCase():"",x=0;x<f.length;x++){var B=f[x];if(q===String(B.key).toLowerCase()&&k===!!B.ctrl&&c.shiftKey===!!B.shift&&c.altKey===!!B.alt){c.preventDefault();c.stopImmediatePropagation();null!=B.command&&(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"shortcut",-command:B.command}),"*");break}}}),window.addEventListener("keydown",this.passThroughKeysListener,!0))};EditorUi.keyNames={8:"Backspace",9:"Tab",13:"Enter",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",109:"-",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",187:"+",189:"-"};EditorUi.prototype.installKeyboardShortcuts=function(){if(null!=Editor.keyboardShortcuts)for(var c=+"rack"!=c)?f:null};EditorUi.prototype.setContainerChildLayout=function(c,f){var k=this.editor.graph,q=f,x=null,C=null;if("string"!==typeof f){if(!Array.isArray(f)||0==f.length)throw Error("Invalid layout list: "+JSON.stringify(f));q=[];for(var E=0;E<f.length;E++){var L=f[E];if(null!=L&&("mxRadialTreeLayout"==L.layout||"mxOrgChartLayout"==L.layout||"mxFastOrganicLayout"==L.layout||"mxCircleLayout"==L.layout))throw Error("Not supported as childLayout: "+L.layout);if(null!=L&&null!=Graph.elkLayoutAlgorithms[L.layout]){var Q=+{},V;for(V in L.config)Q[V]=L.config[V];delete Q.rootCellIds;null==Q.resizeNodes&&(Q.resizeNodes=!1);null==Q.resizeLayoutRoot&&(Q.resizeLayoutRoot=!0);"elkLayered"==L.layout&&null==Q.extractIsolated&&(Q.extractIsolated=!1);null!=Q.corners&&(C=Q.corners);if(null!=Q.groupPadding&&(x=String(Q.groupPadding),/[;=]/.test(x)))throw Error("Invalid groupPadding: "+x);L={layout:L.layout,config:Q}}q.push(L)}k.createLayouts(q);q=Graph.encodeChildLayout(q)}if(0<=q.indexOf(";"))throw Error("Invalid childLayout: "++q);k.model.beginUpdate();try{var K=k.model.getStyle(c);k.setCellStyles("childLayout",q,[c]);null!=x&&k.setCellStyles("groupPadding",x,[c]);null!=C&&"undefined"!==typeof ElkLayout&&"function"===typeof ElkLayout.applyCorners&&ElkLayout.applyCorners(k,c,C);k.model.getStyle(c)==K&&null!=k.layoutManager&&k.layoutManager.executeLayout(c,!1)}finally{k.model.endUpdate()}};EditorUi.prototype.executeLayoutSpec=function(c,f,k){var q=this;this.whenScriptReady(function(){return"undefined"!==typeof ElkLayout&&+null!=ElkLayout.MENU_PRESETS},function(){try{var x=q.resolveLayoutList(c);if(null!=x){q.lastLayoutSpec=x;var C=k?q.getSelectedLayoutContainer():null;null!=C&&Array.isArray(x)&&0<x.length?(q.setContainerChildLayout(C,x),null!=f&&f()):q.executeLayouts(q.editor.graph.createLayouts(x),f)}else q.handleError(Error("Unknown layout: "+c))}catch(E){q.handleError(E)}},function(){q.handleError(Error(mxResources.get("serviceUnavailableOrBlocked")))})};EditorUi.prototype.installPassThroughKeys=function(){null!=+Editor.passThroughKeys&&null==this.passThroughKeysListener&&(this.passThroughKeysListener=mxUtils.bind(this,function(c){for(var f=Editor.passThroughKeys,k=c.ctrlKey||c.metaKey,q=null!=c.key?c.key.toLowerCase():"",x=0;x<f.length;x++){var C=f[x];if(q===String(C.key).toLowerCase()&&k===!!C.ctrl&&c.shiftKey===!!C.shift&&c.altKey===!!C.alt){c.preventDefault();c.stopImmediatePropagation();null!=C.command&&(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify({event:"shortcut",+command:C.command}),"*");break}}}),window.addEventListener("keydown",this.passThroughKeysListener,!0))};EditorUi.keyNames={8:"Backspace",9:"Tab",13:"Enter",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",109:"-",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",187:"+",189:"-"};EditorUi.prototype.installKeyboardShortcuts=function(){if(null!=Editor.keyboardShortcuts)for(var c=0;c<Editor.keyboardShortcuts.length;c++)this.installKeyboardShortcut(Editor.keyboardShortcuts[c])};EditorUi.prototype.installKeyboardShortcut=function(c){var f="string"===typeof c.keyCode&&1==c.keyCode.length,k=f?c.keyCode.toUpperCase().charCodeAt(0):parseInt(c.keyCode);if(isNaN(k))EditorUi.debug("Configuration Error: Invalid keyCode for keyboardShortcuts",c);else{if(c.alt){var q=c.control?c.shift?this.ctrlAltShiftActions:this.ctrlAltActions:c.shift?this.altShiftActions:this.altActions;null!=c.action?q[k]=c.action:delete q[k]}else null!=c.action?(q=mxUtils.bind(this,function(){var x=this.actions.get(c.action);null!=x&&x.isEnabled()&&x.funct.apply(this,arguments)}),c.control?c.shift?this.keyHandler.bindControlShiftKey(k,q):this.keyHandler.bindControlKey(k,q):c.shift?this.keyHandler.bindShiftKey(k,q):this.keyHandler.bindKey(k,q)):delete (c.control?c.shift?this.keyHandler.controlShiftKeys:this.keyHandler.controlKeys:c.shift?this.keyHandler.shiftKeys:this.keyHandler.normalKeys)[k];null!=c.action&&-(q=this.actions.get(c.action),f=f?c.keyCode.toUpperCase():48<=k&&57>=k||65<=k&&90>=k?String.fromCharCode(k):EditorUi.keyNames[k],null!=q&&null!=f&&(q.shortcut=(c.control?Editor.ctrlKey+"+":"")+(c.alt?Editor.altKey+"+":"")+(c.shift?Editor.shiftKey+"+":"")+f))}};EditorUi.prototype.installMessageHandler=function(c){var f=null,k=!1,q=!1,x=null,B=null;this.installPassThroughKeys();var E=mxUtils.bind(this,function(V,K){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,+(q=this.actions.get(c.action),f=f?c.keyCode.toUpperCase():48<=k&&57>=k||65<=k&&90>=k?String.fromCharCode(k):EditorUi.keyNames[k],null!=q&&null!=f&&(q.shortcut=(c.control?Editor.ctrlKey+"+":"")+(c.alt?Editor.altKey+"+":"")+(c.shift?Editor.shiftKey+"+":"")+f))}};EditorUi.prototype.installMessageHandler=function(c){var f=null,k=!1,q=!1,x=null,C=null;this.installPassThroughKeys();var E=mxUtils.bind(this,function(V,K){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,E);mxEvent.addListener(window,"message",mxUtils.bind(this,function(V){if(V.source==(this.embedMessageSource||window.opener||window.parent)){var K=V.data,fa=null,aa=null,da=mxUtils.bind(this,function(ya){if(null!=ya&&"function"===typeof ya.charAt&&"<"!=ya.charAt(0))try{Editor.isPngDataUrl(ya)?ya=Editor.extractGraphModelFromPng(ya):"data:image/svg+xml;base64,"==ya.substring(0,26)?ya=atob(ya.substring(26)):"data:image/svg+xml;utf8,"==ya.substring(0,24)&&(ya=ya.substring(24)),null!=ya&&(""==ya.trim()?ya=null:"%"==ya.charAt(0)?ya=decodeURIComponent(ya):"<"!=ya.charAt(0)&&(ya=Graph.decompress(ya)))}catch(Ra){}return ya});if("json"==urlParams.proto){var ba=!1;try{K=JSON.parse(K),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[V],"data",[K])}catch(ya){K=null}try{var ha=K;if(null==K)return;if("dialog"==K.action){this.showError(null!=K.titleKey?mxResources.get(K.titleKey):K.title,null!=K.messageKey?mxResources.get(K.messageKey):mxUtils.htmlEntities(K.message),null!=K.buttonKey?mxResources.get(K.buttonKey):K.button);null!=K.modified&&(this.editor.modified=K.modified);return}if("layout"==K.action){this.executeLayoutSpec(K.layouts);return}if("prompt"==K.action){this.spinner.stop();var qa=new FilenameDialog(this,K.defaultValue||"",null!=K.okKey?mxResources.get(K.okKey):K.ok,function(ya){null!=ya?L.postMessage(JSON.stringify({event:"prompt",value:ya,message:K}),"*"):L.postMessage(JSON.stringify({event:"prompt-cancel",@@ -4533,13 +4536,13 @@ this.clearStatus())}),null,null,null,null,null,null,null,l?mxUtils.bind(this,funnull,null,ya,function(){ya({},0)})}):null,1==K.withoutType,null,K.templatesOnly);this.showDialog(qa.container,620,460,!0,!1,mxUtils.bind(this,function(ya){null!=this.sidebar&&this.sidebar.hideTooltip();ya&&!K.noExitOnCancel&&this.actions.get("exit").funct()}));qa.init();return}if("textContent"==K.action){var J=this.getDiagramTextContent();L.postMessage(JSON.stringify({event:"textContent",data:J,message:K}),"*");return}if("status"==K.action){this.updateStatus(mxUtils.bind(this,function(){null!=K.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(K.messageKey))):null!=K.message&&this.editor.setStatus(mxUtils.htmlEntities(K.message))}));null!=K.modified&&(this.editor.modified=K.modified);return}if("spinner"==K.action){var R=null!=K.messageKey?mxResources.get(K.messageKey):K.message;null==K.show||K.show?this.spinner.spin(document.body,R):this.spinner.stop();return}if("exit"==K.action){this.actions.get("exit").funct();return}if("viewport"==K.action){if(null!=K.viewport){var T=this.editor.graph,Y=T.view.translate.x,Z=T.view.translate.y;this.embedViewport=K.viewport;T.refresh();this.diagramContainer.scrollTop-=(Z-T.view.translate.y)*T.view.scale;this.diagramContainer.scrollLeft-=(Y-T.view.translate.x)*T.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("invokeAction"==K.action){var ia=this.actions.get(K.actionName);null!=ia&&ia.funct();return}if("resetEditor"==K.action){T=this.editor.graph;T.isEditing()&&T.stopEditing(!1);this.hideCurrentMenu();T.popupMenuHandler.hideMenu();-T.clearSelection();return}if("fit"==K.action){T=this.editor.graph;var ka=T.maxFitScale;T.maxFitScale=null!=K.maxScale?K.maxScale:1;T.fit(null!=K.border?K.border:16,null,null,null,null,!0);T.maxFitScale=ka;R=this.createLoadMessage("fit");R.message=K;L.postMessage(JSON.stringify(R),"*");return}if("fullscreenChanged"==K.action){var X=null;try{var ja=this.diagramContainer.getAttribute("data-scrollState");null!=ja&&(this.diagramContainer.removeAttribute("data-scrollState"),X=JSON.parse(ja))}catch(ya){}Editor.inlineFullscreen=+T.clearSelection();return}if("fit"==K.action){T=this.editor.graph;var ja=T.maxFitScale;T.maxFitScale=null!=K.maxScale?K.maxScale:1;T.fit(null!=K.border?K.border:16,null,null,null,null,!0);T.maxFitScale=ja;R=this.createLoadMessage("fit");R.message=K;L.postMessage(JSON.stringify(R),"*");return}if("fullscreenChanged"==K.action){var X=null;try{var ka=this.diagramContainer.getAttribute("data-scrollState");null!=ka&&(this.diagramContainer.removeAttribute("data-scrollState"),X=JSON.parse(ka))}catch(ya){}Editor.inlineFullscreen=K.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=X&&this.restoreScrollState(X);return}if("snapshot"==K.action){this.sendEmbeddedSvgExport(!0);return}if("export"==K.action){if("png"==K.format||"xmlpng"==K.format){if(null==K.spin&&null==K.spinKey||this.spinner.spin(document.body,null!=K.spinKey?mxResources.get(K.spinKey):K.spin)){var na=null!=K.xml?K.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);T=this.editor.graph;var la=mxUtils.bind(this,function(ya,Ra){if(K.withSvg)K.withSvg=-!1,this.getEmbeddedSvg(na,this.editor.graph,null,!0,function(lb){la(ya,lb)},null,null,K.embedImages,this.editor.graph.background,K.scale,K.border,K.shadow,"auto",null,K.embedFonts);else{this.editor.graph.setEnabled(!0);this.spinner.stop();var Ya=this.createLoadMessage("export");Ya.format=K.format;Ya.message=ha;Ya.data=ya;Ya.svg=Ra;Ya.xml=na;L.postMessage(JSON.stringify(Ya),"*")}}),va=mxUtils.bind(this,function(ya){null==ya&&(ya=Editor.blankImage);"xmlpng"==K.format&&(ya=Editor.writeGraphModelToPng(ya,+!1,this.getEmbeddedSvg(na,this.editor.graph,null,!0,function(lb){la(ya,lb)},null,null,K.embedImages,this.editor.graph.background,K.scale,K.border,K.shadow,"auto",null,K.embedFonts);else{this.editor.graph.setEnabled(!0);this.spinner.stop();var Ya=this.createLoadMessage("export");Ya.format=K.format;Ya.message=ha;Ya.data=ya;Ya.svg=Ra;Ya.xml=na;L.postMessage(JSON.stringify(Ya),"*")}}),ua=mxUtils.bind(this,function(ya){null==ya&&(ya=Editor.blankImage);"xmlpng"==K.format&&(ya=Editor.writeGraphModelToPng(ya,"tEXt","mxfile",encodeURIComponent(na)));T!=this.editor.graph&&T.container.parentNode.removeChild(T.container);la(ya)}),za=K.pageId||(null!=this.pages?K.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var sa=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=za){var ya=T.getGlobalVariable;T=this.createTemporaryGraph(T.getStylesheet());for(var Ra,Ya=0;Ya<this.pages.length;Ya++)if(this.pages[Ya].getId()==za){Ra=this.updatePageRoot(this.pages[Ya]);break}null==Ra&&(Ra=this.currentPage);T.getGlobalVariable=function(jb){return"page"==jb?Ra.getName():"pagenumber"==jb?1:ya.apply(this,arguments)};document.body.appendChild(T.container);T.model.setRoot(Ra.root)}if(null!=K.layerIds){var lb=T.model,ub=lb.getChildCells(lb.getRoot()),gb={};for(Ya=0;Ya<K.layerIds.length;Ya++)gb[K.layerIds[Ya]]=!0;for(Ya=0;Ya<ub.length;Ya++)lb.setVisible(ub[Ya],gb[ub[Ya].id]||!1)}Ya=null;K.keepTheme&&(Ya=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,-function(jb){va(jb.toDataURL("image/png"))}),K.width,null,K.background,mxUtils.bind(this,function(){va(null)}),null,null,K.scale,K.transparent,K.shadow,null,T,K.border,null,K.grid,Ya,K.size)});null!=K.xml&&0<K.xml.length&&(k=!0,this.setFileData(na),k=!1);sa()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==K.format?"1":"0")+(null!=za?"&pageId="+za:"")+(null!=K.layerIds&&0<K.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:K.layerIds})):"")+(null!=K.scale?"&scale="+-K.scale:"")+"&base64=1&xml="+encodeURIComponent(na))).send(mxUtils.bind(this,function(ya){200<=ya.getStatus()&&299>=ya.getStatus()?la("data:image/png;base64,"+ya.getText()):va(null)}),mxUtils.bind(this,function(){va(null)}))}}else if(sa=mxUtils.bind(this,function(){var ya=this.createLoadMessage("export");ya.message=K;if("html2"==K.format||"html"==K.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var Ra=this.getXmlFileData();ya.xml=mxUtils.getXml(Ra);ya.data=this.getFileData(null,+function(jb){ua(jb.toDataURL("image/png"))}),K.width,null,K.background,mxUtils.bind(this,function(){ua(null)}),null,null,K.scale,K.transparent,K.shadow,null,T,K.border,null,K.grid,Ya,K.size)});null!=K.xml&&0<K.xml.length&&(k=!0,this.setFileData(na),k=!1);sa()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==K.format?"1":"0")+(null!=za?"&pageId="+za:"")+(null!=K.layerIds&&0<K.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:K.layerIds})):"")+(null!=K.scale?"&scale="++K.scale:"")+"&base64=1&xml="+encodeURIComponent(na))).send(mxUtils.bind(this,function(ya){200<=ya.getStatus()&&299>=ya.getStatus()?la("data:image/png;base64,"+ya.getText()):ua(null)}),mxUtils.bind(this,function(){ua(null)}))}}else if(sa=mxUtils.bind(this,function(){var ya=this.createLoadMessage("export");ya.message=K;if("html2"==K.format||"html"==K.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var Ra=this.getXmlFileData();ya.xml=mxUtils.getXml(Ra);ya.data=this.getFileData(null,null,!0,null,null,null,Ra);ya.format=K.format}else if("html"==K.format)Ra=this.editor.getGraphXml(),ya.data=this.getHtml(Ra,this.editor.graph),ya.xml=mxUtils.getXml(Ra),ya.format=K.format;else{if("xml"==K.format)ya.xml=this.getFileData(!0),ya.format=K.format,L.postMessage(JSON.stringify(ya),"*");else if("json"==K.format)ya.format=K.format,ya.data=this.createJsonForExport(0!=K.allPages,1==K.includeData,1==K.compressed,1==K.selection),L.postMessage(JSON.stringify(ya),"*");else{mxSvgCanvas2D.prototype.foAltText=null;Ra=null!=K.background?K.background:this.editor.graph.background;Ra==mxConstants.NONE&&(Ra=null);ya.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);ya.format="svg";var Ya=mxUtils.bind(this,function(gb){this.editor.graph.setEnabled(!0);this.spinner.stop();ya.data=K.asText?gb:Editor.createSvgDataUri(gb);L.postMessage(JSON.stringify(ya),"*")}),lb="auto";K.keepTheme&&(lb=Editor.isDarkMode()?"dark":"light");null!=K.theme&&(lb=K.theme);if("xmlsvg"==K.format){if(null==K.spin&&null==K.spinKey||this.spinner.spin(document.body,null!=K.spinKey?mxResources.get(K.spinKey):K.spin)){lb=null;if(this.isAutoDarkMode()||Editor.isDarkMode())lb="auto";null!=K.theme&&(lb=K.theme);this.getEmbeddedSvg(ya.xml,this.editor.graph,null,!0,Ya,null,null,K.embedImages,Ra,K.scale,K.border,K.shadow,lb,K.embedCellMetadata,K.embedFonts)}}else if(null==K.spin&&null==K.spinKey||this.spinner.spin(document.body,null!=K.spinKey?mxResources.get(K.spinKey):K.spin)){this.editor.graph.setEnabled(!1);var ub=K.embedCellMetadata?@@ -4554,12 +4557,12 @@ Math.max(this.minInlineWidth,Ba):Ba,ya.width-80);ya=Math.min(null!=this.minInlinYa}Ra.maxFitScale=ya;Ra.container.scrollTop-=La;Ra.container.scrollLeft-=La;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[K]));Ra.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=Ra.container.style.top);var lb=Ra.getGraphBounds();Ra.container.clientWidth>lb.width+2*La&&(Ra.container.scrollLeft=lb.x+(lb.width+La-Ra.container.clientWidth)/2)}),10)})}null!=K.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=K.noExitBtn);null!=K.title&&null!=this.buttonContainer&&this.setEmbedTitle(K.title);try{K.libs&&this.sidebar.showEntries(K.libs)}catch(ya){}if(null!=K.xmlpng)K=this.extractGraphModelFromPng(K.xmlpng);else if(null!=K.descriptor){if(K=K.descriptor,"mermaid"==K.format){if(EditorUi.isMermaidSupported()){var ab=mxUtils.bind(this,function(ya){c(ya,V,null,ba);ya=this.createLoadMessage("load");ya.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!0);ya.message=ha;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(ya),"*");if(null!=Ca&&null!=Ca.key&&null!=Ca.value){ya=this.editor.graph;var Ra=ya.getModel().getRoot();if(null!=Ra){ya.getModel().beginUpdate();try{ya.setAttributeForCell(Ra,Ca.key,Ca.value)}finally{ya.getModel().endUpdate()}}}}),Qa=mxUtils.bind(this,function(ya){this.handleError(ya)});K.image?this.parseMermaidImage(K.data,ab,Qa):this.parseMermaidDiagram(K.data,null,-mxUtils.bind(this,function(ya){K.wrap&&(ya=mxMermaidToDrawio.wrapGroup(ya,K.data,null,{normalize:!0}));ab(ya)}),Qa)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else K=K.xml}else{if("merge"==K.action){var db=this.getCurrentFile();null!=db&&(ra=da(K.xml),null!=ra&&""!=ra&&db.mergeFile(new LocalFile(this,ra),mxUtils.bind(this,function(){this.embedDiffSync&&(B=this.clonePages(this.pages),x=nb());L.postMessage(JSON.stringify({event:"merge",-message:K}),"*")}),function(ya){L.postMessage(JSON.stringify({event:"merge",message:K,error:ya}),"*")}))}else if("patch"==K.action){if(db=this.getCurrentFile(),null!=db&&null!=K.patch)try{k=!0,db.patch([K.patch]),this.embedDiffSync&&null!=B&&(B=this.applyPatches(B,[K.patch])),x=nb(),k=!1,ja={event:"patch",message:K},X=this.getHashValueForPages(this.pages),ja.checksum=X,null!=K.checksum&&K.checksum!=X&&(ja.checksumMismatch=!0),L.postMessage(JSON.stringify(ja),"*")}catch(ya){k=!1,L.postMessage(JSON.stringify({event:"patch",-message:K,error:ya.message||ya.toString()}),"*")}}else if("getDiff"==K.action){R={event:"getDiff",message:K};if(this.embedDiffSync&&null!=B){var Va=this.clonePages(this.pages);R.patch=this.diffPages(B,Va);R.checksum=this.getHashValueForPages(Va)}else R.xml=nb();L.postMessage(JSON.stringify(R),"*")}else"resetDiff"==K.action?this.embedDiffSync&&(null!=K.xml?(ra=da(K.xml),db=this.getCurrentFile(),null!=ra&&""!=ra&&null!=db&&db.mergeFile(new LocalFile(this,ra),mxUtils.bind(this,function(){B=this.clonePages(this.pages);-x=nb();L.postMessage(JSON.stringify({event:"resetDiff",message:K,checksum:this.getHashValueForPages(this.pages)}),"*")}),function(ya){L.postMessage(JSON.stringify({event:"resetDiff",message:K,error:ya}),"*")})):(B=this.clonePages(this.pages),x=nb(),L.postMessage(JSON.stringify({event:"resetDiff",message:K,checksum:this.getHashValueForPages(this.pages)}),"*"))):"remoteInvokeReady"==K.action?this.handleRemoteInvokeReady(L):"remoteInvoke"==K.action?this.handleRemoteInvoke(K,V.origin):"remoteInvokeResponse"==+mxUtils.bind(this,function(ya){K.wrap&&(ya=mxMermaidToDrawio.wrapGroup(ya,K.data,null,{normalize:!0}));ab(ya)}),Qa)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));return}}else K=K.xml}else{if("merge"==K.action){var db=this.getCurrentFile();null!=db&&(ra=da(K.xml),null!=ra&&""!=ra&&db.mergeFile(new LocalFile(this,ra),mxUtils.bind(this,function(){this.embedDiffSync&&(C=this.clonePages(this.pages),x=nb());L.postMessage(JSON.stringify({event:"merge",+message:K}),"*")}),function(ya){L.postMessage(JSON.stringify({event:"merge",message:K,error:ya}),"*")}))}else if("patch"==K.action){if(db=this.getCurrentFile(),null!=db&&null!=K.patch)try{k=!0,db.patch([K.patch]),this.embedDiffSync&&null!=C&&(C=this.applyPatches(C,[K.patch])),x=nb(),k=!1,ka={event:"patch",message:K},X=this.getHashValueForPages(this.pages),ka.checksum=X,null!=K.checksum&&K.checksum!=X&&(ka.checksumMismatch=!0),L.postMessage(JSON.stringify(ka),"*")}catch(ya){k=!1,L.postMessage(JSON.stringify({event:"patch",+message:K,error:ya.message||ya.toString()}),"*")}}else if("getDiff"==K.action){R={event:"getDiff",message:K};if(this.embedDiffSync&&null!=C){var Va=this.clonePages(this.pages);R.patch=this.diffPages(C,Va);R.checksum=this.getHashValueForPages(Va)}else R.xml=nb();L.postMessage(JSON.stringify(R),"*")}else"resetDiff"==K.action?this.embedDiffSync&&(null!=K.xml?(ra=da(K.xml),db=this.getCurrentFile(),null!=ra&&""!=ra&&null!=db&&db.mergeFile(new LocalFile(this,ra),mxUtils.bind(this,function(){C=this.clonePages(this.pages);+x=nb();L.postMessage(JSON.stringify({event:"resetDiff",message:K,checksum:this.getHashValueForPages(this.pages)}),"*")}),function(ya){L.postMessage(JSON.stringify({event:"resetDiff",message:K,error:ya}),"*")})):(C=this.clonePages(this.pages),x=nb(),L.postMessage(JSON.stringify({event:"resetDiff",message:K,checksum:this.getHashValueForPages(this.pages)}),"*"))):"remoteInvokeReady"==K.action?this.handleRemoteInvokeReady(L):"remoteInvoke"==K.action?this.handleRemoteInvoke(K,V.origin):"remoteInvokeResponse"==K.action?this.handleRemoteInvokeResponse(K):L.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(K)}),"*");return}}catch(ya){this.handleError(ya)}}var nb=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),bb=mxUtils.bind(this,function(ya,Ra){k=!0;try{c(ya,Ra,null,ba)}catch(Ya){this.handleError(Ya)}k=!1;this.editor.graph.model.prefix=Editor.guid()+"-";Ra=mxUtils.bind(this,-function(){null!=urlParams.modified&&this.clearStatus();x=nb();this.embedDiffSync&&(B=this.clonePages(this.pages));q&&null==f&&(f=mxUtils.bind(this,function(lb,ub){lb=nb();if(lb!=x&&!k){ub=this.createLoadMessage("autosave");ub.message=ha;if(this.embedDiffSync&&null!=B){var gb=this.clonePages(this.pages),jb=this.diffPages(B,gb);mxUtils.isEmptyObject(jb)?ub.xml=lb:(ub.patch=jb,ub.checksum=this.getHashValueForPages(gb),this.embedDiffSyncPatchOnly||(ub.xml=lb));B=gb}else ub.xml=lb;(this.embedMessageSource||+function(){null!=urlParams.modified&&this.clearStatus();x=nb();this.embedDiffSync&&(C=this.clonePages(this.pages));q&&null==f&&(f=mxUtils.bind(this,function(lb,ub){lb=nb();if(lb!=x&&!k){ub=this.createLoadMessage("autosave");ub.message=ha;if(this.embedDiffSync&&null!=C){var gb=this.clonePages(this.pages),jb=this.diffPages(C,gb);mxUtils.isEmptyObject(jb)?ub.xml=lb:(ub.patch=jb,ub.checksum=this.getHashValueForPages(gb),this.embedDiffSyncPatchOnly||(ub.xml=lb));C=gb}else ub.xml=lb;(this.embedMessageSource||window.opener||window.parent).postMessage(JSON.stringify(ub),"*")}x=lb}),this.editor.graph.model.addListener(mxEvent.CHANGE,f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",f),this.addListener("backgroundImageChanged",f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",f),this.addListener("guidesEnabledChanged",f),this.addListener("pageViewChanged",f));null!=fa&&fa();if("1"==urlParams.returnbounds||"json"==urlParams.proto){var Ya=this.createLoadMessage("load");Ya.xml=null!=aa?nb():ya;this.embedDiffSync&&null!=this.pages&&(Ya.checksum=this.getHashValueForPages(this.pages));L.postMessage(JSON.stringify(Ya),"*")}});null!=aa?this.executeLayoutSpec(aa,Ra):Ra()});null!=K&&"function"===typeof K.substring&&"data:application/vnd.visio;base64,"==K.substring(0,34)?(da="0M8R4KGxGuE"==K.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(K.substring(K.indexOf(",")+1)),function(ya){bb(ya,V)},mxUtils.bind(this,function(ya){this.handleError(ya)}),da)):null!=K&&"function"===typeof K.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(K,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(K,mxUtils.bind(this,function(ya){4==ya.readyState&&(200<=ya.status&&299>=ya.status&&"<mxGraphModel"==ya.responseText.substring(0,@@ -4570,38 +4573,38 @@ mxUtils.write(x,c);q&&x.classList.add("gePrimaryBtn");mxEvent.addListener(x,"clifunction(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new SimpleTextareaDialog(this,Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),mxResources.get("import"),"https://www.drawio.com/blog/insert-from-csv"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,new mxRectangle(0,0,320,280));this.importCsvDialog.init()};-EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(k){if(0<k.length)try{var q=JSON.parse(k),x=this.getSelectedLayoutContainer();null!=x&&Array.isArray(q)&&0<q.length?this.setContainerChildLayout(x,q):this.executeLayouts(this.editor.graph.createLayouts(q));this.lastLayoutSpec=this.customLayoutConfig=q;this.hideDialog()}catch(B){this.handleError(B)}}),null,null,-null,null,mxUtils.bind(this,function(k,q){var x=this.createLayoutAddSelect(q);k.appendChild(x);x=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var B=q.value;q.value=JSON.stringify(JSON.parse(B));q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));q.value=B}catch(E){this.handleError(E)}}));x.setAttribute("title","copy");x.className=-"geBtn";k.appendChild(x)}),!0,null,null,EditorUi.APPLY_LAYOUTS_SPEC_URL);this.showDialog(f.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));f.init()}))};EditorUi.APPLY_LAYOUTS_SPEC_URL="https://www.drawio.com/docs/reference/json-layout-specification/";EditorUi.prototype.scopeLayoutsToCells=function(c,f){for(var k={},q=0;q<f.length;q++)null!=f[q]&&(k[f[q].id]=!0);var x=function(B){return null!=B&&!0===k[B.id]};for(q=0;q<c.length;q++)f=c[q],"undefined"!==typeof ElkLayout&&f instanceof-ElkLayout||void 0!==f.cellFilter?f.cellFilter=x:"function"===typeof f.isVertexIgnored&&function(B){var E=B.isVertexIgnored;B.isVertexIgnored=function(L){return E.apply(this,arguments)||!x(L)}}(f)};EditorUi.prototype.createLayoutAddSelect=function(c){var f=this,k=document.createElement("select");k.className="geBtn";k.style.marginRight="8px";k.style.maxWidth="180px";var q=document.createElement("option");q.value="";mxUtils.write(q,mxResources.get("add")+"...");q.disabled=!0;q.selected=!0;k.appendChild(q);+EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(k){if(0<k.length)try{var q=JSON.parse(k),x=this.getSelectedLayoutContainer();null!=x&&Array.isArray(q)&&0<q.length?this.setContainerChildLayout(x,q):this.executeLayouts(this.editor.graph.createLayouts(q));this.lastLayoutSpec=this.customLayoutConfig=q;this.hideDialog()}catch(C){this.handleError(C)}}),null,null,+null,null,mxUtils.bind(this,function(k,q){var x=this.createLayoutAddSelect(q);k.appendChild(x);x=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var C=q.value;q.value=JSON.stringify(JSON.parse(C));q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));q.value=C}catch(E){this.handleError(E)}}));x.setAttribute("title","copy");x.className=+"geBtn";k.appendChild(x)}),!0,null,null,EditorUi.APPLY_LAYOUTS_SPEC_URL);this.showDialog(f.container,620,460,!0,!0,null,null,null,new mxRectangle(0,0,440,280));f.init()}))};EditorUi.APPLY_LAYOUTS_SPEC_URL="https://www.drawio.com/docs/reference/json-layout-specification/";EditorUi.prototype.scopeLayoutsToCells=function(c,f){for(var k={},q=0;q<f.length;q++)null!=f[q]&&(k[f[q].id]=!0);var x=function(C){return null!=C&&!0===k[C.id]};for(q=0;q<c.length;q++)f=c[q],"undefined"!==typeof ElkLayout&&f instanceof+ElkLayout||void 0!==f.cellFilter?f.cellFilter=x:"function"===typeof f.isVertexIgnored&&function(C){var E=C.isVertexIgnored;C.isVertexIgnored=function(L){return E.apply(this,arguments)||!x(L)}}(f)};EditorUi.prototype.createLayoutAddSelect=function(c){var f=this,k=document.createElement("select");k.className="geBtn";k.style.marginRight="8px";k.style.maxWidth="180px";var q=document.createElement("option");q.value="";mxUtils.write(q,mxResources.get("add")+"...");q.disabled=!0;q.selected=!0;k.appendChild(q);var x=[];"undefined"!==typeof ElkLayout&&(q=function(E,L){var Q=ElkLayout.MENU_PRESETS[E];return{label:E,kind:"elk",algo:Q.algorithm,preset:Q.options,layoutName:L}},x.push(q("verticalFlow","elkLayered")),x.push(q("horizontalFlow","elkLayered")),x.push(q("verticalTree","elkTree")),x.push(q("horizontalTree","elkTree")),x.push(q("radialTree","elkRadial")),x.push(q("organic","elkOrganic")));x.push({label:"orgChart",kind:"orgchart"});x.push({label:"circle",kind:"simple",layoutName:"mxCircleLayout",config:{}});-x.push({label:"parallels",kind:"simple",layoutName:"mxParallelEdgeLayout",config:{spacing:20,checkOverlap:!0}});"undefined"!==typeof LibavoidRouting&&x.push({label:"orthogonalRouting",kind:"simple",layoutName:LibavoidRouting.LAYOUT_NAME,config:{}});for(q=0;q<x.length;q++){var B=document.createElement("option");B.value=String(q);mxUtils.write(B,mxResources.get(x[q].label)+("elk"===x[q].kind||"orgchart"===x[q].kind?"...":""));k.appendChild(B)}mxEvent.addListener(k,"change",mxUtils.bind(this,function(){var E=+x.push({label:"parallels",kind:"simple",layoutName:"mxParallelEdgeLayout",config:{spacing:20,checkOverlap:!0}});"undefined"!==typeof LibavoidRouting&&x.push({label:"orthogonalRouting",kind:"simple",layoutName:LibavoidRouting.LAYOUT_NAME,config:{}});for(q=0;q<x.length;q++){var C=document.createElement("option");C.value=String(q);mxUtils.write(C,mxResources.get(x[q].label)+("elk"===x[q].kind||"orgchart"===x[q].kind?"...":""));k.appendChild(C)}mxEvent.addListener(k,"change",mxUtils.bind(this,function(){var E=parseInt(k.value);k.selectedIndex=0;if(!(isNaN(E)||0>E||E>=x.length)){var L=x[E],Q=c.value;if(0===mxUtils.trim(Q).length)var V=[];else{try{V=JSON.parse(Q)}catch(fa){f.handleError(fa);return}if(!Array.isArray(V)){f.handleError(Error(mxResources.get("error")+": expected JSON array"));return}}var K=mxUtils.bind(this,function(fa){V.push(fa);f.hideDialog();f.showCustomLayoutDialog(JSON.stringify(V,null,2))});E=mxUtils.bind(this,function(){f.hideDialog();f.showCustomLayoutDialog(Q)});"elk"===L.kind?(f.hideDialog(),-ElkLayout.runWithDialog(f,L.algo,L.preset,mxResources.get(L.label),function(fa,aa){fa=Graph.elkOptionsToConfig(fa,aa);K({layout:L.layoutName,config:fa})},E)):"orgchart"===L.kind?(f.hideDialog(),f.showOrgChartConfigDialog(K,E)):K({layout:L.layoutName,config:L.config||{}})}}));return k};EditorUi.prototype.showOrgChartConfigDialog=function(c,f){var k=2,q=20,x=20,B=document.createElement("div"),E=function(da,ba){var ha=document.createElement("div");ha.style.marginTop="6px";ha.style.display="inline-block";-ha.style.width="180px";mxUtils.write(ha,mxResources.get(da)+": ");B.appendChild(ha);B.appendChild(ba)},L=document.createElement("select");L.style.width="160px";L.style.boxSizing="border-box";for(var Q=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],V=0;V<Q.length;V++){var K=document.createElement("option");mxUtils.write(K,+ElkLayout.runWithDialog(f,L.algo,L.preset,mxResources.get(L.label),function(fa,aa){fa=Graph.elkOptionsToConfig(fa,aa);K({layout:L.layoutName,config:fa})},E)):"orgchart"===L.kind?(f.hideDialog(),f.showOrgChartConfigDialog(K,E)):K({layout:L.layoutName,config:L.config||{}})}}));return k};EditorUi.prototype.showOrgChartConfigDialog=function(c,f){var k=2,q=20,x=20,C=document.createElement("div"),E=function(da,ba){var ha=document.createElement("div");ha.style.marginTop="6px";ha.style.display="inline-block";+ha.style.width="180px";mxUtils.write(ha,mxResources.get(da)+": ");C.appendChild(ha);C.appendChild(ba)},L=document.createElement("select");L.style.width="160px";L.style.boxSizing="border-box";for(var Q=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],V=0;V<Q.length;V++){var K=document.createElement("option");mxUtils.write(K,Q[V]);K.value=V;2===V&&K.setAttribute("selected","selected");L.appendChild(K)}mxEvent.addListener(L,"change",function(){k=parseInt(L.value)});E("orgChartType",L);var fa=document.createElement("input");fa.type="number";fa.value=q;fa.style.width="160px";fa.style.boxSizing="border-box";mxEvent.addListener(fa,"change",function(){q=parseInt(fa.value)});E("parentChildSpacing",fa);var aa=document.createElement("input");aa.type="number";aa.value=x;aa.style.width="160px";aa.style.boxSizing="border-box";mxEvent.addListener(aa,-"change",function(){x=parseInt(aa.value)});E("siblingSpacing",aa);f=new CustomDialog(this,B,function(){c({layout:"mxOrgChartLayout",config:{branchOptimizer:k,parentChildSpacing:q,siblingSpacing:x}})},f||null,mxResources.get("apply"),"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");this.showDialog(f.container,355,null,!0,!0)};EditorUi.prototype.loadOrgChartLayouts=function(c,f){this.createTimeout(null,mxUtils.bind(this,function(k){var q=mxUtils.bind(this,function(){this.loadingOrgChart=-!1;k.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),x=mxUtils.bind(this,function(B){this.loadingOrgChart=!1;k.clear()&&this.handleError(B)});if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))q();else if(f||this.spinner.spin(document.body,mxResources.get("loading")))this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",-function(){mxscript("js/orgchart/mxOrgChartLayout.js",q,null,null,null,x)},null,null,null,x)},null,null,null,x)},null,null,null,x):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",q,null,null,null,x)}),onerror)};EditorUi.prototype.importCsv=function(c,f,k,q){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,k)}),q)};EditorUi.prototype.doImportCsv=function(c,f,k){try{var q=c.split("\n"),x=[],B=[],E=[],L={};if(0<q.length){var Q={};k=null!=k?k:this.editor.graph;var V=null,-K=null,fa=null,aa=null,da=null,ba=null,ha=null,qa="whiteSpace=wrap;html=1;",ra=null,l=null,t="",H="auto",J="auto",R=!1,T=null,Y=null,Z=40,ia=40,ka=100,X=0,ja=mxUtils.bind(this,function(){null!=f?f(Ya):(k.setSelectionCells(Ya),k.scrollCellToVisible(k.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),na=k.getFreeInsertPoint(!0),la=na.x,va=na.y;na=va;var za=null,sa="auto";l=null;for(var wa=[],Ca=null,Fa=null,Ha=0;Ha<q.length&&+"change",function(){x=parseInt(aa.value)});E("siblingSpacing",aa);f=new CustomDialog(this,C,function(){c({layout:"mxOrgChartLayout",config:{branchOptimizer:k,parentChildSpacing:q,siblingSpacing:x}})},f||null,mxResources.get("apply"),"https://www.drawio.com/docs/manual/layouts/org-chart-layout/");this.showDialog(f.container,355,null,!0,!0)};EditorUi.prototype.loadOrgChartLayouts=function(c,f){this.createTimeout(null,mxUtils.bind(this,function(k){var q=mxUtils.bind(this,function(){this.loadingOrgChart=+!1;k.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),x=mxUtils.bind(this,function(C){this.loadingOrgChart=!1;k.clear()&&this.handleError(C)});if("undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0))q();else if(f||this.spinner.spin(document.body,mxResources.get("loading")))this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",+function(){mxscript("js/orgchart/mxOrgChartLayout.js",q,null,null,null,x)},null,null,null,x)},null,null,null,x)},null,null,null,x):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",q,null,null,null,x)}),onerror)};EditorUi.prototype.importCsv=function(c,f,k,q){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f,k)}),q)};EditorUi.prototype.doImportCsv=function(c,f,k){try{var q=c.split("\n"),x=[],C=[],E=[],L={};if(0<q.length){var Q={};k=null!=k?k:this.editor.graph;var V=null,+K=null,fa=null,aa=null,da=null,ba=null,ha=null,qa="whiteSpace=wrap;html=1;",ra=null,l=null,t="",H="auto",J="auto",R=!1,T=null,Y=null,Z=40,ia=40,ja=100,X=0,ka=mxUtils.bind(this,function(){null!=f?f(Ya):(k.setSelectionCells(Ya),k.scrollCellToVisible(k.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),na=k.getFreeInsertPoint(!0),la=na.x,ua=na.y;na=ua;var za=null,sa="auto";l=null;for(var wa=[],Ca=null,Fa=null,Ha=0;Ha<q.length&&"#"==q[Ha].charAt(0);){c=q[Ha].replace(/\r$/,"");for(Ha++;Ha<q.length&&"\\"==c.charAt(c.length-1)&&"#"==q[Ha].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(q[Ha].substring(1)),Ha++;if("#"!=c.charAt(1)){var Na=c.indexOf(":");if(0<Na){var La=mxUtils.trim(c.substring(1,Na)),Da=mxUtils.trim(c.substring(Na+1));"label"==La?za=Graph.sanitizeHtml(Da):"labelname"==La&&0<Da.length&&"-"!=Da?da=Da:"labels"==La&&0<Da.length&&"-"!=Da?ha=JSON.parse(Da):"style"==La?K=Da:"parentstyle"==La?qa=Da:"unknownStyle"==La&&"-"!=Da?ba=Da:"stylename"==La&&0<Da.length&&"-"!=Da?aa=Da:"styles"==La&&0<Da.length&&"-"!=Da?fa=JSON.parse(Da):"vars"==La&&0<Da.length&&"-"!=Da?V=JSON.parse(Da):"identity"==La&&0<Da.length&&"-"!=Da?ra=Da:"parent"==La&&0<Da.length&&"-"!=Da?l=Da:"namespace"==La&&0<Da.length&&"-"!=Da?t=Da:"width"==La?H=Da:"height"==La?J=Da:"collapsed"==La&&"-"!=Da?R="true"==Da:"left"==La&&0<Da.length?T=Da:"top"==La&&0<Da.length?Y=Da:"ignore"==La?Fa=Da.split(","):"connect"==La?wa.push(JSON.parse(Da)):"link"==La?Ca=-Da:"padding"==La?X=parseFloat(Da):"edgespacing"==La?Z=parseFloat(Da):"nodespacing"==La?ia=parseFloat(Da):"levelspacing"==La?ka=parseFloat(Da):"layout"==La&&(sa=Da)}}}if(null==q[Ha])throw Error(mxResources.get("invalidOrMissingFile"));var Sa=this.editor.csvToArray(q[Ha].replace(/\r$/,""));Na=c=null;La=[];for(Da=0;Da<Sa.length;Da++)ra==Sa[Da]&&(c=Da),l==Sa[Da]&&(Na=Da),La.push(mxUtils.trim(Sa[Da]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==za&&(za="%"+La[0]+"%");if(null!=+Da:"padding"==La?X=parseFloat(Da):"edgespacing"==La?Z=parseFloat(Da):"nodespacing"==La?ia=parseFloat(Da):"levelspacing"==La?ja=parseFloat(Da):"layout"==La&&(sa=Da)}}}if(null==q[Ha])throw Error(mxResources.get("invalidOrMissingFile"));var Sa=this.editor.csvToArray(q[Ha].replace(/\r$/,""));Na=c=null;La=[];for(Da=0;Da<Sa.length;Da++)ra==Sa[Da]&&(c=Da),l==Sa[Da]&&(Na=Da),La.push(mxUtils.trim(Sa[Da]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==za&&(za="%"+La[0]+"%");if(null!=wa)for(var Oa=0;Oa<wa.length;Oa++)null==Q[wa[Oa].to]&&(Q[wa[Oa].to]={});ra=[];for(Da=Ha+1;Da<q.length;Da++){var Ta=this.editor.csvToArray(q[Da].replace(/\r$/,""));if(null==Ta){var Ua=40<q[Da].length?q[Da].substring(0,40)+"...":q[Da];throw Error(Ua+" ("+Da+"):\n"+mxResources.get("containsValidationErrors"));}0<Ta.length&&ra.push(Ta)}k.model.beginUpdate();try{for(Da=0;Da<ra.length;Da++){Ta=ra[Da];var Ba=null,Ka=null!=c?t+Ta[c]:null;q=!1;null!=Ka&&(Ba=k.model.getCell(Ka),q=null==Ba||0<=mxUtils.indexOf(x,Ba));var ab=new mxCell(za,new mxGeometry(la,na,0,0),K||"whiteSpace=wrap;html=1;");ab.collapsed=R;ab.vertex=!0;ab.id=Ka;null==Ba||q||k.model.setCollapsed(Ba,R);for(var Qa=0;Qa<Ta.length;Qa++)k.setAttributeForCell(ab,La[Qa],Ta[Qa]),null==Ba||q||k.setAttributeForCell(Ba,La[Qa],Ta[Qa]);if(null!=da&&null!=ha){var db=ha[ab.getAttribute(da)];null!=db&&(k.labelChanged(ab,db),null==Ba||q||k.cellLabelChanged(Ba,db))}if(null!=aa&&null!=fa){var Va=fa[ab.getAttribute(aa)];null!=Va&&(ab.style=Va)}k.setAttributeForCell(ab,"placeholders","1");ab.style=k.replacePlaceholders(ab,ab.style,V);null==Ba||q?k.fireEvent(new mxEventObject("cellsInserted","cells",[ab])):(k.model.setStyle(Ba,ab.style),0>mxUtils.indexOf(E,Ba)&&E.push(Ba),k.fireEvent(new mxEventObject("cellsInserted","cells",[Ba])));q=null!=Ba;Ba=ab;if(!q)for(Oa=0;Oa<wa.length;Oa++)Q[wa[Oa].to][Ba.getAttribute(wa[Oa].to)]=Ba;null!=Ca&&"link"!=Ca&&(k.setLinkForCell(Ba,Ba.getAttribute(Ca)),k.setAttributeForCell(Ba,Ca,null));var nb=k.getPreferredSizeForCell(Ba);l=null!=-Na?k.model.getCell(t+Ta[Na]):null;if(Ba.vertex){Ua=null!=l?0:la;Ha=null!=l?0:va;null!=T&&null!=Ba.getAttribute(T)&&(Ba.geometry.x=Ua+parseFloat(Ba.getAttribute(T)));null!=Y&&null!=Ba.getAttribute(Y)&&(Ba.geometry.y=Ha+parseFloat(Ba.getAttribute(Y)));var bb="@"==H.charAt(0)?Ba.getAttribute(H.substring(1)):null;Ba.geometry.width=null!=bb&&"auto"!=bb?parseFloat(Ba.getAttribute(H.substring(1))):"auto"==H||"auto"==bb?nb.width+X:parseFloat(H);var ya="@"==J.charAt(0)?Ba.getAttribute(J.substring(1)):null;-Ba.geometry.height=null!=ya&&"auto"!=ya&&"width"!=J?parseFloat(ya):"auto"==J||"auto"==ya?nb.height+X:"width"==J?Ba.geometry.width:parseFloat(J);na+=Ba.geometry.height+ia}q?(null==L[Ka]&&(L[Ka]=[]),L[Ka].push(Ba)):(x.push(Ba),null!=l?(l.style=k.replacePlaceholders(l,qa,V),k.addCell(Ba,l),B.push(l)):E.push(k.addCell(Ba)))}for(Da=0;Da<B.length;Da++)bb="@"==H.charAt(0)?B[Da].getAttribute(H.substring(1)):null,ya="@"==J.charAt(0)?B[Da].getAttribute(J.substring(1)):null,"auto"!=H&&"auto"!=bb||"auto"!=J&&-"auto"!=ya||k.updateGroupBounds([B[Da]],X,!0);var Ra=E.slice(),Ya=E.slice();for(Oa=0;Oa<wa.length;Oa++){var lb=wa[Oa];for(Da=0;Da<x.length;Da++){Ba=x[Da];var ub=mxUtils.bind(this,function(Ab,D,M){var N=D.getAttribute(M.from);if(null!=N&&""!=N){N=N.split(",");for(var W=0;W<N.length;W++){var ca=Q[M.to][N[W]];if(null==ca&&null!=ba){ca=new mxCell(N[W],new mxGeometry(la,va,0,0),ba);ca.style=k.replacePlaceholders(D,ca.style,V);var ma=k.getPreferredSizeForCell(ca);ca.geometry.width=ma.width+X;ca.geometry.height=+Na?k.model.getCell(t+Ta[Na]):null;if(Ba.vertex){Ua=null!=l?0:la;Ha=null!=l?0:ua;null!=T&&null!=Ba.getAttribute(T)&&(Ba.geometry.x=Ua+parseFloat(Ba.getAttribute(T)));null!=Y&&null!=Ba.getAttribute(Y)&&(Ba.geometry.y=Ha+parseFloat(Ba.getAttribute(Y)));var bb="@"==H.charAt(0)?Ba.getAttribute(H.substring(1)):null;Ba.geometry.width=null!=bb&&"auto"!=bb?parseFloat(Ba.getAttribute(H.substring(1))):"auto"==H||"auto"==bb?nb.width+X:parseFloat(H);var ya="@"==J.charAt(0)?Ba.getAttribute(J.substring(1)):null;+Ba.geometry.height=null!=ya&&"auto"!=ya&&"width"!=J?parseFloat(ya):"auto"==J||"auto"==ya?nb.height+X:"width"==J?Ba.geometry.width:parseFloat(J);na+=Ba.geometry.height+ia}q?(null==L[Ka]&&(L[Ka]=[]),L[Ka].push(Ba)):(x.push(Ba),null!=l?(l.style=k.replacePlaceholders(l,qa,V),k.addCell(Ba,l),C.push(l)):E.push(k.addCell(Ba)))}for(Da=0;Da<C.length;Da++)bb="@"==H.charAt(0)?C[Da].getAttribute(H.substring(1)):null,ya="@"==J.charAt(0)?C[Da].getAttribute(J.substring(1)):null,"auto"!=H&&"auto"!=bb||"auto"!=J&&+"auto"!=ya||k.updateGroupBounds([C[Da]],X,!0);var Ra=E.slice(),Ya=E.slice();for(Oa=0;Oa<wa.length;Oa++){var lb=wa[Oa];for(Da=0;Da<x.length;Da++){Ba=x[Da];var ub=mxUtils.bind(this,function(Ab,D,M){var N=D.getAttribute(M.from);if(null!=N&&""!=N){N=N.split(",");for(var W=0;W<N.length;W++){var ca=Q[M.to][N[W]];if(null==ca&&null!=ba){ca=new mxCell(N[W],new mxGeometry(la,ua,0,0),ba);ca.style=k.replacePlaceholders(D,ca.style,V);var ma=k.getPreferredSizeForCell(ca);ca.geometry.width=ma.width+X;ca.geometry.height=ma.height+X;Q[M.to][N[W]]=ca;ca.vertex=!0;ca.id=N[W];E.push(k.addCell(ca))}if(null!=ca){ma=M.label;null!=M.fromlabel&&(ma=(D.getAttribute(M.fromlabel)||"")+(ma||""));null!=M.sourcelabel&&(ma=k.replacePlaceholders(D,M.sourcelabel,V)+(ma||""));null!=M.tolabel&&(ma=(ma||"")+(ca.getAttribute(M.tolabel)||""));null!=M.targetlabel&&(ma=(ma||"")+k.replacePlaceholders(ca,M.targetlabel,V));var pa="target"==M.placeholders==!M.invert?ca:Ab;pa=null!=M.style?k.replacePlaceholders(pa,M.style,V):k.createCurrentEdgeStyle();-ma=k.insertEdge(null,null,ma||"",M.invert?ca:Ab,M.invert?Ab:ca,pa);if(null!=M.labels)for(pa=0;pa<M.labels.length;pa++){var ua=M.labels[pa],Aa=new mxCell(ua.label||pa,new mxGeometry(null!=ua.x?ua.x:0,null!=ua.y?ua.y:0,0,0),"resizable=0;html=1;");Aa.vertex=!0;Aa.connectable=!1;Aa.geometry.relative=!0;null!=ua.placeholders&&(Aa.value=k.replacePlaceholders("target"==ua.placeholders==!M.invert?ca:Ab,Aa.value,V));if(null!=ua.dx||null!=ua.dy)Aa.geometry.offset=new mxPoint(null!=ua.dx?ua.dx:0,null!=ua.dy?-ua.dy:0);ma.insert(Aa)}if(null!=M.data)for(var xa in M.data)k.setAttributeForCell(ma,xa,M.data[xa]);Ya.push(ma);mxUtils.remove(M.invert?Ab:ca,Ra)}}}});ub(Ba,Ba,lb);if(null!=L[Ba.id])for(Qa=0;Qa<L[Ba.id].length;Qa++)ub(Ba,L[Ba.id][Qa],lb)}}if(null!=Fa)for(Da=0;Da<x.length;Da++)for(Ba=x[Da],Qa=0;Qa<Fa.length;Qa++)k.setAttributeForCell(Ba,mxUtils.trim(Fa[Qa]),null);if(0<E.length){var gb=new mxParallelEdgeLayout(k);gb.spacing=Z;gb.checkOverlap=!0;var jb=function(){0<gb.spacing&&gb.execute(k.getDefaultParent());+ma=k.insertEdge(null,null,ma||"",M.invert?ca:Ab,M.invert?Ab:ca,pa);if(null!=M.labels)for(pa=0;pa<M.labels.length;pa++){var va=M.labels[pa],Aa=new mxCell(va.label||pa,new mxGeometry(null!=va.x?va.x:0,null!=va.y?va.y:0,0,0),"resizable=0;html=1;");Aa.vertex=!0;Aa.connectable=!1;Aa.geometry.relative=!0;null!=va.placeholders&&(Aa.value=k.replacePlaceholders("target"==va.placeholders==!M.invert?ca:Ab,Aa.value,V));if(null!=va.dx||null!=va.dy)Aa.geometry.offset=new mxPoint(null!=va.dx?va.dx:0,null!=va.dy?+va.dy:0);ma.insert(Aa)}if(null!=M.data)for(var xa in M.data)k.setAttributeForCell(ma,xa,M.data[xa]);Ya.push(ma);mxUtils.remove(M.invert?Ab:ca,Ra)}}}});ub(Ba,Ba,lb);if(null!=L[Ba.id])for(Qa=0;Qa<L[Ba.id].length;Qa++)ub(Ba,L[Ba.id][Qa],lb)}}if(null!=Fa)for(Da=0;Da<x.length;Da++)for(Ba=x[Da],Qa=0;Qa<Fa.length;Qa++)k.setAttributeForCell(Ba,mxUtils.trim(Fa[Qa]),null);if(0<E.length){var gb=new mxParallelEdgeLayout(k);gb.spacing=Z;gb.checkOverlap=!0;var jb=function(){0<gb.spacing&&gb.execute(k.getDefaultParent());var Ab=0,D=0;0<E.length&&(D=k.getCellGeometry(E[0]),Ab=Math.round(k.snap(D.x))-D.x,D=Math.round(k.snap(D.y))-D.y);for(var M=0;M<E.length;M++){var N=k.getCellGeometry(E[M]);N.x=Math.round(N.x+Ab);N.y=Math.round(N.y+D);"auto"==H&&(N.width=Math.round(k.snap(N.width)));"auto"==J&&(N.height=Math.round(k.snap(N.height)))}};"auto"==sa&&1==Ra.length&&(sa=Ya.length==2*E.length-1?"verticaltree":"verticalflow");var yb="organic"==sa||null!=EditorUi.CSV_ELK_LAYOUTS[sa]?null:this.resolveLayoutList(sa);if(null!=-yb){var Bb=ja;k.view.validate();var Cb=k.createLayouts(yb);this.scopeLayoutsToCells(Cb,Ya);this.executeLayouts(Cb,function(){jb();Bb()});ja=null}else if("circle"==sa){var Kb=new mxCircleLayout(k);Kb.disableEdgeStyle=!1;Kb.resetEdges=!1;var Xb=Kb.isVertexIgnored;Kb.isVertexIgnored=function(Ab){return Xb.apply(this,arguments)||0>mxUtils.indexOf(E,Ab)};this.executeLayout(function(){Kb.execute(k.getDefaultParent());jb()},!0,ja);ja=null}else if("verticaltree"==sa||"horizontaltree"==sa){k.view.validate();-var Ob=new mxCompactTreeLayout(k,"horizontaltree"==sa);Ob.levelDistance=ia;Ob.edgeRouting=!1;Ob.resetEdges=!1;Ob.sortEdges=!0;var Ub=Ob.isVertexIgnored;Ob.isVertexIgnored=function(Ab){return Ub.apply(this,arguments)||0>mxUtils.indexOf(E,Ab)};this.executeLayout(function(){Ob.execute(k.getDefaultParent(),0<Ra.length?Ra[0]:null)},!0,ja);ja=null}else if("orgchart"==sa){k.view.validate();var Qb=new mxOrgChartLayout(k,2,ka,ia),xb=Qb.isVertexIgnored;Qb.isVertexIgnored=function(Ab){return xb.apply(this,arguments)||-0>mxUtils.indexOf(E,Ab)};this.executeLayout(function(){Qb.execute(k.getDefaultParent());jb()},!0,ja);ja=null}else if("organic"==sa||"auto"==sa&&Ya.length>E.length){k.view.validate();var Mb=new mxFastOrganicLayout(k);Mb.forceConstant=3*ia;Mb.disableEdgeStyle=!1;Mb.resetEdges=!1;var Pb=Mb.isVertexIgnored;Mb.isVertexIgnored=function(Ab){return Pb.apply(this,arguments)||0>mxUtils.indexOf(E,Ab)};this.executeLayout(function(){Mb.execute(k.getDefaultParent());jb()},!0,ja);ja=null}else if(null!=EditorUi.CSV_ELK_LAYOUTS[sa]){k.view.validate();-Bb=ja;var Tb=EditorUi.CSV_ELK_LAYOUTS[sa],Vb=mxUtils.clone(Tb.config);Vb["elk.spacing.nodeNode"]=ia;Vb["elk.layered.spacing.nodeNodeBetweenLayers"]=ka;Vb["elk.spacing.edgeEdge"]=Z;Vb["elk.layered.spacing.edgeEdgeBetweenLayers"]=Z;var Gb=k.createLayouts([{layout:Tb.layout,config:Vb}]);this.scopeLayoutsToCells(Gb,Ya);k.model.beginUpdate();var Nb=!1,Wb=function(){Nb||(Nb=!0,k.model.endUpdate())},Yb=this;try{Gb[0].prepare(k.getDefaultParent(),function(Ab,D){null!=Ab?(Wb(),Yb.handleError(Ab)):Yb.executeLayout(function(){D();-var M=k.getBoundingBoxFromGeometry(Ya);null!=M&&k.moveCells(Ya,la-M.x,va-M.y)},!0,function(){Wb();Bb()})})}catch(Ab){throw Wb(),Ab;}ja=null}}this.hideDialog()}finally{k.model.endUpdate()}null!=ja&&ja()}}catch(Ab){this.handleError(Ab)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var k="?",q;for(q in urlParams)0>mxUtils.indexOf(c,q)&&null!=urlParams[q]&&(f+=k+q+"="+urlParams[q],k="&")}else f=window.location.search;+yb){var Bb=ka;k.view.validate();var Cb=k.createLayouts(yb);this.scopeLayoutsToCells(Cb,Ya);this.executeLayouts(Cb,function(){jb();Bb()});ka=null}else if("circle"==sa){var Kb=new mxCircleLayout(k);Kb.disableEdgeStyle=!1;Kb.resetEdges=!1;var Xb=Kb.isVertexIgnored;Kb.isVertexIgnored=function(Ab){return Xb.apply(this,arguments)||0>mxUtils.indexOf(E,Ab)};this.executeLayout(function(){Kb.execute(k.getDefaultParent());jb()},!0,ka);ka=null}else if("verticaltree"==sa||"horizontaltree"==sa){k.view.validate();+var Ob=new mxCompactTreeLayout(k,"horizontaltree"==sa);Ob.levelDistance=ia;Ob.edgeRouting=!1;Ob.resetEdges=!1;Ob.sortEdges=!0;var Ub=Ob.isVertexIgnored;Ob.isVertexIgnored=function(Ab){return Ub.apply(this,arguments)||0>mxUtils.indexOf(E,Ab)};this.executeLayout(function(){Ob.execute(k.getDefaultParent(),0<Ra.length?Ra[0]:null)},!0,ka);ka=null}else if("orgchart"==sa){k.view.validate();var Qb=new mxOrgChartLayout(k,2,ja,ia),xb=Qb.isVertexIgnored;Qb.isVertexIgnored=function(Ab){return xb.apply(this,arguments)||+0>mxUtils.indexOf(E,Ab)};this.executeLayout(function(){Qb.execute(k.getDefaultParent());jb()},!0,ka);ka=null}else if("organic"==sa||"auto"==sa&&Ya.length>E.length){k.view.validate();var Mb=new mxFastOrganicLayout(k);Mb.forceConstant=3*ia;Mb.disableEdgeStyle=!1;Mb.resetEdges=!1;var Pb=Mb.isVertexIgnored;Mb.isVertexIgnored=function(Ab){return Pb.apply(this,arguments)||0>mxUtils.indexOf(E,Ab)};this.executeLayout(function(){Mb.execute(k.getDefaultParent());jb()},!0,ka);ka=null}else if(null!=EditorUi.CSV_ELK_LAYOUTS[sa]){k.view.validate();+Bb=ka;var Tb=EditorUi.CSV_ELK_LAYOUTS[sa],Vb=mxUtils.clone(Tb.config);Vb["elk.spacing.nodeNode"]=ia;Vb["elk.layered.spacing.nodeNodeBetweenLayers"]=ja;Vb["elk.spacing.edgeEdge"]=Z;Vb["elk.layered.spacing.edgeEdgeBetweenLayers"]=Z;var Gb=k.createLayouts([{layout:Tb.layout,config:Vb}]);this.scopeLayoutsToCells(Gb,Ya);k.model.beginUpdate();var Nb=!1,Wb=function(){Nb||(Nb=!0,k.model.endUpdate())},Yb=this;try{Gb[0].prepare(k.getDefaultParent(),function(Ab,D){null!=Ab?(Wb(),Yb.handleError(Ab)):Yb.executeLayout(function(){D();+var M=k.getBoundingBoxFromGeometry(Ya);null!=M&&k.moveCells(Ya,la-M.x,ua-M.y)},!0,function(){Wb();Bb()})})}catch(Ab){throw Wb(),Ab;}ka=null}}this.hideDialog()}finally{k.model.endUpdate()}null!=ka&&ka()}}catch(Ab){this.handleError(Ab)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var k="?",q;for(q in urlParams)0>mxUtils.indexOf(c,q)&&null!=urlParams[q]&&(f+=k+q+"="+urlParams[q],k="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var k="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),q;for(q in urlParams)0>mxUtils.indexOf(k,q)&&(c=0==f?c+"?":c+"&",null!=urlParams[q]&&(c+=q+"="+urlParams[q],f++))}return c};EditorUi.prototype.showLinkDialog=function(c,f,k,q,x){c=new LinkDialog(this,c,f,k,!0,q,x);this.showDialog(c.container,440,null,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){var f=1;null==this.drive&&"function"!==typeof window.DriveClient||f++;null==this.dropbox&&"function"!==typeof window.DropboxClient||f++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||f++;null!=this.m365&&f++;null!=this.gitHub&&f++;null!=this.gitLab&&f++;c&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),f=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var k=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!k);this.actions.get("print").setEnabled(!k);this.menus.get("exportAs").setEnabled(!k);this.menus.get("embed").setEnabled(!k);k="1"!=urlParams.embed||this.editor.graph.isEnabled();@@ -4613,93 +4616,93 @@ x="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=f&&f.isEditable();t!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&q&&0<k.cells.length);this.actions.get("copyTextStyle").setEnabled(q&&!c.isSelectionEmpty());this.actions.get("pasteTextStyle").setEnabled(null!=this.copiedTextStyle&&q&&0<k.cells.length);this.actions.get("editGeometry").setEnabled(0<k.vertices.length&&!k.transparentBounds);this.actions.get("addToScratchpad").setEnabled(0<k.cells.length);this.actions.get("createShape").setEnabled(q);this.actions.get("createRevision").setEnabled(q);this.actions.get("moveToFolder").setEnabled(null!=f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(q&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=f&&!f.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.actions.get("properties").setEnabled(null!=f);this.menus.get("publish").setEnabled(null!=f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("none"!=this.diagramContainer.style.display);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):-"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(q&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var U=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);U.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,k,q,x,B,E,L){var Q=c.editor.graph;-if("xml"==k)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==k)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(Q.getSvg(q,x,B)),"image/svg+xml");else{var V=c.getFileData(!0,null,null,null,null,!0),K=Q.getGraphBounds(),fa=Math.floor(K.width*x/Q.view.scale),aa=Math.floor(K.height*x/Q.view.scale);if(V.length<=MAX_REQUEST_SIZE&&fa*aa<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.editor.isExportToCanvas()){var da={globalVars:Q.getExportVariables()};-L&&(da.grid={size:Q.gridSize,steps:Q.view.gridSteps,color:Q.view.gridColor});c.saveRequest(f,k,function(ba,ha){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(ha||"0")+(null!=ba?"&filename="+encodeURIComponent(ba):"")+"&extras="+encodeURIComponent(JSON.stringify(da))+(0<E?"&dpi="+E:"")+"&bg="+(null!=q?q:"none")+"&w="+fa+"&h="+aa+"&border="+B+"&xml="+encodeURIComponent(V))})}else"png"==k?c.exportImage(x,null==q||"none"==q,!0,!1,!1,B,!0,!1,null,L,E):c.exportImage(x,!1,!0,!1,!1,B,!0,!1,"jpeg",+"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(q&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var U=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);U.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,k,q,x,C,E,L){var Q=c.editor.graph;+if("xml"==k)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==k)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(Q.getSvg(q,x,C)),"image/svg+xml");else{var V=c.getFileData(!0,null,null,null,null,!0),K=Q.getGraphBounds(),fa=Math.floor(K.width*x/Q.view.scale),aa=Math.floor(K.height*x/Q.view.scale);if(V.length<=MAX_REQUEST_SIZE&&fa*aa<MAX_AREA)if(c.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!c.editor.isExportToCanvas()){var da={globalVars:Q.getExportVariables()};+L&&(da.grid={size:Q.gridSize,steps:Q.view.gridSteps,color:Q.view.gridColor});c.saveRequest(f,k,function(ba,ha){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(ha||"0")+(null!=ba?"&filename="+encodeURIComponent(ba):"")+"&extras="+encodeURIComponent(JSON.stringify(da))+(0<E?"&dpi="+E:"")+"&bg="+(null!=q?q:"none")+"&w="+fa+"&h="+aa+"&border="+C+"&xml="+encodeURIComponent(V))})}else"png"==k?c.exportImage(x,null==q||"none"==q,!0,!1,!1,C,!0,!1,null,L,E):c.exportImage(x,!1,!0,!1,!1,C,!0,!1,"jpeg",L);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var k=0;k<this.pages.length;k++){var q=c;this.currentPage!=this.pages[k]&&(q=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[k]),q.model.setRoot(this.pages[k].root));f+=this.pages[k].getName()+" "+q.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.writeJsonLabel=function(c,f,k){if(null!=f&&""!=f){if(this.editor.graph.isHtmlLabel(c)&&(c=document.createElement("div"),c.innerHTML=Graph.sanitizeHtml(f),0<c.getElementsByTagName("*").length)){k.label=mxUtils.trim(mxUtils.extractTextWithWhitespace([c]));k.html=f;return}k.label=f}};EditorUi.prototype.getJsonForExportCell=function(c,f){var k={id:c.getId()};k.type=f?"layer":c.edge?"edge":c.vertex?"node":"group";f||(f=c.getParent(),null!=f&&(k.parent=f.getId()));c.edge&&(null!=-c.source&&(k.source=c.source.getId()),null!=c.target&&(k.target=c.target.getId()));f=c.value;if(null!=f&&mxUtils.isNode(f)){this.writeJsonLabel(c,f.getAttribute("label"),k);c=f.attributes;f={};for(var q=0,x=0;x<c.length;x++){var B=c[x].nodeName;"label"!=B&&"placeholders"!=B&&"id"!=B&&(f[B]=c[x].nodeValue,q++)}0<q&&(k.metadata=f)}else"string"===typeof f&&this.writeJsonLabel(c,f,k);return k};EditorUi.prototype.getJsonForPage=function(c,f){var k=this.editor.graph.getModel();var q=null==c||c==this.currentPage?-k.getRoot():this.updatePageRoot(c).root;var x=[],B=mxUtils.bind(this,function(K,fa){x.push(this.getJsonForExportCell(K,fa));fa=K.getChildCount();for(var aa=0;aa<fa;aa++)B(K.getChildAt(aa),!1)});if(null!=f){q={};for(var E=0;E<f.length;E++)q[f[E].getId()]=!0;for(E=0;E<f.length;E++){for(var L=f[E],Q=L.getParent(),V=!1;null!=Q;){if(q[Q.getId()]){V=!0;break}Q=Q.getParent()}V||B(L,k.isLayer(L))}}else for(f=q.getChildCount(),E=0;E<f;E++)B(q.getChildAt(E),!0);E={};null!=c&&(E.id=c.getId(),E.name=c.getName());+c.source&&(k.source=c.source.getId()),null!=c.target&&(k.target=c.target.getId()));f=c.value;if(null!=f&&mxUtils.isNode(f)){this.writeJsonLabel(c,f.getAttribute("label"),k);c=f.attributes;f={};for(var q=0,x=0;x<c.length;x++){var C=c[x].nodeName;"label"!=C&&"placeholders"!=C&&"id"!=C&&(f[C]=c[x].nodeValue,q++)}0<q&&(k.metadata=f)}else"string"===typeof f&&this.writeJsonLabel(c,f,k);return k};EditorUi.prototype.getJsonForPage=function(c,f){var k=this.editor.graph.getModel();var q=null==c||c==this.currentPage?+k.getRoot():this.updatePageRoot(c).root;var x=[],C=mxUtils.bind(this,function(K,fa){x.push(this.getJsonForExportCell(K,fa));fa=K.getChildCount();for(var aa=0;aa<fa;aa++)C(K.getChildAt(aa),!1)});if(null!=f){q={};for(var E=0;E<f.length;E++)q[f[E].getId()]=!0;for(E=0;E<f.length;E++){for(var L=f[E],Q=L.getParent(),V=!1;null!=Q;){if(q[Q.getId()]){V=!0;break}Q=Q.getParent()}V||C(L,k.isLayer(L))}}else for(f=q.getChildCount(),E=0;E<f;E++)C(q.getChildAt(E),!0);E={};null!=c&&(E.id=c.getId(),E.name=c.getName());E.cells=x;return E};EditorUi.prototype.createJsonForExport=function(c,f,k,q){var x={version:EditorUi.VERSION};f&&(x.data=mxUtils.getXml(this.getXmlFileData(!q,!c,!k)));f=[];if(q)f.push(this.getJsonForPage(this.currentPage,this.editor.graph.getSelectionCells()));else if(c&&null!=this.pages)for(c=0;c<this.pages.length;c++)f.push(this.getJsonForPage(this.pages[c]));else f.push(this.getJsonForPage(this.currentPage));x.pages=f;return x};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},-k=document.createElement("div");k.style.whiteSpace="nowrap";var q=document.createElement("h3");mxUtils.write(q,mxUtils.htmlEntities(c));k.appendChild(q);var x=document.createElement("div");x.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";x.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var B={};try{var E=mxSettings.getCustomLibraries();for(c=0;c<E.length;c++){var L=E[c];if("R"==L.substring(0,1)){var Q=JSON.parse(decodeURIComponent(L.substring(1)));-B[Q[0]]={id:Q[0],title:Q[1],downloadUrl:Q[2]}}}}catch(V){}this.remoteInvoke("getCustomLibraries",null,null,function(V){x.innerText="";if(0==V.length)x.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var K=0;K<V.length;K++){var fa=V[K];B[fa.id]&&(f[fa.id]=fa);var aa=this.addCheckbox(x,fa.title,B[fa.id]);(function(da,ba){mxEvent.addListener(ba,"change",function(){this.checked?f[da.id]=da:delete f[da.id]})})(fa,-aa)}},mxUtils.bind(this,function(V){x.innerText="";var K=document.createElement("div");K.style.padding="8px";K.style.textAlign="center";mxUtils.write(K,mxResources.get("error")+": ");mxUtils.write(K,null!=V&&null!=V.message?V.message:mxResources.get("unknownError"));x.appendChild(K)}));k.appendChild(x);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var V=0,K;for(K in f)null==B[K]&&(V++,mxUtils.bind(this,function(fa){this.remoteInvoke("getFileContent",-[fa.downloadUrl],null,mxUtils.bind(this,function(aa){V--;0==V&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,aa,fa)),this.showSidebar()}catch(da){this.handleError(da,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){V--;0==V&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[K]));for(K in B)f[K]||this.closeLibrary(new RemoteLibrary(this,null,B[K]));0==V&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");+k=document.createElement("div");k.style.whiteSpace="nowrap";var q=document.createElement("h3");mxUtils.write(q,mxUtils.htmlEntities(c));k.appendChild(q);var x=document.createElement("div");x.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";x.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var C={};try{var E=mxSettings.getCustomLibraries();for(c=0;c<E.length;c++){var L=E[c];if("R"==L.substring(0,1)){var Q=JSON.parse(decodeURIComponent(L.substring(1)));+C[Q[0]]={id:Q[0],title:Q[1],downloadUrl:Q[2]}}}}catch(V){}this.remoteInvoke("getCustomLibraries",null,null,function(V){x.innerText="";if(0==V.length)x.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var K=0;K<V.length;K++){var fa=V[K];C[fa.id]&&(f[fa.id]=fa);var aa=this.addCheckbox(x,fa.title,C[fa.id]);(function(da,ba){mxEvent.addListener(ba,"change",function(){this.checked?f[da.id]=da:delete f[da.id]})})(fa,+aa)}},mxUtils.bind(this,function(V){x.innerText="";var K=document.createElement("div");K.style.padding="8px";K.style.textAlign="center";mxUtils.write(K,mxResources.get("error")+": ");mxUtils.write(K,null!=V&&null!=V.message?V.message:mxResources.get("unknownError"));x.appendChild(K)}));k.appendChild(x);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var V=0,K;for(K in f)null==C[K]&&(V++,mxUtils.bind(this,function(fa){this.remoteInvoke("getFileContent",+[fa.downloadUrl],null,mxUtils.bind(this,function(aa){V--;0==V&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,aa,fa)),this.showSidebar()}catch(da){this.handleError(da,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){V--;0==V&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[K]));for(K in C)f[K]||this.closeLibrary(new RemoteLibrary(this,null,C[K]));0==V&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(k.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=-c;for(var f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,k=this.remoteInvokeCallbacks[f.callbackId];if(null==k)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?k.error&&k.error(c.error.errResp):k.callback&&k.callback.apply(this,c.resp);this.remoteInvokeCallbacks[f.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,f,k,q,x){var B=-!0,E=window.setTimeout(mxUtils.bind(this,function(){B=!1;x({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),L=mxUtils.bind(this,function(){window.clearTimeout(E);B&&q.apply(this,arguments)}),Q=mxUtils.bind(this,function(){window.clearTimeout(E);B&&x.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:L,error:Q});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:k});null!=this.remoteWin?-this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,f){var k=mxUtils.bind(this,function(V,K){var fa={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=K?fa.error={errResp:K}:null!=V&&(fa.resp=V);this.remoteWin.postMessage(JSON.stringify(fa),"*")});try{var q=c.funtionName,x=this.remoteInvokableFns[q];if(null!=x&&"function"===typeof this[q]){if(x.allowedDomains){for(var B=!1,E=0;E<x.allowedDomains.length;E++)if(f=="https://"+x.allowedDomains[E]){B=-!0;break}if(!B){k(null,"Invalid Call: "+q+" is not allowed.");return}}var L=c.functionArgs;Array.isArray(L)||(L=[]);if(x.isAsync)L.push(function(){k(Array.prototype.slice.apply(arguments))}),L.push(function(V){k(null,V||"Unkown Error")}),this[q].apply(this,L);else{var Q=this[q].apply(this,L);k([Q])}}else k(null,"Invalid Call: "+q+" is not found.")}catch(V){k(null,"Invalid Call: An error occurred, "+V.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var k=window.indexedDB||-window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var q=k.open("database",2);q.onupgradeneeded=function(x){try{var B=q.result;1>x.oldVersion&&B.createObjectStore("objects",{keyPath:"key"});2>x.oldVersion&&(B.createObjectStore("files",{keyPath:"title"}),B.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(E){null!=f&&f(E)}};q.onsuccess=mxUtils.bind(this,function(x){try{var B=q.result;this.database=B;EditorUi.migrateStorageFiles&&(StorageFile.migrate(B),+c;for(var f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,k=this.remoteInvokeCallbacks[f.callbackId];if(null==k)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?k.error&&k.error(c.error.errResp):k.callback&&k.callback.apply(this,c.resp);this.remoteInvokeCallbacks[f.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,f,k,q,x){var C=+!0,E=window.setTimeout(mxUtils.bind(this,function(){C=!1;x({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),L=mxUtils.bind(this,function(){window.clearTimeout(E);C&&q.apply(this,arguments)}),Q=mxUtils.bind(this,function(){window.clearTimeout(E);C&&x.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:L,error:Q});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:k});null!=this.remoteWin?+this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,f){var k=mxUtils.bind(this,function(V,K){var fa={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=K?fa.error={errResp:K}:null!=V&&(fa.resp=V);this.remoteWin.postMessage(JSON.stringify(fa),"*")});try{var q=c.funtionName,x=this.remoteInvokableFns[q];if(null!=x&&"function"===typeof this[q]){if(x.allowedDomains){for(var C=!1,E=0;E<x.allowedDomains.length;E++)if(f=="https://"+x.allowedDomains[E]){C=+!0;break}if(!C){k(null,"Invalid Call: "+q+" is not allowed.");return}}var L=c.functionArgs;Array.isArray(L)||(L=[]);if(x.isAsync)L.push(function(){k(Array.prototype.slice.apply(arguments))}),L.push(function(V){k(null,V||"Unkown Error")}),this[q].apply(this,L);else{var Q=this[q].apply(this,L);k([Q])}}else k(null,"Invalid Call: "+q+" is not found.")}catch(V){k(null,"Invalid Call: An error occurred, "+V.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var k=window.indexedDB||+window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var q=k.open("database",2);q.onupgradeneeded=function(x){try{var C=q.result;1>x.oldVersion&&C.createObjectStore("objects",{keyPath:"key"});2>x.oldVersion&&(C.createObjectStore("files",{keyPath:"title"}),C.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(E){null!=f&&f(E)}};q.onsuccess=mxUtils.bind(this,function(x){try{var C=q.result;this.database=C;EditorUi.migrateStorageFiles&&(StorageFile.migrate(C),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(E){if((!E||"1"==urlParams.forceMigration)&&"1"==urlParams.forceMigration){var L=document.createElement("iframe");L.style.display="none";L.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(L);var Q=!0,V=!1,K,fa=0,aa=mxUtils.bind(this,function(){V=!0;this.setDatabaseItem(".drawioMigrated3",!0);L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),da=mxUtils.bind(this,function(){fa++;ba()}),ba=mxUtils.bind(this,function(){try{if(fa>=K.length)aa();else{var qa=K[fa];StorageFile.getFileContent(this,qa,mxUtils.bind(this,function(ra){null==ra||".scratchpad"==qa&&ra==this.emptyLibraryXml?L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[qa]}),"*"):da()}),da)}}catch(ra){console.log(ra)}}),ha=mxUtils.bind(this,function(qa){try{this.setDatabaseItem(null,[{title:qa.title,size:qa.data.length,lastModified:Date.now(),type:qa.isLib?"L":"F"},{title:qa.title,data:qa.data}],da,da,["filesInfo","files"])}catch(ra){console.log(ra)}});E=mxUtils.bind(this,function(qa){try{if(qa.source==L.contentWindow){var ra={};try{ra=JSON.parse(qa.data)}catch(l){}"init"==ra.event?(L.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),-"*"),L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=ra.event||V||(Q?null!=ra.resp&&0<ra.resp.length&&null!=ra.resp[0]?(K=ra.resp[0],Q=!1,ba()):aa():null!=ra.resp&&0<ra.resp.length&&null!=ra.resp[0]?ha(ra.resp[0]):da())}}catch(l){console.log(l)}});window.addEventListener("message",E)}})));c(B);B.onversionchange=function(){B.close()}}catch(E){null!=f?f(E):null!=window.console&&console.warn(E)}});q.onerror=f;q.onblocked=-function(){}}catch(x){null!=f?f(x):null!=window.console&&console.error(x)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,f,k,q,x){this.openDatabase(mxUtils.bind(this,function(B){try{x=x||"objects";Array.isArray(x)||(x=[x],c=[c],f=[f]);var E=B.transaction(x,"readwrite");E.oncomplete=k;E.onerror=q;for(B=0;B<x.length;B++)E.objectStore(x[B]).put(null!=c&&null!=c[B]?{key:c[B],data:f[B]}:f[B])}catch(L){null!=q&&q(L)}}),q)};EditorUi.prototype.removeDatabaseItem=-function(c,f,k,q){this.openDatabase(mxUtils.bind(this,function(x){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c]);var B=x.transaction(q,"readwrite");B.oncomplete=f;B.onerror=k;for(x=0;x<q.length;x++)B.objectStore(q[x]).delete(c[x])}catch(E){null!=k&&k(E)}}),k)};EditorUi.prototype.getDatabaseItem=function(c,f,k,q){this.openDatabase(mxUtils.bind(this,function(x){try{q=q||"objects";var B=x.transaction([q],"readonly").objectStore(q).get(c);B.onsuccess=function(){f(B.result)};B.onerror=k}catch(E){null!=-k&&k(E)}}),k)};EditorUi.prototype.getDatabaseItems=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(q){try{k=k||"objects";var x=q.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),B=[];x.onsuccess=function(E){null==E.target.result?c(B):(B.push(E.target.result.value),E.target.result.continue())};x.onerror=f}catch(E){null!=f&&f(E)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(q){try{k=k||"objects";-var x=q.transaction([k],"readonly").objectStore(k).getAllKeys();x.onsuccess=function(){c(x.result)};x.onerror=f}catch(B){null!=f&&f(B)}}),f)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};+"*"),L.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=ra.event||V||(Q?null!=ra.resp&&0<ra.resp.length&&null!=ra.resp[0]?(K=ra.resp[0],Q=!1,ba()):aa():null!=ra.resp&&0<ra.resp.length&&null!=ra.resp[0]?ha(ra.resp[0]):da())}}catch(l){console.log(l)}});window.addEventListener("message",E)}})));c(C);C.onversionchange=function(){C.close()}}catch(E){null!=f?f(E):null!=window.console&&console.warn(E)}});q.onerror=f;q.onblocked=+function(){}}catch(x){null!=f?f(x):null!=window.console&&console.error(x)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,f,k,q,x){this.openDatabase(mxUtils.bind(this,function(C){try{x=x||"objects";Array.isArray(x)||(x=[x],c=[c],f=[f]);var E=C.transaction(x,"readwrite");E.oncomplete=k;E.onerror=q;for(C=0;C<x.length;C++)E.objectStore(x[C]).put(null!=c&&null!=c[C]?{key:c[C],data:f[C]}:f[C])}catch(L){null!=q&&q(L)}}),q)};EditorUi.prototype.removeDatabaseItem=+function(c,f,k,q){this.openDatabase(mxUtils.bind(this,function(x){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c]);var C=x.transaction(q,"readwrite");C.oncomplete=f;C.onerror=k;for(x=0;x<q.length;x++)C.objectStore(q[x]).delete(c[x])}catch(E){null!=k&&k(E)}}),k)};EditorUi.prototype.getDatabaseItem=function(c,f,k,q){this.openDatabase(mxUtils.bind(this,function(x){try{q=q||"objects";var C=x.transaction([q],"readonly").objectStore(q).get(c);C.onsuccess=function(){f(C.result)};C.onerror=k}catch(E){null!=+k&&k(E)}}),k)};EditorUi.prototype.getDatabaseItems=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(q){try{k=k||"objects";var x=q.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),C=[];x.onsuccess=function(E){null==E.target.result?c(C):(C.push(E.target.result.value),E.target.result.continue())};x.onerror=f}catch(E){null!=f&&f(E)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,k){this.openDatabase(mxUtils.bind(this,function(q){try{k=k||"objects";+var x=q.transaction([k],"readonly").objectStore(k).getAllKeys();x.onsuccess=function(){c(x.result)};x.onerror=f}catch(C){null!=f&&f(C)}}),f)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(c,f){var k=this.getCurrentFile();null!=k?k.getComments(c,f):c([])};EditorUi.prototype.addComment=function(c,f,k){var q=this.getCurrentFile();null!=q?q.addComment(c,f,k):f(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.newComment=function(c,f){var k=this.getCurrentFile();return null!=k?k.newComment(c,f):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,f){var k=this.getCurrentFile();null!=k&&k.getRevisions?k.getRevisions(c,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==-DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,k,q,x,B,E,L){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,k,q,x,B,E,L)};EditorUi.prototype.loadFonts=+DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,k,q,x,C,E,L){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,k,q,x,C,E,L)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};-EditorUi.prototype.exportToCanvas=function(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba,ha){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,k,q,x,B,E,L,Q,V,K,fa,aa,da,ba,ha)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,k,q){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,+EditorUi.prototype.exportToCanvas=function(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba,ha){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,k,q,x,C,E,L,Q,V,K,fa,aa,da,ba,ha)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,k,q){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,k,q)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,f)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,f,k,q){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,k,q)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,k,q,x){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,f,k,q,x)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],f=0;f<localStorage.length;f++){var k=localStorage.key(f),q=localStorage.getItem(k);if(0<k.length&&(".scratchpad"==k||"."!=k.charAt(0))&&0<q.length){var x="<mxfile "===q.substring(0,8)||"<?xml"===q.substring(0,5)||"\x3c!--[if IE]>"===q.substring(0,12);q="<mxlibrary>"===q.substring(0,11);(x||q)&&c.push(k)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var f=localStorage.getItem(c);return{title:c,data:f,isLib:"<mxlibrary>"===f.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();-var CommentsWindow=function(b,d,m,p,v,n){function y(){for(var ba=E.getElementsByTagName("div"),ha=0,qa=0;qa<ba.length;qa++)"none"!=ba[qa].style.display&&ba[qa].parentNode==E&&ha++;L.style.display=0==ha?"block":"none"}function C(ba,ha,qa,ra){function l(){ha.removeChild(J);ha.removeChild(R);H.style.display="block";t.style.display="block"}q={div:ha,comment:ba,saveCallback:qa,deleteOnCancel:ra};var t=ha.querySelector(".geCommentTxt"),H=ha.querySelector(".geCommentActionsList"),J=document.createElement("textarea");+var CommentsWindow=function(b,d,m,p,u,n){function y(){for(var ba=E.getElementsByTagName("div"),ha=0,qa=0;qa<ba.length;qa++)"none"!=ba[qa].style.display&&ba[qa].parentNode==E&&ha++;L.style.display=0==ha?"block":"none"}function B(ba,ha,qa,ra){function l(){ha.removeChild(J);ha.removeChild(R);H.style.display="block";t.style.display="block"}q={div:ha,comment:ba,saveCallback:qa,deleteOnCancel:ra};var t=ha.querySelector(".geCommentTxt"),H=ha.querySelector(".geCommentActionsList"),J=document.createElement("textarea");J.className="geCommentEditTxtArea";J.style.minHeight=t.offsetHeight+"px";J.value=ba.content;ha.insertBefore(J,t);var R=document.createElement("div");R.className="geCommentEditBtns";var T=mxUtils.button(mxResources.get("cancel"),function(){ra?(ha.parentNode.removeChild(ha),y()):l();q=null});T.className="geCommentEditBtn";R.appendChild(T);var Y=mxUtils.button(mxResources.get("save"),function(){t.innerText="";ba.content=J.value;mxUtils.write(t,ba.content);l();qa(ba);q=null});mxEvent.addListener(J,"keydown",mxUtils.bind(this,function(Z){mxEvent.isConsumed(Z)||((mxEvent.isControlDown(Z)||mxClient.IS_MAC&&mxEvent.isMetaDown(Z))&&13==Z.keyCode?(Y.click(),mxEvent.consume(Z)):27==Z.keyCode&&(T.click(),mxEvent.consume(Z)))}));Y.focus();Y.className="geCommentEditBtn gePrimaryBtn";R.appendChild(Y);ha.insertBefore(R,t);H.style.display="none";t.style.display="none";J.focus()}function P(ba,ha){ha.innerText="";ba=new Date(ba.modifiedDate);var qa=b.timeSince(ba);null==qa&&(qa=mxResources.get("lessThanAMinute"));-mxUtils.write(ha,mxResources.get("timeAgo",[qa],"{1} ago"));ha.setAttribute("title",ba.toLocaleDateString()+" "+ba.toLocaleTimeString())}function G(ba){var ha=document.createElement("img");ha.className="geCommentBusyImg";ha.src=IMAGE_PATH+"/spin.gif";ba.appendChild(ha);ba.busyImg=ha}function O(ba){ba.style.border="1px solid red";ba.busyImg.parentNode==ba&&ba.removeChild(ba.busyImg)}function U(ba){ba.style.border="";ba.busyImg.parentNode==ba&&ba.removeChild(ba.busyImg)}function c(ba,ha,qa,ra,l){function t(ka,-X,ja){var na=document.createElement("li");na.className="geCommentAction";var la=document.createElement("a");la.className="geCommentActionLnk";mxUtils.write(la,ka);na.appendChild(la);mxEvent.addListener(la,"click",function(va){X(va,ba);va.preventDefault();mxEvent.consume(va)});ia.appendChild(na);ja&&(na.style.display="none")}function H(){function ka(na){X.push(ja);if(null!=na.replies)for(var la=0;la<na.replies.length;la++)ja=ja.nextSibling,ka(na.replies[la])}var X=[],ja=R;ka(ba);return{pdiv:ja,replies:X}}-function J(ka,X,ja,na,la){function va(){G(Ca);ba.addReply(wa,function(Fa){wa.id=Fa;ba.replies.push(wa);U(Ca);ja&&ja()},function(Fa){za();O(Ca);b.handleError(Fa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},na,la)}function za(){C(wa,Ca,function(Fa){va()},!0)}var sa=H().pdiv,wa=b.newComment(ka,b.getCurrentUser());wa.pCommentId=ba.id;null==ba.replies&&(ba.replies=[]);var Ca=c(wa,ba.replies,sa,ra+1);X?za():va()}if(l||!ba.isResolved){L.style.display="none";var R=document.createElement("div");+mxUtils.write(ha,mxResources.get("timeAgo",[qa],"{1} ago"));ha.setAttribute("title",ba.toLocaleDateString()+" "+ba.toLocaleTimeString())}function G(ba){var ha=document.createElement("img");ha.className="geCommentBusyImg";ha.src=IMAGE_PATH+"/spin.gif";ba.appendChild(ha);ba.busyImg=ha}function O(ba){ba.style.border="1px solid red";ba.busyImg.parentNode==ba&&ba.removeChild(ba.busyImg)}function U(ba){ba.style.border="";ba.busyImg.parentNode==ba&&ba.removeChild(ba.busyImg)}function c(ba,ha,qa,ra,l){function t(ja,+X,ka){var na=document.createElement("li");na.className="geCommentAction";var la=document.createElement("a");la.className="geCommentActionLnk";mxUtils.write(la,ja);na.appendChild(la);mxEvent.addListener(la,"click",function(ua){X(ua,ba);ua.preventDefault();mxEvent.consume(ua)});ia.appendChild(na);ka&&(na.style.display="none")}function H(){function ja(na){X.push(ka);if(null!=na.replies)for(var la=0;la<na.replies.length;la++)ka=ka.nextSibling,ja(na.replies[la])}var X=[],ka=R;ja(ba);return{pdiv:ka,replies:X}}+function J(ja,X,ka,na,la){function ua(){G(Ca);ba.addReply(wa,function(Fa){wa.id=Fa;ba.replies.push(wa);U(Ca);ka&&ka()},function(Fa){za();O(Ca);b.handleError(Fa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},na,la)}function za(){B(wa,Ca,function(Fa){ua()},!0)}var sa=H().pdiv,wa=b.newComment(ja,b.getCurrentUser());wa.pCommentId=ba.id;null==ba.replies&&(ba.replies=[]);var Ca=c(wa,ba.replies,sa,ra+1);X?za():ua()}if(l||!ba.isResolved){L.style.display="none";var R=document.createElement("div");R.className="geCommentContainer";R.setAttribute("data-commentId",ba.id);R.style.marginLeft=20*ra+5+"px";ba.isResolved&&(x.style.opacity="0.7");var T=document.createElement("div");T.className="geCommentHeader";var Y=document.createElement("img");Y.className="geCommentUserImg";Y.src=null!=ba.user&&null!=ba.user.pictureUrl?ba.user.pictureUrl:Editor.userImage;T.appendChild(Y);Y=document.createElement("div");Y.className="geCommentHeaderTxt";T.appendChild(Y);var Z=document.createElement("div");Z.className="geCommentUsername";mxUtils.write(Z,null!=ba.user?ba.user.displayName:mxResources.get("unknownUser"));Y.appendChild(Z);Z=document.createElement("div");Z.className="geCommentDate";Z.setAttribute("data-commentId",ba.id);P(ba,Z);Y.appendChild(Z);R.appendChild(T);T=document.createElement("div");T.className="geCommentTxt";mxUtils.write(T,ba.content||"");R.appendChild(T);ba.isLocked&&(R.style.opacity="0.5");T=document.createElement("div");T.className="geCommentActions";var ia=document.createElement("ul");-ia.className="geCommentActionsList";T.appendChild(ia);f||ba.isLocked||0!=ra&&!k||t(mxResources.get("reply"),function(){J("",!0)},ba.isResolved);Y=b.getCurrentUser();null==Y||null==ba.user||Y.id!=ba.user.id||f||ba.isLocked||(t(mxResources.get("edit"),function(){function ka(){C(ba,R,function(){G(R);ba.editComment(ba.content,function(){U(R)},function(X){O(R);ka();b.handleError(X,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}ka()},ba.isResolved),t(mxResources.get("delete"),-function(){b.confirm(mxResources.get("areYouSure"),function(){G(R);ba.deleteComment(function(ka){if(!0===ka){ka=R.querySelector(".geCommentTxt");ka.innerText="";mxUtils.write(ka,mxResources.get("msgDeleted"));var X=R.querySelectorAll(".geCommentAction");for(ka=0;ka<X.length;ka++)X[ka].parentNode.removeChild(X[ka]);U(R);R.style.opacity="0.5"}else{X=H(ba).replies;for(ka=0;ka<X.length;ka++)E.removeChild(X[ka]);for(ka=0;ka<ha.length;ka++)if(ha[ka]==ba){ha.splice(ka,1);break}L.style.display=0==E.getElementsByTagName("div").length?-"block":"none"}},function(ka){O(R);b.handleError(ka,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},ba.isResolved));f||ba.isLocked||0!=ra||t(ba.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(ka){function X(){var ja=ka.target;ja.innerText="";ba.isResolved=!ba.isResolved;mxUtils.write(ja,ba.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var na=ba.isResolved?"none":"",la=H(ba).replies,va="light-dark("+(ba.isResolved?"ghostWhite":-"white")+", transparent)",za=0;za<la.length;za++){la[za].style.backgroundColor=va;for(var sa=la[za].querySelectorAll(".geCommentAction"),wa=0;wa<sa.length;wa++)sa[wa]!=ja.parentNode&&(sa[wa].style.display=na);fa||(la[za].style.display="none")}y()}ba.isResolved?J(mxResources.get("reOpened")+": ",!0,X,!1,!0):J(mxResources.get("markedAsResolved"),!1,X,!0)});R.appendChild(T);null!=qa?E.insertBefore(R,qa.nextSibling):E.appendChild(R);for(qa=0;null!=ba.replies&&qa<ba.replies.length;qa++)T=ba.replies[qa],-T.isResolved=ba.isResolved,c(T,ba.replies,null,ra+1,l);null!=q&&(q.comment.id==ba.id?(l=ba.content,ba.content=q.comment.content,C(ba,R,q.saveCallback,q.deleteOnCancel),ba.content=l):null==q.comment.id&&q.comment.pCommentId==ba.id&&(E.appendChild(q.div),C(q.comment,q.div,q.saveCallback,q.deleteOnCancel)));return R}}var f=!b.canComment(),k=b.canReplyToReplies(),q=null,x=document.createElement("div");x.className="geCommentsWin";var B=EditorUi.compactUi?"26px":"30px",E=document.createElement("div");E.className=-"geCommentsList";E.style.bottom=parseInt(B)+7+"px";x.appendChild(E);var L=document.createElement("span");L.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(L,mxResources.get("noCommentsFound"));var Q=document.createElement("div");Q.className="geToolbarContainer geCommentsToolbar";Q.style.height=B;Q.style.padding="3px 4px 4px 4px";B=document.createElement("a");B.className="geButton";if(!f){var V=B.cloneNode();V.style.backgroundImage="url("+Editor.plusImage+")";V.setAttribute("title",-mxResources.get("create")+"...");mxEvent.addListener(V,"click",function(ba){function ha(){C(qa,ra,function(l){G(ra);b.addComment(l,function(t){l.id=t;aa.push(l);U(ra)},function(t){O(ra);ha();b.handleError(t,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var qa=b.newComment("",b.getCurrentUser()),ra=c(qa,aa,null,0);ha();ba.preventDefault();mxEvent.consume(ba)});Q.appendChild(V)}var K=B.cloneNode();K.style.backgroundImage="url("+Editor.checkImage+")";K.setAttribute("title",-mxResources.get("showResolved"));var fa=!1;mxEvent.addListener(K,"click",function(ba){(fa=!fa)?K.classList.add("geActiveItem"):K.classList.remove("geActiveItem");da();ba.preventDefault();mxEvent.consume(ba)});Q.appendChild(K);b.commentsRefreshNeeded()&&(V=B.cloneNode(),V.style.backgroundImage="url("+Editor.refreshImage+")",V.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(V,"click",function(ba){da();ba.preventDefault();mxEvent.consume(ba)}),Q.appendChild(V));b.commentsSaveNeeded()&&-(B=B.cloneNode(),B.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',B.setAttribute("title",mxResources.get("save")),B.className="geButton geAdaptiveAsset",mxEvent.addListener(B,"click",function(ba){n();ba.preventDefault();mxEvent.consume(ba)}),Q.appendChild(B));x.appendChild(Q);var aa=[],da=mxUtils.bind(this,function(){this.hasError=!1;if(null!=q)try{q.div=q.div.cloneNode(!0);var ba=q.div.querySelector(".geCommentEditTxtArea"),ha=q.div.querySelector(".geCommentEditBtns");+ia.className="geCommentActionsList";T.appendChild(ia);f||ba.isLocked||0!=ra&&!k||t(mxResources.get("reply"),function(){J("",!0)},ba.isResolved);Y=b.getCurrentUser();null==Y||null==ba.user||Y.id!=ba.user.id||f||ba.isLocked||(t(mxResources.get("edit"),function(){function ja(){B(ba,R,function(){G(R);ba.editComment(ba.content,function(){U(R)},function(X){O(R);ja();b.handleError(X,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}ja()},ba.isResolved),t(mxResources.get("delete"),+function(){b.confirm(mxResources.get("areYouSure"),function(){G(R);ba.deleteComment(function(ja){if(!0===ja){ja=R.querySelector(".geCommentTxt");ja.innerText="";mxUtils.write(ja,mxResources.get("msgDeleted"));var X=R.querySelectorAll(".geCommentAction");for(ja=0;ja<X.length;ja++)X[ja].parentNode.removeChild(X[ja]);U(R);R.style.opacity="0.5"}else{X=H(ba).replies;for(ja=0;ja<X.length;ja++)E.removeChild(X[ja]);for(ja=0;ja<ha.length;ja++)if(ha[ja]==ba){ha.splice(ja,1);break}L.style.display=0==E.getElementsByTagName("div").length?+"block":"none"}},function(ja){O(R);b.handleError(ja,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},ba.isResolved));f||ba.isLocked||0!=ra||t(ba.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(ja){function X(){var ka=ja.target;ka.innerText="";ba.isResolved=!ba.isResolved;mxUtils.write(ka,ba.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var na=ba.isResolved?"none":"",la=H(ba).replies,ua="light-dark("+(ba.isResolved?"ghostWhite":+"white")+", transparent)",za=0;za<la.length;za++){la[za].style.backgroundColor=ua;for(var sa=la[za].querySelectorAll(".geCommentAction"),wa=0;wa<sa.length;wa++)sa[wa]!=ka.parentNode&&(sa[wa].style.display=na);fa||(la[za].style.display="none")}y()}ba.isResolved?J(mxResources.get("reOpened")+": ",!0,X,!1,!0):J(mxResources.get("markedAsResolved"),!1,X,!0)});R.appendChild(T);null!=qa?E.insertBefore(R,qa.nextSibling):E.appendChild(R);for(qa=0;null!=ba.replies&&qa<ba.replies.length;qa++)T=ba.replies[qa],+T.isResolved=ba.isResolved,c(T,ba.replies,null,ra+1,l);null!=q&&(q.comment.id==ba.id?(l=ba.content,ba.content=q.comment.content,B(ba,R,q.saveCallback,q.deleteOnCancel),ba.content=l):null==q.comment.id&&q.comment.pCommentId==ba.id&&(E.appendChild(q.div),B(q.comment,q.div,q.saveCallback,q.deleteOnCancel)));return R}}var f=!b.canComment(),k=b.canReplyToReplies(),q=null,x=document.createElement("div");x.className="geCommentsWin";var C=EditorUi.compactUi?"26px":"30px",E=document.createElement("div");E.className=+"geCommentsList";E.style.bottom=parseInt(C)+7+"px";x.appendChild(E);var L=document.createElement("span");L.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(L,mxResources.get("noCommentsFound"));var Q=document.createElement("div");Q.className="geToolbarContainer geCommentsToolbar";Q.style.height=C;Q.style.padding="3px 4px 4px 4px";C=document.createElement("a");C.className="geButton";if(!f){var V=C.cloneNode();V.style.backgroundImage="url("+Editor.plusImage+")";V.setAttribute("title",+mxResources.get("create")+"...");mxEvent.addListener(V,"click",function(ba){function ha(){B(qa,ra,function(l){G(ra);b.addComment(l,function(t){l.id=t;aa.push(l);U(ra)},function(t){O(ra);ha();b.handleError(t,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var qa=b.newComment("",b.getCurrentUser()),ra=c(qa,aa,null,0);ha();ba.preventDefault();mxEvent.consume(ba)});Q.appendChild(V)}var K=C.cloneNode();K.style.backgroundImage="url("+Editor.checkImage+")";K.setAttribute("title",+mxResources.get("showResolved"));var fa=!1;mxEvent.addListener(K,"click",function(ba){(fa=!fa)?K.classList.add("geActiveItem"):K.classList.remove("geActiveItem");da();ba.preventDefault();mxEvent.consume(ba)});Q.appendChild(K);b.commentsRefreshNeeded()&&(V=C.cloneNode(),V.style.backgroundImage="url("+Editor.refreshImage+")",V.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(V,"click",function(ba){da();ba.preventDefault();mxEvent.consume(ba)}),Q.appendChild(V));b.commentsSaveNeeded()&&+(C=C.cloneNode(),C.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',C.setAttribute("title",mxResources.get("save")),C.className="geButton geAdaptiveAsset",mxEvent.addListener(C,"click",function(ba){n();ba.preventDefault();mxEvent.consume(ba)}),Q.appendChild(C));x.appendChild(Q);var aa=[],da=mxUtils.bind(this,function(){this.hasError=!1;if(null!=q)try{q.div=q.div.cloneNode(!0);var ba=q.div.querySelector(".geCommentEditTxtArea"),ha=q.div.querySelector(".geCommentEditBtns");q.comment.content=ba.value;ba.parentNode.removeChild(ba);ha.parentNode.removeChild(ha)}catch(qa){b.handleError(qa)}E.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";k=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(qa){function ra(l){if(null!=l){l.sort(function(H,J){return new Date(H.modifiedDate)-new Date(J.modifiedDate)});for(var t=0;t<l.length;t++)ra(l[t].replies)}}-qa.sort(function(l,t){return new Date(l.modifiedDate)-new Date(t.modifiedDate)});E.innerText="";E.appendChild(L);L.style.display="block";aa=qa;for(qa=0;qa<aa.length;qa++)ra(aa[qa].replies),c(aa[qa],aa,null,0,fa);null!=q&&null==q.comment.id&&null==q.comment.pCommentId&&(E.appendChild(q.div),C(q.comment,q.div,q.saveCallback,q.deleteOnCancel))},mxUtils.bind(this,function(qa){E.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(qa&&qa.message?": "+qa.message:""));this.hasError=!0})):E.innerHTML=+qa.sort(function(l,t){return new Date(l.modifiedDate)-new Date(t.modifiedDate)});E.innerText="";E.appendChild(L);L.style.display="block";aa=qa;for(qa=0;qa<aa.length;qa++)ra(aa[qa].replies),c(aa[qa],aa,null,0,fa);null!=q&&null==q.comment.id&&null==q.comment.pCommentId&&(E.appendChild(q.div),B(q.comment,q.div,q.saveCallback,q.deleteOnCancel))},mxUtils.bind(this,function(qa){E.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(qa&&qa.message?": "+qa.message:""));this.hasError=!0})):E.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});da();this.refreshComments=da;Q=mxUtils.bind(this,function(){function ba(t){var H=qa[t.id];if(null!=H)for(P(t,H),H=0;null!=t.replies&&H<t.replies.length;H++)ba(t.replies[H])}if(this.window.isVisible()){for(var ha=E.querySelectorAll(".geCommentDate"),qa={},ra=0;ra<ha.length;ra++){var l=ha[ra];qa[l.getAttribute("data-commentId")]=l}for(ra=0;ra<aa.length;ra++)ba(aa[ra])}});setInterval(Q,6E4);this.refreshCommentsTime=Q;this.window=new mxWindow(mxResources.get("comments"),-x,d,m,p,v,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,d,m,p,v,n,y,C,P,G,O){var U=document.createElement("div");U.style.textAlign="center";O=null!=O?O:44;var c=document.createElement("div");c.style.padding=+x,d,m,p,u,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,d,m,p,u,n,y,B,P,G,O){var U=document.createElement("div");U.style.textAlign="center";O=null!=O?O:44;var c=document.createElement("div");c.style.padding="6px";c.style.overflow="auto";c.style.maxHeight=O+"px";c.style.lineHeight="1.2em";mxUtils.write(c,d);U.appendChild(c);null!=G&&(c=document.createElement("div"),c.style.padding="6px 0 6px 0",d=document.createElement("img"),d.setAttribute("src",G),c.appendChild(d),U.appendChild(c));G=document.createElement("div");G.style.textAlign="center";G.style.whiteSpace="nowrap";var f=document.createElement("input");f.setAttribute("type","checkbox");n=mxUtils.button(n||mxResources.get("cancel"),function(){b.hideDialog();-null!=p&&p(f.checked)});n.className="geBtn";null!=C&&(n.innerHTML=C+"<br>"+n.innerHTML,n.style.display="inline-block",n.style.paddingBottom="8px",n.style.paddingTop="8px",n.style.height="auto",n.style.width="40%");b.editor.cancelFirst&&G.appendChild(n);var k=mxUtils.button(v||mxResources.get("ok"),function(){b.hideDialog();null!=m&&m(f.checked)});G.appendChild(k);null!=y?(k.innerHTML=y+"<br>"+k.innerHTML+"<br>",k.style.display="inline-block",k.style.paddingBottom="8px",k.style.paddingTop="8px",k.style.height=-"auto",k.className="geBtn",k.style.width="40%"):k.className="geBtn gePrimaryBtn";b.editor.cancelFirst||G.appendChild(n);U.appendChild(G);P?(G.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom="0px",c.appendChild(f),v=document.createElement("span"),mxUtils.write(v," "+mxResources.get("rememberThisSetting")),c.appendChild(v),U.appendChild(c),mxEvent.addListener(v,"click",function(q){f.checked=!f.checked;mxEvent.consume(q)})):G.style.marginTop="12px";+null!=p&&p(f.checked)});n.className="geBtn";null!=B&&(n.innerHTML=B+"<br>"+n.innerHTML,n.style.display="inline-block",n.style.paddingBottom="8px",n.style.paddingTop="8px",n.style.height="auto",n.style.width="40%");b.editor.cancelFirst&&G.appendChild(n);var k=mxUtils.button(u||mxResources.get("ok"),function(){b.hideDialog();null!=m&&m(f.checked)});G.appendChild(k);null!=y?(k.innerHTML=y+"<br>"+k.innerHTML+"<br>",k.style.display="inline-block",k.style.paddingBottom="8px",k.style.paddingTop="8px",k.style.height=+"auto",k.className="geBtn",k.style.width="40%"):k.className="geBtn gePrimaryBtn";b.editor.cancelFirst||G.appendChild(n);U.appendChild(G);P?(G.style.marginTop="10px",c=document.createElement("p"),c.style.marginTop="20px",c.style.marginBottom="0px",c.appendChild(f),u=document.createElement("span"),mxUtils.write(u," "+mxResources.get("rememberThisSetting")),c.appendChild(u),U.appendChild(c),mxEvent.addListener(u,"click",function(q){f.checked=!f.checked;mxEvent.consume(q)})):G.style.marginTop="12px";this.init=function(){k.focus()};this.container=U},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};HeadlessEditorUi.prototype.addTrees=function(){};HeadlessEditorUi.prototype.onBeforeUnload=function(){};HeadlessEditorUi.prototype.updateActionStates=function(){};function DiagramPage(b,d){this.node=b;null!=d?this.node.setAttribute("id",d):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.diagramModified=!1;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};-DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("name"):this.node.setAttribute("name",b)};DiagramPage.prototype.getViewBox=function(){var b=this.node.getAttribute("viewBox");if(null!=b){var d=b.split(" ");b=parseFloat(d[0]);var m=parseFloat(d[1]),p=parseFloat(d[2]),v=parseFloat(d[3]);d=4<d.length?parseFloat(d[4]):null;if(isFinite(b)&&isFinite(m)&&isFinite(p)&&isFinite(v)&&0<p&&0<v)return{x:b,y:m,width:p,height:v,scale:null!=d&&isFinite(d)&&0<d?d:null}}return null};+DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("name"):this.node.setAttribute("name",b)};DiagramPage.prototype.getViewBox=function(){var b=this.node.getAttribute("viewBox");if(null!=b){var d=b.split(" ");b=parseFloat(d[0]);var m=parseFloat(d[1]),p=parseFloat(d[2]),u=parseFloat(d[3]);d=4<d.length?parseFloat(d[4]):null;if(isFinite(b)&&isFinite(m)&&isFinite(p)&&isFinite(u)&&0<p&&0<u)return{x:b,y:m,width:p,height:u,scale:null!=d&&isFinite(d)&&0<d?d:null}}return null};DiagramPage.prototype.setViewBox=function(b){if(null==b)this.node.removeAttribute("viewBox");else{var d=b.x+" "+b.y+" "+b.width+" "+b.height;null!=b.scale&&(d+=" "+b.scale);this.node.setAttribute("viewBox",d)}};DiagramPage.prototype.setDiagramModified=function(b){this.diagramModified=b};DiagramPage.prototype.isDiagramModified=function(){return this.diagramModified};function RenamePage(b,d,m){this.ui=b;this.page=d;this.previous=this.name=m}RenamePage.prototype.execute=function(){var b=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function ChangePageView(b,d,m){this.ui=b;this.page=d;this.previous=this.viewBox=m}ChangePageView.prototype.execute=function(){var b=this.page.getViewBox();this.page.setViewBox(this.previous);this.viewBox=this.previous;this.previous=b;this.ui.editor.fireEvent(new mxEventObject("pageViewChanged"))};function MovePage(b,d,m){this.ui=b;this.oldIndex=d;this.newIndex=m}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var b=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};function SelectPage(b,d,m){this.ui=b;this.previousPage=this.page=d;null!=d&&(this.ui.updatePageRoot(d),null!=m&&(d.viewState=m))}SelectPage.prototype.execute=function(){var b=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=b){b=this.ui.currentPage;var d=this.ui.editor,m=d.graph;b.isDiagramModified()&&(b.setDiagramModified(!1),EditorUi.removeChildNodes(b.node),b.node.appendChild(d.getGraphXml(!0)));b.viewState=m.getViewState();b.root=m.model.root;null!=b.model&&b.model.rootChanged(b.root);m.view.clear(b.root,!0);m.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=b;b=this.ui.currentPage;-m.model.prefix=Editor.guid()+"-";m.model.rootChanged(b.root);m.setViewState(b.viewState);m.gridEnabled=m.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);d.graph.fireEvent(new mxEventObject(mxEvent.ROOT));d.fireEvent(new mxEventObject("pageSelected","change",this))}};function ChangePage(b,d,m,p,v){SelectPage.call(this,b,m);this.relatedPage=d;this.index=p;this.previousIndex=null;this.noSelect=v}mxUtils.extend(ChangePage,SelectPage);+m.model.prefix=Editor.guid()+"-";m.model.rootChanged(b.root);m.setViewState(b.viewState);m.gridEnabled=m.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);d.graph.fireEvent(new mxEventObject(mxEvent.ROOT));d.fireEvent(new mxEventObject("pageSelected","change",this))}};function ChangePage(b,d,m,p,u){SelectPage.call(this,b,m);this.relatedPage=d;this.index=p;this.previousIndex=null;this.noSelect=u}mxUtils.extend(ChangePage,SelectPage);ChangePage.prototype.execute=function(){this.ui.editor.fireEvent(new mxEventObject("beforePageChange","change",this));this.previousIndex=this.index;if(null==this.index){var b=mxUtils.indexOf(this.ui.pages,this.relatedPage);this.ui.pages.splice(b,1);this.index=b}else this.ui.pages.splice(this.index,0,this.relatedPage),this.index=null;this.noSelect||SelectPage.prototype.execute.apply(this,arguments)};function ReplaceDiagram(b,d){this.ui=b;this.data=d}ReplaceDiagram.prototype.execute=function(){var b=this.ui.editor.graph,d=this.ui.editor.getGraphXml();this.ui.editor.readGraphState(this.data);this.ui.editor.updateGraphComponents();var m=new mxCodec(this.data.ownerDocument),p=new mxGraphModel;m.decode(this.data,p);this.data=d;this.ui.currentPage&&(this.ui.currentPage.viewState=b.getViewState(),this.ui.currentPage.root=p.root,null!=this.ui.currentPage.model&&this.ui.currentPage.model.rootChanged(this.ui.currentPage.model.root));b.view.clear(b.model.root,!0);b.model.rootChanged(p.root);b.fireEvent(new mxEventObject(mxEvent.ROOT))};EditorUi.prototype.tabContainerVisible=!0;EditorUi.prototype.setTabContainerVisible=function(b,d){Editor.isSettingsEnabled()&&d&&(mxSettings.settings.pages=b,mxSettings.save());this.tabContainerVisible=b;this.updateTabContainer()};EditorUi.prototype.isTabContainerVisible=function(){return this.tabContainerVisible};EditorUi.prototype.getSelectedPageIndex=function(){return this.getPageIndex(this.currentPage)};EditorUi.prototype.getPageIndex=function(b){var d=null;if(null!=this.pages&&null!=b)for(var m=0;m<this.pages.length;m++)if(this.pages[m]==b){d=m;break}return d};EditorUi.prototype.getPageById=function(b,d){d=null!=d?d:this.pages;if(null!=d)for(var m=0;m<d.length;m++)if(d[m].getId()==b)return d[m];return null};-EditorUi.prototype.createImageForPageLink=function(b,d,m,p){var v=b.indexOf(","),n=null;0<v&&(v=this.getPageById(b.substring(v+1)),null!=v&&v!=d&&(n=this.getImageForPage(v,d,m,p),n.originalSrc=b));null==n&&(n={originalSrc:b});return n};+EditorUi.prototype.createImageForPageLink=function(b,d,m,p){var u=b.indexOf(","),n=null;0<u&&(u=this.getPageById(b.substring(u+1)),null!=u&&u!=d&&(n=this.getImageForPage(u,d,m,p),n.originalSrc=b));null==n&&(n={originalSrc:b});return n};EditorUi.prototype.pageSelected=function(){var b=this.editor.graph,d=this.currentPage;null!=d&&(b.tooltipHandler.hide(),null==d.viewState||null==d.viewState.scrollTop||null==d.viewState.scrollLeft?(b.selectUnlockedLayer(),this.resetScrollbars(),b.isLightboxView()?this.lightboxFit():Editor.fitDiagramOnPage&&this.fitInitialView(),null!=this.chromelessResize&&(b.container.scrollleft=0,b.container.scrollTop=0,this.chromelessResize())):b.setScrollbarPositions(d.viewState,b.view.translate.x,b.view.translate.y),this.updateTabContainer())};-EditorUi.prototype.getImageForPage=function(b,d,m,p){m=null!=m?m:this.editor.graph;var v=m.getGlobalVariable;m=this.createTemporaryGraph(m.getStylesheet());var n=this.getPageIndex(null!=d?d:this.currentPage);m.getGlobalVariable=function(C){return"pagenumber"==C?n+1:"page"==C&&null!=d?d.getName():v.apply(this,arguments)};document.body.appendChild(m.container);this.updatePageRoot(b);m.setAdaptiveColors(b.viewState.adaptiveColors);m.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText=+EditorUi.prototype.getImageForPage=function(b,d,m,p){m=null!=m?m:this.editor.graph;var u=m.getGlobalVariable;m=this.createTemporaryGraph(m.getStylesheet());var n=this.getPageIndex(null!=d?d:this.currentPage);m.getGlobalVariable=function(B){return"pagenumber"==B?n+1:"page"==B&&null!=d?d.getName():u.apply(this,arguments)};document.body.appendChild(m.container);this.updatePageRoot(b);m.setAdaptiveColors(b.viewState.adaptiveColors);m.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText="";p=m.getSvg(null,null,null,null,null,null,null,null,null,null,p,null,null,null,!0,!0);var y=m.getGraphBounds();document.body.removeChild(m.container);Graph.foreignObjectWarningText=b;return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(p)),y.width,y.height,y.x,y.y)};EditorUi.prototype.initPages=function(){if(!this.editor.graph.standalone){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.isPagesEnabled()&&(this.keyHandler.bindAction(33,!0,"previousPage",!0),this.keyHandler.bindAction(34,!0,"nextPage",!0));var b=this.editor.graph,d=b.view.validateBackground;b.view.validateBackground=mxUtils.bind(this,function(){d.apply(b.view,-arguments);null!=b.view.backgroundImage&&EditorUi.embedSvgImages(b.view.backgroundImage.node)});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(y,C){y=C.getProperty("edit").changes;for(C=0;C<y.length;C++)if(y[C]instanceof RenamePage||y[C]instanceof ChangePage||y[C]instanceof mxRootChange){this.updateTabContainer();break}null==this.currentPage||1==y.length&&y[0]instanceof SelectPage||this.currentPage.setDiagramModified(!0)}));var m=b.sizeDidChange,p=null,v=this;b.sizeDidChange=-function(){var y=m.apply(this,arguments);null!=v.currentPage&&p!=v.currentPage&&(p=v.currentPage,v.pageSelected());return y};b.addListener(mxEvent.ROOT,mxUtils.bind(this,function(){b.checkDefaultParent()}));var n=mxUtils.bind(this,function(){this.updateDocumentTitle();this.updateTabContainer()});this.addListener("currentThemeChanged",n);this.editor.addListener("pagesPatched",n);this.editor.addListener("pageRenamed",n);this.editor.addListener("pageMoved",n);this.editor.addListener("fileLoaded",n);-this.editor.addListener("pageSelected",mxUtils.bind(this,function(y,C){this.updateTabContainer();this.updateHashObject();this.updateDocumentTitle()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(y,C){this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}));this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTabContainer()}))}};+arguments);null!=b.view.backgroundImage&&EditorUi.embedSvgImages(b.view.backgroundImage.node)});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(y,B){y=B.getProperty("edit").changes;for(B=0;B<y.length;B++)if(y[B]instanceof RenamePage||y[B]instanceof ChangePage||y[B]instanceof mxRootChange){this.updateTabContainer();break}null==this.currentPage||1==y.length&&y[0]instanceof SelectPage||this.currentPage.setDiagramModified(!0)}));var m=b.sizeDidChange,p=null,u=this;b.sizeDidChange=+function(){var y=m.apply(this,arguments);null!=u.currentPage&&p!=u.currentPage&&(p=u.currentPage,u.pageSelected());return y};b.addListener(mxEvent.ROOT,mxUtils.bind(this,function(){b.checkDefaultParent()}));var n=mxUtils.bind(this,function(){this.updateDocumentTitle();this.updateTabContainer()});this.addListener("currentThemeChanged",n);this.editor.addListener("pagesPatched",n);this.editor.addListener("pageRenamed",n);this.editor.addListener("pageMoved",n);this.editor.addListener("fileLoaded",n);+this.editor.addListener("pageSelected",mxUtils.bind(this,function(y,B){this.updateTabContainer();this.updateHashObject();this.updateDocumentTitle()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(y,B){this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}));this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTabContainer()}))}};EditorUi.prototype.scrollToPage=function(b,d){var m=null!=b?this.getPageIndex(b):this.getSelectedPageIndex(),p=null!=b?b:this.currentPage;null!=m&&null!=this.tabScroller&&this.tabScroller.children.length>m&&null!=this.tabScroller.children[m]&&(p!=this.lastScrollPage||d)&&(this.tabScroller.children[m].scrollIntoView({block:"nearest",inline:null!=b?"nearest":"center"}),this.tabScroller.children[m].className="geTab gePageTab geActivePage",this.lastScrollPage=p,this.btKnownTabScroll=this.tabScroller.scrollLeft)};EditorUi.prototype.restoreViewState=function(b,d,m){b=null!=b?this.getPageById(b.getId()):null;var p=this.editor.graph;null!=b&&null!=this.currentPage&&null!=this.pages&&(b!=this.currentPage?this.selectPage(b,!0,d):(p.setViewState(d),this.editor.updateGraphComponents(),p.view.revalidate(),p.sizeDidChange()),p.container.scrollLeft=p.view.translate.x*p.view.scale+d.scrollLeft,p.container.scrollTop=p.view.translate.y*p.view.scale+d.scrollTop,p.restoreSelection(m))};-Graph.prototype.createViewState=function(b){var d=b.getAttribute("page"),m=parseFloat(b.getAttribute("pageScale")),p=parseFloat(b.getAttribute("pageWidth")),v=parseFloat(b.getAttribute("pageHeight")),n=b.getAttribute("background"),y=this.parseBackgroundImage(b.getAttribute("backgroundImage")),C=b.getAttribute("extFonts");if(C)try{C=C.split("|").map(function(P){P=P.split("^");return{name:P[0],url:P[1]}})}catch(P){console.log("ExtFonts format error: "+P.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),+Graph.prototype.createViewState=function(b){var d=b.getAttribute("page"),m=parseFloat(b.getAttribute("pageScale")),p=parseFloat(b.getAttribute("pageWidth")),u=parseFloat(b.getAttribute("pageHeight")),n=b.getAttribute("background"),y=this.parseBackgroundImage(b.getAttribute("backgroundImage")),B=b.getAttribute("extFonts");if(B)try{B=B.split("|").map(function(P){P=P.split("^");return{name:P[0],url:P[1]}})}catch(P){console.log("ExtFonts format error: "+P.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:function(){var P=b.getAttribute("fold");return null==P||null!=Editor.config&&null!=Editor.config.defaultFoldingEnabled?Graph.prototype.defaultFoldingEnabled:"0"!=P}(),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=d?"0"!=d:this.defaultPageVisible,background:null!=n&&0<n.length?n:null,backgroundImage:y,pageScale:isNaN(m)?mxGraph.prototype.pageScale:-m,pageFormat:isNaN(p)||isNaN(v)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat():new mxRectangle(0,0,p,v),tooltips:"0"!=b.getAttribute("tooltips"),connect:function(){var P=b.getAttribute("connect");return null==P||null!=Editor.config&&null!=Editor.config.defaultConnectable?Graph.prototype.defaultConnectable:"0"!=P}(),arrows:function(){var P=b.getAttribute("arrows");return null==P||null!=Editor.config&&null!=Editor.config.defaultConnectionArrowsEnabled?-Graph.prototype.defaultConnectionArrowsEnabled:"0"!=P}(),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:C||[]}};-Graph.prototype.saveViewState=function(b,d,m,p,v){m||(d.setAttribute("grid",(null==b?this.defaultGridEnabled:b.gridEnabled)?"1":"0"),d.setAttribute("page",(null==b?this.defaultPageVisible:b.pageVisible)?"1":"0"),d.setAttribute("gridSize",null!=b?b.gridSize:mxGraph.prototype.gridSize),d.setAttribute("guides",null==b||b.guidesEnabled?"1":"0"),d.setAttribute("tooltips",null==b||b.tooltips?"1":"0"),d.setAttribute("connect",null==b||b.connect?"1":"0"),d.setAttribute("arrows",null==b||b.arrows?"1":"0"),+m,pageFormat:isNaN(p)||isNaN(u)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat():new mxRectangle(0,0,p,u),tooltips:"0"!=b.getAttribute("tooltips"),connect:function(){var P=b.getAttribute("connect");return null==P||null!=Editor.config&&null!=Editor.config.defaultConnectable?Graph.prototype.defaultConnectable:"0"!=P}(),arrows:function(){var P=b.getAttribute("arrows");return null==P||null!=Editor.config&&null!=Editor.config.defaultConnectionArrowsEnabled?+Graph.prototype.defaultConnectionArrowsEnabled:"0"!=P}(),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:B||[]}};+Graph.prototype.saveViewState=function(b,d,m,p,u){m||(d.setAttribute("grid",(null==b?this.defaultGridEnabled:b.gridEnabled)?"1":"0"),d.setAttribute("page",(null==b?this.defaultPageVisible:b.pageVisible)?"1":"0"),d.setAttribute("gridSize",null!=b?b.gridSize:mxGraph.prototype.gridSize),d.setAttribute("guides",null==b||b.guidesEnabled?"1":"0"),d.setAttribute("tooltips",null==b||b.tooltips?"1":"0"),d.setAttribute("connect",null==b||b.connect?"1":"0"),d.setAttribute("arrows",null==b||b.arrows?"1":"0"),d.setAttribute("fold",null==b||b.foldingEnabled?"1":"0"));d.setAttribute("pageScale",null!=b&&null!=b.pageScale?b.pageScale:mxGraph.prototype.pageScale);m=null!=b?b.pageFormat:"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat();null!=m&&(d.setAttribute("pageWidth",m.width),d.setAttribute("pageHeight",m.height));null!=b&&(null!=b.background&&d.setAttribute("background",b.background),p=this.getBackgroundImageObject(b.backgroundImage,-p,v),null!=p&&d.setAttribute("backgroundImage",JSON.stringify(p)));d.setAttribute("math",(null==b?this.defaultMathEnabled:b.mathEnabled)?"1":"0");d.setAttribute("shadow",null!=b&&b.shadowVisible?"1":"0");null==b||null==b.adaptiveColors?d.removeAttribute("adaptiveColors"):d.setAttribute("adaptiveColors",b.adaptiveColors);null!=b&&null!=b.extFonts&&0<b.extFonts.length&&d.setAttribute("extFonts",b.extFonts.map(function(n){return n.name+"^"+n.url}).join("|"))};+p,u),null!=p&&d.setAttribute("backgroundImage",JSON.stringify(p)));d.setAttribute("math",(null==b?this.defaultMathEnabled:b.mathEnabled)?"1":"0");d.setAttribute("shadow",null!=b&&b.shadowVisible?"1":"0");null==b||null==b.adaptiveColors?d.removeAttribute("adaptiveColors"):d.setAttribute("adaptiveColors",b.adaptiveColors);null!=b&&null!=b.extFonts&&0<b.extFonts.length&&d.setAttribute("extFonts",b.extFonts.map(function(n){return n.name+"^"+n.url}).join("|"))};Graph.prototype.getViewState=function(){return{defaultParent:this.defaultParent,currentRoot:this.view.currentRoot,gridEnabled:this.gridEnabled,gridSize:this.gridSize,guidesEnabled:this.graphHandler.guidesEnabled,foldingEnabled:this.foldingEnabled,shadowVisible:this.shadowVisible,scrollbars:this.scrollbars,pageVisible:this.pageVisible,background:this.background,backgroundImage:this.backgroundImage,pageScale:this.pageScale,pageFormat:this.pageFormat,tooltips:this.tooltipHandler.isEnabled(),connect:this.connectionHandler.isEnabled(),arrows:this.connectionArrowsEnabled,scale:this.view.scale,scrollLeft:this.container.scrollLeft-this.view.translate.x*this.view.scale,scrollTop:this.container.scrollTop-this.view.translate.y*this.view.scale,translate:this.view.translate.clone(),lastPasteXml:this.lastPasteXml,pasteCounter:this.pasteCounter,mathEnabled:this.mathEnabled,adaptiveColors:this.adaptiveColors,hiddenTags:this.hiddenTags,extFonts:this.extFonts}};Graph.prototype.setViewState=function(b,d){if(null!=b){this.lastPasteXml=b.lastPasteXml;this.pasteCounter=b.pasteCounter||0;this.mathEnabled=b.mathEnabled;this.adaptiveColors=b.adaptiveColors;this.gridEnabled=null!=urlParams.grid?"0"!=urlParams.grid:b.gridEnabled;this.gridSize=b.gridSize;this.graphHandler.guidesEnabled=b.guidesEnabled;this.foldingEnabled=b.foldingEnabled;this.setShadowVisible(b.shadowVisible,!1);this.scrollbars=b.scrollbars;this.pageVisible=!this.isViewer()&&(null!=urlParams.pv?"0"!=@@ -4708,33 +4711,33 @@ p.parentNode.removeChild(p)}for(d=0;d<this.extFonts.length;d++)this.addExtFont(tthis.defaultGridEnabled,this.gridSize=mxGraph.prototype.gridSize,this.pageScale=mxGraph.prototype.pageScale,this.pageFormat="undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat(),this.pageVisible=this.defaultPageVisible,this.backgroundImage=this.background=null,this.scrollbars=this.defaultScrollbars,this.graphHandler.guidesEnabled=!0,this.foldingEnabled=this.defaultFoldingEnabled,this.setShadowVisible(!1,!1),this.defaultParent=null,this.setTooltips(!0),this.setConnectable(this.defaultConnectable),this.lastPasteXml=null,this.pasteCounter=0,this.mathEnabled=this.defaultMathEnabled,this.adaptiveColors=null,this.connectionArrowsEnabled=this.defaultConnectionArrowsEnabled,this.hiddenTags=[],this.extFonts=[];this.setAdaptiveColors(this.adaptiveColors);this.preferPageSize=this.pageBreaksVisible=this.pageVisible;this.fireEvent(new mxEventObject("viewStateChanged","state",b))};Graph.prototype.setScrollbarPositions=function(b,d,m){null!=b&&null!=b.scrollLeft&&null!=b.scrollTop&&(this.container.scrollLeft=d*this.view.scale+b.scrollLeft,this.container.scrollTop=m*this.view.scale+b.scrollTop)};-Graph.prototype.addExtFont=function(b,d,m){if(b&&d){var p="extFont_"+b;if(null==document.getElementById(p))if(0==d.indexOf(Editor.GOOGLE_FONTS))mxClient.link("stylesheet",d,null,p);else{document.getElementsByTagName("head");var v=document.createElement("style");v.appendChild(document.createTextNode('@font-face {\n\tfont-family: "'+b+'";\n\tsrc: url("'+d+'");\n}'));v.setAttribute("id",p);document.getElementsByTagName("head")[0].appendChild(v)}if(!m){null==this.extFonts&&(this.extFonts=[]);m=this.extFonts;-p=!0;for(v=0;v<m.length;v++)if(m[v].name==b){p=!1;break}p&&this.extFonts.push({name:b,url:d})}}};+Graph.prototype.addExtFont=function(b,d,m){if(b&&d){var p="extFont_"+b;if(null==document.getElementById(p))if(0==d.indexOf(Editor.GOOGLE_FONTS))mxClient.link("stylesheet",d,null,p);else{document.getElementsByTagName("head");var u=document.createElement("style");u.appendChild(document.createTextNode('@font-face {\n\tfont-family: "'+b+'";\n\tsrc: url("'+d+'");\n}'));u.setAttribute("id",p);document.getElementsByTagName("head")[0].appendChild(u)}if(!m){null==this.extFonts&&(this.extFonts=[]);m=this.extFonts;+p=!0;for(u=0;u<m.length;u++)if(m[u].name==b){p=!1;break}p&&this.extFonts.push({name:b,url:d})}}};EditorUi.prototype.updatePageRoot=function(b,d){if(null==b.root){d=this.editor.extractGraphModel(b.node,null,d);var m=Editor.extractParserError(d);if(m)throw Error(m);null!=d?(b.graphModelNode=d,b.viewState=this.editor.graph.createViewState(d),m=new mxCodec(d.ownerDocument),b.root=m.decode(d).root):(b.root=this.editor.graph.model.createRoot(),b.root.setId("0"),b.root.children[0].setId("1"),b.needsUpdate=!0)}else if(null==b.viewState){if(null==b.graphModelNode){d=this.editor.extractGraphModel(b.node);if(m=Editor.extractParserError(d))throw Error(m);null!=d&&(b.graphModelNode=d)}null!=b.graphModelNode&&(b.viewState=this.editor.graph.createViewState(b.graphModelNode))}if(null==b.root.children||0==b.root.children.length)d=new mxCell,d.setId("1"),b.root.insert(d),b.needsUpdate=!0;return b};EditorUi.prototype.getDiagramSnapshot=function(){return{node:this.editor.getGraphXml(),page:this.currentPage}};-EditorUi.prototype.updateDiagramData=function(b,d){if(null==this.getPageIndex(b.page))this.insertPage(null,null,d);else{var m=new mxCodec(b.node.ownerDocument),p=new mxGraphModel;m.decode(b.node,p);m=new mxCodec(d.ownerDocument);var v=new mxGraphModel;m.decode(d,v);this.selectPage(b.page);d=this.diffCells(p.root,v.root);this.patchPage(b.page,d,null,!0)}};EditorUi.prototype.replaceDiagramData=function(b){this.editor.graph.model.execute(new ReplaceDiagram(this,mxUtils.parseXml(b).documentElement))};-EditorUi.prototype.selectPage=function(b,d,m){try{if(b!=this.currentPage){var p=this.editor.graph;p.isEditing()&&p.stopEditing(!1);d=null!=d?d:!1;p.isMouseDown=!1;p.reset();var v=p.model.createUndoableEdit();v.ignoreEdit=!0;var n=new SelectPage(this,b,m);n.execute();v.add(n);v.notify();d||p.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",v))}}catch(y){this.handleError(y)}};+EditorUi.prototype.updateDiagramData=function(b,d){if(null==this.getPageIndex(b.page))this.insertPage(null,null,d);else{var m=new mxCodec(b.node.ownerDocument),p=new mxGraphModel;m.decode(b.node,p);m=new mxCodec(d.ownerDocument);var u=new mxGraphModel;m.decode(d,u);this.selectPage(b.page);d=this.diffCells(p.root,u.root);this.patchPage(b.page,d,null,!0)}};EditorUi.prototype.replaceDiagramData=function(b){this.editor.graph.model.execute(new ReplaceDiagram(this,mxUtils.parseXml(b).documentElement))};+EditorUi.prototype.selectPage=function(b,d,m){try{if(b!=this.currentPage){var p=this.editor.graph;p.isEditing()&&p.stopEditing(!1);d=null!=d?d:!1;p.isMouseDown=!1;p.reset();var u=p.model.createUndoableEdit();u.ignoreEdit=!0;var n=new SelectPage(this,b,m);n.execute();u.add(n);u.notify();d||p.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",u))}}catch(y){this.handleError(y)}};EditorUi.prototype.selectNextPage=function(b){var d=this.currentPage;null!=d&&null!=this.pages&&(d=mxUtils.indexOf(this.pages,d),b?this.selectPage(this.pages[mxUtils.mod(d+1,this.pages.length)]):b||this.selectPage(this.pages[mxUtils.mod(d-1,this.pages.length)]))};EditorUi.prototype.insertPage=function(b,d,m){this.editor.graph.isEnabled()&&(this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1),b=null!=b?b:this.createPage(null,this.createPageId(),m),d=null!=d?d:this.pages.length,d=new ChangePage(this,b,b,d),this.editor.graph.model.execute(d));return b};EditorUi.prototype.createPageId=function(){do var b=Editor.guid();while(null!=this.getPageById(b));return b};EditorUi.prototype.createPage=function(b,d,m){d=new DiagramPage((null!=this.fileNode?this.fileNode.ownerDocument:document).createElement("diagram"),d);d.setName(null!=b?b:this.createPageName());this.initDiagramNode(d,m);return d};EditorUi.prototype.createPageName=function(){for(var b={},d=0;d<this.pages.length;d++){var m=this.pages[d].getName();null!=m&&0<m.length&&(b[m]=m)}d=this.pages.length;do m=mxResources.get("pageWithNumber",[++d]);while(null!=b[m]);return m};-EditorUi.prototype.removePage=function(b){try{var d=this.editor.graph,m=mxUtils.indexOf(this.pages,b);if(d.isEnabled()&&0<=m){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);d.model.beginUpdate();try{var p=this.currentPage;p==b&&1<this.pages.length?(m==this.pages.length-1?m--:m++,p=this.pages[m]):1>=this.pages.length&&(p=this.insertPage(),d.model.execute(new RenamePage(this,p,mxResources.get("pageWithNumber",[1]))));d.model.execute(new ChangePage(this,b,p))}finally{d.model.endUpdate()}}}catch(v){this.handleError(v)}return b};-EditorUi.prototype.duplicatePage=function(b,d){var m=null;try{var p=this.editor.graph;if(p.isEnabled()){p.isEditing()&&p.stopEditing();var v=b.node.cloneNode(!1);v.removeAttribute("id");var n={},y=p.createCellLookup([p.model.root]);m=new DiagramPage(v);m.root=p.cloneCell(p.model.root,null,n);var C=new mxGraphModel;C.prefix=Editor.guid()+"-";C.setRoot(m.root);p.updateCustomLinks(p.createCellMapping(n,y),[m.root]);m.viewState=b==this.currentPage?p.getViewState():b.viewState;this.initDiagramNode(m);+EditorUi.prototype.removePage=function(b){try{var d=this.editor.graph,m=mxUtils.indexOf(this.pages,b);if(d.isEnabled()&&0<=m){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);d.model.beginUpdate();try{var p=this.currentPage;p==b&&1<this.pages.length?(m==this.pages.length-1?m--:m++,p=this.pages[m]):1>=this.pages.length&&(p=this.insertPage(),d.model.execute(new RenamePage(this,p,mxResources.get("pageWithNumber",[1]))));d.model.execute(new ChangePage(this,b,p))}finally{d.model.endUpdate()}}}catch(u){this.handleError(u)}return b};+EditorUi.prototype.duplicatePage=function(b,d){var m=null;try{var p=this.editor.graph;if(p.isEnabled()){p.isEditing()&&p.stopEditing();var u=b.node.cloneNode(!1);u.removeAttribute("id");var n={},y=p.createCellLookup([p.model.root]);m=new DiagramPage(u);m.root=p.cloneCell(p.model.root,null,n);var B=new mxGraphModel;B.prefix=Editor.guid()+"-";B.setRoot(m.root);p.updateCustomLinks(p.createCellMapping(n,y),[m.root]);m.viewState=b==this.currentPage?p.getViewState():b.viewState;this.initDiagramNode(m);m.viewState.scale=1;delete m.viewState.scrollLeft;delete m.viewState.scrollTop;delete m.viewState.currentRoot;delete m.viewState.defaultParent;m.setName(d);m=this.insertPage(m,mxUtils.indexOf(this.pages,b)+1)}}catch(P){this.handleError(P)}return m};EditorUi.prototype.initDiagramNode=function(b,d){null==d&&(d=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,d);EditorUi.removeChildNodes(b.node);b.node.appendChild(d)};-EditorUi.prototype.clonePages=function(b){for(var d=[],m=[],p=0;p<b.length;p++)try{m.push(this.clonePage(b[p]))}catch(v){d.push(mxResources.get("pageWithNumber",[p+1])+": "+v.toString())}if(0<d.length){b=Error(d.join("\n"));try{0<m.length&&(b.fallbackFileData=this.getXmlForPages(m))}catch(v){}throw b;}return m};+EditorUi.prototype.clonePages=function(b){for(var d=[],m=[],p=0;p<b.length;p++)try{m.push(this.clonePage(b[p]))}catch(u){d.push(mxResources.get("pageWithNumber",[p+1])+": "+u.toString())}if(0<d.length){b=Error(d.join("\n"));try{0<m.length&&(b.fallbackFileData=this.getXmlForPages(m))}catch(u){}throw b;}return m};EditorUi.prototype.clonePage=function(b){this.updatePageRoot(b);var d=new DiagramPage(b.node.cloneNode(!0)),m=b==this.currentPage?this.editor.graph.getViewState():b.viewState;d.viewState=mxUtils.clone(m,EditorUi.transientViewStateProperties);d.root=this.editor.graph.model.cloneCell(b.root,null,!0);d.diagramModified=b.diagramModified;return d};EditorUi.prototype.renamePage=function(b){if(this.editor.graph.isEnabled()){var d=new FilenameDialog(this,b.getName(),mxResources.get("rename"),mxUtils.bind(this,function(m){null!=m&&0<m.length&&this.editor.graph.model.execute(new RenamePage(this,b,m))}),mxResources.get("rename"));this.showDialog(d.container,300,80,!0,!0);d.init()}return b};EditorUi.prototype.movePage=function(b,d){this.editor.graph.model.execute(new MovePage(this,b,d))};-EditorUi.prototype.sortPages=function(){var b=this.pages.slice().sort(function(v,n){return(v.getName()||"").localeCompare(n.getName()||"",void 0,{numeric:!0,sensitivity:"base"})}),d=this.editor.graph.model;d.beginUpdate();try{for(var m=0;m<b.length;m++){var p=mxUtils.indexOf(this.pages,b[m]);p!=m&&this.movePage(p,m)}}finally{d.endUpdate()}this.scrollToPage(this.currentPage,!0)};+EditorUi.prototype.sortPages=function(){var b=this.pages.slice().sort(function(u,n){return(u.getName()||"").localeCompare(n.getName()||"",void 0,{numeric:!0,sensitivity:"base"})}),d=this.editor.graph.model;d.beginUpdate();try{for(var m=0;m<b.length;m++){var p=mxUtils.indexOf(this.pages,b[m]);p!=m&&this.movePage(p,m)}}finally{d.endUpdate()}this.scrollToPage(this.currentPage,!0)};EditorUi.prototype.createTabContainer=function(){var b=document.createElement("div");b.className="geTabContainer geTabItem";return b};-EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&!this.isTabContainerVisible())this.tabContainer.style.display="none";else if(null!=this.tabContainer&&null!=this.pages){this.tabContainer.style.display="";var b=this.editor.graph,d=document.createElement("div");d.className="geTabScroller";for(var m=null,p=null,v=null,n=this,y=null!=this.tabScroller?this.tabScroller.scrollLeft:0,C=!1,P=0;P<this.pages.length;P++){var G=this.pages[P];if(null!=G){var O=G.getId(),U=G.getName()||-mxResources.get("untitled"),c=O+":"+U;c=null!=this.btPageTabCache?this.btPageTabCache[c]:null;null!=c?c.setAttribute("title",U+(null!=O?" ("+O+")":"")+" ["+(P+1)+"]"):(c=this.createTabForPage(G,P+1),C=!0);c.setAttribute("draggable","true");c.setAttribute("data-index",P);c.className="geTab gePageTab";null==c.btDndInstalled&&(c.btDndInstalled=!0,mxEvent.addListener(c,"dragstart",mxUtils.bind(this,function(q){b.isEnabled()?(mxClient.IS_FF&&q.dataTransfer.setData("Text","<diagram/>"),m=parseInt(q.currentTarget.getAttribute("data-index"),+EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&!this.isTabContainerVisible())this.tabContainer.style.display="none";else if(null!=this.tabContainer&&null!=this.pages){this.tabContainer.style.display="";var b=this.editor.graph,d=document.createElement("div");d.className="geTabScroller";for(var m=null,p=null,u=null,n=this,y=null!=this.tabScroller?this.tabScroller.scrollLeft:0,B=!1,P=0;P<this.pages.length;P++){var G=this.pages[P];if(null!=G){var O=G.getId(),U=G.getName()||+mxResources.get("untitled"),c=O+":"+U;c=null!=this.btPageTabCache?this.btPageTabCache[c]:null;null!=c?c.setAttribute("title",U+(null!=O?" ("+O+")":"")+" ["+(P+1)+"]"):(c=this.createTabForPage(G,P+1),B=!0);c.setAttribute("draggable","true");c.setAttribute("data-index",P);c.className="geTab gePageTab";null==c.btDndInstalled&&(c.btDndInstalled=!0,mxEvent.addListener(c,"dragstart",mxUtils.bind(this,function(q){b.isEnabled()?(mxClient.IS_FF&&q.dataTransfer.setData("Text","<diagram/>"),m=parseInt(q.currentTarget.getAttribute("data-index"),10),p=q.currentTarget,window.requestAnimationFrame(function(){null!=p&&p.classList.add("gePageTabDragPlaceholder")}),n._pageTabDragOverHandler=function(x){x.dataTransfer.dropEffect="move";x.preventDefault();x.target.classList&&x.target.classList.contains("gePageTab")||x.stopPropagation()},n._pageTabDropHandler=function(x){x.preventDefault();x.stopPropagation()},document.addEventListener("dragover",n._pageTabDragOverHandler,!0),document.addEventListener("drop",n._pageTabDropHandler,!0)):mxEvent.consume(q)})),-mxEvent.addListener(c,"dragend",mxUtils.bind(this,function(q){if(null!=p){p.classList.remove("gePageTabDragPlaceholder");for(var x=p.parentNode.querySelectorAll(".gePageTab"),B=0,E=0;E<x.length;E++)if(x[E]==p){B=E;break}null!=m&&B!=m&&this.movePage(m,B)}null!=n._pageTabDragOverHandler&&(document.removeEventListener("dragover",n._pageTabDragOverHandler,!0),document.removeEventListener("drop",n._pageTabDropHandler,!0),n._pageTabDragOverHandler=null,n._pageTabDropHandler=null);p=m=null;q.stopPropagation();-q.preventDefault()})),mxEvent.addListener(c,"dragover",function(q){if(null!=m&&null!=p){q.dataTransfer.dropEffect="move";var x=q.currentTarget;if(x!=p){var B=x.getBoundingClientRect(),E=p.parentNode;q.clientX<B.left+B.width/2?E.insertBefore(p,x):x.nextSibling!=p&&E.insertBefore(p,x.nextSibling)}}q.stopPropagation();q.preventDefault()}),mxEvent.addListener(c,"drop",function(q){q.stopPropagation();q.preventDefault()}));G==this.currentPage&&(v=c);d.appendChild(c)}}this.tabContainer.innerText="";this.isPageInsertTabVisible()&&+mxEvent.addListener(c,"dragend",mxUtils.bind(this,function(q){if(null!=p){p.classList.remove("gePageTabDragPlaceholder");for(var x=p.parentNode.querySelectorAll(".gePageTab"),C=0,E=0;E<x.length;E++)if(x[E]==p){C=E;break}null!=m&&C!=m&&this.movePage(m,C)}null!=n._pageTabDragOverHandler&&(document.removeEventListener("dragover",n._pageTabDragOverHandler,!0),document.removeEventListener("drop",n._pageTabDropHandler,!0),n._pageTabDragOverHandler=null,n._pageTabDropHandler=null);p=m=null;q.stopPropagation();+q.preventDefault()})),mxEvent.addListener(c,"dragover",function(q){if(null!=m&&null!=p){q.dataTransfer.dropEffect="move";var x=q.currentTarget;if(x!=p){var C=x.getBoundingClientRect(),E=p.parentNode;q.clientX<C.left+C.width/2?E.insertBefore(p,x):x.nextSibling!=p&&E.insertBefore(p,x.nextSibling)}}q.stopPropagation();q.preventDefault()}),mxEvent.addListener(c,"drop",function(q){q.stopPropagation();q.preventDefault()}));G==this.currentPage&&(u=c);d.appendChild(c)}}this.tabContainer.innerText="";this.isPageInsertTabVisible()&&this.tabContainer.appendChild(this.createPageInsertTab());"simple"!=Editor.currentTheme&&(this.pageMenuTab=this.createPageMenuTab(),this.tabContainer.appendChild(this.pageMenuTab));this.tabContainer.appendChild(d);this.leftScrollTab=this.createLeftScrollTab();this.tabContainer.appendChild(this.leftScrollTab);this.rightScrollTab=this.createRightScrollTab();this.tabContainer.appendChild(this.rightScrollTab);if(Graph.browserTranslate&&Graph.isBrowserTranslated())for(this.btPageTabCache={},P=0;P<d.children.length;P++)G=null!=this.pages&&P<this.pages.length?this.pages[P]:null,null!=G&&(G=G.getId()+":"+(G.getName()||mxResources.get("untitled")),this.btPageTabCache[G]=d.children[P]);this.tabScroller=d;mxEvent.addListener(this.tabScroller,"scroll",mxUtils.bind(this,function(q){this.checkTabScrollerOverflow()}));if(Graph.browserTranslate&&Graph.isBrowserTranslated()){if(null==this.btCanary){n=this;this.btCanary=document.createElement("p");this.btCanary.setAttribute("aria-hidden","true");this.btCanary.style.cssText="position:absolute;left:-10000px;top:0;width:1px;height:1px;overflow:hidden;pointer-events:none;";this.btCanaryOriginal="Click here to insert a new page into the document";this.btCanary.textContent=this.btCanaryOriginal;document.body.appendChild(this.btCanary);this.btCanarySavedScroll=null;var f=function(){null!=n.btCanarySavedScroll&&null!=n.tabScroller&&(n.btCanarySavedScroll=null,n.scrollToPage(null,!0))};this.btCanaryObserver=new MutationObserver(function(){null!=n.btCanarySavedScroll&&n.btCanary.textContent!=n.btCanaryOriginal&&setTimeout(f,100)});this.btCanaryObserver.observe(this.btCanary,-{characterData:!0,childList:!0,subtree:!0})}null==this.btCanarySavedScroll&&C&&0<this.btKnownTabScroll&&(this.btCanarySavedScroll=this.btKnownTabScroll,this.btCanary.textContent=this.btCanaryOriginal,document.body.appendChild(this.btCanary))}var k=document.createElement("a");k.href="https://github.com/jgraph/drawio";k.target="_blank";k.style.cssText="margin-left:auto;display:flex;align-items:center;padding:0 8px;opacity:0.5;flex-shrink:0";d=document.createElement("img");d.src=IMAGE_PATH+(Editor.isDarkMode()?-"/github-logo-white.svg":"/github-logo.svg");d.style.cssText="width:18px;height:18px";d.setAttribute("title","jgraph/drawio");k.appendChild(d);mxEvent.addListener(k,"mouseenter",function(){k.style.opacity="1"});mxEvent.addListener(k,"mouseleave",function(){k.style.opacity="0.5"});this.tabContainer.appendChild(k);null!=v&&v.classList.add("geActivePage");this.tabScroller.scrollLeft=y;this.scrollToPage();this.btKnownTabScroll=this.tabScroller.scrollLeft;this.checkTabScrollerOverflow();null!=v&&v.scrollIntoView({behavior:"smooth",+{characterData:!0,childList:!0,subtree:!0})}null==this.btCanarySavedScroll&&B&&0<this.btKnownTabScroll&&(this.btCanarySavedScroll=this.btKnownTabScroll,this.btCanary.textContent=this.btCanaryOriginal,document.body.appendChild(this.btCanary))}var k=document.createElement("a");k.href="https://github.com/jgraph/drawio";k.target="_blank";k.style.cssText="margin-left:auto;display:flex;align-items:center;padding:0 8px;opacity:0.5;flex-shrink:0";d=document.createElement("img");d.src=IMAGE_PATH+(Editor.isDarkMode()?+"/github-logo-white.svg":"/github-logo.svg");d.style.cssText="width:18px;height:18px";d.setAttribute("title","jgraph/drawio");k.appendChild(d);mxEvent.addListener(k,"mouseenter",function(){k.style.opacity="1"});mxEvent.addListener(k,"mouseleave",function(){k.style.opacity="0.5"});this.tabContainer.appendChild(k);null!=u&&u.classList.add("geActivePage");this.tabScroller.scrollLeft=y;this.scrollToPage();this.btKnownTabScroll=this.tabScroller.scrollLeft;this.checkTabScrollerOverflow();null!=u&&u.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}};EditorUi.prototype.checkTabScrollerOverflow=function(){null!=this.tabScroller&&null!=this.tabContainer&&2<this.tabContainer.children.length&&(this.tabScroller.scrollWidth>this.tabScroller.offsetWidth?(this.leftScrollTab.style.display="",this.rightScrollTab.style.display="",0==this.tabScroller.scrollLeft?this.leftScrollTab.classList.add("mxDisabled"):this.leftScrollTab.classList.remove("mxDisabled"),Math.ceil(this.tabScroller.scrollLeft)+this.tabScroller.offsetWidth>=this.tabScroller.scrollWidth?this.rightScrollTab.classList.add("mxDisabled"):this.rightScrollTab.classList.remove("mxDisabled")):(this.leftScrollTab.style.display="none",this.rightScrollTab.style.display="none"))};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};@@ -4742,61 +4745,61 @@ EditorUi.prototype.createTab=function(){var b=document.createElement("div");b.clEditorUi.prototype.createControlTab=function(b,d,m){var p=this.createTab();p.className="geTab geControlTab";null!=b&&p.setAttribute("title",b);b=document.createElement("div");b.className="geButton";b.style.backgroundImage="url("+d+")";p.appendChild(b);mxEvent.addListener(p,"click",m);return p};EditorUi.prototype.createPageInsertTab=function(){return this.createControlTab(mxResources.get("insertPage"),Editor.plusImage,mxUtils.bind(this,function(b){this.actions.get("insertPage").funct();mxEvent.consume(b)}))};EditorUi.prototype.createLeftScrollTab=function(){return this.createControlTab(null,Editor.chevronLeftImage,mxUtils.bind(this,function(b){var d=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:-d,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft-=d;mxEvent.consume(b)}))};EditorUi.prototype.createRightScrollTab=function(){return this.createControlTab(null,Editor.chevronRightImage,mxUtils.bind(this,function(b){var d=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:d,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft+=d;mxEvent.consume(b)}))};-EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var d=new mxPopupMenu(mxUtils.bind(this,function(v,n){this.menus.get("pages").funct(v,n)}));d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);d.destroy()});var m=mxEvent.getClientX(b),p=mxEvent.getClientY(b);d.popup(m,-p,null,b);this.setCurrentMenu(d);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,d){var m=this.createTab(),p=b.getName()||mxResources.get("untitled"),v=b.getId();m.setAttribute("title",p+(null!=v?" ("+v+")":"")+" ["+d+"]");d=document.createElement("span");d.style.maxWidth="160px";d.style.textOverflow="ellipsis";d.style.overflow="hidden";mxUtils.write(d,p);m.appendChild(d);this.addTabListeners(b,m);return m};-EditorUi.prototype.addTabListeners=function(b,d){mxEvent.disableContextMenu(d);var m=this.editor.graph;mxEvent.addListener(d,"dblclick",mxUtils.bind(this,function(P){this.renamePage(b);mxEvent.consume(P)}));var p=document.createElement("div");p.style.backgroundImage="url("+Editor.thinExpandImage+")";p.className="geButton";d.appendChild(p);var v=!1,n=!1,y=mxUtils.bind(this,function(P){v=null!=this.currentMenu;n=b==this.currentPage;this.scrollToPage(b);m.isMouseDown||n||this.selectPage(b)}),C=mxUtils.bind(this,-function(P){if(!m.isMouseDown&&(n&&(mxEvent.isTouchEvent(P)||mxEvent.getSource(P)==p)||mxEvent.isPopupTrigger(P))&&(m.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(P)||!v)){var G=new mxPopupMenu(this.createPageMenu(b));G.smartSeparators=!0;G.showDisabled=!0;G.autoExpand=!0;G.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(G,arguments);this.resetCurrentMenu();G.destroy()});var O=mxEvent.getClientX(P),U=mxEvent.getClientY(P);G.popup(O,U,null,P);-this.setCurrentMenu(G,d)}mxEvent.consume(P)});mxEvent.addGestureListeners(p,y,null,C);mxEvent.addGestureListeners(d,y,null,C)};+EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var d=new mxPopupMenu(mxUtils.bind(this,function(u,n){this.menus.get("pages").funct(u,n)}));d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);d.destroy()});var m=mxEvent.getClientX(b),p=mxEvent.getClientY(b);d.popup(m,+p,null,b);this.setCurrentMenu(d);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,d){var m=this.createTab(),p=b.getName()||mxResources.get("untitled"),u=b.getId();m.setAttribute("title",p+(null!=u?" ("+u+")":"")+" ["+d+"]");d=document.createElement("span");d.style.maxWidth="160px";d.style.textOverflow="ellipsis";d.style.overflow="hidden";mxUtils.write(d,p);m.appendChild(d);this.addTabListeners(b,m);return m};+EditorUi.prototype.addTabListeners=function(b,d){mxEvent.disableContextMenu(d);var m=this.editor.graph;mxEvent.addListener(d,"dblclick",mxUtils.bind(this,function(P){this.renamePage(b);mxEvent.consume(P)}));var p=document.createElement("div");p.style.backgroundImage="url("+Editor.thinExpandImage+")";p.className="geButton";d.appendChild(p);var u=!1,n=!1,y=mxUtils.bind(this,function(P){u=null!=this.currentMenu;n=b==this.currentPage;this.scrollToPage(b);m.isMouseDown||n||this.selectPage(b)}),B=mxUtils.bind(this,+function(P){if(!m.isMouseDown&&(n&&(mxEvent.isTouchEvent(P)||mxEvent.getSource(P)==p)||mxEvent.isPopupTrigger(P))&&(m.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(P)||!u)){var G=new mxPopupMenu(this.createPageMenu(b));G.smartSeparators=!0;G.showDisabled=!0;G.autoExpand=!0;G.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(G,arguments);this.resetCurrentMenu();G.destroy()});var O=mxEvent.getClientX(P),U=mxEvent.getClientY(P);G.popup(O,U,null,P);+this.setCurrentMenu(G,d)}mxEvent.consume(P)});mxEvent.addGestureListeners(p,y,null,B);mxEvent.addGestureListeners(d,y,null,B)};EditorUi.prototype.createPageMenu=function(b,d){return mxUtils.bind(this,function(m,p){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||navigator.standalone||m.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,!0,!0))}),p));this.editor.graph.isEnabled()&&(this.menus.addMenuItems(m,["duplicatePage","-"],p),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",-m,p,mxResources.get("move")),this.menus.addMenuItems(m,["removePage","renamePage"],p))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(p,v,n,y,C){v=null!=v?v:!1;null==n&&(n=this.getFoldableCells(this.getSelectionCells(),p));this.stopEditing();this.model.beginUpdate();try{for(var P=n.slice(),G=0;G<n.length;G++)"1"==mxUtils.getValue(this.getCurrentCellStyle(n[G]),"treeFolding","0")&&this.foldTreeCell(p,n[G]);n=P;n=b.apply(this,arguments)}finally{this.model.endUpdate()}return n};Graph.prototype.foldTreeCell=function(p,v){this.model.beginUpdate();try{var n=-[];this.traverse(v,!0,mxUtils.bind(this,function(C,P){var G=null!=P&&this.isTreeEdge(P);G&&n.push(P);C==v||null!=P&&!G||n.push(C);return(null==P||G)&&(C==v||!this.model.isCollapsed(C))}));this.model.setCollapsed(v,p);for(var y=0;y<n.length;y++)this.model.setVisible(n[y],!p)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(p){return!this.isEdgeIgnored(p)};Graph.prototype.getTreeEdges=function(p,v,n,y,C,P){return this.model.filterCells(this.getEdges(p,v,n,y,C,P),mxUtils.bind(this,-function(G){return this.isTreeEdge(G)}))};Graph.prototype.getIncomingTreeEdges=function(p,v){return this.getTreeEdges(p,v,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(p,v){return this.getTreeEdges(p,v,!1,!0,!1)};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function p(t){return L.isVertex(t)&&n(t)}function v(t){var H=!1;null!=t&&(H="1"==-E.getCurrentCellStyle(t).treeMoving);return H}function n(t){var H=!1;null!=t&&(t=L.getParent(t),H=E.view.getState(t),H="tree"==(null!=H?H.style:E.getCellStyle(t)).containerType);return H}function y(t){for(;null!=t&&!n(t);)t=L.getParent(t);return null!=t?L.getParent(t):null}function C(t){var H=!1;null!=t&&(t=L.getParent(t),H=E.view.getState(t),E.view.getState(t),H=null!=(null!=H?H.style:E.getCellStyle(t)).childLayout);return H}function P(t,H){function J(ja,na){null!=ja&&(T.cut.get(ja)||(T.cut.put(ja,-!0),T.cells.push(ja)),na&&!Y.get(ja)&&(Y.put(ja,!0),Z.push(ja)))}function R(ja){if(!T.deleted.get(ja)){T.deleted.put(ja,!0);T.cells.push(ja);ja=E.getAllEdges([ja]);for(var na=0;na<ja.length;na++)J(ja[na],!0)}}for(var T={cells:[],deleted:new mxDictionary,cut:new mxDictionary,cascaded:[]},Y=new mxDictionary,Z=[],ia=0;ia<t.length;ia++){var ka=t[ia];L.isEdge(ka)?J(ka,!1):L.isVertex(ka)&&null!=y(ka)?R(ka):null!=ka&&T.cells.push(ka)}for(;0<Z.length;)if(t=L.getTerminal(Z.shift(),!1),null!=t&&!T.deleted.get(t)&&-L.isVertex(t)&&(ia=y(t),null!=ia&&(null==H||!H.get(ia)))){ia=E.getIncomingTreeEdges(t);ka=!0;for(var X=0;X<ia.length;X++)if(!T.cut.get(ia[X])){ka=!1;break}ka&&(T.cascaded.push(t),R(t))}return T}function G(t){t=E.view.getState(t);if(null!=t){var H=E.getIncomingTreeEdges(t.cell);if(0<H.length&&(H=E.view.getState(H[0]),null!=H&&(H=H.absolutePoints,null!=H&&0<H.length&&(H=H[H.length-1],null!=H)))){if(H.y==t.y&&Math.abs(H.x-t.getCenterX())<t.width/2)return mxConstants.DIRECTION_SOUTH;if(H.y==t.y+t.height&&+m,p,mxResources.get("move")),this.menus.addMenuItems(m,["removePage","renamePage"],p))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(p,u,n,y,B){u=null!=u?u:!1;null==n&&(n=this.getFoldableCells(this.getSelectionCells(),p));this.stopEditing();this.model.beginUpdate();try{for(var P=n.slice(),G=0;G<n.length;G++)"1"==mxUtils.getValue(this.getCurrentCellStyle(n[G]),"treeFolding","0")&&this.foldTreeCell(p,n[G]);n=P;n=b.apply(this,arguments)}finally{this.model.endUpdate()}return n};Graph.prototype.foldTreeCell=function(p,u){this.model.beginUpdate();try{var n=+[];this.traverse(u,!0,mxUtils.bind(this,function(B,P){var G=null!=P&&this.isTreeEdge(P);G&&n.push(P);B==u||null!=P&&!G||n.push(B);return(null==P||G)&&(B==u||!this.model.isCollapsed(B))}));this.model.setCollapsed(u,p);for(var y=0;y<n.length;y++)this.model.setVisible(n[y],!p)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(p){return!this.isEdgeIgnored(p)};Graph.prototype.getTreeEdges=function(p,u,n,y,B,P){return this.model.filterCells(this.getEdges(p,u,n,y,B,P),mxUtils.bind(this,+function(G){return this.isTreeEdge(G)}))};Graph.prototype.getIncomingTreeEdges=function(p,u){return this.getTreeEdges(p,u,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(p,u){return this.getTreeEdges(p,u,!1,!0,!1)};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function p(t){return L.isVertex(t)&&n(t)}function u(t){var H=!1;null!=t&&(H="1"==+E.getCurrentCellStyle(t).treeMoving);return H}function n(t){var H=!1;null!=t&&(t=L.getParent(t),H=E.view.getState(t),H="tree"==(null!=H?H.style:E.getCellStyle(t)).containerType);return H}function y(t){for(;null!=t&&!n(t);)t=L.getParent(t);return null!=t?L.getParent(t):null}function B(t){var H=!1;null!=t&&(t=L.getParent(t),H=E.view.getState(t),E.view.getState(t),H=null!=(null!=H?H.style:E.getCellStyle(t)).childLayout);return H}function P(t,H){function J(ka,na){null!=ka&&(T.cut.get(ka)||(T.cut.put(ka,+!0),T.cells.push(ka)),na&&!Y.get(ka)&&(Y.put(ka,!0),Z.push(ka)))}function R(ka){if(!T.deleted.get(ka)){T.deleted.put(ka,!0);T.cells.push(ka);ka=E.getAllEdges([ka]);for(var na=0;na<ka.length;na++)J(ka[na],!0)}}for(var T={cells:[],deleted:new mxDictionary,cut:new mxDictionary,cascaded:[]},Y=new mxDictionary,Z=[],ia=0;ia<t.length;ia++){var ja=t[ia];L.isEdge(ja)?J(ja,!1):L.isVertex(ja)&&null!=y(ja)?R(ja):null!=ja&&T.cells.push(ja)}for(;0<Z.length;)if(t=L.getTerminal(Z.shift(),!1),null!=t&&!T.deleted.get(t)&&+L.isVertex(t)&&(ia=y(t),null!=ia&&(null==H||!H.get(ia)))){ia=E.getIncomingTreeEdges(t);ja=!0;for(var X=0;X<ia.length;X++)if(!T.cut.get(ia[X])){ja=!1;break}ja&&(T.cascaded.push(t),R(t))}return T}function G(t){t=E.view.getState(t);if(null!=t){var H=E.getIncomingTreeEdges(t.cell);if(0<H.length&&(H=E.view.getState(H[0]),null!=H&&(H=H.absolutePoints,null!=H&&0<H.length&&(H=H[H.length-1],null!=H)))){if(H.y==t.y&&Math.abs(H.x-t.getCenterX())<t.width/2)return mxConstants.DIRECTION_SOUTH;if(H.y==t.y+t.height&&Math.abs(H.x-t.getCenterX())<t.width/2)return mxConstants.DIRECTION_NORTH;if(H.x>t.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function O(t,H,J){if(null!=J){for(var R=E.getCurrentCellStyle(H),T=["treeFolding","treeMoving","newEdgeStyle"],Y=0;Y<T.length;Y++)null!=R[T[Y]]&&(null==J.style||0>J.style.indexOf(T[Y]+"="))&&(J.style=mxUtils.setStyle(J.style,T[Y],R[T[Y]]));null!=J.geometry&&null!=H.geometry&&(J.geometry.x=H.geometry.x,J.geometry.y=H.geometry.y);E.model.getTerminal(t[0],!1)==t[1]&&E.model.setTerminal(t[0],J,!1);t[1]=J}return t}function U(t,H,J){H=null!=H?H:!0;E.model.beginUpdate();try{var R=E.model.getParent(t),T=E.getIncomingTreeEdges(t),Y=O(E.cloneCells([T[0],t]),t,J);E.model.setTerminal(Y[0],E.model.getTerminal(T[0],!0),!0);var Z=G(t),ia=R.geometry;Z==mxConstants.DIRECTION_SOUTH||Z==mxConstants.DIRECTION_NORTH?Y[1].geometry.x+=H?t.geometry.width+10:-Y[1].geometry.width-10:Y[1].geometry.y+=H?t.geometry.height+10:-Y[1].geometry.height-10;E.view.currentRoot!=R&&-(Y[1].geometry.x-=ia.x,Y[1].geometry.y-=ia.y);var ka=E.view.getState(t),X=E.view.scale;if(null!=ka){var ja=mxRectangle.fromRectangle(ka);Z==mxConstants.DIRECTION_SOUTH||Z==mxConstants.DIRECTION_NORTH?ja.x+=(H?t.geometry.width+10:-Y[1].geometry.width-10)*X:ja.y+=(H?t.geometry.height+10:-Y[1].geometry.height-10)*X;var na=E.getOutgoingTreeEdges(E.model.getTerminal(T[0],!0));if(null!=na){var la=Z==mxConstants.DIRECTION_SOUTH||Z==mxConstants.DIRECTION_NORTH;for(ia=T=J=0;ia<na.length;ia++){var va=E.model.getTerminal(na[ia],-!1);if(Z==G(va)){var za=E.view.getState(va);va!=t&&null!=za&&(la&&H!=za.getCenterX()<ka.getCenterX()||!la&&H!=za.getCenterY()<ka.getCenterY())&&mxUtils.intersects(ja,za)&&(J=10+Math.max(J,(Math.min(ja.x+ja.width,za.x+za.width)-Math.max(ja.x,za.x))/X),T=10+Math.max(T,(Math.min(ja.y+ja.height,za.y+za.height)-Math.max(ja.y,za.y))/X))}}la?T=0:J=0;for(ia=0;ia<na.length;ia++)if(va=E.model.getTerminal(na[ia],!1),Z==G(va)&&(za=E.view.getState(va),va!=t&&null!=za&&(la&&H!=za.getCenterX()<ka.getCenterX()||-!la&&H!=za.getCenterY()<ka.getCenterY()))){var sa=[];E.traverse(za.cell,!0,function(wa,Ca){var Fa=null!=Ca&&E.isTreeEdge(Ca);Fa&&sa.push(Ca);(null==Ca||Fa)&&sa.push(wa);return null==Ca||Fa});E.moveCells(sa,(H?1:-1)*J,(H?1:-1)*T)}}}return E.addCells(Y,R)}finally{E.model.endUpdate()}}function c(t,H){E.model.beginUpdate();try{var J=G(t),R=E.getIncomingTreeEdges(t),T=O(E.cloneCells([R[0],t]),t,H);E.model.setTerminal(R[0],T[1],!1);E.model.setTerminal(T[0],T[1],!0);E.model.setTerminal(T[0],t,!1);var Y=-E.model.getParent(t),Z=Y.geometry,ia=[];E.view.currentRoot!=Y&&(T[1].geometry.x-=Z.x,T[1].geometry.y-=Z.y);E.traverse(t,!0,function(ja,na){var la=null!=na&&E.isTreeEdge(na);la&&ia.push(na);(null==na||la)&&ia.push(ja);return null==na||la});var ka=t.geometry.width+40,X=t.geometry.height+40;J==mxConstants.DIRECTION_SOUTH?ka=0:J==mxConstants.DIRECTION_NORTH?(ka=0,X=-X):J==mxConstants.DIRECTION_WEST?(ka=-ka,X=0):J==mxConstants.DIRECTION_EAST&&(X=0);E.moveCells(ia,ka,X);return E.addCells(T,Y)}finally{E.model.endUpdate()}}-function f(t,H,J){E.model.beginUpdate();try{var R=E.model.getParent(t),T=E.getIncomingTreeEdges(t),Y=G(t);0==T.length&&(T=[E.createEdge(R,null,"",null,null,E.createCurrentEdgeStyle())],Y=H);var Z=O(E.cloneCells([T[0],t]),t,J);E.model.setTerminal(Z[0],t,!0);null==E.model.getTerminal(Z[0],!1)&&(E.model.setTerminal(Z[0],Z[1],!1),E.applyNewEdgeStyle(Z[1],[Z[0]],Y));T=E.getOutgoingTreeEdges(t);var ia=R.geometry;H=[];E.view.currentRoot==R&&(ia=new mxRectangle);for(J=0;J<T.length;J++){var ka=E.model.getTerminal(T[J],-!1);null!=ka&&H.push(ka)}var X=E.view.getBounds(H),ja=E.view.translate,na=E.view.scale;Y==mxConstants.DIRECTION_SOUTH?(Z[1].geometry.x=null==X?t.geometry.x+(t.geometry.width-Z[1].geometry.width)/2:(X.x+X.width)/na-ja.x-ia.x+10,Z[1].geometry.y+=t.geometry.height-ia.y+40):Y==mxConstants.DIRECTION_NORTH?(Z[1].geometry.x=null==X?t.geometry.x+(t.geometry.width-Z[1].geometry.width)/2:(X.x+X.width)/na-ja.x+-ia.x+10,Z[1].geometry.y-=Z[1].geometry.height+ia.y+40):(Z[1].geometry.x=Y==mxConstants.DIRECTION_WEST?-Z[1].geometry.x-(Z[1].geometry.width+ia.x+40):Z[1].geometry.x+(t.geometry.width-ia.x+40),Z[1].geometry.y=null==X?t.geometry.y+(t.geometry.height-Z[1].geometry.height)/2:(X.y+X.height)/na-ja.y+-ia.y+10);return E.addCells(Z,R)}finally{E.model.endUpdate()}}function k(t,H,J){t=E.getOutgoingTreeEdges(t);J=E.view.getState(J);var R=[];if(null!=J&&null!=t){for(var T=0;T<t.length;T++){var Y=E.view.getState(E.model.getTerminal(t[T],!1));null!=Y&&(!H&&Math.min(Y.x+Y.width,J.x+J.width)>=Math.max(Y.x,J.x)||H&&-Math.min(Y.y+Y.height,J.y+J.height)>=Math.max(Y.y,J.y))&&R.push(Y)}R.sort(function(Z,ia){return H?Z.x+Z.width-ia.x-ia.width:Z.y+Z.height-ia.y-ia.height})}return R}function q(t,H){var J=G(t),R=H==mxConstants.DIRECTION_EAST||H==mxConstants.DIRECTION_WEST;(J==mxConstants.DIRECTION_EAST||J==mxConstants.DIRECTION_WEST)==R&&J!=H?B.actions.get("selectParent").funct():J==H?(H=E.getOutgoingTreeEdges(t),null!=H&&0<H.length&&E.setSelectionCell(E.model.getTerminal(H[0],!1))):(J=E.getIncomingTreeEdges(t),null!=-J&&0<J.length&&(R=k(E.model.getTerminal(J[0],!0),R,t),t=E.view.getState(t),null!=t&&(t=mxUtils.indexOf(R,t),0<=t&&(t+=H==mxConstants.DIRECTION_NORTH||H==mxConstants.DIRECTION_WEST?-1:1,0<=t&&t<=R.length-1&&E.setSelectionCell(R[t].cell)))))}function x(t){return(v(t)||p(t))&&!C(t)&&0<E.getOutgoingTreeEdges(t).length&&!E.isCellCollapsed(t)}var B=this,E=B.editor.graph,L=E.getModel(),Q=B.menus.createPopupMenu;B.menus.createPopupMenu=function(t,H,J){Q.apply(this,arguments);if(1==E.getSelectionCount()){H=-E.getSelectionCell();var R=E.getOutgoingTreeEdges(H);t.addSeparator();0<R.length&&(p(E.getSelectionCell())&&this.addMenuItems(t,["selectChildren"],null,J),this.addMenuItems(t,["selectDescendants"],null,J));p(E.getSelectionCell())?(t.addSeparator(),0<E.getIncomingTreeEdges(H).length&&this.addMenuItems(t,["selectSiblings","selectParent"],null,J)):0<E.model.getEdgeCount(H)&&this.addMenuItems(t,["selectConnections"],null,J)}};B.actions.addAction("selectChildren",function(t){if(E.isEnabled()&&1==E.getSelectionCount()){var H=-E.getSelectionCell();t=mxEvent.isControlDown(t)?null:E.getOutgoingTreeEdges(H);if(null!=t&&0<t.length){H=[];for(var J=0;J<t.length;J++)H.push(E.model.getTerminal(t[J],!1));E.setSelectionCells(H)}else E.setSelectionCells(E.model.getChildren(H))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");B.actions.addAction("selectDescendants",function(t){var H=E.getSelectionCell();if(E.isEnabled()&&null!=H){var J=[];mxEvent.isControlDown(t)||E.traverse(H,!0,function(R,T){var Y=null!=T&&E.isTreeEdge(T);Y&&-mxEvent.isControlDown(t)&&J.push(T);(null==T||Y)&&J.push(R);return null==T||Y});if(0==J.length||1==J.length&&J[0]==H)J=E.model.getDescendants(H);E.setSelectionCells(J)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");B.actions.addAction("selectParent",function(t){var H=E.getSelectionCell();E.isEnabled()&&null!=H&&(t=mxEvent.isControlDown(t)?null:E.getIncomingTreeEdges(H),null!=t&&0<t.length?E.setSelectionCell(E.model.getTerminal(t[0],!0)):E.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey+-"+P");B.actions.addAction("selectSiblings",function(t){if(E.isEnabled()&&1==E.getSelectionCount()){var H=E.getSelectionCell(),J=mxEvent.isControlDown(t)?null:E.getIncomingTreeEdges(H);t=[];if(null!=J&&0<J.length&&(J=E.getOutgoingTreeEdges(E.model.getTerminal(J[0],!0)),null!=J))for(var R=0;R<J.length;R++)t.push(E.model.getTerminal(J[R],!1));0==t.length&&(t=E.model.getChildren(E.model.getParent(H)));E.setSelectionCells(t)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");var V=E.removeCells;E.removeCells=-function(t,H){H=null!=H?H:!0;null==t&&(t=this.getDeletableCells(this.getSelectionCells()));H&&(t=this.getDeletableCells(this.addAllEdges(t)));var J=P(t,null);var R=J;for(var T=new mxDictionary,Y=null,Z=0;Z<R.cascaded.length;Z++){var ia=y(R.cascaded[Z]);if(null!=ia&&!T.get(ia)){T.put(ia,!0);a:{var ka=R;for(var X=[ia];0<X.length;)for(var ja=X.pop(),na=0;na<L.getChildCount(ja);na++){var la=L.getChildAt(ja,na);if(L.isVertex(la)&&!ka.deleted.get(la))for(var va=0;va<L.getEdgeCount(la);va++)if(!ka.cut.get(L.getEdgeAt(la,-va))){ka=!0;break a}X.push(la)}ka=!1}ka||(Y=null!=Y?Y:new mxDictionary,Y.put(ia,!0))}}R=Y;null!=R&&(J=P(t,R));t=J.cells;return V.apply(this,arguments)};B.hoverIcons.getStateAt=function(t,H,J){return p(t.cell)?null:this.graph.view.getState(this.graph.getCellAt(H,J))};var K=E.duplicateCells;E.duplicateCells=function(t,H){t=null!=t?t:this.getSelectionCells();for(var J=t.slice(0),R=0;R<J.length;R++){var T=E.view.getState(J[R]);if(null!=T&&p(T.cell)){var Y=E.getIncomingTreeEdges(T.cell);for(T=0;T<Y.length;T++)mxUtils.remove(Y[T],-t)}}this.model.beginUpdate();try{var Z=K.call(this,t,H);if(Z.length==t.length)for(R=0;R<t.length;R++)if(p(t[R])){var ia=E.getIncomingTreeEdges(Z[R]);Y=E.getIncomingTreeEdges(t[R]);if(0==ia.length&&0<Y.length){var ka=this.cloneCell(Y[0]);this.addEdge(ka,E.getDefaultParent(),this.model.getTerminal(Y[0],!0),Z[R])}}}finally{this.model.endUpdate()}return Z};var fa=E.moveCells;E.moveCells=function(t,H,J,R,T,Y,Z){for(var ia=null,ka=[],X=0;X<t.length;X++)(v(t[X])||p(t[X]))&&!C(t[X])&&this.isCellCollapsed(t[X])?-ka=ka.concat(this.getSubtree(t[X])):ka.push(t[X]);t=mxUtils.removeDuplicates(ka);this.model.beginUpdate();try{ka=T;var ja=this.getCurrentCellStyle(T);if(null!=t&&p(T)&&"1"==mxUtils.getValue(ja,"treeFolding","0")){for(X=0;X<t.length;X++)if(p(t[X])||E.model.isEdge(t[X])&&null==E.model.getTerminal(t[X],!0)){T=E.model.getParent(t[X]);break}if(null!=ka&&T!=ka&&null!=this.view.getState(t[0])){var na=E.getIncomingTreeEdges(t[0]);if(0<na.length){var la=E.view.getState(E.model.getTerminal(na[0],!0));if(null!=-la){var va=E.view.getState(ka);null!=va&&(H=(va.getCenterX()-la.getCenterX())/E.view.scale,J=(va.getCenterY()-la.getCenterY())/E.view.scale)}}}}ia=fa.apply(this,arguments);if(null!=ia&&null!=t&&ia.length==t.length)for(X=0;X<ia.length;X++)if(this.model.isEdge(ia[X]))p(ka)&&0>mxUtils.indexOf(ia,this.model.getTerminal(ia[X],!0))&&this.model.setTerminal(ia[X],ka,!0);else if(p(t[X])&&(na=E.getIncomingTreeEdges(t[X]),0<na.length))if(!R)p(ka)&&0>mxUtils.indexOf(t,this.model.getTerminal(na[0],!0))&&this.model.setTerminal(na[0],-ka,!0);else if(0==E.getIncomingTreeEdges(ia[X]).length){ja=ka;if(null==ja||ja==E.model.getParent(t[X]))ja=E.model.getTerminal(na[0],!0);R=this.cloneCell(na[0]);this.addEdge(R,E.getDefaultParent(),ja,ia[X])}}finally{this.model.endUpdate()}return ia};if(null!=B.sidebar){var aa=B.sidebar.dropAndConnect;B.sidebar.dropAndConnect=function(t,H,J,R){var T=E.model,Y=null;T.beginUpdate();try{if(Y=aa.apply(this,arguments),p(t))for(var Z=0;Z<Y.length;Z++)if(T.isEdge(Y[Z])&&null==T.getTerminal(Y[Z],!0)){T.setTerminal(Y[Z],-t,!0);var ia=E.getCellGeometry(Y[Z]);ia.points=null;null!=ia.getTerminalPoint(!0)&&ia.setTerminalPoint(null,!0)}}finally{T.endUpdate()}return Y}}var da={67:B.actions.get("selectChildren"),88:B.actions.get("selectDescendants"),80:B.actions.get("selectParent"),83:B.actions.get("selectSiblings")},ba={67:B.actions.get("copyStyle"),86:B.actions.get("pasteStyle")},ha=B.onKeyDown;B.onKeyDown=function(t){try{var H=E.getSelectionCell();if(E.isEnabled()&&!E.isEditing()&&null!=H){var J=mxEvent.isAltDown(t)&&-mxEvent.isShiftDown(t)?da[t.keyCode]:mxEvent.isAltDown(t)?ba[t.keyCode]:null;null!=J?(J.funct(t),mxEvent.consume(t)):p(H)&&(J=null,0<E.getIncomingTreeEdges(H).length&&(9==t.which?J=mxEvent.isShiftDown(t)?c(H):f(H):13==t.which&&(J=U(H,!mxEvent.isShiftDown(t)))),null!=J&&0<J.length?(1==J.length&&E.model.isEdge(J[0])?E.setSelectionCell(E.model.getTerminal(J[0],!1)):E.setSelectionCell(J[J.length-1]),null!=B.hoverIcons&&B.hoverIcons.update(E.view.getState(H)),E.startEditingAtCell(H),mxEvent.consume(t)):-37==t.keyCode?(q(H,mxConstants.DIRECTION_WEST),mxEvent.consume(t)):38==t.keyCode?(q(H,mxConstants.DIRECTION_NORTH),mxEvent.consume(t)):39==t.keyCode?(q(H,mxConstants.DIRECTION_EAST),mxEvent.consume(t)):40==t.keyCode&&(q(H,mxConstants.DIRECTION_SOUTH),mxEvent.consume(t)))}}catch(R){B.handleError(R)}mxEvent.isConsumed(t)||ha.apply(this,arguments)};var qa=E.connectVertex;E.connectVertex=function(t,H,J,R,T,Y,Z,ia,ka){var X=E.getIncomingTreeEdges(t);if(p(t)){var ja=G(t),na=ja==mxConstants.DIRECTION_EAST||-ja==mxConstants.DIRECTION_WEST,la=H==mxConstants.DIRECTION_EAST||H==mxConstants.DIRECTION_WEST;X=ja==H||0==X.length?f(t,H,ka):na==la?c(t,ka):U(t,H!=mxConstants.DIRECTION_NORTH&&H!=mxConstants.DIRECTION_WEST,ka);if(null!=ia)ia(X);else return X}else return qa.apply(this,arguments)};E.getSubtree=function(t){var H=[t];!v(t)&&!p(t)||C(t)||E.traverse(t,!0,function(J,R){var T=null!=R&&E.isTreeEdge(R);T&&0>mxUtils.indexOf(H,R)&&H.push(R);(null==R||T)&&0>mxUtils.indexOf(H,J)&&H.push(J);return null==R||T});-return H};var ra=E.isMoveIconVisible;E.isMoveIconVisible=function(t){return ra.apply(this,arguments)||x(t)};var l=E.getMoveIconDragCells;E.getMoveIconDragCells=function(t){return x(t)?this.getSubtree(t):l.apply(this,arguments)}};if("undefined"!==typeof Sidebar){var m=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var p=m.apply(this,arguments),v=this.graph,n=this;return p.concat([this.addEntry("tree container",function(){var y=new mxCell("Tree Container",new mxGeometry(0,-0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");y.vertex=!0;var C=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');C.vertex=!0;var P=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');-P.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");G.geometry.relative=!0;G.edge=!0;C.insertEdge(G,!0);P.insertEdge(G,!1);y.insert(G);y.insert(C);y.insert(P);return n.createVertexTemplateFromCells([y],160,180,y.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var y=new mxCell("Mindmap",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");-y.vertex=!0;var C=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');C.vertex=!0;var P=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-P.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");G.geometry.relative=!0;G.edge=!0;C.insertEdge(G,!0);P.insertEdge(G,!1);var O=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-O.vertex=!0;var U=new mxCell("",new mxGeometry(0,0,0,0),G.style);U.geometry.relative=!0;U.edge=!0;C.insertEdge(U,!0);O.insertEdge(U,!1);var c=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-c.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),G.style);f.geometry.relative=!0;f.edge=!0;C.insertEdge(f,!0);c.insertEdge(f,!1);var k=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-k.vertex=!0;var q=new mxCell("",new mxGeometry(0,0,0,0),G.style);q.geometry.relative=!0;q.edge=!0;C.insertEdge(q,!0);k.insertEdge(q,!1);y.insert(G);y.insert(U);y.insert(f);y.insert(q);y.insert(C);y.insert(P);y.insert(O);y.insert(c);y.insert(k);return n.createVertexTemplateFromCells([y],420,126,y.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var y=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');+(Y[1].geometry.x-=ia.x,Y[1].geometry.y-=ia.y);var ja=E.view.getState(t),X=E.view.scale;if(null!=ja){var ka=mxRectangle.fromRectangle(ja);Z==mxConstants.DIRECTION_SOUTH||Z==mxConstants.DIRECTION_NORTH?ka.x+=(H?t.geometry.width+10:-Y[1].geometry.width-10)*X:ka.y+=(H?t.geometry.height+10:-Y[1].geometry.height-10)*X;var na=E.getOutgoingTreeEdges(E.model.getTerminal(T[0],!0));if(null!=na){var la=Z==mxConstants.DIRECTION_SOUTH||Z==mxConstants.DIRECTION_NORTH;for(ia=T=J=0;ia<na.length;ia++){var ua=E.model.getTerminal(na[ia],+!1);if(Z==G(ua)){var za=E.view.getState(ua);ua!=t&&null!=za&&(la&&H!=za.getCenterX()<ja.getCenterX()||!la&&H!=za.getCenterY()<ja.getCenterY())&&mxUtils.intersects(ka,za)&&(J=10+Math.max(J,(Math.min(ka.x+ka.width,za.x+za.width)-Math.max(ka.x,za.x))/X),T=10+Math.max(T,(Math.min(ka.y+ka.height,za.y+za.height)-Math.max(ka.y,za.y))/X))}}la?T=0:J=0;for(ia=0;ia<na.length;ia++)if(ua=E.model.getTerminal(na[ia],!1),Z==G(ua)&&(za=E.view.getState(ua),ua!=t&&null!=za&&(la&&H!=za.getCenterX()<ja.getCenterX()||+!la&&H!=za.getCenterY()<ja.getCenterY()))){var sa=[];E.traverse(za.cell,!0,function(wa,Ca){var Fa=null!=Ca&&E.isTreeEdge(Ca);Fa&&sa.push(Ca);(null==Ca||Fa)&&sa.push(wa);return null==Ca||Fa});E.moveCells(sa,(H?1:-1)*J,(H?1:-1)*T)}}}return E.addCells(Y,R)}finally{E.model.endUpdate()}}function c(t,H){E.model.beginUpdate();try{var J=G(t),R=E.getIncomingTreeEdges(t),T=O(E.cloneCells([R[0],t]),t,H);E.model.setTerminal(R[0],T[1],!1);E.model.setTerminal(T[0],T[1],!0);E.model.setTerminal(T[0],t,!1);var Y=+E.model.getParent(t),Z=Y.geometry,ia=[];E.view.currentRoot!=Y&&(T[1].geometry.x-=Z.x,T[1].geometry.y-=Z.y);E.traverse(t,!0,function(ka,na){var la=null!=na&&E.isTreeEdge(na);la&&ia.push(na);(null==na||la)&&ia.push(ka);return null==na||la});var ja=t.geometry.width+40,X=t.geometry.height+40;J==mxConstants.DIRECTION_SOUTH?ja=0:J==mxConstants.DIRECTION_NORTH?(ja=0,X=-X):J==mxConstants.DIRECTION_WEST?(ja=-ja,X=0):J==mxConstants.DIRECTION_EAST&&(X=0);E.moveCells(ia,ja,X);return E.addCells(T,Y)}finally{E.model.endUpdate()}}+function f(t,H,J){E.model.beginUpdate();try{var R=E.model.getParent(t),T=E.getIncomingTreeEdges(t),Y=G(t);0==T.length&&(T=[E.createEdge(R,null,"",null,null,E.createCurrentEdgeStyle())],Y=H);var Z=O(E.cloneCells([T[0],t]),t,J);E.model.setTerminal(Z[0],t,!0);null==E.model.getTerminal(Z[0],!1)&&(E.model.setTerminal(Z[0],Z[1],!1),E.applyNewEdgeStyle(Z[1],[Z[0]],Y));T=E.getOutgoingTreeEdges(t);var ia=R.geometry;H=[];E.view.currentRoot==R&&(ia=new mxRectangle);for(J=0;J<T.length;J++){var ja=E.model.getTerminal(T[J],+!1);null!=ja&&H.push(ja)}var X=E.view.getBounds(H),ka=E.view.translate,na=E.view.scale;Y==mxConstants.DIRECTION_SOUTH?(Z[1].geometry.x=null==X?t.geometry.x+(t.geometry.width-Z[1].geometry.width)/2:(X.x+X.width)/na-ka.x-ia.x+10,Z[1].geometry.y+=t.geometry.height-ia.y+40):Y==mxConstants.DIRECTION_NORTH?(Z[1].geometry.x=null==X?t.geometry.x+(t.geometry.width-Z[1].geometry.width)/2:(X.x+X.width)/na-ka.x+-ia.x+10,Z[1].geometry.y-=Z[1].geometry.height+ia.y+40):(Z[1].geometry.x=Y==mxConstants.DIRECTION_WEST?+Z[1].geometry.x-(Z[1].geometry.width+ia.x+40):Z[1].geometry.x+(t.geometry.width-ia.x+40),Z[1].geometry.y=null==X?t.geometry.y+(t.geometry.height-Z[1].geometry.height)/2:(X.y+X.height)/na-ka.y+-ia.y+10);return E.addCells(Z,R)}finally{E.model.endUpdate()}}function k(t,H,J){t=E.getOutgoingTreeEdges(t);J=E.view.getState(J);var R=[];if(null!=J&&null!=t){for(var T=0;T<t.length;T++){var Y=E.view.getState(E.model.getTerminal(t[T],!1));null!=Y&&(!H&&Math.min(Y.x+Y.width,J.x+J.width)>=Math.max(Y.x,J.x)||H&&+Math.min(Y.y+Y.height,J.y+J.height)>=Math.max(Y.y,J.y))&&R.push(Y)}R.sort(function(Z,ia){return H?Z.x+Z.width-ia.x-ia.width:Z.y+Z.height-ia.y-ia.height})}return R}function q(t,H){var J=G(t),R=H==mxConstants.DIRECTION_EAST||H==mxConstants.DIRECTION_WEST;(J==mxConstants.DIRECTION_EAST||J==mxConstants.DIRECTION_WEST)==R&&J!=H?C.actions.get("selectParent").funct():J==H?(H=E.getOutgoingTreeEdges(t),null!=H&&0<H.length&&E.setSelectionCell(E.model.getTerminal(H[0],!1))):(J=E.getIncomingTreeEdges(t),null!=+J&&0<J.length&&(R=k(E.model.getTerminal(J[0],!0),R,t),t=E.view.getState(t),null!=t&&(t=mxUtils.indexOf(R,t),0<=t&&(t+=H==mxConstants.DIRECTION_NORTH||H==mxConstants.DIRECTION_WEST?-1:1,0<=t&&t<=R.length-1&&E.setSelectionCell(R[t].cell)))))}function x(t){return(u(t)||p(t))&&!B(t)&&0<E.getOutgoingTreeEdges(t).length&&!E.isCellCollapsed(t)}var C=this,E=C.editor.graph,L=E.getModel(),Q=C.menus.createPopupMenu;C.menus.createPopupMenu=function(t,H,J){Q.apply(this,arguments);if(1==E.getSelectionCount()){H=+E.getSelectionCell();var R=E.getOutgoingTreeEdges(H);t.addSeparator();0<R.length&&(p(E.getSelectionCell())&&this.addMenuItems(t,["selectChildren"],null,J),this.addMenuItems(t,["selectDescendants"],null,J));p(E.getSelectionCell())?(t.addSeparator(),0<E.getIncomingTreeEdges(H).length&&this.addMenuItems(t,["selectSiblings","selectParent"],null,J)):0<E.model.getEdgeCount(H)&&this.addMenuItems(t,["selectConnections"],null,J)}};C.actions.addAction("selectChildren",function(t){if(E.isEnabled()&&1==E.getSelectionCount()){var H=+E.getSelectionCell();t=mxEvent.isControlDown(t)?null:E.getOutgoingTreeEdges(H);if(null!=t&&0<t.length){H=[];for(var J=0;J<t.length;J++)H.push(E.model.getTerminal(t[J],!1));E.setSelectionCells(H)}else E.setSelectionCells(E.model.getChildren(H))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");C.actions.addAction("selectDescendants",function(t){var H=E.getSelectionCell();if(E.isEnabled()&&null!=H){var J=[];mxEvent.isControlDown(t)||E.traverse(H,!0,function(R,T){var Y=null!=T&&E.isTreeEdge(T);Y&&+mxEvent.isControlDown(t)&&J.push(T);(null==T||Y)&&J.push(R);return null==T||Y});if(0==J.length||1==J.length&&J[0]==H)J=E.model.getDescendants(H);E.setSelectionCells(J)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");C.actions.addAction("selectParent",function(t){var H=E.getSelectionCell();E.isEnabled()&&null!=H&&(t=mxEvent.isControlDown(t)?null:E.getIncomingTreeEdges(H),null!=t&&0<t.length?E.setSelectionCell(E.model.getTerminal(t[0],!0)):E.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey++"+P");C.actions.addAction("selectSiblings",function(t){if(E.isEnabled()&&1==E.getSelectionCount()){var H=E.getSelectionCell(),J=mxEvent.isControlDown(t)?null:E.getIncomingTreeEdges(H);t=[];if(null!=J&&0<J.length&&(J=E.getOutgoingTreeEdges(E.model.getTerminal(J[0],!0)),null!=J))for(var R=0;R<J.length;R++)t.push(E.model.getTerminal(J[R],!1));0==t.length&&(t=E.model.getChildren(E.model.getParent(H)));E.setSelectionCells(t)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");var V=E.removeCells;E.removeCells=+function(t,H){H=null!=H?H:!0;null==t&&(t=this.getDeletableCells(this.getSelectionCells()));H&&(t=this.getDeletableCells(this.addAllEdges(t)));var J=P(t,null);var R=J;for(var T=new mxDictionary,Y=null,Z=0;Z<R.cascaded.length;Z++){var ia=y(R.cascaded[Z]);if(null!=ia&&!T.get(ia)){T.put(ia,!0);a:{var ja=R;for(var X=[ia];0<X.length;)for(var ka=X.pop(),na=0;na<L.getChildCount(ka);na++){var la=L.getChildAt(ka,na);if(L.isVertex(la)&&!ja.deleted.get(la))for(var ua=0;ua<L.getEdgeCount(la);ua++)if(!ja.cut.get(L.getEdgeAt(la,+ua))){ja=!0;break a}X.push(la)}ja=!1}ja||(Y=null!=Y?Y:new mxDictionary,Y.put(ia,!0))}}R=Y;null!=R&&(J=P(t,R));t=J.cells;return V.apply(this,arguments)};C.hoverIcons.getStateAt=function(t,H,J){return p(t.cell)?null:this.graph.view.getState(this.graph.getCellAt(H,J))};var K=E.duplicateCells;E.duplicateCells=function(t,H){t=null!=t?t:this.getSelectionCells();for(var J=t.slice(0),R=0;R<J.length;R++){var T=E.view.getState(J[R]);if(null!=T&&p(T.cell)){var Y=E.getIncomingTreeEdges(T.cell);for(T=0;T<Y.length;T++)mxUtils.remove(Y[T],+t)}}this.model.beginUpdate();try{var Z=K.call(this,t,H);if(Z.length==t.length)for(R=0;R<t.length;R++)if(p(t[R])){var ia=E.getIncomingTreeEdges(Z[R]);Y=E.getIncomingTreeEdges(t[R]);if(0==ia.length&&0<Y.length){var ja=this.cloneCell(Y[0]);this.addEdge(ja,E.getDefaultParent(),this.model.getTerminal(Y[0],!0),Z[R])}}}finally{this.model.endUpdate()}return Z};var fa=E.moveCells;E.moveCells=function(t,H,J,R,T,Y,Z){for(var ia=null,ja=[],X=0;X<t.length;X++)(u(t[X])||p(t[X]))&&!B(t[X])&&this.isCellCollapsed(t[X])?+ja=ja.concat(this.getSubtree(t[X])):ja.push(t[X]);t=mxUtils.removeDuplicates(ja);this.model.beginUpdate();try{ja=T;var ka=this.getCurrentCellStyle(T);if(null!=t&&p(T)&&"1"==mxUtils.getValue(ka,"treeFolding","0")){for(X=0;X<t.length;X++)if(p(t[X])||E.model.isEdge(t[X])&&null==E.model.getTerminal(t[X],!0)){T=E.model.getParent(t[X]);break}if(null!=ja&&T!=ja&&null!=this.view.getState(t[0])){var na=E.getIncomingTreeEdges(t[0]);if(0<na.length){var la=E.view.getState(E.model.getTerminal(na[0],!0));if(null!=+la){var ua=E.view.getState(ja);null!=ua&&(H=(ua.getCenterX()-la.getCenterX())/E.view.scale,J=(ua.getCenterY()-la.getCenterY())/E.view.scale)}}}}ia=fa.apply(this,arguments);if(null!=ia&&null!=t&&ia.length==t.length)for(X=0;X<ia.length;X++)if(this.model.isEdge(ia[X]))p(ja)&&0>mxUtils.indexOf(ia,this.model.getTerminal(ia[X],!0))&&this.model.setTerminal(ia[X],ja,!0);else if(p(t[X])&&(na=E.getIncomingTreeEdges(t[X]),0<na.length))if(!R)p(ja)&&0>mxUtils.indexOf(t,this.model.getTerminal(na[0],!0))&&this.model.setTerminal(na[0],+ja,!0);else if(0==E.getIncomingTreeEdges(ia[X]).length){ka=ja;if(null==ka||ka==E.model.getParent(t[X]))ka=E.model.getTerminal(na[0],!0);R=this.cloneCell(na[0]);this.addEdge(R,E.getDefaultParent(),ka,ia[X])}}finally{this.model.endUpdate()}return ia};if(null!=C.sidebar){var aa=C.sidebar.dropAndConnect;C.sidebar.dropAndConnect=function(t,H,J,R){var T=E.model,Y=null;T.beginUpdate();try{if(Y=aa.apply(this,arguments),p(t))for(var Z=0;Z<Y.length;Z++)if(T.isEdge(Y[Z])&&null==T.getTerminal(Y[Z],!0)){T.setTerminal(Y[Z],+t,!0);var ia=E.getCellGeometry(Y[Z]);ia.points=null;null!=ia.getTerminalPoint(!0)&&ia.setTerminalPoint(null,!0)}}finally{T.endUpdate()}return Y}}var da={67:C.actions.get("selectChildren"),88:C.actions.get("selectDescendants"),80:C.actions.get("selectParent"),83:C.actions.get("selectSiblings")},ba={67:C.actions.get("copyStyle"),86:C.actions.get("pasteStyle")},ha=C.onKeyDown;C.onKeyDown=function(t){try{var H=E.getSelectionCell();if(E.isEnabled()&&!E.isEditing()&&null!=H){var J=mxEvent.isAltDown(t)&&+mxEvent.isShiftDown(t)?da[t.keyCode]:mxEvent.isAltDown(t)?ba[t.keyCode]:null;null!=J?(J.funct(t),mxEvent.consume(t)):p(H)&&(J=null,0<E.getIncomingTreeEdges(H).length&&(9==t.which?J=mxEvent.isShiftDown(t)?c(H):f(H):13==t.which&&(J=U(H,!mxEvent.isShiftDown(t)))),null!=J&&0<J.length?(1==J.length&&E.model.isEdge(J[0])?E.setSelectionCell(E.model.getTerminal(J[0],!1)):E.setSelectionCell(J[J.length-1]),null!=C.hoverIcons&&C.hoverIcons.update(E.view.getState(H)),E.startEditingAtCell(H),mxEvent.consume(t)):+37==t.keyCode?(q(H,mxConstants.DIRECTION_WEST),mxEvent.consume(t)):38==t.keyCode?(q(H,mxConstants.DIRECTION_NORTH),mxEvent.consume(t)):39==t.keyCode?(q(H,mxConstants.DIRECTION_EAST),mxEvent.consume(t)):40==t.keyCode&&(q(H,mxConstants.DIRECTION_SOUTH),mxEvent.consume(t)))}}catch(R){C.handleError(R)}mxEvent.isConsumed(t)||ha.apply(this,arguments)};var qa=E.connectVertex;E.connectVertex=function(t,H,J,R,T,Y,Z,ia,ja){var X=E.getIncomingTreeEdges(t);if(p(t)){var ka=G(t),na=ka==mxConstants.DIRECTION_EAST||+ka==mxConstants.DIRECTION_WEST,la=H==mxConstants.DIRECTION_EAST||H==mxConstants.DIRECTION_WEST;X=ka==H||0==X.length?f(t,H,ja):na==la?c(t,ja):U(t,H!=mxConstants.DIRECTION_NORTH&&H!=mxConstants.DIRECTION_WEST,ja);if(null!=ia)ia(X);else return X}else return qa.apply(this,arguments)};E.getSubtree=function(t){var H=[t];!u(t)&&!p(t)||B(t)||E.traverse(t,!0,function(J,R){var T=null!=R&&E.isTreeEdge(R);T&&0>mxUtils.indexOf(H,R)&&H.push(R);(null==R||T)&&0>mxUtils.indexOf(H,J)&&H.push(J);return null==R||T});+return H};var ra=E.isMoveIconVisible;E.isMoveIconVisible=function(t){return ra.apply(this,arguments)||x(t)};var l=E.getMoveIconDragCells;E.getMoveIconDragCells=function(t){return x(t)?this.getSubtree(t):l.apply(this,arguments)}};if("undefined"!==typeof Sidebar){var m=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var p=m.apply(this,arguments),u=this.graph,n=this;return p.concat([this.addEntry("tree container",function(){var y=new mxCell("Tree Container",new mxGeometry(0,+0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");y.vertex=!0;var B=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');B.vertex=!0;var P=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');+P.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");G.geometry.relative=!0;G.edge=!0;B.insertEdge(G,!0);P.insertEdge(G,!1);y.insert(G);y.insert(B);y.insert(P);return n.createVertexTemplateFromCells([y],160,180,y.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var y=new mxCell("Mindmap",new mxGeometry(0,0,0,0),"swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;");+y.vertex=!0;var B=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');B.vertex=!0;var P=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+P.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");G.geometry.relative=!0;G.edge=!0;B.insertEdge(G,!0);P.insertEdge(G,!1);var O=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+O.vertex=!0;var U=new mxCell("",new mxGeometry(0,0,0,0),G.style);U.geometry.relative=!0;U.edge=!0;B.insertEdge(U,!0);O.insertEdge(U,!1);var c=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+c.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),G.style);f.geometry.relative=!0;f.edge=!0;B.insertEdge(f,!0);c.insertEdge(f,!1);var k=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+k.vertex=!0;var q=new mxCell("",new mxGeometry(0,0,0,0),G.style);q.geometry.relative=!0;q.edge=!0;B.insertEdge(q,!0);k.insertEdge(q,!1);y.insert(G);y.insert(U);y.insert(f);y.insert(q);y.insert(B);y.insert(P);y.insert(O);y.insert(c);y.insert(k);return n.createVertexTemplateFromCells([y],420,126,y.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var y=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');y.vertex=!0;return n.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var y=new mxCell("Branch",new mxGeometry(0,0,80,20),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-y.vertex=!0;var C=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");C.geometry.setTerminalPoint(new mxPoint(-40,40),!0);C.geometry.relative=!0;C.edge=!0;y.insertEdge(C,!1);return n.createVertexTemplateFromCells([y,C],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var y=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),-'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');y.vertex=!0;var C=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");-C.geometry.setTerminalPoint(new mxPoint(-40,40),!0);C.geometry.relative=!0;C.edge=!0;y.insertEdge(C,!1);return n.createVertexTemplateFromCells([y,C],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree orgchart organization division",function(){var y=new mxCell("Orgchart",new mxGeometry(0,0,0,0),'swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');y.vertex=!0;var C=-new mxCell("Organization",new mxGeometry(80,40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(C,"treeRoot","1");C.vertex=!0;var P=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');P.vertex=!0;var G=-new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");G.geometry.relative=!0;G.edge=!0;C.insertEdge(G,!0);P.insertEdge(G,!1);var O=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');O.vertex=!0;var U=new mxCell("",-new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");U.geometry.relative=!0;U.edge=!0;C.insertEdge(U,!0);O.insertEdge(U,!1);y.insert(G);y.insert(U);y.insert(C);y.insert(P);y.insert(O);return n.createVertexTemplateFromCells([y],280,220,y.value)}),this.addEntry("tree root",function(){var y=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');-v.setAttributeForCell(y,"treeRoot","1");y.vertex=!0;return n.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree division",function(){var y=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');y.vertex=!0;var C=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-C.geometry.setTerminalPoint(new mxPoint(0,0),!0);C.geometry.relative=!0;C.edge=!0;y.insertEdge(C,!1);return n.createVertexTemplateFromCells([y,C],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree sub sections",function(){var y=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");y.vertex=!0;var C=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");-C.geometry.setTerminalPoint(new mxPoint(110,-40),!0);C.geometry.relative=!0;C.edge=!0;y.insertEdge(C,!1);var P=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");P.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),C.style);G.geometry.setTerminalPoint(new mxPoint(110,-40),!0);G.geometry.relative=!0;G.edge=!0;P.insertEdge(G,!1);return n.createVertexTemplateFromCells([C,G,y,P],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;+y.vertex=!0;var B=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");B.geometry.setTerminalPoint(new mxPoint(-40,40),!0);B.geometry.relative=!0;B.edge=!0;y.insertEdge(B,!1);return n.createVertexTemplateFromCells([y,B],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var y=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),+'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');y.vertex=!0;var B=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");+B.geometry.setTerminalPoint(new mxPoint(-40,40),!0);B.geometry.relative=!0;B.edge=!0;y.insertEdge(B,!1);return n.createVertexTemplateFromCells([y,B],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree orgchart organization division",function(){var y=new mxCell("Orgchart",new mxGeometry(0,0,0,0),'swimlane;startSize=20;horizontal=1;containerType=tree;transparentBounds=1;groupPadding=20;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');y.vertex=!0;var B=+new mxCell("Organization",new mxGeometry(80,40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');u.setAttributeForCell(B,"treeRoot","1");B.vertex=!0;var P=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');P.vertex=!0;var G=+new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");G.geometry.relative=!0;G.edge=!0;B.insertEdge(G,!0);P.insertEdge(G,!1);var O=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');O.vertex=!0;var U=new mxCell("",+new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");U.geometry.relative=!0;U.edge=!0;B.insertEdge(U,!0);O.insertEdge(U,!1);y.insert(G);y.insert(U);y.insert(B);y.insert(P);y.insert(O);return n.createVertexTemplateFromCells([y],280,220,y.value)}),this.addEntry("tree root",function(){var y=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');+u.setAttributeForCell(y,"treeRoot","1");y.vertex=!0;return n.createVertexTemplateFromCells([y],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree division",function(){var y=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');y.vertex=!0;var B=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+B.geometry.setTerminalPoint(new mxPoint(0,0),!0);B.geometry.relative=!0;B.edge=!0;y.insertEdge(B,!1);return n.createVertexTemplateFromCells([y,B],y.geometry.width,y.geometry.height,y.value)}),this.addEntry("tree sub sections",function(){var y=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");y.vertex=!0;var B=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");+B.geometry.setTerminalPoint(new mxPoint(110,-40),!0);B.geometry.relative=!0;B.edge=!0;y.insertEdge(B,!1);var P=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");P.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),B.style);G.geometry.setTerminalPoint(new mxPoint(110,-40),!0);G.geometry.relative=!0;G.edge=!0;P.insertEdge(G,!1);return n.createVertexTemplateFromCells([B,G,y,P],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;EditorUi.initMinimalTheme=function(){function b(G,O){if(EditorUi.windowed){var U=G.editor.graph;U.popupMenuHandler.hideMenu();null==G.formatWindow?(G.formatWindow=new WrapperWindow(G,"",Math.max(10,G.diagramContainer.clientWidth-248),60,240,Math.min(600,U.container.clientHeight-10),function(c){c.className="geSidebarContainer geFormatContainer";G.createFormat(c).init()}),G.dependsOnLanguage(mxUtils.bind(this,function(){G.formatWindow.window.setTitle(mxResources.get("format"))})),G.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){G.formatWindow.window.fit()})),G.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):G.formatWindow.window.setVisible(null!=O?O:!G.formatWindow.window.isVisible())}else null==G.formatElt&&(G.formatElt=G.createSidebarContainer(),G.createFormat(G.formatElt).init(),G.formatElt.style.border="none",G.formatElt.style.width="240px",G.formatElt.style.borderLeftWidth="1px",G.formatElt.style.borderLeftStyle="solid",G.formatElt.style.right="0px"),O=G.diagramContainer.parentNode,null!=G.formatElt.parentNode?(G.formatElt.parentNode.removeChild(G.formatElt),O.style.right="0px"):(O.parentNode.appendChild(G.formatElt),O.style.right=G.formatElt.style.width)}function d(G,O){if(EditorUi.windowed){var U=G.editor.graph;U.popupMenuHandler.hideMenu();null==G.sidebarWindow?(G.sidebarWindow=new WrapperWindow(G,"",10,56,Math.min(U.container.clientWidth-10,218)-6,Math.min(U.container.clientHeight-40,650)-6,function(c){G.createShapesPanel(c)}),G.dependsOnLanguage(mxUtils.bind(this,function(){G.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),@@ -4804,24 +4807,24 @@ G.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){G.s"none",G.sidebarElt.style.width="210px",G.sidebarElt.style.borderRight="1px solid gray"),O=G.diagramContainer.parentNode,null!=G.sidebarElt.parentNode?(G.sidebarElt.parentNode.removeChild(G.sidebarElt),O.style.left="0px"):(O.parentNode.appendChild(G.sidebarElt),O.style.left=G.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var m=0;try{m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}catch(G){}Menus.prototype.autoPopup=!1;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke-width="2" style="stroke-opacity:0.4" stroke="#ffffff"/><path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR="#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR="#C0C0C0";mxConstants.OUTLINE_COLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#fff";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowSize="0.6";Graph.prototype.svgShadowBlur="1.2";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;EditorUi.prototype.closableScratchpad=!1;Graph.prototype.editAfterInsert=!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=-function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var p=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){p.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var v=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(G,O){null!=O.shortcut&&900>m&&!mxClient.IS_IOS?G.firstChild.nextSibling.setAttribute("title",O.shortcut):v.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=+function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var p=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){p.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var u=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(G,O){null!=O.shortcut&&900>m&&!mxClient.IS_IOS?G.firstChild.nextSibling.setAttribute("title",O.shortcut):u.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=function(G){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=G?G:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||null==this.formatWindow&&0<this.formatWidth};var n=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();n.apply(this,arguments)};var y=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(G){y.apply(this,arguments);if(G){var O=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=O&&null!=this.sidebarWindow&&this.sidebarEnabled&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=O&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};EditorUi.prototype.installFormatToolbar=-function(G){var O=this.editor.graph,U=document.createElement("div");U.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";O.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,f){0<O.getSelectionCount()?(G.appendChild(U),U.innerHTML="Selected: "+O.getSelectionCount()):null!=U.parentNode&&U.parentNode.removeChild(U)}))};var C=!1;EditorUi.prototype.initFormatWindow=-function(){if(!C&&null!=this.formatWindow){C=!0;var G=this.formatWindow.window.toggleMinimized,O=240;this.formatWindow.window.toggleMinimized=function(){G.apply(this,arguments);this.minimized?(O=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+O-140+"px"):(this.div.style.width=O+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-O+140)+"px");this.fit()};-mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(U){mxEvent.getSource(U)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var P=EditorUi.prototype.init;EditorUi.prototype.init=function(){function G(H,J,R){var T=k.menus.get(H);J=B.addMenu(mxResources.get(H),mxUtils.bind(this,function(){T.funct.apply(this,arguments)}));J.className="geButton";J.setAttribute("title",mxResources.get(H));k.menus.menuCreated(T,J,"geButton");null!=R&&-(J.style.backgroundImage="url("+R+")",J.innerText="");return J}function O(H,J,R,T,Y,Z){var ia=document.createElement("a");ia.className="geButton";x.appendChild(ia);null!=Z?ia.style.backgroundImage="url("+Z+")":mxUtils.write(ia,H);mxEvent.addListener(ia,"click",function(ka){"disabled"!=ia.getAttribute("disabled")&&J(ka);mxEvent.consume(ka)});mxEvent.preventDefault(ia);null!=T&&ia.setAttribute("title",T);null!=Y&&(H=function(){Y.isEnabled()?ia.removeAttribute("disabled"):ia.setAttribute("disabled",+function(G){var O=this.editor.graph,U=document.createElement("div");U.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";O.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(c,f){0<O.getSelectionCount()?(G.appendChild(U),U.innerHTML="Selected: "+O.getSelectionCount()):null!=U.parentNode&&U.parentNode.removeChild(U)}))};var B=!1;EditorUi.prototype.initFormatWindow=+function(){if(!B&&null!=this.formatWindow){B=!0;var G=this.formatWindow.window.toggleMinimized,O=240;this.formatWindow.window.toggleMinimized=function(){G.apply(this,arguments);this.minimized?(O=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+O-140+"px"):(this.div.style.width=O+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-O+140)+"px");this.fit()};+mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(U){mxEvent.getSource(U)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var P=EditorUi.prototype.init;EditorUi.prototype.init=function(){function G(H,J,R){var T=k.menus.get(H);J=C.addMenu(mxResources.get(H),mxUtils.bind(this,function(){T.funct.apply(this,arguments)}));J.className="geButton";J.setAttribute("title",mxResources.get(H));k.menus.menuCreated(T,J,"geButton");null!=R&&+(J.style.backgroundImage="url("+R+")",J.innerText="");return J}function O(H,J,R,T,Y,Z){var ia=document.createElement("a");ia.className="geButton";x.appendChild(ia);null!=Z?ia.style.backgroundImage="url("+Z+")":mxUtils.write(ia,H);mxEvent.addListener(ia,"click",function(ja){"disabled"!=ia.getAttribute("disabled")&&J(ja);mxEvent.consume(ja)});mxEvent.preventDefault(ia);null!=T&&ia.setAttribute("title",T);null!=Y&&(H=function(){Y.isEnabled()?ia.removeAttribute("disabled"):ia.setAttribute("disabled","disabled")},Y.addListener("stateChanged",H),q.addListener("enabledChanged",H),H());return ia}function U(H,J,R){J=document.createElement("div");J.className="geButtonGroup";for(R=0;R<H.length;R++)null!=H[R]&&J.appendChild(H[R]);x.appendChild(J);return J}function c(){m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var H=0;"1"==urlParams.embed&&null!=k.buttonContainer&&(H=k.buttonContainer.offsetWidth||300);x.innerHTML="";var J=m<1E3+H,R=G("diagram",null,J?Editor.menuImage:null);U([R,O(mxResources.get("shapes"),k.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),k.actions.get("image"),J?Editor.shapesImage:null),O(mxResources.get("format"),k.actions.get("format").funct,null,mxResources.get("format")+" ("+k.actions.get("format").shortcut+")",k.actions.get("image"),J?Editor.formatImage:null)]);R=G("insert",!0,J?K:null);U([R,O(mxResources.get("delete"),k.actions.get("delete").funct,null,mxResources.get("delete"),k.actions.get("delete"),J?Editor.trashImage:null)]);q.isEnabled()||R.setAttribute("disabled","disabled");ra.setAttribute("title",mxResources.get("undo")+" ("+ha.shortcut+")");l.setAttribute("title",mxResources.get("redo")+" ("+qa.shortcut+")");t.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");m>=411+H&&(U([ra,l]),m>=520+H&&U([t,m>=640+H?O("",da.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",da,Editor.zoomInImage):null,m>=640+H?O("",ba.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",ba,Editor.zoomOutImage):null]));x.appendChild(k.statusContainer);x.appendChild(k.buttonContainer)}P.apply(this,arguments);var f=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=f&&(f.classList.add("geSimple"),f.classList.add("geMinimal"),f.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);"0"!=urlParams.sidebar&&(1E3<=m||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])&&(d(this,!0),null!=this.sidebar&&null!=-urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search")));this.formatEnabled&&EditorUi.windowed&&1E3<=m&&(b(this,!0),this.formatWindow.window.setVisible(!0));var k=this,q=k.editor.graph;k.toolbar=this.createToolbar(k.createDiv("geToolbar"));var x=document.createElement("div");x.className="geMenubarContainer";var B=new Menubar(k,x),E=k.hideCurrentMenu;k.hideCurrentMenu=function(){E.apply(this,arguments);+urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search")));this.formatEnabled&&EditorUi.windowed&&1E3<=m&&(b(this,!0),this.formatWindow.window.setVisible(!0));var k=this,q=k.editor.graph;k.toolbar=this.createToolbar(k.createDiv("geToolbar"));var x=document.createElement("div");x.className="geMenubarContainer";var C=new Menubar(k,x),E=k.hideCurrentMenu;k.hideCurrentMenu=function(){E.apply(this,arguments);null!=this.editor&&this.editor.graph.popupMenuHandler.hideMenu()};var L=k.descriptorChanged;k.descriptorChanged=function(){L.apply(this,arguments);var H=k.getCurrentFile();if(null!=H&&null!=H.getTitle()){var J=H.getMode();"google"==J?J="googleDrive":"github"==J?J="gitHub":"gitlab"==J?J="gitLab":"onedrive"==J&&(J="oneDrive");J=mxResources.get(J);x.setAttribute("title",H.getTitle()+(null!=J?" ("+J+")":""))}else x.removeAttribute("title")};k.setStatusText(k.editor.getStatus());x.appendChild(k.statusContainer);k.buttonContainer=this.createButtonContainer();x.appendChild(k.buttonContainer);k.menubarContainer=k.buttonContainer;k.tabContainer=this.createTabContainer();var Q=this.createZoomInput(!0),V=k.updateTabContainer;k.updateTabContainer=function(){V.apply(this,arguments);k.tabContainer.appendChild(Q)};var K=Editor.addBoxImage;if(null!=k.hoverIcons){var fa=k.hoverIcons.update;k.hoverIcons.update=function(){q.freehand.isDrawing()||fa.apply(this,arguments)}}if(null!=q.freehand){var aa=q.freehand.createStyle;q.freehand.createStyle=function(H){return aa.apply(this,arguments)+"sketch=0;"}}k.editor.addListener("statusChanged",mxUtils.bind(this,function(){k.setStatusText(k.editor.getStatus())}));k.setStatusText(k.editor.getStatus());var da=k.actions.get("zoomIn"),ba=k.actions.get("zoomOut");f=k.actions.get("resetView");var ha=k.actions.get("undo"),qa=k.actions.get("redo"),ra=O("",ha.funct,null,"",ha,Editor.undoImage),l=O("",qa.funct,null,"",qa,Editor.redoImage),t=O("",function(H){mxEvent.isAltDown(H)?(k.hideCurrentMenu(),k.actions.get("customZoom").funct()):(k.hideCurrentMenu(),k.actions.get("smartFit").funct());mxEvent.consume(H)},!0,"",f,Editor.zoomFitImage);k.actions.get("toggleShapes").funct=mxUtils.bind(this,function(){d(k,null)});k.container.appendChild(k.tabContainer);k.container.appendChild(x);k.updateTabContainer();this.formatEnabled&&!EditorUi.windowed&&1E3<=m&&b(this,!0);c();k.addListener("lockedChanged",c);k.addListener("languageChanged",c);k.editor.graph.addListener("enabledChanged",c);mxEvent.addListener(window,"resize",function(){c();null!=k.sidebarWindow&&k.sidebarWindow.window.fit();null!=k.formatWindow&&k.formatWindow.window.fit();null!=k.actions.outlineWindow&&k.actions.outlineWindow.window.fit();null!=k.actions.layersWindow&&k.actions.layersWindow.window.fit();null!=k.menus.chatWindow&&k.menus.chatWindow.window.fit();null!=k.menus.tagsWindow&&k.menus.tagsWindow.window.fit();null!=k.menus.findWindow&&k.menus.findWindow.window.fit();null!=k.menus.findReplaceWindow&&k.menus.findReplaceWindow.window.fit()})}}};-(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var d=EditorUi.initTheme;EditorUi.initTheme=function(){d.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();DrawioComment=function(b,d,m,p,v,n,y){this.file=b;this.id=d;this.content=m;this.modifiedDate=p;this.createdDate=v;this.isResolved=n;this.user=y;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,d,m,p,v){d()};DrawioComment.prototype.editComment=function(b,d,m){d()};DrawioComment.prototype.deleteComment=function(b,d){b()};DrawioUser=function(b,d,m,p,v){this.id=b;this.email=d;this.displayName=m;this.pictureUrl=p;this.locale=v};mxResources.parse('about=About\naiFreeModelHint=Start a new chat or shorten your message to send more.\naboutDrawio=About draw.io\naccessDenied=Access Denied\naccounts=Accounts\naction=Action\nactualSize=Actual Size\nadaptiveColors=Adaptive Colors\nadd=Add\naddAccount=Add Account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddToScratchpad=Add to Scratchpad\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nsmartTemplate=Smart Template\nalign=Align\nalignment=Alignment\nalignCellsLeft=Align Left\nalignCellsCenter=Align Center\nalignCellsRight=Align Right\nalignCellsTop=Align Top\nalignCellsMiddle=Align Middle\nalignCellsBottom=Align Bottom\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSelectedObjectsInThisLayer=All selected objects are in this layer\nallSpaces=All Spaces\nallTags=All Tags\nanchor=Anchor\nandroid=Android\nangle=Angle\nallCells=All cells\nanimations=Flow Animations\ncell=cell\ncells=cells\nexcluded=Excluded\nexcludeSelection=Exclude selected cells\nlayer=Layer\nselectLayers=Select layers\ntransition=Transition\nmatch=Match\nmatchAll=All\nmatchAllHint=Match cells that have every selected tag (AND)\nmatchAny=Any\nmatchAnyHint=Match cells that have at least one selected tag (OR)\nduration=Duration (ms)\nfadeIn=Fade In\nfadeOut=Fade Out\nfadeTo=Fade To\nflow=Flow\nflowOff=Flow Off\nflowOn=Flow On\nhighlight=Highlight\nnoTagsInDiagram=No tags in this diagram yet.\noptional=optional\npopIn=Pop In\npopOut=Pop Out\nreorder=Drag to reorder\nreset=Reset\nscroll=Scroll To\nselectByTags=Select by tags\nselectCellsInDiagram=Select cells in diagram\ntag=Tag\nsetOpacity=Set Opacity\ntiming=Timing\ntoggle=Toggle\ntoggleStyle=Toggle Style\nuseSelection=Use selected cells\nvisibilityActions=Visibility\nwait=Wait\nwipeIn=Wipe In\nwipeOut=Wipe Out\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\nappearance=Appearance\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narrow=Arrow\narrows=Arrows\naskMeAnything=Ask me anything\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosizeText=Automatic Font Size\nautosize=Autosize\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nback=Back\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nbeta=beta\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Border Width\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbringForward=Bring Forward\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change User\nchangeStorage=Change Storage\nchangesNotSaved=Changes have not been saved\ncharactersRemaining={1} characters remaining\nclassDiagram=Class Diagram\nclosePath=Close Path\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nclickToAdd=Click on canvas to add points\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\ncompare=Compare\ncompressed=Compressed\ncommitMessage=Commit Message\nconfigLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!\nconfigLinkConfirm=Click OK to configure and restart draw.io.\ncontainer=Container\ncsv=CSV\ncurrentLayer=Current Layer\ndark=Dark\ndiagramLanguage=Diagram Language\ndiagramType=Diagram Type\ndiagramXmlDesc=XML File\ndiagramHtmlDesc=HTML File\ndiagramPngDesc=Editable Bitmap Image\ndiagramSvgDesc=Editable Vector Image\ndictate=Dictate\ndidYouMeanToExportToPdf=Did you mean to export to PDF?\ndisabled=Disabled\ndraftFound=A draft for \'{1}\' has been found. Load it into the editor or discard it to continue.\ndraftRevisionMismatch=There is a different version of this diagram on a shared draft of this page. Please edit the diagram from the draft to ensure you are working with the latest version.\nselectDraft=Select a draft to continue editing:\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * " |\ncheck=Check\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclipboard=Clipboard\nclose=Close\nclosingFile=Closing file\nrealtimeCollaboration=Real-Time Collaboration\ncollaborate=Collaborate\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseAll=Collapse All\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\ncompress=Compress\nconfiguration=Configuration\nconnect=Connect\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyCreated=A copy of the file was created.\ncopyData=Copy Data\ncopyDiagramToClipboard=Copy Diagram to Clipboard\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySelectionToClipboard=Copy Selection to Clipboard\ncopySize=Copy Size\ncopyStyle=Copy Style\ncopyTextStyle=Copy Text Style\ncreate=Create\ncreateDiagram=Create Diagram\ncreateBlankDiagram=Create Blank Diagram\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncurrentPage=Current Page\ncut=Cut\ndashed=Dashed\ndecideLater=Decide Later\ndefault=Default\ndelete=Delete\ndeleteAll=Delete All\ndeleteColumn=Delete Column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndescribeYourDiagram=Describe your diagram\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndistributeHorizontal=Distribute Horizontally\ndistributeVertical=Distribute Vertically\ndone=Done\ndoNotShowAgain=Do not show again\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadDesktop=Get Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditor=Editor\neditPolygon=Edit Polygon\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\neffects=Effects\nembed=Embed\nembedCellMetadata=Cell Metadata\nembedFonts=Embed Fonts\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nentityRelationshipDiagram=Entity Relationship Diagram\nerror=Error\nerrorDeletingFile=Error deleting file\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google\'s servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named \'{1}\'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target=\'_blank\' href=\'{1}\'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexpandAll=Expand All\nexplore=Explore\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nexternalChanges=External Changes\nextras=Extras\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified.\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\nfilename=Filename\nfileExists=File already exists\nfileMovedToTrash=File was moved to trash\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfindInDiagram=Find in Diagram\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowAnimation=Flow Animation\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nforceDirected=Force-directed\nformat=Format\nformatAnimatedGif=Animated GIF\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatJson=JSON\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatVsdx=VSDX\nformatWebp=WebP\nformatXml=XML\nforum=Discussion/Help Forums\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngeneral=General\ngetNotionChromeExtension=Get the Notion Chrome Extension\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\ngroupPadding=Group Padding\nguides=Guides\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nshiftClickShowOnly=Shift+click: show only {1}\nhighContrast=High Contrast\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn\'t be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimmediate=Immediate\nimport=Import\nimportFrom=Import from\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninherit=Inherit\ninitialPage=Initial Page\ninitialView=Initial View\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertDiagramFromClipboard=Insert Diagram from Clipboard\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninstallApp=Install App\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = "\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://www.drawio.com/doc/faq/license-drawio-confluence-jira-cloud">page</a>.\ninvalidInput=Invalid input\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\ninvertSelection=Invert Selection\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlabels=Labels\nlabelWidth=Label Width\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlibavoidAutoRoute=Auto-route around shapes\nlibavoidUnavailable=Orthogonal routing is not available in this browser.\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseRequired=This feature requires draw.io to be licensed.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlight=Light\nlineJumps=Line Jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkIcons=Link Icons\nlinkText=Link Text\ntooltipIcons=Tooltip Icons\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after a restart of the application.\nlaneColor=Lanecolor\nlanguageCode=Language Code\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to Right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nlightboxAnimationHint=Plays automatically when the page is shown in lightbox mode.\nline=Line\nlineend=Line End\nlineheight=Line Height\nlinestart=Line Start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlock=Lock\nlocked=Locked\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloop=Loop\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmaximize=Maximize\nmerge=Merge\nmermaid=Mermaid\nmethod=Method\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nminimize=Minimize\nmisc=Misc\nmockups=Mockups\nmodern=Modern\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move Selection to {1}\nmyDrive=My Drive\nmyFiles=My Files\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewChat=New Chat\nnewLibrary=New Library\nnextPage=Next Page\nno=No\nnoPickFolder=No, pick folder\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoAnimationsInDiagram=No animations found in diagram\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for \'{1}\'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoStepsYet=No steps yet. Add the first step below.\nnoPageContentOrNotSaved=No anchors found on this page or it hasn\'t been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotion=Notion\nnotSatisfiedWithImport=Not satisfied with the import?\nnotUsingService=Not using {1}?\nnumberedList=Numbered List\noffline=Offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenRepairedCopy=Open repaired copy\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\norgChart=Org Chart\northogonal=Orthogonal\northogonalRouting=Orthogonal Routing\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageTabs=Page Tabs\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\nparallels=Parallels\npaste=Paste\npasteData=Paste Data\npasteHere=Paste Here\npasteResponse=Paste Response\npasteSize=Paste Size\npasteStyle=Paste Style\npasteTextStyle=Paste Text Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\npolygon=Polygon\nportrait=Portrait\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\npresentationMode=Presentation Mode\nprint=Print\nprocEng=Process Engineering\nproject=Project\npriority=Priority\nprocessForHiringNewEmployee=Process for hiring a new employee\npromptOnly=Prompt Only\npromptTooLarge=Only {1} characters allowed in the free version using the draw.io model\npromptWithDiagram=Prompt with Diagram\npromptWithSelection=Prompt with Selection\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradial=Radial\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you\'ve made a few changes while offline. We\'re sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelative=Relative\nrelativeUrlNotAllowed=Relative URL not allowed\nretry=Retry\nrememberMe=Remember Me\nrememberThisSetting=Remember This Setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace Existing Drawing\nrequired=required\nrequirementDiagram=Requirement Diagram\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoreBackupCopy=Open backup as copy\nrecover=Recover…\nrecoverTitle=Recover file\nrecoverVersionFrom=Version from {1}\nrecoverPreviousVersion=Previous version\nrecoveryVersionDesc=A previously saved version. Complete, but any changes made since then are not included.\nrecoveryRepairedDesc=The current file with a best-effort repair. Recent, but content after the damaged point may be missing.\nrecoveryWarning=This is a best-effort recovery and may be missing content. It will open as a new unsaved copy and your original file is not changed. Continue?\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to Left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nrunLastLayout=Run Last Layout\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save as\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaveLibraryReadOnly=Could not save library while read-only mode is active\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchImages=Search Images\nsearchShapes=Search Shapes\nsearchShapesInOpenLibraries=Search Shapes in Open Libraries\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectedPage=Selected Page\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselection=Selection\nselectNone=Select None\nselectObjectsInLayer=Select Objects in Layer\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendBackward=Send Backward\nsendMessage=Send\nsendYourFeedback=Send your feedback\nsequenceDiagram=Sequence Diagram\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save.\nsetAsDefaultStyle=Set as Default Style\nsettings=Settings\nshadow=Shadow\nshadows=Shadows\nshape=Shape\nshapes=Shapes\nshare=Share\nshareCursor=Share Mouse Cursor\nshareLink=Link for shared editing\nsharingAvailable=Sharing available for Google Drive and OneDrive files.\nsaveItToGoogleDriveToCollaborate=You\'ll need to save "{1}" to Google Drive before you can collaborate.\nsaveToGoogleDrive=Save to Google Drive\nsharp=Sharp\nshow=Show\nshowRemoteCursors=Show Remote Mouse Cursors\nsidebarTooltip=Click or drag and drop shapes. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsimpleViewer=Simple Viewer\nsize=Size\nsketch=Sketch\nsmoothing=Smoothing\nsnapToGrid=Snap to Grid\nsolid=Solid\nsortPages=Sort Pages\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstateDiagram=State Diagram\nstandard=Standard\nstartDrawing=Start Drawing\nstopDrawing=Stop Drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\nstrokeColor=Line Color\nstress=Stress\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nswap=Swap\nswimlaneDiagram=Swimlane Diagram\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooLargeUseDownload=Too large, use download instead.\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page\nturn=Rotate Shape Only by 90°\ntype=Type\ntypeSlashToSearch=Type / to search\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunlock=Unlock\nunmerge=Unmerge\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nunknownUser=Unknown user\nupdateDiagramFromClipboard=Update diagram from clipboard\nupdateExistingDrawing=Update existing drawing\nupdateFile=Update {1}\nupdatingDocument=Updating document. Please wait...\nupdatingPreview=Updating preview. Please wait...\nupdatingSelection=Updating selection. Please wait...\nupload=Upload\nurl=URL\nuseBlackAndWhite=Use Black and White\nuseCurrent=Use Current\nuseCurrentSettings=Use Current Settings\nuseOffline=Use Offline\nuserDefined=User-defined\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwhere=Where\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently Used\nlistView=List View\ngridView=Grid View\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft read error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft write error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrawDiag=draw.io diagram\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occurred, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Select export target, then click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound={2} diagram "{1}" found. Importing\nconfAGliffyDiagImported={2} diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported {2} diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing {2} diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching {2} diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occurred!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving failed (unexpected error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload failed (unexpected error)\nhiResPreview=High Resolution Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\ncreateODFile=Create OneDrive File\npickGDriveFile=Pick Google Drive File\ncreateGDriveFile=Create Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\ntryVssDraw=Try importing the file at {1}\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nminTwoPoints=At least 2 points required\nconfEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.\nconfDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session\'s modifications.\nmacroNotFound=Macro Not Found\nconfAInvalidPageIdsFormat=Incorrect Page IDs file format\nconfACollectingCurPages=Collecting current pages\nconfABuildingPagesMap=Building pages mapping\nconfAProcessDrawDiag=Started processing imported draw.io diagrams\nconfAProcessDrawDiagDone=Finished processing imported draw.io diagrams\nconfAProcessImpPages=Started processing imported pages\nconfAErrPrcsDiagInPage=Error processing draw.io diagrams in page "{1}"\nconfAPrcsDiagInPage=Processing draw.io diagrams in page "{1}"\nconfAImpDiagram=Importing diagram "{1}"\nconfAImpDiagramFailed=Importing diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\nconfAImpDiagramError=Error importing diagram "{1}". Cannot fetch or save the diagram. Cannot fix this diagram links.\nconfAUpdateDgrmCCFailed=Updating link to diagram "{1}" failed.\nconfImpDiagramSuccess=Updating diagram "{1}" done successfully.\nconfANoLnksInDrgm=No links to update in: {1}\nconfAUpdateLnkToPg=Updated link to page: "{1}" in diagram: "{2}"\nconfAUpdateLBLnkToPg=Updated lightbox link to page: "{1}" in diagram: "{2}"\nconfAUpdateLnkBase=Updated base URL from: "{1}" to: "{2}" in diagram: "{3}"\nconfAPageIdsImpDone=Page IDs import finished\nconfAPrcsMacrosInPage=Processing draw.io macros in page "{1}"\nconfAErrFetchPage=Error fetching page "{1}"\nconfAFixingMacro=Fixing macro of diagram "{1}"\nconfAErrReadingExpFile=Error reading export file\nconfAPrcsDiagInPageDone=Processing draw.io diagrams in page "{1}" finished\nconfAFixingMacroSkipped=Fixing macro of diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\npageIdsExpTrg=Export target\nconfALucidDiagImgImported={2} diagram "{1}" image extracted successfully\nconfASavingLucidDiagImgFailed=Extracting {2} diagram "{1}" image failed\nconfGetInfoFailed=Fetching file info from {1} failed.\nconfCheckCacheFailed=Cannot get cached file info.\nconfReadFileErr=Cannot read "{1}" file from {2}.\nconfSaveCacheFailed=Unexpected error. Cannot save cached file\norgChartType=Org Chart Type\nlinear=Linear\nhanger2=Hanger 2\nhanger4=Hanger 4\nfishbone1=Fishbone 1\nfishbone2=Fishbone 2\n1ColumnLeft=Single Column Left\n1ColumnRight=Single Column Right\nsmart=Smart\nparentChildSpacing=Parent Child Spacing\nsiblingSpacing=Sibling Spacing\nconfNoPermErr=Sorry, you don\'t have enough permissions to view this embedded diagram from page {1}\ncopyAsImage=Copy as Image\ncopyAsText=Copy as Text\ncopyAsSvg=Copy as SVG\nlucidImport=Lucidchart Import\nlucidImportInst1=Click the "Start Import" button to import all Lucidchart diagrams.\ninstallFirst=Please install {1} first\ndrawioChromeExt=draw.io Chrome Extension\nloginFirstThen=Please login to {1} first, then {2}\nerrFetchDocList=Error: Couldn\'t fetch documents list\nbuiltinPlugins=Built-in Plugins\nextPlugins=External Plugins\nbackupFound=Backup file found\nchromeOnly=This feature only works in Google Chrome\nmsgDeleted=This message has been deleted\nconfAErrFetchDrawList=Error fetching diagrams list. Some diagrams are skipped.\nconfAErrCheckDrawDiag=Cannot check diagram {1}\nconfAErrFetchPageList=Error fetching pages list\nconfADiagImportIncom={1} diagram "{2}" is imported partially and may have missing shapes\ninvalidSel=Invalid selection\ndiagNameEmptyErr=Diagram name cannot be empty\nopenDiagram=Open Diagram\nnewDiagram=New diagram\neditable=Editable\nconfAReimportStarted=Re-import {1} diagrams started...\nspaceFilter=Filter by Spaces\ncurViewState=Current Viewer State\npageLayers=Page and Layers\ncustomize=Customize\nfirstPage=First Page (All Layers)\ncurEditorState=Current Editor State\nnoAnchorsFound=No anchors found\nattachment=Attachment\ncurDiagram=Current Diagram\nrecentDiags=Recent Diagrams\ncsvImport=CSV Import\nchooseFile=Choose a File...\nchoose=Choose\ngdriveFname=Google Drive filename\nwidthOfViewer=Width of the Viewer (px)\nheightOfViewer=Height of the Viewer (px)\nautoSetViewerSize=Automatically set the size of the viewer\nthumbnail=Thumbnail\nprevInDraw=Preview in draw.io\nonedriveFname=OneDrive filename\ndiagFname=Diagram filename\ndiagUrl=Diagram URL\nshowDiag=Show Diagram\ndiagPreview=Diagram Preview\ncsvFileUrl=CSV File URL\ngenerate=Generate\nselectDiag2Insert=Please select a diagram to insert it.\nerrShowingDiag=Unexpected error. Cannot show diagram\nnoRecentDiags=No recent diagrams found\nfetchingRecentFailed=Failed to fetch recent diagrams\nuseSrch2FindDiags=Use the search box to find draw.io diagrams\ncantReadChckPerms=Cannot read the specified diagram. Please check you have read permission on that file.\ncantFetchChckPerms=Cannot fetch diagram info. Please check you have read permission on that file.\nsearchFailed=Searching failed. Please try again later.\nplsTypeStr=Please type a search string.\nunsupportedFileChckUrl=Unsupported file. Please check the specified URL\ndiagNotFoundChckUrl=Diagram not found or cannot be accessed. Please check the specified URL\ncsvNotFoundChckUrl=CSV file not found or cannot be accessed. Please check the specified URL\ncantReadUpload=Cannot read the uploaded diagram\nselect=Select\nerrCantGetIdType=Unexpected Error: Cannot get content id or type.\nerrGAuthWinBlocked=Error: Google Authentication window blocked\nauthDrawAccess=Authorize draw.io to access {1}\nconnTimeout=The connection has timed out\nerrAuthSrvc=Error authenticating to {1}\nplsSelectFile=Please select a file\nmustBgtZ={1} must be greater than zero\ncantLoadPrev=Cannot load file preview.\nerrAccessFile=Error: Access Denied. You do not have permission to access "{1}".\nnoPrevAvail=No preview is available.\npersonalAccNotSup=Personal accounts are not supported.\nerrSavingTryLater=Error occurred during saving, please try again later.\nplsEnterFld=Please enter {1}\ninvalidDiagUrl=Invalid Diagram URL\nunsupportedVsdx=Unsupported vsdx file\nunsupportedImg=Unsupported image file\nunsupportedFormat=Unsupported file format\nplsSelectSingleFile=Please select a single file only\nattCorrupt=Attachment file "{1}" is corrupted\nloadAttFailed=Failed to load attachment "{1}"\nembedDrawDiag=Embed draw.io Diagram\naddDiagram=Add Diagram\nembedDiagram=Embed Diagram\neditOwningPg=Edit Owning Page\ndeepIndexing=Deep Indexing (including diagrams that aren\'t used in any page)\nconfADeepIndexStarted=Deep indexing started\nconfADeepIndexDone=Deep indexing done\nofficeNoDiagramsSelected=No diagrams found in the selection\nofficeNoDiagramsInDoc=No diagrams found in the document\nofficeNotSupported=This feature is not supported in this host application\nsomeImagesFailed={1} out of {2} failed due to the following errors\nimportingNoUsedDiagrams=Importing {1} Diagrams not used in pages\nimportingDrafts=Importing {1} Diagrams in drafts\nprocessingDrafts=Processing drafts\nupdatingDrafts=Updating drafts\nupdateDrafts=Update drafts\nnotifications=Notifications\ndrawioImp=draw.io Import\nconfALibsImp=Importing draw.io Libraries\nconfALibsImpFailed=Importing {1} library failed\ncontributors=Contributors\ndrawDiagrams=draw.io Diagrams\nerrFileNotFoundOrNoPer=Error: Access Denied. File not found or you do not have permission to access "{1}" on {2}.\nconfACheckPagesWEmbed=Checking pages having embedded draw.io diagrams.\nconfADelBrokenEmbedDiagLnk=Removing broken embedded diagram links\nreplaceWith=Replace with\nreplaceAll=Replace All\nconfASkipDiagModified=Skipped "{1}" as it was modified after initial import\nreplFind=Replace/Find\nmatchesRepl={1} matches replaced\ndraftErrDataLoss=An error occurred while reading the draft file. The diagram cannot be edited now to prevent any possible data loss. Please try again later or contact support.\nibm=IBM\nlinkToDiagramHint=Add a link to this diagram. The diagram can only be edited from the page that owns it.\nlinkToDiagram=Link to Diagram\nchangedBy=Changed By\nlastModifiedOn=Last Modified on\nsearchResults=Search Results\nshowAllTemps=Show All Templates\nnotionToken=Notion Token\nselectDB=Select Database\nnoDBs=No Databases\ndiagramEdited={1} diagram "{2}" edited\nconfDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?\nconfFileTooBigErr=File size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration.\nowner=Owner\nrepository=Repository\nbranch=Branch\nmeters=Meters\nteamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)\ncontactOwner=Contact Owner\nviewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.\nwebsite=Website\ncheck4Updates=Check for Updates\nattWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...\nconfPartialPageList=We couldn\'t fetch all pages due to an error in Confluence. Continuing using {1} pages only.\nspellCheck=Spell Checker\nnoChange=No Change\nlblToSvg=Convert Labels to SVG\nautoRotateLabel=Rotate with Edge\ntxtSettings=Text Settings\nLinksLost=Links will be lost\narcSize=Arc Size\neditConnectionPoints=Edit Connection Points\nnotInOffline=Not supported while offline\nnotInDesktop=Not supported in Desktop App\nconfConfigSpaceArchived=draw.io Configuration space (DRAWIOCONFIG) is archived. Please restore it first.\nconfACleanOldVerStarted=Cleaning old diagram draft versions started\nconfACleanOldVerDone=Cleaning old diagram draft versions finished\nconfACleaningFile=Cleaning diagram draft "{1}" old versions\nconfAFileCleaned=Cleaning diagram draft "{1}" done\nconfAFileCleanFailed=Cleaning diagram draft "{1}" failed\nconfACleanOnly=Clean Diagram Drafts Only\nbrush=Brush\nopenDevTools=Open Developer Tools\nautoBkp=Automatic Backup\nconfAIgnoreCollectErr=Ignore collecting current pages errors\ndrafts=Drafts\ndraftSaveInt=Draft Save Interval [sec] (0 to disable)\npluginsDisabled=External plugins disabled.\nextExpNotConfigured=External image service is not configured\npathFilename=Path/Filename\nconfAHugeInstances=Very Large Instances\nconfAHugeInstancesDesc=If this instance includes 100,000+ pages, it is faster to request the current instance pages list from Atlassian. Please contact our support for more details.\nchoosePageIDsFile=Choose current page IDs csv file\nchooseDrawioPsgesFile=Choose pages with draw.io diagrams csv file\nprivate=Private\ndiagramTooLarge=The diagram is too large, please reduce its size and try again.\nselectAdminUsers=Select Admin Users\nxyzTeam={1} Team\naddTeamTitle=Adding a new draw.io Team\naddTeamInst1=To create a new draw.io Team, you need to create a new Atlassian group with "drawio-" prefix (e.g, a group named "drawio-marketing").\naddTeamInst2=Then, configure which team member can edit/add configuration, templates, and libraries from this page.\ndrawioTeams=draw.io Teams\nmembers=Members\nadminEditors=Admins/Editors\nallowAll=Allow All\nnoTeams=No teams found\nerrorLoadingTeams=Error loading teams\nnoTeamMembers=No team members found\nerrLoadTMembers=Error loading team members\nerrCreateTeamPage=Error creating team "{1}" page in "draw.io Configuration" space, please check you have the required permissions.\ngotoConfigPage=Please create the space from draw.io "Configuration" page.\nnoAdminsSelected=No admins/editors selected\nerrCreateConfigFile=Error creating "configuration.json" file, please check you have the required permissions.\nerrSetPageRestr=Error setting page restrictions\nnotAdmin4Team=You are not an admin for this team\nconfigUpdated=Configuration updated, restart the editor if you want to work with last configuration.\noutOfDateRevisionAlert=You are editing a historical revision of the diagram, please review the revision and open it to replace the latest version. Or close and overwrite/merge later.\nconfAErrFaqs=There are {1} error(s), the following instructions may help fixing most of the cases. (Please download the log for future references)\nconfA403ErrFaq=There are ({1}) 403 error(s). The current users must have add (write) permissions on all pages and attachments. Even admins sometimes are not allowed to write to some pages via page restrictions\nconfA404ErrFaq=There are ({1}) 404 error(s). The attachment/page is not found. This is due to improper migration or the diagram file (an attachment of the page) is deleted.\nconfA500ErrFaq=There are ({1}) 500 error(s). An internal server error in Confluence Cloud. Such errors are due to overloading the server and usually fixed by retrying the process.\nconfAOtherErrFaq=There are ({1}) other error(s). Please check the error description. If the description is not clear, please contact our support.\nconfAReplaceBaseUrl=Replace base URL in diagram links when no page ID mapping is found\ndrawSvgPrev=draw.io SVG preview\ngoogleFonts=Google Fonts\ndiagDupl=Duplicate diagram detected\ndiagDuplMsg=This diagram is used in multiple places, which can result in unexpected results when edited. We\'ve created an independent copy. Please open the editor again.\ndiagDuplNoEditMsg=This diagram is used in multiple places. Please edit it within its own page.\nconfCloudMigConfirm=Warning: This process will edit many pages and diagrams, so it is recommended to stop the Synchrony service during the process. Do you want to proceed?\nconfCloudMigNotice=In the Cloud instance, please add linkAdjustments to draw.io configuration as follows {1}. Without this configuration, links in diagrams pointing to Confluence pages will not work.\nconfALogsPageDesc=This page contains logs of draw.io long running services as attachments\nconfEditOnlyInPageEditor=Can only be edited within Confluence page editor\nconfEvalWarn=Evaluation License - Not for Production Use\notherUsersEditing=Other user(s) are editing this diagram\nfirstTimeGD=First time to access this file?\ndrawioGDAppNotInstalled=draw.io Google Drive app is not installed, please install it first\nConfDC415Error=Saving drafts is blocked. If you have "Attachment Checker for Confluence" app, please update to the latest version.\nremove=Remove\nselectPgLyr=Select Page and Layers\nerrGenPreview=There was an error generating a diagram preview. Please consult technical support.\nattAccessErr=Diagram attachment access error: cannot display diagram\nwidthIntOrFixed=Width must be a valid integer or of value \'fixed\'\ndupDisabledPgLyrSlct=Diagram duplication is disabled when page and layers are selected\ncantDupPickDiffName=Could not duplicate diagram. Please choose a different name.\nownPgAccessDupErr=Owning page access restriction: cannot duplicate diagram.\ncantDupTryLater=Could not duplicate diagram. Please try again later.\ncantEditLnkd=Cannot edit linked diagram\ndiagEditOwnPgOnlyOpen=Diagram can only be edited from the page that owns it. Would you like to open the owning page for edit?\ndiagInTemps=draw.io diagrams in templates\ndiagInTempsCantEdit=Diagrams in page templates cannot be edited. They can only be edited on pages and blog posts.\nconfDirectEditDraftLost=This Confluence page has unpublished changes. Editing the diagram from page view may cause data loss. Please edit the Confluence page first and then edit the diagram.\nconfConfigSpacePerm=Note: If you recently migrated from DC app, please check draw.io Configuration space permissions such that all users can read and only admins can write. In addition, remove the page restrictions on "Configuration" and "Libraries" pages. You may need admin keys to access them. Also, please check the file "configuration.json" in the "Configuration" page is downloadable.\ntryCurPageOnErr=Try finding the diagram attachment on the macro page when the linked page fails\nconfAExtSrvcNoSupported=Embedded diagrams from external services or urls are not supported.\ngliffyVersionPinning=Import Gliffy pinned version instead of the latest version\nconfEmbedUpload=For a better editing experience, please use the regular draw.io macro to insert a blank diagram, then from (File menu → Import From → Device...) select the file you want to upload and embed.\nconfPublishErr=Another update conflicted with your publish, please try the operation again\nconfACacheMapping=Cache Page IDs Mapping\nconfARemImpPages=Remember Imported Pages\ndelCachedData=Delete Cached Data\nk15tPagesError=Error retrieving Scroll pages. Is Scroll Versions installed?\ndrawioUninstalled=draw.io has been uninstalled, the editor will now close\nconfAttachmentArchived=Diagram belongs to an archived page and cannot be loaded. Restore the page (ID: {1}) to load it.\nconfDiagramMacroDowngrade=The diagram is saved but the page macro cannot be updated as the diagraam revision in the macro is newer. Please edit the diagram from Confluence page editor.\nDCSave500Error=Another Confluence operation interrupted saving, retry #{1}\nconfAppNotInstalled=draw.io diagrams Confluence App is not installed.\nplsInstallAppInConf=Please install/connect this App in Confluence to be able to access the diagrams (in addition to draw.io Confluence app)\nm365=Microsoft 365\nnodeSpacing=Node Spacing\nrankSpacing=Rank Spacing\npolyline=Polyline\nlayeringStrategy=Layering Strategy\nnetworkSimplex=Network Simplex\nlongestPath=Longest Path\ncoffmanGraham=Coffman-Graham\nweighting=Weighting\nmodelOrder=Model Order\ndescendants=Descendants\nconstraint=Constraint\nfan=Fan\noptimization=Optimization\nedgeLength=Edge Length\nedgeLengthByPosition=Edge Length by Position\ncrossingMinimization=Crossing Minimization\niterations=Iterations\nrepulsivePower=Repulsive Power\nresizeNodes=Resize Nodes\nuseSelectionAsRoot=Use Selection as Root\nuseSelectionAsRoots=Use Selection as Roots\nanonymize=Anonymize\nconnector=Connector\nextractText=Extract Text\nlegacyLayouts=Legacy Layouts\nedgeStyle=Edge Style\ncorners=Corners\nkeepStyle=Keep Existing Style\nopenLucidSite=Open Lucidchart Site in another tab and login to your account, then come back to this tab and click the "Start Import" button again.\npreviewSaveNoPermission=You do not have permission to save the preview image. The source page may be restricted or you may not have edit permission on the page. This only affects this page export to PDF/Word.\npreserveOrigin=Preserve Origin\nsharedStems=Bundle Outgoing Connections\ndraftLoadedWUnpublishedChanges=The diagram has loaded from a draft with unpublished changes. It is different from the published version.\nhachure=Hachure\nhatch=Hatch\ndots=Dots\ncrossHatch=Cross Hatch\nzigzag=ZigZag\nzigzagLine=ZigZag Line\nsysFonts=System Fonts\nwebfonts=Web Fonts\nfontname=Font Name\nfontUrl=Font URL\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;+(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var d=EditorUi.initTheme;EditorUi.initTheme=function(){d.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();DrawioComment=function(b,d,m,p,u,n,y){this.file=b;this.id=d;this.content=m;this.modifiedDate=p;this.createdDate=u;this.isResolved=n;this.user=y;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,d,m,p,u){d()};DrawioComment.prototype.editComment=function(b,d,m){d()};DrawioComment.prototype.deleteComment=function(b,d){b()};DrawioUser=function(b,d,m,p,u){this.id=b;this.email=d;this.displayName=m;this.pictureUrl=p;this.locale=u};mxResources.parse('about=About\naiFreeModelHint=Start a new chat or shorten your message to send more.\naboutDrawio=About draw.io\naccessDenied=Access Denied\naccounts=Accounts\naction=Action\nactualSize=Actual Size\nadaptiveColors=Adaptive Colors\nadd=Add\naddAccount=Add Account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddToScratchpad=Add to Scratchpad\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nsmartTemplate=Smart Template\nalign=Align\nalignment=Alignment\nalignCellsLeft=Align Left\nalignCellsCenter=Align Center\nalignCellsRight=Align Right\nalignCellsTop=Align Top\nalignCellsMiddle=Align Middle\nalignCellsBottom=Align Bottom\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSelectedObjectsInThisLayer=All selected objects are in this layer\nallSpaces=All Spaces\nallTags=All Tags\nanchor=Anchor\nandroid=Android\nangle=Angle\nallCells=All cells\nanimations=Flow Animations\ncell=cell\ncells=cells\nexcluded=Excluded\nexcludeSelection=Exclude selected cells\nlayer=Layer\nselectLayers=Select layers\ntransition=Transition\nmatch=Match\nmatchAll=All\nmatchAllHint=Match cells that have every selected tag (AND)\nmatchAny=Any\nmatchAnyHint=Match cells that have at least one selected tag (OR)\nduration=Duration (ms)\nfadeIn=Fade In\nfadeOut=Fade Out\nfadeTo=Fade To\nflow=Flow\nflowOff=Flow Off\nflowOn=Flow On\nhighlight=Highlight\nnoTagsInDiagram=No tags in this diagram yet.\noptional=optional\npopIn=Pop In\npopOut=Pop Out\nreorder=Drag to reorder\nreset=Reset\nscroll=Scroll To\nselectByTags=Select by tags\nselectCellsInDiagram=Select cells in diagram\ntag=Tag\nsetOpacity=Set Opacity\ntiming=Timing\ntoggle=Toggle\ntoggleStyle=Toggle Style\nuseSelection=Use selected cells\nvisibilityActions=Visibility\nwait=Wait\nwipeIn=Wipe In\nwipeOut=Wipe Out\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\nappearance=Appearance\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narrow=Arrow\narrows=Arrows\naskMeAnything=Ask me anything\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosizeText=Automatic Font Size\nautosize=Autosize\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nback=Back\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nbeta=beta\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Border Width\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbringForward=Bring Forward\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change User\nchangeStorage=Change Storage\nchangesNotSaved=Changes have not been saved\ncharactersRemaining={1} characters remaining\nclassDiagram=Class Diagram\nclosePath=Close Path\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nclickToAdd=Click on canvas to add points\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\ncompare=Compare\ncompressed=Compressed\ncommitMessage=Commit Message\nconfigLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!\nconfigLinkConfirm=Click OK to configure and restart draw.io.\ncontainer=Container\ncsv=CSV\ncurrentLayer=Current Layer\ndark=Dark\ndiagramLanguage=Diagram Language\ndiagramType=Diagram Type\ndiagramXmlDesc=XML File\ndiagramHtmlDesc=HTML File\ndiagramPngDesc=Editable Bitmap Image\ndiagramSvgDesc=Editable Vector Image\ndictate=Dictate\ndidYouMeanToExportToPdf=Did you mean to export to PDF?\ndisabled=Disabled\ndraftFound=A draft for \'{1}\' has been found. Load it into the editor or discard it to continue.\ndraftRevisionMismatch=There is a different version of this diagram on a shared draft of this page. Please edit the diagram from the draft to ensure you are working with the latest version.\nselectDraft=Select a draft to continue editing:\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * " |\ncheck=Check\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclipboard=Clipboard\nclose=Close\nclosingFile=Closing file\nrealtimeCollaboration=Real-Time Collaboration\ncollaborate=Collaborate\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseAll=Collapse All\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\ncompress=Compress\nconfiguration=Configuration\nconnect=Connect\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyCreated=A copy of the file was created.\ncopyData=Copy Data\ncopyDiagramToClipboard=Copy Diagram to Clipboard\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySelectionToClipboard=Copy Selection to Clipboard\ncopySize=Copy Size\ncopyStyle=Copy Style\ncopyTextStyle=Copy Text Style\ncreate=Create\ncreateDiagram=Create Diagram\ncreateBlankDiagram=Create Blank Diagram\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncurrentPage=Current Page\ncut=Cut\ndashed=Dashed\ndecideLater=Decide Later\ndefault=Default\ndelete=Delete\ndeleteAll=Delete All\ndeleteColumn=Delete Column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndescribeYourDiagram=Describe your diagram\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndistributeHorizontal=Distribute Horizontally\ndistributeVertical=Distribute Vertically\ndone=Done\ndoNotShowAgain=Do not show again\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadDesktop=Get Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditor=Editor\neditPolygon=Edit Polygon\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\neffects=Effects\nembed=Embed\nembedCellMetadata=Cell Metadata\nembedFonts=Embed Fonts\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nentityRelationshipDiagram=Entity Relationship Diagram\nerror=Error\nerrorDeletingFile=Error deleting file\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google\'s servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named \'{1}\'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target=\'_blank\' href=\'{1}\'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexpandAll=Expand All\nexplore=Explore\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nexternalChanges=External Changes\nextras=Extras\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified.\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\nfilename=Filename\nfileExists=File already exists\nfileMovedToTrash=File was moved to trash\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfindInDiagram=Find in Diagram\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowAnimation=Flow Animation\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nforceDirected=Force-directed\nformat=Format\nformatAnimatedGif=Animated GIF\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatJson=JSON\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatVsdx=VSDX\nformatWebp=WebP\nformatXml=XML\nforum=Discussion/Help Forums\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngeneral=General\ngetNotionChromeExtension=Get the Notion Chrome Extension\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\ngroupPadding=Group Padding\nguides=Guides\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nshiftClickShowOnly=Shift+click: show only {1}\nhighContrast=High Contrast\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn\'t be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimmediate=Immediate\nimport=Import\nimportFrom=Import from\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninherit=Inherit\ninitialPage=Initial Page\ninitialView=Initial View\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertDiagramFromClipboard=Insert Diagram from Clipboard\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninstallApp=Install App\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = "\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://www.drawio.com/doc/faq/license-drawio-confluence-jira-cloud">page</a>.\ninvalidInput=Invalid input\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\ninvertSelection=Invert Selection\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlabels=Labels\nlabelWidth=Label Width\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlibavoidAutoRoute=Auto-route around shapes\nlibavoidUnavailable=Orthogonal routing is not available in this browser.\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseRequired=This feature requires draw.io to be licensed.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlight=Light\nlineJumps=Line Jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkIcons=Link Icons\nlinkText=Link Text\ntooltipIcons=Tooltip Icons\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after a restart of the application.\nlaneColor=Lanecolor\nlanguageCode=Language Code\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to Right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nlightboxAnimationHint=Plays automatically when the page is shown in lightbox mode.\nline=Line\nlineend=Line End\nlineheight=Line Height\nlinestart=Line Start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlock=Lock\nlocked=Locked\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloop=Loop\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmaximize=Maximize\nmerge=Merge\nmermaid=Mermaid\nmethod=Method\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nminimize=Minimize\nmisc=Misc\nmockups=Mockups\nmodern=Modern\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move Selection to {1}\nmyDrive=My Drive\nmyFiles=My Files\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewChat=New Chat\nnewLibrary=New Library\nnextPage=Next Page\nno=No\nnoPickFolder=No, pick folder\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoAnimationsInDiagram=No animations found in diagram\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for \'{1}\'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoStepsYet=No steps yet. Add the first step below.\nnoPageContentOrNotSaved=No anchors found on this page or it hasn\'t been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotion=Notion\nnotSatisfiedWithImport=Not satisfied with the import?\nnotUsingService=Not using {1}?\nnumberedList=Numbered List\noffline=Offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenRepairedCopy=Open repaired copy\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\norgChart=Org Chart\northogonal=Orthogonal\northogonalRouting=Orthogonal Routing\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageTabs=Page Tabs\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\nparallels=Parallels\npaste=Paste\npasteData=Paste Data\npasteHere=Paste Here\npasteResponse=Paste Response\npasteSize=Paste Size\npasteStyle=Paste Style\npasteTextStyle=Paste Text Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\npolygon=Polygon\nportrait=Portrait\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\npresentationMode=Presentation Mode\nprint=Print\nprocEng=Process Engineering\nproject=Project\npriority=Priority\nprocessForHiringNewEmployee=Process for hiring a new employee\npromptOnly=Prompt Only\npromptTooLarge=Only {1} characters allowed in the free version using the draw.io model\npromptWithDiagram=Prompt with Diagram\npromptWithSelection=Prompt with Selection\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradial=Radial\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you\'ve made a few changes while offline. We\'re sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelative=Relative\nrelativeUrlNotAllowed=Relative URL not allowed\nretry=Retry\nrememberMe=Remember Me\nrememberThisSetting=Remember This Setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace Existing Drawing\nrequired=required\nrequirementDiagram=Requirement Diagram\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoreBackupCopy=Open backup as copy\nrecover=Recover…\nrecoverTitle=Recover file\nrecoverVersionFrom=Version from {1}\nrecoverPreviousVersion=Previous version\nrecoveryVersionDesc=A previously saved version. Complete, but any changes made since then are not included.\nrecoveryRepairedDesc=The current file with a best-effort repair. Recent, but content after the damaged point may be missing.\nrecoveryWarning=This is a best-effort recovery and may be missing content. It will open as a new unsaved copy and your original file is not changed. Continue?\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to Left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nrunLastLayout=Run Last Layout\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save as\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaveLibraryReadOnly=Could not save library while read-only mode is active\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchImages=Search Images\nsearchShapes=Search Shapes\nsearchShapesInOpenLibraries=Search Shapes in Open Libraries\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectedPage=Selected Page\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselection=Selection\nselectNone=Select None\nselectObjectsInLayer=Select Objects in Layer\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendBackward=Send Backward\nsendMessage=Send\nsendYourFeedback=Send your feedback\nsequenceDiagram=Sequence Diagram\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save.\nsetAsDefaultStyle=Set as Default Style\nsettings=Settings\nshadow=Shadow\nshadows=Shadows\nshape=Shape\nshapes=Shapes\nshare=Share\nshareCursor=Share Mouse Cursor\nshareLink=Link for shared editing\nsharingAvailable=Sharing available for Google Drive and OneDrive files.\nsaveItToGoogleDriveToCollaborate=You\'ll need to save "{1}" to Google Drive before you can collaborate.\nsaveToGoogleDrive=Save to Google Drive\nsharp=Sharp\nshow=Show\nshowRemoteCursors=Show Remote Mouse Cursors\nsidebarTooltip=Click or drag and drop shapes. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsimpleViewer=Simple Viewer\nsize=Size\nsketch=Sketch\nsmoothing=Smoothing\nsnapToGrid=Snap to Grid\nsolid=Solid\nsortPages=Sort Pages\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstateDiagram=State Diagram\nstandard=Standard\nstartDrawing=Start Drawing\nstopDrawing=Stop Drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\nstrokeColor=Line Color\nstress=Stress\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nswap=Swap\nswimlaneDiagram=Swimlane Diagram\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooLargeUseDownload=Too large, use download instead.\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page\nturn=Rotate Shape Only by 90°\ntype=Type\ntypeSlashToSearch=Type / to search\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunlock=Unlock\nunmerge=Unmerge\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nunknownUser=Unknown user\nupdateDiagramFromClipboard=Update diagram from clipboard\nupdateExistingDrawing=Update existing drawing\nupdateFile=Update {1}\nupdatingDocument=Updating document. Please wait...\nupdatingPreview=Updating preview. Please wait...\nupdatingSelection=Updating selection. Please wait...\nupload=Upload\nurl=URL\nuseBlackAndWhite=Use Black and White\nuseCurrent=Use Current\nuseCurrentSettings=Use Current Settings\nuseOffline=Use Offline\nuserDefined=User-defined\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwhere=Where\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently Used\nlistView=List View\ngridView=Grid View\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft read error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft write error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrawDiag=draw.io diagram\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occurred, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Select export target, then click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound={2} diagram "{1}" found. Importing\nconfAGliffyDiagImported={2} diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported {2} diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing {2} diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching {2} diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occurred!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving failed (unexpected error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload failed (unexpected error)\nhiResPreview=High Resolution Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\ncreateODFile=Create OneDrive File\npickGDriveFile=Pick Google Drive File\ncreateGDriveFile=Create Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\ntryVssDraw=Try importing the file at {1}\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nminTwoPoints=At least 2 points required\nconfEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.\nconfDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session\'s modifications.\nmacroNotFound=Macro Not Found\nconfAInvalidPageIdsFormat=Incorrect Page IDs file format\nconfACollectingCurPages=Collecting current pages\nconfABuildingPagesMap=Building pages mapping\nconfAProcessDrawDiag=Started processing imported draw.io diagrams\nconfAProcessDrawDiagDone=Finished processing imported draw.io diagrams\nconfAProcessImpPages=Started processing imported pages\nconfAErrPrcsDiagInPage=Error processing draw.io diagrams in page "{1}"\nconfAPrcsDiagInPage=Processing draw.io diagrams in page "{1}"\nconfAImpDiagram=Importing diagram "{1}"\nconfAImpDiagramFailed=Importing diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\nconfAImpDiagramError=Error importing diagram "{1}". Cannot fetch or save the diagram. Cannot fix this diagram links.\nconfAUpdateDgrmCCFailed=Updating link to diagram "{1}" failed.\nconfImpDiagramSuccess=Updating diagram "{1}" done successfully.\nconfANoLnksInDrgm=No links to update in: {1}\nconfAUpdateLnkToPg=Updated link to page: "{1}" in diagram: "{2}"\nconfAUpdateLBLnkToPg=Updated lightbox link to page: "{1}" in diagram: "{2}"\nconfAUpdateLnkBase=Updated base URL from: "{1}" to: "{2}" in diagram: "{3}"\nconfAPageIdsImpDone=Page IDs import finished\nconfAPrcsMacrosInPage=Processing draw.io macros in page "{1}"\nconfAErrFetchPage=Error fetching page "{1}"\nconfAFixingMacro=Fixing macro of diagram "{1}"\nconfAErrReadingExpFile=Error reading export file\nconfAPrcsDiagInPageDone=Processing draw.io diagrams in page "{1}" finished\nconfAFixingMacroSkipped=Fixing macro of diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\npageIdsExpTrg=Export target\nconfALucidDiagImgImported={2} diagram "{1}" image extracted successfully\nconfASavingLucidDiagImgFailed=Extracting {2} diagram "{1}" image failed\nconfGetInfoFailed=Fetching file info from {1} failed.\nconfCheckCacheFailed=Cannot get cached file info.\nconfReadFileErr=Cannot read "{1}" file from {2}.\nconfSaveCacheFailed=Unexpected error. Cannot save cached file\norgChartType=Org Chart Type\nlinear=Linear\nhanger2=Hanger 2\nhanger4=Hanger 4\nfishbone1=Fishbone 1\nfishbone2=Fishbone 2\n1ColumnLeft=Single Column Left\n1ColumnRight=Single Column Right\nsmart=Smart\nparentChildSpacing=Parent Child Spacing\nsiblingSpacing=Sibling Spacing\nconfNoPermErr=Sorry, you don\'t have enough permissions to view this embedded diagram from page {1}\ncopyAsImage=Copy as Image\ncopyAsText=Copy as Text\ncopyAsSvg=Copy as SVG\nlucidImport=Lucidchart Import\nlucidImportInst1=Click the "Start Import" button to import all Lucidchart diagrams.\ninstallFirst=Please install {1} first\ndrawioChromeExt=draw.io Chrome Extension\nloginFirstThen=Please login to {1} first, then {2}\nerrFetchDocList=Error: Couldn\'t fetch documents list\nbuiltinPlugins=Built-in Plugins\nextPlugins=External Plugins\nbackupFound=Backup file found\nchromeOnly=This feature only works in Google Chrome\nmsgDeleted=This message has been deleted\nconfAErrFetchDrawList=Error fetching diagrams list. Some diagrams are skipped.\nconfAErrCheckDrawDiag=Cannot check diagram {1}\nconfAErrFetchPageList=Error fetching pages list\nconfADiagImportIncom={1} diagram "{2}" is imported partially and may have missing shapes\ninvalidSel=Invalid selection\ndiagNameEmptyErr=Diagram name cannot be empty\nopenDiagram=Open Diagram\nnewDiagram=New diagram\neditable=Editable\nconfAReimportStarted=Re-import {1} diagrams started...\nspaceFilter=Filter by Spaces\ncurViewState=Current Viewer State\npageLayers=Page and Layers\ncustomize=Customize\nfirstPage=First Page (All Layers)\ncurEditorState=Current Editor State\nnoAnchorsFound=No anchors found\nattachment=Attachment\ncurDiagram=Current Diagram\nrecentDiags=Recent Diagrams\ncsvImport=CSV Import\nchooseFile=Choose a File...\nchoose=Choose\ngdriveFname=Google Drive filename\nwidthOfViewer=Width of the Viewer (px)\nheightOfViewer=Height of the Viewer (px)\nautoSetViewerSize=Automatically set the size of the viewer\nthumbnail=Thumbnail\nprevInDraw=Preview in draw.io\nonedriveFname=OneDrive filename\ndiagFname=Diagram filename\ndiagUrl=Diagram URL\nshowDiag=Show Diagram\ndiagPreview=Diagram Preview\ncsvFileUrl=CSV File URL\ngenerate=Generate\nselectDiag2Insert=Please select a diagram to insert it.\nerrShowingDiag=Unexpected error. Cannot show diagram\nnoRecentDiags=No recent diagrams found\nfetchingRecentFailed=Failed to fetch recent diagrams\nuseSrch2FindDiags=Use the search box to find draw.io diagrams\ncantReadChckPerms=Cannot read the specified diagram. Please check you have read permission on that file.\ncantFetchChckPerms=Cannot fetch diagram info. Please check you have read permission on that file.\nsearchFailed=Searching failed. Please try again later.\nplsTypeStr=Please type a search string.\nunsupportedFileChckUrl=Unsupported file. Please check the specified URL\ndiagNotFoundChckUrl=Diagram not found or cannot be accessed. Please check the specified URL\ncsvNotFoundChckUrl=CSV file not found or cannot be accessed. Please check the specified URL\ncantReadUpload=Cannot read the uploaded diagram\nselect=Select\nerrCantGetIdType=Unexpected Error: Cannot get content id or type.\nerrGAuthWinBlocked=Error: Google Authentication window blocked\nauthDrawAccess=Authorize draw.io to access {1}\nconnTimeout=The connection has timed out\nerrAuthSrvc=Error authenticating to {1}\nplsSelectFile=Please select a file\nmustBgtZ={1} must be greater than zero\ncantLoadPrev=Cannot load file preview.\nerrAccessFile=Error: Access Denied. You do not have permission to access "{1}".\nnoPrevAvail=No preview is available.\npersonalAccNotSup=Personal accounts are not supported.\nerrSavingTryLater=Error occurred during saving, please try again later.\nplsEnterFld=Please enter {1}\ninvalidDiagUrl=Invalid Diagram URL\nunsupportedVsdx=Unsupported vsdx file\nunsupportedImg=Unsupported image file\nunsupportedFormat=Unsupported file format\nplsSelectSingleFile=Please select a single file only\nattCorrupt=Attachment file "{1}" is corrupted\nloadAttFailed=Failed to load attachment "{1}"\nembedDrawDiag=Embed draw.io Diagram\naddDiagram=Add Diagram\nembedDiagram=Embed Diagram\neditOwningPg=Edit Owning Page\ndeepIndexing=Deep Indexing (including diagrams that aren\'t used in any page)\nconfADeepIndexStarted=Deep indexing started\nconfADeepIndexDone=Deep indexing done\nofficeNoDiagramsSelected=No diagrams found in the selection\nofficeNoDiagramsInDoc=No diagrams found in the document\nofficeNotSupported=This feature is not supported in this host application\nsomeImagesFailed={1} out of {2} failed due to the following errors\nimportingNoUsedDiagrams=Importing {1} Diagrams not used in pages\nimportingDrafts=Importing {1} Diagrams in drafts\nprocessingDrafts=Processing drafts\nupdatingDrafts=Updating drafts\nupdateDrafts=Update drafts\nnotifications=Notifications\ndrawioImp=draw.io Import\nconfALibsImp=Importing draw.io Libraries\nconfALibsImpFailed=Importing {1} library failed\ncontributors=Contributors\ndrawDiagrams=draw.io Diagrams\nerrFileNotFoundOrNoPer=Error: Access Denied. File not found or you do not have permission to access "{1}" on {2}.\nconfACheckPagesWEmbed=Checking pages having embedded draw.io diagrams.\nconfADelBrokenEmbedDiagLnk=Removing broken embedded diagram links\nreplaceWith=Replace with\nreplaceAll=Replace All\nconfASkipDiagModified=Skipped "{1}" as it was modified after initial import\nreplFind=Replace/Find\nmatchesRepl={1} matches replaced\ndraftErrDataLoss=An error occurred while reading the draft file. The diagram cannot be edited now to prevent any possible data loss. Please try again later or contact support.\nibm=IBM\nlinkToDiagramHint=Add a link to this diagram. The diagram can only be edited from the page that owns it.\nlinkToDiagram=Link to Diagram\nchangedBy=Changed By\nlastModifiedOn=Last Modified on\nsearchResults=Search Results\nshowAllTemps=Show All Templates\nnotionToken=Notion Token\nselectDB=Select Database\nnoDBs=No Databases\ndiagramEdited={1} diagram "{2}" edited\nconfDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?\nconfFileTooBigErr=File size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration.\nowner=Owner\nrepository=Repository\nbranch=Branch\nmeters=Meters\nteamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)\ncontactOwner=Contact Owner\nviewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.\nwebsite=Website\ncheck4Updates=Check for Updates\nattWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...\nconfPartialPageList=We couldn\'t fetch all pages due to an error in Confluence. Continuing using {1} pages only.\nspellCheck=Spell Checker\nnoChange=No Change\nlblToSvg=Convert Labels to SVG\nautoRotateLabel=Rotate with Edge\ntxtSettings=Text Settings\nLinksLost=Links will be lost\narcSize=Arc Size\neditConnectionPoints=Edit Connection Points\nnotInOffline=Not supported while offline\nnotInDesktop=Not supported in Desktop App\nconfConfigSpaceArchived=draw.io Configuration space (DRAWIOCONFIG) is archived. Please restore it first.\nconfACleanOldVerStarted=Cleaning old diagram draft versions started\nconfACleanOldVerDone=Cleaning old diagram draft versions finished\nconfACleaningFile=Cleaning diagram draft "{1}" old versions\nconfAFileCleaned=Cleaning diagram draft "{1}" done\nconfAFileCleanFailed=Cleaning diagram draft "{1}" failed\nconfACleanOnly=Clean Diagram Drafts Only\nbrush=Brush\nopenDevTools=Open Developer Tools\nautoBkp=Automatic Backup\nconfAIgnoreCollectErr=Ignore collecting current pages errors\ndrafts=Drafts\ndraftSaveInt=Draft Save Interval [sec] (0 to disable)\npluginsDisabled=External plugins disabled.\nextExpNotConfigured=External image service is not configured\npathFilename=Path/Filename\nconfAHugeInstances=Very Large Instances\nconfAHugeInstancesDesc=If this instance includes 100,000+ pages, it is faster to request the current instance pages list from Atlassian. Please contact our support for more details.\nchoosePageIDsFile=Choose current page IDs csv file\nchooseDrawioPsgesFile=Choose pages with draw.io diagrams csv file\nprivate=Private\ndiagramTooLarge=The diagram is too large, please reduce its size and try again.\nselectAdminUsers=Select Admin Users\nxyzTeam={1} Team\naddTeamTitle=Adding a new draw.io Team\naddTeamInst1=To create a new draw.io Team, you need to create a new Atlassian group with "drawio-" prefix (e.g, a group named "drawio-marketing").\naddTeamInst2=Then, configure which team member can edit/add configuration, templates, and libraries from this page.\ndrawioTeams=draw.io Teams\nmembers=Members\nadminEditors=Admins/Editors\nallowAll=Allow All\nnoTeams=No teams found\nerrorLoadingTeams=Error loading teams\nnoTeamMembers=No team members found\nerrLoadTMembers=Error loading team members\nerrCreateTeamPage=Error creating team "{1}" page in "draw.io Configuration" space, please check you have the required permissions.\ngotoConfigPage=Please create the space from draw.io "Configuration" page.\nnoAdminsSelected=No admins/editors selected\nerrCreateConfigFile=Error creating "configuration.json" file, please check you have the required permissions.\nerrSetPageRestr=Error setting page restrictions\nnotAdmin4Team=You are not an admin for this team\nconfigUpdated=Configuration updated, restart the editor if you want to work with last configuration.\noutOfDateRevisionAlert=You are editing a historical revision of the diagram, please review the revision and open it to replace the latest version. Or close and overwrite/merge later.\nconfAErrFaqs=There are {1} error(s), the following instructions may help fixing most of the cases. (Please download the log for future references)\nconfA403ErrFaq=There are ({1}) 403 error(s). The current users must have add (write) permissions on all pages and attachments. Even admins sometimes are not allowed to write to some pages via page restrictions\nconfA404ErrFaq=There are ({1}) 404 error(s). The attachment/page is not found. This is due to improper migration or the diagram file (an attachment of the page) is deleted.\nconfA500ErrFaq=There are ({1}) 500 error(s). An internal server error in Confluence Cloud. Such errors are due to overloading the server and usually fixed by retrying the process.\nconfAOtherErrFaq=There are ({1}) other error(s). Please check the error description. If the description is not clear, please contact our support.\nconfAReplaceBaseUrl=Replace base URL in diagram links when no page ID mapping is found\ndrawSvgPrev=draw.io SVG preview\ngoogleFonts=Google Fonts\ndiagDupl=Duplicate diagram detected\ndiagDuplMsg=This diagram is used in multiple places, which can result in unexpected results when edited. We\'ve created an independent copy. Please open the editor again.\ndiagDuplNoEditMsg=This diagram is used in multiple places. Please edit it within its own page.\nconfCloudMigConfirm=Warning: This process will edit many pages and diagrams, so it is recommended to stop the Synchrony service during the process. Do you want to proceed?\nconfCloudMigNotice=In the Cloud instance, please add linkAdjustments to draw.io configuration as follows {1}. Without this configuration, links in diagrams pointing to Confluence pages will not work.\nconfALogsPageDesc=This page contains logs of draw.io long running services as attachments\nconfEditOnlyInPageEditor=Can only be edited within Confluence page editor\nconfEvalWarn=Evaluation License - Not for Production Use\notherUsersEditing=Other user(s) are editing this diagram\nfirstTimeGD=First time to access this file?\ndrawioGDAppNotInstalled=draw.io Google Drive app is not installed, please install it first\nConfDC415Error=Saving drafts is blocked. If you have "Attachment Checker for Confluence" app, please update to the latest version.\nremove=Remove\nselectPgLyr=Select Page and Layers\nerrGenPreview=There was an error generating a diagram preview. Please consult technical support.\nattAccessErr=Diagram attachment access error: cannot display diagram\nwidthIntOrFixed=Width must be a valid integer or of value \'fixed\'\ndupDisabledPgLyrSlct=Diagram duplication is disabled when page and layers are selected\ncantDupPickDiffName=Could not duplicate diagram. Please choose a different name.\nownPgAccessDupErr=Owning page access restriction: cannot duplicate diagram.\ncantDupTryLater=Could not duplicate diagram. Please try again later.\ncantEditLnkd=Cannot edit linked diagram\ndiagEditOwnPgOnlyOpen=Diagram can only be edited from the page that owns it. Would you like to open the owning page for edit?\ndiagInTemps=draw.io diagrams in templates\ndiagInTempsCantEdit=Diagrams in page templates cannot be edited. They can only be edited on pages and blog posts.\nconfDirectEditDraftLost=This Confluence page has unpublished changes. Editing the diagram from page view may cause data loss. Please edit the Confluence page first and then edit the diagram.\nconfConfigSpacePerm=Note: If you recently migrated from DC app, please check draw.io Configuration space permissions such that all users can read and only admins can write. In addition, remove the page restrictions on "Configuration" and "Libraries" pages. You may need admin keys to access them. Also, please check the file "configuration.json" in the "Configuration" page is downloadable.\ntryCurPageOnErr=Try finding the diagram attachment on the macro page when the linked page fails\nconfAExtSrvcNoSupported=Embedded diagrams from external services or urls are not supported.\ngliffyVersionPinning=Import Gliffy pinned version instead of the latest version\nconfEmbedUpload=For a better editing experience, please use the regular draw.io macro to insert a blank diagram, then from (File menu → Import From → Device...) select the file you want to upload and embed.\nconfPublishErr=Another update conflicted with your publish, please try the operation again\nconfACacheMapping=Cache Page IDs Mapping\nconfARemImpPages=Remember Imported Pages\ndelCachedData=Delete Cached Data\nk15tPagesError=Error retrieving Scroll pages. Is Scroll Versions installed?\ndrawioUninstalled=draw.io has been uninstalled, the editor will now close\nconfAttachmentArchived=Diagram belongs to an archived page and cannot be loaded. Restore the page (ID: {1}) to load it.\nconfDiagramMacroDowngrade=The diagram is saved but the page macro cannot be updated as the diagraam revision in the macro is newer. Please edit the diagram from Confluence page editor.\nDCSave500Error=Another Confluence operation interrupted saving, retry #{1}\nconfAppNotInstalled=draw.io diagrams Confluence App is not installed.\nplsInstallAppInConf=Please install/connect this App in Confluence to be able to access the diagrams (in addition to draw.io Confluence app)\nm365=Microsoft 365\nnodeSpacing=Node Spacing\nrankSpacing=Rank Spacing\npolyline=Polyline\nlayeringStrategy=Layering Strategy\nnetworkSimplex=Network Simplex\nlongestPath=Longest Path\ncoffmanGraham=Coffman-Graham\nweighting=Weighting\nmodelOrder=Model Order\ndescendants=Descendants\nconstraint=Constraint\nfan=Fan\noptimization=Optimization\nedgeLength=Edge Length\nedgeLengthByPosition=Edge Length by Position\ncrossingMinimization=Crossing Minimization\niterations=Iterations\nrepulsivePower=Repulsive Power\nresizeNodes=Resize Nodes\nuseSelectionAsRoot=Use Selection as Root\nuseSelectionAsRoots=Use Selection as Roots\nanonymize=Anonymize\nconnector=Connector\nextractText=Extract Text\nlegacyLayouts=Legacy Layouts\nedgeStyle=Edge Style\ncorners=Corners\nkeepStyle=Keep Existing Style\nopenLucidSite=Open Lucidchart Site in another tab and login to your account, then come back to this tab and click the "Start Import" button again.\npreviewSaveNoPermission=You do not have permission to save the preview image. The source page may be restricted or you may not have edit permission on the page. This only affects this page export to PDF/Word.\npreserveOrigin=Preserve Origin\nsharedStems=Bundle Outgoing Connections\ndraftLoadedWUnpublishedChanges=The diagram has loaded from a draft with unpublished changes. It is different from the published version.\nhachure=Hachure\nhatch=Hatch\ndots=Dots\ncrossHatch=Cross Hatch\nzigzag=ZigZag\nzigzagLine=ZigZag Line\nsysFonts=System Fonts\nwebfonts=Web Fonts\nfontname=Font Name\nfontUrl=Font URL\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;Graph.prototype.defaultThemes.darkTheme=Graph.prototype.defaultThemes["default-style2"];Editor.currentTheme="";window.uiTheme="";GraphViewer=function(b,d,m){this.init(b,d,m)};mxUtils.extend(GraphViewer,mxEventSource);GraphViewer.prototype.editBlankUrl="1"==urlParams.dev?"https://test.draw.io/":"https://app.diagrams.net/";GraphViewer.prototype.imageBaseUrl=window.DRAWIO_BASE_URL+"/";GraphViewer.prototype.toolbarHeight="BackCompat"==document.compatMode?24:26;GraphViewer.prototype.lightboxChrome=!0;GraphViewer.prototype.lightboxZIndex=999;GraphViewer.prototype.toolbarZIndex=999;GraphViewer.prototype.autoFit=!1;GraphViewer.prototype.autoCrop=!1;GraphViewer.prototype.autoOrigin=!0;GraphViewer.prototype.center=!1;GraphViewer.prototype.forceCenter=!1;GraphViewer.prototype.allowZoomIn=!1;GraphViewer.prototype.allowZoomOut=!0;GraphViewer.prototype.showTitleAsTooltip=!1;GraphViewer.prototype.checkVisibleState=!0;GraphViewer.prototype.minHeight=28;GraphViewer.prototype.minWidth=100;GraphViewer.prototype.responsive=!1;GraphViewer.prototype.darkMode=null;GraphViewer.prototype.showLinkIcons=!1;GraphViewer.prototype.showTooltipIcons=!1;@@ -4829,20 +4832,20 @@ GraphViewer.prototype.init=function(b,d,m){GraphViewer.initCss();this.graphConfinull!=this.graphConfig["allow-zoom-in"]?this.graphConfig["allow-zoom-in"]:this.allowZoomIn;this.forceCenter=null!=this.graphConfig.forceCenter?this.graphConfig.forceCenter:this.forceCenter;this.hCenterOnly=null!=this.graphConfig.hCenterOnly?this.graphConfig.hCenterOnly:this.hCenterOnly;this.center=null!=this.graphConfig.center?this.graphConfig.center:this.center||this.forceCenter;this.checkVisibleState=null!=this.graphConfig["check-visible-state"]?this.graphConfig["check-visible-state"]:this.checkVisibleState;this.darkMode=null!=this.graphConfig["dark-mode"]?this.graphConfig["dark-mode"]:this.darkMode;this.showLinkIcons=null!=this.graphConfig["show-link-icons"]?this.graphConfig["show-link-icons"]:this.showLinkIcons;this.showTooltipIcons=null!=this.graphConfig["show-tooltip-icons"]?this.graphConfig["show-tooltip-icons"]:this.showTooltipIcons;this.toolbarItems=null!=this.graphConfig.toolbar?this.graphConfig.toolbar.split(" "):[];this.zoomEnabled=0<=mxUtils.indexOf(this.toolbarItems,"zoom");this.layersEnabled=0<=mxUtils.indexOf(this.toolbarItems,"layers");this.tagsEnabled=0<=mxUtils.indexOf(this.toolbarItems,"tags");this.lightboxEnabled=0<=mxUtils.indexOf(this.toolbarItems,"lightbox");this.lightboxClickEnabled=0!=this.graphConfig.lightbox;this.initialOverflow=document.body.style.overflow;this.initialWidth=null!=b?b.style.width:null;this.widthIsEmpty=null!=this.initialWidth?""==this.initialWidth:!0;this.currentPage=parseInt(this.graphConfig.page)||0;this.responsive=(null!=this.graphConfig.responsive?this.graphConfig.responsive:-this.responsive)&&!this.zoomEnabled&&!mxClient.NO_FO&&!mxClient.IS_SF;this.pageId=this.graphConfig.pageId;this.browserTranslate=mxClient.IS_GC&&(null!=this.graphConfig["browser-translate"]?this.graphConfig["browser-translate"]:!0);this.editor=null;var p=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=d&&(this.xmlDocument=d.ownerDocument,this.xmlNode=d,this.xml=mxUtils.getXml(d),null!=b)){var v=mxUtils.bind(this,function(){this.graph=new Graph(b);-this.browserTranslate&&this.graph.waitForBrowserTranslate();this.graph.enableFlowAnimation=!0;this.installDarkModeListener();if(this.responsive&&this.graph.dialect==mxConstants.DIALECT_SVG){var C=this.graph.view.getDrawPane().ownerSVGElement,P=0;null!=this.graphConfig.border?P=this.graphConfig.border:""==b.style.padding&&(P=8);0<P&&(b.style.padding=P+"px",b.style.boxSizing="border-box");C.style.forcedColorAdjust="none";C.style.boxSizing="border-box";C.style.overflow="visible";this.graph.fit=function(){};-var G=parseFloat(this.graphConfig["responsive-max-scale"]),O=parseFloat(b.style.maxWidth);this.graph.sizeDidChange=function(){var K=this.view.graphBounds,fa=this.view.translate;C.setAttribute("viewBox",K.x+fa.x-this.panDx+" "+(K.y+fa.y-this.panDy)+" "+(K.width+1)+" "+(K.height+1));this.container.style.backgroundColor=C.style.backgroundColor;isNaN(G)||(fa=Math.round((K.width+1)*G+2*P),fa=isNaN(O)?fa:Math.min(fa,O),this.container.style.maxWidth=fa+"px");this.fireEvent(new mxEventObject(mxEvent.SIZE,+this.responsive)&&!this.zoomEnabled&&!mxClient.NO_FO&&!mxClient.IS_SF;this.pageId=this.graphConfig.pageId;this.browserTranslate=mxClient.IS_GC&&(null!=this.graphConfig["browser-translate"]?this.graphConfig["browser-translate"]:!0);this.editor=null;var p=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=d&&(this.xmlDocument=d.ownerDocument,this.xmlNode=d,this.xml=mxUtils.getXml(d),null!=b)){var u=mxUtils.bind(this,function(){this.graph=new Graph(b);+this.browserTranslate&&this.graph.waitForBrowserTranslate();this.graph.enableFlowAnimation=!0;this.installDarkModeListener();if(this.responsive&&this.graph.dialect==mxConstants.DIALECT_SVG){var B=this.graph.view.getDrawPane().ownerSVGElement,P=0;null!=this.graphConfig.border?P=this.graphConfig.border:""==b.style.padding&&(P=8);0<P&&(b.style.padding=P+"px",b.style.boxSizing="border-box");B.style.forcedColorAdjust="none";B.style.boxSizing="border-box";B.style.overflow="visible";this.graph.fit=function(){};+var G=parseFloat(this.graphConfig["responsive-max-scale"]),O=parseFloat(b.style.maxWidth);this.graph.sizeDidChange=function(){var K=this.view.graphBounds,fa=this.view.translate;B.setAttribute("viewBox",K.x+fa.x-this.panDx+" "+(K.y+fa.y-this.panDy)+" "+(K.width+1)+" "+(K.height+1));this.container.style.backgroundColor=B.style.backgroundColor;isNaN(G)||(fa=Math.round((K.width+1)*G+2*P),fa=isNaN(O)?fa:Math.min(fa,O),this.container.style.maxWidth=fa+"px");this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",K))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(K){return!0});this.lightboxClickEnabled&&(b.style.cursor="pointer");this.editor=new Editor(!0,null,null,this.graph);this.editor.editBlankUrl=this.editBlankUrl;this.graph.lightbox=!0;this.graph.centerZoom=!1;this.graph.autoExtend=!1;this.graph.autoScroll=!1;this.graph.showLinkIcons=this.showLinkIcons;this.graph.showTooltipIcons=this.showTooltipIcons;this.graph.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");var U=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=U&&U!=d)try{this.xml=mxUtils.getXml(U),this.xmlNode=U,this.xmlDocument=U.ownerDocument}catch(K){}this.graph.getImageFromBundles=function(K){return p.getImageUrl(K)};this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==this.xmlNode.nodeName){var c=this.xmlNode.getElementsByTagName("diagram");if(0<c.length){if(null!=this.pageId)for(U=0;U<c.length;U++)if(this.pageId==c[U].getAttribute("id")){this.currentPage=U;break}var f=this.graph.getGlobalVariable,k=null;try{var q=p.xmlNode.getAttribute("vars");null!=q&&0<q.length&&(k=JSON.parse(q))}catch(K){}this.graph.getGlobalVariable=function(K){var fa=c[p.currentPage];if("page"==K)return fa.getAttribute("name")||mxResources.get("pageWithNumber",[p.currentPage+1],"Page-"+(p.currentPage+1));if("pagenumber"==K)return p.currentPage+1;if("pagecount"==K)return c.length;fa=f.apply(this,arguments);null==fa&&null!=k&&(fa=k[K]);return fa}}}this.diagrams=[];var x=null;this.selectPage=function(K){if(!this.handlingResize){if(this.tagsEnabled&&null!=this.graphConfig.hiddenTags&&null!=this.diagrams[this.currentPage]){var fa=this.diagrams[this.currentPage].getAttribute("id");this.graphConfig.hiddenTags[fa]=0<this.graph.hiddenTags.length?this.graph.hiddenTags.slice():null}this.currentPage=mxUtils.mod(K,this.diagrams.length);this.tagsEnabled&&null!=this.graphConfig.hiddenTags&&null!=this.diagrams[this.currentPage]&&(K=this.diagrams[this.currentPage].getAttribute("id"),K=this.graphConfig.hiddenTags[K],-this.graph.hiddenTags=null!=K&&0<K.length?K:[]);this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage]))}};this.selectPageById=function(K){K=this.getIndexById(K);var fa=0<=K;fa&&this.selectPage(K);return fa};q=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=x&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),x=this.xmlNode)});var B=this.graph.setBackgroundImage;this.graph.setBackgroundImage=function(K){if(null!=-K&&Graph.isPageLink(K.src)){var fa=K.src,aa=fa.indexOf(",");0<aa&&(aa=p.getIndexById(fa.substring(aa+1)),0<=aa&&(K=p.getImageForGraphModel(Editor.parseDiagramNode(p.diagrams[aa])),K.originalSrc=fa))}B.apply(this,arguments)};var E=this.graph.getGraphBounds;this.graph.getGraphBounds=function(K){var fa=E.apply(this,arguments);K=this.backgroundImage;if(null!=K){var aa=this.view.translate,da=this.view.scale;fa=mxRectangle.fromRectangle(fa);fa.add(new mxRectangle((aa.x+K.x)*da,(aa.y+K.y)*da,K.width*da,+this.graph.hiddenTags=null!=K&&0<K.length?K:[]);this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage]))}};this.selectPageById=function(K){K=this.getIndexById(K);var fa=0<=K;fa&&this.selectPage(K);return fa};q=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=x&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),x=this.xmlNode)});var C=this.graph.setBackgroundImage;this.graph.setBackgroundImage=function(K){if(null!=+K&&Graph.isPageLink(K.src)){var fa=K.src,aa=fa.indexOf(",");0<aa&&(aa=p.getIndexById(fa.substring(aa+1)),0<=aa&&(K=p.getImageForGraphModel(Editor.parseDiagramNode(p.diagrams[aa])),K.originalSrc=fa))}C.apply(this,arguments)};var E=this.graph.getGraphBounds;this.graph.getGraphBounds=function(K){var fa=E.apply(this,arguments);K=this.backgroundImage;if(null!=K){var aa=this.view.translate,da=this.view.scale;fa=mxRectangle.fromRectangle(fa);fa.add(new mxRectangle((aa.x+K.x)*da,(aa.y+K.y)*da,K.width*da,K.height*da))}return fa};this.addListener("xmlNodeChanged",q);q();urlParams.page=p.currentPage;q=null;this.graph.getModel().beginUpdate();try{urlParams.nav=0!=this.graphConfig.nav?"1":"0";this.editor.setGraphXml(this.xmlNode);this.graph.view.scale=this.graphConfig.zoom||1;q=this.setLayersVisible();if(this.tagsEnabled&&null!=this.graphConfig.hiddenTags&&null!=this.diagrams&&null!=this.diagrams[this.currentPage]){var L=this.diagrams[this.currentPage].getAttribute("id"),Q=this.graphConfig.hiddenTags[L];null!=Q&&0<Q.length&&(this.graph.hiddenTags=Q)}this.fireEvent(new mxEventObject("graphInitialized"));this.responsive||(this.graph.border=null!=this.graphConfig.border?this.graphConfig.border:8);this.installBackgroundColorHandler();GraphViewer.viewerInitialized(this)}finally{this.graph.getModel().endUpdate()}this.responsive||(this.graph.panningHandler.isForcePanningEvent=function(K){return!mxEvent.isPopupTrigger(K.getEvent())&&"auto"==this.graph.container.style.overflow},this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.panningHandler.ignoreCell=!0,this.graph.panningHandler.usePopupTrigger=!1,this.graph.panningHandler.pinchEnabled=!1);this.graph.setPanning(!1);null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&b.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title);this.responsive||this.addSizeHandler();!this.showLayers(this.graph)||this.forceCenter||this.layersEnabled&&!this.autoCrop||this.crop();this.addClickHandler(this.graph);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=q&&this.setLayersVisible(q);this.graph.customLinkClicked=function(K,fa){try{if(Graph.isPageLink(K)){var aa=K.indexOf(",");p.selectPageById(K.substring(aa+1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var da=this.getGraphBounds();this.handleCustomLink(K,fa);da.equals(this.getGraphBounds())||p.crop()}}catch(ba){alert(ba.message)}return!0};var V=this.graph.foldTreeCell;this.graph.foldTreeCell=-mxUtils.bind(this,function(){this.treeCellFolded=!0;return V.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});m=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==b.offsetWidth&&null==this.getAncestorDetails(b)&&"undefined"!==typeof m){var n=this.getObservableParent(b),y=new m(mxUtils.bind(this,function(C){0<b.offsetWidth&&(y.disconnect(),v())}));y.observe(n,{attributes:!0})}else v()}};+mxUtils.bind(this,function(){this.treeCellFolded=!0;return V.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});m=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==b.offsetWidth&&null==this.getAncestorDetails(b)&&"undefined"!==typeof m){var n=this.getObservableParent(b),y=new m(mxUtils.bind(this,function(B){0<b.offsetWidth&&(y.disconnect(),u())}));y.observe(n,{attributes:!0})}else u()}};GraphViewer.prototype.installBackgroundColorHandler=function(){var b=this.graph;if(null!=b){null!=GraphViewer.shapeBackgroundColor&&(b.shapeBackgroundColor=GraphViewer.shapeBackgroundColor);b.defaultPageBackgroundColor="transparent";b.diagramBackgroundColor="transparent";b.transparentBackground=!1;var d=b.background,m=mxUtils.bind(this,function(p){"none"==b.getAdaptiveColors()&&null==d&&(this.isDarkMode()?b.background="#ffffff":b.background=null,p&&b.view.validateBackground())});this.addListener("graphChanged",function(){d=b.background;m(!0)});this.addListener("darkModeChanged",function(){m(!0)});m(!1)}};GraphViewer.prototype.installDarkModeListener=function(){null!=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(){this.darkModeChanged();this.fireEvent(new mxEventObject("darkModeChanged"))}));this.darkModeChanged()};GraphViewer.prototype.darkModeChanged=function(){if(null!=this.graph){var b=this.graph.container,d=this.isDarkMode();d?b.classList.add("geDarkMode"):b.classList.remove("geDarkMode");b.style.colorScheme=d?"dark":"light"}};GraphViewer.prototype.getAncestorDetails=function(b){for(;null!=b;){if("DETAILS"==b.nodeName)return b;b=b.parentNode}return null};@@ -4850,64 +4853,64 @@ GraphViewer.prototype.getObservableParent=function(b){for(b=b.parentNode;b!=docuGraphViewer.prototype.getImageForGraphModel=function(b){var d=Graph.createOffscreenGraph(this.graph.getStylesheet());d.getGlobalVariable=this.graph.getGlobalVariable;document.body.appendChild(d.container);b=(new mxCodec(b.ownerDocument)).decode(b).root;d.model.setRoot(b);b=d.getSvg();var m=d.getGraphBounds();document.body.removeChild(d.container);return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(b)),m.width,m.height,m.x,m.y)};GraphViewer.prototype.getIndexById=function(b){if(null!=this.diagrams)for(var d=0;d<this.diagrams.length;d++)if(this.diagrams[d].getAttribute("id")==b)return d;return-1};GraphViewer.prototype.setXmlNode=function(b){b=this.editor.extractGraphModel(b,!0);this.xmlDocument=b.ownerDocument;this.xml=mxUtils.getXml(b);this.xmlNode=b;this.updateGraphXml(b);this.fireEvent(new mxEventObject("xmlNodeChanged"))};GraphViewer.prototype.setFileNode=function(b){null==this.xmlNode&&(this.xmlDocument=b.ownerDocument,this.xml=mxUtils.getXml(b),this.xmlNode=b);this.setGraphXml(b)};GraphViewer.prototype.updateGraphXml=function(b){this.setGraphXml(b);this.fireEvent(new mxEventObject("graphChanged"))};-GraphViewer.prototype.setLayersVisible=function(b){var d=!0;if(!this.autoOrigin){var m=[],p=this.graph.getModel();p.beginUpdate();try{for(var v=0;v<p.getChildCount(p.root);v++){var n=p.getChildAt(p.root,v);d=d&&p.isVisible(n);m.push(p.isVisible(n));p.setVisible(n,null!=b?b[v]:!0)}}finally{p.endUpdate()}}return d?null:m};+GraphViewer.prototype.setLayersVisible=function(b){var d=!0;if(!this.autoOrigin){var m=[],p=this.graph.getModel();p.beginUpdate();try{for(var u=0;u<p.getChildCount(p.root);u++){var n=p.getChildAt(p.root,u);d=d&&p.isVisible(n);m.push(p.isVisible(n));p.setVisible(n,null!=b?b[u]:!0)}}finally{p.endUpdate()}}return d?null:m};GraphViewer.prototype.setGraphXml=function(b){if(null!=this.graph){this.graph.view.translate=new mxPoint;this.graph.view.scale=1;var d=null;this.graph.getModel().beginUpdate();try{this.graph.getModel().clear(),this.editor.setGraphXml(b),d=this.setLayersVisible(!0)}finally{this.graph.getModel().endUpdate()}this.responsive||(this.widthIsEmpty?(this.graph.container.style.width="",this.graph.container.style.height=""):this.graph.container.style.width=this.initialWidth,this.positionGraph());this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};d&&this.setLayersVisible(d)}};GraphViewer.prototype.isDarkMode=function(){return"dark"==this.darkMode||"auto"==this.darkMode&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches};-GraphViewer.prototype.addSizeHandler=function(){var b=this.graph.container,d=this.graph.getGraphBounds(),m=!1;b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var p=mxUtils.bind(this,function(){if(!m){m=!0;var C=this.graph.getGraphBounds();b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?C.width+2*this.graph.border>b.offsetWidth-2?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){C=b.getBoundingClientRect();var P=mxUtils.getScrollOrigin(document.body);-P="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-P.x,top:-P.y};C={left:C.left-P.left,top:C.top-P.top,bottom:C.bottom-P.top,right:C.right-P.left};this.toolbar.style.left=C.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=C.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px",this.toolbar.style.top=C.top+1+"px"):this.toolbar.style.top=C.top+"px"}else null!=-this.toolbar&&(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px");this.treeCellFolded&&(this.treeCellFolded=!1,this.positionGraph(this.graph.view.translate),this.graph.initialViewState.translate=this.graph.view.translate.clone());m=!1}}),v=null;this.handlingResize=!1;this.fitGraph=mxUtils.bind(this,function(C){var P=b.offsetWidth;P==v||this.handlingResize||(this.handlingResize=!0,"auto"==b.style.overflow&&(b.style.overflow="hidden"),this.graph.maxFitScale=null!=C?C:this.graphConfig.zoom||-(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,null,!0),(this.center||0==this.graphConfig.resize&&""!=b.style.height)&&this.graph.center(!0,this.hCenterOnly?!1:!0),this.graph.maxFitScale=null,(0!=this.graphConfig.resize||""==b.style.height||this.hCenterOnly)&&this.updateContainerHeight(b,Math.max(this.minHeight,this.graph.getGraphBounds().height+2*this.graph.border+1)),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},v=P,window.setTimeout(mxUtils.bind(this,+GraphViewer.prototype.addSizeHandler=function(){var b=this.graph.container,d=this.graph.getGraphBounds(),m=!1;b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var p=mxUtils.bind(this,function(){if(!m){m=!0;var B=this.graph.getGraphBounds();b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?B.width+2*this.graph.border>b.offsetWidth-2?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){B=b.getBoundingClientRect();var P=mxUtils.getScrollOrigin(document.body);+P="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-P.x,top:-P.y};B={left:B.left-P.left,top:B.top-P.top,bottom:B.bottom-P.top,right:B.right-P.left};this.toolbar.style.left=B.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=B.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px",this.toolbar.style.top=B.top+1+"px"):this.toolbar.style.top=B.top+"px"}else null!=+this.toolbar&&(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px");this.treeCellFolded&&(this.treeCellFolded=!1,this.positionGraph(this.graph.view.translate),this.graph.initialViewState.translate=this.graph.view.translate.clone());m=!1}}),u=null;this.handlingResize=!1;this.fitGraph=mxUtils.bind(this,function(B){var P=b.offsetWidth;P==u||this.handlingResize||(this.handlingResize=!0,"auto"==b.style.overflow&&(b.style.overflow="hidden"),this.graph.maxFitScale=null!=B?B:this.graphConfig.zoom||+(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,null,!0),(this.center||0==this.graphConfig.resize&&""!=b.style.height)&&this.graph.center(!0,this.hCenterOnly?!1:!0),this.graph.maxFitScale=null,(0!=this.graphConfig.resize||""==b.style.height||this.hCenterOnly)&&this.updateContainerHeight(b,Math.max(this.minHeight,this.graph.getGraphBounds().height+2*this.graph.border+1)),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},u=P,window.setTimeout(mxUtils.bind(this,function(){this.handlingResize=!1}),0))});GraphViewer.useResizeSensor&&(9>=document.documentMode?(mxEvent.addListener(window,"resize",p),this.graph.addListener("size",p)):new ResizeSensor(this.graph.container,p));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,this.minWidth,this.minHeight),this.graph.resizeContainer=!0;else if(!this.widthIsEmpty||""!=b.style.height&&this.autoFit||this.updateContainerWidth(b,-d.width+2*this.graph.border),0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,d.height+2*this.graph.border+1)),!this.zoomEnabled&&this.autoFit){var n=v=null;p=mxUtils.bind(this,function(){window.clearTimeout(n);this.handlingResize||(n=window.setTimeout(mxUtils.bind(this,this.fitGraph),100))});GraphViewer.useResizeSensor&&(9>=document.documentMode?mxEvent.addListener(window,"resize",p):new ResizeSensor(this.graph.container,p))}else 9>=document.documentMode||-this.graph.addListener("size",p);var y=mxUtils.bind(this,function(C){var P=b.style.minWidth;this.widthIsEmpty&&(b.style.minWidth="100%");var G=null!=this.graphConfig["max-height"]?this.graphConfig["max-height"]:""!=b.style.height&&this.autoFit?b.offsetHeight:void 0;0<b.offsetWidth&&null==C&&this.allowZoomOut&&(this.allowZoomIn||d.width+2*this.graph.border>b.offsetWidth||d.height+2*this.graph.border>G)?(C=null,null!=G&&d.height+2*this.graph.border>G-2&&(C=(G-2*this.graph.border-2)/d.height),this.fitGraph(C)):-this.widthIsEmpty||null!=C||0!=this.graphConfig.resize||""==b.style.height?(C=null!=C?C:new mxPoint,this.graph.view.setTranslate(Math.floor(this.graph.border-d.x/this.graph.view.scale)+C.x,Math.floor(this.graph.border-d.y/this.graph.view.scale)+C.y),v=b.offsetWidth):this.graph.center((!this.widthIsEmpty||d.width<this.minWidth)&&1!=this.graphConfig.resize);b.style.minWidth=P});8==document.documentMode?window.setTimeout(y,0):y();this.positionGraph=function(C){d=this.graph.getGraphBounds();v=null;y(C)}};+d.width+2*this.graph.border),0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,d.height+2*this.graph.border+1)),!this.zoomEnabled&&this.autoFit){var n=u=null;p=mxUtils.bind(this,function(){window.clearTimeout(n);this.handlingResize||(n=window.setTimeout(mxUtils.bind(this,this.fitGraph),100))});GraphViewer.useResizeSensor&&(9>=document.documentMode?mxEvent.addListener(window,"resize",p):new ResizeSensor(this.graph.container,p))}else 9>=document.documentMode||+this.graph.addListener("size",p);var y=mxUtils.bind(this,function(B){var P=b.style.minWidth;this.widthIsEmpty&&(b.style.minWidth="100%");var G=null!=this.graphConfig["max-height"]?this.graphConfig["max-height"]:""!=b.style.height&&this.autoFit?b.offsetHeight:void 0;0<b.offsetWidth&&null==B&&this.allowZoomOut&&(this.allowZoomIn||d.width+2*this.graph.border>b.offsetWidth||d.height+2*this.graph.border>G)?(B=null,null!=G&&d.height+2*this.graph.border>G-2&&(B=(G-2*this.graph.border-2)/d.height),this.fitGraph(B)):+this.widthIsEmpty||null!=B||0!=this.graphConfig.resize||""==b.style.height?(B=null!=B?B:new mxPoint,this.graph.view.setTranslate(Math.floor(this.graph.border-d.x/this.graph.view.scale)+B.x,Math.floor(this.graph.border-d.y/this.graph.view.scale)+B.y),u=b.offsetWidth):this.graph.center((!this.widthIsEmpty||d.width<this.minWidth)&&1!=this.graphConfig.resize);b.style.minWidth=P});8==document.documentMode?window.setTimeout(y,0):y();this.positionGraph=function(B){d=this.graph.getGraphBounds();u=null;y(B)}};GraphViewer.prototype.crop=function(){var b=this.graph,d=b.getGraphBounds(),m=b.border,p=b.view.scale;b.view.setTranslate(null!=d.x?Math.floor(b.view.translate.x-d.x/p+m):m,null!=d.y?Math.floor(b.view.translate.y-d.y/p+m):m)};GraphViewer.prototype.updateContainerWidth=function(b,d){b.style.width=d+"px"};GraphViewer.prototype.updateContainerHeight=function(b,d){if(this.forceCenter||this.zoomEnabled||!this.autoFit||"BackCompat"==document.compatMode||8==document.documentMode)b.style.height=d+"px"};-GraphViewer.prototype.showLayers=function(b,d){var m=this.graphConfig.layers;m=null!=m&&0<m.length?m.split(" "):[];var p=this.graphConfig.layerIds,v=null!=p&&0<p.length,n=!1;if(0<m.length||v||null!=d){d=null!=d?d.getModel():null;b=b.getModel();b.beginUpdate();try{var y=b.getChildCount(b.root);if(null==d){d=!1;n={};if(v)for(var C=0;C<p.length;C++){var P=b.getCell(p[C]);null!=P&&(d=!0,n[P.id]=!0)}else for(C=0;C<m.length;C++)P=b.getChildAt(b.root,parseInt(m[C])),null!=P&&(d=!0,n[P.id]=!0);for(C=0;d&&-C<y;C++)P=b.getChildAt(b.root,C),b.setVisible(P,n[P.id]||!1)}else for(C=0;C<y;C++)b.setVisible(b.getChildAt(b.root,C),d.isVisible(d.getChildAt(d.root,C)))}finally{b.endUpdate()}n=!0}return n};+GraphViewer.prototype.showLayers=function(b,d){var m=this.graphConfig.layers;m=null!=m&&0<m.length?m.split(" "):[];var p=this.graphConfig.layerIds,u=null!=p&&0<p.length,n=!1;if(0<m.length||u||null!=d){d=null!=d?d.getModel():null;b=b.getModel();b.beginUpdate();try{var y=b.getChildCount(b.root);if(null==d){d=!1;n={};if(u)for(var B=0;B<p.length;B++){var P=b.getCell(p[B]);null!=P&&(d=!0,n[P.id]=!0)}else for(B=0;B<m.length;B++)P=b.getChildAt(b.root,parseInt(m[B])),null!=P&&(d=!0,n[P.id]=!0);for(B=0;d&&+B<y;B++)P=b.getChildAt(b.root,B),b.setVisible(P,n[P.id]||!1)}else for(B=0;B<y;B++)b.setVisible(b.getChildAt(b.root,B),d.isVisible(d.getChildAt(d.root,B)))}finally{b.endUpdate()}n=!0}return n};GraphViewer.prototype.addToolbar=function(){var b=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?b.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(b.style.marginTop=this.toolbarHeight+"px");var d=b.ownerDocument.createElement("div");d.style.display="flex";d.style.alignItems="center";d.style.position="absolute";d.style.overflow="hidden";d.style.boxSizing="border-box";d.style.whiteSpace="nowrap";d.style.textAlign="left";d.style.zIndex=this.toolbarZIndex;d.style.backgroundColor="light-dark(#eeeeee, "+GraphViewer.darkBackgroundColor+")";d.style.height=this.toolbarHeight+"px";var m=mxUtils.bind(this,function(){this.isDarkMode()?(d.classList.add("geDarkMode"),d.style.colorScheme="dark"):(d.classList.remove("geDarkMode"),d.style.colorScheme="light")});this.addListener("darkModeChanged",m);this.toolbar=d;m();if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(d.style,"transition","opacity 100ms ease-in-out");-mxUtils.setOpacity(d,30);var p=null,v=null,n=mxUtils.bind(this,function(aa){null!=p&&(window.clearTimeout(p),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);p=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(d,0);p=null;v=window.setTimeout(mxUtils.bind(this,function(){d.style.display="none";v=null}),100)}),aa||200)}),y=mxUtils.bind(this,function(aa){null!=p&&(window.clearTimeout(p),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);d.style.display=+mxUtils.setOpacity(d,30);var p=null,u=null,n=mxUtils.bind(this,function(aa){null!=p&&(window.clearTimeout(p),fadeThead=null);null!=u&&(window.clearTimeout(u),fadeThead2=null);p=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(d,0);p=null;u=window.setTimeout(mxUtils.bind(this,function(){d.style.display="none";u=null}),100)}),aa||200)}),y=mxUtils.bind(this,function(aa){null!=p&&(window.clearTimeout(p),fadeThead=null);null!=u&&(window.clearTimeout(u),fadeThead2=null);d.style.display="flex";mxUtils.setOpacity(d,aa||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(aa){mxEvent.isTouchEvent(aa)||(y(30),n())}));mxEvent.addListener(d,mxClient.IS_POINTER?"pointermove":"mousemove",function(aa){mxEvent.consume(aa)});mxEvent.addListener(d,"mouseenter",mxUtils.bind(this,function(aa){y(100)}));mxEvent.addListener(d,"mousemove",mxUtils.bind(this,function(aa){y(100);mxEvent.consume(aa)}));mxEvent.addListener(d,"mouseleave",-mxUtils.bind(this,function(aa){mxEvent.isTouchEvent(aa)||y(30)}));var C=this.graph,P=C.getTolerance();C.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(aa,da){this.startX=da.getGraphX();this.startY=da.getGraphY();this.scrollLeft=C.container.scrollLeft;this.scrollTop=C.container.scrollTop},mouseMove:function(aa,da){},mouseUp:function(aa,da){mxEvent.isTouchEvent(da.getEvent())&&Math.abs(this.scrollLeft-C.container.scrollLeft)<P&&Math.abs(this.scrollTop-C.container.scrollTop)<-P&&Math.abs(this.startX-da.getGraphX())<P&&Math.abs(this.startY-da.getGraphY())<P&&(0<parseFloat(d.style.opacity||0)?n():y(30))}})}m=this.toolbarItems;for(var G=0,O=mxUtils.bind(this,function(aa,da,ba,ha){aa=this.createToolbarButton(aa,da,ba,ha);d.appendChild(aa);G++;return aa}),U=this.graph.getModel(),c=null,f=null,k=null,q=null,x=0;x<m.length;x++){var B=m[x];if("pages"==B){q=b.ownerDocument.createElement("div");q.style.display="inline-flex";q.style.position="relative";q.style.alignItems="center";+mxUtils.bind(this,function(aa){mxEvent.isTouchEvent(aa)||y(30)}));var B=this.graph,P=B.getTolerance();B.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(aa,da){this.startX=da.getGraphX();this.startY=da.getGraphY();this.scrollLeft=B.container.scrollLeft;this.scrollTop=B.container.scrollTop},mouseMove:function(aa,da){},mouseUp:function(aa,da){mxEvent.isTouchEvent(da.getEvent())&&Math.abs(this.scrollLeft-B.container.scrollLeft)<P&&Math.abs(this.scrollTop-B.container.scrollTop)<+P&&Math.abs(this.startX-da.getGraphX())<P&&Math.abs(this.startY-da.getGraphY())<P&&(0<parseFloat(d.style.opacity||0)?n():y(30))}})}m=this.toolbarItems;for(var G=0,O=mxUtils.bind(this,function(aa,da,ba,ha){aa=this.createToolbarButton(aa,da,ba,ha);d.appendChild(aa);G++;return aa}),U=this.graph.getModel(),c=null,f=null,k=null,q=null,x=0;x<m.length;x++){var C=m[x];if("pages"==C){q=b.ownerDocument.createElement("div");q.style.display="inline-flex";q.style.position="relative";q.style.alignItems="center";q.style.padding="4px";q.style.fontFamily=GraphViewer.cssFontFamily;q.style.fontSize="12px";q.style.cursor="default";q.style.color="light-dark(#000000, #ffffff)";mxUtils.setOpacity(q,70);var E=O(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.chevronLeftImage,mxResources.get("previousPage")||"Previous Page");E.style.borderRightStyle="none";E.style.paddingLeft="0px";E.style.paddingRight="0px";d.appendChild(q);var L=O(mxUtils.bind(this,function(){this.selectPage(this.currentPage+-1)}),Editor.chevronRightImage,mxResources.get("nextPage")||"Next Page");L.style.paddingLeft="0px";L.style.paddingRight="0px";B=mxUtils.bind(this,function(){q.innerText="";mxUtils.write(q,this.currentPage+1+" / "+this.diagrams.length);q.style.display=1<this.diagrams.length?"inline-flex":"none";E.style.display=q.style.display;L.style.display=q.style.display});this.addListener("graphChanged",B);B()}else if("zoom"==B)this.zoomEnabled&&(O(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,-mxResources.get("zoomOut")||"Zoom Out"),O(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),O(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==B){if(this.layersEnabled){var Q=O(mxUtils.bind(this,function(aa){if(null!=c)c.parentNode.removeChild(c),+1)}),Editor.chevronRightImage,mxResources.get("nextPage")||"Next Page");L.style.paddingLeft="0px";L.style.paddingRight="0px";C=mxUtils.bind(this,function(){q.innerText="";mxUtils.write(q,this.currentPage+1+" / "+this.diagrams.length);q.style.display=1<this.diagrams.length?"inline-flex":"none";E.style.display=q.style.display;L.style.display=q.style.display});this.addListener("graphChanged",C);C()}else if("zoom"==C)this.zoomEnabled&&(O(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,+mxResources.get("zoomOut")||"Zoom Out"),O(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),O(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==C){if(this.layersEnabled){var Q=O(mxUtils.bind(this,function(aa){if(null!=c)c.parentNode.removeChild(c),c=null;else{c=this.graph.createLayersDialog(mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ba=this.graph.getGraphBounds(),ha=this.graph.view;0>ba.x||0>ba.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:ha.translate.clone(),scale:ha.scale}):null!=this.graph.originalViewState&&0<ba.x/ha.scale+this.graph.originalViewState.translate.x-ha.translate.x&&0<ba.y/ha.scale+this.graph.originalViewState.translate.y-ha.translate.y&&(ha.setTranslate(this.graph.originalViewState.translate.x,this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:ha.translate.clone(),scale:ha.scale})}}));mxEvent.addListener(c,"mouseleave",function(){c.parentNode.removeChild(c);c=null});aa=Q.getBoundingClientRect();c.style.width="140px";c.style.padding="2px 0px 2px 0px";c.style.border="1px solid #d0d0d0";c.style.backgroundColor="#eee";c.style.fontFamily=GraphViewer.cssFontFamily;c.style.fontSize="11px";c.style.overflowY="auto";c.style.maxHeight=this.graph.container.clientHeight-this.toolbarHeight-10+"px";c.style.zIndex=this.toolbarZIndex+1;c.style.color="#000";mxUtils.setOpacity(c,85);var da=mxUtils.getDocumentScrollOrigin(document);c.style.left=da.x+aa.left-1+"px";c.style.top=da.y+aa.bottom-2+"px";this.isDarkMode()&&(c.style.filter="invert(93%) hue-rotate(180deg)");document.body.appendChild(c)}}),Editor.layersImage,mxResources.get("layers")||"Layers");U.addListener(mxEvent.CHANGE,-function(){Q.style.display=1<U.getChildCount(U.root)?"inline-flex":"none"});Q.style.display=1<U.getChildCount(U.root)?"inline-flex":"none"}}else if("tags"==B){if(this.tagsEnabled){var V=O(mxUtils.bind(this,function(aa){null==f&&(f=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),this.graph.addListener(mxEvent.REFRESH,mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ba=this.graph.getGraphBounds(),ha=this.graph.view;0>ba.x||0>ba.y?(this.crop(),+function(){Q.style.display=1<U.getChildCount(U.root)?"inline-flex":"none"});Q.style.display=1<U.getChildCount(U.root)?"inline-flex":"none"}}else if("tags"==C){if(this.tagsEnabled){var V=O(mxUtils.bind(this,function(aa){null==f&&(f=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),this.graph.addListener(mxEvent.REFRESH,mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var ba=this.graph.getGraphBounds(),ha=this.graph.view;0>ba.x||0>ba.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:ha.translate.clone(),scale:ha.scale}):null!=this.graph.originalViewState&&0<ba.x/ha.scale+this.graph.originalViewState.translate.x-ha.translate.x&&0<ba.y/ha.scale+this.graph.originalViewState.translate.y-ha.translate.y&&(ha.setTranslate(this.graph.originalViewState.translate.x,this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:ha.translate.clone(),scale:ha.scale})}})),f.div.getElementsByTagName("div")[0].style.position="",f.div.style.maxHeight="160px",f.div.style.maxWidth="120px",f.div.style.padding="2px",f.div.style.overflow="auto",f.div.style.height="auto",f.div.style.position="fixed",f.div.style.fontFamily=GraphViewer.cssFontFamily,f.div.style.fontSize="11px",f.div.style.backgroundColor="#eee",f.div.style.color="#000",f.div.style.border="1px solid #d0d0d0",f.div.style.zIndex=this.toolbarZIndex+1,this.isDarkMode()&&(f.div.style.filter="invert(93%) hue-rotate(180deg)"),mxUtils.setOpacity(f.div,85));if(null!=k)k.parentNode.removeChild(k),k=null;else{k=f.div;k.style.position="absolute";mxEvent.addListener(k,"mouseleave",function(){null!=k&&(k.parentNode.removeChild(k),k=null)});aa=V.getBoundingClientRect();var da=mxUtils.getDocumentScrollOrigin(document);k.style.left=da.x+aa.left-1+"px";k.style.top=da.y+aa.bottom-2+"px";document.body.appendChild(k);f.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");U.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){V.style.display=-0<this.graph.getAllTags().length?"inline-flex":"none";null!=k&&0==this.graph.getAllTags().length&&(k.parentNode.removeChild(k),k=null)}));V.style.display=0<this.graph.getAllTags().length?"inline-flex":"none"}}else"lightbox"==B?this.lightboxEnabled&&O(mxUtils.bind(this,function(){try{this.showLightbox()}catch(aa){alert(aa.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(B=this.graphConfig["toolbar-buttons"][B],null!=B&&(B.elem=-O(null==B.enabled||B.enabled?B.handler:function(){},B.image,B.title,B.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*G);null!=this.graphConfig.title&&(m=b.ownerDocument.createElement("div"),m.style.display="inline-flex",m.style.position="relative",m.style.alignItems="center",m.style.padding="6px",m.style.fontFamily=GraphViewer.cssFontFamily,m.style.fontSize="12px",m.style.cursor="default",m.style.color="light-dark(#000000, #ffffff)",m.setAttribute("title",+0<this.graph.getAllTags().length?"inline-flex":"none";null!=k&&0==this.graph.getAllTags().length&&(k.parentNode.removeChild(k),k=null)}));V.style.display=0<this.graph.getAllTags().length?"inline-flex":"none"}}else"lightbox"==C?this.lightboxEnabled&&O(mxUtils.bind(this,function(){try{this.showLightbox()}catch(aa){alert(aa.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(C=this.graphConfig["toolbar-buttons"][C],null!=C&&(C.elem=+O(null==C.enabled||C.enabled?C.handler:function(){},C.image,C.title,C.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*G);null!=this.graphConfig.title&&(m=b.ownerDocument.createElement("div"),m.style.display="inline-flex",m.style.position="relative",m.style.alignItems="center",m.style.padding="6px",m.style.fontFamily=GraphViewer.cssFontFamily,m.style.fontSize="12px",m.style.cursor="default",m.style.color="light-dark(#000000, #ffffff)",m.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title),mxUtils.write(m,this.graphConfig.title),mxUtils.setOpacity(m,70),d.appendChild(m),this.filename=m);this.minToolbarWidth=34*G;var K=b.style.border,fa=mxUtils.bind(this,function(){d.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";d.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var aa=b.getBoundingClientRect(),da=mxUtils.getScrollOrigin(document.body);da="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-da.x,top:-da.y};aa={left:aa.left-da.left,top:aa.top-da.top,bottom:aa.bottom-da.top,right:aa.right-da.left};d.style.left=aa.left+"px";"bottom"==this.graphConfig["toolbar-position"]?d.style.top=aa.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(d.style.marginTop=-this.toolbarHeight+"px",d.style.top=aa.top+1+"px"):d.style.top=aa.top+"px";"1px solid transparent"==K&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(d);var ba=mxUtils.bind(this,function(){null!=d.parentNode&&d.parentNode.removeChild(d);null!=k&&(k.parentNode.removeChild(k),k=null);null!=c&&(c.parentNode.removeChild(c),c=null);b.style.border=K});mxEvent.addListener(document,"mousemove",function(ha){for(ha=mxEvent.getSource(ha);null!=ha;){if(ha==b||ha==d||ha==c||ha==k)return;ha=ha.parentNode}ba()});mxEvent.addListener(document.body,"mouseleave",function(ha){ba()})}else d.style.top=-this.toolbarHeight+"px",b.appendChild(d)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",fa):fa();this.responsive&&"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){null!=d.parentNode&&fa()})).observe(b)};-GraphViewer.prototype.createToolbarButton=function(b,d,m,p){var v=document.createElement("div");v.style.borderRight="1px solid #d0d0d0";v.style.display="inline-flex";v.style.alignItems="center";v.style.padding="6px";mxEvent.addListener(v,"click",b);null!=m&&v.setAttribute("title",m);b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",d);b.style.width="18px";b.className="geAdaptiveAsset";null==p||p?(mxEvent.addListener(v,"mouseenter",function(){v.style.backgroundColor=-"light-dark(#dddddd,#333333)"}),mxEvent.addListener(v,"mouseleave",function(){v.style.backgroundColor="transparent"}),mxUtils.setOpacity(b,60),v.style.cursor="pointer"):mxUtils.setOpacity(v,30);v.appendChild(b);return v};+GraphViewer.prototype.createToolbarButton=function(b,d,m,p){var u=document.createElement("div");u.style.borderRight="1px solid #d0d0d0";u.style.display="inline-flex";u.style.alignItems="center";u.style.padding="6px";mxEvent.addListener(u,"click",b);null!=m&&u.setAttribute("title",m);b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",d);b.style.width="18px";b.className="geAdaptiveAsset";null==p||p?(mxEvent.addListener(u,"mouseenter",function(){u.style.backgroundColor=+"light-dark(#dddddd,#333333)"}),mxEvent.addListener(u,"mouseleave",function(){u.style.backgroundColor="transparent"}),mxUtils.setOpacity(b,60),u.style.cursor="pointer"):mxUtils.setOpacity(u,30);u.appendChild(b);return u};GraphViewer.prototype.disableButton=function(b,d){var m=this.graphConfig["toolbar-buttons"]?this.graphConfig["toolbar-buttons"][b]:null;null!=m&&(mxUtils.setOpacity(m.elem,30),mxEvent.removeListener(m.elem,"click",m.handler),mxEvent.addListener(m.elem,"mouseenter",function(){m.elem.style.backgroundColor="#eee"}),d&&m.elem.setAttribute("title",d))};-GraphViewer.prototype.addClickHandler=function(b,d){b.linkPolicy=this.graphConfig.target||b.linkPolicy;b.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(m,p,v){if(null==p)for(var n=mxEvent.getSource(m);n!=b.container&&null!=n&&null==p;)"a"==n.nodeName.toLowerCase()&&(p=n.getAttribute("href")),n=n.parentNode;null!=d?null==p||b.isCustomLink(p)?mxEvent.consume(m):b.isExternalProtocol(p)||b.isBlankLink(p)||window.setTimeout(function(){d.destroy()},0):null!=p&&null==d&&b.isCustomLink(p)&&-(mxEvent.isTouchEvent(m)||!mxEvent.isPopupTrigger(m))&&b.customLinkClicked(p,v)&&(mxUtils.clearSelection(),mxEvent.consume(m))}),mxUtils.bind(this,function(m){if(null==d&&this.lightboxClickEnabled&&(!mxEvent.isTouchEvent(m)||0==this.toolbarItems.length))try{this.showLightbox()}catch(p){alert(p.message)}}))};+GraphViewer.prototype.addClickHandler=function(b,d){b.linkPolicy=this.graphConfig.target||b.linkPolicy;b.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(m,p,u){if(null==p)for(var n=mxEvent.getSource(m);n!=b.container&&null!=n&&null==p;)"a"==n.nodeName.toLowerCase()&&(p=n.getAttribute("href")),n=n.parentNode;null!=d?null==p||b.isCustomLink(p)?mxEvent.consume(m):b.isExternalProtocol(p)||b.isBlankLink(p)||window.setTimeout(function(){d.destroy()},0):null!=p&&null==d&&b.isCustomLink(p)&&+(mxEvent.isTouchEvent(m)||!mxEvent.isPopupTrigger(m))&&b.customLinkClicked(p,u)&&(mxUtils.clearSelection(),mxEvent.consume(m))}),mxUtils.bind(this,function(m){if(null==d&&this.lightboxClickEnabled&&(!mxEvent.isTouchEvent(m)||0==this.toolbarItems.length))try{this.showLightbox()}catch(p){alert(p.message)}}))};GraphViewer.prototype.showLightbox=function(b,d,m){if("open"==this.graphConfig.lightbox||window.self!==window.top)if(null==this.lightboxWindow||this.lightboxWindow.closed){b=null!=b?b:null!=this.graphConfig.editable?this.graphConfig.editable:!0;m={client:1,target:null!=m?m:"blank"};b&&(m.edit=this.graphConfig.edit||"_blank");if(null!=d?d:1)m.close=1;this.layersEnabled&&(m.layers=1);this.tagsEnabled&&null!=this.diagrams&&null!=this.diagrams[this.currentPage]&&(b=this.diagrams[this.currentPage].getAttribute("id"),null==this.graphConfig.hiddenTags&&(this.graphConfig.hiddenTags={}),this.graphConfig.hiddenTags[b]=0<this.graph.hiddenTags.length?this.graph.hiddenTags.slice():null,m.tags=this.graphConfig.hiddenTags);this.browserTranslate&&(m["browser-translate"]=1);null!=this.graphConfig&&0!=this.graphConfig.nav&&(m.nav=1);null!=this.graphConfig&&null!=this.graphConfig.highlight&&(m.highlight=this.graphConfig.highlight.substring(1));null!=this.currentPage&&0<this.currentPage&&(m.page=this.currentPage);"undefined"!==typeof window.postMessage&&(null==document.documentMode||10<=document.documentMode)?null==this.lightboxWindow&&mxEvent.addListener(window,"message",mxUtils.bind(this,function(p){"ready"==p.data&&p.source==this.lightboxWindow&&this.lightboxWindow.postMessage(this.xml,"*")})):m.data=encodeURIComponent(this.xml);"1"==urlParams.dev&&(m.dev="1");this.lightboxWindow=window.open(("1"!=urlParams.dev?EditorUi.lightboxHost:"https://test.draw.io")+"/#P"+encodeURIComponent(JSON.stringify(m)))}else this.lightboxWindow.focus();else this.showLocalLightbox()};GraphViewer.prototype.showLocalLightbox=function(b){var d=this.browserTranslate&&null!=this.graph?this.graph.getBrowserTranslationCache():null,m=document.createElement("div");m.style.position="fixed";m.style.top="0";m.style.left="0";m.style.bottom="0";m.style.right="0";m.style.zIndex=this.lightboxZIndex;m.style.backgroundColor="#000000";mxUtils.setOpacity(m,70);document.body.appendChild(m);var p=document.createElement("img");p.setAttribute("border","0");p.setAttribute("src",Editor.closeBlackImage);-p.style.position="fixed";p.style.top="32px";p.style.right="32px";p.style.cursor="pointer";p.className="geAdaptiveAsset";var v=mxUtils.bind(this,function(){C.setDarkMode(this.isDarkMode())});mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.removeListener("darkModeChanged",v);C.destroy()}));urlParams.pages="1";urlParams.page=this.currentPage;urlParams["page-id"]=this.graphConfig.pageId;urlParams["layer-ids"]=null!=this.graphConfig.layerIds&&0<this.graphConfig.layerIds.length?this.graphConfig.layerIds.join(" "):+p.style.position="fixed";p.style.top="32px";p.style.right="32px";p.style.cursor="pointer";p.className="geAdaptiveAsset";var u=mxUtils.bind(this,function(){B.setDarkMode(this.isDarkMode())});mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.removeListener("darkModeChanged",u);B.destroy()}));urlParams.pages="1";urlParams.page=this.currentPage;urlParams["page-id"]=this.graphConfig.pageId;urlParams["layer-ids"]=null!=this.graphConfig.layerIds&&0<this.graphConfig.layerIds.length?this.graphConfig.layerIds.join(" "):null;urlParams.nav=0!=this.graphConfig.nav?"1":"0";urlParams.layers=this.layersEnabled?"1":"0";urlParams.dark=this.isDarkMode()?"1":"0";if(this.tagsEnabled&&null!=this.diagrams&&null!=this.diagrams[this.currentPage]){var n=this.diagrams[this.currentPage].getAttribute("id");null==this.graphConfig.hiddenTags&&(this.graphConfig.hiddenTags={});this.graphConfig.hiddenTags[n]=0<this.graph.hiddenTags.length?this.graph.hiddenTags.slice():null;urlParams.tags=JSON.stringify(this.graphConfig.hiddenTags)}if(null!=b)try{var y=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));y.noCloseBtn=!0;urlParams["toolbar-config"]=encodeURIComponent(JSON.stringify(y))}catch(q){}if(null==document.documentMode||10<=document.documentMode)Editor.prototype.editButtonLink=this.graphConfig.edit,Editor.prototype.editButtonFunc=this.graphConfig.editFunc;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};-var C=new EditorUi(new Editor(!0),document.createElement("div"),!0);this.addListener("darkModeChanged",v);C.editor.editBlankUrl=this.editBlankUrl;C.refresh=function(){};var P=mxUtils.bind(this,function(q){27==q.keyCode&&C.destroy()}),G=this.initialOverflow,O=C.destroy;C.destroy=function(){null==b&&(mxEvent.removeListener(document.documentElement,"keydown",P),document.body.removeChild(m),document.body.removeChild(p),document.body.style.overflow=G,GraphViewer.resizeSensorEnabled=!0,O.apply(this,arguments))};-var U=C.editor.graph;this.browserTranslate&&U.waitForBrowserTranslate();var c=U.container;c.style.overflow="hidden";c.style.inset="0";this.lightboxChrome&&null==b?(c.style.border="1px solid #c0c0c0",c.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",P)):(m.style.display="none",p.style.display="none");var f=this;U.getImageFromBundles=function(q){return f.getImageUrl(q)};var k=C.createTemporaryGraph;C.createTemporaryGraph=function(){var q=k.apply(this,arguments);q.getImageFromBundles=-function(x){return f.getImageUrl(x)};return q};this.graphConfig.move&&(U.isMoveCellsEvent=function(q){return!0});mxUtils.setPrefixedStyle(c.style,"border-radius","4px");c.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(U,C);window.setTimeout(mxUtils.bind(this,function(){try{mxEvent.addListener(m,"click",function(){C.destroy()});c.style.outline="none";c.style.zIndex=this.lightboxZIndex;p.style.zIndex=this.lightboxZIndex;null!=b?(b.innerHTML=-"",b.appendChild(c)):(document.body.appendChild(c),document.body.appendChild(p));C.setFileData(this.xml);if(this.tagsEnabled&&null!=this.graphConfig.hiddenTags&&null!=C.currentPage){var q=C.currentPage.getId(),x=this.graphConfig.hiddenTags[q];U.hiddenTags=null!=x&&0<x.length?x:[];U.refresh()}mxUtils.setPrefixedStyle(c.style,"transform","rotateY(0deg)");C.chromelessToolbar.style.bottom="60px";C.chromelessToolbar.style.zIndex=this.lightboxZIndex;(b||document.body).appendChild(C.chromelessToolbar);C.getEditBlankXml=-mxUtils.bind(this,function(){return this.xml});this.showLayers(U,this.graph);C.lightboxFit();C.chromelessResize();null!=d&&U.applyBrowserTranslationCache(d)}catch(B){C.handleError(B,null,function(){C.destroy()})}}),0);return C};Dialog.prototype.getDocumentSize=function(){return new mxRectangle(0,0,Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0))};+var B=new EditorUi(new Editor(!0),document.createElement("div"),!0);this.addListener("darkModeChanged",u);B.editor.editBlankUrl=this.editBlankUrl;B.refresh=function(){};var P=mxUtils.bind(this,function(q){27==q.keyCode&&B.destroy()}),G=this.initialOverflow,O=B.destroy;B.destroy=function(){null==b&&(mxEvent.removeListener(document.documentElement,"keydown",P),document.body.removeChild(m),document.body.removeChild(p),document.body.style.overflow=G,GraphViewer.resizeSensorEnabled=!0,O.apply(this,arguments))};+var U=B.editor.graph;this.browserTranslate&&U.waitForBrowserTranslate();var c=U.container;c.style.overflow="hidden";c.style.inset="0";this.lightboxChrome&&null==b?(c.style.border="1px solid #c0c0c0",c.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",P)):(m.style.display="none",p.style.display="none");var f=this;U.getImageFromBundles=function(q){return f.getImageUrl(q)};var k=B.createTemporaryGraph;B.createTemporaryGraph=function(){var q=k.apply(this,arguments);q.getImageFromBundles=+function(x){return f.getImageUrl(x)};return q};this.graphConfig.move&&(U.isMoveCellsEvent=function(q){return!0});mxUtils.setPrefixedStyle(c.style,"border-radius","4px");c.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(U,B);window.setTimeout(mxUtils.bind(this,function(){try{mxEvent.addListener(m,"click",function(){B.destroy()});c.style.outline="none";c.style.zIndex=this.lightboxZIndex;p.style.zIndex=this.lightboxZIndex;null!=b?(b.innerHTML=+"",b.appendChild(c)):(document.body.appendChild(c),document.body.appendChild(p));B.setFileData(this.xml);if(this.tagsEnabled&&null!=this.graphConfig.hiddenTags&&null!=B.currentPage){var q=B.currentPage.getId(),x=this.graphConfig.hiddenTags[q];U.hiddenTags=null!=x&&0<x.length?x:[];U.refresh()}mxUtils.setPrefixedStyle(c.style,"transform","rotateY(0deg)");B.chromelessToolbar.style.bottom="60px";B.chromelessToolbar.style.zIndex=this.lightboxZIndex;(b||document.body).appendChild(B.chromelessToolbar);B.getEditBlankXml=+mxUtils.bind(this,function(){return this.xml});this.showLayers(U,this.graph);B.lightboxFit();B.chromelessResize();null!=d&&U.applyBrowserTranslationCache(d)}catch(C){B.handleError(C,null,function(){B.destroy()})}}),0);return B};Dialog.prototype.getDocumentSize=function(){return new mxRectangle(0,0,Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0))};GraphViewer.prototype.updateTitle=function(b,d){b=b||"";this.showTitleAsTooltip&&null!=this.graph&&null!=this.graph.container&&this.graph.container.setAttribute("title",d||b);null!=this.filename&&(this.filename.innerText="",mxUtils.write(this.filename,b),this.filename.setAttribute("title",d||b))};GraphViewer.processElements=function(b){mxUtils.forEach(GraphViewer.getElementsByClassName(b||"mxgraph"),function(d){try{d.innerText="",GraphViewer.createViewerForElement(d)}catch(m){d.innerText=m.message,null!=window.console&&console.error(m)}})};-GraphViewer.getElementsByClassName=function(b){if(document.getElementsByClassName){var d=document.getElementsByClassName(b);b=[];for(var m=0;m<d.length;m++)b.push(d[m]);return b}var p=document.getElementsByTagName("*");d=[];for(m=0;m<p.length;m++){var v=p[m].className;null!=v&&0<v.length&&(v=v.split(" "),0<=mxUtils.indexOf(v,b)&&d.push(p[m]))}return d};-GraphViewer.createViewerForElement=function(b,d){var m=b.getAttribute("data-mxgraph");if(null!=m){var p=JSON.parse(m),v=function(n){n=mxUtils.parseXml(n);n=new GraphViewer(b,n.documentElement,p);null!=d&&d(n)};null!=p.url?GraphViewer.getUrl(p.url,function(n){v(n)}):v(p.xml)}};+GraphViewer.getElementsByClassName=function(b){if(document.getElementsByClassName){var d=document.getElementsByClassName(b);b=[];for(var m=0;m<d.length;m++)b.push(d[m]);return b}var p=document.getElementsByTagName("*");d=[];for(m=0;m<p.length;m++){var u=p[m].className;null!=u&&0<u.length&&(u=u.split(" "),0<=mxUtils.indexOf(u,b)&&d.push(p[m]))}return d};+GraphViewer.createViewerForElement=function(b,d){var m=b.getAttribute("data-mxgraph");if(null!=m){var p=JSON.parse(m),u=function(n){n=mxUtils.parseXml(n);n=new GraphViewer(b,n.documentElement,p);null!=d&&d(n)};null!=p.url?GraphViewer.getUrl(p.url,function(n){u(n)}):u(p.xml)}};GraphViewer.blockedAncestorFrames=function(){try{if(window.location.ancestorOrigins&&window.location.hostname&&window.location.ancestorOrigins.length&&0<window.location.ancestorOrigins.length){var b=window.location.hostname;b&&1<b.length&&"/"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1));for(var d="",m=0;m<window.location.ancestorOrigins.length;m++)if(d+=" -> "+window.location.ancestorOrigins[m],d.endsWith("dan6v7pm1f1a1.cloudfront.net")||d.endsWith("confluence-cloud-excalidraw-ll3likebca-uc.a.run.app"))return!0;(b.endsWith("ac.draw.io")||b.endsWith("aj.draw.io"))&&1==window.location.ancestorOrigins.length&&window.location.ancestorOrigins[0]&&window.location.ancestorOrigins[0].endsWith(".atlassian.net")}}catch(p){}return!1};GraphViewer.darkBackgroundColor=Editor.darkColor;GraphViewer.cssFontFamily=Editor.defaultHtmlFont;GraphViewer.shapeBackgroundColor=null;GraphViewer.viewerInitialized=function(b){};GraphViewer.initCss=function(){try{null==GraphViewer.styleElement&&(GraphViewer.styleElement=document.createElement("style"),GraphViewer.styleElement.setAttribute("type","text/css"),GraphViewer.styleElement.innerHTML=GraphViewer.getCss(),GraphViewer.blockedAncestorFrames()||document.getElementsByTagName("head")[0].appendChild(GraphViewer.styleElement))}catch(b){}};@@ -4917,9 +4920,9 @@ GraphViewer.getCss=function(){return[".geDarkMode img {\n filter: invert(1);\"\t z-index: "+(GraphViewer.prototype.lightboxZIndex+2)+";","}\n.geBackground {"," background-color: light-dark(#ffffff, "+GraphViewer.darkBackgroundColor+");","\t position: fixed;\n left: 0px;\n top: 0px;\n right: 0px;\n bottom: 0px;\n opacity: 0.9;","\t z-index: "+(GraphViewer.prototype.lightboxZIndex+1)+";","}\n.geDialogTitle {\n box-sizing: border-box;\n white-space: nowrap;"," background: light-dark(#f1f3f4, "+GraphViewer.darkBackgroundColor+");"," border-bottom: 1px solid rgb(192, 192, 192);\n font-size: 15px;\n font-weight: bold;\n text-align: center;\n color: rgb(35, 86, 149);\n}\n.geDialogFooter {"," background: light-dark(#f1f3f4, "+GraphViewer.darkBackgroundColor+");"," white-space: nowrap;\n text-align: right;\n box-sizing: border-box;\n border-top: 1px solid #e5e5e5;\n color: darkGray;\n}\n.geHelpIcon {\n width: 16px;\n margin: 0 4px;\n vertical-align: text-bottom;\n}\n.geBtn, .mxWindow .geBtn {\n background-color: light-dark(#eeeeee, #1b1d1e);\n border: 1px solid light-dark(#d8d8d8, #333333);\n color: light-dark(#3f3f3f, #c0c0c0);\n font-size: 13px;\n font-weight: 500;\n border-radius: 4px;\n height: 30px;\n margin: 0 0 0 8px;\n min-width: 72px;\n outline: 0;\n padding: 0 8px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n.geBtn:hover:not(.gePrimaryBtn), .geBtn:focus {\n border: 1px solid light-dark(#c6c6c6, #333333);\n background: light-dark(#dadada, #333333);\n}\n.geBtn:disabled {\n opacity: .5;\n}\n.gePrimaryBtn {\n background: linear-gradient(light-dark(#4d90fe, #003555) 0px, light-dark(#4787ed, #003555) 100%);\n border: 1px solid light-dark(#3079ed, transparent);\n color: light-dark(#ffffff, #c0c0c0);\n}\n.gePrimaryBtn:hover:not([disabled]) {\n background: linear-gradient(light-dark(#4d90fe, #004a77) 0px, light-dark(#357ae8, #004a77) 100%);\n border: 1px solid light-dark(#2f5bb7, transparent);\n}\n.geBtn:disabled {\n opacity: .5;\n}"].join("\n")};GraphViewer.cachedUrls={};GraphViewer.getUrl=function(b,d,m){if(null!=GraphViewer.cachedUrls[b])d(GraphViewer.cachedUrls[b]);else{var p=null!=navigator.userAgent&&0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;p.open("GET",b);p.onload=function(){d(null!=p.getText?p.getText():p.responseText)};p.onerror=m;p.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeObserver=!0;GraphViewer.useResizeSensor=!0;-(function(){var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(m){return window.setTimeout(m,20)},d=function(m,p){function v(){this.q=[];this.add=function(q){this.q.push(q)};var f,k;this.call=function(){f=0;for(k=this.q.length;f<k;f++)this.q[f].call()}}function n(f,k){return f.currentStyle?f.currentStyle[k]:window.getComputedStyle?window.getComputedStyle(f,null).getPropertyValue(k):f.style[k]}function y(f,k){if(!f.resizedAttached)f.resizedAttached=-new v,f.resizedAttached.add(k);else if(f.resizedAttached){f.resizedAttached.add(k);return}f.resizeSensor=document.createElement("div");f.resizeSensor.className="resize-sensor";f.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";f.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>';-f.appendChild(f.resizeSensor);"static"==n(f,"position")&&(f.style.position="relative");var q=f.resizeSensor.childNodes[0],x=q.childNodes[0],B=f.resizeSensor.childNodes[1],E=function(){x.style.width="100000px";x.style.height="100000px";q.scrollLeft=1E5;q.scrollTop=1E5;B.scrollLeft=1E5;B.scrollTop=1E5};E();var L=!1,Q=function(){f.resizedAttached&&(L&&(f.resizedAttached.call(),L=!1),b(Q))};b(Q);var V,K,fa,aa;k=function(){if((fa=f.offsetWidth)!=V||(aa=f.offsetHeight)!=K)L=!0,V=fa,K=aa;E()};var da=function(ba,-ha,qa){ba.attachEvent?ba.attachEvent("on"+ha,qa):ba.addEventListener(ha,qa)};da(q,"scroll",k);da(B,"scroll",k)}var C=function(){GraphViewer.resizeSensorEnabled&&p()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var P=null,G=!1;(new ResizeObserver(function(){G||(null!=P&&window.clearTimeout(P),P=window.setTimeout(function(){G=!0;C();P=null;G=!1},200))})).observe(m)}else{var O=Object.prototype.toString.call(m),U="[object Array]"===O||"[object NodeList]"===O||"[object HTMLCollection]"===-O||"undefined"!==typeof jQuery&&m instanceof jQuery||"undefined"!==typeof Elements&&m instanceof Elements;if(U){O=0;for(var c=m.length;O<c;O++)y(m[O],C)}else y(m,C);this.detach=function(){if(U)for(var f=0,k=m.length;f<k;f++)d.detach(m[f]);else d.detach(m)}}};d.detach=function(m){m.resizeSensor&&(m.removeChild(m.resizeSensor),delete m.resizeSensor,delete m.resizedAttached)};window.ResizeSensor=d})();+(function(){var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(m){return window.setTimeout(m,20)},d=function(m,p){function u(){this.q=[];this.add=function(q){this.q.push(q)};var f,k;this.call=function(){f=0;for(k=this.q.length;f<k;f++)this.q[f].call()}}function n(f,k){return f.currentStyle?f.currentStyle[k]:window.getComputedStyle?window.getComputedStyle(f,null).getPropertyValue(k):f.style[k]}function y(f,k){if(!f.resizedAttached)f.resizedAttached=+new u,f.resizedAttached.add(k);else if(f.resizedAttached){f.resizedAttached.add(k);return}f.resizeSensor=document.createElement("div");f.resizeSensor.className="resize-sensor";f.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";f.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>';+f.appendChild(f.resizeSensor);"static"==n(f,"position")&&(f.style.position="relative");var q=f.resizeSensor.childNodes[0],x=q.childNodes[0],C=f.resizeSensor.childNodes[1],E=function(){x.style.width="100000px";x.style.height="100000px";q.scrollLeft=1E5;q.scrollTop=1E5;C.scrollLeft=1E5;C.scrollTop=1E5};E();var L=!1,Q=function(){f.resizedAttached&&(L&&(f.resizedAttached.call(),L=!1),b(Q))};b(Q);var V,K,fa,aa;k=function(){if((fa=f.offsetWidth)!=V||(aa=f.offsetHeight)!=K)L=!0,V=fa,K=aa;E()};var da=function(ba,+ha,qa){ba.attachEvent?ba.attachEvent("on"+ha,qa):ba.addEventListener(ha,qa)};da(q,"scroll",k);da(C,"scroll",k)}var B=function(){GraphViewer.resizeSensorEnabled&&p()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var P=null,G=!1;(new ResizeObserver(function(){G||(null!=P&&window.clearTimeout(P),P=window.setTimeout(function(){G=!0;B();P=null;G=!1},200))})).observe(m)}else{var O=Object.prototype.toString.call(m),U="[object Array]"===O||"[object NodeList]"===O||"[object HTMLCollection]"===+O||"undefined"!==typeof jQuery&&m instanceof jQuery||"undefined"!==typeof Elements&&m instanceof Elements;if(U){O=0;for(var c=m.length;O<c;O++)y(m[O],B)}else y(m,B);this.detach=function(){if(U)for(var f=0,k=m.length;f<k;f++)d.detach(m[f]);else d.detach(m)}}};d.detach=function(m){m.resizeSensor&&(m.removeChild(m.resizeSensor),delete m.resizeSensor,delete m.resizedAttached)};window.ResizeSensor=d})();(function(){Editor.initMath();if(null!=window.onDrawioViewerLoad)window.onDrawioViewerLoad();else GraphViewer.processElements()})();diff --git a/src/main/webapp/mxgraph/mxClient.js b/src/main/webapp/mxgraph/mxClient.jsindex 981393028..331b56f8f 100644--- a/src/main/webapp/mxgraph/mxClient.js+++ b/src/main/webapp/mxgraph/mxClient.js@@ -1,4 +1,4 @@-var mxClient={VERSION:"30.3.13",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&+var mxClient={VERSION:"30.3.14",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&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."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),IS_MT:0<=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."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!==document.createElementNS("http://www.w3.org/2000/svg","foreignObject").toString()||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),@@ -342,9 +342,9 @@ mxSvgCanvas2D.prototype.getAlternateTextLines=function(a,b,c,d,e,f){var g=this.sa[m].split(/\s+/),p="",q=0;q<n.length;q++)if(0<n[q].length){var r=0<p.length?p+" "+n[q]:n[q];0<p.length&&l.measureText(r).width>k?(b.push(p),p=n[q]):p=r;for(;1<p.length&&l.measureText(p).width>k&&/[\u2E80-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF]/.test(p);){for(r=p.length-1;1<r&&l.measureText(p.substring(0,r)).width>k;)r--;b.push(p.substring(0,r));p=p.substring(r)}}b.push(p)}a=b}(f||"fill"==e)&&0<c&&(c=Math.max(1,Math.floor(c/Math.round(mxConstants.LINE_HEIGHT*g.fontSize))),a.length>c&&(a=a.slice(0,c),a[a.length-1]+="..."));if(f&&!d&&null!=l)for(m=0;m<a.length;m++)if(l.measureText(a[m]).width>k){for(r=a[m].length-1;1<r&&l.measureText(a[m].substring(0,r)+"...").width>k;)r--;a[m]=mxUtils.trim(a[m].substring(0,r))+"..."}return a};mxSvgCanvas2D.prototype.createAlternateContent=function(a,b,c,d,e,f,g,k,l,m,n,p,q){m=this.getAlternateText(a,b,c,d,e,f,g,k,l,m,n,p,q);a=this.state;if(null!=m&&0<a.fontSize){f=k==mxConstants.ALIGN_TOP?1:k==mxConstants.ALIGN_BOTTOM?0:.3;g=g==mxConstants.ALIGN_RIGHT?"end":g==mxConstants.ALIGN_LEFT?"start":"middle";d=this.getAlternateTextLines(m,d,e,l,n,p);e=Math.round(mxConstants.LINE_HEIGHT*a.fontSize);b=Math.round(b+a.dx);c=c+a.dy+f*a.fontSize-(k==mxConstants.ALIGN_TOP?0:k==mxConstants.ALIGN_BOTTOM?-(d.length-1)*e:(d.length-1)*e/2);k=this.createElement("text");k.setAttribute("x",b);k.setAttribute("y",Math.round(c));k.setAttribute("fill",a.fontColor||"black");k.setAttribute("font-family",mxUtils.parseCssFontFamily(a.fontFamily));k.setAttribute("font-size",Math.round(a.fontSize)+"px");"start"!=g&&k.setAttribute("text-anchor",g);(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&k.setAttribute("font-weight","bold");(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&k.setAttribute("font-style",-"italic");l=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&l.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&l.push("line-through");0<l.length&&(k.setAttribute("text-decoration",l.join(" ")),(a.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(k.style.textDecorationStyle="dotted"));if(1<d.length)for(a=0;a<d.length;a++)l=this.createElement("tspan"),l.setAttribute("x",b),l.setAttribute("y",Math.round(c+-a*e)),mxUtils.write(l,d[a]),k.appendChild(l);else mxUtils.write(k,d[0]);return k}return null};+(d.length-1)*e:(d.length-1)*e/2);l=this.getLightDarkColor(a.fontColor||"black");k=this.createElement("text");k.setAttribute("x",b);k.setAttribute("y",Math.round(c));"transparent"==l.light?k.setAttribute("fill","none"):(k.setAttribute("fill",l.light),k.style.fill=l.cssText);k.setAttribute("font-family",mxUtils.parseCssFontFamily(a.fontFamily));k.setAttribute("font-size",Math.round(a.fontSize)+"px");"start"!=g&&k.setAttribute("text-anchor",g);(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&+k.setAttribute("font-weight","bold");(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&k.setAttribute("font-style","italic");g=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&g.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&g.push("line-through");0<g.length&&(k.setAttribute("text-decoration",g.join(" ")),(a.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(k.style.textDecorationStyle=+"dotted"));if(1<d.length)for(a=0;a<d.length;a++)g=this.createElement("tspan"),g.setAttribute("x",b),g.setAttribute("y",Math.round(c+a*e)),mxUtils.write(g,d[a]),k.appendChild(g);else mxUtils.write(k,d[0]);return k}return null};mxSvgCanvas2D.prototype.createGradientId=function(a,b,c,d,e){a=a.toLowerCase()+"-"+c;b=b.toLowerCase()+"-"+d;c=null;null==e||e==mxConstants.DIRECTION_SOUTH?c="s":e==mxConstants.DIRECTION_EAST?c="e":e==mxConstants.DIRECTION_RADIAL?c="r":(d=a,a=b,b=d,e==mxConstants.DIRECTION_NORTH?c="s":e==mxConstants.DIRECTION_WEST&&(c="e"));return((""!=this.idPrefix?this.idPrefix:"mx")+"-gradient-"+a+"-"+b+"-"+c).replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};mxSvgCanvas2D.prototype.getSvgGradient=function(a,b,c,d,e){a=this.getLightDarkColor(a);b=this.getLightDarkColor(b);var f=this.createGradientId(a.cssText,b.cssText,c,d,e),g=this.gradients[f];if(null==g){var k=this.root.ownerSVGElement,l=0,m=f+"-"+l;if(null!=k)for(g=k.ownerDocument.getElementById(m);null!=g&&g.ownerSVGElement!=k;)m=f+"-"+l++,g=k.ownerDocument.getElementById(m);else m="id"+ ++this.refCount;null==g&&(g=this.createSvgGradient(a,b,c,d,e),g.setAttribute("id",m),null!=this.defs?this.defs.appendChild(g):k.appendChild(g));this.gradients[f]=g}return g.getAttribute("id")};@@ -367,8 +367,8 @@ mxSvgCanvas2D.prototype.addNode=function(a,b){var c=this.addTitle(this.node),d=tc.setAttribute("transform",d.transform);this.pointerEvents?c.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none");0<this.strokeTolerance&&(!a||null==d.fillColor||!mxShape.forceFilledPointerEvents&&!this.pointerEvents&&null==this.originalRoot)&&this.addTolerance(c);("rect"!=c.nodeName&&"path"!=c.nodeName&&"ellipse"!=c.nodeName||"none"!=c.getAttribute("fill")&&"transparent"!=c.getAttribute("fill")||"none"!=c.getAttribute("stroke")||"none"!=c.getAttribute("pointer-events"))&&this.root.appendChild(c);this.node=null}};mxSvgCanvas2D.prototype.getShadowFilter=function(){var a=this.state,b=a.shadowStyle;if(1!=a.scale){var c=b.split("(");if(0<c.length){var d=c[1].split(" ");3<d.length&&(b=function(e){return Math.round(parseFloat(d[e])*a.scale*100)/100+"px"},b=c[0]+"("+b(0)+" "+b(1)+" "+b(2)+" "+d.slice(3).join(" ")+(2<c.length?"("+c.slice(2).join("("):""))}}return b};mxSvgCanvas2D.prototype.addTolerance=function(a){this.root.appendChild(this.createTolerance(a))};mxSvgCanvas2D.prototype.updateFill=function(){var a=this.state;(1>a.alpha||1>a.fillAlpha)&&this.node.setAttribute("fill-opacity",a.alpha*a.fillAlpha);var b=!1;if(null!=a.fillColor)if(null!=a.gradientColor&&a.gradientColor!=mxConstants.NONE){b=!0;var c=this.getSvgGradient(String(a.fillColor),String(a.gradientColor),a.gradientFillAlpha,a.gradientAlpha,a.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c="url("+d+"#"+c+-")"}else c="url(#"+c+")";d=c}else c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText;var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill",-"url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};+")"}else c="url(#"+c+")";d=c}else String(a.fillColor).toLowerCase()==mxConstants.NONE?c=d="none":(c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText);var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,+"\\$1"),this.node.setAttribute("fill","url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};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 a=this.state,b=this.getLightDarkColor(String(a.strokeColor).toLowerCase());this.node.setAttribute("stroke",b.light);this.node.style.stroke=b.cssText;(1>a.alpha||1>a.strokeAlpha)&&this.node.setAttribute("stroke-opacity",a.alpha*a.strokeAlpha);b=this.getCurrentStrokeWidth();1!=b&&this.node.setAttribute("stroke-width",b);"path"==this.node.nodeName&&this.updateStrokeAttributes();a.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((a.fixDash?1:a.strokeWidth)*a.scale))};mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var a=this.state;null!=a.lineJoin&&"miter"!=a.lineJoin&&this.node.setAttribute("stroke-linejoin",a.lineJoin);if(null!=a.lineCap){var b=a.lineCap;"flat"==b&&(b="butt");"butt"!=b&&this.node.setAttribute("stroke-linecap",b)}null==a.miterLimit||this.styleEnabled&&10==a.miterLimit||this.node.setAttribute("stroke-miterlimit",a.miterLimit)};mxSvgCanvas2D.prototype.createDashPattern=function(a){var b=[];if("string"===typeof this.state.dashPattern){var c=this.state.dashPattern.split(" ");if(0<c.length)for(var d=0;d<c.length;d++)b[d]=Math.round(Number(c[d])*a*100)/100}return b.join(" ")};diff --git a/src/main/webapp/mxgraph/src/util/mxSvgCanvas2D.js b/src/main/webapp/mxgraph/src/util/mxSvgCanvas2D.jsindex c4410e7c3..6355391a9 100644--- a/src/main/webapp/mxgraph/src/util/mxSvgCanvas2D.js+++ b/src/main/webapp/mxgraph/src/util/mxSvgCanvas2D.js@@ -580,10 +580,25 @@ mxSvgCanvas2D.prototype.createAlternateContent = function(fo, x, y, w, h, str, a((valign == mxConstants.ALIGN_BOTTOM) ? (lines.length - 1) * lh :(lines.length - 1) * lh / 2));+ var cssFontColor = this.getLightDarkColor(s.fontColor || 'black');var alt = this.createElement('text');alt.setAttribute('x', x0);alt.setAttribute('y', Math.round(y0));- alt.setAttribute('fill', s.fontColor || 'black');++ // Alternate content is rendered in viewers with no support for+ // light-dark colors so the fill attribute must be a plain color,+ // using none for transparent as it is not a valid paint value+ // in SVG 1.1 and renders black in Inkscape and PowerPoint+ if (cssFontColor.light == 'transparent')+ {+ alt.setAttribute('fill', 'none');+ }+ else+ {+ alt.setAttribute('fill', cssFontColor.light);+ alt.style.fill = cssFontColor.cssText;+ }+alt.setAttribute('font-family', mxUtils.parseCssFontFamily(s.fontFamily));alt.setAttribute('font-size', Math.round(s.fontSize) + 'px');@@ -1227,6 +1242,14 @@ mxSvgCanvas2D.prototype.updateFill = function()lightFill = fill;}+ else if (String(s.fillColor).toLowerCase() == mxConstants.NONE)+ {+ // NONE reaches this point via setGradient. Uses none as+ // transparent is not a valid paint value in SVG 1.1 and+ // renders black in Inkscape and PowerPoint+ lightFill = 'none';+ fill = 'none';+ }else{var cssFill = this.getLightDarkColor(String(s.fillColor).toLowerCase());diff --git a/src/main/webapp/service-worker.js b/src/main/webapp/service-worker.jsindex 6bf6ee1d3..738df6170 100644--- a/src/main/webapp/service-worker.js+++ b/src/main/webapp/service-worker.js@@ -19,26 +19,26 @@ self.skipWaiting();var MANIFEST = [{"url":"js/bootstrap.js","revision":"16f03bfd427b13a3d96b08b5069b99aa"},{"url":"js/main.js","revision":"a8d40469d3d72ab4b11059362f3dd825"},- {"url":"js/app.min.js","revision":"276b8ee9d351e26b5835c0e2c040c934"},+ {"url":"js/app.min.js","revision":"6f90def4fcc5bef9e4ac03de2bc41522"},{"url":"js/extensions.min.js","revision":"42d45475625e549e89d496abe56e264e"},{"url":"js/plantuml/drawio-plantuml.min.js","revision":"64348263302fd084d028d59b2b18525a"},{"url":"js/orgchart.min.js","revision":"619d8c4dab47b81868916df31f55478b"},- {"url":"js/stencils.min.js","revision":"ac781e5356333fdb863335067d843772"},+ {"url":"js/stencils.min.js","revision":"ffca5e4bdda3e151aab9b88cf26e7404"},{"url":"js/shapes-14-6-5.min.js","revision":"e068391c33741282abcd270d163e30bc"},{"url":"js/math-print.js","revision":"ad9cf0f2f2b614eac58ea72499c1017f"},- {"url":"index.html","revision":"9de11c65ec13b24c73ace7042bc529cc-30.3.13"},- {"url":"open.html","revision":"d71816b3b00e769fc6019fcdd6921662-30.3.13"},+ {"url":"index.html","revision":"9de11c65ec13b24c73ace7042bc529cc-30.3.14"},+ {"url":"open.html","revision":"d71816b3b00e769fc6019fcdd6921662-30.3.14"},{"url":"shortcuts.svg","revision":"2381dd779ce6cfee954042a7f784c7e6"},{"url":"styles/fonts/ArchitectsDaughter-Regular.ttf","revision":"31c2153c0530e32553b31a49b3d70736"},{"url":"styles/grapheditor.css","revision":"34c00fcbd3c6fa6b6220d085e0a40833"},{"url":"styles/high-contrast.css","revision":"0c0219b1016c8bd6bbf859cfd53b5058"},{"url":"js/dropbox/Dropbox-sdk.min.js","revision":"4b9842892aa37b156db0a8364b7a83b0"},{"url":"js/onedrive/OneDrive.js","revision":"e863f5e6833892f22492211663e3efe9"},- {"url":"js/viewer-static.min.js","revision":"209031b660a6d8052420ce6acbcd170d"},- {"url":"connect/jira/editor-1-3-3.html","revision":"41dc8af9576b47f359cff19fff7a41c2-30.3.13"},- {"url":"connect/jira/viewerPanel-1-3-12.html","revision":"4836f5e4308abe57830e441518364f23-30.3.13"},- {"url":"connect/jira/viewerPanel2.html","revision":"0dd1ee1343a46b5c03aedbc587450b84-30.3.13"},- {"url":"connect/jira/fullScreenViewer-1-3-3.html","revision":"abed474e47c0c41a5ad2366b4828f77a-30.3.13"},+ {"url":"js/viewer-static.min.js","revision":"877e98025d03bd5c0cfa8dab36275d6c"},+ {"url":"connect/jira/editor-1-3-3.html","revision":"41dc8af9576b47f359cff19fff7a41c2-30.3.14"},+ {"url":"connect/jira/viewerPanel-1-3-12.html","revision":"4836f5e4308abe57830e441518364f23-30.3.14"},+ {"url":"connect/jira/viewerPanel2.html","revision":"0dd1ee1343a46b5c03aedbc587450b84-30.3.14"},+ {"url":"connect/jira/fullScreenViewer-1-3-3.html","revision":"abed474e47c0c41a5ad2366b4828f77a-30.3.14"},{"url":"connect/jira/viewerPanel.js","revision":"85011efa68d638da560871ee2ab3a6fe"},{"url":"connect/jira/spinner.gif","revision":"7d857ab9d86123e93d74d48e958fe743"},{"url":"connect/jira/editor.js","revision":"3dc56c6566abaa7af151a8359e5bb556"},@@ -53,10 +53,10 @@ var MANIFEST = [{"url":"connect/onedrive_common/ac.js","revision":"1264ba8705eff0d1337701e5ae962366"},{"url":"connect/confluence/viewer-init.js","revision":"c5e51e32ac74414d8d518af83ee2781f"},{"url":"connect/confluence/viewer.js","revision":"9128708cd80881dbf6caa06f2c4ebda8"},- {"url":"connect/confluence/viewer-1-4-42.html","revision":"69c1bca25fd4889bf832e8441c972268-30.3.13"},- {"url":"connect/confluence/macroEditor-1-4-8.html","revision":"4ad77ae3f08c19eddac932b2fa8c7068-30.3.13"},+ {"url":"connect/confluence/viewer-1-4-42.html","revision":"69c1bca25fd4889bf832e8441c972268-30.3.14"},+ {"url":"connect/confluence/macroEditor-1-4-8.html","revision":"4ad77ae3f08c19eddac932b2fa8c7068-30.3.14"},{"url":"connect/confluence/includeDiagram-1-4-8.js","revision":"c2bf5b089b99006177ca184d65a4a25e"},- {"url":"connect/confluence/includeDiagram.html","revision":"01b04b3f54f1e2e63fcf1df033d24519-30.3.13"},+ {"url":"connect/confluence/includeDiagram.html","revision":"01b04b3f54f1e2e63fcf1df033d24519-30.3.14"},{"url":"connect/confluence/macro-editor.js","revision":"b9000d6c20f30e4068f83bd0b56965ca"},{"url":"math4/es5/ui/safe.js","revision":"70818a3a0b12f623d08897c6db834920"},{"url":"math4/es5/core.js","revision":"dc3ca1e12b086e5ab44e588a7cb6ebb3"},diff --git a/src/main/webapp/stencils/electrical/mosfets1.xml b/src/main/webapp/stencils/electrical/mosfets1.xmlindex 37b2be637..a0c37e858 100644--- a/src/main/webapp/stencils/electrical/mosfets1.xml+++ b/src/main/webapp/stencils/electrical/mosfets1.xml@@ -177,6 +177,68 @@<fillstroke/></foreground></shape>+ <shape aspect="variable" h="110" name="MOSFET IC N Body Diode" strokewidth="inherit" w="100">+ <connections>+ <constraint name="G" perimeter="0" x="0" y="0.7182"/>+ <constraint name="D" perimeter="0" x="0.7" y="0"/>+ <constraint name="S" perimeter="0" x="0.7" y="1"/>+ </connections>+ <background>+ <ellipse h="90" w="90" x="10" y="10"/>+ </background>+ <foreground>+ <fillstroke/>+ <path>+ <move x="79" y="44.5"/>+ <line x="95" y="44.5"/>+ <move x="80" y="60"/>+ <line x="94" y="60"/>+ <line x="87" y="45"/>+ <close/>+ </path>+ <fillstroke/>+ <path>+ <move x="87" y="44.5"/>+ <line x="87" y="25"/>+ <line x="70" y="25"/>+ <move x="87" y="60"/>+ <line x="87" y="85"/>+ <line x="70" y="85"/>+ </path>+ <stroke/>+ <path>+ <move x="45" y="35"/>+ <line x="70" y="35"/>+ <line x="70" y="0"/>+ <move x="0" y="79"/>+ <line x="42" y="79"/>+ <line x="42" y="30.5"/>+ <move x="45" y="55"/>+ <line x="70" y="55"/>+ <line x="70" y="110"/>+ <move x="45" y="75"/>+ <line x="70" y="75"/>+ </path>+ <stroke/>+ <path>+ <move x="60.5" y="50"/>+ <line x="46" y="55"/>+ <line x="60.5" y="60"/>+ <close/>+ </path>+ <fillstroke/>+ <strokewidth width="2"/>+ <path>+ <move x="45" y="50"/>+ <line x="45" y="60"/>+ <move x="45" y="70"/>+ <line x="45" y="80"/>+ <move x="45" y="30"/>+ <line x="45" y="40"/>+ </path>+ <fillstroke/>+ </foreground>+ </shape><shape aspect="variable" h="110" name="MOSFET IC P" strokewidth="inherit" w="100"><connections><constraint name="G" perimeter="0" x="0" y="0.7182"/>@@ -221,6 +283,68 @@<fillstroke/></foreground></shape>+ <shape aspect="variable" h="110" name="MOSFET IC P Body Diode" strokewidth="inherit" w="100">+ <connections>+ <constraint name="G" perimeter="0" x="0" y="0.7182"/>+ <constraint name="D" perimeter="0" x="0.7" y="0"/>+ <constraint name="S" perimeter="0" x="0.7" y="1"/>+ </connections>+ <background>+ <ellipse h="90" w="90" x="10" y="10"/>+ </background>+ <foreground>+ <fillstroke/>+ <path>+ <move x="79" y="60"/>+ <line x="95" y="60"/>+ <move x="80" y="45"/>+ <line x="94" y="45"/>+ <line x="87" y="59"/>+ <close/>+ </path>+ <fillstroke/>+ <path>+ <move x="87" y="45"/>+ <line x="87" y="25"/>+ <line x="70" y="25"/>+ <move x="87" y="60"/>+ <line x="87" y="85"/>+ <line x="70" y="85"/>+ </path>+ <stroke/>+ <path>+ <move x="45" y="35"/>+ <line x="70" y="35"/>+ <line x="70" y="0"/>+ <move x="45" y="55"/>+ <line x="70" y="55"/>+ <line x="70" y="110"/>+ <move x="45" y="75"/>+ <line x="70" y="75"/>+ <move x="0" y="79"/>+ <line x="42" y="79"/>+ <line x="42" y="30.5"/>+ </path>+ <stroke/>+ <path>+ <move x="54" y="50"/>+ <line x="69" y="55"/>+ <line x="54" y="60"/>+ <close/>+ </path>+ <fillstroke/>+ <strokewidth width="2"/>+ <path>+ <move x="45" y="30"/>+ <line x="45" y="40"/>+ <move x="45" y="50"/>+ <line x="45" y="60"/>+ <move x="45" y="70"/>+ <line x="45" y="80"/>+ </path>+ <fillstroke/>+ </foreground>+ </shape><shape aspect="variable" h="110" name="MOSFET N No Bulk" strokewidth="inherit" w="100"><connections><constraint name="G" perimeter="0" x="0" y="0.5"/>